diff --git a/examples/01.HelloWorld/HelloWorld.cbp b/examples/01.HelloWorld/HelloWorld.cbp deleted file mode 100644 index 1811e4a8..00000000 --- a/examples/01.HelloWorld/HelloWorld.cbp +++ /dev/null @@ -1,58 +0,0 @@ - - - - - - diff --git a/examples/01.HelloWorld/HelloWorld.vcproj b/examples/01.HelloWorld/HelloWorld.vcproj deleted file mode 100644 index 3a2fdb0e..00000000 --- a/examples/01.HelloWorld/HelloWorld.vcproj +++ /dev/null @@ -1,163 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/examples/01.HelloWorld/HelloWorld.xcodeproj/project.pbxproj b/examples/01.HelloWorld/HelloWorld.xcodeproj/project.pbxproj deleted file mode 100644 index c3c5eb5f..00000000 --- a/examples/01.HelloWorld/HelloWorld.xcodeproj/project.pbxproj +++ /dev/null @@ -1,290 +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 /* 01.HelloWorld.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = 01.HelloWorld.app; sourceTree = BUILT_PRODUCTS_DIR; }; - 5E34CC741B7F8EEF00F212E8 /* main.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = main.cpp; sourceTree = ""; }; - 5E34CC781B7F90A000F212E8 /* libIrrlicht.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libIrrlicht.a; path = ../../lib/OSX/libIrrlicht.a; sourceTree = ""; }; - 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 = ""; }; -/* 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 = ""; - }; - 5E34CC521B7F8E6E00F212E8 /* Products */ = { - isa = PBXGroup; - children = ( - 5E34CC511B7F8E6E00F212E8 /* 01.HelloWorld.app */, - ); - name = Products; - sourceTree = ""; - }; - 5E34CC761B7F905600F212E8 /* Libraries */ = { - isa = PBXGroup; - children = ( - 5E8570B01B7F99F500B267D2 /* Cocoa.framework */, - 5E8570B41B7F9A0700B267D2 /* IOKit.framework */, - 5E8570B21B7F99FE00B267D2 /* OpenGL.framework */, - 5E34CC781B7F90A000F212E8 /* libIrrlicht.a */, - ); - name = Libraries; - sourceTree = ""; - }; - 5E34CC771B7F906D00F212E8 /* Resources */ = { - isa = PBXGroup; - children = ( - 5E8570BE1B7F9D3A00B267D2 /* media */, - ); - name = Resources; - sourceTree = ""; - }; -/* End PBXGroup section */ - -/* Begin PBXNativeTarget section */ - 5E34CC501B7F8E6E00F212E8 /* 01.HelloWorld */ = { - isa = PBXNativeTarget; - buildConfigurationList = 5E34CC701B7F8E6E00F212E8 /* Build configuration list for PBXNativeTarget "01.HelloWorld" */; - buildPhases = ( - 5E34CC4D1B7F8E6E00F212E8 /* Sources */, - 5E34CC4E1B7F8E6E00F212E8 /* Frameworks */, - 5E34CC4F1B7F8E6E00F212E8 /* Resources */, - ); - buildRules = ( - ); - dependencies = ( - ); - name = 01.HelloWorld; - productName = 01.HelloWorld; - productReference = 5E34CC511B7F8E6E00F212E8 /* 01.HelloWorld.app */; - productType = "com.apple.product-type.application"; - }; -/* End PBXNativeTarget section */ - -/* Begin PBXProject section */ - 5E34C6D91B7F4A0C00F212E8 /* Project object */ = { - isa = PBXProject; - attributes = { - LastUpgradeCheck = 0710; - TargetAttributes = { - 5E34CC501B7F8E6E00F212E8 = { - CreatedOnToolsVersion = 6.1; - }; - }; - }; - buildConfigurationList = 5E34C6DC1B7F4A0C00F212E8 /* Build configuration list for PBXProject "HelloWorld" */; - compatibilityVersion = "Xcode 3.2"; - developmentRegion = English; - hasScannedForEncodings = 0; - knownRegions = ( - en, - Base, - ); - mainGroup = 5E34C6D81B7F4A0C00F212E8; - productRefGroup = 5E34CC521B7F8E6E00F212E8 /* Products */; - projectDirPath = ""; - projectRoot = ""; - targets = ( - 5E34CC501B7F8E6E00F212E8 /* 01.HelloWorld */, - ); - }; -/* 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++"; - ENABLE_TESTABILITY = YES; - GCC_C_LANGUAGE_STANDARD = c11; - 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++"; - GCC_C_LANGUAGE_STANDARD = c11; - 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 "HelloWorld" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 5E34C6DD1B7F4A0C00F212E8 /* Debug */, - 5E34C6DE1B7F4A0C00F212E8 /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - 5E34CC701B7F8E6E00F212E8 /* Build configuration list for PBXNativeTarget "01.HelloWorld" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 5E34CC6C1B7F8E6E00F212E8 /* Debug */, - 5E34CC6D1B7F8E6E00F212E8 /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; -/* End XCConfigurationList section */ - }; - rootObject = 5E34C6D91B7F4A0C00F212E8 /* Project object */; -} diff --git a/examples/01.HelloWorld/HelloWorld.xcodeproj/xcshareddata/xcschemes/01.HelloWorld.xcscheme b/examples/01.HelloWorld/HelloWorld.xcodeproj/xcshareddata/xcschemes/01.HelloWorld.xcscheme deleted file mode 100644 index ba196db3..00000000 --- a/examples/01.HelloWorld/HelloWorld.xcodeproj/xcshareddata/xcschemes/01.HelloWorld.xcscheme +++ /dev/null @@ -1,91 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/examples/01.HelloWorld/HelloWorld_vc10.vcxproj b/examples/01.HelloWorld/HelloWorld_vc10.vcxproj deleted file mode 100644 index 509ccbed..00000000 --- a/examples/01.HelloWorld/HelloWorld_vc10.vcxproj +++ /dev/null @@ -1,233 +0,0 @@ - - - - - Debug - Win32 - - - Debug - x64 - - - Release - Win32 - - - Release - x64 - - - - 01.HelloWorld - {5AD4C95C-BA38-4692-BA4B-8C25A86208F9} - HelloWorld - - - - Application - false - MultiByte - - - Application - false - MultiByte - - - Application - false - MultiByte - Windows7.1SDK - - - Application - false - MultiByte - Windows7.1SDK - - - - - - - - - - - - - - - - - - - - - - - <_ProjectFileVersion>10.0.30319.1 - ..\..\bin\Win32-VisualStudio\ - ..\..\bin\Win64-VisualStudio\ - - - ..\..\bin\Win32-VisualStudio\ - ..\..\bin\Win32-VisualStudio\ - - - AllRules.ruleset - AllRules.ruleset - - - - - AllRules.ruleset - AllRules.ruleset - - - - - - - - .\Debug/HelloWorld.tlb - - - - - Disabled - ..\..\include;%(AdditionalIncludeDirectories) - WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebug - - - Level3 - EditAndContinue - - - _DEBUG;%(PreprocessorDefinitions) - 0x0c07 - - - ..\..\bin\Win32-VisualStudio\01.HelloWorld.exe - ..\..\lib\Win32-visualstudio;%(AdditionalLibraryDirectories) - true - Console - - - - - - - .\Debug/HelloWorld.tlb - - - - - Disabled - ..\..\include;%(AdditionalIncludeDirectories) - WIN32;WIN64;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebug - - - Level3 - ProgramDatabase - - - _DEBUG;%(PreprocessorDefinitions) - 0x0c07 - - - ..\..\bin\Win64-VisualStudio\01.HelloWorld.exe - ..\..\lib\Win64-visualstudio;%(AdditionalLibraryDirectories) - true - Console - - - - - - - .\Release/HelloWorld.tlb - - - - - MaxSpeed - OnlyExplicitInline - ..\..\include;%(AdditionalIncludeDirectories) - WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) - true - MultiThreaded - true - - - Level3 - - - NDEBUG;%(PreprocessorDefinitions) - 0x0c07 - - - ..\..\bin\Win32-VisualStudio\01.HelloWorld.exe - ..\..\lib\Win32-visualstudio;%(AdditionalLibraryDirectories) - Console - - - - - - - .\Release/HelloWorld.tlb - - - - - MaxSpeed - OnlyExplicitInline - ..\..\include;%(AdditionalIncludeDirectories) - WIN32;WIN64;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) - true - MultiThreaded - true - - - Level3 - - - NDEBUG;%(PreprocessorDefinitions) - 0x0c07 - - - ..\..\bin\Win64-VisualStudio\01.HelloWorld.exe - ..\..\lib\Win64-visualstudio;%(AdditionalLibraryDirectories) - Console - - - - - - - Disabled - Disabled - %(AdditionalIncludeDirectories) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(PreprocessorDefinitions) - EnableFastChecks - EnableFastChecks - MaxSpeed - MaxSpeed - %(AdditionalIncludeDirectories) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(PreprocessorDefinitions) - - - - - - \ No newline at end of file diff --git a/examples/01.HelloWorld/HelloWorld_vc11.vcxproj b/examples/01.HelloWorld/HelloWorld_vc11.vcxproj deleted file mode 100644 index c131e023..00000000 --- a/examples/01.HelloWorld/HelloWorld_vc11.vcxproj +++ /dev/null @@ -1,235 +0,0 @@ - - - - - Debug - Win32 - - - Debug - x64 - - - Release - Win32 - - - Release - x64 - - - - 01.HelloWorld - {5AD4C95C-BA38-4692-BA4B-8C25A86208F9} - HelloWorld - - - - Application - false - MultiByte - Windows7.1SDK - - - Application - false - MultiByte - Windows7.1SDK - - - Application - false - MultiByte - Windows7.1SDK - - - Application - false - MultiByte - Windows7.1SDK - - - - - - - - - - - - - - - - - - - - - - - <_ProjectFileVersion>10.0.30319.1 - ..\..\bin\Win32-VisualStudio\ - ..\..\bin\Win64-VisualStudio\ - - - ..\..\bin\Win32-VisualStudio\ - ..\..\bin\Win32-VisualStudio\ - - - AllRules.ruleset - AllRules.ruleset - - - - - AllRules.ruleset - AllRules.ruleset - - - - - - - - .\Debug/HelloWorld.tlb - - - - - Disabled - ..\..\include;%(AdditionalIncludeDirectories) - WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebug - - - Level3 - EditAndContinue - - - _DEBUG;%(PreprocessorDefinitions) - 0x0c07 - - - ..\..\bin\Win32-VisualStudio\01.HelloWorld.exe - ..\..\lib\Win32-visualstudio;%(AdditionalLibraryDirectories) - true - Console - - - - - - - .\Debug/HelloWorld.tlb - - - - - Disabled - ..\..\include;%(AdditionalIncludeDirectories) - WIN32;WIN64;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebug - - - Level3 - ProgramDatabase - - - _DEBUG;%(PreprocessorDefinitions) - 0x0c07 - - - ..\..\bin\Win64-VisualStudio\01.HelloWorld.exe - ..\..\lib\Win64-visualstudio;%(AdditionalLibraryDirectories) - true - Console - - - - - - - .\Release/HelloWorld.tlb - - - - - MaxSpeed - OnlyExplicitInline - ..\..\include;%(AdditionalIncludeDirectories) - WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) - true - MultiThreaded - true - - - Level3 - - - NDEBUG;%(PreprocessorDefinitions) - 0x0c07 - - - ..\..\bin\Win32-VisualStudio\01.HelloWorld.exe - ..\..\lib\Win32-visualstudio;%(AdditionalLibraryDirectories) - Console - - - - - - - .\Release/HelloWorld.tlb - - - - - MaxSpeed - OnlyExplicitInline - ..\..\include;%(AdditionalIncludeDirectories) - WIN32;WIN64;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) - true - MultiThreaded - true - - - Level3 - - - NDEBUG;%(PreprocessorDefinitions) - 0x0c07 - - - ..\..\bin\Win64-VisualStudio\01.HelloWorld.exe - ..\..\lib\Win64-visualstudio;%(AdditionalLibraryDirectories) - Console - - - - - - - Disabled - Disabled - %(AdditionalIncludeDirectories) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(PreprocessorDefinitions) - EnableFastChecks - EnableFastChecks - MaxSpeed - MaxSpeed - %(AdditionalIncludeDirectories) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(PreprocessorDefinitions) - - - - - - \ No newline at end of file diff --git a/examples/01.HelloWorld/HelloWorld_vc12.vcxproj b/examples/01.HelloWorld/HelloWorld_vc12.vcxproj deleted file mode 100644 index 109da6b3..00000000 --- a/examples/01.HelloWorld/HelloWorld_vc12.vcxproj +++ /dev/null @@ -1,235 +0,0 @@ - - - - - Debug - Win32 - - - Debug - x64 - - - Release - Win32 - - - Release - x64 - - - - 01.HelloWorld - {5AD4C95C-BA38-4692-BA4B-8C25A86208F9} - HelloWorld - - - - Application - false - MultiByte - Windows7.1SDK - - - Application - false - MultiByte - Windows7.1SDK - - - Application - false - MultiByte - Windows7.1SDK - - - Application - false - MultiByte - Windows7.1SDK - - - - - - - - - - - - - - - - - - - - - - - <_ProjectFileVersion>10.0.30319.1 - ..\..\bin\Win32-VisualStudio\ - ..\..\bin\Win64-VisualStudio\ - - - ..\..\bin\Win32-VisualStudio\ - ..\..\bin\Win32-VisualStudio\ - - - AllRules.ruleset - AllRules.ruleset - - - - - AllRules.ruleset - AllRules.ruleset - - - - - - - - .\Debug/HelloWorld.tlb - - - - - Disabled - ..\..\include;%(AdditionalIncludeDirectories) - WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebug - - - Level3 - EditAndContinue - - - _DEBUG;%(PreprocessorDefinitions) - 0x0c07 - - - ..\..\bin\Win32-VisualStudio\01.HelloWorld.exe - ..\..\lib\Win32-visualstudio;%(AdditionalLibraryDirectories) - true - Console - - - - - - - .\Debug/HelloWorld.tlb - - - - - Disabled - ..\..\include;%(AdditionalIncludeDirectories) - WIN32;WIN64;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebug - - - Level3 - ProgramDatabase - - - _DEBUG;%(PreprocessorDefinitions) - 0x0c07 - - - ..\..\bin\Win64-VisualStudio\01.HelloWorld.exe - ..\..\lib\Win64-visualstudio;%(AdditionalLibraryDirectories) - true - Console - - - - - - - .\Release/HelloWorld.tlb - - - - - MaxSpeed - OnlyExplicitInline - ..\..\include;%(AdditionalIncludeDirectories) - WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) - true - MultiThreaded - true - - - Level3 - - - NDEBUG;%(PreprocessorDefinitions) - 0x0c07 - - - ..\..\bin\Win32-VisualStudio\01.HelloWorld.exe - ..\..\lib\Win32-visualstudio;%(AdditionalLibraryDirectories) - Console - - - - - - - .\Release/HelloWorld.tlb - - - - - MaxSpeed - OnlyExplicitInline - ..\..\include;%(AdditionalIncludeDirectories) - WIN32;WIN64;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) - true - MultiThreaded - true - - - Level3 - - - NDEBUG;%(PreprocessorDefinitions) - 0x0c07 - - - ..\..\bin\Win64-VisualStudio\01.HelloWorld.exe - ..\..\lib\Win64-visualstudio;%(AdditionalLibraryDirectories) - Console - - - - - - - Disabled - Disabled - %(AdditionalIncludeDirectories) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(PreprocessorDefinitions) - EnableFastChecks - EnableFastChecks - MaxSpeed - MaxSpeed - %(AdditionalIncludeDirectories) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(PreprocessorDefinitions) - - - - - - \ No newline at end of file diff --git a/examples/01.HelloWorld/HelloWorld_vc14.vcxproj b/examples/01.HelloWorld/HelloWorld_vc14.vcxproj deleted file mode 100644 index 23853d7b..00000000 --- a/examples/01.HelloWorld/HelloWorld_vc14.vcxproj +++ /dev/null @@ -1,235 +0,0 @@ - - - - - Debug - Win32 - - - Debug - x64 - - - Release - Win32 - - - Release - x64 - - - - 01.HelloWorld - {5AD4C95C-BA38-4692-BA4B-8C25A86208F9} - HelloWorld - - - - Application - false - MultiByte - v140 - - - Application - false - MultiByte - v140 - - - Application - false - MultiByte - v140 - - - Application - false - MultiByte - v140 - - - - - - - - - - - - - - - - - - - - - - - <_ProjectFileVersion>10.0.30319.1 - ..\..\bin\Win32-VisualStudio\ - ..\..\bin\Win64-VisualStudio\ - - - ..\..\bin\Win32-VisualStudio\ - ..\..\bin\Win32-VisualStudio\ - - - AllRules.ruleset - AllRules.ruleset - - - - - AllRules.ruleset - AllRules.ruleset - - - - - - - - .\Debug/HelloWorld.tlb - - - - - Disabled - ..\..\include;%(AdditionalIncludeDirectories) - WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebug - - - Level3 - EditAndContinue - - - _DEBUG;%(PreprocessorDefinitions) - 0x0c07 - - - ..\..\bin\Win32-VisualStudio\01.HelloWorld.exe - ..\..\lib\Win32-visualstudio;%(AdditionalLibraryDirectories) - true - Console - - - - - - - .\Debug/HelloWorld.tlb - - - - - Disabled - ..\..\include;%(AdditionalIncludeDirectories) - WIN32;WIN64;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebug - - - Level3 - ProgramDatabase - - - _DEBUG;%(PreprocessorDefinitions) - 0x0c07 - - - ..\..\bin\Win64-VisualStudio\01.HelloWorld.exe - ..\..\lib\Win64-visualstudio;%(AdditionalLibraryDirectories) - true - Console - - - - - - - .\Release/HelloWorld.tlb - - - - - MaxSpeed - OnlyExplicitInline - ..\..\include;%(AdditionalIncludeDirectories) - WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) - true - MultiThreaded - true - - - Level3 - - - NDEBUG;%(PreprocessorDefinitions) - 0x0c07 - - - ..\..\bin\Win32-VisualStudio\01.HelloWorld.exe - ..\..\lib\Win32-visualstudio;%(AdditionalLibraryDirectories) - Console - - - - - - - .\Release/HelloWorld.tlb - - - - - MaxSpeed - OnlyExplicitInline - ..\..\include;%(AdditionalIncludeDirectories) - WIN32;WIN64;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) - true - MultiThreaded - true - - - Level3 - - - NDEBUG;%(PreprocessorDefinitions) - 0x0c07 - - - ..\..\bin\Win64-VisualStudio\01.HelloWorld.exe - ..\..\lib\Win64-visualstudio;%(AdditionalLibraryDirectories) - Console - - - - - - - Disabled - Disabled - %(AdditionalIncludeDirectories) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(PreprocessorDefinitions) - EnableFastChecks - EnableFastChecks - MaxSpeed - MaxSpeed - %(AdditionalIncludeDirectories) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(PreprocessorDefinitions) - - - - - - \ No newline at end of file diff --git a/examples/01.HelloWorld/Makefile b/examples/01.HelloWorld/Makefile deleted file mode 100644 index 6b6d16fd..00000000 --- a/examples/01.HelloWorld/Makefile +++ /dev/null @@ -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 := 01.HelloWorld -# 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 diff --git a/examples/01.HelloWorld/main.cpp b/examples/01.HelloWorld/main.cpp deleted file mode 100644 index aeb0c570..00000000 --- a/examples/01.HelloWorld/main.cpp +++ /dev/null @@ -1,269 +0,0 @@ -/** Example 001 HelloWorld - -This tutorial shows how to set up the IDE for using the Irrlicht Engine and how -to write a simple HelloWorld program with it. The program will show how to use -the basics of the VideoDriver, the GUIEnvironment, and the SceneManager. -Microsoft Visual Studio is used as an IDE, but you will also be able to -understand everything if you are using a different one or even another -operating system than Windows. - -You have to include the header file in order to use the engine. The -header file can be found in the Irrlicht Engine SDK directory \c include. To let -the compiler find this header file, the directory where it is located has to be -added in your project as include path. This is different for every IDE and -compiler you use. Let's explain shortly how to do this in Visual Studio 2010: - -- In Visual Studio 2010 select the Menu Project -> Properties. Select the - "C/C++" - "General" option, and select the "Additional Include Directories". - Add the \c include directory of the Irrlicht engine folder to the list of - directories. Now the compiler will find the irrlicht.h header file. We also - need the irrlicht.lib to be found, so select "Linker" - "General" and - add the \c lib/Win64-visualStudio or \c lib/Win32-visualStudio directory - to "Additional Library Directories". Which of the 2 Irrlicht versions you - chose depends on the target platform for your application (win32 or x64). - In your project properties you can see what your active solution platform - is, you can use the same one for Irrlicht. - -To be able to use the Irrlicht.DLL file, we need to link with the Irrlicht.lib. -In most IDE's you have to add irrlicht.lib (or irrlicht.a or irrlicht.so on -Linux) to your Linker input files. - -For VisualStudio we can be lazy and use the pragma comment lib. -We also want to get rid of the console window, which pops up when starting a -program with main() (instead of WinMain). This is done by the second pragma. -We could also use the WinMain method, though losing platform independence then. -*/ -#ifdef _MSC_VER -#pragma comment(lib, "Irrlicht.lib") -#pragma comment(linker, "/subsystem:windows /ENTRY:mainCRTStartup") -#endif - -/* -That's it. With your IDE set up like this, you will now be able to develop -applications with the Irrlicht Engine. - -Lets start! - -After we have set up the IDE, the compiler will know where to find the Irrlicht -Engine header files so we can include it now in our code. -*/ -#include - -/* -That header just adds the getExampleMediaPath tool-functions to help locating -the media we need. More about that later below. -*/ -#include "exampleHelper.h" - -/* -In the Irrlicht Engine, everything can be found in the namespace 'irr'. So if -you want to use a class of the engine, you have to write irr:: before the name -of the class. For example to use the IrrlichtDevice write: irr::IrrlichtDevice. -To get rid of the irr:: in front of the name of every class, we tell the -compiler that we use that namespace from now on, and we will not have to write -irr:: anymore. -Note that you never should do that in headers - otherwise you will pollute the -namespace of every file including such a header. So in headers always write -out the full names including all namespaces. -*/ -using namespace irr; - -/* -There are 5 sub namespaces in the Irrlicht Engine. Take a look at them, you can -read a detailed description of them in the documentation by clicking on the top -menu item 'Namespace List' or by using this link: -http://irrlicht.sourceforge.net/docu/namespaces.html -Like the irr namespace, we do not want these 5 sub namespaces now, to keep this -example simple. Hence, we tell the compiler again that we do not want always to -write their names. -*/ -using namespace core; -using namespace scene; -using namespace video; -using namespace io; -using namespace gui; - -/* -This is the main method. We can now use main() on every platform. -*/ -int main() -{ - /* - The most important function of the engine is the createDevice() - function. The IrrlichtDevice is created by it, which is the root - object for doing anything with the engine. createDevice() has the - following parameters: - - - driverType: Type of the video driver. This can currently be the Null-device, - one of the two software renderers, D3D9, or OpenGL. In this - example we use EDT_BURNINGSVIDEO, but to try out, you might want to - change it to EDT_SOFTWARE, EDT_NULL, EDT_DIRECT3D9, or EDT_OPENGL. - Generally you will want to use OpenGL or Direct3D as they are - using your graphic card for calculations instead of the CPU and - are way faster (and usually better looking). We just use one of the - software renderers here as it even works when your graphic card driver - isn't set up for 3d support. - - - windowSize: Size of the Window or screen in FullScreenMode to be - created. In this example we use 640x480. - - - bits: Amount of color bits per pixel. This should be 16 or 32. The - parameter is often ignored when running in windowed mode. More - commonly you would chose 32 bit, again we're just playing it safe. - - - fullscreen: Specifies if we want the device to run in fullscreen mode - or windowed. - - - stencilbuffer: Specifies if we want to use the stencil buffer (you - need it for drawing shadows). - - - vsync: Specifies if we want to have vsync enabled, this is only useful - in fullscreen mode. - - - eventReceiver: An object to receive events. We do not want to use this - parameter here, and set it to 0. - - Always check the return value to cope with unsupported drivers, - dimensions, etc. - */ - IrrlichtDevice *device = - createDevice( video::EDT_OGLES1, dimension2d(640, 480), 16, - false, false, false, 0); - - if (!device) - return 1; - - /* - Set the caption of the window to some nice text. Note that there is an - 'L' in front of the string. The Irrlicht Engine uses wide character - strings when displaying text. - */ - device->setWindowCaption(L"Hello World! - Irrlicht Engine Demo"); - - /* - Get a pointer to the VideoDriver, the SceneManager and the graphical - user interface environment, so that we do not always have to write - device->getVideoDriver(), device->getSceneManager(), or - device->getGUIEnvironment(). - */ - IVideoDriver* driver = device->getVideoDriver(); - ISceneManager* smgr = device->getSceneManager(); - IGUIEnvironment* guienv = device->getGUIEnvironment(); - - /* - We add a hello world label to the window, using the GUI environment. - The text is placed at the position (10,10) as top left corner and - (260,22) as lower right corner. - */ - guienv->addStaticText(L"Hello World! This is Irrlicht with the burnings software renderer!", - rect(10,10,260,22), true); - - /* - Get a media path dedicated for your platform. Finding media files for your - applications can be tricky. First you have 2 options - working with relative - paths or working with absolute paths. - - On Windows a common solution is that your installer will write a key into - the registry with the absolute path of wherever the user installed the - media. And in your application you read out that key from the registry. - On Linux a common solution is to use config file which is placed in some - fixed location (for example in a . file/folder in the user home). - - But you can also work with relative paths - which is what we do here. There - is a slight complication with relative paths as they are relative to your - current working directory. And that depends on the way your application is - started and it might change inside your application. But mostly it will be - set to your executable on start so you can ignore that problem while - developing. - - When inside VisualStudio the current working directory is set to your - project files location unless you overwrite Project properties - Debugging - - Working Directory. In Irrlicht examples the media folder is on most - platforms ../../media which works for the examples as it's relative to our - project files as well as to the binary (.exe) files. - - Whatever you chose to find your base-folder for media - wrap it with some - function and then you can improve the code to locate the media later on. - */ - const io::path mediaPath = getExampleMediaPath(); - - /* - To show something interesting, we load a Quake 2 model and display it. - We get the Mesh from the Scene Manager with getMesh() and add a SceneNode - to display the mesh with addAnimatedMeshSceneNode(). Check the return value - of getMesh() to become aware of loading problems and other errors. - - Instead of writing the filename sydney.md2, it would also be possible - to load a Maya object file (.obj), a complete Quake3 map (.bsp) or any - other supported file format. By the way, that cool Quake 2 model - called sydney was modeled by Brian Collins. - */ - IAnimatedMesh* mesh = smgr->getMesh(mediaPath + "sydney.md2"); - if (!mesh) - { - device->drop(); - return 1; - } - IAnimatedMeshSceneNode* node = smgr->addAnimatedMeshSceneNode( mesh ); - - /* - To let the mesh look a little bit nicer, we change its material. We - disable lighting because we do not have a dynamic light in here, and - the mesh would be totally black otherwise. Then we set the frame loop, - such that the predefined STAND animation is used. And last, we apply a - texture to the mesh. Without it the mesh would be drawn using only a - color. - */ - if (node) - { - node->setMaterialFlag(EMF_LIGHTING, false); - node->setMD2Animation(scene::EMAT_STAND); - node->setMaterialTexture( 0, driver->getTexture(mediaPath + "sydney.bmp") ); - } - - /* - To look at the mesh, we place a camera into 3d space at the position - (0, 30, -40). The camera looks from there to (0,5,0), which is - approximately the place where our md2 model is. - */ - smgr->addCameraSceneNode(0, vector3df(0,30,-40), vector3df(0,5,0)); - - /* - OK, now we have set up the scene, lets draw everything: We run the - device in a while() loop, until the device does not want to run any - more. This would be when the user closes the window or presses ALT+F4 - (or whatever keycode closes a window on your OS). - */ - while(device->run()) - { - /* - Anything can be drawn between a beginScene() and an endScene() - call. The beginScene() call clears the screen with a color and - the depth buffer, if desired. Then we let the Scene Manager and - the GUI Environment draw their content. With the endScene() - call everything is presented on the screen. - */ - driver->beginScene(ECBF_COLOR | ECBF_DEPTH, SColor(255,100,101,140)); - - smgr->drawAll(); - guienv->drawAll(); - - driver->endScene(); - } - - /* - After we are done with the render loop, we have to delete the Irrlicht - Device created before with createDevice(). In the Irrlicht Engine, you - have to delete all objects you created with a method or function which - starts with 'create'. The object is simply deleted by calling ->drop(). - See the documentation at irr::IReferenceCounted::drop() for more - information. - */ - device->drop(); - - return 0; -} - -/* -That's it. Compile and run. -**/ diff --git a/examples/01.HelloWorld/tutorial.html b/examples/01.HelloWorld/tutorial.html deleted file mode 100644 index e46c9542..00000000 --- a/examples/01.HelloWorld/tutorial.html +++ /dev/null @@ -1,394 +0,0 @@ - - -Irrlicht Engine Tutorial - - - - -
- - - - - - - - - -
Tutorial 1.HelloWorld
-

This Tutorial shows how to set up the IDE for using the - Irrlicht Engine and how to write a simple HelloWorld program - with it. The program will show how to use the basics of - the VideoDriver, the GUIEnvironment and the SceneManager.
- The result of this example will look like this:

-


-

-
-
- - - - - - -
Setting up the - IDE
-
-

To use the engine, we will have to include - the header file <irrlicht.h>, which can be found - in the Irrlicht Engine SDK directory \include. To let - the compiler find this header file, the directory where - it is located should be specified somewhere. This is different - for every IDE and compiler. I will explain how to do this - in Microsoft Visual Studio C++ 6.0 and .NET:

- -
-
    -
  • -
    If you use Version 6.0, select the Menu - Extras -> Options. Select the directories tab, and - select the 'Include' Item in the combo box. Add the - \include directory of the Irrlicht Engine folder to - the list of directories. Now the compiler will find - the Irrlicht.h header file. We also need the location - of irrlicht.lib to be listed, so select the 'Libraries' - tab and add the \lib\VisualStudio directory.
    -
    -   
    -  
    - -
    -
  • -
  • If your IDE is Visual Studio .NET, select Tools -> - Options. Select the Projects entry and then select VC++ - directories. Select 'show directories for include files' - in the combo box, and add the \include directory of the - Irrlicht Engine folder to the list of directories so the - compiler will find the Irrlicht.h header file. We also - need the irrlicht.lib to be found, so select 'show directories - for Library files' and add the \lib\VisualStudio directory.
    -
    - -
    -
  • -
- -

 

-
-
- - - - - - - - -
Lets start!
-
-
-
-

After we have set up the IDE, the compiler will know - where to find the Irrlicht Engine header files so - we can include it now into our code.

- - - - - -
#include <irrlicht.h>
-

In the Irrlicht Engine, everything can be found in - the namespace 'irr'. So if you want to use a class - of the engine, you'll have to type an irr:: before - the name of the class. For example, to use the IrrlichtDevice, - write: irr::IrrlichtDevice. To avoid having to put - irr:: before of the name of every class, we tell the - compiler that we use that namespace.

- - - - - -
using namespace irr;
-

There are 5 sub-namespaces in the Irrlicht Engine. - Take a look at them: you can read a detailed description - of them in the documentation by clicking on the top - menu item 'Namespace - List'. To keep this example simple, we don't want - to have to specify the name spaces, Hence:

- - - - - -
using namespace core;
using namespace scene;
using namespace video;
using namespace io;
using namespace gui;
-

To be able to use the Irrlicht.DLL file, we need - to link with the Irrlicht.lib. We could set this option - in the project settings, but to make it easy we use - a pragma comment:

- - - - - -
#pragma comment(lib, "Irrlicht.lib")
-

Now the main method: to keep this example simple - we use int main(), which can be used on any platform. - However, on Windows platforms, we could also use the - WinMain method if we would want to get rid of the - console window which pops up when starting a program - with main().

- - - - - -
int main()
{
-

The most important function of the engine is the - 'createDevice' function. The Irrlicht Device, which - is the root object for doing everything with the engine, - can be created with it. createDevice() has 7 parameters:

-
-
    -
  • - -
    deviceType: Type of the device. This can currently - be the Null device, the Software device, Direct3D8, Direct3D9, - or OpenGL. In this example we use EDT_SOFTWARE, but, to try - them out, you might want to change it to EDT_NULL, EDT_DIRECT3D8, - EDT_DIRECT3D9 or EDT_OPENGL.
    -
  • -
  • -
    windowSize: Size of the window or - full screen mode to be created. In this example - we use 512x384.
    - -
  • -
  • -
    bits: Number of bits per pixel when - in full screen mode. This should be 16 or 32. This - parameter is ignored when running in windowed mode.
    -
  • -
  • -
    fullscreen: Specifies if we want - the device to run in full screen mode or not.
    -
  • -
  • stencilbuffer: Specifies if we want to use the stencil - buffer for drawing shadows.
  • - -
  • vsync: Specifies if we want to have vsync enabled. - This is only useful in full screen mode.
  • -
  • -
    eventReceiver: An object to receive - events. We do not want to use this parameter here, - and set it to 0.
    -
  • -
- - - - - -
IrrlichtDevice *device =
createDevice(EDT_SOFTWARE, dimension2d<s32>(512, 384), 16,
false, false, false, 0);
-

Now we set the caption of the window to some nice text. - Note that there is a 'L' in front of the string: the - Irrlicht Engine uses wide character strings when displaying - text.

- - - - - -
device->setWindowCaption(L"Hello World! - Irrlicht Engine Demo");
-

Now we store a pointer to the video driver, the SceneManager, - and the graphical user interface environment so that - we do not always have to write device->getVideoDriver(), - device->getSceneManager(), and device->getGUIEnvironment().

- - - - - -
IVideoDriver* driver = device->getVideoDriver();
ISceneManager* smgr = device->getSceneManager();
IGUIEnvironment* guienv = device->getGUIEnvironment();
-

We add a hello world label to the window using the - GUI environment. The text is placed at the position - (10,10) as top left corner and (200,22) as lower right - corner.

- - - - - -
guienv->addStaticText(L"Hello World! This is the Irrlicht Software engine!",
rect<s32>(10,10,200,22), true);
-

To display something interesting, we load a Quake 2 - model and display it. We only have to get the Mesh from - the Scene Manager with getMesh() and add a SceneNode - to display the mesh with addAnimatedMeshSceneNode(). - Instead of loading a Quake2 file (.md2), it is also - possible to load a Maya object file (.obj), a complete - Quake3 map (.bsp), or a Milshape file (.ms3d).
- By the way, that cool Quake 2 model called sydney.md2 - was modelled by Brian Collins.

- - - - - -
IAnimatedMesh* mesh = smgr->getMesh("../../media/sydney.md2");
IAnimatedMeshSceneNode* node = smgr->addAnimatedMeshSceneNode( mesh );
-

To make the mesh look a little bit nicer, we change - its material a little bit: we disable lighting because - we do not have a dynamic light in here and the mesh - would be totally black. Then we set the frame loop so - that the animation is looped between the frames 0 and - 310. Then, at last, we apply a texture to the mesh. - Without it the mesh would be drawn using only a solid - color.

- - - - - -
if (node)
{
node->setMaterialFlag(EMF_LIGHTING, false);
node->setFrameLoop(0, 310);
node->setMaterialTexture( 0, driver->getTexture("../../media/sydney.bmp") );
}
-
-

To look at the mesh, we place a camera into 3d space - at the position (0, 10, -40). The camera looks from - there to (0,5,0).

- - - - - -
smgr->addCameraSceneNode(0, vector3df(0,30,-40), vector3df(0,5,0));
-

Ok. Now that we have set up the scene, let's draw everything: - we run the device in a while() loop until the device - does not want to run any more. This would be when the - user closes the window or presses ALT+F4 in Windows.

- - - - - -
while(device->run())
{
-

Everything must be drawn between a beginScene() and - an endScene() call. The beginScene clears the screen - with a color and also the depth buffer, if desired. - Then we let the Scene Manager and the GUI environment - draw their content. With the endScene() call, everything - is presented on the screen.

- - - - - - -
	driver->beginScene(true, true, SColor(255,100,101,140));
- smgr->drawAll(); - guienv->drawAll();
-
	driver->endScene();
-}
-

After we are finished, we have to delete the Irrlicht - Device created earlier with createDevice(). With the - Irrlicht Engine, you should delete all objects you created - with a method or function that starts with 'create'. - The object is deleted simply by calling ->drop(). - See the documentation - for more information.

- - - - - -
	device->drop();
return 0; -}
-

That's it. Compile and run.

-

 

-
-
-
-
- - - - - - - -
Possible Errors - or Problems
-
-
-

Visual Studio
- - While trying to compile the tutorial, if you get the - error:

- - - - -
fatal - error C1083: Cannot open include file: 'irrlicht.h': - No such file or directory
-

Solution: You may have set the include directory improperly - in the Visual Studio options. See above - for information on setting it.

- - - - - -
LINK - : LNK6004: HelloWorld.exe not found or not built - by the last incremental link; performing full link
- LINK : fatal error LNK1104: cannot open file "Irrlicht.lib"
- Error executing link.exe
-

Solution: You may have set the library directory improperly. - See above for information on - setting it.
- -
-

-

Compiler independent problems
-
If the tutorial compiles successfully but gives - the error:

- - - - - -
This - application has failed to start because Irrlicht.dll - was not found. Re-installing the application may - fix this problem
-

Solution: You may have forgotten to copy the Irrlicht.dll - file from Irrlicht\bin\VisualStudio to the directory - the tutorial's project file is in.

- If the tutorial compiles and runs successfully but produces - errors in the console like:
-
- - - - - -
Could - not load mesh, because file could not be opened.: - ../media/sydney.md2
-

Or:

- - - - - -
Could - not open file of texture: stones.jpg
-
Could not load texture: stones.jpg
-

Solution: The file listed in the error message cannot - be found. Ensure that the directory specified in the - main.cpp exists and is where the file is located.
-

-
-
-
-

 

- - diff --git a/examples/01.HelloWorld_Android/AndroidManifest.xml b/examples/01.HelloWorld_Android/AndroidManifest.xml deleted file mode 100755 index b26b4d40..00000000 --- a/examples/01.HelloWorld_Android/AndroidManifest.xml +++ /dev/null @@ -1,21 +0,0 @@ - - - - - - - - - - - - - - diff --git a/examples/01.HelloWorld_Android/android_tools.cpp b/examples/01.HelloWorld_Android/android_tools.cpp deleted file mode 100644 index 758a0a8d..00000000 --- a/examples/01.HelloWorld_Android/android_tools.cpp +++ /dev/null @@ -1,184 +0,0 @@ -// This file is part of the "Irrlicht Engine". -// For conditions of distribution and use, see copyright notice in irrlicht.h - -#include "android_tools.h" -#include // for the occasional debugging, style: __android_log_print(ANDROID_LOG_VERBOSE, "Irrlicht", "%s\n", "We do log"); - -namespace irr -{ -namespace android -{ - -// Not all DisplayMetrics are available through the NDK. -// So we access the Java classes with the JNI interface. -// You can access other Java classes available in Android in similar ways. -// Function based roughly on the code from here: http://stackoverflow.com/questions/13249164/android-using-jni-from-nativeactivity -bool getDisplayMetrics(android_app* app, SDisplayMetrics & metrics) -{ - if (!app || !app->activity || !app->activity->vm ) - return false; - - JNIEnv* jni = 0; - app->activity->vm->AttachCurrentThread(&jni, NULL); - if (!jni ) - return false; - - - // get all the classes we want to access from the JVM - jclass classNativeActivity = jni->FindClass("android/app/NativeActivity"); - jclass classWindowManager = jni->FindClass("android/view/WindowManager"); - jclass classDisplay = jni->FindClass("android/view/Display"); - jclass classDisplayMetrics = jni->FindClass("android/util/DisplayMetrics"); - - if (!classNativeActivity || !classWindowManager || !classDisplay || !classDisplayMetrics) - { - app->activity->vm->DetachCurrentThread(); - return false; - } - - - // Get all the methods we want to access from the JVM classes - // Note: You can get the signatures (third parameter of GetMethodID) for all - // functions of a class with the javap tool, like in the following example for class DisplayMetrics: - // javap -s -classpath myandroidpath/adt-bundle-linux-x86_64-20131030/sdk/platforms/android-10/android.jar android/util/DisplayMetrics - jmethodID idNativeActivity_getWindowManager = jni->GetMethodID( classNativeActivity - , "getWindowManager" - , "()Landroid/view/WindowManager;"); - jmethodID idWindowManager_getDefaultDisplay = jni->GetMethodID( classWindowManager - , "getDefaultDisplay" - , "()Landroid/view/Display;"); - jmethodID idDisplayMetrics_constructor = jni->GetMethodID( classDisplayMetrics - , "" - , "()V"); - jmethodID idDisplay_getMetrics = jni->GetMethodID( classDisplay - , "getMetrics" - , "(Landroid/util/DisplayMetrics;)V"); - - if (!idNativeActivity_getWindowManager || !idWindowManager_getDefaultDisplay || !idDisplayMetrics_constructor - || !idDisplay_getMetrics) - { - app->activity->vm->DetachCurrentThread(); - return false; - } - - - // In Java the following code would be: getWindowManager().getDefaultDisplay().getMetrics(metrics); - // Note: If you need to call java functions in time-critical places you can split getting the jmethodID's - // and calling the functions into separate functions as you only have to get the jmethodID's once. - jobject windowManager = jni->CallObjectMethod(app->activity->clazz, idNativeActivity_getWindowManager); - - if (!windowManager) - { - app->activity->vm->DetachCurrentThread(); - return false; - } - jobject display = jni->CallObjectMethod(windowManager, idWindowManager_getDefaultDisplay); - if (!display) - { - app->activity->vm->DetachCurrentThread(); - return false; - } - jobject displayMetrics = jni->NewObject( classDisplayMetrics, idDisplayMetrics_constructor); - if (!displayMetrics) - { - app->activity->vm->DetachCurrentThread(); - return false; - } - jni->CallVoidMethod(display, idDisplay_getMetrics, displayMetrics); - - // access the fields of DisplayMetrics (we ignore the DENSITY constants) - jfieldID idDisplayMetrics_widthPixels = jni->GetFieldID( classDisplayMetrics, "widthPixels", "I"); - jfieldID idDisplayMetrics_heightPixels = jni->GetFieldID( classDisplayMetrics, "heightPixels", "I"); - jfieldID idDisplayMetrics_density = jni->GetFieldID( classDisplayMetrics, "density", "F"); - jfieldID idDisplayMetrics_densityDpi = jni->GetFieldID( classDisplayMetrics, "densityDpi", "I"); - jfieldID idDisplayMetrics_scaledDensity = jni->GetFieldID( classDisplayMetrics, "scaledDensity", "F"); - jfieldID idDisplayMetrics_xdpi = jni->GetFieldID(classDisplayMetrics, "xdpi", "F"); - jfieldID idDisplayMetrics_ydpi = jni->GetFieldID(classDisplayMetrics, "ydpi", "F"); - - if ( idDisplayMetrics_widthPixels ) - metrics.widthPixels = jni->GetIntField(displayMetrics, idDisplayMetrics_widthPixels); - if ( idDisplayMetrics_heightPixels ) - metrics.heightPixels = jni->GetIntField(displayMetrics, idDisplayMetrics_heightPixels); - if (idDisplayMetrics_density ) - metrics.density = jni->GetFloatField(displayMetrics, idDisplayMetrics_density); - if (idDisplayMetrics_densityDpi) - metrics.densityDpi = jni->GetIntField(displayMetrics, idDisplayMetrics_densityDpi); - if (idDisplayMetrics_scaledDensity) - metrics.scaledDensity = jni->GetFloatField(displayMetrics, idDisplayMetrics_scaledDensity); - if ( idDisplayMetrics_xdpi ) - metrics.xdpi = jni->GetFloatField(displayMetrics, idDisplayMetrics_xdpi); - if ( idDisplayMetrics_ydpi ) - metrics.ydpi = jni->GetFloatField(displayMetrics, idDisplayMetrics_ydpi); - - app->activity->vm->DetachCurrentThread(); - return true; -} - -void setSoftInputVisibility(android_app* app, bool visible) -{ - // NOTE: Unfortunately ANativeActivity_showSoftInput from the NDK does not work and Google does not care. - // This is based on the solution from @Ratamovic from here: http://stackoverflow.com/questions/5864790/how-to-show-the-soft-keyboard-on-native-activity - - if (!app || !app->activity || !app->activity->vm ) - return; - - JNIEnv* jni = 0; - app->activity->vm->AttachCurrentThread(&jni, NULL); - if (!jni ) - return; - - // get all the classes we want to access from the JVM (could be cached) - jclass classNativeActivity = jni->FindClass("android/app/NativeActivity"); - jclass classInputMethodManager = jni->FindClass("android/view/inputmethod/InputMethodManager"); - jclass classWindow = jni->FindClass("android/view/Window"); - jclass classView = jni->FindClass("android/view/View"); - - if (classNativeActivity && classInputMethodManager && classWindow) - { - // Get all the methods we want to access from the JVM classes (could be cached) - jmethodID mid_getSystemService = jni->GetMethodID(classNativeActivity, "getSystemService","(Ljava/lang/String;)Ljava/lang/Object;"); - jmethodID mid_showSoftInput = jni->GetMethodID(classInputMethodManager, "showSoftInput", "(Landroid/view/View;I)Z"); - - jmethodID mid_hideSoftInput = jni->GetMethodID(classInputMethodManager, "hideSoftInputFromWindow", "(Landroid/os/IBinder;I)Z"); - jmethodID mid_getWindow = jni->GetMethodID(classNativeActivity, "getWindow", "()Landroid/view/Window;"); - jmethodID mid_getWindowToken = jni->GetMethodID(classView, "getWindowToken", "()Landroid/os/IBinder;"); - jmethodID mid_getDecorView = jni->GetMethodID(classWindow, "getDecorView", "()Landroid/view/View;"); - - if ( mid_getSystemService && mid_showSoftInput && mid_hideSoftInput && mid_getWindow && mid_getDecorView && mid_getWindowToken ) - { - jstring paramInput = jni->NewStringUTF("input_method"); - jobject objInputMethodManager = jni->CallObjectMethod(app->activity->clazz, mid_getSystemService, paramInput); - jni->DeleteLocalRef(paramInput); - - jobject objWindow = jni->CallObjectMethod(app->activity->clazz, mid_getWindow); - - if ( visible && objInputMethodManager && objWindow) - { - jobject objDecorView = jni->CallObjectMethod(objWindow, mid_getDecorView); - if ( objDecorView ) - { - int showFlags = 0; - jni->CallBooleanMethod(objInputMethodManager, mid_showSoftInput, objDecorView, showFlags); - } - } - else if ( !visible && objInputMethodManager && objWindow ) - { - jobject objDecorView = jni->CallObjectMethod(objWindow, mid_getDecorView); - if ( objDecorView ) - { - jobject objBinder = jni->CallObjectMethod(objDecorView, mid_getWindowToken); - if ( objBinder ) - { - int hideFlags = 0; - jni->CallBooleanMethod(objInputMethodManager, mid_hideSoftInput, objBinder, hideFlags); - } - } - } - } - } - - app->activity->vm->DetachCurrentThread(); -} - -} // namespace android -} // namespace irr diff --git a/examples/01.HelloWorld_Android/android_tools.h b/examples/01.HelloWorld_Android/android_tools.h deleted file mode 100644 index 2a3d66f7..00000000 --- a/examples/01.HelloWorld_Android/android_tools.h +++ /dev/null @@ -1,33 +0,0 @@ -// This file is part of the "Irrlicht Engine". -// For conditions of distribution and use, see copyright notice in irrlicht.h - -#ifndef __IRR_ANDROID_TOOLS_H__ -#define __IRR_ANDROID_TOOLS_H__ - -#include -#include - -namespace irr -{ -namespace android -{ - -struct SDisplayMetrics -{ - irr::s32 widthPixels; - irr::s32 heightPixels; - irr::f32 density; - irr::s32 densityDpi; - irr::f32 scaledDensity; - irr::f32 xdpi; - irr::f32 ydpi; -}; - -//! Access SDisplayMetrics -extern bool getDisplayMetrics(android_app* app, SDisplayMetrics & metrics); - -extern void setSoftInputVisibility(android_app* app, bool visible); -} -} - -#endif // __IRR_ANDROID_TOOLS_H__ diff --git a/examples/01.HelloWorld_Android/build.xml b/examples/01.HelloWorld_Android/build.xml deleted file mode 100755 index 3ebae63b..00000000 --- a/examples/01.HelloWorld_Android/build.xml +++ /dev/null @@ -1,17 +0,0 @@ - - - - - - - - - - - - - - diff --git a/examples/01.HelloWorld_Android/jni/Android.mk b/examples/01.HelloWorld_Android/jni/Android.mk deleted file mode 100755 index 3ac2aa4c..00000000 --- a/examples/01.HelloWorld_Android/jni/Android.mk +++ /dev/null @@ -1,50 +0,0 @@ -LOCAL_PATH := $(call my-dir)/.. -IRRLICHT_PROJECT_PATH := $(LOCAL_PATH) - -include $(CLEAR_VARS) -LOCAL_MODULE := Irrlicht -LOCAL_SRC_FILES := $(IRRLICHT_PROJECT_PATH)/../../lib/Android/libIrrlicht.a -include $(PREBUILT_STATIC_LIBRARY) - -include $(CLEAR_VARS) - -LOCAL_MODULE := HelloWorldMobile - -LOCAL_CFLAGS := -pipe -fno-exceptions -fno-rtti -fstrict-aliasing - -ifndef NDEBUG -LOCAL_CFLAGS += -g -D_DEBUG -else -LOCAL_CFLAGS += -fexpensive-optimizations -O3 -endif - -ifeq ($(TARGET_ARCH_ABI),x86) -LOCAL_CFLAGS += -fno-stack-protector -endif - -LOCAL_C_INCLUDES := ../../include - -LOCAL_SRC_FILES := main.cpp android_tools.cpp - -LOCAL_LDLIBS := -lEGL -llog -lGLESv1_CM -lGLESv2 -lz -landroid - -LOCAL_STATIC_LIBRARIES := Irrlicht android_native_app_glue - -include $(BUILD_SHARED_LIBRARY) - -$(call import-module,android/native_app_glue) - -# copy Irrlicht data to assets - -$(shell mkdir -p $(IRRLICHT_PROJECT_PATH)/assets) -$(shell mkdir -p $(IRRLICHT_PROJECT_PATH)/assets/media) -$(shell mkdir -p $(IRRLICHT_PROJECT_PATH)/assets/media/Shaders) -$(shell mkdir -p $(IRRLICHT_PROJECT_PATH)/src) -$(shell cp $(IRRLICHT_PROJECT_PATH)/../../media/Shaders/*.* $(IRRLICHT_PROJECT_PATH)/assets/media/Shaders/) -$(shell cp $(IRRLICHT_PROJECT_PATH)/../../media/irrlichtlogo3.png $(IRRLICHT_PROJECT_PATH)/assets/media/) -$(shell cp $(IRRLICHT_PROJECT_PATH)/../../media/dwarf.x $(IRRLICHT_PROJECT_PATH)/assets/media/) -$(shell cp $(IRRLICHT_PROJECT_PATH)/../../media/dwarf.jpg $(IRRLICHT_PROJECT_PATH)/assets/media/) -$(shell cp $(IRRLICHT_PROJECT_PATH)/../../media/axe.jpg $(IRRLICHT_PROJECT_PATH)/assets/media/) -$(shell cp $(IRRLICHT_PROJECT_PATH)/../../media/fonthaettenschweiler.bmp $(IRRLICHT_PROJECT_PATH)/assets/media/) -$(shell cp $(IRRLICHT_PROJECT_PATH)/../../media/bigfont.png $(IRRLICHT_PROJECT_PATH)/assets/media/) - diff --git a/examples/01.HelloWorld_Android/jni/Application.mk b/examples/01.HelloWorld_Android/jni/Application.mk deleted file mode 100755 index 6c4880ea..00000000 --- a/examples/01.HelloWorld_Android/jni/Application.mk +++ /dev/null @@ -1,2 +0,0 @@ -APP_PLATFORM := android-10 -APP_MODULES := HelloWorldMobile diff --git a/examples/01.HelloWorld_Android/main.cpp b/examples/01.HelloWorld_Android/main.cpp deleted file mode 100644 index 087da556..00000000 --- a/examples/01.HelloWorld_Android/main.cpp +++ /dev/null @@ -1,387 +0,0 @@ -/** Example 027 Helloworld_Android - This example shows a simple application for Android. -*/ - -#include - -#ifdef _IRR_ANDROID_PLATFORM_ - -#include -#include "android_tools.h" -#include "android/window.h" - -using namespace irr; -using namespace core; -using namespace scene; -using namespace video; -using namespace io; -using namespace gui; - - -enum GUI_IDS -{ - GUI_INFO_FPS, - GUI_IRR_LOGO, -}; - - -/* - Android is using multitouch events. - We allow users to move around the Irrlicht logo as example of how to use those. -*/ -class MyEventReceiver : public IEventReceiver -{ -public: - MyEventReceiver(android_app* app ) - : Device(0), AndroidApp(app), SpriteToMove(0), TouchID(-1) - { - } - - void Init(IrrlichtDevice *device) - { - Device = device; - } - - virtual bool OnEvent(const SEvent& event) - { - if (event.EventType == EET_TOUCH_INPUT_EVENT) - { - /* - For now we fake mouse-events. Touch-events will be handled inside Irrlicht in the future, but until - that is implemented you can use this workaround to get a GUI which works at least for simple elements like - buttons. That workaround does ignore multi-touch events - if you need several buttons pressed at the same - time you have to handle that yourself. - */ - SEvent fakeMouseEvent; - fakeMouseEvent.EventType = EET_MOUSE_INPUT_EVENT; - fakeMouseEvent.MouseInput.X = event.TouchInput.X; - fakeMouseEvent.MouseInput.Y = event.TouchInput.Y; - fakeMouseEvent.MouseInput.Shift = false; - fakeMouseEvent.MouseInput.Control = false; - fakeMouseEvent.MouseInput.ButtonStates = 0; - fakeMouseEvent.MouseInput.Event = EMIE_COUNT; - - switch (event.TouchInput.Event) - { - case ETIE_PRESSED_DOWN: - { - // We only work with the first for now.force opengl error - if ( TouchID == -1 ) - { - fakeMouseEvent.MouseInput.Event = EMIE_LMOUSE_PRESSED_DOWN; - - if (Device) - { - position2d touchPoint(event.TouchInput.X, event.TouchInput.Y); - IGUIElement * logo = Device->getGUIEnvironment()->getRootGUIElement()->getElementFromId ( GUI_IRR_LOGO ); - if ( logo && logo->isPointInside (touchPoint) ) - { - TouchID = event.TouchInput.ID; - SpriteToMove = logo; - SpriteStartRect = SpriteToMove->getRelativePosition(); - TouchStartPos = touchPoint; - } - } - } - break; - } - case ETIE_MOVED: - if ( TouchID == event.TouchInput.ID ) - { - fakeMouseEvent.MouseInput.Event = EMIE_MOUSE_MOVED; - fakeMouseEvent.MouseInput.ButtonStates = EMBSM_LEFT; - - if ( SpriteToMove && TouchID == event.TouchInput.ID ) - { - - position2d touchPoint(event.TouchInput.X, event.TouchInput.Y); - MoveSprite(touchPoint); - } - } - break; - case ETIE_LEFT_UP: - if ( TouchID == event.TouchInput.ID ) - { - fakeMouseEvent.MouseInput.Event = EMIE_LMOUSE_LEFT_UP; - - if ( SpriteToMove ) - { - TouchID = -1; - position2d touchPoint(event.TouchInput.X, event.TouchInput.Y); - MoveSprite(touchPoint); - SpriteToMove = 0; - } - } - break; - default: - break; - } - - if ( fakeMouseEvent.MouseInput.Event != EMIE_COUNT && Device ) - { - Device->postEventFromUser(fakeMouseEvent); - } - } - else if ( event.EventType == EET_GUI_EVENT ) - { - /* - Show and hide the soft input keyboard when an edit-box get's the focus. - */ - switch(event.GUIEvent.EventType) - { - case EGET_EDITBOX_ENTER: - if ( event.GUIEvent.Caller->getType() == EGUIET_EDIT_BOX ) - { - if( Device->getGUIEnvironment() ) - Device->getGUIEnvironment()->setFocus(NULL); - android::setSoftInputVisibility(AndroidApp, false); - } - break; - case EGET_ELEMENT_FOCUS_LOST: - if ( event.GUIEvent.Caller->getType() == EGUIET_EDIT_BOX ) - { - /* Unfortunatly this only works on some android devices. - On other devices Android passes through touch-input events when the virtual keyboard is clicked while blocking those events in areas where the keyboard isn't. - Very likely an Android bug as it only happens in certain cases (like Android Lollipop with landscape mode on MotoG, but also some reports from other devices). - Or maybe Irrlicht still does something wrong. - Can't figure it out so far - so be warned - with landscape mode you might be better off writing your own keyboard. - */ - android::setSoftInputVisibility(AndroidApp, false); - } - break; - case EGET_ELEMENT_FOCUSED: - if ( event.GUIEvent.Caller->getType() == EGUIET_EDIT_BOX ) - { - android::setSoftInputVisibility(AndroidApp, true); - } - break; - default: - break; - } - } - - return false; - } - - void MoveSprite(const irr::core::position2d &touchPos) - { - irr::core::position2d move(touchPos-TouchStartPos); - SpriteToMove->setRelativePosition(SpriteStartRect.UpperLeftCorner + move); - } - -private: - IrrlichtDevice * Device; - android_app* AndroidApp; - gui::IGUIElement * SpriteToMove; - core::rect SpriteStartRect; - core::position2d TouchStartPos; - s32 TouchID; -}; - -/* Mainloop. -*/ -void mainloop( IrrlichtDevice *device, IGUIStaticText * infoText ) -{ - u32 loop = 0; // loop is reset when the app is destroyed unlike runCounter - static u32 runCounter = 0; // static's seem to survive even an app-destroy message (not sure if that's guaranteed). - while(device->run()) - { - /* - The window seems to be always active in this setup. - That's because when it's not active Android will stop the code from running. - */ - if (device->isWindowActive()) - { - /* - Show FPS and some counters to show which parts of an app run - in different app-lifecycle states. - */ - if ( infoText ) - { - stringw str = L"FPS:"; - str += (s32)device->getVideoDriver()->getFPS(); - str += L" r:"; - str += runCounter; - str += L" l:"; - str += loop; - infoText->setText ( str.c_str() ); - } - - device->getVideoDriver()->beginScene(true, true, SColor(0,100,100,100)); - device->getSceneManager()->drawAll(); - device->getGUIEnvironment()->drawAll(); - device->getVideoDriver()->endScene (); - } - device->yield(); // probably nicer to the battery - ++runCounter; - ++loop; - } -} - -/* Main application code. */ -void android_main(android_app* app) -{ - // Make sure glue isn't stripped. - app_dummy(); - - /* - The receiver can already receive system events while createDeviceEx is called. - So we create it first. - */ - MyEventReceiver receiver(app); - - /* - Create the device. - You have currently the choice between 2 drivers: - EDT_OGLES1 is basically a opengl fixed function pipeline. - EDT_OGLES2 is a shader pipeline. Irrlicht comes with shaders to simulate - typical fixed function materials. For this to work the - corresponding shaders from the Irrlicht media/Shaders folder are - copied to the application assets folder (done in the Makefile). - */ - SIrrlichtCreationParameters param; -// param.DriverType = EDT_OGLES1; // android:glEsVersion in AndroidManifest.xml should be "0x00010000" (requesting 0x00020000 will also guarantee that ES1 works) - param.DriverType = EDT_OGLES2; // android:glEsVersion in AndroidManifest.xml should be "0x00020000" - param.WindowSize = dimension2d(300,300); // using 0,0 it will automatically set it to the maximal size - param.PrivateData = app; - param.Bits = 24; - param.ZBufferBits = 16; - param.AntiAlias = 0; - param. EventReceiver = &receiver; - - /* Logging is written to a file. So your application should disable all logging when you distribute your - application or it can fill up that file over time. - */ -#ifndef _DEBUG - param.LoggingLevel = ELL_NONE; -#endif - - IrrlichtDevice *device = createDeviceEx(param); - if (device == 0) - return; - - receiver.Init(device); - -// ANativeActivity_setWindowFlags(app->activity, AWINDOW_FLAG_FULLSCREEN, 0); - - IVideoDriver* driver = device->getVideoDriver(); - ISceneManager* smgr = device->getSceneManager(); - IGUIEnvironment* guienv = device->getGUIEnvironment(); - ILogger* logger = device->getLogger(); - IFileSystem * fs = device->getFileSystem(); - - /* Access to the Android native window. You often need this when accessing NDK functions like we are doing here. - Note that windowWidth/windowHeight have already subtracted things like the taskbar which your device might have, - so you get the real size of your render-window. - */ - ANativeWindow* nativeWindow = static_cast(driver->getExposedVideoData().OGLESAndroid.Window); - int32_t windowWidth = ANativeWindow_getWidth(app->window); - int32_t windowHeight = ANativeWindow_getHeight(app->window); - - /* Get display metrics. We are accessing the Java functions of the JVM directly in this case as there is no NDK function for that yet. - Checkout android_tools.cpp if you want to know how that is done. */ - irr::android::SDisplayMetrics displayMetrics; - memset(&displayMetrics, 0, sizeof displayMetrics); - irr::android::getDisplayMetrics(app, displayMetrics); - - /* For troubleshooting you can use the Irrlicht logger. - The Irrlicht logging messages are send to the Android logging system using the tag "Irrlicht". - They stay in a file there, so you can check them even after running your app. - You can watch them with the command: "adb logcat Irrlicht:V DEBUG:V *:S" - This means Irrlicht _V_erbose, debug messages verbose (p.E callstack on crashes) and all other messages _S_ilent. - Clean the logging file with: "adb logcat -c". - See http://developer.android.com/tools/debugging/debugging-log.html for more advanced log options. - */ - char strDisplay[1000]; - sprintf(strDisplay, "Window size:(%d/%d)\nDisplay size:(%d/%d)", windowWidth, windowHeight, displayMetrics.widthPixels, displayMetrics.heightPixels); - logger->log(strDisplay); - - core::dimension2d dim(driver->getScreenSize()); - sprintf(strDisplay, "getScreenSize:(%d/%d)", dim.Width, dim.Height); - logger->log(strDisplay); - - - /* Your media must be somewhere inside the assets folder. The assets folder is the root for the file system. - This example copies the media in the Android.mk makefile. */ - stringc mediaPath = "media/"; - - // The Android assets file-system does not know which sub-directories it has (blame google). - // So we have to add all sub-directories in assets manually. Otherwise we could still open the files, - // but existFile checks will fail (which are for example needed by getFont). - for ( u32 i=0; i < fs->getFileArchiveCount(); ++i ) - { - IFileArchive* archive = fs->getFileArchive(i); - if ( archive->getType() == EFAT_ANDROID_ASSET ) - { - archive->addDirectoryToFileList(mediaPath); - break; - } - } - - /* Set the font-size depending on your device. - dpi=dots per inch. 1 inch = 2.54 cm. */ - IGUISkin* skin = guienv->getSkin(); - IGUIFont* font = 0; - if ( displayMetrics.xdpi < 100 ) // just guessing some value where fontsize might start to get too small - font = guienv->getFont(mediaPath + "fonthaettenschweiler.bmp"); - else - font = guienv->getFont(mediaPath + "bigfont.png"); - if (font) - skin->setFont(font); - - // A field to show some text. Comment out stat->setText in run() if you want to see the dpi instead of the fps. - IGUIStaticText *text = guienv->addStaticText(stringw(displayMetrics.xdpi).c_str(), - rect(5,5,635,35), false, false, 0, GUI_INFO_FPS ); - guienv->addEditBox( L"", rect(5,40,475,80)); - - // add irrlicht logo - IGUIImage * logo = guienv->addImage(driver->getTexture(mediaPath + "irrlichtlogo3.png"), - core::position2d(5,85), true, 0, GUI_IRR_LOGO); - s32 minLogoWidth = windowWidth/3; - if ( logo && logo->getRelativePosition().getWidth() < minLogoWidth ) - { - /* Scale to make it better visible on high-res devices (we could also work with dpi here). - */ - logo->setScaleImage(true); - core::rect logoPos(logo->getRelativePosition()); - f32 scale = (f32)minLogoWidth/(f32)logoPos.getWidth(); - logoPos.LowerRightCorner.X = logoPos.UpperLeftCorner.X + minLogoWidth; - logoPos.LowerRightCorner.Y = logoPos.UpperLeftCorner.Y + (s32)((f32)logoPos.getHeight()*scale); - logo->setRelativePosition(logoPos); - } - - /* - Add a 3d model. Note that you might need to add light when using other models. - A copy of the model and it's textures must be inside the assets folder to be installed to Android. - In this example we do copy it to the assets folder in the Makefile jni/Android.mk - */ - IAnimatedMesh* mesh = smgr->getMesh(mediaPath + "dwarf.x"); - if (!mesh) - { - device->closeDevice(); - device->drop(); - return; - } - smgr->addAnimatedMeshSceneNode( mesh ); - - - /* - To look at the mesh, we place a camera. - */ - smgr->addCameraSceneNode(0, vector3df(15,40,-90), vector3df(0,30,0)); - - /* - Mainloop. Applications usually never quit themself in Android. The OS is responsible for that. - */ - mainloop(device, text); - - /* Cleanup */ - device->setEventReceiver(0); - device->closeDevice(); - device->drop(); -} - -#endif // defined(_IRR_ANDROID_PLATFORM_) - -/* -**/ diff --git a/examples/01.HelloWorld_Android/project.properties b/examples/01.HelloWorld_Android/project.properties deleted file mode 100755 index 5bf8b31b..00000000 --- a/examples/01.HelloWorld_Android/project.properties +++ /dev/null @@ -1 +0,0 @@ -target = android-10 diff --git a/examples/01.HelloWorld_Android/readme.txt b/examples/01.HelloWorld_Android/readme.txt deleted file mode 100644 index 2a9d66f5..00000000 --- a/examples/01.HelloWorld_Android/readme.txt +++ /dev/null @@ -1,95 +0,0 @@ ------------- -REQUIREMENTS ------------- - -To use Android you need to have installed: -- Android SDK (from http://developer.android.com) -- Android NDK (from http://developer.android.com) -- ant (a build tool commonly used for Java) -- A Java jdk (for example openjdk-6-jdk) -- GNU Make 3.81 or later -- A recent version of awk -- On Windows you need to have Cygwin (at least version 1.7) installed - ----------------------------- -BUILDING Irrlicht & your App ----------------------------- - -1. Assign your Android SDK path to an ANDROID_HOME environment variable. -2. Add $ANDROID_HOME/tools and $ANDROID_HOME/platform-tools and the Android NDK main folder to your PATH environment variable. -3. Go to: source/Irrlicht/Android and call "ndk-build" or "ndk-build NDEBUG=1" -4. Go to: examples/01.HelloWorld_Android and call "ndk-build" or "ndk-build NDEBUG=1" -5. Call "ant debug" to create package -6. Connect device to PC (with USB debugging mode ON) or turn on emulator. -7. Call "adb -d install bin/HelloWorldMobile-debug.apk" (if you use emulator please add "-e" parameter instead of "-d") to install package on your device/emulator. - -Troubleshooting: - -Error: Unable to resolve project target 'android-10' -Solution: Run "android sdk" in sdk/tools and install API 10. - Alternatively you can probably (not yet tested) set another APP_PLATFORM - in the Application.mk's for the project and for Irrlicht. In this case you - should likely also change the android:minSdkVersion in the AndroidManifest.xml - ------ -FILES ------ - -AndroidManifest.xml: - Every Android application needs one of those to describe the needs of the application. - Must have exactly this name. - See http://developer.android.com/guide/topics/manifest/manifest-intro.html - -build.xml: - Ant build file to create the final package. - You might want to create a new one as described in the Android documentation: - http://developer.android.com/tools/projects/projects-cmdline.html - That will then also update project.properties. - -project.properties - Contains the build target (and maybe other project properties). Must exist. - -jni: - A folder by this name must exist below the folder where you have build.xml. - Usually it contains the native (c/c++) source files, but in our case we put - the source-files one level higher (with LOCAL_PATH in Android.mk). - -jni/Android.mk: - The Makefile for the project. - Source-files in the project are added to LOCAL_SRC_FILES - In the Irrlicht example it also copies the assets, but you can - also already create your project assets in the right place. - -jni/Application.mk: - Optional file which for example restricts which modules are installed and - where you can set specific target architectures. - More info about this can be found in the ndk docs. - -res: - A folder with resources which districuted with your application and can be accessed via ID's. - Unfortunately no direct NDK access to resources at the time of writing this. So you either have - to access them with java-code and copy to c++ somehow or you have to use hacks to read the format - directly (which is done by some apps, but not future-safe and google recommends not doing that). - Please check the official "App Resources" android developer documention, as this is rather complex. - We use it only for the application icons in this example. - -assets: - Files in here are distributed with your app. It's acting like a read-only file system. - -assets/media/Shaders: - Shader code needed by the OGLES2 driver to simulate a fixed function pipeline. - In the example this code is automatically copied within the Android.mk makefile. - The path where the shaders are searched is set in the IRR_OGLES2_SHADER_PATH define in IrrCompileConfig.h - The names are hardcoded so they have to be identical to those found in media/Shaders. - You can rewrite the shaders, but ensure to add some working shaders files by those names. - The OGLES1 driver doesn't need those files. - -obj: - All object and library files mentioned in the Android.mk are put in here before linking. - -libs: - Contains the binaries of your application after compilation. The application itself is a lib(probably because native code can't run directly but only as lib). - -src: - The src folder is needed when you have Java sources and should only contain .java and .aidl files. - Although the examples doesn't use Java the makefile creates this folder as the ant build.xml in the android sdk needs it. diff --git a/examples/01.HelloWorld_Android/res/drawable-hdpi/irr_icon.png b/examples/01.HelloWorld_Android/res/drawable-hdpi/irr_icon.png deleted file mode 100755 index 65813ad1..00000000 Binary files a/examples/01.HelloWorld_Android/res/drawable-hdpi/irr_icon.png and /dev/null differ diff --git a/examples/01.HelloWorld_Android/res/drawable-ldpi/irr_icon.png b/examples/01.HelloWorld_Android/res/drawable-ldpi/irr_icon.png deleted file mode 100755 index 11e3ae24..00000000 Binary files a/examples/01.HelloWorld_Android/res/drawable-ldpi/irr_icon.png and /dev/null differ diff --git a/examples/01.HelloWorld_Android/res/drawable-mdpi/irr_icon.png b/examples/01.HelloWorld_Android/res/drawable-mdpi/irr_icon.png deleted file mode 100755 index b0fdc957..00000000 Binary files a/examples/01.HelloWorld_Android/res/drawable-mdpi/irr_icon.png and /dev/null differ diff --git a/examples/01.HelloWorld_Android/res/drawable-xhdpi/irr_icon.png b/examples/01.HelloWorld_Android/res/drawable-xhdpi/irr_icon.png deleted file mode 100755 index 89573a3c..00000000 Binary files a/examples/01.HelloWorld_Android/res/drawable-xhdpi/irr_icon.png and /dev/null differ diff --git a/examples/01.HelloWorld_emscripten/Makefile b/examples/01.HelloWorld_emscripten/Makefile deleted file mode 100644 index f60a678e..00000000 --- a/examples/01.HelloWorld_emscripten/Makefile +++ /dev/null @@ -1,98 +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 := 01.HelloEmscripten -# 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) - -all_emscripten: EMSCRIPTEN=1 - -# general compiler settings (might need to be set when compiling the lib, too) -CPPFLAGS += -I$(IrrlichtHome)/include -I/usr/X11R6/include -ifndef NDEBUG - ifdef EMSCRIPTEN - LDFLAGS += -s DEMANGLE_SUPPORT=1 - endif - CXXFLAGS += -g -Wall -else - ifdef EMSCRIPTEN - LDFLAGS += -O3 - endif - CXXFLAGS += -O3 -endif -ifdef EMSCRIPTEN - CXXFLAGS += -std=gnu++11 -U__STRICT_ANSI__ -endif - -ifdef EMSCRIPTEN - all: all_emscripten -else - all: all_linux -endif - -# target specific settings -all_linux all_emscripten all_win32 static_win32: LDFLAGS += -L$(IrrlichtHome)/lib/$(SYSTEM) -lIrrlicht -all_linux: LDFLAGS += -L/usr/X11R6/lib$(LIBSELECT) -lGL -lEGL -ifndef EMSCRIPTEN - LDFLAGS += -lGLESv1_CM -lGLESv2 -lXxf86vm -lXext -lX11 -lXcursor -endif -all_linux clean_linux: SYSTEM=Linux -all_emscripten clean_emscripten: SYSTEM=emscripten -all_win32 clean_win32 static_win32: SYSTEM=Win32-gcc -all_win32 clean_win32 static_win32: SUF=.exe -all_emscripten clean_emscripten: SUF=.html -all_emscripten: CXXFLAGS += -fno-exceptions -fno-rtti -fstrict-aliasing -std=gnu++11 -U__STRICT_ANSI__ -# Pass on a custom html file. -#all_emscripten: CXXFLAGS += --shell-file shell_minimal.html -all_emscripten: LDFLAGS += -lGL -lSDL --preload-file ../../media@/media -s ALLOW_MEMORY_GROWTH=1 -s NO_EXIT_RUNTIME=1 -#If you know the maximum memory (in bytes) which your application need then set it. It can speed things up a lot. -#all_emscripten: LDFLAGS += -s TOTAL_MEMORY=268435456 -# You need the FULL_ES2 when using EDT_OGLES2 driver -#all_emscripten: LDFLAGS += -s FULL_ES2=1 -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) - -# Enable compiling to WASM and not just asm.js (you have to set it in the engine Makefile as well) -ifdef EMSCRIPTEN - ifdef WASM - CXXFLAGS += -s WASM=1 - endif -endif - -emscripten: all_emscripten - -all_linux all_win32 all_emscripten static_win32: - $(warning Building...) - $(CXX) $(CPPFLAGS) $(CXXFLAGS) $(Sources) -o $(DESTPATH) $(LDFLAGS) - -clean: clean_linux clean_win32 clean_emscripten - $(warning Cleaning...) - -clean_linux clean_win32: - @$(RM) $(DESTPATH) - -clean_emscripten: - @$(RM) $(BinPath)/$(Target).data - @$(RM) $(BinPath)/$(Target).html* - @$(RM) $(BinPath)/$(Target).js - - -.PHONY: all all_win32 all_emscripten static_win32 clean clean_linux clean_win32 clean_emscripten - -#multilib handling -ifeq ($(HOSTTYPE), x86_64) -LIBSELECT=64 -endif -#solaris real-time features -ifeq ($(HOSTTYPE), sun4) -LDFLAGS += -lrt -endif diff --git a/examples/01.HelloWorld_emscripten/main.cpp b/examples/01.HelloWorld_emscripten/main.cpp deleted file mode 100644 index 86b960da..00000000 --- a/examples/01.HelloWorld_emscripten/main.cpp +++ /dev/null @@ -1,240 +0,0 @@ -/** Example 001 HelloWorld adapted to emscripten - -This Tutorial shows how to run code with emscripten. -Emscripten compiles c++ to asm.js to allow it running inside a webbrowser. -You have to setup the emscripten environment on your system first to use this. -*/ -#include -#include "exampleHelper.h" -#include -#include - -/* -The code in here is mostly similar to the usual HelloWorld. -You can find more information about it there. Here we mainly document the -differences needed for emscripten. -*/ - -using namespace irr; -using namespace core; -using namespace scene; -using namespace video; -using namespace io; -using namespace gui; - -/* -This part not necessary for emscripten, only useful to keep it in -in case you want to run the same code on Windows with VS as well. -*/ -#ifdef _MSC_VER -#pragma comment(lib, "Irrlicht.lib") -#pragma comment(linker, "/subsystem:windows /ENTRY:mainCRTStartup") -#endif - - -/* -Variables on the stack will stay intact between runs of one_iter() -*/ -IrrlichtDevice *device = 0; -IVideoDriver* driver = 0; -ISceneManager* smgr = 0; -IGUIEnvironment* guienv = 0; - -ICameraSceneNode* camera = 0; -dimension2d screenSize(640, 480); - -#ifdef __EMSCRIPTEN__ -/* - Handle changes in canvas size which are done with html/js. - Note that it's only OK for windowed so far, - the switch to fullscreen not yet working. - Also the emscripten_get_canvas_size might cause a slow-down - (but haven't found yet a way to avoid it with SDL1). - */ -void checkCanvasResize() -{ - int w, h, fs; - emscripten_get_canvas_size(&w, &h, &fs); - const core::dimension2d canvasDim(w,h); - if ( canvasDim != screenSize ) - { - screenSize = canvasDim; - driver->OnResize(canvasDim); - driver->setViewPort(irr::core::rect(0,0,w,h)); - - irr::f32 aspect = (irr::f32)w / (irr::f32)h; - camera->setAspectRatio(aspect); - } -} - - -/* - emscripten can't run things in an endless-loop or otherwise the browse will consider - the script to hang. -*/ -void one_iter() -{ - if(!device->run()) - { - // Could clean up here in theory, but not sure if it makes a difference - - /* - This tells emscripten to not run any further code. - */ - emscripten_cancel_main_loop(); - return; - } - - // In case you have a resizeable canvas (resized from html) - //checkCanvasResize(); - - driver->beginScene(ECBF_COLOR | ECBF_DEPTH, SColor(255,100,101,140)); - - smgr->drawAll(); - guienv->drawAll(); - - driver->endScene(); -} -#endif //__EMSCRIPTEN__ - - -/* - The main method is also run on emscripten. -*/ -int main() -{ - /* - Printing out the build date/time is very useful to find troubles with unexpected browser-caches. - */ - printf("Build-date: %s %s\n", __DATE__, __TIME__); - - SIrrlichtCreationParameters parameters; - /* - Create device flags for emscripten are still experimental - and might not all work. - - - deviceType: You can to use EDT_OGLES2 or EDT_WEBGL1 on emscripten. - EDT_WEBGL1 is better optimized but does not yet support all options. - EDT_OGLES2 needs -s FULL_ES2=1 as linker flag in the Makefile. - */ -#ifndef __EMSCRIPTEN__ - parameters.DriverType = EDT_OGLES2; -#else //__EMSCRIPTEN__ - parameters.DriverType = EDT_WEBGL1; -#endif //__EMSCRIPTEN__ - - parameters.LoggingLevel = ELL_DEBUG; - parameters.WindowSize = screenSize; - parameters.Stencilbuffer = false; - parameters.AntiAlias = 4; - - device = createDeviceEx(parameters); - - if (!device) - return 1; - - /* - Window caption will set the title-text in the browser. - */ - device->setWindowCaption(L"Hello World! - Irrlicht Engine Demo"); - - /* - Get a pointer to the VideoDriver, the SceneManager and the graphical - user interface environment, so that we do not always have to write - device->getVideoDriver(), device->getSceneManager(), or - device->getGUIEnvironment(). - */ - driver = device->getVideoDriver(); - smgr = device->getSceneManager(); - guienv = device->getGUIEnvironment(); - - /* - We add a hello world label to the window, using the GUI environment. - The text is placed at the position (10,10) as top left corner and - (260,22) as lower right corner. - */ - guienv->addStaticText(L"Hello World! This is Irrlicht on emscripten!", - rect(10,10,260,22), true); - - /* - Get a media path dedicated for your platform. - We tell emscripten to copy the media folder in the Makefile with: - "--preload-file ../../media@/media" - That copies our ../../media folder in a .data - file which is loaded by the browser. It can then be accessed there - by "/media" name (that's the parameter after the '@'). - Note that usually you would try to copy only as many files - as absolutely necessary to reduce start-up times. - */ - const io::path mediaPath = getExampleMediaPath(); - - /* - Make a model called Sydney show up. - */ - IAnimatedMesh* mesh = smgr->getMesh(mediaPath + "sydney.md2"); - if (!mesh) - { - device->drop(); - return 1; - } - IAnimatedMeshSceneNode* node = smgr->addAnimatedMeshSceneNode( mesh ); - - /* - Disable lighting because we do not have a dynamic light in here, and - the mesh would be totally black otherwise. - Set the frame loop such that the predefined STAND animation is used. - Add a texture to the model. - */ - if (node) - { - node->setMaterialFlag(EMF_LIGHTING, false); - node->setMD2Animation(scene::EMAT_STAND); - node->setMaterialTexture( 0, driver->getTexture(mediaPath + "sydney.bmp") ); - } - - /* - To look at the mesh, we place a camera into 3d space at the position - (0, 30, -40). The camera looks from there to (0,5,0), which is - approximately the place where our md2 model is. - */ - camera = smgr->addCameraSceneNode(0, vector3df(0,30,-40), vector3df(0,5,0)); - -#ifndef __EMSCRIPTEN__ // this part only so you can run the same code on desktop - /* - On desktop we run and endless loop until the user closes the window or - presses ALT+F4 (or whatever keycode closes a window). - */ - while(device->run()) - { - driver->beginScene(ECBF_COLOR | ECBF_DEPTH, SColor(255,100,101,140)); - - smgr->drawAll(); - guienv->drawAll(); - - driver->endScene(); - } - device->drop(); - -#else // __EMSCRIPTEN__ - - /* - Setting fps to 0 or a negative value will use the browser’s - requestAnimationFrame mechanism to call the main loop function. - Emscripten documentation recommends to do that, but you can also set - another fps value and the browser will try to call the main-loop - fps times per second. - The simulate_infinite_loop tells emscripten that this is an application - which will simulate an infinite loop. There is also a flag in the - Makefile about that: -s NO_EXIT_RUNTIME=1 - */ - int fps = 0; - int simulate_infinite_loop = 1; - emscripten_set_main_loop(one_iter, fps, simulate_infinite_loop); -#endif //__EMSCRIPTEN__ - - return 0; -} - -/* -That's it. Compile and run. -**/ diff --git a/examples/01.HelloWorld_emscripten/readme.txt b/examples/01.HelloWorld_emscripten/readme.txt deleted file mode 100644 index e1cfb5b2..00000000 --- a/examples/01.HelloWorld_emscripten/readme.txt +++ /dev/null @@ -1,24 +0,0 @@ -Emscripten is a project to compile c/c++ code int the asm.js format which can be run in some browsers. -See http://kripken.github.io/emscripten-site for more information. - -emscripten support for Irrlicht is a work in process. Use at your own risk. -Might take work and knowledge to get it running. - ------------- -REQUIREMENTS ------------- -You have to install the emscripten environment. - ----------------------------- -BUILDING Irrlicht & your App ----------------------------- - -Linux: -Go into source/Irrlicht folder and call: -emmake make emscripten - - -Go into examples/01.HelloWord_emscripten folder and call: -emmake make all_emscripten - -Note: The shell_minimal.html is currently not used (as resizing isn't working yet correctly), but can be enabled in the Makefile. diff --git a/examples/01.HelloWorld_emscripten/shell_minimal.html b/examples/01.HelloWorld_emscripten/shell_minimal.html deleted file mode 100644 index 15d8b3bf..00000000 --- a/examples/01.HelloWorld_emscripten/shell_minimal.html +++ /dev/null @@ -1,180 +0,0 @@ - - - - - - Emscripten-Generated Code - - - - - - - - - - -
-
emscripten
-
Downloading...
-
- -
-
- -
-
-
- Resize canvas - Lock/hide mouse pointer -     - -
- -
- -
- - {{{ SCRIPT }}} - - diff --git a/examples/01.HelloWorld_iOS/Assets.xcassets/AppIcon.appiconset/Contents.json b/examples/01.HelloWorld_iOS/Assets.xcassets/AppIcon.appiconset/Contents.json deleted file mode 100644 index 36d2c80d..00000000 --- a/examples/01.HelloWorld_iOS/Assets.xcassets/AppIcon.appiconset/Contents.json +++ /dev/null @@ -1,68 +0,0 @@ -{ - "images" : [ - { - "idiom" : "iphone", - "size" : "29x29", - "scale" : "2x" - }, - { - "idiom" : "iphone", - "size" : "29x29", - "scale" : "3x" - }, - { - "idiom" : "iphone", - "size" : "40x40", - "scale" : "2x" - }, - { - "idiom" : "iphone", - "size" : "40x40", - "scale" : "3x" - }, - { - "idiom" : "iphone", - "size" : "60x60", - "scale" : "2x" - }, - { - "idiom" : "iphone", - "size" : "60x60", - "scale" : "3x" - }, - { - "idiom" : "ipad", - "size" : "29x29", - "scale" : "1x" - }, - { - "idiom" : "ipad", - "size" : "29x29", - "scale" : "2x" - }, - { - "idiom" : "ipad", - "size" : "40x40", - "scale" : "1x" - }, - { - "idiom" : "ipad", - "size" : "40x40", - "scale" : "2x" - }, - { - "idiom" : "ipad", - "size" : "76x76", - "scale" : "1x" - }, - { - "idiom" : "ipad", - "size" : "76x76", - "scale" : "2x" - } - ], - "info" : { - "version" : 1, - "author" : "xcode" - } -} \ No newline at end of file diff --git a/examples/01.HelloWorld_iOS/HelloWorld_iOS.xcodeproj/project.pbxproj b/examples/01.HelloWorld_iOS/HelloWorld_iOS.xcodeproj/project.pbxproj deleted file mode 100644 index 18933c8d..00000000 --- a/examples/01.HelloWorld_iOS/HelloWorld_iOS.xcodeproj/project.pbxproj +++ /dev/null @@ -1,302 +0,0 @@ -// !$*UTF8*$! -{ - archiveVersion = 1; - classes = { - }; - objectVersion = 46; - objects = { - -/* Begin PBXBuildFile section */ - 5E172FF01C1DB99B0024464F /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 5E172FEF1C1DB99B0024464F /* UIKit.framework */; }; - 5E172FF21C1DB9C80024464F /* CoreMotion.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 5E172FF11C1DB9C80024464F /* CoreMotion.framework */; }; - 5E172FF41C1DBA610024464F /* OpenGLES.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 5E172FF31C1DBA610024464F /* OpenGLES.framework */; }; - 5E172FF81C1DBAC30024464F /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 5E172FF71C1DBAC30024464F /* Foundation.framework */; }; - 5E172FFC1C1DBB280024464F /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 5E172FFB1C1DBB280024464F /* QuartzCore.framework */; }; - 5E6AC1831C1DA8A100DADD92 /* main.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5E6AC1821C1DA8A100DADD92 /* main.cpp */; }; - 5E6AC1881C1DA9C000DADD92 /* media in Resources */ = {isa = PBXBuildFile; fileRef = 5E6AC1871C1DA9C000DADD92 /* media */; }; - 5E6AC18B1C1DAA3100DADD92 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 5E6AC18A1C1DAA3100DADD92 /* Assets.xcassets */; }; - 5E6AC18D1C1DAD9500DADD92 /* libIrrlicht.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 5E6AC18C1C1DAD9500DADD92 /* libIrrlicht.a */; }; -/* End PBXBuildFile section */ - -/* Begin PBXFileReference section */ - 5E172FEF1C1DB99B0024464F /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; }; - 5E172FF11C1DB9C80024464F /* CoreMotion.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreMotion.framework; path = System/Library/Frameworks/CoreMotion.framework; sourceTree = SDKROOT; }; - 5E172FF31C1DBA610024464F /* OpenGLES.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = OpenGLES.framework; path = System/Library/Frameworks/OpenGLES.framework; sourceTree = SDKROOT; }; - 5E172FF71C1DBAC30024464F /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; - 5E172FFB1C1DBB280024464F /* QuartzCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = QuartzCore.framework; path = System/Library/Frameworks/QuartzCore.framework; sourceTree = SDKROOT; }; - 5E6AC1821C1DA8A100DADD92 /* main.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = main.cpp; sourceTree = ""; }; - 5E6AC1871C1DA9C000DADD92 /* media */ = {isa = PBXFileReference; lastKnownFileType = folder; name = media; path = ../../media; sourceTree = ""; }; - 5E6AC1891C1DA9CE00DADD92 /* 28.HelloWorld_iOS.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = 28.HelloWorld_iOS.app; sourceTree = BUILT_PRODUCTS_DIR; }; - 5E6AC18A1C1DAA3100DADD92 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; - 5E6AC18C1C1DAD9500DADD92 /* libIrrlicht.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libIrrlicht.a; path = ../../lib/iOS/libIrrlicht.a; sourceTree = ""; }; -/* End PBXFileReference section */ - -/* Begin PBXFrameworksBuildPhase section */ - 5E6AC1651C1DA6CF00DADD92 /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - 5E172FF21C1DB9C80024464F /* CoreMotion.framework in Frameworks */, - 5E172FF81C1DBAC30024464F /* Foundation.framework in Frameworks */, - 5E172FF41C1DBA610024464F /* OpenGLES.framework in Frameworks */, - 5E172FF01C1DB99B0024464F /* UIKit.framework in Frameworks */, - 5E172FFC1C1DBB280024464F /* QuartzCore.framework in Frameworks */, - 5E6AC18D1C1DAD9500DADD92 /* libIrrlicht.a in Frameworks */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXFrameworksBuildPhase section */ - -/* Begin PBXGroup section */ - 5E6AC15F1C1DA6CF00DADD92 = { - isa = PBXGroup; - children = ( - 5E6AC1821C1DA8A100DADD92 /* main.cpp */, - 5E6AC1851C1DA91500DADD92 /* Libraries */, - 5E6AC1841C1DA90B00DADD92 /* Products */, - 5E6AC1861C1DA91E00DADD92 /* Resources */, - ); - sourceTree = ""; - }; - 5E6AC1841C1DA90B00DADD92 /* Products */ = { - isa = PBXGroup; - children = ( - 5E6AC1891C1DA9CE00DADD92 /* 28.HelloWorld_iOS.app */, - ); - name = Products; - sourceTree = ""; - }; - 5E6AC1851C1DA91500DADD92 /* Libraries */ = { - isa = PBXGroup; - children = ( - 5E172FF11C1DB9C80024464F /* CoreMotion.framework */, - 5E172FF71C1DBAC30024464F /* Foundation.framework */, - 5E172FF31C1DBA610024464F /* OpenGLES.framework */, - 5E172FEF1C1DB99B0024464F /* UIKit.framework */, - 5E172FFB1C1DBB280024464F /* QuartzCore.framework */, - 5E6AC18C1C1DAD9500DADD92 /* libIrrlicht.a */, - ); - name = Libraries; - sourceTree = ""; - }; - 5E6AC1861C1DA91E00DADD92 /* Resources */ = { - isa = PBXGroup; - children = ( - 5E6AC18A1C1DAA3100DADD92 /* Assets.xcassets */, - 5E6AC1871C1DA9C000DADD92 /* media */, - ); - name = Resources; - sourceTree = ""; - }; -/* End PBXGroup section */ - -/* Begin PBXNativeTarget section */ - 5E6AC1671C1DA6CF00DADD92 /* 28.HelloWorld_iOS */ = { - isa = PBXNativeTarget; - buildConfigurationList = 5E6AC17F1C1DA6D000DADD92 /* Build configuration list for PBXNativeTarget "28.HelloWorld_iOS" */; - buildPhases = ( - 5E6AC1641C1DA6CF00DADD92 /* Sources */, - 5E6AC1651C1DA6CF00DADD92 /* Frameworks */, - 5E6AC1661C1DA6CF00DADD92 /* Resources */, - ); - buildRules = ( - ); - dependencies = ( - ); - name = 28.HelloWorld_iOS; - productName = 28.HelloWorld_iOS; - productReference = 5E6AC1891C1DA9CE00DADD92 /* 28.HelloWorld_iOS.app */; - productType = "com.apple.product-type.application"; - }; -/* End PBXNativeTarget section */ - -/* Begin PBXProject section */ - 5E6AC1601C1DA6CF00DADD92 /* Project object */ = { - isa = PBXProject; - attributes = { - LastUpgradeCheck = 0830; - TargetAttributes = { - 5E6AC1671C1DA6CF00DADD92 = { - CreatedOnToolsVersion = 7.1.1; - }; - }; - }; - buildConfigurationList = 5E6AC1631C1DA6CF00DADD92 /* Build configuration list for PBXProject "HelloWorld_iOS" */; - compatibilityVersion = "Xcode 3.2"; - developmentRegion = English; - hasScannedForEncodings = 0; - knownRegions = ( - en, - Base, - ); - mainGroup = 5E6AC15F1C1DA6CF00DADD92; - productRefGroup = 5E6AC15F1C1DA6CF00DADD92; - projectDirPath = ""; - projectRoot = ""; - targets = ( - 5E6AC1671C1DA6CF00DADD92 /* 28.HelloWorld_iOS */, - ); - }; -/* End PBXProject section */ - -/* Begin PBXResourcesBuildPhase section */ - 5E6AC1661C1DA6CF00DADD92 /* Resources */ = { - isa = PBXResourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 5E6AC18B1C1DAA3100DADD92 /* Assets.xcassets in Resources */, - 5E6AC1881C1DA9C000DADD92 /* media in Resources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXResourcesBuildPhase section */ - -/* Begin PBXSourcesBuildPhase section */ - 5E6AC1641C1DA6CF00DADD92 /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 5E6AC1831C1DA8A100DADD92 /* main.cpp in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXSourcesBuildPhase section */ - -/* Begin XCBuildConfiguration section */ - 5E6AC17D1C1DA6D000DADD92 /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - CLANG_CXX_LANGUAGE_STANDARD = "c++0x"; - CLANG_CXX_LIBRARY = "libc++"; - CLANG_ENABLE_MODULES = YES; - CLANG_ENABLE_OBJC_ARC = YES; - 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_INFINITE_RECURSION = YES; - CLANG_WARN_INT_CONVERSION = YES; - CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; - CLANG_WARN_SUSPICIOUS_MOVE = YES; - CLANG_WARN_UNREACHABLE_CODE = YES; - CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; - COPY_PHASE_STRIP = NO; - DEBUG_INFORMATION_FORMAT = dwarf; - ENABLE_STRICT_OBJC_MSGSEND = YES; - ENABLE_TESTABILITY = YES; - GCC_C_LANGUAGE_STANDARD = c11; - GCC_DYNAMIC_NO_PIC = NO; - GCC_NO_COMMON_BLOCKS = YES; - GCC_OPTIMIZATION_LEVEL = 0; - GCC_PREPROCESSOR_DEFINITIONS = ( - "DEBUG=1", - "$(inherited)", - ); - 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; - IPHONEOS_DEPLOYMENT_TARGET = 8.0; - MTL_ENABLE_DEBUG_INFO = YES; - ONLY_ACTIVE_ARCH = YES; - SDKROOT = iphoneos; - TARGETED_DEVICE_FAMILY = "1,2"; - }; - name = Debug; - }; - 5E6AC17E1C1DA6D000DADD92 /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - CLANG_CXX_LANGUAGE_STANDARD = "c++0x"; - CLANG_CXX_LIBRARY = "libc++"; - CLANG_ENABLE_MODULES = YES; - CLANG_ENABLE_OBJC_ARC = YES; - 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_INFINITE_RECURSION = YES; - CLANG_WARN_INT_CONVERSION = YES; - CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; - CLANG_WARN_SUSPICIOUS_MOVE = YES; - CLANG_WARN_UNREACHABLE_CODE = YES; - CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; - COPY_PHASE_STRIP = NO; - DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; - ENABLE_NS_ASSERTIONS = NO; - 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_ERROR; - GCC_WARN_UNDECLARED_SELECTOR = YES; - GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; - GCC_WARN_UNUSED_FUNCTION = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 8.0; - MTL_ENABLE_DEBUG_INFO = NO; - SDKROOT = iphoneos; - TARGETED_DEVICE_FAMILY = "1,2"; - VALIDATE_PRODUCT = YES; - }; - name = Release; - }; - 5E6AC1801C1DA6D000DADD92 /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; - CODE_SIGN_IDENTITY = "iPhone Developer"; - HEADER_SEARCH_PATHS = "$(SRCROOT)/../../include"; - INFOPLIST_FILE = "$(SRCROOT)/../../media/info_ios.plist"; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; - LIBRARY_SEARCH_PATHS = "$(SRCROOT)/../../lib/iOS"; - PRODUCT_BUNDLE_IDENTIFIER = "org.irrlicht.-8-HelloWorld-iOS"; - PRODUCT_NAME = "$(TARGET_NAME)"; - }; - name = Debug; - }; - 5E6AC1811C1DA6D000DADD92 /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; - CODE_SIGN_IDENTITY = "iPhone Developer"; - HEADER_SEARCH_PATHS = "$(SRCROOT)/../../include"; - INFOPLIST_FILE = "$(SRCROOT)/../../media/info_ios.plist"; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; - LIBRARY_SEARCH_PATHS = "$(SRCROOT)/../../lib/iOS"; - PRODUCT_BUNDLE_IDENTIFIER = "org.irrlicht.-8-HelloWorld-iOS"; - PRODUCT_NAME = "$(TARGET_NAME)"; - }; - name = Release; - }; -/* End XCBuildConfiguration section */ - -/* Begin XCConfigurationList section */ - 5E6AC1631C1DA6CF00DADD92 /* Build configuration list for PBXProject "HelloWorld_iOS" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 5E6AC17D1C1DA6D000DADD92 /* Debug */, - 5E6AC17E1C1DA6D000DADD92 /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - 5E6AC17F1C1DA6D000DADD92 /* Build configuration list for PBXNativeTarget "28.HelloWorld_iOS" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 5E6AC1801C1DA6D000DADD92 /* Debug */, - 5E6AC1811C1DA6D000DADD92 /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; -/* End XCConfigurationList section */ - }; - rootObject = 5E6AC1601C1DA6CF00DADD92 /* Project object */; -} diff --git a/examples/01.HelloWorld_iOS/HelloWorld_iOS.xcodeproj/xcshareddata/xcschemes/28.HelloWorld_iOS.xcscheme b/examples/01.HelloWorld_iOS/HelloWorld_iOS.xcodeproj/xcshareddata/xcschemes/28.HelloWorld_iOS.xcscheme deleted file mode 100644 index 61feff08..00000000 --- a/examples/01.HelloWorld_iOS/HelloWorld_iOS.xcodeproj/xcshareddata/xcschemes/28.HelloWorld_iOS.xcscheme +++ /dev/null @@ -1,91 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/examples/01.HelloWorld_iOS/main.cpp b/examples/01.HelloWorld_iOS/main.cpp deleted file mode 100644 index 93b9405f..00000000 --- a/examples/01.HelloWorld_iOS/main.cpp +++ /dev/null @@ -1,62 +0,0 @@ -#include -#include "exampleHelper.h" - -using namespace irr; - -using namespace core; -using namespace scene; -using namespace video; -using namespace io; -using namespace gui; - -// It's important for iOS projects to use 'irrlicht_main' instead of standard 'main' function. - -void irrlicht_main() -{ - IrrlichtDevice *device = createDevice(EDT_OGLES2, dimension2d(0, 0), 16, false, false, false, 0); - - if (!device) - return; - - device->setWindowCaption(L"Hello World! - Irrlicht Engine Demo"); - - IVideoDriver* driver = device->getVideoDriver(); - ISceneManager* smgr = device->getSceneManager(); - IGUIEnvironment* guienv = device->getGUIEnvironment(); - - guienv->addStaticText(L"Hello World! This is the Irrlicht Software renderer!", rect(10,10,260,22), true); - - const io::path mediaPath = getExampleMediaPath(); - - IAnimatedMesh* mesh = smgr->getMesh(mediaPath + "sydney.md2"); - - if (!mesh) - { - device->drop(); - return; - } - - IAnimatedMeshSceneNode* node = smgr->addAnimatedMeshSceneNode( mesh ); - - if (node) - { - node->setMaterialFlag(EMF_LIGHTING, false); - node->setMD2Animation(scene::EMAT_STAND); - node->setMaterialTexture( 0, driver->getTexture(mediaPath + "sydney.bmp") ); - } - - smgr->addCameraSceneNode(0, vector3df(0,30,-40), vector3df(0,5,0)); - - while (device->run()) - if (device->isWindowActive()) - { - driver->beginScene(ECBF_COLOR | ECBF_DEPTH, SColor(255,255,255,255)); - - smgr->drawAll(); - guienv->drawAll(); - - driver->endScene(); - } - - device->drop(); -} diff --git a/examples/02.Quake3Map/Makefile b/examples/02.Quake3Map/Makefile deleted file mode 100644 index 10f2fcd7..00000000 --- a/examples/02.Quake3Map/Makefile +++ /dev/null @@ -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 := 02.Quake3Map -# 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 diff --git a/examples/02.Quake3Map/Quake3Map.cbp b/examples/02.Quake3Map/Quake3Map.cbp deleted file mode 100644 index 2d54a9c1..00000000 --- a/examples/02.Quake3Map/Quake3Map.cbp +++ /dev/null @@ -1,58 +0,0 @@ - - - - - - diff --git a/examples/02.Quake3Map/Quake3Map.vcproj b/examples/02.Quake3Map/Quake3Map.vcproj deleted file mode 100644 index 4416fbb4..00000000 --- a/examples/02.Quake3Map/Quake3Map.vcproj +++ /dev/null @@ -1,162 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/examples/02.Quake3Map/Quake3Map.xcodeproj/project.pbxproj b/examples/02.Quake3Map/Quake3Map.xcodeproj/project.pbxproj deleted file mode 100644 index e9ef2605..00000000 --- a/examples/02.Quake3Map/Quake3Map.xcodeproj/project.pbxproj +++ /dev/null @@ -1,326 +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 /* 02.Quake3Map.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = 02.Quake3Map.app; sourceTree = BUILT_PRODUCTS_DIR; }; - 5E34CC741B7F8EEF00F212E8 /* main.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = main.cpp; sourceTree = ""; }; - 5E34CC781B7F90A000F212E8 /* libIrrlicht.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libIrrlicht.a; path = ../../lib/OSX/libIrrlicht.a; sourceTree = ""; }; - 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 = ""; }; -/* 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 = ""; - }; - 5E34CC521B7F8E6E00F212E8 /* Products */ = { - isa = PBXGroup; - children = ( - 5E34CC511B7F8E6E00F212E8 /* 02.Quake3Map.app */, - ); - name = Products; - sourceTree = ""; - }; - 5E34CC761B7F905600F212E8 /* Libraries */ = { - isa = PBXGroup; - children = ( - 5E8570B01B7F99F500B267D2 /* Cocoa.framework */, - 5E8570B41B7F9A0700B267D2 /* IOKit.framework */, - 5E8570B21B7F99FE00B267D2 /* OpenGL.framework */, - 5E34CC781B7F90A000F212E8 /* libIrrlicht.a */, - ); - name = Libraries; - sourceTree = ""; - }; - 5E34CC771B7F906D00F212E8 /* Resources */ = { - isa = PBXGroup; - children = ( - 5E8570BE1B7F9D3A00B267D2 /* media */, - ); - name = Resources; - sourceTree = ""; - }; -/* End PBXGroup section */ - -/* Begin PBXNativeTarget section */ - 5E34CC501B7F8E6E00F212E8 /* 02.Quake3Map */ = { - isa = PBXNativeTarget; - buildConfigurationList = 5E34CC701B7F8E6E00F212E8 /* Build configuration list for PBXNativeTarget "02.Quake3Map" */; - buildPhases = ( - 5E34CC4D1B7F8E6E00F212E8 /* Sources */, - 5E34CC4E1B7F8E6E00F212E8 /* Frameworks */, - 5E34CC4F1B7F8E6E00F212E8 /* Resources */, - ); - buildRules = ( - ); - dependencies = ( - ); - name = 02.Quake3Map; - productName = 01.HelloWorld; - productReference = 5E34CC511B7F8E6E00F212E8 /* 02.Quake3Map.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 "Quake3Map" */; - compatibilityVersion = "Xcode 3.2"; - developmentRegion = English; - hasScannedForEncodings = 0; - knownRegions = ( - en, - Base, - ); - mainGroup = 5E34C6D81B7F4A0C00F212E8; - productRefGroup = 5E34CC521B7F8E6E00F212E8 /* Products */; - projectDirPath = ""; - projectRoot = ""; - targets = ( - 5E34CC501B7F8E6E00F212E8 /* 02.Quake3Map */, - ); - }; -/* 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_BUNDLE_IDENTIFIER = "org.irrlicht.$(PRODUCT_NAME:rfc1034identifier)"; - 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_BUNDLE_IDENTIFIER = "org.irrlicht.$(PRODUCT_NAME:rfc1034identifier)"; - PRODUCT_NAME = "$(TARGET_NAME)"; - SDKROOT = macosx; - }; - name = Release; - }; -/* End XCBuildConfiguration section */ - -/* Begin XCConfigurationList section */ - 5E34C6DC1B7F4A0C00F212E8 /* Build configuration list for PBXProject "Quake3Map" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 5E34C6DD1B7F4A0C00F212E8 /* Debug */, - 5E34C6DE1B7F4A0C00F212E8 /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - 5E34CC701B7F8E6E00F212E8 /* Build configuration list for PBXNativeTarget "02.Quake3Map" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 5E34CC6C1B7F8E6E00F212E8 /* Debug */, - 5E34CC6D1B7F8E6E00F212E8 /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; -/* End XCConfigurationList section */ - }; - rootObject = 5E34C6D91B7F4A0C00F212E8 /* Project object */; -} diff --git a/examples/02.Quake3Map/Quake3Map.xcodeproj/xcshareddata/xcschemes/02.Quake3Map.xcscheme b/examples/02.Quake3Map/Quake3Map.xcodeproj/xcshareddata/xcschemes/02.Quake3Map.xcscheme deleted file mode 100644 index 68dd239a..00000000 --- a/examples/02.Quake3Map/Quake3Map.xcodeproj/xcshareddata/xcschemes/02.Quake3Map.xcscheme +++ /dev/null @@ -1,91 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/examples/02.Quake3Map/Quake3Map_vc10.vcxproj b/examples/02.Quake3Map/Quake3Map_vc10.vcxproj deleted file mode 100644 index f45673aa..00000000 --- a/examples/02.Quake3Map/Quake3Map_vc10.vcxproj +++ /dev/null @@ -1,235 +0,0 @@ - - - - - Debug - Win32 - - - Debug - x64 - - - Release - Win32 - - - Release - x64 - - - - 02.Quake3Map - {D1A464A2-D479-458C-98A2-60965D823CD1} - Quake3Map - - - - Application - false - MultiByte - Windows7.1SDK - - - Application - false - MultiByte - Windows7.1SDK - - - Application - false - MultiByte - Windows7.1SDK - - - Application - false - MultiByte - Windows7.1SDK - - - - - - - - - - - - - - - - - - - - - - - <_ProjectFileVersion>10.0.30319.1 - ..\..\bin\Win32-VisualStudio\ - ..\..\bin\Win64-VisualStudio\ - - - ..\..\bin\Win32-VisualStudio\ - ..\..\bin\Win64-VisualStudio\ - - - AllRules.ruleset - AllRules.ruleset - - - - - AllRules.ruleset - AllRules.ruleset - - - - - - - - .\Debug/Quake3Map.tlb - - - - - Disabled - ..\..\include;%(AdditionalIncludeDirectories) - WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebug - - - Level3 - EditAndContinue - - - _DEBUG;%(PreprocessorDefinitions) - 0x0c07 - - - ..\..\bin\Win32-VisualStudio\02.Quake3Map.exe - ..\..\lib\Win32-visualstudio;%(AdditionalLibraryDirectories) - true - Console - - - - - - - .\Debug/Quake3Map.tlb - - - - - Disabled - ..\..\include;%(AdditionalIncludeDirectories) - WIN32;WIN64;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebug - - - Level3 - ProgramDatabase - - - _DEBUG;%(PreprocessorDefinitions) - 0x0c07 - - - ..\..\bin\Win64-VisualStudio\02.Quake3Map.exe - ..\..\lib\Win64-visualstudio;%(AdditionalLibraryDirectories) - true - Console - - - - - - - .\Release/Quake3Map.tlb - - - - - MaxSpeed - OnlyExplicitInline - ..\..\include;%(AdditionalIncludeDirectories) - WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) - true - MultiThreaded - true - - - Level3 - - - NDEBUG;%(PreprocessorDefinitions) - 0x0c07 - - - ..\..\bin\Win32-VisualStudio\02.Quake3Map.exe - ..\..\lib\Win32-visualstudio;%(AdditionalLibraryDirectories) - Console - - - - - - - .\Release/Quake3Map.tlb - - - - - MaxSpeed - OnlyExplicitInline - ..\..\include;%(AdditionalIncludeDirectories) - WIN32;WIN64;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) - true - MultiThreaded - true - - - Level3 - - - NDEBUG;%(PreprocessorDefinitions) - 0x0c07 - - - ..\..\bin\Win64-VisualStudio\02.Quake3Map.exe - ..\..\lib\Win64-visualstudio;%(AdditionalLibraryDirectories) - Console - - - - - - - Disabled - Disabled - %(AdditionalIncludeDirectories) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(PreprocessorDefinitions) - EnableFastChecks - EnableFastChecks - MaxSpeed - MaxSpeed - %(AdditionalIncludeDirectories) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(PreprocessorDefinitions) - - - - - - \ No newline at end of file diff --git a/examples/02.Quake3Map/Quake3Map_vc11.vcxproj b/examples/02.Quake3Map/Quake3Map_vc11.vcxproj deleted file mode 100644 index f45673aa..00000000 --- a/examples/02.Quake3Map/Quake3Map_vc11.vcxproj +++ /dev/null @@ -1,235 +0,0 @@ - - - - - Debug - Win32 - - - Debug - x64 - - - Release - Win32 - - - Release - x64 - - - - 02.Quake3Map - {D1A464A2-D479-458C-98A2-60965D823CD1} - Quake3Map - - - - Application - false - MultiByte - Windows7.1SDK - - - Application - false - MultiByte - Windows7.1SDK - - - Application - false - MultiByte - Windows7.1SDK - - - Application - false - MultiByte - Windows7.1SDK - - - - - - - - - - - - - - - - - - - - - - - <_ProjectFileVersion>10.0.30319.1 - ..\..\bin\Win32-VisualStudio\ - ..\..\bin\Win64-VisualStudio\ - - - ..\..\bin\Win32-VisualStudio\ - ..\..\bin\Win64-VisualStudio\ - - - AllRules.ruleset - AllRules.ruleset - - - - - AllRules.ruleset - AllRules.ruleset - - - - - - - - .\Debug/Quake3Map.tlb - - - - - Disabled - ..\..\include;%(AdditionalIncludeDirectories) - WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebug - - - Level3 - EditAndContinue - - - _DEBUG;%(PreprocessorDefinitions) - 0x0c07 - - - ..\..\bin\Win32-VisualStudio\02.Quake3Map.exe - ..\..\lib\Win32-visualstudio;%(AdditionalLibraryDirectories) - true - Console - - - - - - - .\Debug/Quake3Map.tlb - - - - - Disabled - ..\..\include;%(AdditionalIncludeDirectories) - WIN32;WIN64;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebug - - - Level3 - ProgramDatabase - - - _DEBUG;%(PreprocessorDefinitions) - 0x0c07 - - - ..\..\bin\Win64-VisualStudio\02.Quake3Map.exe - ..\..\lib\Win64-visualstudio;%(AdditionalLibraryDirectories) - true - Console - - - - - - - .\Release/Quake3Map.tlb - - - - - MaxSpeed - OnlyExplicitInline - ..\..\include;%(AdditionalIncludeDirectories) - WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) - true - MultiThreaded - true - - - Level3 - - - NDEBUG;%(PreprocessorDefinitions) - 0x0c07 - - - ..\..\bin\Win32-VisualStudio\02.Quake3Map.exe - ..\..\lib\Win32-visualstudio;%(AdditionalLibraryDirectories) - Console - - - - - - - .\Release/Quake3Map.tlb - - - - - MaxSpeed - OnlyExplicitInline - ..\..\include;%(AdditionalIncludeDirectories) - WIN32;WIN64;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) - true - MultiThreaded - true - - - Level3 - - - NDEBUG;%(PreprocessorDefinitions) - 0x0c07 - - - ..\..\bin\Win64-VisualStudio\02.Quake3Map.exe - ..\..\lib\Win64-visualstudio;%(AdditionalLibraryDirectories) - Console - - - - - - - Disabled - Disabled - %(AdditionalIncludeDirectories) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(PreprocessorDefinitions) - EnableFastChecks - EnableFastChecks - MaxSpeed - MaxSpeed - %(AdditionalIncludeDirectories) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(PreprocessorDefinitions) - - - - - - \ No newline at end of file diff --git a/examples/02.Quake3Map/Quake3Map_vc12.vcxproj b/examples/02.Quake3Map/Quake3Map_vc12.vcxproj deleted file mode 100644 index 042060f3..00000000 --- a/examples/02.Quake3Map/Quake3Map_vc12.vcxproj +++ /dev/null @@ -1,235 +0,0 @@ - - - - - Debug - Win32 - - - Debug - x64 - - - Release - Win32 - - - Release - x64 - - - - 02.Quake3Map - {D1A464A2-D479-458C-98A2-60965D823CD1} - Quake3Map - - - - Application - false - MultiByte - Windows7.1SDK - - - Application - false - MultiByte - Windows7.1SDK - - - Application - false - MultiByte - Windows7.1SDK - - - Application - false - MultiByte - Windows7.1SDK - - - - - - - - - - - - - - - - - - - - - - - <_ProjectFileVersion>10.0.30319.1 - ..\..\bin\Win32-VisualStudio\ - ..\..\bin\Win64-VisualStudio\ - - - ..\..\bin\Win32-VisualStudio\ - ..\..\bin\Win64-VisualStudio\ - - - AllRules.ruleset - AllRules.ruleset - - - - - AllRules.ruleset - AllRules.ruleset - - - - - - - - .\Debug/Quake3Map.tlb - - - - - Disabled - ..\..\include;%(AdditionalIncludeDirectories) - WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebug - - - Level3 - EditAndContinue - - - _DEBUG;%(PreprocessorDefinitions) - 0x0c07 - - - ..\..\bin\Win32-VisualStudio\02.Quake3Map.exe - ..\..\lib\Win32-visualstudio;%(AdditionalLibraryDirectories) - true - Console - - - - - - - .\Debug/Quake3Map.tlb - - - - - Disabled - ..\..\include;%(AdditionalIncludeDirectories) - WIN32;WIN64;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebug - - - Level3 - ProgramDatabase - - - _DEBUG;%(PreprocessorDefinitions) - 0x0c07 - - - ..\..\bin\Win64-VisualStudio\02.Quake3Map.exe - ..\..\lib\Win64-visualstudio;%(AdditionalLibraryDirectories) - true - Console - - - - - - - .\Release/Quake3Map.tlb - - - - - MaxSpeed - OnlyExplicitInline - ..\..\include;%(AdditionalIncludeDirectories) - WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) - true - MultiThreaded - true - - - Level3 - - - NDEBUG;%(PreprocessorDefinitions) - 0x0c07 - - - ..\..\bin\Win32-VisualStudio\02.Quake3Map.exe - ..\..\lib\Win32-visualstudio;%(AdditionalLibraryDirectories) - Console - - - - - - - .\Release/Quake3Map.tlb - - - - - MaxSpeed - OnlyExplicitInline - ..\..\include;%(AdditionalIncludeDirectories) - WIN32;WIN64;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) - true - MultiThreaded - true - - - Level3 - - - NDEBUG;%(PreprocessorDefinitions) - 0x0c07 - - - ..\..\bin\Win64-VisualStudio\02.Quake3Map.exe - ..\..\lib\Win64-visualstudio;%(AdditionalLibraryDirectories) - Console - - - - - - - Disabled - Disabled - %(AdditionalIncludeDirectories) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(PreprocessorDefinitions) - EnableFastChecks - EnableFastChecks - MaxSpeed - MaxSpeed - %(AdditionalIncludeDirectories) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(PreprocessorDefinitions) - - - - - - \ No newline at end of file diff --git a/examples/02.Quake3Map/Quake3Map_vc14.vcxproj b/examples/02.Quake3Map/Quake3Map_vc14.vcxproj deleted file mode 100644 index df7001d1..00000000 --- a/examples/02.Quake3Map/Quake3Map_vc14.vcxproj +++ /dev/null @@ -1,235 +0,0 @@ - - - - - Debug - Win32 - - - Debug - x64 - - - Release - Win32 - - - Release - x64 - - - - 02.Quake3Map - {D1A464A2-D479-458C-98A2-60965D823CD1} - Quake3Map - - - - Application - false - MultiByte - v140 - - - Application - false - MultiByte - v140 - - - Application - false - MultiByte - v140 - - - Application - false - MultiByte - v140 - - - - - - - - - - - - - - - - - - - - - - - <_ProjectFileVersion>10.0.30319.1 - ..\..\bin\Win32-VisualStudio\ - ..\..\bin\Win64-VisualStudio\ - - - ..\..\bin\Win32-VisualStudio\ - ..\..\bin\Win64-VisualStudio\ - - - AllRules.ruleset - AllRules.ruleset - - - - - AllRules.ruleset - AllRules.ruleset - - - - - - - - .\Debug/Quake3Map.tlb - - - - - Disabled - ..\..\include;%(AdditionalIncludeDirectories) - WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebug - - - Level3 - EditAndContinue - - - _DEBUG;%(PreprocessorDefinitions) - 0x0c07 - - - ..\..\bin\Win32-VisualStudio\02.Quake3Map.exe - ..\..\lib\Win32-visualstudio;%(AdditionalLibraryDirectories) - true - Console - - - - - - - .\Debug/Quake3Map.tlb - - - - - Disabled - ..\..\include;%(AdditionalIncludeDirectories) - WIN32;WIN64;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebug - - - Level3 - ProgramDatabase - - - _DEBUG;%(PreprocessorDefinitions) - 0x0c07 - - - ..\..\bin\Win64-VisualStudio\02.Quake3Map.exe - ..\..\lib\Win64-visualstudio;%(AdditionalLibraryDirectories) - true - Console - - - - - - - .\Release/Quake3Map.tlb - - - - - MaxSpeed - OnlyExplicitInline - ..\..\include;%(AdditionalIncludeDirectories) - WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) - true - MultiThreaded - true - - - Level3 - - - NDEBUG;%(PreprocessorDefinitions) - 0x0c07 - - - ..\..\bin\Win32-VisualStudio\02.Quake3Map.exe - ..\..\lib\Win32-visualstudio;%(AdditionalLibraryDirectories) - Console - - - - - - - .\Release/Quake3Map.tlb - - - - - MaxSpeed - OnlyExplicitInline - ..\..\include;%(AdditionalIncludeDirectories) - WIN32;WIN64;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) - true - MultiThreaded - true - - - Level3 - - - NDEBUG;%(PreprocessorDefinitions) - 0x0c07 - - - ..\..\bin\Win64-VisualStudio\02.Quake3Map.exe - ..\..\lib\Win64-visualstudio;%(AdditionalLibraryDirectories) - Console - - - - - - - Disabled - Disabled - %(AdditionalIncludeDirectories) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(PreprocessorDefinitions) - EnableFastChecks - EnableFastChecks - MaxSpeed - MaxSpeed - %(AdditionalIncludeDirectories) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(PreprocessorDefinitions) - - - - - - \ No newline at end of file diff --git a/examples/02.Quake3Map/main.cpp b/examples/02.Quake3Map/main.cpp deleted file mode 100644 index 042b70fe..00000000 --- a/examples/02.Quake3Map/main.cpp +++ /dev/null @@ -1,185 +0,0 @@ -/** Example 002 Quake3Map - -This tutorial shows how to load a Quake 3 map into the engine, create a -SceneNode for optimizing the speed of rendering, and how to create a user -controlled camera. - -Please note that you should know the basics of the engine before starting this -tutorial. Just take a short look at the first tutorial, if you haven't done -this yet: http://irrlicht.sourceforge.net/docu/example001.html - -Lets start like the HelloWorld example: We include the irrlicht header files -and an additional file to be able to ask the user for a driver type using the -console. -*/ -#include -#include "driverChoice.h" -#include "exampleHelper.h" - -/* -As already written in the HelloWorld example, in the Irrlicht Engine everything -can be found in the namespace 'irr'. To get rid of the irr:: in front of the -name of every class, we tell the compiler that we use that namespace from now -on, and we will not have to write that 'irr::'. There are 5 other sub -namespaces 'core', 'scene', 'video', 'io' and 'gui'. Unlike in the HelloWorld -example, we do not call 'using namespace' for these 5 other namespaces, because -in this way you will see what can be found in which namespace. But if you like, -you can also include the namespaces like in the previous example. -*/ -using namespace irr; - -/* -Again, to be able to use the Irrlicht.DLL file, we need to link with the -Irrlicht.lib. We could set this option in the project settings, but to make it -easy, we use a pragma comment lib: -*/ -#ifdef _MSC_VER -#pragma comment(lib, "Irrlicht.lib") -#endif - -/* -OK, lets start. Again, we use the main() method as start, not the WinMain(). -*/ -int main() -{ - /* - Like in the HelloWorld example, we create an IrrlichtDevice with - createDevice(). The difference now is that we ask the user to select - which video driver to use. The Software device might be - too slow to draw a huge Quake 3 map, but just for the fun of it, we make - this decision possible, too. - */ - - // ask user for driver - video::E_DRIVER_TYPE driverType=driverChoiceConsole(true); - if (driverType==video::EDT_COUNT) - return 1; - - // create device and exit if creation failed - - IrrlichtDevice *device = - createDevice(driverType, core::dimension2d(640, 480)); - - if (device == 0) - return 1; // could not create selected driver. - - /* - Get a pointer to the video driver and the SceneManager so that - we do not always have to call irr::IrrlichtDevice::getVideoDriver() and - irr::IrrlichtDevice::getSceneManager(). - */ - video::IVideoDriver* driver = device->getVideoDriver(); - scene::ISceneManager* smgr = device->getSceneManager(); - - /* - To display the Quake 3 map, we first need to load it. Quake 3 maps - are packed into .pk3 files which are nothing else than .zip files. - So we add the .pk3 file to our irr::io::IFileSystem. After it was added, - we can read from the files in that archive as if they were stored on disk. - */ - device->getFileSystem()->addFileArchive(getExampleMediaPath() + "map-20kdm2.pk3"); - - /* - Now we can load the mesh by calling irr::scene::ISceneManager::getMesh(). - We get a pointer returned to an irr::scene::IAnimatedMesh. Quake 3 maps are - not really animated, they are only a chunk of static geometry with - some materials attached. Hence the IAnimatedMesh consists of only one - frame, so we get the "first frame" of the "animation", which is our - quake level and create an Octree scene node with it, using - irr::scene::ISceneManager::addOctreeSceneNode(). - The Octree optimizes the scene a little bit, trying to draw only geometry - which is currently visible. An alternative to the Octree would be a - irr::scene::IMeshSceneNode, which would always draw the complete - geometry of the mesh, without optimization. Try it: Use - irr::scene::ISceneManager::addMeshSceneNode() instead of - addOctreeSceneNode() and compare the primitives drawn by the video - driver. (There is a irr::video::IVideoDriver::getPrimitiveCountDrawn() - method in the irr::video::IVideoDriver class). Note that this - optimization with the Octree is only useful when drawing huge meshes - consisting of lots of geometry and if users can't see the whole scene at - once. - */ - scene::IAnimatedMesh* mesh = smgr->getMesh("20kdm2.bsp"); - scene::ISceneNode* node = 0; - - if (mesh) - node = smgr->addOctreeSceneNode(mesh->getMesh(0), 0, -1, 1024); -// node = smgr->addMeshSceneNode(mesh->getMesh(0)); - - /* - Because the level was not modeled around the origin (0,0,0), we - translate the whole level a little bit. This is done on - irr::scene::ISceneNode level using the methods - irr::scene::ISceneNode::setPosition() (in this case), - irr::scene::ISceneNode::setRotation(), and - irr::scene::ISceneNode::setScale(). - */ - if (node) - node->setPosition(core::vector3df(-1300,-144,-1249)); - - /* - Now we need a camera to look at the Quake 3 map. - We want to create a user controlled camera. There are some - cameras available in the Irrlicht engine. For example the - MayaCamera which can be controlled like the camera in Maya: - Rotate with left mouse button pressed, Zoom with both buttons pressed, - translate with right mouse button pressed. This could be created with - irr::scene::ISceneManager::addCameraSceneNodeMaya(). But for this - example, we want to create a camera which behaves like the ones in - first person shooter games (FPS) and hence use - irr::scene::ISceneManager::addCameraSceneNodeFPS(). - */ - smgr->addCameraSceneNodeFPS(); - - /* - The mouse cursor needs not be visible, so we hide it via the - irr::IrrlichtDevice::ICursorControl. - */ - device->getCursorControl()->setVisible(false); - - /* - Everything is set up, so lets draw it. We also write the current - frames per second and the primitives drawn into the caption of the - window. The test for irr::IrrlichtDevice::isWindowActive() is optional, - but prevents the engine to grab the mouse cursor after task switching - when other programs are active. The call to irr::IrrlichtDevice::yield() - will avoid the busy loop to eat up all CPU cycles when the window is not - active. - */ - int lastFPS = -1; - - while(device->run()) - { - if (device->isWindowActive()) - { - driver->beginScene(video::ECBF_COLOR | video::ECBF_DEPTH, video::SColor(255,200,200,200)); - smgr->drawAll(); - driver->endScene(); - - int fps = driver->getFPS(); - - if (lastFPS != fps) - { - core::stringw str = L"Irrlicht Engine - Quake 3 Map example ["; - str += driver->getName(); - str += "] FPS:"; - str += fps; - - device->setWindowCaption(str.c_str()); - lastFPS = fps; - } - } - else - device->yield(); - } - - /* - In the end, delete the Irrlicht device. - */ - device->drop(); - return 0; -} - -/* -That's it. Compile and play around with the program. -**/ diff --git a/examples/02.Quake3Map/tutorial.html b/examples/02.Quake3Map/tutorial.html deleted file mode 100644 index 1858b866..00000000 --- a/examples/02.Quake3Map/tutorial.html +++ /dev/null @@ -1,181 +0,0 @@ - - -Irrlicht Engine Tutorial - - - - -
- - - - - - - - -
- Tutorial 2.Quake3Map
-

This Tutorial shows how to load a Quake 3 map into the engine, create - a SceneNode for optimizing the speed of rendering and how to create - a user controlled camera. Please note that you should know the basics - of the engine before starting this tutorial, just take a short look - at the first tutorial, 1.HelloWorld, if you haven't done this yet.
- The result of this example will look like this:

-


-

-
-
- - - - - - - -
- Lets start!
-

Lets start like the HelloWorld example: We include the irrlicht header - files and an additional file to be able
- to ask the user for a driver type using the console.

- - - - -
#include <irrlicht.h>
#include <iostream>
-

As already written in the HelloWorld example, in the Irrlicht Engine, - everything can be found in the namespace 'irr'. To get rid of the irr:: - in front of the name of every class, we tell the compiler that we use - that namespace from now on, and we will not have to write that 'irr::'.
- There are 5 other sub namespaces 'core', 'scene', 'video', 'io' and - 'gui'. Unlike in the HelloWorld example, we do not a 'using namespace' - for these 5 other namespaces because in this way you will see what can - be found in which namespace. But if you like, you can also include the - namespaces like in the previous example. Code just like you want to.

- - - - -
using namespace irr;
-

Again, to be able to use the Irrlicht.DLL file, we need to link with - the Irrlicht.lib. We could set this option in the project settings, - but to make it easy, we use a pragma comment lib:

- - - - -
#pragma comment(lib, "Irrlicht.lib")
- -
-

Ok, lets start. Again, we use the main() method as start, not the WinMain(), - because its shorter to write.

- - - - -
int main()
{
-

Like in the HelloWorld example, we create an IrrlichtDevice with createDevice(). - The difference now is that we ask the user to select which hardware accelerated - driver to use. The Software device would be too slow to draw a huge Quake - 3 map, but just for the fun of it, we make this decision possible too.

- - - - -
// ask user for driver

video::E_DRIVER_TYPE driverType = video::EDT_DIRECT3D9;

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;
-

Get a pointer to the video driver and the SceneManager so that we do - not always have to write device->getVideoDriver() and device->getSceneManager().

- - - - -
video::IVideoDriver* driver = device->getVideoDriver();
-scene::ISceneManager* smgr = device->getSceneManager();
-

To display the Quake 3 map, we first need to load it. Quake 3 maps are - packed into .pk3 files wich are nothing other than .zip files. So we add - the .pk3 file to our FileSystem. After it was added, we are able to read - from the files in that archive as they would directly be stored on disk.

- - - - -
device->getFileSystem()->addZipFileArchive("../../media/map-20kdm2.pk3");
-

Now we can load the mesh by calling getMesh(). We get a pointer returned - to a IAnimatedMesh. As you know, Quake 3 maps are not really animated, - they are only a huge chunk of static geometry with some materials attached. - Hence the IAnimated mesh consists of only one frame,
- so we get the "first frame" of the "animation", which - is our quake level and create an OctTree scene node with it, using addOctTreeSceneNode(). - The OctTree optimizes the scene a little bit, trying to draw only geometry - which is currently visible. An alternative to the OctTree would be a AnimatedMeshSceneNode, - which would draw always the complete geometry of the mesh, without optimization. - Try it out: Write addAnimatedMeshSceneNode instead of addOctTreeSceneNode - and compare the primitives drawed by the video driver. (There is a getPrimitiveCountDrawed() - method in the IVideoDriver class). Note that this optimization with the - Octree is only useful when drawing huge meshes consiting of lots of geometry.

- - - - -
scene::IAnimatedMesh* mesh = smgr->getMesh("20kdm2.bsp");
scene::ISceneNode* node = 0; - -if (mesh)
node = smgr->addOctTreeSceneNode(mesh->getMesh(0));
-

Because the level was modelled not around the origin (0,0,0), we translate - the whole level a little bit.

- - - - -
if (node)
node->setPosition(core::vector3df(-1300,-144,-1249));
-

Now we only need a Camera to look at the Quake 3 map. And we want to - create a user controlled camera. There are some different cameras available - in the Irrlicht engine. For example the Maya Camera which can be controlled - compareable to the camera in Maya: Rotate with left mouse button pressed, - Zoom with both buttons pressed,
- translate with right mouse button pressed. This could be created with - addCameraSceneNodeMaya(). But for this example, we want to create a camera - which behaves like the ones in first person shooter games (FPS):

- - - - -
smgr->addCameraSceneNodeFPS();
-

The mouse cursor needs not to be visible, so we make it invisible.

- - - - -
device->getCursorControl()->setVisible(false);
-

We have done everything, so lets draw it. We also write the current frames - per second and the drawn primitives to the caption of the window. The - 'if (device->isWindowActive())' line is optional, but prevents the - engine render to set the position of the mouse cursor after task switching - when other program are active.

- - - - -
int lastFPS = -1;
-
while(device->run())
-{
-  driver->beginScene(true, true, video::SColor(0,200,200,200));
-  smgr->drawAll();
-  driver->endScene();
-
  int fps = driver->getFPS();
-
  if (lastFPS != fps)
-  {
-     core::stringw str = L"Irrlicht Engine - Quake 3 Map example [";
str += driver->getName();
str += "] FPS:";
str += fps;
device->setWindowCaption(str.c_str());
lastFPS = fps; - } -}
-

In the end, delete the Irrlicht device.

- - - - -
  device->drop();
return 0;
}
-

That's it. Compile and play around with the program.

-

 

-

 

- - diff --git a/examples/03.CustomSceneNode/CustomSceneNode.cbp b/examples/03.CustomSceneNode/CustomSceneNode.cbp deleted file mode 100644 index 4295fbc3..00000000 --- a/examples/03.CustomSceneNode/CustomSceneNode.cbp +++ /dev/null @@ -1,58 +0,0 @@ - - - - - - diff --git a/examples/03.CustomSceneNode/CustomSceneNode.vcproj b/examples/03.CustomSceneNode/CustomSceneNode.vcproj deleted file mode 100644 index 890d308b..00000000 --- a/examples/03.CustomSceneNode/CustomSceneNode.vcproj +++ /dev/null @@ -1,163 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/examples/03.CustomSceneNode/CustomSceneNode.xcodeproj/project.pbxproj b/examples/03.CustomSceneNode/CustomSceneNode.xcodeproj/project.pbxproj deleted file mode 100644 index 9ac9c7c1..00000000 --- a/examples/03.CustomSceneNode/CustomSceneNode.xcodeproj/project.pbxproj +++ /dev/null @@ -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 /* 03.CustomSceneNode.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = 03.CustomSceneNode.app; sourceTree = BUILT_PRODUCTS_DIR; }; - 5E34CC741B7F8EEF00F212E8 /* main.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = main.cpp; sourceTree = ""; }; - 5E34CC781B7F90A000F212E8 /* libIrrlicht.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libIrrlicht.a; path = ../../lib/OSX/libIrrlicht.a; sourceTree = ""; }; - 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 = ""; }; -/* 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 = ""; - }; - 5E34CC521B7F8E6E00F212E8 /* Products */ = { - isa = PBXGroup; - children = ( - 5E34CC511B7F8E6E00F212E8 /* 03.CustomSceneNode.app */, - ); - name = Products; - sourceTree = ""; - }; - 5E34CC761B7F905600F212E8 /* Libraries */ = { - isa = PBXGroup; - children = ( - 5E8570B01B7F99F500B267D2 /* Cocoa.framework */, - 5E8570B41B7F9A0700B267D2 /* IOKit.framework */, - 5E8570B21B7F99FE00B267D2 /* OpenGL.framework */, - 5E34CC781B7F90A000F212E8 /* libIrrlicht.a */, - ); - name = Libraries; - sourceTree = ""; - }; - 5E34CC771B7F906D00F212E8 /* Resources */ = { - isa = PBXGroup; - children = ( - 5E8570BE1B7F9D3A00B267D2 /* media */, - ); - name = Resources; - sourceTree = ""; - }; -/* End PBXGroup section */ - -/* Begin PBXNativeTarget section */ - 5E34CC501B7F8E6E00F212E8 /* 03.CustomSceneNode */ = { - isa = PBXNativeTarget; - buildConfigurationList = 5E34CC701B7F8E6E00F212E8 /* Build configuration list for PBXNativeTarget "03.CustomSceneNode" */; - buildPhases = ( - 5E34CC4D1B7F8E6E00F212E8 /* Sources */, - 5E34CC4E1B7F8E6E00F212E8 /* Frameworks */, - 5E34CC4F1B7F8E6E00F212E8 /* Resources */, - ); - buildRules = ( - ); - dependencies = ( - ); - name = 03.CustomSceneNode; - productName = 01.HelloWorld; - productReference = 5E34CC511B7F8E6E00F212E8 /* 03.CustomSceneNode.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 "CustomSceneNode" */; - compatibilityVersion = "Xcode 3.2"; - developmentRegion = English; - hasScannedForEncodings = 0; - knownRegions = ( - en, - Base, - ); - mainGroup = 5E34C6D81B7F4A0C00F212E8; - productRefGroup = 5E34CC521B7F8E6E00F212E8 /* Products */; - projectDirPath = ""; - projectRoot = ""; - targets = ( - 5E34CC501B7F8E6E00F212E8 /* 03.CustomSceneNode */, - ); - }; -/* 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 "CustomSceneNode" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 5E34C6DD1B7F4A0C00F212E8 /* Debug */, - 5E34C6DE1B7F4A0C00F212E8 /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - 5E34CC701B7F8E6E00F212E8 /* Build configuration list for PBXNativeTarget "03.CustomSceneNode" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 5E34CC6C1B7F8E6E00F212E8 /* Debug */, - 5E34CC6D1B7F8E6E00F212E8 /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; -/* End XCConfigurationList section */ - }; - rootObject = 5E34C6D91B7F4A0C00F212E8 /* Project object */; -} diff --git a/examples/03.CustomSceneNode/CustomSceneNode.xcodeproj/xcshareddata/xcschemes/03.CustomSceneNode.xcscheme b/examples/03.CustomSceneNode/CustomSceneNode.xcodeproj/xcshareddata/xcschemes/03.CustomSceneNode.xcscheme deleted file mode 100644 index e186f6d6..00000000 --- a/examples/03.CustomSceneNode/CustomSceneNode.xcodeproj/xcshareddata/xcschemes/03.CustomSceneNode.xcscheme +++ /dev/null @@ -1,91 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/examples/03.CustomSceneNode/CustomSceneNode_vc10.vcxproj b/examples/03.CustomSceneNode/CustomSceneNode_vc10.vcxproj deleted file mode 100644 index 77e9e6e1..00000000 --- a/examples/03.CustomSceneNode/CustomSceneNode_vc10.vcxproj +++ /dev/null @@ -1,247 +0,0 @@ - - - - - Debug - Win32 - - - Debug - x64 - - - Release - Win32 - - - Release - x64 - - - - 03.CustomSceneNode - {171CCDFA-C140-4956-8EB7-F0168F4521D3} - CustomSceneNode - - - - Application - false - MultiByte - Windows7.1SDK - - - Application - false - MultiByte - Windows7.1SDK - - - Application - false - MultiByte - Windows7.1SDK - - - Application - false - MultiByte - Windows7.1SDK - - - - - - - - - - - - - - - - - - - - - - - <_ProjectFileVersion>10.0.30319.1 - ..\..\bin\Win32-VisualStudio\ - ..\..\bin\Win64-VisualStudio\ - - - ..\..\bin\Win32-VisualStudio\ - ..\..\bin\Win64-VisualStudio\ - - - AllRules.ruleset - AllRules.ruleset - - - - - AllRules.ruleset - AllRules.ruleset - - - - - - - - .\Debug/CustomSceneNode.tlb - - - - - Disabled - ..\..\include;%(AdditionalIncludeDirectories) - WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebug - - - Level3 - EditAndContinue - - - _DEBUG;%(PreprocessorDefinitions) - 0x0c07 - - - ..\..\bin\Win32-VisualStudio\03.CustomSceneNode.exe - ..\..\lib\Win32-visualstudio;%(AdditionalLibraryDirectories) - true - Console - - - - - - - .\Debug/CustomSceneNode.tlb - - - - - Disabled - ..\..\include;%(AdditionalIncludeDirectories) - WIN32;WIN64;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebug - - - Level3 - ProgramDatabase - - - _DEBUG;%(PreprocessorDefinitions) - 0x0c07 - - - ..\..\bin\Win64-VisualStudio\03.CustomSceneNode.exe - ..\..\lib\Win64-visualstudio;%(AdditionalLibraryDirectories) - true - Console - - - - - - - .\Release/CustomSceneNode.tlb - - - - - MaxSpeed - OnlyExplicitInline - ..\..\include;%(AdditionalIncludeDirectories) - WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) - true - MultiThreaded - true - - - .\Release/CustomSceneNode.pch - .\Release/ - .\Release/ - .\Release/ - Level3 - - - NDEBUG;%(PreprocessorDefinitions) - 0x0c07 - - - ..\..\bin\Win32-VisualStudio\03.CustomSceneNode.exe - ..\..\lib\Win32-visualstudio;%(AdditionalLibraryDirectories) - .\Release/CustomSceneNode.pdb - Console - false - - - - - - - .\Release/CustomSceneNode.tlb - - - - - MaxSpeed - OnlyExplicitInline - ..\..\include;%(AdditionalIncludeDirectories) - WIN32;WIN64;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) - true - MultiThreaded - true - - - .\Release/CustomSceneNode.pch - .\Release/ - .\Release/ - .\Release/ - Level3 - - - NDEBUG;%(PreprocessorDefinitions) - 0x0c07 - - - ..\..\bin\Win64-VisualStudio\03.CustomSceneNode.exe - ..\..\lib\Win64-visualstudio;%(AdditionalLibraryDirectories) - .\Release/CustomSceneNode.pdb - Console - false - - - - - - - Disabled - Disabled - %(AdditionalIncludeDirectories) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(PreprocessorDefinitions) - EnableFastChecks - EnableFastChecks - MaxSpeed - MaxSpeed - %(AdditionalIncludeDirectories) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(PreprocessorDefinitions) - - - - - - \ No newline at end of file diff --git a/examples/03.CustomSceneNode/CustomSceneNode_vc11.vcxproj b/examples/03.CustomSceneNode/CustomSceneNode_vc11.vcxproj deleted file mode 100644 index 77e9e6e1..00000000 --- a/examples/03.CustomSceneNode/CustomSceneNode_vc11.vcxproj +++ /dev/null @@ -1,247 +0,0 @@ - - - - - Debug - Win32 - - - Debug - x64 - - - Release - Win32 - - - Release - x64 - - - - 03.CustomSceneNode - {171CCDFA-C140-4956-8EB7-F0168F4521D3} - CustomSceneNode - - - - Application - false - MultiByte - Windows7.1SDK - - - Application - false - MultiByte - Windows7.1SDK - - - Application - false - MultiByte - Windows7.1SDK - - - Application - false - MultiByte - Windows7.1SDK - - - - - - - - - - - - - - - - - - - - - - - <_ProjectFileVersion>10.0.30319.1 - ..\..\bin\Win32-VisualStudio\ - ..\..\bin\Win64-VisualStudio\ - - - ..\..\bin\Win32-VisualStudio\ - ..\..\bin\Win64-VisualStudio\ - - - AllRules.ruleset - AllRules.ruleset - - - - - AllRules.ruleset - AllRules.ruleset - - - - - - - - .\Debug/CustomSceneNode.tlb - - - - - Disabled - ..\..\include;%(AdditionalIncludeDirectories) - WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebug - - - Level3 - EditAndContinue - - - _DEBUG;%(PreprocessorDefinitions) - 0x0c07 - - - ..\..\bin\Win32-VisualStudio\03.CustomSceneNode.exe - ..\..\lib\Win32-visualstudio;%(AdditionalLibraryDirectories) - true - Console - - - - - - - .\Debug/CustomSceneNode.tlb - - - - - Disabled - ..\..\include;%(AdditionalIncludeDirectories) - WIN32;WIN64;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebug - - - Level3 - ProgramDatabase - - - _DEBUG;%(PreprocessorDefinitions) - 0x0c07 - - - ..\..\bin\Win64-VisualStudio\03.CustomSceneNode.exe - ..\..\lib\Win64-visualstudio;%(AdditionalLibraryDirectories) - true - Console - - - - - - - .\Release/CustomSceneNode.tlb - - - - - MaxSpeed - OnlyExplicitInline - ..\..\include;%(AdditionalIncludeDirectories) - WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) - true - MultiThreaded - true - - - .\Release/CustomSceneNode.pch - .\Release/ - .\Release/ - .\Release/ - Level3 - - - NDEBUG;%(PreprocessorDefinitions) - 0x0c07 - - - ..\..\bin\Win32-VisualStudio\03.CustomSceneNode.exe - ..\..\lib\Win32-visualstudio;%(AdditionalLibraryDirectories) - .\Release/CustomSceneNode.pdb - Console - false - - - - - - - .\Release/CustomSceneNode.tlb - - - - - MaxSpeed - OnlyExplicitInline - ..\..\include;%(AdditionalIncludeDirectories) - WIN32;WIN64;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) - true - MultiThreaded - true - - - .\Release/CustomSceneNode.pch - .\Release/ - .\Release/ - .\Release/ - Level3 - - - NDEBUG;%(PreprocessorDefinitions) - 0x0c07 - - - ..\..\bin\Win64-VisualStudio\03.CustomSceneNode.exe - ..\..\lib\Win64-visualstudio;%(AdditionalLibraryDirectories) - .\Release/CustomSceneNode.pdb - Console - false - - - - - - - Disabled - Disabled - %(AdditionalIncludeDirectories) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(PreprocessorDefinitions) - EnableFastChecks - EnableFastChecks - MaxSpeed - MaxSpeed - %(AdditionalIncludeDirectories) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(PreprocessorDefinitions) - - - - - - \ No newline at end of file diff --git a/examples/03.CustomSceneNode/CustomSceneNode_vc12.vcxproj b/examples/03.CustomSceneNode/CustomSceneNode_vc12.vcxproj deleted file mode 100644 index aa125e42..00000000 --- a/examples/03.CustomSceneNode/CustomSceneNode_vc12.vcxproj +++ /dev/null @@ -1,247 +0,0 @@ - - - - - Debug - Win32 - - - Debug - x64 - - - Release - Win32 - - - Release - x64 - - - - 03.CustomSceneNode - {171CCDFA-C140-4956-8EB7-F0168F4521D3} - CustomSceneNode - - - - Application - false - MultiByte - Windows7.1SDK - - - Application - false - MultiByte - Windows7.1SDK - - - Application - false - MultiByte - Windows7.1SDK - - - Application - false - MultiByte - Windows7.1SDK - - - - - - - - - - - - - - - - - - - - - - - <_ProjectFileVersion>10.0.30319.1 - ..\..\bin\Win32-VisualStudio\ - ..\..\bin\Win64-VisualStudio\ - - - ..\..\bin\Win32-VisualStudio\ - ..\..\bin\Win64-VisualStudio\ - - - AllRules.ruleset - AllRules.ruleset - - - - - AllRules.ruleset - AllRules.ruleset - - - - - - - - .\Debug/CustomSceneNode.tlb - - - - - Disabled - ..\..\include;%(AdditionalIncludeDirectories) - WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebug - - - Level3 - EditAndContinue - - - _DEBUG;%(PreprocessorDefinitions) - 0x0c07 - - - ..\..\bin\Win32-VisualStudio\03.CustomSceneNode.exe - ..\..\lib\Win32-visualstudio;%(AdditionalLibraryDirectories) - true - Console - - - - - - - .\Debug/CustomSceneNode.tlb - - - - - Disabled - ..\..\include;%(AdditionalIncludeDirectories) - WIN32;WIN64;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebug - - - Level3 - ProgramDatabase - - - _DEBUG;%(PreprocessorDefinitions) - 0x0c07 - - - ..\..\bin\Win64-VisualStudio\03.CustomSceneNode.exe - ..\..\lib\Win64-visualstudio;%(AdditionalLibraryDirectories) - true - Console - - - - - - - .\Release/CustomSceneNode.tlb - - - - - MaxSpeed - OnlyExplicitInline - ..\..\include;%(AdditionalIncludeDirectories) - WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) - true - MultiThreaded - true - - - .\Release/CustomSceneNode.pch - .\Release/ - .\Release/ - .\Release/ - Level3 - - - NDEBUG;%(PreprocessorDefinitions) - 0x0c07 - - - ..\..\bin\Win32-VisualStudio\03.CustomSceneNode.exe - ..\..\lib\Win32-visualstudio;%(AdditionalLibraryDirectories) - .\Release/CustomSceneNode.pdb - Console - false - - - - - - - .\Release/CustomSceneNode.tlb - - - - - MaxSpeed - OnlyExplicitInline - ..\..\include;%(AdditionalIncludeDirectories) - WIN32;WIN64;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) - true - MultiThreaded - true - - - .\Release/CustomSceneNode.pch - .\Release/ - .\Release/ - .\Release/ - Level3 - - - NDEBUG;%(PreprocessorDefinitions) - 0x0c07 - - - ..\..\bin\Win64-VisualStudio\03.CustomSceneNode.exe - ..\..\lib\Win64-visualstudio;%(AdditionalLibraryDirectories) - .\Release/CustomSceneNode.pdb - Console - false - - - - - - - Disabled - Disabled - %(AdditionalIncludeDirectories) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(PreprocessorDefinitions) - EnableFastChecks - EnableFastChecks - MaxSpeed - MaxSpeed - %(AdditionalIncludeDirectories) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(PreprocessorDefinitions) - - - - - - \ No newline at end of file diff --git a/examples/03.CustomSceneNode/CustomSceneNode_vc14.vcxproj b/examples/03.CustomSceneNode/CustomSceneNode_vc14.vcxproj deleted file mode 100644 index 42e75d1f..00000000 --- a/examples/03.CustomSceneNode/CustomSceneNode_vc14.vcxproj +++ /dev/null @@ -1,247 +0,0 @@ - - - - - Debug - Win32 - - - Debug - x64 - - - Release - Win32 - - - Release - x64 - - - - 03.CustomSceneNode - {171CCDFA-C140-4956-8EB7-F0168F4521D3} - CustomSceneNode - - - - Application - false - MultiByte - v140 - - - Application - false - MultiByte - v140 - - - Application - false - MultiByte - v140 - - - Application - false - MultiByte - v140 - - - - - - - - - - - - - - - - - - - - - - - <_ProjectFileVersion>10.0.30319.1 - ..\..\bin\Win32-VisualStudio\ - ..\..\bin\Win64-VisualStudio\ - - - ..\..\bin\Win32-VisualStudio\ - ..\..\bin\Win64-VisualStudio\ - - - AllRules.ruleset - AllRules.ruleset - - - - - AllRules.ruleset - AllRules.ruleset - - - - - - - - .\Debug/CustomSceneNode.tlb - - - - - Disabled - ..\..\include;%(AdditionalIncludeDirectories) - WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebug - - - Level3 - EditAndContinue - - - _DEBUG;%(PreprocessorDefinitions) - 0x0c07 - - - ..\..\bin\Win32-VisualStudio\03.CustomSceneNode.exe - ..\..\lib\Win32-visualstudio;%(AdditionalLibraryDirectories) - true - Console - - - - - - - .\Debug/CustomSceneNode.tlb - - - - - Disabled - ..\..\include;%(AdditionalIncludeDirectories) - WIN32;WIN64;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebug - - - Level3 - ProgramDatabase - - - _DEBUG;%(PreprocessorDefinitions) - 0x0c07 - - - ..\..\bin\Win64-VisualStudio\03.CustomSceneNode.exe - ..\..\lib\Win64-visualstudio;%(AdditionalLibraryDirectories) - true - Console - - - - - - - .\Release/CustomSceneNode.tlb - - - - - MaxSpeed - OnlyExplicitInline - ..\..\include;%(AdditionalIncludeDirectories) - WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) - true - MultiThreaded - true - - - .\Release/CustomSceneNode.pch - .\Release/ - .\Release/ - .\Release/ - Level3 - - - NDEBUG;%(PreprocessorDefinitions) - 0x0c07 - - - ..\..\bin\Win32-VisualStudio\03.CustomSceneNode.exe - ..\..\lib\Win32-visualstudio;%(AdditionalLibraryDirectories) - .\Release/CustomSceneNode.pdb - Console - false - - - - - - - .\Release/CustomSceneNode.tlb - - - - - MaxSpeed - OnlyExplicitInline - ..\..\include;%(AdditionalIncludeDirectories) - WIN32;WIN64;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) - true - MultiThreaded - true - - - .\Release/CustomSceneNode.pch - .\Release/ - .\Release/ - .\Release/ - Level3 - - - NDEBUG;%(PreprocessorDefinitions) - 0x0c07 - - - ..\..\bin\Win64-VisualStudio\03.CustomSceneNode.exe - ..\..\lib\Win64-visualstudio;%(AdditionalLibraryDirectories) - .\Release/CustomSceneNode.pdb - Console - false - - - - - - - Disabled - Disabled - %(AdditionalIncludeDirectories) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(PreprocessorDefinitions) - EnableFastChecks - EnableFastChecks - MaxSpeed - MaxSpeed - %(AdditionalIncludeDirectories) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(PreprocessorDefinitions) - - - - - - \ No newline at end of file diff --git a/examples/03.CustomSceneNode/Makefile b/examples/03.CustomSceneNode/Makefile deleted file mode 100644 index 7daed21a..00000000 --- a/examples/03.CustomSceneNode/Makefile +++ /dev/null @@ -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 := 03.CustomSceneNode -# 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 diff --git a/examples/03.CustomSceneNode/main.cpp b/examples/03.CustomSceneNode/main.cpp deleted file mode 100644 index 95529312..00000000 --- a/examples/03.CustomSceneNode/main.cpp +++ /dev/null @@ -1,268 +0,0 @@ -/** Example 003 Custom SceneNode - -This tutorial is more advanced than the previous ones. -If you are currently just playing around with the Irrlicht -engine, you may want to look at other examples first. -This tutorials shows how to create a custom scene node and -how to use it in the engine. A custom scene node is needed -if you want to implement a render technique the Irrlicht -Engine currently does not support. For example, you can write -an indoor portal based renderer or an advanced terrain scene -node with it. By creating custom scene nodes, you can -easily extend the Irrlicht Engine and adapt it to your needs. - -I will keep the tutorial simple: Keep everything very short -and everything in one .cpp file. This is the style which -will also be used in most of the following tutorials. - -To start, I include the header files, use the irr namespace, -and tell the linker to link with the .lib file. -*/ -#include -#include "driverChoice.h" - -using namespace irr; - -#ifdef _MSC_VER -#pragma comment(lib, "Irrlicht.lib") -#endif - -/* -Here comes the more sophisticated part of this tutorial: -The class of our very own custom scene node. To keep it simple, -our scene node will not be an indoor portal renderer nor a terrain -scene node, but a simple tetrahedron, a 3D object consisting of 4 -connected vertices, which only draws itself and does nothing more. -Note that this scenario does not require a custom scene node in Irrlicht. -Instead one would create a mesh from the geometry and pass it to a -irr::scene::IMeshSceneNode. This example just illustrates creation of a custom -scene node in a simple setting. - -To allow our scene node to be inserted into the Irrlicht -Engine scene, the class we create needs to be derived from the -irr::scene::ISceneNode class and has to override some methods. -*/ - -class CSampleSceneNode : public scene::ISceneNode -{ - - /* - First, we declare some member variables: - The bounding box, 4 vertices, and the material of the tetrahedron. - */ - core::aabbox3d Box; - video::S3DVertex Vertices[4]; - video::SMaterial Material; - -public: - - /* - The parameters of the constructor specify the parent of the scene node, - a pointer to the scene manager, and an id of the scene node. - In the constructor we call the parent class' constructor, - set some properties of the material, and create the 4 vertices of - the tetrahedron. - */ - - CSampleSceneNode(scene::ISceneNode* parent, scene::ISceneManager* mgr, s32 id) - : scene::ISceneNode(parent, mgr, id) - { - Material.Wireframe = false; - Material.Lighting = false; - Material.Thickness=0.f; - - Vertices[0] = video::S3DVertex(0,0,10, 5,1,0, - video::SColor(255,0,255,255), 0, 1); - Vertices[1] = video::S3DVertex(10,0,-10, 10,0,0, - video::SColor(255,255,0,255), 1, 1); - Vertices[2] = video::S3DVertex(0,20,0, 20,1,1, - video::SColor(255,255,255,0), 1, 0); - Vertices[3] = video::S3DVertex(-10,0,-10, 40,0,1, - video::SColor(255,0,255,0), 0, 0); - - /* - The Irrlicht Engine needs to know the bounding box of a scene node. - It will use it for automatic culling and other things. Hence, we - need to create a bounding box from the 4 vertices we use. - If you do not want the engine to use the box for automatic culling, - and/or don't want to create the box, you could also call - irr::scene::ISceneNode::setAutomaticCulling() with irr::scene::EAC_OFF. - */ - Box.reset(Vertices[0].Pos); - for (s32 i=1; i<4; ++i) - Box.addInternalPoint(Vertices[i].Pos); - } - - /* - Before it is drawn, the irr::scene::ISceneNode::OnRegisterSceneNode() - method of every scene node in the scene is called by the scene manager. - If the scene node wishes to draw itself, it may register itself in the - scene manager to be drawn. This is necessary to tell the scene manager - when it should call irr::scene::ISceneNode::render(). For - example, normal scene nodes render their content one after another, - while stencil buffer shadows would like to be drawn after all other - scene nodes. And camera or light scene nodes need to be rendered before - all other scene nodes (if at all). So here we simply register the - scene node to render normally. If we would like to let it be rendered - like cameras or light, we would have to call - SceneManager->registerNodeForRendering(this, SNRT_LIGHT_AND_CAMERA); - After this, we call the actual irr::scene::ISceneNode::OnRegisterSceneNode() - method of the base class, which lets all the child scene nodes of this node - register themselves. - */ - virtual void OnRegisterSceneNode() - { - if (IsVisible) - SceneManager->registerNodeForRendering(this); - - ISceneNode::OnRegisterSceneNode(); - } - - /* - In the render() method most of the interesting stuff happens: The - Scene node renders itself. We override this method and draw the - tetrahedron. - */ - virtual void render() - { - /* Indices into the 'Vertices' array. A triangle needs 3 vertices - so you have to pass the 3 corresponding indices for each triangle to - tell which of the vertices should be used for it. */ - u16 indices[] = { 0,2,3, 2,1,3, 1,0,3, 2,0,1 }; - video::IVideoDriver* driver = SceneManager->getVideoDriver(); - - driver->setMaterial(Material); - driver->setTransform(video::ETS_WORLD, AbsoluteTransformation); - driver->drawVertexPrimitiveList(&Vertices[0], 4, &indices[0], 4, video::EVT_STANDARD, scene::EPT_TRIANGLES, video::EIT_16BIT); - } - - /* - And finally we create three small additional methods. - irr::scene::ISceneNode::getBoundingBox() returns the bounding box of - this scene node, irr::scene::ISceneNode::getMaterialCount() returns the - amount of materials in this scene node (our tetrahedron only has one - material), and irr::scene::ISceneNode::getMaterial() returns the - material at an index. Because we have only one material, we can - return that and assume that no one ever calls getMaterial() with an index - greater than 0. - */ - virtual const core::aabbox3d& getBoundingBox() const - { - return Box; - } - - virtual u32 getMaterialCount() const - { - return 1; - } - - virtual video::SMaterial& getMaterial(u32 i) - { - return Material; - } -}; - -/* -That's it. The Scene node is done. Now we start the engine, -create the scene node and a camera, and look at the result. -*/ -int main() -{ - // ask user for driver - video::E_DRIVER_TYPE driverType=driverChoiceConsole(); - if (driverType==video::EDT_COUNT) - return 1; - - // create device - IrrlichtDevice *device = createDevice(driverType, - core::dimension2d(640, 480), 16, false); - - if (device == 0) - return 1; // could not create selected driver. - - // set window caption, get some pointers, create a camera - - device->setWindowCaption(L"Custom Scene Node - Irrlicht Engine Demo"); - - video::IVideoDriver* driver = device->getVideoDriver(); - scene::ISceneManager* smgr = device->getSceneManager(); - - smgr->addCameraSceneNode(0, core::vector3df(0,-40,0), core::vector3df(0,0,0)); - - /* - Create our scene node. I don't check the result of calling new, as it - should throw an exception rather than returning 0 on failure. Because - the new node will create itself with a reference count of 1, and then - will have another reference added by its parent scene node when it is - added to the scene, I need to drop my reference to it. Best practice is - to drop it only *after* I have finished using it, regardless of what - the reference count of the object is after creation. - */ - CSampleSceneNode *myNode = - new CSampleSceneNode(smgr->getRootSceneNode(), smgr, 666); - - /* - To animate something in this boring scene consisting only of one - tetrahedron, and to show that you now can use your scene node like any - other scene node in the engine, we add an animator to the scene node, - which rotates the node a little bit. - irr::scene::ISceneManager::createRotationAnimator() could return 0, so - should be checked. - */ - scene::ISceneNodeAnimator* anim = - smgr->createRotationAnimator(core::vector3df(0.8f, 0, 0.8f)); - - if(anim) - { - myNode->addAnimator(anim); - - /* - I'm done referring to anim, so must - irr::IReferenceCounted::drop() this reference now because it - was produced by a createFoo() function. As I shouldn't refer to - it again, ensure that I can't by setting to 0. - */ - anim->drop(); - anim = 0; - } - - /* - I'm done with my CSampleSceneNode object, and so must drop my reference. - This won't delete the object, yet, because it is still attached to the - scene graph, which prevents the deletion until the graph is deleted or the - custom scene node is removed from it. - */ - myNode->drop(); - myNode = 0; // As I shouldn't refer to it again, ensure that I can't - - /* - Now draw everything and finish. - */ - u32 frames=0; - while(device->run()) - { - driver->beginScene(video::ECBF_COLOR | video::ECBF_DEPTH, video::SColor(0,100,100,100)); - - smgr->drawAll(); - - driver->endScene(); - if (++frames==100) // don't update more often, setWindowCaption can be expensive - { - core::stringw str = L"Irrlicht Engine ["; - str += driver->getName(); - str += L"] FPS: "; - str += (s32)driver->getFPS(); - - device->setWindowCaption(str.c_str()); - frames=0; - } - } - - device->drop(); - - return 0; -} - -/* -That's it. Compile and play around with the program. -**/ diff --git a/examples/03.CustomSceneNode/tutorial.html b/examples/03.CustomSceneNode/tutorial.html deleted file mode 100644 index becc3d77..00000000 --- a/examples/03.CustomSceneNode/tutorial.html +++ /dev/null @@ -1,222 +0,0 @@ - - -Irrlicht Engine Tutorial - - - - -
- - - - - - - - -
-
-
-
Tutorial 3.CustomSceneNode
-
-
-
-

This Tutorial is a tutorial for more advanced developers. If you are - currently just playing around with the Irrlicht engine, please look - at other examples first. This tutorial shows how to create a custom - scene node and how to use it in the engine. A custom scene node is needed, - if you want to implement a render technique, the Irrlicht Engine is - currently not supporting. For example you can write a indoor portal - based renderer or a advanced terrain scene node with it. With creating - custom scene nodes, you can easily extend the Irrlicht Engine and adapt - it to your needs.

-

I will keep the tutorial simple: Keep everything very short, everything - in one .cpp file, and I'll use the engine here as in all other tutorials. - At the end of the tutorial, the result will look like the image below. - This looks not very exciting, but it is a complete customized scene - node and a good point to start from creating you own scene nodes.

-


-

-
-
-
- - - - - - - -
- Lets start!
-

To start, I include the header files, use the irr namespace, and tell - the linker to link with the .lib file.

- - - - -
#include <irrlicht.h>
using namespace irr;
#pragma comment(lib, "Irrlicht.lib")
-

Here comes the most sophisticated part of this tutorial: The class - of our very own custom scene node. To keep it simple,
- our scene node will not be an indoor portal renderer nor a terrain scene - node, but a simple tetraeder, a 3d object consiting of 4 connected vertices, - which only draws itself and does nothing more.

-

To let our scene node be able to be inserted into the Irrlicht Engine - scene, the class we create needs only be derived from the ISceneNode - class and has to override some methods.

- - - - -
class CSampleSceneNode : public scene::ISceneNode
{
-

First, we declare some member variables, to hold data for our tetraeder: - The bounding box, 4 vertices, and
- the material of the tetraeder.

- - - - -
core::aabbox3d<f32> Box;
video::S3DVertex Vertices[4];
video::SMaterial Material;
-

The parameters of the constructor specify the parent of the scene node, - a pointer to the scene manager, and an id of the scene node. In the - constructor itself, we call the parent classes constructor, set some - properties of the material we use to draw the scene node and create - the 4 vertices of the tetraeder we will draw later.

- - - - -
public:
CSampleSceneNode(scene::ISceneNode* parent, scene::ISceneManager* mgr, s32 id)
- : scene::ISceneNode(parent, mgr, id)
-{ 
-  Material.Wireframe = false;
-  Material.Lighting = false;
-
  Vertices[0] = video::S3DVertex(0,0,10, 1,1,0,video::SColor(255,0,255,255),0,1);
-  Vertices[1] = video::S3DVertex(10,0,-10, 1,0,0,video::SColor(255,255,0,255),1,1); 
-  Vertices[2] = video::S3DVertex(0,20,0, 0,1,1,video::SColor(255,255,255,0),1,0);
-  Vertices[3] = video::S3DVertex(-10,0,-10, 0,0,1,video::SColor(255,0,255,0),0,0);
-
-
- The Irrlicht Engine needs to know the bounding box of your scene node. - It will use it for doing automatic culling and other things. Hence we - need to create a bounding box from the 4 vertices we use. If you do not - want the engine to use the box for automatic culling, and/or don't want - to create the box, you could also write
- AutomaticCullingEnabled = false;.
-
- - - - -
  Box.reset(Vertices[0].Pos);
for (s32 i=1; i<4; ++i)
Box.addInternalPoint(Vertices[i].Pos); -}
-
-

Before it is drawn, the OnPreRender() method of every scene node in - the scene is called by the scene manager. If the scene node wishes to - draw itself, it may register itself in the scene manager to be drawn. - This is necessary to tell the scene manager when it should call the - ::render method. For example normal scene nodes render their content - one after another, while stencil buffer shadows would like to be drawn - after all other scene nodes. And camera or light scene nodes need to - be rendered before all other scene nodes (if at all).
- So here we simply register the scene node to get rendered normally. - If we would like to let it be rendered like cameras or light, we would - have to call SceneManager->registerNodeForRendering(this, SNRT_LIGHT_AND_CAMERA); -
- After this, we call the OnPreRender-method of the base class ISceneNode, - which simply lets also all the child scene nodes of this node register - themselves.

-
- - - - -
virtual void OnPreRender()
{
if (IsVisible)
SceneManager->registerNodeForRendering(this); - - ISceneNode::OnPreRender(); -}
-

In the render() method most of the interresting stuff happenes: The Scene - node renders itself. We override this method and draw the tetraeder.

- - - - -
virtual void render()
{
u16 indices[] = { 0,2,3, 2,1,3, 1,0,3, 2,0,1 }; - video::IVideoDriver* driver = SceneManager->getVideoDriver();
-
  driver->setMaterial(Material);
-  driver->setTransform(video::ETS_WORLD, AbsoluteTransformation);
-  driver->drawIndexedTriangleList(&Vertices[0], 4, &indices[0], 4);
-}
-

At least, we create three small additional methods. GetBoundingBox() - returns the bounding box of this scene node,
- GetMaterialCount() returns the amount of materials in this scene node - (our tetraeder only has one material), and getMaterial() returns the material - at an index. Because we have only one material here, we can return the - only one material, assuming that no one ever calls getMaterial() with - an index greater than 0.

- - - - -
  virtual const core::aabbox3d<f32>& getBoundingBox() const
{
return Box;
}
  virtual u32 getMaterialCount()
-  {
-    return 1;
-  }
  virtual video::SMaterial& getMaterial(u32 i)
-  {
-    return Material;
-  } 
-};
-

That's it. The Scene node is done. Now we simply have to start the engine, - create the scene node and a camera, and look at the result.

- - - - -
int main()
{ - IrrlichtDevice *device = - createDevice(video::EDT_OPENGL, core::dimension2d<s32>(640, 480), 16, false);
  device->setWindowCaption(L"Custom Scene Node - Irrlicht Engine Demo");
  video::IVideoDriver* driver = device->getVideoDriver();
-           scene::ISceneManager* smgr = device->getSceneManager();
-
  smgr->addCameraSceneNode(0, core::vector3df(0,-40,0), core::vector3df(0,0,0));
-                   
-

Create our scene node. Note that it is dropped (->drop()) instantly - after we create it. This is possible because the scene manager now takes - care of it. This is not nessecary, it would also be possible to drop it - at the end of the program.

- - - - -
CSampleSceneNode *myNode = 
new CSampleSceneNode(smgr->getRootSceneNode(), smgr, 666); - -myNode->drop();
-

To animate something in this boring scene consisting only of one tetraeder, - and to show, that you now can use your scene node like any other scene - node in the engine, we add an animator to the scene node, which rotates - the node a little bit.

- - - - -
scene::ISceneNodeAnimator* anim = 
smgr->createRotationAnimator(core::vector3df(0.8f, 0, 0.8f)); - -myNode->addAnimator(anim); -anim->drop();
-

Now draw everything and finish.

- - - - -
  while(device->run())
{
driver->beginScene(true, true, video::SColor(0,100,100,100)); - - smgr->drawAll(); - - driver->endScene(); - } - -device->drop(); -return 0; -}
-

That's it. Compile and play around with the program.

-

 

- - diff --git a/examples/04.Movement/Makefile b/examples/04.Movement/Makefile deleted file mode 100644 index c5d50c9d..00000000 --- a/examples/04.Movement/Makefile +++ /dev/null @@ -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 := 04.Movement -# 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 diff --git a/examples/04.Movement/Movement.cbp b/examples/04.Movement/Movement.cbp deleted file mode 100644 index 76e2f439..00000000 --- a/examples/04.Movement/Movement.cbp +++ /dev/null @@ -1,55 +0,0 @@ - - - - - - diff --git a/examples/04.Movement/Movement.vcproj b/examples/04.Movement/Movement.vcproj deleted file mode 100644 index 105c6258..00000000 --- a/examples/04.Movement/Movement.vcproj +++ /dev/null @@ -1,163 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/examples/04.Movement/Movement.xcodeproj/project.pbxproj b/examples/04.Movement/Movement.xcodeproj/project.pbxproj deleted file mode 100644 index 06d14890..00000000 --- a/examples/04.Movement/Movement.xcodeproj/project.pbxproj +++ /dev/null @@ -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 /* 04.Movement.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = 04.Movement.app; sourceTree = BUILT_PRODUCTS_DIR; }; - 5E34CC741B7F8EEF00F212E8 /* main.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = main.cpp; sourceTree = ""; }; - 5E34CC781B7F90A000F212E8 /* libIrrlicht.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libIrrlicht.a; path = ../../lib/OSX/libIrrlicht.a; sourceTree = ""; }; - 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 = ""; }; -/* 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 = ""; - }; - 5E34CC521B7F8E6E00F212E8 /* Products */ = { - isa = PBXGroup; - children = ( - 5E34CC511B7F8E6E00F212E8 /* 04.Movement.app */, - ); - name = Products; - sourceTree = ""; - }; - 5E34CC761B7F905600F212E8 /* Libraries */ = { - isa = PBXGroup; - children = ( - 5E8570B01B7F99F500B267D2 /* Cocoa.framework */, - 5E8570B41B7F9A0700B267D2 /* IOKit.framework */, - 5E8570B21B7F99FE00B267D2 /* OpenGL.framework */, - 5E34CC781B7F90A000F212E8 /* libIrrlicht.a */, - ); - name = Libraries; - sourceTree = ""; - }; - 5E34CC771B7F906D00F212E8 /* Resources */ = { - isa = PBXGroup; - children = ( - 5E8570BE1B7F9D3A00B267D2 /* media */, - ); - name = Resources; - sourceTree = ""; - }; -/* End PBXGroup section */ - -/* Begin PBXNativeTarget section */ - 5E34CC501B7F8E6E00F212E8 /* 04.Movement */ = { - isa = PBXNativeTarget; - buildConfigurationList = 5E34CC701B7F8E6E00F212E8 /* Build configuration list for PBXNativeTarget "04.Movement" */; - buildPhases = ( - 5E34CC4D1B7F8E6E00F212E8 /* Sources */, - 5E34CC4E1B7F8E6E00F212E8 /* Frameworks */, - 5E34CC4F1B7F8E6E00F212E8 /* Resources */, - ); - buildRules = ( - ); - dependencies = ( - ); - name = 04.Movement; - productName = 01.HelloWorld; - productReference = 5E34CC511B7F8E6E00F212E8 /* 04.Movement.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 "Movement" */; - compatibilityVersion = "Xcode 3.2"; - developmentRegion = English; - hasScannedForEncodings = 0; - knownRegions = ( - en, - Base, - ); - mainGroup = 5E34C6D81B7F4A0C00F212E8; - productRefGroup = 5E34CC521B7F8E6E00F212E8 /* Products */; - projectDirPath = ""; - projectRoot = ""; - targets = ( - 5E34CC501B7F8E6E00F212E8 /* 04.Movement */, - ); - }; -/* 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 "Movement" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 5E34C6DD1B7F4A0C00F212E8 /* Debug */, - 5E34C6DE1B7F4A0C00F212E8 /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - 5E34CC701B7F8E6E00F212E8 /* Build configuration list for PBXNativeTarget "04.Movement" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 5E34CC6C1B7F8E6E00F212E8 /* Debug */, - 5E34CC6D1B7F8E6E00F212E8 /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; -/* End XCConfigurationList section */ - }; - rootObject = 5E34C6D91B7F4A0C00F212E8 /* Project object */; -} diff --git a/examples/04.Movement/Movement.xcodeproj/xcshareddata/xcschemes/04.Movement.xcscheme b/examples/04.Movement/Movement.xcodeproj/xcshareddata/xcschemes/04.Movement.xcscheme deleted file mode 100644 index aec7f206..00000000 --- a/examples/04.Movement/Movement.xcodeproj/xcshareddata/xcschemes/04.Movement.xcscheme +++ /dev/null @@ -1,91 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/examples/04.Movement/Movement_vc10.vcxproj b/examples/04.Movement/Movement_vc10.vcxproj deleted file mode 100644 index 131479da..00000000 --- a/examples/04.Movement/Movement_vc10.vcxproj +++ /dev/null @@ -1,235 +0,0 @@ - - - - - Debug - Win32 - - - Debug - x64 - - - Release - Win32 - - - Release - x64 - - - - 04.Movement - {7BDBB7E8-E0C9-4A0D-83C1-D389D6140FEF} - Movement - - - - Application - false - MultiByte - Windows7.1SDK - - - Application - false - MultiByte - Windows7.1SDK - - - Application - false - MultiByte - Windows7.1SDK - - - Application - false - MultiByte - Windows7.1SDK - - - - - - - - - - - - - - - - - - - - - - - <_ProjectFileVersion>10.0.30319.1 - ..\..\bin\Win32-VisualStudio\ - ..\..\bin\Win64-VisualStudio\ - - - ..\..\bin\Win32-VisualStudio\ - ..\..\bin\Win64-VisualStudio\ - - - AllRules.ruleset - AllRules.ruleset - - - - - AllRules.ruleset - AllRules.ruleset - - - - - - - - .\Debug/Movement.tlb - - - - - Disabled - ..\..\include;%(AdditionalIncludeDirectories) - WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebug - - - Level3 - EditAndContinue - - - _DEBUG;%(PreprocessorDefinitions) - 0x0c07 - - - ..\..\bin\Win32-VisualStudio\04.Movement.exe - ..\..\lib\Win32-visualstudio;%(AdditionalLibraryDirectories) - true - Console - - - - - - - .\Debug/Movement.tlb - - - - - Disabled - ..\..\include;%(AdditionalIncludeDirectories) - WIN32;WIN64;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebug - - - Level3 - ProgramDatabase - - - _DEBUG;%(PreprocessorDefinitions) - 0x0c07 - - - ..\..\bin\Win64-VisualStudio\04.Movement.exe - ..\..\lib\Win64-visualstudio;%(AdditionalLibraryDirectories) - true - Console - - - - - - - .\Release/Movement.tlb - - - - - MaxSpeed - OnlyExplicitInline - ..\..\include;%(AdditionalIncludeDirectories) - WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) - true - MultiThreaded - true - - - Level3 - - - NDEBUG;%(PreprocessorDefinitions) - 0x0c07 - - - ..\..\bin\Win32-VisualStudio\04.Movement.exe - ..\..\lib\Win32-visualstudio;%(AdditionalLibraryDirectories) - Console - - - - - - - .\Release/Movement.tlb - - - - - MaxSpeed - OnlyExplicitInline - ..\..\include;%(AdditionalIncludeDirectories) - WIN32;WIN64;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) - true - MultiThreaded - true - - - Level3 - - - NDEBUG;%(PreprocessorDefinitions) - 0x0c07 - - - ..\..\bin\Win64-VisualStudio\04.Movement.exe - ..\..\lib\Win64-visualstudio;%(AdditionalLibraryDirectories) - Console - - - - - - - Disabled - Disabled - %(AdditionalIncludeDirectories) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(PreprocessorDefinitions) - EnableFastChecks - EnableFastChecks - MaxSpeed - MaxSpeed - %(AdditionalIncludeDirectories) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(PreprocessorDefinitions) - - - - - - \ No newline at end of file diff --git a/examples/04.Movement/Movement_vc11.vcxproj b/examples/04.Movement/Movement_vc11.vcxproj deleted file mode 100644 index 131479da..00000000 --- a/examples/04.Movement/Movement_vc11.vcxproj +++ /dev/null @@ -1,235 +0,0 @@ - - - - - Debug - Win32 - - - Debug - x64 - - - Release - Win32 - - - Release - x64 - - - - 04.Movement - {7BDBB7E8-E0C9-4A0D-83C1-D389D6140FEF} - Movement - - - - Application - false - MultiByte - Windows7.1SDK - - - Application - false - MultiByte - Windows7.1SDK - - - Application - false - MultiByte - Windows7.1SDK - - - Application - false - MultiByte - Windows7.1SDK - - - - - - - - - - - - - - - - - - - - - - - <_ProjectFileVersion>10.0.30319.1 - ..\..\bin\Win32-VisualStudio\ - ..\..\bin\Win64-VisualStudio\ - - - ..\..\bin\Win32-VisualStudio\ - ..\..\bin\Win64-VisualStudio\ - - - AllRules.ruleset - AllRules.ruleset - - - - - AllRules.ruleset - AllRules.ruleset - - - - - - - - .\Debug/Movement.tlb - - - - - Disabled - ..\..\include;%(AdditionalIncludeDirectories) - WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebug - - - Level3 - EditAndContinue - - - _DEBUG;%(PreprocessorDefinitions) - 0x0c07 - - - ..\..\bin\Win32-VisualStudio\04.Movement.exe - ..\..\lib\Win32-visualstudio;%(AdditionalLibraryDirectories) - true - Console - - - - - - - .\Debug/Movement.tlb - - - - - Disabled - ..\..\include;%(AdditionalIncludeDirectories) - WIN32;WIN64;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebug - - - Level3 - ProgramDatabase - - - _DEBUG;%(PreprocessorDefinitions) - 0x0c07 - - - ..\..\bin\Win64-VisualStudio\04.Movement.exe - ..\..\lib\Win64-visualstudio;%(AdditionalLibraryDirectories) - true - Console - - - - - - - .\Release/Movement.tlb - - - - - MaxSpeed - OnlyExplicitInline - ..\..\include;%(AdditionalIncludeDirectories) - WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) - true - MultiThreaded - true - - - Level3 - - - NDEBUG;%(PreprocessorDefinitions) - 0x0c07 - - - ..\..\bin\Win32-VisualStudio\04.Movement.exe - ..\..\lib\Win32-visualstudio;%(AdditionalLibraryDirectories) - Console - - - - - - - .\Release/Movement.tlb - - - - - MaxSpeed - OnlyExplicitInline - ..\..\include;%(AdditionalIncludeDirectories) - WIN32;WIN64;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) - true - MultiThreaded - true - - - Level3 - - - NDEBUG;%(PreprocessorDefinitions) - 0x0c07 - - - ..\..\bin\Win64-VisualStudio\04.Movement.exe - ..\..\lib\Win64-visualstudio;%(AdditionalLibraryDirectories) - Console - - - - - - - Disabled - Disabled - %(AdditionalIncludeDirectories) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(PreprocessorDefinitions) - EnableFastChecks - EnableFastChecks - MaxSpeed - MaxSpeed - %(AdditionalIncludeDirectories) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(PreprocessorDefinitions) - - - - - - \ No newline at end of file diff --git a/examples/04.Movement/Movement_vc12.vcxproj b/examples/04.Movement/Movement_vc12.vcxproj deleted file mode 100644 index bbebe747..00000000 --- a/examples/04.Movement/Movement_vc12.vcxproj +++ /dev/null @@ -1,235 +0,0 @@ - - - - - Debug - Win32 - - - Debug - x64 - - - Release - Win32 - - - Release - x64 - - - - 04.Movement - {7BDBB7E8-E0C9-4A0D-83C1-D389D6140FEF} - Movement - - - - Application - false - MultiByte - Windows7.1SDK - - - Application - false - MultiByte - Windows7.1SDK - - - Application - false - MultiByte - Windows7.1SDK - - - Application - false - MultiByte - Windows7.1SDK - - - - - - - - - - - - - - - - - - - - - - - <_ProjectFileVersion>10.0.30319.1 - ..\..\bin\Win32-VisualStudio\ - ..\..\bin\Win64-VisualStudio\ - - - ..\..\bin\Win32-VisualStudio\ - ..\..\bin\Win64-VisualStudio\ - - - AllRules.ruleset - AllRules.ruleset - - - - - AllRules.ruleset - AllRules.ruleset - - - - - - - - .\Debug/Movement.tlb - - - - - Disabled - ..\..\include;%(AdditionalIncludeDirectories) - WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebug - - - Level3 - EditAndContinue - - - _DEBUG;%(PreprocessorDefinitions) - 0x0c07 - - - ..\..\bin\Win32-VisualStudio\04.Movement.exe - ..\..\lib\Win32-visualstudio;%(AdditionalLibraryDirectories) - true - Console - - - - - - - .\Debug/Movement.tlb - - - - - Disabled - ..\..\include;%(AdditionalIncludeDirectories) - WIN32;WIN64;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebug - - - Level3 - ProgramDatabase - - - _DEBUG;%(PreprocessorDefinitions) - 0x0c07 - - - ..\..\bin\Win64-VisualStudio\04.Movement.exe - ..\..\lib\Win64-visualstudio;%(AdditionalLibraryDirectories) - true - Console - - - - - - - .\Release/Movement.tlb - - - - - MaxSpeed - OnlyExplicitInline - ..\..\include;%(AdditionalIncludeDirectories) - WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) - true - MultiThreaded - true - - - Level3 - - - NDEBUG;%(PreprocessorDefinitions) - 0x0c07 - - - ..\..\bin\Win32-VisualStudio\04.Movement.exe - ..\..\lib\Win32-visualstudio;%(AdditionalLibraryDirectories) - Console - - - - - - - .\Release/Movement.tlb - - - - - MaxSpeed - OnlyExplicitInline - ..\..\include;%(AdditionalIncludeDirectories) - WIN32;WIN64;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) - true - MultiThreaded - true - - - Level3 - - - NDEBUG;%(PreprocessorDefinitions) - 0x0c07 - - - ..\..\bin\Win64-VisualStudio\04.Movement.exe - ..\..\lib\Win64-visualstudio;%(AdditionalLibraryDirectories) - Console - - - - - - - Disabled - Disabled - %(AdditionalIncludeDirectories) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(PreprocessorDefinitions) - EnableFastChecks - EnableFastChecks - MaxSpeed - MaxSpeed - %(AdditionalIncludeDirectories) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(PreprocessorDefinitions) - - - - - - \ No newline at end of file diff --git a/examples/04.Movement/Movement_vc14.vcxproj b/examples/04.Movement/Movement_vc14.vcxproj deleted file mode 100644 index f56853e9..00000000 --- a/examples/04.Movement/Movement_vc14.vcxproj +++ /dev/null @@ -1,235 +0,0 @@ - - - - - Debug - Win32 - - - Debug - x64 - - - Release - Win32 - - - Release - x64 - - - - 04.Movement - {7BDBB7E8-E0C9-4A0D-83C1-D389D6140FEF} - Movement - - - - Application - false - MultiByte - v140 - - - Application - false - MultiByte - v140 - - - Application - false - MultiByte - v140 - - - Application - false - MultiByte - v140 - - - - - - - - - - - - - - - - - - - - - - - <_ProjectFileVersion>10.0.30319.1 - ..\..\bin\Win32-VisualStudio\ - ..\..\bin\Win64-VisualStudio\ - - - ..\..\bin\Win32-VisualStudio\ - ..\..\bin\Win64-VisualStudio\ - - - AllRules.ruleset - AllRules.ruleset - - - - - AllRules.ruleset - AllRules.ruleset - - - - - - - - .\Debug/Movement.tlb - - - - - Disabled - ..\..\include;%(AdditionalIncludeDirectories) - WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebug - - - Level3 - EditAndContinue - - - _DEBUG;%(PreprocessorDefinitions) - 0x0c07 - - - ..\..\bin\Win32-VisualStudio\04.Movement.exe - ..\..\lib\Win32-visualstudio;%(AdditionalLibraryDirectories) - true - Console - - - - - - - .\Debug/Movement.tlb - - - - - Disabled - ..\..\include;%(AdditionalIncludeDirectories) - WIN32;WIN64;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebug - - - Level3 - ProgramDatabase - - - _DEBUG;%(PreprocessorDefinitions) - 0x0c07 - - - ..\..\bin\Win64-VisualStudio\04.Movement.exe - ..\..\lib\Win64-visualstudio;%(AdditionalLibraryDirectories) - true - Console - - - - - - - .\Release/Movement.tlb - - - - - MaxSpeed - OnlyExplicitInline - ..\..\include;%(AdditionalIncludeDirectories) - WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) - true - MultiThreaded - true - - - Level3 - - - NDEBUG;%(PreprocessorDefinitions) - 0x0c07 - - - ..\..\bin\Win32-VisualStudio\04.Movement.exe - ..\..\lib\Win32-visualstudio;%(AdditionalLibraryDirectories) - Console - - - - - - - .\Release/Movement.tlb - - - - - MaxSpeed - OnlyExplicitInline - ..\..\include;%(AdditionalIncludeDirectories) - WIN32;WIN64;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) - true - MultiThreaded - true - - - Level3 - - - NDEBUG;%(PreprocessorDefinitions) - 0x0c07 - - - ..\..\bin\Win64-VisualStudio\04.Movement.exe - ..\..\lib\Win64-visualstudio;%(AdditionalLibraryDirectories) - Console - - - - - - - Disabled - Disabled - %(AdditionalIncludeDirectories) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(PreprocessorDefinitions) - EnableFastChecks - EnableFastChecks - MaxSpeed - MaxSpeed - %(AdditionalIncludeDirectories) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(PreprocessorDefinitions) - - - - - - \ No newline at end of file diff --git a/examples/04.Movement/main.cpp b/examples/04.Movement/main.cpp deleted file mode 100644 index dcbcc30e..00000000 --- a/examples/04.Movement/main.cpp +++ /dev/null @@ -1,265 +0,0 @@ -/** Example 004 Movement - -This tutorial shows how to move and animate SceneNodes. The -basic concept of SceneNodeAnimators is shown as well as manual -movement of nodes using the keyboard. We'll demonstrate framerate -independent movement, which means moving by an amount dependent -on the duration of the last run of the Irrlicht loop. - -Example 19.MouseAndJoystick shows how to handle other input than keyboard. - -As always, include the header files, use the irr namespace, -and tell the linker to link with the .lib file. -*/ -#ifdef _MSC_VER -#pragma comment(lib, "Irrlicht.lib") -#endif - -#include -#include "driverChoice.h" -#include "exampleHelper.h" - -using namespace irr; - -/* -To receive events like mouse and keyboard input, or GUI events like -"button has been clicked", we need an object which is derived from the -irr::IEventReceiver object. There is only one method to override: -irr::IEventReceiver::OnEvent(). This method will be called by the engine once -when an event happens. What we really want to know is whether a key is being -held down, and so we will remember the current state of each key. -*/ -class MyEventReceiver : public IEventReceiver -{ -public: - // This is the one method that we have to implement - virtual bool OnEvent(const SEvent& event) - { - // Remember whether each key is down or up - if (event.EventType == irr::EET_KEY_INPUT_EVENT) - KeyIsDown[event.KeyInput.Key] = event.KeyInput.PressedDown; - - /* - Always return false by default. If you return true you tell the engine - that you handled this event completely and the Irrlicht should not - process it any further. So for example if you return true for all - EET_KEY_INPUT_EVENT events then Irrlicht would not pass on key-events - to it's GUI system. - */ - return false; - } - - // This is used to check whether a key is being held down - virtual bool IsKeyDown(EKEY_CODE keyCode) const - { - return KeyIsDown[keyCode]; - } - - MyEventReceiver() - { - for (u32 i=0; i(640, 480), 16, false, false, false, &receiver); - - if (device == 0) - return 1; // could not create selected driver. - - video::IVideoDriver* driver = device->getVideoDriver(); - scene::ISceneManager* smgr = device->getSceneManager(); - - const io::path mediaPath = getExampleMediaPath(); - - /* - Create the node which will be moved with the WSAD keys. We create a - sphere node, which is a built-in geometry primitive. We place the node - at (0,0,30) and assign a texture to it to let it look a little bit more - interesting. Because we have no dynamic lights in this scene we disable - lighting for each model (otherwise the models would be black). - */ - scene::ISceneNode * sphereNode = smgr->addSphereSceneNode(); - if (sphereNode) - { - sphereNode->setPosition(core::vector3df(0,0,30)); - sphereNode->setMaterialTexture(0, driver->getTexture(mediaPath + "wall.bmp")); - sphereNode->setMaterialFlag(video::EMF_LIGHTING, false); - } - - /* - Now we create another node, movable using a scene node animator. Scene - node animators modify scene nodes and can be attached to any scene node - like mesh scene nodes, billboards, lights and even camera scene nodes. - Scene node animators are not only able to modify the position of a - scene node, they can also animate the textures of an object for - example. We create a cube scene node and attach a 'fly circle' scene - node animator to it, letting this node fly around our sphere scene node. - */ - scene::ISceneNode* cubeNode = smgr->addCubeSceneNode(); - if (cubeNode) - { - cubeNode->setMaterialTexture(0, driver->getTexture(mediaPath + "t351sml.jpg")); - cubeNode->setMaterialFlag(video::EMF_LIGHTING, false); - scene::ISceneNodeAnimator* anim = - smgr->createFlyCircleAnimator(core::vector3df(0,0,30), 20.0f); - if (anim) - { - cubeNode->addAnimator(anim); - anim->drop(); - } - } - - /* - The last scene node we add is a b3d model of a walking ninja. Is shows the - use of a 'fly straight' animator to move the node between two points. - */ - scene::IAnimatedMeshSceneNode* ninjaNode = - smgr->addAnimatedMeshSceneNode(smgr->getMesh(mediaPath + "ninja.b3d")); - - if (ninjaNode) - { - scene::ISceneNodeAnimator* anim = - smgr->createFlyStraightAnimator(core::vector3df(100,0,60), - core::vector3df(-100,0,60), 3500, true); - if (anim) - { - ninjaNode->addAnimator(anim); - anim->drop(); - } - - /* - To make the model look right we disable lighting, set the - frames between which the animation should loop, rotate the - model around 180 degrees, and adjust the animation speed and - the texture. To set the correct animation (frames and speed), we - would also be able to just call - "ninjaNode->setMD2Animation(scene::EMAT_RUN)" for the 'run' - animation instead of "setFrameLoop" and "setAnimationSpeed", - But that only works with MD2 animations, while this can be used to - start other animations. For MD2 it's usually good advice not to use - hardcoded frame-numbers... - */ - ninjaNode->setMaterialFlag(video::EMF_LIGHTING, false); - - ninjaNode->setFrameLoop(0, 13); - ninjaNode->setAnimationSpeed(15); -// ninjaNode->setMD2Animation(scene::EMAT_RUN); - - ninjaNode->setScale(core::vector3df(2.f,2.f,2.f)); - ninjaNode->setRotation(core::vector3df(0,-90,0)); -// ninjaNode->setMaterialTexture(0, driver->getTexture(mediaPath + "sydney.bmp")); - - } - - - /* - To be able to look at and move around in this scene, we create a first - person shooter style camera and make the mouse cursor invisible. - */ - smgr->addCameraSceneNodeFPS(); - device->getCursorControl()->setVisible(false); - - /* - Add a colorful irrlicht logo - */ - device->getGUIEnvironment()->addImage( - driver->getTexture(mediaPath + "irrlichtlogoalpha2.tga"), - core::position2d(10,20)); - - /* - Lets draw the scene and also write the current frames per second and the - name of the driver to the caption of the window. - */ - int lastFPS = -1; - - // In order to do framerate independent movement, we have to know - // how long it was since the last frame - u32 then = device->getTimer()->getTime(); - - // This is the movement speed in units per second. - const f32 MOVEMENT_SPEED = 5.f; - - while(device->run()) - { - // Work out a frame delta time. - const u32 now = device->getTimer()->getTime(); - const f32 frameDeltaTime = (f32)(now - then) / 1000.f; // Time in seconds - then = now; - - /* Check if keys W, S, A or D are being held down, and move the - sphere node around respectively. */ - core::vector3df nodePosition = sphereNode->getPosition(); - - if(receiver.IsKeyDown(irr::KEY_KEY_W)) - nodePosition.Y += MOVEMENT_SPEED * frameDeltaTime; - else if(receiver.IsKeyDown(irr::KEY_KEY_S)) - nodePosition.Y -= MOVEMENT_SPEED * frameDeltaTime; - - if(receiver.IsKeyDown(irr::KEY_KEY_A)) - nodePosition.X -= MOVEMENT_SPEED * frameDeltaTime; - else if(receiver.IsKeyDown(irr::KEY_KEY_D)) - nodePosition.X += MOVEMENT_SPEED * frameDeltaTime; - - sphereNode->setPosition(nodePosition); - - driver->beginScene(video::ECBF_COLOR | video::ECBF_DEPTH, video::SColor(255,113,113,133)); - - smgr->drawAll(); // draw the 3d scene - device->getGUIEnvironment()->drawAll(); // draw the gui environment (the logo) - - driver->endScene(); - - int fps = driver->getFPS(); - - if (lastFPS != fps) - { - core::stringw tmp(L"Movement Example - Irrlicht Engine ["); - tmp += driver->getName(); - tmp += L"] fps: "; - tmp += fps; - - device->setWindowCaption(tmp.c_str()); - lastFPS = fps; - } - } - - /* - In the end, delete the Irrlicht device. - */ - device->drop(); - - return 0; -} - -/* -That's it. Compile and play around with the program. -**/ diff --git a/examples/04.Movement/tutorial.html b/examples/04.Movement/tutorial.html deleted file mode 100644 index 28b207dc..00000000 --- a/examples/04.Movement/tutorial.html +++ /dev/null @@ -1,188 +0,0 @@ - - -Irrlicht Engine Tutorial - - - - -
- - - - - - - - -
-
-
-
Tutorial 4.Movement
-
-
-
-

This Tutorial shows how to move and animate SceneNodes. The basic concept - of SceneNodeAnimators is shown as well as manual movement of nodes using - the keyboard.

-

The program which is described here will look like this:

-


-

-
-
-
- - - - - - - -
- Lets start!
-

As always, I include the header files, use the irr namespace, and tell - the linker to link with the .lib file.

- - - - -
#include <stdio.h>
#include <wchar.h>
#include <irrlicht.h>
-
using namespace irr;
-
#pragma comment(lib, "Irrlicht.lib")
-

In this tutorial, one of our goals is to move a scene node using some - keys on the keyboard. We store a pointer to the scene node we want to - move with the keys here.
- The other pointer is a pointer to the Irrlicht Device, which we need - int the EventReceiver to manipulate the scene node and to get the active - camera.

- - - - -
scene::ISceneNode* node = 0;
IrrlichtDevice* device = 0;
-

To get events like mouse and keyboard input, or GUI events like "the - OK button has been clicked", we need an object wich is derived - from the IEventReceiver object. There is only one method to override: - OnEvent. This method will be called by the engine when an event happened. - We will use this input to move the scene node with the keys W and S.

- - - - -
class MyEventReceiver : public IEventReceiver
{
public:
virtual bool OnEvent(const SEvent& event)
{
-

If the key 'W' or 'S' was left up, we get the position of the scene - node, and modify the Y coordinate a little bit. So if you press 'W', - the node moves up, and if you press 'S' it moves down.

- - - - -
if (node != 0 && event.EventType == irr::EET_KEY_INPUT_EVENT&&
!event.KeyInput.PressedDown)
{
switch(event.KeyInput.Key)
{
case KEY_KEY_W:
case KEY_KEY_S:
{
core::vector3df v = node->getPosition();
v.Y += event.KeyInput.Key == KEY_KEY_W ? 2.0f : -2.0f;
node->setPosition(v);
}
return true;
}
} return false;
}
};
- -
-

The event receiver for moving a scene node is ready. So lets just create - an Irrlicht Device and the scene node we want to move. We also create - some other additional scene nodes, to show that there are also some different - possibilities to move and animate scene nodes.

- - - - -
int main()
{
MyEventReceiver receiver; - - device = createDevice(video::EDT_OPENGL, core::dimension2d<s32>(640, 480), - 16, false, false, false, &receiver);
-
   video::IVideoDriver* driver = device->getVideoDriver();
-   scene::ISceneManager* smgr = device->getSceneManager();
-
-

Create the node for moving it with the 'W' and 'S' key. We create a - sphere node, which is a built in geometric primitive scene node. - We place the node at (0,0,30) and assign a texture to it to let it look - a little bit more interesting.

- - - - -
node = smgr->addSphereSceneNode();
-node->setPosition(core::vector3df(0,0,30));
-node->setMaterialFlag(video::EMF_LIGHTING, false);
-node->setMaterialTexture(0, driver->getTexture("../../media/wall.bmp"));
-

Now we create another node, moving using a scene node animator. Scene - node animators modify scene nodes and can be attached to any scene node - like
- mesh scene nodes, billboards, lights and even camera scene nodes. Scene - node animators are not only able to modify the position of a scene node, - they can
- also animate the textures of an object for example. We create a test scene - node again an attach a 'fly circle' scene node to it, letting this node - fly around our first test scene node.

- - - - -
scene::ISceneNode* n = smgr->addCubeSceneNode();
-n->setMaterialTexture(0, driver->getTexture("../../media/t351sml.jpg"));
-n->setMaterialFlag(video::EMF_LIGHTING, false);
-scene::ISceneNodeAnimator* anim = 
-	smgr->createFlyCircleAnimator(core::vector3df(0,0,30), 20.0f);
-n->addAnimator(anim);
-anim->drop();
-

The last scene node we add to show possibilities of scene node animators - is a md2 model, which uses a 'fly straight' animator to run between to - points.

- - - - -
scene::IAnimatedMeshSceneNode* anms = smgr->addAnimatedMeshSceneNode(
smgr->getMesh("../../media/sydney.md2")); - -if (n)
{
anim = smgr->createFlyStraightAnimator(core::vector3df(100,0,60),
core::vector3df(-100,0,60), 10000, true);
anms->addAnimator(anim);
anim->drop();
-
-

To make to model look right we set the frames between which - the animation should loop, rotate the model around 180 degrees, and adjust - the animation speed and the texture.
- To set the right animation (frames and speed), we would also be able to - just call "anms->setMD2Animation(scene::EMAT_RUN)" for the - 'run' animation instead of "setFrameLoop" and "setAnimationSpeed", - but this only works with MD2 animations, and so you know how to start - other animations.

- - - - -
   anms->setMaterialFlag(video::EMF_LIGHTING, false);
anms->setFrameLoop(320, 360); - anms->setAnimationSpeed(30);
anms->setRotation(core::vector3df(0,180.0f,0));
anms->setMaterialTexture(0, driver->getTexture("../../media/sydney.bmp"));
}
-

To be able to look at and move around in this scene, we create a first - person shooter style camera and make the mouse cursor invisible.

- - - - -
smgr->addCameraSceneNodeFPS(0, 100.0f, 100.0f);
device->getCursorControl()->setVisible(false);
-

We have done everything, so lets draw it. We also write the current frames - per second and the name of the driver to the caption of the window.

- - - - -
int lastFPS = -1;
-
while(device->run())
-{
-     driver->beginScene(true, true, video::SColor(255,90,90,156));
-     smgr->drawAll();
-     driver->endScene();
-
     int fps = driver->getFPS();
-
     if (lastFPS != fps)
-     {
-        wchar_t tmp[1024];
-        swprintf(tmp, 1024, L"Movement Example - Irrlicht Engine (%ls)(fps:%d)",
driver->getName(), fps);
-
       device->setWindowCaption(tmp);
-       lastFPS = fps;
-     }
-}
-
-device->drop();
return 0;
}
-

That's it. Compile and play around with the program.

-

 

-

 

- - diff --git a/examples/05.UserInterface/Makefile b/examples/05.UserInterface/Makefile deleted file mode 100644 index fb919746..00000000 --- a/examples/05.UserInterface/Makefile +++ /dev/null @@ -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 := 05.UserInterface -# 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 diff --git a/examples/05.UserInterface/UserInterface.cbp b/examples/05.UserInterface/UserInterface.cbp deleted file mode 100644 index 99887189..00000000 --- a/examples/05.UserInterface/UserInterface.cbp +++ /dev/null @@ -1,55 +0,0 @@ - - - - - - diff --git a/examples/05.UserInterface/UserInterface.vcproj b/examples/05.UserInterface/UserInterface.vcproj deleted file mode 100644 index 44281698..00000000 --- a/examples/05.UserInterface/UserInterface.vcproj +++ /dev/null @@ -1,163 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/examples/05.UserInterface/UserInterface.xcodeproj/project.pbxproj b/examples/05.UserInterface/UserInterface.xcodeproj/project.pbxproj deleted file mode 100644 index 1e03a8ee..00000000 --- a/examples/05.UserInterface/UserInterface.xcodeproj/project.pbxproj +++ /dev/null @@ -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 /* 05.UserInterface.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = 05.UserInterface.app; sourceTree = BUILT_PRODUCTS_DIR; }; - 5E34CC741B7F8EEF00F212E8 /* main.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = main.cpp; sourceTree = ""; }; - 5E34CC781B7F90A000F212E8 /* libIrrlicht.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libIrrlicht.a; path = ../../lib/OSX/libIrrlicht.a; sourceTree = ""; }; - 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 = ""; }; -/* 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 = ""; - }; - 5E34CC521B7F8E6E00F212E8 /* Products */ = { - isa = PBXGroup; - children = ( - 5E34CC511B7F8E6E00F212E8 /* 05.UserInterface.app */, - ); - name = Products; - sourceTree = ""; - }; - 5E34CC761B7F905600F212E8 /* Libraries */ = { - isa = PBXGroup; - children = ( - 5E8570B01B7F99F500B267D2 /* Cocoa.framework */, - 5E8570B41B7F9A0700B267D2 /* IOKit.framework */, - 5E8570B21B7F99FE00B267D2 /* OpenGL.framework */, - 5E34CC781B7F90A000F212E8 /* libIrrlicht.a */, - ); - name = Libraries; - sourceTree = ""; - }; - 5E34CC771B7F906D00F212E8 /* Resources */ = { - isa = PBXGroup; - children = ( - 5E8570BE1B7F9D3A00B267D2 /* media */, - ); - name = Resources; - sourceTree = ""; - }; -/* End PBXGroup section */ - -/* Begin PBXNativeTarget section */ - 5E34CC501B7F8E6E00F212E8 /* 05.UserInterface */ = { - isa = PBXNativeTarget; - buildConfigurationList = 5E34CC701B7F8E6E00F212E8 /* Build configuration list for PBXNativeTarget "05.UserInterface" */; - buildPhases = ( - 5E34CC4D1B7F8E6E00F212E8 /* Sources */, - 5E34CC4E1B7F8E6E00F212E8 /* Frameworks */, - 5E34CC4F1B7F8E6E00F212E8 /* Resources */, - ); - buildRules = ( - ); - dependencies = ( - ); - name = 05.UserInterface; - productName = 01.HelloWorld; - productReference = 5E34CC511B7F8E6E00F212E8 /* 05.UserInterface.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 "UserInterface" */; - compatibilityVersion = "Xcode 3.2"; - developmentRegion = English; - hasScannedForEncodings = 0; - knownRegions = ( - en, - Base, - ); - mainGroup = 5E34C6D81B7F4A0C00F212E8; - productRefGroup = 5E34CC521B7F8E6E00F212E8 /* Products */; - projectDirPath = ""; - projectRoot = ""; - targets = ( - 5E34CC501B7F8E6E00F212E8 /* 05.UserInterface */, - ); - }; -/* 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 "UserInterface" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 5E34C6DD1B7F4A0C00F212E8 /* Debug */, - 5E34C6DE1B7F4A0C00F212E8 /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - 5E34CC701B7F8E6E00F212E8 /* Build configuration list for PBXNativeTarget "05.UserInterface" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 5E34CC6C1B7F8E6E00F212E8 /* Debug */, - 5E34CC6D1B7F8E6E00F212E8 /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; -/* End XCConfigurationList section */ - }; - rootObject = 5E34C6D91B7F4A0C00F212E8 /* Project object */; -} diff --git a/examples/05.UserInterface/UserInterface.xcodeproj/xcshareddata/xcschemes/05.UserInterface.xcscheme b/examples/05.UserInterface/UserInterface.xcodeproj/xcshareddata/xcschemes/05.UserInterface.xcscheme deleted file mode 100644 index 3edc9eb3..00000000 --- a/examples/05.UserInterface/UserInterface.xcodeproj/xcshareddata/xcschemes/05.UserInterface.xcscheme +++ /dev/null @@ -1,91 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/examples/05.UserInterface/UserInterface_vc10.vcxproj b/examples/05.UserInterface/UserInterface_vc10.vcxproj deleted file mode 100644 index d4be57f1..00000000 --- a/examples/05.UserInterface/UserInterface_vc10.vcxproj +++ /dev/null @@ -1,235 +0,0 @@ - - - - - Debug - Win32 - - - Debug - x64 - - - Release - Win32 - - - Release - x64 - - - - 05.UserInterface - {622C9DD7-0391-49FF-AF53-24F9D5A8EC53} - UserInterface - - - - Application - false - MultiByte - Windows7.1SDK - - - Application - false - MultiByte - Windows7.1SDK - - - Application - false - MultiByte - Windows7.1SDK - - - Application - false - MultiByte - Windows7.1SDK - - - - - - - - - - - - - - - - - - - - - - - <_ProjectFileVersion>10.0.30319.1 - ..\..\bin\Win32-VisualStudio\ - ..\..\bin\Win64-VisualStudio\ - - - ..\..\bin\Win32-VisualStudio\ - ..\..\bin\Win64-VisualStudio\ - - - AllRules.ruleset - AllRules.ruleset - - - - - AllRules.ruleset - AllRules.ruleset - - - - - - - - .\Debug/UserInterface.tlb - - - - - Disabled - ..\..\include;%(AdditionalIncludeDirectories) - WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebug - - - Level3 - EditAndContinue - - - _DEBUG;%(PreprocessorDefinitions) - 0x0c07 - - - ..\..\bin\Win32-VisualStudio\05.UserInterface.exe - ..\..\lib\Win32-visualstudio;%(AdditionalLibraryDirectories) - true - Console - - - - - - - .\Debug/UserInterface.tlb - - - - - Disabled - ..\..\include;%(AdditionalIncludeDirectories) - WIN32;WIN64;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebug - - - Level3 - ProgramDatabase - - - _DEBUG;%(PreprocessorDefinitions) - 0x0c07 - - - ..\..\bin\Win64-VisualStudio\05.UserInterface.exe - ..\..\lib\Win64-visualstudio;%(AdditionalLibraryDirectories) - true - Console - - - - - - - .\Release/UserInterface.tlb - - - - - MaxSpeed - OnlyExplicitInline - ..\..\include;%(AdditionalIncludeDirectories) - WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) - true - MultiThreaded - true - - - Level3 - - - NDEBUG;%(PreprocessorDefinitions) - 0x0c07 - - - ..\..\bin\Win32-VisualStudio\05.UserInterface.exe - ..\..\lib\Win32-visualstudio;%(AdditionalLibraryDirectories) - Console - - - - - - - .\Release/UserInterface.tlb - - - - - MaxSpeed - OnlyExplicitInline - ..\..\include;%(AdditionalIncludeDirectories) - WIN32;WIN64;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) - true - MultiThreaded - true - - - Level3 - - - NDEBUG;%(PreprocessorDefinitions) - 0x0c07 - - - ..\..\bin\Win64-VisualStudio\05.UserInterface.exe - ..\..\lib\Win64-visualstudio;%(AdditionalLibraryDirectories) - Console - - - - - - - Disabled - Disabled - %(AdditionalIncludeDirectories) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(PreprocessorDefinitions) - EnableFastChecks - EnableFastChecks - MaxSpeed - MaxSpeed - %(AdditionalIncludeDirectories) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(PreprocessorDefinitions) - - - - - - \ No newline at end of file diff --git a/examples/05.UserInterface/UserInterface_vc11.vcxproj b/examples/05.UserInterface/UserInterface_vc11.vcxproj deleted file mode 100644 index d4be57f1..00000000 --- a/examples/05.UserInterface/UserInterface_vc11.vcxproj +++ /dev/null @@ -1,235 +0,0 @@ - - - - - Debug - Win32 - - - Debug - x64 - - - Release - Win32 - - - Release - x64 - - - - 05.UserInterface - {622C9DD7-0391-49FF-AF53-24F9D5A8EC53} - UserInterface - - - - Application - false - MultiByte - Windows7.1SDK - - - Application - false - MultiByte - Windows7.1SDK - - - Application - false - MultiByte - Windows7.1SDK - - - Application - false - MultiByte - Windows7.1SDK - - - - - - - - - - - - - - - - - - - - - - - <_ProjectFileVersion>10.0.30319.1 - ..\..\bin\Win32-VisualStudio\ - ..\..\bin\Win64-VisualStudio\ - - - ..\..\bin\Win32-VisualStudio\ - ..\..\bin\Win64-VisualStudio\ - - - AllRules.ruleset - AllRules.ruleset - - - - - AllRules.ruleset - AllRules.ruleset - - - - - - - - .\Debug/UserInterface.tlb - - - - - Disabled - ..\..\include;%(AdditionalIncludeDirectories) - WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebug - - - Level3 - EditAndContinue - - - _DEBUG;%(PreprocessorDefinitions) - 0x0c07 - - - ..\..\bin\Win32-VisualStudio\05.UserInterface.exe - ..\..\lib\Win32-visualstudio;%(AdditionalLibraryDirectories) - true - Console - - - - - - - .\Debug/UserInterface.tlb - - - - - Disabled - ..\..\include;%(AdditionalIncludeDirectories) - WIN32;WIN64;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebug - - - Level3 - ProgramDatabase - - - _DEBUG;%(PreprocessorDefinitions) - 0x0c07 - - - ..\..\bin\Win64-VisualStudio\05.UserInterface.exe - ..\..\lib\Win64-visualstudio;%(AdditionalLibraryDirectories) - true - Console - - - - - - - .\Release/UserInterface.tlb - - - - - MaxSpeed - OnlyExplicitInline - ..\..\include;%(AdditionalIncludeDirectories) - WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) - true - MultiThreaded - true - - - Level3 - - - NDEBUG;%(PreprocessorDefinitions) - 0x0c07 - - - ..\..\bin\Win32-VisualStudio\05.UserInterface.exe - ..\..\lib\Win32-visualstudio;%(AdditionalLibraryDirectories) - Console - - - - - - - .\Release/UserInterface.tlb - - - - - MaxSpeed - OnlyExplicitInline - ..\..\include;%(AdditionalIncludeDirectories) - WIN32;WIN64;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) - true - MultiThreaded - true - - - Level3 - - - NDEBUG;%(PreprocessorDefinitions) - 0x0c07 - - - ..\..\bin\Win64-VisualStudio\05.UserInterface.exe - ..\..\lib\Win64-visualstudio;%(AdditionalLibraryDirectories) - Console - - - - - - - Disabled - Disabled - %(AdditionalIncludeDirectories) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(PreprocessorDefinitions) - EnableFastChecks - EnableFastChecks - MaxSpeed - MaxSpeed - %(AdditionalIncludeDirectories) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(PreprocessorDefinitions) - - - - - - \ No newline at end of file diff --git a/examples/05.UserInterface/UserInterface_vc12.vcxproj b/examples/05.UserInterface/UserInterface_vc12.vcxproj deleted file mode 100644 index 3945262f..00000000 --- a/examples/05.UserInterface/UserInterface_vc12.vcxproj +++ /dev/null @@ -1,235 +0,0 @@ - - - - - Debug - Win32 - - - Debug - x64 - - - Release - Win32 - - - Release - x64 - - - - 05.UserInterface - {622C9DD7-0391-49FF-AF53-24F9D5A8EC53} - UserInterface - - - - Application - false - MultiByte - Windows7.1SDK - - - Application - false - MultiByte - Windows7.1SDK - - - Application - false - MultiByte - Windows7.1SDK - - - Application - false - MultiByte - Windows7.1SDK - - - - - - - - - - - - - - - - - - - - - - - <_ProjectFileVersion>10.0.30319.1 - ..\..\bin\Win32-VisualStudio\ - ..\..\bin\Win64-VisualStudio\ - - - ..\..\bin\Win32-VisualStudio\ - ..\..\bin\Win64-VisualStudio\ - - - AllRules.ruleset - AllRules.ruleset - - - - - AllRules.ruleset - AllRules.ruleset - - - - - - - - .\Debug/UserInterface.tlb - - - - - Disabled - ..\..\include;%(AdditionalIncludeDirectories) - WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebug - - - Level3 - EditAndContinue - - - _DEBUG;%(PreprocessorDefinitions) - 0x0c07 - - - ..\..\bin\Win32-VisualStudio\05.UserInterface.exe - ..\..\lib\Win32-visualstudio;%(AdditionalLibraryDirectories) - true - Console - - - - - - - .\Debug/UserInterface.tlb - - - - - Disabled - ..\..\include;%(AdditionalIncludeDirectories) - WIN32;WIN64;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebug - - - Level3 - ProgramDatabase - - - _DEBUG;%(PreprocessorDefinitions) - 0x0c07 - - - ..\..\bin\Win64-VisualStudio\05.UserInterface.exe - ..\..\lib\Win64-visualstudio;%(AdditionalLibraryDirectories) - true - Console - - - - - - - .\Release/UserInterface.tlb - - - - - MaxSpeed - OnlyExplicitInline - ..\..\include;%(AdditionalIncludeDirectories) - WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) - true - MultiThreaded - true - - - Level3 - - - NDEBUG;%(PreprocessorDefinitions) - 0x0c07 - - - ..\..\bin\Win32-VisualStudio\05.UserInterface.exe - ..\..\lib\Win32-visualstudio;%(AdditionalLibraryDirectories) - Console - - - - - - - .\Release/UserInterface.tlb - - - - - MaxSpeed - OnlyExplicitInline - ..\..\include;%(AdditionalIncludeDirectories) - WIN32;WIN64;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) - true - MultiThreaded - true - - - Level3 - - - NDEBUG;%(PreprocessorDefinitions) - 0x0c07 - - - ..\..\bin\Win64-VisualStudio\05.UserInterface.exe - ..\..\lib\Win64-visualstudio;%(AdditionalLibraryDirectories) - Console - - - - - - - Disabled - Disabled - %(AdditionalIncludeDirectories) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(PreprocessorDefinitions) - EnableFastChecks - EnableFastChecks - MaxSpeed - MaxSpeed - %(AdditionalIncludeDirectories) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(PreprocessorDefinitions) - - - - - - \ No newline at end of file diff --git a/examples/05.UserInterface/UserInterface_vc14.vcxproj b/examples/05.UserInterface/UserInterface_vc14.vcxproj deleted file mode 100644 index 0b66809b..00000000 --- a/examples/05.UserInterface/UserInterface_vc14.vcxproj +++ /dev/null @@ -1,235 +0,0 @@ - - - - - Debug - Win32 - - - Debug - x64 - - - Release - Win32 - - - Release - x64 - - - - 05.UserInterface - {622C9DD7-0391-49FF-AF53-24F9D5A8EC53} - UserInterface - - - - Application - false - MultiByte - v140 - - - Application - false - MultiByte - v140 - - - Application - false - MultiByte - v140 - - - Application - false - MultiByte - v140 - - - - - - - - - - - - - - - - - - - - - - - <_ProjectFileVersion>10.0.30319.1 - ..\..\bin\Win32-VisualStudio\ - ..\..\bin\Win64-VisualStudio\ - - - ..\..\bin\Win32-VisualStudio\ - ..\..\bin\Win64-VisualStudio\ - - - AllRules.ruleset - AllRules.ruleset - - - - - AllRules.ruleset - AllRules.ruleset - - - - - - - - .\Debug/UserInterface.tlb - - - - - Disabled - ..\..\include;%(AdditionalIncludeDirectories) - WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebug - - - Level3 - EditAndContinue - - - _DEBUG;%(PreprocessorDefinitions) - 0x0c07 - - - ..\..\bin\Win32-VisualStudio\05.UserInterface.exe - ..\..\lib\Win32-visualstudio;%(AdditionalLibraryDirectories) - true - Console - - - - - - - .\Debug/UserInterface.tlb - - - - - Disabled - ..\..\include;%(AdditionalIncludeDirectories) - WIN32;WIN64;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebug - - - Level3 - ProgramDatabase - - - _DEBUG;%(PreprocessorDefinitions) - 0x0c07 - - - ..\..\bin\Win64-VisualStudio\05.UserInterface.exe - ..\..\lib\Win64-visualstudio;%(AdditionalLibraryDirectories) - true - Console - - - - - - - .\Release/UserInterface.tlb - - - - - MaxSpeed - OnlyExplicitInline - ..\..\include;%(AdditionalIncludeDirectories) - WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) - true - MultiThreaded - true - - - Level3 - - - NDEBUG;%(PreprocessorDefinitions) - 0x0c07 - - - ..\..\bin\Win32-VisualStudio\05.UserInterface.exe - ..\..\lib\Win32-visualstudio;%(AdditionalLibraryDirectories) - Console - - - - - - - .\Release/UserInterface.tlb - - - - - MaxSpeed - OnlyExplicitInline - ..\..\include;%(AdditionalIncludeDirectories) - WIN32;WIN64;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) - true - MultiThreaded - true - - - Level3 - - - NDEBUG;%(PreprocessorDefinitions) - 0x0c07 - - - ..\..\bin\Win64-VisualStudio\05.UserInterface.exe - ..\..\lib\Win64-visualstudio;%(AdditionalLibraryDirectories) - Console - - - - - - - Disabled - Disabled - %(AdditionalIncludeDirectories) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(PreprocessorDefinitions) - EnableFastChecks - EnableFastChecks - MaxSpeed - MaxSpeed - %(AdditionalIncludeDirectories) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(PreprocessorDefinitions) - - - - - - \ No newline at end of file diff --git a/examples/05.UserInterface/main.cpp b/examples/05.UserInterface/main.cpp deleted file mode 100644 index deaba6f1..00000000 --- a/examples/05.UserInterface/main.cpp +++ /dev/null @@ -1,293 +0,0 @@ -/** Example 005 User Interface - -This tutorial shows how to use the built in User Interface of -the Irrlicht Engine. It will give a brief overview and show -how to create and use windows, buttons, scroll bars, static -texts, and list boxes. - -As always, we include the header files, and use the irrlicht -namespaces. We also store a pointer to the Irrlicht device, -a counter variable for changing the creation position of a window, -and a pointer to a listbox. -*/ -#include -#include "driverChoice.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 - -// Declare a structure to hold some context for the event receiver so that it -// has it available inside its OnEvent() method. -struct SAppContext -{ - IrrlichtDevice *device; - s32 counter; - IGUIListBox* listbox; -}; - -// Define some values that we'll use to identify individual GUI controls. -enum -{ - GUI_ID_QUIT_BUTTON = 101, - GUI_ID_NEW_WINDOW_BUTTON, - GUI_ID_FILE_OPEN_BUTTON, - GUI_ID_TRANSPARENCY_SCROLL_BAR -}; - -/* - Set the skin transparency by changing the alpha values of all skin-colors -*/ -void setSkinTransparency(s32 alpha, irr::gui::IGUISkin * skin) -{ - for (s32 i=0; igetColor((EGUI_DEFAULT_COLOR)i); - col.setAlpha(alpha); - skin->setColor((EGUI_DEFAULT_COLOR)i, col); - } -} - -/* -The Event Receiver is not only capable of getting keyboard and -mouse input events, but also events of the graphical user interface -(gui). There are events for almost everything: button click, -listbox selection change, events that say that a element was hovered -and so on. To be able to react to some of these events, we create -an event receiver. -We only react to gui events, and if it's such an event, we get the -id of the caller (the gui element which caused the event) and get -the pointer to the gui environment. -*/ -class MyEventReceiver : public IEventReceiver -{ -public: - MyEventReceiver(SAppContext & context) : Context(context) { } - - virtual bool OnEvent(const SEvent& event) - { - if (event.EventType == EET_GUI_EVENT) - { - s32 id = event.GUIEvent.Caller->getID(); - IGUIEnvironment* env = Context.device->getGUIEnvironment(); - - switch(event.GUIEvent.EventType) - { - - /* - If a scrollbar changed its scroll position, and it is - 'our' scrollbar (the one with id GUI_ID_TRANSPARENCY_SCROLL_BAR), - then we change the transparency of all gui elements. This is an - easy task: There is a skin object, in which all color - settings are stored. We simply go through all colors - stored in the skin and change their alpha value. - */ - case EGET_SCROLL_BAR_CHANGED: - if (id == GUI_ID_TRANSPARENCY_SCROLL_BAR) - { - s32 pos = ((IGUIScrollBar*)event.GUIEvent.Caller)->getPos(); - setSkinTransparency(pos, env->getSkin()); - } - break; - - /* - If a button was clicked, it could be one of 'our' - three buttons. If it is the first, we shut down the engine. - If it is the second, we create a little window with some - text on it. We also add a string to the list box to log - what happened. And if it is the third button, we create - a file open dialog, and add also this as string to the list box. - That's all for the event receiver. - */ - case EGET_BUTTON_CLICKED: - switch(id) - { - case GUI_ID_QUIT_BUTTON: - Context.device->closeDevice(); - return true; - - case GUI_ID_NEW_WINDOW_BUTTON: - { - Context.listbox->addItem(L"Window created"); - Context.counter += 30; - if (Context.counter > 200) - Context.counter = 0; - - IGUIWindow* window = env->addWindow( - rect(100 + Context.counter, 100 + Context.counter, 300 + Context.counter, 200 + Context.counter), - false, // modal? - L"Test window"); - - env->addStaticText(L"Please close me", - rect(35,35,140,50), - true, // border? - false, // wordwrap? - window); - } - return true; - - case GUI_ID_FILE_OPEN_BUTTON: - Context.listbox->addItem(L"File open"); - // There are some options for the file open dialog - // We set the title, make it a modal window, and make sure - // that the working directory is restored after the dialog - // is finished. - env->addFileOpenDialog(L"Please choose a file.", true, 0, -1, true); - return true; - - default: - return false; - } - break; - - case EGET_FILE_SELECTED: - { - // show the model filename, selected in the file dialog - IGUIFileOpenDialog* dialog = - (IGUIFileOpenDialog*)event.GUIEvent.Caller; - Context.listbox->addItem(dialog->getFileName()); - } - break; - - default: - break; - } - } - - return false; - } - -private: - SAppContext & Context; -}; - - -/* -OK, now for the more interesting part. First, create the Irrlicht device. As in -some examples before, we ask the user which driver he wants to use for this -example. -*/ -int main() -{ - // 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(640, 480)); - - if (device == 0) - return 1; // could not create selected driver. - - /* The creation was successful, now we set the event receiver and - store pointers to the driver and to the gui environment. */ - - device->setWindowCaption(L"Irrlicht Engine - User Interface Demo"); - device->setResizable(true); - - video::IVideoDriver* driver = device->getVideoDriver(); - IGUIEnvironment* env = device->getGUIEnvironment(); - - const io::path mediaPath = getExampleMediaPath(); - - /* - To make the font a little bit nicer, we load an external font - and set it as the new default font in the skin. - To keep the standard font for tool tip text, we set it to - the built-in font. - */ - - IGUISkin* skin = env->getSkin(); - IGUIFont* font = env->getFont(mediaPath + "fonthaettenschweiler.bmp"); - if (font) - skin->setFont(font); - - skin->setFont(env->getBuiltInFont(), EGDF_TOOLTIP); - - /* - We add three buttons. The first one closes the engine. The second - creates a window and the third opens a file open dialog. The third - parameter is the id of the button, with which we can easily identify - the button in the event receiver. - */ - - env->addButton(rect(10,240,110,240 + 32), 0, GUI_ID_QUIT_BUTTON, - L"Quit", L"Exits Program"); - env->addButton(rect(10,280,110,280 + 32), 0, GUI_ID_NEW_WINDOW_BUTTON, - L"New Window", L"Launches a new Window"); - env->addButton(rect(10,320,110,320 + 32), 0, GUI_ID_FILE_OPEN_BUTTON, - L"File Open", L"Opens a file"); - - /* - Now, we add a static text and a scrollbar, which modifies the - transparency of all gui elements. We set the maximum value of - the scrollbar to 255, because that's the maximal value for - a color value. - Then we create an other static text and a list box. - */ - - env->addStaticText(L"Transparent Control:", rect(150,20,350,40), true); - IGUIScrollBar* scrollbar = env->addScrollBar(true, - rect(150, 45, 350, 60), 0, GUI_ID_TRANSPARENCY_SCROLL_BAR); - scrollbar->setMax(255); - scrollbar->setPos(255); - setSkinTransparency( scrollbar->getPos(), env->getSkin()); - - // set scrollbar position to alpha value of an arbitrary element - scrollbar->setPos(env->getSkin()->getColor(EGDC_WINDOW).getAlpha()); - - env->addStaticText(L"Logging ListBox:", rect(50,110,250,130), true); - IGUIListBox * listbox = env->addListBox(rect(50, 140, 250, 210)); - env->addEditBox(L"Editable Text", rect(350, 80, 550, 100)); - - // Store the appropriate data in a context structure. - SAppContext context; - context.device = device; - context.counter = 0; - context.listbox = listbox; - - // Then create the event receiver, giving it that context structure. - MyEventReceiver receiver(context); - - // And tell the device to use our custom event receiver. - device->setEventReceiver(&receiver); - - - /* - And at last, we create a nice Irrlicht Engine logo in the top left corner. - */ - env->addImage(driver->getTexture(mediaPath + "irrlichtlogo3.png"), - position2d(10,10)); - - - /* - That's all, we only have to draw everything. - */ - - while(device->run() && driver) - if (device->isWindowActive()) - { - driver->beginScene(video::ECBF_COLOR | video::ECBF_DEPTH, SColor(0,200,200,200)); - - env->drawAll(); - - driver->endScene(); - } - - device->drop(); - - return 0; -} - -/* -**/ diff --git a/examples/05.UserInterface/tutorial.html b/examples/05.UserInterface/tutorial.html deleted file mode 100644 index 3f3614fa..00000000 --- a/examples/05.UserInterface/tutorial.html +++ /dev/null @@ -1,225 +0,0 @@ - - -Irrlicht Engine Tutorial - - - - -
- - - - - - - - -
-
-
-
Tutorial 5.User Interface
-
-
-
-

This tutorial shows how to use the built in User Interface of the Irrlicht - Engine. It will give a brief overview and show how to create and use - windows, buttons, scroll bars, static texts and list boxes.

-

The program which is described here will look like this:

-


-

-
-
-
- - - - - - - -
- Lets start!
-

As always, we include the header files (conio and curses for getting - user input from the console), and use the irrlicht namespaces. We also - store a pointer to the Irrlicht device, a counter variable for changing - the creation position of a window, and a pointer to a listbox.

- - - - -
#include <irrlicht.h>
-#include <iostream>
-using namespace irr;
-
using namespace core;
-using namespace scene;
-using namespace video;
-using namespace io;
-using namespace gui;
-
#pragma comment(lib, "Irrlicht.lib")
-
IrrlichtDevice *device = 0;
-s32 cnt = 0;
-IGUIListBox* listbox = 0;
-
-

The Event Receiver is not only capable of getting keyboard and mouse - input events, but also events of the graphical user interface (gui). - There are events for almost everything: Button click, Listbox selection - change, events that say that a element was hovered and so on. To be - able to react to some of these events, we create
- an event receiver. We only react to gui events, and if it's such an - event, we get the id of the caller (the gui element which caused the - event) and get the pointer to the gui environment.

- - - - -
class MyEventReceiver : public IEventReceiver
{
public:
virtual bool OnEvent(const SEvent& event)
{
if (event.EventType == EET_GUI_EVENT)
{
s32 id = event.GUIEvent.Caller->getID();
IGUIEnvironment* env = device->getGUIEnvironment();
-
            switch(event.GUIEvent.EventType)
-            {
-
-

If a scrollbar changed its scroll position, and it is 'our' scrollbar - (the one with id 104), then we change the
- transparency of all gui elements. This is a very easy task: There is - a skin object, in which all color settings are stored. We simply go - through all colors stored in the skin and change their alpha value. -

- - - - -
case EGET_SCROLL_BAR_CHANGED:
if (id == 104)
{
s32 pos = ((IGUIScrollBar*)event.GUIEvent.Caller)->getPos();

for (s32 i=0; i<EGDC_COUNT ; ++i)
{
SColor col = env->getSkin()->getColor((EGUI_DEFAULT_COLOR)i);
col.setAlpha(pos);
env->getSkin()->setColor((EGUI_DEFAULT_COLOR)i, col);
}
}
break;
-

If a button was clicked, it could be one of 'our' three buttons. If - it is the first, we shut down the engine.
- If it is the second, we create a little window with some text on it. - We also add a string to the list box to log
- what happened. And if it is the third button, we create a file open - dialog, and add also this as string to the list box.
- That's all for the event receiver.

- - - - -
-
       case EGET_BUTTON_CLICKED:
-              if (id == 101)
-              {
-                 device->closeDevice();
-                 return true;
-              }
-
              if (id == 102)
-              {
-                 listbox->addItem(L"Window created");
-                 cnt += 30;
-                 if (cnt > 200) 
-                   cnt = 0;
-
                 IGUIWindow* window = env->addWindow(
-                       rect<s32>(100 + cnt, 100 + cnt, 300 + cnt, 200 + cnt), 
false, // modal? - L"Test window");
-
                 env->addStaticText(L"Please close me", 
-                       rect<s32>(35,35,140,50),
-                       true, // border?,
-                       false, // wordwrap?
-                       window);
-
-                 return true;
-              }
-
              if (id == 103)
-              {
-                 listbox->addItem(L"File open");
-                 env->addFileOpenDialog(L"Please choose a file.");
-                 return true;
-              }
-
              break;
-          }
-       }
-       return false;
-    }
- };
-
-

Ok, now for the more interesting part. First, create the Irrlicht device. - As in some examples before, we ask the user which driver he wants to - use for this example:

-
- - - - -
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 - device = createDevice(driverType, core::dimension2d<s32>(640, 480));
- if (device == 0) - return 1; -
-
-

The creation was successful, now we set the event receiver and store - pointers to the driver and to the gui environment.

- - - - -
MyEventReceiver receiver;
-device->setEventReceiver(&receiver);
-device->setWindowCaption(L"Irrlicht Engine - User Inferface Demo");
-
video::IVideoDriver* driver = device->getVideoDriver();
-IGUIEnvironment* env = device->getGUIEnvironment();
-
-
-

We add three buttons. The first one closes the engine. The second creates - a window and the third opens a file open dialog. The third parameter is - the id of the button, with which we can easily identify the button in - the event receiver.

- - - - -
env->addButton(rect<s32>(10,240,100,270), 0, 101, L"Quit");
env->addButton(rect<s32>(10,280,100,320), 0, 102, L"New Window");
env->addButton(rect<s32>(10,330,100,370), 0, 103, L"File Open");
-

Now, we add a static text and a scrollbar, which modifies the transparency - of all gui elements. We set the maximum value of the scrollbar to 255, - because that's the maximal value for a color value.
- Then we create an other static text and a list box.

- - - - -
env->addStaticText(L"Transparent Control:", rect<s32>(150,20,350,40), true);
IGUIScrollBar* scrollbar = env->addScrollBar(true, - rect<s32>(150, 45, 350, 60), 0, 104);
scrollbar->setMax(255);
-
env->addStaticText(L"Logging ListBox:", rect<s32>(50,110,250,130), true);
-listbox = env->addListBox(rect<s32>(50, 140, 250, 210));
-
- To make the font a little bit nicer, we load an external font and set it - as new font in the skin. An at last, we create a nice Irrlicht Engine logo - in the top left corner.
-
- - - - -
IGUISkin* skin = env->getSkin();
IGUIFont* font = env->getFont("../../media/fonthaettenschweiler.bmp");
if (font)
skin->setFont(font);
-
IGUIImage* img = env->addImage(
driver->getTexture("../../media/irrlichtlogoalpha.tga"),
position2d<int>(10,10));
-

That's all, we only have to draw everything.

- - - - -
-
  while(device->run() && driver)
if (device->isWindowActive())
{
driver->beginScene(true, true, SColor(0,122,65,171)); - env->drawAll(); - driver->endScene(); - } - - device->drop();
-
  return 0;
-}
-
- -
-

 

- - diff --git a/examples/06.2DGraphics/2DGraphics.cbp b/examples/06.2DGraphics/2DGraphics.cbp deleted file mode 100644 index f7b73962..00000000 --- a/examples/06.2DGraphics/2DGraphics.cbp +++ /dev/null @@ -1,55 +0,0 @@ - - - - - - diff --git a/examples/06.2DGraphics/2DGraphics.vcproj b/examples/06.2DGraphics/2DGraphics.vcproj deleted file mode 100644 index b21c3517..00000000 --- a/examples/06.2DGraphics/2DGraphics.vcproj +++ /dev/null @@ -1,163 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/examples/06.2DGraphics/2DGraphics.xcodeproj/project.pbxproj b/examples/06.2DGraphics/2DGraphics.xcodeproj/project.pbxproj deleted file mode 100644 index 5848bbf1..00000000 --- a/examples/06.2DGraphics/2DGraphics.xcodeproj/project.pbxproj +++ /dev/null @@ -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 /* 06.2DGraphics.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = 06.2DGraphics.app; sourceTree = BUILT_PRODUCTS_DIR; }; - 5E34CC741B7F8EEF00F212E8 /* main.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = main.cpp; sourceTree = ""; }; - 5E34CC781B7F90A000F212E8 /* libIrrlicht.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libIrrlicht.a; path = ../../lib/OSX/libIrrlicht.a; sourceTree = ""; }; - 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 = ""; }; -/* 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 = ""; - }; - 5E34CC521B7F8E6E00F212E8 /* Products */ = { - isa = PBXGroup; - children = ( - 5E34CC511B7F8E6E00F212E8 /* 06.2DGraphics.app */, - ); - name = Products; - sourceTree = ""; - }; - 5E34CC761B7F905600F212E8 /* Libraries */ = { - isa = PBXGroup; - children = ( - 5E8570B01B7F99F500B267D2 /* Cocoa.framework */, - 5E8570B41B7F9A0700B267D2 /* IOKit.framework */, - 5E8570B21B7F99FE00B267D2 /* OpenGL.framework */, - 5E34CC781B7F90A000F212E8 /* libIrrlicht.a */, - ); - name = Libraries; - sourceTree = ""; - }; - 5E34CC771B7F906D00F212E8 /* Resources */ = { - isa = PBXGroup; - children = ( - 5E8570BE1B7F9D3A00B267D2 /* media */, - ); - name = Resources; - sourceTree = ""; - }; -/* End PBXGroup section */ - -/* Begin PBXNativeTarget section */ - 5E34CC501B7F8E6E00F212E8 /* 06.2DGraphics */ = { - isa = PBXNativeTarget; - buildConfigurationList = 5E34CC701B7F8E6E00F212E8 /* Build configuration list for PBXNativeTarget "06.2DGraphics" */; - buildPhases = ( - 5E34CC4D1B7F8E6E00F212E8 /* Sources */, - 5E34CC4E1B7F8E6E00F212E8 /* Frameworks */, - 5E34CC4F1B7F8E6E00F212E8 /* Resources */, - ); - buildRules = ( - ); - dependencies = ( - ); - name = 06.2DGraphics; - productName = 01.HelloWorld; - productReference = 5E34CC511B7F8E6E00F212E8 /* 06.2DGraphics.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 "2DGraphics" */; - compatibilityVersion = "Xcode 3.2"; - developmentRegion = English; - hasScannedForEncodings = 0; - knownRegions = ( - en, - Base, - ); - mainGroup = 5E34C6D81B7F4A0C00F212E8; - productRefGroup = 5E34CC521B7F8E6E00F212E8 /* Products */; - projectDirPath = ""; - projectRoot = ""; - targets = ( - 5E34CC501B7F8E6E00F212E8 /* 06.2DGraphics */, - ); - }; -/* 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 "2DGraphics" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 5E34C6DD1B7F4A0C00F212E8 /* Debug */, - 5E34C6DE1B7F4A0C00F212E8 /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - 5E34CC701B7F8E6E00F212E8 /* Build configuration list for PBXNativeTarget "06.2DGraphics" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 5E34CC6C1B7F8E6E00F212E8 /* Debug */, - 5E34CC6D1B7F8E6E00F212E8 /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; -/* End XCConfigurationList section */ - }; - rootObject = 5E34C6D91B7F4A0C00F212E8 /* Project object */; -} diff --git a/examples/06.2DGraphics/2DGraphics.xcodeproj/xcshareddata/xcschemes/06.2DGraphics.xcscheme b/examples/06.2DGraphics/2DGraphics.xcodeproj/xcshareddata/xcschemes/06.2DGraphics.xcscheme deleted file mode 100644 index 6a138026..00000000 --- a/examples/06.2DGraphics/2DGraphics.xcodeproj/xcshareddata/xcschemes/06.2DGraphics.xcscheme +++ /dev/null @@ -1,91 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/examples/06.2DGraphics/2DGraphics_vc10.vcxproj b/examples/06.2DGraphics/2DGraphics_vc10.vcxproj deleted file mode 100644 index 07fd309f..00000000 --- a/examples/06.2DGraphics/2DGraphics_vc10.vcxproj +++ /dev/null @@ -1,235 +0,0 @@ - - - - - Debug - Win32 - - - Debug - x64 - - - Release - Win32 - - - Release - x64 - - - - 06.2DGraphics - {E71B6F18-10DC-4101-A541-F6D33F71B2BD} - 2DGraphics - - - - Application - false - MultiByte - Windows7.1SDK - - - Application - false - MultiByte - Windows7.1SDK - - - Application - false - MultiByte - Windows7.1SDK - - - Application - false - MultiByte - Windows7.1SDK - - - - - - - - - - - - - - - - - - - - - - - <_ProjectFileVersion>10.0.30319.1 - ..\..\bin\Win32-VisualStudio\ - ..\..\bin\Win64-VisualStudio\ - - - ..\..\bin\Win32-VisualStudio\ - ..\..\bin\Win64-VisualStudio\ - - - AllRules.ruleset - AllRules.ruleset - - - - - AllRules.ruleset - AllRules.ruleset - - - - - - - - .\Release/2DGraphics.tlb - - - - - MaxSpeed - OnlyExplicitInline - ..\..\include;%(AdditionalIncludeDirectories) - WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) - true - MultiThreaded - true - - - Level3 - - - NDEBUG;%(PreprocessorDefinitions) - 0x0c07 - - - ..\..\bin\Win32-VisualStudio\06.2DGraphics.exe - ..\..\lib\Win32-visualstudio;%(AdditionalLibraryDirectories) - Console - - - - - - - .\Release/2DGraphics.tlb - - - - - MaxSpeed - OnlyExplicitInline - ..\..\include;%(AdditionalIncludeDirectories) - WIN32;WIN64;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) - true - MultiThreaded - true - - - Level3 - - - NDEBUG;%(PreprocessorDefinitions) - 0x0c07 - - - ..\..\bin\Win64-VisualStudio\06.2DGraphics.exe - ..\..\lib\Win64-visualstudio;%(AdditionalLibraryDirectories) - Console - - - - - - - .\Debug/2DGraphics.tlb - - - - - Disabled - ..\..\include;%(AdditionalIncludeDirectories) - WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebug - - - Level3 - EditAndContinue - - - _DEBUG;%(PreprocessorDefinitions) - 0x0c07 - - - ..\..\bin\Win32-VisualStudio\06.2DGraphics.exe - ..\..\lib\Win32-visualstudio;%(AdditionalLibraryDirectories) - true - Console - - - - - - - .\Debug/2DGraphics.tlb - - - - - Disabled - ..\..\include;%(AdditionalIncludeDirectories) - WIN32;WIN64;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebug - - - Level3 - ProgramDatabase - - - _DEBUG;%(PreprocessorDefinitions) - 0x0c07 - - - ..\..\bin\Win64-VisualStudio\06.2DGraphics.exe - ..\..\lib\Win64-visualstudio;%(AdditionalLibraryDirectories) - true - Console - - - - - - - Disabled - Disabled - %(AdditionalIncludeDirectories) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(PreprocessorDefinitions) - EnableFastChecks - EnableFastChecks - MaxSpeed - MaxSpeed - %(AdditionalIncludeDirectories) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(PreprocessorDefinitions) - - - - - - \ No newline at end of file diff --git a/examples/06.2DGraphics/2DGraphics_vc11.vcxproj b/examples/06.2DGraphics/2DGraphics_vc11.vcxproj deleted file mode 100644 index 07fd309f..00000000 --- a/examples/06.2DGraphics/2DGraphics_vc11.vcxproj +++ /dev/null @@ -1,235 +0,0 @@ - - - - - Debug - Win32 - - - Debug - x64 - - - Release - Win32 - - - Release - x64 - - - - 06.2DGraphics - {E71B6F18-10DC-4101-A541-F6D33F71B2BD} - 2DGraphics - - - - Application - false - MultiByte - Windows7.1SDK - - - Application - false - MultiByte - Windows7.1SDK - - - Application - false - MultiByte - Windows7.1SDK - - - Application - false - MultiByte - Windows7.1SDK - - - - - - - - - - - - - - - - - - - - - - - <_ProjectFileVersion>10.0.30319.1 - ..\..\bin\Win32-VisualStudio\ - ..\..\bin\Win64-VisualStudio\ - - - ..\..\bin\Win32-VisualStudio\ - ..\..\bin\Win64-VisualStudio\ - - - AllRules.ruleset - AllRules.ruleset - - - - - AllRules.ruleset - AllRules.ruleset - - - - - - - - .\Release/2DGraphics.tlb - - - - - MaxSpeed - OnlyExplicitInline - ..\..\include;%(AdditionalIncludeDirectories) - WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) - true - MultiThreaded - true - - - Level3 - - - NDEBUG;%(PreprocessorDefinitions) - 0x0c07 - - - ..\..\bin\Win32-VisualStudio\06.2DGraphics.exe - ..\..\lib\Win32-visualstudio;%(AdditionalLibraryDirectories) - Console - - - - - - - .\Release/2DGraphics.tlb - - - - - MaxSpeed - OnlyExplicitInline - ..\..\include;%(AdditionalIncludeDirectories) - WIN32;WIN64;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) - true - MultiThreaded - true - - - Level3 - - - NDEBUG;%(PreprocessorDefinitions) - 0x0c07 - - - ..\..\bin\Win64-VisualStudio\06.2DGraphics.exe - ..\..\lib\Win64-visualstudio;%(AdditionalLibraryDirectories) - Console - - - - - - - .\Debug/2DGraphics.tlb - - - - - Disabled - ..\..\include;%(AdditionalIncludeDirectories) - WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebug - - - Level3 - EditAndContinue - - - _DEBUG;%(PreprocessorDefinitions) - 0x0c07 - - - ..\..\bin\Win32-VisualStudio\06.2DGraphics.exe - ..\..\lib\Win32-visualstudio;%(AdditionalLibraryDirectories) - true - Console - - - - - - - .\Debug/2DGraphics.tlb - - - - - Disabled - ..\..\include;%(AdditionalIncludeDirectories) - WIN32;WIN64;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebug - - - Level3 - ProgramDatabase - - - _DEBUG;%(PreprocessorDefinitions) - 0x0c07 - - - ..\..\bin\Win64-VisualStudio\06.2DGraphics.exe - ..\..\lib\Win64-visualstudio;%(AdditionalLibraryDirectories) - true - Console - - - - - - - Disabled - Disabled - %(AdditionalIncludeDirectories) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(PreprocessorDefinitions) - EnableFastChecks - EnableFastChecks - MaxSpeed - MaxSpeed - %(AdditionalIncludeDirectories) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(PreprocessorDefinitions) - - - - - - \ No newline at end of file diff --git a/examples/06.2DGraphics/2DGraphics_vc12.vcxproj b/examples/06.2DGraphics/2DGraphics_vc12.vcxproj deleted file mode 100644 index a4750aad..00000000 --- a/examples/06.2DGraphics/2DGraphics_vc12.vcxproj +++ /dev/null @@ -1,235 +0,0 @@ - - - - - Debug - Win32 - - - Debug - x64 - - - Release - Win32 - - - Release - x64 - - - - 06.2DGraphics - {E71B6F18-10DC-4101-A541-F6D33F71B2BD} - 2DGraphics - - - - Application - false - MultiByte - Windows7.1SDK - - - Application - false - MultiByte - Windows7.1SDK - - - Application - false - MultiByte - Windows7.1SDK - - - Application - false - MultiByte - Windows7.1SDK - - - - - - - - - - - - - - - - - - - - - - - <_ProjectFileVersion>10.0.30319.1 - ..\..\bin\Win32-VisualStudio\ - ..\..\bin\Win64-VisualStudio\ - - - ..\..\bin\Win32-VisualStudio\ - ..\..\bin\Win64-VisualStudio\ - - - AllRules.ruleset - AllRules.ruleset - - - - - AllRules.ruleset - AllRules.ruleset - - - - - - - - .\Release/2DGraphics.tlb - - - - - MaxSpeed - OnlyExplicitInline - ..\..\include;%(AdditionalIncludeDirectories) - WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) - true - MultiThreaded - true - - - Level3 - - - NDEBUG;%(PreprocessorDefinitions) - 0x0c07 - - - ..\..\bin\Win32-VisualStudio\06.2DGraphics.exe - ..\..\lib\Win32-visualstudio;%(AdditionalLibraryDirectories) - Console - - - - - - - .\Release/2DGraphics.tlb - - - - - MaxSpeed - OnlyExplicitInline - ..\..\include;%(AdditionalIncludeDirectories) - WIN32;WIN64;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) - true - MultiThreaded - true - - - Level3 - - - NDEBUG;%(PreprocessorDefinitions) - 0x0c07 - - - ..\..\bin\Win64-VisualStudio\06.2DGraphics.exe - ..\..\lib\Win64-visualstudio;%(AdditionalLibraryDirectories) - Console - - - - - - - .\Debug/2DGraphics.tlb - - - - - Disabled - ..\..\include;%(AdditionalIncludeDirectories) - WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebug - - - Level3 - EditAndContinue - - - _DEBUG;%(PreprocessorDefinitions) - 0x0c07 - - - ..\..\bin\Win32-VisualStudio\06.2DGraphics.exe - ..\..\lib\Win32-visualstudio;%(AdditionalLibraryDirectories) - true - Console - - - - - - - .\Debug/2DGraphics.tlb - - - - - Disabled - ..\..\include;%(AdditionalIncludeDirectories) - WIN32;WIN64;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebug - - - Level3 - ProgramDatabase - - - _DEBUG;%(PreprocessorDefinitions) - 0x0c07 - - - ..\..\bin\Win64-VisualStudio\06.2DGraphics.exe - ..\..\lib\Win64-visualstudio;%(AdditionalLibraryDirectories) - true - Console - - - - - - - Disabled - Disabled - %(AdditionalIncludeDirectories) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(PreprocessorDefinitions) - EnableFastChecks - EnableFastChecks - MaxSpeed - MaxSpeed - %(AdditionalIncludeDirectories) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(PreprocessorDefinitions) - - - - - - \ No newline at end of file diff --git a/examples/06.2DGraphics/2DGraphics_vc14.vcxproj b/examples/06.2DGraphics/2DGraphics_vc14.vcxproj deleted file mode 100644 index e4d22b1c..00000000 --- a/examples/06.2DGraphics/2DGraphics_vc14.vcxproj +++ /dev/null @@ -1,235 +0,0 @@ - - - - - Debug - Win32 - - - Debug - x64 - - - Release - Win32 - - - Release - x64 - - - - 06.2DGraphics - {E71B6F18-10DC-4101-A541-F6D33F71B2BD} - 2DGraphics - - - - Application - false - MultiByte - v140 - - - Application - false - MultiByte - v140 - - - Application - false - MultiByte - v140 - - - Application - false - MultiByte - v140 - - - - - - - - - - - - - - - - - - - - - - - <_ProjectFileVersion>10.0.30319.1 - ..\..\bin\Win32-VisualStudio\ - ..\..\bin\Win64-VisualStudio\ - - - ..\..\bin\Win32-VisualStudio\ - ..\..\bin\Win64-VisualStudio\ - - - AllRules.ruleset - AllRules.ruleset - - - - - AllRules.ruleset - AllRules.ruleset - - - - - - - - .\Release/2DGraphics.tlb - - - - - MaxSpeed - OnlyExplicitInline - ..\..\include;%(AdditionalIncludeDirectories) - WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) - true - MultiThreaded - true - - - Level3 - - - NDEBUG;%(PreprocessorDefinitions) - 0x0c07 - - - ..\..\bin\Win32-VisualStudio\06.2DGraphics.exe - ..\..\lib\Win32-visualstudio;%(AdditionalLibraryDirectories) - Console - - - - - - - .\Release/2DGraphics.tlb - - - - - MaxSpeed - OnlyExplicitInline - ..\..\include;%(AdditionalIncludeDirectories) - WIN32;WIN64;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) - true - MultiThreaded - true - - - Level3 - - - NDEBUG;%(PreprocessorDefinitions) - 0x0c07 - - - ..\..\bin\Win64-VisualStudio\06.2DGraphics.exe - ..\..\lib\Win64-visualstudio;%(AdditionalLibraryDirectories) - Console - - - - - - - .\Debug/2DGraphics.tlb - - - - - Disabled - ..\..\include;%(AdditionalIncludeDirectories) - WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebug - - - Level3 - EditAndContinue - - - _DEBUG;%(PreprocessorDefinitions) - 0x0c07 - - - ..\..\bin\Win32-VisualStudio\06.2DGraphics.exe - ..\..\lib\Win32-visualstudio;%(AdditionalLibraryDirectories) - true - Console - - - - - - - .\Debug/2DGraphics.tlb - - - - - Disabled - ..\..\include;%(AdditionalIncludeDirectories) - WIN32;WIN64;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebug - - - Level3 - ProgramDatabase - - - _DEBUG;%(PreprocessorDefinitions) - 0x0c07 - - - ..\..\bin\Win64-VisualStudio\06.2DGraphics.exe - ..\..\lib\Win64-visualstudio;%(AdditionalLibraryDirectories) - true - Console - - - - - - - Disabled - Disabled - %(AdditionalIncludeDirectories) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(PreprocessorDefinitions) - EnableFastChecks - EnableFastChecks - MaxSpeed - MaxSpeed - %(AdditionalIncludeDirectories) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(PreprocessorDefinitions) - - - - - - \ No newline at end of file diff --git a/examples/06.2DGraphics/Makefile b/examples/06.2DGraphics/Makefile deleted file mode 100644 index 84cb831d..00000000 --- a/examples/06.2DGraphics/Makefile +++ /dev/null @@ -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 := 06.2DGraphics -# 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 diff --git a/examples/06.2DGraphics/main.cpp b/examples/06.2DGraphics/main.cpp deleted file mode 100644 index 930fbea5..00000000 --- a/examples/06.2DGraphics/main.cpp +++ /dev/null @@ -1,168 +0,0 @@ -/** Example 006 2D Graphics - -This tutorial shows how to do 2d graphics with the Irrlicht Engine. -It shows how to draw images, keycolor based sprites, -transparent rectangles, and different fonts. You may consider -this useful if you want to make a 2d game with the engine, or if -you want to draw a cool interface or head up display for your 3d game. - -As always, I include the header files, use the irr namespace, -and tell the linker to link with the .lib file. -*/ -#include -#include "driverChoice.h" -#include "exampleHelper.h" - -using namespace irr; - -#ifdef _MSC_VER -#pragma comment(lib, "Irrlicht.lib") -#endif - -/* -At first, we let the user select the driver type, then start up the engine, set -a caption, and get a pointer to the video driver. -*/ -int main() -{ - // ask user for driver - video::E_DRIVER_TYPE driverType=driverChoiceConsole(); - if (driverType==video::EDT_COUNT) - return 1; - - // create device - IrrlichtDevice *device = createDevice(driverType, - core::dimension2d(512, 384)); - - if (device == 0) - return 1; // could not create selected driver. - - device->setWindowCaption(L"Irrlicht Engine - 2D Graphics Demo"); - - video::IVideoDriver* driver = device->getVideoDriver(); - - const io::path mediaPath = getExampleMediaPath(); - - /* - All 2d graphics in this example are put together into one texture, - 2ddemo.png. Because we want to draw colorkey based sprites, we need to - load this texture and tell the engine, which part of it should be - transparent based on a colorkey. - - In this example, we don't tell it the color directly, we just say "Hey - Irrlicht Engine, you'll find the color I want at position (0,0) on the - texture.". Instead, it would be also possible to call - driver->makeColorKeyTexture(images, video::SColor(0,0,0,0)), to make - e.g. all black pixels transparent. Please note that - makeColorKeyTexture just creates an alpha channel based on the color. - */ - video::ITexture* images = driver->getTexture(mediaPath + "2ddemo.png"); - driver->makeColorKeyTexture(images, core::position2d(0,0)); - - /* - To be able to draw some text with two different fonts, we first load - them. OK, we load just one. As the first font we just use the default - font which is built into the engine. Also, we define two rectangles - which specify the position of the images of the red imps (little flying - creatures) in the texture. - */ - gui::IGUIFont* font = device->getGUIEnvironment()->getBuiltInFont(); - gui::IGUIFont* font2 = - device->getGUIEnvironment()->getFont(mediaPath + "fonthaettenschweiler.bmp"); - - core::rect imp1(349,15,385,78); - core::rect imp2(387,15,423,78); - - /* - Prepare a nicely filtering 2d render mode for special cases. - */ - driver->getMaterial2D().TextureLayer[0].BilinearFilter=true; - driver->getMaterial2D().AntiAliasing=video::EAAM_FULL_BASIC; - - /* - Everything is prepared, now we can draw everything in the draw loop, - between the begin scene and end scene calls. In this example, we are - just doing 2d graphics, but it would be no problem to mix them with 3d - graphics. Just try it out, and draw some 3d vertices or set up a scene - with the scene manager and draw it. - */ - while(device->run() && driver) - { - if (device->isWindowActive()) - { - u32 time = device->getTimer()->getTime(); - - driver->beginScene(video::ECBF_COLOR | video::ECBF_DEPTH, video::SColor(255,120,102,136)); - - /* - First, we draw 3 sprites, using the alpha channel we - created with makeColorKeyTexture. The last parameter - specifies that the drawing method should use this alpha - channel. The last-but-one parameter specifies a - color, with which the sprite should be colored. - (255,255,255,255) is full white, so the sprite will - look like the original. The third sprite is drawn - with the red channel modulated based on the time. - */ - - // draw fire & dragons background world - driver->draw2DImage(images, core::position2d(50,50), - core::rect(0,0,342,224), 0, - video::SColor(255,255,255,255), true); - - // draw flying imp - driver->draw2DImage(images, core::position2d(164,125), - (time/500 % 2) ? imp1 : imp2, 0, - video::SColor(255,255,255,255), true); - - // draw second flying imp with color cycle - driver->draw2DImage(images, core::position2d(270,105), - (time/500 % 2) ? imp1 : imp2, 0, - video::SColor(255,(time) % 255,255,255), true); - - /* - Drawing text is really simple. The code should be self - explanatory. - */ - - // draw some text - if (font) - font->draw(L"This demo shows that Irrlicht is also capable of drawing 2D graphics.", - core::rect(130,10,300,50), - video::SColor(255,255,255,255)); - - // draw some other text - if (font2) - font2->draw(L"Also mixing with 3d graphics is possible.", - core::rect(130,20,300,60), - video::SColor(255,time % 255,time % 255,255)); - - /* - Next, we draw the Irrlicht Engine logo (without - using a color or an alpha channel). Since we slightly scale - the image we use the prepared filter mode. - */ - driver->enableMaterial2D(); - driver->draw2DImage(images, core::rect(10,10,108,48), - core::rect(354,87,442,118)); - driver->enableMaterial2D(false); - - /* - Finally draw a half-transparent rect under the mouse cursor. - */ - core::position2d m = device->getCursorControl()->getPosition(); - driver->draw2DRectangle(video::SColor(100,255,255,255), - core::rect(m.X-20, m.Y-20, m.X+20, m.Y+20)); - - driver->endScene(); - } - } - - device->drop(); - - return 0; -} - -/* -That's all. I hope it was not too difficult. -**/ diff --git a/examples/06.2DGraphics/tutorial.html b/examples/06.2DGraphics/tutorial.html deleted file mode 100644 index ea6291af..00000000 --- a/examples/06.2DGraphics/tutorial.html +++ /dev/null @@ -1,163 +0,0 @@ - - -Irrlicht Engine Tutorial - - - - -
- - - - - - - - -
-
-
-
Tutorial 6. 2D Graphics
-
-
-
-

This Tutorial shows how to do 2d graphics with the Irrlicht Engine. - It shows how to draw images, keycolor based sprites, transparent rectangles - and different fonts. You will may consider this useful if you want to - make a 2d game with the engine, or if you want to draw a cool interface - or head up display for your 3d game.

-

The program which is described here will look like this:

-


-

-
-
-
- - - - - - - -
- Lets start!
-

As always, I include the header files, use the irr namespace, and tell - the linker to link with the .lib file.

- - - - -
#include <irrlicht.h>
#include <iostream>

using namespace irr;
-
#pragma comment(lib, "Irrlicht.lib")
-               
-

At first, we let the user select the driver type, then start up the - engine, set a caption, and get a pointer to the video driver.

- - - - -
int main()
{
// let user select driver type
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 0;
}

// create device
-
  IrrlichtDevice *device = createDevice(driverType,
-         core::dimension2d<s32>(512, 384));
-
  if (device == 0)
-      return 1;
- 
device->setWindowCaption(L"Irrlicht Engine - 2D Graphics Demo");
-
  video::IVideoDriver* driver = device->getVideoDriver();
-

All 2d graphics in this example are put together into one texture, - 2ddemo.bmp. Because we want to draw colorkey based sprites, we need - to load this texture and tell the engine, which part of it should be - transparent based on a colorkey. In this example, we don't tell it the - color directly, we just say "Hey Irrlicht Engine, you'll find the - color I want at position (0,0) on the texture.". Instead, it would - be also possible to call driver->makeColorKeyTexture(images, - video::SColor(0,0,0,0)), to make e.g. all black pixels transparent. - Please note, that makeColorKeyTexture just creates an alpha channel - based on the color.

- - - - -
video::ITexture* images = driver->getTexture("../../media/2ddemo.bmp");
driver->makeColorKeyTexture(images, core::position2d<s32>(0,0));
-

To be able to draw some text with two different fonts, we load them. - Ok, we load just one, as first font we just use the default font which - is built into the engine.
- Also, we define two rectangles, which specify the position of the images - of the red imps (little flying creatures) in the texture.

- - - - -
gui::IGUIFont* font = device->getGUIEnvironment()->getBuiltInFont();
gui::IGUIFont* font2 = device->getGUIEnvironment()->getFont( - "../../media/fonthaettenschweiler.bmp");
-
core::rect<s32> imp1(349,15,385,78);
-core::rect<s32> imp2(387,15,423,78);
-

Everything is prepared, now we can draw everything in the draw loop, - between the begin scene and end scene calls. In this example, we are - just doing 2d graphics, but it would be no problem to mix them with - 3d graphics. Just try it out, and draw some 3d vertices or set up a - scene with the scene manager and draw it.

-
- - - - -
while(device->run() && driver)
{
if (device->isWindowActive())
{
u32 time = device->getTimer()->getTime();
driver->beginScene(true, true, video::SColor(0,120,102,136)); -
-

First, we draw 3 sprites, using the alpha channel we created with makeColorKeyTexture. - The last parameter specifiys that the drawing method should use thiw alpha - channel. The parameter before the last one specifies a color, with wich - the sprite should be colored. (255,255,255,255) is full white, so the - sprite will look like the original. The third sprite is drawed colored - based on the time.

- - - - -
// draw fire & dragons background world
driver->draw2DImage(images, core::position2d<s32>(50,50),
core::rect<s32>(0,0,342,224), 0,
video::SColor(255,255,255,255), true);
-
// draw flying imp 
-driver->draw2DImage(images, core::position2d<s32>(164,125),
-  (time/500 % 2) ? imp1 : imp2, 0, 
-   video::SColor(255,255,255,255), true);
-
// draw second flying imp with colorcylce
-driver->draw2DImage(images, core::position2d<s32>(270,105),
-  (time/500 % 2) ? imp1 : imp2, 0, 
-  video::SColor(255,(time) % 255,255,255), true);
-

Drawing text is really simple. The code should be self explanatory.

- - - - -
// draw some text
if (font)
font->draw(L"This is some text.",
core::rect<s32>(130,10,300,50),
video::SColor(255,255,255,255));
-
// draw some other text
-if (font2)
-   font2->draw(L"This is some other text.", 
-       core::rect<s32>(130,20,300,60),
-       video::SColor(255,time % 255,time % 255,255));
-

At last, we draw the Irrlicht Engine logo (without using a color or an - alpha channel) and a transparent 2d Rectangle at the position of the mouse - cursor.

- - - - -
    // draw logo
driver->draw2DImage(images, core::position2d<s32>(10,10),
core::rect<s32>(354,87,442,118));
-
    // draw transparent rect under cursor
-    core::position2d<s32> m = device->getCursorControl()->getPosition();
-    driver->draw2DRectangle(video::SColor(100,255,255,255),
-          core::rect<s32>(m.X-20, m.Y-20, m.X+20, m.Y+20));
-
    driver->endScene();
-  }
-}
-

That's all, it was not really difficult, I hope.

- - - - -
   device->drop();
-   return 0;
-}
-
-

 

-

 

- - diff --git a/examples/07.Collision/Collision.cbp b/examples/07.Collision/Collision.cbp deleted file mode 100644 index 1d735879..00000000 --- a/examples/07.Collision/Collision.cbp +++ /dev/null @@ -1,55 +0,0 @@ - - - - - - diff --git a/examples/07.Collision/Collision.vcproj b/examples/07.Collision/Collision.vcproj deleted file mode 100644 index a4e4b076..00000000 --- a/examples/07.Collision/Collision.vcproj +++ /dev/null @@ -1,163 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/examples/07.Collision/Collision.xcodeproj/project.pbxproj b/examples/07.Collision/Collision.xcodeproj/project.pbxproj deleted file mode 100644 index 2dbe0680..00000000 --- a/examples/07.Collision/Collision.xcodeproj/project.pbxproj +++ /dev/null @@ -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 /* 07.Collision.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = 07.Collision.app; sourceTree = BUILT_PRODUCTS_DIR; }; - 5E34CC741B7F8EEF00F212E8 /* main.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = main.cpp; sourceTree = ""; }; - 5E34CC781B7F90A000F212E8 /* libIrrlicht.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libIrrlicht.a; path = ../../lib/OSX/libIrrlicht.a; sourceTree = ""; }; - 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 = ""; }; -/* 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 = ""; - }; - 5E34CC521B7F8E6E00F212E8 /* Products */ = { - isa = PBXGroup; - children = ( - 5E34CC511B7F8E6E00F212E8 /* 07.Collision.app */, - ); - name = Products; - sourceTree = ""; - }; - 5E34CC761B7F905600F212E8 /* Libraries */ = { - isa = PBXGroup; - children = ( - 5E8570B01B7F99F500B267D2 /* Cocoa.framework */, - 5E8570B41B7F9A0700B267D2 /* IOKit.framework */, - 5E8570B21B7F99FE00B267D2 /* OpenGL.framework */, - 5E34CC781B7F90A000F212E8 /* libIrrlicht.a */, - ); - name = Libraries; - sourceTree = ""; - }; - 5E34CC771B7F906D00F212E8 /* Resources */ = { - isa = PBXGroup; - children = ( - 5E8570BE1B7F9D3A00B267D2 /* media */, - ); - name = Resources; - sourceTree = ""; - }; -/* End PBXGroup section */ - -/* Begin PBXNativeTarget section */ - 5E34CC501B7F8E6E00F212E8 /* 07.Collision */ = { - isa = PBXNativeTarget; - buildConfigurationList = 5E34CC701B7F8E6E00F212E8 /* Build configuration list for PBXNativeTarget "07.Collision" */; - buildPhases = ( - 5E34CC4D1B7F8E6E00F212E8 /* Sources */, - 5E34CC4E1B7F8E6E00F212E8 /* Frameworks */, - 5E34CC4F1B7F8E6E00F212E8 /* Resources */, - ); - buildRules = ( - ); - dependencies = ( - ); - name = 07.Collision; - productName = 01.HelloWorld; - productReference = 5E34CC511B7F8E6E00F212E8 /* 07.Collision.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 "Collision" */; - compatibilityVersion = "Xcode 3.2"; - developmentRegion = English; - hasScannedForEncodings = 0; - knownRegions = ( - en, - Base, - ); - mainGroup = 5E34C6D81B7F4A0C00F212E8; - productRefGroup = 5E34CC521B7F8E6E00F212E8 /* Products */; - projectDirPath = ""; - projectRoot = ""; - targets = ( - 5E34CC501B7F8E6E00F212E8 /* 07.Collision */, - ); - }; -/* 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 "Collision" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 5E34C6DD1B7F4A0C00F212E8 /* Debug */, - 5E34C6DE1B7F4A0C00F212E8 /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - 5E34CC701B7F8E6E00F212E8 /* Build configuration list for PBXNativeTarget "07.Collision" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 5E34CC6C1B7F8E6E00F212E8 /* Debug */, - 5E34CC6D1B7F8E6E00F212E8 /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; -/* End XCConfigurationList section */ - }; - rootObject = 5E34C6D91B7F4A0C00F212E8 /* Project object */; -} diff --git a/examples/07.Collision/Collision.xcodeproj/xcshareddata/xcschemes/07.Collision.xcscheme b/examples/07.Collision/Collision.xcodeproj/xcshareddata/xcschemes/07.Collision.xcscheme deleted file mode 100644 index c9728c83..00000000 --- a/examples/07.Collision/Collision.xcodeproj/xcshareddata/xcschemes/07.Collision.xcscheme +++ /dev/null @@ -1,91 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/examples/07.Collision/Collision_vc10.vcxproj b/examples/07.Collision/Collision_vc10.vcxproj deleted file mode 100644 index 72fcae0a..00000000 --- a/examples/07.Collision/Collision_vc10.vcxproj +++ /dev/null @@ -1,235 +0,0 @@ - - - - - Debug - Win32 - - - Debug - x64 - - - Release - Win32 - - - Release - x64 - - - - 07.Collision - {3E30297B-5BE3-4A5C-B31E-08A28ADDB29E} - Collision - - - - Application - false - MultiByte - Windows7.1SDK - - - Application - false - MultiByte - Windows7.1SDK - - - Application - false - MultiByte - Windows7.1SDK - - - Application - false - MultiByte - Windows7.1SDK - - - - - - - - - - - - - - - - - - - - - - - <_ProjectFileVersion>10.0.30319.1 - ..\..\bin\Win32-VisualStudio\ - ..\..\bin\Win64-VisualStudio\ - - - ..\..\bin\Win32-VisualStudio\ - ..\..\bin\Win64-VisualStudio\ - - - AllRules.ruleset - AllRules.ruleset - - - - - AllRules.ruleset - AllRules.ruleset - - - - - - - - .\Debug/Collision.tlb - - - - - Disabled - ..\..\include;%(AdditionalIncludeDirectories) - WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebug - - - Level3 - EditAndContinue - - - _DEBUG;%(PreprocessorDefinitions) - 0x0c07 - - - ..\..\bin\Win32-VisualStudio\07.Collision.exe - ..\..\lib\Win32-visualstudio;%(AdditionalLibraryDirectories) - true - Console - - - - - - - .\Debug/Collision.tlb - - - - - Disabled - ..\..\include;%(AdditionalIncludeDirectories) - WIN32;WIN64;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebug - - - Level3 - ProgramDatabase - - - _DEBUG;%(PreprocessorDefinitions) - 0x0c07 - - - ..\..\bin\Win64-VisualStudio\07.Collision.exe - ..\..\lib\Win64-visualstudio;%(AdditionalLibraryDirectories) - true - Console - - - - - - - .\Release/Collision.tlb - - - - - MaxSpeed - OnlyExplicitInline - ..\..\include;%(AdditionalIncludeDirectories) - WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) - true - MultiThreaded - true - - - Level3 - - - NDEBUG;%(PreprocessorDefinitions) - 0x0c07 - - - ..\..\bin\Win32-VisualStudio\07.Collision.exe - ..\..\lib\Win32-visualstudio;%(AdditionalLibraryDirectories) - Console - - - - - - - .\Release/Collision.tlb - - - - - MaxSpeed - OnlyExplicitInline - ..\..\include;%(AdditionalIncludeDirectories) - WIN32;WIN64;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) - true - MultiThreaded - true - - - Level3 - - - NDEBUG;%(PreprocessorDefinitions) - 0x0c07 - - - ..\..\bin\Win64-VisualStudio\07.Collision.exe - ..\..\lib\Win64-visualstudio;%(AdditionalLibraryDirectories) - Console - - - - - - - Disabled - Disabled - %(AdditionalIncludeDirectories) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(PreprocessorDefinitions) - EnableFastChecks - EnableFastChecks - MaxSpeed - MaxSpeed - %(AdditionalIncludeDirectories) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(PreprocessorDefinitions) - - - - - - \ No newline at end of file diff --git a/examples/07.Collision/Collision_vc11.vcxproj b/examples/07.Collision/Collision_vc11.vcxproj deleted file mode 100644 index 72fcae0a..00000000 --- a/examples/07.Collision/Collision_vc11.vcxproj +++ /dev/null @@ -1,235 +0,0 @@ - - - - - Debug - Win32 - - - Debug - x64 - - - Release - Win32 - - - Release - x64 - - - - 07.Collision - {3E30297B-5BE3-4A5C-B31E-08A28ADDB29E} - Collision - - - - Application - false - MultiByte - Windows7.1SDK - - - Application - false - MultiByte - Windows7.1SDK - - - Application - false - MultiByte - Windows7.1SDK - - - Application - false - MultiByte - Windows7.1SDK - - - - - - - - - - - - - - - - - - - - - - - <_ProjectFileVersion>10.0.30319.1 - ..\..\bin\Win32-VisualStudio\ - ..\..\bin\Win64-VisualStudio\ - - - ..\..\bin\Win32-VisualStudio\ - ..\..\bin\Win64-VisualStudio\ - - - AllRules.ruleset - AllRules.ruleset - - - - - AllRules.ruleset - AllRules.ruleset - - - - - - - - .\Debug/Collision.tlb - - - - - Disabled - ..\..\include;%(AdditionalIncludeDirectories) - WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebug - - - Level3 - EditAndContinue - - - _DEBUG;%(PreprocessorDefinitions) - 0x0c07 - - - ..\..\bin\Win32-VisualStudio\07.Collision.exe - ..\..\lib\Win32-visualstudio;%(AdditionalLibraryDirectories) - true - Console - - - - - - - .\Debug/Collision.tlb - - - - - Disabled - ..\..\include;%(AdditionalIncludeDirectories) - WIN32;WIN64;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebug - - - Level3 - ProgramDatabase - - - _DEBUG;%(PreprocessorDefinitions) - 0x0c07 - - - ..\..\bin\Win64-VisualStudio\07.Collision.exe - ..\..\lib\Win64-visualstudio;%(AdditionalLibraryDirectories) - true - Console - - - - - - - .\Release/Collision.tlb - - - - - MaxSpeed - OnlyExplicitInline - ..\..\include;%(AdditionalIncludeDirectories) - WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) - true - MultiThreaded - true - - - Level3 - - - NDEBUG;%(PreprocessorDefinitions) - 0x0c07 - - - ..\..\bin\Win32-VisualStudio\07.Collision.exe - ..\..\lib\Win32-visualstudio;%(AdditionalLibraryDirectories) - Console - - - - - - - .\Release/Collision.tlb - - - - - MaxSpeed - OnlyExplicitInline - ..\..\include;%(AdditionalIncludeDirectories) - WIN32;WIN64;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) - true - MultiThreaded - true - - - Level3 - - - NDEBUG;%(PreprocessorDefinitions) - 0x0c07 - - - ..\..\bin\Win64-VisualStudio\07.Collision.exe - ..\..\lib\Win64-visualstudio;%(AdditionalLibraryDirectories) - Console - - - - - - - Disabled - Disabled - %(AdditionalIncludeDirectories) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(PreprocessorDefinitions) - EnableFastChecks - EnableFastChecks - MaxSpeed - MaxSpeed - %(AdditionalIncludeDirectories) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(PreprocessorDefinitions) - - - - - - \ No newline at end of file diff --git a/examples/07.Collision/Collision_vc12.vcxproj b/examples/07.Collision/Collision_vc12.vcxproj deleted file mode 100644 index 6434626b..00000000 --- a/examples/07.Collision/Collision_vc12.vcxproj +++ /dev/null @@ -1,235 +0,0 @@ - - - - - Debug - Win32 - - - Debug - x64 - - - Release - Win32 - - - Release - x64 - - - - 07.Collision - {3E30297B-5BE3-4A5C-B31E-08A28ADDB29E} - Collision - - - - Application - false - MultiByte - Windows7.1SDK - - - Application - false - MultiByte - Windows7.1SDK - - - Application - false - MultiByte - Windows7.1SDK - - - Application - false - MultiByte - Windows7.1SDK - - - - - - - - - - - - - - - - - - - - - - - <_ProjectFileVersion>10.0.30319.1 - ..\..\bin\Win32-VisualStudio\ - ..\..\bin\Win64-VisualStudio\ - - - ..\..\bin\Win32-VisualStudio\ - ..\..\bin\Win64-VisualStudio\ - - - AllRules.ruleset - AllRules.ruleset - - - - - AllRules.ruleset - AllRules.ruleset - - - - - - - - .\Debug/Collision.tlb - - - - - Disabled - ..\..\include;%(AdditionalIncludeDirectories) - WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebug - - - Level3 - EditAndContinue - - - _DEBUG;%(PreprocessorDefinitions) - 0x0c07 - - - ..\..\bin\Win32-VisualStudio\07.Collision.exe - ..\..\lib\Win32-visualstudio;%(AdditionalLibraryDirectories) - true - Console - - - - - - - .\Debug/Collision.tlb - - - - - Disabled - ..\..\include;%(AdditionalIncludeDirectories) - WIN32;WIN64;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebug - - - Level3 - ProgramDatabase - - - _DEBUG;%(PreprocessorDefinitions) - 0x0c07 - - - ..\..\bin\Win64-VisualStudio\07.Collision.exe - ..\..\lib\Win64-visualstudio;%(AdditionalLibraryDirectories) - true - Console - - - - - - - .\Release/Collision.tlb - - - - - MaxSpeed - OnlyExplicitInline - ..\..\include;%(AdditionalIncludeDirectories) - WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) - true - MultiThreaded - true - - - Level3 - - - NDEBUG;%(PreprocessorDefinitions) - 0x0c07 - - - ..\..\bin\Win32-VisualStudio\07.Collision.exe - ..\..\lib\Win32-visualstudio;%(AdditionalLibraryDirectories) - Console - - - - - - - .\Release/Collision.tlb - - - - - MaxSpeed - OnlyExplicitInline - ..\..\include;%(AdditionalIncludeDirectories) - WIN32;WIN64;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) - true - MultiThreaded - true - - - Level3 - - - NDEBUG;%(PreprocessorDefinitions) - 0x0c07 - - - ..\..\bin\Win64-VisualStudio\07.Collision.exe - ..\..\lib\Win64-visualstudio;%(AdditionalLibraryDirectories) - Console - - - - - - - Disabled - Disabled - %(AdditionalIncludeDirectories) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(PreprocessorDefinitions) - EnableFastChecks - EnableFastChecks - MaxSpeed - MaxSpeed - %(AdditionalIncludeDirectories) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(PreprocessorDefinitions) - - - - - - \ No newline at end of file diff --git a/examples/07.Collision/Collision_vc14.vcxproj b/examples/07.Collision/Collision_vc14.vcxproj deleted file mode 100644 index 06983f17..00000000 --- a/examples/07.Collision/Collision_vc14.vcxproj +++ /dev/null @@ -1,235 +0,0 @@ - - - - - Debug - Win32 - - - Debug - x64 - - - Release - Win32 - - - Release - x64 - - - - 07.Collision - {3E30297B-5BE3-4A5C-B31E-08A28ADDB29E} - Collision - - - - Application - false - MultiByte - v140 - - - Application - false - MultiByte - v140 - - - Application - false - MultiByte - v140 - - - Application - false - MultiByte - v140 - - - - - - - - - - - - - - - - - - - - - - - <_ProjectFileVersion>10.0.30319.1 - ..\..\bin\Win32-VisualStudio\ - ..\..\bin\Win64-VisualStudio\ - - - ..\..\bin\Win32-VisualStudio\ - ..\..\bin\Win64-VisualStudio\ - - - AllRules.ruleset - AllRules.ruleset - - - - - AllRules.ruleset - AllRules.ruleset - - - - - - - - .\Debug/Collision.tlb - - - - - Disabled - ..\..\include;%(AdditionalIncludeDirectories) - WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebug - - - Level3 - EditAndContinue - - - _DEBUG;%(PreprocessorDefinitions) - 0x0c07 - - - ..\..\bin\Win32-VisualStudio\07.Collision.exe - ..\..\lib\Win32-visualstudio;%(AdditionalLibraryDirectories) - true - Console - - - - - - - .\Debug/Collision.tlb - - - - - Disabled - ..\..\include;%(AdditionalIncludeDirectories) - WIN32;WIN64;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebug - - - Level3 - ProgramDatabase - - - _DEBUG;%(PreprocessorDefinitions) - 0x0c07 - - - ..\..\bin\Win64-VisualStudio\07.Collision.exe - ..\..\lib\Win64-visualstudio;%(AdditionalLibraryDirectories) - true - Console - - - - - - - .\Release/Collision.tlb - - - - - MaxSpeed - OnlyExplicitInline - ..\..\include;%(AdditionalIncludeDirectories) - WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) - true - MultiThreaded - true - - - Level3 - - - NDEBUG;%(PreprocessorDefinitions) - 0x0c07 - - - ..\..\bin\Win32-VisualStudio\07.Collision.exe - ..\..\lib\Win32-visualstudio;%(AdditionalLibraryDirectories) - Console - - - - - - - .\Release/Collision.tlb - - - - - MaxSpeed - OnlyExplicitInline - ..\..\include;%(AdditionalIncludeDirectories) - WIN32;WIN64;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) - true - MultiThreaded - true - - - Level3 - - - NDEBUG;%(PreprocessorDefinitions) - 0x0c07 - - - ..\..\bin\Win64-VisualStudio\07.Collision.exe - ..\..\lib\Win64-visualstudio;%(AdditionalLibraryDirectories) - Console - - - - - - - Disabled - Disabled - %(AdditionalIncludeDirectories) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(PreprocessorDefinitions) - EnableFastChecks - EnableFastChecks - MaxSpeed - MaxSpeed - %(AdditionalIncludeDirectories) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(PreprocessorDefinitions) - - - - - - \ No newline at end of file diff --git a/examples/07.Collision/Makefile b/examples/07.Collision/Makefile deleted file mode 100644 index 25efc238..00000000 --- a/examples/07.Collision/Makefile +++ /dev/null @@ -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 := 07.Collision -# 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 diff --git a/examples/07.Collision/main.cpp b/examples/07.Collision/main.cpp deleted file mode 100644 index a52f493e..00000000 --- a/examples/07.Collision/main.cpp +++ /dev/null @@ -1,375 +0,0 @@ -/** Example 007 Collision - -We will describe 2 methods: Automatic collision detection for moving through -3d worlds with stair climbing and sliding, and manual scene node and triangle -picking using a ray. In this case, we will use a ray coming out from the -camera, but you can use any ray. - -To start, we take the program from tutorial 2, which loads and displays a -quake 3 level. We will use the level to walk in it and to pick triangles from. -In addition we'll place 3 animated models into it for triangle picking. The -following code starts up the engine and loads the level, as per tutorial 2. -*/ -#include -#include "driverChoice.h" -#include "exampleHelper.h" - -using namespace irr; - -#ifdef _MSC_VER -#pragma comment(lib, "Irrlicht.lib") -#endif - -enum -{ - // I use this ISceneNode ID to indicate a scene node that is - // not pickable by getSceneNodeAndCollisionPointFromRay() - ID_IsNotPickable = 0, - - // I use this flag in ISceneNode IDs to indicate that the - // scene node can be picked by ray selection. - IDFlag_IsPickable = 1 << 0, - - // I use this flag in ISceneNode IDs to indicate that the - // scene node can be highlighted. In this example, the - // homonids can be highlighted, but the level mesh can't. - IDFlag_IsHighlightable = 1 << 1 -}; - -int main() -{ - // ask user for driver - video::E_DRIVER_TYPE driverType=driverChoiceConsole(); - if (driverType==video::EDT_COUNT) - return 1; - - // create device - - IrrlichtDevice *device = - createDevice(driverType, core::dimension2d(640, 480), 16, false); - - if (device == 0) - return 1; // could not create selected driver. - - /* - If we want to receive information about the material of a hit triangle we have to get - collisions per meshbuffer. The only disadvantage of this is that getting them per - meshbuffer can be a little bit slower than per mesh, but usually that's not noticeable. - If you set this to false you will no longer get material names in the title bar. - */ - const bool separateMeshBuffers = true; - - video::IVideoDriver* driver = device->getVideoDriver(); - scene::ISceneManager* smgr = device->getSceneManager(); - - const io::path mediaPath = getExampleMediaPath(); - - device->getFileSystem()->addFileArchive(mediaPath + "map-20kdm2.pk3"); - - scene::IAnimatedMesh* q3levelmesh = smgr->getMesh("20kdm2.bsp"); - scene::IMeshSceneNode* q3node = 0; - - // The Quake mesh is pickable, but doesn't get highlighted. - if (q3levelmesh) - q3node = smgr->addOctreeSceneNode(q3levelmesh->getMesh(0), 0, IDFlag_IsPickable); - - /* - So far so good, we've loaded the quake 3 level like in tutorial 2. Now, - here comes something different: We create a triangle selector. A - triangle selector is a class which can fetch the triangles from scene - nodes for doing different things with them, for example collision - detection. There are different triangle selectors, and all can be - created with the ISceneManager. In this example, we create an - OctreeTriangleSelector, which optimizes the triangle output a little - bit by reducing it like an octree. This is very useful for huge meshes - like quake 3 levels. After we created the triangle selector, we attach - it to the q3node. This is not necessary, but in this way, we do not - need to care for the selector, for example dropping it after we do not - need it anymore. - */ - - scene::ITriangleSelector* selector = 0; - - if (q3node) - { - q3node->setPosition(core::vector3df(-1350,-130,-1400)); - - /* - There is currently no way to split an octree by material. - So if we need material infos we have to create one octree per - meshbuffer and put them together in a MetaTriangleSelector. - */ - if ( separateMeshBuffers && q3node->getMesh()->getMeshBufferCount() > 1) - { - scene::IMetaTriangleSelector * metaSelector = smgr->createMetaTriangleSelector(); - for ( irr::u32 m=0; m < q3node->getMesh()->getMeshBufferCount(); ++m ) - { - scene::ITriangleSelector* - bufferSelector = smgr->createOctreeTriangleSelector( - q3node->getMesh()->getMeshBuffer(m), m, q3node); - if ( bufferSelector ) - { - metaSelector->addTriangleSelector( bufferSelector ); - bufferSelector->drop(); - } - } - selector = metaSelector; - } - else - { - // If you don't need material infos just create one octree for the - // whole mesh. - selector = smgr->createOctreeTriangleSelector( - q3node->getMesh(), q3node, 128); - } - q3node->setTriangleSelector(selector); - // We're not done with this selector yet, so don't drop it. - } - - - /* - We add a first person shooter camera to the scene so that we can see and - move in the quake 3 level like in tutorial 2. But this, time, we add a - special animator to the camera: A collision response animator. This - animator modifies the scene node to which it is attached in order to - prevent it from moving through walls and to add gravity to the node. The - only things we have to tell the animator is how the world looks like, - how big the scene node is, how much gravity to apply and so on. After the - collision response animator is attached to the camera, we do not have to do - anything else for collision detection, it's all done automatically. - The rest of the collision detection code below is for picking. And please - note another cool feature: The collision response animator can be - attached also to all other scene nodes, not only to cameras. And it can - be mixed with other scene node animators. In this way, collision - detection and response in the Irrlicht engine is really easy. - - Now we'll take a closer look on the parameters of - createCollisionResponseAnimator(). The first parameter is the - TriangleSelector, which specifies how the world, against which collision - detection is done, looks like. The second parameter is the scene node, - which is the object which is affected by collision detection - in our - case it is the camera. The third defines how big the object is, it is - the radius of an ellipsoid. Try it out and change the radius to smaller - values, the camera will be able to move closer to walls after this. The - next parameter is the direction and speed of gravity. We'll set it to - (0, -1000, 0), which approximates realistic gravity (depends on the units - which are used in the scene model). You could set it to (0,0,0) to disable - gravity. And the last value is just an offset: Without it the ellipsoid with - which collision detection is done would be around the camera and the camera - would be in the middle of the ellipsoid. But as human beings, we are used to - have our eyes on top of the body, not in the middle of it. So we place the - scene node 50 units over the center of the ellipsoid with this parameter. - And that's it, collision detection works now. - */ - - // Set a jump speed of 300 units per second, which gives a fairly realistic jump - // when used with the gravity of (0, -1000, 0) in the collision response animator. - scene::ICameraSceneNode* camera = - smgr->addCameraSceneNodeFPS(0, 100.0f, .3f, ID_IsNotPickable, 0, 0, true, 300.f); - camera->setPosition(core::vector3df(50,50,-60)); - camera->setTarget(core::vector3df(-70,30,-60)); - - if (selector) - { - scene::ISceneNodeAnimatorCollisionResponse * anim = smgr->createCollisionResponseAnimator( - selector, camera, core::vector3df(30,50,30), - core::vector3df(0,-1000,0), core::vector3df(0,30,0)); - selector->drop(); // As soon as we're done with the selector, drop it. - camera->addAnimator(anim); - anim->drop(); // And likewise, drop the animator when we're done referring to it. - } - - // Now I create three animated characters which we can pick, a dynamic light for - // lighting them, and a billboard for drawing where we found an intersection. - - // First, let's get rid of the mouse cursor. We'll use a billboard to show - // what we're looking at. - device->getCursorControl()->setVisible(false); - - // Add the billboard. - scene::IBillboardSceneNode * bill = smgr->addBillboardSceneNode(); - bill->setMaterialType(video::EMT_TRANSPARENT_ADD_COLOR ); - bill->setMaterialTexture(0, driver->getTexture(mediaPath + "particle.bmp")); - bill->setMaterialFlag(video::EMF_LIGHTING, false); - bill->setMaterialFlag(video::EMF_ZBUFFER, false); - bill->setSize(core::dimension2d(20.0f, 20.0f)); - bill->setID(ID_IsNotPickable); // This ensures that we don't accidentally ray-pick it - - /* Add 3 animated hominids, which we can pick using a ray-triangle intersection. - They all animate quite slowly, to make it easier to see that accurate triangle - selection is being performed. */ - scene::IAnimatedMeshSceneNode* node = 0; - - video::SMaterial material; - - // Add an MD2 node, which uses vertex-based animation. - node = smgr->addAnimatedMeshSceneNode(smgr->getMesh(mediaPath + "faerie.md2"), - 0, IDFlag_IsPickable | IDFlag_IsHighlightable); - node->setPosition(core::vector3df(-90,-15,-140)); // Put its feet on the floor. - node->setScale(core::vector3df(1.6f)); // Make it appear realistically scaled - node->setMD2Animation(scene::EMAT_POINT); - node->setAnimationSpeed(20.f); - material.setTexture(0, driver->getTexture(mediaPath + "faerie2.bmp")); - material.Lighting = true; - material.NormalizeNormals = true; - node->getMaterial(0) = material; - - // Now create a triangle selector for it. The selector will know that it - // is associated with an animated node, and will update itself as necessary. - selector = smgr->createTriangleSelector(node, separateMeshBuffers); - node->setTriangleSelector(selector); - selector->drop(); // We're done with this selector, so drop it now. - - // And this B3D file uses skinned skeletal animation. - node = smgr->addAnimatedMeshSceneNode(smgr->getMesh(mediaPath + "ninja.b3d"), - 0, IDFlag_IsPickable | IDFlag_IsHighlightable); - node->setScale(core::vector3df(10)); - node->setPosition(core::vector3df(-75,-66,-80)); - node->setRotation(core::vector3df(0,90,0)); - node->setAnimationSpeed(8.f); - node->getMaterial(0).NormalizeNormals = true; - node->getMaterial(0).Lighting = true; - // Just do the same as we did above. - selector = smgr->createTriangleSelector(node, separateMeshBuffers); - node->setTriangleSelector(selector); - selector->drop(); - - // This X files uses skeletal animation, but without skinning. - node = smgr->addAnimatedMeshSceneNode(smgr->getMesh(mediaPath + "dwarf.x"), - 0, IDFlag_IsPickable | IDFlag_IsHighlightable); - node->setPosition(core::vector3df(-70,-66,-30)); // Put its feet on the floor. - node->setRotation(core::vector3df(0,-90,0)); // And turn it towards the camera. - node->setAnimationSpeed(20.f); - node->getMaterial(0).Lighting = true; - selector = smgr->createTriangleSelector(node, separateMeshBuffers); - node->setTriangleSelector(selector); - selector->drop(); - - // And this mdl file uses skinned skeletal animation. - node = smgr->addAnimatedMeshSceneNode(smgr->getMesh(mediaPath + "yodan.mdl"), - 0, IDFlag_IsPickable | IDFlag_IsHighlightable); - node->setPosition(core::vector3df(-90,-25,20)); - node->setScale(core::vector3df(0.8f)); - node->getMaterial(0).Lighting = true; - node->setAnimationSpeed(20.f); - - // Just do the same as we did above. - selector = smgr->createTriangleSelector(node, separateMeshBuffers); - node->setTriangleSelector(selector); - selector->drop(); - - material.setTexture(0, 0); - material.Lighting = false; - - // Add a light, so that the unselected nodes aren't completely dark. - scene::ILightSceneNode * light = smgr->addLightSceneNode(0, core::vector3df(-60,100,400), - video::SColorf(1.0f,1.0f,1.0f,1.0f), 600.0f); - light->setID(ID_IsNotPickable); // Make it an invalid target for selection. - - // Remember which scene node is highlighted - scene::ISceneNode* highlightedSceneNode = 0; - scene::ISceneCollisionManager* collMan = smgr->getSceneCollisionManager(); - - // draw the selection triangle only as wireframe - material.Wireframe=true; - - while(device->run()) - if (device->isWindowActive()) - { - driver->beginScene(video::ECBF_COLOR | video::ECBF_DEPTH, video::SColor(0)); - smgr->drawAll(); - - // Unlight any currently highlighted scene node - if (highlightedSceneNode) - { - highlightedSceneNode->setMaterialFlag(video::EMF_LIGHTING, true); - highlightedSceneNode = 0; - } - - // All intersections in this example are done with a ray cast out from the camera to - // a distance of 1000. You can easily modify this to check (e.g.) a bullet - // trajectory or a sword's position, or create a ray from a mouse click position using - // ISceneCollisionManager::getRayFromScreenCoordinates() - core::line3d ray; - ray.start = camera->getPosition(); - ray.end = ray.start + (camera->getTarget() - ray.start).normalize() * 1000.0f; - - - // This call is all you need to perform ray/triangle collision on every scene node - // that has a triangle selector, including the Quake level mesh. It finds the nearest - // collision point/triangle, and returns the scene node containing that point. - // Irrlicht provides other types of selection, including ray/triangle selector, - // ray/box and ellipse/triangle selector, plus associated helpers. - // You might also want to check the other methods of ISceneCollisionManager. - - irr::io::SNamedPath hitTextureName; - scene::SCollisionHit hitResult; - scene::ISceneNode * selectedSceneNode =collMan->getSceneNodeAndCollisionPointFromRay( - hitResult, // Returns all kind of info about the collision - ray, - IDFlag_IsPickable, // This ensures that only nodes that we have - // set up to be pickable are considered - 0); // Check the entire scene (this is actually the implicit default) - - - // If the ray hit anything, move the billboard to the collision position - // and draw the triangle that was hit. - if(selectedSceneNode) - { - bill->setPosition(hitResult.Intersection); // Show the current intersection point with the level or a mesh - - // We need to reset the transform before doing our own rendering. - driver->setTransform(video::ETS_WORLD, core::matrix4()); - driver->setMaterial(material); - driver->draw3DTriangle(hitResult.Triangle, video::SColor(0,255,0,0)); // Show which triangle has been hit - - // We can check the flags for the scene node that was hit to see if it should be - // highlighted. The animated nodes can be highlighted, but not the Quake level mesh - if((selectedSceneNode->getID() & IDFlag_IsHighlightable) == IDFlag_IsHighlightable) - { - highlightedSceneNode = selectedSceneNode; - - // Highlighting in this case means turning lighting OFF for this node, - // which means that it will be drawn with full brightness. - highlightedSceneNode->setMaterialFlag(video::EMF_LIGHTING, false); - } - - // When separateMeshBuffers is set to true we can now find out which material was hit - if ( hitResult.MeshBuffer && hitResult.Node && hitResult.Node->getMaterial(hitResult.MaterialIndex).TextureLayer[0].Texture ) - { - // Note we are interested in the node material and not in the meshbuffer material. - // Otherwise we wouldn't get the fairy2 texture which is only set on the node. - hitTextureName = hitResult.Node->getMaterial(hitResult.MaterialIndex).TextureLayer[0].Texture->getName(); - } - } - - // We're all done drawing, so end the scene. - driver->endScene(); - - // Show some info in title-bar - int fps = driver->getFPS(); - static core::stringw lastString; - core::stringw str = L"Collision detection example - Irrlicht Engine ["; - str += driver->getName(); - str += "] FPS:"; - str += fps; - if ( !hitTextureName.getInternalName().empty() ) - { - str += " "; - irr::io::path texName(hitTextureName.getInternalName()); - str += core::deletePathFromFilename(texName); - } - if ( str != lastString ) // changing caption is somewhat expensive, so don't when nothing changed - { - device->setWindowCaption(str.c_str()); - lastString = str; - } - } - - device->drop(); - - return 0; -} - -/* -**/ diff --git a/examples/07.Collision/tutorial.html b/examples/07.Collision/tutorial.html deleted file mode 100644 index c04fce99..00000000 --- a/examples/07.Collision/tutorial.html +++ /dev/null @@ -1,308 +0,0 @@ - - -Irrlicht Engine Tutorial - - - - -
- - - - - - - - -
-
-
-
Tutorial 7. Collision detection - and response
-
-
-
-

In this tutorial, I will show how to collision detection with the Irrlicht - Engine. I will describe 3 methods: Automatic collision detection for - moving through 3d worlds with stair climbing and sliding, manual triangle - picking and manual scene node picking.

-

The program which is described here will look like this:

-


-

-
-
-
- - - - - - - -
- Lets start!
-
-

To start, we take the program from tutorial 2, which loaded and displayed - a quake 3 level. We will use the level to walk in it and to pick triangles - from it. In addition we'll place 3 animated models into it for scene - node picking. The following code starts up the engine and loads a - quake 3 level. I will not explain it, because it should already be - known from tutorial 2.

- - - - -
#include <irrlicht.h>
-#include <iostream>
-
using namespace irr; - -#pragma comment(lib, "Irrlicht.lib") - -int main() -{ - // let user select driver type -
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 0;
}
- // create device
-
  IrrlichtDevice *device = createDevice(driverType,
-     core::dimension2d<s32>(640, 480), 16, false);
- if (device == 0)
return 1; // could not create selected driver.

video::IVideoDriver* driver = device->getVideoDriver();
scene::ISceneManager* smgr = device->getSceneManager();

device->getFileSystem()->addZipFileArchive
("../../media/map-20kdm2.pk3"); - - - scene::IAnimatedMesh* q3levelmesh = smgr->getMesh("20kdm2.bsp"); - scene::ISceneNode* q3node = 0; - - if (q3levelmesh) - q3node = smgr->addOctTreeSceneNode(q3levelmesh->getMesh(0)); -
-
-

So far so good, we've loaded the quake 3 level like in tutorial - 2. Now, here comes something different: We create a triangle selector. - A triangle selector is a class which can fetch the triangles from - scene nodes for doing different things with them, for example collision - detection. There are different triangle selectors, and all can be - created with the ISceneManager. In this example, we create an OctTreeTriangleSelector, - which optimizes the triangle output a little bit by reducing it like - an octree. This is very useful for huge meshes like quake 3 levels.
- Afte we created the triangle selector, we attach it to the q3node. - This is not necessary, but in this way, we do not need to care for - the selector, for example dropping it after we do not need it anymore.

- - - - -
scene::ITriangleSelector* selector = 0;
-	
-	if (q3node)
-	{		
-		q3node->setPosition(core::vector3df(-1370,-130,-1400));
-
-		selector = smgr->createOctTreeTriangleSelector(
-            q3levelmesh->getMesh(0), q3node, 128);
-		q3node->setTriangleSelector(selector);
-	}
-

We add a first person shooter camera to the scene for being able - to move in the quake 3 level like in tutorial 2. But this, time, we - add a special animator to the camera: A Collision Response animator. - This thing modifies the scene node to which it is attached to in that - way, that it may no more move through walls and is affected by gravity. - The only thing we have to tell the animator is how the world looks - like, how big the scene node is, how gravity and so on. After the - collision response animator is attached to the camera, we do not have - to do anything more for collision detection, anything is done automaticly, - all other collision detection code below is for picking. And please - note another cool feature: The collsion response animator can be attached - also to all other scene nodes, not only to cameras. And it can be - mixed with other scene node animators. In this way, collision detection - and response in the Irrlicht
- engine is really, really easy.
- Now we'll take a closer look on the parameters of createCollisionResponseAnimator(). - The first parameter is the TriangleSelector, which specifies how the - world, against collision detection is done looks like. The second - parameter is the scene node, which is the object, which is affected - by collision detection, in our case it is the camera. The third defines - how big the object is, it is the radius of an ellipsoid. Try it out - and change the radius to smaller values, the camera will be able to - move closer to walls after this. The next parameter is the direction - and speed of gravity. You could set it to (0,0,0) to disable gravity. - And the last value is just a translation: Without this, the ellipsoid - with which collision detection is done would be around the camera, - and the camera would be in the middle of the ellipsoid. But as human - beings, we are used to have our eyes on top of the body, with which - we collide with our world, not in the middle of it. So we place the - scene node 50 units over the center of the ellipsoid with this parameter. - And that's it, collision detection works now.
-

- - - - -
	scene::ICameraSceneNode* camera = 	
camera = smgr->addCameraSceneNodeFPS(0,100.0f,300.0f); - camera->setPosition(core::vector3df(-100,50,-150)); - - scene::ISceneNodeAnimator* anim =
smgr->createCollisionResponseAnimator( - selector, camera, core::vector3df(30,50,30), - core::vector3df(0,-3,0), - core::vector3df(0,50,0));
- selector->drop();
- camera->addAnimator(anim); - anim->drop();
-

Because collision detection is no big deal in irrlicht, I'll describe - how to do two different types of picking in the next section. But - before this, I'll prepare the scene a little. I need three animated - characters which we
- could pick later, a dynamic light for lighting them, a billboard for - drawing where we found an intersection, and, yes, I need to get rid - of this mouse cursor. :)

- - - - -
	// disable mouse cursor
-
-	device->getCursorControl()->setVisible(false);
-
-	// add billboard
-
-	scene::IBillboardSceneNode * bill = smgr->addBillboardSceneNode();
-	bill->setMaterialType(video::EMT_TRANSPARENT_ADD_COLOR );
-	bill->setMaterialTexture(0, driver->getTexture(
"../../media/particle.bmp")); - bill->setMaterialFlag(video::EMF_LIGHTING, false); - bill->setSize(core::dimension2d<f32>(20.0f, 20.0f)); - - // add 3 animated faeries. - - video::SMaterial material; - material.Texture1 = driver->getTexture(
"../../media/faerie2.bmp"
); - material.Lighting = true; - - scene::IAnimatedMeshSceneNode* node = 0; - scene::IAnimatedMesh* faerie = smgr->getMesh(
"../../media/faerie.md2"); - - if (faerie) - { - node = smgr->addAnimatedMeshSceneNode(faerie); - node->setPosition(core::vector3df(-70,0,-90)); - node->setMD2Animation(scene::EMAT_RUN); - node->getMaterial(0) = material; - - node = smgr->addAnimatedMeshSceneNode(faerie); - node->setPosition(core::vector3df(-70,0,-30)); - node->setMD2Animation(scene::EMAT_SALUTE); - node->getMaterial(0) = material; - - node = smgr->addAnimatedMeshSceneNode(faerie); - node->setPosition(core::vector3df(-70,0,-60)); - node->setMD2Animation(scene::EMAT_JUMP); - node->getMaterial(0) = material; - } - - material.Texture1 = 0; - material.Lighting = false; - - // Add a light - - smgr->addLightSceneNode(0, core::vector3df(-60,100,400), - video::SColorf(1.0f,1.0f,1.0f,1.0f), - 600.0f);
-

For not making it to complicated, I'm doing picking inside the drawing - loop. We take two pointers for storing the current and the last selected - scene node and start the loop.

-
- - - - -
	scene::ISceneNode* selectedSceneNode = 0;
-	scene::ISceneNode* lastSelectedSceneNode = 0;
-
-	
-	int lastFPS = -1;
-
-	while(device->run())
if (device->isWindowActive()) - { - driver->beginScene(true, true, 0); - - smgr->drawAll();
-

After we've drawn the whole scene whit smgr->drawAll(), we'll do - the first picking: We want to know which triangle of the world we are - looking at. In addition, we want the exact point of the quake 3 level - we are looking at. For this, we create a 3d line starting at the position - of the camera and going through the lookAt-target of it. Then we ask - the collision manager if this line collides with a triangle of the world - stored in the triangle selector. If yes, we draw the 3d triangle and - set the position of the billboard to the intersection point.

- - - - -
		core::line3d<f32> line;
-		line.start = camera->getPosition();
-		line.end = line.start +
-         (camera->getTarget() - line.start).normalize() * 1000.0f;
-
-		core::vector3df intersection;
-		core::triangle3df tri;
-
-		if (smgr->getSceneCollisionManager()->getCollisionPoint(
-			line, selector, intersection, tri))
-		{
-			bill->setPosition(intersection);
-				
-			driver->setTransform(video::ETS_WORLD, core::matrix4());
-			driver->setMaterial(material);
-			driver->draw3DTriangle(tri, video::SColor(0,255,0,0));
-		}
-

Another type of picking supported by the Irrlicht Engine is scene - node picking based on bouding boxes. Every scene node has got a bounding - box, and because of that, it's very fast for example to get the scene - node which the camera looks
- at. Again, we ask the collision manager for this, and if we've got a - scene node, we highlight it by disabling Lighting in its material, if - it is not the billboard or the quake 3 level.

- - - - -
		selectedSceneNode = smgr->getSceneCollisionManager()->
-          getSceneNodeFromCameraBB(camera);
-
-		if (lastSelectedSceneNode)
-			lastSelectedSceneNode->setMaterialFlag(
-                video::EMF_LIGHTING, true);
-
-		if (selectedSceneNode == q3node ||
-           selectedSceneNode == bill)
-			selectedSceneNode = 0;
-
-		if (selectedSceneNode)
-			selectedSceneNode->setMaterialFlag(
-               video::EMF_LIGHTING, false);
-
-		lastSelectedSceneNode = selectedSceneNode;
-

That's it, we just have to finish drawing.

- - - - -
		driver->endScene();
-
-		int fps = driver->getFPS();
-
-		if (lastFPS != fps)
-		{
-		  core::stringw str = L"Collision detection example - Irrlicht Engine [";
str += driver->getName();
str += "] FPS:";
str += fps;

device->setWindowCaption(str.c_str());
lastFPS = fps;
} - } - - device->drop(); - - return 0; -} - -
-

 

-

 

-
-
-

 

- - diff --git a/examples/08.SpecialFX/Makefile b/examples/08.SpecialFX/Makefile deleted file mode 100644 index 2a382f35..00000000 --- a/examples/08.SpecialFX/Makefile +++ /dev/null @@ -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 := 08.SpecialFX -# 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 diff --git a/examples/08.SpecialFX/SpecialFX.cbp b/examples/08.SpecialFX/SpecialFX.cbp deleted file mode 100644 index c23c621f..00000000 --- a/examples/08.SpecialFX/SpecialFX.cbp +++ /dev/null @@ -1,54 +0,0 @@ - - - - - - diff --git a/examples/08.SpecialFX/SpecialFX.vcproj b/examples/08.SpecialFX/SpecialFX.vcproj deleted file mode 100644 index e22266e3..00000000 --- a/examples/08.SpecialFX/SpecialFX.vcproj +++ /dev/null @@ -1,163 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/examples/08.SpecialFX/SpecialFX.xcodeproj/project.pbxproj b/examples/08.SpecialFX/SpecialFX.xcodeproj/project.pbxproj deleted file mode 100644 index cc37ca7f..00000000 --- a/examples/08.SpecialFX/SpecialFX.xcodeproj/project.pbxproj +++ /dev/null @@ -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 /* 08.SpecialFX.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = 08.SpecialFX.app; sourceTree = BUILT_PRODUCTS_DIR; }; - 5E34CC741B7F8EEF00F212E8 /* main.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = main.cpp; sourceTree = ""; }; - 5E34CC781B7F90A000F212E8 /* libIrrlicht.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libIrrlicht.a; path = ../../lib/OSX/libIrrlicht.a; sourceTree = ""; }; - 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 = ""; }; -/* 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 = ""; - }; - 5E34CC521B7F8E6E00F212E8 /* Products */ = { - isa = PBXGroup; - children = ( - 5E34CC511B7F8E6E00F212E8 /* 08.SpecialFX.app */, - ); - name = Products; - sourceTree = ""; - }; - 5E34CC761B7F905600F212E8 /* Libraries */ = { - isa = PBXGroup; - children = ( - 5E8570B01B7F99F500B267D2 /* Cocoa.framework */, - 5E8570B41B7F9A0700B267D2 /* IOKit.framework */, - 5E8570B21B7F99FE00B267D2 /* OpenGL.framework */, - 5E34CC781B7F90A000F212E8 /* libIrrlicht.a */, - ); - name = Libraries; - sourceTree = ""; - }; - 5E34CC771B7F906D00F212E8 /* Resources */ = { - isa = PBXGroup; - children = ( - 5E8570BE1B7F9D3A00B267D2 /* media */, - ); - name = Resources; - sourceTree = ""; - }; -/* End PBXGroup section */ - -/* Begin PBXNativeTarget section */ - 5E34CC501B7F8E6E00F212E8 /* 08.SpecialFX */ = { - isa = PBXNativeTarget; - buildConfigurationList = 5E34CC701B7F8E6E00F212E8 /* Build configuration list for PBXNativeTarget "08.SpecialFX" */; - buildPhases = ( - 5E34CC4D1B7F8E6E00F212E8 /* Sources */, - 5E34CC4E1B7F8E6E00F212E8 /* Frameworks */, - 5E34CC4F1B7F8E6E00F212E8 /* Resources */, - ); - buildRules = ( - ); - dependencies = ( - ); - name = 08.SpecialFX; - productName = 01.HelloWorld; - productReference = 5E34CC511B7F8E6E00F212E8 /* 08.SpecialFX.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 "SpecialFX" */; - compatibilityVersion = "Xcode 3.2"; - developmentRegion = English; - hasScannedForEncodings = 0; - knownRegions = ( - en, - Base, - ); - mainGroup = 5E34C6D81B7F4A0C00F212E8; - productRefGroup = 5E34CC521B7F8E6E00F212E8 /* Products */; - projectDirPath = ""; - projectRoot = ""; - targets = ( - 5E34CC501B7F8E6E00F212E8 /* 08.SpecialFX */, - ); - }; -/* 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 "SpecialFX" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 5E34C6DD1B7F4A0C00F212E8 /* Debug */, - 5E34C6DE1B7F4A0C00F212E8 /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - 5E34CC701B7F8E6E00F212E8 /* Build configuration list for PBXNativeTarget "08.SpecialFX" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 5E34CC6C1B7F8E6E00F212E8 /* Debug */, - 5E34CC6D1B7F8E6E00F212E8 /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; -/* End XCConfigurationList section */ - }; - rootObject = 5E34C6D91B7F4A0C00F212E8 /* Project object */; -} diff --git a/examples/08.SpecialFX/SpecialFX.xcodeproj/xcshareddata/xcschemes/08.SpecialFX.xcscheme b/examples/08.SpecialFX/SpecialFX.xcodeproj/xcshareddata/xcschemes/08.SpecialFX.xcscheme deleted file mode 100644 index 71ffc702..00000000 --- a/examples/08.SpecialFX/SpecialFX.xcodeproj/xcshareddata/xcschemes/08.SpecialFX.xcscheme +++ /dev/null @@ -1,91 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/examples/08.SpecialFX/SpecialFX_vc10.vcxproj b/examples/08.SpecialFX/SpecialFX_vc10.vcxproj deleted file mode 100644 index fd669a1a..00000000 --- a/examples/08.SpecialFX/SpecialFX_vc10.vcxproj +++ /dev/null @@ -1,235 +0,0 @@ - - - - - Debug - Win32 - - - Debug - x64 - - - Release - Win32 - - - Release - x64 - - - - 08.SpecialFX - {C869BF55-B9D6-4980-BC92-60FA0CF8411A} - SpecialFX - - - - Application - false - MultiByte - Windows7.1SDK - - - Application - false - MultiByte - Windows7.1SDK - - - Application - false - MultiByte - Windows7.1SDK - - - Application - false - MultiByte - Windows7.1SDK - - - - - - - - - - - - - - - - - - - - - - - <_ProjectFileVersion>10.0.30319.1 - ..\..\bin\Win32-VisualStudio\ - ..\..\bin\Win64-VisualStudio\ - - - ..\..\bin\Win32-VisualStudio\ - ..\..\bin\Win64-VisualStudio\ - - - AllRules.ruleset - AllRules.ruleset - - - - - AllRules.ruleset - AllRules.ruleset - - - - - - - - .\Release/SpecialFX.tlb - - - - - MaxSpeed - OnlyExplicitInline - ..\..\include;%(AdditionalIncludeDirectories) - WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) - true - MultiThreaded - true - - - Level3 - - - NDEBUG;%(PreprocessorDefinitions) - 0x0c07 - - - ..\..\bin\Win32-VisualStudio\08.SpecialFx.exe - ..\..\lib\Win32-visualstudio;%(AdditionalLibraryDirectories) - Console - - - - - - - .\Release/SpecialFX.tlb - - - - - MaxSpeed - OnlyExplicitInline - ..\..\include;%(AdditionalIncludeDirectories) - WIN32;WIN64;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) - true - MultiThreaded - true - - - Level3 - - - NDEBUG;%(PreprocessorDefinitions) - 0x0c07 - - - ..\..\bin\Win64-VisualStudio\08.SpecialFx.exe - ..\..\lib\Win64-visualstudio;%(AdditionalLibraryDirectories) - Console - - - - - - - .\Debug/SpecialFX.tlb - - - - - Disabled - ..\..\include;%(AdditionalIncludeDirectories) - WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebug - - - Level3 - EditAndContinue - - - _DEBUG;%(PreprocessorDefinitions) - 0x0c07 - - - ..\..\bin\Win32-VisualStudio\08.SpecialFx.exe - ..\..\lib\Win32-visualstudio;%(AdditionalLibraryDirectories) - true - Console - - - - - - - .\Debug/SpecialFX.tlb - - - - - Disabled - ..\..\include;%(AdditionalIncludeDirectories) - WIN32;WIN64;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebug - - - Level3 - ProgramDatabase - - - _DEBUG;%(PreprocessorDefinitions) - 0x0c07 - - - ..\..\bin\Win64-VisualStudio\08.SpecialFx.exe - ..\..\lib\Win64-visualstudio;%(AdditionalLibraryDirectories) - true - Console - - - - - - - Disabled - Disabled - %(AdditionalIncludeDirectories) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(PreprocessorDefinitions) - EnableFastChecks - EnableFastChecks - MaxSpeed - MaxSpeed - %(AdditionalIncludeDirectories) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(PreprocessorDefinitions) - - - - - - \ No newline at end of file diff --git a/examples/08.SpecialFX/SpecialFX_vc11.vcxproj b/examples/08.SpecialFX/SpecialFX_vc11.vcxproj deleted file mode 100644 index fd669a1a..00000000 --- a/examples/08.SpecialFX/SpecialFX_vc11.vcxproj +++ /dev/null @@ -1,235 +0,0 @@ - - - - - Debug - Win32 - - - Debug - x64 - - - Release - Win32 - - - Release - x64 - - - - 08.SpecialFX - {C869BF55-B9D6-4980-BC92-60FA0CF8411A} - SpecialFX - - - - Application - false - MultiByte - Windows7.1SDK - - - Application - false - MultiByte - Windows7.1SDK - - - Application - false - MultiByte - Windows7.1SDK - - - Application - false - MultiByte - Windows7.1SDK - - - - - - - - - - - - - - - - - - - - - - - <_ProjectFileVersion>10.0.30319.1 - ..\..\bin\Win32-VisualStudio\ - ..\..\bin\Win64-VisualStudio\ - - - ..\..\bin\Win32-VisualStudio\ - ..\..\bin\Win64-VisualStudio\ - - - AllRules.ruleset - AllRules.ruleset - - - - - AllRules.ruleset - AllRules.ruleset - - - - - - - - .\Release/SpecialFX.tlb - - - - - MaxSpeed - OnlyExplicitInline - ..\..\include;%(AdditionalIncludeDirectories) - WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) - true - MultiThreaded - true - - - Level3 - - - NDEBUG;%(PreprocessorDefinitions) - 0x0c07 - - - ..\..\bin\Win32-VisualStudio\08.SpecialFx.exe - ..\..\lib\Win32-visualstudio;%(AdditionalLibraryDirectories) - Console - - - - - - - .\Release/SpecialFX.tlb - - - - - MaxSpeed - OnlyExplicitInline - ..\..\include;%(AdditionalIncludeDirectories) - WIN32;WIN64;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) - true - MultiThreaded - true - - - Level3 - - - NDEBUG;%(PreprocessorDefinitions) - 0x0c07 - - - ..\..\bin\Win64-VisualStudio\08.SpecialFx.exe - ..\..\lib\Win64-visualstudio;%(AdditionalLibraryDirectories) - Console - - - - - - - .\Debug/SpecialFX.tlb - - - - - Disabled - ..\..\include;%(AdditionalIncludeDirectories) - WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebug - - - Level3 - EditAndContinue - - - _DEBUG;%(PreprocessorDefinitions) - 0x0c07 - - - ..\..\bin\Win32-VisualStudio\08.SpecialFx.exe - ..\..\lib\Win32-visualstudio;%(AdditionalLibraryDirectories) - true - Console - - - - - - - .\Debug/SpecialFX.tlb - - - - - Disabled - ..\..\include;%(AdditionalIncludeDirectories) - WIN32;WIN64;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebug - - - Level3 - ProgramDatabase - - - _DEBUG;%(PreprocessorDefinitions) - 0x0c07 - - - ..\..\bin\Win64-VisualStudio\08.SpecialFx.exe - ..\..\lib\Win64-visualstudio;%(AdditionalLibraryDirectories) - true - Console - - - - - - - Disabled - Disabled - %(AdditionalIncludeDirectories) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(PreprocessorDefinitions) - EnableFastChecks - EnableFastChecks - MaxSpeed - MaxSpeed - %(AdditionalIncludeDirectories) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(PreprocessorDefinitions) - - - - - - \ No newline at end of file diff --git a/examples/08.SpecialFX/SpecialFX_vc12.vcxproj b/examples/08.SpecialFX/SpecialFX_vc12.vcxproj deleted file mode 100644 index 45f60640..00000000 --- a/examples/08.SpecialFX/SpecialFX_vc12.vcxproj +++ /dev/null @@ -1,235 +0,0 @@ - - - - - Debug - Win32 - - - Debug - x64 - - - Release - Win32 - - - Release - x64 - - - - 08.SpecialFX - {C869BF55-B9D6-4980-BC92-60FA0CF8411A} - SpecialFX - - - - Application - false - MultiByte - Windows7.1SDK - - - Application - false - MultiByte - Windows7.1SDK - - - Application - false - MultiByte - Windows7.1SDK - - - Application - false - MultiByte - Windows7.1SDK - - - - - - - - - - - - - - - - - - - - - - - <_ProjectFileVersion>10.0.30319.1 - ..\..\bin\Win32-VisualStudio\ - ..\..\bin\Win64-VisualStudio\ - - - ..\..\bin\Win32-VisualStudio\ - ..\..\bin\Win64-VisualStudio\ - - - AllRules.ruleset - AllRules.ruleset - - - - - AllRules.ruleset - AllRules.ruleset - - - - - - - - .\Release/SpecialFX.tlb - - - - - MaxSpeed - OnlyExplicitInline - ..\..\include;%(AdditionalIncludeDirectories) - WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) - true - MultiThreaded - true - - - Level3 - - - NDEBUG;%(PreprocessorDefinitions) - 0x0c07 - - - ..\..\bin\Win32-VisualStudio\08.SpecialFx.exe - ..\..\lib\Win32-visualstudio;%(AdditionalLibraryDirectories) - Console - - - - - - - .\Release/SpecialFX.tlb - - - - - MaxSpeed - OnlyExplicitInline - ..\..\include;%(AdditionalIncludeDirectories) - WIN32;WIN64;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) - true - MultiThreaded - true - - - Level3 - - - NDEBUG;%(PreprocessorDefinitions) - 0x0c07 - - - ..\..\bin\Win64-VisualStudio\08.SpecialFx.exe - ..\..\lib\Win64-visualstudio;%(AdditionalLibraryDirectories) - Console - - - - - - - .\Debug/SpecialFX.tlb - - - - - Disabled - ..\..\include;%(AdditionalIncludeDirectories) - WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebug - - - Level3 - EditAndContinue - - - _DEBUG;%(PreprocessorDefinitions) - 0x0c07 - - - ..\..\bin\Win32-VisualStudio\08.SpecialFx.exe - ..\..\lib\Win32-visualstudio;%(AdditionalLibraryDirectories) - true - Console - - - - - - - .\Debug/SpecialFX.tlb - - - - - Disabled - ..\..\include;%(AdditionalIncludeDirectories) - WIN32;WIN64;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebug - - - Level3 - ProgramDatabase - - - _DEBUG;%(PreprocessorDefinitions) - 0x0c07 - - - ..\..\bin\Win64-VisualStudio\08.SpecialFx.exe - ..\..\lib\Win64-visualstudio;%(AdditionalLibraryDirectories) - true - Console - - - - - - - Disabled - Disabled - %(AdditionalIncludeDirectories) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(PreprocessorDefinitions) - EnableFastChecks - EnableFastChecks - MaxSpeed - MaxSpeed - %(AdditionalIncludeDirectories) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(PreprocessorDefinitions) - - - - - - \ No newline at end of file diff --git a/examples/08.SpecialFX/SpecialFX_vc14.vcxproj b/examples/08.SpecialFX/SpecialFX_vc14.vcxproj deleted file mode 100644 index d91a31f6..00000000 --- a/examples/08.SpecialFX/SpecialFX_vc14.vcxproj +++ /dev/null @@ -1,235 +0,0 @@ - - - - - Debug - Win32 - - - Debug - x64 - - - Release - Win32 - - - Release - x64 - - - - 08.SpecialFX - {C869BF55-B9D6-4980-BC92-60FA0CF8411A} - SpecialFX - - - - Application - false - MultiByte - v140 - - - Application - false - MultiByte - v140 - - - Application - false - MultiByte - v140 - - - Application - false - MultiByte - v140 - - - - - - - - - - - - - - - - - - - - - - - <_ProjectFileVersion>10.0.30319.1 - ..\..\bin\Win32-VisualStudio\ - ..\..\bin\Win64-VisualStudio\ - - - ..\..\bin\Win32-VisualStudio\ - ..\..\bin\Win64-VisualStudio\ - - - AllRules.ruleset - AllRules.ruleset - - - - - AllRules.ruleset - AllRules.ruleset - - - - - - - - .\Release/SpecialFX.tlb - - - - - MaxSpeed - OnlyExplicitInline - ..\..\include;%(AdditionalIncludeDirectories) - WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) - true - MultiThreaded - true - - - Level3 - - - NDEBUG;%(PreprocessorDefinitions) - 0x0c07 - - - ..\..\bin\Win32-VisualStudio\08.SpecialFx.exe - ..\..\lib\Win32-visualstudio;%(AdditionalLibraryDirectories) - Console - - - - - - - .\Release/SpecialFX.tlb - - - - - MaxSpeed - OnlyExplicitInline - ..\..\include;%(AdditionalIncludeDirectories) - WIN32;WIN64;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) - true - MultiThreaded - true - - - Level3 - - - NDEBUG;%(PreprocessorDefinitions) - 0x0c07 - - - ..\..\bin\Win64-VisualStudio\08.SpecialFx.exe - ..\..\lib\Win64-visualstudio;%(AdditionalLibraryDirectories) - Console - - - - - - - .\Debug/SpecialFX.tlb - - - - - Disabled - ..\..\include;%(AdditionalIncludeDirectories) - WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebug - - - Level3 - EditAndContinue - - - _DEBUG;%(PreprocessorDefinitions) - 0x0c07 - - - ..\..\bin\Win32-VisualStudio\08.SpecialFx.exe - ..\..\lib\Win32-visualstudio;%(AdditionalLibraryDirectories) - true - Console - - - - - - - .\Debug/SpecialFX.tlb - - - - - Disabled - ..\..\include;%(AdditionalIncludeDirectories) - WIN32;WIN64;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebug - - - Level3 - ProgramDatabase - - - _DEBUG;%(PreprocessorDefinitions) - 0x0c07 - - - ..\..\bin\Win64-VisualStudio\08.SpecialFx.exe - ..\..\lib\Win64-visualstudio;%(AdditionalLibraryDirectories) - true - Console - - - - - - - Disabled - Disabled - %(AdditionalIncludeDirectories) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(PreprocessorDefinitions) - EnableFastChecks - EnableFastChecks - MaxSpeed - MaxSpeed - %(AdditionalIncludeDirectories) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(PreprocessorDefinitions) - - - - - - \ No newline at end of file diff --git a/examples/08.SpecialFX/main.cpp b/examples/08.SpecialFX/main.cpp deleted file mode 100644 index c72674b7..00000000 --- a/examples/08.SpecialFX/main.cpp +++ /dev/null @@ -1,326 +0,0 @@ -/** Example 008 SpecialFX - -This tutorial describes how to do special effects. It shows how to use stencil -buffer shadows, the particle system, billboards, dynamic light, and the water -surface scene node. - -We start like in some tutorials before. Please note that this time, the -'shadows' flag in createDevice() is set to true, for we want to have a dynamic -shadow cast from an animated character. If this example runs too slow, -set it to false. The Irrlicht Engine also checks if your hardware doesn't -support the stencil buffer, and then disables shadows by itself. -*/ - -#include -#include -#include "driverChoice.h" -#include "exampleHelper.h" - -using namespace irr; - -#ifdef _MSC_VER -#pragma comment(lib, "Irrlicht.lib") -#endif - -int main() -{ - // ask if user would like shadows - char i = 'y'; - printf("Please press 'y' if you want to use realtime shadows.\n"); - - std::cin >> i; - - const bool shadows = (i == 'y'); - - // ask user for driver - video::E_DRIVER_TYPE driverType=driverChoiceConsole(); - if (driverType==video::EDT_COUNT) - return 1; - - - /* - Create device and exit if creation failed. We make the stencil flag - optional to avoid slow screen modes for runs without shadows. - */ - - IrrlichtDevice *device = - createDevice(driverType, core::dimension2d(640, 480), - 16, false, shadows); - - if (device == 0) - return 1; // could not create selected driver. - - video::IVideoDriver* driver = device->getVideoDriver(); - scene::ISceneManager* smgr = device->getSceneManager(); - - const io::path mediaPath = getExampleMediaPath(); - - /* - For our environment, we load a .3ds file. It is a small room I modeled - with Anim8or and exported into the 3ds format because the Irrlicht - Engine does not support the .an8 format. I am a very bad 3d graphic - artist, and so the texture mapping is not very nice in this model. - Luckily I am a better programmer than artist, and so the Irrlicht - Engine is able to create a cool texture mapping for me: Just use the - mesh manipulator and create a planar texture mapping for the mesh. If - you want to see the mapping I made with Anim8or, uncomment this line. I - also did not figure out how to set the material right in Anim8or, it - has a specular light color which I don't really like. I'll switch it - off too with this code. - */ - - scene::IAnimatedMesh* mesh = smgr->getMesh(mediaPath + "room.3ds"); - - smgr->getMeshManipulator()->makePlanarTextureMapping(mesh->getMesh(0), 0.004f); - - scene::ISceneNode* node = 0; - - node = smgr->addAnimatedMeshSceneNode(mesh); - node->setMaterialTexture(0, driver->getTexture(mediaPath + "wall.jpg")); - node->getMaterial(0).SpecularColor.set(0,0,0,0); - - /* - Now, for the first special effect: Animated water. It works like this: - The WaterSurfaceSceneNode takes a mesh as input and makes it wave like - a water surface. And if we let this scene node use a nice material like - the EMT_REFLECTION_2_LAYER, it looks really cool. We are doing this - with the next few lines of code. As input mesh, we create a hill plane - mesh, without hills. But any other mesh could be used for this, you - could even use the room.3ds (which would look really strange) if you - want to. - */ - - mesh = smgr->addHillPlaneMesh( "myHill", - core::dimension2d(20,20), - core::dimension2d(40,40), 0, 0, - core::dimension2d(0,0), - core::dimension2d(10,10)); - - node = smgr->addWaterSurfaceSceneNode(mesh->getMesh(0), 3.0f, 300.0f, 30.0f); - node->setPosition(core::vector3df(0,7,0)); - - node->setMaterialTexture(0, driver->getTexture(mediaPath + "stones.jpg")); - node->setMaterialTexture(1, driver->getTexture(mediaPath + "water.jpg")); - - node->setMaterialType(video::EMT_REFLECTION_2_LAYER); - - /* - The second special effect is very basic, I bet you saw it already in - some Irrlicht Engine demos: A transparent billboard combined with a - dynamic light. We simply create a light scene node, let it fly around, - and to make it look more cool, we attach a billboard scene node to it. - */ - - // create light - scene::ILightSceneNode * lightNode = smgr->addLightSceneNode(0, core::vector3df(0,0,0), - video::SColorf(1.0f, 0.6f, 0.7f, 1.0f), 800.0f); - scene::ISceneNodeAnimator* anim = 0; - anim = smgr->createFlyCircleAnimator (core::vector3df(0,150,0),250.0f, 0.0005f); - lightNode ->addAnimator(anim); - anim->drop(); - - // attach billboard to light - - node = smgr->addBillboardSceneNode(lightNode, core::dimension2d(50, 50)); - node->setMaterialFlag(video::EMF_LIGHTING, false); - node->setMaterialType(video::EMT_TRANSPARENT_ADD_COLOR); - node->setMaterialTexture(0, driver->getTexture(mediaPath + "particlewhite.bmp")); - - /* - The next special effect is a lot more interesting: A particle system. - The particle system in the Irrlicht Engine is quite modular and - extensible, but yet easy to use. There is a particle system scene node - into which you can put a particle emitter, which makes particles come out - of nothing. These emitters are quite flexible and usually have lots of - parameters like direction, amount, and color of the particles they - create. - - There are different emitters, for example a point emitter which lets - particles pop out at a fixed point. If the particle emitters available - in the engine are not enough for you, you can easily create your own - ones, you'll simply have to create a class derived from the - IParticleEmitter interface and attach it to the particle system using - setEmitter(). In this example we create a box particle emitter, which - creates particles randomly inside a box. The parameters define the box, - direction of the particles, minimal and maximal new particles per - second, color, and minimal and maximal lifetime of the particles. - - Because only with emitters particle system would be a little bit - boring, there are particle affectors which modify particles while - they fly around. Affectors can be added to a particle system for - simulating additional effects like gravity or wind. - The particle affector we use in this example is an affector which - modifies the color of the particles: It lets them fade out. Like the - particle emitters, additional particle affectors can also be - implemented by you, simply derive a class from IParticleAffector and - add it with addAffector(). - - After we set a nice material to the particle system, we have a cool - looking camp fire. By adjusting material, texture, particle emitter, - and affector parameters, it is also easily possible to create smoke, - rain, explosions, snow, and so on. - */ - - // create a particle system - - scene::IParticleSystemSceneNode* ps = - smgr->addParticleSystemSceneNode(false); - - if (ps) - { - scene::IParticleEmitter* em = ps->createBoxEmitter( - core::aabbox3d(-7,0,-7,7,1,7), // emitter size - core::vector3df(0.0f,0.06f,0.0f), // initial direction - 80,100, // emit rate - video::SColor(0,255,255,255), // darkest color - video::SColor(0,255,255,255), // brightest color - 800,2000,0, // min and max age, angle - core::dimension2df(10.f,10.f), // min size - core::dimension2df(20.f,20.f)); // max size - - ps->setEmitter(em); // this grabs the emitter - em->drop(); // so we can drop it here without deleting it - - scene::IParticleAffector* paf = ps->createFadeOutParticleAffector(); - - ps->addAffector(paf); // same goes for the affector - paf->drop(); - - ps->setPosition(core::vector3df(-70,60,40)); - ps->setScale(core::vector3df(2,2,2)); - ps->setMaterialFlag(video::EMF_LIGHTING, false); - ps->setMaterialFlag(video::EMF_ZWRITE_ENABLE, false); - ps->setMaterialTexture(0, driver->getTexture(mediaPath + "fire.bmp")); - ps->setMaterialType(video::EMT_TRANSPARENT_ADD_COLOR); - } - - /* - Next we add a volumetric light node, which adds a glowing fake area light to - the scene. Like with the billboards and particle systems we also assign a - texture for the desired effect, though this time we'll use a texture animator - to create the illusion of a magical glowing area effect. - */ - scene::IVolumeLightSceneNode * n = smgr->addVolumeLightSceneNode(0, -1, - 32, // Subdivisions on U axis - 32, // Subdivisions on V axis - video::SColor(0, 255, 255, 255), // foot color - video::SColor(0, 0, 0, 0)); // tail color - - if (n) - { - n->setScale(core::vector3df(56.0f, 56.0f, 56.0f)); - n->setPosition(core::vector3df(-120,50,40)); - - // load textures for animation - core::array textures; - for (s32 g=7; g > 0; --g) - { - core::stringc tmp(mediaPath); - tmp += "portal"; - tmp += g; - tmp += ".bmp"; - video::ITexture* t = driver->getTexture( tmp.c_str() ); - textures.push_back(t); - } - - // create texture animator - scene::ISceneNodeAnimator* glow = smgr->createTextureAnimator(textures, 150); - - // add the animator - n->addAnimator(glow); - - // drop the animator because it was created with a create() function - glow->drop(); - } - - /* - As our last special effect, we want a dynamic shadow be cast from an - animated character. For this we load a DirectX .x model and place it - into our world. For creating the shadow, we simply need to call - addShadowVolumeSceneNode(). The color of shadows is only adjustable - globally for all shadows, by calling ISceneManager::setShadowColor(). - Voila, here is our dynamic shadow. - - Because the character is a little bit too small for this scene, we make - it bigger using setScale(). And because the character is lighted by a - dynamic light, we need to normalize the normals to make the lighting on - it correct. This is always necessary if the scale of a dynamic lighted - model is not (1,1,1). Otherwise it would get too dark or too bright - because the normals will be scaled too. - */ - - // add animated character - - mesh = smgr->getMesh(mediaPath + "dwarf.x"); - scene::IAnimatedMeshSceneNode* anode = 0; - - anode = smgr->addAnimatedMeshSceneNode(mesh); - anode->setPosition(core::vector3df(-50,20,-60)); - anode->setAnimationSpeed(15); - - /* - Shadows still have to be drawn even then the node causing them is not visible itself. - We have to disable culling if the node is animated or it's transformations change - as otherwise the shadow is not updated correctly. - If you have many objects and this becomes a speed problem you will have to figure - out some manual culling (for exampling hiding all objects beyond a certain distance). - */ - anode->setAutomaticCulling(scene::EAC_OFF); - - // add shadow - anode->addShadowVolumeSceneNode(); - smgr->setShadowColor(video::SColor(150,0,0,0)); - - // make the model a bit bigger - anode->setScale(core::vector3df(2,2,2)); - // because of the scaling we have to normalize its normals for correct lighting - anode->setMaterialFlag(video::EMF_NORMALIZE_NORMALS, true); - - // let the dwarf slowly rotate around it's y axis - scene::ISceneNodeAnimator* ra = smgr->createRotationAnimator(irr::core::vector3df(0, 0.1f, 0)); - anode->addAnimator(ra); - ra->drop(); - - /* - Finally we simply have to draw everything, that's all. - */ - - scene::ICameraSceneNode* camera = smgr->addCameraSceneNodeFPS(); - camera->setPosition(core::vector3df(-50,50,-150)); - camera->setFarValue(10000.0f); // this increase a shadow visible range. - - // disable mouse cursor - device->getCursorControl()->setVisible(false); - - s32 lastFPS = -1; - - while(device->run()) - if (device->isWindowActive()) - { - driver->beginScene(video::ECBF_COLOR | video::ECBF_DEPTH, video::SColor(0)); - - smgr->drawAll(); - - driver->endScene(); - - const s32 fps = driver->getFPS(); - - if (lastFPS != fps) - { - core::stringw str = L"Irrlicht Engine - SpecialFX example ["; - str += driver->getName(); - str += "] FPS:"; - str += fps; - - device->setWindowCaption(str.c_str()); - lastFPS = fps; - } - } - - device->drop(); - - return 0; -} - -/* -**/ diff --git a/examples/08.SpecialFX/project.properties b/examples/08.SpecialFX/project.properties deleted file mode 100644 index 6f9611b1..00000000 --- a/examples/08.SpecialFX/project.properties +++ /dev/null @@ -1,14 +0,0 @@ -# This file is automatically generated by Android Tools. -# Do not modify this file -- YOUR CHANGES WILL BE ERASED! -# -# This file must be checked in Version Control Systems. -# -# To customize properties used by the Ant build system edit -# "ant.properties", and override values to adapt the script to your -# project structure. -# -# To enable ProGuard to shrink and obfuscate your code, uncomment this (available properties: sdk.dir, user.home): -#proguard.config=${sdk.dir}\tools\proguard\proguard-android.txt:proguard-project.txt - -# Project target. -target=android-10 diff --git a/examples/08.SpecialFX/tutorial.html b/examples/08.SpecialFX/tutorial.html deleted file mode 100644 index 8c1fc51a..00000000 --- a/examples/08.SpecialFX/tutorial.html +++ /dev/null @@ -1,278 +0,0 @@ - - -Irrlicht Engine Tutorial - - - - -
- - - - - - - - -
-
-
Tutorial 8. Special Effects
-
-
-
-

This tutorials describes how to do special effects. It shows how to - use stencil buffer shadows, the particle system, billboards, dynamic - light and the water surface scene node.

-

The program which is described here will look like this:

-


-

-
-
-
- - - - - - - -
Lets start!
-
-

We start like in some tutorials before. Please note that this time, - the 'shadows' flag in createDevice() is set to true, for we want to - have a dynamic shadow casted from an animated character. If your this - example runs to slow, set it to false. The Irrlicht Engine checks - if your hardware doesn't support the stencil buffer, and disables - shadows by itself, but just in case the demo runs slow on your hardware.

- - - - -
#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), 16, false, true); - - if (device == 0) - return 1; - - video::IVideoDriver* driver = device->getVideoDriver(); - scene::ISceneManager* smgr = device->getSceneManager(); -
-
-

For our environment, we load a .3ds file. It is a small room I modelled - with Anim8or and exported it into the 3ds format because the Irrlicht - Engine did not support the .an8 format when I wrote this tutorial. - I am a very bad 3d graphic artist, and so the texture mapping is not - very nice in this model. Luckily I am a better programmer than artist, - and so the Irrlicht Engine is able to create a cool texture mapping - for me: Just use the mesh manipulator and create a planar texture - mapping for the mesh. If you want to see the mapping I made with Anim8or, - uncomment this line. I also did not figure out how to
- set the material right in Anim8or, it has a specular light color - which I don't really
- like. I'll switch it off too with this code.

- - - - -
	scene::IAnimatedMesh* mesh = smgr->getMesh(
-		"../../media/room.3ds");
-
-	smgr->getMeshManipulator()->makePlanarTextureMapping(
-		mesh->getMesh(0), 0.008f);
-
-	scene::ISceneNode* node = 0;
-
-	node = smgr->addAnimatedMeshSceneNode(mesh);
-	node->setMaterialTexture(0,	driver->getTexture("../../media/wall.jpg"));
-	node->getMaterial(0).SpecularColor.set(0,0,0,0);
-

Now, for the first special effect: Animated water. It works like - this: The WaterSurfaceSceneNode takes a mesh as input and makes it - wave like a water surface. And if we let this scene node use a nice - material like the MT_REFLECTION_2_LAYER, it looks really cool. We - are doing this with the next few lines of code. As input mesh, we - create a hill plane mesh, without hills. But any other mesh could - be used for this, you could even use the room.3ds (which would look - really strange) if you wanted to.

- - - - -
	mesh = smgr->addHillPlaneMesh("myHill",
-		core::dimension2d<f32>(20,20),
-		core::dimension2d<s32>(40,40), 0, 0,
-		core::dimension2d<f32>(0,0),
-		core::dimension2d<f32>(10,10));
-
-	node = smgr->addWaterSurfaceSceneNode(mesh->getMesh(0), 3.0f, 300.0f, 30.0f);
-	node->setPosition(core::vector3df(0,7,0));
-
-	node->setMaterialTexture(0,	driver->getTexture("../../media/stones.jpg"));
-	node->setMaterialTexture(1,	driver->getTexture("../../media/water.jpg"));
-
-	node->setMaterialType(video::EMT_REFLECTION_2_LAYER);
-
-

The second special effect is very basic, I bet you saw it already - in some Irrlicht Engine demos: A transparent billboard combined with - a dynamic light. We simply create a light scene node, let it fly around, - an to make it look more cool, we attach a billboard scene node to - it.

- - - - -
	// create light
-
-	node = smgr->addLightSceneNode(0, core::vector3df(0,0,0), 
-		video::SColorf(1.0f, 0.6f, 0.7f, 1.0f), 600.0f);
-	scene::ISceneNodeAnimator* anim = 0;
-	anim = smgr->createFlyCircleAnimator (core::vector3df(0,150,0),250.0f);
-	node->addAnimator(anim);
-	anim->drop();
-
-	// attach billboard to light
-
-	node = smgr->addBillboardSceneNode(node, core::dimension2d<f32>(50, 50));
-	node->setMaterialFlag(video::EMF_LIGHTING, false);
-	node->setMaterialType(video::EMT_TRANSPARENT_ADD_COLOR);
-	node->setMaterialTexture(0,	driver->getTexture("../../media/particlewhite.bmp"));
-
-
-

The next special effect is a lot more interesting: A particle system. - The particle system in the Irrlicht Engine is quit modular and extensible - and yet easy to use. There is a particle system scene node into which - you can put particle emitters, which make particles come out of nothing. - These emitters are quite flexible and usually have lots of parameters - like direction, amount and color of the particles they should create.
- There are different emitters, for example a point emitter which lets - particles pop out at a fixed point. If the particle emitters available - in the engine are not enough for you, you can easily create your own - ones, you'll simply have to create a class derived from the IParticleEmitter - interface and attach it to the particle system using setEmitter().
- In this example we create a box particle emitter, which creates particles - randomly inside a box. The parameters define the box, direction of - the particles, minimal and maximal new particles per second, color - and minimal and maximal livetime of the particles.

-

Because only with emitters particle system would be a little bit - boring, there are particle affectors, which modify particles during - they fly around. They can be added to the particle system, simulating - additional effects like gravity or wind. The particle affector we - use in this example is an affector, which modifies the color of the - particles: It lets them fade out. Like the particle emitters, additional - particle affectors can also be implemented by you, simply derive a - class from IParticleAffector and add it with addAffector(). After - we set a nice material to the particle system, we have a cool looking - camp fire. By adjusting material, texture, particle emitter and affector - parameters, it is also easily possible to create smoke, rain, explosions, - snow, and so on.
-

-
- - - - -
	scene::IParticleSystemSceneNode* ps = 0;
-	ps = smgr->addParticleSystemSceneNode(false);
-	ps->setPosition(core::vector3df(-70,60,40));
-	ps->setScale(core::vector3df(2,2,2));
-
-	ps->setParticleSize(core::dimension2d<f32>(20.0f, 10.0f));
-
-	scene::IParticleEmitter* em = ps->createBoxEmitter(
-		core::aabbox3d<f32>(-7,0,-7,7,1,7), 
-		core::vector3df(0.0f,0.03f,0.0f),
-		80,100, 
-		video::SColor(0,255,255,255), video::SColor(0,255,255,255),
-		800,2000);
-
-	ps->setEmitter(em);
-	em->drop();
-
-	scene::IParticleAffector* paf = 
-		ps->createFadeOutParticleAffector();
-
-	ps->addAffector(paf);
-	paf->drop();
-
-	ps->setMaterialFlag(video::EMF_LIGHTING, false);
-	ps->setMaterialTexture(0, driver->getTexture("../../media/particle.bmp"));
-	ps->setMaterialType(video::EMT_TRANSPARENT_VERTEX_ALPHA);
-

As our last special effect, we want a dynamic shadow be casted from - an animated character. For this we load a DirectX .x model and place - it into our world. For creating the shadow, we simply need to call addShadowVolumeSceneNode(). - The color of shadows is only adjustable globally for all shadows, by - calling ISceneManager::setShadowColor(). Voila, here is our dynamic - shadow.
- Because the character is a little bit too small for this scene, we make - it bigger using setScale(). And because the character is lighted by - a dynamic light, we need to normalize the normals to make the lighting - on it correct. This is always necessary if the scale of a dynamic lighted - model is not (1,1,1). Otherwise it would get too dark or too bright - because the normals will be scaled too.

- - - - -
	mesh = smgr->getMesh("../../media/dwarf.x");
-	scene::IAnimatedMeshSceneNode* anode = 0;
-
-	anode = smgr->addAnimatedMeshSceneNode(mesh);
-	anode->setPosition(core::vector3df(-50,20,-60));
-	anode->setAnimationSpeed(15);
-
-	// add shadow
-	anode->addShadowVolumeSceneNode();	
-	smgr->setShadowColor(video::SColor(220,0,0,0));
-
-	// make the model a little bit bigger and normalize its normals 
// because of this for correct lighting

anode->setScale(core::vector3df(2,2,2));
anode->setMaterialFlag(video::EMF_NORMALIZE_NORMALS, true);

-

Finally we simply have to draw everything, that's all.

- - - - -
	scene::ICameraSceneNode* camera = smgr->addCameraSceneNodeFPS();
-	camera->setPosition(core::vector3df(-50,50,-150));
-
-
-	int lastFPS = -1;
-
-	while(device->run())
-	{
-		driver->beginScene(true, true, 0);
-
-		smgr->drawAll();
-
-		driver->endScene();
-
-		int fps = driver->getFPS();
-
-		if (lastFPS != fps)
-		{
-		  core::stringw str = L"Irrlicht Engine - SpecialFX example [";
str += driver->getName();
str += "] FPS:";
str += fps;

device->setWindowCaption(str.c_str());
lastFPS = fps;
} - } - - device->drop(); - - return 0; -} - -
-
-

 

-

 

-

 

-
-
-

 

- - diff --git a/examples/09.Meshviewer/9.Meshviewer.rc b/examples/09.Meshviewer/9.Meshviewer.rc deleted file mode 100644 index 32085837..00000000 --- a/examples/09.Meshviewer/9.Meshviewer.rc +++ /dev/null @@ -1,84 +0,0 @@ -// Microsoft Visual C++ generated resource script. -// -#include "resource.h" - -#define APSTUDIO_READONLY_SYMBOLS -///////////////////////////////////////////////////////////////////////////// -// -// Generated from the TEXTINCLUDE 2 resource. -// -#include "afxres.h" - -///////////////////////////////////////////////////////////////////////////// -#undef APSTUDIO_READONLY_SYMBOLS - -///////////////////////////////////////////////////////////////////////////// -// English (U.S.) resources - -#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) -#ifdef _WIN32 -LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US -#pragma code_page(1252) -#endif //_WIN32 - -#ifdef APSTUDIO_INVOKED -///////////////////////////////////////////////////////////////////////////// -// -// TEXTINCLUDE -// - -1 TEXTINCLUDE -BEGIN - "resource.h\0" -END - -2 TEXTINCLUDE -BEGIN - "#include ""afxres.h""\r\n" - "\0" -END - -3 TEXTINCLUDE -BEGIN - "\r\n" - "\0" -END - -#endif // APSTUDIO_INVOKED - -#endif // English (U.S.) resources -///////////////////////////////////////////////////////////////////////////// - - -///////////////////////////////////////////////////////////////////////////// -// German (Austria) resources - -#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_DEA) -#ifdef _WIN32 -LANGUAGE LANG_GERMAN, SUBLANG_GERMAN_AUSTRIAN -#pragma code_page(1252) -#endif //_WIN32 - -///////////////////////////////////////////////////////////////////////////// -// -// Icon -// - -// Icon with lowest ID value placed first to ensure application icon -// remains consistent on all systems. -IDI_ICON1 ICON "icon.ico" -#endif // German (Austria) resources -///////////////////////////////////////////////////////////////////////////// - - - -#ifndef APSTUDIO_INVOKED -///////////////////////////////////////////////////////////////////////////// -// -// Generated from the TEXTINCLUDE 3 resource. -// - - -///////////////////////////////////////////////////////////////////////////// -#endif // not APSTUDIO_INVOKED - diff --git a/examples/09.Meshviewer/Makefile b/examples/09.Meshviewer/Makefile deleted file mode 100644 index e90ab524..00000000 --- a/examples/09.Meshviewer/Makefile +++ /dev/null @@ -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 := 09.Meshviewer -# 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 diff --git a/examples/09.Meshviewer/Meshviewer.cbp b/examples/09.Meshviewer/Meshviewer.cbp deleted file mode 100644 index be11327b..00000000 --- a/examples/09.Meshviewer/Meshviewer.cbp +++ /dev/null @@ -1,55 +0,0 @@ - - - - - - diff --git a/examples/09.Meshviewer/Meshviewer.vcproj b/examples/09.Meshviewer/Meshviewer.vcproj deleted file mode 100644 index 4077b860..00000000 --- a/examples/09.Meshviewer/Meshviewer.vcproj +++ /dev/null @@ -1,163 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/examples/09.Meshviewer/Meshviewer.xcodeproj/project.pbxproj b/examples/09.Meshviewer/Meshviewer.xcodeproj/project.pbxproj deleted file mode 100644 index e9137d14..00000000 --- a/examples/09.Meshviewer/Meshviewer.xcodeproj/project.pbxproj +++ /dev/null @@ -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 /* 09.Meshviewer.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = 09.Meshviewer.app; sourceTree = BUILT_PRODUCTS_DIR; }; - 5E34CC741B7F8EEF00F212E8 /* main.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = main.cpp; sourceTree = ""; }; - 5E34CC781B7F90A000F212E8 /* libIrrlicht.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libIrrlicht.a; path = ../../lib/OSX/libIrrlicht.a; sourceTree = ""; }; - 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 = ""; }; -/* 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 = ""; - }; - 5E34CC521B7F8E6E00F212E8 /* Products */ = { - isa = PBXGroup; - children = ( - 5E34CC511B7F8E6E00F212E8 /* 09.Meshviewer.app */, - ); - name = Products; - sourceTree = ""; - }; - 5E34CC761B7F905600F212E8 /* Libraries */ = { - isa = PBXGroup; - children = ( - 5E8570B01B7F99F500B267D2 /* Cocoa.framework */, - 5E8570B41B7F9A0700B267D2 /* IOKit.framework */, - 5E8570B21B7F99FE00B267D2 /* OpenGL.framework */, - 5E34CC781B7F90A000F212E8 /* libIrrlicht.a */, - ); - name = Libraries; - sourceTree = ""; - }; - 5E34CC771B7F906D00F212E8 /* Resources */ = { - isa = PBXGroup; - children = ( - 5E8570BE1B7F9D3A00B267D2 /* media */, - ); - name = Resources; - sourceTree = ""; - }; -/* End PBXGroup section */ - -/* Begin PBXNativeTarget section */ - 5E34CC501B7F8E6E00F212E8 /* 09.Meshviewer */ = { - isa = PBXNativeTarget; - buildConfigurationList = 5E34CC701B7F8E6E00F212E8 /* Build configuration list for PBXNativeTarget "09.Meshviewer" */; - buildPhases = ( - 5E34CC4D1B7F8E6E00F212E8 /* Sources */, - 5E34CC4E1B7F8E6E00F212E8 /* Frameworks */, - 5E34CC4F1B7F8E6E00F212E8 /* Resources */, - ); - buildRules = ( - ); - dependencies = ( - ); - name = 09.Meshviewer; - productName = 01.HelloWorld; - productReference = 5E34CC511B7F8E6E00F212E8 /* 09.Meshviewer.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 "Meshviewer" */; - compatibilityVersion = "Xcode 3.2"; - developmentRegion = English; - hasScannedForEncodings = 0; - knownRegions = ( - en, - Base, - ); - mainGroup = 5E34C6D81B7F4A0C00F212E8; - productRefGroup = 5E34CC521B7F8E6E00F212E8 /* Products */; - projectDirPath = ""; - projectRoot = ""; - targets = ( - 5E34CC501B7F8E6E00F212E8 /* 09.Meshviewer */, - ); - }; -/* 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 "Meshviewer" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 5E34C6DD1B7F4A0C00F212E8 /* Debug */, - 5E34C6DE1B7F4A0C00F212E8 /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - 5E34CC701B7F8E6E00F212E8 /* Build configuration list for PBXNativeTarget "09.Meshviewer" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 5E34CC6C1B7F8E6E00F212E8 /* Debug */, - 5E34CC6D1B7F8E6E00F212E8 /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; -/* End XCConfigurationList section */ - }; - rootObject = 5E34C6D91B7F4A0C00F212E8 /* Project object */; -} diff --git a/examples/09.Meshviewer/Meshviewer.xcodeproj/xcshareddata/xcschemes/09.Meshviewer.xcscheme b/examples/09.Meshviewer/Meshviewer.xcodeproj/xcshareddata/xcschemes/09.Meshviewer.xcscheme deleted file mode 100644 index 0625d5ee..00000000 --- a/examples/09.Meshviewer/Meshviewer.xcodeproj/xcshareddata/xcschemes/09.Meshviewer.xcscheme +++ /dev/null @@ -1,91 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/examples/09.Meshviewer/Meshviewer_vc10.vcxproj b/examples/09.Meshviewer/Meshviewer_vc10.vcxproj deleted file mode 100644 index eb918ccd..00000000 --- a/examples/09.Meshviewer/Meshviewer_vc10.vcxproj +++ /dev/null @@ -1,235 +0,0 @@ - - - - - Debug - Win32 - - - Debug - x64 - - - Release - Win32 - - - Release - x64 - - - - 09.Meshviewer - {2AE24484-22FC-481B-9A40-7CD0DA5C8E06} - Meshviewer - - - - Application - false - MultiByte - Windows7.1SDK - - - Application - false - MultiByte - Windows7.1SDK - - - Application - false - MultiByte - Windows7.1SDK - - - Application - false - MultiByte - Windows7.1SDK - - - - - - - - - - - - - - - - - - - - - - - <_ProjectFileVersion>10.0.30319.1 - ..\..\bin\Win32-VisualStudio\ - ..\..\bin\Win64-VisualStudio\ - - - ..\..\bin\Win32-VisualStudio\ - ..\..\bin\Win64-VisualStudio\ - - - AllRules.ruleset - AllRules.ruleset - - - - - AllRules.ruleset - AllRules.ruleset - - - - - - - - .\Release/Meshviewer.tlb - - - - - MaxSpeed - OnlyExplicitInline - ..\..\include;%(AdditionalIncludeDirectories) - WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) - true - MultiThreaded - true - - - Level3 - - - NDEBUG;%(PreprocessorDefinitions) - 0x0c07 - - - ..\..\bin\Win32-VisualStudio\09.MeshViewer.exe - ..\..\lib\Win32-visualstudio;%(AdditionalLibraryDirectories) - Console - - - - - - - .\Release/Meshviewer.tlb - - - - - MaxSpeed - OnlyExplicitInline - ..\..\include;%(AdditionalIncludeDirectories) - WIN32;WIN64;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) - true - MultiThreaded - true - - - Level3 - - - NDEBUG;%(PreprocessorDefinitions) - 0x0c07 - - - ..\..\bin\Win64-VisualStudio\09.MeshViewer.exe - ..\..\lib\Win64-visualstudio;%(AdditionalLibraryDirectories) - Console - - - - - - - .\Debug/Meshviewer.tlb - - - - - Disabled - ..\..\include;%(AdditionalIncludeDirectories) - WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebug - - - Level3 - EditAndContinue - - - _DEBUG;%(PreprocessorDefinitions) - 0x0c07 - - - ..\..\bin\Win32-VisualStudio\09.MeshViewer.exe - ..\..\lib\Win32-visualstudio;%(AdditionalLibraryDirectories) - true - Console - - - - - - - .\Debug/Meshviewer.tlb - - - - - Disabled - ..\..\include;%(AdditionalIncludeDirectories) - WIN32;WIN64;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebug - - - Level3 - ProgramDatabase - - - _DEBUG;%(PreprocessorDefinitions) - 0x0c07 - - - ..\..\bin\Win64-VisualStudio\09.MeshViewer.exe - ..\..\lib\Win64-visualstudio;%(AdditionalLibraryDirectories) - true - Console - - - - - - - Disabled - Disabled - %(AdditionalIncludeDirectories) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(PreprocessorDefinitions) - EnableFastChecks - EnableFastChecks - MaxSpeed - MaxSpeed - %(AdditionalIncludeDirectories) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(PreprocessorDefinitions) - - - - - - \ No newline at end of file diff --git a/examples/09.Meshviewer/Meshviewer_vc11.vcxproj b/examples/09.Meshviewer/Meshviewer_vc11.vcxproj deleted file mode 100644 index eb918ccd..00000000 --- a/examples/09.Meshviewer/Meshviewer_vc11.vcxproj +++ /dev/null @@ -1,235 +0,0 @@ - - - - - Debug - Win32 - - - Debug - x64 - - - Release - Win32 - - - Release - x64 - - - - 09.Meshviewer - {2AE24484-22FC-481B-9A40-7CD0DA5C8E06} - Meshviewer - - - - Application - false - MultiByte - Windows7.1SDK - - - Application - false - MultiByte - Windows7.1SDK - - - Application - false - MultiByte - Windows7.1SDK - - - Application - false - MultiByte - Windows7.1SDK - - - - - - - - - - - - - - - - - - - - - - - <_ProjectFileVersion>10.0.30319.1 - ..\..\bin\Win32-VisualStudio\ - ..\..\bin\Win64-VisualStudio\ - - - ..\..\bin\Win32-VisualStudio\ - ..\..\bin\Win64-VisualStudio\ - - - AllRules.ruleset - AllRules.ruleset - - - - - AllRules.ruleset - AllRules.ruleset - - - - - - - - .\Release/Meshviewer.tlb - - - - - MaxSpeed - OnlyExplicitInline - ..\..\include;%(AdditionalIncludeDirectories) - WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) - true - MultiThreaded - true - - - Level3 - - - NDEBUG;%(PreprocessorDefinitions) - 0x0c07 - - - ..\..\bin\Win32-VisualStudio\09.MeshViewer.exe - ..\..\lib\Win32-visualstudio;%(AdditionalLibraryDirectories) - Console - - - - - - - .\Release/Meshviewer.tlb - - - - - MaxSpeed - OnlyExplicitInline - ..\..\include;%(AdditionalIncludeDirectories) - WIN32;WIN64;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) - true - MultiThreaded - true - - - Level3 - - - NDEBUG;%(PreprocessorDefinitions) - 0x0c07 - - - ..\..\bin\Win64-VisualStudio\09.MeshViewer.exe - ..\..\lib\Win64-visualstudio;%(AdditionalLibraryDirectories) - Console - - - - - - - .\Debug/Meshviewer.tlb - - - - - Disabled - ..\..\include;%(AdditionalIncludeDirectories) - WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebug - - - Level3 - EditAndContinue - - - _DEBUG;%(PreprocessorDefinitions) - 0x0c07 - - - ..\..\bin\Win32-VisualStudio\09.MeshViewer.exe - ..\..\lib\Win32-visualstudio;%(AdditionalLibraryDirectories) - true - Console - - - - - - - .\Debug/Meshviewer.tlb - - - - - Disabled - ..\..\include;%(AdditionalIncludeDirectories) - WIN32;WIN64;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebug - - - Level3 - ProgramDatabase - - - _DEBUG;%(PreprocessorDefinitions) - 0x0c07 - - - ..\..\bin\Win64-VisualStudio\09.MeshViewer.exe - ..\..\lib\Win64-visualstudio;%(AdditionalLibraryDirectories) - true - Console - - - - - - - Disabled - Disabled - %(AdditionalIncludeDirectories) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(PreprocessorDefinitions) - EnableFastChecks - EnableFastChecks - MaxSpeed - MaxSpeed - %(AdditionalIncludeDirectories) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(PreprocessorDefinitions) - - - - - - \ No newline at end of file diff --git a/examples/09.Meshviewer/Meshviewer_vc12.vcxproj b/examples/09.Meshviewer/Meshviewer_vc12.vcxproj deleted file mode 100644 index effddf22..00000000 --- a/examples/09.Meshviewer/Meshviewer_vc12.vcxproj +++ /dev/null @@ -1,235 +0,0 @@ - - - - - Debug - Win32 - - - Debug - x64 - - - Release - Win32 - - - Release - x64 - - - - 09.Meshviewer - {2AE24484-22FC-481B-9A40-7CD0DA5C8E06} - Meshviewer - - - - Application - false - MultiByte - Windows7.1SDK - - - Application - false - MultiByte - Windows7.1SDK - - - Application - false - MultiByte - Windows7.1SDK - - - Application - false - MultiByte - Windows7.1SDK - - - - - - - - - - - - - - - - - - - - - - - <_ProjectFileVersion>10.0.30319.1 - ..\..\bin\Win32-VisualStudio\ - ..\..\bin\Win64-VisualStudio\ - - - ..\..\bin\Win32-VisualStudio\ - ..\..\bin\Win64-VisualStudio\ - - - AllRules.ruleset - AllRules.ruleset - - - - - AllRules.ruleset - AllRules.ruleset - - - - - - - - .\Release/Meshviewer.tlb - - - - - MaxSpeed - OnlyExplicitInline - ..\..\include;%(AdditionalIncludeDirectories) - WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) - true - MultiThreaded - true - - - Level3 - - - NDEBUG;%(PreprocessorDefinitions) - 0x0c07 - - - ..\..\bin\Win32-VisualStudio\09.MeshViewer.exe - ..\..\lib\Win32-visualstudio;%(AdditionalLibraryDirectories) - Console - - - - - - - .\Release/Meshviewer.tlb - - - - - MaxSpeed - OnlyExplicitInline - ..\..\include;%(AdditionalIncludeDirectories) - WIN32;WIN64;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) - true - MultiThreaded - true - - - Level3 - - - NDEBUG;%(PreprocessorDefinitions) - 0x0c07 - - - ..\..\bin\Win64-VisualStudio\09.MeshViewer.exe - ..\..\lib\Win64-visualstudio;%(AdditionalLibraryDirectories) - Console - - - - - - - .\Debug/Meshviewer.tlb - - - - - Disabled - ..\..\include;%(AdditionalIncludeDirectories) - WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebug - - - Level3 - EditAndContinue - - - _DEBUG;%(PreprocessorDefinitions) - 0x0c07 - - - ..\..\bin\Win32-VisualStudio\09.MeshViewer.exe - ..\..\lib\Win32-visualstudio;%(AdditionalLibraryDirectories) - true - Console - - - - - - - .\Debug/Meshviewer.tlb - - - - - Disabled - ..\..\include;%(AdditionalIncludeDirectories) - WIN32;WIN64;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebug - - - Level3 - ProgramDatabase - - - _DEBUG;%(PreprocessorDefinitions) - 0x0c07 - - - ..\..\bin\Win64-VisualStudio\09.MeshViewer.exe - ..\..\lib\Win64-visualstudio;%(AdditionalLibraryDirectories) - true - Console - - - - - - - Disabled - Disabled - %(AdditionalIncludeDirectories) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(PreprocessorDefinitions) - EnableFastChecks - EnableFastChecks - MaxSpeed - MaxSpeed - %(AdditionalIncludeDirectories) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(PreprocessorDefinitions) - - - - - - \ No newline at end of file diff --git a/examples/09.Meshviewer/Meshviewer_vc14.vcxproj b/examples/09.Meshviewer/Meshviewer_vc14.vcxproj deleted file mode 100644 index f96053dd..00000000 --- a/examples/09.Meshviewer/Meshviewer_vc14.vcxproj +++ /dev/null @@ -1,235 +0,0 @@ - - - - - Debug - Win32 - - - Debug - x64 - - - Release - Win32 - - - Release - x64 - - - - 09.Meshviewer - {2AE24484-22FC-481B-9A40-7CD0DA5C8E06} - Meshviewer - - - - Application - false - MultiByte - v140 - - - Application - false - MultiByte - v140 - - - Application - false - MultiByte - v140 - - - Application - false - MultiByte - v140 - - - - - - - - - - - - - - - - - - - - - - - <_ProjectFileVersion>10.0.30319.1 - ..\..\bin\Win32-VisualStudio\ - ..\..\bin\Win64-VisualStudio\ - - - ..\..\bin\Win32-VisualStudio\ - ..\..\bin\Win64-VisualStudio\ - - - AllRules.ruleset - AllRules.ruleset - - - - - AllRules.ruleset - AllRules.ruleset - - - - - - - - .\Release/Meshviewer.tlb - - - - - MaxSpeed - OnlyExplicitInline - ..\..\include;%(AdditionalIncludeDirectories) - WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) - true - MultiThreaded - true - - - Level3 - - - NDEBUG;%(PreprocessorDefinitions) - 0x0c07 - - - ..\..\bin\Win32-VisualStudio\09.MeshViewer.exe - ..\..\lib\Win32-visualstudio;%(AdditionalLibraryDirectories) - Console - - - - - - - .\Release/Meshviewer.tlb - - - - - MaxSpeed - OnlyExplicitInline - ..\..\include;%(AdditionalIncludeDirectories) - WIN32;WIN64;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) - true - MultiThreaded - true - - - Level3 - - - NDEBUG;%(PreprocessorDefinitions) - 0x0c07 - - - ..\..\bin\Win64-VisualStudio\09.MeshViewer.exe - ..\..\lib\Win64-visualstudio;%(AdditionalLibraryDirectories) - Console - - - - - - - .\Debug/Meshviewer.tlb - - - - - Disabled - ..\..\include;%(AdditionalIncludeDirectories) - WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebug - - - Level3 - EditAndContinue - - - _DEBUG;%(PreprocessorDefinitions) - 0x0c07 - - - ..\..\bin\Win32-VisualStudio\09.MeshViewer.exe - ..\..\lib\Win32-visualstudio;%(AdditionalLibraryDirectories) - true - Console - - - - - - - .\Debug/Meshviewer.tlb - - - - - Disabled - ..\..\include;%(AdditionalIncludeDirectories) - WIN32;WIN64;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebug - - - Level3 - ProgramDatabase - - - _DEBUG;%(PreprocessorDefinitions) - 0x0c07 - - - ..\..\bin\Win64-VisualStudio\09.MeshViewer.exe - ..\..\lib\Win64-visualstudio;%(AdditionalLibraryDirectories) - true - Console - - - - - - - Disabled - Disabled - %(AdditionalIncludeDirectories) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(PreprocessorDefinitions) - EnableFastChecks - EnableFastChecks - MaxSpeed - MaxSpeed - %(AdditionalIncludeDirectories) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(PreprocessorDefinitions) - - - - - - \ No newline at end of file diff --git a/examples/09.Meshviewer/icon.ico b/examples/09.Meshviewer/icon.ico deleted file mode 100644 index 49f8eabb..00000000 Binary files a/examples/09.Meshviewer/icon.ico and /dev/null differ diff --git a/examples/09.Meshviewer/main.cpp b/examples/09.Meshviewer/main.cpp deleted file mode 100644 index 024c7faf..00000000 --- a/examples/09.Meshviewer/main.cpp +++ /dev/null @@ -1,994 +0,0 @@ -/** Example 009 Mesh Viewer - -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 -scene management of Irrlicht. The tutorial show how to create and use Buttons, -Windows, Toolbars, Menus, ComboBoxes, Tabcontrols, Editboxes, Images, -MessageBoxes, SkyBoxes. - -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 -Studio, and declare some global variables. We also add two 'using namespace' -statements, so we do not need to write the whole names of all classes. In this -tutorial, we use a lot of stuff from the gui namespace. -*/ -#include -#include "driverChoice.h" -#include "exampleHelper.h" - -using namespace irr; -using namespace gui; - -#ifdef _MSC_VER -#pragma comment(lib, "Irrlicht.lib") -#endif - - -/* -Some global variables used later on -*/ -IrrlichtDevice *Device = 0; -io::path StartUpModelFile; -core::stringw MessageText; -core::stringw Caption; -scene::ISceneNode* Model = 0; -scene::ISceneNode* SkyBox = 0; -bool Octree=false; -bool UseLight=false; - -scene::ICameraSceneNode* Camera[2] = {0, 0}; - -// Values used to identify individual GUI elements -enum -{ - GUI_ID_DIALOG_ROOT_WINDOW = 0x10000, - - GUI_ID_X_SCALE, - GUI_ID_Y_SCALE, - GUI_ID_Z_SCALE, - - GUI_ID_OPEN_MODEL, - GUI_ID_SET_MODEL_ARCHIVE, - GUI_ID_LOAD_AS_OCTREE, - - GUI_ID_SKY_BOX_VISIBLE, - GUI_ID_TOGGLE_DEBUG_INFO, - - GUI_ID_DEBUG_OFF, - GUI_ID_DEBUG_BOUNDING_BOX, - GUI_ID_DEBUG_NORMALS, - GUI_ID_DEBUG_SKELETON, - GUI_ID_DEBUG_WIRE_OVERLAY, - GUI_ID_DEBUG_HALF_TRANSPARENT, - GUI_ID_DEBUG_BUFFERS_BOUNDING_BOXES, - GUI_ID_DEBUG_ALL, - - GUI_ID_MODEL_MATERIAL_SOLID, - GUI_ID_MODEL_MATERIAL_TRANSPARENT, - GUI_ID_MODEL_MATERIAL_REFLECTION, - - GUI_ID_CAMERA_MAYA, - GUI_ID_CAMERA_FIRST_PERSON, - - GUI_ID_POSITION_TEXT, - - GUI_ID_ABOUT, - GUI_ID_QUIT, - - GUI_ID_TEXTUREFILTER, - GUI_ID_SKIN_TRANSPARENCY, - GUI_ID_SKIN_ANIMATION_FPS, - - GUI_ID_BUTTON_SET_SCALE, - GUI_ID_BUTTON_SCALE_MUL10, - GUI_ID_BUTTON_SCALE_DIV10, - GUI_ID_BUTTON_OPEN_MODEL, - GUI_ID_BUTTON_SHOW_ABOUT, - GUI_ID_BUTTON_SHOW_TOOLBOX, - GUI_ID_BUTTON_SELECT_ARCHIVE, - - GUI_ID_ANIMATION_INFO, - - // And some magic numbers - MAX_FRAMERATE = 80, - DEFAULT_FRAMERATE = 30 -}; - - -/* -Toggle between various cameras -*/ -void setActiveCamera(scene::ICameraSceneNode* newActive) -{ - if (0 == Device) - return; - - scene::ICameraSceneNode * active = Device->getSceneManager()->getActiveCamera(); - active->setInputReceiverEnabled(false); - - newActive->setInputReceiverEnabled(true); - Device->getSceneManager()->setActiveCamera(newActive); -} - -/* - Set the skin transparency by changing the alpha values of all skin-colors -*/ -void setSkinTransparency(s32 alpha, irr::gui::IGUISkin * skin) -{ - for (s32 i=0; igetColor((EGUI_DEFAULT_COLOR)i); - col.setAlpha(alpha); - skin->setColor((EGUI_DEFAULT_COLOR)i, col); - } -} - -/* - Update the display of the model scaling -*/ -void updateScaleInfo(scene::ISceneNode* model) -{ - IGUIElement* toolboxWnd = Device->getGUIEnvironment()->getRootGUIElement()->getElementFromId(GUI_ID_DIALOG_ROOT_WINDOW, true); - if (!toolboxWnd) - return; - if (!model) - { - toolboxWnd->getElementFromId(GUI_ID_X_SCALE, true)->setText( L"-" ); - toolboxWnd->getElementFromId(GUI_ID_Y_SCALE, true)->setText( L"-" ); - toolboxWnd->getElementFromId(GUI_ID_Z_SCALE, true)->setText( L"-" ); - } - else - { - core::vector3df scale = model->getScale(); - toolboxWnd->getElementFromId(GUI_ID_X_SCALE, true)->setText( core::stringw(scale.X).c_str() ); - toolboxWnd->getElementFromId(GUI_ID_Y_SCALE, true)->setText( core::stringw(scale.Y).c_str() ); - toolboxWnd->getElementFromId(GUI_ID_Z_SCALE, true)->setText( core::stringw(scale.Z).c_str() ); - } -} - -/* -Function showAboutText() displays a messagebox with a caption and -a message text. The texts will be stored in the MessageText and Caption -variables at startup. -*/ -void showAboutText() -{ - // create modal message box with the text - // loaded from the xml file. - Device->getGUIEnvironment()->addMessageBox( - Caption.c_str(), MessageText.c_str()); -} - - -/* -Function loadModel() loads a model and displays it using an -addAnimatedMeshSceneNode and the scene manager. Nothing difficult. It also -displays a short message box, if the model could not be loaded. -*/ -void loadModel(const io::path& filename) -{ - io::path extension; - core::getFileNameExtension(extension, filename); - extension.make_lower(); - - // if a texture is loaded apply it to the current model.. - if (extension == ".jpg" || extension == ".pcx" || - extension == ".png" || extension == ".ppm" || - extension == ".pgm" || extension == ".pbm" || - extension == ".psd" || extension == ".tga" || - extension == ".bmp" || extension == ".wal" || - extension == ".rgb" || extension == ".rgba") - { - // Ensure reloading texture by clearing old one out of cache - video::ITexture * texture = Device->getVideoDriver()->findTexture( filename ); - if ( texture ) - Device->getVideoDriver()->removeTexture(texture); - - // Load the new one and put int on the model - texture = Device->getVideoDriver()->getTexture( filename ); - if ( texture && Model ) - { - Model->setMaterialTexture(0, texture); - } - return; - } - // if a archive is loaded add it to the FileArchive.. - else if (extension == ".pk3" || extension == ".zip" || extension == ".pak" || extension == ".npk") - { - Device->getFileSystem()->addFileArchive(filename.c_str()); - return; - } - - // Remove old model - - if (Model) - { - Model->remove(); - Model = 0; - } - - // .irr is a scene format, so load as scene and set Model pointer to first object in the scene - - if (extension==".irr") - { - core::array outNodes; - Device->getSceneManager()->loadScene(filename); - Device->getSceneManager()->getSceneNodesFromType(scene::ESNT_ANIMATED_MESH, outNodes); - if (outNodes.size()) - Model = outNodes[0]; - return; - } - - // load a model into the engine. Also log the time it takes to load it. - - u32 then = Device->getTimer()->getRealTime(); - scene::IAnimatedMesh* mesh = Device->getSceneManager()->getMesh( filename.c_str() ); - Device->getLogger()->log("Loading time (ms): ", core::stringc(Device->getTimer()->getRealTime() - then).c_str()); - - if (!mesh) - { - // model could not be loaded - - if (StartUpModelFile != filename) - Device->getGUIEnvironment()->addMessageBox( - Caption.c_str(), L"The model could not be loaded. " \ - L"Maybe it is not a supported file format."); - return; - } - - // set default material properties - - if (Octree) - Model = Device->getSceneManager()->addOctreeSceneNode(mesh->getMesh(0)); - else - { - scene::IAnimatedMeshSceneNode* animModel = Device->getSceneManager()->addAnimatedMeshSceneNode(mesh); - Model = animModel; - } - Model->setMaterialFlag(video::EMF_LIGHTING, UseLight); - Model->setMaterialFlag(video::EMF_NORMALIZE_NORMALS, UseLight); -// Model->setMaterialFlag(video::EMF_BACK_FACE_CULLING, false); - Model->setDebugDataVisible(scene::EDS_OFF); - - // we need to uncheck the menu entries. would be cool to fake a menu event, but - // that's not so simple. so we do it brute force - gui::IGUIContextMenu* menu = (gui::IGUIContextMenu*)Device->getGUIEnvironment()->getRootGUIElement()->getElementFromId(GUI_ID_TOGGLE_DEBUG_INFO, true); - if (menu) - for(int item = 1; item < 6; ++item) - menu->setItemChecked(item, false); - updateScaleInfo(Model); -} - - -/* -Function createToolBox() creates a toolbox window. In this simple mesh -viewer, this toolbox only contains a controls to change the scale -and animation speed of the model and a control to set the transparency -of the GUI-elements. -*/ -void createToolBox() -{ - // remove tool box if already there - IGUIEnvironment* env = Device->getGUIEnvironment(); - IGUIElement* root = env->getRootGUIElement(); - IGUIElement* e = root->getElementFromId(GUI_ID_DIALOG_ROOT_WINDOW, true); - if (e) - e->remove(); - - // create the toolbox window - IGUIWindow* wnd = env->addWindow(core::rect(600,45,800,480), - false, L"Toolset", 0, GUI_ID_DIALOG_ROOT_WINDOW); - - // create tab control and tabs - IGUITabControl* tab = env->addTabControl( - core::rect(2,20,800-602,480-7), wnd, true, true); - - IGUITab* t1 = tab->addTab(L"Config"); - - // add some edit boxes and a button to tab one - env->addStaticText(L"Scale:", - core::rect(10,20,60,45), false, false, t1); - env->addStaticText(L"X:", core::rect(22,48,40,66), false, false, t1); - env->addEditBox(L"1.0", core::rect(40,46,130,66), true, t1, GUI_ID_X_SCALE); - env->addStaticText(L"Y:", core::rect(22,82,40,96), false, false, t1); - env->addEditBox(L"1.0", core::rect(40,76,130,96), true, t1, GUI_ID_Y_SCALE); - env->addStaticText(L"Z:", core::rect(22,108,40,126), false, false, t1); - env->addEditBox(L"1.0", core::rect(40,106,130,126), true, t1, GUI_ID_Z_SCALE); - - env->addButton(core::rect(10,134,85,165), t1, GUI_ID_BUTTON_SET_SCALE, L"Set"); - - // quick scale buttons - env->addButton(core::rect(65,20,95,40), t1, GUI_ID_BUTTON_SCALE_MUL10, L"* 10"); - env->addButton(core::rect(100,20,130,40), t1, GUI_ID_BUTTON_SCALE_DIV10, L"* 0.1"); - - updateScaleInfo(Model); - - // add transparency control - env->addStaticText(L"GUI Transparency Control:", - core::rect(10,200,150,225), true, false, t1); - IGUIScrollBar* scrollbar = env->addScrollBar(true, - core::rect(10,225,150,240), t1, GUI_ID_SKIN_TRANSPARENCY); - scrollbar->setMax(255); - scrollbar->setPos(255); - - // add framerate control - env->addStaticText(L":", core::rect(10,240,150,265), true, false, t1); - env->addStaticText(L"Framerate:", - core::rect(12,240,75,265), false, false, t1); - // current frame info - env->addStaticText(L"", core::rect(75,240,200,265), false, false, t1, - GUI_ID_ANIMATION_INFO); - scrollbar = env->addScrollBar(true, - core::rect(10,265,150,280), t1, GUI_ID_SKIN_ANIMATION_FPS); - scrollbar->setMax(MAX_FRAMERATE); - scrollbar->setMin(-MAX_FRAMERATE); - scrollbar->setPos(DEFAULT_FRAMERATE); - scrollbar->setSmallStep(1); -} - -/* -Function updateToolBox() is called each frame to update dynamic information in -the toolbox. -*/ -void updateToolBox() -{ - IGUIEnvironment* env = Device->getGUIEnvironment(); - IGUIElement* root = env->getRootGUIElement(); - IGUIElement* dlg = root->getElementFromId(GUI_ID_DIALOG_ROOT_WINDOW, true); - if (!dlg ) - return; - - // update the info we have about the animation of the model - IGUIStaticText * aniInfo = (IGUIStaticText *)(dlg->getElementFromId(GUI_ID_ANIMATION_INFO, true)); - if (aniInfo) - { - if ( Model && scene::ESNT_ANIMATED_MESH == Model->getType() ) - { - scene::IAnimatedMeshSceneNode* animatedModel = (scene::IAnimatedMeshSceneNode*)Model; - - core::stringw str( (s32)core::round_(animatedModel->getAnimationSpeed()) ); - str += L" Frame: "; - str += core::stringw((s32)animatedModel->getFrameNr()); - aniInfo->setText(str.c_str()); - } - else - aniInfo->setText(L""); - } -} - -void onKillFocus() -{ - // Avoid that the FPS-camera continues moving when the user presses alt-tab while - // moving the camera. - const core::list& animators = Camera[1]->getAnimators(); - core::list::ConstIterator iter = animators.begin(); - while ( iter != animators.end() ) - { - if ( (*iter)->getType() == scene::ESNAT_CAMERA_FPS ) - { - // we send a key-down event for all keys used by this animator - scene::ISceneNodeAnimatorCameraFPS * fpsAnimator = static_cast(*iter); - const core::array& keyMap = fpsAnimator->getKeyMap(); - for ( irr::u32 i=0; i< keyMap.size(); ++i ) - { - irr::SEvent event; - event.EventType = EET_KEY_INPUT_EVENT; - event.KeyInput.Key = keyMap[i].KeyCode; - event.KeyInput.PressedDown = false; - fpsAnimator->OnEvent(event); - } - } - ++iter; - } -} - -/* -Function hasModalDialog() checks if we currently have a modal dialog open. -*/ -bool hasModalDialog() -{ - if ( !Device ) - return false; - IGUIEnvironment* env = Device->getGUIEnvironment(); - IGUIElement * focused = env->getFocus(); - while ( focused ) - { - if ( focused->isVisible() && focused->hasType(EGUIET_MODAL_SCREEN) ) - return true; - focused = focused->getParent(); - } - return false; -} - -/* -To get all the events sent by the GUI Elements, we need to create an event -receiver. This one is really simple. If an event occurs, it checks the id of -the caller and the event type, and starts an action based on these values. For -example, if a menu item with id GUI_ID_OPEN_MODEL was selected, it opens a file-open-dialog. -*/ -class MyEventReceiver : public IEventReceiver -{ -public: - virtual bool OnEvent(const SEvent& event) - { - // Key events - if (event.EventType == EET_KEY_INPUT_EVENT && - event.KeyInput.PressedDown == false) - { - if ( OnKeyUp(event.KeyInput.Key) ) - return true; - } - - // GUI events - if (event.EventType == EET_GUI_EVENT) - { - s32 id = event.GUIEvent.Caller->getID(); - IGUIEnvironment* env = Device->getGUIEnvironment(); - - switch(event.GUIEvent.EventType) - { - case EGET_MENU_ITEM_SELECTED: - // a menu item was clicked - OnMenuItemSelected( (IGUIContextMenu*)event.GUIEvent.Caller ); - break; - - case EGET_FILE_SELECTED: - { - // load the model file, selected in the file open dialog - IGUIFileOpenDialog* dialog = - (IGUIFileOpenDialog*)event.GUIEvent.Caller; - loadModel(dialog->getFileNameP()); - } - break; - - case EGET_SCROLL_BAR_CHANGED: - - // control skin transparency - if (id == GUI_ID_SKIN_TRANSPARENCY) - { - const s32 pos = ((IGUIScrollBar*)event.GUIEvent.Caller)->getPos(); - setSkinTransparency(pos, env->getSkin()); - } - // control animation speed - else if (id == GUI_ID_SKIN_ANIMATION_FPS) - { - const s32 pos = ((IGUIScrollBar*)event.GUIEvent.Caller)->getPos(); - if (scene::ESNT_ANIMATED_MESH == Model->getType()) - ((scene::IAnimatedMeshSceneNode*)Model)->setAnimationSpeed((f32)pos); - } - break; - - case EGET_COMBO_BOX_CHANGED: - - // control anti-aliasing/filtering - if (id == GUI_ID_TEXTUREFILTER) - { - OnTextureFilterSelected( (IGUIComboBox*)event.GUIEvent.Caller ); - } - break; - - case EGET_BUTTON_CLICKED: - - switch(id) - { - case GUI_ID_BUTTON_SET_SCALE: - { - // set model scale - gui::IGUIElement* root = env->getRootGUIElement(); - core::vector3df scale; - core::stringc s; - - s = root->getElementFromId(GUI_ID_X_SCALE, true)->getText(); - scale.X = (f32)atof(s.c_str()); - s = root->getElementFromId(GUI_ID_Y_SCALE, true)->getText(); - scale.Y = (f32)atof(s.c_str()); - s = root->getElementFromId(GUI_ID_Z_SCALE, true)->getText(); - scale.Z = (f32)atof(s.c_str()); - - if (Model) - Model->setScale(scale); - updateScaleInfo(Model); - } - break; - case GUI_ID_BUTTON_SCALE_MUL10: - if (Model) - Model->setScale(Model->getScale()*10.f); - updateScaleInfo(Model); - break; - case GUI_ID_BUTTON_SCALE_DIV10: - if (Model) - Model->setScale(Model->getScale()*0.1f); - updateScaleInfo(Model); - break; - case GUI_ID_BUTTON_OPEN_MODEL: - env->addFileOpenDialog(L"Please select a model file to open"); - break; - case GUI_ID_BUTTON_SHOW_ABOUT: - showAboutText(); - break; - case GUI_ID_BUTTON_SHOW_TOOLBOX: - createToolBox(); - break; - case GUI_ID_BUTTON_SELECT_ARCHIVE: - env->addFileOpenDialog(L"Please select your game archive/directory"); - break; - } - - break; - default: - break; - } - } - - return false; - } - - - /* - Handle key-up events - */ - bool OnKeyUp(irr::EKEY_CODE keyCode) - { - // Don't handle keys if we have a modal dialog open as it would lead - // to unexpected application behaviour for the user. - if ( hasModalDialog() ) - return false; - - // Escape swaps Camera Input - if (keyCode == irr::KEY_ESCAPE) - { - if (Device) - { - scene::ICameraSceneNode * camera = - Device->getSceneManager()->getActiveCamera(); - if (camera) - { - camera->setInputReceiverEnabled( !camera->isInputReceiverEnabled() ); - } - return true; - } - } - else if (keyCode == irr::KEY_F1) - { - // Swap display of position information about the camera - if (Device) - { - IGUIElement* elem = Device->getGUIEnvironment()->getRootGUIElement()->getElementFromId(GUI_ID_POSITION_TEXT); - if (elem) - elem->setVisible(!elem->isVisible()); - } - } - else if (keyCode == irr::KEY_KEY_M) - { - if (Device) - Device->minimizeWindow(); - } - else if (keyCode == irr::KEY_KEY_L) - { - UseLight=!UseLight; - if (Model) - { - Model->setMaterialFlag(video::EMF_LIGHTING, UseLight); - Model->setMaterialFlag(video::EMF_NORMALIZE_NORMALS, UseLight); - } - } - return false; - } - - - /* - Handle "menu item clicked" events. - */ - void OnMenuItemSelected( IGUIContextMenu* menu ) - { - s32 id = menu->getItemCommandId(menu->getSelectedItem()); - IGUIEnvironment* env = Device->getGUIEnvironment(); - - switch(id) - { - case GUI_ID_OPEN_MODEL: // File -> Open Model File & Texture - env->addFileOpenDialog(L"Please select a model file to open"); - break; - case GUI_ID_SET_MODEL_ARCHIVE: // File -> Set Model Archive - env->addFileOpenDialog(L"Please select your game archive/directory"); - break; - case GUI_ID_LOAD_AS_OCTREE: // File -> LoadAsOctree - Octree = !Octree; - menu->setItemChecked(menu->getSelectedItem(), Octree); - break; - case GUI_ID_QUIT: // File -> Quit - Device->closeDevice(); - break; - case GUI_ID_SKY_BOX_VISIBLE: // View -> Skybox - menu->setItemChecked(menu->getSelectedItem(), !menu->isItemChecked(menu->getSelectedItem())); - SkyBox->setVisible(!SkyBox->isVisible()); - break; - case GUI_ID_DEBUG_OFF: // View -> Debug Information - menu->setItemChecked(menu->getSelectedItem()+1, false); - menu->setItemChecked(menu->getSelectedItem()+2, false); - menu->setItemChecked(menu->getSelectedItem()+3, false); - menu->setItemChecked(menu->getSelectedItem()+4, false); - menu->setItemChecked(menu->getSelectedItem()+5, false); - menu->setItemChecked(menu->getSelectedItem()+6, false); - if (Model) - Model->setDebugDataVisible(scene::EDS_OFF); - break; - case GUI_ID_DEBUG_BOUNDING_BOX: // View -> Debug Information - menu->setItemChecked(menu->getSelectedItem(), !menu->isItemChecked(menu->getSelectedItem())); - if (Model) - Model->setDebugDataVisible((scene::E_DEBUG_SCENE_TYPE)(Model->isDebugDataVisible()^scene::EDS_BBOX)); - break; - case GUI_ID_DEBUG_NORMALS: // View -> Debug Information - menu->setItemChecked(menu->getSelectedItem(), !menu->isItemChecked(menu->getSelectedItem())); - if (Model) - Model->setDebugDataVisible((scene::E_DEBUG_SCENE_TYPE)(Model->isDebugDataVisible()^scene::EDS_NORMALS)); - break; - case GUI_ID_DEBUG_SKELETON: // View -> Debug Information - menu->setItemChecked(menu->getSelectedItem(), !menu->isItemChecked(menu->getSelectedItem())); - if (Model) - Model->setDebugDataVisible((scene::E_DEBUG_SCENE_TYPE)(Model->isDebugDataVisible()^scene::EDS_SKELETON)); - break; - case GUI_ID_DEBUG_WIRE_OVERLAY: // View -> Debug Information - menu->setItemChecked(menu->getSelectedItem(), !menu->isItemChecked(menu->getSelectedItem())); - if (Model) - Model->setDebugDataVisible((scene::E_DEBUG_SCENE_TYPE)(Model->isDebugDataVisible()^scene::EDS_MESH_WIRE_OVERLAY)); - break; - case GUI_ID_DEBUG_HALF_TRANSPARENT: // View -> Debug Information - menu->setItemChecked(menu->getSelectedItem(), !menu->isItemChecked(menu->getSelectedItem())); - if (Model) - Model->setDebugDataVisible((scene::E_DEBUG_SCENE_TYPE)(Model->isDebugDataVisible()^scene::EDS_HALF_TRANSPARENCY)); - break; - case GUI_ID_DEBUG_BUFFERS_BOUNDING_BOXES: // View -> Debug Information - menu->setItemChecked(menu->getSelectedItem(), !menu->isItemChecked(menu->getSelectedItem())); - if (Model) - Model->setDebugDataVisible((scene::E_DEBUG_SCENE_TYPE)(Model->isDebugDataVisible()^scene::EDS_BBOX_BUFFERS)); - break; - case GUI_ID_DEBUG_ALL: // View -> Debug Information - menu->setItemChecked(menu->getSelectedItem()-1, true); - menu->setItemChecked(menu->getSelectedItem()-2, true); - menu->setItemChecked(menu->getSelectedItem()-3, true); - menu->setItemChecked(menu->getSelectedItem()-4, true); - menu->setItemChecked(menu->getSelectedItem()-5, true); - menu->setItemChecked(menu->getSelectedItem()-6, true); - if (Model) - Model->setDebugDataVisible(scene::EDS_FULL); - break; - case GUI_ID_ABOUT: // Help->About - showAboutText(); - break; - case GUI_ID_MODEL_MATERIAL_SOLID: // View -> Material -> Solid - if (Model) - Model->setMaterialType(video::EMT_SOLID); - break; - case GUI_ID_MODEL_MATERIAL_TRANSPARENT: // View -> Material -> Transparent - if (Model) - Model->setMaterialType(video::EMT_TRANSPARENT_ADD_COLOR); - break; - case GUI_ID_MODEL_MATERIAL_REFLECTION: // View -> Material -> Reflection - if (Model) - Model->setMaterialType(video::EMT_SPHERE_MAP); - break; - - case GUI_ID_CAMERA_MAYA: - setActiveCamera(Camera[0]); - break; - case GUI_ID_CAMERA_FIRST_PERSON: - setActiveCamera(Camera[1]); - break; - } - } - - /* - Handle the event that one of the texture-filters was selected in the corresponding combobox. - */ - void OnTextureFilterSelected( IGUIComboBox* combo ) - { - s32 pos = combo->getSelected(); - switch (pos) - { - case 0: - if (Model) - { - Model->setMaterialFlag(video::EMF_BILINEAR_FILTER, false); - Model->setMaterialFlag(video::EMF_TRILINEAR_FILTER, false); - Model->setMaterialFlag(video::EMF_ANISOTROPIC_FILTER, false); - } - break; - case 1: - if (Model) - { - Model->setMaterialFlag(video::EMF_BILINEAR_FILTER, true); - Model->setMaterialFlag(video::EMF_TRILINEAR_FILTER, false); - } - break; - case 2: - if (Model) - { - Model->setMaterialFlag(video::EMF_BILINEAR_FILTER, false); - Model->setMaterialFlag(video::EMF_TRILINEAR_FILTER, true); - } - break; - case 3: - if (Model) - { - Model->setMaterialFlag(video::EMF_ANISOTROPIC_FILTER, true); - } - break; - case 4: - if (Model) - { - Model->setMaterialFlag(video::EMF_ANISOTROPIC_FILTER, false); - } - break; - } - } -}; - - -/* -Most of the hard work is done. We only need to create the Irrlicht Engine -device and all the buttons, menus and toolbars. We start up the engine as -usual, using createDevice(). To make our application catch events, we set our -eventreceiver as parameter. As you can see, there is also a call to -IrrlichtDevice::setResizeable(). This makes the render window resizeable, which -is quite useful for a mesh viewer. -*/ -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 - MyEventReceiver receiver; - Device = createDevice(driverType, core::dimension2d(800, 600), - 16, false, false, false, &receiver); - - if (Device == 0) - return 1; // could not create selected driver. - - Device->setResizable(true); - - Device->setWindowCaption(L"Irrlicht Engine - Loading..."); - - video::IVideoDriver* driver = Device->getVideoDriver(); - IGUIEnvironment* env = Device->getGUIEnvironment(); - scene::ISceneManager* smgr = Device->getSceneManager(); - smgr->getParameters()->setAttribute(scene::COLLADA_CREATE_SCENE_INSTANCES, true); - - driver->setTextureCreationFlag(video::ETCF_ALWAYS_32_BIT, true); - - smgr->addLightSceneNode(0, core::vector3df(200,200,200), - video::SColorf(1.0f,1.0f,1.0f),2000); - smgr->setAmbientLight(video::SColorf(0.3f,0.3f,0.3f)); - // add our media directory as "search path" - Device->getFileSystem()->addFileArchive(getExampleMediaPath()); - - // We can pass a model to load per command line parameter - if (argc > 1) - StartUpModelFile = argv[1]; - - // set a nicer font - IGUISkin* skin = env->getSkin(); - IGUIFont* font = env->getFont("fonthaettenschweiler.bmp"); - if (font) - skin->setFont(font); - - /* - Now create the Menu. - It is possible to create submenus for every menu item. The call - menu->addItem(L"File", -1, true, true); for example adds a new menu - Item with the name "File" and the id -1. The following parameter says - that the menu item should be enabled, and the last one says, that there - should be a submenu. The submenu can now be accessed with - menu->getSubMenu(0), because the "File" entry is the menu item with - index 0. - */ - gui::IGUIContextMenu* menu = env->addMenu(); - menu->addItem(L"File", -1, true, true); - menu->addItem(L"View", -1, true, true); - menu->addItem(L"Camera", -1, true, true); - menu->addItem(L"Help", -1, true, true); - - gui::IGUIContextMenu* submenu; - submenu = menu->getSubMenu(0); - submenu->addItem(L"Open Model File & Texture...", GUI_ID_OPEN_MODEL); - submenu->addItem(L"Set Model Archive...", GUI_ID_SET_MODEL_ARCHIVE); - submenu->addItem(L"Load as Octree", GUI_ID_LOAD_AS_OCTREE); - submenu->addSeparator(); - submenu->addItem(L"Quit", GUI_ID_QUIT); - - submenu = menu->getSubMenu(1); - submenu->addItem(L"sky box visible", GUI_ID_SKY_BOX_VISIBLE, true, false, true); - submenu->addItem(L"toggle model debug information", GUI_ID_TOGGLE_DEBUG_INFO, true, true); - submenu->addItem(L"model material", -1, true, true ); - - submenu = submenu->getSubMenu(1); - submenu->addItem(L"Off", GUI_ID_DEBUG_OFF); - submenu->addItem(L"Bounding Box", GUI_ID_DEBUG_BOUNDING_BOX); - submenu->addItem(L"Normals", GUI_ID_DEBUG_NORMALS); - submenu->addItem(L"Skeleton", GUI_ID_DEBUG_SKELETON); - submenu->addItem(L"Wire overlay", GUI_ID_DEBUG_WIRE_OVERLAY); - submenu->addItem(L"Half-Transparent", GUI_ID_DEBUG_HALF_TRANSPARENT); - submenu->addItem(L"Buffers bounding boxes", GUI_ID_DEBUG_BUFFERS_BOUNDING_BOXES); - submenu->addItem(L"All", GUI_ID_DEBUG_ALL); - - submenu = menu->getSubMenu(1)->getSubMenu(2); - submenu->addItem(L"Solid", GUI_ID_MODEL_MATERIAL_SOLID); - submenu->addItem(L"Transparent", GUI_ID_MODEL_MATERIAL_TRANSPARENT); - submenu->addItem(L"Reflection", GUI_ID_MODEL_MATERIAL_REFLECTION); - - submenu = menu->getSubMenu(2); - submenu->addItem(L"Maya Style", GUI_ID_CAMERA_MAYA); - submenu->addItem(L"First Person", GUI_ID_CAMERA_FIRST_PERSON); - - submenu = menu->getSubMenu(3); - submenu->addItem(L"About", GUI_ID_ABOUT); - - /* - Below the menu we want a toolbar, onto which we can place colored - buttons and important looking stuff like a senseless combobox. - */ - - // create toolbar - - gui::IGUIToolBar* bar = env->addToolBar(); - - video::ITexture* image = driver->getTexture("open.png"); - bar->addButton(GUI_ID_BUTTON_OPEN_MODEL, 0, L"Open a model",image, 0, false, true); - - image = driver->getTexture("tools.png"); - bar->addButton(GUI_ID_BUTTON_SHOW_TOOLBOX, 0, L"Open Toolset",image, 0, false, true); - - image = driver->getTexture("zip.png"); - bar->addButton(GUI_ID_BUTTON_SELECT_ARCHIVE, 0, L"Set Model Archive",image, 0, false, true); - - image = driver->getTexture("help.png"); - bar->addButton(GUI_ID_BUTTON_SHOW_ABOUT, 0, L"Open Help", image, 0, false, true); - - // create a combobox for texture filters - - gui::IGUIComboBox* box = env->addComboBox(core::rect(250,4,350,23), bar, GUI_ID_TEXTUREFILTER); - box->addItem(L"No filtering"); - box->addItem(L"Bilinear"); - box->addItem(L"Trilinear"); - box->addItem(L"Anisotropic"); - box->addItem(L"Isotropic"); - - /* - To make the editor look a little bit better, we disable transparent gui - elements, and add an Irrlicht Engine logo. In addition, a text showing - the current frames per second value is created and the window caption is - changed. - */ - - // disable alpha - - for (s32 i=0; igetSkin()->getColor((gui::EGUI_DEFAULT_COLOR)i); - col.setAlpha(255); - env->getSkin()->setColor((gui::EGUI_DEFAULT_COLOR)i, col); - } - - // add a tabcontrol - - createToolBox(); - - // create fps text - - IGUIStaticText* fpstext = env->addStaticText(L"", - core::rect(400,4,570,23), true, false, bar); - - IGUIStaticText* postext = env->addStaticText(L"", - core::rect(10,50,470,80),false, false, 0, GUI_ID_POSITION_TEXT); - postext->setVisible(false); - - // set window caption - Caption += " - ["; - Caption += driver->getName(); - Caption += "]"; - Device->setWindowCaption(Caption.c_str()); - - /* - Now we show the about message box at start up, and load the first model. - To make everything look better a skybox is created. We also add a user - controlled camera, to make the application more interactive. - Finally, everything is drawn in a standard drawing loop. - */ - - // show about message box and load default model - if (argc==1) - showAboutText(); - loadModel(StartUpModelFile.c_str()); - - // add skybox - SkyBox = smgr->addSkyBoxSceneNode( - driver->getTexture("irrlicht2_up.jpg"), - driver->getTexture("irrlicht2_dn.jpg"), - driver->getTexture("irrlicht2_lf.jpg"), - driver->getTexture("irrlicht2_rt.jpg"), - driver->getTexture("irrlicht2_ft.jpg"), - driver->getTexture("irrlicht2_bk.jpg")); - - // add a camera scene node - Camera[0] = smgr->addCameraSceneNodeMaya(); - Camera[0]->setFarValue(20000.f); - // Maya cameras reposition themselves relative to their target, so target the location - // where the mesh scene node is placed. - Camera[0]->setTarget(core::vector3df(0,30,0)); - - Camera[1] = smgr->addCameraSceneNodeFPS(); - Camera[1]->setFarValue(20000.f); - Camera[1]->setPosition(core::vector3df(0,0,-70)); - Camera[1]->setTarget(core::vector3df(0,30,0)); - - setActiveCamera(Camera[0]); - - // load the irrlicht engine logo - IGUIImage *img = - env->addImage(driver->getTexture("irrlichtlogo3.png"), - core::position2d(10, driver->getScreenSize().Height - 128)); - - // lock the logo's edges to the bottom left corner of the screen - img->setAlignment(EGUIA_UPPERLEFT, EGUIA_UPPERLEFT, - EGUIA_LOWERRIGHT, EGUIA_LOWERRIGHT); - - // remember state so we notice when the window does lose the focus - bool hasFocus = Device->isWindowFocused(); - - // draw everything - while(Device->run() && driver) - { - // Catch focus changes (workaround until Irrlicht has events for this) - bool focused = Device->isWindowFocused(); - if ( hasFocus && !focused ) - onKillFocus(); - hasFocus = focused; - - if (Device->isWindowActive()) - { - driver->beginScene(video::ECBF_COLOR | video::ECBF_DEPTH, video::SColor(150,50,50,50)); - - smgr->drawAll(); - env->drawAll(); - - driver->endScene(); - - // update information about current frame-rate - core::stringw str(L"FPS: "); - str.append(core::stringw(driver->getFPS())); - str += L" Tris: "; - str.append(core::stringw(driver->getPrimitiveCountDrawn())); - fpstext->setText(str.c_str()); - - // update information about the active camera - scene::ICameraSceneNode* cam = Device->getSceneManager()->getActiveCamera(); - str = L"Pos: "; - str.append(core::stringw(cam->getPosition().X)); - str += L" "; - str.append(core::stringw(cam->getPosition().Y)); - str += L" "; - str.append(core::stringw(cam->getPosition().Z)); - str += L" Tgt: "; - str.append(core::stringw(cam->getTarget().X)); - str += L" "; - str.append(core::stringw(cam->getTarget().Y)); - str += L" "; - str.append(core::stringw(cam->getTarget().Z)); - postext->setText(str.c_str()); - - // update the tool dialog - updateToolBox(); - } - else - Device->yield(); - } - - Device->drop(); - return 0; -} - -/* -**/ diff --git a/examples/09.Meshviewer/resource.h b/examples/09.Meshviewer/resource.h deleted file mode 100644 index a8e8616a..00000000 --- a/examples/09.Meshviewer/resource.h +++ /dev/null @@ -1,16 +0,0 @@ -//{{NO_DEPENDENCIES}} -// Microsoft Visual C++ generated include file. -// Used by 9.Meshviewer.rc -// -#define IDI_ICON1 101 - -// Next default values for new objects -// -#ifdef APSTUDIO_INVOKED -#ifndef APSTUDIO_READONLY_SYMBOLS -#define _APS_NEXT_RESOURCE_VALUE 102 -#define _APS_NEXT_COMMAND_VALUE 40001 -#define _APS_NEXT_CONTROL_VALUE 1001 -#define _APS_NEXT_SYMED_VALUE 101 -#endif -#endif diff --git a/examples/09.Meshviewer/tutorial.html b/examples/09.Meshviewer/tutorial.html deleted file mode 100644 index d296b6ca..00000000 --- a/examples/09.Meshviewer/tutorial.html +++ /dev/null @@ -1,182 +0,0 @@ - - -Irrlicht Engine Tutorial - - - - -
- - - - - - - - -
-
-
Tutorial 9. Mesh Viewer
-
-
-
-

This tutorial shows how to create a more complex application with - the engine. We construct a simple mesh viewer using the user interface - API and the scenemanagement of Irrlicht.
- The tutorial shows how to create and use Buttons, Windows, Toolbars, - Menus, ComboBoxes, Tabcontrols, Editboxes, Images, MessageBoxes, SkyBoxes, - and how to parse XML files with the integrated XML reader of the engine.

-

The program which is described here will look like this:

-


-

-
-
-
- - - - - - - -
Lets start!
-
-

We start like in most other tutorials: Include all nesessary header - files, add a comment to let the engine be linked with the right .lib - file in Visual Studio, and deklare some global variables. We also - add two 'using namespece' statements, so we do not need to write the - whole names of all classes. In this tutorial, we use a lot stuff from - the gui namespace.

- - - - -
#include <irrlicht.h>
#include <iostream>

using namespace irr;
using namespace gui;

#pragma comment(lib, "Irrlicht.lib")

IrrlichtDevice *Device = 0;
core::stringc StartUpModelFile;
core::stringw MessageText;
core::stringw Caption;
scene::IAnimatedMeshSceneNode* Model = 0;
scene::ISceneNode* SkyBox = 0;
-

The three following functions do several stuff used by the mesh - viewer. The first function showAboutText() simply displays a messagebox - with a caption and a message text. The texts will be stored in the - MessageText and Caption variables at startup.

- - - - -
void showAboutText()
{
// create modal message box with the text
// loaded from the xml file
.
Device->getGUIEnvironment()->addMessageBox(
Caption.c_str(), MessageText.c_str());
}
-

The second function loadModel() loads a model and displays it using - an addAnimatedMeshSceneNode and the scene manager. Nothing difficult. - It also displays a short message box, if the model could not be loaded. -

- - - - -
void loadModel(const c8* filename)
{
// load a model into the engine
if (Model)
Model->remove();
Model = 0;

scene::IAnimatedMesh* m = Device->getSceneManager()->getMesh(filename);
if (!m)
{
// model could not be loaded
if (StartUpModelFile != filename)
Device->getGUIEnvironment()->addMessageBox(
Caption.c_str(), L"The model could not be loaded. " \
L"Maybe it is not a supported file format.");
return;
}

// set default material properties
Model = Device->getSceneManager()->addAnimatedMeshSceneNode(m);
Model->setMaterialType(video::EMT_TRANSPARENT_ADD_COLOR);
Model->setMaterialFlag(video::EMF_LIGHTING, false);
Model->setDebugDataVisible(true);
}
-

Finally, the third function creates a toolbox window. In this simple - mesh viewer, this toolbox only contains a tab control with three edit - boxes for changing the scale of the displayed model.

- - - - -
void createToolBox()
{
// remove tool box if already there
IGUIEnvironment* env = Device->getGUIEnvironment();
IGUIElement* root = env->getRootGUIElement();
IGUIElement* e = root->getElementFromId(5000, true);
if (e) e->remove();

// create the toolbox window
IGUIWindow* wnd = env->addWindow(core::rect<s32>(450,25,640,480),
false, L"Toolset", 0, 5000);

// create tab control and tabs
IGUITabControl* tab = env->addTabControl(
core::rect<s32>(2,20,640-452,480-7), wnd, true, true);
IGUITab* t1 = tab->addTab(L"Scale");
IGUITab* t2 = tab->addTab(L"Empty Tab");

// add some edit boxes and a button to tab one
env->addEditBox(L"1.0", core::rect<s32>(40,50,130,70), true, t1, 901);
env->addEditBox(L"1.0", core::rect<s32>(40,80,130,100), true, t1, 902);
env->addEditBox(L"1.0", core::rect<s32>(40,110,130,130), true, t1, 903);
env->addButton(core::rect<s32>(10,150,100,190), t1, 1101, L"set");

// bring irrlicht engine logo to front, because it
// now may be below the newly created toolbox
root->bringToFront(root->getElementFromId(666, true));
}
-

To get all the events sent by the GUI Elements, we need to create - an event receiver. This one is really simple. If an event occurs, - it checks the id of the caller and the event type, and starts an action - based on these values. For example, if a menu item with id 100 was - selected, if opens a file-open-dialog.

-
- - - - -
class MyEventReceiver : public IEventReceiver
{
public:
virtual bool OnEvent(const SEvent& event)
{
if (event.EventType == EET_GUI_EVENT)
{
s32 id = event.GUIEvent.Caller->getID();
IGUIEnvironment* env = Device->getGUIEnvironment();
switch(event.GUIEvent.EventType)
{
case EGET_MENU_ITEM_SELECTED:
{
// a menu item was clicked
IGUIContextMenu* menu = (IGUIContextMenu*)event.GUIEvent.Caller;
s32 id = menu->getItemCommandId(menu->getSelectedItem());

switch(id)
{
case 100: // File -> Open Model
env->addFileOpenDialog(L"Please select a model file to open");
break;
case 200: // File -> Quit
Device->closeDevice();
break;
case 300: // View -> Skybox
SkyBox->setVisible(!SkyBox->isVisible());
break;
case 400: // View -> Debug Information
if (Model)
Model->setDebugDataVisible(!Model->isDebugDataVisible());
break;
case 500: // Help->About
showAboutText();
break;
case 610: // View -> Material -> Solid
if (Model)
Model->setMaterialType(video::EMT_SOLID);
break;
case 620: // View -> Material -> Transparent
if (Model)
Model->setMaterialType(video::EMT_TRANSPARENT_ADD_COLOR);
break;
case 630: // View -> Material -> Reflection
if (Model)
Model->setMaterialType(video::EMT_SPHERE_MAP);
break;
}
break;
}
case EGET_FILE_SELECTED:
{
// load the model file, selected in the file open dialog
IGUIFileOpenDialog* dialog =
(IGUIFileOpenDialog*)event.GUIEvent.Caller;
loadModel(core::stringc(dialog->getFilename()).c_str());
}
case EGET_BUTTON_CLICKED:
switch(id)
{
case 1101:
{
// set scale
gui::IGUIElement* root = env->getRootGUIElement();
core::vector3df scale;
core::stringc s;
s = root->getElementFromId(901, true)->getText();
scale.X = (f32)atof(s.c_str());
s = root->getElementFromId(902, true)->getText();
scale.Y = (f32)atof(s.c_str());
s = root->getElementFromId(903, true)->getText();
scale.Z = (f32)atof(s.c_str());
if (Model)
Model->setScale(scale);
}
break;
case 1102:
env->addFileOpenDialog(L"Please select a model file to open");
break;
case 1103:
showAboutText();
break;
case 1104:
createToolBox();
break;
}
break;
}
}
return false;
}
};
-

Most of the hard work is done. We only need to create the Irrlicht - Engine device and all the buttons, menus and toolbars. We start up the - engine as usual, using createDevice(). To make our application catch - events, we set our eventreceiver as parameter. The #ifdef WIN32 preprocessor - commands are not necesarry, but I included them to make the tutorial - use DirectX on Windows and OpenGL on all other platforms like Linux. - As you can see, there is also a unusual call to IrrlichtDevice::setResizeAble(). - This makes the render window resizeable, which is quite useful for a - mesh viewer.

- - - - -
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 key;
std::cin >> key;

switch(key)
{
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 -
MyEventReceiver receiver;
Device = createDevice(driverType, core::dimension2d<s32>(640, 480),
16, false, false, false, &receiver); -
if (Device == 0)
return 1; // could not create selected driver.

Device->setResizable(true);
Device->setWindowCaption(L"Irrlicht Engine - Loading...");

video::IVideoDriver* driver = Device->getVideoDriver();
IGUIEnvironment* env = Device->getGUIEnvironment();
scene::ISceneManager* smgr = Device->getSceneManager();
-

The next step is to read the configuration file. It is stored in the - xml format and looks a little bit like this:
-
- <?xml version="1.0"?>
- <config>
- <startUpModel file="some filename" />
- <messageText caption="Irrlicht Engine Mesh Viewer">
- Hello!
- </messageText>
- </config>

-
- 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("../../media/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;
}
}
if (xml)
xml->drop(); // don't forget to delete the xml reader
-
-

That wasn't difficult. Now we'll set a nicer font and create the Menu. - It is possible to create submenus for every menu item. The call menu->addItem(L"File", - -1, true, true); for example adds a new menu Item with the name "File" - and the id -1. The following parameter says that the menu item should - be enabled, and the last one says, that there should be a submenu. The - submenu can now be accessed with menu->getSubMenu(0), because the - "File" entry is the menu item with index 0.

- - - - -
	// set a nicer font
IGUISkin* skin = env->getSkin();
IGUIFont* font = env->getFont("../../media/fonthaettenschweiler.bmp");
if (font)
skin->setFont(font);

// create menu
gui::IGUIContextMenu* menu = env->addMenu();
menu->addItem(L"File", -1, true, true);
menu->addItem(L"View", -1, true, true);
menu->addItem(L"Help", -1, true, true);

gui::IGUIContextMenu* submenu;
submenu = menu->getSubMenu(0);
submenu->addItem(L"Open Model File...", 100);
submenu->addSeparator();
submenu->addItem(L"Quit", 200);

submenu = menu->getSubMenu(1);
submenu->addItem(L"toggle sky box visibility", 300);
submenu->addItem(L"toggle model debug information", 400);
submenu->addItem(L"model material", -1, true, true );

submenu = submenu->getSubMenu(2);
submenu->addItem(L"Solid", 610);
submenu->addItem(L"Transparent", 620);
submenu->addItem(L"Reflection", 630);

submenu = menu->getSubMenu(2);
submenu->addItem(L"About", 500); -
-
- We want a toolbar, onto which we can place colored buttons and important - looking stuff like a senseless combobox.
-
- - - - -
	// create toolbar
gui::IGUIToolBar* bar = env->addToolBar();
bar->addButton(1102, 0, driver->getTexture("../../media/open.bmp"));
bar->addButton(1103, 0, driver->getTexture("../../media/help.bmp"));
bar->addButton(1104, 0, driver->getTexture("../../media/tools.bmp"));

// create a combobox with some senseless texts
gui::IGUIComboBox* box = env->addComboBox(core::rect<s32>(100,5,200,25), bar);
box->addItem(L"Bilinear");
box->addItem(L"Trilinear");
box->addItem(L"Anisotropic");
box->addItem(L"Isotropic");
box->addItem(L"Psychedelic");
box->addItem(L"No filtering");
-
- To make the editor look a little bit better, we disable transparent gui - elements, and add a Irrlicht Engine logo. In addition, a text, which will - show the current frame per second value is created, and the window caption - changed.
-
- - - - -
	// disable alpha
for (s32 i=0; i<gui::EGDC_COUNT ; ++i)
{
video::SColor col = env->getSkin()->getColor((gui::EGUI_DEFAULT_COLOR)i);
col.setAlpha(255);
env->getSkin()->setColor((gui::EGUI_DEFAULT_COLOR)i, col);
}

// add a tabcontrol
createToolBox();

// add the irrlicht engine logo
IGUIImage* img = env->addImage(core::rect<s32>(22,429,108,460), 0, 666);
img->setImage(driver->getTexture("../../media/irrlichtlogoaligned.jpg"));

// create fps text
IGUIStaticText* fpstext =
env->addStaticText(L"", core::rect<s32>(210,26,270,41), true);

// set window caption
Caption += " - [";
Caption += driver->getName();
Caption += "]";
Device->setWindowCaption(Caption.c_str());
-
- That's nearly the whole application. We simply show the about message - box at start up, and load the first model. To make everything look better, - a skybox is created and a user controled camera, to make the application - a little bit more interactive. Finally, everything is drawed in a standard - drawing loop.
-
- - - - -
	// show about message box and load default model
showAboutText();
loadModel(StartUpModelFile.c_str());

// add skybox

SkyBox = smgr->addSkyBoxSceneNode(
driver->getTexture("../../media/irrlicht2_up.bmp"),
driver->getTexture("../../media/irrlicht2_dn.bmp"),
driver->getTexture("../../media/irrlicht2_lf.bmp"),
driver->getTexture("../../media/irrlicht2_rt.bmp"),
driver->getTexture("../../media/irrlicht2_ft.bmp"),
driver->getTexture("../../media/irrlicht2_bk.bmp"));

// add a camera scene node
smgr->addCameraSceneNodeMaya();

// draw everything
while(Device->run() && driver)
if (Device->isWindowActive())
{
driver->beginScene(true, true, video::SColor(150,50,50,50));
smgr->drawAll();
env->drawAll();

driver->endScene();

core::stringw str = L"FPS: ";
str += driver->getFPS();
fpstext->setText(str.c_str());
}
Device->drop();
return 0;
}
-
- Compile and run this, and you have a fully functional 3d Mesh viewer.
-
-
-

 

- - diff --git a/examples/10.Shaders/Makefile b/examples/10.Shaders/Makefile deleted file mode 100644 index fc57b656..00000000 --- a/examples/10.Shaders/Makefile +++ /dev/null @@ -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 := 10.Shaders -# 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 diff --git a/examples/10.Shaders/Shaders.cbp b/examples/10.Shaders/Shaders.cbp deleted file mode 100644 index b4f9dc53..00000000 --- a/examples/10.Shaders/Shaders.cbp +++ /dev/null @@ -1,56 +0,0 @@ - - - - - - diff --git a/examples/10.Shaders/Shaders.vcproj b/examples/10.Shaders/Shaders.vcproj deleted file mode 100644 index e730a2f9..00000000 --- a/examples/10.Shaders/Shaders.vcproj +++ /dev/null @@ -1,163 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/examples/10.Shaders/Shaders.xcodeproj/project.pbxproj b/examples/10.Shaders/Shaders.xcodeproj/project.pbxproj deleted file mode 100644 index 6c36ed9a..00000000 --- a/examples/10.Shaders/Shaders.xcodeproj/project.pbxproj +++ /dev/null @@ -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 /* 10.Shaders.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = 10.Shaders.app; sourceTree = BUILT_PRODUCTS_DIR; }; - 5E34CC741B7F8EEF00F212E8 /* main.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = main.cpp; sourceTree = ""; }; - 5E34CC781B7F90A000F212E8 /* libIrrlicht.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libIrrlicht.a; path = ../../lib/OSX/libIrrlicht.a; sourceTree = ""; }; - 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 = ""; }; -/* 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 = ""; - }; - 5E34CC521B7F8E6E00F212E8 /* Products */ = { - isa = PBXGroup; - children = ( - 5E34CC511B7F8E6E00F212E8 /* 10.Shaders.app */, - ); - name = Products; - sourceTree = ""; - }; - 5E34CC761B7F905600F212E8 /* Libraries */ = { - isa = PBXGroup; - children = ( - 5E8570B01B7F99F500B267D2 /* Cocoa.framework */, - 5E8570B41B7F9A0700B267D2 /* IOKit.framework */, - 5E8570B21B7F99FE00B267D2 /* OpenGL.framework */, - 5E34CC781B7F90A000F212E8 /* libIrrlicht.a */, - ); - name = Libraries; - sourceTree = ""; - }; - 5E34CC771B7F906D00F212E8 /* Resources */ = { - isa = PBXGroup; - children = ( - 5E8570BE1B7F9D3A00B267D2 /* media */, - ); - name = Resources; - sourceTree = ""; - }; -/* End PBXGroup section */ - -/* Begin PBXNativeTarget section */ - 5E34CC501B7F8E6E00F212E8 /* 10.Shaders */ = { - isa = PBXNativeTarget; - buildConfigurationList = 5E34CC701B7F8E6E00F212E8 /* Build configuration list for PBXNativeTarget "10.Shaders" */; - buildPhases = ( - 5E34CC4D1B7F8E6E00F212E8 /* Sources */, - 5E34CC4E1B7F8E6E00F212E8 /* Frameworks */, - 5E34CC4F1B7F8E6E00F212E8 /* Resources */, - ); - buildRules = ( - ); - dependencies = ( - ); - name = 10.Shaders; - productName = 01.HelloWorld; - productReference = 5E34CC511B7F8E6E00F212E8 /* 10.Shaders.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 "Shaders" */; - compatibilityVersion = "Xcode 3.2"; - developmentRegion = English; - hasScannedForEncodings = 0; - knownRegions = ( - en, - Base, - ); - mainGroup = 5E34C6D81B7F4A0C00F212E8; - productRefGroup = 5E34CC521B7F8E6E00F212E8 /* Products */; - projectDirPath = ""; - projectRoot = ""; - targets = ( - 5E34CC501B7F8E6E00F212E8 /* 10.Shaders */, - ); - }; -/* 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 "Shaders" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 5E34C6DD1B7F4A0C00F212E8 /* Debug */, - 5E34C6DE1B7F4A0C00F212E8 /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - 5E34CC701B7F8E6E00F212E8 /* Build configuration list for PBXNativeTarget "10.Shaders" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 5E34CC6C1B7F8E6E00F212E8 /* Debug */, - 5E34CC6D1B7F8E6E00F212E8 /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; -/* End XCConfigurationList section */ - }; - rootObject = 5E34C6D91B7F4A0C00F212E8 /* Project object */; -} diff --git a/examples/10.Shaders/Shaders.xcodeproj/xcshareddata/xcschemes/10.Shaders.xcscheme b/examples/10.Shaders/Shaders.xcodeproj/xcshareddata/xcschemes/10.Shaders.xcscheme deleted file mode 100644 index b6111a44..00000000 --- a/examples/10.Shaders/Shaders.xcodeproj/xcshareddata/xcschemes/10.Shaders.xcscheme +++ /dev/null @@ -1,91 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/examples/10.Shaders/Shaders_vc10.vcxproj b/examples/10.Shaders/Shaders_vc10.vcxproj deleted file mode 100644 index 55e1e888..00000000 --- a/examples/10.Shaders/Shaders_vc10.vcxproj +++ /dev/null @@ -1,235 +0,0 @@ - - - - - Debug - Win32 - - - Debug - x64 - - - Release - Win32 - - - Release - x64 - - - - 10.Shaders - {27158C82-CD15-4A9B-9848-35E7065B209F} - Shaders - - - - Application - false - MultiByte - Windows7.1SDK - - - Application - false - MultiByte - Windows7.1SDK - - - Application - false - MultiByte - Windows7.1SDK - - - Application - false - MultiByte - Windows7.1SDK - - - - - - - - - - - - - - - - - - - - - - - <_ProjectFileVersion>10.0.30319.1 - ..\..\bin\Win32-VisualStudio\ - ..\..\bin\Win64-VisualStudio\ - - - ..\..\bin\Win32-VisualStudio\ - ..\..\bin\Win64-VisualStudio\ - - - AllRules.ruleset - AllRules.ruleset - - - - - AllRules.ruleset - AllRules.ruleset - - - - - - - - .\Debug/Shaders.tlb - - - - - Disabled - ..\..\include;%(AdditionalIncludeDirectories) - WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebug - - - Level3 - EditAndContinue - - - _DEBUG;%(PreprocessorDefinitions) - 0x0c07 - - - ..\..\bin\Win32-VisualStudio\10.Shaders.exe - ..\..\lib\Win32-visualstudio;%(AdditionalLibraryDirectories) - true - Console - - - - - - - .\Debug/Shaders.tlb - - - - - Disabled - ..\..\include;%(AdditionalIncludeDirectories) - WIN32;WIN64;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebug - - - Level3 - ProgramDatabase - - - _DEBUG;%(PreprocessorDefinitions) - 0x0c07 - - - ..\..\bin\Win64-VisualStudio\10.Shaders.exe - ..\..\lib\Win64-visualstudio;%(AdditionalLibraryDirectories) - true - Console - - - - - - - .\Release/Shaders.tlb - - - - - MaxSpeed - OnlyExplicitInline - ..\..\include;%(AdditionalIncludeDirectories) - WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) - true - MultiThreaded - true - - - Level3 - - - NDEBUG;%(PreprocessorDefinitions) - 0x0c07 - - - ..\..\bin\Win32-VisualStudio\10.Shaders.exe - ..\..\lib\Win32-visualstudio;%(AdditionalLibraryDirectories) - Console - - - - - - - .\Release/Shaders.tlb - - - - - MaxSpeed - OnlyExplicitInline - ..\..\include;%(AdditionalIncludeDirectories) - WIN32;WIN64;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) - true - MultiThreaded - true - - - Level3 - - - NDEBUG;%(PreprocessorDefinitions) - 0x0c07 - - - ..\..\bin\Win64-VisualStudio\10.Shaders.exe - ..\..\lib\Win64-visualstudio;%(AdditionalLibraryDirectories) - Console - - - - - - - Disabled - Disabled - %(AdditionalIncludeDirectories) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(PreprocessorDefinitions) - EnableFastChecks - EnableFastChecks - MaxSpeed - MaxSpeed - %(AdditionalIncludeDirectories) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(PreprocessorDefinitions) - - - - - - \ No newline at end of file diff --git a/examples/10.Shaders/Shaders_vc11.vcxproj b/examples/10.Shaders/Shaders_vc11.vcxproj deleted file mode 100644 index 55e1e888..00000000 --- a/examples/10.Shaders/Shaders_vc11.vcxproj +++ /dev/null @@ -1,235 +0,0 @@ - - - - - Debug - Win32 - - - Debug - x64 - - - Release - Win32 - - - Release - x64 - - - - 10.Shaders - {27158C82-CD15-4A9B-9848-35E7065B209F} - Shaders - - - - Application - false - MultiByte - Windows7.1SDK - - - Application - false - MultiByte - Windows7.1SDK - - - Application - false - MultiByte - Windows7.1SDK - - - Application - false - MultiByte - Windows7.1SDK - - - - - - - - - - - - - - - - - - - - - - - <_ProjectFileVersion>10.0.30319.1 - ..\..\bin\Win32-VisualStudio\ - ..\..\bin\Win64-VisualStudio\ - - - ..\..\bin\Win32-VisualStudio\ - ..\..\bin\Win64-VisualStudio\ - - - AllRules.ruleset - AllRules.ruleset - - - - - AllRules.ruleset - AllRules.ruleset - - - - - - - - .\Debug/Shaders.tlb - - - - - Disabled - ..\..\include;%(AdditionalIncludeDirectories) - WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebug - - - Level3 - EditAndContinue - - - _DEBUG;%(PreprocessorDefinitions) - 0x0c07 - - - ..\..\bin\Win32-VisualStudio\10.Shaders.exe - ..\..\lib\Win32-visualstudio;%(AdditionalLibraryDirectories) - true - Console - - - - - - - .\Debug/Shaders.tlb - - - - - Disabled - ..\..\include;%(AdditionalIncludeDirectories) - WIN32;WIN64;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebug - - - Level3 - ProgramDatabase - - - _DEBUG;%(PreprocessorDefinitions) - 0x0c07 - - - ..\..\bin\Win64-VisualStudio\10.Shaders.exe - ..\..\lib\Win64-visualstudio;%(AdditionalLibraryDirectories) - true - Console - - - - - - - .\Release/Shaders.tlb - - - - - MaxSpeed - OnlyExplicitInline - ..\..\include;%(AdditionalIncludeDirectories) - WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) - true - MultiThreaded - true - - - Level3 - - - NDEBUG;%(PreprocessorDefinitions) - 0x0c07 - - - ..\..\bin\Win32-VisualStudio\10.Shaders.exe - ..\..\lib\Win32-visualstudio;%(AdditionalLibraryDirectories) - Console - - - - - - - .\Release/Shaders.tlb - - - - - MaxSpeed - OnlyExplicitInline - ..\..\include;%(AdditionalIncludeDirectories) - WIN32;WIN64;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) - true - MultiThreaded - true - - - Level3 - - - NDEBUG;%(PreprocessorDefinitions) - 0x0c07 - - - ..\..\bin\Win64-VisualStudio\10.Shaders.exe - ..\..\lib\Win64-visualstudio;%(AdditionalLibraryDirectories) - Console - - - - - - - Disabled - Disabled - %(AdditionalIncludeDirectories) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(PreprocessorDefinitions) - EnableFastChecks - EnableFastChecks - MaxSpeed - MaxSpeed - %(AdditionalIncludeDirectories) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(PreprocessorDefinitions) - - - - - - \ No newline at end of file diff --git a/examples/10.Shaders/Shaders_vc12.vcxproj b/examples/10.Shaders/Shaders_vc12.vcxproj deleted file mode 100644 index b7dedf0a..00000000 --- a/examples/10.Shaders/Shaders_vc12.vcxproj +++ /dev/null @@ -1,235 +0,0 @@ - - - - - Debug - Win32 - - - Debug - x64 - - - Release - Win32 - - - Release - x64 - - - - 10.Shaders - {27158C82-CD15-4A9B-9848-35E7065B209F} - Shaders - - - - Application - false - MultiByte - Windows7.1SDK - - - Application - false - MultiByte - Windows7.1SDK - - - Application - false - MultiByte - Windows7.1SDK - - - Application - false - MultiByte - Windows7.1SDK - - - - - - - - - - - - - - - - - - - - - - - <_ProjectFileVersion>10.0.30319.1 - ..\..\bin\Win32-VisualStudio\ - ..\..\bin\Win64-VisualStudio\ - - - ..\..\bin\Win32-VisualStudio\ - ..\..\bin\Win64-VisualStudio\ - - - AllRules.ruleset - AllRules.ruleset - - - - - AllRules.ruleset - AllRules.ruleset - - - - - - - - .\Debug/Shaders.tlb - - - - - Disabled - ..\..\include;%(AdditionalIncludeDirectories) - WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebug - - - Level3 - EditAndContinue - - - _DEBUG;%(PreprocessorDefinitions) - 0x0c07 - - - ..\..\bin\Win32-VisualStudio\10.Shaders.exe - ..\..\lib\Win32-visualstudio;%(AdditionalLibraryDirectories) - true - Console - - - - - - - .\Debug/Shaders.tlb - - - - - Disabled - ..\..\include;%(AdditionalIncludeDirectories) - WIN32;WIN64;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebug - - - Level3 - ProgramDatabase - - - _DEBUG;%(PreprocessorDefinitions) - 0x0c07 - - - ..\..\bin\Win64-VisualStudio\10.Shaders.exe - ..\..\lib\Win64-visualstudio;%(AdditionalLibraryDirectories) - true - Console - - - - - - - .\Release/Shaders.tlb - - - - - MaxSpeed - OnlyExplicitInline - ..\..\include;%(AdditionalIncludeDirectories) - WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) - true - MultiThreaded - true - - - Level3 - - - NDEBUG;%(PreprocessorDefinitions) - 0x0c07 - - - ..\..\bin\Win32-VisualStudio\10.Shaders.exe - ..\..\lib\Win32-visualstudio;%(AdditionalLibraryDirectories) - Console - - - - - - - .\Release/Shaders.tlb - - - - - MaxSpeed - OnlyExplicitInline - ..\..\include;%(AdditionalIncludeDirectories) - WIN32;WIN64;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) - true - MultiThreaded - true - - - Level3 - - - NDEBUG;%(PreprocessorDefinitions) - 0x0c07 - - - ..\..\bin\Win64-VisualStudio\10.Shaders.exe - ..\..\lib\Win64-visualstudio;%(AdditionalLibraryDirectories) - Console - - - - - - - Disabled - Disabled - %(AdditionalIncludeDirectories) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(PreprocessorDefinitions) - EnableFastChecks - EnableFastChecks - MaxSpeed - MaxSpeed - %(AdditionalIncludeDirectories) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(PreprocessorDefinitions) - - - - - - \ No newline at end of file diff --git a/examples/10.Shaders/Shaders_vc14.vcxproj b/examples/10.Shaders/Shaders_vc14.vcxproj deleted file mode 100644 index dfc7ff69..00000000 --- a/examples/10.Shaders/Shaders_vc14.vcxproj +++ /dev/null @@ -1,235 +0,0 @@ - - - - - Debug - Win32 - - - Debug - x64 - - - Release - Win32 - - - Release - x64 - - - - 10.Shaders - {27158C82-CD15-4A9B-9848-35E7065B209F} - Shaders - - - - Application - false - MultiByte - v140 - - - Application - false - MultiByte - v140 - - - Application - false - MultiByte - v140 - - - Application - false - MultiByte - v140 - - - - - - - - - - - - - - - - - - - - - - - <_ProjectFileVersion>10.0.30319.1 - ..\..\bin\Win32-VisualStudio\ - ..\..\bin\Win64-VisualStudio\ - - - ..\..\bin\Win32-VisualStudio\ - ..\..\bin\Win64-VisualStudio\ - - - AllRules.ruleset - AllRules.ruleset - - - - - AllRules.ruleset - AllRules.ruleset - - - - - - - - .\Debug/Shaders.tlb - - - - - Disabled - ..\..\include;%(AdditionalIncludeDirectories) - WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebug - - - Level3 - EditAndContinue - - - _DEBUG;%(PreprocessorDefinitions) - 0x0c07 - - - ..\..\bin\Win32-VisualStudio\10.Shaders.exe - ..\..\lib\Win32-visualstudio;%(AdditionalLibraryDirectories) - true - Console - - - - - - - .\Debug/Shaders.tlb - - - - - Disabled - ..\..\include;%(AdditionalIncludeDirectories) - WIN32;WIN64;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebug - - - Level3 - ProgramDatabase - - - _DEBUG;%(PreprocessorDefinitions) - 0x0c07 - - - ..\..\bin\Win64-VisualStudio\10.Shaders.exe - ..\..\lib\Win64-visualstudio;%(AdditionalLibraryDirectories) - true - Console - - - - - - - .\Release/Shaders.tlb - - - - - MaxSpeed - OnlyExplicitInline - ..\..\include;%(AdditionalIncludeDirectories) - WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) - true - MultiThreaded - true - - - Level3 - - - NDEBUG;%(PreprocessorDefinitions) - 0x0c07 - - - ..\..\bin\Win32-VisualStudio\10.Shaders.exe - ..\..\lib\Win32-visualstudio;%(AdditionalLibraryDirectories) - Console - - - - - - - .\Release/Shaders.tlb - - - - - MaxSpeed - OnlyExplicitInline - ..\..\include;%(AdditionalIncludeDirectories) - WIN32;WIN64;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) - true - MultiThreaded - true - - - Level3 - - - NDEBUG;%(PreprocessorDefinitions) - 0x0c07 - - - ..\..\bin\Win64-VisualStudio\10.Shaders.exe - ..\..\lib\Win64-visualstudio;%(AdditionalLibraryDirectories) - Console - - - - - - - Disabled - Disabled - %(AdditionalIncludeDirectories) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(PreprocessorDefinitions) - EnableFastChecks - EnableFastChecks - MaxSpeed - MaxSpeed - %(AdditionalIncludeDirectories) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(PreprocessorDefinitions) - - - - - - \ No newline at end of file diff --git a/examples/10.Shaders/main.cpp b/examples/10.Shaders/main.cpp deleted file mode 100644 index ff80bd51..00000000 --- a/examples/10.Shaders/main.cpp +++ /dev/null @@ -1,466 +0,0 @@ -/** Example 010 Shaders - -This tutorial shows how to use shaders for D3D9, and OpenGL with the -engine and how to create new material types with them. It also shows how to -disable the generation of mipmaps at texture loading, and how to use text scene -nodes. - -This tutorial does not explain how shaders work. I would recommend to read the -D3D or OpenGL, documentation, to search a tutorial, or to read a book about -this. - -At first, we need to include all headers and do the stuff we always do, like in -nearly all other tutorials: -*/ -#include -#include -#include "driverChoice.h" -#include "exampleHelper.h" - -using namespace irr; - -#ifdef _MSC_VER -#pragma comment(lib, "Irrlicht.lib") -#endif - -/* -Because we want to use some interesting shaders in this tutorials, we need to -set some data for them to make them able to compute nice colors. In this -example, we'll use a simple vertex shader which will calculate the color of the -vertex based on the position of the camera. -For this, the shader needs the following data: The inverted world matrix for -transforming the normal, the clip matrix for transforming the position, the -camera position and the world position of the object for the calculation of the -angle of light, and the color of the light. To be able to tell the shader all -this data every frame, we have to derive a class from the -IShaderConstantSetCallBack interface and override its only method, namely -OnSetConstants(). This method will be called every time the material is set. -The method setVertexShaderConstant() of the IMaterialRendererServices interface -is used to set the data the shader needs. If the user chose to use a High Level -shader language like HLSL instead of Assembler in this example, you have to set -the variable name as parameter instead of the register index. -*/ - -IrrlichtDevice* device = 0; -bool UseHighLevelShaders = false; - -class MyShaderCallBack : public video::IShaderConstantSetCallBack -{ -public: - MyShaderCallBack() : WorldViewProjID(-1), TransWorldID(-1), InvWorldID(-1), PositionID(-1), - ColorID(-1), TextureID(-1), FirstUpdate(true) - { - } - - virtual void OnSetConstants(video::IMaterialRendererServices* services, - s32 userData) - { - video::IVideoDriver* driver = services->getVideoDriver(); - - // get shader constants id. - - if (UseHighLevelShaders && FirstUpdate) - { - WorldViewProjID = services->getVertexShaderConstantID("mWorldViewProj"); - TransWorldID = services->getVertexShaderConstantID("mTransWorld"); - InvWorldID = services->getVertexShaderConstantID("mInvWorld"); - PositionID = services->getVertexShaderConstantID("mLightPos"); - ColorID = services->getVertexShaderConstantID("mLightColor"); - - // Textures ID are important only for OpenGL interface. - - if(driver->getDriverType() == video::EDT_OPENGL) - TextureID = services->getVertexShaderConstantID("myTexture"); - - FirstUpdate = false; - } - - // set inverted world matrix - // if we are using highlevel shaders (the user can select this when - // starting the program), we must set the constants by name. - - core::matrix4 invWorld = driver->getTransform(video::ETS_WORLD); - invWorld.makeInverse(); - - if (UseHighLevelShaders) - services->setVertexShaderConstant(InvWorldID, invWorld.pointer(), 16); - else - services->setVertexShaderConstant(invWorld.pointer(), 0, 4); - - // set clip matrix - - core::matrix4 worldViewProj; - worldViewProj = driver->getTransform(video::ETS_PROJECTION); - worldViewProj *= driver->getTransform(video::ETS_VIEW); - worldViewProj *= driver->getTransform(video::ETS_WORLD); - - if (UseHighLevelShaders) - services->setVertexShaderConstant(WorldViewProjID, worldViewProj.pointer(), 16); - else - services->setVertexShaderConstant(worldViewProj.pointer(), 4, 4); - - // set camera position - - core::vector3df pos = device->getSceneManager()-> - getActiveCamera()->getAbsolutePosition(); - - if (UseHighLevelShaders) - services->setVertexShaderConstant(PositionID, reinterpret_cast(&pos), 3); - else - services->setVertexShaderConstant(reinterpret_cast(&pos), 8, 1); - - // set light color - - video::SColorf col(0.0f,1.0f,1.0f,0.0f); - - if (UseHighLevelShaders) - services->setVertexShaderConstant(ColorID, - reinterpret_cast(&col), 4); - else - services->setVertexShaderConstant(reinterpret_cast(&col), 9, 1); - - // set transposed world matrix - - core::matrix4 world = driver->getTransform(video::ETS_WORLD); - world = world.getTransposed(); - - if (UseHighLevelShaders) - { - services->setVertexShaderConstant(TransWorldID, world.pointer(), 16); - - // set texture, for textures you can use both an int and a float setPixelShaderConstant interfaces (You need it only for an OpenGL driver). - s32 TextureLayerID = 0; - services->setPixelShaderConstant(TextureID, &TextureLayerID, 1); - } - else - services->setVertexShaderConstant(world.pointer(), 10, 4); - } - -private: - s32 WorldViewProjID; - s32 TransWorldID; - s32 InvWorldID; - s32 PositionID; - s32 ColorID; - s32 TextureID; - - bool FirstUpdate; -}; - -/* -The next few lines start up the engine just like in most other tutorials -before. But in addition, we ask the user if he wants to use high level shaders -in this example, if he selected a driver which is capable of doing so. -*/ -int main() -{ - // ask user for driver - video::E_DRIVER_TYPE driverType=driverChoiceConsole(); - if (driverType==video::EDT_COUNT) - return 1; - - // ask the user if we should use high level shaders for this example - if (driverType == video::EDT_DIRECT3D9 || - driverType == video::EDT_OPENGL) - { - char i = 'y'; - printf("Please press 'y' if you want to use high level shaders.\n"); - std::cin >> i; - if (i == 'y') - { - UseHighLevelShaders = true; - } - } - - // create device - - device = createDevice(driverType, core::dimension2d(640, 480)); - - if (device == 0) - return 1; // could not create selected driver. - - - video::IVideoDriver* driver = device->getVideoDriver(); - scene::ISceneManager* smgr = device->getSceneManager(); - gui::IGUIEnvironment* gui = device->getGUIEnvironment(); - - const io::path mediaPath = getExampleMediaPath(); - - /* - Now for the more interesting parts. If we are using Direct3D, we want - to load vertex and pixel shader programs, if we have OpenGL, we want to - use ARB fragment and vertex programs. I wrote the corresponding - programs down into the files d3d9.ps, d3d9.vs, opengl.ps and opengl.vs. - We only need the right filenames now. This is done in the following switch. - Note, that it is not necessary to write the shaders into text files, - like in this example. You can even write the shaders directly as strings - into the cpp source file, and use later addShaderMaterial() instead of - addShaderMaterialFromFiles(). - */ - - io::path vsFileName; // filename for the vertex shader - io::path psFileName; // filename for the pixel shader - - switch(driverType) - { - case video::EDT_DIRECT3D9: - if (UseHighLevelShaders) - { - psFileName = mediaPath + "d3d9.hlsl"; - vsFileName = psFileName; // both shaders are in the same file - } - else - { - psFileName = mediaPath + "d3d9.psh"; - vsFileName = mediaPath + "d3d9.vsh"; - } - break; - - case video::EDT_OGLES1: - case video::EDT_OGLES2: - UseHighLevelShaders=true; - { - psFileName = "../../media/ogles2.frag"; - vsFileName = "../../media/ogles2.vert"; - } - break; - case video::EDT_OPENGL: - if (UseHighLevelShaders) - { - psFileName = mediaPath + "opengl.frag"; - vsFileName = mediaPath + "opengl.vert"; - } - else - { - psFileName = mediaPath + "opengl.psh"; - vsFileName = mediaPath + "opengl.vsh"; - } - break; - default: - break; - } - - /* - In addition, we check if the hardware and the selected renderer is - capable of executing the shaders we want. If not, we simply set the - filename string to 0. This is not necessary, but useful in this - example: For example, if the hardware is able to execute vertex shaders - but not pixel shaders, we create a new material which only uses the - vertex shader, and no pixel shader. Otherwise, if we would tell the - engine to create this material and the engine sees that the hardware - wouldn't be able to fulfill the request completely, it would not - create any new material at all. So in this example you would see at - least the vertex shader in action, without the pixel shader. - */ - - if (!driver->queryFeature(video::EVDF_PIXEL_SHADER_1_1) && - !driver->queryFeature(video::EVDF_ARB_FRAGMENT_PROGRAM_1)) - { - device->getLogger()->log("WARNING: Pixel shaders disabled "\ - "because of missing driver/hardware support."); - psFileName = ""; - } - - if (!driver->queryFeature(video::EVDF_VERTEX_SHADER_1_1) && - !driver->queryFeature(video::EVDF_ARB_VERTEX_PROGRAM_1)) - { - device->getLogger()->log("WARNING: Vertex shaders disabled "\ - "because of missing driver/hardware support."); - vsFileName = ""; - } - - /* - Now lets create the new materials. As you maybe know from previous - examples, a material type in the Irrlicht engine is set by simply - changing the MaterialType value in the SMaterial struct. And this value - is just a simple 32 bit value, like video::EMT_SOLID. So we only need - the engine to create a new value for us which we can set there. To do - this, we get a pointer to the IGPUProgrammingServices and call - addShaderMaterialFromFiles(), which returns such a new 32 bit value. - That's all. - - The parameters to this method are the following: First, the names of - the files containing the code of the vertex and the pixel shader. If - you would use addShaderMaterial() instead, you would not need file - names, then you could write the code of the shader directly as string. - The following parameter is a pointer to the IShaderConstantSetCallBack - class we wrote at the beginning of this tutorial. If you don't want to - set constants, set this to 0. The last parameter tells the engine which - material it should use as base material. - - To demonstrate this, we create two materials with a different base - material, one with EMT_SOLID and one with EMT_TRANSPARENT_ADD_COLOR. - */ - - // create materials - - video::IGPUProgrammingServices* gpu = driver->getGPUProgrammingServices(); - s32 newMaterialType1 = 0; - s32 newMaterialType2 = 0; - - if (gpu) - { - /* - Create one callback instance for each shader material you add. - Reason is that the getVertexShaderConstantID returns ID's which are - only valid per added material (The ID's tend to be identical - as long as the shader code is exactly identical, but it's not good - style to depend on that). - */ - MyShaderCallBack* mcSolid = new MyShaderCallBack(); - MyShaderCallBack* mcTransparentAdd = new MyShaderCallBack(); - - // create the shaders depending on if the user wanted high level - // or low level shaders: - - if (UseHighLevelShaders) - { - // create material from high level shaders (hlsl, glsl) - - newMaterialType1 = gpu->addHighLevelShaderMaterialFromFiles( - vsFileName, "vertexMain", video::EVST_VS_1_1, - psFileName, "pixelMain", video::EPST_PS_1_1, - mcSolid, video::EMT_SOLID, 0); - - newMaterialType2 = gpu->addHighLevelShaderMaterialFromFiles( - vsFileName, "vertexMain", video::EVST_VS_1_1, - psFileName, "pixelMain", video::EPST_PS_1_1, - mcTransparentAdd, video::EMT_TRANSPARENT_ADD_COLOR, 0); - } - else - { - // create material from low level shaders (asm or arb_asm) - - newMaterialType1 = gpu->addShaderMaterialFromFiles(vsFileName, - psFileName, mcSolid, video::EMT_SOLID); - - newMaterialType2 = gpu->addShaderMaterialFromFiles(vsFileName, - psFileName, mcTransparentAdd, video::EMT_TRANSPARENT_ADD_COLOR); - } - - mcSolid->drop(); - mcTransparentAdd->drop(); - } - - /* - Now it's time for testing the materials. We create a test cube and set - the material we created. In addition, we add a text scene node to the - cube and a rotation animator to make it look more interesting and - important. - */ - - // create test scene node 1, with the new created material type 1 - - scene::ISceneNode* node = smgr->addCubeSceneNode(50); - node->setPosition(core::vector3df(0,0,0)); - node->setMaterialTexture(0, driver->getTexture(mediaPath + "wall.bmp")); - node->setMaterialFlag(video::EMF_LIGHTING, false); - node->setMaterialType((video::E_MATERIAL_TYPE)newMaterialType1); - - smgr->addTextSceneNode(gui->getBuiltInFont(), - L"PS & VS & EMT_SOLID", - video::SColor(255,255,255,255), node); - - scene::ISceneNodeAnimator* anim = smgr->createRotationAnimator( - core::vector3df(0,0.3f,0)); - node->addAnimator(anim); - anim->drop(); - - /* - Same for the second cube, but with the second material we created. - */ - - // create test scene node 2, with the new created material type 2 - - node = smgr->addCubeSceneNode(50); - node->setPosition(core::vector3df(0,-10,50)); - node->setMaterialTexture(0, driver->getTexture(mediaPath + "wall.bmp")); - node->setMaterialFlag(video::EMF_LIGHTING, false); - node->setMaterialFlag(video::EMF_BLEND_OPERATION, true); - node->setMaterialType((video::E_MATERIAL_TYPE)newMaterialType2); - - smgr->addTextSceneNode(gui->getBuiltInFont(), - L"PS & VS & EMT_TRANSPARENT", - video::SColor(255,255,255,255), node); - - anim = smgr->createRotationAnimator(core::vector3df(0,0.3f,0)); - node->addAnimator(anim); - anim->drop(); - - /* - Then we add a third cube without a shader on it, to be able to compare - the cubes. - */ - - // add a scene node with no shader - - node = smgr->addCubeSceneNode(50); - node->setPosition(core::vector3df(0,50,25)); - node->setMaterialTexture(0, driver->getTexture(mediaPath + "wall.bmp")); - node->setMaterialFlag(video::EMF_LIGHTING, false); - smgr->addTextSceneNode(gui->getBuiltInFont(), L"NO SHADER", - video::SColor(255,255,255,255), node); - - /* - And last, we add a skybox and a user controlled camera to the scene. - For the skybox textures, we disable mipmap generation, because we don't - need mipmaps on it. - */ - - // add a nice skybox - - driver->setTextureCreationFlag(video::ETCF_CREATE_MIP_MAPS, false); - - smgr->addSkyBoxSceneNode( - driver->getTexture(mediaPath + "irrlicht2_up.jpg"), - driver->getTexture(mediaPath + "irrlicht2_dn.jpg"), - driver->getTexture(mediaPath + "irrlicht2_lf.jpg"), - driver->getTexture(mediaPath + "irrlicht2_rt.jpg"), - driver->getTexture(mediaPath + "irrlicht2_ft.jpg"), - driver->getTexture(mediaPath + "irrlicht2_bk.jpg")); - - driver->setTextureCreationFlag(video::ETCF_CREATE_MIP_MAPS, true); - - // add a camera and disable the mouse cursor - - scene::ICameraSceneNode* cam = smgr->addCameraSceneNodeFPS(); - cam->setPosition(core::vector3df(-100,50,100)); - cam->setTarget(core::vector3df(0,0,0)); - device->getCursorControl()->setVisible(false); - - /* - Now draw everything. That's all. - */ - - int lastFPS = -1; - - while(device->run()) - if (device->isWindowActive()) - { - driver->beginScene(video::ECBF_COLOR | video::ECBF_DEPTH, video::SColor(255,0,0,0)); - smgr->drawAll(); - driver->endScene(); - - int fps = driver->getFPS(); - - if (lastFPS != fps) - { - core::stringw str = L"Irrlicht Engine - Vertex and pixel shader example ["; - str += driver->getName(); - str += "] FPS:"; - str += fps; - - device->setWindowCaption(str.c_str()); - lastFPS = fps; - } - } - - device->drop(); - - return 0; -} - -/* -Compile and run this, and I hope you have fun with your new little shader -writing tool :). -**/ diff --git a/examples/10.Shaders/tutorial.html b/examples/10.Shaders/tutorial.html deleted file mode 100644 index 05c4f08a..00000000 --- a/examples/10.Shaders/tutorial.html +++ /dev/null @@ -1,566 +0,0 @@ - - -Irrlicht Engine Tutorial - - - - -
- - - - - - - - -
-
-
Tutorial 10. Shaders
-
-
-
-

This tutorial shows how to use shaders for D3D8, D3D9 and OpenGL with - the engine and how to create new material types with them. It also shows - how to disable the generation of mipmaps at texture loading, and how - to use text scene nodes.

-

This tutorial does not explain how shaders work. I would recommend - to read the D3D or OpenGL documentation, to search a tutorial, or to - read a book about this.

-

The program which is described here will look like this:

-


-

-
-
-
- - - - - - - -
Lets start!
-
-

At first, we need to include all headers and do the stuff we always - do, like in nearly all other tutorials:

- - - - -
#include <irrlicht.h>
#include <iostream>

using namespace irr;

#pragma comment(lib, "Irrlicht.lib")
-

Because we want to use some interesting shaders in this tutorials, - we need to set some data for them to make them able to compute nice - colors. In this example, we'll use a simple vertex shader which will - calculate the color of the vertex based on the position of the camera. - For this, the shader needs the following data: The inverted world - matrix for transforming the normal, the clip matrix for transforming - the position, the camera position and the world position of the object - for the calculation of the angle of light, and the color of the light. - To be able to tell the shader all this data every frame, we have to - derive a class from the IShaderConstantSetCallBack interface and override - its only method, namely OnSetConstants(). This method will be called - every time the material is set.
- The method setVertexShaderConstant() of the IMaterialRendererServices - interface is used to set the data the shader needs. If the user chose - to use a High Level shader language like HLSL instead of Assembler - in this example, you have to set the variable name as parameter instead - of the register index.

- - - - -
IrrlichtDevice* device = 0;
bool UseHighLevelShaders = false;

class MyShaderCallBack : public video::IShaderConstantSetCallBack
{
public: -
virtual void OnSetConstants(video::IMaterialRendererServices* services, s32 userData)
{
video::IVideoDriver* driver = services->getVideoDriver();

// set inverted world matrix
// if we are using highlevel shaders (the user can select this when
// starting the program), we must set the constants by name.

core::matrix4 invWorld = driver->getTransform(video::ETS_WORLD);
invWorld.makeInverse();

if (UseHighLevelShaders)
services->setVertexShaderConstant("mInvWorld", &invWorld.M[0], 16);
else
services->setVertexShaderConstant(&invWorld.M[0], 0, 4);

// set clip matrix
core::matrix4 worldViewProj;
worldViewProj = driver->getTransform(video::ETS_PROJECTION);
worldViewProj *= driver->getTransform(video::ETS_VIEW);
worldViewProj *= driver->getTransform(video::ETS_WORLD);

if (UseHighLevelShaders)
services->setVertexShaderConstant("mWorldViewProj", &worldViewProj.M[0], 16);
else
services->setVertexShaderConstant(&worldViewProj.M[0], 4, 4);

// set camera position
core::vector3df pos = device->getSceneManager()->
getActiveCamera()->getAbsolutePosition();

if (UseHighLevelShaders)
services->setVertexShaderConstant("mLightPos", reinterpret_cast<f32*>(&pos), 3);
else
services->setVertexShaderConstant(reinterpret_cast<f32*>(&pos), 8, 1);

// set light color
video::SColorf col(0.0f,1.0f,1.0f,0.0f);

if (UseHighLevelShaders)
services->setVertexShaderConstant("mLightColor", reinterpret_cast<f32*>(&col), 4);
else
services->setVertexShaderConstant(reinterpret_cast<f32*>(&col), 9, 1);

// set transposed world matrix
core::matrix4 world = driver->getTransform(video::ETS_WORLD);
world = world.getTransposed();

if (UseHighLevelShaders)
services->setVertexShaderConstant("mTransWorld", &world.M[0], 16);
else
services->setVertexShaderConstant(&world.M[0], 10, 4);
}
};
-

The next few lines start up the engine. Just like in most other - tutorials before. But in addition, we ask the user if he wants this - example to use high level shaders if he selected a driver which is - capable of doing so.

- - - - -
int main()
{
// let user select driver type

video::E_DRIVER_TYPE driverType = video::EDT_DIRECTX9;

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;
}

// ask the user if we should use high level shaders for this example
if (driverType == video::EDT_DIRECT3D9 ||
driverType == video::EDT_OPENGL) - {
printf("Please press 'y' if you want to use high level shaders.\n");
std::cin >> i;
if (i == 'y')
UseHighLevelShaders = true;
}

// create device

device = createDevice(driverType, core::dimension2d<s32>(640, 480));

if (device == 0)
{
printf("\nWas not able to create driver.\n"\
"Please restart and select another driver.\n"
);
getch();
return 1;
}

video::IVideoDriver* driver = device->getVideoDriver();
scene::ISceneManager* smgr = device->getSceneManager();
gui::IGUIEnvironment* gui = device->getGUIEnvironment();
-

Now for the more interesting parts. If we are using Direct3D, we - want to load vertex and pixel shader programs, if we have
- OpenGL, we want to use ARB fragment and vertex programs. I wrote the - corresponding programs down into the files d3d8.ps, d3d8.vs, d3d9.ps, - d3d9.vs, opengl.ps and opengl.vs. We only need the right filenames - now. This is done in the following switch. Note, that it is not necessary - to write the shaders into text files, like in this example. You can - even write the shaders directly as strings into the cpp source file, - and use later addShaderMaterial() instead of addShaderMaterialFromFiles().

- - - - -
	c8* vsFileName = 0; // filename for the vertex shader
c8* psFileName = 0; // filename for the pixel shader

switch(driverType)
{
case video::EDT_DIRECT3D8:
psFileName = "../../media/d3d8.psh";
vsFileName = "../../media/d3d8.vsh";
break;
case video::EDT_DIRECT3D9:
if (UseHighLevelShaders)
{
psFileName = "../../media/d3d9.hlsl";
vsFileName = psFileName; // both shaders are in the same file
}
else
{
psFileName = "../../media/d3d9.psh";
vsFileName = "../../media/d3d9.vsh";
}
break;
case video::EDT_OPENGL:
if (UseHighLevelShaders)
{
psFileName = "../../media/opengl.frag";
vsFileName = "../../media/opengl.vert";
}
else
{
psFileName = "../../media/opengl.psh";
vsFileName = "../../media/opengl.vsh";
}
break;
}
-
-

In addition, we check if the hardware and the selected renderer - is capable of executing the shaders we want. If not, we simply set - the filename string to 0. This is not necessary, but useful in this - example: For example, if the hardware is able to execute vertex shaders - but not pixel shaders, we create a new material which only uses the - vertex shader, and no pixel shader. Otherwise, if we would tell the - engine to create this material and the engine sees that the hardware - wouldn't be able to fullfill the request completely,
- it would not create any new material at all. So in this example you - would see at least the vertex shader in action, without the pixel - shader.

-
- - - - -
	if (!driver->queryFeature(video::EVDF_PIXEL_SHADER_1_1) &&
!driver->queryFeature(video::EVDF_ARB_FRAGMENT_PROGRAM_1))
{
device->getLogger()->log("WARNING: Pixel shaders disabled "\
"because of missing driver/hardware support.");
psFileName = 0;
}

if (!driver->queryFeature(video::EVDF_VERTEX_SHADER_1_1) &&
!driver->queryFeature(video::EVDF_ARB_VERTEX_PROGRAM_1))
{
device->getLogger()->log("WARNING: Vertex shaders disabled "\
"because of missing driver/hardware support.");
vsFileName = 0;
}
-

Now lets create the new materials.
- As you maybe know from previous examples, a material type in the Irrlicht - engine is set by simply changing the MaterialType value in the SMaterial - struct. And this value is just a simple 32 bit value, like video::EMT_SOLID. - So we only need the engine to create a new value for us which we can - set there. To do this, we get a pointer to the IGPUProgrammingServices - and call addShaderMaterialFromFiles(), which returns such a new 32 bit - value. That's all.
- The parameters to this method are the following: First, the names of - the files containing the code of the vertex and the pixel shader.
- If you would use addShaderMaterial() instead, you would not need file - names, then you could write the code of the shader directly as string. - The following parameter is a pointer to the IShaderConstantSetCallBack - class we wrote at the beginning of this tutorial. If you don't want - to set constants, set this to 0. The last paramter tells the engine - which material it should use as base material.
- To demonstrate this, we create two materials with a different base material, - one with EMT_SOLID and one with EMT_TRANSPARENT_ADD_COLOR.

- - - - -
	// create materials

video::IGPUProgrammingServices* gpu = driver->getGPUProgrammingServices();

s32 newMaterialType1 = 0;
s32 newMaterialType2 = 0;

if (gpu)
{
MyShaderCallBack* mc = new MyShaderCallBack();
- // create the shaders depending on if the user wanted high level
// or low level shaders:


if (UseHighLevelShaders)
{
// create material from high level shaders (hlsl or glsl)

newMaterialType1 = gpu->addHighLevelShaderMaterialFromFiles(
vsFileName, "vertexMain", video::EVST_VS_1_1,
psFileName, "pixelMain", video::EPST_PS_1_1,
mc, video::EMT_SOLID);

newMaterialType2 = gpu->addHighLevelShaderMaterialFromFiles(
vsFileName, "vertexMain", video::EVST_VS_1_1,
psFileName, "pixelMain", video::EPST_PS_1_1,
mc, video::EMT_TRANSPARENT_ADD_COLOR);
}
else
{
// create material from low level shaders (asm or arb_asm)

newMaterialType1 = gpu->addShaderMaterialFromFiles(vsFileName,
psFileName, mc, video::EMT_SOLID);

newMaterialType2 = gpu->addShaderMaterialFromFiles(vsFileName,
psFileName, mc, video::EMT_TRANSPARENT_ADD_COLOR);
}

mc->drop();
}
-

Now its time for testing out the materials. We create a test cube - and set the material we created. In addition, we add a text scene node - to the cube and a rotatation animator, to make it look more interesting - and important.

- - - - -

-	// create test scene node 1, with the new created material type 1
-
-	scene::ISceneNode* node = smgr->addCubeSceneNode(50);
-	node->setPosition(core::vector3df(0,0,0));
-	node->setMaterialTexture(0, driver->getTexture("../../media/wall.bmp"));
-	node->setMaterialFlag(video::EMF_LIGHTING, false);
-	node->setMaterialType((video::E_MATERIAL_TYPE)newMaterialType1);
-
-	smgr->addTextSceneNode(gui->getBuiltInFont(),
-			L"PS & VS & EMT_SOLID",
-			video::SColor(255,255,255,255),	node);
-
-	scene::ISceneNodeAnimator* anim = smgr->createRotationAnimator(
-			core::vector3df(0,0.3f,0));
-	node->addAnimator(anim);
-	anim->drop();
-

Same for the second cube, but with the second material we created.

- - - - -
	// create test scene node 2, with the new created material type 2
-
-	node = smgr->addCubeSceneNode(50);
-	node->setPosition(core::vector3df(0,-10,50));
-	node->setMaterialTexture(0, driver->getTexture("../../media/wall.bmp"));
-	node->setMaterialFlag(video::EMF_LIGHTING, false);
-	node->setMaterialType((video::E_MATERIAL_TYPE)newMaterialType2);
-
-	smgr->addTextSceneNode(gui->getBuiltInFont(),
-			L"PS & VS & EMT_TRANSPARENT",
-			video::SColor(255,255,255,255),	node);
-
-	anim = smgr->createRotationAnimator(core::vector3df(0,0.3f,0));
-	node->addAnimator(anim);
-	anim->drop();
-
- Then we add a third cube without a shader on it, to be able to compare - the cubes.
-
- - - - -
	// add a scene node with no shader 
-
-	node = smgr->addCubeSceneNode(50);
-	node->setPosition(core::vector3df(0,50,25));
-	node->setMaterialTexture(0, driver->getTexture("../../media/wall.bmp"));
-	node->setMaterialFlag(video::EMF_LIGHTING, false);
-	smgr->addTextSceneNode(gui->getBuiltInFont(), L"NO SHADER",
-		video::SColor(255,255,255,255), node);
-            
-
- And last, we add a skybox and a user controlled camera to the scene. For - the skybox textures, we disable mipmap generation, because we don't need - mipmaps on it.
-
- - - - -
	// add a nice skybox

driver->setTextureCreationFlag(video::ETCF_CREATE_MIP_MAPS, false);

smgr->addSkyBoxSceneNode(
driver->getTexture("../../media/irrlicht2_up.jpg"),
driver->getTexture("../../media/irrlicht2_dn.jpg"),
driver->getTexture("../../media/irrlicht2_lf.jpg"),
driver->getTexture("../../media/irrlicht2_rt.jpg"),
driver->getTexture("../../media/irrlicht2_ft.jpg"),
driver->getTexture("../../media/irrlicht2_bk.jpg"));

driver->setTextureCreationFlag(video::ETCF_CREATE_MIP_MAPS, true);

// add a camera and disable the mouse cursor

scene::ICameraSceneNode* cam = smgr->addCameraSceneNodeFPS(0, 100.0f, 100.0f);
cam->setPosition(core::vector3df(-100,50,100));
cam->setTarget(core::vector3df(0,0,0));
device->getCursorControl()->setVisible(false);
-
- Now draw everything. That's all.
-
- - - - -
	int lastFPS = -1;

while(device->run())
if (device->isWindowActive())
{
driver->beginScene(true, true, video::SColor(255,0,0,0));
smgr->drawAll();
driver->endScene();

int fps = driver->getFPS();

if (lastFPS != fps)
{
core::stringw str = L"Irrlicht Engine - Vertex and pixel shader example [";
str += driver->getName();
str += "] FPS:";
str += fps;
device->setWindowCaption(str.c_str());
lastFPS = fps;
}
}

device->drop();

return 0;
-
- Compile and run this, and I hope you have fun with your new little shader - writing tool :).
-
-
-
- - - - - - - -
Shader files
-
-

The files containing the shaders can be found in the media directory - of the SDK. However, they look like this:

- - - - - - - -
D3D9.HLSL
-
-// part of the Irrlicht Engine Shader example.
-// These simple Direct3D9 pixel and vertex shaders will be loaded by the shaders
-// example. Please note that these example shaders don't do anything really useful. 
-// They only demonstrate that shaders can be used in Irrlicht.
-
-//-----------------------------------------------------------------------------
-// Global variables
-//-----------------------------------------------------------------------------
-float4x4 mWorldViewProj;  // World * View * Projection transformation
-float4x4 mInvWorld;       // Inverted world matrix
-float4x4 mTransWorld;     // Transposed world matrix
-float3 mLightPos;         // Light position
-float4 mLightColor;       // Light color
-
-
-// Vertex shader output structure
-struct VS_OUTPUT
-{
-	float4 Position   : POSITION;   // vertex position 
-	float4 Diffuse    : COLOR0;     // vertex diffuse color
-	float2 TexCoord   : TEXCOORD0;  // tex coords
-};
-
-
-VS_OUTPUT vertexMain( in float4 vPosition : POSITION,
-                      in float3 vNormal   : NORMAL,
-                      float2 texCoord     : TEXCOORD0 )
-{
-	VS_OUTPUT Output;
-
-	// transform position to clip space 
-	Output.Position = mul(vPosition, mWorldViewProj);
-	
-	// transform normal 
-	float3 normal = mul(vNormal, mInvWorld);
-	
-	// renormalize normal 
-	normal = normalize(normal);
-	
-	// position in world coodinates
-	float3 worldpos = mul(mTransWorld, vPosition);
-	
-	// calculate light vector, vtxpos - lightpos
-	float3 lightVector = worldpos - mLightPos;
-	
-	// normalize light vector 
-	lightVector = normalize(lightVector);
-	
-	// calculate light color 
-	float3 tmp = dot(-lightVector, normal);
-	tmp = lit(tmp.x, tmp.y, 1.0);
-	
-	tmp = mLightColor * tmp.y;
-	Output.Diffuse = float4(tmp.x, tmp.y, tmp.z, 0);
-	Output.TexCoord = texCoord;
-	
-	return Output;
-}
-
-
-
-// Pixel shader output structure
-struct PS_OUTPUT
-{
-    float4 RGBColor : COLOR0;  // Pixel color    
-};
-
-
-sampler2D tex0;
-	
-PS_OUTPUT pixelMain( float2 TexCoord : TEXCOORD0,
-                     float4 Position : POSITION,
-                     float4 Diffuse  : COLOR0 ) 
-{ 
-	PS_OUTPUT Output;
-
-	float4 col = tex2D( tex0, TexCoord );  // sample color map
-	
-	// multiply with diffuse and do other senseless operations
-	Output.RGBColor = Diffuse * col;
-	Output.RGBColor *= 4.0;
-
-	return Output;
-}
-
- - - - - - - -
D3D9.VSH
-; part of the Irrlicht Engine Shader example.
-; This Direct3D9 vertex shader will be loaded by the engine.
-; Please note that these example shaders don't do anything really useful. 
-; They only demonstrate that shaders can be used in Irrlicht.
-vs.1.1 - -dcl_position v0; ; declare position -dcl_normal v1; ; declare normal -dcl_color v2; ; declare color -dcl_texcoord0 v3; ; declare texture coordinate
-; transpose and transform position to clip space -mul r0, v0.x, c4 -mad r0, v0.y, c5, r0 -mad r0, v0.z, c6, r0 -add oPos, c7, r0 - -; transform normal -dp3 r1.x, v1, c0 -dp3 r1.y, v1, c1 -dp3 r1.z, v1, c2 - -; renormalize normal -dp3 r1.w, r1, r1 -rsq r1.w, r1.w -mul r1, r1, r1.w - -; calculate light vector -m4x4 r6, v0, c10 ; vertex into world position -add r2, c8, -r6 ; vtxpos - lightpos - -; normalize light vector -dp3 r2.w, r2, r2 -rsq r2.w, r2.w -mul r2, r2, r2.w - -; calculate light color -dp3 r3, r1, r2 ; dp3 with negative light vector -lit r5, r3 ; clamp to zero if r3 < 0, r5 has diffuce component in r5.y -mul oD0, r5.y, c9 ; ouput diffuse color -mov oT0, v3 ; store texture coordinates
-
- - - - - - - -
D3D9.PSH
-; part of the Irrlicht Engine Shader example.
-; This simple Direct3D9 pixel shader will be loaded by the engine.
-; Please note that these example shaders don't do anything really useful. 
-; They only demonstrate that shaders can be used in Irrlicht.
-ps.1.1 - -tex t0 ; sample color map -add r0, v0, v0 ; mulitply with color -mul t0, t0, r0 ; mulitply with color -add r0, t0, t0 ; make it brighter and store result -
-
- - - - - - - -
D3D8.VSH
-; part of the Irrlicht Engine Shader example.
-; This Direct3D9 vertex shader will be loaded by the engine.
-; Please note that these example shaders don't do anything really useful. 
-; They only demonstrate that shaders can be used in Irrlicht.
-vs.1.1 - -; transpose and transform position to clip space -mul r0, v0.x, c4 -mad r0, v0.y, c5, r0 -mad r0, v0.z, c6, r0 -add oPos, c7, r0 - -; transform normal -dp3 r1.x, v1, c0 -dp3 r1.y, v1, c1 -dp3 r1.z, v1, c2 - -; renormalize normal -dp3 r1.w, r1, r1 -rsq r1.w, r1.w -mul r1, r1, r1.w - -; calculate light vector -m4x4 r6, v0, c10 ; vertex into world position -add r2, c8, -r6 ; vtxpos - lightpos - -; normalize light vector -dp3 r2.w, r2, r2 -rsq r2.w, r2.w -mul r2, r2, r2.w - -; calculate light color -dp3 r3, r1, r2 ; dp3 with negative light vector -lit r5, r3 ; clamp to zero if r3 < 0, r5 has diffuce component in r5.y -mul oD0, r5.y, c9 ; ouput diffuse color -mov oT0, v3 ; store texture coordinates
-
- - - - - - - -
D3D8.PSH
-; part of the Irrlicht Engine Shader example.
-; This simple Direct3D9 pixel shader will be loaded by the engine.
-; Please note that these example shaders don't do anything really useful. 
-; They only demonstrate that shaders can be used in Irrlicht.
-ps.1.1 - -tex t0 ; sample color map -mul_x2 t0, t0, v0 ; mulitply with color -add r0, t0, t0 ; make it brighter and store result
-
- - - - - - - -
OPENGL.VSH
-!!ARBvp1.0
-# part of the Irrlicht Engine Shader example.
-# Please note that these example shaders don't do anything really useful. 
-# They only demonstrate that shaders can be used in Irrlicht.
-#input -ATTRIB InPos = vertex.position; -ATTRIB InColor = vertex.color; -ATTRIB InNormal = vertex.normal; -ATTRIB InTexCoord = vertex.texcoord; - -#output -OUTPUT OutPos = result.position; -OUTPUT OutColor = result.color; -OUTPUT OutTexCoord = result.texcoord; - -PARAM MVP[4] = { state.matrix.mvp }; # modelViewProjection matrix. -TEMP Temp; -TEMP TempColor; -TEMP TempNormal; -TEMP TempPos; - -#transform position to clip space -DP4 Temp.x, MVP[0], InPos; -DP4 Temp.y, MVP[1], InPos; -DP4 Temp.z, MVP[2], InPos; -DP4 Temp.w, MVP[3], InPos; - -#transform normal -DP3 TempNormal.x, InNormal.x, program.local[0]; -DP3 TempNormal.y, InNormal.y, program.local[1]; -DP3 TempNormal.z, InNormal.z, program.local[2]; - -#renormalize normal -DP3 TempNormal.w, TempNormal, TempNormal; -RSQ TempNormal.w, TempNormal.w; -MUL TempNormal, TempNormal, TempNormal.w; - -# calculate light vector -DP4 TempPos.x, InPos, program.local[10]; # vertex into world position -DP4 TempPos.y, InPos, program.local[11]; -DP4 TempPos.z, InPos, program.local[12]; -DP4 TempPos.w, InPos, program.local[13]; - -ADD TempPos, program.local[8], -TempPos; # vtxpos - lightpos - -# normalize light vector -DP3 TempPos.w, TempPos, TempPos; -RSQ TempPos.w, TempPos.w; -MUL TempPos, TempPos, TempPos.w; - -# calculate light color -DP3 TempColor, TempNormal, TempPos; # dp3 with negative light vector -LIT OutColor, TempColor; # clamp to zero if r3 < 0, r5 has diffuce component in r5.y -MUL OutColor, TempColor.y, program.local[9]; # ouput diffuse color -MOV OutColor.w, 1.0; # we want alpha to be always 1 -MOV OutTexCoord, InTexCoord; # store texture coordinate -MOV OutPos, Temp; - -END
-
- - - - - - - -
OPENGL.PSH
-!!ARBfp1.0
-# part of the Irrlicht Engine Shader example.
-# Please note that these example shaders don't do anything really useful. 
-# They only demonstrate that shaders can be used in Irrlicht.
-#Input -ATTRIB inTexCoord = fragment.texcoord; # texture coordinates -ATTRIB inColor = fragment.color.primary; # interpolated diffuse color - -#Output -OUTPUT outColor = result.color; - -TEMP texelColor; -TEMP tmp; -TXP texelColor, inTexCoord, texture, 2D; - -ADD tmp, inColor, inColor; # mulitply with color -MUL texelColor, texelColor, tmp; # mulitply with color -ADD outColor, texelColor, texelColor; # make it brighter and store result - -END
-

 

-
-
-

 

-

 

- - diff --git a/examples/11.PerPixelLighting/Makefile b/examples/11.PerPixelLighting/Makefile deleted file mode 100644 index fddcd343..00000000 --- a/examples/11.PerPixelLighting/Makefile +++ /dev/null @@ -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 := 11.PerPixelLighting -# 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 diff --git a/examples/11.PerPixelLighting/PerPixelLighting.cbp b/examples/11.PerPixelLighting/PerPixelLighting.cbp deleted file mode 100644 index 709dd850..00000000 --- a/examples/11.PerPixelLighting/PerPixelLighting.cbp +++ /dev/null @@ -1,56 +0,0 @@ - - - - - - diff --git a/examples/11.PerPixelLighting/PerPixelLighting.vcproj b/examples/11.PerPixelLighting/PerPixelLighting.vcproj deleted file mode 100644 index 94d7e6a7..00000000 --- a/examples/11.PerPixelLighting/PerPixelLighting.vcproj +++ /dev/null @@ -1,163 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/examples/11.PerPixelLighting/PerPixelLighting.xcodeproj/project.pbxproj b/examples/11.PerPixelLighting/PerPixelLighting.xcodeproj/project.pbxproj deleted file mode 100644 index cac51bca..00000000 --- a/examples/11.PerPixelLighting/PerPixelLighting.xcodeproj/project.pbxproj +++ /dev/null @@ -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 /* 11.PerPixelLighting.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = 11.PerPixelLighting.app; sourceTree = BUILT_PRODUCTS_DIR; }; - 5E34CC741B7F8EEF00F212E8 /* main.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = main.cpp; sourceTree = ""; }; - 5E34CC781B7F90A000F212E8 /* libIrrlicht.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libIrrlicht.a; path = ../../lib/OSX/libIrrlicht.a; sourceTree = ""; }; - 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 = ""; }; -/* 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 = ""; - }; - 5E34CC521B7F8E6E00F212E8 /* Products */ = { - isa = PBXGroup; - children = ( - 5E34CC511B7F8E6E00F212E8 /* 11.PerPixelLighting.app */, - ); - name = Products; - sourceTree = ""; - }; - 5E34CC761B7F905600F212E8 /* Libraries */ = { - isa = PBXGroup; - children = ( - 5E8570B01B7F99F500B267D2 /* Cocoa.framework */, - 5E8570B41B7F9A0700B267D2 /* IOKit.framework */, - 5E8570B21B7F99FE00B267D2 /* OpenGL.framework */, - 5E34CC781B7F90A000F212E8 /* libIrrlicht.a */, - ); - name = Libraries; - sourceTree = ""; - }; - 5E34CC771B7F906D00F212E8 /* Resources */ = { - isa = PBXGroup; - children = ( - 5E8570BE1B7F9D3A00B267D2 /* media */, - ); - name = Resources; - sourceTree = ""; - }; -/* End PBXGroup section */ - -/* Begin PBXNativeTarget section */ - 5E34CC501B7F8E6E00F212E8 /* 11.PerPixelLighting */ = { - isa = PBXNativeTarget; - buildConfigurationList = 5E34CC701B7F8E6E00F212E8 /* Build configuration list for PBXNativeTarget "11.PerPixelLighting" */; - buildPhases = ( - 5E34CC4D1B7F8E6E00F212E8 /* Sources */, - 5E34CC4E1B7F8E6E00F212E8 /* Frameworks */, - 5E34CC4F1B7F8E6E00F212E8 /* Resources */, - ); - buildRules = ( - ); - dependencies = ( - ); - name = 11.PerPixelLighting; - productName = 01.HelloWorld; - productReference = 5E34CC511B7F8E6E00F212E8 /* 11.PerPixelLighting.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 "PerPixelLighting" */; - compatibilityVersion = "Xcode 3.2"; - developmentRegion = English; - hasScannedForEncodings = 0; - knownRegions = ( - en, - Base, - ); - mainGroup = 5E34C6D81B7F4A0C00F212E8; - productRefGroup = 5E34CC521B7F8E6E00F212E8 /* Products */; - projectDirPath = ""; - projectRoot = ""; - targets = ( - 5E34CC501B7F8E6E00F212E8 /* 11.PerPixelLighting */, - ); - }; -/* 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 "PerPixelLighting" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 5E34C6DD1B7F4A0C00F212E8 /* Debug */, - 5E34C6DE1B7F4A0C00F212E8 /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - 5E34CC701B7F8E6E00F212E8 /* Build configuration list for PBXNativeTarget "11.PerPixelLighting" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 5E34CC6C1B7F8E6E00F212E8 /* Debug */, - 5E34CC6D1B7F8E6E00F212E8 /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; -/* End XCConfigurationList section */ - }; - rootObject = 5E34C6D91B7F4A0C00F212E8 /* Project object */; -} diff --git a/examples/11.PerPixelLighting/PerPixelLighting.xcodeproj/xcshareddata/xcschemes/11.PerPixelLighting.xcscheme b/examples/11.PerPixelLighting/PerPixelLighting.xcodeproj/xcshareddata/xcschemes/11.PerPixelLighting.xcscheme deleted file mode 100644 index ddd1fcf4..00000000 --- a/examples/11.PerPixelLighting/PerPixelLighting.xcodeproj/xcshareddata/xcschemes/11.PerPixelLighting.xcscheme +++ /dev/null @@ -1,91 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/examples/11.PerPixelLighting/PerPixelLighting_vc10.vcxproj b/examples/11.PerPixelLighting/PerPixelLighting_vc10.vcxproj deleted file mode 100644 index 2179bc44..00000000 --- a/examples/11.PerPixelLighting/PerPixelLighting_vc10.vcxproj +++ /dev/null @@ -1,235 +0,0 @@ - - - - - Debug - Win32 - - - Debug - x64 - - - Release - Win32 - - - Release - x64 - - - - 11.PerPixelLighting - {C4B42409-542D-4EFC-9E6B-44713FD47A33} - PerPixelLighting - - - - Application - false - MultiByte - Windows7.1SDK - - - Application - false - MultiByte - Windows7.1SDK - - - Application - false - MultiByte - Windows7.1SDK - - - Application - false - MultiByte - Windows7.1SDK - - - - - - - - - - - - - - - - - - - - - - - <_ProjectFileVersion>10.0.30319.1 - ..\..\bin\Win32-VisualStudio\ - ..\..\bin\Win64-VisualStudio\ - - - ..\..\bin\Win32-VisualStudio\ - ..\..\bin\Win64-VisualStudio\ - - - AllRules.ruleset - AllRules.ruleset - - - - - AllRules.ruleset - AllRules.ruleset - - - - - - - - .\Debug/PerPixelLighting.tlb - - - - - Disabled - ..\..\include;%(AdditionalIncludeDirectories) - WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebug - - - Level3 - EditAndContinue - - - _DEBUG;%(PreprocessorDefinitions) - 0x0c07 - - - ..\..\bin\Win32-VisualStudio\11.PerPixelLighting.exe - ..\..\lib\Win32-visualstudio;%(AdditionalLibraryDirectories) - true - Console - - - - - - - .\Debug/PerPixelLighting.tlb - - - - - Disabled - ..\..\include;%(AdditionalIncludeDirectories) - WIN32;WIN64;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebug - - - Level3 - ProgramDatabase - - - _DEBUG;%(PreprocessorDefinitions) - 0x0c07 - - - ..\..\bin\Win64-VisualStudio\11.PerPixelLighting.exe - ..\..\lib\Win64-visualstudio;%(AdditionalLibraryDirectories) - true - Console - - - - - - - .\Release/PerPixelLighting.tlb - - - - - MaxSpeed - OnlyExplicitInline - ..\..\include;%(AdditionalIncludeDirectories) - WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) - true - MultiThreaded - true - - - Level3 - - - NDEBUG;%(PreprocessorDefinitions) - 0x0c07 - - - ..\..\bin\Win32-VisualStudio\11.PerPixelLighting.exe - ..\..\lib\Win32-visualstudio;%(AdditionalLibraryDirectories) - Console - - - - - - - .\Release/PerPixelLighting.tlb - - - - - MaxSpeed - OnlyExplicitInline - ..\..\include;%(AdditionalIncludeDirectories) - WIN32;WIN64;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) - true - MultiThreaded - true - - - Level3 - - - NDEBUG;%(PreprocessorDefinitions) - 0x0c07 - - - ..\..\bin\Win64-VisualStudio\11.PerPixelLighting.exe - ..\..\lib\Win64-visualstudio;%(AdditionalLibraryDirectories) - Console - - - - - - - Disabled - Disabled - %(AdditionalIncludeDirectories) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(PreprocessorDefinitions) - EnableFastChecks - EnableFastChecks - MaxSpeed - MaxSpeed - %(AdditionalIncludeDirectories) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(PreprocessorDefinitions) - - - - - - \ No newline at end of file diff --git a/examples/11.PerPixelLighting/PerPixelLighting_vc11.vcxproj b/examples/11.PerPixelLighting/PerPixelLighting_vc11.vcxproj deleted file mode 100644 index 2179bc44..00000000 --- a/examples/11.PerPixelLighting/PerPixelLighting_vc11.vcxproj +++ /dev/null @@ -1,235 +0,0 @@ - - - - - Debug - Win32 - - - Debug - x64 - - - Release - Win32 - - - Release - x64 - - - - 11.PerPixelLighting - {C4B42409-542D-4EFC-9E6B-44713FD47A33} - PerPixelLighting - - - - Application - false - MultiByte - Windows7.1SDK - - - Application - false - MultiByte - Windows7.1SDK - - - Application - false - MultiByte - Windows7.1SDK - - - Application - false - MultiByte - Windows7.1SDK - - - - - - - - - - - - - - - - - - - - - - - <_ProjectFileVersion>10.0.30319.1 - ..\..\bin\Win32-VisualStudio\ - ..\..\bin\Win64-VisualStudio\ - - - ..\..\bin\Win32-VisualStudio\ - ..\..\bin\Win64-VisualStudio\ - - - AllRules.ruleset - AllRules.ruleset - - - - - AllRules.ruleset - AllRules.ruleset - - - - - - - - .\Debug/PerPixelLighting.tlb - - - - - Disabled - ..\..\include;%(AdditionalIncludeDirectories) - WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebug - - - Level3 - EditAndContinue - - - _DEBUG;%(PreprocessorDefinitions) - 0x0c07 - - - ..\..\bin\Win32-VisualStudio\11.PerPixelLighting.exe - ..\..\lib\Win32-visualstudio;%(AdditionalLibraryDirectories) - true - Console - - - - - - - .\Debug/PerPixelLighting.tlb - - - - - Disabled - ..\..\include;%(AdditionalIncludeDirectories) - WIN32;WIN64;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebug - - - Level3 - ProgramDatabase - - - _DEBUG;%(PreprocessorDefinitions) - 0x0c07 - - - ..\..\bin\Win64-VisualStudio\11.PerPixelLighting.exe - ..\..\lib\Win64-visualstudio;%(AdditionalLibraryDirectories) - true - Console - - - - - - - .\Release/PerPixelLighting.tlb - - - - - MaxSpeed - OnlyExplicitInline - ..\..\include;%(AdditionalIncludeDirectories) - WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) - true - MultiThreaded - true - - - Level3 - - - NDEBUG;%(PreprocessorDefinitions) - 0x0c07 - - - ..\..\bin\Win32-VisualStudio\11.PerPixelLighting.exe - ..\..\lib\Win32-visualstudio;%(AdditionalLibraryDirectories) - Console - - - - - - - .\Release/PerPixelLighting.tlb - - - - - MaxSpeed - OnlyExplicitInline - ..\..\include;%(AdditionalIncludeDirectories) - WIN32;WIN64;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) - true - MultiThreaded - true - - - Level3 - - - NDEBUG;%(PreprocessorDefinitions) - 0x0c07 - - - ..\..\bin\Win64-VisualStudio\11.PerPixelLighting.exe - ..\..\lib\Win64-visualstudio;%(AdditionalLibraryDirectories) - Console - - - - - - - Disabled - Disabled - %(AdditionalIncludeDirectories) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(PreprocessorDefinitions) - EnableFastChecks - EnableFastChecks - MaxSpeed - MaxSpeed - %(AdditionalIncludeDirectories) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(PreprocessorDefinitions) - - - - - - \ No newline at end of file diff --git a/examples/11.PerPixelLighting/PerPixelLighting_vc12.vcxproj b/examples/11.PerPixelLighting/PerPixelLighting_vc12.vcxproj deleted file mode 100644 index ca2c3f4c..00000000 --- a/examples/11.PerPixelLighting/PerPixelLighting_vc12.vcxproj +++ /dev/null @@ -1,235 +0,0 @@ - - - - - Debug - Win32 - - - Debug - x64 - - - Release - Win32 - - - Release - x64 - - - - 11.PerPixelLighting - {C4B42409-542D-4EFC-9E6B-44713FD47A33} - PerPixelLighting - - - - Application - false - MultiByte - Windows7.1SDK - - - Application - false - MultiByte - Windows7.1SDK - - - Application - false - MultiByte - Windows7.1SDK - - - Application - false - MultiByte - Windows7.1SDK - - - - - - - - - - - - - - - - - - - - - - - <_ProjectFileVersion>10.0.30319.1 - ..\..\bin\Win32-VisualStudio\ - ..\..\bin\Win64-VisualStudio\ - - - ..\..\bin\Win32-VisualStudio\ - ..\..\bin\Win64-VisualStudio\ - - - AllRules.ruleset - AllRules.ruleset - - - - - AllRules.ruleset - AllRules.ruleset - - - - - - - - .\Debug/PerPixelLighting.tlb - - - - - Disabled - ..\..\include;%(AdditionalIncludeDirectories) - WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebug - - - Level3 - EditAndContinue - - - _DEBUG;%(PreprocessorDefinitions) - 0x0c07 - - - ..\..\bin\Win32-VisualStudio\11.PerPixelLighting.exe - ..\..\lib\Win32-visualstudio;%(AdditionalLibraryDirectories) - true - Console - - - - - - - .\Debug/PerPixelLighting.tlb - - - - - Disabled - ..\..\include;%(AdditionalIncludeDirectories) - WIN32;WIN64;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebug - - - Level3 - ProgramDatabase - - - _DEBUG;%(PreprocessorDefinitions) - 0x0c07 - - - ..\..\bin\Win64-VisualStudio\11.PerPixelLighting.exe - ..\..\lib\Win64-visualstudio;%(AdditionalLibraryDirectories) - true - Console - - - - - - - .\Release/PerPixelLighting.tlb - - - - - MaxSpeed - OnlyExplicitInline - ..\..\include;%(AdditionalIncludeDirectories) - WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) - true - MultiThreaded - true - - - Level3 - - - NDEBUG;%(PreprocessorDefinitions) - 0x0c07 - - - ..\..\bin\Win32-VisualStudio\11.PerPixelLighting.exe - ..\..\lib\Win32-visualstudio;%(AdditionalLibraryDirectories) - Console - - - - - - - .\Release/PerPixelLighting.tlb - - - - - MaxSpeed - OnlyExplicitInline - ..\..\include;%(AdditionalIncludeDirectories) - WIN32;WIN64;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) - true - MultiThreaded - true - - - Level3 - - - NDEBUG;%(PreprocessorDefinitions) - 0x0c07 - - - ..\..\bin\Win64-VisualStudio\11.PerPixelLighting.exe - ..\..\lib\Win64-visualstudio;%(AdditionalLibraryDirectories) - Console - - - - - - - Disabled - Disabled - %(AdditionalIncludeDirectories) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(PreprocessorDefinitions) - EnableFastChecks - EnableFastChecks - MaxSpeed - MaxSpeed - %(AdditionalIncludeDirectories) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(PreprocessorDefinitions) - - - - - - \ No newline at end of file diff --git a/examples/11.PerPixelLighting/PerPixelLighting_vc14.vcxproj b/examples/11.PerPixelLighting/PerPixelLighting_vc14.vcxproj deleted file mode 100644 index 3e6da846..00000000 --- a/examples/11.PerPixelLighting/PerPixelLighting_vc14.vcxproj +++ /dev/null @@ -1,235 +0,0 @@ - - - - - Debug - Win32 - - - Debug - x64 - - - Release - Win32 - - - Release - x64 - - - - 11.PerPixelLighting - {C4B42409-542D-4EFC-9E6B-44713FD47A33} - PerPixelLighting - - - - Application - false - MultiByte - v140 - - - Application - false - MultiByte - v140 - - - Application - false - MultiByte - v140 - - - Application - false - MultiByte - v140 - - - - - - - - - - - - - - - - - - - - - - - <_ProjectFileVersion>10.0.30319.1 - ..\..\bin\Win32-VisualStudio\ - ..\..\bin\Win64-VisualStudio\ - - - ..\..\bin\Win32-VisualStudio\ - ..\..\bin\Win64-VisualStudio\ - - - AllRules.ruleset - AllRules.ruleset - - - - - AllRules.ruleset - AllRules.ruleset - - - - - - - - .\Debug/PerPixelLighting.tlb - - - - - Disabled - ..\..\include;%(AdditionalIncludeDirectories) - WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebug - - - Level3 - EditAndContinue - - - _DEBUG;%(PreprocessorDefinitions) - 0x0c07 - - - ..\..\bin\Win32-VisualStudio\11.PerPixelLighting.exe - ..\..\lib\Win32-visualstudio;%(AdditionalLibraryDirectories) - true - Console - - - - - - - .\Debug/PerPixelLighting.tlb - - - - - Disabled - ..\..\include;%(AdditionalIncludeDirectories) - WIN32;WIN64;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebug - - - Level3 - ProgramDatabase - - - _DEBUG;%(PreprocessorDefinitions) - 0x0c07 - - - ..\..\bin\Win64-VisualStudio\11.PerPixelLighting.exe - ..\..\lib\Win64-visualstudio;%(AdditionalLibraryDirectories) - true - Console - - - - - - - .\Release/PerPixelLighting.tlb - - - - - MaxSpeed - OnlyExplicitInline - ..\..\include;%(AdditionalIncludeDirectories) - WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) - true - MultiThreaded - true - - - Level3 - - - NDEBUG;%(PreprocessorDefinitions) - 0x0c07 - - - ..\..\bin\Win32-VisualStudio\11.PerPixelLighting.exe - ..\..\lib\Win32-visualstudio;%(AdditionalLibraryDirectories) - Console - - - - - - - .\Release/PerPixelLighting.tlb - - - - - MaxSpeed - OnlyExplicitInline - ..\..\include;%(AdditionalIncludeDirectories) - WIN32;WIN64;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) - true - MultiThreaded - true - - - Level3 - - - NDEBUG;%(PreprocessorDefinitions) - 0x0c07 - - - ..\..\bin\Win64-VisualStudio\11.PerPixelLighting.exe - ..\..\lib\Win64-visualstudio;%(AdditionalLibraryDirectories) - Console - - - - - - - Disabled - Disabled - %(AdditionalIncludeDirectories) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(PreprocessorDefinitions) - EnableFastChecks - EnableFastChecks - MaxSpeed - MaxSpeed - %(AdditionalIncludeDirectories) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(PreprocessorDefinitions) - - - - - - \ No newline at end of file diff --git a/examples/11.PerPixelLighting/main.cpp b/examples/11.PerPixelLighting/main.cpp deleted file mode 100644 index afa59cb5..00000000 --- a/examples/11.PerPixelLighting/main.cpp +++ /dev/null @@ -1,483 +0,0 @@ -/** Example 011 Per-Pixel Lighting - -This tutorial shows how to use one of the built in more complex materials in -irrlicht: Per pixel lighted surfaces using normal maps and parallax mapping. It -will also show how to use fog and moving particle systems. And don't panic: You -do not need any experience with shaders to use these materials in Irrlicht. - -At first, we need to include all headers and do the stuff we always do, like in -nearly all other tutorials. -*/ -#include -#include "driverChoice.h" -#include "exampleHelper.h" - -using namespace irr; - -#ifdef _MSC_VER -#pragma comment(lib, "Irrlicht.lib") -#endif - -/* -For this example, we need an event receiver, to make it possible for the user -to switch between the three available material types. In addition, the event -receiver will create some small GUI window which displays what material is -currently being used. There is nothing special done in this class, so maybe you -want to skip reading it. -*/ -class MyEventReceiver : public IEventReceiver -{ -public: - - MyEventReceiver(scene::ISceneNode* room,scene::ISceneNode* earth, - gui::IGUIEnvironment* env, video::IVideoDriver* driver) - { - // store pointer to room so we can change its drawing mode - Room = room; - Earth = earth; - Driver = driver; - - // set a nicer font - gui::IGUISkin* skin = env->getSkin(); - gui::IGUIFont* font = env->getFont(getExampleMediaPath() + "fonthaettenschweiler.bmp"); - if (font) - skin->setFont(font); - - // add window and listbox - gui::IGUIWindow* window = env->addWindow( - core::rect(460,375,630,470), false, L"Use 'E' + 'R' to change"); - - ListBox = env->addListBox( - core::rect(2,22,165,88), window); - - ListBox->addItem(L"Diffuse"); - ListBox->addItem(L"Bump mapping"); - ListBox->addItem(L"Parallax mapping"); - ListBox->setSelected(1); - - // create problem text - ProblemText = env->addStaticText( - L"Your hardware or this renderer is not able to use the "\ - L"needed shaders for this material. Using fall back materials.", - core::rect(150,20,470,80)); - - ProblemText->setOverrideColor(video::SColor(100,255,255,255)); - - // set start material (prefer parallax mapping if available) - video::IMaterialRenderer* renderer = - Driver->getMaterialRenderer(video::EMT_PARALLAX_MAP_SOLID); - if (renderer && renderer->getRenderCapability() == 0) - ListBox->setSelected(2); - - // set the material which is selected in the listbox - setMaterial(); - } - - bool OnEvent(const SEvent& event) - { - // check if user presses the key 'E' or 'R' - if (event.EventType == irr::EET_KEY_INPUT_EVENT && - !event.KeyInput.PressedDown && Room && ListBox) - { - // change selected item in listbox - - int sel = ListBox->getSelected(); - if (event.KeyInput.Key == irr::KEY_KEY_R) - ++sel; - else - if (event.KeyInput.Key == irr::KEY_KEY_E) - --sel; - else - return false; - - if (sel > 2) sel = 0; - if (sel < 0) sel = 2; - ListBox->setSelected(sel); - - // set the material which is selected in the listbox - setMaterial(); - } - - return false; - } - -private: - - // sets the material of the room mesh the the one set in the - // list box. - void setMaterial() - { - video::E_MATERIAL_TYPE type = video::EMT_SOLID; - - // change material setting - switch(ListBox->getSelected()) - { - case 0: type = video::EMT_SOLID; - break; - case 1: type = video::EMT_NORMAL_MAP_SOLID; - break; - case 2: type = video::EMT_PARALLAX_MAP_SOLID; - break; - } - - Room->setMaterialType(type); - - // change material setting - switch(ListBox->getSelected()) - { - case 0: type = video::EMT_TRANSPARENT_VERTEX_ALPHA; - break; - case 1: type = video::EMT_NORMAL_MAP_TRANSPARENT_VERTEX_ALPHA; - break; - case 2: type = video::EMT_PARALLAX_MAP_TRANSPARENT_VERTEX_ALPHA; - break; - } - - Earth->setMaterialType(type); - - /* - We need to add a warning if the materials will not be able to - be displayed 100% correctly. This is no problem, they will be - rendered using fall back materials, but at least the user - should know that it would look better on better hardware. We - simply check if the material renderer is able to draw at full - quality on the current hardware. The - IMaterialRenderer::getRenderCapability() returns 0 if this is - the case. - */ - video::IMaterialRenderer* renderer = Driver->getMaterialRenderer(type); - - // display some problem text when problem - if (!renderer || renderer->getRenderCapability() != 0) - ProblemText->setVisible(true); - else - ProblemText->setVisible(false); - } - -private: - - gui::IGUIStaticText* ProblemText; - gui::IGUIListBox* ListBox; - - scene::ISceneNode* Room; - scene::ISceneNode* Earth; - video::IVideoDriver* Driver; -}; - - -/* -Now for the real fun. We create an Irrlicht Device and start to setup the scene. -*/ -int main() -{ - // ask user for driver - video::E_DRIVER_TYPE driverType=driverChoiceConsole(); - if (driverType==video::EDT_COUNT) - return 1; - - // create device - - IrrlichtDevice* device = createDevice(driverType, - core::dimension2d(640, 480)); - - if (device == 0) - return 1; // could not create selected driver. - - /* - Before we start with the interesting stuff, we do some simple things: - Store pointers to the most important parts of the engine (video driver, - scene manager, gui environment) to safe us from typing too much, add an - irrlicht engine logo to the window and a user controlled first person - shooter style camera. Also, we let the engine know that it should store - all textures in 32 bit. This necessary because for parallax mapping, we - need 32 bit textures. - */ - - video::IVideoDriver* driver = device->getVideoDriver(); - scene::ISceneManager* smgr = device->getSceneManager(); - gui::IGUIEnvironment* env = device->getGUIEnvironment(); - - driver->setTextureCreationFlag(video::ETCF_ALWAYS_32_BIT, true); - - const io::path mediaPath = getExampleMediaPath(); - - // add irrlicht logo - env->addImage(driver->getTexture(mediaPath + "irrlichtlogo3.png"), - core::position2d(10,10)); - - // add camera - scene::ICameraSceneNode* camera = smgr->addCameraSceneNodeFPS(); - camera->setPosition(core::vector3df(-200,200,-200)); - - // disable mouse cursor - device->getCursorControl()->setVisible(false); - - /* - Because we want the whole scene to look a little bit scarier, we add - some fog to it. This is done by a call to IVideoDriver::setFog(). There - you can set various fog settings. In this example, we use pixel fog, - because it will work well with the materials we'll use in this example. - Please note that you will have to set the material flag EMF_FOG_ENABLE - to 'true' in every scene node which should be affected by this fog. - */ - driver->setFog(video::SColor(0,138,125,81), video::EFT_FOG_LINEAR, 250, 1000, .003f, true, false); - - /* - To be able to display something interesting, we load a mesh from a .3ds - file which is a room I modeled with anim8or. It is the same room as - from the specialFX example. Maybe you remember from that tutorial, I am - no good modeler at all and so I totally messed up the texture mapping - in this model, but we can simply repair it with the - IMeshManipulator::makePlanarTextureMapping() method. - */ - - scene::IAnimatedMesh* roomMesh = smgr->getMesh(mediaPath + "room.3ds"); - scene::ISceneNode* room = 0; - scene::ISceneNode* earth = 0; - - if (roomMesh) - { - // The room mesh doesn't have proper texture mapping on the - // floor, so we can recreate the mapping on runtime. - smgr->getMeshManipulator()->makePlanarTextureMapping( - roomMesh->getMesh(0), 0.003f); - - /* - Now for the first exciting thing: If we successfully loaded the - mesh we need to apply textures to it. Because we want this room - to be displayed with a very cool material, we have to do a - little bit more than just set the textures. Instead of only - loading a color map as usual, we also load a height map which - is simply a grayscale texture. From this height map, we create - a normal map which we will set as second texture of the room. - If you already have a normal map, you could directly set it, - but I simply didn't find a nice normal map for this texture. - The normal map texture is being generated by the - makeNormalMapTexture method of the VideoDriver. The second - parameter specifies the height of the heightmap. If you set it - to a bigger value, the map will look more rocky. - */ - - video::ITexture* normalMap = - driver->getTexture(mediaPath + "rockwall_height.bmp"); - - if (normalMap) - driver->makeNormalMapTexture(normalMap, 9.0f); - - /* - But just setting color and normal map is not everything. The - material we want to use needs some additional information per - vertex like tangents and binormals. Because we are too lazy to - calculate that information now, we let Irrlicht do this for us. - That's why we call IMeshManipulator::createMeshWithTangents(). - It creates a mesh copy with tangents and binormals from another - mesh. After we've done that, we simply create a standard - mesh scene node with this mesh copy, set color and normal map - and adjust some other material settings. Note that we set - EMF_FOG_ENABLE to true to enable fog in the room. - */ - - scene::IMesh* tangentMesh = smgr->getMeshManipulator()-> - createMeshWithTangents(roomMesh->getMesh(0)); - - room = smgr->addMeshSceneNode(tangentMesh); - room->setMaterialTexture(0, - driver->getTexture(mediaPath + "rockwall.jpg")); - room->setMaterialTexture(1, normalMap); - - // Stones don't glitter.. (but specular highlight for EMT_SOLID) - //room->getMaterial(0).SpecularColor.set(0,0,0,0); - //room->getMaterial(0).Shininess = 0.f; - - room->setMaterialFlag(video::EMF_FOG_ENABLE, true); - room->setMaterialType(video::EMT_PARALLAX_MAP_SOLID); - // adjust height for parallax effect - room->getMaterial(0).MaterialTypeParam = 1.f / 64.f; - - // drop mesh because we created it with a create.. call. - tangentMesh->drop(); - } - - /* - After we've created a room shaded by per pixel lighting, we add a - sphere into it with the same material, but we'll make it transparent. - In addition, because the sphere looks somehow like a familiar planet, - we make it rotate. The procedure is similar as before. The difference - is that we are loading the mesh from an .x file which already contains - a color map so we do not need to load it manually. But the sphere is a - little bit too small for our needs, so we scale it by the factor 50. - */ - - // add earth sphere - - scene::IAnimatedMesh* earthMesh = smgr->getMesh(mediaPath + "earth.x"); - if (earthMesh) - { - //perform various tasks with the mesh manipulator - scene::IMeshManipulator *manipulator = smgr->getMeshManipulator(); - - // create mesh copy with tangent information from original earth.x mesh - scene::IMesh* tangentSphereMesh = - manipulator->createMeshWithTangents(earthMesh->getMesh(0)); - - // set the alpha value of all vertices to 200 - manipulator->setVertexColorAlpha(tangentSphereMesh, 200); - - // scale the mesh by factor 50 - core::matrix4 m; - m.setScale ( core::vector3df(50,50,50) ); - manipulator->transform( tangentSphereMesh, m ); - - earth = smgr->addMeshSceneNode(tangentSphereMesh); - - earth->setPosition(core::vector3df(-70,130,45)); - - // load heightmap, create normal map from it and set it - video::ITexture* earthNormalMap = driver->getTexture(mediaPath + "earthbump.jpg"); - if (earthNormalMap) - { - driver->makeNormalMapTexture(earthNormalMap, 20.0f); - earth->setMaterialTexture(1, earthNormalMap); - earth->setMaterialType(video::EMT_NORMAL_MAP_TRANSPARENT_VERTEX_ALPHA); - } - - // adjust material settings - earth->setMaterialFlag(video::EMF_FOG_ENABLE, true); - - // add rotation animator - scene::ISceneNodeAnimator* anim = - smgr->createRotationAnimator(core::vector3df(0,0.1f,0)); - earth->addAnimator(anim); - anim->drop(); - - // drop mesh because we created it with a create.. call. - tangentSphereMesh->drop(); - } - - /* - Per pixel lighted materials only look cool when there are moving - lights. So we add some. And because moving lights alone are so boring, - we add billboards to them, and a whole particle system to one of them. - We start with the first light which is red and has only the billboard - attached. - */ - - // add light 1 (more green) - scene::ILightSceneNode* light1 = - smgr->addLightSceneNode(0, core::vector3df(0,0,0), - video::SColorf(0.5f, 1.0f, 0.5f, 0.0f), 400.0f); - - // add fly circle animator to light 1 - scene::ISceneNodeAnimator* anim = - smgr->createFlyCircleAnimator (core::vector3df(50,300,0),190.0f, -0.003f); - light1->addAnimator(anim); - anim->drop(); - - // attach billboard to the light - scene::IBillboardSceneNode* bill = - smgr->addBillboardSceneNode(light1, core::dimension2d(60, 60)); - - bill->setMaterialFlag(video::EMF_LIGHTING, false); - bill->setMaterialFlag(video::EMF_ZWRITE_ENABLE, false); - bill->setMaterialType(video::EMT_TRANSPARENT_ADD_COLOR); - bill->setMaterialTexture(0, driver->getTexture(mediaPath + "particlegreen.jpg")); - - /* - Now the same again, with the second light. The difference is that we - add a particle system to it too. And because the light moves, the - particles of the particle system will follow. If you want to know more - about how particle systems are created in Irrlicht, take a look at the - SpecialFX example. Maybe you will have noticed that we only add 2 - lights, this has a simple reason: The low end version of this material - was written in ps1.1 and vs1.1, which doesn't allow more lights. You - could add a third light to the scene, but it won't be used to shade the - walls. But of course, this will change in future versions of Irrlicht - where higher versions of pixel/vertex shaders will be implemented too. - */ - - // add light 2 (red) - scene::ISceneNode* light2 = - smgr->addLightSceneNode(0, core::vector3df(0,0,0), - video::SColorf(1.0f, 0.2f, 0.2f, 0.0f), 400.0f); - - // add fly circle animator to light 2 - anim = smgr->createFlyCircleAnimator(core::vector3df(0,150,0), 200.0f, - 0.001f, core::vector3df(0.2f, 0.9f, 0.f)); - light2->addAnimator(anim); - anim->drop(); - - // attach billboard to light - bill = smgr->addBillboardSceneNode(light2, core::dimension2d(120, 120)); - bill->setMaterialFlag(video::EMF_LIGHTING, false); - bill->setMaterialFlag(video::EMF_ZWRITE_ENABLE, false); - bill->setMaterialType(video::EMT_TRANSPARENT_ADD_COLOR); - bill->setMaterialTexture(0, driver->getTexture(mediaPath + "particlered.bmp")); - - // add particle system - scene::IParticleSystemSceneNode* ps = - smgr->addParticleSystemSceneNode(false, light2); - - // create and set emitter - scene::IParticleEmitter* em = ps->createBoxEmitter( - core::aabbox3d(-3,0,-3,3,1,3), - core::vector3df(0.0f,0.03f,0.0f), - 80,100, - video::SColor(10,255,255,255), video::SColor(10,255,255,255), - 400,1100); - em->setMinStartSize(core::dimension2d(30.0f, 40.0f)); - em->setMaxStartSize(core::dimension2d(30.0f, 40.0f)); - - ps->setEmitter(em); - em->drop(); - - // create and set affector - scene::IParticleAffector* paf = ps->createFadeOutParticleAffector(); - ps->addAffector(paf); - paf->drop(); - - // adjust some material settings - ps->setMaterialFlag(video::EMF_LIGHTING, false); - ps->setMaterialFlag(video::EMF_ZWRITE_ENABLE, false); - ps->setMaterialTexture(0, driver->getTexture(mediaPath + "fireball.bmp")); - ps->setMaterialType(video::EMT_TRANSPARENT_ADD_COLOR); - - MyEventReceiver receiver(room, earth, env, driver); - device->setEventReceiver(&receiver); - - /* - Finally, draw everything. That's it. - */ - - int lastFPS = -1; - - while(device->run()) - if (device->isWindowActive()) - { - driver->beginScene(video::ECBF_COLOR | video::ECBF_DEPTH, video::SColor(0)); - - smgr->drawAll(); - env->drawAll(); - - driver->endScene(); - - int fps = driver->getFPS(); - - if (lastFPS != fps) - { - core::stringw str = L"Per pixel lighting example - Irrlicht Engine ["; - str += driver->getName(); - str += "] FPS:"; - str += fps; - - device->setWindowCaption(str.c_str()); - lastFPS = fps; - } - } - - device->drop(); - - return 0; -} - -/* -**/ diff --git a/examples/11.PerPixelLighting/tutorial.html b/examples/11.PerPixelLighting/tutorial.html deleted file mode 100644 index 89e87bd8..00000000 --- a/examples/11.PerPixelLighting/tutorial.html +++ /dev/null @@ -1,502 +0,0 @@ - - -Irrlicht Engine Tutorial - - - - -
- - - - - - - - -
-
-
Tutorial 11. Per pixel lighting
-
-
-
-

This tutorial shows how to use one of the built in more complex materials - in irrlicht: Per pixel lighted surfaces using normal maps and parallax - mapping. It will also show how to use fog and moving particle systems. - And don't panic: You dont need any experience with shaders to use these - materials in Irrlicht.

-

The program which is described here will look like this:

-


-

-
-
-
- - - - - - - -
Lets start!
-
-

At first, we need to include all headers and do the stuff we always - do, like in nearly all other tutorials.

- - - - -
#include <irrlicht.h>
#include <iostream>

using namespace irr;

#pragma comment(lib, "Irrlicht.lib")
-

For this example, we need an event receiver, to make it possible - for the user to switch between the three available material types. - In addition, the event receiver will create some small GUI window - which displays what material is currently being used. There is nothing - special done in this class, so maybe you want to skip reading it.

- - - - -
class MyEventReceiver : public IEventReceiver
-{
-public:
-
-	MyEventReceiver(scene::ISceneNode* room, 
-		gui::IGUIEnvironment* env, video::IVideoDriver* driver)
-	{
-		// store pointer to room so we can change its drawing mode
-		Room = room;
-		Driver = driver;
-
-		// set a nicer font
-		gui::IGUISkin* skin = env->getSkin();
-		gui::IGUIFont* font = env->getFont("../../media/fonthaettenschweiler.bmp");
-		if (font)
-			skin->setFont(font);
-
-		// add window and listbox
-		gui::IGUIWindow* window = env->addWindow(
-			core::rect(490,390,630,470), false, L"Use 'E' + 'R' to change");
-
-		ListBox = env->addListBox(
-			core::rect(2,22,135,78), window);
-
-		ListBox->addItem(L"Diffuse");
-		ListBox->addItem(L"Bump mapping");
-		ListBox->addItem(L"Parallax mapping");
-		ListBox->setSelected(1);
-
-		// create problem text
-		ProblemText = env->addStaticText(
-			L"Your hardware or this renderer is not able to use the "\
-			L"needed shaders for this material. Using fall back materials.",
-			core::rect(150,20,470,60));
-
-		ProblemText->setOverrideColor(video::SColor(100,255,255,255));
-
-		// set start material (prefer parallax mapping if available)
-		video::IMaterialRenderer* renderer = 
-			Driver->getMaterialRenderer(video::EMT_PARALLAX_MAP_SOLID);
-		if (renderer && renderer->getRenderCapability() == 0)
-			ListBox->setSelected(2);
-
-		// set the material which is selected in the listbox
-		setMaterial();
-	}
-
-	bool OnEvent(const SEvent& event)
-	{
-		// check if user presses the key 'E' or 'R'
-		if (event.EventType == irr::EET_KEY_INPUT_EVENT &&
-			!event.KeyInput.PressedDown && Room && ListBox)
-		{
-			// change selected item in listbox 
-
-			int sel = ListBox->getSelected();
-			if (event.KeyInput.Key == irr::KEY_KEY_R)
-				++sel;
-			else
-			if (event.KeyInput.Key == irr::KEY_KEY_E)
-				--sel;
-			else 
-				return false;
-
-			if (sel > 2) sel = 0;
-			if (sel < 0) sel = 2;
-			ListBox->setSelected(sel);
-			
-			// set the material which is selected in the listbox
-			setMaterial();
-		}
-
-		return false;
-	}
-
-private:
-
-	// sets the material of the room mesh the the one set in the 
-	// list box.
-	void setMaterial()
-	{
-		video::E_MATERIAL_TYPE type = video::EMT_SOLID;
-
-		// change material setting
-		switch(ListBox->getSelected())
-		{
-		case 0: type = video::EMT_SOLID;
-			break;
-		case 1: type = video::EMT_NORMAL_MAP_SOLID;
-			break;
-		case 2: type = video::EMT_PARALLAX_MAP_SOLID;
-			break;
-		}
-
-		Room->setMaterialType(type);
-
-

We need to add a warning if the materials will not be able to be - displayed 100% correctly. This is no problem, they will be renderered - using fall back materials, but at least the user should know that - it would look better on better hardware. We simply check if the material - renderer is able to draw at full quality on the current hardware. - The IMaterialRenderer::getRenderCapability() returns 0 if this is - the case.
-

- - - - -
video::IMaterialRenderer* renderer = Driver->getMaterialRenderer(type);
-
-		// display some problem text when problem
-		if (!renderer || renderer->getRenderCapability() != 0)
-			ProblemText->setVisible(true);
-		else
-			ProblemText->setVisible(false);
-	}
-
-private:
-
-	gui::IGUIStaticText* ProblemText;
-	gui::IGUIListBox* ListBox;
-
-	scene::ISceneNode* Room;	
-	video::IVideoDriver* Driver;
-};
-


- Now for the real fun. We create an Irrlicht Device and start to setup - the scene.
-

- - - - -
int main()
-{
-	// let user select driver type
-
-	video::E_DRIVER_TYPE driverType = video::EDT_DIRECT3D9;
-
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 0;
} - - // create device - - IrrlichtDevice* device = createDevice(driverType, core::dimension2d(640, 480)); - - if (device == 0) - return 1; // could not create selected driver. -
-
- Before we start with the interesting stuff, we do some simple things: - Store pointers to the most important parts of the engine (video driver,
- scene manager, gui environment) to safe us from typing too much, add - an irrlicht engine logo to the window and a user controlled first person - shooter style camera. Also, we let the engine now that it should store - all textures in 32 bit. This necessary because for parallax mapping, - we need 32 bit textures.
-
- - - - -
-	video::IVideoDriver* driver = device->getVideoDriver();
-	scene::ISceneManager* smgr = device->getSceneManager();
-	gui::IGUIEnvironment* env = device->getGUIEnvironment();
-
-	driver->setTextureCreationFlag(video::ETCF_ALWAYS_32_BIT, true);
-
-	// add irrlicht logo
-	env->addImage(driver->getTexture("../../media/irrlichtlogoalpha.tga"),
-		core::position2d(10,10));
-		
-	// add camera
-	scene::ICameraSceneNode* camera = 
-		smgr->addCameraSceneNodeFPS(0,100.0f,300.0f);
-	camera->setPosition(core::vector3df(-200,200,-200));
-
-	// disable mouse cursor
-	device->getCursorControl()->setVisible(false);
-
- Because we want the whole scene to look a little bit scarier, we add - some fog to it. This is done by a call to IVideoDriver::setFog(). There - you can set
- various fog settings. In this example, we use pixel fog, because it - will work well with the materials we'll use in this example. Please - note that you will have to set the material flag EMF_FOG_ENABLE to 'true' - in every scene node which should be affected by this fog.
-
- - - - -
driver->setFog(video::SColor(0,138,125,81), true, 250, 1000, 0, true);
-
- To be able to display something interesting, we load a mesh from a .3ds - file which is a room I modeled with anim8or. It is the same room as -
- from the specialFX example. Maybe you remember from that tutorial, I - am no good modeler at all and so I totally messed up the texture mapping - in this model, but we can simply repair it with the IMeshManipulator::makePlanarTextureMapping() - method.
-
- - - - -
	scene::IAnimatedMesh* roomMesh = smgr->getMesh(
-		"../../media/room.3ds");
-	scene::ISceneNode* room = 0;
-
-	if (roomMesh)
-	{
-		smgr->getMeshManipulator()->makePlanarTextureMapping(
-				roomMesh->getMesh(0), 0.003f);
-
- Now for the first exciting thing: If we successfully loaded the mesh - we need to apply textures to it. Because we want this room to be displayed - with a very cool material, we have to do a little bit more than just - set the textures. Instead of only loading a color map as usual, we also - load a height map which is simply a grayscale texture. From this height - map, we create a normal map which we will set as second texture of the - room. If you already have a normal map, you could directly set it, but - I simply didn´t find a nice normal map for this texture. The normal - map texture is being generated by the makeNormalMapTexture method
- of the VideoDriver. The second parameter specifies the height of the - heightmap. If you set it to a bigger value, the map will look more rocky.
-
- - - - -
		video::ITexture* colorMap = driver->getTexture("../../media/rockwall.bmp");
-		video::ITexture* normalMap = driver->getTexture("../../media/rockwall_height.bmp");
-		
-		driver->makeNormalMapTexture(normalMap, 9.0f);
-
- But just setting color and normal map is not everything. The material - we want to use needs some additional informations per vertex like tangents - and binormals.
- Because we are too lazy to calculate that information now, we let Irrlicht - do this for us. That's why we call IMeshManipulator::createMeshWithTangents(). - It
- creates a mesh copy with tangents and binormals from any other mesh. - After we've done that, we simply create a standard mesh scene node with - this
- mesh copy, set color and normal map and adjust some other material settings. - Note that we set EMF_FOG_ENABLE to true to enable fog in the room.
-
- - - - -
scene::IMesh* tangentMesh = smgr->getMeshManipulator()->createMeshWithTangents(
roomMesh->getMesh(0));

room = smgr->addMeshSceneNode(tangentMesh);
room->setMaterialTexture(0, colorMap);
room->setMaterialTexture(1, normalMap);
room->getMaterial(0).SpecularColor.set(0,0,0,0);
room->setMaterialFlag(video::EMF_FOG_ENABLE, true);
room->setMaterialType(video::EMT_PARALLAX_MAP_SOLID);
room->getMaterial(0).MaterialTypeParam = 0.02f; // adjust height for parallax effect
// drop mesh because we created it with a create.. call.
tangentMesh->drop();
}
-
- After we've created a room shaded by per pixel lighting, we add a sphere - into it with the same material, but we'll make it transparent. In addition,
- because the sphere looks somehow like a familiar planet, we make it - rotate. The procedure is similar as before. The difference is that we - are loading
- the mesh from an .x file which already contains a color map so we do - not need to load it manually. But the sphere is a little bit too small - for our needs, so we scale it by the factor 50.
-
- - - - -
// add earth sphere
-
-	scene::IAnimatedMesh* earthMesh = smgr->getMesh("../../media/earth.x");
-	if (earthMesh)
-	{
-		// create mesh copy with tangent informations from original earth.x mesh
-		scene::IMesh* tangentSphereMesh = 
-			smgr->getMeshManipulator()->createMeshWithTangents(earthMesh->getMesh(0));
-
-		// set the alpha value of all vertices to 200
-		smgr->getMeshManipulator()->setVertexColorAlpha(tangentSphereMesh, 200);
-		
-		// scale the mesh by factor 50
-		smgr->getMeshManipulator()->scaleMesh(
-			tangentSphereMesh, core::vector3df(50,50,50));
-
-		// create mesh scene node
-		scene::ISceneNode* sphere = smgr->addMeshSceneNode(tangentSphereMesh);
-		sphere->setPosition(core::vector3df(-70,130,45));
-
-		// load heightmap, create normal map from it and set it
-		video::ITexture* earthNormalMap = driver->getTexture("../../media/earthbump.bmp");
-		driver->makeNormalMapTexture(earthNormalMap, 20.0f);
-		sphere->setMaterialTexture(1, earthNormalMap);
-
-		// adjust material settings
-		sphere->setMaterialFlag(video::EMF_FOG_ENABLE, true);
-		sphere->setMaterialType(video::EMT_NORMAL_MAP_TRANSPARENT_VERTEX_ALPHA); 
-
-		// add rotation animator
-		scene::ISceneNodeAnimator* anim =
-			smgr->createRotationAnimator(core::vector3df(0,0.1f,0));	
-		sphere->addAnimator(anim);
-		anim->drop();
-
-		// drop mesh because we created it with a create.. call.
-		tangentSphereMesh->drop();
-	}
-
- Per pixel lighted materials only look cool when there are moving lights. - So we add some. And because moving lights alone are so boring, we add - billboards
- to them, and a whole particle system to one of them. We start with the - first light which is red and has only the billboard attached.
-
- - - - -
// add light 1 (nearly red)
-	scene::ILightSceneNode* light1 = 
-		smgr->addLightSceneNode(0, core::vector3df(0,0,0), 
-		video::SColorf(0.5f, 1.0f, 0.5f, 0.0f), 200.0f);
-
-	// add fly circle animator to light 1
-	scene::ISceneNodeAnimator* anim = 
-		smgr->createFlyCircleAnimator (core::vector3df(50,300,0),190.0f, -0.003f);
-	light1->addAnimator(anim);
-	anim->drop();
-
-	// attach billboard to the light
-	scene::ISceneNode* bill = 
-		smgr->addBillboardSceneNode(light1, core::dimension2d(60, 60));
-
-	bill->setMaterialFlag(video::EMF_LIGHTING, false);
-	bill->setMaterialType(video::EMT_TRANSPARENT_ADD_COLOR);
-	bill->setMaterialTexture(0, driver->getTexture("../../media/particlered.bmp"));
-
- Now the same again, with the second light. The difference is that we - add a particle system to it too. And because the light moves, the particles - of the particlesystem will follow. If you want to know more about how - particle systems are created in Irrlicht, take a look at the specialFx - example.
- Maybe you will have noticed that we only add 2 lights, this has a simple - reason: The low end version of this material was written in ps1.1 and - vs1.1, which doesn't allow more lights. You could add a third light - to the scene, but it won't be used to shade the walls. But of course, - this will change in future versions of Irrlicht were higher versions - of pixel/vertex shaders will be implemented too.
-
- - - - -
// add light 2 (gray)
-	scene::ISceneNode* light2 = 
-		smgr->addLightSceneNode(0, core::vector3df(0,0,0), 
-		video::SColorf(1.0f, 0.2f, 0.2f, 0.0f), 200.0f);
-
-	// add fly circle animator to light 2
-	anim = smgr->createFlyCircleAnimator (core::vector3df(0,150,0),200.0f); 
-	light2->addAnimator(anim);
-	anim->drop();
-
-	// attach billboard to light
-	bill = smgr->addBillboardSceneNode(light2, core::dimension2d(120, 120));
-	bill->setMaterialFlag(video::EMF_LIGHTING, false);
-	bill->setMaterialType(video::EMT_TRANSPARENT_ADD_COLOR);
-	bill->setMaterialTexture(0, driver->getTexture("../../media/particlewhite.bmp"));
-
-	// add particle system
-	scene::IParticleSystemSceneNode* ps = 
-		smgr->addParticleSystemSceneNode(false, light2);
-
-	ps->setParticleSize(core::dimension2d(30.0f, 40.0f));
-
-	// create and set emitter
-	scene::IParticleEmitter* em = ps->createBoxEmitter(
-		core::aabbox3d(-3,0,-3,3,1,3), 
-		core::vector3df(0.0f,0.03f,0.0f),
-		80,100, 
-		video::SColor(0,255,255,255), video::SColor(0,255,255,255),
-		400,1100);
-	ps->setEmitter(em);
-	em->drop();
-
-	// create and set affector
-	scene::IParticleAffector* paf = ps->createFadeOutParticleAffector();
-	ps->addAffector(paf);
-	paf->drop();
-
-	// adjust some material settings
-	ps->setMaterialFlag(video::EMF_LIGHTING, false);
-	ps->setMaterialTexture(0, driver->getTexture("../../media/fireball.bmp"));
-	ps->setMaterialType(video::EMT_TRANSPARENT_VERTEX_ALPHA);
-
-
-	MyEventReceiver receiver(room, env, driver);
-	device->setEventReceiver(&receiver);
-
- Finally, draw everything. That's it.
-
- - - - -
int lastFPS = -1;
-
-	while(device->run())
-	if (device->isWindowActive())
-	{
-		driver->beginScene(true, true, 0);
-
-		smgr->drawAll();
-		env->drawAll();
-
-		driver->endScene();
-
-		int fps = driver->getFPS();
-
-		if (lastFPS != fps)
-		{
-		  core::stringw str = L"Per pixel lighting example - Irrlicht Engine [";
-		  str += driver->getName();
-		  str += "] FPS:";
-		  str += fps;
-
-		  device->setWindowCaption(str.c_str());
-		  lastFPS = fps;
-		}
-	}
-
-	device->drop();
-	
-	return 0;
-}
-
-
-
-
-
-

 

- - diff --git a/examples/12.TerrainRendering/Makefile b/examples/12.TerrainRendering/Makefile deleted file mode 100644 index 362bf06e..00000000 --- a/examples/12.TerrainRendering/Makefile +++ /dev/null @@ -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 := 12.TerrainRendering -# 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 diff --git a/examples/12.TerrainRendering/TerrainRendering.cbp b/examples/12.TerrainRendering/TerrainRendering.cbp deleted file mode 100644 index 2bf6dead..00000000 --- a/examples/12.TerrainRendering/TerrainRendering.cbp +++ /dev/null @@ -1,56 +0,0 @@ - - - - - - diff --git a/examples/12.TerrainRendering/TerrainRendering.vcproj b/examples/12.TerrainRendering/TerrainRendering.vcproj deleted file mode 100644 index 22005623..00000000 --- a/examples/12.TerrainRendering/TerrainRendering.vcproj +++ /dev/null @@ -1,163 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/examples/12.TerrainRendering/TerrainRendering.xcodeproj/project.pbxproj b/examples/12.TerrainRendering/TerrainRendering.xcodeproj/project.pbxproj deleted file mode 100644 index 63b8efe1..00000000 --- a/examples/12.TerrainRendering/TerrainRendering.xcodeproj/project.pbxproj +++ /dev/null @@ -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 /* 12.TerrainRendering.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = 12.TerrainRendering.app; sourceTree = BUILT_PRODUCTS_DIR; }; - 5E34CC741B7F8EEF00F212E8 /* main.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = main.cpp; sourceTree = ""; }; - 5E34CC781B7F90A000F212E8 /* libIrrlicht.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libIrrlicht.a; path = ../../lib/OSX/libIrrlicht.a; sourceTree = ""; }; - 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 = ""; }; -/* 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 = ""; - }; - 5E34CC521B7F8E6E00F212E8 /* Products */ = { - isa = PBXGroup; - children = ( - 5E34CC511B7F8E6E00F212E8 /* 12.TerrainRendering.app */, - ); - name = Products; - sourceTree = ""; - }; - 5E34CC761B7F905600F212E8 /* Libraries */ = { - isa = PBXGroup; - children = ( - 5E8570B01B7F99F500B267D2 /* Cocoa.framework */, - 5E8570B41B7F9A0700B267D2 /* IOKit.framework */, - 5E8570B21B7F99FE00B267D2 /* OpenGL.framework */, - 5E34CC781B7F90A000F212E8 /* libIrrlicht.a */, - ); - name = Libraries; - sourceTree = ""; - }; - 5E34CC771B7F906D00F212E8 /* Resources */ = { - isa = PBXGroup; - children = ( - 5E8570BE1B7F9D3A00B267D2 /* media */, - ); - name = Resources; - sourceTree = ""; - }; -/* End PBXGroup section */ - -/* Begin PBXNativeTarget section */ - 5E34CC501B7F8E6E00F212E8 /* 12.TerrainRendering */ = { - isa = PBXNativeTarget; - buildConfigurationList = 5E34CC701B7F8E6E00F212E8 /* Build configuration list for PBXNativeTarget "12.TerrainRendering" */; - buildPhases = ( - 5E34CC4D1B7F8E6E00F212E8 /* Sources */, - 5E34CC4E1B7F8E6E00F212E8 /* Frameworks */, - 5E34CC4F1B7F8E6E00F212E8 /* Resources */, - ); - buildRules = ( - ); - dependencies = ( - ); - name = 12.TerrainRendering; - productName = 01.HelloWorld; - productReference = 5E34CC511B7F8E6E00F212E8 /* 12.TerrainRendering.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 "TerrainRendering" */; - compatibilityVersion = "Xcode 3.2"; - developmentRegion = English; - hasScannedForEncodings = 0; - knownRegions = ( - en, - Base, - ); - mainGroup = 5E34C6D81B7F4A0C00F212E8; - productRefGroup = 5E34CC521B7F8E6E00F212E8 /* Products */; - projectDirPath = ""; - projectRoot = ""; - targets = ( - 5E34CC501B7F8E6E00F212E8 /* 12.TerrainRendering */, - ); - }; -/* 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 "TerrainRendering" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 5E34C6DD1B7F4A0C00F212E8 /* Debug */, - 5E34C6DE1B7F4A0C00F212E8 /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - 5E34CC701B7F8E6E00F212E8 /* Build configuration list for PBXNativeTarget "12.TerrainRendering" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 5E34CC6C1B7F8E6E00F212E8 /* Debug */, - 5E34CC6D1B7F8E6E00F212E8 /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; -/* End XCConfigurationList section */ - }; - rootObject = 5E34C6D91B7F4A0C00F212E8 /* Project object */; -} diff --git a/examples/12.TerrainRendering/TerrainRendering.xcodeproj/xcshareddata/xcschemes/12.TerrainRendering.xcscheme b/examples/12.TerrainRendering/TerrainRendering.xcodeproj/xcshareddata/xcschemes/12.TerrainRendering.xcscheme deleted file mode 100644 index 13efddb9..00000000 --- a/examples/12.TerrainRendering/TerrainRendering.xcodeproj/xcshareddata/xcschemes/12.TerrainRendering.xcscheme +++ /dev/null @@ -1,91 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/examples/12.TerrainRendering/TerrainRendering_vc10.vcxproj b/examples/12.TerrainRendering/TerrainRendering_vc10.vcxproj deleted file mode 100644 index 22bd8b6d..00000000 --- a/examples/12.TerrainRendering/TerrainRendering_vc10.vcxproj +++ /dev/null @@ -1,235 +0,0 @@ - - - - - Debug - Win32 - - - Debug - x64 - - - Release - Win32 - - - Release - x64 - - - - 12.TerrainRendering - {3A5B74E5-6390-43B0-A459-2793B81FFD31} - TerrainRendering - - - - Application - false - MultiByte - Windows7.1SDK - - - Application - false - MultiByte - Windows7.1SDK - - - Application - false - MultiByte - Windows7.1SDK - - - Application - false - MultiByte - Windows7.1SDK - - - - - - - - - - - - - - - - - - - - - - - <_ProjectFileVersion>10.0.30319.1 - ..\..\bin\Win32-VisualStudio\ - ..\..\bin\Win64-VisualStudio\ - - - ..\..\bin\Win32-VisualStudio\ - ..\..\bin\Win64-VisualStudio\ - - - AllRules.ruleset - AllRules.ruleset - - - - - AllRules.ruleset - AllRules.ruleset - - - - - - - - .\Debug/TerrainRendering.tlb - - - - - Disabled - ..\..\include;%(AdditionalIncludeDirectories) - WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebug - - - Level3 - EditAndContinue - - - _DEBUG;%(PreprocessorDefinitions) - 0x0c07 - - - ..\..\bin\Win32-VisualStudio\12.TerrainRendering.exe - ..\..\lib\Win32-visualstudio;%(AdditionalLibraryDirectories) - true - Console - - - - - - - .\Debug/TerrainRendering.tlb - - - - - Disabled - ..\..\include;%(AdditionalIncludeDirectories) - WIN32;WIN64;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebug - - - Level3 - ProgramDatabase - - - _DEBUG;%(PreprocessorDefinitions) - 0x0c07 - - - ..\..\bin\Win64-VisualStudio\12.TerrainRendering.exe - ..\..\lib\Win64-visualstudio;%(AdditionalLibraryDirectories) - true - Console - - - - - - - .\Release/TerrainRendering.tlb - - - - - MaxSpeed - OnlyExplicitInline - ..\..\include;%(AdditionalIncludeDirectories) - WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) - true - MultiThreaded - true - - - Level3 - - - NDEBUG;%(PreprocessorDefinitions) - 0x0c07 - - - ..\..\bin\Win32-VisualStudio\12.TerrainRendering.exe - ..\..\lib\Win32-visualstudio;%(AdditionalLibraryDirectories) - Console - - - - - - - .\Release/TerrainRendering.tlb - - - - - MaxSpeed - OnlyExplicitInline - ..\..\include;%(AdditionalIncludeDirectories) - WIN32;WIN64;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) - true - MultiThreaded - true - - - Level3 - - - NDEBUG;%(PreprocessorDefinitions) - 0x0c07 - - - ..\..\bin\Win64-VisualStudio\12.TerrainRendering.exe - ..\..\lib\Win64-visualstudio;%(AdditionalLibraryDirectories) - Console - - - - - - - Disabled - Disabled - %(AdditionalIncludeDirectories) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(PreprocessorDefinitions) - EnableFastChecks - EnableFastChecks - MaxSpeed - MaxSpeed - %(AdditionalIncludeDirectories) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(PreprocessorDefinitions) - - - - - - \ No newline at end of file diff --git a/examples/12.TerrainRendering/TerrainRendering_vc11.vcxproj b/examples/12.TerrainRendering/TerrainRendering_vc11.vcxproj deleted file mode 100644 index 22bd8b6d..00000000 --- a/examples/12.TerrainRendering/TerrainRendering_vc11.vcxproj +++ /dev/null @@ -1,235 +0,0 @@ - - - - - Debug - Win32 - - - Debug - x64 - - - Release - Win32 - - - Release - x64 - - - - 12.TerrainRendering - {3A5B74E5-6390-43B0-A459-2793B81FFD31} - TerrainRendering - - - - Application - false - MultiByte - Windows7.1SDK - - - Application - false - MultiByte - Windows7.1SDK - - - Application - false - MultiByte - Windows7.1SDK - - - Application - false - MultiByte - Windows7.1SDK - - - - - - - - - - - - - - - - - - - - - - - <_ProjectFileVersion>10.0.30319.1 - ..\..\bin\Win32-VisualStudio\ - ..\..\bin\Win64-VisualStudio\ - - - ..\..\bin\Win32-VisualStudio\ - ..\..\bin\Win64-VisualStudio\ - - - AllRules.ruleset - AllRules.ruleset - - - - - AllRules.ruleset - AllRules.ruleset - - - - - - - - .\Debug/TerrainRendering.tlb - - - - - Disabled - ..\..\include;%(AdditionalIncludeDirectories) - WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebug - - - Level3 - EditAndContinue - - - _DEBUG;%(PreprocessorDefinitions) - 0x0c07 - - - ..\..\bin\Win32-VisualStudio\12.TerrainRendering.exe - ..\..\lib\Win32-visualstudio;%(AdditionalLibraryDirectories) - true - Console - - - - - - - .\Debug/TerrainRendering.tlb - - - - - Disabled - ..\..\include;%(AdditionalIncludeDirectories) - WIN32;WIN64;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebug - - - Level3 - ProgramDatabase - - - _DEBUG;%(PreprocessorDefinitions) - 0x0c07 - - - ..\..\bin\Win64-VisualStudio\12.TerrainRendering.exe - ..\..\lib\Win64-visualstudio;%(AdditionalLibraryDirectories) - true - Console - - - - - - - .\Release/TerrainRendering.tlb - - - - - MaxSpeed - OnlyExplicitInline - ..\..\include;%(AdditionalIncludeDirectories) - WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) - true - MultiThreaded - true - - - Level3 - - - NDEBUG;%(PreprocessorDefinitions) - 0x0c07 - - - ..\..\bin\Win32-VisualStudio\12.TerrainRendering.exe - ..\..\lib\Win32-visualstudio;%(AdditionalLibraryDirectories) - Console - - - - - - - .\Release/TerrainRendering.tlb - - - - - MaxSpeed - OnlyExplicitInline - ..\..\include;%(AdditionalIncludeDirectories) - WIN32;WIN64;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) - true - MultiThreaded - true - - - Level3 - - - NDEBUG;%(PreprocessorDefinitions) - 0x0c07 - - - ..\..\bin\Win64-VisualStudio\12.TerrainRendering.exe - ..\..\lib\Win64-visualstudio;%(AdditionalLibraryDirectories) - Console - - - - - - - Disabled - Disabled - %(AdditionalIncludeDirectories) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(PreprocessorDefinitions) - EnableFastChecks - EnableFastChecks - MaxSpeed - MaxSpeed - %(AdditionalIncludeDirectories) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(PreprocessorDefinitions) - - - - - - \ No newline at end of file diff --git a/examples/12.TerrainRendering/TerrainRendering_vc12.vcxproj b/examples/12.TerrainRendering/TerrainRendering_vc12.vcxproj deleted file mode 100644 index 4fb6b9b8..00000000 --- a/examples/12.TerrainRendering/TerrainRendering_vc12.vcxproj +++ /dev/null @@ -1,235 +0,0 @@ - - - - - Debug - Win32 - - - Debug - x64 - - - Release - Win32 - - - Release - x64 - - - - 12.TerrainRendering - {3A5B74E5-6390-43B0-A459-2793B81FFD31} - TerrainRendering - - - - Application - false - MultiByte - Windows7.1SDK - - - Application - false - MultiByte - Windows7.1SDK - - - Application - false - MultiByte - Windows7.1SDK - - - Application - false - MultiByte - Windows7.1SDK - - - - - - - - - - - - - - - - - - - - - - - <_ProjectFileVersion>10.0.30319.1 - ..\..\bin\Win32-VisualStudio\ - ..\..\bin\Win64-VisualStudio\ - - - ..\..\bin\Win32-VisualStudio\ - ..\..\bin\Win64-VisualStudio\ - - - AllRules.ruleset - AllRules.ruleset - - - - - AllRules.ruleset - AllRules.ruleset - - - - - - - - .\Debug/TerrainRendering.tlb - - - - - Disabled - ..\..\include;%(AdditionalIncludeDirectories) - WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebug - - - Level3 - EditAndContinue - - - _DEBUG;%(PreprocessorDefinitions) - 0x0c07 - - - ..\..\bin\Win32-VisualStudio\12.TerrainRendering.exe - ..\..\lib\Win32-visualstudio;%(AdditionalLibraryDirectories) - true - Console - - - - - - - .\Debug/TerrainRendering.tlb - - - - - Disabled - ..\..\include;%(AdditionalIncludeDirectories) - WIN32;WIN64;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebug - - - Level3 - ProgramDatabase - - - _DEBUG;%(PreprocessorDefinitions) - 0x0c07 - - - ..\..\bin\Win64-VisualStudio\12.TerrainRendering.exe - ..\..\lib\Win64-visualstudio;%(AdditionalLibraryDirectories) - true - Console - - - - - - - .\Release/TerrainRendering.tlb - - - - - MaxSpeed - OnlyExplicitInline - ..\..\include;%(AdditionalIncludeDirectories) - WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) - true - MultiThreaded - true - - - Level3 - - - NDEBUG;%(PreprocessorDefinitions) - 0x0c07 - - - ..\..\bin\Win32-VisualStudio\12.TerrainRendering.exe - ..\..\lib\Win32-visualstudio;%(AdditionalLibraryDirectories) - Console - - - - - - - .\Release/TerrainRendering.tlb - - - - - MaxSpeed - OnlyExplicitInline - ..\..\include;%(AdditionalIncludeDirectories) - WIN32;WIN64;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) - true - MultiThreaded - true - - - Level3 - - - NDEBUG;%(PreprocessorDefinitions) - 0x0c07 - - - ..\..\bin\Win64-VisualStudio\12.TerrainRendering.exe - ..\..\lib\Win64-visualstudio;%(AdditionalLibraryDirectories) - Console - - - - - - - Disabled - Disabled - %(AdditionalIncludeDirectories) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(PreprocessorDefinitions) - EnableFastChecks - EnableFastChecks - MaxSpeed - MaxSpeed - %(AdditionalIncludeDirectories) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(PreprocessorDefinitions) - - - - - - \ No newline at end of file diff --git a/examples/12.TerrainRendering/TerrainRendering_vc14.vcxproj b/examples/12.TerrainRendering/TerrainRendering_vc14.vcxproj deleted file mode 100644 index bf067fa2..00000000 --- a/examples/12.TerrainRendering/TerrainRendering_vc14.vcxproj +++ /dev/null @@ -1,235 +0,0 @@ - - - - - Debug - Win32 - - - Debug - x64 - - - Release - Win32 - - - Release - x64 - - - - 12.TerrainRendering - {3A5B74E5-6390-43B0-A459-2793B81FFD31} - TerrainRendering - - - - Application - false - MultiByte - v140 - - - Application - false - MultiByte - v140 - - - Application - false - MultiByte - v140 - - - Application - false - MultiByte - v140 - - - - - - - - - - - - - - - - - - - - - - - <_ProjectFileVersion>10.0.30319.1 - ..\..\bin\Win32-VisualStudio\ - ..\..\bin\Win64-VisualStudio\ - - - ..\..\bin\Win32-VisualStudio\ - ..\..\bin\Win64-VisualStudio\ - - - AllRules.ruleset - AllRules.ruleset - - - - - AllRules.ruleset - AllRules.ruleset - - - - - - - - .\Debug/TerrainRendering.tlb - - - - - Disabled - ..\..\include;%(AdditionalIncludeDirectories) - WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebug - - - Level3 - EditAndContinue - - - _DEBUG;%(PreprocessorDefinitions) - 0x0c07 - - - ..\..\bin\Win32-VisualStudio\12.TerrainRendering.exe - ..\..\lib\Win32-visualstudio;%(AdditionalLibraryDirectories) - true - Console - - - - - - - .\Debug/TerrainRendering.tlb - - - - - Disabled - ..\..\include;%(AdditionalIncludeDirectories) - WIN32;WIN64;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebug - - - Level3 - ProgramDatabase - - - _DEBUG;%(PreprocessorDefinitions) - 0x0c07 - - - ..\..\bin\Win64-VisualStudio\12.TerrainRendering.exe - ..\..\lib\Win64-visualstudio;%(AdditionalLibraryDirectories) - true - Console - - - - - - - .\Release/TerrainRendering.tlb - - - - - MaxSpeed - OnlyExplicitInline - ..\..\include;%(AdditionalIncludeDirectories) - WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) - true - MultiThreaded - true - - - Level3 - - - NDEBUG;%(PreprocessorDefinitions) - 0x0c07 - - - ..\..\bin\Win32-VisualStudio\12.TerrainRendering.exe - ..\..\lib\Win32-visualstudio;%(AdditionalLibraryDirectories) - Console - - - - - - - .\Release/TerrainRendering.tlb - - - - - MaxSpeed - OnlyExplicitInline - ..\..\include;%(AdditionalIncludeDirectories) - WIN32;WIN64;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) - true - MultiThreaded - true - - - Level3 - - - NDEBUG;%(PreprocessorDefinitions) - 0x0c07 - - - ..\..\bin\Win64-VisualStudio\12.TerrainRendering.exe - ..\..\lib\Win64-visualstudio;%(AdditionalLibraryDirectories) - Console - - - - - - - Disabled - Disabled - %(AdditionalIncludeDirectories) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(PreprocessorDefinitions) - EnableFastChecks - EnableFastChecks - MaxSpeed - MaxSpeed - %(AdditionalIncludeDirectories) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(PreprocessorDefinitions) - - - - - - \ No newline at end of file diff --git a/examples/12.TerrainRendering/main.cpp b/examples/12.TerrainRendering/main.cpp deleted file mode 100644 index f9bc97e6..00000000 --- a/examples/12.TerrainRendering/main.cpp +++ /dev/null @@ -1,287 +0,0 @@ -/** Example 012 Terrain Rendering - -This tutorial will briefly show how to use the terrain renderer of Irrlicht. It -will also show the terrain renderer triangle selector to be able to do -collision detection with terrain. - -Note that the Terrain Renderer in Irrlicht is based on Spintz' -GeoMipMapSceneNode, lots of thanks go to him. DeusXL provided a new elegant -simple solution for building larger area on small heightmaps -> terrain -smoothing. - -In the beginning there is nothing special. We include the needed header files -and create an event listener to listen if the user presses certain keys. -*/ -#include -#include "driverChoice.h" -#include "exampleHelper.h" - -using namespace irr; - -#ifdef _MSC_VER -#pragma comment(lib, "Irrlicht.lib") -#endif - - -class MyEventReceiver : public IEventReceiver -{ -public: - - MyEventReceiver(scene::ISceneNode* terrain, scene::ISceneNode* skybox, scene::ISceneNode* skydome) : - Terrain(terrain), Skybox(skybox), Skydome(skydome), showBox(true), showDebug(false) - { - Skybox->setVisible(showBox); - Skydome->setVisible(!showBox); - } - - bool OnEvent(const SEvent& event) - { - // check if user presses the key 'W' or 'D' - if (event.EventType == irr::EET_KEY_INPUT_EVENT && !event.KeyInput.PressedDown) - { - switch (event.KeyInput.Key) - { - case irr::KEY_KEY_W: // switch wire frame mode - Terrain->setMaterialFlag(video::EMF_WIREFRAME, - !Terrain->getMaterial(0).Wireframe); - Terrain->setMaterialFlag(video::EMF_POINTCLOUD, false); - return true; - case irr::KEY_KEY_P: // switch point cloud mode - Terrain->setMaterialFlag(video::EMF_POINTCLOUD, - !Terrain->getMaterial(0).PointCloud); - Terrain->setMaterialFlag(video::EMF_WIREFRAME, false); - return true; - case irr::KEY_KEY_D: // toggle detail map - Terrain->setMaterialType( - Terrain->getMaterial(0).MaterialType == video::EMT_SOLID ? - video::EMT_DETAIL_MAP : video::EMT_SOLID); - return true; - case irr::KEY_KEY_S: // toggle skies - showBox=!showBox; - Skybox->setVisible(showBox); - Skydome->setVisible(!showBox); - return true; - case irr::KEY_KEY_X: // toggle debug information - showDebug=!showDebug; - Terrain->setDebugDataVisible(showDebug?scene::EDS_BBOX_ALL:scene::EDS_OFF); - return true; - default: - break; - } - } - - return false; - } - -private: - scene::ISceneNode* Terrain; - scene::ISceneNode* Skybox; - scene::ISceneNode* Skydome; - bool showBox; - bool showDebug; -}; - - -/* -The start of the main function starts like in most other example. We ask the -user for the desired renderer and start it up. This time with the advanced -parameter handling. -*/ -int main() -{ - // ask user for driver - video::E_DRIVER_TYPE driverType=driverChoiceConsole(); - if (driverType==video::EDT_COUNT) - return 1; - - // create device with full flexibility over creation parameters - // you can add more parameters if desired, check irr::SIrrlichtCreationParameters - irr::SIrrlichtCreationParameters params; - params.DriverType=driverType; - params.WindowSize=core::dimension2d(640, 480); - IrrlichtDevice* device = createDeviceEx(params); - - if (device == 0) - return 1; // could not create selected driver. - - - /* - First, we add standard stuff to the scene: A nice irrlicht engine - logo, a small help text, a user controlled camera, and we disable - the mouse cursor. - */ - - video::IVideoDriver* driver = device->getVideoDriver(); - scene::ISceneManager* smgr = device->getSceneManager(); - gui::IGUIEnvironment* env = device->getGUIEnvironment(); - - driver->setTextureCreationFlag(video::ETCF_ALWAYS_32_BIT, true); - - const io::path mediaPath = getExampleMediaPath(); - - // add irrlicht logo - env->addImage(driver->getTexture(mediaPath + "irrlichtlogo3.png"), - core::position2d(10,10)); - - //set other font - env->getSkin()->setFont(env->getFont(mediaPath + "fontlucida.png")); - - // add some help text (let's ignore 'P' and 'X' which are more about debugging) - env->addStaticText( - L"Press 'W' to change wireframe mode\nPress 'D' to toggle detail map\nPress 'S' to toggle skybox/skydome", - core::rect(10,421,250,475), true, true, 0, -1, true); - - // add camera - scene::ICameraSceneNode* camera = - smgr->addCameraSceneNodeFPS(0,100.0f,1.2f); - - camera->setPosition(core::vector3df(2700*2,255*2,2600*2)); - camera->setTarget(core::vector3df(2397*2,343*2,2700*2)); - camera->setFarValue(42000.0f); - - // disable mouse cursor - device->getCursorControl()->setVisible(false); - - /* - Here comes the terrain renderer scene node: We add it just like any - other scene node to the scene using - ISceneManager::addTerrainSceneNode(). The first parameter is a - file name to the heightmap we use. A heightmap is simply a gray scale - texture. The terrain renderer loads it and creates the 3D terrain from - it. - - To make the terrain look bigger, we change it's scale factor to - (40, 4.4, 40). Because we don't have any dynamic lights in the - scene, we switch off the lighting, and we set the file - terrain-texture.jpg as texture for the terrain and detailmap3.jpg as - second texture, called detail map. At last, we set the scale values for - the texture: The first texture will be repeated only one time over the - whole terrain, and the second one (detail map) 20 times. - */ - - // add terrain scene node - scene::ITerrainSceneNode* terrain = smgr->addTerrainSceneNode( - mediaPath + "terrain-heightmap.bmp", - 0, // parent node - -1, // node id - core::vector3df(0.f, 0.f, 0.f), // position - core::vector3df(0.f, 0.f, 0.f), // rotation - core::vector3df(40.f, 4.4f, 40.f), // scale - video::SColor ( 255, 255, 255, 255 ), // vertexColor - 5, // maxLOD - scene::ETPS_17, // patchSize - 4 // smoothFactor - ); - - terrain->setMaterialFlag(video::EMF_LIGHTING, false); - - terrain->setMaterialTexture(0, - driver->getTexture(mediaPath + "terrain-texture.jpg")); - terrain->setMaterialTexture(1, - driver->getTexture(mediaPath + "detailmap3.jpg")); - - terrain->setMaterialType(video::EMT_DETAIL_MAP); - - terrain->scaleTexture(1.0f, 20.0f); - - /* - To be able to do collision with the terrain, we create a triangle selector. - If you want to know what triangle selectors do, just take a look into the - collision tutorial. The terrain triangle selector works together with the - terrain. To demonstrate this, we create a collision response animator - and attach it to the camera, so that the camera will not be able to fly - through the terrain. - */ - - // create triangle selector for the terrain - scene::ITriangleSelector* selector - = smgr->createTerrainTriangleSelector(terrain, 0); - terrain->setTriangleSelector(selector); - - // create collision response animator and attach it to the camera - scene::ISceneNodeAnimator* anim = smgr->createCollisionResponseAnimator( - selector, camera, core::vector3df(60,100,60), - core::vector3df(0,0,0), - core::vector3df(0,50,0)); - selector->drop(); - camera->addAnimator(anim); - anim->drop(); - - /* If you need access to the terrain data you can also do this directly via the following code fragment. - */ - scene::CDynamicMeshBuffer* buffer = new scene::CDynamicMeshBuffer(video::EVT_2TCOORDS, video::EIT_16BIT); - terrain->getMeshBufferForLOD(*buffer, 0); - video::S3DVertex2TCoords* data = (video::S3DVertex2TCoords*)buffer->getVertexBuffer().getData(); - // Work on data or get the IndexBuffer with a similar call. - (void)data; // disable unused variable warnings - buffer->drop(); // When done drop the buffer again. - - /* - To make the user be able to switch between normal and wireframe mode, - we create an instance of the event receiver from above and let Irrlicht - know about it. In addition, we add the skybox which we already used in - lots of Irrlicht examples and a skydome, which is shown mutually - exclusive with the skybox by pressing 'S'. - */ - - // create skybox and skydome - driver->setTextureCreationFlag(video::ETCF_CREATE_MIP_MAPS, false); - - scene::ISceneNode* skybox=smgr->addSkyBoxSceneNode( - driver->getTexture(mediaPath + "irrlicht2_up.jpg"), - driver->getTexture(mediaPath + "irrlicht2_dn.jpg"), - driver->getTexture(mediaPath + "irrlicht2_lf.jpg"), - driver->getTexture(mediaPath + "irrlicht2_rt.jpg"), - driver->getTexture(mediaPath + "irrlicht2_ft.jpg"), - driver->getTexture(mediaPath + "irrlicht2_bk.jpg")); - scene::ISceneNode* skydome=smgr->addSkyDomeSceneNode(driver->getTexture(mediaPath + "skydome.jpg"),16,8,0.95f,2.0f); - - driver->setTextureCreationFlag(video::ETCF_CREATE_MIP_MAPS, true); - - // create event receiver - MyEventReceiver receiver(terrain, skybox, skydome); - device->setEventReceiver(&receiver); - - /* - That's it, draw everything. - */ - - int lastFPS = -1; - - while(device->run()) - if (device->isWindowActive()) - { - driver->beginScene(video::ECBF_COLOR | video::ECBF_DEPTH, video::SColor(0)); - - smgr->drawAll(); - env->drawAll(); - - driver->endScene(); - - // display frames per second in window title - int fps = driver->getFPS(); - if (lastFPS != fps) - { - core::stringw str = L"Terrain Renderer - Irrlicht Engine ["; - str += driver->getName(); - str += "] FPS:"; - str += fps; - // Also print terrain height of current camera position - // We can use camera position because terrain is located at coordinate origin - str += " Height: "; - str += terrain->getHeight(camera->getAbsolutePosition().X, - camera->getAbsolutePosition().Z); - - device->setWindowCaption(str.c_str()); - lastFPS = fps; - } - } - - device->drop(); - - return 0; -} - -/* -Now you know how to use terrain in Irrlicht. -**/ diff --git a/examples/12.TerrainRendering/tutorial.html b/examples/12.TerrainRendering/tutorial.html deleted file mode 100644 index f3d765f9..00000000 --- a/examples/12.TerrainRendering/tutorial.html +++ /dev/null @@ -1,122 +0,0 @@ - - -Irrlicht Engine Tutorial - - - - -
- - - - - - - - -
-
-
Tutorial 12. Terrain Rendering
-
-
-
-

This tutorial will briefly show how to use the terrain renderer of - Irrlicht. It will also show the terrain renderer triangle selector to - be able to do collision detection with terrain.

-

The program which is described here will look like this:

-

-


- Note that the terrain renderer in Irrlicht is based the terrain renderer - by Soconne and the GeoMipMapSceneNode developed by Spinz, lots of thanks - go to them.

-
-
-
- - - - - - - -
Lets start!
-
-

In the beginning there is nothing special. We include the needed - header files and create an event listener to listen if the user presses - the 'W' key so we can switch to wireframe mode and if he presses 'D' - we toggle to material between solid and detail mapped.

- - - - -
#include <irrlicht.h>
#include <iostream>
using namespace irr;

#pragma comment(lib, "Irrlicht.lib")

class MyEventReceiver : public IEventReceiver
{
public:
MyEventReceiver(scene::ISceneNode* terrain)
{
// store pointer to terrain so we can change its drawing mode
Terrain = terrain;
}

bool OnEvent(const SEvent& event)
{
// check if user presses the key 'W' or 'D'
if (event.EventType == irr::EET_KEY_INPUT_EVENT && !event.KeyInput.PressedDown)
{
switch (event.KeyInput.Key)
{
case irr::KEY_KEY_W: // switch wire frame mode
Terrain->setMaterialFlag(video::EMF_WIREFRAME, !Terrain->getMaterial(0).Wireframe);
return true;
case irr::KEY_KEY_D: // toggle detail map
Terrain->setMaterialType(
Terrain->getMaterial(0).MaterialType == video::EMT_SOLID ?
video::EMT_DETAIL_MAP : video::EMT_SOLID);
return true;
}
}
return false;
}

private:
scene::ISceneNode* Terrain;
};

-

The start of the main function starts like in most other example. - We ask the user for the desired renderer and start it up.

- - - - -
int main()
{
// let user select driver type

video::E_DRIVER_TYPE driverType = video::EDT_DIRECT3D9;

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
IrrlichtDevice* device = createDevice(driverType, core::dimension2d<s32>(640, 480));

if (device == 0)
return 1; // could not create selected driver.
-

First, we add standard stuff to the scene: A nice irrlicht engine - logo, a small help text, a user controlled camera, and we disable - the mouse cursor.

- - - - -
video::IVideoDriver* driver = device->getVideoDriver();
scene::ISceneManager* smgr = device->getSceneManager();
gui::IGUIEnvironment* env = device->getGUIEnvironment();

driver->setTextureCreationFlag(video::ETCF_ALWAYS_32_BIT, true);

// add irrlicht logo
env->addImage(driver->getTexture("../../media/irrlichtlogoalpha.tga"),
core::position2d<s32>(10,10));
-// add some help text
gui::IGUIStaticText* text = env->addStaticText(
L"Press 'W' to change wireframe mode\nPress 'D' to toggle detail map",
core::rect<s32>(10,453,200,475), true, true, 0, -1, true);
-// add camera
scene::ICameraSceneNode* camera =
smgr->addCameraSceneNodeFPS(0,100.0f,1200.0f);
camera->setPosition(core::vector3df(1900*2,255*2,3700*2));
camera->setTarget(core::vector3df(2397*2,343*2,2700*2));
camera->setFarValue(12000.0f);

// disable mouse cursor
device->getCursorControl()->setVisible(false);
-

Here comes the terrain renderer scene node: We add it just like - any other scene node to the scene using ISceneManager::addTerrainSceneNode(). - The only parameter we use is a file name to the heightmap we use. - A heightmap is simply a gray scale texture. The terrain renderer loads - it and creates the 3D terrain from it.
- To make the terrain look more big, we change the scale factor of it - to (40, 4.4, 40). Because we don't have any dynamic lights in the - scene, we switch off the lighting, and we set the file terrain-texture.jpg - as texture for the terrain and detailmap3.jpg as second texture, called - detail map. At last, we set the scale values for the texture: The - first texture will be repeated only one time over the whole terrain, - and the second one (detail map) 20 times.

- - - - -
// add terrain scene node
scene::ITerrainSceneNode* terrain = smgr->addTerrainSceneNode(
"../../media/terrain-heightmap.bmp");

terrain->setScale(core::vector3df(40, 4.4f, 40));
terrain->setMaterialFlag(video::EMF_LIGHTING, false);

terrain->setMaterialTexture(0, driver->getTexture("../../media/terrain-texture.jpg"));
terrain->setMaterialTexture(1, driver->getTexture("../../media/detailmap3.jpg"));

terrain->setMaterialType(video::EMT_DETAIL_MAP);
terrain->scaleTexture(1.0f, 20.0f);
-

To be able to do collision with the terrain, we create a triangle - selector. If you want to know what triangle selectors do, just take - a look into the collision tutorial. The terrain triangle selector - works together with the terrain. To demonstrate this, we create a - collision response animator and attach it to the camera, so that the - camera will not be able to fly through the terrain.

-
- - - - -
// create triangle selector for the terrain	
scene::ITriangleSelector* selector =
smgr->createTerrainTriangleSelector(terrain, 0);
terrain->setTriangleSelector(selector);

// create collision response animator and attach it to the camera
scene::ISceneNodeAnimator* anim = smgr->createCollisionResponseAnimator(
selector, camera, core::vector3df(60,100,60),
core::vector3df(0,0,0),
core::vector3df(0,50,0));
selector->drop();
camera->addAnimator(anim);
anim->drop();
-

To make the user be able to switch between normal and wireframe mode, - we create an instance of the event reciever from above and let Irrlicht - know about it. In addition, we add the skybox which we already used - in lots of Irrlicht examples.

- - - - -
// create event receiver
MyEventReceiver receiver(terrain);
device->setEventReceiver(&receiver);

// create skybox
driver->setTextureCreationFlag(video::ETCF_CREATE_MIP_MAPS, false);

smgr->addSkyBoxSceneNode(
driver->getTexture("../../media/irrlicht2_up.jpg"),
driver->getTexture("../../media/irrlicht2_dn.jpg"),
driver->getTexture("../../media/irrlicht2_lf.jpg"),
driver->getTexture("../../media/irrlicht2_rt.jpg"),
driver->getTexture("../../media/irrlicht2_ft.jpg"),
driver->getTexture("../../media/irrlicht2_bk.jpg"));
-driver->setTextureCreationFlag(video::ETCF_CREATE_MIP_MAPS, true);
-

That's it, draw everything. Now you know how to use terrain in Irrlicht.

- - - - -
	int lastFPS = -1;

while(device->run())
if (device->isWindowActive())
{
driver->beginScene(true, true, 0 );

smgr->drawAll();
env->drawAll();

driver->endScene(); -
// display frames per second in window title - int fps = driver->getFPS();

if (lastFPS != fps)
{
core::stringw str = L"Terrain Renderer - Irrlicht Engine [";
str += driver->getName();
str += "] FPS:";
str += fps;
device->setWindowCaption(str.c_str());
lastFPS = fps;
}
}

device->drop();

return 0;
}
-

 

-
-
-

 

- - diff --git a/examples/13.RenderToTexture/Makefile b/examples/13.RenderToTexture/Makefile deleted file mode 100644 index 1022075a..00000000 --- a/examples/13.RenderToTexture/Makefile +++ /dev/null @@ -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 := 13.RenderToTexture -# 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 diff --git a/examples/13.RenderToTexture/RenderToTexture.cbp b/examples/13.RenderToTexture/RenderToTexture.cbp deleted file mode 100644 index 78c760b6..00000000 --- a/examples/13.RenderToTexture/RenderToTexture.cbp +++ /dev/null @@ -1,55 +0,0 @@ - - - - - - diff --git a/examples/13.RenderToTexture/RenderToTexture.vcproj b/examples/13.RenderToTexture/RenderToTexture.vcproj deleted file mode 100644 index 8fd8e6c2..00000000 --- a/examples/13.RenderToTexture/RenderToTexture.vcproj +++ /dev/null @@ -1,163 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/examples/13.RenderToTexture/RenderToTexture.xcodeproj/project.pbxproj b/examples/13.RenderToTexture/RenderToTexture.xcodeproj/project.pbxproj deleted file mode 100644 index f2f6fb31..00000000 --- a/examples/13.RenderToTexture/RenderToTexture.xcodeproj/project.pbxproj +++ /dev/null @@ -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 /* 13.RenderToTexture.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = 13.RenderToTexture.app; sourceTree = BUILT_PRODUCTS_DIR; }; - 5E34CC741B7F8EEF00F212E8 /* main.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = main.cpp; sourceTree = ""; }; - 5E34CC781B7F90A000F212E8 /* libIrrlicht.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libIrrlicht.a; path = ../../lib/OSX/libIrrlicht.a; sourceTree = ""; }; - 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 = ""; }; -/* 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 = ""; - }; - 5E34CC521B7F8E6E00F212E8 /* Products */ = { - isa = PBXGroup; - children = ( - 5E34CC511B7F8E6E00F212E8 /* 13.RenderToTexture.app */, - ); - name = Products; - sourceTree = ""; - }; - 5E34CC761B7F905600F212E8 /* Libraries */ = { - isa = PBXGroup; - children = ( - 5E8570B01B7F99F500B267D2 /* Cocoa.framework */, - 5E8570B41B7F9A0700B267D2 /* IOKit.framework */, - 5E8570B21B7F99FE00B267D2 /* OpenGL.framework */, - 5E34CC781B7F90A000F212E8 /* libIrrlicht.a */, - ); - name = Libraries; - sourceTree = ""; - }; - 5E34CC771B7F906D00F212E8 /* Resources */ = { - isa = PBXGroup; - children = ( - 5E8570BE1B7F9D3A00B267D2 /* media */, - ); - name = Resources; - sourceTree = ""; - }; -/* End PBXGroup section */ - -/* Begin PBXNativeTarget section */ - 5E34CC501B7F8E6E00F212E8 /* 13.RenderToTexture */ = { - isa = PBXNativeTarget; - buildConfigurationList = 5E34CC701B7F8E6E00F212E8 /* Build configuration list for PBXNativeTarget "13.RenderToTexture" */; - buildPhases = ( - 5E34CC4D1B7F8E6E00F212E8 /* Sources */, - 5E34CC4E1B7F8E6E00F212E8 /* Frameworks */, - 5E34CC4F1B7F8E6E00F212E8 /* Resources */, - ); - buildRules = ( - ); - dependencies = ( - ); - name = 13.RenderToTexture; - productName = 01.HelloWorld; - productReference = 5E34CC511B7F8E6E00F212E8 /* 13.RenderToTexture.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 "RenderToTexture" */; - compatibilityVersion = "Xcode 3.2"; - developmentRegion = English; - hasScannedForEncodings = 0; - knownRegions = ( - en, - Base, - ); - mainGroup = 5E34C6D81B7F4A0C00F212E8; - productRefGroup = 5E34CC521B7F8E6E00F212E8 /* Products */; - projectDirPath = ""; - projectRoot = ""; - targets = ( - 5E34CC501B7F8E6E00F212E8 /* 13.RenderToTexture */, - ); - }; -/* 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 "RenderToTexture" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 5E34C6DD1B7F4A0C00F212E8 /* Debug */, - 5E34C6DE1B7F4A0C00F212E8 /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - 5E34CC701B7F8E6E00F212E8 /* Build configuration list for PBXNativeTarget "13.RenderToTexture" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 5E34CC6C1B7F8E6E00F212E8 /* Debug */, - 5E34CC6D1B7F8E6E00F212E8 /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; -/* End XCConfigurationList section */ - }; - rootObject = 5E34C6D91B7F4A0C00F212E8 /* Project object */; -} diff --git a/examples/13.RenderToTexture/RenderToTexture.xcodeproj/xcshareddata/xcschemes/13.RenderToTexture.xcscheme b/examples/13.RenderToTexture/RenderToTexture.xcodeproj/xcshareddata/xcschemes/13.RenderToTexture.xcscheme deleted file mode 100644 index 3c99c7ce..00000000 --- a/examples/13.RenderToTexture/RenderToTexture.xcodeproj/xcshareddata/xcschemes/13.RenderToTexture.xcscheme +++ /dev/null @@ -1,91 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/examples/13.RenderToTexture/RenderToTexture_vc10.vcxproj b/examples/13.RenderToTexture/RenderToTexture_vc10.vcxproj deleted file mode 100644 index b41b2772..00000000 --- a/examples/13.RenderToTexture/RenderToTexture_vc10.vcxproj +++ /dev/null @@ -1,235 +0,0 @@ - - - - - Debug - Win32 - - - Debug - x64 - - - Release - Win32 - - - Release - x64 - - - - 13.RenderToTexture - {0914E5C8-5352-467B-8421-C9EB35BD5596} - RenderToTexture - - - - Application - false - MultiByte - Windows7.1SDK - - - Application - false - MultiByte - Windows7.1SDK - - - Application - false - MultiByte - Windows7.1SDK - - - Application - false - MultiByte - Windows7.1SDK - - - - - - - - - - - - - - - - - - - - - - - <_ProjectFileVersion>10.0.30319.1 - ..\..\bin\Win32-VisualStudio\ - ..\..\bin\Win64-VisualStudio\ - - - ..\..\bin\Win32-VisualStudio\ - ..\..\bin\Win64-VisualStudio\ - - - AllRules.ruleset - AllRules.ruleset - - - - - AllRules.ruleset - AllRules.ruleset - - - - - - - - .\Release/RenderToTexture.tlb - - - - - MaxSpeed - OnlyExplicitInline - ..\..\include;%(AdditionalIncludeDirectories) - WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) - true - MultiThreaded - true - - - Level3 - - - NDEBUG;%(PreprocessorDefinitions) - 0x0c07 - - - ..\..\bin\Win32-VisualStudio\13.RenderToTexture.exe - ..\..\lib\Win32-visualstudio;%(AdditionalLibraryDirectories) - Console - - - - - - - .\Release/RenderToTexture.tlb - - - - - MaxSpeed - OnlyExplicitInline - ..\..\include;%(AdditionalIncludeDirectories) - WIN32;WIN64;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) - true - MultiThreaded - true - - - Level3 - - - NDEBUG;%(PreprocessorDefinitions) - 0x0c07 - - - ..\..\bin\Win64-VisualStudio\13.RenderToTexture.exe - ..\..\lib\Win64-visualstudio;%(AdditionalLibraryDirectories) - Console - - - - - - - .\Debug/RenderToTexture.tlb - - - - - Disabled - ..\..\include;%(AdditionalIncludeDirectories) - WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebug - - - Level3 - EditAndContinue - - - _DEBUG;%(PreprocessorDefinitions) - 0x0c07 - - - ..\..\bin\Win32-VisualStudio\13.RenderToTexture.exe - ..\..\lib\Win32-visualstudio;%(AdditionalLibraryDirectories) - true - Console - - - - - - - .\Debug/RenderToTexture.tlb - - - - - Disabled - ..\..\include;%(AdditionalIncludeDirectories) - WIN32;WIN64;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebug - - - Level3 - ProgramDatabase - - - _DEBUG;%(PreprocessorDefinitions) - 0x0c07 - - - ..\..\bin\Win64-VisualStudio\13.RenderToTexture.exe - ..\..\lib\Win64-visualstudio;%(AdditionalLibraryDirectories) - true - Console - - - - - - - Disabled - Disabled - %(AdditionalIncludeDirectories) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(PreprocessorDefinitions) - EnableFastChecks - EnableFastChecks - MaxSpeed - MaxSpeed - %(AdditionalIncludeDirectories) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(PreprocessorDefinitions) - - - - - - \ No newline at end of file diff --git a/examples/13.RenderToTexture/RenderToTexture_vc11.vcxproj b/examples/13.RenderToTexture/RenderToTexture_vc11.vcxproj deleted file mode 100644 index b41b2772..00000000 --- a/examples/13.RenderToTexture/RenderToTexture_vc11.vcxproj +++ /dev/null @@ -1,235 +0,0 @@ - - - - - Debug - Win32 - - - Debug - x64 - - - Release - Win32 - - - Release - x64 - - - - 13.RenderToTexture - {0914E5C8-5352-467B-8421-C9EB35BD5596} - RenderToTexture - - - - Application - false - MultiByte - Windows7.1SDK - - - Application - false - MultiByte - Windows7.1SDK - - - Application - false - MultiByte - Windows7.1SDK - - - Application - false - MultiByte - Windows7.1SDK - - - - - - - - - - - - - - - - - - - - - - - <_ProjectFileVersion>10.0.30319.1 - ..\..\bin\Win32-VisualStudio\ - ..\..\bin\Win64-VisualStudio\ - - - ..\..\bin\Win32-VisualStudio\ - ..\..\bin\Win64-VisualStudio\ - - - AllRules.ruleset - AllRules.ruleset - - - - - AllRules.ruleset - AllRules.ruleset - - - - - - - - .\Release/RenderToTexture.tlb - - - - - MaxSpeed - OnlyExplicitInline - ..\..\include;%(AdditionalIncludeDirectories) - WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) - true - MultiThreaded - true - - - Level3 - - - NDEBUG;%(PreprocessorDefinitions) - 0x0c07 - - - ..\..\bin\Win32-VisualStudio\13.RenderToTexture.exe - ..\..\lib\Win32-visualstudio;%(AdditionalLibraryDirectories) - Console - - - - - - - .\Release/RenderToTexture.tlb - - - - - MaxSpeed - OnlyExplicitInline - ..\..\include;%(AdditionalIncludeDirectories) - WIN32;WIN64;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) - true - MultiThreaded - true - - - Level3 - - - NDEBUG;%(PreprocessorDefinitions) - 0x0c07 - - - ..\..\bin\Win64-VisualStudio\13.RenderToTexture.exe - ..\..\lib\Win64-visualstudio;%(AdditionalLibraryDirectories) - Console - - - - - - - .\Debug/RenderToTexture.tlb - - - - - Disabled - ..\..\include;%(AdditionalIncludeDirectories) - WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebug - - - Level3 - EditAndContinue - - - _DEBUG;%(PreprocessorDefinitions) - 0x0c07 - - - ..\..\bin\Win32-VisualStudio\13.RenderToTexture.exe - ..\..\lib\Win32-visualstudio;%(AdditionalLibraryDirectories) - true - Console - - - - - - - .\Debug/RenderToTexture.tlb - - - - - Disabled - ..\..\include;%(AdditionalIncludeDirectories) - WIN32;WIN64;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebug - - - Level3 - ProgramDatabase - - - _DEBUG;%(PreprocessorDefinitions) - 0x0c07 - - - ..\..\bin\Win64-VisualStudio\13.RenderToTexture.exe - ..\..\lib\Win64-visualstudio;%(AdditionalLibraryDirectories) - true - Console - - - - - - - Disabled - Disabled - %(AdditionalIncludeDirectories) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(PreprocessorDefinitions) - EnableFastChecks - EnableFastChecks - MaxSpeed - MaxSpeed - %(AdditionalIncludeDirectories) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(PreprocessorDefinitions) - - - - - - \ No newline at end of file diff --git a/examples/13.RenderToTexture/RenderToTexture_vc12.vcxproj b/examples/13.RenderToTexture/RenderToTexture_vc12.vcxproj deleted file mode 100644 index 5ede2aee..00000000 --- a/examples/13.RenderToTexture/RenderToTexture_vc12.vcxproj +++ /dev/null @@ -1,235 +0,0 @@ - - - - - Debug - Win32 - - - Debug - x64 - - - Release - Win32 - - - Release - x64 - - - - 13.RenderToTexture - {0914E5C8-5352-467B-8421-C9EB35BD5596} - RenderToTexture - - - - Application - false - MultiByte - Windows7.1SDK - - - Application - false - MultiByte - Windows7.1SDK - - - Application - false - MultiByte - Windows7.1SDK - - - Application - false - MultiByte - Windows7.1SDK - - - - - - - - - - - - - - - - - - - - - - - <_ProjectFileVersion>10.0.30319.1 - ..\..\bin\Win32-VisualStudio\ - ..\..\bin\Win64-VisualStudio\ - - - ..\..\bin\Win32-VisualStudio\ - ..\..\bin\Win64-VisualStudio\ - - - AllRules.ruleset - AllRules.ruleset - - - - - AllRules.ruleset - AllRules.ruleset - - - - - - - - .\Release/RenderToTexture.tlb - - - - - MaxSpeed - OnlyExplicitInline - ..\..\include;%(AdditionalIncludeDirectories) - WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) - true - MultiThreaded - true - - - Level3 - - - NDEBUG;%(PreprocessorDefinitions) - 0x0c07 - - - ..\..\bin\Win32-VisualStudio\13.RenderToTexture.exe - ..\..\lib\Win32-visualstudio;%(AdditionalLibraryDirectories) - Console - - - - - - - .\Release/RenderToTexture.tlb - - - - - MaxSpeed - OnlyExplicitInline - ..\..\include;%(AdditionalIncludeDirectories) - WIN32;WIN64;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) - true - MultiThreaded - true - - - Level3 - - - NDEBUG;%(PreprocessorDefinitions) - 0x0c07 - - - ..\..\bin\Win64-VisualStudio\13.RenderToTexture.exe - ..\..\lib\Win64-visualstudio;%(AdditionalLibraryDirectories) - Console - - - - - - - .\Debug/RenderToTexture.tlb - - - - - Disabled - ..\..\include;%(AdditionalIncludeDirectories) - WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebug - - - Level3 - EditAndContinue - - - _DEBUG;%(PreprocessorDefinitions) - 0x0c07 - - - ..\..\bin\Win32-VisualStudio\13.RenderToTexture.exe - ..\..\lib\Win32-visualstudio;%(AdditionalLibraryDirectories) - true - Console - - - - - - - .\Debug/RenderToTexture.tlb - - - - - Disabled - ..\..\include;%(AdditionalIncludeDirectories) - WIN32;WIN64;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebug - - - Level3 - ProgramDatabase - - - _DEBUG;%(PreprocessorDefinitions) - 0x0c07 - - - ..\..\bin\Win64-VisualStudio\13.RenderToTexture.exe - ..\..\lib\Win64-visualstudio;%(AdditionalLibraryDirectories) - true - Console - - - - - - - Disabled - Disabled - %(AdditionalIncludeDirectories) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(PreprocessorDefinitions) - EnableFastChecks - EnableFastChecks - MaxSpeed - MaxSpeed - %(AdditionalIncludeDirectories) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(PreprocessorDefinitions) - - - - - - \ No newline at end of file diff --git a/examples/13.RenderToTexture/RenderToTexture_vc14.vcxproj b/examples/13.RenderToTexture/RenderToTexture_vc14.vcxproj deleted file mode 100644 index 5316976e..00000000 --- a/examples/13.RenderToTexture/RenderToTexture_vc14.vcxproj +++ /dev/null @@ -1,235 +0,0 @@ - - - - - Debug - Win32 - - - Debug - x64 - - - Release - Win32 - - - Release - x64 - - - - 13.RenderToTexture - {0914E5C8-5352-467B-8421-C9EB35BD5596} - RenderToTexture - - - - Application - false - MultiByte - v140 - - - Application - false - MultiByte - v140 - - - Application - false - MultiByte - v140 - - - Application - false - MultiByte - v140 - - - - - - - - - - - - - - - - - - - - - - - <_ProjectFileVersion>10.0.30319.1 - ..\..\bin\Win32-VisualStudio\ - ..\..\bin\Win64-VisualStudio\ - - - ..\..\bin\Win32-VisualStudio\ - ..\..\bin\Win64-VisualStudio\ - - - AllRules.ruleset - AllRules.ruleset - - - - - AllRules.ruleset - AllRules.ruleset - - - - - - - - .\Release/RenderToTexture.tlb - - - - - MaxSpeed - OnlyExplicitInline - ..\..\include;%(AdditionalIncludeDirectories) - WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) - true - MultiThreaded - true - - - Level3 - - - NDEBUG;%(PreprocessorDefinitions) - 0x0c07 - - - ..\..\bin\Win32-VisualStudio\13.RenderToTexture.exe - ..\..\lib\Win32-visualstudio;%(AdditionalLibraryDirectories) - Console - - - - - - - .\Release/RenderToTexture.tlb - - - - - MaxSpeed - OnlyExplicitInline - ..\..\include;%(AdditionalIncludeDirectories) - WIN32;WIN64;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) - true - MultiThreaded - true - - - Level3 - - - NDEBUG;%(PreprocessorDefinitions) - 0x0c07 - - - ..\..\bin\Win64-VisualStudio\13.RenderToTexture.exe - ..\..\lib\Win64-visualstudio;%(AdditionalLibraryDirectories) - Console - - - - - - - .\Debug/RenderToTexture.tlb - - - - - Disabled - ..\..\include;%(AdditionalIncludeDirectories) - WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebug - - - Level3 - EditAndContinue - - - _DEBUG;%(PreprocessorDefinitions) - 0x0c07 - - - ..\..\bin\Win32-VisualStudio\13.RenderToTexture.exe - ..\..\lib\Win32-visualstudio;%(AdditionalLibraryDirectories) - true - Console - - - - - - - .\Debug/RenderToTexture.tlb - - - - - Disabled - ..\..\include;%(AdditionalIncludeDirectories) - WIN32;WIN64;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebug - - - Level3 - ProgramDatabase - - - _DEBUG;%(PreprocessorDefinitions) - 0x0c07 - - - ..\..\bin\Win64-VisualStudio\13.RenderToTexture.exe - ..\..\lib\Win64-visualstudio;%(AdditionalLibraryDirectories) - true - Console - - - - - - - Disabled - Disabled - %(AdditionalIncludeDirectories) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(PreprocessorDefinitions) - EnableFastChecks - EnableFastChecks - MaxSpeed - MaxSpeed - %(AdditionalIncludeDirectories) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(PreprocessorDefinitions) - - - - - - \ No newline at end of file diff --git a/examples/13.RenderToTexture/main.cpp b/examples/13.RenderToTexture/main.cpp deleted file mode 100644 index 99a18eac..00000000 --- a/examples/13.RenderToTexture/main.cpp +++ /dev/null @@ -1,229 +0,0 @@ -/** Example 013 Render To Texture - -This tutorial shows how to render to a texture using Irrlicht. Render to -texture is a feature where everything which would usually be rendered to -the screen is instead written to a (special) texture. This can be used to -create nice special effects. -In addition, this tutorial shows how to enable specular highlights. - -In the beginning, everything as usual. Include the needed headers, ask the user -for the rendering driver, create the Irrlicht device: -*/ - -#include -#include "driverChoice.h" -#include "exampleHelper.h" - -using namespace irr; - -#ifdef _MSC_VER -#pragma comment(lib, "Irrlicht.lib") -#endif - -int main() -{ - // 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(640, 480), - 16, false, false); - - if (device == 0) - return 1; // could not create selected driver. - - video::IVideoDriver* driver = device->getVideoDriver(); - scene::ISceneManager* smgr = device->getSceneManager(); - gui::IGUIEnvironment* env = device->getGUIEnvironment(); - - const io::path mediaPath = getExampleMediaPath(); - - /* - Now, we load an animated mesh to be displayed. As in most examples, - we'll take the fairy md2 model. The difference here: We set the - shininess of the model to a value other than 0 which is the default - value. This enables specular highlights on the model if dynamic - lighting is on. The value influences the size of the highlights. - */ - - // load and display animated fairy mesh - - scene::IAnimatedMeshSceneNode* fairy = smgr->addAnimatedMeshSceneNode( - smgr->getMesh(mediaPath + "faerie.md2")); - - if (fairy) - { - fairy->setMaterialTexture(0, - driver->getTexture(mediaPath + "faerie2.bmp")); // set diffuse texture - fairy->setMaterialFlag(video::EMF_LIGHTING, true); // enable dynamic lighting - fairy->getMaterial(0).Shininess = 20.0f; // set size of specular highlights - fairy->setPosition(core::vector3df(-10,0,-100)); - fairy->setMD2Animation ( scene::EMAT_STAND ); - } - - /* - To make specular highlights appear on the model, we need a dynamic - light in the scene. We add one directly in vicinity of the model. In - addition, to make the model not that dark, we set the ambient light to - gray. - */ - - // add white light - smgr->addLightSceneNode(0, core::vector3df(-15,5,-105), - video::SColorf(1.0f, 1.0f, 1.0f)); - - // set ambient light - smgr->setAmbientLight(video::SColor(0,60,60,60)); - - /* - The next is just some standard stuff: Add a test cube and let it rotate - to make the scene more interesting. The user defined camera and cursor - setup is made later on, right before the render loop. - */ - - // create test cube - scene::ISceneNode* cube = smgr->addCubeSceneNode(60); - - // let the cube rotate and set some light settings - scene::ISceneNodeAnimator* anim = smgr->createRotationAnimator( - core::vector3df(0.3f, 0.3f,0)); - - cube->setPosition(core::vector3df(-100,0,-100)); - cube->setMaterialFlag(video::EMF_LIGHTING, false); // disable dynamic lighting - cube->addAnimator(anim); - anim->drop(); - - // set window caption - device->setWindowCaption(L"Irrlicht Engine - Render to Texture and Specular Highlights example"); - - /* - To test out the render to texture feature, we need to define our - new rendertarget. The rendertarget will need one texture to receive - the result you would otherwise see on screen and one texture - which is used as depth-buffer. - - (Note: If you worked with older Irrlicht versions (before 1.9) you might be - used to only create a rendertarget texture and no explicit rendertarget. While - that's still possible, it's no longer recommended.) - - The rendertarget textures are not like standard textures, but need to be created - first. To create them, we call IVideoDriver::addRenderTargetTexture() - and specify the size of the texture and the type. - For depth-maps you can use types ECF_D16, ECF_D32 or ECF_D24S8. When ECF_D24S8 - you can also use a stencil-buffer. - - Because we want to render the scene not from the user camera into the - texture, we add another fixed camera to the scene. But before we do all - this, we check if the current running driver is able to render to - textures. If it is not, we simply display a warning text. - */ - - // create render target - video::IRenderTarget* renderTarget = 0; - scene::ICameraSceneNode* fixedCam = 0; - - if (driver->queryFeature(video::EVDF_RENDER_TO_TARGET)) - { - const core::dimension2d rtDim(256, 256); // always use same size for render target texture and it's depth-buffer - video::ITexture* renderTargetTex = driver->addRenderTargetTexture(rtDim, "RTT1", video::ECF_A8R8G8B8); - video::ITexture* renderTargetDepth = driver->addRenderTargetTexture(rtDim, "DepthStencil", video::ECF_D16); - - renderTarget = driver->addRenderTarget(); - renderTarget->setTexture(renderTargetTex, renderTargetDepth); - - cube->setMaterialTexture(0, renderTargetTex); // set material of cube to render target - - // add fixed camera - fixedCam = smgr->addCameraSceneNode(0, core::vector3df(10,10,-80), - core::vector3df(-10,10,-100)); - } - else - { - // create problem text - gui::IGUISkin* skin = env->getSkin(); - gui::IGUIFont* font = env->getFont(mediaPath + "fonthaettenschweiler.bmp"); - if (font) - skin->setFont(font); - - gui::IGUIStaticText* text = env->addStaticText( - L"Your hardware or this renderer is not able to use the "\ - L"render to texture feature. RTT Disabled.", - core::rect(150,20,470,60)); - - text->setOverrideColor(video::SColor(100,255,255,255)); - } - - // add fps camera - scene::ICameraSceneNode* fpsCamera = smgr->addCameraSceneNodeFPS(); - fpsCamera->setPosition(core::vector3df(-50,50,-150)); - - // disable mouse cursor - device->getCursorControl()->setVisible(false); - - /* - Nearly finished. Now we need to draw everything. Every frame, we draw - the scene twice. Once from the fixed camera into the render target - texture and once as usual. When rendering into the render target, we - need to disable the visibility of the test cube, because it has the - render target texture applied to it. That's it, wasn't too complicated - I hope. :) - */ - - int lastFPS = -1; - - while(device->run()) - if (device->isWindowActive()) - { - driver->beginScene(video::ECBF_COLOR | video::ECBF_DEPTH, video::SColor(0)); - - if (renderTarget) - { - // draw scene into render target - - // set render target - driver->setRenderTargetEx(renderTarget, video::ECBF_COLOR | video::ECBF_DEPTH, video::SColor(0,0,0,255)); - - // make cube invisible and set fixed camera as active camera - cube->setVisible(false); - smgr->setActiveCamera(fixedCam); - - // draw whole scene into render buffer - smgr->drawAll(); - - // set back old render target (the screen) - driver->setRenderTargetEx(0, 0); - - // make the cube visible and set the user controlled camera as active one - cube->setVisible(true); - smgr->setActiveCamera(fpsCamera); - } - - // draw scene normally - smgr->drawAll(); - env->drawAll(); - - driver->endScene(); - - // display frames per second in window title - int fps = driver->getFPS(); - if (lastFPS != fps) - { - core::stringw str = L"Irrlicht Engine - Render to Texture and Specular Highlights example"; - str += " FPS:"; - str += fps; - - device->setWindowCaption(str.c_str()); - lastFPS = fps; - } - } - - device->drop(); // drop device - return 0; -} - -/* -**/ diff --git a/examples/13.RenderToTexture/tutorial.html b/examples/13.RenderToTexture/tutorial.html deleted file mode 100644 index 26340a3e..00000000 --- a/examples/13.RenderToTexture/tutorial.html +++ /dev/null @@ -1,244 +0,0 @@ - - -Irrlicht Engine Tutorial - - - - -
- - - - - - - - -
-
-
Tutorial 13. Render to Texture
-
-
-
-

This tutorial shows how to render to a texture using Irrlicht. Render - to texture is a feature with which it is possible to create nice special - effects. In addition, this tutorial shows how to enable specular highlights.

-

The program which is described here will look like this:

-


-

-
-
-
- - - - - - - -
Lets start!
-
-

In the beginning, everything as usual. Include the needed headers, - ask the user for the rendering driver, create the Irrlicht Device:

- - - - -
#include <irrlicht.h>
-#include <iostream>
-
-using namespace irr;
-
-#pragma comment(lib, "Irrlicht.lib")
-
-int main()
-{
-	// let user select driver type
-
-	video::E_DRIVER_TYPE driverType = video::EDT_DIRECT3D9;
-
-	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(640, 480), - 16, false, false); - - if (device == 0) - return 1; // could not create selected driver. - - video::IVideoDriver* driver = device->getVideoDriver(); - scene::ISceneManager* smgr = device->getSceneManager(); - gui::IGUIEnvironment* env = device->getGUIEnvironment();
-

Now, we load an animated mesh to be displayed. As in most examples, - we'll take the fairy md2 model. The difference here: We set the shininess
- of the model to a value other than 0 which is the default value. This - enables specular highlights on the model if dynamic lighting is on. - The value influences the size of the highlights.

- - - - -
// load and display animated fairy mesh
-
-	scene::IAnimatedMeshSceneNode* fairy = smgr->addAnimatedMeshSceneNode(
-		smgr->getMesh("../../media/faerie.md2"));
-
-	if (fairy)
-	{
-		fairy->setMaterialTexture(0, driver->getTexture("../../media/faerie2.bmp")); // set diffuse texture
-		fairy->setMaterialFlag(video::EMF_LIGHTING, true); // enable dynamic lighting
-		fairy->getMaterial(0).Shininess = 20.0f; // set size of specular highlights
-		fairy->setPosition(core::vector3df(-10,0,-100));
-	}
-

To make specular highlights appear on the model, we need a dynamic - light in the scene. We add one directly in vicinity of the model. - In addition, to make the model not that dark, we set the ambient light - to gray.

- - - - -
-	// add white light
-	scene::ILightSceneNode* light = smgr->addLightSceneNode(0,
-		core::vector3df(-15,5,-105), video::SColorf(1.0f, 1.0f, 1.0f));
-
-	// set ambient light
-	driver->setAmbientLight(video::SColor(0,60,60,60));
-

The next is just some standard stuff: Add a user controlled camera - to the scene, disable mouse cursor, and add a test cube and let it - rotate to make the scene more interesting.

- - - - -
-	// add fps camera
-	scene::ICameraSceneNode* fpsCamera = smgr->addCameraSceneNodeFPS();
-	fpsCamera->setPosition(core::vector3df(-50,50,-150));
-
-	// disable mouse cursor
-	device->getCursorControl()->setVisible(false);
-
-	// create test cube
-	scene::ISceneNode* test = smgr->addCubeSceneNode(60);
-
-	// let the cube rotate and set some light settings
-	scene::ISceneNodeAnimator* anim = smgr->createRotationAnimator(
-		core::vector3df(0.3f, 0.3f,0));
-
-	test->setPosition(core::vector3df(-100,0,-100));
-	test->setMaterialFlag(video::EMF_LIGHTING, false); // disable dynamic lighting
-	test->addAnimator(anim);
-	anim->drop();
-
-	// set window caption
-	device->setWindowCaption(L"Irrlicht Engine - Render to Texture and Specular Highlights example");
-

To test out the render to texture feature, we need a render target - texture. These are not like standard textures, but need to be created - first. To create one, we call IVideoDriver::createRenderTargetTexture() - and specify the size of the texture. Please don't use sizes bigger - than the frame buffer for this, because the render target shares the - zbuffer with the frame buffer. And because we want to render the scene - not from the user camera into the texture, we add another, fixed camera - to the scene. But before we do all this, we check if the current running - driver is able to render to textures. If it is not, we simply display - a warning text.

- - - - -
// create render target
-	video::ITexture* rt = 0;
-	scene::ICameraSceneNode* fixedCam = 0;
-	
-
-	if (driver->queryFeature(video::EVDF_RENDER_TO_TARGET))
-	{
-		rt = driver->createRenderTargetTexture(core::dimension2d(256,256));
-		test->setMaterialTexture(0, rt); // set material of cube to render target
-
-		// add fixed camera
-		fixedCam = smgr->addCameraSceneNode(0, core::vector3df(10,10,-80),
-			core::vector3df(-10,10,-100));
-	}
-	else
-	{
-		// create problem text
-		gui::IGUISkin* skin = env->getSkin();
-		gui::IGUIFont* font = env->getFont("../../media/fonthaettenschweiler.bmp");
-		if (font)
-			skin->setFont(font);
-
-		gui::IGUIStaticText* text = env->addStaticText(
-			L"Your hardware or this renderer is not able to use the "\
-			L"render to texture feature. RTT Disabled.",
-			core::rect(150,20,470,60));
-
-		text->setOverrideColor(video::SColor(100,255,255,255));
-	}
-

Nearly finished. Now we need to draw everything. Every frame, we - draw the scene twice. Once from the fixed camera into the render target - texture and once as usual. When rendering into the render target, - we need to disable the visibilty of the test cube, because it has - the render target texture applied to it.
- That's, wasn't quite complicated I hope. :)

- - - - -
while(device->run())
-	if (device->isWindowActive())
-	{
-		driver->beginScene(true, true, 0);
-
-		if (rt)
-		{
-			// draw scene into render target
-			
-			// set render target texture
-			driver->setRenderTarget(rt, true, true, video::SColor(0,0,0,255));     
-
-			// make cube invisible and set fixed camera as active camera
-			test->setVisible(false);
-			smgr->setActiveCamera(fixedCam);
-
-			// draw whole scene into render buffer
-			smgr->drawAll();                 
-
-			// set back old render target
-			driver->setRenderTarget(0);      
-
-			// make the cube visible and set the user controlled camera as active one
-			test->setVisible(true);
-			smgr->setActiveCamera(fpsCamera);
-		}
-		
-		// draw scene normally
-		smgr->drawAll(); 
-		env->drawAll();
-
-		driver->endScene();
-	}
-
-	if (rt)
-		rt->drop(); // drop render target because we created if with a create() method
-
-	device->drop(); // drop device
-	return 0;
-}
-
- -

 

-
-
-

 

- - diff --git a/examples/13.RenderToTexture_emscripten/Makefile b/examples/13.RenderToTexture_emscripten/Makefile deleted file mode 100644 index 81dcc442..00000000 --- a/examples/13.RenderToTexture_emscripten/Makefile +++ /dev/null @@ -1,74 +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 := 13.RenderToTexture -# 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) - -all_emscripten: EMSCRIPTEN=1 - -# general compiler settings (might need to be set when compiling the lib, too) -CPPFLAGS += -I$(IrrlichtHome)/include -I/usr/X11R6/include -ifndef NDEBUG - ifdef EMSCRIPTEN - LDFLAGS += -s DEMANGLE_SUPPORT=1 - endif - CXXFLAGS += -g -Wall -else - ifdef EMSCRIPTEN - LDFLAGS += -O3 - endif - CXXFLAGS += -O3 -endif - -#default target is Linux -all: all_emscripten - -# target specific settings -all_linux all_emscripten 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_emscripten clean_emscripten: SYSTEM=emscripten -all_win32 clean_win32 static_win32: SYSTEM=Win32-gcc -all_win32 clean_win32 static_win32: SUF=.exe -all_emscripten clean_emscripten: SUF=.html -all_emscripten: CXXFLAGS += -fno-exceptions -fno-rtti -fstrict-aliasing -std=gnu++11 -U__STRICT_ANSI__ -all_emscripten: LDFLAGS += -lGL -lSDL --preload-file ../../media@/media -s ALLOW_MEMORY_GROWTH=1 -s NO_EXIT_RUNTIME=1 -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 all_emscripten static_win32: - $(warning Building...) - $(CXX) $(CPPFLAGS) $(CXXFLAGS) $(Sources) -o $(DESTPATH) $(LDFLAGS) - -clean: clean_linux clean_win32 clean_emscripten - $(warning Cleaning...) - -clean_linux clean_win32: - @$(RM) $(DESTPATH) - -clean_emscripten: - @$(RM) $(BinPath)/$(Target).data - @$(RM) $(BinPath)/$(Target).html* - @$(RM) $(BinPath)/$(Target).js - - -.PHONY: all all_win32 all_emscripten static_win32 clean clean_linux clean_win32 clean_emscripten - -#multilib handling -ifeq ($(HOSTTYPE), x86_64) -LIBSELECT=64 -endif -#solaris real-time features -ifeq ($(HOSTTYPE), sun4) -LDFLAGS += -lrt -endif diff --git a/examples/13.RenderToTexture_emscripten/main.cpp b/examples/13.RenderToTexture_emscripten/main.cpp deleted file mode 100644 index f9916887..00000000 --- a/examples/13.RenderToTexture_emscripten/main.cpp +++ /dev/null @@ -1,172 +0,0 @@ -/** Example 013 Render To Texture on emscripten -*/ - -#include -#include -#include "exampleHelper.h" - -using namespace irr; - -IrrlichtDevice *device = 0; -video::IVideoDriver* driver = 0; -scene::ISceneManager* smgr = 0; -gui::IGUIEnvironment* guienv = 0; -scene::ICameraSceneNode* fpsCamera = 0; -scene::ICameraSceneNode* fixedCam = 0; -video::IRenderTarget* renderTarget = 0; -scene::ISceneNode* cube = 0; - -void one_iter() -{ - if(!device->run()) - { - // Could clean up here in theory, but not sure if it makes a difference - - /* - This tells emscripten to not run any further code. - */ - emscripten_cancel_main_loop(); - return; - } - - driver->beginScene(video::ECBF_COLOR | video::ECBF_DEPTH, video::SColor(0)); - - if (renderTarget) - { - // draw scene into render target - - // set render target - driver->setRenderTargetEx(renderTarget, video::ECBF_COLOR | video::ECBF_DEPTH, video::SColor(0,0,0,255)); - - // make cube invisible and set fixed camera as active camera - cube->setVisible(false); - smgr->setActiveCamera(fixedCam); - - // draw whole scene into render buffer - smgr->drawAll(); - - // set back old render target - // The buffer might have been distorted, so clear it - driver->setRenderTargetEx(0, 0, video::SColor(0)); - - // make the cube visible and set the user controlled camera as active one - cube->setVisible(true); - smgr->setActiveCamera(fpsCamera); - } - - // draw scene normally - smgr->drawAll(); - guienv->drawAll(); - - driver->endScene(); -} - -int main() -{ - // create device and exit if creation failed - - device = createDevice(video::EDT_WEBGL1, core::dimension2d(640, 480), 16, false, false); - - if (device == 0) - return 1; // could not create selected driver. - - driver = device->getVideoDriver(); - smgr = device->getSceneManager(); - guienv = device->getGUIEnvironment(); - - const io::path mediaPath = getExampleMediaPath(); - - - // load and display animated fairy mesh - scene::IAnimatedMeshSceneNode* fairy = smgr->addAnimatedMeshSceneNode( - smgr->getMesh(mediaPath + "faerie.md2")); - - if (!fairy) - return 1; - - fairy->setMaterialTexture(0, driver->getTexture(mediaPath + "faerie2.bmp")); // set diffuse texture - fairy->setMaterialFlag(video::EMF_LIGHTING, true); // enable dynamic lighting - fairy->getMaterial(0).Shininess = 20.0f; // set size of specular highlights - fairy->setPosition(core::vector3df(-10,0,-100)); - fairy->setMD2Animation ( scene::EMAT_STAND ); - - // add white light - smgr->addLightSceneNode(0, core::vector3df(-15,5,-105), video::SColorf(1.0f, 1.0f, 1.0f)); - - // set ambient light - smgr->setAmbientLight(video::SColor(0,60,60,60)); - - /* - The next is just some standard stuff: Add a test cube and let it rotate - to make the scene more interesting. The user defined camera and cursor - setup is made later on, right before the render loop. - */ - - // create test cube - cube = smgr->addCubeSceneNode(60); - - // let the cube rotate and set some light settings - scene::ISceneNodeAnimator* anim = smgr->createRotationAnimator( - core::vector3df(0.3f, 0.3f,0)); - - cube->setPosition(core::vector3df(-100,0,-100)); - cube->setMaterialFlag(video::EMF_LIGHTING, false); // disable dynamic lighting - cube->addAnimator(anim); - anim->drop(); - - // set window caption - device->setWindowCaption(L"Irrlicht Engine - Render to Texture and Specular Highlights example"); - - /* - To test out the render to texture feature, we need a render target - texture. These are not like standard textures, but need to be created - first. To create one, we call IVideoDriver::addRenderTargetTexture() - and specify the size of the texture. Please don't use sizes bigger than - the frame buffer for this, because the render target shares the zbuffer - with the frame buffer. - Because we want to render the scene not from the user camera into the - texture, we add another fixed camera to the scene. But before we do all - this, we check if the current running driver is able to render to - textures. If it is not, we simply display a warning text. - */ - - // create render target - if (driver->queryFeature(video::EVDF_RENDER_TO_TARGET)) - { - video::ITexture* renderTargetTex = driver->addRenderTargetTexture(core::dimension2d(256, 256), "RTT1", video::ECF_A8R8G8B8); - video::ITexture* renderTargetDepth = driver->addRenderTargetTexture(core::dimension2d(256, 256), "DepthStencil", video::ECF_D16); - - renderTarget = driver->addRenderTarget(); - renderTarget->setTexture(renderTargetTex, renderTargetDepth); - - cube->setMaterialTexture(0, renderTargetTex); // set material of cube to render target - - // add fixed camera - fixedCam = smgr->addCameraSceneNode(0, core::vector3df(10,10,-80), - core::vector3df(-10,10,-100)); - } - else - { - return 1; - } - - // add fps camera - fpsCamera = smgr->addCameraSceneNodeFPS(); - fpsCamera->setPosition(core::vector3df(-50,50,-150)); - -/* - Setting fps to 0 or a negative value will use the browser’s - requestAnimationFrame mechanism to call the main loop function. - Emscripten documentation recommends to do that, but you can also set - another fps value and the browser will try to call the main-loop - fps times per second. - The simulate_infinite_loop tells emscripten that this is an application - which will simulate an infinite loop. There is also a flag in the - Makefile about that: -s NO_EXIT_RUNTIME=1 - */ - int fps = 0; - int simulate_infinite_loop = 1; - emscripten_set_main_loop(one_iter, fps, simulate_infinite_loop); - - return 0; -} diff --git a/examples/14.Win32Window/Makefile b/examples/14.Win32Window/Makefile deleted file mode 100644 index 5813ca0a..00000000 --- a/examples/14.Win32Window/Makefile +++ /dev/null @@ -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 := 14.Win32Window -# 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 diff --git a/examples/14.Win32Window/Win32Window.cbp b/examples/14.Win32Window/Win32Window.cbp deleted file mode 100644 index 06f310b7..00000000 --- a/examples/14.Win32Window/Win32Window.cbp +++ /dev/null @@ -1,43 +0,0 @@ - - - - - - diff --git a/examples/14.Win32Window/Win32Window.vcproj b/examples/14.Win32Window/Win32Window.vcproj deleted file mode 100644 index c8576c76..00000000 --- a/examples/14.Win32Window/Win32Window.vcproj +++ /dev/null @@ -1,165 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/examples/14.Win32Window/Win32Window_vc10.vcxproj b/examples/14.Win32Window/Win32Window_vc10.vcxproj deleted file mode 100644 index 0ea47dbd..00000000 --- a/examples/14.Win32Window/Win32Window_vc10.vcxproj +++ /dev/null @@ -1,239 +0,0 @@ - - - - - Debug - Win32 - - - Debug - x64 - - - Release - Win32 - - - Release - x64 - - - - 14.Win32Window - {772FBE05-D05A-467B-9842-BEC409EEA8D0} - Win32Window - - - - Application - false - MultiByte - Windows7.1SDK - - - Application - false - MultiByte - Windows7.1SDK - - - Application - false - MultiByte - Windows7.1SDK - - - Application - false - MultiByte - Windows7.1SDK - - - - - - - - - - - - - - - - - - - - - - - <_ProjectFileVersion>10.0.30319.1 - ..\..\bin\Win32-VisualStudio\ - ..\..\bin\Win64-VisualStudio\ - - - ..\..\bin\Win32-VisualStudio\ - ..\..\bin\Win64-VisualStudio\ - - - AllRules.ruleset - AllRules.ruleset - - - - - AllRules.ruleset - AllRules.ruleset - - - - - - - - .\Debug/Win32Window.tlb - - - - - Disabled - ..\..\include;%(AdditionalIncludeDirectories) - WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebug - - - Level3 - EditAndContinue - - - _DEBUG;%(PreprocessorDefinitions) - 0x0c07 - - - opengl32.lib;%(AdditionalDependencies) - ..\..\bin\Win32-VisualStudio\14.Win32Window.exe - ..\..\lib\Win32-visualstudio;%(AdditionalLibraryDirectories) - true - Console - - - - - - - .\Debug/Win32Window.tlb - - - - - Disabled - ..\..\include;%(AdditionalIncludeDirectories) - WIN32;WIN64;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebug - - - Level3 - ProgramDatabase - - - _DEBUG;%(PreprocessorDefinitions) - 0x0c07 - - - opengl32.lib;%(AdditionalDependencies) - ..\..\bin\Win64-VisualStudio\14.Win32Window.exe - ..\..\lib\Win64-visualstudio;%(AdditionalLibraryDirectories) - true - Console - - - - - - - .\Release/Win32Window.tlb - - - - - MaxSpeed - OnlyExplicitInline - ..\..\include;%(AdditionalIncludeDirectories) - WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) - true - MultiThreaded - true - - - Level3 - - - NDEBUG;%(PreprocessorDefinitions) - 0x0c07 - - - opengl32.lib;%(AdditionalDependencies) - ..\..\bin\Win32-VisualStudio\14.Win32Window.exe - ..\..\lib\Win32-visualstudio;%(AdditionalLibraryDirectories) - Console - - - - - - - .\Release/Win32Window.tlb - - - - - MaxSpeed - OnlyExplicitInline - ..\..\include;%(AdditionalIncludeDirectories) - WIN32;WIN64;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) - true - MultiThreaded - true - - - Level3 - - - NDEBUG;%(PreprocessorDefinitions) - 0x0c07 - - - opengl32.lib;%(AdditionalDependencies) - ..\..\bin\Win64-VisualStudio\14.Win32Window.exe - ..\..\lib\Win64-visualstudio;%(AdditionalLibraryDirectories) - Console - - - - - - - Disabled - Disabled - %(AdditionalIncludeDirectories) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(PreprocessorDefinitions) - EnableFastChecks - EnableFastChecks - MaxSpeed - MaxSpeed - %(AdditionalIncludeDirectories) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(PreprocessorDefinitions) - - - - - - \ No newline at end of file diff --git a/examples/14.Win32Window/Win32Window_vc11.vcxproj b/examples/14.Win32Window/Win32Window_vc11.vcxproj deleted file mode 100644 index 0ea47dbd..00000000 --- a/examples/14.Win32Window/Win32Window_vc11.vcxproj +++ /dev/null @@ -1,239 +0,0 @@ - - - - - Debug - Win32 - - - Debug - x64 - - - Release - Win32 - - - Release - x64 - - - - 14.Win32Window - {772FBE05-D05A-467B-9842-BEC409EEA8D0} - Win32Window - - - - Application - false - MultiByte - Windows7.1SDK - - - Application - false - MultiByte - Windows7.1SDK - - - Application - false - MultiByte - Windows7.1SDK - - - Application - false - MultiByte - Windows7.1SDK - - - - - - - - - - - - - - - - - - - - - - - <_ProjectFileVersion>10.0.30319.1 - ..\..\bin\Win32-VisualStudio\ - ..\..\bin\Win64-VisualStudio\ - - - ..\..\bin\Win32-VisualStudio\ - ..\..\bin\Win64-VisualStudio\ - - - AllRules.ruleset - AllRules.ruleset - - - - - AllRules.ruleset - AllRules.ruleset - - - - - - - - .\Debug/Win32Window.tlb - - - - - Disabled - ..\..\include;%(AdditionalIncludeDirectories) - WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebug - - - Level3 - EditAndContinue - - - _DEBUG;%(PreprocessorDefinitions) - 0x0c07 - - - opengl32.lib;%(AdditionalDependencies) - ..\..\bin\Win32-VisualStudio\14.Win32Window.exe - ..\..\lib\Win32-visualstudio;%(AdditionalLibraryDirectories) - true - Console - - - - - - - .\Debug/Win32Window.tlb - - - - - Disabled - ..\..\include;%(AdditionalIncludeDirectories) - WIN32;WIN64;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebug - - - Level3 - ProgramDatabase - - - _DEBUG;%(PreprocessorDefinitions) - 0x0c07 - - - opengl32.lib;%(AdditionalDependencies) - ..\..\bin\Win64-VisualStudio\14.Win32Window.exe - ..\..\lib\Win64-visualstudio;%(AdditionalLibraryDirectories) - true - Console - - - - - - - .\Release/Win32Window.tlb - - - - - MaxSpeed - OnlyExplicitInline - ..\..\include;%(AdditionalIncludeDirectories) - WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) - true - MultiThreaded - true - - - Level3 - - - NDEBUG;%(PreprocessorDefinitions) - 0x0c07 - - - opengl32.lib;%(AdditionalDependencies) - ..\..\bin\Win32-VisualStudio\14.Win32Window.exe - ..\..\lib\Win32-visualstudio;%(AdditionalLibraryDirectories) - Console - - - - - - - .\Release/Win32Window.tlb - - - - - MaxSpeed - OnlyExplicitInline - ..\..\include;%(AdditionalIncludeDirectories) - WIN32;WIN64;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) - true - MultiThreaded - true - - - Level3 - - - NDEBUG;%(PreprocessorDefinitions) - 0x0c07 - - - opengl32.lib;%(AdditionalDependencies) - ..\..\bin\Win64-VisualStudio\14.Win32Window.exe - ..\..\lib\Win64-visualstudio;%(AdditionalLibraryDirectories) - Console - - - - - - - Disabled - Disabled - %(AdditionalIncludeDirectories) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(PreprocessorDefinitions) - EnableFastChecks - EnableFastChecks - MaxSpeed - MaxSpeed - %(AdditionalIncludeDirectories) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(PreprocessorDefinitions) - - - - - - \ No newline at end of file diff --git a/examples/14.Win32Window/Win32Window_vc12.vcxproj b/examples/14.Win32Window/Win32Window_vc12.vcxproj deleted file mode 100644 index 814a398d..00000000 --- a/examples/14.Win32Window/Win32Window_vc12.vcxproj +++ /dev/null @@ -1,239 +0,0 @@ - - - - - Debug - Win32 - - - Debug - x64 - - - Release - Win32 - - - Release - x64 - - - - 14.Win32Window - {772FBE05-D05A-467B-9842-BEC409EEA8D0} - Win32Window - - - - Application - false - MultiByte - Windows7.1SDK - - - Application - false - MultiByte - Windows7.1SDK - - - Application - false - MultiByte - Windows7.1SDK - - - Application - false - MultiByte - Windows7.1SDK - - - - - - - - - - - - - - - - - - - - - - - <_ProjectFileVersion>10.0.30319.1 - ..\..\bin\Win32-VisualStudio\ - ..\..\bin\Win64-VisualStudio\ - - - ..\..\bin\Win32-VisualStudio\ - ..\..\bin\Win64-VisualStudio\ - - - AllRules.ruleset - AllRules.ruleset - - - - - AllRules.ruleset - AllRules.ruleset - - - - - - - - .\Debug/Win32Window.tlb - - - - - Disabled - ..\..\include;%(AdditionalIncludeDirectories) - WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebug - - - Level3 - EditAndContinue - - - _DEBUG;%(PreprocessorDefinitions) - 0x0c07 - - - opengl32.lib;%(AdditionalDependencies) - ..\..\bin\Win32-VisualStudio\14.Win32Window.exe - ..\..\lib\Win32-visualstudio;%(AdditionalLibraryDirectories) - true - Console - - - - - - - .\Debug/Win32Window.tlb - - - - - Disabled - ..\..\include;%(AdditionalIncludeDirectories) - WIN32;WIN64;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebug - - - Level3 - ProgramDatabase - - - _DEBUG;%(PreprocessorDefinitions) - 0x0c07 - - - opengl32.lib;%(AdditionalDependencies) - ..\..\bin\Win64-VisualStudio\14.Win32Window.exe - ..\..\lib\Win64-visualstudio;%(AdditionalLibraryDirectories) - true - Console - - - - - - - .\Release/Win32Window.tlb - - - - - MaxSpeed - OnlyExplicitInline - ..\..\include;%(AdditionalIncludeDirectories) - WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) - true - MultiThreaded - true - - - Level3 - - - NDEBUG;%(PreprocessorDefinitions) - 0x0c07 - - - opengl32.lib;%(AdditionalDependencies) - ..\..\bin\Win32-VisualStudio\14.Win32Window.exe - ..\..\lib\Win32-visualstudio;%(AdditionalLibraryDirectories) - Console - - - - - - - .\Release/Win32Window.tlb - - - - - MaxSpeed - OnlyExplicitInline - ..\..\include;%(AdditionalIncludeDirectories) - WIN32;WIN64;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) - true - MultiThreaded - true - - - Level3 - - - NDEBUG;%(PreprocessorDefinitions) - 0x0c07 - - - opengl32.lib;%(AdditionalDependencies) - ..\..\bin\Win64-VisualStudio\14.Win32Window.exe - ..\..\lib\Win64-visualstudio;%(AdditionalLibraryDirectories) - Console - - - - - - - Disabled - Disabled - %(AdditionalIncludeDirectories) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(PreprocessorDefinitions) - EnableFastChecks - EnableFastChecks - MaxSpeed - MaxSpeed - %(AdditionalIncludeDirectories) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(PreprocessorDefinitions) - - - - - - \ No newline at end of file diff --git a/examples/14.Win32Window/Win32Window_vc14.vcxproj b/examples/14.Win32Window/Win32Window_vc14.vcxproj deleted file mode 100644 index 3142d412..00000000 --- a/examples/14.Win32Window/Win32Window_vc14.vcxproj +++ /dev/null @@ -1,239 +0,0 @@ - - - - - Debug - Win32 - - - Debug - x64 - - - Release - Win32 - - - Release - x64 - - - - 14.Win32Window - {772FBE05-D05A-467B-9842-BEC409EEA8D0} - Win32Window - - - - Application - false - MultiByte - v140 - - - Application - false - MultiByte - v140 - - - Application - false - MultiByte - v140 - - - Application - false - MultiByte - v140 - - - - - - - - - - - - - - - - - - - - - - - <_ProjectFileVersion>10.0.30319.1 - ..\..\bin\Win32-VisualStudio\ - ..\..\bin\Win64-VisualStudio\ - - - ..\..\bin\Win32-VisualStudio\ - ..\..\bin\Win64-VisualStudio\ - - - AllRules.ruleset - AllRules.ruleset - - - - - AllRules.ruleset - AllRules.ruleset - - - - - - - - .\Debug/Win32Window.tlb - - - - - Disabled - ..\..\include;%(AdditionalIncludeDirectories) - WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebug - - - Level3 - EditAndContinue - - - _DEBUG;%(PreprocessorDefinitions) - 0x0c07 - - - opengl32.lib;%(AdditionalDependencies) - ..\..\bin\Win32-VisualStudio\14.Win32Window.exe - ..\..\lib\Win32-visualstudio;%(AdditionalLibraryDirectories) - true - Console - - - - - - - .\Debug/Win32Window.tlb - - - - - Disabled - ..\..\include;%(AdditionalIncludeDirectories) - WIN32;WIN64;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebug - - - Level3 - ProgramDatabase - - - _DEBUG;%(PreprocessorDefinitions) - 0x0c07 - - - opengl32.lib;%(AdditionalDependencies) - ..\..\bin\Win64-VisualStudio\14.Win32Window.exe - ..\..\lib\Win64-visualstudio;%(AdditionalLibraryDirectories) - true - Console - - - - - - - .\Release/Win32Window.tlb - - - - - MaxSpeed - OnlyExplicitInline - ..\..\include;%(AdditionalIncludeDirectories) - WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) - true - MultiThreaded - true - - - Level3 - - - NDEBUG;%(PreprocessorDefinitions) - 0x0c07 - - - opengl32.lib;%(AdditionalDependencies) - ..\..\bin\Win32-VisualStudio\14.Win32Window.exe - ..\..\lib\Win32-visualstudio;%(AdditionalLibraryDirectories) - Console - - - - - - - .\Release/Win32Window.tlb - - - - - MaxSpeed - OnlyExplicitInline - ..\..\include;%(AdditionalIncludeDirectories) - WIN32;WIN64;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) - true - MultiThreaded - true - - - Level3 - - - NDEBUG;%(PreprocessorDefinitions) - 0x0c07 - - - opengl32.lib;%(AdditionalDependencies) - ..\..\bin\Win64-VisualStudio\14.Win32Window.exe - ..\..\lib\Win64-visualstudio;%(AdditionalLibraryDirectories) - Console - - - - - - - Disabled - Disabled - %(AdditionalIncludeDirectories) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(PreprocessorDefinitions) - EnableFastChecks - EnableFastChecks - MaxSpeed - MaxSpeed - %(AdditionalIncludeDirectories) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(PreprocessorDefinitions) - - - - - - \ No newline at end of file diff --git a/examples/14.Win32Window/main.cpp b/examples/14.Win32Window/main.cpp deleted file mode 100644 index 183381b9..00000000 --- a/examples/14.Win32Window/main.cpp +++ /dev/null @@ -1,263 +0,0 @@ -/** Example 014 Win32 Window - -This example only runs under MS Windows and demonstrates that Irrlicht can -render inside a win32 window. MFC and .NET Windows.Forms windows are possible, -too. - -In the beginning, we create a windows window using the windows API. I'm not -going to explain this code, because it is windows specific. See the MSDN or a -windows book for details. -*/ - -#include -#ifndef _IRR_WINDOWS_ -#error Windows only example -#else -#include // this example only runs with windows -#include -#include "driverChoice.h" -#include "exampleHelper.h" - -using namespace irr; - -#ifdef _MSC_VER -#pragma comment(lib, "irrlicht.lib") -#endif - -HWND hOKButton; -HWND hWnd; - -static LRESULT CALLBACK CustomWndProc(HWND hWnd, UINT message, - WPARAM wParam, LPARAM lParam) -{ - switch (message) - { - case WM_COMMAND: - { - HWND hwndCtl = (HWND)lParam; - int code = HIWORD(wParam); - - if (hwndCtl == hOKButton) - { - DestroyWindow(hWnd); - PostQuitMessage(0); - return 0; - } - } - break; - case WM_DESTROY: - PostQuitMessage(0); - return 0; - - } - - return DefWindowProc(hWnd, message, wParam, lParam); -} - - -/* - Now ask for the driver and create the Windows specific window. -*/ -int main() -{ - // ask user for driver - video::E_DRIVER_TYPE driverType=driverChoiceConsole(); - if (driverType==video::EDT_COUNT) - return 1; - - printf("Select the render window (some dead window may exist too):\n"\ - " (a) Window with button (via CreationParam)\n"\ - " (b) Window with button (via beginScene)\n"\ - " (c) Own Irrlicht window (default behavior)\n"\ - " (otherKey) exit\n\n"); - - char key; - std::cin >> key; - if (key != 'a' && key != 'b' && key != 'c') - return 1; - - HINSTANCE hInstance = 0; - // create dialog - - const fschar_t* Win32ClassName = __TEXT("CIrrlichtWindowsTestDialog"); - - WNDCLASSEX wcex; - wcex.cbSize = sizeof(WNDCLASSEX); - wcex.style = CS_HREDRAW | CS_VREDRAW; - wcex.lpfnWndProc = (WNDPROC)CustomWndProc; - wcex.cbClsExtra = 0; - wcex.cbWndExtra = DLGWINDOWEXTRA; - wcex.hInstance = hInstance; - wcex.hIcon = NULL; - wcex.hCursor = LoadCursor(NULL, IDC_ARROW); - wcex.hbrBackground = (HBRUSH)(COLOR_WINDOW); - wcex.lpszMenuName = 0; - wcex.lpszClassName = Win32ClassName; - wcex.hIconSm = 0; - - RegisterClassEx(&wcex); - - DWORD style = WS_SYSMENU | WS_BORDER | WS_CAPTION | - WS_CLIPCHILDREN | WS_CLIPSIBLINGS | WS_MAXIMIZEBOX | WS_MINIMIZEBOX | WS_SIZEBOX; - - int windowWidth = 440; - int windowHeight = 380; - - hWnd = CreateWindow( Win32ClassName, __TEXT("Irrlicht Win32 window example"), - style, 100, 100, windowWidth, windowHeight, - NULL, NULL, hInstance, NULL); - - RECT clientRect; - GetClientRect(hWnd, &clientRect); - windowWidth = clientRect.right; - windowHeight = clientRect.bottom; - - // create ok button - - hOKButton = CreateWindow(__TEXT("BUTTON"), __TEXT("OK - Close"), WS_CHILD | WS_VISIBLE | BS_TEXT, - windowWidth - 160, windowHeight - 40, 150, 30, hWnd, NULL, hInstance, NULL); - - // create some text - - CreateWindow(__TEXT("STATIC"), __TEXT("This is Irrlicht running inside a standard Win32 window.\n")\ - __TEXT("Also mixing with MFC and .NET Windows.Forms is possible."), - WS_CHILD | WS_VISIBLE, 20, 20, 400, 40, hWnd, NULL, hInstance, NULL); - - // create window to put irrlicht in - - HWND hIrrlichtWindow = CreateWindow(__TEXT("BUTTON"), __TEXT(""), - WS_CHILD | WS_VISIBLE | BS_OWNERDRAW, - 50, 80, 320, 220, hWnd, NULL, hInstance, NULL); - video::SExposedVideoData videodata((key=='b')?hIrrlichtWindow:0); - - /* - So now that we have some window, we can create an Irrlicht device - inside of it. We use Irrlicht createEx() function for this. We only - need the handle (HWND) to that window, set it as windowsID parameter - and start up the engine as usual. That's it. - */ - // create irrlicht device in the button window - - irr::SIrrlichtCreationParameters param; - param.DriverType = driverType; - if (key=='a') - param.WindowId = reinterpret_cast(hIrrlichtWindow); - - irr::IrrlichtDevice* device = irr::createDeviceEx(param); - - // setup a simple 3d scene - - irr::scene::ISceneManager* smgr = device->getSceneManager(); - video::IVideoDriver* driver = device->getVideoDriver(); - - if (driverType==video::EDT_OPENGL) - { - HDC HDc=GetDC(hIrrlichtWindow); - PIXELFORMATDESCRIPTOR pfd={0}; - pfd.nSize=sizeof(PIXELFORMATDESCRIPTOR); - int pf = GetPixelFormat(HDc); - DescribePixelFormat(HDc, pf, sizeof(PIXELFORMATDESCRIPTOR), &pfd); - pfd.dwFlags |= PFD_DOUBLEBUFFER | PFD_SUPPORT_OPENGL | PFD_DRAW_TO_WINDOW; - pfd.cDepthBits=16; - pf = ChoosePixelFormat(HDc, &pfd); - SetPixelFormat(HDc, pf, &pfd); - videodata.OpenGLWin32.HDc = HDc; - videodata.OpenGLWin32.HRc=wglCreateContext(HDc); - wglShareLists((HGLRC)driver->getExposedVideoData().OpenGLWin32.HRc, (HGLRC)videodata.OpenGLWin32.HRc); - } - scene::ICameraSceneNode* cam = smgr->addCameraSceneNode(); - cam->setTarget(core::vector3df(0,0,0)); - - scene::ISceneNodeAnimator* anim = - smgr->createFlyCircleAnimator(core::vector3df(0,15,0), 30.0f); - cam->addAnimator(anim); - anim->drop(); - - scene::ISceneNode* cube = smgr->addCubeSceneNode(20); - - const io::path mediaPath = getExampleMediaPath(); - - cube->setMaterialTexture(0, driver->getTexture(mediaPath + "wall.bmp")); - cube->setMaterialTexture(1, driver->getTexture(mediaPath + "water.jpg")); - cube->setMaterialFlag( video::EMF_LIGHTING, false ); - cube->setMaterialType( video::EMT_REFLECTION_2_LAYER ); - - smgr->addSkyBoxSceneNode( - driver->getTexture(mediaPath + "irrlicht2_up.jpg"), - driver->getTexture(mediaPath + "irrlicht2_dn.jpg"), - driver->getTexture(mediaPath + "irrlicht2_lf.jpg"), - driver->getTexture(mediaPath + "irrlicht2_rt.jpg"), - driver->getTexture(mediaPath + "irrlicht2_ft.jpg"), - driver->getTexture(mediaPath + "irrlicht2_bk.jpg")); - - // This shows that we can render to multiple windows within one application - device->getGUIEnvironment()->addStaticText(core::stringw("Second screen render").c_str(),core::recti(0,0,200,200)); - - // show and execute dialog - - ShowWindow(hWnd , SW_SHOW); - UpdateWindow(hWnd); - - // do message queue - - /* - Now the only thing missing is the drawing loop using - IrrlichtDevice::run(). We do this as usual. But instead of this, there - is another possibility: You can also simply use your own message loop - using GetMessage, DispatchMessage and whatever. Calling - Device->run() will cause Irrlicht to dispatch messages internally too. - You need not call Device->run() if you want to do your own message - dispatching loop, but Irrlicht will not be able to fetch user input - then and you have to do it on your own using the window messages, - DirectInput, or whatever. - */ - - while (device->run()) - { - driver->beginScene(video::ECBF_COLOR | video::ECBF_DEPTH, video::SColor(0), 1.f, 0, videodata); - smgr->drawAll(); - driver->endScene(); - if (key=='b') - { - driver->beginScene(video::ECBF_COLOR | video::ECBF_DEPTH, video::SColor(0xbbbbbbbb)); - device->getGUIEnvironment()->drawAll(); - driver->endScene(); - } - } - - /* - The alternative, own message dispatching loop without Device->run() - would look like this: - */ - - /*MSG msg; - while (true) - { - if (PeekMessage(&msg, NULL, 0, 0, PM_REMOVE)) - { - TranslateMessage(&msg); - DispatchMessage(&msg); - - if (msg.message == WM_QUIT) - break; - } - - // advance virtual time - device->getTimer()->tick(); - - // draw engine picture - driver->beginScene(true, true, 0, (key=='c')?hIrrlichtWindow:0); - smgr->drawAll(); - driver->endScene(); - }*/ - - device->closeDevice(); - device->drop(); - - return 0; -} -#endif // if windows - -/* -That's it, Irrlicht now runs in your own windows window. -**/ diff --git a/examples/14.Win32Window/tutorial.html b/examples/14.Win32Window/tutorial.html deleted file mode 100644 index 6c5d5baa..00000000 --- a/examples/14.Win32Window/tutorial.html +++ /dev/null @@ -1,247 +0,0 @@ - - -Irrlicht Engine Tutorial - - - - -
- - - - - - - - -
-
-
Tutorial 14. Win32 Window
-
-
-
-

This example only runs in Windows and demonstrates that Irrlicht can - run inside a win32 window. MFC and .NET Windows.Forms windows are possible - too.

-

The program which is described here will look like this:

-


-

-
-
-
- - - - - - - -
Lets start!
-
-

In the begining, we create a windows window using the windows API. - I'm not going to explain this code, because it is windows specific. - See the MSDN or a windows book for details.

- - - - -
#include <irrlicht.h>
-#include <windows.h> // this example only runs with windows
-
-using namespace irr;
-
-#pragma comment(lib, "irrlicht.lib")
-
-HWND hOKButton;
-HWND hWnd;
-
-static LRESULT CALLBACK CustomWndProc(HWND hWnd, UINT message,
-    WPARAM wParam, LPARAM lParam)
-{
-	switch (message) 
-	{
-	case WM_COMMAND:
-		{
-			HWND hwndCtl = (HWND)lParam;
-			int code = HIWORD(wParam);
-
-			if (hwndCtl == hOKButton)
-			{
-				DestroyWindow(hWnd);
-				PostQuitMessage(0);
-				return 0;
-			}		
-		}
-		break;
-	case WM_DESTROY:
-		PostQuitMessage(0);
-		return 0;
-
-	}
-
-	return DefWindowProc(hWnd, message, wParam, lParam);
-}
-
-int main()
-//int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hpre, LPSTR cmd, int cc)
-{
-	HINSTANCE hInstance = 0;
-	// create dialog
-
-	const char* Win32ClassName = "CIrrlichtWindowsTestDialog";
-
-	WNDCLASSEX wcex;
-	wcex.cbSize			= sizeof(WNDCLASSEX); 
-	wcex.style			= CS_HREDRAW | CS_VREDRAW;
-	wcex.lpfnWndProc	= (WNDPROC)CustomWndProc;
-	wcex.cbClsExtra		= 0;
-	wcex.cbWndExtra		= DLGWINDOWEXTRA; 
-	wcex.hInstance		= hInstance;
-	wcex.hIcon			= NULL;
-	wcex.hCursor		= LoadCursor(NULL, IDC_ARROW);
-	wcex.hbrBackground	= (HBRUSH)(COLOR_WINDOW);
-	wcex.lpszMenuName	= 0;
-	wcex.lpszClassName	= Win32ClassName;
-	wcex.hIconSm		= 0;
-
-	RegisterClassEx(&wcex);
-
-	DWORD style = WS_SYSMENU | WS_BORDER | WS_CAPTION | 
-		WS_CLIPCHILDREN | WS_CLIPSIBLINGS | WS_MAXIMIZEBOX
-		| WS_MINIMIZEBOX | WS_SIZEBOX;
-
-	int windowWidth = 440;
-	int windowHeight = 380;
-
-	hWnd = CreateWindow( Win32ClassName, "Irrlicht Win32 window example",
-		style, 100, 100, windowWidth, windowHeight,
-		NULL, NULL, hInstance, NULL);
-
-	RECT clientRect;
-	GetClientRect(hWnd, &clientRect);
-	windowWidth = clientRect.right;
-	windowHeight = clientRect.bottom;
-
-	// create ok button
-
-	hOKButton = CreateWindow(
-	    "BUTTON", "OK - Close", WS_CHILD | WS_VISIBLE | BS_TEXT, 
-		windowWidth - 160, windowHeight - 40, 150, 30, hWnd, NULL, 
-		hInstance, NULL);
-
-	// create some text
-	
-	CreateWindow("STATIC", 
-        "This is Irrlicht running inside a standard Win32 window.\n"\
-		"Also mixing with MFC and .NET Windows.Forms is possible.",
-		WS_CHILD | WS_VISIBLE, 20, 20, 400, 40, hWnd, NULL, hInstance, NULL);
-
-	// create window to put irrlicht in
-
-	HWND hIrrlichtWindow =
CreateWindow("BUTTON", "", WS_CHILD | WS_VISIBLE | BS_OWNERDRAW, - 50, 80, 320, 220, hWnd, NULL, hInstance, NULL); - -
-

So now that we have some window, we can create an Irrlicht device - inside of it. We use Irrlicht createEx() function for this. We only - need the handle (HWND) to that window, set it as windowsID parameter - and start up the engine as usual. That's it.

- - - - -
	// create irrlicht device in the button window
-
-	irr::SIrrlichtCreationParameters param;
-	param.WindowId = reinterpret_cast(hIrrlichtWindow); // hColorButton
-	param.DriverType = video::EDT_OPENGL;
-
-	irr::IrrlichtDevice* device = irr::createDeviceEx(param);
-	
-	// setup a simple 3d scene
-
-	irr::scene::ISceneManager* smgr = device->getSceneManager();
-	video::IVideoDriver* driver = device->getVideoDriver();
-
-	scene::ICameraSceneNode* cam = smgr->addCameraSceneNode();
-	cam->setTarget(core::vector3df(0,0,0));
-
-	scene::ISceneNodeAnimator* anim =
-	   smgr->createFlyCircleAnimator(core::vector3df(0,10,0), 30.0f);
-	cam->addAnimator(anim);
-	anim->drop();
-
-	scene::ISceneNode* cube = smgr->addCubeSceneNode(25);
-	cube->setMaterialFlag(video::EMF_LIGHTING, false);
-	
-	cube->setMaterialTexture(0, driver->getTexture("../../media/rockwall.bmp"));
-
-	smgr->addSkyBoxSceneNode(
-	driver->getTexture("../../media/irrlicht2_up.jpg"),
-	driver->getTexture("../../media/irrlicht2_dn.jpg"),
-	driver->getTexture("../../media/irrlicht2_lf.jpg"),
-	driver->getTexture("../../media/irrlicht2_rt.jpg"),
-	driver->getTexture("../../media/irrlicht2_ft.jpg"),
-	driver->getTexture("../../media/irrlicht2_bk.jpg"));
-
-	// show and execute dialog
-
-	ShowWindow(hWnd , SW_SHOW);
-	UpdateWindow(hWnd);
-
-

Now the only thing missing is the drawing loop using IrrlichtDevice::run(). - We do this as usual. But instead of this, there is another possibility: - You can also simply use your own message loop using GetMessage, DispatchMessage - and whatever. Calling
- Device->run() will cause Irrlicht to dispatch messages internally - too. You need not call Device->run() if you want to do your own - message dispatching loop, but Irrlicht will not be able to fetch user - input then and you have to do it on your own using the window messages, - DirectInput, or whatever.

- - - - -
	while (device->run())
-	{
-		driver->beginScene(true, true, 0);
-		smgr->drawAll();
-		driver->endScene();
-	}
-
-	// the alternative, own message dispatching loop without Device->run() would
-	// look like this:
-
-	/*MSG msg;
-	while (true)
-	{
-		if (PeekMessage(&msg, NULL, 0, 0, PM_REMOVE))
-		{
-			TranslateMessage(&msg);
-			DispatchMessage(&msg);
-
-			if (msg.message == WM_QUIT)
-				break;
-		}
-		
-		// advance virtual time
-		device->getTimer()->tick();
-
-		// draw engine picture
-		driver->beginScene(true, true, 0);
-		smgr->drawAll();
-		driver->endScene();
-	}*/
-
-	device->closeDevice();
-	device->drop();
-
-	return 0;
-}
-

That's it, Irrlicht now runs in your own windows window.

-
-
-
-

 

- - diff --git a/examples/16.Quake3MapShader/Makefile b/examples/16.Quake3MapShader/Makefile deleted file mode 100644 index e4d5fb19..00000000 --- a/examples/16.Quake3MapShader/Makefile +++ /dev/null @@ -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 := 16.Quake3MapShader -# 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 diff --git a/examples/16.Quake3MapShader/Quake3MapShader.cbp b/examples/16.Quake3MapShader/Quake3MapShader.cbp deleted file mode 100644 index 544f80fe..00000000 --- a/examples/16.Quake3MapShader/Quake3MapShader.cbp +++ /dev/null @@ -1,56 +0,0 @@ - - - - - - diff --git a/examples/16.Quake3MapShader/Quake3MapShader.vcproj b/examples/16.Quake3MapShader/Quake3MapShader.vcproj deleted file mode 100644 index de658b34..00000000 --- a/examples/16.Quake3MapShader/Quake3MapShader.vcproj +++ /dev/null @@ -1,133 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/examples/16.Quake3MapShader/Quake3MapShader.xcodeproj/project.pbxproj b/examples/16.Quake3MapShader/Quake3MapShader.xcodeproj/project.pbxproj deleted file mode 100644 index 31edfb14..00000000 --- a/examples/16.Quake3MapShader/Quake3MapShader.xcodeproj/project.pbxproj +++ /dev/null @@ -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 /* 16.Quake3MapShader.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = 16.Quake3MapShader.app; sourceTree = BUILT_PRODUCTS_DIR; }; - 5E34CC741B7F8EEF00F212E8 /* main.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = main.cpp; sourceTree = ""; }; - 5E34CC781B7F90A000F212E8 /* libIrrlicht.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libIrrlicht.a; path = ../../lib/OSX/libIrrlicht.a; sourceTree = ""; }; - 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 = ""; }; -/* 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 = ""; - }; - 5E34CC521B7F8E6E00F212E8 /* Products */ = { - isa = PBXGroup; - children = ( - 5E34CC511B7F8E6E00F212E8 /* 16.Quake3MapShader.app */, - ); - name = Products; - sourceTree = ""; - }; - 5E34CC761B7F905600F212E8 /* Libraries */ = { - isa = PBXGroup; - children = ( - 5E8570B01B7F99F500B267D2 /* Cocoa.framework */, - 5E8570B41B7F9A0700B267D2 /* IOKit.framework */, - 5E8570B21B7F99FE00B267D2 /* OpenGL.framework */, - 5E34CC781B7F90A000F212E8 /* libIrrlicht.a */, - ); - name = Libraries; - sourceTree = ""; - }; - 5E34CC771B7F906D00F212E8 /* Resources */ = { - isa = PBXGroup; - children = ( - 5E8570BE1B7F9D3A00B267D2 /* media */, - ); - name = Resources; - sourceTree = ""; - }; -/* End PBXGroup section */ - -/* Begin PBXNativeTarget section */ - 5E34CC501B7F8E6E00F212E8 /* 16.Quake3MapShader */ = { - isa = PBXNativeTarget; - buildConfigurationList = 5E34CC701B7F8E6E00F212E8 /* Build configuration list for PBXNativeTarget "16.Quake3MapShader" */; - buildPhases = ( - 5E34CC4D1B7F8E6E00F212E8 /* Sources */, - 5E34CC4E1B7F8E6E00F212E8 /* Frameworks */, - 5E34CC4F1B7F8E6E00F212E8 /* Resources */, - ); - buildRules = ( - ); - dependencies = ( - ); - name = 16.Quake3MapShader; - productName = 01.HelloWorld; - productReference = 5E34CC511B7F8E6E00F212E8 /* 16.Quake3MapShader.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 "Quake3MapShader" */; - compatibilityVersion = "Xcode 3.2"; - developmentRegion = English; - hasScannedForEncodings = 0; - knownRegions = ( - en, - Base, - ); - mainGroup = 5E34C6D81B7F4A0C00F212E8; - productRefGroup = 5E34CC521B7F8E6E00F212E8 /* Products */; - projectDirPath = ""; - projectRoot = ""; - targets = ( - 5E34CC501B7F8E6E00F212E8 /* 16.Quake3MapShader */, - ); - }; -/* 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 "Quake3MapShader" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 5E34C6DD1B7F4A0C00F212E8 /* Debug */, - 5E34C6DE1B7F4A0C00F212E8 /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - 5E34CC701B7F8E6E00F212E8 /* Build configuration list for PBXNativeTarget "16.Quake3MapShader" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 5E34CC6C1B7F8E6E00F212E8 /* Debug */, - 5E34CC6D1B7F8E6E00F212E8 /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; -/* End XCConfigurationList section */ - }; - rootObject = 5E34C6D91B7F4A0C00F212E8 /* Project object */; -} diff --git a/examples/16.Quake3MapShader/Quake3MapShader.xcodeproj/xcshareddata/xcschemes/16.Quake3MapShader.xcscheme b/examples/16.Quake3MapShader/Quake3MapShader.xcodeproj/xcshareddata/xcschemes/16.Quake3MapShader.xcscheme deleted file mode 100644 index 02775ec0..00000000 --- a/examples/16.Quake3MapShader/Quake3MapShader.xcodeproj/xcshareddata/xcschemes/16.Quake3MapShader.xcscheme +++ /dev/null @@ -1,91 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/examples/16.Quake3MapShader/Quake3MapShader_vc10.vcxproj b/examples/16.Quake3MapShader/Quake3MapShader_vc10.vcxproj deleted file mode 100644 index b5564f80..00000000 --- a/examples/16.Quake3MapShader/Quake3MapShader_vc10.vcxproj +++ /dev/null @@ -1,194 +0,0 @@ - - - - - Debug - Win32 - - - Debug - x64 - - - Release - Win32 - - - Release - x64 - - - - 16.Quake3MapShader - {EB3B38EA-5CE7-4983-845B-880661E69D09} - 16.Quake3MapShader - Win32Proj - - - - Application - MultiByte - Windows7.1SDK - - - Application - MultiByte - Windows7.1SDK - - - Application - MultiByte - Windows7.1SDK - - - Application - MultiByte - Windows7.1SDK - - - - - - - - - - - - - - - - - - - - - - - <_ProjectFileVersion>10.0.30319.1 - ..\..\bin\Win32-VisualStudio\ - ..\..\bin\Win64-VisualStudio\ - true - true - ..\..\bin\Win32-VisualStudio\ - ..\..\bin\Win64-VisualStudio\ - - - AllRules.ruleset - AllRules.ruleset - - - - - AllRules.ruleset - AllRules.ruleset - - - - - - - - Disabled - ..\..\include;%(AdditionalIncludeDirectories) - WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions) - true - EnableFastChecks - MultiThreadedDebug - - - Level3 - EditAndContinue - Cdecl - - - ..\..\bin\Win32-VisualStudio\16.Quake3MapShader.exe - ..\..\lib\Win32-visualstudio;%(AdditionalLibraryDirectories) - true - Console - - - - - - - Disabled - ..\..\include;%(AdditionalIncludeDirectories) - WIN32;WIN64;_DEBUG;_WINDOWS;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebug - - - Level3 - ProgramDatabase - Cdecl - - - ..\..\bin\Win64-VisualStudio\16.Quake3MapShader.exe - ..\..\lib\Win64-visualstudio;%(AdditionalLibraryDirectories) - true - Console - - - - - - - true - Speed - ..\..\include;%(AdditionalIncludeDirectories) - WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions) - MultiThreaded - false - - - Level3 - - - Cdecl - - - ..\..\bin\Win32-VisualStudio\16.Quake3MapShader.exe - ..\..\lib\Win32-visualstudio;%(AdditionalLibraryDirectories) - false - Console - true - true - - - - - - - true - Speed - ..\..\include;%(AdditionalIncludeDirectories) - WIN32;WIN64;NDEBUG;_WINDOWS;%(PreprocessorDefinitions) - MultiThreaded - false - - - Level3 - - - Cdecl - - - ..\..\bin\Win64-VisualStudio\16.Quake3MapShader.exe - ..\..\lib\Win64-visualstudio;%(AdditionalLibraryDirectories) - false - Console - true - true - - - - - - - - - - - \ No newline at end of file diff --git a/examples/16.Quake3MapShader/Quake3MapShader_vc11.vcxproj b/examples/16.Quake3MapShader/Quake3MapShader_vc11.vcxproj deleted file mode 100644 index b5564f80..00000000 --- a/examples/16.Quake3MapShader/Quake3MapShader_vc11.vcxproj +++ /dev/null @@ -1,194 +0,0 @@ - - - - - Debug - Win32 - - - Debug - x64 - - - Release - Win32 - - - Release - x64 - - - - 16.Quake3MapShader - {EB3B38EA-5CE7-4983-845B-880661E69D09} - 16.Quake3MapShader - Win32Proj - - - - Application - MultiByte - Windows7.1SDK - - - Application - MultiByte - Windows7.1SDK - - - Application - MultiByte - Windows7.1SDK - - - Application - MultiByte - Windows7.1SDK - - - - - - - - - - - - - - - - - - - - - - - <_ProjectFileVersion>10.0.30319.1 - ..\..\bin\Win32-VisualStudio\ - ..\..\bin\Win64-VisualStudio\ - true - true - ..\..\bin\Win32-VisualStudio\ - ..\..\bin\Win64-VisualStudio\ - - - AllRules.ruleset - AllRules.ruleset - - - - - AllRules.ruleset - AllRules.ruleset - - - - - - - - Disabled - ..\..\include;%(AdditionalIncludeDirectories) - WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions) - true - EnableFastChecks - MultiThreadedDebug - - - Level3 - EditAndContinue - Cdecl - - - ..\..\bin\Win32-VisualStudio\16.Quake3MapShader.exe - ..\..\lib\Win32-visualstudio;%(AdditionalLibraryDirectories) - true - Console - - - - - - - Disabled - ..\..\include;%(AdditionalIncludeDirectories) - WIN32;WIN64;_DEBUG;_WINDOWS;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebug - - - Level3 - ProgramDatabase - Cdecl - - - ..\..\bin\Win64-VisualStudio\16.Quake3MapShader.exe - ..\..\lib\Win64-visualstudio;%(AdditionalLibraryDirectories) - true - Console - - - - - - - true - Speed - ..\..\include;%(AdditionalIncludeDirectories) - WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions) - MultiThreaded - false - - - Level3 - - - Cdecl - - - ..\..\bin\Win32-VisualStudio\16.Quake3MapShader.exe - ..\..\lib\Win32-visualstudio;%(AdditionalLibraryDirectories) - false - Console - true - true - - - - - - - true - Speed - ..\..\include;%(AdditionalIncludeDirectories) - WIN32;WIN64;NDEBUG;_WINDOWS;%(PreprocessorDefinitions) - MultiThreaded - false - - - Level3 - - - Cdecl - - - ..\..\bin\Win64-VisualStudio\16.Quake3MapShader.exe - ..\..\lib\Win64-visualstudio;%(AdditionalLibraryDirectories) - false - Console - true - true - - - - - - - - - - - \ No newline at end of file diff --git a/examples/16.Quake3MapShader/Quake3MapShader_vc12.vcxproj b/examples/16.Quake3MapShader/Quake3MapShader_vc12.vcxproj deleted file mode 100644 index e41579e1..00000000 --- a/examples/16.Quake3MapShader/Quake3MapShader_vc12.vcxproj +++ /dev/null @@ -1,194 +0,0 @@ - - - - - Debug - Win32 - - - Debug - x64 - - - Release - Win32 - - - Release - x64 - - - - 16.Quake3MapShader - {EB3B38EA-5CE7-4983-845B-880661E69D09} - 16.Quake3MapShader - Win32Proj - - - - Application - MultiByte - Windows7.1SDK - - - Application - MultiByte - Windows7.1SDK - - - Application - MultiByte - Windows7.1SDK - - - Application - MultiByte - Windows7.1SDK - - - - - - - - - - - - - - - - - - - - - - - <_ProjectFileVersion>10.0.30319.1 - ..\..\bin\Win32-VisualStudio\ - ..\..\bin\Win64-VisualStudio\ - true - true - ..\..\bin\Win32-VisualStudio\ - ..\..\bin\Win64-VisualStudio\ - - - AllRules.ruleset - AllRules.ruleset - - - - - AllRules.ruleset - AllRules.ruleset - - - - - - - - Disabled - ..\..\include;%(AdditionalIncludeDirectories) - WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions) - true - EnableFastChecks - MultiThreadedDebug - - - Level3 - EditAndContinue - Cdecl - - - ..\..\bin\Win32-VisualStudio\16.Quake3MapShader.exe - ..\..\lib\Win32-visualstudio;%(AdditionalLibraryDirectories) - true - Console - - - - - - - Disabled - ..\..\include;%(AdditionalIncludeDirectories) - WIN32;WIN64;_DEBUG;_WINDOWS;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebug - - - Level3 - ProgramDatabase - Cdecl - - - ..\..\bin\Win64-VisualStudio\16.Quake3MapShader.exe - ..\..\lib\Win64-visualstudio;%(AdditionalLibraryDirectories) - true - Console - - - - - - - true - Speed - ..\..\include;%(AdditionalIncludeDirectories) - WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions) - MultiThreaded - false - - - Level3 - - - Cdecl - - - ..\..\bin\Win32-VisualStudio\16.Quake3MapShader.exe - ..\..\lib\Win32-visualstudio;%(AdditionalLibraryDirectories) - false - Console - true - true - - - - - - - true - Speed - ..\..\include;%(AdditionalIncludeDirectories) - WIN32;WIN64;NDEBUG;_WINDOWS;%(PreprocessorDefinitions) - MultiThreaded - false - - - Level3 - - - Cdecl - - - ..\..\bin\Win64-VisualStudio\16.Quake3MapShader.exe - ..\..\lib\Win64-visualstudio;%(AdditionalLibraryDirectories) - false - Console - true - true - - - - - - - - - - - \ No newline at end of file diff --git a/examples/16.Quake3MapShader/Quake3MapShader_vc14.vcxproj b/examples/16.Quake3MapShader/Quake3MapShader_vc14.vcxproj deleted file mode 100644 index 9c850a13..00000000 --- a/examples/16.Quake3MapShader/Quake3MapShader_vc14.vcxproj +++ /dev/null @@ -1,194 +0,0 @@ - - - - - Debug - Win32 - - - Debug - x64 - - - Release - Win32 - - - Release - x64 - - - - 16.Quake3MapShader - {EB3B38EA-5CE7-4983-845B-880661E69D09} - 16.Quake3MapShader - Win32Proj - - - - Application - MultiByte - v140 - - - Application - MultiByte - v140 - - - Application - MultiByte - v140 - - - Application - MultiByte - v140 - - - - - - - - - - - - - - - - - - - - - - - <_ProjectFileVersion>10.0.30319.1 - ..\..\bin\Win32-VisualStudio\ - ..\..\bin\Win64-VisualStudio\ - true - true - ..\..\bin\Win32-VisualStudio\ - ..\..\bin\Win64-VisualStudio\ - - - AllRules.ruleset - AllRules.ruleset - - - - - AllRules.ruleset - AllRules.ruleset - - - - - - - - Disabled - ..\..\include;%(AdditionalIncludeDirectories) - WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions) - true - EnableFastChecks - MultiThreadedDebug - - - Level3 - EditAndContinue - Cdecl - - - ..\..\bin\Win32-VisualStudio\16.Quake3MapShader.exe - ..\..\lib\Win32-visualstudio;%(AdditionalLibraryDirectories) - true - Console - - - - - - - Disabled - ..\..\include;%(AdditionalIncludeDirectories) - WIN32;WIN64;_DEBUG;_WINDOWS;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebug - - - Level3 - ProgramDatabase - Cdecl - - - ..\..\bin\Win64-VisualStudio\16.Quake3MapShader.exe - ..\..\lib\Win64-visualstudio;%(AdditionalLibraryDirectories) - true - Console - - - - - - - true - Speed - ..\..\include;%(AdditionalIncludeDirectories) - WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions) - MultiThreaded - false - - - Level3 - - - Cdecl - - - ..\..\bin\Win32-VisualStudio\16.Quake3MapShader.exe - ..\..\lib\Win32-visualstudio;%(AdditionalLibraryDirectories) - false - Console - true - true - - - - - - - true - Speed - ..\..\include;%(AdditionalIncludeDirectories) - WIN32;WIN64;NDEBUG;_WINDOWS;%(PreprocessorDefinitions) - MultiThreaded - false - - - Level3 - - - Cdecl - - - ..\..\bin\Win64-VisualStudio\16.Quake3MapShader.exe - ..\..\lib\Win64-visualstudio;%(AdditionalLibraryDirectories) - false - Console - true - true - - - - - - - - - - - \ No newline at end of file diff --git a/examples/16.Quake3MapShader/main.cpp b/examples/16.Quake3MapShader/main.cpp deleted file mode 100644 index 38062c5a..00000000 --- a/examples/16.Quake3MapShader/main.cpp +++ /dev/null @@ -1,393 +0,0 @@ -/** Example 016 Quake3 Map Shader Support - -This tutorial shows how to load a Quake 3 map into the -engine, create a SceneNode for optimizing the speed of -rendering and how to create a user controlled camera. - -Lets start like the HelloWorld example: We include -the irrlicht header files and an additional file to be able -to ask the user for a driver type using the console. -*/ -#include -#include "driverChoice.h" -#include "exampleHelper.h" - -/* - define which Quake3 Level should be loaded -*/ -#define IRRLICHT_QUAKE3_ARENA -//#define ORIGINAL_QUAKE3_ARENA -//#define CUSTOM_QUAKE3_ARENA -//#define SHOW_SHADER_NAME - -#ifdef ORIGINAL_QUAKE3_ARENA - #define QUAKE3_STORAGE_FORMAT addFolderFileArchive - #define QUAKE3_STORAGE_1 "/baseq3/" - #ifdef CUSTOM_QUAKE3_ARENA - #define QUAKE3_STORAGE_2 "/cf/" - #define QUAKE3_MAP_NAME "maps/cf.bsp" - #else - #define QUAKE3_MAP_NAME "maps/q3dm8.bsp" - #endif -#endif - -#ifdef IRRLICHT_QUAKE3_ARENA - #define QUAKE3_STORAGE_FORMAT addFileArchive - #define QUAKE3_STORAGE_1 getExampleMediaPath() + "map-20kdm2.pk3" - #define QUAKE3_MAP_NAME "maps/20kdm2.bsp" -#endif - -using namespace irr; -using namespace scene; - -/* -Again, to be able to use the Irrlicht.DLL file, we need to link with the -Irrlicht.lib. We could set this option in the project settings, but -to make it easy, we use a pragma comment lib: -*/ -#ifdef _MSC_VER -#pragma comment(lib, "Irrlicht.lib") -#endif - - -/* -A class to produce a series of screenshots -*/ -class CScreenShotFactory : public IEventReceiver -{ -public: - - CScreenShotFactory( IrrlichtDevice *device, const c8 * templateName, ISceneNode* node ) - : Device(device), Number(0), FilenameTemplate(templateName), Node(node) - { - FilenameTemplate.replace ( '/', '_' ); - FilenameTemplate.replace ( '\\', '_' ); - } - - bool OnEvent(const SEvent& event) - { - // check if user presses the key F9 - if ((event.EventType == EET_KEY_INPUT_EVENT) && - event.KeyInput.PressedDown) - { - if (event.KeyInput.Key == KEY_F9) - { - video::IImage* image = Device->getVideoDriver()->createScreenShot(); - if (image) - { - c8 buf[256]; - snprintf_irr(buf, 256, "%s_shot%04d.jpg", - FilenameTemplate.c_str(), - ++Number); - Device->getVideoDriver()->writeImageToFile(image, buf, 85 ); - image->drop(); - } - } - else - if (event.KeyInput.Key == KEY_F8) - { - if (Node->isDebugDataVisible()) - Node->setDebugDataVisible(scene::EDS_OFF); - else - Node->setDebugDataVisible(scene::EDS_BBOX_ALL); - } - } - return false; - } - -private: - IrrlichtDevice *Device; - u32 Number; - core::stringc FilenameTemplate; - ISceneNode* Node; -}; - - -/* -Ok, lets start. -*/ - -int IRRCALLCONV main(int argc, char* argv[]) -{ - /* - Like in the HelloWorld example, we create an IrrlichtDevice with - createDevice(). The difference now is that we ask the user to select - which hardware accelerated driver to use. The Software device would be - too slow to draw a huge Quake 3 map, but just for the fun of it, we make - this decision possible too. - */ - - // ask user for driver - video::E_DRIVER_TYPE driverType=driverChoiceConsole(); - if (driverType==video::EDT_COUNT) - return 1; - - // create device and exit if creation failed - const core::dimension2du videoDim(800,600); - - IrrlichtDevice *device = createDevice(driverType, videoDim, 32, false ); - - if (device == 0) - return 1; // could not create selected driver. - - const char* mapname=0; - if (argc>2) - mapname = argv[2]; - else - mapname = QUAKE3_MAP_NAME; - - /* - Get a pointer to the video driver and the SceneManager so that - we do not always have to write device->getVideoDriver() and - device->getSceneManager(). - */ - video::IVideoDriver* driver = device->getVideoDriver(); - scene::ISceneManager* smgr = device->getSceneManager(); - gui::IGUIEnvironment* gui = device->getGUIEnvironment(); - - const io::path mediaPath = getExampleMediaPath(); - - //! add our private media directory to the file system - device->getFileSystem()->addFileArchive(mediaPath); - - /* - To display the Quake 3 map, we first need to load it. Quake 3 maps - are packed into .pk3 files, which are nothing other than .zip files. - So we add the .pk3 file to our FileSystem. After it was added, - we are able to read from the files in that archive as they would - directly be stored on disk. - */ - if (argc>2) - device->getFileSystem()->QUAKE3_STORAGE_FORMAT(argv[1]); - else - device->getFileSystem()->QUAKE3_STORAGE_FORMAT(QUAKE3_STORAGE_1); -#ifdef QUAKE3_STORAGE_2 - device->getFileSystem()->QUAKE3_STORAGE_FORMAT(QUAKE3_STORAGE_2); -#endif - - // Quake3 Shader controls Z-Writing - smgr->getParameters()->setAttribute(scene::ALLOW_ZWRITE_ON_TRANSPARENT, true); - - /* - Now we can load the mesh by calling getMesh(). We get a pointer returned - to a IAnimatedMesh. As you know, Quake 3 maps are not really animated, - they are only a huge chunk of static geometry with some materials - attached. Hence the IAnimated mesh consists of only one frame, - so we get the "first frame" of the "animation", which is our quake level - and create an Octree scene node with it, using addOctreeSceneNode(). - The Octree optimizes the scene a little bit, trying to draw only geometry - which is currently visible. An alternative to the Octree would be a - AnimatedMeshSceneNode, which would draw always the complete geometry of - the mesh, without optimization. Try it out: Write addAnimatedMeshSceneNode - instead of addOctreeSceneNode and compare the primitives drawn by the - video driver. (There is a getPrimitiveCountDrawed() method in the - IVideoDriver class). Note that this optimization with the Octree is only - useful when drawing huge meshes consisting of lots of geometry. - */ - scene::IQ3LevelMesh* const mesh = - (scene::IQ3LevelMesh*) smgr->getMesh(mapname); - - /* - add the geometry mesh to the Scene ( polygon & patches ) - The Geometry mesh is optimised for faster drawing - */ - scene::ISceneNode* node = 0; - if (mesh) - { - scene::IMesh * const geometry = mesh->getMesh(quake3::E_Q3_MESH_GEOMETRY); - node = smgr->addOctreeSceneNode(geometry, 0, -1, 4096); - } - - // create an event receiver for making screenshots - CScreenShotFactory screenshotFactory(device, mapname, node); - device->setEventReceiver(&screenshotFactory); - - /* - now construct SceneNodes for each Shader - The Objects are stored in the quake mesh scene::E_Q3_MESH_ITEMS - and the Shader ID is stored in the MaterialParameters - mostly dark looking skulls and moving lava.. or green flashing tubes? - */ - if ( mesh ) - { - // the additional mesh can be quite huge and is unoptimized - const scene::IMesh * const additional_mesh = mesh->getMesh(quake3::E_Q3_MESH_ITEMS); - -#ifdef SHOW_SHADER_NAME - gui::IGUIFont *font = device->getGUIEnvironment()->getFont(mediaPath + "fontlucida.png"); - u32 count = 0; -#endif - - for ( u32 i = 0; i!= additional_mesh->getMeshBufferCount(); ++i ) - { - const IMeshBuffer* meshBuffer = additional_mesh->getMeshBuffer(i); - const video::SMaterial& material = meshBuffer->getMaterial(); - - // The ShaderIndex is stored in the material parameter - const s32 shaderIndex = (s32) material.MaterialTypeParam2; - - // the meshbuffer can be rendered without additional support, or it has no shader - const quake3::IShader *shader = mesh->getShader(shaderIndex); - if (0 == shader) - { - continue; - } - - // we can dump the shader to the console in its - // original but already parsed layout in a pretty - // printers way.. commented out, because the console - // would be full... - // quake3::dumpShader ( Shader ); - - node = smgr->addQuake3SceneNode(meshBuffer, shader); - -#ifdef SHOW_SHADER_NAME - count += 1; - core::stringw name( node->getName() ); - node = smgr->addBillboardTextSceneNode( - font, name.c_str(), node, - core::dimension2d(80.0f, 8.0f), - core::vector3df(0, 10, 0)); -#endif - } - } - - /* - Now we only need a Camera to look at the Quake 3 map. And we want to - create a user controlled camera. There are some different cameras - available in the Irrlicht engine. For example the Maya Camera which can - be controlled comparable to the camera in Maya: Rotate with left mouse - button pressed, Zoom with both buttons pressed, translate with right - mouse button pressed. This could be created with - addCameraSceneNodeMaya(). But for this example, we want to create a - camera which behaves like the ones in first person shooter games (FPS). - */ - - scene::ICameraSceneNode* camera = smgr->addCameraSceneNodeFPS(); - - /* - so we need a good starting Position in the level. - we can ask the Quake3 Loader for all entities with class_name - "info_player_deathmatch" - we choose a random launch - */ - if ( mesh ) - { - quake3::tQ3EntityList &entityList = mesh->getEntityList(); - - quake3::IEntity search; - search.name = "info_player_deathmatch"; - - s32 index = entityList.binary_search(search); - if (index >= 0) - { - s32 notEndList; - do - { - const quake3::SVarGroup *group = entityList[index].getGroup(1); - - u32 parsepos = 0; - const core::vector3df pos = - quake3::getAsVector3df(group->get("origin"), parsepos); - - parsepos = 0; - const f32 angle = quake3::getAsFloat(group->get("angle"), parsepos); - - core::vector3df target(0.f, 0.f, 1.f); - target.rotateXZBy(angle); - - camera->setPosition(pos); - camera->setTarget(pos + target); - - ++index; -/* - notEndList = ( index < (s32) entityList.size () && - entityList[index].name == search.name && - (device->getTimer()->getRealTime() >> 3 ) & 1 - ); -*/ - notEndList = index == 2; - } while ( notEndList ); - } - } - - /* - The mouse cursor needs not to be visible, so we make it invisible. - */ - - device->getCursorControl()->setVisible(false); - - // load the engine logo - gui->addImage(driver->getTexture("irrlichtlogo3.png"), - core::position2d(10, 10)); - - // show the driver logo - const core::position2di pos(videoDim.Width - 128, videoDim.Height - 64); - - switch ( driverType ) - { - case video::EDT_BURNINGSVIDEO: - gui->addImage(driver->getTexture("burninglogo.png"), pos); - break; - case video::EDT_OPENGL: - gui->addImage(driver->getTexture("opengllogo.png"), pos); - break; - case video::EDT_DIRECT3D9: - gui->addImage(driver->getTexture("directxlogo.png"), pos); - break; - default: - break; - } - - /* - We have done everything, so lets draw it. We also write the current - frames per second and the drawn primitives to the caption of the - window. The 'if (device->isWindowActive())' line is optional, but - prevents the engine render to set the position of the mouse cursor - after task switching when other program are active. - */ - int lastFPS = -1; - - while(device->run()) - if (device->isWindowActive()) - { - driver->beginScene(video::ECBF_COLOR | video::ECBF_DEPTH, video::SColor(255,20,20,40)); - smgr->drawAll(); - gui->drawAll(); - driver->endScene(); - - int fps = driver->getFPS(); - if (1 || lastFPS != fps) - { - core::stringw str = L"Q3 ["; - str += driver->getName(); - str += "] FPS:"; - str += fps; -#ifdef _IRR_SCENEMANAGER_DEBUG - io::IAttributes * const attr = smgr->getParameters(); - str += " Cull:"; - str += attr->getAttributeAsInt("calls"); - str += "/"; - str += attr->getAttributeAsInt("culled"); - str += " Draw: "; - str += attr->getAttributeAsInt("drawn_solid"); - str += "/"; - str += attr->getAttributeAsInt("drawn_transparent"); - str += "/"; - str += attr->getAttributeAsInt("drawn_transparent_effect"); -#endif - device->setWindowCaption(str.c_str()); - lastFPS = fps; - } - } - - /* - In the end, delete the Irrlicht device. - */ - device->drop(); - - return 0; -} - -/* -**/ diff --git a/examples/17.HelloWorld_Mobile/17. HelloWorld for Windows Mobile on PC_v8.vcproj b/examples/17.HelloWorld_Mobile/17. HelloWorld for Windows Mobile on PC_v8.vcproj deleted file mode 100644 index be07354f..00000000 --- a/examples/17.HelloWorld_Mobile/17. HelloWorld for Windows Mobile on PC_v8.vcproj +++ /dev/null @@ -1,185 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/examples/17.HelloWorld_Mobile/17. HelloWorld for Windows Mobile on PC_v9.vcproj b/examples/17.HelloWorld_Mobile/17. HelloWorld for Windows Mobile on PC_v9.vcproj deleted file mode 100644 index acdc249d..00000000 --- a/examples/17.HelloWorld_Mobile/17. HelloWorld for Windows Mobile on PC_v9.vcproj +++ /dev/null @@ -1,184 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/examples/17.HelloWorld_Mobile/17. HelloWorld for Windows Mobile on PC_vc10.vcxproj b/examples/17.HelloWorld_Mobile/17. HelloWorld for Windows Mobile on PC_vc10.vcxproj deleted file mode 100644 index 0f047407..00000000 --- a/examples/17.HelloWorld_Mobile/17. HelloWorld for Windows Mobile on PC_vc10.vcxproj +++ /dev/null @@ -1,180 +0,0 @@ - - - - - Debug - Win32 - - - Debug - x64 - - - Release - Win32 - - - Release - x64 - - - - 17.HelloWorld_Mobile - {2A29B6B1-AFC4-46C7-9944-7052AAE66F7B} - My17HelloWorldforWindowsMobileonPC - Win32Proj - - - - Application - Unicode - true - Windows7.1SDK - - - Application - Unicode - true - Windows7.1SDK - - - Application - Unicode - Windows7.1SDK - - - Application - Unicode - Windows7.1SDK - - - - - - - - - - - - - - - - - - - <_ProjectFileVersion>10.0.30319.1 - ..\..\bin\Win32-VisualStudio\ - ..\..\bin\Win64-VisualStudio\ - true - true - ..\..\bin\Win32-VisualStudio\ - ..\..\bin\Win64-VisualStudio\ - false - false - AllRules.ruleset - AllRules.ruleset - - - - - AllRules.ruleset - AllRules.ruleset - - - - - - - - Disabled - ..\..\include;%(AdditionalIncludeDirectories) - WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) - true - EnableFastChecks - MultiThreadedDebugDLL - - - Level3 - EditAndContinue - - - ..\..\bin\Win32-VisualStudio\17.HelloWorld_Mobile.exe - ..\..\lib\Win32-visualstudio;%(AdditionalLibraryDirectories) - true - Console - - - - - - - Disabled - ..\..\include;%(AdditionalIncludeDirectories) - WIN32;WIN64;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebugDLL - - - Level3 - ProgramDatabase - - - ..\..\bin\Win64-VisualStudio\17.HelloWorld_Mobile.exe - ..\..\lib\Win64-visualstudio;%(AdditionalLibraryDirectories) - true - Console - - - - - - - ..\..\include;%(AdditionalIncludeDirectories) - WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) - MultiThreadedDLL - - - Level3 - ProgramDatabase - - - ..\..\bin\Win32-VisualStudio\17.HelloWorld_Mobile.exe - ..\..\lib\Win32-visualstudio;%(AdditionalLibraryDirectories) - false - Console - true - true - - - - - - - ..\..\include;%(AdditionalIncludeDirectories) - WIN32;WIN64;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) - MultiThreadedDLL - - - Level3 - ProgramDatabase - - - ..\..\bin\Win64-VisualStudio\17.HelloWorld_Mobile.exe - ..\..\lib\Win64-visualstudio;%(AdditionalLibraryDirectories) - false - Console - true - true - - - - - - - - - - - \ No newline at end of file diff --git a/examples/17.HelloWorld_Mobile/17. HelloWorld for Windows Mobile on PC_vc11.vcxproj b/examples/17.HelloWorld_Mobile/17. HelloWorld for Windows Mobile on PC_vc11.vcxproj deleted file mode 100644 index 0f047407..00000000 --- a/examples/17.HelloWorld_Mobile/17. HelloWorld for Windows Mobile on PC_vc11.vcxproj +++ /dev/null @@ -1,180 +0,0 @@ - - - - - Debug - Win32 - - - Debug - x64 - - - Release - Win32 - - - Release - x64 - - - - 17.HelloWorld_Mobile - {2A29B6B1-AFC4-46C7-9944-7052AAE66F7B} - My17HelloWorldforWindowsMobileonPC - Win32Proj - - - - Application - Unicode - true - Windows7.1SDK - - - Application - Unicode - true - Windows7.1SDK - - - Application - Unicode - Windows7.1SDK - - - Application - Unicode - Windows7.1SDK - - - - - - - - - - - - - - - - - - - <_ProjectFileVersion>10.0.30319.1 - ..\..\bin\Win32-VisualStudio\ - ..\..\bin\Win64-VisualStudio\ - true - true - ..\..\bin\Win32-VisualStudio\ - ..\..\bin\Win64-VisualStudio\ - false - false - AllRules.ruleset - AllRules.ruleset - - - - - AllRules.ruleset - AllRules.ruleset - - - - - - - - Disabled - ..\..\include;%(AdditionalIncludeDirectories) - WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) - true - EnableFastChecks - MultiThreadedDebugDLL - - - Level3 - EditAndContinue - - - ..\..\bin\Win32-VisualStudio\17.HelloWorld_Mobile.exe - ..\..\lib\Win32-visualstudio;%(AdditionalLibraryDirectories) - true - Console - - - - - - - Disabled - ..\..\include;%(AdditionalIncludeDirectories) - WIN32;WIN64;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebugDLL - - - Level3 - ProgramDatabase - - - ..\..\bin\Win64-VisualStudio\17.HelloWorld_Mobile.exe - ..\..\lib\Win64-visualstudio;%(AdditionalLibraryDirectories) - true - Console - - - - - - - ..\..\include;%(AdditionalIncludeDirectories) - WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) - MultiThreadedDLL - - - Level3 - ProgramDatabase - - - ..\..\bin\Win32-VisualStudio\17.HelloWorld_Mobile.exe - ..\..\lib\Win32-visualstudio;%(AdditionalLibraryDirectories) - false - Console - true - true - - - - - - - ..\..\include;%(AdditionalIncludeDirectories) - WIN32;WIN64;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) - MultiThreadedDLL - - - Level3 - ProgramDatabase - - - ..\..\bin\Win64-VisualStudio\17.HelloWorld_Mobile.exe - ..\..\lib\Win64-visualstudio;%(AdditionalLibraryDirectories) - false - Console - true - true - - - - - - - - - - - \ No newline at end of file diff --git a/examples/17.HelloWorld_Mobile/17. HelloWorld for Windows Mobile on PC_vc12.vcxproj b/examples/17.HelloWorld_Mobile/17. HelloWorld for Windows Mobile on PC_vc12.vcxproj deleted file mode 100644 index 30079f8b..00000000 --- a/examples/17.HelloWorld_Mobile/17. HelloWorld for Windows Mobile on PC_vc12.vcxproj +++ /dev/null @@ -1,180 +0,0 @@ - - - - - Debug - Win32 - - - Debug - x64 - - - Release - Win32 - - - Release - x64 - - - - 17.HelloWorld_Mobile - {2A29B6B1-AFC4-46C7-9944-7052AAE66F7B} - My17HelloWorldforWindowsMobileonPC - Win32Proj - - - - Application - Unicode - true - Windows7.1SDK - - - Application - Unicode - true - Windows7.1SDK - - - Application - Unicode - Windows7.1SDK - - - Application - Unicode - Windows7.1SDK - - - - - - - - - - - - - - - - - - - <_ProjectFileVersion>10.0.30319.1 - ..\..\bin\Win32-VisualStudio\ - ..\..\bin\Win64-VisualStudio\ - true - true - ..\..\bin\Win32-VisualStudio\ - ..\..\bin\Win64-VisualStudio\ - false - false - AllRules.ruleset - AllRules.ruleset - - - - - AllRules.ruleset - AllRules.ruleset - - - - - - - - Disabled - ..\..\include;%(AdditionalIncludeDirectories) - WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) - true - EnableFastChecks - MultiThreadedDebugDLL - - - Level3 - EditAndContinue - - - ..\..\bin\Win32-VisualStudio\17.HelloWorld_Mobile.exe - ..\..\lib\Win32-visualstudio;%(AdditionalLibraryDirectories) - true - Console - - - - - - - Disabled - ..\..\include;%(AdditionalIncludeDirectories) - WIN32;WIN64;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebugDLL - - - Level3 - ProgramDatabase - - - ..\..\bin\Win64-VisualStudio\17.HelloWorld_Mobile.exe - ..\..\lib\Win64-visualstudio;%(AdditionalLibraryDirectories) - true - Console - - - - - - - ..\..\include;%(AdditionalIncludeDirectories) - WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) - MultiThreadedDLL - - - Level3 - ProgramDatabase - - - ..\..\bin\Win32-VisualStudio\17.HelloWorld_Mobile.exe - ..\..\lib\Win32-visualstudio;%(AdditionalLibraryDirectories) - false - Console - true - true - - - - - - - ..\..\include;%(AdditionalIncludeDirectories) - WIN32;WIN64;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) - MultiThreadedDLL - - - Level3 - ProgramDatabase - - - ..\..\bin\Win64-VisualStudio\17.HelloWorld_Mobile.exe - ..\..\lib\Win64-visualstudio;%(AdditionalLibraryDirectories) - false - Console - true - true - - - - - - - - - - - \ No newline at end of file diff --git a/examples/17.HelloWorld_Mobile/HelloWorld_mobile.sln b/examples/17.HelloWorld_Mobile/HelloWorld_mobile.sln deleted file mode 100644 index 31932b79..00000000 --- a/examples/17.HelloWorld_Mobile/HelloWorld_mobile.sln +++ /dev/null @@ -1,33 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 9.00 -# Visual Studio 2005 -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "17.HelloWorld_mobile", "HelloWorld_mobile.vcproj", "{AD95D5D7-91D2-4030-B28D-23A6FE5C0359}" - ProjectSection(ProjectDependencies) = postProject - {E08E042A-6C45-411B-92BE-3CC31331019F} = {E08E042A-6C45-411B-92BE-3CC31331019F} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Irrlicht", "..\..\source\Irrlicht\Irrlicht_mobile6.vcproj", "{E08E042A-6C45-411B-92BE-3CC31331019F}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Windows Mobile 6 Professional SDK (ARMV4I) = Debug|Windows Mobile 6 Professional SDK (ARMV4I) - Release|Windows Mobile 6 Professional SDK (ARMV4I) = Release|Windows Mobile 6 Professional SDK (ARMV4I) - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {AD95D5D7-91D2-4030-B28D-23A6FE5C0359}.Debug|Windows Mobile 6 Professional SDK (ARMV4I).ActiveCfg = Debug|Windows Mobile 6 Professional SDK (ARMV4I) - {AD95D5D7-91D2-4030-B28D-23A6FE5C0359}.Debug|Windows Mobile 6 Professional SDK (ARMV4I).Build.0 = Debug|Windows Mobile 6 Professional SDK (ARMV4I) - {AD95D5D7-91D2-4030-B28D-23A6FE5C0359}.Debug|Windows Mobile 6 Professional SDK (ARMV4I).Deploy.0 = Debug|Windows Mobile 6 Professional SDK (ARMV4I) - {AD95D5D7-91D2-4030-B28D-23A6FE5C0359}.Release|Windows Mobile 6 Professional SDK (ARMV4I).ActiveCfg = Release|Windows Mobile 6 Professional SDK (ARMV4I) - {AD95D5D7-91D2-4030-B28D-23A6FE5C0359}.Release|Windows Mobile 6 Professional SDK (ARMV4I).Build.0 = Release|Windows Mobile 6 Professional SDK (ARMV4I) - {AD95D5D7-91D2-4030-B28D-23A6FE5C0359}.Release|Windows Mobile 6 Professional SDK (ARMV4I).Deploy.0 = Release|Windows Mobile 6 Professional SDK (ARMV4I) - {E08E042A-6C45-411B-92BE-3CC31331019F}.Debug|Windows Mobile 6 Professional SDK (ARMV4I).ActiveCfg = Debug|Windows Mobile 6 Professional SDK (ARMV4I) - {E08E042A-6C45-411B-92BE-3CC31331019F}.Debug|Windows Mobile 6 Professional SDK (ARMV4I).Build.0 = Debug|Windows Mobile 6 Professional SDK (ARMV4I) - {E08E042A-6C45-411B-92BE-3CC31331019F}.Debug|Windows Mobile 6 Professional SDK (ARMV4I).Deploy.0 = Debug|Windows Mobile 6 Professional SDK (ARMV4I) - {E08E042A-6C45-411B-92BE-3CC31331019F}.Release|Windows Mobile 6 Professional SDK (ARMV4I).ActiveCfg = Release|Windows Mobile 6 Professional SDK (ARMV4I) - {E08E042A-6C45-411B-92BE-3CC31331019F}.Release|Windows Mobile 6 Professional SDK (ARMV4I).Build.0 = Release|Windows Mobile 6 Professional SDK (ARMV4I) - {E08E042A-6C45-411B-92BE-3CC31331019F}.Release|Windows Mobile 6 Professional SDK (ARMV4I).Deploy.0 = Release|Windows Mobile 6 Professional SDK (ARMV4I) - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/examples/17.HelloWorld_Mobile/HelloWorld_mobile.vcproj b/examples/17.HelloWorld_Mobile/HelloWorld_mobile.vcproj deleted file mode 100644 index dcaca9ef..00000000 --- a/examples/17.HelloWorld_Mobile/HelloWorld_mobile.vcproj +++ /dev/null @@ -1,198 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/examples/17.HelloWorld_Mobile/Makefile b/examples/17.HelloWorld_Mobile/Makefile deleted file mode 100644 index a29ccaa2..00000000 --- a/examples/17.HelloWorld_Mobile/Makefile +++ /dev/null @@ -1,39 +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 -Target = 17.HelloWorld_Mobile -Sources = main.cpp - -# general compiler settings -CPPFLAGS = -I../../include -I/usr/X11R6/include -CXXFLAGS = -O3 -ffast-math -#CXXFLAGS = -g -Wall - -#default target is Linux -all: all_linux - -ifeq ($(HOSTTYPE), x86_64) -LIBSELECT=64 -endif - -# target specific settings -all_linux: LDFLAGS = -L/usr/X11R6/lib$(LIBSELECT) -L../../lib/Linux -lIrrlicht -lGL -lXxf86vm -lXext -lX11 -lXcursor -all_linux clean_linux: SYSTEM=Linux -all_win32: LDFLAGS = -L../../lib/Win32-gcc -lIrrlicht -lopengl32 -lm -all_win32: CPPFLAGS += -D__GNUWIN32__ -D_WIN32 -DWIN32 -D_WINDOWS -D_MBCS -D_USRDLL -all_win32 clean_win32: SYSTEM=Win32-gcc -all_win32 clean_win32: SUF=.exe -# name of the binary - only valid for targets which set SYSTEM -DESTPATH = ../../bin/$(SYSTEM)/$(Target)$(SUF) - -all_linux all_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 clean clean_linux clean_win32 diff --git a/examples/17.HelloWorld_Mobile/main.cpp b/examples/17.HelloWorld_Mobile/main.cpp deleted file mode 100644 index 9db5806f..00000000 --- a/examples/17.HelloWorld_Mobile/main.cpp +++ /dev/null @@ -1,497 +0,0 @@ -/** Deprecated. This was Example 017 Helloworld mobile for WinCE 6. - But WinCE6 support has been removed for Irrlicht 1.9. - If you still need that please use Irrlicht 1.8 or svn revision 5045 which was the last one to include it. - - Sources still kept for now as it compiles on other platform too. And we might use this example again - once we support Windows RT. -*/ - -#include - -#if defined ( _IRR_WINDOWS_ ) - #include -#endif - -using namespace irr; -using namespace core; -using namespace scene; -using namespace video; -using namespace io; -using namespace gui; - -#pragma comment(lib, "Irrlicht.lib") - -class EventReceiver_basic : public IEventReceiver -{ -private: - IrrlichtDevice *Device; -public: - EventReceiver_basic ( IrrlichtDevice *device ): Device ( device ) {} - - virtual bool OnEvent(const SEvent& event) - { - if (event.EventType == EET_GUI_EVENT) - { - s32 id = event.GUIEvent.Caller->getID(); - - switch(event.GUIEvent.EventType) - { - case EGET_BUTTON_CLICKED: - if (id == 2) - { - Device->closeDevice(); - return true; - } break; - } - } - - return false; - } -}; - -class CSampleSceneNode : public ISceneNode -{ - aabbox3d Box; - S3DVertex Vertices[4]; - SMaterial Material; -public: - - CSampleSceneNode(ISceneNode* parent, ISceneManager* mgr, s32 id) - : ISceneNode(parent, mgr, id) - { - Material.Wireframe = false; - Material.Lighting = false; - - Vertices[0] = S3DVertex(0,0,10, 1,1,0, SColor(255,0,255,255), 0, 1); - Vertices[1] = S3DVertex(10,0,-10, 1,0,0, SColor(255,255,0,255), 1, 1); - Vertices[2] = S3DVertex(0,20,0, 0,1,1, SColor(255,255,255,0), 1, 0); - Vertices[3] = S3DVertex(-10,0,-10, 0,0,1, SColor(255,0,255,0), 0, 0); - Box.reset(Vertices[0].Pos); - for (s32 i=1; i<4; ++i) - Box.addInternalPoint(Vertices[i].Pos); - } - virtual void OnRegisterSceneNode() - { - if (IsVisible) - SceneManager->registerNodeForRendering(this); - - ISceneNode::OnRegisterSceneNode(); - } - - virtual void render() - { - u16 indices[] = { 0,2,3, 2,1,3, 1,0,3, 2,0,1 }; - IVideoDriver* driver = SceneManager->getVideoDriver(); - - driver->setMaterial(Material); - driver->setTransform(ETS_WORLD, AbsoluteTransformation); - driver->drawIndexedTriangleList(&Vertices[0], 4, &indices[0], 4); - } - - virtual const aabbox3d& getBoundingBox() const - { - return Box; - } - - virtual u32 getMaterialCount() - { - return 1; - } - - virtual SMaterial& getMaterial(u32 i) - { - return Material; - } -}; - -/*! - Startup a Windows Mobile Device -*/ -IrrlichtDevice *startup() -{ - // both software and burnings video can be used - E_DRIVER_TYPE driverType = EDT_SOFTWARE; // EDT_BURNINGSVIDEO; - - // create device - IrrlichtDevice *device = 0; - - // Use window mode on PC - device = createDevice(driverType, dimension2d(240, 320), 16, false ); - if ( 0 == device ) - return 0; - - IVideoDriver* driver = device->getVideoDriver(); - ISceneManager* smgr = device->getSceneManager(); - IGUIEnvironment* guienv = device->getGUIEnvironment(); - - // set the filesystem relative to the executable -#if defined (_IRR_WINDOWS_) - { - wchar_t buf[255]; - GetModuleFileNameW ( 0, buf, 255 ); - - io::path base = buf; - base = base.subString ( 0, base.findLast ( '\\' ) + 1 ); - device->getFileSystem()->addFileArchive ( base ); - } -#endif - - IGUIStaticText *text = guienv->addStaticText(L"FPS: 25", - rect(140,15,200,30), false, false, 0, 100 ); - - guienv->addButton(core::rect(200,10,238,30), 0, 2, L"Quit"); - - // add irrlicht logo - guienv->addImage(driver->getTexture("../../media/irrlichtlogo3.png"), - core::position2d(0,-2)); - return device; -} - -/*! -*/ -int run ( IrrlichtDevice *device ) -{ - while(device->run()) - if (device->isWindowActive()) - { - device->getVideoDriver()->beginScene(true, true, SColor(0,100,100,100)); - device->getSceneManager()->drawAll(); - device->getGUIEnvironment()->drawAll(); - device->getVideoDriver()->endScene (); - - IGUIElement *stat = device->getGUIEnvironment()-> - getRootGUIElement()->getElementFromId ( 100 ); - if ( stat ) - { - stringw str = L"FPS: "; - str += (s32)device->getVideoDriver()->getFPS(); - - stat->setText ( str.c_str() ); - } - } - - device->drop(); - return 0; -} - -/*! -*/ -int example_customscenenode() -{ - // create device - IrrlichtDevice *device = startup(); - if (device == 0) - return 1; // could not create selected driver. - - // create engine and camera - EventReceiver_basic receiver(device); - device->setEventReceiver(&receiver); - - IVideoDriver* driver = device->getVideoDriver(); - ISceneManager* smgr = device->getSceneManager(); - IGUIEnvironment* guienv = device->getGUIEnvironment(); - - - smgr->addCameraSceneNode(0, vector3df(0,-40,0), vector3df(0,0,0)); - - CSampleSceneNode *myNode = - new CSampleSceneNode(smgr->getRootSceneNode(), smgr, 666); - - ISceneNodeAnimator* anim = - smgr->createRotationAnimator(vector3df(0.8f, 0, 0.8f)); - - if(anim) - { - myNode->addAnimator(anim); - anim->drop(); - anim = 0; // As I shouldn't refer to it again, ensure that I can't - } - - myNode->drop(); - myNode = 0; // As I shouldn't refer to it again, ensure that I can't - - return run ( device ); -} - -class EventReceiver_terrain : public IEventReceiver -{ -public: - - EventReceiver_terrain(IrrlichtDevice *device, scene::ISceneNode* terrain, scene::ISceneNode* skybox, scene::ISceneNode* skydome) : - Device ( device ), Terrain(terrain), Skybox(skybox), Skydome(skydome), showBox(true) - { - Skybox->setVisible(true); - Skydome->setVisible(false); - } - - bool OnEvent(const SEvent& event) - { - if (event.EventType == EET_GUI_EVENT) - { - s32 id = event.GUIEvent.Caller->getID(); - - switch(event.GUIEvent.EventType) - { - case EGET_BUTTON_CLICKED: - if (id == 2) - { - Device->closeDevice(); - return true; - } break; - } - } - - // check if user presses the key 'W' or 'D' - if (event.EventType == irr::EET_KEY_INPUT_EVENT && !event.KeyInput.PressedDown) - { - switch (event.KeyInput.Key) - { - case irr::KEY_KEY_W: // switch wire frame mode - Terrain->setMaterialFlag(video::EMF_WIREFRAME, - !Terrain->getMaterial(0).Wireframe); - Terrain->setMaterialFlag(video::EMF_POINTCLOUD, false); - return true; - case irr::KEY_KEY_P: // switch wire frame mode - Terrain->setMaterialFlag(video::EMF_POINTCLOUD, - !Terrain->getMaterial(0).PointCloud); - Terrain->setMaterialFlag(video::EMF_WIREFRAME, false); - return true; - case irr::KEY_KEY_D: // toggle detail map - Terrain->setMaterialType( - Terrain->getMaterial(0).MaterialType == video::EMT_SOLID ? - video::EMT_DETAIL_MAP : video::EMT_SOLID); - return true; - case irr::KEY_KEY_S: // toggle skies - showBox=!showBox; - Skybox->setVisible(showBox); - Skydome->setVisible(!showBox); - return true; - default: - break; - } - } - - return false; - } - -private: - IrrlichtDevice *Device; - scene::ISceneNode* Terrain; - scene::ISceneNode* Skybox; - scene::ISceneNode* Skydome; - bool showBox; -}; - - -/* -The start of the main function starts like in most other example. We ask the user -for the desired renderer and start it up. This time with the advanced parameter handling. -*/ -int example_terrain() -{ - // create device - IrrlichtDevice *device = startup(); - if (device == 0) - return 1; // could not create selected driver. - - /* - First, we add standard stuff to the scene: A nice irrlicht engine - logo, a small help text, a user controlled camera, and we disable - the mouse cursor. - */ - - video::IVideoDriver* driver = device->getVideoDriver(); - scene::ISceneManager* smgr = device->getSceneManager(); - gui::IGUIEnvironment* env = device->getGUIEnvironment(); - - - //set other font - //env->getSkin()->setFont(env->getFont("../../media/fontlucida.png")); - - // add some help text - env->addStaticText( - L"Press 'W' to change wireframe mode\nPress 'D' to toggle detail map\nPress 'S' to toggle skybox/skydome", - core::rect(5,250,235,320), true, true, 0, -1, true); - - // add camera - scene::ICameraSceneNode* camera = - smgr->addCameraSceneNodeFPS(0,100.0f,1.2f); - - camera->setPosition(core::vector3df(2700*2,255*2,2600*2)); - camera->setTarget(core::vector3df(2397*2,343*2,2700*2)); - camera->setFarValue(42000.0f); - - // disable mouse cursor - device->getCursorControl()->setVisible(false); - - /* - Here comes the terrain renderer scene node: We add it just like any - other scene node to the scene using - ISceneManager::addTerrainSceneNode(). The only parameter we use is a - file name to the heightmap we use. A heightmap is simply a gray scale - texture. The terrain renderer loads it and creates the 3D terrain from - it. - - To make the terrain look more big, we change the scale factor of - it to (40, 4.4, 40). Because we don't have any dynamic lights in the - scene, we switch off the lighting, and we set the file - terrain-texture.jpg as texture for the terrain and detailmap3.jpg as - second texture, called detail map. At last, we set the scale values for - the texture: The first texture will be repeated only one time over the - whole terrain, and the second one (detail map) 20 times. - */ - - // add terrain scene node - scene::ITerrainSceneNode* terrain = smgr->addTerrainSceneNode( - "../../media/terrain-heightmap.bmp", - 0, // parent node - -1, // node id - core::vector3df(0.f, 0.f, 0.f), // position - core::vector3df(0.f, 0.f, 0.f), // rotation - core::vector3df(40.f, 4.4f, 40.f), // scale - video::SColor ( 255, 255, 255, 255 ), // vertexColor - 5, // maxLOD - scene::ETPS_17, // patchSize - 4 // smoothFactor - ); - - if ( terrain ) - { - terrain->setMaterialFlag(video::EMF_LIGHTING, false); - - terrain->setMaterialTexture(0, - driver->getTexture("../../media/terrain-texture.jpg")); - terrain->setMaterialTexture(1, - driver->getTexture("../../media/detailmap3.jpg")); - - terrain->setMaterialType(video::EMT_DETAIL_MAP); - - terrain->scaleTexture(1.0f, 20.0f); - //terrain->setDebugDataVisible ( true ); - - /* - To be able to do collision with the terrain, we create a triangle selector. - If you want to know what triangle selectors do, just take a look into the - collision tutorial. The terrain triangle selector works together with the - terrain. To demonstrate this, we create a collision response animator - and attach it to the camera, so that the camera will not be able to fly - through the terrain. - */ - - // create triangle selector for the terrain - scene::ITriangleSelector* selector - = smgr->createTerrainTriangleSelector(terrain, 0); - terrain->setTriangleSelector(selector); - - // create collision response animator and attach it to the camera - scene::ISceneNodeAnimator* anim = smgr->createCollisionResponseAnimator( - selector, camera, core::vector3df(60,100,60), - core::vector3df(0,0,0), - core::vector3df(0,50,0)); - selector->drop(); - camera->addAnimator(anim); - anim->drop(); - - /* If you need access to the terrain data you can also do this directly via the following code fragment. - */ - scene::CDynamicMeshBuffer* buffer = new scene::CDynamicMeshBuffer(video::EVT_2TCOORDS, video::EIT_16BIT); - terrain->getMeshBufferForLOD(*buffer, 0); - video::S3DVertex2TCoords* data = (video::S3DVertex2TCoords*)buffer->getVertexBuffer().getData(); - // Work on data or get the IndexBuffer with a similar call. - buffer->drop(); // When done drop the buffer again. - } - - /* - To make the user be able to switch between normal and wireframe mode, - we create an instance of the event receiver from above and let Irrlicht - know about it. In addition, we add the skybox which we already used in - lots of Irrlicht examples and a skydome, which is shown mutually - exclusive with the skybox by pressing 'S'. - */ - - // create skybox and skydome - driver->setTextureCreationFlag(video::ETCF_CREATE_MIP_MAPS, false); - - scene::ISceneNode* skybox=smgr->addSkyBoxSceneNode( - driver->getTexture("../../media/irrlicht2_up.jpg"), - driver->getTexture("../../media/irrlicht2_dn.jpg"), - driver->getTexture("../../media/irrlicht2_lf.jpg"), - driver->getTexture("../../media/irrlicht2_rt.jpg"), - driver->getTexture("../../media/irrlicht2_ft.jpg"), - driver->getTexture("../../media/irrlicht2_bk.jpg")); - scene::ISceneNode* skydome=smgr->addSkyDomeSceneNode(driver->getTexture("../../media/skydome.jpg"),16,8,0.95f,2.0f); - - driver->setTextureCreationFlag(video::ETCF_CREATE_MIP_MAPS, true); - - // create event receiver - EventReceiver_terrain receiver( device, terrain, skybox, skydome); - device->setEventReceiver(&receiver); - - return run ( device ); -} - -/* -*/ -int example_helloworld() -{ - // create device - IrrlichtDevice *device = startup(); - if (device == 0) - return 1; // could not create selected driver. - - IVideoDriver* driver = device->getVideoDriver(); - ISceneManager* smgr = device->getSceneManager(); - IGUIEnvironment* guienv = device->getGUIEnvironment(); - - IAnimatedMesh* mesh = smgr->getMesh("../../media/sydney.md2"); - if (!mesh) - { - device->drop(); - return 1; - } - IAnimatedMeshSceneNode* node = smgr->addAnimatedMeshSceneNode( mesh ); - - /* - To let the mesh look a little bit nicer, we change its material. We - disable lighting because we do not have a dynamic light in here, and - the mesh would be totally black otherwise. Then we set the frame loop, - such that the predefined STAND animation is used. And last, we apply a - texture to the mesh. Without it the mesh would be drawn using only a - color. - */ - if (node) - { - node->setMaterialFlag(EMF_LIGHTING, false); - node->setMD2Animation(scene::EMAT_STAND); - node->setMaterialTexture( 0, driver->getTexture("../../media/sydney.bmp") ); - } - - /* - To look at the mesh, we place a camera into 3d space at the position - (0, 30, -40). The camera looks from there to (0,5,0), which is - approximately the place where our md2 model is. - */ - smgr->addCameraSceneNode(0, vector3df(0,30,-40), vector3df(0,5,0)); - - EventReceiver_basic receiver(device); - device->setEventReceiver(&receiver); - - return run ( device ); - -} - -#if defined (_IRR_WINDOWS_) - #pragma comment(linker, "/subsystem:windows /ENTRY:mainCRTStartup") -#endif - -/* -*/ -int main() -{ - example_helloworld (); - example_customscenenode(); - //example_terrain(); -} - -/* -**/ diff --git a/examples/18.SplitScreen/Makefile b/examples/18.SplitScreen/Makefile deleted file mode 100644 index fd414013..00000000 --- a/examples/18.SplitScreen/Makefile +++ /dev/null @@ -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 := 18.SplitScreen -# 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 diff --git a/examples/18.SplitScreen/SplitScreen.cbp b/examples/18.SplitScreen/SplitScreen.cbp deleted file mode 100644 index e1574a6d..00000000 --- a/examples/18.SplitScreen/SplitScreen.cbp +++ /dev/null @@ -1,55 +0,0 @@ - - - - - - diff --git a/examples/18.SplitScreen/SplitScreen.vcproj b/examples/18.SplitScreen/SplitScreen.vcproj deleted file mode 100644 index 46cb6b78..00000000 --- a/examples/18.SplitScreen/SplitScreen.vcproj +++ /dev/null @@ -1,132 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/examples/18.SplitScreen/SplitScreen.xcodeproj/project.pbxproj b/examples/18.SplitScreen/SplitScreen.xcodeproj/project.pbxproj deleted file mode 100644 index 1201daf9..00000000 --- a/examples/18.SplitScreen/SplitScreen.xcodeproj/project.pbxproj +++ /dev/null @@ -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 /* 18.SplitScreen.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = 18.SplitScreen.app; sourceTree = BUILT_PRODUCTS_DIR; }; - 5E34CC741B7F8EEF00F212E8 /* main.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = main.cpp; sourceTree = ""; }; - 5E34CC781B7F90A000F212E8 /* libIrrlicht.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libIrrlicht.a; path = ../../lib/OSX/libIrrlicht.a; sourceTree = ""; }; - 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 = ""; }; -/* 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 = ""; - }; - 5E34CC521B7F8E6E00F212E8 /* Products */ = { - isa = PBXGroup; - children = ( - 5E34CC511B7F8E6E00F212E8 /* 18.SplitScreen.app */, - ); - name = Products; - sourceTree = ""; - }; - 5E34CC761B7F905600F212E8 /* Libraries */ = { - isa = PBXGroup; - children = ( - 5E8570B01B7F99F500B267D2 /* Cocoa.framework */, - 5E8570B41B7F9A0700B267D2 /* IOKit.framework */, - 5E8570B21B7F99FE00B267D2 /* OpenGL.framework */, - 5E34CC781B7F90A000F212E8 /* libIrrlicht.a */, - ); - name = Libraries; - sourceTree = ""; - }; - 5E34CC771B7F906D00F212E8 /* Resources */ = { - isa = PBXGroup; - children = ( - 5E8570BE1B7F9D3A00B267D2 /* media */, - ); - name = Resources; - sourceTree = ""; - }; -/* End PBXGroup section */ - -/* Begin PBXNativeTarget section */ - 5E34CC501B7F8E6E00F212E8 /* 18.SplitScreen */ = { - isa = PBXNativeTarget; - buildConfigurationList = 5E34CC701B7F8E6E00F212E8 /* Build configuration list for PBXNativeTarget "18.SplitScreen" */; - buildPhases = ( - 5E34CC4D1B7F8E6E00F212E8 /* Sources */, - 5E34CC4E1B7F8E6E00F212E8 /* Frameworks */, - 5E34CC4F1B7F8E6E00F212E8 /* Resources */, - ); - buildRules = ( - ); - dependencies = ( - ); - name = 18.SplitScreen; - productName = 01.HelloWorld; - productReference = 5E34CC511B7F8E6E00F212E8 /* 18.SplitScreen.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 "SplitScreen" */; - compatibilityVersion = "Xcode 3.2"; - developmentRegion = English; - hasScannedForEncodings = 0; - knownRegions = ( - en, - Base, - ); - mainGroup = 5E34C6D81B7F4A0C00F212E8; - productRefGroup = 5E34CC521B7F8E6E00F212E8 /* Products */; - projectDirPath = ""; - projectRoot = ""; - targets = ( - 5E34CC501B7F8E6E00F212E8 /* 18.SplitScreen */, - ); - }; -/* 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 "SplitScreen" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 5E34C6DD1B7F4A0C00F212E8 /* Debug */, - 5E34C6DE1B7F4A0C00F212E8 /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - 5E34CC701B7F8E6E00F212E8 /* Build configuration list for PBXNativeTarget "18.SplitScreen" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 5E34CC6C1B7F8E6E00F212E8 /* Debug */, - 5E34CC6D1B7F8E6E00F212E8 /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; -/* End XCConfigurationList section */ - }; - rootObject = 5E34C6D91B7F4A0C00F212E8 /* Project object */; -} diff --git a/examples/18.SplitScreen/SplitScreen.xcodeproj/xcshareddata/xcschemes/18.SplitScreen.xcscheme b/examples/18.SplitScreen/SplitScreen.xcodeproj/xcshareddata/xcschemes/18.SplitScreen.xcscheme deleted file mode 100644 index 0af4a284..00000000 --- a/examples/18.SplitScreen/SplitScreen.xcodeproj/xcshareddata/xcschemes/18.SplitScreen.xcscheme +++ /dev/null @@ -1,91 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/examples/18.SplitScreen/SplitScreen_vc10.vcxproj b/examples/18.SplitScreen/SplitScreen_vc10.vcxproj deleted file mode 100644 index a0c211c7..00000000 --- a/examples/18.SplitScreen/SplitScreen_vc10.vcxproj +++ /dev/null @@ -1,193 +0,0 @@ - - - - - Debug - Win32 - - - Debug - x64 - - - Release - Win32 - - - Release - x64 - - - - 18.SplitScreen - {1AB9413E-4F53-42A3-8CB2-CB4BE22336D0} - 18.SplitScreen - Win32Proj - - - - Application - MultiByte - Windows7.1SDK - - - Application - MultiByte - Windows7.1SDK - - - Application - MultiByte - Windows7.1SDK - - - Application - MultiByte - Windows7.1SDK - - - - - - - - - - - - - - - - - - - - - - - <_ProjectFileVersion>10.0.30319.1 - ..\..\bin\Win32-VisualStudio\ - ..\..\bin\Win64-VisualStudio\ - true - true - ..\..\bin\Win32-VisualStudio\ - ..\..\bin\Win64-VisualStudio\ - - - AllRules.ruleset - AllRules.ruleset - - - - - AllRules.ruleset - AllRules.ruleset - - - - - - - - Disabled - ..\..\include;%(AdditionalIncludeDirectories) - WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions) - true - EnableFastChecks - MultiThreadedDebug - - - Level3 - EditAndContinue - - - ..\..\bin\Win32-VisualStudio\18.SplitScreen.exe - ..\..\lib\Win32-visualstudio;%(AdditionalLibraryDirectories) - true - Console - - - - - - - Disabled - ..\..\include;%(AdditionalIncludeDirectories) - WIN32;WIN64;_DEBUG;_WINDOWS;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebug - - - Level3 - ProgramDatabase - - - ..\..\bin\Win64-VisualStudio\18.SplitScreen.exe - ..\..\lib\Win64-visualstudio;%(AdditionalLibraryDirectories) - true - $(OutDir)SplitScreen.pdb - Console - - - - - - - true - Speed - ..\..\include;%(AdditionalIncludeDirectories) - WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions) - MultiThreaded - false - - - Level3 - - - Cdecl - - - ..\..\bin\Win32-VisualStudio\18.SplitScreen.exe - ..\..\lib\Win32-visualstudio;%(AdditionalLibraryDirectories) - false - Console - true - true - - - - - - - true - Speed - ..\..\include;%(AdditionalIncludeDirectories) - WIN32;WIN64;NDEBUG;_WINDOWS;%(PreprocessorDefinitions) - MultiThreaded - false - - - Level3 - - - Cdecl - - - ..\..\bin\Win64-VisualStudio\18.SplitScreen.exe - ..\..\lib\Win64-visualstudio;%(AdditionalLibraryDirectories) - false - Console - true - true - - - - - - - - - - - \ No newline at end of file diff --git a/examples/18.SplitScreen/SplitScreen_vc11.vcxproj b/examples/18.SplitScreen/SplitScreen_vc11.vcxproj deleted file mode 100644 index e4707c58..00000000 --- a/examples/18.SplitScreen/SplitScreen_vc11.vcxproj +++ /dev/null @@ -1,194 +0,0 @@ - - - - - Debug - Win32 - - - Debug - x64 - - - Release - Win32 - - - Release - x64 - - - - 18.SplitScreen - {1AB9413E-4F53-42A3-8CB2-CB4BE22336D0} - 18.SplitScreen - Win32Proj - - - - Application - MultiByte - Windows7.1SDK - - - Application - MultiByte - Windows7.1SDK - - - Application - MultiByte - Windows7.1SDK - - - Application - MultiByte - Windows7.1SDK - - - - - - - - - - - - - - - - - - - - - - - <_ProjectFileVersion>10.0.30319.1 - ..\..\bin\Win32-VisualStudio\ - ..\..\bin\Win64-VisualStudio\ - true - true - ..\..\bin\Win32-VisualStudio\ - ..\..\bin\Win64-VisualStudio\ - - - AllRules.ruleset - AllRules.ruleset - - - - - AllRules.ruleset - AllRules.ruleset - - - - - - - - Disabled - ..\..\include;%(AdditionalIncludeDirectories) - WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions) - true - EnableFastChecks - MultiThreadedDebug - - - Level3 - EditAndContinue - - - ..\..\bin\Win32-VisualStudio\18.SplitScreen.exe - ..\..\lib\Win32-visualstudio;%(AdditionalLibraryDirectories) - true - $(OutDir)SplitScreen.pdb - Console - - - - - - - Disabled - ..\..\include;%(AdditionalIncludeDirectories) - WIN32;WIN64;_DEBUG;_WINDOWS;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebug - - - Level3 - ProgramDatabase - - - ..\..\bin\Win64-VisualStudio\18.SplitScreen.exe - ..\..\lib\Win64-visualstudio;%(AdditionalLibraryDirectories) - true - $(OutDir)SplitScreen.pdb - Console - - - - - - - true - Speed - ..\..\include;%(AdditionalIncludeDirectories) - WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions) - MultiThreaded - false - - - Level3 - - - Cdecl - - - ..\..\bin\Win32-VisualStudio\18.SplitScreen.exe - ..\..\lib\Win32-visualstudio;%(AdditionalLibraryDirectories) - false - Console - true - true - - - - - - - true - Speed - ..\..\include;%(AdditionalIncludeDirectories) - WIN32;WIN64;NDEBUG;_WINDOWS;%(PreprocessorDefinitions) - MultiThreaded - false - - - Level3 - - - Cdecl - - - ..\..\bin\Win64-VisualStudio\18.SplitScreen.exe - ..\..\lib\Win64-visualstudio;%(AdditionalLibraryDirectories) - false - Console - true - true - - - - - - - - - - - \ No newline at end of file diff --git a/examples/18.SplitScreen/SplitScreen_vc12.vcxproj b/examples/18.SplitScreen/SplitScreen_vc12.vcxproj deleted file mode 100644 index 1c6c62d3..00000000 --- a/examples/18.SplitScreen/SplitScreen_vc12.vcxproj +++ /dev/null @@ -1,194 +0,0 @@ - - - - - Debug - Win32 - - - Debug - x64 - - - Release - Win32 - - - Release - x64 - - - - 18.SplitScreen - {1AB9413E-4F53-42A3-8CB2-CB4BE22336D0} - 18.SplitScreen - Win32Proj - - - - Application - MultiByte - Windows7.1SDK - - - Application - MultiByte - Windows7.1SDK - - - Application - MultiByte - Windows7.1SDK - - - Application - MultiByte - Windows7.1SDK - - - - - - - - - - - - - - - - - - - - - - - <_ProjectFileVersion>10.0.30319.1 - ..\..\bin\Win32-VisualStudio\ - ..\..\bin\Win64-VisualStudio\ - true - true - ..\..\bin\Win32-VisualStudio\ - ..\..\bin\Win64-VisualStudio\ - - - AllRules.ruleset - AllRules.ruleset - - - - - AllRules.ruleset - AllRules.ruleset - - - - - - - - Disabled - ..\..\include;%(AdditionalIncludeDirectories) - WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions) - true - EnableFastChecks - MultiThreadedDebug - - - Level3 - EditAndContinue - - - ..\..\bin\Win32-VisualStudio\18.SplitScreen.exe - ..\..\lib\Win32-visualstudio;%(AdditionalLibraryDirectories) - true - $(OutDir)SplitScreen.pdb - Console - - - - - - - Disabled - ..\..\include;%(AdditionalIncludeDirectories) - WIN32;WIN64;_DEBUG;_WINDOWS;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebug - - - Level3 - ProgramDatabase - - - ..\..\bin\Win64-VisualStudio\18.SplitScreen.exe - ..\..\lib\Win64-visualstudio;%(AdditionalLibraryDirectories) - true - $(OutDir)SplitScreen.pdb - Console - - - - - - - true - Speed - ..\..\include;%(AdditionalIncludeDirectories) - WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions) - MultiThreaded - false - - - Level3 - - - Cdecl - - - ..\..\bin\Win32-VisualStudio\18.SplitScreen.exe - ..\..\lib\Win32-visualstudio;%(AdditionalLibraryDirectories) - false - Console - true - true - - - - - - - true - Speed - ..\..\include;%(AdditionalIncludeDirectories) - WIN32;WIN64;NDEBUG;_WINDOWS;%(PreprocessorDefinitions) - MultiThreaded - false - - - Level3 - - - Cdecl - - - ..\..\bin\Win64-VisualStudio\18.SplitScreen.exe - ..\..\lib\Win64-visualstudio;%(AdditionalLibraryDirectories) - false - Console - true - true - - - - - - - - - - - \ No newline at end of file diff --git a/examples/18.SplitScreen/SplitScreen_vc14.vcxproj b/examples/18.SplitScreen/SplitScreen_vc14.vcxproj deleted file mode 100644 index 7004b80c..00000000 --- a/examples/18.SplitScreen/SplitScreen_vc14.vcxproj +++ /dev/null @@ -1,194 +0,0 @@ - - - - - Debug - Win32 - - - Debug - x64 - - - Release - Win32 - - - Release - x64 - - - - 18.SplitScreen - {1AB9413E-4F53-42A3-8CB2-CB4BE22336D0} - 18.SplitScreen - Win32Proj - - - - Application - MultiByte - v140 - - - Application - MultiByte - v140 - - - Application - MultiByte - v140 - - - Application - MultiByte - v140 - - - - - - - - - - - - - - - - - - - - - - - <_ProjectFileVersion>10.0.30319.1 - ..\..\bin\Win32-VisualStudio\ - ..\..\bin\Win64-VisualStudio\ - true - true - ..\..\bin\Win32-VisualStudio\ - ..\..\bin\Win64-VisualStudio\ - - - AllRules.ruleset - AllRules.ruleset - - - - - AllRules.ruleset - AllRules.ruleset - - - - - - - - Disabled - ..\..\include;%(AdditionalIncludeDirectories) - WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions) - true - EnableFastChecks - MultiThreadedDebug - - - Level3 - EditAndContinue - - - ..\..\bin\Win32-VisualStudio\18.SplitScreen.exe - ..\..\lib\Win32-visualstudio;%(AdditionalLibraryDirectories) - true - $(OutDir)SplitScreen.pdb - Console - - - - - - - Disabled - ..\..\include;%(AdditionalIncludeDirectories) - WIN32;WIN64;_DEBUG;_WINDOWS;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebug - - - Level3 - ProgramDatabase - - - ..\..\bin\Win64-VisualStudio\18.SplitScreen.exe - ..\..\lib\Win64-visualstudio;%(AdditionalLibraryDirectories) - true - $(OutDir)SplitScreen.pdb - Console - - - - - - - true - Speed - ..\..\include;%(AdditionalIncludeDirectories) - WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions) - MultiThreaded - false - - - Level3 - - - Cdecl - - - ..\..\bin\Win32-VisualStudio\18.SplitScreen.exe - ..\..\lib\Win32-visualstudio;%(AdditionalLibraryDirectories) - false - Console - true - true - - - - - - - true - Speed - ..\..\include;%(AdditionalIncludeDirectories) - WIN32;WIN64;NDEBUG;_WINDOWS;%(PreprocessorDefinitions) - MultiThreaded - false - - - Level3 - - - Cdecl - - - ..\..\bin\Win64-VisualStudio\18.SplitScreen.exe - ..\..\lib\Win64-visualstudio;%(AdditionalLibraryDirectories) - false - Console - true - true - - - - - - - - - - - \ No newline at end of file diff --git a/examples/18.SplitScreen/main.cpp b/examples/18.SplitScreen/main.cpp deleted file mode 100644 index 600b7bf8..00000000 --- a/examples/18.SplitScreen/main.cpp +++ /dev/null @@ -1,247 +0,0 @@ -/** Example 018 Splitscreen - -A tutorial by Max Winkel. - -In this tutorial we'll learn how to use splitscreen (e.g. for racing-games) -with Irrlicht. We'll create a viewport divided -into 4 parts, with 3 fixed cameras and one user-controlled. - -Ok, let's start with the headers (I think there's -nothing to say about it) -*/ - -#include -#include "driverChoice.h" -#include "exampleHelper.h" - -#ifdef _MSC_VER -#pragma comment(lib, "Irrlicht.lib") -#endif - -//Namespaces for the engine -using namespace irr; -using namespace core; -using namespace video; -using namespace scene; - -/* -Now we'll define the resolution in a constant for use in -initializing the device and setting up the viewport. In addition -we set up a global variable saying splitscreen is active or not. -*/ -//Resolution -const int ResX=800; -const int ResY=600; -const bool fullScreen=false; - -//Use SplitScreen? -bool SplitScreen=true; - -/* -Now we need four pointers to our cameras which are created later: -*/ -//cameras -ICameraSceneNode *camera[4]={0,0,0,0}; -/* -In our event-receiver we switch the SplitScreen-variable, -whenever the user press the S-key. All other events are sent -to the FPS camera. -*/ - -class MyEventReceiver : public IEventReceiver -{ - public: - virtual bool OnEvent(const SEvent& event) - { - //Key S enables/disables SplitScreen - if (event.EventType == irr::EET_KEY_INPUT_EVENT && - event.KeyInput.Key == KEY_KEY_S && event.KeyInput.PressedDown) - { - SplitScreen = !SplitScreen; - return true; - } - //Send all other events to camera4 - if (camera[3]) - return camera[3]->OnEvent(event); - return false; - } -}; - -/* -Ok, now the main-function: -First, we initialize the device, get the SourceManager and -VideoDriver, load an animated mesh from .md2 and a map from -.pk3. Because that's old stuff, I won't explain every step. -Just take care of the maps position. -*/ -int main() -{ - // ask user for driver - video::E_DRIVER_TYPE driverType=driverChoiceConsole(); - if (driverType==video::EDT_COUNT) - return 1; - - //Instance of the EventReceiver - MyEventReceiver receiver; - - //Initialise the engine - IrrlichtDevice *device = createDevice(driverType, - dimension2du(ResX,ResY), 32, fullScreen, - false, false, &receiver); - if (!device) - return 1; - - ISceneManager *smgr = device->getSceneManager(); - IVideoDriver *driver = device->getVideoDriver(); - - const io::path mediaPath = getExampleMediaPath(); - - //Load model - IAnimatedMesh *model = smgr->getMesh(mediaPath + "sydney.md2"); - if (!model) - return 1; - IAnimatedMeshSceneNode *model_node = smgr->addAnimatedMeshSceneNode(model); - //Load texture - if (model_node) - { - ITexture *texture = driver->getTexture(mediaPath + "sydney.bmp"); - model_node->setMaterialTexture(0,texture); - model_node->setMD2Animation(scene::EMAT_RUN); - //Disable lighting (we've got no light) - model_node->setMaterialFlag(EMF_LIGHTING,false); - } - - //Load map - device->getFileSystem()->addFileArchive(mediaPath + "map-20kdm2.pk3"); - IAnimatedMesh *map = smgr->getMesh("20kdm2.bsp"); - if (map) - { - ISceneNode *map_node = smgr->addOctreeSceneNode(map->getMesh(0)); - //Set position - map_node->setPosition(vector3df(-850,-220,-850)); - } - -/* -Now we create our four cameras. One is looking at the model -from the front, one from the top and one from the side. In -addition there's a FPS-camera which can be controlled by the -user. -*/ - // Create 3 fixed and one user-controlled cameras - //Front - camera[0] = smgr->addCameraSceneNode(0, vector3df(50,0,0), vector3df(0,0,0)); - //Top - camera[1] = smgr->addCameraSceneNode(0, vector3df(0,50,0), vector3df(0,0,0)); - //Left - camera[2] = smgr->addCameraSceneNode(0, vector3df(0,0,50), vector3df(0,0,0)); - //User-controlled - camera[3] = smgr->addCameraSceneNodeFPS(); - // don't start at sydney's position - if (camera[3]) - camera[3]->setPosition(core::vector3df(-50,0,-50)); - -/* -Create a variable for counting the fps and hide the mouse: -*/ - //Hide mouse - device->getCursorControl()->setVisible(false); - //We want to count the fps - int lastFPS = -1; - -/* -There wasn't much new stuff - till now! -Only by defining four cameras, the game won't be splitscreen. -To do this you need several steps: - - Set the viewport to the whole screen - - Begin a new scene (Clear screen) - - - The following 3 steps are repeated for every viewport in the splitscreen - - Set the viewport to the area you wish - - Activate the camera which should be "linked" with the viewport - - Render all objects - - - If you have a GUI: - - Set the viewport the whole screen - - Display the GUI - - End scene - -Sounds a little complicated, but you'll see it isn't: -*/ - - while(device->run()) - { - //Set the viewpoint to the whole screen and begin scene - driver->setViewPort(rect(0,0,ResX,ResY)); - driver->beginScene(video::ECBF_COLOR | video::ECBF_DEPTH, SColor(255,100,100,100)); - //If SplitScreen is used - if (SplitScreen) - { - //Activate camera1 - smgr->setActiveCamera(camera[0]); - //Set viewpoint to the first quarter (left top) - driver->setViewPort(rect(0,0,ResX/2,ResY/2)); - //Draw scene - smgr->drawAll(); - //Activate camera2 - smgr->setActiveCamera(camera[1]); - //Set viewpoint to the second quarter (right top) - driver->setViewPort(rect(ResX/2,0,ResX,ResY/2)); - //Draw scene - smgr->drawAll(); - //Activate camera3 - smgr->setActiveCamera(camera[2]); - //Set viewpoint to the third quarter (left bottom) - driver->setViewPort(rect(0,ResY/2,ResX/2,ResY)); - //Draw scene - smgr->drawAll(); - //Set viewport the last quarter (right bottom) - driver->setViewPort(rect(ResX/2,ResY/2,ResX,ResY)); - } - //Activate camera4 - smgr->setActiveCamera(camera[3]); - //Draw scene - smgr->drawAll(); - driver->endScene(); - - /* - As you can probably see, the image is rendered for every - viewport separately. That means, that you'll loose much performance. - Ok, if you're asking "How do I have to set the viewport - to get this or that screen?", don't panic. It's really - easy: In the rect-function you define 4 coordinates: - - X-coordinate of the corner left top - - Y-coordinate of the corner left top - - X-coordinate of the corner right bottom - - Y-coordinate of the corner right bottom - - That means, if you want to split the screen into 2 viewports - you would give the following coordinates: - - 1st viewport: 0,0,ResX/2,ResY - - 2nd viewport: ResX/2,0,ResX,ResY - - If you didn't fully understand, just play around with the example - to check out what happens. - - Now we just view the current fps and shut down the engine, - when the user wants to: - */ - //Get and show fps - if (driver->getFPS() != lastFPS) - { - lastFPS = driver->getFPS(); - core::stringw tmp = L"Irrlicht SplitScreen-Example (FPS: "; - tmp += lastFPS; - tmp += ")"; - device->setWindowCaption(tmp.c_str()); - } - } - //Delete device - device->drop(); - return 0; -} -/* -That's it! Just compile and play around with the program. -Note: With the S-Key you can switch between using splitscreen -and not. -**/ - diff --git a/examples/19.MouseAndJoystick/Makefile b/examples/19.MouseAndJoystick/Makefile deleted file mode 100644 index 90d08fb3..00000000 --- a/examples/19.MouseAndJoystick/Makefile +++ /dev/null @@ -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 := 19.MouseAndJoystick -# 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 diff --git a/examples/19.MouseAndJoystick/MouseAndJoystick.cbp b/examples/19.MouseAndJoystick/MouseAndJoystick.cbp deleted file mode 100644 index 7400072c..00000000 --- a/examples/19.MouseAndJoystick/MouseAndJoystick.cbp +++ /dev/null @@ -1,56 +0,0 @@ - - - - - - diff --git a/examples/19.MouseAndJoystick/MouseAndJoystick.vcproj b/examples/19.MouseAndJoystick/MouseAndJoystick.vcproj deleted file mode 100644 index 84d8396f..00000000 --- a/examples/19.MouseAndJoystick/MouseAndJoystick.vcproj +++ /dev/null @@ -1,162 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/examples/19.MouseAndJoystick/MouseAndJoystick.xcodeproj/project.pbxproj b/examples/19.MouseAndJoystick/MouseAndJoystick.xcodeproj/project.pbxproj deleted file mode 100644 index 5a3cddf3..00000000 --- a/examples/19.MouseAndJoystick/MouseAndJoystick.xcodeproj/project.pbxproj +++ /dev/null @@ -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 /* 19.MouseAndJoystick.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = 19.MouseAndJoystick.app; sourceTree = BUILT_PRODUCTS_DIR; }; - 5E34CC741B7F8EEF00F212E8 /* main.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = main.cpp; sourceTree = ""; }; - 5E34CC781B7F90A000F212E8 /* libIrrlicht.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libIrrlicht.a; path = ../../lib/OSX/libIrrlicht.a; sourceTree = ""; }; - 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 = ""; }; -/* 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 = ""; - }; - 5E34CC521B7F8E6E00F212E8 /* Products */ = { - isa = PBXGroup; - children = ( - 5E34CC511B7F8E6E00F212E8 /* 19.MouseAndJoystick.app */, - ); - name = Products; - sourceTree = ""; - }; - 5E34CC761B7F905600F212E8 /* Libraries */ = { - isa = PBXGroup; - children = ( - 5E8570B01B7F99F500B267D2 /* Cocoa.framework */, - 5E8570B41B7F9A0700B267D2 /* IOKit.framework */, - 5E8570B21B7F99FE00B267D2 /* OpenGL.framework */, - 5E34CC781B7F90A000F212E8 /* libIrrlicht.a */, - ); - name = Libraries; - sourceTree = ""; - }; - 5E34CC771B7F906D00F212E8 /* Resources */ = { - isa = PBXGroup; - children = ( - 5E8570BE1B7F9D3A00B267D2 /* media */, - ); - name = Resources; - sourceTree = ""; - }; -/* End PBXGroup section */ - -/* Begin PBXNativeTarget section */ - 5E34CC501B7F8E6E00F212E8 /* 19.MouseAndJoystick */ = { - isa = PBXNativeTarget; - buildConfigurationList = 5E34CC701B7F8E6E00F212E8 /* Build configuration list for PBXNativeTarget "19.MouseAndJoystick" */; - buildPhases = ( - 5E34CC4D1B7F8E6E00F212E8 /* Sources */, - 5E34CC4E1B7F8E6E00F212E8 /* Frameworks */, - 5E34CC4F1B7F8E6E00F212E8 /* Resources */, - ); - buildRules = ( - ); - dependencies = ( - ); - name = 19.MouseAndJoystick; - productName = 01.HelloWorld; - productReference = 5E34CC511B7F8E6E00F212E8 /* 19.MouseAndJoystick.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 "MouseAndJoystick" */; - compatibilityVersion = "Xcode 3.2"; - developmentRegion = English; - hasScannedForEncodings = 0; - knownRegions = ( - en, - Base, - ); - mainGroup = 5E34C6D81B7F4A0C00F212E8; - productRefGroup = 5E34CC521B7F8E6E00F212E8 /* Products */; - projectDirPath = ""; - projectRoot = ""; - targets = ( - 5E34CC501B7F8E6E00F212E8 /* 19.MouseAndJoystick */, - ); - }; -/* 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 "MouseAndJoystick" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 5E34C6DD1B7F4A0C00F212E8 /* Debug */, - 5E34C6DE1B7F4A0C00F212E8 /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - 5E34CC701B7F8E6E00F212E8 /* Build configuration list for PBXNativeTarget "19.MouseAndJoystick" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 5E34CC6C1B7F8E6E00F212E8 /* Debug */, - 5E34CC6D1B7F8E6E00F212E8 /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; -/* End XCConfigurationList section */ - }; - rootObject = 5E34C6D91B7F4A0C00F212E8 /* Project object */; -} diff --git a/examples/19.MouseAndJoystick/MouseAndJoystick.xcodeproj/xcshareddata/xcschemes/19.MouseAndJoystick.xcscheme b/examples/19.MouseAndJoystick/MouseAndJoystick.xcodeproj/xcshareddata/xcschemes/19.MouseAndJoystick.xcscheme deleted file mode 100644 index a7e77e1d..00000000 --- a/examples/19.MouseAndJoystick/MouseAndJoystick.xcodeproj/xcshareddata/xcschemes/19.MouseAndJoystick.xcscheme +++ /dev/null @@ -1,91 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/examples/19.MouseAndJoystick/MouseAndJoystick_vc10.vcxproj b/examples/19.MouseAndJoystick/MouseAndJoystick_vc10.vcxproj deleted file mode 100644 index 16c3a38f..00000000 --- a/examples/19.MouseAndJoystick/MouseAndJoystick_vc10.vcxproj +++ /dev/null @@ -1,231 +0,0 @@ - - - - - Debug - Win32 - - - Debug - x64 - - - Release - Win32 - - - Release - x64 - - - - 19.MouseAndJoystick - {FE853A36-E0D1-4AC5-A792-B643E70D2953} - MouseAndJoystick - - - - Application - MultiByte - Windows7.1SDK - - - Application - MultiByte - Windows7.1SDK - - - Application - MultiByte - Windows7.1SDK - - - Application - MultiByte - Windows7.1SDK - - - - - - - - - - - - - - - - - - - - - - - <_ProjectFileVersion>10.0.30319.1 - ..\..\bin\Win32-VisualStudio\ - ..\..\bin\Win64-VisualStudio\ - - - ..\..\bin\Win32-VisualStudio\ - ..\..\bin\Win64-VisualStudio\ - - - AllRules.ruleset - AllRules.ruleset - - - - - AllRules.ruleset - AllRules.ruleset - - - - - - - - .\Debug/MouseAndJoystick.tlb - - - - - Disabled - ..\..\include;%(AdditionalIncludeDirectories) - WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebug - - - Level3 - EditAndContinue - - - _DEBUG;%(PreprocessorDefinitions) - 0x0c07 - - - ..\..\bin\Win32-VisualStudio\19.MouseAndJoystick.exe - ..\..\lib\Win32-visualstudio;%(AdditionalLibraryDirectories) - true - Console - - - - - - - .\Debug/MouseAndJoystick.tlb - - - - - Disabled - ..\..\include;%(AdditionalIncludeDirectories) - WIN32;WIN64;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebug - - - Level3 - ProgramDatabase - - - _DEBUG;%(PreprocessorDefinitions) - 0x0c07 - - - ..\..\bin\Win64-VisualStudio\19.MouseAndJoystick.exe - ..\..\lib\Win64-visualstudio;%(AdditionalLibraryDirectories) - true - Console - - - - - - - .\Release/MouseAndJoystick.tlb - - - - - MaxSpeed - OnlyExplicitInline - ..\..\include;%(AdditionalIncludeDirectories) - WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) - true - MultiThreaded - true - - - Level3 - - - NDEBUG;%(PreprocessorDefinitions) - 0x0c07 - - - ..\..\bin\Win32-VisualStudio\19.MouseAndJoystick.exe - ..\..\lib\Win32-visualstudio;%(AdditionalLibraryDirectories) - Console - - - - - - - .\Release/MouseAndJoystick.tlb - - - - - MaxSpeed - OnlyExplicitInline - ..\..\include;%(AdditionalIncludeDirectories) - WIN32;WIN64;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) - true - MultiThreaded - true - - - Level3 - - - NDEBUG;%(PreprocessorDefinitions) - 0x0c07 - - - ..\..\bin\Win64-VisualStudio\19.MouseAndJoystick.exe - ..\..\lib\Win64-visualstudio;%(AdditionalLibraryDirectories) - Console - - - - - - - Disabled - Disabled - %(AdditionalIncludeDirectories) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(PreprocessorDefinitions) - EnableFastChecks - EnableFastChecks - MaxSpeed - MaxSpeed - %(AdditionalIncludeDirectories) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(PreprocessorDefinitions) - - - - - - \ No newline at end of file diff --git a/examples/19.MouseAndJoystick/MouseAndJoystick_vc11.vcxproj b/examples/19.MouseAndJoystick/MouseAndJoystick_vc11.vcxproj deleted file mode 100644 index 16c3a38f..00000000 --- a/examples/19.MouseAndJoystick/MouseAndJoystick_vc11.vcxproj +++ /dev/null @@ -1,231 +0,0 @@ - - - - - Debug - Win32 - - - Debug - x64 - - - Release - Win32 - - - Release - x64 - - - - 19.MouseAndJoystick - {FE853A36-E0D1-4AC5-A792-B643E70D2953} - MouseAndJoystick - - - - Application - MultiByte - Windows7.1SDK - - - Application - MultiByte - Windows7.1SDK - - - Application - MultiByte - Windows7.1SDK - - - Application - MultiByte - Windows7.1SDK - - - - - - - - - - - - - - - - - - - - - - - <_ProjectFileVersion>10.0.30319.1 - ..\..\bin\Win32-VisualStudio\ - ..\..\bin\Win64-VisualStudio\ - - - ..\..\bin\Win32-VisualStudio\ - ..\..\bin\Win64-VisualStudio\ - - - AllRules.ruleset - AllRules.ruleset - - - - - AllRules.ruleset - AllRules.ruleset - - - - - - - - .\Debug/MouseAndJoystick.tlb - - - - - Disabled - ..\..\include;%(AdditionalIncludeDirectories) - WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebug - - - Level3 - EditAndContinue - - - _DEBUG;%(PreprocessorDefinitions) - 0x0c07 - - - ..\..\bin\Win32-VisualStudio\19.MouseAndJoystick.exe - ..\..\lib\Win32-visualstudio;%(AdditionalLibraryDirectories) - true - Console - - - - - - - .\Debug/MouseAndJoystick.tlb - - - - - Disabled - ..\..\include;%(AdditionalIncludeDirectories) - WIN32;WIN64;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebug - - - Level3 - ProgramDatabase - - - _DEBUG;%(PreprocessorDefinitions) - 0x0c07 - - - ..\..\bin\Win64-VisualStudio\19.MouseAndJoystick.exe - ..\..\lib\Win64-visualstudio;%(AdditionalLibraryDirectories) - true - Console - - - - - - - .\Release/MouseAndJoystick.tlb - - - - - MaxSpeed - OnlyExplicitInline - ..\..\include;%(AdditionalIncludeDirectories) - WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) - true - MultiThreaded - true - - - Level3 - - - NDEBUG;%(PreprocessorDefinitions) - 0x0c07 - - - ..\..\bin\Win32-VisualStudio\19.MouseAndJoystick.exe - ..\..\lib\Win32-visualstudio;%(AdditionalLibraryDirectories) - Console - - - - - - - .\Release/MouseAndJoystick.tlb - - - - - MaxSpeed - OnlyExplicitInline - ..\..\include;%(AdditionalIncludeDirectories) - WIN32;WIN64;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) - true - MultiThreaded - true - - - Level3 - - - NDEBUG;%(PreprocessorDefinitions) - 0x0c07 - - - ..\..\bin\Win64-VisualStudio\19.MouseAndJoystick.exe - ..\..\lib\Win64-visualstudio;%(AdditionalLibraryDirectories) - Console - - - - - - - Disabled - Disabled - %(AdditionalIncludeDirectories) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(PreprocessorDefinitions) - EnableFastChecks - EnableFastChecks - MaxSpeed - MaxSpeed - %(AdditionalIncludeDirectories) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(PreprocessorDefinitions) - - - - - - \ No newline at end of file diff --git a/examples/19.MouseAndJoystick/MouseAndJoystick_vc12.vcxproj b/examples/19.MouseAndJoystick/MouseAndJoystick_vc12.vcxproj deleted file mode 100644 index 24dca694..00000000 --- a/examples/19.MouseAndJoystick/MouseAndJoystick_vc12.vcxproj +++ /dev/null @@ -1,231 +0,0 @@ - - - - - Debug - Win32 - - - Debug - x64 - - - Release - Win32 - - - Release - x64 - - - - 19.MouseAndJoystick - {FE853A36-E0D1-4AC5-A792-B643E70D2953} - MouseAndJoystick - - - - Application - MultiByte - Windows7.1SDK - - - Application - MultiByte - Windows7.1SDK - - - Application - MultiByte - Windows7.1SDK - - - Application - MultiByte - Windows7.1SDK - - - - - - - - - - - - - - - - - - - - - - - <_ProjectFileVersion>10.0.30319.1 - ..\..\bin\Win32-VisualStudio\ - ..\..\bin\Win64-VisualStudio\ - - - ..\..\bin\Win32-VisualStudio\ - ..\..\bin\Win64-VisualStudio\ - - - AllRules.ruleset - AllRules.ruleset - - - - - AllRules.ruleset - AllRules.ruleset - - - - - - - - .\Debug/MouseAndJoystick.tlb - - - - - Disabled - ..\..\include;%(AdditionalIncludeDirectories) - WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebug - - - Level3 - EditAndContinue - - - _DEBUG;%(PreprocessorDefinitions) - 0x0c07 - - - ..\..\bin\Win32-VisualStudio\19.MouseAndJoystick.exe - ..\..\lib\Win32-visualstudio;%(AdditionalLibraryDirectories) - true - Console - - - - - - - .\Debug/MouseAndJoystick.tlb - - - - - Disabled - ..\..\include;%(AdditionalIncludeDirectories) - WIN32;WIN64;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebug - - - Level3 - ProgramDatabase - - - _DEBUG;%(PreprocessorDefinitions) - 0x0c07 - - - ..\..\bin\Win64-VisualStudio\19.MouseAndJoystick.exe - ..\..\lib\Win64-visualstudio;%(AdditionalLibraryDirectories) - true - Console - - - - - - - .\Release/MouseAndJoystick.tlb - - - - - MaxSpeed - OnlyExplicitInline - ..\..\include;%(AdditionalIncludeDirectories) - WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) - true - MultiThreaded - true - - - Level3 - - - NDEBUG;%(PreprocessorDefinitions) - 0x0c07 - - - ..\..\bin\Win32-VisualStudio\19.MouseAndJoystick.exe - ..\..\lib\Win32-visualstudio;%(AdditionalLibraryDirectories) - Console - - - - - - - .\Release/MouseAndJoystick.tlb - - - - - MaxSpeed - OnlyExplicitInline - ..\..\include;%(AdditionalIncludeDirectories) - WIN32;WIN64;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) - true - MultiThreaded - true - - - Level3 - - - NDEBUG;%(PreprocessorDefinitions) - 0x0c07 - - - ..\..\bin\Win64-VisualStudio\19.MouseAndJoystick.exe - ..\..\lib\Win64-visualstudio;%(AdditionalLibraryDirectories) - Console - - - - - - - Disabled - Disabled - %(AdditionalIncludeDirectories) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(PreprocessorDefinitions) - EnableFastChecks - EnableFastChecks - MaxSpeed - MaxSpeed - %(AdditionalIncludeDirectories) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(PreprocessorDefinitions) - - - - - - \ No newline at end of file diff --git a/examples/19.MouseAndJoystick/MouseAndJoystick_vc14.vcxproj b/examples/19.MouseAndJoystick/MouseAndJoystick_vc14.vcxproj deleted file mode 100644 index 1c452c59..00000000 --- a/examples/19.MouseAndJoystick/MouseAndJoystick_vc14.vcxproj +++ /dev/null @@ -1,231 +0,0 @@ - - - - - Debug - Win32 - - - Debug - x64 - - - Release - Win32 - - - Release - x64 - - - - 19.MouseAndJoystick - {FE853A36-E0D1-4AC5-A792-B643E70D2953} - MouseAndJoystick - - - - Application - MultiByte - v140 - - - Application - MultiByte - v140 - - - Application - MultiByte - v140 - - - Application - MultiByte - v140 - - - - - - - - - - - - - - - - - - - - - - - <_ProjectFileVersion>10.0.30319.1 - ..\..\bin\Win32-VisualStudio\ - ..\..\bin\Win64-VisualStudio\ - - - ..\..\bin\Win32-VisualStudio\ - ..\..\bin\Win64-VisualStudio\ - - - AllRules.ruleset - AllRules.ruleset - - - - - AllRules.ruleset - AllRules.ruleset - - - - - - - - .\Debug/MouseAndJoystick.tlb - - - - - Disabled - ..\..\include;%(AdditionalIncludeDirectories) - WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebug - - - Level3 - EditAndContinue - - - _DEBUG;%(PreprocessorDefinitions) - 0x0c07 - - - ..\..\bin\Win32-VisualStudio\19.MouseAndJoystick.exe - ..\..\lib\Win32-visualstudio;%(AdditionalLibraryDirectories) - true - Console - - - - - - - .\Debug/MouseAndJoystick.tlb - - - - - Disabled - ..\..\include;%(AdditionalIncludeDirectories) - WIN32;WIN64;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebug - - - Level3 - ProgramDatabase - - - _DEBUG;%(PreprocessorDefinitions) - 0x0c07 - - - ..\..\bin\Win64-VisualStudio\19.MouseAndJoystick.exe - ..\..\lib\Win64-visualstudio;%(AdditionalLibraryDirectories) - true - Console - - - - - - - .\Release/MouseAndJoystick.tlb - - - - - MaxSpeed - OnlyExplicitInline - ..\..\include;%(AdditionalIncludeDirectories) - WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) - true - MultiThreaded - true - - - Level3 - - - NDEBUG;%(PreprocessorDefinitions) - 0x0c07 - - - ..\..\bin\Win32-VisualStudio\19.MouseAndJoystick.exe - ..\..\lib\Win32-visualstudio;%(AdditionalLibraryDirectories) - Console - - - - - - - .\Release/MouseAndJoystick.tlb - - - - - MaxSpeed - OnlyExplicitInline - ..\..\include;%(AdditionalIncludeDirectories) - WIN32;WIN64;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) - true - MultiThreaded - true - - - Level3 - - - NDEBUG;%(PreprocessorDefinitions) - 0x0c07 - - - ..\..\bin\Win64-VisualStudio\19.MouseAndJoystick.exe - ..\..\lib\Win64-visualstudio;%(AdditionalLibraryDirectories) - Console - - - - - - - Disabled - Disabled - %(AdditionalIncludeDirectories) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(PreprocessorDefinitions) - EnableFastChecks - EnableFastChecks - MaxSpeed - MaxSpeed - %(AdditionalIncludeDirectories) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(PreprocessorDefinitions) - - - - - - \ No newline at end of file diff --git a/examples/19.MouseAndJoystick/main.cpp b/examples/19.MouseAndJoystick/main.cpp deleted file mode 100644 index faa63057..00000000 --- a/examples/19.MouseAndJoystick/main.cpp +++ /dev/null @@ -1,285 +0,0 @@ -/** Example 019 Mouse and Joystick - -This tutorial builds on example 04.Movement which showed how to -handle keyboard events in Irrlicht. Here we'll handle mouse events -and joystick events, if you have a joystick connected and a device -that supports joysticks. These are currently Windows, Linux and SDL -devices. -*/ - -#ifdef _MSC_VER -// We'll define this to stop MSVC complaining about sprintf(). -#define _CRT_SECURE_NO_WARNINGS -#pragma comment(lib, "Irrlicht.lib") -#endif - -#include -#include "driverChoice.h" - -using namespace irr; - -/* -Just as we did in example 04.Movement, we'll store the latest state of the -mouse and the first joystick, updating them as we receive events. -*/ -class MyEventReceiver : public IEventReceiver -{ -public: - // We'll create a struct to record info on the mouse state - struct SMouseState - { - core::position2di Position; - bool LeftButtonDown; - SMouseState() : LeftButtonDown(false) { } - } MouseState; - - // This is the one method that we have to implement - virtual bool OnEvent(const SEvent& event) - { - // Remember the mouse state - if (event.EventType == irr::EET_MOUSE_INPUT_EVENT) - { - switch(event.MouseInput.Event) - { - case EMIE_LMOUSE_PRESSED_DOWN: - MouseState.LeftButtonDown = true; - break; - - case EMIE_LMOUSE_LEFT_UP: - MouseState.LeftButtonDown = false; - break; - - case EMIE_MOUSE_MOVED: - MouseState.Position.X = event.MouseInput.X; - MouseState.Position.Y = event.MouseInput.Y; - break; - - default: - // We won't use the wheel - break; - } - } - - // The state of each connected joystick is sent to us - // once every run() of the Irrlicht device. Store the - // state of the first joystick, ignoring other joysticks. - // This is currently only supported on Windows and Linux. - if (event.EventType == irr::EET_JOYSTICK_INPUT_EVENT - && event.JoystickEvent.Joystick == 0) - { - JoystickState = event.JoystickEvent; - } - - return false; - } - - const SEvent::SJoystickEvent & GetJoystickState(void) const - { - return JoystickState; - } - - const SMouseState & GetMouseState(void) const - { - return MouseState; - } - - - MyEventReceiver() - { - } - -private: - SEvent::SJoystickEvent JoystickState; -}; - - -/* -The event receiver for keeping the pressed keys is ready, the actual responses -will be made inside the render loop, right before drawing the scene. So lets -just create an irr::IrrlichtDevice and the scene node we want to move. We also -create some other additional scene nodes, to show that there are also some -different possibilities to move and animate scene nodes. -*/ -int main() -{ - // ask user for driver - video::E_DRIVER_TYPE driverType=driverChoiceConsole(); - if (driverType==video::EDT_COUNT) - return 1; - - // create device - MyEventReceiver receiver; - - IrrlichtDevice* device = createDevice(driverType, - core::dimension2d(640, 480), 16, false, false, false, &receiver); - - if (device == 0) - return 1; // could not create selected driver. - - - core::array joystickInfo; - if(device->activateJoysticks(joystickInfo)) - { - std::cout << "Joystick support is enabled and " << joystickInfo.size() << " joystick(s) are present." << std::endl; - - for(u32 joystick = 0; joystick < joystickInfo.size(); ++joystick) - { - std::cout << "Joystick " << joystick << ":" << std::endl; - std::cout << "\tName: '" << joystickInfo[joystick].Name.c_str() << "'" << std::endl; - std::cout << "\tAxes: " << joystickInfo[joystick].Axes << std::endl; - std::cout << "\tButtons: " << joystickInfo[joystick].Buttons << std::endl; - - std::cout << "\tHat is: "; - - switch(joystickInfo[joystick].PovHat) - { - case SJoystickInfo::POV_HAT_PRESENT: - std::cout << "present" << std::endl; - break; - - case SJoystickInfo::POV_HAT_ABSENT: - std::cout << "absent" << std::endl; - break; - - case SJoystickInfo::POV_HAT_UNKNOWN: - default: - std::cout << "unknown" << std::endl; - break; - } - } - } - else - { - std::cout << "Joystick support is not enabled." << std::endl; - } - - core::stringw tmp = L"Irrlicht Joystick Example ("; - tmp += joystickInfo.size(); - tmp += " joysticks)"; - device->setWindowCaption(tmp.c_str()); - - video::IVideoDriver* driver = device->getVideoDriver(); - scene::ISceneManager* smgr = device->getSceneManager(); - - /* - We'll create an arrow mesh and move it around either with the joystick axis/hat, - or make it follow the mouse pointer. */ - scene::ISceneNode * node = smgr->addMeshSceneNode( - smgr->addArrowMesh( "Arrow", - video::SColor(255, 255, 0, 0), - video::SColor(255, 0, 255, 0), - 16,16, - 2.f, 1.3f, - 0.1f, 0.6f - ) - ); - node->setMaterialFlag(video::EMF_LIGHTING, false); - - scene::ICameraSceneNode * camera = smgr->addCameraSceneNode(); - camera->setPosition(core::vector3df(0, 0, -10)); - - // As in example 04, we'll use framerate independent movement. - u32 then = device->getTimer()->getTime(); - const f32 MOVEMENT_SPEED = 5.f; - - while(device->run()) - { - // Work out a frame delta time. - const u32 now = device->getTimer()->getTime(); - const f32 frameDeltaTime = (f32)(now - then) / 1000.f; // Time in seconds - then = now; - - bool movedWithJoystick = false; - core::vector3df nodePosition = node->getPosition(); - - if(joystickInfo.size() > 0) - { - f32 moveHorizontal = 0.f; // Range is -1.f for full left to +1.f for full right - f32 moveVertical = 0.f; // -1.f for full down to +1.f for full up. - - const SEvent::SJoystickEvent & joystickData = receiver.GetJoystickState(); - - // We receive the full analog range of the axes, and so have to implement our - // own dead zone. This is an empirical value, since some joysticks have more - // jitter or creep around the center point than others. We'll use 5% of the - // range as the dead zone, but generally you would want to give the user the - // option to change this. - const f32 DEAD_ZONE = 0.05f; - - moveHorizontal = - (f32)joystickData.Axis[SEvent::SJoystickEvent::AXIS_X] / 32767.f; - if(fabs(moveHorizontal) < DEAD_ZONE) - moveHorizontal = 0.f; - - moveVertical = - (f32)joystickData.Axis[SEvent::SJoystickEvent::AXIS_Y] / -32767.f; - if(fabs(moveVertical) < DEAD_ZONE) - moveVertical = 0.f; - - // POV hat info is only currently supported on Windows, but the value is - // guaranteed to be 65535 if it's not supported, so we can check its range. - const u16 povDegrees = joystickData.POV / 100; - if(povDegrees < 360) - { - if(povDegrees > 0 && povDegrees < 180) - moveHorizontal = 1.f; - else if(povDegrees > 180) - moveHorizontal = -1.f; - - if(povDegrees > 90 && povDegrees < 270) - moveVertical = -1.f; - else if(povDegrees > 270 || povDegrees < 90) - moveVertical = +1.f; - } - - if(!core::equals(moveHorizontal, 0.f) || !core::equals(moveVertical, 0.f)) - { - nodePosition.X += MOVEMENT_SPEED * frameDeltaTime * moveHorizontal; - nodePosition.Y += MOVEMENT_SPEED * frameDeltaTime * moveVertical; - movedWithJoystick = true; - } - } - - // If the arrow node isn't being moved with the joystick, then have it follow the mouse cursor. - if(!movedWithJoystick) - { - // Create a ray through the mouse cursor. - core::line3df ray = smgr->getSceneCollisionManager()->getRayFromScreenCoordinates( - receiver.GetMouseState().Position, camera); - - // And intersect the ray with a plane around the node facing towards the camera. - core::plane3df plane(nodePosition, core::vector3df(0, 0, -1)); - core::vector3df mousePosition; - if(plane.getIntersectionWithLine(ray.start, ray.getVector(), mousePosition)) - { - // We now have a mouse position in 3d space; move towards it. - core::vector3df toMousePosition(mousePosition - nodePosition); - const f32 availableMovement = MOVEMENT_SPEED * frameDeltaTime; - - if(toMousePosition.getLength() <= availableMovement) - nodePosition = mousePosition; // Jump to the final position - else - nodePosition += toMousePosition.normalize() * availableMovement; // Move towards it - } - } - - node->setPosition(nodePosition); - - // Turn lighting on and off depending on whether the left mouse button is down. - node->setMaterialFlag(video::EMF_LIGHTING, receiver.GetMouseState().LeftButtonDown); - - driver->beginScene(video::ECBF_COLOR | video::ECBF_DEPTH, video::SColor(255,113,113,133)); - smgr->drawAll(); // draw the 3d scene - driver->endScene(); - } - - /* - In the end, delete the Irrlicht device. - */ - device->drop(); - - return 0; -} - -/* -**/ diff --git a/examples/20.ManagedLights/Makefile b/examples/20.ManagedLights/Makefile deleted file mode 100644 index 6fe42450..00000000 --- a/examples/20.ManagedLights/Makefile +++ /dev/null @@ -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 := 20.ManagedLights -# 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 diff --git a/examples/20.ManagedLights/ManagedLights.cbp b/examples/20.ManagedLights/ManagedLights.cbp deleted file mode 100644 index 5c94e995..00000000 --- a/examples/20.ManagedLights/ManagedLights.cbp +++ /dev/null @@ -1,57 +0,0 @@ - - - - - - diff --git a/examples/20.ManagedLights/ManagedLights.vcproj b/examples/20.ManagedLights/ManagedLights.vcproj deleted file mode 100644 index 850a8d27..00000000 --- a/examples/20.ManagedLights/ManagedLights.vcproj +++ /dev/null @@ -1,163 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/examples/20.ManagedLights/ManagedLights.xcodeproj/project.pbxproj b/examples/20.ManagedLights/ManagedLights.xcodeproj/project.pbxproj deleted file mode 100644 index 34988448..00000000 --- a/examples/20.ManagedLights/ManagedLights.xcodeproj/project.pbxproj +++ /dev/null @@ -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 /* 20.ManagedLights.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = 20.ManagedLights.app; sourceTree = BUILT_PRODUCTS_DIR; }; - 5E34CC741B7F8EEF00F212E8 /* main.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = main.cpp; sourceTree = ""; }; - 5E34CC781B7F90A000F212E8 /* libIrrlicht.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libIrrlicht.a; path = ../../lib/OSX/libIrrlicht.a; sourceTree = ""; }; - 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 = ""; }; -/* 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 = ""; - }; - 5E34CC521B7F8E6E00F212E8 /* Products */ = { - isa = PBXGroup; - children = ( - 5E34CC511B7F8E6E00F212E8 /* 20.ManagedLights.app */, - ); - name = Products; - sourceTree = ""; - }; - 5E34CC761B7F905600F212E8 /* Libraries */ = { - isa = PBXGroup; - children = ( - 5E8570B01B7F99F500B267D2 /* Cocoa.framework */, - 5E8570B41B7F9A0700B267D2 /* IOKit.framework */, - 5E8570B21B7F99FE00B267D2 /* OpenGL.framework */, - 5E34CC781B7F90A000F212E8 /* libIrrlicht.a */, - ); - name = Libraries; - sourceTree = ""; - }; - 5E34CC771B7F906D00F212E8 /* Resources */ = { - isa = PBXGroup; - children = ( - 5E8570BE1B7F9D3A00B267D2 /* media */, - ); - name = Resources; - sourceTree = ""; - }; -/* End PBXGroup section */ - -/* Begin PBXNativeTarget section */ - 5E34CC501B7F8E6E00F212E8 /* 20.ManagedLights */ = { - isa = PBXNativeTarget; - buildConfigurationList = 5E34CC701B7F8E6E00F212E8 /* Build configuration list for PBXNativeTarget "20.ManagedLights" */; - buildPhases = ( - 5E34CC4D1B7F8E6E00F212E8 /* Sources */, - 5E34CC4E1B7F8E6E00F212E8 /* Frameworks */, - 5E34CC4F1B7F8E6E00F212E8 /* Resources */, - ); - buildRules = ( - ); - dependencies = ( - ); - name = 20.ManagedLights; - productName = 01.HelloWorld; - productReference = 5E34CC511B7F8E6E00F212E8 /* 20.ManagedLights.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 "ManagedLights" */; - compatibilityVersion = "Xcode 3.2"; - developmentRegion = English; - hasScannedForEncodings = 0; - knownRegions = ( - en, - Base, - ); - mainGroup = 5E34C6D81B7F4A0C00F212E8; - productRefGroup = 5E34CC521B7F8E6E00F212E8 /* Products */; - projectDirPath = ""; - projectRoot = ""; - targets = ( - 5E34CC501B7F8E6E00F212E8 /* 20.ManagedLights */, - ); - }; -/* 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 "ManagedLights" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 5E34C6DD1B7F4A0C00F212E8 /* Debug */, - 5E34C6DE1B7F4A0C00F212E8 /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - 5E34CC701B7F8E6E00F212E8 /* Build configuration list for PBXNativeTarget "20.ManagedLights" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 5E34CC6C1B7F8E6E00F212E8 /* Debug */, - 5E34CC6D1B7F8E6E00F212E8 /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; -/* End XCConfigurationList section */ - }; - rootObject = 5E34C6D91B7F4A0C00F212E8 /* Project object */; -} diff --git a/examples/20.ManagedLights/ManagedLights.xcodeproj/xcshareddata/xcschemes/20.ManagedLights.xcscheme b/examples/20.ManagedLights/ManagedLights.xcodeproj/xcshareddata/xcschemes/20.ManagedLights.xcscheme deleted file mode 100644 index 5e640be9..00000000 --- a/examples/20.ManagedLights/ManagedLights.xcodeproj/xcshareddata/xcschemes/20.ManagedLights.xcscheme +++ /dev/null @@ -1,91 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/examples/20.ManagedLights/ManagedLights_vc10.vcxproj b/examples/20.ManagedLights/ManagedLights_vc10.vcxproj deleted file mode 100644 index 53568a92..00000000 --- a/examples/20.ManagedLights/ManagedLights_vc10.vcxproj +++ /dev/null @@ -1,234 +0,0 @@ - - - - - Debug - Win32 - - - Debug - x64 - - - Release - Win32 - - - Release - x64 - - - - 20.ManagedLights - {16007FE2-142B-47F8-93E1-519BA3F39E71} - ManagedLights - - - - Application - MultiByte - Windows7.1SDK - - - Application - MultiByte - Windows7.1SDK - - - Application - MultiByte - Windows7.1SDK - - - Application - MultiByte - Windows7.1SDK - - - - - - - - - - - - - - - - - - - - - - - <_ProjectFileVersion>10.0.30319.1 - ..\..\bin\Win32-VisualStudio\ - ..\..\bin\Win64-VisualStudio\ - - - ..\..\bin\Win32-VisualStudio\ - ..\..\bin\Win64-VisualStudio\ - - - AllRules.ruleset - AllRules.ruleset - - - - - AllRules.ruleset - AllRules.ruleset - - - - - - - - .\Debug/ManagedLights.tlb - - - - - Disabled - ..\..\include;%(AdditionalIncludeDirectories) - WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebug - - - Level3 - EditAndContinue - - - _DEBUG;%(PreprocessorDefinitions) - 0x0c07 - - - ..\..\Lib\Win32-visualstudio\Irrlicht.lib;%(AdditionalDependencies) - ..\..\bin\Win32-VisualStudio\20.ManagedLights.exe - ..\..\lib\Win32-visualstudio;%(AdditionalLibraryDirectories) - true - Console - - - - - - - .\Debug/ManagedLights.tlb - - - - - Disabled - ..\..\include;%(AdditionalIncludeDirectories) - WIN32;WIN64;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebug - - - Level3 - ProgramDatabase - - - _DEBUG;%(PreprocessorDefinitions) - 0x0c07 - - - kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies) - ..\..\bin\Win64-VisualStudio\20.ManagedLights.exe - ..\..\lib\Win64-visualstudio;%(AdditionalLibraryDirectories) - true - Console - - - - - - - .\Release/ManagedLights.tlb - - - - - MaxSpeed - OnlyExplicitInline - ..\..\include;%(AdditionalIncludeDirectories) - WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) - true - MultiThreaded - true - - - Level3 - - - NDEBUG;%(PreprocessorDefinitions) - 0x0c07 - - - ..\..\bin\Win32-VisualStudio\20.ManagedLights.exe - ..\..\lib\Win32-visualstudio;%(AdditionalLibraryDirectories) - Console - - - - - - - .\Release/ManagedLights.tlb - - - - - MaxSpeed - OnlyExplicitInline - ..\..\include;%(AdditionalIncludeDirectories) - WIN32;WIN64;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) - true - MultiThreaded - true - - - Level3 - - - NDEBUG;%(PreprocessorDefinitions) - 0x0c07 - - - ..\..\bin\Win64-VisualStudio\20.ManagedLights.exe - ..\..\lib\Win64-visualstudio;%(AdditionalLibraryDirectories) - Console - - - kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies) - - - - - Disabled - Disabled - %(AdditionalIncludeDirectories) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(PreprocessorDefinitions) - EnableFastChecks - EnableFastChecks - MaxSpeed - MaxSpeed - %(AdditionalIncludeDirectories) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(PreprocessorDefinitions) - - - - - - \ No newline at end of file diff --git a/examples/20.ManagedLights/ManagedLights_vc11.vcxproj b/examples/20.ManagedLights/ManagedLights_vc11.vcxproj deleted file mode 100644 index 53568a92..00000000 --- a/examples/20.ManagedLights/ManagedLights_vc11.vcxproj +++ /dev/null @@ -1,234 +0,0 @@ - - - - - Debug - Win32 - - - Debug - x64 - - - Release - Win32 - - - Release - x64 - - - - 20.ManagedLights - {16007FE2-142B-47F8-93E1-519BA3F39E71} - ManagedLights - - - - Application - MultiByte - Windows7.1SDK - - - Application - MultiByte - Windows7.1SDK - - - Application - MultiByte - Windows7.1SDK - - - Application - MultiByte - Windows7.1SDK - - - - - - - - - - - - - - - - - - - - - - - <_ProjectFileVersion>10.0.30319.1 - ..\..\bin\Win32-VisualStudio\ - ..\..\bin\Win64-VisualStudio\ - - - ..\..\bin\Win32-VisualStudio\ - ..\..\bin\Win64-VisualStudio\ - - - AllRules.ruleset - AllRules.ruleset - - - - - AllRules.ruleset - AllRules.ruleset - - - - - - - - .\Debug/ManagedLights.tlb - - - - - Disabled - ..\..\include;%(AdditionalIncludeDirectories) - WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebug - - - Level3 - EditAndContinue - - - _DEBUG;%(PreprocessorDefinitions) - 0x0c07 - - - ..\..\Lib\Win32-visualstudio\Irrlicht.lib;%(AdditionalDependencies) - ..\..\bin\Win32-VisualStudio\20.ManagedLights.exe - ..\..\lib\Win32-visualstudio;%(AdditionalLibraryDirectories) - true - Console - - - - - - - .\Debug/ManagedLights.tlb - - - - - Disabled - ..\..\include;%(AdditionalIncludeDirectories) - WIN32;WIN64;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebug - - - Level3 - ProgramDatabase - - - _DEBUG;%(PreprocessorDefinitions) - 0x0c07 - - - kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies) - ..\..\bin\Win64-VisualStudio\20.ManagedLights.exe - ..\..\lib\Win64-visualstudio;%(AdditionalLibraryDirectories) - true - Console - - - - - - - .\Release/ManagedLights.tlb - - - - - MaxSpeed - OnlyExplicitInline - ..\..\include;%(AdditionalIncludeDirectories) - WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) - true - MultiThreaded - true - - - Level3 - - - NDEBUG;%(PreprocessorDefinitions) - 0x0c07 - - - ..\..\bin\Win32-VisualStudio\20.ManagedLights.exe - ..\..\lib\Win32-visualstudio;%(AdditionalLibraryDirectories) - Console - - - - - - - .\Release/ManagedLights.tlb - - - - - MaxSpeed - OnlyExplicitInline - ..\..\include;%(AdditionalIncludeDirectories) - WIN32;WIN64;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) - true - MultiThreaded - true - - - Level3 - - - NDEBUG;%(PreprocessorDefinitions) - 0x0c07 - - - ..\..\bin\Win64-VisualStudio\20.ManagedLights.exe - ..\..\lib\Win64-visualstudio;%(AdditionalLibraryDirectories) - Console - - - kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies) - - - - - Disabled - Disabled - %(AdditionalIncludeDirectories) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(PreprocessorDefinitions) - EnableFastChecks - EnableFastChecks - MaxSpeed - MaxSpeed - %(AdditionalIncludeDirectories) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(PreprocessorDefinitions) - - - - - - \ No newline at end of file diff --git a/examples/20.ManagedLights/ManagedLights_vc12.vcxproj b/examples/20.ManagedLights/ManagedLights_vc12.vcxproj deleted file mode 100644 index 287f1b96..00000000 --- a/examples/20.ManagedLights/ManagedLights_vc12.vcxproj +++ /dev/null @@ -1,234 +0,0 @@ - - - - - Debug - Win32 - - - Debug - x64 - - - Release - Win32 - - - Release - x64 - - - - 20.ManagedLights - {16007FE2-142B-47F8-93E1-519BA3F39E71} - ManagedLights - - - - Application - MultiByte - Windows7.1SDK - - - Application - MultiByte - Windows7.1SDK - - - Application - MultiByte - Windows7.1SDK - - - Application - MultiByte - Windows7.1SDK - - - - - - - - - - - - - - - - - - - - - - - <_ProjectFileVersion>10.0.30319.1 - ..\..\bin\Win32-VisualStudio\ - ..\..\bin\Win64-VisualStudio\ - - - ..\..\bin\Win32-VisualStudio\ - ..\..\bin\Win64-VisualStudio\ - - - AllRules.ruleset - AllRules.ruleset - - - - - AllRules.ruleset - AllRules.ruleset - - - - - - - - .\Debug/ManagedLights.tlb - - - - - Disabled - ..\..\include;%(AdditionalIncludeDirectories) - WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebug - - - Level3 - EditAndContinue - - - _DEBUG;%(PreprocessorDefinitions) - 0x0c07 - - - ..\..\Lib\Win32-visualstudio\Irrlicht.lib;%(AdditionalDependencies) - ..\..\bin\Win32-VisualStudio\20.ManagedLights.exe - ..\..\lib\Win32-visualstudio;%(AdditionalLibraryDirectories) - true - Console - - - - - - - .\Debug/ManagedLights.tlb - - - - - Disabled - ..\..\include;%(AdditionalIncludeDirectories) - WIN32;WIN64;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebug - - - Level3 - ProgramDatabase - - - _DEBUG;%(PreprocessorDefinitions) - 0x0c07 - - - kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies) - ..\..\bin\Win64-VisualStudio\20.ManagedLights.exe - ..\..\lib\Win64-visualstudio;%(AdditionalLibraryDirectories) - true - Console - - - - - - - .\Release/ManagedLights.tlb - - - - - MaxSpeed - OnlyExplicitInline - ..\..\include;%(AdditionalIncludeDirectories) - WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) - true - MultiThreaded - true - - - Level3 - - - NDEBUG;%(PreprocessorDefinitions) - 0x0c07 - - - ..\..\bin\Win32-VisualStudio\20.ManagedLights.exe - ..\..\lib\Win32-visualstudio;%(AdditionalLibraryDirectories) - Console - - - - - - - .\Release/ManagedLights.tlb - - - - - MaxSpeed - OnlyExplicitInline - ..\..\include;%(AdditionalIncludeDirectories) - WIN32;WIN64;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) - true - MultiThreaded - true - - - Level3 - - - NDEBUG;%(PreprocessorDefinitions) - 0x0c07 - - - ..\..\bin\Win64-VisualStudio\20.ManagedLights.exe - ..\..\lib\Win64-visualstudio;%(AdditionalLibraryDirectories) - Console - - - kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies) - - - - - Disabled - Disabled - %(AdditionalIncludeDirectories) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(PreprocessorDefinitions) - EnableFastChecks - EnableFastChecks - MaxSpeed - MaxSpeed - %(AdditionalIncludeDirectories) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(PreprocessorDefinitions) - - - - - - \ No newline at end of file diff --git a/examples/20.ManagedLights/ManagedLights_vc14.vcxproj b/examples/20.ManagedLights/ManagedLights_vc14.vcxproj deleted file mode 100644 index 31e9e782..00000000 --- a/examples/20.ManagedLights/ManagedLights_vc14.vcxproj +++ /dev/null @@ -1,234 +0,0 @@ - - - - - Debug - Win32 - - - Debug - x64 - - - Release - Win32 - - - Release - x64 - - - - 20.ManagedLights - {16007FE2-142B-47F8-93E1-519BA3F39E71} - ManagedLights - - - - Application - MultiByte - v140 - - - Application - MultiByte - v140 - - - Application - MultiByte - v140 - - - Application - MultiByte - v140 - - - - - - - - - - - - - - - - - - - - - - - <_ProjectFileVersion>10.0.30319.1 - ..\..\bin\Win32-VisualStudio\ - ..\..\bin\Win64-VisualStudio\ - - - ..\..\bin\Win32-VisualStudio\ - ..\..\bin\Win64-VisualStudio\ - - - AllRules.ruleset - AllRules.ruleset - - - - - AllRules.ruleset - AllRules.ruleset - - - - - - - - .\Debug/ManagedLights.tlb - - - - - Disabled - ..\..\include;%(AdditionalIncludeDirectories) - WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebug - - - Level3 - EditAndContinue - - - _DEBUG;%(PreprocessorDefinitions) - 0x0c07 - - - ..\..\Lib\Win32-visualstudio\Irrlicht.lib;%(AdditionalDependencies) - ..\..\bin\Win32-VisualStudio\20.ManagedLights.exe - ..\..\lib\Win32-visualstudio;%(AdditionalLibraryDirectories) - true - Console - - - - - - - .\Debug/ManagedLights.tlb - - - - - Disabled - ..\..\include;%(AdditionalIncludeDirectories) - WIN32;WIN64;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebug - - - Level3 - ProgramDatabase - - - _DEBUG;%(PreprocessorDefinitions) - 0x0c07 - - - kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies) - ..\..\bin\Win64-VisualStudio\20.ManagedLights.exe - ..\..\lib\Win64-visualstudio;%(AdditionalLibraryDirectories) - true - Console - - - - - - - .\Release/ManagedLights.tlb - - - - - MaxSpeed - OnlyExplicitInline - ..\..\include;%(AdditionalIncludeDirectories) - WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) - true - MultiThreaded - true - - - Level3 - - - NDEBUG;%(PreprocessorDefinitions) - 0x0c07 - - - ..\..\bin\Win32-VisualStudio\20.ManagedLights.exe - ..\..\lib\Win32-visualstudio;%(AdditionalLibraryDirectories) - Console - - - - - - - .\Release/ManagedLights.tlb - - - - - MaxSpeed - OnlyExplicitInline - ..\..\include;%(AdditionalIncludeDirectories) - WIN32;WIN64;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) - true - MultiThreaded - true - - - Level3 - - - NDEBUG;%(PreprocessorDefinitions) - 0x0c07 - - - ..\..\bin\Win64-VisualStudio\20.ManagedLights.exe - ..\..\lib\Win64-visualstudio;%(AdditionalLibraryDirectories) - Console - - - kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies) - - - - - Disabled - Disabled - %(AdditionalIncludeDirectories) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(PreprocessorDefinitions) - EnableFastChecks - EnableFastChecks - MaxSpeed - MaxSpeed - %(AdditionalIncludeDirectories) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(PreprocessorDefinitions) - - - - - - \ No newline at end of file diff --git a/examples/20.ManagedLights/main.cpp b/examples/20.ManagedLights/main.cpp deleted file mode 100644 index f1fdb50d..00000000 --- a/examples/20.ManagedLights/main.cpp +++ /dev/null @@ -1,389 +0,0 @@ -/** Example 020 Managed Lights - -Written by Colin MacDonald. This tutorial explains the use of the Light Manager -of Irrlicht. It enables the use of more dynamic light sources than the actual -hardware supports. Further applications of the Light Manager, such as per scene -node callbacks, are left out for simplicity of the example. -*/ - -#include -#include "driverChoice.h" -#include "exampleHelper.h" - -using namespace irr; -using namespace core; - -#if defined(_MSC_VER) -#pragma comment(lib, "Irrlicht.lib") -#endif // MSC_VER - -/* - Normally, you are limited to 8 dynamic lights per scene: this is a hardware limit. If you - want to use more dynamic lights in your scene, then you can register an optional light - manager that allows you to to turn lights on and off at specific point during rendering. - You are still limited to 8 lights, but the limit is per scene node. - - This is completely optional: if you do not register a light manager, then a default - distance-based scheme will be used to prioritise hardware lights based on their distance - from the active camera. - - NO_MANAGEMENT disables the light manager and shows Irrlicht's default light behaviour. - The 8 lights nearest to the camera will be turned on, and other lights will be turned off. - In this example, this produces a funky looking but incoherent light display. - - LIGHTS_NEAREST_NODE shows an implementation that turns on a limited number of lights - per mesh scene node. If finds the 3 lights that are nearest to the node being rendered, - and turns them on, turning all other lights off. This works, but as it operates on every - light for every node, it does not scale well with many lights. The flickering you can see - in this demo is due to the lights swapping their relative positions from the cubes - (a deliberate demonstration of the limitations of this technique). - - LIGHTS_IN_ZONE shows a technique for turning on lights based on a 'zone'. Each empty scene - node is considered to be the parent of a zone. When nodes are rendered, they turn off all - lights, then find their parent 'zone' and turn on all lights that are inside that zone, i.e. - are descendents of it in the scene graph. This produces true 'local' lighting for each cube - in this example. You could use a similar technique to locally light all meshes in (e.g.) - a room, without the lights spilling out to other rooms. - - This light manager is also an event receiver; this is purely for simplicity in this example, - it's neither necessary nor recommended for a real application. -*/ -class CMyLightManager : public scene::ILightManager, public IEventReceiver -{ - typedef enum - { - NO_MANAGEMENT, - LIGHTS_NEAREST_NODE, - LIGHTS_IN_ZONE - } - LightManagementMode; - - LightManagementMode Mode; - LightManagementMode RequestedMode; - - // These data represent the state information that this light manager - // is interested in. - scene::ISceneManager * SceneManager; - core::array * SceneLightList; - scene::E_SCENE_NODE_RENDER_PASS CurrentRenderPass; - scene::ISceneNode * CurrentSceneNode; - -public: - CMyLightManager(scene::ISceneManager* sceneManager) - : Mode(NO_MANAGEMENT), RequestedMode(NO_MANAGEMENT), - SceneManager(sceneManager), SceneLightList(0), - CurrentRenderPass(scene::ESNRP_NONE), CurrentSceneNode(0) - { } - - // The input receiver interface, which just switches light management strategy - bool OnEvent(const SEvent & event) - { - bool handled = false; - - if (event.EventType == irr::EET_KEY_INPUT_EVENT && event.KeyInput.PressedDown) - { - handled = true; - switch(event.KeyInput.Key) - { - case irr::KEY_KEY_1: - RequestedMode = NO_MANAGEMENT; - break; - case irr::KEY_KEY_2: - RequestedMode = LIGHTS_NEAREST_NODE; - break; - case irr::KEY_KEY_3: - RequestedMode = LIGHTS_IN_ZONE; - break; - default: - handled = false; - break; - } - - if(NO_MANAGEMENT == RequestedMode) - SceneManager->setLightManager(0); // Show that it's safe to register the light manager - else - SceneManager->setLightManager(this); - } - - return handled; - } - - - // This is called before the first scene node is rendered. - virtual void OnPreRender(core::array & lightList) - { - // Update the mode; changing it here ensures that it's consistent throughout a render - Mode = RequestedMode; - - // Store the light list. I am free to alter this list until the end of OnPostRender(). - SceneLightList = &lightList; - } - - // Called after the last scene node is rendered. - virtual void OnPostRender() - { - // Since light management might be switched off in the event handler, we'll turn all - // lights on to ensure that they are in a consistent state. You wouldn't normally have - // to do this when using a light manager, since you'd continue to do light management - // yourself. - for (u32 i = 0; i < SceneLightList->size(); i++) - (*SceneLightList)[i]->setVisible(true); - } - - virtual void OnRenderPassPreRender(scene::E_SCENE_NODE_RENDER_PASS renderPass) - { - // I don't have to do anything here except remember which render pass I am in. - CurrentRenderPass = renderPass; - } - - virtual void OnRenderPassPostRender(scene::E_SCENE_NODE_RENDER_PASS renderPass) - { - // I only want solid nodes to be lit, so after the solid pass, turn all lights off. - if (scene::ESNRP_SOLID == renderPass) - { - for (u32 i = 0; i < SceneLightList->size(); ++i) - (*SceneLightList)[i]->setVisible(false); - } - } - - // This is called before the specified scene node is rendered - virtual void OnNodePreRender(scene::ISceneNode* node) - { - CurrentSceneNode = node; - - // This light manager only considers solid objects, but you are free to manipulate - // lights during any phase, depending on your requirements. - if (scene::ESNRP_SOLID != CurrentRenderPass) - return; - - // And in fact for this example, I only want to consider lighting for cube scene - // nodes. You will probably want to deal with lighting for (at least) mesh / - // animated mesh scene nodes as well. - if (node->getType() != scene::ESNT_CUBE) - return; - - if (LIGHTS_NEAREST_NODE == Mode) - { - // This is a naive implementation that prioritises every light in the scene - // by its proximity to the node being rendered. This produces some flickering - // when lights orbit closer to a cube than its 'zone' lights. - const vector3df nodePosition = node->getAbsolutePosition(); - - // Sort the light list by prioritising them based on their distance from the node - // that's about to be rendered. - array sortingArray; - sortingArray.reallocate(SceneLightList->size()); - - u32 i; - for(i = 0; i < SceneLightList->size(); ++i) - { - scene::ISceneNode* lightNode = (*SceneLightList)[i]; - const f64 distance = lightNode->getAbsolutePosition().getDistanceFromSQ(nodePosition); - sortingArray.push_back(LightDistanceElement(lightNode, distance)); - } - - sortingArray.sort(); - - // The list is now sorted by proximity to the node. - // Turn on the three nearest lights, and turn the others off. - for(i = 0; i < sortingArray.size(); ++i) - sortingArray[i].node->setVisible(i < 3); - } - else if(LIGHTS_IN_ZONE == Mode) - { - // Empty scene nodes are used to represent 'zones'. For each solid mesh that - // is being rendered, turn off all lights, then find its 'zone' parent, and turn - // on all lights that are found under that node in the scene graph. - // This is a general purpose algorithm that doesn't use any special - // knowledge of how this particular scene graph is organised. - for (u32 i = 0; i < SceneLightList->size(); ++i) - { - if ((*SceneLightList)[i]->getType() != scene::ESNT_LIGHT) - continue; - scene::ILightSceneNode* lightNode = static_cast((*SceneLightList)[i]); - video::SLight & lightData = lightNode->getLightData(); - - if (video::ELT_DIRECTIONAL != lightData.Type) - lightNode->setVisible(false); - } - - scene::ISceneNode * parentZone = findZone(node); - if (parentZone) - turnOnZoneLights(parentZone); - } - } - - // Called after the specified scene node is rendered - virtual void OnNodePostRender(scene::ISceneNode* node) - { - // I don't need to do any light management after individual node rendering. - } - -private: - - // Find the empty scene node that is the parent of the specified node - scene::ISceneNode * findZone(scene::ISceneNode * node) - { - if (!node) - return 0; - - if (node->getType() == scene::ESNT_EMPTY) - return node; - - return findZone(node->getParent()); - } - - // Turn on all lights that are children (directly or indirectly) of the - // specified scene node. - void turnOnZoneLights(scene::ISceneNode * node) - { - core::list const & children = node->getChildren(); - for (core::list::ConstIterator child = children.begin(); - child != children.end(); ++child) - { - if ((*child)->getType() == scene::ESNT_LIGHT) - (*child)->setVisible(true); - else // Assume that lights don't have any children that are also lights - turnOnZoneLights(*child); - } - } - - - // A utility class to aid in sorting scene nodes into a distance order - class LightDistanceElement - { - public: - LightDistanceElement() {}; - - LightDistanceElement(scene::ISceneNode* n, f64 d) - : node(n), distance(d) { } - - scene::ISceneNode* node; - f64 distance; - - // Lower distance elements are sorted to the start of the array - bool operator < (const LightDistanceElement& other) const - { - return (distance < other.distance); - } - }; -}; - - -/* -*/ -int main(int argumentCount, char * argumentValues[]) -{ - // ask user for driver - video::E_DRIVER_TYPE driverType=driverChoiceConsole(); - if (driverType==video::EDT_COUNT) - return 1; - - IrrlichtDevice *device = createDevice(driverType, - dimension2d(640, 480), 32); - - if(!device) - return -1; - - f32 const lightRadius = 60.f; // Enough to reach the far side of each 'zone' - - video::IVideoDriver* driver = device->getVideoDriver(); - scene::ISceneManager* smgr = device->getSceneManager(); - gui::IGUIEnvironment* guienv = device->getGUIEnvironment(); - - const io::path mediaPath = getExampleMediaPath(); - - gui::IGUISkin* skin = guienv->getSkin(); - if (skin) - { - skin->setColor(gui::EGDC_BUTTON_TEXT, video::SColor(255, 255, 255, 255)); - gui::IGUIFont* font = guienv->getFont(mediaPath + "fontlucida.png"); - if(font) - skin->setFont(font); - } - - guienv->addStaticText(L"1 - No light management", core::rect(10,10,200,30)); - guienv->addStaticText(L"2 - Closest 3 lights", core::rect(10,30,200,50)); - guienv->addStaticText(L"3 - Lights in zone", core::rect(10,50,200,70)); - -/* -Add several "zones". You could use this technique to light individual rooms, for example. -*/ - for(f32 zoneX = -100.f; zoneX <= 100.f; zoneX += 50.f) - for(f32 zoneY = -60.f; zoneY <= 60.f; zoneY += 60.f) - { - // Start with an empty scene node, which we will use to represent a zone. - scene::ISceneNode * zoneRoot = smgr->addEmptySceneNode(); - zoneRoot->setPosition(vector3df(zoneX, zoneY, 0)); - - // Each zone contains a rotating cube - scene::IMeshSceneNode * node = smgr->addCubeSceneNode(15, zoneRoot); - scene::ISceneNodeAnimator * rotation = smgr->createRotationAnimator(vector3df(0.25f, 0.5f, 0.75f)); - node->addAnimator(rotation); - rotation->drop(); - - // And each cube has three lights attached to it. The lights are attached to billboards so - // that we can see where they are. The billboards are attached to the cube, so that the - // lights are indirect descendents of the same empty scene node as the cube. - scene::IBillboardSceneNode * billboard = smgr->addBillboardSceneNode(node); - billboard->setPosition(vector3df(0, -14, 30)); - billboard->setMaterialType(video::EMT_TRANSPARENT_ADD_COLOR ); - billboard->setMaterialTexture(0, driver->getTexture(mediaPath + "particle.bmp")); - billboard->setMaterialFlag(video::EMF_LIGHTING, false); - smgr->addLightSceneNode(billboard, vector3df(0, 0, 0), video::SColorf(1, 0, 0), lightRadius); - - billboard = smgr->addBillboardSceneNode(node); - billboard->setPosition(vector3df(-21, -14, -21)); - billboard->setMaterialType(video::EMT_TRANSPARENT_ADD_COLOR ); - billboard->setMaterialTexture(0, driver->getTexture(mediaPath + "particle.bmp")); - billboard->setMaterialFlag(video::EMF_LIGHTING, false); - smgr->addLightSceneNode(billboard, vector3df(0, 0, 0), video::SColorf(0, 1, 0), lightRadius); - - billboard = smgr->addBillboardSceneNode(node); - billboard->setPosition(vector3df(21, -14, -21)); - billboard->setMaterialType(video::EMT_TRANSPARENT_ADD_COLOR ); - billboard->setMaterialTexture(0, driver->getTexture(mediaPath + "particle.bmp")); - billboard->setMaterialFlag(video::EMF_LIGHTING, false); - smgr->addLightSceneNode(billboard, vector3df(0, 0, 0), video::SColorf(0, 0, 1), lightRadius); - - // Each cube also has a smaller cube rotating around it, to show that the cubes are being - // lit by the lights in their 'zone', not just lights that are their direct children. - node = smgr->addCubeSceneNode(5, node); - node->setPosition(vector3df(0, 21, 0)); - } - - smgr->addCameraSceneNode(0, vector3df(0,0,-130), vector3df(0,0,0)); - - CMyLightManager * myLightManager = new CMyLightManager(smgr); - smgr->setLightManager(0); // This is the default: we won't do light management until told to do it. - device->setEventReceiver(myLightManager); - - int lastFps = -1; - - while(device->run()) - { - driver->beginScene(video::ECBF_COLOR | video::ECBF_DEPTH, video::SColor(255,100,101,140)); - smgr->drawAll(); - guienv->drawAll(); - driver->endScene(); - - int fps = driver->getFPS(); - if(fps != lastFps) - { - lastFps = fps; - core::stringw str = L"Managed Lights ["; - str += driver->getName(); - str += "] FPS:"; - str += fps; - device->setWindowCaption(str.c_str()); - } - } - - myLightManager->drop(); // Drop my implicit reference - device->drop(); - return 0; -} - -/* -**/ - diff --git a/examples/21.Quake3Explorer/Makefile b/examples/21.Quake3Explorer/Makefile deleted file mode 100644 index 9b33360a..00000000 --- a/examples/21.Quake3Explorer/Makefile +++ /dev/null @@ -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 := 21.Quake3Explorer -# List of source files, separated by spaces -Sources := main.cpp sound.cpp q3factory.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 diff --git a/examples/21.Quake3Explorer/Quake3Explorer.cbp b/examples/21.Quake3Explorer/Quake3Explorer.cbp deleted file mode 100644 index d32ac6f7..00000000 --- a/examples/21.Quake3Explorer/Quake3Explorer.cbp +++ /dev/null @@ -1,78 +0,0 @@ - - - - - - diff --git a/examples/21.Quake3Explorer/Quake3Explorer.vcproj b/examples/21.Quake3Explorer/Quake3Explorer.vcproj deleted file mode 100644 index b869cc4c..00000000 --- a/examples/21.Quake3Explorer/Quake3Explorer.vcproj +++ /dev/null @@ -1,132 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/examples/21.Quake3Explorer/Quake3Explorer.xcodeproj/project.pbxproj b/examples/21.Quake3Explorer/Quake3Explorer.xcodeproj/project.pbxproj deleted file mode 100644 index ea3f8bdb..00000000 --- a/examples/21.Quake3Explorer/Quake3Explorer.xcodeproj/project.pbxproj +++ /dev/null @@ -1,336 +0,0 @@ -// !$*UTF8*$! -{ - archiveVersion = 1; - classes = { - }; - objectVersion = 46; - objects = { - -/* Begin PBXBuildFile section */ - 5E34CC751B7F8EEF00F212E8 /* main.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5E34CC741B7F8EEF00F212E8 /* main.cpp */; }; - 5E3A0F831C1108A100545D10 /* q3factory.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5E3A0F7F1C1108A100545D10 /* q3factory.cpp */; }; - 5E3A0F841C1108A100545D10 /* sound.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5E3A0F811C1108A100545D10 /* sound.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 /* 21.Quake3Explorer.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = 21.Quake3Explorer.app; sourceTree = BUILT_PRODUCTS_DIR; }; - 5E34CC741B7F8EEF00F212E8 /* main.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = main.cpp; sourceTree = ""; }; - 5E34CC781B7F90A000F212E8 /* libIrrlicht.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libIrrlicht.a; path = ../../lib/OSX/libIrrlicht.a; sourceTree = ""; }; - 5E3A0F7F1C1108A100545D10 /* q3factory.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = q3factory.cpp; sourceTree = ""; }; - 5E3A0F801C1108A100545D10 /* q3factory.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = q3factory.h; sourceTree = ""; }; - 5E3A0F811C1108A100545D10 /* sound.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = sound.cpp; sourceTree = ""; }; - 5E3A0F821C1108A100545D10 /* sound.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = sound.h; sourceTree = ""; }; - 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 = ""; }; -/* 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 */, - 5E3A0F7F1C1108A100545D10 /* q3factory.cpp */, - 5E3A0F801C1108A100545D10 /* q3factory.h */, - 5E3A0F811C1108A100545D10 /* sound.cpp */, - 5E3A0F821C1108A100545D10 /* sound.h */, - 5E34CC761B7F905600F212E8 /* Libraries */, - 5E34CC521B7F8E6E00F212E8 /* Products */, - 5E34CC771B7F906D00F212E8 /* Resources */, - ); - sourceTree = ""; - }; - 5E34CC521B7F8E6E00F212E8 /* Products */ = { - isa = PBXGroup; - children = ( - 5E34CC511B7F8E6E00F212E8 /* 21.Quake3Explorer.app */, - ); - name = Products; - sourceTree = ""; - }; - 5E34CC761B7F905600F212E8 /* Libraries */ = { - isa = PBXGroup; - children = ( - 5E8570B01B7F99F500B267D2 /* Cocoa.framework */, - 5E8570B41B7F9A0700B267D2 /* IOKit.framework */, - 5E8570B21B7F99FE00B267D2 /* OpenGL.framework */, - 5E34CC781B7F90A000F212E8 /* libIrrlicht.a */, - ); - name = Libraries; - sourceTree = ""; - }; - 5E34CC771B7F906D00F212E8 /* Resources */ = { - isa = PBXGroup; - children = ( - 5E8570BE1B7F9D3A00B267D2 /* media */, - ); - name = Resources; - sourceTree = ""; - }; -/* End PBXGroup section */ - -/* Begin PBXNativeTarget section */ - 5E34CC501B7F8E6E00F212E8 /* 21.Quake3Explorer */ = { - isa = PBXNativeTarget; - buildConfigurationList = 5E34CC701B7F8E6E00F212E8 /* Build configuration list for PBXNativeTarget "21.Quake3Explorer" */; - buildPhases = ( - 5E34CC4D1B7F8E6E00F212E8 /* Sources */, - 5E34CC4E1B7F8E6E00F212E8 /* Frameworks */, - 5E34CC4F1B7F8E6E00F212E8 /* Resources */, - ); - buildRules = ( - ); - dependencies = ( - ); - name = 21.Quake3Explorer; - productName = 01.HelloWorld; - productReference = 5E34CC511B7F8E6E00F212E8 /* 21.Quake3Explorer.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 "Quake3Explorer" */; - compatibilityVersion = "Xcode 3.2"; - developmentRegion = English; - hasScannedForEncodings = 0; - knownRegions = ( - en, - Base, - ); - mainGroup = 5E34C6D81B7F4A0C00F212E8; - productRefGroup = 5E34CC521B7F8E6E00F212E8 /* Products */; - projectDirPath = ""; - projectRoot = ""; - targets = ( - 5E34CC501B7F8E6E00F212E8 /* 21.Quake3Explorer */, - ); - }; -/* 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 = ( - 5E3A0F831C1108A100545D10 /* q3factory.cpp in Sources */, - 5E3A0F841C1108A100545D10 /* sound.cpp in Sources */, - 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 "Quake3Explorer" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 5E34C6DD1B7F4A0C00F212E8 /* Debug */, - 5E34C6DE1B7F4A0C00F212E8 /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - 5E34CC701B7F8E6E00F212E8 /* Build configuration list for PBXNativeTarget "21.Quake3Explorer" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 5E34CC6C1B7F8E6E00F212E8 /* Debug */, - 5E34CC6D1B7F8E6E00F212E8 /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; -/* End XCConfigurationList section */ - }; - rootObject = 5E34C6D91B7F4A0C00F212E8 /* Project object */; -} diff --git a/examples/21.Quake3Explorer/Quake3Explorer.xcodeproj/xcshareddata/xcschemes/21.Quake3Explorer.xcscheme b/examples/21.Quake3Explorer/Quake3Explorer.xcodeproj/xcshareddata/xcschemes/21.Quake3Explorer.xcscheme deleted file mode 100644 index 4dfc785a..00000000 --- a/examples/21.Quake3Explorer/Quake3Explorer.xcodeproj/xcshareddata/xcschemes/21.Quake3Explorer.xcscheme +++ /dev/null @@ -1,91 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/examples/21.Quake3Explorer/Quake3Explorer_vc10.vcxproj b/examples/21.Quake3Explorer/Quake3Explorer_vc10.vcxproj deleted file mode 100644 index 1a50c74b..00000000 --- a/examples/21.Quake3Explorer/Quake3Explorer_vc10.vcxproj +++ /dev/null @@ -1,199 +0,0 @@ - - - - - Debug - Win32 - - - Debug - x64 - - - Release - Win32 - - - Release - x64 - - - - 21.Quake3Explorer - {CDC4AAA9-72E1-4FFA-A04D-7EF59D8B97CD} - 21.Quake3Explorer - Win32Proj - - - - Application - MultiByte - Windows7.1SDK - - - Application - MultiByte - Windows7.1SDK - - - Application - MultiByte - Windows7.1SDK - - - Application - MultiByte - Windows7.1SDK - - - - - - - - - - - - - - - - - - - - - - - <_ProjectFileVersion>10.0.30319.1 - ..\..\bin\Win32-VisualStudio\ - ..\..\bin\Win64-VisualStudio\ - true - true - ..\..\bin\Win32-VisualStudio\ - ..\..\bin\Win64-VisualStudio\ - false - false - AllRules.ruleset - AllRules.ruleset - - - - - AllRules.ruleset - AllRules.ruleset - - - - - - - - Disabled - ..\..\include;%(AdditionalIncludeDirectories) - WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions) - true - EnableFastChecks - MultiThreadedDebug - - - Level3 - EditAndContinue - - - ..\..\bin\Win32-VisualStudio\21.Quake3Explorer.exe - ..\..\lib\Win32-visualstudio;%(AdditionalLibraryDirectories) - true - Console - - - - - - - Disabled - ..\..\include;%(AdditionalIncludeDirectories) - WIN32;WIN64;_DEBUG;_WINDOWS;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebug - - - Level3 - ProgramDatabase - - - ..\..\bin\Win64-VisualStudio\21.Quake3Explorer.exe - ..\..\lib\Win64-visualstudio;%(AdditionalLibraryDirectories) - true - $(OutDir)Quake3MapShader.pdb - Console - - - - - - - true - Speed - ..\..\include;%(AdditionalIncludeDirectories) - WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions) - MultiThreaded - false - - - Level3 - - - FastCall - - - ..\..\bin\Win32-VisualStudio\21.Quake3Explorer.exe - ..\..\lib\Win32-visualstudio;%(AdditionalLibraryDirectories) - false - Console - true - true - - - - - - - true - Speed - ..\..\include;%(AdditionalIncludeDirectories) - WIN32;WIN64;NDEBUG;_WINDOWS;%(PreprocessorDefinitions) - MultiThreaded - false - - - Level3 - - - Cdecl - - - ..\..\bin\Win64-VisualStudio\21.Quake3Explorer.exe - ..\..\lib\Win64-visualstudio;%(AdditionalLibraryDirectories) - false - Console - true - true - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/examples/21.Quake3Explorer/Quake3Explorer_vc11.vcxproj b/examples/21.Quake3Explorer/Quake3Explorer_vc11.vcxproj deleted file mode 100644 index a2f2ff63..00000000 --- a/examples/21.Quake3Explorer/Quake3Explorer_vc11.vcxproj +++ /dev/null @@ -1,200 +0,0 @@ - - - - - Debug - Win32 - - - Debug - x64 - - - Release - Win32 - - - Release - x64 - - - - 21.Quake3Explorer - {CDC4AAA9-72E1-4FFA-A04D-7EF59D8B97CD} - 21.Quake3Explorer - Win32Proj - - - - Application - MultiByte - Windows7.1SDK - - - Application - MultiByte - Windows7.1SDK - - - Application - MultiByte - Windows7.1SDK - - - Application - MultiByte - Windows7.1SDK - - - - - - - - - - - - - - - - - - - - - - - <_ProjectFileVersion>10.0.30319.1 - ..\..\bin\Win32-VisualStudio\ - ..\..\bin\Win64-VisualStudio\ - true - true - ..\..\bin\Win32-VisualStudio\ - ..\..\bin\Win64-VisualStudio\ - false - false - AllRules.ruleset - AllRules.ruleset - - - - - AllRules.ruleset - AllRules.ruleset - - - - - - - - Disabled - ..\..\include;%(AdditionalIncludeDirectories) - WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions) - true - EnableFastChecks - MultiThreadedDebug - - - Level3 - EditAndContinue - - - ..\..\bin\Win32-VisualStudio\21.Quake3Explorer.exe - ..\..\lib\Win32-visualstudio;%(AdditionalLibraryDirectories) - true - $(OutDir)Quake3MapShader.pdb - Console - - - - - - - Disabled - ..\..\include;%(AdditionalIncludeDirectories) - WIN32;WIN64;_DEBUG;_WINDOWS;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebug - - - Level3 - ProgramDatabase - - - ..\..\bin\Win64-VisualStudio\21.Quake3Explorer.exe - ..\..\lib\Win64-visualstudio;%(AdditionalLibraryDirectories) - true - $(OutDir)Quake3MapShader.pdb - Console - - - - - - - true - Speed - ..\..\include;%(AdditionalIncludeDirectories) - WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions) - MultiThreaded - false - - - Level3 - - - Cdecl - - - ..\..\bin\Win32-VisualStudio\21.Quake3Explorer.exe - ..\..\lib\Win32-visualstudio;%(AdditionalLibraryDirectories) - false - Console - true - true - - - - - - - true - Speed - ..\..\include;%(AdditionalIncludeDirectories) - WIN32;WIN64;NDEBUG;_WINDOWS;%(PreprocessorDefinitions) - MultiThreaded - false - - - Level3 - - - FastCall - - - ..\..\bin\Win64-VisualStudio\21.Quake3Explorer.exe - ..\..\lib\Win64-visualstudio;%(AdditionalLibraryDirectories) - false - Console - true - true - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/examples/21.Quake3Explorer/Quake3Explorer_vc12.vcxproj b/examples/21.Quake3Explorer/Quake3Explorer_vc12.vcxproj deleted file mode 100644 index f84bfc04..00000000 --- a/examples/21.Quake3Explorer/Quake3Explorer_vc12.vcxproj +++ /dev/null @@ -1,200 +0,0 @@ - - - - - Debug - Win32 - - - Debug - x64 - - - Release - Win32 - - - Release - x64 - - - - 21.Quake3Explorer - {CDC4AAA9-72E1-4FFA-A04D-7EF59D8B97CD} - 21.Quake3Explorer - Win32Proj - - - - Application - MultiByte - Windows7.1SDK - - - Application - MultiByte - Windows7.1SDK - - - Application - MultiByte - Windows7.1SDK - - - Application - MultiByte - Windows7.1SDK - - - - - - - - - - - - - - - - - - - - - - - <_ProjectFileVersion>10.0.30319.1 - ..\..\bin\Win32-VisualStudio\ - ..\..\bin\Win64-VisualStudio\ - true - true - ..\..\bin\Win32-VisualStudio\ - ..\..\bin\Win64-VisualStudio\ - false - false - AllRules.ruleset - AllRules.ruleset - - - - - AllRules.ruleset - AllRules.ruleset - - - - - - - - Disabled - ..\..\include;%(AdditionalIncludeDirectories) - WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions) - true - EnableFastChecks - MultiThreadedDebug - - - Level3 - EditAndContinue - - - ..\..\bin\Win32-VisualStudio\21.Quake3Explorer.exe - ..\..\lib\Win32-visualstudio;%(AdditionalLibraryDirectories) - true - $(OutDir)Quake3MapShader.pdb - Console - - - - - - - Disabled - ..\..\include;%(AdditionalIncludeDirectories) - WIN32;WIN64;_DEBUG;_WINDOWS;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebug - - - Level3 - ProgramDatabase - - - ..\..\bin\Win64-VisualStudio\21.Quake3Explorer.exe - ..\..\lib\Win64-visualstudio;%(AdditionalLibraryDirectories) - true - $(OutDir)Quake3MapShader.pdb - Console - - - - - - - true - Speed - ..\..\include;%(AdditionalIncludeDirectories) - WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions) - MultiThreaded - false - - - Level3 - - - FastCall - - - ..\..\bin\Win32-VisualStudio\21.Quake3Explorer.exe - ..\..\lib\Win32-visualstudio;%(AdditionalLibraryDirectories) - false - Console - true - true - - - - - - - true - Speed - ..\..\include;%(AdditionalIncludeDirectories) - WIN32;WIN64;NDEBUG;_WINDOWS;%(PreprocessorDefinitions) - MultiThreaded - false - - - Level3 - - - Cdecl - - - ..\..\bin\Win64-VisualStudio\21.Quake3Explorer.exe - ..\..\lib\Win64-visualstudio;%(AdditionalLibraryDirectories) - false - Console - true - true - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/examples/21.Quake3Explorer/Quake3Explorer_vc14.vcxproj b/examples/21.Quake3Explorer/Quake3Explorer_vc14.vcxproj deleted file mode 100644 index eadcfea5..00000000 --- a/examples/21.Quake3Explorer/Quake3Explorer_vc14.vcxproj +++ /dev/null @@ -1,200 +0,0 @@ - - - - - Debug - Win32 - - - Debug - x64 - - - Release - Win32 - - - Release - x64 - - - - 21.Quake3Explorer - {CDC4AAA9-72E1-4FFA-A04D-7EF59D8B97CD} - 21.Quake3Explorer - Win32Proj - - - - Application - MultiByte - v140 - - - Application - MultiByte - v140 - - - Application - MultiByte - v140 - - - Application - MultiByte - v140 - - - - - - - - - - - - - - - - - - - - - - - <_ProjectFileVersion>10.0.30319.1 - ..\..\bin\Win32-VisualStudio\ - ..\..\bin\Win64-VisualStudio\ - true - true - ..\..\bin\Win32-VisualStudio\ - ..\..\bin\Win64-VisualStudio\ - false - false - AllRules.ruleset - AllRules.ruleset - - - - - AllRules.ruleset - AllRules.ruleset - - - - - - - - Disabled - ..\..\include;%(AdditionalIncludeDirectories) - WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions) - true - EnableFastChecks - MultiThreadedDebug - - - Level3 - EditAndContinue - - - ..\..\bin\Win32-VisualStudio\21.Quake3Explorer.exe - ..\..\lib\Win32-visualstudio;%(AdditionalLibraryDirectories) - true - $(OutDir)Quake3MapShader.pdb - Console - - - - - - - Disabled - ..\..\include;%(AdditionalIncludeDirectories) - WIN32;WIN64;_DEBUG;_WINDOWS;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebug - - - Level3 - ProgramDatabase - - - ..\..\bin\Win64-VisualStudio\21.Quake3Explorer.exe - ..\..\lib\Win64-visualstudio;%(AdditionalLibraryDirectories) - true - $(OutDir)Quake3MapShader.pdb - Console - - - - - - - true - Speed - ..\..\include;%(AdditionalIncludeDirectories) - WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions) - MultiThreaded - false - - - Level3 - - - FastCall - - - ..\..\bin\Win32-VisualStudio\21.Quake3Explorer.exe - ..\..\lib\Win32-visualstudio;%(AdditionalLibraryDirectories) - false - Console - true - true - - - - - - - true - Speed - ..\..\include;%(AdditionalIncludeDirectories) - WIN32;WIN64;NDEBUG;_WINDOWS;%(PreprocessorDefinitions) - MultiThreaded - false - - - Level3 - - - FastCall - - - ..\..\bin\Win64-VisualStudio\21.Quake3Explorer.exe - ..\..\lib\Win64-visualstudio;%(AdditionalLibraryDirectories) - false - Console - true - true - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/examples/21.Quake3Explorer/main.cpp b/examples/21.Quake3Explorer/main.cpp deleted file mode 100644 index 7b14c92f..00000000 --- a/examples/21.Quake3Explorer/main.cpp +++ /dev/null @@ -1,2189 +0,0 @@ -/** Example 021 Quake3 Explorer - -This tutorial shows how to load different Quake 3 maps. - -Features: - - Load BSP Archives at Runtime from the menu - - Load a Map from the menu. Showing with Screenshot - - Set the VideoDriver at runtime from menu - - Adjust GammaLevel at runtime - - Create SceneNodes for the Shaders - - Load EntityList and create Entity SceneNodes - - Create Players with Weapons and with Collision Response - - Play music - -You can download the Quake III Arena demo ( copyright id software ) -at the following location: -ftp://ftp.idsoftware.com/idstuff/quake3/win32/q3ademo.exe - -Copyright 2006-2011 Burningwater, Thomas Alten -*/ - -#include -#include "driverChoice.h" -#include "exampleHelper.h" -#include "q3factory.h" -#include "sound.h" - -/* - Game Data is used to hold Data which is needed to drive the game -*/ -struct GameData -{ - GameData ( const path &startupDir) : - retVal(0), StartupDir(startupDir), createExDevice(0), Device(0) - { - setDefault (); - } - - void setDefault (); - s32 save ( const path &filename ); - s32 load ( const path &filename ); - - s32 debugState; - s32 gravityState; - s32 flyTroughState; - s32 wireFrame; - s32 guiActive; - s32 guiInputActive; - f32 GammaValue; - s32 retVal; - s32 sound; - - path StartupDir; - stringw CurrentMapName; - array CurrentArchiveList; - - vector3df PlayerPosition; - vector3df PlayerRotation; - - tQ3EntityList Variable; - - Q3LevelLoadParameter loadParam; - SIrrlichtCreationParameters deviceParam; - funcptr_createDeviceEx createExDevice; - IrrlichtDevice *Device; -}; - -/* - set default settings -*/ -void GameData::setDefault () -{ - debugState = EDS_OFF; - gravityState = 1; - flyTroughState = 0; - wireFrame = 0; - guiActive = 1; - guiInputActive = 0; - GammaValue = 1.f; - - // default deviceParam; -#if defined ( _IRR_WINDOWS_ ) - deviceParam.DriverType = EDT_DIRECT3D9; -#else - deviceParam.DriverType = EDT_OGLES2; // TODO: have to figure out what to use when we merge ogl-es with trunk. -#endif - deviceParam.WindowSize.Width = 800; - deviceParam.WindowSize.Height = 600; - deviceParam.Fullscreen = false; - deviceParam.Bits = 24; - deviceParam.ZBufferBits = 16; - deviceParam.Vsync = false; - deviceParam.AntiAlias = false; - - // default Quake3 loadParam - loadParam.defaultLightMapMaterial = EMT_LIGHTMAP; - loadParam.defaultModulate = EMFN_MODULATE_1X; - loadParam.defaultFilter = EMF_ANISOTROPIC_FILTER; - loadParam.verbose = 2; - loadParam.mergeShaderBuffer = 1; // merge meshbuffers with same material - loadParam.cleanUnResolvedMeshes = 1; // should unresolved meshes be cleaned. otherwise blue texture - loadParam.loadAllShaders = 1; // load all scripts in the script directory - loadParam.loadSkyShader = 0; // load sky Shader - loadParam.alpharef = 1; - - sound = 0; - - CurrentMapName = ""; - CurrentArchiveList.clear (); - - const io::path mediaPath = getExampleMediaPath(); - - // Explorer Media directory - CurrentArchiveList.push_back ( StartupDir + mediaPath ); - - // Add the original quake3 files before you load your custom map - // Most mods are using the original shaders, models&items&weapons - CurrentArchiveList.push_back("/q/baseq3/"); - - CurrentArchiveList.push_back(StartupDir + mediaPath + "map-20kdm2.pk3"); -} - -/* - Load the current game State from a typical quake3 cfg file -*/ -s32 GameData::load ( const path &filename ) -{ - if (!Device) - return 0; - - // the quake3 mesh loader can also handle *.shader and *.cfg file - IQ3LevelMesh* mesh = (IQ3LevelMesh*) Device->getSceneManager()->getMesh ( filename ); - if (!mesh) - return 0; - - tQ3EntityList &entityList = mesh->getEntityList (); - - stringc s; - u32 pos; - - for ( u32 e = 0; e != entityList.size (); ++e ) - { - //dumpShader ( s, &entityList[e], false ); - //printf ( s.c_str () ); - - for ( u32 g = 0; g != entityList[e].getGroupSize (); ++g ) - { - const SVarGroup *group = entityList[e].getGroup ( g ); - - for ( u32 index = 0; index < group->Variable.size (); ++index ) - { - const SVariable &v = group->Variable[index]; - pos = 0; - if ( v.name == "playerposition" ) - { - PlayerPosition = getAsVector3df ( v.content, pos ); - } - else - if ( v.name == "playerrotation" ) - { - PlayerRotation = getAsVector3df ( v.content, pos ); - } - } - } - } - - return 1; -} - -/* - Store the current game State in a quake3 configuration file -*/ -s32 GameData::save ( const path &filename ) -{ - return 0; - if (!Device) - return 0; - - c8 buf[128]; - u32 i; - - // Store current Archive for restart - CurrentArchiveList.clear(); - IFileSystem *fs = Device->getFileSystem(); - for ( i = 0; i != fs->getFileArchiveCount(); ++i ) - { - CurrentArchiveList.push_back ( fs->getFileArchive(i)->getFileList()->getPath() ); - } - - // Store Player Position and Rotation - ICameraSceneNode * camera = Device->getSceneManager()->getActiveCamera (); - if ( camera ) - { - PlayerPosition = camera->getPosition (); - PlayerRotation = camera->getRotation (); - } - - IWriteFile *file = fs->createAndWriteFile ( filename ); - if (!file) - return 0; - - snprintf_irr ( buf, 128, "playerposition %.f %.f %.f\nplayerrotation %.f %.f %.f\n", - PlayerPosition.X, PlayerPosition.Z, PlayerPosition.Y, - PlayerRotation.X, PlayerRotation.Z, PlayerRotation.Y); - file->write ( buf, (s32) strlen ( buf ) ); - for ( i = 0; i != fs->getFileArchiveCount(); ++i ) - { - snprintf_irr ( buf, 128, "archive %s\n",stringc ( fs->getFileArchive(i)->getFileList()->getPath() ).c_str () ); - file->write ( buf, (s32) strlen ( buf ) ); - } - - file->drop (); - return 1; -} - -/* - Representing a player -*/ -struct Q3Player : public IAnimationEndCallBack -{ - Q3Player () - : Device(0), MapParent(0), Mesh(0), WeaponNode(0), StartPositionCurrent(0) - { - animation[0] = 0; - memset(Anim, 0, sizeof(TimeFire)*4); - } - - virtual void OnAnimationEnd(IAnimatedMeshSceneNode* node); - - void create ( IrrlichtDevice *device, - IQ3LevelMesh* mesh, - ISceneNode *mapNode, - IMetaTriangleSelector *meta - ); - void shutdown (); - void setAnim ( const c8 *name ); - void respawn (); - void setpos ( const vector3df &pos, const vector3df& rotation ); - - ISceneNodeAnimatorCollisionResponse * cam() { return camCollisionResponse ( Device ); } - - IrrlichtDevice *Device; - ISceneNode* MapParent; - IQ3LevelMesh* Mesh; - IAnimatedMeshSceneNode* WeaponNode; - s32 StartPositionCurrent; - TimeFire Anim[4]; - c8 animation[64]; - c8 buf[64]; -}; - - -/* End player -*/ -void Q3Player::shutdown () -{ - setAnim ( 0 ); - - dropElement (WeaponNode); - - if ( Device ) - { - ICameraSceneNode* camera = Device->getSceneManager()->getActiveCamera(); - dropElement ( camera ); - Device = 0; - } - - MapParent = 0; - Mesh = 0; -} - - -/* create a new player -*/ -void Q3Player::create ( IrrlichtDevice *device, IQ3LevelMesh* mesh, ISceneNode *mapNode, IMetaTriangleSelector *meta ) -{ - setTimeFire ( Anim + 0, 200, FIRED ); - setTimeFire ( Anim + 1, 5000 ); - - if (!device) - return; - // load FPS weapon to Camera - Device = device; - Mesh = mesh; - MapParent = mapNode; - - ISceneManager *smgr = device->getSceneManager (); - IVideoDriver * driver = device->getVideoDriver(); - - ICameraSceneNode* camera = 0; - - core::array keyMap; - keyMap.set_used(12); - keyMap[0].Action = EKA_MOVE_FORWARD; - keyMap[0].KeyCode = KEY_UP; - keyMap[1].Action = EKA_MOVE_FORWARD; - keyMap[1].KeyCode = KEY_KEY_W; - - keyMap[2].Action = EKA_MOVE_BACKWARD; - keyMap[2].KeyCode = KEY_DOWN; - keyMap[3].Action = EKA_MOVE_BACKWARD; - keyMap[3].KeyCode = KEY_KEY_S; - - keyMap[4].Action = EKA_STRAFE_LEFT; - keyMap[4].KeyCode = KEY_LEFT; - keyMap[5].Action = EKA_STRAFE_LEFT; - keyMap[5].KeyCode = KEY_KEY_A; - - keyMap[6].Action = EKA_STRAFE_RIGHT; - keyMap[6].KeyCode = KEY_RIGHT; - keyMap[7].Action = EKA_STRAFE_RIGHT; - keyMap[7].KeyCode = KEY_KEY_D; - - keyMap[8].Action = EKA_JUMP_UP; - keyMap[8].KeyCode = KEY_KEY_J; - - keyMap[9].Action = EKA_CROUCH; - keyMap[9].KeyCode = KEY_KEY_C; - - keyMap[10].Action = EKA_ROTATE_LEFT; - keyMap[10].KeyCode = KEY_KEY_Q; - - keyMap[11].Action = EKA_ROTATE_RIGHT; - keyMap[11].KeyCode = KEY_KEY_E; - - camera = smgr->addCameraSceneNodeFPS(0, 100.0f, 0.6f, -1, keyMap.pointer(), keyMap.size(), false, 600.f); - camera->setName ( "First Person Camera" ); - //camera->setFOV ( 100.f * core::DEGTORAD ); - camera->setFarValue( 20000.f ); - - IAnimatedMeshMD2* weaponMesh = (IAnimatedMeshMD2*) smgr->getMesh("gun.md2"); - if ( 0 == weaponMesh ) - return; - - if ( weaponMesh->getMeshType() == EAMT_MD2 ) - { - s32 count = weaponMesh->getAnimationCount(); - for ( s32 i = 0; i != count; ++i ) - { - snprintf_irr ( buf, 64, "Animation: %s", weaponMesh->getAnimationName(i) ); - device->getLogger()->log(buf, ELL_INFORMATION); - } - } - - WeaponNode = smgr->addAnimatedMeshSceneNode( - weaponMesh, - smgr->getActiveCamera(), - 10, - vector3df( 0, 0, 0), - vector3df(-90,-90,90) - ); - WeaponNode->setMaterialFlag(EMF_LIGHTING, false); - WeaponNode->setMaterialTexture(0, driver->getTexture( "gun.jpg")); - WeaponNode->setLoopMode ( false ); - WeaponNode->setName ( "tommi the gun man" ); - - //create a collision auto response animator - ISceneNodeAnimator* anim = - smgr->createCollisionResponseAnimator( meta, camera, - vector3df(30,45,30), - getGravity ( "earth" ), - vector3df(0,40,0), - 0.0005f - ); - - camera->addAnimator( anim ); - anim->drop(); - - if ( meta ) - { - meta->drop (); - } - - respawn (); - setAnim ( "idle" ); -} - - -/* - so we need a good starting Position in the level. - we can ask the Quake3 Loader for all entities with class_name "info_player_deathmatch" -*/ -void Q3Player::respawn () -{ - if (!Device) - return; - ICameraSceneNode* camera = Device->getSceneManager()->getActiveCamera(); - - Device->getLogger()->log( "respawn" ); - - if (StartPositionCurrent >= Q3StartPosition(Mesh, camera, - StartPositionCurrent, cam()->getEllipsoidTranslation())) - StartPositionCurrent = 0; - else - ++StartPositionCurrent; -} - -/* - set Player position from saved coordinates -*/ -void Q3Player::setpos ( const vector3df &pos, const vector3df &rotation ) -{ - if (!Device) - return; - Device->getLogger()->log( "setpos" ); - - ICameraSceneNode* camera = Device->getSceneManager()->getActiveCamera(); - if ( camera ) - { - camera->setPosition ( pos ); - camera->setRotation ( rotation ); - //! New. FPSCamera and animators catches reset on animate 0 - camera->OnAnimate ( 0 ); - } -} - -/* set the Animation of the player and weapon -*/ -void Q3Player::setAnim ( const c8 *name ) -{ - if ( name ) - { - snprintf_irr ( animation, 64, "%s", name ); - if ( WeaponNode ) - { - WeaponNode->setAnimationEndCallback ( this ); - WeaponNode->setMD2Animation ( animation ); - } - } - else - { - animation[0] = 0; - if ( WeaponNode ) - { - WeaponNode->setAnimationEndCallback ( 0 ); - } - } -} - - -// Callback -void Q3Player::OnAnimationEnd(IAnimatedMeshSceneNode* node) -{ - setAnim ( 0 ); -} - - - -/* GUI Elements -*/ -struct GUI -{ - GUI () - { - memset ( this, 0, sizeof ( *this ) ); - } - - void drop() - { - dropElement ( Window ); - dropElement ( Logo ); - } - - IGUIComboBox* VideoDriver; - IGUIComboBox* VideoMode; - IGUICheckBox* FullScreen; - IGUICheckBox* Bit32; - IGUIScrollBar* MultiSample; - IGUIButton* SetVideoMode; - - IGUIScrollBar* Tesselation; - IGUIScrollBar* Gamma; - IGUICheckBox* Collision; - IGUICheckBox* Visible_Map; - IGUICheckBox* Visible_Shader; - IGUICheckBox* Visible_Fog; - IGUICheckBox* Visible_Unresolved; - IGUICheckBox* Visible_Skydome; - IGUIButton* Respawn; - - IGUITable* ArchiveList; - IGUIButton* ArchiveAdd; - IGUIButton* ArchiveRemove; - IGUIFileOpenDialog* ArchiveFileOpen; - IGUIButton* ArchiveUp; - IGUIButton* ArchiveDown; - - IGUIListBox* MapList; - IGUITreeView* SceneTree; - IGUIStaticText* StatusLine; - IGUIImage* Logo; - IGUIWindow* Window; -}; - - -/* - CQuake3EventHandler controls the game -*/ -class CQuake3EventHandler : public IEventReceiver -{ -public: - - CQuake3EventHandler( GameData *gameData ); - virtual ~CQuake3EventHandler (); - - void Animate(); - void Render(); - - void AddArchive ( const path& archiveName ); - void LoadMap ( const stringw& mapName, s32 collision ); - void CreatePlayers(); - void AddSky( u32 dome, const c8 *texture ); - Q3Player *GetPlayer ( u32 index ) { return &Player[index]; } - - void CreateGUI(); - void SetGUIActive( s32 command); - - bool OnEvent(const SEvent& eve); - - -private: - - GameData *Game; - - IQ3LevelMesh* Mesh; - ISceneNode* MapParent; - ISceneNode* ShaderParent; - ISceneNode* ItemParent; - ISceneNode* UnresolvedParent; - ISceneNode* BulletParent; - ISceneNode* FogParent; - ISceneNode * SkyNode; - IMetaTriangleSelector *Meta; - - c8 buf[256]; - - Q3Player Player[2]; - - struct SParticleImpact - { - u32 when; - vector3df pos; - vector3df outVector; - }; - array Impacts; - void useItem( Q3Player * player); - void createParticleImpacts( u32 now ); - - void createTextures (); - void addSceneTreeItem( ISceneNode * parent, IGUITreeViewNode* nodeParent); - - GUI gui; - void dropMap (); -}; - -/* Constructor -*/ -CQuake3EventHandler::CQuake3EventHandler( GameData *game ) -: Game(game), Mesh(0), MapParent(0), ShaderParent(0), ItemParent(0), UnresolvedParent(0), - BulletParent(0), FogParent(0), SkyNode(0), Meta(0) -{ - buf[0]=0; - // Also use 16 Bit Textures for 16 Bit RenderDevice - if ( Game->deviceParam.Bits == 16 ) - { - game->Device->getVideoDriver()->setTextureCreationFlag(ETCF_ALWAYS_16_BIT, true); - } - - // Quake3 Shader controls Z-Writing - game->Device->getSceneManager()->getParameters()->setAttribute(scene::ALLOW_ZWRITE_ON_TRANSPARENT, true); - - // create internal textures - createTextures (); - - sound_init ( game->Device ); - - Game->Device->setEventReceiver ( this ); -} - - -// destructor -CQuake3EventHandler::~CQuake3EventHandler () -{ - Player[0].shutdown (); - sound_shutdown (); - - Game->save( "explorer.cfg" ); - - Game->Device->drop(); -} - - -// create runtime textures smog, fog -void CQuake3EventHandler::createTextures() -{ - IVideoDriver * driver = Game->Device->getVideoDriver(); - - dimension2du dim(64, 64); - - video::IImage* image; - u32 i; - u32 x; - u32 y; - u32 * data; - for ( i = 0; i != 8; ++i ) - { - image = driver->createImage ( video::ECF_A8R8G8B8, dim); - data = (u32*) image->getData (); - for ( y = 0; y != dim.Height; ++y ) - { - for ( x = 0; x != dim.Width; ++x ) - { - data [x] = 0xFFFFFFFF; - } - data = (u32*) ( (u8*) data + image->getPitch() ); - } - snprintf_irr ( buf, 64, "smoke_%02d", i ); - driver->addTexture( buf, image ); - image->drop (); - } - - // fog - for ( i = 0; i != 1; ++i ) - { - image = driver->createImage ( video::ECF_A8R8G8B8, dim); - data = (u32*) image->getData (); - for ( y = 0; y != dim.Height; ++y ) - { - for ( x = 0; x != dim.Width; ++x ) - { - data [x] = 0xFFFFFFFF; - } - data = (u32*) ( (u8*) data + image->getPitch() ); - } - snprintf_irr ( buf, 64, "fog_%02d", i ); - driver->addTexture( buf, image ); - image->drop (); - } -} - - -/* - create the GUI -*/ -void CQuake3EventHandler::CreateGUI() -{ - - IGUIEnvironment *env = Game->Device->getGUIEnvironment(); - IVideoDriver * driver = Game->Device->getVideoDriver(); - - gui.drop(); - - // set skin font - IGUIFont* font = env->getFont("fontlucida.png"); - if (font) - env->getSkin()->setFont(font); - env->getSkin()->setColor ( EGDC_BUTTON_TEXT, video::SColor(240,0xAA,0xAA,0xAA) ); - env->getSkin()->setColor ( EGDC_3D_HIGH_LIGHT, video::SColor(240,0x22,0x22,0x22) ); - env->getSkin()->setColor ( EGDC_3D_FACE, video::SColor(240,0x44,0x44,0x44) ); - env->getSkin()->setColor ( EGDC_EDITABLE, video::SColor(240,0x44,0x44,0x44) ); - env->getSkin()->setColor ( EGDC_FOCUSED_EDITABLE, video::SColor(240,0x54,0x54,0x54) ); - env->getSkin()->setColor ( EGDC_WINDOW, video::SColor(240,0x66,0x66,0x66) ); - - // minimal gui size 800x600 - dimension2d dim ( 800, 600 ); - dimension2d vdim ( Game->Device->getVideoDriver()->getScreenSize() ); - - if ( vdim.Height >= dim.Height && vdim.Width >= dim.Width ) - { - //dim = vdim; - } - else - { - } - - gui.Window = env->addWindow ( rect ( 0, 0, dim.Width, dim.Height ), false, L"Quake3 Explorer" ); - gui.Window->setToolTipText ( L"Quake3Explorer. Loads and show various BSP File Format and Shaders." ); - gui.Window->getCloseButton()->setToolTipText ( L"Quit Quake3 Explorer" ); - - // add a status line help text - gui.StatusLine = env->addStaticText( 0, rect( 5,dim.Height - 30,dim.Width - 5,dim.Height - 10), - false, false, gui.Window, -1, true - ); - - - env->addStaticText ( L"VideoDriver:", rect( dim.Width - 400, 24, dim.Width - 310, 40 ),false, false, gui.Window, -1, false ); - gui.VideoDriver = env->addComboBox(rect( dim.Width - 300, 24, dim.Width - 10, 40 ),gui.Window); - gui.VideoDriver->addItem(L"Direct3D 9.0c", EDT_DIRECT3D9 ); - gui.VideoDriver->addItem(L"OpenGL 1.5", EDT_OPENGL); - gui.VideoDriver->addItem(L"Software Renderer", EDT_OGLES1); - gui.VideoDriver->addItem(L"Burning's Video (TM) Thomas Alten", EDT_BURNINGSVIDEO); - gui.VideoDriver->setSelected ( gui.VideoDriver->getIndexForItemData ( Game->deviceParam.DriverType ) ); - gui.VideoDriver->setToolTipText ( L"Use a VideoDriver" ); - - env->addStaticText ( L"VideoMode:", rect( dim.Width - 400, 44, dim.Width - 310, 60 ),false, false, gui.Window, -1, false ); - gui.VideoMode = env->addComboBox(rect( dim.Width - 300, 44, dim.Width - 10, 60 ),gui.Window); - gui.VideoMode->setToolTipText ( L"Supported Screenmodes" ); - IVideoModeList *modeList = Game->Device->getVideoModeList(); - if ( modeList ) - { - s32 i; - for ( i = 0; i != modeList->getVideoModeCount (); ++i ) - { - u16 d = modeList->getVideoModeDepth ( i ); - if ( d < 16 ) - continue; - - u16 w = modeList->getVideoModeResolution ( i ).Width; - u16 h = modeList->getVideoModeResolution ( i ).Height; - u32 val = w << 16 | h; - - if ( gui.VideoMode->getIndexForItemData ( val ) >= 0 ) - continue; - - f32 aspect = (f32) w / (f32) h; - const c8 *a = ""; - if ( core::equals ( aspect, 1.3333333333f ) ) a = "4:3"; - else if ( core::equals ( aspect, 1.6666666f ) ) a = "15:9 widescreen"; - else if ( core::equals ( aspect, 1.7777777f ) ) a = "16:9 widescreen"; - else if ( core::equals ( aspect, 1.6f ) ) a = "16:10 widescreen"; - else if ( core::equals ( aspect, 2.133333f ) ) a = "20:9 widescreen"; - - snprintf_irr ( buf, sizeof ( buf ), "%d x %d, %s",w, h, a ); - gui.VideoMode->addItem ( stringw ( buf ).c_str(), val ); - } - } - gui.VideoMode->setSelected ( gui.VideoMode->getIndexForItemData ( - Game->deviceParam.WindowSize.Width << 16 | - Game->deviceParam.WindowSize.Height ) ); - - gui.FullScreen = env->addCheckBox ( Game->deviceParam.Fullscreen, rect( dim.Width - 400, 64, dim.Width - 300, 80 ), gui.Window,-1, L"Fullscreen" ); - gui.FullScreen->setToolTipText ( L"Set Fullscreen or Window Mode" ); - - gui.Bit32 = env->addCheckBox ( Game->deviceParam.Bits == 32, rect( dim.Width - 300, 64, dim.Width - 240, 80 ), gui.Window,-1, L"32Bit" ); - gui.Bit32->setToolTipText ( L"Use 16 or 32 Bit" ); - - env->addStaticText ( L"MultiSample:", rect( dim.Width - 235, 64, dim.Width - 150, 80 ),false, false, gui.Window, -1, false ); - gui.MultiSample = env->addScrollBar( true, rect( dim.Width - 150, 64, dim.Width - 70, 80 ), gui.Window,-1 ); - gui.MultiSample->setMin ( 0 ); - gui.MultiSample->setMax ( 8 ); - gui.MultiSample->setSmallStep ( 1 ); - gui.MultiSample->setLargeStep ( 1 ); - gui.MultiSample->setPos ( Game->deviceParam.AntiAlias ); - gui.MultiSample->setToolTipText ( L"Set the MultiSample (disable, 1x, 2x, 4x, 8x )" ); - - gui.SetVideoMode = env->addButton (rect( dim.Width - 60, 64, dim.Width - 10, 80 ), gui.Window, -1,L"set" ); - gui.SetVideoMode->setToolTipText ( L"Set Video Mode with current values" ); - - env->addStaticText ( L"Gamma:", rect( dim.Width - 400, 104, dim.Width - 310, 120 ),false, false, gui.Window, -1, false ); - gui.Gamma = env->addScrollBar( true, rect( dim.Width - 300, 104, dim.Width - 10, 120 ), gui.Window,-1 ); - gui.Gamma->setMin ( 50 ); - gui.Gamma->setMax ( 350 ); - gui.Gamma->setSmallStep ( 1 ); - gui.Gamma->setLargeStep ( 10 ); - gui.Gamma->setPos ( core::floor32 ( Game->GammaValue * 100.f ) ); - gui.Gamma->setToolTipText ( L"Adjust Gamma Ramp ( 0.5 - 3.5)" ); - Game->Device->setGammaRamp ( Game->GammaValue, Game->GammaValue, Game->GammaValue, 0.f, 0.f ); - - - env->addStaticText ( L"Tesselation:", rect( dim.Width - 400, 124, dim.Width - 310, 140 ),false, false, gui.Window, -1, false ); - gui.Tesselation = env->addScrollBar( true, rect( dim.Width - 300, 124, dim.Width - 10, 140 ), gui.Window,-1 ); - gui.Tesselation->setMin ( 2 ); - gui.Tesselation->setMax ( 12 ); - gui.Tesselation->setSmallStep ( 1 ); - gui.Tesselation->setLargeStep ( 1 ); - gui.Tesselation->setPos ( Game->loadParam.patchTesselation ); - gui.Tesselation->setToolTipText ( L"How smooth should curved surfaces be rendered" ); - - gui.Collision = env->addCheckBox ( true, rect( dim.Width - 400, 150, dim.Width - 300, 166 ), gui.Window,-1, L"Collision" ); - gui.Collision->setToolTipText ( L"Set collision on or off ( flythrough ). \nPress F7 on your Keyboard" ); - gui.Visible_Map = env->addCheckBox ( true, rect( dim.Width - 300, 150, dim.Width - 240, 166 ), gui.Window,-1, L"Map" ); - gui.Visible_Map->setToolTipText ( L"Show or not show the static part the Level. \nPress F3 on your Keyboard" ); - gui.Visible_Shader = env->addCheckBox ( true, rect( dim.Width - 240, 150, dim.Width - 170, 166 ), gui.Window,-1, L"Shader" ); - gui.Visible_Shader->setToolTipText ( L"Show or not show the Shader Nodes. \nPress F4 on your Keyboard" ); - gui.Visible_Fog = env->addCheckBox ( true, rect( dim.Width - 170, 150, dim.Width - 110, 166 ), gui.Window,-1, L"Fog" ); - gui.Visible_Fog->setToolTipText ( L"Show or not show the Fog Nodes. \nPress F5 on your Keyboard" ); - gui.Visible_Unresolved = env->addCheckBox ( true, rect( dim.Width - 110, 150, dim.Width - 10, 166 ), gui.Window,-1, L"Unresolved" ); - gui.Visible_Unresolved->setToolTipText ( L"Show the or not show the Nodes the Engine can't handle. \nPress F6 on your Keyboard" ); - gui.Visible_Skydome = env->addCheckBox ( true, rect( dim.Width - 110, 180, dim.Width - 10, 196 ), gui.Window,-1, L"Skydome" ); - gui.Visible_Skydome->setToolTipText ( L"Show the or not show the Skydome." ); - - //Respawn = env->addButton ( rect( dim.Width - 260, 90, dim.Width - 10, 106 ), 0,-1, L"Respawn" ); - - env->addStaticText ( L"Archives:", rect( 5, dim.Height - 530, dim.Width - 600,dim.Height - 514 ),false, false, gui.Window, -1, false ); - - gui.ArchiveAdd = env->addButton ( rect( dim.Width - 725, dim.Height - 530, dim.Width - 665, dim.Height - 514 ), gui.Window,-1, L"add" ); - gui.ArchiveAdd->setToolTipText ( L"Add an archive, usually packed zip-archives (*.pk3) to the Filesystem" ); - gui.ArchiveRemove = env->addButton ( rect( dim.Width - 660, dim.Height - 530, dim.Width - 600, dim.Height - 514 ), gui.Window,-1, L"del" ); - gui.ArchiveRemove->setToolTipText ( L"Remove the selected archive from the FileSystem." ); - gui.ArchiveUp = env->addButton ( rect( dim.Width - 575, dim.Height - 530, dim.Width - 515, dim.Height - 514 ), gui.Window,-1, L"up" ); - gui.ArchiveUp->setToolTipText ( L"Arrange Archive Look-up Hirachy. Move the selected Archive up" ); - gui.ArchiveDown = env->addButton ( rect( dim.Width - 510, dim.Height - 530, dim.Width - 440, dim.Height - 514 ), gui.Window,-1, L"down" ); - gui.ArchiveDown->setToolTipText ( L"Arrange Archive Look-up Hirachy. Move the selected Archive down" ); - - - gui.ArchiveList = env->addTable ( rect( 5,dim.Height - 510, dim.Width - 450,dim.Height - 410 ), gui.Window ); - gui.ArchiveList->addColumn ( L"Type", 0 ); - gui.ArchiveList->addColumn ( L"Real File Path", 1 ); - gui.ArchiveList->setColumnWidth ( 0, 60 ); - gui.ArchiveList->setColumnWidth ( 1, 284 ); - gui.ArchiveList->setToolTipText ( L"Show the attached Archives" ); - - - env->addStaticText ( L"Maps:", rect( 5, dim.Height - 400, dim.Width - 450,dim.Height - 380 ),false, false, gui.Window, -1, false ); - gui.MapList = env->addListBox ( rect( 5,dim.Height - 380, dim.Width - 450,dim.Height - 40 ), gui.Window, -1, true ); - gui.MapList->setToolTipText ( L"Show the current Maps in all Archives.\n Double-Click the Map to start the level" ); - - - // create a visible Scene Tree - env->addStaticText ( L"Scenegraph:", rect( dim.Width - 400, dim.Height - 400, dim.Width - 5,dim.Height - 380 ),false, false, gui.Window, -1, false ); - gui.SceneTree = env->addTreeView( rect( dim.Width - 400, dim.Height - 380, dim.Width - 5, dim.Height - 40 ), - gui.Window, -1, true, true, false ); - gui.SceneTree->setToolTipText ( L"Show the current Scenegraph" ); - gui.SceneTree->getRoot()->clearChildren(); - addSceneTreeItem ( Game->Device->getSceneManager()->getRootSceneNode(), gui.SceneTree->getRoot() ); - - - IGUIImageList* imageList = env->createImageList( driver->getTexture ( "iconlist.png" ), - dimension2di( 32, 32 ), true ); - - if ( imageList ) - { - gui.SceneTree->setImageList( imageList ); - imageList->drop (); - } - - - // load the engine logo - gui.Logo = env->addImage( driver->getTexture("irrlichtlogo3.png"), position2d(5, 16 ), true, 0 ); - gui.Logo->setToolTipText ( L"The great Irrlicht Engine" ); - - AddArchive ( "" ); -} - - -/* - Add an Archive to the FileSystems and updates the GUI -*/ -void CQuake3EventHandler::AddArchive ( const path& archiveName ) -{ - IFileSystem *fs = Game->Device->getFileSystem(); - u32 i; - - if ( archiveName.size () ) - { - bool exists = false; - for ( i = 0; i != fs->getFileArchiveCount(); ++i ) - { - if ( fs->getFileArchive(i)->getFileList()->getPath() == archiveName ) - { - exists = true; - break; - } - } - - if (!exists) - { - fs->addFileArchive(archiveName, true, false); - } - } - - // store the current archives in game data - // show the attached Archive in proper order - if ( gui.ArchiveList ) - { - gui.ArchiveList->clearRows(); - - for ( i = 0; i != fs->getFileArchiveCount(); ++i ) - { - IFileArchive * archive = fs->getFileArchive ( i ); - - u32 index = gui.ArchiveList->addRow(i); - - core::stringw typeName; - switch(archive->getType()) - { - case io::EFAT_ZIP: - typeName = "ZIP"; - break; - case io::EFAT_GZIP: - typeName = "gzip"; - break; - case io::EFAT_FOLDER: - typeName = "Mount"; - break; - case io::EFAT_PAK: - typeName = "PAK"; - break; - case io::EFAT_TAR: - typeName = "TAR"; - break; - default: - typeName = "archive"; - } - - gui.ArchiveList->setCellText ( index, 0, typeName ); - gui.ArchiveList->setCellText ( index, 1, archive->getFileList()->getPath() ); - } - } - - - // browse the archives for maps - if ( gui.MapList ) - { - gui.MapList->clear(); - - IGUISpriteBank *bank = Game->Device->getGUIEnvironment()->getSpriteBank("sprite_q3map"); - if ( 0 == bank ) - bank = Game->Device->getGUIEnvironment()->addEmptySpriteBank("sprite_q3map"); - - SGUISprite sprite; - SGUISpriteFrame frame; - core::rect r; - - bank->getSprites().clear(); - bank->getPositions().clear (); - gui.MapList->setSpriteBank ( bank ); - - u32 g = 0; - core::stringw s; - - // browse the attached file system - fs->setFileListSystem ( FILESYSTEM_VIRTUAL ); - fs->changeWorkingDirectoryTo ( "/maps/" ); - IFileList *fileList = fs->createFileList (); - fs->setFileListSystem ( FILESYSTEM_NATIVE ); - - for ( i=0; i< fileList->getFileCount(); ++i) - { - s = fileList->getFullFileName(i); - if ( s.find ( ".bsp" ) >= 0 ) - { - // get level screenshot. reformat texture to 128x128 - path c ( s ); - deletePathFromFilename ( c ); - cutFilenameExtension ( c, c ); - c = path ( "levelshots/" ) + c; - - dimension2du dim ( 128, 128 ); - IVideoDriver * driver = Game->Device->getVideoDriver(); - IImage* image = 0; - ITexture *tex = 0; - path filename; - - filename = c + ".jpg"; - if ( fs->existFile ( filename ) ) - image = driver->createImageFromFile( filename ); - if ( 0 == image ) - { - filename = c + ".tga"; - if ( fs->existFile ( filename ) ) - image = driver->createImageFromFile( filename ); - } - - if ( image ) - { - IImage* filter = driver->createImage ( video::ECF_R8G8B8, dim ); - image->copyToScalingBoxFilter ( filter, 0 ); - image->drop (); - image = filter; - } - - if ( image ) - { - tex = driver->addTexture ( filename, image ); - image->drop (); - } - - - bank->setTexture ( g, tex ); - - r.LowerRightCorner.X = dim.Width; - r.LowerRightCorner.Y = dim.Height; - gui.MapList->setItemHeight ( r.LowerRightCorner.Y + 4 ); - frame.rectNumber = bank->getPositions().size(); - frame.textureNumber = g; - - bank->getPositions().push_back(r); - - sprite.Frames.set_used ( 0 ); - sprite.Frames.push_back(frame); - sprite.frameTime = 0; - bank->getSprites().push_back(sprite); - - gui.MapList->addItem ( s.c_str (), g ); - g += 1; - } - } - fileList->drop (); - - gui.MapList->setSelected ( -1 ); - IGUIScrollBar * bar = (IGUIScrollBar*)gui.MapList->getElementFromId( 0 ); - if ( bar ) - bar->setPos ( 0 ); - - } - -} - -/* - clears the Map in Memory -*/ -void CQuake3EventHandler::dropMap () -{ - IVideoDriver * driver = Game->Device->getVideoDriver(); - - driver->removeAllHardwareBuffers (); - driver->removeAllTextures (); - - Player[0].shutdown (); - - - dropElement ( ItemParent ); - dropElement ( ShaderParent ); - dropElement ( UnresolvedParent ); - dropElement ( FogParent ); - dropElement ( BulletParent ); - - - Impacts.clear(); - - if ( Meta ) - { - Meta = 0; - } - - dropElement ( MapParent ); - dropElement ( SkyNode ); - - // clean out meshes, because textures are invalid - // TODO: better texture handling;-) - IMeshCache *cache = Game->Device->getSceneManager ()->getMeshCache(); - cache->clear (); - Mesh = 0; -} - -/* Load new map -*/ -void CQuake3EventHandler::LoadMap ( const stringw &mapName, s32 collision ) -{ - if ( 0 == mapName.size() ) - return; - - dropMap (); - - IFileSystem *fs = Game->Device->getFileSystem(); - ISceneManager *smgr = Game->Device->getSceneManager (); - - IReadFile* file = fs->createMemoryReadFile(&Game->loadParam, - sizeof(Game->loadParam), L"levelparameter.cfg", false); - - // load cfg file - smgr->getMesh( file ); - file->drop (); - - // load the actual map - Mesh = (IQ3LevelMesh*) smgr->getMesh(mapName); - if ( 0 == Mesh ) - return; - - /* - add the geometry mesh to the Scene ( polygon & patches ) - The Geometry mesh is optimised for faster drawing - */ - - IMesh *geometry = Mesh->getMesh(E_Q3_MESH_GEOMETRY); - if ( 0 == geometry || geometry->getMeshBufferCount() == 0) - return; - - Game->CurrentMapName = mapName; - - //create a collision list - Meta = 0; - - ITriangleSelector * selector = 0; - if (collision) - Meta = smgr->createMetaTriangleSelector(); - - //IMeshBuffer *b0 = geometry->getMeshBuffer(0); - //s32 minimalNodes = b0 ? core::s32_max ( 2048, b0->getVertexCount() / 32 ) : 2048; - s32 minimalNodes = 2048; - - MapParent = smgr->addOctreeSceneNode(geometry, 0, -1, minimalNodes); - MapParent->setName ( mapName ); - if ( Meta ) - { - selector = smgr->createOctreeTriangleSelector( geometry,MapParent, minimalNodes); - //selector = smgr->createTriangleSelector ( geometry, MapParent ); - Meta->addTriangleSelector( selector); - selector->drop (); - } - - // logical parent for the items - ItemParent = smgr->addEmptySceneNode(); - if ( ItemParent ) - ItemParent->setName ( "Item Container" ); - - ShaderParent = smgr->addEmptySceneNode(); - if ( ShaderParent ) - ShaderParent->setName ( "Shader Container" ); - - UnresolvedParent = smgr->addEmptySceneNode(); - if ( UnresolvedParent ) - UnresolvedParent->setName ( "Unresolved Container" ); - - FogParent = smgr->addEmptySceneNode(); - if ( FogParent ) - FogParent->setName ( "Fog Container" ); - - // logical parent for the bullets - BulletParent = smgr->addEmptySceneNode(); - if ( BulletParent ) - BulletParent->setName ( "Bullet Container" ); - - /* - now construct SceneNodes for each Shader - The Objects are stored in the quake mesh E_Q3_MESH_ITEMS - and the Shader ID is stored in the MaterialParameters - mostly dark looking skulls and moving lava.. or green flashing tubes? - */ - Q3ShaderFactory ( Game->loadParam, Game->Device, Mesh, E_Q3_MESH_ITEMS,ShaderParent, Meta, false ); - Q3ShaderFactory ( Game->loadParam, Game->Device, Mesh, E_Q3_MESH_FOG,FogParent, 0, false ); - Q3ShaderFactory ( Game->loadParam, Game->Device, Mesh, E_Q3_MESH_UNRESOLVED,UnresolvedParent, Meta, true ); - - /* - Now construct Models from Entity List - */ - Q3ModelFactory ( Game->loadParam, Game->Device, Mesh, ItemParent, false ); -} - -/* - Adds a SceneNode with an icon to the Scene Tree -*/ -void CQuake3EventHandler::addSceneTreeItem( ISceneNode * parent, IGUITreeViewNode* nodeParent) -{ - IGUITreeViewNode* node; - wchar_t msg[128]; - - s32 imageIndex; - list::ConstIterator it = parent->getChildren().begin(); - for (; it != parent->getChildren().end(); ++it) - { - switch ( (*it)->getType () ) - { - case ESNT_Q3SHADER_SCENE_NODE: imageIndex = 0; break; - case ESNT_CAMERA: imageIndex = 1; break; - case ESNT_EMPTY: imageIndex = 2; break; - case ESNT_MESH: imageIndex = 3; break; - case ESNT_OCTREE: imageIndex = 3; break; - case ESNT_ANIMATED_MESH: imageIndex = 4; break; - case ESNT_SKY_BOX: imageIndex = 5; break; - case ESNT_BILLBOARD: imageIndex = 6; break; - case ESNT_PARTICLE_SYSTEM: imageIndex = 7; break; - case ESNT_TEXT: imageIndex = 8; break; - default:imageIndex = -1; break; - } - - if ( imageIndex < 0 ) - { - swprintf_irr ( msg, 128, L"%hs,%hs", - Game->Device->getSceneManager ()->getSceneNodeTypeName ( (*it)->getType () ), - (*it)->getName() - ); - } - else - { - swprintf_irr ( msg, 128, L"%hs",(*it)->getName() ); - } - - node = nodeParent->addChildBack( msg, 0, imageIndex ); - - // Add all Animators - list::ConstIterator ait = (*it)->getAnimators().begin(); - for (; ait != (*it)->getAnimators().end(); ++ait) - { - imageIndex = -1; - swprintf_irr ( msg, 128, L"%hs", - Game->Device->getSceneManager ()->getAnimatorTypeName ( (*ait)->getType () ) - ); - - switch ( (*ait)->getType () ) - { - case ESNAT_FLY_CIRCLE: - case ESNAT_FLY_STRAIGHT: - case ESNAT_FOLLOW_SPLINE: - case ESNAT_ROTATION: - case ESNAT_TEXTURE: - case ESNAT_DELETION: - case ESNAT_COLLISION_RESPONSE: - case ESNAT_CAMERA_FPS: - case ESNAT_CAMERA_MAYA: - default: - break; - } - node->addChildBack( msg, 0, imageIndex ); - } - - addSceneTreeItem ( *it, node ); - } -} - - -// Adds life! -void CQuake3EventHandler::CreatePlayers() -{ - Player[0].create ( Game->Device, Mesh, MapParent, Meta ); -} - - -// Adds a skydome to the scene -void CQuake3EventHandler::AddSky( u32 dome, const c8 *texture) -{ - ISceneManager *smgr = Game->Device->getSceneManager (); - IVideoDriver * driver = Game->Device->getVideoDriver(); - - bool oldMipMapState = driver->getTextureCreationFlag(video::ETCF_CREATE_MIP_MAPS); - driver->setTextureCreationFlag(video::ETCF_CREATE_MIP_MAPS, false); - - if ( 0 == dome ) - { - // irrlicht order - //static const c8*p[] = { "ft", "lf", "bk", "rt", "up", "dn" }; - // quake3 order - static const c8*p[] = { "ft", "rt", "bk", "lf", "up", "dn" }; - - u32 i = 0; - snprintf_irr ( buf, 64, "%s_%s.jpg", texture, p[i] ); - SkyNode = smgr->addSkyBoxSceneNode( driver->getTexture ( buf ), 0, 0, 0, 0, 0 ); - - if (SkyNode) - { - for ( i = 0; i < 6; ++i ) - { - snprintf_irr ( buf, 64, "%s_%s.jpg", texture, p[i] ); - SkyNode->getMaterial(i).setTexture ( 0, driver->getTexture ( buf ) ); - } - } - } - else - if ( 1 == dome ) - { - snprintf_irr ( buf, 64, "%s.jpg", texture ); - SkyNode = smgr->addSkyDomeSceneNode( - driver->getTexture( buf ), 32,32, - 1.f, 1.f, 1000.f, 0, 11); - } - else - if ( 2 == dome ) - { - snprintf_irr ( buf, 64, "%s.jpg", texture ); - SkyNode = smgr->addSkyDomeSceneNode( - driver->getTexture( buf ), 16,8, - 0.95f, 2.f, 1000.f, 0, 11); - } - - if (SkyNode) - SkyNode->setName("Skydome"); - //SkyNode->getMaterial(0).ZBuffer = video::EMDF_DEPTH_LESS_EQUAL; - - driver->setTextureCreationFlag(video::ETCF_CREATE_MIP_MAPS, oldMipMapState); -} - - -// enable GUI elements -void CQuake3EventHandler::SetGUIActive( s32 command) -{ - bool inputState = false; - - ICameraSceneNode * camera = Game->Device->getSceneManager()->getActiveCamera (); - - switch ( command ) - { - case 0: Game->guiActive = 0; inputState = !Game->guiActive; break; - case 1: Game->guiActive = 1; inputState = !Game->guiActive;;break; - case 2: Game->guiActive ^= 1; inputState = !Game->guiActive;break; - case 3: - if ( camera ) - inputState = !camera->isInputReceiverEnabled(); - break; - } - - if ( camera ) - { - camera->setInputReceiverEnabled ( inputState ); - Game->Device->getCursorControl()->setVisible( !inputState ); - } - - if ( gui.Window ) - { - gui.Window->setVisible ( Game->guiActive != 0 ); - } - - if ( Game->guiActive && - gui.SceneTree && Game->Device->getGUIEnvironment()->getFocus() != gui.SceneTree - ) - { - gui.SceneTree->getRoot()->clearChildren(); - addSceneTreeItem ( Game->Device->getSceneManager()->getRootSceneNode(), gui.SceneTree->getRoot() ); - } - - Game->Device->getGUIEnvironment()->setFocus ( Game->guiActive ? gui.Window: 0 ); -} - - -/* - Handle game input -*/ -bool CQuake3EventHandler::OnEvent(const SEvent& eve) -{ - if ( eve.EventType == EET_LOG_TEXT_EVENT ) - { - return false; - } - - if ( Game->guiActive && eve.EventType == EET_GUI_EVENT ) - { - if ( eve.GUIEvent.Caller == gui.MapList && eve.GUIEvent.EventType == gui::EGET_LISTBOX_SELECTED_AGAIN ) - { - s32 selected = gui.MapList->getSelected(); - if ( selected >= 0 ) - { - stringw loadMap = gui.MapList->getListItem ( selected ); - if ( 0 == MapParent || loadMap != Game->CurrentMapName ) - { - printf ( "Loading map %ls\n", loadMap.c_str() ); - LoadMap ( loadMap , 1 ); - if ( 0 == Game->loadParam.loadSkyShader ) - { - AddSky ( 1, "skydome2" ); - } - CreatePlayers (); - CreateGUI (); - SetGUIActive ( 0 ); - return true; - } - } - } - else - if ( eve.GUIEvent.Caller == gui.ArchiveRemove && eve.GUIEvent.EventType == gui::EGET_BUTTON_CLICKED ) - { - Game->Device->getFileSystem()->removeFileArchive( gui.ArchiveList->getSelected() ); - Game->CurrentMapName = ""; - AddArchive ( "" ); - } - else - if ( eve.GUIEvent.Caller == gui.ArchiveAdd && eve.GUIEvent.EventType == gui::EGET_BUTTON_CLICKED ) - { - if ( 0 == gui.ArchiveFileOpen ) - { - Game->Device->getFileSystem()->setFileListSystem ( FILESYSTEM_NATIVE ); - gui.ArchiveFileOpen = Game->Device->getGUIEnvironment()->addFileOpenDialog ( L"Add Game Archive" , false,gui.Window ); - } - } - else - if ( eve.GUIEvent.Caller == gui.ArchiveFileOpen && eve.GUIEvent.EventType == gui::EGET_FILE_SELECTED ) - { - AddArchive ( gui.ArchiveFileOpen->getFileNameP() ); - gui.ArchiveFileOpen = 0; - } - else - if ( eve.GUIEvent.Caller == gui.ArchiveFileOpen && eve.GUIEvent.EventType == gui::EGET_DIRECTORY_SELECTED ) - { - AddArchive ( gui.ArchiveFileOpen->getDirectoryName() ); - } - else - if ( eve.GUIEvent.Caller == gui.ArchiveFileOpen && eve.GUIEvent.EventType == gui::EGET_FILE_CHOOSE_DIALOG_CANCELLED ) - { - gui.ArchiveFileOpen = 0; - } - else - if ( ( eve.GUIEvent.Caller == gui.ArchiveUp || eve.GUIEvent.Caller == gui.ArchiveDown ) && - eve.GUIEvent.EventType == gui::EGET_BUTTON_CLICKED ) - { - s32 rel = eve.GUIEvent.Caller == gui.ArchiveUp ? -1 : 1; - if ( Game->Device->getFileSystem()->moveFileArchive ( gui.ArchiveList->getSelected (), rel ) ) - { - s32 newIndex = core::s32_clamp ( gui.ArchiveList->getSelected() + rel, 0, gui.ArchiveList->getRowCount() - 1 ); - AddArchive ( "" ); - gui.ArchiveList->setSelected ( newIndex ); - Game->CurrentMapName = ""; - } - } - else - if ( eve.GUIEvent.Caller == gui.VideoDriver && eve.GUIEvent.EventType == gui::EGET_COMBO_BOX_CHANGED ) - { - Game->deviceParam.DriverType = (E_DRIVER_TYPE) gui.VideoDriver->getItemData ( gui.VideoDriver->getSelected() ); - } - else - if ( eve.GUIEvent.Caller == gui.VideoMode && eve.GUIEvent.EventType == gui::EGET_COMBO_BOX_CHANGED ) - { - u32 val = gui.VideoMode->getItemData ( gui.VideoMode->getSelected() ); - Game->deviceParam.WindowSize.Width = val >> 16; - Game->deviceParam.WindowSize.Height = val & 0xFFFF; - } - else - if ( eve.GUIEvent.Caller == gui.FullScreen && eve.GUIEvent.EventType == gui::EGET_CHECKBOX_CHANGED ) - { - Game->deviceParam.Fullscreen = gui.FullScreen->isChecked(); - } - else - if ( eve.GUIEvent.Caller == gui.Bit32 && eve.GUIEvent.EventType == gui::EGET_CHECKBOX_CHANGED ) - { - Game->deviceParam.Bits = gui.Bit32->isChecked() ? 32 : 16; - } - else - if ( eve.GUIEvent.Caller == gui.MultiSample && eve.GUIEvent.EventType == gui::EGET_SCROLL_BAR_CHANGED ) - { - Game->deviceParam.AntiAlias = gui.MultiSample->getPos(); - } - else - if ( eve.GUIEvent.Caller == gui.Tesselation && eve.GUIEvent.EventType == gui::EGET_SCROLL_BAR_CHANGED ) - { - Game->loadParam.patchTesselation = gui.Tesselation->getPos (); - } - else - if ( eve.GUIEvent.Caller == gui.Gamma && eve.GUIEvent.EventType == gui::EGET_SCROLL_BAR_CHANGED ) - { - Game->GammaValue = gui.Gamma->getPos () * 0.01f; - Game->Device->setGammaRamp ( Game->GammaValue, Game->GammaValue, Game->GammaValue, 0.f, 0.f ); - } - else - if ( eve.GUIEvent.Caller == gui.SetVideoMode && eve.GUIEvent.EventType == gui::EGET_BUTTON_CLICKED ) - { - Game->retVal = 2; - Game->Device->closeDevice(); - } - else - if ( eve.GUIEvent.Caller == gui.Window && eve.GUIEvent.EventType == gui::EGET_ELEMENT_CLOSED ) - { - Game->Device->closeDevice(); - } - else - if ( eve.GUIEvent.Caller == gui.Collision && eve.GUIEvent.EventType == gui::EGET_CHECKBOX_CHANGED ) - { - // set fly through active - Game->flyTroughState ^= 1; - Player[0].cam()->setAnimateTarget ( Game->flyTroughState == 0 ); - - printf ( "collision %d\n", Game->flyTroughState == 0 ); - } - else - if ( eve.GUIEvent.Caller == gui.Visible_Map && eve.GUIEvent.EventType == gui::EGET_CHECKBOX_CHANGED ) - { - bool v = gui.Visible_Map->isChecked(); - - if ( MapParent ) - { - printf ( "static node set visible %d\n",v ); - MapParent->setVisible ( v ); - } - } - else - if ( eve.GUIEvent.Caller == gui.Visible_Shader && eve.GUIEvent.EventType == gui::EGET_CHECKBOX_CHANGED ) - { - bool v = gui.Visible_Shader->isChecked(); - - if ( ShaderParent ) - { - printf ( "shader node set visible %d\n",v ); - ShaderParent->setVisible ( v ); - } - } - else - if ( eve.GUIEvent.Caller == gui.Visible_Skydome && eve.GUIEvent.EventType == gui::EGET_CHECKBOX_CHANGED ) - { - if ( SkyNode ) - { - bool v = !SkyNode->isVisible(); - printf ( "skynode set visible %d\n",v ); - SkyNode->setVisible ( v ); - } - } - else - if ( eve.GUIEvent.Caller == gui.Respawn && eve.GUIEvent.EventType == gui::EGET_BUTTON_CLICKED ) - { - Player[0].respawn (); - } - - return false; - } - - // fire - if ((eve.EventType == EET_KEY_INPUT_EVENT && eve.KeyInput.Key == KEY_SPACE && - eve.KeyInput.PressedDown == false) || - (eve.EventType == EET_MOUSE_INPUT_EVENT && eve.MouseInput.Event == EMIE_LMOUSE_LEFT_UP) - ) - { - ICameraSceneNode * camera = Game->Device->getSceneManager()->getActiveCamera (); - if ( camera && camera->isInputReceiverEnabled () ) - { - useItem( Player + 0 ); - } - } - - // gui active - if ((eve.EventType == EET_KEY_INPUT_EVENT && eve.KeyInput.Key == KEY_F1 && - eve.KeyInput.PressedDown == false) || - (eve.EventType == EET_MOUSE_INPUT_EVENT && eve.MouseInput.Event == EMIE_RMOUSE_LEFT_UP) - ) - { - SetGUIActive ( 2 ); - } - - // check if user presses the key - if ( eve.EventType == EET_KEY_INPUT_EVENT && eve.KeyInput.PressedDown == false) - { - // Escape toggles camera Input - if ( eve.KeyInput.Key == irr::KEY_ESCAPE ) - { - SetGUIActive ( 3 ); - } - else - if (eve.KeyInput.Key == KEY_F11) - { - // screenshot are taken without gamma! - IImage* image = Game->Device->getVideoDriver()->createScreenShot(); - if (image) - { - core::vector3df pos; - core::vector3df rot; - ICameraSceneNode * cam = Game->Device->getSceneManager()->getActiveCamera (); - if ( cam ) - { - pos = cam->getPosition (); - rot = cam->getRotation (); - } - - snprintf_irr(buf, 256, "%s_%ls_%.0f_%.0f_%.0f_%.0f_%.0f_%.0f.jpg", - DRIVER_TYPE_NAMES_SHORT[Game->Device->getVideoDriver()->getDriverType()], - Game->CurrentMapName.c_str(), - pos.X, pos.Y, pos.Z, - rot.X, rot.Y, rot.Z - ); - path filename ( buf ); - filename.replace ( '/', '_' ); - printf ( "screenshot : %s\n", filename.c_str() ); - Game->Device->getVideoDriver()->writeImageToFile(image, filename, 100 ); - image->drop(); - } - } - else - if (eve.KeyInput.Key == KEY_F9) - { - s32 value = EDS_OFF; - - Game->debugState = ( Game->debugState + 1 ) & 3; - - switch ( Game->debugState ) - { - case 1: value = EDS_NORMALS | EDS_MESH_WIRE_OVERLAY | EDS_BBOX_ALL; break; - case 2: value = EDS_NORMALS | EDS_MESH_WIRE_OVERLAY | EDS_SKELETON; break; - } -/* - // set debug map data on/off - debugState = debugState == EDS_OFF ? - EDS_NORMALS | EDS_MESH_WIRE_OVERLAY | EDS_BBOX_ALL: - EDS_OFF; -*/ - if ( ItemParent ) - { - list::ConstIterator it = ItemParent->getChildren().begin(); - for (; it != ItemParent->getChildren().end(); ++it) - { - (*it)->setDebugDataVisible ( value ); - } - } - - if ( ShaderParent ) - { - list::ConstIterator it = ShaderParent->getChildren().begin(); - for (; it != ShaderParent->getChildren().end(); ++it) - { - (*it)->setDebugDataVisible ( value ); - } - } - - if ( UnresolvedParent ) - { - list::ConstIterator it = UnresolvedParent->getChildren().begin(); - for (; it != UnresolvedParent->getChildren().end(); ++it) - { - (*it)->setDebugDataVisible ( value ); - } - } - - if ( FogParent ) - { - list::ConstIterator it = FogParent->getChildren().begin(); - for (; it != FogParent->getChildren().end(); ++it) - { - (*it)->setDebugDataVisible ( value ); - } - } - - if ( SkyNode ) - { - SkyNode->setDebugDataVisible ( value ); - } - - } - else - if (eve.KeyInput.Key == KEY_F8) - { - // set gravity on/off - Game->gravityState ^= 1; - Player[0].cam()->setGravity ( getGravity ( Game->gravityState ? "earth" : "none" ) ); - printf ( "gravity %s\n", Game->gravityState ? "earth" : "none" ); - } - else - if (eve.KeyInput.Key == KEY_F7) - { - // set fly through active - Game->flyTroughState ^= 1; - Player[0].cam()->setAnimateTarget ( Game->flyTroughState == 0 ); - if ( gui.Collision ) - gui.Collision->setChecked ( Game->flyTroughState == 0 ); - - printf ( "collision %d\n", Game->flyTroughState == 0 ); - } - else - if (eve.KeyInput.Key == KEY_F2) - { - Player[0].respawn (); - } - else - if (eve.KeyInput.Key == KEY_F3) - { - if ( MapParent ) - { - bool v = !MapParent->isVisible (); - printf ( "static node set visible %d\n",v ); - MapParent->setVisible ( v ); - if ( gui.Visible_Map ) - gui.Visible_Map->setChecked ( v ); - } - } - else - if (eve.KeyInput.Key == KEY_F4) - { - if ( ShaderParent ) - { - bool v = !ShaderParent->isVisible (); - printf ( "shader node set visible %d\n",v ); - ShaderParent->setVisible ( v ); - if ( gui.Visible_Shader ) - gui.Visible_Shader->setChecked ( v ); - } - } - else - if (eve.KeyInput.Key == KEY_F5) - { - if ( FogParent ) - { - bool v = !FogParent->isVisible (); - printf ( "fog node set visible %d\n",v ); - FogParent->setVisible ( v ); - if ( gui.Visible_Fog ) - gui.Visible_Fog->setChecked ( v ); - } - - } - else - if (eve.KeyInput.Key == KEY_F6) - { - if ( UnresolvedParent ) - { - bool v = !UnresolvedParent->isVisible (); - printf ( "unresolved node set visible %d\n",v ); - UnresolvedParent->setVisible ( v ); - if ( gui.Visible_Unresolved ) - gui.Visible_Unresolved->setChecked ( v ); - } - } - } - - // check if user presses the key C ( for crouch) - if ( eve.EventType == EET_KEY_INPUT_EVENT && eve.KeyInput.Key == KEY_KEY_C ) - { - // crouch - ISceneNodeAnimatorCollisionResponse *anim = Player[0].cam (); - if ( anim && 0 == Game->flyTroughState ) - { - if ( false == eve.KeyInput.PressedDown ) - { - // stand up - anim->setEllipsoidRadius ( vector3df(30,45,30) ); - anim->setEllipsoidTranslation ( vector3df(0,40,0)); - - } - else - { - // on your knees - anim->setEllipsoidRadius ( vector3df(30,20,30) ); - anim->setEllipsoidTranslation ( vector3df(0,20,0)); - } - return true; - } - } - return false; -} - - - -/* - useItem -*/ -void CQuake3EventHandler::useItem( Q3Player * player) -{ - ISceneManager* smgr = Game->Device->getSceneManager(); - ICameraSceneNode* camera = smgr->getActiveCamera(); - - if (!camera) - return; - - SParticleImpact imp; - imp.when = 0; - - // get line of camera - - vector3df start = camera->getPosition(); - - if ( player->WeaponNode ) - { - start.X += 0.f; - start.Y += 0.f; - start.Z += 0.f; - } - - vector3df end = (camera->getTarget() - start); - end.normalize(); - start += end*20.0f; - - end = start + (end * camera->getFarValue()); - - triangle3df triangle; - line3d line(start, end); - - // get intersection point with map - scene::ISceneNode* hitNode; - if (smgr->getSceneCollisionManager()->getCollisionPoint( - line, Meta, end, triangle,hitNode)) - { - // collides with wall - vector3df out = triangle.getNormal(); - out.setLength(0.03f); - - imp.when = 1; - imp.outVector = out; - imp.pos = end; - - player->setAnim ( "pow" ); - player->Anim[1].next += player->Anim[1].delta; - } - else - { - // doesnt collide with wall - vector3df start = camera->getPosition(); - if ( player->WeaponNode ) - { - //start.X += 10.f; - //start.Y += -5.f; - //start.Z += 1.f; - } - - vector3df end = (camera->getTarget() - start); - end.normalize(); - start += end*20.0f; - end = start + (end * camera->getFarValue()); - } - - // create fire ball - ISceneNode* node = 0; - node = smgr->addBillboardSceneNode( BulletParent,dimension2d(10,10), start); - - node->setMaterialFlag(EMF_LIGHTING, false); - node->setMaterialTexture(0, Game->Device->getVideoDriver()->getTexture("fireball.bmp")); - node->setMaterialFlag(video::EMF_ZWRITE_ENABLE, false); - node->setMaterialType(EMT_TRANSPARENT_ADD_COLOR); - - f32 length = (f32)(end - start).getLength(); - const f32 speed = 5.8f; - u32 time = (u32)(length / speed); - - ISceneNodeAnimator* anim = 0; - - // set flight line - - anim = smgr->createFlyStraightAnimator(start, end, time); - node->addAnimator(anim); - anim->drop(); - - snprintf_irr ( buf, 64, "bullet: %s on %.1f,%1.f,%1.f", - imp.when ? "hit" : "nohit", end.X, end.Y, end.Z ); - node->setName ( buf ); - - - anim = smgr->createDeleteAnimator(time); - node->addAnimator(anim); - anim->drop(); - - if (imp.when) - { - // create impact note - imp.when = Game->Device->getTimer()->getTime() + - (time + (s32) ( ( 1.f + Noiser::get() ) * 250.f )); - Impacts.push_back(imp); - } - - // play sound -} - -// rendered when bullets hit something -void CQuake3EventHandler::createParticleImpacts( u32 now ) -{ - ISceneManager* sm = Game->Device->getSceneManager(); - - struct smokeLayer - { - const c8 * texture; - f32 scale; - f32 minparticleSize; - f32 maxparticleSize; - f32 boxSize; - u32 minParticle; - u32 maxParticle; - u32 fadeout; - u32 lifetime; - }; - - smokeLayer smoke[] = - { - { "smoke2.jpg", 0.4f, 1.5f, 18.f, 20.f, 20, 50, 2000, 10000 }, - { "smoke3.jpg", 0.2f, 1.2f, 15.f, 20.f, 10, 30, 1000, 12000 } - }; - - - u32 i; - u32 g; - s32 factor = 1; - for ( g = 0; g != 2; ++g ) - { - smoke[g].minParticle *= factor; - smoke[g].maxParticle *= factor; - smoke[g].lifetime *= factor; - smoke[g].boxSize *= Noiser::get() * 0.5f; - } - - for ( i=0; i < Impacts.size(); ++i) - { - if (now < Impacts[i].when) - continue; - - // create smoke particle system - IParticleSystemSceneNode* pas = 0; - - for ( g = 0; g != 2; ++g ) - { - pas = sm->addParticleSystemSceneNode(false, BulletParent, -1, Impacts[i].pos); - - snprintf_irr ( buf, 64, "bullet impact smoke at %.1f,%.1f,%1.f", - Impacts[i].pos.X,Impacts[i].pos.Y,Impacts[i].pos.Z); - pas->setName ( buf ); - - // create a flat smoke - vector3df direction = Impacts[i].outVector; - direction *= smoke[g].scale; - IParticleEmitter* em = pas->createBoxEmitter( - aabbox3d(-4.f,0.f,-4.f,20.f,smoke[g].minparticleSize,20.f), - direction,smoke[g].minParticle, smoke[g].maxParticle, - video::SColor(0,0,0,0),video::SColor(0,128,128,128), - 250,4000, 60); - - em->setMinStartSize (dimension2d( smoke[g].minparticleSize, smoke[g].minparticleSize)); - em->setMaxStartSize (dimension2d( smoke[g].maxparticleSize, smoke[g].maxparticleSize)); - - pas->setEmitter(em); - em->drop(); - - // particles get invisible - IParticleAffector* paf = pas->createFadeOutParticleAffector( - video::SColor ( 0, 0, 0, 0 ), smoke[g].fadeout); - pas->addAffector(paf); - paf->drop(); - - // particle system life time - ISceneNodeAnimator* anim = sm->createDeleteAnimator( smoke[g].lifetime); - pas->addAnimator(anim); - anim->drop(); - - pas->setMaterialFlag(video::EMF_LIGHTING, false); - pas->setMaterialFlag(video::EMF_ZWRITE_ENABLE, false); - pas->setMaterialType(video::EMT_TRANSPARENT_ADD_COLOR ); - pas->setMaterialTexture(0, Game->Device->getVideoDriver()->getTexture( smoke[g].texture )); - } - - - // play impact sound - #ifdef USE_IRRKLANG -/* - if (irrKlang) - { - audio::ISound* sound = - irrKlang->play3D(impactSound, Impacts[i].pos, false, false, true); - - if (sound) - { - // adjust max value a bit to make to sound of an impact louder - sound->setMinDistance(400); - sound->drop(); - } - } -*/ - #endif - - - // delete entry - Impacts.erase(i); - i--; - } -} - -/* - render -*/ -void CQuake3EventHandler::Render() -{ - IVideoDriver * driver = Game->Device->getVideoDriver(); - if ( 0 == driver ) - return; - - // TODO: This does not work, yet. - const bool anaglyph=false; - if (anaglyph) - { - scene::ICameraSceneNode* cameraOld = Game->Device->getSceneManager()->getActiveCamera(); - driver->beginScene(video::ECBF_COLOR | video::ECBF_DEPTH, SColor(0,0,0,0)); - driver->getOverrideMaterial().Material.ColorMask = ECP_NONE; - driver->getOverrideMaterial().EnableFlags = EMF_COLOR_MASK; - driver->getOverrideMaterial().EnablePasses = ESNRP_SKY_BOX + - ESNRP_SOLID + - ESNRP_TRANSPARENT + - ESNRP_TRANSPARENT_EFFECT + - ESNRP_SHADOW; - Game->Device->getSceneManager()->drawAll(); - driver->clearBuffers(video::ECBF_DEPTH, video::SColor(255,0,0,0)); - - const vector3df oldPosition = cameraOld->getPosition(); - const vector3df oldTarget = cameraOld->getTarget(); - const matrix4 startMatrix = cameraOld->getAbsoluteTransformation(); - const vector3df focusPoint = (oldTarget - - cameraOld->getAbsolutePosition()).setLength(10000) + - cameraOld->getAbsolutePosition() ; - - scene::ICameraSceneNode* camera = cameraOld;//Game->Device->getSceneManager()->addCameraSceneNode(); - - //Left eye... - vector3df pos; - matrix4 move; - - move.setTranslation( vector3df(-1.5f,0.0f,0.0f) ); - pos=(startMatrix*move).getTranslation(); - - driver->getOverrideMaterial().Material.ColorMask = ECP_RED; - driver->getOverrideMaterial().EnableFlags = EMF_COLOR_MASK; - driver->getOverrideMaterial().EnablePasses = - ESNRP_SKY_BOX|ESNRP_SOLID|ESNRP_TRANSPARENT| - ESNRP_TRANSPARENT_EFFECT|ESNRP_SHADOW; - - camera->setPosition(pos); - camera->setTarget(focusPoint); - - Game->Device->getSceneManager()->drawAll(); - driver->clearBuffers(video::ECBF_DEPTH, video::SColor(255, 0, 0, 0)); - - //Right eye... - move.setTranslation( vector3df(1.5f,0.0f,0.0f) ); - pos=(startMatrix*move).getTranslation(); - - driver->getOverrideMaterial().Material.ColorMask = ECP_GREEN + ECP_BLUE; - driver->getOverrideMaterial().EnableFlags = EMF_COLOR_MASK; - driver->getOverrideMaterial().EnablePasses = - ESNRP_SKY_BOX|ESNRP_SOLID|ESNRP_TRANSPARENT| - ESNRP_TRANSPARENT_EFFECT|ESNRP_SHADOW; - - camera->setPosition(pos); - camera->setTarget(focusPoint); - - Game->Device->getSceneManager()->drawAll(); - - driver->getOverrideMaterial().Material.ColorMask=ECP_ALL; - driver->getOverrideMaterial().EnableFlags=0; - driver->getOverrideMaterial().EnablePasses=0; - - if (camera != cameraOld) - { - Game->Device->getSceneManager()->setActiveCamera(cameraOld); - camera->remove(); - } - else - { - camera->setPosition(oldPosition); - camera->setTarget(oldTarget); - } - } - else - { - driver->beginScene(video::ECBF_COLOR | video::ECBF_DEPTH, SColor(0,0,0,0)); - Game->Device->getSceneManager()->drawAll(); - } - Game->Device->getGUIEnvironment()->drawAll(); - driver->endScene(); -} - -/* - update the generic scene node -*/ -void CQuake3EventHandler::Animate() -{ - u32 now = Game->Device->getTimer()->getTime(); - - Q3Player * player = Player + 0; - - checkTimeFire ( player->Anim, 4, now ); - - // Query Scene Manager attributes - if ( player->Anim[0].flags & FIRED ) - { - wchar_t msg[128]; - IVideoDriver * driver = Game->Device->getVideoDriver(); - -#ifdef _IRR_SCENEMANAGER_DEBUG - IAttributes * attr = Game->Device->getSceneManager()->getParameters(); - swprintf_irr ( msg, 128, - L"Q3 %s [%ls], FPS:%03d Tri:%.03fm Cull %d/%d nodes (%d,%d,%d)", - Game->CurrentMapName.c_str(), - driver->getName(), - driver->getFPS (), - (f32) driver->getPrimitiveCountDrawn( 0 ) * ( 1.f / 1000000.f ), - attr->getAttributeAsInt ( "culled" ), - attr->getAttributeAsInt ( "calls" ), - attr->getAttributeAsInt ( "drawn_solid" ), - attr->getAttributeAsInt ( "drawn_transparent" ), - attr->getAttributeAsInt ( "drawn_transparent_effect" ) - ); -#else -swprintf_irr ( msg, 128, - L"Q3 %s [%ls], FPS:%03d Tri:%.03fm", - Game->CurrentMapName.c_str(), - driver->getName(), - driver->getFPS (), - (f32) driver->getPrimitiveCountDrawn( 0 ) * ( 1.f / 1000000.f ) - ); -#endif - Game->Device->setWindowCaption( msg ); - - swprintf_irr ( msg, 128, - L"%03d fps, F1 GUI on/off, F2 respawn, F3-F6 toggle Nodes, F7 Collision on/off" - L", F8 Gravity on/off, Right Mouse Toggle GUI", - Game->Device->getVideoDriver()->getFPS () - ); - if ( gui.StatusLine ) - gui.StatusLine->setText ( msg ); - player->Anim[0].flags &= ~FIRED; - } - - // idle.. - if ( player->Anim[1].flags & FIRED ) - { - if ( strcmp ( player->animation, "idle" ) ) - player->setAnim ( "idle" ); - - player->Anim[1].flags &= ~FIRED; - } - - createParticleImpacts ( now ); - -} - - -/* The main game states -*/ -void runGame ( GameData *game ) -{ - if ( game->retVal >= 3 ) - return; - - game->Device = (*game->createExDevice) ( game->deviceParam ); - if ( 0 == game->Device) - { - // could not create selected driver. - game->retVal = 0; - return; - } - - // create an event receiver based on current game data - CQuake3EventHandler *eventHandler = new CQuake3EventHandler( game ); - - // load stored config - game->load ( "explorer.cfg" ); - - // add our media directory and archive to the file system - for ( u32 i = 0; i < game->CurrentArchiveList.size(); ++i ) - { - eventHandler->AddArchive ( game->CurrentArchiveList[i] ); - } - - // Load a Map or startup to the GUI - if ( game->CurrentMapName.size () ) - { - eventHandler->LoadMap ( game->CurrentMapName, 1 ); - if ( 0 == game->loadParam.loadSkyShader ) - eventHandler->AddSky ( 1, "skydome2" ); - eventHandler->CreatePlayers (); - eventHandler->CreateGUI (); - eventHandler->SetGUIActive ( 0 ); - - // set player to last position on restart - if ( game->retVal == 2 ) - { - eventHandler->GetPlayer( 0 )->setpos ( game->PlayerPosition, game->PlayerRotation ); - } - } - else - { - // start up empty - eventHandler->AddSky ( 1, "skydome2" ); - eventHandler->CreatePlayers (); - eventHandler->CreateGUI (); - eventHandler->SetGUIActive ( 1 ); - background_music ( "IrrlichtTheme.ogg" ); - } - - - game->retVal = 3; - while( game->Device->run() ) - { - eventHandler->Animate (); - eventHandler->Render (); - //if ( !game->Device->isWindowActive() ) - game->Device->yield(); - } - - game->Device->setGammaRamp ( 1.f, 1.f, 1.f, 0.f, 0.f ); - delete eventHandler; -} - -#if defined (_IRR_WINDOWS_) && 0 - #pragma comment(linker, "/subsystem:windows /ENTRY:mainCRTStartup") -#endif - - -/* The main routine, doing all setup -*/ -int IRRCALLCONV main(int argc, char* argv[]) -{ - path prgname(argv[0]); - GameData game ( deletePathFromPath ( prgname, 1 ) ); - - // dynamically load irrlicht - const c8 * dllName = argc > 1 ? argv[1] : "irrlicht.dll"; - game.createExDevice = load_createDeviceEx ( dllName ); - if ( 0 == game.createExDevice ) - { - game.retVal = 3; - printf ( "Could not load %s.\n", dllName ); - return game.retVal; // could not load dll - } - - // start without asking for driver - game.retVal = 1; - do - { - // if driver could not created, ask for another driver - if ( game.retVal == 0 ) - { - game.setDefault (); - // ask user for driver - game.deviceParam.DriverType=driverChoiceConsole(); - if (game.deviceParam.DriverType==video::EDT_COUNT) - game.retVal = 3; - } - runGame ( &game ); - } while ( game.retVal < 3 ); - - return game.retVal; -} - -/* -**/ diff --git a/examples/21.Quake3Explorer/q3factory.cpp b/examples/21.Quake3Explorer/q3factory.cpp deleted file mode 100644 index 476a2ed4..00000000 --- a/examples/21.Quake3Explorer/q3factory.cpp +++ /dev/null @@ -1,825 +0,0 @@ -/*! - Model Factory. - create the additional scenenodes for ( bullets, health... ) - - Defines the Entities for Quake3 -*/ - -#include -#include "q3factory.h" -#include "sound.h" - -using namespace irr; -using namespace scene; -using namespace gui; -using namespace video; -using namespace core; -using namespace quake3; - -//! This list is based on the original quake3. -static const SItemElement Quake3ItemElement [] = { -{ "item_health", - {"models/powerups/health/medium_cross.md3", - "models/powerups/health/medium_sphere.md3"}, - "sound/items/n_health.wav", - "icons/iconh_yellow", - "25 Health", - 25, - HEALTH, - SUB_NONE, - SPECIAL_SFX_BOUNCE | SPECIAL_SFX_ROTATE_1 -}, -{ "item_health_large", - "models/powerups/health/large_cross.md3", - "models/powerups/health/large_sphere.md3", - "sound/items/l_health.wav", - "icons/iconh_red", - "50 Health", - 50, - HEALTH, - SUB_NONE, - SPECIAL_SFX_BOUNCE | SPECIAL_SFX_ROTATE_1 -}, -{ - "item_health_mega", - "models/powerups/health/mega_cross.md3", - "models/powerups/health/mega_sphere.md3", - "sound/items/m_health.wav", - "icons/iconh_mega", - "Mega Health", - 100, - HEALTH, - SUB_NONE, - SPECIAL_SFX_BOUNCE | SPECIAL_SFX_ROTATE_1 -}, -{ - "item_health_small", - "models/powerups/health/small_cross.md3", - "models/powerups/health/small_sphere.md3", - "sound/items/s_health.wav", - "icons/iconh_green", - "5 Health", - 5, - HEALTH, - SUB_NONE, - SPECIAL_SFX_BOUNCE | SPECIAL_SFX_ROTATE_1 -}, -{ "ammo_bullets", - "models/powerups/ammo/machinegunam.md3", - "", - "sound/misc/am_pkup.wav", - "icons/icona_machinegun", - "Bullets", - 50, - AMMO, - MACHINEGUN, - SPECIAL_SFX_BOUNCE, -}, -{ - "ammo_cells", - "models/powerups/ammo/plasmaam.md3", - "", - "sound/misc/am_pkup.wav", - "icons/icona_plasma", - "Cells", - 30, - AMMO, - PLASMAGUN, - SPECIAL_SFX_BOUNCE -}, -{ "ammo_rockets", - "models/powerups/ammo/rocketam.md3", - "", - "", - "icons/icona_rocket", - "Rockets", - 5, - AMMO, - ROCKET_LAUNCHER, - SPECIAL_SFX_ROTATE -}, -{ - "ammo_shells", - "models/powerups/ammo/shotgunam.md3", - "", - "sound/misc/am_pkup.wav", - "icons/icona_shotgun", - "Shells", - 10, - AMMO, - SHOTGUN, - SPECIAL_SFX_ROTATE -}, -{ - "ammo_slugs", - "models/powerups/ammo/railgunam.md3", - "", - "sound/misc/am_pkup.wav", - "icons/icona_railgun", - "Slugs", - 10, - AMMO, - RAILGUN, - SPECIAL_SFX_ROTATE -}, -{ - "item_armor_body", - "models/powerups/armor/armor_red.md3", - "", - "sound/misc/ar2_pkup.wav", - "icons/iconr_red", - "Heavy Armor", - 100, - ARMOR, - SUB_NONE, - SPECIAL_SFX_ROTATE -}, -{ - "item_armor_combat", - "models/powerups/armor/armor_yel.md3", - "", - "sound/misc/ar2_pkup.wav", - "icons/iconr_yellow", - "Armor", - 50, - ARMOR, - SUB_NONE, - SPECIAL_SFX_ROTATE -}, -{ - "item_armor_shard", - "models/powerups/armor/shard.md3", - "", - "sound/misc/ar1_pkup.wav", - "icons/iconr_shard", - "Armor Shared", - 5, - ARMOR, - SUB_NONE, - SPECIAL_SFX_ROTATE -}, -{ - "weapon_gauntlet", - "models/weapons2/gauntlet/gauntlet.md3", - "", - "sound/misc/w_pkup.wav", - "icons/iconw_gauntlet", - "Gauntlet", - 0, - WEAPON, - GAUNTLET, - SPECIAL_SFX_ROTATE -}, -{ - "weapon_shotgun", - "models/weapons2/shotgun/shotgun.md3", - "", - "sound/misc/w_pkup.wav", - "icons/iconw_shotgun", - "Shotgun", - 10, - WEAPON, - SHOTGUN, - SPECIAL_SFX_ROTATE -}, -{ - "weapon_machinegun", - "models/weapons2/machinegun/machinegun.md3", - "", - "sound/misc/w_pkup.wav", - "icons/iconw_machinegun", - "Machinegun", - 40, - WEAPON, - MACHINEGUN, - SPECIAL_SFX_ROTATE -}, -{ - "weapon_grenadelauncher", - "models/weapons2/grenadel/grenadel.md3", - "", - "sound/misc/w_pkup.wav", - "icons/iconw_grenade", - "Grenade Launcher", - 10, - WEAPON, - GRENADE_LAUNCHER, - SPECIAL_SFX_ROTATE -}, -{ - "weapon_rocketlauncher", - "models/weapons2/rocketl/rocketl.md3", - "", - "sound/misc/w_pkup.wav", - "icons/iconw_rocket", - "Rocket Launcher", - 10, - WEAPON, - ROCKET_LAUNCHER, - SPECIAL_SFX_ROTATE -}, -{ - "weapon_lightning", - "models/weapons2/lightning/lightning.md3", - "", - "sound/misc/w_pkup.wav", - "icons/iconw_lightning", - "Lightning Gun", - 100, - WEAPON, - LIGHTNING, - SPECIAL_SFX_ROTATE -}, -{ - "weapon_railgun", - "models/weapons2/railgun/railgun.md3", - "", - "sound/misc/w_pkup.wav", - "icons/iconw_railgun", - "Railgun", - 10, - WEAPON, - RAILGUN, - SPECIAL_SFX_ROTATE -}, -{ - "weapon_plasmagun", - "models/weapons2/plasma/plasma.md3", - "", - "sound/misc/w_pkup.wav", - "icons/iconw_plasma", - "Plasma Gun", - 50, - WEAPON, - PLASMAGUN, - SPECIAL_SFX_ROTATE -}, -{ - "weapon_bfg", - "models/weapons2/bfg/bfg.md3", - "", - "sound/misc/w_pkup.wav", - "icons/iconw_bfg", - "BFG10K", - 20, - WEAPON, - BFG, - SPECIAL_SFX_ROTATE -}, -{ - "weapon_grapplinghook", - "models/weapons2/grapple/grapple.md3", - "", - "sound/misc/w_pkup.wav", - "icons/iconw_grapple", - "Grappling Hook", - 0, - WEAPON, - GRAPPLING_HOOK, - SPECIAL_SFX_ROTATE -}, -{ - 0 -} - -}; - - -/*! -*/ -const SItemElement * getItemElement ( const stringc& key ) -{ - const SItemElement *item = Quake3ItemElement; - - while ( item->key ) - { - if ( 0 == strcmp ( key.c_str(), item->key ) ) - return item; - item += 1; - } - return 0; -} - -/*! - Quake3 Model Factory. - Takes the mesh buffers and creates scenenodes for their associated shaders -*/ -void Q3ShaderFactory ( Q3LevelLoadParameter &loadParam, - IrrlichtDevice *device, - IQ3LevelMesh* mesh, - eQ3MeshIndex meshIndex, - ISceneNode *parent, - IMetaTriangleSelector *meta, - bool showShaderName ) -{ - if ( 0 == mesh || 0 == device ) - return; - - IMeshSceneNode* node = 0; - ISceneManager* smgr = device->getSceneManager(); - ITriangleSelector * selector = 0; - - // the additional mesh can be quite huge and is unoptimized - // Save to cast to SMesh - SMesh * additional_mesh = (SMesh*) mesh->getMesh ( meshIndex ); - if ( 0 == additional_mesh || additional_mesh->getMeshBufferCount() == 0) - return; - - char buf[128]; - if ( loadParam.verbose > 0 ) - { - loadParam.startTime = device->getTimer()->getRealTime(); - if ( loadParam.verbose > 1 ) - { - snprintf_irr(buf, 128, "q3shaderfactory start" ); - device->getLogger()->log( buf, ELL_INFORMATION); - } - } - - IGUIFont *font = 0; - if ( showShaderName ) - font = device->getGUIEnvironment()->getFont("fontlucida.png"); - - IVideoDriver *driver = device->getVideoDriver(); - - // create helper textures - if ( 1 ) - { - tTexArray tex; - u32 pos = 0; - getTextures ( tex, "$redimage $blueimage $whiteimage $checkerimage", pos, - device->getFileSystem(), driver ); - } - - s32 sceneNodeID = 0; - for ( u32 i = 0; i!= additional_mesh->getMeshBufferCount (); ++i ) - { - IMeshBuffer *meshBuffer = additional_mesh->getMeshBuffer ( i ); - const SMaterial &material = meshBuffer->getMaterial(); - - //! The ShaderIndex is stored in the second material parameter - s32 shaderIndex = (s32) material.MaterialTypeParam2; - - // the meshbuffer can be rendered without additional support, or it has no shader - IShader *shader = (IShader *) mesh->getShader ( shaderIndex ); - - // no shader, or mapped to existing material - if ( 0 == shader ) - { - -#if 1 - // clone mesh - SMesh * m = new SMesh (); - m->addMeshBuffer ( meshBuffer ); - SMaterial &mat = m->getMeshBuffer( 0 )->getMaterial(); - if ( mat.getTexture( 0 ) == 0 ) - mat.setTexture ( 0, driver->getTexture ( "$blueimage" ) ); - if ( mat.getTexture( 1 ) == 0 ) - mat.setTexture ( 1, driver->getTexture ( "$redimage" ) ); - - IMesh * store = smgr->getMeshManipulator ()->createMeshWith2TCoords ( m ); - m->drop(); - - node = smgr->addMeshSceneNode ( store, parent, sceneNodeID ); - node->setAutomaticCulling ( scene::EAC_OFF ); - store->drop (); - sceneNodeID += 1; -#endif - } - else if ( 1 ) - { -/* - stringc s; - dumpShader ( s, shader ); - printf ( s.c_str () ); -*/ - // create sceneNode - node = smgr->addQuake3SceneNode ( meshBuffer, shader, parent, sceneNodeID ); - node->setAutomaticCulling ( scene::EAC_FRUSTUM_BOX ); - sceneNodeID += 1; - } - - // show Debug Shader Name - if ( showShaderName && node ) - { - swprintf_irr ( (wchar_t*) buf, 64, L"%hs:%d", node->getName(),node->getID() ); - smgr->addBillboardTextSceneNode( - font, - (wchar_t*) buf, - node, - dimension2d(80.0f, 8.0f), - vector3df(0, 10, 0), - sceneNodeID); - sceneNodeID += 1; - } - - // create Portal Rendertargets - if ( shader ) - { - const SVarGroup *group = shader->getGroup(1); - if ( group->isDefined( "surfaceparm", "portal" ) ) - { - } - - } - - - // add collision - // find out if shader is marked as nonsolid - u8 doCreate = meta !=0 ; - - if ( shader ) - { - const SVarGroup *group = shader->getGroup(1); - if ( group->isDefined( "surfaceparm", "trans" ) - // || group->isDefined( "surfaceparm", "sky" ) - // || group->isDefined( "surfaceparm", "nonsolid" ) - ) - { - if ( !group->isDefined( "surfaceparm", "metalsteps" ) ) - { - doCreate = 0; - } - } - } - - if ( doCreate ) - { - IMesh *m = 0; - - //! controls if triangles are modified by the scenenode during runtime - bool takeOriginal = true; - - if ( takeOriginal ) - { - m = new SMesh (); - ((SMesh*) m )->addMeshBuffer (meshBuffer); - } - else - { - m = node->getMesh(); - } - - //selector = smgr->createOctreeTriangleSelector ( m, 0, 128 ); - selector = smgr->createTriangleSelector ( m, 0 ); - meta->addTriangleSelector ( selector ); - selector->drop (); - - if ( takeOriginal ) - { - delete m; - } - } - - } - -#if 0 - if ( meta ) - { - selector = smgr->createOctreeTriangleSelector ( additional_mesh, 0 ); - meta->addTriangleSelector ( selector ); - selector->drop (); - } -#endif - - if ( loadParam.verbose > 0 ) - { - loadParam.endTime = device->getTimer()->getRealTime (); - snprintf_irr(buf, 128, "q3shaderfactory needed %04d ms to create %d shader nodes", - loadParam.endTime - loadParam.startTime, - sceneNodeID - ); - device->getLogger()->log(buf, ELL_INFORMATION); - } - -} - - -/*! - create Items from Entity -*/ -void Q3ModelFactory ( Q3LevelLoadParameter &loadParam, - IrrlichtDevice *device, - IQ3LevelMesh* masterMesh, - ISceneNode *parent, - bool showShaderName - ) -{ - if ( 0 == masterMesh ) - return; - - tQ3EntityList &entity = masterMesh->getEntityList (); - ISceneManager* smgr = device->getSceneManager(); - - - char buf[128]; - const SVarGroup *group; - IEntity search; - s32 index; - s32 lastIndex; - -/* - stringc s; - FILE *f = 0; - f = fopen ( "entity.txt", "wb" ); - for ( index = 0; (u32) index < entityList.size (); ++index ) - { - const IEntity *entity = &entityList[ index ]; - s = entity->name; - dumpShader ( s, entity ); - fwrite ( s.c_str(), 1, s.size(), f ); - } - fclose ( f ); -*/ - IAnimatedMeshMD3* model; - SMD3Mesh * mesh; - const SMD3MeshBuffer *meshBuffer; - IMeshSceneNode* node; - ISceneNodeAnimator* anim; - const IShader *shader; - u32 pos; - vector3df p; - u32 nodeCount = 0; - tTexArray textureArray; - - IGUIFont *font = 0; - if ( showShaderName ) - font = device->getGUIEnvironment()->getFont("fontlucida.png"); - - const SItemElement *itemElement; - - // walk list - for ( index = 0; (u32) index < entity.size(); ++index ) - { - itemElement = getItemElement ( entity[index].name ); - if ( 0 == itemElement ) - continue; - - pos = 0; - p = getAsVector3df ( entity[index].getGroup(1)->get ( "origin" ), pos ); - - nodeCount += 1; - for ( u32 g = 0; g < 2; ++g ) - { - if ( 0 == itemElement->model[g] || itemElement->model[g][0] == 0 ) - continue; - model = (IAnimatedMeshMD3*) smgr->getMesh( itemElement->model[g] ); - if ( 0 == model ) - continue; - - mesh = model->getOriginalMesh(); - for ( u32 j = 0; j != mesh->Buffer.size (); ++j ) - { - meshBuffer = mesh->Buffer[j]; - if ( 0 == meshBuffer ) - continue; - - shader = masterMesh->getShader ( meshBuffer->Shader.c_str(), false ); - IMeshBuffer *final = model->getMesh(0)->getMeshBuffer(j); - if ( shader ) - { - //!TODO: Hack don't modify the vertexbuffer. make it better;-) - final->getMaterial().ColorMask = 0; - node = smgr->addQuake3SceneNode ( final, shader, parent ); - final->getMaterial().ColorMask = 15; - } - else - { - // clone mesh - SMesh * m = new SMesh (); - m->addMeshBuffer ( final ); - node = smgr->addMeshSceneNode ( m, parent ); - m->drop(); - } - - if ( 0 == node ) - { - snprintf_irr ( buf, 128, "q3ModelFactory shader %s failed", meshBuffer->Shader.c_str() ); - device->getLogger()->log ( buf ); - continue; - } - - // node was maybe centered by shaderscenenode - node->setPosition ( p ); - node->setName ( meshBuffer->Shader ); - node->setAutomaticCulling ( scene::EAC_BOX ); - - // add special effects to node - if ( itemElement->special & SPECIAL_SFX_ROTATE || - (g == 0 && itemElement->special & SPECIAL_SFX_ROTATE_1) - ) - { - anim = smgr->createRotationAnimator ( vector3df ( 0.f, - 2.f, 0.f ) ); - node->addAnimator ( anim ); - anim->drop (); - } - - if ( itemElement->special & SPECIAL_SFX_BOUNCE ) - { - //anim = smgr->createFlyStraightAnimator ( - // p, p + vector3df ( 0.f, 60.f, 0.f ), 1000, true, true ); - anim = smgr->createFlyCircleAnimator ( - p + vector3df( 0.f, 20.f, 0.f ), - 20.f, - 0.005f, - vector3df ( 1.f, 0.f, 0.f ), - core::fract ( nodeCount * 0.05f ), - 1.f - ); - node->addAnimator ( anim ); - anim->drop (); - } - } - } - // show name - if ( showShaderName ) - { - swprintf_irr ( (wchar_t*) buf, sizeof(buf) / 2, L"%hs", itemElement->key ); - smgr->addBillboardTextSceneNode( - font, - (wchar_t*) buf, - parent, - dimension2d(80.0f, 8.0f), - p + vector3df(0, 30, 0), - 0); - } - } - - // music - search.name = "worldspawn"; - index = entity.binary_search_multi ( search, lastIndex ); - - if ( index >= 0 ) - { - group = entity[ index ].getGroup(1); - background_music ( group->get ( "music" ).c_str () ); - } - - // music - search.name = "worldspawn"; - index = entity.binary_search_multi ( search, lastIndex ); - - if ( index >= 0 ) - { - group = entity[ index ].getGroup(1); - background_music ( group->get ( "music" ).c_str () ); - } - - //IAnimatedMesh* mesh = smgr->getMesh("../../media/sydney.md2"); - //IAnimatedMeshSceneNode* node = smgr->addAnimatedMeshSceneNode( mesh ); - -} - -/*! - so we need a good starting Position in the level. - we can ask the Quake3 Loader for all entities with class_name "info_player_deathmatch" -*/ -s32 Q3StartPosition ( IQ3LevelMesh* mesh, - ICameraSceneNode* camera, - s32 startposIndex, - const vector3df &translation - ) -{ - if ( 0 == mesh ) - return 0; - - tQ3EntityList &entityList = mesh->getEntityList (); - - IEntity search; - search.name = "info_player_start"; // "info_player_deathmatch"; - - // find all entities in the multi-list - s32 lastIndex; - s32 index = entityList.binary_search_multi ( search, lastIndex ); - - if ( index < 0 ) - { - search.name = "info_player_deathmatch"; - index = entityList.binary_search_multi ( search, lastIndex ); - } - - if ( index < 0 ) - return 0; - - index += core::clamp ( startposIndex, 0, lastIndex - index ); - - u32 parsepos; - - const SVarGroup *group; - group = entityList[ index ].getGroup(1); - - parsepos = 0; - vector3df pos = getAsVector3df ( group->get ( "origin" ), parsepos ); - pos += translation; - - parsepos = 0; - f32 angle = getAsFloat ( group->get ( "angle"), parsepos ); - - vector3df target ( 0.f, 0.f, 1.f ); - target.rotateXZBy ( angle - 90.f, vector3df () ); - - if ( camera ) - { - camera->setPosition ( pos ); - camera->setTarget ( pos + target ); - //! New. FPSCamera and animators catches reset on animate 0 - camera->OnAnimate ( 0 ); - } - return lastIndex - index + 1; -} - - -/*! - gets a accumulated force on a given surface -*/ -vector3df getGravity ( const c8 * surface ) -{ - if ( 0 == strcmp ( surface, "earth" ) ) return vector3df ( 0.f, -900.f, 0.f ); - if ( 0 == strcmp ( surface, "moon" ) ) return vector3df ( 0.f, -6.f , 0.f ); - if ( 0 == strcmp ( surface, "water" ) ) return vector3df ( 0.1f, -2.f, 0.f ); - if ( 0 == strcmp ( surface, "ice" ) ) return vector3df ( 0.2f, -9.f, 0.3f ); - - return vector3df ( 0.f, 0.f, 0.f ); -} - - - -/* - Dynamically load the Irrlicht Library -*/ - -#if defined(_IRR_WINDOWS_API_) -#ifdef _MSC_VER -#pragma comment(lib, "Irrlicht.lib") -#endif - -#include - -funcptr_createDevice load_createDevice ( const c8 * filename) -{ - return (funcptr_createDevice) GetProcAddress ( LoadLibrary ( filename ), "createDevice" ); -} - -funcptr_createDeviceEx load_createDeviceEx ( const c8 * filename) -{ - return (funcptr_createDeviceEx) GetProcAddress ( LoadLibrary ( filename ), "createDeviceEx" ); -} - -#else - -// TODO: Dynamic Loading for other os - -funcptr_createDevice load_createDevice ( const c8 * filename) -{ - return createDevice; -} - -funcptr_createDeviceEx load_createDeviceEx ( const c8 * filename) -{ - return createDeviceEx; -} - -#endif - -/* - get the current collision response camera animator -*/ -ISceneNodeAnimatorCollisionResponse* camCollisionResponse( IrrlichtDevice * device ) -{ - ICameraSceneNode *camera = device->getSceneManager()->getActiveCamera(); - ISceneNodeAnimatorCollisionResponse *a = 0; - - list::ConstIterator it = camera->getAnimators().begin(); - for (; it != camera->getAnimators().end(); ++it) - { - a = (ISceneNodeAnimatorCollisionResponse*) (*it); - if ( a->getType() == ESNAT_COLLISION_RESPONSE ) - return a; - } - - return 0; -} - - -//! internal Animation -void setTimeFire ( TimeFire *t, u32 delta, u32 flags ) -{ - t->flags = flags; - t->next = 0; - t->delta = delta; -} - - -void checkTimeFire ( TimeFire *t, u32 listSize, u32 now ) -{ - u32 i; - for ( i = 0; i < listSize; ++i ) - { - if ( now < t[i].next ) - continue; - - t[i].next = core::max_ ( now + t[i].delta, t[i].next + t[i].delta ); - t[i].flags |= FIRED; - } -} diff --git a/examples/21.Quake3Explorer/q3factory.h b/examples/21.Quake3Explorer/q3factory.h deleted file mode 100644 index d9606ed0..00000000 --- a/examples/21.Quake3Explorer/q3factory.h +++ /dev/null @@ -1,149 +0,0 @@ -/*! - Model Factory. - create the additional scenenodes for ( bullets, health... ) - - Defines the Entities for Quake3 -*/ -#ifndef __QUAKE3_FACTORY__H_INCLUDED__ -#define __QUAKE3_FACTORY__H_INCLUDED__ - -using namespace irr; -using namespace scene; -using namespace gui; -using namespace video; -using namespace core; -using namespace quake3; -using namespace io; - - - -//! Defines to which group the entities belong -enum eItemGroup -{ - WEAPON, - AMMO, - ARMOR, - HEALTH, - POWERUP -}; - -//! define a supgroup for the item. for e.q the Weapons -enum eItemSubGroup -{ - SUB_NONE = 0, - GAUNTLET, - MACHINEGUN, - SHOTGUN, - GRENADE_LAUNCHER, - ROCKET_LAUNCHER, - LIGHTNING, - RAILGUN, - PLASMAGUN, - BFG, - GRAPPLING_HOOK, - NAILGUN, - PROX_LAUNCHER, - CHAINGUN, -}; - -//! aplly a special effect to the shader -enum eItemSpecialEffect -{ - SPECIAL_SFX_NONE = 0, - SPECIAL_SFX_ROTATE = 1, - SPECIAL_SFX_BOUNCE = 2, - SPECIAL_SFX_ROTATE_1 = 4, -}; - -// a List for defining a model -struct SItemElement -{ - const c8 *key; - const c8 *model[2]; - const c8 *sound; - const c8 *icon; - const c8 *pickup; - s32 value; - eItemGroup group; - eItemSubGroup sub; - u32 special; -}; - - -//! Get's an entity based on it's key -const SItemElement * getItemElement ( const stringc& key ); - -/*! - Quake3 Model Factory. - Takes the mesh buffers and creates scenenodes for their associated shaders -*/ -void Q3ShaderFactory ( Q3LevelLoadParameter &loadParam, - IrrlichtDevice *device, - IQ3LevelMesh* mesh, - eQ3MeshIndex meshIndex, - ISceneNode *parent, - IMetaTriangleSelector *meta, - bool showShaderName - ); - - -/*! - Creates Model based on the entity list -*/ -void Q3ModelFactory ( Q3LevelLoadParameter &loadParam, - IrrlichtDevice *device, - IQ3LevelMesh* masterMesh, - ISceneNode *parent, - bool showShaderName - ); - -/*! - so we need a good starting Position in the level. - we can ask the Quake3 Loader for all entities with class_name "info_player_deathmatch" -*/ -s32 Q3StartPosition ( IQ3LevelMesh* mesh, - ICameraSceneNode* camera, - s32 startposIndex, - const vector3df &translation - ); -/*! - gets a accumulated force on a given surface -*/ -vector3df getGravity ( const c8 * surface ); - - -/* - Dynamically load the Irrlicht Library -*/ -funcptr_createDevice load_createDevice ( const c8 * filename); -funcptr_createDeviceEx load_createDeviceEx ( const c8 * filename); - - -//! Macro for save Dropping an Element -#define dropElement(x) if (x) { x->remove(); x = 0; } - - -/* - get the current collision respone camera animator -*/ -ISceneNodeAnimatorCollisionResponse* camCollisionResponse( IrrlichtDevice * device ); - -//! internal Animation -enum eTimeFireFlag -{ - FIRED = 1, -}; - -struct TimeFire -{ - u32 flags; - u32 next; - u32 delta; -}; - -void setTimeFire ( TimeFire *t, u32 delta, u32 flags = 0 ); -void checkTimeFire ( TimeFire *t, u32 listSize, u32 now ); - -#endif // __QUAKE3_FACTORY__H_INCLUDED__ - - diff --git a/examples/21.Quake3Explorer/sound.cpp b/examples/21.Quake3Explorer/sound.cpp deleted file mode 100644 index f693e660..00000000 --- a/examples/21.Quake3Explorer/sound.cpp +++ /dev/null @@ -1,98 +0,0 @@ -/*! - Sound Factory. - provides a sound interface - -*/ - -#include "sound.h" - - -//#define USE_IRRKLANG - -#ifdef USE_IRRKLANG - -#include -#ifdef _MSC_VER - #pragma comment (lib, "irrKlang.lib") -#endif - -using namespace irrklang; - -struct soundfile: public IFileReader -{ - soundfile ( io::IReadFile* f ): file (f ) {} - virtual ~soundfile () { file->drop (); } - - virtual ik_s32 read(void* buffer, ik_u32 sizeToRead) { return file->read ( buffer, sizeToRead ); } - virtual bool seek(ik_s32 finalPos, bool relativeMovement = false) { return file->seek ( finalPos, relativeMovement ); } - virtual ik_s32 getSize(){ return file->getSize (); } - virtual ik_s32 getPos() {return file->getPos (); } - virtual const ik_c8* getFileName() { return file->getFileName().c_str(); } - io::IReadFile* file; -}; - -struct klangFactory : public irrklang::IFileFactory -{ - klangFactory ( IrrlichtDevice *device ) { Device = device; } - - virtual irrklang::IFileReader* createFileReader(const ik_c8* filename) - { - io::IReadFile* file = Device->getFileSystem()->createAndOpenFile(filename); - if ( 0 == file ) - return 0; - - return new soundfile ( file ); - } - - IrrlichtDevice *Device; -}; - -ISoundEngine *engine = 0; -ISound *backMusic = 0; - -void sound_init ( IrrlichtDevice *device ) -{ - engine = createIrrKlangDevice (); - if ( 0 == engine ) - return; - - klangFactory *f = new klangFactory ( device ); - engine->addFileFactory ( f ); -} - -void sound_shutdown () -{ - if ( backMusic ) - backMusic->drop (); - - if ( engine ) - engine->drop (); -} - -void background_music ( const c8 * file ) -{ - if ( 0 == engine ) - return; - - if ( backMusic ) - { - backMusic->stop (); - backMusic->drop (); - } - - backMusic = engine->play2D ( file, true, false, true ); - - if ( backMusic ) - { - backMusic->setVolume ( 0.5f ); - } -} - -#else - -void sound_init ( IrrlichtDevice *device ) {} -void sound_shutdown () {} -void background_music ( const c8 * file ) {} - -#endif - diff --git a/examples/21.Quake3Explorer/sound.h b/examples/21.Quake3Explorer/sound.h deleted file mode 100644 index 033e9bb6..00000000 --- a/examples/21.Quake3Explorer/sound.h +++ /dev/null @@ -1,18 +0,0 @@ -/*! - Sound Factory. - provides a sound interface - -*/ -#ifndef __QUAKE3_SOUND__H_INCLUDED__ -#define __QUAKE3_SOUND__H_INCLUDED__ - -#include - -using namespace irr; - -void sound_init ( IrrlichtDevice *device ); -void sound_shutdown (); -void background_music ( const c8 * file ); - - -#endif // __QUAKE3_SOUND__H_INCLUDED__ diff --git a/examples/22.MaterialViewer/Makefile b/examples/22.MaterialViewer/Makefile deleted file mode 100644 index fcbdc22e..00000000 --- a/examples/22.MaterialViewer/Makefile +++ /dev/null @@ -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 := 22.MaterialViewer -# 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 diff --git a/examples/22.MaterialViewer/MaterialViewer.cbp b/examples/22.MaterialViewer/MaterialViewer.cbp deleted file mode 100644 index 7d4a0624..00000000 --- a/examples/22.MaterialViewer/MaterialViewer.cbp +++ /dev/null @@ -1,74 +0,0 @@ - - - - - - diff --git a/examples/22.MaterialViewer/MaterialViewer.vcproj b/examples/22.MaterialViewer/MaterialViewer.vcproj deleted file mode 100644 index 7419359f..00000000 --- a/examples/22.MaterialViewer/MaterialViewer.vcproj +++ /dev/null @@ -1,229 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/examples/22.MaterialViewer/MaterialViewer.xcodeproj/project.pbxproj b/examples/22.MaterialViewer/MaterialViewer.xcodeproj/project.pbxproj deleted file mode 100644 index c278e231..00000000 --- a/examples/22.MaterialViewer/MaterialViewer.xcodeproj/project.pbxproj +++ /dev/null @@ -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 /* 22.MaterialViewer.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = 22.MaterialViewer.app; sourceTree = BUILT_PRODUCTS_DIR; }; - 5E34CC741B7F8EEF00F212E8 /* main.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = main.cpp; sourceTree = ""; }; - 5E34CC781B7F90A000F212E8 /* libIrrlicht.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libIrrlicht.a; path = ../../lib/OSX/libIrrlicht.a; sourceTree = ""; }; - 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 = ""; }; -/* 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 = ""; - }; - 5E34CC521B7F8E6E00F212E8 /* Products */ = { - isa = PBXGroup; - children = ( - 5E34CC511B7F8E6E00F212E8 /* 22.MaterialViewer.app */, - ); - name = Products; - sourceTree = ""; - }; - 5E34CC761B7F905600F212E8 /* Libraries */ = { - isa = PBXGroup; - children = ( - 5E8570B01B7F99F500B267D2 /* Cocoa.framework */, - 5E8570B41B7F9A0700B267D2 /* IOKit.framework */, - 5E8570B21B7F99FE00B267D2 /* OpenGL.framework */, - 5E34CC781B7F90A000F212E8 /* libIrrlicht.a */, - ); - name = Libraries; - sourceTree = ""; - }; - 5E34CC771B7F906D00F212E8 /* Resources */ = { - isa = PBXGroup; - children = ( - 5E8570BE1B7F9D3A00B267D2 /* media */, - ); - name = Resources; - sourceTree = ""; - }; -/* End PBXGroup section */ - -/* Begin PBXNativeTarget section */ - 5E34CC501B7F8E6E00F212E8 /* 22.MaterialViewer */ = { - isa = PBXNativeTarget; - buildConfigurationList = 5E34CC701B7F8E6E00F212E8 /* Build configuration list for PBXNativeTarget "22.MaterialViewer" */; - buildPhases = ( - 5E34CC4D1B7F8E6E00F212E8 /* Sources */, - 5E34CC4E1B7F8E6E00F212E8 /* Frameworks */, - 5E34CC4F1B7F8E6E00F212E8 /* Resources */, - ); - buildRules = ( - ); - dependencies = ( - ); - name = 22.MaterialViewer; - productName = 01.HelloWorld; - productReference = 5E34CC511B7F8E6E00F212E8 /* 22.MaterialViewer.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 "MaterialViewer" */; - compatibilityVersion = "Xcode 3.2"; - developmentRegion = English; - hasScannedForEncodings = 0; - knownRegions = ( - en, - Base, - ); - mainGroup = 5E34C6D81B7F4A0C00F212E8; - productRefGroup = 5E34CC521B7F8E6E00F212E8 /* Products */; - projectDirPath = ""; - projectRoot = ""; - targets = ( - 5E34CC501B7F8E6E00F212E8 /* 22.MaterialViewer */, - ); - }; -/* 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 "MaterialViewer" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 5E34C6DD1B7F4A0C00F212E8 /* Debug */, - 5E34C6DE1B7F4A0C00F212E8 /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - 5E34CC701B7F8E6E00F212E8 /* Build configuration list for PBXNativeTarget "22.MaterialViewer" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 5E34CC6C1B7F8E6E00F212E8 /* Debug */, - 5E34CC6D1B7F8E6E00F212E8 /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; -/* End XCConfigurationList section */ - }; - rootObject = 5E34C6D91B7F4A0C00F212E8 /* Project object */; -} diff --git a/examples/22.MaterialViewer/MaterialViewer.xcodeproj/xcshareddata/xcschemes/22.MaterialViewer.xcscheme b/examples/22.MaterialViewer/MaterialViewer.xcodeproj/xcshareddata/xcschemes/22.MaterialViewer.xcscheme deleted file mode 100644 index eed2899f..00000000 --- a/examples/22.MaterialViewer/MaterialViewer.xcodeproj/xcshareddata/xcschemes/22.MaterialViewer.xcscheme +++ /dev/null @@ -1,91 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/examples/22.MaterialViewer/MaterialViewer_vc10.vcxproj b/examples/22.MaterialViewer/MaterialViewer_vc10.vcxproj deleted file mode 100644 index 5e5560bd..00000000 --- a/examples/22.MaterialViewer/MaterialViewer_vc10.vcxproj +++ /dev/null @@ -1,234 +0,0 @@ - - - - - Debug - Win32 - - - Debug - x64 - - - Release - Win32 - - - Release - x64 - - - - 22.MaterialViewer - {4E6C2F8D-BA92-4C5B-96FD-72D4FE8BD7FA} - MaterialViewer - - - - Application - MultiByte - Windows7.1SDK - - - Application - MultiByte - Windows7.1SDK - - - Application - MultiByte - Windows7.1SDK - - - Application - MultiByte - Windows7.1SDK - - - - - - - - - - - - - - - - - - - - - - - <_ProjectFileVersion>10.0.30319.1 - ..\..\bin\Win32-VisualStudio\ - ..\..\bin\Win64-VisualStudio\ - - - ..\..\bin\Win32-VisualStudio\ - ..\..\bin\Win64-VisualStudio\ - - - AllRules.ruleset - AllRules.ruleset - - - - - AllRules.ruleset - AllRules.ruleset - - - - - - - - .\Release/MaterialViewer.tlb - - - - - MaxSpeed - OnlyExplicitInline - ..\..\include;%(AdditionalIncludeDirectories) - WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) - true - MultiThreaded - true - - - Level3 - - - NDEBUG;%(PreprocessorDefinitions) - 0x0c07 - - - ..\..\bin\Win32-VisualStudio\22.MaterialViewer.exe - ..\..\lib\Win32-visualstudio;%(AdditionalLibraryDirectories) - .\Release/MaterialViewer.pdb - Console - - - - - - - .\Release/MaterialViewer.tlb - - - - - MaxSpeed - OnlyExplicitInline - ..\..\include;%(AdditionalIncludeDirectories) - WIN32;WIN64;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) - true - MultiThreaded - true - - - Level3 - - - NDEBUG;%(PreprocessorDefinitions) - 0x0c07 - - - ..\..\bin\Win64-VisualStudio\22.MaterialViewer.exe - ..\..\lib\Win64-visualstudio;%(AdditionalLibraryDirectories) - .\Release/MaterialViewer.pdb - Console - - - - - - - .\Debug/MaterialViewer.tlb - - - - - Disabled - ..\..\include;%(AdditionalIncludeDirectories) - WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebug - - - Level3 - EditAndContinue - - - _DEBUG;%(PreprocessorDefinitions) - 0x0c07 - - - ..\..\bin\Win32-VisualStudio\22.MaterialViewer.exe - ..\..\lib\Win32-visualstudio;%(AdditionalLibraryDirectories) - true - Console - - - - - - - .\Debug/MaterialViewer.tlb - - - - - Disabled - ..\..\include;%(AdditionalIncludeDirectories) - WIN32;WIN64;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebug - - - Level3 - ProgramDatabase - - - _DEBUG;%(PreprocessorDefinitions) - 0x0c07 - - - ..\..\bin\Win64-VisualStudio\22.MaterialViewer.exe - ..\..\lib\Win64-visualstudio;%(AdditionalLibraryDirectories) - true - .\Debug/MaterialViewer.pdb - Console - - - - - - - Disabled - Disabled - %(AdditionalIncludeDirectories) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(PreprocessorDefinitions) - EnableFastChecks - EnableFastChecks - MaxSpeed - MaxSpeed - %(AdditionalIncludeDirectories) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(PreprocessorDefinitions) - - - - - - \ No newline at end of file diff --git a/examples/22.MaterialViewer/MaterialViewer_vc11.vcxproj b/examples/22.MaterialViewer/MaterialViewer_vc11.vcxproj deleted file mode 100644 index 582faee9..00000000 --- a/examples/22.MaterialViewer/MaterialViewer_vc11.vcxproj +++ /dev/null @@ -1,235 +0,0 @@ - - - - - Debug - Win32 - - - Debug - x64 - - - Release - Win32 - - - Release - x64 - - - - 22.MaterialViewer - {4E6C2F8D-BA92-4C5B-96FD-72D4FE8BD7FA} - MaterialViewer - - - - Application - MultiByte - Windows7.1SDK - - - Application - MultiByte - Windows7.1SDK - - - Application - MultiByte - Windows7.1SDK - - - Application - MultiByte - Windows7.1SDK - - - - - - - - - - - - - - - - - - - - - - - <_ProjectFileVersion>10.0.30319.1 - ..\..\bin\Win32-VisualStudio\ - ..\..\bin\Win64-VisualStudio\ - - - ..\..\bin\Win32-VisualStudio\ - ..\..\bin\Win64-VisualStudio\ - - - AllRules.ruleset - AllRules.ruleset - - - - - AllRules.ruleset - AllRules.ruleset - - - - - - - - .\Release/MaterialViewer.tlb - - - - - MaxSpeed - OnlyExplicitInline - ..\..\include;%(AdditionalIncludeDirectories) - WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) - true - MultiThreaded - true - - - Level3 - - - NDEBUG;%(PreprocessorDefinitions) - 0x0c07 - - - ..\..\bin\Win32-VisualStudio\22.MaterialViewer.exe - ..\..\lib\Win32-visualstudio;%(AdditionalLibraryDirectories) - .\Release/MaterialViewer.pdb - Console - - - - - - - .\Release/MaterialViewer.tlb - - - - - MaxSpeed - OnlyExplicitInline - ..\..\include;%(AdditionalIncludeDirectories) - WIN32;WIN64;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) - true - MultiThreaded - true - - - Level3 - - - NDEBUG;%(PreprocessorDefinitions) - 0x0c07 - - - ..\..\bin\Win64-VisualStudio\22.MaterialViewer.exe - ..\..\lib\Win64-visualstudio;%(AdditionalLibraryDirectories) - .\Release/MaterialViewer.pdb - Console - - - - - - - .\Debug/MaterialViewer.tlb - - - - - Disabled - ..\..\include;%(AdditionalIncludeDirectories) - WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebug - - - Level3 - EditAndContinue - - - _DEBUG;%(PreprocessorDefinitions) - 0x0c07 - - - ..\..\bin\Win32-VisualStudio\22.MaterialViewer.exe - ..\..\lib\Win32-visualstudio;%(AdditionalLibraryDirectories) - true - .\Debug/MaterialViewer.pdb - Console - - - - - - - .\Debug/MaterialViewer.tlb - - - - - Disabled - ..\..\include;%(AdditionalIncludeDirectories) - WIN32;WIN64;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebug - - - Level3 - ProgramDatabase - - - _DEBUG;%(PreprocessorDefinitions) - 0x0c07 - - - ..\..\bin\Win64-VisualStudio\22.MaterialViewer.exe - ..\..\lib\Win64-visualstudio;%(AdditionalLibraryDirectories) - true - .\Debug/MaterialViewer.pdb - Console - - - - - - - Disabled - Disabled - %(AdditionalIncludeDirectories) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(PreprocessorDefinitions) - EnableFastChecks - EnableFastChecks - MaxSpeed - MaxSpeed - %(AdditionalIncludeDirectories) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(PreprocessorDefinitions) - - - - - - \ No newline at end of file diff --git a/examples/22.MaterialViewer/MaterialViewer_vc12.vcxproj b/examples/22.MaterialViewer/MaterialViewer_vc12.vcxproj deleted file mode 100644 index ca494237..00000000 --- a/examples/22.MaterialViewer/MaterialViewer_vc12.vcxproj +++ /dev/null @@ -1,235 +0,0 @@ - - - - - Debug - Win32 - - - Debug - x64 - - - Release - Win32 - - - Release - x64 - - - - 22.MaterialViewer - {4E6C2F8D-BA92-4C5B-96FD-72D4FE8BD7FA} - MaterialViewer - - - - Application - MultiByte - Windows7.1SDK - - - Application - MultiByte - Windows7.1SDK - - - Application - MultiByte - Windows7.1SDK - - - Application - MultiByte - Windows7.1SDK - - - - - - - - - - - - - - - - - - - - - - - <_ProjectFileVersion>10.0.30319.1 - ..\..\bin\Win32-VisualStudio\ - ..\..\bin\Win64-VisualStudio\ - - - ..\..\bin\Win32-VisualStudio\ - ..\..\bin\Win64-VisualStudio\ - - - AllRules.ruleset - AllRules.ruleset - - - - - AllRules.ruleset - AllRules.ruleset - - - - - - - - .\Release/MaterialViewer.tlb - - - - - MaxSpeed - OnlyExplicitInline - ..\..\include;%(AdditionalIncludeDirectories) - WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) - true - MultiThreaded - true - - - Level3 - - - NDEBUG;%(PreprocessorDefinitions) - 0x0c07 - - - ..\..\bin\Win32-VisualStudio\22.MaterialViewer.exe - ..\..\lib\Win32-visualstudio;%(AdditionalLibraryDirectories) - .\Release/MaterialViewer.pdb - Console - - - - - - - .\Release/MaterialViewer.tlb - - - - - MaxSpeed - OnlyExplicitInline - ..\..\include;%(AdditionalIncludeDirectories) - WIN32;WIN64;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) - true - MultiThreaded - true - - - Level3 - - - NDEBUG;%(PreprocessorDefinitions) - 0x0c07 - - - ..\..\bin\Win64-VisualStudio\22.MaterialViewer.exe - ..\..\lib\Win64-visualstudio;%(AdditionalLibraryDirectories) - .\Release/MaterialViewer.pdb - Console - - - - - - - .\Debug/MaterialViewer.tlb - - - - - Disabled - ..\..\include;%(AdditionalIncludeDirectories) - WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebug - - - Level3 - EditAndContinue - - - _DEBUG;%(PreprocessorDefinitions) - 0x0c07 - - - ..\..\bin\Win32-VisualStudio\22.MaterialViewer.exe - ..\..\lib\Win32-visualstudio;%(AdditionalLibraryDirectories) - true - .\Debug/MaterialViewer.pdb - Console - - - - - - - .\Debug/MaterialViewer.tlb - - - - - Disabled - ..\..\include;%(AdditionalIncludeDirectories) - WIN32;WIN64;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebug - - - Level3 - ProgramDatabase - - - _DEBUG;%(PreprocessorDefinitions) - 0x0c07 - - - ..\..\bin\Win64-VisualStudio\22.MaterialViewer.exe - ..\..\lib\Win64-visualstudio;%(AdditionalLibraryDirectories) - true - .\Debug/MaterialViewer.pdb - Console - - - - - - - Disabled - Disabled - %(AdditionalIncludeDirectories) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(PreprocessorDefinitions) - EnableFastChecks - EnableFastChecks - MaxSpeed - MaxSpeed - %(AdditionalIncludeDirectories) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(PreprocessorDefinitions) - - - - - - \ No newline at end of file diff --git a/examples/22.MaterialViewer/MaterialViewer_vc14.vcxproj b/examples/22.MaterialViewer/MaterialViewer_vc14.vcxproj deleted file mode 100644 index f568176e..00000000 --- a/examples/22.MaterialViewer/MaterialViewer_vc14.vcxproj +++ /dev/null @@ -1,235 +0,0 @@ - - - - - Debug - Win32 - - - Debug - x64 - - - Release - Win32 - - - Release - x64 - - - - 22.MaterialViewer - {4E6C2F8D-BA92-4C5B-96FD-72D4FE8BD7FA} - MaterialViewer - - - - Application - MultiByte - v140 - - - Application - MultiByte - v140 - - - Application - MultiByte - v140 - - - Application - MultiByte - v140 - - - - - - - - - - - - - - - - - - - - - - - <_ProjectFileVersion>10.0.30319.1 - ..\..\bin\Win32-VisualStudio\ - ..\..\bin\Win64-VisualStudio\ - - - ..\..\bin\Win32-VisualStudio\ - ..\..\bin\Win64-VisualStudio\ - - - AllRules.ruleset - AllRules.ruleset - - - - - AllRules.ruleset - AllRules.ruleset - - - - - - - - .\Release/MaterialViewer.tlb - - - - - MaxSpeed - OnlyExplicitInline - ..\..\include;%(AdditionalIncludeDirectories) - WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) - true - MultiThreaded - true - - - Level3 - - - NDEBUG;%(PreprocessorDefinitions) - 0x0c07 - - - ..\..\bin\Win32-VisualStudio\22.MaterialViewer.exe - ..\..\lib\Win32-visualstudio;%(AdditionalLibraryDirectories) - .\Release/MaterialViewer.pdb - Console - - - - - - - .\Release/MaterialViewer.tlb - - - - - MaxSpeed - OnlyExplicitInline - ..\..\include;%(AdditionalIncludeDirectories) - WIN32;WIN64;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) - true - MultiThreaded - true - - - Level3 - - - NDEBUG;%(PreprocessorDefinitions) - 0x0c07 - - - ..\..\bin\Win64-VisualStudio\22.MaterialViewer.exe - ..\..\lib\Win64-visualstudio;%(AdditionalLibraryDirectories) - .\Release/MaterialViewer.pdb - Console - - - - - - - .\Debug/MaterialViewer.tlb - - - - - Disabled - ..\..\include;%(AdditionalIncludeDirectories) - WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebug - - - Level3 - EditAndContinue - - - _DEBUG;%(PreprocessorDefinitions) - 0x0c07 - - - ..\..\bin\Win32-VisualStudio\22.MaterialViewer.exe - ..\..\lib\Win32-visualstudio;%(AdditionalLibraryDirectories) - true - .\Debug/MaterialViewer.pdb - Console - - - - - - - .\Debug/MaterialViewer.tlb - - - - - Disabled - ..\..\include;%(AdditionalIncludeDirectories) - WIN32;WIN64;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebug - - - Level3 - ProgramDatabase - - - _DEBUG;%(PreprocessorDefinitions) - 0x0c07 - - - ..\..\bin\Win64-VisualStudio\22.MaterialViewer.exe - ..\..\lib\Win64-visualstudio;%(AdditionalLibraryDirectories) - true - .\Debug/MaterialViewer.pdb - Console - - - - - - - Disabled - Disabled - %(AdditionalIncludeDirectories) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(PreprocessorDefinitions) - EnableFastChecks - EnableFastChecks - MaxSpeed - MaxSpeed - %(AdditionalIncludeDirectories) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(PreprocessorDefinitions) - - - - - - \ No newline at end of file diff --git a/examples/22.MaterialViewer/main.cpp b/examples/22.MaterialViewer/main.cpp deleted file mode 100755 index 358ce02c..00000000 --- a/examples/22.MaterialViewer/main.cpp +++ /dev/null @@ -1,1047 +0,0 @@ -/** Example 022 Material Viewer - -This example can be used to play around with material settings and watch the results. -Only the default non-shader materials are used in here. - -You have a node with a mesh, one dynamic light and global ambient light to play around with. -You can move the light with cursor-keys and +/-. -You can move the camera while left-mouse button is clicked. -*/ - -// TODO: Should be possible to set all material values by the GUI. -// For now just change the defaultMaterial in CApp::init for the rest. -// TODO: Allow users to switch between a sphere and a box mesh. - -#include -#include "driverChoice.h" -#include "exampleHelper.h" -#include "main.h" - -using namespace irr; - -#ifdef _MSC_VER -#pragma comment(lib, "Irrlicht.lib") -#endif - -/* - Variables within the empty namespace are globals which are restricted to this file. -*/ -namespace -{ - // For the gui id's - enum EGUI_IDS - { - GUI_ID_OPEN_TEXTURE = 1, - GUI_ID_QUIT, - GUI_ID_MAX - }; - - // Name used in texture selection to clear the textures on the node - const core::stringw CLEAR_TEXTURE = L"CLEAR texture"; - - // some useful color constants - const video::SColor SCOL_BLACK = video::SColor(255, 0, 0, 0); - const video::SColor SCOL_BLUE = video::SColor(255, 0, 0, 255); - const video::SColor SCOL_CYAN = video::SColor(255, 0, 255, 255); - const video::SColor SCOL_GRAY = video::SColor(255, 128,128, 128); - const video::SColor SCOL_GREEN = video::SColor(255, 0, 255, 0); - const video::SColor SCOL_MAGENTA = video::SColor(255, 255, 0, 255); - const video::SColor SCOL_RED = video::SColor(255, 255, 0, 0); - const video::SColor SCOL_YELLOW = video::SColor(255, 255, 255, 0); - const video::SColor SCOL_WHITE = video::SColor(255, 255, 255, 255); -}; // namespace - -/* - Returns a new unique number on each call. -*/ -s32 makeUniqueId() -{ - static int unique = GUI_ID_MAX; - ++unique; - return unique; -} - -/* - Find out which vertex-type is needed for the given material type. -*/ -video::E_VERTEX_TYPE getVertexTypeForMaterialType(video::E_MATERIAL_TYPE materialType) -{ - using namespace video; - - switch ( materialType ) - { - case EMT_SOLID: - return EVT_STANDARD; - - case EMT_SOLID_2_LAYER: - return EVT_STANDARD; - - case EMT_LIGHTMAP: - case EMT_LIGHTMAP_ADD: - case EMT_LIGHTMAP_M2: - case EMT_LIGHTMAP_M4: - case EMT_LIGHTMAP_LIGHTING: - case EMT_LIGHTMAP_LIGHTING_M2: - case EMT_LIGHTMAP_LIGHTING_M4: - return EVT_2TCOORDS; - - case EMT_DETAIL_MAP: - return EVT_2TCOORDS; - - case EMT_SPHERE_MAP: - return EVT_STANDARD; - - case EMT_REFLECTION_2_LAYER: - return EVT_2TCOORDS; - - case EMT_TRANSPARENT_ADD_COLOR: - return EVT_STANDARD; - - case EMT_TRANSPARENT_ALPHA_CHANNEL: - return EVT_STANDARD; - - case EMT_TRANSPARENT_ALPHA_CHANNEL_REF: - return EVT_STANDARD; - - case EMT_TRANSPARENT_VERTEX_ALPHA: - return EVT_STANDARD; - - case EMT_TRANSPARENT_REFLECTION_2_LAYER: - return EVT_2TCOORDS; - - case EMT_NORMAL_MAP_SOLID: - case EMT_NORMAL_MAP_TRANSPARENT_ADD_COLOR: - case EMT_NORMAL_MAP_TRANSPARENT_VERTEX_ALPHA: - case EMT_PARALLAX_MAP_SOLID: - case EMT_PARALLAX_MAP_TRANSPARENT_ADD_COLOR: - case EMT_PARALLAX_MAP_TRANSPARENT_VERTEX_ALPHA: - return EVT_TANGENTS; - - case EMT_ONETEXTURE_BLEND: - return EVT_STANDARD; - - case EMT_FORCE_32BIT: - return EVT_STANDARD; - } - return EVT_STANDARD; -} - -/* - Custom GUI-control to edit colorvalues. -*/ -// Constructor -CColorControl::CColorControl(gui::IGUIEnvironment* guiEnv, const core::position2d & pos, const wchar_t *text, IGUIElement* parent, s32 id) - : gui::IGUIElement(gui::EGUIET_ELEMENT, guiEnv, parent,id, core::rect< s32 >(pos, pos+core::dimension2d(80, 75))) - , DirtyFlag(true) - , Color(0) - , ColorStatic(0) - , EditAlpha(0) - , EditRed(0) - , EditGreen(0) - , EditBlue(0) -{ - using namespace gui; - ButtonSetId = makeUniqueId(); - - const core::rect< s32 > rectControls(0,0,AbsoluteRect.getWidth(),AbsoluteRect.getHeight() ); - IGUIStaticText * groupElement = guiEnv->addStaticText (L"", rectControls, true, false, this, -1, false); - groupElement->setNotClipped(true); - - guiEnv->addStaticText (text, core::rect(0,0,80,15), false, false, groupElement, -1, false); - - EditAlpha = addEditForNumbers(guiEnv, core::position2d(0,15), L"a", -1, groupElement ); - EditRed = addEditForNumbers(guiEnv, core::position2d(0,30), L"r", -1, groupElement ); - EditGreen = addEditForNumbers(guiEnv, core::position2d(0,45), L"g", -1, groupElement ); - EditBlue = addEditForNumbers(guiEnv, core::position2d(0,60), L"b", -1, groupElement ); - - ColorStatic = guiEnv->addStaticText (L"", core::rect(60,15,80,75), true, false, groupElement, -1, true); - - guiEnv->addButton (core::rect(60,35,80,50), groupElement, ButtonSetId, L"set"); - setEditsFromColor(Color); -} - -// event receiver -bool CColorControl::OnEvent(const SEvent &event) -{ - if ( event.EventType != EET_GUI_EVENT ) - return false; - - if ( event.GUIEvent.Caller->getID() == ButtonSetId && event.GUIEvent.EventType == gui::EGET_BUTTON_CLICKED ) - { - Color = getColorFromEdits(); - setEditsFromColor(Color); - } - - return false; -} - -// set the color values -void CColorControl::setColor(const video::SColor& col) -{ - DirtyFlag = true; - Color = col; - setEditsFromColor(Color); -} - -// Add a staticbox for a description + an editbox so users can enter numbers -gui::IGUIEditBox* CColorControl::addEditForNumbers(gui::IGUIEnvironment* guiEnv, const core::position2d & pos, const wchar_t *text, s32 id, gui::IGUIElement * parent) -{ - using namespace gui; - - core::rect< s32 > rect(pos, pos+core::dimension2d(10, 15)); - guiEnv->addStaticText (text, rect, false, false, parent, -1, false); - rect += core::position2d( 20, 0 ); - rect.LowerRightCorner.X += 20; - gui::IGUIEditBox* edit = guiEnv->addEditBox(L"0", rect, true, parent, id); - return edit; -} - -// Get the color value from the editfields -video::SColor CColorControl::getColorFromEdits() const -{ - video::SColor col; - - if (EditAlpha) - { - u32 alpha = core::strtoul10(core::stringc(EditAlpha->getText()).c_str()); - if (alpha > 255) - alpha = 255; - col.setAlpha(alpha); - } - - if (EditRed) - { - u32 red = core::strtoul10(core::stringc(EditRed->getText()).c_str()); - if (red > 255) - red = 255; - col.setRed(red); - } - - if (EditGreen) - { - u32 green = core::strtoul10(core::stringc(EditGreen->getText()).c_str()); - if (green > 255) - green = 255; - col.setGreen(green); - } - - if (EditBlue) - { - u32 blue = core::strtoul10(core::stringc(EditBlue->getText()).c_str()); - if (blue > 255) - blue = 255; - col.setBlue(blue); - } - - return col; -} - -// Fill the editfields with the value for the given color -void CColorControl::setEditsFromColor(video::SColor col) -{ - DirtyFlag = true; - if ( EditAlpha ) - EditAlpha->setText( core::stringw(col.getAlpha()).c_str() ); - if ( EditRed ) - EditRed->setText( core::stringw(col.getRed()).c_str() ); - if ( EditGreen ) - EditGreen->setText( core::stringw(col.getGreen()).c_str() ); - if ( EditBlue ) - EditBlue->setText( core::stringw(col.getBlue()).c_str() ); - if ( ColorStatic ) - ColorStatic->setBackgroundColor(col); -} - -/* - Custom GUI-control for to edit all colors typically used in materials and lights -*/ -// Constructor -CTypicalColorsControl::CTypicalColorsControl(gui::IGUIEnvironment* guiEnv, const core::position2d & pos, bool hasEmissive, IGUIElement* parent, s32 id) - : gui::IGUIElement(gui::EGUIET_ELEMENT, guiEnv, parent,id, core::rect(pos,pos+core::dimension2d(60,250))) - , ControlAmbientColor(0), ControlDiffuseColor(0), ControlSpecularColor(0), ControlEmissiveColor(0) -{ - ControlAmbientColor = new CColorControl( guiEnv, core::position2d(0, 0), L"Ambient", this); - ControlDiffuseColor = new CColorControl( guiEnv, core::position2d(0, 75), L"Diffuse", this ); - ControlSpecularColor = new CColorControl( guiEnv, core::position2d(0, 150), L"Specular", this ); - if ( hasEmissive ) - { - ControlEmissiveColor = new CColorControl( guiEnv, core::position2d(0, 225), L"Emissive", this ); - } -} - -// Destructor -CTypicalColorsControl::~CTypicalColorsControl() -{ - ControlAmbientColor->drop(); - ControlDiffuseColor->drop(); - if ( ControlEmissiveColor ) - ControlEmissiveColor->drop(); - ControlSpecularColor->drop(); -} - -// Set the color values to those within the material -void CTypicalColorsControl::setColorsToMaterialColors(const video::SMaterial & material) -{ - ControlAmbientColor->setColor(material.AmbientColor); - ControlDiffuseColor->setColor(material.DiffuseColor); - ControlEmissiveColor->setColor(material.EmissiveColor); - ControlSpecularColor->setColor(material.SpecularColor); -} - -// Update all changed colors in the material -void CTypicalColorsControl::updateMaterialColors(video::SMaterial & material) const -{ - if ( ControlAmbientColor->isDirty() ) - material.AmbientColor = ControlAmbientColor->getColor(); - if ( ControlDiffuseColor->isDirty() ) - material.DiffuseColor = ControlDiffuseColor->getColor(); - if ( ControlEmissiveColor->isDirty() ) - material.EmissiveColor = ControlEmissiveColor->getColor(); - if ( ControlSpecularColor->isDirty() ) - material.SpecularColor = ControlSpecularColor->getColor(); -} - -// Set the color values to those from the light data -void CTypicalColorsControl::setColorsToLightDataColors(const video::SLight & lightData) -{ - ControlAmbientColor->setColor(lightData.AmbientColor.toSColor()); - ControlDiffuseColor->setColor(lightData.DiffuseColor.toSColor()); - ControlSpecularColor->setColor(lightData.SpecularColor.toSColor()); -} - -// Update all changed colors in the light data -void CTypicalColorsControl::updateLightColors(video::SLight & lightData) const -{ - if ( ControlAmbientColor->isDirty() ) - lightData.AmbientColor = video::SColorf( ControlAmbientColor->getColor() ); - if ( ControlDiffuseColor->isDirty() ) - lightData.DiffuseColor = video::SColorf( ControlDiffuseColor->getColor() ); - if ( ControlSpecularColor->isDirty() ) - lightData.SpecularColor = video::SColorf(ControlSpecularColor->getColor() ); -} - -// To reset the dirty flags -void CTypicalColorsControl::resetDirty() -{ - ControlAmbientColor->resetDirty(); - ControlDiffuseColor->resetDirty(); - ControlSpecularColor->resetDirty(); - if ( ControlEmissiveColor ) - ControlEmissiveColor->resetDirty(); -} - - -/* - GUI-Control to offer a selection of available textures. -*/ -CTextureControl::CTextureControl(gui::IGUIEnvironment* guiEnv, video::IVideoDriver * driver, const core::position2d & pos, IGUIElement* parent, s32 id) -: gui::IGUIElement(gui::EGUIET_ELEMENT, guiEnv, parent,id, core::rect(pos,pos+core::dimension2d(150,15))) -, DirtyFlag(true), ComboTexture(0) -{ - core::rect rectCombo(0, 0, AbsoluteRect.getWidth(),AbsoluteRect.getHeight()); - ComboTexture = guiEnv->addComboBox (rectCombo, this); - updateTextures(driver); -} - -bool CTextureControl::OnEvent(const SEvent &event) -{ - if ( event.EventType != EET_GUI_EVENT ) - return false; - - if ( event.GUIEvent.Caller == ComboTexture && event.GUIEvent.EventType == gui::EGET_COMBO_BOX_CHANGED ) - { - DirtyFlag = true; - } - - return false; -} - -// Workaround for a problem with comboboxes. -// We have to get in front when the combobox wants to get in front or combobox-list might be drawn below other elements. -bool CTextureControl::bringToFront(IGUIElement* element) -{ - bool result = gui::IGUIElement::bringToFront(element); - if ( Parent && element == ComboTexture ) - result &= Parent->bringToFront(this); - return result; -} - -// return selected texturename (if any, otherwise 0) -const wchar_t * CTextureControl::getSelectedTextureName() const -{ - s32 selected = ComboTexture->getSelected(); - if ( selected < 0 ) - return 0; - return ComboTexture->getItem(selected); -} - -void CTextureControl::selectTextureByName(const irr::core::stringw& name) -{ - for (u32 i=0; i< ComboTexture->getItemCount(); ++i) - { - if ( name == ComboTexture->getItem(i)) - { - ComboTexture->setSelected(i); - DirtyFlag = true; - return; - } - } -} - -// Put the names of all currently loaded textures in a combobox -void CTextureControl::updateTextures(video::IVideoDriver * driver) -{ - s32 oldSelected = ComboTexture->getSelected(); - s32 selectNew = -1; - core::stringw oldTextureName; - if ( oldSelected >= 0 ) - { - oldTextureName = ComboTexture->getItem(oldSelected); - } - ComboTexture->clear(); - for ( u32 i=0; i < driver->getTextureCount(); ++i ) - { - video::ITexture * texture = driver->getTextureByIndex(i); - core::stringw name( texture->getName() ); - ComboTexture->addItem( name.c_str() ); - if ( !oldTextureName.empty() && selectNew < 0 && name == oldTextureName ) - selectNew = i; - } - - // add another name which can be used to clear the texture - ComboTexture->addItem( CLEAR_TEXTURE.c_str() ); - if ( CLEAR_TEXTURE == oldTextureName ) - selectNew = ComboTexture->getItemCount()-1; - - if ( selectNew >= 0 ) - ComboTexture->setSelected(selectNew); - - DirtyFlag = true; -} - -/* - Control which allows setting some of the material values for a meshscenenode -*/ -void CMaterialControl::init(scene::IMeshSceneNode* node, IrrlichtDevice * device, const core::position2d & pos, const wchar_t * description) -{ - if ( Initialized || !node || !device) // initializing twice or with invalid data not allowed - return; - - Driver = device->getVideoDriver (); - gui::IGUIEnvironment* guiEnv = device->getGUIEnvironment(); - //scene::ISceneManager* smgr = device->getSceneManager(); - const video::SMaterial & material = node->getMaterial(0); - - s32 top = pos.Y; - - // Description - guiEnv->addStaticText(description, core::rect(pos.X, top, pos.X+60, top+15), false, false, 0, -1, false); - top += 15; - - // Control for material type - core::rect rectCombo(pos.X, top, 150, top+15); - top += 15; - ComboMaterial = guiEnv->addComboBox (rectCombo); - for ( int i=0; i <= (int)video::EMT_ONETEXTURE_BLEND; ++i ) - { - ComboMaterial->addItem( core::stringw(video::sBuiltInMaterialTypeNames[i]).c_str() ); - } - ComboMaterial->setSelected( (s32)material.MaterialType ); - - // Control to enable/disabling material lighting - core::rect rectBtn(core::position2d(pos.X, top), core::dimension2d(100, 15)); - top += 15; - ButtonLighting = guiEnv->addButton (rectBtn, 0, -1, L"Lighting"); - ButtonLighting->setIsPushButton(true); - ButtonLighting->setPressed(material.Lighting); - core::rect rectInfo( rectBtn.LowerRightCorner.X, rectBtn.UpperLeftCorner.Y, rectBtn.LowerRightCorner.X+40, rectBtn.UpperLeftCorner.Y+15 ); - InfoLighting = guiEnv->addStaticText(L"", rectInfo, true, false ); - InfoLighting->setTextAlignment(gui::EGUIA_CENTER, gui::EGUIA_CENTER ); - - // Controls for colors - TypicalColorsControl = new CTypicalColorsControl(guiEnv, core::position2d(pos.X, top), true, guiEnv->getRootGUIElement()); - top += 300; - TypicalColorsControl->setColorsToMaterialColors(material); - - // Controls for selecting the material textures - guiEnv->addStaticText(L"Textures", core::rect(pos.X, top, pos.X+60, top+15), false, false, 0, -1, false); - top += 15; - - for (irr::u32 i=0; igetRootGUIElement()); - top += 15; - } - - Initialized = true; -} - -void CMaterialControl::update(scene::IMeshSceneNode* sceneNode, scene::IMeshSceneNode* sceneNode2T, scene::IMeshSceneNode* sceneNodeTangents) -{ - if ( !Initialized ) - return; - - video::SMaterial & material = sceneNode->getMaterial(0); - video::SMaterial & material2T = sceneNode2T->getMaterial(0); - video::SMaterial & materialTangents = sceneNodeTangents->getMaterial(0); - - s32 selectedMaterial = ComboMaterial->getSelected(); - if ( selectedMaterial >= (s32)video::EMT_SOLID && selectedMaterial <= (s32)video::EMT_ONETEXTURE_BLEND) - { - // Show the node which has a mesh to work with the currently selected material - video::E_VERTEX_TYPE vertexType = getVertexTypeForMaterialType((video::E_MATERIAL_TYPE)selectedMaterial); - switch ( vertexType ) - { - case video::EVT_STANDARD: - material.MaterialType = (video::E_MATERIAL_TYPE)selectedMaterial; - sceneNode->setVisible(true); - sceneNode2T->setVisible(false); - sceneNodeTangents->setVisible(false); - break; - case video::EVT_2TCOORDS: - material2T.MaterialType = (video::E_MATERIAL_TYPE)selectedMaterial; - sceneNode->setVisible(false); - sceneNode2T->setVisible(true); - sceneNodeTangents->setVisible(false); - break; - case video::EVT_TANGENTS: - materialTangents.MaterialType = (video::E_MATERIAL_TYPE)selectedMaterial; - sceneNode->setVisible(false); - sceneNode2T->setVisible(false); - sceneNodeTangents->setVisible(true); - break; - } - } - - // Always update materials of all nodes, otherwise the tool is confusing to use. - updateMaterial(material); - updateMaterial(material2T); - updateMaterial(materialTangents); - - if ( ButtonLighting->isPressed() ) - InfoLighting->setText(L"is on"); - else - InfoLighting->setText(L"is off"); - - TypicalColorsControl->resetDirty(); - - for (irr::u32 i=0; iresetDirty(); -} - -void CMaterialControl::updateTextures() -{ - for (irr::u32 i=0; iupdateTextures(Driver); -} - -void CMaterialControl::selectTextures(const irr::core::stringw& name) -{ - for (irr::u32 i=0; iselectTextureByName(name); -} - -bool CMaterialControl::isLightingEnabled() const -{ - return ButtonLighting && ButtonLighting->isPressed(); -} - -void CMaterialControl::updateMaterial(video::SMaterial & material) -{ - TypicalColorsControl->updateMaterialColors(material); - material.Lighting = ButtonLighting->isPressed(); - for (irr::u32 i=0; iisDirty() ) - { - material.TextureLayer[i].Texture = Driver->getTexture( io::path(TextureControls[i]->getSelectedTextureName()) ); - } - } -} - -/* - Control to allow setting the color values of a lightscenenode. -*/ - -void CLightNodeControl::init(scene::ILightSceneNode* node, gui::IGUIEnvironment* guiEnv, const core::position2d & pos, const wchar_t * description) -{ - if ( Initialized || !node || !guiEnv) // initializing twice or with invalid data not allowed - return; - - guiEnv->addStaticText(description, core::rect(pos.X, pos.Y, pos.X+70, pos.Y+15), false, false, 0, -1, false); - TypicalColorsControl = new CTypicalColorsControl(guiEnv, core::position2d(pos.X, pos.Y+15), false, guiEnv->getRootGUIElement()); - const video::SLight & lightData = node->getLightData(); - TypicalColorsControl->setColorsToLightDataColors(lightData); - Initialized = true; -} - -void CLightNodeControl::update(scene::ILightSceneNode* node) -{ - if ( !Initialized ) - return; - - video::SLight & lightData = node->getLightData(); - TypicalColorsControl->updateLightColors(lightData); -} - -/* - Main application class -*/ - -/* - Event handler -*/ -bool CApp::OnEvent(const SEvent &event) -{ - if (event.EventType == EET_GUI_EVENT) - { - gui::IGUIEnvironment* env = Device->getGUIEnvironment(); - - switch(event.GUIEvent.EventType) - { - case gui::EGET_MENU_ITEM_SELECTED: - { - gui::IGUIContextMenu* menu = (gui::IGUIContextMenu*)event.GUIEvent.Caller; - s32 id = menu->getItemCommandId(menu->getSelectedItem()); - - switch(id) - { - case GUI_ID_OPEN_TEXTURE: // File -> Open Texture - env->addFileOpenDialog(L"Please select a texture file to open"); - break; - case GUI_ID_QUIT: // File -> Quit - setRunning(false); - break; - } - } - break; - - case gui::EGET_FILE_SELECTED: - { - // load the model file, selected in the file open dialog - gui::IGUIFileOpenDialog* dialog = - (gui::IGUIFileOpenDialog*)event.GUIEvent.Caller; - loadTexture(io::path(dialog->getFileName()).c_str()); - } - break; - - default: - break; - } - } - else if (event.EventType == EET_KEY_INPUT_EVENT) - { - KeysPressed[event.KeyInput.Key] = event.KeyInput.PressedDown; - } - else if (event.EventType == EET_MOUSE_INPUT_EVENT) - { - if (!MousePressed && event.MouseInput.isLeftPressed()) - { - gui::IGUIEnvironment* guiEnv = Device->getGUIEnvironment(); - if ( guiEnv->getHovered() == guiEnv->getRootGUIElement() ) // Click on background - { - MousePressed = true; - MouseStart.X = event.MouseInput.X; - MouseStart.Y = event.MouseInput.Y; - } - } - else if (MousePressed && !event.MouseInput.isLeftPressed()) - { - MousePressed = false; - } - } - - return false; -} - -// Application initialization -// returns true when it was successful initialized, otherwise false. -bool CApp::init(int argc, char *argv[]) -{ - // ask user for driver - Config.DriverType=driverChoiceConsole(); - if (Config.DriverType==video::EDT_COUNT) - return false; - - // create the device with the settings from our config - Device = createDevice(Config.DriverType, Config.ScreenSize); - if (!Device) - return false; - - Device->setWindowCaption( core::stringw(video::DRIVER_TYPE_NAMES[Config.DriverType]).c_str() ); - Device->setEventReceiver(this); - - scene::ISceneManager* smgr = Device->getSceneManager(); - video::IVideoDriver * driver = Device->getVideoDriver (); - gui::IGUIEnvironment* guiEnv = Device->getGUIEnvironment(); - MeshManipulator = smgr->getMeshManipulator(); - - // set a nicer font - gui::IGUISkin* skin = guiEnv->getSkin(); - gui::IGUIFont* font = guiEnv->getFont(getExampleMediaPath() + "fonthaettenschweiler.bmp"); - if (font) - skin->setFont(font); - - // remove some alpha value because it makes those menus harder to read otherwise - video::SColor col3dHighLight( skin->getColor(gui::EGDC_APP_WORKSPACE) ); - col3dHighLight.setAlpha(255); - video::SColor colHighLight( col3dHighLight ); - skin->setColor(gui::EGDC_HIGH_LIGHT, colHighLight ); - skin->setColor(gui::EGDC_3D_HIGH_LIGHT, col3dHighLight ); - - // Add some textures which are useful to test material settings - createDefaultTextures(driver); - - // create a menu - gui::IGUIContextMenu * menuBar = guiEnv->addMenu(); - menuBar->addItem(L"File", -1, true, true); - - gui::IGUIContextMenu* subMenuFile = menuBar->getSubMenu(0); - subMenuFile->addItem(L"Open texture ...", GUI_ID_OPEN_TEXTURE); - subMenuFile->addSeparator(); - subMenuFile->addItem(L"Quit", GUI_ID_QUIT); - - // a static camera - Camera = smgr->addCameraSceneNode (0, core::vector3df(0, 40, -40), - core::vector3df(0, 10, 0), - -1); - - // default material - video::SMaterial defaultMaterial; - defaultMaterial.Shininess = 20.f; - - // add the nodes which are used to show the materials - SceneNode = smgr->addCubeSceneNode (30.0f, 0, -1, - core::vector3df(0, 0, 0), - core::vector3df(0.f, 45.f, 0.f), - core::vector3df(1.0f, 1.0f, 1.0f)); - SceneNode->getMaterial(0) = defaultMaterial; - - const s32 controlsTop = 20; - MeshMaterialControl = new CMaterialControl(); - MeshMaterialControl->init( SceneNode, Device, core::position2d(10,controlsTop), L"Material" ); - MeshMaterialControl->selectTextures(core::stringw("CARO_A8R8G8B8")); // set a useful default texture - - // create nodes with other vertex types - scene::IMesh * mesh2T = MeshManipulator->createMeshWith2TCoords(SceneNode->getMesh()); - SceneNode2T = smgr->addMeshSceneNode(mesh2T, 0, -1, SceneNode->getPosition(), SceneNode->getRotation(), SceneNode->getScale() ); - mesh2T->drop(); - - scene::IMesh * meshTangents = MeshManipulator->createMeshWithTangents(SceneNode->getMesh(), false, false, false); - SceneNodeTangents = smgr->addMeshSceneNode(meshTangents, 0, -1 - , SceneNode->getPosition(), SceneNode->getRotation(), SceneNode->getScale() ); - meshTangents->drop(); - - - // add one light - NodeLight = smgr->addLightSceneNode(0, core::vector3df(0, 0, -40), - video::SColorf(1.0f, 1.0f, 1.0f), - 35.0f); - LightControl = new CLightNodeControl(); - LightControl->init(NodeLight, guiEnv, core::position2d(550,controlsTop), L"Dynamic light" ); - - // one large cube around everything. That's mainly to make the light more obvious. - scene::IMeshSceneNode* backgroundCube = smgr->addCubeSceneNode (200.0f, 0, -1, core::vector3df(0, 0, 0), - core::vector3df(45, 0, 0), - core::vector3df(1.0f, 1.0f, 1.0f)); - backgroundCube->getMaterial(0).BackfaceCulling = false; // we are within the cube, so we have to disable backface culling to see it - backgroundCube->getMaterial(0).EmissiveColor.set(255,50,50,50); // we keep some self lighting to keep texts visible - - - // Add a the mesh vertex color control - guiEnv->addStaticText(L"Mesh", core::rect(200, controlsTop, 270, controlsTop+15), false, false, 0, -1, false); - ControlVertexColors = new CColorControl( guiEnv, core::position2d(200, controlsTop+15), L"Vertex colors", guiEnv->getRootGUIElement()); - video::S3DVertex * vertices = (video::S3DVertex *)SceneNode->getMesh()->getMeshBuffer(0)->getVertices(); - if ( vertices ) - { - ControlVertexColors->setColor(vertices[0].Color); - } - - // Add a control for ambient light - GlobalAmbient = new CColorControl( guiEnv, core::position2d(550, 300), L"Global ambient", guiEnv->getRootGUIElement()); - GlobalAmbient->setColor( smgr->getAmbientLight().toSColor() ); - - return true; -} - -/* - Update one frame -*/ -bool CApp::update() -{ - using namespace irr; - - video::IVideoDriver* videoDriver = Device->getVideoDriver(); - if ( !Device->run() ) - return false; - - // Figure out delta time since last frame - ITimer * timer = Device->getTimer(); - u32 newTick = timer->getRealTime(); - f32 deltaTime = RealTimeTick > 0 ? f32(newTick-RealTimeTick)/1000.f : 0.f; // in seconds - RealTimeTick = newTick; - - if ( Device->isWindowActive() || Config.RenderInBackground ) - { - gui::IGUIEnvironment* guiEnv = Device->getGUIEnvironment(); - scene::ISceneManager* smgr = Device->getSceneManager(); - gui::IGUISkin * skin = guiEnv->getSkin(); - - // update our controls - MeshMaterialControl->update(SceneNode, SceneNode2T, SceneNodeTangents); - LightControl->update(NodeLight); - - // Update vertices - if ( ControlVertexColors->isDirty() ) - { - MeshManipulator->setVertexColors (SceneNode->getMesh(), ControlVertexColors->getColor()); - MeshManipulator->setVertexColors (SceneNode2T->getMesh(), ControlVertexColors->getColor()); - MeshManipulator->setVertexColors (SceneNodeTangents->getMesh(), ControlVertexColors->getColor()); - ControlVertexColors->resetDirty(); - } - - // update ambient light settings - if ( GlobalAmbient->isDirty() ) - { - smgr->setAmbientLight( GlobalAmbient->getColor() ); - GlobalAmbient->resetDirty(); - } - - // Let the user move the light around - const float zoomSpeed = 10.f * deltaTime; - const float rotationSpeed = 100.f * deltaTime; - if ( KeysPressed[KEY_PLUS] || KeysPressed[KEY_ADD]) - ZoomOut(NodeLight, zoomSpeed); - if ( KeysPressed[KEY_MINUS] || KeysPressed[KEY_SUBTRACT]) - ZoomOut(NodeLight, -zoomSpeed); - if ( KeysPressed[KEY_RIGHT]) - RotateHorizontal(NodeLight, rotationSpeed); - if ( KeysPressed[KEY_LEFT]) - RotateHorizontal(NodeLight, -rotationSpeed); - UpdateRotationAxis(NodeLight, LightRotationAxis); - if ( KeysPressed[KEY_UP]) - RotateAroundAxis(NodeLight, rotationSpeed, LightRotationAxis); - if ( KeysPressed[KEY_DOWN]) - RotateAroundAxis(NodeLight, -rotationSpeed, LightRotationAxis); - - // Let the user move the camera around - if (MousePressed) - { - gui::ICursorControl* cursorControl = Device->getCursorControl(); - const core::position2d& mousePos = cursorControl->getPosition (); - RotateHorizontal(Camera, rotationSpeed * (MouseStart.X - mousePos.X)); - RotateAroundAxis(Camera, rotationSpeed * (mousePos.Y - MouseStart.Y), CameraRotationAxis); - MouseStart = mousePos; - } - - // draw everything - video::SColor bkColor( skin->getColor(gui::EGDC_APP_WORKSPACE) ); - videoDriver->beginScene(video::ECBF_COLOR | video::ECBF_DEPTH, bkColor); - - smgr->drawAll(); - guiEnv->drawAll(); - - if ( MeshMaterialControl->isLightingEnabled() ) - { - // draw a line from the light to the target - video::SMaterial lineMaterial; - lineMaterial.Lighting = false; - videoDriver->setMaterial(lineMaterial); - videoDriver->setTransform(video::ETS_WORLD, core::IdentityMatrix); - videoDriver->draw3DLine(NodeLight->getAbsolutePosition(), SceneNode->getAbsolutePosition()); - } - - videoDriver->endScene(); - } - - // be nice - Device->sleep( 5 ); - - return true; -} - -// Close down the application -void CApp::quit() -{ - IsRunning = false; - - delete LightControl; - LightControl = NULL; - - delete MeshMaterialControl; - MeshMaterialControl = NULL; - - if ( ControlVertexColors ) - { - ControlVertexColors->drop(); - ControlVertexColors = NULL; - } - if ( GlobalAmbient ) - { - GlobalAmbient->drop(); - GlobalAmbient = NULL; - } - if ( Device ) - { - Device->closeDevice(); - Device->drop(); - Device = NULL; - } -} - -// Create some useful textures. -void CApp::createDefaultTextures(video::IVideoDriver * driver) -{ - const u32 width = 256; - const u32 height = 256; - video::IImage * imageA8R8G8B8 = driver->createImage (video::ECF_A8R8G8B8, core::dimension2d(width, height)); - if ( !imageA8R8G8B8 ) - return; - const u32 pitch = imageA8R8G8B8->getPitch(); - - // Some nice square-pattern with 9 typical colors - // Note that the function put readability over speed, you shouldn't use setPixel at runtime but for initialization it's nice. - for ( u32 y = 0; y < height; ++ y ) - { - for ( u32 x = 0; x < pitch; ++x ) - { - if ( y < height/3 ) - { - if ( x < width/3 ) - imageA8R8G8B8->setPixel (x, y, SCOL_BLACK); - else if ( x < 2*width/3 ) - imageA8R8G8B8->setPixel (x, y, SCOL_BLUE); - else - imageA8R8G8B8->setPixel (x, y, SCOL_CYAN); - } - else if ( y < 2*height/3 ) - { - if ( x < width/3 ) - imageA8R8G8B8->setPixel (x, y, SCOL_GRAY); - else if ( x < 2*width/3 ) - imageA8R8G8B8->setPixel (x, y, SCOL_GREEN); - else - imageA8R8G8B8->setPixel (x, y, SCOL_MAGENTA); - } - else - { - if ( x < width/3 ) - imageA8R8G8B8->setPixel (x, y, SCOL_RED); - else if ( x < 2*width/3 ) - imageA8R8G8B8->setPixel (x, y, SCOL_YELLOW); - else - imageA8R8G8B8->setPixel (x, y, SCOL_WHITE); - } - } - } - driver->addTexture (io::path("CARO_A8R8G8B8"), imageA8R8G8B8); - - // all white - imageA8R8G8B8->fill(SCOL_WHITE); - driver->addTexture (io::path("WHITE_A8R8G8B8"), imageA8R8G8B8); - - // all black - imageA8R8G8B8->fill(SCOL_BLACK); - driver->addTexture (io::path("BLACK_A8R8G8B8"), imageA8R8G8B8); - - // gray-scale - for ( u32 y = 0; y < height; ++ y ) - { - for ( u32 x = 0; x < pitch; ++x ) - { - imageA8R8G8B8->setPixel (x, y, video::SColor(y, x,x,x) ); - } - } - driver->addTexture (io::path("GRAYSCALE_A8R8G8B8"), imageA8R8G8B8); - - imageA8R8G8B8->drop(); -} - -// Load a texture and make sure nodes know it when more textures are available. -void CApp::loadTexture(const io::path &name) -{ - Device->getVideoDriver()->getTexture(name); - MeshMaterialControl->updateTextures(); -} - -void CApp::RotateHorizontal(irr::scene::ISceneNode* node, irr::f32 angle) -{ - if ( node ) - { - core::vector3df pos(node->getPosition()); - core::vector2df dir(pos.X, pos.Z); - dir.rotateBy(angle); - pos.X = dir.X; - pos.Z = dir.Y; - node->setPosition(pos); - } -} - -void CApp::RotateAroundAxis(irr::scene::ISceneNode* node, irr::f32 angle, const irr::core::vector3df& axis) -{ - if ( node ) - { - // TOOD: yeah, doesn't rotate around top/bottom yet. Fixes welcome. - core::vector3df pos(node->getPosition()); - core::matrix4 mat; - mat.setRotationAxisRadians (core::degToRad(angle), axis); - mat.rotateVect(pos); - node->setPosition(pos); - } -} - -void CApp::ZoomOut(irr::scene::ISceneNode* node, irr::f32 units) -{ - if ( node ) - { - core::vector3df pos(node->getPosition()); - irr::f32 len = pos.getLength() + units; - pos.setLength(len); - node->setPosition(pos); - } -} - -void CApp::UpdateRotationAxis(irr::scene::ISceneNode* node, irr::core::vector3df& axis) -{ - // Find a perpendicular axis to the x,z vector. If none found (vector straight up/down) continue to use the existing one. - core::vector3df pos(node->getPosition()); - if ( !core::equals(pos.X, 0.f) || !core::equals(pos.Z, 0.f) ) - { - axis.X = -pos.Z; - axis.Z = pos.X; - axis.normalize(); - } -} - -/* - Short main as most is done in classes. -*/ -int main(int argc, char *argv[]) -{ - CApp APP; - - if ( !APP.init(argc, argv) ) - { - printf("init failed\n"); - APP.quit(); - return 1; - } - - APP.setRunning(true); - - /* - main application loop - */ - while(APP.isRunning()) - { - if ( !APP.update() ) - break; - } - - APP.quit(); - - return 0; -} - -/* -**/ diff --git a/examples/22.MaterialViewer/main.h b/examples/22.MaterialViewer/main.h deleted file mode 100644 index 8fabc01d..00000000 --- a/examples/22.MaterialViewer/main.h +++ /dev/null @@ -1,319 +0,0 @@ -#ifndef EXAMPLE22_MATERIAL_VIEWER_MAIN_H -#define EXAMPLE22_MATERIAL_VIEWER_MAIN_H - -#include - -// Helper control to allow setting colors -class CColorControl : public irr::gui::IGUIElement -{ -public: - CColorControl(irr::gui::IGUIEnvironment* guiEnv, const irr::core::position2d & pos, const wchar_t *text, irr::gui::IGUIElement* parent, irr::s32 id=-1); - - // Event receiver - virtual bool OnEvent(const irr::SEvent &event); - - // Set the color values - void setColor(const irr::video::SColor& col); - - // Get the color values - const irr::video::SColor& getColor() const - { - return Color; - } - - // To reset the dirty flag - void resetDirty() - { - DirtyFlag = false; - } - - // when the color was changed the dirty flag is set - bool isDirty() const - { - return DirtyFlag; - }; - -protected: - - // Add a staticbox for a description + an editbox so users can enter numbers - irr::gui::IGUIEditBox* addEditForNumbers(irr::gui::IGUIEnvironment* guiEnv, const irr::core::position2d & pos, const wchar_t *text, irr::s32 id, irr::gui::IGUIElement * parent); - - // Get the color value from the editfields - irr::video::SColor getColorFromEdits() const; - - // Fill the editfields with the value for the given color - void setEditsFromColor(irr::video::SColor col); - -private: - - bool DirtyFlag; - irr::video::SColor Color; - irr::s32 ButtonSetId; - irr::gui::IGUIStaticText * ColorStatic; - irr::gui::IGUIEditBox * EditAlpha; - irr::gui::IGUIEditBox * EditRed; - irr::gui::IGUIEditBox * EditGreen; - irr::gui::IGUIEditBox * EditBlue; -}; - -/* - Custom GUI-control for to edit all colors typically used in materials and lights -*/ -class CTypicalColorsControl : public irr::gui::IGUIElement -{ -public: - // Constructor - CTypicalColorsControl(irr::gui::IGUIEnvironment* guiEnv, const irr::core::position2d & pos, bool hasEmissive, irr::gui::IGUIElement* parent, irr::s32 id=-1); - - // Destructor - virtual ~CTypicalColorsControl(); - - // Set the color values to those within the material - void setColorsToMaterialColors(const irr::video::SMaterial & material); - - // Update all changed colors in the material - void updateMaterialColors(irr::video::SMaterial & material) const; - - // Set the color values to those from the light data - void setColorsToLightDataColors(const irr::video::SLight & lightData); - - // Update all changed colors in the light data - void updateLightColors(irr::video::SLight & lightData) const; - - // To reset the dirty flags - void resetDirty(); - -private: - CColorControl* ControlAmbientColor; - CColorControl* ControlDiffuseColor; - CColorControl* ControlSpecularColor; - CColorControl* ControlEmissiveColor; -}; - -/* - GUI-Control to offer a selection of available textures. -*/ -class CTextureControl : public irr::gui::IGUIElement -{ -public: - CTextureControl(irr::gui::IGUIEnvironment* guiEnv, irr::video::IVideoDriver * driver, const irr::core::position2d & pos, irr::gui::IGUIElement* parent, irr::s32 id=-1); - - virtual bool OnEvent(const irr::SEvent &event); - - // Workaround for a problem with comboboxes. - // We have to get in front when the combobox wants to get in front or combobox-list might be drawn below other elements. - virtual bool bringToFront(irr::gui::IGUIElement* element); - - // Return selected texturename (if any, otherwise 0) - const wchar_t * getSelectedTextureName() const; - - // Change active selectionbased on the texture name - void selectTextureByName(const irr::core::stringw& name); - - // Reset the dirty flag - void resetDirty() - { - DirtyFlag = false; - } - - // When the texture was changed the dirty flag is set - bool isDirty() const - { - return DirtyFlag; - }; - - // Put the names of all currently loaded textures in a combobox - void updateTextures(irr::video::IVideoDriver * driver); - -private: - bool DirtyFlag; - irr::gui::IGUIComboBox * ComboTexture; -}; - -/* - Control which allows setting some of the material values for a meshscenenode -*/ -class CMaterialControl -{ -public: - // constructor - CMaterialControl() - : Initialized(false), Driver(0) - , TypicalColorsControl(0), ButtonLighting(0), InfoLighting(0), ComboMaterial(0) - { - for (irr::u32 i=0; idrop(); - } - if ( TypicalColorsControl ) - TypicalColorsControl->drop(); - } - - void init(irr::scene::IMeshSceneNode* node, irr::IrrlichtDevice * device, const irr::core::position2d & pos, const wchar_t * description); - - void update(irr::scene::IMeshSceneNode* sceneNode, irr::scene::IMeshSceneNode* sceneNode2T, irr::scene::IMeshSceneNode* sceneNodeTangents); - - void updateTextures(); - - void selectTextures(const irr::core::stringw& name); - - bool isLightingEnabled() const; - -protected: - - void updateMaterial(irr::video::SMaterial & material); - - bool Initialized; - irr::video::IVideoDriver * Driver; - CTypicalColorsControl* TypicalColorsControl; - irr::gui::IGUIButton * ButtonLighting; - irr::gui::IGUIStaticText* InfoLighting; - irr::gui::IGUIComboBox * ComboMaterial; - CTextureControl* TextureControls[irr::video::MATERIAL_MAX_TEXTURES]; -}; - -/* - Control to allow setting the color values of a lightscenenode. -*/ -class CLightNodeControl -{ -public: - // constructor - CLightNodeControl() : Initialized(false), TypicalColorsControl(0) - {} - - ~CLightNodeControl() - { - if ( TypicalColorsControl ) - TypicalColorsControl->drop(); - } - - void init(irr::scene::ILightSceneNode* node, irr::gui::IGUIEnvironment* guiEnv, const irr::core::position2d & pos, const wchar_t * description); - - void update(irr::scene::ILightSceneNode* node); - -protected: - bool Initialized; - CTypicalColorsControl* TypicalColorsControl; -}; - -/* - Application configuration -*/ -struct SConfig -{ - SConfig() - : RenderInBackground(true) - , DriverType(irr::video::EDT_NULL) - , ScreenSize(640, 480) - { - } - - bool RenderInBackground; - irr::video::E_DRIVER_TYPE DriverType; - irr::core::dimension2d ScreenSize; -}; - -/* - Main application class -*/ -class CApp : public irr::IEventReceiver -{ - friend int main(int argc, char *argv[]); - -public: - // constructor - CApp() - : IsRunning(false) - , RealTimeTick(0) - , Device(0) - , MeshManipulator(0) - , Camera(0) - , SceneNode(0), SceneNode2T(0), SceneNodeTangents(0), NodeLight(0) - , CameraRotationAxis(irr::core::vector3df(1,0,0)) - , LightRotationAxis(irr::core::vector3df(1,0,0)) - , MeshMaterialControl(0) - , LightControl(0) - , ControlVertexColors(0) - , GlobalAmbient(0) - , MousePressed(false) - { - memset(KeysPressed, 0, sizeof KeysPressed); - } - - // destructor - ~CApp() - { - } - - // Tell it to stop running - void setRunning(bool appRuns) - { - IsRunning = appRuns; - } - - // Check if it should continue running - bool isRunning() const - { - return IsRunning; - } - - // Event handler - virtual bool OnEvent(const irr::SEvent &event); - -protected: - - // Application initialization - // returns true when it was successful initialized, otherwise false. - bool init(int argc, char *argv[]); - - // Update one frame - bool update(); - - // Close down the application - void quit(); - - // Create some useful textures. - void createDefaultTextures(irr::video::IVideoDriver * driver); - - // Load a texture and make sure nodes know it when more textures are available. - void loadTexture(const irr::io::path &name); - - // Rotate a node around the origin (0,0,0) - void RotateHorizontal(irr::scene::ISceneNode* node, irr::f32 angle); - void RotateAroundAxis(irr::scene::ISceneNode* node, irr::f32 angle, const irr::core::vector3df& axis); - void ZoomOut(irr::scene::ISceneNode* node, irr::f32 units); - void UpdateRotationAxis(irr::scene::ISceneNode* node, irr::core::vector3df& axis); - - -private: - SConfig Config; - bool IsRunning; - irr::u32 RealTimeTick; - irr::IrrlichtDevice * Device; - irr::scene::IMeshManipulator* MeshManipulator; - irr::scene::ICameraSceneNode * Camera; - irr::scene::IMeshSceneNode* SceneNode; - irr::scene::IMeshSceneNode* SceneNode2T; - irr::scene::IMeshSceneNode* SceneNodeTangents; - irr::scene::ILightSceneNode* NodeLight; - irr::core::vector3df CameraRotationAxis; - irr::core::vector3df LightRotationAxis; - CMaterialControl* MeshMaterialControl; - CLightNodeControl* LightControl; - CColorControl* ControlVertexColors; - CColorControl* GlobalAmbient; - bool KeysPressed[irr::KEY_KEY_CODES_COUNT]; - bool MousePressed; - irr::core::position2d MouseStart; -}; - -#endif diff --git a/examples/23.SMeshHandling/Makefile b/examples/23.SMeshHandling/Makefile deleted file mode 100644 index 3c7710b7..00000000 --- a/examples/23.SMeshHandling/Makefile +++ /dev/null @@ -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 := 23.SMeshHandling -# 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 diff --git a/examples/23.SMeshHandling/SMeshHandling.cbp b/examples/23.SMeshHandling/SMeshHandling.cbp deleted file mode 100644 index 920efacc..00000000 --- a/examples/23.SMeshHandling/SMeshHandling.cbp +++ /dev/null @@ -1,44 +0,0 @@ - - - - - - diff --git a/examples/23.SMeshHandling/SMeshHandling.vcproj b/examples/23.SMeshHandling/SMeshHandling.vcproj deleted file mode 100644 index a63d583b..00000000 --- a/examples/23.SMeshHandling/SMeshHandling.vcproj +++ /dev/null @@ -1,132 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/examples/23.SMeshHandling/SMeshHandling.xcodeproj/project.pbxproj b/examples/23.SMeshHandling/SMeshHandling.xcodeproj/project.pbxproj deleted file mode 100644 index 4382e543..00000000 --- a/examples/23.SMeshHandling/SMeshHandling.xcodeproj/project.pbxproj +++ /dev/null @@ -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 /* 23.SMeshHandling.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = 23.SMeshHandling.app; sourceTree = BUILT_PRODUCTS_DIR; }; - 5E34CC741B7F8EEF00F212E8 /* main.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = main.cpp; sourceTree = ""; }; - 5E34CC781B7F90A000F212E8 /* libIrrlicht.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libIrrlicht.a; path = ../../lib/OSX/libIrrlicht.a; sourceTree = ""; }; - 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 = ""; }; -/* 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 = ""; - }; - 5E34CC521B7F8E6E00F212E8 /* Products */ = { - isa = PBXGroup; - children = ( - 5E34CC511B7F8E6E00F212E8 /* 23.SMeshHandling.app */, - ); - name = Products; - sourceTree = ""; - }; - 5E34CC761B7F905600F212E8 /* Libraries */ = { - isa = PBXGroup; - children = ( - 5E8570B01B7F99F500B267D2 /* Cocoa.framework */, - 5E8570B41B7F9A0700B267D2 /* IOKit.framework */, - 5E8570B21B7F99FE00B267D2 /* OpenGL.framework */, - 5E34CC781B7F90A000F212E8 /* libIrrlicht.a */, - ); - name = Libraries; - sourceTree = ""; - }; - 5E34CC771B7F906D00F212E8 /* Resources */ = { - isa = PBXGroup; - children = ( - 5E8570BE1B7F9D3A00B267D2 /* media */, - ); - name = Resources; - sourceTree = ""; - }; -/* End PBXGroup section */ - -/* Begin PBXNativeTarget section */ - 5E34CC501B7F8E6E00F212E8 /* 23.SMeshHandling */ = { - isa = PBXNativeTarget; - buildConfigurationList = 5E34CC701B7F8E6E00F212E8 /* Build configuration list for PBXNativeTarget "23.SMeshHandling" */; - buildPhases = ( - 5E34CC4D1B7F8E6E00F212E8 /* Sources */, - 5E34CC4E1B7F8E6E00F212E8 /* Frameworks */, - 5E34CC4F1B7F8E6E00F212E8 /* Resources */, - ); - buildRules = ( - ); - dependencies = ( - ); - name = 23.SMeshHandling; - productName = 01.HelloWorld; - productReference = 5E34CC511B7F8E6E00F212E8 /* 23.SMeshHandling.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 "SMeshHandling" */; - compatibilityVersion = "Xcode 3.2"; - developmentRegion = English; - hasScannedForEncodings = 0; - knownRegions = ( - en, - Base, - ); - mainGroup = 5E34C6D81B7F4A0C00F212E8; - productRefGroup = 5E34CC521B7F8E6E00F212E8 /* Products */; - projectDirPath = ""; - projectRoot = ""; - targets = ( - 5E34CC501B7F8E6E00F212E8 /* 23.SMeshHandling */, - ); - }; -/* 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 "SMeshHandling" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 5E34C6DD1B7F4A0C00F212E8 /* Debug */, - 5E34C6DE1B7F4A0C00F212E8 /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - 5E34CC701B7F8E6E00F212E8 /* Build configuration list for PBXNativeTarget "23.SMeshHandling" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 5E34CC6C1B7F8E6E00F212E8 /* Debug */, - 5E34CC6D1B7F8E6E00F212E8 /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; -/* End XCConfigurationList section */ - }; - rootObject = 5E34C6D91B7F4A0C00F212E8 /* Project object */; -} diff --git a/examples/23.SMeshHandling/SMeshHandling.xcodeproj/xcshareddata/xcschemes/23.SMeshHandling.xcscheme b/examples/23.SMeshHandling/SMeshHandling.xcodeproj/xcshareddata/xcschemes/23.SMeshHandling.xcscheme deleted file mode 100644 index 9a7fc357..00000000 --- a/examples/23.SMeshHandling/SMeshHandling.xcodeproj/xcshareddata/xcschemes/23.SMeshHandling.xcscheme +++ /dev/null @@ -1,91 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/examples/23.SMeshHandling/SMeshHandling_vc10.vcxproj b/examples/23.SMeshHandling/SMeshHandling_vc10.vcxproj deleted file mode 100644 index 949f1ce6..00000000 --- a/examples/23.SMeshHandling/SMeshHandling_vc10.vcxproj +++ /dev/null @@ -1,191 +0,0 @@ - - - - - Debug - Win32 - - - Debug - x64 - - - Release - Win32 - - - Release - x64 - - - - 23.SMeshHandling - {6AEC2AA2-C9FF-4B7D-B07A-94A9D34B41D7} - 23.SMeshHandling - Win32Proj - - - - Application - MultiByte - Windows7.1SDK - - - Application - MultiByte - Windows7.1SDK - - - Application - MultiByte - Windows7.1SDK - - - Application - MultiByte - Windows7.1SDK - - - - - - - - - - - - - - - - - - - - - - - <_ProjectFileVersion>10.0.30319.1 - ..\..\bin\Win32-VisualStudio\ - ..\..\bin\Win64-VisualStudio\ - true - true - ..\..\bin\Win32-VisualStudio\ - ..\..\bin\Win64-VisualStudio\ - false - false - AllRules.ruleset - AllRules.ruleset - - - - - AllRules.ruleset - AllRules.ruleset - - - - - - - - Disabled - ..\..\include;%(AdditionalIncludeDirectories) - WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions) - true - EnableFastChecks - MultiThreadedDebug - - - Level3 - EditAndContinue - - - ..\..\bin\Win32-VisualStudio\23.SMeshHandling.exe - ..\..\lib\Win32-visualstudio;%(AdditionalLibraryDirectories) - true - Console - - - - - - - Disabled - ..\..\include;%(AdditionalIncludeDirectories) - WIN32;WIN64;_DEBUG;_WINDOWS;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebug - - - Level3 - ProgramDatabase - - - ..\..\bin\Win64-VisualStudio\23.SMeshHandling.exe - ..\..\lib\Win64-visualstudio;%(AdditionalLibraryDirectories) - true - $(OutDir)SMeshHandling.pdb - Console - - - - - - - true - Speed - ..\..\include;%(AdditionalIncludeDirectories) - WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions) - Sync - - - Level3 - - - Cdecl - - - ..\..\bin\Win32-VisualStudio\23.SMeshHandling.exe - ..\..\lib\Win32-visualstudio;%(AdditionalLibraryDirectories) - false - Console - true - true - - - - - - - true - Speed - ..\..\include;%(AdditionalIncludeDirectories) - WIN32;WIN64;NDEBUG;_WINDOWS;%(PreprocessorDefinitions) - Sync - - - Level3 - - - Cdecl - - - ..\..\bin\Win64-VisualStudio\23.SMeshHandling.exe - ..\..\lib\Win64-visualstudio;%(AdditionalLibraryDirectories) - false - Console - true - true - - - - - - - - - - - \ No newline at end of file diff --git a/examples/23.SMeshHandling/SMeshHandling_vc11.vcxproj b/examples/23.SMeshHandling/SMeshHandling_vc11.vcxproj deleted file mode 100644 index 83332f4d..00000000 --- a/examples/23.SMeshHandling/SMeshHandling_vc11.vcxproj +++ /dev/null @@ -1,192 +0,0 @@ - - - - - Debug - Win32 - - - Debug - x64 - - - Release - Win32 - - - Release - x64 - - - - 23.SMeshHandling - {6AEC2AA2-C9FF-4B7D-B07A-94A9D34B41D7} - 23.SMeshHandling - Win32Proj - - - - Application - MultiByte - Windows7.1SDK - - - Application - MultiByte - Windows7.1SDK - - - Application - MultiByte - Windows7.1SDK - - - Application - MultiByte - Windows7.1SDK - - - - - - - - - - - - - - - - - - - - - - - <_ProjectFileVersion>10.0.30319.1 - ..\..\bin\Win32-VisualStudio\ - ..\..\bin\Win64-VisualStudio\ - true - true - ..\..\bin\Win32-VisualStudio\ - ..\..\bin\Win64-VisualStudio\ - false - false - AllRules.ruleset - AllRules.ruleset - - - - - AllRules.ruleset - AllRules.ruleset - - - - - - - - Disabled - ..\..\include;%(AdditionalIncludeDirectories) - WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions) - true - EnableFastChecks - MultiThreadedDebug - - - Level3 - EditAndContinue - - - ..\..\bin\Win32-VisualStudio\23.SMeshHandling.exe - ..\..\lib\Win32-visualstudio;%(AdditionalLibraryDirectories) - true - $(OutDir)SMeshHandling.pdb - Console - - - - - - - Disabled - ..\..\include;%(AdditionalIncludeDirectories) - WIN32;WIN64;_DEBUG;_WINDOWS;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebug - - - Level3 - ProgramDatabase - - - ..\..\bin\Win64-VisualStudio\23.SMeshHandling.exe - ..\..\lib\Win64-visualstudio;%(AdditionalLibraryDirectories) - true - $(OutDir)SMeshHandling.pdb - Console - - - - - - - true - Speed - ..\..\include;%(AdditionalIncludeDirectories) - WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions) - Sync - - - Level3 - - - Cdecl - - - ..\..\bin\Win32-VisualStudio\23.SMeshHandling.exe - ..\..\lib\Win32-visualstudio;%(AdditionalLibraryDirectories) - false - Console - true - true - - - - - - - true - Speed - ..\..\include;%(AdditionalIncludeDirectories) - WIN32;WIN64;NDEBUG;_WINDOWS;%(PreprocessorDefinitions) - Sync - - - Level3 - - - Cdecl - - - ..\..\bin\Win64-VisualStudio\23.SMeshHandling.exe - ..\..\lib\Win64-visualstudio;%(AdditionalLibraryDirectories) - false - Console - true - true - - - - - - - - - - - \ No newline at end of file diff --git a/examples/23.SMeshHandling/SMeshHandling_vc12.vcxproj b/examples/23.SMeshHandling/SMeshHandling_vc12.vcxproj deleted file mode 100644 index 46b2382c..00000000 --- a/examples/23.SMeshHandling/SMeshHandling_vc12.vcxproj +++ /dev/null @@ -1,192 +0,0 @@ - - - - - Debug - Win32 - - - Debug - x64 - - - Release - Win32 - - - Release - x64 - - - - 23.SMeshHandling - {6AEC2AA2-C9FF-4B7D-B07A-94A9D34B41D7} - 23.SMeshHandling - Win32Proj - - - - Application - MultiByte - Windows7.1SDK - - - Application - MultiByte - Windows7.1SDK - - - Application - MultiByte - Windows7.1SDK - - - Application - MultiByte - Windows7.1SDK - - - - - - - - - - - - - - - - - - - - - - - <_ProjectFileVersion>10.0.30319.1 - ..\..\bin\Win32-VisualStudio\ - ..\..\bin\Win64-VisualStudio\ - true - true - ..\..\bin\Win32-VisualStudio\ - ..\..\bin\Win64-VisualStudio\ - false - false - AllRules.ruleset - AllRules.ruleset - - - - - AllRules.ruleset - AllRules.ruleset - - - - - - - - Disabled - ..\..\include;%(AdditionalIncludeDirectories) - WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions) - true - EnableFastChecks - MultiThreadedDebug - - - Level3 - EditAndContinue - - - ..\..\bin\Win32-VisualStudio\23.SMeshHandling.exe - ..\..\lib\Win32-visualstudio;%(AdditionalLibraryDirectories) - true - $(OutDir)SMeshHandling.pdb - Console - - - - - - - Disabled - ..\..\include;%(AdditionalIncludeDirectories) - WIN32;WIN64;_DEBUG;_WINDOWS;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebug - - - Level3 - ProgramDatabase - - - ..\..\bin\Win64-VisualStudio\23.SMeshHandling.exe - ..\..\lib\Win64-visualstudio;%(AdditionalLibraryDirectories) - true - $(OutDir)SMeshHandling.pdb - Console - - - - - - - true - Speed - ..\..\include;%(AdditionalIncludeDirectories) - WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions) - Sync - - - Level3 - - - Cdecl - - - ..\..\bin\Win32-VisualStudio\23.SMeshHandling.exe - ..\..\lib\Win32-visualstudio;%(AdditionalLibraryDirectories) - false - Console - true - true - - - - - - - true - Speed - ..\..\include;%(AdditionalIncludeDirectories) - WIN32;WIN64;NDEBUG;_WINDOWS;%(PreprocessorDefinitions) - Sync - - - Level3 - - - Cdecl - - - ..\..\bin\Win64-VisualStudio\23.SMeshHandling.exe - ..\..\lib\Win64-visualstudio;%(AdditionalLibraryDirectories) - false - Console - true - true - - - - - - - - - - - \ No newline at end of file diff --git a/examples/23.SMeshHandling/SMeshHandling_vc14.vcxproj b/examples/23.SMeshHandling/SMeshHandling_vc14.vcxproj deleted file mode 100644 index 6c9b712b..00000000 --- a/examples/23.SMeshHandling/SMeshHandling_vc14.vcxproj +++ /dev/null @@ -1,192 +0,0 @@ - - - - - Debug - Win32 - - - Debug - x64 - - - Release - Win32 - - - Release - x64 - - - - 23.SMeshHandling - {6AEC2AA2-C9FF-4B7D-B07A-94A9D34B41D7} - 23.SMeshHandling - Win32Proj - - - - Application - MultiByte - v140 - - - Application - MultiByte - v140 - - - Application - MultiByte - v140 - - - Application - MultiByte - v140 - - - - - - - - - - - - - - - - - - - - - - - <_ProjectFileVersion>10.0.30319.1 - ..\..\bin\Win32-VisualStudio\ - ..\..\bin\Win64-VisualStudio\ - true - true - ..\..\bin\Win32-VisualStudio\ - ..\..\bin\Win64-VisualStudio\ - false - false - AllRules.ruleset - AllRules.ruleset - - - - - AllRules.ruleset - AllRules.ruleset - - - - - - - - Disabled - ..\..\include;%(AdditionalIncludeDirectories) - WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions) - true - EnableFastChecks - MultiThreadedDebug - - - Level3 - EditAndContinue - - - ..\..\bin\Win32-VisualStudio\23.SMeshHandling.exe - ..\..\lib\Win32-visualstudio;%(AdditionalLibraryDirectories) - true - $(OutDir)SMeshHandling.pdb - Console - - - - - - - Disabled - ..\..\include;%(AdditionalIncludeDirectories) - WIN32;WIN64;_DEBUG;_WINDOWS;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebug - - - Level3 - ProgramDatabase - - - ..\..\bin\Win64-VisualStudio\23.SMeshHandling.exe - ..\..\lib\Win64-visualstudio;%(AdditionalLibraryDirectories) - true - $(OutDir)SMeshHandling.pdb - Console - - - - - - - true - Speed - ..\..\include;%(AdditionalIncludeDirectories) - WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions) - Sync - - - Level3 - - - Cdecl - - - ..\..\bin\Win32-VisualStudio\23.SMeshHandling.exe - ..\..\lib\Win32-visualstudio;%(AdditionalLibraryDirectories) - false - Console - true - true - - - - - - - true - Speed - ..\..\include;%(AdditionalIncludeDirectories) - WIN32;WIN64;NDEBUG;_WINDOWS;%(PreprocessorDefinitions) - Sync - - - Level3 - - - Cdecl - - - ..\..\bin\Win64-VisualStudio\23.SMeshHandling.exe - ..\..\lib\Win64-visualstudio;%(AdditionalLibraryDirectories) - false - Console - true - true - - - - - - - - - - - \ No newline at end of file diff --git a/examples/23.SMeshHandling/main.cpp b/examples/23.SMeshHandling/main.cpp deleted file mode 100644 index a4ef9ebc..00000000 --- a/examples/23.SMeshHandling/main.cpp +++ /dev/null @@ -1,426 +0,0 @@ -/** Example 023 SMeshBufferHandling - -A tutorial by geoff. - -In this tutorial we'll learn how to create custom meshes and deal with them -with Irrlicht. We'll create an interesting heightmap with some lighting effects. -With keys 1,2,3 you can choose a different mesh layout, which is put into the -mesh buffers as desired. All positions, normals, etc. are updated accordingly. - -Ok, let's start with the headers (I think there's nothing to say about it) -*/ - -#include -#include "driverChoice.h" - -#ifdef _MSC_VER -#pragma comment(lib, "Irrlicht.lib") -#endif - -//Namespaces for the engine -using namespace irr; -using namespace video; -using namespace core; -using namespace scene; -using namespace io; -using namespace gui; - -/* This is the type of the functions which work out the colour. */ -typedef SColor colour_func(f32 x, f32 y, f32 z); - -/* Here comes a set of functions which can be used for coloring the nodes while -creating the mesh. */ - -// Greyscale, based on the height. -SColor grey(f32, f32, f32 z) -{ - u32 n = (u32)(255.f * z); - return SColor(255, n, n, n); -} - -// Interpolation between blue and white, with red added in one -// direction and green in the other. -SColor yellow(f32 x, f32 y, f32) -{ - return SColor(255, 128 + (u32)(127.f * x), 128 + (u32)(127.f * y), 255); -} - -// Pure white. -SColor white(f32, f32, f32) { return SColor(255, 255, 255, 255); } - -/* The type of the functions which generate the heightmap. x and y -range between -0.5 and 0.5, and s is the scale of the heightmap. */ - -typedef f32 generate_func(s16 x, s16 y, f32 s); - -// An interesting sample function :-) -f32 eggbox(s16 x, s16 y, f32 s) -{ - const f32 r = 4.f*sqrtf((f32)(x*x + y*y))/s; - const f32 z = (f32)exp(-r * 2) * (cosf(0.2f * x) + cosf(0.2f * y)); - return 0.25f+0.25f*z; -} - -// A rather dumb sine function :-/ -f32 moresine(s16 x, s16 y, f32 s) -{ - const f32 xx=0.3f*(f32)x/s; - const f32 yy=12*y/s; - const f32 z = sinf(xx*xx+yy)*sinf(xx+yy*yy); - return 0.25f + 0.25f * z; -} - -// A simple function -f32 justexp(s16 x, s16 y, f32 s) -{ - const f32 xx=6*x/s; - const f32 yy=6*y/s; - const f32 z = (xx*xx+yy*yy); - return 0.3f*z*cosf(xx*yy); -} - -/* A simple class for representing heightmaps. Most of this should be obvious. */ - -class HeightMap -{ -private: - const u16 Width; - const u16 Height; - f32 s; - core::array data; -public: - HeightMap(u16 _w, u16 _h) : Width(_w), Height(_h), s(0.f), data(0) - { - s = sqrtf((f32)(Width * Width + Height * Height)); - data.set_used(Width * Height); - } - - // Fill the heightmap with values generated from f. - void generate(generate_func f) - { - u32 i=0; - for(u16 y = 0; y < Height; ++y) - for(u16 x = 0; x < Width; ++x) - set(i++, calc(f, x, y)); - } - - u16 height() const { return Height; } - u16 width() const { return Width; } - - f32 calc(generate_func f, u16 x, u16 y) const - { - const f32 xx = (f32)x - Width*0.5f; - const f32 yy = (f32)y - Height*0.5f; - return f((u16)xx, (u16)yy, s); - } - - // The height at (x, y) is at position y * Width + x. - - void set(u16 x, u16 y, f32 z) { data[y * Width + x] = z; } - void set(u32 i, f32 z) { data[i] = z; } - f32 get(u16 x, u16 y) const { return data[y * Width + x]; } - - /* The only difficult part. This considers the normal at (x, y) to - be the cross product of the vectors between the adjacent points - in the horizontal and vertical directions. - - s is a scaling factor, which is necessary if the height units are - different from the coordinate units; for example, if your map has - heights in meters and the coordinates are in units of a - kilometer. */ - - vector3df getnormal(u16 x, u16 y, f32 s) const - { - const f32 zc = get(x, y); - f32 zl, zr, zu, zd; - - if (x == 0) - { - zr = get(x + 1, y); - zl = zc + zc - zr; - } - else if (x == Width - 1) - { - zl = get(x - 1, y); - zr = zc + zc - zl; - } - else - { - zr = get(x + 1, y); - zl = get(x - 1, y); - } - - if (y == 0) - { - zd = get(x, y + 1); - zu = zc + zc - zd; - } - else if (y == Height - 1) - { - zu = get(x, y - 1); - zd = zc + zc - zu; - } - else - { - zd = get(x, y + 1); - zu = get(x, y - 1); - } - - return vector3df(s * 2 * (zl - zr), 4, s * 2 * (zd - zu)).normalize(); - } -}; - -/* A class which generates a mesh from a heightmap. */ -class TMesh -{ -private: - u16 Width; - u16 Height; - f32 Scale; -public: - SMesh* Mesh; - - TMesh() : Width(0), Height(0), Scale(1.f), Mesh(0) - { - Mesh = new SMesh(); - } - - ~TMesh() - { - Mesh->drop(); - } - - // Unless the heightmap is small, it won't all fit into a single - // SMeshBuffer. This function chops it into pieces and generates a - // buffer from each one. - - void init(const HeightMap &hm, f32 scale, colour_func cf, IVideoDriver *driver) - { - Scale = scale; - - const u32 mp = driver -> getMaximalPrimitiveCount(); - Width = hm.width(); - Height = hm.height(); - - const u32 sw = mp / (6 * Height); // the width of each piece - - u32 i=0; - for(u32 y0 = 0; y0 < Height; y0 += sw) - { - u16 y1 = y0 + sw; - if (y1 >= Height) - y1 = Height - 1; // the last one might be narrower - addstrip(hm, cf, y0, y1, i); - ++i; - } - if (igetMeshBufferCount()) - { - // clear the rest - for (u32 j=i; jgetMeshBufferCount(); ++j) - { - Mesh->getMeshBuffer(j)->drop(); - } - Mesh->MeshBuffers.erase(i,Mesh->getMeshBufferCount()-i); - } - // set dirty flag to make sure that hardware copies of this - // buffer are also updated, see IMesh::setHardwareMappingHint - Mesh->setDirty(); - Mesh->recalculateBoundingBox(); - } - - // Generate a SMeshBuffer which represents all the vertices and - // indices for values of y between y0 and y1, and add it to the - // mesh. - - void addstrip(const HeightMap &hm, colour_func cf, u16 y0, u16 y1, u32 bufNum) - { - SMeshBuffer *buf = 0; - if (bufNumgetMeshBufferCount()) - { - buf = (SMeshBuffer*)Mesh->getMeshBuffer(bufNum); - } - else - { - // create new buffer - buf = new SMeshBuffer(); - Mesh->addMeshBuffer(buf); - // to simplify things we drop here but continue using buf - buf->drop(); - } - buf->Vertices.set_used((1 + y1 - y0) * Width); - - u32 i=0; - for (u16 y = y0; y <= y1; ++y) - { - for (u16 x = 0; x < Width; ++x) - { - const f32 z = hm.get(x, y); - const f32 xx = (f32)x/(f32)Width; - const f32 yy = (f32)y/(f32)Height; - - S3DVertex& v = buf->Vertices[i++]; - v.Pos.set(x, Scale * z, y); - v.Normal.set(hm.getnormal(x, y, Scale)); - v.Color=cf(xx, yy, z); - v.TCoords.set(xx, yy); - } - } - - buf->Indices.set_used(6 * (Width - 1) * (y1 - y0)); - i=0; - for(u16 y = y0; y < y1; ++y) - { - for(u16 x = 0; x < Width - 1; ++x) - { - const u16 n = (y-y0) * Width + x; - buf->Indices[i]=n; - buf->Indices[++i]=n + Width; - buf->Indices[++i]=n + Width + 1; - buf->Indices[++i]=n + Width + 1; - buf->Indices[++i]=n + 1; - buf->Indices[++i]=n; - ++i; - } - } - - buf->recalculateBoundingBox(); - } -}; - -/* -Our event receiver implementation, taken from tutorial 4. -*/ -class MyEventReceiver : public IEventReceiver -{ -public: - // This is the one method that we have to implement - virtual bool OnEvent(const SEvent& event) - { - // Remember whether each key is down or up - if (event.EventType == irr::EET_KEY_INPUT_EVENT) - KeyIsDown[event.KeyInput.Key] = event.KeyInput.PressedDown; - - return false; - } - - // This is used to check whether a key is being held down - virtual bool IsKeyDown(EKEY_CODE keyCode) const - { - return KeyIsDown[keyCode]; - } - - MyEventReceiver() - { - for (u32 i=0; igetVideoDriver(); - ISceneManager *smgr = device->getSceneManager(); - device->setWindowCaption(L"Irrlicht Example for SMesh usage."); - - /* - Create the custom mesh and initialize with a heightmap - */ - TMesh mesh; - HeightMap hm = HeightMap(255, 255); - hm.generate(eggbox); - mesh.init(hm, 50.f, grey, driver); - - // Add the mesh to the scene graph - IMeshSceneNode* meshnode = smgr -> addMeshSceneNode(mesh.Mesh); - meshnode->setMaterialFlag(video::EMF_BACK_FACE_CULLING, false); - - // light is just for nice effects - ILightSceneNode *node = smgr->addLightSceneNode(0, vector3df(0,100,0), - SColorf(1.0f, 0.6f, 0.7f, 1.0f), 500.0f); - if (node) - { - node->getLightData().Attenuation.set(0.f, 1.f/500.f, 0.f); - ISceneNodeAnimator* anim = smgr->createFlyCircleAnimator(vector3df(0,150,0),250.0f); - if (anim) - { - node->addAnimator(anim); - anim->drop(); - } - } - - ICameraSceneNode* camera = smgr->addCameraSceneNodeFPS(); - if (camera) - { - camera->setPosition(vector3df(-20.f, 150.f, -20.f)); - camera->setTarget(vector3df(200.f, -80.f, 150.f)); - camera->setFarValue(20000.0f); - } - - /* - Just a usual render loop with event handling. The custom mesh is - a usual part of the scene graph which gets rendered by drawAll. - */ - while(device->run()) - { - if(!device->isWindowActive()) - { - device->sleep(100); - continue; - } - - if(receiver.IsKeyDown(irr::KEY_KEY_W)) - { - meshnode->setMaterialFlag(video::EMF_WIREFRAME, !meshnode->getMaterial(0).Wireframe); - } - else if(receiver.IsKeyDown(irr::KEY_KEY_1)) - { - hm.generate(eggbox); - mesh.init(hm, 50.f, grey, driver); - } - else if(receiver.IsKeyDown(irr::KEY_KEY_2)) - { - hm.generate(moresine); - mesh.init(hm, 50.f, yellow, driver); - } - else if(receiver.IsKeyDown(irr::KEY_KEY_3)) - { - hm.generate(justexp); - mesh.init(hm, 50.f, yellow, driver); - } - - driver->beginScene(video::ECBF_COLOR | video::ECBF_DEPTH, SColor(0xff000000)); - smgr->drawAll(); - driver->endScene(); - } - - device->drop(); - - return 0; -} - -/* -That's it! Just compile and play around with the program. -**/ diff --git a/examples/24.CursorControl/CursorControl.cbp b/examples/24.CursorControl/CursorControl.cbp deleted file mode 100644 index b8aa231f..00000000 --- a/examples/24.CursorControl/CursorControl.cbp +++ /dev/null @@ -1,57 +0,0 @@ - - - - - - diff --git a/examples/24.CursorControl/CursorControl.vcproj b/examples/24.CursorControl/CursorControl.vcproj deleted file mode 100644 index 1bc2f531..00000000 --- a/examples/24.CursorControl/CursorControl.vcproj +++ /dev/null @@ -1,132 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/examples/24.CursorControl/CursorControl.xcodeproj/project.pbxproj b/examples/24.CursorControl/CursorControl.xcodeproj/project.pbxproj deleted file mode 100644 index 2000a263..00000000 --- a/examples/24.CursorControl/CursorControl.xcodeproj/project.pbxproj +++ /dev/null @@ -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 /* 24.CursorControl.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = 24.CursorControl.app; sourceTree = BUILT_PRODUCTS_DIR; }; - 5E34CC741B7F8EEF00F212E8 /* main.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = main.cpp; sourceTree = ""; }; - 5E34CC781B7F90A000F212E8 /* libIrrlicht.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libIrrlicht.a; path = ../../lib/OSX/libIrrlicht.a; sourceTree = ""; }; - 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 = ""; }; -/* 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 = ""; - }; - 5E34CC521B7F8E6E00F212E8 /* Products */ = { - isa = PBXGroup; - children = ( - 5E34CC511B7F8E6E00F212E8 /* 24.CursorControl.app */, - ); - name = Products; - sourceTree = ""; - }; - 5E34CC761B7F905600F212E8 /* Libraries */ = { - isa = PBXGroup; - children = ( - 5E8570B01B7F99F500B267D2 /* Cocoa.framework */, - 5E8570B41B7F9A0700B267D2 /* IOKit.framework */, - 5E8570B21B7F99FE00B267D2 /* OpenGL.framework */, - 5E34CC781B7F90A000F212E8 /* libIrrlicht.a */, - ); - name = Libraries; - sourceTree = ""; - }; - 5E34CC771B7F906D00F212E8 /* Resources */ = { - isa = PBXGroup; - children = ( - 5E8570BE1B7F9D3A00B267D2 /* media */, - ); - name = Resources; - sourceTree = ""; - }; -/* End PBXGroup section */ - -/* Begin PBXNativeTarget section */ - 5E34CC501B7F8E6E00F212E8 /* 24.CursorControl */ = { - isa = PBXNativeTarget; - buildConfigurationList = 5E34CC701B7F8E6E00F212E8 /* Build configuration list for PBXNativeTarget "24.CursorControl" */; - buildPhases = ( - 5E34CC4D1B7F8E6E00F212E8 /* Sources */, - 5E34CC4E1B7F8E6E00F212E8 /* Frameworks */, - 5E34CC4F1B7F8E6E00F212E8 /* Resources */, - ); - buildRules = ( - ); - dependencies = ( - ); - name = 24.CursorControl; - productName = 01.HelloWorld; - productReference = 5E34CC511B7F8E6E00F212E8 /* 24.CursorControl.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 "CursorControl" */; - compatibilityVersion = "Xcode 3.2"; - developmentRegion = English; - hasScannedForEncodings = 0; - knownRegions = ( - en, - Base, - ); - mainGroup = 5E34C6D81B7F4A0C00F212E8; - productRefGroup = 5E34CC521B7F8E6E00F212E8 /* Products */; - projectDirPath = ""; - projectRoot = ""; - targets = ( - 5E34CC501B7F8E6E00F212E8 /* 24.CursorControl */, - ); - }; -/* 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 "CursorControl" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 5E34C6DD1B7F4A0C00F212E8 /* Debug */, - 5E34C6DE1B7F4A0C00F212E8 /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - 5E34CC701B7F8E6E00F212E8 /* Build configuration list for PBXNativeTarget "24.CursorControl" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 5E34CC6C1B7F8E6E00F212E8 /* Debug */, - 5E34CC6D1B7F8E6E00F212E8 /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; -/* End XCConfigurationList section */ - }; - rootObject = 5E34C6D91B7F4A0C00F212E8 /* Project object */; -} diff --git a/examples/24.CursorControl/CursorControl.xcodeproj/xcshareddata/xcschemes/24.CursorControl.xcscheme b/examples/24.CursorControl/CursorControl.xcodeproj/xcshareddata/xcschemes/24.CursorControl.xcscheme deleted file mode 100644 index 2bf741e7..00000000 --- a/examples/24.CursorControl/CursorControl.xcodeproj/xcshareddata/xcschemes/24.CursorControl.xcscheme +++ /dev/null @@ -1,91 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/examples/24.CursorControl/CursorControl_vc10.vcxproj b/examples/24.CursorControl/CursorControl_vc10.vcxproj deleted file mode 100644 index 913c520a..00000000 --- a/examples/24.CursorControl/CursorControl_vc10.vcxproj +++ /dev/null @@ -1,187 +0,0 @@ - - - - - Debug - Win32 - - - Debug - x64 - - - Release - Win32 - - - Release - x64 - - - - 24.CursorControl - {02B67A37-50E1-49DB-BECF-905BC029C2FE} - 24.CursorControl - Win32Proj - - - - Application - MultiByte - Windows7.1SDK - - - Application - MultiByte - Windows7.1SDK - - - Application - MultiByte - Windows7.1SDK - - - Application - MultiByte - Windows7.1SDK - - - - - - - - - - - - - - - - - - - - - - - <_ProjectFileVersion>10.0.30319.1 - ..\..\bin\Win32-VisualStudio\ - ..\..\bin\Win64-VisualStudio\ - ..\..\bin\Win32-VisualStudio\ - ..\..\bin\Win64-VisualStudio\ - AllRules.ruleset - AllRules.ruleset - - - - - AllRules.ruleset - AllRules.ruleset - - - - - - - - Disabled - ..\..\include;%(AdditionalIncludeDirectories) - WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions) - true - EnableFastChecks - MultiThreadedDebug - - - Level3 - EditAndContinue - - - ..\..\bin\Win32-VisualStudio\24.CursorControl.exe - ..\..\lib\Win32-visualstudio;%(AdditionalLibraryDirectories) - true - Console - - - - - - - Disabled - ..\..\include;%(AdditionalIncludeDirectories) - WIN32;WIN64;_DEBUG;_WINDOWS;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebug - - - Level3 - ProgramDatabase - - - ..\..\bin\Win64-VisualStudio\24.CursorControl.exe - ..\..\lib\Win64-visualstudio;%(AdditionalLibraryDirectories) - true - $(OutDir)CursorControl.pdb - Console - - - - - - - true - Speed - ..\..\include;%(AdditionalIncludeDirectories) - WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions) - Sync - - - Level3 - - - Cdecl - - - ..\..\bin\Win32-VisualStudio\24.CursorControl.exe - ..\..\lib\Win32-visualstudio;%(AdditionalLibraryDirectories) - false - Console - true - true - - - - - - - true - Speed - ..\..\include;%(AdditionalIncludeDirectories) - WIN32;WIN64;NDEBUG;_WINDOWS;%(PreprocessorDefinitions) - Sync - - - Level3 - - - Cdecl - - - ..\..\bin\Win64-VisualStudio\24.CursorControl.exe - ..\..\lib\Win64-visualstudio;%(AdditionalLibraryDirectories) - false - Console - true - true - - - - - - - - - - - \ No newline at end of file diff --git a/examples/24.CursorControl/CursorControl_vc11.vcxproj b/examples/24.CursorControl/CursorControl_vc11.vcxproj deleted file mode 100644 index 7eadc6f1..00000000 --- a/examples/24.CursorControl/CursorControl_vc11.vcxproj +++ /dev/null @@ -1,188 +0,0 @@ - - - - - Debug - Win32 - - - Debug - x64 - - - Release - Win32 - - - Release - x64 - - - - 24.CursorControl - {02B67A37-50E1-49DB-BECF-905BC029C2FE} - 24.CursorControl - Win32Proj - - - - Application - MultiByte - Windows7.1SDK - - - Application - MultiByte - Windows7.1SDK - - - Application - MultiByte - Windows7.1SDK - - - Application - MultiByte - Windows7.1SDK - - - - - - - - - - - - - - - - - - - - - - - <_ProjectFileVersion>10.0.30319.1 - ..\..\bin\Win32-VisualStudio\ - ..\..\bin\Win64-VisualStudio\ - ..\..\bin\Win32-VisualStudio\ - ..\..\bin\Win64-VisualStudio\ - AllRules.ruleset - AllRules.ruleset - - - - - AllRules.ruleset - AllRules.ruleset - - - - - - - - Disabled - ..\..\include;%(AdditionalIncludeDirectories) - WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions) - true - EnableFastChecks - MultiThreadedDebug - - - Level3 - EditAndContinue - - - ..\..\bin\Win32-VisualStudio\24.CursorControl.exe - ..\..\lib\Win32-visualstudio;%(AdditionalLibraryDirectories) - true - $(OutDir)CursorControl.pdb - Console - - - - - - - Disabled - ..\..\include;%(AdditionalIncludeDirectories) - WIN32;WIN64;_DEBUG;_WINDOWS;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebug - - - Level3 - ProgramDatabase - - - ..\..\bin\Win64-VisualStudio\24.CursorControl.exe - ..\..\lib\Win64-visualstudio;%(AdditionalLibraryDirectories) - true - $(OutDir)CursorControl.pdb - Console - - - - - - - true - Speed - ..\..\include;%(AdditionalIncludeDirectories) - WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions) - Sync - - - Level3 - - - Cdecl - - - ..\..\bin\Win32-VisualStudio\24.CursorControl.exe - ..\..\lib\Win32-visualstudio;%(AdditionalLibraryDirectories) - false - Console - true - true - - - - - - - true - Speed - ..\..\include;%(AdditionalIncludeDirectories) - WIN32;WIN64;NDEBUG;_WINDOWS;%(PreprocessorDefinitions) - Sync - - - Level3 - - - Cdecl - - - ..\..\bin\Win64-VisualStudio\24.CursorControl.exe - ..\..\lib\Win64-visualstudio;%(AdditionalLibraryDirectories) - false - Console - true - true - - - - - - - - - - - \ No newline at end of file diff --git a/examples/24.CursorControl/CursorControl_vc12.vcxproj b/examples/24.CursorControl/CursorControl_vc12.vcxproj deleted file mode 100644 index 26fdf871..00000000 --- a/examples/24.CursorControl/CursorControl_vc12.vcxproj +++ /dev/null @@ -1,188 +0,0 @@ - - - - - Debug - Win32 - - - Debug - x64 - - - Release - Win32 - - - Release - x64 - - - - 24.CursorControl - {02B67A37-50E1-49DB-BECF-905BC029C2FE} - 24.CursorControl - Win32Proj - - - - Application - MultiByte - Windows7.1SDK - - - Application - MultiByte - Windows7.1SDK - - - Application - MultiByte - Windows7.1SDK - - - Application - MultiByte - Windows7.1SDK - - - - - - - - - - - - - - - - - - - - - - - <_ProjectFileVersion>10.0.30319.1 - ..\..\bin\Win32-VisualStudio\ - ..\..\bin\Win64-VisualStudio\ - ..\..\bin\Win32-VisualStudio\ - ..\..\bin\Win64-VisualStudio\ - AllRules.ruleset - AllRules.ruleset - - - - - AllRules.ruleset - AllRules.ruleset - - - - - - - - Disabled - ..\..\include;%(AdditionalIncludeDirectories) - WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions) - true - EnableFastChecks - MultiThreadedDebug - - - Level3 - EditAndContinue - - - ..\..\bin\Win32-VisualStudio\24.CursorControl.exe - ..\..\lib\Win32-visualstudio;%(AdditionalLibraryDirectories) - true - $(OutDir)CursorControl.pdb - Console - - - - - - - Disabled - ..\..\include;%(AdditionalIncludeDirectories) - WIN32;WIN64;_DEBUG;_WINDOWS;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebug - - - Level3 - ProgramDatabase - - - ..\..\bin\Win64-VisualStudio\24.CursorControl.exe - ..\..\lib\Win64-visualstudio;%(AdditionalLibraryDirectories) - true - $(OutDir)CursorControl.pdb - Console - - - - - - - true - Speed - ..\..\include;%(AdditionalIncludeDirectories) - WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions) - Sync - - - Level3 - - - Cdecl - - - ..\..\bin\Win32-VisualStudio\24.CursorControl.exe - ..\..\lib\Win32-visualstudio;%(AdditionalLibraryDirectories) - false - Console - true - true - - - - - - - true - Speed - ..\..\include;%(AdditionalIncludeDirectories) - WIN32;WIN64;NDEBUG;_WINDOWS;%(PreprocessorDefinitions) - Sync - - - Level3 - - - Cdecl - - - ..\..\bin\Win64-VisualStudio\24.CursorControl.exe - ..\..\lib\Win64-visualstudio;%(AdditionalLibraryDirectories) - false - Console - true - true - - - - - - - - - - - \ No newline at end of file diff --git a/examples/24.CursorControl/CursorControl_vc14.vcxproj b/examples/24.CursorControl/CursorControl_vc14.vcxproj deleted file mode 100644 index 40a0a88e..00000000 --- a/examples/24.CursorControl/CursorControl_vc14.vcxproj +++ /dev/null @@ -1,188 +0,0 @@ - - - - - Debug - Win32 - - - Debug - x64 - - - Release - Win32 - - - Release - x64 - - - - 24.CursorControl - {02B67A37-50E1-49DB-BECF-905BC029C2FE} - 24.CursorControl - Win32Proj - - - - Application - MultiByte - v140 - - - Application - MultiByte - v140 - - - Application - MultiByte - v140 - - - Application - MultiByte - v140 - - - - - - - - - - - - - - - - - - - - - - - <_ProjectFileVersion>10.0.30319.1 - ..\..\bin\Win32-VisualStudio\ - ..\..\bin\Win64-VisualStudio\ - ..\..\bin\Win32-VisualStudio\ - ..\..\bin\Win64-VisualStudio\ - AllRules.ruleset - AllRules.ruleset - - - - - AllRules.ruleset - AllRules.ruleset - - - - - - - - Disabled - ..\..\include;%(AdditionalIncludeDirectories) - WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions) - true - EnableFastChecks - MultiThreadedDebug - - - Level3 - EditAndContinue - - - ..\..\bin\Win32-VisualStudio\24.CursorControl.exe - ..\..\lib\Win32-visualstudio;%(AdditionalLibraryDirectories) - true - $(OutDir)CursorControl.pdb - Console - - - - - - - Disabled - ..\..\include;%(AdditionalIncludeDirectories) - WIN32;WIN64;_DEBUG;_WINDOWS;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebug - - - Level3 - ProgramDatabase - - - ..\..\bin\Win64-VisualStudio\24.CursorControl.exe - ..\..\lib\Win64-visualstudio;%(AdditionalLibraryDirectories) - true - $(OutDir)CursorControl.pdb - Console - - - - - - - true - Speed - ..\..\include;%(AdditionalIncludeDirectories) - WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions) - Sync - - - Level3 - - - Cdecl - - - ..\..\bin\Win32-VisualStudio\24.CursorControl.exe - ..\..\lib\Win32-visualstudio;%(AdditionalLibraryDirectories) - false - Console - true - true - - - - - - - true - Speed - ..\..\include;%(AdditionalIncludeDirectories) - WIN32;WIN64;NDEBUG;_WINDOWS;%(PreprocessorDefinitions) - Sync - - - Level3 - - - Cdecl - - - ..\..\bin\Win64-VisualStudio\24.CursorControl.exe - ..\..\lib\Win64-visualstudio;%(AdditionalLibraryDirectories) - false - Console - true - true - - - - - - - - - - - \ No newline at end of file diff --git a/examples/24.CursorControl/Makefile b/examples/24.CursorControl/Makefile deleted file mode 100644 index f30f3701..00000000 --- a/examples/24.CursorControl/Makefile +++ /dev/null @@ -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 := 24.CursorControl -# 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 diff --git a/examples/24.CursorControl/main.cpp b/examples/24.CursorControl/main.cpp deleted file mode 100644 index 22c22cb7..00000000 --- a/examples/24.CursorControl/main.cpp +++ /dev/null @@ -1,566 +0,0 @@ -/** Example 024 CursorControl - -Show how to modify cursors and offer some useful tool-functions for creating cursors. -It can also be used for experiments with the mouse in general. -*/ - -#include -#include "driverChoice.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 - -const int DELAY_TIME = 3000; - -enum ETimerAction -{ - ETA_MOUSE_VISIBLE, - ETA_MOUSE_INVISIBLE, -}; - -/* - Structure to allow delayed execution of some actions. -*/ -struct TimerAction -{ - u32 TargetTime; - ETimerAction Action; -}; - -/* -*/ -struct SAppContext -{ - SAppContext() - : Device(0), InfoStatic(0), EventBox(0), CursorBox(0), SpriteBox(0) - , ButtonSetVisible(0), ButtonSetInvisible(0), ButtonSimulateBadFps(0) - , ButtonChangeIcon(0) - , SimulateBadFps(false) - { - } - - void update() - { - if (!Device) - return; - u32 timeNow = Device->getTimer()->getTime(); - for ( u32 i=0; i < TimerActions.size(); ++i ) - { - if ( timeNow >= TimerActions[i].TargetTime ) - { - runTimerAction(TimerActions[i]); - TimerActions.erase(i); - } - else - { - ++i; - } - } - } - - void runTimerAction(const TimerAction& action) - { - if (ETA_MOUSE_VISIBLE == action.Action) - { - Device->getCursorControl()->setVisible(true); - ButtonSetVisible->setEnabled(true); - } - else if ( ETA_MOUSE_INVISIBLE == action.Action) - { - Device->getCursorControl()->setVisible(false); - ButtonSetInvisible->setEnabled(true); - } - } - - /* - Add another icon which the user can click and select as cursor later on. - */ - void addIcon(const stringw& name, const SCursorSprite &sprite, bool addCursor=true) - { - // Sprites are just icons - not yet cursors. They can be displayed by Irrlicht sprite functions and be used to create cursors. - SpriteBox->addItem(name.c_str(), sprite.SpriteId); - Sprites.push_back(sprite); - - // create the cursor together with the icon? - if ( addCursor ) - { - /* Here we create a hardware cursor from a sprite */ - Device->getCursorControl()->addIcon(sprite); - - // ... and add it to the cursors selection listbox to the other system cursors. - CursorBox->addItem(name.c_str()); - } - } - - IrrlichtDevice * Device; - gui::IGUIStaticText * InfoStatic; - gui::IGUIListBox * EventBox; - gui::IGUIListBox * CursorBox; - gui::IGUIListBox * SpriteBox; - gui::IGUIButton * ButtonSetVisible; - gui::IGUIButton * ButtonSetInvisible; - gui::IGUIButton * ButtonSimulateBadFps; - gui::IGUIButton * ButtonChangeIcon; - array TimerActions; - bool SimulateBadFps; - array Sprites; -}; - -/* - Helper function to print mouse event names into a stringw -*/ -void PrintMouseEventName(const SEvent& event, stringw &result) -{ - switch ( event.MouseInput.Event ) - { - case EMIE_LMOUSE_PRESSED_DOWN: result += stringw(L"EMIE_LMOUSE_PRESSED_DOWN"); break; - case EMIE_RMOUSE_PRESSED_DOWN: result += stringw(L"EMIE_RMOUSE_PRESSED_DOWN"); break; - case EMIE_MMOUSE_PRESSED_DOWN: result += stringw(L"EMIE_MMOUSE_PRESSED_DOWN"); break; - case EMIE_LMOUSE_LEFT_UP: result += stringw(L"EMIE_LMOUSE_LEFT_UP"); break; - case EMIE_RMOUSE_LEFT_UP: result += stringw(L"EMIE_RMOUSE_LEFT_UP"); break; - case EMIE_MMOUSE_LEFT_UP: result += stringw(L"EMIE_MMOUSE_LEFT_UP"); break; - case EMIE_MOUSE_MOVED: result += stringw(L"EMIE_MOUSE_MOVED"); break; - case EMIE_MOUSE_WHEEL: result += stringw(L"EMIE_MOUSE_WHEEL"); break; - case EMIE_LMOUSE_DOUBLE_CLICK: result += stringw(L"EMIE_LMOUSE_DOUBLE_CLICK"); break; - case EMIE_RMOUSE_DOUBLE_CLICK: result += stringw(L"EMIE_RMOUSE_DOUBLE_CLICK"); break; - case EMIE_MMOUSE_DOUBLE_CLICK: result += stringw(L"EMIE_MMOUSE_DOUBLE_CLICK"); break; - case EMIE_LMOUSE_TRIPLE_CLICK: result += stringw(L"EMIE_LMOUSE_TRIPLE_CLICK"); break; - case EMIE_RMOUSE_TRIPLE_CLICK: result += stringw(L"EMIE_RMOUSE_TRIPLE_CLICK"); break; - case EMIE_MMOUSE_TRIPLE_CLICK: result += stringw(L"EMIE_MMOUSE_TRIPLE_CLICK"); break; - default: - break; - } -} - -/* - Helper function to print all the state information which get from a mouse-event into a stringw -*/ -void PrintMouseState(const SEvent& event, stringw &result) -{ - result += stringw(L"X: "); - result += stringw(event.MouseInput.X); - result += stringw(L"\n"); - - result += stringw(L"Y: "); - result += stringw(event.MouseInput.Y); - result += stringw(L"\n"); - - - result += stringw(L"Wheel: "); - result += stringw(event.MouseInput.Wheel); - result += stringw(L"\n"); - - result += stringw(L"Shift: "); - if ( event.MouseInput.Shift ) - result += stringw(L"true\n"); - else - result += stringw(L"false\n"); - - result += stringw(L"Control: "); - if ( event.MouseInput.Control ) - result += stringw(L"true\n"); - else - result += stringw(L"false\n"); - - result += stringw(L"ButtonStates: "); - result += stringw(event.MouseInput.ButtonStates); - result += stringw(L"\n"); - - result += stringw(L"isLeftPressed: "); - if ( event.MouseInput.isLeftPressed() ) - result += stringw(L"true\n"); - else - result += stringw(L"false\n"); - - result += stringw(L"isRightPressed: "); - if ( event.MouseInput.isRightPressed() ) - result += stringw(L"true\n"); - else - result += stringw(L"false\n"); - - result += stringw(L"isMiddlePressed: "); - if ( event.MouseInput.isMiddlePressed() ) - result += stringw(L"true\n"); - else - result += stringw(L"false\n"); - - result += stringw(L"Event: "); - - PrintMouseEventName(event, result); - - result += stringw(L"\n"); -} - -/* - A typical event receiver. -*/ -class MyEventReceiver : public IEventReceiver -{ -public: - MyEventReceiver(SAppContext & context) : Context(context) { } - - virtual bool OnEvent(const SEvent& event) - { - if (event.EventType == EET_GUI_EVENT ) - { - switch ( event.GUIEvent.EventType ) - { - case EGET_BUTTON_CLICKED: - { - u32 timeNow = Context.Device->getTimer()->getTime(); - TimerAction action; - action.TargetTime = timeNow + DELAY_TIME; - if ( event.GUIEvent.Caller == Context.ButtonSetVisible ) - { - action.Action = ETA_MOUSE_VISIBLE; - Context.TimerActions.push_back(action); - Context.ButtonSetVisible->setEnabled(false); - } - else if ( event.GUIEvent.Caller == Context.ButtonSetInvisible ) - { - action.Action = ETA_MOUSE_INVISIBLE; - Context.TimerActions.push_back(action); - Context.ButtonSetInvisible->setEnabled(false); - } - else if ( event.GUIEvent.Caller == Context.ButtonSimulateBadFps ) - { - Context.SimulateBadFps = Context.ButtonSimulateBadFps->isPressed(); - } - else if ( event.GUIEvent.Caller == Context.ButtonChangeIcon ) - { - /* - Replace an existing cursor icon by another icon. - The user has to select both - the icon which should be replaced and the icon which will replace it. - */ - s32 selectedCursor = Context.CursorBox->getSelected(); - s32 selectedSprite = Context.SpriteBox->getSelected(); - if ( selectedCursor >= 0 && selectedSprite >= 0 ) - { - /* - This does replace the icon. - */ - Context.Device->getCursorControl()->changeIcon((ECURSOR_ICON)selectedCursor, Context.Sprites[selectedSprite] ); - - /* - Do also show the new icon. - */ - Context.Device->getCursorControl()->setActiveIcon( ECURSOR_ICON(selectedCursor) ); - } - } - } - break; - case EGET_LISTBOX_CHANGED: - case EGET_LISTBOX_SELECTED_AGAIN: - { - if ( event.GUIEvent.Caller == Context.CursorBox ) - { - /* - Find out which cursor the user selected - */ - s32 selected = Context.CursorBox->getSelected(); - if ( selected >= 0 ) - { - /* - Here we set the new cursor icon which will now be used within our window. - */ - Context.Device->getCursorControl()->setActiveIcon( ECURSOR_ICON(selected) ); - } - } - } - break; - default: - break; - } - } - - if (event.EventType == EET_MOUSE_INPUT_EVENT) - { - stringw infoText; - PrintMouseState(event, infoText); - Context.InfoStatic->setText(infoText.c_str()); - if ( event.MouseInput.Event != EMIE_MOUSE_MOVED && event.MouseInput.Event != EMIE_MOUSE_WHEEL ) // no spam - { - infoText = L""; - PrintMouseEventName(event, infoText); - Context.EventBox->insertItem(0, infoText.c_str(), -1); - } - } - - return false; - } - -private: - SAppContext & Context; -}; - -/* - Use several imagefiles as animation frames for a sprite which can be used as cursor icon. - The images in those files all need to have the same size. - Return sprite index on success or -1 on failure -*/ -s32 AddAnimatedIconToSpriteBank( gui::IGUISpriteBank * spriteBank, video::IVideoDriver* driver, const array< io::path >& files, u32 frameTime ) -{ - if ( !spriteBank || !driver || !files.size() ) - return -1; - - video::ITexture * tex = driver->getTexture( files[0] ); - if ( tex ) - { - array< rect >& spritePositions = spriteBank->getPositions(); - u32 idxRect = spritePositions.size(); - spritePositions.push_back( rect(0,0, tex->getSize().Width, tex->getSize().Height) ); - - SGUISprite sprite; - sprite.frameTime = frameTime; - - array< SGUISprite >& sprites = spriteBank->getSprites(); - u32 startIdx = spriteBank->getTextureCount(); - for ( u32 f=0; f < files.size(); ++f ) - { - tex = driver->getTexture( files[f] ); - if ( tex ) - { - spriteBank->addTexture( driver->getTexture(files[f]) ); - gui::SGUISpriteFrame frame; - frame.rectNumber = idxRect; - frame.textureNumber = startIdx+f; - sprite.Frames.push_back( frame ); - } - } - - sprites.push_back( sprite ); - return sprites.size()-1; - } - - return -1; -} - -/* - Use several images within one imagefile as animation frames for a sprite which can be used as cursor icon - The sizes of the icons within that file all need to have the same size - Return sprite index on success or -1 on failure -*/ -s32 AddAnimatedIconToSpriteBank( gui::IGUISpriteBank * spriteBank, video::IVideoDriver* driver, const io::path& file, const array< rect >& rects, u32 frameTime ) -{ - if ( !spriteBank || !driver || !rects.size() ) - return -1; - - video::ITexture * tex = driver->getTexture( file ); - if ( tex ) - { - array< rect >& spritePositions = spriteBank->getPositions(); - u32 idxRect = spritePositions.size(); - u32 idxTex = spriteBank->getTextureCount(); - spriteBank->addTexture( tex ); - - SGUISprite sprite; - sprite.frameTime = frameTime; - - array< SGUISprite >& sprites = spriteBank->getSprites(); - for ( u32 i=0; i < rects.size(); ++i ) - { - spritePositions.push_back( rects[i] ); - - gui::SGUISpriteFrame frame; - frame.rectNumber = idxRect+i; - frame.textureNumber = idxTex; - sprite.Frames.push_back( frame ); - } - - sprites.push_back( sprite ); - return sprites.size()-1; - } - - return -1; -} - -/* - Create a non-animated icon from the given file and position and put it into the spritebank. - We can use this icon later on in a cursor. -*/ -s32 AddIconToSpriteBank( gui::IGUISpriteBank * spriteBank, video::IVideoDriver* driver, const io::path& file, const core::rect& rect ) -{ - if ( !spriteBank || !driver ) - return -1; - - video::ITexture * tex = driver->getTexture( file ); - if ( tex ) - { - core::array< core::rect >& spritePositions = spriteBank->getPositions(); - spritePositions.push_back( rect ); - array< SGUISprite >& sprites = spriteBank->getSprites(); - spriteBank->addTexture( tex ); - - gui::SGUISpriteFrame frame; - frame.rectNumber = spritePositions.size()-1; - frame.textureNumber = spriteBank->getTextureCount()-1; - - SGUISprite sprite; - sprite.frameTime = 0; - sprite.Frames.push_back( frame ); - - sprites.push_back( sprite ); - - return sprites.size()-1; - } - - return -1; -} - -int main() -{ - video::E_DRIVER_TYPE driverType = driverChoiceConsole(); - if (driverType==video::EDT_COUNT) - return 1; - - IrrlichtDevice * device = createDevice(driverType, dimension2d(640, 480)); - if (device == 0) - return 1; // could not create selected driver. - - // It's sometimes of interest to know how the mouse behaves after a resize - device->setResizable(true); - - device->setWindowCaption(L"Cursor control - Irrlicht engine tutorial"); - video::IVideoDriver* driver = device->getVideoDriver(); - IGUIEnvironment* env = device->getGUIEnvironment(); - - gui::IGUISpriteBank * SpriteBankIcons; - - SAppContext context; - context.Device = device; - - rect< s32 > rectInfoStatic(10,10, 200, 200); - env->addStaticText (L"Cursor state information", rectInfoStatic, true, true); - rectInfoStatic.UpperLeftCorner += dimension2di(0, 15); - context.InfoStatic = env->addStaticText (L"", rectInfoStatic, true, true); - rect< s32 > rectEventBox(10,210, 200, 400); - env->addStaticText (L"click events (new on top)", rectEventBox, true, true); - rectEventBox.UpperLeftCorner += dimension2di(0, 15); - context.EventBox = env->addListBox(rectEventBox); - rect< s32 > rectCursorBox(210,10, 400, 250); - env->addStaticText (L"cursors, click to set the active one", rectCursorBox, true, true); - rectCursorBox.UpperLeftCorner += dimension2di(0, 15); - context.CursorBox = env->addListBox(rectCursorBox); - rect< s32 > rectSpriteBox(210,260, 400, 400); - env->addStaticText (L"sprites", rectSpriteBox, true, true); - rectSpriteBox.UpperLeftCorner += dimension2di(0, 15); - context.SpriteBox = env->addListBox(rectSpriteBox); - - context.ButtonSetVisible = env->addButton( rect( 410, 20, 560, 40 ), 0, -1, L"set visible (delayed)" ); - context.ButtonSetInvisible = env->addButton( rect( 410, 50, 560, 70 ), 0, -1, L"set invisible (delayed)" ); - context.ButtonSimulateBadFps = env->addButton( rect( 410, 80, 560, 100 ), 0, -1, L"simulate bad FPS" ); - context.ButtonSimulateBadFps->setIsPushButton(true); - context.ButtonChangeIcon = env->addButton( rect( 410, 140, 560, 160 ), 0, -1, L"replace cursor icon\n(cursor+sprite must be selected)" ); - - // set the names for all the system cursors - for ( int i=0; i < (int)gui::ECI_COUNT; ++i ) - { - context.CursorBox->addItem(stringw( GUICursorIconNames[i] ).c_str()); - } - - /* - Create sprites which then can be used as cursor icons. - */ - SpriteBankIcons = env->addEmptySpriteBank(io::path("cursor_icons")); - context.SpriteBox->setSpriteBank(SpriteBankIcons); - - const io::path mediaPath = getExampleMediaPath(); - - // create one animated icon from several files - array< io::path > files; - files.push_back( io::path(mediaPath + "icon_crosshairs16x16bw1.png") ); - files.push_back( io::path(mediaPath + "icon_crosshairs16x16bw2.png") ); - files.push_back( io::path(mediaPath + "icon_crosshairs16x16bw3.png") ); - files.push_back( io::path(mediaPath + "icon_crosshairs16x16bw3.png") ); - files.push_back( io::path(mediaPath + "icon_crosshairs16x16bw2.png") ); - SCursorSprite spriteBw; // the sprite + some additional information needed for cursors - spriteBw.SpriteId = AddAnimatedIconToSpriteBank( SpriteBankIcons, driver, files, 200 ); - spriteBw.SpriteBank = SpriteBankIcons; - spriteBw.HotSpot = position2d(7,7); - context.addIcon(L"crosshair_bw", spriteBw); - - // create one animated icon from one file - array< rect > iconRects; - iconRects.push_back( rect(0,0, 16, 16) ); - iconRects.push_back( rect(16,0, 32, 16) ); - iconRects.push_back( rect(0,16, 16, 32) ); - iconRects.push_back( rect(0,16, 16, 32) ); - iconRects.push_back( rect(16,0, 32, 16) ); - SCursorSprite spriteCol; // the sprite + some additional information needed for cursors - spriteCol.SpriteId = AddAnimatedIconToSpriteBank( SpriteBankIcons, driver, io::path(mediaPath + "icon_crosshairs16x16col.png"), iconRects, 200 ); - spriteCol.HotSpot = position2d(7,7); - spriteCol.SpriteBank = SpriteBankIcons; - context.addIcon(L"crosshair_colored", spriteCol); - - // Create some non-animated icons - rect rectIcon; - SCursorSprite spriteNonAnimated(SpriteBankIcons, 0, position2d(7,7)); - - rectIcon = rect(0,0, 16, 16); - spriteNonAnimated.SpriteId = AddIconToSpriteBank( SpriteBankIcons, driver, io::path(mediaPath + "icon_crosshairs16x16col.png"), rectIcon ); - context.addIcon(L"crosshair_col1", spriteNonAnimated, false); - - rectIcon = rect(16,0, 32, 16); - spriteNonAnimated.SpriteId = AddIconToSpriteBank( SpriteBankIcons, driver, io::path(mediaPath + "icon_crosshairs16x16col.png"), rectIcon ); - context.addIcon(L"crosshair_col2", spriteNonAnimated, false); - - rectIcon = rect(0,16, 16, 32); - spriteNonAnimated.SpriteId = AddIconToSpriteBank( SpriteBankIcons, driver, io::path(mediaPath + "icon_crosshairs16x16col.png"), rectIcon ); - context.addIcon(L"crosshair_col3", spriteNonAnimated, false); - - - MyEventReceiver receiver(context); - device->setEventReceiver(&receiver); - - while(device->run() && driver) - { - // if (device->isWindowActive()) - { - u32 realTimeNow = device->getTimer()->getRealTime(); - - context.update(); - - driver->beginScene(video::ECBF_COLOR | video::ECBF_DEPTH, SColor(0,200,200,200)); - - env->drawAll(); - - // draw custom sprite with Irrlicht functions for comparison. It should usually look the same as the cursors. - if ( context.SpriteBox ) - { - s32 selectedSprite = context.SpriteBox->getSelected(); - if ( selectedSprite >= 0 && context.Sprites[selectedSprite].SpriteId >= 0 ) - { - SpriteBankIcons->draw2DSprite(u32(context.Sprites[selectedSprite].SpriteId), position2di(580, 140), 0, video::SColor(255, 255, 255, 255), 0, realTimeNow); - } - } - - driver->endScene(); - } - - // By simulating bad fps we can find out if hardware-support for cursors works or not. If it works the cursor will move as usual,while it otherwise will just update with 2 fps now. - if ( context.SimulateBadFps ) - { - device->sleep(500); // 2 fps - } - else - { - device->sleep(10); - } - } - - device->drop(); - - return 0; -} - -/* -**/ diff --git a/examples/26.OcclusionQuery/Makefile b/examples/26.OcclusionQuery/Makefile deleted file mode 100644 index b01efd30..00000000 --- a/examples/26.OcclusionQuery/Makefile +++ /dev/null @@ -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 := 26.OcclusionQuery -# 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 diff --git a/examples/26.OcclusionQuery/OcclusionQuery.cbp b/examples/26.OcclusionQuery/OcclusionQuery.cbp deleted file mode 100644 index 09587e5d..00000000 --- a/examples/26.OcclusionQuery/OcclusionQuery.cbp +++ /dev/null @@ -1,55 +0,0 @@ - - - - - - diff --git a/examples/26.OcclusionQuery/OcclusionQuery.vcproj b/examples/26.OcclusionQuery/OcclusionQuery.vcproj deleted file mode 100644 index 602f2d3d..00000000 --- a/examples/26.OcclusionQuery/OcclusionQuery.vcproj +++ /dev/null @@ -1,163 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/examples/26.OcclusionQuery/OcclusionQuery.xcodeproj/project.pbxproj b/examples/26.OcclusionQuery/OcclusionQuery.xcodeproj/project.pbxproj deleted file mode 100644 index 26ea259a..00000000 --- a/examples/26.OcclusionQuery/OcclusionQuery.xcodeproj/project.pbxproj +++ /dev/null @@ -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 /* 26.OcclusionQuery.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = 26.OcclusionQuery.app; sourceTree = BUILT_PRODUCTS_DIR; }; - 5E34CC741B7F8EEF00F212E8 /* main.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = main.cpp; sourceTree = ""; }; - 5E34CC781B7F90A000F212E8 /* libIrrlicht.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libIrrlicht.a; path = ../../lib/OSX/libIrrlicht.a; sourceTree = ""; }; - 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 = ""; }; -/* 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 = ""; - }; - 5E34CC521B7F8E6E00F212E8 /* Products */ = { - isa = PBXGroup; - children = ( - 5E34CC511B7F8E6E00F212E8 /* 26.OcclusionQuery.app */, - ); - name = Products; - sourceTree = ""; - }; - 5E34CC761B7F905600F212E8 /* Libraries */ = { - isa = PBXGroup; - children = ( - 5E8570B01B7F99F500B267D2 /* Cocoa.framework */, - 5E8570B41B7F9A0700B267D2 /* IOKit.framework */, - 5E8570B21B7F99FE00B267D2 /* OpenGL.framework */, - 5E34CC781B7F90A000F212E8 /* libIrrlicht.a */, - ); - name = Libraries; - sourceTree = ""; - }; - 5E34CC771B7F906D00F212E8 /* Resources */ = { - isa = PBXGroup; - children = ( - 5E8570BE1B7F9D3A00B267D2 /* media */, - ); - name = Resources; - sourceTree = ""; - }; -/* End PBXGroup section */ - -/* Begin PBXNativeTarget section */ - 5E34CC501B7F8E6E00F212E8 /* 26.OcclusionQuery */ = { - isa = PBXNativeTarget; - buildConfigurationList = 5E34CC701B7F8E6E00F212E8 /* Build configuration list for PBXNativeTarget "26.OcclusionQuery" */; - buildPhases = ( - 5E34CC4D1B7F8E6E00F212E8 /* Sources */, - 5E34CC4E1B7F8E6E00F212E8 /* Frameworks */, - 5E34CC4F1B7F8E6E00F212E8 /* Resources */, - ); - buildRules = ( - ); - dependencies = ( - ); - name = 26.OcclusionQuery; - productName = 01.HelloWorld; - productReference = 5E34CC511B7F8E6E00F212E8 /* 26.OcclusionQuery.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 "OcclusionQuery" */; - compatibilityVersion = "Xcode 3.2"; - developmentRegion = English; - hasScannedForEncodings = 0; - knownRegions = ( - en, - Base, - ); - mainGroup = 5E34C6D81B7F4A0C00F212E8; - productRefGroup = 5E34CC521B7F8E6E00F212E8 /* Products */; - projectDirPath = ""; - projectRoot = ""; - targets = ( - 5E34CC501B7F8E6E00F212E8 /* 26.OcclusionQuery */, - ); - }; -/* 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 "OcclusionQuery" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 5E34C6DD1B7F4A0C00F212E8 /* Debug */, - 5E34C6DE1B7F4A0C00F212E8 /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - 5E34CC701B7F8E6E00F212E8 /* Build configuration list for PBXNativeTarget "26.OcclusionQuery" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 5E34CC6C1B7F8E6E00F212E8 /* Debug */, - 5E34CC6D1B7F8E6E00F212E8 /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; -/* End XCConfigurationList section */ - }; - rootObject = 5E34C6D91B7F4A0C00F212E8 /* Project object */; -} diff --git a/examples/26.OcclusionQuery/OcclusionQuery.xcodeproj/xcshareddata/xcschemes/26.OcclusionQuery.xcscheme b/examples/26.OcclusionQuery/OcclusionQuery.xcodeproj/xcshareddata/xcschemes/26.OcclusionQuery.xcscheme deleted file mode 100644 index 3004daa8..00000000 --- a/examples/26.OcclusionQuery/OcclusionQuery.xcodeproj/xcshareddata/xcschemes/26.OcclusionQuery.xcscheme +++ /dev/null @@ -1,91 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/examples/26.OcclusionQuery/OcclusionQuery_vc10.vcxproj b/examples/26.OcclusionQuery/OcclusionQuery_vc10.vcxproj deleted file mode 100644 index 370d3683..00000000 --- a/examples/26.OcclusionQuery/OcclusionQuery_vc10.vcxproj +++ /dev/null @@ -1,235 +0,0 @@ - - - - - Debug - Win32 - - - Debug - x64 - - - Release - Win32 - - - Release - x64 - - - - 26.OcclusionQuery - {5CE0E2E7-879D-4152-B61D-24E7D0707B45} - OcclusionQuery - - - - Application - false - MultiByte - Windows7.1SDK - - - Application - false - MultiByte - Windows7.1SDK - - - Application - false - MultiByte - Windows7.1SDK - - - Application - false - MultiByte - Windows7.1SDK - - - - - - - - - - - - - - - - - - - - - - - <_ProjectFileVersion>10.0.30319.1 - ..\..\bin\Win32-VisualStudio\ - ..\..\bin\Win64-VisualStudio\ - - - ..\..\bin\Win32-VisualStudio\ - ..\..\bin\Win64-VisualStudio\ - - - AllRules.ruleset - AllRules.ruleset - - - - - AllRules.ruleset - AllRules.ruleset - - - - - - - - .\Debug\OcclusionQuery.tlb - - - - - Disabled - ..\..\include;%(AdditionalIncludeDirectories) - WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebug - - - Level3 - EditAndContinue - - - _DEBUG;%(PreprocessorDefinitions) - 0x0c07 - - - ..\..\bin\Win32-VisualStudio\26.OcclusionQuery.exe - ..\..\lib\Win32-visualstudio;%(AdditionalLibraryDirectories) - true - Console - - - - - - - .\Debug\OcclusionQuery.tlb - - - - - Disabled - ..\..\include;%(AdditionalIncludeDirectories) - WIN32;WIN64;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebug - - - Level3 - ProgramDatabase - - - _DEBUG;%(PreprocessorDefinitions) - 0x0c07 - - - ..\..\bin\Win64-VisualStudio\26.OcclusionQuery.exe - ..\..\lib\Win64-visualstudio;%(AdditionalLibraryDirectories) - true - Console - - - - - - - .\Release\OcclusionQuery.tlb - - - - - MaxSpeed - OnlyExplicitInline - ..\..\include;%(AdditionalIncludeDirectories) - WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) - true - MultiThreaded - true - - - Level3 - - - NDEBUG;%(PreprocessorDefinitions) - 0x0c07 - - - ..\..\bin\Win32-VisualStudio\26.OcclusionQuery.exe - ..\..\lib\Win32-visualstudio;%(AdditionalLibraryDirectories) - Console - - - - - - - .\Release\OcclusionQuery.tlb - - - - - MaxSpeed - OnlyExplicitInline - ..\..\include;%(AdditionalIncludeDirectories) - WIN32;WIN64;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) - true - MultiThreaded - true - - - Level3 - - - NDEBUG;%(PreprocessorDefinitions) - 0x0c07 - - - ..\..\bin\Win64-VisualStudio\26.OcclusionQuery.exe - ..\..\lib\Win64-visualstudio;%(AdditionalLibraryDirectories) - Console - - - - - - - Disabled - Disabled - %(AdditionalIncludeDirectories) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(PreprocessorDefinitions) - EnableFastChecks - EnableFastChecks - MaxSpeed - MaxSpeed - %(AdditionalIncludeDirectories) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(PreprocessorDefinitions) - - - - - - \ No newline at end of file diff --git a/examples/26.OcclusionQuery/OcclusionQuery_vc11.vcxproj b/examples/26.OcclusionQuery/OcclusionQuery_vc11.vcxproj deleted file mode 100644 index 370d3683..00000000 --- a/examples/26.OcclusionQuery/OcclusionQuery_vc11.vcxproj +++ /dev/null @@ -1,235 +0,0 @@ - - - - - Debug - Win32 - - - Debug - x64 - - - Release - Win32 - - - Release - x64 - - - - 26.OcclusionQuery - {5CE0E2E7-879D-4152-B61D-24E7D0707B45} - OcclusionQuery - - - - Application - false - MultiByte - Windows7.1SDK - - - Application - false - MultiByte - Windows7.1SDK - - - Application - false - MultiByte - Windows7.1SDK - - - Application - false - MultiByte - Windows7.1SDK - - - - - - - - - - - - - - - - - - - - - - - <_ProjectFileVersion>10.0.30319.1 - ..\..\bin\Win32-VisualStudio\ - ..\..\bin\Win64-VisualStudio\ - - - ..\..\bin\Win32-VisualStudio\ - ..\..\bin\Win64-VisualStudio\ - - - AllRules.ruleset - AllRules.ruleset - - - - - AllRules.ruleset - AllRules.ruleset - - - - - - - - .\Debug\OcclusionQuery.tlb - - - - - Disabled - ..\..\include;%(AdditionalIncludeDirectories) - WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebug - - - Level3 - EditAndContinue - - - _DEBUG;%(PreprocessorDefinitions) - 0x0c07 - - - ..\..\bin\Win32-VisualStudio\26.OcclusionQuery.exe - ..\..\lib\Win32-visualstudio;%(AdditionalLibraryDirectories) - true - Console - - - - - - - .\Debug\OcclusionQuery.tlb - - - - - Disabled - ..\..\include;%(AdditionalIncludeDirectories) - WIN32;WIN64;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebug - - - Level3 - ProgramDatabase - - - _DEBUG;%(PreprocessorDefinitions) - 0x0c07 - - - ..\..\bin\Win64-VisualStudio\26.OcclusionQuery.exe - ..\..\lib\Win64-visualstudio;%(AdditionalLibraryDirectories) - true - Console - - - - - - - .\Release\OcclusionQuery.tlb - - - - - MaxSpeed - OnlyExplicitInline - ..\..\include;%(AdditionalIncludeDirectories) - WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) - true - MultiThreaded - true - - - Level3 - - - NDEBUG;%(PreprocessorDefinitions) - 0x0c07 - - - ..\..\bin\Win32-VisualStudio\26.OcclusionQuery.exe - ..\..\lib\Win32-visualstudio;%(AdditionalLibraryDirectories) - Console - - - - - - - .\Release\OcclusionQuery.tlb - - - - - MaxSpeed - OnlyExplicitInline - ..\..\include;%(AdditionalIncludeDirectories) - WIN32;WIN64;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) - true - MultiThreaded - true - - - Level3 - - - NDEBUG;%(PreprocessorDefinitions) - 0x0c07 - - - ..\..\bin\Win64-VisualStudio\26.OcclusionQuery.exe - ..\..\lib\Win64-visualstudio;%(AdditionalLibraryDirectories) - Console - - - - - - - Disabled - Disabled - %(AdditionalIncludeDirectories) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(PreprocessorDefinitions) - EnableFastChecks - EnableFastChecks - MaxSpeed - MaxSpeed - %(AdditionalIncludeDirectories) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(PreprocessorDefinitions) - - - - - - \ No newline at end of file diff --git a/examples/26.OcclusionQuery/OcclusionQuery_vc12.vcxproj b/examples/26.OcclusionQuery/OcclusionQuery_vc12.vcxproj deleted file mode 100644 index e181a45f..00000000 --- a/examples/26.OcclusionQuery/OcclusionQuery_vc12.vcxproj +++ /dev/null @@ -1,235 +0,0 @@ - - - - - Debug - Win32 - - - Debug - x64 - - - Release - Win32 - - - Release - x64 - - - - 26.OcclusionQuery - {5CE0E2E7-879D-4152-B61D-24E7D0707B45} - OcclusionQuery - - - - Application - false - MultiByte - Windows7.1SDK - - - Application - false - MultiByte - Windows7.1SDK - - - Application - false - MultiByte - Windows7.1SDK - - - Application - false - MultiByte - Windows7.1SDK - - - - - - - - - - - - - - - - - - - - - - - <_ProjectFileVersion>10.0.30319.1 - ..\..\bin\Win32-VisualStudio\ - ..\..\bin\Win64-VisualStudio\ - - - ..\..\bin\Win32-VisualStudio\ - ..\..\bin\Win64-VisualStudio\ - - - AllRules.ruleset - AllRules.ruleset - - - - - AllRules.ruleset - AllRules.ruleset - - - - - - - - .\Debug\OcclusionQuery.tlb - - - - - Disabled - ..\..\include;%(AdditionalIncludeDirectories) - WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebug - - - Level3 - EditAndContinue - - - _DEBUG;%(PreprocessorDefinitions) - 0x0c07 - - - ..\..\bin\Win32-VisualStudio\26.OcclusionQuery.exe - ..\..\lib\Win32-visualstudio;%(AdditionalLibraryDirectories) - true - Console - - - - - - - .\Debug\OcclusionQuery.tlb - - - - - Disabled - ..\..\include;%(AdditionalIncludeDirectories) - WIN32;WIN64;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebug - - - Level3 - ProgramDatabase - - - _DEBUG;%(PreprocessorDefinitions) - 0x0c07 - - - ..\..\bin\Win64-VisualStudio\26.OcclusionQuery.exe - ..\..\lib\Win64-visualstudio;%(AdditionalLibraryDirectories) - true - Console - - - - - - - .\Release\OcclusionQuery.tlb - - - - - MaxSpeed - OnlyExplicitInline - ..\..\include;%(AdditionalIncludeDirectories) - WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) - true - MultiThreaded - true - - - Level3 - - - NDEBUG;%(PreprocessorDefinitions) - 0x0c07 - - - ..\..\bin\Win32-VisualStudio\26.OcclusionQuery.exe - ..\..\lib\Win32-visualstudio;%(AdditionalLibraryDirectories) - Console - - - - - - - .\Release\OcclusionQuery.tlb - - - - - MaxSpeed - OnlyExplicitInline - ..\..\include;%(AdditionalIncludeDirectories) - WIN32;WIN64;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) - true - MultiThreaded - true - - - Level3 - - - NDEBUG;%(PreprocessorDefinitions) - 0x0c07 - - - ..\..\bin\Win64-VisualStudio\26.OcclusionQuery.exe - ..\..\lib\Win64-visualstudio;%(AdditionalLibraryDirectories) - Console - - - - - - - Disabled - Disabled - %(AdditionalIncludeDirectories) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(PreprocessorDefinitions) - EnableFastChecks - EnableFastChecks - MaxSpeed - MaxSpeed - %(AdditionalIncludeDirectories) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(PreprocessorDefinitions) - - - - - - \ No newline at end of file diff --git a/examples/26.OcclusionQuery/OcclusionQuery_vc14.vcxproj b/examples/26.OcclusionQuery/OcclusionQuery_vc14.vcxproj deleted file mode 100644 index d52b6d59..00000000 --- a/examples/26.OcclusionQuery/OcclusionQuery_vc14.vcxproj +++ /dev/null @@ -1,235 +0,0 @@ - - - - - Debug - Win32 - - - Debug - x64 - - - Release - Win32 - - - Release - x64 - - - - 26.OcclusionQuery - {5CE0E2E7-879D-4152-B61D-24E7D0707B45} - OcclusionQuery - - - - Application - false - MultiByte - v140 - - - Application - false - MultiByte - v140 - - - Application - false - MultiByte - v140 - - - Application - false - MultiByte - v140 - - - - - - - - - - - - - - - - - - - - - - - <_ProjectFileVersion>10.0.30319.1 - ..\..\bin\Win32-VisualStudio\ - ..\..\bin\Win64-VisualStudio\ - - - ..\..\bin\Win32-VisualStudio\ - ..\..\bin\Win64-VisualStudio\ - - - AllRules.ruleset - AllRules.ruleset - - - - - AllRules.ruleset - AllRules.ruleset - - - - - - - - .\Debug\OcclusionQuery.tlb - - - - - Disabled - ..\..\include;%(AdditionalIncludeDirectories) - WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebug - - - Level3 - EditAndContinue - - - _DEBUG;%(PreprocessorDefinitions) - 0x0c07 - - - ..\..\bin\Win32-VisualStudio\26.OcclusionQuery.exe - ..\..\lib\Win32-visualstudio;%(AdditionalLibraryDirectories) - true - Console - - - - - - - .\Debug\OcclusionQuery.tlb - - - - - Disabled - ..\..\include;%(AdditionalIncludeDirectories) - WIN32;WIN64;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebug - - - Level3 - ProgramDatabase - - - _DEBUG;%(PreprocessorDefinitions) - 0x0c07 - - - ..\..\bin\Win64-VisualStudio\26.OcclusionQuery.exe - ..\..\lib\Win64-visualstudio;%(AdditionalLibraryDirectories) - true - Console - - - - - - - .\Release\OcclusionQuery.tlb - - - - - MaxSpeed - OnlyExplicitInline - ..\..\include;%(AdditionalIncludeDirectories) - WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) - true - MultiThreaded - true - - - Level3 - - - NDEBUG;%(PreprocessorDefinitions) - 0x0c07 - - - ..\..\bin\Win32-VisualStudio\26.OcclusionQuery.exe - ..\..\lib\Win32-visualstudio;%(AdditionalLibraryDirectories) - Console - - - - - - - .\Release\OcclusionQuery.tlb - - - - - MaxSpeed - OnlyExplicitInline - ..\..\include;%(AdditionalIncludeDirectories) - WIN32;WIN64;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) - true - MultiThreaded - true - - - Level3 - - - NDEBUG;%(PreprocessorDefinitions) - 0x0c07 - - - ..\..\bin\Win64-VisualStudio\26.OcclusionQuery.exe - ..\..\lib\Win64-visualstudio;%(AdditionalLibraryDirectories) - Console - - - - - - - Disabled - Disabled - %(AdditionalIncludeDirectories) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(PreprocessorDefinitions) - EnableFastChecks - EnableFastChecks - MaxSpeed - MaxSpeed - %(AdditionalIncludeDirectories) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(PreprocessorDefinitions) - - - - - - \ No newline at end of file diff --git a/examples/26.OcclusionQuery/main.cpp b/examples/26.OcclusionQuery/main.cpp deleted file mode 100644 index 6aea63cb..00000000 --- a/examples/26.OcclusionQuery/main.cpp +++ /dev/null @@ -1,216 +0,0 @@ -/** Example 026 OcclusionQuery - -This tutorial shows how to speed up rendering by use of the -OcclusionQuery feature. The usual rendering tries to avoid rendering of -scene nodes by culling those nodes which are outside the visible area, the -view frustum. However, this technique does not cope with occluded objects -which are still in the line of sight, but occluded by some larger object -between the object and the eye (camera). Occlusion queries check exactly that. -The queries basically measure the number of pixels that a previous render -left on the screen. -Since those pixels cannot be recognized at the end of a rendering anymore, -the pixel count is measured directly when rendering. Thus, one needs to render -the occluder (the object in front) first. This object needs to write to the -z-buffer in order to become a real occluder. Then the node is rendered and in -case a z-pass happens, i.e. the pixel is written to the framebuffer, the pixel -is counted in the query. -The result of a query is the number of pixels which got through. One can, based -on this number, judge if the scene node is visible enough to be rendered, or if -the node should be removed in the next round. Also note that the number of -pixels is a safe over approximation in general. The pixels might be overdrawn -later on, and the GPU tries to avoid inaccuracies which could lead to false -negatives in the queries. - -As you might have recognized already, we had to render the node to get the -numbers. So where's the benefit, you might say. There are several ways where -occlusion queries can help. It is often a good idea to just render the bbox -of the node instead of the actual mesh. This is really fast and is a safe over -approximation. If you need a more exact render with the actual geometry, it's -a good idea to render with just basic solid material. Avoid complex shaders -and state changes through textures. There's no need while just doing the -occlusion query. At least if the render is not used for the actual scene. This -is the third way to optimize occlusion queries. Just check the queries every -5th or 10th frame, or even less frequent. This depends on the movement speed -of the objects and camera. -*/ - -#ifdef _MSC_VER -// We'll also define this to stop MSVC complaining about sprintf(). -#define _CRT_SECURE_NO_WARNINGS -#pragma comment(lib, "Irrlicht.lib") -#endif - -#include -#include "driverChoice.h" -#include "exampleHelper.h" - -using namespace irr; - -/* -We need keyboard input events to switch some parameters -*/ -class MyEventReceiver : public IEventReceiver -{ -public: - // This is the one method that we have to implement - virtual bool OnEvent(const SEvent& event) - { - // Remember whether each key is down or up - if (event.EventType == irr::EET_KEY_INPUT_EVENT) - KeyIsDown[event.KeyInput.Key] = event.KeyInput.PressedDown; - - return false; - } - - // This is used to check whether a key is being held down - virtual bool IsKeyDown(EKEY_CODE keyCode) const - { - return KeyIsDown[keyCode]; - } - - MyEventReceiver() - { - for (u32 i=0; i(640, 480), 16, false, false, false, &receiver); - - if (device == 0) - return 1; // could not create selected driver. - - video::IVideoDriver* driver = device->getVideoDriver(); - scene::ISceneManager* smgr = device->getSceneManager(); - - const io::path mediaPath = getExampleMediaPath(); - - smgr->getGUIEnvironment()->addStaticText(L"Press Space to hide occluder.", core::recti(10,10, 200,50)); - - /* - Create the node to be occluded. We create a sphere node with high poly count. - */ - scene::ISceneNode * node = smgr->addSphereSceneNode(10, 64); - if (node) - { - node->setPosition(core::vector3df(0,0,60)); - node->setMaterialTexture(0, driver->getTexture(mediaPath + "wall.bmp")); - node->setMaterialFlag(video::EMF_LIGHTING, false); - } - - /* - Now we create another node, the occluder. It's a simple plane. - */ - scene::ISceneNode* plane = smgr->addMeshSceneNode(smgr->addHillPlaneMesh( - "plane", core::dimension2df(10,10), core::dimension2du(2,2)), 0, -1, - core::vector3df(0,0,20), core::vector3df(270,0,0)); - - if (plane) - { - plane->setMaterialTexture(0, driver->getTexture(mediaPath + "t351sml.jpg")); - plane->setMaterialFlag(video::EMF_LIGHTING, false); - plane->setMaterialFlag(video::EMF_BACK_FACE_CULLING, true); - } - - /* - Here we create the occlusion query. Because we don't have a plain mesh scene node - (ESNT_MESH or ESNT_ANIMATED_MESH), we pass the base geometry as well. Instead, - we could also pass a simpler mesh or the bounding box. But we will use a time - based method, where the occlusion query renders to the frame buffer and in case - of success (occlusion), the mesh is not drawn for several frames. - */ - driver->addOcclusionQuery(node, ((scene::IMeshSceneNode*)node)->getMesh()); - - /* - We have done everything, just a camera and draw it. We also write the - current frames per second and the name of the driver to the caption of the - window to examine the render speedup. - We also store the time for measuring the time since the last occlusion query ran - and store whether the node should be visible in the next frames. - */ - smgr->addCameraSceneNode(); - int lastFPS = -1; - u32 timeNow = device->getTimer()->getTime(); - bool nodeVisible=true; - - while(device->run()) - { - plane->setVisible(!receiver.IsKeyDown(irr::KEY_SPACE)); - - driver->beginScene(video::ECBF_COLOR | video::ECBF_DEPTH, video::SColor(255,113,113,133)); - /* - First, we draw the scene, possibly without the occluded element. This is necessary - because we need the occluder to be drawn first. You can also use several scene - managers to collect a number of possible occluders in a separately rendered - scene. - */ - node->setVisible(nodeVisible); - smgr->drawAll(); - smgr->getGUIEnvironment()->drawAll(); - - /* - Once in a while, here every 100 ms, we check the visibility. We run the queries, - update the pixel value, and query the result. Since we already rendered the node - we render the query invisible. The update is made blocking, as we need the result - immediately. If you don't need the result immediately, e.g. because you have other - things to render, you can call the update non-blocking. This gives the GPU more - time to pass back the results without flushing the render pipeline. - If the update was called non-blocking, the result from getOcclusionQueryResult is - either the previous value, or 0xffffffff if no value has been generated at all, yet. - The result is taken immediately as visibility flag for the node. - */ - if (device->getTimer()->getTime()-timeNow>100) - { - driver->runAllOcclusionQueries(false); - driver->updateAllOcclusionQueries(); - nodeVisible=driver->getOcclusionQueryResult(node)>0; - timeNow=device->getTimer()->getTime(); - } - - driver->endScene(); - - int fps = driver->getFPS(); - - if (lastFPS != fps) - { - core::stringw tmp(L"OcclusionQuery Example ["); - tmp += driver->getName(); - tmp += L"] fps: "; - tmp += fps; - - device->setWindowCaption(tmp.c_str()); - lastFPS = fps; - } - } - - /* - In the end, delete the Irrlicht device. - */ - device->drop(); - - return 0; -} - -/* -That's it. Compile and play around with the program. -**/ diff --git a/examples/27.PostProcessing/Makefile b/examples/27.PostProcessing/Makefile deleted file mode 100644 index c5905005..00000000 --- a/examples/27.PostProcessing/Makefile +++ /dev/null @@ -1,38 +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 -Target = 27.PostProcessing -Sources = main.cpp - -# general compiler settings -CPPFLAGS = -I../../include -I/usr/X11R6/include -CXXFLAGS = -O3 -ffast-math -#CXXFLAGS = -g -Wall - -#default target is Linux -all: all_linux - -ifeq ($(HOSTTYPE), x86_64) -LIBSELECT=64 -endif - -# target specific settings -all_linux: LDFLAGS = -L/usr/X11R6/lib$(LIBSELECT) -L../../lib/Linux -lIrrlicht -lGL -lXxf86vm -lXext -lX11 -lXcursor -all_linux clean_linux: SYSTEM=Linux -all_win32: LDFLAGS = -L../../lib/Win32-gcc -lIrrlicht -lopengl32 -lm -all_win32 clean_win32: SYSTEM=Win32-gcc -all_win32 clean_win32: SUF=.exe -# name of the binary - only valid for targets which set SYSTEM -DESTPATH = ../../bin/$(SYSTEM)/$(Target)$(SUF) - -all_linux all_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 clean clean_linux clean_win32 diff --git a/examples/27.PostProcessing/PostProcessing.cbp b/examples/27.PostProcessing/PostProcessing.cbp deleted file mode 100644 index 8c7f68e6..00000000 --- a/examples/27.PostProcessing/PostProcessing.cbp +++ /dev/null @@ -1,56 +0,0 @@ - - - - - - diff --git a/examples/27.PostProcessing/PostProcessing_vc10.vcxproj b/examples/27.PostProcessing/PostProcessing_vc10.vcxproj deleted file mode 100644 index 65e47f37..00000000 --- a/examples/27.PostProcessing/PostProcessing_vc10.vcxproj +++ /dev/null @@ -1,231 +0,0 @@ - - - - - Debug - Win32 - - - Debug - x64 - - - Release - Win32 - - - Release - x64 - - - - 27.PostProcessing - {2B885150-210F-4CA7-957E-2C3D75974308} - PostProcessing - - - - Application - false - MultiByte - - - Application - false - MultiByte - - - Application - false - MultiByte - - - Application - false - MultiByte - - - - - - - - - - - - - - - - - - - - - - - <_ProjectFileVersion>10.0.30319.1 - ..\..\bin\Win32-VisualStudio\ - ..\..\bin\Win64-VisualStudio\ - - - ..\..\bin\Win32-VisualStudio\ - ..\..\bin\Win64-VisualStudio\ - - - AllRules.ruleset - AllRules.ruleset - - - - - AllRules.ruleset - AllRules.ruleset - - - - - - - - .\Debug/PostProcessing.tlb - - - - - Disabled - ..\..\include;%(AdditionalIncludeDirectories) - WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebug - - - Level3 - EditAndContinue - - - _DEBUG;%(PreprocessorDefinitions) - 0x0c07 - - - ..\..\bin\Win32-VisualStudio\27.PostProcessing.exe - ..\..\lib\Win32-visualstudio;%(AdditionalLibraryDirectories) - true - Console - - - - - - - .\Debug/PostProcessing.tlb - - - - - Disabled - ..\..\include;%(AdditionalIncludeDirectories) - WIN32;WIN64;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebug - - - Level3 - ProgramDatabase - - - _DEBUG;%(PreprocessorDefinitions) - 0x0c07 - - - ..\..\bin\Win64-VisualStudio\27.PostProcessing.exe - ..\..\lib\Win64-visualstudio;%(AdditionalLibraryDirectories) - true - Console - - - - - - - .\Release/PostProcessing.tlb - - - - - MaxSpeed - OnlyExplicitInline - ..\..\include;%(AdditionalIncludeDirectories) - WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) - true - MultiThreaded - true - - - Level3 - - - NDEBUG;%(PreprocessorDefinitions) - 0x0c07 - - - ..\..\bin\Win32-VisualStudio\27.PostProcessing.exe - ..\..\lib\Win32-visualstudio;%(AdditionalLibraryDirectories) - Console - - - - - - - .\Release/PostProcessing.tlb - - - - - MaxSpeed - OnlyExplicitInline - ..\..\include;%(AdditionalIncludeDirectories) - WIN32;WIN64;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) - true - MultiThreaded - true - - - Level3 - - - NDEBUG;%(PreprocessorDefinitions) - 0x0c07 - - - ..\..\bin\Win64-VisualStudio\27.PostProcessing.exe - ..\..\lib\Win64-visualstudio;%(AdditionalLibraryDirectories) - Console - - - - - - - Disabled - Disabled - %(AdditionalIncludeDirectories) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(PreprocessorDefinitions) - EnableFastChecks - EnableFastChecks - MaxSpeed - MaxSpeed - %(AdditionalIncludeDirectories) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(PreprocessorDefinitions) - - - - - - \ No newline at end of file diff --git a/examples/27.PostProcessing/PostProcessing_vc11.vcxproj b/examples/27.PostProcessing/PostProcessing_vc11.vcxproj deleted file mode 100644 index 8a732900..00000000 --- a/examples/27.PostProcessing/PostProcessing_vc11.vcxproj +++ /dev/null @@ -1,235 +0,0 @@ - - - - - Debug - Win32 - - - Debug - x64 - - - Release - Win32 - - - Release - x64 - - - - 27.PostProcessing - {F864F96D-F6AE-43E2-9A12-218B1A081255} - PostProcessing - - - - Application - false - MultiByte - v110 - - - Application - false - MultiByte - v110 - - - Application - false - MultiByte - v110 - - - Application - false - MultiByte - v110 - - - - - - - - - - - - - - - - - - - - - - - <_ProjectFileVersion>10.0.30319.1 - ..\..\bin\Win32-VisualStudio\ - ..\..\bin\Win64-VisualStudio\ - - - ..\..\bin\Win32-VisualStudio\ - ..\..\bin\Win64-VisualStudio\ - - - AllRules.ruleset - AllRules.ruleset - - - - - AllRules.ruleset - AllRules.ruleset - - - - - - - - .\Debug/PostProcessing.tlb - - - - - Disabled - ..\..\include;%(AdditionalIncludeDirectories) - WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebug - - - Level3 - EditAndContinue - - - _DEBUG;%(PreprocessorDefinitions) - 0x0c07 - - - ..\..\bin\Win32-VisualStudio\27.PostProcessing.exe - ..\..\lib\Win32-visualstudio;%(AdditionalLibraryDirectories) - true - Console - - - - - - - .\Debug/PostProcessing.tlb - - - - - Disabled - ..\..\include;%(AdditionalIncludeDirectories) - WIN32;WIN64;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebug - - - Level3 - ProgramDatabase - - - _DEBUG;%(PreprocessorDefinitions) - 0x0c07 - - - ..\..\bin\Win64-VisualStudio\27.PostProcessing.exe - ..\..\lib\Win64-visualstudio;%(AdditionalLibraryDirectories) - true - Console - - - - - - - .\Release/PostProcessing.tlb - - - - - MaxSpeed - OnlyExplicitInline - ..\..\include;%(AdditionalIncludeDirectories) - WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) - true - MultiThreaded - true - - - Level3 - - - NDEBUG;%(PreprocessorDefinitions) - 0x0c07 - - - ..\..\bin\Win32-VisualStudio\27.PostProcessing.exe - ..\..\lib\Win32-visualstudio;%(AdditionalLibraryDirectories) - Console - - - - - - - .\Release/PostProcessing.tlb - - - - - MaxSpeed - OnlyExplicitInline - ..\..\include;%(AdditionalIncludeDirectories) - WIN32;WIN64;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) - true - MultiThreaded - true - - - Level3 - - - NDEBUG;%(PreprocessorDefinitions) - 0x0c07 - - - ..\..\bin\Win64-VisualStudio\27.PostProcessing.exe - ..\..\lib\Win64-visualstudio;%(AdditionalLibraryDirectories) - Console - - - - - - - Disabled - Disabled - %(AdditionalIncludeDirectories) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(PreprocessorDefinitions) - EnableFastChecks - EnableFastChecks - MaxSpeed - MaxSpeed - %(AdditionalIncludeDirectories) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(PreprocessorDefinitions) - - - - - - \ No newline at end of file diff --git a/examples/27.PostProcessing/PostProcessing_vc12.vcxproj b/examples/27.PostProcessing/PostProcessing_vc12.vcxproj deleted file mode 100644 index 8aef23bd..00000000 --- a/examples/27.PostProcessing/PostProcessing_vc12.vcxproj +++ /dev/null @@ -1,235 +0,0 @@ - - - - - Debug - Win32 - - - Debug - x64 - - - Release - Win32 - - - Release - x64 - - - - 27.PostProcessing - {17E74625-568E-4008-897E-CAD12A332B0C} - PostProcessing - - - - Application - false - MultiByte - v110 - - - Application - false - MultiByte - v110 - - - Application - false - MultiByte - v110 - - - Application - false - MultiByte - v110 - - - - - - - - - - - - - - - - - - - - - - - <_ProjectFileVersion>10.0.30319.1 - ..\..\bin\Win32-VisualStudio\ - ..\..\bin\Win64-VisualStudio\ - - - ..\..\bin\Win32-VisualStudio\ - ..\..\bin\Win64-VisualStudio\ - - - AllRules.ruleset - AllRules.ruleset - - - - - AllRules.ruleset - AllRules.ruleset - - - - - - - - .\Debug/PostProcessing.tlb - - - - - Disabled - ..\..\include;%(AdditionalIncludeDirectories) - WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebug - - - Level3 - EditAndContinue - - - _DEBUG;%(PreprocessorDefinitions) - 0x0c07 - - - ..\..\bin\Win32-VisualStudio\27.PostProcessing.exe - ..\..\lib\Win32-visualstudio;%(AdditionalLibraryDirectories) - true - Console - - - - - - - .\Debug/PostProcessing.tlb - - - - - Disabled - ..\..\include;%(AdditionalIncludeDirectories) - WIN32;WIN64;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebug - - - Level3 - ProgramDatabase - - - _DEBUG;%(PreprocessorDefinitions) - 0x0c07 - - - ..\..\bin\Win64-VisualStudio\27.PostProcessing.exe - ..\..\lib\Win64-visualstudio;%(AdditionalLibraryDirectories) - true - Console - - - - - - - .\Release/PostProcessing.tlb - - - - - MaxSpeed - OnlyExplicitInline - ..\..\include;%(AdditionalIncludeDirectories) - WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) - true - MultiThreaded - true - - - Level3 - - - NDEBUG;%(PreprocessorDefinitions) - 0x0c07 - - - ..\..\bin\Win32-VisualStudio\27.PostProcessing.exe - ..\..\lib\Win32-visualstudio;%(AdditionalLibraryDirectories) - Console - - - - - - - .\Release/PostProcessing.tlb - - - - - MaxSpeed - OnlyExplicitInline - ..\..\include;%(AdditionalIncludeDirectories) - WIN32;WIN64;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) - true - MultiThreaded - true - - - Level3 - - - NDEBUG;%(PreprocessorDefinitions) - 0x0c07 - - - ..\..\bin\Win64-VisualStudio\27.PostProcessing.exe - ..\..\lib\Win64-visualstudio;%(AdditionalLibraryDirectories) - Console - - - - - - - Disabled - Disabled - %(AdditionalIncludeDirectories) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(PreprocessorDefinitions) - EnableFastChecks - EnableFastChecks - MaxSpeed - MaxSpeed - %(AdditionalIncludeDirectories) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(PreprocessorDefinitions) - - - - - - \ No newline at end of file diff --git a/examples/27.PostProcessing/PostProcessing_vc14.vcxproj b/examples/27.PostProcessing/PostProcessing_vc14.vcxproj deleted file mode 100644 index a39c5551..00000000 --- a/examples/27.PostProcessing/PostProcessing_vc14.vcxproj +++ /dev/null @@ -1,235 +0,0 @@ - - - - - Debug - Win32 - - - Debug - x64 - - - Release - Win32 - - - Release - x64 - - - - 27.PostProcessing - {F25F2AC4-AEDA-4A95-9769-01A2652B54A2} - PostProcessing - - - - Application - false - MultiByte - v140 - - - Application - false - MultiByte - v140 - - - Application - false - MultiByte - v140 - - - Application - false - MultiByte - v140 - - - - - - - - - - - - - - - - - - - - - - - <_ProjectFileVersion>10.0.30319.1 - ..\..\bin\Win32-VisualStudio\ - ..\..\bin\Win64-VisualStudio\ - - - ..\..\bin\Win32-VisualStudio\ - ..\..\bin\Win64-VisualStudio\ - - - AllRules.ruleset - AllRules.ruleset - - - - - AllRules.ruleset - AllRules.ruleset - - - - - - - - .\Debug/PostProcessing.tlb - - - - - Disabled - ..\..\include;%(AdditionalIncludeDirectories) - WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebug - - - Level3 - EditAndContinue - - - _DEBUG;%(PreprocessorDefinitions) - 0x0c07 - - - ..\..\bin\Win32-VisualStudio\27.PostProcessing.exe - ..\..\lib\Win32-visualstudio;%(AdditionalLibraryDirectories) - true - Console - - - - - - - .\Debug/PostProcessing.tlb - - - - - Disabled - ..\..\include;%(AdditionalIncludeDirectories) - WIN32;WIN64;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebug - - - Level3 - ProgramDatabase - - - _DEBUG;%(PreprocessorDefinitions) - 0x0c07 - - - ..\..\bin\Win64-VisualStudio\27.PostProcessing.exe - ..\..\lib\Win64-visualstudio;%(AdditionalLibraryDirectories) - true - Console - - - - - - - .\Release/PostProcessing.tlb - - - - - MaxSpeed - OnlyExplicitInline - ..\..\include;%(AdditionalIncludeDirectories) - WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) - true - MultiThreaded - true - - - Level3 - - - NDEBUG;%(PreprocessorDefinitions) - 0x0c07 - - - ..\..\bin\Win32-VisualStudio\27.PostProcessing.exe - ..\..\lib\Win32-visualstudio;%(AdditionalLibraryDirectories) - Console - - - - - - - .\Release/PostProcessing.tlb - - - - - MaxSpeed - OnlyExplicitInline - ..\..\include;%(AdditionalIncludeDirectories) - WIN32;WIN64;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) - true - MultiThreaded - true - - - Level3 - - - NDEBUG;%(PreprocessorDefinitions) - 0x0c07 - - - ..\..\bin\Win64-VisualStudio\27.PostProcessing.exe - ..\..\lib\Win64-visualstudio;%(AdditionalLibraryDirectories) - Console - - - - - - - Disabled - Disabled - %(AdditionalIncludeDirectories) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(PreprocessorDefinitions) - EnableFastChecks - EnableFastChecks - MaxSpeed - MaxSpeed - %(AdditionalIncludeDirectories) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(PreprocessorDefinitions) - - - - - - \ No newline at end of file diff --git a/examples/27.PostProcessing/main.cpp b/examples/27.PostProcessing/main.cpp deleted file mode 100644 index 2f49ccfc..00000000 --- a/examples/27.PostProcessing/main.cpp +++ /dev/null @@ -1,417 +0,0 @@ -/** Example 027 Post Processing - -This tutorial shows how to implement post processing for D3D9 and OpenGL with -the engine. In order to do post processing, scene objects are firstly rendered -to render target. With the help of screen quad, the render target texture -is then drawn on the quad with shader-defined effects applied. - -This tutorial shows how to create a screen quad. It also shows how to create a -render target texture and associate it with the quad. Effects are defined as -shaders which are applied during rendering the quad with the render target -texture attached to it. - -A simple color inverse example is presented in this tutorial. The effect is -written in HLSL and GLSL. - -@author Boshen Guan - -We include all headers and define necessary variables as we have done before. -*/ -#include "driverChoice.h" -#include "exampleHelper.h" - -#include - -using namespace irr; - -#ifdef _MSC_VER -#pragma comment(lib, "Irrlicht.lib") -#endif - -/* -We write a class derived from IShaderConstantSetCallBack class and implement -OnSetConstants callback interface. In this callback, we will set constants -used by the shader. -In this example, our HLSL shader needs texture size as input in its vertex -shader. Therefore, we set texture size in OnSetConstants callback using -setVertexShaderConstant function. -*/ - -IrrlichtDevice* device = 0; -video::ITexture* rt = 0; - -class QuadShaderCallBack : public video::IShaderConstantSetCallBack -{ -public: - QuadShaderCallBack() : FirstUpdate(true), TextureSizeID(-1), TextureSamplerID(-1) - { } - - virtual void OnSetConstants(video::IMaterialRendererServices* services, - s32 userData) - { - core::dimension2d size = rt->getSize(); - - // get texture size array - f32 textureSize[] = - { - (f32)size.Width, (f32)size.Height - }; - - if ( FirstUpdate ) - { - TextureSizeID = services->getVertexShaderConstantID("TextureSize"); - TextureSamplerID = services->getPixelShaderConstantID("TextureSampler"); - } - - // set texture size to vertex shader - services->setVertexShaderConstant(TextureSizeID, reinterpret_cast(textureSize), 2); - - // set texture for an OpenGL driver - s32 textureLayer = 0; - services->setPixelShaderConstant(TextureSamplerID, &textureLayer, 1); - } - -private: - bool FirstUpdate; - s32 TextureSizeID; - s32 TextureSamplerID; -}; - -class ScreenQuad : public IReferenceCounted -{ -public: - - ScreenQuad(video::IVideoDriver* driver) - : Driver(driver) - { - // --------------------------------> u - // |[1](-1, 1)----------[2](1, 1) - // | | ( 0, 0) / | (1, 0) - // | | / | - // | | / | - // | | / | - // | | / | - // | | / | - // | | / | - // | | / | - // | | / | - // |[0](-1, -1)---------[3](1, -1) - // | ( 0, 1) (1, 1) - // V - // v - - /* - A screen quad is composed of two adjacent triangles with 4 vertices. - Vertex [0], [1] and [2] create the first triangle and Vertex [0], - [2] and [3] create the second one. To map texture on the quad, UV - coordinates are assigned to the vertices. The origin of UV coordinate - locates on the top-left corner. And the value of UVs range from 0 to 1. - */ - - // define vertices array - - Vertices[0] = irr::video::S3DVertex(-1.0f, -1.0f, 0.0f, 1, 1, 0, irr::video::SColor(0,255,255,255), 0.0f, 1.0f); - Vertices[1] = irr::video::S3DVertex(-1.0f, 1.0f, 0.0f, 1, 1, 0, irr::video::SColor(0,255,255,255), 0.0f, 0.0f); - Vertices[2] = irr::video::S3DVertex( 1.0f, 1.0f, 0.0f, 1, 1, 0, irr::video::SColor(0,255,255,255), 1.0f, 0.0f); - Vertices[3] = irr::video::S3DVertex( 1.0f, -1.0f, 0.0f, 1, 1, 0, irr::video::SColor(0,255,255,255), 1.0f, 1.0f); - - // define indices for triangles - - Indices[0] = 0; - Indices[1] = 1; - Indices[2] = 2; - Indices[3] = 0; - Indices[4] = 2; - Indices[5] = 3; - - // turn off lighting as default - Material.setFlag(video::EMF_LIGHTING, false); - - // set texture warp settings to clamp to edge pixel - for (u32 i = 0; i < video::MATERIAL_MAX_TEXTURES; i++) - { - Material.TextureLayer[i].TextureWrapU = video::ETC_CLAMP_TO_EDGE; - Material.TextureLayer[i].TextureWrapV = video::ETC_CLAMP_TO_EDGE; - } - } - - virtual ~ScreenQuad() {} - - - //! render the screen quad - virtual void render() - { - // set the material of screen quad - Driver->setMaterial(Material); - - // set matrices to fit the quad to full viewport - Driver->setTransform(video::ETS_WORLD, core::IdentityMatrix); - Driver->setTransform(video::ETS_VIEW, core::IdentityMatrix); - Driver->setTransform(video::ETS_PROJECTION, core::IdentityMatrix); - - // draw screen quad - Driver->drawVertexPrimitiveList(Vertices, 4, Indices, 2); - } - - //! sets a flag of material to a new value - virtual void setMaterialFlag(video::E_MATERIAL_FLAG flag, bool newvalue) - { - Material.setFlag(flag, newvalue); - } - - //! sets the texture of the specified layer in material to the new texture. - void setMaterialTexture(u32 textureLayer, video::ITexture* texture) - { - Material.setTexture(textureLayer, texture); - } - - //! sets the material type to a new material type. - virtual void setMaterialType(video::E_MATERIAL_TYPE newType) - { - Material.MaterialType = newType; - } - -private: - - video::IVideoDriver *Driver; - video::S3DVertex Vertices[4]; - u16 Indices[6]; - video::SMaterial Material; -}; - -/* -We start up the engine just like before. Then shader programs are selected -according to the driver type. -*/ -int main() -{ - // ask user for driver - video::E_DRIVER_TYPE driverType=driverChoiceConsole(); - if (driverType==video::EDT_COUNT) - return 1; - - // create device - device = createDevice(driverType, core::dimension2d(640, 480)); - - if (device == 0) - return 1; // could not create selected driver. - - video::IVideoDriver* driver = device->getVideoDriver(); - scene::ISceneManager* smgr = device->getSceneManager(); - - /* - In this example, high level post processing shaders are loaded for both - Direct3D and OpenGL drivers. - File pp_d3d9.hlsl is for Direct3D 9, and pp_opengl.frag/pp_opengl.vert - are for OpenGL. - */ - - const io::path mediaPath = getExampleMediaPath(); - io::path vsFileName; // filename for the vertex shader - io::path psFileName; // filename for the pixel shader - - switch(driverType) - { - case video::EDT_DIRECT3D9: - psFileName = mediaPath + "pp_d3d9.hlsl"; - vsFileName = psFileName; // both shaders are in the same file - break; - - case video::EDT_OPENGL: - psFileName = mediaPath + "pp_opengl.frag"; - vsFileName = mediaPath + "pp_opengl.vert"; - break; - } - - /* - Check for hardware capability of executing the corresponding shaders - on selected renderer. This is not necessary though. - */ - - if (!driver->queryFeature(video::EVDF_PIXEL_SHADER_1_1) && - !driver->queryFeature(video::EVDF_ARB_FRAGMENT_PROGRAM_1)) - { - device->getLogger()->log("WARNING: Pixel shaders disabled "\ - "because of missing driver/hardware support."); - psFileName = ""; - } - - if (!driver->queryFeature(video::EVDF_VERTEX_SHADER_1_1) && - !driver->queryFeature(video::EVDF_ARB_VERTEX_PROGRAM_1)) - { - device->getLogger()->log("WARNING: Vertex shaders disabled "\ - "because of missing driver/hardware support."); - vsFileName = ""; - } - - /* - An animated mesh is loaded to be displayed. As in most examples, - we'll take the fairy md2 model. - */ - - // load and display animated fairy mesh - - scene::IAnimatedMeshSceneNode* fairy = smgr->addAnimatedMeshSceneNode( - smgr->getMesh(mediaPath + "faerie.md2")); - - if (fairy) - { - fairy->setMaterialTexture(0, - driver->getTexture(mediaPath + "faerie2.bmp")); // set diffuse texture - fairy->setMaterialFlag(video::EMF_LIGHTING, false); // disable dynamic lighting - fairy->setPosition(core::vector3df(-10,0,-100)); - fairy->setMD2Animation ( scene::EMAT_STAND ); - } - - // add scene camera - smgr->addCameraSceneNode(0, core::vector3df(10,10,-80), - core::vector3df(-10,10,-100)); - - /* - We create a render target texture (RTT) with the same size as frame buffer. - Instead of rendering the scene directly to the frame buffer, we firstly - render it to this RTT. Post processing is then applied based on this RTT. - RTT size needs not to be the same with frame buffer though. However in this - example, we expect the result of rendering to RTT to be consistent with the - result of rendering directly to the frame buffer. Therefore, the size of - RTT keeps the same with frame buffer. - */ - - // create render target - - if (driver->queryFeature(video::EVDF_RENDER_TO_TARGET)) - { - rt = driver->addRenderTargetTexture(core::dimension2d(640, 480), "RTT1"); - } - else - { - device->getLogger()->log("Your hardware or this renderer is not able to use the "\ - "render to texture feature. RTT Disabled."); - } - - /* - Post processing is achieved by rendering a screen quad with this RTT (with - previously rendered result) as a texture on the quad. A screen quad is - geometry of flat plane composed of two adjacent triangles covering the - entire area of viewport. In this pass of rendering, RTT works just like - a normal texture and is drawn on the quad during rendering. We can then - take control of this rendering process by applying various shader-defined - materials to the quad. In other words, we can achieve different effect by - writing different shaders. - This process is called post processing because it normally does not rely - on scene geometry. The inputs of this process are just textures, or in - other words, just images. With the help of screen quad, we can draw these - images on the screen with different effects. For example, we can adjust - contrast, make grayscale, add noise, do more fancy effect such as blur, - bloom, ghost, or just like in this example, we invert the color to produce - negative image. - Note that post processing is not limited to use only one texture. It can - take multiple textures as shader inputs to provide desired result. In - addition, post processing can also be chained to produce compound result. - */ - - // we create a screen quad - ScreenQuad *screenQuad = new ScreenQuad(driver); - - // turn off mip maps and bilinear filter since we do not want interpolated result - screenQuad->setMaterialFlag(video::EMF_USE_MIP_MAPS, false); - screenQuad->setMaterialFlag(video::EMF_BILINEAR_FILTER, false); - - // set quad texture to RTT we just create - screenQuad->setMaterialTexture(0, rt); - - /* - Let's create material for the quad. Like in other example, we create material - using IGPUProgrammingServices and call addShaderMaterialFromFiles, which - returns a material type identifier. - */ - - // create materials - - video::IGPUProgrammingServices* gpu = driver->getGPUProgrammingServices(); - s32 ppMaterialType = 0; - - if (gpu) - { - // We write a QuadShaderCallBack class that implements OnSetConstants - // callback of IShaderConstantSetCallBack class at the beginning of - // this tutorial. We set shader constants in this callback. - - // create an instance of callback class - - QuadShaderCallBack* mc = new QuadShaderCallBack(); - - // create material from post processing shaders - - ppMaterialType = gpu->addHighLevelShaderMaterialFromFiles( - vsFileName, "vertexMain", video::EVST_VS_1_1, - psFileName, "pixelMain", video::EPST_PS_1_1, mc); - - mc->drop(); - } - - // set post processing material type to the quad - screenQuad->setMaterialType((video::E_MATERIAL_TYPE)ppMaterialType); - - /* - Now draw everything. That's all. - */ - - int lastFPS = -1; - - while(device->run()) - { - if (device->isWindowActive()) - { - driver->beginScene(true, true, video::SColor(255,0,0,0)); - - if (rt) - { - // draw scene into render target - - // set render target to RTT - driver->setRenderTarget(rt, true, true, video::SColor(255,0,0,0)); - - // draw scene to RTT just like normal rendering - smgr->drawAll(); - - // after rendering to RTT, we change render target back - driver->setRenderTarget(0, true, true, video::SColor(255,0,0,0)); - - // render screen quad to apply post processing - screenQuad->render(); - } - else - { - // draw scene normally - smgr->drawAll(); - } - - driver->endScene(); - - int fps = driver->getFPS(); - - if (lastFPS != fps) - { - core::stringw str = L"Irrlicht Engine - Post processing example ["; - str += driver->getName(); - str += "] FPS:"; - str += fps; - - device->setWindowCaption(str.c_str()); - lastFPS = fps; - } - } - } - - // do not forget to manually drop the screen quad - - screenQuad->drop(); - - device->drop(); - - return 0; -} - -/* -**/ diff --git a/examples/28.CubeMapping/CubeMapping.cbp b/examples/28.CubeMapping/CubeMapping.cbp deleted file mode 100644 index f8025e49..00000000 --- a/examples/28.CubeMapping/CubeMapping.cbp +++ /dev/null @@ -1,56 +0,0 @@ - - - - - - diff --git a/examples/28.CubeMapping/CubeMapping_vc10.vcxproj b/examples/28.CubeMapping/CubeMapping_vc10.vcxproj deleted file mode 100644 index 403cd970..00000000 --- a/examples/28.CubeMapping/CubeMapping_vc10.vcxproj +++ /dev/null @@ -1,231 +0,0 @@ - - - - - Debug - Win32 - - - Debug - x64 - - - Release - Win32 - - - Release - x64 - - - - 28.CubeMapping - {9A2CE404-75E2-4195-837D-BED5B0FF3FA7} - CubeMapping - - - - Application - false - MultiByte - - - Application - false - MultiByte - - - Application - false - MultiByte - - - Application - false - MultiByte - - - - - - - - - - - - - - - - - - - - - - - <_ProjectFileVersion>10.0.30319.1 - ..\..\bin\Win32-VisualStudio\ - ..\..\bin\Win64-VisualStudio\ - - - ..\..\bin\Win32-VisualStudio\ - ..\..\bin\Win64-VisualStudio\ - - - AllRules.ruleset - AllRules.ruleset - - - - - AllRules.ruleset - AllRules.ruleset - - - - - - - - .\Debug/CubeMapping.tlb - - - - - Disabled - ..\..\include;%(AdditionalIncludeDirectories) - WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebug - - - Level3 - EditAndContinue - - - _DEBUG;%(PreprocessorDefinitions) - 0x0c07 - - - ..\..\bin\Win32-VisualStudio\28.CubeMapping.exe - ..\..\lib\Win32-visualstudio;%(AdditionalLibraryDirectories) - true - Console - - - - - - - .\Debug/CubeMapping.tlb - - - - - Disabled - ..\..\include;%(AdditionalIncludeDirectories) - WIN32;WIN64;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebug - - - Level3 - ProgramDatabase - - - _DEBUG;%(PreprocessorDefinitions) - 0x0c07 - - - ..\..\bin\Win64-VisualStudio\28.CubeMapping.exe - ..\..\lib\Win64-visualstudio;%(AdditionalLibraryDirectories) - true - Console - - - - - - - .\Release/CubeMapping.tlb - - - - - MaxSpeed - OnlyExplicitInline - ..\..\include;%(AdditionalIncludeDirectories) - WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) - true - MultiThreaded - true - - - Level3 - - - NDEBUG;%(PreprocessorDefinitions) - 0x0c07 - - - ..\..\bin\Win32-VisualStudio\28.CubeMapping.exe - ..\..\lib\Win32-visualstudio;%(AdditionalLibraryDirectories) - Console - - - - - - - .\Release/CubeMapping.tlb - - - - - MaxSpeed - OnlyExplicitInline - ..\..\include;%(AdditionalIncludeDirectories) - WIN32;WIN64;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) - true - MultiThreaded - true - - - Level3 - - - NDEBUG;%(PreprocessorDefinitions) - 0x0c07 - - - ..\..\bin\Win64-VisualStudio\28.CubeMapping.exe - ..\..\lib\Win64-visualstudio;%(AdditionalLibraryDirectories) - Console - - - - - - - Disabled - Disabled - %(AdditionalIncludeDirectories) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(PreprocessorDefinitions) - EnableFastChecks - EnableFastChecks - MaxSpeed - MaxSpeed - %(AdditionalIncludeDirectories) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(PreprocessorDefinitions) - - - - - - \ No newline at end of file diff --git a/examples/28.CubeMapping/CubeMapping_vc11.vcxproj b/examples/28.CubeMapping/CubeMapping_vc11.vcxproj deleted file mode 100644 index bd8bbb92..00000000 --- a/examples/28.CubeMapping/CubeMapping_vc11.vcxproj +++ /dev/null @@ -1,235 +0,0 @@ - - - - - Debug - Win32 - - - Debug - x64 - - - Release - Win32 - - - Release - x64 - - - - 28.CubeMapping - {3DAD16DC-3D80-46EA-ADD8-C4418CEDE553} - CubeMapping - - - - Application - false - MultiByte - v110 - - - Application - false - MultiByte - v110 - - - Application - false - MultiByte - v110 - - - Application - false - MultiByte - v110 - - - - - - - - - - - - - - - - - - - - - - - <_ProjectFileVersion>10.0.30319.1 - ..\..\bin\Win32-VisualStudio\ - ..\..\bin\Win64-VisualStudio\ - - - ..\..\bin\Win32-VisualStudio\ - ..\..\bin\Win64-VisualStudio\ - - - AllRules.ruleset - AllRules.ruleset - - - - - AllRules.ruleset - AllRules.ruleset - - - - - - - - .\Debug/CubeMapping.tlb - - - - - Disabled - ..\..\include;%(AdditionalIncludeDirectories) - WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebug - - - Level3 - EditAndContinue - - - _DEBUG;%(PreprocessorDefinitions) - 0x0c07 - - - ..\..\bin\Win32-VisualStudio\28.CubeMapping.exe - ..\..\lib\Win32-visualstudio;%(AdditionalLibraryDirectories) - true - Console - - - - - - - .\Debug/CubeMapping.tlb - - - - - Disabled - ..\..\include;%(AdditionalIncludeDirectories) - WIN32;WIN64;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebug - - - Level3 - ProgramDatabase - - - _DEBUG;%(PreprocessorDefinitions) - 0x0c07 - - - ..\..\bin\Win64-VisualStudio\28.CubeMapping.exe - ..\..\lib\Win64-visualstudio;%(AdditionalLibraryDirectories) - true - Console - - - - - - - .\Release/CubeMapping.tlb - - - - - MaxSpeed - OnlyExplicitInline - ..\..\include;%(AdditionalIncludeDirectories) - WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) - true - MultiThreaded - true - - - Level3 - - - NDEBUG;%(PreprocessorDefinitions) - 0x0c07 - - - ..\..\bin\Win32-VisualStudio\28.CubeMapping.exe - ..\..\lib\Win32-visualstudio;%(AdditionalLibraryDirectories) - Console - - - - - - - .\Release/CubeMapping.tlb - - - - - MaxSpeed - OnlyExplicitInline - ..\..\include;%(AdditionalIncludeDirectories) - WIN32;WIN64;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) - true - MultiThreaded - true - - - Level3 - - - NDEBUG;%(PreprocessorDefinitions) - 0x0c07 - - - ..\..\bin\Win64-VisualStudio\28.CubeMapping.exe - ..\..\lib\Win64-visualstudio;%(AdditionalLibraryDirectories) - Console - - - - - - - Disabled - Disabled - %(AdditionalIncludeDirectories) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(PreprocessorDefinitions) - EnableFastChecks - EnableFastChecks - MaxSpeed - MaxSpeed - %(AdditionalIncludeDirectories) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(PreprocessorDefinitions) - - - - - - \ No newline at end of file diff --git a/examples/28.CubeMapping/CubeMapping_vc12.vcxproj b/examples/28.CubeMapping/CubeMapping_vc12.vcxproj deleted file mode 100644 index 1c7f9201..00000000 --- a/examples/28.CubeMapping/CubeMapping_vc12.vcxproj +++ /dev/null @@ -1,235 +0,0 @@ - - - - - Debug - Win32 - - - Debug - x64 - - - Release - Win32 - - - Release - x64 - - - - 28.CubeMapping - {1FDD5E75-9EB3-4467-B672-0BFC105B84A5} - CubeMapping - - - - Application - false - MultiByte - v110 - - - Application - false - MultiByte - v110 - - - Application - false - MultiByte - v110 - - - Application - false - MultiByte - v110 - - - - - - - - - - - - - - - - - - - - - - - <_ProjectFileVersion>10.0.30319.1 - ..\..\bin\Win32-VisualStudio\ - ..\..\bin\Win64-VisualStudio\ - - - ..\..\bin\Win32-VisualStudio\ - ..\..\bin\Win64-VisualStudio\ - - - AllRules.ruleset - AllRules.ruleset - - - - - AllRules.ruleset - AllRules.ruleset - - - - - - - - .\Debug/CubeMapping.tlb - - - - - Disabled - ..\..\include;%(AdditionalIncludeDirectories) - WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebug - - - Level3 - EditAndContinue - - - _DEBUG;%(PreprocessorDefinitions) - 0x0c07 - - - ..\..\bin\Win32-VisualStudio\28.CubeMapping.exe - ..\..\lib\Win32-visualstudio;%(AdditionalLibraryDirectories) - true - Console - - - - - - - .\Debug/CubeMapping.tlb - - - - - Disabled - ..\..\include;%(AdditionalIncludeDirectories) - WIN32;WIN64;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebug - - - Level3 - ProgramDatabase - - - _DEBUG;%(PreprocessorDefinitions) - 0x0c07 - - - ..\..\bin\Win64-VisualStudio\28.CubeMapping.exe - ..\..\lib\Win64-visualstudio;%(AdditionalLibraryDirectories) - true - Console - - - - - - - .\Release/CubeMapping.tlb - - - - - MaxSpeed - OnlyExplicitInline - ..\..\include;%(AdditionalIncludeDirectories) - WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) - true - MultiThreaded - true - - - Level3 - - - NDEBUG;%(PreprocessorDefinitions) - 0x0c07 - - - ..\..\bin\Win32-VisualStudio\28.CubeMapping.exe - ..\..\lib\Win32-visualstudio;%(AdditionalLibraryDirectories) - Console - - - - - - - .\Release/CubeMapping.tlb - - - - - MaxSpeed - OnlyExplicitInline - ..\..\include;%(AdditionalIncludeDirectories) - WIN32;WIN64;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) - true - MultiThreaded - true - - - Level3 - - - NDEBUG;%(PreprocessorDefinitions) - 0x0c07 - - - ..\..\bin\Win64-VisualStudio\28.CubeMapping.exe - ..\..\lib\Win64-visualstudio;%(AdditionalLibraryDirectories) - Console - - - - - - - Disabled - Disabled - %(AdditionalIncludeDirectories) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(PreprocessorDefinitions) - EnableFastChecks - EnableFastChecks - MaxSpeed - MaxSpeed - %(AdditionalIncludeDirectories) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(PreprocessorDefinitions) - - - - - - \ No newline at end of file diff --git a/examples/28.CubeMapping/CubeMapping_vc14.vcxproj b/examples/28.CubeMapping/CubeMapping_vc14.vcxproj deleted file mode 100644 index 55e11efc..00000000 --- a/examples/28.CubeMapping/CubeMapping_vc14.vcxproj +++ /dev/null @@ -1,235 +0,0 @@ - - - - - Debug - Win32 - - - Debug - x64 - - - Release - Win32 - - - Release - x64 - - - - 28.CubeMapping - {DEE0160F-8FBD-43EC-BB96-1B9C0ED1B51A} - CubeMapping - - - - Application - false - MultiByte - v140 - - - Application - false - MultiByte - v140 - - - Application - false - MultiByte - v140 - - - Application - false - MultiByte - v140 - - - - - - - - - - - - - - - - - - - - - - - <_ProjectFileVersion>10.0.30319.1 - ..\..\bin\Win32-VisualStudio\ - ..\..\bin\Win64-VisualStudio\ - - - ..\..\bin\Win32-VisualStudio\ - ..\..\bin\Win64-VisualStudio\ - - - AllRules.ruleset - AllRules.ruleset - - - - - AllRules.ruleset - AllRules.ruleset - - - - - - - - .\Debug/CubeMapping.tlb - - - - - Disabled - ..\..\include;%(AdditionalIncludeDirectories) - WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebug - - - Level3 - EditAndContinue - - - _DEBUG;%(PreprocessorDefinitions) - 0x0c07 - - - ..\..\bin\Win32-VisualStudio\28.CubeMapping.exe - ..\..\lib\Win32-visualstudio;%(AdditionalLibraryDirectories) - true - Console - - - - - - - .\Debug/CubeMapping.tlb - - - - - Disabled - ..\..\include;%(AdditionalIncludeDirectories) - WIN32;WIN64;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebug - - - Level3 - ProgramDatabase - - - _DEBUG;%(PreprocessorDefinitions) - 0x0c07 - - - ..\..\bin\Win64-VisualStudio\28.CubeMapping.exe - ..\..\lib\Win64-visualstudio;%(AdditionalLibraryDirectories) - true - Console - - - - - - - .\Release/CubeMapping.tlb - - - - - MaxSpeed - OnlyExplicitInline - ..\..\include;%(AdditionalIncludeDirectories) - WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) - true - MultiThreaded - true - - - Level3 - - - NDEBUG;%(PreprocessorDefinitions) - 0x0c07 - - - ..\..\bin\Win32-VisualStudio\28.CubeMapping.exe - ..\..\lib\Win32-visualstudio;%(AdditionalLibraryDirectories) - Console - - - - - - - .\Release/CubeMapping.tlb - - - - - MaxSpeed - OnlyExplicitInline - ..\..\include;%(AdditionalIncludeDirectories) - WIN32;WIN64;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) - true - MultiThreaded - true - - - Level3 - - - NDEBUG;%(PreprocessorDefinitions) - 0x0c07 - - - ..\..\bin\Win64-VisualStudio\28.CubeMapping.exe - ..\..\lib\Win64-visualstudio;%(AdditionalLibraryDirectories) - Console - - - - - - - Disabled - Disabled - %(AdditionalIncludeDirectories) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(PreprocessorDefinitions) - EnableFastChecks - EnableFastChecks - MaxSpeed - MaxSpeed - %(AdditionalIncludeDirectories) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(PreprocessorDefinitions) - - - - - - \ No newline at end of file diff --git a/examples/28.CubeMapping/Makefile b/examples/28.CubeMapping/Makefile deleted file mode 100644 index 22514c2c..00000000 --- a/examples/28.CubeMapping/Makefile +++ /dev/null @@ -1,38 +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 -Target = 28.CubeMapping -Sources = main.cpp - -# general compiler settings -CPPFLAGS = -I../../include -I/usr/X11R6/include -CXXFLAGS = -O3 -ffast-math -#CXXFLAGS = -g -Wall - -#default target is Linux -all: all_linux - -ifeq ($(HOSTTYPE), x86_64) -LIBSELECT=64 -endif - -# target specific settings -all_linux: LDFLAGS = -L/usr/X11R6/lib$(LIBSELECT) -L../../lib/Linux -lIrrlicht -lGL -lXxf86vm -lXext -lX11 -lXcursor -all_linux clean_linux: SYSTEM=Linux -all_win32: LDFLAGS = -L../../lib/Win32-gcc -lIrrlicht -lopengl32 -lm -all_win32 clean_win32: SYSTEM=Win32-gcc -all_win32 clean_win32: SUF=.exe -# name of the binary - only valid for targets which set SYSTEM -DESTPATH = ../../bin/$(SYSTEM)/$(Target)$(SUF) - -all_linux all_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 clean clean_linux clean_win32 diff --git a/examples/28.CubeMapping/main.cpp b/examples/28.CubeMapping/main.cpp deleted file mode 100644 index b831d318..00000000 --- a/examples/28.CubeMapping/main.cpp +++ /dev/null @@ -1,770 +0,0 @@ -/** Example 028 CubeMapping - -Shows usage of cubemap textures and how to do some simple environment mapping. -Cubemap textures have images for all 6 directions of a cube in a single texture. -Environment is used to reflect the environment around an object onto the object. -Cubemaps only work with shader materials which are written to support cube mapping. - -@author Michael Zeilfelder, based on EnvCubeMap example from irrSpintz engine. - -Start with the usual includes. -*/ - -#ifdef _MSC_VER -#pragma comment(lib, "Irrlicht.lib") -#endif - -#include -#include "driverChoice.h" -#include "exampleHelper.h" - -using namespace irr; - - -/* - A callback class for our cubemap shader. - We need a shader material which maps the cubemap texture to - the polygon vertices of objects. -*/ -class CubeMapReflectionCallback : public video::IShaderConstantSetCallBack -{ -public: - CubeMapReflectionCallback(scene::ISceneManager* smgr, int styleUVW) - : SceneMgr(smgr) - , StyleUVW(styleUVW), Roughness(0.f) - , styleUvwID(-1) , worldViewProjID(-1), worldID(-1), cameraPosID(-1) - {} - - /* - Setting the style to map vertex UV-coordinates to the cubemap textures. - - Specular style is typically used for mirrors and highlight reflections. - - Diffuse style is commonly used in image based lighting calculations and - often in combination with a higher roughness. Think of it as the sum of all - light which reaches a point on your object. - - Using model vertices directly for UV's is just nice for testing sometimes. - Maybe has more uses? Experiment around :-) - */ - void SetStyleUVW(int style) - { - StyleUVW = style; - } - - int GetStyleUVW() const - { - return StyleUVW; - } - - /* - We could also call this sharpness as the rougher a material the less - sharp the reflections of a cubemap are (light for rough materials - spreads out more while smooth materials reflect it more like a mirror). - Roughness is calculated using the mipmaps of the cubemap texture. - Note that rendertarget cubemap textures won't have mipmaps, so unfortunately - it won't work for those. - Also currently only OpenGL is able to interpolate seamless over cubemap borders. - On Direct3D9 you will only smooth per side, but not over side-borders. - */ - void SetRoughness(float roughness) - { - Roughness = roughness; - } - - float getRoughness() const - { - return Roughness; - } - - /* - Typical code which passes a few values from c++ to shader. - */ - virtual void OnSetMaterial(const video::SMaterial& material) - {} - - virtual void OnSetConstants(video::IMaterialRendererServices* services, s32 userData) - { - video::IVideoDriver* driver = services->getVideoDriver(); - - if ( worldViewProjID < 0 ) // first update - { - styleUvwID = services->getVertexShaderConstantID("StyleUVW"); - if( driver->getDriverType() == video::EDT_DIRECT3D9 ) - { - worldViewProjID = services->getVertexShaderConstantID("WorldViewProj"); - } - worldID = services->getVertexShaderConstantID("World"); - cameraPosID = services->getVertexShaderConstantID("CameraPos"); - roughnessID = services->getPixelShaderConstantID("Roughness"); - } - - services->setVertexShaderConstant(styleUvwID, &StyleUVW, 1 ); - - irr::core::matrix4 world = driver->getTransform(irr::video::ETS_WORLD); - services->setVertexShaderConstant(worldID, world.pointer(), 16); - - if( driver->getDriverType() == video::EDT_DIRECT3D9 ) - { - irr::core::matrix4 worldViewProj; - worldViewProj = driver->getTransform(irr::video::ETS_PROJECTION); - worldViewProj *= driver->getTransform(irr::video::ETS_VIEW); - worldViewProj *= world; - services->setVertexShaderConstant(worldViewProjID, worldViewProj.pointer(), 16); - } - - core::vector3df cameraPos = SceneMgr->getActiveCamera()->getAbsolutePosition(); - services->setVertexShaderConstant(cameraPosID, &cameraPos.X, 3 ); - services->setPixelShaderConstant(roughnessID, &Roughness, 1 ); - } - -private: - scene::ISceneManager* SceneMgr; - - int StyleUVW; // 0 = specular, 1=diffuse, 2 = use model vertex coordinates for uvw. - float Roughness; // cubemap 0 = specular ... highest value depends on number of mipmaps in the texture - - irr::s32 styleUvwID; - irr::s32 worldViewProjID; - irr::s32 worldID; - irr::s32 cameraPosID; - irr::s32 roughnessID; -}; - -/* - To keep the example compact our event-receiver acts also like a main - application class. So it handles user input, updates the dynamic parts of - the UI and it keeps some 3d nodes around. -*/ -class MyEventReceiver : public IEventReceiver -{ -public: - MyEventReceiver() : Driver(0), Shader(0) - ,BackgroundSkybox(0), BackgroundCube(0) - , CubemapUpdates(2) - , CurrentStyleUVW(0), CurrentRoughness(0) - , NeedCubemapUpdate(true) - { - StyleNamesUVW.push_back( L"specular" ); - StyleNamesUVW.push_back( L"diffuse" ); - StyleNamesUVW.push_back( L"model coordinates" ); - } - - // Handle the key input - virtual bool OnEvent(const SEvent& event) - { - if (event.EventType == EET_KEY_INPUT_EVENT && event.KeyInput.PressedDown == false) - { - switch(event.KeyInput.Key ) - { - case KEY_SPACE: - // Switch between different texture mapping styles - if ( Shader ) - { - Shader->SetStyleUVW((Shader->GetStyleUVW()+1)%StyleNamesUVW.size()); - updateStyleUVW(); - } - break; - case KEY_KEY_B: - // Switch between our 2 different backgrounds - if ( BackgroundSkybox && BackgroundCube ) - { - if ( BackgroundSkybox->isVisible() ) - { - BackgroundSkybox->setVisible(false); - BackgroundCube->setVisible(true); - } - else - { - BackgroundSkybox->setVisible(true); - BackgroundCube->setVisible(false); - } - NeedCubemapUpdate = true; - } - break; - case KEY_KEY_I: - // Show/hide the info text nodes - for (u32 i=0; isetVisible(!InfoTextNodes[i]->isVisible()); - break; - case KEY_KEY_S: - // Enable/disable seamless smoothing of mipmaps over cube borders - if ( Driver ) - { - Driver->disableFeature(video::EVDF_TEXTURE_CUBEMAP_SEAMLESS, Driver->queryFeature(video::EVDF_TEXTURE_CUBEMAP_SEAMLESS) ); - updateSeamless(); - } - break; - case KEY_KEY_U: - // Switch dynamic cubemap updates on/off. - CubemapUpdates = (CubemapUpdates+1) % 3; - updateCubemapUpdates(); - break; - case KEY_PLUS: - case KEY_ADD: - // Make material rougher - if ( Shader ) - { - Shader->SetRoughness( Shader->getRoughness() + 0.5f ); - updateRoughness(); - } - break; - case KEY_MINUS: - case KEY_SUBTRACT: - { - // Make material smoother - if ( Shader ) - { - float roughness = Shader->getRoughness() - 0.5f; - if ( roughness >= 0.f ) - { - Shader->SetRoughness(roughness); - updateRoughness(); - } - } - break; - } - default: - break; - } - } - - return false; - } - - // Some helper functions to update the UI - void updateStyleUVW() - { - if ( CurrentStyleUVW && Shader) - CurrentStyleUVW->setText(StyleNamesUVW[Shader->GetStyleUVW()].c_str()); - } - - void updateRoughness() - { - if ( CurrentRoughness && Shader ) - { - CurrentRoughness->setText( irr::core::stringw(Shader->getRoughness()).c_str() ); - } - } - - void updateSeamless() - { - if ( CurrentSeamlessCubemap && Driver ) - { - CurrentSeamlessCubemap->setText( Driver->queryFeature(video::EVDF_TEXTURE_CUBEMAP_SEAMLESS) ? L"ON" : L"OFF" ); - } - } - - void updateCubemapUpdates() - { - if ( CurrentCubemapUpdates ) - { - switch ( CubemapUpdates ) - { - case 0: CurrentCubemapUpdates->setText( L"static"); break; - case 1: CurrentCubemapUpdates->setText( L"dynamic" ); break; - case 2: CurrentCubemapUpdates->setText( L"dynamic+mips" ); break; - } - } - } - - // Check if the cubemap textures should be updated with new screenshots - // return 0 for no update, 1 for update, 2 for update and fix mip-maps - int checkCubemapUpdate() - { - if ( NeedCubemapUpdate || CubemapUpdates == 2) - { - NeedCubemapUpdate = false; - return 2; - } - - return CubemapUpdates; - } - - // Add some text-node floating above it's parent node. - void addInfoTextNode(irr::gui::IGUIFont* font, const wchar_t* text, irr::scene::ISceneNode* parent) - { - if ( parent ) - { - const video::SColor infoTextCol(250, 70, 90, 90); - core::dimension2du dim(font->getDimension(text)); - core::dimension2df dimf((f32)dim.Width, (f32)dim.Height); - scene::IBillboardTextSceneNode* infoNode = parent->getSceneManager()->addBillboardTextSceneNode( font, text, parent, dimf, core::vector3df(0, 120, 0), -1, infoTextCol, infoTextCol); - InfoTextNodes.push_back(infoNode); - } - } - - irr::video::IVideoDriver* Driver; - CubeMapReflectionCallback* Shader; - - scene::ISceneNode* BackgroundSkybox; - scene::ISceneNode* BackgroundCube; - irr::core::array InfoTextNodes; - - int CubemapUpdates; // 0 = static, 1 = dynamic, 2 = dynamic with rtt - - irr::core::array StyleNamesUVW; - - irr::gui::IGUIStaticText* CurrentStyleUVW; - irr::gui::IGUIStaticText* CurrentRoughness; - irr::gui::IGUIStaticText* CurrentSeamlessCubemap; - irr::gui::IGUIStaticText* CurrentCubemapUpdates; - -private: - bool NeedCubemapUpdate; -}; - -/* Workaround for OpenGL's upside-down images. - Texture origins (0,0) in OpenGL are usually at the left-bottom instead of the more common left-top image formats. - Irrlicht internally uses textures with left-top origin and then corrects the texture-matrices in the fixed-function pipeline. - For shader materials it's left to the users to handle those UV-flips for the texture-matrix. - Render target textures (RTT's) in OpenGL are rendered with left-bottom origin and Irrlicht can't change that, so all RTT textures - in memory are upside-down (unlike all other Irrlicht textures). - In the fixed function pipeline Irrlicht handles this by flipping the RTT's texture matrix once more and for shaders it's again - left to the users to handle it. - Cubemap textures are different from other textures in OpenGL. Each cube side has left-top as the origin. So not flipping Irrlicht textures for those would be fine. - Except - OpenGL RTT's still render left-bottom - even when the target is a cubemap RTT. - I found no good way around this so far - it just seems messed up as we get a left-handed/right handed coordinate system change that way. - - So... the following 2 defines are two different workarounds I found. Both are ugly, which one is better in reality depends probably on the scene. - Only use one of those: - CUBEMAP_UPSIDE_DOWN_GL_PROJECTION is relatively fast as it just changes the project matrix. The problem is that changing the projection matrix - means changing front/backside culling. So every node rendered has to flip the material flags for those. - - CUBEMAP_USPIDE_DOWN_RTT will change the texture memory itself and flip the image upside-down. - While easier to do, this involves texture-locking and is very slow. -*/ -#define CUBEMAP_UPSIDE_DOWN_GL_PROJECTION -//#define CUBEMAP_USPIDE_DOWN_RTT - - -// Flip frontface/backface culling for all nodes -#ifdef CUBEMAP_UPSIDE_DOWN_GL_PROJECTION -void flipCullingFlags(const core::array& nodes) -{ - for ( irr::u32 n=0; n < nodes.size(); ++n ) - { - scene::ISceneNode* node = nodes[n]; - const irr::u32 matCount = node->getMaterialCount(); - for ( irr::u32 m=0; m < matCount; ++m) - { - video::SMaterial& mat = node->getMaterial(m); - mat.BackfaceCulling = !mat.BackfaceCulling; - mat.FrontfaceCulling = !mat.FrontfaceCulling; - } - } -} -#endif - - -/* - Render the environment around a node into a cubemap texture. -*/ -void renderEnvironmentCubeMap(irr::video::IVideoDriver* driver, irr::scene::ICameraSceneNode* cubeMapCamera, irr::scene::ISceneNode* cubeCenterNode, video::IRenderTarget* cubeMapRT, video::ITexture* dynamicCubeMapRTT, video::ITexture* depthStencilRTT) -{ - // Change to the cubemap camera which has a few specific render-settings - scene::ISceneManager* smgr = cubeMapCamera->getSceneManager(); - scene::ICameraSceneNode * oldCam = smgr->getActiveCamera(); - smgr->setActiveCamera( cubeMapCamera ); - - /* - We want to see everything around the center node, so hide the node - itself, otherwise it would be in the way. - Then set the camera to that node's position. - */ - cubeCenterNode->setVisible( false ); - const core::vector3df center( cubeCenterNode->getAbsolutePosition() ); - cubeMapCamera->setPosition( center ); - - /* - Render all 6 directions. Which means simple setting the camera target/up - vector to all 6 directions and then render the full scene each time. - So yeah - updating an environment cube-map means 6 full renders for each - object which needs an environment map. In other words - you generally only - want to do that in pre-processing, not in realtime. - */ - const core::vector3df targetVecs[6] = { - core::vector3df(1.f, 0.f, 0.f), - core::vector3df(-1.f, 0.f, 0.f), - core::vector3df(0.f, 1.f, 0.f), - core::vector3df(0.f, -1.f, 0.f), - core::vector3df(0.f, 0.f, 1.f), - core::vector3df(0.f, 0.f, -1.f) - }; - - const core::vector3df upVecs[6] = { - core::vector3df( 0,1,0 ), - core::vector3df( 0,1,0 ), - core::vector3df( 0,0,-1 ), - core::vector3df( 0,0,1 ), - core::vector3df( 0,1,0 ), - core::vector3df( 0,1,0 ) - }; - for ( int s=0; s<6; ++s ) - { - cubeMapCamera->setUpVector( upVecs[s] ); - cubeMapCamera->setTarget( center + targetVecs[s] ); - // Here we tell into which side of the cubemap texture we want to write - cubeMapRT->setTexture(dynamicCubeMapRTT, depthStencilRTT, (video::E_CUBE_SURFACE)(video::ECS_POSX + s)); - driver->setRenderTargetEx(cubeMapRT, video::ECBF_ALL); - smgr->drawAll(); - -#ifdef CUBEMAP_USPIDE_DOWN_RTT - // This works because the lock for rtt's always flips in Irrlicht. - // So in this case lock() unlock will result in a flipped texture - // But be warned - it's very, very slow! - driver->setRenderTarget(0); // to avoid accessing active rt - dynamicCubeMapRTT->lock(video::ETLM_READ_WRITE, 0, s, video::ETLF_FLIP_Y_UP_RTT); - dynamicCubeMapRTT->unlock(); -#endif - } - - //dynamicCubeMapRTT->regenerateMipMapLevels(); // Unfortunately we can't seem to have mipmaps for rtt's - - driver->setRenderTarget(0); - cubeCenterNode->setVisible( true ); - smgr->setActiveCamera( oldCam ); -} - -/* - Typical setup at the main start. -*/ -int main() -{ - // Ask user for driver - video::E_DRIVER_TYPE driverType = driverChoiceConsole(); - if (driverType==video::EDT_COUNT) - return 1; - - // Create device - MyEventReceiver eventReceiver; - const core::dimension2d dimDevice(1024, 768); - IrrlichtDevice* device = createDevice( driverType, dimDevice, 32, false, false, false, &eventReceiver ); - if (!device) - return 1; - - const io::path mediaPath = getExampleMediaPath(); - video::IVideoDriver* driver = device->getVideoDriver(); - scene::ISceneManager* smgr = device->getSceneManager(); - gui::IGUIEnvironment* env = device->getGUIEnvironment(); - eventReceiver.Driver = driver; - - // Set window title - core::stringw strCaption(L"Cubemap example - Irrlicht Engine ["); - strCaption += driver->getName(); - strCaption += L"]"; - device->setWindowCaption(strCaption.c_str()); - - // set a nicer font - gui::IGUISkin* skin = env->getSkin(); - gui::IGUIFont* font = env->getFont(mediaPath + "fonthaettenschweiler.bmp"); - if (font) - skin->setFont(font); - - /* - Create a shader material for cube mapping - */ - video::IGPUProgrammingServices* gpu = driver->getGPUProgrammingServices(); - s32 cubeMapReflectionMaterial = 0; - if( gpu ) - { - // Decide on shader to use based on active driver - irr::io::path vsFileName; - irr::io::path psFileName; - switch( driverType ) - { - case video::EDT_DIRECT3D9: - vsFileName = mediaPath + "cubeMapReflectionVS.hlsl"; - psFileName = mediaPath + "cubeMapReflectionPS.hlsl"; - break; - - case video::EDT_OPENGL: - vsFileName = mediaPath + "cubeMapReflection.vert"; - psFileName = mediaPath + "cubeMapReflection.frag"; - break; - } - - CubeMapReflectionCallback* cubeMapCB = new CubeMapReflectionCallback(smgr, 2); - cubeMapReflectionMaterial = gpu->addHighLevelShaderMaterialFromFiles( - vsFileName, "VS", video::EVST_VS_1_1, - psFileName, "PS", video::EPST_PS_3_0, - cubeMapCB, video::EMT_SOLID ); - if ( cubeMapReflectionMaterial >= 0 ) - eventReceiver.Shader = cubeMapCB; - cubeMapCB->drop(); - } - - // add fps camera - scene::ICameraSceneNode* camera = smgr->addCameraSceneNodeFPS(0, 100.f, 1.f); - camera->setPosition( core::vector3df( 0,10,-200 ) ); - device->getCursorControl()->setVisible(false); - - /* - Get 6 images forming a cubemap. The coordinate system used in those images - seemed to be different than the one in Irrlicht. I decided to leave it like - that because it's pretty common that way. If you get cubemap textures which - seem to have x/y/z axis named different you'll just have to experiment until - you figured out the correct order. - */ - core::array cubeMapImages; - cubeMapImages.push_back(driver->createImageFromFile( mediaPath + "cubemap_posx.jpg" )); - cubeMapImages.push_back(driver->createImageFromFile( mediaPath + "cubemap_negx.jpg" )); - cubeMapImages.push_back(driver->createImageFromFile( mediaPath + "cubemap_posy.jpg" )); - cubeMapImages.push_back(driver->createImageFromFile( mediaPath + "cubemap_negy.jpg" )); - cubeMapImages.push_back(driver->createImageFromFile( mediaPath + "cubemap_posz.jpg" )); - cubeMapImages.push_back(driver->createImageFromFile( mediaPath + "cubemap_negz.jpg" )); - - /* Create a cubemap texture from those images. Note that 6 images become a single texture now. */ - video::ITexture* cubeMapStaticTex = 0; - cubeMapStaticTex = driver->addTextureCubemap("cm", cubeMapImages[0], cubeMapImages[1], cubeMapImages[2], cubeMapImages[3], cubeMapImages[4], cubeMapImages[5]); - for ( u32 i=0; idrop(); - cubeMapImages.clear(); - - /* Create a render target, cubemap render-target-textures and a camera with settings for cube mapping */ - video::IRenderTarget* cubeMapRT = driver->addRenderTarget(); - video::ITexture* dynamicCubeMapRTT = 0; - video::ITexture* depthStencilRTT = 0; - video::ITexture* dynamicCubeMapRTT_intermediate = 0; // just for rendering, but not used in material - video::ITexture* dynamicCubeMapTex = 0; // dynamic and with mipmaps - scene::ICameraSceneNode* cubeMapCamera = 0; - if( driver->queryFeature( video::EVDF_RENDER_TO_TARGET ) ) - { - // Create cube map textures and render target cubemap textures. - const u32 dynamicCubeMapSize = 512; - dynamicCubeMapRTT = driver->addRenderTargetTextureCubemap(dynamicCubeMapSize, "cube_rtr"); - depthStencilRTT = driver->addRenderTargetTexture(irr::core::dimension2du(dynamicCubeMapSize, dynamicCubeMapSize), "cubemap_ds", irr::video::ECF_D24S8); - - dynamicCubeMapRTT_intermediate = driver->addRenderTargetTextureCubemap(dynamicCubeMapSize, "cube_rtr"); - dynamicCubeMapTex = driver->addTextureCubemap(dynamicCubeMapSize, "cube_tex"); - - // Camera for creating an environment cubemap - cubeMapCamera = smgr->addCameraSceneNode(); - cubeMapCamera->setFOV(core::PI* 0.5f); // 90° view angle - cubeMapCamera->setAspectRatio(1.f); // it's a cube... all sides have the same length - smgr->setActiveCamera( camera ); - } - - /* - Add sphere-nodes which will be using the cubemaps as materials. - You may also want to experiment with other node-types here! - */ - - scene::ISceneNode* sphereNode = 0; - scene::ISceneNode* sphereNode2 = 0; - scene::ISceneNode* sphereNode3 = 0; - scene::IMesh* sphereMesh = smgr->getGeometryCreator()->createSphereMesh(100.f); - if( sphereMesh ) - { - // Nothing really special here except they need the shader material to display cubemaps. - sphereNode = smgr->addMeshSceneNode( sphereMesh ); - sphereNode->setPosition( core::vector3df(-250,0,0) ); - sphereNode->updateAbsolutePosition(); - sphereNode->setMaterialFlag( video::EMF_LIGHTING, false ); - sphereNode->setMaterialTexture( 0, dynamicCubeMapRTT ); - sphereNode->setMaterialType( (video::E_MATERIAL_TYPE)cubeMapReflectionMaterial ); - eventReceiver.addInfoTextNode(font, L"Cubemap dynamic rtt, no mip-maps", sphereNode); - - if ( dynamicCubeMapTex ) - { - sphereNode3 = smgr->addMeshSceneNode( sphereMesh ); - sphereNode3->setPosition( core::vector3df(0,0,250) ); - sphereNode3->updateAbsolutePosition(); - sphereNode3->setMaterialFlag( video::EMF_LIGHTING, false ); - sphereNode3->setMaterialTexture( 0, dynamicCubeMapTex ); - sphereNode3->getMaterial(0).TextureLayer[0].TrilinearFilter = false; // this is default anyway. It would be faster - but you can only access integer mip-levels - no filtering between mip-levels. - sphereNode3->setMaterialType( (video::E_MATERIAL_TYPE)cubeMapReflectionMaterial ); - eventReceiver.addInfoTextNode(font, L"Cubemap dynamic with mip-maps", sphereNode3); - } - - if ( cubeMapStaticTex ) - { - sphereNode2 = smgr->addMeshSceneNode( sphereMesh ); - sphereNode2->setPosition( core::vector3df(250,0,0) ); - sphereNode2->updateAbsolutePosition(); - sphereNode2->setMaterialFlag( video::EMF_LIGHTING, false ); - sphereNode2->setMaterialTexture( 0, cubeMapStaticTex ); - sphereNode2->getMaterial(0).TextureLayer[0].TrilinearFilter = true; // this way smoothing happens between different mip-levels. - sphereNode2->setMaterialType( (video::E_MATERIAL_TYPE)cubeMapReflectionMaterial ); - eventReceiver.addInfoTextNode(font, L"Cubemap fixed images", sphereNode2); - } - - sphereMesh->drop(); - } - - /* Add some background which will show up in the environment maps. - For first one we use the same textures as used in the spheres. - Note the difference between a skybox and a cubemap is that the skybox really uses 6 different - textures. While the cubemap uses a single texture created from 6 images. */ - eventReceiver.BackgroundSkybox = smgr->addSkyBoxSceneNode( - driver->getTexture(mediaPath + "cubemap_posy.jpg"), // top - driver->getTexture(mediaPath + "cubemap_negy.jpg"), // bottom - driver->getTexture(mediaPath + "cubemap_posz.jpg"), // left - driver->getTexture(mediaPath + "cubemap_negz.jpg"), // right - driver->getTexture(mediaPath + "cubemap_posx.jpg"), // front - driver->getTexture(mediaPath + "cubemap_negx.jpg")); // back - - - - /* Another background for comparison and to make it more obvious - when the spheres reflect the environment and when they use static cubemaps. */ - scene::IMesh * cubeMesh = smgr->getGeometryCreator()->createCubeMesh( core::vector3df(10.f, 10.f, 10.f), scene::ECMT_6BUF_4VTX_NP); - smgr->getMeshManipulator()->scale(cubeMesh, core::vector3df(-1, 1, 1)); - if( cubeMesh ) - { - smgr->getMeshManipulator()->setVertexColors( cubeMesh->getMeshBuffer(0), video::SColor(255, 240, 10, 10) ); - smgr->getMeshManipulator()->setVertexColors( cubeMesh->getMeshBuffer(1), video::SColor(255, 240, 130, 10) ); - smgr->getMeshManipulator()->setVertexColors( cubeMesh->getMeshBuffer(2), video::SColor(255, 50, 250, 10) ); - smgr->getMeshManipulator()->setVertexColors( cubeMesh->getMeshBuffer(3), video::SColor(255, 70, 10, 250) ); - smgr->getMeshManipulator()->setVertexColors( cubeMesh->getMeshBuffer(4), video::SColor(255, 240, 250, 10) ); - smgr->getMeshManipulator()->setVertexColors( cubeMesh->getMeshBuffer(5), video::SColor(255, 85, 250, 250) ); - - eventReceiver.BackgroundCube = smgr->addMeshSceneNode( cubeMesh ); - cubeMesh->drop(); - - eventReceiver.BackgroundCube->setScale( core::vector3df( 200, 200, 200 ) ); - eventReceiver.BackgroundCube->setMaterialFlag( video::EMF_LIGHTING, false ); - eventReceiver.BackgroundCube->setVisible(false); - } - -#ifdef CUBEMAP_UPSIDE_DOWN_GL_PROJECTION - if ( driverType == video::EDT_OPENGL ) - { - // Flip projection matrix (note this also flips front/backface culling) - core::matrix4 matProj = cubeMapCamera->getProjectionMatrix(); - matProj[4] = -matProj[4]; - matProj[5] = -matProj[5]; - matProj[6] = -matProj[6]; - matProj[7] = -matProj[7]; - cubeMapCamera->setProjectionMatrix(matProj); - } -#endif - - /* - Add some moving node to show the difference between static/dynamic environment maps - */ - scene::IMeshSceneNode * movingNode = smgr->addCubeSceneNode(30.f); - movingNode->getMaterial(0).Lighting = false; - smgr->getMeshManipulator()->setVertexColors( movingNode->getMesh()->getMeshBuffer(0), video::SColor(255, 230, 200, 150)); - scene::ISceneNodeAnimator* circleAnimator = smgr->createFlyCircleAnimator(core::vector3df(-125, -50.f, 125), 300.f, 0.0005f); - movingNode->addAnimator(circleAnimator); - circleAnimator->drop(); - - /* Add some UI */ - if ( eventReceiver.Shader ) - { - skin->setColor(gui::EGDC_3D_FACE, video::SColor(50, 160, 120, 120)); - - u32 top = dimDevice.Height - 200; - const u32 left = dimDevice.Width - 350; - const u32 right = dimDevice.Width - 10; - irr::gui::IGUIStaticText * stextUVW = env->addStaticText(L" Style of generating texture coordinates:\n Change with (space)", core::recti(left, top, right, top+35), false, true, 0, -1, true); - top += 40; - stextUVW->setTextAlignment(gui::EGUIA_UPPERLEFT, gui::EGUIA_UPPERLEFT); - eventReceiver.CurrentStyleUVW = env->addStaticText(L"", core::recti(240,0, 400, 20), false, false, stextUVW); - eventReceiver.updateStyleUVW(); - - irr::gui::IGUIStaticText * stextRoughness = env->addStaticText(L" Roughness:\n Change with (+) and (-)", core::recti(left, top, right, top+35), false, true, 0, -1, true); - top += 40; - eventReceiver.CurrentRoughness = env->addStaticText( L"", core::recti(240,0, 400, 20), false, false, stextRoughness); - eventReceiver.updateRoughness(); - - irr::gui::IGUIStaticText * stextSeamlessCupemap = env->addStaticText(L" Seamless cubemap (with roughness):\n Change with (s)", core::recti(left, top, right, top+35), false, true, 0, -1, true); - top += 40; - eventReceiver.CurrentSeamlessCubemap = env->addStaticText( L"", core::recti(240,0, 400, 20), false, false, stextSeamlessCupemap); - eventReceiver.updateSeamless(); - - irr::gui::IGUIStaticText * stextUpdates = env->addStaticText(L" Cubemap updates:\n Change with (u)", core::recti(left, top, right, top+35), false, true, 0, -1, true); - top += 40; - eventReceiver.CurrentCubemapUpdates = env->addStaticText( L"", core::recti(240,0, 400, 20), false, false, stextUpdates); - eventReceiver.updateCubemapUpdates(); - - env->addStaticText(L" Change background with (b)", core::recti(left, top, right, top+15), false, true, 0, -1, true); - top += 20; - - env->addStaticText(L" Show/hide info nodes with (i)", core::recti(left, top, right, top+15), false, true, 0, -1, true); - } - - - /* Main loop */ - while(device->run()) - { - if (device->isWindowActive()) - { - driver->beginScene(true, true, video::SColor(255, 127, 127, 255)); - - /* Check if we want to update the environment maps. - Usually not something you'll do every frame, but either once at the star - or maybe updating an environment map once in a while. - */ - int updateCubemaps = eventReceiver.checkCubemapUpdate(); - if( dynamicCubeMapRTT && sphereNode && updateCubemaps > 0 ) - { -#ifdef CUBEMAP_UPSIDE_DOWN_GL_PROJECTION - core::array allNodes; - if ( driverType == video::EDT_OPENGL ) - { - /* - Flipping projection matrix flips front/backface culling. - We only have a skybox so in this case this still would be fast, with more objects it's getting more ugly. - */ - smgr->getSceneNodesFromType(scene::ESNT_ANY, allNodes); - flipCullingFlags(allNodes); - } -#endif - /* - If rendered just once then this node has still a white (or even undefined) texture at this point - Just hiding it and render the background when rendering the cubemap for the other node is less noticable - than having a big white dot in the environment texture. - Render order can matter if you want several environment maps in your scene. - */ - if (sphereNode3) - sphereNode3->setVisible(false); - - renderEnvironmentCubeMap(driver, cubeMapCamera, sphereNode, cubeMapRT, dynamicCubeMapRTT, depthStencilRTT); - - if ( sphereNode3) - { - if ( updateCubemaps == 2 ) - { - /* - Our rtt's unfortunately don't have mipmaps (sorry, not sure if we can get that somehow...) - So if we want mipmaps in the dynamic cubemap we have to copy it to a non-rtt texture. - Warning: Very, very slow. Far slower than just creating an environment map as this - will copy the texture from GPU to main memory - copy it to a new texture, create mip-maps and - upload the result back to the GPU. - */ - renderEnvironmentCubeMap(driver, cubeMapCamera, sphereNode3, cubeMapRT, dynamicCubeMapRTT_intermediate, depthStencilRTT); - for ( int i=0; i<6; ++i) - { - void * rtData = dynamicCubeMapRTT_intermediate->lock(video::ETLM_READ_ONLY, 0, i, video::ETLF_NONE); - void * tData = dynamicCubeMapTex->lock(video::ETLM_READ_WRITE, 0, i); - memcpy(tData, rtData, dynamicCubeMapTex->getPitch()*dynamicCubeMapTex->getSize().Width); - dynamicCubeMapRTT_intermediate->unlock(); - dynamicCubeMapTex->unlock(); - dynamicCubeMapTex->regenerateMipMapLevels(); - } - } - sphereNode3->setVisible(true); - } - -#ifdef CUBEMAP_UPSIDE_DOWN_GL_PROJECTION - if ( driverType == video::EDT_OPENGL ) - { - flipCullingFlags(allNodes); - } -#endif - } - - smgr->drawAll(); - env->drawAll(); - - driver->endScene(); - } - } - - device->drop(); - - return 0; -} - -/* -**/ diff --git a/examples/29.HardwareSkinning/where_is_it.txt b/examples/29.HardwareSkinning/where_is_it.txt deleted file mode 100644 index afe0b22e..00000000 --- a/examples/29.HardwareSkinning/where_is_it.txt +++ /dev/null @@ -1,2 +0,0 @@ -This example is currently only available in Irrlicht svn branch for the shader-pipeline: https://sourceforge.net/p/irrlicht/code/HEAD/tree/branches/shader-pipeline -It will be merged with the svn trunk at some point in the future. diff --git a/examples/30.Profiling/Makefile b/examples/30.Profiling/Makefile deleted file mode 100644 index fa113d48..00000000 --- a/examples/30.Profiling/Makefile +++ /dev/null @@ -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 := 30.Profiling -# 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 diff --git a/examples/30.Profiling/Profiling.cbp b/examples/30.Profiling/Profiling.cbp deleted file mode 100644 index 0f71fbde..00000000 --- a/examples/30.Profiling/Profiling.cbp +++ /dev/null @@ -1,55 +0,0 @@ - - - - - - diff --git a/examples/30.Profiling/Profiling.vcproj b/examples/30.Profiling/Profiling.vcproj deleted file mode 100644 index 494f9bb4..00000000 --- a/examples/30.Profiling/Profiling.vcproj +++ /dev/null @@ -1,132 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/examples/30.Profiling/Profiling.xcodeproj/project.pbxproj b/examples/30.Profiling/Profiling.xcodeproj/project.pbxproj deleted file mode 100644 index 6468c707..00000000 --- a/examples/30.Profiling/Profiling.xcodeproj/project.pbxproj +++ /dev/null @@ -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 /* 30.Profiling.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = 30.Profiling.app; sourceTree = BUILT_PRODUCTS_DIR; }; - 5E34CC741B7F8EEF00F212E8 /* main.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = main.cpp; sourceTree = ""; }; - 5E34CC781B7F90A000F212E8 /* libIrrlicht.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libIrrlicht.a; path = ../../lib/OSX/libIrrlicht.a; sourceTree = ""; }; - 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 = ""; }; -/* 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 = ""; - }; - 5E34CC521B7F8E6E00F212E8 /* Products */ = { - isa = PBXGroup; - children = ( - 5E34CC511B7F8E6E00F212E8 /* 30.Profiling.app */, - ); - name = Products; - sourceTree = ""; - }; - 5E34CC761B7F905600F212E8 /* Libraries */ = { - isa = PBXGroup; - children = ( - 5E8570B01B7F99F500B267D2 /* Cocoa.framework */, - 5E8570B41B7F9A0700B267D2 /* IOKit.framework */, - 5E8570B21B7F99FE00B267D2 /* OpenGL.framework */, - 5E34CC781B7F90A000F212E8 /* libIrrlicht.a */, - ); - name = Libraries; - sourceTree = ""; - }; - 5E34CC771B7F906D00F212E8 /* Resources */ = { - isa = PBXGroup; - children = ( - 5E8570BE1B7F9D3A00B267D2 /* media */, - ); - name = Resources; - sourceTree = ""; - }; -/* End PBXGroup section */ - -/* Begin PBXNativeTarget section */ - 5E34CC501B7F8E6E00F212E8 /* 30.Profiling */ = { - isa = PBXNativeTarget; - buildConfigurationList = 5E34CC701B7F8E6E00F212E8 /* Build configuration list for PBXNativeTarget "30.Profiling" */; - buildPhases = ( - 5E34CC4D1B7F8E6E00F212E8 /* Sources */, - 5E34CC4E1B7F8E6E00F212E8 /* Frameworks */, - 5E34CC4F1B7F8E6E00F212E8 /* Resources */, - ); - buildRules = ( - ); - dependencies = ( - ); - name = 30.Profiling; - productName = 01.HelloWorld; - productReference = 5E34CC511B7F8E6E00F212E8 /* 30.Profiling.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 "Profiling" */; - compatibilityVersion = "Xcode 3.2"; - developmentRegion = English; - hasScannedForEncodings = 0; - knownRegions = ( - en, - Base, - ); - mainGroup = 5E34C6D81B7F4A0C00F212E8; - productRefGroup = 5E34CC521B7F8E6E00F212E8 /* Products */; - projectDirPath = ""; - projectRoot = ""; - targets = ( - 5E34CC501B7F8E6E00F212E8 /* 30.Profiling */, - ); - }; -/* 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 "Profiling" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 5E34C6DD1B7F4A0C00F212E8 /* Debug */, - 5E34C6DE1B7F4A0C00F212E8 /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - 5E34CC701B7F8E6E00F212E8 /* Build configuration list for PBXNativeTarget "30.Profiling" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 5E34CC6C1B7F8E6E00F212E8 /* Debug */, - 5E34CC6D1B7F8E6E00F212E8 /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; -/* End XCConfigurationList section */ - }; - rootObject = 5E34C6D91B7F4A0C00F212E8 /* Project object */; -} diff --git a/examples/30.Profiling/Profiling.xcodeproj/xcshareddata/xcschemes/30.Profiling.xcscheme b/examples/30.Profiling/Profiling.xcodeproj/xcshareddata/xcschemes/30.Profiling.xcscheme deleted file mode 100644 index 111087e8..00000000 --- a/examples/30.Profiling/Profiling.xcodeproj/xcshareddata/xcschemes/30.Profiling.xcscheme +++ /dev/null @@ -1,91 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/examples/30.Profiling/Profiling_vc10.vcxproj b/examples/30.Profiling/Profiling_vc10.vcxproj deleted file mode 100644 index 7fba2fa9..00000000 --- a/examples/30.Profiling/Profiling_vc10.vcxproj +++ /dev/null @@ -1,184 +0,0 @@ - - - - - Debug - Win32 - - - Debug - x64 - - - Release - Win32 - - - Release - x64 - - - - 30.Profiling - {65D9DE2E-B73E-4ADF-96D1-BF4A8B7F4F97} - 30.Profiling - Win32Proj - - - - Application - MultiByte - - - Application - MultiByte - - - Application - MultiByte - - - Application - MultiByte - - - - - - - - - - - - - - - - - - - - - - - <_ProjectFileVersion>10.0.30319.1 - ..\..\bin\Win32-VisualStudio\ - ..\..\bin\Win64-VisualStudio\ - ..\..\bin\Win32-VisualStudio\ - ..\..\bin\Win64-VisualStudio\ - AllRules.ruleset - AllRules.ruleset - - - - - AllRules.ruleset - AllRules.ruleset - - - - - - - - Disabled - ..\..\include;%(AdditionalIncludeDirectories) - WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions) - true - EnableFastChecks - MultiThreadedDebug - - - Level3 - EditAndContinue - - - ..\..\bin\Win32-VisualStudio\30.Profiling.exe - ..\..\lib\Win32-visualstudio;%(AdditionalLibraryDirectories) - true - $(OutDir)Profiling.pdb - Console - - - - - - - Disabled - ..\..\include;%(AdditionalIncludeDirectories) - WIN32;WIN64;_DEBUG;_WINDOWS;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebug - - - Level3 - ProgramDatabase - - - ..\..\bin\Win64-VisualStudio\30.Profiling.exe - ..\..\lib\Win64-visualstudio;%(AdditionalLibraryDirectories) - true - $(OutDir)Profiling.pdb - Console - - - - - - - true - Speed - ..\..\include;%(AdditionalIncludeDirectories) - WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions) - Sync - - - Level3 - - - Cdecl - - - ..\..\bin\Win32-VisualStudio\30.Profiling.exe - ..\..\lib\Win32-visualstudio;%(AdditionalLibraryDirectories) - false - Console - true - true - - - - - - - true - Speed - ..\..\include;%(AdditionalIncludeDirectories) - WIN32;WIN64;NDEBUG;_WINDOWS;%(PreprocessorDefinitions) - Sync - - - Level3 - - - Cdecl - - - ..\..\bin\Win64-VisualStudio\30.Profiling.exe - ..\..\lib\Win64-visualstudio;%(AdditionalLibraryDirectories) - false - Console - true - true - - - - - - - - - - - \ No newline at end of file diff --git a/examples/30.Profiling/Profiling_vc11.vcxproj b/examples/30.Profiling/Profiling_vc11.vcxproj deleted file mode 100644 index 265698a9..00000000 --- a/examples/30.Profiling/Profiling_vc11.vcxproj +++ /dev/null @@ -1,188 +0,0 @@ - - - - - Debug - Win32 - - - Debug - x64 - - - Release - Win32 - - - Release - x64 - - - - 30.Profiling - {65D9DE2E-B73E-4ADF-96D1-BF4A8B7F4F97} - 30.Profiling - Win32Proj - - - - Application - MultiByte - v110 - - - Application - MultiByte - v110 - - - Application - MultiByte - v110 - - - Application - MultiByte - v110 - - - - - - - - - - - - - - - - - - - - - - - <_ProjectFileVersion>10.0.30319.1 - ..\..\bin\Win32-VisualStudio\ - ..\..\bin\Win64-VisualStudio\ - ..\..\bin\Win32-VisualStudio\ - ..\..\bin\Win64-VisualStudio\ - AllRules.ruleset - AllRules.ruleset - - - - - AllRules.ruleset - AllRules.ruleset - - - - - - - - Disabled - ..\..\include;%(AdditionalIncludeDirectories) - WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions) - true - EnableFastChecks - MultiThreadedDebug - - - Level3 - EditAndContinue - - - ..\..\bin\Win32-VisualStudio\30.Profiling.exe - ..\..\lib\Win32-visualstudio;%(AdditionalLibraryDirectories) - true - $(OutDir)Profiling.pdb - Console - - - - - - - Disabled - ..\..\include;%(AdditionalIncludeDirectories) - WIN32;WIN64;_DEBUG;_WINDOWS;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebug - - - Level3 - ProgramDatabase - - - ..\..\bin\Win64-VisualStudio\30.Profiling.exe - ..\..\lib\Win64-visualstudio;%(AdditionalLibraryDirectories) - true - $(OutDir)Profiling.pdb - Console - - - - - - - true - Speed - ..\..\include;%(AdditionalIncludeDirectories) - WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions) - Sync - - - Level3 - - - Cdecl - - - ..\..\bin\Win32-VisualStudio\30.Profiling.exe - ..\..\lib\Win32-visualstudio;%(AdditionalLibraryDirectories) - false - Console - true - true - - - - - - - true - Speed - ..\..\include;%(AdditionalIncludeDirectories) - WIN32;WIN64;NDEBUG;_WINDOWS;%(PreprocessorDefinitions) - Sync - - - Level3 - - - Cdecl - - - ..\..\bin\Win64-VisualStudio\30.Profiling.exe - ..\..\lib\Win64-visualstudio;%(AdditionalLibraryDirectories) - false - Console - true - true - - - - - - - - - - - \ No newline at end of file diff --git a/examples/30.Profiling/Profiling_vc12.vcxproj b/examples/30.Profiling/Profiling_vc12.vcxproj deleted file mode 100644 index 1b5e4972..00000000 --- a/examples/30.Profiling/Profiling_vc12.vcxproj +++ /dev/null @@ -1,188 +0,0 @@ - - - - - Debug - Win32 - - - Debug - x64 - - - Release - Win32 - - - Release - x64 - - - - 30.Profiling - {65D9DE2E-B73E-4ADF-96D1-BF4A8B7F4F97} - 30.Profiling - Win32Proj - - - - Application - MultiByte - Windows7.1SDK - - - Application - MultiByte - Windows7.1SDK - - - Application - MultiByte - Windows7.1SDK - - - Application - MultiByte - Windows7.1SDK - - - - - - - - - - - - - - - - - - - - - - - <_ProjectFileVersion>10.0.30319.1 - ..\..\bin\Win32-VisualStudio\ - ..\..\bin\Win64-VisualStudio\ - ..\..\bin\Win32-VisualStudio\ - ..\..\bin\Win64-VisualStudio\ - AllRules.ruleset - AllRules.ruleset - - - - - AllRules.ruleset - AllRules.ruleset - - - - - - - - Disabled - ..\..\include;%(AdditionalIncludeDirectories) - WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions) - true - EnableFastChecks - MultiThreadedDebug - - - Level3 - EditAndContinue - - - ..\..\bin\Win32-VisualStudio\30.Profiling.exe - ..\..\lib\Win32-visualstudio;%(AdditionalLibraryDirectories) - true - $(OutDir)Profiling.pdb - Console - - - - - - - Disabled - ..\..\include;%(AdditionalIncludeDirectories) - WIN32;WIN64;_DEBUG;_WINDOWS;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebug - - - Level3 - ProgramDatabase - - - ..\..\bin\Win64-VisualStudio\30.Profiling.exe - ..\..\lib\Win64-visualstudio;%(AdditionalLibraryDirectories) - true - $(OutDir)Profiling.pdb - Console - - - - - - - true - Speed - ..\..\include;%(AdditionalIncludeDirectories) - WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions) - Sync - - - Level3 - - - Cdecl - - - ..\..\bin\Win32-VisualStudio\30.Profiling.exe - ..\..\lib\Win32-visualstudio;%(AdditionalLibraryDirectories) - false - Console - true - true - - - - - - - true - Speed - ..\..\include;%(AdditionalIncludeDirectories) - WIN32;WIN64;NDEBUG;_WINDOWS;%(PreprocessorDefinitions) - Sync - - - Level3 - - - Cdecl - - - ..\..\bin\Win64-VisualStudio\30.Profiling.exe - ..\..\lib\Win64-visualstudio;%(AdditionalLibraryDirectories) - false - Console - true - true - - - - - - - - - - - \ No newline at end of file diff --git a/examples/30.Profiling/Profiling_vc14.vcxproj b/examples/30.Profiling/Profiling_vc14.vcxproj deleted file mode 100644 index caf33cd9..00000000 --- a/examples/30.Profiling/Profiling_vc14.vcxproj +++ /dev/null @@ -1,188 +0,0 @@ - - - - - Debug - Win32 - - - Debug - x64 - - - Release - Win32 - - - Release - x64 - - - - 30.Profiling - {65D9DE2E-B73E-4ADF-96D1-BF4A8B7F4F97} - 30.Profiling - Win32Proj - - - - Application - MultiByte - v140 - - - Application - MultiByte - v140 - - - Application - MultiByte - v140 - - - Application - MultiByte - v140 - - - - - - - - - - - - - - - - - - - - - - - <_ProjectFileVersion>10.0.30319.1 - ..\..\bin\Win32-VisualStudio\ - ..\..\bin\Win64-VisualStudio\ - ..\..\bin\Win32-VisualStudio\ - ..\..\bin\Win64-VisualStudio\ - AllRules.ruleset - AllRules.ruleset - - - - - AllRules.ruleset - AllRules.ruleset - - - - - - - - Disabled - ..\..\include;%(AdditionalIncludeDirectories) - WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions) - true - EnableFastChecks - MultiThreadedDebug - - - Level3 - EditAndContinue - - - ..\..\bin\Win32-VisualStudio\30.Profiling.exe - ..\..\lib\Win32-visualstudio;%(AdditionalLibraryDirectories) - true - $(OutDir)Profiling.pdb - Console - - - - - - - Disabled - ..\..\include;%(AdditionalIncludeDirectories) - WIN32;WIN64;_DEBUG;_WINDOWS;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebug - - - Level3 - ProgramDatabase - - - ..\..\bin\Win64-VisualStudio\30.Profiling.exe - ..\..\lib\Win64-visualstudio;%(AdditionalLibraryDirectories) - true - $(OutDir)Profiling.pdb - Console - - - - - - - true - Speed - ..\..\include;%(AdditionalIncludeDirectories) - WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions) - Sync - - - Level3 - - - Cdecl - - - ..\..\bin\Win32-VisualStudio\30.Profiling.exe - ..\..\lib\Win32-visualstudio;%(AdditionalLibraryDirectories) - false - Console - true - true - - - - - - - true - Speed - ..\..\include;%(AdditionalIncludeDirectories) - WIN32;WIN64;NDEBUG;_WINDOWS;%(PreprocessorDefinitions) - Sync - - - Level3 - - - Cdecl - - - ..\..\bin\Win64-VisualStudio\30.Profiling.exe - ..\..\lib\Win64-visualstudio;%(AdditionalLibraryDirectories) - false - Console - true - true - - - - - - - - - - - \ No newline at end of file diff --git a/examples/30.Profiling/main.cpp b/examples/30.Profiling/main.cpp deleted file mode 100644 index 0ad479af..00000000 --- a/examples/30.Profiling/main.cpp +++ /dev/null @@ -1,507 +0,0 @@ -// This file is part of the "Irrlicht Engine". -// For conditions of distribution and use, see copyright notice in irrlicht.h -// Copyright by Michael Zeilfelder - -/** Example 030 Profiling - -Profiling is used to get runtime information about code code. - -There exist several independent profiling tools. -Examples for free profilers are "gprof" for the GNU toolchain and "very sleepy" -from codersnotes for Windows. Proprietary tools are for example "VTune" from -Intel or "AMD APP Profiler". Those tools work by sampling the running -application regularly to get statistic information about the called functions. -The way to use them is to compile your application with special flags -to include profiling information (some also work with debug information). They -also might allow to profile only certain parts of the code, although -most can't do that. The sampling is usually rather time-consuming which means -the application will be very slow when collecting the profiling data. It's often -useful to start with one of those tools to get an overview over the bottlenecks -in your application. Those tools have the advantage that they don't need any -modifications inside the code. - -Once you need to dig deeper the Irrlicht profiler can help you. It works nearly -like a stopwatch. You add start/stop blocks into the parts of your code which -you need to check and the Irrlicht profiler will give you then the exact times -of execution for those parts. And unlike general profiler tools you don't just -get average information about the run-time but also worst-cases. Which tends -to be information you really for a stable framerate. Also the Irrlicht profiler -has a low overhead and affects only the areas which you want to time. So you -can profile applications with nearly original speed. - -Irrlicht itself has such profiling information, which is useful to figure out -where the runtime inside the engine is spend. To get that profiling data you -need to recompile Irrlicht with _IRR_COMPILE_WITH_PROFILING_ enabled as -collecting profiling information is disabled by default for speed reasons. -*/ - -/* - It's usually a good idea to wrap all your profile code with a define. - That way you don't have to worry too much about the runtime profiling - itself takes. You can remove the profiling code completely when you release - the software by removing a single define.Or sometimes you might want to - have several such defines for different areas of your application code. -*/ -#define ENABLE_MY_PROFILE // comment out to remove the profiling code -#ifdef ENABLE_MY_PROFILE - // calls code X - #define MY_PROFILE(X) X -#else - // removes the code for X in the pre-processor - #define MY_PROFILE(X) -#endif // IRR_PROFILE - -#include -#include "driverChoice.h" -#include "exampleHelper.h" - -#ifdef _MSC_VER -#pragma comment(lib, "Irrlicht.lib") -#endif - - -using namespace irr; -using namespace core; -using namespace scene; -using namespace video; -using namespace io; -using namespace gui; - -/* - We have the choice between working with fixed and with automatic profiling id's. - Here are some fixed ID's we will be using. -*/ -enum EProfiles -{ - EP_APP_TIME_ONCE, - EP_APP_TIME_UPDATED, - EP_SCOPE1, - EP_SCOPE2, - EP_DRAW_SCENE -}; - -// For our example scenes -enum EScenes -{ - ES_NONE, // no scene set - ES_CUBE, - ES_QUAKE_MAP, - ES_DWARVES, - - ES_COUNT // counting how many scenes we have -}; - -/* - Controlling the profiling display is application specific behavior. - We use function keys in our case and play around with all the parameters. - In real applications you will likely only need something to make the - profiling-display visible/invisible and switch pages while the parameters - can be set to fixed values. -*/ -class MyEventReceiver : public IEventReceiver -{ -public: - // constructor - MyEventReceiver(ISceneManager * smgr) : GuiProfiler(0), IncludeOverview(true), IgnoreUncalled(false), ActiveScene(ES_NONE), SceneManager(smgr) {} - - virtual bool OnEvent(const SEvent& event) - { - if (event.EventType == EET_KEY_INPUT_EVENT) - { - if ( event.KeyInput.PressedDown ) - { - /* - Catching keys to control the profiling display and the profiler itself - */ - switch ( event.KeyInput.Key ) - { - case KEY_F1: - GuiProfiler->setVisible( !GuiProfiler->isVisible() ); - break; - case KEY_F2: - GuiProfiler->nextPage(IncludeOverview); - break; - case KEY_F3: - GuiProfiler->previousPage(IncludeOverview); - break; - case KEY_F4: - GuiProfiler->firstPage(IncludeOverview); - break; - case KEY_F5: - IncludeOverview = !IncludeOverview; - GuiProfiler->firstPage(IncludeOverview); // not strictly needed, but otherwise the update won't update - break; - case KEY_F6: - /* - You can set more filters. This one filters out profile data which was never called. - */ - IgnoreUncalled = !IgnoreUncalled; - GuiProfiler->setFilters(IgnoreUncalled ? 1 : 0, 0, 0.f, 0); - break; - case KEY_F7: - GuiProfiler->setShowGroupsTogether( !GuiProfiler->getShowGroupsTogether() ); - break; - case KEY_F8: - NextScene(); - break; - case KEY_F9: - { - u32 index = 0; - if ( getProfiler().findGroupIndex(index, L"grp runtime") ) - { - getProfiler().resetGroup(index); - } - } - break; - case KEY_F10: - { - u32 index = 0; - if ( getProfiler().findDataIndex(index, L"scope 3") ) - { - getProfiler().resetDataByIndex(index); - } - } - break; - case KEY_F11: - getProfiler().resetAll(); - break; - case KEY_KEY_F: - GuiProfiler->setFrozen(!GuiProfiler->getFrozen()); - break; - default: - break; - } - } - } - - return false; - } - - /* - Some example scenes so we have something to profile - */ - void NextScene() - { - SceneManager->clear(); - ActiveScene = (ActiveScene+1) % ES_COUNT; - if ( ActiveScene == 0 ) - ActiveScene = ActiveScene+1; - - switch ( ActiveScene ) - { - case ES_CUBE: - { - /* - Simple scene with cube and light. - */ - MY_PROFILE(CProfileScope p(L"cube", L"grp switch scene");) - - SceneManager->addCameraSceneNode (0, core::vector3df(0, 0, 0), - core::vector3df(0, 0, 100), - -1); - - SceneManager->addCubeSceneNode (30.0f, 0, -1, - core::vector3df(0, 20, 100), - core::vector3df(45, 45, 45), - core::vector3df(1.0f, 1.0f, 1.0f)); - - SceneManager->addLightSceneNode(0, core::vector3df(0, 0, 0), - video::SColorf(1.0f, 1.0f, 1.0f), - 100.0f); - } - break; - case ES_QUAKE_MAP: - { - /* - Our typical Irrlicht example quake map. - */ - MY_PROFILE(CProfileScope p(L"quake map", L"grp switch scene");) - - scene::IAnimatedMesh* mesh = SceneManager->getMesh("20kdm2.bsp"); - scene::ISceneNode* node = 0; - - if (mesh) - node = SceneManager->addOctreeSceneNode(mesh->getMesh(0), 0, -1, 1024); - if (node) - node->setPosition(core::vector3df(-1300,-144,-1249)); - SceneManager->addCameraSceneNodeFPS(); - } - break; - case ES_DWARVES: - { - /* - Stress-test Irrlicht a little bit by creating many objects. - */ - MY_PROFILE(CProfileScope p(L"dwarfes", L"grp switch scene");) - - scene::IAnimatedMesh* aniMesh = SceneManager->getMesh( getExampleMediaPath() + "dwarf.x" ); - if (aniMesh) - { - scene::IMesh * mesh = aniMesh->getMesh (0); - if ( !mesh ) - break; - - /* - You can never have too many dwarves. So let's make some. - */ - const int nodesX = 30; - const int nodesY = 5; - const int nodesZ = 30; - - aabbox3df bbox = mesh->getBoundingBox(); - vector3df extent = bbox.getExtent(); - const f32 GAP = 10.f; - f32 halfSizeX = 0.5f * (nodesX*extent.X + GAP*(nodesX-1)); - f32 halfSizeY = 0.5f * (nodesY*extent.Y + GAP*(nodesY-1)); - f32 halfSizeZ = 0.5f * (nodesZ*extent.Z + GAP*(nodesZ-1)); - - for ( int x = 0; x < nodesX; ++x ) - { - irr::f32 gapX = x > 0 ? (x-1)*GAP : 0.f; - irr::f32 posX = -halfSizeX + x*extent.X + gapX; - for ( int y = 0; y < nodesY; ++y ) - { - irr::f32 gapY = y > 0 ? (y-1)*GAP : 0.f; - irr::f32 posY = -halfSizeY + y*extent.Y + gapY; - for ( int z=0; z < nodesZ; ++z ) - { - irr::f32 gapZ = z > 0 ? (z-1)*GAP : 0.f; - irr::f32 posZ = -halfSizeZ + z*extent.Z + gapZ; - scene::IAnimatedMeshSceneNode * node = SceneManager->addAnimatedMeshSceneNode(aniMesh, NULL, -1, vector3df(posX, posY, posZ) ); - node->setMaterialFlag(video::EMF_LIGHTING, false); - } - } - } - - irr::scene::ICameraSceneNode * camera = SceneManager->addCameraSceneNodeFPS(0, 20.f, 0.1f ); - camera->updateAbsolutePosition(); - camera->setTarget( vector3df(0,0,0) ); - camera->updateAbsolutePosition(); - camera->setPosition(irr::core::vector3df(halfSizeX+extent.X, halfSizeY+extent.Y, halfSizeZ+extent.Z)); - camera->updateAbsolutePosition(); - } - } - break; - } - } - - IGUIProfiler * GuiProfiler; - bool IncludeOverview; - bool IgnoreUncalled; - u32 ActiveScene; - scene::ISceneManager* SceneManager; -}; - -void recursive(int recursion) -{ - /* - As the profiler uses internally counters for start stop and only - takes profile data when that counter is zero we count all recursions - as a single call. - If you want to profile each call on it's own you have to use explicit start/stop calls and - stop the profile id right before the recursive call. - */ - MY_PROFILE(CProfileScope p3(L"recursive", L"grp runtime");) - if (recursion > 0 ) - recursive(recursion-1); -} - -int main() -{ - /* - Setup, nothing special here. - */ - video::E_DRIVER_TYPE driverType=driverChoiceConsole(); - if (driverType==video::EDT_COUNT) - return 1; - - /* - Profiler is independent of the device - so we can time the device setup - */ - MY_PROFILE(s32 pDev = getProfiler().add(L"createDevice", L"grp runtime");) - MY_PROFILE(getProfiler().start(pDev);) - - IrrlichtDevice * device = createDevice(driverType, core::dimension2d(640, 480)); - if (device == 0) - { - /* - When working with start/stop you should add a stop to all exit paths. - Although in this case it wouldn't matter as we don't do anything with it when we quit here. - */ - MY_PROFILE(getProfiler().stop(pDev);) - return 1; // could not create selected driver. - } - MY_PROFILE(getProfiler().stop(pDev);) - - video::IVideoDriver* driver = device->getVideoDriver(); - IGUIEnvironment* env = device->getGUIEnvironment(); - scene::ISceneManager* smgr = device->getSceneManager(); - - const io::path mediaPath = getExampleMediaPath(); - - /* - A map we use for one of our test-scenes. - */ - device->getFileSystem()->addFileArchive(mediaPath + "map-20kdm2.pk3"); - - MyEventReceiver receiver(smgr); - device->setEventReceiver(&receiver); - receiver.NextScene(); - - /* - Show some info about the controls used in this example - */ - IGUIStaticText * staticText = env->addStaticText( - L" to show/hide the profiling display\n" - L" to show the next page\n" - L" to show the previous page\n" - L" to show the first page\n" - L" to flip between including the group overview\n" - L" to flip between ignoring and showing uncalled data\n" - L" to flip between showing 1 group per page or all together\n" - L" to change our scene\n" - L" to reset the \"grp runtime\" data\n" - L" to reset the scope 3 data\n" - L" to reset all data\n" - L" to freeze/unfreeze the display\n" - , recti(10,10, 250, 140), true, true, 0, -1, true); - staticText->setWordWrap(false); - - /* - IGUIProfiler is can be used to show active profiling data at runtime. - */ - receiver.GuiProfiler = env->addProfilerDisplay(core::recti(40, 140, 600, 470)); - receiver.GuiProfiler->setDrawBackground(true); - - /* - Get a monospaced font - it's nicer when working with rows of numbers. - */ - IGUIFont* font = env->getFont(mediaPath + "fontcourier.bmp"); - if (font) - receiver.GuiProfiler->setOverrideFont(font); - - - /* - Adding ID's has to be done before the start/stop calls. - This allows start/stop to be really fast and we still have nice information like - names and groups. - Groups are created automatically each time an ID with a new group-name is added. - Groups exist to sort the display data in a nicer way. - */ - MY_PROFILE( - getProfiler().add(EP_APP_TIME_ONCE, L"full time", L"grp runtime"); - getProfiler().add(EP_APP_TIME_UPDATED, L"full time updated", L"grp runtime"); - getProfiler().add(EP_SCOPE1, L"scope 1", L"grp runtime"); - getProfiler().add(EP_DRAW_SCENE, L"draw scene", L"grp runtime"); - ) - - /* - Two timers which run the whole time. One will be continuously updated the other won't. - */ - MY_PROFILE(getProfiler().start(EP_APP_TIME_ONCE);) - MY_PROFILE(getProfiler().start(EP_APP_TIME_UPDATED);) - - s32 lastFPS = -1; - while(device->run() && driver) - { - if (device->isWindowActive()) - { - /* - For comparison show the FPS in the title bar - */ - s32 fps = driver->getFPS(); - if (lastFPS != fps) - { - core::stringw str = L"FPS: "; - str += fps; - device->setWindowCaption(str.c_str()); - lastFPS = fps; - } - - /* - Times are only updated on stop() calls. So if we want a long-running timer - to update we have to stop() and start() it in between. - Note that this will also update the call-counter and is rarely needed. - */ - MY_PROFILE(getProfiler().stop(EP_APP_TIME_UPDATED);) - MY_PROFILE(getProfiler().start(EP_APP_TIME_UPDATED);) - - /* - The following CProfileScope's will all do the same thing: - they measure the time this loop takes. They call start() - when the object is created and call stop() when it - is destroyed. - - The first one creates an ID on it's first call and will - do constant string-comparisons for the name. It's - the slowest, but most comfortable solution. Use it when you - just need to run a quick check without the hassle of setting - up id's. - */ - MY_PROFILE(CProfileScope p3(L"scope 3", L"grp runtime");) - - /* - Second CProfileScope solution will create a data block on first - call. So it's a little bit slower on the first run. But usually - that's hardly noticeable. - */ - MY_PROFILE(CProfileScope p2(EP_SCOPE2, L"scope 2", L"grp runtime");) - - /* - Last CProfileScope solution is the fastest one. But you must add - the id before you can use it like that. - */ - MY_PROFILE(CProfileScope p1(EP_SCOPE1)); - - /* - Call a recursive function to show how profiler only counts it once. - */ - recursive(5); - - driver->beginScene(video::ECBF_COLOR | video::ECBF_DEPTH, SColor(0,200,200,200)); - - /* - If you want to profile only some lines and not a complete scope - then you have to work with start() and stop() calls. - */ - MY_PROFILE(getProfiler().start(EP_DRAW_SCENE);) - smgr->drawAll(); - MY_PROFILE(getProfiler().stop(EP_DRAW_SCENE);) - - /* - If it doesn't matter if the profiler takes some time you can also - be lazy and create id's automatically on the spot: - */ - MY_PROFILE(s32 pEnv = getProfiler().add(L"draw env", L"grp runtime");) - MY_PROFILE(getProfiler().start(pEnv);) - env->drawAll(); - MY_PROFILE(getProfiler().stop(pEnv);) - - driver->endScene(); - } - } - - /* - Shutdown. - */ - device->drop(); - - /* - The profiler is independent of an device - so we can still work with it. - */ - - MY_PROFILE(getProfiler().stop(EP_APP_TIME_UPDATED)); - MY_PROFILE(getProfiler().stop(EP_APP_TIME_ONCE)); - - /* - Print a complete overview of the profiling data to the console. - */ - MY_PROFILE(core::stringw output); - MY_PROFILE(getProfiler().printAll(output)); - MY_PROFILE(printf("%s", core::stringc(output).c_str() )); - - return 0; -} - -/* -**/ diff --git a/examples/AutomatedTest/main.cpp b/examples/AutomatedTest/main.cpp index b155696c..386e14c8 100644 --- a/examples/AutomatedTest/main.cpp +++ b/examples/AutomatedTest/main.cpp @@ -45,18 +45,19 @@ int main(int argc, char *argv[]) const io::path mediaPath = getExampleMediaPath(); - scene::IAnimatedMesh* mesh = smgr->getMesh(mediaPath + "sydney.md2"); + scene::IAnimatedMesh* mesh = smgr->getMesh(mediaPath + "coolguy_opt.x"); if (!mesh) return 1; scene::IAnimatedMeshSceneNode* node = smgr->addAnimatedMeshSceneNode(mesh); if (node) { node->setMaterialFlag(video::EMF_LIGHTING, false); - node->setMD2Animation(scene::EMAT_STAND); - node->setMaterialTexture(0, driver->getTexture(mediaPath + "sydney.bmp")); + node->setFrameLoop(0, 29); + node->setAnimationSpeed(30); + node->setMaterialTexture(0, driver->getTexture(mediaPath + "cooltexture.png")); } - smgr->addCameraSceneNode(0, core::vector3df(0,30,-40), core::vector3df(0,5,0)); + smgr->addCameraSceneNode(0, core::vector3df(0,4,5), core::vector3df(0,2,0)); s32 n = 0; SEvent event; diff --git a/examples/BuildAllExamples.workspace b/examples/BuildAllExamples.workspace deleted file mode 100644 index d5cb5827..00000000 --- a/examples/BuildAllExamples.workspace +++ /dev/null @@ -1,38 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/examples/BuildAllExamples.xcworkspace/contents.xcworkspacedata b/examples/BuildAllExamples.xcworkspace/contents.xcworkspacedata deleted file mode 100644 index ae4d7b20..00000000 --- a/examples/BuildAllExamples.xcworkspace/contents.xcworkspacedata +++ /dev/null @@ -1,88 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/examples/BuildAllExamples_vc10.sln b/examples/BuildAllExamples_vc10.sln deleted file mode 100644 index 27618b7c..00000000 --- a/examples/BuildAllExamples_vc10.sln +++ /dev/null @@ -1,437 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 11.00 -# Visual Studio 2010 -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Irrlicht", "..\source\Irrlicht\Irrlicht10.0.vcxproj", "{E08E042A-6C45-411B-92BE-3CC31331019F}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "01.HelloWorld", "01.HelloWorld\HelloWorld_vc10.vcxproj", "{5AD4C95C-BA38-4692-BA4B-8C25A86208F9}" - ProjectSection(ProjectDependencies) = postProject - {E08E042A-6C45-411B-92BE-3CC31331019F} = {E08E042A-6C45-411B-92BE-3CC31331019F} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "02.Quake3Map", "02.Quake3Map\Quake3Map_vc10.vcxproj", "{D1A464A2-D479-458C-98A2-60965D823CD1}" - ProjectSection(ProjectDependencies) = postProject - {E08E042A-6C45-411B-92BE-3CC31331019F} = {E08E042A-6C45-411B-92BE-3CC31331019F} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "03.CustomSceneNode", "03.CustomSceneNode\CustomSceneNode_vc10.vcxproj", "{171CCDFA-C140-4956-8EB7-F0168F4521D3}" - ProjectSection(ProjectDependencies) = postProject - {E08E042A-6C45-411B-92BE-3CC31331019F} = {E08E042A-6C45-411B-92BE-3CC31331019F} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "04.Movement", "04.Movement\Movement_vc10.vcxproj", "{7BDBB7E8-E0C9-4A0D-83C1-D389D6140FEF}" - ProjectSection(ProjectDependencies) = postProject - {E08E042A-6C45-411B-92BE-3CC31331019F} = {E08E042A-6C45-411B-92BE-3CC31331019F} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "05.UserInterface", "05.UserInterface\UserInterface_vc10.vcxproj", "{622C9DD7-0391-49FF-AF53-24F9D5A8EC53}" - ProjectSection(ProjectDependencies) = postProject - {E08E042A-6C45-411B-92BE-3CC31331019F} = {E08E042A-6C45-411B-92BE-3CC31331019F} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "06.2DGraphics", "06.2DGraphics\2DGraphics_vc10.vcxproj", "{E71B6F18-10DC-4101-A541-F6D33F71B2BD}" - ProjectSection(ProjectDependencies) = postProject - {E08E042A-6C45-411B-92BE-3CC31331019F} = {E08E042A-6C45-411B-92BE-3CC31331019F} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "07.Collision", "07.Collision\Collision_vc10.vcxproj", "{3E30297B-5BE3-4A5C-B31E-08A28ADDB29E}" - ProjectSection(ProjectDependencies) = postProject - {E08E042A-6C45-411B-92BE-3CC31331019F} = {E08E042A-6C45-411B-92BE-3CC31331019F} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "08.SpecialFX", "08.SpecialFX\SpecialFX_vc10.vcxproj", "{C869BF55-B9D6-4980-BC92-60FA0CF8411A}" - ProjectSection(ProjectDependencies) = postProject - {E08E042A-6C45-411B-92BE-3CC31331019F} = {E08E042A-6C45-411B-92BE-3CC31331019F} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "09.Meshviewer", "09.Meshviewer\Meshviewer_vc10.vcxproj", "{2AE24484-22FC-481B-9A40-7CD0DA5C8E06}" - ProjectSection(ProjectDependencies) = postProject - {E08E042A-6C45-411B-92BE-3CC31331019F} = {E08E042A-6C45-411B-92BE-3CC31331019F} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "10.Shaders", "10.Shaders\Shaders_vc10.vcxproj", "{27158C82-CD15-4A9B-9848-35E7065B209F}" - ProjectSection(ProjectDependencies) = postProject - {E08E042A-6C45-411B-92BE-3CC31331019F} = {E08E042A-6C45-411B-92BE-3CC31331019F} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "11.PerPixelLighting", "11.PerPixelLighting\PerPixelLighting_vc10.vcxproj", "{C4B42409-542D-4EFC-9E6B-44713FD47A33}" - ProjectSection(ProjectDependencies) = postProject - {E08E042A-6C45-411B-92BE-3CC31331019F} = {E08E042A-6C45-411B-92BE-3CC31331019F} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "12.TerrainRendering", "12.TerrainRendering\TerrainRendering_vc10.vcxproj", "{3A5B74E5-6390-43B0-A459-2793B81FFD31}" - ProjectSection(ProjectDependencies) = postProject - {E08E042A-6C45-411B-92BE-3CC31331019F} = {E08E042A-6C45-411B-92BE-3CC31331019F} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "13.RenderToTexture", "13.RenderToTexture\RenderToTexture_vc10.vcxproj", "{0914E5C8-5352-467B-8421-C9EB35BD5596}" - ProjectSection(ProjectDependencies) = postProject - {E08E042A-6C45-411B-92BE-3CC31331019F} = {E08E042A-6C45-411B-92BE-3CC31331019F} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "14.Win32Window", "14.Win32Window\Win32Window_vc10.vcxproj", "{772FBE05-D05A-467B-9842-BEC409EEA8D0}" - ProjectSection(ProjectDependencies) = postProject - {E08E042A-6C45-411B-92BE-3CC31331019F} = {E08E042A-6C45-411B-92BE-3CC31331019F} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "15.LoadIrrFile", "15.LoadIrrFile\LoadIrrFile_vc10.vcxproj", "{78C9F424-523C-49AC-94B7-823AA4A26BF9}" - ProjectSection(ProjectDependencies) = postProject - {E08E042A-6C45-411B-92BE-3CC31331019F} = {E08E042A-6C45-411B-92BE-3CC31331019F} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "16.Quake3MapShader", "16.Quake3MapShader\Quake3MapShader_vc10.vcxproj", "{EB3B38EA-5CE7-4983-845B-880661E69D09}" - ProjectSection(ProjectDependencies) = postProject - {E08E042A-6C45-411B-92BE-3CC31331019F} = {E08E042A-6C45-411B-92BE-3CC31331019F} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "17.HelloWorld_Mobile", "17.HelloWorld_Mobile\17. HelloWorld for Windows Mobile on PC_vc10.vcxproj", "{2A29B6B1-AFC4-46C7-9944-7052AAE66F7B}" - ProjectSection(ProjectDependencies) = postProject - {E08E042A-6C45-411B-92BE-3CC31331019F} = {E08E042A-6C45-411B-92BE-3CC31331019F} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "18.SplitScreen", "18.SplitScreen\SplitScreen_vc10.vcxproj", "{1AB9413E-4F53-42A3-8CB2-CB4BE22336D0}" - ProjectSection(ProjectDependencies) = postProject - {E08E042A-6C45-411B-92BE-3CC31331019F} = {E08E042A-6C45-411B-92BE-3CC31331019F} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "19.MouseAndJoystick", "19.MouseAndJoystick\MouseAndJoystick_vc10.vcxproj", "{FE853A36-E0D1-4AC5-A792-B643E70D2953}" - ProjectSection(ProjectDependencies) = postProject - {E08E042A-6C45-411B-92BE-3CC31331019F} = {E08E042A-6C45-411B-92BE-3CC31331019F} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "20.ManagedLights", "20.ManagedLights\ManagedLights_vc10.vcxproj", "{16007FE2-142B-47F8-93E1-519BA3F39E71}" - ProjectSection(ProjectDependencies) = postProject - {E08E042A-6C45-411B-92BE-3CC31331019F} = {E08E042A-6C45-411B-92BE-3CC31331019F} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "21.Quake3Explorer", "21.Quake3Explorer\Quake3Explorer_vc10.vcxproj", "{CDC4AAA9-72E1-4FFA-A04D-7EF59D8B97CD}" - ProjectSection(ProjectDependencies) = postProject - {E08E042A-6C45-411B-92BE-3CC31331019F} = {E08E042A-6C45-411B-92BE-3CC31331019F} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "22.MaterialViewer", "22.MaterialViewer\MaterialViewer_vc10.vcxproj", "{4E6C2F8D-BA92-4C5B-96FD-72D4FE8BD7FA}" - ProjectSection(ProjectDependencies) = postProject - {E08E042A-6C45-411B-92BE-3CC31331019F} = {E08E042A-6C45-411B-92BE-3CC31331019F} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "23.SMeshHandling", "23.SMeshHandling\SMeshHandling_vc10.vcxproj", "{6AEC2AA2-C9FF-4B7D-B07A-94A9D34B41D7}" - ProjectSection(ProjectDependencies) = postProject - {E08E042A-6C45-411B-92BE-3CC31331019F} = {E08E042A-6C45-411B-92BE-3CC31331019F} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "24.CursorControl", "24.CursorControl\CursorControl_vc10.vcxproj", "{02B67A37-50E1-49DB-BECF-905BC029C2FE}" - ProjectSection(ProjectDependencies) = postProject - {E08E042A-6C45-411B-92BE-3CC31331019F} = {E08E042A-6C45-411B-92BE-3CC31331019F} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Demo", "Demo\Demo_vc10.vcxproj", "{6F076455-D955-45D4-9C68-4AD4E45F2D47}" - ProjectSection(ProjectDependencies) = postProject - {E08E042A-6C45-411B-92BE-3CC31331019F} = {E08E042A-6C45-411B-92BE-3CC31331019F} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "GUIEditor", "..\tools\GUIEditor\GUI Editor_vc10.vcxproj", "{853A396E-C031-4C26-A716-5B4E176BE11D}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "FontTool", "..\tools\IrrFontTool\newFontTool\irrFontTool_vc10.vcxproj", "{4D53E40F-37E3-42B1-8848-F4C6F8313A17}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "MeshConverter", "..\tools\MeshConverter\MeshConverter_vc10.vcxproj", "{E72B637E-4AA6-46F3-885F-AC67B4B470ED}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "26.OcclusionQuery", "26.OcclusionQuery\OcclusionQuery_vc10.vcxproj", "{5CE0E2E7-879D-4152-B61D-24E7D0707B45}" - ProjectSection(ProjectDependencies) = postProject - {E08E042A-6C45-411B-92BE-3CC31331019F} = {E08E042A-6C45-411B-92BE-3CC31331019F} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "25.XmlHandling", "25.XmlHandling\XmlHandling_vc10.vcxproj", "{8FDA260E-EF27-4F8C-8720-7AF707DD0D9E}" - ProjectSection(ProjectDependencies) = postProject - {E08E042A-6C45-411B-92BE-3CC31331019F} = {E08E042A-6C45-411B-92BE-3CC31331019F} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "30.Profiling", "30.Profiling\Profiling_vc10.vcxproj", "{65D9DE2E-B73E-4ADF-96D1-BF4A8B7F4F97}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "27.PostProcessing", "27.PostProcessing\PostProcessing_vc10.vcxproj", "{2B885150-210F-4CA7-957E-2C3D75974308}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "28.CubeMapping", "28.CubeMapping\CubeMapping_vc10.vcxproj", "{9A2CE404-75E2-4195-837D-BED5B0FF3FA7}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Win32 = Debug|Win32 - Debug|x64 = Debug|x64 - Release|Win32 = Release|Win32 - Release|x64 = Release|x64 - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {E08E042A-6C45-411B-92BE-3CC31331019F}.Debug|Win32.ActiveCfg = Debug|Win32 - {E08E042A-6C45-411B-92BE-3CC31331019F}.Debug|Win32.Build.0 = Debug|Win32 - {E08E042A-6C45-411B-92BE-3CC31331019F}.Debug|x64.ActiveCfg = Debug|x64 - {E08E042A-6C45-411B-92BE-3CC31331019F}.Debug|x64.Build.0 = Debug|x64 - {E08E042A-6C45-411B-92BE-3CC31331019F}.Release|Win32.ActiveCfg = Release|Win32 - {E08E042A-6C45-411B-92BE-3CC31331019F}.Release|Win32.Build.0 = Release|Win32 - {E08E042A-6C45-411B-92BE-3CC31331019F}.Release|x64.ActiveCfg = Release|x64 - {E08E042A-6C45-411B-92BE-3CC31331019F}.Release|x64.Build.0 = Release|x64 - {5AD4C95C-BA38-4692-BA4B-8C25A86208F9}.Debug|Win32.ActiveCfg = Debug|Win32 - {5AD4C95C-BA38-4692-BA4B-8C25A86208F9}.Debug|Win32.Build.0 = Debug|Win32 - {5AD4C95C-BA38-4692-BA4B-8C25A86208F9}.Debug|x64.ActiveCfg = Debug|x64 - {5AD4C95C-BA38-4692-BA4B-8C25A86208F9}.Debug|x64.Build.0 = Debug|x64 - {5AD4C95C-BA38-4692-BA4B-8C25A86208F9}.Release|Win32.ActiveCfg = Release|Win32 - {5AD4C95C-BA38-4692-BA4B-8C25A86208F9}.Release|Win32.Build.0 = Release|Win32 - {5AD4C95C-BA38-4692-BA4B-8C25A86208F9}.Release|x64.ActiveCfg = Release|x64 - {5AD4C95C-BA38-4692-BA4B-8C25A86208F9}.Release|x64.Build.0 = Release|x64 - {D1A464A2-D479-458C-98A2-60965D823CD1}.Debug|Win32.ActiveCfg = Debug|Win32 - {D1A464A2-D479-458C-98A2-60965D823CD1}.Debug|Win32.Build.0 = Debug|Win32 - {D1A464A2-D479-458C-98A2-60965D823CD1}.Debug|x64.ActiveCfg = Debug|x64 - {D1A464A2-D479-458C-98A2-60965D823CD1}.Debug|x64.Build.0 = Debug|x64 - {D1A464A2-D479-458C-98A2-60965D823CD1}.Release|Win32.ActiveCfg = Release|Win32 - {D1A464A2-D479-458C-98A2-60965D823CD1}.Release|Win32.Build.0 = Release|Win32 - {D1A464A2-D479-458C-98A2-60965D823CD1}.Release|x64.ActiveCfg = Release|x64 - {D1A464A2-D479-458C-98A2-60965D823CD1}.Release|x64.Build.0 = Release|x64 - {171CCDFA-C140-4956-8EB7-F0168F4521D3}.Debug|Win32.ActiveCfg = Debug|Win32 - {171CCDFA-C140-4956-8EB7-F0168F4521D3}.Debug|Win32.Build.0 = Debug|Win32 - {171CCDFA-C140-4956-8EB7-F0168F4521D3}.Debug|x64.ActiveCfg = Debug|x64 - {171CCDFA-C140-4956-8EB7-F0168F4521D3}.Debug|x64.Build.0 = Debug|x64 - {171CCDFA-C140-4956-8EB7-F0168F4521D3}.Release|Win32.ActiveCfg = Release|Win32 - {171CCDFA-C140-4956-8EB7-F0168F4521D3}.Release|Win32.Build.0 = Release|Win32 - {171CCDFA-C140-4956-8EB7-F0168F4521D3}.Release|x64.ActiveCfg = Release|x64 - {171CCDFA-C140-4956-8EB7-F0168F4521D3}.Release|x64.Build.0 = Release|x64 - {7BDBB7E8-E0C9-4A0D-83C1-D389D6140FEF}.Debug|Win32.ActiveCfg = Debug|Win32 - {7BDBB7E8-E0C9-4A0D-83C1-D389D6140FEF}.Debug|Win32.Build.0 = Debug|Win32 - {7BDBB7E8-E0C9-4A0D-83C1-D389D6140FEF}.Debug|x64.ActiveCfg = Debug|x64 - {7BDBB7E8-E0C9-4A0D-83C1-D389D6140FEF}.Debug|x64.Build.0 = Debug|x64 - {7BDBB7E8-E0C9-4A0D-83C1-D389D6140FEF}.Release|Win32.ActiveCfg = Release|Win32 - {7BDBB7E8-E0C9-4A0D-83C1-D389D6140FEF}.Release|Win32.Build.0 = Release|Win32 - {7BDBB7E8-E0C9-4A0D-83C1-D389D6140FEF}.Release|x64.ActiveCfg = Release|x64 - {7BDBB7E8-E0C9-4A0D-83C1-D389D6140FEF}.Release|x64.Build.0 = Release|x64 - {622C9DD7-0391-49FF-AF53-24F9D5A8EC53}.Debug|Win32.ActiveCfg = Debug|Win32 - {622C9DD7-0391-49FF-AF53-24F9D5A8EC53}.Debug|Win32.Build.0 = Debug|Win32 - {622C9DD7-0391-49FF-AF53-24F9D5A8EC53}.Debug|x64.ActiveCfg = Debug|x64 - {622C9DD7-0391-49FF-AF53-24F9D5A8EC53}.Debug|x64.Build.0 = Debug|x64 - {622C9DD7-0391-49FF-AF53-24F9D5A8EC53}.Release|Win32.ActiveCfg = Release|Win32 - {622C9DD7-0391-49FF-AF53-24F9D5A8EC53}.Release|Win32.Build.0 = Release|Win32 - {622C9DD7-0391-49FF-AF53-24F9D5A8EC53}.Release|x64.ActiveCfg = Release|x64 - {622C9DD7-0391-49FF-AF53-24F9D5A8EC53}.Release|x64.Build.0 = Release|x64 - {E71B6F18-10DC-4101-A541-F6D33F71B2BD}.Debug|Win32.ActiveCfg = Debug|Win32 - {E71B6F18-10DC-4101-A541-F6D33F71B2BD}.Debug|Win32.Build.0 = Debug|Win32 - {E71B6F18-10DC-4101-A541-F6D33F71B2BD}.Debug|x64.ActiveCfg = Debug|x64 - {E71B6F18-10DC-4101-A541-F6D33F71B2BD}.Debug|x64.Build.0 = Debug|x64 - {E71B6F18-10DC-4101-A541-F6D33F71B2BD}.Release|Win32.ActiveCfg = Release|Win32 - {E71B6F18-10DC-4101-A541-F6D33F71B2BD}.Release|Win32.Build.0 = Release|Win32 - {E71B6F18-10DC-4101-A541-F6D33F71B2BD}.Release|x64.ActiveCfg = Release|x64 - {E71B6F18-10DC-4101-A541-F6D33F71B2BD}.Release|x64.Build.0 = Release|x64 - {3E30297B-5BE3-4A5C-B31E-08A28ADDB29E}.Debug|Win32.ActiveCfg = Debug|Win32 - {3E30297B-5BE3-4A5C-B31E-08A28ADDB29E}.Debug|Win32.Build.0 = Debug|Win32 - {3E30297B-5BE3-4A5C-B31E-08A28ADDB29E}.Debug|x64.ActiveCfg = Debug|x64 - {3E30297B-5BE3-4A5C-B31E-08A28ADDB29E}.Debug|x64.Build.0 = Debug|x64 - {3E30297B-5BE3-4A5C-B31E-08A28ADDB29E}.Release|Win32.ActiveCfg = Release|Win32 - {3E30297B-5BE3-4A5C-B31E-08A28ADDB29E}.Release|Win32.Build.0 = Release|Win32 - {3E30297B-5BE3-4A5C-B31E-08A28ADDB29E}.Release|x64.ActiveCfg = Release|x64 - {3E30297B-5BE3-4A5C-B31E-08A28ADDB29E}.Release|x64.Build.0 = Release|x64 - {C869BF55-B9D6-4980-BC92-60FA0CF8411A}.Debug|Win32.ActiveCfg = Debug|Win32 - {C869BF55-B9D6-4980-BC92-60FA0CF8411A}.Debug|Win32.Build.0 = Debug|Win32 - {C869BF55-B9D6-4980-BC92-60FA0CF8411A}.Debug|x64.ActiveCfg = Debug|x64 - {C869BF55-B9D6-4980-BC92-60FA0CF8411A}.Debug|x64.Build.0 = Debug|x64 - {C869BF55-B9D6-4980-BC92-60FA0CF8411A}.Release|Win32.ActiveCfg = Release|Win32 - {C869BF55-B9D6-4980-BC92-60FA0CF8411A}.Release|Win32.Build.0 = Release|Win32 - {C869BF55-B9D6-4980-BC92-60FA0CF8411A}.Release|x64.ActiveCfg = Release|x64 - {C869BF55-B9D6-4980-BC92-60FA0CF8411A}.Release|x64.Build.0 = Release|x64 - {2AE24484-22FC-481B-9A40-7CD0DA5C8E06}.Debug|Win32.ActiveCfg = Debug|Win32 - {2AE24484-22FC-481B-9A40-7CD0DA5C8E06}.Debug|Win32.Build.0 = Debug|Win32 - {2AE24484-22FC-481B-9A40-7CD0DA5C8E06}.Debug|x64.ActiveCfg = Debug|x64 - {2AE24484-22FC-481B-9A40-7CD0DA5C8E06}.Debug|x64.Build.0 = Debug|x64 - {2AE24484-22FC-481B-9A40-7CD0DA5C8E06}.Release|Win32.ActiveCfg = Release|Win32 - {2AE24484-22FC-481B-9A40-7CD0DA5C8E06}.Release|Win32.Build.0 = Release|Win32 - {2AE24484-22FC-481B-9A40-7CD0DA5C8E06}.Release|x64.ActiveCfg = Release|x64 - {2AE24484-22FC-481B-9A40-7CD0DA5C8E06}.Release|x64.Build.0 = Release|x64 - {27158C82-CD15-4A9B-9848-35E7065B209F}.Debug|Win32.ActiveCfg = Debug|Win32 - {27158C82-CD15-4A9B-9848-35E7065B209F}.Debug|Win32.Build.0 = Debug|Win32 - {27158C82-CD15-4A9B-9848-35E7065B209F}.Debug|x64.ActiveCfg = Debug|x64 - {27158C82-CD15-4A9B-9848-35E7065B209F}.Debug|x64.Build.0 = Debug|x64 - {27158C82-CD15-4A9B-9848-35E7065B209F}.Release|Win32.ActiveCfg = Release|Win32 - {27158C82-CD15-4A9B-9848-35E7065B209F}.Release|Win32.Build.0 = Release|Win32 - {27158C82-CD15-4A9B-9848-35E7065B209F}.Release|x64.ActiveCfg = Release|x64 - {27158C82-CD15-4A9B-9848-35E7065B209F}.Release|x64.Build.0 = Release|x64 - {C4B42409-542D-4EFC-9E6B-44713FD47A33}.Debug|Win32.ActiveCfg = Debug|Win32 - {C4B42409-542D-4EFC-9E6B-44713FD47A33}.Debug|Win32.Build.0 = Debug|Win32 - {C4B42409-542D-4EFC-9E6B-44713FD47A33}.Debug|x64.ActiveCfg = Debug|x64 - {C4B42409-542D-4EFC-9E6B-44713FD47A33}.Debug|x64.Build.0 = Debug|x64 - {C4B42409-542D-4EFC-9E6B-44713FD47A33}.Release|Win32.ActiveCfg = Release|Win32 - {C4B42409-542D-4EFC-9E6B-44713FD47A33}.Release|Win32.Build.0 = Release|Win32 - {C4B42409-542D-4EFC-9E6B-44713FD47A33}.Release|x64.ActiveCfg = Release|x64 - {C4B42409-542D-4EFC-9E6B-44713FD47A33}.Release|x64.Build.0 = Release|x64 - {3A5B74E5-6390-43B0-A459-2793B81FFD31}.Debug|Win32.ActiveCfg = Debug|Win32 - {3A5B74E5-6390-43B0-A459-2793B81FFD31}.Debug|Win32.Build.0 = Debug|Win32 - {3A5B74E5-6390-43B0-A459-2793B81FFD31}.Debug|x64.ActiveCfg = Debug|x64 - {3A5B74E5-6390-43B0-A459-2793B81FFD31}.Debug|x64.Build.0 = Debug|x64 - {3A5B74E5-6390-43B0-A459-2793B81FFD31}.Release|Win32.ActiveCfg = Release|Win32 - {3A5B74E5-6390-43B0-A459-2793B81FFD31}.Release|Win32.Build.0 = Release|Win32 - {3A5B74E5-6390-43B0-A459-2793B81FFD31}.Release|x64.ActiveCfg = Release|x64 - {3A5B74E5-6390-43B0-A459-2793B81FFD31}.Release|x64.Build.0 = Release|x64 - {0914E5C8-5352-467B-8421-C9EB35BD5596}.Debug|Win32.ActiveCfg = Debug|Win32 - {0914E5C8-5352-467B-8421-C9EB35BD5596}.Debug|Win32.Build.0 = Debug|Win32 - {0914E5C8-5352-467B-8421-C9EB35BD5596}.Debug|x64.ActiveCfg = Debug|x64 - {0914E5C8-5352-467B-8421-C9EB35BD5596}.Debug|x64.Build.0 = Debug|x64 - {0914E5C8-5352-467B-8421-C9EB35BD5596}.Release|Win32.ActiveCfg = Release|Win32 - {0914E5C8-5352-467B-8421-C9EB35BD5596}.Release|Win32.Build.0 = Release|Win32 - {0914E5C8-5352-467B-8421-C9EB35BD5596}.Release|x64.ActiveCfg = Release|x64 - {0914E5C8-5352-467B-8421-C9EB35BD5596}.Release|x64.Build.0 = Release|x64 - {772FBE05-D05A-467B-9842-BEC409EEA8D0}.Debug|Win32.ActiveCfg = Debug|Win32 - {772FBE05-D05A-467B-9842-BEC409EEA8D0}.Debug|Win32.Build.0 = Debug|Win32 - {772FBE05-D05A-467B-9842-BEC409EEA8D0}.Debug|x64.ActiveCfg = Debug|x64 - {772FBE05-D05A-467B-9842-BEC409EEA8D0}.Debug|x64.Build.0 = Debug|x64 - {772FBE05-D05A-467B-9842-BEC409EEA8D0}.Release|Win32.ActiveCfg = Release|Win32 - {772FBE05-D05A-467B-9842-BEC409EEA8D0}.Release|Win32.Build.0 = Release|Win32 - {772FBE05-D05A-467B-9842-BEC409EEA8D0}.Release|x64.ActiveCfg = Release|x64 - {772FBE05-D05A-467B-9842-BEC409EEA8D0}.Release|x64.Build.0 = Release|x64 - {78C9F424-523C-49AC-94B7-823AA4A26BF9}.Debug|Win32.ActiveCfg = Debug|Win32 - {78C9F424-523C-49AC-94B7-823AA4A26BF9}.Debug|Win32.Build.0 = Debug|Win32 - {78C9F424-523C-49AC-94B7-823AA4A26BF9}.Debug|x64.ActiveCfg = Debug|x64 - {78C9F424-523C-49AC-94B7-823AA4A26BF9}.Debug|x64.Build.0 = Debug|x64 - {78C9F424-523C-49AC-94B7-823AA4A26BF9}.Release|Win32.ActiveCfg = Release|Win32 - {78C9F424-523C-49AC-94B7-823AA4A26BF9}.Release|Win32.Build.0 = Release|Win32 - {78C9F424-523C-49AC-94B7-823AA4A26BF9}.Release|x64.ActiveCfg = Release|x64 - {78C9F424-523C-49AC-94B7-823AA4A26BF9}.Release|x64.Build.0 = Release|x64 - {EB3B38EA-5CE7-4983-845B-880661E69D09}.Debug|Win32.ActiveCfg = Debug|Win32 - {EB3B38EA-5CE7-4983-845B-880661E69D09}.Debug|Win32.Build.0 = Debug|Win32 - {EB3B38EA-5CE7-4983-845B-880661E69D09}.Debug|x64.ActiveCfg = Debug|x64 - {EB3B38EA-5CE7-4983-845B-880661E69D09}.Debug|x64.Build.0 = Debug|x64 - {EB3B38EA-5CE7-4983-845B-880661E69D09}.Release|Win32.ActiveCfg = Release|Win32 - {EB3B38EA-5CE7-4983-845B-880661E69D09}.Release|Win32.Build.0 = Release|Win32 - {EB3B38EA-5CE7-4983-845B-880661E69D09}.Release|x64.ActiveCfg = Release|x64 - {EB3B38EA-5CE7-4983-845B-880661E69D09}.Release|x64.Build.0 = Release|x64 - {2A29B6B1-AFC4-46C7-9944-7052AAE66F7B}.Debug|Win32.ActiveCfg = Debug|Win32 - {2A29B6B1-AFC4-46C7-9944-7052AAE66F7B}.Debug|Win32.Build.0 = Debug|Win32 - {2A29B6B1-AFC4-46C7-9944-7052AAE66F7B}.Debug|x64.ActiveCfg = Debug|x64 - {2A29B6B1-AFC4-46C7-9944-7052AAE66F7B}.Debug|x64.Build.0 = Debug|x64 - {2A29B6B1-AFC4-46C7-9944-7052AAE66F7B}.Release|Win32.ActiveCfg = Release|Win32 - {2A29B6B1-AFC4-46C7-9944-7052AAE66F7B}.Release|Win32.Build.0 = Release|Win32 - {2A29B6B1-AFC4-46C7-9944-7052AAE66F7B}.Release|x64.ActiveCfg = Release|x64 - {2A29B6B1-AFC4-46C7-9944-7052AAE66F7B}.Release|x64.Build.0 = Release|x64 - {1AB9413E-4F53-42A3-8CB2-CB4BE22336D0}.Debug|Win32.ActiveCfg = Debug|Win32 - {1AB9413E-4F53-42A3-8CB2-CB4BE22336D0}.Debug|Win32.Build.0 = Debug|Win32 - {1AB9413E-4F53-42A3-8CB2-CB4BE22336D0}.Debug|x64.ActiveCfg = Debug|x64 - {1AB9413E-4F53-42A3-8CB2-CB4BE22336D0}.Debug|x64.Build.0 = Debug|x64 - {1AB9413E-4F53-42A3-8CB2-CB4BE22336D0}.Release|Win32.ActiveCfg = Release|Win32 - {1AB9413E-4F53-42A3-8CB2-CB4BE22336D0}.Release|Win32.Build.0 = Release|Win32 - {1AB9413E-4F53-42A3-8CB2-CB4BE22336D0}.Release|x64.ActiveCfg = Release|x64 - {1AB9413E-4F53-42A3-8CB2-CB4BE22336D0}.Release|x64.Build.0 = Release|x64 - {FE853A36-E0D1-4AC5-A792-B643E70D2953}.Debug|Win32.ActiveCfg = Debug|Win32 - {FE853A36-E0D1-4AC5-A792-B643E70D2953}.Debug|Win32.Build.0 = Debug|Win32 - {FE853A36-E0D1-4AC5-A792-B643E70D2953}.Debug|x64.ActiveCfg = Debug|x64 - {FE853A36-E0D1-4AC5-A792-B643E70D2953}.Debug|x64.Build.0 = Debug|x64 - {FE853A36-E0D1-4AC5-A792-B643E70D2953}.Release|Win32.ActiveCfg = Release|Win32 - {FE853A36-E0D1-4AC5-A792-B643E70D2953}.Release|Win32.Build.0 = Release|Win32 - {FE853A36-E0D1-4AC5-A792-B643E70D2953}.Release|x64.ActiveCfg = Release|x64 - {FE853A36-E0D1-4AC5-A792-B643E70D2953}.Release|x64.Build.0 = Release|x64 - {16007FE2-142B-47F8-93E1-519BA3F39E71}.Debug|Win32.ActiveCfg = Debug|Win32 - {16007FE2-142B-47F8-93E1-519BA3F39E71}.Debug|Win32.Build.0 = Debug|Win32 - {16007FE2-142B-47F8-93E1-519BA3F39E71}.Debug|x64.ActiveCfg = Debug|x64 - {16007FE2-142B-47F8-93E1-519BA3F39E71}.Debug|x64.Build.0 = Debug|x64 - {16007FE2-142B-47F8-93E1-519BA3F39E71}.Release|Win32.ActiveCfg = Release|Win32 - {16007FE2-142B-47F8-93E1-519BA3F39E71}.Release|Win32.Build.0 = Release|Win32 - {16007FE2-142B-47F8-93E1-519BA3F39E71}.Release|x64.ActiveCfg = Release|x64 - {16007FE2-142B-47F8-93E1-519BA3F39E71}.Release|x64.Build.0 = Release|x64 - {CDC4AAA9-72E1-4FFA-A04D-7EF59D8B97CD}.Debug|Win32.ActiveCfg = Debug|Win32 - {CDC4AAA9-72E1-4FFA-A04D-7EF59D8B97CD}.Debug|Win32.Build.0 = Debug|Win32 - {CDC4AAA9-72E1-4FFA-A04D-7EF59D8B97CD}.Debug|x64.ActiveCfg = Debug|x64 - {CDC4AAA9-72E1-4FFA-A04D-7EF59D8B97CD}.Debug|x64.Build.0 = Debug|x64 - {CDC4AAA9-72E1-4FFA-A04D-7EF59D8B97CD}.Release|Win32.ActiveCfg = Release|Win32 - {CDC4AAA9-72E1-4FFA-A04D-7EF59D8B97CD}.Release|Win32.Build.0 = Release|Win32 - {CDC4AAA9-72E1-4FFA-A04D-7EF59D8B97CD}.Release|x64.ActiveCfg = Release|x64 - {CDC4AAA9-72E1-4FFA-A04D-7EF59D8B97CD}.Release|x64.Build.0 = Release|x64 - {4E6C2F8D-BA92-4C5B-96FD-72D4FE8BD7FA}.Debug|Win32.ActiveCfg = Debug|Win32 - {4E6C2F8D-BA92-4C5B-96FD-72D4FE8BD7FA}.Debug|Win32.Build.0 = Debug|Win32 - {4E6C2F8D-BA92-4C5B-96FD-72D4FE8BD7FA}.Debug|x64.ActiveCfg = Debug|x64 - {4E6C2F8D-BA92-4C5B-96FD-72D4FE8BD7FA}.Debug|x64.Build.0 = Debug|x64 - {4E6C2F8D-BA92-4C5B-96FD-72D4FE8BD7FA}.Release|Win32.ActiveCfg = Release|Win32 - {4E6C2F8D-BA92-4C5B-96FD-72D4FE8BD7FA}.Release|Win32.Build.0 = Release|Win32 - {4E6C2F8D-BA92-4C5B-96FD-72D4FE8BD7FA}.Release|x64.ActiveCfg = Release|x64 - {4E6C2F8D-BA92-4C5B-96FD-72D4FE8BD7FA}.Release|x64.Build.0 = Release|x64 - {6AEC2AA2-C9FF-4B7D-B07A-94A9D34B41D7}.Debug|Win32.ActiveCfg = Debug|Win32 - {6AEC2AA2-C9FF-4B7D-B07A-94A9D34B41D7}.Debug|Win32.Build.0 = Debug|Win32 - {6AEC2AA2-C9FF-4B7D-B07A-94A9D34B41D7}.Debug|x64.ActiveCfg = Debug|x64 - {6AEC2AA2-C9FF-4B7D-B07A-94A9D34B41D7}.Debug|x64.Build.0 = Debug|x64 - {6AEC2AA2-C9FF-4B7D-B07A-94A9D34B41D7}.Release|Win32.ActiveCfg = Release|Win32 - {6AEC2AA2-C9FF-4B7D-B07A-94A9D34B41D7}.Release|Win32.Build.0 = Release|Win32 - {6AEC2AA2-C9FF-4B7D-B07A-94A9D34B41D7}.Release|x64.ActiveCfg = Release|x64 - {6AEC2AA2-C9FF-4B7D-B07A-94A9D34B41D7}.Release|x64.Build.0 = Release|x64 - {02B67A37-50E1-49DB-BECF-905BC029C2FE}.Debug|Win32.ActiveCfg = Debug|Win32 - {02B67A37-50E1-49DB-BECF-905BC029C2FE}.Debug|Win32.Build.0 = Debug|Win32 - {02B67A37-50E1-49DB-BECF-905BC029C2FE}.Debug|x64.ActiveCfg = Debug|x64 - {02B67A37-50E1-49DB-BECF-905BC029C2FE}.Debug|x64.Build.0 = Debug|x64 - {02B67A37-50E1-49DB-BECF-905BC029C2FE}.Release|Win32.ActiveCfg = Release|Win32 - {02B67A37-50E1-49DB-BECF-905BC029C2FE}.Release|Win32.Build.0 = Release|Win32 - {02B67A37-50E1-49DB-BECF-905BC029C2FE}.Release|x64.ActiveCfg = Release|x64 - {02B67A37-50E1-49DB-BECF-905BC029C2FE}.Release|x64.Build.0 = Release|x64 - {6F076455-D955-45D4-9C68-4AD4E45F2D47}.Debug|Win32.ActiveCfg = Debug|Win32 - {6F076455-D955-45D4-9C68-4AD4E45F2D47}.Debug|Win32.Build.0 = Debug|Win32 - {6F076455-D955-45D4-9C68-4AD4E45F2D47}.Debug|x64.ActiveCfg = Debug|x64 - {6F076455-D955-45D4-9C68-4AD4E45F2D47}.Debug|x64.Build.0 = Debug|x64 - {6F076455-D955-45D4-9C68-4AD4E45F2D47}.Release|Win32.ActiveCfg = Release|Win32 - {6F076455-D955-45D4-9C68-4AD4E45F2D47}.Release|Win32.Build.0 = Release|Win32 - {6F076455-D955-45D4-9C68-4AD4E45F2D47}.Release|x64.ActiveCfg = Release|x64 - {6F076455-D955-45D4-9C68-4AD4E45F2D47}.Release|x64.Build.0 = Release|x64 - {853A396E-C031-4C26-A716-5B4E176BE11D}.Debug|Win32.ActiveCfg = Debug|Win32 - {853A396E-C031-4C26-A716-5B4E176BE11D}.Debug|Win32.Build.0 = Debug|Win32 - {853A396E-C031-4C26-A716-5B4E176BE11D}.Debug|x64.ActiveCfg = Debug|x64 - {853A396E-C031-4C26-A716-5B4E176BE11D}.Debug|x64.Build.0 = Debug|x64 - {853A396E-C031-4C26-A716-5B4E176BE11D}.Release|Win32.ActiveCfg = Release|Win32 - {853A396E-C031-4C26-A716-5B4E176BE11D}.Release|Win32.Build.0 = Release|Win32 - {853A396E-C031-4C26-A716-5B4E176BE11D}.Release|x64.ActiveCfg = Release|x64 - {853A396E-C031-4C26-A716-5B4E176BE11D}.Release|x64.Build.0 = Release|x64 - {4D53E40F-37E3-42B1-8848-F4C6F8313A17}.Debug|Win32.ActiveCfg = Debug|Win32 - {4D53E40F-37E3-42B1-8848-F4C6F8313A17}.Debug|Win32.Build.0 = Debug|Win32 - {4D53E40F-37E3-42B1-8848-F4C6F8313A17}.Debug|x64.ActiveCfg = Debug|x64 - {4D53E40F-37E3-42B1-8848-F4C6F8313A17}.Debug|x64.Build.0 = Debug|x64 - {4D53E40F-37E3-42B1-8848-F4C6F8313A17}.Release|Win32.ActiveCfg = Release|Win32 - {4D53E40F-37E3-42B1-8848-F4C6F8313A17}.Release|Win32.Build.0 = Release|Win32 - {4D53E40F-37E3-42B1-8848-F4C6F8313A17}.Release|x64.ActiveCfg = Release|x64 - {4D53E40F-37E3-42B1-8848-F4C6F8313A17}.Release|x64.Build.0 = Release|x64 - {E72B637E-4AA6-46F3-885F-AC67B4B470ED}.Debug|Win32.ActiveCfg = Debug|Win32 - {E72B637E-4AA6-46F3-885F-AC67B4B470ED}.Debug|Win32.Build.0 = Debug|Win32 - {E72B637E-4AA6-46F3-885F-AC67B4B470ED}.Debug|x64.ActiveCfg = Debug|x64 - {E72B637E-4AA6-46F3-885F-AC67B4B470ED}.Debug|x64.Build.0 = Debug|x64 - {E72B637E-4AA6-46F3-885F-AC67B4B470ED}.Release|Win32.ActiveCfg = Release|Win32 - {E72B637E-4AA6-46F3-885F-AC67B4B470ED}.Release|Win32.Build.0 = Release|Win32 - {E72B637E-4AA6-46F3-885F-AC67B4B470ED}.Release|x64.ActiveCfg = Release|x64 - {E72B637E-4AA6-46F3-885F-AC67B4B470ED}.Release|x64.Build.0 = Release|x64 - {5CE0E2E7-879D-4152-B61D-24E7D0707B45}.Debug|Win32.ActiveCfg = Debug|Win32 - {5CE0E2E7-879D-4152-B61D-24E7D0707B45}.Debug|Win32.Build.0 = Debug|Win32 - {5CE0E2E7-879D-4152-B61D-24E7D0707B45}.Debug|x64.ActiveCfg = Debug|x64 - {5CE0E2E7-879D-4152-B61D-24E7D0707B45}.Debug|x64.Build.0 = Debug|x64 - {5CE0E2E7-879D-4152-B61D-24E7D0707B45}.Release|Win32.ActiveCfg = Release|Win32 - {5CE0E2E7-879D-4152-B61D-24E7D0707B45}.Release|Win32.Build.0 = Release|Win32 - {5CE0E2E7-879D-4152-B61D-24E7D0707B45}.Release|x64.ActiveCfg = Release|x64 - {5CE0E2E7-879D-4152-B61D-24E7D0707B45}.Release|x64.Build.0 = Release|x64 - {8FDA260E-EF27-4F8C-8720-7AF707DD0D9E}.Debug|Win32.ActiveCfg = Debug|Win32 - {8FDA260E-EF27-4F8C-8720-7AF707DD0D9E}.Debug|Win32.Build.0 = Debug|Win32 - {8FDA260E-EF27-4F8C-8720-7AF707DD0D9E}.Debug|x64.ActiveCfg = Debug|x64 - {8FDA260E-EF27-4F8C-8720-7AF707DD0D9E}.Debug|x64.Build.0 = Debug|x64 - {8FDA260E-EF27-4F8C-8720-7AF707DD0D9E}.Release|Win32.ActiveCfg = Release|Win32 - {8FDA260E-EF27-4F8C-8720-7AF707DD0D9E}.Release|Win32.Build.0 = Release|Win32 - {8FDA260E-EF27-4F8C-8720-7AF707DD0D9E}.Release|x64.ActiveCfg = Release|x64 - {8FDA260E-EF27-4F8C-8720-7AF707DD0D9E}.Release|x64.Build.0 = Release|x64 - {65D9DE2E-B73E-4ADF-96D1-BF4A8B7F4F97}.Debug|Win32.ActiveCfg = Debug|Win32 - {65D9DE2E-B73E-4ADF-96D1-BF4A8B7F4F97}.Debug|Win32.Build.0 = Debug|Win32 - {65D9DE2E-B73E-4ADF-96D1-BF4A8B7F4F97}.Debug|x64.ActiveCfg = Debug|x64 - {65D9DE2E-B73E-4ADF-96D1-BF4A8B7F4F97}.Debug|x64.Build.0 = Debug|x64 - {65D9DE2E-B73E-4ADF-96D1-BF4A8B7F4F97}.Release|Win32.ActiveCfg = Release|Win32 - {65D9DE2E-B73E-4ADF-96D1-BF4A8B7F4F97}.Release|Win32.Build.0 = Release|Win32 - {65D9DE2E-B73E-4ADF-96D1-BF4A8B7F4F97}.Release|x64.ActiveCfg = Release|x64 - {65D9DE2E-B73E-4ADF-96D1-BF4A8B7F4F97}.Release|x64.Build.0 = Release|x64 - {2B885150-210F-4CA7-957E-2C3D75974308}.Debug|Win32.ActiveCfg = Debug|Win32 - {2B885150-210F-4CA7-957E-2C3D75974308}.Debug|Win32.Build.0 = Debug|Win32 - {2B885150-210F-4CA7-957E-2C3D75974308}.Debug|x64.ActiveCfg = Debug|x64 - {2B885150-210F-4CA7-957E-2C3D75974308}.Debug|x64.Build.0 = Debug|x64 - {2B885150-210F-4CA7-957E-2C3D75974308}.Release|Win32.ActiveCfg = Release|Win32 - {2B885150-210F-4CA7-957E-2C3D75974308}.Release|Win32.Build.0 = Release|Win32 - {2B885150-210F-4CA7-957E-2C3D75974308}.Release|x64.ActiveCfg = Release|x64 - {2B885150-210F-4CA7-957E-2C3D75974308}.Release|x64.Build.0 = Release|x64 - {9A2CE404-75E2-4195-837D-BED5B0FF3FA7}.Debug|Win32.ActiveCfg = Debug|Win32 - {9A2CE404-75E2-4195-837D-BED5B0FF3FA7}.Debug|Win32.Build.0 = Debug|Win32 - {9A2CE404-75E2-4195-837D-BED5B0FF3FA7}.Debug|x64.ActiveCfg = Debug|x64 - {9A2CE404-75E2-4195-837D-BED5B0FF3FA7}.Debug|x64.Build.0 = Debug|x64 - {9A2CE404-75E2-4195-837D-BED5B0FF3FA7}.Release|Win32.ActiveCfg = Release|Win32 - {9A2CE404-75E2-4195-837D-BED5B0FF3FA7}.Release|Win32.Build.0 = Release|Win32 - {9A2CE404-75E2-4195-837D-BED5B0FF3FA7}.Release|x64.ActiveCfg = Release|x64 - {9A2CE404-75E2-4195-837D-BED5B0FF3FA7}.Release|x64.Build.0 = Release|x64 - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/examples/BuildAllExamples_vc11.sln b/examples/BuildAllExamples_vc11.sln deleted file mode 100644 index 6b5b06e2..00000000 --- a/examples/BuildAllExamples_vc11.sln +++ /dev/null @@ -1,440 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 2012 -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Irrlicht", "..\source\Irrlicht\Irrlicht11.0.vcxproj", "{E08E042A-6C45-411B-92BE-3CC31331019F}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "01.HelloWorld", "01.HelloWorld\HelloWorld_vc11.vcxproj", "{5AD4C95C-BA38-4692-BA4B-8C25A86208F9}" - ProjectSection(ProjectDependencies) = postProject - {E08E042A-6C45-411B-92BE-3CC31331019F} = {E08E042A-6C45-411B-92BE-3CC31331019F} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "02.Quake3Map", "02.Quake3Map\Quake3Map_vc11.vcxproj", "{D1A464A2-D479-458C-98A2-60965D823CD1}" - ProjectSection(ProjectDependencies) = postProject - {E08E042A-6C45-411B-92BE-3CC31331019F} = {E08E042A-6C45-411B-92BE-3CC31331019F} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "03.CustomSceneNode", "03.CustomSceneNode\CustomSceneNode_vc11.vcxproj", "{171CCDFA-C140-4956-8EB7-F0168F4521D3}" - ProjectSection(ProjectDependencies) = postProject - {E08E042A-6C45-411B-92BE-3CC31331019F} = {E08E042A-6C45-411B-92BE-3CC31331019F} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "04.Movement", "04.Movement\Movement_vc11.vcxproj", "{7BDBB7E8-E0C9-4A0D-83C1-D389D6140FEF}" - ProjectSection(ProjectDependencies) = postProject - {E08E042A-6C45-411B-92BE-3CC31331019F} = {E08E042A-6C45-411B-92BE-3CC31331019F} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "05.UserInterface", "05.UserInterface\UserInterface_vc11.vcxproj", "{622C9DD7-0391-49FF-AF53-24F9D5A8EC53}" - ProjectSection(ProjectDependencies) = postProject - {E08E042A-6C45-411B-92BE-3CC31331019F} = {E08E042A-6C45-411B-92BE-3CC31331019F} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "06.2DGraphics", "06.2DGraphics\2DGraphics_vc11.vcxproj", "{E71B6F18-10DC-4101-A541-F6D33F71B2BD}" - ProjectSection(ProjectDependencies) = postProject - {E08E042A-6C45-411B-92BE-3CC31331019F} = {E08E042A-6C45-411B-92BE-3CC31331019F} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "07.Collision", "07.Collision\Collision_vc11.vcxproj", "{3E30297B-5BE3-4A5C-B31E-08A28ADDB29E}" - ProjectSection(ProjectDependencies) = postProject - {E08E042A-6C45-411B-92BE-3CC31331019F} = {E08E042A-6C45-411B-92BE-3CC31331019F} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "08.SpecialFX", "08.SpecialFX\SpecialFX_vc11.vcxproj", "{C869BF55-B9D6-4980-BC92-60FA0CF8411A}" - ProjectSection(ProjectDependencies) = postProject - {E08E042A-6C45-411B-92BE-3CC31331019F} = {E08E042A-6C45-411B-92BE-3CC31331019F} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "09.Meshviewer", "09.Meshviewer\Meshviewer_vc11.vcxproj", "{2AE24484-22FC-481B-9A40-7CD0DA5C8E06}" - ProjectSection(ProjectDependencies) = postProject - {E08E042A-6C45-411B-92BE-3CC31331019F} = {E08E042A-6C45-411B-92BE-3CC31331019F} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "10.Shaders", "10.Shaders\Shaders_vc11.vcxproj", "{27158C82-CD15-4A9B-9848-35E7065B209F}" - ProjectSection(ProjectDependencies) = postProject - {E08E042A-6C45-411B-92BE-3CC31331019F} = {E08E042A-6C45-411B-92BE-3CC31331019F} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "11.PerPixelLighting", "11.PerPixelLighting\PerPixelLighting_vc11.vcxproj", "{C4B42409-542D-4EFC-9E6B-44713FD47A33}" - ProjectSection(ProjectDependencies) = postProject - {E08E042A-6C45-411B-92BE-3CC31331019F} = {E08E042A-6C45-411B-92BE-3CC31331019F} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "12.TerrainRendering", "12.TerrainRendering\TerrainRendering_vc11.vcxproj", "{3A5B74E5-6390-43B0-A459-2793B81FFD31}" - ProjectSection(ProjectDependencies) = postProject - {E08E042A-6C45-411B-92BE-3CC31331019F} = {E08E042A-6C45-411B-92BE-3CC31331019F} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "13.RenderToTexture", "13.RenderToTexture\RenderToTexture_vc11.vcxproj", "{0914E5C8-5352-467B-8421-C9EB35BD5596}" - ProjectSection(ProjectDependencies) = postProject - {E08E042A-6C45-411B-92BE-3CC31331019F} = {E08E042A-6C45-411B-92BE-3CC31331019F} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "14.Win32Window", "14.Win32Window\Win32Window_vc11.vcxproj", "{772FBE05-D05A-467B-9842-BEC409EEA8D0}" - ProjectSection(ProjectDependencies) = postProject - {E08E042A-6C45-411B-92BE-3CC31331019F} = {E08E042A-6C45-411B-92BE-3CC31331019F} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "15.LoadIrrFile", "15.LoadIrrFile\LoadIrrFile_vc11.vcxproj", "{78C9F424-523C-49AC-94B7-823AA4A26BF9}" - ProjectSection(ProjectDependencies) = postProject - {E08E042A-6C45-411B-92BE-3CC31331019F} = {E08E042A-6C45-411B-92BE-3CC31331019F} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "16.Quake3MapShader", "16.Quake3MapShader\Quake3MapShader_vc11.vcxproj", "{EB3B38EA-5CE7-4983-845B-880661E69D09}" - ProjectSection(ProjectDependencies) = postProject - {E08E042A-6C45-411B-92BE-3CC31331019F} = {E08E042A-6C45-411B-92BE-3CC31331019F} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "17.HelloWorld_Mobile", "17.HelloWorld_Mobile\17. HelloWorld for Windows Mobile on PC_vc11.vcxproj", "{2A29B6B1-AFC4-46C7-9944-7052AAE66F7B}" - ProjectSection(ProjectDependencies) = postProject - {E08E042A-6C45-411B-92BE-3CC31331019F} = {E08E042A-6C45-411B-92BE-3CC31331019F} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "18.SplitScreen", "18.SplitScreen\SplitScreen_vc11.vcxproj", "{1AB9413E-4F53-42A3-8CB2-CB4BE22336D0}" - ProjectSection(ProjectDependencies) = postProject - {E08E042A-6C45-411B-92BE-3CC31331019F} = {E08E042A-6C45-411B-92BE-3CC31331019F} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "19.MouseAndJoystick", "19.MouseAndJoystick\MouseAndJoystick_vc11.vcxproj", "{FE853A36-E0D1-4AC5-A792-B643E70D2953}" - ProjectSection(ProjectDependencies) = postProject - {E08E042A-6C45-411B-92BE-3CC31331019F} = {E08E042A-6C45-411B-92BE-3CC31331019F} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "20.ManagedLights", "20.ManagedLights\ManagedLights_vc11.vcxproj", "{16007FE2-142B-47F8-93E1-519BA3F39E71}" - ProjectSection(ProjectDependencies) = postProject - {E08E042A-6C45-411B-92BE-3CC31331019F} = {E08E042A-6C45-411B-92BE-3CC31331019F} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "21.Quake3Explorer", "21.Quake3Explorer\Quake3Explorer_vc11.vcxproj", "{CDC4AAA9-72E1-4FFA-A04D-7EF59D8B97CD}" - ProjectSection(ProjectDependencies) = postProject - {E08E042A-6C45-411B-92BE-3CC31331019F} = {E08E042A-6C45-411B-92BE-3CC31331019F} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "22.MaterialViewer", "22.MaterialViewer\MaterialViewer_vc11.vcxproj", "{4E6C2F8D-BA92-4C5B-96FD-72D4FE8BD7FA}" - ProjectSection(ProjectDependencies) = postProject - {E08E042A-6C45-411B-92BE-3CC31331019F} = {E08E042A-6C45-411B-92BE-3CC31331019F} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "23.SMeshHandling", "23.SMeshHandling\SMeshHandling_vc11.vcxproj", "{6AEC2AA2-C9FF-4B7D-B07A-94A9D34B41D7}" - ProjectSection(ProjectDependencies) = postProject - {E08E042A-6C45-411B-92BE-3CC31331019F} = {E08E042A-6C45-411B-92BE-3CC31331019F} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "24.CursorControl", "24.CursorControl\CursorControl_vc11.vcxproj", "{02B67A37-50E1-49DB-BECF-905BC029C2FE}" - ProjectSection(ProjectDependencies) = postProject - {E08E042A-6C45-411B-92BE-3CC31331019F} = {E08E042A-6C45-411B-92BE-3CC31331019F} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Demo", "Demo\Demo_vc11.vcxproj", "{6F076455-D955-45D4-9C68-4AD4E45F2D47}" - ProjectSection(ProjectDependencies) = postProject - {E08E042A-6C45-411B-92BE-3CC31331019F} = {E08E042A-6C45-411B-92BE-3CC31331019F} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "GUIEditor", "..\tools\GUIEditor\GUI Editor_vc11.vcxproj", "{853A396E-C031-4C26-A716-5B4E176BE11D}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "FontTool", "..\tools\IrrFontTool\newFontTool\irrFontTool_vc11.vcxproj", "{4D53E40F-37E3-42B1-8848-F4C6F8313A17}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "MeshConverter", "..\tools\MeshConverter\MeshConverter_vc11.vcxproj", "{E72B637E-4AA6-46F3-885F-AC67B4B470ED}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "26.OcclusionQuery", "26.OcclusionQuery\OcclusionQuery_vc11.vcxproj", "{5CE0E2E7-879D-4152-B61D-24E7D0707B45}" - ProjectSection(ProjectDependencies) = postProject - {E08E042A-6C45-411B-92BE-3CC31331019F} = {E08E042A-6C45-411B-92BE-3CC31331019F} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "25.XmlHandling", "25.XmlHandling\XmlHandling_vc11.vcxproj", "{8FDA260E-EF27-4F8C-8720-7AF707DD0D9E}" - ProjectSection(ProjectDependencies) = postProject - {E08E042A-6C45-411B-92BE-3CC31331019F} = {E08E042A-6C45-411B-92BE-3CC31331019F} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "30.Profiling", "30.Profiling\Profiling_vc11.vcxproj", "{65D9DE2E-B73E-4ADF-96D1-BF4A8B7F4F97}" - ProjectSection(ProjectDependencies) = postProject - {E08E042A-6C45-411B-92BE-3CC31331019F} = {E08E042A-6C45-411B-92BE-3CC31331019F} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "27.PostProcessing", "27.PostProcessing\PostProcessing_vc11.vcxproj", "{F864F96D-F6AE-43E2-9A12-218B1A081255}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "28.CubeMapping", "28.CubeMapping\CubeMapping_vc11.vcxproj", "{3DAD16DC-3D80-46EA-ADD8-C4418CEDE553}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Win32 = Debug|Win32 - Debug|x64 = Debug|x64 - Release|Win32 = Release|Win32 - Release|x64 = Release|x64 - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {E08E042A-6C45-411B-92BE-3CC31331019F}.Debug|Win32.ActiveCfg = Debug|Win32 - {E08E042A-6C45-411B-92BE-3CC31331019F}.Debug|Win32.Build.0 = Debug|Win32 - {E08E042A-6C45-411B-92BE-3CC31331019F}.Debug|x64.ActiveCfg = Debug|x64 - {E08E042A-6C45-411B-92BE-3CC31331019F}.Debug|x64.Build.0 = Debug|x64 - {E08E042A-6C45-411B-92BE-3CC31331019F}.Release|Win32.ActiveCfg = Release|Win32 - {E08E042A-6C45-411B-92BE-3CC31331019F}.Release|Win32.Build.0 = Release|Win32 - {E08E042A-6C45-411B-92BE-3CC31331019F}.Release|x64.ActiveCfg = Release|x64 - {E08E042A-6C45-411B-92BE-3CC31331019F}.Release|x64.Build.0 = Release|x64 - {5AD4C95C-BA38-4692-BA4B-8C25A86208F9}.Debug|Win32.ActiveCfg = Debug|Win32 - {5AD4C95C-BA38-4692-BA4B-8C25A86208F9}.Debug|Win32.Build.0 = Debug|Win32 - {5AD4C95C-BA38-4692-BA4B-8C25A86208F9}.Debug|x64.ActiveCfg = Debug|x64 - {5AD4C95C-BA38-4692-BA4B-8C25A86208F9}.Debug|x64.Build.0 = Debug|x64 - {5AD4C95C-BA38-4692-BA4B-8C25A86208F9}.Release|Win32.ActiveCfg = Release|Win32 - {5AD4C95C-BA38-4692-BA4B-8C25A86208F9}.Release|Win32.Build.0 = Release|Win32 - {5AD4C95C-BA38-4692-BA4B-8C25A86208F9}.Release|x64.ActiveCfg = Release|x64 - {5AD4C95C-BA38-4692-BA4B-8C25A86208F9}.Release|x64.Build.0 = Release|x64 - {D1A464A2-D479-458C-98A2-60965D823CD1}.Debug|Win32.ActiveCfg = Debug|Win32 - {D1A464A2-D479-458C-98A2-60965D823CD1}.Debug|Win32.Build.0 = Debug|Win32 - {D1A464A2-D479-458C-98A2-60965D823CD1}.Debug|x64.ActiveCfg = Debug|x64 - {D1A464A2-D479-458C-98A2-60965D823CD1}.Debug|x64.Build.0 = Debug|x64 - {D1A464A2-D479-458C-98A2-60965D823CD1}.Release|Win32.ActiveCfg = Release|Win32 - {D1A464A2-D479-458C-98A2-60965D823CD1}.Release|Win32.Build.0 = Release|Win32 - {D1A464A2-D479-458C-98A2-60965D823CD1}.Release|x64.ActiveCfg = Release|x64 - {D1A464A2-D479-458C-98A2-60965D823CD1}.Release|x64.Build.0 = Release|x64 - {171CCDFA-C140-4956-8EB7-F0168F4521D3}.Debug|Win32.ActiveCfg = Debug|Win32 - {171CCDFA-C140-4956-8EB7-F0168F4521D3}.Debug|Win32.Build.0 = Debug|Win32 - {171CCDFA-C140-4956-8EB7-F0168F4521D3}.Debug|x64.ActiveCfg = Debug|x64 - {171CCDFA-C140-4956-8EB7-F0168F4521D3}.Debug|x64.Build.0 = Debug|x64 - {171CCDFA-C140-4956-8EB7-F0168F4521D3}.Release|Win32.ActiveCfg = Release|Win32 - {171CCDFA-C140-4956-8EB7-F0168F4521D3}.Release|Win32.Build.0 = Release|Win32 - {171CCDFA-C140-4956-8EB7-F0168F4521D3}.Release|x64.ActiveCfg = Release|x64 - {171CCDFA-C140-4956-8EB7-F0168F4521D3}.Release|x64.Build.0 = Release|x64 - {7BDBB7E8-E0C9-4A0D-83C1-D389D6140FEF}.Debug|Win32.ActiveCfg = Debug|Win32 - {7BDBB7E8-E0C9-4A0D-83C1-D389D6140FEF}.Debug|Win32.Build.0 = Debug|Win32 - {7BDBB7E8-E0C9-4A0D-83C1-D389D6140FEF}.Debug|x64.ActiveCfg = Debug|x64 - {7BDBB7E8-E0C9-4A0D-83C1-D389D6140FEF}.Debug|x64.Build.0 = Debug|x64 - {7BDBB7E8-E0C9-4A0D-83C1-D389D6140FEF}.Release|Win32.ActiveCfg = Release|Win32 - {7BDBB7E8-E0C9-4A0D-83C1-D389D6140FEF}.Release|Win32.Build.0 = Release|Win32 - {7BDBB7E8-E0C9-4A0D-83C1-D389D6140FEF}.Release|x64.ActiveCfg = Release|x64 - {7BDBB7E8-E0C9-4A0D-83C1-D389D6140FEF}.Release|x64.Build.0 = Release|x64 - {622C9DD7-0391-49FF-AF53-24F9D5A8EC53}.Debug|Win32.ActiveCfg = Debug|Win32 - {622C9DD7-0391-49FF-AF53-24F9D5A8EC53}.Debug|Win32.Build.0 = Debug|Win32 - {622C9DD7-0391-49FF-AF53-24F9D5A8EC53}.Debug|x64.ActiveCfg = Debug|x64 - {622C9DD7-0391-49FF-AF53-24F9D5A8EC53}.Debug|x64.Build.0 = Debug|x64 - {622C9DD7-0391-49FF-AF53-24F9D5A8EC53}.Release|Win32.ActiveCfg = Release|Win32 - {622C9DD7-0391-49FF-AF53-24F9D5A8EC53}.Release|Win32.Build.0 = Release|Win32 - {622C9DD7-0391-49FF-AF53-24F9D5A8EC53}.Release|x64.ActiveCfg = Release|x64 - {622C9DD7-0391-49FF-AF53-24F9D5A8EC53}.Release|x64.Build.0 = Release|x64 - {E71B6F18-10DC-4101-A541-F6D33F71B2BD}.Debug|Win32.ActiveCfg = Debug|Win32 - {E71B6F18-10DC-4101-A541-F6D33F71B2BD}.Debug|Win32.Build.0 = Debug|Win32 - {E71B6F18-10DC-4101-A541-F6D33F71B2BD}.Debug|x64.ActiveCfg = Debug|x64 - {E71B6F18-10DC-4101-A541-F6D33F71B2BD}.Debug|x64.Build.0 = Debug|x64 - {E71B6F18-10DC-4101-A541-F6D33F71B2BD}.Release|Win32.ActiveCfg = Release|Win32 - {E71B6F18-10DC-4101-A541-F6D33F71B2BD}.Release|Win32.Build.0 = Release|Win32 - {E71B6F18-10DC-4101-A541-F6D33F71B2BD}.Release|x64.ActiveCfg = Release|x64 - {E71B6F18-10DC-4101-A541-F6D33F71B2BD}.Release|x64.Build.0 = Release|x64 - {3E30297B-5BE3-4A5C-B31E-08A28ADDB29E}.Debug|Win32.ActiveCfg = Debug|Win32 - {3E30297B-5BE3-4A5C-B31E-08A28ADDB29E}.Debug|Win32.Build.0 = Debug|Win32 - {3E30297B-5BE3-4A5C-B31E-08A28ADDB29E}.Debug|x64.ActiveCfg = Debug|x64 - {3E30297B-5BE3-4A5C-B31E-08A28ADDB29E}.Debug|x64.Build.0 = Debug|x64 - {3E30297B-5BE3-4A5C-B31E-08A28ADDB29E}.Release|Win32.ActiveCfg = Release|Win32 - {3E30297B-5BE3-4A5C-B31E-08A28ADDB29E}.Release|Win32.Build.0 = Release|Win32 - {3E30297B-5BE3-4A5C-B31E-08A28ADDB29E}.Release|x64.ActiveCfg = Release|x64 - {3E30297B-5BE3-4A5C-B31E-08A28ADDB29E}.Release|x64.Build.0 = Release|x64 - {C869BF55-B9D6-4980-BC92-60FA0CF8411A}.Debug|Win32.ActiveCfg = Debug|Win32 - {C869BF55-B9D6-4980-BC92-60FA0CF8411A}.Debug|Win32.Build.0 = Debug|Win32 - {C869BF55-B9D6-4980-BC92-60FA0CF8411A}.Debug|x64.ActiveCfg = Debug|x64 - {C869BF55-B9D6-4980-BC92-60FA0CF8411A}.Debug|x64.Build.0 = Debug|x64 - {C869BF55-B9D6-4980-BC92-60FA0CF8411A}.Release|Win32.ActiveCfg = Release|Win32 - {C869BF55-B9D6-4980-BC92-60FA0CF8411A}.Release|Win32.Build.0 = Release|Win32 - {C869BF55-B9D6-4980-BC92-60FA0CF8411A}.Release|x64.ActiveCfg = Release|x64 - {C869BF55-B9D6-4980-BC92-60FA0CF8411A}.Release|x64.Build.0 = Release|x64 - {2AE24484-22FC-481B-9A40-7CD0DA5C8E06}.Debug|Win32.ActiveCfg = Debug|Win32 - {2AE24484-22FC-481B-9A40-7CD0DA5C8E06}.Debug|Win32.Build.0 = Debug|Win32 - {2AE24484-22FC-481B-9A40-7CD0DA5C8E06}.Debug|x64.ActiveCfg = Debug|x64 - {2AE24484-22FC-481B-9A40-7CD0DA5C8E06}.Debug|x64.Build.0 = Debug|x64 - {2AE24484-22FC-481B-9A40-7CD0DA5C8E06}.Release|Win32.ActiveCfg = Release|Win32 - {2AE24484-22FC-481B-9A40-7CD0DA5C8E06}.Release|Win32.Build.0 = Release|Win32 - {2AE24484-22FC-481B-9A40-7CD0DA5C8E06}.Release|x64.ActiveCfg = Release|x64 - {2AE24484-22FC-481B-9A40-7CD0DA5C8E06}.Release|x64.Build.0 = Release|x64 - {27158C82-CD15-4A9B-9848-35E7065B209F}.Debug|Win32.ActiveCfg = Debug|Win32 - {27158C82-CD15-4A9B-9848-35E7065B209F}.Debug|Win32.Build.0 = Debug|Win32 - {27158C82-CD15-4A9B-9848-35E7065B209F}.Debug|x64.ActiveCfg = Debug|x64 - {27158C82-CD15-4A9B-9848-35E7065B209F}.Debug|x64.Build.0 = Debug|x64 - {27158C82-CD15-4A9B-9848-35E7065B209F}.Release|Win32.ActiveCfg = Release|Win32 - {27158C82-CD15-4A9B-9848-35E7065B209F}.Release|Win32.Build.0 = Release|Win32 - {27158C82-CD15-4A9B-9848-35E7065B209F}.Release|x64.ActiveCfg = Release|x64 - {27158C82-CD15-4A9B-9848-35E7065B209F}.Release|x64.Build.0 = Release|x64 - {C4B42409-542D-4EFC-9E6B-44713FD47A33}.Debug|Win32.ActiveCfg = Debug|Win32 - {C4B42409-542D-4EFC-9E6B-44713FD47A33}.Debug|Win32.Build.0 = Debug|Win32 - {C4B42409-542D-4EFC-9E6B-44713FD47A33}.Debug|x64.ActiveCfg = Debug|x64 - {C4B42409-542D-4EFC-9E6B-44713FD47A33}.Debug|x64.Build.0 = Debug|x64 - {C4B42409-542D-4EFC-9E6B-44713FD47A33}.Release|Win32.ActiveCfg = Release|Win32 - {C4B42409-542D-4EFC-9E6B-44713FD47A33}.Release|Win32.Build.0 = Release|Win32 - {C4B42409-542D-4EFC-9E6B-44713FD47A33}.Release|x64.ActiveCfg = Release|x64 - {C4B42409-542D-4EFC-9E6B-44713FD47A33}.Release|x64.Build.0 = Release|x64 - {3A5B74E5-6390-43B0-A459-2793B81FFD31}.Debug|Win32.ActiveCfg = Debug|Win32 - {3A5B74E5-6390-43B0-A459-2793B81FFD31}.Debug|Win32.Build.0 = Debug|Win32 - {3A5B74E5-6390-43B0-A459-2793B81FFD31}.Debug|x64.ActiveCfg = Debug|x64 - {3A5B74E5-6390-43B0-A459-2793B81FFD31}.Debug|x64.Build.0 = Debug|x64 - {3A5B74E5-6390-43B0-A459-2793B81FFD31}.Release|Win32.ActiveCfg = Release|Win32 - {3A5B74E5-6390-43B0-A459-2793B81FFD31}.Release|Win32.Build.0 = Release|Win32 - {3A5B74E5-6390-43B0-A459-2793B81FFD31}.Release|x64.ActiveCfg = Release|x64 - {3A5B74E5-6390-43B0-A459-2793B81FFD31}.Release|x64.Build.0 = Release|x64 - {0914E5C8-5352-467B-8421-C9EB35BD5596}.Debug|Win32.ActiveCfg = Debug|Win32 - {0914E5C8-5352-467B-8421-C9EB35BD5596}.Debug|Win32.Build.0 = Debug|Win32 - {0914E5C8-5352-467B-8421-C9EB35BD5596}.Debug|x64.ActiveCfg = Debug|x64 - {0914E5C8-5352-467B-8421-C9EB35BD5596}.Debug|x64.Build.0 = Debug|x64 - {0914E5C8-5352-467B-8421-C9EB35BD5596}.Release|Win32.ActiveCfg = Release|Win32 - {0914E5C8-5352-467B-8421-C9EB35BD5596}.Release|Win32.Build.0 = Release|Win32 - {0914E5C8-5352-467B-8421-C9EB35BD5596}.Release|x64.ActiveCfg = Release|x64 - {0914E5C8-5352-467B-8421-C9EB35BD5596}.Release|x64.Build.0 = Release|x64 - {772FBE05-D05A-467B-9842-BEC409EEA8D0}.Debug|Win32.ActiveCfg = Debug|Win32 - {772FBE05-D05A-467B-9842-BEC409EEA8D0}.Debug|Win32.Build.0 = Debug|Win32 - {772FBE05-D05A-467B-9842-BEC409EEA8D0}.Debug|x64.ActiveCfg = Debug|x64 - {772FBE05-D05A-467B-9842-BEC409EEA8D0}.Debug|x64.Build.0 = Debug|x64 - {772FBE05-D05A-467B-9842-BEC409EEA8D0}.Release|Win32.ActiveCfg = Release|Win32 - {772FBE05-D05A-467B-9842-BEC409EEA8D0}.Release|Win32.Build.0 = Release|Win32 - {772FBE05-D05A-467B-9842-BEC409EEA8D0}.Release|x64.ActiveCfg = Release|x64 - {772FBE05-D05A-467B-9842-BEC409EEA8D0}.Release|x64.Build.0 = Release|x64 - {78C9F424-523C-49AC-94B7-823AA4A26BF9}.Debug|Win32.ActiveCfg = Debug|Win32 - {78C9F424-523C-49AC-94B7-823AA4A26BF9}.Debug|Win32.Build.0 = Debug|Win32 - {78C9F424-523C-49AC-94B7-823AA4A26BF9}.Debug|x64.ActiveCfg = Debug|x64 - {78C9F424-523C-49AC-94B7-823AA4A26BF9}.Debug|x64.Build.0 = Debug|x64 - {78C9F424-523C-49AC-94B7-823AA4A26BF9}.Release|Win32.ActiveCfg = Release|Win32 - {78C9F424-523C-49AC-94B7-823AA4A26BF9}.Release|Win32.Build.0 = Release|Win32 - {78C9F424-523C-49AC-94B7-823AA4A26BF9}.Release|x64.ActiveCfg = Release|x64 - {78C9F424-523C-49AC-94B7-823AA4A26BF9}.Release|x64.Build.0 = Release|x64 - {EB3B38EA-5CE7-4983-845B-880661E69D09}.Debug|Win32.ActiveCfg = Debug|Win32 - {EB3B38EA-5CE7-4983-845B-880661E69D09}.Debug|Win32.Build.0 = Debug|Win32 - {EB3B38EA-5CE7-4983-845B-880661E69D09}.Debug|x64.ActiveCfg = Debug|x64 - {EB3B38EA-5CE7-4983-845B-880661E69D09}.Debug|x64.Build.0 = Debug|x64 - {EB3B38EA-5CE7-4983-845B-880661E69D09}.Release|Win32.ActiveCfg = Release|Win32 - {EB3B38EA-5CE7-4983-845B-880661E69D09}.Release|Win32.Build.0 = Release|Win32 - {EB3B38EA-5CE7-4983-845B-880661E69D09}.Release|x64.ActiveCfg = Release|x64 - {EB3B38EA-5CE7-4983-845B-880661E69D09}.Release|x64.Build.0 = Release|x64 - {2A29B6B1-AFC4-46C7-9944-7052AAE66F7B}.Debug|Win32.ActiveCfg = Debug|Win32 - {2A29B6B1-AFC4-46C7-9944-7052AAE66F7B}.Debug|Win32.Build.0 = Debug|Win32 - {2A29B6B1-AFC4-46C7-9944-7052AAE66F7B}.Debug|x64.ActiveCfg = Debug|x64 - {2A29B6B1-AFC4-46C7-9944-7052AAE66F7B}.Debug|x64.Build.0 = Debug|x64 - {2A29B6B1-AFC4-46C7-9944-7052AAE66F7B}.Release|Win32.ActiveCfg = Release|Win32 - {2A29B6B1-AFC4-46C7-9944-7052AAE66F7B}.Release|Win32.Build.0 = Release|Win32 - {2A29B6B1-AFC4-46C7-9944-7052AAE66F7B}.Release|x64.ActiveCfg = Release|x64 - {2A29B6B1-AFC4-46C7-9944-7052AAE66F7B}.Release|x64.Build.0 = Release|x64 - {1AB9413E-4F53-42A3-8CB2-CB4BE22336D0}.Debug|Win32.ActiveCfg = Debug|Win32 - {1AB9413E-4F53-42A3-8CB2-CB4BE22336D0}.Debug|Win32.Build.0 = Debug|Win32 - {1AB9413E-4F53-42A3-8CB2-CB4BE22336D0}.Debug|x64.ActiveCfg = Debug|x64 - {1AB9413E-4F53-42A3-8CB2-CB4BE22336D0}.Debug|x64.Build.0 = Debug|x64 - {1AB9413E-4F53-42A3-8CB2-CB4BE22336D0}.Release|Win32.ActiveCfg = Release|Win32 - {1AB9413E-4F53-42A3-8CB2-CB4BE22336D0}.Release|Win32.Build.0 = Release|Win32 - {1AB9413E-4F53-42A3-8CB2-CB4BE22336D0}.Release|x64.ActiveCfg = Release|x64 - {1AB9413E-4F53-42A3-8CB2-CB4BE22336D0}.Release|x64.Build.0 = Release|x64 - {FE853A36-E0D1-4AC5-A792-B643E70D2953}.Debug|Win32.ActiveCfg = Debug|Win32 - {FE853A36-E0D1-4AC5-A792-B643E70D2953}.Debug|Win32.Build.0 = Debug|Win32 - {FE853A36-E0D1-4AC5-A792-B643E70D2953}.Debug|x64.ActiveCfg = Debug|x64 - {FE853A36-E0D1-4AC5-A792-B643E70D2953}.Debug|x64.Build.0 = Debug|x64 - {FE853A36-E0D1-4AC5-A792-B643E70D2953}.Release|Win32.ActiveCfg = Release|Win32 - {FE853A36-E0D1-4AC5-A792-B643E70D2953}.Release|Win32.Build.0 = Release|Win32 - {FE853A36-E0D1-4AC5-A792-B643E70D2953}.Release|x64.ActiveCfg = Release|x64 - {FE853A36-E0D1-4AC5-A792-B643E70D2953}.Release|x64.Build.0 = Release|x64 - {16007FE2-142B-47F8-93E1-519BA3F39E71}.Debug|Win32.ActiveCfg = Debug|Win32 - {16007FE2-142B-47F8-93E1-519BA3F39E71}.Debug|Win32.Build.0 = Debug|Win32 - {16007FE2-142B-47F8-93E1-519BA3F39E71}.Debug|x64.ActiveCfg = Debug|x64 - {16007FE2-142B-47F8-93E1-519BA3F39E71}.Debug|x64.Build.0 = Debug|x64 - {16007FE2-142B-47F8-93E1-519BA3F39E71}.Release|Win32.ActiveCfg = Release|Win32 - {16007FE2-142B-47F8-93E1-519BA3F39E71}.Release|Win32.Build.0 = Release|Win32 - {16007FE2-142B-47F8-93E1-519BA3F39E71}.Release|x64.ActiveCfg = Release|x64 - {16007FE2-142B-47F8-93E1-519BA3F39E71}.Release|x64.Build.0 = Release|x64 - {CDC4AAA9-72E1-4FFA-A04D-7EF59D8B97CD}.Debug|Win32.ActiveCfg = Debug|Win32 - {CDC4AAA9-72E1-4FFA-A04D-7EF59D8B97CD}.Debug|Win32.Build.0 = Debug|Win32 - {CDC4AAA9-72E1-4FFA-A04D-7EF59D8B97CD}.Debug|x64.ActiveCfg = Debug|x64 - {CDC4AAA9-72E1-4FFA-A04D-7EF59D8B97CD}.Debug|x64.Build.0 = Debug|x64 - {CDC4AAA9-72E1-4FFA-A04D-7EF59D8B97CD}.Release|Win32.ActiveCfg = Release|Win32 - {CDC4AAA9-72E1-4FFA-A04D-7EF59D8B97CD}.Release|Win32.Build.0 = Release|Win32 - {CDC4AAA9-72E1-4FFA-A04D-7EF59D8B97CD}.Release|x64.ActiveCfg = Release|x64 - {CDC4AAA9-72E1-4FFA-A04D-7EF59D8B97CD}.Release|x64.Build.0 = Release|x64 - {4E6C2F8D-BA92-4C5B-96FD-72D4FE8BD7FA}.Debug|Win32.ActiveCfg = Debug|Win32 - {4E6C2F8D-BA92-4C5B-96FD-72D4FE8BD7FA}.Debug|Win32.Build.0 = Debug|Win32 - {4E6C2F8D-BA92-4C5B-96FD-72D4FE8BD7FA}.Debug|x64.ActiveCfg = Debug|x64 - {4E6C2F8D-BA92-4C5B-96FD-72D4FE8BD7FA}.Debug|x64.Build.0 = Debug|x64 - {4E6C2F8D-BA92-4C5B-96FD-72D4FE8BD7FA}.Release|Win32.ActiveCfg = Release|Win32 - {4E6C2F8D-BA92-4C5B-96FD-72D4FE8BD7FA}.Release|Win32.Build.0 = Release|Win32 - {4E6C2F8D-BA92-4C5B-96FD-72D4FE8BD7FA}.Release|x64.ActiveCfg = Release|x64 - {4E6C2F8D-BA92-4C5B-96FD-72D4FE8BD7FA}.Release|x64.Build.0 = Release|x64 - {6AEC2AA2-C9FF-4B7D-B07A-94A9D34B41D7}.Debug|Win32.ActiveCfg = Debug|Win32 - {6AEC2AA2-C9FF-4B7D-B07A-94A9D34B41D7}.Debug|Win32.Build.0 = Debug|Win32 - {6AEC2AA2-C9FF-4B7D-B07A-94A9D34B41D7}.Debug|x64.ActiveCfg = Debug|x64 - {6AEC2AA2-C9FF-4B7D-B07A-94A9D34B41D7}.Debug|x64.Build.0 = Debug|x64 - {6AEC2AA2-C9FF-4B7D-B07A-94A9D34B41D7}.Release|Win32.ActiveCfg = Release|Win32 - {6AEC2AA2-C9FF-4B7D-B07A-94A9D34B41D7}.Release|Win32.Build.0 = Release|Win32 - {6AEC2AA2-C9FF-4B7D-B07A-94A9D34B41D7}.Release|x64.ActiveCfg = Release|x64 - {6AEC2AA2-C9FF-4B7D-B07A-94A9D34B41D7}.Release|x64.Build.0 = Release|x64 - {02B67A37-50E1-49DB-BECF-905BC029C2FE}.Debug|Win32.ActiveCfg = Debug|Win32 - {02B67A37-50E1-49DB-BECF-905BC029C2FE}.Debug|Win32.Build.0 = Debug|Win32 - {02B67A37-50E1-49DB-BECF-905BC029C2FE}.Debug|x64.ActiveCfg = Debug|x64 - {02B67A37-50E1-49DB-BECF-905BC029C2FE}.Debug|x64.Build.0 = Debug|x64 - {02B67A37-50E1-49DB-BECF-905BC029C2FE}.Release|Win32.ActiveCfg = Release|Win32 - {02B67A37-50E1-49DB-BECF-905BC029C2FE}.Release|Win32.Build.0 = Release|Win32 - {02B67A37-50E1-49DB-BECF-905BC029C2FE}.Release|x64.ActiveCfg = Release|x64 - {02B67A37-50E1-49DB-BECF-905BC029C2FE}.Release|x64.Build.0 = Release|x64 - {6F076455-D955-45D4-9C68-4AD4E45F2D47}.Debug|Win32.ActiveCfg = Debug|Win32 - {6F076455-D955-45D4-9C68-4AD4E45F2D47}.Debug|Win32.Build.0 = Debug|Win32 - {6F076455-D955-45D4-9C68-4AD4E45F2D47}.Debug|x64.ActiveCfg = Debug|x64 - {6F076455-D955-45D4-9C68-4AD4E45F2D47}.Debug|x64.Build.0 = Debug|x64 - {6F076455-D955-45D4-9C68-4AD4E45F2D47}.Release|Win32.ActiveCfg = Release|Win32 - {6F076455-D955-45D4-9C68-4AD4E45F2D47}.Release|Win32.Build.0 = Release|Win32 - {6F076455-D955-45D4-9C68-4AD4E45F2D47}.Release|x64.ActiveCfg = Release|x64 - {6F076455-D955-45D4-9C68-4AD4E45F2D47}.Release|x64.Build.0 = Release|x64 - {853A396E-C031-4C26-A716-5B4E176BE11D}.Debug|Win32.ActiveCfg = Debug|Win32 - {853A396E-C031-4C26-A716-5B4E176BE11D}.Debug|Win32.Build.0 = Debug|Win32 - {853A396E-C031-4C26-A716-5B4E176BE11D}.Debug|x64.ActiveCfg = Debug|x64 - {853A396E-C031-4C26-A716-5B4E176BE11D}.Debug|x64.Build.0 = Debug|x64 - {853A396E-C031-4C26-A716-5B4E176BE11D}.Release|Win32.ActiveCfg = Release|Win32 - {853A396E-C031-4C26-A716-5B4E176BE11D}.Release|Win32.Build.0 = Release|Win32 - {853A396E-C031-4C26-A716-5B4E176BE11D}.Release|x64.ActiveCfg = Release|x64 - {853A396E-C031-4C26-A716-5B4E176BE11D}.Release|x64.Build.0 = Release|x64 - {4D53E40F-37E3-42B1-8848-F4C6F8313A17}.Debug|Win32.ActiveCfg = Debug|Win32 - {4D53E40F-37E3-42B1-8848-F4C6F8313A17}.Debug|Win32.Build.0 = Debug|Win32 - {4D53E40F-37E3-42B1-8848-F4C6F8313A17}.Debug|x64.ActiveCfg = Debug|x64 - {4D53E40F-37E3-42B1-8848-F4C6F8313A17}.Debug|x64.Build.0 = Debug|x64 - {4D53E40F-37E3-42B1-8848-F4C6F8313A17}.Release|Win32.ActiveCfg = Release|Win32 - {4D53E40F-37E3-42B1-8848-F4C6F8313A17}.Release|Win32.Build.0 = Release|Win32 - {4D53E40F-37E3-42B1-8848-F4C6F8313A17}.Release|x64.ActiveCfg = Release|x64 - {4D53E40F-37E3-42B1-8848-F4C6F8313A17}.Release|x64.Build.0 = Release|x64 - {E72B637E-4AA6-46F3-885F-AC67B4B470ED}.Debug|Win32.ActiveCfg = Debug|Win32 - {E72B637E-4AA6-46F3-885F-AC67B4B470ED}.Debug|Win32.Build.0 = Debug|Win32 - {E72B637E-4AA6-46F3-885F-AC67B4B470ED}.Debug|x64.ActiveCfg = Debug|x64 - {E72B637E-4AA6-46F3-885F-AC67B4B470ED}.Debug|x64.Build.0 = Debug|x64 - {E72B637E-4AA6-46F3-885F-AC67B4B470ED}.Release|Win32.ActiveCfg = Release|Win32 - {E72B637E-4AA6-46F3-885F-AC67B4B470ED}.Release|Win32.Build.0 = Release|Win32 - {E72B637E-4AA6-46F3-885F-AC67B4B470ED}.Release|x64.ActiveCfg = Release|x64 - {E72B637E-4AA6-46F3-885F-AC67B4B470ED}.Release|x64.Build.0 = Release|x64 - {5CE0E2E7-879D-4152-B61D-24E7D0707B45}.Debug|Win32.ActiveCfg = Debug|Win32 - {5CE0E2E7-879D-4152-B61D-24E7D0707B45}.Debug|Win32.Build.0 = Debug|Win32 - {5CE0E2E7-879D-4152-B61D-24E7D0707B45}.Debug|x64.ActiveCfg = Debug|x64 - {5CE0E2E7-879D-4152-B61D-24E7D0707B45}.Debug|x64.Build.0 = Debug|x64 - {5CE0E2E7-879D-4152-B61D-24E7D0707B45}.Release|Win32.ActiveCfg = Release|Win32 - {5CE0E2E7-879D-4152-B61D-24E7D0707B45}.Release|Win32.Build.0 = Release|Win32 - {5CE0E2E7-879D-4152-B61D-24E7D0707B45}.Release|x64.ActiveCfg = Release|x64 - {5CE0E2E7-879D-4152-B61D-24E7D0707B45}.Release|x64.Build.0 = Release|x64 - {8FDA260E-EF27-4F8C-8720-7AF707DD0D9E}.Debug|Win32.ActiveCfg = Debug|Win32 - {8FDA260E-EF27-4F8C-8720-7AF707DD0D9E}.Debug|Win32.Build.0 = Debug|Win32 - {8FDA260E-EF27-4F8C-8720-7AF707DD0D9E}.Debug|x64.ActiveCfg = Debug|x64 - {8FDA260E-EF27-4F8C-8720-7AF707DD0D9E}.Debug|x64.Build.0 = Debug|x64 - {8FDA260E-EF27-4F8C-8720-7AF707DD0D9E}.Release|Win32.ActiveCfg = Release|Win32 - {8FDA260E-EF27-4F8C-8720-7AF707DD0D9E}.Release|Win32.Build.0 = Release|Win32 - {8FDA260E-EF27-4F8C-8720-7AF707DD0D9E}.Release|x64.ActiveCfg = Release|x64 - {8FDA260E-EF27-4F8C-8720-7AF707DD0D9E}.Release|x64.Build.0 = Release|x64 - {65D9DE2E-B73E-4ADF-96D1-BF4A8B7F4F97}.Debug|Win32.ActiveCfg = Debug|Win32 - {65D9DE2E-B73E-4ADF-96D1-BF4A8B7F4F97}.Debug|Win32.Build.0 = Debug|Win32 - {65D9DE2E-B73E-4ADF-96D1-BF4A8B7F4F97}.Debug|x64.ActiveCfg = Debug|x64 - {65D9DE2E-B73E-4ADF-96D1-BF4A8B7F4F97}.Debug|x64.Build.0 = Debug|x64 - {65D9DE2E-B73E-4ADF-96D1-BF4A8B7F4F97}.Release|Win32.ActiveCfg = Release|Win32 - {65D9DE2E-B73E-4ADF-96D1-BF4A8B7F4F97}.Release|Win32.Build.0 = Release|Win32 - {65D9DE2E-B73E-4ADF-96D1-BF4A8B7F4F97}.Release|x64.ActiveCfg = Release|x64 - {65D9DE2E-B73E-4ADF-96D1-BF4A8B7F4F97}.Release|x64.Build.0 = Release|x64 - {F864F96D-F6AE-43E2-9A12-218B1A081255}.Debug|Win32.ActiveCfg = Debug|Win32 - {F864F96D-F6AE-43E2-9A12-218B1A081255}.Debug|Win32.Build.0 = Debug|Win32 - {F864F96D-F6AE-43E2-9A12-218B1A081255}.Debug|x64.ActiveCfg = Debug|x64 - {F864F96D-F6AE-43E2-9A12-218B1A081255}.Debug|x64.Build.0 = Debug|x64 - {F864F96D-F6AE-43E2-9A12-218B1A081255}.Release|Win32.ActiveCfg = Release|Win32 - {F864F96D-F6AE-43E2-9A12-218B1A081255}.Release|Win32.Build.0 = Release|Win32 - {F864F96D-F6AE-43E2-9A12-218B1A081255}.Release|x64.ActiveCfg = Release|x64 - {F864F96D-F6AE-43E2-9A12-218B1A081255}.Release|x64.Build.0 = Release|x64 - {3DAD16DC-3D80-46EA-ADD8-C4418CEDE553}.Debug|Win32.ActiveCfg = Debug|Win32 - {3DAD16DC-3D80-46EA-ADD8-C4418CEDE553}.Debug|Win32.Build.0 = Debug|Win32 - {3DAD16DC-3D80-46EA-ADD8-C4418CEDE553}.Debug|x64.ActiveCfg = Debug|x64 - {3DAD16DC-3D80-46EA-ADD8-C4418CEDE553}.Debug|x64.Build.0 = Debug|x64 - {3DAD16DC-3D80-46EA-ADD8-C4418CEDE553}.Release|Win32.ActiveCfg = Release|Win32 - {3DAD16DC-3D80-46EA-ADD8-C4418CEDE553}.Release|Win32.Build.0 = Release|Win32 - {3DAD16DC-3D80-46EA-ADD8-C4418CEDE553}.Release|x64.ActiveCfg = Release|x64 - {3DAD16DC-3D80-46EA-ADD8-C4418CEDE553}.Release|x64.Build.0 = Release|x64 - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/examples/BuildAllExamples_vc12.sln b/examples/BuildAllExamples_vc12.sln deleted file mode 100644 index a6786e25..00000000 --- a/examples/BuildAllExamples_vc12.sln +++ /dev/null @@ -1,1132 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 2013 -VisualStudioVersion = 12.0.40629.0 -MinimumVisualStudioVersion = 10.0.40219.1 -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "01.HelloWorld", "01.HelloWorld\HelloWorld_vc12.vcxproj", "{5AD4C95C-BA38-4692-BA4B-8C25A86208F9}" - ProjectSection(ProjectDependencies) = postProject - {E08E042A-6C45-411B-92BE-3CC31331019F} = {E08E042A-6C45-411B-92BE-3CC31331019F} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "02.Quake3Map", "02.Quake3Map\Quake3Map_vc12.vcxproj", "{D1A464A2-D479-458C-98A2-60965D823CD1}" - ProjectSection(ProjectDependencies) = postProject - {E08E042A-6C45-411B-92BE-3CC31331019F} = {E08E042A-6C45-411B-92BE-3CC31331019F} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "03.CustomSceneNode", "03.CustomSceneNode\CustomSceneNode_vc12.vcxproj", "{171CCDFA-C140-4956-8EB7-F0168F4521D3}" - ProjectSection(ProjectDependencies) = postProject - {E08E042A-6C45-411B-92BE-3CC31331019F} = {E08E042A-6C45-411B-92BE-3CC31331019F} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "04.Movement", "04.Movement\Movement_vc12.vcxproj", "{7BDBB7E8-E0C9-4A0D-83C1-D389D6140FEF}" - ProjectSection(ProjectDependencies) = postProject - {E08E042A-6C45-411B-92BE-3CC31331019F} = {E08E042A-6C45-411B-92BE-3CC31331019F} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "05.UserInterface", "05.UserInterface\UserInterface_vc12.vcxproj", "{622C9DD7-0391-49FF-AF53-24F9D5A8EC53}" - ProjectSection(ProjectDependencies) = postProject - {E08E042A-6C45-411B-92BE-3CC31331019F} = {E08E042A-6C45-411B-92BE-3CC31331019F} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "06.2DGraphics", "06.2DGraphics\2DGraphics_vc12.vcxproj", "{E71B6F18-10DC-4101-A541-F6D33F71B2BD}" - ProjectSection(ProjectDependencies) = postProject - {E08E042A-6C45-411B-92BE-3CC31331019F} = {E08E042A-6C45-411B-92BE-3CC31331019F} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "07.Collision", "07.Collision\Collision_vc12.vcxproj", "{3E30297B-5BE3-4A5C-B31E-08A28ADDB29E}" - ProjectSection(ProjectDependencies) = postProject - {E08E042A-6C45-411B-92BE-3CC31331019F} = {E08E042A-6C45-411B-92BE-3CC31331019F} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "08.SpecialFX", "08.SpecialFX\SpecialFX_vc12.vcxproj", "{C869BF55-B9D6-4980-BC92-60FA0CF8411A}" - ProjectSection(ProjectDependencies) = postProject - {E08E042A-6C45-411B-92BE-3CC31331019F} = {E08E042A-6C45-411B-92BE-3CC31331019F} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "09.Meshviewer", "09.Meshviewer\Meshviewer_vc12.vcxproj", "{2AE24484-22FC-481B-9A40-7CD0DA5C8E06}" - ProjectSection(ProjectDependencies) = postProject - {E08E042A-6C45-411B-92BE-3CC31331019F} = {E08E042A-6C45-411B-92BE-3CC31331019F} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "10.Shaders", "10.Shaders\Shaders_vc12.vcxproj", "{27158C82-CD15-4A9B-9848-35E7065B209F}" - ProjectSection(ProjectDependencies) = postProject - {E08E042A-6C45-411B-92BE-3CC31331019F} = {E08E042A-6C45-411B-92BE-3CC31331019F} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "11.PerPixelLighting", "11.PerPixelLighting\PerPixelLighting_vc12.vcxproj", "{C4B42409-542D-4EFC-9E6B-44713FD47A33}" - ProjectSection(ProjectDependencies) = postProject - {E08E042A-6C45-411B-92BE-3CC31331019F} = {E08E042A-6C45-411B-92BE-3CC31331019F} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "12.TerrainRendering", "12.TerrainRendering\TerrainRendering_vc12.vcxproj", "{3A5B74E5-6390-43B0-A459-2793B81FFD31}" - ProjectSection(ProjectDependencies) = postProject - {E08E042A-6C45-411B-92BE-3CC31331019F} = {E08E042A-6C45-411B-92BE-3CC31331019F} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "13.RenderToTexture", "13.RenderToTexture\RenderToTexture_vc12.vcxproj", "{0914E5C8-5352-467B-8421-C9EB35BD5596}" - ProjectSection(ProjectDependencies) = postProject - {E08E042A-6C45-411B-92BE-3CC31331019F} = {E08E042A-6C45-411B-92BE-3CC31331019F} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "14.Win32Window", "14.Win32Window\Win32Window_vc12.vcxproj", "{772FBE05-D05A-467B-9842-BEC409EEA8D0}" - ProjectSection(ProjectDependencies) = postProject - {E08E042A-6C45-411B-92BE-3CC31331019F} = {E08E042A-6C45-411B-92BE-3CC31331019F} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "15.LoadIrrFile", "15.LoadIrrFile\LoadIrrFile_vc12.vcxproj", "{78C9F424-523C-49AC-94B7-823AA4A26BF9}" - ProjectSection(ProjectDependencies) = postProject - {E08E042A-6C45-411B-92BE-3CC31331019F} = {E08E042A-6C45-411B-92BE-3CC31331019F} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "16.Quake3MapShader", "16.Quake3MapShader\Quake3MapShader_vc12.vcxproj", "{EB3B38EA-5CE7-4983-845B-880661E69D09}" - ProjectSection(ProjectDependencies) = postProject - {E08E042A-6C45-411B-92BE-3CC31331019F} = {E08E042A-6C45-411B-92BE-3CC31331019F} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "17.HelloWorld_Mobile", "17.HelloWorld_Mobile\17. HelloWorld for Windows Mobile on PC_vc12.vcxproj", "{2A29B6B1-AFC4-46C7-9944-7052AAE66F7B}" - ProjectSection(ProjectDependencies) = postProject - {E08E042A-6C45-411B-92BE-3CC31331019F} = {E08E042A-6C45-411B-92BE-3CC31331019F} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "18.SplitScreen", "18.SplitScreen\SplitScreen_vc12.vcxproj", "{1AB9413E-4F53-42A3-8CB2-CB4BE22336D0}" - ProjectSection(ProjectDependencies) = postProject - {E08E042A-6C45-411B-92BE-3CC31331019F} = {E08E042A-6C45-411B-92BE-3CC31331019F} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "19.MouseAndJoystick", "19.MouseAndJoystick\MouseAndJoystick_vc12.vcxproj", "{FE853A36-E0D1-4AC5-A792-B643E70D2953}" - ProjectSection(ProjectDependencies) = postProject - {E08E042A-6C45-411B-92BE-3CC31331019F} = {E08E042A-6C45-411B-92BE-3CC31331019F} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "20.ManagedLights", "20.ManagedLights\ManagedLights_vc12.vcxproj", "{16007FE2-142B-47F8-93E1-519BA3F39E71}" - ProjectSection(ProjectDependencies) = postProject - {E08E042A-6C45-411B-92BE-3CC31331019F} = {E08E042A-6C45-411B-92BE-3CC31331019F} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "21.Quake3Explorer", "21.Quake3Explorer\Quake3Explorer_vc12.vcxproj", "{CDC4AAA9-72E1-4FFA-A04D-7EF59D8B97CD}" - ProjectSection(ProjectDependencies) = postProject - {E08E042A-6C45-411B-92BE-3CC31331019F} = {E08E042A-6C45-411B-92BE-3CC31331019F} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "22.MaterialViewer", "22.MaterialViewer\MaterialViewer_vc12.vcxproj", "{4E6C2F8D-BA92-4C5B-96FD-72D4FE8BD7FA}" - ProjectSection(ProjectDependencies) = postProject - {E08E042A-6C45-411B-92BE-3CC31331019F} = {E08E042A-6C45-411B-92BE-3CC31331019F} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "23.SMeshHandling", "23.SMeshHandling\SMeshHandling_vc12.vcxproj", "{6AEC2AA2-C9FF-4B7D-B07A-94A9D34B41D7}" - ProjectSection(ProjectDependencies) = postProject - {E08E042A-6C45-411B-92BE-3CC31331019F} = {E08E042A-6C45-411B-92BE-3CC31331019F} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "24.CursorControl", "24.CursorControl\CursorControl_vc12.vcxproj", "{02B67A37-50E1-49DB-BECF-905BC029C2FE}" - ProjectSection(ProjectDependencies) = postProject - {E08E042A-6C45-411B-92BE-3CC31331019F} = {E08E042A-6C45-411B-92BE-3CC31331019F} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "25.XmlHandling", "25.XmlHandling\XmlHandling_vc12.vcxproj", "{8FDA260E-EF27-4F8C-8720-7AF707DD0D9E}" - ProjectSection(ProjectDependencies) = postProject - {E08E042A-6C45-411B-92BE-3CC31331019F} = {E08E042A-6C45-411B-92BE-3CC31331019F} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "26.OcclusionQuery", "26.OcclusionQuery\OcclusionQuery_vc12.vcxproj", "{5CE0E2E7-879D-4152-B61D-24E7D0707B45}" - ProjectSection(ProjectDependencies) = postProject - {E08E042A-6C45-411B-92BE-3CC31331019F} = {E08E042A-6C45-411B-92BE-3CC31331019F} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "30.Profiling", "30.Profiling\Profiling_vc12.vcxproj", "{65D9DE2E-B73E-4ADF-96D1-BF4A8B7F4F97}" - ProjectSection(ProjectDependencies) = postProject - {E08E042A-6C45-411B-92BE-3CC31331019F} = {E08E042A-6C45-411B-92BE-3CC31331019F} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "GUIEditor", "..\tools\GUIEditor\GUI Editor_vc12.vcxproj", "{853A396E-C031-4C26-A716-5B4E176BE11D}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "FontTool", "..\tools\IrrFontTool\newFontTool\irrFontTool_vc12.vcxproj", "{4D53E40F-37E3-42B1-8848-F4C6F8313A17}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "MeshConverter", "..\tools\MeshConverter\MeshConverter_vc12.vcxproj", "{E72B637E-4AA6-46F3-885F-AC67B4B470ED}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Demo", "Demo\Demo_vc12.vcxproj", "{6F076455-D955-45D4-9C68-4AD4E45F2D47}" - ProjectSection(ProjectDependencies) = postProject - {E08E042A-6C45-411B-92BE-3CC31331019F} = {E08E042A-6C45-411B-92BE-3CC31331019F} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Irrlicht", "..\source\Irrlicht\Irrlicht12.0.vcxproj", "{E08E042A-6C45-411B-92BE-3CC31331019F}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "27.PostProcessing", "27.PostProcessing\PostProcessing_vc12.vcxproj", "{17E74625-568E-4008-897E-CAD12A332B0C}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "28.CubeMapping", "28.CubeMapping\CubeMapping_vc12.vcxproj", "{1FDD5E75-9EB3-4467-B672-0BFC105B84A5}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Win32 = Debug|Win32 - Debug|x64 = Debug|x64 - Release - Fast FPU|Win32 = Release - Fast FPU|Win32 - Release - Fast FPU|x64 = Release - Fast FPU|x64 - Release|Win32 = Release|Win32 - Release|x64 = Release|x64 - SDL-Debug|Win32 = SDL-Debug|Win32 - SDL-Debug|x64 = SDL-Debug|x64 - Static lib - Debug|Win32 = Static lib - Debug|Win32 - Static lib - Debug|x64 = Static lib - Debug|x64 - Static lib - Release - Fast FPU|Win32 = Static lib - Release - Fast FPU|Win32 - Static lib - Release - Fast FPU|x64 = Static lib - Release - Fast FPU|x64 - Static lib - Release|Win32 = Static lib - Release|Win32 - Static lib - Release|x64 = Static lib - Release|x64 - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {5AD4C95C-BA38-4692-BA4B-8C25A86208F9}.Debug|Win32.ActiveCfg = Debug|Win32 - {5AD4C95C-BA38-4692-BA4B-8C25A86208F9}.Debug|Win32.Build.0 = Debug|Win32 - {5AD4C95C-BA38-4692-BA4B-8C25A86208F9}.Debug|x64.ActiveCfg = Debug|x64 - {5AD4C95C-BA38-4692-BA4B-8C25A86208F9}.Debug|x64.Build.0 = Debug|x64 - {5AD4C95C-BA38-4692-BA4B-8C25A86208F9}.Release - Fast FPU|Win32.ActiveCfg = Release|Win32 - {5AD4C95C-BA38-4692-BA4B-8C25A86208F9}.Release - Fast FPU|Win32.Build.0 = Release|Win32 - {5AD4C95C-BA38-4692-BA4B-8C25A86208F9}.Release - Fast FPU|x64.ActiveCfg = Release|x64 - {5AD4C95C-BA38-4692-BA4B-8C25A86208F9}.Release - Fast FPU|x64.Build.0 = Release|x64 - {5AD4C95C-BA38-4692-BA4B-8C25A86208F9}.Release|Win32.ActiveCfg = Release|Win32 - {5AD4C95C-BA38-4692-BA4B-8C25A86208F9}.Release|Win32.Build.0 = Release|Win32 - {5AD4C95C-BA38-4692-BA4B-8C25A86208F9}.Release|x64.ActiveCfg = Release|x64 - {5AD4C95C-BA38-4692-BA4B-8C25A86208F9}.Release|x64.Build.0 = Release|x64 - {5AD4C95C-BA38-4692-BA4B-8C25A86208F9}.SDL-Debug|Win32.ActiveCfg = Debug|Win32 - {5AD4C95C-BA38-4692-BA4B-8C25A86208F9}.SDL-Debug|Win32.Build.0 = Debug|Win32 - {5AD4C95C-BA38-4692-BA4B-8C25A86208F9}.SDL-Debug|x64.ActiveCfg = Debug|x64 - {5AD4C95C-BA38-4692-BA4B-8C25A86208F9}.SDL-Debug|x64.Build.0 = Debug|x64 - {5AD4C95C-BA38-4692-BA4B-8C25A86208F9}.Static lib - Debug|Win32.ActiveCfg = Debug|Win32 - {5AD4C95C-BA38-4692-BA4B-8C25A86208F9}.Static lib - Debug|Win32.Build.0 = Debug|Win32 - {5AD4C95C-BA38-4692-BA4B-8C25A86208F9}.Static lib - Debug|x64.ActiveCfg = Debug|x64 - {5AD4C95C-BA38-4692-BA4B-8C25A86208F9}.Static lib - Debug|x64.Build.0 = Debug|x64 - {5AD4C95C-BA38-4692-BA4B-8C25A86208F9}.Static lib - Release - Fast FPU|Win32.ActiveCfg = Release|Win32 - {5AD4C95C-BA38-4692-BA4B-8C25A86208F9}.Static lib - Release - Fast FPU|Win32.Build.0 = Release|Win32 - {5AD4C95C-BA38-4692-BA4B-8C25A86208F9}.Static lib - Release - Fast FPU|x64.ActiveCfg = Release|x64 - {5AD4C95C-BA38-4692-BA4B-8C25A86208F9}.Static lib - Release - Fast FPU|x64.Build.0 = Release|x64 - {5AD4C95C-BA38-4692-BA4B-8C25A86208F9}.Static lib - Release|Win32.ActiveCfg = Release|Win32 - {5AD4C95C-BA38-4692-BA4B-8C25A86208F9}.Static lib - Release|Win32.Build.0 = Release|Win32 - {5AD4C95C-BA38-4692-BA4B-8C25A86208F9}.Static lib - Release|x64.ActiveCfg = Release|x64 - {5AD4C95C-BA38-4692-BA4B-8C25A86208F9}.Static lib - Release|x64.Build.0 = Release|x64 - {D1A464A2-D479-458C-98A2-60965D823CD1}.Debug|Win32.ActiveCfg = Debug|Win32 - {D1A464A2-D479-458C-98A2-60965D823CD1}.Debug|Win32.Build.0 = Debug|Win32 - {D1A464A2-D479-458C-98A2-60965D823CD1}.Debug|x64.ActiveCfg = Debug|x64 - {D1A464A2-D479-458C-98A2-60965D823CD1}.Debug|x64.Build.0 = Debug|x64 - {D1A464A2-D479-458C-98A2-60965D823CD1}.Release - Fast FPU|Win32.ActiveCfg = Release|Win32 - {D1A464A2-D479-458C-98A2-60965D823CD1}.Release - Fast FPU|Win32.Build.0 = Release|Win32 - {D1A464A2-D479-458C-98A2-60965D823CD1}.Release - Fast FPU|x64.ActiveCfg = Release|x64 - {D1A464A2-D479-458C-98A2-60965D823CD1}.Release - Fast FPU|x64.Build.0 = Release|x64 - {D1A464A2-D479-458C-98A2-60965D823CD1}.Release|Win32.ActiveCfg = Release|Win32 - {D1A464A2-D479-458C-98A2-60965D823CD1}.Release|Win32.Build.0 = Release|Win32 - {D1A464A2-D479-458C-98A2-60965D823CD1}.Release|x64.ActiveCfg = Release|x64 - {D1A464A2-D479-458C-98A2-60965D823CD1}.Release|x64.Build.0 = Release|x64 - {D1A464A2-D479-458C-98A2-60965D823CD1}.SDL-Debug|Win32.ActiveCfg = Debug|Win32 - {D1A464A2-D479-458C-98A2-60965D823CD1}.SDL-Debug|Win32.Build.0 = Debug|Win32 - {D1A464A2-D479-458C-98A2-60965D823CD1}.SDL-Debug|x64.ActiveCfg = Debug|x64 - {D1A464A2-D479-458C-98A2-60965D823CD1}.SDL-Debug|x64.Build.0 = Debug|x64 - {D1A464A2-D479-458C-98A2-60965D823CD1}.Static lib - Debug|Win32.ActiveCfg = Debug|Win32 - {D1A464A2-D479-458C-98A2-60965D823CD1}.Static lib - Debug|Win32.Build.0 = Debug|Win32 - {D1A464A2-D479-458C-98A2-60965D823CD1}.Static lib - Debug|x64.ActiveCfg = Debug|x64 - {D1A464A2-D479-458C-98A2-60965D823CD1}.Static lib - Debug|x64.Build.0 = Debug|x64 - {D1A464A2-D479-458C-98A2-60965D823CD1}.Static lib - Release - Fast FPU|Win32.ActiveCfg = Release|Win32 - {D1A464A2-D479-458C-98A2-60965D823CD1}.Static lib - Release - Fast FPU|Win32.Build.0 = Release|Win32 - {D1A464A2-D479-458C-98A2-60965D823CD1}.Static lib - Release - Fast FPU|x64.ActiveCfg = Release|x64 - {D1A464A2-D479-458C-98A2-60965D823CD1}.Static lib - Release - Fast FPU|x64.Build.0 = Release|x64 - {D1A464A2-D479-458C-98A2-60965D823CD1}.Static lib - Release|Win32.ActiveCfg = Release|Win32 - {D1A464A2-D479-458C-98A2-60965D823CD1}.Static lib - Release|Win32.Build.0 = Release|Win32 - {D1A464A2-D479-458C-98A2-60965D823CD1}.Static lib - Release|x64.ActiveCfg = Release|x64 - {D1A464A2-D479-458C-98A2-60965D823CD1}.Static lib - Release|x64.Build.0 = Release|x64 - {171CCDFA-C140-4956-8EB7-F0168F4521D3}.Debug|Win32.ActiveCfg = Debug|Win32 - {171CCDFA-C140-4956-8EB7-F0168F4521D3}.Debug|Win32.Build.0 = Debug|Win32 - {171CCDFA-C140-4956-8EB7-F0168F4521D3}.Debug|x64.ActiveCfg = Debug|x64 - {171CCDFA-C140-4956-8EB7-F0168F4521D3}.Debug|x64.Build.0 = Debug|x64 - {171CCDFA-C140-4956-8EB7-F0168F4521D3}.Release - Fast FPU|Win32.ActiveCfg = Release|Win32 - {171CCDFA-C140-4956-8EB7-F0168F4521D3}.Release - Fast FPU|Win32.Build.0 = Release|Win32 - {171CCDFA-C140-4956-8EB7-F0168F4521D3}.Release - Fast FPU|x64.ActiveCfg = Release|x64 - {171CCDFA-C140-4956-8EB7-F0168F4521D3}.Release - Fast FPU|x64.Build.0 = Release|x64 - {171CCDFA-C140-4956-8EB7-F0168F4521D3}.Release|Win32.ActiveCfg = Release|Win32 - {171CCDFA-C140-4956-8EB7-F0168F4521D3}.Release|Win32.Build.0 = Release|Win32 - {171CCDFA-C140-4956-8EB7-F0168F4521D3}.Release|x64.ActiveCfg = Release|x64 - {171CCDFA-C140-4956-8EB7-F0168F4521D3}.Release|x64.Build.0 = Release|x64 - {171CCDFA-C140-4956-8EB7-F0168F4521D3}.SDL-Debug|Win32.ActiveCfg = Debug|Win32 - {171CCDFA-C140-4956-8EB7-F0168F4521D3}.SDL-Debug|Win32.Build.0 = Debug|Win32 - {171CCDFA-C140-4956-8EB7-F0168F4521D3}.SDL-Debug|x64.ActiveCfg = Debug|x64 - {171CCDFA-C140-4956-8EB7-F0168F4521D3}.SDL-Debug|x64.Build.0 = Debug|x64 - {171CCDFA-C140-4956-8EB7-F0168F4521D3}.Static lib - Debug|Win32.ActiveCfg = Debug|Win32 - {171CCDFA-C140-4956-8EB7-F0168F4521D3}.Static lib - Debug|Win32.Build.0 = Debug|Win32 - {171CCDFA-C140-4956-8EB7-F0168F4521D3}.Static lib - Debug|x64.ActiveCfg = Debug|x64 - {171CCDFA-C140-4956-8EB7-F0168F4521D3}.Static lib - Debug|x64.Build.0 = Debug|x64 - {171CCDFA-C140-4956-8EB7-F0168F4521D3}.Static lib - Release - Fast FPU|Win32.ActiveCfg = Release|Win32 - {171CCDFA-C140-4956-8EB7-F0168F4521D3}.Static lib - Release - Fast FPU|Win32.Build.0 = Release|Win32 - {171CCDFA-C140-4956-8EB7-F0168F4521D3}.Static lib - Release - Fast FPU|x64.ActiveCfg = Release|x64 - {171CCDFA-C140-4956-8EB7-F0168F4521D3}.Static lib - Release - Fast FPU|x64.Build.0 = Release|x64 - {171CCDFA-C140-4956-8EB7-F0168F4521D3}.Static lib - Release|Win32.ActiveCfg = Release|Win32 - {171CCDFA-C140-4956-8EB7-F0168F4521D3}.Static lib - Release|Win32.Build.0 = Release|Win32 - {171CCDFA-C140-4956-8EB7-F0168F4521D3}.Static lib - Release|x64.ActiveCfg = Release|x64 - {171CCDFA-C140-4956-8EB7-F0168F4521D3}.Static lib - Release|x64.Build.0 = Release|x64 - {7BDBB7E8-E0C9-4A0D-83C1-D389D6140FEF}.Debug|Win32.ActiveCfg = Debug|Win32 - {7BDBB7E8-E0C9-4A0D-83C1-D389D6140FEF}.Debug|Win32.Build.0 = Debug|Win32 - {7BDBB7E8-E0C9-4A0D-83C1-D389D6140FEF}.Debug|x64.ActiveCfg = Debug|x64 - {7BDBB7E8-E0C9-4A0D-83C1-D389D6140FEF}.Debug|x64.Build.0 = Debug|x64 - {7BDBB7E8-E0C9-4A0D-83C1-D389D6140FEF}.Release - Fast FPU|Win32.ActiveCfg = Release|Win32 - {7BDBB7E8-E0C9-4A0D-83C1-D389D6140FEF}.Release - Fast FPU|Win32.Build.0 = Release|Win32 - {7BDBB7E8-E0C9-4A0D-83C1-D389D6140FEF}.Release - Fast FPU|x64.ActiveCfg = Release|x64 - {7BDBB7E8-E0C9-4A0D-83C1-D389D6140FEF}.Release - Fast FPU|x64.Build.0 = Release|x64 - {7BDBB7E8-E0C9-4A0D-83C1-D389D6140FEF}.Release|Win32.ActiveCfg = Release|Win32 - {7BDBB7E8-E0C9-4A0D-83C1-D389D6140FEF}.Release|Win32.Build.0 = Release|Win32 - {7BDBB7E8-E0C9-4A0D-83C1-D389D6140FEF}.Release|x64.ActiveCfg = Release|x64 - {7BDBB7E8-E0C9-4A0D-83C1-D389D6140FEF}.Release|x64.Build.0 = Release|x64 - {7BDBB7E8-E0C9-4A0D-83C1-D389D6140FEF}.SDL-Debug|Win32.ActiveCfg = Debug|Win32 - {7BDBB7E8-E0C9-4A0D-83C1-D389D6140FEF}.SDL-Debug|Win32.Build.0 = Debug|Win32 - {7BDBB7E8-E0C9-4A0D-83C1-D389D6140FEF}.SDL-Debug|x64.ActiveCfg = Debug|x64 - {7BDBB7E8-E0C9-4A0D-83C1-D389D6140FEF}.SDL-Debug|x64.Build.0 = Debug|x64 - {7BDBB7E8-E0C9-4A0D-83C1-D389D6140FEF}.Static lib - Debug|Win32.ActiveCfg = Debug|Win32 - {7BDBB7E8-E0C9-4A0D-83C1-D389D6140FEF}.Static lib - Debug|Win32.Build.0 = Debug|Win32 - {7BDBB7E8-E0C9-4A0D-83C1-D389D6140FEF}.Static lib - Debug|x64.ActiveCfg = Debug|x64 - {7BDBB7E8-E0C9-4A0D-83C1-D389D6140FEF}.Static lib - Debug|x64.Build.0 = Debug|x64 - {7BDBB7E8-E0C9-4A0D-83C1-D389D6140FEF}.Static lib - Release - Fast FPU|Win32.ActiveCfg = Release|Win32 - {7BDBB7E8-E0C9-4A0D-83C1-D389D6140FEF}.Static lib - Release - Fast FPU|Win32.Build.0 = Release|Win32 - {7BDBB7E8-E0C9-4A0D-83C1-D389D6140FEF}.Static lib - Release - Fast FPU|x64.ActiveCfg = Release|x64 - {7BDBB7E8-E0C9-4A0D-83C1-D389D6140FEF}.Static lib - Release - Fast FPU|x64.Build.0 = Release|x64 - {7BDBB7E8-E0C9-4A0D-83C1-D389D6140FEF}.Static lib - Release|Win32.ActiveCfg = Release|Win32 - {7BDBB7E8-E0C9-4A0D-83C1-D389D6140FEF}.Static lib - Release|Win32.Build.0 = Release|Win32 - {7BDBB7E8-E0C9-4A0D-83C1-D389D6140FEF}.Static lib - Release|x64.ActiveCfg = Release|x64 - {7BDBB7E8-E0C9-4A0D-83C1-D389D6140FEF}.Static lib - Release|x64.Build.0 = Release|x64 - {622C9DD7-0391-49FF-AF53-24F9D5A8EC53}.Debug|Win32.ActiveCfg = Debug|Win32 - {622C9DD7-0391-49FF-AF53-24F9D5A8EC53}.Debug|Win32.Build.0 = Debug|Win32 - {622C9DD7-0391-49FF-AF53-24F9D5A8EC53}.Debug|x64.ActiveCfg = Debug|x64 - {622C9DD7-0391-49FF-AF53-24F9D5A8EC53}.Debug|x64.Build.0 = Debug|x64 - {622C9DD7-0391-49FF-AF53-24F9D5A8EC53}.Release - Fast FPU|Win32.ActiveCfg = Release|Win32 - {622C9DD7-0391-49FF-AF53-24F9D5A8EC53}.Release - Fast FPU|Win32.Build.0 = Release|Win32 - {622C9DD7-0391-49FF-AF53-24F9D5A8EC53}.Release - Fast FPU|x64.ActiveCfg = Release|x64 - {622C9DD7-0391-49FF-AF53-24F9D5A8EC53}.Release - Fast FPU|x64.Build.0 = Release|x64 - {622C9DD7-0391-49FF-AF53-24F9D5A8EC53}.Release|Win32.ActiveCfg = Release|Win32 - {622C9DD7-0391-49FF-AF53-24F9D5A8EC53}.Release|Win32.Build.0 = Release|Win32 - {622C9DD7-0391-49FF-AF53-24F9D5A8EC53}.Release|x64.ActiveCfg = Release|x64 - {622C9DD7-0391-49FF-AF53-24F9D5A8EC53}.Release|x64.Build.0 = Release|x64 - {622C9DD7-0391-49FF-AF53-24F9D5A8EC53}.SDL-Debug|Win32.ActiveCfg = Debug|Win32 - {622C9DD7-0391-49FF-AF53-24F9D5A8EC53}.SDL-Debug|Win32.Build.0 = Debug|Win32 - {622C9DD7-0391-49FF-AF53-24F9D5A8EC53}.SDL-Debug|x64.ActiveCfg = Debug|x64 - {622C9DD7-0391-49FF-AF53-24F9D5A8EC53}.SDL-Debug|x64.Build.0 = Debug|x64 - {622C9DD7-0391-49FF-AF53-24F9D5A8EC53}.Static lib - Debug|Win32.ActiveCfg = Debug|Win32 - {622C9DD7-0391-49FF-AF53-24F9D5A8EC53}.Static lib - Debug|Win32.Build.0 = Debug|Win32 - {622C9DD7-0391-49FF-AF53-24F9D5A8EC53}.Static lib - Debug|x64.ActiveCfg = Debug|x64 - {622C9DD7-0391-49FF-AF53-24F9D5A8EC53}.Static lib - Debug|x64.Build.0 = Debug|x64 - {622C9DD7-0391-49FF-AF53-24F9D5A8EC53}.Static lib - Release - Fast FPU|Win32.ActiveCfg = Release|Win32 - {622C9DD7-0391-49FF-AF53-24F9D5A8EC53}.Static lib - Release - Fast FPU|Win32.Build.0 = Release|Win32 - {622C9DD7-0391-49FF-AF53-24F9D5A8EC53}.Static lib - Release - Fast FPU|x64.ActiveCfg = Release|x64 - {622C9DD7-0391-49FF-AF53-24F9D5A8EC53}.Static lib - Release - Fast FPU|x64.Build.0 = Release|x64 - {622C9DD7-0391-49FF-AF53-24F9D5A8EC53}.Static lib - Release|Win32.ActiveCfg = Release|Win32 - {622C9DD7-0391-49FF-AF53-24F9D5A8EC53}.Static lib - Release|Win32.Build.0 = Release|Win32 - {622C9DD7-0391-49FF-AF53-24F9D5A8EC53}.Static lib - Release|x64.ActiveCfg = Release|x64 - {622C9DD7-0391-49FF-AF53-24F9D5A8EC53}.Static lib - Release|x64.Build.0 = Release|x64 - {E71B6F18-10DC-4101-A541-F6D33F71B2BD}.Debug|Win32.ActiveCfg = Debug|Win32 - {E71B6F18-10DC-4101-A541-F6D33F71B2BD}.Debug|Win32.Build.0 = Debug|Win32 - {E71B6F18-10DC-4101-A541-F6D33F71B2BD}.Debug|x64.ActiveCfg = Debug|x64 - {E71B6F18-10DC-4101-A541-F6D33F71B2BD}.Debug|x64.Build.0 = Debug|x64 - {E71B6F18-10DC-4101-A541-F6D33F71B2BD}.Release - Fast FPU|Win32.ActiveCfg = Release|Win32 - {E71B6F18-10DC-4101-A541-F6D33F71B2BD}.Release - Fast FPU|Win32.Build.0 = Release|Win32 - {E71B6F18-10DC-4101-A541-F6D33F71B2BD}.Release - Fast FPU|x64.ActiveCfg = Release|x64 - {E71B6F18-10DC-4101-A541-F6D33F71B2BD}.Release - Fast FPU|x64.Build.0 = Release|x64 - {E71B6F18-10DC-4101-A541-F6D33F71B2BD}.Release|Win32.ActiveCfg = Release|Win32 - {E71B6F18-10DC-4101-A541-F6D33F71B2BD}.Release|Win32.Build.0 = Release|Win32 - {E71B6F18-10DC-4101-A541-F6D33F71B2BD}.Release|x64.ActiveCfg = Release|x64 - {E71B6F18-10DC-4101-A541-F6D33F71B2BD}.Release|x64.Build.0 = Release|x64 - {E71B6F18-10DC-4101-A541-F6D33F71B2BD}.SDL-Debug|Win32.ActiveCfg = Debug|Win32 - {E71B6F18-10DC-4101-A541-F6D33F71B2BD}.SDL-Debug|Win32.Build.0 = Debug|Win32 - {E71B6F18-10DC-4101-A541-F6D33F71B2BD}.SDL-Debug|x64.ActiveCfg = Debug|x64 - {E71B6F18-10DC-4101-A541-F6D33F71B2BD}.SDL-Debug|x64.Build.0 = Debug|x64 - {E71B6F18-10DC-4101-A541-F6D33F71B2BD}.Static lib - Debug|Win32.ActiveCfg = Debug|Win32 - {E71B6F18-10DC-4101-A541-F6D33F71B2BD}.Static lib - Debug|Win32.Build.0 = Debug|Win32 - {E71B6F18-10DC-4101-A541-F6D33F71B2BD}.Static lib - Debug|x64.ActiveCfg = Debug|x64 - {E71B6F18-10DC-4101-A541-F6D33F71B2BD}.Static lib - Debug|x64.Build.0 = Debug|x64 - {E71B6F18-10DC-4101-A541-F6D33F71B2BD}.Static lib - Release - Fast FPU|Win32.ActiveCfg = Release|Win32 - {E71B6F18-10DC-4101-A541-F6D33F71B2BD}.Static lib - Release - Fast FPU|Win32.Build.0 = Release|Win32 - {E71B6F18-10DC-4101-A541-F6D33F71B2BD}.Static lib - Release - Fast FPU|x64.ActiveCfg = Release|x64 - {E71B6F18-10DC-4101-A541-F6D33F71B2BD}.Static lib - Release - Fast FPU|x64.Build.0 = Release|x64 - {E71B6F18-10DC-4101-A541-F6D33F71B2BD}.Static lib - Release|Win32.ActiveCfg = Release|Win32 - {E71B6F18-10DC-4101-A541-F6D33F71B2BD}.Static lib - Release|Win32.Build.0 = Release|Win32 - {E71B6F18-10DC-4101-A541-F6D33F71B2BD}.Static lib - Release|x64.ActiveCfg = Release|x64 - {E71B6F18-10DC-4101-A541-F6D33F71B2BD}.Static lib - Release|x64.Build.0 = Release|x64 - {3E30297B-5BE3-4A5C-B31E-08A28ADDB29E}.Debug|Win32.ActiveCfg = Debug|Win32 - {3E30297B-5BE3-4A5C-B31E-08A28ADDB29E}.Debug|Win32.Build.0 = Debug|Win32 - {3E30297B-5BE3-4A5C-B31E-08A28ADDB29E}.Debug|x64.ActiveCfg = Debug|x64 - {3E30297B-5BE3-4A5C-B31E-08A28ADDB29E}.Debug|x64.Build.0 = Debug|x64 - {3E30297B-5BE3-4A5C-B31E-08A28ADDB29E}.Release - Fast FPU|Win32.ActiveCfg = Release|Win32 - {3E30297B-5BE3-4A5C-B31E-08A28ADDB29E}.Release - Fast FPU|Win32.Build.0 = Release|Win32 - {3E30297B-5BE3-4A5C-B31E-08A28ADDB29E}.Release - Fast FPU|x64.ActiveCfg = Release|x64 - {3E30297B-5BE3-4A5C-B31E-08A28ADDB29E}.Release - Fast FPU|x64.Build.0 = Release|x64 - {3E30297B-5BE3-4A5C-B31E-08A28ADDB29E}.Release|Win32.ActiveCfg = Release|Win32 - {3E30297B-5BE3-4A5C-B31E-08A28ADDB29E}.Release|Win32.Build.0 = Release|Win32 - {3E30297B-5BE3-4A5C-B31E-08A28ADDB29E}.Release|x64.ActiveCfg = Release|x64 - {3E30297B-5BE3-4A5C-B31E-08A28ADDB29E}.Release|x64.Build.0 = Release|x64 - {3E30297B-5BE3-4A5C-B31E-08A28ADDB29E}.SDL-Debug|Win32.ActiveCfg = Debug|Win32 - {3E30297B-5BE3-4A5C-B31E-08A28ADDB29E}.SDL-Debug|Win32.Build.0 = Debug|Win32 - {3E30297B-5BE3-4A5C-B31E-08A28ADDB29E}.SDL-Debug|x64.ActiveCfg = Debug|x64 - {3E30297B-5BE3-4A5C-B31E-08A28ADDB29E}.SDL-Debug|x64.Build.0 = Debug|x64 - {3E30297B-5BE3-4A5C-B31E-08A28ADDB29E}.Static lib - Debug|Win32.ActiveCfg = Debug|Win32 - {3E30297B-5BE3-4A5C-B31E-08A28ADDB29E}.Static lib - Debug|Win32.Build.0 = Debug|Win32 - {3E30297B-5BE3-4A5C-B31E-08A28ADDB29E}.Static lib - Debug|x64.ActiveCfg = Debug|x64 - {3E30297B-5BE3-4A5C-B31E-08A28ADDB29E}.Static lib - Debug|x64.Build.0 = Debug|x64 - {3E30297B-5BE3-4A5C-B31E-08A28ADDB29E}.Static lib - Release - Fast FPU|Win32.ActiveCfg = Release|Win32 - {3E30297B-5BE3-4A5C-B31E-08A28ADDB29E}.Static lib - Release - Fast FPU|Win32.Build.0 = Release|Win32 - {3E30297B-5BE3-4A5C-B31E-08A28ADDB29E}.Static lib - Release - Fast FPU|x64.ActiveCfg = Release|x64 - {3E30297B-5BE3-4A5C-B31E-08A28ADDB29E}.Static lib - Release - Fast FPU|x64.Build.0 = Release|x64 - {3E30297B-5BE3-4A5C-B31E-08A28ADDB29E}.Static lib - Release|Win32.ActiveCfg = Release|Win32 - {3E30297B-5BE3-4A5C-B31E-08A28ADDB29E}.Static lib - Release|Win32.Build.0 = Release|Win32 - {3E30297B-5BE3-4A5C-B31E-08A28ADDB29E}.Static lib - Release|x64.ActiveCfg = Release|x64 - {3E30297B-5BE3-4A5C-B31E-08A28ADDB29E}.Static lib - Release|x64.Build.0 = Release|x64 - {C869BF55-B9D6-4980-BC92-60FA0CF8411A}.Debug|Win32.ActiveCfg = Debug|Win32 - {C869BF55-B9D6-4980-BC92-60FA0CF8411A}.Debug|Win32.Build.0 = Debug|Win32 - {C869BF55-B9D6-4980-BC92-60FA0CF8411A}.Debug|x64.ActiveCfg = Debug|x64 - {C869BF55-B9D6-4980-BC92-60FA0CF8411A}.Debug|x64.Build.0 = Debug|x64 - {C869BF55-B9D6-4980-BC92-60FA0CF8411A}.Release - Fast FPU|Win32.ActiveCfg = Release|Win32 - {C869BF55-B9D6-4980-BC92-60FA0CF8411A}.Release - Fast FPU|Win32.Build.0 = Release|Win32 - {C869BF55-B9D6-4980-BC92-60FA0CF8411A}.Release - Fast FPU|x64.ActiveCfg = Release|x64 - {C869BF55-B9D6-4980-BC92-60FA0CF8411A}.Release - Fast FPU|x64.Build.0 = Release|x64 - {C869BF55-B9D6-4980-BC92-60FA0CF8411A}.Release|Win32.ActiveCfg = Release|Win32 - {C869BF55-B9D6-4980-BC92-60FA0CF8411A}.Release|Win32.Build.0 = Release|Win32 - {C869BF55-B9D6-4980-BC92-60FA0CF8411A}.Release|x64.ActiveCfg = Release|x64 - {C869BF55-B9D6-4980-BC92-60FA0CF8411A}.Release|x64.Build.0 = Release|x64 - {C869BF55-B9D6-4980-BC92-60FA0CF8411A}.SDL-Debug|Win32.ActiveCfg = Debug|Win32 - {C869BF55-B9D6-4980-BC92-60FA0CF8411A}.SDL-Debug|Win32.Build.0 = Debug|Win32 - {C869BF55-B9D6-4980-BC92-60FA0CF8411A}.SDL-Debug|x64.ActiveCfg = Debug|x64 - {C869BF55-B9D6-4980-BC92-60FA0CF8411A}.SDL-Debug|x64.Build.0 = Debug|x64 - {C869BF55-B9D6-4980-BC92-60FA0CF8411A}.Static lib - Debug|Win32.ActiveCfg = Debug|Win32 - {C869BF55-B9D6-4980-BC92-60FA0CF8411A}.Static lib - Debug|Win32.Build.0 = Debug|Win32 - {C869BF55-B9D6-4980-BC92-60FA0CF8411A}.Static lib - Debug|x64.ActiveCfg = Debug|x64 - {C869BF55-B9D6-4980-BC92-60FA0CF8411A}.Static lib - Debug|x64.Build.0 = Debug|x64 - {C869BF55-B9D6-4980-BC92-60FA0CF8411A}.Static lib - Release - Fast FPU|Win32.ActiveCfg = Release|Win32 - {C869BF55-B9D6-4980-BC92-60FA0CF8411A}.Static lib - Release - Fast FPU|Win32.Build.0 = Release|Win32 - {C869BF55-B9D6-4980-BC92-60FA0CF8411A}.Static lib - Release - Fast FPU|x64.ActiveCfg = Release|x64 - {C869BF55-B9D6-4980-BC92-60FA0CF8411A}.Static lib - Release - Fast FPU|x64.Build.0 = Release|x64 - {C869BF55-B9D6-4980-BC92-60FA0CF8411A}.Static lib - Release|Win32.ActiveCfg = Release|Win32 - {C869BF55-B9D6-4980-BC92-60FA0CF8411A}.Static lib - Release|Win32.Build.0 = Release|Win32 - {C869BF55-B9D6-4980-BC92-60FA0CF8411A}.Static lib - Release|x64.ActiveCfg = Release|x64 - {C869BF55-B9D6-4980-BC92-60FA0CF8411A}.Static lib - Release|x64.Build.0 = Release|x64 - {2AE24484-22FC-481B-9A40-7CD0DA5C8E06}.Debug|Win32.ActiveCfg = Debug|Win32 - {2AE24484-22FC-481B-9A40-7CD0DA5C8E06}.Debug|Win32.Build.0 = Debug|Win32 - {2AE24484-22FC-481B-9A40-7CD0DA5C8E06}.Debug|x64.ActiveCfg = Debug|x64 - {2AE24484-22FC-481B-9A40-7CD0DA5C8E06}.Debug|x64.Build.0 = Debug|x64 - {2AE24484-22FC-481B-9A40-7CD0DA5C8E06}.Release - Fast FPU|Win32.ActiveCfg = Release|Win32 - {2AE24484-22FC-481B-9A40-7CD0DA5C8E06}.Release - Fast FPU|Win32.Build.0 = Release|Win32 - {2AE24484-22FC-481B-9A40-7CD0DA5C8E06}.Release - Fast FPU|x64.ActiveCfg = Release|x64 - {2AE24484-22FC-481B-9A40-7CD0DA5C8E06}.Release - Fast FPU|x64.Build.0 = Release|x64 - {2AE24484-22FC-481B-9A40-7CD0DA5C8E06}.Release|Win32.ActiveCfg = Release|Win32 - {2AE24484-22FC-481B-9A40-7CD0DA5C8E06}.Release|Win32.Build.0 = Release|Win32 - {2AE24484-22FC-481B-9A40-7CD0DA5C8E06}.Release|x64.ActiveCfg = Release|x64 - {2AE24484-22FC-481B-9A40-7CD0DA5C8E06}.Release|x64.Build.0 = Release|x64 - {2AE24484-22FC-481B-9A40-7CD0DA5C8E06}.SDL-Debug|Win32.ActiveCfg = Debug|Win32 - {2AE24484-22FC-481B-9A40-7CD0DA5C8E06}.SDL-Debug|Win32.Build.0 = Debug|Win32 - {2AE24484-22FC-481B-9A40-7CD0DA5C8E06}.SDL-Debug|x64.ActiveCfg = Debug|x64 - {2AE24484-22FC-481B-9A40-7CD0DA5C8E06}.SDL-Debug|x64.Build.0 = Debug|x64 - {2AE24484-22FC-481B-9A40-7CD0DA5C8E06}.Static lib - Debug|Win32.ActiveCfg = Debug|Win32 - {2AE24484-22FC-481B-9A40-7CD0DA5C8E06}.Static lib - Debug|Win32.Build.0 = Debug|Win32 - {2AE24484-22FC-481B-9A40-7CD0DA5C8E06}.Static lib - Debug|x64.ActiveCfg = Debug|x64 - {2AE24484-22FC-481B-9A40-7CD0DA5C8E06}.Static lib - Debug|x64.Build.0 = Debug|x64 - {2AE24484-22FC-481B-9A40-7CD0DA5C8E06}.Static lib - Release - Fast FPU|Win32.ActiveCfg = Release|Win32 - {2AE24484-22FC-481B-9A40-7CD0DA5C8E06}.Static lib - Release - Fast FPU|Win32.Build.0 = Release|Win32 - {2AE24484-22FC-481B-9A40-7CD0DA5C8E06}.Static lib - Release - Fast FPU|x64.ActiveCfg = Release|x64 - {2AE24484-22FC-481B-9A40-7CD0DA5C8E06}.Static lib - Release - Fast FPU|x64.Build.0 = Release|x64 - {2AE24484-22FC-481B-9A40-7CD0DA5C8E06}.Static lib - Release|Win32.ActiveCfg = Release|Win32 - {2AE24484-22FC-481B-9A40-7CD0DA5C8E06}.Static lib - Release|Win32.Build.0 = Release|Win32 - {2AE24484-22FC-481B-9A40-7CD0DA5C8E06}.Static lib - Release|x64.ActiveCfg = Release|x64 - {2AE24484-22FC-481B-9A40-7CD0DA5C8E06}.Static lib - Release|x64.Build.0 = Release|x64 - {27158C82-CD15-4A9B-9848-35E7065B209F}.Debug|Win32.ActiveCfg = Debug|Win32 - {27158C82-CD15-4A9B-9848-35E7065B209F}.Debug|Win32.Build.0 = Debug|Win32 - {27158C82-CD15-4A9B-9848-35E7065B209F}.Debug|x64.ActiveCfg = Debug|x64 - {27158C82-CD15-4A9B-9848-35E7065B209F}.Debug|x64.Build.0 = Debug|x64 - {27158C82-CD15-4A9B-9848-35E7065B209F}.Release - Fast FPU|Win32.ActiveCfg = Release|Win32 - {27158C82-CD15-4A9B-9848-35E7065B209F}.Release - Fast FPU|Win32.Build.0 = Release|Win32 - {27158C82-CD15-4A9B-9848-35E7065B209F}.Release - Fast FPU|x64.ActiveCfg = Release|x64 - {27158C82-CD15-4A9B-9848-35E7065B209F}.Release - Fast FPU|x64.Build.0 = Release|x64 - {27158C82-CD15-4A9B-9848-35E7065B209F}.Release|Win32.ActiveCfg = Release|Win32 - {27158C82-CD15-4A9B-9848-35E7065B209F}.Release|Win32.Build.0 = Release|Win32 - {27158C82-CD15-4A9B-9848-35E7065B209F}.Release|x64.ActiveCfg = Release|x64 - {27158C82-CD15-4A9B-9848-35E7065B209F}.Release|x64.Build.0 = Release|x64 - {27158C82-CD15-4A9B-9848-35E7065B209F}.SDL-Debug|Win32.ActiveCfg = Debug|Win32 - {27158C82-CD15-4A9B-9848-35E7065B209F}.SDL-Debug|Win32.Build.0 = Debug|Win32 - {27158C82-CD15-4A9B-9848-35E7065B209F}.SDL-Debug|x64.ActiveCfg = Debug|x64 - {27158C82-CD15-4A9B-9848-35E7065B209F}.SDL-Debug|x64.Build.0 = Debug|x64 - {27158C82-CD15-4A9B-9848-35E7065B209F}.Static lib - Debug|Win32.ActiveCfg = Debug|Win32 - {27158C82-CD15-4A9B-9848-35E7065B209F}.Static lib - Debug|Win32.Build.0 = Debug|Win32 - {27158C82-CD15-4A9B-9848-35E7065B209F}.Static lib - Debug|x64.ActiveCfg = Debug|x64 - {27158C82-CD15-4A9B-9848-35E7065B209F}.Static lib - Debug|x64.Build.0 = Debug|x64 - {27158C82-CD15-4A9B-9848-35E7065B209F}.Static lib - Release - Fast FPU|Win32.ActiveCfg = Release|Win32 - {27158C82-CD15-4A9B-9848-35E7065B209F}.Static lib - Release - Fast FPU|Win32.Build.0 = Release|Win32 - {27158C82-CD15-4A9B-9848-35E7065B209F}.Static lib - Release - Fast FPU|x64.ActiveCfg = Release|x64 - {27158C82-CD15-4A9B-9848-35E7065B209F}.Static lib - Release - Fast FPU|x64.Build.0 = Release|x64 - {27158C82-CD15-4A9B-9848-35E7065B209F}.Static lib - Release|Win32.ActiveCfg = Release|Win32 - {27158C82-CD15-4A9B-9848-35E7065B209F}.Static lib - Release|Win32.Build.0 = Release|Win32 - {27158C82-CD15-4A9B-9848-35E7065B209F}.Static lib - Release|x64.ActiveCfg = Release|x64 - {27158C82-CD15-4A9B-9848-35E7065B209F}.Static lib - Release|x64.Build.0 = Release|x64 - {C4B42409-542D-4EFC-9E6B-44713FD47A33}.Debug|Win32.ActiveCfg = Debug|Win32 - {C4B42409-542D-4EFC-9E6B-44713FD47A33}.Debug|Win32.Build.0 = Debug|Win32 - {C4B42409-542D-4EFC-9E6B-44713FD47A33}.Debug|x64.ActiveCfg = Debug|x64 - {C4B42409-542D-4EFC-9E6B-44713FD47A33}.Debug|x64.Build.0 = Debug|x64 - {C4B42409-542D-4EFC-9E6B-44713FD47A33}.Release - Fast FPU|Win32.ActiveCfg = Release|Win32 - {C4B42409-542D-4EFC-9E6B-44713FD47A33}.Release - Fast FPU|Win32.Build.0 = Release|Win32 - {C4B42409-542D-4EFC-9E6B-44713FD47A33}.Release - Fast FPU|x64.ActiveCfg = Release|x64 - {C4B42409-542D-4EFC-9E6B-44713FD47A33}.Release - Fast FPU|x64.Build.0 = Release|x64 - {C4B42409-542D-4EFC-9E6B-44713FD47A33}.Release|Win32.ActiveCfg = Release|Win32 - {C4B42409-542D-4EFC-9E6B-44713FD47A33}.Release|Win32.Build.0 = Release|Win32 - {C4B42409-542D-4EFC-9E6B-44713FD47A33}.Release|x64.ActiveCfg = Release|x64 - {C4B42409-542D-4EFC-9E6B-44713FD47A33}.Release|x64.Build.0 = Release|x64 - {C4B42409-542D-4EFC-9E6B-44713FD47A33}.SDL-Debug|Win32.ActiveCfg = Debug|Win32 - {C4B42409-542D-4EFC-9E6B-44713FD47A33}.SDL-Debug|Win32.Build.0 = Debug|Win32 - {C4B42409-542D-4EFC-9E6B-44713FD47A33}.SDL-Debug|x64.ActiveCfg = Debug|x64 - {C4B42409-542D-4EFC-9E6B-44713FD47A33}.SDL-Debug|x64.Build.0 = Debug|x64 - {C4B42409-542D-4EFC-9E6B-44713FD47A33}.Static lib - Debug|Win32.ActiveCfg = Debug|Win32 - {C4B42409-542D-4EFC-9E6B-44713FD47A33}.Static lib - Debug|Win32.Build.0 = Debug|Win32 - {C4B42409-542D-4EFC-9E6B-44713FD47A33}.Static lib - Debug|x64.ActiveCfg = Debug|x64 - {C4B42409-542D-4EFC-9E6B-44713FD47A33}.Static lib - Debug|x64.Build.0 = Debug|x64 - {C4B42409-542D-4EFC-9E6B-44713FD47A33}.Static lib - Release - Fast FPU|Win32.ActiveCfg = Release|Win32 - {C4B42409-542D-4EFC-9E6B-44713FD47A33}.Static lib - Release - Fast FPU|Win32.Build.0 = Release|Win32 - {C4B42409-542D-4EFC-9E6B-44713FD47A33}.Static lib - Release - Fast FPU|x64.ActiveCfg = Release|x64 - {C4B42409-542D-4EFC-9E6B-44713FD47A33}.Static lib - Release - Fast FPU|x64.Build.0 = Release|x64 - {C4B42409-542D-4EFC-9E6B-44713FD47A33}.Static lib - Release|Win32.ActiveCfg = Release|Win32 - {C4B42409-542D-4EFC-9E6B-44713FD47A33}.Static lib - Release|Win32.Build.0 = Release|Win32 - {C4B42409-542D-4EFC-9E6B-44713FD47A33}.Static lib - Release|x64.ActiveCfg = Release|x64 - {C4B42409-542D-4EFC-9E6B-44713FD47A33}.Static lib - Release|x64.Build.0 = Release|x64 - {3A5B74E5-6390-43B0-A459-2793B81FFD31}.Debug|Win32.ActiveCfg = Debug|Win32 - {3A5B74E5-6390-43B0-A459-2793B81FFD31}.Debug|Win32.Build.0 = Debug|Win32 - {3A5B74E5-6390-43B0-A459-2793B81FFD31}.Debug|x64.ActiveCfg = Debug|x64 - {3A5B74E5-6390-43B0-A459-2793B81FFD31}.Debug|x64.Build.0 = Debug|x64 - {3A5B74E5-6390-43B0-A459-2793B81FFD31}.Release - Fast FPU|Win32.ActiveCfg = Release|Win32 - {3A5B74E5-6390-43B0-A459-2793B81FFD31}.Release - Fast FPU|Win32.Build.0 = Release|Win32 - {3A5B74E5-6390-43B0-A459-2793B81FFD31}.Release - Fast FPU|x64.ActiveCfg = Release|x64 - {3A5B74E5-6390-43B0-A459-2793B81FFD31}.Release - Fast FPU|x64.Build.0 = Release|x64 - {3A5B74E5-6390-43B0-A459-2793B81FFD31}.Release|Win32.ActiveCfg = Release|Win32 - {3A5B74E5-6390-43B0-A459-2793B81FFD31}.Release|Win32.Build.0 = Release|Win32 - {3A5B74E5-6390-43B0-A459-2793B81FFD31}.Release|x64.ActiveCfg = Release|x64 - {3A5B74E5-6390-43B0-A459-2793B81FFD31}.Release|x64.Build.0 = Release|x64 - {3A5B74E5-6390-43B0-A459-2793B81FFD31}.SDL-Debug|Win32.ActiveCfg = Debug|Win32 - {3A5B74E5-6390-43B0-A459-2793B81FFD31}.SDL-Debug|Win32.Build.0 = Debug|Win32 - {3A5B74E5-6390-43B0-A459-2793B81FFD31}.SDL-Debug|x64.ActiveCfg = Debug|x64 - {3A5B74E5-6390-43B0-A459-2793B81FFD31}.SDL-Debug|x64.Build.0 = Debug|x64 - {3A5B74E5-6390-43B0-A459-2793B81FFD31}.Static lib - Debug|Win32.ActiveCfg = Debug|Win32 - {3A5B74E5-6390-43B0-A459-2793B81FFD31}.Static lib - Debug|Win32.Build.0 = Debug|Win32 - {3A5B74E5-6390-43B0-A459-2793B81FFD31}.Static lib - Debug|x64.ActiveCfg = Debug|x64 - {3A5B74E5-6390-43B0-A459-2793B81FFD31}.Static lib - Debug|x64.Build.0 = Debug|x64 - {3A5B74E5-6390-43B0-A459-2793B81FFD31}.Static lib - Release - Fast FPU|Win32.ActiveCfg = Release|Win32 - {3A5B74E5-6390-43B0-A459-2793B81FFD31}.Static lib - Release - Fast FPU|Win32.Build.0 = Release|Win32 - {3A5B74E5-6390-43B0-A459-2793B81FFD31}.Static lib - Release - Fast FPU|x64.ActiveCfg = Release|x64 - {3A5B74E5-6390-43B0-A459-2793B81FFD31}.Static lib - Release - Fast FPU|x64.Build.0 = Release|x64 - {3A5B74E5-6390-43B0-A459-2793B81FFD31}.Static lib - Release|Win32.ActiveCfg = Release|Win32 - {3A5B74E5-6390-43B0-A459-2793B81FFD31}.Static lib - Release|Win32.Build.0 = Release|Win32 - {3A5B74E5-6390-43B0-A459-2793B81FFD31}.Static lib - Release|x64.ActiveCfg = Release|x64 - {3A5B74E5-6390-43B0-A459-2793B81FFD31}.Static lib - Release|x64.Build.0 = Release|x64 - {0914E5C8-5352-467B-8421-C9EB35BD5596}.Debug|Win32.ActiveCfg = Debug|Win32 - {0914E5C8-5352-467B-8421-C9EB35BD5596}.Debug|Win32.Build.0 = Debug|Win32 - {0914E5C8-5352-467B-8421-C9EB35BD5596}.Debug|x64.ActiveCfg = Debug|x64 - {0914E5C8-5352-467B-8421-C9EB35BD5596}.Debug|x64.Build.0 = Debug|x64 - {0914E5C8-5352-467B-8421-C9EB35BD5596}.Release - Fast FPU|Win32.ActiveCfg = Release|Win32 - {0914E5C8-5352-467B-8421-C9EB35BD5596}.Release - Fast FPU|Win32.Build.0 = Release|Win32 - {0914E5C8-5352-467B-8421-C9EB35BD5596}.Release - Fast FPU|x64.ActiveCfg = Release|x64 - {0914E5C8-5352-467B-8421-C9EB35BD5596}.Release - Fast FPU|x64.Build.0 = Release|x64 - {0914E5C8-5352-467B-8421-C9EB35BD5596}.Release|Win32.ActiveCfg = Release|Win32 - {0914E5C8-5352-467B-8421-C9EB35BD5596}.Release|Win32.Build.0 = Release|Win32 - {0914E5C8-5352-467B-8421-C9EB35BD5596}.Release|x64.ActiveCfg = Release|x64 - {0914E5C8-5352-467B-8421-C9EB35BD5596}.Release|x64.Build.0 = Release|x64 - {0914E5C8-5352-467B-8421-C9EB35BD5596}.SDL-Debug|Win32.ActiveCfg = Debug|Win32 - {0914E5C8-5352-467B-8421-C9EB35BD5596}.SDL-Debug|Win32.Build.0 = Debug|Win32 - {0914E5C8-5352-467B-8421-C9EB35BD5596}.SDL-Debug|x64.ActiveCfg = Debug|x64 - {0914E5C8-5352-467B-8421-C9EB35BD5596}.SDL-Debug|x64.Build.0 = Debug|x64 - {0914E5C8-5352-467B-8421-C9EB35BD5596}.Static lib - Debug|Win32.ActiveCfg = Debug|Win32 - {0914E5C8-5352-467B-8421-C9EB35BD5596}.Static lib - Debug|Win32.Build.0 = Debug|Win32 - {0914E5C8-5352-467B-8421-C9EB35BD5596}.Static lib - Debug|x64.ActiveCfg = Debug|x64 - {0914E5C8-5352-467B-8421-C9EB35BD5596}.Static lib - Debug|x64.Build.0 = Debug|x64 - {0914E5C8-5352-467B-8421-C9EB35BD5596}.Static lib - Release - Fast FPU|Win32.ActiveCfg = Release|Win32 - {0914E5C8-5352-467B-8421-C9EB35BD5596}.Static lib - Release - Fast FPU|Win32.Build.0 = Release|Win32 - {0914E5C8-5352-467B-8421-C9EB35BD5596}.Static lib - Release - Fast FPU|x64.ActiveCfg = Release|x64 - {0914E5C8-5352-467B-8421-C9EB35BD5596}.Static lib - Release - Fast FPU|x64.Build.0 = Release|x64 - {0914E5C8-5352-467B-8421-C9EB35BD5596}.Static lib - Release|Win32.ActiveCfg = Release|Win32 - {0914E5C8-5352-467B-8421-C9EB35BD5596}.Static lib - Release|Win32.Build.0 = Release|Win32 - {0914E5C8-5352-467B-8421-C9EB35BD5596}.Static lib - Release|x64.ActiveCfg = Release|x64 - {0914E5C8-5352-467B-8421-C9EB35BD5596}.Static lib - Release|x64.Build.0 = Release|x64 - {772FBE05-D05A-467B-9842-BEC409EEA8D0}.Debug|Win32.ActiveCfg = Debug|Win32 - {772FBE05-D05A-467B-9842-BEC409EEA8D0}.Debug|Win32.Build.0 = Debug|Win32 - {772FBE05-D05A-467B-9842-BEC409EEA8D0}.Debug|x64.ActiveCfg = Debug|x64 - {772FBE05-D05A-467B-9842-BEC409EEA8D0}.Debug|x64.Build.0 = Debug|x64 - {772FBE05-D05A-467B-9842-BEC409EEA8D0}.Release - Fast FPU|Win32.ActiveCfg = Release|Win32 - {772FBE05-D05A-467B-9842-BEC409EEA8D0}.Release - Fast FPU|Win32.Build.0 = Release|Win32 - {772FBE05-D05A-467B-9842-BEC409EEA8D0}.Release - Fast FPU|x64.ActiveCfg = Release|x64 - {772FBE05-D05A-467B-9842-BEC409EEA8D0}.Release - Fast FPU|x64.Build.0 = Release|x64 - {772FBE05-D05A-467B-9842-BEC409EEA8D0}.Release|Win32.ActiveCfg = Release|Win32 - {772FBE05-D05A-467B-9842-BEC409EEA8D0}.Release|Win32.Build.0 = Release|Win32 - {772FBE05-D05A-467B-9842-BEC409EEA8D0}.Release|x64.ActiveCfg = Release|x64 - {772FBE05-D05A-467B-9842-BEC409EEA8D0}.Release|x64.Build.0 = Release|x64 - {772FBE05-D05A-467B-9842-BEC409EEA8D0}.SDL-Debug|Win32.ActiveCfg = Debug|Win32 - {772FBE05-D05A-467B-9842-BEC409EEA8D0}.SDL-Debug|Win32.Build.0 = Debug|Win32 - {772FBE05-D05A-467B-9842-BEC409EEA8D0}.SDL-Debug|x64.ActiveCfg = Debug|x64 - {772FBE05-D05A-467B-9842-BEC409EEA8D0}.SDL-Debug|x64.Build.0 = Debug|x64 - {772FBE05-D05A-467B-9842-BEC409EEA8D0}.Static lib - Debug|Win32.ActiveCfg = Debug|Win32 - {772FBE05-D05A-467B-9842-BEC409EEA8D0}.Static lib - Debug|Win32.Build.0 = Debug|Win32 - {772FBE05-D05A-467B-9842-BEC409EEA8D0}.Static lib - Debug|x64.ActiveCfg = Debug|x64 - {772FBE05-D05A-467B-9842-BEC409EEA8D0}.Static lib - Debug|x64.Build.0 = Debug|x64 - {772FBE05-D05A-467B-9842-BEC409EEA8D0}.Static lib - Release - Fast FPU|Win32.ActiveCfg = Release|Win32 - {772FBE05-D05A-467B-9842-BEC409EEA8D0}.Static lib - Release - Fast FPU|Win32.Build.0 = Release|Win32 - {772FBE05-D05A-467B-9842-BEC409EEA8D0}.Static lib - Release - Fast FPU|x64.ActiveCfg = Release|x64 - {772FBE05-D05A-467B-9842-BEC409EEA8D0}.Static lib - Release - Fast FPU|x64.Build.0 = Release|x64 - {772FBE05-D05A-467B-9842-BEC409EEA8D0}.Static lib - Release|Win32.ActiveCfg = Release|Win32 - {772FBE05-D05A-467B-9842-BEC409EEA8D0}.Static lib - Release|Win32.Build.0 = Release|Win32 - {772FBE05-D05A-467B-9842-BEC409EEA8D0}.Static lib - Release|x64.ActiveCfg = Release|x64 - {772FBE05-D05A-467B-9842-BEC409EEA8D0}.Static lib - Release|x64.Build.0 = Release|x64 - {78C9F424-523C-49AC-94B7-823AA4A26BF9}.Debug|Win32.ActiveCfg = Debug|Win32 - {78C9F424-523C-49AC-94B7-823AA4A26BF9}.Debug|Win32.Build.0 = Debug|Win32 - {78C9F424-523C-49AC-94B7-823AA4A26BF9}.Debug|x64.ActiveCfg = Debug|x64 - {78C9F424-523C-49AC-94B7-823AA4A26BF9}.Debug|x64.Build.0 = Debug|x64 - {78C9F424-523C-49AC-94B7-823AA4A26BF9}.Release - Fast FPU|Win32.ActiveCfg = Release|Win32 - {78C9F424-523C-49AC-94B7-823AA4A26BF9}.Release - Fast FPU|Win32.Build.0 = Release|Win32 - {78C9F424-523C-49AC-94B7-823AA4A26BF9}.Release - Fast FPU|x64.ActiveCfg = Release|x64 - {78C9F424-523C-49AC-94B7-823AA4A26BF9}.Release - Fast FPU|x64.Build.0 = Release|x64 - {78C9F424-523C-49AC-94B7-823AA4A26BF9}.Release|Win32.ActiveCfg = Release|Win32 - {78C9F424-523C-49AC-94B7-823AA4A26BF9}.Release|Win32.Build.0 = Release|Win32 - {78C9F424-523C-49AC-94B7-823AA4A26BF9}.Release|x64.ActiveCfg = Release|x64 - {78C9F424-523C-49AC-94B7-823AA4A26BF9}.Release|x64.Build.0 = Release|x64 - {78C9F424-523C-49AC-94B7-823AA4A26BF9}.SDL-Debug|Win32.ActiveCfg = Debug|Win32 - {78C9F424-523C-49AC-94B7-823AA4A26BF9}.SDL-Debug|Win32.Build.0 = Debug|Win32 - {78C9F424-523C-49AC-94B7-823AA4A26BF9}.SDL-Debug|x64.ActiveCfg = Debug|x64 - {78C9F424-523C-49AC-94B7-823AA4A26BF9}.SDL-Debug|x64.Build.0 = Debug|x64 - {78C9F424-523C-49AC-94B7-823AA4A26BF9}.Static lib - Debug|Win32.ActiveCfg = Debug|Win32 - {78C9F424-523C-49AC-94B7-823AA4A26BF9}.Static lib - Debug|Win32.Build.0 = Debug|Win32 - {78C9F424-523C-49AC-94B7-823AA4A26BF9}.Static lib - Debug|x64.ActiveCfg = Debug|x64 - {78C9F424-523C-49AC-94B7-823AA4A26BF9}.Static lib - Debug|x64.Build.0 = Debug|x64 - {78C9F424-523C-49AC-94B7-823AA4A26BF9}.Static lib - Release - Fast FPU|Win32.ActiveCfg = Release|Win32 - {78C9F424-523C-49AC-94B7-823AA4A26BF9}.Static lib - Release - Fast FPU|Win32.Build.0 = Release|Win32 - {78C9F424-523C-49AC-94B7-823AA4A26BF9}.Static lib - Release - Fast FPU|x64.ActiveCfg = Release|x64 - {78C9F424-523C-49AC-94B7-823AA4A26BF9}.Static lib - Release - Fast FPU|x64.Build.0 = Release|x64 - {78C9F424-523C-49AC-94B7-823AA4A26BF9}.Static lib - Release|Win32.ActiveCfg = Release|Win32 - {78C9F424-523C-49AC-94B7-823AA4A26BF9}.Static lib - Release|Win32.Build.0 = Release|Win32 - {78C9F424-523C-49AC-94B7-823AA4A26BF9}.Static lib - Release|x64.ActiveCfg = Release|x64 - {78C9F424-523C-49AC-94B7-823AA4A26BF9}.Static lib - Release|x64.Build.0 = Release|x64 - {EB3B38EA-5CE7-4983-845B-880661E69D09}.Debug|Win32.ActiveCfg = Debug|Win32 - {EB3B38EA-5CE7-4983-845B-880661E69D09}.Debug|Win32.Build.0 = Debug|Win32 - {EB3B38EA-5CE7-4983-845B-880661E69D09}.Debug|x64.ActiveCfg = Debug|x64 - {EB3B38EA-5CE7-4983-845B-880661E69D09}.Debug|x64.Build.0 = Debug|x64 - {EB3B38EA-5CE7-4983-845B-880661E69D09}.Release - Fast FPU|Win32.ActiveCfg = Release|Win32 - {EB3B38EA-5CE7-4983-845B-880661E69D09}.Release - Fast FPU|Win32.Build.0 = Release|Win32 - {EB3B38EA-5CE7-4983-845B-880661E69D09}.Release - Fast FPU|x64.ActiveCfg = Release|x64 - {EB3B38EA-5CE7-4983-845B-880661E69D09}.Release - Fast FPU|x64.Build.0 = Release|x64 - {EB3B38EA-5CE7-4983-845B-880661E69D09}.Release|Win32.ActiveCfg = Release|Win32 - {EB3B38EA-5CE7-4983-845B-880661E69D09}.Release|Win32.Build.0 = Release|Win32 - {EB3B38EA-5CE7-4983-845B-880661E69D09}.Release|x64.ActiveCfg = Release|x64 - {EB3B38EA-5CE7-4983-845B-880661E69D09}.Release|x64.Build.0 = Release|x64 - {EB3B38EA-5CE7-4983-845B-880661E69D09}.SDL-Debug|Win32.ActiveCfg = Debug|Win32 - {EB3B38EA-5CE7-4983-845B-880661E69D09}.SDL-Debug|Win32.Build.0 = Debug|Win32 - {EB3B38EA-5CE7-4983-845B-880661E69D09}.SDL-Debug|x64.ActiveCfg = Debug|x64 - {EB3B38EA-5CE7-4983-845B-880661E69D09}.SDL-Debug|x64.Build.0 = Debug|x64 - {EB3B38EA-5CE7-4983-845B-880661E69D09}.Static lib - Debug|Win32.ActiveCfg = Debug|Win32 - {EB3B38EA-5CE7-4983-845B-880661E69D09}.Static lib - Debug|Win32.Build.0 = Debug|Win32 - {EB3B38EA-5CE7-4983-845B-880661E69D09}.Static lib - Debug|x64.ActiveCfg = Debug|x64 - {EB3B38EA-5CE7-4983-845B-880661E69D09}.Static lib - Debug|x64.Build.0 = Debug|x64 - {EB3B38EA-5CE7-4983-845B-880661E69D09}.Static lib - Release - Fast FPU|Win32.ActiveCfg = Release|Win32 - {EB3B38EA-5CE7-4983-845B-880661E69D09}.Static lib - Release - Fast FPU|Win32.Build.0 = Release|Win32 - {EB3B38EA-5CE7-4983-845B-880661E69D09}.Static lib - Release - Fast FPU|x64.ActiveCfg = Release|x64 - {EB3B38EA-5CE7-4983-845B-880661E69D09}.Static lib - Release - Fast FPU|x64.Build.0 = Release|x64 - {EB3B38EA-5CE7-4983-845B-880661E69D09}.Static lib - Release|Win32.ActiveCfg = Release|Win32 - {EB3B38EA-5CE7-4983-845B-880661E69D09}.Static lib - Release|Win32.Build.0 = Release|Win32 - {EB3B38EA-5CE7-4983-845B-880661E69D09}.Static lib - Release|x64.ActiveCfg = Release|x64 - {EB3B38EA-5CE7-4983-845B-880661E69D09}.Static lib - Release|x64.Build.0 = Release|x64 - {2A29B6B1-AFC4-46C7-9944-7052AAE66F7B}.Debug|Win32.ActiveCfg = Debug|Win32 - {2A29B6B1-AFC4-46C7-9944-7052AAE66F7B}.Debug|Win32.Build.0 = Debug|Win32 - {2A29B6B1-AFC4-46C7-9944-7052AAE66F7B}.Debug|x64.ActiveCfg = Debug|x64 - {2A29B6B1-AFC4-46C7-9944-7052AAE66F7B}.Debug|x64.Build.0 = Debug|x64 - {2A29B6B1-AFC4-46C7-9944-7052AAE66F7B}.Release - Fast FPU|Win32.ActiveCfg = Release|Win32 - {2A29B6B1-AFC4-46C7-9944-7052AAE66F7B}.Release - Fast FPU|Win32.Build.0 = Release|Win32 - {2A29B6B1-AFC4-46C7-9944-7052AAE66F7B}.Release - Fast FPU|x64.ActiveCfg = Release|x64 - {2A29B6B1-AFC4-46C7-9944-7052AAE66F7B}.Release - Fast FPU|x64.Build.0 = Release|x64 - {2A29B6B1-AFC4-46C7-9944-7052AAE66F7B}.Release|Win32.ActiveCfg = Release|Win32 - {2A29B6B1-AFC4-46C7-9944-7052AAE66F7B}.Release|Win32.Build.0 = Release|Win32 - {2A29B6B1-AFC4-46C7-9944-7052AAE66F7B}.Release|x64.ActiveCfg = Release|x64 - {2A29B6B1-AFC4-46C7-9944-7052AAE66F7B}.Release|x64.Build.0 = Release|x64 - {2A29B6B1-AFC4-46C7-9944-7052AAE66F7B}.SDL-Debug|Win32.ActiveCfg = Debug|Win32 - {2A29B6B1-AFC4-46C7-9944-7052AAE66F7B}.SDL-Debug|Win32.Build.0 = Debug|Win32 - {2A29B6B1-AFC4-46C7-9944-7052AAE66F7B}.SDL-Debug|x64.ActiveCfg = Debug|x64 - {2A29B6B1-AFC4-46C7-9944-7052AAE66F7B}.SDL-Debug|x64.Build.0 = Debug|x64 - {2A29B6B1-AFC4-46C7-9944-7052AAE66F7B}.Static lib - Debug|Win32.ActiveCfg = Debug|Win32 - {2A29B6B1-AFC4-46C7-9944-7052AAE66F7B}.Static lib - Debug|Win32.Build.0 = Debug|Win32 - {2A29B6B1-AFC4-46C7-9944-7052AAE66F7B}.Static lib - Debug|x64.ActiveCfg = Debug|x64 - {2A29B6B1-AFC4-46C7-9944-7052AAE66F7B}.Static lib - Debug|x64.Build.0 = Debug|x64 - {2A29B6B1-AFC4-46C7-9944-7052AAE66F7B}.Static lib - Release - Fast FPU|Win32.ActiveCfg = Release|Win32 - {2A29B6B1-AFC4-46C7-9944-7052AAE66F7B}.Static lib - Release - Fast FPU|Win32.Build.0 = Release|Win32 - {2A29B6B1-AFC4-46C7-9944-7052AAE66F7B}.Static lib - Release - Fast FPU|x64.ActiveCfg = Release|x64 - {2A29B6B1-AFC4-46C7-9944-7052AAE66F7B}.Static lib - Release - Fast FPU|x64.Build.0 = Release|x64 - {2A29B6B1-AFC4-46C7-9944-7052AAE66F7B}.Static lib - Release|Win32.ActiveCfg = Release|Win32 - {2A29B6B1-AFC4-46C7-9944-7052AAE66F7B}.Static lib - Release|Win32.Build.0 = Release|Win32 - {2A29B6B1-AFC4-46C7-9944-7052AAE66F7B}.Static lib - Release|x64.ActiveCfg = Release|x64 - {2A29B6B1-AFC4-46C7-9944-7052AAE66F7B}.Static lib - Release|x64.Build.0 = Release|x64 - {1AB9413E-4F53-42A3-8CB2-CB4BE22336D0}.Debug|Win32.ActiveCfg = Debug|Win32 - {1AB9413E-4F53-42A3-8CB2-CB4BE22336D0}.Debug|Win32.Build.0 = Debug|Win32 - {1AB9413E-4F53-42A3-8CB2-CB4BE22336D0}.Debug|x64.ActiveCfg = Debug|x64 - {1AB9413E-4F53-42A3-8CB2-CB4BE22336D0}.Debug|x64.Build.0 = Debug|x64 - {1AB9413E-4F53-42A3-8CB2-CB4BE22336D0}.Release - Fast FPU|Win32.ActiveCfg = Release|Win32 - {1AB9413E-4F53-42A3-8CB2-CB4BE22336D0}.Release - Fast FPU|Win32.Build.0 = Release|Win32 - {1AB9413E-4F53-42A3-8CB2-CB4BE22336D0}.Release - Fast FPU|x64.ActiveCfg = Release|x64 - {1AB9413E-4F53-42A3-8CB2-CB4BE22336D0}.Release - Fast FPU|x64.Build.0 = Release|x64 - {1AB9413E-4F53-42A3-8CB2-CB4BE22336D0}.Release|Win32.ActiveCfg = Release|Win32 - {1AB9413E-4F53-42A3-8CB2-CB4BE22336D0}.Release|Win32.Build.0 = Release|Win32 - {1AB9413E-4F53-42A3-8CB2-CB4BE22336D0}.Release|x64.ActiveCfg = Release|x64 - {1AB9413E-4F53-42A3-8CB2-CB4BE22336D0}.Release|x64.Build.0 = Release|x64 - {1AB9413E-4F53-42A3-8CB2-CB4BE22336D0}.SDL-Debug|Win32.ActiveCfg = Debug|Win32 - {1AB9413E-4F53-42A3-8CB2-CB4BE22336D0}.SDL-Debug|Win32.Build.0 = Debug|Win32 - {1AB9413E-4F53-42A3-8CB2-CB4BE22336D0}.SDL-Debug|x64.ActiveCfg = Debug|x64 - {1AB9413E-4F53-42A3-8CB2-CB4BE22336D0}.SDL-Debug|x64.Build.0 = Debug|x64 - {1AB9413E-4F53-42A3-8CB2-CB4BE22336D0}.Static lib - Debug|Win32.ActiveCfg = Debug|Win32 - {1AB9413E-4F53-42A3-8CB2-CB4BE22336D0}.Static lib - Debug|Win32.Build.0 = Debug|Win32 - {1AB9413E-4F53-42A3-8CB2-CB4BE22336D0}.Static lib - Debug|x64.ActiveCfg = Debug|x64 - {1AB9413E-4F53-42A3-8CB2-CB4BE22336D0}.Static lib - Debug|x64.Build.0 = Debug|x64 - {1AB9413E-4F53-42A3-8CB2-CB4BE22336D0}.Static lib - Release - Fast FPU|Win32.ActiveCfg = Release|Win32 - {1AB9413E-4F53-42A3-8CB2-CB4BE22336D0}.Static lib - Release - Fast FPU|Win32.Build.0 = Release|Win32 - {1AB9413E-4F53-42A3-8CB2-CB4BE22336D0}.Static lib - Release - Fast FPU|x64.ActiveCfg = Release|x64 - {1AB9413E-4F53-42A3-8CB2-CB4BE22336D0}.Static lib - Release - Fast FPU|x64.Build.0 = Release|x64 - {1AB9413E-4F53-42A3-8CB2-CB4BE22336D0}.Static lib - Release|Win32.ActiveCfg = Release|Win32 - {1AB9413E-4F53-42A3-8CB2-CB4BE22336D0}.Static lib - Release|Win32.Build.0 = Release|Win32 - {1AB9413E-4F53-42A3-8CB2-CB4BE22336D0}.Static lib - Release|x64.ActiveCfg = Release|x64 - {1AB9413E-4F53-42A3-8CB2-CB4BE22336D0}.Static lib - Release|x64.Build.0 = Release|x64 - {FE853A36-E0D1-4AC5-A792-B643E70D2953}.Debug|Win32.ActiveCfg = Debug|Win32 - {FE853A36-E0D1-4AC5-A792-B643E70D2953}.Debug|Win32.Build.0 = Debug|Win32 - {FE853A36-E0D1-4AC5-A792-B643E70D2953}.Debug|x64.ActiveCfg = Debug|x64 - {FE853A36-E0D1-4AC5-A792-B643E70D2953}.Debug|x64.Build.0 = Debug|x64 - {FE853A36-E0D1-4AC5-A792-B643E70D2953}.Release - Fast FPU|Win32.ActiveCfg = Release|Win32 - {FE853A36-E0D1-4AC5-A792-B643E70D2953}.Release - Fast FPU|Win32.Build.0 = Release|Win32 - {FE853A36-E0D1-4AC5-A792-B643E70D2953}.Release - Fast FPU|x64.ActiveCfg = Release|x64 - {FE853A36-E0D1-4AC5-A792-B643E70D2953}.Release - Fast FPU|x64.Build.0 = Release|x64 - {FE853A36-E0D1-4AC5-A792-B643E70D2953}.Release|Win32.ActiveCfg = Release|Win32 - {FE853A36-E0D1-4AC5-A792-B643E70D2953}.Release|Win32.Build.0 = Release|Win32 - {FE853A36-E0D1-4AC5-A792-B643E70D2953}.Release|x64.ActiveCfg = Release|x64 - {FE853A36-E0D1-4AC5-A792-B643E70D2953}.Release|x64.Build.0 = Release|x64 - {FE853A36-E0D1-4AC5-A792-B643E70D2953}.SDL-Debug|Win32.ActiveCfg = Debug|Win32 - {FE853A36-E0D1-4AC5-A792-B643E70D2953}.SDL-Debug|Win32.Build.0 = Debug|Win32 - {FE853A36-E0D1-4AC5-A792-B643E70D2953}.SDL-Debug|x64.ActiveCfg = Debug|x64 - {FE853A36-E0D1-4AC5-A792-B643E70D2953}.SDL-Debug|x64.Build.0 = Debug|x64 - {FE853A36-E0D1-4AC5-A792-B643E70D2953}.Static lib - Debug|Win32.ActiveCfg = Debug|Win32 - {FE853A36-E0D1-4AC5-A792-B643E70D2953}.Static lib - Debug|Win32.Build.0 = Debug|Win32 - {FE853A36-E0D1-4AC5-A792-B643E70D2953}.Static lib - Debug|x64.ActiveCfg = Debug|x64 - {FE853A36-E0D1-4AC5-A792-B643E70D2953}.Static lib - Debug|x64.Build.0 = Debug|x64 - {FE853A36-E0D1-4AC5-A792-B643E70D2953}.Static lib - Release - Fast FPU|Win32.ActiveCfg = Release|Win32 - {FE853A36-E0D1-4AC5-A792-B643E70D2953}.Static lib - Release - Fast FPU|Win32.Build.0 = Release|Win32 - {FE853A36-E0D1-4AC5-A792-B643E70D2953}.Static lib - Release - Fast FPU|x64.ActiveCfg = Release|x64 - {FE853A36-E0D1-4AC5-A792-B643E70D2953}.Static lib - Release - Fast FPU|x64.Build.0 = Release|x64 - {FE853A36-E0D1-4AC5-A792-B643E70D2953}.Static lib - Release|Win32.ActiveCfg = Release|Win32 - {FE853A36-E0D1-4AC5-A792-B643E70D2953}.Static lib - Release|Win32.Build.0 = Release|Win32 - {FE853A36-E0D1-4AC5-A792-B643E70D2953}.Static lib - Release|x64.ActiveCfg = Release|x64 - {FE853A36-E0D1-4AC5-A792-B643E70D2953}.Static lib - Release|x64.Build.0 = Release|x64 - {16007FE2-142B-47F8-93E1-519BA3F39E71}.Debug|Win32.ActiveCfg = Debug|Win32 - {16007FE2-142B-47F8-93E1-519BA3F39E71}.Debug|Win32.Build.0 = Debug|Win32 - {16007FE2-142B-47F8-93E1-519BA3F39E71}.Debug|x64.ActiveCfg = Debug|x64 - {16007FE2-142B-47F8-93E1-519BA3F39E71}.Debug|x64.Build.0 = Debug|x64 - {16007FE2-142B-47F8-93E1-519BA3F39E71}.Release - Fast FPU|Win32.ActiveCfg = Release|Win32 - {16007FE2-142B-47F8-93E1-519BA3F39E71}.Release - Fast FPU|Win32.Build.0 = Release|Win32 - {16007FE2-142B-47F8-93E1-519BA3F39E71}.Release - Fast FPU|x64.ActiveCfg = Release|x64 - {16007FE2-142B-47F8-93E1-519BA3F39E71}.Release - Fast FPU|x64.Build.0 = Release|x64 - {16007FE2-142B-47F8-93E1-519BA3F39E71}.Release|Win32.ActiveCfg = Release|Win32 - {16007FE2-142B-47F8-93E1-519BA3F39E71}.Release|Win32.Build.0 = Release|Win32 - {16007FE2-142B-47F8-93E1-519BA3F39E71}.Release|x64.ActiveCfg = Release|x64 - {16007FE2-142B-47F8-93E1-519BA3F39E71}.Release|x64.Build.0 = Release|x64 - {16007FE2-142B-47F8-93E1-519BA3F39E71}.SDL-Debug|Win32.ActiveCfg = Debug|Win32 - {16007FE2-142B-47F8-93E1-519BA3F39E71}.SDL-Debug|Win32.Build.0 = Debug|Win32 - {16007FE2-142B-47F8-93E1-519BA3F39E71}.SDL-Debug|x64.ActiveCfg = Debug|x64 - {16007FE2-142B-47F8-93E1-519BA3F39E71}.SDL-Debug|x64.Build.0 = Debug|x64 - {16007FE2-142B-47F8-93E1-519BA3F39E71}.Static lib - Debug|Win32.ActiveCfg = Debug|Win32 - {16007FE2-142B-47F8-93E1-519BA3F39E71}.Static lib - Debug|Win32.Build.0 = Debug|Win32 - {16007FE2-142B-47F8-93E1-519BA3F39E71}.Static lib - Debug|x64.ActiveCfg = Debug|x64 - {16007FE2-142B-47F8-93E1-519BA3F39E71}.Static lib - Debug|x64.Build.0 = Debug|x64 - {16007FE2-142B-47F8-93E1-519BA3F39E71}.Static lib - Release - Fast FPU|Win32.ActiveCfg = Release|Win32 - {16007FE2-142B-47F8-93E1-519BA3F39E71}.Static lib - Release - Fast FPU|Win32.Build.0 = Release|Win32 - {16007FE2-142B-47F8-93E1-519BA3F39E71}.Static lib - Release - Fast FPU|x64.ActiveCfg = Release|x64 - {16007FE2-142B-47F8-93E1-519BA3F39E71}.Static lib - Release - Fast FPU|x64.Build.0 = Release|x64 - {16007FE2-142B-47F8-93E1-519BA3F39E71}.Static lib - Release|Win32.ActiveCfg = Release|Win32 - {16007FE2-142B-47F8-93E1-519BA3F39E71}.Static lib - Release|Win32.Build.0 = Release|Win32 - {16007FE2-142B-47F8-93E1-519BA3F39E71}.Static lib - Release|x64.ActiveCfg = Release|x64 - {16007FE2-142B-47F8-93E1-519BA3F39E71}.Static lib - Release|x64.Build.0 = Release|x64 - {CDC4AAA9-72E1-4FFA-A04D-7EF59D8B97CD}.Debug|Win32.ActiveCfg = Debug|Win32 - {CDC4AAA9-72E1-4FFA-A04D-7EF59D8B97CD}.Debug|Win32.Build.0 = Debug|Win32 - {CDC4AAA9-72E1-4FFA-A04D-7EF59D8B97CD}.Debug|x64.ActiveCfg = Debug|x64 - {CDC4AAA9-72E1-4FFA-A04D-7EF59D8B97CD}.Debug|x64.Build.0 = Debug|x64 - {CDC4AAA9-72E1-4FFA-A04D-7EF59D8B97CD}.Release - Fast FPU|Win32.ActiveCfg = Release|Win32 - {CDC4AAA9-72E1-4FFA-A04D-7EF59D8B97CD}.Release - Fast FPU|Win32.Build.0 = Release|Win32 - {CDC4AAA9-72E1-4FFA-A04D-7EF59D8B97CD}.Release - Fast FPU|x64.ActiveCfg = Release|x64 - {CDC4AAA9-72E1-4FFA-A04D-7EF59D8B97CD}.Release - Fast FPU|x64.Build.0 = Release|x64 - {CDC4AAA9-72E1-4FFA-A04D-7EF59D8B97CD}.Release|Win32.ActiveCfg = Release|Win32 - {CDC4AAA9-72E1-4FFA-A04D-7EF59D8B97CD}.Release|Win32.Build.0 = Release|Win32 - {CDC4AAA9-72E1-4FFA-A04D-7EF59D8B97CD}.Release|x64.ActiveCfg = Release|x64 - {CDC4AAA9-72E1-4FFA-A04D-7EF59D8B97CD}.Release|x64.Build.0 = Release|x64 - {CDC4AAA9-72E1-4FFA-A04D-7EF59D8B97CD}.SDL-Debug|Win32.ActiveCfg = Debug|Win32 - {CDC4AAA9-72E1-4FFA-A04D-7EF59D8B97CD}.SDL-Debug|Win32.Build.0 = Debug|Win32 - {CDC4AAA9-72E1-4FFA-A04D-7EF59D8B97CD}.SDL-Debug|x64.ActiveCfg = Debug|x64 - {CDC4AAA9-72E1-4FFA-A04D-7EF59D8B97CD}.SDL-Debug|x64.Build.0 = Debug|x64 - {CDC4AAA9-72E1-4FFA-A04D-7EF59D8B97CD}.Static lib - Debug|Win32.ActiveCfg = Debug|Win32 - {CDC4AAA9-72E1-4FFA-A04D-7EF59D8B97CD}.Static lib - Debug|Win32.Build.0 = Debug|Win32 - {CDC4AAA9-72E1-4FFA-A04D-7EF59D8B97CD}.Static lib - Debug|x64.ActiveCfg = Debug|x64 - {CDC4AAA9-72E1-4FFA-A04D-7EF59D8B97CD}.Static lib - Debug|x64.Build.0 = Debug|x64 - {CDC4AAA9-72E1-4FFA-A04D-7EF59D8B97CD}.Static lib - Release - Fast FPU|Win32.ActiveCfg = Release|Win32 - {CDC4AAA9-72E1-4FFA-A04D-7EF59D8B97CD}.Static lib - Release - Fast FPU|Win32.Build.0 = Release|Win32 - {CDC4AAA9-72E1-4FFA-A04D-7EF59D8B97CD}.Static lib - Release - Fast FPU|x64.ActiveCfg = Release|x64 - {CDC4AAA9-72E1-4FFA-A04D-7EF59D8B97CD}.Static lib - Release - Fast FPU|x64.Build.0 = Release|x64 - {CDC4AAA9-72E1-4FFA-A04D-7EF59D8B97CD}.Static lib - Release|Win32.ActiveCfg = Release|Win32 - {CDC4AAA9-72E1-4FFA-A04D-7EF59D8B97CD}.Static lib - Release|Win32.Build.0 = Release|Win32 - {CDC4AAA9-72E1-4FFA-A04D-7EF59D8B97CD}.Static lib - Release|x64.ActiveCfg = Release|x64 - {CDC4AAA9-72E1-4FFA-A04D-7EF59D8B97CD}.Static lib - Release|x64.Build.0 = Release|x64 - {4E6C2F8D-BA92-4C5B-96FD-72D4FE8BD7FA}.Debug|Win32.ActiveCfg = Debug|Win32 - {4E6C2F8D-BA92-4C5B-96FD-72D4FE8BD7FA}.Debug|Win32.Build.0 = Debug|Win32 - {4E6C2F8D-BA92-4C5B-96FD-72D4FE8BD7FA}.Debug|x64.ActiveCfg = Debug|x64 - {4E6C2F8D-BA92-4C5B-96FD-72D4FE8BD7FA}.Debug|x64.Build.0 = Debug|x64 - {4E6C2F8D-BA92-4C5B-96FD-72D4FE8BD7FA}.Release - Fast FPU|Win32.ActiveCfg = Release|Win32 - {4E6C2F8D-BA92-4C5B-96FD-72D4FE8BD7FA}.Release - Fast FPU|Win32.Build.0 = Release|Win32 - {4E6C2F8D-BA92-4C5B-96FD-72D4FE8BD7FA}.Release - Fast FPU|x64.ActiveCfg = Release|x64 - {4E6C2F8D-BA92-4C5B-96FD-72D4FE8BD7FA}.Release - Fast FPU|x64.Build.0 = Release|x64 - {4E6C2F8D-BA92-4C5B-96FD-72D4FE8BD7FA}.Release|Win32.ActiveCfg = Release|Win32 - {4E6C2F8D-BA92-4C5B-96FD-72D4FE8BD7FA}.Release|Win32.Build.0 = Release|Win32 - {4E6C2F8D-BA92-4C5B-96FD-72D4FE8BD7FA}.Release|x64.ActiveCfg = Release|x64 - {4E6C2F8D-BA92-4C5B-96FD-72D4FE8BD7FA}.Release|x64.Build.0 = Release|x64 - {4E6C2F8D-BA92-4C5B-96FD-72D4FE8BD7FA}.SDL-Debug|Win32.ActiveCfg = Debug|Win32 - {4E6C2F8D-BA92-4C5B-96FD-72D4FE8BD7FA}.SDL-Debug|Win32.Build.0 = Debug|Win32 - {4E6C2F8D-BA92-4C5B-96FD-72D4FE8BD7FA}.SDL-Debug|x64.ActiveCfg = Debug|x64 - {4E6C2F8D-BA92-4C5B-96FD-72D4FE8BD7FA}.SDL-Debug|x64.Build.0 = Debug|x64 - {4E6C2F8D-BA92-4C5B-96FD-72D4FE8BD7FA}.Static lib - Debug|Win32.ActiveCfg = Debug|Win32 - {4E6C2F8D-BA92-4C5B-96FD-72D4FE8BD7FA}.Static lib - Debug|Win32.Build.0 = Debug|Win32 - {4E6C2F8D-BA92-4C5B-96FD-72D4FE8BD7FA}.Static lib - Debug|x64.ActiveCfg = Debug|x64 - {4E6C2F8D-BA92-4C5B-96FD-72D4FE8BD7FA}.Static lib - Debug|x64.Build.0 = Debug|x64 - {4E6C2F8D-BA92-4C5B-96FD-72D4FE8BD7FA}.Static lib - Release - Fast FPU|Win32.ActiveCfg = Release|Win32 - {4E6C2F8D-BA92-4C5B-96FD-72D4FE8BD7FA}.Static lib - Release - Fast FPU|Win32.Build.0 = Release|Win32 - {4E6C2F8D-BA92-4C5B-96FD-72D4FE8BD7FA}.Static lib - Release - Fast FPU|x64.ActiveCfg = Release|x64 - {4E6C2F8D-BA92-4C5B-96FD-72D4FE8BD7FA}.Static lib - Release - Fast FPU|x64.Build.0 = Release|x64 - {4E6C2F8D-BA92-4C5B-96FD-72D4FE8BD7FA}.Static lib - Release|Win32.ActiveCfg = Release|Win32 - {4E6C2F8D-BA92-4C5B-96FD-72D4FE8BD7FA}.Static lib - Release|Win32.Build.0 = Release|Win32 - {4E6C2F8D-BA92-4C5B-96FD-72D4FE8BD7FA}.Static lib - Release|x64.ActiveCfg = Release|x64 - {4E6C2F8D-BA92-4C5B-96FD-72D4FE8BD7FA}.Static lib - Release|x64.Build.0 = Release|x64 - {6AEC2AA2-C9FF-4B7D-B07A-94A9D34B41D7}.Debug|Win32.ActiveCfg = Debug|Win32 - {6AEC2AA2-C9FF-4B7D-B07A-94A9D34B41D7}.Debug|Win32.Build.0 = Debug|Win32 - {6AEC2AA2-C9FF-4B7D-B07A-94A9D34B41D7}.Debug|x64.ActiveCfg = Debug|x64 - {6AEC2AA2-C9FF-4B7D-B07A-94A9D34B41D7}.Debug|x64.Build.0 = Debug|x64 - {6AEC2AA2-C9FF-4B7D-B07A-94A9D34B41D7}.Release - Fast FPU|Win32.ActiveCfg = Release|Win32 - {6AEC2AA2-C9FF-4B7D-B07A-94A9D34B41D7}.Release - Fast FPU|Win32.Build.0 = Release|Win32 - {6AEC2AA2-C9FF-4B7D-B07A-94A9D34B41D7}.Release - Fast FPU|x64.ActiveCfg = Release|x64 - {6AEC2AA2-C9FF-4B7D-B07A-94A9D34B41D7}.Release - Fast FPU|x64.Build.0 = Release|x64 - {6AEC2AA2-C9FF-4B7D-B07A-94A9D34B41D7}.Release|Win32.ActiveCfg = Release|Win32 - {6AEC2AA2-C9FF-4B7D-B07A-94A9D34B41D7}.Release|Win32.Build.0 = Release|Win32 - {6AEC2AA2-C9FF-4B7D-B07A-94A9D34B41D7}.Release|x64.ActiveCfg = Release|x64 - {6AEC2AA2-C9FF-4B7D-B07A-94A9D34B41D7}.Release|x64.Build.0 = Release|x64 - {6AEC2AA2-C9FF-4B7D-B07A-94A9D34B41D7}.SDL-Debug|Win32.ActiveCfg = Debug|Win32 - {6AEC2AA2-C9FF-4B7D-B07A-94A9D34B41D7}.SDL-Debug|Win32.Build.0 = Debug|Win32 - {6AEC2AA2-C9FF-4B7D-B07A-94A9D34B41D7}.SDL-Debug|x64.ActiveCfg = Debug|x64 - {6AEC2AA2-C9FF-4B7D-B07A-94A9D34B41D7}.SDL-Debug|x64.Build.0 = Debug|x64 - {6AEC2AA2-C9FF-4B7D-B07A-94A9D34B41D7}.Static lib - Debug|Win32.ActiveCfg = Debug|Win32 - {6AEC2AA2-C9FF-4B7D-B07A-94A9D34B41D7}.Static lib - Debug|Win32.Build.0 = Debug|Win32 - {6AEC2AA2-C9FF-4B7D-B07A-94A9D34B41D7}.Static lib - Debug|x64.ActiveCfg = Debug|x64 - {6AEC2AA2-C9FF-4B7D-B07A-94A9D34B41D7}.Static lib - Debug|x64.Build.0 = Debug|x64 - {6AEC2AA2-C9FF-4B7D-B07A-94A9D34B41D7}.Static lib - Release - Fast FPU|Win32.ActiveCfg = Release|Win32 - {6AEC2AA2-C9FF-4B7D-B07A-94A9D34B41D7}.Static lib - Release - Fast FPU|Win32.Build.0 = Release|Win32 - {6AEC2AA2-C9FF-4B7D-B07A-94A9D34B41D7}.Static lib - Release - Fast FPU|x64.ActiveCfg = Release|x64 - {6AEC2AA2-C9FF-4B7D-B07A-94A9D34B41D7}.Static lib - Release - Fast FPU|x64.Build.0 = Release|x64 - {6AEC2AA2-C9FF-4B7D-B07A-94A9D34B41D7}.Static lib - Release|Win32.ActiveCfg = Release|Win32 - {6AEC2AA2-C9FF-4B7D-B07A-94A9D34B41D7}.Static lib - Release|Win32.Build.0 = Release|Win32 - {6AEC2AA2-C9FF-4B7D-B07A-94A9D34B41D7}.Static lib - Release|x64.ActiveCfg = Release|x64 - {6AEC2AA2-C9FF-4B7D-B07A-94A9D34B41D7}.Static lib - Release|x64.Build.0 = Release|x64 - {02B67A37-50E1-49DB-BECF-905BC029C2FE}.Debug|Win32.ActiveCfg = Debug|Win32 - {02B67A37-50E1-49DB-BECF-905BC029C2FE}.Debug|Win32.Build.0 = Debug|Win32 - {02B67A37-50E1-49DB-BECF-905BC029C2FE}.Debug|x64.ActiveCfg = Debug|x64 - {02B67A37-50E1-49DB-BECF-905BC029C2FE}.Debug|x64.Build.0 = Debug|x64 - {02B67A37-50E1-49DB-BECF-905BC029C2FE}.Release - Fast FPU|Win32.ActiveCfg = Release|Win32 - {02B67A37-50E1-49DB-BECF-905BC029C2FE}.Release - Fast FPU|Win32.Build.0 = Release|Win32 - {02B67A37-50E1-49DB-BECF-905BC029C2FE}.Release - Fast FPU|x64.ActiveCfg = Release|x64 - {02B67A37-50E1-49DB-BECF-905BC029C2FE}.Release - Fast FPU|x64.Build.0 = Release|x64 - {02B67A37-50E1-49DB-BECF-905BC029C2FE}.Release|Win32.ActiveCfg = Release|Win32 - {02B67A37-50E1-49DB-BECF-905BC029C2FE}.Release|Win32.Build.0 = Release|Win32 - {02B67A37-50E1-49DB-BECF-905BC029C2FE}.Release|x64.ActiveCfg = Release|x64 - {02B67A37-50E1-49DB-BECF-905BC029C2FE}.Release|x64.Build.0 = Release|x64 - {02B67A37-50E1-49DB-BECF-905BC029C2FE}.SDL-Debug|Win32.ActiveCfg = Debug|Win32 - {02B67A37-50E1-49DB-BECF-905BC029C2FE}.SDL-Debug|Win32.Build.0 = Debug|Win32 - {02B67A37-50E1-49DB-BECF-905BC029C2FE}.SDL-Debug|x64.ActiveCfg = Debug|x64 - {02B67A37-50E1-49DB-BECF-905BC029C2FE}.SDL-Debug|x64.Build.0 = Debug|x64 - {02B67A37-50E1-49DB-BECF-905BC029C2FE}.Static lib - Debug|Win32.ActiveCfg = Debug|Win32 - {02B67A37-50E1-49DB-BECF-905BC029C2FE}.Static lib - Debug|Win32.Build.0 = Debug|Win32 - {02B67A37-50E1-49DB-BECF-905BC029C2FE}.Static lib - Debug|x64.ActiveCfg = Debug|x64 - {02B67A37-50E1-49DB-BECF-905BC029C2FE}.Static lib - Debug|x64.Build.0 = Debug|x64 - {02B67A37-50E1-49DB-BECF-905BC029C2FE}.Static lib - Release - Fast FPU|Win32.ActiveCfg = Release|Win32 - {02B67A37-50E1-49DB-BECF-905BC029C2FE}.Static lib - Release - Fast FPU|Win32.Build.0 = Release|Win32 - {02B67A37-50E1-49DB-BECF-905BC029C2FE}.Static lib - Release - Fast FPU|x64.ActiveCfg = Release|x64 - {02B67A37-50E1-49DB-BECF-905BC029C2FE}.Static lib - Release - Fast FPU|x64.Build.0 = Release|x64 - {02B67A37-50E1-49DB-BECF-905BC029C2FE}.Static lib - Release|Win32.ActiveCfg = Release|Win32 - {02B67A37-50E1-49DB-BECF-905BC029C2FE}.Static lib - Release|Win32.Build.0 = Release|Win32 - {02B67A37-50E1-49DB-BECF-905BC029C2FE}.Static lib - Release|x64.ActiveCfg = Release|x64 - {02B67A37-50E1-49DB-BECF-905BC029C2FE}.Static lib - Release|x64.Build.0 = Release|x64 - {8FDA260E-EF27-4F8C-8720-7AF707DD0D9E}.Debug|Win32.ActiveCfg = Debug|Win32 - {8FDA260E-EF27-4F8C-8720-7AF707DD0D9E}.Debug|Win32.Build.0 = Debug|Win32 - {8FDA260E-EF27-4F8C-8720-7AF707DD0D9E}.Debug|x64.ActiveCfg = Debug|x64 - {8FDA260E-EF27-4F8C-8720-7AF707DD0D9E}.Debug|x64.Build.0 = Debug|x64 - {8FDA260E-EF27-4F8C-8720-7AF707DD0D9E}.Release - Fast FPU|Win32.ActiveCfg = Release|Win32 - {8FDA260E-EF27-4F8C-8720-7AF707DD0D9E}.Release - Fast FPU|Win32.Build.0 = Release|Win32 - {8FDA260E-EF27-4F8C-8720-7AF707DD0D9E}.Release - Fast FPU|x64.ActiveCfg = Release|x64 - {8FDA260E-EF27-4F8C-8720-7AF707DD0D9E}.Release - Fast FPU|x64.Build.0 = Release|x64 - {8FDA260E-EF27-4F8C-8720-7AF707DD0D9E}.Release|Win32.ActiveCfg = Release|Win32 - {8FDA260E-EF27-4F8C-8720-7AF707DD0D9E}.Release|Win32.Build.0 = Release|Win32 - {8FDA260E-EF27-4F8C-8720-7AF707DD0D9E}.Release|x64.ActiveCfg = Release|x64 - {8FDA260E-EF27-4F8C-8720-7AF707DD0D9E}.Release|x64.Build.0 = Release|x64 - {8FDA260E-EF27-4F8C-8720-7AF707DD0D9E}.SDL-Debug|Win32.ActiveCfg = Debug|Win32 - {8FDA260E-EF27-4F8C-8720-7AF707DD0D9E}.SDL-Debug|Win32.Build.0 = Debug|Win32 - {8FDA260E-EF27-4F8C-8720-7AF707DD0D9E}.SDL-Debug|x64.ActiveCfg = Debug|x64 - {8FDA260E-EF27-4F8C-8720-7AF707DD0D9E}.SDL-Debug|x64.Build.0 = Debug|x64 - {8FDA260E-EF27-4F8C-8720-7AF707DD0D9E}.Static lib - Debug|Win32.ActiveCfg = Debug|Win32 - {8FDA260E-EF27-4F8C-8720-7AF707DD0D9E}.Static lib - Debug|Win32.Build.0 = Debug|Win32 - {8FDA260E-EF27-4F8C-8720-7AF707DD0D9E}.Static lib - Debug|x64.ActiveCfg = Debug|x64 - {8FDA260E-EF27-4F8C-8720-7AF707DD0D9E}.Static lib - Debug|x64.Build.0 = Debug|x64 - {8FDA260E-EF27-4F8C-8720-7AF707DD0D9E}.Static lib - Release - Fast FPU|Win32.ActiveCfg = Release|Win32 - {8FDA260E-EF27-4F8C-8720-7AF707DD0D9E}.Static lib - Release - Fast FPU|Win32.Build.0 = Release|Win32 - {8FDA260E-EF27-4F8C-8720-7AF707DD0D9E}.Static lib - Release - Fast FPU|x64.ActiveCfg = Release|x64 - {8FDA260E-EF27-4F8C-8720-7AF707DD0D9E}.Static lib - Release - Fast FPU|x64.Build.0 = Release|x64 - {8FDA260E-EF27-4F8C-8720-7AF707DD0D9E}.Static lib - Release|Win32.ActiveCfg = Release|Win32 - {8FDA260E-EF27-4F8C-8720-7AF707DD0D9E}.Static lib - Release|Win32.Build.0 = Release|Win32 - {8FDA260E-EF27-4F8C-8720-7AF707DD0D9E}.Static lib - Release|x64.ActiveCfg = Release|x64 - {8FDA260E-EF27-4F8C-8720-7AF707DD0D9E}.Static lib - Release|x64.Build.0 = Release|x64 - {5CE0E2E7-879D-4152-B61D-24E7D0707B45}.Debug|Win32.ActiveCfg = Debug|Win32 - {5CE0E2E7-879D-4152-B61D-24E7D0707B45}.Debug|Win32.Build.0 = Debug|Win32 - {5CE0E2E7-879D-4152-B61D-24E7D0707B45}.Debug|x64.ActiveCfg = Debug|x64 - {5CE0E2E7-879D-4152-B61D-24E7D0707B45}.Debug|x64.Build.0 = Debug|x64 - {5CE0E2E7-879D-4152-B61D-24E7D0707B45}.Release - Fast FPU|Win32.ActiveCfg = Release|Win32 - {5CE0E2E7-879D-4152-B61D-24E7D0707B45}.Release - Fast FPU|Win32.Build.0 = Release|Win32 - {5CE0E2E7-879D-4152-B61D-24E7D0707B45}.Release - Fast FPU|x64.ActiveCfg = Release|x64 - {5CE0E2E7-879D-4152-B61D-24E7D0707B45}.Release - Fast FPU|x64.Build.0 = Release|x64 - {5CE0E2E7-879D-4152-B61D-24E7D0707B45}.Release|Win32.ActiveCfg = Release|Win32 - {5CE0E2E7-879D-4152-B61D-24E7D0707B45}.Release|Win32.Build.0 = Release|Win32 - {5CE0E2E7-879D-4152-B61D-24E7D0707B45}.Release|x64.ActiveCfg = Release|x64 - {5CE0E2E7-879D-4152-B61D-24E7D0707B45}.Release|x64.Build.0 = Release|x64 - {5CE0E2E7-879D-4152-B61D-24E7D0707B45}.SDL-Debug|Win32.ActiveCfg = Debug|Win32 - {5CE0E2E7-879D-4152-B61D-24E7D0707B45}.SDL-Debug|Win32.Build.0 = Debug|Win32 - {5CE0E2E7-879D-4152-B61D-24E7D0707B45}.SDL-Debug|x64.ActiveCfg = Debug|x64 - {5CE0E2E7-879D-4152-B61D-24E7D0707B45}.SDL-Debug|x64.Build.0 = Debug|x64 - {5CE0E2E7-879D-4152-B61D-24E7D0707B45}.Static lib - Debug|Win32.ActiveCfg = Debug|Win32 - {5CE0E2E7-879D-4152-B61D-24E7D0707B45}.Static lib - Debug|Win32.Build.0 = Debug|Win32 - {5CE0E2E7-879D-4152-B61D-24E7D0707B45}.Static lib - Debug|x64.ActiveCfg = Debug|x64 - {5CE0E2E7-879D-4152-B61D-24E7D0707B45}.Static lib - Debug|x64.Build.0 = Debug|x64 - {5CE0E2E7-879D-4152-B61D-24E7D0707B45}.Static lib - Release - Fast FPU|Win32.ActiveCfg = Release|Win32 - {5CE0E2E7-879D-4152-B61D-24E7D0707B45}.Static lib - Release - Fast FPU|Win32.Build.0 = Release|Win32 - {5CE0E2E7-879D-4152-B61D-24E7D0707B45}.Static lib - Release - Fast FPU|x64.ActiveCfg = Release|x64 - {5CE0E2E7-879D-4152-B61D-24E7D0707B45}.Static lib - Release - Fast FPU|x64.Build.0 = Release|x64 - {5CE0E2E7-879D-4152-B61D-24E7D0707B45}.Static lib - Release|Win32.ActiveCfg = Release|Win32 - {5CE0E2E7-879D-4152-B61D-24E7D0707B45}.Static lib - Release|Win32.Build.0 = Release|Win32 - {5CE0E2E7-879D-4152-B61D-24E7D0707B45}.Static lib - Release|x64.ActiveCfg = Release|x64 - {5CE0E2E7-879D-4152-B61D-24E7D0707B45}.Static lib - Release|x64.Build.0 = Release|x64 - {65D9DE2E-B73E-4ADF-96D1-BF4A8B7F4F97}.Debug|Win32.ActiveCfg = Debug|Win32 - {65D9DE2E-B73E-4ADF-96D1-BF4A8B7F4F97}.Debug|Win32.Build.0 = Debug|Win32 - {65D9DE2E-B73E-4ADF-96D1-BF4A8B7F4F97}.Debug|x64.ActiveCfg = Debug|x64 - {65D9DE2E-B73E-4ADF-96D1-BF4A8B7F4F97}.Debug|x64.Build.0 = Debug|x64 - {65D9DE2E-B73E-4ADF-96D1-BF4A8B7F4F97}.Release - Fast FPU|Win32.ActiveCfg = Release|Win32 - {65D9DE2E-B73E-4ADF-96D1-BF4A8B7F4F97}.Release - Fast FPU|Win32.Build.0 = Release|Win32 - {65D9DE2E-B73E-4ADF-96D1-BF4A8B7F4F97}.Release - Fast FPU|x64.ActiveCfg = Release|x64 - {65D9DE2E-B73E-4ADF-96D1-BF4A8B7F4F97}.Release - Fast FPU|x64.Build.0 = Release|x64 - {65D9DE2E-B73E-4ADF-96D1-BF4A8B7F4F97}.Release|Win32.ActiveCfg = Release|Win32 - {65D9DE2E-B73E-4ADF-96D1-BF4A8B7F4F97}.Release|Win32.Build.0 = Release|Win32 - {65D9DE2E-B73E-4ADF-96D1-BF4A8B7F4F97}.Release|x64.ActiveCfg = Release|x64 - {65D9DE2E-B73E-4ADF-96D1-BF4A8B7F4F97}.Release|x64.Build.0 = Release|x64 - {65D9DE2E-B73E-4ADF-96D1-BF4A8B7F4F97}.SDL-Debug|Win32.ActiveCfg = Debug|Win32 - {65D9DE2E-B73E-4ADF-96D1-BF4A8B7F4F97}.SDL-Debug|Win32.Build.0 = Debug|Win32 - {65D9DE2E-B73E-4ADF-96D1-BF4A8B7F4F97}.SDL-Debug|x64.ActiveCfg = Debug|x64 - {65D9DE2E-B73E-4ADF-96D1-BF4A8B7F4F97}.SDL-Debug|x64.Build.0 = Debug|x64 - {65D9DE2E-B73E-4ADF-96D1-BF4A8B7F4F97}.Static lib - Debug|Win32.ActiveCfg = Debug|Win32 - {65D9DE2E-B73E-4ADF-96D1-BF4A8B7F4F97}.Static lib - Debug|Win32.Build.0 = Debug|Win32 - {65D9DE2E-B73E-4ADF-96D1-BF4A8B7F4F97}.Static lib - Debug|x64.ActiveCfg = Debug|x64 - {65D9DE2E-B73E-4ADF-96D1-BF4A8B7F4F97}.Static lib - Debug|x64.Build.0 = Debug|x64 - {65D9DE2E-B73E-4ADF-96D1-BF4A8B7F4F97}.Static lib - Release - Fast FPU|Win32.ActiveCfg = Release|Win32 - {65D9DE2E-B73E-4ADF-96D1-BF4A8B7F4F97}.Static lib - Release - Fast FPU|Win32.Build.0 = Release|Win32 - {65D9DE2E-B73E-4ADF-96D1-BF4A8B7F4F97}.Static lib - Release - Fast FPU|x64.ActiveCfg = Release|x64 - {65D9DE2E-B73E-4ADF-96D1-BF4A8B7F4F97}.Static lib - Release - Fast FPU|x64.Build.0 = Release|x64 - {65D9DE2E-B73E-4ADF-96D1-BF4A8B7F4F97}.Static lib - Release|Win32.ActiveCfg = Release|Win32 - {65D9DE2E-B73E-4ADF-96D1-BF4A8B7F4F97}.Static lib - Release|Win32.Build.0 = Release|Win32 - {65D9DE2E-B73E-4ADF-96D1-BF4A8B7F4F97}.Static lib - Release|x64.ActiveCfg = Release|x64 - {65D9DE2E-B73E-4ADF-96D1-BF4A8B7F4F97}.Static lib - Release|x64.Build.0 = Release|x64 - {853A396E-C031-4C26-A716-5B4E176BE11D}.Debug|Win32.ActiveCfg = Debug|Win32 - {853A396E-C031-4C26-A716-5B4E176BE11D}.Debug|Win32.Build.0 = Debug|Win32 - {853A396E-C031-4C26-A716-5B4E176BE11D}.Debug|x64.ActiveCfg = Debug|x64 - {853A396E-C031-4C26-A716-5B4E176BE11D}.Debug|x64.Build.0 = Debug|x64 - {853A396E-C031-4C26-A716-5B4E176BE11D}.Release - Fast FPU|Win32.ActiveCfg = Release|Win32 - {853A396E-C031-4C26-A716-5B4E176BE11D}.Release - Fast FPU|Win32.Build.0 = Release|Win32 - {853A396E-C031-4C26-A716-5B4E176BE11D}.Release - Fast FPU|x64.ActiveCfg = Release|x64 - {853A396E-C031-4C26-A716-5B4E176BE11D}.Release - Fast FPU|x64.Build.0 = Release|x64 - {853A396E-C031-4C26-A716-5B4E176BE11D}.Release|Win32.ActiveCfg = Release|Win32 - {853A396E-C031-4C26-A716-5B4E176BE11D}.Release|Win32.Build.0 = Release|Win32 - {853A396E-C031-4C26-A716-5B4E176BE11D}.Release|x64.ActiveCfg = Release|x64 - {853A396E-C031-4C26-A716-5B4E176BE11D}.Release|x64.Build.0 = Release|x64 - {853A396E-C031-4C26-A716-5B4E176BE11D}.SDL-Debug|Win32.ActiveCfg = Debug|Win32 - {853A396E-C031-4C26-A716-5B4E176BE11D}.SDL-Debug|Win32.Build.0 = Debug|Win32 - {853A396E-C031-4C26-A716-5B4E176BE11D}.SDL-Debug|x64.ActiveCfg = Debug|x64 - {853A396E-C031-4C26-A716-5B4E176BE11D}.SDL-Debug|x64.Build.0 = Debug|x64 - {853A396E-C031-4C26-A716-5B4E176BE11D}.Static lib - Debug|Win32.ActiveCfg = Debug|Win32 - {853A396E-C031-4C26-A716-5B4E176BE11D}.Static lib - Debug|Win32.Build.0 = Debug|Win32 - {853A396E-C031-4C26-A716-5B4E176BE11D}.Static lib - Debug|x64.ActiveCfg = Debug|x64 - {853A396E-C031-4C26-A716-5B4E176BE11D}.Static lib - Debug|x64.Build.0 = Debug|x64 - {853A396E-C031-4C26-A716-5B4E176BE11D}.Static lib - Release - Fast FPU|Win32.ActiveCfg = Release|Win32 - {853A396E-C031-4C26-A716-5B4E176BE11D}.Static lib - Release - Fast FPU|Win32.Build.0 = Release|Win32 - {853A396E-C031-4C26-A716-5B4E176BE11D}.Static lib - Release - Fast FPU|x64.ActiveCfg = Release|x64 - {853A396E-C031-4C26-A716-5B4E176BE11D}.Static lib - Release - Fast FPU|x64.Build.0 = Release|x64 - {853A396E-C031-4C26-A716-5B4E176BE11D}.Static lib - Release|Win32.ActiveCfg = Release|Win32 - {853A396E-C031-4C26-A716-5B4E176BE11D}.Static lib - Release|Win32.Build.0 = Release|Win32 - {853A396E-C031-4C26-A716-5B4E176BE11D}.Static lib - Release|x64.ActiveCfg = Release|x64 - {853A396E-C031-4C26-A716-5B4E176BE11D}.Static lib - Release|x64.Build.0 = Release|x64 - {4D53E40F-37E3-42B1-8848-F4C6F8313A17}.Debug|Win32.ActiveCfg = Debug|Win32 - {4D53E40F-37E3-42B1-8848-F4C6F8313A17}.Debug|Win32.Build.0 = Debug|Win32 - {4D53E40F-37E3-42B1-8848-F4C6F8313A17}.Debug|x64.ActiveCfg = Debug|x64 - {4D53E40F-37E3-42B1-8848-F4C6F8313A17}.Debug|x64.Build.0 = Debug|x64 - {4D53E40F-37E3-42B1-8848-F4C6F8313A17}.Release - Fast FPU|Win32.ActiveCfg = Release|Win32 - {4D53E40F-37E3-42B1-8848-F4C6F8313A17}.Release - Fast FPU|Win32.Build.0 = Release|Win32 - {4D53E40F-37E3-42B1-8848-F4C6F8313A17}.Release - Fast FPU|x64.ActiveCfg = Release|x64 - {4D53E40F-37E3-42B1-8848-F4C6F8313A17}.Release - Fast FPU|x64.Build.0 = Release|x64 - {4D53E40F-37E3-42B1-8848-F4C6F8313A17}.Release|Win32.ActiveCfg = Release|Win32 - {4D53E40F-37E3-42B1-8848-F4C6F8313A17}.Release|Win32.Build.0 = Release|Win32 - {4D53E40F-37E3-42B1-8848-F4C6F8313A17}.Release|x64.ActiveCfg = Release|x64 - {4D53E40F-37E3-42B1-8848-F4C6F8313A17}.Release|x64.Build.0 = Release|x64 - {4D53E40F-37E3-42B1-8848-F4C6F8313A17}.SDL-Debug|Win32.ActiveCfg = Debug|Win32 - {4D53E40F-37E3-42B1-8848-F4C6F8313A17}.SDL-Debug|Win32.Build.0 = Debug|Win32 - {4D53E40F-37E3-42B1-8848-F4C6F8313A17}.SDL-Debug|x64.ActiveCfg = Debug|x64 - {4D53E40F-37E3-42B1-8848-F4C6F8313A17}.SDL-Debug|x64.Build.0 = Debug|x64 - {4D53E40F-37E3-42B1-8848-F4C6F8313A17}.Static lib - Debug|Win32.ActiveCfg = Debug|Win32 - {4D53E40F-37E3-42B1-8848-F4C6F8313A17}.Static lib - Debug|Win32.Build.0 = Debug|Win32 - {4D53E40F-37E3-42B1-8848-F4C6F8313A17}.Static lib - Debug|x64.ActiveCfg = Debug|x64 - {4D53E40F-37E3-42B1-8848-F4C6F8313A17}.Static lib - Debug|x64.Build.0 = Debug|x64 - {4D53E40F-37E3-42B1-8848-F4C6F8313A17}.Static lib - Release - Fast FPU|Win32.ActiveCfg = Release|Win32 - {4D53E40F-37E3-42B1-8848-F4C6F8313A17}.Static lib - Release - Fast FPU|Win32.Build.0 = Release|Win32 - {4D53E40F-37E3-42B1-8848-F4C6F8313A17}.Static lib - Release - Fast FPU|x64.ActiveCfg = Release|x64 - {4D53E40F-37E3-42B1-8848-F4C6F8313A17}.Static lib - Release - Fast FPU|x64.Build.0 = Release|x64 - {4D53E40F-37E3-42B1-8848-F4C6F8313A17}.Static lib - Release|Win32.ActiveCfg = Release|Win32 - {4D53E40F-37E3-42B1-8848-F4C6F8313A17}.Static lib - Release|Win32.Build.0 = Release|Win32 - {4D53E40F-37E3-42B1-8848-F4C6F8313A17}.Static lib - Release|x64.ActiveCfg = Release|x64 - {4D53E40F-37E3-42B1-8848-F4C6F8313A17}.Static lib - Release|x64.Build.0 = Release|x64 - {E72B637E-4AA6-46F3-885F-AC67B4B470ED}.Debug|Win32.ActiveCfg = Debug|Win32 - {E72B637E-4AA6-46F3-885F-AC67B4B470ED}.Debug|Win32.Build.0 = Debug|Win32 - {E72B637E-4AA6-46F3-885F-AC67B4B470ED}.Debug|x64.ActiveCfg = Debug|x64 - {E72B637E-4AA6-46F3-885F-AC67B4B470ED}.Debug|x64.Build.0 = Debug|x64 - {E72B637E-4AA6-46F3-885F-AC67B4B470ED}.Release - Fast FPU|Win32.ActiveCfg = Release|Win32 - {E72B637E-4AA6-46F3-885F-AC67B4B470ED}.Release - Fast FPU|Win32.Build.0 = Release|Win32 - {E72B637E-4AA6-46F3-885F-AC67B4B470ED}.Release - Fast FPU|x64.ActiveCfg = Release|x64 - {E72B637E-4AA6-46F3-885F-AC67B4B470ED}.Release - Fast FPU|x64.Build.0 = Release|x64 - {E72B637E-4AA6-46F3-885F-AC67B4B470ED}.Release|Win32.ActiveCfg = Release|Win32 - {E72B637E-4AA6-46F3-885F-AC67B4B470ED}.Release|Win32.Build.0 = Release|Win32 - {E72B637E-4AA6-46F3-885F-AC67B4B470ED}.Release|x64.ActiveCfg = Release|x64 - {E72B637E-4AA6-46F3-885F-AC67B4B470ED}.Release|x64.Build.0 = Release|x64 - {E72B637E-4AA6-46F3-885F-AC67B4B470ED}.SDL-Debug|Win32.ActiveCfg = Debug|Win32 - {E72B637E-4AA6-46F3-885F-AC67B4B470ED}.SDL-Debug|Win32.Build.0 = Debug|Win32 - {E72B637E-4AA6-46F3-885F-AC67B4B470ED}.SDL-Debug|x64.ActiveCfg = Debug|x64 - {E72B637E-4AA6-46F3-885F-AC67B4B470ED}.SDL-Debug|x64.Build.0 = Debug|x64 - {E72B637E-4AA6-46F3-885F-AC67B4B470ED}.Static lib - Debug|Win32.ActiveCfg = Debug|Win32 - {E72B637E-4AA6-46F3-885F-AC67B4B470ED}.Static lib - Debug|Win32.Build.0 = Debug|Win32 - {E72B637E-4AA6-46F3-885F-AC67B4B470ED}.Static lib - Debug|x64.ActiveCfg = Debug|x64 - {E72B637E-4AA6-46F3-885F-AC67B4B470ED}.Static lib - Debug|x64.Build.0 = Debug|x64 - {E72B637E-4AA6-46F3-885F-AC67B4B470ED}.Static lib - Release - Fast FPU|Win32.ActiveCfg = Release|Win32 - {E72B637E-4AA6-46F3-885F-AC67B4B470ED}.Static lib - Release - Fast FPU|Win32.Build.0 = Release|Win32 - {E72B637E-4AA6-46F3-885F-AC67B4B470ED}.Static lib - Release - Fast FPU|x64.ActiveCfg = Release|x64 - {E72B637E-4AA6-46F3-885F-AC67B4B470ED}.Static lib - Release - Fast FPU|x64.Build.0 = Release|x64 - {E72B637E-4AA6-46F3-885F-AC67B4B470ED}.Static lib - Release|Win32.ActiveCfg = Release|Win32 - {E72B637E-4AA6-46F3-885F-AC67B4B470ED}.Static lib - Release|Win32.Build.0 = Release|Win32 - {E72B637E-4AA6-46F3-885F-AC67B4B470ED}.Static lib - Release|x64.ActiveCfg = Release|x64 - {E72B637E-4AA6-46F3-885F-AC67B4B470ED}.Static lib - Release|x64.Build.0 = Release|x64 - {6F076455-D955-45D4-9C68-4AD4E45F2D47}.Debug|Win32.ActiveCfg = Debug|Win32 - {6F076455-D955-45D4-9C68-4AD4E45F2D47}.Debug|Win32.Build.0 = Debug|Win32 - {6F076455-D955-45D4-9C68-4AD4E45F2D47}.Debug|x64.ActiveCfg = Debug|x64 - {6F076455-D955-45D4-9C68-4AD4E45F2D47}.Debug|x64.Build.0 = Debug|x64 - {6F076455-D955-45D4-9C68-4AD4E45F2D47}.Release - Fast FPU|Win32.ActiveCfg = Release|Win32 - {6F076455-D955-45D4-9C68-4AD4E45F2D47}.Release - Fast FPU|Win32.Build.0 = Release|Win32 - {6F076455-D955-45D4-9C68-4AD4E45F2D47}.Release - Fast FPU|x64.ActiveCfg = Release|x64 - {6F076455-D955-45D4-9C68-4AD4E45F2D47}.Release - Fast FPU|x64.Build.0 = Release|x64 - {6F076455-D955-45D4-9C68-4AD4E45F2D47}.Release|Win32.ActiveCfg = Release|Win32 - {6F076455-D955-45D4-9C68-4AD4E45F2D47}.Release|Win32.Build.0 = Release|Win32 - {6F076455-D955-45D4-9C68-4AD4E45F2D47}.Release|x64.ActiveCfg = Release|x64 - {6F076455-D955-45D4-9C68-4AD4E45F2D47}.Release|x64.Build.0 = Release|x64 - {6F076455-D955-45D4-9C68-4AD4E45F2D47}.SDL-Debug|Win32.ActiveCfg = Debug|Win32 - {6F076455-D955-45D4-9C68-4AD4E45F2D47}.SDL-Debug|Win32.Build.0 = Debug|Win32 - {6F076455-D955-45D4-9C68-4AD4E45F2D47}.SDL-Debug|x64.ActiveCfg = Debug|x64 - {6F076455-D955-45D4-9C68-4AD4E45F2D47}.SDL-Debug|x64.Build.0 = Debug|x64 - {6F076455-D955-45D4-9C68-4AD4E45F2D47}.Static lib - Debug|Win32.ActiveCfg = Debug|Win32 - {6F076455-D955-45D4-9C68-4AD4E45F2D47}.Static lib - Debug|Win32.Build.0 = Debug|Win32 - {6F076455-D955-45D4-9C68-4AD4E45F2D47}.Static lib - Debug|x64.ActiveCfg = Debug|x64 - {6F076455-D955-45D4-9C68-4AD4E45F2D47}.Static lib - Debug|x64.Build.0 = Debug|x64 - {6F076455-D955-45D4-9C68-4AD4E45F2D47}.Static lib - Release - Fast FPU|Win32.ActiveCfg = Release|Win32 - {6F076455-D955-45D4-9C68-4AD4E45F2D47}.Static lib - Release - Fast FPU|Win32.Build.0 = Release|Win32 - {6F076455-D955-45D4-9C68-4AD4E45F2D47}.Static lib - Release - Fast FPU|x64.ActiveCfg = Release|x64 - {6F076455-D955-45D4-9C68-4AD4E45F2D47}.Static lib - Release - Fast FPU|x64.Build.0 = Release|x64 - {6F076455-D955-45D4-9C68-4AD4E45F2D47}.Static lib - Release|Win32.ActiveCfg = Release|Win32 - {6F076455-D955-45D4-9C68-4AD4E45F2D47}.Static lib - Release|Win32.Build.0 = Release|Win32 - {6F076455-D955-45D4-9C68-4AD4E45F2D47}.Static lib - Release|x64.ActiveCfg = Release|x64 - {6F076455-D955-45D4-9C68-4AD4E45F2D47}.Static lib - Release|x64.Build.0 = Release|x64 - {E08E042A-6C45-411B-92BE-3CC31331019F}.Debug|Win32.ActiveCfg = Debug|Win32 - {E08E042A-6C45-411B-92BE-3CC31331019F}.Debug|Win32.Build.0 = Debug|Win32 - {E08E042A-6C45-411B-92BE-3CC31331019F}.Debug|x64.ActiveCfg = Debug|x64 - {E08E042A-6C45-411B-92BE-3CC31331019F}.Debug|x64.Build.0 = Debug|x64 - {E08E042A-6C45-411B-92BE-3CC31331019F}.Release - Fast FPU|Win32.ActiveCfg = Release - Fast FPU|Win32 - {E08E042A-6C45-411B-92BE-3CC31331019F}.Release - Fast FPU|Win32.Build.0 = Release - Fast FPU|Win32 - {E08E042A-6C45-411B-92BE-3CC31331019F}.Release - Fast FPU|x64.ActiveCfg = Release - Fast FPU|x64 - {E08E042A-6C45-411B-92BE-3CC31331019F}.Release - Fast FPU|x64.Build.0 = Release - Fast FPU|x64 - {E08E042A-6C45-411B-92BE-3CC31331019F}.Release|Win32.ActiveCfg = Release|Win32 - {E08E042A-6C45-411B-92BE-3CC31331019F}.Release|Win32.Build.0 = Release|Win32 - {E08E042A-6C45-411B-92BE-3CC31331019F}.Release|x64.ActiveCfg = Release|x64 - {E08E042A-6C45-411B-92BE-3CC31331019F}.Release|x64.Build.0 = Release|x64 - {E08E042A-6C45-411B-92BE-3CC31331019F}.SDL-Debug|Win32.ActiveCfg = SDL-Debug|Win32 - {E08E042A-6C45-411B-92BE-3CC31331019F}.SDL-Debug|Win32.Build.0 = SDL-Debug|Win32 - {E08E042A-6C45-411B-92BE-3CC31331019F}.SDL-Debug|x64.ActiveCfg = SDL-Debug|x64 - {E08E042A-6C45-411B-92BE-3CC31331019F}.SDL-Debug|x64.Build.0 = SDL-Debug|x64 - {E08E042A-6C45-411B-92BE-3CC31331019F}.Static lib - Debug|Win32.ActiveCfg = Static lib - Debug|Win32 - {E08E042A-6C45-411B-92BE-3CC31331019F}.Static lib - Debug|Win32.Build.0 = Static lib - Debug|Win32 - {E08E042A-6C45-411B-92BE-3CC31331019F}.Static lib - Debug|x64.ActiveCfg = Static lib - Debug|x64 - {E08E042A-6C45-411B-92BE-3CC31331019F}.Static lib - Debug|x64.Build.0 = Static lib - Debug|x64 - {E08E042A-6C45-411B-92BE-3CC31331019F}.Static lib - Release - Fast FPU|Win32.ActiveCfg = Static lib - Release - Fast FPU|Win32 - {E08E042A-6C45-411B-92BE-3CC31331019F}.Static lib - Release - Fast FPU|Win32.Build.0 = Static lib - Release - Fast FPU|Win32 - {E08E042A-6C45-411B-92BE-3CC31331019F}.Static lib - Release - Fast FPU|x64.ActiveCfg = Static lib - Release - Fast FPU|x64 - {E08E042A-6C45-411B-92BE-3CC31331019F}.Static lib - Release - Fast FPU|x64.Build.0 = Static lib - Release - Fast FPU|x64 - {E08E042A-6C45-411B-92BE-3CC31331019F}.Static lib - Release|Win32.ActiveCfg = Static lib - Release|Win32 - {E08E042A-6C45-411B-92BE-3CC31331019F}.Static lib - Release|Win32.Build.0 = Static lib - Release|Win32 - {E08E042A-6C45-411B-92BE-3CC31331019F}.Static lib - Release|x64.ActiveCfg = Static lib - Release|x64 - {E08E042A-6C45-411B-92BE-3CC31331019F}.Static lib - Release|x64.Build.0 = Static lib - Release|x64 - {17E74625-568E-4008-897E-CAD12A332B0C}.Debug|Win32.ActiveCfg = Debug|Win32 - {17E74625-568E-4008-897E-CAD12A332B0C}.Debug|Win32.Build.0 = Debug|Win32 - {17E74625-568E-4008-897E-CAD12A332B0C}.Debug|x64.ActiveCfg = Debug|x64 - {17E74625-568E-4008-897E-CAD12A332B0C}.Debug|x64.Build.0 = Debug|x64 - {17E74625-568E-4008-897E-CAD12A332B0C}.Release - Fast FPU|Win32.ActiveCfg = Release|Win32 - {17E74625-568E-4008-897E-CAD12A332B0C}.Release - Fast FPU|Win32.Build.0 = Release|Win32 - {17E74625-568E-4008-897E-CAD12A332B0C}.Release - Fast FPU|x64.ActiveCfg = Release|x64 - {17E74625-568E-4008-897E-CAD12A332B0C}.Release - Fast FPU|x64.Build.0 = Release|x64 - {17E74625-568E-4008-897E-CAD12A332B0C}.Release|Win32.ActiveCfg = Release|Win32 - {17E74625-568E-4008-897E-CAD12A332B0C}.Release|Win32.Build.0 = Release|Win32 - {17E74625-568E-4008-897E-CAD12A332B0C}.Release|x64.ActiveCfg = Release|x64 - {17E74625-568E-4008-897E-CAD12A332B0C}.Release|x64.Build.0 = Release|x64 - {17E74625-568E-4008-897E-CAD12A332B0C}.SDL-Debug|Win32.ActiveCfg = Debug|Win32 - {17E74625-568E-4008-897E-CAD12A332B0C}.SDL-Debug|Win32.Build.0 = Debug|Win32 - {17E74625-568E-4008-897E-CAD12A332B0C}.SDL-Debug|x64.ActiveCfg = Debug|x64 - {17E74625-568E-4008-897E-CAD12A332B0C}.SDL-Debug|x64.Build.0 = Debug|x64 - {17E74625-568E-4008-897E-CAD12A332B0C}.Static lib - Debug|Win32.ActiveCfg = Debug|Win32 - {17E74625-568E-4008-897E-CAD12A332B0C}.Static lib - Debug|Win32.Build.0 = Debug|Win32 - {17E74625-568E-4008-897E-CAD12A332B0C}.Static lib - Debug|x64.ActiveCfg = Debug|x64 - {17E74625-568E-4008-897E-CAD12A332B0C}.Static lib - Debug|x64.Build.0 = Debug|x64 - {17E74625-568E-4008-897E-CAD12A332B0C}.Static lib - Release - Fast FPU|Win32.ActiveCfg = Release|Win32 - {17E74625-568E-4008-897E-CAD12A332B0C}.Static lib - Release - Fast FPU|Win32.Build.0 = Release|Win32 - {17E74625-568E-4008-897E-CAD12A332B0C}.Static lib - Release - Fast FPU|x64.ActiveCfg = Release|x64 - {17E74625-568E-4008-897E-CAD12A332B0C}.Static lib - Release - Fast FPU|x64.Build.0 = Release|x64 - {17E74625-568E-4008-897E-CAD12A332B0C}.Static lib - Release|Win32.ActiveCfg = Release|Win32 - {17E74625-568E-4008-897E-CAD12A332B0C}.Static lib - Release|Win32.Build.0 = Release|Win32 - {17E74625-568E-4008-897E-CAD12A332B0C}.Static lib - Release|x64.ActiveCfg = Release|x64 - {17E74625-568E-4008-897E-CAD12A332B0C}.Static lib - Release|x64.Build.0 = Release|x64 - {1FDD5E75-9EB3-4467-B672-0BFC105B84A5}.Debug|Win32.ActiveCfg = Debug|Win32 - {1FDD5E75-9EB3-4467-B672-0BFC105B84A5}.Debug|Win32.Build.0 = Debug|Win32 - {1FDD5E75-9EB3-4467-B672-0BFC105B84A5}.Debug|x64.ActiveCfg = Debug|x64 - {1FDD5E75-9EB3-4467-B672-0BFC105B84A5}.Debug|x64.Build.0 = Debug|x64 - {1FDD5E75-9EB3-4467-B672-0BFC105B84A5}.Release - Fast FPU|Win32.ActiveCfg = Release|Win32 - {1FDD5E75-9EB3-4467-B672-0BFC105B84A5}.Release - Fast FPU|Win32.Build.0 = Release|Win32 - {1FDD5E75-9EB3-4467-B672-0BFC105B84A5}.Release - Fast FPU|x64.ActiveCfg = Release|x64 - {1FDD5E75-9EB3-4467-B672-0BFC105B84A5}.Release - Fast FPU|x64.Build.0 = Release|x64 - {1FDD5E75-9EB3-4467-B672-0BFC105B84A5}.Release|Win32.ActiveCfg = Release|Win32 - {1FDD5E75-9EB3-4467-B672-0BFC105B84A5}.Release|Win32.Build.0 = Release|Win32 - {1FDD5E75-9EB3-4467-B672-0BFC105B84A5}.Release|x64.ActiveCfg = Release|x64 - {1FDD5E75-9EB3-4467-B672-0BFC105B84A5}.Release|x64.Build.0 = Release|x64 - {1FDD5E75-9EB3-4467-B672-0BFC105B84A5}.SDL-Debug|Win32.ActiveCfg = Debug|Win32 - {1FDD5E75-9EB3-4467-B672-0BFC105B84A5}.SDL-Debug|Win32.Build.0 = Debug|Win32 - {1FDD5E75-9EB3-4467-B672-0BFC105B84A5}.SDL-Debug|x64.ActiveCfg = Debug|x64 - {1FDD5E75-9EB3-4467-B672-0BFC105B84A5}.SDL-Debug|x64.Build.0 = Debug|x64 - {1FDD5E75-9EB3-4467-B672-0BFC105B84A5}.Static lib - Debug|Win32.ActiveCfg = Debug|Win32 - {1FDD5E75-9EB3-4467-B672-0BFC105B84A5}.Static lib - Debug|Win32.Build.0 = Debug|Win32 - {1FDD5E75-9EB3-4467-B672-0BFC105B84A5}.Static lib - Debug|x64.ActiveCfg = Debug|x64 - {1FDD5E75-9EB3-4467-B672-0BFC105B84A5}.Static lib - Debug|x64.Build.0 = Debug|x64 - {1FDD5E75-9EB3-4467-B672-0BFC105B84A5}.Static lib - Release - Fast FPU|Win32.ActiveCfg = Release|Win32 - {1FDD5E75-9EB3-4467-B672-0BFC105B84A5}.Static lib - Release - Fast FPU|Win32.Build.0 = Release|Win32 - {1FDD5E75-9EB3-4467-B672-0BFC105B84A5}.Static lib - Release - Fast FPU|x64.ActiveCfg = Release|x64 - {1FDD5E75-9EB3-4467-B672-0BFC105B84A5}.Static lib - Release - Fast FPU|x64.Build.0 = Release|x64 - {1FDD5E75-9EB3-4467-B672-0BFC105B84A5}.Static lib - Release|Win32.ActiveCfg = Release|Win32 - {1FDD5E75-9EB3-4467-B672-0BFC105B84A5}.Static lib - Release|Win32.Build.0 = Release|Win32 - {1FDD5E75-9EB3-4467-B672-0BFC105B84A5}.Static lib - Release|x64.ActiveCfg = Release|x64 - {1FDD5E75-9EB3-4467-B672-0BFC105B84A5}.Static lib - Release|x64.Build.0 = Release|x64 - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/examples/BuildAllExamples_vc14.sln b/examples/BuildAllExamples_vc14.sln deleted file mode 100644 index 4766c3b5..00000000 --- a/examples/BuildAllExamples_vc14.sln +++ /dev/null @@ -1,1099 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 14 -VisualStudioVersion = 14.0.25420.1 -MinimumVisualStudioVersion = 10.0.40219.1 -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "01.HelloWorld", "01.HelloWorld\HelloWorld_vc14.vcxproj", "{5AD4C95C-BA38-4692-BA4B-8C25A86208F9}" - ProjectSection(ProjectDependencies) = postProject - {E08E042A-6C45-411B-92BE-3CC31331019F} = {E08E042A-6C45-411B-92BE-3CC31331019F} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "02.Quake3Map", "02.Quake3Map\Quake3Map_vc14.vcxproj", "{D1A464A2-D479-458C-98A2-60965D823CD1}" - ProjectSection(ProjectDependencies) = postProject - {E08E042A-6C45-411B-92BE-3CC31331019F} = {E08E042A-6C45-411B-92BE-3CC31331019F} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "03.CustomSceneNode", "03.CustomSceneNode\CustomSceneNode_vc14.vcxproj", "{171CCDFA-C140-4956-8EB7-F0168F4521D3}" - ProjectSection(ProjectDependencies) = postProject - {E08E042A-6C45-411B-92BE-3CC31331019F} = {E08E042A-6C45-411B-92BE-3CC31331019F} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "04.Movement", "04.Movement\Movement_vc14.vcxproj", "{7BDBB7E8-E0C9-4A0D-83C1-D389D6140FEF}" - ProjectSection(ProjectDependencies) = postProject - {E08E042A-6C45-411B-92BE-3CC31331019F} = {E08E042A-6C45-411B-92BE-3CC31331019F} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "05.UserInterface", "05.UserInterface\UserInterface_vc14.vcxproj", "{622C9DD7-0391-49FF-AF53-24F9D5A8EC53}" - ProjectSection(ProjectDependencies) = postProject - {E08E042A-6C45-411B-92BE-3CC31331019F} = {E08E042A-6C45-411B-92BE-3CC31331019F} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "06.2DGraphics", "06.2DGraphics\2DGraphics_vc14.vcxproj", "{E71B6F18-10DC-4101-A541-F6D33F71B2BD}" - ProjectSection(ProjectDependencies) = postProject - {E08E042A-6C45-411B-92BE-3CC31331019F} = {E08E042A-6C45-411B-92BE-3CC31331019F} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "07.Collision", "07.Collision\Collision_vc14.vcxproj", "{3E30297B-5BE3-4A5C-B31E-08A28ADDB29E}" - ProjectSection(ProjectDependencies) = postProject - {E08E042A-6C45-411B-92BE-3CC31331019F} = {E08E042A-6C45-411B-92BE-3CC31331019F} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "08.SpecialFX", "08.SpecialFX\SpecialFX_vc14.vcxproj", "{C869BF55-B9D6-4980-BC92-60FA0CF8411A}" - ProjectSection(ProjectDependencies) = postProject - {E08E042A-6C45-411B-92BE-3CC31331019F} = {E08E042A-6C45-411B-92BE-3CC31331019F} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "09.Meshviewer", "09.Meshviewer\Meshviewer_vc14.vcxproj", "{2AE24484-22FC-481B-9A40-7CD0DA5C8E06}" - ProjectSection(ProjectDependencies) = postProject - {E08E042A-6C45-411B-92BE-3CC31331019F} = {E08E042A-6C45-411B-92BE-3CC31331019F} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "10.Shaders", "10.Shaders\Shaders_vc14.vcxproj", "{27158C82-CD15-4A9B-9848-35E7065B209F}" - ProjectSection(ProjectDependencies) = postProject - {E08E042A-6C45-411B-92BE-3CC31331019F} = {E08E042A-6C45-411B-92BE-3CC31331019F} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "11.PerPixelLighting", "11.PerPixelLighting\PerPixelLighting_vc14.vcxproj", "{C4B42409-542D-4EFC-9E6B-44713FD47A33}" - ProjectSection(ProjectDependencies) = postProject - {E08E042A-6C45-411B-92BE-3CC31331019F} = {E08E042A-6C45-411B-92BE-3CC31331019F} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "12.TerrainRendering", "12.TerrainRendering\TerrainRendering_vc14.vcxproj", "{3A5B74E5-6390-43B0-A459-2793B81FFD31}" - ProjectSection(ProjectDependencies) = postProject - {E08E042A-6C45-411B-92BE-3CC31331019F} = {E08E042A-6C45-411B-92BE-3CC31331019F} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "13.RenderToTexture", "13.RenderToTexture\RenderToTexture_vc14.vcxproj", "{0914E5C8-5352-467B-8421-C9EB35BD5596}" - ProjectSection(ProjectDependencies) = postProject - {E08E042A-6C45-411B-92BE-3CC31331019F} = {E08E042A-6C45-411B-92BE-3CC31331019F} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "14.Win32Window", "14.Win32Window\Win32Window_vc14.vcxproj", "{772FBE05-D05A-467B-9842-BEC409EEA8D0}" - ProjectSection(ProjectDependencies) = postProject - {E08E042A-6C45-411B-92BE-3CC31331019F} = {E08E042A-6C45-411B-92BE-3CC31331019F} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "15.LoadIrrFile", "15.LoadIrrFile\LoadIrrFile_vc14.vcxproj", "{78C9F424-523C-49AC-94B7-823AA4A26BF9}" - ProjectSection(ProjectDependencies) = postProject - {E08E042A-6C45-411B-92BE-3CC31331019F} = {E08E042A-6C45-411B-92BE-3CC31331019F} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "16.Quake3MapShader", "16.Quake3MapShader\Quake3MapShader_vc14.vcxproj", "{EB3B38EA-5CE7-4983-845B-880661E69D09}" - ProjectSection(ProjectDependencies) = postProject - {E08E042A-6C45-411B-92BE-3CC31331019F} = {E08E042A-6C45-411B-92BE-3CC31331019F} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "18.SplitScreen", "18.SplitScreen\SplitScreen_vc14.vcxproj", "{1AB9413E-4F53-42A3-8CB2-CB4BE22336D0}" - ProjectSection(ProjectDependencies) = postProject - {E08E042A-6C45-411B-92BE-3CC31331019F} = {E08E042A-6C45-411B-92BE-3CC31331019F} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "19.MouseAndJoystick", "19.MouseAndJoystick\MouseAndJoystick_vc14.vcxproj", "{FE853A36-E0D1-4AC5-A792-B643E70D2953}" - ProjectSection(ProjectDependencies) = postProject - {E08E042A-6C45-411B-92BE-3CC31331019F} = {E08E042A-6C45-411B-92BE-3CC31331019F} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "20.ManagedLights", "20.ManagedLights\ManagedLights_vc14.vcxproj", "{16007FE2-142B-47F8-93E1-519BA3F39E71}" - ProjectSection(ProjectDependencies) = postProject - {E08E042A-6C45-411B-92BE-3CC31331019F} = {E08E042A-6C45-411B-92BE-3CC31331019F} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "21.Quake3Explorer", "21.Quake3Explorer\Quake3Explorer_vc14.vcxproj", "{CDC4AAA9-72E1-4FFA-A04D-7EF59D8B97CD}" - ProjectSection(ProjectDependencies) = postProject - {E08E042A-6C45-411B-92BE-3CC31331019F} = {E08E042A-6C45-411B-92BE-3CC31331019F} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "22.MaterialViewer", "22.MaterialViewer\MaterialViewer_vc14.vcxproj", "{4E6C2F8D-BA92-4C5B-96FD-72D4FE8BD7FA}" - ProjectSection(ProjectDependencies) = postProject - {E08E042A-6C45-411B-92BE-3CC31331019F} = {E08E042A-6C45-411B-92BE-3CC31331019F} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "23.SMeshHandling", "23.SMeshHandling\SMeshHandling_vc14.vcxproj", "{6AEC2AA2-C9FF-4B7D-B07A-94A9D34B41D7}" - ProjectSection(ProjectDependencies) = postProject - {E08E042A-6C45-411B-92BE-3CC31331019F} = {E08E042A-6C45-411B-92BE-3CC31331019F} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "24.CursorControl", "24.CursorControl\CursorControl_vc14.vcxproj", "{02B67A37-50E1-49DB-BECF-905BC029C2FE}" - ProjectSection(ProjectDependencies) = postProject - {E08E042A-6C45-411B-92BE-3CC31331019F} = {E08E042A-6C45-411B-92BE-3CC31331019F} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "25.XmlHandling", "25.XmlHandling\XmlHandling_vc14.vcxproj", "{8FDA260E-EF27-4F8C-8720-7AF707DD0D9E}" - ProjectSection(ProjectDependencies) = postProject - {E08E042A-6C45-411B-92BE-3CC31331019F} = {E08E042A-6C45-411B-92BE-3CC31331019F} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "26.OcclusionQuery", "26.OcclusionQuery\OcclusionQuery_vc14.vcxproj", "{5CE0E2E7-879D-4152-B61D-24E7D0707B45}" - ProjectSection(ProjectDependencies) = postProject - {E08E042A-6C45-411B-92BE-3CC31331019F} = {E08E042A-6C45-411B-92BE-3CC31331019F} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "30.Profiling", "30.Profiling\Profiling_vc14.vcxproj", "{65D9DE2E-B73E-4ADF-96D1-BF4A8B7F4F97}" - ProjectSection(ProjectDependencies) = postProject - {E08E042A-6C45-411B-92BE-3CC31331019F} = {E08E042A-6C45-411B-92BE-3CC31331019F} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "GUIEditor", "..\tools\GUIEditor\GUI Editor_vc14.vcxproj", "{853A396E-C031-4C26-A716-5B4E176BE11D}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "FontTool", "..\tools\IrrFontTool\newFontTool\irrFontTool_vc14.vcxproj", "{4D53E40F-37E3-42B1-8848-F4C6F8313A17}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "MeshConverter", "..\tools\MeshConverter\MeshConverter_vc14.vcxproj", "{E72B637E-4AA6-46F3-885F-AC67B4B470ED}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Demo", "Demo\Demo_vc14.vcxproj", "{6F076455-D955-45D4-9C68-4AD4E45F2D47}" - ProjectSection(ProjectDependencies) = postProject - {E08E042A-6C45-411B-92BE-3CC31331019F} = {E08E042A-6C45-411B-92BE-3CC31331019F} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Irrlicht", "..\source\Irrlicht\Irrlicht14.0.vcxproj", "{E08E042A-6C45-411B-92BE-3CC31331019F}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "27.PostProcessing", "27.PostProcessing\PostProcessing_vc14.vcxproj", "{F25F2AC4-AEDA-4A95-9769-01A2652B54A2}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "28.CubeMapping", "28.CubeMapping\CubeMapping_vc14.vcxproj", "{DEE0160F-8FBD-43EC-BB96-1B9C0ED1B51A}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Win32 = Debug|Win32 - Debug|x64 = Debug|x64 - Release - Fast FPU|Win32 = Release - Fast FPU|Win32 - Release - Fast FPU|x64 = Release - Fast FPU|x64 - Release|Win32 = Release|Win32 - Release|x64 = Release|x64 - SDL-Debug|Win32 = SDL-Debug|Win32 - SDL-Debug|x64 = SDL-Debug|x64 - Static lib - Debug|Win32 = Static lib - Debug|Win32 - Static lib - Debug|x64 = Static lib - Debug|x64 - Static lib - Release - Fast FPU|Win32 = Static lib - Release - Fast FPU|Win32 - Static lib - Release - Fast FPU|x64 = Static lib - Release - Fast FPU|x64 - Static lib - Release|Win32 = Static lib - Release|Win32 - Static lib - Release|x64 = Static lib - Release|x64 - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {5AD4C95C-BA38-4692-BA4B-8C25A86208F9}.Debug|Win32.ActiveCfg = Debug|Win32 - {5AD4C95C-BA38-4692-BA4B-8C25A86208F9}.Debug|Win32.Build.0 = Debug|Win32 - {5AD4C95C-BA38-4692-BA4B-8C25A86208F9}.Debug|x64.ActiveCfg = Debug|x64 - {5AD4C95C-BA38-4692-BA4B-8C25A86208F9}.Debug|x64.Build.0 = Debug|x64 - {5AD4C95C-BA38-4692-BA4B-8C25A86208F9}.Release - Fast FPU|Win32.ActiveCfg = Release|Win32 - {5AD4C95C-BA38-4692-BA4B-8C25A86208F9}.Release - Fast FPU|Win32.Build.0 = Release|Win32 - {5AD4C95C-BA38-4692-BA4B-8C25A86208F9}.Release - Fast FPU|x64.ActiveCfg = Release|x64 - {5AD4C95C-BA38-4692-BA4B-8C25A86208F9}.Release - Fast FPU|x64.Build.0 = Release|x64 - {5AD4C95C-BA38-4692-BA4B-8C25A86208F9}.Release|Win32.ActiveCfg = Release|Win32 - {5AD4C95C-BA38-4692-BA4B-8C25A86208F9}.Release|Win32.Build.0 = Release|Win32 - {5AD4C95C-BA38-4692-BA4B-8C25A86208F9}.Release|x64.ActiveCfg = Release|x64 - {5AD4C95C-BA38-4692-BA4B-8C25A86208F9}.Release|x64.Build.0 = Release|x64 - {5AD4C95C-BA38-4692-BA4B-8C25A86208F9}.SDL-Debug|Win32.ActiveCfg = Debug|Win32 - {5AD4C95C-BA38-4692-BA4B-8C25A86208F9}.SDL-Debug|Win32.Build.0 = Debug|Win32 - {5AD4C95C-BA38-4692-BA4B-8C25A86208F9}.SDL-Debug|x64.ActiveCfg = Debug|x64 - {5AD4C95C-BA38-4692-BA4B-8C25A86208F9}.SDL-Debug|x64.Build.0 = Debug|x64 - {5AD4C95C-BA38-4692-BA4B-8C25A86208F9}.Static lib - Debug|Win32.ActiveCfg = Debug|Win32 - {5AD4C95C-BA38-4692-BA4B-8C25A86208F9}.Static lib - Debug|Win32.Build.0 = Debug|Win32 - {5AD4C95C-BA38-4692-BA4B-8C25A86208F9}.Static lib - Debug|x64.ActiveCfg = Debug|x64 - {5AD4C95C-BA38-4692-BA4B-8C25A86208F9}.Static lib - Debug|x64.Build.0 = Debug|x64 - {5AD4C95C-BA38-4692-BA4B-8C25A86208F9}.Static lib - Release - Fast FPU|Win32.ActiveCfg = Release|Win32 - {5AD4C95C-BA38-4692-BA4B-8C25A86208F9}.Static lib - Release - Fast FPU|Win32.Build.0 = Release|Win32 - {5AD4C95C-BA38-4692-BA4B-8C25A86208F9}.Static lib - Release - Fast FPU|x64.ActiveCfg = Release|x64 - {5AD4C95C-BA38-4692-BA4B-8C25A86208F9}.Static lib - Release - Fast FPU|x64.Build.0 = Release|x64 - {5AD4C95C-BA38-4692-BA4B-8C25A86208F9}.Static lib - Release|Win32.ActiveCfg = Release|Win32 - {5AD4C95C-BA38-4692-BA4B-8C25A86208F9}.Static lib - Release|Win32.Build.0 = Release|Win32 - {5AD4C95C-BA38-4692-BA4B-8C25A86208F9}.Static lib - Release|x64.ActiveCfg = Release|x64 - {5AD4C95C-BA38-4692-BA4B-8C25A86208F9}.Static lib - Release|x64.Build.0 = Release|x64 - {D1A464A2-D479-458C-98A2-60965D823CD1}.Debug|Win32.ActiveCfg = Debug|Win32 - {D1A464A2-D479-458C-98A2-60965D823CD1}.Debug|Win32.Build.0 = Debug|Win32 - {D1A464A2-D479-458C-98A2-60965D823CD1}.Debug|x64.ActiveCfg = Debug|x64 - {D1A464A2-D479-458C-98A2-60965D823CD1}.Debug|x64.Build.0 = Debug|x64 - {D1A464A2-D479-458C-98A2-60965D823CD1}.Release - Fast FPU|Win32.ActiveCfg = Release|Win32 - {D1A464A2-D479-458C-98A2-60965D823CD1}.Release - Fast FPU|Win32.Build.0 = Release|Win32 - {D1A464A2-D479-458C-98A2-60965D823CD1}.Release - Fast FPU|x64.ActiveCfg = Release|x64 - {D1A464A2-D479-458C-98A2-60965D823CD1}.Release - Fast FPU|x64.Build.0 = Release|x64 - {D1A464A2-D479-458C-98A2-60965D823CD1}.Release|Win32.ActiveCfg = Release|Win32 - {D1A464A2-D479-458C-98A2-60965D823CD1}.Release|Win32.Build.0 = Release|Win32 - {D1A464A2-D479-458C-98A2-60965D823CD1}.Release|x64.ActiveCfg = Release|x64 - {D1A464A2-D479-458C-98A2-60965D823CD1}.Release|x64.Build.0 = Release|x64 - {D1A464A2-D479-458C-98A2-60965D823CD1}.SDL-Debug|Win32.ActiveCfg = Debug|Win32 - {D1A464A2-D479-458C-98A2-60965D823CD1}.SDL-Debug|Win32.Build.0 = Debug|Win32 - {D1A464A2-D479-458C-98A2-60965D823CD1}.SDL-Debug|x64.ActiveCfg = Debug|x64 - {D1A464A2-D479-458C-98A2-60965D823CD1}.SDL-Debug|x64.Build.0 = Debug|x64 - {D1A464A2-D479-458C-98A2-60965D823CD1}.Static lib - Debug|Win32.ActiveCfg = Debug|Win32 - {D1A464A2-D479-458C-98A2-60965D823CD1}.Static lib - Debug|Win32.Build.0 = Debug|Win32 - {D1A464A2-D479-458C-98A2-60965D823CD1}.Static lib - Debug|x64.ActiveCfg = Debug|x64 - {D1A464A2-D479-458C-98A2-60965D823CD1}.Static lib - Debug|x64.Build.0 = Debug|x64 - {D1A464A2-D479-458C-98A2-60965D823CD1}.Static lib - Release - Fast FPU|Win32.ActiveCfg = Release|Win32 - {D1A464A2-D479-458C-98A2-60965D823CD1}.Static lib - Release - Fast FPU|Win32.Build.0 = Release|Win32 - {D1A464A2-D479-458C-98A2-60965D823CD1}.Static lib - Release - Fast FPU|x64.ActiveCfg = Release|x64 - {D1A464A2-D479-458C-98A2-60965D823CD1}.Static lib - Release - Fast FPU|x64.Build.0 = Release|x64 - {D1A464A2-D479-458C-98A2-60965D823CD1}.Static lib - Release|Win32.ActiveCfg = Release|Win32 - {D1A464A2-D479-458C-98A2-60965D823CD1}.Static lib - Release|Win32.Build.0 = Release|Win32 - {D1A464A2-D479-458C-98A2-60965D823CD1}.Static lib - Release|x64.ActiveCfg = Release|x64 - {D1A464A2-D479-458C-98A2-60965D823CD1}.Static lib - Release|x64.Build.0 = Release|x64 - {171CCDFA-C140-4956-8EB7-F0168F4521D3}.Debug|Win32.ActiveCfg = Debug|Win32 - {171CCDFA-C140-4956-8EB7-F0168F4521D3}.Debug|Win32.Build.0 = Debug|Win32 - {171CCDFA-C140-4956-8EB7-F0168F4521D3}.Debug|x64.ActiveCfg = Debug|x64 - {171CCDFA-C140-4956-8EB7-F0168F4521D3}.Debug|x64.Build.0 = Debug|x64 - {171CCDFA-C140-4956-8EB7-F0168F4521D3}.Release - Fast FPU|Win32.ActiveCfg = Release|Win32 - {171CCDFA-C140-4956-8EB7-F0168F4521D3}.Release - Fast FPU|Win32.Build.0 = Release|Win32 - {171CCDFA-C140-4956-8EB7-F0168F4521D3}.Release - Fast FPU|x64.ActiveCfg = Release|x64 - {171CCDFA-C140-4956-8EB7-F0168F4521D3}.Release - Fast FPU|x64.Build.0 = Release|x64 - {171CCDFA-C140-4956-8EB7-F0168F4521D3}.Release|Win32.ActiveCfg = Release|Win32 - {171CCDFA-C140-4956-8EB7-F0168F4521D3}.Release|Win32.Build.0 = Release|Win32 - {171CCDFA-C140-4956-8EB7-F0168F4521D3}.Release|x64.ActiveCfg = Release|x64 - {171CCDFA-C140-4956-8EB7-F0168F4521D3}.Release|x64.Build.0 = Release|x64 - {171CCDFA-C140-4956-8EB7-F0168F4521D3}.SDL-Debug|Win32.ActiveCfg = Debug|Win32 - {171CCDFA-C140-4956-8EB7-F0168F4521D3}.SDL-Debug|Win32.Build.0 = Debug|Win32 - {171CCDFA-C140-4956-8EB7-F0168F4521D3}.SDL-Debug|x64.ActiveCfg = Debug|x64 - {171CCDFA-C140-4956-8EB7-F0168F4521D3}.SDL-Debug|x64.Build.0 = Debug|x64 - {171CCDFA-C140-4956-8EB7-F0168F4521D3}.Static lib - Debug|Win32.ActiveCfg = Debug|Win32 - {171CCDFA-C140-4956-8EB7-F0168F4521D3}.Static lib - Debug|Win32.Build.0 = Debug|Win32 - {171CCDFA-C140-4956-8EB7-F0168F4521D3}.Static lib - Debug|x64.ActiveCfg = Debug|x64 - {171CCDFA-C140-4956-8EB7-F0168F4521D3}.Static lib - Debug|x64.Build.0 = Debug|x64 - {171CCDFA-C140-4956-8EB7-F0168F4521D3}.Static lib - Release - Fast FPU|Win32.ActiveCfg = Release|Win32 - {171CCDFA-C140-4956-8EB7-F0168F4521D3}.Static lib - Release - Fast FPU|Win32.Build.0 = Release|Win32 - {171CCDFA-C140-4956-8EB7-F0168F4521D3}.Static lib - Release - Fast FPU|x64.ActiveCfg = Release|x64 - {171CCDFA-C140-4956-8EB7-F0168F4521D3}.Static lib - Release - Fast FPU|x64.Build.0 = Release|x64 - {171CCDFA-C140-4956-8EB7-F0168F4521D3}.Static lib - Release|Win32.ActiveCfg = Release|Win32 - {171CCDFA-C140-4956-8EB7-F0168F4521D3}.Static lib - Release|Win32.Build.0 = Release|Win32 - {171CCDFA-C140-4956-8EB7-F0168F4521D3}.Static lib - Release|x64.ActiveCfg = Release|x64 - {171CCDFA-C140-4956-8EB7-F0168F4521D3}.Static lib - Release|x64.Build.0 = Release|x64 - {7BDBB7E8-E0C9-4A0D-83C1-D389D6140FEF}.Debug|Win32.ActiveCfg = Debug|Win32 - {7BDBB7E8-E0C9-4A0D-83C1-D389D6140FEF}.Debug|Win32.Build.0 = Debug|Win32 - {7BDBB7E8-E0C9-4A0D-83C1-D389D6140FEF}.Debug|x64.ActiveCfg = Debug|x64 - {7BDBB7E8-E0C9-4A0D-83C1-D389D6140FEF}.Debug|x64.Build.0 = Debug|x64 - {7BDBB7E8-E0C9-4A0D-83C1-D389D6140FEF}.Release - Fast FPU|Win32.ActiveCfg = Release|Win32 - {7BDBB7E8-E0C9-4A0D-83C1-D389D6140FEF}.Release - Fast FPU|Win32.Build.0 = Release|Win32 - {7BDBB7E8-E0C9-4A0D-83C1-D389D6140FEF}.Release - Fast FPU|x64.ActiveCfg = Release|x64 - {7BDBB7E8-E0C9-4A0D-83C1-D389D6140FEF}.Release - Fast FPU|x64.Build.0 = Release|x64 - {7BDBB7E8-E0C9-4A0D-83C1-D389D6140FEF}.Release|Win32.ActiveCfg = Release|Win32 - {7BDBB7E8-E0C9-4A0D-83C1-D389D6140FEF}.Release|Win32.Build.0 = Release|Win32 - {7BDBB7E8-E0C9-4A0D-83C1-D389D6140FEF}.Release|x64.ActiveCfg = Release|x64 - {7BDBB7E8-E0C9-4A0D-83C1-D389D6140FEF}.Release|x64.Build.0 = Release|x64 - {7BDBB7E8-E0C9-4A0D-83C1-D389D6140FEF}.SDL-Debug|Win32.ActiveCfg = Debug|Win32 - {7BDBB7E8-E0C9-4A0D-83C1-D389D6140FEF}.SDL-Debug|Win32.Build.0 = Debug|Win32 - {7BDBB7E8-E0C9-4A0D-83C1-D389D6140FEF}.SDL-Debug|x64.ActiveCfg = Debug|x64 - {7BDBB7E8-E0C9-4A0D-83C1-D389D6140FEF}.SDL-Debug|x64.Build.0 = Debug|x64 - {7BDBB7E8-E0C9-4A0D-83C1-D389D6140FEF}.Static lib - Debug|Win32.ActiveCfg = Debug|Win32 - {7BDBB7E8-E0C9-4A0D-83C1-D389D6140FEF}.Static lib - Debug|Win32.Build.0 = Debug|Win32 - {7BDBB7E8-E0C9-4A0D-83C1-D389D6140FEF}.Static lib - Debug|x64.ActiveCfg = Debug|x64 - {7BDBB7E8-E0C9-4A0D-83C1-D389D6140FEF}.Static lib - Debug|x64.Build.0 = Debug|x64 - {7BDBB7E8-E0C9-4A0D-83C1-D389D6140FEF}.Static lib - Release - Fast FPU|Win32.ActiveCfg = Release|Win32 - {7BDBB7E8-E0C9-4A0D-83C1-D389D6140FEF}.Static lib - Release - Fast FPU|Win32.Build.0 = Release|Win32 - {7BDBB7E8-E0C9-4A0D-83C1-D389D6140FEF}.Static lib - Release - Fast FPU|x64.ActiveCfg = Release|x64 - {7BDBB7E8-E0C9-4A0D-83C1-D389D6140FEF}.Static lib - Release - Fast FPU|x64.Build.0 = Release|x64 - {7BDBB7E8-E0C9-4A0D-83C1-D389D6140FEF}.Static lib - Release|Win32.ActiveCfg = Release|Win32 - {7BDBB7E8-E0C9-4A0D-83C1-D389D6140FEF}.Static lib - Release|Win32.Build.0 = Release|Win32 - {7BDBB7E8-E0C9-4A0D-83C1-D389D6140FEF}.Static lib - Release|x64.ActiveCfg = Release|x64 - {7BDBB7E8-E0C9-4A0D-83C1-D389D6140FEF}.Static lib - Release|x64.Build.0 = Release|x64 - {622C9DD7-0391-49FF-AF53-24F9D5A8EC53}.Debug|Win32.ActiveCfg = Debug|Win32 - {622C9DD7-0391-49FF-AF53-24F9D5A8EC53}.Debug|Win32.Build.0 = Debug|Win32 - {622C9DD7-0391-49FF-AF53-24F9D5A8EC53}.Debug|x64.ActiveCfg = Debug|x64 - {622C9DD7-0391-49FF-AF53-24F9D5A8EC53}.Debug|x64.Build.0 = Debug|x64 - {622C9DD7-0391-49FF-AF53-24F9D5A8EC53}.Release - Fast FPU|Win32.ActiveCfg = Release|Win32 - {622C9DD7-0391-49FF-AF53-24F9D5A8EC53}.Release - Fast FPU|Win32.Build.0 = Release|Win32 - {622C9DD7-0391-49FF-AF53-24F9D5A8EC53}.Release - Fast FPU|x64.ActiveCfg = Release|x64 - {622C9DD7-0391-49FF-AF53-24F9D5A8EC53}.Release - Fast FPU|x64.Build.0 = Release|x64 - {622C9DD7-0391-49FF-AF53-24F9D5A8EC53}.Release|Win32.ActiveCfg = Release|Win32 - {622C9DD7-0391-49FF-AF53-24F9D5A8EC53}.Release|Win32.Build.0 = Release|Win32 - {622C9DD7-0391-49FF-AF53-24F9D5A8EC53}.Release|x64.ActiveCfg = Release|x64 - {622C9DD7-0391-49FF-AF53-24F9D5A8EC53}.Release|x64.Build.0 = Release|x64 - {622C9DD7-0391-49FF-AF53-24F9D5A8EC53}.SDL-Debug|Win32.ActiveCfg = Debug|Win32 - {622C9DD7-0391-49FF-AF53-24F9D5A8EC53}.SDL-Debug|Win32.Build.0 = Debug|Win32 - {622C9DD7-0391-49FF-AF53-24F9D5A8EC53}.SDL-Debug|x64.ActiveCfg = Debug|x64 - {622C9DD7-0391-49FF-AF53-24F9D5A8EC53}.SDL-Debug|x64.Build.0 = Debug|x64 - {622C9DD7-0391-49FF-AF53-24F9D5A8EC53}.Static lib - Debug|Win32.ActiveCfg = Debug|Win32 - {622C9DD7-0391-49FF-AF53-24F9D5A8EC53}.Static lib - Debug|Win32.Build.0 = Debug|Win32 - {622C9DD7-0391-49FF-AF53-24F9D5A8EC53}.Static lib - Debug|x64.ActiveCfg = Debug|x64 - {622C9DD7-0391-49FF-AF53-24F9D5A8EC53}.Static lib - Debug|x64.Build.0 = Debug|x64 - {622C9DD7-0391-49FF-AF53-24F9D5A8EC53}.Static lib - Release - Fast FPU|Win32.ActiveCfg = Release|Win32 - {622C9DD7-0391-49FF-AF53-24F9D5A8EC53}.Static lib - Release - Fast FPU|Win32.Build.0 = Release|Win32 - {622C9DD7-0391-49FF-AF53-24F9D5A8EC53}.Static lib - Release - Fast FPU|x64.ActiveCfg = Release|x64 - {622C9DD7-0391-49FF-AF53-24F9D5A8EC53}.Static lib - Release - Fast FPU|x64.Build.0 = Release|x64 - {622C9DD7-0391-49FF-AF53-24F9D5A8EC53}.Static lib - Release|Win32.ActiveCfg = Release|Win32 - {622C9DD7-0391-49FF-AF53-24F9D5A8EC53}.Static lib - Release|Win32.Build.0 = Release|Win32 - {622C9DD7-0391-49FF-AF53-24F9D5A8EC53}.Static lib - Release|x64.ActiveCfg = Release|x64 - {622C9DD7-0391-49FF-AF53-24F9D5A8EC53}.Static lib - Release|x64.Build.0 = Release|x64 - {E71B6F18-10DC-4101-A541-F6D33F71B2BD}.Debug|Win32.ActiveCfg = Debug|Win32 - {E71B6F18-10DC-4101-A541-F6D33F71B2BD}.Debug|Win32.Build.0 = Debug|Win32 - {E71B6F18-10DC-4101-A541-F6D33F71B2BD}.Debug|x64.ActiveCfg = Debug|x64 - {E71B6F18-10DC-4101-A541-F6D33F71B2BD}.Debug|x64.Build.0 = Debug|x64 - {E71B6F18-10DC-4101-A541-F6D33F71B2BD}.Release - Fast FPU|Win32.ActiveCfg = Release|Win32 - {E71B6F18-10DC-4101-A541-F6D33F71B2BD}.Release - Fast FPU|Win32.Build.0 = Release|Win32 - {E71B6F18-10DC-4101-A541-F6D33F71B2BD}.Release - Fast FPU|x64.ActiveCfg = Release|x64 - {E71B6F18-10DC-4101-A541-F6D33F71B2BD}.Release - Fast FPU|x64.Build.0 = Release|x64 - {E71B6F18-10DC-4101-A541-F6D33F71B2BD}.Release|Win32.ActiveCfg = Release|Win32 - {E71B6F18-10DC-4101-A541-F6D33F71B2BD}.Release|Win32.Build.0 = Release|Win32 - {E71B6F18-10DC-4101-A541-F6D33F71B2BD}.Release|x64.ActiveCfg = Release|x64 - {E71B6F18-10DC-4101-A541-F6D33F71B2BD}.Release|x64.Build.0 = Release|x64 - {E71B6F18-10DC-4101-A541-F6D33F71B2BD}.SDL-Debug|Win32.ActiveCfg = Debug|Win32 - {E71B6F18-10DC-4101-A541-F6D33F71B2BD}.SDL-Debug|Win32.Build.0 = Debug|Win32 - {E71B6F18-10DC-4101-A541-F6D33F71B2BD}.SDL-Debug|x64.ActiveCfg = Debug|x64 - {E71B6F18-10DC-4101-A541-F6D33F71B2BD}.SDL-Debug|x64.Build.0 = Debug|x64 - {E71B6F18-10DC-4101-A541-F6D33F71B2BD}.Static lib - Debug|Win32.ActiveCfg = Debug|Win32 - {E71B6F18-10DC-4101-A541-F6D33F71B2BD}.Static lib - Debug|Win32.Build.0 = Debug|Win32 - {E71B6F18-10DC-4101-A541-F6D33F71B2BD}.Static lib - Debug|x64.ActiveCfg = Debug|x64 - {E71B6F18-10DC-4101-A541-F6D33F71B2BD}.Static lib - Debug|x64.Build.0 = Debug|x64 - {E71B6F18-10DC-4101-A541-F6D33F71B2BD}.Static lib - Release - Fast FPU|Win32.ActiveCfg = Release|Win32 - {E71B6F18-10DC-4101-A541-F6D33F71B2BD}.Static lib - Release - Fast FPU|Win32.Build.0 = Release|Win32 - {E71B6F18-10DC-4101-A541-F6D33F71B2BD}.Static lib - Release - Fast FPU|x64.ActiveCfg = Release|x64 - {E71B6F18-10DC-4101-A541-F6D33F71B2BD}.Static lib - Release - Fast FPU|x64.Build.0 = Release|x64 - {E71B6F18-10DC-4101-A541-F6D33F71B2BD}.Static lib - Release|Win32.ActiveCfg = Release|Win32 - {E71B6F18-10DC-4101-A541-F6D33F71B2BD}.Static lib - Release|Win32.Build.0 = Release|Win32 - {E71B6F18-10DC-4101-A541-F6D33F71B2BD}.Static lib - Release|x64.ActiveCfg = Release|x64 - {E71B6F18-10DC-4101-A541-F6D33F71B2BD}.Static lib - Release|x64.Build.0 = Release|x64 - {3E30297B-5BE3-4A5C-B31E-08A28ADDB29E}.Debug|Win32.ActiveCfg = Debug|Win32 - {3E30297B-5BE3-4A5C-B31E-08A28ADDB29E}.Debug|Win32.Build.0 = Debug|Win32 - {3E30297B-5BE3-4A5C-B31E-08A28ADDB29E}.Debug|x64.ActiveCfg = Debug|x64 - {3E30297B-5BE3-4A5C-B31E-08A28ADDB29E}.Debug|x64.Build.0 = Debug|x64 - {3E30297B-5BE3-4A5C-B31E-08A28ADDB29E}.Release - Fast FPU|Win32.ActiveCfg = Release|Win32 - {3E30297B-5BE3-4A5C-B31E-08A28ADDB29E}.Release - Fast FPU|Win32.Build.0 = Release|Win32 - {3E30297B-5BE3-4A5C-B31E-08A28ADDB29E}.Release - Fast FPU|x64.ActiveCfg = Release|x64 - {3E30297B-5BE3-4A5C-B31E-08A28ADDB29E}.Release - Fast FPU|x64.Build.0 = Release|x64 - {3E30297B-5BE3-4A5C-B31E-08A28ADDB29E}.Release|Win32.ActiveCfg = Release|Win32 - {3E30297B-5BE3-4A5C-B31E-08A28ADDB29E}.Release|Win32.Build.0 = Release|Win32 - {3E30297B-5BE3-4A5C-B31E-08A28ADDB29E}.Release|x64.ActiveCfg = Release|x64 - {3E30297B-5BE3-4A5C-B31E-08A28ADDB29E}.Release|x64.Build.0 = Release|x64 - {3E30297B-5BE3-4A5C-B31E-08A28ADDB29E}.SDL-Debug|Win32.ActiveCfg = Debug|Win32 - {3E30297B-5BE3-4A5C-B31E-08A28ADDB29E}.SDL-Debug|Win32.Build.0 = Debug|Win32 - {3E30297B-5BE3-4A5C-B31E-08A28ADDB29E}.SDL-Debug|x64.ActiveCfg = Debug|x64 - {3E30297B-5BE3-4A5C-B31E-08A28ADDB29E}.SDL-Debug|x64.Build.0 = Debug|x64 - {3E30297B-5BE3-4A5C-B31E-08A28ADDB29E}.Static lib - Debug|Win32.ActiveCfg = Debug|Win32 - {3E30297B-5BE3-4A5C-B31E-08A28ADDB29E}.Static lib - Debug|Win32.Build.0 = Debug|Win32 - {3E30297B-5BE3-4A5C-B31E-08A28ADDB29E}.Static lib - Debug|x64.ActiveCfg = Debug|x64 - {3E30297B-5BE3-4A5C-B31E-08A28ADDB29E}.Static lib - Debug|x64.Build.0 = Debug|x64 - {3E30297B-5BE3-4A5C-B31E-08A28ADDB29E}.Static lib - Release - Fast FPU|Win32.ActiveCfg = Release|Win32 - {3E30297B-5BE3-4A5C-B31E-08A28ADDB29E}.Static lib - Release - Fast FPU|Win32.Build.0 = Release|Win32 - {3E30297B-5BE3-4A5C-B31E-08A28ADDB29E}.Static lib - Release - Fast FPU|x64.ActiveCfg = Release|x64 - {3E30297B-5BE3-4A5C-B31E-08A28ADDB29E}.Static lib - Release - Fast FPU|x64.Build.0 = Release|x64 - {3E30297B-5BE3-4A5C-B31E-08A28ADDB29E}.Static lib - Release|Win32.ActiveCfg = Release|Win32 - {3E30297B-5BE3-4A5C-B31E-08A28ADDB29E}.Static lib - Release|Win32.Build.0 = Release|Win32 - {3E30297B-5BE3-4A5C-B31E-08A28ADDB29E}.Static lib - Release|x64.ActiveCfg = Release|x64 - {3E30297B-5BE3-4A5C-B31E-08A28ADDB29E}.Static lib - Release|x64.Build.0 = Release|x64 - {C869BF55-B9D6-4980-BC92-60FA0CF8411A}.Debug|Win32.ActiveCfg = Debug|Win32 - {C869BF55-B9D6-4980-BC92-60FA0CF8411A}.Debug|Win32.Build.0 = Debug|Win32 - {C869BF55-B9D6-4980-BC92-60FA0CF8411A}.Debug|x64.ActiveCfg = Debug|x64 - {C869BF55-B9D6-4980-BC92-60FA0CF8411A}.Debug|x64.Build.0 = Debug|x64 - {C869BF55-B9D6-4980-BC92-60FA0CF8411A}.Release - Fast FPU|Win32.ActiveCfg = Release|Win32 - {C869BF55-B9D6-4980-BC92-60FA0CF8411A}.Release - Fast FPU|Win32.Build.0 = Release|Win32 - {C869BF55-B9D6-4980-BC92-60FA0CF8411A}.Release - Fast FPU|x64.ActiveCfg = Release|x64 - {C869BF55-B9D6-4980-BC92-60FA0CF8411A}.Release - Fast FPU|x64.Build.0 = Release|x64 - {C869BF55-B9D6-4980-BC92-60FA0CF8411A}.Release|Win32.ActiveCfg = Release|Win32 - {C869BF55-B9D6-4980-BC92-60FA0CF8411A}.Release|Win32.Build.0 = Release|Win32 - {C869BF55-B9D6-4980-BC92-60FA0CF8411A}.Release|x64.ActiveCfg = Release|x64 - {C869BF55-B9D6-4980-BC92-60FA0CF8411A}.Release|x64.Build.0 = Release|x64 - {C869BF55-B9D6-4980-BC92-60FA0CF8411A}.SDL-Debug|Win32.ActiveCfg = Debug|Win32 - {C869BF55-B9D6-4980-BC92-60FA0CF8411A}.SDL-Debug|Win32.Build.0 = Debug|Win32 - {C869BF55-B9D6-4980-BC92-60FA0CF8411A}.SDL-Debug|x64.ActiveCfg = Debug|x64 - {C869BF55-B9D6-4980-BC92-60FA0CF8411A}.SDL-Debug|x64.Build.0 = Debug|x64 - {C869BF55-B9D6-4980-BC92-60FA0CF8411A}.Static lib - Debug|Win32.ActiveCfg = Debug|Win32 - {C869BF55-B9D6-4980-BC92-60FA0CF8411A}.Static lib - Debug|Win32.Build.0 = Debug|Win32 - {C869BF55-B9D6-4980-BC92-60FA0CF8411A}.Static lib - Debug|x64.ActiveCfg = Debug|x64 - {C869BF55-B9D6-4980-BC92-60FA0CF8411A}.Static lib - Debug|x64.Build.0 = Debug|x64 - {C869BF55-B9D6-4980-BC92-60FA0CF8411A}.Static lib - Release - Fast FPU|Win32.ActiveCfg = Release|Win32 - {C869BF55-B9D6-4980-BC92-60FA0CF8411A}.Static lib - Release - Fast FPU|Win32.Build.0 = Release|Win32 - {C869BF55-B9D6-4980-BC92-60FA0CF8411A}.Static lib - Release - Fast FPU|x64.ActiveCfg = Release|x64 - {C869BF55-B9D6-4980-BC92-60FA0CF8411A}.Static lib - Release - Fast FPU|x64.Build.0 = Release|x64 - {C869BF55-B9D6-4980-BC92-60FA0CF8411A}.Static lib - Release|Win32.ActiveCfg = Release|Win32 - {C869BF55-B9D6-4980-BC92-60FA0CF8411A}.Static lib - Release|Win32.Build.0 = Release|Win32 - {C869BF55-B9D6-4980-BC92-60FA0CF8411A}.Static lib - Release|x64.ActiveCfg = Release|x64 - {C869BF55-B9D6-4980-BC92-60FA0CF8411A}.Static lib - Release|x64.Build.0 = Release|x64 - {2AE24484-22FC-481B-9A40-7CD0DA5C8E06}.Debug|Win32.ActiveCfg = Debug|Win32 - {2AE24484-22FC-481B-9A40-7CD0DA5C8E06}.Debug|Win32.Build.0 = Debug|Win32 - {2AE24484-22FC-481B-9A40-7CD0DA5C8E06}.Debug|x64.ActiveCfg = Debug|x64 - {2AE24484-22FC-481B-9A40-7CD0DA5C8E06}.Debug|x64.Build.0 = Debug|x64 - {2AE24484-22FC-481B-9A40-7CD0DA5C8E06}.Release - Fast FPU|Win32.ActiveCfg = Release|Win32 - {2AE24484-22FC-481B-9A40-7CD0DA5C8E06}.Release - Fast FPU|Win32.Build.0 = Release|Win32 - {2AE24484-22FC-481B-9A40-7CD0DA5C8E06}.Release - Fast FPU|x64.ActiveCfg = Release|x64 - {2AE24484-22FC-481B-9A40-7CD0DA5C8E06}.Release - Fast FPU|x64.Build.0 = Release|x64 - {2AE24484-22FC-481B-9A40-7CD0DA5C8E06}.Release|Win32.ActiveCfg = Release|Win32 - {2AE24484-22FC-481B-9A40-7CD0DA5C8E06}.Release|Win32.Build.0 = Release|Win32 - {2AE24484-22FC-481B-9A40-7CD0DA5C8E06}.Release|x64.ActiveCfg = Release|x64 - {2AE24484-22FC-481B-9A40-7CD0DA5C8E06}.Release|x64.Build.0 = Release|x64 - {2AE24484-22FC-481B-9A40-7CD0DA5C8E06}.SDL-Debug|Win32.ActiveCfg = Debug|Win32 - {2AE24484-22FC-481B-9A40-7CD0DA5C8E06}.SDL-Debug|Win32.Build.0 = Debug|Win32 - {2AE24484-22FC-481B-9A40-7CD0DA5C8E06}.SDL-Debug|x64.ActiveCfg = Debug|x64 - {2AE24484-22FC-481B-9A40-7CD0DA5C8E06}.SDL-Debug|x64.Build.0 = Debug|x64 - {2AE24484-22FC-481B-9A40-7CD0DA5C8E06}.Static lib - Debug|Win32.ActiveCfg = Debug|Win32 - {2AE24484-22FC-481B-9A40-7CD0DA5C8E06}.Static lib - Debug|Win32.Build.0 = Debug|Win32 - {2AE24484-22FC-481B-9A40-7CD0DA5C8E06}.Static lib - Debug|x64.ActiveCfg = Debug|x64 - {2AE24484-22FC-481B-9A40-7CD0DA5C8E06}.Static lib - Debug|x64.Build.0 = Debug|x64 - {2AE24484-22FC-481B-9A40-7CD0DA5C8E06}.Static lib - Release - Fast FPU|Win32.ActiveCfg = Release|Win32 - {2AE24484-22FC-481B-9A40-7CD0DA5C8E06}.Static lib - Release - Fast FPU|Win32.Build.0 = Release|Win32 - {2AE24484-22FC-481B-9A40-7CD0DA5C8E06}.Static lib - Release - Fast FPU|x64.ActiveCfg = Release|x64 - {2AE24484-22FC-481B-9A40-7CD0DA5C8E06}.Static lib - Release - Fast FPU|x64.Build.0 = Release|x64 - {2AE24484-22FC-481B-9A40-7CD0DA5C8E06}.Static lib - Release|Win32.ActiveCfg = Release|Win32 - {2AE24484-22FC-481B-9A40-7CD0DA5C8E06}.Static lib - Release|Win32.Build.0 = Release|Win32 - {2AE24484-22FC-481B-9A40-7CD0DA5C8E06}.Static lib - Release|x64.ActiveCfg = Release|x64 - {2AE24484-22FC-481B-9A40-7CD0DA5C8E06}.Static lib - Release|x64.Build.0 = Release|x64 - {27158C82-CD15-4A9B-9848-35E7065B209F}.Debug|Win32.ActiveCfg = Debug|Win32 - {27158C82-CD15-4A9B-9848-35E7065B209F}.Debug|Win32.Build.0 = Debug|Win32 - {27158C82-CD15-4A9B-9848-35E7065B209F}.Debug|x64.ActiveCfg = Debug|x64 - {27158C82-CD15-4A9B-9848-35E7065B209F}.Debug|x64.Build.0 = Debug|x64 - {27158C82-CD15-4A9B-9848-35E7065B209F}.Release - Fast FPU|Win32.ActiveCfg = Release|Win32 - {27158C82-CD15-4A9B-9848-35E7065B209F}.Release - Fast FPU|Win32.Build.0 = Release|Win32 - {27158C82-CD15-4A9B-9848-35E7065B209F}.Release - Fast FPU|x64.ActiveCfg = Release|x64 - {27158C82-CD15-4A9B-9848-35E7065B209F}.Release - Fast FPU|x64.Build.0 = Release|x64 - {27158C82-CD15-4A9B-9848-35E7065B209F}.Release|Win32.ActiveCfg = Release|Win32 - {27158C82-CD15-4A9B-9848-35E7065B209F}.Release|Win32.Build.0 = Release|Win32 - {27158C82-CD15-4A9B-9848-35E7065B209F}.Release|x64.ActiveCfg = Release|x64 - {27158C82-CD15-4A9B-9848-35E7065B209F}.Release|x64.Build.0 = Release|x64 - {27158C82-CD15-4A9B-9848-35E7065B209F}.SDL-Debug|Win32.ActiveCfg = Debug|Win32 - {27158C82-CD15-4A9B-9848-35E7065B209F}.SDL-Debug|Win32.Build.0 = Debug|Win32 - {27158C82-CD15-4A9B-9848-35E7065B209F}.SDL-Debug|x64.ActiveCfg = Debug|x64 - {27158C82-CD15-4A9B-9848-35E7065B209F}.SDL-Debug|x64.Build.0 = Debug|x64 - {27158C82-CD15-4A9B-9848-35E7065B209F}.Static lib - Debug|Win32.ActiveCfg = Debug|Win32 - {27158C82-CD15-4A9B-9848-35E7065B209F}.Static lib - Debug|Win32.Build.0 = Debug|Win32 - {27158C82-CD15-4A9B-9848-35E7065B209F}.Static lib - Debug|x64.ActiveCfg = Debug|x64 - {27158C82-CD15-4A9B-9848-35E7065B209F}.Static lib - Debug|x64.Build.0 = Debug|x64 - {27158C82-CD15-4A9B-9848-35E7065B209F}.Static lib - Release - Fast FPU|Win32.ActiveCfg = Release|Win32 - {27158C82-CD15-4A9B-9848-35E7065B209F}.Static lib - Release - Fast FPU|Win32.Build.0 = Release|Win32 - {27158C82-CD15-4A9B-9848-35E7065B209F}.Static lib - Release - Fast FPU|x64.ActiveCfg = Release|x64 - {27158C82-CD15-4A9B-9848-35E7065B209F}.Static lib - Release - Fast FPU|x64.Build.0 = Release|x64 - {27158C82-CD15-4A9B-9848-35E7065B209F}.Static lib - Release|Win32.ActiveCfg = Release|Win32 - {27158C82-CD15-4A9B-9848-35E7065B209F}.Static lib - Release|Win32.Build.0 = Release|Win32 - {27158C82-CD15-4A9B-9848-35E7065B209F}.Static lib - Release|x64.ActiveCfg = Release|x64 - {27158C82-CD15-4A9B-9848-35E7065B209F}.Static lib - Release|x64.Build.0 = Release|x64 - {C4B42409-542D-4EFC-9E6B-44713FD47A33}.Debug|Win32.ActiveCfg = Debug|Win32 - {C4B42409-542D-4EFC-9E6B-44713FD47A33}.Debug|Win32.Build.0 = Debug|Win32 - {C4B42409-542D-4EFC-9E6B-44713FD47A33}.Debug|x64.ActiveCfg = Debug|x64 - {C4B42409-542D-4EFC-9E6B-44713FD47A33}.Debug|x64.Build.0 = Debug|x64 - {C4B42409-542D-4EFC-9E6B-44713FD47A33}.Release - Fast FPU|Win32.ActiveCfg = Release|Win32 - {C4B42409-542D-4EFC-9E6B-44713FD47A33}.Release - Fast FPU|Win32.Build.0 = Release|Win32 - {C4B42409-542D-4EFC-9E6B-44713FD47A33}.Release - Fast FPU|x64.ActiveCfg = Release|x64 - {C4B42409-542D-4EFC-9E6B-44713FD47A33}.Release - Fast FPU|x64.Build.0 = Release|x64 - {C4B42409-542D-4EFC-9E6B-44713FD47A33}.Release|Win32.ActiveCfg = Release|Win32 - {C4B42409-542D-4EFC-9E6B-44713FD47A33}.Release|Win32.Build.0 = Release|Win32 - {C4B42409-542D-4EFC-9E6B-44713FD47A33}.Release|x64.ActiveCfg = Release|x64 - {C4B42409-542D-4EFC-9E6B-44713FD47A33}.Release|x64.Build.0 = Release|x64 - {C4B42409-542D-4EFC-9E6B-44713FD47A33}.SDL-Debug|Win32.ActiveCfg = Debug|Win32 - {C4B42409-542D-4EFC-9E6B-44713FD47A33}.SDL-Debug|Win32.Build.0 = Debug|Win32 - {C4B42409-542D-4EFC-9E6B-44713FD47A33}.SDL-Debug|x64.ActiveCfg = Debug|x64 - {C4B42409-542D-4EFC-9E6B-44713FD47A33}.SDL-Debug|x64.Build.0 = Debug|x64 - {C4B42409-542D-4EFC-9E6B-44713FD47A33}.Static lib - Debug|Win32.ActiveCfg = Debug|Win32 - {C4B42409-542D-4EFC-9E6B-44713FD47A33}.Static lib - Debug|Win32.Build.0 = Debug|Win32 - {C4B42409-542D-4EFC-9E6B-44713FD47A33}.Static lib - Debug|x64.ActiveCfg = Debug|x64 - {C4B42409-542D-4EFC-9E6B-44713FD47A33}.Static lib - Debug|x64.Build.0 = Debug|x64 - {C4B42409-542D-4EFC-9E6B-44713FD47A33}.Static lib - Release - Fast FPU|Win32.ActiveCfg = Release|Win32 - {C4B42409-542D-4EFC-9E6B-44713FD47A33}.Static lib - Release - Fast FPU|Win32.Build.0 = Release|Win32 - {C4B42409-542D-4EFC-9E6B-44713FD47A33}.Static lib - Release - Fast FPU|x64.ActiveCfg = Release|x64 - {C4B42409-542D-4EFC-9E6B-44713FD47A33}.Static lib - Release - Fast FPU|x64.Build.0 = Release|x64 - {C4B42409-542D-4EFC-9E6B-44713FD47A33}.Static lib - Release|Win32.ActiveCfg = Release|Win32 - {C4B42409-542D-4EFC-9E6B-44713FD47A33}.Static lib - Release|Win32.Build.0 = Release|Win32 - {C4B42409-542D-4EFC-9E6B-44713FD47A33}.Static lib - Release|x64.ActiveCfg = Release|x64 - {C4B42409-542D-4EFC-9E6B-44713FD47A33}.Static lib - Release|x64.Build.0 = Release|x64 - {3A5B74E5-6390-43B0-A459-2793B81FFD31}.Debug|Win32.ActiveCfg = Debug|Win32 - {3A5B74E5-6390-43B0-A459-2793B81FFD31}.Debug|Win32.Build.0 = Debug|Win32 - {3A5B74E5-6390-43B0-A459-2793B81FFD31}.Debug|x64.ActiveCfg = Debug|x64 - {3A5B74E5-6390-43B0-A459-2793B81FFD31}.Debug|x64.Build.0 = Debug|x64 - {3A5B74E5-6390-43B0-A459-2793B81FFD31}.Release - Fast FPU|Win32.ActiveCfg = Release|Win32 - {3A5B74E5-6390-43B0-A459-2793B81FFD31}.Release - Fast FPU|Win32.Build.0 = Release|Win32 - {3A5B74E5-6390-43B0-A459-2793B81FFD31}.Release - Fast FPU|x64.ActiveCfg = Release|x64 - {3A5B74E5-6390-43B0-A459-2793B81FFD31}.Release - Fast FPU|x64.Build.0 = Release|x64 - {3A5B74E5-6390-43B0-A459-2793B81FFD31}.Release|Win32.ActiveCfg = Release|Win32 - {3A5B74E5-6390-43B0-A459-2793B81FFD31}.Release|Win32.Build.0 = Release|Win32 - {3A5B74E5-6390-43B0-A459-2793B81FFD31}.Release|x64.ActiveCfg = Release|x64 - {3A5B74E5-6390-43B0-A459-2793B81FFD31}.Release|x64.Build.0 = Release|x64 - {3A5B74E5-6390-43B0-A459-2793B81FFD31}.SDL-Debug|Win32.ActiveCfg = Debug|Win32 - {3A5B74E5-6390-43B0-A459-2793B81FFD31}.SDL-Debug|Win32.Build.0 = Debug|Win32 - {3A5B74E5-6390-43B0-A459-2793B81FFD31}.SDL-Debug|x64.ActiveCfg = Debug|x64 - {3A5B74E5-6390-43B0-A459-2793B81FFD31}.SDL-Debug|x64.Build.0 = Debug|x64 - {3A5B74E5-6390-43B0-A459-2793B81FFD31}.Static lib - Debug|Win32.ActiveCfg = Debug|Win32 - {3A5B74E5-6390-43B0-A459-2793B81FFD31}.Static lib - Debug|Win32.Build.0 = Debug|Win32 - {3A5B74E5-6390-43B0-A459-2793B81FFD31}.Static lib - Debug|x64.ActiveCfg = Debug|x64 - {3A5B74E5-6390-43B0-A459-2793B81FFD31}.Static lib - Debug|x64.Build.0 = Debug|x64 - {3A5B74E5-6390-43B0-A459-2793B81FFD31}.Static lib - Release - Fast FPU|Win32.ActiveCfg = Release|Win32 - {3A5B74E5-6390-43B0-A459-2793B81FFD31}.Static lib - Release - Fast FPU|Win32.Build.0 = Release|Win32 - {3A5B74E5-6390-43B0-A459-2793B81FFD31}.Static lib - Release - Fast FPU|x64.ActiveCfg = Release|x64 - {3A5B74E5-6390-43B0-A459-2793B81FFD31}.Static lib - Release - Fast FPU|x64.Build.0 = Release|x64 - {3A5B74E5-6390-43B0-A459-2793B81FFD31}.Static lib - Release|Win32.ActiveCfg = Release|Win32 - {3A5B74E5-6390-43B0-A459-2793B81FFD31}.Static lib - Release|Win32.Build.0 = Release|Win32 - {3A5B74E5-6390-43B0-A459-2793B81FFD31}.Static lib - Release|x64.ActiveCfg = Release|x64 - {3A5B74E5-6390-43B0-A459-2793B81FFD31}.Static lib - Release|x64.Build.0 = Release|x64 - {0914E5C8-5352-467B-8421-C9EB35BD5596}.Debug|Win32.ActiveCfg = Debug|Win32 - {0914E5C8-5352-467B-8421-C9EB35BD5596}.Debug|Win32.Build.0 = Debug|Win32 - {0914E5C8-5352-467B-8421-C9EB35BD5596}.Debug|x64.ActiveCfg = Debug|x64 - {0914E5C8-5352-467B-8421-C9EB35BD5596}.Debug|x64.Build.0 = Debug|x64 - {0914E5C8-5352-467B-8421-C9EB35BD5596}.Release - Fast FPU|Win32.ActiveCfg = Release|Win32 - {0914E5C8-5352-467B-8421-C9EB35BD5596}.Release - Fast FPU|Win32.Build.0 = Release|Win32 - {0914E5C8-5352-467B-8421-C9EB35BD5596}.Release - Fast FPU|x64.ActiveCfg = Release|x64 - {0914E5C8-5352-467B-8421-C9EB35BD5596}.Release - Fast FPU|x64.Build.0 = Release|x64 - {0914E5C8-5352-467B-8421-C9EB35BD5596}.Release|Win32.ActiveCfg = Release|Win32 - {0914E5C8-5352-467B-8421-C9EB35BD5596}.Release|Win32.Build.0 = Release|Win32 - {0914E5C8-5352-467B-8421-C9EB35BD5596}.Release|x64.ActiveCfg = Release|x64 - {0914E5C8-5352-467B-8421-C9EB35BD5596}.Release|x64.Build.0 = Release|x64 - {0914E5C8-5352-467B-8421-C9EB35BD5596}.SDL-Debug|Win32.ActiveCfg = Debug|Win32 - {0914E5C8-5352-467B-8421-C9EB35BD5596}.SDL-Debug|Win32.Build.0 = Debug|Win32 - {0914E5C8-5352-467B-8421-C9EB35BD5596}.SDL-Debug|x64.ActiveCfg = Debug|x64 - {0914E5C8-5352-467B-8421-C9EB35BD5596}.SDL-Debug|x64.Build.0 = Debug|x64 - {0914E5C8-5352-467B-8421-C9EB35BD5596}.Static lib - Debug|Win32.ActiveCfg = Debug|Win32 - {0914E5C8-5352-467B-8421-C9EB35BD5596}.Static lib - Debug|Win32.Build.0 = Debug|Win32 - {0914E5C8-5352-467B-8421-C9EB35BD5596}.Static lib - Debug|x64.ActiveCfg = Debug|x64 - {0914E5C8-5352-467B-8421-C9EB35BD5596}.Static lib - Debug|x64.Build.0 = Debug|x64 - {0914E5C8-5352-467B-8421-C9EB35BD5596}.Static lib - Release - Fast FPU|Win32.ActiveCfg = Release|Win32 - {0914E5C8-5352-467B-8421-C9EB35BD5596}.Static lib - Release - Fast FPU|Win32.Build.0 = Release|Win32 - {0914E5C8-5352-467B-8421-C9EB35BD5596}.Static lib - Release - Fast FPU|x64.ActiveCfg = Release|x64 - {0914E5C8-5352-467B-8421-C9EB35BD5596}.Static lib - Release - Fast FPU|x64.Build.0 = Release|x64 - {0914E5C8-5352-467B-8421-C9EB35BD5596}.Static lib - Release|Win32.ActiveCfg = Release|Win32 - {0914E5C8-5352-467B-8421-C9EB35BD5596}.Static lib - Release|Win32.Build.0 = Release|Win32 - {0914E5C8-5352-467B-8421-C9EB35BD5596}.Static lib - Release|x64.ActiveCfg = Release|x64 - {0914E5C8-5352-467B-8421-C9EB35BD5596}.Static lib - Release|x64.Build.0 = Release|x64 - {772FBE05-D05A-467B-9842-BEC409EEA8D0}.Debug|Win32.ActiveCfg = Debug|Win32 - {772FBE05-D05A-467B-9842-BEC409EEA8D0}.Debug|Win32.Build.0 = Debug|Win32 - {772FBE05-D05A-467B-9842-BEC409EEA8D0}.Debug|x64.ActiveCfg = Debug|x64 - {772FBE05-D05A-467B-9842-BEC409EEA8D0}.Debug|x64.Build.0 = Debug|x64 - {772FBE05-D05A-467B-9842-BEC409EEA8D0}.Release - Fast FPU|Win32.ActiveCfg = Release|Win32 - {772FBE05-D05A-467B-9842-BEC409EEA8D0}.Release - Fast FPU|Win32.Build.0 = Release|Win32 - {772FBE05-D05A-467B-9842-BEC409EEA8D0}.Release - Fast FPU|x64.ActiveCfg = Release|x64 - {772FBE05-D05A-467B-9842-BEC409EEA8D0}.Release - Fast FPU|x64.Build.0 = Release|x64 - {772FBE05-D05A-467B-9842-BEC409EEA8D0}.Release|Win32.ActiveCfg = Release|Win32 - {772FBE05-D05A-467B-9842-BEC409EEA8D0}.Release|Win32.Build.0 = Release|Win32 - {772FBE05-D05A-467B-9842-BEC409EEA8D0}.Release|x64.ActiveCfg = Release|x64 - {772FBE05-D05A-467B-9842-BEC409EEA8D0}.Release|x64.Build.0 = Release|x64 - {772FBE05-D05A-467B-9842-BEC409EEA8D0}.SDL-Debug|Win32.ActiveCfg = Debug|Win32 - {772FBE05-D05A-467B-9842-BEC409EEA8D0}.SDL-Debug|Win32.Build.0 = Debug|Win32 - {772FBE05-D05A-467B-9842-BEC409EEA8D0}.SDL-Debug|x64.ActiveCfg = Debug|x64 - {772FBE05-D05A-467B-9842-BEC409EEA8D0}.SDL-Debug|x64.Build.0 = Debug|x64 - {772FBE05-D05A-467B-9842-BEC409EEA8D0}.Static lib - Debug|Win32.ActiveCfg = Debug|Win32 - {772FBE05-D05A-467B-9842-BEC409EEA8D0}.Static lib - Debug|Win32.Build.0 = Debug|Win32 - {772FBE05-D05A-467B-9842-BEC409EEA8D0}.Static lib - Debug|x64.ActiveCfg = Debug|x64 - {772FBE05-D05A-467B-9842-BEC409EEA8D0}.Static lib - Debug|x64.Build.0 = Debug|x64 - {772FBE05-D05A-467B-9842-BEC409EEA8D0}.Static lib - Release - Fast FPU|Win32.ActiveCfg = Release|Win32 - {772FBE05-D05A-467B-9842-BEC409EEA8D0}.Static lib - Release - Fast FPU|Win32.Build.0 = Release|Win32 - {772FBE05-D05A-467B-9842-BEC409EEA8D0}.Static lib - Release - Fast FPU|x64.ActiveCfg = Release|x64 - {772FBE05-D05A-467B-9842-BEC409EEA8D0}.Static lib - Release - Fast FPU|x64.Build.0 = Release|x64 - {772FBE05-D05A-467B-9842-BEC409EEA8D0}.Static lib - Release|Win32.ActiveCfg = Release|Win32 - {772FBE05-D05A-467B-9842-BEC409EEA8D0}.Static lib - Release|Win32.Build.0 = Release|Win32 - {772FBE05-D05A-467B-9842-BEC409EEA8D0}.Static lib - Release|x64.ActiveCfg = Release|x64 - {772FBE05-D05A-467B-9842-BEC409EEA8D0}.Static lib - Release|x64.Build.0 = Release|x64 - {78C9F424-523C-49AC-94B7-823AA4A26BF9}.Debug|Win32.ActiveCfg = Debug|Win32 - {78C9F424-523C-49AC-94B7-823AA4A26BF9}.Debug|Win32.Build.0 = Debug|Win32 - {78C9F424-523C-49AC-94B7-823AA4A26BF9}.Debug|x64.ActiveCfg = Debug|x64 - {78C9F424-523C-49AC-94B7-823AA4A26BF9}.Debug|x64.Build.0 = Debug|x64 - {78C9F424-523C-49AC-94B7-823AA4A26BF9}.Release - Fast FPU|Win32.ActiveCfg = Release|Win32 - {78C9F424-523C-49AC-94B7-823AA4A26BF9}.Release - Fast FPU|Win32.Build.0 = Release|Win32 - {78C9F424-523C-49AC-94B7-823AA4A26BF9}.Release - Fast FPU|x64.ActiveCfg = Release|x64 - {78C9F424-523C-49AC-94B7-823AA4A26BF9}.Release - Fast FPU|x64.Build.0 = Release|x64 - {78C9F424-523C-49AC-94B7-823AA4A26BF9}.Release|Win32.ActiveCfg = Release|Win32 - {78C9F424-523C-49AC-94B7-823AA4A26BF9}.Release|Win32.Build.0 = Release|Win32 - {78C9F424-523C-49AC-94B7-823AA4A26BF9}.Release|x64.ActiveCfg = Release|x64 - {78C9F424-523C-49AC-94B7-823AA4A26BF9}.Release|x64.Build.0 = Release|x64 - {78C9F424-523C-49AC-94B7-823AA4A26BF9}.SDL-Debug|Win32.ActiveCfg = Debug|Win32 - {78C9F424-523C-49AC-94B7-823AA4A26BF9}.SDL-Debug|Win32.Build.0 = Debug|Win32 - {78C9F424-523C-49AC-94B7-823AA4A26BF9}.SDL-Debug|x64.ActiveCfg = Debug|x64 - {78C9F424-523C-49AC-94B7-823AA4A26BF9}.SDL-Debug|x64.Build.0 = Debug|x64 - {78C9F424-523C-49AC-94B7-823AA4A26BF9}.Static lib - Debug|Win32.ActiveCfg = Debug|Win32 - {78C9F424-523C-49AC-94B7-823AA4A26BF9}.Static lib - Debug|Win32.Build.0 = Debug|Win32 - {78C9F424-523C-49AC-94B7-823AA4A26BF9}.Static lib - Debug|x64.ActiveCfg = Debug|x64 - {78C9F424-523C-49AC-94B7-823AA4A26BF9}.Static lib - Debug|x64.Build.0 = Debug|x64 - {78C9F424-523C-49AC-94B7-823AA4A26BF9}.Static lib - Release - Fast FPU|Win32.ActiveCfg = Release|Win32 - {78C9F424-523C-49AC-94B7-823AA4A26BF9}.Static lib - Release - Fast FPU|Win32.Build.0 = Release|Win32 - {78C9F424-523C-49AC-94B7-823AA4A26BF9}.Static lib - Release - Fast FPU|x64.ActiveCfg = Release|x64 - {78C9F424-523C-49AC-94B7-823AA4A26BF9}.Static lib - Release - Fast FPU|x64.Build.0 = Release|x64 - {78C9F424-523C-49AC-94B7-823AA4A26BF9}.Static lib - Release|Win32.ActiveCfg = Release|Win32 - {78C9F424-523C-49AC-94B7-823AA4A26BF9}.Static lib - Release|Win32.Build.0 = Release|Win32 - {78C9F424-523C-49AC-94B7-823AA4A26BF9}.Static lib - Release|x64.ActiveCfg = Release|x64 - {78C9F424-523C-49AC-94B7-823AA4A26BF9}.Static lib - Release|x64.Build.0 = Release|x64 - {EB3B38EA-5CE7-4983-845B-880661E69D09}.Debug|Win32.ActiveCfg = Debug|Win32 - {EB3B38EA-5CE7-4983-845B-880661E69D09}.Debug|Win32.Build.0 = Debug|Win32 - {EB3B38EA-5CE7-4983-845B-880661E69D09}.Debug|x64.ActiveCfg = Debug|x64 - {EB3B38EA-5CE7-4983-845B-880661E69D09}.Debug|x64.Build.0 = Debug|x64 - {EB3B38EA-5CE7-4983-845B-880661E69D09}.Release - Fast FPU|Win32.ActiveCfg = Release|Win32 - {EB3B38EA-5CE7-4983-845B-880661E69D09}.Release - Fast FPU|Win32.Build.0 = Release|Win32 - {EB3B38EA-5CE7-4983-845B-880661E69D09}.Release - Fast FPU|x64.ActiveCfg = Release|x64 - {EB3B38EA-5CE7-4983-845B-880661E69D09}.Release - Fast FPU|x64.Build.0 = Release|x64 - {EB3B38EA-5CE7-4983-845B-880661E69D09}.Release|Win32.ActiveCfg = Release|Win32 - {EB3B38EA-5CE7-4983-845B-880661E69D09}.Release|Win32.Build.0 = Release|Win32 - {EB3B38EA-5CE7-4983-845B-880661E69D09}.Release|x64.ActiveCfg = Release|x64 - {EB3B38EA-5CE7-4983-845B-880661E69D09}.Release|x64.Build.0 = Release|x64 - {EB3B38EA-5CE7-4983-845B-880661E69D09}.SDL-Debug|Win32.ActiveCfg = Debug|Win32 - {EB3B38EA-5CE7-4983-845B-880661E69D09}.SDL-Debug|Win32.Build.0 = Debug|Win32 - {EB3B38EA-5CE7-4983-845B-880661E69D09}.SDL-Debug|x64.ActiveCfg = Debug|x64 - {EB3B38EA-5CE7-4983-845B-880661E69D09}.SDL-Debug|x64.Build.0 = Debug|x64 - {EB3B38EA-5CE7-4983-845B-880661E69D09}.Static lib - Debug|Win32.ActiveCfg = Debug|Win32 - {EB3B38EA-5CE7-4983-845B-880661E69D09}.Static lib - Debug|Win32.Build.0 = Debug|Win32 - {EB3B38EA-5CE7-4983-845B-880661E69D09}.Static lib - Debug|x64.ActiveCfg = Debug|x64 - {EB3B38EA-5CE7-4983-845B-880661E69D09}.Static lib - Debug|x64.Build.0 = Debug|x64 - {EB3B38EA-5CE7-4983-845B-880661E69D09}.Static lib - Release - Fast FPU|Win32.ActiveCfg = Release|Win32 - {EB3B38EA-5CE7-4983-845B-880661E69D09}.Static lib - Release - Fast FPU|Win32.Build.0 = Release|Win32 - {EB3B38EA-5CE7-4983-845B-880661E69D09}.Static lib - Release - Fast FPU|x64.ActiveCfg = Release|x64 - {EB3B38EA-5CE7-4983-845B-880661E69D09}.Static lib - Release - Fast FPU|x64.Build.0 = Release|x64 - {EB3B38EA-5CE7-4983-845B-880661E69D09}.Static lib - Release|Win32.ActiveCfg = Release|Win32 - {EB3B38EA-5CE7-4983-845B-880661E69D09}.Static lib - Release|Win32.Build.0 = Release|Win32 - {EB3B38EA-5CE7-4983-845B-880661E69D09}.Static lib - Release|x64.ActiveCfg = Release|x64 - {EB3B38EA-5CE7-4983-845B-880661E69D09}.Static lib - Release|x64.Build.0 = Release|x64 - {1AB9413E-4F53-42A3-8CB2-CB4BE22336D0}.Debug|Win32.ActiveCfg = Debug|Win32 - {1AB9413E-4F53-42A3-8CB2-CB4BE22336D0}.Debug|Win32.Build.0 = Debug|Win32 - {1AB9413E-4F53-42A3-8CB2-CB4BE22336D0}.Debug|x64.ActiveCfg = Debug|x64 - {1AB9413E-4F53-42A3-8CB2-CB4BE22336D0}.Debug|x64.Build.0 = Debug|x64 - {1AB9413E-4F53-42A3-8CB2-CB4BE22336D0}.Release - Fast FPU|Win32.ActiveCfg = Release|Win32 - {1AB9413E-4F53-42A3-8CB2-CB4BE22336D0}.Release - Fast FPU|Win32.Build.0 = Release|Win32 - {1AB9413E-4F53-42A3-8CB2-CB4BE22336D0}.Release - Fast FPU|x64.ActiveCfg = Release|x64 - {1AB9413E-4F53-42A3-8CB2-CB4BE22336D0}.Release - Fast FPU|x64.Build.0 = Release|x64 - {1AB9413E-4F53-42A3-8CB2-CB4BE22336D0}.Release|Win32.ActiveCfg = Release|Win32 - {1AB9413E-4F53-42A3-8CB2-CB4BE22336D0}.Release|Win32.Build.0 = Release|Win32 - {1AB9413E-4F53-42A3-8CB2-CB4BE22336D0}.Release|x64.ActiveCfg = Release|x64 - {1AB9413E-4F53-42A3-8CB2-CB4BE22336D0}.Release|x64.Build.0 = Release|x64 - {1AB9413E-4F53-42A3-8CB2-CB4BE22336D0}.SDL-Debug|Win32.ActiveCfg = Debug|Win32 - {1AB9413E-4F53-42A3-8CB2-CB4BE22336D0}.SDL-Debug|Win32.Build.0 = Debug|Win32 - {1AB9413E-4F53-42A3-8CB2-CB4BE22336D0}.SDL-Debug|x64.ActiveCfg = Debug|x64 - {1AB9413E-4F53-42A3-8CB2-CB4BE22336D0}.SDL-Debug|x64.Build.0 = Debug|x64 - {1AB9413E-4F53-42A3-8CB2-CB4BE22336D0}.Static lib - Debug|Win32.ActiveCfg = Debug|Win32 - {1AB9413E-4F53-42A3-8CB2-CB4BE22336D0}.Static lib - Debug|Win32.Build.0 = Debug|Win32 - {1AB9413E-4F53-42A3-8CB2-CB4BE22336D0}.Static lib - Debug|x64.ActiveCfg = Debug|x64 - {1AB9413E-4F53-42A3-8CB2-CB4BE22336D0}.Static lib - Debug|x64.Build.0 = Debug|x64 - {1AB9413E-4F53-42A3-8CB2-CB4BE22336D0}.Static lib - Release - Fast FPU|Win32.ActiveCfg = Release|Win32 - {1AB9413E-4F53-42A3-8CB2-CB4BE22336D0}.Static lib - Release - Fast FPU|Win32.Build.0 = Release|Win32 - {1AB9413E-4F53-42A3-8CB2-CB4BE22336D0}.Static lib - Release - Fast FPU|x64.ActiveCfg = Release|x64 - {1AB9413E-4F53-42A3-8CB2-CB4BE22336D0}.Static lib - Release - Fast FPU|x64.Build.0 = Release|x64 - {1AB9413E-4F53-42A3-8CB2-CB4BE22336D0}.Static lib - Release|Win32.ActiveCfg = Release|Win32 - {1AB9413E-4F53-42A3-8CB2-CB4BE22336D0}.Static lib - Release|Win32.Build.0 = Release|Win32 - {1AB9413E-4F53-42A3-8CB2-CB4BE22336D0}.Static lib - Release|x64.ActiveCfg = Release|x64 - {1AB9413E-4F53-42A3-8CB2-CB4BE22336D0}.Static lib - Release|x64.Build.0 = Release|x64 - {FE853A36-E0D1-4AC5-A792-B643E70D2953}.Debug|Win32.ActiveCfg = Debug|Win32 - {FE853A36-E0D1-4AC5-A792-B643E70D2953}.Debug|Win32.Build.0 = Debug|Win32 - {FE853A36-E0D1-4AC5-A792-B643E70D2953}.Debug|x64.ActiveCfg = Debug|x64 - {FE853A36-E0D1-4AC5-A792-B643E70D2953}.Debug|x64.Build.0 = Debug|x64 - {FE853A36-E0D1-4AC5-A792-B643E70D2953}.Release - Fast FPU|Win32.ActiveCfg = Release|Win32 - {FE853A36-E0D1-4AC5-A792-B643E70D2953}.Release - Fast FPU|Win32.Build.0 = Release|Win32 - {FE853A36-E0D1-4AC5-A792-B643E70D2953}.Release - Fast FPU|x64.ActiveCfg = Release|x64 - {FE853A36-E0D1-4AC5-A792-B643E70D2953}.Release - Fast FPU|x64.Build.0 = Release|x64 - {FE853A36-E0D1-4AC5-A792-B643E70D2953}.Release|Win32.ActiveCfg = Release|Win32 - {FE853A36-E0D1-4AC5-A792-B643E70D2953}.Release|Win32.Build.0 = Release|Win32 - {FE853A36-E0D1-4AC5-A792-B643E70D2953}.Release|x64.ActiveCfg = Release|x64 - {FE853A36-E0D1-4AC5-A792-B643E70D2953}.Release|x64.Build.0 = Release|x64 - {FE853A36-E0D1-4AC5-A792-B643E70D2953}.SDL-Debug|Win32.ActiveCfg = Debug|Win32 - {FE853A36-E0D1-4AC5-A792-B643E70D2953}.SDL-Debug|Win32.Build.0 = Debug|Win32 - {FE853A36-E0D1-4AC5-A792-B643E70D2953}.SDL-Debug|x64.ActiveCfg = Debug|x64 - {FE853A36-E0D1-4AC5-A792-B643E70D2953}.SDL-Debug|x64.Build.0 = Debug|x64 - {FE853A36-E0D1-4AC5-A792-B643E70D2953}.Static lib - Debug|Win32.ActiveCfg = Debug|Win32 - {FE853A36-E0D1-4AC5-A792-B643E70D2953}.Static lib - Debug|Win32.Build.0 = Debug|Win32 - {FE853A36-E0D1-4AC5-A792-B643E70D2953}.Static lib - Debug|x64.ActiveCfg = Debug|x64 - {FE853A36-E0D1-4AC5-A792-B643E70D2953}.Static lib - Debug|x64.Build.0 = Debug|x64 - {FE853A36-E0D1-4AC5-A792-B643E70D2953}.Static lib - Release - Fast FPU|Win32.ActiveCfg = Release|Win32 - {FE853A36-E0D1-4AC5-A792-B643E70D2953}.Static lib - Release - Fast FPU|Win32.Build.0 = Release|Win32 - {FE853A36-E0D1-4AC5-A792-B643E70D2953}.Static lib - Release - Fast FPU|x64.ActiveCfg = Release|x64 - {FE853A36-E0D1-4AC5-A792-B643E70D2953}.Static lib - Release - Fast FPU|x64.Build.0 = Release|x64 - {FE853A36-E0D1-4AC5-A792-B643E70D2953}.Static lib - Release|Win32.ActiveCfg = Release|Win32 - {FE853A36-E0D1-4AC5-A792-B643E70D2953}.Static lib - Release|Win32.Build.0 = Release|Win32 - {FE853A36-E0D1-4AC5-A792-B643E70D2953}.Static lib - Release|x64.ActiveCfg = Release|x64 - {FE853A36-E0D1-4AC5-A792-B643E70D2953}.Static lib - Release|x64.Build.0 = Release|x64 - {16007FE2-142B-47F8-93E1-519BA3F39E71}.Debug|Win32.ActiveCfg = Debug|Win32 - {16007FE2-142B-47F8-93E1-519BA3F39E71}.Debug|Win32.Build.0 = Debug|Win32 - {16007FE2-142B-47F8-93E1-519BA3F39E71}.Debug|x64.ActiveCfg = Debug|x64 - {16007FE2-142B-47F8-93E1-519BA3F39E71}.Debug|x64.Build.0 = Debug|x64 - {16007FE2-142B-47F8-93E1-519BA3F39E71}.Release - Fast FPU|Win32.ActiveCfg = Release|Win32 - {16007FE2-142B-47F8-93E1-519BA3F39E71}.Release - Fast FPU|Win32.Build.0 = Release|Win32 - {16007FE2-142B-47F8-93E1-519BA3F39E71}.Release - Fast FPU|x64.ActiveCfg = Release|x64 - {16007FE2-142B-47F8-93E1-519BA3F39E71}.Release - Fast FPU|x64.Build.0 = Release|x64 - {16007FE2-142B-47F8-93E1-519BA3F39E71}.Release|Win32.ActiveCfg = Release|Win32 - {16007FE2-142B-47F8-93E1-519BA3F39E71}.Release|Win32.Build.0 = Release|Win32 - {16007FE2-142B-47F8-93E1-519BA3F39E71}.Release|x64.ActiveCfg = Release|x64 - {16007FE2-142B-47F8-93E1-519BA3F39E71}.Release|x64.Build.0 = Release|x64 - {16007FE2-142B-47F8-93E1-519BA3F39E71}.SDL-Debug|Win32.ActiveCfg = Debug|Win32 - {16007FE2-142B-47F8-93E1-519BA3F39E71}.SDL-Debug|Win32.Build.0 = Debug|Win32 - {16007FE2-142B-47F8-93E1-519BA3F39E71}.SDL-Debug|x64.ActiveCfg = Debug|x64 - {16007FE2-142B-47F8-93E1-519BA3F39E71}.SDL-Debug|x64.Build.0 = Debug|x64 - {16007FE2-142B-47F8-93E1-519BA3F39E71}.Static lib - Debug|Win32.ActiveCfg = Debug|Win32 - {16007FE2-142B-47F8-93E1-519BA3F39E71}.Static lib - Debug|Win32.Build.0 = Debug|Win32 - {16007FE2-142B-47F8-93E1-519BA3F39E71}.Static lib - Debug|x64.ActiveCfg = Debug|x64 - {16007FE2-142B-47F8-93E1-519BA3F39E71}.Static lib - Debug|x64.Build.0 = Debug|x64 - {16007FE2-142B-47F8-93E1-519BA3F39E71}.Static lib - Release - Fast FPU|Win32.ActiveCfg = Release|Win32 - {16007FE2-142B-47F8-93E1-519BA3F39E71}.Static lib - Release - Fast FPU|Win32.Build.0 = Release|Win32 - {16007FE2-142B-47F8-93E1-519BA3F39E71}.Static lib - Release - Fast FPU|x64.ActiveCfg = Release|x64 - {16007FE2-142B-47F8-93E1-519BA3F39E71}.Static lib - Release - Fast FPU|x64.Build.0 = Release|x64 - {16007FE2-142B-47F8-93E1-519BA3F39E71}.Static lib - Release|Win32.ActiveCfg = Release|Win32 - {16007FE2-142B-47F8-93E1-519BA3F39E71}.Static lib - Release|Win32.Build.0 = Release|Win32 - {16007FE2-142B-47F8-93E1-519BA3F39E71}.Static lib - Release|x64.ActiveCfg = Release|x64 - {16007FE2-142B-47F8-93E1-519BA3F39E71}.Static lib - Release|x64.Build.0 = Release|x64 - {CDC4AAA9-72E1-4FFA-A04D-7EF59D8B97CD}.Debug|Win32.ActiveCfg = Debug|Win32 - {CDC4AAA9-72E1-4FFA-A04D-7EF59D8B97CD}.Debug|Win32.Build.0 = Debug|Win32 - {CDC4AAA9-72E1-4FFA-A04D-7EF59D8B97CD}.Debug|x64.ActiveCfg = Debug|x64 - {CDC4AAA9-72E1-4FFA-A04D-7EF59D8B97CD}.Debug|x64.Build.0 = Debug|x64 - {CDC4AAA9-72E1-4FFA-A04D-7EF59D8B97CD}.Release - Fast FPU|Win32.ActiveCfg = Release|Win32 - {CDC4AAA9-72E1-4FFA-A04D-7EF59D8B97CD}.Release - Fast FPU|Win32.Build.0 = Release|Win32 - {CDC4AAA9-72E1-4FFA-A04D-7EF59D8B97CD}.Release - Fast FPU|x64.ActiveCfg = Release|x64 - {CDC4AAA9-72E1-4FFA-A04D-7EF59D8B97CD}.Release - Fast FPU|x64.Build.0 = Release|x64 - {CDC4AAA9-72E1-4FFA-A04D-7EF59D8B97CD}.Release|Win32.ActiveCfg = Release|Win32 - {CDC4AAA9-72E1-4FFA-A04D-7EF59D8B97CD}.Release|Win32.Build.0 = Release|Win32 - {CDC4AAA9-72E1-4FFA-A04D-7EF59D8B97CD}.Release|x64.ActiveCfg = Release|x64 - {CDC4AAA9-72E1-4FFA-A04D-7EF59D8B97CD}.Release|x64.Build.0 = Release|x64 - {CDC4AAA9-72E1-4FFA-A04D-7EF59D8B97CD}.SDL-Debug|Win32.ActiveCfg = Debug|Win32 - {CDC4AAA9-72E1-4FFA-A04D-7EF59D8B97CD}.SDL-Debug|Win32.Build.0 = Debug|Win32 - {CDC4AAA9-72E1-4FFA-A04D-7EF59D8B97CD}.SDL-Debug|x64.ActiveCfg = Debug|x64 - {CDC4AAA9-72E1-4FFA-A04D-7EF59D8B97CD}.SDL-Debug|x64.Build.0 = Debug|x64 - {CDC4AAA9-72E1-4FFA-A04D-7EF59D8B97CD}.Static lib - Debug|Win32.ActiveCfg = Debug|Win32 - {CDC4AAA9-72E1-4FFA-A04D-7EF59D8B97CD}.Static lib - Debug|Win32.Build.0 = Debug|Win32 - {CDC4AAA9-72E1-4FFA-A04D-7EF59D8B97CD}.Static lib - Debug|x64.ActiveCfg = Debug|x64 - {CDC4AAA9-72E1-4FFA-A04D-7EF59D8B97CD}.Static lib - Debug|x64.Build.0 = Debug|x64 - {CDC4AAA9-72E1-4FFA-A04D-7EF59D8B97CD}.Static lib - Release - Fast FPU|Win32.ActiveCfg = Release|Win32 - {CDC4AAA9-72E1-4FFA-A04D-7EF59D8B97CD}.Static lib - Release - Fast FPU|Win32.Build.0 = Release|Win32 - {CDC4AAA9-72E1-4FFA-A04D-7EF59D8B97CD}.Static lib - Release - Fast FPU|x64.ActiveCfg = Release|x64 - {CDC4AAA9-72E1-4FFA-A04D-7EF59D8B97CD}.Static lib - Release - Fast FPU|x64.Build.0 = Release|x64 - {CDC4AAA9-72E1-4FFA-A04D-7EF59D8B97CD}.Static lib - Release|Win32.ActiveCfg = Release|Win32 - {CDC4AAA9-72E1-4FFA-A04D-7EF59D8B97CD}.Static lib - Release|Win32.Build.0 = Release|Win32 - {CDC4AAA9-72E1-4FFA-A04D-7EF59D8B97CD}.Static lib - Release|x64.ActiveCfg = Release|x64 - {CDC4AAA9-72E1-4FFA-A04D-7EF59D8B97CD}.Static lib - Release|x64.Build.0 = Release|x64 - {4E6C2F8D-BA92-4C5B-96FD-72D4FE8BD7FA}.Debug|Win32.ActiveCfg = Debug|Win32 - {4E6C2F8D-BA92-4C5B-96FD-72D4FE8BD7FA}.Debug|Win32.Build.0 = Debug|Win32 - {4E6C2F8D-BA92-4C5B-96FD-72D4FE8BD7FA}.Debug|x64.ActiveCfg = Debug|x64 - {4E6C2F8D-BA92-4C5B-96FD-72D4FE8BD7FA}.Debug|x64.Build.0 = Debug|x64 - {4E6C2F8D-BA92-4C5B-96FD-72D4FE8BD7FA}.Release - Fast FPU|Win32.ActiveCfg = Release|Win32 - {4E6C2F8D-BA92-4C5B-96FD-72D4FE8BD7FA}.Release - Fast FPU|Win32.Build.0 = Release|Win32 - {4E6C2F8D-BA92-4C5B-96FD-72D4FE8BD7FA}.Release - Fast FPU|x64.ActiveCfg = Release|x64 - {4E6C2F8D-BA92-4C5B-96FD-72D4FE8BD7FA}.Release - Fast FPU|x64.Build.0 = Release|x64 - {4E6C2F8D-BA92-4C5B-96FD-72D4FE8BD7FA}.Release|Win32.ActiveCfg = Release|Win32 - {4E6C2F8D-BA92-4C5B-96FD-72D4FE8BD7FA}.Release|Win32.Build.0 = Release|Win32 - {4E6C2F8D-BA92-4C5B-96FD-72D4FE8BD7FA}.Release|x64.ActiveCfg = Release|x64 - {4E6C2F8D-BA92-4C5B-96FD-72D4FE8BD7FA}.Release|x64.Build.0 = Release|x64 - {4E6C2F8D-BA92-4C5B-96FD-72D4FE8BD7FA}.SDL-Debug|Win32.ActiveCfg = Debug|Win32 - {4E6C2F8D-BA92-4C5B-96FD-72D4FE8BD7FA}.SDL-Debug|Win32.Build.0 = Debug|Win32 - {4E6C2F8D-BA92-4C5B-96FD-72D4FE8BD7FA}.SDL-Debug|x64.ActiveCfg = Debug|x64 - {4E6C2F8D-BA92-4C5B-96FD-72D4FE8BD7FA}.SDL-Debug|x64.Build.0 = Debug|x64 - {4E6C2F8D-BA92-4C5B-96FD-72D4FE8BD7FA}.Static lib - Debug|Win32.ActiveCfg = Debug|Win32 - {4E6C2F8D-BA92-4C5B-96FD-72D4FE8BD7FA}.Static lib - Debug|Win32.Build.0 = Debug|Win32 - {4E6C2F8D-BA92-4C5B-96FD-72D4FE8BD7FA}.Static lib - Debug|x64.ActiveCfg = Debug|x64 - {4E6C2F8D-BA92-4C5B-96FD-72D4FE8BD7FA}.Static lib - Debug|x64.Build.0 = Debug|x64 - {4E6C2F8D-BA92-4C5B-96FD-72D4FE8BD7FA}.Static lib - Release - Fast FPU|Win32.ActiveCfg = Release|Win32 - {4E6C2F8D-BA92-4C5B-96FD-72D4FE8BD7FA}.Static lib - Release - Fast FPU|Win32.Build.0 = Release|Win32 - {4E6C2F8D-BA92-4C5B-96FD-72D4FE8BD7FA}.Static lib - Release - Fast FPU|x64.ActiveCfg = Release|x64 - {4E6C2F8D-BA92-4C5B-96FD-72D4FE8BD7FA}.Static lib - Release - Fast FPU|x64.Build.0 = Release|x64 - {4E6C2F8D-BA92-4C5B-96FD-72D4FE8BD7FA}.Static lib - Release|Win32.ActiveCfg = Release|Win32 - {4E6C2F8D-BA92-4C5B-96FD-72D4FE8BD7FA}.Static lib - Release|Win32.Build.0 = Release|Win32 - {4E6C2F8D-BA92-4C5B-96FD-72D4FE8BD7FA}.Static lib - Release|x64.ActiveCfg = Release|x64 - {4E6C2F8D-BA92-4C5B-96FD-72D4FE8BD7FA}.Static lib - Release|x64.Build.0 = Release|x64 - {6AEC2AA2-C9FF-4B7D-B07A-94A9D34B41D7}.Debug|Win32.ActiveCfg = Debug|Win32 - {6AEC2AA2-C9FF-4B7D-B07A-94A9D34B41D7}.Debug|Win32.Build.0 = Debug|Win32 - {6AEC2AA2-C9FF-4B7D-B07A-94A9D34B41D7}.Debug|x64.ActiveCfg = Debug|x64 - {6AEC2AA2-C9FF-4B7D-B07A-94A9D34B41D7}.Debug|x64.Build.0 = Debug|x64 - {6AEC2AA2-C9FF-4B7D-B07A-94A9D34B41D7}.Release - Fast FPU|Win32.ActiveCfg = Release|Win32 - {6AEC2AA2-C9FF-4B7D-B07A-94A9D34B41D7}.Release - Fast FPU|Win32.Build.0 = Release|Win32 - {6AEC2AA2-C9FF-4B7D-B07A-94A9D34B41D7}.Release - Fast FPU|x64.ActiveCfg = Release|x64 - {6AEC2AA2-C9FF-4B7D-B07A-94A9D34B41D7}.Release - Fast FPU|x64.Build.0 = Release|x64 - {6AEC2AA2-C9FF-4B7D-B07A-94A9D34B41D7}.Release|Win32.ActiveCfg = Release|Win32 - {6AEC2AA2-C9FF-4B7D-B07A-94A9D34B41D7}.Release|Win32.Build.0 = Release|Win32 - {6AEC2AA2-C9FF-4B7D-B07A-94A9D34B41D7}.Release|x64.ActiveCfg = Release|x64 - {6AEC2AA2-C9FF-4B7D-B07A-94A9D34B41D7}.Release|x64.Build.0 = Release|x64 - {6AEC2AA2-C9FF-4B7D-B07A-94A9D34B41D7}.SDL-Debug|Win32.ActiveCfg = Debug|Win32 - {6AEC2AA2-C9FF-4B7D-B07A-94A9D34B41D7}.SDL-Debug|Win32.Build.0 = Debug|Win32 - {6AEC2AA2-C9FF-4B7D-B07A-94A9D34B41D7}.SDL-Debug|x64.ActiveCfg = Debug|x64 - {6AEC2AA2-C9FF-4B7D-B07A-94A9D34B41D7}.SDL-Debug|x64.Build.0 = Debug|x64 - {6AEC2AA2-C9FF-4B7D-B07A-94A9D34B41D7}.Static lib - Debug|Win32.ActiveCfg = Debug|Win32 - {6AEC2AA2-C9FF-4B7D-B07A-94A9D34B41D7}.Static lib - Debug|Win32.Build.0 = Debug|Win32 - {6AEC2AA2-C9FF-4B7D-B07A-94A9D34B41D7}.Static lib - Debug|x64.ActiveCfg = Debug|x64 - {6AEC2AA2-C9FF-4B7D-B07A-94A9D34B41D7}.Static lib - Debug|x64.Build.0 = Debug|x64 - {6AEC2AA2-C9FF-4B7D-B07A-94A9D34B41D7}.Static lib - Release - Fast FPU|Win32.ActiveCfg = Release|Win32 - {6AEC2AA2-C9FF-4B7D-B07A-94A9D34B41D7}.Static lib - Release - Fast FPU|Win32.Build.0 = Release|Win32 - {6AEC2AA2-C9FF-4B7D-B07A-94A9D34B41D7}.Static lib - Release - Fast FPU|x64.ActiveCfg = Release|x64 - {6AEC2AA2-C9FF-4B7D-B07A-94A9D34B41D7}.Static lib - Release - Fast FPU|x64.Build.0 = Release|x64 - {6AEC2AA2-C9FF-4B7D-B07A-94A9D34B41D7}.Static lib - Release|Win32.ActiveCfg = Release|Win32 - {6AEC2AA2-C9FF-4B7D-B07A-94A9D34B41D7}.Static lib - Release|Win32.Build.0 = Release|Win32 - {6AEC2AA2-C9FF-4B7D-B07A-94A9D34B41D7}.Static lib - Release|x64.ActiveCfg = Release|x64 - {6AEC2AA2-C9FF-4B7D-B07A-94A9D34B41D7}.Static lib - Release|x64.Build.0 = Release|x64 - {02B67A37-50E1-49DB-BECF-905BC029C2FE}.Debug|Win32.ActiveCfg = Debug|Win32 - {02B67A37-50E1-49DB-BECF-905BC029C2FE}.Debug|Win32.Build.0 = Debug|Win32 - {02B67A37-50E1-49DB-BECF-905BC029C2FE}.Debug|x64.ActiveCfg = Debug|x64 - {02B67A37-50E1-49DB-BECF-905BC029C2FE}.Debug|x64.Build.0 = Debug|x64 - {02B67A37-50E1-49DB-BECF-905BC029C2FE}.Release - Fast FPU|Win32.ActiveCfg = Release|Win32 - {02B67A37-50E1-49DB-BECF-905BC029C2FE}.Release - Fast FPU|Win32.Build.0 = Release|Win32 - {02B67A37-50E1-49DB-BECF-905BC029C2FE}.Release - Fast FPU|x64.ActiveCfg = Release|x64 - {02B67A37-50E1-49DB-BECF-905BC029C2FE}.Release - Fast FPU|x64.Build.0 = Release|x64 - {02B67A37-50E1-49DB-BECF-905BC029C2FE}.Release|Win32.ActiveCfg = Release|Win32 - {02B67A37-50E1-49DB-BECF-905BC029C2FE}.Release|Win32.Build.0 = Release|Win32 - {02B67A37-50E1-49DB-BECF-905BC029C2FE}.Release|x64.ActiveCfg = Release|x64 - {02B67A37-50E1-49DB-BECF-905BC029C2FE}.Release|x64.Build.0 = Release|x64 - {02B67A37-50E1-49DB-BECF-905BC029C2FE}.SDL-Debug|Win32.ActiveCfg = Debug|Win32 - {02B67A37-50E1-49DB-BECF-905BC029C2FE}.SDL-Debug|Win32.Build.0 = Debug|Win32 - {02B67A37-50E1-49DB-BECF-905BC029C2FE}.SDL-Debug|x64.ActiveCfg = Debug|x64 - {02B67A37-50E1-49DB-BECF-905BC029C2FE}.SDL-Debug|x64.Build.0 = Debug|x64 - {02B67A37-50E1-49DB-BECF-905BC029C2FE}.Static lib - Debug|Win32.ActiveCfg = Debug|Win32 - {02B67A37-50E1-49DB-BECF-905BC029C2FE}.Static lib - Debug|Win32.Build.0 = Debug|Win32 - {02B67A37-50E1-49DB-BECF-905BC029C2FE}.Static lib - Debug|x64.ActiveCfg = Debug|x64 - {02B67A37-50E1-49DB-BECF-905BC029C2FE}.Static lib - Debug|x64.Build.0 = Debug|x64 - {02B67A37-50E1-49DB-BECF-905BC029C2FE}.Static lib - Release - Fast FPU|Win32.ActiveCfg = Release|Win32 - {02B67A37-50E1-49DB-BECF-905BC029C2FE}.Static lib - Release - Fast FPU|Win32.Build.0 = Release|Win32 - {02B67A37-50E1-49DB-BECF-905BC029C2FE}.Static lib - Release - Fast FPU|x64.ActiveCfg = Release|x64 - {02B67A37-50E1-49DB-BECF-905BC029C2FE}.Static lib - Release - Fast FPU|x64.Build.0 = Release|x64 - {02B67A37-50E1-49DB-BECF-905BC029C2FE}.Static lib - Release|Win32.ActiveCfg = Release|Win32 - {02B67A37-50E1-49DB-BECF-905BC029C2FE}.Static lib - Release|Win32.Build.0 = Release|Win32 - {02B67A37-50E1-49DB-BECF-905BC029C2FE}.Static lib - Release|x64.ActiveCfg = Release|x64 - {02B67A37-50E1-49DB-BECF-905BC029C2FE}.Static lib - Release|x64.Build.0 = Release|x64 - {8FDA260E-EF27-4F8C-8720-7AF707DD0D9E}.Debug|Win32.ActiveCfg = Debug|Win32 - {8FDA260E-EF27-4F8C-8720-7AF707DD0D9E}.Debug|Win32.Build.0 = Debug|Win32 - {8FDA260E-EF27-4F8C-8720-7AF707DD0D9E}.Debug|x64.ActiveCfg = Debug|x64 - {8FDA260E-EF27-4F8C-8720-7AF707DD0D9E}.Debug|x64.Build.0 = Debug|x64 - {8FDA260E-EF27-4F8C-8720-7AF707DD0D9E}.Release - Fast FPU|Win32.ActiveCfg = Release|Win32 - {8FDA260E-EF27-4F8C-8720-7AF707DD0D9E}.Release - Fast FPU|Win32.Build.0 = Release|Win32 - {8FDA260E-EF27-4F8C-8720-7AF707DD0D9E}.Release - Fast FPU|x64.ActiveCfg = Release|x64 - {8FDA260E-EF27-4F8C-8720-7AF707DD0D9E}.Release - Fast FPU|x64.Build.0 = Release|x64 - {8FDA260E-EF27-4F8C-8720-7AF707DD0D9E}.Release|Win32.ActiveCfg = Release|Win32 - {8FDA260E-EF27-4F8C-8720-7AF707DD0D9E}.Release|Win32.Build.0 = Release|Win32 - {8FDA260E-EF27-4F8C-8720-7AF707DD0D9E}.Release|x64.ActiveCfg = Release|x64 - {8FDA260E-EF27-4F8C-8720-7AF707DD0D9E}.Release|x64.Build.0 = Release|x64 - {8FDA260E-EF27-4F8C-8720-7AF707DD0D9E}.SDL-Debug|Win32.ActiveCfg = Debug|Win32 - {8FDA260E-EF27-4F8C-8720-7AF707DD0D9E}.SDL-Debug|Win32.Build.0 = Debug|Win32 - {8FDA260E-EF27-4F8C-8720-7AF707DD0D9E}.SDL-Debug|x64.ActiveCfg = Debug|x64 - {8FDA260E-EF27-4F8C-8720-7AF707DD0D9E}.SDL-Debug|x64.Build.0 = Debug|x64 - {8FDA260E-EF27-4F8C-8720-7AF707DD0D9E}.Static lib - Debug|Win32.ActiveCfg = Debug|Win32 - {8FDA260E-EF27-4F8C-8720-7AF707DD0D9E}.Static lib - Debug|Win32.Build.0 = Debug|Win32 - {8FDA260E-EF27-4F8C-8720-7AF707DD0D9E}.Static lib - Debug|x64.ActiveCfg = Debug|x64 - {8FDA260E-EF27-4F8C-8720-7AF707DD0D9E}.Static lib - Debug|x64.Build.0 = Debug|x64 - {8FDA260E-EF27-4F8C-8720-7AF707DD0D9E}.Static lib - Release - Fast FPU|Win32.ActiveCfg = Release|Win32 - {8FDA260E-EF27-4F8C-8720-7AF707DD0D9E}.Static lib - Release - Fast FPU|Win32.Build.0 = Release|Win32 - {8FDA260E-EF27-4F8C-8720-7AF707DD0D9E}.Static lib - Release - Fast FPU|x64.ActiveCfg = Release|x64 - {8FDA260E-EF27-4F8C-8720-7AF707DD0D9E}.Static lib - Release - Fast FPU|x64.Build.0 = Release|x64 - {8FDA260E-EF27-4F8C-8720-7AF707DD0D9E}.Static lib - Release|Win32.ActiveCfg = Release|Win32 - {8FDA260E-EF27-4F8C-8720-7AF707DD0D9E}.Static lib - Release|Win32.Build.0 = Release|Win32 - {8FDA260E-EF27-4F8C-8720-7AF707DD0D9E}.Static lib - Release|x64.ActiveCfg = Release|x64 - {8FDA260E-EF27-4F8C-8720-7AF707DD0D9E}.Static lib - Release|x64.Build.0 = Release|x64 - {5CE0E2E7-879D-4152-B61D-24E7D0707B45}.Debug|Win32.ActiveCfg = Debug|Win32 - {5CE0E2E7-879D-4152-B61D-24E7D0707B45}.Debug|Win32.Build.0 = Debug|Win32 - {5CE0E2E7-879D-4152-B61D-24E7D0707B45}.Debug|x64.ActiveCfg = Debug|x64 - {5CE0E2E7-879D-4152-B61D-24E7D0707B45}.Debug|x64.Build.0 = Debug|x64 - {5CE0E2E7-879D-4152-B61D-24E7D0707B45}.Release - Fast FPU|Win32.ActiveCfg = Release|Win32 - {5CE0E2E7-879D-4152-B61D-24E7D0707B45}.Release - Fast FPU|Win32.Build.0 = Release|Win32 - {5CE0E2E7-879D-4152-B61D-24E7D0707B45}.Release - Fast FPU|x64.ActiveCfg = Release|x64 - {5CE0E2E7-879D-4152-B61D-24E7D0707B45}.Release - Fast FPU|x64.Build.0 = Release|x64 - {5CE0E2E7-879D-4152-B61D-24E7D0707B45}.Release|Win32.ActiveCfg = Release|Win32 - {5CE0E2E7-879D-4152-B61D-24E7D0707B45}.Release|Win32.Build.0 = Release|Win32 - {5CE0E2E7-879D-4152-B61D-24E7D0707B45}.Release|x64.ActiveCfg = Release|x64 - {5CE0E2E7-879D-4152-B61D-24E7D0707B45}.Release|x64.Build.0 = Release|x64 - {5CE0E2E7-879D-4152-B61D-24E7D0707B45}.SDL-Debug|Win32.ActiveCfg = Debug|Win32 - {5CE0E2E7-879D-4152-B61D-24E7D0707B45}.SDL-Debug|Win32.Build.0 = Debug|Win32 - {5CE0E2E7-879D-4152-B61D-24E7D0707B45}.SDL-Debug|x64.ActiveCfg = Debug|x64 - {5CE0E2E7-879D-4152-B61D-24E7D0707B45}.SDL-Debug|x64.Build.0 = Debug|x64 - {5CE0E2E7-879D-4152-B61D-24E7D0707B45}.Static lib - Debug|Win32.ActiveCfg = Debug|Win32 - {5CE0E2E7-879D-4152-B61D-24E7D0707B45}.Static lib - Debug|Win32.Build.0 = Debug|Win32 - {5CE0E2E7-879D-4152-B61D-24E7D0707B45}.Static lib - Debug|x64.ActiveCfg = Debug|x64 - {5CE0E2E7-879D-4152-B61D-24E7D0707B45}.Static lib - Debug|x64.Build.0 = Debug|x64 - {5CE0E2E7-879D-4152-B61D-24E7D0707B45}.Static lib - Release - Fast FPU|Win32.ActiveCfg = Release|Win32 - {5CE0E2E7-879D-4152-B61D-24E7D0707B45}.Static lib - Release - Fast FPU|Win32.Build.0 = Release|Win32 - {5CE0E2E7-879D-4152-B61D-24E7D0707B45}.Static lib - Release - Fast FPU|x64.ActiveCfg = Release|x64 - {5CE0E2E7-879D-4152-B61D-24E7D0707B45}.Static lib - Release - Fast FPU|x64.Build.0 = Release|x64 - {5CE0E2E7-879D-4152-B61D-24E7D0707B45}.Static lib - Release|Win32.ActiveCfg = Release|Win32 - {5CE0E2E7-879D-4152-B61D-24E7D0707B45}.Static lib - Release|Win32.Build.0 = Release|Win32 - {5CE0E2E7-879D-4152-B61D-24E7D0707B45}.Static lib - Release|x64.ActiveCfg = Release|x64 - {5CE0E2E7-879D-4152-B61D-24E7D0707B45}.Static lib - Release|x64.Build.0 = Release|x64 - {65D9DE2E-B73E-4ADF-96D1-BF4A8B7F4F97}.Debug|Win32.ActiveCfg = Debug|Win32 - {65D9DE2E-B73E-4ADF-96D1-BF4A8B7F4F97}.Debug|Win32.Build.0 = Debug|Win32 - {65D9DE2E-B73E-4ADF-96D1-BF4A8B7F4F97}.Debug|x64.ActiveCfg = Debug|x64 - {65D9DE2E-B73E-4ADF-96D1-BF4A8B7F4F97}.Debug|x64.Build.0 = Debug|x64 - {65D9DE2E-B73E-4ADF-96D1-BF4A8B7F4F97}.Release - Fast FPU|Win32.ActiveCfg = Release|Win32 - {65D9DE2E-B73E-4ADF-96D1-BF4A8B7F4F97}.Release - Fast FPU|Win32.Build.0 = Release|Win32 - {65D9DE2E-B73E-4ADF-96D1-BF4A8B7F4F97}.Release - Fast FPU|x64.ActiveCfg = Release|x64 - {65D9DE2E-B73E-4ADF-96D1-BF4A8B7F4F97}.Release - Fast FPU|x64.Build.0 = Release|x64 - {65D9DE2E-B73E-4ADF-96D1-BF4A8B7F4F97}.Release|Win32.ActiveCfg = Release|Win32 - {65D9DE2E-B73E-4ADF-96D1-BF4A8B7F4F97}.Release|Win32.Build.0 = Release|Win32 - {65D9DE2E-B73E-4ADF-96D1-BF4A8B7F4F97}.Release|x64.ActiveCfg = Release|x64 - {65D9DE2E-B73E-4ADF-96D1-BF4A8B7F4F97}.Release|x64.Build.0 = Release|x64 - {65D9DE2E-B73E-4ADF-96D1-BF4A8B7F4F97}.SDL-Debug|Win32.ActiveCfg = Debug|Win32 - {65D9DE2E-B73E-4ADF-96D1-BF4A8B7F4F97}.SDL-Debug|Win32.Build.0 = Debug|Win32 - {65D9DE2E-B73E-4ADF-96D1-BF4A8B7F4F97}.SDL-Debug|x64.ActiveCfg = Debug|x64 - {65D9DE2E-B73E-4ADF-96D1-BF4A8B7F4F97}.SDL-Debug|x64.Build.0 = Debug|x64 - {65D9DE2E-B73E-4ADF-96D1-BF4A8B7F4F97}.Static lib - Debug|Win32.ActiveCfg = Debug|Win32 - {65D9DE2E-B73E-4ADF-96D1-BF4A8B7F4F97}.Static lib - Debug|Win32.Build.0 = Debug|Win32 - {65D9DE2E-B73E-4ADF-96D1-BF4A8B7F4F97}.Static lib - Debug|x64.ActiveCfg = Debug|x64 - {65D9DE2E-B73E-4ADF-96D1-BF4A8B7F4F97}.Static lib - Debug|x64.Build.0 = Debug|x64 - {65D9DE2E-B73E-4ADF-96D1-BF4A8B7F4F97}.Static lib - Release - Fast FPU|Win32.ActiveCfg = Release|Win32 - {65D9DE2E-B73E-4ADF-96D1-BF4A8B7F4F97}.Static lib - Release - Fast FPU|Win32.Build.0 = Release|Win32 - {65D9DE2E-B73E-4ADF-96D1-BF4A8B7F4F97}.Static lib - Release - Fast FPU|x64.ActiveCfg = Release|x64 - {65D9DE2E-B73E-4ADF-96D1-BF4A8B7F4F97}.Static lib - Release - Fast FPU|x64.Build.0 = Release|x64 - {65D9DE2E-B73E-4ADF-96D1-BF4A8B7F4F97}.Static lib - Release|Win32.ActiveCfg = Release|Win32 - {65D9DE2E-B73E-4ADF-96D1-BF4A8B7F4F97}.Static lib - Release|Win32.Build.0 = Release|Win32 - {65D9DE2E-B73E-4ADF-96D1-BF4A8B7F4F97}.Static lib - Release|x64.ActiveCfg = Release|x64 - {65D9DE2E-B73E-4ADF-96D1-BF4A8B7F4F97}.Static lib - Release|x64.Build.0 = Release|x64 - {853A396E-C031-4C26-A716-5B4E176BE11D}.Debug|Win32.ActiveCfg = Debug|Win32 - {853A396E-C031-4C26-A716-5B4E176BE11D}.Debug|Win32.Build.0 = Debug|Win32 - {853A396E-C031-4C26-A716-5B4E176BE11D}.Debug|x64.ActiveCfg = Debug|x64 - {853A396E-C031-4C26-A716-5B4E176BE11D}.Debug|x64.Build.0 = Debug|x64 - {853A396E-C031-4C26-A716-5B4E176BE11D}.Release - Fast FPU|Win32.ActiveCfg = Release|Win32 - {853A396E-C031-4C26-A716-5B4E176BE11D}.Release - Fast FPU|Win32.Build.0 = Release|Win32 - {853A396E-C031-4C26-A716-5B4E176BE11D}.Release - Fast FPU|x64.ActiveCfg = Release|x64 - {853A396E-C031-4C26-A716-5B4E176BE11D}.Release - Fast FPU|x64.Build.0 = Release|x64 - {853A396E-C031-4C26-A716-5B4E176BE11D}.Release|Win32.ActiveCfg = Release|Win32 - {853A396E-C031-4C26-A716-5B4E176BE11D}.Release|Win32.Build.0 = Release|Win32 - {853A396E-C031-4C26-A716-5B4E176BE11D}.Release|x64.ActiveCfg = Release|x64 - {853A396E-C031-4C26-A716-5B4E176BE11D}.Release|x64.Build.0 = Release|x64 - {853A396E-C031-4C26-A716-5B4E176BE11D}.SDL-Debug|Win32.ActiveCfg = Debug|Win32 - {853A396E-C031-4C26-A716-5B4E176BE11D}.SDL-Debug|Win32.Build.0 = Debug|Win32 - {853A396E-C031-4C26-A716-5B4E176BE11D}.SDL-Debug|x64.ActiveCfg = Debug|x64 - {853A396E-C031-4C26-A716-5B4E176BE11D}.SDL-Debug|x64.Build.0 = Debug|x64 - {853A396E-C031-4C26-A716-5B4E176BE11D}.Static lib - Debug|Win32.ActiveCfg = Debug|Win32 - {853A396E-C031-4C26-A716-5B4E176BE11D}.Static lib - Debug|Win32.Build.0 = Debug|Win32 - {853A396E-C031-4C26-A716-5B4E176BE11D}.Static lib - Debug|x64.ActiveCfg = Debug|x64 - {853A396E-C031-4C26-A716-5B4E176BE11D}.Static lib - Debug|x64.Build.0 = Debug|x64 - {853A396E-C031-4C26-A716-5B4E176BE11D}.Static lib - Release - Fast FPU|Win32.ActiveCfg = Release|Win32 - {853A396E-C031-4C26-A716-5B4E176BE11D}.Static lib - Release - Fast FPU|Win32.Build.0 = Release|Win32 - {853A396E-C031-4C26-A716-5B4E176BE11D}.Static lib - Release - Fast FPU|x64.ActiveCfg = Release|x64 - {853A396E-C031-4C26-A716-5B4E176BE11D}.Static lib - Release - Fast FPU|x64.Build.0 = Release|x64 - {853A396E-C031-4C26-A716-5B4E176BE11D}.Static lib - Release|Win32.ActiveCfg = Release|Win32 - {853A396E-C031-4C26-A716-5B4E176BE11D}.Static lib - Release|Win32.Build.0 = Release|Win32 - {853A396E-C031-4C26-A716-5B4E176BE11D}.Static lib - Release|x64.ActiveCfg = Release|x64 - {853A396E-C031-4C26-A716-5B4E176BE11D}.Static lib - Release|x64.Build.0 = Release|x64 - {4D53E40F-37E3-42B1-8848-F4C6F8313A17}.Debug|Win32.ActiveCfg = Debug|Win32 - {4D53E40F-37E3-42B1-8848-F4C6F8313A17}.Debug|Win32.Build.0 = Debug|Win32 - {4D53E40F-37E3-42B1-8848-F4C6F8313A17}.Debug|x64.ActiveCfg = Debug|x64 - {4D53E40F-37E3-42B1-8848-F4C6F8313A17}.Debug|x64.Build.0 = Debug|x64 - {4D53E40F-37E3-42B1-8848-F4C6F8313A17}.Release - Fast FPU|Win32.ActiveCfg = Release|Win32 - {4D53E40F-37E3-42B1-8848-F4C6F8313A17}.Release - Fast FPU|Win32.Build.0 = Release|Win32 - {4D53E40F-37E3-42B1-8848-F4C6F8313A17}.Release - Fast FPU|x64.ActiveCfg = Release|x64 - {4D53E40F-37E3-42B1-8848-F4C6F8313A17}.Release - Fast FPU|x64.Build.0 = Release|x64 - {4D53E40F-37E3-42B1-8848-F4C6F8313A17}.Release|Win32.ActiveCfg = Release|Win32 - {4D53E40F-37E3-42B1-8848-F4C6F8313A17}.Release|Win32.Build.0 = Release|Win32 - {4D53E40F-37E3-42B1-8848-F4C6F8313A17}.Release|x64.ActiveCfg = Release|x64 - {4D53E40F-37E3-42B1-8848-F4C6F8313A17}.Release|x64.Build.0 = Release|x64 - {4D53E40F-37E3-42B1-8848-F4C6F8313A17}.SDL-Debug|Win32.ActiveCfg = Debug|Win32 - {4D53E40F-37E3-42B1-8848-F4C6F8313A17}.SDL-Debug|Win32.Build.0 = Debug|Win32 - {4D53E40F-37E3-42B1-8848-F4C6F8313A17}.SDL-Debug|x64.ActiveCfg = Debug|x64 - {4D53E40F-37E3-42B1-8848-F4C6F8313A17}.SDL-Debug|x64.Build.0 = Debug|x64 - {4D53E40F-37E3-42B1-8848-F4C6F8313A17}.Static lib - Debug|Win32.ActiveCfg = Debug|Win32 - {4D53E40F-37E3-42B1-8848-F4C6F8313A17}.Static lib - Debug|Win32.Build.0 = Debug|Win32 - {4D53E40F-37E3-42B1-8848-F4C6F8313A17}.Static lib - Debug|x64.ActiveCfg = Debug|x64 - {4D53E40F-37E3-42B1-8848-F4C6F8313A17}.Static lib - Debug|x64.Build.0 = Debug|x64 - {4D53E40F-37E3-42B1-8848-F4C6F8313A17}.Static lib - Release - Fast FPU|Win32.ActiveCfg = Release|Win32 - {4D53E40F-37E3-42B1-8848-F4C6F8313A17}.Static lib - Release - Fast FPU|Win32.Build.0 = Release|Win32 - {4D53E40F-37E3-42B1-8848-F4C6F8313A17}.Static lib - Release - Fast FPU|x64.ActiveCfg = Release|x64 - {4D53E40F-37E3-42B1-8848-F4C6F8313A17}.Static lib - Release - Fast FPU|x64.Build.0 = Release|x64 - {4D53E40F-37E3-42B1-8848-F4C6F8313A17}.Static lib - Release|Win32.ActiveCfg = Release|Win32 - {4D53E40F-37E3-42B1-8848-F4C6F8313A17}.Static lib - Release|Win32.Build.0 = Release|Win32 - {4D53E40F-37E3-42B1-8848-F4C6F8313A17}.Static lib - Release|x64.ActiveCfg = Release|x64 - {4D53E40F-37E3-42B1-8848-F4C6F8313A17}.Static lib - Release|x64.Build.0 = Release|x64 - {E72B637E-4AA6-46F3-885F-AC67B4B470ED}.Debug|Win32.ActiveCfg = Debug|Win32 - {E72B637E-4AA6-46F3-885F-AC67B4B470ED}.Debug|Win32.Build.0 = Debug|Win32 - {E72B637E-4AA6-46F3-885F-AC67B4B470ED}.Debug|x64.ActiveCfg = Debug|x64 - {E72B637E-4AA6-46F3-885F-AC67B4B470ED}.Debug|x64.Build.0 = Debug|x64 - {E72B637E-4AA6-46F3-885F-AC67B4B470ED}.Release - Fast FPU|Win32.ActiveCfg = Release|Win32 - {E72B637E-4AA6-46F3-885F-AC67B4B470ED}.Release - Fast FPU|Win32.Build.0 = Release|Win32 - {E72B637E-4AA6-46F3-885F-AC67B4B470ED}.Release - Fast FPU|x64.ActiveCfg = Release|x64 - {E72B637E-4AA6-46F3-885F-AC67B4B470ED}.Release - Fast FPU|x64.Build.0 = Release|x64 - {E72B637E-4AA6-46F3-885F-AC67B4B470ED}.Release|Win32.ActiveCfg = Release|Win32 - {E72B637E-4AA6-46F3-885F-AC67B4B470ED}.Release|Win32.Build.0 = Release|Win32 - {E72B637E-4AA6-46F3-885F-AC67B4B470ED}.Release|x64.ActiveCfg = Release|x64 - {E72B637E-4AA6-46F3-885F-AC67B4B470ED}.Release|x64.Build.0 = Release|x64 - {E72B637E-4AA6-46F3-885F-AC67B4B470ED}.SDL-Debug|Win32.ActiveCfg = Debug|Win32 - {E72B637E-4AA6-46F3-885F-AC67B4B470ED}.SDL-Debug|Win32.Build.0 = Debug|Win32 - {E72B637E-4AA6-46F3-885F-AC67B4B470ED}.SDL-Debug|x64.ActiveCfg = Debug|x64 - {E72B637E-4AA6-46F3-885F-AC67B4B470ED}.SDL-Debug|x64.Build.0 = Debug|x64 - {E72B637E-4AA6-46F3-885F-AC67B4B470ED}.Static lib - Debug|Win32.ActiveCfg = Debug|Win32 - {E72B637E-4AA6-46F3-885F-AC67B4B470ED}.Static lib - Debug|Win32.Build.0 = Debug|Win32 - {E72B637E-4AA6-46F3-885F-AC67B4B470ED}.Static lib - Debug|x64.ActiveCfg = Debug|x64 - {E72B637E-4AA6-46F3-885F-AC67B4B470ED}.Static lib - Debug|x64.Build.0 = Debug|x64 - {E72B637E-4AA6-46F3-885F-AC67B4B470ED}.Static lib - Release - Fast FPU|Win32.ActiveCfg = Release|Win32 - {E72B637E-4AA6-46F3-885F-AC67B4B470ED}.Static lib - Release - Fast FPU|Win32.Build.0 = Release|Win32 - {E72B637E-4AA6-46F3-885F-AC67B4B470ED}.Static lib - Release - Fast FPU|x64.ActiveCfg = Release|x64 - {E72B637E-4AA6-46F3-885F-AC67B4B470ED}.Static lib - Release - Fast FPU|x64.Build.0 = Release|x64 - {E72B637E-4AA6-46F3-885F-AC67B4B470ED}.Static lib - Release|Win32.ActiveCfg = Release|Win32 - {E72B637E-4AA6-46F3-885F-AC67B4B470ED}.Static lib - Release|Win32.Build.0 = Release|Win32 - {E72B637E-4AA6-46F3-885F-AC67B4B470ED}.Static lib - Release|x64.ActiveCfg = Release|x64 - {E72B637E-4AA6-46F3-885F-AC67B4B470ED}.Static lib - Release|x64.Build.0 = Release|x64 - {6F076455-D955-45D4-9C68-4AD4E45F2D47}.Debug|Win32.ActiveCfg = Debug|Win32 - {6F076455-D955-45D4-9C68-4AD4E45F2D47}.Debug|Win32.Build.0 = Debug|Win32 - {6F076455-D955-45D4-9C68-4AD4E45F2D47}.Debug|x64.ActiveCfg = Debug|x64 - {6F076455-D955-45D4-9C68-4AD4E45F2D47}.Debug|x64.Build.0 = Debug|x64 - {6F076455-D955-45D4-9C68-4AD4E45F2D47}.Release - Fast FPU|Win32.ActiveCfg = Release|Win32 - {6F076455-D955-45D4-9C68-4AD4E45F2D47}.Release - Fast FPU|Win32.Build.0 = Release|Win32 - {6F076455-D955-45D4-9C68-4AD4E45F2D47}.Release - Fast FPU|x64.ActiveCfg = Release|x64 - {6F076455-D955-45D4-9C68-4AD4E45F2D47}.Release - Fast FPU|x64.Build.0 = Release|x64 - {6F076455-D955-45D4-9C68-4AD4E45F2D47}.Release|Win32.ActiveCfg = Release|Win32 - {6F076455-D955-45D4-9C68-4AD4E45F2D47}.Release|Win32.Build.0 = Release|Win32 - {6F076455-D955-45D4-9C68-4AD4E45F2D47}.Release|x64.ActiveCfg = Release|x64 - {6F076455-D955-45D4-9C68-4AD4E45F2D47}.Release|x64.Build.0 = Release|x64 - {6F076455-D955-45D4-9C68-4AD4E45F2D47}.SDL-Debug|Win32.ActiveCfg = Debug|Win32 - {6F076455-D955-45D4-9C68-4AD4E45F2D47}.SDL-Debug|Win32.Build.0 = Debug|Win32 - {6F076455-D955-45D4-9C68-4AD4E45F2D47}.SDL-Debug|x64.ActiveCfg = Debug|x64 - {6F076455-D955-45D4-9C68-4AD4E45F2D47}.SDL-Debug|x64.Build.0 = Debug|x64 - {6F076455-D955-45D4-9C68-4AD4E45F2D47}.Static lib - Debug|Win32.ActiveCfg = Debug|Win32 - {6F076455-D955-45D4-9C68-4AD4E45F2D47}.Static lib - Debug|Win32.Build.0 = Debug|Win32 - {6F076455-D955-45D4-9C68-4AD4E45F2D47}.Static lib - Debug|x64.ActiveCfg = Debug|x64 - {6F076455-D955-45D4-9C68-4AD4E45F2D47}.Static lib - Debug|x64.Build.0 = Debug|x64 - {6F076455-D955-45D4-9C68-4AD4E45F2D47}.Static lib - Release - Fast FPU|Win32.ActiveCfg = Release|Win32 - {6F076455-D955-45D4-9C68-4AD4E45F2D47}.Static lib - Release - Fast FPU|Win32.Build.0 = Release|Win32 - {6F076455-D955-45D4-9C68-4AD4E45F2D47}.Static lib - Release - Fast FPU|x64.ActiveCfg = Release|x64 - {6F076455-D955-45D4-9C68-4AD4E45F2D47}.Static lib - Release - Fast FPU|x64.Build.0 = Release|x64 - {6F076455-D955-45D4-9C68-4AD4E45F2D47}.Static lib - Release|Win32.ActiveCfg = Release|Win32 - {6F076455-D955-45D4-9C68-4AD4E45F2D47}.Static lib - Release|Win32.Build.0 = Release|Win32 - {6F076455-D955-45D4-9C68-4AD4E45F2D47}.Static lib - Release|x64.ActiveCfg = Release|x64 - {6F076455-D955-45D4-9C68-4AD4E45F2D47}.Static lib - Release|x64.Build.0 = Release|x64 - {E08E042A-6C45-411B-92BE-3CC31331019F}.Debug|Win32.ActiveCfg = Debug|Win32 - {E08E042A-6C45-411B-92BE-3CC31331019F}.Debug|Win32.Build.0 = Debug|Win32 - {E08E042A-6C45-411B-92BE-3CC31331019F}.Debug|x64.ActiveCfg = Debug|x64 - {E08E042A-6C45-411B-92BE-3CC31331019F}.Debug|x64.Build.0 = Debug|x64 - {E08E042A-6C45-411B-92BE-3CC31331019F}.Release - Fast FPU|Win32.ActiveCfg = Release - Fast FPU|Win32 - {E08E042A-6C45-411B-92BE-3CC31331019F}.Release - Fast FPU|Win32.Build.0 = Release - Fast FPU|Win32 - {E08E042A-6C45-411B-92BE-3CC31331019F}.Release - Fast FPU|x64.ActiveCfg = Release - Fast FPU|x64 - {E08E042A-6C45-411B-92BE-3CC31331019F}.Release - Fast FPU|x64.Build.0 = Release - Fast FPU|x64 - {E08E042A-6C45-411B-92BE-3CC31331019F}.Release|Win32.ActiveCfg = Release|Win32 - {E08E042A-6C45-411B-92BE-3CC31331019F}.Release|Win32.Build.0 = Release|Win32 - {E08E042A-6C45-411B-92BE-3CC31331019F}.Release|x64.ActiveCfg = Release|x64 - {E08E042A-6C45-411B-92BE-3CC31331019F}.Release|x64.Build.0 = Release|x64 - {E08E042A-6C45-411B-92BE-3CC31331019F}.SDL-Debug|Win32.ActiveCfg = SDL-Debug|Win32 - {E08E042A-6C45-411B-92BE-3CC31331019F}.SDL-Debug|Win32.Build.0 = SDL-Debug|Win32 - {E08E042A-6C45-411B-92BE-3CC31331019F}.SDL-Debug|x64.ActiveCfg = SDL-Debug|x64 - {E08E042A-6C45-411B-92BE-3CC31331019F}.SDL-Debug|x64.Build.0 = SDL-Debug|x64 - {E08E042A-6C45-411B-92BE-3CC31331019F}.Static lib - Debug|Win32.ActiveCfg = Static lib - Debug|Win32 - {E08E042A-6C45-411B-92BE-3CC31331019F}.Static lib - Debug|Win32.Build.0 = Static lib - Debug|Win32 - {E08E042A-6C45-411B-92BE-3CC31331019F}.Static lib - Debug|x64.ActiveCfg = Static lib - Debug|x64 - {E08E042A-6C45-411B-92BE-3CC31331019F}.Static lib - Debug|x64.Build.0 = Static lib - Debug|x64 - {E08E042A-6C45-411B-92BE-3CC31331019F}.Static lib - Release - Fast FPU|Win32.ActiveCfg = Static lib - Release - Fast FPU|Win32 - {E08E042A-6C45-411B-92BE-3CC31331019F}.Static lib - Release - Fast FPU|Win32.Build.0 = Static lib - Release - Fast FPU|Win32 - {E08E042A-6C45-411B-92BE-3CC31331019F}.Static lib - Release - Fast FPU|x64.ActiveCfg = Static lib - Release - Fast FPU|x64 - {E08E042A-6C45-411B-92BE-3CC31331019F}.Static lib - Release - Fast FPU|x64.Build.0 = Static lib - Release - Fast FPU|x64 - {E08E042A-6C45-411B-92BE-3CC31331019F}.Static lib - Release|Win32.ActiveCfg = Static lib - Release|Win32 - {E08E042A-6C45-411B-92BE-3CC31331019F}.Static lib - Release|Win32.Build.0 = Static lib - Release|Win32 - {E08E042A-6C45-411B-92BE-3CC31331019F}.Static lib - Release|x64.ActiveCfg = Static lib - Release|x64 - {E08E042A-6C45-411B-92BE-3CC31331019F}.Static lib - Release|x64.Build.0 = Static lib - Release|x64 - {F25F2AC4-AEDA-4A95-9769-01A2652B54A2}.Debug|Win32.ActiveCfg = Debug|Win32 - {F25F2AC4-AEDA-4A95-9769-01A2652B54A2}.Debug|Win32.Build.0 = Debug|Win32 - {F25F2AC4-AEDA-4A95-9769-01A2652B54A2}.Debug|x64.ActiveCfg = Debug|x64 - {F25F2AC4-AEDA-4A95-9769-01A2652B54A2}.Debug|x64.Build.0 = Debug|x64 - {F25F2AC4-AEDA-4A95-9769-01A2652B54A2}.Release - Fast FPU|Win32.ActiveCfg = Release|Win32 - {F25F2AC4-AEDA-4A95-9769-01A2652B54A2}.Release - Fast FPU|Win32.Build.0 = Release|Win32 - {F25F2AC4-AEDA-4A95-9769-01A2652B54A2}.Release - Fast FPU|x64.ActiveCfg = Release|x64 - {F25F2AC4-AEDA-4A95-9769-01A2652B54A2}.Release - Fast FPU|x64.Build.0 = Release|x64 - {F25F2AC4-AEDA-4A95-9769-01A2652B54A2}.Release|Win32.ActiveCfg = Release|Win32 - {F25F2AC4-AEDA-4A95-9769-01A2652B54A2}.Release|Win32.Build.0 = Release|Win32 - {F25F2AC4-AEDA-4A95-9769-01A2652B54A2}.Release|x64.ActiveCfg = Release|x64 - {F25F2AC4-AEDA-4A95-9769-01A2652B54A2}.Release|x64.Build.0 = Release|x64 - {F25F2AC4-AEDA-4A95-9769-01A2652B54A2}.SDL-Debug|Win32.ActiveCfg = Debug|Win32 - {F25F2AC4-AEDA-4A95-9769-01A2652B54A2}.SDL-Debug|Win32.Build.0 = Debug|Win32 - {F25F2AC4-AEDA-4A95-9769-01A2652B54A2}.SDL-Debug|x64.ActiveCfg = Debug|x64 - {F25F2AC4-AEDA-4A95-9769-01A2652B54A2}.SDL-Debug|x64.Build.0 = Debug|x64 - {F25F2AC4-AEDA-4A95-9769-01A2652B54A2}.Static lib - Debug|Win32.ActiveCfg = Debug|Win32 - {F25F2AC4-AEDA-4A95-9769-01A2652B54A2}.Static lib - Debug|Win32.Build.0 = Debug|Win32 - {F25F2AC4-AEDA-4A95-9769-01A2652B54A2}.Static lib - Debug|x64.ActiveCfg = Debug|x64 - {F25F2AC4-AEDA-4A95-9769-01A2652B54A2}.Static lib - Debug|x64.Build.0 = Debug|x64 - {F25F2AC4-AEDA-4A95-9769-01A2652B54A2}.Static lib - Release - Fast FPU|Win32.ActiveCfg = Release|Win32 - {F25F2AC4-AEDA-4A95-9769-01A2652B54A2}.Static lib - Release - Fast FPU|Win32.Build.0 = Release|Win32 - {F25F2AC4-AEDA-4A95-9769-01A2652B54A2}.Static lib - Release - Fast FPU|x64.ActiveCfg = Release|x64 - {F25F2AC4-AEDA-4A95-9769-01A2652B54A2}.Static lib - Release - Fast FPU|x64.Build.0 = Release|x64 - {F25F2AC4-AEDA-4A95-9769-01A2652B54A2}.Static lib - Release|Win32.ActiveCfg = Release|Win32 - {F25F2AC4-AEDA-4A95-9769-01A2652B54A2}.Static lib - Release|Win32.Build.0 = Release|Win32 - {F25F2AC4-AEDA-4A95-9769-01A2652B54A2}.Static lib - Release|x64.ActiveCfg = Release|x64 - {F25F2AC4-AEDA-4A95-9769-01A2652B54A2}.Static lib - Release|x64.Build.0 = Release|x64 - {DEE0160F-8FBD-43EC-BB96-1B9C0ED1B51A}.Debug|Win32.ActiveCfg = Debug|Win32 - {DEE0160F-8FBD-43EC-BB96-1B9C0ED1B51A}.Debug|Win32.Build.0 = Debug|Win32 - {DEE0160F-8FBD-43EC-BB96-1B9C0ED1B51A}.Debug|x64.ActiveCfg = Debug|x64 - {DEE0160F-8FBD-43EC-BB96-1B9C0ED1B51A}.Debug|x64.Build.0 = Debug|x64 - {DEE0160F-8FBD-43EC-BB96-1B9C0ED1B51A}.Release - Fast FPU|Win32.ActiveCfg = Release|Win32 - {DEE0160F-8FBD-43EC-BB96-1B9C0ED1B51A}.Release - Fast FPU|Win32.Build.0 = Release|Win32 - {DEE0160F-8FBD-43EC-BB96-1B9C0ED1B51A}.Release - Fast FPU|x64.ActiveCfg = Release|x64 - {DEE0160F-8FBD-43EC-BB96-1B9C0ED1B51A}.Release - Fast FPU|x64.Build.0 = Release|x64 - {DEE0160F-8FBD-43EC-BB96-1B9C0ED1B51A}.Release|Win32.ActiveCfg = Release|Win32 - {DEE0160F-8FBD-43EC-BB96-1B9C0ED1B51A}.Release|Win32.Build.0 = Release|Win32 - {DEE0160F-8FBD-43EC-BB96-1B9C0ED1B51A}.Release|x64.ActiveCfg = Release|x64 - {DEE0160F-8FBD-43EC-BB96-1B9C0ED1B51A}.Release|x64.Build.0 = Release|x64 - {DEE0160F-8FBD-43EC-BB96-1B9C0ED1B51A}.SDL-Debug|Win32.ActiveCfg = Debug|Win32 - {DEE0160F-8FBD-43EC-BB96-1B9C0ED1B51A}.SDL-Debug|Win32.Build.0 = Debug|Win32 - {DEE0160F-8FBD-43EC-BB96-1B9C0ED1B51A}.SDL-Debug|x64.ActiveCfg = Debug|x64 - {DEE0160F-8FBD-43EC-BB96-1B9C0ED1B51A}.SDL-Debug|x64.Build.0 = Debug|x64 - {DEE0160F-8FBD-43EC-BB96-1B9C0ED1B51A}.Static lib - Debug|Win32.ActiveCfg = Debug|Win32 - {DEE0160F-8FBD-43EC-BB96-1B9C0ED1B51A}.Static lib - Debug|Win32.Build.0 = Debug|Win32 - {DEE0160F-8FBD-43EC-BB96-1B9C0ED1B51A}.Static lib - Debug|x64.ActiveCfg = Debug|x64 - {DEE0160F-8FBD-43EC-BB96-1B9C0ED1B51A}.Static lib - Debug|x64.Build.0 = Debug|x64 - {DEE0160F-8FBD-43EC-BB96-1B9C0ED1B51A}.Static lib - Release - Fast FPU|Win32.ActiveCfg = Release|Win32 - {DEE0160F-8FBD-43EC-BB96-1B9C0ED1B51A}.Static lib - Release - Fast FPU|Win32.Build.0 = Release|Win32 - {DEE0160F-8FBD-43EC-BB96-1B9C0ED1B51A}.Static lib - Release - Fast FPU|x64.ActiveCfg = Release|x64 - {DEE0160F-8FBD-43EC-BB96-1B9C0ED1B51A}.Static lib - Release - Fast FPU|x64.Build.0 = Release|x64 - {DEE0160F-8FBD-43EC-BB96-1B9C0ED1B51A}.Static lib - Release|Win32.ActiveCfg = Release|Win32 - {DEE0160F-8FBD-43EC-BB96-1B9C0ED1B51A}.Static lib - Release|Win32.Build.0 = Release|Win32 - {DEE0160F-8FBD-43EC-BB96-1B9C0ED1B51A}.Static lib - Release|x64.ActiveCfg = Release|x64 - {DEE0160F-8FBD-43EC-BB96-1B9C0ED1B51A}.Static lib - Release|x64.Build.0 = Release|x64 - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/examples/CMakeLists.txt b/examples/CMakeLists.txt index 4f42e74d..9aab740f 100644 --- a/examples/CMakeLists.txt +++ b/examples/CMakeLists.txt @@ -1,35 +1,7 @@ set(IRREXAMPLES - 01.HelloWorld - 02.Quake3Map - 03.CustomSceneNode - 04.Movement - 05.UserInterface - 06.2DGraphics - 07.Collision - 08.SpecialFX - 09.Meshviewer - 10.Shaders - 11.PerPixelLighting - 12.TerrainRendering - 13.RenderToTexture - 16.Quake3MapShader - 18.SplitScreen - 19.MouseAndJoystick - 20.ManagedLights - 21.Quake3Explorer - 22.MaterialViewer - 23.SMeshHandling - 24.CursorControl - 26.OcclusionQuery - 27.PostProcessing - 28.CubeMapping - 30.Profiling + # removed ) - -if(WIN32) - list(APPEND IRREXAMPLES 14.Win32Window) -endif() if(UNIX) list(APPEND IRREXAMPLES AutomatedTest) endif() diff --git a/examples/Demo/CDemo.cpp b/examples/Demo/CDemo.cpp deleted file mode 100644 index b50b6d35..00000000 --- a/examples/Demo/CDemo.cpp +++ /dev/null @@ -1,833 +0,0 @@ -// This is a Demo of the Irrlicht Engine (c) 2005-2009 by N.Gebhardt. -// This file is not documented. - -#include "CDemo.h" -#include "exampleHelper.h" - -CDemo::CDemo(bool f, bool m, bool s, bool a, bool v, bool fsaa, video::E_DRIVER_TYPE d) -: fullscreen(f), music(m), shadows(s), additive(a), vsync(v), aa(fsaa), - driverType(d), device(0), -#ifdef USE_IRRKLANG - irrKlang(0), ballSound(0), impactSound(0), -#endif -#ifdef USE_SDL_MIXER - stream(0), ballSound(0), impactSound(0), -#endif - currentScene(-2), backColor(0), statusText(0), inOutFader(0), - quakeLevelMesh(0), quakeLevelNode(0), skyboxNode(0), model1(0), model2(0), - campFire(0), metaSelector(0), mapSelector(0), sceneStartTime(0), - timeForThisScene(0) -{ -} - - -CDemo::~CDemo() -{ - if (mapSelector) - mapSelector->drop(); - - if (metaSelector) - metaSelector->drop(); - -#ifdef USE_IRRKLANG - if (irrKlang) - irrKlang->drop(); -#endif -} - - -void CDemo::run() -{ - core::dimension2d resolution (800, 600); - - if ( driverType == video::EDT_BURNINGSVIDEO || driverType == video::EDT_SOFTWARE ) - { - resolution.Width = 640; - resolution.Height = 480; - } - - irr::SIrrlichtCreationParameters params; - params.DriverType=driverType; - params.WindowSize=resolution; - params.Bits=32; - params.Fullscreen=fullscreen; - params.Stencilbuffer=shadows; - params.Vsync=vsync; - params.AntiAlias=aa?8:0; - params.EventReceiver=this; - - device = createDeviceEx(params); - if (!device) - return; - - const io::path mediaPath = getExampleMediaPath(); - - if (device->getFileSystem()->existFile("irrlicht.dat")) - device->getFileSystem()->addFileArchive("irrlicht.dat"); - else - device->getFileSystem()->addFileArchive(mediaPath + "irrlicht.dat"); - if (device->getFileSystem()->existFile("map-20kdm2.pk3")) - device->getFileSystem()->addFileArchive("map-20kdm2.pk3"); - else - device->getFileSystem()->addFileArchive(mediaPath + "map-20kdm2.pk3"); - - video::IVideoDriver* driver = device->getVideoDriver(); - scene::ISceneManager* smgr = device->getSceneManager(); - gui::IGUIEnvironment* guienv = device->getGUIEnvironment(); - - device->setWindowCaption(L"Irrlicht Engine Demo"); - - // set ambient light - smgr->setAmbientLight ( video::SColorf ( 0x00c0c0c0 ) ); - - wchar_t tmp[255]; - - // draw everything - - s32 now = 0; - s32 lastfps = 0; - sceneStartTime = device->getTimer()->getTime(); - while(device->run() && driver) - { - if (device->isWindowActive()) - { - #ifdef USE_IRRKLANG - // update 3D position for sound engine - scene::ICameraSceneNode* cam = smgr->getActiveCamera(); - if (cam && irrKlang) - irrKlang->setListenerPosition(cam->getAbsolutePosition(), cam->getTarget()); - #endif - - // load next scene if necessary - now = device->getTimer()->getTime(); - if (now - sceneStartTime > timeForThisScene && timeForThisScene!=-1) - switchToNextScene(); - - createParticleImpacts(); - - u16 clearFlag = video::ECBF_DEPTH; - - if (timeForThisScene != -1) - clearFlag |= video::ECBF_COLOR; - - driver->beginScene(clearFlag, backColor); - - smgr->drawAll(); - guienv->drawAll(); - driver->endScene(); - - // write statistics - const s32 nowfps = driver->getFPS(); - - swprintf_irr(tmp, 255, L"%ls fps:%3d triangles:%0.3f mio/s", - driver->getName(), driver->getFPS(), - driver->getPrimitiveCountDrawn(1) * (1.f / 1000000.f)); - - statusText->setText(tmp); - if ( nowfps != lastfps ) - { - device->setWindowCaption(tmp); - lastfps = nowfps; - } - } - } - - device->drop(); -} - - -bool CDemo::OnEvent(const SEvent& event) -{ - if (!device) - return false; - - if (event.EventType == EET_KEY_INPUT_EVENT && - event.KeyInput.Key == KEY_ESCAPE && - event.KeyInput.PressedDown == false) - { - // user wants to quit. - if (currentScene < 3) - timeForThisScene = 0; - else - device->closeDevice(); - } - else - if (((event.EventType == EET_KEY_INPUT_EVENT && - event.KeyInput.Key == KEY_SPACE && - event.KeyInput.PressedDown == false) || - (event.EventType == EET_MOUSE_INPUT_EVENT && - event.MouseInput.Event == EMIE_LMOUSE_LEFT_UP)) && - currentScene == 3) - { - // shoot - shoot(); - } - else - if (event.EventType == EET_KEY_INPUT_EVENT && - event.KeyInput.Key == KEY_F9 && - event.KeyInput.PressedDown == false) - { - video::IImage* image = device->getVideoDriver()->createScreenShot(); - if (image) - { - device->getVideoDriver()->writeImageToFile(image, "screenshot.bmp"); - device->getVideoDriver()->writeImageToFile(image, "screenshot.png"); - device->getVideoDriver()->writeImageToFile(image, "screenshot.tga"); - device->getVideoDriver()->writeImageToFile(image, "screenshot.ppm"); - device->getVideoDriver()->writeImageToFile(image, "screenshot.jpg"); - device->getVideoDriver()->writeImageToFile(image, "screenshot.pcx"); - image->drop(); - } - } - else - if (device->getSceneManager()->getActiveCamera()) - { - device->getSceneManager()->getActiveCamera()->OnEvent(event); - return true; - } - - return false; -} - - -void CDemo::switchToNextScene() -{ - currentScene++; - if (currentScene > 3) - currentScene = 1; - - scene::ISceneManager* sm = device->getSceneManager(); - scene::ISceneNodeAnimator* sa = 0; - scene::ICameraSceneNode* camera = 0; - - camera = sm->getActiveCamera(); - if (camera) - { - sm->setActiveCamera(0); - camera->remove(); - camera = 0; - } - - switch(currentScene) - { - case -1: // loading screen - timeForThisScene = 0; - createLoadingScreen(); - break; - - case 0: // load scene - timeForThisScene = 0; - loadSceneData(); - break; - - case 1: // panorama camera - { - currentScene += 1; - //camera = sm->addCameraSceneNode(0, core::vector3df(0,0,0), core::vector3df(-586,708,52)); - //camera->setTarget(core::vector3df(0,400,0)); - - core::array points; - - points.push_back(core::vector3df(-931.473755f, 138.300003f, 987.279114f)); // -49873 - points.push_back(core::vector3df(-847.902222f, 136.757553f, 915.792725f)); // -50559 - points.push_back(core::vector3df(-748.680420f, 152.254501f, 826.418945f)); // -51964 - points.push_back(core::vector3df(-708.428406f, 213.569580f, 784.466675f)); // -53251 - points.push_back(core::vector3df(-686.217651f, 288.141174f, 762.965576f)); // -54015 - points.push_back(core::vector3df(-679.685059f, 365.095612f, 756.551453f)); // -54733 - points.push_back(core::vector3df(-671.317871f, 447.360107f, 749.394592f)); // -55588 - points.push_back(core::vector3df(-669.468445f, 583.335632f, 747.711853f)); // -56178 - points.push_back(core::vector3df(-667.611267f, 727.313232f, 746.018250f)); // -56757 - points.push_back(core::vector3df(-665.853210f, 862.791931f, 744.436096f)); // -57859 - points.push_back(core::vector3df(-642.649597f, 1026.047607f, 724.259827f)); // -59705 - points.push_back(core::vector3df(-517.793884f, 838.396790f, 490.326050f)); // -60983 - points.push_back(core::vector3df(-474.387299f, 715.691467f, 344.639984f)); // -61629 - points.push_back(core::vector3df(-444.600250f, 601.155701f, 180.938095f)); // -62319 - points.push_back(core::vector3df(-414.808899f, 479.691406f, 4.866660f)); // -63048 - points.push_back(core::vector3df(-410.418945f, 429.642242f, -134.332687f)); // -63757 - points.push_back(core::vector3df(-399.837585f, 411.498383f, -349.350983f)); // -64418 - points.push_back(core::vector3df(-390.756653f, 403.970093f, -524.454407f)); // -65005 - points.push_back(core::vector3df(-334.864227f, 350.065491f, -732.397400f)); // -65701 - points.push_back(core::vector3df(-195.253387f, 349.577209f, -812.475891f)); // -66335 - points.push_back(core::vector3df(16.255573f, 363.743134f, -833.800415f)); // -67170 - points.push_back(core::vector3df(234.940964f, 352.957825f, -820.150696f)); // -67939 - points.push_back(core::vector3df(436.797668f, 349.236450f, -816.914185f)); // -68596 - points.push_back(core::vector3df(575.236206f, 356.244812f, -719.788513f)); // -69166 - points.push_back(core::vector3df(594.131042f, 387.173828f, -609.675598f)); // -69744 - points.push_back(core::vector3df(617.615234f, 412.002899f, -326.174072f)); // -70640 - points.push_back(core::vector3df(606.456848f, 403.221954f, -104.179291f)); // -71390 - points.push_back(core::vector3df(610.958252f, 407.037750f, 117.209778f)); // -72085 - points.push_back(core::vector3df(597.956909f, 395.167877f, 345.942200f)); // -72817 - points.push_back(core::vector3df(587.383118f, 391.444519f, 566.098633f)); // -73477 - points.push_back(core::vector3df(559.572449f, 371.991333f, 777.689453f)); // -74124 - points.push_back(core::vector3df(423.753204f, 329.990051f, 925.859741f)); // -74941 - points.push_back(core::vector3df(247.520050f, 252.818954f, 935.311829f)); // -75651 - points.push_back(core::vector3df(114.756012f, 199.799759f, 805.014160f)); - points.push_back(core::vector3df(96.783348f, 181.639481f, 648.188110f)); - points.push_back(core::vector3df(97.865623f, 138.905975f, 484.812561f)); - points.push_back(core::vector3df(99.612457f, 102.463669f, 347.603210f)); - points.push_back(core::vector3df(99.612457f, 102.463669f, 347.603210f)); - points.push_back(core::vector3df(99.612457f, 102.463669f, 347.603210f)); - - timeForThisScene = (points.size()-3)* 1000; - - camera = sm->addCameraSceneNode(0, points[0], core::vector3df(0 ,400,0)); - //camera->setTarget(core::vector3df(0,400,0)); - - sa = sm->createFollowSplineAnimator(device->getTimer()->getTime(), - points); - camera->addAnimator(sa); - sa->drop(); - - model1->setVisible(false); - model2->setVisible(false); - campFire->setVisible(false); - inOutFader->fadeIn(7000); - } - break; - - case 2: // down fly anim camera - camera = sm->addCameraSceneNode(0, core::vector3df(100,40,-80), core::vector3df(844,670,-885)); - sa = sm->createFlyStraightAnimator(core::vector3df(94, 1002, 127), - core::vector3df(108, 15, -60), 10000, true); - camera->addAnimator(sa); - timeForThisScene = 9900; - model1->setVisible(true); - model2->setVisible(false); - campFire->setVisible(false); - sa->drop(); - break; - - case 3: // interactive, go around - { - model1->setVisible(true); - model2->setVisible(true); - campFire->setVisible(true); - timeForThisScene = -1; - - core::array keyMap(11); - - keyMap.push_back( SKeyMap(EKA_MOVE_FORWARD, KEY_UP) ); - keyMap.push_back( SKeyMap(EKA_MOVE_FORWARD, KEY_KEY_W) ); - - keyMap.push_back( SKeyMap(EKA_MOVE_BACKWARD, KEY_DOWN) ); - keyMap.push_back( SKeyMap(EKA_MOVE_BACKWARD, KEY_KEY_S) ); - - keyMap.push_back( SKeyMap(EKA_STRAFE_LEFT, KEY_LEFT) ); - keyMap.push_back( SKeyMap(EKA_STRAFE_LEFT, KEY_KEY_A) ); - - keyMap.push_back( SKeyMap(EKA_STRAFE_RIGHT, KEY_RIGHT) ); - keyMap.push_back( SKeyMap(EKA_STRAFE_RIGHT, KEY_KEY_D) ); - - keyMap.push_back( SKeyMap(EKA_JUMP_UP, KEY_KEY_J) ); - - keyMap.push_back( SKeyMap(EKA_ROTATE_LEFT, KEY_KEY_Q) ); - - keyMap.push_back( SKeyMap(EKA_ROTATE_RIGHT, KEY_KEY_E) ); - - camera = sm->addCameraSceneNodeFPS(0, 100.0f, .4f, -1, keyMap.pointer(), keyMap.size(), false, 300.f); - camera->setPosition(core::vector3df(108,140,-140)); - camera->setFarValue(5000.0f); - - scene::ISceneNodeAnimatorCollisionResponse* collider = - sm->createCollisionResponseAnimator( - metaSelector, camera, core::vector3df(25,50,25), - core::vector3df(0, quakeLevelMesh ? -1000.f : 0.0f,0), - core::vector3df(0,45,0), 0.005f); - - camera->addAnimator(collider); - collider->drop(); - } - break; - } - - sceneStartTime = device->getTimer()->getTime(); -} - - -void CDemo::loadSceneData() -{ - // load quake level - - video::IVideoDriver* driver = device->getVideoDriver(); - scene::ISceneManager* sm = device->getSceneManager(); - - // Quake3 Shader controls Z-Writing - sm->getParameters()->setAttribute(scene::ALLOW_ZWRITE_ON_TRANSPARENT, true); - - quakeLevelMesh = (scene::IQ3LevelMesh*) sm->getMesh("maps/20kdm2.bsp"); - - if (quakeLevelMesh) - { - u32 i; - - //move all quake level meshes (non-realtime) - core::matrix4 m; - m.setTranslation(core::vector3df(-1300,-70,-1249)); - - for ( i = 0; i != scene::quake3::E_Q3_MESH_SIZE; ++i ) - sm->getMeshManipulator()->transform(quakeLevelMesh->getMesh(i), m); - - quakeLevelNode = sm->addOctreeSceneNode( - quakeLevelMesh->getMesh( scene::quake3::E_Q3_MESH_GEOMETRY)); - if (quakeLevelNode) - { - //quakeLevelNode->setPosition(core::vector3df(-1300,-70,-1249)); - quakeLevelNode->setVisible(true); - - // create map triangle selector - mapSelector = sm->createOctreeTriangleSelector(quakeLevelMesh->getMesh(0), - quakeLevelNode, 128); - - // if not using shader and no gamma it's better to use more lighting, because - // quake3 level are usually dark - quakeLevelNode->setMaterialType ( video::EMT_LIGHTMAP_M4 ); - - // set additive blending if wanted - if (additive) - quakeLevelNode->setMaterialType(video::EMT_LIGHTMAP_ADD); - } - - // the additional mesh can be quite huge and is unoptimized - scene::IMesh * additional_mesh = quakeLevelMesh->getMesh ( scene::quake3::E_Q3_MESH_ITEMS ); - - for ( i = 0; i!= additional_mesh->getMeshBufferCount (); ++i ) - { - scene::IMeshBuffer *meshBuffer = additional_mesh->getMeshBuffer ( i ); - const video::SMaterial &material = meshBuffer->getMaterial(); - - //! The ShaderIndex is stored in the material parameter - s32 shaderIndex = (s32) material.MaterialTypeParam2; - - // the meshbuffer can be rendered without additional support, or it has no shader - const scene::quake3::IShader *shader = quakeLevelMesh->getShader ( shaderIndex ); - if ( 0 == shader ) - { - continue; - } - // Now add the MeshBuffer(s) with the current Shader to the Manager - sm->addQuake3SceneNode ( meshBuffer, shader ); - } - } - - const io::path mediaPath = getExampleMediaPath(); - - // load sydney model and create 2 instances - - scene::IAnimatedMesh* mesh = 0; - mesh = sm->getMesh(mediaPath + "sydney.md2"); - if (mesh) - { - model1 = sm->addAnimatedMeshSceneNode(mesh); - if (model1) - { - model1->setMaterialTexture(0, driver->getTexture(mediaPath + "spheremap.jpg")); - model1->setPosition(core::vector3df(100,40,-80)); - model1->setScale(core::vector3df(2,2,2)); - model1->setMD2Animation(scene::EMAT_STAND); - model1->setMaterialFlag(video::EMF_LIGHTING, true); - model1->getMaterial(0).Shininess = 40.f; - model1->setMaterialFlag(video::EMF_NORMALIZE_NORMALS, true); - model1->setMaterialType(video::EMT_SPHERE_MAP); - model1->setAutomaticCulling(scene::EAC_OFF); // avoid shadows not updating - scene::IShadowVolumeSceneNode * shadVol = model1->addShadowVolumeSceneNode(); - if(shadVol) shadVol->setOptimization(scene::ESV_NONE); // Sydney has broken shadows otherwise - } - - model2 = sm->addAnimatedMeshSceneNode(mesh); - if (model2) - { - model2->setPosition(core::vector3df(180,15,-60)); - model2->setScale(core::vector3df(2,2,2)); - model2->setMD2Animation(scene::EMAT_RUN); - model2->setMaterialTexture(0, device->getVideoDriver()->getTexture(mediaPath + "sydney.bmp")); - model2->setMaterialFlag(video::EMF_LIGHTING, true); - model2->setMaterialFlag(video::EMF_NORMALIZE_NORMALS, true); - model2->setAutomaticCulling(scene::EAC_OFF); // avoid shadows not updating - scene::IShadowVolumeSceneNode * shadVol = model2->addShadowVolumeSceneNode(); - if (shadVol) shadVol->setOptimization(scene::ESV_NONE); // Sydney has broken shadows otherwise - } - } - - scene::ISceneNodeAnimator* anim = 0; - - // create sky box - driver->setTextureCreationFlag(video::ETCF_CREATE_MIP_MAPS, false); - skyboxNode = sm->addSkyBoxSceneNode( - driver->getTexture(mediaPath + "irrlicht2_up.jpg"), - driver->getTexture(mediaPath + "irrlicht2_dn.jpg"), - driver->getTexture(mediaPath + "irrlicht2_lf.jpg"), - driver->getTexture(mediaPath + "irrlicht2_rt.jpg"), - driver->getTexture(mediaPath + "irrlicht2_ft.jpg"), - driver->getTexture(mediaPath + "irrlicht2_bk.jpg")); - driver->setTextureCreationFlag(video::ETCF_CREATE_MIP_MAPS, true); - - // create walk-between-portals animation - - core::vector3df waypoint[2]; - waypoint[0].set(-150,40,100); - waypoint[1].set(350,40,100); - - if (model2) - { - anim = device->getSceneManager()->createFlyStraightAnimator( - waypoint[0], waypoint[1], 2000, true); - model2->addAnimator(anim); - anim->drop(); - } - - // create animation for portals; - - core::array textures; - for (s32 g=1; g<8; ++g) - { - core::stringc tmp(mediaPath + "portal"); - tmp += g; - tmp += ".bmp"; - video::ITexture* t = driver->getTexture( tmp ); - textures.push_back(t); - } - - anim = sm->createTextureAnimator(textures, 100); - - // create portals - - scene::IBillboardSceneNode* bill = 0; - - for (int r=0; r<2; ++r) - { - bill = sm->addBillboardSceneNode(0, core::dimension2d(100,100), - waypoint[r]+ core::vector3df(0,20,0)); - bill->setMaterialFlag(video::EMF_LIGHTING, false); - bill->setMaterialFlag(video::EMF_ZWRITE_ENABLE, false); - bill->setMaterialTexture(0, driver->getTexture(mediaPath + "portal1.bmp")); - bill->setMaterialType(video::EMT_TRANSPARENT_ADD_COLOR); - bill->addAnimator(anim); - } - - anim->drop(); - - // create cirlce flying dynamic light with transparent billboard attached - - scene::ILightSceneNode* light = 0; - - light = sm->addLightSceneNode(0, - core::vector3df(0,0,0), video::SColorf(1.0f, 1.0f, 1.f, 1.0f), 500.f); - - anim = sm->createFlyCircleAnimator( - core::vector3df(100,150,80), 80.0f, 0.0005f); - - light->addAnimator(anim); - anim->drop(); - - bill = device->getSceneManager()->addBillboardSceneNode( - light, core::dimension2d(40,40)); - bill->setMaterialFlag(video::EMF_LIGHTING, false); - bill->setMaterialTexture(0, driver->getTexture(mediaPath + "particlewhite.bmp")); - bill->setMaterialType(video::EMT_TRANSPARENT_ADD_COLOR); - - // create meta triangle selector with all triangles selectors in it. - metaSelector = sm->createMetaTriangleSelector(); - metaSelector->addTriangleSelector(mapSelector); - - // create camp fire - - campFire = sm->addParticleSystemSceneNode(false); - campFire->setPosition(core::vector3df(100,120,600)); - campFire->setScale(core::vector3df(2,2,2)); - - scene::IParticleEmitter* em = campFire->createBoxEmitter( - core::aabbox3d(-7,0,-7,7,1,7), - core::vector3df(0.0f,0.06f,0.0f), - 80,100, video::SColor(1,255,255,255),video::SColor(1,255,255,255), 800,2000); - - em->setMinStartSize(core::dimension2d(20.0f, 10.0f)); - em->setMaxStartSize(core::dimension2d(20.0f, 10.0f)); - campFire->setEmitter(em); - em->drop(); - - scene::IParticleAffector* paf = campFire->createFadeOutParticleAffector(); - campFire->addAffector(paf); - paf->drop(); - - campFire->setMaterialFlag(video::EMF_LIGHTING, false); - campFire->setMaterialFlag(video::EMF_ZWRITE_ENABLE, false); - campFire->setMaterialTexture(0, driver->getTexture(mediaPath + "fireball.bmp")); - campFire->setMaterialType(video::EMT_TRANSPARENT_ADD_COLOR); - - // load music - - #ifdef USE_IRRKLANG - if (music) - startIrrKlang(); - #endif - #ifdef USE_SDL_MIXER - if (music) - startSound(); - #endif -} - - -void CDemo::createLoadingScreen() -{ - core::dimension2d size = device->getVideoDriver()->getScreenSize(); - - device->getCursorControl()->setVisible(false); - - // setup loading screen - - backColor.set(255,90,90,156); - - // create in fader - - inOutFader = device->getGUIEnvironment()->addInOutFader(); - inOutFader->setColor(backColor, video::SColor ( 0, 230, 230, 230 )); - - const io::path mediaPath = getExampleMediaPath(); - - // irrlicht logo - device->getGUIEnvironment()->addImage(device->getVideoDriver()->getTexture(mediaPath + "irrlichtlogo3.png"), - core::position2d(5,5)); - - // loading text - - const int lwidth = size.Width - 20; - const int lheight = 16; - - core::rect pos(10, size.Height-lheight-10, 10+lwidth, size.Height-10); - - device->getGUIEnvironment()->addImage(pos); - statusText = device->getGUIEnvironment()->addStaticText(L"Loading...", pos, true); - statusText->setOverrideColor(video::SColor(255,205,200,200)); - - // load bigger font - - device->getGUIEnvironment()->getSkin()->setFont( - device->getGUIEnvironment()->getFont(mediaPath + "fonthaettenschweiler.bmp")); - - // set new font color - - device->getGUIEnvironment()->getSkin()->setColor(gui::EGDC_BUTTON_TEXT, - video::SColor(255,100,100,100)); -} - - -void CDemo::shoot() -{ - scene::ISceneManager* sm = device->getSceneManager(); - scene::ICameraSceneNode* camera = sm->getActiveCamera(); - - if (!camera || !mapSelector) - return; - - SParticleImpact imp; - imp.when = 0; - - // get line of camera - - core::vector3df start = camera->getPosition(); - core::vector3df end = (camera->getTarget() - start); - end.normalize(); - start += end*8.0f; - end = start + (end * camera->getFarValue()); - - core::triangle3df triangle; - - core::line3d line(start, end); - - // get intersection point with map - scene::ISceneNode* hitNode; - if (sm->getSceneCollisionManager()->getCollisionPoint( - line, mapSelector, end, triangle, hitNode)) - { - // collides with wall - core::vector3df out = triangle.getNormal(); - out.setLength(0.03f); - - imp.when = 1; - imp.outVector = out; - imp.pos = end; - } - else - { - // doesnt collide with wall - start = camera->getPosition(); - end = (camera->getTarget() - start); - end.normalize(); - start += end*8.0f; - end = start + (end * camera->getFarValue()); - } - - // create fire ball - scene::ISceneNode* node = 0; - node = sm->addBillboardSceneNode(0, - core::dimension2d(25,25), start); - - node->setMaterialFlag(video::EMF_LIGHTING, false); - node->setMaterialTexture(0, device->getVideoDriver()->getTexture(getExampleMediaPath() + "fireball.bmp")); - node->setMaterialType(video::EMT_TRANSPARENT_ADD_COLOR); - - f32 length = (f32)(end - start).getLength(); - const f32 speed = 0.6f; - u32 time = (u32)(length / speed); - - scene::ISceneNodeAnimator* anim = 0; - - // set flight line - - anim = sm->createFlyStraightAnimator(start, end, time); - node->addAnimator(anim); - anim->drop(); - - anim = sm->createDeleteAnimator(time); - node->addAnimator(anim); - anim->drop(); - - if (imp.when) - { - // create impact note - imp.when = device->getTimer()->getTime() + (time - 100); - Impacts.push_back(imp); - } - - // play sound - #ifdef USE_IRRKLANG - if (ballSound) - irrKlang->play2D(ballSound); - #endif - #ifdef USE_SDL_MIXER - if (ballSound) - playSound(ballSound); - #endif -} - - -void CDemo::createParticleImpacts() -{ - u32 now = device->getTimer()->getTime(); - scene::ISceneManager* sm = device->getSceneManager(); - - for (s32 i=0; i<(s32)Impacts.size(); ++i) - if (now > Impacts[i].when) - { - // create smoke particle system - scene::IParticleSystemSceneNode* pas = 0; - - pas = sm->addParticleSystemSceneNode(false, 0, -1, Impacts[i].pos); - - pas->setParticleSize(core::dimension2d(10.0f, 10.0f)); - - scene::IParticleEmitter* em = pas->createBoxEmitter( - core::aabbox3d(-5,-5,-5,5,5,5), - Impacts[i].outVector, 20,40, video::SColor(50,255,255,255),video::SColor(50,255,255,255), - 1200,1600, 20); - - pas->setEmitter(em); - em->drop(); - - scene::IParticleAffector* paf = campFire->createFadeOutParticleAffector(); - pas->addAffector(paf); - paf->drop(); - - pas->setMaterialFlag(video::EMF_LIGHTING, false); - pas->setMaterialFlag(video::EMF_ZWRITE_ENABLE, false); - pas->setMaterialTexture(0, device->getVideoDriver()->getTexture(getExampleMediaPath() + "smoke.bmp")); - pas->setMaterialType(video::EMT_TRANSPARENT_ADD_COLOR); - - scene::ISceneNodeAnimator* anim = sm->createDeleteAnimator(2000); - pas->addAnimator(anim); - anim->drop(); - - // play impact sound - #ifdef USE_IRRKLANG - if (irrKlang) - { - irrklang::ISound* sound = - irrKlang->play3D(impactSound, Impacts[i].pos, false, false, true); - - if (sound) - { - // adjust max value a bit to make to sound of an impact louder - sound->setMinDistance(400); - sound->drop(); - } - } - #endif - - #ifdef USE_SDL_MIXER - if (impactSound) - playSound(impactSound); - #endif - - // delete entry - Impacts.erase(i); - i--; - } -} - - -#ifdef USE_IRRKLANG -void CDemo::startIrrKlang() -{ - irrKlang = irrklang::createIrrKlangDevice(); - - if (!irrKlang) - return; - - const io::path mediaPath = getExampleMediaPath(); - - // play music - - irrklang::ISound* snd = irrKlang->play2D((mediaPath + "IrrlichtTheme.ogg").c_str(), true, false, true); - if ( !snd ) - snd = irrKlang->play2D("IrrlichtTheme.ogg", true, false, true); - - if (snd) - { - snd->setVolume(0.5f); // 50% volume - snd->drop(); - } - - // preload both sound effects - - ballSound = irrKlang->getSoundSource(mediaPath + "ball.wav"); - impactSound = irrKlang->getSoundSource(mediaPath + "impact.wav"); -} -#endif - - -#ifdef USE_SDL_MIXER -void CDemo::startSound() -{ - stream = NULL; - ballSound = NULL; - impactSound = NULL; - - SDL_Init(SDL_INIT_AUDIO); - - if (Mix_OpenAudio(44100, AUDIO_S16SYS, 2, 4096)) - return; - - const io::path mediaPath = getExampleMediaPath(); - - stream = Mix_LoadMUS((mediaPath + "IrrlichtTheme.ogg").c_str()); - if (stream) - Mix_PlayMusic(stream, -1); - - ballSound = Mix_LoadWAV((mediaPath + "ball.wav").c_str()); - impactSound = Mix_LoadWAV((mediaPath + "impact.wav").c_str()); -} - -void CDemo::playSound(Mix_Chunk *sample) -{ - if (sample) - Mix_PlayChannel(-1, sample, 0); -} - -void CDemo::pollSound(void) -{ - SDL_Event event; - - while (SDL_PollEvent(&event)) - ; -} -#endif diff --git a/examples/Demo/CDemo.h b/examples/Demo/CDemo.h deleted file mode 100644 index 0b2ca39c..00000000 --- a/examples/Demo/CDemo.h +++ /dev/null @@ -1,110 +0,0 @@ -// This is a Demo of the Irrlicht Engine (c) 2006 by N.Gebhardt. -// This file is not documented. - -#ifndef __C_DEMO_H_INCLUDED__ -#define __C_DEMO_H_INCLUDED__ - -//#define USE_IRRKLANG -//#define USE_SDL_MIXER - -#include - -#ifdef _IRR_WINDOWS_ -#include -#endif - -using namespace irr; - -// audio support - -#ifdef USE_IRRKLANG - #include // problem here? go to http://www.ambiera.com/irrklang and download - // the irrKlang library or undefine USE_IRRKLANG at the beginning - // of this file. - #ifdef _MSC_VER - #pragma comment (lib, "irrKlang.lib") - #endif -#endif -#ifdef USE_SDL_MIXER - # include - # include -#endif - -const int CAMERA_COUNT = 7; - -class CDemo : public IEventReceiver -{ -public: - - CDemo(bool fullscreen, bool music, bool shadows, bool additive, bool vsync, bool aa, video::E_DRIVER_TYPE driver); - - ~CDemo(); - - void run(); - - virtual bool OnEvent(const SEvent& event); - -private: - - void createLoadingScreen(); - void loadSceneData(); - void switchToNextScene(); - void shoot(); - void createParticleImpacts(); - - bool fullscreen; - bool music; - bool shadows; - bool additive; - bool vsync; - bool aa; - video::E_DRIVER_TYPE driverType; - IrrlichtDevice *device; - -#ifdef USE_IRRKLANG - void startIrrKlang(); - irrklang::ISoundEngine* irrKlang; - irrklang::ISoundSource* ballSound; - irrklang::ISoundSource* impactSound; -#endif - -#ifdef USE_SDL_MIXER - void startSound(); - void playSound(Mix_Chunk *); - void pollSound(); - Mix_Music *stream; - Mix_Chunk *ballSound; - Mix_Chunk *impactSound; -#endif - - struct SParticleImpact - { - u32 when; - core::vector3df pos; - core::vector3df outVector; - }; - - int currentScene; - video::SColor backColor; - - gui::IGUIStaticText* statusText; - gui::IGUIInOutFader* inOutFader; - - scene::IQ3LevelMesh* quakeLevelMesh; - scene::ISceneNode* quakeLevelNode; - scene::ISceneNode* skyboxNode; - scene::IAnimatedMeshSceneNode* model1; - scene::IAnimatedMeshSceneNode* model2; - scene::IParticleSystemSceneNode* campFire; - - scene::IMetaTriangleSelector* metaSelector; - scene::ITriangleSelector* mapSelector; - - s32 sceneStartTime; - s32 timeForThisScene; - - core::array Impacts; -}; - -#endif - diff --git a/examples/Demo/CMainMenu.cpp b/examples/Demo/CMainMenu.cpp deleted file mode 100644 index f67d9f3c..00000000 --- a/examples/Demo/CMainMenu.cpp +++ /dev/null @@ -1,393 +0,0 @@ -// This is a Demo of the Irrlicht Engine (c) 2005-2009 by N.Gebhardt. -// This file is not documented. - -#include "CMainMenu.h" -#include "CDemo.h" -#include "exampleHelper.h" - - - -CMainMenu::CMainMenu() -: startButton(0), MenuDevice(0), selected(0), start(false), fullscreen(false), -#if defined(USE_IRRKLANG) || defined(USE_SDL_MIXER) - music(true), -#else - music(false), -#endif - shadows(true), additive(false), transparent(true), vsync(true), aa(true), -#ifndef _IRR_WINDOWS_ - driverType(video::EDT_OPENGL) -#else - driverType(video::EDT_DIRECT3D9) -#endif - //driverType(video::EDT_BURNINGSVIDEO) -{ -} - - -bool CMainMenu::run() -{ - video::E_DRIVER_TYPE driverType = video::EDT_OPENGL; - if (!IrrlichtDevice::isDriverSupported(video::EDT_OPENGL)) - driverType = video::EDT_BURNINGSVIDEO; - - MenuDevice = createDevice(driverType, - core::dimension2d(512, 384), 16, false, false, false, this); - - const io::path mediaPath = getExampleMediaPath(); - - if (MenuDevice->getFileSystem()->existFile("irrlicht.dat")) - MenuDevice->getFileSystem()->addFileArchive("irrlicht.dat"); - else - MenuDevice->getFileSystem()->addFileArchive(mediaPath + "irrlicht.dat"); - - video::IVideoDriver* driver = MenuDevice->getVideoDriver(); - scene::ISceneManager* smgr = MenuDevice->getSceneManager(); - gui::IGUIEnvironment* guienv = MenuDevice->getGUIEnvironment(); - - core::stringw str = "Irrlicht Engine Demo v"; - str += MenuDevice->getVersion(); - MenuDevice->setWindowCaption(str.c_str()); - - // set new Skin - gui::IGUISkin* newskin = guienv->createSkin(gui::EGST_BURNING_SKIN); - guienv->setSkin(newskin); - newskin->drop(); - - // load font - gui::IGUIFont* font = guienv->getFont(mediaPath + "fonthaettenschweiler.bmp"); - if (font) - guienv->getSkin()->setFont(font); - - // add images - - const s32 leftX = 260; - - // add tab control - gui::IGUITabControl* tabctrl = guienv->addTabControl(core::rect(leftX,10,512-10,384-10), - 0, true, true); - gui::IGUITab* optTab = tabctrl->addTab(L"Demo"); - gui::IGUITab* aboutTab = tabctrl->addTab(L"About"); - - // add list box - - gui::IGUIListBox* box = guienv->addListBox(core::rect(10,10,220,120), optTab, 1); - for (u32 i=1; iaddItem(core::stringw(video::DRIVER_TYPE_NAMES[i]).c_str()); - if ( driverType == video::E_DRIVER_TYPE(i) ) - selected = box->getItemCount()-1; - } - } - box->setSelected(selected); - - // add button - - startButton = guienv->addButton(core::rect(30,295,200,324), optTab, 2, L"Start Demo"); - - // add checkbox - - const s32 d = 50; - - guienv->addCheckBox(fullscreen, core::rect(20,85+d,130,110+d), - optTab, 3, L"Fullscreen"); - guienv->addCheckBox(music, core::rect(135,85+d,245,110+d), - optTab, 4, L"Music & Sfx"); - guienv->addCheckBox(shadows, core::rect(20,110+d,135,135+d), - optTab, 5, L"Realtime shadows"); - guienv->addCheckBox(additive, core::rect(20,135+d,230,160+d), - optTab, 6, L"Old HW compatible blending"); - guienv->addCheckBox(vsync, core::rect(20,160+d,230,185+d), - optTab, 7, L"Vertical synchronisation"); - guienv->addCheckBox(aa, core::rect(20,185+d,230,210+d), - optTab, 8, L"Antialiasing"); - - // add about text - - const wchar_t* text2 = L"This is the tech demo of the Irrlicht engine. To start, "\ - L"select a video driver which works best with your hardware and press 'Start Demo'.\n"\ - L"What you currently see is displayed using the Burning Software Renderer (Thomas Alten).\n"\ - L"The Irrlicht Engine was written by me, Nikolaus Gebhardt. The models, "\ - L"maps and textures were placed at my disposal by B.Collins, M.Cook and J.Marton. The music was created by "\ - L"M.Rohde and is played back by irrKlang.\n"\ - L"For more information, please visit the homepage of the Irrlicht engine:\nhttp://irrlicht.sourceforge.net"; - - guienv->addStaticText(text2, core::rect(10, 10, 230, 320), - true, true, aboutTab); - - // add md2 model - - scene::IAnimatedMesh* mesh = smgr->getMesh(mediaPath + "faerie.md2"); - scene::IAnimatedMeshSceneNode* modelNode = smgr->addAnimatedMeshSceneNode(mesh); - if (modelNode) - { - modelNode->setPosition( core::vector3df(0.f, 0.f, -5.f) ); - modelNode->setMaterialTexture(0, driver->getTexture(mediaPath + "faerie2.bmp")); - modelNode->setMaterialFlag(video::EMF_LIGHTING, true); - modelNode->getMaterial(0).Shininess = 50.f; - modelNode->getMaterial(0).NormalizeNormals = true; - modelNode->setMD2Animation(scene::EMAT_STAND); - } - - // set ambient light (no sun light in the catacombs) - smgr->setAmbientLight( video::SColorf(0.2f, 0.2f, 0.2f) ); - - scene::ILightSceneNode *light; - scene::ISceneNodeAnimator* anim; - scene::ISceneNode* bill; - - enum eLightParticle - { - LIGHT_NONE, - LIGHT_GLOBAL, - LIGHT_RED, - LIGHT_BLUE - }; - core::vector3df lightDir[2] = { - core::vector3df(0.f, 0.1f, 0.4f), - core::vector3df(0.f, 0.1f, -0.4f), - }; - - struct SLightParticle - { - eLightParticle type; - u32 dir; - }; - const SLightParticle lightParticle[] = - { - //LIGHT_GLOBAL,0, - {LIGHT_RED,0}, - {LIGHT_BLUE,0}, - {LIGHT_RED,1}, - {LIGHT_BLUE,1}, - {LIGHT_NONE,0} - }; - - const SLightParticle *l = lightParticle; - while ( l->type != LIGHT_NONE ) - { - switch ( l->type ) - { - case LIGHT_GLOBAL: - // add illumination from the background - light = smgr->addLightSceneNode(0, core::vector3df(10.f,40.f,-5.f), - video::SColorf(0.2f, 0.2f, 0.2f), 90.f); - break; - case LIGHT_RED: - // add light nearly red - light = smgr->addLightSceneNode(0, core::vector3df(0,1,0), - video::SColorf(0.8f, 0.f, 0.f, 0.0f), 30.0f); - // attach red billboard to the light - bill = smgr->addBillboardSceneNode(light, core::dimension2d(10, 10)); - if ( bill ) - { - bill->setMaterialFlag(video::EMF_LIGHTING, false); - bill->setMaterialType(video::EMT_TRANSPARENT_ADD_COLOR); - bill->setMaterialFlag(video::EMF_ZWRITE_ENABLE, false); - bill->setMaterialTexture(0, driver->getTexture(mediaPath + "particlered.bmp")); - } - // add fly circle animator to the light - anim = smgr->createFlyCircleAnimator(core::vector3df(0.f,0.f,-5.f),20.f, - 0.002f, lightDir [l->dir] ); - light->addAnimator(anim); - anim->drop(); - break; - case LIGHT_BLUE: - // add light nearly blue - light = smgr->addLightSceneNode(0, core::vector3df(0,1,0), - video::SColorf(0.f, 0.0f, 0.8f, 0.0f), 30.0f); - // attach blue billboard to the light - bill = smgr->addBillboardSceneNode(light, core::dimension2d(10, 10)); - if (bill) - { - bill->setMaterialFlag(video::EMF_LIGHTING, false); - bill->setMaterialType(video::EMT_TRANSPARENT_ADD_COLOR); - bill->setMaterialFlag(video::EMF_ZWRITE_ENABLE, false); - bill->setMaterialTexture(0, driver->getTexture(mediaPath + "portal1.bmp")); - } - // add fly circle animator to the light - anim = smgr->createFlyCircleAnimator(core::vector3df(0.f,0.f,-5.f),20.f, - -0.002f, lightDir [l->dir], 0.5f); - light->addAnimator(anim); - anim->drop(); - break; - case LIGHT_NONE: - break; - } - l += 1; - } - - // create a fixed camera - smgr->addCameraSceneNode(0, core::vector3df(45,0,0), core::vector3df(0,0,10)); - - - // irrlicht logo and background - // add irrlicht logo - bool oldMipMapState = driver->getTextureCreationFlag(video::ETCF_CREATE_MIP_MAPS); - driver->setTextureCreationFlag(video::ETCF_CREATE_MIP_MAPS, false); - - guienv->addImage(driver->getTexture(mediaPath + "irrlichtlogo3.png"), - core::position2d(5,5)); - - video::ITexture* irrlichtBack = driver->getTexture(mediaPath + "demoback.jpg"); - - driver->setTextureCreationFlag(video::ETCF_CREATE_MIP_MAPS, oldMipMapState); - - // query original skin color - getOriginalSkinColor(); - - // set transparency - setTransparency(); - - // draw all - - while(MenuDevice->run()) - { - if (MenuDevice->isWindowActive()) - { - driver->beginScene(video::ECBF_DEPTH, video::SColor(0,0,0,0)); - - if (irrlichtBack) - driver->draw2DImage(irrlichtBack, - core::position2d(0,0)); - - smgr->drawAll(); - guienv->drawAll(); - driver->endScene(); - } - } - - MenuDevice->drop(); - - for (u32 i=1; igetVideoDriver()->createScreenShot(); - if (image) - { - MenuDevice->getVideoDriver()->writeImageToFile(image, "screenshot_main.jpg"); - image->drop(); - } - } - else - if (event.EventType == irr::EET_MOUSE_INPUT_EVENT && - event.MouseInput.Event == EMIE_RMOUSE_LEFT_UP ) - { - core::rect r(event.MouseInput.X, event.MouseInput.Y, 0, 0); - gui::IGUIContextMenu* menu = MenuDevice->getGUIEnvironment()->addContextMenu(r, 0, 45); - menu->addItem(L"transparent menus", 666, transparent == false); - menu->addItem(L"solid menus", 666, transparent == true); - menu->addSeparator(); - menu->addItem(L"Cancel"); - } - else - if (event.EventType == EET_GUI_EVENT) - { - s32 id = event.GUIEvent.Caller->getID(); - switch(id) - { - case 45: // context menu - if (event.GUIEvent.EventType == gui::EGET_MENU_ITEM_SELECTED) - { - s32 s = ((gui::IGUIContextMenu*)event.GUIEvent.Caller)->getSelectedItem(); - if (s == 0 || s == 1) - { - transparent = !transparent; - setTransparency(); - } - } - break; - case 1: - if (event.GUIEvent.EventType == gui::EGET_LISTBOX_CHANGED || - event.GUIEvent.EventType == gui::EGET_LISTBOX_SELECTED_AGAIN) - { - selected = ((gui::IGUIListBox*)event.GUIEvent.Caller)->getSelected(); - //startButton->setEnabled(selected != 4); - startButton->setEnabled(true); - } - break; - case 2: - if (event.GUIEvent.EventType == gui::EGET_BUTTON_CLICKED ) - { - MenuDevice->closeDevice(); - start = true; - } - case 3: - if (event.GUIEvent.EventType == gui::EGET_CHECKBOX_CHANGED ) - fullscreen = ((gui::IGUICheckBox*)event.GUIEvent.Caller)->isChecked(); - break; - case 4: - if (event.GUIEvent.EventType == gui::EGET_CHECKBOX_CHANGED ) - music = ((gui::IGUICheckBox*)event.GUIEvent.Caller)->isChecked(); - break; - case 5: - if (event.GUIEvent.EventType == gui::EGET_CHECKBOX_CHANGED ) - shadows = ((gui::IGUICheckBox*)event.GUIEvent.Caller)->isChecked(); - break; - case 6: - if (event.GUIEvent.EventType == gui::EGET_CHECKBOX_CHANGED ) - additive = ((gui::IGUICheckBox*)event.GUIEvent.Caller)->isChecked(); - break; - case 7: - if (event.GUIEvent.EventType == gui::EGET_CHECKBOX_CHANGED ) - vsync = ((gui::IGUICheckBox*)event.GUIEvent.Caller)->isChecked(); - break; - case 8: - if (event.GUIEvent.EventType == gui::EGET_CHECKBOX_CHANGED ) - aa = ((gui::IGUICheckBox*)event.GUIEvent.Caller)->isChecked(); - break; - } - } - - return false; -} - - -void CMainMenu::getOriginalSkinColor() -{ - irr::gui::IGUISkin * skin = MenuDevice->getGUIEnvironment()->getSkin(); - for (s32 i=0; igetColor( (gui::EGUI_DEFAULT_COLOR)i ); - } - -} - - -void CMainMenu::setTransparency() -{ - irr::gui::IGUISkin * skin = MenuDevice->getGUIEnvironment()->getSkin(); - - for (u32 i=0; isetColor((gui::EGUI_DEFAULT_COLOR)i, col); - } -} - diff --git a/examples/Demo/CMainMenu.h b/examples/Demo/CMainMenu.h deleted file mode 100644 index 6a3dd358..00000000 --- a/examples/Demo/CMainMenu.h +++ /dev/null @@ -1,56 +0,0 @@ -// This is a Demo of the Irrlicht Engine (c) 2005 by N.Gebhardt. -// This file is not documentated. - -#ifndef __C_MAIN_MENU_H_INCLUDED__ -#define __C_MAIN_MENU_H_INCLUDED__ - -#include - -using namespace irr; - -class CMainMenu : public IEventReceiver -{ -public: - - CMainMenu(); - - bool run(); - - bool getFullscreen() const { return fullscreen; } - bool getMusic() const { return music; } - bool getShadows() const { return shadows; } - bool getAdditive() const { return additive; } - bool getVSync() const { return vsync; } - bool getAntiAliasing() const { return aa; } - video::E_DRIVER_TYPE getDriverType() const { return driverType; } - - - virtual bool OnEvent(const SEvent& event); - -private: - - void setTransparency(); - - gui::IGUIButton* startButton; - IrrlichtDevice *MenuDevice; - s32 selected; - bool start; - bool fullscreen; - bool music; - bool shadows; - bool additive; - bool transparent; - bool vsync; - bool aa; - video::E_DRIVER_TYPE driverType; - - scene::IAnimatedMesh* quakeLevel; - scene::ISceneNode* lightMapNode; - scene::ISceneNode* dynamicNode; - - video::SColor SkinColor [ gui::EGDC_COUNT ]; - void getOriginalSkinColor(); -}; - -#endif - diff --git a/examples/Demo/Demo.vcproj b/examples/Demo/Demo.vcproj deleted file mode 100644 index fe55b37f..00000000 --- a/examples/Demo/Demo.vcproj +++ /dev/null @@ -1,223 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/examples/Demo/Demo.xcodeproj/project.pbxproj b/examples/Demo/Demo.xcodeproj/project.pbxproj deleted file mode 100644 index b27eb4c6..00000000 --- a/examples/Demo/Demo.xcodeproj/project.pbxproj +++ /dev/null @@ -1,336 +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 */; }; - 5EBFAE801BB493CC0095BC45 /* CDemo.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5EBFAE7C1BB493CC0095BC45 /* CDemo.cpp */; }; - 5EBFAE811BB493CC0095BC45 /* CMainMenu.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5EBFAE7E1BB493CC0095BC45 /* CMainMenu.cpp */; }; -/* End PBXBuildFile section */ - -/* Begin PBXFileReference section */ - 5E34CC511B7F8E6E00F212E8 /* Demo.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Demo.app; sourceTree = BUILT_PRODUCTS_DIR; }; - 5E34CC741B7F8EEF00F212E8 /* main.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = main.cpp; sourceTree = ""; }; - 5E34CC781B7F90A000F212E8 /* libIrrlicht.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libIrrlicht.a; path = ../../lib/OSX/libIrrlicht.a; sourceTree = ""; }; - 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 = ""; }; - 5EBFAE7C1BB493CC0095BC45 /* CDemo.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CDemo.cpp; sourceTree = ""; }; - 5EBFAE7D1BB493CC0095BC45 /* CDemo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CDemo.h; sourceTree = ""; }; - 5EBFAE7E1BB493CC0095BC45 /* CMainMenu.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CMainMenu.cpp; sourceTree = ""; }; - 5EBFAE7F1BB493CC0095BC45 /* CMainMenu.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CMainMenu.h; sourceTree = ""; }; -/* 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 = ( - 5EBFAE7C1BB493CC0095BC45 /* CDemo.cpp */, - 5EBFAE7D1BB493CC0095BC45 /* CDemo.h */, - 5EBFAE7E1BB493CC0095BC45 /* CMainMenu.cpp */, - 5EBFAE7F1BB493CC0095BC45 /* CMainMenu.h */, - 5E34CC741B7F8EEF00F212E8 /* main.cpp */, - 5E34CC761B7F905600F212E8 /* Libraries */, - 5E34CC521B7F8E6E00F212E8 /* Products */, - 5E34CC771B7F906D00F212E8 /* Resources */, - ); - sourceTree = ""; - }; - 5E34CC521B7F8E6E00F212E8 /* Products */ = { - isa = PBXGroup; - children = ( - 5E34CC511B7F8E6E00F212E8 /* Demo.app */, - ); - name = Products; - sourceTree = ""; - }; - 5E34CC761B7F905600F212E8 /* Libraries */ = { - isa = PBXGroup; - children = ( - 5E8570B01B7F99F500B267D2 /* Cocoa.framework */, - 5E8570B41B7F9A0700B267D2 /* IOKit.framework */, - 5E8570B21B7F99FE00B267D2 /* OpenGL.framework */, - 5E34CC781B7F90A000F212E8 /* libIrrlicht.a */, - ); - name = Libraries; - sourceTree = ""; - }; - 5E34CC771B7F906D00F212E8 /* Resources */ = { - isa = PBXGroup; - children = ( - 5E8570BE1B7F9D3A00B267D2 /* media */, - ); - name = Resources; - sourceTree = ""; - }; -/* End PBXGroup section */ - -/* Begin PBXNativeTarget section */ - 5E34CC501B7F8E6E00F212E8 /* Demo */ = { - isa = PBXNativeTarget; - buildConfigurationList = 5E34CC701B7F8E6E00F212E8 /* Build configuration list for PBXNativeTarget "Demo" */; - buildPhases = ( - 5E34CC4D1B7F8E6E00F212E8 /* Sources */, - 5E34CC4E1B7F8E6E00F212E8 /* Frameworks */, - 5E34CC4F1B7F8E6E00F212E8 /* Resources */, - ); - buildRules = ( - ); - dependencies = ( - ); - name = Demo; - productName = 01.HelloWorld; - productReference = 5E34CC511B7F8E6E00F212E8 /* Demo.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 "Demo" */; - compatibilityVersion = "Xcode 3.2"; - developmentRegion = English; - hasScannedForEncodings = 0; - knownRegions = ( - en, - Base, - ); - mainGroup = 5E34C6D81B7F4A0C00F212E8; - productRefGroup = 5E34CC521B7F8E6E00F212E8 /* Products */; - projectDirPath = ""; - projectRoot = ""; - targets = ( - 5E34CC501B7F8E6E00F212E8 /* Demo */, - ); - }; -/* 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 = ( - 5EBFAE811BB493CC0095BC45 /* CMainMenu.cpp in Sources */, - 5EBFAE801BB493CC0095BC45 /* CDemo.cpp in Sources */, - 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 "Demo" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 5E34C6DD1B7F4A0C00F212E8 /* Debug */, - 5E34C6DE1B7F4A0C00F212E8 /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - 5E34CC701B7F8E6E00F212E8 /* Build configuration list for PBXNativeTarget "Demo" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 5E34CC6C1B7F8E6E00F212E8 /* Debug */, - 5E34CC6D1B7F8E6E00F212E8 /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; -/* End XCConfigurationList section */ - }; - rootObject = 5E34C6D91B7F4A0C00F212E8 /* Project object */; -} diff --git a/examples/Demo/Demo.xcodeproj/xcshareddata/xcschemes/Demo.xcscheme b/examples/Demo/Demo.xcodeproj/xcshareddata/xcschemes/Demo.xcscheme deleted file mode 100644 index e0fffcbd..00000000 --- a/examples/Demo/Demo.xcodeproj/xcshareddata/xcschemes/Demo.xcscheme +++ /dev/null @@ -1,91 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/examples/Demo/Demo_vc10.vcxproj b/examples/Demo/Demo_vc10.vcxproj deleted file mode 100644 index c6d213fe..00000000 --- a/examples/Demo/Demo_vc10.vcxproj +++ /dev/null @@ -1,283 +0,0 @@ - - - - - Debug - Win32 - - - Debug - x64 - - - Release - Win32 - - - Release - x64 - - - - {6F076455-D955-45D4-9C68-4AD4E45F2D47} - Demo - - - - Application - MultiByte - Windows7.1SDK - - - Application - MultiByte - Windows7.1SDK - - - Application - MultiByte - Windows7.1SDK - - - Application - MultiByte - Windows7.1SDK - - - - - - - - - - - - - - - - - - - - - - - <_ProjectFileVersion>10.0.30319.1 - ..\..\bin\Win32-VisualStudio\ - ..\..\bin\Win64-VisualStudio\ - - - ..\..\bin\Win32-VisualStudio\ - ..\..\bin\Win64-VisualStudio\ - - - AllRules.ruleset - AllRules.ruleset - - - - - AllRules.ruleset - AllRules.ruleset - - - - - - - - NDEBUG;%(PreprocessorDefinitions) - true - true - Win32 - .\Release/Demo.tlb - - - - - MaxSpeed - Default - false - ..\..\include;%(AdditionalIncludeDirectories) - WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions) - true - MultiThreaded - true - - - Level3 - - - NDEBUG;%(PreprocessorDefinitions) - 0x0c07 - - - ..\..\bin\Win64-VisualStudio\Demo.exe - ..\..\lib\Win32-visualstudio;%(AdditionalLibraryDirectories) - Windows - - - - - - - NDEBUG;%(PreprocessorDefinitions) - true - true - .\Release/Demo.tlb - - - - - MaxSpeed - Default - false - ..\..\include;%(AdditionalIncludeDirectories) - WIN32;WIN64;NDEBUG;_WINDOWS;%(PreprocessorDefinitions) - true - MultiThreaded - true - - - Level3 - - - NDEBUG;%(PreprocessorDefinitions) - 0x0c07 - - - $(OutDir)$(TargetName)$(TargetExt) - ..\..\lib\Win64-visualstudio;%(AdditionalLibraryDirectories) - Windows - - - - - - - _DEBUG;%(PreprocessorDefinitions) - true - true - Win32 - .\Debug/Demo.tlb - - - - - Disabled - ..\..\include;%(AdditionalIncludeDirectories) - WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebug - - - Level3 - EditAndContinue - - - _DEBUG;%(PreprocessorDefinitions) - 0x0c07 - - - ..\..\lib\Win32-visualstudio;%(AdditionalLibraryDirectories) - true - Windows - - - - - - - _DEBUG;%(PreprocessorDefinitions) - true - true - .\Debug/Demo.tlb - - - - - Disabled - ..\..\include;%(AdditionalIncludeDirectories) - WIN32;WIN64;_DEBUG;_WINDOWS;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebug - - - Level3 - ProgramDatabase - - - _DEBUG;%(PreprocessorDefinitions) - 0x0c07 - - - ..\..\lib\Win64-visualstudio;%(AdditionalLibraryDirectories) - true - Windows - - - - - - - Disabled - Disabled - %(AdditionalIncludeDirectories) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(PreprocessorDefinitions) - EnableFastChecks - EnableFastChecks - MaxSpeed - MaxSpeed - %(AdditionalIncludeDirectories) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(PreprocessorDefinitions) - - - Disabled - Disabled - %(AdditionalIncludeDirectories) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(PreprocessorDefinitions) - EnableFastChecks - EnableFastChecks - MaxSpeed - MaxSpeed - %(AdditionalIncludeDirectories) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(PreprocessorDefinitions) - - - Disabled - Disabled - %(AdditionalIncludeDirectories) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(PreprocessorDefinitions) - EnableFastChecks - EnableFastChecks - MaxSpeed - MaxSpeed - %(AdditionalIncludeDirectories) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(PreprocessorDefinitions) - - - - - - - - - - - - - \ No newline at end of file diff --git a/examples/Demo/Demo_vc11.vcxproj b/examples/Demo/Demo_vc11.vcxproj deleted file mode 100644 index f1db13d6..00000000 --- a/examples/Demo/Demo_vc11.vcxproj +++ /dev/null @@ -1,283 +0,0 @@ - - - - - Debug - Win32 - - - Debug - x64 - - - Release - Win32 - - - Release - x64 - - - - {6F076455-D955-45D4-9C68-4AD4E45F2D47} - Demo - - - - Application - MultiByte - Windows7.1SDK - - - Application - MultiByte - Windows7.1SDK - - - Application - MultiByte - Windows7.1SDK - - - Application - MultiByte - Windows7.1SDK - - - - - - - - - - - - - - - - - - - - - - - <_ProjectFileVersion>10.0.30319.1 - ..\..\bin\Win32-VisualStudio\ - ..\..\bin\Win64-VisualStudio\ - - - ..\..\bin\Win32-VisualStudio\ - ..\..\bin\Win64-VisualStudio\ - - - AllRules.ruleset - AllRules.ruleset - - - - - AllRules.ruleset - AllRules.ruleset - - - - - - - - NDEBUG;%(PreprocessorDefinitions) - true - true - Win32 - .\Release/Demo.tlb - - - - - MaxSpeed - Default - false - ..\..\include;%(AdditionalIncludeDirectories) - WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions) - true - MultiThreaded - true - - - Level3 - - - NDEBUG;%(PreprocessorDefinitions) - 0x0c07 - - - ..\..\bin\Win32-VisualStudio\Demo.exe - ..\..\lib\Win32-visualstudio;%(AdditionalLibraryDirectories) - Windows - - - - - - - NDEBUG;%(PreprocessorDefinitions) - true - true - .\Release/Demo.tlb - - - - - MaxSpeed - Default - false - ..\..\include;%(AdditionalIncludeDirectories) - WIN32;WIN64;NDEBUG;_WINDOWS;%(PreprocessorDefinitions) - true - MultiThreaded - true - - - Level3 - - - NDEBUG;%(PreprocessorDefinitions) - 0x0c07 - - - ..\..\bin\Win32-VisualStudio\Demo.exe - ..\..\lib\Win64-visualstudio;%(AdditionalLibraryDirectories) - Windows - - - - - - - _DEBUG;%(PreprocessorDefinitions) - true - true - Win32 - .\Debug/Demo.tlb - - - - - Disabled - ..\..\include;%(AdditionalIncludeDirectories) - WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebug - - - Level3 - EditAndContinue - - - _DEBUG;%(PreprocessorDefinitions) - 0x0c07 - - - ..\..\lib\Win32-visualstudio;%(AdditionalLibraryDirectories) - true - Windows - - - - - - - _DEBUG;%(PreprocessorDefinitions) - true - true - .\Debug/Demo.tlb - - - - - Disabled - ..\..\include;%(AdditionalIncludeDirectories) - WIN32;WIN64;_DEBUG;_WINDOWS;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebug - - - Level3 - ProgramDatabase - - - _DEBUG;%(PreprocessorDefinitions) - 0x0c07 - - - ..\..\lib\Win64-visualstudio;%(AdditionalLibraryDirectories) - true - Windows - - - - - - - Disabled - Disabled - %(AdditionalIncludeDirectories) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(PreprocessorDefinitions) - EnableFastChecks - EnableFastChecks - MaxSpeed - MaxSpeed - %(AdditionalIncludeDirectories) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(PreprocessorDefinitions) - - - Disabled - Disabled - %(AdditionalIncludeDirectories) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(PreprocessorDefinitions) - EnableFastChecks - EnableFastChecks - MaxSpeed - MaxSpeed - %(AdditionalIncludeDirectories) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(PreprocessorDefinitions) - - - Disabled - Disabled - %(AdditionalIncludeDirectories) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(PreprocessorDefinitions) - EnableFastChecks - EnableFastChecks - MaxSpeed - MaxSpeed - %(AdditionalIncludeDirectories) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(PreprocessorDefinitions) - - - - - - - - - - - - - \ No newline at end of file diff --git a/examples/Demo/Demo_vc12.vcxproj b/examples/Demo/Demo_vc12.vcxproj deleted file mode 100644 index 320adde3..00000000 --- a/examples/Demo/Demo_vc12.vcxproj +++ /dev/null @@ -1,283 +0,0 @@ - - - - - Debug - Win32 - - - Debug - x64 - - - Release - Win32 - - - Release - x64 - - - - {6F076455-D955-45D4-9C68-4AD4E45F2D47} - Demo - - - - Application - MultiByte - Windows7.1SDK - - - Application - MultiByte - Windows7.1SDK - - - Application - MultiByte - Windows7.1SDK - - - Application - MultiByte - Windows7.1SDK - - - - - - - - - - - - - - - - - - - - - - - <_ProjectFileVersion>10.0.30319.1 - ..\..\bin\Win32-VisualStudio\ - ..\..\bin\Win64-VisualStudio\ - - - ..\..\bin\Win32-VisualStudio\ - ..\..\bin\Win64-VisualStudio\ - - - AllRules.ruleset - AllRules.ruleset - - - - - AllRules.ruleset - AllRules.ruleset - - - - - - - - NDEBUG;%(PreprocessorDefinitions) - true - true - Win32 - .\Release/Demo.tlb - - - - - MaxSpeed - Default - false - ..\..\include;%(AdditionalIncludeDirectories) - WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions) - true - MultiThreaded - true - - - Level3 - - - NDEBUG;%(PreprocessorDefinitions) - 0x0c07 - - - ..\..\bin\Win32-VisualStudio\Demo.exe - ..\..\lib\Win32-visualstudio;%(AdditionalLibraryDirectories) - Windows - - - - - - - NDEBUG;%(PreprocessorDefinitions) - true - true - .\Release/Demo.tlb - - - - - MaxSpeed - Default - false - ..\..\include;%(AdditionalIncludeDirectories) - WIN32;WIN64;NDEBUG;_WINDOWS;%(PreprocessorDefinitions) - true - MultiThreaded - true - - - Level3 - - - NDEBUG;%(PreprocessorDefinitions) - 0x0c07 - - - $(OutDir)$(TargetName)$(TargetExt) - ..\..\lib\Win64-visualstudio;%(AdditionalLibraryDirectories) - Windows - - - - - - - _DEBUG;%(PreprocessorDefinitions) - true - true - Win32 - .\Debug/Demo.tlb - - - - - Disabled - ..\..\include;%(AdditionalIncludeDirectories) - WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebug - - - Level3 - EditAndContinue - - - _DEBUG;%(PreprocessorDefinitions) - 0x0c07 - - - ..\..\lib\Win32-visualstudio;%(AdditionalLibraryDirectories) - true - Windows - - - - - - - _DEBUG;%(PreprocessorDefinitions) - true - true - .\Debug/Demo.tlb - - - - - Disabled - ..\..\include;%(AdditionalIncludeDirectories) - WIN32;WIN64;_DEBUG;_WINDOWS;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebug - - - Level3 - ProgramDatabase - - - _DEBUG;%(PreprocessorDefinitions) - 0x0c07 - - - ..\..\lib\Win64-visualstudio;%(AdditionalLibraryDirectories) - true - Windows - - - - - - - Disabled - Disabled - %(AdditionalIncludeDirectories) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(PreprocessorDefinitions) - EnableFastChecks - EnableFastChecks - MaxSpeed - MaxSpeed - %(AdditionalIncludeDirectories) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(PreprocessorDefinitions) - - - Disabled - Disabled - %(AdditionalIncludeDirectories) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(PreprocessorDefinitions) - EnableFastChecks - EnableFastChecks - MaxSpeed - MaxSpeed - %(AdditionalIncludeDirectories) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(PreprocessorDefinitions) - - - Disabled - Disabled - %(AdditionalIncludeDirectories) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(PreprocessorDefinitions) - EnableFastChecks - EnableFastChecks - MaxSpeed - MaxSpeed - %(AdditionalIncludeDirectories) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(PreprocessorDefinitions) - - - - - - - - - - - - - \ No newline at end of file diff --git a/examples/Demo/Demo_vc14.vcxproj b/examples/Demo/Demo_vc14.vcxproj deleted file mode 100644 index cb85feb3..00000000 --- a/examples/Demo/Demo_vc14.vcxproj +++ /dev/null @@ -1,283 +0,0 @@ - - - - - Debug - Win32 - - - Debug - x64 - - - Release - Win32 - - - Release - x64 - - - - {6F076455-D955-45D4-9C68-4AD4E45F2D47} - Demo - - - - Application - MultiByte - v140 - - - Application - MultiByte - v140 - - - Application - MultiByte - v140 - - - Application - MultiByte - v140 - - - - - - - - - - - - - - - - - - - - - - - <_ProjectFileVersion>10.0.30319.1 - ..\..\bin\Win32-VisualStudio\ - ..\..\bin\Win64-VisualStudio\ - - - ..\..\bin\Win32-VisualStudio\ - ..\..\bin\Win64-VisualStudio\ - - - AllRules.ruleset - AllRules.ruleset - - - - - AllRules.ruleset - AllRules.ruleset - - - - - - - - NDEBUG;%(PreprocessorDefinitions) - true - true - Win32 - .\Release/Demo.tlb - - - - - MaxSpeed - Default - false - ..\..\include;%(AdditionalIncludeDirectories) - WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions) - true - MultiThreaded - true - - - Level3 - - - NDEBUG;%(PreprocessorDefinitions) - 0x0c07 - - - ..\..\bin\Win32-VisualStudio\Demo.exe - ..\..\lib\Win32-visualstudio;%(AdditionalLibraryDirectories) - Windows - - - - - - - NDEBUG;%(PreprocessorDefinitions) - true - true - .\Release/Demo.tlb - - - - - MaxSpeed - Default - false - ..\..\include;%(AdditionalIncludeDirectories) - WIN32;WIN64;NDEBUG;_WINDOWS;%(PreprocessorDefinitions) - true - MultiThreaded - true - - - Level3 - - - NDEBUG;%(PreprocessorDefinitions) - 0x0c07 - - - $(OutDir)$(TargetName)$(TargetExt) - ..\..\lib\Win64-visualstudio;%(AdditionalLibraryDirectories) - Windows - - - - - - - _DEBUG;%(PreprocessorDefinitions) - true - true - Win32 - .\Debug/Demo.tlb - - - - - Disabled - ..\..\include;%(AdditionalIncludeDirectories) - WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebug - - - Level3 - EditAndContinue - - - _DEBUG;%(PreprocessorDefinitions) - 0x0c07 - - - ..\..\lib\Win32-visualstudio;%(AdditionalLibraryDirectories) - true - Windows - - - - - - - _DEBUG;%(PreprocessorDefinitions) - true - true - .\Debug/Demo.tlb - - - - - Disabled - ..\..\include;%(AdditionalIncludeDirectories) - WIN32;WIN64;_DEBUG;_WINDOWS;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebug - - - Level3 - ProgramDatabase - - - _DEBUG;%(PreprocessorDefinitions) - 0x0c07 - - - ..\..\lib\Win64-visualstudio;%(AdditionalLibraryDirectories) - true - Windows - - - - - - - Disabled - Disabled - %(AdditionalIncludeDirectories) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(PreprocessorDefinitions) - EnableFastChecks - EnableFastChecks - MaxSpeed - MaxSpeed - %(AdditionalIncludeDirectories) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(PreprocessorDefinitions) - - - Disabled - Disabled - %(AdditionalIncludeDirectories) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(PreprocessorDefinitions) - EnableFastChecks - EnableFastChecks - MaxSpeed - MaxSpeed - %(AdditionalIncludeDirectories) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(PreprocessorDefinitions) - - - Disabled - Disabled - %(AdditionalIncludeDirectories) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(PreprocessorDefinitions) - EnableFastChecks - EnableFastChecks - MaxSpeed - MaxSpeed - %(AdditionalIncludeDirectories) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(PreprocessorDefinitions) - - - - - - - - - - - - - \ No newline at end of file diff --git a/examples/Demo/Makefile b/examples/Demo/Makefile deleted file mode 100644 index 706ce7c1..00000000 --- a/examples/Demo/Makefile +++ /dev/null @@ -1,61 +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 := Demo -# List of source files, separated by spaces -Sources := CDemo.cpp CMainMenu.cpp 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 - -# if you enable sound add the proper library for linking -#LDFLAGS += -lIrrKlang -#LDFLAGS += -laudiere -#LDFLAGS += -lSDL_mixer -lSDL - -#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 diff --git a/examples/Demo/demo.cbp b/examples/Demo/demo.cbp deleted file mode 100644 index 4c620406..00000000 --- a/examples/Demo/demo.cbp +++ /dev/null @@ -1,68 +0,0 @@ - - - - - - diff --git a/examples/Demo/icon.ico b/examples/Demo/icon.ico deleted file mode 100644 index 49f8eabb..00000000 Binary files a/examples/Demo/icon.ico and /dev/null differ diff --git a/examples/Demo/main.cpp b/examples/Demo/main.cpp deleted file mode 100644 index 4cef6e30..00000000 --- a/examples/Demo/main.cpp +++ /dev/null @@ -1,40 +0,0 @@ -// This is a Demo of the Irrlicht Engine (c) 2005-2009 by N.Gebhardt. -// This file is not documented. - -#include -#ifdef _IRR_WINDOWS_ -#include -#endif - -#include - -#include "CMainMenu.h" -#include "CDemo.h" - -using namespace irr; - -#ifdef _MSC_VER - -#pragma comment(lib, "Irrlicht.lib") -INT WINAPI WinMain( HINSTANCE hInst, HINSTANCE, LPSTR strCmdLine, INT ) -#else -int main(int argc, char* argv[]) -#endif -{ - CMainMenu menu; - - if (menu.run()) - { - CDemo demo(menu.getFullscreen(), - menu.getMusic(), - menu.getShadows(), - menu.getAdditive(), - menu.getVSync(), - menu.getAntiAliasing(), - menu.getDriverType()); - demo.run(); - } - - return 0; -} - diff --git a/examples/Demo/resource.h b/examples/Demo/resource.h deleted file mode 100644 index eb3b976e..00000000 --- a/examples/Demo/resource.h +++ /dev/null @@ -1,16 +0,0 @@ -//{{NO_DEPENDENCIES}} -// Microsoft Developer Studio generated include file. -// Used by resscript.rc -// -#define IDI_ICON1 101 - -// Next default values for new objects -// -#ifdef APSTUDIO_INVOKED -#ifndef APSTUDIO_READONLY_SYMBOLS -#define _APS_NEXT_RESOURCE_VALUE 102 -#define _APS_NEXT_COMMAND_VALUE 40001 -#define _APS_NEXT_CONTROL_VALUE 1000 -#define _APS_NEXT_SYMED_VALUE 101 -#endif -#endif diff --git a/examples/Demo/resscript.rc b/examples/Demo/resscript.rc deleted file mode 100644 index be12eb7f..00000000 --- a/examples/Demo/resscript.rc +++ /dev/null @@ -1,72 +0,0 @@ -//Microsoft Developer Studio generated resource script. -// -#include "resource.h" - -#define APSTUDIO_READONLY_SYMBOLS -///////////////////////////////////////////////////////////////////////////// -// -// Generated from the TEXTINCLUDE 2 resource. -// -#include "afxres.h" - -///////////////////////////////////////////////////////////////////////////// -#undef APSTUDIO_READONLY_SYMBOLS - -///////////////////////////////////////////////////////////////////////////// -// Deutsch (Österreich) resources - -#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_DEA) -#ifdef _WIN32 -LANGUAGE LANG_GERMAN, SUBLANG_GERMAN_AUSTRIAN -#pragma code_page(1252) -#endif //_WIN32 - -#ifdef APSTUDIO_INVOKED -///////////////////////////////////////////////////////////////////////////// -// -// TEXTINCLUDE -// - -1 TEXTINCLUDE DISCARDABLE -BEGIN - "resource.h\0" -END - -2 TEXTINCLUDE DISCARDABLE -BEGIN - "#include ""afxres.h""\r\n" - "\0" -END - -3 TEXTINCLUDE DISCARDABLE -BEGIN - "\r\n" - "\0" -END - -#endif // APSTUDIO_INVOKED - - -///////////////////////////////////////////////////////////////////////////// -// -// Icon -// - -// Icon with lowest ID value placed first to ensure application icon -// remains consistent on all systems. -IDI_ICON1 ICON DISCARDABLE "icon.ico" -#endif // Deutsch (Österreich) resources -///////////////////////////////////////////////////////////////////////////// - - - -#ifndef APSTUDIO_INVOKED -///////////////////////////////////////////////////////////////////////////// -// -// Generated from the TEXTINCLUDE 3 resource. -// - - -///////////////////////////////////////////////////////////////////////////// -#endif // not APSTUDIO_INVOKED - diff --git a/examples/buildAllExamples.sh b/examples/buildAllExamples.sh deleted file mode 100755 index e9de098a..00000000 --- a/examples/buildAllExamples.sh +++ /dev/null @@ -1,8 +0,0 @@ -#! /bin/bash -[ -z $1 ] || TARGET=$1 -[ -z $TARGET ] && TARGET=all -for i in [0123]* Demo; do - echo "Building $i"; - pushd $i && make clean $TARGET; - popd; -done diff --git a/examples/whereAreTheBinaries.txt b/examples/whereAreTheBinaries.txt deleted file mode 100644 index d9f7d6ad..00000000 --- a/examples/whereAreTheBinaries.txt +++ /dev/null @@ -1,7 +0,0 @@ -If you are searching for executeables of the examples and the demo, -you'll find some for Windows in the directory -/bin/win32-VisualStudio. - -For Linux, just go into the directory of the example you want and -execute a simple 'make' after you made the engine from source/Irrlicht. - diff --git a/include/ESceneNodeAnimatorTypes.h b/include/ESceneNodeAnimatorTypes.h deleted file mode 100644 index f771d128..00000000 --- a/include/ESceneNodeAnimatorTypes.h +++ /dev/null @@ -1,58 +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 __E_SCENE_NODE_ANIMATOR_TYPES_H_INCLUDED__ -#define __E_SCENE_NODE_ANIMATOR_TYPES_H_INCLUDED__ - -namespace irr -{ -namespace scene -{ - - //! An enumeration for all types of built-in scene node animators - enum ESCENE_NODE_ANIMATOR_TYPE - { - //! Fly circle scene node animator - ESNAT_FLY_CIRCLE = 0, - - //! Fly straight scene node animator - ESNAT_FLY_STRAIGHT, - - //! Follow spline scene node animator - ESNAT_FOLLOW_SPLINE, - - //! Rotation scene node animator - ESNAT_ROTATION, - - //! Texture scene node animator - ESNAT_TEXTURE, - - //! Deletion scene node animator - ESNAT_DELETION, - - //! Collision response scene node animator - ESNAT_COLLISION_RESPONSE, - - //! FPS camera animator - ESNAT_CAMERA_FPS, - - //! Maya camera animator - ESNAT_CAMERA_MAYA, - - //! Amount of built-in scene node animators - ESNAT_COUNT, - - //! Unknown scene node animator - ESNAT_UNKNOWN, - - //! This enum is never used, it only forces the compiler to compile this enumeration to 32 bit. - ESNAT_FORCE_32_BIT = 0x7fffffff - }; - -} // end namespace scene -} // end namespace irr - - -#endif - diff --git a/include/ESceneNodeTypes.h b/include/ESceneNodeTypes.h index 0eeab92a..2573ca08 100644 --- a/include/ESceneNodeTypes.h +++ b/include/ESceneNodeTypes.h @@ -21,42 +21,9 @@ namespace scene //! of type CSceneManager (note that ISceneManager is not(!) an ISceneNode) ESNT_SCENE_MANAGER = MAKE_IRR_ID('s','m','n','g'), - //! simple cube scene node - ESNT_CUBE = MAKE_IRR_ID('c','u','b','e'), - - //! Sphere scene node - ESNT_SPHERE = MAKE_IRR_ID('s','p','h','r'), - - //! Text Scene Node - ESNT_TEXT = MAKE_IRR_ID('t','e','x','t'), - - //! Billboard text scene node - ESNT_BILLBOARD_TEXT = MAKE_IRR_ID('b','t','x','t'), - - //! Water Surface Scene Node - ESNT_WATER_SURFACE = MAKE_IRR_ID('w','a','t','r'), - - //! Terrain Scene Node - ESNT_TERRAIN = MAKE_IRR_ID('t','e','r','r'), - - //! Sky Box Scene Node - ESNT_SKY_BOX = MAKE_IRR_ID('s','k','y','_'), - - //! Sky Dome Scene Node - ESNT_SKY_DOME = MAKE_IRR_ID('s','k','y','d'), - - //! Shadow Volume Scene Node - ESNT_SHADOW_VOLUME = MAKE_IRR_ID('s','h','d','w'), - - //! Octree Scene Node - ESNT_OCTREE = MAKE_IRR_ID('o','c','t','r'), - //! Mesh Scene Node ESNT_MESH = MAKE_IRR_ID('m','e','s','h'), - //! Light Scene Node - ESNT_LIGHT = MAKE_IRR_ID('l','g','h','t'), - //! Empty Scene Node ESNT_EMPTY = MAKE_IRR_ID('e','m','t','y'), @@ -72,26 +39,6 @@ namespace scene //! Animated Mesh Scene Node ESNT_ANIMATED_MESH = MAKE_IRR_ID('a','m','s','h'), - //! Particle System Scene Node - ESNT_PARTICLE_SYSTEM = MAKE_IRR_ID('p','t','c','l'), - - //! Quake3 Shader Scene Node - ESNT_Q3SHADER_SCENE_NODE = MAKE_IRR_ID('q','3','s','h'), - - //! Quake3 Model Scene Node ( has tag to link to ) - ESNT_MD3_SCENE_NODE = MAKE_IRR_ID('m','d','3','_'), - - //! Volume Light Scene Node - ESNT_VOLUME_LIGHT = MAKE_IRR_ID('v','o','l','l'), - - //! Maya Camera Scene Node - /** Legacy, for loading version <= 1.4.x .irr files */ - ESNT_CAMERA_MAYA = MAKE_IRR_ID('c','a','m','M'), - - //! First Person Shooter Camera - /** Legacy, for loading version <= 1.4.x .irr files */ - ESNT_CAMERA_FPS = MAKE_IRR_ID('c','a','m','F'), - //! Unknown scene node ESNT_UNKNOWN = MAKE_IRR_ID('u','n','k','n'), diff --git a/include/IAnimatedMeshMD2.h b/include/IAnimatedMeshMD2.h deleted file mode 100644 index 6830f37e..00000000 --- a/include/IAnimatedMeshMD2.h +++ /dev/null @@ -1,79 +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_ANIMATED_MESH_MD2_H_INCLUDED__ -#define __I_ANIMATED_MESH_MD2_H_INCLUDED__ - -#include "IAnimatedMesh.h" - -namespace irr -{ -namespace scene -{ - - //! Types of standard md2 animations - enum EMD2_ANIMATION_TYPE - { - EMAT_STAND = 0, - EMAT_RUN, - EMAT_ATTACK, - EMAT_PAIN_A, - EMAT_PAIN_B, - EMAT_PAIN_C, - EMAT_JUMP, - EMAT_FLIP, - EMAT_SALUTE, - EMAT_FALLBACK, - EMAT_WAVE, - EMAT_POINT, - EMAT_CROUCH_STAND, - EMAT_CROUCH_WALK, - EMAT_CROUCH_ATTACK, - EMAT_CROUCH_PAIN, - EMAT_CROUCH_DEATH, - EMAT_DEATH_FALLBACK, - EMAT_DEATH_FALLFORWARD, - EMAT_DEATH_FALLBACKSLOW, - EMAT_BOOM, - - //! Not an animation, but amount of animation types. - EMAT_COUNT - }; - - //! Interface for using some special functions of MD2 meshes - class IAnimatedMeshMD2 : public IAnimatedMesh - { - public: - - //! Get frame loop data for a default MD2 animation type. - /** \param l The EMD2_ANIMATION_TYPE to get the frames for. - \param outBegin The returned beginning frame for animation type specified. - \param outEnd The returned ending frame for the animation type specified. - \param outFPS The number of frames per second, this animation should be played at. - \return beginframe, endframe and frames per second for a default MD2 animation type. */ - virtual void getFrameLoop(EMD2_ANIMATION_TYPE l, s32& outBegin, - s32& outEnd, s32& outFPS) const = 0; - - //! Get frame loop data for a special MD2 animation type, identified by name. - /** \param name Name of the animation. - \param outBegin The returned beginning frame for animation type specified. - \param outEnd The returned ending frame for the animation type specified. - \param outFPS The number of frames per second, this animation should be played at. - \return beginframe, endframe and frames per second for a special MD2 animation type. */ - virtual bool getFrameLoop(const c8* name, - s32& outBegin, s32& outEnd, s32& outFPS) const = 0; - - //! Get amount of md2 animations in this file. - virtual s32 getAnimationCount() const = 0; - - //! Get name of md2 animation. - /** \param nr: Zero based index of animation. */ - virtual const c8* getAnimationName(s32 nr) const = 0; - }; - -} // end namespace scene -} // end namespace irr - -#endif - diff --git a/include/IAnimatedMeshMD3.h b/include/IAnimatedMeshMD3.h deleted file mode 100644 index cdd416e5..00000000 --- a/include/IAnimatedMeshMD3.h +++ /dev/null @@ -1,278 +0,0 @@ -// Copyright (C) 2007-2012 Nikolaus Gebhardt / Thomas Alten -// This file is part of the "Irrlicht Engine". -// For conditions of distribution and use, see copyright notice in irrlicht.h - -#ifndef __I_ANIMATED_MESH_MD3_H_INCLUDED__ -#define __I_ANIMATED_MESH_MD3_H_INCLUDED__ - -#include "IAnimatedMesh.h" -#include "IQ3Shader.h" -#include "quaternion.h" - -namespace irr -{ -namespace scene -{ - - enum eMD3Models - { - EMD3_HEAD = 0, - EMD3_UPPER, - EMD3_LOWER, - EMD3_WEAPON, - EMD3_NUMMODELS - }; - - //! Animation list - enum EMD3_ANIMATION_TYPE - { - // Animations for both lower and upper parts of the player - EMD3_BOTH_DEATH_1 = 0, - EMD3_BOTH_DEAD_1, - EMD3_BOTH_DEATH_2, - EMD3_BOTH_DEAD_2, - EMD3_BOTH_DEATH_3, - EMD3_BOTH_DEAD_3, - - // Animations for the upper part - EMD3_TORSO_GESTURE, - EMD3_TORSO_ATTACK_1, - EMD3_TORSO_ATTACK_2, - EMD3_TORSO_DROP, - EMD3_TORSO_RAISE, - EMD3_TORSO_STAND_1, - EMD3_TORSO_STAND_2, - - // Animations for the lower part - EMD3_LEGS_WALK_CROUCH, - EMD3_LEGS_WALK, - EMD3_LEGS_RUN, - EMD3_LEGS_BACK, - EMD3_LEGS_SWIM, - EMD3_LEGS_JUMP_1, - EMD3_LEGS_LAND_1, - EMD3_LEGS_JUMP_2, - EMD3_LEGS_LAND_2, - EMD3_LEGS_IDLE, - EMD3_LEGS_IDLE_CROUCH, - EMD3_LEGS_TURN, - - //! Not an animation, but amount of animation types. - EMD3_ANIMATION_COUNT - }; - - struct SMD3AnimationInfo - { - //! First frame - s32 first; - //! Last frame - s32 num; - //! Looping frames - s32 looping; - //! Frames per second - s32 fps; - }; - - -// byte-align structures -#include "irrpack.h" - - //! this holds the header info of the MD3 file - struct SMD3Header - { - c8 headerID[4]; //id of file, always "IDP3" - s32 Version; //this is a version number, always 15 - s8 fileName[68];//sometimes left Blank... 65 chars, 32bit aligned == 68 chars - s32 numFrames; //number of KeyFrames - s32 numTags; //number of 'tags' per frame - s32 numMeshes; //number of meshes/skins - s32 numMaxSkins;//maximum number of unique skins used in md3 file. artefact md2 - s32 frameStart; //starting position of frame-structur - s32 tagStart; //starting position of tag-structures - s32 tagEnd; //ending position of tag-structures/starting position of mesh-structures - s32 fileSize; - } PACK_STRUCT; - - //! this holds the header info of an MD3 mesh section - struct SMD3MeshHeader - { - c8 meshID[4]; //id, must be IDP3 - c8 meshName[68]; //name of mesh 65 chars, 32 bit aligned == 68 chars - - s32 numFrames; //number of meshframes in mesh - s32 numShader; //number of skins in mesh - s32 numVertices; //number of vertices - s32 numTriangles; //number of Triangles - - s32 offset_triangles; //starting position of Triangle data, relative to start of Mesh_Header - s32 offset_shaders; //size of header - s32 offset_st; //starting position of texvector data, relative to start of Mesh_Header - s32 vertexStart; //starting position of vertex data,relative to start of Mesh_Header - s32 offset_end; - } PACK_STRUCT; - - - //! Compressed Vertex Data - struct SMD3Vertex - { - s16 position[3]; - u8 normal[2]; - } PACK_STRUCT; - - //! Texture Coordinate - struct SMD3TexCoord - { - f32 u; - f32 v; - } PACK_STRUCT; - - //! Triangle Index - struct SMD3Face - { - s32 Index[3]; - } PACK_STRUCT; - - -// Default alignment -#include "irrunpack.h" - - //! Holding Frame Data for a Mesh - struct SMD3MeshBuffer : public IReferenceCounted - { - SMD3MeshHeader MeshHeader; - - core::stringc Shader; - core::array < s32 > Indices; - core::array < SMD3Vertex > Vertices; - core::array < SMD3TexCoord > Tex; - }; - - //! hold a tag info for connecting meshes - /** Basically its an alternate way to describe a transformation. */ - struct SMD3QuaternionTag - { - virtual ~SMD3QuaternionTag() - { - position.X = 0.f; - } - - // construct for searching - SMD3QuaternionTag( const core::stringc& name ) - : Name ( name ) {} - - // construct from a position and euler angles in degrees - SMD3QuaternionTag ( const core::vector3df &pos, const core::vector3df &angle ) - : position(pos), rotation(angle * core::DEGTORAD) {} - - // set to matrix - void setto ( core::matrix4 &m ) - { - rotation.getMatrix ( m, position ); - } - - bool operator == ( const SMD3QuaternionTag &other ) const - { - return Name == other.Name; - } - - core::stringc Name; - core::vector3df position; - core::quaternion rotation; - }; - - //! holds a associative list of named quaternions - struct SMD3QuaternionTagList - { - SMD3QuaternionTagList() - { - Container.setAllocStrategy(core::ALLOC_STRATEGY_SAFE); - } - - virtual ~SMD3QuaternionTagList() {} - - SMD3QuaternionTag* get(const core::stringc& name) - { - SMD3QuaternionTag search ( name ); - s32 index = Container.linear_search ( search ); - if ( index >= 0 ) - return &Container[index]; - return 0; - } - - u32 size () const - { - return Container.size(); - } - - void set_used(u32 new_size) - { - s32 diff = (s32) new_size - (s32) Container.allocated_size(); - if ( diff > 0 ) - { - SMD3QuaternionTag e(""); - for ( s32 i = 0; i < diff; ++i ) - Container.push_back(e); - } - } - - const SMD3QuaternionTag& operator[](u32 index) const - { - return Container[index]; - } - - SMD3QuaternionTag& operator[](u32 index) - { - return Container[index]; - } - - void push_back(const SMD3QuaternionTag& other) - { - Container.push_back(other); - } - - private: - core::array < SMD3QuaternionTag > Container; - }; - - - //! Holding Frames Buffers and Tag Infos - struct SMD3Mesh: public IReferenceCounted - { - SMD3Mesh () - { - MD3Header.numFrames = 0; - } - - virtual ~SMD3Mesh() - { - for (u32 i=0; idrop(); - } - - core::stringc Name; - core::array Buffer; - SMD3QuaternionTagList TagList; - SMD3Header MD3Header; - }; - - - //! Interface for using some special functions of MD3 meshes - class IAnimatedMeshMD3 : public IAnimatedMesh - { - public: - - //! tune how many frames you want to render in between. - virtual void setInterpolationShift(u32 shift, u32 loopMode) =0; - - //! get the tag list of the mesh. - virtual SMD3QuaternionTagList* getTagList(s32 frame, s32 detailLevel, s32 startFrameLoop, s32 endFrameLoop) =0; - - //! get the original md3 mesh. - virtual SMD3Mesh* getOriginalMesh() =0; - }; - -} // end namespace scene -} // end namespace irr - -#endif - diff --git a/include/IAnimatedMeshSceneNode.h b/include/IAnimatedMeshSceneNode.h index 5a399039..ef16dd80 100644 --- a/include/IAnimatedMeshSceneNode.h +++ b/include/IAnimatedMeshSceneNode.h @@ -7,15 +7,12 @@ #include "ISceneNode.h" #include "IBoneSceneNode.h" -#include "IAnimatedMeshMD2.h" -#include "IAnimatedMeshMD3.h" +#include "IAnimatedMesh.h" namespace irr { namespace scene { - class IShadowVolumeSceneNode; - enum E_JOINT_UPDATE_ON_RENDER { //! do nothing @@ -88,31 +85,6 @@ namespace scene /** \return Frames per second played. */ virtual f32 getAnimationSpeed() const =0; - /** The shadow can be rendered using the ZPass or the zfail - method. ZPass is a little bit faster because the shadow volume - creation is easier, but with this method there occur ugly - looking artifacts when the camera is inside the shadow volume. - These error do not occur with the ZFail method, but it can - have trouble with clipping to the far-plane (it usually works - well in OpenGL and fails with other drivers). - \param shadowMesh: Optional custom mesh for shadow volume. - \param id: Id of the shadow scene node. This id can be used to - identify the node later. - \param zfailmethod: If set to true, the shadow will use the - zfail method, if not, zpass is used. - \param infinity: Value used by the shadow volume algorithm to - scale the shadow volume. For zfail shadow volumes on some drivers - only suppport finite shadows, so camera zfar must be larger than - shadow back cap,which is depending on the infinity parameter). - Infinity value also scales by the scaling factors of the model. - If shadows don't show up with zfail then try reducing infinity. - If shadows are cut-off then try increasing infinity. - \return Pointer to the created shadow scene node. This pointer - should not be dropped. See IReferenceCounted::drop() for more - information. */ - virtual IShadowVolumeSceneNode* addShadowVolumeSceneNode(const IMesh* shadowMesh=0, - s32 id=-1, bool zfailmethod=true, f32 infinity=1000.0f) = 0; - //! Get a pointer to a joint in the mesh (if the mesh is a bone based mesh). /** With this method it is possible to attach scene nodes to joints for example possible to attach a weapon to the left hand @@ -137,31 +109,6 @@ namespace scene /** \return Amount of joints in the mesh. */ virtual u32 getJointCount() const = 0; - //! Starts a default MD2 animation. - /** With this method it is easily possible to start a Run, - Attack, Die or whatever animation, if the mesh contained in - this scene node is an md2 mesh. Otherwise, nothing happens. - \param anim: An MD2 animation type, which should be played, for - example EMAT_STAND for the standing animation. - \return True if successful, and false if not, for example if - the mesh in the scene node is not a md2 mesh. */ - virtual bool setMD2Animation(EMD2_ANIMATION_TYPE anim) = 0; - - //! Starts a special MD2 animation. - /** With this method it is easily possible to start a Run, - Attack, Die or whatever animation, if the mesh contained in - this scene node is an md2 mesh. Otherwise, nothing happens. - This method uses a character string to identify the animation. - If the animation is a standard md2 animation, you might want to - start this animation with the EMD2_ANIMATION_TYPE enumeration - instead. - \param animationName: Name of the animation which should be - played. - \return Returns true if successful, and false if not, for - example if the mesh in the scene node is not an md2 mesh, or no - animation with this name could be found. */ - virtual bool setMD2Animation(const c8* animationName) = 0; - //! Returns the currently displayed frame number. virtual f32 getFrameNr() const = 0; //! Returns the current start frame number. @@ -198,9 +145,6 @@ namespace scene //! Returns the current mesh virtual IAnimatedMesh* getMesh(void) = 0; - //! Get the absolute transformation for a special MD3 Tag if the mesh is a md3 mesh, or the absolutetransformation if it's a normal scenenode - virtual const SMD3QuaternionTag* getMD3TagTransformation( const core::stringc & tagname) = 0; - //! Set how the joints should be updated on render virtual void setJointMode(E_JOINT_UPDATE_ON_RENDER mode)=0; diff --git a/include/IBillboardTextSceneNode.h b/include/IBillboardTextSceneNode.h deleted file mode 100644 index 0526b63f..00000000 --- a/include/IBillboardTextSceneNode.h +++ /dev/null @@ -1,78 +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_BILLBOARD_TEXT_SCENE_NODE_H_INCLUDED__ -#define __I_BILLBOARD_TEXT_SCENE_NODE_H_INCLUDED__ - -#include "IBillboardSceneNode.h" - -namespace irr -{ - -namespace gui -{ - class IGUIFont; -} - -namespace scene -{ - -//! A billboard text scene node. -/** Acts like a billboard which displays the currently set text. - Due to the exclusion of RTTI in Irrlicht we have to avoid multiple - inheritance. Hence, changes to the ITextSceneNode interface have - to be copied here manually. -*/ -class IBillboardTextSceneNode : public IBillboardSceneNode -{ -public: - - //! Constructor - IBillboardTextSceneNode(ISceneNode* parent, ISceneManager* mgr, s32 id, - const core::vector3df& position = core::vector3df(0,0,0)) - : IBillboardSceneNode(parent, mgr, id, position) {} - - //! Sets the size of the billboard. - virtual void setSize(const core::dimension2d& size) = 0; - - //! Returns the size of the billboard. - virtual const core::dimension2d& getSize() const = 0; - - //! Set the color of all vertices of the billboard - /** \param overallColor: the color to set */ - virtual void setColor(const video::SColor & overallColor) = 0; - - //! Set the color of the top and bottom vertices of the billboard - /** \param topColor: the color to set the top vertices - \param bottomColor: the color to set the bottom vertices */ - virtual void setColor(const video::SColor & topColor, const video::SColor & bottomColor) = 0; - - //! Gets the color of the top and bottom vertices of the billboard - /** \param topColor: stores the color of the top vertices - \param bottomColor: stores the color of the bottom vertices */ - virtual void getColor(video::SColor & topColor, video::SColor & bottomColor) const = 0; - - //! sets the text string - virtual void setText(const wchar_t* text) = 0; - - //! get the text string - virtual const wchar_t* getText() const = 0; - - //! sets the color of the text - //! You can use setColor instead which does the same - virtual void setTextColor(video::SColor color) - { - setColor(color); - } - - //! Get the font used to draw the text - virtual gui::IGUIFont* getFont() const = 0; -}; - -} // end namespace scene -} // end namespace irr - - -#endif - diff --git a/include/IGeometryCreator.h b/include/IGeometryCreator.h deleted file mode 100644 index 6083f5b4..00000000 --- a/include/IGeometryCreator.h +++ /dev/null @@ -1,209 +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_GEOMETRY_CREATOR_H_INCLUDED__ -#define __I_GEOMETRY_CREATOR_H_INCLUDED__ - -#include "IReferenceCounted.h" -#include "IMesh.h" -#include "IImage.h" - -namespace irr -{ -namespace video -{ - class IVideoDriver; - class SMaterial; -} - -namespace scene -{ - - enum ECUBE_MESH_TYPE - { - //! Single buffer with 12 different vertices, normals are average of adjacent planes - //! Order for outgoing (front-face) normals of planes would be: NEG_Z, POS_X, POS_Z, NEG_X, POS_Y, NEG_Y - ECMT_1BUF_12VTX_NA, - - //! One buffer per side, each with 4 vertices, normals are perpendicular to sides - //! Note: You probably will have to scale down your texture uv's to avoid white lines at borders - // as this mesh sets them to 0,1 values. We can't do that when creating the mesh as it - // depends on texture resolution which we don't know at that point. - ECMT_6BUF_4VTX_NP - }; - -//! Helper class for creating geometry on the fly. -/** You can get an instance of this class through ISceneManager::getGeometryCreator() */ -class IGeometryCreator : public IReferenceCounted -{ -public: - - //! Creates a simple cube mesh. - /** - \param size Dimensions of the cube. - \param type One of ECUBE_MESH_TYPE. So you can chose between cubes with single material or independent materials per side. - \return Generated mesh. - */ - virtual IMesh* createCubeMesh(const core::vector3df& size=core::vector3df(5.f,5.f,5.f), ECUBE_MESH_TYPE type = ECMT_1BUF_12VTX_NA) const =0; - - //! Create a pseudo-random mesh representing a hilly terrain. - /** - \param tileSize The size of each tile. - \param tileCount The number of tiles in each dimension. - \param material The material to apply to the mesh. - \param hillHeight The maximum height of the hills. - \param countHills The number of hills along each dimension. - \param textureRepeatCount The number of times to repeat the material texture along each dimension. - \return Generated mesh. - */ - virtual IMesh* createHillPlaneMesh( - const core::dimension2d& tileSize, - const core::dimension2d& tileCount, - video::SMaterial* material, f32 hillHeight, - const core::dimension2d& countHills, - const core::dimension2d& textureRepeatCount) const =0; - - //! Create a simple rectangular textured plane mesh. - /** - \param tileSize The size of each tile. - \param tileCount The number of tiles in each dimension. - \param material The material to apply to the mesh. - \param textureRepeatCount The number of times to repeat the material texture along each dimension. - \return Generated mesh. - */ - IMesh* createPlaneMesh( - const core::dimension2d& tileSize, - const core::dimension2d& tileCount=core::dimension2du(1,1), - video::SMaterial* material=0, - const core::dimension2df& textureRepeatCount=core::dimension2df(1.f,1.f)) const - { - return createHillPlaneMesh(tileSize, tileCount, material, 0.f, core::dimension2df(), textureRepeatCount); - } - - //! Create a geoplane. - /** - \param radius Radius of the plane - \param rows How many rows to place - \param columns How many columns to place - \return Generated mesh. - */ - virtual IMesh* createGeoplaneMesh(f32 radius = 5.f, - u32 rows = 16, u32 columns = 16) const =0; - - //! Create a terrain mesh from an image representing a heightfield. - /** - \param texture The texture to apply to the terrain. - \param heightmap An image that will be interpreted as a heightmap. The - brightness (average color) of each pixel is interpreted as a height, - with a 255 brightness pixel producing the maximum height. - \param stretchSize The size that each pixel will produce, i.e. a - 512x512 heightmap - and a stretchSize of (10.f, 20.f) will produce a mesh of size - 5120.f x 10240.f - \param maxHeight The maximum height of the terrain. - \param driver The current video driver. - \param defaultVertexBlockSize (to be documented) - \param debugBorders (to be documented) - \return Generated mesh. - */ - virtual IMesh* createTerrainMesh(video::IImage* texture, - video::IImage* heightmap, - const core::dimension2d& stretchSize, - f32 maxHeight, video::IVideoDriver* driver, - const core::dimension2d& defaultVertexBlockSize, - bool debugBorders=false) const =0; - - //! Create an arrow mesh, composed of a cylinder and a cone. - /** - \param tesselationCylinder Number of quads composing the cylinder. - \param tesselationCone Number of triangles composing the cone's roof. - \param height Total height of the arrow - \param cylinderHeight Total height of the cylinder, should be lesser - than total height - \param widthCylinder Diameter of the cylinder - \param widthCone Diameter of the cone's base, should be not smaller - than the cylinder's diameter - \param colorCylinder color of the cylinder - \param colorCone color of the cone - \return Generated mesh. - */ - virtual IMesh* createArrowMesh(const u32 tesselationCylinder = 4, - const u32 tesselationCone = 8, const f32 height = 1.f, - const f32 cylinderHeight = 0.6f, const f32 widthCylinder = 0.05f, - const f32 widthCone = 0.3f, const video::SColor colorCylinder = 0xFFFFFFFF, - const video::SColor colorCone = 0xFFFFFFFF) const =0; - - - //! Create a sphere mesh. - /** - \param radius Radius of the sphere - \param polyCountX Number of quads used for the horizontal tiling - \param polyCountY Number of quads used for the vertical tiling - \return Generated mesh. - */ - virtual IMesh* createSphereMesh(f32 radius = 5.f, - u32 polyCountX = 16, u32 polyCountY = 16) const =0; - - //! Create a cylinder mesh. - /** - \param radius Radius of the cylinder. - \param length Length of the cylinder. - \param tesselation Number of quads around the circumference of the cylinder. - \param color The color of the cylinder. - \param closeTop If true, close the ends of the cylinder, otherwise leave them open. - \param oblique X-offset (shear) of top compared to bottom. - \param normalType When 0 side normals are radial from origin. Note that origin is at the bottom. - When 1 side normals are flat along top/bottom polygons. - NOTE: To get normals which are perpendicular to the side of an oblique - cylinder, don't use the oblique parameter. Instead set normalType to 1 - and create a cylinder with oblique set to 0. Then use - IMeshManipulator::transform with a shear matrix on the returned mesh. - You get a shear matrix for an identical effect of this oblique parameter when you - set the 4th element of an identity matrix to (oblique/length). - \return Generated mesh. - */ - virtual IMesh* createCylinderMesh(f32 radius, f32 length, - u32 tesselation, - const video::SColor& color=video::SColor(0xffffffff), - bool closeTop=true, f32 oblique=0.f, u32 normalType=0) const =0; - - //! Create a cone mesh. - /** - \param radius Radius of the cone. - \param length Length of the cone. - \param tesselation Number of quads around the circumference of the cone. - \param colorTop The color of the top of the cone. - \param colorBottom The color of the bottom of the cone. - \param oblique (to be documented) - \return Generated mesh. - */ - virtual IMesh* createConeMesh(f32 radius, f32 length, u32 tesselation, - const video::SColor& colorTop=video::SColor(0xffffffff), - const video::SColor& colorBottom=video::SColor(0xffffffff), - f32 oblique=0.f) const =0; - - //! Create a volume light mesh. - /** - \param subdivideU Horizontal patch count. - \param subdivideV Vertical patch count. - \param footColor Color at the bottom of the light. - \param tailColor Color at the mid of the light. - \param lpDistance Virtual distance of the light point for normals. - \param lightDim Dimensions of the light. - \return Generated mesh. - */ - virtual IMesh* createVolumeLightMesh( - const u32 subdivideU=32, const u32 subdivideV=32, - const video::SColor footColor = 0xffffffff, - const video::SColor tailColor = 0xffffffff, - const f32 lpDistance = 8.f, - const core::vector3df& lightDim = core::vector3df(1.f,1.2f,1.f)) const =0; -}; - - -} // end namespace scene -} // end namespace irr - -#endif // __I_GEOMETRY_CREATOR_H_INCLUDED__ - diff --git a/include/ILightManager.h b/include/ILightManager.h deleted file mode 100644 index ff667983..00000000 --- a/include/ILightManager.h +++ /dev/null @@ -1,62 +0,0 @@ -// Written by Colin MacDonald - all rights assigned to Nikolaus Gebhardt -// Copyright (C) 2008-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_LIGHT_MANAGER_H_INCLUDED__ -#define __I_LIGHT_MANAGER_H_INCLUDED__ - -#include "IReferenceCounted.h" -#include "irrArray.h" - -namespace irr -{ -namespace scene -{ - class ILightSceneNode; - - //! ILightManager provides an interface for user applications to manipulate the list of lights in the scene. - /** The light list can be trimmed or re-ordered before device/ hardware - lights are created, and/or individual lights can be switched on and off - before or after each scene node is rendered. It is assumed that the - ILightManager implementation will store any data that it wishes to - retain, i.e. the ISceneManager to which it is assigned, the lightList, - the current render pass, and the current scene node. */ - class ILightManager : public IReferenceCounted - { - public: - //! Called after the scene's light list has been built, but before rendering has begun. - /** As actual device/hardware lights are not created until the - ESNRP_LIGHT render pass, this provides an opportunity for the - light manager to trim or re-order the light list, before any - device/hardware lights have actually been created. - \param lightList: the Scene Manager's light list, which - the light manager may modify. This reference will remain valid - until OnPostRender(). - */ - virtual void OnPreRender(core::array & lightList) = 0; - - //! Called after the last scene node is rendered. - /** After this call returns, the lightList passed to OnPreRender() becomes invalid. */ - virtual void OnPostRender(void) = 0; - - //! Called before a render pass begins - /** \param renderPass: the render pass that's about to begin */ - virtual void OnRenderPassPreRender(E_SCENE_NODE_RENDER_PASS renderPass) = 0; - - //! Called after the render pass specified in OnRenderPassPreRender() ends - /** \param[in] renderPass: the render pass that has finished */ - virtual void OnRenderPassPostRender(E_SCENE_NODE_RENDER_PASS renderPass) = 0; - - //! Called before the given scene node is rendered - /** \param[in] node: the scene node that's about to be rendered */ - virtual void OnNodePreRender(ISceneNode* node) = 0; - - //! Called after the the node specified in OnNodePreRender() has been rendered - /** \param[in] node: the scene node that has just been rendered */ - virtual void OnNodePostRender(ISceneNode* node) = 0; - }; -} // end namespace scene -} // end namespace irr - -#endif diff --git a/include/ILightSceneNode.h b/include/ILightSceneNode.h deleted file mode 100644 index 62533a0d..00000000 --- a/include/ILightSceneNode.h +++ /dev/null @@ -1,87 +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_LIGHT_SCENE_NODE_H_INCLUDED__ -#define __I_LIGHT_SCENE_NODE_H_INCLUDED__ - -#include "ISceneNode.h" -#include "SLight.h" - -namespace irr -{ -namespace scene -{ - -//! Scene node which is a dynamic light. -/** You can switch the light on and off by making it visible or not. It can be -animated by ordinary scene node animators. If the light type is directional or -spot, the direction of the light source is defined by the rotation of the scene -node (assuming (0,0,1) as the local direction of the light). -*/ -class ILightSceneNode : public ISceneNode -{ -public: - - //! constructor - ILightSceneNode(ISceneNode* parent, ISceneManager* mgr, s32 id, - const core::vector3df& position = core::vector3df(0,0,0)) - : ISceneNode(parent, mgr, id, position) {} - - //! Sets the light data associated with this ILightSceneNode - /** \param light The new light data. */ - virtual void setLightData(const video::SLight& light) = 0; - - //! Gets the light data associated with this ILightSceneNode - /** \return The light data. */ - virtual const video::SLight& getLightData() const = 0; - - //! Gets the light data associated with this ILightSceneNode - /** \return The light data. */ - virtual video::SLight& getLightData() = 0; - - //! Sets if the node should be visible or not. - /** All children of this node won't be visible either, when set - to true. - \param isVisible If the node shall be visible. */ - virtual void setVisible(bool isVisible) = 0; - - //! Sets the light's radius of influence. - /** Outside this radius the light won't lighten geometry and cast no - shadows. Setting the radius will also influence the attenuation, setting - it to (0,1/radius,0). If you want to override this behavior, set the - attenuation after the radius. - NOTE: On OpenGL only the attenuation is set, there's no hard range. - \param radius The new radius. */ - virtual void setRadius(f32 radius) = 0; - - //! Gets the light's radius of influence. - /** \return The current radius. */ - virtual f32 getRadius() const = 0; - - //! Sets the light type. - /** \param type The new type. */ - virtual void setLightType(video::E_LIGHT_TYPE type) = 0; - - //! Gets the light type. - /** \return The current light type. */ - virtual video::E_LIGHT_TYPE getLightType() const = 0; - - //! Sets whether this light casts shadows. - /** Enabling this flag won't automatically cast shadows, the meshes - will still need shadow scene nodes attached. But one can enable or - disable distinct lights for shadow casting for performance reasons. - \param shadow True if this light shall cast shadows. */ - virtual void enableCastShadow(bool shadow=true) = 0; - - //! Check whether this light casts shadows. - /** \return True if light would cast shadows, else false. */ - virtual bool getCastShadow() const = 0; -}; - -} // end namespace scene -} // end namespace irr - - -#endif - diff --git a/include/IMeshLoader.h b/include/IMeshLoader.h index f81f3307..91b07b94 100644 --- a/include/IMeshLoader.h +++ b/include/IMeshLoader.h @@ -7,7 +7,6 @@ #include "IReferenceCounted.h" #include "path.h" -#include "IMeshTextureLoader.h" namespace irr { @@ -29,14 +28,10 @@ class IMeshLoader : public virtual IReferenceCounted public: //! Constructor - IMeshLoader() : TextureLoader(0) {} + IMeshLoader() {} //! Destructor - virtual ~IMeshLoader() - { - if ( TextureLoader ) - TextureLoader->drop(); - } + virtual ~IMeshLoader() {} //! Returns true if the file might be loaded by this class. /** This decision should be based on the file extension (e.g. ".cob") @@ -51,35 +46,6 @@ public: If you no longer need the mesh, you should call IAnimatedMesh::drop(). See IReferenceCounted::drop() for more information. */ virtual IAnimatedMesh* createMesh(io::IReadFile* file) = 0; - - //! Set a new texture loader which this meshloader can use when searching for textures. - /** NOTE: Not all meshloaders do support this interface. Meshloaders which - support it will return a non-null value in getMeshTextureLoader from the start. Setting a - texture-loader to a meshloader which doesn't support it won't help. - \param textureLoader The textureloader to use. When set to NULL the mesh will not load any textures. - */ - virtual void setMeshTextureLoader(IMeshTextureLoader* textureLoader) - { - if ( textureLoader != TextureLoader ) - { - if ( textureLoader ) - textureLoader->grab(); - if ( TextureLoader ) - TextureLoader->drop(); - TextureLoader = textureLoader; - } - } - - //! Get the texture loader used when this meshloader searches for textures. - /** NOTE: not all meshloaders support this interface so this can return NULL. - */ - virtual IMeshTextureLoader* getMeshTextureLoader() const - { - return TextureLoader; - } - -protected: - IMeshTextureLoader* TextureLoader; }; diff --git a/include/IMeshSceneNode.h b/include/IMeshSceneNode.h index 03c5c522..d4f6fff3 100644 --- a/include/IMeshSceneNode.h +++ b/include/IMeshSceneNode.h @@ -12,7 +12,6 @@ namespace irr namespace scene { -class IShadowVolumeSceneNode; class IMesh; @@ -38,31 +37,6 @@ public: /** \return Pointer to mesh which is displayed by this node. */ virtual IMesh* getMesh(void) = 0; - /** The shadow can be rendered using the ZPass or the zfail - method. ZPass is a little bit faster because the shadow volume - creation is easier, but with this method there occur ugly - looking artifacts when the camera is inside the shadow volume. - These error do not occur with the ZFail method, but it can - have trouble with clipping to the far-plane (it usually works - well in OpenGL and fails with other drivers). - \param shadowMesh: Optional custom mesh for shadow volume. - \param id: Id of the shadow scene node. This id can be used to - identify the node later. - \param zfailmethod: If set to true, the shadow will use the - zfail method, if not, zpass is used. - \param infinity: Value used by the shadow volume algorithm to - scale the shadow volume. For zfail shadow volumes on some drivers - only suppport finite shadows, so camera zfar must be larger than - shadow back cap,which is depending on the infinity parameter). - Infinity value also scales by the scaling factors of the model. - If shadows don't show up with zfail then try reducing infinity. - If shadows are cut-off then try increasing infinity. - \return Pointer to the created shadow scene node. This pointer - should not be dropped. See IReferenceCounted::drop() for more - information. */ - virtual IShadowVolumeSceneNode* addShadowVolumeSceneNode(const IMesh* shadowMesh=0, - s32 id=-1, bool zfailmethod=true, f32 infinity=1000.0f) = 0; - //! Sets if the scene node should not copy the materials of the mesh but use them in a read only style. /** In this way it is possible to change the materials of a mesh causing all mesh scene nodes referencing this mesh to change, too. diff --git a/include/IMeshTextureLoader.h b/include/IMeshTextureLoader.h deleted file mode 100644 index 92df7b0d..00000000 --- a/include/IMeshTextureLoader.h +++ /dev/null @@ -1,65 +0,0 @@ -// This file is part of the "Irrlicht Engine". -// For conditions of distribution and use, see copyright notice in irrlicht.h - -#ifndef IRR_I_MESH_TEXTURE_LOADER_H_INCLUDED__ -#define IRR_I_MESH_TEXTURE_LOADER_H_INCLUDED__ - -#include "path.h" -#include "IReferenceCounted.h" - -namespace irr -{ - -namespace video -{ - class ITexture; -} -namespace io -{ - class IReadFile; -} - -namespace scene -{ - -//! Finding and loading textures inside meshloaders. -/** A texture loader can search for a texture in several paths. -For example relative to a given texture-path, relative to the current -working directory or relative to a mesh- and/or material-file. -*/ -class IMeshTextureLoader : public virtual IReferenceCounted -{ -public: - - //! Destructor - virtual ~IMeshTextureLoader() {} - - //! Set a custom texture path. - /** This is the first path the texture-loader should search. */ - virtual void setTexturePath(const irr::io::path& path) = 0; - - //! Get the current custom texture path. - virtual const irr::io::path& getTexturePath() const = 0; - - //! Get the texture by searching for it in all paths that makes sense for the given textureName. - /** Usually you do not have to use this method, it is used internally by IMeshLoader's. - \param textureName Texturename as used in the mesh-format - \return Pointer to the texture. Returns 0 if loading failed.*/ - virtual irr::video::ITexture* getTexture(const irr::io::path& textureName) = 0; - - //! Meshloaders will search paths relative to the meshFile. - /** Usually you do not have to use this method, it is used internally by IMeshLoader's. - Any values you set here will likely be overwritten internally. */ - virtual void setMeshFile(const irr::io::IReadFile* meshFile) = 0; - - //! Meshloaders will try to look relative to the path of the materialFile - /** Usually you do not have to use this method, it is used internally by IMeshLoader's. - Any values you set here will likely be overwritten internally. */ - virtual void setMaterialFile(const irr::io::IReadFile* materialFile) = 0; -}; - - -} // end namespace scene -} // end namespace irr - -#endif diff --git a/include/IMetaTriangleSelector.h b/include/IMetaTriangleSelector.h deleted file mode 100644 index 2cbb385c..00000000 --- a/include/IMetaTriangleSelector.h +++ /dev/null @@ -1,43 +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_META_TRIANGLE_SELECTOR_H_INCLUDED__ -#define __I_META_TRIANGLE_SELECTOR_H_INCLUDED__ - -#include "ITriangleSelector.h" - -namespace irr -{ -namespace scene -{ - -//! Interface for making multiple triangle selectors work as one big selector. -/** This is nothing more than a collection of one or more triangle selectors -providing together the interface of one triangle selector. In this way, -collision tests can be done with different triangle soups in one pass. -*/ -class IMetaTriangleSelector : public ITriangleSelector -{ -public: - - //! Adds a triangle selector to the collection of triangle selectors. - /** \param toAdd: Pointer to an triangle selector to add to the list. */ - virtual void addTriangleSelector(ITriangleSelector* toAdd) = 0; - - //! Removes a specific triangle selector from the collection. - /** \param toRemove: Pointer to an triangle selector which is in the - list but will be removed. - \return True if successful, false if not. */ - virtual bool removeTriangleSelector(ITriangleSelector* toRemove) = 0; - - //! Removes all triangle selectors from the collection. - virtual void removeAllTriangleSelectors() = 0; -}; - -} // end namespace scene -} // end namespace irr - - -#endif - diff --git a/include/IOctreeSceneNode.h b/include/IOctreeSceneNode.h deleted file mode 100644 index 352a274a..00000000 --- a/include/IOctreeSceneNode.h +++ /dev/null @@ -1,83 +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_OCTREE_SCENE_NODE_H_INCLUDED__ -#define __I_OCTREE_SCENE_NODE_H_INCLUDED__ - -#include "IMeshSceneNode.h" - -namespace irr -{ -namespace scene -{ - -//! Settings if/how octree scene nodes are using hardware mesh-buffers -/** VBO = Vertex buffer object = meshbuffers bound on the graphic-card instead of uploaded each frame. - It can not be generally said which mode is optimal for drawing as this depends - on the scene. So you have to try and experiment for your meshes which one works best. -*/ -enum EOCTREENODE_VBO -{ - //! No VBO's used. Vertices+indices send to graphic-card on each render. - EOV_NO_VBO, - - //! VBO's used. Draw the complete meshbuffers if any polygon in it is visible. - //! This allows VBO's for the meshbuffers to be completely static, but basically means - //! the octree is not used as an octree (not it still does do all the octree calculations) - //! Might work in very specific cases, but if this is gives you the best fastest results - //! you should probably compare as well to simply using a static mesh with no octree at all. - //! In most cases the other 2 options should work better with an octree. - EOV_USE_VBO, - - //! VBO's used. The index-buffer information is updated each frame - //! with only the visible parts of a tree-node. - //! So the vertex-buffer is static and the index-buffer is dynamic. - //! This is the default - EOV_USE_VBO_WITH_VISIBITLY -}; - -//! Kind of checks polygons of the octree scene nodes use against camera -enum EOCTREE_POLYGON_CHECKS -{ - //! Check against box of the camera frustum - //! This is the default - EOPC_BOX, - - //! against the camera frustum - EOPC_FRUSTUM - -}; - -//! A scene node displaying a static mesh -class IOctreeSceneNode : public irr::scene::IMeshSceneNode -{ -public: - - //! Constructor - /** Use setMesh() to set the mesh to display. - */ - IOctreeSceneNode(ISceneNode* parent, ISceneManager* mgr, s32 id, - const core::vector3df& position = core::vector3df(0,0,0), - const core::vector3df& rotation = core::vector3df(0,0,0), - const core::vector3df& scale = core::vector3df(1,1,1)) - : IMeshSceneNode(parent, mgr, id, position, rotation, scale) {} - - //! Get if/how vertex buffer object are used for the meshbuffers - // NOTE: Will currently _always_ return EOV_NO_VBO. - // Octree's with VBO's don't work yet correctly. - virtual EOCTREENODE_VBO getUseVBO() const = 0; - - //! Set the kind of tests polygons do for visibility against the camera - virtual void setPolygonChecks(EOCTREE_POLYGON_CHECKS checks) = 0; - - //! Get the kind of tests polygons do for visibility against the camera - virtual EOCTREE_POLYGON_CHECKS getPolygonChecks() const = 0; -}; - -} // end namespace scene -} // end namespace irr - - -#endif - diff --git a/include/IParticleAffector.h b/include/IParticleAffector.h deleted file mode 100644 index e2b83e8f..00000000 --- a/include/IParticleAffector.h +++ /dev/null @@ -1,72 +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_PARTICLE_AFFECTOR_H_INCLUDED__ -#define __I_PARTICLE_AFFECTOR_H_INCLUDED__ - -#include "IAttributeExchangingObject.h" -#include "SParticle.h" - -namespace irr -{ -namespace scene -{ - -//! Types of built in particle affectors -enum E_PARTICLE_AFFECTOR_TYPE -{ - EPAT_NONE = 0, - EPAT_ATTRACT, - EPAT_FADE_OUT, - EPAT_GRAVITY, - EPAT_ROTATE, - EPAT_SCALE, - EPAT_COUNT -}; - -//! Names for built in particle affectors -const c8* const ParticleAffectorTypeNames[] = -{ - "None", - "Attract", - "FadeOut", - "Gravity", - "Rotate", - "Scale", - 0 -}; - -//! A particle affector modifies particles. -class IParticleAffector : public virtual io::IAttributeExchangingObject -{ -public: - - //! constructor - IParticleAffector() : Enabled(true) {} - - //! Affects an array of particles. - /** \param now Current time. (Same as ITimer::getTime() would return) - \param particlearray Array of particles. - \param count Amount of particles in array. */ - virtual void affect(u32 now, SParticle* particlearray, u32 count) = 0; - - //! Sets whether or not the affector is currently enabled. - virtual void setEnabled(bool enabled) { Enabled = enabled; } - - //! Gets whether or not the affector is currently enabled. - virtual bool getEnabled() const { return Enabled; } - - //! Get emitter type - virtual E_PARTICLE_AFFECTOR_TYPE getType() const = 0; - -protected: - bool Enabled; -}; - -} // end namespace scene -} // end namespace irr - - -#endif - diff --git a/include/IParticleAnimatedMeshSceneNodeEmitter.h b/include/IParticleAnimatedMeshSceneNodeEmitter.h deleted file mode 100644 index 0e0646f2..00000000 --- a/include/IParticleAnimatedMeshSceneNodeEmitter.h +++ /dev/null @@ -1,54 +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_PARTICLE_ANIMATED_MESH_SCENE_NODE_EMITTER_H_INCLUDED__ -#define __I_PARTICLE_ANIMATED_MESH_SCENE_NODE_EMITTER_H_INCLUDED__ - -#include "IParticleEmitter.h" -#include "IAnimatedMeshSceneNode.h" - -namespace irr -{ -namespace scene -{ - -//! A particle emitter which emits particles from mesh vertices. -class IParticleAnimatedMeshSceneNodeEmitter : public IParticleEmitter -{ -public: - - //! Set Mesh to emit particles from - virtual void setAnimatedMeshSceneNode( IAnimatedMeshSceneNode* node ) = 0; - - //! Set whether to use vertex normal for direction, or direction specified - virtual void setUseNormalDirection( bool useNormalDirection = true ) = 0; - - //! Set the amount that the normal is divided by for getting a particles direction - virtual void setNormalDirectionModifier( f32 normalDirectionModifier ) = 0; - - //! Sets whether to emit min<->max particles for every vertex or to pick min<->max vertices - virtual void setEveryMeshVertex( bool everyMeshVertex = true ) = 0; - - //! Get mesh we're emitting particles from - virtual const IAnimatedMeshSceneNode* getAnimatedMeshSceneNode() const = 0; - - //! Get whether to use vertex normal for direction, or direction specified - virtual bool isUsingNormalDirection() const = 0; - - //! Get the amount that the normal is divided by for getting a particles direction - virtual f32 getNormalDirectionModifier() const = 0; - - //! Gets whether to emit min<->max particles for every vertex or to pick min<->max vertices - virtual bool getEveryMeshVertex() const = 0; - - //! Get emitter type - virtual E_PARTICLE_EMITTER_TYPE getType() const _IRR_OVERRIDE_ { return EPET_ANIMATED_MESH; } -}; - -} // end namespace scene -} // end namespace irr - - -#endif // __I_PARTICLE_ANIMATED_MESH_SCENE_NODE_EMITTER_H_INCLUDED__ - diff --git a/include/IParticleAttractionAffector.h b/include/IParticleAttractionAffector.h deleted file mode 100644 index e858f8ac..00000000 --- a/include/IParticleAttractionAffector.h +++ /dev/null @@ -1,65 +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_PARTICLE_ATTRACTION_AFFECTOR_H_INCLUDED__ -#define __I_PARTICLE_ATTRACTION_AFFECTOR_H_INCLUDED__ - -#include "IParticleAffector.h" - -namespace irr -{ -namespace scene -{ - -//! A particle affector which attracts or detracts particles. -class IParticleAttractionAffector : public IParticleAffector -{ -public: - - //! Set the point that particles will attract to - virtual void setPoint( const core::vector3df& point ) = 0; - - //! Set the speed, in game units per second that the particles will attract to the specified point - virtual void setSpeed( f32 speed ) =0; - - //! Set whether or not the particles are attracting or detracting - virtual void setAttract( bool attract ) = 0; - - //! Set whether or not this will affect particles in the X direction - virtual void setAffectX( bool affect ) = 0; - - //! Set whether or not this will affect particles in the Y direction - virtual void setAffectY( bool affect ) = 0; - - //! Set whether or not this will affect particles in the Z direction - virtual void setAffectZ( bool affect ) = 0; - - //! Get the point that particles are attracted to - virtual const core::vector3df& getPoint() const = 0; - - //! Get the speed that points attract to the specified point - virtual f32 getSpeed() const =0; - - //! Get whether or not the particles are attracting or detracting - virtual bool getAttract() const = 0; - - //! Get whether or not the particles X position are affected - virtual bool getAffectX() const = 0; - - //! Get whether or not the particles Y position are affected - virtual bool getAffectY() const = 0; - - //! Get whether or not the particles Z position are affected - virtual bool getAffectZ() const = 0; - - //! Get emitter type - virtual E_PARTICLE_AFFECTOR_TYPE getType() const _IRR_OVERRIDE_ { return EPAT_ATTRACT; } -}; - -} // end namespace scene -} // end namespace irr - - -#endif // __I_PARTICLE_ATTRACTION_AFFECTOR_H_INCLUDED__ - diff --git a/include/IParticleBoxEmitter.h b/include/IParticleBoxEmitter.h deleted file mode 100644 index 10790bf8..00000000 --- a/include/IParticleBoxEmitter.h +++ /dev/null @@ -1,36 +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_PARTICLE_BOX_EMITTER_H_INCLUDED__ -#define __I_PARTICLE_BOX_EMITTER_H_INCLUDED__ - -#include "IParticleEmitter.h" -#include "aabbox3d.h" - -namespace irr -{ -namespace scene -{ - -//! A particle emitter which emits particles from a box shaped space -class IParticleBoxEmitter : public IParticleEmitter -{ -public: - - //! Set the box shape - virtual void setBox( const core::aabbox3df& box ) = 0; - - //! Get the box shape set - virtual const core::aabbox3df& getBox() const = 0; - - //! Get emitter type - virtual E_PARTICLE_EMITTER_TYPE getType() const _IRR_OVERRIDE_ { return EPET_BOX; } -}; - -} // end namespace scene -} // end namespace irr - - -#endif - diff --git a/include/IParticleCylinderEmitter.h b/include/IParticleCylinderEmitter.h deleted file mode 100644 index ca42defe..00000000 --- a/include/IParticleCylinderEmitter.h +++ /dev/null @@ -1,59 +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_PARTICLE_CYLINDER_EMITTER_H_INCLUDED__ -#define __I_PARTICLE_CYLINDER_EMITTER_H_INCLUDED__ - -#include "IParticleEmitter.h" - -namespace irr -{ -namespace scene -{ - -//! A particle emitter which emits from a cylindrically shaped space. -class IParticleCylinderEmitter : public IParticleEmitter -{ -public: - - //! Set the center of the radius for the cylinder, at one end of the cylinder - virtual void setCenter( const core::vector3df& center ) = 0; - - //! Set the normal of the cylinder - virtual void setNormal( const core::vector3df& normal ) = 0; - - //! Set the radius of the cylinder - virtual void setRadius( f32 radius ) = 0; - - //! Set the length of the cylinder - virtual void setLength( f32 length ) = 0; - - //! Set whether or not to draw points inside the cylinder - virtual void setOutlineOnly( bool outlineOnly = true ) = 0; - - //! Get the center of the cylinder - virtual const core::vector3df& getCenter() const = 0; - - //! Get the normal of the cylinder - virtual const core::vector3df& getNormal() const = 0; - - //! Get the radius of the cylinder - virtual f32 getRadius() const = 0; - - //! Get the center of the cylinder - virtual f32 getLength() const = 0; - - //! Get whether or not to draw points inside the cylinder - virtual bool getOutlineOnly() const = 0; - - //! Get emitter type - virtual E_PARTICLE_EMITTER_TYPE getType() const _IRR_OVERRIDE_ { return EPET_CYLINDER; } -}; - -} // end namespace scene -} // end namespace irr - - -#endif - diff --git a/include/IParticleEmitter.h b/include/IParticleEmitter.h deleted file mode 100644 index 4e54e85d..00000000 --- a/include/IParticleEmitter.h +++ /dev/null @@ -1,128 +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_PARTICLE_EMITTER_H_INCLUDED__ -#define __I_PARTICLE_EMITTER_H_INCLUDED__ - -#include "IAttributeExchangingObject.h" -#include "SParticle.h" - -namespace irr -{ -namespace scene -{ - -//! Types of built in particle emitters -enum E_PARTICLE_EMITTER_TYPE -{ - EPET_POINT = 0, - EPET_ANIMATED_MESH, - EPET_BOX, - EPET_CYLINDER, - EPET_MESH, - EPET_RING, - EPET_SPHERE, - EPET_COUNT -}; - -//! Names for built in particle emitters -const c8* const ParticleEmitterTypeNames[] = -{ - "Point", - "AnimatedMesh", - "Box", - "Cylinder", - "Mesh", - "Ring", - "Sphere", - 0 -}; - -//! A particle emitter for using with particle systems. -/** A Particle emitter emits new particles into a particle system. -*/ -class IParticleEmitter : public virtual io::IAttributeExchangingObject -{ -public: - - //! Prepares an array with new particles to emit into the system - /** \param now Current time. - \param timeSinceLastCall Time elapsed since last call, in milliseconds. - \param outArray Pointer which will point to the array with the new - particles to add into the system. - \return Amount of new particles in the array. Can be 0. */ - virtual s32 emitt(u32 now, u32 timeSinceLastCall, SParticle*& outArray) = 0; - - //! Set direction the emitter emits particles - virtual void setDirection( const core::vector3df& newDirection ) = 0; - - //! Set minimum number of particles the emitter emits per second - virtual void setMinParticlesPerSecond( u32 minPPS ) = 0; - - //! Set maximum number of particles the emitter emits per second - virtual void setMaxParticlesPerSecond( u32 maxPPS ) = 0; - - //! Set minimum starting color for particles - virtual void setMinStartColor( const video::SColor& color ) = 0; - - //! Set maximum starting color for particles - virtual void setMaxStartColor( const video::SColor& color ) = 0; - - //! Set the maximum starting size for particles - virtual void setMaxStartSize( const core::dimension2df& size ) = 0; - - //! Set the minimum starting size for particles - virtual void setMinStartSize( const core::dimension2df& size ) = 0; - - //! Set the minimum particle life-time in milliseconds - virtual void setMinLifeTime( u32 lifeTimeMin ) = 0; - - //! Set the maximum particle life-time in milliseconds - virtual void setMaxLifeTime( u32 lifeTimeMax ) = 0; - - //! Set maximal random derivation from the direction - virtual void setMaxAngleDegrees( s32 maxAngleDegrees ) = 0; - - //! Get direction the emitter emits particles - virtual const core::vector3df& getDirection() const = 0; - - //! Get the minimum number of particles the emitter emits per second - virtual u32 getMinParticlesPerSecond() const = 0; - - //! Get the maximum number of particles the emitter emits per second - virtual u32 getMaxParticlesPerSecond() const = 0; - - //! Get the minimum starting color for particles - virtual const video::SColor& getMinStartColor() const = 0; - - //! Get the maximum starting color for particles - virtual const video::SColor& getMaxStartColor() const = 0; - - //! Get the maximum starting size for particles - virtual const core::dimension2df& getMaxStartSize() const = 0; - - //! Get the minimum starting size for particles - virtual const core::dimension2df& getMinStartSize() const = 0; - - //! Get the minimum particle life-time in milliseconds - virtual u32 getMinLifeTime() const = 0; - - //! Get the maximum particle life-time in milliseconds - virtual u32 getMaxLifeTime() const = 0; - - //! Get maximal random derivation from the direction - virtual s32 getMaxAngleDegrees() const = 0; - - //! Get emitter type - virtual E_PARTICLE_EMITTER_TYPE getType() const { return EPET_POINT; } -}; - -typedef IParticleEmitter IParticlePointEmitter; - -} // end namespace scene -} // end namespace irr - - -#endif - diff --git a/include/IParticleFadeOutAffector.h b/include/IParticleFadeOutAffector.h deleted file mode 100644 index 67000c0b..00000000 --- a/include/IParticleFadeOutAffector.h +++ /dev/null @@ -1,41 +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_PARTICLE_FADE_OUT_AFFECTOR_H_INCLUDED__ -#define __I_PARTICLE_FADE_OUT_AFFECTOR_H_INCLUDED__ - -#include "IParticleAffector.h" - -namespace irr -{ -namespace scene -{ - -//! A particle affector which fades out the particles. -class IParticleFadeOutAffector : public IParticleAffector -{ -public: - - //! Sets the targetColor, i.e. the color the particles will interpolate to over time. - virtual void setTargetColor( const video::SColor& targetColor ) = 0; - - //! Sets the time in milliseconds it takes for each particle to fade out (minimal 1 ms) - virtual void setFadeOutTime( u32 fadeOutTime ) = 0; - - //! Gets the targetColor, i.e. the color the particles will interpolate to over time. - virtual const video::SColor& getTargetColor() const = 0; - - //! Gets the time in milliseconds it takes for each particle to fade out. - virtual u32 getFadeOutTime() const = 0; - - //! Get emitter type - virtual E_PARTICLE_AFFECTOR_TYPE getType() const _IRR_OVERRIDE_ { return EPAT_FADE_OUT; } -}; - -} // end namespace scene -} // end namespace irr - - -#endif // __I_PARTICLE_FADE_OUT_AFFECTOR_H_INCLUDED__ - diff --git a/include/IParticleGravityAffector.h b/include/IParticleGravityAffector.h deleted file mode 100644 index be2c244b..00000000 --- a/include/IParticleGravityAffector.h +++ /dev/null @@ -1,42 +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_PARTICLE_GRAVITY_AFFECTOR_H_INCLUDED__ -#define __I_PARTICLE_GRAVITY_AFFECTOR_H_INCLUDED__ - -#include "IParticleAffector.h" - -namespace irr -{ -namespace scene -{ - -//! A particle affector which applies gravity to particles. -class IParticleGravityAffector : public IParticleAffector -{ -public: - - //! Set the time in milliseconds when the gravity force is totally lost - /** At that point the particle does not move any more. */ - virtual void setTimeForceLost( f32 timeForceLost ) = 0; - - //! Set the direction and force of gravity in all 3 dimensions. - virtual void setGravity( const core::vector3df& gravity ) = 0; - - //! Get the time in milliseconds when the gravity force is totally lost - virtual f32 getTimeForceLost() const = 0; - - //! Get the direction and force of gravity. - virtual const core::vector3df& getGravity() const = 0; - - //! Get emitter type - virtual E_PARTICLE_AFFECTOR_TYPE getType() const _IRR_OVERRIDE_ { return EPAT_GRAVITY; } -}; - -} // end namespace scene -} // end namespace irr - - -#endif // __I_PARTICLE_GRAVITY_AFFECTOR_H_INCLUDED__ - diff --git a/include/IParticleMeshEmitter.h b/include/IParticleMeshEmitter.h deleted file mode 100644 index 7f078064..00000000 --- a/include/IParticleMeshEmitter.h +++ /dev/null @@ -1,54 +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_PARTICLE_MESH_EMITTER_H_INCLUDED__ -#define __I_PARTICLE_MESH_EMITTER_H_INCLUDED__ - -#include "IParticleEmitter.h" -#include "IMesh.h" - -namespace irr -{ -namespace scene -{ - -//! A particle emitter which emits from vertices of a mesh -class IParticleMeshEmitter : public IParticleEmitter -{ -public: - - //! Set Mesh to emit particles from - virtual void setMesh( IMesh* mesh ) = 0; - - //! Set whether to use vertex normal for direction, or direction specified - virtual void setUseNormalDirection( bool useNormalDirection = true ) = 0; - - //! Set the amount that the normal is divided by for getting a particles direction - virtual void setNormalDirectionModifier( f32 normalDirectionModifier ) = 0; - - //! Sets whether to emit min<->max particles for every vertex or to pick min<->max vertices - virtual void setEveryMeshVertex( bool everyMeshVertex = true ) = 0; - - //! Get Mesh we're emitting particles from - virtual const IMesh* getMesh() const = 0; - - //! Get whether to use vertex normal for direction, or direction specified - virtual bool isUsingNormalDirection() const = 0; - - //! Get the amount that the normal is divided by for getting a particles direction - virtual f32 getNormalDirectionModifier() const = 0; - - //! Gets whether to emit min<->max particles for every vertex or to pick min<->max vertices - virtual bool getEveryMeshVertex() const = 0; - - //! Get emitter type - virtual E_PARTICLE_EMITTER_TYPE getType() const _IRR_OVERRIDE_ { return EPET_MESH; } -}; - -} // end namespace scene -} // end namespace irr - - -#endif - diff --git a/include/IParticleRingEmitter.h b/include/IParticleRingEmitter.h deleted file mode 100644 index 7828b898..00000000 --- a/include/IParticleRingEmitter.h +++ /dev/null @@ -1,47 +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_PARTICLE_RING_EMITTER_H_INCLUDED__ -#define __I_PARTICLE_RING_EMITTER_H_INCLUDED__ - -#include "IParticleEmitter.h" - -namespace irr -{ -namespace scene -{ - -//! A particle emitter which emits particles along a ring shaped area. -class IParticleRingEmitter : public IParticleEmitter -{ -public: - - //! Set the center of the ring - virtual void setCenter( const core::vector3df& center ) = 0; - - //! Set the radius of the ring - virtual void setRadius( f32 radius ) = 0; - - //! Set the thickness of the ring - virtual void setRingThickness( f32 ringThickness ) = 0; - - //! Get the center of the ring - virtual const core::vector3df& getCenter() const = 0; - - //! Get the radius of the ring - virtual f32 getRadius() const = 0; - - //! Get the thickness of the ring - virtual f32 getRingThickness() const = 0; - - //! Get emitter type - virtual E_PARTICLE_EMITTER_TYPE getType() const _IRR_OVERRIDE_ { return EPET_RING; } -}; - -} // end namespace scene -} // end namespace irr - - -#endif - diff --git a/include/IParticleRotationAffector.h b/include/IParticleRotationAffector.h deleted file mode 100644 index 374a2682..00000000 --- a/include/IParticleRotationAffector.h +++ /dev/null @@ -1,41 +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_PARTICLE_ROTATION_AFFECTOR_H_INCLUDED__ -#define __I_PARTICLE_ROTATION_AFFECTOR_H_INCLUDED__ - -#include "IParticleAffector.h" - -namespace irr -{ -namespace scene -{ - -//! A particle affector which rotates the particle system. -class IParticleRotationAffector : public IParticleAffector -{ -public: - - //! Set the point that particles will rotate around - virtual void setPivotPoint( const core::vector3df& point ) = 0; - - //! Set the speed in degrees per second in all 3 dimensions - virtual void setSpeed( const core::vector3df& speed ) = 0; - - //! Get the point that particles are attracted to - virtual const core::vector3df& getPivotPoint() const = 0; - - //! Get the speed in degrees per second in all 3 dimensions - virtual const core::vector3df& getSpeed() const = 0; - - //! Get emitter type - virtual E_PARTICLE_AFFECTOR_TYPE getType() const _IRR_OVERRIDE_ { return EPAT_ROTATE; } -}; - -} // end namespace scene -} // end namespace irr - - -#endif // __I_PARTICLE_ROTATION_AFFECTOR_H_INCLUDED__ - diff --git a/include/IParticleSphereEmitter.h b/include/IParticleSphereEmitter.h deleted file mode 100644 index 1bfe98c3..00000000 --- a/include/IParticleSphereEmitter.h +++ /dev/null @@ -1,41 +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_PARTICLE_SPHERE_EMITTER_H_INCLUDED__ -#define __I_PARTICLE_SPHERE_EMITTER_H_INCLUDED__ - -#include "IParticleEmitter.h" - -namespace irr -{ -namespace scene -{ - -//! A particle emitter which emits from a spherical space. -class IParticleSphereEmitter : public IParticleEmitter -{ -public: - - //! Set the center of the sphere for particle emissions - virtual void setCenter( const core::vector3df& center ) = 0; - - //! Set the radius of the sphere for particle emissions - virtual void setRadius( f32 radius ) = 0; - - //! Get the center of the sphere for particle emissions - virtual const core::vector3df& getCenter() const = 0; - - //! Get the radius of the sphere for particle emissions - virtual f32 getRadius() const = 0; - - //! Get emitter type - virtual E_PARTICLE_EMITTER_TYPE getType() const _IRR_OVERRIDE_ { return EPET_SPHERE; } -}; - -} // end namespace scene -} // end namespace irr - - -#endif - diff --git a/include/IParticleSystemSceneNode.h b/include/IParticleSystemSceneNode.h deleted file mode 100644 index b124cbc5..00000000 --- a/include/IParticleSystemSceneNode.h +++ /dev/null @@ -1,572 +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_PARTICLE_SYSTEM_SCENE_NODE_H_INCLUDED__ -#define __I_PARTICLE_SYSTEM_SCENE_NODE_H_INCLUDED__ - -#include "ISceneNode.h" -#include "IParticleAnimatedMeshSceneNodeEmitter.h" -#include "IParticleBoxEmitter.h" -#include "IParticleCylinderEmitter.h" -#include "IParticleMeshEmitter.h" -#include "IParticleRingEmitter.h" -#include "IParticleSphereEmitter.h" -#include "IParticleAttractionAffector.h" -#include "IParticleFadeOutAffector.h" -#include "IParticleGravityAffector.h" -#include "IParticleRotationAffector.h" -#include "dimension2d.h" - -namespace irr -{ -namespace scene -{ - -//! A particle system scene node for creating snow, fire, explosions, smoke... -/** A scene node controlling a particle System. The behavior of the particles -can be controlled by setting the right particle emitters and affectors. -You can for example easily create a campfire by doing this: - -\code - scene::IParticleSystemSceneNode* p = scenemgr->addParticleSystemSceneNode(); - p->setParticleSize(core::dimension2d(20.0f, 10.0f)); - scene::IParticleEmitter* em = p->createBoxEmitter( - core::aabbox3d(-5,0,-5,5,1,5), - core::vector3df(0.0f,0.03f,0.0f), - 40,80, video::SColor(0,255,255,255),video::SColor(0,255,255,255), 1100,2000); - p->setEmitter(em); - em->drop(); - scene::IParticleAffector* paf = p->createFadeOutParticleAffector(); - p->addAffector(paf); - paf->drop(); -\endcode -*/ - -//! Bitflags to control particle behavior -enum EParticleBehavior -{ - //! Continue emitting new particles even when the node is invisible - EPB_INVISIBLE_EMITTING = 1, - - //! Continue affecting particles even when the node is invisible - EPB_INVISIBLE_AFFECTING = 2, - - //! Continue updating particle positions or deleting them even when the node is invisible - EPB_INVISIBLE_ANIMATING = 4, - - //! Clear all particles when node gets invisible - EPB_CLEAR_ON_INVISIBLE = 8, - - //! Particle movement direction on emitting ignores the node rotation - //! This is mainly to allow backward compatible behavior to Irrlicht 1.8 - EPB_EMITTER_VECTOR_IGNORE_ROTATION = 16, - - //! On emitting global particles interpolate the positions randomly between the last and current node transformations. - //! This can be set to avoid gaps caused by fast node movement or low framerates, but will be somewhat - //! slower to calculate. - EPB_EMITTER_FRAME_INTERPOLATION = 32 -}; - -class IParticleSystemSceneNode : public ISceneNode -{ -public: - - //! Constructor - IParticleSystemSceneNode(ISceneNode* parent, ISceneManager* mgr, s32 id, - const core::vector3df& position = core::vector3df(0,0,0), - const core::vector3df& rotation = core::vector3df(0,0,0), - const core::vector3df& scale = core::vector3df(1.0f, 1.0f, 1.0f)) - : ISceneNode(parent, mgr, id, position, rotation, scale) - , ParticleBehavior(0) - { - } - - //! Sets the size of all particles. - virtual void setParticleSize( - const core::dimension2d &size = core::dimension2d(5.0f, 5.0f)) = 0; - - //! Sets if the particles should be global. - /** If they are, the particles are affected by the movement of the - particle system scene node too, otherwise they completely ignore it. - Default is true. */ - virtual void setParticlesAreGlobal(bool global=true) = 0; - - - //! Bitflags to change the particle behavior - /** - \param flags A combination of ::EParticleBehavior bit-flags. Default is 0. */ - virtual void setParticleBehavior(irr::u32 flags) - { - ParticleBehavior = flags; - } - - - //! Gets how particles behave in different situations - /** - \return A combination of ::EParticleBehavior flags */ - virtual irr::u32 getParticleBehavior() const - { - return ParticleBehavior; - } - - //! Remove all currently visible particles - virtual void clearParticles() = 0; - - //! Do manually update the particles. - /** This should only be called when you want to render the node outside - the scenegraph, as the node will care about this otherwise - automatically. */ - virtual void doParticleSystem(u32 time) = 0; - - //! Gets the particle emitter, which creates the particles. - /** \return The particle emitter. Can be 0 if none is set. */ - virtual IParticleEmitter* getEmitter() =0; - - //! Sets the particle emitter, which creates the particles. - /** A particle emitter can be created using one of the createEmitter - methods. For example to create and use a simple PointEmitter, call - IParticleEmitter* p = createPointEmitter(); setEmitter(p); p->drop(); - \param emitter: Sets the particle emitter. You can set this to 0 for - removing the current emitter and stopping the particle system emitting - new particles. */ - virtual void setEmitter(IParticleEmitter* emitter) = 0; - - //! Adds new particle effector to the particle system. - /** A particle affector modifies the particles. For example, the FadeOut - affector lets all particles fade out after some time. It is created and - used in this way: - \code - IParticleAffector* p = createFadeOutParticleAffector(); - addAffector(p); - p->drop(); - \endcode - Please note that an affector is not necessary for the particle system to - work. - \param affector: New affector. */ - virtual void addAffector(IParticleAffector* affector) = 0; - - //! Get a list of all particle affectors. - /** \return The list of particle affectors attached to this node. */ - virtual const core::list& getAffectors() const = 0; - - //! Removes all particle affectors in the particle system. - virtual void removeAllAffectors() = 0; - - //! Creates a particle emitter for an animated mesh scene node - /** \param node: Pointer to the animated mesh scene node to emit - particles from - \param useNormalDirection: If true, the direction of each particle - created will be the normal of the vertex that it's emitting from. The - normal is divided by the normalDirectionModifier parameter, which - defaults to 100.0f. - \param direction: Direction and speed of particle emission. - \param normalDirectionModifier: If the emitter is using the normal - direction then the normal of the vertex that is being emitted from is - divided by this number. - \param mbNumber: This allows you to specify a specific meshBuffer for - the IMesh* to emit particles from. The default value is -1, which - means a random meshBuffer picked from all of the meshes meshBuffers - will be selected to pick a random vertex from. If the value is 0 or - greater, it will only pick random vertices from the meshBuffer - specified by this value. - \param everyMeshVertex: If true, the emitter will emit between min/max - particles every second, for every vertex in the mesh, if false, it will - emit between min/max particles from random vertices in the mesh. - \param minParticlesPerSecond: Minimal amount of particles emitted per - second. - \param maxParticlesPerSecond: Maximal amount of particles emitted per - second. - \param minStartColor: Minimal initial start color of a particle. The - real color of every particle is calculated as random interpolation - between minStartColor and maxStartColor. - \param maxStartColor: Maximal initial start color of a particle. The - real color of every particle is calculated as random interpolation - between minStartColor and maxStartColor. - \param lifeTimeMin: Minimal lifetime of a particle, in milliseconds. - \param lifeTimeMax: Maximal lifetime of a particle, in milliseconds. - \param maxAngleDegrees: Maximal angle in degrees, the emitting - direction of the particle will differ from the original direction. - \param minStartSize: Minimal initial start size of a particle. The - real size of every particle is calculated as random interpolation - between minStartSize and maxStartSize. - \param maxStartSize: Maximal initial start size of a particle. The - real size of every particle is calculated as random interpolation - between minStartSize and maxStartSize. - \return Pointer to the created particle emitter. To set this emitter - as new emitter of this particle system, just call setEmitter(). Note - that you'll have to drop() the returned pointer, after you don't need - it any more, see IReferenceCounted::drop() for more information. */ - virtual IParticleAnimatedMeshSceneNodeEmitter* createAnimatedMeshSceneNodeEmitter( - scene::IAnimatedMeshSceneNode* node, bool useNormalDirection = true, - const core::vector3df& direction = core::vector3df(0.0f,0.03f,0.0f), - f32 normalDirectionModifier = 100.0f, s32 mbNumber = -1, - bool everyMeshVertex = false, - u32 minParticlesPerSecond = 5, u32 maxParticlesPerSecond = 10, - const video::SColor& minStartColor = video::SColor(255,0,0,0), - const video::SColor& maxStartColor = video::SColor(255,255,255,255), - u32 lifeTimeMin = 2000, u32 lifeTimeMax = 4000, - s32 maxAngleDegrees = 0, - const core::dimension2df& minStartSize = core::dimension2df(5.0f,5.0f), - const core::dimension2df& maxStartSize = core::dimension2df(5.0f,5.0f) ) = 0; - - //! Creates a box particle emitter. - /** \param box: The box for the emitter. - \param direction: Direction and speed of particle emission. - \param minParticlesPerSecond: Minimal amount of particles emitted per - second. - \param maxParticlesPerSecond: Maximal amount of particles emitted per - second. - \param minStartColor: Minimal initial start color of a particle. The - real color of every particle is calculated as random interpolation - between minStartColor and maxStartColor. - \param maxStartColor: Maximal initial start color of a particle. The - real color of every particle is calculated as random interpolation - between minStartColor and maxStartColor. - \param lifeTimeMin: Minimal lifetime of a particle, in milliseconds. - \param lifeTimeMax: Maximal lifetime of a particle, in milliseconds. - \param maxAngleDegrees: Maximal angle in degrees, the emitting - direction of the particle will differ from the original direction. - \param minStartSize: Minimal initial start size of a particle. The - real size of every particle is calculated as random interpolation - between minStartSize and maxStartSize. - \param maxStartSize: Maximal initial start size of a particle. The - real size of every particle is calculated as random interpolation - between minStartSize and maxStartSize. - \return Pointer to the created particle emitter. To set this emitter - as new emitter of this particle system, just call setEmitter(). Note - that you'll have to drop() the returned pointer, after you don't need - it any more, see IReferenceCounted::drop() for more information. */ - virtual IParticleBoxEmitter* createBoxEmitter( - const core::aabbox3df& box = core::aabbox3df(-10,28,-10,10,30,10), - const core::vector3df& direction = core::vector3df(0.0f,0.03f,0.0f), - u32 minParticlesPerSecond = 5, - u32 maxParticlesPerSecond = 10, - const video::SColor& minStartColor = video::SColor(255,0,0,0), - const video::SColor& maxStartColor = video::SColor(255,255,255,255), - u32 lifeTimeMin=2000, u32 lifeTimeMax=4000, - s32 maxAngleDegrees=0, - const core::dimension2df& minStartSize = core::dimension2df(5.0f,5.0f), - const core::dimension2df& maxStartSize = core::dimension2df(5.0f,5.0f) ) = 0; - - //! Creates a particle emitter for emitting from a cylinder - /** \param center: The center of the circle at the base of the cylinder - \param radius: The thickness of the cylinder - \param normal: Direction of the length of the cylinder - \param length: The length of the the cylinder - \param outlineOnly: Whether or not to put points inside the cylinder or - on the outline only - \param direction: Direction and speed of particle emission. - \param minParticlesPerSecond: Minimal amount of particles emitted per - second. - \param maxParticlesPerSecond: Maximal amount of particles emitted per - second. - \param minStartColor: Minimal initial start color of a particle. The - real color of every particle is calculated as random interpolation - between minStartColor and maxStartColor. - \param maxStartColor: Maximal initial start color of a particle. The - real color of every particle is calculated as random interpolation - between minStartColor and maxStartColor. - \param lifeTimeMin: Minimal lifetime of a particle, in milliseconds. - \param lifeTimeMax: Maximal lifetime of a particle, in milliseconds. - \param maxAngleDegrees: Maximal angle in degrees, the emitting - direction of the particle will differ from the original direction. - \param minStartSize: Minimal initial start size of a particle. The - real size of every particle is calculated as random interpolation - between minStartSize and maxStartSize. - \param maxStartSize: Maximal initial start size of a particle. The - real size of every particle is calculated as random interpolation - between minStartSize and maxStartSize. - \return Pointer to the created particle emitter. To set this emitter - as new emitter of this particle system, just call setEmitter(). Note - that you'll have to drop() the returned pointer, after you don't need - it any more, see IReferenceCounted::drop() for more information. */ - virtual IParticleCylinderEmitter* createCylinderEmitter( - const core::vector3df& center, f32 radius, - const core::vector3df& normal, f32 length, - bool outlineOnly = false, - const core::vector3df& direction = core::vector3df(0.0f,0.03f,0.0f), - u32 minParticlesPerSecond = 5, u32 maxParticlesPerSecond = 10, - const video::SColor& minStartColor = video::SColor(255,0,0,0), - const video::SColor& maxStartColor = video::SColor(255,255,255,255), - u32 lifeTimeMin = 2000, u32 lifeTimeMax = 4000, - s32 maxAngleDegrees = 0, - const core::dimension2df& minStartSize = core::dimension2df(5.0f,5.0f), - const core::dimension2df& maxStartSize = core::dimension2df(5.0f,5.0f) ) = 0; - - //! Creates a mesh particle emitter. - /** \param mesh: Pointer to mesh to emit particles from - \param useNormalDirection: If true, the direction of each particle - created will be the normal of the vertex that it's emitting from. The - normal is divided by the normalDirectionModifier parameter, which - defaults to 100.0f. - \param direction: Direction and speed of particle emission. - \param normalDirectionModifier: If the emitter is using the normal - direction then the normal of the vertex that is being emitted from is - divided by this number. - \param mbNumber: This allows you to specify a specific meshBuffer for - the IMesh* to emit particles from. The default value is -1, which - means a random meshBuffer picked from all of the meshes meshBuffers - will be selected to pick a random vertex from. If the value is 0 or - greater, it will only pick random vertices from the meshBuffer - specified by this value. - \param everyMeshVertex: If true, the emitter will emit between min/max - particles every second, for every vertex in the mesh, if false, it will - emit between min/max particles from random vertices in the mesh. - \param minParticlesPerSecond: Minimal amount of particles emitted per - second. - \param maxParticlesPerSecond: Maximal amount of particles emitted per - second. - \param minStartColor: Minimal initial start color of a particle. The - real color of every particle is calculated as random interpolation - between minStartColor and maxStartColor. - \param maxStartColor: Maximal initial start color of a particle. The - real color of every particle is calculated as random interpolation - between minStartColor and maxStartColor. - \param lifeTimeMin: Minimal lifetime of a particle, in milliseconds. - \param lifeTimeMax: Maximal lifetime of a particle, in milliseconds. - \param maxAngleDegrees: Maximal angle in degrees, the emitting - direction of the particle will differ from the original direction. - \param minStartSize: Minimal initial start size of a particle. The - real size of every particle is calculated as random interpolation - between minStartSize and maxStartSize. - \param maxStartSize: Maximal initial start size of a particle. The - real size of every particle is calculated as random interpolation - between minStartSize and maxStartSize. - \return Pointer to the created particle emitter. To set this emitter - as new emitter of this particle system, just call setEmitter(). Note - that you'll have to drop() the returned pointer, after you don't need - it any more, see IReferenceCounted::drop() for more information. */ - virtual IParticleMeshEmitter* createMeshEmitter( - scene::IMesh* mesh, bool useNormalDirection = true, - const core::vector3df& direction = core::vector3df(0.0f,0.03f,0.0f), - f32 normalDirectionModifier = 100.0f, s32 mbNumber = -1, - bool everyMeshVertex = false, - u32 minParticlesPerSecond = 5, u32 maxParticlesPerSecond = 10, - const video::SColor& minStartColor = video::SColor(255,0,0,0), - const video::SColor& maxStartColor = video::SColor(255,255,255,255), - u32 lifeTimeMin = 2000, u32 lifeTimeMax = 4000, - s32 maxAngleDegrees = 0, - const core::dimension2df& minStartSize = core::dimension2df(5.0f,5.0f), - const core::dimension2df& maxStartSize = core::dimension2df(5.0f,5.0f) ) = 0; - - //! Creates a point particle emitter. - /** \param direction: Direction and speed of particle emission. - \param minParticlesPerSecond: Minimal amount of particles emitted per - second. - \param maxParticlesPerSecond: Maximal amount of particles emitted per - second. - \param minStartColor: Minimal initial start color of a particle. The - real color of every particle is calculated as random interpolation - between minStartColor and maxStartColor. - \param maxStartColor: Maximal initial start color of a particle. The - real color of every particle is calculated as random interpolation - between minStartColor and maxStartColor. - \param lifeTimeMin: Minimal lifetime of a particle, in milliseconds. - \param lifeTimeMax: Maximal lifetime of a particle, in milliseconds. - \param maxAngleDegrees: Maximal angle in degrees, the emitting - direction of the particle will differ from the original direction. - \param minStartSize: Minimal initial start size of a particle. The - real size of every particle is calculated as random interpolation - between minStartSize and maxStartSize. - \param maxStartSize: Maximal initial start size of a particle. The - real size of every particle is calculated as random interpolation - between minStartSize and maxStartSize. - \return Pointer to the created particle emitter. To set this emitter - as new emitter of this particle system, just call setEmitter(). Note - that you'll have to drop() the returned pointer, after you don't need - it any more, see IReferenceCounted::drop() for more information. */ - virtual IParticlePointEmitter* createPointEmitter( - const core::vector3df& direction = core::vector3df(0.0f,0.03f,0.0f), - u32 minParticlesPerSecond = 5, - u32 maxParticlesPerSecond = 10, - const video::SColor& minStartColor = video::SColor(255,0,0,0), - const video::SColor& maxStartColor = video::SColor(255,255,255,255), - u32 lifeTimeMin=2000, u32 lifeTimeMax=4000, - s32 maxAngleDegrees=0, - const core::dimension2df& minStartSize = core::dimension2df(5.0f,5.0f), - const core::dimension2df& maxStartSize = core::dimension2df(5.0f,5.0f) ) = 0; - - //! Creates a ring particle emitter. - /** \param center: Center of ring - \param radius: Distance of points from center, points will be rotated - around the Y axis at a random 360 degrees and will then be shifted by - the provided ringThickness values in each axis. - \param ringThickness : thickness of the ring or how wide the ring is - \param direction: Direction and speed of particle emission. - \param minParticlesPerSecond: Minimal amount of particles emitted per - second. - \param maxParticlesPerSecond: Maximal amount of particles emitted per - second. - \param minStartColor: Minimal initial start color of a particle. The - real color of every particle is calculated as random interpolation - between minStartColor and maxStartColor. - \param maxStartColor: Maximal initial start color of a particle. The - real color of every particle is calculated as random interpolation - between minStartColor and maxStartColor. - \param lifeTimeMin: Minimal lifetime of a particle, in milliseconds. - \param lifeTimeMax: Maximal lifetime of a particle, in milliseconds. - \param maxAngleDegrees: Maximal angle in degrees, the emitting - direction of the particle will differ from the original direction. - \param minStartSize: Minimal initial start size of a particle. The - real size of every particle is calculated as random interpolation - between minStartSize and maxStartSize. - \param maxStartSize: Maximal initial start size of a particle. The - real size of every particle is calculated as random interpolation - between minStartSize and maxStartSize. - \return Pointer to the created particle emitter. To set this emitter - as new emitter of this particle system, just call setEmitter(). Note - that you'll have to drop() the returned pointer, after you don't need - it any more, see IReferenceCounted::drop() for more information. */ - virtual IParticleRingEmitter* createRingEmitter( - const core::vector3df& center, f32 radius, f32 ringThickness, - const core::vector3df& direction = core::vector3df(0.0f,0.03f,0.0f), - u32 minParticlesPerSecond = 5, - u32 maxParticlesPerSecond = 10, - const video::SColor& minStartColor = video::SColor(255,0,0,0), - const video::SColor& maxStartColor = video::SColor(255,255,255,255), - u32 lifeTimeMin=2000, u32 lifeTimeMax=4000, - s32 maxAngleDegrees=0, - const core::dimension2df& minStartSize = core::dimension2df(5.0f,5.0f), - const core::dimension2df& maxStartSize = core::dimension2df(5.0f,5.0f) ) = 0; - - //! Creates a sphere particle emitter. - /** \param center: Center of sphere - \param radius: Radius of sphere - \param direction: Direction and speed of particle emission. - \param minParticlesPerSecond: Minimal amount of particles emitted per - second. - \param maxParticlesPerSecond: Maximal amount of particles emitted per - second. - \param minStartColor: Minimal initial start color of a particle. The - real color of every particle is calculated as random interpolation - between minStartColor and maxStartColor. - \param maxStartColor: Maximal initial start color of a particle. The - real color of every particle is calculated as random interpolation - between minStartColor and maxStartColor. - \param lifeTimeMin: Minimal lifetime of a particle, in milliseconds. - \param lifeTimeMax: Maximal lifetime of a particle, in milliseconds. - \param maxAngleDegrees: Maximal angle in degrees, the emitting - direction of the particle will differ from the original direction. - \param minStartSize: Minimal initial start size of a particle. The - real size of every particle is calculated as random interpolation - between minStartSize and maxStartSize. - \param maxStartSize: Maximal initial start size of a particle. The - real size of every particle is calculated as random interpolation - between minStartSize and maxStartSize. - \return Pointer to the created particle emitter. To set this emitter - as new emitter of this particle system, just call setEmitter(). Note - that you'll have to drop() the returned pointer, after you don't need - it any more, see IReferenceCounted::drop() for more information. */ - virtual IParticleSphereEmitter* createSphereEmitter( - const core::vector3df& center, f32 radius, - const core::vector3df& direction = core::vector3df(0.0f,0.03f,0.0f), - u32 minParticlesPerSecond = 5, - u32 maxParticlesPerSecond = 10, - const video::SColor& minStartColor = video::SColor(255,0,0,0), - const video::SColor& maxStartColor = video::SColor(255,255,255,255), - u32 lifeTimeMin=2000, u32 lifeTimeMax=4000, - s32 maxAngleDegrees=0, - const core::dimension2df& minStartSize = core::dimension2df(5.0f,5.0f), - const core::dimension2df& maxStartSize = core::dimension2df(5.0f,5.0f) ) = 0; - - //! Creates a point attraction affector. - /** This affector modifies the positions of the particles and attracts - them to a specified point at a specified speed per second. - \param point: Point to attract particles to. - \param speed: Speed in units per second, to attract to the specified - point. - \param attract: Whether the particles attract or detract from this - point. - \param affectX: Whether or not this will affect the X position of the - particle. - \param affectY: Whether or not this will affect the Y position of the - particle. - \param affectZ: Whether or not this will affect the Z position of the - particle. - \return Pointer to the created particle affector. To add this affector - as new affector of this particle system, just call addAffector(). Note - that you'll have to drop() the returned pointer, after you don't need - it any more, see IReferenceCounted::drop() for more information. */ - virtual IParticleAttractionAffector* createAttractionAffector( - const core::vector3df& point, f32 speed = 1.0f, bool attract = true, - bool affectX = true, bool affectY = true, bool affectZ = true) = 0; - - //! Creates a scale particle affector. - /** This affector scales the particle to the a multiple of its size defined - by the scaleTo variable. - \param scaleTo: multiple of the size which the particle will be scaled to until deletion - \return Pointer to the created particle affector. - To add this affector as new affector of this particle system, - just call addAffector(). Note that you'll have to drop() the - returned pointer, after you don't need it any more, see - IReferenceCounted::drop() for more information. */ - virtual IParticleAffector* createScaleParticleAffector(const core::dimension2df& scaleTo = core::dimension2df(1.0f, 1.0f)) = 0; - - //! Creates a fade out particle affector. - /** This affector modifies the color of every particle and and reaches - the final color when the particle dies. This affector looks really - good, if the EMT_TRANSPARENT_ADD_COLOR material is used and the - targetColor is video::SColor(0,0,0,0): Particles are fading out into - void with this setting. - \param targetColor: Color whereto the color of the particle is changed. - \param timeNeededToFadeOut: How much time in milliseconds should the - affector need to change the color to the targetColor. - \return Pointer to the created particle affector. To add this affector - as new affector of this particle system, just call addAffector(). Note - that you'll have to drop() the returned pointer, after you don't need - it any more, see IReferenceCounted::drop() for more information. */ - virtual IParticleFadeOutAffector* createFadeOutParticleAffector( - const video::SColor& targetColor = video::SColor(0,0,0,0), - u32 timeNeededToFadeOut = 1000) = 0; - - //! Creates a gravity affector. - /** This affector modifies the direction of the particle. It assumes - that the particle is fired out of the emitter with huge force, but is - loosing this after some time and is caught by the gravity then. This - affector is ideal for creating things like fountains. - \param gravity: Direction and force of gravity. - \param timeForceLost: Time in milliseconds when the force of the - emitter is totally lost and the particle does not move any more. This - is the time where gravity fully affects the particle. - \return Pointer to the created particle affector. To add this affector - as new affector of this particle system, just call addAffector(). Note - that you'll have to drop() the returned pointer, after you don't need - it any more, see IReferenceCounted::drop() for more information. */ - virtual IParticleGravityAffector* createGravityAffector( - const core::vector3df& gravity = core::vector3df(0.0f,-0.03f,0.0f), - u32 timeForceLost = 1000) = 0; - - //! Creates a rotation affector. - /** This affector modifies the positions of the particles and attracts - them to a specified point at a specified speed per second. - \param speed: Rotation in degrees per second - \param pivotPoint: Point to rotate the particles around - \return Pointer to the created particle affector. To add this affector - as new affector of this particle system, just call addAffector(). Note - that you'll have to drop() the returned pointer, after you don't need - it any more, see IReferenceCounted::drop() for more information. */ - virtual IParticleRotationAffector* createRotationAffector( - const core::vector3df& speed = core::vector3df(5.0f,5.0f,5.0f), - const core::vector3df& pivotPoint = core::vector3df(0.0f,0.0f,0.0f) ) = 0; - - //! Writes attributes of the scene node. - virtual void serializeAttributes(io::IAttributes* out, io::SAttributeReadWriteOptions* options) const _IRR_OVERRIDE_ - { - out->addInt("ParticleBehavior", ParticleBehavior); - } - - //! Reads attributes of the scene node. - virtual void deserializeAttributes(io::IAttributes* in, io::SAttributeReadWriteOptions* options) _IRR_OVERRIDE_ - { - ParticleBehavior = in->getAttributeAsInt("ParticleBehavior", ParticleBehavior); - } - -protected: - s32 ParticleBehavior; -}; - -} // end namespace scene -} // end namespace irr - -#endif diff --git a/include/IQ3LevelMesh.h b/include/IQ3LevelMesh.h deleted file mode 100644 index 62feffc6..00000000 --- a/include/IQ3LevelMesh.h +++ /dev/null @@ -1,46 +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_Q3_LEVEL_MESH_H_INCLUDED__ -#define __I_Q3_LEVEL_MESH_H_INCLUDED__ - -#include "IAnimatedMesh.h" -#include "IQ3Shader.h" - -namespace irr -{ -namespace scene -{ - //! Interface for a Mesh which can be loaded directly from a Quake3 .bsp-file. - /** The Mesh tries to load all textures of the map.*/ - class IQ3LevelMesh : public IAnimatedMesh - { - public: - - //! loads the shader definition from file - /** \param filename Name of the shaderfile, defaults to /scripts if fileNameIsValid is false. - \param fileNameIsValid Specifies whether the filename is valid in the current situation. */ - virtual const quake3::IShader* getShader( const c8* filename, bool fileNameIsValid=true ) = 0; - - //! returns a already loaded Shader - virtual const quake3::IShader* getShader(u32 index) const = 0; - - //! get's an interface to the entities - virtual quake3::tQ3EntityList& getEntityList() = 0; - - //! returns the requested brush entity - /** \param num The number from the model key of the entity. - - Use this interface if you parse the entities yourself.*/ - virtual IMesh* getBrushEntityMesh(s32 num) const = 0; - - //! returns the requested brush entity - virtual IMesh* getBrushEntityMesh(quake3::IEntity &ent) const = 0; - }; - -} // end namespace scene -} // end namespace irr - -#endif - diff --git a/include/IQ3Shader.h b/include/IQ3Shader.h deleted file mode 100644 index bcdb4d5b..00000000 --- a/include/IQ3Shader.h +++ /dev/null @@ -1,875 +0,0 @@ -// Copyright (C) 2006-2012 Nikolaus Gebhardt / Thomas Alten -// This file is part of the "Irrlicht Engine". -// For conditions of distribution and use, see copyright notice in irrlicht.h - -#ifndef __I_Q3_LEVEL_SHADER_H_INCLUDED__ -#define __I_Q3_LEVEL_SHADER_H_INCLUDED__ - -#include "irrArray.h" -#include "fast_atof.h" -#include "IFileSystem.h" -#include "IVideoDriver.h" -#include "coreutil.h" - -namespace irr -{ -namespace scene -{ -namespace quake3 -{ - - static core::stringc irrEmptyStringc(""); - - //! Hold the different Mesh Types used for getMesh - enum eQ3MeshIndex - { - E_Q3_MESH_GEOMETRY = 0, - E_Q3_MESH_ITEMS, - E_Q3_MESH_BILLBOARD, - E_Q3_MESH_FOG, - E_Q3_MESH_UNRESOLVED, - E_Q3_MESH_SIZE - }; - - /*! used to customize Quake3 BSP Loader - */ - - struct Q3LevelLoadParameter - { - Q3LevelLoadParameter () - :defaultLightMapMaterial ( video::EMT_LIGHTMAP_M4 ), - defaultModulate ( video::EMFN_MODULATE_4X ), - defaultFilter ( video::EMF_BILINEAR_FILTER ), - patchTesselation ( 8 ), - verbose ( 0 ), - startTime ( 0 ), endTime ( 0 ), - mergeShaderBuffer ( 1 ), - cleanUnResolvedMeshes ( 1 ), - loadAllShaders ( 0 ), - loadSkyShader ( 0 ), - alpharef ( 1 ), - swapLump ( 0 ), - #ifdef __BIG_ENDIAN__ - swapHeader ( 1 ) - #else - swapHeader ( 0 ) - #endif - { - memcpy ( scriptDir, "scripts\x0", 8 ); - } - - video::E_MATERIAL_TYPE defaultLightMapMaterial; - video::E_MODULATE_FUNC defaultModulate; - video::E_MATERIAL_FLAG defaultFilter; - s32 patchTesselation; - s32 verbose; - u32 startTime; - u32 endTime; - s32 mergeShaderBuffer; - s32 cleanUnResolvedMeshes; - s32 loadAllShaders; - s32 loadSkyShader; - s32 alpharef; - s32 swapLump; - s32 swapHeader; - c8 scriptDir [ 64 ]; - }; - - // some useful typedefs - typedef core::array< core::stringc > tStringList; - typedef core::array< video::ITexture* > tTexArray; - - // string helper.. TODO: move to generic files - inline s16 isEqual ( const core::stringc &string, u32 &pos, const c8 * const list[], u16 listSize ) - { - const char * in = string.c_str () + pos; - - for ( u16 i = 0; i != listSize; ++i ) - { - if (string.size() < pos) - return -2; - u32 len = (u32) strlen ( list[i] ); - if (string.size() < pos+len) - continue; - if ( in [len] != 0 && in [len] != ' ' ) - continue; - if ( strncmp ( in, list[i], len ) ) - continue; - - pos += len + 1; - return (s16) i; - } - return -2; - } - - inline f32 getAsFloat ( const core::stringc &string, u32 &pos ) - { - const char * in = string.c_str () + pos; - - f32 value = 0.f; - pos += (u32) ( core::fast_atof_move ( in, value ) - in ) + 1; - return value; - } - - //! get a quake3 vector translated to irrlicht position (x,-z,y ) - inline core::vector3df getAsVector3df ( const core::stringc &string, u32 &pos ) - { - core::vector3df v; - - v.X = getAsFloat ( string, pos ); - v.Z = getAsFloat ( string, pos ); - v.Y = getAsFloat ( string, pos ); - - return v; - } - - - /* - extract substrings - */ - inline void getAsStringList ( tStringList &list, s32 max, const core::stringc &string, u32 &startPos ) - { - list.clear (); - - s32 finish = 0; - s32 endPos; - do - { - endPos = string.findNext ( ' ', startPos ); - if ( endPos == -1 ) - { - finish = 1; - endPos = string.size(); - } - - list.push_back ( string.subString ( startPos, endPos - startPos ) ); - startPos = endPos + 1; - - if ( list.size() >= (u32) max ) - finish = 1; - - } while ( !finish ); - - } - - //! A blend function for a q3 shader. - struct SBlendFunc - { - SBlendFunc ( video::E_MODULATE_FUNC mod ) - : type ( video::EMT_SOLID ), modulate ( mod ), - param0( 0.f ), - isTransparent ( 0 ) {} - - video::E_MATERIAL_TYPE type; - video::E_MODULATE_FUNC modulate; - - f32 param0; - u32 isTransparent; - }; - - // parses the content of Variable cull - inline bool getCullingFunction ( const core::stringc &cull ) - { - if ( cull.size() == 0 ) - return true; - - bool ret = true; - static const c8 * funclist[] = { "none", "disable", "twosided" }; - - u32 pos = 0; - switch ( isEqual ( cull, pos, funclist, 3 ) ) - { - case 0: - case 1: - case 2: - ret = false; - break; - } - return ret; - } - - // parses the content of Variable depthfunc - // return a z-test - inline u8 getDepthFunction ( const core::stringc &string ) - { - u8 ret = video::ECFN_LESSEQUAL; - - if ( string.size() == 0 ) - return ret; - - static const c8 * funclist[] = { "lequal","equal" }; - - u32 pos = 0; - switch ( isEqual ( string, pos, funclist, 2 ) ) - { - case 0: - ret = video::ECFN_LESSEQUAL; - break; - case 1: - ret = video::ECFN_EQUAL; - break; - } - return ret; - } - - - /*! - parses the content of Variable blendfunc,alphafunc - it also make a hint for rendering as transparent or solid node. - - we assume a typical quake scene would look like this.. - 1) Big Static Mesh ( solid ) - 2) static scene item ( may use transparency ) but rendered in the solid pass - 3) additional transparency item in the transparent pass - - it's not 100% accurate! it just empirical.. - */ - inline static void getBlendFunc ( const core::stringc &string, SBlendFunc &blendfunc ) - { - if ( string.size() == 0 ) - return; - - // maps to E_BLEND_FACTOR - static const c8 * funclist[] = - { - "gl_zero", - "gl_one", - "gl_dst_color", - "gl_one_minus_dst_color", - "gl_src_color", - "gl_one_minus_src_color", - "gl_src_alpha", - "gl_one_minus_src_alpha", - "gl_dst_alpha", - "gl_one_minus_dst_alpha", - "gl_src_alpha_sat", - - "add", - "filter", - "blend", - - "ge128", - "gt0", - }; - - - u32 pos = 0; - s32 srcFact = isEqual ( string, pos, funclist, 16 ); - - if ( srcFact < 0 ) - return; - - u32 resolved = 0; - s32 dstFact = isEqual ( string, pos, funclist, 16 ); - - switch ( srcFact ) - { - case video::EBF_ZERO: - switch ( dstFact ) - { - // gl_zero gl_src_color == gl_dst_color gl_zero - case video::EBF_SRC_COLOR: - blendfunc.type = video::EMT_ONETEXTURE_BLEND; - blendfunc.param0 = video::pack_textureBlendFunc ( video::EBF_DST_COLOR, video::EBF_ZERO, blendfunc.modulate ); - blendfunc.isTransparent = 1; - resolved = 1; - break; - } break; - - case video::EBF_ONE: - switch ( dstFact ) - { - // gl_one gl_zero - case video::EBF_ZERO: - blendfunc.type = video::EMT_SOLID; - blendfunc.isTransparent = 0; - resolved = 1; - break; - - // gl_one gl_one - case video::EBF_ONE: - blendfunc.type = video::EMT_TRANSPARENT_ADD_COLOR; - blendfunc.isTransparent = 1; - resolved = 1; - break; - } break; - - case video::EBF_SRC_ALPHA: - switch ( dstFact ) - { - // gl_src_alpha gl_one_minus_src_alpha - case video::EBF_ONE_MINUS_SRC_ALPHA: - blendfunc.type = video::EMT_TRANSPARENT_ALPHA_CHANNEL; - blendfunc.param0 = 1.f/255.f; - blendfunc.isTransparent = 1; - resolved = 1; - break; - } break; - - case 11: - // add - blendfunc.type = video::EMT_TRANSPARENT_ADD_COLOR; - blendfunc.isTransparent = 1; - resolved = 1; - break; - case 12: - // filter = gl_dst_color gl_zero or gl_zero gl_src_color - blendfunc.type = video::EMT_ONETEXTURE_BLEND; - blendfunc.param0 = video::pack_textureBlendFunc ( video::EBF_DST_COLOR, video::EBF_ZERO, blendfunc.modulate ); - blendfunc.isTransparent = 1; - resolved = 1; - break; - case 13: - // blend = gl_src_alpha gl_one_minus_src_alpha - blendfunc.type = video::EMT_TRANSPARENT_ALPHA_CHANNEL; - blendfunc.param0 = 1.f/255.f; - blendfunc.isTransparent = 1; - resolved = 1; - break; - case 14: - // alphafunc ge128 - blendfunc.type = video::EMT_TRANSPARENT_ALPHA_CHANNEL; - blendfunc.param0 = 0.5f; - blendfunc.isTransparent = 1; - resolved = 1; - break; - case 15: - // alphafunc gt0 - blendfunc.type = video::EMT_TRANSPARENT_ALPHA_CHANNEL; - blendfunc.param0 = 1.f / 255.f; - blendfunc.isTransparent = 1; - resolved = 1; - break; - - } - - // use the generic blender - if ( 0 == resolved ) - { - blendfunc.type = video::EMT_ONETEXTURE_BLEND; - blendfunc.param0 = video::pack_textureBlendFunc ( - (video::E_BLEND_FACTOR) srcFact, - (video::E_BLEND_FACTOR) dstFact, - blendfunc.modulate); - - blendfunc.isTransparent = 1; - } - } - - // random noise [-1;1] - struct Noiser - { - static f32 get () - { - static u32 RandomSeed = 0x69666966; - RandomSeed = (RandomSeed * 3631 + 1); - - f32 value = ( (f32) (RandomSeed & 0x7FFF ) * (1.0f / (f32)(0x7FFF >> 1) ) ) - 1.f; - return value; - } - }; - - enum eQ3ModifierFunction - { - TCMOD = 0, - DEFORMVERTEXES = 1, - RGBGEN = 2, - TCGEN = 3, - MAP = 4, - ALPHAGEN = 5, - - FUNCTION2 = 0x10, - SCROLL = FUNCTION2 + 1, - SCALE = FUNCTION2 + 2, - ROTATE = FUNCTION2 + 3, - STRETCH = FUNCTION2 + 4, - TURBULENCE = FUNCTION2 + 5, - WAVE = FUNCTION2 + 6, - - IDENTITY = FUNCTION2 + 7, - VERTEX = FUNCTION2 + 8, - TEXTURE = FUNCTION2 + 9, - LIGHTMAP = FUNCTION2 + 10, - ENVIRONMENT = FUNCTION2 + 11, - DOLLAR_LIGHTMAP = FUNCTION2 + 12, - BULGE = FUNCTION2 + 13, - AUTOSPRITE = FUNCTION2 + 14, - AUTOSPRITE2 = FUNCTION2 + 15, - TRANSFORM = FUNCTION2 + 16, - EXACTVERTEX = FUNCTION2 + 17, - CONSTANT = FUNCTION2 + 18, - LIGHTINGSPECULAR = FUNCTION2 + 19, - MOVE = FUNCTION2 + 20, - NORMAL = FUNCTION2 + 21, - IDENTITYLIGHTING = FUNCTION2 + 22, - - WAVE_MODIFIER_FUNCTION = 0x30, - SINUS = WAVE_MODIFIER_FUNCTION + 1, - COSINUS = WAVE_MODIFIER_FUNCTION + 2, - SQUARE = WAVE_MODIFIER_FUNCTION + 3, - TRIANGLE = WAVE_MODIFIER_FUNCTION + 4, - SAWTOOTH = WAVE_MODIFIER_FUNCTION + 5, - SAWTOOTH_INVERSE = WAVE_MODIFIER_FUNCTION + 6, - NOISE = WAVE_MODIFIER_FUNCTION + 7, - - UNKNOWN = -2 - }; - - struct SModifierFunction - { - SModifierFunction () - : masterfunc0 ( UNKNOWN ), masterfunc1( UNKNOWN ), func ( SINUS ), - tcgen( TEXTURE ), rgbgen ( IDENTITY ), alphagen ( UNKNOWN ), - base ( 0 ), amp ( 1 ), phase ( 0 ), frequency ( 1 ), - wave ( 1 ), - x ( 0 ), y ( 0 ), z( 0 ), count( 0 ) {} - - // "tcmod","deformvertexes","rgbgen", "tcgen" - eQ3ModifierFunction masterfunc0; - // depends - eQ3ModifierFunction masterfunc1; - // depends - eQ3ModifierFunction func; - - eQ3ModifierFunction tcgen; - eQ3ModifierFunction rgbgen; - eQ3ModifierFunction alphagen; - - union - { - f32 base; - f32 bulgewidth; - }; - - union - { - f32 amp; - f32 bulgeheight; - }; - - f32 phase; - - union - { - f32 frequency; - f32 bulgespeed; - }; - - union - { - f32 wave; - f32 div; - }; - - f32 x; - f32 y; - f32 z; - u32 count; - - f32 evaluate ( f32 dt ) const - { - // phase in 0 and 1.. - f32 x = core::fract( (dt + phase ) * frequency ); - f32 y = 0.f; - - switch ( func ) - { - case SINUS: - y = sinf ( x * core::PI * 2.f ); - break; - case COSINUS: - y = cosf ( x * core::PI * 2.f ); - break; - case SQUARE: - y = x < 0.5f ? 1.f : -1.f; - break; - case TRIANGLE: - y = x < 0.5f ? ( 4.f * x ) - 1.f : ( -4.f * x ) + 3.f; - break; - case SAWTOOTH: - y = x; - break; - case SAWTOOTH_INVERSE: - y = 1.f - x; - break; - case NOISE: - y = Noiser::get(); - break; - default: - break; - } - - return base + ( y * amp ); - } - - - }; - - inline core::vector3df getMD3Normal ( u32 i, u32 j ) - { - const f32 lng = i * 2.0f * core::PI / 255.0f; - const f32 lat = j * 2.0f * core::PI / 255.0f; - return core::vector3df(cosf ( lat ) * sinf ( lng ), - sinf ( lat ) * sinf ( lng ), - cosf ( lng )); - } - - // - inline void getModifierFunc ( SModifierFunction& fill, const core::stringc &string, u32 &pos ) - { - if ( string.size() == 0 ) - return; - - static const c8 * funclist[] = - { - "sin","cos","square", - "triangle", "sawtooth","inversesawtooth", "noise" - }; - - fill.func = (eQ3ModifierFunction) isEqual ( string,pos, funclist,7 ); - fill.func = fill.func == UNKNOWN ? SINUS : (eQ3ModifierFunction) ((u32) fill.func + WAVE_MODIFIER_FUNCTION + 1); - - fill.base = getAsFloat ( string, pos ); - fill.amp = getAsFloat ( string, pos ); - fill.phase = getAsFloat ( string, pos ); - fill.frequency = getAsFloat ( string, pos ); - } - - - // name = "a b c .." - struct SVariable - { - core::stringc name; - core::stringc content; - - SVariable ( const c8 * n, const c8 *c = 0 ) : name ( n ), content (c) {} - virtual ~SVariable () {} - - void clear () - { - name = ""; - content = ""; - } - - s32 isValid () const - { - return name.size(); - } - - bool operator == ( const SVariable &other ) const - { - return 0 == strcmp ( name.c_str(), other.name.c_str () ); - } - - bool operator < ( const SVariable &other ) const - { - return 0 > strcmp ( name.c_str(), other.name.c_str () ); - } - - }; - - - // string database. "a" = "Hello", "b" = "1234.6" - struct SVarGroup - { - SVarGroup () { Variable.setAllocStrategy ( core::ALLOC_STRATEGY_SAFE ); } - virtual ~SVarGroup () {} - - u32 isDefined ( const c8 * name, const c8 * content = 0 ) const - { - for ( u32 i = 0; i != Variable.size (); ++i ) - { - if ( 0 == strcmp ( Variable[i].name.c_str(), name ) && - ( 0 == content || strstr ( Variable[i].content.c_str(), content ) ) - ) - { - return i + 1; - } - } - return 0; - } - - // searches for Variable name and returns is content - // if Variable is not found a reference to an Empty String is returned - const core::stringc &get( const c8 * name ) const - { - SVariable search ( name ); - s32 index = Variable.linear_search ( search ); - if ( index < 0 ) - return irrEmptyStringc; - - return Variable [ index ].content; - } - - // set the Variable name - void set ( const c8 * name, const c8 * content = 0 ) - { - u32 index = isDefined ( name, 0 ); - if ( 0 == index ) - { - Variable.push_back ( SVariable ( name, content ) ); - } - else - { - Variable [ index ].content = content; - } - } - - - core::array < SVariable > Variable; - }; - - //! holding a group a variable - struct SVarGroupList: public IReferenceCounted - { - SVarGroupList () - { - VariableGroup.setAllocStrategy ( core::ALLOC_STRATEGY_SAFE ); - } - virtual ~SVarGroupList () {} - - core::array < SVarGroup > VariableGroup; - }; - - - //! A Parsed Shader Holding Variables ordered in Groups - struct IShader - { - IShader () - : ID ( 0 ), VarGroup ( 0 ) {} - virtual ~IShader () {} - - bool operator == (const IShader &other ) const - { - return 0 == strcmp ( name.c_str(), other.name.c_str () ); - //return name == other.name; - } - - bool operator < (const IShader &other ) const - { - return strcmp ( name.c_str(), other.name.c_str () ) < 0; - //return name < other.name; - } - - u32 getGroupSize () const - { - if ( 0 == VarGroup ) - return 0; - return VarGroup->VariableGroup.size (); - } - - const SVarGroup * getGroup ( u32 stage ) const - { - if ( 0 == VarGroup || stage >= VarGroup->VariableGroup.size () ) - return 0; - - return &VarGroup->VariableGroup [ stage ]; - } - - // id - s32 ID; - SVarGroupList *VarGroup; // reference - - // Shader: shader name ( also first variable in first Vargroup ) - // Entity: classname ( variable in Group(1) ) - core::stringc name; - }; - - typedef IShader IEntity; - - typedef core::array < IEntity > tQ3EntityList; - - /* - dump shader like original layout, regardless of internal data holding - no recursive folding.. - */ - inline void dumpVarGroup ( core::stringc &dest, const SVarGroup * group, s32 stack ) - { - core::stringc buf; - - if ( stack > 0 ) - { - buf = ""; - for (s32 i = 0; i < stack - 1; ++i ) - buf += '\t'; - - buf += "{\n"; - dest.append ( buf ); - } - - for ( u32 g = 0; g != group->Variable.size(); ++g ) - { - buf = ""; - for (s32 i = 0; i < stack; ++i ) - buf += '\t'; - - buf += group->Variable[g].name; - buf += " "; - buf += group->Variable[g].content; - buf += "\n"; - dest.append ( buf ); - } - - if ( stack > 1 ) - { - buf = ""; - for (s32 i = 0; i < stack - 1; ++i ) - buf += '\t'; - - buf += "}\n"; - dest.append ( buf ); - } - } - - /*! - dump a Shader or an Entity - */ - inline core::stringc & dumpShader ( core::stringc &dest, const IShader * shader, bool entity = false ) - { - if ( 0 == shader ) - return dest; - - const u32 size = shader->VarGroup->VariableGroup.size (); - for ( u32 i = 0; i != size; ++i ) - { - const SVarGroup * group = &shader->VarGroup->VariableGroup[ i ]; - dumpVarGroup ( dest, group, core::clamp( (int)i, 0, 2 ) ); - } - - if ( !entity ) - { - if ( size <= 1 ) - { - dest.append ( "{\n" ); - } - dest.append ( "}\n" ); - } - return dest; - } - - - /* - quake3 doesn't care much about tga & jpg - load one or multiple files stored in name started at startPos to the texture array textures - if texture is not loaded 0 will be added ( to find missing textures easier) - */ - inline void getTextures(tTexArray &textures, - const core::stringc &name, u32 &startPos, - const io::IFileSystem *fileSystem, - video::IVideoDriver* driver) - { - static const char * const extension[] = - { - ".jpg", - ".jpeg", - ".png", - ".dds", - ".tga", - ".bmp", - ".pcx" - }; - - tStringList stringList; - getAsStringList(stringList, -1, name, startPos); - - textures.clear(); - - io::path loadFile; - for ( u32 i = 0; i!= stringList.size (); ++i ) - { - video::ITexture* texture = 0; - for (u32 g = 0; g != 7; ++g) - { - core::cutFilenameExtension ( loadFile, stringList[i] ); - - if ( loadFile == "$whiteimage" ) - { - texture = driver->getTexture( "$whiteimage" ); - if ( 0 == texture ) - { - core::dimension2du s ( 2, 2 ); - u32 image[4] = { 0xFFFFFFFF, 0xFFFFFFFF,0xFFFFFFFF,0xFFFFFFFF }; - video::IImage* w = driver->createImageFromData ( video::ECF_A8R8G8B8, s,&image ); - texture = driver->addTexture( "$whiteimage", w ); - w->drop (); - } - - } - else - if ( loadFile == "$redimage" ) - { - texture = driver->getTexture( "$redimage" ); - if ( 0 == texture ) - { - core::dimension2du s ( 2, 2 ); - u32 image[4] = { 0xFFFF0000, 0xFFFF0000,0xFFFF0000,0xFFFF0000 }; - video::IImage* w = driver->createImageFromData ( video::ECF_A8R8G8B8, s,&image ); - texture = driver->addTexture( "$redimage", w ); - w->drop (); - } - } - else - if ( loadFile == "$blueimage" ) - { - texture = driver->getTexture( "$blueimage" ); - if ( 0 == texture ) - { - core::dimension2du s ( 2, 2 ); - u32 image[4] = { 0xFF0000FF, 0xFF0000FF,0xFF0000FF,0xFF0000FF }; - video::IImage* w = driver->createImageFromData ( video::ECF_A8R8G8B8, s,&image ); - texture = driver->addTexture( "$blueimage", w ); - w->drop (); - } - } - else - if ( loadFile == "$checkerimage" ) - { - texture = driver->getTexture( "$checkerimage" ); - if ( 0 == texture ) - { - core::dimension2du s ( 2, 2 ); - u32 image[4] = { 0xFFFFFFFF, 0xFF000000,0xFF000000,0xFFFFFFFF }; - video::IImage* w = driver->createImageFromData ( video::ECF_A8R8G8B8, s,&image ); - texture = driver->addTexture( "$checkerimage", w ); - w->drop (); - } - } - else - if ( loadFile == "$lightmap" ) - { - texture = 0; - } - else - { - loadFile.append ( extension[g] ); - } - - texture = driver->findTexture( loadFile ); - if ( texture ) - break; - - if ( fileSystem->existFile ( loadFile ) ) - { - texture = driver->getTexture( loadFile ); - if ( texture ) - break; - texture = 0; - } - } - // take 0 Texture - textures.push_back(texture); - } - } - - - //! Manages various Quake3 Shader Styles - class IShaderManager : public IReferenceCounted - { - }; - -} // end namespace quake3 -} // end namespace scene -} // end namespace irr - -#endif - diff --git a/include/ISceneCollisionManager.h b/include/ISceneCollisionManager.h deleted file mode 100644 index ccfe8639..00000000 --- a/include/ISceneCollisionManager.h +++ /dev/null @@ -1,284 +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_SCENE_COLLISION_MANAGER_H_INCLUDED__ -#define __I_SCENE_COLLISION_MANAGER_H_INCLUDED__ - -#include "IReferenceCounted.h" -#include "vector3d.h" -#include "triangle3d.h" -#include "position2d.h" -#include "line3d.h" - -namespace irr -{ - -namespace scene -{ - class ISceneNode; - class ICameraSceneNode; - class ITriangleSelector; - class IMeshBuffer; - - struct SCollisionHit - { - //! Point of collision - core::vector3df Intersection; - - //! Triangle with which we collided - core::triangle3df Triangle; - - //! Triangle selector which contained the colliding triangle (useful when having MetaTriangleSelector) - ITriangleSelector* TriangleSelector; - - //! Node which contained the triangle (is 0 when selector doesn't have that information) - ISceneNode* Node; - - //! Meshbuffer which contained the triangle (is 0 when the selector doesn't have that information, only works when selectors are created per meshbuffer) - const IMeshBuffer* MeshBuffer; - - //! Index of selected material of the triangle in the SceneNode. Usually only valid when MeshBuffer is also set, otherwise always 0 - irr::u32 MaterialIndex; - - SCollisionHit() : TriangleSelector(0), Node(0), MeshBuffer(0), MaterialIndex(0) - {} - }; - - //! The Scene Collision Manager provides methods for performing collision tests and picking on scene nodes. - class ISceneCollisionManager : public virtual IReferenceCounted - { - public: - - //! Finds the nearest collision point of a line and lots of triangles, if there is one. - /** \param hitResult: Contains collision result when there was a collision detected. - \param ray: Line with which collisions are tested. - \param selector: TriangleSelector to be used for the collision check. - \return true if a collision was detected and false if not. */ - virtual bool getCollisionPoint(SCollisionHit& hitResult, const core::line3d& ray, - ITriangleSelector* selector) = 0; - - //! Finds the nearest collision point of a line and lots of triangles, if there is one. - /** \param ray: Line with which collisions are tested. - \param selector: TriangleSelector containing the triangles. It - can be created for example using - ISceneManager::createTriangleSelector() or - ISceneManager::createTriangleOctreeSelector(). - \param outCollisionPoint: If a collision is detected, this will - contain the position of the nearest collision to the line-start. - \param outTriangle: If a collision is detected, this will - contain the triangle with which the ray collided. - \param outNode: If a collision is detected, this will contain - the scene node associated with the triangle that was hit. - \return True if a collision was detected and false if not. */ - virtual bool getCollisionPoint(const core::line3d& ray, - ITriangleSelector* selector, core::vector3df& outCollisionPoint, - core::triangle3df& outTriangle, ISceneNode*& outNode) - { - SCollisionHit hitResult; - if ( getCollisionPoint(hitResult, ray, selector) ) - { - outCollisionPoint = hitResult.Intersection; - outTriangle = hitResult.Triangle; - outNode = hitResult.Node; - return true; - } - return false; - } - - //! Collides a moving ellipsoid with a 3d world with gravity and returns the resulting new position of the ellipsoid. - /** This can be used for moving a character in a 3d world: The - character will slide at walls and is able to walk up stairs. - The method used how to calculate the collision result position - is based on the paper "Improved Collision detection and - Response" by Kasper Fauerby. - \param selector: TriangleSelector containing the triangles of - the world. It can be created for example using - ISceneManager::createTriangleSelector() or - ISceneManager::createTriangleOctreeSelector(). - \param ellipsoidPosition: Position of the ellipsoid. - \param ellipsoidRadius: Radius of the ellipsoid. - \param ellipsoidDirectionAndSpeed: Direction and speed of the - movement of the ellipsoid. - \param triout: Optional parameter where the last triangle - causing a collision is stored, if there is a collision. - \param hitPosition: Return value for the position of the collision - \param outFalling: Is set to true if the ellipsoid is falling - down, caused by gravity. - \param outNode: the node with which the ellipsoid collided (if any) - \param slidingSpeed: DOCUMENTATION NEEDED. - \param gravityDirectionAndSpeed: Direction and force of gravity. - \return New position of the ellipsoid. */ - virtual core::vector3df getCollisionResultPosition( - ITriangleSelector* selector, - const core::vector3df &ellipsoidPosition, - const core::vector3df& ellipsoidRadius, - const core::vector3df& ellipsoidDirectionAndSpeed, - core::triangle3df& triout, - core::vector3df& hitPosition, - bool& outFalling, - ISceneNode*& outNode, - f32 slidingSpeed = 0.0005f, - const core::vector3df& gravityDirectionAndSpeed - = core::vector3df(0.0f, 0.0f, 0.0f)) = 0; - - //! Returns a 3d ray which would go through the 2d screen coordinates. - /** \param pos: Screen coordinates in pixels. - \param camera: Camera from which the ray starts. If null, the - active camera is used. - \return Ray starting from the position of the camera and ending - at a length of the far value of the camera at a position which - would be behind the 2d screen coordinates. */ - virtual core::line3d getRayFromScreenCoordinates( - const core::position2d& pos, const ICameraSceneNode* camera = 0) = 0; - - //! Calculates 2d screen position from a 3d position. - /** \param pos: 3D position in world space to be transformed - into 2d. - \param camera: Camera to be used. If null, the currently active - camera is used. - \param useViewPort: Calculate screen coordinates relative to - the current view port. Please note that unless the driver does - not take care of the view port, it is usually best to get the - result in absolute screen coordinates (flag=false). - \return 2d screen coordinates which a object in the 3d world - would have if it would be rendered to the screen. If the 3d - position is behind the camera, it is set to (-1000,-1000). In - most cases you can ignore this fact, because if you use this - method for drawing a decorator over a 3d object, it will be - clipped by the screen borders. */ - virtual core::position2d getScreenCoordinatesFrom3DPosition( - const core::vector3df& pos, const ICameraSceneNode* camera=0, bool useViewPort=false) = 0; - - //! Gets the scene node, which is currently visible under the given screen coordinates, viewed from the currently active camera. - /** The collision tests are done using a bounding box for each - scene node. You can limit the recursive search so just all children of the specified root are tested. - \param pos: Position in pixel screen coordinates, under which - the returned scene node will be. - \param idBitMask: Only scene nodes with an id with bits set - like in this mask will be tested. If the BitMask is 0, this - feature is disabled. - Please note that the default node id of -1 will match with - every bitmask != 0 - \param bNoDebugObjects: Doesn't take debug objects into account - when true. These are scene nodes with IsDebugObject() = true. - \param root If different from 0, the search is limited to the children of this node. - \return Visible scene node under screen coordinates with - matching bits in its id. If there is no scene node under this - position, 0 is returned. */ - virtual ISceneNode* getSceneNodeFromScreenCoordinatesBB(const core::position2d& pos, - s32 idBitMask=0, bool bNoDebugObjects=false, ISceneNode* root=0) =0; - - //! Returns the nearest scene node which collides with a 3d ray and whose id matches a bitmask. - /** The collision tests are done using a bounding box for each - scene node. The recursive search can be limited be specifying a scene node. - \param ray Line with which collisions are tested. - \param idBitMask Only scene nodes with an id which matches at - least one of the bits contained in this mask will be tested. - However, if this parameter is 0, then all nodes are checked. - \param bNoDebugObjects: Doesn't take debug objects into account when true. These - are scene nodes with IsDebugObject() = true. - \param root If different from 0, the search is limited to the children of this node. - \return Scene node nearest to ray.start, which collides with - the ray and matches the idBitMask, if the mask is not null. If - no scene node is found, 0 is returned. */ - virtual ISceneNode* getSceneNodeFromRayBB(const core::line3d& ray, - s32 idBitMask=0, bool bNoDebugObjects=false, ISceneNode* root=0) =0; - - //! Get the scene node, which the given camera is looking at and whose id matches the bitmask. - /** A ray is simply cast from the position of the camera to - the view target position, and all scene nodes are tested - against this ray. The collision tests are done using a bounding - box for each scene node. - \param camera: Camera from which the ray is cast. - \param idBitMask: Only scene nodes with an id which matches at least one of the - bits contained in this mask will be tested. However, if this parameter is 0, then - all nodes are checked. - feature is disabled. - Please note that the default node id of -1 will match with - every bitmask != 0 - \param bNoDebugObjects: Doesn't take debug objects into account - when true. These are scene nodes with IsDebugObject() = true. - \return Scene node nearest to the camera, which collides with - the ray and matches the idBitMask, if the mask is not null. If - no scene node is found, 0 is returned. */ - virtual ISceneNode* getSceneNodeFromCameraBB(const ICameraSceneNode* camera, - s32 idBitMask=0, bool bNoDebugObjects = false) = 0; - - - //! Perform a ray/box and ray/triangle collision check on a hierarchy of scene nodes. - /** This checks all scene nodes under the specified one, first by ray/bounding - box, and then by accurate ray/triangle collision, finding the nearest collision, - and the scene node containing it. It returns the node hit, and (via output - parameters) the position of the collision, and the triangle that was hit. - - All scene nodes in the hierarchy tree under the specified node are checked. Only - nodes that are visible, with an ID that matches at least one bit in the supplied - bitmask, and which have a triangle selector are considered as candidates for being hit. - You do not have to build a meta triangle selector; the individual triangle selectors - of each candidate scene node are used automatically. - - \param ray: Line with which collisions are tested. - \param outCollisionPoint: If a collision is detected, this will contain the - position of the nearest collision. - \param outTriangle: If a collision is detected, this will contain the triangle - with which the ray collided. - \param idBitMask: Only scene nodes with an id which matches at least one of the - bits contained in this mask will be tested. However, if this parameter is 0, then - all nodes are checked. - \param collisionRootNode: the scene node at which to begin checking. Only this - node and its children will be checked. If you want to check the entire scene, - pass 0, and the root scene node will be used (this is the default). - \param noDebugObjects: when true, debug objects are not considered viable targets. - Debug objects are scene nodes with IsDebugObject() = true. - \return Returns the scene node containing the hit triangle nearest to ray.start. - If no collision is detected, then 0 is returned. */ - virtual ISceneNode* getSceneNodeAndCollisionPointFromRay( - SCollisionHit& hitResult, - const core::line3df& ray, - s32 idBitMask = 0, - ISceneNode * collisionRootNode = 0, - bool noDebugObjects = false) = 0; - - //! Perform a ray/box and ray/triangle collision check on a hierarchy of scene nodes. - /** Works same as other getSceneNodeAndCollisionPointFromRay but returns less information. - (was written before the other getSceneNodeAndCollisionPointFromRay implementation). - \param ray: Line with which collisions are tested. - \param outCollisionPoint: If a collision is detected, this will contain the - position of the nearest collision. - \param outTriangle: If a collision is detected, this will contain the triangle - with which the ray collided. - \param idBitMask: Only scene nodes with an id which matches at least one of the - bits contained in this mask will be tested. However, if this parameter is 0, then - all nodes are checked. - \param collisionRootNode: the scene node at which to begin checking. Only this - node and its children will be checked. If you want to check the entire scene, - pass 0, and the root scene node will be used (this is the default). - \param noDebugObjects: when true, debug objects are not considered viable targets. - Debug objects are scene nodes with IsDebugObject() = true. - \return Returns the scene node containing the hit triangle nearest to ray.start. - If no collision is detected, then 0 is returned. */ - virtual ISceneNode* getSceneNodeAndCollisionPointFromRay( - const core::line3df& ray, - core::vector3df& outCollisionPoint, - core::triangle3df& outTriangle, - s32 idBitMask = 0, - ISceneNode * collisionRootNode = 0, - bool noDebugObjects = false) - { - SCollisionHit hitResult; - ISceneNode* node = getSceneNodeAndCollisionPointFromRay(hitResult, ray, idBitMask, collisionRootNode, noDebugObjects); - if ( node ) - { - outCollisionPoint = hitResult.Intersection; - outTriangle = hitResult.Triangle; - } - return node; - } - - }; - -} // end namespace scene -} // end namespace irr - -#endif diff --git a/include/ISceneManager.h b/include/ISceneManager.h index ac860a70..2f25e414 100644 --- a/include/ISceneManager.h +++ b/include/ISceneManager.h @@ -14,10 +14,8 @@ #include "SColor.h" #include "ETerrainElements.h" #include "ESceneNodeTypes.h" -#include "ESceneNodeAnimatorTypes.h" #include "EMeshWriterEnums.h" #include "SceneParameters.h" -#include "IGeometryCreator.h" #include "ISkinnedMesh.h" namespace irr @@ -103,11 +101,8 @@ namespace scene class IAnimatedMesh; class IAnimatedMeshSceneNode; class IBillboardSceneNode; - class IBillboardTextSceneNode; class ICameraSceneNode; class IDummyTransformationSceneNode; - class ILightManager; - class ILightSceneNode; class IMesh; class IMeshBuffer; class IMeshCache; @@ -115,35 +110,13 @@ namespace scene class IMeshManipulator; class IMeshSceneNode; class IMeshWriter; - class IMetaTriangleSelector; - class IOctreeSceneNode; - class IParticleSystemSceneNode; - class ISceneCollisionManager; class ISceneLoader; class ISceneNode; - class ISceneNodeAnimator; - class ISceneNodeAnimatorCollisionResponse; - class ISceneNodeAnimatorFactory; class ISceneNodeFactory; class ISceneUserDataSerializer; - class IShadowVolumeSceneNode; - class ITerrainSceneNode; - class ITextSceneNode; - class ITriangleSelector; - class IVolumeLightSceneNode; - - namespace quake3 - { - struct IShader; - } // end namespace quake3 //! The Scene Manager manages scene nodes, mesh resources, cameras and all the other stuff. - /** All Scene nodes can be created only here. There is a always growing - list of scene nodes for lots of purposes: Indoor rendering scene nodes - like the Octree (addOctreeSceneNode()) or the terrain renderer - (addTerrainSceneNode()), different Camera scene nodes - (addCameraSceneNode(), addCameraSceneNodeMaya()), scene nodes for Light - (addLightSceneNode()), Billboards (addBillboardSceneNode()) and so on. + /** All Scene nodes can be created only here. A scene node is a node in the hierarchical scene graph. Every scene node may have children, which are other scene nodes. Children move relative the their parents position. If the parent of a node is not visible, its @@ -384,65 +357,6 @@ namespace scene This pointer should not be dropped. See IReferenceCounted::drop() for more information. */ virtual io::IFileSystem* getFileSystem() = 0; - //! adds Volume Lighting Scene Node. - /** Example Usage: - scene::IVolumeLightSceneNode * n = smgr->addVolumeLightSceneNode(0, -1, - 32, 32, //Subdivide U/V - video::SColor(0, 180, 180, 180), //foot color - video::SColor(0, 0, 0, 0) //tail color - ); - if (n) - { - n->setScale(core::vector3df(46.0f, 45.0f, 46.0f)); - n->getMaterial(0).setTexture(0, smgr->getVideoDriver()->getTexture("lightFalloff.png")); - } - \return Pointer to the volumeLight if successful, otherwise NULL. - This pointer should not be dropped. See IReferenceCounted::drop() for more information. */ - virtual IVolumeLightSceneNode* addVolumeLightSceneNode(ISceneNode* parent=0, s32 id=-1, - const u32 subdivU = 32, const u32 subdivV = 32, - const video::SColor foot = video::SColor(51, 0, 230, 180), - const video::SColor tail = video::SColor(0, 0, 0, 0), - const core::vector3df& position = core::vector3df(0,0,0), - const core::vector3df& rotation = core::vector3df(0,0,0), - const core::vector3df& scale = core::vector3df(1.0f, 1.0f, 1.0f)) = 0; - - //! Adds a cube scene node - /** \param size: Size of the cube, uniformly in each dimension. - \param parent: Parent of the scene node. Can be 0 if no parent. - \param id: Id of the node. This id can be used to identify the scene node. - \param position: Position of the space relative to its parent - where the scene node will be placed. - \param rotation: Initial rotation of the scene node. - \param scale: Initial scale of the scene node. - \return Pointer to the created test scene node. This - pointer should not be dropped. See IReferenceCounted::drop() - for more information. */ - virtual IMeshSceneNode* addCubeSceneNode(f32 size=10.0f, ISceneNode* parent=0, s32 id=-1, - const core::vector3df& position = core::vector3df(0,0,0), - const core::vector3df& rotation = core::vector3df(0,0,0), - const core::vector3df& scale = core::vector3df(1.0f, 1.0f, 1.0f)) = 0; - - //! Adds a sphere scene node of the given radius and detail - /** \param radius: Radius of the sphere. - \param polyCount: The number of vertices in horizontal and - vertical direction. The total polyCount of the sphere is - polyCount*polyCount. This parameter must be less than 256 to - stay within the 16-bit limit of the indices of a meshbuffer. - \param parent: Parent of the scene node. Can be 0 if no parent. - \param id: Id of the node. This id can be used to identify the scene node. - \param position: Position of the space relative to its parent - where the scene node will be placed. - \param rotation: Initial rotation of the scene node. - \param scale: Initial scale of the scene node. - \return Pointer to the created test scene node. This - pointer should not be dropped. See IReferenceCounted::drop() - for more information. */ - virtual IMeshSceneNode* addSphereSceneNode(f32 radius=5.0f, s32 polyCount=16, - ISceneNode* parent=0, s32 id=-1, - const core::vector3df& position = core::vector3df(0,0,0), - const core::vector3df& rotation = core::vector3df(0,0,0), - const core::vector3df& scale = core::vector3df(1.0f, 1.0f, 1.0f)) = 0; - //! Adds a scene node for rendering an animated mesh model. /** \param mesh: Pointer to the loaded animated mesh to be displayed. \param parent: Parent of the scene node. Can be NULL if no parent. @@ -478,65 +392,10 @@ namespace scene const core::vector3df& scale = core::vector3df(1.0f, 1.0f, 1.0f), bool alsoAddIfMeshPointerZero=false) = 0; - //! Adds a scene node for rendering a animated water surface mesh. - /** Looks really good when the Material type EMT_TRANSPARENT_REFLECTION - is used. - \param waveHeight: Height of the water waves. - \param waveSpeed: Speed of the water waves. - \param waveLength: Length of a water wave. - \param mesh: Pointer to the loaded static mesh to be displayed with water waves on it. - \param parent: Parent of the scene node. Can be NULL if no parent. - \param id: Id of the node. This id can be used to identify the scene node. - \param position: Position of the space relative to its parent where the - scene node will be placed. - \param rotation: Initial rotation of the scene node. - \param scale: Initial scale of the scene node. - \return Pointer to the created scene node. - This pointer should not be dropped. See IReferenceCounted::drop() for more information. */ - virtual ISceneNode* addWaterSurfaceSceneNode(IMesh* mesh, - f32 waveHeight=2.0f, f32 waveSpeed=300.0f, f32 waveLength=10.0f, - ISceneNode* parent=0, s32 id=-1, - const core::vector3df& position = core::vector3df(0,0,0), - const core::vector3df& rotation = core::vector3df(0,0,0), - const core::vector3df& scale = core::vector3df(1.0f, 1.0f, 1.0f)) = 0; - - - //! Adds a scene node for rendering using a octree to the scene graph. - /** This a good method for rendering - scenes with lots of geometry. The octree is built on the fly from the mesh. - \param mesh: The mesh containing all geometry from which the octree will be build. - If this animated mesh has more than one frames in it, the first frame is taken. - \param parent: Parent node of the octree node. - \param id: id of the node. This id can be used to identify the node. - \param minimalPolysPerNode: Specifies the minimal polygons contained a octree node. - If a node gets less polys than this value it will not be split into - smaller nodes. - \param alsoAddIfMeshPointerZero: Add the scene node even if a 0 pointer is passed. - \return Pointer to the octree if successful, otherwise 0. - This pointer should not be dropped. See IReferenceCounted::drop() for more information. */ - virtual IOctreeSceneNode* addOctreeSceneNode(IAnimatedMesh* mesh, ISceneNode* parent=0, - s32 id=-1, s32 minimalPolysPerNode=512, bool alsoAddIfMeshPointerZero=false) = 0; - - //! Adds a scene node for rendering using a octree to the scene graph. - /** This a good method for rendering scenes with lots of - geometry. The octree is built on the fly from the mesh, much - faster then a bsp tree. - \param mesh: The mesh containing all geometry from which the octree will be build. - \param parent: Parent node of the octree node. - \param id: id of the node. This id can be used to identify the node. - \param minimalPolysPerNode: Specifies the minimal polygons contained a octree node. - If a node gets less polys than this value it will not be split into - smaller nodes. - \param alsoAddIfMeshPointerZero: Add the scene node even if a 0 pointer is passed. - \return Pointer to the octree if successful, otherwise 0. - This pointer should not be dropped. See IReferenceCounted::drop() for more information. */ - virtual IOctreeSceneNode* addOctreeSceneNode(IMesh* mesh, ISceneNode* parent=0, - s32 id=-1, s32 minimalPolysPerNode=256, bool alsoAddIfMeshPointerZero=false) = 0; - //! Adds a camera scene node to the scene graph and sets it as active camera. - /** This camera does not react on user input like for example the one created with - addCameraSceneNodeFPS(). If you want to move or animate it, use animators or the - ISceneNode::setPosition(), ICameraSceneNode::setTarget() etc methods. + /** This camera does not react on user input. + If you want to move or animate it, use ISceneNode::setPosition(), + ICameraSceneNode::setTarget() etc methods. By default, a camera's look at position (set with setTarget()) and its scene node rotation (set with setRotation()) are independent. If you want to be able to control the direction that the camera looks by using setRotation() then call @@ -555,116 +414,6 @@ namespace scene const core::vector3df& lookat = core::vector3df(0,0,100), s32 id=-1, bool makeActive=true) = 0; - //! Adds a maya style user controlled camera scene node to the scene graph. - /** This is a standard camera with an animator that provides mouse control similar - to camera in the 3D Software Maya by Alias Wavefront. - The camera does not react on setPosition anymore after applying this animator. Instead - use setTarget, to fix the target the camera the camera hovers around. And setDistance - to set the current distance from that target, i.e. the radius of the orbit the camera - hovers on. - \param parent: Parent scene node of the camera. Can be null. - \param rotateSpeed: Rotation speed of the camera. - \param zoomSpeed: Zoom speed of the camera. - \param translationSpeed: TranslationSpeed of the camera. - \param id: id of the camera. This id can be used to identify the camera. - \param distance Initial distance of the camera from the object - \param makeActive Flag whether this camera should become the active one. - Make sure you always have one active camera. - \return Returns a pointer to the interface of the camera if successful, otherwise 0. - This pointer should not be dropped. See IReferenceCounted::drop() for more information. */ - virtual ICameraSceneNode* addCameraSceneNodeMaya(ISceneNode* parent=0, - f32 rotateSpeed=-1500.f, f32 zoomSpeed=200.f, - f32 translationSpeed=1500.f, s32 id=-1, f32 distance=70.f, - bool makeActive=true) =0; - - //! Adds a camera scene node with an animator which provides mouse and keyboard control appropriate for first person shooters (FPS). - /** This FPS camera is intended to provide a demonstration of a - camera that behaves like a typical First Person Shooter. It is - useful for simple demos and prototyping but is not intended to - provide a full solution for a production quality game. It binds - the camera scene node rotation to the look-at target; @see - ICameraSceneNode::bindTargetAndRotation(). With this camera, - you look with the mouse, and move with cursor keys. If you want - to change the key layout, you can specify your own keymap. For - example to make the camera be controlled by the cursor keys AND - the keys W,A,S, and D, do something like this: - \code - SKeyMap keyMap[8]; - keyMap[0].Action = EKA_MOVE_FORWARD; - keyMap[0].KeyCode = KEY_UP; - keyMap[1].Action = EKA_MOVE_FORWARD; - keyMap[1].KeyCode = KEY_KEY_W; - - keyMap[2].Action = EKA_MOVE_BACKWARD; - keyMap[2].KeyCode = KEY_DOWN; - keyMap[3].Action = EKA_MOVE_BACKWARD; - keyMap[3].KeyCode = KEY_KEY_S; - - keyMap[4].Action = EKA_STRAFE_LEFT; - keyMap[4].KeyCode = KEY_LEFT; - keyMap[5].Action = EKA_STRAFE_LEFT; - keyMap[5].KeyCode = KEY_KEY_A; - - keyMap[6].Action = EKA_STRAFE_RIGHT; - keyMap[6].KeyCode = KEY_RIGHT; - keyMap[7].Action = EKA_STRAFE_RIGHT; - keyMap[7].KeyCode = KEY_KEY_D; - - camera = sceneManager->addCameraSceneNodeFPS(0, 100, 500, -1, keyMap, 8); - \endcode - \param parent: Parent scene node of the camera. Can be null. - \param rotateSpeed: Speed in degrees with which the camera is - rotated. This can be done only with the mouse. - \param moveSpeed: Speed in units per millisecond with which - the camera is moved. Movement is done with the cursor keys. - \param id: id of the camera. This id can be used to identify - the camera. - \param keyMapArray: Optional pointer to an array of a keymap, - specifying what keys should be used to move the camera. If this - is null, the default keymap is used. You can define actions - more then one time in the array, to bind multiple keys to the - same action. - \param keyMapSize: Amount of items in the keymap array. - \param noVerticalMovement: Setting this to true makes the - camera only move within a horizontal plane, and disables - vertical movement as known from most ego shooters. Default is - 'false', with which it is possible to fly around in space, if - no gravity is there. - \param jumpSpeed: Speed with which the camera is moved when - jumping. - \param invertMouse: Setting this to true makes the camera look - up when the mouse is moved down and down when the mouse is - moved up, the default is 'false' which means it will follow the - movement of the mouse cursor. - \param makeActive Flag whether this camera should become the active one. - Make sure you always have one active camera. - \return Pointer to the interface of the camera if successful, - otherwise 0. This pointer should not be dropped. See - IReferenceCounted::drop() for more information. */ - virtual ICameraSceneNode* addCameraSceneNodeFPS(ISceneNode* parent = 0, - f32 rotateSpeed = 100.0f, f32 moveSpeed = 0.5f, s32 id=-1, - SKeyMap* keyMapArray=0, s32 keyMapSize=0, bool noVerticalMovement=false, - f32 jumpSpeed = 0.f, bool invertMouse=false, - bool makeActive=true) = 0; - - //! Adds a dynamic light scene node to the scene graph. - /** The light will cast dynamic light on all - other scene nodes in the scene, which have the material flag video::MTF_LIGHTING - turned on. (This is the default setting in most scene nodes). - \param parent: Parent scene node of the light. Can be null. If the parent moves, - the light will move too. - \param position: Position of the space relative to its parent where the light will be placed. - \param color: Diffuse color of the light. Ambient or Specular colors can be set manually with - the ILightSceneNode::getLightData() method. - \param radius: Radius of the light. - \param id: id of the node. This id can be used to identify the node. - \return Pointer to the interface of the light if successful, otherwise NULL. - This pointer should not be dropped. See IReferenceCounted::drop() for more information. */ - virtual ILightSceneNode* addLightSceneNode(ISceneNode* parent = 0, - const core::vector3df& position = core::vector3df(0,0,0), - video::SColorf color = video::SColorf(1.0f, 1.0f, 1.0f), - f32 radius=100.0f, s32 id=-1) = 0; - //! Adds a billboard scene node to the scene graph. /** A billboard is like a 3d sprite: A 2d element, which always looks to the camera. It is usually used for things @@ -689,180 +438,6 @@ namespace scene const core::vector3df& position = core::vector3df(0,0,0), s32 id=-1, video::SColor colorTop = 0xFFFFFFFF, video::SColor colorBottom = 0xFFFFFFFF) = 0; - //! Adds a skybox scene node to the scene graph. - /** A skybox is a big cube with 6 textures on it and - is drawn around the camera position. - \param top: Texture for the top plane of the box. - \param bottom: Texture for the bottom plane of the box. - \param left: Texture for the left plane of the box. - \param right: Texture for the right plane of the box. - \param front: Texture for the front plane of the box. - \param back: Texture for the back plane of the box. - \param parent: Parent scene node of the skybox. A skybox usually has no parent, - so this should be null. Note: If a parent is set to the skybox, the box will not - change how it is drawn. - \param id: An id of the node. This id can be used to identify the node. - \return Pointer to the sky box if successful, otherwise NULL. - This pointer should not be dropped. See IReferenceCounted::drop() for more information. */ - virtual ISceneNode* addSkyBoxSceneNode(video::ITexture* top, video::ITexture* bottom, - video::ITexture* left, video::ITexture* right, video::ITexture* front, - video::ITexture* back, ISceneNode* parent = 0, s32 id=-1) = 0; - - //! Adds a skydome scene node to the scene graph. - /** A skydome is a large (half-) sphere with a panoramic texture - on the inside and is drawn around the camera position. - \param texture: Texture for the dome. - \param horiRes: Number of vertices of a horizontal layer of the sphere. - \param vertRes: Number of vertices of a vertical layer of the sphere. - \param texturePercentage: How much of the height of the - texture is used. Should be between 0 and 1. - \param spherePercentage: How much of the sphere is drawn. - Value should be between 0 and 2, where 1 is an exact - half-sphere and 2 is a full sphere. - \param radius The Radius of the sphere - \param parent: Parent scene node of the dome. A dome usually has no parent, - so this should be null. Note: If a parent is set, the dome will not - change how it is drawn. - \param id: An id of the node. This id can be used to identify the node. - \return Pointer to the sky dome if successful, otherwise NULL. - This pointer should not be dropped. See IReferenceCounted::drop() for more information. */ - virtual ISceneNode* addSkyDomeSceneNode(video::ITexture* texture, - u32 horiRes=16, u32 vertRes=8, - f32 texturePercentage=0.9, f32 spherePercentage=2.0,f32 radius = 1000.f, - ISceneNode* parent=0, s32 id=-1) = 0; - - //! Adds a particle system scene node to the scene graph. - /** \param withDefaultEmitter: Creates a default working point emitter - which emits some particles. Set this to true to see a particle system - in action. If set to false, you'll have to set the emitter you want by - calling IParticleSystemSceneNode::setEmitter(). - \param parent: Parent of the scene node. Can be NULL if no parent. - \param id: Id of the node. This id can be used to identify the scene node. - \param position: Position of the space relative to its parent where the - scene node will be placed. - \param rotation: Initial rotation of the scene node. - \param scale: Initial scale of the scene node. - \return Pointer to the created scene node. - This pointer should not be dropped. See IReferenceCounted::drop() for more information. */ - virtual IParticleSystemSceneNode* addParticleSystemSceneNode( - bool withDefaultEmitter=true, ISceneNode* parent=0, s32 id=-1, - const core::vector3df& position = core::vector3df(0,0,0), - const core::vector3df& rotation = core::vector3df(0,0,0), - const core::vector3df& scale = core::vector3df(1.0f, 1.0f, 1.0f)) = 0; - - //! Adds a terrain scene node to the scene graph. - /** This node implements is a simple terrain renderer which uses - a technique known as geo mip mapping - for reducing the detail of triangle blocks which are far away. - The code for the TerrainSceneNode is based on the terrain - renderer by Soconne and the GeoMipMapSceneNode developed by - Spintz. They made their code available for Irrlicht and allowed - it to be distributed under this licence. I only modified some - parts. A lot of thanks go to them. - - This scene node is capable of loading terrains and updating - the indices at runtime to enable viewing very large terrains - very quickly. It uses a CLOD (Continuous Level of Detail) - algorithm which updates the indices for each patch based on - a LOD (Level of Detail) which is determined based on a patch's - distance from the camera. - - The patch size of the terrain must always be a size of 2^N+1, - i.e. 8+1(9), 16+1(17), etc. - The MaxLOD available is directly dependent on the patch size - of the terrain. LOD 0 contains all of the indices to draw all - the triangles at the max detail for a patch. As each LOD goes - up by 1 the step taken, in generating indices increases by - -2^LOD, so for LOD 1, the step taken is 2, for LOD 2, the step - taken is 4, LOD 3 - 8, etc. The step can be no larger than - the size of the patch, so having a LOD of 8, with a patch size - of 17, is asking the algorithm to generate indices every 2^8 ( - 256 ) vertices, which is not possible with a patch size of 17. - The maximum LOD for a patch size of 17 is 2^4 ( 16 ). So, - with a MaxLOD of 5, you'll have LOD 0 ( full detail ), LOD 1 ( - every 2 vertices ), LOD 2 ( every 4 vertices ), LOD 3 ( every - 8 vertices ) and LOD 4 ( every 16 vertices ). - \param heightMapFileName: The name of the file on disk, to read vertex data from. This should - be a gray scale bitmap. - \param parent: Parent of the scene node. Can be 0 if no parent. - \param id: Id of the node. This id can be used to identify the scene node. - \param position: The absolute position of this node. - \param rotation: The absolute rotation of this node. ( NOT YET IMPLEMENTED ) - \param scale: The scale factor for the terrain. If you're - using a heightmap of size 129x129 and would like your terrain - to be 12900x12900 in game units, then use a scale factor of ( - core::vector ( 100.0f, 100.0f, 100.0f ). If you use a Y - scaling factor of 0.0f, then your terrain will be flat. - \param vertexColor: The default color of all the vertices. If no texture is associated - with the scene node, then all vertices will be this color. Defaults to white. - \param maxLOD: The maximum LOD (level of detail) for the node. Only change if you - know what you are doing, this might lead to strange behavior. - \param patchSize: patch size of the terrain. Only change if you - know what you are doing, this might lead to strange behavior. - \param smoothFactor: The number of times the vertices are smoothed. - \param addAlsoIfHeightmapEmpty: Add terrain node even with empty heightmap. - \return Pointer to the created scene node. Can be null - if the terrain could not be created, for example because the - heightmap could not be loaded. The returned pointer should - not be dropped. See IReferenceCounted::drop() for more - information. */ - virtual ITerrainSceneNode* addTerrainSceneNode( - const io::path& heightMapFileName, - ISceneNode* parent=0, s32 id=-1, - const core::vector3df& position = core::vector3df(0.0f,0.0f,0.0f), - const core::vector3df& rotation = core::vector3df(0.0f,0.0f,0.0f), - const core::vector3df& scale = core::vector3df(1.0f,1.0f,1.0f), - video::SColor vertexColor = video::SColor(255,255,255,255), - s32 maxLOD=5, E_TERRAIN_PATCH_SIZE patchSize=ETPS_17, s32 smoothFactor=0, - bool addAlsoIfHeightmapEmpty = false) = 0; - - //! Adds a terrain scene node to the scene graph. - /** Just like the other addTerrainSceneNode() method, but takes an IReadFile - pointer as parameter for the heightmap. For more information take a look - at the other function. - \param heightMapFile: The file handle to read vertex data from. This should - be a gray scale bitmap. - \param parent: Parent of the scene node. Can be 0 if no parent. - \param id: Id of the node. This id can be used to identify the scene node. - \param position: The absolute position of this node. - \param rotation: The absolute rotation of this node. ( NOT YET IMPLEMENTED ) - \param scale: The scale factor for the terrain. If you're - using a heightmap of size 129x129 and would like your terrain - to be 12900x12900 in game units, then use a scale factor of ( - core::vector ( 100.0f, 100.0f, 100.0f ). If you use a Y - scaling factor of 0.0f, then your terrain will be flat. - \param vertexColor: The default color of all the vertices. If no texture is associated - with the scene node, then all vertices will be this color. Defaults to white. - \param maxLOD: The maximum LOD (level of detail) for the node. Only change if you - know what you are doing, this might lead to strange behavior. - \param patchSize: patch size of the terrain. Only change if you - know what you are doing, this might lead to strange behavior. - \param smoothFactor: The number of times the vertices are smoothed. - \param addAlsoIfHeightmapEmpty: Add terrain node even with empty heightmap. - \return Pointer to the created scene node. Can be null - if the terrain could not be created, for example because the - heightmap could not be loaded. The returned pointer should - not be dropped. See IReferenceCounted::drop() for more - information. */ - virtual ITerrainSceneNode* addTerrainSceneNode( - io::IReadFile* heightMapFile, - ISceneNode* parent=0, s32 id=-1, - const core::vector3df& position = core::vector3df(0.0f,0.0f,0.0f), - const core::vector3df& rotation = core::vector3df(0.0f,0.0f,0.0f), - const core::vector3df& scale = core::vector3df(1.0f,1.0f,1.0f), - video::SColor vertexColor = video::SColor(255,255,255,255), - s32 maxLOD=5, E_TERRAIN_PATCH_SIZE patchSize=ETPS_17, s32 smoothFactor=0, - bool addAlsoIfHeightmapEmpty = false) = 0; - - //! Adds a quake3 scene node to the scene graph. - /** A Quake3 Scene renders multiple meshes for a specific HighLanguage Shader (Quake3 Style ) - \return Pointer to the quake3 scene node if successful, otherwise NULL. - This pointer should not be dropped. See IReferenceCounted::drop() for more information. */ - virtual IMeshSceneNode* addQuake3SceneNode(const IMeshBuffer* meshBuffer, const quake3::IShader * shader, - ISceneNode* parent=0, s32 id=-1 - ) = 0; - - //! Adds an empty scene node to the scene graph. /** Can be used for doing advanced transformations or structuring the scene graph. @@ -880,136 +455,6 @@ namespace scene virtual IDummyTransformationSceneNode* addDummyTransformationSceneNode( ISceneNode* parent=0, s32 id=-1) = 0; - //! Adds a text scene node, which is able to display 2d text at a position in three dimensional space - virtual ITextSceneNode* addTextSceneNode(gui::IGUIFont* font, const wchar_t* text, - video::SColor color=video::SColor(100,255,255,255), - ISceneNode* parent = 0, const core::vector3df& position = core::vector3df(0,0,0), - s32 id=-1) = 0; - - //! Adds a text scene node, which uses billboards. The node, and the text on it, will scale with distance. - /** - \param font The font to use on the billboard. Pass 0 to use the GUI environment's default font. - \param text The text to display on the billboard. - \param parent The billboard's parent. Pass 0 to use the root scene node. - \param size The billboard's width and height. - \param position The billboards position relative to its parent. - \param id: An id of the node. This id can be used to identify the node. - \param colorTop: The color of the vertices at the top of the billboard (default: white). - \param colorBottom: The color of the vertices at the bottom of the billboard (default: white). - \return Pointer to the billboard if successful, otherwise NULL. - This pointer should not be dropped. See IReferenceCounted::drop() for more information. */ - virtual IBillboardTextSceneNode* addBillboardTextSceneNode( gui::IGUIFont* font, const wchar_t* text, - ISceneNode* parent = 0, - const core::dimension2d& size = core::dimension2d(10.0f, 10.0f), - const core::vector3df& position = core::vector3df(0,0,0), s32 id=-1, - video::SColor colorTop = 0xFFFFFFFF, video::SColor colorBottom = 0xFFFFFFFF) = 0; - - //! Adds a Hill Plane mesh to the mesh pool. - /** The mesh is generated on the fly - and looks like a plane with some hills on it. It is uses mostly for quick - tests of the engine only. You can specify how many hills there should be - on the plane and how high they should be. Also you must specify a name for - the mesh, because the mesh is added to the mesh pool, and can be retrieved - again using ISceneManager::getMesh() with the name as parameter. - \param name: The name of this mesh which must be specified in order - to be able to retrieve the mesh later with ISceneManager::getMesh(). - \param tileSize: Size of a tile of the mesh. (10.0f, 10.0f) would be a - good value to start, for example. - \param tileCount: Specifies how much tiles there will be. If you specify - for example that a tile has the size (10.0f, 10.0f) and the tileCount is - (10,10), than you get a field of 100 tiles which has the dimension 100.0f x 100.0f. - \param material: Material of the hill mesh. - \param hillHeight: Height of the hills. If you specify a negative value - you will get holes instead of hills. If the height is 0, no hills will be - created. - \param countHills: Amount of hills on the plane. There will be countHills.X - hills along the X axis and countHills.Y along the Y axis. So in total there - will be countHills.X * countHills.Y hills. - \param textureRepeatCount: Defines how often the texture will be repeated in - x and y direction. - return Null if the creation failed. The reason could be that you - specified some invalid parameters or that a mesh with that name already - exists. If successful, a pointer to the mesh is returned. - This pointer should not be dropped. See IReferenceCounted::drop() for more information. */ - virtual IAnimatedMesh* addHillPlaneMesh(const io::path& name, - const core::dimension2d& tileSize, const core::dimension2d& tileCount, - video::SMaterial* material = 0, f32 hillHeight = 0.0f, - const core::dimension2d& countHills = core::dimension2d(0.0f, 0.0f), - const core::dimension2d& textureRepeatCount = core::dimension2d(1.0f, 1.0f)) = 0; - - //! Adds a static terrain mesh to the mesh pool. - /** The mesh is generated on the fly - from a texture file and a height map file. Both files may be huge - (8000x8000 pixels would be no problem) because the generator splits the - files into smaller textures if necessary. - You must specify a name for the mesh, because the mesh is added to the mesh pool, - and can be retrieved again using ISceneManager::getMesh() with the name as parameter. - \param meshname: The name of this mesh which must be specified in order - to be able to retrieve the mesh later with ISceneManager::getMesh(). - \param texture: Texture for the terrain. Please note that this is not a - hardware texture as usual (ITexture), but an IImage software texture. - You can load this texture with IVideoDriver::createImageFromFile(). - \param heightmap: A grayscaled heightmap image. Like the texture, - it can be created with IVideoDriver::createImageFromFile(). The amount - of triangles created depends on the size of this texture, so use a small - heightmap to increase rendering speed. - \param stretchSize: Parameter defining how big a is pixel on the heightmap. - \param maxHeight: Defines how high a white pixel on the heightmap is. - \param defaultVertexBlockSize: Defines the initial dimension between vertices. - \return Null if the creation failed. The reason could be that you - specified some invalid parameters, that a mesh with that name already - exists, or that a texture could not be found. If successful, a pointer to the mesh is returned. - This pointer should not be dropped. See IReferenceCounted::drop() for more information. */ - virtual IAnimatedMesh* addTerrainMesh(const io::path& meshname, - video::IImage* texture, video::IImage* heightmap, - const core::dimension2d& stretchSize = core::dimension2d(10.0f,10.0f), - f32 maxHeight=200.0f, - const core::dimension2d& defaultVertexBlockSize = core::dimension2d(64,64)) = 0; - - //! add a static arrow mesh to the meshpool - /** \param name Name of the mesh - \param vtxColorCylinder color of the cylinder - \param vtxColorCone color of the cone - \param tesselationCylinder Number of quads the cylinder side consists of - \param tesselationCone Number of triangles the cone's roof consists of - \param height Total height of the arrow - \param cylinderHeight Total height of the cylinder, should be lesser than total height - \param widthCylinder Diameter of the cylinder - \param widthCone Diameter of the cone's base, should be not smaller than the cylinder's diameter - \return Pointer to the arrow mesh if successful, otherwise 0. - This pointer should not be dropped. See IReferenceCounted::drop() for more information. */ - virtual IAnimatedMesh* addArrowMesh(const io::path& name, - video::SColor vtxColorCylinder=0xFFFFFFFF, - video::SColor vtxColorCone=0xFFFFFFFF, - u32 tesselationCylinder=4, u32 tesselationCone=8, - f32 height=1.f, f32 cylinderHeight=0.6f, - f32 widthCylinder=0.05f, f32 widthCone=0.3f) = 0; - - //! add a static sphere mesh to the meshpool - /** \param name Name of the mesh - \param radius Radius of the sphere - \param polyCountX Number of quads used for the horizontal tiling - \param polyCountY Number of quads used for the vertical tiling - \return Pointer to the sphere mesh if successful, otherwise 0. - This pointer should not be dropped. See IReferenceCounted::drop() for more information. */ - virtual IAnimatedMesh* addSphereMesh(const io::path& name, - f32 radius=5.f, u32 polyCountX = 16, - u32 polyCountY = 16) = 0; - - //! Add a volume light mesh to the meshpool - /** \param name Name of the mesh - \param SubdivideU Horizontal subdivision count - \param SubdivideV Vertical subdivision count - \param FootColor Color of the bottom of the light - \param TailColor Color of the top of the light - \return Pointer to the volume light mesh if successful, otherwise 0. - This pointer should not be dropped. See IReferenceCounted::drop() for more information. - */ - virtual IAnimatedMesh* addVolumeLightMesh(const io::path& name, - const u32 SubdivideU = 32, const u32 SubdivideV = 32, - const video::SColor FootColor = video::SColor(51, 0, 230, 180), - const video::SColor TailColor = video::SColor(0, 0, 0, 0)) = 0; - //! Gets the root scene node. /** This is the scene node which is parent of all scene nodes. The root scene node is a special scene node which @@ -1070,17 +515,6 @@ namespace scene \param camera: The new camera which should be active. */ virtual void setActiveCamera(ICameraSceneNode* camera) = 0; - //! Sets the color of stencil buffers shadows drawn by the scene manager. - virtual void setShadowColor(video::SColor color = video::SColor(150,0,0,0)) = 0; - - //! Get the current color of shadows. - virtual video::SColor getShadowColor() const = 0; - - //! Create a shadow volume scene node to be used with custom nodes - /** Use this if you implement your own SceneNodes and need shadow volumes in them. - Otherwise you should generally use addShadowVolumeSceneNode functions from IMeshSceneNode or IAnimatedMeshSceneNode.*/ - virtual IShadowVolumeSceneNode* createShadowVolumeSceneNode(const IMesh* shadowMesh, ISceneNode* parent, s32 id, bool zfailmethod, f32 infinity) = 0; - //! Registers a node for rendering it at a specific time. /** This method should only be used by SceneNodes when they get a ISceneNode::OnRegisterSceneNode() call. @@ -1108,254 +542,6 @@ namespace scene by existing scene node animators, culling of scene nodes is done, etc. */ virtual void drawAll() = 0; - //! Creates a rotation animator, which rotates the attached scene node around itself. - /** \param rotationSpeed Specifies the speed of the animation in degree per 10 milliseconds. - \return The animator. Attach it to a scene node with ISceneNode::addAnimator() - and the animator will animate it. - If you no longer need the animator, you should call ISceneNodeAnimator::drop(). - See IReferenceCounted::drop() for more information. */ - virtual ISceneNodeAnimator* createRotationAnimator(const core::vector3df& rotationSpeed) = 0; - - //! Creates a fly circle animator, which lets the attached scene node fly around a center. - /** \param center: Center of the circle. - \param radius: Radius of the circle. - \param speed: The orbital speed, in radians per millisecond. - \param direction: Specifies the upvector used for alignment of the mesh. - \param startPosition: The position on the circle where the animator will - begin. Value is in multiples of a circle, i.e. 0.5 is half way around. (phase) - \param radiusEllipsoid: if radiusEllipsoid != 0 then radius2 from a ellipsoid - begin. Value is in multiples of a circle, i.e. 0.5 is half way around. (phase) - \return The animator. Attach it to a scene node with ISceneNode::addAnimator() - and the animator will animate it. - If you no longer need the animator, you should call ISceneNodeAnimator::drop(). - See IReferenceCounted::drop() for more information. */ - virtual ISceneNodeAnimator* createFlyCircleAnimator( - const core::vector3df& center=core::vector3df(0.f,0.f,0.f), - f32 radius=100.f, f32 speed=0.001f, - const core::vector3df& direction=core::vector3df(0.f, 1.f, 0.f), - f32 startPosition = 0.f, - f32 radiusEllipsoid = 0.f) = 0; - - //! Creates a fly straight animator, which lets the attached scene node fly or move along a line between two points. - /** \param startPoint: Start point of the line. - \param endPoint: End point of the line. - \param timeForWay: Time in milliseconds how long the node should need to - move from the start point to the end point. - \param loop: If set to false, the node stops when the end point is reached. - If loop is true, the node begins again at the start. - \param pingpong Flag to set whether the animator should fly - back from end to start again. - \return The animator. Attach it to a scene node with ISceneNode::addAnimator() - and the animator will animate it. - If you no longer need the animator, you should call ISceneNodeAnimator::drop(). - See IReferenceCounted::drop() for more information. */ - virtual ISceneNodeAnimator* createFlyStraightAnimator(const core::vector3df& startPoint, - const core::vector3df& endPoint, u32 timeForWay, bool loop=false, bool pingpong = false) = 0; - - //! Creates a texture animator, which switches the textures of the target scene node based on a list of textures. - /** \param textures: List of textures to use. - \param timePerFrame: Time in milliseconds, how long any texture in the list - should be visible. - \param loop: If set to to false, the last texture remains set, and the animation - stops. If set to true, the animation restarts with the first texture. - \return The animator. Attach it to a scene node with ISceneNode::addAnimator() - and the animator will animate it. - If you no longer need the animator, you should call ISceneNodeAnimator::drop(). - See IReferenceCounted::drop() for more information. */ - virtual ISceneNodeAnimator* createTextureAnimator(const core::array& textures, - s32 timePerFrame, bool loop=true) = 0; - - //! Creates a scene node animator, which deletes the scene node after some time automatically. - /** \param timeMs: Time in milliseconds, after when the node will be deleted. - \return The animator. Attach it to a scene node with ISceneNode::addAnimator() - and the animator will animate it. - If you no longer need the animator, you should call ISceneNodeAnimator::drop(). - See IReferenceCounted::drop() for more information. */ - virtual ISceneNodeAnimator* createDeleteAnimator(u32 timeMs) = 0; - - //! Creates a special scene node animator for doing automatic collision detection and response. - /** See ISceneNodeAnimatorCollisionResponse for details. - \param world: Triangle selector holding all triangles of the world with which - the scene node may collide. You can create a triangle selector with - ISceneManager::createTriangleSelector(); - \param sceneNode: SceneNode which should be manipulated. After you added this animator - to the scene node, the scene node will not be able to move through walls and is - affected by gravity. If you need to teleport the scene node to a new position without - it being effected by the collision geometry, then call sceneNode->setPosition(); then - animator->setTargetNode(sceneNode); - \param ellipsoidRadius: Radius of the ellipsoid with which collision detection and - response is done. If you have got a scene node, and you are unsure about - how big the radius should be, you could use the following code to determine - it: - \code - const core::aabbox3d& box = yourSceneNode->getBoundingBox(); - core::vector3df radius = box.MaxEdge - box.getCenter(); - \endcode - \param gravityPerSecond: Sets the gravity of the environment, as an acceleration in - units per second per second. If your units are equivalent to meters, then - core::vector3df(0,-10.0f,0) would give an approximately realistic gravity. - You can disable gravity by setting it to core::vector3df(0,0,0). - \param ellipsoidTranslation: By default, the ellipsoid for collision detection is created around - the center of the scene node, which means that the ellipsoid surrounds - it completely. If this is not what you want, you may specify a translation - for the ellipsoid. - \param slidingValue: DOCUMENTATION NEEDED. - \return The animator. Attach it to a scene node with ISceneNode::addAnimator() - and the animator will cause it to do collision detection and response. - If you no longer need the animator, you should call ISceneNodeAnimator::drop(). - See IReferenceCounted::drop() for more information. */ - virtual ISceneNodeAnimatorCollisionResponse* createCollisionResponseAnimator( - ITriangleSelector* world, ISceneNode* sceneNode, - const core::vector3df& ellipsoidRadius = core::vector3df(30,60,30), - const core::vector3df& gravityPerSecond = core::vector3df(0,-10.0f,0), - const core::vector3df& ellipsoidTranslation = core::vector3df(0,0,0), - f32 slidingValue = 0.0005f) = 0; - - //! Creates a follow spline animator. - /** The animator modifies the position of - the attached scene node to make it follow a Hermite spline. - It uses a subset of Hermite splines: either cardinal splines - (tightness != 0.5) or Catmull-Rom-splines (tightness == 0.5). - The animator moves from one control point to the next in - 1/speed seconds. This code was sent in by Matthias Gall. - If you no longer need the animator, you should call ISceneNodeAnimator::drop(). - See IReferenceCounted::drop() for more information. */ - virtual ISceneNodeAnimator* createFollowSplineAnimator(s32 startTime, - const core::array< core::vector3df >& points, - f32 speed = 1.0f, f32 tightness = 0.5f, bool loop=true, bool pingpong=false) = 0; - - //! Creates a simple ITriangleSelector, based on a mesh. - /** Triangle selectors - can be used for doing collision detection. Don't use this selector - for a huge amount of triangles like in Quake3 maps. - Instead, use for example ISceneManager::createOctreeTriangleSelector(). - Please note that the created triangle selector is not automatically attached - to the scene node. You will have to call ISceneNode::setTriangleSelector() - for this. To create and attach a triangle selector is done like this: - \code - ITriangleSelector* s = sceneManager->createTriangleSelector(yourMesh, - yourSceneNode); - yourSceneNode->setTriangleSelector(s); - s->drop(); - \endcode - \param mesh: Mesh of which the triangles are taken. - \param node: Scene node of which transformation is used. - \param separateMeshbuffers: When true it's possible to get information which meshbuffer - got hit in collision tests. But has a slight speed cost. - \return The selector, or null if not successful. - If you no longer need the selector, you should call ITriangleSelector::drop(). - See IReferenceCounted::drop() for more information. */ - virtual ITriangleSelector* createTriangleSelector(IMesh* mesh, ISceneNode* node, bool separateMeshbuffers=false) = 0; - - //! Creates a simple ITriangleSelector, based on a meshbuffer. - /** - This is a static selector which won't update when the mesh changes. - \param meshBuffer Triangles of that meshbuffer are used - \param materialIndex If you pass a material index that index can be returned by the triangle selector. - \para node: Scene node of which transformation is used. - */ - virtual ITriangleSelector* createTriangleSelector(const IMeshBuffer* meshBuffer, irr::u32 materialIndex, ISceneNode* node) = 0; - - //! Creates a simple ITriangleSelector, based on an animated mesh scene node. - /** Details of the mesh associated with the node will be extracted internally. - \param node The animated mesh scene node from which to build the selector - \param separateMeshbuffers: When true it's possible to get information which meshbuffer - got hit in collision tests. But has a slight speed cost. - */ - virtual ITriangleSelector* createTriangleSelector(IAnimatedMeshSceneNode* node, bool separateMeshbuffers=false) = 0; - - - //! Creates a simple dynamic ITriangleSelector, based on a axis aligned bounding box. - /** Triangle selectors - can be used for doing collision detection. Every time when triangles are - queried, the triangle selector gets the bounding box of the scene node, - an creates new triangles. In this way, it works good with animated scene nodes. - \param node: Scene node of which the bounding box, visibility and transformation is used. - \return The selector, or null if not successful. - If you no longer need the selector, you should call ITriangleSelector::drop(). - See IReferenceCounted::drop() for more information. */ - virtual ITriangleSelector* createTriangleSelectorFromBoundingBox(ISceneNode* node) = 0; - - //! Creates a Triangle Selector, optimized by an octree. - /** Triangle selectors - can be used for doing collision detection. This triangle selector is - optimized for huge amounts of triangle, it organizes them in an octree. - Please note that the created triangle selector is not automatically attached - to the scene node. You will have to call ISceneNode::setTriangleSelector() - for this. To create and attach a triangle selector is done like this: - \code - ITriangleSelector* s = sceneManager->createOctreeTriangleSelector(yourMesh, - yourSceneNode); - yourSceneNode->setTriangleSelector(s); - s->drop(); - \endcode - For more information and examples on this, take a look at the collision - tutorial in the SDK. - \param mesh: Mesh of which the triangles are taken. - \param node: Scene node of which visibility and transformation is used. - \param minimalPolysPerNode: Specifies the minimal polygons contained a octree node. - If a node gets less polys than this value, it will not be split into - smaller nodes. - \return The selector, or null if not successful. - If you no longer need the selector, you should call ITriangleSelector::drop(). - See IReferenceCounted::drop() for more information. */ - virtual ITriangleSelector* createOctreeTriangleSelector(IMesh* mesh, - ISceneNode* node, s32 minimalPolysPerNode=32) = 0; - - //! Creates a Triangle Selector for a single meshbuffer, optimized by an octree. - /** Triangle selectors - can be used for doing collision detection. This triangle selector is - optimized for huge amounts of triangle, it organizes them in an octree. - Please note that the created triangle selector is not automatically attached - to the scene node. You will have to call ISceneNode::setTriangleSelector() - for this. To create and attach a triangle selector is done like this: - \code - ITriangleSelector* s = sceneManager->createOctreeTriangleSelector(yourMesh, - yourSceneNode); - yourSceneNode->setTriangleSelector(s); - s->drop(); - \endcode - For more information and examples on this, take a look at the collision - tutorial in the SDK. - \param meshBuffer: Meshbuffer of which the triangles are taken. - \param materialIndex: Setting this value allows the triangle selector to return the material index - \param node: Scene node of which visibility and transformation is used. - \param minimalPolysPerNode: Specifies the minimal polygons contained a octree node. - If a node gets less polys than this value, it will not be split into - smaller nodes. - \return The selector, or null if not successful. - If you no longer need the selector, you should call ITriangleSelector::drop(). - See IReferenceCounted::drop() for more information. */ - virtual ITriangleSelector* createOctreeTriangleSelector(IMeshBuffer* meshBuffer, irr::u32 materialIndex, - ISceneNode* node, s32 minimalPolysPerNode=32) = 0; - - //! //! Creates a Triangle Selector, optimized by an octree. - /** \deprecated Use createOctreeTriangleSelector instead. This method may be removed by Irrlicht 1.9. */ - _IRR_DEPRECATED_ ITriangleSelector* createOctTreeTriangleSelector(IMesh* mesh, - ISceneNode* node, s32 minimalPolysPerNode=32) - { - return createOctreeTriangleSelector(mesh, node, minimalPolysPerNode); - } - - //! Creates a meta triangle selector. - /** A meta triangle selector is nothing more than a - collection of one or more triangle selectors providing together - the interface of one triangle selector. In this way, - collision tests can be done with different triangle soups in one pass. - \return The selector, or null if not successful. - If you no longer need the selector, you should call ITriangleSelector::drop(). - See IReferenceCounted::drop() for more information. */ - virtual IMetaTriangleSelector* createMetaTriangleSelector() = 0; - - //! Creates a triangle selector which can select triangles from a terrain scene node. - /** \param node: Pointer to the created terrain scene node - \param LOD: Level of detail, 0 for highest detail. - \return The selector, or null if not successful. - If you no longer need the selector, you should call ITriangleSelector::drop(). - See IReferenceCounted::drop() for more information. */ - virtual ITriangleSelector* createTerrainTriangleSelector( - ITerrainSceneNode* node, s32 LOD=0) = 0; - //! Adds an external mesh loader for extending the engine with new file formats. /** If you want the engine to be extended with file formats it currently is not able to load (e.g. .cob), just implement @@ -1392,11 +578,6 @@ namespace scene \return A pointer to the specified loader, 0 if the index is incorrect. */ virtual ISceneLoader* getSceneLoader(u32 index) const = 0; - //! Get pointer to the scene collision manager. - /** \return Pointer to the collision manager - This pointer should not be dropped. See IReferenceCounted::drop() for more information. */ - virtual ISceneCollisionManager* getSceneCollisionManager() = 0; - //! Get pointer to the mesh manipulator. /** \return Pointer to the mesh manipulator This pointer should not be dropped. See IReferenceCounted::drop() for more information. */ @@ -1454,42 +635,14 @@ namespace scene This pointer should not be dropped. See IReferenceCounted::drop() for more information. */ virtual ISceneNodeFactory* getSceneNodeFactory(u32 index) = 0; - //! Get the default scene node animator factory which can create all built-in scene node animators - /** \return Pointer to the default scene node animator factory - This pointer should not be dropped. See IReferenceCounted::drop() for more information. */ - virtual ISceneNodeAnimatorFactory* getDefaultSceneNodeAnimatorFactory() = 0; - - //! Adds a scene node animator factory to the scene manager. - /** Use this to extend the scene manager with new scene node animator types which it should be - able to create automatically, for example when loading data from xml files. */ - virtual void registerSceneNodeAnimatorFactory(ISceneNodeAnimatorFactory* factoryToAdd) = 0; - - //! Get amount of registered scene node animator factories. - virtual u32 getRegisteredSceneNodeAnimatorFactoryCount() const = 0; - - //! Get scene node animator factory by index - /** \return Pointer to the requested scene node animator factory, or 0 if it does not exist. - This pointer should not be dropped. See IReferenceCounted::drop() for more information. */ - virtual ISceneNodeAnimatorFactory* getSceneNodeAnimatorFactory(u32 index) = 0; - //! Get typename from a scene node type or null if not found virtual const c8* getSceneNodeTypeName(ESCENE_NODE_TYPE type) = 0; - //! Returns a typename from a scene node animator type or null if not found - virtual const c8* getAnimatorTypeName(ESCENE_NODE_ANIMATOR_TYPE type) = 0; - //! Adds a scene node to the scene by name /** \return Pointer to the scene node added by a factory This pointer should not be dropped. See IReferenceCounted::drop() for more information. */ virtual ISceneNode* addSceneNode(const char* sceneNodeTypeName, ISceneNode* parent=0) = 0; - //! creates a scene node animator based on its type name - /** \param typeName: Type of the scene node animator to add. - \param target: Target scene node of the new animator. - \return Returns pointer to the new scene node animator or null if not successful. You need to - drop this pointer after calling this, see IReferenceCounted::drop() for details. */ - virtual ISceneNodeAnimator* createSceneNodeAnimator(const char* typeName, ISceneNode* target=0) = 0; - //! Creates a new scene manager. /** This can be used to easily draw and/or store two independent scenes at the same time. The mesh cache will be @@ -1601,22 +754,12 @@ namespace scene //! Get ambient color of the scene virtual const video::SColorf& getAmbientLight() const = 0; - //! Register a custom callbacks manager which gets callbacks during scene rendering. - /** \param[in] lightManager: the new callbacks manager. You may pass 0 to remove the - current callbacks manager and restore the default behavior. */ - virtual void setLightManager(ILightManager* lightManager) = 0; - //! Get current render pass. virtual E_SCENE_NODE_RENDER_PASS getCurrentRenderPass() const =0; //! Set current render pass. virtual void setCurrentRenderPass(E_SCENE_NODE_RENDER_PASS nextPass) =0; - //! Get an instance of a geometry creator. - /** The geometry creator provides some helper methods to create various types of - basic geometry. This can be useful for custom scene nodes. */ - virtual const IGeometryCreator* getGeometryCreator(void) const = 0; - //! Check if node is culled in current view frustum /** Please note that depending on the used culling method this check can be rather coarse, or slow. A positive result is diff --git a/include/ISceneNode.h b/include/ISceneNode.h index 71910276..63d1566b 100644 --- a/include/ISceneNode.h +++ b/include/ISceneNode.h @@ -9,8 +9,6 @@ #include "ESceneNodeTypes.h" #include "ECullingTypes.h" #include "EDebugSceneTypes.h" -#include "ISceneNodeAnimator.h" -#include "ITriangleSelector.h" #include "SMaterial.h" #include "irrString.h" #include "aabbox3d.h" @@ -22,12 +20,11 @@ namespace irr { namespace scene { + class ISceneNode; class ISceneManager; //! Typedef for list of scene nodes typedef core::list ISceneNodeList; - //! Typedef for list of scene node animators - typedef core::list ISceneNodeAnimatorList; //! Scene node interface. /** A scene node is a node in the hierarchical scene graph. Every scene @@ -47,7 +44,7 @@ namespace scene const core::vector3df& rotation = core::vector3df(0,0,0), const core::vector3df& scale = core::vector3df(1.0f, 1.0f, 1.0f)) : RelativeTranslation(position), RelativeRotation(rotation), RelativeScale(scale), - Parent(0), SceneManager(mgr), TriangleSelector(0), ID(id), + Parent(0), SceneManager(mgr), ID(id), AutomaticCullingState(EAC_BOX), DebugDataVisible(EDS_OFF), IsVisible(true), IsDebugObject(false) { @@ -63,14 +60,6 @@ namespace scene { // delete all children removeAll(); - - // delete all animators - ISceneNodeAnimatorList::Iterator ait = Animators.begin(); - for (; ait != Animators.end(); ++ait) - (*ait)->drop(); - - if (TriangleSelector) - TriangleSelector->drop(); } @@ -109,22 +98,6 @@ namespace scene { if (IsVisible) { - // animate this node with all animators - - ISceneNodeAnimatorList::Iterator ait = Animators.begin(); - while (ait != Animators.end()) - { - // continue to the next node before calling animateNode() - // so that the animator may remove itself from the scene - // node without the iterator becoming invalid - ISceneNodeAnimator* anim = *ait; - ++ait; - if ( anim->isEnabled() ) - { - anim->animateNode(this, timeMs); - } - } - // update absolute position updateAbsolutePosition(); @@ -357,58 +330,6 @@ namespace scene } - //! Adds an animator which should animate this node. - /** \param animator A pointer to the new animator. */ - virtual void addAnimator(ISceneNodeAnimator* animator) - { - if (animator) - { - Animators.push_back(animator); - animator->grab(); - } - } - - - //! Get a list of all scene node animators. - /** \return The list of animators attached to this node. */ - const core::list& getAnimators() const - { - return Animators; - } - - - //! Removes an animator from this scene node. - /** If the animator is found, it is also dropped and might be - deleted if not other grab exists for it. - \param animator A pointer to the animator to be deleted. */ - virtual void removeAnimator(ISceneNodeAnimator* animator) - { - ISceneNodeAnimatorList::Iterator it = Animators.begin(); - for (; it != Animators.end(); ++it) - { - if ((*it) == animator) - { - (*it)->drop(); - Animators.erase(it); - return; - } - } - } - - - //! Removes all animators from this scene node. - /** The animators might also be deleted if no other grab exists - for them. */ - virtual void removeAnimators() - { - ISceneNodeAnimatorList::Iterator it = Animators.begin(); - for (; it != Animators.end(); ++it) - (*it)->drop(); - - Animators.clear(); - } - - //! Returns the material based on the zero based index i. /** To get the amount of materials used by this scene node, use getMaterialCount(). This function is needed for inserting the @@ -620,45 +541,6 @@ namespace scene } - //! Returns the triangle selector attached to this scene node. - /** The Selector can be used by the engine for doing collision - detection. You can create a TriangleSelector with - ISceneManager::createTriangleSelector() or - ISceneManager::createOctreeTriangleSelector and set it with - ISceneNode::setTriangleSelector(). If a scene node got no triangle - selector, but collision tests should be done with it, a triangle - selector is created using the bounding box of the scene node. - \return A pointer to the TriangleSelector or 0, if there - is none. */ - virtual ITriangleSelector* getTriangleSelector() const - { - return TriangleSelector; - } - - - //! Sets the triangle selector of the scene node. - /** The Selector can be used by the engine for doing collision - detection. You can create a TriangleSelector with - ISceneManager::createTriangleSelector() or - ISceneManager::createOctreeTriangleSelector(). Some nodes may - create their own selector by default, so it would be good to - check if there is already a selector in this node by calling - ISceneNode::getTriangleSelector(). - \param selector New triangle selector for this scene node. */ - virtual void setTriangleSelector(ITriangleSelector* selector) - { - if (TriangleSelector != selector) - { - if (TriangleSelector) - TriangleSelector->drop(); - - TriangleSelector = selector; - if (TriangleSelector) - TriangleSelector->grab(); - } - } - - //! Updates the absolute position based on the relative and the parents position /** Note: This does not recursively update the parents absolute positions, so if you have a deeper hierarchy you might want to update the parents first.*/ @@ -778,7 +660,6 @@ namespace scene RelativeRotation = toCopyFrom->RelativeRotation; RelativeScale = toCopyFrom->RelativeScale; ID = toCopyFrom->ID; - setTriangleSelector(toCopyFrom->TriangleSelector); AutomaticCullingState = toCopyFrom->AutomaticCullingState; DebugDataVisible = toCopyFrom->DebugDataVisible; IsVisible = toCopyFrom->IsVisible; @@ -794,19 +675,6 @@ namespace scene ISceneNodeList::Iterator it = toCopyFrom->Children.begin(); for (; it != toCopyFrom->Children.end(); ++it) (*it)->clone(this, newManager); - - // clone animators - - ISceneNodeAnimatorList::Iterator ait = toCopyFrom->Animators.begin(); - for (; ait != toCopyFrom->Animators.end(); ++ait) - { - ISceneNodeAnimator* anim = (*ait)->createClone(this, SceneManager); - if (anim) - { - addAnimator(anim); - anim->drop(); - } - } } //! Sets the new scene manager for this node and all children. @@ -841,15 +709,9 @@ namespace scene //! List of all children of this node core::list Children; - //! List of all animator nodes - core::list Animators; - //! Pointer to the scene manager ISceneManager* SceneManager; - //! Pointer to the triangle selector - ITriangleSelector* TriangleSelector; - //! ID of the node. s32 ID; diff --git a/include/ISceneNodeAnimator.h b/include/ISceneNodeAnimator.h deleted file mode 100644 index cdff7009..00000000 --- a/include/ISceneNodeAnimator.h +++ /dev/null @@ -1,170 +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_SCENE_NODE_ANIMATOR_H_INCLUDED__ -#define __I_SCENE_NODE_ANIMATOR_H_INCLUDED__ - -#include "IReferenceCounted.h" -#include "vector3d.h" -#include "ESceneNodeAnimatorTypes.h" -#include "IAttributeExchangingObject.h" -#include "IAttributes.h" -#include "IEventReceiver.h" - -namespace irr -{ -namespace io -{ - class IAttributes; -} // end namespace io -namespace scene -{ - class ISceneNode; - class ISceneManager; - - //! Animates a scene node. Can animate position, rotation, material, and so on. - /** A scene node animator is able to animate a scene node in a very simple way. It may - change its position, rotation, scale and/or material. There are lots of animators - to choose from. You can create scene node animators with the ISceneManager interface. - */ - class ISceneNodeAnimator : public io::IAttributeExchangingObject, public IEventReceiver - { - public: - ISceneNodeAnimator() : IsEnabled(true), PauseTimeSum(0), PauseTimeStart(0), StartTime(0) - { - } - - //! Animates a scene node. - /** \param node Node to animate. - \param timeMs Current time in milliseconds. */ - virtual void animateNode(ISceneNode* node, u32 timeMs) =0; - - //! Creates a clone of this animator. - /** Please note that you will have to drop - (IReferenceCounted::drop()) the returned pointer after calling this. */ - virtual ISceneNodeAnimator* createClone(ISceneNode* node, - ISceneManager* newManager=0) =0; - - //! Returns true if this animator receives events. - /** When attached to an active camera, this animator will be - able to respond to events such as mouse and keyboard events. */ - virtual bool isEventReceiverEnabled() const - { - return false; - } - - //! Event receiver, override this function for camera controlling animators - virtual bool OnEvent(const SEvent& event) _IRR_OVERRIDE_ - { - return false; - } - - //! Returns type of the scene node animator - virtual ESCENE_NODE_ANIMATOR_TYPE getType() const - { - return ESNAT_UNKNOWN; - } - - //! Returns if the animator has finished. - /** This is only valid for non-looping animators with a discrete end state. - \return true if the animator has finished, false if it is still running. */ - virtual bool hasFinished(void) const - { - return false; - } - - //! Reset a time-based movement by changing the starttime. - /** By default most animators start on object creation. - This value is ignored by animators which don't work with a starttime. - Known problems: CSceneNodeAnimatorRotation currently overwrites this value constantly (might be changed in the future). - \param time Commonly you will use irr::ITimer::getTime(). - \param resetPauseTime Reset internal pause time for enabling/diabling animators as well - */ - virtual void setStartTime(u32 time, bool resetPauseTime=true) - { - StartTime = time; - if ( resetPauseTime ) - { - PauseTimeStart = 0; - PauseTimeSum = 0; - } - } - - //! Get the starttime. - /** This will return 0 for by animators which don't work with a starttime unless a starttime was manually set */ - virtual irr::u32 getStartTime() const - { - return StartTime; - } - - //! Sets the enabled state of this element. - /** - \param enabled When set to false ISceneNodes will not update the animator anymore. - Animators themselves usually don't care. So manual calls to animateNode still work. - \param timeNow When set to values > 0 on enabling and disabling an internal timer will be increased by the time disabled time. - Animator decide themselves how to handle that timer, but generally setting it will allow you to pause an animator, so it - will continue at the same position when you enable it again. To use that pass irr::ITimer::getTime() as value. - Animators with no timers will just ignore this. - */ - virtual void setEnabled(bool enabled, u32 timeNow=0) - { - if ( enabled == IsEnabled ) - return; - IsEnabled = enabled; - if ( enabled ) - { - if ( timeNow > 0 && PauseTimeStart > 0 ) - PauseTimeSum += timeNow-PauseTimeStart; - } - else - { - PauseTimeStart = timeNow; - } - } - - virtual bool isEnabled() const - { - return IsEnabled; - } - - //! Writes attributes of the scene node animator. - virtual void serializeAttributes(io::IAttributes* out, io::SAttributeReadWriteOptions* options=0) const _IRR_OVERRIDE_ - { - out->addBool("IsEnabled", IsEnabled); - // timers not serialized as they usually depend on system-time which is different on each application start. - } - - //! Reads attributes of the scene node animator. - virtual void deserializeAttributes(io::IAttributes* in, io::SAttributeReadWriteOptions* options=0) _IRR_OVERRIDE_ - { - IsEnabled = in->getAttributeAsBool("IsEnabled", IsEnabled); - PauseTimeSum = 0; - PauseTimeStart = 0; - } - - protected: - - /** This method can be used by clone() implementations of - derived classes - \param toCopyFrom The animator from which the values are copied */ - void cloneMembers(const ISceneNodeAnimator* toCopyFrom) - { - IsEnabled = toCopyFrom->IsEnabled; - PauseTimeSum = toCopyFrom->IsEnabled; - PauseTimeStart = toCopyFrom->PauseTimeStart; - StartTime = toCopyFrom->StartTime; - } - - bool IsEnabled; //! Only enabled animators are updated - u32 PauseTimeSum; //! Sum up time which the animator was disabled - u32 PauseTimeStart; //! Last time setEnabled(false) was called with a timer > 0 - u32 StartTime; //! Used by animators which are time-based, ignored otherwise. - }; - - -} // end namespace scene -} // end namespace irr - -#endif - diff --git a/include/ISceneNodeAnimatorCameraFPS.h b/include/ISceneNodeAnimatorCameraFPS.h deleted file mode 100644 index 91a00680..00000000 --- a/include/ISceneNodeAnimatorCameraFPS.h +++ /dev/null @@ -1,75 +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_SCENE_NODE_ANIMATOR_CAMERA_FPS_H_INCLUDED__ -#define __I_SCENE_NODE_ANIMATOR_CAMERA_FPS_H_INCLUDED__ - -#include "ISceneNodeAnimator.h" -#include "IEventReceiver.h" -#include "irrArray.h" - -namespace irr -{ - struct SKeyMap; - -namespace scene -{ - - //! Special scene node animator for FPS cameras - /** This scene node animator can be attached to a camera to make it act - like a first person shooter - */ - class ISceneNodeAnimatorCameraFPS : public ISceneNodeAnimator - { - public: - - //! Returns the speed of movement in units per millisecond - virtual f32 getMoveSpeed() const = 0; - - //! Sets the speed of movement in units per millisecond - virtual void setMoveSpeed(f32 moveSpeed) = 0; - - //! Returns the rotation speed when using keyboard - virtual f32 getRotateSpeedKeyboard() const = 0; - - //! Set the rotation speed when using keyboard - virtual void setRotateSpeedKeyboard(f32 rotateSpeed) = 0; - - //! Returns the rotation speed in degrees when using mouse - /** The degrees are equivalent to a half screen movement of the mouse, - i.e. if the mouse cursor had been moved to the border of the screen since - the last animation. */ - virtual f32 getRotateSpeed() const = 0; - - //! Set the rotation speed in degrees when using mouse - virtual void setRotateSpeed(f32 rotateSpeed) = 0; - - //! Sets the keyboard mapping for this animator (old style) - /** \param map Array of keyboard mappings, see irr::SKeyMap - \param count Size of the keyboard map array. */ - virtual void setKeyMap(SKeyMap *map, u32 count) = 0; - - //! Sets the keyboard mapping for this animator - //! \param keymap The new keymap array - virtual void setKeyMap(const core::array& keymap) = 0; - - //! Gets the keyboard mapping for this animator - virtual const core::array& getKeyMap() const = 0; - - //! Sets whether vertical movement should be allowed. - /** If vertical movement is enabled then the camera may fight with - gravity causing camera shake. Disable this if the camera has - a collision animator with gravity enabled. */ - virtual void setVerticalMovement(bool allow) = 0; - - //! Sets whether the Y axis of the mouse should be inverted. - /** If enabled then moving the mouse down will cause - the camera to look up. It is disabled by default. */ - virtual void setInvertMouse(bool invert) = 0; - }; -} // end namespace scene -} // end namespace irr - -#endif - diff --git a/include/ISceneNodeAnimatorCameraMaya.h b/include/ISceneNodeAnimatorCameraMaya.h deleted file mode 100644 index a1dba263..00000000 --- a/include/ISceneNodeAnimatorCameraMaya.h +++ /dev/null @@ -1,65 +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_SCENE_NODE_ANIMATOR_CAMERA_MAYA_H_INCLUDED__ -#define __I_SCENE_NODE_ANIMATOR_CAMERA_MAYA_H_INCLUDED__ - -#include "ISceneNodeAnimator.h" - -namespace irr -{ - -namespace scene -{ - - //! Special scene node animator for Maya-style cameras - /** This scene node animator can be attached to a camera to make it act like a 3d - modeling tool. - The camera is moving relative to the target with the mouse, by pressing either - of the three buttons. - In order to move the camera, set a new target for the camera. The distance defines - the current orbit radius the camera moves on. Distance can be changed via the setter - or by mouse events. - */ - class ISceneNodeAnimatorCameraMaya : public ISceneNodeAnimator - { - public: - - //! Returns the speed of movement - virtual f32 getMoveSpeed() const = 0; - - //! Sets the speed of movement - virtual void setMoveSpeed(f32 moveSpeed) = 0; - - //! Returns the rotation speed - virtual f32 getRotateSpeed() const = 0; - - //! Set the rotation speed - virtual void setRotateSpeed(f32 rotateSpeed) = 0; - - //! Returns the zoom speed - virtual f32 getZoomSpeed() const = 0; - - //! Set the zoom speed - virtual void setZoomSpeed(f32 zoomSpeed) = 0; - - //! Returns the current distance, i.e. orbit radius - virtual f32 getDistance() const = 0; - - //! Set the distance - virtual void setDistance(f32 distance) = 0; - - //! Set the minimal distance to the camera target for zoom - virtual void setTargetMinDistance(f32 minDistance) = 0; - - //! Returns the minimal distance to the camera target for zoom - virtual f32 getTargetMinDistance() const = 0; - - }; - -} // end namespace scene -} // end namespace irr - -#endif - diff --git a/include/ISceneNodeAnimatorCollisionResponse.h b/include/ISceneNodeAnimatorCollisionResponse.h deleted file mode 100644 index 66334127..00000000 --- a/include/ISceneNodeAnimatorCollisionResponse.h +++ /dev/null @@ -1,171 +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_SCENE_NODE_ANIMATOR_COLLISION_RESPONSE_H_INCLUDED__ -#define __I_SCENE_NODE_ANIMATOR_COLLISION_RESPONSE_H_INCLUDED__ - -#include "ISceneNode.h" - -namespace irr -{ -namespace scene -{ - - class ISceneNodeAnimatorCollisionResponse; - - //! Callback interface for catching events of collisions. - /** Implement this interface and use - ISceneNodeAnimatorCollisionResponse::setCollisionCallback to be able to - be notified if a collision has occurred. - **/ - class ICollisionCallback : public virtual IReferenceCounted - { - public: - - //! Will be called when a collision occurs. - /** See ISceneNodeAnimatorCollisionResponse::setCollisionCallback for more information. - \param animator: Collision response animator in which the collision occurred. You can call - this animator's methods to find the node, collisionPoint and/or collision triangle. - \retval true if the collision was handled in the animator. The animator's target - node will *not* be stopped at the collision point, but will instead move fully - to the location that triggered the collision check. - \retval false if the collision was not handled in the animator. The animator's - target node will be moved to the collision position. - */ - virtual bool onCollision(const ISceneNodeAnimatorCollisionResponse& animator) = 0; - }; - - //! Special scene node animator for doing automatic collision detection and response. - /** This scene node animator can be attached to any single scene node - and will then prevent it from moving through specified collision geometry - (e.g. walls and floors of the) world, as well as having it fall under gravity. - This animator provides a simple implementation of first person shooter cameras. - Attach it to a camera, and the camera will behave as the player control in a - first person shooter game: The camera stops and slides at walls, walks up stairs, - falls down if there is no floor under it, and so on. - - The animator will treat any change in the position of its target scene - node as movement, including a setPosition(), as movement. If you want to - teleport the target scene node manually to a location without it being effected - by collision geometry, then call setTargetNode(node) after calling node->setPosition(). - */ - class ISceneNodeAnimatorCollisionResponse : public ISceneNodeAnimator - { - public: - - //! Destructor - virtual ~ISceneNodeAnimatorCollisionResponse() {} - - //! Check if the attached scene node is falling. - /** Falling means that there is no blocking wall from the scene - node in the direction of the gravity. The implementation of - this method is very fast, no collision detection is done when - invoking it. - \return True if the scene node is falling, false if not. */ - virtual bool isFalling() const = 0; - - //! Sets the radius of the ellipsoid for collision detection and response. - /** If you have a scene node, and you are unsure about how big - the radius should be, you could use the following code to - determine it: - \code - core::aabbox box = yourSceneNode->getBoundingBox(); - core::vector3df radius = box.MaxEdge - box.getCenter(); - \endcode - \param radius: New radius of the ellipsoid. */ - virtual void setEllipsoidRadius(const core::vector3df& radius) = 0; - - //! Returns the radius of the ellipsoid for collision detection and response. - /** \return Radius of the ellipsoid. */ - virtual core::vector3df getEllipsoidRadius() const = 0; - - //! Sets the gravity of the environment. - /** A good example value would be core::vector3df(0,-100.0f,0) - for letting gravity affect all object to fall down. For bigger - gravity, make increase the length of the vector. You can - disable gravity by setting it to core::vector3df(0,0,0); - \param gravity: New gravity vector. */ - virtual void setGravity(const core::vector3df& gravity) = 0; - - //! Get current vector of gravity. - //! \return Gravity vector. */ - virtual core::vector3df getGravity() const = 0; - - //! 'Jump' the animator, by adding a jump speed opposite to its gravity - /** \param jumpSpeed The initial speed of the jump; the velocity will be opposite - to this animator's gravity vector. */ - virtual void jump(f32 jumpSpeed) = 0; - - //! Should the Target react on collision ( default = true ) - virtual void setAnimateTarget ( bool enable ) = 0; - virtual bool getAnimateTarget () const = 0; - - //! Set translation of the collision ellipsoid. - /** By default, the ellipsoid for collision detection is - created around the center of the scene node, which means that - the ellipsoid surrounds it completely. If this is not what you - want, you may specify a translation for the ellipsoid. - \param translation: Translation of the ellipsoid relative - to the position of the scene node. */ - virtual void setEllipsoidTranslation(const core::vector3df &translation) = 0; - - //! Get the translation of the ellipsoid for collision detection. - /** See - ISceneNodeAnimatorCollisionResponse::setEllipsoidTranslation() - for more details. - \return Translation of the ellipsoid relative to the position - of the scene node. */ - virtual core::vector3df getEllipsoidTranslation() const = 0; - - //! Sets a triangle selector holding all triangles of the world with which the scene node may collide. - /** \param newWorld: New triangle selector containing triangles - to let the scene node collide with. */ - virtual void setWorld(ITriangleSelector* newWorld) = 0; - - //! Get the current triangle selector containing all triangles for collision detection. - virtual ITriangleSelector* getWorld() const = 0; - - //! Set the single node that this animator will act on. - /** \param node The new target node. Setting this will force the animator to update - its last target position for the node, allowing setPosition() to teleport - the node through collision geometry. */ - virtual void setTargetNode(ISceneNode * node) = 0; - - //! Gets the single node that this animator is acting on. - /** \return The node that this animator is acting on. */ - virtual ISceneNode* getTargetNode(void) const = 0; - - //! Returns true if a collision occurred during the last animateNode() - virtual bool collisionOccurred() const = 0; - - //! Returns the last point of collision. - virtual const core::vector3df & getCollisionPoint() const = 0; - - //! Returns the last triangle that caused a collision - virtual const core::triangle3df & getCollisionTriangle() const = 0; - - //! Returns the position that the target node will be moved to, unless the collision is consumed in a callback. - /** - If you have a collision callback registered, and it consumes the collision, then the - node will ignore the collision and will not stop at this position. Instead, it will - move fully to the position that caused the collision to occur. */ - virtual const core::vector3df & getCollisionResultPosition(void) const = 0; - - //! Returns the node that was collided with. - virtual ISceneNode* getCollisionNode(void) const = 0; - - //! Sets a callback interface which will be called if a collision occurs. - /** \param callback: collision callback handler that will be called when a collision - occurs. Set this to 0 to disable the callback. - */ - virtual void setCollisionCallback(ICollisionCallback* callback) = 0; - - }; - - -} // end namespace scene -} // end namespace irr - -#endif - diff --git a/include/ISceneNodeAnimatorFactory.h b/include/ISceneNodeAnimatorFactory.h deleted file mode 100644 index a50703f2..00000000 --- a/include/ISceneNodeAnimatorFactory.h +++ /dev/null @@ -1,69 +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_SCENE_NODE_ANIMATOR_FACTORY_H_INCLUDED__ -#define __I_SCENE_NODE_ANIMATOR_FACTORY_H_INCLUDED__ - -#include "IReferenceCounted.h" -#include "ESceneNodeAnimatorTypes.h" - -namespace irr -{ -namespace scene -{ - class ISceneNode; - class ISceneNodeAnimator; - - //! Interface for dynamic creation of scene node animators - /** To be able to add custom scene node animators to Irrlicht and to make it possible for the - scene manager to save and load those external animators, simply implement this - interface and register it in you scene manager via ISceneManager::registerSceneNodeAnimatorFactory. - Note: When implementing your own scene node factory, don't call ISceneNodeManager::grab() to - increase the reference counter of the scene node manager. This is not necessary because the - scene node manager will grab() the factory anyway, and otherwise cyclic references will - be created and the scene manager and all its nodes won't get deallocated. - */ - class ISceneNodeAnimatorFactory : public virtual IReferenceCounted - { - public: - - //! creates a scene node animator based on its type id - /** \param type: Type of the scene node animator to add. - \param target: Target scene node of the new animator. - \return Returns pointer to the new scene node animator or null if not successful. You need to - drop this pointer after calling this, see IReferenceCounted::drop() for details. */ - virtual ISceneNodeAnimator* createSceneNodeAnimator(ESCENE_NODE_ANIMATOR_TYPE type, ISceneNode* target) = 0; - - //! creates a scene node animator based on its type name - /** \param typeName: Type of the scene node animator to add. - \param target: Target scene node of the new animator. - \return Returns pointer to the new scene node animator or null if not successful. You need to - drop this pointer after calling this, see IReferenceCounted::drop() for details. */ - virtual ISceneNodeAnimator* createSceneNodeAnimator(const c8* typeName, ISceneNode* target) = 0; - - //! returns amount of scene node animator types this factory is able to create - virtual u32 getCreatableSceneNodeAnimatorTypeCount() const = 0; - - //! returns type of a creatable scene node animator type - /** \param idx: Index of scene node animator type in this factory. Must be a value between 0 and - getCreatableSceneNodeTypeCount() */ - virtual ESCENE_NODE_ANIMATOR_TYPE getCreateableSceneNodeAnimatorType(u32 idx) const = 0; - - //! returns type name of a creatable scene node animator type - /** \param idx: Index of scene node animator type in this factory. Must be a value between 0 and - getCreatableSceneNodeAnimatorTypeCount() */ - virtual const c8* getCreateableSceneNodeAnimatorTypeName(u32 idx) const = 0; - - //! returns type name of a creatable scene node animator type - /** \param type: Type of scene node animator. - \return: Returns name of scene node animator type if this factory can create the type, otherwise 0. */ - virtual const c8* getCreateableSceneNodeAnimatorTypeName(ESCENE_NODE_ANIMATOR_TYPE type) const = 0; - }; - - -} // end namespace scene -} // end namespace irr - -#endif - diff --git a/include/IShadowVolumeSceneNode.h b/include/IShadowVolumeSceneNode.h deleted file mode 100644 index f19e6aab..00000000 --- a/include/IShadowVolumeSceneNode.h +++ /dev/null @@ -1,65 +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_SHADOW_VOLUME_SCENE_NODE_H_INCLUDED__ -#define __I_SHADOW_VOLUME_SCENE_NODE_H_INCLUDED__ - -#include "ISceneNode.h" - -namespace irr -{ -namespace scene -{ - class IMesh; - - enum ESHADOWVOLUME_OPTIMIZATION - { - //! Create volumes around every triangle - ESV_NONE, - - //! Create volumes only around the silhouette of the mesh - /** This can reduce the number of volumes drastically, - but will have an upfront-cost where it calculates adjacency of - triangles. Also it will not work with all models. Basically - if you see strange black shadow lines then you have a model - for which it won't work. - We get that information about adjacency by comparing the positions of - all edges in the mesh (even if they are in different meshbuffers). */ - ESV_SILHOUETTE_BY_POS - }; - - //! Scene node for rendering a shadow volume into a stencil buffer. - class IShadowVolumeSceneNode : public ISceneNode - { - public: - - //! constructor - IShadowVolumeSceneNode(ISceneNode* parent, ISceneManager* mgr, s32 id) - : ISceneNode(parent, mgr, id) {} - - //! Sets the mesh from which the shadow volume should be generated. - /** To optimize shadow rendering, use a simpler mesh for shadows. - */ - virtual void setShadowMesh(const IMesh* mesh) = 0; - - //! Updates the shadow volumes for current light positions. - virtual void updateShadowVolumes() = 0; - - //! Set optimization used to create shadow volumes - /** Default is ESV_SILHOUETTE_BY_POS. If the shadow - looks bad then give ESV_NONE a try (which will be slower). - Alternatively you can try to fix the model, it's often - because it's not closed (aka if you'd put water in it then - that would leak out). */ - virtual void setOptimization(ESHADOWVOLUME_OPTIMIZATION optimization) = 0; - - //! Get currently active optimization used to create shadow volumes - virtual ESHADOWVOLUME_OPTIMIZATION getOptimization() const = 0; - }; - -} // end namespace scene -} // end namespace irr - -#endif - diff --git a/include/ITerrainSceneNode.h b/include/ITerrainSceneNode.h deleted file mode 100644 index b0c822ce..00000000 --- a/include/ITerrainSceneNode.h +++ /dev/null @@ -1,190 +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 - -// The code for the TerrainSceneNode is based on the terrain renderer by -// Soconne and the GeoMipMapSceneNode developed by Spintz. They made their -// code available for Irrlicht and allowed it to be distributed under this -// licence. I only modified some parts. A lot of thanks go to them. - -#ifndef __I_TERRAIN_SCENE_NODE_H__ -#define __I_TERRAIN_SCENE_NODE_H__ - -#include "ETerrainElements.h" -#include "ISceneNode.h" -#include "IDynamicMeshBuffer.h" -#include "irrArray.h" - -namespace irr -{ -namespace io -{ - class IReadFile; -} // end namespace io -namespace scene -{ - class IMesh; - - //! A scene node for displaying terrain using the geo mip map algorithm. - /** The code for the TerrainSceneNode is based on the Terrain renderer by Soconne and - * the GeoMipMapSceneNode developed by Spintz. They made their code available for Irrlicht - * and allowed it to be distributed under this licence. I only modified some parts. - * A lot of thanks go to them. - * - * This scene node is capable of very quickly loading - * terrains and updating the indices at runtime to enable viewing very large terrains. It uses a - * CLOD (Continuous Level of Detail) algorithm which updates the indices for each patch based on - * a LOD (Level of Detail) which is determined based on a patch's distance from the camera. - * - * The Patch Size of the terrain must always be a size of ( 2^N+1, i.e. 8+1(9), 16+1(17), etc. ). - * The MaxLOD available is directly dependent on the patch size of the terrain. LOD 0 contains all - * of the indices to draw all the triangles at the max detail for a patch. As each LOD goes up by 1 - * the step taken, in generating indices increases by - 2^LOD, so for LOD 1, the step taken is 2, for - * LOD 2, the step taken is 4, LOD 3 - 8, etc. The step can be no larger than the size of the patch, - * so having a LOD of 8, with a patch size of 17, is asking the algorithm to generate indices every - * 2^8 ( 256 ) vertices, which is not possible with a patch size of 17. The maximum LOD for a patch - * size of 17 is 2^4 ( 16 ). So, with a MaxLOD of 5, you'll have LOD 0 ( full detail ), LOD 1 ( every - * 2 vertices ), LOD 2 ( every 4 vertices ), LOD 3 ( every 8 vertices ) and LOD 4 ( every 16 vertices ). - **/ - class ITerrainSceneNode : public ISceneNode - { - public: - //! Constructor - ITerrainSceneNode(ISceneNode* parent, ISceneManager* mgr, s32 id, - const core::vector3df& position = core::vector3df(0.0f, 0.0f, 0.0f), - const core::vector3df& rotation = core::vector3df(0.0f, 0.0f, 0.0f), - const core::vector3df& scale = core::vector3df(1.0f, 1.0f, 1.0f) ) - : ISceneNode (parent, mgr, id, position, rotation, scale) {} - - //! Get the bounding box of the terrain. - /** \return The bounding box of the entire terrain. */ - virtual const core::aabbox3d& getBoundingBox() const =0; - - //! Get the bounding box of a patch - /** \return The bounding box of the chosen patch. */ - virtual const core::aabbox3d& getBoundingBox(s32 patchX, s32 patchZ) const =0; - - //! Get the number of indices currently in the meshbuffer - /** \return The index count. */ - virtual u32 getIndexCount() const =0; - - //! Get pointer to the mesh - /** \return Pointer to the mesh. */ - virtual IMesh* getMesh() =0; - - //! Get pointer to the buffer used by the terrain (most users will not need this) - virtual IMeshBuffer* getRenderBuffer() =0; - - - //! Gets the meshbuffer data based on a specified level of detail. - /** \param mb A reference to an IDynamicMeshBuffer object - \param LOD The level of detail you want the indices from. */ - virtual void getMeshBufferForLOD(IDynamicMeshBuffer& mb, s32 LOD=0) const =0; - - //! Gets the indices for a specified patch at a specified Level of Detail. - /** \param indices A reference to an array of u32 indices. - \param patchX Patch x coordinate. - \param patchZ Patch z coordinate. - \param LOD The level of detail to get for that patch. If -1, - then get the CurrentLOD. If the CurrentLOD is set to -1, - meaning it's not shown, then it will retrieve the triangles at - the highest LOD (0). - \return Number of indices put into the buffer. */ - virtual s32 getIndicesForPatch(core::array& indices, - s32 patchX, s32 patchZ, s32 LOD=0) =0; - - //! Populates an array with the CurrentLOD of each patch. - /** \param LODs A reference to a core::array to hold the - values - \return Number of elements in the array */ - virtual s32 getCurrentLODOfPatches(core::array& LODs) const =0; - - //! Manually sets the LOD of a patch - /** NOTE: Any values set here are overwritten again in the automatic - recalculations when the camera changes. - \param patchX Patch x coordinate. - \param patchZ Patch z coordinate. - \param LOD The level of detail to set the patch to. */ - virtual void setLODOfPatch(s32 patchX, s32 patchZ, s32 LOD=0) =0; - - //! Get center of terrain. - virtual const core::vector3df& getTerrainCenter() const =0; - - //! Get height of a point of the terrain. - virtual f32 getHeight(f32 x, f32 y) const =0; - - //! Sets the movement camera threshold. - /** It is used to determine when to recalculate - indices for the scene node. The default value is 10.0f. */ - virtual void setCameraMovementDelta(f32 delta) =0; - - //! Sets the rotation camera threshold. - /** It is used to determine when to recalculate - indices for the scene node. The default value is 1.0f. */ - virtual void setCameraRotationDelta(f32 delta) =0; - - //! Sets whether or not the node should dynamically update its associated selector when the geomipmap data changes. - /** \param bVal: Boolean value representing whether or not to update selector dynamically. */ - virtual void setDynamicSelectorUpdate(bool bVal) =0; - - //! Override the default generation of distance thresholds. - /** For determining the LOD a patch is rendered at. If any LOD - is overridden, then the scene node will no longer apply scaling - factors to these values. If you override these distances, and - then apply a scale to the scene node, it is your responsibility - to update the new distances to work best with your new terrain - size. */ - virtual bool overrideLODDistance(s32 LOD, f64 newDistance) =0; - - //! Scales the base texture, similar to makePlanarTextureMapping. - /** \param scale The scaling amount. Values above 1.0 - increase the number of time the texture is drawn on the - terrain. Values below 0 will decrease the number of times the - texture is drawn on the terrain. Using negative values will - flip the texture, as well as still scaling it. - \param scale2 If set to 0 (default value), this will set the - second texture coordinate set to the same values as in the - first set. If this is another value than zero, it will scale - the second texture coordinate set by this value. */ - virtual void scaleTexture(f32 scale = 1.0f, f32 scale2=0.0f) =0; - - //! Initializes the terrain data. Loads the vertices from the heightMapFile. - /** The file must contain a loadable image of the heightmap. The heightmap - must be square. - \param file The file to read the image from. File is not rewinded. - \param vertexColor Color of all vertices. - \param smoothFactor Number of smoothing passes. */ - virtual bool loadHeightMap(io::IReadFile* file, - video::SColor vertexColor=video::SColor(255,255,255,255), - s32 smoothFactor=0) =0; - - //! Initializes the terrain data. Loads the vertices from the heightMapFile. - /** The data is interpreted as (signed) integers of the given bit size or - floats (with 32bits, signed). Allowed bitsizes for integers are - 8, 16, and 32. The heightmap must be square. - \param file The file to read the RAW data from. File is not rewinded. - \param bitsPerPixel Size of data if integers used, for floats always use 32. - \param signedData Whether we use signed or unsigned ints, ignored for floats. - \param floatVals Whether the data is float or int. - \param width Width (and also Height, as it must be square) of the heightmap. Use 0 for autocalculating from the filesize. - \param vertexColor Color of all vertices. - \param smoothFactor Number of smoothing passes. */ - virtual bool loadHeightMapRAW(io::IReadFile* file, s32 bitsPerPixel=16, - bool signedData=false, bool floatVals=false, s32 width=0, - video::SColor vertexColor=video::SColor(255,255,255,255), - s32 smoothFactor=0) =0; - - //! Force node to use a fixed LOD level at the borders of the terrain. - /** This can be useful when several TerrainSceneNodes are connected. - \param borderLOD When >= 0 all patches at the 4 borders will use the - given LOD. When < 0 borders are just regular patches (that's default). */ - virtual void setFixedBorderLOD(irr::s32 borderLOD=0) = 0; - - }; - -} // end namespace scene -} // end namespace irr - - -#endif // __I_TERRAIN_SCENE_NODE_H__ - diff --git a/include/ITextSceneNode.h b/include/ITextSceneNode.h deleted file mode 100644 index 2e12379f..00000000 --- a/include/ITextSceneNode.h +++ /dev/null @@ -1,55 +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_TEXT_SCENE_NODE_H_INCLUDED__ -#define __I_TEXT_SCENE_NODE_H_INCLUDED__ - -#include "ISceneNode.h" - -namespace irr -{ - -namespace gui -{ - class IGUIFont; -} - -namespace scene -{ - -//! A scene node for displaying 2d text at a position in three dimensional space -class ITextSceneNode : public ISceneNode -{ -public: - - //! constructor - ITextSceneNode(ISceneNode* parent, ISceneManager* mgr, s32 id, - const core::vector3df& position = core::vector3df(0,0,0)) - : ISceneNode(parent, mgr, id, position) {} - - //! sets the text string - virtual void setText(const wchar_t* text) = 0; - - //! get the text string - virtual const wchar_t* getText() const = 0; - - //! sets the color of the text - virtual void setTextColor(video::SColor color) = 0; - - //! get the color of the text - virtual video::SColor getTextColor() const = 0; - - //! set the font used to draw the text - virtual void setFont(gui::IGUIFont* font) = 0; - - //! Get the font used to draw the text - virtual gui::IGUIFont* getFont() const = 0; -}; - -} // end namespace scene -} // end namespace irr - - -#endif - diff --git a/include/ITriangleSelector.h b/include/ITriangleSelector.h deleted file mode 100644 index 04aa0467..00000000 --- a/include/ITriangleSelector.h +++ /dev/null @@ -1,195 +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_TRIANGLE_SELECTOR_H_INCLUDED__ -#define __I_TRIANGLE_SELECTOR_H_INCLUDED__ - -#include "IReferenceCounted.h" -#include "triangle3d.h" -#include "aabbox3d.h" -#include "matrix4.h" -#include "line3d.h" -#include "irrArray.h" - -namespace irr -{ -namespace scene -{ - -class ISceneNode; -class ITriangleSelector; -class IMeshBuffer; - -//! Additional information about the triangle arrays returned by ITriangleSelector::getTriangles -/** ITriangleSelector are free to fill out this information fully, partly or ignore it. - Usually they will try to fill it when they can and set values to 0 otherwise. -*/ -struct SCollisionTriangleRange -{ - SCollisionTriangleRange() - : RangeStart(0), RangeSize(0) - , Selector(0), SceneNode(0) - , MeshBuffer(0), MaterialIndex(0) - {} - - //! Check if this triangle index inside the range - /** - \param triangleIndex Index to an element inside the array of triangles returned by ITriangleSelector::getTriangles - */ - bool isIndexInRange(irr::u32 triangleIndex) const - { - return triangleIndex >= RangeStart && triangleIndex < RangeStart+RangeSize; - } - - //! First index in the returned triangle array for which this struct is valid - irr::u32 RangeStart; - - //! Number of elements in the returned triangle array for which this struct is valid (starting with RangeStart) - irr::u32 RangeSize; - - //! Real selector which contained those triangles (useful when working with MetaTriangleSelector) - ITriangleSelector* Selector; - - //! SceneNode from which the triangles are from - ISceneNode* SceneNode; - - //! Meshbuffer from which the triangles are from - //! Is 0 when the ITriangleSelector doesn't support meshbuffer selection - const IMeshBuffer* MeshBuffer; - - //! Index of selected material in the SceneNode. Usually only valid when MeshBuffer is also set, otherwise always 0 - irr::u32 MaterialIndex; -}; - -//! Interface to return triangles with specific properties. -/** Every ISceneNode may have a triangle selector, available with -ISceneNode::getTriangleSelector() or ISceneManager::createTriangleSelector. -This is used for doing collision detection: For example if you know, that a -collision may have happened in the area between (1,1,1) and (10,10,10), you -can get all triangles of the scene node in this area with the -ITriangleSelector easily and check every triangle if it collided. */ -class ITriangleSelector : public virtual IReferenceCounted -{ -public: - - //! Get amount of all available triangles in this selector - virtual s32 getTriangleCount() const = 0; - - //! Gets the triangles for one associated node. - /** - This returns all triangles for one scene node associated with this - selector. If there is more than one scene node associated (e.g. for - an IMetaTriangleSelector) this this function may be called multiple - times to retrieve all triangles. - \param triangles Array where the resulting triangles will be - written to. - \param arraySize Size of the target array. - \param outTriangleCount: Amount of triangles which have been written - into the array. - \param transform Pointer to matrix for transforming the triangles - before they are returned. Useful for example to scale all triangles - down into an ellipsoid space. - \param useNodeTransform When the selector has a node then transform the - triangles by that node's transformation matrix. - \param outTriangleInfo When a pointer to an array is passed then that - array is filled with additional information about the returned triangles. - One element of SCollisionTriangleRange added for each range of triangles which - has distinguishable information. For example one range per meshbuffer. - */ - virtual void getTriangles(core::triangle3df* triangles, s32 arraySize, - s32& outTriangleCount, const core::matrix4* transform=0, - bool useNodeTransform=true, - irr::core::array* outTriangleInfo=0) const = 0; - - //! Gets the triangles for one associated node which may lie within a specific bounding box. - /** - This returns all triangles for one scene node associated with this - selector. If there is more than one scene node associated (e.g. for - an IMetaTriangleSelector) this this function may be called multiple - times to retrieve all triangles. - - This method will return at least the triangles that intersect the box, - but may return other triangles as well. - \param triangles Array where the resulting triangles will be written - to. - \param arraySize Size of the target array. - \param outTriangleCount Amount of triangles which have been written - into the array. - \param box Only triangles which are in this axis aligned bounding box - will be written into the array. - \param transform Pointer to matrix for transforming the triangles - before they are returned. Useful for example to scale all triangles - down into an ellipsoid space. - \param useNodeTransform When the selector has a node then transform the - triangles by that node's transformation matrix. - \param outTriangleInfo When a pointer to an array is passed then that - array is filled with additional information about the returned triangles. - One element of SCollisionTriangleRange added for each range of triangles which - has distinguishable information. For example one range per meshbuffer. */ - virtual void getTriangles(core::triangle3df* triangles, s32 arraySize, - s32& outTriangleCount, const core::aabbox3d& box, - const core::matrix4* transform=0, bool useNodeTransform=true, - irr::core::array* outTriangleInfo=0) const = 0; - - //! Gets the triangles for one associated node which have or may have contact with a 3d line. - /** - This returns all triangles for one scene node associated with this - selector. If there is more than one scene node associated (e.g. for - an IMetaTriangleSelector) this this function may be called multiple - times to retrieve all triangles. - - Please note that unoptimized triangle selectors also may return - triangles which are not in contact at all with the 3d line. - \param triangles Array where the resulting triangles will be written - to. - \param arraySize Size of the target array. - \param outTriangleCount Amount of triangles which have been written - into the array. - \param line Only triangles which may be in contact with this 3d line - will be written into the array. - \param transform Pointer to matrix for transforming the triangles - before they are returned. Useful for example to scale all triangles - down into an ellipsoid space. - \param useNodeTransform When the selector has a node then transform the - triangles by that node's transformation matrix. - \param outTriangleInfo When a pointer to an array is passed then that - array is filled with additional information about the returned triangles. - One element of SCollisionTriangleRange added for each range of triangles which - has distinguishable information. For example one range per meshbuffer. */ - virtual void getTriangles(core::triangle3df* triangles, s32 arraySize, - s32& outTriangleCount, const core::line3d& line, - const core::matrix4* transform=0, bool useNodeTransform=true, - irr::core::array* outTriangleInfo=0) const = 0; - - //! Get number of TriangleSelectors that are part of this one - /** Only useful for MetaTriangleSelector, others return 1 - */ - virtual u32 getSelectorCount() const = 0; - - //! Get TriangleSelector based on index based on getSelectorCount - /** Only useful for MetaTriangleSelector, others return 'this' or 0 - */ - virtual ITriangleSelector* getSelector(u32 index) = 0; - - //! Get TriangleSelector based on index based on getSelectorCount - /** Only useful for MetaTriangleSelector, others return 'this' or 0 - */ - virtual const ITriangleSelector* getSelector(u32 index) const = 0; - - //! Get scene node associated with a given triangle. - /** With CMetaTriangleSelector-selectors it's possible to find out a node - belonging to a certain triangle index. - NOTE: triangleIndex has nothing to do with the order of triangles returned by getTriangles functions! - So you can _not_ use this function to find out anything about to which node returned triangles belong. - Use STriangleCollisionInfo struct for that. - \param triangleIndex: the index of the triangle for which you want to find. - \return The scene node associated with that triangle. - */ - virtual ISceneNode* getSceneNodeForTriangle(u32 triangleIndex) const = 0; -}; - -} // end namespace scene -} // end namespace irr - -#endif diff --git a/include/IVolumeLightSceneNode.h b/include/IVolumeLightSceneNode.h deleted file mode 100644 index d67dff58..00000000 --- a/include/IVolumeLightSceneNode.h +++ /dev/null @@ -1,60 +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 -// -// created by Dean Wadsworth aka Varmint Dec 31 2007 - -#ifndef __I_VOLUME_LIGHT_SCENE_NODE_H_INCLUDED__ -#define __I_VOLUME_LIGHT_SCENE_NODE_H_INCLUDED__ - -#include "ISceneNode.h" - -namespace irr -{ -namespace scene -{ - class IMeshBuffer; - - class IVolumeLightSceneNode : public ISceneNode - { - public: - - //! constructor - IVolumeLightSceneNode(ISceneNode* parent, ISceneManager* mgr, s32 id, - const core::vector3df& position, - const core::vector3df& rotation, - const core::vector3df& scale) - : ISceneNode(parent, mgr, id, position, rotation, scale) {}; - - //! Returns type of the scene node - virtual ESCENE_NODE_TYPE getType() const _IRR_OVERRIDE_ { return ESNT_VOLUME_LIGHT; } - - //! Sets the number of segments across the U axis - virtual void setSubDivideU(const u32 inU) =0; - - //! Sets the number of segments across the V axis - virtual void setSubDivideV(const u32 inV) =0; - - //! Returns the number of segments across the U axis - virtual u32 getSubDivideU() const =0; - - //! Returns the number of segments across the V axis - virtual u32 getSubDivideV() const =0; - - //! Sets the color of the base of the light - virtual void setFootColor(const video::SColor inColor) =0; - - //! Sets the color of the tip of the light - virtual void setTailColor(const video::SColor inColor) =0; - - //! Returns the color of the base of the light - virtual video::SColor getFootColor() const =0; - - //! Returns the color of the tip of the light - virtual video::SColor getTailColor() const =0; - }; - -} // end namespace scene -} // end namespace irr - -#endif diff --git a/include/IrrCompileConfig.h b/include/IrrCompileConfig.h index ccdeec8e..ac3715f5 100644 --- a/include/IrrCompileConfig.h +++ b/include/IrrCompileConfig.h @@ -190,12 +190,6 @@ If not defined, Windows Multimedia library is used, which offers also broad supp #undef _IRR_COMPILE_WITH_DIRECTINPUT_JOYSTICK_ #endif -//! enabled Direct3D 9 -#define _IRR_COMPILE_WITH_DIRECT3D_9_ -#ifdef NO_IRR_COMPILE_WITH_DIRECT3D_9_ -#undef _IRR_COMPILE_WITH_DIRECT3D_9_ -#endif - #endif //! Define _IRR_COMPILE_WITH_OPENGL_ to compile the Irrlicht engine with OpenGL. @@ -292,21 +286,6 @@ define out. */ -//! Define _IRR_COMPILE_WITH_SOFTWARE_ to compile the Irrlicht engine with software driver -/** If you do not need the software driver, or want to use Burning's Video instead, -comment this define out */ -//#define _IRR_COMPILE_WITH_SOFTWARE_ -#ifdef NO_IRR_COMPILE_WITH_SOFTWARE_ -#undef _IRR_COMPILE_WITH_SOFTWARE_ -#endif - -//! Define _IRR_COMPILE_WITH_BURNINGSVIDEO_ to compile the Irrlicht engine with Burning's video driver -/** If you do not need this software driver, you can comment this define out. */ -//#define _IRR_COMPILE_WITH_BURNINGSVIDEO_ -#ifdef NO_IRR_COMPILE_WITH_BURNINGSVIDEO_ -#undef _IRR_COMPILE_WITH_BURNINGSVIDEO_ -#endif - //! Define _IRR_COMPILE_WITH_X11_ to compile the Irrlicht engine with X11 support. /** If you do not wish the engine to be compiled with X11, comment this define out. */ @@ -351,13 +330,6 @@ you will not be able to use anything provided by the GUI Environment, including #undef _IRR_COMPILE_WITH_GUI_ #endif -//! Define _IRR_COMPILE_WITH_PARTICLES to compile the engine the withe build-in particle system -/** You can disable this if you don't need particles or use an external particle system. */ -#define _IRR_COMPILE_WITH_PARTICLES_ -#ifdef NO_IRR_COMPILE_WITH_PARTICLES_ -#undef _IRR_COMPILE_WITH_PARTICLES_ -#endif - //! Define _IRR_WCHAR_FILESYSTEM to enable unicode filesystem support for the engine. /** This enables the engine to read/write from unicode filesystem. If you disable this feature, the engine behave as before (ansi). This is currently only supported @@ -432,69 +404,9 @@ tool . */ 16Bit + SubPixel/SubTexel Correct + ZBuffer */ -#define BURNINGVIDEO_RENDERER_BEAUTIFUL -//#define BURNINGVIDEO_RENDERER_FAST -//#define BURNINGVIDEO_RENDERER_ULTRA_FAST -//#define BURNINGVIDEO_RENDERER_CE - //! Uncomment the following line if you want to ignore the deprecated warnings //#define IGNORE_DEPRECATED_WARNING -//! Define _IRR_COMPILE_WITH_SHADOW_VOLUME_SCENENODE_ to support ShadowVolumes -#define _IRR_COMPILE_WITH_SHADOW_VOLUME_SCENENODE_ -#ifdef NO_IRR_COMPILE_WITH_SHADOW_VOLUME_SCENENODE_ -#undef _IRR_COMPILE_WITH_SHADOW_VOLUME_SCENENODE_ -#endif - -//! Define _IRR_COMPILE_WITH_OCTREE_SCENENODE_ to support OctreeSceneNodes -#define _IRR_COMPILE_WITH_OCTREE_SCENENODE_ -#ifdef NO_IRR_COMPILE_WITH_OCTREE_SCENENODE_ -#undef _IRR_COMPILE_WITH_OCTREE_SCENENODE_ -#endif - -//! Define _IRR_COMPILE_WITH_TERRAIN_SCENENODE_ to support TerrainSceneNodes -#define _IRR_COMPILE_WITH_TERRAIN_SCENENODE_ -#ifdef NO_IRR_COMPILE_WITH_TERRAIN_SCENENODE_ -#undef _IRR_COMPILE_WITH_TERRAIN_SCENENODE_ -#endif - -//! Define _IRR_COMPILE_WITH_BILLBOARD_SCENENODE_ to support BillboardSceneNodes -#define _IRR_COMPILE_WITH_BILLBOARD_SCENENODE_ -#ifdef NO_IRR_COMPILE_WITH_BILLBOARD_SCENENODE_ -#undef _IRR_COMPILE_WITH_BILLBOARD_SCENENODE_ -#endif - -//! Define _IRR_COMPILE_WITH_WATER_SURFACE_SCENENODE_ to support WaterSurfaceSceneNodes -#define _IRR_COMPILE_WITH_WATER_SURFACE_SCENENODE_ -#ifdef NO_IRR_COMPILE_WITH_WATER_SURFACE_SCENENODE_ -#undef _IRR_COMPILE_WITH_WATER_SURFACE_SCENENODE_ -#endif - -//! Define _IRR_COMPILE_WITH_SKYDOME_SCENENODE_ to support SkydomeSceneNodes -#define _IRR_COMPILE_WITH_SKYDOME_SCENENODE_ -#ifdef NO_IRR_COMPILE_WITH_SKYDOME_SCENENODE_ -#undef _IRR_COMPILE_WITH_SKYDOME_SCENENODE_ -#endif - -//! Define _IRR_COMPILE_WITH_CUBE_SCENENODE_ to support CubeSceneNodes -#define _IRR_COMPILE_WITH_CUBE_SCENENODE_ -#ifdef NO_IRR_COMPILE_WITH_CUBE_SCENENODE_ -#undef _IRR_COMPILE_WITH_CUBE_SCENENODE_ -#endif - -//! Define _IRR_COMPILE_WITH_SPHERE_SCENENODE_ to support CubeSceneNodes -#define _IRR_COMPILE_WITH_SPHERE_SCENENODE_ -#ifdef NO_IRR_COMPILE_WITH_SPHERE_SCENENODE_ -#undef _IRR_COMPILE_WITH_SPHERE_SCENENODE_ -#endif - -//! Define _IRR_COMPILE_WITH_IRR_SCENE_LOADER_ if you want to be able to load -/** .irr scenes using ISceneManager::loadScene */ -#define _IRR_COMPILE_WITH_IRR_SCENE_LOADER_ -#ifdef NO_IRR_COMPILE_WITH_IRR_SCENE_LOADER_ -#undef _IRR_COMPILE_WITH_IRR_SCENE_LOADER_ -#endif - //! Define _IRR_COMPILE_WITH_SKINNED_MESH_SUPPORT_ if you want to use bone based /** animated meshes. If you compile without this, you will be unable to load B3D, MS3D or X meshes */ @@ -509,119 +421,18 @@ B3D, MS3D or X meshes */ #ifdef NO_IRR_COMPILE_WITH_B3D_LOADER_ #undef _IRR_COMPILE_WITH_B3D_LOADER_ #endif -//! Define _IRR_COMPILE_WITH_MS3D_LOADER_ if you want to Milkshape files -#define _IRR_COMPILE_WITH_MS3D_LOADER_ -#ifdef NO_IRR_COMPILE_WITH_MS3D_LOADER_ -#undef _IRR_COMPILE_WITH_MS3D_LOADER_ -#endif //! Define _IRR_COMPILE_WITH_X_LOADER_ if you want to use Microsoft X files #define _IRR_COMPILE_WITH_X_LOADER_ #ifdef NO_IRR_COMPILE_WITH_X_LOADER_ #undef _IRR_COMPILE_WITH_X_LOADER_ #endif -//! Define _IRR_COMPILE_WITH_OGRE_LOADER_ if you want to load Ogre 3D files -#define _IRR_COMPILE_WITH_OGRE_LOADER_ -#ifdef NO_IRR_COMPILE_WITH_OGRE_LOADER_ -#undef _IRR_COMPILE_WITH_OGRE_LOADER_ -#endif #endif // _IRR_COMPILE_WITH_SKINNED_MESH_SUPPORT_ -//! Define _IRR_COMPILE_WITH_HALFLIFE_LOADER_ if you want to load Halflife animated files -#define _IRR_COMPILE_WITH_HALFLIFE_LOADER_ -#ifdef NO_IRR_COMPILE_WITH_HALFLIFE_LOADER_ -#undef _IRR_COMPILE_WITH_HALFLIFE_LOADER_ -#endif -//! Define _IRR_COMPILE_WITH_MD2_LOADER_ if you want to load Quake 2 animated files -#define _IRR_COMPILE_WITH_MD2_LOADER_ -#ifdef NO_IRR_COMPILE_WITH_MD2_LOADER_ -#undef _IRR_COMPILE_WITH_MD2_LOADER_ -#endif -//! Define _IRR_COMPILE_WITH_MD3_LOADER_ if you want to load Quake 3 animated files -#define _IRR_COMPILE_WITH_MD3_LOADER_ -#ifdef NO_IRR_COMPILE_WITH_MD3_LOADER_ -#undef _IRR_COMPILE_WITH_MD3_LOADER_ -#endif -//! Define _IRR_COMPILE_WITH_3DS_LOADER_ if you want to load 3D Studio Max files -#define _IRR_COMPILE_WITH_3DS_LOADER_ -#ifdef NO_IRR_COMPILE_WITH_3DS_LOADER_ -#undef _IRR_COMPILE_WITH_3DS_LOADER_ -#endif -//! Define _IRR_COMPILE_WITH_CSM_LOADER_ if you want to load Cartography Shop files -#define _IRR_COMPILE_WITH_CSM_LOADER_ -#ifdef NO_IRR_COMPILE_WITH_CSM_LOADER_ -#undef _IRR_COMPILE_WITH_CSM_LOADER_ -#endif -//! Define _IRR_COMPILE_WITH_BSP_LOADER_ if you want to load Quake 3 BSP files -#define _IRR_COMPILE_WITH_BSP_LOADER_ -#ifdef NO_IRR_COMPILE_WITH_BSP_LOADER_ -#undef _IRR_COMPILE_WITH_BSP_LOADER_ -#endif -//! Define _IRR_COMPILE_WITH_DMF_LOADER_ if you want to load DeleD files -#define _IRR_COMPILE_WITH_DMF_LOADER_ -#ifdef NO_IRR_COMPILE_WITH_DMF_LOADER_ -#undef _IRR_COMPILE_WITH_DMF_LOADER_ -#endif -//! Define _IRR_COMPILE_WITH_LMTS_LOADER_ if you want to load LMTools files -#define _IRR_COMPILE_WITH_LMTS_LOADER_ -#ifdef NO_IRR_COMPILE_WITH_LMTS_LOADER_ -#undef _IRR_COMPILE_WITH_LMTS_LOADER_ -#endif -//! Define _IRR_COMPILE_WITH_MY3D_LOADER_ if you want to load MY3D files -#define _IRR_COMPILE_WITH_MY3D_LOADER_ -#ifdef NO_IRR_COMPILE_WITH_MY3D_LOADER_ -#undef _IRR_COMPILE_WITH_MY3D_LOADER_ -#endif //! Define _IRR_COMPILE_WITH_OBJ_LOADER_ if you want to load Wavefront OBJ files #define _IRR_COMPILE_WITH_OBJ_LOADER_ #ifdef NO_IRR_COMPILE_WITH_OBJ_LOADER_ #undef _IRR_COMPILE_WITH_OBJ_LOADER_ #endif -//! Define _IRR_COMPILE_WITH_OCT_LOADER_ if you want to load FSRad OCT files -#define _IRR_COMPILE_WITH_OCT_LOADER_ -#ifdef NO_IRR_COMPILE_WITH_OCT_LOADER_ -#undef _IRR_COMPILE_WITH_OCT_LOADER_ -#endif -//! Define _IRR_COMPILE_WITH_LWO_LOADER_ if you want to load Lightwave3D files -#define _IRR_COMPILE_WITH_LWO_LOADER_ -#ifdef NO_IRR_COMPILE_WITH_LWO_LOADER_ -#undef _IRR_COMPILE_WITH_LWO_LOADER_ -#endif -//! Define _IRR_COMPILE_WITH_STL_LOADER_ if you want to load stereolithography files -#define _IRR_COMPILE_WITH_STL_LOADER_ -#ifdef NO_IRR_COMPILE_WITH_STL_LOADER_ -#undef _IRR_COMPILE_WITH_STL_LOADER_ -#endif -//! Define _IRR_COMPILE_WITH_PLY_LOADER_ if you want to load Polygon (Stanford Triangle) files -#define _IRR_COMPILE_WITH_PLY_LOADER_ -#ifdef NO_IRR_COMPILE_WITH_PLY_LOADER_ -#undef _IRR_COMPILE_WITH_PLY_LOADER_ -#endif -//! Define _IRR_COMPILE_WITH_SMF_LOADER_ if you want to load 3D World Studio mesh files -#define _IRR_COMPILE_WITH_SMF_LOADER_ -#ifdef NO_IRR_COMPILE_WITH_SMF_LOADER_ -#undef _IRR_COMPILE_WITH_SMF_LOADER_ -#endif - -//! Define _IRR_COMPILE_WITH_STL_WRITER_ if you want to write .stl files -#define _IRR_COMPILE_WITH_STL_WRITER_ -#ifdef NO_IRR_COMPILE_WITH_STL_WRITER_ -#undef _IRR_COMPILE_WITH_STL_WRITER_ -#endif -//! Define _IRR_COMPILE_WITH_OBJ_WRITER_ if you want to write .obj files -#define _IRR_COMPILE_WITH_OBJ_WRITER_ -#ifdef NO_IRR_COMPILE_WITH_OBJ_WRITER_ -#undef _IRR_COMPILE_WITH_OBJ_WRITER_ -#endif -//! Define _IRR_COMPILE_WITH_PLY_WRITER_ if you want to write .ply files -#define _IRR_COMPILE_WITH_PLY_WRITER_ -#ifdef NO_IRR_COMPILE_WITH_PLY_WRITER_ -#undef _IRR_COMPILE_WITH_PLY_WRITER_ -#endif -//! Define _IRR_COMPILE_WITH_B3D_WRITER_ if you want to write .b3d files -#define _IRR_COMPILE_WITH_B3D_WRITER_ -#ifdef NO_IRR_COMPILE_WITH_B3D_WRITER_ -#undef _IRR_COMPILE_WITH_B3D_WRITER_ -#endif //! Define _IRR_COMPILE_WITH_BMP_LOADER_ if you want to load .bmp files //! Disabling this loader will also disable the built-in font @@ -634,107 +445,22 @@ B3D, MS3D or X meshes */ #ifdef NO_IRR_COMPILE_WITH_JPG_LOADER_ #undef _IRR_COMPILE_WITH_JPG_LOADER_ #endif -//! Define _IRR_COMPILE_WITH_PCX_LOADER_ if you want to load .pcx files -#define _IRR_COMPILE_WITH_PCX_LOADER_ -#ifdef NO_IRR_COMPILE_WITH_PCX_LOADER_ -#undef _IRR_COMPILE_WITH_PCX_LOADER_ -#endif //! Define _IRR_COMPILE_WITH_PNG_LOADER_ if you want to load .png files #define _IRR_COMPILE_WITH_PNG_LOADER_ #ifdef NO_IRR_COMPILE_WITH_PNG_LOADER_ #undef _IRR_COMPILE_WITH_PNG_LOADER_ #endif -//! Define _IRR_COMPILE_WITH_PPM_LOADER_ if you want to load .ppm/.pgm/.pbm files -#define _IRR_COMPILE_WITH_PPM_LOADER_ -#ifdef NO_IRR_COMPILE_WITH_PPM_LOADER_ -#undef _IRR_COMPILE_WITH_PPM_LOADER_ -#endif -//! Define _IRR_COMPILE_WITH_PSD_LOADER_ if you want to load .psd files -#define _IRR_COMPILE_WITH_PSD_LOADER_ -#ifdef NO_IRR_COMPILE_WITH_PSD_LOADER_ -#undef _IRR_COMPILE_WITH_PSD_LOADER_ -#endif -//! Define _IRR_COMPILE_WITH_PVR_LOADER_ if you want to load .pvr files -#define _IRR_COMPILE_WITH_PVR_LOADER_ -#ifdef NO_IRR_COMPILE_WITH_PVR_LOADER_ -#undef _IRR_COMPILE_WITH_PVR_LOADER_ -#endif -//! Define _IRR_COMPILE_WITH_DDS_LOADER_ if you want to load compressed .dds files -// Patent problem isn't related to this loader. -#define _IRR_COMPILE_WITH_DDS_LOADER_ -#ifdef NO_IRR_COMPILE_WITH_DDS_LOADER_ -#undef _IRR_COMPILE_WITH_DDS_LOADER_ -#endif -//! Define _IRR_COMPILE_WITH_DDS_DECODER_LOADER_ if you want to load .dds files -//! loader will decompress these files and will send to the memory as uncompressed files. -// Outcommented because -// a) it doesn't compile on 64-bit currently -// b) anyone enabling it should be aware that S3TC compression algorithm which might be used in that loader -// is patented in the US by S3 and they do collect license fees when it's used in applications. -// So if you are unfortunate enough to develop applications for US market and their broken patent system be careful. -// #define _IRR_COMPILE_WITH_DDS_DECODER_LOADER_ -#ifdef NO_IRR_COMPILE_WITH_DDS_DECODER_LOADER_ -#undef _IRR_COMPILE_WITH_DDS_DECODER_LOADER_ -#endif -#ifdef _IRR_COMPILE_WITH_DDS_DECODER_LOADER_ -#undef _IRR_COMPILE_WITH_DDS_LOADER_ -#endif -//! Define _IRR_COMPILE_WITH_TGA_LOADER_ if you want to load .tga files -#define _IRR_COMPILE_WITH_TGA_LOADER_ -#ifdef NO_IRR_COMPILE_WITH_TGA_LOADER_ -#undef _IRR_COMPILE_WITH_TGA_LOADER_ -#endif -//! Define _IRR_COMPILE_WITH_WAL_LOADER_ if you want to load .wal files -#define _IRR_COMPILE_WITH_WAL_LOADER_ -#ifdef NO_IRR_COMPILE_WITH_WAL_LOADER_ -#undef _IRR_COMPILE_WITH_WAL_LOADER_ -#endif -//! Define _IRR_COMPILE_WITH_LMP_LOADER_ if you want to load .lmp files -#define _IRR_COMPILE_WITH_LMP_LOADER_ -#ifdef NO_IRR_COMPILE_WITH_LMP_LOADER_ -#undef _IRR_COMPILE_WITH_LMP_LOADER_ -#endif -//! Define _IRR_COMPILE_WITH_RGB_LOADER_ if you want to load Silicon Graphics .rgb/.rgba/.sgi/.int/.inta/.bw files -#define _IRR_COMPILE_WITH_RGB_LOADER_ -#ifdef NO_IRR_COMPILE_WITH_RGB_LOADER_ -#undef _IRR_COMPILE_WITH_RGB_LOADER_ -#endif -//! Define _IRR_COMPILE_WITH_BMP_WRITER_ if you want to write .bmp files -#define _IRR_COMPILE_WITH_BMP_WRITER_ -#ifdef NO_IRR_COMPILE_WITH_BMP_WRITER_ -#undef _IRR_COMPILE_WITH_BMP_WRITER_ -#endif //! Define _IRR_COMPILE_WITH_JPG_WRITER_ if you want to write .jpg files #define _IRR_COMPILE_WITH_JPG_WRITER_ #ifdef NO_IRR_COMPILE_WITH_JPG_WRITER_ #undef _IRR_COMPILE_WITH_JPG_WRITER_ #endif -//! Define _IRR_COMPILE_WITH_PCX_WRITER_ if you want to write .pcx files -#define _IRR_COMPILE_WITH_PCX_WRITER_ -#ifdef NO_IRR_COMPILE_WITH_PCX_WRITER_ -#undef _IRR_COMPILE_WITH_PCX_WRITER_ -#endif //! Define _IRR_COMPILE_WITH_PNG_WRITER_ if you want to write .png files #define _IRR_COMPILE_WITH_PNG_WRITER_ #ifdef NO_IRR_COMPILE_WITH_PNG_WRITER_ #undef _IRR_COMPILE_WITH_PNG_WRITER_ #endif -//! Define _IRR_COMPILE_WITH_PPM_WRITER_ if you want to write .ppm files -#define _IRR_COMPILE_WITH_PPM_WRITER_ -#ifdef NO_IRR_COMPILE_WITH_PPM_WRITER_ -#undef _IRR_COMPILE_WITH_PPM_WRITER_ -#endif -//! Define _IRR_COMPILE_WITH_PSD_WRITER_ if you want to write .psd files -#define _IRR_COMPILE_WITH_PSD_WRITER_ -#ifdef NO_IRR_COMPILE_WITH_PSD_WRITER_ -#undef _IRR_COMPILE_WITH_PSD_WRITER_ -#endif -//! Define _IRR_COMPILE_WITH_TGA_WRITER_ if you want to write .tga files -#define _IRR_COMPILE_WITH_TGA_WRITER_ -#ifdef NO_IRR_COMPILE_WITH_TGA_WRITER_ -#undef _IRR_COMPILE_WITH_TGA_WRITER_ -#endif //! Define __IRR_COMPILE_WITH_ZIP_ARCHIVE_LOADER_ if you want to open ZIP and GZIP archives /** ZIP reading has several more options below to configure. */ @@ -758,26 +484,6 @@ ones. */ #ifdef NO__IRR_COMPILE_WITH_MOUNT_ARCHIVE_LOADER_ #undef __IRR_COMPILE_WITH_MOUNT_ARCHIVE_LOADER_ #endif -//! Define __IRR_COMPILE_WITH_PAK_ARCHIVE_LOADER_ if you want to open ID software PAK archives -#define __IRR_COMPILE_WITH_PAK_ARCHIVE_LOADER_ -#ifdef NO__IRR_COMPILE_WITH_PAK_ARCHIVE_LOADER_ -#undef __IRR_COMPILE_WITH_PAK_ARCHIVE_LOADER_ -#endif -//! Define __IRR_COMPILE_WITH_NPK_ARCHIVE_LOADER_ if you want to open Nebula Device NPK archives -#define __IRR_COMPILE_WITH_NPK_ARCHIVE_LOADER_ -#ifdef NO__IRR_COMPILE_WITH_NPK_ARCHIVE_LOADER_ -#undef __IRR_COMPILE_WITH_NPK_ARCHIVE_LOADER_ -#endif -//! Define __IRR_COMPILE_WITH_TAR_ARCHIVE_LOADER_ if you want to open TAR archives -#define __IRR_COMPILE_WITH_TAR_ARCHIVE_LOADER_ -#ifdef NO__IRR_COMPILE_WITH_TAR_ARCHIVE_LOADER_ -#undef __IRR_COMPILE_WITH_TAR_ARCHIVE_LOADER_ -#endif -//! Define __IRR_COMPILE_WITH_WAD_ARCHIVE_LOADER_ if you want to open WAD archives -#define __IRR_COMPILE_WITH_WAD_ARCHIVE_LOADER_ -#ifdef NO__IRR_COMPILE_WITH_WAD_ARCHIVE_LOADER_ -#undef __IRR_COMPILE_WITH_WAD_ARCHIVE_LOADER_ -#endif // Some cleanup and standard stuff diff --git a/include/SMaterial.h b/include/SMaterial.h index b70a7df5..295cfbd0 100644 --- a/include/SMaterial.h +++ b/include/SMaterial.h @@ -368,20 +368,7 @@ namespace video The specular color of the dynamic lights (SLight::SpecularColor) will influence the the highlight color too, but they are set to a useful value by default when - creating the light scene node. Here is a simple example on how - to use specular highlights: - \code - // load and display mesh - scene::IAnimatedMeshSceneNode* node = smgr->addAnimatedMeshSceneNode( - smgr->getMesh("data/faerie.md2")); - node->setMaterialTexture(0, driver->getTexture("data/Faerie2.pcx")); // set diffuse texture - node->setMaterialFlag(video::EMF_LIGHTING, true); // enable dynamic lighting - node->getMaterial(0).Shininess = 20.0f; // set size of specular highlights - - // add white light - scene::ILightSceneNode* light = smgr->addLightSceneNode(0, - core::vector3df(5,5,5), video::SColorf(1.0f, 1.0f, 1.0f)); - \endcode */ + creating the light scene node.*/ f32 Shininess; //! Free parameter, dependent on the material type. diff --git a/include/irrlicht.h b/include/irrlicht.h index 62ded3c0..ea82b621 100644 --- a/include/irrlicht.h +++ b/include/irrlicht.h @@ -49,19 +49,16 @@ #include "EMaterialTypes.h" #include "EMeshWriterEnums.h" #include "EMessageBoxFlags.h" -#include "ESceneNodeAnimatorTypes.h" +// #include "ESceneNodeAnimatorTypes.h" #include "ESceneNodeTypes.h" #include "ETerrainElements.h" #include "fast_atof.h" #include "heapsort.h" #include "IAnimatedMesh.h" -#include "IAnimatedMeshMD2.h" -#include "IAnimatedMeshMD3.h" #include "IAnimatedMeshSceneNode.h" #include "IAttributeExchangingObject.h" #include "IAttributes.h" #include "IBillboardSceneNode.h" -#include "IBillboardTextSceneNode.h" #include "IBoneSceneNode.h" #include "ICameraSceneNode.h" #include "IContextManager.h" @@ -71,7 +68,6 @@ #include "IEventReceiver.h" #include "IFileList.h" #include "IFileSystem.h" -#include "IGeometryCreator.h" #include "IGPUProgrammingServices.h" #include "IGUIButton.h" #include "IGUICheckBox.h" @@ -104,7 +100,6 @@ #include "IImageLoader.h" #include "IImageWriter.h" #include "IIndexBuffer.h" -#include "ILightSceneNode.h" #include "ILogger.h" #include "IMaterialRenderer.h" #include "IMaterialRendererServices.h" @@ -115,12 +110,7 @@ #include "IMeshManipulator.h" #include "IMeshSceneNode.h" #include "IMeshWriter.h" -#include "IOctreeSceneNode.h" -#include "IMetaTriangleSelector.h" #include "IOSOperator.h" -#include "IParticleSystemSceneNode.h" // also includes all emitters and attractors -#include "IQ3LevelMesh.h" -#include "IQ3Shader.h" #include "IReadFile.h" #include "IReferenceCounted.h" #include "irrArray.h" @@ -133,31 +123,19 @@ #include "irrString.h" #include "irrTypes.h" #include "path.h" -#include "ISceneCollisionManager.h" #include "ISceneLoader.h" #include "ISceneManager.h" #include "ISceneNode.h" -#include "ISceneNodeAnimator.h" -#include "ISceneNodeAnimatorCameraFPS.h" -#include "ISceneNodeAnimatorCameraMaya.h" -#include "ISceneNodeAnimatorCollisionResponse.h" -#include "ISceneNodeAnimatorFactory.h" #include "ISceneNodeFactory.h" #include "ISceneUserDataSerializer.h" #include "IShaderConstantSetCallBack.h" -#include "IShadowVolumeSceneNode.h" #include "ISkinnedMesh.h" -#include "ITerrainSceneNode.h" -#include "ITextSceneNode.h" #include "ITexture.h" #include "ITimer.h" -#include "ITriangleSelector.h" #include "IVertexBuffer.h" #include "IVideoDriver.h" #include "IVideoModeList.h" -#include "IVolumeLightSceneNode.h" #include "IWriteFile.h" -#include "ILightManager.h" #include "Keycodes.h" #include "line2d.h" #include "line3d.h" diff --git a/media/2ddemo.png b/media/2ddemo.png deleted file mode 100644 index 5084114e..00000000 Binary files a/media/2ddemo.png and /dev/null differ diff --git a/media/Faerie5.BMP b/media/Faerie5.BMP deleted file mode 100644 index 2a85c5a0..00000000 Binary files a/media/Faerie5.BMP and /dev/null differ diff --git a/media/IrrlichtTheme.ogg b/media/IrrlichtTheme.ogg deleted file mode 100644 index 27d028f1..00000000 Binary files a/media/IrrlichtTheme.ogg and /dev/null differ diff --git a/media/Particle.tga b/media/Particle.tga deleted file mode 100644 index aec06071..00000000 Binary files a/media/Particle.tga and /dev/null differ diff --git a/media/axe.jpg b/media/axe.jpg deleted file mode 100644 index 2222cc95..00000000 Binary files a/media/axe.jpg and /dev/null differ diff --git a/media/ball.wav b/media/ball.wav deleted file mode 100644 index 24094eee..00000000 Binary files a/media/ball.wav and /dev/null differ diff --git a/media/bigfont.png b/media/bigfont.png deleted file mode 100644 index ca8d948c..00000000 Binary files a/media/bigfont.png and /dev/null differ diff --git a/media/burninglogo.png b/media/burninglogo.png deleted file mode 100644 index 19cf8b39..00000000 Binary files a/media/burninglogo.png and /dev/null differ diff --git a/media/config.xml b/media/config.xml deleted file mode 100644 index d8ff5e0d..00000000 --- a/media/config.xml +++ /dev/null @@ -1,29 +0,0 @@ - - - - -Welcome to the Mesh Viewer of the "Irrlicht Engine"!. -This program is able to load and display all 3D geometry and models the Irrlicht Engine can. -Controls: Left mouse to rotate, right mouse to move, both buttons to zoom. Escape to Stop FPS Camera - -Supported formats are: -- Irrlicht scene and mesh formats (.irr, .irrmesh, .xml) -- 3D Studio (.3ds) -- Blitz3D (.b3d) -- COLLADA 1.2/1.3 (.dae, .xml) -- Cartography shop 4 (.csm) -- DirectX (.x) -- DeleD (.dmf) -- Maya (.obj) -- Milkshape (.ms3d) -- My3D (.my3D) -- OCT (.oct) -- Ogre3d (.mesh) -- Pulsar LMTools (.lmts) -- Quake 3 levels (.bsp) -- Quake 2 models (.md2) -- Stanford Triangle (.ply) -- Stereolithography format (.stl) - - - diff --git a/media/coolguy_opt.x b/media/coolguy_opt.x new file mode 100755 index 00000000..e806d831 --- /dev/null +++ b/media/coolguy_opt.x @@ -0,0 +1,2 @@ +xof 0303txt 0032 +AnimationSet{Animation{{Armature}AnimationKey{0;2;0;4;1,0,0,0;;,29;4;1,0,0,0;;;}AnimationKey{2;2;0;3;0,0,0;;,29;3;0,0,0;;;}}Animation{{Armature_knee_r}AnimationKey{0;16;0;4;0.864183,0.503177,0,0;;,1;4;0.829812,0.558043,0,0;;,3;4;0.708698,0.705512,0,0;;,5;4;0.589108,0.808054,0,0;;,7;4;0.593659,0.804717,0,0;;,9;4;0.748627,0.662991,0,0;;,11;4;0.910305,0.413938,0,0;;,13;4;0.975925,0.218107,0,0;;,15;4;0.981302,0.192476,0,0;;,17;4;0.975476,0.220108,0,0;;,19;4;0.963662,0.267124,0,0;;,21;4;0.945893,0.324478,0,0;;,23;4;0.923816,0.382838,0,0;;,25;4;0.901205,0.433394,0,0;;,27;4;0.883429,0.468566,0,0;;,29;4;0.876305,0.481757,0,0;;;}AnimationKey{2;2;0;3;0,0,1.10139;;,29;3;0,0,1.10139;;;}}Animation{{Armature_elbow_r}AnimationKey{0;16;0;4;0.756295,0.004619,-0.619265,0.210967;;,1;4;0.771977,0.005599,-0.60257,0.202311;;,3;4;0.825501,0.009164,-0.538259,0.169533;;,5;4;0.891859,0.014253,-0.436142,0.119019;;,7;4;0.949154,0.019821,-0.308768,0.058108;;,9;4;0.983251,0.024703,-0.18057,-0.001258;;,11;4;0.995416,0.028143,-0.07812,-0.047458;;,13;4;0.996672,0.02991,-0.020368,-0.073041;;,15;4;0.996672,0.02991,-0.020368,-0.073041;;,17;4;0.995416,0.028143,-0.07812,-0.047458;;,19;4;0.983251,0.024703,-0.18057,-0.001258;;,21;4;0.949154,0.019821,-0.308768,0.058108;;,23;4;0.891859,0.014253,-0.436142,0.119019;;,25;4;0.825501,0.009164,-0.538259,0.169533;;,27;4;0.771977,0.005599,-0.60257,0.202311;;,29;4;0.750682,0.004275,-0.625038,0.213976;;;}AnimationKey{2;2;0;3;0,0,0.754892;;,29;3;0,0,0.754892;;;}}Animation{{Armature_arm_r}AnimationKey{0;16;0;4;0.28219,0.629905,0.723388,-0.017285;;,1;4;0.277641,0.632543,0.722699,-0.022614;;,3;4;0.261375,0.641615,0.719924,-0.041507;;,5;4;0.238321,0.653533,0.715186,-0.067874;;,7;4;0.212026,0.665838,0.708676,-0.097381;;,9;4;0.186345,0.676585,0.701229,-0.125643;;,11;4;0.165298,0.684491,0.694351,-0.14841;;,13;4;0.152894,0.688778,0.68998,-0.161665;;,15;4;0.152894,0.688779,0.68998,-0.161665;;,17;4;0.165298,0.684491,0.694351,-0.14841;;,19;4;0.186345,0.676585,0.701229,-0.125643;;,21;4;0.212026,0.665838,0.708676,-0.097381;;,23;4;0.238321,0.653533,0.715186,-0.067874;;,25;4;0.261375,0.641615,0.719924,-0.041507;;,27;4;0.277641,0.632543,0.722699,-0.022614;;,29;4;0.283802,0.628959,0.723623,-0.015394;;;}AnimationKey{2;2;0;3;-0.545315,0,1;;,29;3;-0.545315,0,1;;;}}Animation{{Armature_knee_l}AnimationKey{0;16;0;4;0.981896,0.189423,0,0;;,1;4;0.9814,0.191974,0,0;;,3;4;0.979127,0.203251,0,0;;,5;4;0.974526,0.224276,0,0;;,7;4;0.96645,0.256853,0,0;;,9;4;0.953088,0.302692,0,0;;,11;4;0.931731,0.36315,0,0;;,13;4;0.898645,0.438676,0,0;;,15;4;0.848226,0.529634,0,0;;,17;4;0.773692,0.633562,0,0;;,19;4;0.689831,0.72397,0,0;;,21;4;0.629304,0.777159,0,0;;,23;4;0.648685,0.761057,0,0;;,25;4;0.812268,0.583284,0,0;;,27;4;0.948066,0.318074,0,0;;,29;4;0.982049,0.188624,0,0;;;}AnimationKey{2;2;0;3;0,0,1.10139;;,29;3;0,0,1.10139;;;}}Animation{{Armature_Bone_007}AnimationKey{0;16;0;4;0.993671,-0.112331,0,0;;,1;4;0.994784,-0.102002,0,0;;,3;4;0.997507,-0.070564,0,0;;,5;4;0.999237,-0.039056,0,0;;,7;4;0.999694,-0.024737,0,0;;,9;4;0.999079,-0.042907,0,0;;,11;4;0.99677,-0.080308,0,0;;,13;4;0.993798,-0.111199,0,0;;,15;4;0.993599,-0.112965,0,0;;,17;4;0.995813,-0.091409,0,0;;,19;4;0.998181,-0.060285,0,0;;,21;4;0.999479,-0.032286,0,0;;,23;4;0.999797,-0.020142,0,0;;,25;4;0.998983,-0.045097,0,0;;,27;4;0.995813,-0.091409,0,0;;,29;4;0.993221,-0.116243,0,0;;;}AnimationKey{2;2;0;3;0,0,1.221802;;,29;3;0,0,1.221802;;;}}Animation{{Armature_elbow_l}AnimationKey{0;16;0;4;0.995195,-0.034868,-0.015799,-0.090119;;,1;4;0.993465,-0.046368,-0.030155,-0.099838;;,3;4;0.983557,-0.0879,-0.082099,-0.134715;;,5;4;0.959324,-0.146904,-0.156177,-0.183648;;,7;4;0.917546,-0.212233,-0.238611,-0.236921;;,9;4;0.864109,-0.271657,-0.314022,-0.284443;;,11;4;0.813172,-0.315829,-0.370387,-0.319087;;,13;4;0.781004,-0.339668,-0.400938,-0.337501;;,15;4;0.781004,-0.339668,-0.400938,-0.337501;;,17;4;0.813172,-0.315829,-0.370387,-0.319087;;,19;4;0.864109,-0.271657,-0.314022,-0.284443;;,21;4;0.917546,-0.212233,-0.238611,-0.236921;;,23;4;0.959324,-0.146904,-0.156177,-0.183648;;,25;4;0.983557,-0.0879,-0.082099,-0.134715;;,27;4;0.993465,-0.046368,-0.030155,-0.099838;;,29;4;0.995701,-0.030812,-0.010739,-0.086685;;;}AnimationKey{2;2;0;3;0,0,0.754892;;,29;3;0,0,0.754892;;;}}Animation{{Armature_body}AnimationKey{0;16;0;4;-0,0,0.601298,0.799025;;,1;4;-0,0,0.608144,0.793827;;,3;4;-0,0,0.627465,0.778645;;,5;4;-0,0,0.643183,0.765712;;,7;4;-0,0,0.643755,0.765231;;,9;4;-0,0,0.631076,0.775721;;,11;4;-0,0,0.613775,0.789481;;,13;4;-0,0,0.6007,0.799474;;,15;4;-0,0,0.601488,0.798882;;,17;4;-0,0,0.619499,0.784997;;,19;4;-0,0,0.643196,0.765702;;,21;4;-0,0,0.660441,0.750878;;,23;4;-0,0,0.659666,0.751559;;,25;4;-0,0,0.638264,0.769817;;,27;4;-0,0,0.611752,0.791049;;,29;4;-0,0,0.598631,0.801025;;;}AnimationKey{2;2;0;3;0,2.580534,0;;,29;3;0,2.571201,0;;;}}Animation{{Armature_leg_l}AnimationKey{0;16;0;4;0.390287,0.920693,0,0;;,1;4;0.362565,0.931959,0,0;;,3;4;0.266163,0.963928,0,0;;,5;4;0.138294,0.990391,0,0;;,7;4;0.012725,0.999919,0,0;;,9;4;-0.090194,0.995924,0,0;;,11;4;-0.162502,0.986708,0,0;;,13;4;-0.201466,0.979496,0,0;;,15;4;-0.185641,0.982618,0,0;;,17;4;-0.013697,0.999906,0,0;;,19;4;0.24238,0.970181,0,0;;,21;4;0.417271,0.908782,0,0;;,23;4;0.439308,0.898336,0,0;;,25;4;0.424255,0.905543,0,0;;,27;4;0.407664,0.913132,0,0;;,29;4;0.400263,0.9164,0,0;;;}AnimationKey{2;2;0;3;0.246294,0,-0.171352;;,29;3;0.246294,0,-0.171351;;;}}Animation{{Armature_leg_r}AnimationKey{0;16;0;4;0.174933,-0.98458,0,0;;,1;4;0.082829,-0.996564,0,0;;,3;4;-0.21147,-0.977384,0,0;;,5;4;-0.442802,-0.89662,0,0;;,7;4;-0.47604,-0.879424,0,0;;,9;4;-0.47279,-0.881175,0,0;;,11;4;-0.459567,-0.888143,0,0;;,13;4;-0.427425,-0.904051,0,0;;,15;4;-0.361724,-0.932285,0,0;;,17;4;-0.251362,-0.967893,0,0;;,19;4;-0.114531,-0.99342,0,0;;,21;4;0.021053,-0.999778,0,0;;,23;4;0.12473,-0.992191,0,0;;,25;4;0.181473,-0.983396,0,0;;,27;4;0.204037,-0.978963,0,0;;,29;4;0.208187,-0.978089,0,0;;;}AnimationKey{2;2;0;3;-0.246294,0,-0.171352;;,29;3;-0.246294,0,-0.171351;;;}}Animation{{Armature_arm_l}AnimationKey{0;16;0;4;0.200754,-0.659656,-0.716264,-0.107316;;,1;4;0.192268,-0.660735,-0.716526,-0.114246;;,3;4;0.161871,-0.663925,-0.716753,-0.138802;;,5;4;0.118745,-0.666682,-0.715211,-0.17294;;,7;4;0.069733,-0.667364,-0.710872,-0.210767;;,9;4;0.022313,-0.665594,-0.704111,-0.246404;;,11;4;-0.016046,-0.662426,-0.696821,-0.274543;;,13;4;-0.038374,-0.659874,-0.691824,-0.290643;;,15;4;-0.038373,-0.659874,-0.691824,-0.290643;;,17;4;-0.016044,-0.662427,-0.696822,-0.274543;;,19;4;0.022312,-0.665594,-0.70411,-0.246404;;,21;4;0.069733,-0.667365,-0.710872,-0.210767;;,23;4;0.118745,-0.666682,-0.715211,-0.17294;;,25;4;0.161871,-0.663925,-0.716753,-0.138802;;,27;4;0.192268,-0.660735,-0.716526,-0.114246;;,29;4;0.203757,-0.659255,-0.716151,-0.104856;;;}AnimationKey{2;2;0;3;0.545315,0,1;;,29;3;0.545315,0,1;;;}}}Frame Root{FrameTransformMatrix{1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1;;}Frame Armature{FrameTransformMatrix{1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1;;}Frame Armature_body{FrameTransformMatrix{-1,0,0,0,0,0,1,0,0,1,0,0,0,2.571201,0,1;;}Frame Armature_arm_r{FrameTransformMatrix{-0.047733,0.997488,-0.05233,0,0.901521,0.020464,-0.432251,0,-0.430095,-0.067809,-0.900233,0,-0.545315,0,1,1;;}Frame Armature_elbow_r{FrameTransformMatrix{0.987983,0.151721,-0.029519,0,-0.153228,0.986478,-0.058162,0,0.020295,0.061987,0.997871,0,0,0,0.754892,1;;}}}Frame Armature_arm_l{FrameTransformMatrix{-0.047732,0.994072,-0.097683,0,0.901521,0.084983,0.424309,0,0.430095,-0.067809,-0.900233,0,0.545315,0,1,1;;}Frame Armature_elbow_l{FrameTransformMatrix{0.984741,0.173286,-0.016044,0,-0.171963,0.983073,0.063221,0,0.026727,-0.059497,0.99787,0,0,0,0.754892,1;;}}}Frame Armature_leg_l{FrameTransformMatrix{1,0,0,0,0,-0.998426,-0.056453,0,0,0.056453,-0.998405,0,0.246294,0,-0.171351,1;;}Frame Armature_knee_l{FrameTransformMatrix{1,0,0,0,0,0.993861,-0.110639,0,0,0.110639,0.993861,0,0,0,1.10139,1;;}}}Frame Armature_leg_r{FrameTransformMatrix{1,0,0,0,0,-0.998426,-0.056453,0,0,0.056453,-0.998405,0,-0.246294,0,-0.171351,1;;}Frame Armature_knee_r{FrameTransformMatrix{1,0,0,0,0,0.993861,-0.110639,0,0,0.110639,0.993861,0,0,0,1.10139,1;;}}}Frame Armature_Bone_007{FrameTransformMatrix{1,0,0,0,0,1,0,0,0,0,1,0,0,0,1.221802,1;;}}}Frame cool_dude{FrameTransformMatrix{-1,0,0,0,0,1,0,0,0,0,-1,0,0,0,0,1;;}Mesh{272;0;2.440814;0.219926;,0;3.688199;0.219926;,0.466212;3.688199;0.219926;,0.466212;2.440814;0.219926;,0.466212;2.440814;0.219926;,0.466212;3.688199;0.219926;,0.466212;3.688199;-0.219926;,0.466212;2.440814;-0.219926;,0;2.440814;0.219926;,0.466212;2.440814;0.219926;,0.466212;2.440814;-0.219926;,0;2.440814;-0.219926;,0.055633;1.27575;-0.190081;,0.055633;2.35741;-0.190081;,0.055633;2.35741;0.190081;,0.055633;1.27575;0.190081;,0.055633;1.27575;0.190081;,0.055633;2.35741;0.190081;,0.43017;2.35741;0.190081;,0.43017;1.27575;0.190081;,0.43017;1.27575;0.190081;,0.43017;2.35741;0.190081;,0.43017;2.35741;-0.190081;,0.43017;1.27575;-0.190081;,0.43017;1.27575;-0.190081;,0.43017;2.35741;-0.190081;,0.055633;2.35741;-0.190081;,0.055633;1.27575;-0.190081;,0.055633;1.27575;0.190081;,0.43017;1.27575;0.190081;,0.43017;1.27575;-0.190081;,0.055633;1.27575;-0.190081;,0.43017;2.35741;0.190081;,0.055633;2.35741;0.190081;,0.055633;2.35741;-0.190081;,0.43017;2.35741;-0.190081;,0.466212;3.688199;0.219926;,0;3.688199;0.219926;,0;3.688199;-0.219926;,0.466212;3.688199;-0.219926;,0.466212;2.440814;-0.219926;,0.466212;3.688199;-0.219926;,0;3.688199;-0.219926;,0;2.440814;-0.219926;,0.769341;2.834949;-0.041122;,0.440953;3.555781;-0.041122;,0.440953;3.555781;0.207294;,0.769341;2.834949;0.207294;,0.769341;2.834949;0.207294;,0.440953;3.555781;0.207294;,0.616273;3.635651;0.207294;,0.944661;2.914819;0.207294;,0.944661;2.914819;0.207294;,0.616273;3.635651;0.207294;,0.616273;3.635651;-0.041122;,0.944661;2.914819;-0.041122;,0.944661;2.914819;-0.041122;,0.616273;3.635651;-0.041122;,0.440953;3.555781;-0.041122;,0.769341;2.834949;-0.041122;,0.769341;2.834949;0.207294;,0.944661;2.914819;0.207294;,0.944661;2.914819;-0.041122;,0.769341;2.834949;-0.041122;,0.616273;3.635651;0.207294;,0.440953;3.555781;0.207294;,0.440953;3.555781;-0.041122;,0.616273;3.635651;-0.041122;,1.104504;2.080977;-0.086788;,0.776116;2.801809;-0.086788;,0.776116;2.801809;0.161627;,1.104504;2.080977;0.161627;,1.104504;2.080977;0.161627;,0.776116;2.801809;0.161627;,0.951436;2.881679;0.161627;,1.279824;2.160847;0.161627;,1.279824;2.160847;0.161627;,0.951436;2.881679;0.161627;,0.951436;2.881679;-0.086788;,1.279824;2.160847;-0.086788;,1.279824;2.160847;-0.086788;,0.951436;2.881679;-0.086788;,0.776116;2.801809;-0.086788;,1.104504;2.080977;-0.086788;,1.104504;2.080977;0.161627;,1.279824;2.160847;0.161627;,1.279824;2.160847;-0.086788;,1.104504;2.080977;-0.086788;,0.951436;2.881679;0.161627;,0.776116;2.801809;0.161627;,0.776116;2.801809;-0.086788;,0.951436;2.881679;-0.086788;,0.055633;0.093601;-0.190081;,0.055633;1.205294;-0.190081;,0.055633;1.205294;0.190081;,0.055633;0.093601;0.190081;,0.055633;0.093601;0.190081;,0.055633;1.205294;0.190081;,0.43017;1.205294;0.190081;,0.43017;0.093601;0.190081;,0.43017;0.093601;0.190081;,0.43017;1.205294;0.190081;,0.43017;1.205294;-0.190081;,0.43017;0.093601;-0.190081;,0.43017;0.093601;-0.190081;,0.43017;1.205294;-0.190081;,0.055633;1.205294;-0.190081;,0.055633;0.093601;-0.190081;,0.055633;0.093601;0.190081;,0.43017;0.093601;0.190081;,0.43017;0.093601;-0.190081;,0.055633;0.093601;-0.190081;,0.43017;1.205294;0.190081;,0.055633;1.205294;0.190081;,0.055633;1.205294;-0.190081;,0.43017;1.205294;-0.190081;,0;3.790919;0.428464;,0;4.579204;0.428464;,0.43344;4.560537;0.409797;,0.43344;3.809586;0.409797;,0.43344;3.809586;0.409797;,0.43344;4.560537;0.409797;,0.43344;4.560537;-0.284975;,0.43344;3.809586;-0.284975;,0;3.790919;0.428464;,0.43344;3.809586;0.409797;,0.43344;3.809586;-0.284975;,0;3.790919;-0.303642;,0.43344;4.560537;0.409797;,0;4.579204;0.428464;,0;4.579204;-0.303642;,0.43344;4.560537;-0.284975;,0.43344;3.809586;-0.284975;,0.43344;4.560537;-0.284975;,0;4.579204;-0.303642;,0;3.790919;-0.303642;,0;2.440814;0.219926;,-0.466212;2.440814;0.219926;,-0.466212;3.688199;0.219926;,0;3.688199;0.219926;,-0.466212;2.440814;0.219926;,-0.466212;2.440814;-0.219926;,-0.466212;3.688199;-0.219926;,-0.466212;3.688199;0.219926;,0;2.440814;0.219926;,0;2.440814;-0.219926;,-0.466212;2.440814;-0.219926;,-0.466212;2.440814;0.219926;,-0.055633;1.27575;-0.190081;,-0.055633;1.27575;0.190081;,-0.055633;2.35741;0.190081;,-0.055633;2.35741;-0.190081;,-0.055633;1.27575;0.190081;,-0.43017;1.27575;0.190081;,-0.43017;2.35741;0.190081;,-0.055633;2.35741;0.190081;,-0.43017;1.27575;0.190081;,-0.43017;1.27575;-0.190081;,-0.43017;2.35741;-0.190081;,-0.43017;2.35741;0.190081;,-0.43017;1.27575;-0.190081;,-0.055633;1.27575;-0.190081;,-0.055633;2.35741;-0.190081;,-0.43017;2.35741;-0.190081;,-0.055633;1.27575;0.190081;,-0.055633;1.27575;-0.190081;,-0.43017;1.27575;-0.190081;,-0.43017;1.27575;0.190081;,-0.43017;2.35741;0.190081;,-0.43017;2.35741;-0.190081;,-0.055633;2.35741;-0.190081;,-0.055633;2.35741;0.190081;,-0.466212;3.688199;0.219926;,-0.466212;3.688199;-0.219926;,0;3.688199;-0.219926;,0;3.688199;0.219926;,-0.466212;2.440814;-0.219926;,0;2.440814;-0.219926;,0;3.688199;-0.219926;,-0.466212;3.688199;-0.219926;,-0.769341;2.834949;-0.041122;,-0.769341;2.834949;0.207294;,-0.440953;3.555781;0.207294;,-0.440953;3.555781;-0.041122;,-0.769341;2.834949;0.207294;,-0.944661;2.914819;0.207294;,-0.616273;3.635651;0.207294;,-0.440953;3.555781;0.207294;,-0.944661;2.914819;0.207294;,-0.944661;2.914819;-0.041122;,-0.616273;3.635651;-0.041122;,-0.616273;3.635651;0.207294;,-0.944661;2.914819;-0.041122;,-0.769341;2.834949;-0.041122;,-0.440953;3.555781;-0.041122;,-0.616273;3.635651;-0.041122;,-0.769341;2.834949;0.207294;,-0.769341;2.834949;-0.041122;,-0.944661;2.914819;-0.041122;,-0.944661;2.914819;0.207294;,-0.616273;3.635651;0.207294;,-0.616273;3.635651;-0.041122;,-0.440953;3.555781;-0.041122;,-0.440953;3.555781;0.207294;,-1.104504;2.080977;-0.086788;,-1.104504;2.080977;0.161627;,-0.776116;2.801809;0.161627;,-0.776116;2.801809;-0.086788;,-1.104504;2.080977;0.161627;,-1.279824;2.160847;0.161627;,-0.951436;2.881679;0.161627;,-0.776116;2.801809;0.161627;,-1.279824;2.160847;0.161627;,-1.279824;2.160847;-0.086788;,-0.951436;2.881679;-0.086788;,-0.951436;2.881679;0.161627;,-1.279824;2.160847;-0.086788;,-1.104504;2.080977;-0.086788;,-0.776116;2.801809;-0.086788;,-0.951436;2.881679;-0.086788;,-1.104504;2.080977;0.161627;,-1.104504;2.080977;-0.086788;,-1.279824;2.160847;-0.086788;,-1.279824;2.160847;0.161627;,-0.951436;2.881679;0.161627;,-0.951436;2.881679;-0.086788;,-0.776116;2.801809;-0.086788;,-0.776116;2.801809;0.161627;,-0.055633;0.093601;-0.190081;,-0.055633;0.093601;0.190081;,-0.055633;1.205294;0.190081;,-0.055633;1.205294;-0.190081;,-0.055633;0.093601;0.190081;,-0.43017;0.093601;0.190081;,-0.43017;1.205294;0.190081;,-0.055633;1.205294;0.190081;,-0.43017;0.093601;0.190081;,-0.43017;0.093601;-0.190081;,-0.43017;1.205294;-0.190081;,-0.43017;1.205294;0.190081;,-0.43017;0.093601;-0.190081;,-0.055633;0.093601;-0.190081;,-0.055633;1.205294;-0.190081;,-0.43017;1.205294;-0.190081;,-0.055633;0.093601;0.190081;,-0.055633;0.093601;-0.190081;,-0.43017;0.093601;-0.190081;,-0.43017;0.093601;0.190081;,-0.43017;1.205294;0.190081;,-0.43017;1.205294;-0.190081;,-0.055633;1.205294;-0.190081;,-0.055633;1.205294;0.190081;,0;3.790919;0.428464;,-0.43344;3.809586;0.409797;,-0.43344;4.560537;0.409797;,0;4.579204;0.428464;,-0.43344;3.809586;0.409797;,-0.43344;3.809586;-0.284975;,-0.43344;4.560537;-0.284975;,-0.43344;4.560537;0.409797;,0;3.790919;0.428464;,0;3.790919;-0.303642;,-0.43344;3.809586;-0.284975;,-0.43344;3.809586;0.409797;,-0.43344;4.560537;0.409797;,-0.43344;4.560537;-0.284975;,0;4.579204;-0.303642;,0;4.579204;0.428464;,-0.43344;3.809586;-0.284975;,0;3.790919;-0.303642;,0;4.579204;-0.303642;,-0.43344;4.560537;-0.284975;;68;4;3,2,1,0;,4;7,6,5,4;,4;11,10,9,8;,4;15,14,13,12;,4;19,18,17,16;,4;23,22,21,20;,4;27,26,25,24;,4;31,30,29,28;,4;35,34,33,32;,4;39,38,37,36;,4;43,42,41,40;,4;47,46,45,44;,4;51,50,49,48;,4;55,54,53,52;,4;59,58,57,56;,4;63,62,61,60;,4;67,66,65,64;,4;71,70,69,68;,4;75,74,73,72;,4;79,78,77,76;,4;83,82,81,80;,4;87,86,85,84;,4;91,90,89,88;,4;95,94,93,92;,4;99,98,97,96;,4;103,102,101,100;,4;107,106,105,104;,4;111,110,109,108;,4;115,114,113,112;,4;119,118,117,116;,4;123,122,121,120;,4;127,126,125,124;,4;131,130,129,128;,4;135,134,133,132;,4;139,138,137,136;,4;143,142,141,140;,4;147,146,145,144;,4;151,150,149,148;,4;155,154,153,152;,4;159,158,157,156;,4;163,162,161,160;,4;167,166,165,164;,4;171,170,169,168;,4;175,174,173,172;,4;179,178,177,176;,4;183,182,181,180;,4;187,186,185,184;,4;191,190,189,188;,4;195,194,193,192;,4;199,198,197,196;,4;203,202,201,200;,4;207,206,205,204;,4;211,210,209,208;,4;215,214,213,212;,4;219,218,217,216;,4;223,222,221,220;,4;227,226,225,224;,4;231,230,229,228;,4;235,234,233,232;,4;239,238,237,236;,4;243,242,241,240;,4;247,246,245,244;,4;251,250,249,248;,4;255,254,253,252;,4;259,258,257,256;,4;263,262,261,260;,4;267,266,265,264;,4;271,270,269,268;;MeshNormals{272;0;-0.707083;0.707083;,0;0.707083;0.707083;,0.577349;0.577349;0.577349;,0.577349;-0.577349;0.577349;,0.577349;-0.577349;0.577349;,0.577349;0.577349;0.577349;,0.577349;0.577349;-0.577349;,0.577349;-0.577349;-0.577349;,0;-0.707083;0.707083;,0.577349;-0.577349;0.577349;,0.577349;-0.577349;-0.577349;,0;-0.707083;-0.707083;,-0.577349;-0.577349;-0.577349;,-0.577349;0.577349;-0.577349;,-0.577349;0.577349;0.577349;,-0.577349;-0.577349;0.577349;,-0.577349;-0.577349;0.577349;,-0.577349;0.577349;0.577349;,0.577349;0.577349;0.577349;,0.577349;-0.577349;0.577349;,0.577349;-0.577349;0.577349;,0.577349;0.577349;0.577349;,0.577349;0.577349;-0.577349;,0.577349;-0.577349;-0.577349;,0.577349;-0.577349;-0.577349;,0.577349;0.577349;-0.577349;,-0.577349;0.577349;-0.577349;,-0.577349;-0.577349;-0.577349;,-0.577349;-0.577349;0.577349;,0.577349;-0.577349;0.577349;,0.577349;-0.577349;-0.577349;,-0.577349;-0.577349;-0.577349;,0.577349;0.577349;0.577349;,-0.577349;0.577349;0.577349;,-0.577349;0.577349;-0.577349;,0.577349;0.577349;-0.577349;,0.577349;0.577349;0.577349;,0;0.707083;0.707083;,0;0.707083;-0.707083;,0.577349;0.577349;-0.577349;,0.577349;-0.577349;-0.577349;,0.577349;0.577349;-0.577349;,0;0.707083;-0.707083;,0;-0.707083;-0.707083;,-0.286019;-0.764733;-0.577349;,-0.764733;0.286019;-0.577349;,-0.764733;0.286019;0.577349;,-0.286019;-0.764733;0.577349;,-0.286019;-0.764733;0.577349;,-0.764733;0.286019;0.577349;,0.286019;0.764733;0.577349;,0.764733;-0.286019;0.577349;,0.764733;-0.286019;0.577349;,0.286019;0.764733;0.577349;,0.286019;0.764733;-0.577349;,0.764733;-0.286019;-0.577349;,0.764733;-0.286019;-0.577349;,0.286019;0.764733;-0.577349;,-0.764733;0.286019;-0.577349;,-0.286019;-0.764733;-0.577349;,-0.286019;-0.764733;0.577349;,0.764733;-0.286019;0.577349;,0.764733;-0.286019;-0.577349;,-0.286019;-0.764733;-0.577349;,0.286019;0.764733;0.577349;,-0.764733;0.286019;0.577349;,-0.764733;0.286019;-0.577349;,0.286019;0.764733;-0.577349;,-0.286019;-0.764733;-0.577349;,-0.764733;0.286019;-0.577349;,-0.764733;0.286019;0.577349;,-0.286019;-0.764733;0.577349;,-0.286019;-0.764733;0.577349;,-0.764733;0.286019;0.577349;,0.286019;0.764733;0.577349;,0.764733;-0.286019;0.577349;,0.764733;-0.286019;0.577349;,0.286019;0.764733;0.577349;,0.286019;0.764733;-0.577349;,0.764733;-0.286019;-0.577349;,0.764733;-0.286019;-0.577349;,0.286019;0.764733;-0.577349;,-0.764733;0.286019;-0.577349;,-0.286019;-0.764733;-0.577349;,-0.286019;-0.764733;0.577349;,0.764733;-0.286019;0.577349;,0.764733;-0.286019;-0.577349;,-0.286019;-0.764733;-0.577349;,0.286019;0.764733;0.577349;,-0.764733;0.286019;0.577349;,-0.764733;0.286019;-0.577349;,0.286019;0.764733;-0.577349;,-0.577349;-0.577349;-0.577349;,-0.577349;0.577349;-0.577349;,-0.577349;0.577349;0.577349;,-0.577349;-0.577349;0.577349;,-0.577349;-0.577349;0.577349;,-0.577349;0.577349;0.577349;,0.577349;0.577349;0.577349;,0.577349;-0.577349;0.577349;,0.577349;-0.577349;0.577349;,0.577349;0.577349;0.577349;,0.577349;0.577349;-0.577349;,0.577349;-0.577349;-0.577349;,0.577349;-0.577349;-0.577349;,0.577349;0.577349;-0.577349;,-0.577349;0.577349;-0.577349;,-0.577349;-0.577349;-0.577349;,-0.577349;-0.577349;0.577349;,0.577349;-0.577349;0.577349;,0.577349;-0.577349;-0.577349;,-0.577349;-0.577349;-0.577349;,0.577349;0.577349;0.577349;,-0.577349;0.577349;0.577349;,-0.577349;0.577349;-0.577349;,0.577349;0.577349;-0.577349;,0;-0.707083;0.707083;,0;0.707083;0.707083;,0.599902;0.565722;0.565722;,0.599902;-0.565722;0.565722;,0.599902;-0.565722;0.565722;,0.599902;0.565722;0.565722;,0.599902;0.565722;-0.565722;,0.599902;-0.565722;-0.565722;,0;-0.707083;0.707083;,0.599902;-0.565722;0.565722;,0.599902;-0.565722;-0.565722;,0;-0.707083;-0.707083;,0.599902;0.565722;0.565722;,0;0.707083;0.707083;,0;0.707083;-0.707083;,0.599902;0.565722;-0.565722;,0.599902;-0.565722;-0.565722;,0.599902;0.565722;-0.565722;,0;0.707083;-0.707083;,0;-0.707083;-0.707083;,0;-0.707083;0.707083;,-0.577349;-0.577349;0.577349;,-0.577349;0.577349;0.577349;,0;0.707083;0.707083;,-0.577349;-0.577349;0.577349;,-0.577349;-0.577349;-0.577349;,-0.577349;0.577349;-0.577349;,-0.577349;0.577349;0.577349;,0;-0.707083;0.707083;,0;-0.707083;-0.707083;,-0.577349;-0.577349;-0.577349;,-0.577349;-0.577349;0.577349;,0.577349;-0.577349;-0.577349;,0.577349;-0.577349;0.577349;,0.577349;0.577349;0.577349;,0.577349;0.577349;-0.577349;,0.577349;-0.577349;0.577349;,-0.577349;-0.577349;0.577349;,-0.577349;0.577349;0.577349;,0.577349;0.577349;0.577349;,-0.577349;-0.577349;0.577349;,-0.577349;-0.577349;-0.577349;,-0.577349;0.577349;-0.577349;,-0.577349;0.577349;0.577349;,-0.577349;-0.577349;-0.577349;,0.577349;-0.577349;-0.577349;,0.577349;0.577349;-0.577349;,-0.577349;0.577349;-0.577349;,0.577349;-0.577349;0.577349;,0.577349;-0.577349;-0.577349;,-0.577349;-0.577349;-0.577349;,-0.577349;-0.577349;0.577349;,-0.577349;0.577349;0.577349;,-0.577349;0.577349;-0.577349;,0.577349;0.577349;-0.577349;,0.577349;0.577349;0.577349;,-0.577349;0.577349;0.577349;,-0.577349;0.577349;-0.577349;,0;0.707083;-0.707083;,0;0.707083;0.707083;,-0.577349;-0.577349;-0.577349;,0;-0.707083;-0.707083;,0;0.707083;-0.707083;,-0.577349;0.577349;-0.577349;,0.286019;-0.764733;-0.577349;,0.286019;-0.764733;0.577349;,0.764733;0.286019;0.577349;,0.764733;0.286019;-0.577349;,0.286019;-0.764733;0.577349;,-0.764733;-0.286019;0.577349;,-0.286019;0.764733;0.577349;,0.764733;0.286019;0.577349;,-0.764733;-0.286019;0.577349;,-0.764733;-0.286019;-0.577349;,-0.286019;0.764733;-0.577349;,-0.286019;0.764733;0.577349;,-0.764733;-0.286019;-0.577349;,0.286019;-0.764733;-0.577349;,0.764733;0.286019;-0.577349;,-0.286019;0.764733;-0.577349;,0.286019;-0.764733;0.577349;,0.286019;-0.764733;-0.577349;,-0.764733;-0.286019;-0.577349;,-0.764733;-0.286019;0.577349;,-0.286019;0.764733;0.577349;,-0.286019;0.764733;-0.577349;,0.764733;0.286019;-0.577349;,0.764733;0.286019;0.577349;,0.286019;-0.764733;-0.577349;,0.286019;-0.764733;0.577349;,0.764733;0.286019;0.577349;,0.764733;0.286019;-0.577349;,0.286019;-0.764733;0.577349;,-0.764733;-0.286019;0.577349;,-0.286019;0.764733;0.577349;,0.764733;0.286019;0.577349;,-0.764733;-0.286019;0.577349;,-0.764733;-0.286019;-0.577349;,-0.286019;0.764733;-0.577349;,-0.286019;0.764733;0.577349;,-0.764733;-0.286019;-0.577349;,0.286019;-0.764733;-0.577349;,0.764733;0.286019;-0.577349;,-0.286019;0.764733;-0.577349;,0.286019;-0.764733;0.577349;,0.286019;-0.764733;-0.577349;,-0.764733;-0.286019;-0.577349;,-0.764733;-0.286019;0.577349;,-0.286019;0.764733;0.577349;,-0.286019;0.764733;-0.577349;,0.764733;0.286019;-0.577349;,0.764733;0.286019;0.577349;,0.577349;-0.577349;-0.577349;,0.577349;-0.577349;0.577349;,0.577349;0.577349;0.577349;,0.577349;0.577349;-0.577349;,0.577349;-0.577349;0.577349;,-0.577349;-0.577349;0.577349;,-0.577349;0.577349;0.577349;,0.577349;0.577349;0.577349;,-0.577349;-0.577349;0.577349;,-0.577349;-0.577349;-0.577349;,-0.577349;0.577349;-0.577349;,-0.577349;0.577349;0.577349;,-0.577349;-0.577349;-0.577349;,0.577349;-0.577349;-0.577349;,0.577349;0.577349;-0.577349;,-0.577349;0.577349;-0.577349;,0.577349;-0.577349;0.577349;,0.577349;-0.577349;-0.577349;,-0.577349;-0.577349;-0.577349;,-0.577349;-0.577349;0.577349;,-0.577349;0.577349;0.577349;,-0.577349;0.577349;-0.577349;,0.577349;0.577349;-0.577349;,0.577349;0.577349;0.577349;,0;-0.707083;0.707083;,-0.599902;-0.565722;0.565722;,-0.599872;0.565722;0.565722;,0;0.707083;0.707083;,-0.599902;-0.565722;0.565722;,-0.599902;-0.565722;-0.565722;,-0.599872;0.565722;-0.565722;,-0.599872;0.565722;0.565722;,0;-0.707083;0.707083;,0;-0.707083;-0.707083;,-0.599902;-0.565722;-0.565722;,-0.599902;-0.565722;0.565722;,-0.599872;0.565722;0.565722;,-0.599872;0.565722;-0.565722;,0;0.707083;-0.707083;,0;0.707083;0.707083;,-0.599902;-0.565722;-0.565722;,0;-0.707083;-0.707083;,0;0.707083;-0.707083;,-0.599872;0.565722;-0.565722;;68;4;3,2,1,0;,4;7,6,5,4;,4;11,10,9,8;,4;15,14,13,12;,4;19,18,17,16;,4;23,22,21,20;,4;27,26,25,24;,4;31,30,29,28;,4;35,34,33,32;,4;39,38,37,36;,4;43,42,41,40;,4;47,46,45,44;,4;51,50,49,48;,4;55,54,53,52;,4;59,58,57,56;,4;63,62,61,60;,4;67,66,65,64;,4;71,70,69,68;,4;75,74,73,72;,4;79,78,77,76;,4;83,82,81,80;,4;87,86,85,84;,4;91,90,89,88;,4;95,94,93,92;,4;99,98,97,96;,4;103,102,101,100;,4;107,106,105,104;,4;111,110,109,108;,4;115,114,113,112;,4;119,118,117,116;,4;123,122,121,120;,4;127,126,125,124;,4;131,130,129,128;,4;135,134,133,132;,4;139,138,137,136;,4;143,142,141,140;,4;147,146,145,144;,4;151,150,149,148;,4;155,154,153,152;,4;159,158,157,156;,4;163,162,161,160;,4;167,166,165,164;,4;171,170,169,168;,4;175,174,173,172;,4;179,178,177,176;,4;183,182,181,180;,4;187,186,185,184;,4;191,190,189,188;,4;195,194,193,192;,4;199,198,197,196;,4;203,202,201,200;,4;207,206,205,204;,4;211,210,209,208;,4;215,214,213,212;,4;219,218,217,216;,4;223,222,221,220;,4;227,226,225,224;,4;231,230,229,228;,4;235,234,233,232;,4;239,238,237,236;,4;243,242,241,240;,4;247,246,245,244;,4;251,250,249,248;,4;255,254,253,252;,4;259,258,257,256;,4;263,262,261,260;,4;267,266,265,264;,4;271,270,269,268;;}MeshTextureCoords{272;0.849264;0.899246;,0.849264;0.931916;,0.861547;0.931916;,0.861547;0.899246;,0.916988;0.931916;,0.916988;0.899246;,0.9054;0.899246;,0.9054;0.931916;,0.84857;0.844707;,0.84857;0.83254;,0.836981;0.83254;,0.836981;0.844707;,0.927004;0.903587;,0.927004;0.931916;,0.937019;0.931916;,0.937019;0.903587;,0.937019;0.903587;,0.937019;0.931916;,0.946887;0.931916;,0.946887;0.903587;,0.888533;0.856954;,0.888533;0.828625;,0.878517;0.828625;,0.878517;0.856954;,0.939292;0.870917;,0.939292;0.899246;,0.949159;0.899246;,0.949159;0.870917;,0.946887;0.91117;,0.956719;0.91117;,0.956719;0.901213;,0.946887;0.901213;,0.865118;0.813135;,0.855286;0.813135;,0.855286;0.823092;,0.865118;0.823092;,0.866874;0.847426;,0.866874;0.835259;,0.855286;0.835259;,0.855286;0.847426;,0.598002;0.973516;,0.598002;0.206739;,0.309722;0.206739;,0.309722;0.973516;,0.909393;0.822135;,0.909393;0.841014;,0.915938;0.841014;,0.915938;0.822135;,0.951962;0.931916;,0.951962;0.91117;,0.946887;0.91117;,0.946887;0.931916;,0.948762;0.841801;,0.948762;0.822921;,0.942217;0.822921;,0.942217;0.841801;,0.893608;0.838075;,0.893608;0.817329;,0.888533;0.817329;,0.888533;0.838075;,0.900724;0.909292;,0.90515;0.909292;,0.90515;0.902786;,0.900724;0.902786;,0.953585;0.871994;,0.949159;0.871994;,0.949159;0.8785;,0.953585;0.8785;,0.84857;0.837995;,0.84857;0.856874;,0.855114;0.856874;,0.855114;0.837995;,0.902881;0.83746;,0.902881;0.816714;,0.897805;0.816714;,0.897805;0.83746;,0.942217;0.841801;,0.942217;0.822921;,0.935673;0.822921;,0.935673;0.841801;,0.949159;0.8785;,0.949159;0.899246;,0.954235;0.899246;,0.954235;0.8785;,0.919226;0.822135;,0.923651;0.822135;,0.923651;0.815629;,0.919226;0.815629;,0.928077;0.815629;,0.923651;0.815629;,0.923651;0.822135;,0.928077;0.822135;,0.865301;0.847426;,0.865301;0.876542;,0.875317;0.876542;,0.875317;0.847426;,0.909393;0.841014;,0.909393;0.87013;,0.919261;0.87013;,0.919261;0.841014;,0.855286;0.847426;,0.855286;0.876542;,0.865301;0.876542;,0.865301;0.847426;,0.919261;0.841014;,0.919261;0.87013;,0.929128;0.87013;,0.929128;0.841014;,0.878517;0.828625;,0.888349;0.828625;,0.88835;0.818668;,0.878517;0.818668;,0.836981;0.83254;,0.846814;0.83254;,0.846814;0.822583;,0.836981;0.822583;,0.857749;0.887894;,0.836981;0.887894;,0.837473;0.899246;,0.857257;0.899246;,0.855286;0.876542;,0.855286;0.856874;,0.836981;0.856874;,0.836981;0.876542;,0.897805;0.887893;,0.897313;0.876622;,0.879009;0.876622;,0.878517;0.887893;,0.886604;0.909292;,0.886112;0.920645;,0.9054;0.920645;,0.904908;0.909292;,0.977665;0.442421;,0.977665;0.131438;,0.799225;0.123708;,0.799225;0.450151;,0.849264;0.899246;,0.836981;0.899246;,0.836981;0.931916;,0.849264;0.931916;,0.909393;0.866576;,0.897805;0.866576;,0.897805;0.899246;,0.909393;0.899246;,0.84857;0.844707;,0.836981;0.844707;,0.836981;0.856874;,0.84857;0.856874;,0.929276;0.899246;,0.939292;0.899246;,0.939292;0.870917;,0.929276;0.870917;,0.876741;0.819096;,0.866874;0.819096;,0.866874;0.847426;,0.876741;0.847426;,0.939144;0.841801;,0.929128;0.841801;,0.929128;0.87013;,0.939144;0.87013;,0.949011;0.841801;,0.939144;0.841801;,0.939144;0.87013;,0.949011;0.87013;,0.836981;0.812626;,0.836981;0.822583;,0.846814;0.822583;,0.846814;0.812626;,0.909393;0.812178;,0.909393;0.822135;,0.919226;0.822135;,0.919226;0.812178;,0.866874;0.823092;,0.855286;0.823092;,0.855286;0.835259;,0.866874;0.835259;,0.021442;0.973516;,0.309722;0.973516;,0.309722;0.206739;,0.021442;0.206739;,0.916039;0.841014;,0.922583;0.841014;,0.922583;0.822135;,0.916039;0.822135;,0.907956;0.816714;,0.902881;0.816714;,0.902881;0.83746;,0.907956;0.83746;,0.929128;0.822135;,0.922583;0.822135;,0.922583;0.841014;,0.929128;0.841014;,0.853645;0.817249;,0.84857;0.817249;,0.84857;0.837995;,0.853645;0.837995;,0.900724;0.909292;,0.900724;0.902786;,0.895944;0.902786;,0.895944;0.909292;,0.93896;0.816415;,0.93896;0.822921;,0.94374;0.822921;,0.94374;0.816415;,0.935673;0.822921;,0.929128;0.822921;,0.929128;0.841801;,0.935673;0.841801;,0.954087;0.849384;,0.949011;0.849384;,0.949011;0.87013;,0.954087;0.87013;,0.895077;0.838075;,0.888533;0.838075;,0.888533;0.856954;,0.895077;0.856954;,0.948762;0.841801;,0.953838;0.841801;,0.953838;0.821055;,0.948762;0.821055;,0.94374;0.816415;,0.94374;0.822921;,0.94852;0.822921;,0.94852;0.816415;,0.949011;0.842878;,0.949011;0.849384;,0.953791;0.849384;,0.953791;0.842878;,0.919409;0.87013;,0.909393;0.87013;,0.909393;0.899246;,0.919409;0.899246;,0.897805;0.866576;,0.907672;0.866576;,0.907672;0.83746;,0.897805;0.83746;,0.927004;0.9028;,0.916988;0.9028;,0.916988;0.931916;,0.927004;0.931916;,0.929276;0.87013;,0.919409;0.87013;,0.919409;0.899246;,0.929276;0.899246;,0.93896;0.822921;,0.93896;0.812965;,0.929128;0.812965;,0.929128;0.822921;,0.886112;0.899336;,0.886112;0.909292;,0.895944;0.909292;,0.895944;0.899336;,0.857749;0.887894;,0.857257;0.876542;,0.837473;0.876542;,0.836981;0.887894;,0.896821;0.856954;,0.878517;0.856954;,0.878517;0.876622;,0.896821;0.876622;,0.897805;0.887893;,0.878517;0.887893;,0.879009;0.899246;,0.897313;0.899246;,0.886604;0.931916;,0.904908;0.931916;,0.9054;0.920645;,0.886112;0.920645;,0.620785;0.44242;,0.799225;0.450151;,0.799225;0.123708;,0.620785;0.131438;;}XSkinMeshHeader{3;9;10;}SkinWeights{"Armature_arm_l";24;44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,67,66;1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1;-0.047733,0.901521,0.430095,0,-0.097683,0.424309,-0.900233,0,-0.994073,-0.084983,0.06781,0,0.374873,-2.006904,2.980378,1;;}SkinWeights{"Armature_elbow_r";24;216,219,218,213,212,215,214,209,224,208,227,211,226,210,206,221,207,220,204,223,205,222,225,217;1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1;0.102316,0.92166,-0.374266,0,-0.090709,-0.366028,-0.926173,0,-0.990608,0.128712,0.046152,0,0.402018,1.853661,2.350172,1;;}SkinWeights{"Armature_arm_r";24;186,187,184,185,182,183,180,194,195,203,202,192,193,201,200,199,190,198,191,197,188,196,189,181;1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1;-0.047733,0.901521,-0.430095,0,-0.05233,-0.432251,-0.900234,0,-0.997489,-0.020464,0.067809,0,0.160852,2.035269,2.980378,1;;}SkinWeights{"Armature_knee_l";24;105,99,114,106,98,115,107,101,93,108,100,92,109,103,95,110,102,94,111,97,112,104,113,96;1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1;1,0,0,0,0,0.054357,-0.998522,0,0,0.998501,0.054355,0,-0.246294,-0.008592,1.301673,1;;}SkinWeights{"Armature_Bone_007";40;132,133,134,135,124,125,126,252,253,254,255,121,122,264,265,123,267,268,269,270,116,256,258,259,260,261,262,263,271,266,120,119,117,128,129,127,130,118,131,257;1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1;1,0,0,0,0,0,1,0,0,-1,0,0,0,0,-3.793003,1;;}SkinWeights{"Armature_elbow_l";24;88,80,72,91,83,75,90,82,74,70,85,77,71,84,76,68,87,79,69,86,78,89,81,73;1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1;0.102316,0.92166,0.374266,0,-0.008222,0.377011,-0.926173,0,-0.994719,0.091686,0.046152,0,-0.014321,-1.896701,2.350171,1;;}SkinWeights{"Armature_knee_r";24;249,235,250,234,251,229,244,228,245,231,246,230,247,240,241,242,243,237,236,239,238,233,248,232;1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1;1,0,0,0,0,0.054357,-0.998522,0,0,0.998501,0.054355,0,0.246294,-0.008592,1.301673,1;;}SkinWeights{"Armature_leg_l";38;0,3,4,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,40,43,136,145,177,144;0.055873,0.852304,0.852304,0.82998,0.055873,0.852304,0.82998,0.054606,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0.82998,0.054606,0.055873,0.054606,0.054606,0.055873;1,0,0,0,0,-0.056452,-0.998405,0,0,0.998385,-0.056452,0,-0.246294,0.135476,2.396023,1;;}SkinWeights{"Armature_leg_r";38;0,170,169,11,168,151,150,149,148,147,146,176,145,177,144,159,158,157,156,155,154,153,167,136,166,137,165,164,163,140,162,141,161,43,160,152,8,171;0.055873,1,1,0.054606,1,1,1,1,1,0.852304,0.82998,0.82998,0.054606,0.054606,0.055873,1,1,1,1,1,1,1,1,0.055873,1,0.852304,1,1,1,0.852304,1,0.82998,1,0.054606,1,1,0.055873,1;1,0,0,0,0,-0.056452,-0.998405,0,0,0.998385,-0.056452,0,0.246294,0.135476,2.396023,1;;}SkinWeights{"Armature_body";40;0,1,2,3,4,5,6,7,8,9,10,11,36,37,38,39,40,41,42,43,136,137,138,139,140,147,141,146,142,145,143,144,179,174,178,173,177,172,176,175;0.888255,1,1,0.147696,0.147696,1,1,0.17002,0.888255,0.147696,0.17002,0.890788,1,1,1,1,0.17002,1,1,0.890788,0.888255,0.147696,1,1,0.147696,0.147696,0.17002,0.17002,1,0.890788,1,0.888255,1,1,1,1,0.890788,1,0.17002,1;1,0,0,0,0,0,1,0,0,-1,0,0,0,0,-2.571201,1;;}}}}} \ No newline at end of file diff --git a/media/cooltexture.png b/media/cooltexture.png new file mode 100755 index 00000000..fcc219ac Binary files /dev/null and b/media/cooltexture.png differ diff --git a/media/cubeMapReflection.frag b/media/cubeMapReflection.frag deleted file mode 100644 index f1a4a1fc..00000000 --- a/media/cubeMapReflection.frag +++ /dev/null @@ -1,12 +0,0 @@ -uniform samplerCube cubeTex; -uniform float Roughness; - -void main( void ) -{ -// gl_FragColor = vec4(1.0, 0.0, 0.0, 1.0); - vec3 uvw = vec3(gl_TexCoord[0]); - //gl_FragColor = textureCube( cubeTex, uvw ); - gl_FragColor = textureLod( cubeTex, uvw, Roughness ); - //gl_FragColor = textureCube( cubeTex, uvw, Roughness ); -} - diff --git a/media/cubeMapReflection.vert b/media/cubeMapReflection.vert deleted file mode 100644 index 97f9ac5b..00000000 --- a/media/cubeMapReflection.vert +++ /dev/null @@ -1,27 +0,0 @@ -uniform int StyleUVW ; // 0 = specular reflection, 1 = diffuse reflection, 2 = use model vertex coordinates for uvw. -uniform vec3 CameraPos; -uniform mat4 World; - -void main(void) -{ - gl_Position = ftransform(); // same as gl_ModelViewProjectionMatrix * gl_Vertex; - - // compute the reflection vector, and assign it to texcoord 0 - if ( StyleUVW == 0 ) - { - vec4 worldPos = World*gl_Vertex; - vec3 viewNormal = normalize(worldPos.xyz - CameraPos); // view vector - - gl_TexCoord[0] = vec4( reflect( viewNormal, normalize(gl_Normal) ), 1.0 ); - } - else if ( StyleUVW == 1 ) - { - // just use the normal for the reflection vector - gl_TexCoord[0] = vec4(normalize(gl_Normal), 1.0); - } - else if ( StyleUVW == 2 ) - { - // use vertex-coordinates for texture coordinates - gl_TexCoord[0] = normalize(gl_Vertex); - } -} diff --git a/media/cubeMapReflectionPS.hlsl b/media/cubeMapReflectionPS.hlsl deleted file mode 100644 index 179979dc..00000000 --- a/media/cubeMapReflectionPS.hlsl +++ /dev/null @@ -1,10 +0,0 @@ -sampler cubeTex: register(s0); -float Roughness; - -float4 PS( float4 uvwTex : TEXCOORD0 ) : COLOR -{ - uvwTex.w = Roughness; - //return texCUBEbias( cubeTex, uvwTex); - return texCUBElod( cubeTex, uvwTex); - //return texCUBE( cubeTex, uvwTex); -} diff --git a/media/cubeMapReflectionVS.hlsl b/media/cubeMapReflectionVS.hlsl deleted file mode 100644 index 64033060..00000000 --- a/media/cubeMapReflectionVS.hlsl +++ /dev/null @@ -1,38 +0,0 @@ -int StyleUVW ; // 0 = specular reflection, 1 = diffuse reflection, 2 = use model vertex coordinates for uvw. -float4x4 WorldViewProj; -float4x4 World; -float3 CameraPos; - -// Vertex Shader -void VS( - in float4 VPos : POSITION, - in float3 VNorm : NORMAL, - in float3 VTex : TEXCOORD0, - out float4 outPos : POSITION, - out float4 outTex : TEXCOORD0 ) -{ - // vertex position from model-space to view-space - outPos = mul( VPos, WorldViewProj ); - - if ( StyleUVW == 0 ) - { - // create ray from camera position to the vertex, in world space - float4 worldPos = mul(float4(VPos.x, VPos.y, VPos.z, 1.0), World); - float3 view = CameraPos - worldPos.xyz; - - float4 normWorld = normalize(mul(float4(VNorm.x, VNorm.y, VNorm.z, 0.0), World)); // TODO: when objects are scaled non-uniform we need to multiply by WorldInverseTranspose instead - - // compute the reflection vector, and assign it to texcoord 0 - outTex.xyz = reflect( -normalize(view), normWorld.xyz ); - } - else if ( StyleUVW == 1 ) - { - // just use the normal for the reflection vector - outTex.xyz = normalize(VNorm); - } - else if ( StyleUVW == 2 ) - { - // use vertex-coordinates for texture coordinates - outTex.xyz = VPos.xyz; - } -} diff --git a/media/cubemap_license.txt b/media/cubemap_license.txt deleted file mode 100644 index 2bfb4a5a..00000000 --- a/media/cubemap_license.txt +++ /dev/null @@ -1,18 +0,0 @@ -License for the cubemap_*.jpg files in this folder. - -Author -====== - -This is the work of Emil Persson, aka Humus. -http://www.humus.name - -License -======= - -This work is licensed under a Creative Commons Attribution 3.0 Unported License. -http://creativecommons.org/licenses/by/3.0/ - - -Changes -======= -For the Irrlicht engine we downscaled the images to 512x512. Get the full 2048x2048 resolution at http://www.humus.name diff --git a/media/cubemap_negx.jpg b/media/cubemap_negx.jpg deleted file mode 100644 index abb77ce1..00000000 Binary files a/media/cubemap_negx.jpg and /dev/null differ diff --git a/media/cubemap_negy.jpg b/media/cubemap_negy.jpg deleted file mode 100644 index 740c536d..00000000 Binary files a/media/cubemap_negy.jpg and /dev/null differ diff --git a/media/cubemap_negz.jpg b/media/cubemap_negz.jpg deleted file mode 100644 index 057d3f1e..00000000 Binary files a/media/cubemap_negz.jpg and /dev/null differ diff --git a/media/cubemap_posx.jpg b/media/cubemap_posx.jpg deleted file mode 100644 index 6c32969b..00000000 Binary files a/media/cubemap_posx.jpg and /dev/null differ diff --git a/media/cubemap_posy.jpg b/media/cubemap_posy.jpg deleted file mode 100644 index e343c3fa..00000000 Binary files a/media/cubemap_posy.jpg and /dev/null differ diff --git a/media/cubemap_posz.jpg b/media/cubemap_posz.jpg deleted file mode 100644 index 2d28e44e..00000000 Binary files a/media/cubemap_posz.jpg and /dev/null differ diff --git a/media/d3d9.hlsl b/media/d3d9.hlsl deleted file mode 100644 index 07809e5f..00000000 --- a/media/d3d9.hlsl +++ /dev/null @@ -1,84 +0,0 @@ -// Part of the Irrlicht Engine Shader example. -// These simple Direct3D9 pixel and vertex shaders will be loaded by the shaders -// example. Please note that these example shaders don't do anything really useful. -// They only demonstrate that shaders can be used in Irrlicht. - -//----------------------------------------------------------------------------- -// Global variables -//----------------------------------------------------------------------------- -float4x4 mWorldViewProj; // World * View * Projection transformation -float4x4 mInvWorld; // Inverted world matrix -float4x4 mTransWorld; // Transposed world matrix -float3 mLightPos; // Light position (actually just camera-pos in this case) -float4 mLightColor; // Light color - - -// Vertex shader output structure -struct VS_OUTPUT -{ - float4 Position : POSITION; // vertex position - float4 Diffuse : COLOR0; // vertex diffuse color - float2 TexCoord : TEXCOORD0; // tex coords -}; - - -VS_OUTPUT vertexMain(in float4 vPosition : POSITION, - in float3 vNormal : NORMAL, - float2 texCoord : TEXCOORD0 ) -{ - VS_OUTPUT Output; - - // transform position to clip space - Output.Position = mul(vPosition, mWorldViewProj); - - // transform normal somehow (NOTE: for the real vertex normal you would use an inverse-transpose world matrix instead of mInvWorld) - float3 normal = mul(float4(vNormal,0.0), mInvWorld); - - // renormalize normal - normal = normalize(normal); - - // position in world coordinates (NOTE: not sure why transposed world is used instead of world?) - float3 worldpos = mul(mTransWorld, vPosition); - - // calculate light vector, vtxpos - lightpos - float3 lightVector = worldpos - mLightPos; - - // normalize light vector - lightVector = normalize(lightVector); - - // calculate light color - float3 tmp = dot(-lightVector, normal); - tmp = lit(tmp.x, tmp.y, 1.0); - - tmp = mLightColor * tmp.y; - Output.Diffuse = float4(tmp.x, tmp.y, tmp.z, 0); - Output.TexCoord = texCoord; - - return Output; -} - - -// Pixel shader output structure -struct PS_OUTPUT -{ - float4 RGBColor : COLOR0; // Pixel color -}; - - -sampler2D myTexture; - -PS_OUTPUT pixelMain(float2 TexCoord : TEXCOORD0, - float4 Position : POSITION, - float4 Diffuse : COLOR0 ) -{ - PS_OUTPUT Output; - - float4 col = tex2D( myTexture, TexCoord ); // sample color map - - // multiply with diffuse and do other senseless operations - Output.RGBColor = Diffuse * col; - Output.RGBColor *= 4.0; - - return Output; -} - diff --git a/media/d3d9.psh b/media/d3d9.psh deleted file mode 100644 index 8286eb86..00000000 --- a/media/d3d9.psh +++ /dev/null @@ -1,11 +0,0 @@ -; part of the Irrlicht Engine Shader example. -; This simple Direct3D9 pixel shader will be loaded by the engine. -; Please note that these example shaders don't do anything really useful. -; They only demonstrate that shaders can be used in Irrlicht. - -ps.1.1 - -tex t0 ; sample color map -add r0, v0, v0 ; mulitply with color -mul t0, t0, r0 ; mulitply with color -add r0, t0, t0 ; make it brighter and store result diff --git a/media/d3d9.vsh b/media/d3d9.vsh deleted file mode 100644 index 0d1dfe9f..00000000 --- a/media/d3d9.vsh +++ /dev/null @@ -1,42 +0,0 @@ -; part of the Irrlicht Engine Shader example. -; This Direct3D9 vertex shader will be loaded by the engine. -; Please note that these example shaders don't do anything really useful. -; They only demonstrate that shaders can be used in Irrlicht. - -vs.1.1 - -dcl_position v0; ; declare position -dcl_normal v1; ; declare normal -dcl_color v2; ; declare color -dcl_texcoord0 v3; ; declare texture coordinate - -; transpose and transform position to clip space -mul r0, v0.x, c4 -mad r0, v0.y, c5, r0 -mad r0, v0.z, c6, r0 -add oPos, c7, r0 - -; transform normal -dp3 r1.x, v1, c0 -dp3 r1.y, v1, c1 -dp3 r1.z, v1, c2 - -; renormalize normal -dp3 r1.w, r1, r1 -rsq r1.w, r1.w -mul r1, r1, r1.w - -; calculate light vector -m4x4 r6, v0, c10 ; vertex into world position -add r2, c8, -r6 ; vtxpos - lightpos - -; normalize light vector -dp3 r2.w, r2, r2 -rsq r2.w, r2.w -mul r2, r2, r2.w - -; calculate light color -dp3 r3, r1, r2 ; dp3 with negative light vector -lit r5, r3 ; clamp to zero if r3 < 0, r5 has diffuce component in r5.y -mul oD0, r5.y, c9 ; ouput diffuse color -mov oT0, v3 ; store texture coordinates \ No newline at end of file diff --git a/media/demoback.jpg b/media/demoback.jpg deleted file mode 100644 index dec609cc..00000000 Binary files a/media/demoback.jpg and /dev/null differ diff --git a/media/detailmap3.jpg b/media/detailmap3.jpg deleted file mode 100644 index acf5f41d..00000000 Binary files a/media/detailmap3.jpg and /dev/null differ diff --git a/media/directxlogo.png b/media/directxlogo.png deleted file mode 100644 index db5eff70..00000000 Binary files a/media/directxlogo.png and /dev/null differ diff --git a/media/dotnetback.jpg b/media/dotnetback.jpg deleted file mode 100644 index 9ac13cff..00000000 Binary files a/media/dotnetback.jpg and /dev/null differ diff --git a/media/dwarf-Read-Me.txt b/media/dwarf-Read-Me.txt deleted file mode 100644 index ad158375..00000000 --- a/media/dwarf-Read-Me.txt +++ /dev/null @@ -1,51 +0,0 @@ -Dwarf lowpoly model Pack -Copyright 2004, Psionic Design -e-mail: psionic@blueyonder.co.uk - - - -INSTALLATION INSTRUCTIONS: - -To install, simply unzip to your hard drive with the "Use Folder Names" option turned on. And that's it you're ready to go! - - - -USAGE INFORMATION: - -Each zip contains the models, textures and animation info for that particular format! - -Please Read the "animationinfo.txt" file included in each zip for the exact frames of animation to use - -Credits to me "Psionic" are really appreciated but are not essential ;-) - -Any questions, screenshots of him in use etc drop by my site or email me at:- - -website: http://www.psionic3d.co.uk -email: psionic@blueyonder.co.uk - - - - -WHAT'S INCLUDED IN THE ZIP: - -ReadMe.txt - This file -b3d.zip - Blitz 3D Format models and textures -ms3d.zip - Milkshape 3D Format models and textures -x.zip - DarkBasic Direct X 8 Format models and textures - - - -RESTRICTIONS: - -This model pack is available for use in freeware, shareware, commercial games/software with the following restrictions:- - -**You may not sell/re-sell this model pack or claim it as your own. -***You may not redistribute this pack in some other model pack through a website or on a compilation CD of any kind, without my written consent. - - -Psi -http://www.psionic3d.co.uk - - - - diff --git a/media/dwarf.jpg b/media/dwarf.jpg deleted file mode 100644 index 430d83e7..00000000 Binary files a/media/dwarf.jpg and /dev/null differ diff --git a/media/dwarf.x b/media/dwarf.x deleted file mode 100644 index c10769bc..00000000 --- a/media/dwarf.x +++ /dev/null @@ -1,18468 +0,0 @@ -xof 0303txt 0032 - -// DirectX - from MilkShape3D - -template XSkinMeshHeader -{ - <3CF169CE-FF7C-44AB-93C0-F78F62D172E2> - WORD nMaxSkinWeightsPerVertex; - WORD nMaxSkinWeightsPerFace; - WORD nBones; -} - -template VertexDuplicationIndices -{ - - DWORD nIndices; - DWORD nOriginalVertices; - array DWORD indices[nIndices]; -} - -template SkinWeights -{ - <6F0D123B-BAD2-4167-A0D0-80224F25FABB> - CSTRING transformNodeName; - DWORD nWeights; - array DWORD vertexIndices[nWeights]; - array FLOAT weights[nWeights]; - Matrix4x4 matrixOffset; -} - -Frame base -{ - FrameTransformMatrix - { - 1.000000,0.000000,0.000000,0.000000, - 0.000000,1.000000,0.000000,0.000000, - 0.000000,0.000000,1.000000,0.000000, - 0.011608,-0.015192,0.000000,1.000000;; - } - - Frame middle - { - FrameTransformMatrix - { - 1.000000,0.000000,0.000000,0.000000, - 0.000000,1.000000,0.000000,0.000000, - 0.000000,0.000000,1.000000,0.000000, - 0.173034,30.221760,0.000000,1.000000;; - } - - Frame lhip - { - FrameTransformMatrix - { - 1.000000,0.000000,0.000000,0.000000, - 0.000000,1.000000,0.000000,0.000000, - 0.000000,0.000000,1.000000,0.000000, - -5.191007,-3.469861,0.000000,1.000000;; - } - - Frame lknee - { - FrameTransformMatrix - { - 1.000000,0.000000,0.000000,0.000000, - 0.000000,1.000000,0.000000,0.000000, - 0.000000,0.000000,1.000000,0.000000, - -1.903369,-8.817497,0.000000,1.000000;; - } - - Frame lankle - { - FrameTransformMatrix - { - 1.000000,0.000000,0.000000,0.000000, - 0.000000,1.000000,0.000000,0.000000, - 0.000000,0.000000,1.000000,0.000000, - -1.557302,-12.873290,3.507543,1.000000;; - } - - Frame ltoe - { - FrameTransformMatrix - { - 1.000000,0.000000,0.000000,0.000000, - 0.000000,1.000000,0.000000,0.000000, - 0.000000,0.000000,1.000000,0.000000, - -0.083542,-2.837912,-5.268192,1.000000;; - } - } - } - } - } - - Frame rhip - { - FrameTransformMatrix - { - 1.000000,0.000000,0.000000,0.000000, - 0.000000,1.000000,0.000000,0.000000, - 0.000000,0.000000,1.000000,0.000000, - 5.883141,-2.951185,0.000000,1.000000;; - } - - Frame rknee - { - FrameTransformMatrix - { - 1.000000,0.000000,0.000000,0.000000, - 0.000000,1.000000,0.000000,0.000000, - 0.000000,0.000000,1.000000,0.000000, - 1.557302,-9.681957,0.000000,1.000000;; - } - - Frame rankle - { - FrameTransformMatrix - { - 1.000000,0.000000,0.000000,0.000000, - 0.000000,1.000000,0.000000,0.000000, - 0.000000,0.000000,1.000000,0.000000, - 1.038201,-13.046183,3.507543,1.000000;; - } - - Frame rtoe - { - FrameTransformMatrix - { - 1.000000,0.000000,0.000000,0.000000, - 0.000000,1.000000,0.000000,0.000000, - 0.000000,0.000000,1.000000,0.000000, - 0.161076,-2.268395,-5.055357,1.000000;; - } - } - } - } - } - - Frame spine2 - { - FrameTransformMatrix - { - 1.000000,0.000000,0.000000,0.000000, - 0.000000,1.000000,0.000000,0.000000, - 0.000000,0.000000,1.000000,0.000000, - -0.008257,4.071795,0.000000,1.000000;; - } - - Frame Joint75 - { - FrameTransformMatrix - { - 1.000000,0.000000,0.000000,0.000000, - 0.000000,1.000000,0.000000,0.000000, - 0.000000,0.000000,1.000000,0.000000, - -0.007980,5.843795,0.000000,1.000000;; - } - - Frame Joint76 - { - FrameTransformMatrix - { - 1.000000,0.000000,0.000000,0.000000, - 0.000000,1.000000,0.000000,0.000000, - 0.000000,0.000000,1.000000,0.000000, - -0.033215,5.642583,0.000000,1.000000;; - } - - Frame spine1 - { - FrameTransformMatrix - { - 1.000000,0.000000,0.000000,0.000000, - 0.000000,1.000000,0.000000,0.000000, - 0.000000,0.000000,1.000000,0.000000, - -0.057544,3.129822,0.000000,1.000000;; - } - - Frame head - { - FrameTransformMatrix - { - 1.000000,0.000000,0.000000,0.000000, - 0.000000,1.000000,0.000000,0.000000, - 0.000000,0.000000,1.000000,0.000000, - 0.000000,4.183402,0.000000,1.000000;; - } - - Frame Joint36 - { - FrameTransformMatrix - { - 1.000000,0.000000,0.000000,0.000000, - 0.000000,1.000000,0.000000,0.000000, - 0.000000,0.000000,1.000000,0.000000, - 2.351048,-2.969238,-5.128667,1.000000;; - } - - Frame Joint39 - { - FrameTransformMatrix - { - 1.000000,0.000000,0.000000,0.000000, - 0.000000,1.000000,0.000000,0.000000, - 0.000000,0.000000,1.000000,0.000000, - 2.521163,-4.102684,-2.779583,1.000000;; - } - - Frame Joint40 - { - FrameTransformMatrix - { - 1.000000,0.000000,0.000000,0.000000, - 0.000000,1.000000,0.000000,0.000000, - 0.000000,0.000000,1.000000,0.000000, - 1.543145,-3.721243,-0.884647,1.000000;; - } - - Frame Joint41 - { - FrameTransformMatrix - { - 1.000000,0.000000,0.000000,0.000000, - 0.000000,1.000000,0.000000,0.000000, - 0.000000,0.000000,1.000000,0.000000, - 0.857303,-3.157324,-0.940437,1.000000;; - } - } - } - } - } - - Frame Joint37 - { - FrameTransformMatrix - { - 1.000000,0.000000,0.000000,0.000000, - 0.000000,1.000000,0.000000,0.000000, - 0.000000,0.000000,1.000000,0.000000, - -2.844125,-3.130046,-5.128667,1.000000;; - } - - Frame Joint38 - { - FrameTransformMatrix - { - 1.000000,0.000000,0.000000,0.000000, - 0.000000,1.000000,0.000000,0.000000, - 0.000000,0.000000,1.000000,0.000000, - -2.314107,-4.198860,-2.779583,1.000000;; - } - - Frame Joint42 - { - FrameTransformMatrix - { - 1.000000,0.000000,0.000000,0.000000, - 0.000000,1.000000,0.000000,0.000000, - 0.000000,0.000000,1.000000,0.000000, - -1.200224,-3.209697,-0.885387,1.000000;; - } - - Frame Joint43 - { - FrameTransformMatrix - { - 1.000000,0.000000,0.000000,0.000000, - 0.000000,1.000000,0.000000,0.000000, - 0.000000,0.000000,1.000000,0.000000, - -1.285954,-3.696030,-0.939697,1.000000;; - } - } - } - } - } - - Frame top - { - FrameTransformMatrix - { - 1.000000,0.000000,0.000000,0.000000, - 0.000000,1.000000,0.000000,0.000000, - 0.000000,0.000000,1.000000,0.000000, - -0.311274,14.438549,-1.107615,1.000000;; - } - } - } - - Frame pad2 - { - FrameTransformMatrix - { - 0.986286,0.165048,0.000000,0.000000, - -0.159424,0.952679,0.258819,0.000000, - 0.042717,-0.255270,0.965926,0.000000, - -6.280235,3.399014,0.000000,1.000000;; - } - } - - Frame pad1 - { - FrameTransformMatrix - { - 1.000000,0.000000,0.000000,0.000000, - 0.000000,1.000000,0.000000,0.000000, - 0.000000,0.000000,1.000000,0.000000, - 5.233529,3.529747,0.000000,1.000000;; - } - } - - Frame lsholda - { - FrameTransformMatrix - { - 1.000000,0.000000,0.000000,0.000000, - 0.000000,1.000000,0.000000,0.000000, - 0.000000,0.000000,1.000000,0.000000, - -10.711074,-1.732187,3.529744,1.000000;; - } - - Frame lelbo - { - FrameTransformMatrix - { - 1.000000,0.000000,0.000000,0.000000, - 0.000000,1.000000,0.000000,0.000000, - 0.000000,0.000000,1.000000,0.000000, - -6.541911,-5.098517,0.705949,1.000000;; - } - - Frame lwrist - { - FrameTransformMatrix - { - 1.000000,0.000000,0.000000,0.000000, - 0.000000,1.000000,0.000000,0.000000, - 0.000000,0.000000,1.000000,0.000000, - -7.850295,-6.405833,0.000000,1.000000;; - } - - Frame Joint17 - { - FrameTransformMatrix - { - 1.000000,0.000000,0.000000,0.000000, - 0.000000,1.000000,0.000000,0.000000, - 0.000000,0.000000,1.000000,0.000000, - -3.663469,-3.660475,0.000000,1.000000;; - } - - Frame Joint18 - { - FrameTransformMatrix - { - 1.000000,0.000000,0.000000,0.000000, - 0.000000,1.000000,0.000000,0.000000, - 0.000000,0.000000,1.000000,0.000000, - -1.046706,-2.091701,0.000000,1.000000;; - } - - Frame Joint19 - { - FrameTransformMatrix - { - 1.000000,0.000000,0.000000,0.000000, - 0.000000,1.000000,0.000000,0.000000, - 0.000000,0.000000,1.000000,0.000000, - -0.130838,-3.137549,0.000000,1.000000;; - } - } - } - } - - Frame Joint20 - { - FrameTransformMatrix - { - 1.000000,0.000000,0.000000,0.000000, - 0.000000,1.000000,0.000000,0.000000, - 0.000000,0.000000,1.000000,0.000000, - -0.261676,-4.314132,-3.481931,1.000000;; - } - - Frame Joint21 - { - FrameTransformMatrix - { - 1.000000,0.000000,0.000000,0.000000, - 0.000000,1.000000,0.000000,0.000000, - 0.000000,0.000000,1.000000,0.000000, - -1.046704,-2.483894,0.000000,1.000000;; - } - } - } - } - } - } - - Frame rsholda - { - FrameTransformMatrix - { - 1.000000,0.000000,0.000000,0.000000, - 0.000000,1.000000,0.000000,0.000000, - 0.000000,0.000000,1.000000,0.000000, - 9.986465,-1.438042,3.529744,1.000000;; - } - - Frame relbo - { - FrameTransformMatrix - { - 1.000000,0.000000,0.000000,0.000000, - 0.000000,1.000000,0.000000,0.000000, - 0.000000,0.000000,1.000000,0.000000, - 6.803588,-5.359982,0.705949,1.000000;; - } - - Frame rwrist - { - FrameTransformMatrix - { - 1.000000,0.000000,0.000000,0.000000, - 0.000000,1.000000,0.000000,0.000000, - 0.000000,0.000000,1.000000,0.000000, - 8.373647,-6.798027,0.000000,1.000000;; - } - - Frame Joint25 - { - FrameTransformMatrix - { - 1.000000,0.000000,0.000000,0.000000, - 0.000000,1.000000,0.000000,0.000000, - 0.000000,0.000000,1.000000,0.000000, - 3.663469,-3.137551,0.000000,1.000000;; - } - - Frame Joint26 - { - FrameTransformMatrix - { - 1.000000,0.000000,0.000000,0.000000, - 0.000000,1.000000,0.000000,0.000000, - 0.000000,0.000000,1.000000,0.000000, - 1.046706,-2.353162,0.000000,1.000000;; - } - - Frame Joint27 - { - FrameTransformMatrix - { - 1.000000,0.000000,0.000000,0.000000, - 0.000000,1.000000,0.000000,0.000000, - 0.000000,0.000000,1.000000,0.000000, - -0.261676,-2.876088,0.000000,1.000000;; - } - } - } - } - - Frame Joint28 - { - FrameTransformMatrix - { - 1.000000,0.000000,0.000000,0.000000, - 0.000000,1.000000,0.000000,0.000000, - 0.000000,0.000000,1.000000,0.000000, - -0.785030,-4.183402,-2.034320,1.000000;; - } - - Frame Joint29 - { - FrameTransformMatrix - { - 1.000000,0.000000,0.000000,0.000000, - 0.000000,1.000000,0.000000,0.000000, - 0.000000,0.000000,1.000000,0.000000, - 0.261676,-2.483894,0.000000,1.000000;; - } - } - } - - Frame weapon - { - FrameTransformMatrix - { - 1.000000,0.000000,0.000000,0.000000, - 0.000000,1.000000,0.000000,0.000000, - 0.000000,0.000000,1.000000,0.000000, - 1.700897,-4.837056,0.000000,1.000000;; - } - - Frame end - { - FrameTransformMatrix - { - 1.000000,0.000000,0.000000,0.000000, - 0.000000,1.000000,0.000000,0.000000, - 0.000000,0.000000,1.000000,0.000000, - 0.179647,0.498486,-36.421711,1.000000;; - } - - Frame hit - { - FrameTransformMatrix - { - 1.000000,0.000000,0.000000,0.000000, - 0.000000,1.000000,0.000000,0.000000, - 0.000000,0.000000,1.000000,0.000000, - 9.751877,-17.324219,-0.896412,1.000000;; - } - } - } - } - } - } - } - } - } - } - } - } - - Frame Body - { - FrameTransformMatrix - { - 1.000000,0.000000,0.000000,0.000000, - 0.000000,1.000000,0.000000,0.000000, - 0.000000,0.000000,1.000000,0.000000, - 0.000000,0.000000,0.000000,1.000000;; - } - - Mesh test2Mesh - { - 1479; - 9.163393;52.592094;5.311051;, - 9.238389;48.717903;7.829298;, - 4.414237;48.688927;8.841169;, - 3.635573;52.340664;5.854128;, - 9.163393;53.140781;0.434684;, - 4.689968;52.717564;0.392938;, - 9.088393;49.163322;-4.030602;, - 4.688091;48.439060;-3.863904;, - 9.163393;53.331882;5.609362;, - 9.238389;49.283154;8.325875;, - 11.722147;50.016842;7.103333;, - 14.414900;52.402100;5.129919;, - 9.163393;53.906952;0.104077;, - 14.609170;52.948395;0.154898;, - 9.088393;49.657726;-4.596818;, - 12.538961;51.131771;-3.441837;, - 11.743780;49.455685;6.606065;, - 3.657926;53.078899;6.152925;, - 4.392604;49.250080;9.338439;, - 14.392547;51.663868;4.831122;, - 4.714078;53.482971;0.062556;, - 14.585064;52.182983;0.485280;, - 4.665834;48.929771;-4.430783;, - 12.561217;50.641060;-2.874957;, - -3.841073;48.688927;8.841169;, - -8.665230;48.717903;7.829298;, - -8.590232;52.592094;5.311051;, - -3.062412;52.340664;5.854128;, - -8.590232;53.140781;0.434684;, - -4.116807;52.717564;0.392938;, - -8.515234;49.163322;-4.030602;, - -4.114926;48.439060;-3.863904;, - -11.148983;50.016842;7.103333;, - -8.665230;49.283154;8.325875;, - -8.590232;53.331882;5.609362;, - -13.841740;52.402100;5.129919;, - -8.590232;53.906952;0.104077;, - -14.036011;52.948395;0.154898;, - -8.515234;49.657726;-4.596818;, - -11.965799;51.131771;-3.441837;, - -11.170617;49.455685;6.606065;, - -3.084766;53.078899;6.152925;, - -3.819439;49.250080;9.338439;, - -13.819386;51.663868;4.831122;, - -4.140916;53.482971;0.062556;, - -14.011902;52.182983;0.485280;, - -4.092670;48.929771;-4.430783;, - -11.988054;50.641060;-2.874957;, - 4.242009;58.884743;2.570855;, - 1.719232;58.884743;4.326951;, - 1.719237;56.180134;3.868141;, - 4.136295;56.180134;2.112046;, - 4.610723;58.899246;1.076627;, - 4.437895;58.255383;1.427657;, - 5.073560;57.831852;-0.831290;, - 5.188532;58.921978;-0.146142;, - 2.365810;57.220150;-5.311353;, - 2.389302;57.854408;-5.411583;, - 3.446397;57.361095;-4.919837;, - 1.418339;57.462894;-5.428807;, - 1.960295;58.125488;-6.407607;, - 3.297620;58.189804;-5.624568;, - 0.916452;57.514851;-5.702876;, - 0.196953;57.775261;-6.329302;, - 0.196953;58.155617;-6.759973;, - 0.564816;57.560535;-6.329302;, - 0.196953;56.507580;-7.229795;, - 0.708737;56.429287;-6.994888;, - 4.421278;57.862228;-4.019349;, - 1.112585;56.335316;-6.608064;, - 0.196953;55.849838;-7.151498;, - 0.582964;55.818516;-6.994890;, - 0.896177;55.674747;-6.525379;, - 1.417937;56.238544;-6.527757;, - 1.563801;56.421631;-5.875276;, - 1.501053;55.516430;-5.925784;, - 1.252991;55.717010;-6.405910;, - 1.410475;56.510334;-5.864188;, - 3.431264;58.838142;-5.428817;, - 4.623211;58.867786;-3.862747;, - 1.890343;58.877293;-6.329304;, - 0.196953;58.892124;-6.759975;, - 0.196953;55.386570;-6.432980;, - 1.338982;55.451138;-5.933945;, - 0.777895;55.360485;-5.945277;, - 1.571026;56.366024;-5.339862;, - 1.571026;55.436707;-5.446356;, - 1.861757;55.585438;-5.471374;, - 1.884718;56.220394;-5.389740;, - 2.329635;56.396385;-5.213789;, - 2.469955;55.050526;-5.128000;, - 3.372011;56.456528;-4.812878;, - 3.374272;54.561684;-4.943109;, - 4.306293;56.502014;-3.484852;, - 3.994818;55.254379;-3.108994;, - 4.901477;58.929310;-2.285047;, - 4.795761;57.729420;-2.282111;, - 4.617773;56.512859;-2.432453;, - 1.247561;54.160404;-6.036166;, - 1.628837;53.851963;-5.425615;, - 1.488684;53.503712;-5.567427;, - 1.076976;53.568111;-6.080726;, - 0.196953;54.323627;-6.546213;, - 0.196953;53.731537;-6.538884;, - 0.196953;55.284870;-6.817455;, - 0.951778;55.293880;-6.407505;, - 1.324306;54.522755;-6.402828;, - 0.196953;54.639961;-6.854869;, - 1.651121;55.311077;-5.924803;, - 1.872430;54.120838;-6.092515;, - 2.486549;54.906082;-5.613785;, - 1.896263;53.393780;-5.016593;, - 3.004211;54.377865;-5.643836;, - 2.416372;53.485512;-6.018716;, - 4.294228;53.059486;-5.110569;, - 4.603637;53.194355;-4.556661;, - 3.353439;52.269436;-6.323624;, - 3.164008;52.026455;-5.518155;, - 2.831037;52.120289;-6.667702;, - 1.427815;53.126896;-6.581466;, - 0.196953;53.319347;-7.071489;, - 4.258074;51.279964;-6.929201;, - 0.196953;51.218552;-7.671501;, - 1.286211;51.037498;-7.819720;, - 0.196953;48.516830;-4.831125;, - 0.906312;47.223148;-6.323102;, - 2.390713;50.135826;-8.501509;, - 5.147715;49.761192;-2.113228;, - 5.483280;49.024506;-7.912204;, - 3.519759;47.640644;-8.922348;, - 2.230943;45.983410;-6.837262;, - 5.862195;46.566502;-7.827096;, - 6.063165;47.270485;-4.336467;, - 5.817128;46.143192;-6.768289;, - 4.771815;46.200104;-8.748175;, - 4.112585;45.550518;-7.827313;, - 5.082815;53.401516;-0.452015;, - 5.082815;55.802074;-0.757885;, - 6.278196;45.850166;-8.067322;, - 6.233131;45.426857;-7.008514;, - 5.187818;45.483761;-8.988400;, - 4.528587;44.834175;-8.067539;, - 7.751843;45.219013;-8.465691;, - 7.664405;44.397705;-6.411367;, - 5.636263;44.508118;-10.252790;, - 4.357210;43.247772;-8.466115;, - 7.991459;42.205650;-8.873802;, - 7.938428;41.592506;-7.636380;, - 6.708311;41.659477;-9.966291;, - 5.932536;40.895046;-8.882633;, - 7.677983;38.542618;-9.851732;, - 0.196953;58.884743;4.326951;, - 0.196953;56.180134;3.868141;, - 4.401065;56.646732;1.280575;, - 4.430346;55.772125;0.639352;, - 0.196953;53.862251;5.027995;, - 2.420499;53.751408;4.068233;, - 4.104025;53.089230;2.761263;, - 4.926210;51.548302;1.105534;, - 0.196953;51.306179;5.766455;, - 2.537956;50.579800;4.794079;, - 4.280571;49.732357;3.256207;, - 5.337671;48.582260;0.821585;, - 5.337671;47.371635;-1.636148;, - 0.196953;59.059555;4.940836;, - 1.877897;59.059555;4.940958;, - 5.022821;59.059555;2.991112;, - 5.431325;59.075630;1.332422;, - 6.073157;59.100891;-0.026047;, - 5.753413;59.109047;-2.406004;, - 5.444712;59.040668;-4.160086;, - 4.124426;59.007809;-5.896048;, - 2.070525;59.051250;-6.894945;, - 0.196953;59.067738;-7.373756;, - 0.196953;60.034519;4.932486;, - 1.875382;60.034519;4.933323;, - 5.012119;60.034527;2.990359;, - 5.413950;60.050449;1.339854;, - 6.055133;60.075699;-0.018468;, - 5.730547;60.083881;-2.419671;, - 5.424481;60.015327;-4.181113;, - 4.127413;59.982983;-5.894018;, - 2.082769;60.026131;-6.883855;, - 0.196953;60.042675;-7.364650;, - 0.196953;61.891335;4.474140;, - 2.119642;61.891335;4.476328;, - 4.312335;61.891335;2.701971;, - 4.631948;61.891903;1.199314;, - 5.159706;61.892818;-0.050380;, - 4.883253;61.893120;-2.302159;, - 4.635466;61.890621;-3.937706;, - 3.606839;61.889484;-5.468257;, - 2.316901;61.891026;-6.361181;, - 0.196953;61.891628;-6.807594;, - 0.196953;63.485386;2.934556;, - 1.273063;63.485386;2.936174;, - 2.932324;63.485386;1.646364;, - 3.173945;63.485817;0.554150;, - 3.573367;63.486504;-0.354457;, - 3.363917;63.486732;-1.992494;, - 3.176482;63.484837;-3.181942;, - 2.398919;63.483986;-4.293848;, - 1.422985;63.485149;-4.942707;, - 0.196953;63.485607;-5.267362;, - 0.196953;64.502686;-1.390165;, - -1.325331;58.884743;4.326951;, - -3.848105;58.884743;2.570855;, - -3.742393;56.180134;2.112046;, - -1.325334;56.180134;3.868141;, - -4.043993;58.255383;1.427657;, - -4.216822;58.899246;1.076627;, - -4.794626;58.921978;-0.146142;, - -4.679657;57.831852;-0.831290;, - -3.052497;57.361095;-4.919837;, - -1.995399;57.854408;-5.411583;, - -1.971910;57.220150;-5.311353;, - -1.024434;57.462894;-5.428807;, - -2.903716;58.189804;-5.624568;, - -1.566390;58.125488;-6.407607;, - -0.522547;57.514851;-5.702876;, - -0.170911;57.560535;-6.329302;, - -0.314837;56.429287;-6.994888;, - -4.027374;57.862228;-4.019349;, - -0.718680;56.335316;-6.608064;, - -0.189061;55.818516;-6.994890;, - -0.502274;55.674747;-6.525379;, - -1.169898;56.421631;-5.875276;, - -1.024032;56.238544;-6.527757;, - -0.859088;55.717010;-6.405910;, - -1.107148;55.516430;-5.925784;, - -1.016574;56.510334;-5.864188;, - -4.229308;58.867786;-3.862747;, - -3.037360;58.838142;-5.428817;, - -1.496442;58.877293;-6.329304;, - -0.383995;55.360485;-5.945277;, - -0.945081;55.451138;-5.933945;, - -1.177125;55.436707;-5.446356;, - -1.177123;56.366024;-5.339862;, - -1.490817;56.220394;-5.389740;, - -1.467852;55.585438;-5.471374;, - -1.935732;56.396385;-5.213789;, - -2.076050;55.050526;-5.128000;, - -2.978111;56.456528;-4.812878;, - -2.980371;54.561684;-4.943109;, - -3.912392;56.502014;-3.484852;, - -3.600917;55.254379;-3.108994;, - -4.507572;58.929310;-2.285047;, - -4.401859;57.729420;-2.282111;, - -4.223874;56.512859;-2.432453;, - -1.234934;53.851963;-5.425615;, - -0.853661;54.160404;-6.036166;, - -0.683076;53.568111;-6.080726;, - -1.094784;53.503712;-5.567427;, - -0.557873;55.293880;-6.407505;, - -0.930401;54.522755;-6.402828;, - -1.257221;55.311077;-5.924803;, - -1.478527;54.120838;-6.092515;, - -2.092644;54.906082;-5.613785;, - -1.502358;53.393780;-5.016593;, - -2.022469;53.485512;-6.018716;, - -2.610310;54.377865;-5.643836;, - -3.900326;53.059486;-5.110569;, - -4.209735;53.194355;-4.556661;, - -2.959539;52.269436;-6.323624;, - -2.770105;52.026455;-5.518155;, - -1.033910;53.126896;-6.581466;, - -2.437134;52.120289;-6.667702;, - -3.864171;51.279964;-6.929201;, - -0.892305;51.037498;-7.819720;, - -0.512412;47.223148;-6.323102;, - -1.996812;50.135826;-8.501509;, - -4.753813;49.761192;-2.113228;, - -5.089376;49.024506;-7.912204;, - -3.125859;47.640644;-8.922348;, - -1.837040;45.983410;-6.837262;, - -5.468292;46.566502;-7.827096;, - -5.423228;46.143192;-6.768289;, - -5.669262;47.270485;-4.336467;, - -4.377913;46.200104;-8.748175;, - -3.718686;45.550518;-7.827313;, - -4.688914;53.401516;-0.452015;, - -4.688914;55.802074;-0.757885;, - -5.884295;45.850166;-8.067322;, - -5.839230;45.426857;-7.008514;, - -4.793914;45.483761;-8.988400;, - -4.134687;44.834175;-8.067539;, - -7.357939;45.219013;-8.465691;, - -7.270504;44.397705;-6.411367;, - -5.242361;44.508118;-10.252790;, - -3.963310;43.247772;-8.466115;, - -7.597560;42.205650;-8.873802;, - -7.544526;41.592506;-7.636380;, - -6.314410;41.659477;-9.966291;, - -5.538635;40.895046;-8.882633;, - -7.284081;38.542618;-9.851732;, - -4.036447;55.772125;0.639352;, - -4.007164;56.646732;1.280575;, - -2.026598;53.751408;4.068233;, - -4.532308;51.548302;1.105534;, - -3.710120;53.089230;2.761263;, - -2.144051;50.579800;4.794079;, - -3.886670;49.732357;3.256207;, - -4.943766;48.582260;0.821585;, - -4.943766;47.371635;-1.636148;, - -1.483993;59.059555;4.940958;, - -4.628918;59.059555;2.991112;, - -5.037425;59.075630;1.332422;, - -5.679255;59.100891;-0.026047;, - -5.359512;59.109047;-2.406004;, - -5.050810;59.040668;-4.160086;, - -3.730523;59.007809;-5.896048;, - -1.676620;59.051250;-6.894945;, - -1.481479;60.034519;4.933323;, - -4.618215;60.034527;2.990359;, - -5.020047;60.050449;1.339854;, - -5.661230;60.075699;-0.018468;, - -5.336645;60.083881;-2.419671;, - -5.030577;60.015327;-4.181113;, - -3.733512;59.982983;-5.894018;, - -1.688867;60.026131;-6.883855;, - -1.725740;61.891335;4.476328;, - -3.918436;61.891335;2.701971;, - -4.238046;61.891903;1.199314;, - -4.765804;61.892818;-0.050380;, - -4.489351;61.893120;-2.302159;, - -4.241562;61.890621;-3.937706;, - -3.212934;61.889484;-5.468257;, - -1.923000;61.891026;-6.361181;, - -0.879161;63.485386;2.936174;, - -2.538420;63.485386;1.646364;, - -2.780046;63.485817;0.554150;, - -3.179467;63.486504;-0.354457;, - -2.970013;63.486732;-1.992494;, - -2.782579;63.484837;-3.181942;, - -2.005019;63.483986;-4.293848;, - -1.029080;63.485149;-4.942707;, - -0.192284;65.158386;-0.267689;, - -0.617771;65.158386;-1.004657;, - -0.014429;64.035477;-1.004657;, - 0.109390;64.035477;-0.790199;, - 0.234013;67.669022;-1.022976;, - 0.658695;65.158386;-0.267689;, - 0.357023;64.035477;-0.790199;, - 1.084181;65.158386;-1.004657;, - 0.480839;64.035477;-1.004657;, - 0.658695;65.158386;-1.741625;, - 0.357023;64.035477;-1.219115;, - -0.192284;65.158386;-1.741625;, - 0.109390;64.035477;-1.219115;, - 7.321572;63.560955;-0.055478;, - 7.050604;63.754948;-1.851895;, - 2.748468;63.025620;-1.582111;, - 2.822511;62.793049;0.228580;, - 7.863518;62.050617;0.503212;, - 2.702447;60.765869;0.971560;, - 8.134492;60.734272;-0.734516;, - 2.776194;59.416355;-0.247001;, - 7.863518;60.928257;-2.530933;, - 2.702447;59.647991;-2.050448;, - 7.321572;62.438591;-3.089625;, - 2.822511;61.670685;-2.805565;, - 9.181485;64.333855;-2.066042;, - 9.632345;64.462769;-1.100490;, - 10.534081;64.061180;-0.951941;, - 10.984941;63.530704;-1.768948;, - 10.534077;63.401791;-2.734500;, - 9.632351;63.803379;-2.883049;, - 10.870568;67.072159;-2.811351;, - 11.125603;67.210205;-2.340091;, - 11.635665;67.146370;-2.316478;, - 11.890695;66.944496;-2.764128;, - 11.635665;66.806458;-3.235387;, - 11.125603;66.870285;-3.259001;, - 10.770185;70.864441;-4.091156;, - -2.175307;63.025620;-1.582111;, - -6.477442;63.754936;-1.851895;, - -6.748413;63.560955;-0.055478;, - -2.249351;62.793049;0.228580;, - -7.290359;62.050617;0.503212;, - -2.129283;60.765858;0.971560;, - -7.561328;60.734272;-0.734516;, - -2.203030;59.416344;-0.247001;, - -7.290359;60.928257;-2.530933;, - -2.129283;59.647991;-2.050448;, - -6.748413;62.438591;-3.089625;, - -2.249351;61.670685;-2.805565;, - -8.608323;64.333855;-2.066042;, - -9.059186;64.462769;-1.100490;, - -9.960917;64.061180;-0.951941;, - -10.411779;63.530704;-1.768948;, - -9.960917;63.401791;-2.734500;, - -9.059186;63.803379;-2.883049;, - -10.297409;67.072159;-2.811351;, - -10.552441;67.210205;-2.340091;, - -11.062504;67.146370;-2.316479;, - -11.317535;66.944496;-2.764129;, - -11.062504;66.806458;-3.235389;, - -10.552441;66.870285;-3.259001;, - -10.197022;70.864441;-4.091156;, - 9.278677;42.422218;6.029630;, - 3.269274;42.720932;10.305261;, - 3.727235;37.106018;10.305261;, - 8.567321;37.947166;6.627038;, - 3.076538;53.204800;4.651457;, - 0.063876;53.173985;0.844661;, - 1.636344;53.091850;6.132280;, - 10.371579;42.720932;0.675551;, - 10.590998;38.832512;-0.519268;, - 4.213577;53.047283;0.988064;, - 8.567321;42.720932;-4.893595;, - 8.567321;40.015377;-5.275937;, - 3.118487;52.304691;-0.871308;, - 3.269272;42.644463;-8.265944;, - 3.269272;40.303337;-8.724752;, - 1.678248;51.885815;-2.496562;, - 0.063876;40.303337;-8.724752;, - 0.063876;42.644463;-8.265944;, - 8.092727;46.706837;7.085848;, - 4.030234;47.533649;9.387641;, - 7.498330;46.932663;-3.808702;, - 9.269650;46.553898;-0.745430;, - 2.860954;47.304241;-6.201300;, - 0.063876;47.304241;-6.201299;, - 6.308704;51.898582;5.810977;, - 2.260517;51.022770;7.858276;, - 6.308704;51.061012;-1.528991;, - 7.708933;51.749233;0.002558;, - 2.260515;49.875748;-3.830782;, - 0.063876;53.091850;6.132280;, - 0.063876;51.405113;7.858276;, - 0.063876;42.720932;10.305261;, - 0.063876;37.106018;10.305261;, - 0.063876;51.885815;-2.496561;, - 0.063876;47.533646;9.378681;, - 0.063876;49.952217;-4.021954;, - 9.563355;51.572124;5.130688;, - 10.424463;51.137897;0.771196;, - -3.599484;37.106018;10.305261;, - -3.141526;42.720932;10.305261;, - -9.150930;42.422218;6.029630;, - -8.439575;37.947166;6.627038;, - -1.508598;53.091850;6.132280;, - -2.948791;53.204800;4.651457;, - -10.243833;42.720932;0.675551;, - -10.463250;38.832512;-0.519268;, - -4.085828;53.047283;0.988064;, - -8.439575;42.720932;-4.893595;, - -8.439575;40.015377;-5.275937;, - -2.990738;52.304691;-0.871308;, - -3.141523;42.644463;-8.265944;, - -3.141523;40.303337;-8.724752;, - -1.550497;51.885815;-2.496562;, - -3.902486;47.533649;9.387641;, - -7.964980;46.706837;7.085848;, - -9.141901;46.553898;-0.745430;, - -7.370583;46.932663;-3.808702;, - -2.733205;47.304241;-6.201300;, - -2.132767;51.022770;7.858276;, - -6.180955;51.898582;5.810977;, - -7.581183;51.749233;0.002558;, - -6.180955;51.061012;-1.528991;, - -2.132767;49.875748;-3.830782;, - -9.435607;51.572124;5.130688;, - -10.296713;51.137897;0.771196;, - 26.442608;31.439417;2.804749;, - 27.750952;33.479103;1.464946;, - 28.644909;31.793991;1.543602;, - 27.650051;30.546118;1.966592;, - 27.962191;30.422531;4.730635;, - 25.291662;35.616783;6.993527;, - 23.804535;33.790108;6.865523;, - 28.113920;30.947910;7.563584;, - 29.418135;32.175655;7.563584;, - 26.276403;37.035873;5.267626;, - 29.144712;26.626286;4.498936;, - 30.605154;26.898275;4.811452;, - 30.184065;26.943773;6.619426;, - 29.278811;26.812195;6.619426;, - 23.970884;33.278522;4.380921;, - 26.921537;36.568802;3.461252;, - 25.464495;35.399422;1.973382;, - 29.121349;26.822264;2.423525;, - 29.903082;27.052881;2.157598;, - 23.995649;32.729515;1.987316;, - 25.637072;33.964241;0.536960;, - 25.396690;32.550930;-0.123384;, - 24.000338;31.858027;1.237716;, - 24.161800;33.391464;3.241510;, - 29.999184;32.499008;5.227734;, - 26.998781;32.694099;1.064689;, - 25.652718;30.935171;2.198134;, - 25.432625;28.413658;0.334064;, - 26.032991;29.244349;-0.349298;, - 26.852461;29.841438;0.779249;, - 26.386019;28.977617;1.267885;, - 26.512205;31.188791;1.184134;, - 25.206884;31.094601;-0.305392;, - 23.991529;30.626995;0.930952;, - 30.933636;29.712465;5.072928;, - 30.310335;29.777977;7.264207;, - 28.988699;28.980301;7.299366;, - 28.432882;29.246729;4.638216;, - 29.648125;29.915192;1.703345;, - 28.309542;29.520292;2.073250;, - 6.755167;0.046006;8.013719;, - 5.431096;0.088037;3.223917;, - 12.250779;0.088037;3.300384;, - 5.309235;0.894232;2.923214;, - 12.009439;0.731735;2.923214;, - 4.846424;0.413626;-6.580339;, - 7.194882;0.034675;-8.202744;, - 10.442262;0.175008;-8.276375;, - 5.897818;0.168155;0.023152;, - 11.833355;0.047754;-6.787080;, - 12.240962;0.175049;0.374328;, - 6.753324;1.573865;7.859301;, - 5.310324;1.516512;3.522007;, - 10.324868;0.327974;8.243123;, - 10.323023;1.855839;8.088705;, - 12.010524;1.354014;3.522007;, - 7.195130;0.874356;-8.201875;, - 10.442509;1.014684;-8.275504;, - 4.846746;1.253311;-6.580090;, - 11.833675;0.887438;-6.786831;, - 5.898684;1.007790;0.014234;, - 12.241827;1.014688;0.365411;, - 8.078106;3.698104;-7.581497;, - 11.428559;3.021991;-6.440265;, - 5.468536;3.167656;-5.998088;, - 5.238337;3.089141;-2.541014;, - 11.932255;2.791543;-3.152129;, - 8.602904;5.932668;-0.505548;, - 11.133778;5.817454;1.389889;, - 8.140334;4.399764;-4.469068;, - 8.224634;5.036399;-2.774021;, - 11.898876;5.830766;3.514578;, - 5.863575;5.809277;1.057280;, - 4.953313;5.817947;3.744911;, - 5.601276;5.822373;6.464175;, - 7.258355;5.792872;6.393783;, - 10.561975;5.836313;6.220846;, - 3.714457;19.327164;5.891222;, - 2.395580;19.017778;1.623937;, - 2.663392;17.355799;1.982380;, - 3.977465;17.241997;5.800620;, - 6.098813;19.432480;7.503632;, - 6.110166;17.147745;7.382187;, - 9.150031;20.134617;6.603466;, - 9.390180;17.139515;5.800619;, - 12.296237;20.290672;1.623937;, - 12.022444;17.723486;1.982380;, - 9.151049;19.982052;-2.746684;, - 9.045196;17.139517;-1.835862;, - 6.099829;19.279917;-4.705683;, - 6.618869;17.147745;-3.417428;, - 3.568517;19.174599;-2.746683;, - 3.743971;17.241997;-1.835860;, - 2.744522;21.981775;7.255371;, - 0.781750;21.713270;1.998527;, - 5.311180;23.393459;9.200554;, - 8.947892;24.840387;7.668663;, - 12.009036;25.446686;1.982380;, - 8.947892;24.362463;-3.649055;, - 5.311180;22.915539;-6.179790;, - 2.633436;21.656416;-3.632905;, - 1.563167;23.850784;8.223292;, - 0.063876;23.353767;1.793407;, - 9.435429;28.020374;7.743168;, - 8.477934;28.887068;-4.569030;, - 11.027375;30.391527;0.493318;, - 3.810796;27.047464;-6.897249;, - 0.063876;24.272585;-4.193496;, - 13.090539;50.522636;1.384549;, - 13.041045;50.467754;5.078930;, - 15.039926;48.268642;5.106739;, - 15.654872;48.436718;2.094133;, - 9.371727;37.438923;7.067486;, - 4.033619;36.444157;10.870089;, - 11.587032;38.454742;-0.613277;, - 9.381097;39.704651;-5.891787;, - 3.585032;40.004971;-9.656940;, - 0.063876;40.004971;-9.656940;, - 8.947521;33.780930;6.792171;, - 4.207292;33.892616;11.120209;, - 11.152753;32.194057;-0.597313;, - 9.604399;31.258600;-5.890305;, - 3.468354;30.257090;-9.461814;, - 0.063876;30.257090;-9.461814;, - 8.336151;33.208889;6.506425;, - 3.972105;33.252815;10.523578;, - 10.880808;31.578617;-0.480340;, - 8.391865;30.899374;-5.411129;, - 3.229546;29.783400;-8.733105;, - 0.063876;29.783400;-8.733105;, - 8.763739;31.230478;7.043343;, - 0.063876;25.862223;-6.032537;, - 0.063876;36.444157;10.870090;, - 0.063876;33.892616;11.120211;, - 0.063876;33.252815;10.523581;, - 0.063876;24.095449;8.763750;, - 0.063876;25.246412;10.275227;, - 0.063876;31.503160;10.970792;, - 4.717443;31.494150;10.284621;, - 0.063876;27.969845;11.631809;, - 5.059318;27.174917;10.768083;, - 3.292733;13.614117;8.688048;, - 2.012897;13.266646;2.479012;, - 7.391886;13.045812;9.537921;, - 9.592052;13.108393;8.535723;, - 13.927161;13.699846;2.063019;, - 11.253488;12.661762;-3.185383;, - 7.687788;12.915033;-4.890432;, - 3.292731;13.091016;-3.337706;, - 4.909685;14.315273;6.833395;, - 3.449045;14.019177;2.395389;, - 7.335181;13.898731;7.254448;, - 8.640161;14.192272;6.638759;, - 12.054080;14.385403;1.847208;, - 10.983072;13.852963;-1.636501;, - 7.731716;13.866605;-2.741714;, - 4.956770;13.926673;-1.904490;, - 4.622008;12.070519;7.351222;, - 3.704210;12.065571;2.885277;, - 7.193317;12.063840;7.696905;, - 9.864344;12.084161;6.936748;, - 12.660480;12.906409;2.302423;, - 11.551223;11.698577;-0.567342;, - 7.725829;10.867992;-1.832680;, - 5.002745;10.862820;-0.929778;, - 12.585479;45.664989;7.008708;, - 12.874625;45.344864;-1.512470;, - 15.109089;43.486977;7.253585;, - 13.087454;40.435127;5.464614;, - 13.795866;40.778912;1.743529;, - 15.452188;43.225502;-0.514091;, - 16.849886;45.784691;5.345008;, - 17.423424;46.063019;2.332403;, - 16.609575;42.436638;6.842184;, - 14.607471;39.414421;5.619863;, - 15.315888;39.758205;1.898780;, - 16.952673;42.175163;0.809246;, - 18.329708;44.705509;5.492955;, - 18.903246;44.983837;2.480351;, - 18.144800;40.845119;8.897065;, - 14.914027;35.968437;6.910757;, - 16.068686;36.528782;0.845695;, - 18.704021;40.418938;-0.936131;, - 20.914110;44.495216;6.691762;, - 21.848928;44.948868;1.781464;, - 18.167065;40.766296;8.049853;, - 15.450755;36.687752;6.384915;, - 16.415583;37.133137;1.422668;, - 18.616444;40.429634;-0.082681;, - 20.535810;43.903175;6.157079;, - 21.299704;44.256214;2.222467;, - 20.548147;39.083851;7.840796;, - 18.160057;35.498848;6.365007;, - 19.018757;35.895241;1.948607;, - 20.948095;38.784222;0.303311;, - 22.625053;41.832062;6.150033;, - 23.304918;42.146267;2.648228;, - 23.432049;37.018097;6.817175;, - 21.932474;34.767567;5.880031;, - 23.302208;36.315411;2.154666;, - 22.480751;35.020664;3.060161;, - 24.731340;38.735447;5.732314;, - 25.165438;38.936066;3.496411;, - 23.626654;36.826782;1.797030;, - -28.517160;31.793991;1.543602;, - -27.623203;33.479103;1.464946;, - -26.314863;31.439417;2.804749;, - -27.522303;30.546118;1.966592;, - -27.834438;30.422531;4.730635;, - -27.986174;30.947910;7.563584;, - -23.676790;33.790108;6.865523;, - -25.163914;35.616783;6.993527;, - -29.290388;32.175655;7.563584;, - -26.148655;37.035873;5.267626;, - -30.056318;26.943773;6.619426;, - -30.477406;26.898275;4.811452;, - -29.016966;26.626286;4.498936;, - -29.151058;26.812195;6.619426;, - -23.843136;33.278522;4.380921;, - -25.336742;35.399422;1.973382;, - -26.793785;36.568802;3.461252;, - -29.775337;27.052881;2.157598;, - -28.993601;26.822264;2.423525;, - -25.268938;32.550930;-0.123384;, - -25.509323;33.964241;0.536960;, - -23.867901;32.729515;1.987316;, - -23.872589;31.858027;1.237716;, - -24.034052;33.391464;3.241510;, - -29.871441;32.499008;5.227734;, - -26.871038;32.694099;1.064689;, - -25.524969;30.935171;2.198134;, - -26.724709;29.841438;0.779249;, - -25.905239;29.244349;-0.349298;, - -25.304882;28.413658;0.334064;, - -26.258276;28.977617;1.267885;, - -25.079140;31.094601;-0.305392;, - -26.384459;31.188791;1.184134;, - -23.863787;30.626995;0.930952;, - -30.805887;29.712465;5.072928;, - -30.182587;29.777977;7.264207;, - -28.860950;28.980301;7.299366;, - -28.305138;29.246729;4.638216;, - -29.520382;29.915192;1.703345;, - -28.181793;29.520292;2.073250;, - -12.123036;0.088037;3.300384;, - -5.303345;0.088037;3.223917;, - -6.627419;0.046006;8.013719;, - -11.881689;0.731735;2.923214;, - -5.181487;0.894232;2.923214;, - -10.314516;0.175008;-8.276375;, - -7.067134;0.034675;-8.202744;, - -4.718675;0.413626;-6.580339;, - -11.705606;0.047754;-6.787080;, - -5.770067;0.168155;0.023152;, - -12.113213;0.175049;0.374328;, - -5.182574;1.516512;3.522007;, - -6.625576;1.573865;7.859301;, - -10.195277;1.855839;8.088705;, - -10.197120;0.327974;8.243123;, - -11.882777;1.354014;3.522007;, - -10.314760;1.014684;-8.275504;, - -7.067381;0.874356;-8.201875;, - -4.718995;1.253311;-6.580090;, - -11.705929;0.887438;-6.786831;, - -5.770934;1.007790;0.014234;, - -12.114079;1.014688;0.365411;, - -11.300814;3.021991;-6.440265;, - -7.950356;3.698104;-7.581497;, - -5.340785;3.167656;-5.998088;, - -5.110586;3.089141;-2.541014;, - -11.804509;2.791543;-3.152129;, - -11.006028;5.817454;1.389889;, - -8.475157;5.932668;-0.505548;, - -8.096884;5.036399;-2.774021;, - -8.012587;4.399764;-4.469068;, - -11.771126;5.830766;3.514578;, - -5.735826;5.809277;1.057280;, - -4.825563;5.817947;3.744911;, - -5.473527;5.822373;6.464175;, - -7.130609;5.792872;6.393783;, - -10.434228;5.836313;6.220846;, - -2.535641;17.355799;1.982380;, - -2.267831;19.017778;1.623937;, - -3.586708;19.327164;5.891222;, - -3.849715;17.241997;5.800620;, - -5.971066;19.432480;7.503632;, - -5.982419;17.147745;7.382187;, - -9.022285;20.134617;6.603466;, - -9.262430;17.139515;5.800619;, - -12.168489;20.290672;1.623937;, - -11.894694;17.723486;1.982380;, - -9.023302;19.982052;-2.746684;, - -8.917446;17.139517;-1.835862;, - -5.972082;19.279917;-4.705683;, - -6.491119;17.147745;-3.417428;, - -3.440768;19.174599;-2.746683;, - -3.616219;17.241997;-1.835860;, - -0.653999;21.713270;1.998527;, - -2.616775;21.981775;7.255371;, - -5.183431;23.393459;9.200554;, - -8.820147;24.840387;7.668663;, - -11.881289;25.446686;1.982380;, - -8.820147;24.362463;-3.649055;, - -5.183429;22.915539;-6.179790;, - -2.505685;21.656416;-3.632905;, - -1.435419;23.850784;8.223292;, - -9.307683;28.020374;7.743168;, - -10.899626;30.391527;0.493318;, - -8.350187;28.887068;-4.569030;, - -3.683043;27.047464;-6.897249;, - -14.912179;48.268642;5.106739;, - -12.913298;50.467754;5.078930;, - -12.962790;50.522636;1.384549;, - -15.527129;48.436718;2.094133;, - -9.243979;37.438923;7.067486;, - -3.905869;36.444157;10.870089;, - -11.459283;38.454742;-0.613277;, - -9.253351;39.704651;-5.891787;, - -3.457279;40.004971;-9.656940;, - -8.819773;33.780930;6.792171;, - -4.079543;33.892616;11.120209;, - -11.025005;32.194057;-0.597313;, - -9.476652;31.258600;-5.890305;, - -3.340604;30.257090;-9.461814;, - -8.208400;33.208889;6.506425;, - -3.844355;33.252815;10.523578;, - -10.753060;31.578617;-0.480340;, - -8.264114;30.899374;-5.411129;, - -3.101796;29.783400;-8.733105;, - -8.635990;31.230478;7.043343;, - -4.589693;31.494150;10.284621;, - -4.931572;27.174917;10.768083;, - -3.164983;13.614117;8.688048;, - -1.885150;13.266646;2.479012;, - -7.264134;13.045812;9.537921;, - -9.464302;13.108393;8.535723;, - -13.799416;13.699846;2.063019;, - -11.125739;12.661762;-3.185383;, - -7.560040;12.915033;-4.890432;, - -3.164983;13.091016;-3.337706;, - -4.781938;14.315273;6.833395;, - -3.321296;14.019177;2.395389;, - -7.207436;13.898731;7.254448;, - -8.512415;14.192272;6.638759;, - -11.926332;14.385403;1.847208;, - -10.855326;13.852963;-1.636501;, - -7.603969;13.866605;-2.741714;, - -4.829021;13.926673;-1.904490;, - -4.494260;12.070519;7.351222;, - -3.576463;12.065571;2.885277;, - -7.065567;12.063840;7.696905;, - -9.736598;12.084161;6.936748;, - -12.532731;12.906409;2.302423;, - -11.423474;11.698577;-0.567342;, - -7.598082;10.867992;-1.832680;, - -4.874997;10.862820;-0.929778;, - -12.457731;45.664989;7.008708;, - -12.746877;45.344864;-1.512470;, - -14.981347;43.486977;7.253585;, - -12.959704;40.435127;5.464614;, - -13.668120;40.778912;1.743529;, - -15.324445;43.225502;-0.514091;, - -16.722143;45.784691;5.345008;, - -17.295679;46.063019;2.332403;, - -16.481831;42.436638;6.842184;, - -14.479725;39.414421;5.619863;, - -15.188142;39.758205;1.898780;, - -16.824930;42.175163;0.809246;, - -18.201963;44.705509;5.492955;, - -18.775501;44.983837;2.480351;, - -18.017056;40.845119;8.897065;, - -14.786280;35.968437;6.910757;, - -15.940937;36.528782;0.845695;, - -18.576277;40.418938;-0.936131;, - -20.786366;44.495216;6.691762;, - -21.721182;44.948868;1.781464;, - -18.039320;40.766296;8.049853;, - -15.323012;36.687752;6.384915;, - -16.287840;37.133137;1.422668;, - -18.488697;40.429634;-0.082681;, - -20.408064;43.903175;6.157079;, - -21.171957;44.256214;2.222467;, - -20.420401;39.083851;7.840796;, - -18.032312;35.498848;6.365007;, - -18.891008;35.895241;1.948607;, - -20.820349;38.784222;0.303311;, - -22.497307;41.832062;6.150033;, - -23.177174;42.146267;2.648228;, - -23.304302;37.018097;6.817175;, - -21.804729;34.767567;5.880031;, - -22.353006;35.020664;3.060161;, - -23.174463;36.315411;2.154666;, - -24.603598;38.735447;5.732314;, - -25.037689;38.936066;3.496411;, - -23.498907;36.826782;1.797030;, - 32.573399;20.998508;-13.993474;, - 31.347282;21.510612;-18.896196;, - 32.212158;19.942856;-22.086969;, - 34.386311;17.725908;-19.577688;, - 32.721909;19.000187;-25.473017;, - 35.309505;16.038933;-24.075357;, - 32.861069;18.711260;-28.951471;, - 35.487915;15.668485;-28.535112;, - 32.625397;19.084837;-32.416637;, - 35.185760;16.147453;-32.977818;, - 32.022045;20.109577;-35.763229;, - 34.412201;17.461275;-37.268509;, - 31.069363;21.754337;-38.889565;, - 33.190762;19.570044;-41.276810;, - 30.172787;23.316404;-40.686150;, - 30.727213;23.864517;-46.026169;, - 26.799459;29.484686;-23.919806;, - 26.588755;29.721081;-34.907444;, - 28.314373;26.659443;-35.908363;, - 28.665804;26.196402;-23.140169;, - 29.684425;24.219271;-37.460514;, - 30.009434;23.747953;-29.136843;, - 30.314682;23.305275;-21.319128;, - 33.628345;20.744303;-22.096889;, - 32.763477;22.312052;-18.906120;, - 34.138103;19.801640;-25.482931;, - 34.277260;19.512701;-28.961386;, - 34.041592;19.886280;-32.426556;, - 33.438240;20.911032;-35.773148;, - 32.485558;22.555790;-38.899498;, - 31.588987;24.117847;-40.696075;, - 29.730568;27.460878;-35.918262;, - 28.004946;30.522528;-34.917355;, - 28.215664;30.286123;-23.929716;, - 30.082003;26.997847;-23.150089;, - 31.425623;24.549398;-29.146767;, - 31.100611;25.020727;-37.470440;, - 31.730875;24.106718;-21.329044;, - 28.887688;30.497171;16.516956;, - 28.264534;31.576502;16.538700;, - 27.273039;30.284517;16.527586;, - 28.868330;30.531387;14.265285;, - 28.245173;31.610723;14.287043;, - 28.430216;31.305752;-36.706051;, - 26.815575;31.093081;-36.695400;, - 27.807066;32.385075;-36.684288;, - 28.565001;29.293274;16.501442;, - 28.545649;29.327480;14.249776;, - 28.107540;30.101837;-36.721565;, - 27.485502;28.670019;16.501251;, - 27.466146;28.704229;14.249575;, - 27.028032;29.478594;-36.721748;, - 26.281548;28.992525;16.516499;, - 26.262192;29.026735;14.264828;, - 25.824083;29.801088;-36.706490;, - 25.658390;30.071863;16.538246;, - 25.639032;30.106077;14.286580;, - 25.200922;30.880438;-36.684742;, - 25.981071;31.275770;16.553751;, - 25.961720;31.309975;14.302090;, - 25.523605;32.084339;-36.669224;, - 27.060581;31.899025;16.553940;, - 27.041225;31.933235;14.302281;, - 26.603115;32.707592;-36.669060;, - 28.548414;31.096832;-22.954752;, - 27.925262;32.176163;-22.932991;, - 28.111961;31.846174;-1.211521;, - 28.735117;30.766836;-1.233276;, - 28.225733;29.892931;-22.970266;, - 28.412436;29.562933;-1.248788;, - 27.146231;29.269676;-22.970453;, - 27.332933;28.939684;-1.248984;, - 25.942278;29.592182;-22.955206;, - 26.128983;29.262184;-1.233739;, - 25.319118;30.671524;-22.933453;, - 25.505823;30.341524;-1.211982;, - 25.641800;31.875427;-22.917944;, - 25.828506;31.545427;-1.196465;, - 26.721312;32.498676;-22.917738;, - 26.908014;32.168686;-1.196282;, - 29.272268;30.830444;-0.798965;, - 28.443258;32.266331;-0.770020;, - 28.568949;32.044174;13.852868;, - 29.397957;30.608292;13.823928;, - 28.842997;29.228819;-0.819599;, - 28.968679;29.006672;13.803288;, - 27.406893;28.399687;-0.819852;, - 27.532579;28.177542;13.803031;, - 25.805210;28.828726;-0.799567;, - 25.930891;28.606585;13.823323;, - 24.976185;30.264614;-0.770632;, - 25.101870;30.042463;13.852263;, - 25.405474;31.866238;-0.749988;, - 25.531157;31.644094;13.872904;, - 26.841581;32.695370;-0.749732;, - 26.967262;32.473228;13.873165;, - 27.815252;32.370605;-35.731056;, - 28.438414;31.291262;-35.752815;, - 28.115726;30.087366;-35.768326;, - 27.036226;29.464113;-35.768520;, - 25.832272;29.786617;-35.753273;, - 25.209120;30.865946;-35.731510;, - 25.531799;32.069855;-35.715992;, - 26.611311;32.693104;-35.715794;, - 29.151377;31.385166;-35.757492;, - 28.253050;32.941086;-35.726151;, - 28.363062;32.746647;-22.928093;, - 29.261381;31.190737;-22.959444;, - 28.686214;29.649672;-35.779873;, - 28.796217;29.455244;-22.981829;, - 27.130047;28.751215;-35.780151;, - 27.240047;28.556789;-22.982094;, - 25.394470;29.216141;-35.758179;, - 25.504477;29.021709;-22.960121;, - 24.496161;30.772045;-35.726803;, - 24.606161;30.577616;-22.928751;, - 24.961311;32.507545;-35.704453;, - 25.071318;32.313114;-22.906395;, - 26.517492;33.405987;-35.704166;, - 26.627487;33.211575;-22.906115;, - 4.623211;58.867786;-3.862747;, - 4.421278;57.862228;-4.019349;, - 4.306293;56.502014;-3.484852;, - 3.994818;55.254379;-3.108994;, - 5.147715;49.761192;-2.113228;, - 6.278196;45.850166;-8.067322;, - 6.233131;45.426857;-7.008514;, - 7.751843;45.219013;-8.465691;, - 4.528587;44.834175;-8.067539;, - 5.187818;45.483761;-8.988400;, - 5.636263;44.508118;-10.252790;, - 7.664405;44.397705;-6.411367;, - 4.357210;43.247772;-8.466115;, - 7.991459;42.205650;-8.873802;, - 6.708311;41.659477;-9.966291;, - 7.938428;41.592506;-7.636380;, - 5.932536;40.895046;-8.882633;, - 7.677983;38.542618;-9.851732;, - 7.677983;38.542618;-9.851732;, - 4.401065;56.646732;1.280575;, - 4.437895;58.255383;1.427657;, - 4.430346;55.772125;0.639352;, - 5.337671;47.371635;-1.636148;, - 4.610723;58.899246;1.076627;, - 0.196953;58.884743;4.326951;, - 1.719232;58.884743;4.326951;, - 4.242009;58.884743;2.570855;, - 4.610723;58.899246;1.076627;, - 5.188532;58.921978;-0.146142;, - 4.901477;58.929310;-2.285047;, - 4.623211;58.867786;-3.862747;, - 3.431264;58.838142;-5.428817;, - 1.890343;58.877293;-6.329304;, - 0.196953;58.892124;-6.759975;, - 0.196953;61.891335;4.474140;, - 2.119642;61.891335;4.476328;, - 4.312335;61.891335;2.701971;, - 4.631948;61.891903;1.199314;, - 5.159706;61.892818;-0.050380;, - 4.883253;61.893120;-2.302159;, - 4.635466;61.890621;-3.937706;, - 3.606839;61.889484;-5.468257;, - 2.316901;61.891026;-6.361181;, - 0.196953;61.891628;-6.807594;, - -4.753813;49.761192;-2.113228;, - -5.884295;45.850166;-8.067322;, - -5.839230;45.426857;-7.008514;, - -7.357939;45.219013;-8.465691;, - -4.134687;44.834175;-8.067539;, - -5.242361;44.508118;-10.252790;, - -4.793914;45.483761;-8.988400;, - -7.270504;44.397705;-6.411367;, - -3.963310;43.247772;-8.466115;, - -7.597560;42.205650;-8.873802;, - -6.314410;41.659477;-9.966291;, - -7.544526;41.592506;-7.636380;, - -5.538635;40.895046;-8.882633;, - -7.284081;38.542618;-9.851732;, - -7.284081;38.542618;-9.851732;, - -4.043993;58.255383;1.427657;, - -4.007164;56.646732;1.280575;, - -4.036447;55.772125;0.639352;, - -4.943766;47.371635;-1.636148;, - -4.216822;58.899246;1.076627;, - 0.196953;58.884743;4.326951;, - 0.196953;59.059555;4.940836;, - -1.325331;58.884743;4.326951;, - -3.848105;58.884743;2.570855;, - -4.216822;58.899246;1.076627;, - -4.794626;58.921978;-0.146142;, - -4.507572;58.929310;-2.285047;, - -4.229308;58.867786;-3.862747;, - -3.037360;58.838142;-5.428817;, - -1.496442;58.877293;-6.329304;, - 0.196953;60.034519;4.932486;, - 0.196953;61.891335;4.474140;, - -1.725740;61.891335;4.476328;, - -3.918436;61.891335;2.701971;, - -4.238046;61.891903;1.199314;, - -4.765804;61.892818;-0.050380;, - -4.489351;61.893120;-2.302159;, - -4.241562;61.890621;-3.937706;, - -3.212934;61.889484;-5.468257;, - -1.923000;61.891026;-6.361181;, - -0.192284;65.158386;-0.267689;, - 0.109390;64.035477;-0.790199;, - 0.234013;67.669022;-1.022976;, - 0.658695;65.158386;-0.267689;, - 0.357023;64.035477;-0.790199;, - 0.658695;65.158386;-1.741625;, - 0.357023;64.035477;-1.219115;, - -0.192284;65.158386;-1.741625;, - 0.234013;67.669022;-1.022976;, - 7.050604;63.754948;-1.851895;, - 2.748468;63.025620;-1.582111;, - 9.181485;64.333855;-2.066042;, - 10.870568;67.072159;-2.811351;, - -6.477442;63.754936;-1.851895;, - -2.175307;63.025620;-1.582111;, - -8.608323;64.333855;-2.066042;, - -10.297409;67.072159;-2.811351;, - 9.278677;42.422218;6.029630;, - 8.567321;37.947166;6.627038;, - 10.371579;42.720932;0.675551;, - 10.590998;38.832512;-0.519268;, - 0.063876;53.173985;0.844661;, - 4.213577;53.047283;0.988064;, - 9.269650;46.553898;-0.745430;, - 6.308704;51.061012;-1.528991;, - 7.708933;51.749233;0.002558;, - 7.708933;51.749233;0.002558;, - 6.308704;51.898582;5.810977;, - 8.092727;46.706837;7.085848;, - 0.063876;53.173985;0.844661;, - -8.439575;37.947166;6.627038;, - -9.150930;42.422218;6.029630;, - -10.463250;38.832512;-0.519268;, - -10.243833;42.720932;0.675551;, - -4.085828;53.047283;0.988064;, - -9.141901;46.553898;-0.745430;, - -6.180955;51.061012;-1.528991;, - 0.063876;51.405113;7.858276;, - 0.063876;53.091850;6.132280;, - -7.581183;51.749233;0.002558;, - -7.581183;51.749233;0.002558;, - 0.063876;42.720932;10.305261;, - 0.063876;37.106018;10.305261;, - 0.063876;47.533646;9.378681;, - -7.964980;46.706837;7.085848;, - -6.180955;51.898582;5.810977;, - 26.442608;31.439417;2.804749;, - 28.644909;31.793991;1.543602;, - 27.650051;30.546118;1.966592;, - 29.418135;32.175655;7.563584;, - 25.291662;35.616783;6.993527;, - 28.113920;30.947910;7.563584;, - 23.804535;33.790108;6.865523;, - 23.995649;32.729515;1.987316;, - 24.161800;33.391464;3.241510;, - 25.464495;35.399422;1.973382;, - 30.310335;29.777977;7.264207;, - 28.988699;28.980301;7.299366;, - 29.648125;29.915192;1.703345;, - 28.309542;29.520292;2.073250;, - 30.184065;26.943773;6.619426;, - 29.278811;26.812195;6.619426;, - 29.121349;26.822264;2.423525;, - 29.903082;27.052881;2.157598;, - 6.755167;0.046006;8.013719;, - 12.250779;0.088037;3.300384;, - 12.009439;0.731735;2.923214;, - 5.309235;0.894232;2.923214;, - 5.431096;0.088037;3.223917;, - 7.194882;0.034675;-8.202744;, - 4.846424;0.413626;-6.580339;, - 10.442262;0.175008;-8.276375;, - 5.897818;0.168155;0.023152;, - 11.833355;0.047754;-6.787080;, - 12.240962;0.175049;0.374328;, - 10.442509;1.014684;-8.275504;, - 4.846746;1.253311;-6.580090;, - 7.195130;0.874356;-8.201875;, - 5.468536;3.167656;-5.998088;, - 4.846746;1.253311;-6.580090;, - 11.428559;3.021991;-6.440265;, - 12.241827;1.014688;0.365411;, - 11.833675;0.887438;-6.786831;, - 11.932255;2.791543;-3.152129;, - 11.133778;5.817454;1.389889;, - 12.010524;1.354014;3.522007;, - 5.898684;1.007790;0.014234;, - 5.310324;1.516512;3.522007;, - 6.753324;1.573865;7.859301;, - 5.601276;5.822373;6.464175;, - 10.323023;1.855839;8.088705;, - 5.238337;3.089141;-2.541014;, - 5.863575;5.809277;1.057280;, - 2.395580;19.017778;1.623937;, - 2.663392;17.355799;1.982380;, - 0.781750;21.713270;1.998527;, - 0.063876;23.353767;1.793407;, - 8.567321;37.947166;6.627038;, - 3.727235;37.106018;10.305261;, - 10.590998;38.832512;-0.519268;, - 8.567321;40.015377;-5.275937;, - 3.269272;40.303337;-8.724752;, - 0.063876;40.303337;-8.724752;, - 10.880808;31.578617;-0.480340;, - 8.336151;33.208889;6.506425;, - 8.391865;30.899374;-5.411129;, - 3.229546;29.783400;-8.733105;, - 0.063876;29.783400;-8.733105;, - 0.063876;37.106018;10.305261;, - 3.972105;33.252815;10.523578;, - 0.063876;33.252815;10.523581;, - 3.977465;17.241997;5.800620;, - 2.663392;17.355799;1.982380;, - 6.110166;17.147745;7.382187;, - 9.390180;17.139515;5.800619;, - 6.110166;17.147745;7.382187;, - 7.391886;13.045812;9.537921;, - 12.022444;17.723486;1.982380;, - 9.045196;17.139517;-1.835862;, - 6.618869;17.147745;-3.417428;, - 3.743971;17.241997;-1.835860;, - 3.743971;17.241997;-1.835860;, - 3.292731;13.091016;-3.337706;, - 7.335181;13.898731;7.254448;, - 4.956770;13.926673;-1.904490;, - 4.909685;14.315273;6.833395;, - 3.449045;14.019177;2.395389;, - 7.335181;13.898731;7.254448;, - 4.909685;14.315273;6.833395;, - 4.622008;12.070519;7.351222;, - 8.640161;14.192272;6.638759;, - 12.054080;14.385403;1.847208;, - 8.640161;14.192272;6.638759;, - 9.864344;12.084161;6.936748;, - 10.983072;13.852963;-1.636501;, - 7.731716;13.866605;-2.741714;, - 10.983072;13.852963;-1.636501;, - 11.551223;11.698577;-0.567342;, - 4.956770;13.926673;-1.904490;, - 4.956770;13.926673;-1.904490;, - 5.002745;10.862820;-0.929778;, - 5.601276;5.822373;6.464175;, - 7.258355;5.792872;6.393783;, - 10.561975;5.836313;6.220846;, - 11.898876;5.830766;3.514578;, - 11.133778;5.817454;1.389889;, - 8.602904;5.932668;-0.505548;, - 4.953313;5.817947;3.744911;, - 8.078106;3.698104;-7.581497;, - 5.468536;3.167656;-5.998088;, - 10.323023;1.855839;8.088705;, - 10.561975;5.836313;6.220846;, - 11.428559;3.021991;-6.440265;, - 10.324868;0.327974;8.243123;, - 11.833675;0.887438;-6.786831;, - 6.753324;1.573865;7.859301;, - 5.601276;5.822373;6.464175;, - 10.561975;5.836313;6.220846;, - 11.133778;5.817454;1.389889;, - 10.371579;42.720932;0.675551;, - 9.278677;42.422218;6.029630;, - 10.371579;42.720932;0.675551;, - 13.795866;40.778912;1.743529;, - 15.315888;39.758205;1.898780;, - 16.609575;42.436638;6.842184;, - 14.607471;39.414421;5.619863;, - 15.315888;39.758205;1.898780;, - 16.952673;42.175163;0.809246;, - 14.914027;35.968437;6.910757;, - 14.607471;39.414421;5.619863;, - 18.329708;44.705509;5.492955;, - 18.144800;40.845119;8.897065;, - 18.903246;44.983837;2.480351;, - 15.450755;36.687752;6.384915;, - 18.167065;40.766296;8.049853;, - 18.160057;35.498848;6.365007;, - 21.932474;34.767567;5.880031;, - 25.291662;35.616783;6.993527;, - 23.804535;33.790108;6.865523;, - 23.970884;33.278522;4.380921;, - 23.804535;33.790108;6.865523;, - 26.276403;37.035873;5.267626;, - 26.921537;36.568802;3.461252;, - -25.163914;35.616783;6.993527;, - -29.290388;32.175655;7.563584;, - -23.676790;33.790108;6.865523;, - -27.986174;30.947910;7.563584;, - -25.336742;35.399422;1.973382;, - -24.034052;33.391464;3.241510;, - -23.867901;32.729515;1.987316;, - -30.182587;29.777977;7.264207;, - -28.860950;28.980301;7.299366;, - -30.056318;26.943773;6.619426;, - -29.151058;26.812195;6.619426;, - -6.627419;0.046006;8.013719;, - -12.123036;0.088037;3.300384;, - -11.881689;0.731735;2.923214;, - -5.303345;0.088037;3.223917;, - -5.181487;0.894232;2.923214;, - -7.067134;0.034675;-8.202744;, - -4.718675;0.413626;-6.580339;, - -10.314516;0.175008;-8.276375;, - -5.770067;0.168155;0.023152;, - -11.705606;0.047754;-6.787080;, - -12.113213;0.175049;0.374328;, - -10.314760;1.014684;-8.275504;, - -7.067381;0.874356;-8.201875;, - -4.718995;1.253311;-6.580090;, - -4.718995;1.253311;-6.580090;, - -5.340785;3.167656;-5.998088;, - -12.114079;1.014688;0.365411;, - -11.300814;3.021991;-6.440265;, - -11.705929;0.887438;-6.786831;, - -11.804509;2.791543;-3.152129;, - -11.882777;1.354014;3.522007;, - -11.006028;5.817454;1.389889;, - -5.770934;1.007790;0.014234;, - -5.182574;1.516512;3.522007;, - -5.473527;5.822373;6.464175;, - -6.625576;1.573865;7.859301;, - -10.195277;1.855839;8.088705;, - -5.735826;5.809277;1.057280;, - -5.110586;3.089141;-2.541014;, - -2.267831;19.017778;1.623937;, - -2.535641;17.355799;1.982380;, - -0.653999;21.713270;1.998527;, - -3.599484;37.106018;10.305261;, - -8.439575;37.947166;6.627038;, - -10.463250;38.832512;-0.519268;, - -8.439575;40.015377;-5.275937;, - -3.141523;40.303337;-8.724752;, - -8.208400;33.208889;6.506425;, - -10.753060;31.578617;-0.480340;, - -8.264114;30.899374;-5.411129;, - -3.101796;29.783400;-8.733105;, - -3.844355;33.252815;10.523578;, - -2.535641;17.355799;1.982380;, - -3.849715;17.241997;5.800620;, - -5.982419;17.147745;7.382187;, - -5.982419;17.147745;7.382187;, - -9.262430;17.139515;5.800619;, - -7.264134;13.045812;9.537921;, - -11.894694;17.723486;1.982380;, - -8.917446;17.139517;-1.835862;, - -6.491119;17.147745;-3.417428;, - -3.616219;17.241997;-1.835860;, - -3.616219;17.241997;-1.835860;, - -3.164983;13.091016;-3.337706;, - -7.207436;13.898731;7.254448;, - -4.829021;13.926673;-1.904490;, - -3.321296;14.019177;2.395389;, - -4.781938;14.315273;6.833395;, - -4.781938;14.315273;6.833395;, - -7.207436;13.898731;7.254448;, - -4.494260;12.070519;7.351222;, - -8.512415;14.192272;6.638759;, - -8.512415;14.192272;6.638759;, - -11.926332;14.385403;1.847208;, - -9.736598;12.084161;6.936748;, - -10.855326;13.852963;-1.636501;, - -10.855326;13.852963;-1.636501;, - -7.603969;13.866605;-2.741714;, - -11.423474;11.698577;-0.567342;, - -4.829021;13.926673;-1.904490;, - -4.829021;13.926673;-1.904490;, - -4.874997;10.862820;-0.929778;, - -5.473527;5.822373;6.464175;, - -7.130609;5.792872;6.393783;, - -10.434228;5.836313;6.220846;, - -11.771126;5.830766;3.514578;, - -11.006028;5.817454;1.389889;, - -8.475157;5.932668;-0.505548;, - -4.825563;5.817947;3.744911;, - -5.340785;3.167656;-5.998088;, - -7.950356;3.698104;-7.581497;, - -10.434228;5.836313;6.220846;, - -10.195277;1.855839;8.088705;, - -11.300814;3.021991;-6.440265;, - -10.197120;0.327974;8.243123;, - -11.705929;0.887438;-6.786831;, - -6.625576;1.573865;7.859301;, - -5.473527;5.822373;6.464175;, - -10.434228;5.836313;6.220846;, - -11.006028;5.817454;1.389889;, - -10.243833;42.720932;0.675551;, - -9.150930;42.422218;6.029630;, - -10.243833;42.720932;0.675551;, - -13.668120;40.778912;1.743529;, - -15.188142;39.758205;1.898780;, - -14.479725;39.414421;5.619863;, - -16.481831;42.436638;6.842184;, - -16.824930;42.175163;0.809246;, - -15.188142;39.758205;1.898780;, - -14.479725;39.414421;5.619863;, - -14.786280;35.968437;6.910757;, - -18.201963;44.705509;5.492955;, - -18.017056;40.845119;8.897065;, - -18.775501;44.983837;2.480351;, - -15.323012;36.687752;6.384915;, - -18.039320;40.766296;8.049853;, - -18.032312;35.498848;6.365007;, - -21.804729;34.767567;5.880031;, - -25.163914;35.616783;6.993527;, - -23.676790;33.790108;6.865523;, - -23.676790;33.790108;6.865523;, - -23.843136;33.278522;4.380921;, - -26.148655;37.035873;5.267626;, - -26.793785;36.568802;3.461252;, - 32.763477;22.312052;-18.906120;, - 31.347282;21.510612;-18.896196;, - 32.573399;20.998508;-13.993474;, - 31.588987;24.117847;-40.696075;, - 30.727213;23.864517;-46.026169;, - 30.172787;23.316404;-40.686150;, - 28.004946;30.522528;-34.917355;, - 26.588755;29.721081;-34.907444;, - 26.799459;29.484686;-23.919806;, - 28.215664;30.286123;-23.929716;, - 29.730568;27.460878;-35.918262;, - 28.314373;26.659443;-35.908363;, - 28.665804;26.196402;-23.140169;, - 30.082003;26.997847;-23.150089;, - 31.100611;25.020727;-37.470440;, - 29.684425;24.219271;-37.460514;, - 30.314682;23.305275;-21.319128;, - 31.730875;24.106718;-21.329044;, - 28.264534;31.576502;16.538700;, - 28.887688;30.497171;16.516956;, - 28.565001;29.293274;16.501442;, - 27.485502;28.670019;16.501251;, - 26.281548;28.992525;16.516499;, - 25.658390;30.071863;16.538246;, - 25.981071;31.275770;16.553751;, - 25.961720;31.309975;14.302090;, - 25.981071;31.275770;16.553751;, - 27.060581;31.899025;16.553940;, - 25.641800;31.875427;-22.917944;, - 25.828506;31.545427;-1.196465;, - 25.405474;31.866238;-0.749988;, - 25.531157;31.644094;13.872904;, - 28.430216;31.305752;-36.706051;, - 27.807066;32.385075;-36.684288;, - 28.107540;30.101837;-36.721565;, - 27.028032;29.478594;-36.721748;, - 25.824083;29.801088;-36.706490;, - 25.200922;30.880438;-36.684742;, - 25.523605;32.084339;-36.669224;, - 26.603115;32.707592;-36.669060;, - 25.523605;32.084339;-36.669224;, - 25.531799;32.069855;-35.715992;, - 24.961311;32.507545;-35.704453;, - 25.071318;32.313114;-22.906395;, - 29.151377;31.385166;-35.757492;, - 28.438414;31.291262;-35.752815;, - 27.815252;32.370605;-35.731056;, - 28.253050;32.941086;-35.726151;, - 28.363062;32.746647;-22.928093;, - 27.925262;32.176163;-22.932991;, - 28.548414;31.096832;-22.954752;, - 29.261381;31.190737;-22.959444;, - 28.686214;29.649672;-35.779873;, - 28.115726;30.087366;-35.768326;, - 28.225733;29.892931;-22.970266;, - 28.796217;29.455244;-22.981829;, - 27.130047;28.751215;-35.780151;, - 27.036226;29.464113;-35.768520;, - 27.146231;29.269676;-22.970453;, - 27.240047;28.556789;-22.982094;, - 25.394470;29.216141;-35.758179;, - 25.832272;29.786617;-35.753273;, - 25.942278;29.592182;-22.955206;, - 25.504477;29.021709;-22.960121;, - 24.496161;30.772045;-35.726803;, - 25.209120;30.865946;-35.731510;, - 25.319118;30.671524;-22.933453;, - 24.606161;30.577616;-22.928751;, - 24.961311;32.507545;-35.704453;, - 25.531799;32.069855;-35.715992;, - 25.641800;31.875427;-22.917944;, - 25.071318;32.313114;-22.906395;, - 26.517492;33.405987;-35.704166;, - 26.611311;32.693104;-35.715794;, - 26.721312;32.498676;-22.917738;, - 26.627487;33.211575;-22.906115;, - 29.272268;30.830444;-0.798965;, - 28.735117;30.766836;-1.233276;, - 28.111961;31.846174;-1.211521;, - 28.443258;32.266331;-0.770020;, - 28.568949;32.044174;13.852868;, - 28.245173;31.610723;14.287043;, - 28.868330;30.531387;14.265285;, - 29.397957;30.608292;13.823928;, - 28.842997;29.228819;-0.819599;, - 28.412436;29.562933;-1.248788;, - 28.545649;29.327480;14.249776;, - 28.968679;29.006672;13.803288;, - 27.406893;28.399687;-0.819852;, - 27.332933;28.939684;-1.248984;, - 27.466146;28.704229;14.249575;, - 27.532579;28.177542;13.803031;, - 25.805210;28.828726;-0.799567;, - 26.128983;29.262184;-1.233739;, - 26.262192;29.026735;14.264828;, - 25.930891;28.606585;13.823323;, - 24.976185;30.264614;-0.770632;, - 25.505823;30.341524;-1.211982;, - 25.639032;30.106077;14.286580;, - 25.101870;30.042463;13.852263;, - 25.405474;31.866238;-0.749988;, - 25.828506;31.545427;-1.196465;, - 25.961720;31.309975;14.302090;, - 25.531157;31.644094;13.872904;, - 26.841581;32.695370;-0.749732;, - 26.908014;32.168686;-1.196282;, - 27.041225;31.933235;14.302281;, - 26.967262;32.473228;13.873165;; - 1896; - 3;0,1,2;, - 3;3,0,2;, - 3;4,0,3;, - 3;5,4,3;, - 3;6,4,5;, - 3;7,6,5;, - 3;8,9,10;, - 3;11,8,10;, - 3;12,8,11;, - 3;13,12,11;, - 3;14,12,13;, - 3;15,14,13;, - 3;9,1,16;, - 3;10,9,16;, - 3;17,3,2;, - 3;18,17,2;, - 3;10,16,19;, - 3;11,10,19;, - 3;20,5,3;, - 3;17,20,3;, - 3;11,19,21;, - 3;13,11,21;, - 3;22,7,5;, - 3;20,22,5;, - 3;14,6,7;, - 3;22,14,7;, - 3;13,21,23;, - 3;15,13,23;, - 3;19,16,1;, - 3;0,19,1;, - 3;21,19,0;, - 3;4,21,0;, - 3;23,21,4;, - 3;6,23,4;, - 3;17,18,9;, - 3;8,17,9;, - 3;20,17,8;, - 3;12,20,8;, - 3;22,20,12;, - 3;14,22,12;, - 3;18,2,1;, - 3;9,18,1;, - 3;15,23,6;, - 3;14,15,6;, - 3;24,25,26;, - 3;24,26,27;, - 3;27,26,28;, - 3;27,28,29;, - 3;29,28,30;, - 3;29,30,31;, - 3;32,33,34;, - 3;32,34,35;, - 3;35,34,36;, - 3;35,36,37;, - 3;37,36,38;, - 3;37,38,39;, - 3;40,25,33;, - 3;40,33,32;, - 3;24,27,41;, - 3;24,41,42;, - 3;43,40,32;, - 3;43,32,35;, - 3;27,29,44;, - 3;27,44,41;, - 3;45,43,35;, - 3;45,35,37;, - 3;29,31,46;, - 3;29,46,44;, - 3;31,30,38;, - 3;31,38,46;, - 3;47,45,37;, - 3;47,37,39;, - 3;25,40,43;, - 3;25,43,26;, - 3;26,43,45;, - 3;26,45,28;, - 3;28,45,47;, - 3;28,47,30;, - 3;33,42,41;, - 3;33,41,34;, - 3;34,41,44;, - 3;34,44,36;, - 3;36,44,46;, - 3;36,46,38;, - 3;25,24,42;, - 3;25,42,33;, - 3;30,47,39;, - 3;30,39,38;, - 3;48,49,50;, - 3;51,48,50;, - 3;52,53,54;, - 3;55,52,54;, - 3;56,57,58;, - 3;59,57,56;, - 3;57,60,61;, - 3;62,60,57;, - 3;59,62,57;, - 3;63,64,65;, - 3;65,60,62;, - 3;64,60,65;, - 3;66,63,65;, - 3;67,66,65;, - 3;61,68,58;, - 3;67,65,62;, - 3;69,67,62;, - 3;70,66,67;, - 3;71,70,67;, - 3;67,69,72;, - 3;71,67,72;, - 3;73,74,75;, - 3;76,73,75;, - 3;62,77,69;, - 3;78,79,68;, - 3;61,78,68;, - 3;80,78,61;, - 3;60,80,61;, - 3;64,81,80;, - 3;71,72,82;, - 3;70,71,82;, - 3;83,84,82;, - 3;72,83,82;, - 3;72,69,73;, - 3;76,72,73;, - 3;69,77,74;, - 3;73,69,74;, - 3;85,86,87;, - 3;88,85,87;, - 3;86,83,75;, - 3;87,86,75;, - 3;59,56,89;, - 3;85,59,89;, - 3;85,89,90;, - 3;86,85,90;, - 3;89,56,58;, - 3;91,89,58;, - 3;90,89,91;, - 3;92,90,91;, - 3;74,88,87;, - 3;75,74,87;, - 3;59,85,77;, - 3;62,59,77;, - 3;84,83,86;, - 3;77,85,88;, - 3;74,77,88;, - 3;83,72,76;, - 3;75,83,76;, - 3;91,58,68;, - 3;93,91,68;, - 3;92,91,93;, - 3;94,92,93;, - 3;979,95,96;, - 3;980,979,96;, - 3;980,96,97;, - 3;981,980,97;, - 3;981,97,982;, - 3;61,58,57;, - 3;98,99,100;, - 3;101,98,100;, - 3;102,98,101;, - 3;103,102,101;, - 3;104,105,106;, - 3;107,104,106;, - 3;105,108,109;, - 3;106,105,109;, - 3;108,110,109;, - 3;100,99,111;, - 3;109,110,112;, - 3;113,109,112;, - 3;104,82,84;, - 3;105,104,84;, - 3;106,98,102;, - 3;107,106,102;, - 3;105,84,86;, - 3;108,105,86;, - 3;109,99,98;, - 3;106,109,98;, - 3;108,86,90;, - 3;110,108,90;, - 3;110,90,92;, - 3;112,110,92;, - 3;113,111,99;, - 3;109,113,99;, - 3;114,112,92;, - 3;115,114,92;, - 3;116,113,112;, - 3;114,116,112;, - 3;117,111,113;, - 3;116,117,113;, - 3;92,94,115;, - 3;111,117,118;, - 3;119,111,118;, - 3;100,111,119;, - 3;101,100,119;, - 3;103,101,119;, - 3;120,103,119;, - 3;117,116,121;, - 3;118,117,121;, - 3;122,120,119;, - 3;123,122,119;, - 3;124,122,123;, - 3;125,124,123;, - 3;119,118,123;, - 3;126,123,118;, - 3;121,126,118;, - 3;125,123,126;, - 3;114,115,127;, - 3;116,114,127;, - 3;121,116,127;, - 3;128,121,127;, - 3;126,121,128;, - 3;129,126,128;, - 3;125,126,129;, - 3;130,125,129;, - 3;131,128,132;, - 3;133,131,132;, - 3;134,129,128;, - 3;131,134,128;, - 3;135,130,129;, - 3;134,135,129;, - 3;133,132,130;, - 3;135,133,130;, - 3;127,132,128;, - 3;127,115,94;, - 3;136,983,982;, - 3;95,55,54;, - 3;96,95,54;, - 3;96,54,137;, - 3;97,96,137;, - 3;97,137,136;, - 3;982,97,136;, - 3;138,131,133;, - 3;139,138,133;, - 3;140,134,131;, - 3;138,140,131;, - 3;141,135,134;, - 3;140,141,134;, - 3;139,133,135;, - 3;141,139,135;, - 3;142,984,985;, - 3;143,142,985;, - 3;144,140,138;, - 3;986,144,138;, - 3;145,987,988;, - 3;989,145,988;, - 3;990,139,141;, - 3;991,990,141;, - 3;146,142,143;, - 3;147,146,143;, - 3;148,144,986;, - 3;992,148,986;, - 3;149,145,989;, - 3;993,149,989;, - 3;994,990,991;, - 3;995,994,991;, - 3;150,146,147;, - 3;996,148,992;, - 3;997,149,993;, - 3;996,994,995;, - 3;50,49,151;, - 3;152,50,151;, - 3;153,154,137;, - 3;54,153,137;, - 3;998,999,48;, - 3;51,998,48;, - 3;51,50,155;, - 3;156,51,155;, - 3;156,1000,51;, - 3;136,137,157;, - 3;158,136,157;, - 3;983,136,158;, - 3;50,152,155;, - 3;156,155,159;, - 3;160,156,159;, - 3;157,156,160;, - 3;161,157,160;, - 3;158,157,161;, - 3;162,158,161;, - 3;983,158,162;, - 3;163,983,162;, - 3;132,127,1001;, - 3;999,1002,48;, - 3;1000,998,51;, - 3;53,153,54;, - 3;157,137,154;, - 3;156,157,1000;, - 3;164,1003,1004;, - 3;165,164,1004;, - 3;165,1004,1005;, - 3;166,165,1005;, - 3;166,1005,1006;, - 3;167,166,1006;, - 3;167,1006,1007;, - 3;168,167,1007;, - 3;168,1007,1008;, - 3;169,168,1008;, - 3;169,1008,1009;, - 3;170,169,1009;, - 3;170,1009,1010;, - 3;171,170,1010;, - 3;171,1010,1011;, - 3;172,171,1011;, - 3;172,1011,1012;, - 3;173,172,1012;, - 3;174,164,165;, - 3;175,174,165;, - 3;175,165,166;, - 3;176,175,166;, - 3;176,166,167;, - 3;177,176,167;, - 3;177,167,168;, - 3;178,177,168;, - 3;178,168,169;, - 3;179,178,169;, - 3;179,169,170;, - 3;180,179,170;, - 3;180,170,171;, - 3;181,180,171;, - 3;181,171,172;, - 3;182,181,172;, - 3;182,172,173;, - 3;183,182,173;, - 3;184,174,175;, - 3;185,184,175;, - 3;185,175,176;, - 3;186,185,176;, - 3;186,176,177;, - 3;187,186,177;, - 3;187,177,178;, - 3;188,187,178;, - 3;188,178,179;, - 3;189,188,179;, - 3;189,179,180;, - 3;190,189,180;, - 3;190,180,181;, - 3;191,190,181;, - 3;191,181,182;, - 3;192,191,182;, - 3;192,182,183;, - 3;193,192,183;, - 3;194,1013,1014;, - 3;195,194,1014;, - 3;195,1014,1015;, - 3;196,195,1015;, - 3;196,1015,1016;, - 3;197,196,1016;, - 3;197,1016,1017;, - 3;198,197,1017;, - 3;198,1017,1018;, - 3;199,198,1018;, - 3;199,1018,1019;, - 3;200,199,1019;, - 3;200,1019,1020;, - 3;201,200,1020;, - 3;201,1020,1021;, - 3;202,201,1021;, - 3;202,1021,1022;, - 3;203,202,1022;, - 3;204,194,195;, - 3;204,195,196;, - 3;204,196,197;, - 3;204,197,198;, - 3;204,198,199;, - 3;204,199,200;, - 3;204,200,201;, - 3;204,201,202;, - 3;204,202,203;, - 3;80,60,64;, - 3;205,206,207;, - 3;208,205,207;, - 3;209,210,211;, - 3;212,209,211;, - 3;213,214,215;, - 3;215,214,216;, - 3;217,218,214;, - 3;218,219,216;, - 3;214,218,216;, - 3;220,64,63;, - 3;219,218,220;, - 3;220,218,64;, - 3;63,66,221;, - 3;220,63,221;, - 3;213,222,217;, - 3;220,221,223;, - 3;219,220,223;, - 3;66,70,224;, - 3;221,66,224;, - 3;223,221,224;, - 3;225,223,224;, - 3;226,227,228;, - 3;229,226,228;, - 3;223,230,219;, - 3;231,232,217;, - 3;222,231,217;, - 3;232,233,218;, - 3;217,232,218;, - 3;233,81,64;, - 3;82,225,224;, - 3;82,224,70;, - 3;234,235,225;, - 3;82,234,225;, - 3;223,225,228;, - 3;227,223,228;, - 3;230,223,227;, - 3;226,230,227;, - 3;236,237,238;, - 3;239,236,238;, - 3;235,236,239;, - 3;229,235,239;, - 3;215,216,237;, - 3;240,215,237;, - 3;240,237,236;, - 3;241,240,236;, - 3;215,240,242;, - 3;213,215,242;, - 3;240,241,243;, - 3;242,240,243;, - 3;238,226,229;, - 3;239,238,229;, - 3;230,237,216;, - 3;230,216,219;, - 3;236,235,234;, - 3;237,230,226;, - 3;238,237,226;, - 3;225,235,229;, - 3;228,225,229;, - 3;213,242,244;, - 3;222,213,244;, - 3;242,243,245;, - 3;244,242,245;, - 3;246,231,222;, - 3;247,246,222;, - 3;247,222,244;, - 3;248,247,244;, - 3;245,248,244;, - 3;214,213,217;, - 3;249,250,251;, - 3;252,249,251;, - 3;250,102,103;, - 3;251,250,103;, - 3;253,104,107;, - 3;254,253,107;, - 3;255,253,254;, - 3;256,255,254;, - 3;256,257,255;, - 3;258,249,252;, - 3;257,256,259;, - 3;260,257,259;, - 3;82,104,253;, - 3;234,82,253;, - 3;250,254,107;, - 3;102,250,107;, - 3;234,253,255;, - 3;236,234,255;, - 3;249,256,254;, - 3;250,249,254;, - 3;236,255,257;, - 3;241,236,257;, - 3;241,257,260;, - 3;243,241,260;, - 3;258,259,256;, - 3;249,258,256;, - 3;260,261,262;, - 3;243,260,262;, - 3;259,263,261;, - 3;260,259,261;, - 3;258,264,263;, - 3;259,258,263;, - 3;262,245,243;, - 3;264,258,265;, - 3;266,264,265;, - 3;265,258,252;, - 3;265,252,251;, - 3;251,103,120;, - 3;265,251,120;, - 3;267,263,264;, - 3;267,264,266;, - 3;120,122,268;, - 3;265,120,268;, - 3;122,124,269;, - 3;268,122,269;, - 3;268,266,265;, - 3;268,270,267;, - 3;266,268,267;, - 3;270,268,269;, - 3;271,262,261;, - 3;261,263,267;, - 3;271,261,267;, - 3;271,267,272;, - 3;267,270,273;, - 3;272,267,273;, - 3;270,269,274;, - 3;273,270,274;, - 3;272,275,276;, - 3;277,272,276;, - 3;273,278,275;, - 3;272,273,275;, - 3;274,279,278;, - 3;273,274,278;, - 3;277,276,279;, - 3;274,277,279;, - 3;272,277,271;, - 3;1023,280,245;, - 3;245,262,271;, - 3;211,246,247;, - 3;212,211,247;, - 3;212,247,248;, - 3;281,212,248;, - 3;281,248,245;, - 3;280,281,245;, - 3;275,282,283;, - 3;276,275,283;, - 3;278,284,282;, - 3;275,278,282;, - 3;279,285,284;, - 3;278,279,284;, - 3;276,283,285;, - 3;279,276,285;, - 3;1024,286,287;, - 3;1025,1024,287;, - 3;284,288,1026;, - 3;282,284,1026;, - 3;1027,289,1028;, - 3;1029,1027,1028;, - 3;283,1030,1031;, - 3;285,283,1031;, - 3;286,290,291;, - 3;287,286,291;, - 3;288,292,1032;, - 3;1026,288,1032;, - 3;289,293,1033;, - 3;1028,289,1033;, - 3;1030,1034,1035;, - 3;1031,1030,1035;, - 3;291,290,294;, - 3;1032,292,1036;, - 3;1033,293,1037;, - 3;1035,1034,1036;, - 3;205,208,152;, - 3;151,205,152;, - 3;295,296,212;, - 3;281,295,212;, - 3;1038,1039,207;, - 3;206,1038,207;, - 3;208,207,297;, - 3;155,208,297;, - 3;207,1040,297;, - 3;281,280,298;, - 3;299,281,298;, - 3;298,280,1023;, - 3;155,152,208;, - 3;155,297,300;, - 3;159,155,300;, - 3;297,299,301;, - 3;300,297,301;, - 3;299,298,302;, - 3;301,299,302;, - 3;302,298,1023;, - 3;302,1023,303;, - 3;1041,271,277;, - 3;206,1042,1038;, - 3;207,1039,1040;, - 3;212,296,209;, - 3;295,281,299;, - 3;1040,299,297;, - 3;1043,1044,304;, - 3;1045,1043,304;, - 3;1045,304,305;, - 3;1046,1045,305;, - 3;1046,305,306;, - 3;1047,1046,306;, - 3;1047,306,307;, - 3;1048,1047,307;, - 3;1048,307,308;, - 3;1049,1048,308;, - 3;1049,308,309;, - 3;1050,1049,309;, - 3;1050,309,310;, - 3;1051,1050,310;, - 3;1051,310,311;, - 3;1052,1051,311;, - 3;1052,311,173;, - 3;1012,1052,173;, - 3;1044,1053,312;, - 3;304,1044,312;, - 3;304,312,313;, - 3;305,304,313;, - 3;305,313,314;, - 3;306,305,314;, - 3;306,314,315;, - 3;307,306,315;, - 3;307,315,316;, - 3;308,307,316;, - 3;308,316,317;, - 3;309,308,317;, - 3;309,317,318;, - 3;310,309,318;, - 3;310,318,319;, - 3;311,310,319;, - 3;311,319,183;, - 3;173,311,183;, - 3;1053,1054,320;, - 3;312,1053,320;, - 3;312,320,321;, - 3;313,312,321;, - 3;313,321,322;, - 3;314,313,322;, - 3;314,322,323;, - 3;315,314,323;, - 3;315,323,324;, - 3;316,315,324;, - 3;316,324,325;, - 3;317,316,325;, - 3;317,325,326;, - 3;318,317,326;, - 3;318,326,327;, - 3;319,318,327;, - 3;319,327,193;, - 3;183,319,193;, - 3;1013,194,328;, - 3;1055,1013,328;, - 3;1055,328,329;, - 3;1056,1055,329;, - 3;1056,329,330;, - 3;1057,1056,330;, - 3;1057,330,331;, - 3;1058,1057,331;, - 3;1058,331,332;, - 3;1059,1058,332;, - 3;1059,332,333;, - 3;1060,1059,333;, - 3;1060,333,334;, - 3;1061,1060,334;, - 3;1061,334,335;, - 3;1062,1061,335;, - 3;1062,335,203;, - 3;1022,1062,203;, - 3;328,194,204;, - 3;329,328,204;, - 3;330,329,204;, - 3;331,330,204;, - 3;332,331,204;, - 3;333,332,204;, - 3;334,333,204;, - 3;335,334,204;, - 3;203,335,204;, - 3;64,218,233;, - 3;336,337,338;, - 3;339,336,338;, - 3;336,340,337;, - 3;341,1063,1064;, - 3;342,341,1064;, - 3;341,1065,1063;, - 3;343,1066,1067;, - 3;344,343,1067;, - 3;343,340,1066;, - 3;345,343,344;, - 3;346,345,344;, - 3;345,340,343;, - 3;347,1068,1069;, - 3;348,1070,346;, - 3;347,1071,1068;, - 3;337,1070,348;, - 3;338,337,348;, - 3;337,340,1070;, - 3;349,350,351;, - 3;352,349,351;, - 3;353,349,352;, - 3;354,353,352;, - 3;355,353,354;, - 3;356,355,354;, - 3;357,355,356;, - 3;358,357,356;, - 3;359,357,358;, - 3;360,359,358;, - 3;1072,359,360;, - 3;1073,1072,360;, - 3;361,350,349;, - 3;362,361,349;, - 3;362,349,353;, - 3;363,362,353;, - 3;363,353,355;, - 3;364,363,355;, - 3;364,355,357;, - 3;365,364,357;, - 3;365,357,359;, - 3;366,365,359;, - 3;366,359,1072;, - 3;1074,366,1072;, - 3;367,361,362;, - 3;368,367,362;, - 3;368,362,363;, - 3;369,368,363;, - 3;369,363,364;, - 3;370,369,364;, - 3;370,364,365;, - 3;371,370,365;, - 3;371,365,366;, - 3;372,371,366;, - 3;372,366,1074;, - 3;1075,372,1074;, - 3;373,367,368;, - 3;373,368,369;, - 3;373,369,370;, - 3;373,370,371;, - 3;373,371,372;, - 3;373,372,1075;, - 3;374,375,376;, - 3;374,376,377;, - 3;377,376,378;, - 3;377,378,379;, - 3;379,378,380;, - 3;379,380,381;, - 3;381,380,382;, - 3;381,382,383;, - 3;383,382,384;, - 3;383,384,385;, - 3;385,384,1076;, - 3;385,1076,1077;, - 3;376,375,386;, - 3;376,386,387;, - 3;378,376,387;, - 3;378,387,388;, - 3;380,378,388;, - 3;380,388,389;, - 3;382,380,389;, - 3;382,389,390;, - 3;384,382,390;, - 3;384,390,391;, - 3;1076,384,391;, - 3;1076,391,1078;, - 3;387,386,392;, - 3;387,392,393;, - 3;388,387,393;, - 3;388,393,394;, - 3;389,388,394;, - 3;389,394,395;, - 3;390,389,395;, - 3;390,395,396;, - 3;391,390,396;, - 3;391,396,397;, - 3;1078,391,397;, - 3;1078,397,1079;, - 3;393,392,398;, - 3;394,393,398;, - 3;395,394,398;, - 3;396,395,398;, - 3;397,396,398;, - 3;1079,397,398;, - 3;399,400,401;, - 3;402,399,401;, - 3;403,404,405;, - 3;406,1080,1081;, - 3;407,406,1081;, - 3;408,404,403;, - 3;409,1082,1083;, - 3;410,409,1083;, - 3;411,1084,1085;, - 3;412,409,410;, - 3;413,412,410;, - 3;414,1084,411;, - 3;415,416,412;, - 3;413,415,412;, - 3;417,418,400;, - 3;399,417,400;, - 3;419,420,1082;, - 3;409,419,1082;, - 3;421,419,409;, - 3;412,421,409;, - 3;416,422,421;, - 3;412,416,421;, - 3;423,424,418;, - 3;417,423,418;, - 3;425,426,1086;, - 3;419,1087,420;, - 3;427,1087,419;, - 3;421,427,419;, - 3;428,429,424;, - 3;405,428,424;, - 3;405,424,423;, - 3;403,405,423;, - 3;403,423,1088;, - 3;408,403,1088;, - 3;1085,1089,1087;, - 3;411,1085,1087;, - 3;411,1087,427;, - 3;414,411,427;, - 3;401,400,430;, - 3;431,401,430;, - 3;404,428,405;, - 3;432,1084,414;, - 3;400,418,433;, - 3;430,400,433;, - 3;418,424,429;, - 3;433,418,429;, - 3;434,432,414;, - 3;427,434,414;, - 3;422,434,427;, - 3;421,422,427;, - 3;435,1090,1091;, - 3;436,426,1090;, - 3;435,436,1090;, - 3;437,438,439;, - 3;437,439,440;, - 3;441,1092,442;, - 3;1093,1094,443;, - 3;1093,443,444;, - 3;442,1092,445;, - 3;1095,1096,446;, - 3;1095,446,447;, - 3;1097,1084,448;, - 3;447,446,449;, - 3;447,449,450;, - 3;448,1084,451;, - 3;449,416,415;, - 3;449,415,450;, - 3;438,452,453;, - 3;438,453,439;, - 3;1096,454,455;, - 3;1096,455,446;, - 3;446,455,456;, - 3;446,456,449;, - 3;456,422,416;, - 3;456,416,449;, - 3;452,457,458;, - 3;452,458,453;, - 3;1098,459,460;, - 3;454,1099,455;, - 3;455,1099,461;, - 3;455,461,456;, - 3;457,1100,1101;, - 3;457,1101,441;, - 3;458,457,441;, - 3;458,441,442;, - 3;1102,458,442;, - 3;1102,442,445;, - 3;1099,1103,1097;, - 3;1099,1097,448;, - 3;461,1099,448;, - 3;461,448,451;, - 3;1104,438,437;, - 3;1104,437,1105;, - 3;441,1101,1092;, - 3;451,1084,432;, - 3;1106,452,438;, - 3;1106,438,1104;, - 3;1100,457,452;, - 3;1100,452,1106;, - 3;451,432,434;, - 3;451,434,461;, - 3;461,434,422;, - 3;461,422,456;, - 3;1107,1108,462;, - 3;1108,459,463;, - 3;1108,463,462;, - 3;463,459,1098;, - 3;464,465,466;, - 3;467,1109,1110;, - 3;468,464,1111;, - 3;469,470,471;, - 3;472,469,471;, - 3;1112,473,1113;, - 3;474,475,476;, - 3;477,474,476;, - 3;1114,1115,478;, - 3;468,1114,478;, - 3;479,465,480;, - 3;481,482,475;, - 3;474,481,475;, - 3;483,484,485;, - 3;486,483,485;, - 3;478,487,464;, - 3;468,478,464;, - 3;488,466,465;, - 3;479,488,465;, - 3;484,489,485;, - 3;1116,1117,1118;, - 3;487,490,464;, - 3;490,489,465;, - 3;464,490,465;, - 3;480,465,489;, - 3;484,480,489;, - 3;483,486,490;, - 3;487,483,490;, - 3;491,492,493;, - 3;494,491,493;, - 3;495,496,485;, - 3;489,495,485;, - 3;496,497,486;, - 3;485,496,486;, - 3;486,497,490;, - 3;490,495,489;, - 3;493,492,496;, - 3;495,493,496;, - 3;492,491,497;, - 3;496,492,497;, - 3;491,494,490;, - 3;497,491,490;, - 3;494,493,495;, - 3;490,494,495;, - 3;498,488,1112;, - 3;499,498,1112;, - 3;500,1114,468;, - 3;501,500,468;, - 3;1119,472,471;, - 3;1120,1119,471;, - 3;502,466,488;, - 3;498,502,488;, - 3;503,467,1110;, - 3;1121,503,1110;, - 3;501,468,1111;, - 3;1122,501,1111;, - 3;475,498,499;, - 3;476,475,499;, - 3;477,500,501;, - 3;474,477,501;, - 3;1123,1119,1120;, - 3;1124,1123,1120;, - 3;482,502,498;, - 3;475,482,498;, - 3;1125,503,1121;, - 3;1126,1125,1121;, - 3;474,501,1122;, - 3;481,474,1122;, - 3;504,505,506;, - 3;507,508,506;, - 3;509,510,511;, - 3;512,509,513;, - 3;507,512,514;, - 3;1127,515,516;, - 3;517,518,515;, - 3;1128,519,518;, - 3;1128,1129,519;, - 3;1130,1131,516;, - 3;1132,520,521;, - 3;1133,522,520;, - 3;1134,521,523;, - 3;1135,524,522;, - 3;1136,523,525;, - 3;1130,516,524;, - 3;1137,525,519;, - 3;1138,526,527;, - 3;1139,528,1140;, - 3;529,1141,1142;, - 3;1143,530,1144;, - 3;1138,527,1145;, - 3;1146,531,532;, - 3;533,534,1146;, - 3;1147,535,1148;, - 3;530,1147,1144;, - 3;1149,536,529;, - 3;537,536,1149;, - 3;538,537,1150;, - 3;1151,539,1152;, - 3;535,540,1153;, - 3;1154,1155,531;, - 3;541,542,543;, - 3;544,541,543;, - 3;545,541,544;, - 3;546,545,544;, - 3;547,545,546;, - 3;548,547,546;, - 3;549,547,548;, - 3;550,549,548;, - 3;551,549,550;, - 3;552,551,550;, - 3;553,551,552;, - 3;554,553,552;, - 3;555,553,554;, - 3;556,555,554;, - 3;1156,555,556;, - 3;1157,1156,556;, - 3;557,558,542;, - 3;541,557,542;, - 3;559,557,541;, - 3;545,559,541;, - 3;560,559,545;, - 3;547,560,545;, - 3;561,560,547;, - 3;549,561,547;, - 3;562,561,549;, - 3;551,562,549;, - 3;563,562,551;, - 3;553,563,551;, - 3;564,563,553;, - 3;555,564,553;, - 3;1158,564,555;, - 3;1156,1158,555;, - 3;565,566,558;, - 3;557,565,558;, - 3;561,567,560;, - 3;568,569,561;, - 3;562,568,561;, - 3;570,568,562;, - 3;563,570,562;, - 3;571,570,563;, - 3;1159,571,564;, - 3;1158,1159,564;, - 3;572,573,574;, - 3;575,572,574;, - 3;436,435,573;, - 3;572,436,573;, - 3;576,1160,1161;, - 3;577,576,1161;, - 3;578,1162,1160;, - 3;576,578,1160;, - 3;579,1163,1162;, - 3;578,579,1162;, - 3;580,1164,1163;, - 3;579,580,1163;, - 3;581,1165,1164;, - 3;580,581,1164;, - 3;582,576,577;, - 3;583,582,577;, - 3;584,578,576;, - 3;582,584,576;, - 3;585,579,578;, - 3;584,585,578;, - 3;586,580,579;, - 3;585,586,579;, - 3;587,581,580;, - 3;586,587,580;, - 3;588,582,583;, - 3;589,588,583;, - 3;590,584,582;, - 3;588,590,582;, - 3;591,585,584;, - 3;590,591,584;, - 3;592,586,585;, - 3;591,592,585;, - 3;593,587,586;, - 3;592,593,586;, - 3;569,1166,1167;, - 3;594,569,1167;, - 3;568,1168,1166;, - 3;569,568,1166;, - 3;570,1169,1168;, - 3;568,570,1168;, - 3;595,1170,1169;, - 3;570,595,1169;, - 3;571,595,570;, - 3;577,1161,1171;, - 3;596,577,1171;, - 3;583,577,596;, - 3;597,583,596;, - 3;589,583,597;, - 3;598,589,597;, - 3;566,565,599;, - 3;599,565,600;, - 3;1172,1173,601;, - 3;602,1172,601;, - 3;1167,1172,602;, - 3;594,1167,602;, - 3;557,559,565;, - 3;602,601,603;, - 3;604,602,603;, - 3;569,594,567;, - 3;561,569,567;, - 3;594,602,604;, - 3;567,594,604;, - 3;560,567,604;, - 3;559,604,565;, - 3;604,603,600;, - 3;605,1174,1175;, - 3;606,605,1175;, - 3;607,1176,1174;, - 3;605,607,1174;, - 3;608,1177,1178;, - 3;1179,608,1178;, - 3;609,1180,1177;, - 3;608,609,1177;, - 3;610,1181,1180;, - 3;609,610,1180;, - 3;611,1182,1181;, - 3;610,611,1181;, - 3;612,1183,1182;, - 3;611,612,1182;, - 3;606,1175,1184;, - 3;1185,606,1184;, - 3;613,605,606;, - 3;614,613,606;, - 3;615,607,605;, - 3;613,615,605;, - 3;616,608,1179;, - 3;1186,616,1179;, - 3;617,609,608;, - 3;616,617,608;, - 3;618,610,609;, - 3;617,618,609;, - 3;619,611,610;, - 3;618,619,610;, - 3;620,612,611;, - 3;619,620,611;, - 3;614,606,1185;, - 3;1187,614,1185;, - 3;621,1188,1189;, - 3;622,621,1189;, - 3;623,1190,1191;, - 3;1192,623,1191;, - 3;624,1193,1190;, - 3;623,624,1190;, - 3;625,1194,1195;, - 3;1196,625,1195;, - 3;626,1197,1194;, - 3;625,626,1194;, - 3;627,1198,1199;, - 3;1200,627,1199;, - 3;628,1201,1198;, - 3;627,628,1198;, - 3;622,1189,1202;, - 3;1203,622,1202;, - 3;1204,621,622;, - 3;1205,623,1192;, - 3;1206,624,623;, - 3;1207,625,1196;, - 3;1208,626,625;, - 3;1209,627,1200;, - 3;1155,628,627;, - 3;1210,622,1203;, - 3;564,571,563;, - 3;565,604,600;, - 3;533,1211,1212;, - 3;1213,1214,539;, - 3;1151,1213,539;, - 3;531,534,1154;, - 3;1140,528,526;, - 3;1138,1140,526;, - 3;534,533,1154;, - 3;1211,533,1215;, - 3;531,1146,534;, - 3;1216,504,506;, - 3;505,507,506;, - 3;513,509,511;, - 3;514,512,513;, - 3;508,507,514;, - 3;1131,1127,516;, - 3;1127,517,515;, - 3;517,1128,518;, - 3;1134,1132,521;, - 3;1132,1133,520;, - 3;1136,1134,523;, - 3;1133,1135,522;, - 3;1137,1136,525;, - 3;1135,1130,524;, - 3;1129,1137,519;, - 3;1149,529,1142;, - 3;1217,1143,1144;, - 3;1215,533,1146;, - 3;1144,1147,1148;, - 3;1150,537,1149;, - 3;1218,538,1150;, - 3;1148,535,1153;, - 3;1210,1204,622;, - 3;1219,1205,1192;, - 3;1205,1206,623;, - 3;1220,1207,1196;, - 3;1207,1208,625;, - 3;1221,1209,1200;, - 3;1209,1155,627;, - 3;1155,1210,1203;, - 3;1154,533,1212;, - 3;604,559,560;, - 3;573,629,574;, - 3;1086,630,1222;, - 3;573,435,1091;, - 3;436,572,1086;, - 3;1091,1223,629;, - 3;573,1091,629;, - 3;572,575,630;, - 3;1086,572,630;, - 3;631,629,1223;, - 3;632,631,1223;, - 3;633,1222,630;, - 3;634,633,630;, - 3;632,1223,1224;, - 3;1225,632,1224;, - 3;635,574,629;, - 3;631,635,629;, - 3;636,575,574;, - 3;635,636,574;, - 3;634,630,575;, - 3;636,634,575;, - 3;637,631,632;, - 3;638,637,632;, - 3;639,633,634;, - 3;640,639,634;, - 3;638,632,1225;, - 3;1226,638,1225;, - 3;641,635,631;, - 3;637,641,631;, - 3;642,636,635;, - 3;641,642,635;, - 3;640,634,636;, - 3;642,640,636;, - 3;643,1227,1228;, - 3;644,643,1228;, - 3;645,1229,1230;, - 3;646,645,1230;, - 3;1231,1232,1229;, - 3;645,1231,1229;, - 3;647,1233,1227;, - 3;1234,647,1227;, - 3;648,1235,1233;, - 3;647,648,1233;, - 3;646,1230,1235;, - 3;648,646,1235;, - 3;649,643,644;, - 3;650,649,644;, - 3;651,645,646;, - 3;652,651,646;, - 3;1236,1231,645;, - 3;651,1236,645;, - 3;653,647,1234;, - 3;1237,653,1234;, - 3;654,648,647;, - 3;653,654,647;, - 3;652,646,648;, - 3;654,652,648;, - 3;655,649,650;, - 3;656,655,650;, - 3;657,651,652;, - 3;658,657,652;, - 3;1238,1236,651;, - 3;657,1238,651;, - 3;659,653,1237;, - 3;655,659,1237;, - 3;660,654,653;, - 3;659,660,653;, - 3;658,652,654;, - 3;660,658,654;, - 3;661,655,656;, - 3;662,661,656;, - 3;657,663,664;, - 3;1239,1238,657;, - 3;664,1239,657;, - 3;665,659,655;, - 3;661,665,655;, - 3;666,660,659;, - 3;665,666,659;, - 3;667,658,660;, - 3;666,667,660;, - 3;1240,661,662;, - 3;1241,1240,662;, - 3;1118,663,667;, - 3;1239,1242,1243;, - 3;1244,665,661;, - 3;1240,1244,661;, - 3;1245,666,665;, - 3;1244,1245,665;, - 3;1118,667,666;, - 3;1245,1118,666;, - 3;1086,426,436;, - 3;488,479,473;, - 3;1112,488,473;, - 3;658,667,663;, - 3;657,658,663;, - 3;1117,664,663;, - 3;1118,1117,663;, - 3;664,1117,1242;, - 3;1239,664,1242;, - 3;484,483,480;, - 3;668,669,670;, - 3;668,670,671;, - 3;671,670,672;, - 3;673,674,675;, - 3;673,675,676;, - 3;1246,677,1247;, - 3;678,679,680;, - 3;678,680,681;, - 3;682,1248,1249;, - 3;682,1249,672;, - 3;683,669,684;, - 3;679,685,686;, - 3;679,686,680;, - 3;687,688,689;, - 3;687,689,690;, - 3;670,691,682;, - 3;670,682,672;, - 3;669,668,692;, - 3;669,692,684;, - 3;687,693,688;, - 3;1250,1251,1252;, - 3;670,694,691;, - 3;669,693,694;, - 3;669,694,670;, - 3;693,669,683;, - 3;693,683,688;, - 3;694,690,689;, - 3;694,689,691;, - 3;695,696,697;, - 3;695,697,698;, - 3;687,699,700;, - 3;687,700,693;, - 3;690,701,699;, - 3;690,699,687;, - 3;694,701,690;, - 3;693,700,694;, - 3;699,696,695;, - 3;699,695,700;, - 3;701,697,696;, - 3;701,696,699;, - 3;694,698,697;, - 3;694,697,701;, - 3;700,695,698;, - 3;700,698,694;, - 3;1247,692,702;, - 3;1247,702,703;, - 3;672,1249,704;, - 3;672,704,705;, - 3;673,676,1253;, - 3;673,1253,1254;, - 3;692,668,706;, - 3;692,706,702;, - 3;668,671,707;, - 3;668,707,706;, - 3;671,672,705;, - 3;671,705,707;, - 3;703,702,679;, - 3;703,679,678;, - 3;705,704,681;, - 3;705,681,680;, - 3;1254,1253,1255;, - 3;1254,1255,1256;, - 3;702,706,685;, - 3;702,685,679;, - 3;706,707,686;, - 3;706,686,685;, - 3;707,705,680;, - 3;707,680,686;, - 3;708,709,710;, - 3;708,711,712;, - 3;713,714,715;, - 3;716,715,717;, - 3;718,717,712;, - 3;719,720,1257;, - 3;720,721,722;, - 3;721,723,1258;, - 3;723,1259,1258;, - 3;719,1260,1261;, - 3;724,725,1262;, - 3;725,726,1263;, - 3;727,724,1264;, - 3;726,728,1265;, - 3;729,727,1266;, - 3;728,719,1261;, - 3;723,729,1267;, - 3;730,731,1268;, - 3;1269,732,1270;, - 3;1271,1272,733;, - 3;1273,734,1274;, - 3;1275,730,1268;, - 3;735,736,1276;, - 3;1276,737,738;, - 3;1277,739,1278;, - 3;1273,1278,734;, - 3;733,740,1279;, - 3;1279,740,741;, - 3;1280,741,742;, - 3;1281,743,1282;, - 3;1283,744,739;, - 3;736,1284,1285;, - 3;745,746,747;, - 3;745,747,748;, - 3;748,747,749;, - 3;748,749,750;, - 3;750,749,751;, - 3;750,751,752;, - 3;752,751,753;, - 3;752,753,754;, - 3;754,753,755;, - 3;754,755,756;, - 3;756,755,757;, - 3;756,757,758;, - 3;758,757,759;, - 3;758,759,760;, - 3;760,759,1286;, - 3;760,1286,1287;, - 3;746,761,762;, - 3;746,762,747;, - 3;747,762,763;, - 3;747,763,749;, - 3;749,763,764;, - 3;749,764,751;, - 3;751,764,765;, - 3;751,765,753;, - 3;753,765,766;, - 3;753,766,755;, - 3;755,766,767;, - 3;755,767,757;, - 3;757,767,768;, - 3;757,768,759;, - 3;759,768,1288;, - 3;759,1288,1286;, - 3;761,566,769;, - 3;761,769,762;, - 3;764,770,765;, - 3;765,771,772;, - 3;765,772,766;, - 3;766,772,773;, - 3;766,773,767;, - 3;767,773,571;, - 3;768,571,1159;, - 3;768,1159,1288;, - 3;774,775,776;, - 3;774,776,777;, - 3;775,462,463;, - 3;775,463,776;, - 3;1289,1290,778;, - 3;1289,778,779;, - 3;1290,1291,780;, - 3;1290,780,778;, - 3;1291,1292,781;, - 3;1291,781,780;, - 3;1292,1293,782;, - 3;1292,782,781;, - 3;1293,1165,581;, - 3;1293,581,782;, - 3;779,778,783;, - 3;779,783,784;, - 3;778,780,785;, - 3;778,785,783;, - 3;780,781,786;, - 3;780,786,785;, - 3;781,782,787;, - 3;781,787,786;, - 3;782,581,587;, - 3;782,587,787;, - 3;784,783,788;, - 3;784,788,789;, - 3;783,785,790;, - 3;783,790,788;, - 3;785,786,791;, - 3;785,791,790;, - 3;786,787,792;, - 3;786,792,791;, - 3;787,587,593;, - 3;787,593,792;, - 3;1294,1295,771;, - 3;1294,771,793;, - 3;1295,1296,772;, - 3;1295,772,771;, - 3;1296,1297,773;, - 3;1296,773,772;, - 3;1297,1170,595;, - 3;1297,595,773;, - 3;773,595,571;, - 3;1171,1289,779;, - 3;1171,779,596;, - 3;596,779,784;, - 3;596,784,597;, - 3;597,784,789;, - 3;597,789,598;, - 3;599,769,566;, - 3;600,769,599;, - 3;601,1173,1298;, - 3;601,1298,794;, - 3;794,1298,1294;, - 3;794,1294,793;, - 3;769,763,762;, - 3;603,601,794;, - 3;603,794,795;, - 3;770,793,771;, - 3;770,771,765;, - 3;795,794,793;, - 3;795,793,770;, - 3;795,770,764;, - 3;769,795,763;, - 3;600,603,795;, - 3;1299,1300,796;, - 3;1299,796,797;, - 3;1300,1301,798;, - 3;1300,798,796;, - 3;1302,1303,799;, - 3;1302,799,1304;, - 3;1303,1305,800;, - 3;1303,800,799;, - 3;1305,1306,801;, - 3;1305,801,800;, - 3;1306,1307,802;, - 3;1306,802,801;, - 3;1307,1308,803;, - 3;1307,803,802;, - 3;1309,1299,797;, - 3;1309,797,1310;, - 3;797,796,804;, - 3;797,804,805;, - 3;796,798,806;, - 3;796,806,804;, - 3;1304,799,807;, - 3;1304,807,1311;, - 3;799,800,808;, - 3;799,808,807;, - 3;800,801,809;, - 3;800,809,808;, - 3;801,802,810;, - 3;801,810,809;, - 3;802,803,811;, - 3;802,811,810;, - 3;1310,797,805;, - 3;1310,805,1312;, - 3;1313,1314,812;, - 3;1313,812,813;, - 3;1315,1316,814;, - 3;1315,814,1317;, - 3;1316,1318,815;, - 3;1316,815,814;, - 3;1319,1320,816;, - 3;1319,816,1321;, - 3;1320,1322,817;, - 3;1320,817,816;, - 3;1323,1324,818;, - 3;1323,818,1325;, - 3;1324,1326,819;, - 3;1324,819,818;, - 3;1327,1313,813;, - 3;1327,813,1328;, - 3;813,812,1329;, - 3;1317,814,1330;, - 3;814,815,1331;, - 3;1321,816,1332;, - 3;816,817,1333;, - 3;1325,818,1334;, - 3;818,819,1284;, - 3;1328,813,1335;, - 3;767,571,768;, - 3;600,795,769;, - 3;1336,1337,738;, - 3;743,1338,1339;, - 3;743,1339,1282;, - 3;1285,737,736;, - 3;731,732,1269;, - 3;731,1269,1268;, - 3;1285,738,737;, - 3;1340,738,1337;, - 3;737,1276,736;, - 3;708,710,1341;, - 3;708,712,709;, - 3;713,715,716;, - 3;716,717,718;, - 3;718,712,711;, - 3;719,1257,1260;, - 3;720,722,1257;, - 3;721,1258,722;, - 3;724,1262,1264;, - 3;725,1263,1262;, - 3;727,1264,1266;, - 3;726,1265,1263;, - 3;729,1266,1267;, - 3;728,1261,1265;, - 3;723,1267,1259;, - 3;1271,733,1279;, - 3;1273,1274,1342;, - 3;1276,738,1340;, - 3;1277,1278,1273;, - 3;1279,741,1280;, - 3;1280,742,1343;, - 3;1283,739,1277;, - 3;813,1329,1335;, - 3;1317,1330,1344;, - 3;814,1331,1330;, - 3;1321,1332,1345;, - 3;816,1333,1332;, - 3;1325,1334,1346;, - 3;818,1284,1334;, - 3;1328,1335,1284;, - 3;1336,738,1285;, - 3;764,763,795;, - 3;774,820,775;, - 3;1347,821,1098;, - 3;1107,462,775;, - 3;1098,776,463;, - 3;820,1348,1107;, - 3;820,1107,775;, - 3;821,777,776;, - 3;821,776,1098;, - 3;1348,820,822;, - 3;1348,822,823;, - 3;821,1347,824;, - 3;821,824,825;, - 3;1349,1348,823;, - 3;1349,823,1350;, - 3;820,774,826;, - 3;820,826,822;, - 3;774,777,827;, - 3;774,827,826;, - 3;777,821,825;, - 3;777,825,827;, - 3;823,822,828;, - 3;823,828,829;, - 3;825,824,830;, - 3;825,830,831;, - 3;1350,823,829;, - 3;1350,829,1351;, - 3;822,826,832;, - 3;822,832,828;, - 3;826,827,833;, - 3;826,833,832;, - 3;827,825,831;, - 3;827,831,833;, - 3;1352,1353,834;, - 3;1352,834,835;, - 3;1354,1355,836;, - 3;1354,836,837;, - 3;1355,1356,1357;, - 3;1355,1357,836;, - 3;1353,1358,838;, - 3;1353,838,1359;, - 3;1358,1360,839;, - 3;1358,839,838;, - 3;1360,1354,837;, - 3;1360,837,839;, - 3;835,834,840;, - 3;835,840,841;, - 3;837,836,842;, - 3;837,842,843;, - 3;836,1357,1361;, - 3;836,1361,842;, - 3;1359,838,844;, - 3;1359,844,1362;, - 3;838,839,845;, - 3;838,845,844;, - 3;839,837,843;, - 3;839,843,845;, - 3;841,840,846;, - 3;841,846,847;, - 3;843,842,848;, - 3;843,848,849;, - 3;842,1361,1363;, - 3;842,1363,848;, - 3;1362,844,850;, - 3;1362,850,846;, - 3;844,845,851;, - 3;844,851,850;, - 3;845,843,849;, - 3;845,849,851;, - 3;847,846,852;, - 3;847,852,853;, - 3;854,855,848;, - 3;848,1363,1364;, - 3;848,1364,854;, - 3;846,850,856;, - 3;846,856,852;, - 3;850,851,857;, - 3;850,857,856;, - 3;851,849,858;, - 3;851,858,857;, - 3;853,852,1365;, - 3;853,1365,1366;, - 3;858,855,1250;, - 3;1367,1368,1364;, - 3;852,856,1369;, - 3;852,1369,1365;, - 3;856,857,1370;, - 3;856,1370,1369;, - 3;857,858,1250;, - 3;857,1250,1370;, - 3;677,684,692;, - 3;677,692,1247;, - 3;855,858,849;, - 3;855,849,848;, - 3;855,854,1251;, - 3;855,1251,1250;, - 3;1368,1251,854;, - 3;1368,854,1364;, - 3;683,689,688;, - 3;859,860,861;, - 3;862,859,861;, - 3;862,861,863;, - 3;864,862,863;, - 3;864,863,865;, - 3;866,864,865;, - 3;866,865,867;, - 3;868,866,867;, - 3;868,867,869;, - 3;870,868,869;, - 3;870,869,871;, - 3;872,870,871;, - 3;872,871,873;, - 3;874,872,873;, - 3;875,876,877;, - 3;878,875,877;, - 3;879,880,877;, - 3;880,881,878;, - 3;880,878,877;, - 3;880,863,861;, - 3;879,873,871;, - 3;879,871,869;, - 3;880,879,869;, - 3;880,869,867;, - 3;880,867,865;, - 3;880,865,863;, - 3;880,861,881;, - 3;881,861,860;, - 3;882,883,859;, - 3;862,882,859;, - 3;884,882,862;, - 3;864,884,862;, - 3;885,884,864;, - 3;866,885,864;, - 3;886,885,866;, - 3;868,886,866;, - 3;887,886,868;, - 3;870,887,868;, - 3;888,887,870;, - 3;872,888,870;, - 3;889,888,872;, - 3;874,889,872;, - 3;890,891,892;, - 3;893,890,892;, - 3;890,894,895;, - 3;893,896,894;, - 3;890,893,894;, - 3;882,884,894;, - 3;888,889,895;, - 3;887,888,895;, - 3;894,887,895;, - 3;886,887,894;, - 3;885,886,894;, - 3;884,885,894;, - 3;896,882,894;, - 3;883,882,896;, - 3;1371,1372,1373;, - 3;1374,1375,1376;, - 3;1377,1378,1379;, - 3;1380,1377,1379;, - 3;1381,1382,1378;, - 3;1377,1381,1378;, - 3;1380,1379,1383;, - 3;1384,1380,1383;, - 3;1385,1386,1382;, - 3;1381,1385,1382;, - 3;1384,1383,1387;, - 3;1388,1384,1387;, - 3;1374,1376,1386;, - 3;1385,1374,1386;, - 3;1388,1387,1372;, - 3;1371,1388,1372;, - 3;897,898,899;, - 3;900,901,1389;, - 3;1390,900,1389;, - 3;902,903,904;, - 3;905,897,899;, - 3;906,900,1390;, - 3;1391,906,1390;, - 3;907,903,902;, - 3;908,905,899;, - 3;909,906,1391;, - 3;1392,909,1391;, - 3;910,903,907;, - 3;911,908,899;, - 3;912,909,1392;, - 3;1393,912,1392;, - 3;913,903,910;, - 3;914,911,899;, - 3;915,912,1393;, - 3;1394,915,1393;, - 3;916,903,913;, - 3;917,914,899;, - 3;918,915,1394;, - 3;1395,918,1394;, - 3;919,903,916;, - 3;920,917,899;, - 3;921,1396,1397;, - 3;1398,921,1397;, - 3;922,903,919;, - 3;898,920,899;, - 3;901,921,1398;, - 3;1389,901,1398;, - 3;904,903,922;, - 3;923,924,925;, - 3;926,923,925;, - 3;927,923,926;, - 3;928,927,926;, - 3;929,927,928;, - 3;930,929,928;, - 3;931,929,930;, - 3;932,931,930;, - 3;933,931,932;, - 3;934,933,932;, - 3;935,933,934;, - 3;936,935,934;, - 3;937,1399,1400;, - 3;938,937,1400;, - 3;924,937,938;, - 3;925,924,938;, - 3;939,940,941;, - 3;942,939,941;, - 3;943,939,942;, - 3;944,943,942;, - 3;945,943,944;, - 3;946,945,944;, - 3;947,945,946;, - 3;948,947,946;, - 3;949,947,948;, - 3;950,949,948;, - 3;951,949,950;, - 3;952,951,950;, - 3;953,1401,1402;, - 3;954,953,1402;, - 3;940,953,954;, - 3;941,940,954;, - 3;1403,1404,955;, - 3;956,1403,955;, - 3;1405,1403,956;, - 3;957,1405,956;, - 3;1406,1405,957;, - 3;958,1406,957;, - 3;1407,1406,958;, - 3;959,1407,958;, - 3;1408,1407,959;, - 3;960,1408,959;, - 3;1409,1408,960;, - 3;961,1409,960;, - 3;1410,1411,1412;, - 3;962,1410,1412;, - 3;1404,1410,962;, - 3;955,1404,962;, - 3;963,964,965;, - 3;966,963,965;, - 3;967,963,966;, - 3;968,967,966;, - 3;969,967,968;, - 3;970,969,968;, - 3;971,969,970;, - 3;972,971,970;, - 3;973,971,972;, - 3;974,973,972;, - 3;975,973,974;, - 3;976,975,974;, - 3;977,1413,1414;, - 3;978,977,1414;, - 3;964,977,978;, - 3;965,964,978;, - 3;1415,1416,1417;, - 3;1418,1415,1417;, - 3;1419,1420,1421;, - 3;1422,1419,1421;, - 3;1423,1424,1416;, - 3;1415,1423,1416;, - 3;1422,1421,1425;, - 3;1426,1422,1425;, - 3;1427,1428,1424;, - 3;1423,1427,1424;, - 3;1426,1425,1429;, - 3;1430,1426,1429;, - 3;1431,1432,1428;, - 3;1427,1431,1428;, - 3;1430,1429,1433;, - 3;1434,1430,1433;, - 3;1435,1436,1432;, - 3;1431,1435,1432;, - 3;1434,1433,1437;, - 3;1438,1434,1437;, - 3;1439,1440,1436;, - 3;1435,1439,1436;, - 3;1438,1437,1441;, - 3;1442,1438,1441;, - 3;1443,1444,1440;, - 3;1439,1443,1440;, - 3;1442,1441,1445;, - 3;1446,1442,1445;, - 3;1418,1417,1444;, - 3;1443,1418,1444;, - 3;1446,1445,1420;, - 3;1419,1446,1420;, - 3;1447,1448,1449;, - 3;1450,1447,1449;, - 3;1451,1452,1453;, - 3;1454,1451,1453;, - 3;1455,1456,1448;, - 3;1447,1455,1448;, - 3;1454,1453,1457;, - 3;1458,1454,1457;, - 3;1459,1460,1456;, - 3;1455,1459,1456;, - 3;1458,1457,1461;, - 3;1462,1458,1461;, - 3;1463,1464,1460;, - 3;1459,1463,1460;, - 3;1462,1461,1465;, - 3;1466,1462,1465;, - 3;1467,1468,1464;, - 3;1463,1467,1464;, - 3;1466,1465,1469;, - 3;1470,1466,1469;, - 3;1471,1472,1468;, - 3;1467,1471,1468;, - 3;1470,1469,1473;, - 3;1474,1470,1473;, - 3;1475,1476,1472;, - 3;1471,1475,1472;, - 3;1474,1473,1477;, - 3;1478,1474,1477;, - 3;1450,1449,1476;, - 3;1475,1450,1476;, - 3;1478,1477,1452;, - 3;1451,1478,1452;; - - MeshNormals - { - 979; - -0.129816;-0.852990;-0.505525;, - 0.036964;-0.991876;-0.121718;, - -0.698699;-0.688078;-0.195877;, - -0.708337;-0.651960;-0.270567;, - -0.006954;-0.960460;0.278330;, - -0.700324;-0.650018;0.294997;, - 0.302430;-0.952051;0.046201;, - -0.276584;-0.929242;-0.244971;, - 0.094428;0.853934;0.511742;, - 0.336283;-0.009104;0.941717;, - 0.556489;-0.055914;0.828972;, - 0.759730;0.498962;0.416950;, - 0.034747;0.947415;-0.318114;, - 0.731470;0.541587;-0.414288;, - 0.105400;0.061590;-0.992521;, - 0.621131;-0.303408;-0.722592;, - 0.541167;-0.749736;0.380833;, - -0.709843;0.544304;0.447052;, - -0.207902;-0.308447;0.928244;, - 0.546967;-0.813260;-0.198582;, - -0.735620;0.642658;-0.214135;, - 0.607416;-0.793959;-0.025956;, - -0.702457;0.230287;-0.673440;, - 0.609483;-0.790811;-0.056108;, - 0.698700;-0.688078;-0.195877;, - -0.036964;-0.991876;-0.121718;, - 0.129816;-0.852990;-0.505525;, - 0.708337;-0.651961;-0.270567;, - 0.006954;-0.960460;0.278330;, - 0.700323;-0.650018;0.294997;, - -0.302430;-0.952051;0.046201;, - 0.276584;-0.929242;-0.244970;, - -0.556488;-0.055914;0.828972;, - -0.336283;-0.009104;0.941717;, - -0.094428;0.853934;0.511742;, - -0.759730;0.498962;0.416950;, - -0.034747;0.947415;-0.318114;, - -0.731472;0.541585;-0.414288;, - -0.105400;0.061590;-0.992521;, - -0.621131;-0.303409;-0.722592;, - -0.541168;-0.749736;0.380833;, - 0.709843;0.544305;0.447052;, - 0.207903;-0.308447;0.928244;, - -0.546967;-0.813260;-0.198581;, - 0.735620;0.642658;-0.214134;, - -0.607415;-0.793960;-0.025956;, - 0.702458;0.230287;-0.673439;, - -0.609482;-0.790812;-0.056107;, - 0.715168;-0.546642;0.435566;, - 0.174589;-0.765639;0.619125;, - 0.311507;-0.029519;0.949785;, - 0.802549;-0.063801;0.593165;, - 0.674954;-0.705769;0.215238;, - 0.965425;-0.079199;0.248359;, - 0.989682;-0.086167;0.114472;, - 0.589572;-0.802548;0.091222;, - 0.222087;-0.142281;-0.964590;, - 0.239432;-0.628781;-0.739802;, - 0.451846;-0.276668;-0.848110;, - 0.400719;-0.107309;-0.909895;, - 0.345620;-0.589510;-0.730086;, - 0.552622;-0.313025;-0.772414;, - 0.714052;-0.151501;-0.683504;, - -0.111976;0.059755;-0.991913;, - 0.000000;-0.303073;-0.952967;, - 0.408905;-0.168156;-0.896951;, - -0.008987;0.245821;-0.969274;, - 0.637596;0.116274;-0.761545;, - 0.862761;-0.168404;-0.476742;, - 0.607110;0.434795;-0.665110;, - 0.093622;-0.452750;-0.886709;, - 0.454447;-0.542535;-0.706493;, - 0.433850;-0.537110;-0.723386;, - 0.668027;-0.011998;-0.744040;, - 0.770806;0.495623;-0.400270;, - 0.695970;-0.572016;-0.434078;, - 0.452755;-0.608582;-0.651645;, - 0.678173;0.659980;-0.323276;, - 0.561443;-0.626268;-0.540898;, - 0.695491;-0.680703;-0.230080;, - 0.320057;-0.465858;-0.824948;, - 0.015522;-0.721373;-0.692373;, - 0.025936;-0.639799;-0.768104;, - 0.267999;-0.896130;-0.353734;, - 0.429871;0.677744;-0.596552;, - 0.870887;0.286101;-0.399627;, - 0.899576;0.029925;-0.435739;, - 0.877351;-0.421108;0.230049;, - 0.727191;0.647472;0.227974;, - 0.251564;-0.085554;-0.964052;, - 0.443688;0.461641;-0.768133;, - 0.574683;-0.083305;-0.814125;, - 0.736077;0.391009;-0.552541;, - 0.899391;-0.211232;-0.382723;, - 0.958834;0.021238;-0.283171;, - 0.746330;-0.655766;-0.113851;, - 0.972458;-0.091984;-0.214160;, - 0.939346;-0.154664;-0.306116;, - 0.394895;-0.519206;-0.757947;, - 0.079536;-0.698997;-0.710688;, - 0.793478;0.264078;-0.548321;, - 0.593612;0.315377;-0.740379;, - 0.122186;-0.410372;-0.903696;, - -0.025452;0.456614;-0.889301;, - 0.117224;0.694033;-0.710336;, - 0.364145;0.733069;-0.574464;, - 0.345959;-0.296498;-0.890169;, - -0.135622;-0.348879;-0.927303;, - 0.466699;0.709807;-0.527604;, - 0.226468;-0.163193;-0.960250;, - 0.506498;0.620402;-0.598799;, - 0.485375;0.342365;-0.804486;, - 0.470753;0.400109;-0.786323;, - -0.507537;-0.402332;-0.761929;, - 0.800830;0.191458;-0.567463;, - 0.889577;0.287018;-0.355350;, - 0.266019;0.013318;-0.963876;, - -0.642198;0.006037;-0.766515;, - 0.425486;0.746189;-0.512018;, - 0.409779;0.681736;-0.606067;, - -0.058171;0.604638;-0.794374;, - 0.508624;0.701385;-0.499359;, - 0.286727;-0.054946;-0.956435;, - -0.316097;0.145690;-0.937474;, - -0.114483;-0.612880;-0.781838;, - -0.732130;-0.218041;-0.645325;, - -0.077040;0.341658;-0.936662;, - 0.982790;0.168633;-0.075412;, - 0.736791;0.340065;-0.584375;, - -0.327315;-0.220940;-0.918722;, - -0.356933;-0.916762;-0.179292;, - 0.858059;0.295560;-0.419974;, - 0.982755;-0.116030;0.143980;, - 0.686546;-0.436660;0.581362;, - -0.114684;-0.032216;-0.992880;, - -0.610499;-0.792017;0.000055;, - 0.997650;0.023444;-0.064385;, - 0.994914;-0.019735;0.098779;, - 0.607825;0.764607;-0.214302;, - 0.169187;0.272448;0.947179;, - -0.308242;0.468162;-0.828137;, - -0.945384;-0.259556;0.197182;, - 0.724385;0.622190;-0.296892;, - 0.338665;0.069750;0.938318;, - -0.281176;0.325935;-0.902611;, - -0.944702;-0.225837;0.237773;, - 0.943751;0.081290;-0.320510;, - 0.309733;-0.452451;0.836274;, - 0.122451;-0.025404;-0.992149;, - -0.820495;-0.556147;-0.132241;, - 0.521386;-0.621684;-0.584522;, - 0.000004;-0.667404;0.744696;, - 0.000000;0.082569;0.996585;, - 0.955176;-0.093355;0.280935;, - 0.907373;-0.032566;0.419063;, - 0.017997;0.304606;0.952308;, - 0.611072;0.197838;0.766453;, - 0.839507;0.190096;0.509010;, - 0.969844;0.099854;0.222331;, - 0.141318;0.262440;0.954544;, - 0.596370;0.185083;0.781081;, - 0.866160;0.114817;0.486400;, - 0.988906;0.103392;0.106655;, - 0.988842;0.100552;0.109915;, - 0.000104;-0.599228;0.800578;, - 0.173663;-0.620057;0.765095;, - 0.570753;-0.654192;0.496260;, - 0.741579;-0.628361;0.234997;, - 0.750948;-0.640212;0.161879;, - 0.775887;-0.622672;-0.101386;, - 0.726861;-0.637107;-0.256451;, - 0.518488;-0.628231;-0.580083;, - 0.282637;-0.599455;-0.748846;, - 0.039464;-0.606899;-0.793799;, - 0.000173;0.124733;0.992190;, - 0.273998;0.111428;0.955253;, - 0.810070;0.159410;0.564247;, - 0.923389;0.204059;0.325134;, - 0.963267;0.228823;0.140559;, - 0.961478;0.230312;-0.150056;, - 0.893601;0.214711;-0.394178;, - 0.628384;0.178155;-0.757228;, - 0.365227;0.121643;-0.922937;, - -0.008183;0.142392;-0.989776;, - 0.000103;0.483720;0.875223;, - 0.277107;0.511871;0.813142;, - 0.698315;0.579992;0.419483;, - 0.784868;0.562838;0.259223;, - 0.803441;0.586284;0.103699;, - 0.816344;0.565091;-0.119395;, - 0.765667;0.558811;-0.318567;, - 0.582400;0.519613;-0.625150;, - 0.339503;0.496872;-0.798658;, - -0.010072;0.503689;-0.863826;, - -0.000170;0.838829;0.544394;, - 0.209122;0.860779;0.464035;, - 0.472183;0.850685;0.231037;, - 0.524210;0.831400;0.184332;, - 0.548334;0.835391;0.038098;, - 0.560725;0.823931;-0.082001;, - 0.493044;0.839080;-0.229897;, - 0.356599;0.845126;-0.398246;, - 0.193906;0.838344;-0.509490;, - -0.030005;0.838012;-0.544826;, - 0.000000;0.999889;-0.014920;, - -0.247610;-0.617187;0.746839;, - -0.640144;-0.698513;0.319837;, - -0.845216;-0.109792;0.523025;, - -0.332309;0.120583;0.935431;, - -0.951232;-0.100313;0.291711;, - -0.607708;-0.765854;0.210140;, - -0.794975;-0.601716;0.077149;, - -0.992358;-0.084286;0.090118;, - -0.540786;-0.310747;-0.781657;, - -0.243635;-0.604159;-0.758705;, - -0.239575;-0.129408;-0.962215;, - -0.457699;-0.311417;-0.832785;, - -0.601820;-0.346641;-0.719481;, - -0.372432;-0.542919;-0.752685;, - -0.727575;-0.138985;-0.671802;, - -0.462077;-0.172950;-0.869812;, - -0.526055;0.267394;-0.807321;, - -0.889688;-0.200487;-0.410196;, - -0.661906;0.183020;-0.726900;, - -0.482780;-0.428287;-0.763868;, - -0.368326;-0.722170;-0.585497;, - -0.844542;0.459938;-0.274236;, - -0.681525;0.387393;-0.620847;, - -0.605303;-0.397304;-0.689752;, - -0.673388;-0.491201;-0.552514;, - -0.657816;0.645924;-0.387376;, - -0.662135;-0.671377;-0.332913;, - -0.486791;-0.582794;-0.650681;, - -0.258785;-0.568614;-0.780839;, - -0.513083;0.131989;-0.848130;, - -0.297505;-0.905023;-0.304014;, - -0.895981;0.262607;-0.358127;, - -0.675033;0.466963;-0.571206;, - -0.901019;0.266881;0.341965;, - -0.680425;-0.732688;-0.013786;, - -0.259518;-0.023921;-0.965442;, - -0.514018;0.532502;-0.672478;, - -0.645404;-0.118674;-0.754566;, - -0.641496;0.340399;-0.687468;, - -0.875472;-0.233593;-0.423064;, - -0.941780;-0.006383;-0.336169;, - -0.729762;-0.674587;-0.111267;, - -0.974729;-0.092161;-0.203496;, - -0.948685;-0.159768;-0.272894;, - -0.413516;-0.551069;-0.724795;, - -0.452430;-0.424111;-0.784497;, - -0.633631;0.387785;-0.669429;, - -0.759347;0.388122;-0.522258;, - -0.349670;0.699505;-0.623236;, - -0.367983;-0.326177;-0.870745;, - -0.426287;0.691018;-0.583758;, - 0.024608;-0.361630;-0.931997;, - -0.506095;0.593595;-0.625710;, - 0.205299;-0.327376;-0.922321;, - -0.019213;0.001677;-0.999814;, - -0.592122;0.499030;-0.632740;, - -0.705863;0.322617;-0.630616;, - -0.858342;0.333085;-0.390262;, - 0.520378;-0.115323;-0.846113;, - -0.098311;0.739985;-0.665400;, - -0.505485;0.718564;-0.477651;, - -0.429291;0.753222;-0.498363;, - -0.436628;0.579844;-0.687850;, - -0.018955;0.315468;-0.948747;, - 0.628680;-0.297343;-0.718574;, - 0.340473;0.081313;-0.936732;, - -0.987372;0.150062;-0.050767;, - -0.879193;0.307819;-0.363685;, - -0.071334;0.098893;-0.992538;, - 0.552973;-0.594293;-0.583984;, - -0.838304;0.391818;-0.379111;, - -0.660024;-0.355125;0.662008;, - -0.878202;-0.379715;0.290821;, - 0.063977;0.037528;-0.997245;, - 0.565936;-0.819042;-0.094270;, - -0.991440;0.023648;-0.128400;, - -0.999073;0.010052;0.041867;, - -0.576121;0.786004;-0.224237;, - -0.253102;0.252826;0.933819;, - 0.335569;0.443367;-0.831155;, - 0.943943;-0.232201;0.234638;, - -0.746213;0.592914;-0.302686;, - -0.189845;0.217076;0.957516;, - 0.237934;0.300377;-0.923667;, - 0.932614;-0.306696;0.190181;, - -0.854338;0.099672;-0.510071;, - -0.759448;-0.294301;0.580194;, - 0.213648;-0.150954;-0.965177;, - 0.739086;-0.584441;0.334935;, - -0.521385;-0.621686;-0.584521;, - -0.921296;-0.000592;0.388863;, - -0.962588;-0.092104;0.254837;, - -0.643832;0.151144;0.750091;, - -0.980272;0.070344;0.184714;, - -0.849418;0.188211;0.493017;, - -0.517473;0.220460;0.826812;, - -0.775120;0.146862;0.614508;, - -0.979260;0.103055;0.174438;, - -0.988842;0.100551;0.109916;, - -0.257131;-0.613480;0.746677;, - -0.655025;-0.643192;0.396543;, - -0.729698;-0.628342;0.269680;, - -0.767211;-0.638569;0.060144;, - -0.773397;-0.623118;-0.116540;, - -0.694093;-0.641310;-0.327041;, - -0.455929;-0.638307;-0.620236;, - -0.253991;-0.603628;-0.755726;, - -0.290181;0.120439;0.949363;, - -0.790874;0.202403;0.577539;, - -0.923458;0.210735;0.320651;, - -0.959298;0.234558;0.157257;, - -0.963277;0.224319;-0.147576;, - -0.900844;0.202218;-0.384172;, - -0.646321;0.146493;-0.748871;, - -0.336180;0.122826;-0.933754;, - -0.268545;0.501480;0.822436;, - -0.701566;0.531626;0.474529;, - -0.791663;0.556265;0.252664;, - -0.805765;0.578042;0.128881;, - -0.812528;0.571712;-0.113773;, - -0.760729;0.577526;-0.296236;, - -0.589180;0.554444;-0.587757;, - -0.331045;0.502521;-0.798675;, - -0.118111;0.855986;0.503326;, - -0.413323;0.856582;0.308919;, - -0.532739;0.831452;0.157727;, - -0.535078;0.837140;0.113529;, - -0.562623;0.823042;-0.077821;, - -0.522170;0.835158;-0.172769;, - -0.396124;0.843506;-0.362744;, - -0.243647;0.844427;-0.477053;, - -0.585560;-0.168913;0.792836;, - -0.979025;-0.171040;-0.110706;, - -0.868505;-0.466650;0.167143;, - -0.289501;-0.466650;0.835720;, - 0.000148;0.999994;-0.003359;, - 0.394045;-0.169028;0.903414;, - 0.579005;-0.466650;0.668574;, - 0.979037;-0.171271;0.110238;, - 0.868506;-0.466648;-0.167143;, - 0.584817;-0.173401;-0.792415;, - 0.289503;-0.466649;-0.835719;, - -0.393644;-0.173286;-0.902783;, - -0.579003;-0.466649;-0.668576;, - -0.130098;0.890443;0.436104;, - -0.236889;0.850100;-0.470334;, - -0.175642;0.968564;-0.176161;, - -0.060805;0.637960;0.767665;, - 0.235836;0.103418;0.966274;, - 0.172266;-0.360525;0.916704;, - 0.503507;-0.734161;0.455509;, - 0.250506;-0.953163;0.169488;, - 0.379678;-0.782095;-0.494138;, - 0.086510;-0.635228;-0.767464;, - -0.026852;0.043388;-0.998697;, - -0.120815;0.369417;-0.921377;, - -0.615710;0.743650;-0.260549;, - -0.318016;0.682023;0.658567;, - 0.454590;0.074146;0.887610;, - 0.872061;-0.456119;0.177383;, - 0.544687;-0.374159;-0.750547;, - -0.205593;0.244510;-0.947600;, - -0.947918;0.318514;-0.000749;, - -0.382719;0.448240;0.807841;, - 0.611759;0.246959;0.751507;, - 0.993888;-0.069640;-0.085659;, - 0.432662;-0.176959;-0.884019;, - -0.548317;0.022330;-0.835973;, - -0.007283;0.942541;-0.334010;, - 0.175641;0.968564;-0.176163;, - 0.236889;0.850100;-0.470334;, - 0.130099;0.890443;0.436103;, - 0.060805;0.637960;0.767665;, - -0.235836;0.103418;0.966274;, - -0.172267;-0.360525;0.916704;, - -0.503507;-0.734161;0.455508;, - -0.250507;-0.953164;0.169486;, - -0.379678;-0.782095;-0.494138;, - -0.086509;-0.635227;-0.767465;, - 0.026852;0.043389;-0.998697;, - 0.120815;0.369418;-0.921376;, - 0.615711;0.743650;-0.260548;, - 0.318016;0.682023;0.658567;, - -0.454590;0.074146;0.887609;, - -0.872061;-0.456119;0.177385;, - -0.544687;-0.374159;-0.750547;, - 0.205595;0.244511;-0.947600;, - 0.947918;0.318513;-0.000749;, - 0.382720;0.448240;0.807841;, - -0.611758;0.246959;0.751507;, - -0.993888;-0.069640;-0.085659;, - -0.432660;-0.176959;-0.884020;, - 0.548319;0.022332;-0.835971;, - 0.007296;0.942541;-0.334010;, - 0.326102;-0.301915;0.895826;, - 0.290390;0.081714;0.953413;, - 0.282586;0.359266;0.889423;, - 0.732955;0.505070;0.455721;, - 0.196255;0.976233;0.091942;, - 0.000000;0.983658;-0.180048;, - 0.092154;0.912052;0.399586;, - 0.685876;-0.491759;-0.536421;, - 0.803250;0.595471;-0.014278;, - 0.173689;0.943714;-0.281490;, - 0.755928;0.238778;-0.609556;, - 0.573852;0.647817;-0.501026;, - 0.218078;0.832084;-0.509980;, - 0.273387;0.254330;-0.927672;, - 0.177185;0.758963;-0.626563;, - 0.152142;0.771846;-0.617338;, - 0.000000;0.507928;-0.861399;, - -0.000000;0.336033;-0.941850;, - 0.302092;0.176073;0.936877;, - 0.240533;0.336563;0.910422;, - 0.663467;0.421496;-0.618184;, - 0.427727;0.228952;-0.874432;, - 0.230252;0.500003;-0.834854;, - 0.000000;0.578617;-0.815600;, - 0.307879;0.805978;0.505580;, - 0.145346;0.598582;0.787765;, - 0.405591;0.657823;-0.634638;, - 0.402621;0.826286;-0.393887;, - 0.226398;0.640557;-0.733779;, - 0.000000;0.846676;0.532109;, - 0.000000;0.512865;0.858469;, - 0.000000;0.063273;0.997996;, - 0.000000;0.457798;0.889057;, - -0.000000;0.804821;-0.593518;, - -0.000000;0.248350;0.968670;, - 0.000000;0.609069;-0.793118;, - 0.227767;0.807947;0.543456;, - 0.281507;0.877647;-0.387930;, - -0.282586;0.359266;0.889423;, - -0.290390;0.081714;0.953413;, - -0.326102;-0.301915;0.895826;, - -0.732955;0.505070;0.455721;, - -0.092154;0.912052;0.399586;, - -0.196255;0.976233;0.091942;, - -0.685876;-0.491759;-0.536421;, - -0.803250;0.595471;-0.014278;, - -0.173689;0.943714;-0.281490;, - -0.755928;0.238778;-0.609556;, - -0.573852;0.647817;-0.501026;, - -0.218077;0.832084;-0.509980;, - -0.273387;0.254330;-0.927672;, - -0.177185;0.758963;-0.626563;, - -0.152141;0.771846;-0.617338;, - -0.240533;0.336564;0.910422;, - -0.302092;0.176073;0.936877;, - -0.427727;0.228952;-0.874432;, - -0.663467;0.421497;-0.618184;, - -0.230252;0.500003;-0.834854;, - -0.145346;0.598582;0.787765;, - -0.307879;0.805978;0.505580;, - -0.402622;0.826286;-0.393887;, - -0.405591;0.657823;-0.634638;, - -0.226397;0.640557;-0.733779;, - -0.227767;0.807947;0.543456;, - -0.281507;0.877647;-0.387931;, - -0.519282;-0.801856;-0.295590;, - 0.628811;0.048486;-0.776045;, - 0.075597;0.061964;-0.995211;, - -0.768733;-0.464430;-0.439722;, - -0.776444;-0.621408;0.104819;, - -0.008636;0.241742;0.970302;, - -0.519681;-0.462756;0.718184;, - -0.392286;-0.395655;0.830403;, - 0.606488;0.362636;0.707578;, - 0.634201;0.590890;0.498637;, - -0.532226;-0.846074;0.029908;, - 0.733299;-0.679627;0.019472;, - 0.395655;-0.688028;0.608338;, - -0.626298;-0.623654;0.467767;, - -0.615564;-0.788001;-0.011651;, - 0.737398;0.614678;-0.280025;, - -0.020657;0.352402;-0.935621;, - -0.283460;-0.739558;-0.610496;, - 0.671011;-0.430239;-0.603853;, - -0.978692;0.134618;-0.155050;, - -0.093467;0.573633;-0.813763;, - -0.077464;0.247205;-0.965862;, - -0.990913;0.025340;-0.132096;, - -0.772378;-0.597866;-0.214449;, - 0.872971;0.472486;-0.121157;, - 0.815150;0.020096;-0.578901;, - -0.017212;-0.667549;0.744367;, - -0.025443;-0.997470;0.066387;, - 0.063832;-0.326004;-0.943211;, - 0.938699;-0.157979;-0.306408;, - 0.658994;-0.420980;0.623300;, - 0.999001;-0.033016;-0.030116;, - 0.005130;0.183809;-0.982949;, - -0.933054;-0.303730;-0.192764;, - 0.991412;0.128365;-0.025012;, - 0.649195;-0.068635;0.757519;, - -0.555420;-0.356113;0.751460;, - -0.937074;-0.338487;0.085549;, - 0.447515;0.045262;-0.893130;, - -0.705682;-0.354669;-0.613370;, - -0.592644;-0.622931;0.510618;, - -0.752771;-0.619673;-0.222128;, - 0.720371;-0.617368;-0.316104;, - -0.683253;-0.627919;-0.372670;, - 0.769514;-0.558111;-0.310419;, - -0.562589;-0.760251;-0.324828;, - -0.204878;-0.344714;-0.916077;, - 0.446447;-0.607871;-0.656642;, - -0.711056;-0.698405;0.081424;, - 0.643951;-0.736522;-0.207031;, - 0.686779;-0.713298;0.139789;, - -0.413593;0.147648;0.898410;, - -0.990075;-0.050814;0.131034;, - 0.321552;-0.282128;0.903885;, - 0.624392;0.208123;0.752874;, - 0.996072;0.072527;0.050800;, - -0.386575;0.167860;-0.906853;, - 0.318836;0.181672;-0.930236;, - -0.965362;0.116386;-0.233516;, - 0.885875;0.093258;-0.454453;, - -0.998737;-0.000577;-0.050239;, - 0.997215;0.069558;-0.026922;, - -0.059927;0.707805;-0.703861;, - 0.750455;0.543429;-0.376168;, - -0.617940;0.665192;-0.419130;, - -0.803206;0.582659;-0.123972;, - 0.704325;0.662368;-0.255334;, - 0.082622;0.499858;-0.862158;, - 0.931934;0.103939;-0.347414;, - -0.027959;0.981500;-0.189407;, - -0.050360;0.933873;-0.354042;, - 0.981209;0.015725;0.192306;, - -0.827387;-0.039311;-0.560255;, - -0.986340;-0.131712;-0.098922;, - -0.787094;-0.082947;0.611231;, - -0.006351;0.094118;0.995541;, - 0.498810;0.079278;0.863078;, - -0.740122;-0.312903;0.595240;, - -0.938230;-0.345002;0.026413;, - -0.993493;0.048503;0.103045;, - -0.673953;0.185181;0.715189;, - -0.108392;-0.207274;0.972260;, - 0.051154;0.195171;0.979434;, - 0.639562;-0.102929;0.761818;, - 0.704736;0.180554;0.686111;, - 0.998869;-0.047538;-0.000576;, - 0.958935;0.173981;-0.223994;, - 0.698266;-0.181001;-0.692577;, - 0.620972;0.089948;-0.778655;, - 0.016398;-0.443063;-0.896341;, - -0.144390;-0.065290;-0.987365;, - -0.728851;-0.441912;-0.522963;, - -0.871827;-0.033825;-0.488645;, - -0.626805;-0.572093;0.528985;, - -0.871386;-0.490489;0.010370;, - -0.076929;-0.452265;0.888559;, - 0.626649;-0.191510;0.755404;, - 0.998179;0.029379;0.052680;, - 0.721135;-0.035727;-0.691873;, - 0.076054;-0.310273;-0.947600;, - -0.686595;-0.525811;-0.502105;, - -0.330716;-0.736732;0.589791;, - -0.000000;-0.999826;-0.018662;, - 0.814386;0.118924;0.568007;, - 0.793032;-0.131439;-0.594831;, - 0.983958;0.171788;0.048122;, - 0.282352;-0.374795;-0.883066;, - -0.000000;-0.704137;-0.710064;, - 0.479848;0.732180;-0.483382;, - 0.372803;0.739708;0.560223;, - 0.661563;0.611093;0.434626;, - 0.699606;0.569916;-0.430984;, - 0.710696;0.422097;0.562801;, - 0.295926;0.387851;0.872926;, - 0.837365;0.545835;0.029727;, - 0.634042;0.611621;-0.473192;, - 0.202625;0.600191;-0.773766;, - 0.000000;0.760465;-0.649379;, - 0.746427;-0.359817;0.559803;, - 0.315278;-0.350053;0.882078;, - 0.925014;-0.373716;0.068452;, - 0.702484;-0.584123;-0.406592;, - 0.277977;-0.495656;-0.822833;, - 0.000000;-0.326323;-0.945258;, - 0.788118;-0.183645;0.587491;, - 0.253204;-0.328259;0.910019;, - 0.953596;-0.298213;-0.041519;, - 0.649818;-0.613601;-0.448587;, - 0.213921;-0.752172;-0.623277;, - 0.000000;-0.760910;-0.648858;, - 0.750713;0.268051;0.603803;, - 0.000000;-0.632247;-0.774767;, - 0.000000;0.293377;0.955997;, - 0.000000;-0.458024;0.888940;, - 0.000000;-0.247527;0.968881;, - -0.000000;-0.929061;0.369927;, - 0.000000;-0.674749;0.738047;, - 0.000000;0.121068;0.992644;, - 0.413319;0.153508;0.897554;, - 0.000000;-0.048684;0.998814;, - 0.333509;-0.199190;0.921464;, - -0.715206;-0.667542;0.207047;, - -0.578980;-0.808463;-0.105693;, - -0.254152;-0.724281;0.640955;, - 0.350123;-0.705733;0.615918;, - 0.521829;-0.685532;0.507681;, - 0.582105;-0.748288;-0.318149;, - 0.259672;-0.758109;-0.598199;, - -0.324676;-0.788502;-0.522351;, - -0.164580;-0.761217;0.627266;, - -0.489043;-0.865249;0.110364;, - 0.147015;-0.759744;0.633384;, - 0.605120;-0.686438;0.403277;, - 0.602435;-0.766434;-0.222825;, - 0.157318;-0.949324;-0.272095;, - -0.166899;-0.916412;-0.363778;, - -0.427237;-0.891048;-0.153303;, - -0.649900;-0.035036;0.759212;, - -0.985761;-0.163298;-0.040116;, - 0.036046;0.034905;0.998740;, - 0.608077;0.178337;0.773588;, - 0.981662;0.163987;0.097203;, - 0.740908;-0.121535;-0.660519;, - -0.006847;-0.316355;-0.948616;, - -0.687977;-0.293549;-0.663714;, - 0.152727;0.197261;0.968381;, - 0.101821;-0.074160;-0.992035;, - 0.114730;0.027382;0.993019;, - -0.400147;-0.785877;0.471465;, - -0.373140;-0.766605;-0.522573;, - 0.346292;-0.166438;-0.923244;, - 0.519780;0.635299;0.571160;, - 0.747186;0.566650;-0.347307;, - -0.236063;0.200824;0.950760;, - -0.838795;-0.373110;0.396500;, - -0.651438;-0.450605;-0.610396;, - -0.031669;0.154102;-0.987547;, - 0.201281;0.810006;0.550796;, - 0.239147;0.872811;-0.425453;, - 0.299406;-0.276504;0.913182;, - -0.090325;-0.956867;0.276130;, - 0.102216;-0.745525;-0.658593;, - 0.569936;-0.148382;-0.808181;, - 0.711459;0.196812;0.674605;, - 0.934562;0.328093;-0.137656;, - 0.670078;-0.315307;0.671995;, - 0.433905;-0.762868;0.479331;, - 0.392697;-0.891971;-0.224004;, - 0.619791;-0.530830;-0.577995;, - 0.937105;-0.010824;0.348879;, - 0.942842;-0.125596;-0.308665;, - 0.179838;-0.052199;0.982310;, - -0.225765;-0.835864;0.500361;, - -0.124005;-0.775689;-0.618813;, - 0.254434;-0.153439;-0.954840;, - 0.632262;0.479231;0.608755;, - 0.779351;0.507865;-0.366995;, - 0.211083;-0.007310;0.977441;, - -0.425351;-0.766520;0.481169;, - -0.099996;-0.506703;-0.856302;, - -0.397481;-0.777098;-0.487983;, - 0.691760;0.435659;0.575908;, - 0.783622;0.512593;-0.350976;, - 0.312687;-0.071199;-0.947184;, - -0.075596;0.061964;-0.995211;, - -0.628811;0.048486;-0.776045;, - 0.519283;-0.801855;-0.295591;, - 0.768732;-0.464431;-0.439721;, - 0.776443;-0.621410;0.104818;, - 0.392286;-0.395655;0.830403;, - 0.519681;-0.462756;0.718184;, - 0.008636;0.241742;0.970302;, - -0.606488;0.362636;0.707579;, - -0.634201;0.590890;0.498637;, - -0.395655;-0.688028;0.608338;, - -0.733299;-0.679627;0.019472;, - 0.532226;-0.846074;0.029908;, - 0.626299;-0.623654;0.467766;, - 0.615564;-0.788001;-0.011651;, - 0.020657;0.352402;-0.935621;, - -0.737398;0.614678;-0.280026;, - -0.671012;-0.430239;-0.603852;, - 0.283460;-0.739558;-0.610496;, - 0.077465;0.247205;-0.965862;, - 0.093468;0.573633;-0.813762;, - 0.978692;0.134617;-0.155050;, - 0.990913;0.025337;-0.132097;, - 0.772378;-0.597866;-0.214449;, - -0.872971;0.472486;-0.121157;, - -0.815150;0.020096;-0.578901;, - 0.017212;-0.667549;0.744367;, - -0.938699;-0.157978;-0.306411;, - -0.063832;-0.326003;-0.943211;, - 0.025442;-0.997470;0.066384;, - -0.658998;-0.420978;0.623297;, - -0.005131;0.183808;-0.982949;, - -0.999001;-0.033016;-0.030117;, - 0.933054;-0.303731;-0.192763;, - -0.991412;0.128365;-0.025011;, - -0.649195;-0.068635;0.757519;, - 0.555420;-0.356114;0.751459;, - 0.937074;-0.338488;0.085548;, - -0.447516;0.045263;-0.893130;, - 0.705682;-0.354669;-0.613370;, - -0.720371;-0.617367;-0.316106;, - 0.752772;-0.619672;-0.222130;, - 0.592644;-0.622930;0.510618;, - -0.769512;-0.558113;-0.310422;, - 0.683253;-0.627918;-0.372671;, - -0.446447;-0.607871;-0.656642;, - 0.204878;-0.344714;-0.916077;, - 0.562588;-0.760251;-0.324828;, - -0.643951;-0.736523;-0.207031;, - 0.711056;-0.698405;0.081424;, - -0.686777;-0.713299;0.139789;, - 0.990075;-0.050814;0.131033;, - 0.413593;0.147648;0.898410;, - -0.624392;0.208124;0.752874;, - -0.321551;-0.282128;0.903885;, - -0.996072;0.072527;0.050799;, - -0.318836;0.181672;-0.930236;, - 0.386574;0.167859;-0.906854;, - 0.965362;0.116386;-0.233516;, - -0.885875;0.093257;-0.454453;, - 0.998737;-0.000577;-0.050239;, - -0.997215;0.069557;-0.026922;, - -0.750455;0.543429;-0.376168;, - 0.059927;0.707805;-0.703862;, - 0.617939;0.665192;-0.419130;, - 0.803206;0.582659;-0.123972;, - -0.704325;0.662368;-0.255334;, - -0.931934;0.103939;-0.347414;, - -0.082622;0.499858;-0.862158;, - 0.050360;0.933873;-0.354042;, - 0.027959;0.981500;-0.189407;, - -0.981209;0.015725;0.192306;, - 0.827387;-0.039311;-0.560255;, - 0.986340;-0.131712;-0.098922;, - 0.787094;-0.082947;0.611231;, - 0.006351;0.094118;0.995541;, - -0.498810;0.079278;0.863078;, - 0.993493;0.048503;0.103045;, - 0.938231;-0.345001;0.026413;, - 0.740122;-0.312902;0.595241;, - 0.673953;0.185182;0.715189;, - 0.108392;-0.207274;0.972260;, - -0.051154;0.195171;0.979434;, - -0.639562;-0.102930;0.761817;, - -0.704736;0.180553;0.686111;, - -0.998869;-0.047539;-0.000576;, - -0.958935;0.173981;-0.223994;, - -0.698266;-0.181001;-0.692577;, - -0.620972;0.089947;-0.778655;, - -0.016398;-0.443063;-0.896341;, - 0.144390;-0.065289;-0.987365;, - 0.728851;-0.441912;-0.522963;, - 0.871827;-0.033824;-0.488645;, - 0.871385;-0.490489;0.010371;, - 0.626805;-0.572093;0.528985;, - 0.076929;-0.452265;0.888559;, - -0.626649;-0.191510;0.755404;, - -0.998179;0.029379;0.052679;, - -0.721134;-0.035727;-0.691873;, - -0.076054;-0.310273;-0.947600;, - 0.686595;-0.525811;-0.502105;, - 0.330715;-0.736732;0.589791;, - -0.814386;0.118924;0.568007;, - -0.983958;0.171789;0.048122;, - -0.793032;-0.131439;-0.594831;, - -0.282352;-0.374795;-0.883067;, - -0.661563;0.611093;0.434626;, - -0.372803;0.739708;0.560223;, - -0.479848;0.732180;-0.483382;, - -0.699606;0.569916;-0.430984;, - -0.710696;0.422097;0.562801;, - -0.295926;0.387851;0.872926;, - -0.837365;0.545835;0.029728;, - -0.634042;0.611621;-0.473192;, - -0.202625;0.600190;-0.773766;, - -0.746426;-0.359818;0.559803;, - -0.315278;-0.350053;0.882078;, - -0.925014;-0.373716;0.068452;, - -0.702484;-0.584123;-0.406592;, - -0.277977;-0.495656;-0.822833;, - -0.788117;-0.183645;0.587491;, - -0.253204;-0.328259;0.910019;, - -0.953596;-0.298213;-0.041519;, - -0.649818;-0.613601;-0.448587;, - -0.213921;-0.752172;-0.623277;, - -0.750713;0.268052;0.603803;, - -0.413319;0.153508;0.897554;, - -0.333508;-0.199190;0.921464;, - 0.715206;-0.667542;0.207047;, - 0.578979;-0.808463;-0.105693;, - 0.254151;-0.724281;0.640956;, - -0.350122;-0.705733;0.615918;, - -0.521829;-0.685532;0.507682;, - -0.582105;-0.748288;-0.318149;, - -0.259672;-0.758109;-0.598199;, - 0.324675;-0.788502;-0.522351;, - 0.164580;-0.761216;0.627266;, - 0.489043;-0.865250;0.110364;, - -0.147015;-0.759744;0.633384;, - -0.605120;-0.686438;0.403277;, - -0.602435;-0.766434;-0.222825;, - -0.157318;-0.949324;-0.272095;, - 0.166899;-0.916412;-0.363778;, - 0.427237;-0.891048;-0.153303;, - 0.649900;-0.035037;0.759212;, - 0.985761;-0.163298;-0.040116;, - -0.036046;0.034905;0.998740;, - -0.608077;0.178337;0.773588;, - -0.981662;0.163987;0.097202;, - -0.740908;-0.121535;-0.660518;, - 0.006847;-0.316355;-0.948616;, - 0.687977;-0.293549;-0.663714;, - -0.152727;0.197261;0.968381;, - -0.101821;-0.074160;-0.992035;, - -0.114730;0.027382;0.993019;, - 0.400147;-0.785877;0.471465;, - 0.373140;-0.766605;-0.522573;, - -0.346292;-0.166438;-0.923244;, - -0.519779;0.635300;0.571160;, - -0.747186;0.566650;-0.347306;, - 0.236063;0.200824;0.950760;, - 0.838795;-0.373110;0.396500;, - 0.651438;-0.450605;-0.610396;, - 0.031669;0.154102;-0.987547;, - -0.201281;0.810006;0.550796;, - -0.239147;0.872811;-0.425453;, - -0.299406;-0.276504;0.913182;, - 0.090326;-0.956866;0.276132;, - -0.102213;-0.745525;-0.658593;, - -0.569935;-0.148383;-0.808181;, - -0.711459;0.196812;0.674605;, - -0.934562;0.328093;-0.137655;, - -0.670077;-0.315307;0.671995;, - -0.433903;-0.762869;0.479331;, - -0.392695;-0.891971;-0.224004;, - -0.619791;-0.530830;-0.577995;, - -0.937105;-0.010824;0.348879;, - -0.942842;-0.125596;-0.308665;, - -0.179838;-0.052199;0.982310;, - 0.225766;-0.835864;0.500361;, - 0.124006;-0.775689;-0.618813;, - -0.254434;-0.153439;-0.954840;, - -0.632263;0.479231;0.608754;, - -0.779351;0.507865;-0.366995;, - -0.211083;-0.007311;0.977441;, - 0.425351;-0.766520;0.481169;, - 0.397482;-0.777098;-0.487983;, - 0.099996;-0.506703;-0.856302;, - -0.691761;0.435659;0.575907;, - -0.783623;0.512593;-0.350976;, - -0.312688;-0.071199;-0.947184;, - -0.158440;0.272260;0.949090;, - -0.826805;0.300613;0.475422;, - -0.818240;-0.572323;0.054124;, - 0.443455;-0.793006;0.417718;, - -0.807686;-0.588428;0.037363;, - 0.478308;-0.856915;0.192140;, - -0.806374;-0.591350;0.008141;, - 0.485289;-0.872612;-0.055172;, - -0.805965;-0.591697;-0.017746;, - 0.466843;-0.842931;-0.267441;, - -0.819948;-0.571396;-0.034540;, - 0.428416;-0.777562;-0.460280;, - -0.815220;-0.575410;-0.065729;, - 0.362499;-0.663593;-0.654400;, - -0.987557;-0.002703;-0.157237;, - -0.465064;0.808835;-0.359864;, - -0.895193;0.296505;0.332738;, - -0.621376;0.321019;-0.714730;, - -0.823363;-0.179475;-0.538388;, - -0.717959;-0.165741;0.676065;, - -0.954361;0.021745;-0.297862;, - -0.870287;-0.492508;0.006093;, - -0.818024;0.006369;0.575148;, - 0.915007;0.400877;0.045386;, - 0.362063;0.859195;0.361516;, - 0.923704;0.382121;0.027477;, - 0.925341;0.379116;-0.003806;, - 0.925113;0.378382;-0.031514;, - 0.914133;0.402378;-0.049520;, - 0.914701;0.395544;-0.082872;, - 0.318704;0.921135;-0.223467;, - 0.592761;0.573307;-0.565644;, - -0.096115;0.933726;-0.344844;, - 0.336545;0.702533;0.627045;, - 0.486292;0.591434;0.643216;, - 0.870287;0.492508;-0.006093;, - 0.516008;0.743904;-0.424667;, - 0.388701;0.765725;0.512422;, - 0.818479;-0.013906;0.574368;, - 0.583881;0.562753;0.585143;, - 0.008591;-0.015184;0.999848;, - 0.871568;0.231819;0.432006;, - 0.448861;0.775548;0.443902;, - 0.779452;0.224370;-0.584904;, - -0.008598;0.015187;-0.999848;, - 0.397356;0.715862;-0.574151;, - 0.576552;-0.587596;0.567732;, - 0.785924;-0.451591;0.422360;, - 0.702038;-0.393393;-0.593620;, - -0.000186;-0.822252;0.569124;, - 0.242090;-0.874344;0.420613;, - 0.210446;-0.775533;-0.595199;, - -0.573887;-0.580416;0.577729;, - -0.441362;-0.788795;0.427788;, - -0.407347;-0.698201;-0.588713;, - -0.808485;-0.003753;0.588505;, - -0.864073;-0.245059;0.439687;, - -0.789452;-0.206700;-0.577963;, - -0.566558;0.569931;0.595139;, - -0.778428;0.438345;0.449336;, - -0.712039;0.411053;-0.569242;, - 0.010185;0.804586;0.593749;, - -0.234597;0.861095;0.451087;, - -0.220443;0.793196;-0.567667;, - 0.663953;0.169591;0.728289;, - 0.343613;0.581657;0.737296;, - 0.636660;0.638950;-0.431748;, - 0.896190;0.001007;-0.443670;, - 0.599051;-0.348328;0.720975;, - 0.628552;-0.633648;-0.451012;, - 0.186915;-0.668706;0.719650;, - -0.009479;-0.893246;-0.449468;, - -0.331041;-0.603875;0.725084;, - -0.644150;-0.625711;-0.439950;, - -0.651388;-0.191809;0.734100;, - -0.903681;0.012237;-0.428031;, - -0.586482;0.326109;0.741412;, - -0.636045;0.646893;-0.420685;, - -0.174343;0.646491;0.742734;, - 0.001989;0.906490;-0.422223;, - 0.864073;0.245061;-0.439686;, - 0.441363;0.788793;-0.427789;, - 0.644155;0.625710;0.439944;, - 0.903685;-0.012232;0.428023;, - 0.778430;-0.438345;-0.449333;, - 0.636046;-0.646894;0.420683;, - 0.234598;-0.861099;-0.451080;, - -0.001986;-0.906489;0.422225;, - -0.448852;-0.775554;-0.443902;, - -0.636655;-0.638956;0.431746;, - -0.871564;-0.231820;-0.432014;, - -0.896188;-0.001007;0.443673;, - -0.785920;0.451591;-0.422368;, - -0.628551;0.633646;0.451017;, - -0.242090;0.874344;-0.420613;, - 0.009483;0.893244;0.449471;, - 0.479045;0.490319;-0.728082;, - 0.675735;0.006858;-0.737113;, - 0.472902;-0.474122;-0.742679;, - -0.010626;-0.670850;-0.741517;, - -0.491614;-0.468095;-0.734304;, - -0.688295;0.015361;-0.725268;, - -0.485460;0.496332;-0.719711;, - -0.001936;0.693063;-0.720874;, - 0.651394;0.191812;-0.734094;, - 0.331038;0.603871;-0.725089;, - 0.491611;0.468102;0.734302;, - 0.688292;-0.015363;0.725271;, - 0.586489;-0.326107;-0.741407;, - 0.485471;-0.496336;0.719700;, - 0.174344;-0.646489;-0.742736;, - 0.001936;-0.693068;0.720870;, - -0.343609;-0.581653;-0.737301;, - -0.479044;-0.490321;0.728081;, - -0.663957;-0.169592;-0.728286;, - -0.675725;-0.006857;0.737122;, - -0.599047;0.348320;-0.720982;, - -0.472901;0.474118;0.742682;, - -0.186907;0.668699;-0.719658;, - 0.010630;0.670854;0.741513;; - 1896; - 3;0,1,2;, - 3;3,0,2;, - 3;4,0,3;, - 3;5,4,3;, - 3;6,4,5;, - 3;7,6,5;, - 3;8,9,10;, - 3;11,8,10;, - 3;12,8,11;, - 3;13,12,11;, - 3;14,12,13;, - 3;15,14,13;, - 3;9,1,16;, - 3;10,9,16;, - 3;17,3,2;, - 3;18,17,2;, - 3;10,16,19;, - 3;11,10,19;, - 3;20,5,3;, - 3;17,20,3;, - 3;11,19,21;, - 3;13,11,21;, - 3;22,7,5;, - 3;20,22,5;, - 3;14,6,7;, - 3;22,14,7;, - 3;13,21,23;, - 3;15,13,23;, - 3;19,16,1;, - 3;0,19,1;, - 3;21,19,0;, - 3;4,21,0;, - 3;23,21,4;, - 3;6,23,4;, - 3;17,18,9;, - 3;8,17,9;, - 3;20,17,8;, - 3;12,20,8;, - 3;22,20,12;, - 3;14,22,12;, - 3;18,2,1;, - 3;9,18,1;, - 3;15,23,6;, - 3;14,15,6;, - 3;24,25,26;, - 3;24,26,27;, - 3;27,26,28;, - 3;27,28,29;, - 3;29,28,30;, - 3;29,30,31;, - 3;32,33,34;, - 3;32,34,35;, - 3;35,34,36;, - 3;35,36,37;, - 3;37,36,38;, - 3;37,38,39;, - 3;40,25,33;, - 3;40,33,32;, - 3;24,27,41;, - 3;24,41,42;, - 3;43,40,32;, - 3;43,32,35;, - 3;27,29,44;, - 3;27,44,41;, - 3;45,43,35;, - 3;45,35,37;, - 3;29,31,46;, - 3;29,46,44;, - 3;31,30,38;, - 3;31,38,46;, - 3;47,45,37;, - 3;47,37,39;, - 3;25,40,43;, - 3;25,43,26;, - 3;26,43,45;, - 3;26,45,28;, - 3;28,45,47;, - 3;28,47,30;, - 3;33,42,41;, - 3;33,41,34;, - 3;34,41,44;, - 3;34,44,36;, - 3;36,44,46;, - 3;36,46,38;, - 3;25,24,42;, - 3;25,42,33;, - 3;30,47,39;, - 3;30,39,38;, - 3;48,49,50;, - 3;51,48,50;, - 3;52,53,54;, - 3;55,52,54;, - 3;56,57,58;, - 3;59,57,56;, - 3;57,60,61;, - 3;62,60,57;, - 3;59,62,57;, - 3;63,64,65;, - 3;65,60,62;, - 3;64,60,65;, - 3;66,63,65;, - 3;67,66,65;, - 3;61,68,58;, - 3;67,65,62;, - 3;69,67,62;, - 3;70,66,67;, - 3;71,70,67;, - 3;67,69,72;, - 3;71,67,72;, - 3;73,74,75;, - 3;76,73,75;, - 3;62,77,69;, - 3;78,79,68;, - 3;61,78,68;, - 3;80,78,61;, - 3;60,80,61;, - 3;64,81,80;, - 3;71,72,82;, - 3;70,71,82;, - 3;83,84,82;, - 3;72,83,82;, - 3;72,69,73;, - 3;76,72,73;, - 3;69,77,74;, - 3;73,69,74;, - 3;85,86,87;, - 3;88,85,87;, - 3;86,83,75;, - 3;87,86,75;, - 3;59,56,89;, - 3;85,59,89;, - 3;85,89,90;, - 3;86,85,90;, - 3;89,56,58;, - 3;91,89,58;, - 3;90,89,91;, - 3;92,90,91;, - 3;74,88,87;, - 3;75,74,87;, - 3;59,85,77;, - 3;62,59,77;, - 3;84,83,86;, - 3;77,85,88;, - 3;74,77,88;, - 3;83,72,76;, - 3;75,83,76;, - 3;91,58,68;, - 3;93,91,68;, - 3;92,91,93;, - 3;94,92,93;, - 3;79,95,96;, - 3;68,79,96;, - 3;68,96,97;, - 3;93,68,97;, - 3;93,97,94;, - 3;61,58,57;, - 3;98,99,100;, - 3;101,98,100;, - 3;102,98,101;, - 3;103,102,101;, - 3;104,105,106;, - 3;107,104,106;, - 3;105,108,109;, - 3;106,105,109;, - 3;108,110,109;, - 3;100,99,111;, - 3;109,110,112;, - 3;113,109,112;, - 3;104,82,84;, - 3;105,104,84;, - 3;106,98,102;, - 3;107,106,102;, - 3;105,84,86;, - 3;108,105,86;, - 3;109,99,98;, - 3;106,109,98;, - 3;108,86,90;, - 3;110,108,90;, - 3;110,90,92;, - 3;112,110,92;, - 3;113,111,99;, - 3;109,113,99;, - 3;114,112,92;, - 3;115,114,92;, - 3;116,113,112;, - 3;114,116,112;, - 3;117,111,113;, - 3;116,117,113;, - 3;92,94,115;, - 3;111,117,118;, - 3;119,111,118;, - 3;100,111,119;, - 3;101,100,119;, - 3;103,101,119;, - 3;120,103,119;, - 3;117,116,121;, - 3;118,117,121;, - 3;122,120,119;, - 3;123,122,119;, - 3;124,122,123;, - 3;125,124,123;, - 3;119,118,123;, - 3;126,123,118;, - 3;121,126,118;, - 3;125,123,126;, - 3;114,115,127;, - 3;116,114,127;, - 3;121,116,127;, - 3;128,121,127;, - 3;126,121,128;, - 3;129,126,128;, - 3;125,126,129;, - 3;130,125,129;, - 3;131,128,132;, - 3;133,131,132;, - 3;134,129,128;, - 3;131,134,128;, - 3;135,130,129;, - 3;134,135,129;, - 3;133,132,130;, - 3;135,133,130;, - 3;127,132,128;, - 3;127,115,94;, - 3;136,127,94;, - 3;95,55,54;, - 3;96,95,54;, - 3;96,54,137;, - 3;97,96,137;, - 3;97,137,136;, - 3;94,97,136;, - 3;138,131,133;, - 3;139,138,133;, - 3;140,134,131;, - 3;138,140,131;, - 3;141,135,134;, - 3;140,141,134;, - 3;139,133,135;, - 3;141,139,135;, - 3;142,138,139;, - 3;143,142,139;, - 3;144,140,138;, - 3;142,144,138;, - 3;145,141,140;, - 3;144,145,140;, - 3;143,139,141;, - 3;145,143,141;, - 3;146,142,143;, - 3;147,146,143;, - 3;148,144,142;, - 3;146,148,142;, - 3;149,145,144;, - 3;148,149,144;, - 3;147,143,145;, - 3;149,147,145;, - 3;150,146,147;, - 3;150,148,146;, - 3;150,149,148;, - 3;150,147,149;, - 3;50,49,151;, - 3;152,50,151;, - 3;153,154,137;, - 3;54,153,137;, - 3;153,53,48;, - 3;51,153,48;, - 3;51,50,155;, - 3;156,51,155;, - 3;156,154,51;, - 3;136,137,157;, - 3;158,136,157;, - 3;127,136,158;, - 3;50,152,155;, - 3;156,155,159;, - 3;160,156,159;, - 3;157,156,160;, - 3;161,157,160;, - 3;158,157,161;, - 3;162,158,161;, - 3;127,158,162;, - 3;163,127,162;, - 3;132,127,163;, - 3;53,52,48;, - 3;154,153,51;, - 3;53,153,54;, - 3;157,137,154;, - 3;156,157,154;, - 3;164,151,49;, - 3;165,164,49;, - 3;165,49,48;, - 3;166,165,48;, - 3;166,48,52;, - 3;167,166,52;, - 3;167,52,55;, - 3;168,167,55;, - 3;168,55,95;, - 3;169,168,95;, - 3;169,95,79;, - 3;170,169,79;, - 3;170,79,78;, - 3;171,170,78;, - 3;171,78,80;, - 3;172,171,80;, - 3;172,80,81;, - 3;173,172,81;, - 3;174,164,165;, - 3;175,174,165;, - 3;175,165,166;, - 3;176,175,166;, - 3;176,166,167;, - 3;177,176,167;, - 3;177,167,168;, - 3;178,177,168;, - 3;178,168,169;, - 3;179,178,169;, - 3;179,169,170;, - 3;180,179,170;, - 3;180,170,171;, - 3;181,180,171;, - 3;181,171,172;, - 3;182,181,172;, - 3;182,172,173;, - 3;183,182,173;, - 3;184,174,175;, - 3;185,184,175;, - 3;185,175,176;, - 3;186,185,176;, - 3;186,176,177;, - 3;187,186,177;, - 3;187,177,178;, - 3;188,187,178;, - 3;188,178,179;, - 3;189,188,179;, - 3;189,179,180;, - 3;190,189,180;, - 3;190,180,181;, - 3;191,190,181;, - 3;191,181,182;, - 3;192,191,182;, - 3;192,182,183;, - 3;193,192,183;, - 3;194,184,185;, - 3;195,194,185;, - 3;195,185,186;, - 3;196,195,186;, - 3;196,186,187;, - 3;197,196,187;, - 3;197,187,188;, - 3;198,197,188;, - 3;198,188,189;, - 3;199,198,189;, - 3;199,189,190;, - 3;200,199,190;, - 3;200,190,191;, - 3;201,200,191;, - 3;201,191,192;, - 3;202,201,192;, - 3;202,192,193;, - 3;203,202,193;, - 3;204,194,195;, - 3;204,195,196;, - 3;204,196,197;, - 3;204,197,198;, - 3;204,198,199;, - 3;204,199,200;, - 3;204,200,201;, - 3;204,201,202;, - 3;204,202,203;, - 3;80,60,64;, - 3;205,206,207;, - 3;208,205,207;, - 3;209,210,211;, - 3;212,209,211;, - 3;213,214,215;, - 3;215,214,216;, - 3;217,218,214;, - 3;218,219,216;, - 3;214,218,216;, - 3;220,64,63;, - 3;219,218,220;, - 3;220,218,64;, - 3;63,66,221;, - 3;220,63,221;, - 3;213,222,217;, - 3;220,221,223;, - 3;219,220,223;, - 3;66,70,224;, - 3;221,66,224;, - 3;223,221,224;, - 3;225,223,224;, - 3;226,227,228;, - 3;229,226,228;, - 3;223,230,219;, - 3;231,232,217;, - 3;222,231,217;, - 3;232,233,218;, - 3;217,232,218;, - 3;233,81,64;, - 3;82,225,224;, - 3;82,224,70;, - 3;234,235,225;, - 3;82,234,225;, - 3;223,225,228;, - 3;227,223,228;, - 3;230,223,227;, - 3;226,230,227;, - 3;236,237,238;, - 3;239,236,238;, - 3;235,236,239;, - 3;229,235,239;, - 3;215,216,237;, - 3;240,215,237;, - 3;240,237,236;, - 3;241,240,236;, - 3;215,240,242;, - 3;213,215,242;, - 3;240,241,243;, - 3;242,240,243;, - 3;238,226,229;, - 3;239,238,229;, - 3;230,237,216;, - 3;230,216,219;, - 3;236,235,234;, - 3;237,230,226;, - 3;238,237,226;, - 3;225,235,229;, - 3;228,225,229;, - 3;213,242,244;, - 3;222,213,244;, - 3;242,243,245;, - 3;244,242,245;, - 3;246,231,222;, - 3;247,246,222;, - 3;247,222,244;, - 3;248,247,244;, - 3;245,248,244;, - 3;214,213,217;, - 3;249,250,251;, - 3;252,249,251;, - 3;250,102,103;, - 3;251,250,103;, - 3;253,104,107;, - 3;254,253,107;, - 3;255,253,254;, - 3;256,255,254;, - 3;256,257,255;, - 3;258,249,252;, - 3;257,256,259;, - 3;260,257,259;, - 3;82,104,253;, - 3;234,82,253;, - 3;250,254,107;, - 3;102,250,107;, - 3;234,253,255;, - 3;236,234,255;, - 3;249,256,254;, - 3;250,249,254;, - 3;236,255,257;, - 3;241,236,257;, - 3;241,257,260;, - 3;243,241,260;, - 3;258,259,256;, - 3;249,258,256;, - 3;260,261,262;, - 3;243,260,262;, - 3;259,263,261;, - 3;260,259,261;, - 3;258,264,263;, - 3;259,258,263;, - 3;262,245,243;, - 3;264,258,265;, - 3;266,264,265;, - 3;265,258,252;, - 3;265,252,251;, - 3;251,103,120;, - 3;265,251,120;, - 3;267,263,264;, - 3;267,264,266;, - 3;120,122,268;, - 3;265,120,268;, - 3;122,124,269;, - 3;268,122,269;, - 3;268,266,265;, - 3;268,270,267;, - 3;266,268,267;, - 3;270,268,269;, - 3;271,262,261;, - 3;261,263,267;, - 3;271,261,267;, - 3;271,267,272;, - 3;267,270,273;, - 3;272,267,273;, - 3;270,269,274;, - 3;273,270,274;, - 3;272,275,276;, - 3;277,272,276;, - 3;273,278,275;, - 3;272,273,275;, - 3;274,279,278;, - 3;273,274,278;, - 3;277,276,279;, - 3;274,277,279;, - 3;272,277,271;, - 3;271,280,245;, - 3;245,262,271;, - 3;211,246,247;, - 3;212,211,247;, - 3;212,247,248;, - 3;281,212,248;, - 3;281,248,245;, - 3;280,281,245;, - 3;275,282,283;, - 3;276,275,283;, - 3;278,284,282;, - 3;275,278,282;, - 3;279,285,284;, - 3;278,279,284;, - 3;276,283,285;, - 3;279,276,285;, - 3;282,286,287;, - 3;283,282,287;, - 3;284,288,286;, - 3;282,284,286;, - 3;285,289,288;, - 3;284,285,288;, - 3;283,287,289;, - 3;285,283,289;, - 3;286,290,291;, - 3;287,286,291;, - 3;288,292,290;, - 3;286,288,290;, - 3;289,293,292;, - 3;288,289,292;, - 3;287,291,293;, - 3;289,287,293;, - 3;291,290,294;, - 3;290,292,294;, - 3;292,293,294;, - 3;293,291,294;, - 3;205,208,152;, - 3;151,205,152;, - 3;295,296,212;, - 3;281,295,212;, - 3;209,296,207;, - 3;206,209,207;, - 3;208,207,297;, - 3;155,208,297;, - 3;207,295,297;, - 3;281,280,298;, - 3;299,281,298;, - 3;298,280,271;, - 3;155,152,208;, - 3;155,297,300;, - 3;159,155,300;, - 3;297,299,301;, - 3;300,297,301;, - 3;299,298,302;, - 3;301,299,302;, - 3;302,298,271;, - 3;302,271,303;, - 3;303,271,277;, - 3;206,210,209;, - 3;207,296,295;, - 3;212,296,209;, - 3;295,281,299;, - 3;295,299,297;, - 3;151,164,304;, - 3;205,151,304;, - 3;205,304,305;, - 3;206,205,305;, - 3;206,305,306;, - 3;210,206,306;, - 3;210,306,307;, - 3;211,210,307;, - 3;211,307,308;, - 3;246,211,308;, - 3;246,308,309;, - 3;231,246,309;, - 3;231,309,310;, - 3;232,231,310;, - 3;232,310,311;, - 3;233,232,311;, - 3;233,311,173;, - 3;81,233,173;, - 3;164,174,312;, - 3;304,164,312;, - 3;304,312,313;, - 3;305,304,313;, - 3;305,313,314;, - 3;306,305,314;, - 3;306,314,315;, - 3;307,306,315;, - 3;307,315,316;, - 3;308,307,316;, - 3;308,316,317;, - 3;309,308,317;, - 3;309,317,318;, - 3;310,309,318;, - 3;310,318,319;, - 3;311,310,319;, - 3;311,319,183;, - 3;173,311,183;, - 3;174,184,320;, - 3;312,174,320;, - 3;312,320,321;, - 3;313,312,321;, - 3;313,321,322;, - 3;314,313,322;, - 3;314,322,323;, - 3;315,314,323;, - 3;315,323,324;, - 3;316,315,324;, - 3;316,324,325;, - 3;317,316,325;, - 3;317,325,326;, - 3;318,317,326;, - 3;318,326,327;, - 3;319,318,327;, - 3;319,327,193;, - 3;183,319,193;, - 3;184,194,328;, - 3;320,184,328;, - 3;320,328,329;, - 3;321,320,329;, - 3;321,329,330;, - 3;322,321,330;, - 3;322,330,331;, - 3;323,322,331;, - 3;323,331,332;, - 3;324,323,332;, - 3;324,332,333;, - 3;325,324,333;, - 3;325,333,334;, - 3;326,325,334;, - 3;326,334,335;, - 3;327,326,335;, - 3;327,335,203;, - 3;193,327,203;, - 3;328,194,204;, - 3;329,328,204;, - 3;330,329,204;, - 3;331,330,204;, - 3;332,331,204;, - 3;333,332,204;, - 3;334,333,204;, - 3;335,334,204;, - 3;203,335,204;, - 3;64,218,233;, - 3;336,337,338;, - 3;339,336,338;, - 3;336,340,337;, - 3;341,336,339;, - 3;342,341,339;, - 3;341,340,336;, - 3;343,341,342;, - 3;344,343,342;, - 3;343,340,341;, - 3;345,343,344;, - 3;346,345,344;, - 3;345,340,343;, - 3;347,345,346;, - 3;348,347,346;, - 3;347,340,345;, - 3;337,347,348;, - 3;338,337,348;, - 3;337,340,347;, - 3;349,350,351;, - 3;352,349,351;, - 3;353,349,352;, - 3;354,353,352;, - 3;355,353,354;, - 3;356,355,354;, - 3;357,355,356;, - 3;358,357,356;, - 3;359,357,358;, - 3;360,359,358;, - 3;350,359,360;, - 3;351,350,360;, - 3;361,350,349;, - 3;362,361,349;, - 3;362,349,353;, - 3;363,362,353;, - 3;363,353,355;, - 3;364,363,355;, - 3;364,355,357;, - 3;365,364,357;, - 3;365,357,359;, - 3;366,365,359;, - 3;366,359,350;, - 3;361,366,350;, - 3;367,361,362;, - 3;368,367,362;, - 3;368,362,363;, - 3;369,368,363;, - 3;369,363,364;, - 3;370,369,364;, - 3;370,364,365;, - 3;371,370,365;, - 3;371,365,366;, - 3;372,371,366;, - 3;372,366,361;, - 3;367,372,361;, - 3;373,367,368;, - 3;373,368,369;, - 3;373,369,370;, - 3;373,370,371;, - 3;373,371,372;, - 3;373,372,367;, - 3;374,375,376;, - 3;374,376,377;, - 3;377,376,378;, - 3;377,378,379;, - 3;379,378,380;, - 3;379,380,381;, - 3;381,380,382;, - 3;381,382,383;, - 3;383,382,384;, - 3;383,384,385;, - 3;385,384,375;, - 3;385,375,374;, - 3;376,375,386;, - 3;376,386,387;, - 3;378,376,387;, - 3;378,387,388;, - 3;380,378,388;, - 3;380,388,389;, - 3;382,380,389;, - 3;382,389,390;, - 3;384,382,390;, - 3;384,390,391;, - 3;375,384,391;, - 3;375,391,386;, - 3;387,386,392;, - 3;387,392,393;, - 3;388,387,393;, - 3;388,393,394;, - 3;389,388,394;, - 3;389,394,395;, - 3;390,389,395;, - 3;390,395,396;, - 3;391,390,396;, - 3;391,396,397;, - 3;386,391,397;, - 3;386,397,392;, - 3;393,392,398;, - 3;394,393,398;, - 3;395,394,398;, - 3;396,395,398;, - 3;397,396,398;, - 3;392,397,398;, - 3;399,400,401;, - 3;402,399,401;, - 3;403,404,405;, - 3;406,399,402;, - 3;407,406,402;, - 3;408,404,403;, - 3;409,406,407;, - 3;410,409,407;, - 3;411,404,408;, - 3;412,409,410;, - 3;413,412,410;, - 3;414,404,411;, - 3;415,416,412;, - 3;413,415,412;, - 3;417,418,400;, - 3;399,417,400;, - 3;419,420,406;, - 3;409,419,406;, - 3;421,419,409;, - 3;412,421,409;, - 3;416,422,421;, - 3;412,416,421;, - 3;423,424,418;, - 3;417,423,418;, - 3;425,426,420;, - 3;419,425,420;, - 3;427,425,419;, - 3;421,427,419;, - 3;428,429,424;, - 3;405,428,424;, - 3;405,424,423;, - 3;403,405,423;, - 3;403,423,426;, - 3;408,403,426;, - 3;408,426,425;, - 3;411,408,425;, - 3;411,425,427;, - 3;414,411,427;, - 3;401,400,430;, - 3;431,401,430;, - 3;404,428,405;, - 3;432,404,414;, - 3;400,418,433;, - 3;430,400,433;, - 3;418,424,429;, - 3;433,418,429;, - 3;434,432,414;, - 3;427,434,414;, - 3;422,434,427;, - 3;421,422,427;, - 3;435,423,417;, - 3;436,426,423;, - 3;435,436,423;, - 3;437,438,439;, - 3;437,439,440;, - 3;441,404,442;, - 3;440,439,443;, - 3;440,443,444;, - 3;442,404,445;, - 3;444,443,446;, - 3;444,446,447;, - 3;445,404,448;, - 3;447,446,449;, - 3;447,449,450;, - 3;448,404,451;, - 3;449,416,415;, - 3;449,415,450;, - 3;438,452,453;, - 3;438,453,439;, - 3;443,454,455;, - 3;443,455,446;, - 3;446,455,456;, - 3;446,456,449;, - 3;456,422,416;, - 3;456,416,449;, - 3;452,457,458;, - 3;452,458,453;, - 3;454,459,460;, - 3;454,460,455;, - 3;455,460,461;, - 3;455,461,456;, - 3;457,429,428;, - 3;457,428,441;, - 3;458,457,441;, - 3;458,441,442;, - 3;459,458,442;, - 3;459,442,445;, - 3;460,459,445;, - 3;460,445,448;, - 3;461,460,448;, - 3;461,448,451;, - 3;430,438,437;, - 3;430,437,431;, - 3;441,428,404;, - 3;451,404,432;, - 3;433,452,438;, - 3;433,438,430;, - 3;429,457,452;, - 3;429,452,433;, - 3;451,432,434;, - 3;451,434,461;, - 3;461,434,422;, - 3;461,422,456;, - 3;453,458,462;, - 3;458,459,463;, - 3;458,463,462;, - 3;463,459,454;, - 3;464,465,466;, - 3;467,464,466;, - 3;468,464,467;, - 3;469,470,471;, - 3;472,469,471;, - 3;472,473,469;, - 3;474,475,476;, - 3;477,474,476;, - 3;471,470,478;, - 3;468,471,478;, - 3;479,465,480;, - 3;481,482,475;, - 3;474,481,475;, - 3;483,484,485;, - 3;486,483,485;, - 3;478,487,464;, - 3;468,478,464;, - 3;488,466,465;, - 3;479,488,465;, - 3;484,489,485;, - 3;483,487,480;, - 3;487,490,464;, - 3;490,489,465;, - 3;464,490,465;, - 3;480,465,489;, - 3;484,480,489;, - 3;483,486,490;, - 3;487,483,490;, - 3;491,492,493;, - 3;494,491,493;, - 3;495,496,485;, - 3;489,495,485;, - 3;496,497,486;, - 3;485,496,486;, - 3;486,497,490;, - 3;490,495,489;, - 3;493,492,496;, - 3;495,493,496;, - 3;492,491,497;, - 3;496,492,497;, - 3;491,494,490;, - 3;497,491,490;, - 3;494,493,495;, - 3;490,494,495;, - 3;498,488,472;, - 3;499,498,472;, - 3;500,471,468;, - 3;501,500,468;, - 3;499,472,471;, - 3;500,499,471;, - 3;502,466,488;, - 3;498,502,488;, - 3;503,467,466;, - 3;502,503,466;, - 3;501,468,467;, - 3;503,501,467;, - 3;475,498,499;, - 3;476,475,499;, - 3;477,500,501;, - 3;474,477,501;, - 3;476,499,500;, - 3;477,476,500;, - 3;482,502,498;, - 3;475,482,498;, - 3;481,503,502;, - 3;482,481,502;, - 3;474,501,503;, - 3;481,474,503;, - 3;504,505,506;, - 3;507,508,506;, - 3;509,510,511;, - 3;512,509,513;, - 3;507,512,514;, - 3;504,515,516;, - 3;517,518,515;, - 3;506,519,518;, - 3;506,508,519;, - 3;507,505,516;, - 3;510,520,521;, - 3;509,522,520;, - 3;511,521,523;, - 3;512,524,522;, - 3;513,523,525;, - 3;507,516,524;, - 3;514,525,519;, - 3;521,526,527;, - 3;522,528,520;, - 3;529,528,522;, - 3;527,530,525;, - 3;521,527,523;, - 3;530,531,532;, - 3;533,534,530;, - 3;532,535,519;, - 3;530,532,525;, - 3;524,536,529;, - 3;537,536,524;, - 3;538,537,516;, - 3;515,539,538;, - 3;535,540,518;, - 3;529,536,531;, - 3;541,542,543;, - 3;544,541,543;, - 3;545,541,544;, - 3;546,545,544;, - 3;547,545,546;, - 3;548,547,546;, - 3;549,547,548;, - 3;550,549,548;, - 3;551,549,550;, - 3;552,551,550;, - 3;553,551,552;, - 3;554,553,552;, - 3;555,553,554;, - 3;556,555,554;, - 3;542,555,556;, - 3;543,542,556;, - 3;557,558,542;, - 3;541,557,542;, - 3;559,557,541;, - 3;545,559,541;, - 3;560,559,545;, - 3;547,560,545;, - 3;561,560,547;, - 3;549,561,547;, - 3;562,561,549;, - 3;551,562,549;, - 3;563,562,551;, - 3;553,563,551;, - 3;564,563,553;, - 3;555,564,553;, - 3;558,564,555;, - 3;542,558,555;, - 3;565,566,558;, - 3;557,565,558;, - 3;561,567,560;, - 3;568,569,561;, - 3;562,568,561;, - 3;570,568,562;, - 3;563,570,562;, - 3;571,570,563;, - 3;566,571,564;, - 3;558,566,564;, - 3;572,573,574;, - 3;575,572,574;, - 3;436,435,573;, - 3;572,436,573;, - 3;576,402,401;, - 3;577,576,401;, - 3;578,407,402;, - 3;576,578,402;, - 3;579,410,407;, - 3;578,579,407;, - 3;580,413,410;, - 3;579,580,410;, - 3;581,415,413;, - 3;580,581,413;, - 3;582,576,577;, - 3;583,582,577;, - 3;584,578,576;, - 3;582,584,576;, - 3;585,579,578;, - 3;584,585,578;, - 3;586,580,579;, - 3;585,586,579;, - 3;587,581,580;, - 3;586,587,580;, - 3;588,582,583;, - 3;589,588,583;, - 3;590,584,582;, - 3;588,590,582;, - 3;591,585,584;, - 3;590,591,584;, - 3;592,586,585;, - 3;591,592,585;, - 3;593,587,586;, - 3;592,593,586;, - 3;569,590,588;, - 3;594,569,588;, - 3;568,591,590;, - 3;569,568,590;, - 3;570,592,591;, - 3;568,570,591;, - 3;595,593,592;, - 3;570,595,592;, - 3;571,595,570;, - 3;577,401,431;, - 3;596,577,431;, - 3;583,577,596;, - 3;597,583,596;, - 3;589,583,597;, - 3;598,589,597;, - 3;566,565,599;, - 3;599,565,600;, - 3;589,598,601;, - 3;602,589,601;, - 3;588,589,602;, - 3;594,588,602;, - 3;557,559,565;, - 3;602,601,603;, - 3;604,602,603;, - 3;569,594,567;, - 3;561,569,567;, - 3;594,602,604;, - 3;567,594,604;, - 3;560,567,604;, - 3;559,604,565;, - 3;604,603,600;, - 3;605,544,543;, - 3;606,605,543;, - 3;607,546,544;, - 3;605,607,544;, - 3;608,548,546;, - 3;607,608,546;, - 3;609,550,548;, - 3;608,609,548;, - 3;610,552,550;, - 3;609,610,550;, - 3;611,554,552;, - 3;610,611,552;, - 3;612,556,554;, - 3;611,612,554;, - 3;606,543,556;, - 3;612,606,556;, - 3;613,605,606;, - 3;614,613,606;, - 3;615,607,605;, - 3;613,615,605;, - 3;616,608,607;, - 3;615,616,607;, - 3;617,609,608;, - 3;616,617,608;, - 3;618,610,609;, - 3;617,618,609;, - 3;619,611,610;, - 3;618,619,610;, - 3;620,612,611;, - 3;619,620,611;, - 3;614,606,612;, - 3;620,614,612;, - 3;621,613,614;, - 3;622,621,614;, - 3;623,615,613;, - 3;621,623,613;, - 3;624,616,615;, - 3;623,624,615;, - 3;625,617,616;, - 3;624,625,616;, - 3;626,618,617;, - 3;625,626,617;, - 3;627,619,618;, - 3;626,627,618;, - 3;628,620,619;, - 3;627,628,619;, - 3;622,614,620;, - 3;628,622,620;, - 3;538,621,622;, - 3;539,623,621;, - 3;540,624,623;, - 3;535,625,624;, - 3;532,626,625;, - 3;531,627,626;, - 3;536,628,627;, - 3;537,622,628;, - 3;564,571,563;, - 3;565,604,600;, - 3;533,526,528;, - 3;518,540,539;, - 3;515,518,539;, - 3;531,534,529;, - 3;520,528,526;, - 3;521,520,526;, - 3;534,533,529;, - 3;526,533,527;, - 3;531,530,534;, - 3;517,504,506;, - 3;505,507,506;, - 3;513,509,511;, - 3;514,512,513;, - 3;508,507,514;, - 3;505,504,516;, - 3;504,517,515;, - 3;517,506,518;, - 3;511,510,521;, - 3;510,509,520;, - 3;513,511,523;, - 3;509,512,522;, - 3;514,513,525;, - 3;512,507,524;, - 3;508,514,519;, - 3;524,529,522;, - 3;523,527,525;, - 3;527,533,530;, - 3;525,532,519;, - 3;516,537,524;, - 3;515,538,516;, - 3;519,535,518;, - 3;537,538,622;, - 3;538,539,621;, - 3;539,540,623;, - 3;540,535,624;, - 3;535,532,625;, - 3;532,531,626;, - 3;531,536,627;, - 3;536,537,628;, - 3;529,533,528;, - 3;604,559,560;, - 3;573,629,574;, - 3;420,630,406;, - 3;573,435,417;, - 3;436,572,420;, - 3;417,399,629;, - 3;573,417,629;, - 3;572,575,630;, - 3;420,572,630;, - 3;631,629,399;, - 3;632,631,399;, - 3;633,406,630;, - 3;634,633,630;, - 3;632,399,406;, - 3;633,632,406;, - 3;635,574,629;, - 3;631,635,629;, - 3;636,575,574;, - 3;635,636,574;, - 3;634,630,575;, - 3;636,634,575;, - 3;637,631,632;, - 3;638,637,632;, - 3;639,633,634;, - 3;640,639,634;, - 3;638,632,633;, - 3;639,638,633;, - 3;641,635,631;, - 3;637,641,631;, - 3;642,636,635;, - 3;641,642,635;, - 3;640,634,636;, - 3;642,640,636;, - 3;643,637,638;, - 3;644,643,638;, - 3;645,639,640;, - 3;646,645,640;, - 3;644,638,639;, - 3;645,644,639;, - 3;647,641,637;, - 3;643,647,637;, - 3;648,642,641;, - 3;647,648,641;, - 3;646,640,642;, - 3;648,646,642;, - 3;649,643,644;, - 3;650,649,644;, - 3;651,645,646;, - 3;652,651,646;, - 3;650,644,645;, - 3;651,650,645;, - 3;653,647,643;, - 3;649,653,643;, - 3;654,648,647;, - 3;653,654,647;, - 3;652,646,648;, - 3;654,652,648;, - 3;655,649,650;, - 3;656,655,650;, - 3;657,651,652;, - 3;658,657,652;, - 3;656,650,651;, - 3;657,656,651;, - 3;659,653,649;, - 3;655,659,649;, - 3;660,654,653;, - 3;659,660,653;, - 3;658,652,654;, - 3;660,658,654;, - 3;661,655,656;, - 3;662,661,656;, - 3;657,663,664;, - 3;662,656,657;, - 3;664,662,657;, - 3;665,659,655;, - 3;661,665,655;, - 3;666,660,659;, - 3;665,666,659;, - 3;667,658,660;, - 3;666,667,660;, - 3;469,661,662;, - 3;470,469,662;, - 3;480,663,667;, - 3;662,478,470;, - 3;473,665,661;, - 3;469,473,661;, - 3;479,666,665;, - 3;473,479,665;, - 3;480,667,666;, - 3;479,480,666;, - 3;420,426,436;, - 3;488,479,473;, - 3;472,488,473;, - 3;658,667,663;, - 3;657,658,663;, - 3;487,664,663;, - 3;480,487,663;, - 3;664,487,478;, - 3;662,664,478;, - 3;484,483,480;, - 3;668,669,670;, - 3;668,670,671;, - 3;671,670,672;, - 3;673,674,675;, - 3;673,675,676;, - 3;675,677,676;, - 3;678,679,680;, - 3;678,680,681;, - 3;682,674,673;, - 3;682,673,672;, - 3;683,669,684;, - 3;679,685,686;, - 3;679,686,680;, - 3;687,688,689;, - 3;687,689,690;, - 3;670,691,682;, - 3;670,682,672;, - 3;669,668,692;, - 3;669,692,684;, - 3;687,693,688;, - 3;683,691,689;, - 3;670,694,691;, - 3;669,693,694;, - 3;669,694,670;, - 3;693,669,683;, - 3;693,683,688;, - 3;694,690,689;, - 3;694,689,691;, - 3;695,696,697;, - 3;695,697,698;, - 3;687,699,700;, - 3;687,700,693;, - 3;690,701,699;, - 3;690,699,687;, - 3;694,701,690;, - 3;693,700,694;, - 3;699,696,695;, - 3;699,695,700;, - 3;701,697,696;, - 3;701,696,699;, - 3;694,698,697;, - 3;694,697,701;, - 3;700,695,698;, - 3;700,698,694;, - 3;676,692,702;, - 3;676,702,703;, - 3;672,673,704;, - 3;672,704,705;, - 3;673,676,703;, - 3;673,703,704;, - 3;692,668,706;, - 3;692,706,702;, - 3;668,671,707;, - 3;668,707,706;, - 3;671,672,705;, - 3;671,705,707;, - 3;703,702,679;, - 3;703,679,678;, - 3;705,704,681;, - 3;705,681,680;, - 3;704,703,678;, - 3;704,678,681;, - 3;702,706,685;, - 3;702,685,679;, - 3;706,707,686;, - 3;706,686,685;, - 3;707,705,680;, - 3;707,680,686;, - 3;708,709,710;, - 3;708,711,712;, - 3;713,714,715;, - 3;716,715,717;, - 3;718,717,712;, - 3;719,720,710;, - 3;720,721,722;, - 3;721,723,708;, - 3;723,711,708;, - 3;719,709,712;, - 3;724,725,714;, - 3;725,726,715;, - 3;727,724,713;, - 3;726,728,717;, - 3;729,727,716;, - 3;728,719,712;, - 3;723,729,718;, - 3;730,731,724;, - 3;725,732,726;, - 3;726,732,733;, - 3;729,734,730;, - 3;727,730,724;, - 3;735,736,734;, - 3;734,737,738;, - 3;723,739,735;, - 3;729,735,734;, - 3;733,740,728;, - 3;728,740,741;, - 3;719,741,742;, - 3;742,743,720;, - 3;721,744,739;, - 3;736,740,733;, - 3;745,746,747;, - 3;745,747,748;, - 3;748,747,749;, - 3;748,749,750;, - 3;750,749,751;, - 3;750,751,752;, - 3;752,751,753;, - 3;752,753,754;, - 3;754,753,755;, - 3;754,755,756;, - 3;756,755,757;, - 3;756,757,758;, - 3;758,757,759;, - 3;758,759,760;, - 3;760,759,746;, - 3;760,746,745;, - 3;746,761,762;, - 3;746,762,747;, - 3;747,762,763;, - 3;747,763,749;, - 3;749,763,764;, - 3;749,764,751;, - 3;751,764,765;, - 3;751,765,753;, - 3;753,765,766;, - 3;753,766,755;, - 3;755,766,767;, - 3;755,767,757;, - 3;757,767,768;, - 3;757,768,759;, - 3;759,768,761;, - 3;759,761,746;, - 3;761,566,769;, - 3;761,769,762;, - 3;764,770,765;, - 3;765,771,772;, - 3;765,772,766;, - 3;766,772,773;, - 3;766,773,767;, - 3;767,773,571;, - 3;768,571,566;, - 3;768,566,761;, - 3;774,775,776;, - 3;774,776,777;, - 3;775,462,463;, - 3;775,463,776;, - 3;437,440,778;, - 3;437,778,779;, - 3;440,444,780;, - 3;440,780,778;, - 3;444,447,781;, - 3;444,781,780;, - 3;447,450,782;, - 3;447,782,781;, - 3;450,415,581;, - 3;450,581,782;, - 3;779,778,783;, - 3;779,783,784;, - 3;778,780,785;, - 3;778,785,783;, - 3;780,781,786;, - 3;780,786,785;, - 3;781,782,787;, - 3;781,787,786;, - 3;782,581,587;, - 3;782,587,787;, - 3;784,783,788;, - 3;784,788,789;, - 3;783,785,790;, - 3;783,790,788;, - 3;785,786,791;, - 3;785,791,790;, - 3;786,787,792;, - 3;786,792,791;, - 3;787,587,593;, - 3;787,593,792;, - 3;788,790,771;, - 3;788,771,793;, - 3;790,791,772;, - 3;790,772,771;, - 3;791,792,773;, - 3;791,773,772;, - 3;792,593,595;, - 3;792,595,773;, - 3;773,595,571;, - 3;431,437,779;, - 3;431,779,596;, - 3;596,779,784;, - 3;596,784,597;, - 3;597,784,789;, - 3;597,789,598;, - 3;599,769,566;, - 3;600,769,599;, - 3;601,598,789;, - 3;601,789,794;, - 3;794,789,788;, - 3;794,788,793;, - 3;769,763,762;, - 3;603,601,794;, - 3;603,794,795;, - 3;770,793,771;, - 3;770,771,765;, - 3;795,794,793;, - 3;795,793,770;, - 3;795,770,764;, - 3;769,795,763;, - 3;600,603,795;, - 3;745,748,796;, - 3;745,796,797;, - 3;748,750,798;, - 3;748,798,796;, - 3;750,752,799;, - 3;750,799,798;, - 3;752,754,800;, - 3;752,800,799;, - 3;754,756,801;, - 3;754,801,800;, - 3;756,758,802;, - 3;756,802,801;, - 3;758,760,803;, - 3;758,803,802;, - 3;760,745,797;, - 3;760,797,803;, - 3;797,796,804;, - 3;797,804,805;, - 3;796,798,806;, - 3;796,806,804;, - 3;798,799,807;, - 3;798,807,806;, - 3;799,800,808;, - 3;799,808,807;, - 3;800,801,809;, - 3;800,809,808;, - 3;801,802,810;, - 3;801,810,809;, - 3;802,803,811;, - 3;802,811,810;, - 3;803,797,805;, - 3;803,805,811;, - 3;805,804,812;, - 3;805,812,813;, - 3;804,806,814;, - 3;804,814,812;, - 3;806,807,815;, - 3;806,815,814;, - 3;807,808,816;, - 3;807,816,815;, - 3;808,809,817;, - 3;808,817,816;, - 3;809,810,818;, - 3;809,818,817;, - 3;810,811,819;, - 3;810,819,818;, - 3;811,805,813;, - 3;811,813,819;, - 3;813,812,742;, - 3;812,814,743;, - 3;814,815,744;, - 3;815,816,739;, - 3;816,817,735;, - 3;817,818,736;, - 3;818,819,740;, - 3;819,813,741;, - 3;767,571,768;, - 3;600,795,769;, - 3;732,731,738;, - 3;743,744,721;, - 3;743,721,720;, - 3;733,737,736;, - 3;731,732,725;, - 3;731,725,724;, - 3;733,738,737;, - 3;730,738,731;, - 3;737,734,736;, - 3;708,710,722;, - 3;708,712,709;, - 3;713,715,716;, - 3;716,717,718;, - 3;718,712,711;, - 3;719,710,709;, - 3;720,722,710;, - 3;721,708,722;, - 3;724,714,713;, - 3;725,715,714;, - 3;727,713,716;, - 3;726,717,715;, - 3;729,716,718;, - 3;728,712,717;, - 3;723,718,711;, - 3;726,733,728;, - 3;729,730,727;, - 3;734,738,730;, - 3;723,735,729;, - 3;728,741,719;, - 3;719,742,720;, - 3;721,739,723;, - 3;813,742,741;, - 3;812,743,742;, - 3;814,744,743;, - 3;815,739,744;, - 3;816,735,739;, - 3;817,736,735;, - 3;818,740,736;, - 3;819,741,740;, - 3;732,738,733;, - 3;764,763,795;, - 3;774,820,775;, - 3;443,821,454;, - 3;453,462,775;, - 3;454,776,463;, - 3;820,439,453;, - 3;820,453,775;, - 3;821,777,776;, - 3;821,776,454;, - 3;439,820,822;, - 3;439,822,823;, - 3;821,443,824;, - 3;821,824,825;, - 3;443,439,823;, - 3;443,823,824;, - 3;820,774,826;, - 3;820,826,822;, - 3;774,777,827;, - 3;774,827,826;, - 3;777,821,825;, - 3;777,825,827;, - 3;823,822,828;, - 3;823,828,829;, - 3;825,824,830;, - 3;825,830,831;, - 3;824,823,829;, - 3;824,829,830;, - 3;822,826,832;, - 3;822,832,828;, - 3;826,827,833;, - 3;826,833,832;, - 3;827,825,831;, - 3;827,831,833;, - 3;829,828,834;, - 3;829,834,835;, - 3;831,830,836;, - 3;831,836,837;, - 3;830,829,835;, - 3;830,835,836;, - 3;828,832,838;, - 3;828,838,834;, - 3;832,833,839;, - 3;832,839,838;, - 3;833,831,837;, - 3;833,837,839;, - 3;835,834,840;, - 3;835,840,841;, - 3;837,836,842;, - 3;837,842,843;, - 3;836,835,841;, - 3;836,841,842;, - 3;834,838,844;, - 3;834,844,840;, - 3;838,839,845;, - 3;838,845,844;, - 3;839,837,843;, - 3;839,843,845;, - 3;841,840,846;, - 3;841,846,847;, - 3;843,842,848;, - 3;843,848,849;, - 3;842,841,847;, - 3;842,847,848;, - 3;840,844,850;, - 3;840,850,846;, - 3;844,845,851;, - 3;844,851,850;, - 3;845,843,849;, - 3;845,849,851;, - 3;847,846,852;, - 3;847,852,853;, - 3;854,855,848;, - 3;848,847,853;, - 3;848,853,854;, - 3;846,850,856;, - 3;846,856,852;, - 3;850,851,857;, - 3;850,857,856;, - 3;851,849,858;, - 3;851,858,857;, - 3;853,852,675;, - 3;853,675,674;, - 3;858,855,683;, - 3;674,682,853;, - 3;852,856,677;, - 3;852,677,675;, - 3;856,857,684;, - 3;856,684,677;, - 3;857,858,683;, - 3;857,683,684;, - 3;677,684,692;, - 3;677,692,676;, - 3;855,858,849;, - 3;855,849,848;, - 3;855,854,691;, - 3;855,691,683;, - 3;682,691,854;, - 3;682,854,853;, - 3;683,689,688;, - 3;859,860,861;, - 3;862,859,861;, - 3;862,861,863;, - 3;864,862,863;, - 3;864,863,865;, - 3;866,864,865;, - 3;866,865,867;, - 3;868,866,867;, - 3;868,867,869;, - 3;870,868,869;, - 3;870,869,871;, - 3;872,870,871;, - 3;872,871,873;, - 3;874,872,873;, - 3;875,876,877;, - 3;878,875,877;, - 3;879,880,877;, - 3;880,881,878;, - 3;880,878,877;, - 3;880,863,861;, - 3;879,873,871;, - 3;879,871,869;, - 3;880,879,869;, - 3;880,869,867;, - 3;880,867,865;, - 3;880,865,863;, - 3;880,861,881;, - 3;881,861,860;, - 3;882,883,859;, - 3;862,882,859;, - 3;884,882,862;, - 3;864,884,862;, - 3;885,884,864;, - 3;866,885,864;, - 3;886,885,866;, - 3;868,886,866;, - 3;887,886,868;, - 3;870,887,868;, - 3;888,887,870;, - 3;872,888,870;, - 3;889,888,872;, - 3;874,889,872;, - 3;890,891,892;, - 3;893,890,892;, - 3;890,894,895;, - 3;893,896,894;, - 3;890,893,894;, - 3;882,884,894;, - 3;888,889,895;, - 3;887,888,895;, - 3;894,887,895;, - 3;886,887,894;, - 3;885,886,894;, - 3;884,885,894;, - 3;896,882,894;, - 3;883,882,896;, - 3;883,860,859;, - 3;889,874,873;, - 3;891,876,875;, - 3;892,891,875;, - 3;890,877,876;, - 3;891,890,876;, - 3;892,875,878;, - 3;893,892,878;, - 3;895,879,877;, - 3;890,895,877;, - 3;893,878,881;, - 3;896,893,881;, - 3;889,873,879;, - 3;895,889,879;, - 3;896,881,860;, - 3;883,896,860;, - 3;897,898,899;, - 3;900,901,898;, - 3;897,900,898;, - 3;902,903,904;, - 3;905,897,899;, - 3;906,900,897;, - 3;905,906,897;, - 3;907,903,902;, - 3;908,905,899;, - 3;909,906,905;, - 3;908,909,905;, - 3;910,903,907;, - 3;911,908,899;, - 3;912,909,908;, - 3;911,912,908;, - 3;913,903,910;, - 3;914,911,899;, - 3;915,912,911;, - 3;914,915,911;, - 3;916,903,913;, - 3;917,914,899;, - 3;918,915,914;, - 3;917,918,914;, - 3;919,903,916;, - 3;920,917,899;, - 3;921,918,917;, - 3;920,921,917;, - 3;922,903,919;, - 3;898,920,899;, - 3;901,921,920;, - 3;898,901,920;, - 3;904,903,922;, - 3;923,924,925;, - 3;926,923,925;, - 3;927,923,926;, - 3;928,927,926;, - 3;929,927,928;, - 3;930,929,928;, - 3;931,929,930;, - 3;932,931,930;, - 3;933,931,932;, - 3;934,933,932;, - 3;935,933,934;, - 3;936,935,934;, - 3;937,935,936;, - 3;938,937,936;, - 3;924,937,938;, - 3;925,924,938;, - 3;939,940,941;, - 3;942,939,941;, - 3;943,939,942;, - 3;944,943,942;, - 3;945,943,944;, - 3;946,945,944;, - 3;947,945,946;, - 3;948,947,946;, - 3;949,947,948;, - 3;950,949,948;, - 3;951,949,950;, - 3;952,951,950;, - 3;953,951,952;, - 3;954,953,952;, - 3;940,953,954;, - 3;941,940,954;, - 3;902,904,955;, - 3;956,902,955;, - 3;907,902,956;, - 3;957,907,956;, - 3;910,907,957;, - 3;958,910,957;, - 3;913,910,958;, - 3;959,913,958;, - 3;916,913,959;, - 3;960,916,959;, - 3;919,916,960;, - 3;961,919,960;, - 3;922,919,961;, - 3;962,922,961;, - 3;904,922,962;, - 3;955,904,962;, - 3;963,964,965;, - 3;966,963,965;, - 3;967,963,966;, - 3;968,967,966;, - 3;969,967,968;, - 3;970,969,968;, - 3;971,969,970;, - 3;972,971,970;, - 3;973,971,972;, - 3;974,973,972;, - 3;975,973,974;, - 3;976,975,974;, - 3;977,975,976;, - 3;978,977,976;, - 3;964,977,978;, - 3;965,964,978;, - 3;963,956,955;, - 3;964,963,955;, - 3;965,924,923;, - 3;966,965,923;, - 3;967,957,956;, - 3;963,967,956;, - 3;966,923,927;, - 3;968,966,927;, - 3;969,958,957;, - 3;967,969,957;, - 3;968,927,929;, - 3;970,968,929;, - 3;971,959,958;, - 3;969,971,958;, - 3;970,929,931;, - 3;972,970,931;, - 3;973,960,959;, - 3;971,973,959;, - 3;972,931,933;, - 3;974,972,933;, - 3;975,961,960;, - 3;973,975,960;, - 3;974,933,935;, - 3;976,974,935;, - 3;977,962,961;, - 3;975,977,961;, - 3;976,935,937;, - 3;978,976,937;, - 3;964,955,962;, - 3;977,964,962;, - 3;978,937,924;, - 3;965,978,924;, - 3;939,926,925;, - 3;940,939,925;, - 3;941,901,900;, - 3;942,941,900;, - 3;943,928,926;, - 3;939,943,926;, - 3;942,900,906;, - 3;944,942,906;, - 3;945,930,928;, - 3;943,945,928;, - 3;944,906,909;, - 3;946,944,909;, - 3;947,932,930;, - 3;945,947,930;, - 3;946,909,912;, - 3;948,946,912;, - 3;949,934,932;, - 3;947,949,932;, - 3;948,912,915;, - 3;950,948,915;, - 3;951,936,934;, - 3;949,951,934;, - 3;950,915,918;, - 3;952,950,918;, - 3;953,938,936;, - 3;951,953,936;, - 3;952,918,921;, - 3;954,952,921;, - 3;940,925,938;, - 3;953,940,938;, - 3;954,921,901;, - 3;941,954,901;; - } - - MeshTextureCoords - { - 1479; - 0.280615;0.558309;, - 0.352344;0.554924;, - 0.369747;0.634334;, - 0.289371;0.647432;, - 0.201996;0.558309;, - 0.201322;0.630433;, - 0.106905;0.558899;, - 0.111895;0.631083;, - 0.285424;0.558309;, - 0.345657;0.555196;, - 0.330844;0.522226;, - 0.271138;0.475430;, - 0.196666;0.558309;, - 0.197484;0.478011;, - 0.117133;0.559519;, - 0.134823;0.506295;, - 0.334255;0.513986;, - 0.294188;0.647073;, - 0.355995;0.630874;, - 0.277231;0.467783;, - 0.195995;0.630044;, - 0.198470;0.465449;, - 0.120283;0.629581;, - 0.129080;0.494225;, - 0.369747;0.634334;, - 0.352344;0.554924;, - 0.280615;0.558309;, - 0.289371;0.647432;, - 0.201996;0.558309;, - 0.201322;0.630433;, - 0.106905;0.558899;, - 0.111895;0.631083;, - 0.330844;0.522226;, - 0.345657;0.555196;, - 0.285424;0.558309;, - 0.271138;0.475430;, - 0.196666;0.558309;, - 0.197484;0.478011;, - 0.117133;0.559519;, - 0.134823;0.506295;, - 0.334255;0.513986;, - 0.294188;0.647073;, - 0.355995;0.630874;, - 0.277231;0.467783;, - 0.195995;0.630044;, - 0.198470;0.465449;, - 0.120283;0.629581;, - 0.129080;0.494225;, - 0.883088;0.082413;, - 0.952602;0.082413;, - 0.952602;0.124822;, - 0.886670;0.125688;, - 0.845982;0.082413;, - 0.853762;0.092854;, - 0.803697;0.099653;, - 0.818882;0.082413;, - 0.550187;0.108550;, - 0.549541;0.099912;, - 0.521198;0.108242;, - 0.570984;0.105166;, - 0.559898;0.090185;, - 0.524569;0.093462;, - 0.590036;0.104329;, - 0.609816;0.100136;, - 0.609816;0.094012;, - 0.599702;0.103594;, - 0.609816;0.120548;, - 0.595746;0.121809;, - 0.488608;0.098736;, - 0.584643;0.123322;, - 0.609816;0.131139;, - 0.599203;0.131643;, - 0.590592;0.133959;, - 0.576247;0.124880;, - 0.572237;0.121932;, - 0.573963;0.136508;, - 0.580782;0.133278;, - 0.576453;0.120504;, - 0.520895;0.082413;, - 0.488125;0.082413;, - 0.563259;0.082413;, - 0.609816;0.082413;, - 0.609816;0.138599;, - 0.578418;0.137559;, - 0.593845;0.139019;, - 0.572039;0.122828;, - 0.572039;0.137791;, - 0.564045;0.135397;, - 0.563414;0.125172;, - 0.551182;0.122339;, - 0.547324;0.144010;, - 0.522523;0.121370;, - 0.522461;0.151881;, - 0.491771;0.120638;, - 0.485200;0.143898;, - 0.771477;0.082413;, - 0.771542;0.101298;, - 0.768210;0.120830;, - 0.580931;0.158343;, - 0.570449;0.163309;, - 0.574303;0.168917;, - 0.585622;0.167880;, - 0.609816;0.155714;, - 0.609816;0.165248;, - 0.609816;0.140236;, - 0.589064;0.140091;, - 0.578822;0.152508;, - 0.609816;0.150620;, - 0.569837;0.139814;, - 0.563751;0.158980;, - 0.546868;0.146335;, - 0.563096;0.170687;, - 0.532636;0.154841;, - 0.548798;0.169209;, - 0.497169;0.176069;, - 0.488662;0.173898;, - 0.525106;0.183955;, - 0.528242;0.192703;, - 0.537397;0.191192;, - 0.575976;0.174984;, - 0.609816;0.171885;, - 0.502307;0.209559;, - 0.609816;0.205712;, - 0.579870;0.208627;, - 0.609816;0.249215;, - 0.590314;0.270046;, - 0.549502;0.223146;, - 0.443436;0.224306;, - 0.480367;0.239659;, - 0.518461;0.263323;, - 0.553895;0.290008;, - 0.454060;0.280620;, - 0.433337;0.267212;, - 0.451713;0.279666;, - 0.484038;0.286519;, - 0.502163;0.296979;, - 0.812102;0.170782;, - 0.805323;0.132241;, - 0.442623;0.287970;, - 0.444460;0.290005;, - 0.472601;0.298053;, - 0.490726;0.308513;, - 0.820616;0.294451;, - 0.872608;0.298270;, - 0.460271;0.313764;, - 0.865127;0.329289;, - 0.830969;0.345938;, - 0.863058;0.350187;, - 0.430798;0.359632;, - 0.855289;0.369545;, - 0.832614;0.410798;, - 0.977253;0.082413;, - 0.977253;0.124822;, - 0.850503;0.118681;, - 0.836291;0.132722;, - 0.977253;0.162733;, - 0.937459;0.164546;, - 0.893619;0.175809;, - 0.846623;0.200535;, - 0.977253;0.204540;, - 0.934116;0.216421;, - 0.894289;0.229689;, - 0.840330;0.248155;, - 0.785859;0.267591;, - 0.488679;0.064671;, - 0.509745;0.064671;, - 0.558410;0.064671;, - 0.577029;0.064671;, - 0.597051;0.064671;, - 0.629523;0.064671;, - 0.653262;0.064671;, - 0.681827;0.064671;, - 0.711831;0.064671;, - 0.737024;0.064671;, - 0.488679;0.034046;, - 0.509740;0.034046;, - 0.558329;0.034046;, - 0.576834;0.034046;, - 0.596904;0.034046;, - 0.629776;0.034046;, - 0.653633;0.034046;, - 0.681781;0.034046;, - 0.711631;0.034046;, - 0.737024;0.034046;, - 0.488679;0.004105;, - 0.514426;0.004105;, - 0.554945;0.004105;, - 0.573423;0.004093;, - 0.594608;0.004075;, - 0.630847;0.004069;, - 0.656329;0.004118;, - 0.683589;0.004140;, - 0.706125;0.004111;, - 0.737024;0.004098;, - 0.611020;0.319170;, - 0.589653;0.319147;, - 0.556708;0.337698;, - 0.551911;0.353407;, - 0.543980;0.366476;, - 0.548138;0.390036;, - 0.551860;0.407144;, - 0.567299;0.423136;, - 0.586676;0.432468;, - 0.611020;0.437138;, - 0.611020;0.381372;, - 0.952552;0.082413;, - 0.883037;0.082413;, - 0.886620;0.125688;, - 0.952552;0.124822;, - 0.853762;0.092854;, - 0.845982;0.082413;, - 0.818882;0.082413;, - 0.803697;0.099653;, - 0.698437;0.106805;, - 0.668654;0.099194;, - 0.669447;0.108550;, - 0.650225;0.105166;, - 0.695064;0.093462;, - 0.656860;0.093779;, - 0.629597;0.104329;, - 0.619931;0.103594;, - 0.623887;0.121809;, - 0.733040;0.099166;, - 0.634991;0.123322;, - 0.620430;0.131643;, - 0.629041;0.133959;, - 0.647396;0.121932;, - 0.643386;0.124880;, - 0.638851;0.133278;, - 0.645671;0.136508;, - 0.643180;0.120504;, - 0.736511;0.082413;, - 0.698740;0.082413;, - 0.656374;0.082413;, - 0.625788;0.139019;, - 0.641215;0.137559;, - 0.647594;0.137791;, - 0.647594;0.122828;, - 0.656219;0.125172;, - 0.655588;0.135397;, - 0.665576;0.120182;, - 0.672309;0.144010;, - 0.692798;0.120651;, - 0.697172;0.151881;, - 0.731433;0.119786;, - 0.744808;0.142253;, - 0.771477;0.082413;, - 0.771542;0.101298;, - 0.768210;0.120830;, - 0.649184;0.163309;, - 0.638702;0.158343;, - 0.634011;0.167880;, - 0.645330;0.168917;, - 0.630569;0.140091;, - 0.640811;0.152508;, - 0.649796;0.139814;, - 0.655882;0.158980;, - 0.672766;0.146335;, - 0.656537;0.170687;, - 0.670836;0.169209;, - 0.686998;0.154841;, - 0.720784;0.179724;, - 0.729290;0.177552;, - 0.696600;0.188791;, - 0.691392;0.192703;, - 0.643657;0.174984;, - 0.682237;0.191192;, - 0.710804;0.204162;, - 0.639763;0.208627;, - 0.629319;0.270046;, - 0.670131;0.223146;, - 0.774517;0.229178;, - 0.739679;0.241380;, - 0.711278;0.259955;, - 0.665739;0.290008;, - 0.766770;0.280022;, - 0.760151;0.282057;, - 0.771099;0.269284;, - 0.735595;0.286519;, - 0.717471;0.296979;, - 0.812102;0.170782;, - 0.805323;0.132241;, - 0.775600;0.289980;, - 0.771064;0.292089;, - 0.747034;0.300317;, - 0.728909;0.308513;, - 0.820616;0.294451;, - 0.872608;0.298270;, - 0.759362;0.313764;, - 0.865127;0.329289;, - 0.830969;0.345938;, - 0.863058;0.350187;, - 0.788837;0.359632;, - 0.855289;0.369545;, - 0.832614;0.410798;, - 0.836291;0.132722;, - 0.850503;0.118681;, - 0.937408;0.164546;, - 0.846623;0.200535;, - 0.893619;0.175809;, - 0.934066;0.216421;, - 0.894289;0.229689;, - 0.840330;0.248155;, - 0.785859;0.267591;, - 0.964301;0.064671;, - 0.917764;0.064671;, - 0.897016;0.064671;, - 0.876995;0.064671;, - 0.844523;0.064671;, - 0.820785;0.064671;, - 0.792219;0.064671;, - 0.762215;0.064671;, - 0.964306;0.034046;, - 0.917844;0.034046;, - 0.897212;0.034046;, - 0.877141;0.034046;, - 0.844270;0.034046;, - 0.820414;0.034046;, - 0.792265;0.034046;, - 0.762416;0.034046;, - 0.959620;0.004105;, - 0.921228;0.004105;, - 0.900623;0.004093;, - 0.879437;0.004075;, - 0.843198;0.004069;, - 0.817717;0.004118;, - 0.790457;0.004140;, - 0.767920;0.004111;, - 0.632386;0.319147;, - 0.665331;0.337698;, - 0.670129;0.353407;, - 0.678059;0.366476;, - 0.673901;0.390036;, - 0.670179;0.407144;, - 0.654740;0.423136;, - 0.635362;0.432468;, - 0.391029;0.473726;, - 0.369726;0.473726;, - 0.369726;0.506185;, - 0.375924;0.506185;, - 0.369196;0.401156;, - 0.348048;0.473726;, - 0.363152;0.506185;, - 0.369726;0.473726;, - 0.369726;0.506185;, - 0.348424;0.473726;, - 0.363527;0.506185;, - 0.389704;0.473726;, - 0.363527;0.506185;, - 0.371565;0.129504;, - 0.355624;0.129504;, - 0.355624;0.175198;, - 0.368648;0.175198;, - 0.386154;0.129504;, - 0.386565;0.175198;, - 0.401455;0.129504;, - 0.401455;0.175198;, - 0.416757;0.129504;, - 0.416346;0.175198;, - 0.431346;0.129504;, - 0.434263;0.175198;, - 0.355624;0.086776;, - 0.369098;0.086776;, - 0.383421;0.086776;, - 0.397779;0.086776;, - 0.416817;0.086776;, - 0.431140;0.086776;, - 0.355571;0.048160;, - 0.371528;0.048160;, - 0.383328;0.048160;, - 0.398025;0.048160;, - 0.411409;0.048160;, - 0.429026;0.048160;, - 0.400607;0.010969;, - 0.355624;0.175198;, - 0.355624;0.129504;, - 0.371565;0.129504;, - 0.368648;0.175198;, - 0.386154;0.129504;, - 0.386565;0.175198;, - 0.401455;0.129504;, - 0.401455;0.175198;, - 0.416757;0.129504;, - 0.416346;0.175198;, - 0.431346;0.129504;, - 0.434263;0.175198;, - 0.355624;0.086776;, - 0.369098;0.086776;, - 0.383421;0.086776;, - 0.397779;0.086776;, - 0.416817;0.086776;, - 0.431140;0.086776;, - 0.355571;0.048160;, - 0.371528;0.048160;, - 0.383328;0.048160;, - 0.398025;0.048160;, - 0.411409;0.048160;, - 0.429026;0.048160;, - 0.400607;0.010969;, - 0.517951;0.890433;, - 0.427137;0.883950;, - 0.435186;0.982633;, - 0.510383;0.975251;, - 0.415278;0.689727;, - 0.370135;0.659013;, - 0.391969;0.701679;, - 0.572844;0.892869;, - 0.567696;0.972005;, - 0.425793;0.670568;, - 0.625334;0.894379;, - 0.629035;0.955158;, - 0.715766;0.705303;, - 0.712791;0.895888;, - 0.712791;0.942076;, - 0.744180;0.713567;, - 0.777555;0.942076;, - 0.777555;0.895888;, - 0.503275;0.813897;, - 0.440512;0.799365;, - 0.629357;0.811287;, - 0.584542;0.818759;, - 0.720847;0.803956;, - 0.777555;0.803956;, - 0.480556;0.722650;, - 0.402939;0.738043;, - 0.900980;0.491809;, - 0.873420;0.492783;, - 0.732693;0.753223;, - 0.370135;0.701679;, - 0.370135;0.731323;, - 0.370135;0.883950;, - 0.370135;0.982633;, - 0.777555;0.713567;, - 0.370135;0.799365;, - 0.777555;0.751715;, - 0.836156;0.510838;, - 0.873268;0.519740;, - 0.305207;0.982633;, - 0.313256;0.883950;, - 0.222442;0.890433;, - 0.230010;0.975251;, - 0.343249;0.701679;, - 0.325115;0.689727;, - 0.176734;0.894092;, - 0.180046;0.971166;, - 0.314600;0.670568;, - 0.935726;0.894379;, - 0.942692;0.955158;, - 0.838894;0.705303;, - 0.841869;0.895888;, - 0.841869;0.942076;, - 0.810480;0.713567;, - 0.299881;0.799365;, - 0.237118;0.813897;, - 0.970118;0.818759;, - 0.914636;0.811287;, - 0.833813;0.803956;, - 0.332279;0.738043;, - 0.259837;0.722650;, - 0.873420;0.492783;, - 0.900980;0.491809;, - 0.821967;0.753223;, - 0.836156;0.510838;, - 0.873268;0.519740;, - 0.918959;0.405681;, - 0.898498;0.429269;, - 0.894966;0.400969;, - 0.990199;0.426294;, - 0.947165;0.384354;, - 0.971267;0.413782;, - 0.956838;0.417097;, - 0.967154;0.447736;, - 0.978365;0.446699;, - 0.955778;0.486085;, - 0.940586;0.319616;, - 0.944732;0.317124;, - 0.975241;0.318740;, - 0.975564;0.320794;, - 0.943364;0.442528;, - 0.928589;0.476796;, - 0.906900;0.466579;, - 0.904555;0.321383;, - 0.903345;0.321307;, - 0.907629;0.434826;, - 0.885399;0.445480;, - 0.875628;0.426406;, - 0.896440;0.422435;, - 0.926290;0.443429;, - 0.953860;0.405111;, - 0.892791;0.421365;, - 0.910186;0.401974;, - 0.882443;0.367108;, - 0.872030;0.376435;, - 0.888582;0.381286;, - 0.896041;0.370924;, - 0.894747;0.401967;, - 0.872978;0.406447;, - 0.891864;0.404921;, - 0.951217;0.361266;, - 0.986172;0.364345;, - 0.987166;0.358691;, - 0.945619;0.365525;, - 0.896655;0.370095;, - 0.987594;0.438274;, - 0.063348;0.627819;, - 0.077953;0.584320;, - 0.011718;0.584154;, - 0.079060;0.581589;, - 0.013910;0.580729;, - 0.080683;0.486679;, - 0.059355;0.473666;, - 0.029863;0.472997;, - 0.071135;0.548371;, - 0.009488;0.486523;, - 0.010087;0.551560;, - 0.100741;0.470991;, - 0.097934;0.479430;, - 0.107691;0.470245;, - 0.107687;0.470545;, - 0.110970;0.479430;, - 0.101601;0.502242;, - 0.107919;0.502385;, - 0.097032;0.499086;, - 0.110626;0.499488;, - 0.099079;0.486255;, - 0.111420;0.485572;, - 0.106250;0.421203;, - 0.078698;0.426763;, - 0.127709;0.425565;, - 0.172089;0.424328;, - 0.166487;0.427056;, - 0.050569;0.412161;, - 0.035610;0.406526;, - 0.052377;0.444396;, - 0.051832;0.429629;, - 0.227606;0.399193;, - 0.205078;0.399390;, - 0.229717;0.399311;, - 0.254647;0.399270;, - 0.272080;0.399407;, - 0.252416;0.399142;, - 0.070362;0.287393;, - 0.016046;0.293476;, - 0.016046;0.324669;, - 0.072292;0.324669;, - 0.113194;0.285322;, - 0.113279;0.324669;, - 0.158180;0.271515;, - 0.163873;0.324669;, - 0.206640;0.268446;, - 0.206640;0.324669;, - 0.247941;0.274515;, - 0.242835;0.324669;, - 0.283810;0.288322;, - 0.278594;0.324669;, - 0.311221;0.290393;, - 0.315308;0.324669;, - 0.068945;0.235193;, - 0.016046;0.240473;, - 0.108219;0.207433;, - 0.152927;0.178981;, - 0.206640;0.167059;, - 0.252867;0.175304;, - 0.288891;0.212805;, - 0.318162;0.231991;, - 0.065705;0.198441;, - 0.016046;0.208214;, - 0.155878;0.116450;, - 0.260626;0.086608;, - 0.206640;0.069824;, - 0.297131;0.129663;, - 0.334772;0.190121;, - 0.877720;0.549659;, - 0.835118;0.546998;, - 0.835052;0.586744;, - 0.876715;0.589598;, - 0.068252;0.887184;, - 0.089066;0.958830;, - 0.046998;0.832490;, - 0.029357;0.785551;, - 0.023073;0.712469;, - 0.023073;0.674844;, - 0.145853;0.888391;, - 0.143516;0.958116;, - 0.177991;0.831961;, - 0.197564;0.786458;, - 0.213185;0.711950;, - 0.215318;0.674844;, - 0.157821;0.890682;, - 0.156902;0.959254;, - 0.190868;0.832283;, - 0.205079;0.782164;, - 0.223096;0.710534;, - 0.225229;0.674844;, - 0.153638;0.053327;, - 0.334772;0.160303;, - 0.086938;0.892203;, - 0.143516;0.891840;, - 0.156902;0.892732;, - 0.055189;0.189485;, - 0.065223;0.170997;, - 0.067039;0.047965;, - 0.105565;0.048142;, - 0.068508;0.117444;, - 0.107800;0.133075;, - 0.343109;0.380090;, - 0.323832;0.383288;, - 0.355057;0.385320;, - 0.206829;0.384744;, - 0.234567;0.382514;, - 0.257187;0.388855;, - 0.276919;0.382594;, - 0.298064;0.380974;, - 0.344860;0.373637;, - 0.325680;0.376362;, - 0.354260;0.377471;, - 0.204463;0.374769;, - 0.233180;0.376205;, - 0.251611;0.377892;, - 0.277423;0.373836;, - 0.298171;0.373284;, - 0.140035;0.355838;, - 0.100853;0.355882;, - 0.154296;0.355147;, - 0.169423;0.354964;, - 0.097884;0.347432;, - 0.078303;0.359102;, - 0.054330;0.360424;, - 0.076810;0.360458;, - 0.784640;0.576144;, - 0.931041;0.562636;, - 0.783145;0.623006;, - 0.702517;0.610617;, - 0.985871;0.600609;, - 0.931288;0.605739;, - 0.844017;0.627798;, - 0.881038;0.614886;, - 0.782830;0.648292;, - 0.697657;0.637050;, - 0.985871;0.627042;, - 0.929760;0.623529;, - 0.843533;0.654056;, - 0.883177;0.641144;, - 0.454991;0.524293;, - 0.410274;0.510212;, - 0.603777;0.507259;, - 0.564440;0.512230;, - 0.487397;0.524067;, - 0.520078;0.523358;, - 0.455289;0.523505;, - 0.409861;0.511667;, - 0.604047;0.509031;, - 0.564126;0.512622;, - 0.488686;0.521909;, - 0.523239;0.524440;, - 0.449119;0.565596;, - 0.407333;0.554503;, - 0.605049;0.554831;, - 0.569952;0.558712;, - 0.492583;0.572056;, - 0.526891;0.572306;, - 0.436540;0.611713;, - 0.402027;0.604724;, - 0.585826;0.605834;, - 0.606428;0.604934;, - 0.491624;0.615716;, - 0.535771;0.615875;, - 0.577581;0.606189;, - 0.894966;0.400969;, - 0.898498;0.429269;, - 0.918959;0.405681;, - 0.902644;0.387762;, - 0.947165;0.384354;, - 0.969630;0.436914;, - 0.966359;0.469649;, - 0.985675;0.467648;, - 0.988300;0.434689;, - 0.955778;0.486085;, - 0.975241;0.318740;, - 0.944732;0.317124;, - 0.940586;0.319616;, - 0.975564;0.320794;, - 0.943364;0.442528;, - 0.906900;0.466579;, - 0.928589;0.476796;, - 0.903345;0.321307;, - 0.903853;0.322786;, - 0.875628;0.426406;, - 0.885399;0.445480;, - 0.907629;0.434826;, - 0.896440;0.422435;, - 0.926290;0.443429;, - 0.953860;0.405111;, - 0.892791;0.421365;, - 0.910186;0.401974;, - 0.888582;0.381286;, - 0.872030;0.376435;, - 0.882443;0.367108;, - 0.896041;0.370924;, - 0.872978;0.406447;, - 0.894747;0.401967;, - 0.891864;0.404921;, - 0.951217;0.361266;, - 0.986172;0.364345;, - 0.987166;0.358691;, - 0.945619;0.365525;, - 0.896655;0.370095;, - 0.899278;0.370234;, - 0.011718;0.584154;, - 0.077953;0.584320;, - 0.063348;0.627819;, - 0.013910;0.580729;, - 0.079060;0.581589;, - 0.029863;0.472997;, - 0.059355;0.473666;, - 0.080683;0.486679;, - 0.009488;0.486523;, - 0.071135;0.548371;, - 0.010087;0.551560;, - 0.097961;0.479430;, - 0.100768;0.470991;, - 0.107714;0.470545;, - 0.107717;0.470245;, - 0.110997;0.479430;, - 0.107946;0.502385;, - 0.101628;0.502242;, - 0.097059;0.499086;, - 0.110653;0.499488;, - 0.099105;0.486255;, - 0.111447;0.485572;, - 0.078698;0.426763;, - 0.106250;0.421203;, - 0.127709;0.425565;, - 0.172089;0.424328;, - 0.166487;0.427056;, - 0.035610;0.406526;, - 0.050569;0.412161;, - 0.051832;0.429629;, - 0.052377;0.444396;, - 0.227606;0.399193;, - 0.205078;0.399390;, - 0.229717;0.399311;, - 0.254647;0.399270;, - 0.272080;0.399407;, - 0.252416;0.399142;, - 0.016046;0.324669;, - 0.016046;0.293476;, - 0.070362;0.287393;, - 0.072292;0.324669;, - 0.113194;0.285322;, - 0.113279;0.324669;, - 0.158180;0.271515;, - 0.163873;0.324669;, - 0.206640;0.268446;, - 0.206640;0.324669;, - 0.247941;0.274515;, - 0.242835;0.324669;, - 0.283810;0.288322;, - 0.278594;0.324669;, - 0.311221;0.290393;, - 0.315308;0.324669;, - 0.016046;0.240473;, - 0.068945;0.235193;, - 0.108219;0.207433;, - 0.152927;0.178981;, - 0.206640;0.167059;, - 0.252867;0.175304;, - 0.288891;0.212805;, - 0.318162;0.231991;, - 0.065705;0.198441;, - 0.155878;0.116450;, - 0.206640;0.069824;, - 0.260626;0.086608;, - 0.297131;0.129663;, - 0.835052;0.586744;, - 0.835118;0.546998;, - 0.877720;0.549659;, - 0.876715;0.589598;, - 0.068252;0.887184;, - 0.089066;0.958830;, - 0.046998;0.832490;, - 0.029357;0.785551;, - 0.023073;0.712469;, - 0.145853;0.888391;, - 0.143516;0.958116;, - 0.177991;0.831961;, - 0.197564;0.786458;, - 0.213185;0.711950;, - 0.157821;0.890682;, - 0.156902;0.959254;, - 0.190868;0.832283;, - 0.205079;0.782164;, - 0.223096;0.710534;, - 0.153638;0.053327;, - 0.105565;0.048142;, - 0.107800;0.133075;, - 0.343109;0.380090;, - 0.323832;0.383288;, - 0.355057;0.385320;, - 0.206829;0.384744;, - 0.234567;0.382514;, - 0.257187;0.388855;, - 0.276919;0.382594;, - 0.298064;0.380974;, - 0.344860;0.373637;, - 0.325680;0.376362;, - 0.354260;0.377471;, - 0.204463;0.374769;, - 0.233180;0.376205;, - 0.251611;0.377892;, - 0.277423;0.373836;, - 0.298171;0.373284;, - 0.140035;0.355838;, - 0.100853;0.355882;, - 0.154296;0.355147;, - 0.169423;0.354964;, - 0.097884;0.347432;, - 0.078303;0.359102;, - 0.054330;0.360424;, - 0.076810;0.360458;, - 0.784640;0.576144;, - 0.931041;0.562636;, - 0.783145;0.623006;, - 0.702517;0.610617;, - 0.985871;0.600609;, - 0.931288;0.605739;, - 0.844017;0.627798;, - 0.881038;0.614886;, - 0.782830;0.648292;, - 0.697657;0.637050;, - 0.985871;0.627042;, - 0.929760;0.623529;, - 0.843533;0.654056;, - 0.883177;0.641144;, - 0.454991;0.524293;, - 0.410274;0.510212;, - 0.603777;0.507259;, - 0.564440;0.512230;, - 0.487397;0.524067;, - 0.520078;0.523358;, - 0.455289;0.523505;, - 0.409861;0.511667;, - 0.604047;0.509031;, - 0.564126;0.512622;, - 0.488686;0.521909;, - 0.523239;0.524440;, - 0.449119;0.565596;, - 0.407333;0.554503;, - 0.605049;0.554831;, - 0.569952;0.558712;, - 0.492583;0.572056;, - 0.526891;0.572306;, - 0.436540;0.611713;, - 0.402027;0.604724;, - 0.606428;0.604934;, - 0.585826;0.605834;, - 0.491624;0.615716;, - 0.535771;0.615875;, - 0.577581;0.606189;, - 0.225629;0.906647;, - 0.257118;0.770403;, - 0.196806;0.682930;, - 0.100224;0.753850;, - 0.159871;0.589702;, - 0.034839;0.630259;, - 0.147435;0.493553;, - 0.018893;0.506986;, - 0.159871;0.397404;, - 0.034839;0.383712;, - 0.196806;0.304177;, - 0.082196;0.264183;, - 0.257118;0.216703;, - 0.159520;0.152032;, - 0.314932;0.166093;, - 0.318555;0.018152;, - 0.554152;0.626886;, - 0.557998;0.322535;, - 0.442610;0.296521;, - 0.431074;0.650296;, - 0.350303;0.254902;, - 0.336420;0.485623;, - 0.323379;0.702323;, - 0.196806;0.682655;, - 0.257118;0.770128;, - 0.159871;0.589427;, - 0.147435;0.493278;, - 0.159871;0.397130;, - 0.196806;0.303901;, - 0.257118;0.216428;, - 0.314932;0.165818;, - 0.442610;0.296246;, - 0.557998;0.322260;, - 0.554152;0.626611;, - 0.431074;0.650021;, - 0.336420;0.485348;, - 0.350303;0.254627;, - 0.323379;0.702048;, - 0.438450;0.893948;, - 0.393391;0.912613;, - 0.393391;0.848889;, - 0.731679;0.669200;, - 0.682021;0.669200;, - 0.496696;0.202288;, - 0.450065;0.155657;, - 0.450065;0.221604;, - 0.457115;0.848889;, - 0.781335;0.669200;, - 0.516012;0.155657;, - 0.438450;0.803826;, - 0.830993;0.669200;, - 0.496696;0.109022;, - 0.393391;0.785161;, - 0.880650;0.669200;, - 0.450065;0.089706;, - 0.348331;0.803826;, - 0.930304;0.669200;, - 0.403431;0.109022;, - 0.329666;0.848889;, - 0.979961;0.669200;, - 0.384118;0.155657;, - 0.348331;0.893948;, - 0.632365;0.669200;, - 0.403431;0.202288;, - 0.731679;0.199240;, - 0.682021;0.199240;, - 0.682021;0.474517;, - 0.731679;0.474517;, - 0.781335;0.199240;, - 0.781335;0.474517;, - 0.830993;0.199240;, - 0.830993;0.474517;, - 0.880650;0.199240;, - 0.880650;0.474517;, - 0.930304;0.199240;, - 0.930304;0.474517;, - 0.979961;0.199240;, - 0.979961;0.474517;, - 0.632365;0.199240;, - 0.632365;0.474517;, - 0.731679;0.480018;, - 0.682021;0.480018;, - 0.682021;0.663701;, - 0.731679;0.663701;, - 0.781335;0.480018;, - 0.781335;0.663701;, - 0.830993;0.480018;, - 0.830993;0.663701;, - 0.880650;0.480018;, - 0.880650;0.663701;, - 0.930304;0.480018;, - 0.930304;0.663701;, - 0.979961;0.480018;, - 0.979961;0.663701;, - 0.632365;0.480018;, - 0.632365;0.663701;, - 0.682021;0.038480;, - 0.731679;0.038480;, - 0.781335;0.038480;, - 0.830993;0.038480;, - 0.880650;0.038480;, - 0.930304;0.038480;, - 0.979961;0.038480;, - 0.632365;0.038480;, - 0.731679;0.038480;, - 0.682021;0.038480;, - 0.682021;0.199240;, - 0.731679;0.199240;, - 0.781335;0.038480;, - 0.781335;0.199240;, - 0.830993;0.038480;, - 0.830993;0.199240;, - 0.880650;0.038480;, - 0.880650;0.199240;, - 0.930304;0.038480;, - 0.930304;0.199240;, - 0.979961;0.038480;, - 0.979961;0.199240;, - 0.632365;0.038480;, - 0.632365;0.199240;, - 0.736511;0.082413;, - 0.733040;0.099166;, - 0.731433;0.119786;, - 0.744808;0.142253;, - 0.775285;0.229227;, - 0.825553;0.282190;, - 0.852349;0.284159;, - 0.402107;0.302317;, - 0.874543;0.302145;, - 0.852790;0.291030;, - 0.822925;0.307724;, - 0.404511;0.315541;, - 0.495438;0.334057;, - 0.395519;0.350837;, - 0.829692;0.356466;, - 0.396977;0.360710;, - 0.452126;0.371941;, - 0.404138;0.409819;, - 0.832399;0.409796;, - 0.850805;0.118056;, - 0.854157;0.093477;, - 0.836994;0.132361;, - 0.426443;0.264001;, - 0.846071;0.082413;, - 0.488679;0.071330;, - 0.509864;0.071330;, - 0.561990;0.071330;, - 0.574974;0.071330;, - 0.596153;0.071330;, - 0.630507;0.071330;, - 0.655447;0.071330;, - 0.685261;0.071330;, - 0.711741;0.071330;, - 0.737024;0.071330;, - 0.611020;0.297027;, - 0.572843;0.296995;, - 0.529308;0.322515;, - 0.522962;0.344128;, - 0.512484;0.362103;, - 0.517972;0.394490;, - 0.522892;0.418014;, - 0.543315;0.440027;, - 0.568927;0.452870;, - 0.611020;0.459291;, - 0.775285;0.229227;, - 0.825553;0.282190;, - 0.852349;0.284159;, - 0.817527;0.302317;, - 0.874543;0.302145;, - 0.822925;0.307724;, - 0.852790;0.291030;, - 0.815123;0.315541;, - 0.724198;0.334057;, - 0.824114;0.350837;, - 0.829692;0.356466;, - 0.822656;0.360710;, - 0.767508;0.371941;, - 0.815497;0.409819;, - 0.832399;0.409796;, - 0.854106;0.093477;, - 0.850754;0.118056;, - 0.836944;0.132361;, - 0.784785;0.267655;, - 0.846020;0.082413;, - 0.985368;0.071330;, - 0.985368;0.064671;, - 0.964181;0.071330;, - 0.920566;0.071330;, - 0.899072;0.071330;, - 0.877892;0.071330;, - 0.843538;0.071330;, - 0.818598;0.071330;, - 0.788785;0.071330;, - 0.762305;0.071330;, - 0.985368;0.034046;, - 0.985368;0.004105;, - 0.649194;0.296995;, - 0.692732;0.322515;, - 0.699077;0.344128;, - 0.709556;0.362103;, - 0.704068;0.394490;, - 0.699148;0.418014;, - 0.678724;0.440027;, - 0.653112;0.452870;, - 0.348048;0.473726;, - 0.363152;0.506185;, - 0.369880;0.401156;, - 0.391029;0.473726;, - 0.375924;0.506185;, - 0.389704;0.473726;, - 0.374601;0.506185;, - 0.348424;0.473726;, - 0.368932;0.401156;, - 0.452400;0.129504;, - 0.452400;0.175198;, - 0.452400;0.086776;, - 0.452347;0.048160;, - 0.452400;0.129504;, - 0.452400;0.175198;, - 0.452400;0.086776;, - 0.452347;0.048160;, - 0.517436;0.890028;, - 0.510531;0.976844;, - 0.572671;0.894379;, - 0.568342;0.971093;, - 0.777555;0.678284;, - 0.694161;0.680784;, - 0.930651;0.528982;, - 0.636790;0.729840;, - 0.497690;0.695873;, - 0.625202;0.706393;, - 0.829864;0.489448;, - 0.791888;0.522384;, - 0.370258;0.659013;, - 0.230175;0.975238;, - 0.222812;0.890877;, - 0.990199;0.971093;, - 0.985870;0.894379;, - 0.860499;0.680784;, - 0.930651;0.528982;, - 0.917870;0.729840;, - 0.370258;0.731323;, - 0.370258;0.701679;, - 0.242703;0.695873;, - 0.929458;0.706393;, - 0.370258;0.883950;, - 0.370258;0.982633;, - 0.370258;0.799365;, - 0.791888;0.522384;, - 0.829864;0.489448;, - 0.986396;0.412257;, - 0.975310;0.418268;, - 0.902644;0.387762;, - 0.994669;0.402101;, - 0.981890;0.469917;, - 0.995134;0.390231;, - 0.984220;0.450300;, - 0.603782;0.643446;, - 0.609341;0.643446;, - 0.582531;0.643446;, - 0.973521;0.462071;, - 0.963886;0.460904;, - 0.973851;0.440898;, - 0.899278;0.370234;, - 0.961957;0.475718;, - 0.956964;0.472868;, - 0.985692;0.467093;, - 0.973104;0.465610;, - 0.100745;0.470691;, - 0.111438;0.479862;, - 0.110968;0.480595;, - 0.097932;0.480595;, - 0.098169;0.480010;, - 0.101601;0.502243;, - 0.097031;0.499087;, - 0.107919;0.502387;, - 0.099077;0.486238;, - 0.110626;0.499489;, - 0.111419;0.485555;, - 0.086807;0.443269;, - 0.132822;0.441307;, - 0.113511;0.444424;, - 0.140395;0.423608;, - 0.135060;0.441158;, - 0.136342;0.424943;, - 0.198735;0.443346;, - 0.075366;0.444316;, - 0.027868;0.432074;, - 0.208127;0.399315;, - 0.227674;0.440235;, - 0.195515;0.443409;, - 0.227674;0.438745;, - 0.267237;0.439863;, - 0.256190;0.399124;, - 0.269540;0.435635;, - 0.071134;0.428124;, - 0.066616;0.410202;, - 0.367433;0.293476;, - 0.367433;0.324669;, - 0.367433;0.240473;, - 0.367433;0.208214;, - 0.057618;0.889801;, - 0.075217;0.960259;, - 0.039094;0.831536;, - 0.022855;0.783300;, - 0.016830;0.710664;, - 0.016830;0.674844;, - 0.206640;0.029904;, - 0.152154;0.014424;, - 0.263299;0.059838;, - 0.297418;0.072112;, - 0.334772;0.081782;, - 0.073089;0.893078;, - 0.101798;0.013560;, - 0.065925;0.013560;, - 0.339698;0.346140;, - 0.322500;0.345093;, - 0.349771;0.347008;, - 0.206286;0.347083;, - 0.187234;0.346447;, - 0.192520;0.385320;, - 0.233624;0.344280;, - 0.264945;0.347083;, - 0.283942;0.347008;, - 0.302605;0.346140;, - 0.302349;0.346140;, - 0.297808;0.380974;, - 0.191723;0.377471;, - 0.297916;0.373284;, - 0.141389;0.337516;, - 0.096555;0.337516;, - 0.155781;0.337516;, - 0.141143;0.337516;, - 0.139486;0.355087;, - 0.169423;0.337516;, - 0.094962;0.337516;, - 0.139682;0.337516;, - 0.139079;0.356255;, - 0.070832;0.337516;, - 0.059451;0.337516;, - 0.037745;0.337516;, - 0.034063;0.355263;, - 0.069376;0.337516;, - 0.070089;0.337516;, - 0.078341;0.360000;, - 0.140295;0.410202;, - 0.154671;0.410202;, - 0.169423;0.410202;, - 0.106374;0.410202;, - 0.066616;0.410202;, - 0.050267;0.412054;, - 0.108395;0.410202;, - 0.052779;0.459751;, - 0.069646;0.449516;, - 0.301467;0.437159;, - 0.303759;0.398990;, - 0.031124;0.452374;, - 0.027488;0.628182;, - 0.133164;0.444513;, - 0.267437;0.438220;, - 0.140673;0.410202;, - 0.138160;0.410202;, - 0.035715;0.406444;, - 0.983283;0.552269;, - 0.717768;0.549735;, - 0.665848;0.551563;, - 0.665848;0.603961;, - 0.665848;0.624999;, - 0.465080;0.495146;, - 0.416895;0.485971;, - 0.596048;0.486003;, - 0.554443;0.490049;, - 0.648116;0.507207;, - 0.653986;0.485971;, - 0.495199;0.500632;, - 0.453668;0.524293;, - 0.520895;0.500658;, - 0.647703;0.508662;, - 0.453966;0.523505;, - 0.644424;0.554503;, - 0.639118;0.604724;, - 0.427648;0.643446;, - 0.408566;0.643446;, - 0.620138;0.643446;, - 0.645657;0.643446;, - 0.510273;0.643446;, - 0.560244;0.643446;, - 0.981890;0.469917;, - 0.994669;0.402101;, - 0.984220;0.450300;, - 0.995134;0.390231;, - 0.582531;0.643446;, - 0.609341;0.643446;, - 0.603782;0.643446;, - 0.987227;0.416442;, - 0.963436;0.423164;, - 0.960557;0.404342;, - 0.955628;0.408440;, - 0.100772;0.470691;, - 0.111465;0.479862;, - 0.110995;0.480595;, - 0.098196;0.480010;, - 0.097958;0.480595;, - 0.101627;0.502243;, - 0.097058;0.499087;, - 0.107946;0.502387;, - 0.099104;0.486238;, - 0.110652;0.499489;, - 0.111445;0.485555;, - 0.086807;0.443269;, - 0.113511;0.444424;, - 0.132822;0.441307;, - 0.135060;0.441158;, - 0.140395;0.423608;, - 0.198735;0.443346;, - 0.136342;0.424943;, - 0.075366;0.444316;, - 0.027868;0.432074;, - 0.227674;0.440235;, - 0.208127;0.399315;, - 0.195515;0.443409;, - 0.227674;0.438745;, - 0.256190;0.399124;, - 0.267237;0.439863;, - 0.269540;0.435635;, - 0.066616;0.410202;, - 0.071134;0.428124;, - 0.367433;0.293476;, - 0.367433;0.324669;, - 0.367433;0.240473;, - 0.075217;0.960259;, - 0.057618;0.889801;, - 0.039094;0.831536;, - 0.022855;0.783300;, - 0.016830;0.710664;, - 0.152154;0.014424;, - 0.206640;0.029904;, - 0.263299;0.059838;, - 0.297418;0.072112;, - 0.101798;0.013560;, - 0.322500;0.345093;, - 0.339698;0.346140;, - 0.349771;0.347008;, - 0.187234;0.346447;, - 0.206286;0.347083;, - 0.192520;0.385320;, - 0.233624;0.344280;, - 0.264945;0.347083;, - 0.283942;0.347008;, - 0.302605;0.346140;, - 0.302349;0.346140;, - 0.297808;0.380974;, - 0.191723;0.377471;, - 0.297916;0.373284;, - 0.096555;0.337516;, - 0.141389;0.337516;, - 0.141143;0.337516;, - 0.155781;0.337516;, - 0.139486;0.355087;, - 0.169423;0.337516;, - 0.139682;0.337516;, - 0.094962;0.337516;, - 0.139079;0.356255;, - 0.070832;0.337516;, - 0.037745;0.337516;, - 0.059451;0.337516;, - 0.034063;0.355263;, - 0.069376;0.337516;, - 0.070089;0.337516;, - 0.078341;0.360000;, - 0.140295;0.410202;, - 0.154671;0.410202;, - 0.169423;0.410202;, - 0.106374;0.410202;, - 0.066616;0.410202;, - 0.050267;0.412054;, - 0.108395;0.410202;, - 0.069646;0.449516;, - 0.052779;0.459751;, - 0.303759;0.398990;, - 0.301467;0.437159;, - 0.031124;0.452374;, - 0.027488;0.628182;, - 0.133164;0.444513;, - 0.267437;0.438220;, - 0.140673;0.410202;, - 0.138160;0.410202;, - 0.035715;0.406444;, - 0.983283;0.552269;, - 0.717768;0.549735;, - 0.665848;0.551563;, - 0.665848;0.603961;, - 0.665848;0.624999;, - 0.416895;0.485971;, - 0.465080;0.495146;, - 0.554443;0.490049;, - 0.596048;0.486003;, - 0.653986;0.485971;, - 0.648116;0.507207;, - 0.495199;0.500632;, - 0.453668;0.524293;, - 0.520895;0.500658;, - 0.647703;0.508662;, - 0.453966;0.523505;, - 0.644424;0.554503;, - 0.639118;0.604724;, - 0.427648;0.643446;, - 0.408566;0.643446;, - 0.645657;0.643446;, - 0.620138;0.643446;, - 0.510273;0.643446;, - 0.560244;0.643446;, - 0.664199;0.736052;, - 0.664199;0.796555;, - 0.531908;0.770624;, - 0.708835;0.738811;, - 0.532529;0.770158;, - 0.708835;0.799314;, - 0.971027;0.739715;, - 0.971027;0.800221;, - 0.967319;0.797731;, - 0.967319;0.737225;, - 0.859756;0.739928;, - 0.859756;0.800434;, - 0.848628;0.797539;, - 0.848628;0.737033;, - 0.768886;0.740271;, - 0.768886;0.800774;, - 0.716979;0.794925;, - 0.716979;0.734422;, - 0.682021;0.697485;, - 0.731679;0.697485;, - 0.781335;0.697485;, - 0.830993;0.697485;, - 0.880650;0.697485;, - 0.930304;0.697485;, - 0.979961;0.697485;, - 0.582708;0.669200;, - 0.582708;0.697485;, - 0.632365;0.697485;, - 0.582708;0.199240;, - 0.582708;0.474517;, - 0.582708;0.480018;, - 0.582708;0.663701;, - 0.731679;0.028928;, - 0.682021;0.028928;, - 0.781335;0.028928;, - 0.830993;0.028928;, - 0.880650;0.028928;, - 0.930304;0.028928;, - 0.979961;0.028928;, - 0.632365;0.028928;, - 0.582708;0.028928;, - 0.582708;0.038480;, - 0.582708;0.038480;, - 0.582708;0.199240;, - 0.525596;0.231189;, - 0.496696;0.202288;, - 0.450065;0.221604;, - 0.450065;0.262474;, - 0.393391;0.955706;, - 0.393391;0.912613;, - 0.438450;0.893948;, - 0.468922;0.924421;, - 0.556881;0.155657;, - 0.516012;0.155657;, - 0.457115;0.848889;, - 0.500207;0.848889;, - 0.525596;0.080125;, - 0.496696;0.109022;, - 0.438450;0.803826;, - 0.468922;0.773357;, - 0.450065;0.048836;, - 0.450065;0.089706;, - 0.393391;0.785161;, - 0.393391;0.742068;, - 0.374533;0.080125;, - 0.403431;0.109022;, - 0.348331;0.803826;, - 0.317859;0.773357;, - 0.343249;0.155657;, - 0.384118;0.155657;, - 0.329666;0.848889;, - 0.286574;0.848889;, - 0.374533;0.231189;, - 0.403431;0.202288;, - 0.348331;0.893948;, - 0.317859;0.924421;, - 0.519767;0.225363;, - 0.496696;0.202288;, - 0.450065;0.221604;, - 0.450065;0.254234;, - 0.393391;0.947466;, - 0.393391;0.912613;, - 0.438450;0.893948;, - 0.463096;0.918595;, - 0.548641;0.155657;, - 0.516012;0.155657;, - 0.457115;0.848889;, - 0.491967;0.848889;, - 0.519767;0.085951;, - 0.496696;0.109022;, - 0.438450;0.803826;, - 0.463096;0.779183;, - 0.450065;0.057076;, - 0.450065;0.089706;, - 0.393391;0.785161;, - 0.393391;0.750308;, - 0.380359;0.085951;, - 0.403431;0.109022;, - 0.348331;0.803826;, - 0.323688;0.779183;, - 0.351488;0.155657;, - 0.384118;0.155657;, - 0.329666;0.848889;, - 0.294813;0.848889;, - 0.380359;0.225363;, - 0.403431;0.202288;, - 0.348331;0.893948;, - 0.323688;0.918595;; - } - - VertexDuplicationIndices - { - 1479; - 979; - 0, - 1, - 2, - 3, - 4, - 5, - 6, - 7, - 8, - 9, - 10, - 11, - 12, - 13, - 14, - 15, - 16, - 17, - 18, - 19, - 20, - 21, - 22, - 23, - 24, - 25, - 26, - 27, - 28, - 29, - 30, - 31, - 32, - 33, - 34, - 35, - 36, - 37, - 38, - 39, - 40, - 41, - 42, - 43, - 44, - 45, - 46, - 47, - 48, - 49, - 50, - 51, - 52, - 53, - 54, - 55, - 56, - 57, - 58, - 59, - 60, - 61, - 62, - 63, - 64, - 65, - 66, - 67, - 68, - 69, - 70, - 71, - 72, - 73, - 74, - 75, - 76, - 77, - 78, - 79, - 80, - 81, - 82, - 83, - 84, - 85, - 86, - 87, - 88, - 89, - 90, - 91, - 92, - 93, - 94, - 95, - 96, - 97, - 98, - 99, - 100, - 101, - 102, - 103, - 104, - 105, - 106, - 107, - 108, - 109, - 110, - 111, - 112, - 113, - 114, - 115, - 116, - 117, - 118, - 119, - 120, - 121, - 122, - 123, - 124, - 125, - 126, - 127, - 128, - 129, - 130, - 131, - 132, - 133, - 134, - 135, - 136, - 137, - 138, - 139, - 140, - 141, - 142, - 143, - 144, - 145, - 146, - 147, - 148, - 149, - 150, - 151, - 152, - 153, - 154, - 155, - 156, - 157, - 158, - 159, - 160, - 161, - 162, - 163, - 164, - 165, - 166, - 167, - 168, - 169, - 170, - 171, - 172, - 173, - 174, - 175, - 176, - 177, - 178, - 179, - 180, - 181, - 182, - 183, - 184, - 185, - 186, - 187, - 188, - 189, - 190, - 191, - 192, - 193, - 194, - 195, - 196, - 197, - 198, - 199, - 200, - 201, - 202, - 203, - 204, - 205, - 206, - 207, - 208, - 209, - 210, - 211, - 212, - 213, - 214, - 215, - 216, - 217, - 218, - 219, - 220, - 221, - 222, - 223, - 224, - 225, - 226, - 227, - 228, - 229, - 230, - 231, - 232, - 233, - 234, - 235, - 236, - 237, - 238, - 239, - 240, - 241, - 242, - 243, - 244, - 245, - 246, - 247, - 248, - 249, - 250, - 251, - 252, - 253, - 254, - 255, - 256, - 257, - 258, - 259, - 260, - 261, - 262, - 263, - 264, - 265, - 266, - 267, - 268, - 269, - 270, - 271, - 272, - 273, - 274, - 275, - 276, - 277, - 278, - 279, - 280, - 281, - 282, - 283, - 284, - 285, - 286, - 287, - 288, - 289, - 290, - 291, - 292, - 293, - 294, - 295, - 296, - 297, - 298, - 299, - 300, - 301, - 302, - 303, - 304, - 305, - 306, - 307, - 308, - 309, - 310, - 311, - 312, - 313, - 314, - 315, - 316, - 317, - 318, - 319, - 320, - 321, - 322, - 323, - 324, - 325, - 326, - 327, - 328, - 329, - 330, - 331, - 332, - 333, - 334, - 335, - 336, - 337, - 338, - 339, - 340, - 341, - 342, - 343, - 344, - 345, - 346, - 347, - 348, - 349, - 350, - 351, - 352, - 353, - 354, - 355, - 356, - 357, - 358, - 359, - 360, - 361, - 362, - 363, - 364, - 365, - 366, - 367, - 368, - 369, - 370, - 371, - 372, - 373, - 374, - 375, - 376, - 377, - 378, - 379, - 380, - 381, - 382, - 383, - 384, - 385, - 386, - 387, - 388, - 389, - 390, - 391, - 392, - 393, - 394, - 395, - 396, - 397, - 398, - 399, - 400, - 401, - 402, - 403, - 404, - 405, - 406, - 407, - 408, - 409, - 410, - 411, - 412, - 413, - 414, - 415, - 416, - 417, - 418, - 419, - 420, - 421, - 422, - 423, - 424, - 425, - 426, - 427, - 428, - 429, - 430, - 431, - 432, - 433, - 434, - 435, - 436, - 437, - 438, - 439, - 440, - 441, - 442, - 443, - 444, - 445, - 446, - 447, - 448, - 449, - 450, - 451, - 452, - 453, - 454, - 455, - 456, - 457, - 458, - 459, - 460, - 461, - 462, - 463, - 464, - 465, - 466, - 467, - 468, - 469, - 470, - 471, - 472, - 473, - 474, - 475, - 476, - 477, - 478, - 479, - 480, - 481, - 482, - 483, - 484, - 485, - 486, - 487, - 488, - 489, - 490, - 491, - 492, - 493, - 494, - 495, - 496, - 497, - 498, - 499, - 500, - 501, - 502, - 503, - 504, - 505, - 506, - 507, - 508, - 509, - 510, - 511, - 512, - 513, - 514, - 515, - 516, - 517, - 518, - 519, - 520, - 521, - 522, - 523, - 524, - 525, - 526, - 527, - 528, - 529, - 530, - 531, - 532, - 533, - 534, - 535, - 536, - 537, - 538, - 539, - 540, - 541, - 542, - 543, - 544, - 545, - 546, - 547, - 548, - 549, - 550, - 551, - 552, - 553, - 554, - 555, - 556, - 557, - 558, - 559, - 560, - 561, - 562, - 563, - 564, - 565, - 566, - 567, - 568, - 569, - 570, - 571, - 572, - 573, - 574, - 575, - 576, - 577, - 578, - 579, - 580, - 581, - 582, - 583, - 584, - 585, - 586, - 587, - 588, - 589, - 590, - 591, - 592, - 593, - 594, - 595, - 596, - 597, - 598, - 599, - 600, - 601, - 602, - 603, - 604, - 605, - 606, - 607, - 608, - 609, - 610, - 611, - 612, - 613, - 614, - 615, - 616, - 617, - 618, - 619, - 620, - 621, - 622, - 623, - 624, - 625, - 626, - 627, - 628, - 629, - 630, - 631, - 632, - 633, - 634, - 635, - 636, - 637, - 638, - 639, - 640, - 641, - 642, - 643, - 644, - 645, - 646, - 647, - 648, - 649, - 650, - 651, - 652, - 653, - 654, - 655, - 656, - 657, - 658, - 659, - 660, - 661, - 662, - 663, - 664, - 665, - 666, - 667, - 668, - 669, - 670, - 671, - 672, - 673, - 674, - 675, - 676, - 677, - 678, - 679, - 680, - 681, - 682, - 683, - 684, - 685, - 686, - 687, - 688, - 689, - 690, - 691, - 692, - 693, - 694, - 695, - 696, - 697, - 698, - 699, - 700, - 701, - 702, - 703, - 704, - 705, - 706, - 707, - 708, - 709, - 710, - 711, - 712, - 713, - 714, - 715, - 716, - 717, - 718, - 719, - 720, - 721, - 722, - 723, - 724, - 725, - 726, - 727, - 728, - 729, - 730, - 731, - 732, - 733, - 734, - 735, - 736, - 737, - 738, - 739, - 740, - 741, - 742, - 743, - 744, - 745, - 746, - 747, - 748, - 749, - 750, - 751, - 752, - 753, - 754, - 755, - 756, - 757, - 758, - 759, - 760, - 761, - 762, - 763, - 764, - 765, - 766, - 767, - 768, - 769, - 770, - 771, - 772, - 773, - 774, - 775, - 776, - 777, - 778, - 779, - 780, - 781, - 782, - 783, - 784, - 785, - 786, - 787, - 788, - 789, - 790, - 791, - 792, - 793, - 794, - 795, - 796, - 797, - 798, - 799, - 800, - 801, - 802, - 803, - 804, - 805, - 806, - 807, - 808, - 809, - 810, - 811, - 812, - 813, - 814, - 815, - 816, - 817, - 818, - 819, - 820, - 821, - 822, - 823, - 824, - 825, - 826, - 827, - 828, - 829, - 830, - 831, - 832, - 833, - 834, - 835, - 836, - 837, - 838, - 839, - 840, - 841, - 842, - 843, - 844, - 845, - 846, - 847, - 848, - 849, - 850, - 851, - 852, - 853, - 854, - 855, - 856, - 857, - 858, - 859, - 860, - 861, - 862, - 863, - 864, - 865, - 866, - 867, - 868, - 869, - 870, - 871, - 872, - 873, - 874, - 875, - 876, - 877, - 878, - 879, - 880, - 881, - 882, - 883, - 884, - 885, - 886, - 887, - 888, - 889, - 890, - 891, - 892, - 893, - 894, - 895, - 896, - 897, - 898, - 899, - 900, - 901, - 902, - 903, - 904, - 905, - 906, - 907, - 908, - 909, - 910, - 911, - 912, - 913, - 914, - 915, - 916, - 917, - 918, - 919, - 920, - 921, - 922, - 923, - 924, - 925, - 926, - 927, - 928, - 929, - 930, - 931, - 932, - 933, - 934, - 935, - 936, - 937, - 938, - 939, - 940, - 941, - 942, - 943, - 944, - 945, - 946, - 947, - 948, - 949, - 950, - 951, - 952, - 953, - 954, - 955, - 956, - 957, - 958, - 959, - 960, - 961, - 962, - 963, - 964, - 965, - 966, - 967, - 968, - 969, - 970, - 971, - 972, - 973, - 974, - 975, - 976, - 977, - 978; - 79, - 68, - 93, - 94, - 127, - 138, - 139, - 142, - 141, - 140, - 144, - 143, - 145, - 146, - 148, - 147, - 149, - 150, - 150, - 153, - 53, - 154, - 163, - 52, - 151, - 49, - 48, - 52, - 55, - 95, - 79, - 78, - 80, - 81, - 184, - 185, - 186, - 187, - 188, - 189, - 190, - 191, - 192, - 193, - 271, - 282, - 283, - 286, - 285, - 288, - 284, - 287, - 289, - 290, - 292, - 291, - 293, - 294, - 294, - 209, - 296, - 295, - 303, - 210, - 151, - 164, - 205, - 206, - 210, - 211, - 246, - 231, - 232, - 233, - 174, - 184, - 320, - 321, - 322, - 323, - 324, - 325, - 326, - 327, - 336, - 339, - 340, - 341, - 342, - 345, - 346, - 347, - 340, - 350, - 351, - 361, - 367, - 375, - 374, - 386, - 392, - 399, - 402, - 406, - 407, - 404, - 408, - 420, - 425, - 426, - 426, - 423, - 417, - 404, - 440, - 439, - 444, - 443, - 445, - 454, - 460, - 429, - 428, - 459, - 459, - 430, - 431, - 433, - 453, - 458, - 464, - 466, - 467, - 472, - 469, - 471, - 470, - 483, - 487, - 480, - 499, - 500, - 502, - 503, - 476, - 477, - 481, - 482, - 504, - 506, - 508, - 507, - 505, - 510, - 509, - 511, - 512, - 513, - 514, - 521, - 522, - 520, - 528, - 522, - 527, - 525, - 523, - 530, - 532, - 519, - 524, - 516, - 515, - 538, - 518, - 529, - 536, - 542, - 543, - 558, - 566, - 402, - 401, - 407, - 410, - 413, - 415, - 590, - 588, - 591, - 592, - 593, - 431, - 589, - 598, - 544, - 543, - 546, - 548, - 546, - 607, - 550, - 552, - 554, - 556, - 556, - 612, - 615, - 620, - 613, - 614, - 615, - 613, - 621, - 616, - 617, - 616, - 624, - 618, - 619, - 618, - 626, - 620, - 620, - 628, - 538, - 539, - 540, - 535, - 532, - 531, - 537, - 526, - 528, - 518, - 540, - 527, - 517, - 523, - 515, - 538, - 540, - 532, - 406, - 399, - 406, - 633, - 639, - 637, - 638, - 639, - 640, - 644, - 638, - 641, - 643, - 642, - 650, - 649, - 656, - 662, - 469, - 470, - 478, - 470, - 473, - 479, - 675, - 676, - 674, - 673, - 683, - 691, - 689, - 703, - 704, - 678, - 681, - 710, - 708, - 711, - 709, - 712, - 714, - 715, - 713, - 717, - 716, - 718, - 724, - 725, - 726, - 726, - 732, - 729, - 730, - 727, - 734, - 723, - 735, - 728, - 719, - 742, - 720, - 721, - 740, - 733, - 746, - 745, - 761, - 437, - 440, - 444, - 447, - 450, - 788, - 790, - 791, - 792, - 789, - 745, - 748, - 750, - 750, - 752, - 798, - 754, - 756, - 758, - 760, - 760, - 803, - 806, - 811, - 805, - 804, - 804, - 806, - 812, - 807, - 807, - 808, - 815, - 809, - 809, - 810, - 817, - 811, - 811, - 819, - 742, - 743, - 744, - 739, - 735, - 736, - 741, - 732, - 731, - 744, - 721, - 730, - 722, - 727, - 720, - 742, - 744, - 735, - 443, - 439, - 443, - 824, - 830, - 829, - 828, - 831, - 830, - 829, - 835, - 832, - 834, - 833, - 841, - 840, - 847, - 853, - 675, - 674, - 674, - 682, - 677, - 684, - 883, - 860, - 859, - 889, - 874, - 873, - 891, - 876, - 875, - 892, - 890, - 877, - 878, - 893, - 895, - 879, - 881, - 896, - 898, - 897, - 905, - 908, - 911, - 914, - 917, - 918, - 917, - 920, - 935, - 936, - 951, - 952, - 902, - 904, - 907, - 910, - 913, - 916, - 919, - 922, - 919, - 961, - 975, - 976, - 963, - 956, - 955, - 964, - 965, - 924, - 923, - 966, - 967, - 957, - 927, - 968, - 969, - 958, - 929, - 970, - 971, - 959, - 931, - 972, - 973, - 960, - 933, - 974, - 975, - 961, - 935, - 976, - 977, - 962, - 937, - 978, - 939, - 926, - 925, - 940, - 941, - 901, - 900, - 942, - 943, - 928, - 906, - 944, - 945, - 930, - 909, - 946, - 947, - 932, - 912, - 948, - 949, - 934, - 915, - 950, - 951, - 936, - 918, - 952, - 953, - 938, - 921, - 954; - } - - MeshMaterialList - { - 2; - 1896; - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0; - - Material Material0 - { - 0.800000;0.800000;0.800000;1.000000;; - 0.000000; - 0.000000;0.000000;0.000000;; - 0.364706;0.364706;0.364706;; - - TextureFileName - { - "axe.jpg"; - } - } - - Material Material1 - { - 0.800000;0.800000;0.800000;1.000000;; - 0.000000; - 0.000000;0.000000;0.000000;; - 0.305882;0.305882;0.305882;; - - TextureFileName - { - "dwarf.jpg"; - } - } - - } - - XSkinMeshHeader - { - 1; - 3; - 40; - } - - SkinWeights - { - "middle"; - 19; - 565, - 566, - 567, - 568, - 569, - 570, - 571, - 595, - 599, - 600, - 603, - 604, - 769, - 770, - 771, - 772, - 773, - 795, - 1159; - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000; - 1.000000,0.000000,0.000000,0.000000, - 0.000000,1.000000,0.000000,0.000000, - 0.000000,0.000000,1.000000,0.000000, - -0.184641,-30.206568,0.000000,1.000000;; - } - - SkinWeights - { - "lhip"; - 18; - 746, - 747, - 749, - 751, - 753, - 755, - 757, - 759, - 761, - 762, - 763, - 764, - 765, - 766, - 767, - 768, - 1286, - 1288; - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000; - 1.000000,0.000000,0.000000,0.000000, - 0.000000,1.000000,0.000000,0.000000, - 0.000000,0.000000,1.000000,0.000000, - 5.006365,-26.736708,0.000000,1.000000;; - } - - SkinWeights - { - "lknee"; - 85; - 735, - 736, - 739, - 740, - 741, - 742, - 743, - 744, - 745, - 748, - 750, - 752, - 754, - 756, - 758, - 760, - 796, - 797, - 798, - 799, - 800, - 801, - 802, - 803, - 804, - 805, - 806, - 807, - 808, - 809, - 810, - 811, - 812, - 813, - 814, - 815, - 816, - 817, - 818, - 819, - 1278, - 1281, - 1284, - 1287, - 1299, - 1300, - 1301, - 1302, - 1303, - 1304, - 1305, - 1306, - 1307, - 1308, - 1309, - 1310, - 1311, - 1312, - 1313, - 1314, - 1315, - 1316, - 1317, - 1318, - 1319, - 1320, - 1321, - 1322, - 1323, - 1324, - 1325, - 1326, - 1327, - 1328, - 1329, - 1330, - 1331, - 1332, - 1333, - 1334, - 1335, - 1338, - 1344, - 1345, - 1346; - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000; - 1.000000,0.000000,0.000000,0.000000, - 0.000000,1.000000,0.000000,0.000000, - 0.000000,0.000000,1.000000,0.000000, - 6.909735,-17.919210,0.000000,1.000000;; - } - - SkinWeights - { - "lankle"; - 30; - 708, - 709, - 710, - 711, - 712, - 717, - 718, - 719, - 720, - 721, - 722, - 723, - 728, - 729, - 1257, - 1258, - 1259, - 1260, - 1261, - 1265, - 1267, - 1273, - 1277, - 1279, - 1280, - 1282, - 1283, - 1339, - 1341, - 1343; - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000; - 1.000000,0.000000,0.000000,0.000000, - 0.000000,1.000000,0.000000,0.000000, - 0.000000,0.000000,1.000000,0.000000, - 8.467036,-5.045920,-3.507543,1.000000;; - } - - SkinWeights - { - "ltoe"; - 32; - 713, - 714, - 715, - 716, - 724, - 725, - 726, - 727, - 730, - 731, - 732, - 733, - 734, - 737, - 738, - 1262, - 1263, - 1264, - 1266, - 1268, - 1269, - 1270, - 1271, - 1272, - 1274, - 1275, - 1276, - 1285, - 1336, - 1337, - 1340, - 1342; - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000; - 1.000000,0.000000,0.000000,0.000000, - 0.000000,1.000000,0.000000,0.000000, - 0.000000,0.000000,1.000000,0.000000, - 8.550578,-2.208009,1.760649,1.000000;; - } - - SkinWeights - { - "rhip"; - 37; - 541, - 542, - 543, - 544, - 545, - 546, - 547, - 548, - 549, - 550, - 551, - 552, - 553, - 554, - 555, - 556, - 557, - 558, - 559, - 560, - 561, - 562, - 563, - 564, - 1156, - 1157, - 1158, - 1174, - 1175, - 1176, - 1177, - 1178, - 1180, - 1181, - 1182, - 1183, - 1184; - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000; - 1.000000,0.000000,0.000000,0.000000, - 0.000000,1.000000,0.000000,0.000000, - 0.000000,0.000000,1.000000,0.000000, - -6.067782,-27.255383,0.000000,1.000000;; - } - - SkinWeights - { - "rknee"; - 66; - 531, - 532, - 535, - 536, - 537, - 538, - 539, - 540, - 605, - 606, - 607, - 608, - 609, - 610, - 611, - 612, - 613, - 614, - 615, - 616, - 617, - 618, - 619, - 620, - 621, - 622, - 623, - 624, - 625, - 626, - 627, - 628, - 1147, - 1152, - 1155, - 1179, - 1185, - 1186, - 1187, - 1188, - 1189, - 1190, - 1191, - 1192, - 1193, - 1194, - 1195, - 1196, - 1197, - 1198, - 1199, - 1200, - 1201, - 1202, - 1203, - 1204, - 1205, - 1206, - 1207, - 1208, - 1209, - 1210, - 1214, - 1219, - 1220, - 1221; - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000; - 1.000000,0.000000,0.000000,0.000000, - 0.000000,1.000000,0.000000,0.000000, - 0.000000,0.000000,1.000000,0.000000, - -7.625084,-17.573425,0.000000,1.000000;; - } - - SkinWeights - { - "rankle"; - 30; - 504, - 505, - 506, - 507, - 508, - 512, - 514, - 515, - 516, - 517, - 518, - 519, - 524, - 525, - 1127, - 1128, - 1129, - 1130, - 1131, - 1135, - 1137, - 1144, - 1148, - 1149, - 1150, - 1151, - 1153, - 1213, - 1216, - 1218; - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000; - 1.000000,0.000000,0.000000,0.000000, - 0.000000,1.000000,0.000000,0.000000, - 0.000000,0.000000,1.000000,0.000000, - -8.663285,-4.527243,-3.507543,1.000000;; - } - - SkinWeights - { - "rtoe"; - 32; - 509, - 510, - 511, - 513, - 520, - 521, - 522, - 523, - 526, - 527, - 528, - 529, - 530, - 533, - 534, - 1132, - 1133, - 1134, - 1136, - 1138, - 1139, - 1140, - 1141, - 1142, - 1143, - 1145, - 1146, - 1154, - 1211, - 1212, - 1215, - 1217; - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000; - 1.000000,0.000000,0.000000,0.000000, - 0.000000,1.000000,0.000000,0.000000, - 0.000000,0.000000,1.000000,0.000000, - -8.824361,-2.258848,1.547814,1.000000;; - } - - SkinWeights - { - "spine2"; - 82; - 401, - 402, - 407, - 410, - 413, - 415, - 431, - 437, - 440, - 444, - 447, - 450, - 576, - 577, - 578, - 579, - 580, - 581, - 582, - 583, - 584, - 585, - 586, - 587, - 588, - 589, - 590, - 591, - 592, - 593, - 594, - 596, - 597, - 598, - 601, - 602, - 778, - 779, - 780, - 781, - 782, - 783, - 784, - 785, - 786, - 787, - 788, - 789, - 790, - 791, - 792, - 793, - 794, - 1081, - 1083, - 1093, - 1095, - 1105, - 1160, - 1161, - 1162, - 1163, - 1164, - 1165, - 1166, - 1167, - 1168, - 1169, - 1170, - 1171, - 1172, - 1173, - 1289, - 1290, - 1291, - 1292, - 1293, - 1294, - 1295, - 1296, - 1297, - 1298; - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000; - 1.000000,0.000000,0.000000,0.000000, - 0.000000,1.000000,0.000000,0.000000, - 0.000000,0.000000,1.000000,0.000000, - -0.176384,-34.278362,0.000000,1.000000;; - } - - SkinWeights - { - "Joint76"; - 23; - 399, - 400, - 406, - 409, - 412, - 416, - 430, - 438, - 439, - 443, - 446, - 449, - 1080, - 1082, - 1094, - 1096, - 1104, - 1222, - 1223, - 1224, - 1347, - 1348, - 1349; - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000; - 1.000000,0.000000,0.000000,0.000000, - 0.000000,1.000000,0.000000,0.000000, - 0.000000,0.000000,1.000000,0.000000, - -0.135189,-45.764740,0.000000,1.000000;; - } - - SkinWeights - { - "spine1"; - 58; - 403, - 404, - 405, - 408, - 411, - 414, - 417, - 418, - 419, - 420, - 421, - 422, - 423, - 424, - 425, - 426, - 427, - 428, - 429, - 432, - 433, - 434, - 441, - 442, - 445, - 448, - 451, - 452, - 453, - 454, - 455, - 456, - 457, - 458, - 459, - 460, - 461, - 462, - 463, - 1084, - 1085, - 1086, - 1087, - 1088, - 1089, - 1090, - 1091, - 1092, - 1097, - 1098, - 1099, - 1100, - 1101, - 1102, - 1103, - 1106, - 1107, - 1108; - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000; - 1.000000,0.000000,0.000000,0.000000, - 0.000000,1.000000,0.000000,0.000000, - 0.000000,0.000000,1.000000,0.000000, - -0.077645,-48.894562,0.000000,1.000000;; - } - - SkinWeights - { - "head"; - 372; - 48, - 49, - 50, - 51, - 52, - 53, - 54, - 55, - 56, - 57, - 58, - 59, - 60, - 61, - 62, - 63, - 64, - 65, - 66, - 67, - 68, - 69, - 70, - 71, - 72, - 73, - 74, - 75, - 76, - 77, - 78, - 79, - 80, - 81, - 82, - 83, - 84, - 85, - 86, - 87, - 88, - 89, - 90, - 91, - 92, - 93, - 94, - 95, - 96, - 97, - 98, - 99, - 100, - 101, - 102, - 103, - 104, - 105, - 106, - 107, - 108, - 109, - 110, - 111, - 112, - 113, - 114, - 115, - 116, - 117, - 118, - 119, - 120, - 127, - 136, - 137, - 151, - 152, - 153, - 154, - 155, - 156, - 157, - 158, - 159, - 160, - 161, - 162, - 163, - 164, - 165, - 166, - 167, - 168, - 169, - 170, - 171, - 172, - 173, - 174, - 175, - 176, - 177, - 178, - 179, - 180, - 181, - 182, - 183, - 184, - 185, - 186, - 187, - 188, - 189, - 190, - 191, - 192, - 193, - 194, - 195, - 196, - 197, - 198, - 199, - 200, - 201, - 202, - 203, - 204, - 205, - 206, - 207, - 208, - 209, - 210, - 211, - 212, - 213, - 214, - 215, - 216, - 217, - 218, - 219, - 220, - 221, - 222, - 223, - 224, - 225, - 226, - 227, - 228, - 229, - 230, - 231, - 232, - 233, - 234, - 235, - 236, - 237, - 238, - 239, - 240, - 241, - 242, - 243, - 244, - 245, - 246, - 247, - 248, - 249, - 250, - 251, - 252, - 253, - 254, - 255, - 256, - 257, - 258, - 259, - 260, - 261, - 262, - 263, - 264, - 265, - 266, - 271, - 280, - 281, - 295, - 296, - 297, - 298, - 299, - 300, - 301, - 302, - 303, - 304, - 305, - 306, - 307, - 308, - 309, - 310, - 311, - 312, - 313, - 314, - 315, - 316, - 317, - 318, - 319, - 320, - 321, - 322, - 323, - 324, - 325, - 326, - 327, - 328, - 329, - 330, - 331, - 332, - 333, - 334, - 335, - 336, - 337, - 338, - 339, - 340, - 341, - 342, - 343, - 344, - 345, - 346, - 347, - 348, - 349, - 350, - 351, - 352, - 353, - 354, - 355, - 356, - 357, - 358, - 359, - 360, - 361, - 362, - 363, - 364, - 365, - 366, - 367, - 368, - 369, - 370, - 371, - 372, - 373, - 374, - 375, - 376, - 377, - 378, - 379, - 380, - 381, - 382, - 383, - 384, - 385, - 386, - 387, - 388, - 389, - 390, - 391, - 392, - 393, - 394, - 395, - 396, - 397, - 398, - 979, - 980, - 981, - 982, - 983, - 998, - 999, - 1000, - 1001, - 1002, - 1003, - 1004, - 1005, - 1006, - 1007, - 1008, - 1009, - 1010, - 1011, - 1012, - 1013, - 1014, - 1015, - 1016, - 1017, - 1018, - 1019, - 1020, - 1021, - 1022, - 1023, - 1038, - 1039, - 1040, - 1041, - 1042, - 1043, - 1044, - 1045, - 1046, - 1047, - 1048, - 1049, - 1050, - 1051, - 1052, - 1053, - 1054, - 1055, - 1056, - 1057, - 1058, - 1059, - 1060, - 1061, - 1062, - 1063, - 1064, - 1065, - 1066, - 1067, - 1068, - 1069, - 1070, - 1071, - 1072, - 1073, - 1074, - 1075, - 1076, - 1077, - 1078, - 1079; - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000; - 1.000000,0.000000,0.000000,0.000000, - 0.000000,1.000000,0.000000,0.000000, - 0.000000,0.000000,1.000000,0.000000, - -0.077645,-53.077965,0.000000,1.000000;; - } - - SkinWeights - { - "Joint36"; - 9; - 121, - 122, - 123, - 124, - 125, - 126, - 128, - 129, - 132; - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000; - 1.000000,0.000000,0.000000,0.000000, - 0.000000,1.000000,0.000000,0.000000, - 0.000000,0.000000,1.000000,0.000000, - -2.428693,-50.108727,5.128667,1.000000;; - } - - SkinWeights - { - "Joint39"; - 19; - 130, - 131, - 133, - 134, - 135, - 138, - 139, - 140, - 141, - 142, - 143, - 144, - 984, - 985, - 986, - 987, - 988, - 989, - 990; - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000; - 1.000000,0.000000,0.000000,0.000000, - 0.000000,1.000000,0.000000,0.000000, - 0.000000,0.000000,1.000000,0.000000, - -4.949857,-46.006042,7.908250,1.000000;; - } - - SkinWeights - { - "Joint40"; - 10; - 145, - 146, - 147, - 148, - 149, - 991, - 992, - 993, - 994, - 995; - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000; - 1.000000,0.000000,0.000000,0.000000, - 0.000000,1.000000,0.000000,0.000000, - 0.000000,0.000000,1.000000,0.000000, - -6.493002,-42.284798,8.792897,1.000000;; - } - - SkinWeights - { - "Joint41"; - 3; - 150, - 996, - 997; - 1.000000, - 1.000000, - 1.000000; - 1.000000,0.000000,0.000000,0.000000, - 0.000000,1.000000,0.000000,0.000000, - 0.000000,0.000000,1.000000,0.000000, - -7.350305,-39.127472,9.733334,1.000000;; - } - - SkinWeights - { - "Joint37"; - 6; - 267, - 268, - 269, - 270, - 272, - 277; - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000; - 1.000000,0.000000,0.000000,0.000000, - 0.000000,1.000000,0.000000,0.000000, - 0.000000,0.000000,1.000000,0.000000, - 2.766480,-49.947918,5.128667,1.000000;; - } - - SkinWeights - { - "Joint38"; - 20; - 273, - 274, - 275, - 276, - 278, - 279, - 282, - 283, - 284, - 285, - 286, - 287, - 288, - 1024, - 1025, - 1026, - 1027, - 1028, - 1029, - 1030; - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000; - 1.000000,0.000000,0.000000,0.000000, - 0.000000,1.000000,0.000000,0.000000, - 0.000000,0.000000,1.000000,0.000000, - 5.080586,-45.749058,7.908250,1.000000;; - } - - SkinWeights - { - "Joint42"; - 10; - 289, - 290, - 291, - 292, - 293, - 1031, - 1032, - 1033, - 1034, - 1035; - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000; - 1.000000,0.000000,0.000000,0.000000, - 0.000000,1.000000,0.000000,0.000000, - 0.000000,0.000000,1.000000,0.000000, - 6.280811,-42.539360,8.793637,1.000000;; - } - - SkinWeights - { - "Joint43"; - 3; - 294, - 1036, - 1037; - 1.000000, - 1.000000, - 1.000000; - 1.000000,0.000000,0.000000,0.000000, - 0.000000,1.000000,0.000000,0.000000, - 0.000000,0.000000,1.000000,0.000000, - 7.566765,-38.843330,9.733334,1.000000;; - } - - SkinWeights - { - "pad2"; - 24; - 24, - 25, - 26, - 27, - 28, - 29, - 30, - 31, - 32, - 33, - 34, - 35, - 36, - 37, - 38, - 39, - 40, - 41, - 42, - 43, - 44, - 45, - 46, - 47; - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000; - 0.986286,-0.159424,0.042717,0.000000, - 0.165048,0.952679,-0.255270,0.000000, - 0.000000,0.258819,0.965926,0.000000, - -2.513408,-50.807816,13.613914,1.000000;; - } - - SkinWeights - { - "pad1"; - 24; - 0, - 1, - 2, - 3, - 4, - 5, - 6, - 7, - 8, - 9, - 10, - 11, - 12, - 13, - 14, - 15, - 16, - 17, - 18, - 19, - 20, - 21, - 22, - 23; - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000; - 1.000000,0.000000,0.000000,0.000000, - 0.000000,1.000000,0.000000,0.000000, - 0.000000,0.000000,1.000000,0.000000, - -5.311174,-52.424309,0.000000,1.000000;; - } - - SkinWeights - { - "lsholda"; - 13; - 774, - 775, - 776, - 777, - 820, - 821, - 822, - 823, - 824, - 825, - 826, - 827, - 1350; - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000; - 1.000000,0.000000,0.000000,0.000000, - 0.000000,1.000000,0.000000,0.000000, - 0.000000,0.000000,1.000000,0.000000, - 10.633429,-47.162376,-3.529744,1.000000;; - } - - SkinWeights - { - "lelbo"; - 62; - 674, - 675, - 677, - 682, - 683, - 684, - 691, - 828, - 829, - 830, - 831, - 832, - 833, - 834, - 835, - 836, - 837, - 838, - 839, - 840, - 841, - 842, - 843, - 844, - 845, - 846, - 847, - 848, - 849, - 850, - 851, - 852, - 853, - 854, - 855, - 856, - 857, - 858, - 1246, - 1248, - 1250, - 1251, - 1351, - 1352, - 1353, - 1354, - 1355, - 1356, - 1357, - 1358, - 1359, - 1360, - 1361, - 1362, - 1363, - 1364, - 1365, - 1366, - 1367, - 1368, - 1369, - 1370; - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000; - 1.000000,0.000000,0.000000,0.000000, - 0.000000,1.000000,0.000000,0.000000, - 0.000000,0.000000,1.000000,0.000000, - 17.175339,-42.063858,-4.235693,1.000000;; - } - - SkinWeights - { - "lwrist"; - 2; - 669, - 670; - 1.000000, - 1.000000; - 1.000000,0.000000,0.000000,0.000000, - 0.000000,1.000000,0.000000,0.000000, - 0.000000,0.000000,1.000000,0.000000, - 25.025633,-35.658024,-4.235693,1.000000;; - } - - SkinWeights - { - "Joint17"; - 8; - 668, - 671, - 672, - 673, - 676, - 692, - 1247, - 1249; - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000; - 1.000000,0.000000,0.000000,0.000000, - 0.000000,1.000000,0.000000,0.000000, - 0.000000,0.000000,1.000000,0.000000, - 28.689102,-31.997549,-4.235693,1.000000;; - } - - SkinWeights - { - "Joint18"; - 8; - 702, - 703, - 704, - 705, - 706, - 707, - 1253, - 1254; - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000; - 1.000000,0.000000,0.000000,0.000000, - 0.000000,1.000000,0.000000,0.000000, - 0.000000,0.000000,1.000000,0.000000, - 29.735809,-29.905848,-4.235693,1.000000;; - } - - SkinWeights - { - "Joint19"; - 8; - 678, - 679, - 680, - 681, - 685, - 686, - 1255, - 1256; - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000; - 1.000000,0.000000,0.000000,0.000000, - 0.000000,1.000000,0.000000,0.000000, - 0.000000,0.000000,1.000000,0.000000, - 29.866648,-26.768299,-4.235693,1.000000;; - } - - SkinWeights - { - "Joint20"; - 10; - 687, - 688, - 689, - 690, - 693, - 694, - 699, - 700, - 701, - 1252; - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000; - 1.000000,0.000000,0.000000,0.000000, - 0.000000,1.000000,0.000000,0.000000, - 0.000000,0.000000,1.000000,0.000000, - 25.287310,-31.343891,-0.753762,1.000000;; - } - - SkinWeights - { - "Joint21"; - 4; - 695, - 696, - 697, - 698; - 1.000000, - 1.000000, - 1.000000, - 1.000000; - 1.000000,0.000000,0.000000,0.000000, - 0.000000,1.000000,0.000000,0.000000, - 0.000000,0.000000,1.000000,0.000000, - 26.334013,-28.859997,-0.753762,1.000000;; - } - - SkinWeights - { - "rsholda"; - 15; - 435, - 436, - 572, - 573, - 574, - 575, - 629, - 630, - 631, - 632, - 633, - 634, - 635, - 636, - 1225; - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000; - 1.000000,0.000000,0.000000,0.000000, - 0.000000,1.000000,0.000000,0.000000, - 0.000000,0.000000,1.000000,0.000000, - -10.064111,-47.456520,-3.529744,1.000000;; - } - - SkinWeights - { - "relbo"; - 62; - 469, - 470, - 473, - 478, - 479, - 480, - 487, - 637, - 638, - 639, - 640, - 641, - 642, - 643, - 644, - 645, - 646, - 647, - 648, - 649, - 650, - 651, - 652, - 653, - 654, - 655, - 656, - 657, - 658, - 659, - 660, - 661, - 662, - 663, - 664, - 665, - 666, - 667, - 1113, - 1115, - 1117, - 1118, - 1226, - 1227, - 1228, - 1229, - 1230, - 1231, - 1232, - 1233, - 1234, - 1235, - 1236, - 1237, - 1238, - 1239, - 1240, - 1241, - 1242, - 1243, - 1244, - 1245; - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000; - 1.000000,0.000000,0.000000,0.000000, - 0.000000,1.000000,0.000000,0.000000, - 0.000000,0.000000,1.000000,0.000000, - -16.867699,-42.096539,-4.235693,1.000000;; - } - - SkinWeights - { - "rwrist"; - 3; - 464, - 465, - 1109; - 1.000000, - 1.000000, - 1.000000; - 1.000000,0.000000,0.000000,0.000000, - 0.000000,1.000000,0.000000,0.000000, - 0.000000,0.000000,1.000000,0.000000, - -25.241344,-35.298512,-4.235693,1.000000;; - } - - SkinWeights - { - "Joint25"; - 10; - 466, - 467, - 468, - 471, - 472, - 488, - 1110, - 1111, - 1112, - 1114; - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000; - 1.000000,0.000000,0.000000,0.000000, - 0.000000,1.000000,0.000000,0.000000, - 0.000000,0.000000,1.000000,0.000000, - -28.904814,-32.160961,-4.235693,1.000000;; - } - - SkinWeights - { - "Joint26"; - 10; - 498, - 499, - 500, - 501, - 502, - 503, - 1119, - 1120, - 1121, - 1122; - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000; - 1.000000,0.000000,0.000000,0.000000, - 0.000000,1.000000,0.000000,0.000000, - 0.000000,0.000000,1.000000,0.000000, - -29.951521,-29.807800,-4.235693,1.000000;; - } - - SkinWeights - { - "Joint27"; - 10; - 474, - 475, - 476, - 477, - 481, - 482, - 1123, - 1124, - 1125, - 1126; - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000; - 1.000000,0.000000,0.000000,0.000000, - 0.000000,1.000000,0.000000,0.000000, - 0.000000,0.000000,1.000000,0.000000, - -29.689844,-26.931713,-4.235693,1.000000;; - } - - SkinWeights - { - "Joint28"; - 7; - 483, - 484, - 485, - 486, - 489, - 490, - 1116; - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000; - 1.000000,0.000000,0.000000,0.000000, - 0.000000,1.000000,0.000000,0.000000, - 0.000000,0.000000,1.000000,0.000000, - -24.456314,-31.115110,-2.201373,1.000000;; - } - - SkinWeights - { - "Joint29"; - 7; - 491, - 492, - 493, - 494, - 495, - 496, - 497; - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000; - 1.000000,0.000000,0.000000,0.000000, - 0.000000,1.000000,0.000000,0.000000, - 0.000000,0.000000,1.000000,0.000000, - -24.717991,-28.631216,-2.201373,1.000000;; - } - - SkinWeights - { - "weapon"; - 228; - 859, - 860, - 861, - 862, - 863, - 864, - 865, - 866, - 867, - 868, - 869, - 870, - 871, - 872, - 873, - 874, - 875, - 876, - 877, - 878, - 879, - 880, - 881, - 882, - 883, - 884, - 885, - 886, - 887, - 888, - 889, - 890, - 891, - 892, - 893, - 894, - 895, - 896, - 897, - 898, - 899, - 900, - 901, - 902, - 903, - 904, - 905, - 906, - 907, - 908, - 909, - 910, - 911, - 912, - 913, - 914, - 915, - 916, - 917, - 918, - 919, - 920, - 921, - 922, - 923, - 924, - 925, - 926, - 927, - 928, - 929, - 930, - 931, - 932, - 933, - 934, - 935, - 936, - 937, - 938, - 939, - 940, - 941, - 942, - 943, - 944, - 945, - 946, - 947, - 948, - 949, - 950, - 951, - 952, - 953, - 954, - 955, - 956, - 957, - 958, - 959, - 960, - 961, - 962, - 963, - 964, - 965, - 966, - 967, - 968, - 969, - 970, - 971, - 972, - 973, - 974, - 975, - 976, - 977, - 978, - 1371, - 1372, - 1373, - 1374, - 1375, - 1376, - 1377, - 1378, - 1379, - 1380, - 1381, - 1382, - 1383, - 1384, - 1385, - 1386, - 1387, - 1388, - 1389, - 1390, - 1391, - 1392, - 1393, - 1394, - 1395, - 1396, - 1397, - 1398, - 1399, - 1400, - 1401, - 1402, - 1403, - 1404, - 1405, - 1406, - 1407, - 1408, - 1409, - 1410, - 1411, - 1412, - 1413, - 1414, - 1415, - 1416, - 1417, - 1418, - 1419, - 1420, - 1421, - 1422, - 1423, - 1424, - 1425, - 1426, - 1427, - 1428, - 1429, - 1430, - 1431, - 1432, - 1433, - 1434, - 1435, - 1436, - 1437, - 1438, - 1439, - 1440, - 1441, - 1442, - 1443, - 1444, - 1445, - 1446, - 1447, - 1448, - 1449, - 1450, - 1451, - 1452, - 1453, - 1454, - 1455, - 1456, - 1457, - 1458, - 1459, - 1460, - 1461, - 1462, - 1463, - 1464, - 1465, - 1466, - 1467, - 1468, - 1469, - 1470, - 1471, - 1472, - 1473, - 1474, - 1475, - 1476, - 1477, - 1478; - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000, - 1.000000; - 1.000000,0.000000,0.000000,0.000000, - 0.000000,1.000000,0.000000,0.000000, - 0.000000,0.000000,1.000000,0.000000, - -26.942242,-30.461456,-4.235693,1.000000;; - } - } - } -} - -AnimationSet AnimationSet0 -{ - Animation baseAnimation - { - {base} - - AnimationKey - { - 2; - 23; - 0;3;0.011608,-0.015192,0.000000;;, - 1;3;0.011608,-0.015192,0.000000;;, - 2;3;0.011608,-0.015192,0.000000;;, - 3;3;0.011608,-0.015192,0.000000;;, - 4;3;0.011608,-0.015192,0.000000;;, - 5;3;0.011608,-0.015192,0.000000;;, - 12;3;0.011608,-0.015192,0.000000;;, - 14;3;0.011608,-0.015192,0.000000;;, - 15;3;0.011608,-0.015192,0.000000;;, - 16;3;0.011608,-0.015192,0.000000;;, - 17;3;0.011608,-0.015192,0.000000;;, - 18;3;0.011608,-0.015192,0.000000;;, - 19;3;0.011608,-0.015192,0.000000;;, - 20;3;0.011608,-0.015192,0.000000;;, - 27;3;0.011608,-0.015192,0.000000;;, - 33;3;0.011608,-0.015192,0.000000;;, - 34;3;0.011608,-0.015192,0.000000;;, - 35;3;0.011608,-0.015192,0.000000;;, - 41;3;0.011608,-0.015192,0.000000;;, - 43;3;0.011608,-0.015192,0.000000;;, - 50;3;0.011608,-0.015192,0.000000;;, - 53;3;0.011608,-0.015192,0.000000;;, - 55;3;0.011608,-0.015192,0.000000;;; - } - - AnimationOptions - { - 1; - 1; - } - - AnimationKey - { - 0; - 23; - 0;4;1.000000,0.000000,0.000000,0.000000;;, - 1;4;1.000000,0.000000,0.000000,0.000000;;, - 2;4;1.000000,0.000000,0.000000,0.000000;;, - 3;4;1.000000,0.000000,0.000000,0.000000;;, - 4;4;1.000000,0.000000,0.000000,0.000000;;, - 5;4;1.000000,0.000000,0.000000,0.000000;;, - 12;4;1.000000,0.000000,0.000000,0.000000;;, - 14;4;1.000000,0.000000,0.000000,0.000000;;, - 15;4;1.000000,0.000000,0.000000,0.000000;;, - 16;4;1.000000,0.000000,0.000000,0.000000;;, - 17;4;1.000000,0.000000,0.000000,0.000000;;, - 18;4;1.000000,0.000000,0.000000,0.000000;;, - 19;4;1.000000,0.000000,0.000000,0.000000;;, - 20;4;1.000000,0.000000,0.000000,0.000000;;, - 27;4;1.000000,0.000000,0.000000,0.000000;;, - 33;4;1.000000,0.000000,0.000000,0.000000;;, - 34;4;1.000000,0.000000,0.000000,0.000000;;, - 35;4;1.000000,0.000000,0.000000,0.000000;;, - 41;4;1.000000,0.000000,0.000000,0.000000;;, - 43;4;1.000000,0.000000,0.000000,0.000000;;, - 50;4;1.000000,0.000000,0.000000,0.000000;;, - 53;4;1.000000,0.000000,0.000000,0.000000;;, - 55;4;1.000000,0.000000,0.000000,0.000000;;; - } - - AnimationOptions - { - 1; - 1; - } - } - - Animation middleAnimation - { - {middle} - - AnimationKey - { - 2; - 25; - 0;3;0.173034,30.221760,0.000000;;, - 1;3;0.173034,30.221760,0.000000;;, - 2;3;0.173034,27.773420,0.372200;;, - 3;3;0.173034,24.919014,0.806130;;, - 4;3;0.173034,22.482626,1.176512;;, - 5;3;0.173034,22.482626,1.176512;;, - 12;3;0.173034,22.482626,1.176512;;, - 14;3;0.173034,22.482626,1.176512;;, - 15;3;0.173034,22.482626,1.176512;;, - 16;3;0.173034,24.272297,0.904444;;, - 17;3;0.173034,26.344128,0.589482;;, - 18;3;0.173034,28.455601,0.268494;;, - 19;3;0.173034,30.221760,0.000000;;, - 20;3;0.173034,30.221760,0.000000;;, - 24;3;0.173034,29.353209,0.000000;;, - 27;3;0.173034,29.520485,0.000000;;, - 33;3;0.173034,30.221760,0.000000;;, - 34;3;0.173034,30.221760,0.000000;;, - 35;3;0.173034,30.221760,0.000000;;, - 41;3;0.173034,28.753119,0.000000;;, - 43;3;0.173034,28.285614,0.000000;;, - 45;3;0.173034,28.050383,0.000000;;, - 50;3;0.173034,28.889324,0.000000;;, - 53;3;0.173034,29.697077,0.000000;;, - 55;3;0.173034,30.221760,0.000000;;; - } - - AnimationOptions - { - 1; - 1; - } - - AnimationKey - { - 0; - 25; - 0;4;1.000000,0.000000,0.000000,0.000000;;, - 1;4;1.000000,0.000000,0.000000,0.000000;;, - 2;4;1.000000,0.000000,0.000000,0.000000;;, - 3;4;1.000000,0.000000,0.000000,0.000000;;, - 4;4;1.000000,0.000000,0.000000,0.000000;;, - 5;4;1.000000,0.000000,0.000000,0.000000;;, - 12;4;1.000000,0.000000,0.000000,0.000000;;, - 14;4;1.000000,0.000000,0.000000,0.000000;;, - 15;4;1.000000,0.000000,0.000000,0.000000;;, - 16;4;1.000000,0.000000,0.000000,0.000000;;, - 17;4;1.000000,0.000000,0.000000,0.000000;;, - 18;4;1.000000,0.000000,0.000000,0.000000;;, - 19;4;1.000000,0.000000,0.000000,0.000000;;, - 20;4;1.000000,0.000000,0.000000,0.000000;;, - 24;4;1.000000,0.000000,0.000000,0.000000;;, - 27;4;1.000000,0.000000,0.000000,0.000000;;, - 33;4;1.000000,0.000000,0.000000,0.000000;;, - 34;4;1.000000,0.000000,0.000000,0.000000;;, - 35;4;1.000000,0.000000,0.000000,0.000000;;, - 41;4;1.000000,0.000000,0.000000,0.000000;;, - 43;4;1.000000,0.000000,0.000000,0.000000;;, - 45;4;1.000000,0.000000,0.000000,0.000000;;, - 50;4;1.000000,0.000000,0.000000,0.000000;;, - 53;4;1.000000,0.000000,0.000000,0.000000;;, - 55;4;1.000000,0.000000,0.000000,0.000000;;; - } - - AnimationOptions - { - 1; - 1; - } - } - - Animation lhipAnimation - { - {lhip} - - AnimationKey - { - 2; - 23; - 0;3;-5.191007,-3.469861,0.000000;;, - 1;3;-5.191007,-3.469861,0.000000;;, - 2;3;-5.191007,-3.469861,0.000000;;, - 3;3;-5.191007,-3.469861,0.000000;;, - 4;3;-5.191007,-3.469861,0.000000;;, - 5;3;-5.191007,-3.469861,0.000000;;, - 12;3;-5.191007,-3.469861,0.000000;;, - 14;3;-5.191007,-3.469861,0.000000;;, - 15;3;-5.191007,-3.469861,0.000000;;, - 16;3;-5.191007,-3.469861,0.000000;;, - 17;3;-5.191007,-3.469861,0.000000;;, - 18;3;-5.191007,-3.469861,0.000000;;, - 19;3;-5.191007,-3.469861,0.000000;;, - 20;3;-5.191007,-3.469861,0.000000;;, - 27;3;-5.191007,-3.469861,0.000000;;, - 33;3;-5.191007,-3.469861,0.000000;;, - 34;3;-5.191007,-3.469861,0.000000;;, - 35;3;-5.191007,-3.469861,0.000000;;, - 41;3;-5.191007,-3.469861,0.000000;;, - 43;3;-5.191007,-3.469861,0.000000;;, - 50;3;-5.191007,-3.469861,0.000000;;, - 53;3;-5.191007,-3.469861,0.000000;;, - 55;3;-5.191007,-3.469861,0.000000;;; - } - - AnimationOptions - { - 1; - 1; - } - - AnimationKey - { - 0; - 23; - 0;4;1.000000,0.000000,0.000000,0.000000;;, - 1;4;1.000000,0.000000,0.000000,0.000000;;, - 2;4;0.933591,-0.357025,0.029033,0.009857;;, - 3;4;0.833984,-0.551409,0.020009,0.004259;;, - 4;4;0.751840,-0.659346,0.000000,0.000000;;, - 5;4;0.751840,-0.659346,0.000000,0.000000;;, - 12;4;0.751840,-0.659346,0.000000,0.000000;;, - 14;4;0.751840,-0.659346,0.000000,0.000000;;, - 15;4;0.751840,-0.659346,0.000000,0.000000;;, - 16;4;0.815325,-0.578790,0.015233,0.003854;;, - 17;4;0.880134,-0.473717,0.030180,0.006729;;, - 18;4;0.961855,-0.272346,0.024861,0.006633;;, - 19;4;1.000000,0.000000,0.000000,0.000000;;, - 20;4;1.000000,0.000000,0.000000,0.000000;;, - 27;4;1.000000,0.000000,0.000000,0.000000;;, - 33;4;1.000000,0.000000,0.000000,0.000000;;, - 34;4;1.000000,0.000000,0.000000,0.000000;;, - 35;4;1.000000,0.000000,0.000000,0.000000;;, - 41;4;1.000000,0.000000,0.000000,0.000000;;, - 43;4;1.000000,0.000000,0.000000,0.000000;;, - 50;4;1.000000,0.000000,0.000000,0.000000;;, - 53;4;1.000000,0.000000,0.000000,0.000000;;, - 55;4;1.000000,0.000000,0.000000,0.000000;;; - } - - AnimationOptions - { - 1; - 1; - } - } - - Animation lkneeAnimation - { - {lknee} - - AnimationKey - { - 2; - 25; - 0;3;-1.903369,-8.817497,0.000000;;, - 1;3;-1.903369,-8.817497,0.000000;;, - 2;3;-1.903369,-8.817497,0.000000;;, - 3;3;-1.903369,-8.817497,0.000000;;, - 4;3;-1.903369,-8.817497,0.000000;;, - 5;3;-1.903369,-8.817497,0.000000;;, - 12;3;-1.903369,-8.817497,0.000000;;, - 14;3;-1.903369,-8.817497,0.000000;;, - 15;3;-1.903369,-8.817497,0.000000;;, - 16;3;-1.903369,-8.817497,0.000000;;, - 17;3;-1.903369,-8.817497,0.000000;;, - 18;3;-1.903369,-8.817497,0.000000;;, - 19;3;-1.903369,-8.817497,0.000000;;, - 20;3;-1.903369,-8.817497,0.000000;;, - 24;3;-1.903369,-8.527980,0.000000;;, - 27;3;-1.903369,-8.583739,0.000000;;, - 33;3;-1.903369,-8.817497,0.000000;;, - 34;3;-1.903369,-8.817497,0.000000;;, - 35;3;-1.903369,-8.817497,0.000000;;, - 41;3;-1.903369,-8.034223,0.000000;;, - 43;3;-1.903369,-7.784886,0.000000;;, - 45;3;-1.903369,-7.659429,0.000000;;, - 50;3;-1.903369,-8.106865,0.000000;;, - 53;3;-1.903369,-8.537666,0.000000;;, - 55;3;-1.903369,-8.817497,0.000000;;; - } - - AnimationOptions - { - 1; - 1; - } - - AnimationKey - { - 0; - 25; - 0;4;1.000000,0.000000,0.000000,0.000000;;, - 1;4;1.000000,0.000000,0.000000,0.000000;;, - 2;4;0.936175,0.350946,-0.020210,-0.002106;;, - 3;4;0.832879,0.553271,-0.014218,0.001102;;, - 4;4;0.754710,0.656059,0.000000,0.000000;;, - 5;4;0.754710,0.656059,0.000000,0.000000;;, - 12;4;0.754709,0.656059,0.000000,0.000000;;, - 14;4;0.754710,0.656059,0.000000,0.000000;;, - 15;4;0.754710,0.656059,0.000000,0.000000;;, - 16;4;0.817547,0.575786,-0.009196,0.001689;;, - 17;4;0.867357,0.497283,-0.018216,0.008324;;, - 18;4;0.954530,0.297619,-0.015169,0.008102;;, - 19;4;1.000000,0.000000,0.000000,0.000000;;, - 20;4;1.000000,0.000000,0.000000,0.000000;;, - 24;4;1.000000,0.000000,0.000000,0.000000;;, - 27;4;1.000000,0.000000,0.000000,0.000000;;, - 33;4;1.000000,0.000000,0.000000,0.000000;;, - 34;4;1.000000,0.000000,0.000000,0.000000;;, - 35;4;1.000000,0.000000,0.000000,0.000000;;, - 41;4;1.000000,0.000000,0.000000,0.000000;;, - 43;4;1.000000,0.000000,0.000000,0.000000;;, - 45;4;1.000000,0.000000,0.000000,0.000000;;, - 50;4;1.000000,0.000000,0.000000,0.000000;;, - 53;4;1.000000,0.000000,0.000000,0.000000;;, - 55;4;1.000000,0.000000,0.000000,0.000000;;; - } - - AnimationOptions - { - 1; - 1; - } - } - - Animation lankleAnimation - { - {lankle} - - AnimationKey - { - 2; - 25; - 0;3;-1.557302,-12.873290,3.507543;;, - 1;3;-1.557302,-12.873290,3.507543;;, - 2;3;-1.557302,-12.873290,3.507543;;, - 3;3;-1.557302,-12.873290,3.507543;;, - 4;3;-1.557302,-12.873290,3.507543;;, - 5;3;-1.557302,-12.873290,3.507543;;, - 12;3;-1.557302,-12.873290,3.507543;;, - 14;3;-1.557302,-12.873290,3.507543;;, - 15;3;-1.557302,-12.873290,3.507543;;, - 16;3;-1.557302,-12.873290,3.507543;;, - 17;3;-1.557302,-12.873290,3.507543;;, - 18;3;-1.557302,-12.873290,3.507543;;, - 19;3;-1.557302,-12.873290,3.507543;;, - 20;3;-1.557302,-12.873290,3.507543;;, - 24;3;-1.557302,-12.294256,3.507543;;, - 27;3;-1.557302,-12.405774,3.507543;;, - 33;3;-1.557302,-12.873290,3.507543;;, - 34;3;-1.557302,-12.873290,3.507543;;, - 35;3;-1.557302,-12.873290,3.507543;;, - 41;3;-1.557302,-12.187924,3.507543;;, - 43;3;-1.557302,-11.969755,3.507543;;, - 45;3;-1.557302,-11.859981,3.507543;;, - 50;3;-1.557302,-12.251487,3.507543;;, - 53;3;-1.557302,-12.628438,3.507543;;, - 55;3;-1.557302,-12.873290,3.507543;;; - } - - AnimationOptions - { - 1; - 1; - } - - AnimationKey - { - 0; - 25; - 0;4;1.000000,0.000000,0.000000,0.000000;;, - 1;4;1.000000,0.000000,0.000000,0.000000;;, - 2;4;1.000000,0.000000,0.000000,0.000000;;, - 3;4;1.000000,0.000000,0.000000,0.000000;;, - 4;4;1.000000,0.000000,0.000000,0.000000;;, - 5;4;1.000000,0.000000,0.000000,0.000000;;, - 12;4;1.000000,0.000000,0.000000,0.000000;;, - 14;4;1.000000,0.000000,0.000000,0.000000;;, - 15;4;1.000000,0.000000,0.000000,0.000000;;, - 16;4;1.000000,0.000000,0.000000,0.000000;;, - 17;4;1.000000,0.000000,0.000000,0.000000;;, - 18;4;0.999476,-0.032322,0.001562,-0.000284;;, - 19;4;1.000000,0.000000,0.000000,0.000000;;, - 20;4;1.000000,0.000000,0.000000,0.000000;;, - 24;4;1.000000,0.000000,0.000000,0.000000;;, - 27;4;1.000000,0.000000,0.000000,0.000000;;, - 33;4;1.000000,0.000000,0.000000,0.000000;;, - 34;4;1.000000,0.000000,0.000000,0.000000;;, - 35;4;1.000000,0.000000,0.000000,0.000000;;, - 41;4;1.000000,0.000000,0.000000,0.000000;;, - 43;4;1.000000,0.000000,0.000000,0.000000;;, - 45;4;1.000000,0.000000,0.000000,0.000000;;, - 50;4;1.000000,0.000000,0.000000,0.000000;;, - 53;4;1.000000,0.000000,0.000000,0.000000;;, - 55;4;1.000000,0.000000,0.000000,0.000000;;; - } - - AnimationOptions - { - 1; - 1; - } - } - - Animation ltoeAnimation - { - {ltoe} - - AnimationKey - { - 2; - 23; - 0;3;-0.083542,-2.837912,-5.268192;;, - 1;3;-0.083542,-2.837912,-5.268192;;, - 2;3;-0.083542,-2.837912,-5.268192;;, - 3;3;-0.083542,-2.837912,-5.268192;;, - 4;3;-0.083542,-2.837912,-5.268192;;, - 5;3;-0.083542,-2.837912,-5.268192;;, - 12;3;-0.083542,-2.837912,-5.268192;;, - 14;3;-0.083542,-2.837912,-5.268192;;, - 15;3;-0.083542,-2.837912,-5.268192;;, - 16;3;-0.083542,-2.837912,-5.268192;;, - 17;3;-0.083542,-2.837912,-5.268192;;, - 18;3;-0.083542,-2.837912,-5.268192;;, - 19;3;-0.083542,-2.837912,-5.268192;;, - 20;3;-0.083542,-2.837912,-5.268192;;, - 27;3;-0.083542,-2.837912,-5.268192;;, - 33;3;-0.083542,-2.837912,-5.268192;;, - 34;3;-0.083542,-2.837912,-5.268192;;, - 35;3;-0.083542,-2.837912,-5.268192;;, - 41;3;-0.083542,-2.837912,-5.268192;;, - 43;3;-0.083542,-2.837912,-5.268192;;, - 50;3;-0.083542,-2.837912,-5.268192;;, - 53;3;-0.083542,-2.837912,-5.268192;;, - 55;3;-0.083542,-2.837912,-5.268192;;; - } - - AnimationOptions - { - 1; - 1; - } - - AnimationKey - { - 0; - 23; - 0;4;1.000000,0.000000,0.000000,0.000000;;, - 1;4;1.000000,0.000000,0.000000,0.000000;;, - 2;4;1.000000,0.000000,0.000000,0.000000;;, - 3;4;1.000000,0.000000,0.000000,0.000000;;, - 4;4;1.000000,0.000000,0.000000,0.000000;;, - 5;4;1.000000,0.000000,0.000000,0.000000;;, - 12;4;1.000000,0.000000,0.000000,0.000000;;, - 14;4;1.000000,0.000000,0.000000,0.000000;;, - 15;4;1.000000,0.000000,0.000000,0.000000;;, - 16;4;1.000000,0.000000,0.000000,0.000000;;, - 17;4;1.000000,0.000000,0.000000,0.000000;;, - 18;4;1.000000,0.000000,0.000000,0.000000;;, - 19;4;1.000000,0.000000,0.000000,0.000000;;, - 20;4;1.000000,0.000000,0.000000,0.000000;;, - 27;4;1.000000,0.000000,0.000000,0.000000;;, - 33;4;1.000000,0.000000,0.000000,0.000000;;, - 34;4;1.000000,0.000000,0.000000,0.000000;;, - 35;4;1.000000,0.000000,0.000000,0.000000;;, - 41;4;1.000000,0.000000,0.000000,0.000000;;, - 43;4;1.000000,0.000000,0.000000,0.000000;;, - 50;4;1.000000,0.000000,0.000000,0.000000;;, - 53;4;1.000000,0.000000,0.000000,0.000000;;, - 55;4;1.000000,0.000000,0.000000,0.000000;;; - } - - AnimationOptions - { - 1; - 1; - } - } - - Animation rhipAnimation - { - {rhip} - - AnimationKey - { - 2; - 23; - 0;3;5.883141,-2.951185,0.000000;;, - 1;3;5.883141,-2.951185,0.000000;;, - 2;3;5.883141,-2.951185,0.000000;;, - 3;3;5.883141,-2.951185,0.000000;;, - 4;3;5.883141,-2.951185,0.000000;;, - 5;3;5.883141,-2.951185,0.000000;;, - 12;3;5.883141,-2.951185,0.000000;;, - 14;3;5.883141,-2.951185,0.000000;;, - 15;3;5.883141,-2.951185,0.000000;;, - 16;3;5.883141,-2.951185,0.000000;;, - 17;3;5.883141,-2.951185,0.000000;;, - 18;3;5.883141,-2.951185,0.000000;;, - 19;3;5.883141,-2.951185,0.000000;;, - 20;3;5.883141,-2.951185,0.000000;;, - 27;3;5.883141,-2.951185,0.000000;;, - 33;3;5.883141,-2.951185,0.000000;;, - 34;3;5.883141,-2.951185,0.000000;;, - 35;3;5.883141,-2.951185,0.000000;;, - 41;3;5.883141,-2.951185,0.000000;;, - 43;3;5.883141,-2.951185,0.000000;;, - 50;3;5.883141,-2.951185,0.000000;;, - 53;3;5.883141,-2.951185,0.000000;;, - 55;3;5.883141,-2.951185,0.000000;;; - } - - AnimationOptions - { - 1; - 1; - } - - AnimationKey - { - 0; - 23; - 0;4;1.000000,0.000000,0.000000,0.000000;;, - 1;4;1.000000,0.000000,0.000000,0.000000;;, - 2;4;0.997921,0.064448,0.000411,-0.000559;;, - 3;4;0.990580,0.136931,0.000703,-0.000957;;, - 4;4;0.982450,0.186524,0.000000,0.000000;;, - 5;4;0.982450,0.186524,0.000000,0.000000;;, - 12;4;0.982450,0.186524,0.000000,0.000000;;, - 14;4;0.982450,0.186524,0.000000,0.000000;;, - 15;4;0.982450,0.186524,0.000000,0.000000;;, - 16;4;0.988892,0.148634,-0.000027,-0.001179;;, - 17;4;0.995206,0.097793,-0.000021,-0.000940;;, - 18;4;0.999001,0.044690,-0.000010,-0.000451;;, - 19;4;1.000000,0.000000,0.000000,0.000000;;, - 20;4;1.000000,0.000000,0.000000,0.000000;;, - 27;4;1.000000,0.000000,0.000000,0.000000;;, - 33;4;1.000000,0.000000,0.000000,0.000000;;, - 34;4;1.000000,0.000000,0.000000,0.000000;;, - 35;4;1.000000,0.000000,0.000000,0.000000;;, - 41;4;1.000000,0.000000,0.000000,0.000000;;, - 43;4;1.000000,0.000000,0.000000,0.000000;;, - 50;4;1.000000,0.000000,0.000000,0.000000;;, - 53;4;1.000000,0.000000,0.000000,0.000000;;, - 55;4;1.000000,0.000000,0.000000,0.000000;;; - } - - AnimationOptions - { - 1; - 1; - } - } - - Animation rkneeAnimation - { - {rknee} - - AnimationKey - { - 2; - 25; - 0;3;1.557302,-9.681957,0.000000;;, - 1;3;1.557302,-9.681957,0.000000;;, - 2;3;1.557302,-9.681957,0.000000;;, - 3;3;1.557302,-9.681957,0.000000;;, - 4;3;1.557302,-9.681957,0.000000;;, - 5;3;1.557302,-9.681957,0.000000;;, - 12;3;1.557302,-9.681957,0.000000;;, - 14;3;1.557302,-9.681957,0.000000;;, - 15;3;1.557302,-9.681957,0.000000;;, - 16;3;1.557302,-9.681957,0.000000;;, - 17;3;1.557302,-9.681957,0.000000;;, - 18;3;1.557302,-9.681957,0.000000;;, - 19;3;1.557302,-9.681957,0.000000;;, - 20;3;1.557302,-9.681957,0.000000;;, - 24;3;1.557302,-9.392440,0.000000;;, - 27;3;1.557302,-9.448199,0.000000;;, - 33;3;1.557302,-9.681957,0.000000;;, - 34;3;1.557302,-9.681957,0.000000;;, - 35;3;1.557302,-9.681957,0.000000;;, - 41;3;1.557302,-8.898683,0.000000;;, - 43;3;1.557302,-8.649346,0.000000;;, - 45;3;1.557302,-8.523890,0.000000;;, - 50;3;1.557302,-8.971325,0.000000;;, - 53;3;1.557302,-9.402126,0.000000;;, - 55;3;1.557302,-9.681957,0.000000;;; - } - - AnimationOptions - { - 1; - 1; - } - - AnimationKey - { - 0; - 25; - 0;4;1.000000,0.000000,0.000000,0.000000;;, - 1;4;1.000000,0.000000,0.000000,0.000000;;, - 2;4;0.963221,0.268544,0.008625,-0.003828;;, - 3;4;0.881291,0.472453,0.010177,-0.003199;;, - 4;4;0.859406,0.511293,0.000000,0.000000;;, - 5;4;0.859406,0.511293,0.000000,0.000000;;, - 12;4;0.859406,0.511293,0.000000,0.000000;;, - 14;4;0.859406,0.511293,0.000000,0.000000;;, - 15;4;0.859406,0.511293,0.000000,0.000000;;, - 16;4;0.882421,0.470414,0.005475,-0.003796;;, - 17;4;0.936363,0.350938,0.006628,-0.004836;;, - 18;4;0.982689,0.185165,0.005005,-0.003385;;, - 19;4;1.000000,0.000000,0.000000,0.000000;;, - 20;4;1.000000,0.000000,0.000000,0.000000;;, - 24;4;1.000000,0.000000,0.000000,0.000000;;, - 27;4;1.000000,0.000000,0.000000,0.000000;;, - 33;4;1.000000,0.000000,0.000000,0.000000;;, - 34;4;1.000000,0.000000,0.000000,0.000000;;, - 35;4;1.000000,0.000000,0.000000,0.000000;;, - 41;4;1.000000,0.000000,0.000000,0.000000;;, - 43;4;1.000000,0.000000,0.000000,0.000000;;, - 45;4;1.000000,0.000000,0.000000,0.000000;;, - 50;4;1.000000,0.000000,0.000000,0.000000;;, - 53;4;1.000000,0.000000,0.000000,0.000000;;, - 55;4;1.000000,0.000000,0.000000,0.000000;;; - } - - AnimationOptions - { - 1; - 1; - } - } - - Animation rankleAnimation - { - {rankle} - - AnimationKey - { - 2; - 25; - 0;3;1.038201,-13.046183,3.507543;;, - 1;3;1.038201,-13.046183,3.507543;;, - 2;3;1.038201,-13.046183,3.507543;;, - 3;3;1.038201,-13.046183,3.507543;;, - 4;3;1.038201,-13.046183,3.507543;;, - 5;3;1.038201,-13.046183,3.507543;;, - 12;3;1.038201,-13.046183,3.507543;;, - 14;3;1.038201,-13.046183,3.507543;;, - 15;3;1.038201,-13.046183,3.507543;;, - 16;3;1.038201,-13.046183,3.507543;;, - 17;3;1.038201,-13.046183,3.507543;;, - 18;3;1.038201,-13.046183,3.507543;;, - 19;3;1.038201,-13.046183,3.507543;;, - 20;3;1.038201,-13.046183,3.507543;;, - 24;3;1.038201,-12.467149,3.507543;;, - 27;3;1.038201,-12.578667,3.507543;;, - 33;3;1.038201,-13.046183,3.507543;;, - 34;3;1.038201,-13.046183,3.507543;;, - 35;3;1.038201,-13.046183,3.507543;;, - 41;3;1.038201,-12.360817,3.507543;;, - 43;3;1.038201,-12.142648,3.507543;;, - 45;3;1.038201,-12.032873,3.507543;;, - 50;3;1.038201,-12.424379,3.507543;;, - 53;3;1.038201,-12.801331,3.507543;;, - 55;3;1.038201,-13.046183,3.507543;;; - } - - AnimationOptions - { - 1; - 1; - } - - AnimationKey - { - 0; - 25; - 0;4;1.000000,0.000000,0.000000,0.000000;;, - 1;4;1.000000,0.000000,0.000000,0.000000;;, - 2;4;0.978731,-0.205059,-0.003273,-0.005028;;, - 3;4;0.979297,-0.202354,-0.000456,-0.005571;;, - 4;4;1.000000,0.000000,0.000000,0.000000;;, - 5;4;1.000000,0.000000,0.000000,0.000000;;, - 12;4;1.000000,0.000000,0.000000,0.000000;;, - 14;4;1.000000,0.000000,0.000000,0.000000;;, - 15;4;1.000000,0.000000,0.000000,0.000000;;, - 16;4;0.981401,-0.191782,-0.008166,-0.002302;;, - 17;4;0.967608,-0.252304,-0.007780,-0.004084;;, - 18;4;0.984134,-0.177321,-0.005444,-0.002966;;, - 19;4;1.000000,0.000000,0.000000,0.000000;;, - 20;4;1.000000,0.000000,0.000000,0.000000;;, - 24;4;1.000000,0.000000,0.000000,0.000000;;, - 27;4;1.000000,0.000000,0.000000,0.000000;;, - 33;4;1.000000,0.000000,0.000000,0.000000;;, - 34;4;1.000000,0.000000,0.000000,0.000000;;, - 35;4;1.000000,0.000000,0.000000,0.000000;;, - 41;4;1.000000,0.000000,0.000000,0.000000;;, - 43;4;1.000000,0.000000,0.000000,0.000000;;, - 45;4;1.000000,0.000000,0.000000,0.000000;;, - 50;4;1.000000,0.000000,0.000000,0.000000;;, - 53;4;1.000000,0.000000,0.000000,0.000000;;, - 55;4;1.000000,0.000000,0.000000,0.000000;;; - } - - AnimationOptions - { - 1; - 1; - } - } - - Animation rtoeAnimation - { - {rtoe} - - AnimationKey - { - 2; - 23; - 0;3;0.161076,-2.268395,-5.055357;;, - 1;3;0.161076,-2.268395,-5.055357;;, - 2;3;0.161076,-2.268395,-5.055357;;, - 3;3;0.161076,-2.268395,-5.055357;;, - 4;3;0.161076,-2.268395,-5.055357;;, - 5;3;0.161076,-2.268395,-5.055357;;, - 12;3;0.161076,-2.268395,-5.055357;;, - 14;3;0.161076,-2.268395,-5.055357;;, - 15;3;0.161076,-2.268395,-5.055357;;, - 16;3;0.161076,-2.268395,-5.055357;;, - 17;3;0.161076,-2.268395,-5.055357;;, - 18;3;0.161076,-2.268395,-5.055357;;, - 19;3;0.161076,-2.268395,-5.055357;;, - 20;3;0.161076,-2.268395,-5.055357;;, - 27;3;0.161076,-2.268395,-5.055357;;, - 33;3;0.161076,-2.268395,-5.055357;;, - 34;3;0.161076,-2.268395,-5.055357;;, - 35;3;0.161076,-2.268395,-5.055357;;, - 41;3;0.161076,-2.268395,-5.055357;;, - 43;3;0.161076,-2.268395,-5.055357;;, - 50;3;0.161076,-2.268395,-5.055357;;, - 53;3;0.161076,-2.268395,-5.055357;;, - 55;3;0.161076,-2.268395,-5.055357;;; - } - - AnimationOptions - { - 1; - 1; - } - - AnimationKey - { - 0; - 23; - 0;4;1.000000,0.000000,0.000000,0.000000;;, - 1;4;1.000000,0.000000,0.000000,0.000000;;, - 2;4;1.000000,0.000000,0.000000,0.000000;;, - 3;4;1.000000,0.000000,0.000000,0.000000;;, - 4;4;1.000000,0.000000,0.000000,0.000000;;, - 5;4;1.000000,0.000000,0.000000,0.000000;;, - 12;4;1.000000,0.000000,0.000000,0.000000;;, - 14;4;1.000000,0.000000,0.000000,0.000000;;, - 15;4;1.000000,0.000000,0.000000,0.000000;;, - 16;4;1.000000,0.000000,0.000000,0.000000;;, - 17;4;1.000000,0.000000,0.000000,0.000000;;, - 18;4;1.000000,0.000000,0.000000,0.000000;;, - 19;4;1.000000,0.000000,0.000000,0.000000;;, - 20;4;1.000000,0.000000,0.000000,0.000000;;, - 27;4;1.000000,0.000000,0.000000,0.000000;;, - 33;4;1.000000,0.000000,0.000000,0.000000;;, - 34;4;1.000000,0.000000,0.000000,0.000000;;, - 35;4;1.000000,0.000000,0.000000,0.000000;;, - 41;4;1.000000,0.000000,0.000000,0.000000;;, - 43;4;1.000000,0.000000,0.000000,0.000000;;, - 50;4;1.000000,0.000000,0.000000,0.000000;;, - 53;4;1.000000,0.000000,0.000000,0.000000;;, - 55;4;1.000000,0.000000,0.000000,0.000000;;; - } - - AnimationOptions - { - 1; - 1; - } - } - - Animation spine2Animation - { - {spine2} - - AnimationKey - { - 2; - 23; - 0;3;-0.008257,4.071795,0.000000;;, - 1;3;-0.008257,4.071795,0.000000;;, - 2;3;-0.008257,4.071795,0.000000;;, - 3;3;-0.008257,4.071795,0.000000;;, - 4;3;-0.008257,4.071795,0.000000;;, - 5;3;-0.008257,4.071795,0.000000;;, - 12;3;-0.008257,4.071795,0.000000;;, - 14;3;-0.008257,4.071795,0.000000;;, - 15;3;-0.008257,4.071795,0.000000;;, - 16;3;-0.008257,4.071795,0.000000;;, - 17;3;-0.008257,4.071795,0.000000;;, - 18;3;-0.008257,4.071795,0.000000;;, - 19;3;-0.008257,4.071795,0.000000;;, - 20;3;-0.008257,4.071795,0.000000;;, - 27;3;-0.008257,4.071795,0.000000;;, - 33;3;-0.008257,4.071795,0.000000;;, - 34;3;-0.008257,4.071795,0.000000;;, - 35;3;-0.008257,4.071795,0.000000;;, - 41;3;-0.008257,4.071795,0.000000;;, - 43;3;-0.008257,4.071795,0.000000;;, - 50;3;-0.008257,4.071795,0.000000;;, - 53;3;-0.008257,4.071795,0.000000;;, - 55;3;-0.008257,4.071795,0.000000;;; - } - - AnimationOptions - { - 1; - 1; - } - - AnimationKey - { - 0; - 23; - 0;4;1.000000,0.000000,0.000000,0.000000;;, - 1;4;1.000000,0.000000,0.000000,0.000000;;, - 2;4;1.000000,0.000000,0.000000,0.000000;;, - 3;4;1.000000,0.000000,0.000000,0.000000;;, - 4;4;1.000000,0.000000,0.000000,0.000000;;, - 5;4;1.000000,0.000000,0.000000,0.000000;;, - 12;4;1.000000,0.000000,0.000000,0.000000;;, - 14;4;1.000000,0.000000,0.000000,0.000000;;, - 15;4;1.000000,0.000000,0.000000,0.000000;;, - 16;4;1.000000,0.000000,0.000000,0.000000;;, - 17;4;1.000000,0.000000,0.000000,0.000000;;, - 18;4;1.000000,0.000000,0.000000,0.000000;;, - 19;4;1.000000,0.000000,0.000000,0.000000;;, - 20;4;1.000000,0.000000,0.000000,0.000000;;, - 27;4;1.000000,0.000000,0.000000,0.000000;;, - 33;4;1.000000,0.000000,0.000000,0.000000;;, - 34;4;1.000000,0.000000,0.000000,0.000000;;, - 35;4;1.000000,0.000000,0.000000,0.000000;;, - 41;4;0.999391,0.000000,0.034899,0.000000;;, - 43;4;0.999406,0.000000,0.034456,0.000000;;, - 50;4;0.999888,0.000000,0.014985,0.000000;;, - 53;4;0.999982,0.000000,0.005995,0.000000;;, - 55;4;1.000000,0.000000,0.000000,0.000000;;; - } - - AnimationOptions - { - 1; - 1; - } - } - - Animation Joint75Animation - { - {Joint75} - - AnimationKey - { - 2; - 23; - 0;3;-0.007980,5.843795,0.000000;;, - 1;3;-0.007980,5.843795,0.000000;;, - 2;3;-0.007980,5.625298,-0.076575;;, - 3;3;-0.007980,5.370562,-0.165850;;, - 4;3;-0.007980,5.153131,-0.242051;;, - 5;3;-0.007980,5.153131,-0.242051;;, - 12;3;-0.007980,5.153131,-0.242051;;, - 14;3;-0.007980,5.153131,-0.242051;;, - 15;3;-0.007980,5.153131,-0.242051;;, - 16;3;-0.007980,5.312847,-0.186077;;, - 17;3;-0.007980,5.497743,-0.121278;;, - 18;3;-0.007980,5.686178,-0.055239;;, - 19;3;-0.007980,5.843795,0.000000;;, - 20;3;-0.007980,5.843795,0.000000;;, - 27;3;-0.007980,5.843795,0.000000;;, - 33;3;-0.007980,5.843795,0.000000;;, - 34;3;-0.007980,5.843795,0.000000;;, - 35;3;-0.007980,5.843795,0.000000;;, - 41;3;-0.007980,5.843795,0.000000;;, - 43;3;-0.007980,5.975956,-0.018574;;, - 50;3;-0.007980,6.482687,-0.089789;;, - 53;3;-0.007980,6.140066,-0.041637;;, - 55;3;-0.007980,5.843795,0.000000;;; - } - - AnimationOptions - { - 1; - 1; - } - - AnimationKey - { - 0; - 23; - 0;4;0.997564,0.069757,0.000000,0.000000;;, - 1;4;0.997564,0.069757,0.000000,0.000000;;, - 2;4;0.997564,0.069755,0.000000,0.000000;;, - 3;4;0.997564,0.069755,0.000000,0.000000;;, - 4;4;0.997564,0.069757,0.000000,0.000000;;, - 5;4;0.997564,0.069757,0.000000,0.000000;;, - 12;4;0.997564,0.069755,0.000000,0.000000;;, - 14;4;0.997564,0.069757,0.000000,0.000000;;, - 15;4;0.997564,0.069757,0.000000,0.000000;;, - 16;4;0.997564,0.069755,0.000000,0.000000;;, - 17;4;0.997564,0.069755,0.000000,0.000000;;, - 18;4;0.997564,0.069755,0.000000,0.000000;;, - 19;4;0.997564,0.069757,0.000000,0.000000;;, - 20;4;0.997564,0.069757,0.000000,0.000000;;, - 27;4;0.990866,0.134849,0.000000,0.000000;;, - 33;4;0.997564,0.069757,0.000000,0.000000;;, - 34;4;0.997564,0.069757,0.000000,0.000000;;, - 35;4;0.997564,0.069757,0.000000,0.000000;;, - 41;4;0.993768,0.069490,0.086944,-0.006080;;, - 43;4;0.995824,0.069634,0.058902,-0.004119;;, - 50;4;0.993213,0.069451,-0.093073,0.006508;;, - 53;4;0.996487,0.069680,-0.046335,0.003240;;, - 55;4;0.997564,0.069757,0.000000,0.000000;;; - } - - AnimationOptions - { - 1; - 1; - } - } - - Animation Joint76Animation - { - {Joint76} - - AnimationKey - { - 2; - 23; - 0;3;-0.033215,5.642583,0.000000;;, - 1;3;-0.033215,5.642583,0.000000;;, - 2;3;-0.033215,5.390897,-0.199987;;, - 3;3;-0.033215,5.097469,-0.433143;;, - 4;3;-0.033215,4.847012,-0.632154;;, - 5;3;-0.033215,4.847012,-0.632154;;, - 12;3;-0.033215,4.847012,-0.632154;;, - 14;3;-0.033215,4.847012,-0.632154;;, - 15;3;-0.033215,4.847012,-0.632154;;, - 16;3;-0.033215,5.030987,-0.485969;;, - 17;3;-0.033215,5.243968,-0.316736;;, - 18;3;-0.033215,5.461024,-0.144265;;, - 19;3;-0.033215,5.642583,0.000000;;, - 20;3;-0.033215,5.642583,0.000000;;, - 27;3;-0.033215,5.642583,0.000000;;, - 33;3;-0.033215,5.642583,0.000000;;, - 34;3;-0.033215,5.642583,0.000000;;, - 35;3;-0.033215,5.642583,0.000000;;, - 41;3;-0.033215,5.642583,0.000000;;, - 43;3;-0.033215,5.642583,0.000000;;, - 50;3;-0.033215,5.642583,0.000000;;, - 53;3;-0.033215,5.642583,0.000000;;, - 55;3;-0.033215,5.642583,0.000000;;; - } - - AnimationOptions - { - 1; - 1; - } - - AnimationKey - { - 0; - 23; - 0;4;0.999391,0.034899,0.000000,0.000000;;, - 1;4;0.999391,0.034899,0.000000,0.000000;;, - 2;4;0.999391,0.034899,0.000000,0.000000;;, - 3;4;0.999391,0.034899,0.000000,0.000000;;, - 4;4;0.999391,0.034899,0.000000,0.000000;;, - 5;4;0.999391,0.034899,0.000000,0.000000;;, - 12;4;0.999381,0.034899,0.004361,-0.000152;;, - 14;4;0.999391,0.034899,0.000000,0.000000;;, - 15;4;0.999391,0.034899,0.000000,0.000000;;, - 16;4;0.999391,0.034899,0.000000,0.000000;;, - 17;4;0.999391,0.034899,0.000000,0.000000;;, - 18;4;0.999391,0.034899,0.000000,0.000000;;, - 19;4;0.999391,0.034899,0.000000,0.000000;;, - 20;4;0.999391,0.034899,0.000000,0.000000;;, - 27;4;0.999391,0.034899,0.000000,0.000000;;, - 33;4;0.999391,0.034899,0.000000,0.000000;;, - 34;4;0.999391,0.034899,0.000000,0.000000;;, - 35;4;0.999391,0.034899,0.000000,0.000000;;, - 41;4;0.996956,0.034814,0.069714,-0.002434;;, - 43;4;0.998051,0.034853,0.051723,-0.001806;;, - 50;4;0.997991,0.034850,-0.052875,0.001846;;, - 53;4;0.999025,0.034886,-0.027035,0.000944;;, - 55;4;0.999391,0.034899,0.000000,0.000000;;; - } - - AnimationOptions - { - 1; - 1; - } - } - - Animation spine1Animation - { - {spine1} - - AnimationKey - { - 2; - 23; - 0;3;-0.057544,3.129822,0.000000;;, - 1;3;-0.057544,3.129822,0.000000;;, - 2;3;-0.057544,3.129822,0.000000;;, - 3;3;-0.057544,3.129822,0.000000;;, - 4;3;-0.057544,3.129822,0.000000;;, - 5;3;-0.057544,3.129822,0.000000;;, - 12;3;-0.057544,3.129822,0.000000;;, - 14;3;-0.057544,3.129822,0.000000;;, - 15;3;-0.057544,3.129822,0.000000;;, - 16;3;-0.057544,3.129822,0.000000;;, - 17;3;-0.057544,3.129822,0.000000;;, - 18;3;-0.057544,3.129822,0.000000;;, - 19;3;-0.057544,3.129822,0.000000;;, - 20;3;-0.057544,3.129822,0.000000;;, - 27;3;-0.057544,3.129822,0.000000;;, - 33;3;-0.057544,3.129822,0.000000;;, - 34;3;-0.057544,3.129822,0.000000;;, - 35;3;-0.057544,3.129822,0.000000;;, - 41;3;-0.057544,3.129822,0.000000;;, - 43;3;-0.057544,3.129822,0.000000;;, - 50;3;-0.057544,3.129822,0.000000;;, - 53;3;-0.057544,3.129822,0.000000;;, - 55;3;-0.057544,3.129822,0.000000;;; - } - - AnimationOptions - { - 1; - 1; - } - - AnimationKey - { - 0; - 23; - 0;4;1.000000,0.000000,0.000000,0.000000;;, - 1;4;1.000000,0.000000,0.000000,0.000000;;, - 2;4;1.000000,0.000000,0.000000,0.000000;;, - 3;4;1.000000,0.000000,0.000000,0.000000;;, - 4;4;1.000000,0.000000,0.000000,0.000000;;, - 5;4;1.000000,0.000000,0.000000,0.000000;;, - 12;4;1.000000,0.000000,0.000000,0.000000;;, - 14;4;1.000000,0.000000,0.000000,0.000000;;, - 15;4;1.000000,0.000000,0.000000,0.000000;;, - 16;4;1.000000,0.000000,0.000000,0.000000;;, - 17;4;1.000000,0.000000,0.000000,0.000000;;, - 18;4;1.000000,0.000000,0.000000,0.000000;;, - 19;4;1.000000,0.000000,0.000000,0.000000;;, - 20;4;1.000000,0.000000,0.000000,0.000000;;, - 27;4;0.999229,0.039260,0.000000,0.000000;;, - 33;4;1.000000,0.000000,0.000000,0.000000;;, - 34;4;1.000000,0.000000,0.000000,0.000000;;, - 35;4;1.000000,0.000000,0.000000,0.000000;;, - 41;4;0.999229,0.000000,0.039260,0.000000;;, - 43;4;0.999248,0.000000,0.038762,0.000000;;, - 50;4;0.999858,0.000000,0.016858,0.000000;;, - 53;4;0.999977,0.000000,0.006743,0.000000;;, - 55;4;1.000000,0.000000,0.000000,0.000000;;; - } - - AnimationOptions - { - 1; - 1; - } - } - - Animation headAnimation - { - {head} - - AnimationKey - { - 2; - 27; - 0;3;0.000000,4.183402,0.000000;;, - 1;3;0.000000,4.183402,0.000000;;, - 2;3;0.000000,4.191365,-0.387104;;, - 3;3;0.000000,4.200649,-0.838410;;, - 4;3;0.000000,4.208574,-1.223624;;, - 5;3;0.000000,4.208574,-1.223624;;, - 7;3;0.000000,4.208574,-1.223624;;, - 12;3;0.000000,4.208574,-1.223624;;, - 14;3;0.000000,4.208574,-1.223624;;, - 15;3;0.000000,4.208574,-1.223624;;, - 16;3;0.000000,4.202753,-0.940661;;, - 17;3;0.000000,4.196014,-0.613087;;, - 18;3;0.000000,4.189146,-0.279245;;, - 19;3;0.000000,4.183402,0.000000;;, - 20;3;0.000000,4.183402,0.000000;;, - 23;3;0.000000,4.183402,0.000000;;, - 27;3;0.000000,4.183402,0.000000;;, - 29;3;0.000000,4.183402,0.000000;;, - 33;3;0.000000,4.183402,0.000000;;, - 34;3;0.000000,4.183402,0.000000;;, - 35;3;0.000000,4.183402,0.000000;;, - 41;3;0.000000,4.183402,0.000000;;, - 43;3;0.000000,4.183402,0.000000;;, - 45;3;0.000000,4.183402,0.000000;;, - 50;3;0.000000,4.183402,0.000000;;, - 53;3;0.000000,4.183402,0.000000;;, - 55;3;0.000000,4.183402,0.000000;;; - } - - AnimationOptions - { - 1; - 1; - } - - AnimationKey - { - 0; - 27; - 0;4;0.998392,-0.056693,0.000000,0.000000;;, - 1;4;0.998392,-0.056693,0.000000,0.000000;;, - 2;4;0.998178,-0.056679,0.001174,-0.020671;;, - 3;4;0.997388,-0.056635,0.002542,-0.044758;;, - 4;4;0.996254,-0.056570,0.003708,-0.065298;;, - 5;4;0.996254,-0.056570,0.003708,-0.065298;;, - 7;4;0.995518,-0.058815,0.038474,-0.063284;;, - 12;4;0.996114,-0.057445,0.017139,-0.064530;;, - 14;4;0.996254,-0.056570,0.003708,-0.065298;;, - 15;4;0.996254,-0.056570,0.003708,-0.065298;;, - 16;4;0.997128,-0.056620,0.002851,-0.050213;;, - 17;4;0.997855,-0.056661,0.001859,-0.032735;;, - 18;4;0.998280,-0.056685,0.000847,-0.014912;;, - 19;4;0.998392,-0.056693,0.000000,0.000000;;, - 20;4;0.998392,-0.056693,0.000000,0.000000;;, - 23;4;0.993540,-0.095666,0.060767,0.005851;;, - 27;4;0.992410,-0.122909,0.003406,-0.001945;;, - 29;4;0.992114,-0.123201,-0.022487,-0.005039;;, - 33;4;0.998392,-0.056693,0.000000,0.000000;;, - 34;4;0.998392,-0.056693,0.000000,0.000000;;, - 35;4;0.998392,-0.056693,0.000000,0.000000;;, - 41;4;0.994963,-0.056497,0.082675,0.004695;;, - 43;4;0.996303,-0.056573,0.064552,0.003665;;, - 45;4;0.985311,-0.055949,-0.161087,-0.009147;;, - 50;4;0.997274,-0.056628,-0.047219,-0.002681;;, - 53;4;0.994336,-0.056461,0.089900,0.005105;;, - 55;4;0.998392,-0.056693,0.000000,0.000000;;; - } - - AnimationOptions - { - 1; - 1; - } - } - - Animation Joint36Animation - { - {Joint36} - - AnimationKey - { - 2; - 23; - 0;3;2.351048,-2.969238,-5.128667;;, - 1;3;2.351048,-2.969238,-5.128667;;, - 2;3;2.351048,-2.969238,-5.128667;;, - 3;3;2.351048,-2.969238,-5.128667;;, - 4;3;2.351048,-2.969238,-5.128667;;, - 5;3;2.351048,-2.969238,-5.128667;;, - 12;3;2.351048,-2.969238,-5.128667;;, - 14;3;2.351048,-2.969238,-5.128667;;, - 15;3;2.351048,-2.969238,-5.128667;;, - 16;3;2.351048,-2.969238,-5.128667;;, - 17;3;2.351048,-2.969238,-5.128667;;, - 18;3;2.351048,-2.969238,-5.128667;;, - 19;3;2.351048,-2.969238,-5.128667;;, - 20;3;2.351048,-2.969238,-5.128667;;, - 27;3;2.351048,-2.969238,-5.128667;;, - 33;3;2.351048,-2.969238,-5.128667;;, - 34;3;2.351048,-2.969238,-5.128667;;, - 35;3;2.351048,-2.969238,-5.128667;;, - 41;3;2.351048,-2.969238,-5.128667;;, - 43;3;2.351048,-2.969238,-5.128667;;, - 50;3;2.351048,-2.969238,-5.128667;;, - 53;3;2.351048,-2.969238,-5.128667;;, - 55;3;2.351048,-2.969238,-5.128667;;; - } - - AnimationOptions - { - 1; - 1; - } - - AnimationKey - { - 0; - 23; - 0;4;1.000000,0.000000,0.000000,0.000000;;, - 1;4;1.000000,0.000000,0.000000,0.000000;;, - 2;4;1.000000,0.000000,0.000000,0.000000;;, - 3;4;1.000000,0.000000,0.000000,0.000000;;, - 4;4;1.000000,0.000000,0.000000,0.000000;;, - 5;4;1.000000,0.000000,0.000000,0.000000;;, - 12;4;1.000000,0.000000,0.000000,0.000000;;, - 14;4;1.000000,0.000000,0.000000,0.000000;;, - 15;4;1.000000,0.000000,0.000000,0.000000;;, - 16;4;1.000000,0.000000,0.000000,0.000000;;, - 17;4;1.000000,0.000000,0.000000,0.000000;;, - 18;4;1.000000,0.000000,0.000000,0.000000;;, - 19;4;1.000000,0.000000,0.000000,0.000000;;, - 20;4;1.000000,0.000000,0.000000,0.000000;;, - 27;4;1.000000,0.000000,0.000000,0.000000;;, - 33;4;1.000000,0.000000,0.000000,0.000000;;, - 34;4;1.000000,0.000000,0.000000,0.000000;;, - 35;4;1.000000,0.000000,0.000000,0.000000;;, - 41;4;0.999936,0.006365,-0.001014,0.009261;;, - 43;4;1.000000,0.000000,0.000000,0.000000;;, - 50;4;1.000000,0.000000,0.000000,0.000000;;, - 53;4;0.999825,0.002850,-0.006074,0.017471;;, - 55;4;1.000000,0.000000,0.000000,0.000000;;; - } - - AnimationOptions - { - 1; - 1; - } - } - - Animation Joint39Animation - { - {Joint39} - - AnimationKey - { - 2; - 23; - 0;3;2.521163,-4.102684,-2.779583;;, - 1;3;2.521163,-4.102684,-2.779583;;, - 2;3;2.521163,-4.102684,-2.779583;;, - 3;3;2.521163,-4.102684,-2.779583;;, - 4;3;2.521163,-4.102684,-2.779583;;, - 5;3;2.521163,-4.102684,-2.779583;;, - 12;3;2.521163,-4.102684,-2.779583;;, - 14;3;2.521163,-4.102684,-2.779583;;, - 15;3;2.521163,-4.102684,-2.779583;;, - 16;3;2.521163,-4.102684,-2.779583;;, - 17;3;2.521163,-4.102684,-2.779583;;, - 18;3;2.521163,-4.102684,-2.779583;;, - 19;3;2.521163,-4.102684,-2.779583;;, - 20;3;2.521163,-4.102684,-2.779583;;, - 27;3;2.521163,-4.102684,-2.779583;;, - 33;3;2.521163,-4.102684,-2.779583;;, - 34;3;2.521163,-4.102684,-2.779583;;, - 35;3;2.521163,-4.102684,-2.779583;;, - 41;3;2.521163,-4.102684,-2.779583;;, - 43;3;2.521163,-4.102684,-2.779583;;, - 50;3;2.521163,-4.102684,-2.779583;;, - 53;3;2.521163,-4.102684,-2.779583;;, - 55;3;2.521163,-4.102684,-2.779583;;; - } - - AnimationOptions - { - 1; - 1; - } - - AnimationKey - { - 0; - 23; - 0;4;1.000000,0.000000,0.000000,0.000000;;, - 1;4;1.000000,0.000000,0.000000,0.000000;;, - 2;4;1.000000,0.000000,0.000000,0.000000;;, - 3;4;1.000000,0.000000,0.000000,0.000000;;, - 4;4;1.000000,0.000000,0.000000,0.000000;;, - 5;4;1.000000,0.000000,0.000000,0.000000;;, - 12;4;1.000000,0.000000,0.000000,0.000000;;, - 14;4;1.000000,0.000000,0.000000,0.000000;;, - 15;4;1.000000,0.000000,0.000000,0.000000;;, - 16;4;1.000000,0.000000,0.000000,0.000000;;, - 17;4;1.000000,0.000000,0.000000,0.000000;;, - 18;4;1.000000,0.000000,0.000000,0.000000;;, - 19;4;1.000000,0.000000,0.000000,0.000000;;, - 20;4;1.000000,0.000000,0.000000,0.000000;;, - 27;4;1.000000,0.000000,0.000000,0.000000;;, - 33;4;1.000000,0.000000,0.000000,0.000000;;, - 34;4;1.000000,0.000000,0.000000,0.000000;;, - 35;4;1.000000,0.000000,0.000000,0.000000;;, - 41;4;0.999181,0.023935,-0.000402,0.032630;;, - 43;4;1.000000,0.000000,0.000000,0.000000;;, - 50;4;1.000000,0.000000,0.000000,0.000000;;, - 53;4;0.993880,0.004998,-0.009988,0.109898;;, - 55;4;1.000000,0.000000,0.000000,0.000000;;; - } - - AnimationOptions - { - 1; - 1; - } - } - - Animation Joint40Animation - { - {Joint40} - - AnimationKey - { - 2; - 23; - 0;3;1.543145,-3.721243,-0.884647;;, - 1;3;1.543145,-3.721243,-0.884647;;, - 2;3;1.543145,-3.721243,-0.884647;;, - 3;3;1.543145,-3.721243,-0.884647;;, - 4;3;1.543145,-3.721243,-0.884647;;, - 5;3;1.543145,-3.721243,-0.884647;;, - 12;3;1.543145,-3.721243,-0.884647;;, - 14;3;1.543145,-3.721243,-0.884647;;, - 15;3;1.543145,-3.721243,-0.884647;;, - 16;3;1.543145,-3.721243,-0.884647;;, - 17;3;1.543145,-3.721243,-0.884647;;, - 18;3;1.543145,-3.721243,-0.884647;;, - 19;3;1.543145,-3.721243,-0.884647;;, - 20;3;1.543145,-3.721243,-0.884647;;, - 27;3;1.543145,-3.721243,-0.884647;;, - 33;3;1.543145,-3.721243,-0.884647;;, - 34;3;1.543145,-3.721243,-0.884647;;, - 35;3;1.543145,-3.721243,-0.884647;;, - 41;3;1.543145,-3.721243,-0.884647;;, - 43;3;1.543145,-3.721243,-0.884647;;, - 50;3;1.543145,-3.721243,-0.884647;;, - 53;3;1.543145,-3.721243,-0.884647;;, - 55;3;1.543145,-3.721243,-0.884647;;; - } - - AnimationOptions - { - 1; - 1; - } - - AnimationKey - { - 0; - 23; - 0;4;1.000000,0.000000,0.000000,0.000000;;, - 1;4;1.000000,0.000000,0.000000,0.000000;;, - 2;4;1.000000,0.000000,0.000000,0.000000;;, - 3;4;1.000000,0.000000,0.000000,0.000000;;, - 4;4;1.000000,0.000000,0.000000,0.000000;;, - 5;4;1.000000,0.000000,0.000000,0.000000;;, - 12;4;1.000000,0.000000,0.000000,0.000000;;, - 14;4;1.000000,0.000000,0.000000,0.000000;;, - 15;4;1.000000,0.000000,0.000000,0.000000;;, - 16;4;1.000000,0.000000,0.000000,0.000000;;, - 17;4;1.000000,0.000000,0.000000,0.000000;;, - 18;4;1.000000,0.000000,0.000000,0.000000;;, - 19;4;1.000000,0.000000,0.000000,0.000000;;, - 20;4;1.000000,0.000000,0.000000,0.000000;;, - 27;4;1.000000,0.000000,0.000000,0.000000;;, - 33;4;1.000000,0.000000,0.000000,0.000000;;, - 34;4;1.000000,0.000000,0.000000,0.000000;;, - 35;4;1.000000,0.000000,0.000000,0.000000;;, - 41;4;0.997151,0.043421,-0.006512,0.061340;;, - 43;4;1.000000,0.000000,0.000000,0.000000;;, - 50;4;1.000000,0.000000,0.000000,0.000000;;, - 53;4;0.991531,0.009387,-0.014839,0.128675;;, - 55;4;1.000000,0.000000,0.000000,0.000000;;; - } - - AnimationOptions - { - 1; - 1; - } - } - - Animation Joint41Animation - { - {Joint41} - - AnimationKey - { - 2; - 23; - 0;3;0.857303,-3.157324,-0.940437;;, - 1;3;0.857303,-3.157324,-0.940437;;, - 2;3;0.857303,-3.157324,-0.940437;;, - 3;3;0.857303,-3.157324,-0.940437;;, - 4;3;0.857303,-3.157324,-0.940437;;, - 5;3;0.857303,-3.157324,-0.940437;;, - 12;3;0.857303,-3.157324,-0.940437;;, - 14;3;0.857303,-3.157324,-0.940437;;, - 15;3;0.857303,-3.157324,-0.940437;;, - 16;3;0.857303,-3.157324,-0.940437;;, - 17;3;0.857303,-3.157324,-0.940437;;, - 18;3;0.857303,-3.157324,-0.940437;;, - 19;3;0.857303,-3.157324,-0.940437;;, - 20;3;0.857303,-3.157324,-0.940437;;, - 27;3;0.857303,-3.157324,-0.940437;;, - 33;3;0.857303,-3.157324,-0.940437;;, - 34;3;0.857303,-3.157324,-0.940437;;, - 35;3;0.857303,-3.157324,-0.940437;;, - 41;3;0.857303,-3.157324,-0.940437;;, - 43;3;0.857303,-3.157324,-0.940437;;, - 50;3;0.857303,-3.157324,-0.940437;;, - 53;3;0.857303,-3.157324,-0.940437;;, - 55;3;0.857303,-3.157324,-0.940437;;; - } - - AnimationOptions - { - 1; - 1; - } - - AnimationKey - { - 0; - 23; - 0;4;1.000000,0.000000,0.000000,0.000000;;, - 1;4;1.000000,0.000000,0.000000,0.000000;;, - 2;4;1.000000,0.000000,0.000000,0.000000;;, - 3;4;1.000000,0.000000,0.000000,0.000000;;, - 4;4;1.000000,0.000000,0.000000,0.000000;;, - 5;4;1.000000,0.000000,0.000000,0.000000;;, - 12;4;1.000000,0.000000,0.000000,0.000000;;, - 14;4;1.000000,0.000000,0.000000,0.000000;;, - 15;4;1.000000,0.000000,0.000000,0.000000;;, - 16;4;1.000000,0.000000,0.000000,0.000000;;, - 17;4;1.000000,0.000000,0.000000,0.000000;;, - 18;4;1.000000,0.000000,0.000000,0.000000;;, - 19;4;1.000000,0.000000,0.000000,0.000000;;, - 20;4;1.000000,0.000000,0.000000,0.000000;;, - 27;4;1.000000,0.000000,0.000000,0.000000;;, - 33;4;1.000000,0.000000,0.000000,0.000000;;, - 34;4;1.000000,0.000000,0.000000,0.000000;;, - 35;4;1.000000,0.000000,0.000000,0.000000;;, - 41;4;1.000000,0.000000,0.000000,0.000000;;, - 43;4;1.000000,0.000000,0.000000,0.000000;;, - 50;4;1.000000,0.000000,0.000000,0.000000;;, - 53;4;1.000000,0.000000,0.000000,0.000000;;, - 55;4;1.000000,0.000000,0.000000,0.000000;;; - } - - AnimationOptions - { - 1; - 1; - } - } - - Animation Joint37Animation - { - {Joint37} - - AnimationKey - { - 2; - 23; - 0;3;-2.844125,-3.130046,-5.128667;;, - 1;3;-2.844125,-3.130046,-5.128667;;, - 2;3;-2.844125,-3.130046,-5.128667;;, - 3;3;-2.844125,-3.130046,-5.128667;;, - 4;3;-2.844125,-3.130046,-5.128667;;, - 5;3;-2.844125,-3.130046,-5.128667;;, - 12;3;-2.844125,-3.130046,-5.128667;;, - 14;3;-2.844125,-3.130046,-5.128667;;, - 15;3;-2.844125,-3.130046,-5.128667;;, - 16;3;-2.844125,-3.130046,-5.128667;;, - 17;3;-2.844125,-3.130046,-5.128667;;, - 18;3;-2.844125,-3.130046,-5.128667;;, - 19;3;-2.844125,-3.130046,-5.128667;;, - 20;3;-2.844125,-3.130046,-5.128667;;, - 27;3;-2.844125,-3.130046,-5.128667;;, - 33;3;-2.844125,-3.130046,-5.128667;;, - 34;3;-2.844125,-3.130046,-5.128667;;, - 35;3;-2.844125,-3.130046,-5.128667;;, - 41;3;-2.844125,-3.130046,-5.128667;;, - 43;3;-2.844125,-3.130046,-5.128667;;, - 50;3;-2.844125,-3.130046,-5.128667;;, - 53;3;-2.844125,-3.130046,-5.128667;;, - 55;3;-2.844125,-3.130046,-5.128667;;; - } - - AnimationOptions - { - 1; - 1; - } - - AnimationKey - { - 0; - 23; - 0;4;1.000000,0.000000,0.000000,0.000000;;, - 1;4;1.000000,0.000000,0.000000,0.000000;;, - 2;4;1.000000,0.000000,0.000000,0.000000;;, - 3;4;1.000000,0.000000,0.000000,0.000000;;, - 4;4;1.000000,0.000000,0.000000,0.000000;;, - 5;4;1.000000,0.000000,0.000000,0.000000;;, - 12;4;1.000000,0.000000,0.000000,0.000000;;, - 14;4;1.000000,0.000000,0.000000,0.000000;;, - 15;4;1.000000,0.000000,0.000000,0.000000;;, - 16;4;1.000000,0.000000,0.000000,0.000000;;, - 17;4;1.000000,0.000000,0.000000,0.000000;;, - 18;4;1.000000,0.000000,0.000000,0.000000;;, - 19;4;1.000000,0.000000,0.000000,0.000000;;, - 20;4;1.000000,0.000000,0.000000,0.000000;;, - 27;4;1.000000,0.000000,0.000000,0.000000;;, - 33;4;1.000000,0.000000,0.000000,0.000000;;, - 34;4;1.000000,0.000000,0.000000,0.000000;;, - 35;4;1.000000,0.000000,0.000000,0.000000;;, - 41;4;0.999521,0.014638,-0.017367,0.021010;;, - 43;4;1.000000,0.000000,0.000000,0.000000;;, - 50;4;1.000000,0.000000,0.000000,0.000000;;, - 53;4;0.996793,0.039942,-0.049084,0.048974;;, - 55;4;1.000000,0.000000,0.000000,0.000000;;; - } - - AnimationOptions - { - 1; - 1; - } - } - - Animation Joint38Animation - { - {Joint38} - - AnimationKey - { - 2; - 23; - 0;3;-2.314107,-4.198860,-2.779583;;, - 1;3;-2.314107,-4.198860,-2.779583;;, - 2;3;-2.314107,-4.198860,-2.779583;;, - 3;3;-2.314107,-4.198860,-2.779583;;, - 4;3;-2.314107,-4.198860,-2.779583;;, - 5;3;-2.314107,-4.198860,-2.779583;;, - 12;3;-2.314107,-4.198860,-2.779583;;, - 14;3;-2.314107,-4.198860,-2.779583;;, - 15;3;-2.314107,-4.198860,-2.779583;;, - 16;3;-2.314107,-4.198860,-2.779583;;, - 17;3;-2.314107,-4.198860,-2.779583;;, - 18;3;-2.314107,-4.198860,-2.779583;;, - 19;3;-2.314107,-4.198860,-2.779583;;, - 20;3;-2.314107,-4.198860,-2.779583;;, - 27;3;-2.314107,-4.198860,-2.779583;;, - 33;3;-2.314107,-4.198860,-2.779583;;, - 34;3;-2.314107,-4.198860,-2.779583;;, - 35;3;-2.314107,-4.198860,-2.779583;;, - 41;3;-2.314107,-4.198860,-2.779583;;, - 43;3;-2.314107,-4.198860,-2.779583;;, - 50;3;-2.314107,-4.198860,-2.779583;;, - 53;3;-2.314107,-4.198860,-2.779583;;, - 55;3;-2.314107,-4.198860,-2.779583;;; - } - - AnimationOptions - { - 1; - 1; - } - - AnimationKey - { - 0; - 23; - 0;4;1.000000,0.000000,0.000000,0.000000;;, - 1;4;1.000000,0.000000,0.000000,0.000000;;, - 2;4;1.000000,0.000000,0.000000,0.000000;;, - 3;4;1.000000,0.000000,0.000000,0.000000;;, - 4;4;1.000000,0.000000,0.000000,0.000000;;, - 5;4;1.000000,0.000000,0.000000,0.000000;;, - 12;4;1.000000,0.000000,0.000000,0.000000;;, - 14;4;1.000000,0.000000,0.000000,0.000000;;, - 15;4;1.000000,0.000000,0.000000,0.000000;;, - 16;4;1.000000,0.000000,0.000000,0.000000;;, - 17;4;1.000000,0.000000,0.000000,0.000000;;, - 18;4;1.000000,0.000000,0.000000,0.000000;;, - 19;4;1.000000,0.000000,0.000000,0.000000;;, - 20;4;1.000000,0.000000,0.000000,0.000000;;, - 27;4;1.000000,0.000000,0.000000,0.000000;;, - 33;4;1.000000,0.000000,0.000000,0.000000;;, - 34;4;1.000000,0.000000,0.000000,0.000000;;, - 35;4;1.000000,0.000000,0.000000,0.000000;;, - 41;4;0.997118,0.039292,-0.030553,0.057264;;, - 43;4;1.000000,0.000000,0.000000,0.000000;;, - 50;4;1.000000,0.000000,0.000000,0.000000;;, - 53;4;0.991578,-0.066684,-0.003497,0.110966;;, - 55;4;1.000000,0.000000,0.000000,0.000000;;; - } - - AnimationOptions - { - 1; - 1; - } - } - - Animation Joint42Animation - { - {Joint42} - - AnimationKey - { - 2; - 23; - 0;3;-1.200224,-3.209697,-0.885387;;, - 1;3;-1.200224,-3.209697,-0.885387;;, - 2;3;-1.200224,-3.209697,-0.885387;;, - 3;3;-1.200224,-3.209697,-0.885387;;, - 4;3;-1.200224,-3.209697,-0.885387;;, - 5;3;-1.200224,-3.209697,-0.885387;;, - 12;3;-1.200224,-3.209697,-0.885387;;, - 14;3;-1.200224,-3.209697,-0.885387;;, - 15;3;-1.200224,-3.209697,-0.885387;;, - 16;3;-1.200224,-3.209697,-0.885387;;, - 17;3;-1.200224,-3.209697,-0.885387;;, - 18;3;-1.200224,-3.209697,-0.885387;;, - 19;3;-1.200224,-3.209697,-0.885387;;, - 20;3;-1.200224,-3.209697,-0.885387;;, - 27;3;-1.200224,-3.209697,-0.885387;;, - 33;3;-1.200224,-3.209697,-0.885387;;, - 34;3;-1.200224,-3.209697,-0.885387;;, - 35;3;-1.200224,-3.209697,-0.885387;;, - 41;3;-1.200224,-3.209697,-0.885387;;, - 43;3;-1.200224,-3.209697,-0.885387;;, - 50;3;-1.200224,-3.209697,-0.885387;;, - 53;3;-1.200224,-3.209697,-0.885387;;, - 55;3;-1.200224,-3.209697,-0.885387;;; - } - - AnimationOptions - { - 1; - 1; - } - - AnimationKey - { - 0; - 23; - 0;4;1.000000,0.000000,0.000000,0.000000;;, - 1;4;1.000000,0.000000,0.000000,0.000000;;, - 2;4;1.000000,0.000000,0.000000,0.000000;;, - 3;4;1.000000,0.000000,0.000000,0.000000;;, - 4;4;1.000000,0.000000,0.000000,0.000000;;, - 5;4;1.000000,0.000000,0.000000,0.000000;;, - 12;4;1.000000,0.000000,0.000000,0.000000;;, - 14;4;1.000000,0.000000,0.000000,0.000000;;, - 15;4;1.000000,0.000000,0.000000,0.000000;;, - 16;4;1.000000,0.000000,0.000000,0.000000;;, - 17;4;1.000000,0.000000,0.000000,0.000000;;, - 18;4;1.000000,0.000000,0.000000,0.000000;;, - 19;4;1.000000,0.000000,0.000000,0.000000;;, - 20;4;1.000000,0.000000,0.000000,0.000000;;, - 27;4;1.000000,0.000000,0.000000,0.000000;;, - 33;4;1.000000,0.000000,0.000000,0.000000;;, - 34;4;1.000000,0.000000,0.000000,0.000000;;, - 35;4;1.000000,0.000000,0.000000,0.000000;;, - 41;4;1.000000,0.000000,0.000000,0.000000;;, - 43;4;1.000000,0.000000,0.000000,0.000000;;, - 50;4;1.000000,0.000000,0.000000,0.000000;;, - 53;4;1.000000,0.000000,0.000000,0.000000;;, - 55;4;1.000000,0.000000,0.000000,0.000000;;; - } - - AnimationOptions - { - 1; - 1; - } - } - - Animation Joint43Animation - { - {Joint43} - - AnimationKey - { - 2; - 23; - 0;3;-1.285954,-3.696030,-0.939697;;, - 1;3;-1.285954,-3.696030,-0.939697;;, - 2;3;-1.285954,-3.696030,-0.939697;;, - 3;3;-1.285954,-3.696030,-0.939697;;, - 4;3;-1.285954,-3.696030,-0.939697;;, - 5;3;-1.285954,-3.696030,-0.939697;;, - 12;3;-1.285954,-3.696030,-0.939697;;, - 14;3;-1.285954,-3.696030,-0.939697;;, - 15;3;-1.285954,-3.696030,-0.939697;;, - 16;3;-1.285954,-3.696030,-0.939697;;, - 17;3;-1.285954,-3.696030,-0.939697;;, - 18;3;-1.285954,-3.696030,-0.939697;;, - 19;3;-1.285954,-3.696030,-0.939697;;, - 20;3;-1.285954,-3.696030,-0.939697;;, - 27;3;-1.285954,-3.696030,-0.939697;;, - 33;3;-1.285954,-3.696030,-0.939697;;, - 34;3;-1.285954,-3.696030,-0.939697;;, - 35;3;-1.285954,-3.696030,-0.939697;;, - 41;3;-1.285954,-3.696030,-0.939697;;, - 43;3;-1.285954,-3.696030,-0.939697;;, - 50;3;-1.285954,-3.696030,-0.939697;;, - 53;3;-1.285954,-3.696030,-0.939697;;, - 55;3;-1.285954,-3.696030,-0.939697;;; - } - - AnimationOptions - { - 1; - 1; - } - - AnimationKey - { - 0; - 23; - 0;4;1.000000,0.000000,0.000000,0.000000;;, - 1;4;1.000000,0.000000,0.000000,0.000000;;, - 2;4;1.000000,0.000000,0.000000,0.000000;;, - 3;4;1.000000,0.000000,0.000000,0.000000;;, - 4;4;1.000000,0.000000,0.000000,0.000000;;, - 5;4;1.000000,0.000000,0.000000,0.000000;;, - 12;4;1.000000,0.000000,0.000000,0.000000;;, - 14;4;1.000000,0.000000,0.000000,0.000000;;, - 15;4;1.000000,0.000000,0.000000,0.000000;;, - 16;4;1.000000,0.000000,0.000000,0.000000;;, - 17;4;1.000000,0.000000,0.000000,0.000000;;, - 18;4;1.000000,0.000000,0.000000,0.000000;;, - 19;4;1.000000,0.000000,0.000000,0.000000;;, - 20;4;1.000000,0.000000,0.000000,0.000000;;, - 27;4;1.000000,0.000000,0.000000,0.000000;;, - 33;4;1.000000,0.000000,0.000000,0.000000;;, - 34;4;1.000000,0.000000,0.000000,0.000000;;, - 35;4;1.000000,0.000000,0.000000,0.000000;;, - 41;4;1.000000,0.000000,0.000000,0.000000;;, - 43;4;1.000000,0.000000,0.000000,0.000000;;, - 50;4;1.000000,0.000000,0.000000,0.000000;;, - 53;4;1.000000,0.000000,0.000000,0.000000;;, - 55;4;1.000000,0.000000,0.000000,0.000000;;; - } - - AnimationOptions - { - 1; - 1; - } - } - - Animation topAnimation - { - {top} - - AnimationKey - { - 2; - 23; - 0;3;-0.311274,14.438549,-1.107615;;, - 1;3;-0.311274,14.438549,-1.107615;;, - 2;3;-0.311274,14.438549,-1.107615;;, - 3;3;-0.311274,14.438549,-1.107615;;, - 4;3;-0.311274,14.438549,-1.107615;;, - 5;3;-0.311274,14.438549,-1.107615;;, - 12;3;-0.311274,14.438549,-1.107615;;, - 14;3;-0.311274,14.438549,-1.107615;;, - 15;3;-0.311274,14.438549,-1.107615;;, - 16;3;-0.311274,14.438549,-1.107615;;, - 17;3;-0.311274,14.438549,-1.107615;;, - 18;3;-0.311274,14.438549,-1.107615;;, - 19;3;-0.311274,14.438549,-1.107615;;, - 20;3;-0.311274,14.438549,-1.107615;;, - 27;3;-0.311274,14.438549,-1.107615;;, - 33;3;-0.311274,14.438549,-1.107615;;, - 34;3;-0.311274,14.438549,-1.107615;;, - 35;3;-0.311274,14.438549,-1.107615;;, - 41;3;-0.311274,14.438549,-1.107615;;, - 43;3;-0.311274,14.438549,-1.107615;;, - 50;3;-0.311274,14.438549,-1.107615;;, - 53;3;-0.311274,14.438549,-1.107615;;, - 55;3;-0.311274,14.438549,-1.107615;;; - } - - AnimationOptions - { - 1; - 1; - } - - AnimationKey - { - 0; - 23; - 0;4;1.000000,0.000000,0.000000,0.000000;;, - 1;4;1.000000,0.000000,0.000000,0.000000;;, - 2;4;1.000000,0.000000,0.000000,0.000000;;, - 3;4;1.000000,0.000000,0.000000,0.000000;;, - 4;4;1.000000,0.000000,0.000000,0.000000;;, - 5;4;1.000000,0.000000,0.000000,0.000000;;, - 12;4;1.000000,0.000000,0.000000,0.000000;;, - 14;4;1.000000,0.000000,0.000000,0.000000;;, - 15;4;1.000000,0.000000,0.000000,0.000000;;, - 16;4;1.000000,0.000000,0.000000,0.000000;;, - 17;4;1.000000,0.000000,0.000000,0.000000;;, - 18;4;1.000000,0.000000,0.000000,0.000000;;, - 19;4;1.000000,0.000000,0.000000,0.000000;;, - 20;4;1.000000,0.000000,0.000000,0.000000;;, - 27;4;1.000000,0.000000,0.000000,0.000000;;, - 33;4;1.000000,0.000000,0.000000,0.000000;;, - 34;4;1.000000,0.000000,0.000000,0.000000;;, - 35;4;1.000000,0.000000,0.000000,0.000000;;, - 41;4;1.000000,0.000000,0.000000,0.000000;;, - 43;4;1.000000,0.000000,0.000000,0.000000;;, - 50;4;1.000000,0.000000,0.000000,0.000000;;, - 53;4;1.000000,0.000000,0.000000,0.000000;;, - 55;4;1.000000,0.000000,0.000000,0.000000;;; - } - - AnimationOptions - { - 1; - 1; - } - } - - Animation pad2Animation - { - {pad2} - - AnimationKey - { - 2; - 23; - 0;3;-6.280235,3.399014,0.000000;;, - 1;3;-6.280235,3.399014,0.000000;;, - 2;3;-6.280235,3.399014,0.000000;;, - 3;3;-6.280235,3.399014,0.000000;;, - 4;3;-6.280235,3.399014,0.000000;;, - 5;3;-6.280235,3.399014,0.000000;;, - 12;3;-6.280235,3.399014,0.000000;;, - 14;3;-6.280235,3.399014,0.000000;;, - 15;3;-6.280235,3.399014,0.000000;;, - 16;3;-6.280235,3.399014,0.000000;;, - 17;3;-6.280235,3.399014,0.000000;;, - 18;3;-6.280235,3.399014,0.000000;;, - 19;3;-6.280235,3.399014,0.000000;;, - 20;3;-6.280235,3.399014,0.000000;;, - 27;3;-6.280235,3.399014,0.000000;;, - 33;3;-6.280235,3.399014,0.000000;;, - 34;3;-6.280235,3.399014,0.000000;;, - 35;3;-6.280235,3.399014,0.000000;;, - 41;3;-6.280235,3.399014,0.000000;;, - 43;3;-6.280235,3.399014,0.000000;;, - 50;3;-6.280235,3.399014,0.000000;;, - 53;3;-6.280235,3.399014,0.000000;;, - 55;3;-6.280235,3.399014,0.000000;;; - } - - AnimationOptions - { - 1; - 1; - } - - AnimationKey - { - 0; - 23; - 0;4;0.988040,-0.130078,-0.010809,-0.082100;;, - 1;4;0.988040,-0.130078,-0.010809,-0.082100;;, - 2;4;0.988040,-0.130078,-0.010809,-0.082100;;, - 3;4;0.988040,-0.130078,-0.010809,-0.082100;;, - 4;4;0.988040,-0.130078,-0.010809,-0.082100;;, - 5;4;0.988040,-0.130078,-0.010809,-0.082100;;, - 12;4;0.988040,-0.130078,-0.010809,-0.082100;;, - 14;4;0.988040,-0.130078,-0.010809,-0.082100;;, - 15;4;0.988040,-0.130078,-0.010809,-0.082100;;, - 16;4;0.988040,-0.130078,-0.010809,-0.082100;;, - 17;4;0.988040,-0.130078,-0.010809,-0.082100;;, - 18;4;0.988040,-0.130078,-0.010809,-0.082100;;, - 19;4;0.988040,-0.130078,-0.010809,-0.082100;;, - 20;4;0.988040,-0.130078,-0.010809,-0.082100;;, - 27;4;0.989850,-0.129750,-0.014210,-0.056208;;, - 33;4;0.988040,-0.130078,-0.010809,-0.082100;;, - 34;4;0.988040,-0.130078,-0.010809,-0.082100;;, - 35;4;0.988040,-0.130078,-0.010809,-0.082100;;, - 41;4;0.988040,-0.130078,-0.010809,-0.082100;;, - 43;4;0.988040,-0.130078,-0.010809,-0.082100;;, - 50;4;0.988040,-0.130078,-0.010809,-0.082100;;, - 53;4;0.988040,-0.130078,-0.010809,-0.082100;;, - 55;4;0.988040,-0.130078,-0.010809,-0.082100;;; - } - - AnimationOptions - { - 1; - 1; - } - } - - Animation pad1Animation - { - {pad1} - - AnimationKey - { - 2; - 23; - 0;3;5.233529,3.529747,0.000000;;, - 1;3;5.233529,3.529747,0.000000;;, - 2;3;5.233529,3.529747,0.000000;;, - 3;3;5.233529,3.529747,0.000000;;, - 4;3;5.233529,3.529747,0.000000;;, - 5;3;5.233529,3.529747,0.000000;;, - 12;3;5.233529,3.529747,0.000000;;, - 14;3;5.233529,3.529747,0.000000;;, - 15;3;5.233529,3.529747,0.000000;;, - 16;3;5.233529,3.529747,0.000000;;, - 17;3;5.233529,3.529747,0.000000;;, - 18;3;5.233529,3.529747,0.000000;;, - 19;3;5.233529,3.529747,0.000000;;, - 20;3;5.233529,3.529747,0.000000;;, - 27;3;5.233529,3.529747,0.000000;;, - 33;3;5.233529,3.529747,0.000000;;, - 34;3;5.233529,3.529747,0.000000;;, - 35;3;5.233529,3.529747,0.000000;;, - 41;3;5.233529,3.529747,0.000000;;, - 43;3;5.233529,3.529747,0.000000;;, - 50;3;5.233529,3.529747,0.000000;;, - 53;3;5.233529,3.529747,0.000000;;, - 55;3;5.233529,3.529747,0.000000;;; - } - - AnimationOptions - { - 1; - 1; - } - - AnimationKey - { - 0; - 23; - 0;4;1.000000,0.000000,0.000000,0.000000;;, - 1;4;1.000000,0.000000,0.000000,0.000000;;, - 2;4;1.000000,0.000000,0.000000,0.000000;;, - 3;4;1.000000,0.000000,0.000000,0.000000;;, - 4;4;1.000000,0.000000,0.000000,0.000000;;, - 5;4;1.000000,0.000000,0.000000,0.000000;;, - 12;4;1.000000,0.000000,0.000000,0.000000;;, - 14;4;1.000000,0.000000,0.000000,0.000000;;, - 15;4;1.000000,0.000000,0.000000,0.000000;;, - 16;4;1.000000,0.000000,0.000000,0.000000;;, - 17;4;1.000000,0.000000,0.000000,0.000000;;, - 18;4;1.000000,0.000000,0.000000,0.000000;;, - 19;4;1.000000,0.000000,0.000000,0.000000;;, - 20;4;1.000000,0.000000,0.000000,0.000000;;, - 27;4;0.998135,0.000000,0.000000,-0.061049;;, - 33;4;1.000000,0.000000,0.000000,0.000000;;, - 34;4;1.000000,0.000000,0.000000,0.000000;;, - 35;4;1.000000,0.000000,0.000000,0.000000;;, - 41;4;1.000000,0.000000,0.000000,0.000000;;, - 43;4;1.000000,0.000000,0.000000,0.000000;;, - 50;4;1.000000,0.000000,0.000000,0.000000;;, - 53;4;1.000000,0.000000,0.000000,0.000000;;, - 55;4;1.000000,0.000000,0.000000,0.000000;;; - } - - AnimationOptions - { - 1; - 1; - } - } - - Animation lsholdaAnimation - { - {lsholda} - - AnimationKey - { - 2; - 23; - 0;3;-10.711074,-1.732187,3.529744;;, - 1;3;-10.711074,-1.732187,3.529744;;, - 2;3;-10.711074,-1.732187,3.529744;;, - 3;3;-10.711074,-1.732187,3.529744;;, - 4;3;-10.711074,-1.732187,3.529744;;, - 5;3;-10.711074,-1.732187,3.529744;;, - 12;3;-10.711074,-1.732187,3.529744;;, - 14;3;-10.711074,-1.732187,3.529744;;, - 15;3;-10.711074,-1.732187,3.529744;;, - 16;3;-10.711074,-1.732187,3.529744;;, - 17;3;-10.711074,-1.732187,3.529744;;, - 18;3;-10.711074,-1.732187,3.529744;;, - 19;3;-10.711074,-1.732187,3.529744;;, - 20;3;-10.711074,-1.732187,3.529744;;, - 27;3;-10.711074,-1.732187,3.529744;;, - 33;3;-10.711074,-1.732187,3.529744;;, - 34;3;-10.711074,-1.732187,3.529744;;, - 35;3;-10.711074,-1.732187,3.529744;;, - 41;3;-10.711074,-1.732187,3.529744;;, - 43;3;-10.711074,-1.732187,3.529744;;, - 50;3;-10.711074,-1.732187,3.529744;;, - 53;3;-10.711074,-1.732187,3.529744;;, - 55;3;-10.711074,-1.732187,3.529744;;; - } - - AnimationOptions - { - 1; - 1; - } - - AnimationKey - { - 0; - 23; - 0;4;0.992262,-0.004035,-0.002900,-0.124058;;, - 1;4;0.992262,-0.004035,-0.002900,-0.124058;;, - 2;4;0.984948,-0.092375,0.080710,-0.121780;;, - 3;4;0.957969,-0.193544,0.176588,-0.116845;;, - 4;4;0.919617,-0.276885,0.255679,-0.110761;;, - 5;4;0.919617,-0.276885,0.255679,-0.110761;;, - 12;4;0.919617,-0.276885,0.255679,-0.110761;;, - 14;4;0.919617,-0.276885,0.255679,-0.110761;;, - 15;4;0.919617,-0.276885,0.255679,-0.110761;;, - 16;4;0.949143,-0.215995,0.197884,-0.115394;;, - 17;4;0.973899,-0.143396,0.129045,-0.119611;;, - 18;4;0.988465,-0.067843,0.057481,-0.122598;;, - 19;4;0.992262,-0.004035,-0.002900,-0.124058;;, - 20;4;0.992262,-0.004035,-0.002900,-0.124058;;, - 27;4;0.980361,0.117258,0.064506,-0.144851;;, - 33;4;0.992262,-0.004035,-0.002900,-0.124058;;, - 34;4;0.992262,-0.004035,-0.002900,-0.124058;;, - 35;4;0.992262,-0.004035,-0.002900,-0.124058;;, - 41;4;0.987041,-0.061321,0.042727,-0.142002;;, - 43;4;0.984145,-0.079780,0.057436,-0.147634;;, - 50;4;0.975443,-0.121280,0.090521,-0.160025;;, - 53;4;0.987695,-0.056533,0.038912,-0.140529;;, - 55;4;0.992262,-0.004035,-0.002900,-0.124058;;; - } - - AnimationOptions - { - 1; - 1; - } - } - - Animation lelboAnimation - { - {lelbo} - - AnimationKey - { - 2; - 23; - 0;3;-6.541911,-5.098517,0.705949;;, - 1;3;-6.541911,-5.098517,0.705949;;, - 2;3;-6.541911,-5.098517,0.705949;;, - 3;3;-6.541911,-5.098517,0.705949;;, - 4;3;-6.541911,-5.098517,0.705949;;, - 5;3;-6.541911,-5.098517,0.705949;;, - 12;3;-6.541911,-5.098517,0.705949;;, - 14;3;-6.541911,-5.098517,0.705949;;, - 15;3;-6.541911,-5.098517,0.705949;;, - 16;3;-6.541911,-5.098517,0.705949;;, - 17;3;-6.541911,-5.098517,0.705949;;, - 18;3;-6.541911,-5.098517,0.705949;;, - 19;3;-6.541911,-5.098517,0.705949;;, - 20;3;-6.541911,-5.098517,0.705949;;, - 27;3;-6.541911,-5.098517,0.705949;;, - 33;3;-6.541911,-5.098517,0.705949;;, - 34;3;-6.541911,-5.098517,0.705949;;, - 35;3;-6.541911,-5.098517,0.705949;;, - 41;3;-6.541911,-5.098517,0.705949;;, - 43;3;-6.541911,-5.098517,0.705949;;, - 50;3;-6.541911,-5.098517,0.705949;;, - 53;3;-6.541911,-5.098517,0.705949;;, - 55;3;-6.541911,-5.098517,0.705949;;; - } - - AnimationOptions - { - 1; - 1; - } - - AnimationKey - { - 0; - 23; - 0;4;0.938931,-0.301990,0.116244,-0.117037;;, - 1;4;0.938931,-0.301990,0.116244,-0.117037;;, - 2;4;0.939499,-0.269250,0.068390,-0.200421;;, - 3;4;0.927931,-0.227598,0.011743,-0.294966;;, - 4;4;0.907758,-0.189498,-0.036768,-0.372443;;, - 5;4;0.907758,-0.189498,-0.036768,-0.372443;;, - 12;4;0.907815,-0.196434,-0.033361,-0.369017;;, - 14;4;0.907758,-0.189498,-0.036768,-0.372443;;, - 15;4;0.907758,-0.189498,-0.036768,-0.372443;;, - 16;4;0.923494,-0.217696,-0.001142,-0.315858;;, - 17;4;0.935347,-0.248829,0.040096,-0.248198;;, - 18;4;0.940317,-0.278666,0.081816,-0.177359;;, - 19;4;0.938931,-0.301990,0.116244,-0.117037;;, - 20;4;0.938931,-0.301990,0.116244,-0.117037;;, - 27;4;0.969755,-0.235046,0.020216,-0.062603;;, - 33;4;0.938931,-0.301990,0.116244,-0.117037;;, - 34;4;0.938931,-0.301990,0.116244,-0.117037;;, - 35;4;0.938931,-0.301990,0.116244,-0.117037;;, - 41;4;0.907794,-0.355022,0.176137,-0.137281;;, - 43;4;0.896205,-0.371593,0.195226,-0.143604;;, - 50;4;0.867362,-0.407890,0.237736,-0.157448;;, - 53;4;0.910675,-0.350682,0.171168,-0.135625;;, - 55;4;0.938931,-0.301990,0.116244,-0.117037;;; - } - - AnimationOptions - { - 1; - 1; - } - } - - Animation lwristAnimation - { - {lwrist} - - AnimationKey - { - 2; - 23; - 0;3;-7.850295,-6.405833,0.000000;;, - 1;3;-7.850295,-6.405833,0.000000;;, - 2;3;-7.850295,-6.405833,0.000000;;, - 3;3;-7.850295,-6.405833,0.000000;;, - 4;3;-7.850295,-6.405833,0.000000;;, - 5;3;-7.850295,-6.405833,0.000000;;, - 12;3;-7.850295,-6.405833,0.000000;;, - 14;3;-7.850295,-6.405833,0.000000;;, - 15;3;-7.850295,-6.405833,0.000000;;, - 16;3;-7.850295,-6.405833,0.000000;;, - 17;3;-7.850295,-6.405833,0.000000;;, - 18;3;-7.850295,-6.405833,0.000000;;, - 19;3;-7.850295,-6.405833,0.000000;;, - 20;3;-7.850295,-6.405833,0.000000;;, - 27;3;-7.850295,-6.405833,0.000000;;, - 33;3;-7.850295,-6.405833,0.000000;;, - 34;3;-7.850295,-6.405833,0.000000;;, - 35;3;-7.850295,-6.405833,0.000000;;, - 41;3;-7.850295,-6.405833,0.000000;;, - 43;3;-7.850295,-6.405833,0.000000;;, - 50;3;-7.850295,-6.405833,0.000000;;, - 53;3;-7.850295,-6.405833,0.000000;;, - 55;3;-7.850295,-6.405833,0.000000;;; - } - - AnimationOptions - { - 1; - 1; - } - - AnimationKey - { - 0; - 23; - 0;4;1.000000,0.000000,0.000000,0.000000;;, - 1;4;1.000000,0.000000,0.000000,0.000000;;, - 2;4;1.000000,0.000000,0.000000,0.000000;;, - 3;4;1.000000,0.000000,0.000000,0.000000;;, - 4;4;1.000000,0.000000,0.000000,0.000000;;, - 5;4;1.000000,0.000000,0.000000,0.000000;;, - 12;4;1.000000,0.000000,0.000000,0.000000;;, - 14;4;1.000000,0.000000,0.000000,0.000000;;, - 15;4;1.000000,0.000000,0.000000,0.000000;;, - 16;4;1.000000,0.000000,0.000000,0.000000;;, - 17;4;1.000000,0.000000,0.000000,0.000000;;, - 18;4;1.000000,0.000000,0.000000,0.000000;;, - 19;4;1.000000,0.000000,0.000000,0.000000;;, - 20;4;1.000000,0.000000,0.000000,0.000000;;, - 27;4;1.000000,0.000000,0.000000,0.000000;;, - 33;4;1.000000,0.000000,0.000000,0.000000;;, - 34;4;1.000000,0.000000,0.000000,0.000000;;, - 35;4;1.000000,0.000000,0.000000,0.000000;;, - 41;4;1.000000,0.000000,0.000000,0.000000;;, - 43;4;1.000000,0.000000,0.000000,0.000000;;, - 50;4;1.000000,0.000000,0.000000,0.000000;;, - 53;4;1.000000,0.000000,0.000000,0.000000;;, - 55;4;1.000000,0.000000,0.000000,0.000000;;; - } - - AnimationOptions - { - 1; - 1; - } - } - - Animation Joint17Animation - { - {Joint17} - - AnimationKey - { - 2; - 23; - 0;3;-3.663469,-3.660475,0.000000;;, - 1;3;-3.663469,-3.660475,0.000000;;, - 2;3;-3.663469,-3.660475,0.000000;;, - 3;3;-3.663469,-3.660475,0.000000;;, - 4;3;-3.663469,-3.660475,0.000000;;, - 5;3;-3.663469,-3.660475,0.000000;;, - 12;3;-3.663469,-3.660475,0.000000;;, - 14;3;-3.663469,-3.660475,0.000000;;, - 15;3;-3.663469,-3.660475,0.000000;;, - 16;3;-3.663469,-3.660475,0.000000;;, - 17;3;-3.663469,-3.660475,0.000000;;, - 18;3;-3.663469,-3.660475,0.000000;;, - 19;3;-3.663469,-3.660475,0.000000;;, - 20;3;-3.663469,-3.660475,0.000000;;, - 27;3;-3.663469,-3.660475,0.000000;;, - 33;3;-3.663469,-3.660475,0.000000;;, - 34;3;-3.663469,-3.660475,0.000000;;, - 35;3;-3.663469,-3.660475,0.000000;;, - 41;3;-3.663469,-3.660475,0.000000;;, - 43;3;-3.663469,-3.660475,0.000000;;, - 50;3;-3.663469,-3.660475,0.000000;;, - 53;3;-3.663469,-3.660475,0.000000;;, - 55;3;-3.663469,-3.660475,0.000000;;; - } - - AnimationOptions - { - 1; - 1; - } - - AnimationKey - { - 0; - 23; - 0;4;1.000000,0.000000,0.000000,0.000000;;, - 1;4;1.000000,0.000000,0.000000,0.000000;;, - 2;4;1.000000,0.000000,0.000000,0.000000;;, - 3;4;1.000000,0.000000,0.000000,0.000000;;, - 4;4;1.000000,0.000000,0.000000,0.000000;;, - 5;4;1.000000,0.000000,0.000000,0.000000;;, - 12;4;1.000000,0.000000,0.000000,0.000000;;, - 14;4;1.000000,0.000000,0.000000,0.000000;;, - 15;4;1.000000,0.000000,0.000000,0.000000;;, - 16;4;1.000000,0.000000,0.000000,0.000000;;, - 17;4;1.000000,0.000000,0.000000,0.000000;;, - 18;4;1.000000,0.000000,0.000000,0.000000;;, - 19;4;1.000000,0.000000,0.000000,0.000000;;, - 20;4;1.000000,0.000000,0.000000,0.000000;;, - 27;4;1.000000,0.000000,0.000000,0.000000;;, - 33;4;1.000000,0.000000,0.000000,0.000000;;, - 34;4;1.000000,0.000000,0.000000,0.000000;;, - 35;4;1.000000,0.000000,0.000000,0.000000;;, - 41;4;1.000000,0.000000,0.000000,0.000000;;, - 43;4;1.000000,0.000000,0.000000,0.000000;;, - 50;4;1.000000,0.000000,0.000000,0.000000;;, - 53;4;1.000000,0.000000,0.000000,0.000000;;, - 55;4;1.000000,0.000000,0.000000,0.000000;;; - } - - AnimationOptions - { - 1; - 1; - } - } - - Animation Joint18Animation - { - {Joint18} - - AnimationKey - { - 2; - 23; - 0;3;-1.046706,-2.091701,0.000000;;, - 1;3;-1.046706,-2.091701,0.000000;;, - 2;3;-1.046706,-2.091701,0.000000;;, - 3;3;-1.046706,-2.091701,0.000000;;, - 4;3;-1.046706,-2.091701,0.000000;;, - 5;3;-1.046706,-2.091701,0.000000;;, - 12;3;-1.046706,-2.091701,0.000000;;, - 14;3;-1.046706,-2.091701,0.000000;;, - 15;3;-1.046706,-2.091701,0.000000;;, - 16;3;-1.046706,-2.091701,0.000000;;, - 17;3;-1.046706,-2.091701,0.000000;;, - 18;3;-1.046706,-2.091701,0.000000;;, - 19;3;-1.046706,-2.091701,0.000000;;, - 20;3;-1.046706,-2.091701,0.000000;;, - 27;3;-1.046706,-2.091701,0.000000;;, - 33;3;-1.046706,-2.091701,0.000000;;, - 34;3;-1.046706,-2.091701,0.000000;;, - 35;3;-1.046706,-2.091701,0.000000;;, - 41;3;-1.046706,-2.091701,0.000000;;, - 43;3;-1.046706,-2.091701,0.000000;;, - 50;3;-1.046706,-2.091701,0.000000;;, - 53;3;-1.046706,-2.091701,0.000000;;, - 55;3;-1.046706,-2.091701,0.000000;;; - } - - AnimationOptions - { - 1; - 1; - } - - AnimationKey - { - 0; - 23; - 0;4;0.938191,0.000000,0.000000,-0.346117;;, - 1;4;0.938191,0.000000,0.000000,-0.346117;;, - 2;4;0.938191,0.000000,0.000000,-0.346117;;, - 3;4;0.938191,0.000000,0.000000,-0.346117;;, - 4;4;0.938191,0.000000,0.000000,-0.346117;;, - 5;4;0.938191,0.000000,0.000000,-0.346117;;, - 12;4;0.938191,0.000000,0.000000,-0.346117;;, - 14;4;0.938191,0.000000,0.000000,-0.346117;;, - 15;4;0.938191,0.000000,0.000000,-0.346117;;, - 16;4;0.938191,0.000000,0.000000,-0.346117;;, - 17;4;0.938191,0.000000,0.000000,-0.346117;;, - 18;4;0.938191,0.000000,0.000000,-0.346117;;, - 19;4;0.938191,0.000000,0.000000,-0.346117;;, - 20;4;0.938191,0.000000,0.000000,-0.346117;;, - 27;4;0.938191,0.000000,0.000000,-0.346117;;, - 33;4;0.938191,0.000000,0.000000,-0.346117;;, - 34;4;0.938191,0.000000,0.000000,-0.346117;;, - 35;4;0.938191,0.000000,0.000000,-0.346117;;, - 41;4;0.938191,0.000000,0.000000,-0.346117;;, - 43;4;0.938191,0.000000,0.000000,-0.346117;;, - 50;4;0.938191,0.000000,0.000000,-0.346117;;, - 53;4;0.938191,0.000000,0.000000,-0.346117;;, - 55;4;0.938191,0.000000,0.000000,-0.346117;;; - } - - AnimationOptions - { - 1; - 1; - } - } - - Animation Joint19Animation - { - {Joint19} - - AnimationKey - { - 2; - 23; - 0;3;-0.130838,-3.137549,0.000000;;, - 1;3;-0.130838,-3.137549,0.000000;;, - 2;3;-0.130838,-3.137549,0.000000;;, - 3;3;-0.130838,-3.137549,0.000000;;, - 4;3;-0.130838,-3.137549,0.000000;;, - 5;3;-0.130838,-3.137549,0.000000;;, - 12;3;-0.130838,-3.137549,0.000000;;, - 14;3;-0.130838,-3.137549,0.000000;;, - 15;3;-0.130838,-3.137549,0.000000;;, - 16;3;-0.130838,-3.137549,0.000000;;, - 17;3;-0.130838,-3.137549,0.000000;;, - 18;3;-0.130838,-3.137549,0.000000;;, - 19;3;-0.130838,-3.137549,0.000000;;, - 20;3;-0.130838,-3.137549,0.000000;;, - 27;3;-0.130838,-3.137549,0.000000;;, - 33;3;-0.130838,-3.137549,0.000000;;, - 34;3;-0.130838,-3.137549,0.000000;;, - 35;3;-0.130838,-3.137549,0.000000;;, - 41;3;-0.130838,-3.137549,0.000000;;, - 43;3;-0.130838,-3.137549,0.000000;;, - 50;3;-0.130838,-3.137549,0.000000;;, - 53;3;-0.130838,-3.137549,0.000000;;, - 55;3;-0.130838,-3.137549,0.000000;;; - } - - AnimationOptions - { - 1; - 1; - } - - AnimationKey - { - 0; - 23; - 0;4;1.000000,0.000000,0.000000,0.000000;;, - 1;4;1.000000,0.000000,0.000000,0.000000;;, - 2;4;1.000000,0.000000,0.000000,0.000000;;, - 3;4;1.000000,0.000000,0.000000,0.000000;;, - 4;4;1.000000,0.000000,0.000000,0.000000;;, - 5;4;1.000000,0.000000,0.000000,0.000000;;, - 12;4;1.000000,0.000000,0.000000,0.000000;;, - 14;4;1.000000,0.000000,0.000000,0.000000;;, - 15;4;1.000000,0.000000,0.000000,0.000000;;, - 16;4;1.000000,0.000000,0.000000,0.000000;;, - 17;4;1.000000,0.000000,0.000000,0.000000;;, - 18;4;1.000000,0.000000,0.000000,0.000000;;, - 19;4;1.000000,0.000000,0.000000,0.000000;;, - 20;4;1.000000,0.000000,0.000000,0.000000;;, - 27;4;1.000000,0.000000,0.000000,0.000000;;, - 33;4;1.000000,0.000000,0.000000,0.000000;;, - 34;4;1.000000,0.000000,0.000000,0.000000;;, - 35;4;1.000000,0.000000,0.000000,0.000000;;, - 41;4;1.000000,0.000000,0.000000,0.000000;;, - 43;4;1.000000,0.000000,0.000000,0.000000;;, - 50;4;1.000000,0.000000,0.000000,0.000000;;, - 53;4;1.000000,0.000000,0.000000,0.000000;;, - 55;4;1.000000,0.000000,0.000000,0.000000;;; - } - - AnimationOptions - { - 1; - 1; - } - } - - Animation Joint20Animation - { - {Joint20} - - AnimationKey - { - 2; - 23; - 0;3;-1.416095,-4.359032,-3.203176;;, - 1;3;-1.416095,-4.359032,-3.203176;;, - 2;3;-1.416095,-4.359032,-3.203176;;, - 3;3;-1.416095,-4.359032,-3.203176;;, - 4;3;-1.416095,-4.359032,-3.203176;;, - 5;3;-1.416095,-4.359032,-3.203176;;, - 12;3;-1.416095,-4.359032,-3.203176;;, - 14;3;-1.416095,-4.359032,-3.203176;;, - 15;3;-1.416095,-4.359032,-3.203176;;, - 16;3;-1.416095,-4.359032,-3.203176;;, - 17;3;-1.416095,-4.359032,-3.203176;;, - 18;3;-1.416095,-4.359032,-3.203176;;, - 19;3;-1.416095,-4.359032,-3.203176;;, - 20;3;-1.416095,-4.359032,-3.203176;;, - 27;3;-1.416095,-4.359032,-3.203176;;, - 33;3;-1.416095,-4.359032,-3.203176;;, - 34;3;-1.416095,-4.359032,-3.203176;;, - 35;3;-1.416095,-4.359032,-3.203176;;, - 41;3;-1.416095,-4.359032,-3.203176;;, - 43;3;-1.416095,-4.359032,-3.203176;;, - 50;3;-1.416095,-4.359032,-3.203176;;, - 53;3;-1.416095,-4.359032,-3.203176;;, - 55;3;-1.416095,-4.359032,-3.203176;;; - } - - AnimationOptions - { - 1; - 1; - } - - AnimationKey - { - 0; - 23; - 0;4;1.000000,0.000000,0.000000,0.000000;;, - 1;4;1.000000,0.000000,0.000000,0.000000;;, - 2;4;1.000000,0.000000,0.000000,0.000000;;, - 3;4;1.000000,0.000000,0.000000,0.000000;;, - 4;4;1.000000,0.000000,0.000000,0.000000;;, - 5;4;1.000000,0.000000,0.000000,0.000000;;, - 12;4;1.000000,0.000000,0.000000,0.000000;;, - 14;4;1.000000,0.000000,0.000000,0.000000;;, - 15;4;1.000000,0.000000,0.000000,0.000000;;, - 16;4;1.000000,0.000000,0.000000,0.000000;;, - 17;4;1.000000,0.000000,0.000000,0.000000;;, - 18;4;1.000000,0.000000,0.000000,0.000000;;, - 19;4;1.000000,0.000000,0.000000,0.000000;;, - 20;4;1.000000,0.000000,0.000000,0.000000;;, - 27;4;1.000000,0.000000,0.000000,0.000000;;, - 33;4;1.000000,0.000000,0.000000,0.000000;;, - 34;4;1.000000,0.000000,0.000000,0.000000;;, - 35;4;1.000000,0.000000,0.000000,0.000000;;, - 41;4;1.000000,0.000000,0.000000,0.000000;;, - 43;4;1.000000,0.000000,0.000000,0.000000;;, - 50;4;1.000000,0.000000,0.000000,0.000000;;, - 53;4;1.000000,0.000000,0.000000,0.000000;;, - 55;4;1.000000,0.000000,0.000000,0.000000;;; - } - - AnimationOptions - { - 1; - 1; - } - } - - Animation Joint21Animation - { - {Joint21} - - AnimationKey - { - 2; - 23; - 0;3;-1.046704,-2.483894,0.000000;;, - 1;3;-1.046704,-2.483894,0.000000;;, - 2;3;-1.046704,-2.483894,0.000000;;, - 3;3;-1.046704,-2.483894,0.000000;;, - 4;3;-1.046704,-2.483894,0.000000;;, - 5;3;-1.046704,-2.483894,0.000000;;, - 12;3;-1.046704,-2.483894,0.000000;;, - 14;3;-1.046704,-2.483894,0.000000;;, - 15;3;-1.046704,-2.483894,0.000000;;, - 16;3;-1.046704,-2.483894,0.000000;;, - 17;3;-1.046704,-2.483894,0.000000;;, - 18;3;-1.046704,-2.483894,0.000000;;, - 19;3;-1.046704,-2.483894,0.000000;;, - 20;3;-1.046704,-2.483894,0.000000;;, - 27;3;-1.046704,-2.483894,0.000000;;, - 33;3;-1.046704,-2.483894,0.000000;;, - 34;3;-1.046704,-2.483894,0.000000;;, - 35;3;-1.046704,-2.483894,0.000000;;, - 41;3;-1.046704,-2.483894,0.000000;;, - 43;3;-1.046704,-2.483894,0.000000;;, - 50;3;-1.046704,-2.483894,0.000000;;, - 53;3;-1.046704,-2.483894,0.000000;;, - 55;3;-1.046704,-2.483894,0.000000;;; - } - - AnimationOptions - { - 1; - 1; - } - - AnimationKey - { - 0; - 23; - 0;4;1.000000,0.000000,0.000000,0.000000;;, - 1;4;1.000000,0.000000,0.000000,0.000000;;, - 2;4;1.000000,0.000000,0.000000,0.000000;;, - 3;4;1.000000,0.000000,0.000000,0.000000;;, - 4;4;1.000000,0.000000,0.000000,0.000000;;, - 5;4;1.000000,0.000000,0.000000,0.000000;;, - 12;4;1.000000,0.000000,0.000000,0.000000;;, - 14;4;1.000000,0.000000,0.000000,0.000000;;, - 15;4;1.000000,0.000000,0.000000,0.000000;;, - 16;4;1.000000,0.000000,0.000000,0.000000;;, - 17;4;1.000000,0.000000,0.000000,0.000000;;, - 18;4;1.000000,0.000000,0.000000,0.000000;;, - 19;4;1.000000,0.000000,0.000000,0.000000;;, - 20;4;1.000000,0.000000,0.000000,0.000000;;, - 27;4;1.000000,0.000000,0.000000,0.000000;;, - 33;4;1.000000,0.000000,0.000000,0.000000;;, - 34;4;1.000000,0.000000,0.000000,0.000000;;, - 35;4;1.000000,0.000000,0.000000,0.000000;;, - 41;4;1.000000,0.000000,0.000000,0.000000;;, - 43;4;1.000000,0.000000,0.000000,0.000000;;, - 50;4;1.000000,0.000000,0.000000,0.000000;;, - 53;4;1.000000,0.000000,0.000000,0.000000;;, - 55;4;1.000000,0.000000,0.000000,0.000000;;; - } - - AnimationOptions - { - 1; - 1; - } - } - - Animation rsholdaAnimation - { - {rsholda} - - AnimationKey - { - 2; - 23; - 0;3;9.986465,-1.438042,3.529744;;, - 1;3;9.986465,-1.438042,3.529744;;, - 2;3;9.986465,-1.438042,3.529744;;, - 3;3;9.986465,-1.438042,3.529744;;, - 4;3;9.986465,-1.438042,3.529744;;, - 5;3;9.986465,-1.438042,3.529744;;, - 12;3;9.986465,-1.438042,3.529744;;, - 14;3;9.986465,-1.438042,3.529744;;, - 15;3;9.986465,-1.438042,3.529744;;, - 16;3;9.986465,-1.438042,3.529744;;, - 17;3;9.986465,-1.438042,3.529744;;, - 18;3;9.986465,-1.438042,3.529744;;, - 19;3;9.986465,-1.438042,3.529744;;, - 20;3;9.986465,-1.438042,3.529744;;, - 27;3;9.986465,-1.438042,3.529744;;, - 33;3;9.986465,-1.438042,3.529744;;, - 34;3;9.986465,-1.438042,3.529744;;, - 35;3;9.986465,-1.438042,3.529744;;, - 41;3;9.986465,-1.438042,3.529744;;, - 43;3;9.986465,-1.438042,3.529744;;, - 50;3;9.986465,-1.438042,3.529744;;, - 53;3;9.986465,-1.438042,3.529744;;, - 55;3;9.986465,-1.438042,3.529744;;; - } - - AnimationOptions - { - 1; - 1; - } - - AnimationKey - { - 0; - 23; - 0;4;0.993880,-0.002269,0.003388,0.110387;;, - 1;4;0.993880,-0.002269,0.003388,0.110387;;, - 2;4;0.993765,-0.003650,0.000223,0.111434;;, - 3;4;0.993637,-0.005031,-0.002942,0.112479;;, - 4;4;0.993496,-0.006413,-0.006107,0.113522;;, - 5;4;0.993496,-0.006413,-0.006107,0.113522;;, - 12;4;0.993496,-0.006413,-0.006107,0.113523;;, - 14;4;0.993496,-0.006413,-0.006107,0.113522;;, - 15;4;0.993496,-0.006413,-0.006107,0.113522;;, - 16;4;0.993603,-0.005377,-0.003733,0.112740;;, - 17;4;0.993703,-0.004341,-0.001359,0.111957;;, - 18;4;0.993795,-0.003305,0.001014,0.111173;;, - 19;4;0.993880,-0.002269,0.003388,0.110387;;, - 20;4;0.993880,-0.002269,0.003388,0.110387;;, - 27;4;0.973729,-0.204525,0.026684,0.096484;;, - 33;4;0.993880,-0.002269,0.003388,0.110387;;, - 34;4;0.993880,-0.002269,0.003388,0.110387;;, - 35;4;0.993880,-0.002269,0.003388,0.110387;;, - 41;4;0.994023,-0.003923,0.001453,0.109093;;, - 43;4;0.993957,-0.002996,-0.000780,0.109727;;, - 50;4;0.993678,0.000249,-0.008594,0.111941;;, - 53;4;0.993801,-0.001051,-0.002101,0.111149;;, - 55;4;0.993880,-0.002269,0.003388,0.110387;;; - } - - AnimationOptions - { - 1; - 1; - } - } - - Animation relboAnimation - { - {relbo} - - AnimationKey - { - 2; - 23; - 0;3;6.803588,-5.359982,0.705949;;, - 1;3;6.803588,-5.359982,0.705949;;, - 2;3;6.803588,-5.359982,0.705949;;, - 3;3;6.803588,-5.359982,0.705949;;, - 4;3;6.803588,-5.359982,0.705949;;, - 5;3;6.803588,-5.359982,0.705949;;, - 12;3;6.803588,-5.359982,0.705949;;, - 14;3;6.803588,-5.359982,0.705949;;, - 15;3;6.803588,-5.359982,0.705949;;, - 16;3;6.803588,-5.359982,0.705949;;, - 17;3;6.803588,-5.359982,0.705949;;, - 18;3;6.803588,-5.359982,0.705949;;, - 19;3;6.803588,-5.359982,0.705949;;, - 20;3;6.803588,-5.359982,0.705949;;, - 27;3;6.803588,-5.359982,0.705949;;, - 33;3;6.803588,-5.359982,0.705949;;, - 34;3;6.803588,-5.359982,0.705949;;, - 35;3;6.803588,-5.359982,0.705949;;, - 41;3;6.803588,-5.359982,0.705949;;, - 43;3;6.803588,-5.359982,0.705949;;, - 50;3;6.803588,-5.359982,0.705949;;, - 53;3;6.803588,-5.359982,0.705949;;, - 55;3;6.803588,-5.359982,0.705949;;; - } - - AnimationOptions - { - 1; - 1; - } - - AnimationKey - { - 0; - 23; - 0;4;0.959847,-0.255150,-0.080990,0.083865;;, - 1;4;0.959847,-0.255150,-0.080990,0.083865;;, - 2;4;0.962470,-0.246054,-0.075922,0.085704;;, - 3;4;0.965384,-0.235411,-0.070003,0.087834;;, - 4;4;0.967748,-0.226298,-0.064941,0.089641;;, - 5;4;0.967748,-0.226298,-0.064941,0.089641;;, - 12;4;0.967748,-0.226298,-0.064941,0.089641;;, - 14;4;0.967748,-0.226298,-0.064941,0.089641;;, - 15;4;0.967748,-0.226298,-0.064941,0.089641;;, - 16;4;0.966023,-0.232995,-0.068660,0.088315;;, - 17;4;0.964039,-0.240399,-0.072776,0.086838;;, - 18;4;0.961805,-0.248399,-0.077228,0.085231;;, - 19;4;0.959847,-0.255150,-0.080990,0.083865;;, - 20;4;0.959847,-0.255150,-0.080990,0.083865;;, - 27;4;0.959350,-0.261136,-0.082412,0.068295;;, - 33;4;0.959847,-0.255150,-0.080990,0.083865;;, - 34;4;0.959847,-0.255150,-0.080990,0.083865;;, - 35;4;0.959847,-0.255150,-0.080990,0.083865;;, - 41;4;0.958063,-0.263775,-0.077544,0.080776;;, - 43;4;0.957289,-0.265983,-0.080054,0.080258;;, - 50;4;0.955168,-0.270038,-0.091428,0.079837;;, - 53;4;0.957785,-0.261756,-0.085958,0.082112;;, - 55;4;0.959847,-0.255150,-0.080990,0.083865;;; - } - - AnimationOptions - { - 1; - 1; - } - } - - Animation rwristAnimation - { - {rwrist} - - AnimationKey - { - 2; - 24; - 0;3;8.373647,-6.798027,0.000000;;, - 1;3;8.373647,-6.798027,0.000000;;, - 2;3;8.373647,-6.798027,0.000000;;, - 3;3;8.373647,-6.798027,0.000000;;, - 4;3;8.373647,-6.798027,0.000000;;, - 5;3;8.373647,-6.798027,0.000000;;, - 12;3;8.373647,-6.798027,0.000000;;, - 14;3;8.373647,-6.798027,0.000000;;, - 15;3;8.373647,-6.798027,0.000000;;, - 16;3;8.373647,-6.798027,0.000000;;, - 17;3;8.373647,-6.798027,0.000000;;, - 18;3;8.373647,-6.798027,0.000000;;, - 19;3;8.373647,-6.798027,0.000000;;, - 20;3;8.373647,-6.798027,0.000000;;, - 27;3;8.373647,-6.798027,0.000000;;, - 29;3;8.373647,-6.798027,0.000000;;, - 33;3;8.373647,-6.798027,0.000000;;, - 34;3;8.373647,-6.798027,0.000000;;, - 35;3;8.373647,-6.798027,0.000000;;, - 41;3;8.373647,-6.798027,0.000000;;, - 43;3;8.373647,-6.798027,0.000000;;, - 50;3;8.373647,-6.798027,0.000000;;, - 53;3;8.373647,-6.798027,0.000000;;, - 55;3;8.373647,-6.798027,0.000000;;; - } - - AnimationOptions - { - 1; - 1; - } - - AnimationKey - { - 0; - 24; - 0;4;1.000000,0.000000,0.000000,0.000000;;, - 1;4;1.000000,0.000000,0.000000,0.000000;;, - 2;4;0.999709,0.020471,0.012692,-0.001586;;, - 3;4;0.998633,0.044321,0.027480,-0.003434;;, - 4;4;0.997090,0.064652,0.040085,-0.005009;;, - 5;4;0.997090,0.064652,0.040085,-0.005009;;, - 12;4;0.997090,0.064652,0.040085,-0.005009;;, - 14;4;0.997090,0.064652,0.040085,-0.005009;;, - 15;4;0.997090,0.064652,0.040085,-0.005009;;, - 16;4;0.998280,0.049721,0.030828,-0.003852;;, - 17;4;0.999269,0.032417,0.020099,-0.002511;;, - 18;4;0.999848,0.014768,0.009157,-0.001144;;, - 19;4;1.000000,0.000000,0.000000,0.000000;;, - 20;4;1.000000,0.000000,0.000000,0.000000;;, - 27;4;0.996917,0.078459,0.000000,0.000000;;, - 29;4;0.992822,0.119601,0.000000,0.000000;;, - 33;4;1.000000,0.000000,0.000000,0.000000;;, - 34;4;1.000000,0.000000,0.000000,0.000000;;, - 35;4;1.000000,0.000000,0.000000,0.000000;;, - 41;4;0.999329,-0.002870,0.035216,-0.009610;;, - 43;4;0.999253,-0.000181,0.037154,-0.010592;;, - 50;4;0.999533,0.011592,0.026653,-0.009464;;, - 53;4;0.999915,0.005480,0.011096,-0.004044;;, - 55;4;1.000000,0.000000,0.000000,0.000000;;; - } - - AnimationOptions - { - 1; - 1; - } - } - - Animation Joint25Animation - { - {Joint25} - - AnimationKey - { - 2; - 23; - 0;3;3.663469,-3.137551,0.000000;;, - 1;3;3.663469,-3.137551,0.000000;;, - 2;3;3.663469,-3.137551,0.000000;;, - 3;3;3.663469,-3.137551,0.000000;;, - 4;3;3.663469,-3.137551,0.000000;;, - 5;3;3.663469,-3.137551,0.000000;;, - 12;3;3.663469,-3.137551,0.000000;;, - 14;3;3.663469,-3.137551,0.000000;;, - 15;3;3.663469,-3.137551,0.000000;;, - 16;3;3.663469,-3.137551,0.000000;;, - 17;3;3.663469,-3.137551,0.000000;;, - 18;3;3.663469,-3.137551,0.000000;;, - 19;3;3.663469,-3.137551,0.000000;;, - 20;3;3.663469,-3.137551,0.000000;;, - 27;3;3.663469,-3.137551,0.000000;;, - 33;3;3.663469,-3.137551,0.000000;;, - 34;3;3.663469,-3.137551,0.000000;;, - 35;3;3.663469,-3.137551,0.000000;;, - 41;3;3.663469,-3.137551,0.000000;;, - 43;3;3.663469,-3.137551,0.000000;;, - 50;3;3.663469,-3.137551,0.000000;;, - 53;3;3.663469,-3.137551,0.000000;;, - 55;3;3.663469,-3.137551,0.000000;;; - } - - AnimationOptions - { - 1; - 1; - } - - AnimationKey - { - 0; - 23; - 0;4;1.000000,0.000000,0.000000,0.000000;;, - 1;4;1.000000,0.000000,0.000000,0.000000;;, - 2;4;1.000000,0.000000,0.000000,0.000000;;, - 3;4;1.000000,0.000000,0.000000,0.000000;;, - 4;4;1.000000,0.000000,0.000000,0.000000;;, - 5;4;1.000000,0.000000,0.000000,0.000000;;, - 12;4;1.000000,0.000000,0.000000,0.000000;;, - 14;4;1.000000,0.000000,0.000000,0.000000;;, - 15;4;1.000000,0.000000,0.000000,0.000000;;, - 16;4;1.000000,0.000000,0.000000,0.000000;;, - 17;4;1.000000,0.000000,0.000000,0.000000;;, - 18;4;1.000000,0.000000,0.000000,0.000000;;, - 19;4;1.000000,0.000000,0.000000,0.000000;;, - 20;4;1.000000,0.000000,0.000000,0.000000;;, - 27;4;1.000000,0.000000,0.000000,0.000000;;, - 33;4;1.000000,0.000000,0.000000,0.000000;;, - 34;4;1.000000,0.000000,0.000000,0.000000;;, - 35;4;1.000000,0.000000,0.000000,0.000000;;, - 41;4;1.000000,0.000000,0.000000,0.000000;;, - 43;4;1.000000,0.000000,0.000000,0.000000;;, - 50;4;1.000000,0.000000,0.000000,0.000000;;, - 53;4;1.000000,0.000000,0.000000,0.000000;;, - 55;4;1.000000,0.000000,0.000000,0.000000;;; - } - - AnimationOptions - { - 1; - 1; - } - } - - Animation Joint26Animation - { - {Joint26} - - AnimationKey - { - 2; - 23; - 0;3;1.046706,-2.353162,0.000000;;, - 1;3;1.046706,-2.353162,0.000000;;, - 2;3;1.046706,-2.353162,0.000000;;, - 3;3;1.046706,-2.353162,0.000000;;, - 4;3;1.046706,-2.353162,0.000000;;, - 5;3;1.046706,-2.353162,0.000000;;, - 12;3;1.046706,-2.353162,0.000000;;, - 14;3;1.046706,-2.353162,0.000000;;, - 15;3;1.046706,-2.353162,0.000000;;, - 16;3;1.046706,-2.353162,0.000000;;, - 17;3;1.046706,-2.353162,0.000000;;, - 18;3;1.046706,-2.353162,0.000000;;, - 19;3;1.046706,-2.353162,0.000000;;, - 20;3;1.046706,-2.353162,0.000000;;, - 27;3;1.046706,-2.353162,0.000000;;, - 33;3;1.046706,-2.353162,0.000000;;, - 34;3;1.046706,-2.353162,0.000000;;, - 35;3;1.046706,-2.353162,0.000000;;, - 41;3;1.046706,-2.353162,0.000000;;, - 43;3;1.046706,-2.353162,0.000000;;, - 50;3;1.046706,-2.353162,0.000000;;, - 53;3;1.046706,-2.353162,0.000000;;, - 55;3;1.046706,-2.353162,0.000000;;; - } - - AnimationOptions - { - 1; - 1; - } - - AnimationKey - { - 0; - 23; - 0;4;0.878817,0.000000,0.000000,0.477159;;, - 1;4;0.878817,0.000000,0.000000,0.477159;;, - 2;4;0.878817,0.000000,0.000000,0.477159;;, - 3;4;0.878817,0.000000,0.000000,0.477159;;, - 4;4;0.878817,0.000000,0.000000,0.477159;;, - 5;4;0.878817,0.000000,0.000000,0.477159;;, - 12;4;0.878817,0.000000,0.000000,0.477159;;, - 14;4;0.878817,0.000000,0.000000,0.477159;;, - 15;4;0.878817,0.000000,0.000000,0.477159;;, - 16;4;0.878817,0.000000,0.000000,0.477159;;, - 17;4;0.878817,0.000000,0.000000,0.477159;;, - 18;4;0.878817,0.000000,0.000000,0.477159;;, - 19;4;0.878817,0.000000,0.000000,0.477159;;, - 20;4;0.878817,0.000000,0.000000,0.477159;;, - 27;4;0.878817,0.000000,0.000000,0.477159;;, - 33;4;0.878817,0.000000,0.000000,0.477159;;, - 34;4;0.878817,0.000000,0.000000,0.477159;;, - 35;4;0.878817,0.000000,0.000000,0.477159;;, - 41;4;0.878817,0.000000,0.000000,0.477159;;, - 43;4;0.878817,0.000000,0.000000,0.477159;;, - 50;4;0.878817,0.000000,0.000000,0.477159;;, - 53;4;0.878817,0.000000,0.000000,0.477159;;, - 55;4;0.878817,0.000000,0.000000,0.477159;;; - } - - AnimationOptions - { - 1; - 1; - } - } - - Animation Joint27Animation - { - {Joint27} - - AnimationKey - { - 2; - 23; - 0;3;-0.261676,-2.876088,0.000000;;, - 1;3;-0.261676,-2.876088,0.000000;;, - 2;3;-0.261676,-2.876088,0.000000;;, - 3;3;-0.261676,-2.876088,0.000000;;, - 4;3;-0.261676,-2.876088,0.000000;;, - 5;3;-0.261676,-2.876088,0.000000;;, - 12;3;-0.261676,-2.876088,0.000000;;, - 14;3;-0.261676,-2.876088,0.000000;;, - 15;3;-0.261676,-2.876088,0.000000;;, - 16;3;-0.261676,-2.876088,0.000000;;, - 17;3;-0.261676,-2.876088,0.000000;;, - 18;3;-0.261676,-2.876088,0.000000;;, - 19;3;-0.261676,-2.876088,0.000000;;, - 20;3;-0.261676,-2.876088,0.000000;;, - 27;3;-0.261676,-2.876088,0.000000;;, - 33;3;-0.261676,-2.876088,0.000000;;, - 34;3;-0.261676,-2.876088,0.000000;;, - 35;3;-0.261676,-2.876088,0.000000;;, - 41;3;-0.261676,-2.876088,0.000000;;, - 43;3;-0.261676,-2.876088,0.000000;;, - 50;3;-0.261676,-2.876088,0.000000;;, - 53;3;-0.261676,-2.876088,0.000000;;, - 55;3;-0.261676,-2.876088,0.000000;;; - } - - AnimationOptions - { - 1; - 1; - } - - AnimationKey - { - 0; - 23; - 0;4;1.000000,0.000000,0.000000,0.000000;;, - 1;4;1.000000,0.000000,0.000000,0.000000;;, - 2;4;1.000000,0.000000,0.000000,0.000000;;, - 3;4;1.000000,0.000000,0.000000,0.000000;;, - 4;4;1.000000,0.000000,0.000000,0.000000;;, - 5;4;1.000000,0.000000,0.000000,0.000000;;, - 12;4;1.000000,0.000000,0.000000,0.000000;;, - 14;4;1.000000,0.000000,0.000000,0.000000;;, - 15;4;1.000000,0.000000,0.000000,0.000000;;, - 16;4;1.000000,0.000000,0.000000,0.000000;;, - 17;4;1.000000,0.000000,0.000000,0.000000;;, - 18;4;1.000000,0.000000,0.000000,0.000000;;, - 19;4;1.000000,0.000000,0.000000,0.000000;;, - 20;4;1.000000,0.000000,0.000000,0.000000;;, - 27;4;1.000000,0.000000,0.000000,0.000000;;, - 33;4;1.000000,0.000000,0.000000,0.000000;;, - 34;4;1.000000,0.000000,0.000000,0.000000;;, - 35;4;1.000000,0.000000,0.000000,0.000000;;, - 41;4;1.000000,0.000000,0.000000,0.000000;;, - 43;4;1.000000,0.000000,0.000000,0.000000;;, - 50;4;1.000000,0.000000,0.000000,0.000000;;, - 53;4;1.000000,0.000000,0.000000,0.000000;;, - 55;4;1.000000,0.000000,0.000000,0.000000;;; - } - - AnimationOptions - { - 1; - 1; - } - } - - Animation Joint28Animation - { - {Joint28} - - AnimationKey - { - 2; - 23; - 0;3;-0.785030,-4.183402,-2.034320;;, - 1;3;-0.785030,-4.183402,-2.034320;;, - 2;3;-0.785030,-4.183402,-2.034320;;, - 3;3;-0.785030,-4.183402,-2.034320;;, - 4;3;-0.785030,-4.183402,-2.034320;;, - 5;3;-0.785030,-4.183402,-2.034320;;, - 12;3;-0.785030,-4.183402,-2.034320;;, - 14;3;-0.785030,-4.183402,-2.034320;;, - 15;3;-0.785030,-4.183402,-2.034320;;, - 16;3;-0.785030,-4.183402,-2.034320;;, - 17;3;-0.785030,-4.183402,-2.034320;;, - 18;3;-0.785030,-4.183402,-2.034320;;, - 19;3;-0.785030,-4.183402,-2.034320;;, - 20;3;-0.785030,-4.183402,-2.034320;;, - 27;3;-0.785030,-4.183402,-2.034320;;, - 33;3;-0.785030,-4.183402,-2.034320;;, - 34;3;-0.785030,-4.183402,-2.034320;;, - 35;3;-0.785030,-4.183402,-2.034320;;, - 41;3;-0.785030,-4.183402,-2.034320;;, - 43;3;-0.785030,-4.183402,-2.034320;;, - 50;3;-0.785030,-4.183402,-2.034320;;, - 53;3;-0.785030,-4.183402,-2.034320;;, - 55;3;-0.785030,-4.183402,-2.034320;;; - } - - AnimationOptions - { - 1; - 1; - } - - AnimationKey - { - 0; - 23; - 0;4;0.971342,0.000000,0.000000,0.237686;;, - 1;4;0.971342,0.000000,0.000000,0.237686;;, - 2;4;0.971342,0.000000,0.000000,0.237686;;, - 3;4;0.971342,0.000000,0.000000,0.237686;;, - 4;4;0.971342,0.000000,0.000000,0.237686;;, - 5;4;0.971342,0.000000,0.000000,0.237686;;, - 12;4;0.971342,0.000000,0.000000,0.237686;;, - 14;4;0.971342,0.000000,0.000000,0.237686;;, - 15;4;0.971342,0.000000,0.000000,0.237686;;, - 16;4;0.971342,0.000000,0.000000,0.237686;;, - 17;4;0.971342,0.000000,0.000000,0.237686;;, - 18;4;0.971342,0.000000,0.000000,0.237686;;, - 19;4;0.971342,0.000000,0.000000,0.237686;;, - 20;4;0.971342,0.000000,0.000000,0.237686;;, - 27;4;0.971342,0.000000,0.000000,0.237686;;, - 33;4;0.971342,0.000000,0.000000,0.237686;;, - 34;4;0.971342,0.000000,0.000000,0.237686;;, - 35;4;0.971342,0.000000,0.000000,0.237686;;, - 41;4;0.971342,0.000000,0.000000,0.237686;;, - 43;4;0.971342,0.000000,0.000000,0.237686;;, - 50;4;0.971342,0.000000,0.000000,0.237686;;, - 53;4;0.971342,0.000000,0.000000,0.237686;;, - 55;4;0.971342,0.000000,0.000000,0.237686;;; - } - - AnimationOptions - { - 1; - 1; - } - } - - Animation Joint29Animation - { - {Joint29} - - AnimationKey - { - 2; - 23; - 0;3;0.261676,-2.483894,0.000000;;, - 1;3;0.261676,-2.483894,0.000000;;, - 2;3;0.261676,-2.483894,0.000000;;, - 3;3;0.261676,-2.483894,0.000000;;, - 4;3;0.261676,-2.483894,0.000000;;, - 5;3;0.261676,-2.483894,0.000000;;, - 12;3;0.261676,-2.483894,0.000000;;, - 14;3;0.261676,-2.483894,0.000000;;, - 15;3;0.261676,-2.483894,0.000000;;, - 16;3;0.261676,-2.483894,0.000000;;, - 17;3;0.261676,-2.483894,0.000000;;, - 18;3;0.261676,-2.483894,0.000000;;, - 19;3;0.261676,-2.483894,0.000000;;, - 20;3;0.261676,-2.483894,0.000000;;, - 27;3;0.261676,-2.483894,0.000000;;, - 33;3;0.261676,-2.483894,0.000000;;, - 34;3;0.261676,-2.483894,0.000000;;, - 35;3;0.261676,-2.483894,0.000000;;, - 41;3;0.261676,-2.483894,0.000000;;, - 43;3;0.261676,-2.483894,0.000000;;, - 50;3;0.261676,-2.483894,0.000000;;, - 53;3;0.261676,-2.483894,0.000000;;, - 55;3;0.261676,-2.483894,0.000000;;; - } - - AnimationOptions - { - 1; - 1; - } - - AnimationKey - { - 0; - 23; - 0;4;1.000000,0.000000,0.000000,0.000000;;, - 1;4;1.000000,0.000000,0.000000,0.000000;;, - 2;4;1.000000,0.000000,0.000000,0.000000;;, - 3;4;1.000000,0.000000,0.000000,0.000000;;, - 4;4;1.000000,0.000000,0.000000,0.000000;;, - 5;4;1.000000,0.000000,0.000000,0.000000;;, - 12;4;1.000000,0.000000,0.000000,0.000000;;, - 14;4;1.000000,0.000000,0.000000,0.000000;;, - 15;4;1.000000,0.000000,0.000000,0.000000;;, - 16;4;1.000000,0.000000,0.000000,0.000000;;, - 17;4;1.000000,0.000000,0.000000,0.000000;;, - 18;4;1.000000,0.000000,0.000000,0.000000;;, - 19;4;1.000000,0.000000,0.000000,0.000000;;, - 20;4;1.000000,0.000000,0.000000,0.000000;;, - 27;4;1.000000,0.000000,0.000000,0.000000;;, - 33;4;1.000000,0.000000,0.000000,0.000000;;, - 34;4;1.000000,0.000000,0.000000,0.000000;;, - 35;4;1.000000,0.000000,0.000000,0.000000;;, - 41;4;1.000000,0.000000,0.000000,0.000000;;, - 43;4;1.000000,0.000000,0.000000,0.000000;;, - 50;4;1.000000,0.000000,0.000000,0.000000;;, - 53;4;1.000000,0.000000,0.000000,0.000000;;, - 55;4;1.000000,0.000000,0.000000,0.000000;;; - } - - AnimationOptions - { - 1; - 1; - } - } - - Animation weaponAnimation - { - {weapon} - - AnimationKey - { - 2; - 23; - 0;3;1.700897,-4.837056,0.000000;;, - 1;3;1.700897,-4.837056,0.000000;;, - 2;3;1.700897,-4.837056,0.000000;;, - 3;3;1.700897,-4.837056,0.000000;;, - 4;3;1.700897,-4.837056,0.000000;;, - 5;3;1.700897,-4.837056,0.000000;;, - 12;3;1.700897,-4.837056,0.000000;;, - 14;3;1.700897,-4.837056,0.000000;;, - 15;3;1.700897,-4.837056,0.000000;;, - 16;3;1.700897,-4.837056,0.000000;;, - 17;3;1.700897,-4.837056,0.000000;;, - 18;3;1.700897,-4.837056,0.000000;;, - 19;3;1.700897,-4.837056,0.000000;;, - 20;3;1.700897,-4.837056,0.000000;;, - 27;3;1.700897,-4.837056,0.000000;;, - 33;3;1.700897,-4.837056,0.000000;;, - 34;3;1.700897,-4.837056,0.000000;;, - 35;3;1.700897,-4.837056,0.000000;;, - 41;3;1.700897,-4.837056,0.000000;;, - 43;3;1.700897,-4.837056,0.000000;;, - 50;3;1.700897,-4.837056,0.000000;;, - 53;3;1.700897,-4.837056,0.000000;;, - 55;3;1.700897,-4.837056,0.000000;;; - } - - AnimationOptions - { - 1; - 1; - } - - AnimationKey - { - 0; - 23; - 0;4;1.000000,0.000000,0.000000,0.000000;;, - 1;4;1.000000,0.000000,0.000000,0.000000;;, - 2;4;0.999743,0.021683,0.006609,-0.000572;;, - 3;4;0.998794,0.046948,0.014309,-0.001238;;, - 4;4;0.997432,0.068488,0.020874,-0.001806;;, - 5;4;0.997432,0.068488,0.020874,-0.001806;;, - 12;4;0.997432,0.068488,0.020874,-0.001806;;, - 14;4;0.997432,0.068488,0.020874,-0.001806;;, - 15;4;0.997432,0.068488,0.020874,-0.001806;;, - 16;4;0.998482,0.052668,0.016052,-0.001389;;, - 17;4;0.999355,0.034337,0.010465,-0.000906;;, - 18;4;0.999866,0.015644,0.004768,-0.000413;;, - 19;4;1.000000,0.000000,0.000000,0.000000;;, - 20;4;1.000000,0.000000,0.000000,0.000000;;, - 27;4;1.000000,0.000000,0.000000,0.000000;;, - 33;4;1.000000,0.000000,0.000000,0.000000;;, - 34;4;1.000000,0.000000,0.000000,0.000000;;, - 35;4;1.000000,0.000000,0.000000,0.000000;;, - 41;4;0.991577,-0.013382,0.128747,-0.004423;;, - 43;4;0.988533,-0.009191,0.150627,-0.005432;;, - 50;4;0.995744,0.045103,0.080265,-0.004060;;, - 53;4;0.999255,0.021677,0.031875,-0.001700;;, - 55;4;1.000000,0.000000,0.000000,0.000000;;; - } - - AnimationOptions - { - 1; - 1; - } - } - - Animation endAnimation - { - {end} - - AnimationKey - { - 2; - 23; - 0;3;0.179647,0.498486,-36.421711;;, - 1;3;0.179647,0.498486,-36.421711;;, - 2;3;0.179647,0.498486,-36.421711;;, - 3;3;0.179647,0.498486,-36.421711;;, - 4;3;0.179647,0.498486,-36.421711;;, - 5;3;0.179647,0.498486,-36.421711;;, - 12;3;0.179647,0.498486,-36.421711;;, - 14;3;0.179647,0.498486,-36.421711;;, - 15;3;0.179647,0.498486,-36.421711;;, - 16;3;0.179647,0.498486,-36.421711;;, - 17;3;0.179647,0.498486,-36.421711;;, - 18;3;0.179647,0.498486,-36.421711;;, - 19;3;0.179647,0.498486,-36.421711;;, - 20;3;0.179647,0.498486,-36.421711;;, - 27;3;0.179647,0.498486,-36.421711;;, - 33;3;0.179647,0.498486,-36.421711;;, - 34;3;0.179647,0.498486,-36.421711;;, - 35;3;0.179647,0.498486,-36.421711;;, - 41;3;0.179647,0.498486,-36.421711;;, - 43;3;0.179647,0.498486,-36.421711;;, - 50;3;0.179647,0.498486,-36.421711;;, - 53;3;0.179647,0.498486,-36.421711;;, - 55;3;0.179647,0.498486,-36.421711;;; - } - - AnimationOptions - { - 1; - 1; - } - - AnimationKey - { - 0; - 23; - 0;4;1.000000,0.000000,0.000000,0.000000;;, - 1;4;1.000000,0.000000,0.000000,0.000000;;, - 2;4;1.000000,0.000000,0.000000,0.000000;;, - 3;4;1.000000,0.000000,0.000000,0.000000;;, - 4;4;1.000000,0.000000,0.000000,0.000000;;, - 5;4;1.000000,0.000000,0.000000,0.000000;;, - 12;4;1.000000,0.000000,0.000000,0.000000;;, - 14;4;1.000000,0.000000,0.000000,0.000000;;, - 15;4;1.000000,0.000000,0.000000,0.000000;;, - 16;4;1.000000,0.000000,0.000000,0.000000;;, - 17;4;1.000000,0.000000,0.000000,0.000000;;, - 18;4;1.000000,0.000000,0.000000,0.000000;;, - 19;4;1.000000,0.000000,0.000000,0.000000;;, - 20;4;1.000000,0.000000,0.000000,0.000000;;, - 27;4;1.000000,0.000000,0.000000,0.000000;;, - 33;4;1.000000,0.000000,0.000000,0.000000;;, - 34;4;1.000000,0.000000,0.000000,0.000000;;, - 35;4;1.000000,0.000000,0.000000,0.000000;;, - 41;4;1.000000,0.000000,0.000000,0.000000;;, - 43;4;1.000000,0.000000,0.000000,0.000000;;, - 50;4;1.000000,0.000000,0.000000,0.000000;;, - 53;4;1.000000,0.000000,0.000000,0.000000;;, - 55;4;1.000000,0.000000,0.000000,0.000000;;; - } - - AnimationOptions - { - 1; - 1; - } - } - - Animation hitAnimation - { - {hit} - - AnimationKey - { - 2; - 23; - 0;3;9.751877,-17.324219,-0.896412;;, - 1;3;9.751877,-17.324219,-0.896412;;, - 2;3;9.751877,-17.324219,-0.896412;;, - 3;3;9.751877,-17.324219,-0.896412;;, - 4;3;9.751877,-17.324219,-0.896412;;, - 5;3;9.751877,-17.324219,-0.896412;;, - 12;3;9.751877,-17.324219,-0.896412;;, - 14;3;9.751877,-17.324219,-0.896412;;, - 15;3;9.751877,-17.324219,-0.896412;;, - 16;3;9.751877,-17.324219,-0.896412;;, - 17;3;9.751877,-17.324219,-0.896412;;, - 18;3;9.751877,-17.324219,-0.896412;;, - 19;3;9.751877,-17.324219,-0.896412;;, - 20;3;9.751877,-17.324219,-0.896412;;, - 27;3;9.751877,-17.324219,-0.896412;;, - 33;3;9.751877,-17.324219,-0.896412;;, - 34;3;9.751877,-17.324219,-0.896412;;, - 35;3;9.751877,-17.324219,-0.896412;;, - 41;3;9.751877,-17.324219,-0.896412;;, - 43;3;9.751877,-17.324219,-0.896412;;, - 50;3;9.751877,-17.324219,-0.896412;;, - 53;3;9.751877,-17.324219,-0.896412;;, - 55;3;9.751877,-17.324219,-0.896412;;; - } - - AnimationOptions - { - 1; - 1; - } - - AnimationKey - { - 0; - 23; - 0;4;1.000000,0.000000,0.000000,0.000000;;, - 1;4;1.000000,0.000000,0.000000,0.000000;;, - 2;4;1.000000,0.000000,0.000000,0.000000;;, - 3;4;1.000000,0.000000,0.000000,0.000000;;, - 4;4;1.000000,0.000000,0.000000,0.000000;;, - 5;4;1.000000,0.000000,0.000000,0.000000;;, - 12;4;1.000000,0.000000,0.000000,0.000000;;, - 14;4;1.000000,0.000000,0.000000,0.000000;;, - 15;4;1.000000,0.000000,0.000000,0.000000;;, - 16;4;1.000000,0.000000,0.000000,0.000000;;, - 17;4;1.000000,0.000000,0.000000,0.000000;;, - 18;4;1.000000,0.000000,0.000000,0.000000;;, - 19;4;1.000000,0.000000,0.000000,0.000000;;, - 20;4;1.000000,0.000000,0.000000,0.000000;;, - 27;4;1.000000,0.000000,0.000000,0.000000;;, - 33;4;1.000000,0.000000,0.000000,0.000000;;, - 34;4;1.000000,0.000000,0.000000,0.000000;;, - 35;4;1.000000,0.000000,0.000000,0.000000;;, - 41;4;1.000000,0.000000,0.000000,0.000000;;, - 43;4;1.000000,0.000000,0.000000,0.000000;;, - 50;4;1.000000,0.000000,0.000000,0.000000;;, - 53;4;1.000000,0.000000,0.000000,0.000000;;, - 55;4;1.000000,0.000000,0.000000,0.000000;;; - } - - AnimationOptions - { - 1; - 1; - } - } -} diff --git a/media/earth.jpg b/media/earth.jpg deleted file mode 100644 index df0e9aae..00000000 Binary files a/media/earth.jpg and /dev/null differ diff --git a/media/earth.x b/media/earth.x deleted file mode 100644 index 01f2827e..00000000 --- a/media/earth.x +++ /dev/null @@ -1,20711 +0,0 @@ -xof 0303txt 0032 - -Frame Frame_SCENE_ROOT { - - - FrameTransformMatrix { - 1.000000,0.000000,0.000000,0.000000,0.000000,1.000000,0.000000,0.000000,0.000000,0.000000,1.000000,0.000000,0.000000,0.000000,0.000000,1.000000;; - } - - Frame Frame1_sphere_lwo_layer1 { - - - FrameTransformMatrix { - 1.000000,0.000000,0.000000,0.000000,0.000000,1.000000,0.000000,0.000000,0.000000,0.000000,1.000000,0.000000,0.000000,0.000000,0.000000,1.000000;; - } - - Mesh Mesh_sphere_lwo_Layer1 { - 2307; - -0.032702;0.997859;-0.056641;, - -0.039815;0.997859;-0.051888;, - 0.000000;1.000000;0.000000;, - -0.065263;0.991445;-0.113039;, - -0.079459;0.991445;-0.103553;, - -0.046247;0.997859;-0.046247;, - 0.000000;1.000000;0.000000;, - -0.025029;0.997859;-0.060425;, - -0.049950;0.991445;-0.120590;, - -0.074658;0.980785;-0.180240;, - -0.097545;0.980785;-0.168953;, - -0.118763;0.980785;-0.154776;, - -0.092296;0.991445;-0.092296;, - -0.016928;0.997859;-0.063175;, - -0.033783;0.991445;-0.126079;, - -0.050493;0.980785;-0.188443;, - -0.066987;0.965926;-0.250000;, - -0.099046;0.965926;-0.239118;, - -0.129410;0.965926;-0.224144;, - -0.008537;0.997859;-0.064844;, - -0.017037;0.991445;-0.129410;, - -0.025464;0.980785;-0.193421;, - -0.033783;0.965926;-0.256605;, - -0.041956;0.946930;-0.318689;, - -0.083195;0.946930;-0.310487;, - 0.000000;0.997859;-0.065403;, - 0.000000;0.991445;-0.130526;, - 0.000000;0.980785;-0.195090;, - 0.000000;0.965926;-0.258819;, - 0.000000;0.946930;-0.321439;, - 0.008537;0.997859;-0.064844;, - 0.017037;0.991445;-0.129410;, - 0.025464;0.980785;-0.193421;, - 0.033783;0.965926;-0.256605;, - 0.041956;0.946930;-0.318689;, - 0.000000;0.923880;-0.382683;, - 0.016928;0.997859;-0.063175;, - 0.033783;0.991445;-0.126079;, - 0.050493;0.980785;-0.188443;, - 0.066987;0.965926;-0.250000;, - 0.083195;0.946930;-0.310487;, - 0.049950;0.923880;-0.379410;, - 0.025029;0.997859;-0.060425;, - 0.049950;0.991445;-0.120590;, - 0.074658;0.980785;-0.180240;, - 0.099046;0.965926;-0.239118;, - 0.123010;0.946930;-0.296971;, - 0.099046;0.923880;-0.369644;, - 0.032702;0.997859;-0.056641;, - 0.065263;0.991445;-0.113039;, - 0.097545;0.980785;-0.168953;, - 0.129410;0.965926;-0.224144;, - 0.160720;0.946930;-0.278375;, - 0.146447;0.923880;-0.353553;, - 0.039815;0.997859;-0.051888;, - 0.079459;0.991445;-0.103553;, - 0.118763;0.980785;-0.154776;, - 0.157559;0.965926;-0.205335;, - 0.195680;0.946930;-0.255015;, - 0.191342;0.923880;-0.331414;, - 0.046247;0.997859;-0.046247;, - 0.092296;0.991445;-0.092296;, - 0.137950;0.980785;-0.137950;, - 0.183013;0.965926;-0.183013;, - 0.227292;0.946930;-0.227292;, - 0.232963;0.923880;-0.303603;, - 0.051888;0.997859;-0.039815;, - 0.103553;0.991445;-0.079459;, - 0.154776;0.980785;-0.118763;, - 0.205335;0.965926;-0.157559;, - 0.255015;0.946930;-0.195680;, - 0.270598;0.923880;-0.270598;, - 0.056641;0.997859;-0.032702;, - 0.113039;0.991445;-0.065263;, - 0.168953;0.980785;-0.097545;, - 0.224144;0.965926;-0.129410;, - 0.278375;0.946930;-0.160720;, - 0.303603;0.923880;-0.232963;, - 0.060425;0.997859;-0.025029;, - 0.120590;0.991445;-0.049950;, - 0.180240;0.980785;-0.074658;, - 0.239118;0.965926;-0.099046;, - 0.296971;0.946930;-0.123010;, - 0.331414;0.923880;-0.191342;, - 0.063175;0.997859;-0.016928;, - 0.126079;0.991445;-0.033783;, - 0.188443;0.980785;-0.050493;, - 0.250000;0.965926;-0.066987;, - 0.310487;0.946930;-0.083195;, - 0.353553;0.923880;-0.146447;, - 0.064844;0.997859;-0.008537;, - 0.129410;0.991445;-0.017037;, - 0.193421;0.980785;-0.025464;, - 0.256605;0.965926;-0.033783;, - 0.318689;0.946930;-0.041956;, - 0.369644;0.923880;-0.099046;, - 0.065403;0.997859;0.000000;, - 0.130526;0.991445;0.000000;, - 0.195090;0.980785;0.000000;, - 0.258819;0.965926;0.000000;, - 0.321439;0.946930;0.000000;, - 0.379410;0.923880;-0.049950;, - 0.064844;0.997859;0.008537;, - 0.129410;0.991445;0.017037;, - 0.193421;0.980785;0.025464;, - 0.256605;0.965926;0.033783;, - 0.318689;0.946930;0.041956;, - 0.382683;0.923880;0.000000;, - 0.063175;0.997859;0.016928;, - 0.126079;0.991445;0.033783;, - 0.188443;0.980785;0.050493;, - 0.250000;0.965926;0.066987;, - 0.310487;0.946930;0.083195;, - 0.379410;0.923880;0.049950;, - 0.060425;0.997859;0.025029;, - 0.120590;0.991445;0.049950;, - 0.180240;0.980785;0.074658;, - 0.239118;0.965926;0.099046;, - 0.296971;0.946930;0.123010;, - 0.369644;0.923880;0.099046;, - 0.056641;0.997859;0.032702;, - 0.113039;0.991445;0.065263;, - 0.168953;0.980785;0.097545;, - 0.224144;0.965926;0.129410;, - 0.278375;0.946930;0.160720;, - 0.353553;0.923880;0.146447;, - 0.051888;0.997859;0.039815;, - 0.103553;0.991445;0.079459;, - 0.154776;0.980785;0.118763;, - 0.205335;0.965926;0.157559;, - 0.255015;0.946930;0.195680;, - 0.331414;0.923880;0.191342;, - 0.046247;0.997859;0.046247;, - 0.092296;0.991445;0.092296;, - 0.137950;0.980785;0.137950;, - 0.183013;0.965926;0.183013;, - 0.227292;0.946930;0.227292;, - 0.303603;0.923880;0.232963;, - 0.039815;0.997859;0.051888;, - 0.079459;0.991445;0.103553;, - 0.118763;0.980785;0.154776;, - 0.157559;0.965926;0.205335;, - 0.195680;0.946930;0.255015;, - 0.270598;0.923880;0.270598;, - 0.032702;0.997859;0.056641;, - 0.065263;0.991445;0.113039;, - 0.097545;0.980785;0.168953;, - 0.129410;0.965926;0.224144;, - 0.160720;0.946930;0.278375;, - 0.232963;0.923880;0.303603;, - 0.025029;0.997859;0.060425;, - 0.049950;0.991445;0.120590;, - 0.074658;0.980785;0.180240;, - 0.099046;0.965926;0.239118;, - 0.123010;0.946930;0.296971;, - 0.191342;0.923880;0.331414;, - 0.016928;0.997859;0.063175;, - 0.033783;0.991445;0.126079;, - 0.050493;0.980785;0.188443;, - 0.066987;0.965926;0.250000;, - 0.083195;0.946930;0.310487;, - 0.146447;0.923880;0.353553;, - 0.008537;0.997859;0.064844;, - 0.017037;0.991445;0.129410;, - 0.025464;0.980785;0.193421;, - 0.033783;0.965926;0.256605;, - 0.041956;0.946930;0.318689;, - 0.099046;0.923880;0.369644;, - 0.000000;0.997859;0.065403;, - 0.000000;0.991445;0.130526;, - 0.000000;0.980785;0.195090;, - 0.000000;0.965926;0.258819;, - 0.000000;0.946930;0.321439;, - 0.049950;0.923880;0.379410;, - 0.114473;0.896873;0.427218;, - 0.169257;0.896873;0.408621;, - 0.221144;0.896873;0.383033;, - 0.000000;0.923880;0.382683;, - 0.057730;0.896873;0.438505;, - 0.129410;0.866025;0.482963;, - 0.191342;0.866025;0.461940;, - 0.250000;0.866025;0.433013;, - 0.304381;0.866025;0.396677;, - 0.269248;0.896873;0.350891;, - 0.000000;0.896873;0.442289;, - 0.065263;0.866025;0.495722;, - 0.143792;0.831470;0.536640;, - 0.212608;0.831470;0.513280;, - 0.277785;0.831470;0.481138;, - 0.338210;0.831470;0.440764;, - 0.000000;0.866025;0.500000;, - 0.072516;0.831470;0.550817;, - 0.157559;0.793353;0.588018;, - 0.232963;0.793353;0.562422;, - 0.304381;0.793353;0.527203;, - 0.370590;0.793353;0.482963;, - 0.000000;0.831470;0.555570;, - 0.079459;0.793353;0.603553;, - 0.170651;0.751840;0.636879;, - 0.252321;0.751840;0.609156;, - 0.329673;0.751840;0.571010;, - 0.401384;0.751840;0.523094;, - 0.000000;0.793353;0.608761;, - 0.086062;0.751840;0.653705;, - 0.183013;0.707107;0.683013;, - 0.270598;0.707107;0.653282;, - 0.353553;0.707107;0.612372;, - 0.430459;0.707107;0.560986;, - 0.000000;0.751840;0.659346;, - 0.092296;0.707107;0.701057;, - 0.194590;0.659346;0.726222;, - 0.287717;0.659346;0.694609;, - 0.375920;0.659346;0.651112;, - 0.457691;0.659346;0.596475;, - 0.000000;0.707107;0.707107;, - 0.098135;0.659346;0.745408;, - 0.205335;0.608761;0.766320;, - 0.303603;0.608761;0.732963;, - 0.396677;0.608761;0.687064;, - 0.482963;0.608761;0.629410;, - 0.000000;0.659346;0.751840;, - 0.103553;0.608761;0.786566;, - 0.215200;0.555570;0.803138;, - 0.318190;0.555570;0.768178;, - 0.415735;0.555570;0.720074;, - 0.506167;0.555570;0.659649;, - 0.000000;0.608761;0.793353;, - 0.108529;0.555570;0.824356;, - 0.224144;0.500000;0.836516;, - 0.331414;0.500000;0.800103;, - 0.433013;0.500000;0.750000;, - 0.527203;0.500000;0.687064;, - 0.000000;0.555570;0.831470;, - 0.113039;0.500000;0.858616;, - 0.232128;0.442289;0.866313;, - 0.343218;0.442289;0.828602;, - 0.448436;0.442289;0.776715;, - 0.545982;0.442289;0.711537;, - 0.000000;0.500000;0.866025;, - 0.117065;0.442289;0.889200;, - 0.239118;0.382683;0.892399;, - 0.353553;0.382683;0.853553;, - 0.461940;0.382683;0.800103;, - 0.562422;0.382683;0.732963;, - 0.000000;0.442289;0.896873;, - 0.120590;0.382683;0.915976;, - 0.245084;0.321439;0.914664;, - 0.362374;0.321439;0.874849;, - 0.473465;0.321439;0.820066;, - 0.576455;0.321439;0.751250;, - 0.000000;0.382683;0.923880;, - 0.123599;0.321439;0.938829;, - 0.250000;0.258819;0.933013;, - 0.369644;0.258819;0.892399;, - 0.482963;0.258819;0.836516;, - 0.588018;0.258819;0.766320;, - 0.000000;0.321439;0.946930;, - 0.126079;0.258819;0.957662;, - 0.253846;0.195090;0.947366;, - 0.375330;0.195090;0.906127;, - 0.490393;0.195090;0.849385;, - 0.597064;0.195090;0.778109;, - 0.000000;0.258819;0.965926;, - 0.128018;0.195090;0.972395;, - 0.256605;0.130526;0.957662;, - 0.379410;0.130526;0.915976;, - 0.495722;0.130526;0.858616;, - 0.603553;0.130526;0.786566;, - 0.000000;0.195090;0.980785;, - 0.129410;0.130526;0.982963;, - 0.258265;0.065403;0.963858;, - 0.381864;0.065403;0.921901;, - 0.498929;0.065403;0.864171;, - 0.607458;0.065403;0.791655;, - 0.000000;0.130526;0.991445;, - 0.130247;0.065403;0.989322;, - 0.258819;0.000000;0.965926;, - 0.382683;0.000000;0.923880;, - 0.500000;0.000000;0.866025;, - 0.608761;0.000000;0.793353;, - 0.000000;0.065403;0.997859;, - 0.130526;0.000000;0.991445;, - 0.258265;-0.065403;0.963858;, - 0.381864;-0.065403;0.921901;, - 0.498929;-0.065403;0.864171;, - 0.607458;-0.065403;0.791655;, - 0.000000;0.000000;1.000000;, - 0.130247;-0.065403;0.989322;, - 0.256605;-0.130526;0.957662;, - 0.379410;-0.130526;0.915976;, - 0.495722;-0.130526;0.858616;, - 0.603553;-0.130526;0.786566;, - 0.000000;-0.065403;0.997859;, - 0.129410;-0.130526;0.982963;, - 0.253846;-0.195090;0.947366;, - 0.375330;-0.195090;0.906127;, - 0.490393;-0.195090;0.849385;, - 0.597064;-0.195090;0.778109;, - 0.000000;-0.130526;0.991445;, - 0.128018;-0.195090;0.972395;, - 0.250000;-0.258819;0.933013;, - 0.369644;-0.258819;0.892399;, - 0.482963;-0.258819;0.836516;, - 0.588018;-0.258819;0.766320;, - 0.000000;-0.195090;0.980785;, - 0.126079;-0.258819;0.957662;, - 0.245084;-0.321439;0.914664;, - 0.362374;-0.321439;0.874849;, - 0.473465;-0.321439;0.820066;, - 0.576455;-0.321439;0.751250;, - 0.000000;-0.258819;0.965926;, - 0.123599;-0.321439;0.938829;, - 0.239118;-0.382683;0.892399;, - 0.353553;-0.382683;0.853553;, - 0.461940;-0.382683;0.800103;, - 0.562422;-0.382683;0.732963;, - 0.000000;-0.321439;0.946930;, - 0.120590;-0.382683;0.915976;, - 0.232128;-0.442289;0.866313;, - 0.343218;-0.442289;0.828602;, - 0.448436;-0.442289;0.776715;, - 0.545982;-0.442289;0.711537;, - 0.000000;-0.382683;0.923880;, - 0.117065;-0.442289;0.889200;, - 0.224144;-0.500000;0.836516;, - 0.331414;-0.500000;0.800103;, - 0.433013;-0.500000;0.750000;, - 0.527203;-0.500000;0.687064;, - 0.000000;-0.442289;0.896873;, - 0.113039;-0.500000;0.858616;, - 0.215200;-0.555570;0.803138;, - 0.318190;-0.555570;0.768178;, - 0.415735;-0.555570;0.720074;, - 0.506167;-0.555570;0.659649;, - 0.000000;-0.500000;0.866025;, - 0.108529;-0.555570;0.824356;, - 0.205335;-0.608761;0.766320;, - 0.303603;-0.608761;0.732963;, - 0.396677;-0.608761;0.687064;, - 0.482963;-0.608761;0.629410;, - 0.000000;-0.555570;0.831470;, - 0.103553;-0.608761;0.786566;, - 0.194590;-0.659346;0.726222;, - 0.287717;-0.659346;0.694609;, - 0.375920;-0.659346;0.651112;, - 0.457691;-0.659346;0.596475;, - 0.000000;-0.608761;0.793353;, - 0.098135;-0.659346;0.745408;, - 0.183013;-0.707107;0.683013;, - 0.270598;-0.707107;0.653282;, - 0.353553;-0.707107;0.612372;, - 0.430459;-0.707107;0.560986;, - 0.000000;-0.659346;0.751840;, - 0.092296;-0.707107;0.701057;, - 0.170651;-0.751840;0.636879;, - 0.252321;-0.751840;0.609156;, - 0.329673;-0.751840;0.571010;, - 0.401384;-0.751840;0.523094;, - 0.000000;-0.707107;0.707107;, - 0.086062;-0.751840;0.653705;, - 0.157559;-0.793353;0.588018;, - 0.232963;-0.793353;0.562422;, - 0.304381;-0.793353;0.527203;, - 0.370590;-0.793353;0.482963;, - 0.000000;-0.751840;0.659346;, - 0.079459;-0.793353;0.603553;, - 0.143792;-0.831470;0.536640;, - 0.212608;-0.831470;0.513280;, - 0.277785;-0.831470;0.481138;, - 0.338210;-0.831470;0.440764;, - 0.000000;-0.793353;0.608761;, - 0.072516;-0.831470;0.550817;, - 0.129410;-0.866025;0.482963;, - 0.191342;-0.866025;0.461940;, - 0.250000;-0.866025;0.433013;, - 0.304381;-0.866025;0.396677;, - 0.000000;-0.831470;0.555570;, - 0.065263;-0.866025;0.495722;, - 0.114473;-0.896873;0.427218;, - 0.169257;-0.896873;0.408621;, - 0.221144;-0.896873;0.383033;, - 0.269248;-0.896873;0.350891;, - 0.000000;-0.866025;0.500000;, - 0.057730;-0.896873;0.438505;, - 0.099046;-0.923880;0.369644;, - 0.146447;-0.923880;0.353553;, - 0.191342;-0.923880;0.331414;, - 0.232963;-0.923880;0.303603;, - 0.000000;-0.896873;0.442289;, - 0.049950;-0.923880;0.379410;, - 0.083195;-0.946930;0.310487;, - 0.123010;-0.946930;0.296971;, - 0.160720;-0.946930;0.278375;, - 0.195680;-0.946930;0.255015;, - 0.000000;-0.923880;0.382683;, - 0.041956;-0.946930;0.318689;, - 0.066987;-0.965926;0.250000;, - 0.099046;-0.965926;0.239118;, - 0.129410;-0.965926;0.224144;, - 0.157559;-0.965926;0.205335;, - 0.000000;-0.946930;0.321439;, - 0.033783;-0.965926;0.256605;, - 0.050493;-0.980785;0.188443;, - 0.074658;-0.980785;0.180240;, - 0.097545;-0.980785;0.168953;, - 0.118763;-0.980785;0.154776;, - 0.000000;-0.965926;0.258819;, - 0.025464;-0.980785;0.193421;, - 0.033783;-0.991445;0.126079;, - 0.049950;-0.991445;0.120590;, - 0.065263;-0.991445;0.113039;, - 0.079459;-0.991445;0.103553;, - 0.000000;-0.980785;0.195090;, - 0.017037;-0.991445;0.129410;, - 0.016928;-0.997859;0.063175;, - 0.025029;-0.997859;0.060425;, - 0.032702;-0.997859;0.056641;, - 0.039815;-0.997859;0.051888;, - 0.000000;-0.991445;0.130526;, - 0.008537;-0.997859;0.064844;, - 0.000000;-1.000000;0.000000;, - 0.046247;-0.997859;0.046247;, - 0.092296;-0.991445;0.092296;, - 0.000000;-0.997859;0.065403;, - 0.137950;-0.980785;0.137950;, - 0.103553;-0.991445;0.079459;, - 0.154776;-0.980785;0.118763;, - 0.183013;-0.965926;0.183013;, - 0.051888;-0.997859;0.039815;, - 0.056641;-0.997859;0.032702;, - 0.113039;-0.991445;0.065263;, - 0.168953;-0.980785;0.097545;, - 0.205335;-0.965926;0.157559;, - 0.060425;-0.997859;0.025029;, - 0.120590;-0.991445;0.049950;, - 0.180240;-0.980785;0.074658;, - 0.224144;-0.965926;0.129410;, - 0.255015;-0.946930;0.195680;, - 0.227292;-0.946930;0.227292;, - 0.063175;-0.997859;0.016928;, - 0.126079;-0.991445;0.033783;, - 0.188443;-0.980785;0.050493;, - 0.239118;-0.965926;0.099046;, - 0.278375;-0.946930;0.160720;, - 0.064844;-0.997859;0.008537;, - 0.129410;-0.991445;0.017037;, - 0.193421;-0.980785;0.025464;, - 0.250000;-0.965926;0.066987;, - 0.296971;-0.946930;0.123010;, - 0.065403;-0.997859;0.000000;, - 0.130526;-0.991445;0.000000;, - 0.195090;-0.980785;0.000000;, - 0.256605;-0.965926;0.033783;, - 0.310487;-0.946930;0.083195;, - 0.064844;-0.997859;-0.008537;, - 0.129410;-0.991445;-0.017037;, - 0.193421;-0.980785;-0.025464;, - 0.258819;-0.965926;0.000000;, - 0.318689;-0.946930;0.041956;, - 0.063175;-0.997859;-0.016928;, - 0.126079;-0.991445;-0.033783;, - 0.188443;-0.980785;-0.050493;, - 0.256605;-0.965926;-0.033783;, - 0.321439;-0.946930;0.000000;, - 0.060425;-0.997859;-0.025029;, - 0.120590;-0.991445;-0.049950;, - 0.180240;-0.980785;-0.074658;, - 0.250000;-0.965926;-0.066987;, - 0.318689;-0.946930;-0.041956;, - 0.056641;-0.997859;-0.032702;, - 0.113039;-0.991445;-0.065263;, - 0.168953;-0.980785;-0.097545;, - 0.239118;-0.965926;-0.099046;, - 0.310487;-0.946930;-0.083195;, - 0.051888;-0.997859;-0.039815;, - 0.103553;-0.991445;-0.079459;, - 0.154776;-0.980785;-0.118763;, - 0.224144;-0.965926;-0.129410;, - 0.296971;-0.946930;-0.123010;, - 0.046247;-0.997859;-0.046247;, - 0.092296;-0.991445;-0.092296;, - 0.137950;-0.980785;-0.137950;, - 0.205335;-0.965926;-0.157559;, - 0.278375;-0.946930;-0.160720;, - 0.039815;-0.997859;-0.051888;, - 0.079459;-0.991445;-0.103553;, - 0.118763;-0.980785;-0.154776;, - 0.183013;-0.965926;-0.183013;, - 0.255015;-0.946930;-0.195680;, - 0.032702;-0.997859;-0.056641;, - 0.065263;-0.991445;-0.113039;, - 0.097545;-0.980785;-0.168953;, - 0.157559;-0.965926;-0.205335;, - 0.227292;-0.946930;-0.227292;, - 0.025029;-0.997859;-0.060425;, - 0.049950;-0.991445;-0.120590;, - 0.074658;-0.980785;-0.180240;, - 0.129410;-0.965926;-0.224144;, - 0.195680;-0.946930;-0.255015;, - 0.016928;-0.997859;-0.063175;, - 0.033783;-0.991445;-0.126079;, - 0.050493;-0.980785;-0.188443;, - 0.099046;-0.965926;-0.239118;, - 0.160720;-0.946930;-0.278375;, - 0.008537;-0.997859;-0.064844;, - 0.017037;-0.991445;-0.129410;, - 0.025464;-0.980785;-0.193421;, - 0.066987;-0.965926;-0.250000;, - 0.123010;-0.946930;-0.296971;, - 0.000000;-0.997859;-0.065403;, - 0.000000;-0.991445;-0.130526;, - 0.000000;-0.980785;-0.195090;, - 0.033783;-0.965926;-0.256605;, - 0.083195;-0.946930;-0.310487;, - 0.146447;-0.923880;-0.353553;, - 0.191342;-0.923880;-0.331414;, - -0.017037;-0.991445;-0.129410;, - -0.025464;-0.980785;-0.193421;, - -0.033783;-0.965926;-0.256605;, - 0.000000;-0.965926;-0.258819;, - 0.041956;-0.946930;-0.318689;, - 0.099046;-0.923880;-0.369644;, - -0.008537;-0.997859;-0.064844;, - -0.033783;-0.991445;-0.126079;, - -0.050493;-0.980785;-0.188443;, - -0.066987;-0.965926;-0.250000;, - -0.083195;-0.946930;-0.310487;, - -0.041956;-0.946930;-0.318689;, - 0.000000;-1.000000;0.000000;, - -0.016928;-0.997859;-0.063175;, - -0.049950;-0.991445;-0.120590;, - -0.074658;-0.980785;-0.180240;, - -0.099046;-0.965926;-0.239118;, - -0.123010;-0.946930;-0.296971;, - -0.025029;-0.997859;-0.060425;, - -0.065263;-0.991445;-0.113039;, - -0.097545;-0.980785;-0.168953;, - -0.129410;-0.965926;-0.224144;, - -0.160720;-0.946930;-0.278375;, - -0.032702;-0.997859;-0.056641;, - -0.079459;-0.991445;-0.103553;, - -0.118763;-0.980785;-0.154776;, - -0.157559;-0.965926;-0.205335;, - -0.195680;-0.946930;-0.255015;, - -0.039815;-0.997859;-0.051888;, - -0.092296;-0.991445;-0.092296;, - -0.137950;-0.980785;-0.137950;, - -0.183013;-0.965926;-0.183013;, - -0.227292;-0.946930;-0.227292;, - -0.046247;-0.997859;-0.046247;, - -0.103553;-0.991445;-0.079459;, - -0.154776;-0.980785;-0.118763;, - -0.205335;-0.965926;-0.157559;, - -0.255015;-0.946930;-0.195680;, - -0.051888;-0.997859;-0.039815;, - -0.113039;-0.991445;-0.065263;, - -0.168953;-0.980785;-0.097545;, - -0.224144;-0.965926;-0.129410;, - -0.278375;-0.946930;-0.160720;, - -0.056641;-0.997859;-0.032702;, - -0.120590;-0.991445;-0.049950;, - -0.180240;-0.980785;-0.074658;, - -0.239118;-0.965926;-0.099046;, - -0.296971;-0.946930;-0.123010;, - -0.060425;-0.997859;-0.025029;, - -0.126079;-0.991445;-0.033783;, - -0.188443;-0.980785;-0.050493;, - -0.250000;-0.965926;-0.066987;, - -0.310487;-0.946930;-0.083195;, - -0.063175;-0.997859;-0.016928;, - -0.129410;-0.991445;-0.017037;, - -0.193421;-0.980785;-0.025464;, - -0.256605;-0.965926;-0.033783;, - -0.318689;-0.946930;-0.041956;, - -0.064844;-0.997859;-0.008537;, - -0.130526;-0.991445;0.000000;, - -0.195090;-0.980785;0.000000;, - -0.258819;-0.965926;0.000000;, - -0.321439;-0.946930;0.000000;, - -0.065403;-0.997859;0.000000;, - -0.129410;-0.991445;0.017037;, - -0.193421;-0.980785;0.025464;, - -0.256605;-0.965926;0.033783;, - -0.318689;-0.946930;0.041956;, - -0.064844;-0.997859;0.008537;, - -0.126079;-0.991445;0.033783;, - -0.188443;-0.980785;0.050493;, - -0.250000;-0.965926;0.066987;, - -0.310487;-0.946930;0.083195;, - -0.063175;-0.997859;0.016928;, - -0.120590;-0.991445;0.049950;, - -0.180240;-0.980785;0.074658;, - -0.239118;-0.965926;0.099046;, - -0.296971;-0.946930;0.123010;, - -0.060425;-0.997859;0.025029;, - -0.113039;-0.991445;0.065263;, - -0.168953;-0.980785;0.097545;, - -0.224144;-0.965926;0.129410;, - -0.278375;-0.946930;0.160720;, - -0.056641;-0.997859;0.032702;, - -0.103553;-0.991445;0.079459;, - -0.154776;-0.980785;0.118763;, - -0.205335;-0.965926;0.157559;, - -0.255015;-0.946930;0.195680;, - -0.051888;-0.997859;0.039815;, - -0.092296;-0.991445;0.092296;, - -0.137950;-0.980785;0.137950;, - -0.183013;-0.965926;0.183013;, - -0.227292;-0.946930;0.227292;, - -0.046247;-0.997859;0.046247;, - -0.079459;-0.991445;0.103553;, - -0.118763;-0.980785;0.154776;, - -0.157559;-0.965926;0.205335;, - -0.195680;-0.946930;0.255015;, - -0.039815;-0.997859;0.051888;, - -0.065263;-0.991445;0.113039;, - -0.097545;-0.980785;0.168953;, - -0.129410;-0.965926;0.224144;, - -0.160720;-0.946930;0.278375;, - -0.032702;-0.997859;0.056641;, - -0.049950;-0.991445;0.120590;, - -0.074658;-0.980785;0.180240;, - -0.099046;-0.965926;0.239118;, - -0.123010;-0.946930;0.296971;, - -0.025029;-0.997859;0.060425;, - -0.033783;-0.991445;0.126079;, - -0.050493;-0.980785;0.188443;, - -0.066987;-0.965926;0.250000;, - -0.083195;-0.946930;0.310487;, - -0.016928;-0.997859;0.063175;, - -0.017037;-0.991445;0.129410;, - -0.025464;-0.980785;0.193421;, - -0.033783;-0.965926;0.256605;, - -0.041956;-0.946930;0.318689;, - -0.008537;-0.997859;0.064844;, - 0.000000;-0.991445;0.130526;, - 0.000000;-0.980785;0.195090;, - 0.000000;-0.965926;0.258819;, - 0.000000;-0.946930;0.321439;, - 0.000000;-0.997859;0.065403;, - 0.000000;-0.923880;0.382683;, - -0.049950;-0.923880;0.379410;, - -0.099046;-0.923880;0.369644;, - -0.146447;-0.923880;0.353553;, - 0.000000;-0.896873;0.442289;, - -0.057730;-0.896873;0.438505;, - -0.114473;-0.896873;0.427218;, - -0.169257;-0.896873;0.408621;, - -0.191342;-0.923880;0.331414;, - -0.232963;-0.923880;0.303603;, - 0.000000;-0.866025;0.500000;, - -0.065263;-0.866025;0.495722;, - -0.129410;-0.866025;0.482963;, - -0.191342;-0.866025;0.461940;, - -0.221144;-0.896873;0.383033;, - -0.269248;-0.896873;0.350891;, - -0.270598;-0.923880;0.270598;, - 0.000000;-0.831470;0.555570;, - -0.072516;-0.831470;0.550817;, - -0.143792;-0.831470;0.536640;, - -0.212608;-0.831470;0.513280;, - -0.250000;-0.866025;0.433013;, - -0.304381;-0.866025;0.396677;, - -0.312745;-0.896873;0.312745;, - 0.000000;-0.793353;0.608761;, - -0.079459;-0.793353;0.603553;, - -0.157559;-0.793353;0.588018;, - -0.232963;-0.793353;0.562422;, - -0.277785;-0.831470;0.481138;, - -0.338210;-0.831470;0.440764;, - -0.353553;-0.866025;0.353553;, - 0.000000;-0.751840;0.659346;, - -0.086062;-0.751840;0.653705;, - -0.170651;-0.751840;0.636879;, - -0.252321;-0.751840;0.609156;, - -0.304381;-0.793353;0.527203;, - -0.370590;-0.793353;0.482963;, - -0.392847;-0.831470;0.392847;, - 0.000000;-0.707107;0.707107;, - -0.092296;-0.707107;0.701057;, - -0.183013;-0.707107;0.683013;, - -0.270598;-0.707107;0.653282;, - -0.329673;-0.751840;0.571010;, - -0.401384;-0.751840;0.523094;, - -0.430459;-0.793353;0.430459;, - 0.000000;-0.659346;0.751840;, - -0.098135;-0.659346;0.745408;, - -0.194590;-0.659346;0.726222;, - -0.287717;-0.659346;0.694609;, - -0.353553;-0.707107;0.612372;, - -0.430459;-0.707107;0.560986;, - -0.466228;-0.751840;0.466228;, - 0.000000;-0.608761;0.793353;, - -0.103553;-0.608761;0.786566;, - -0.205335;-0.608761;0.766320;, - -0.303603;-0.608761;0.732963;, - -0.375920;-0.659346;0.651112;, - -0.457691;-0.659346;0.596475;, - -0.500000;-0.707107;0.500000;, - 0.000000;-0.555570;0.831470;, - -0.108529;-0.555570;0.824356;, - -0.215200;-0.555570;0.803138;, - -0.318190;-0.555570;0.768178;, - -0.396677;-0.608761;0.687064;, - -0.482963;-0.608761;0.629410;, - -0.531631;-0.659346;0.531631;, - 0.000000;-0.500000;0.866025;, - -0.113039;-0.500000;0.858616;, - -0.224144;-0.500000;0.836516;, - -0.331414;-0.500000;0.800103;, - -0.415735;-0.555570;0.720074;, - -0.506167;-0.555570;0.659649;, - -0.560986;-0.608761;0.560986;, - 0.000000;-0.442289;0.896873;, - -0.117065;-0.442289;0.889200;, - -0.232128;-0.442289;0.866313;, - -0.343218;-0.442289;0.828602;, - -0.433013;-0.500000;0.750000;, - -0.527203;-0.500000;0.687064;, - -0.587938;-0.555570;0.587938;, - 0.000000;-0.382683;0.923880;, - -0.120590;-0.382683;0.915976;, - -0.239118;-0.382683;0.892399;, - -0.353553;-0.382683;0.853553;, - -0.448436;-0.442289;0.776715;, - -0.545982;-0.442289;0.711537;, - -0.612372;-0.500000;0.612372;, - 0.000000;-0.321439;0.946930;, - -0.123599;-0.321439;0.938829;, - -0.245084;-0.321439;0.914664;, - -0.362374;-0.321439;0.874849;, - -0.461940;-0.382683;0.800103;, - -0.562422;-0.382683;0.732963;, - -0.634185;-0.442289;0.634185;, - 0.000000;-0.258819;0.965926;, - -0.126079;-0.258819;0.957662;, - -0.250000;-0.258819;0.933013;, - -0.369644;-0.258819;0.892399;, - -0.473465;-0.321439;0.820066;, - -0.576455;-0.321439;0.751250;, - -0.653282;-0.382683;0.653282;, - 0.000000;-0.195090;0.980785;, - -0.128018;-0.195090;0.972395;, - -0.253846;-0.195090;0.947366;, - -0.375330;-0.195090;0.906127;, - -0.482963;-0.258819;0.836516;, - -0.588018;-0.258819;0.766320;, - -0.669581;-0.321439;0.669581;, - 0.000000;-0.130526;0.991445;, - -0.129410;-0.130526;0.982963;, - -0.256605;-0.130526;0.957662;, - -0.379410;-0.130526;0.915976;, - -0.490393;-0.195090;0.849385;, - -0.597064;-0.195090;0.778109;, - -0.683013;-0.258819;0.683013;, - 0.000000;-0.065403;0.997859;, - -0.130247;-0.065403;0.989322;, - -0.258265;-0.065403;0.963858;, - -0.381864;-0.065403;0.921901;, - -0.495722;-0.130526;0.858616;, - -0.603553;-0.130526;0.786566;, - -0.693520;-0.195090;0.693520;, - 0.000000;0.000000;1.000000;, - -0.130526;0.000000;0.991445;, - -0.258819;0.000000;0.965926;, - -0.382683;0.000000;0.923880;, - -0.498929;-0.065403;0.864171;, - -0.607458;-0.065403;0.791655;, - -0.701057;-0.130526;0.701057;, - 0.000000;0.065403;0.997859;, - -0.130247;0.065403;0.989322;, - -0.258265;0.065403;0.963858;, - -0.381864;0.065403;0.921901;, - -0.500000;0.000000;0.866025;, - -0.608761;0.000000;0.793353;, - -0.705593;-0.065403;0.705593;, - 0.000000;0.130526;0.991445;, - -0.129410;0.130526;0.982963;, - -0.256605;0.130526;0.957662;, - -0.379410;0.130526;0.915976;, - -0.498929;0.065403;0.864171;, - -0.607458;0.065403;0.791655;, - -0.707107;0.000000;0.707107;, - 0.000000;0.195090;0.980785;, - -0.128018;0.195090;0.972395;, - -0.253846;0.195090;0.947366;, - -0.375330;0.195090;0.906127;, - -0.495722;0.130526;0.858616;, - -0.603553;0.130526;0.786566;, - -0.705593;0.065403;0.705593;, - 0.000000;0.258819;0.965926;, - -0.126079;0.258819;0.957662;, - -0.250000;0.258819;0.933013;, - -0.369644;0.258819;0.892399;, - -0.490393;0.195090;0.849385;, - -0.597064;0.195090;0.778109;, - -0.701057;0.130526;0.701057;, - 0.000000;0.321439;0.946930;, - -0.123599;0.321439;0.938829;, - -0.245084;0.321439;0.914664;, - -0.362374;0.321439;0.874849;, - -0.482963;0.258819;0.836516;, - -0.588018;0.258819;0.766320;, - -0.693520;0.195090;0.693520;, - 0.000000;0.382683;0.923880;, - -0.120590;0.382683;0.915976;, - -0.239118;0.382683;0.892399;, - -0.353553;0.382683;0.853553;, - -0.473465;0.321439;0.820066;, - -0.576455;0.321439;0.751250;, - -0.683013;0.258819;0.683013;, - 0.000000;0.442289;0.896873;, - -0.117065;0.442289;0.889200;, - -0.232128;0.442289;0.866313;, - -0.343218;0.442289;0.828602;, - -0.461940;0.382683;0.800103;, - -0.562422;0.382683;0.732963;, - -0.669581;0.321439;0.669581;, - 0.000000;0.500000;0.866025;, - -0.113039;0.500000;0.858616;, - -0.224144;0.500000;0.836516;, - -0.331414;0.500000;0.800103;, - -0.448436;0.442289;0.776715;, - -0.545982;0.442289;0.711537;, - -0.653282;0.382683;0.653282;, - 0.000000;0.555570;0.831470;, - -0.108529;0.555570;0.824356;, - -0.215200;0.555570;0.803138;, - -0.318190;0.555570;0.768178;, - -0.433013;0.500000;0.750000;, - -0.527203;0.500000;0.687064;, - -0.634185;0.442289;0.634185;, - 0.000000;0.608761;0.793353;, - -0.103553;0.608761;0.786566;, - -0.205335;0.608761;0.766320;, - -0.303603;0.608761;0.732963;, - -0.415735;0.555570;0.720074;, - -0.506167;0.555570;0.659649;, - -0.612372;0.500000;0.612372;, - 0.000000;0.659346;0.751840;, - -0.098135;0.659346;0.745408;, - -0.194590;0.659346;0.726222;, - -0.287717;0.659346;0.694609;, - -0.396677;0.608761;0.687064;, - -0.482963;0.608761;0.629410;, - -0.587938;0.555570;0.587938;, - 0.000000;0.707107;0.707107;, - -0.092296;0.707107;0.701057;, - -0.183013;0.707107;0.683013;, - -0.270598;0.707107;0.653282;, - -0.375920;0.659346;0.651112;, - -0.457691;0.659346;0.596475;, - -0.560986;0.608761;0.560986;, - 0.000000;0.751840;0.659346;, - -0.086062;0.751840;0.653705;, - -0.170651;0.751840;0.636879;, - -0.252321;0.751840;0.609156;, - -0.353553;0.707107;0.612372;, - -0.430459;0.707107;0.560986;, - -0.531631;0.659346;0.531631;, - 0.000000;0.793353;0.608761;, - -0.079459;0.793353;0.603553;, - -0.157559;0.793353;0.588018;, - -0.232963;0.793353;0.562422;, - -0.329673;0.751840;0.571010;, - -0.401384;0.751840;0.523094;, - -0.500000;0.707107;0.500000;, - 0.000000;0.831470;0.555570;, - -0.072516;0.831470;0.550817;, - -0.143792;0.831470;0.536640;, - -0.212608;0.831470;0.513280;, - -0.304381;0.793353;0.527203;, - -0.370590;0.793353;0.482963;, - -0.466228;0.751840;0.466228;, - 0.000000;0.866025;0.500000;, - -0.065263;0.866025;0.495722;, - -0.129410;0.866025;0.482963;, - -0.191342;0.866025;0.461940;, - -0.277785;0.831470;0.481138;, - -0.338210;0.831470;0.440764;, - -0.430459;0.793353;0.430459;, - 0.000000;0.896873;0.442289;, - -0.057730;0.896873;0.438505;, - -0.114473;0.896873;0.427218;, - -0.169257;0.896873;0.408621;, - -0.250000;0.866025;0.433013;, - -0.304381;0.866025;0.396677;, - -0.392847;0.831470;0.392847;, - 0.000000;0.923880;0.382683;, - -0.049950;0.923880;0.379410;, - -0.099046;0.923880;0.369644;, - -0.146447;0.923880;0.353553;, - -0.221144;0.896873;0.383033;, - -0.269248;0.896873;0.350891;, - -0.353553;0.866025;0.353553;, - 0.000000;0.946930;0.321439;, - -0.041956;0.946930;0.318689;, - -0.083195;0.946930;0.310487;, - -0.123010;0.946930;0.296971;, - -0.191342;0.923880;0.331414;, - -0.232963;0.923880;0.303603;, - -0.312745;0.896873;0.312745;, - 0.000000;0.965926;0.258819;, - -0.033783;0.965926;0.256605;, - -0.066987;0.965926;0.250000;, - -0.099046;0.965926;0.239118;, - -0.160720;0.946930;0.278375;, - -0.195680;0.946930;0.255015;, - -0.270598;0.923880;0.270598;, - 0.000000;0.980785;0.195090;, - -0.025464;0.980785;0.193421;, - -0.050493;0.980785;0.188443;, - -0.074658;0.980785;0.180240;, - -0.129410;0.965926;0.224144;, - -0.157559;0.965926;0.205335;, - -0.227292;0.946930;0.227292;, - 0.000000;0.991445;0.130526;, - -0.017037;0.991445;0.129410;, - -0.033783;0.991445;0.126079;, - -0.049950;0.991445;0.120590;, - -0.097545;0.980785;0.168953;, - -0.118763;0.980785;0.154776;, - -0.183013;0.965926;0.183013;, - 0.000000;0.997859;0.065403;, - -0.008537;0.997859;0.064844;, - -0.016928;0.997859;0.063175;, - -0.025029;0.997859;0.060425;, - -0.065263;0.991445;0.113039;, - -0.079459;0.991445;0.103553;, - -0.137950;0.980785;0.137950;, - -0.032702;0.997859;0.056641;, - -0.039815;0.997859;0.051888;, - -0.092296;0.991445;0.092296;, - -0.154776;0.980785;0.118763;, - -0.205335;0.965926;0.157559;, - -0.046247;0.997859;0.046247;, - -0.103553;0.991445;0.079459;, - -0.168953;0.980785;0.097545;, - -0.224144;0.965926;0.129410;, - -0.278375;0.946930;0.160720;, - -0.255015;0.946930;0.195680;, - -0.051888;0.997859;0.039815;, - -0.113039;0.991445;0.065263;, - -0.180240;0.980785;0.074658;, - -0.239118;0.965926;0.099046;, - -0.296971;0.946930;0.123010;, - -0.056641;0.997859;0.032702;, - -0.120590;0.991445;0.049950;, - -0.188443;0.980785;0.050493;, - -0.250000;0.965926;0.066987;, - -0.310487;0.946930;0.083195;, - -0.060425;0.997859;0.025029;, - -0.126079;0.991445;0.033783;, - -0.193421;0.980785;0.025464;, - -0.256605;0.965926;0.033783;, - -0.318689;0.946930;0.041956;, - -0.063175;0.997859;0.016928;, - -0.129410;0.991445;0.017037;, - -0.195090;0.980785;0.000000;, - -0.258819;0.965926;0.000000;, - -0.321439;0.946930;0.000000;, - -0.064844;0.997859;0.008537;, - -0.130526;0.991445;0.000000;, - -0.193421;0.980785;-0.025464;, - -0.256605;0.965926;-0.033783;, - -0.318689;0.946930;-0.041956;, - -0.065403;0.997859;0.000000;, - -0.129410;0.991445;-0.017037;, - -0.188443;0.980785;-0.050493;, - -0.250000;0.965926;-0.066987;, - -0.310487;0.946930;-0.083195;, - -0.064844;0.997859;-0.008537;, - -0.126079;0.991445;-0.033783;, - -0.180240;0.980785;-0.074658;, - -0.239118;0.965926;-0.099046;, - -0.296971;0.946930;-0.123010;, - -0.063175;0.997859;-0.016928;, - -0.120590;0.991445;-0.049950;, - -0.168953;0.980785;-0.097545;, - -0.224144;0.965926;-0.129410;, - -0.278375;0.946930;-0.160720;, - -0.060425;0.997859;-0.025029;, - -0.113039;0.991445;-0.065263;, - -0.154776;0.980785;-0.118763;, - -0.205335;0.965926;-0.157559;, - -0.255015;0.946930;-0.195680;, - -0.056641;0.997859;-0.032702;, - -0.103553;0.991445;-0.079459;, - -0.137950;0.980785;-0.137950;, - -0.183013;0.965926;-0.183013;, - -0.227292;0.946930;-0.227292;, - -0.051888;0.997859;-0.039815;, - -0.157559;0.965926;-0.205335;, - -0.195680;0.946930;-0.255015;, - -0.160720;0.946930;-0.278375;, - -0.191342;0.923880;-0.331414;, - -0.232963;0.923880;-0.303603;, - -0.270598;0.923880;-0.270598;, - -0.123010;0.946930;-0.296971;, - -0.146447;0.923880;-0.353553;, - -0.169257;0.896873;-0.408621;, - -0.221144;0.896873;-0.383033;, - -0.269248;0.896873;-0.350891;, - -0.099046;0.923880;-0.369644;, - -0.114473;0.896873;-0.427218;, - -0.129410;0.866025;-0.482963;, - -0.191342;0.866025;-0.461940;, - -0.250000;0.866025;-0.433013;, - -0.049950;0.923880;-0.379410;, - -0.057730;0.896873;-0.438505;, - -0.065263;0.866025;-0.495722;, - -0.072516;0.831470;-0.550817;, - -0.143792;0.831470;-0.536640;, - -0.212608;0.831470;-0.513280;, - 0.000000;0.896873;-0.442289;, - 0.000000;0.866025;-0.500000;, - 0.000000;0.831470;-0.555570;, - 0.000000;0.793353;-0.608761;, - -0.079459;0.793353;-0.603553;, - -0.157559;0.793353;-0.588018;, - 0.057730;0.896873;-0.438505;, - 0.065263;0.866025;-0.495722;, - 0.072516;0.831470;-0.550817;, - 0.079459;0.793353;-0.603553;, - 0.000000;0.751840;-0.659346;, - -0.086062;0.751840;-0.653705;, - 0.114473;0.896873;-0.427218;, - 0.129410;0.866025;-0.482963;, - 0.143792;0.831470;-0.536640;, - 0.157559;0.793353;-0.588018;, - 0.086062;0.751840;-0.653705;, - 0.000000;0.707107;-0.707107;, - 0.169257;0.896873;-0.408621;, - 0.191342;0.866025;-0.461940;, - 0.212608;0.831470;-0.513280;, - 0.232963;0.793353;-0.562422;, - 0.170651;0.751840;-0.636879;, - 0.092296;0.707107;-0.701057;, - 0.221144;0.896873;-0.383033;, - 0.250000;0.866025;-0.433013;, - 0.277785;0.831470;-0.481138;, - 0.304381;0.793353;-0.527203;, - 0.252321;0.751840;-0.609156;, - 0.183013;0.707107;-0.683013;, - 0.269248;0.896873;-0.350891;, - 0.304381;0.866025;-0.396677;, - 0.338210;0.831470;-0.440764;, - 0.370590;0.793353;-0.482963;, - 0.329673;0.751840;-0.571010;, - 0.270598;0.707107;-0.653282;, - 0.312745;0.896873;-0.312745;, - 0.353553;0.866025;-0.353553;, - 0.392847;0.831470;-0.392847;, - 0.430459;0.793353;-0.430459;, - 0.401384;0.751840;-0.523094;, - 0.353553;0.707107;-0.612372;, - 0.350891;0.896873;-0.269248;, - 0.396677;0.866025;-0.304381;, - 0.440764;0.831470;-0.338210;, - 0.482963;0.793353;-0.370590;, - 0.466228;0.751840;-0.466228;, - 0.430459;0.707107;-0.560986;, - 0.383033;0.896873;-0.221144;, - 0.433013;0.866025;-0.250000;, - 0.481138;0.831470;-0.277785;, - 0.527203;0.793353;-0.304381;, - 0.523094;0.751840;-0.401384;, - 0.500000;0.707107;-0.500000;, - 0.408621;0.896873;-0.169257;, - 0.461940;0.866025;-0.191342;, - 0.513280;0.831470;-0.212608;, - 0.562422;0.793353;-0.232963;, - 0.571010;0.751840;-0.329673;, - 0.560986;0.707107;-0.430459;, - 0.427218;0.896873;-0.114473;, - 0.482963;0.866025;-0.129410;, - 0.536640;0.831470;-0.143792;, - 0.588018;0.793353;-0.157559;, - 0.609156;0.751840;-0.252321;, - 0.612372;0.707107;-0.353553;, - 0.438505;0.896873;-0.057730;, - 0.495722;0.866025;-0.065263;, - 0.550817;0.831470;-0.072516;, - 0.603553;0.793353;-0.079459;, - 0.636879;0.751840;-0.170651;, - 0.653282;0.707107;-0.270598;, - 0.442289;0.896873;0.000000;, - 0.500000;0.866025;0.000000;, - 0.555570;0.831470;0.000000;, - 0.608761;0.793353;0.000000;, - 0.653705;0.751840;-0.086062;, - 0.683013;0.707107;-0.183013;, - 0.438505;0.896873;0.057730;, - 0.495722;0.866025;0.065263;, - 0.550817;0.831470;0.072516;, - 0.603553;0.793353;0.079459;, - 0.659346;0.751840;0.000000;, - 0.701057;0.707107;-0.092296;, - 0.427218;0.896873;0.114473;, - 0.482963;0.866025;0.129410;, - 0.536640;0.831470;0.143792;, - 0.588018;0.793353;0.157559;, - 0.653705;0.751840;0.086062;, - 0.707107;0.707107;0.000000;, - 0.408621;0.896873;0.169257;, - 0.461940;0.866025;0.191342;, - 0.513280;0.831470;0.212608;, - 0.562422;0.793353;0.232963;, - 0.636879;0.751840;0.170651;, - 0.701057;0.707107;0.092296;, - 0.383033;0.896873;0.221144;, - 0.433013;0.866025;0.250000;, - 0.481138;0.831470;0.277785;, - 0.527203;0.793353;0.304381;, - 0.609156;0.751840;0.252321;, - 0.683013;0.707107;0.183013;, - 0.350891;0.896873;0.269248;, - 0.396677;0.866025;0.304381;, - 0.440764;0.831470;0.338210;, - 0.482963;0.793353;0.370590;, - 0.571010;0.751840;0.329673;, - 0.653282;0.707107;0.270598;, - 0.312745;0.896873;0.312745;, - 0.353553;0.866025;0.353553;, - 0.392847;0.831470;0.392847;, - 0.430459;0.793353;0.430459;, - 0.523094;0.751840;0.401384;, - 0.612372;0.707107;0.353553;, - 0.466228;0.751840;0.466228;, - 0.560986;0.707107;0.430459;, - 0.651112;0.659346;0.375920;, - 0.694609;0.659346;0.287717;, - 0.726222;0.659346;0.194590;, - 0.500000;0.707107;0.500000;, - 0.596475;0.659346;0.457691;, - 0.687064;0.608761;0.396677;, - 0.732963;0.608761;0.303603;, - 0.766320;0.608761;0.205335;, - 0.531631;0.659346;0.531631;, - 0.629410;0.608761;0.482963;, - 0.720074;0.555570;0.415735;, - 0.768178;0.555570;0.318190;, - 0.803138;0.555570;0.215200;, - 0.560986;0.608761;0.560986;, - 0.659649;0.555570;0.506167;, - 0.750000;0.500000;0.433013;, - 0.800103;0.500000;0.331414;, - 0.836516;0.500000;0.224144;, - 0.587938;0.555570;0.587938;, - 0.687064;0.500000;0.527203;, - 0.776715;0.442289;0.448436;, - 0.828602;0.442289;0.343218;, - 0.866313;0.442289;0.232128;, - 0.612372;0.500000;0.612372;, - 0.711537;0.442289;0.545982;, - 0.800103;0.382683;0.461940;, - 0.853553;0.382683;0.353553;, - 0.892399;0.382683;0.239118;, - 0.634185;0.442289;0.634185;, - 0.732963;0.382683;0.562422;, - 0.820066;0.321439;0.473465;, - 0.874849;0.321439;0.362374;, - 0.914664;0.321439;0.245084;, - 0.653282;0.382683;0.653282;, - 0.751250;0.321439;0.576455;, - 0.836516;0.258819;0.482963;, - 0.892399;0.258819;0.369644;, - 0.933013;0.258819;0.250000;, - 0.669581;0.321439;0.669581;, - 0.766320;0.258819;0.588018;, - 0.849385;0.195090;0.490393;, - 0.906127;0.195090;0.375330;, - 0.947366;0.195090;0.253846;, - 0.683013;0.258819;0.683013;, - 0.778109;0.195090;0.597064;, - 0.858616;0.130526;0.495722;, - 0.915976;0.130526;0.379410;, - 0.957662;0.130526;0.256605;, - 0.693520;0.195090;0.693520;, - 0.786566;0.130526;0.603553;, - 0.864171;0.065403;0.498929;, - 0.921901;0.065403;0.381864;, - 0.963858;0.065403;0.258265;, - 0.701057;0.130526;0.701057;, - 0.791655;0.065403;0.607458;, - 0.866025;0.000000;0.500000;, - 0.923880;0.000000;0.382683;, - 0.965926;0.000000;0.258819;, - 0.705593;0.065403;0.705593;, - 0.793353;0.000000;0.608761;, - 0.864171;-0.065403;0.498929;, - 0.921901;-0.065403;0.381864;, - 0.963858;-0.065403;0.258265;, - 0.707107;0.000000;0.707107;, - 0.791655;-0.065403;0.607458;, - 0.858616;-0.130526;0.495722;, - 0.915976;-0.130526;0.379410;, - 0.957662;-0.130526;0.256605;, - 0.705593;-0.065403;0.705593;, - 0.786566;-0.130526;0.603553;, - 0.849385;-0.195090;0.490393;, - 0.906127;-0.195090;0.375330;, - 0.947366;-0.195090;0.253846;, - 0.701057;-0.130526;0.701057;, - 0.778109;-0.195090;0.597064;, - 0.836516;-0.258819;0.482963;, - 0.892399;-0.258819;0.369644;, - 0.933013;-0.258819;0.250000;, - 0.693520;-0.195090;0.693520;, - 0.766320;-0.258819;0.588018;, - 0.820066;-0.321439;0.473465;, - 0.874849;-0.321439;0.362374;, - 0.914664;-0.321439;0.245084;, - 0.683013;-0.258819;0.683013;, - 0.751250;-0.321439;0.576455;, - 0.800103;-0.382683;0.461940;, - 0.853553;-0.382683;0.353553;, - 0.892399;-0.382683;0.239118;, - 0.669581;-0.321439;0.669581;, - 0.732963;-0.382683;0.562422;, - 0.776715;-0.442289;0.448436;, - 0.828602;-0.442289;0.343218;, - 0.866313;-0.442289;0.232128;, - 0.653282;-0.382683;0.653282;, - 0.711537;-0.442289;0.545982;, - 0.750000;-0.500000;0.433013;, - 0.800103;-0.500000;0.331414;, - 0.836516;-0.500000;0.224144;, - 0.634185;-0.442289;0.634185;, - 0.687064;-0.500000;0.527203;, - 0.720074;-0.555570;0.415735;, - 0.768178;-0.555570;0.318190;, - 0.803138;-0.555570;0.215200;, - 0.612372;-0.500000;0.612372;, - 0.659649;-0.555570;0.506167;, - 0.687064;-0.608761;0.396677;, - 0.732963;-0.608761;0.303603;, - 0.766320;-0.608761;0.205335;, - 0.587938;-0.555570;0.587938;, - 0.629410;-0.608761;0.482963;, - 0.651112;-0.659346;0.375920;, - 0.694609;-0.659346;0.287717;, - 0.726222;-0.659346;0.194590;, - 0.560986;-0.608761;0.560986;, - 0.596475;-0.659346;0.457691;, - 0.612372;-0.707107;0.353553;, - 0.653282;-0.707107;0.270598;, - 0.683013;-0.707107;0.183013;, - 0.531631;-0.659346;0.531631;, - 0.560986;-0.707107;0.430459;, - 0.571010;-0.751840;0.329673;, - 0.609156;-0.751840;0.252321;, - 0.636879;-0.751840;0.170651;, - 0.500000;-0.707107;0.500000;, - 0.523094;-0.751840;0.401384;, - 0.527203;-0.793353;0.304381;, - 0.562422;-0.793353;0.232963;, - 0.588018;-0.793353;0.157559;, - 0.466228;-0.751840;0.466228;, - 0.482963;-0.793353;0.370590;, - 0.481138;-0.831470;0.277785;, - 0.513280;-0.831470;0.212608;, - 0.536640;-0.831470;0.143792;, - 0.430459;-0.793353;0.430459;, - 0.440764;-0.831470;0.338210;, - 0.433013;-0.866025;0.250000;, - 0.461940;-0.866025;0.191342;, - 0.482963;-0.866025;0.129410;, - 0.392847;-0.831470;0.392847;, - 0.396677;-0.866025;0.304381;, - 0.383033;-0.896873;0.221144;, - 0.408621;-0.896873;0.169257;, - 0.427218;-0.896873;0.114473;, - 0.353553;-0.866025;0.353553;, - 0.350891;-0.896873;0.269248;, - 0.331414;-0.923880;0.191342;, - 0.353553;-0.923880;0.146447;, - 0.369644;-0.923880;0.099046;, - 0.312745;-0.896873;0.312745;, - 0.303603;-0.923880;0.232963;, - 0.270598;-0.923880;0.270598;, - 0.379410;-0.923880;0.049950;, - 0.438505;-0.896873;0.057730;, - 0.495722;-0.866025;0.065263;, - 0.382683;-0.923880;0.000000;, - 0.442289;-0.896873;0.000000;, - 0.500000;-0.866025;0.000000;, - 0.550817;-0.831470;0.072516;, - 0.603553;-0.793353;0.079459;, - 0.379410;-0.923880;-0.049950;, - 0.438505;-0.896873;-0.057730;, - 0.495722;-0.866025;-0.065263;, - 0.555570;-0.831470;0.000000;, - 0.608761;-0.793353;0.000000;, - 0.653705;-0.751840;0.086062;, - 0.369644;-0.923880;-0.099046;, - 0.427218;-0.896873;-0.114473;, - 0.482963;-0.866025;-0.129410;, - 0.550817;-0.831470;-0.072516;, - 0.603553;-0.793353;-0.079459;, - 0.659346;-0.751840;0.000000;, - 0.353553;-0.923880;-0.146447;, - 0.408621;-0.896873;-0.169257;, - 0.461940;-0.866025;-0.191342;, - 0.536640;-0.831470;-0.143792;, - 0.588018;-0.793353;-0.157559;, - 0.653705;-0.751840;-0.086062;, - 0.331414;-0.923880;-0.191342;, - 0.383033;-0.896873;-0.221144;, - 0.433013;-0.866025;-0.250000;, - 0.513280;-0.831470;-0.212608;, - 0.562422;-0.793353;-0.232963;, - 0.636879;-0.751840;-0.170651;, - 0.303603;-0.923880;-0.232963;, - 0.350891;-0.896873;-0.269248;, - 0.396677;-0.866025;-0.304381;, - 0.481138;-0.831470;-0.277785;, - 0.527203;-0.793353;-0.304381;, - 0.609156;-0.751840;-0.252321;, - 0.270598;-0.923880;-0.270598;, - 0.312745;-0.896873;-0.312745;, - 0.353553;-0.866025;-0.353553;, - 0.440764;-0.831470;-0.338210;, - 0.482963;-0.793353;-0.370590;, - 0.571010;-0.751840;-0.329673;, - 0.232963;-0.923880;-0.303603;, - 0.269248;-0.896873;-0.350891;, - 0.304381;-0.866025;-0.396677;, - 0.392847;-0.831470;-0.392847;, - 0.430459;-0.793353;-0.430459;, - 0.523094;-0.751840;-0.401384;, - 0.221144;-0.896873;-0.383033;, - 0.250000;-0.866025;-0.433013;, - 0.338210;-0.831470;-0.440764;, - 0.370590;-0.793353;-0.482963;, - 0.466228;-0.751840;-0.466228;, - 0.169257;-0.896873;-0.408621;, - 0.191342;-0.866025;-0.461940;, - 0.277785;-0.831470;-0.481138;, - 0.304381;-0.793353;-0.527203;, - 0.401384;-0.751840;-0.523094;, - 0.114473;-0.896873;-0.427218;, - 0.129410;-0.866025;-0.482963;, - 0.212608;-0.831470;-0.513280;, - 0.232963;-0.793353;-0.562422;, - 0.329673;-0.751840;-0.571010;, - 0.049950;-0.923880;-0.379410;, - 0.057730;-0.896873;-0.438505;, - 0.065263;-0.866025;-0.495722;, - 0.143792;-0.831470;-0.536640;, - 0.157559;-0.793353;-0.588018;, - 0.252321;-0.751840;-0.609156;, - 0.000000;-0.946930;-0.321439;, - 0.000000;-0.923880;-0.382683;, - 0.000000;-0.896873;-0.442289;, - 0.000000;-0.866025;-0.500000;, - 0.072516;-0.831470;-0.550817;, - -0.049950;-0.923880;-0.379410;, - -0.057730;-0.896873;-0.438505;, - -0.065263;-0.866025;-0.495722;, - -0.072516;-0.831470;-0.550817;, - 0.000000;-0.831470;-0.555570;, - 0.079459;-0.793353;-0.603553;, - -0.099046;-0.923880;-0.369644;, - -0.114473;-0.896873;-0.427218;, - -0.129410;-0.866025;-0.482963;, - -0.143792;-0.831470;-0.536640;, - -0.157559;-0.793353;-0.588018;, - -0.079459;-0.793353;-0.603553;, - -0.146447;-0.923880;-0.353553;, - -0.169257;-0.896873;-0.408621;, - -0.191342;-0.866025;-0.461940;, - -0.212608;-0.831470;-0.513280;, - -0.232963;-0.793353;-0.562422;, - -0.191342;-0.923880;-0.331414;, - -0.221144;-0.896873;-0.383033;, - -0.250000;-0.866025;-0.433013;, - -0.277785;-0.831470;-0.481138;, - -0.304381;-0.793353;-0.527203;, - -0.232963;-0.923880;-0.303603;, - -0.269248;-0.896873;-0.350891;, - -0.304381;-0.866025;-0.396677;, - -0.338210;-0.831470;-0.440764;, - -0.370590;-0.793353;-0.482963;, - -0.270598;-0.923880;-0.270598;, - -0.312745;-0.896873;-0.312745;, - -0.353553;-0.866025;-0.353553;, - -0.392847;-0.831470;-0.392847;, - -0.430459;-0.793353;-0.430459;, - -0.303603;-0.923880;-0.232963;, - -0.350891;-0.896873;-0.269248;, - -0.396677;-0.866025;-0.304381;, - -0.440764;-0.831470;-0.338210;, - -0.482963;-0.793353;-0.370590;, - -0.331414;-0.923880;-0.191342;, - -0.383033;-0.896873;-0.221144;, - -0.433013;-0.866025;-0.250000;, - -0.481138;-0.831470;-0.277785;, - -0.527203;-0.793353;-0.304381;, - -0.353553;-0.923880;-0.146447;, - -0.408621;-0.896873;-0.169257;, - -0.461940;-0.866025;-0.191342;, - -0.513280;-0.831470;-0.212608;, - -0.562422;-0.793353;-0.232963;, - -0.369644;-0.923880;-0.099046;, - -0.427218;-0.896873;-0.114473;, - -0.482963;-0.866025;-0.129410;, - -0.536640;-0.831470;-0.143792;, - -0.588018;-0.793353;-0.157559;, - -0.379410;-0.923880;-0.049950;, - -0.438505;-0.896873;-0.057730;, - -0.495722;-0.866025;-0.065263;, - -0.550817;-0.831470;-0.072516;, - -0.603553;-0.793353;-0.079459;, - -0.382683;-0.923880;0.000000;, - -0.442289;-0.896873;0.000000;, - -0.500000;-0.866025;0.000000;, - -0.555570;-0.831470;0.000000;, - -0.608761;-0.793353;0.000000;, - -0.379410;-0.923880;0.049950;, - -0.438505;-0.896873;0.057730;, - -0.495722;-0.866025;0.065263;, - -0.550817;-0.831470;0.072516;, - -0.603553;-0.793353;0.079459;, - -0.369644;-0.923880;0.099046;, - -0.427218;-0.896873;0.114473;, - -0.482963;-0.866025;0.129410;, - -0.536640;-0.831470;0.143792;, - -0.588018;-0.793353;0.157559;, - -0.353553;-0.923880;0.146447;, - -0.408621;-0.896873;0.169257;, - -0.461940;-0.866025;0.191342;, - -0.513280;-0.831470;0.212608;, - -0.562422;-0.793353;0.232963;, - -0.331414;-0.923880;0.191342;, - -0.383033;-0.896873;0.221144;, - -0.433013;-0.866025;0.250000;, - -0.481138;-0.831470;0.277785;, - -0.527203;-0.793353;0.304381;, - -0.303603;-0.923880;0.232963;, - -0.350891;-0.896873;0.269248;, - -0.396677;-0.866025;0.304381;, - -0.440764;-0.831470;0.338210;, - -0.482963;-0.793353;0.370590;, - -0.523094;-0.751840;0.401384;, - -0.571010;-0.751840;0.329673;, - -0.609156;-0.751840;0.252321;, - -0.560986;-0.707107;0.430459;, - -0.612372;-0.707107;0.353553;, - -0.653282;-0.707107;0.270598;, - -0.636879;-0.751840;0.170651;, - -0.653705;-0.751840;0.086062;, - -0.596475;-0.659346;0.457691;, - -0.651112;-0.659346;0.375920;, - -0.694609;-0.659346;0.287717;, - -0.683013;-0.707107;0.183013;, - -0.701057;-0.707107;0.092296;, - -0.659346;-0.751840;0.000000;, - -0.629410;-0.608761;0.482963;, - -0.687064;-0.608761;0.396677;, - -0.732963;-0.608761;0.303603;, - -0.726222;-0.659346;0.194590;, - -0.745408;-0.659346;0.098135;, - -0.707107;-0.707107;0.000000;, - -0.659649;-0.555570;0.506167;, - -0.720074;-0.555570;0.415735;, - -0.768178;-0.555570;0.318190;, - -0.766320;-0.608761;0.205335;, - -0.786566;-0.608761;0.103553;, - -0.751840;-0.659346;0.000000;, - -0.687064;-0.500000;0.527203;, - -0.750000;-0.500000;0.433013;, - -0.800103;-0.500000;0.331414;, - -0.803138;-0.555570;0.215200;, - -0.824356;-0.555570;0.108529;, - -0.793353;-0.608761;0.000000;, - -0.711537;-0.442289;0.545982;, - -0.776715;-0.442289;0.448436;, - -0.828602;-0.442289;0.343218;, - -0.836516;-0.500000;0.224144;, - -0.858616;-0.500000;0.113039;, - -0.831470;-0.555570;0.000000;, - -0.732963;-0.382683;0.562422;, - -0.800103;-0.382683;0.461940;, - -0.853553;-0.382683;0.353553;, - -0.866313;-0.442289;0.232128;, - -0.889200;-0.442289;0.117065;, - -0.866025;-0.500000;0.000000;, - -0.751250;-0.321439;0.576455;, - -0.820066;-0.321439;0.473465;, - -0.874849;-0.321439;0.362374;, - -0.892399;-0.382683;0.239118;, - -0.915976;-0.382683;0.120590;, - -0.896873;-0.442289;0.000000;, - -0.766320;-0.258819;0.588018;, - -0.836516;-0.258819;0.482963;, - -0.892399;-0.258819;0.369644;, - -0.914664;-0.321439;0.245084;, - -0.938829;-0.321439;0.123599;, - -0.923880;-0.382683;0.000000;, - -0.778109;-0.195090;0.597064;, - -0.849385;-0.195090;0.490393;, - -0.906127;-0.195090;0.375330;, - -0.933013;-0.258819;0.250000;, - -0.957662;-0.258819;0.126079;, - -0.946930;-0.321439;0.000000;, - -0.786566;-0.130526;0.603553;, - -0.858616;-0.130526;0.495722;, - -0.915976;-0.130526;0.379410;, - -0.947366;-0.195090;0.253846;, - -0.972395;-0.195090;0.128018;, - -0.965926;-0.258819;0.000000;, - -0.791655;-0.065403;0.607458;, - -0.864171;-0.065403;0.498929;, - -0.921901;-0.065403;0.381864;, - -0.957662;-0.130526;0.256605;, - -0.982963;-0.130526;0.129410;, - -0.980785;-0.195090;0.000000;, - -0.793353;0.000000;0.608761;, - -0.866025;0.000000;0.500000;, - -0.923880;0.000000;0.382683;, - -0.963858;-0.065403;0.258265;, - -0.989322;-0.065403;0.130247;, - -0.991445;-0.130526;0.000000;, - -0.791655;0.065403;0.607458;, - -0.864171;0.065403;0.498929;, - -0.921901;0.065403;0.381864;, - -0.965926;0.000000;0.258819;, - -0.991445;0.000000;0.130526;, - -0.997859;-0.065403;0.000000;, - -0.786566;0.130526;0.603553;, - -0.858616;0.130526;0.495722;, - -0.915976;0.130526;0.379410;, - -0.963858;0.065403;0.258265;, - -0.989322;0.065403;0.130247;, - -1.000000;0.000000;0.000000;, - -0.778109;0.195090;0.597064;, - -0.849385;0.195090;0.490393;, - -0.906127;0.195090;0.375330;, - -0.957662;0.130526;0.256605;, - -0.982963;0.130526;0.129410;, - -0.997859;0.065403;0.000000;, - -0.766320;0.258819;0.588018;, - -0.836516;0.258819;0.482963;, - -0.892399;0.258819;0.369644;, - -0.947366;0.195090;0.253846;, - -0.972395;0.195090;0.128018;, - -0.991445;0.130526;0.000000;, - -0.751250;0.321439;0.576455;, - -0.820066;0.321439;0.473465;, - -0.874849;0.321439;0.362374;, - -0.933013;0.258819;0.250000;, - -0.957662;0.258819;0.126079;, - -0.980785;0.195090;0.000000;, - -0.732963;0.382683;0.562422;, - -0.800103;0.382683;0.461940;, - -0.853553;0.382683;0.353553;, - -0.914664;0.321439;0.245084;, - -0.938829;0.321439;0.123599;, - -0.965926;0.258819;0.000000;, - -0.711537;0.442289;0.545982;, - -0.776715;0.442289;0.448436;, - -0.828602;0.442289;0.343218;, - -0.892399;0.382683;0.239118;, - -0.915976;0.382683;0.120590;, - -0.946930;0.321439;0.000000;, - -0.687064;0.500000;0.527203;, - -0.750000;0.500000;0.433013;, - -0.800103;0.500000;0.331414;, - -0.866313;0.442289;0.232128;, - -0.889200;0.442289;0.117065;, - -0.923880;0.382683;0.000000;, - -0.659649;0.555570;0.506167;, - -0.720074;0.555570;0.415735;, - -0.768178;0.555570;0.318190;, - -0.836516;0.500000;0.224144;, - -0.858616;0.500000;0.113039;, - -0.896873;0.442289;0.000000;, - -0.629410;0.608761;0.482963;, - -0.687064;0.608761;0.396677;, - -0.732963;0.608761;0.303603;, - -0.803138;0.555570;0.215200;, - -0.824356;0.555570;0.108529;, - -0.866025;0.500000;0.000000;, - -0.596475;0.659346;0.457691;, - -0.651112;0.659346;0.375920;, - -0.694609;0.659346;0.287717;, - -0.766320;0.608761;0.205335;, - -0.786566;0.608761;0.103553;, - -0.831470;0.555570;0.000000;, - -0.560986;0.707107;0.430459;, - -0.612372;0.707107;0.353553;, - -0.653282;0.707107;0.270598;, - -0.726222;0.659346;0.194590;, - -0.745408;0.659346;0.098135;, - -0.793353;0.608761;0.000000;, - -0.523094;0.751840;0.401384;, - -0.571010;0.751840;0.329673;, - -0.609156;0.751840;0.252321;, - -0.683013;0.707107;0.183013;, - -0.701057;0.707107;0.092296;, - -0.751840;0.659346;0.000000;, - -0.482963;0.793353;0.370590;, - -0.527203;0.793353;0.304381;, - -0.562422;0.793353;0.232963;, - -0.636879;0.751840;0.170651;, - -0.653705;0.751840;0.086062;, - -0.707107;0.707107;0.000000;, - -0.440764;0.831470;0.338210;, - -0.481138;0.831470;0.277785;, - -0.513280;0.831470;0.212608;, - -0.588018;0.793353;0.157559;, - -0.603553;0.793353;0.079459;, - -0.659346;0.751840;0.000000;, - -0.396677;0.866025;0.304381;, - -0.433013;0.866025;0.250000;, - -0.461940;0.866025;0.191342;, - -0.536640;0.831470;0.143792;, - -0.550817;0.831470;0.072516;, - -0.608761;0.793353;0.000000;, - -0.350891;0.896873;0.269248;, - -0.383033;0.896873;0.221144;, - -0.408621;0.896873;0.169257;, - -0.482963;0.866025;0.129410;, - -0.495722;0.866025;0.065263;, - -0.555570;0.831470;0.000000;, - -0.303603;0.923880;0.232963;, - -0.331414;0.923880;0.191342;, - -0.353553;0.923880;0.146447;, - -0.427218;0.896873;0.114473;, - -0.438505;0.896873;0.057730;, - -0.500000;0.866025;0.000000;, - -0.369644;0.923880;0.099046;, - -0.379410;0.923880;0.049950;, - -0.442289;0.896873;0.000000;, - -0.495722;0.866025;-0.065263;, - -0.550817;0.831470;-0.072516;, - -0.382683;0.923880;0.000000;, - -0.438505;0.896873;-0.057730;, - -0.482963;0.866025;-0.129410;, - -0.536640;0.831470;-0.143792;, - -0.588018;0.793353;-0.157559;, - -0.603553;0.793353;-0.079459;, - -0.379410;0.923880;-0.049950;, - -0.427218;0.896873;-0.114473;, - -0.461940;0.866025;-0.191342;, - -0.513280;0.831470;-0.212608;, - -0.562422;0.793353;-0.232963;, - -0.369644;0.923880;-0.099046;, - -0.408621;0.896873;-0.169257;, - -0.433013;0.866025;-0.250000;, - -0.481138;0.831470;-0.277785;, - -0.527203;0.793353;-0.304381;, - -0.353553;0.923880;-0.146447;, - -0.383033;0.896873;-0.221144;, - -0.396677;0.866025;-0.304381;, - -0.440764;0.831470;-0.338210;, - -0.482963;0.793353;-0.370590;, - -0.331414;0.923880;-0.191342;, - -0.350891;0.896873;-0.269248;, - -0.353553;0.866025;-0.353553;, - -0.392847;0.831470;-0.392847;, - -0.430459;0.793353;-0.430459;, - -0.303603;0.923880;-0.232963;, - -0.312745;0.896873;-0.312745;, - -0.304381;0.866025;-0.396677;, - -0.338210;0.831470;-0.440764;, - -0.370590;0.793353;-0.482963;, - -0.277785;0.831470;-0.481138;, - -0.304381;0.793353;-0.527203;, - -0.329673;0.751840;-0.571010;, - -0.401384;0.751840;-0.523094;, - -0.466228;0.751840;-0.466228;, - -0.232963;0.793353;-0.562422;, - -0.252321;0.751840;-0.609156;, - -0.270598;0.707107;-0.653282;, - -0.353553;0.707107;-0.612372;, - -0.430459;0.707107;-0.560986;, - -0.170651;0.751840;-0.636879;, - -0.183013;0.707107;-0.683013;, - -0.194590;0.659346;-0.726222;, - -0.287717;0.659346;-0.694609;, - -0.375920;0.659346;-0.651112;, - -0.092296;0.707107;-0.701057;, - -0.098135;0.659346;-0.745408;, - -0.103553;0.608761;-0.786566;, - -0.205335;0.608761;-0.766320;, - -0.303603;0.608761;-0.732963;, - 0.000000;0.659346;-0.751840;, - 0.000000;0.608761;-0.793353;, - 0.000000;0.555570;-0.831470;, - -0.108529;0.555570;-0.824356;, - -0.215200;0.555570;-0.803138;, - 0.098135;0.659346;-0.745408;, - 0.103553;0.608761;-0.786566;, - 0.108529;0.555570;-0.824356;, - 0.000000;0.500000;-0.866025;, - -0.113039;0.500000;-0.858616;, - 0.194590;0.659346;-0.726222;, - 0.205335;0.608761;-0.766320;, - 0.215200;0.555570;-0.803138;, - 0.113039;0.500000;-0.858616;, - 0.000000;0.442289;-0.896873;, - 0.287717;0.659346;-0.694609;, - 0.303603;0.608761;-0.732963;, - 0.318190;0.555570;-0.768178;, - 0.224144;0.500000;-0.836516;, - 0.117065;0.442289;-0.889200;, - 0.375920;0.659346;-0.651112;, - 0.396677;0.608761;-0.687064;, - 0.415735;0.555570;-0.720074;, - 0.331414;0.500000;-0.800103;, - 0.232128;0.442289;-0.866313;, - 0.457691;0.659346;-0.596475;, - 0.482963;0.608761;-0.629410;, - 0.506167;0.555570;-0.659649;, - 0.433013;0.500000;-0.750000;, - 0.343218;0.442289;-0.828602;, - 0.531631;0.659346;-0.531631;, - 0.560986;0.608761;-0.560986;, - 0.587938;0.555570;-0.587938;, - 0.527203;0.500000;-0.687064;, - 0.448436;0.442289;-0.776715;, - 0.596475;0.659346;-0.457691;, - 0.629410;0.608761;-0.482963;, - 0.659649;0.555570;-0.506167;, - 0.612372;0.500000;-0.612372;, - 0.545982;0.442289;-0.711537;, - 0.651112;0.659346;-0.375920;, - 0.687064;0.608761;-0.396677;, - 0.720074;0.555570;-0.415735;, - 0.687064;0.500000;-0.527203;, - 0.634185;0.442289;-0.634185;, - 0.694609;0.659346;-0.287717;, - 0.732963;0.608761;-0.303603;, - 0.768178;0.555570;-0.318190;, - 0.750000;0.500000;-0.433013;, - 0.711537;0.442289;-0.545982;, - 0.726222;0.659346;-0.194590;, - 0.766320;0.608761;-0.205335;, - 0.803138;0.555570;-0.215200;, - 0.800103;0.500000;-0.331414;, - 0.776715;0.442289;-0.448436;, - 0.745408;0.659346;-0.098135;, - 0.786566;0.608761;-0.103553;, - 0.824356;0.555570;-0.108529;, - 0.836516;0.500000;-0.224144;, - 0.828602;0.442289;-0.343218;, - 0.751840;0.659346;0.000000;, - 0.793353;0.608761;0.000000;, - 0.831470;0.555570;0.000000;, - 0.858616;0.500000;-0.113039;, - 0.866313;0.442289;-0.232128;, - 0.745408;0.659346;0.098135;, - 0.786566;0.608761;0.103553;, - 0.824356;0.555570;0.108529;, - 0.866025;0.500000;0.000000;, - 0.889200;0.442289;-0.117065;, - 0.858616;0.500000;0.113039;, - 0.896873;0.442289;0.000000;, - 0.915976;0.382683;-0.120590;, - 0.892399;0.382683;-0.239118;, - 0.853553;0.382683;-0.353553;, - 0.889200;0.442289;0.117065;, - 0.923880;0.382683;0.000000;, - 0.938829;0.321439;-0.123599;, - 0.914664;0.321439;-0.245084;, - 0.874849;0.321439;-0.362374;, - 0.915976;0.382683;0.120590;, - 0.946930;0.321439;0.000000;, - 0.957662;0.258819;-0.126079;, - 0.933013;0.258819;-0.250000;, - 0.892399;0.258819;-0.369644;, - 0.938829;0.321439;0.123599;, - 0.965926;0.258819;0.000000;, - 0.972395;0.195090;-0.128018;, - 0.947366;0.195090;-0.253846;, - 0.906127;0.195090;-0.375330;, - 0.957662;0.258819;0.126079;, - 0.980785;0.195090;0.000000;, - 0.982963;0.130526;-0.129410;, - 0.957662;0.130526;-0.256605;, - 0.915976;0.130526;-0.379410;, - 0.972395;0.195090;0.128018;, - 0.991445;0.130526;0.000000;, - 0.989322;0.065403;-0.130247;, - 0.963858;0.065403;-0.258265;, - 0.921901;0.065403;-0.381864;, - 0.982963;0.130526;0.129410;, - 0.997859;0.065403;0.000000;, - 0.991445;0.000000;-0.130526;, - 0.965926;0.000000;-0.258819;, - 0.923880;0.000000;-0.382683;, - 0.989322;0.065403;0.130247;, - 1.000000;0.000000;0.000000;, - 0.989322;-0.065403;-0.130247;, - 0.963858;-0.065403;-0.258265;, - 0.921901;-0.065403;-0.381864;, - 0.991445;0.000000;0.130526;, - 0.997859;-0.065403;0.000000;, - 0.982963;-0.130526;-0.129410;, - 0.957662;-0.130526;-0.256605;, - 0.915976;-0.130526;-0.379410;, - 0.989322;-0.065403;0.130247;, - 0.991445;-0.130526;0.000000;, - 0.972395;-0.195090;-0.128018;, - 0.947366;-0.195090;-0.253846;, - 0.906127;-0.195090;-0.375330;, - 0.982963;-0.130526;0.129410;, - 0.980785;-0.195090;0.000000;, - 0.957662;-0.258819;-0.126079;, - 0.933013;-0.258819;-0.250000;, - 0.892399;-0.258819;-0.369644;, - 0.972395;-0.195090;0.128018;, - 0.965926;-0.258819;0.000000;, - 0.938829;-0.321439;-0.123599;, - 0.914664;-0.321439;-0.245084;, - 0.874849;-0.321439;-0.362374;, - 0.957662;-0.258819;0.126079;, - 0.946930;-0.321439;0.000000;, - 0.915976;-0.382683;-0.120590;, - 0.892399;-0.382683;-0.239118;, - 0.853553;-0.382683;-0.353553;, - 0.938829;-0.321439;0.123599;, - 0.923880;-0.382683;0.000000;, - 0.889200;-0.442289;-0.117065;, - 0.866313;-0.442289;-0.232128;, - 0.828602;-0.442289;-0.343218;, - 0.915976;-0.382683;0.120590;, - 0.896873;-0.442289;0.000000;, - 0.858616;-0.500000;-0.113039;, - 0.836516;-0.500000;-0.224144;, - 0.800103;-0.500000;-0.331414;, - 0.889200;-0.442289;0.117065;, - 0.866025;-0.500000;0.000000;, - 0.824356;-0.555570;-0.108529;, - 0.803138;-0.555570;-0.215200;, - 0.768178;-0.555570;-0.318190;, - 0.858616;-0.500000;0.113039;, - 0.831470;-0.555570;0.000000;, - 0.786566;-0.608761;-0.103553;, - 0.766320;-0.608761;-0.205335;, - 0.732963;-0.608761;-0.303603;, - 0.824356;-0.555570;0.108529;, - 0.793353;-0.608761;0.000000;, - 0.745408;-0.659346;-0.098135;, - 0.726222;-0.659346;-0.194590;, - 0.694609;-0.659346;-0.287717;, - 0.786566;-0.608761;0.103553;, - 0.751840;-0.659346;0.000000;, - 0.701057;-0.707107;-0.092296;, - 0.683013;-0.707107;-0.183013;, - 0.653282;-0.707107;-0.270598;, - 0.745408;-0.659346;0.098135;, - 0.707107;-0.707107;0.000000;, - 0.701057;-0.707107;0.092296;, - 0.612372;-0.707107;-0.353553;, - 0.651112;-0.659346;-0.375920;, - 0.687064;-0.608761;-0.396677;, - 0.560986;-0.707107;-0.430459;, - 0.596475;-0.659346;-0.457691;, - 0.629410;-0.608761;-0.482963;, - 0.720074;-0.555570;-0.415735;, - 0.750000;-0.500000;-0.433013;, - 0.500000;-0.707107;-0.500000;, - 0.531631;-0.659346;-0.531631;, - 0.560986;-0.608761;-0.560986;, - 0.659649;-0.555570;-0.506167;, - 0.687064;-0.500000;-0.527203;, - 0.776715;-0.442289;-0.448436;, - 0.430459;-0.707107;-0.560986;, - 0.457691;-0.659346;-0.596475;, - 0.482963;-0.608761;-0.629410;, - 0.587938;-0.555570;-0.587938;, - 0.612372;-0.500000;-0.612372;, - 0.711537;-0.442289;-0.545982;, - 0.353553;-0.707107;-0.612372;, - 0.375920;-0.659346;-0.651112;, - 0.396677;-0.608761;-0.687064;, - 0.506167;-0.555570;-0.659649;, - 0.527203;-0.500000;-0.687064;, - 0.634185;-0.442289;-0.634185;, - 0.270598;-0.707107;-0.653282;, - 0.287717;-0.659346;-0.694609;, - 0.303603;-0.608761;-0.732963;, - 0.415735;-0.555570;-0.720074;, - 0.433013;-0.500000;-0.750000;, - 0.545982;-0.442289;-0.711537;, - 0.170651;-0.751840;-0.636879;, - 0.183013;-0.707107;-0.683013;, - 0.194590;-0.659346;-0.726222;, - 0.205335;-0.608761;-0.766320;, - 0.318190;-0.555570;-0.768178;, - 0.086062;-0.751840;-0.653705;, - 0.092296;-0.707107;-0.701057;, - 0.098135;-0.659346;-0.745408;, - 0.103553;-0.608761;-0.786566;, - 0.215200;-0.555570;-0.803138;, - 0.331414;-0.500000;-0.800103;, - 0.000000;-0.793353;-0.608761;, - 0.000000;-0.751840;-0.659346;, - 0.000000;-0.707107;-0.707107;, - 0.000000;-0.659346;-0.751840;, - 0.000000;-0.608761;-0.793353;, - 0.108529;-0.555570;-0.824356;, - -0.086062;-0.751840;-0.653705;, - -0.092296;-0.707107;-0.701057;, - -0.098135;-0.659346;-0.745408;, - -0.103553;-0.608761;-0.786566;, - -0.108529;-0.555570;-0.824356;, - 0.000000;-0.555570;-0.831470;, - -0.170651;-0.751840;-0.636879;, - -0.183013;-0.707107;-0.683013;, - -0.194590;-0.659346;-0.726222;, - -0.205335;-0.608761;-0.766320;, - -0.215200;-0.555570;-0.803138;, - -0.252321;-0.751840;-0.609156;, - -0.270598;-0.707107;-0.653282;, - -0.287717;-0.659346;-0.694609;, - -0.303603;-0.608761;-0.732963;, - -0.318190;-0.555570;-0.768178;, - -0.329673;-0.751840;-0.571010;, - -0.353553;-0.707107;-0.612372;, - -0.375920;-0.659346;-0.651112;, - -0.396677;-0.608761;-0.687064;, - -0.415735;-0.555570;-0.720074;, - -0.401384;-0.751840;-0.523094;, - -0.430459;-0.707107;-0.560986;, - -0.457691;-0.659346;-0.596475;, - -0.482963;-0.608761;-0.629410;, - -0.506167;-0.555570;-0.659649;, - -0.466228;-0.751840;-0.466228;, - -0.500000;-0.707107;-0.500000;, - -0.531631;-0.659346;-0.531631;, - -0.560986;-0.608761;-0.560986;, - -0.587938;-0.555570;-0.587938;, - -0.523094;-0.751840;-0.401384;, - -0.560986;-0.707107;-0.430459;, - -0.596475;-0.659346;-0.457691;, - -0.629410;-0.608761;-0.482963;, - -0.659649;-0.555570;-0.506167;, - -0.571010;-0.751840;-0.329673;, - -0.612372;-0.707107;-0.353553;, - -0.651112;-0.659346;-0.375920;, - -0.687064;-0.608761;-0.396677;, - -0.720074;-0.555570;-0.415735;, - -0.609156;-0.751840;-0.252321;, - -0.653282;-0.707107;-0.270598;, - -0.694609;-0.659346;-0.287717;, - -0.732963;-0.608761;-0.303603;, - -0.768178;-0.555570;-0.318190;, - -0.636879;-0.751840;-0.170651;, - -0.683013;-0.707107;-0.183013;, - -0.726222;-0.659346;-0.194590;, - -0.766320;-0.608761;-0.205335;, - -0.803138;-0.555570;-0.215200;, - -0.653705;-0.751840;-0.086062;, - -0.701057;-0.707107;-0.092296;, - -0.745408;-0.659346;-0.098135;, - -0.786566;-0.608761;-0.103553;, - -0.824356;-0.555570;-0.108529;, - -0.858616;-0.500000;-0.113039;, - -0.836516;-0.500000;-0.224144;, - -0.800103;-0.500000;-0.331414;, - -0.889200;-0.442289;-0.117065;, - -0.866313;-0.442289;-0.232128;, - -0.828602;-0.442289;-0.343218;, - -0.750000;-0.500000;-0.433013;, - -0.687064;-0.500000;-0.527203;, - -0.915976;-0.382683;-0.120590;, - -0.892399;-0.382683;-0.239118;, - -0.853553;-0.382683;-0.353553;, - -0.776715;-0.442289;-0.448436;, - -0.711537;-0.442289;-0.545982;, - -0.612372;-0.500000;-0.612372;, - -0.938829;-0.321439;-0.123599;, - -0.914664;-0.321439;-0.245084;, - -0.874849;-0.321439;-0.362374;, - -0.800103;-0.382683;-0.461940;, - -0.732963;-0.382683;-0.562422;, - -0.634185;-0.442289;-0.634185;, - -0.957662;-0.258819;-0.126079;, - -0.933013;-0.258819;-0.250000;, - -0.892399;-0.258819;-0.369644;, - -0.820066;-0.321439;-0.473465;, - -0.751250;-0.321439;-0.576455;, - -0.653282;-0.382683;-0.653282;, - -0.972395;-0.195090;-0.128018;, - -0.947366;-0.195090;-0.253846;, - -0.906127;-0.195090;-0.375330;, - -0.836516;-0.258819;-0.482963;, - -0.766320;-0.258819;-0.588018;, - -0.669581;-0.321439;-0.669581;, - -0.982963;-0.130526;-0.129410;, - -0.957662;-0.130526;-0.256605;, - -0.915976;-0.130526;-0.379410;, - -0.849385;-0.195090;-0.490393;, - -0.778109;-0.195090;-0.597064;, - -0.683013;-0.258819;-0.683013;, - -0.989322;-0.065403;-0.130247;, - -0.963858;-0.065403;-0.258265;, - -0.921901;-0.065403;-0.381864;, - -0.858616;-0.130526;-0.495722;, - -0.786566;-0.130526;-0.603553;, - -0.693520;-0.195090;-0.693520;, - -0.991445;0.000000;-0.130526;, - -0.965926;0.000000;-0.258819;, - -0.923880;0.000000;-0.382683;, - -0.864171;-0.065403;-0.498929;, - -0.791655;-0.065403;-0.607458;, - -0.701057;-0.130526;-0.701057;, - -0.989322;0.065403;-0.130247;, - -0.963858;0.065403;-0.258265;, - -0.921901;0.065403;-0.381864;, - -0.866025;0.000000;-0.500000;, - -0.793353;0.000000;-0.608761;, - -0.705593;-0.065403;-0.705593;, - -0.982963;0.130526;-0.129410;, - -0.957662;0.130526;-0.256605;, - -0.915976;0.130526;-0.379410;, - -0.864171;0.065403;-0.498929;, - -0.791655;0.065403;-0.607458;, - -0.707107;0.000000;-0.707107;, - -0.972395;0.195090;-0.128018;, - -0.947366;0.195090;-0.253846;, - -0.906127;0.195090;-0.375330;, - -0.858616;0.130526;-0.495722;, - -0.786566;0.130526;-0.603553;, - -0.705593;0.065403;-0.705593;, - -0.957662;0.258819;-0.126079;, - -0.933013;0.258819;-0.250000;, - -0.892399;0.258819;-0.369644;, - -0.849385;0.195090;-0.490393;, - -0.778109;0.195090;-0.597064;, - -0.701057;0.130526;-0.701057;, - -0.938829;0.321439;-0.123599;, - -0.914664;0.321439;-0.245084;, - -0.874849;0.321439;-0.362374;, - -0.836516;0.258819;-0.482963;, - -0.766320;0.258819;-0.588018;, - -0.693520;0.195090;-0.693520;, - -0.915976;0.382683;-0.120590;, - -0.892399;0.382683;-0.239118;, - -0.853553;0.382683;-0.353553;, - -0.820066;0.321439;-0.473465;, - -0.751250;0.321439;-0.576455;, - -0.683013;0.258819;-0.683013;, - -0.889200;0.442289;-0.117065;, - -0.866313;0.442289;-0.232128;, - -0.828602;0.442289;-0.343218;, - -0.800103;0.382683;-0.461940;, - -0.732963;0.382683;-0.562422;, - -0.669581;0.321439;-0.669581;, - -0.858616;0.500000;-0.113039;, - -0.836516;0.500000;-0.224144;, - -0.800103;0.500000;-0.331414;, - -0.776715;0.442289;-0.448436;, - -0.711537;0.442289;-0.545982;, - -0.653282;0.382683;-0.653282;, - -0.824356;0.555570;-0.108529;, - -0.803138;0.555570;-0.215200;, - -0.768178;0.555570;-0.318190;, - -0.750000;0.500000;-0.433013;, - -0.687064;0.500000;-0.527203;, - -0.634185;0.442289;-0.634185;, - -0.786566;0.608761;-0.103553;, - -0.766320;0.608761;-0.205335;, - -0.732963;0.608761;-0.303603;, - -0.720074;0.555570;-0.415735;, - -0.659649;0.555570;-0.506167;, - -0.612372;0.500000;-0.612372;, - -0.745408;0.659346;-0.098135;, - -0.726222;0.659346;-0.194590;, - -0.694609;0.659346;-0.287717;, - -0.687064;0.608761;-0.396677;, - -0.629410;0.608761;-0.482963;, - -0.587938;0.555570;-0.587938;, - -0.701057;0.707107;-0.092296;, - -0.683013;0.707107;-0.183013;, - -0.653282;0.707107;-0.270598;, - -0.651112;0.659346;-0.375920;, - -0.596475;0.659346;-0.457691;, - -0.560986;0.608761;-0.560986;, - -0.653705;0.751840;-0.086062;, - -0.636879;0.751840;-0.170651;, - -0.609156;0.751840;-0.252321;, - -0.612372;0.707107;-0.353553;, - -0.560986;0.707107;-0.430459;, - -0.531631;0.659346;-0.531631;, - -0.571010;0.751840;-0.329673;, - -0.523094;0.751840;-0.401384;, - -0.500000;0.707107;-0.500000;, - -0.457691;0.659346;-0.596475;, - -0.482963;0.608761;-0.629410;, - -0.396677;0.608761;-0.687064;, - -0.415735;0.555570;-0.720074;, - -0.506167;0.555570;-0.659649;, - -0.527203;0.500000;-0.687064;, - -0.318190;0.555570;-0.768178;, - -0.331414;0.500000;-0.800103;, - -0.433013;0.500000;-0.750000;, - -0.448436;0.442289;-0.776715;, - -0.545982;0.442289;-0.711537;, - -0.224144;0.500000;-0.836516;, - -0.232128;0.442289;-0.866313;, - -0.343218;0.442289;-0.828602;, - -0.353553;0.382683;-0.853553;, - -0.461940;0.382683;-0.800103;, - -0.562422;0.382683;-0.732963;, - -0.117065;0.442289;-0.889200;, - -0.120590;0.382683;-0.915976;, - -0.239118;0.382683;-0.892399;, - -0.245084;0.321439;-0.914664;, - -0.362374;0.321439;-0.874849;, - -0.473465;0.321439;-0.820066;, - 0.000000;0.382683;-0.923880;, - 0.000000;0.321439;-0.946930;, - -0.123599;0.321439;-0.938829;, - -0.126079;0.258819;-0.957662;, - -0.250000;0.258819;-0.933013;, - -0.369644;0.258819;-0.892399;, - 0.120590;0.382683;-0.915976;, - 0.123599;0.321439;-0.938829;, - 0.000000;0.258819;-0.965926;, - 0.000000;0.195090;-0.980785;, - -0.128018;0.195090;-0.972395;, - -0.253846;0.195090;-0.947366;, - 0.239118;0.382683;-0.892399;, - 0.245084;0.321439;-0.914664;, - 0.126079;0.258819;-0.957662;, - 0.128018;0.195090;-0.972395;, - 0.000000;0.130526;-0.991445;, - -0.129410;0.130526;-0.982963;, - 0.353553;0.382683;-0.853553;, - 0.362374;0.321439;-0.874849;, - 0.250000;0.258819;-0.933013;, - 0.253846;0.195090;-0.947366;, - 0.129410;0.130526;-0.982963;, - 0.000000;0.065403;-0.997859;, - 0.461940;0.382683;-0.800103;, - 0.473465;0.321439;-0.820066;, - 0.369644;0.258819;-0.892399;, - 0.375330;0.195090;-0.906127;, - 0.256605;0.130526;-0.957662;, - 0.130247;0.065403;-0.989322;, - 0.562422;0.382683;-0.732963;, - 0.576455;0.321439;-0.751250;, - 0.482963;0.258819;-0.836516;, - 0.490393;0.195090;-0.849385;, - 0.379410;0.130526;-0.915976;, - 0.258265;0.065403;-0.963858;, - 0.653282;0.382683;-0.653282;, - 0.669581;0.321439;-0.669581;, - 0.588018;0.258819;-0.766320;, - 0.597064;0.195090;-0.778109;, - 0.495722;0.130526;-0.858616;, - 0.381864;0.065403;-0.921901;, - 0.732963;0.382683;-0.562422;, - 0.751250;0.321439;-0.576455;, - 0.683013;0.258819;-0.683013;, - 0.693520;0.195090;-0.693520;, - 0.603553;0.130526;-0.786566;, - 0.498929;0.065403;-0.864171;, - 0.800103;0.382683;-0.461940;, - 0.820066;0.321439;-0.473465;, - 0.766320;0.258819;-0.588018;, - 0.778109;0.195090;-0.597064;, - 0.701057;0.130526;-0.701057;, - 0.607458;0.065403;-0.791655;, - 0.836516;0.258819;-0.482963;, - 0.849385;0.195090;-0.490393;, - 0.786566;0.130526;-0.603553;, - 0.705593;0.065403;-0.705593;, - 0.608761;0.000000;-0.793353;, - 0.500000;0.000000;-0.866025;, - 0.858616;0.130526;-0.495722;, - 0.791655;0.065403;-0.607458;, - 0.707107;0.000000;-0.707107;, - 0.607458;-0.065403;-0.791655;, - 0.498929;-0.065403;-0.864171;, - 0.864171;0.065403;-0.498929;, - 0.793353;0.000000;-0.608761;, - 0.705593;-0.065403;-0.705593;, - 0.603553;-0.130526;-0.786566;, - 0.495722;-0.130526;-0.858616;, - 0.866025;0.000000;-0.500000;, - 0.791655;-0.065403;-0.607458;, - 0.701057;-0.130526;-0.701057;, - 0.597064;-0.195090;-0.778109;, - 0.490393;-0.195090;-0.849385;, - 0.864171;-0.065403;-0.498929;, - 0.786566;-0.130526;-0.603553;, - 0.693520;-0.195090;-0.693520;, - 0.588018;-0.258819;-0.766320;, - 0.482963;-0.258819;-0.836516;, - 0.858616;-0.130526;-0.495722;, - 0.778109;-0.195090;-0.597064;, - 0.683013;-0.258819;-0.683013;, - 0.576455;-0.321439;-0.751250;, - 0.473465;-0.321439;-0.820066;, - 0.849385;-0.195090;-0.490393;, - 0.766320;-0.258819;-0.588018;, - 0.669581;-0.321439;-0.669581;, - 0.562422;-0.382683;-0.732963;, - 0.461940;-0.382683;-0.800103;, - 0.836516;-0.258819;-0.482963;, - 0.751250;-0.321439;-0.576455;, - 0.653282;-0.382683;-0.653282;, - 0.448436;-0.442289;-0.776715;, - 0.820066;-0.321439;-0.473465;, - 0.732963;-0.382683;-0.562422;, - 0.800103;-0.382683;-0.461940;, - 0.343218;-0.442289;-0.828602;, - 0.353553;-0.382683;-0.853553;, - 0.362374;-0.321439;-0.874849;, - 0.224144;-0.500000;-0.836516;, - 0.232128;-0.442289;-0.866313;, - 0.239118;-0.382683;-0.892399;, - 0.245084;-0.321439;-0.914664;, - 0.369644;-0.258819;-0.892399;, - 0.113039;-0.500000;-0.858616;, - 0.117065;-0.442289;-0.889200;, - 0.120590;-0.382683;-0.915976;, - 0.123599;-0.321439;-0.938829;, - 0.250000;-0.258819;-0.933013;, - 0.375330;-0.195090;-0.906127;, - 0.000000;-0.500000;-0.866025;, - 0.000000;-0.442289;-0.896873;, - 0.000000;-0.382683;-0.923880;, - 0.000000;-0.321439;-0.946930;, - 0.126079;-0.258819;-0.957662;, - 0.253846;-0.195090;-0.947366;, - -0.113039;-0.500000;-0.858616;, - -0.117065;-0.442289;-0.889200;, - -0.120590;-0.382683;-0.915976;, - -0.123599;-0.321439;-0.938829;, - -0.126079;-0.258819;-0.957662;, - 0.000000;-0.258819;-0.965926;, - -0.224144;-0.500000;-0.836516;, - -0.232128;-0.442289;-0.866313;, - -0.239118;-0.382683;-0.892399;, - -0.245084;-0.321439;-0.914664;, - -0.250000;-0.258819;-0.933013;, - -0.331414;-0.500000;-0.800103;, - -0.343218;-0.442289;-0.828602;, - -0.353553;-0.382683;-0.853553;, - -0.362374;-0.321439;-0.874849;, - -0.369644;-0.258819;-0.892399;, - -0.433013;-0.500000;-0.750000;, - -0.448436;-0.442289;-0.776715;, - -0.461940;-0.382683;-0.800103;, - -0.473465;-0.321439;-0.820066;, - -0.482963;-0.258819;-0.836516;, - -0.527203;-0.500000;-0.687064;, - -0.545982;-0.442289;-0.711537;, - -0.562422;-0.382683;-0.732963;, - -0.576455;-0.321439;-0.751250;, - -0.588018;-0.258819;-0.766320;, - -0.597064;-0.195090;-0.778109;, - -0.490393;-0.195090;-0.849385;, - -0.375330;-0.195090;-0.906127;, - -0.603553;-0.130526;-0.786566;, - -0.495722;-0.130526;-0.858616;, - -0.379410;-0.130526;-0.915976;, - -0.253846;-0.195090;-0.947366;, - -0.128018;-0.195090;-0.972395;, - -0.607458;-0.065403;-0.791655;, - -0.498929;-0.065403;-0.864171;, - -0.381864;-0.065403;-0.921901;, - -0.256605;-0.130526;-0.957662;, - -0.129410;-0.130526;-0.982963;, - 0.000000;-0.195090;-0.980785;, - -0.608761;0.000000;-0.793353;, - -0.500000;0.000000;-0.866025;, - -0.382683;0.000000;-0.923880;, - -0.258265;-0.065403;-0.963858;, - -0.130247;-0.065403;-0.989322;, - 0.000000;-0.130526;-0.991445;, - -0.607458;0.065403;-0.791655;, - -0.498929;0.065403;-0.864171;, - -0.381864;0.065403;-0.921901;, - -0.258819;0.000000;-0.965926;, - -0.130526;0.000000;-0.991445;, - 0.000000;-0.065403;-0.997859;, - -0.603553;0.130526;-0.786566;, - -0.495722;0.130526;-0.858616;, - -0.379410;0.130526;-0.915976;, - -0.258265;0.065403;-0.963858;, - -0.130247;0.065403;-0.989322;, - 0.000000;0.000000;-1.000000;, - -0.597064;0.195090;-0.778109;, - -0.490393;0.195090;-0.849385;, - -0.375330;0.195090;-0.906127;, - -0.256605;0.130526;-0.957662;, - -0.588018;0.258819;-0.766320;, - -0.482963;0.258819;-0.836516;, - -0.576455;0.321439;-0.751250;, - 0.130526;0.000000;-0.991445;, - 0.130247;-0.065403;-0.989322;, - 0.129410;-0.130526;-0.982963;, - 0.258819;0.000000;-0.965926;, - 0.258265;-0.065403;-0.963858;, - 0.256605;-0.130526;-0.957662;, - 0.128018;-0.195090;-0.972395;, - 0.382683;0.000000;-0.923880;, - 0.381864;-0.065403;-0.921901;, - 0.379410;-0.130526;-0.915976;; - 4512; - 3;0,1,2;, - 3;3,1,0;, - 3;3,4,1;, - 3;4,5,1;, - 3;1,5,6;, - 3;7,0,2;, - 3;8,0,7;, - 3;8,3,0;, - 3;9,3,8;, - 3;9,10,3;, - 3;10,4,3;, - 3;10,11,4;, - 3;11,12,4;, - 3;4,12,5;, - 3;13,7,2;, - 3;14,7,13;, - 3;14,8,7;, - 3;15,8,14;, - 3;15,9,8;, - 3;16,9,15;, - 3;16,17,9;, - 3;17,10,9;, - 3;17,18,10;, - 3;18,11,10;, - 3;19,13,2;, - 3;20,13,19;, - 3;20,14,13;, - 3;21,14,20;, - 3;21,15,14;, - 3;22,15,21;, - 3;22,16,15;, - 3;23,16,22;, - 3;23,24,16;, - 3;24,17,16;, - 3;25,19,2;, - 3;26,19,25;, - 3;26,20,19;, - 3;27,20,26;, - 3;27,21,20;, - 3;28,21,27;, - 3;28,22,21;, - 3;29,22,28;, - 3;29,23,22;, - 3;25,2,30;, - 3;26,25,30;, - 3;26,30,31;, - 3;27,26,31;, - 3;27,31,32;, - 3;28,27,32;, - 3;28,32,33;, - 3;29,28,33;, - 3;29,33,34;, - 3;35,29,34;, - 3;35,23,29;, - 3;30,2,36;, - 3;31,30,36;, - 3;31,36,37;, - 3;32,31,37;, - 3;32,37,38;, - 3;33,32,38;, - 3;33,38,39;, - 3;34,33,39;, - 3;34,39,40;, - 3;41,34,40;, - 3;35,34,41;, - 3;36,2,42;, - 3;37,36,42;, - 3;37,42,43;, - 3;38,37,43;, - 3;38,43,44;, - 3;39,38,44;, - 3;39,44,45;, - 3;40,39,45;, - 3;40,45,46;, - 3;47,40,46;, - 3;41,40,47;, - 3;42,2,48;, - 3;43,42,48;, - 3;43,48,49;, - 3;44,43,49;, - 3;44,49,50;, - 3;45,44,50;, - 3;45,50,51;, - 3;46,45,51;, - 3;46,51,52;, - 3;53,46,52;, - 3;47,46,53;, - 3;48,2,54;, - 3;49,48,54;, - 3;49,54,55;, - 3;50,49,55;, - 3;50,55,56;, - 3;51,50,56;, - 3;51,56,57;, - 3;52,51,57;, - 3;52,57,58;, - 3;59,52,58;, - 3;53,52,59;, - 3;54,2,60;, - 3;55,54,60;, - 3;55,60,61;, - 3;56,55,61;, - 3;56,61,62;, - 3;57,56,62;, - 3;57,62,63;, - 3;58,57,63;, - 3;58,63,64;, - 3;65,58,64;, - 3;59,58,65;, - 3;60,2,66;, - 3;61,60,66;, - 3;61,66,67;, - 3;62,61,67;, - 3;62,67,68;, - 3;63,62,68;, - 3;63,68,69;, - 3;64,63,69;, - 3;64,69,70;, - 3;71,64,70;, - 3;65,64,71;, - 3;66,2,72;, - 3;67,66,72;, - 3;67,72,73;, - 3;68,67,73;, - 3;68,73,74;, - 3;69,68,74;, - 3;69,74,75;, - 3;70,69,75;, - 3;70,75,76;, - 3;77,70,76;, - 3;71,70,77;, - 3;72,2,78;, - 3;73,72,78;, - 3;73,78,79;, - 3;74,73,79;, - 3;74,79,80;, - 3;75,74,80;, - 3;75,80,81;, - 3;76,75,81;, - 3;76,81,82;, - 3;83,76,82;, - 3;77,76,83;, - 3;78,2,84;, - 3;79,78,84;, - 3;79,84,85;, - 3;80,79,85;, - 3;80,85,86;, - 3;81,80,86;, - 3;81,86,87;, - 3;82,81,87;, - 3;82,87,88;, - 3;89,82,88;, - 3;83,82,89;, - 3;84,2,90;, - 3;85,84,90;, - 3;85,90,91;, - 3;86,85,91;, - 3;86,91,92;, - 3;87,86,92;, - 3;87,92,93;, - 3;88,87,93;, - 3;88,93,94;, - 3;95,88,94;, - 3;89,88,95;, - 3;90,2,96;, - 3;91,90,96;, - 3;91,96,97;, - 3;92,91,97;, - 3;92,97,98;, - 3;93,92,98;, - 3;93,98,99;, - 3;94,93,99;, - 3;94,99,100;, - 3;101,94,100;, - 3;95,94,101;, - 3;96,2,102;, - 3;97,96,102;, - 3;97,102,103;, - 3;98,97,103;, - 3;98,103,104;, - 3;99,98,104;, - 3;99,104,105;, - 3;100,99,105;, - 3;100,105,106;, - 3;107,100,106;, - 3;101,100,107;, - 3;102,2,108;, - 3;103,102,108;, - 3;103,108,109;, - 3;104,103,109;, - 3;104,109,110;, - 3;105,104,110;, - 3;105,110,111;, - 3;106,105,111;, - 3;106,111,112;, - 3;113,106,112;, - 3;107,106,113;, - 3;108,2,114;, - 3;109,108,114;, - 3;109,114,115;, - 3;110,109,115;, - 3;110,115,116;, - 3;111,110,116;, - 3;111,116,117;, - 3;112,111,117;, - 3;112,117,118;, - 3;119,112,118;, - 3;113,112,119;, - 3;114,2,120;, - 3;115,114,120;, - 3;115,120,121;, - 3;116,115,121;, - 3;116,121,122;, - 3;117,116,122;, - 3;117,122,123;, - 3;118,117,123;, - 3;118,123,124;, - 3;125,118,124;, - 3;119,118,125;, - 3;120,2,126;, - 3;121,120,126;, - 3;121,126,127;, - 3;122,121,127;, - 3;122,127,128;, - 3;123,122,128;, - 3;123,128,129;, - 3;124,123,129;, - 3;124,129,130;, - 3;131,124,130;, - 3;125,124,131;, - 3;126,2,132;, - 3;127,126,132;, - 3;127,132,133;, - 3;128,127,133;, - 3;128,133,134;, - 3;129,128,134;, - 3;129,134,135;, - 3;130,129,135;, - 3;130,135,136;, - 3;137,130,136;, - 3;131,130,137;, - 3;132,2,138;, - 3;133,132,138;, - 3;133,138,139;, - 3;134,133,139;, - 3;134,139,140;, - 3;135,134,140;, - 3;135,140,141;, - 3;136,135,141;, - 3;136,141,142;, - 3;143,136,142;, - 3;137,136,143;, - 3;138,2,144;, - 3;139,138,144;, - 3;139,144,145;, - 3;140,139,145;, - 3;140,145,146;, - 3;141,140,146;, - 3;141,146,147;, - 3;142,141,147;, - 3;142,147,148;, - 3;149,142,148;, - 3;143,142,149;, - 3;144,2,150;, - 3;145,144,150;, - 3;145,150,151;, - 3;146,145,151;, - 3;146,151,152;, - 3;147,146,152;, - 3;147,152,153;, - 3;148,147,153;, - 3;148,153,154;, - 3;155,148,154;, - 3;149,148,155;, - 3;150,2,156;, - 3;151,150,156;, - 3;151,156,157;, - 3;152,151,157;, - 3;152,157,158;, - 3;153,152,158;, - 3;153,158,159;, - 3;154,153,159;, - 3;154,159,160;, - 3;161,154,160;, - 3;155,154,161;, - 3;156,2,162;, - 3;157,156,162;, - 3;157,162,163;, - 3;158,157,163;, - 3;158,163,164;, - 3;159,158,164;, - 3;159,164,165;, - 3;160,159,165;, - 3;160,165,166;, - 3;167,160,166;, - 3;161,160,167;, - 3;162,2,168;, - 3;163,162,168;, - 3;163,168,169;, - 3;164,163,169;, - 3;164,169,170;, - 3;165,164,170;, - 3;165,170,171;, - 3;166,165,171;, - 3;166,171,172;, - 3;173,166,172;, - 3;167,166,173;, - 3;174,167,173;, - 3;175,167,174;, - 3;175,161,167;, - 3;176,161,175;, - 3;176,155,161;, - 3;173,172,177;, - 3;178,173,177;, - 3;174,173,178;, - 3;179,174,178;, - 3;180,174,179;, - 3;180,175,174;, - 3;181,175,180;, - 3;181,176,175;, - 3;182,176,181;, - 3;182,183,176;, - 3;183,155,176;, - 3;183,149,155;, - 3;178,177,184;, - 3;185,178,184;, - 3;179,178,185;, - 3;186,179,185;, - 3;187,179,186;, - 3;187,180,179;, - 3;188,180,187;, - 3;188,181,180;, - 3;189,181,188;, - 3;189,182,181;, - 3;185,184,190;, - 3;191,185,190;, - 3;186,185,191;, - 3;192,186,191;, - 3;193,186,192;, - 3;193,187,186;, - 3;194,187,193;, - 3;194,188,187;, - 3;195,188,194;, - 3;195,189,188;, - 3;191,190,196;, - 3;197,191,196;, - 3;192,191,197;, - 3;198,192,197;, - 3;199,192,198;, - 3;199,193,192;, - 3;200,193,199;, - 3;200,194,193;, - 3;201,194,200;, - 3;201,195,194;, - 3;197,196,202;, - 3;203,197,202;, - 3;198,197,203;, - 3;204,198,203;, - 3;205,198,204;, - 3;205,199,198;, - 3;206,199,205;, - 3;206,200,199;, - 3;207,200,206;, - 3;207,201,200;, - 3;203,202,208;, - 3;209,203,208;, - 3;204,203,209;, - 3;210,204,209;, - 3;211,204,210;, - 3;211,205,204;, - 3;212,205,211;, - 3;212,206,205;, - 3;213,206,212;, - 3;213,207,206;, - 3;209,208,214;, - 3;215,209,214;, - 3;210,209,215;, - 3;216,210,215;, - 3;217,210,216;, - 3;217,211,210;, - 3;218,211,217;, - 3;218,212,211;, - 3;219,212,218;, - 3;219,213,212;, - 3;215,214,220;, - 3;221,215,220;, - 3;216,215,221;, - 3;222,216,221;, - 3;223,216,222;, - 3;223,217,216;, - 3;224,217,223;, - 3;224,218,217;, - 3;225,218,224;, - 3;225,219,218;, - 3;221,220,226;, - 3;227,221,226;, - 3;222,221,227;, - 3;228,222,227;, - 3;229,222,228;, - 3;229,223,222;, - 3;230,223,229;, - 3;230,224,223;, - 3;231,224,230;, - 3;231,225,224;, - 3;227,226,232;, - 3;233,227,232;, - 3;228,227,233;, - 3;234,228,233;, - 3;235,228,234;, - 3;235,229,228;, - 3;236,229,235;, - 3;236,230,229;, - 3;237,230,236;, - 3;237,231,230;, - 3;233,232,238;, - 3;239,233,238;, - 3;234,233,239;, - 3;240,234,239;, - 3;241,234,240;, - 3;241,235,234;, - 3;242,235,241;, - 3;242,236,235;, - 3;243,236,242;, - 3;243,237,236;, - 3;239,238,244;, - 3;245,239,244;, - 3;240,239,245;, - 3;246,240,245;, - 3;247,240,246;, - 3;247,241,240;, - 3;248,241,247;, - 3;248,242,241;, - 3;249,242,248;, - 3;249,243,242;, - 3;245,244,250;, - 3;251,245,250;, - 3;246,245,251;, - 3;252,246,251;, - 3;253,246,252;, - 3;253,247,246;, - 3;254,247,253;, - 3;254,248,247;, - 3;255,248,254;, - 3;255,249,248;, - 3;251,250,256;, - 3;257,251,256;, - 3;252,251,257;, - 3;258,252,257;, - 3;259,252,258;, - 3;259,253,252;, - 3;260,253,259;, - 3;260,254,253;, - 3;261,254,260;, - 3;261,255,254;, - 3;257,256,262;, - 3;263,257,262;, - 3;258,257,263;, - 3;264,258,263;, - 3;265,258,264;, - 3;265,259,258;, - 3;266,259,265;, - 3;266,260,259;, - 3;267,260,266;, - 3;267,261,260;, - 3;263,262,268;, - 3;269,263,268;, - 3;264,263,269;, - 3;270,264,269;, - 3;271,264,270;, - 3;271,265,264;, - 3;272,265,271;, - 3;272,266,265;, - 3;273,266,272;, - 3;273,267,266;, - 3;269,268,274;, - 3;275,269,274;, - 3;270,269,275;, - 3;276,270,275;, - 3;277,270,276;, - 3;277,271,270;, - 3;278,271,277;, - 3;278,272,271;, - 3;279,272,278;, - 3;279,273,272;, - 3;275,274,280;, - 3;281,275,280;, - 3;276,275,281;, - 3;282,276,281;, - 3;283,276,282;, - 3;283,277,276;, - 3;284,277,283;, - 3;284,278,277;, - 3;285,278,284;, - 3;285,279,278;, - 3;281,280,286;, - 3;287,281,286;, - 3;282,281,287;, - 3;288,282,287;, - 3;289,282,288;, - 3;289,283,282;, - 3;290,283,289;, - 3;290,284,283;, - 3;291,284,290;, - 3;291,285,284;, - 3;287,286,292;, - 3;293,287,292;, - 3;288,287,293;, - 3;294,288,293;, - 3;295,288,294;, - 3;295,289,288;, - 3;296,289,295;, - 3;296,290,289;, - 3;297,290,296;, - 3;297,291,290;, - 3;293,292,298;, - 3;299,293,298;, - 3;294,293,299;, - 3;300,294,299;, - 3;301,294,300;, - 3;301,295,294;, - 3;302,295,301;, - 3;302,296,295;, - 3;303,296,302;, - 3;303,297,296;, - 3;299,298,304;, - 3;305,299,304;, - 3;300,299,305;, - 3;306,300,305;, - 3;307,300,306;, - 3;307,301,300;, - 3;308,301,307;, - 3;308,302,301;, - 3;309,302,308;, - 3;309,303,302;, - 3;305,304,310;, - 3;311,305,310;, - 3;306,305,311;, - 3;312,306,311;, - 3;313,306,312;, - 3;313,307,306;, - 3;314,307,313;, - 3;314,308,307;, - 3;315,308,314;, - 3;315,309,308;, - 3;311,310,316;, - 3;317,311,316;, - 3;312,311,317;, - 3;318,312,317;, - 3;319,312,318;, - 3;319,313,312;, - 3;320,313,319;, - 3;320,314,313;, - 3;321,314,320;, - 3;321,315,314;, - 3;317,316,322;, - 3;323,317,322;, - 3;318,317,323;, - 3;324,318,323;, - 3;325,318,324;, - 3;325,319,318;, - 3;326,319,325;, - 3;326,320,319;, - 3;327,320,326;, - 3;327,321,320;, - 3;323,322,328;, - 3;329,323,328;, - 3;324,323,329;, - 3;330,324,329;, - 3;331,324,330;, - 3;331,325,324;, - 3;332,325,331;, - 3;332,326,325;, - 3;333,326,332;, - 3;333,327,326;, - 3;329,328,334;, - 3;335,329,334;, - 3;330,329,335;, - 3;336,330,335;, - 3;337,330,336;, - 3;337,331,330;, - 3;338,331,337;, - 3;338,332,331;, - 3;339,332,338;, - 3;339,333,332;, - 3;335,334,340;, - 3;341,335,340;, - 3;336,335,341;, - 3;342,336,341;, - 3;343,336,342;, - 3;343,337,336;, - 3;344,337,343;, - 3;344,338,337;, - 3;345,338,344;, - 3;345,339,338;, - 3;341,340,346;, - 3;347,341,346;, - 3;342,341,347;, - 3;348,342,347;, - 3;349,342,348;, - 3;349,343,342;, - 3;350,343,349;, - 3;350,344,343;, - 3;351,344,350;, - 3;351,345,344;, - 3;347,346,352;, - 3;353,347,352;, - 3;348,347,353;, - 3;354,348,353;, - 3;355,348,354;, - 3;355,349,348;, - 3;356,349,355;, - 3;356,350,349;, - 3;357,350,356;, - 3;357,351,350;, - 3;353,352,358;, - 3;359,353,358;, - 3;354,353,359;, - 3;360,354,359;, - 3;361,354,360;, - 3;361,355,354;, - 3;362,355,361;, - 3;362,356,355;, - 3;363,356,362;, - 3;363,357,356;, - 3;359,358,364;, - 3;365,359,364;, - 3;360,359,365;, - 3;366,360,365;, - 3;367,360,366;, - 3;367,361,360;, - 3;368,361,367;, - 3;368,362,361;, - 3;369,362,368;, - 3;369,363,362;, - 3;365,364,370;, - 3;371,365,370;, - 3;366,365,371;, - 3;372,366,371;, - 3;373,366,372;, - 3;373,367,366;, - 3;374,367,373;, - 3;374,368,367;, - 3;375,368,374;, - 3;375,369,368;, - 3;371,370,376;, - 3;377,371,376;, - 3;372,371,377;, - 3;378,372,377;, - 3;379,372,378;, - 3;379,373,372;, - 3;380,373,379;, - 3;380,374,373;, - 3;381,374,380;, - 3;381,375,374;, - 3;377,376,382;, - 3;383,377,382;, - 3;378,377,383;, - 3;384,378,383;, - 3;385,378,384;, - 3;385,379,378;, - 3;386,379,385;, - 3;386,380,379;, - 3;387,380,386;, - 3;387,381,380;, - 3;383,382,388;, - 3;389,383,388;, - 3;384,383,389;, - 3;390,384,389;, - 3;391,384,390;, - 3;391,385,384;, - 3;392,385,391;, - 3;392,386,385;, - 3;393,386,392;, - 3;393,387,386;, - 3;389,388,394;, - 3;395,389,394;, - 3;390,389,395;, - 3;396,390,395;, - 3;397,390,396;, - 3;397,391,390;, - 3;398,391,397;, - 3;398,392,391;, - 3;399,392,398;, - 3;399,393,392;, - 3;395,394,400;, - 3;401,395,400;, - 3;396,395,401;, - 3;402,396,401;, - 3;403,396,402;, - 3;403,397,396;, - 3;404,397,403;, - 3;404,398,397;, - 3;405,398,404;, - 3;405,399,398;, - 3;401,400,406;, - 3;407,401,406;, - 3;402,401,407;, - 3;408,402,407;, - 3;409,402,408;, - 3;409,403,402;, - 3;410,403,409;, - 3;410,404,403;, - 3;411,404,410;, - 3;411,405,404;, - 3;407,406,412;, - 3;413,407,412;, - 3;408,407,413;, - 3;414,408,413;, - 3;415,408,414;, - 3;415,409,408;, - 3;416,409,415;, - 3;416,410,409;, - 3;417,410,416;, - 3;417,411,410;, - 3;413,412,418;, - 3;419,413,418;, - 3;414,413,419;, - 3;420,414,419;, - 3;420,415,414;, - 3;420,416,415;, - 3;420,417,416;, - 3;420,421,417;, - 3;421,411,417;, - 3;421,422,411;, - 3;422,405,411;, - 3;419,418,423;, - 3;420,419,423;, - 3;422,424,405;, - 3;425,424,422;, - 3;425,426,424;, - 3;426,427,424;, - 3;424,427,399;, - 3;424,399,405;, - 3;428,425,422;, - 3;429,425,428;, - 3;429,430,425;, - 3;430,426,425;, - 3;430,431,426;, - 3;431,432,426;, - 3;426,432,427;, - 3;428,422,421;, - 3;420,428,421;, - 3;420,429,428;, - 3;420,433,429;, - 3;433,430,429;, - 3;433,434,430;, - 3;434,431,430;, - 3;434,435,431;, - 3;435,436,431;, - 3;431,436,432;, - 3;436,437,432;, - 3;432,437,438;, - 3;432,438,427;, - 3;420,439,433;, - 3;439,434,433;, - 3;439,440,434;, - 3;440,435,434;, - 3;440,441,435;, - 3;441,442,435;, - 3;435,442,436;, - 3;442,443,436;, - 3;436,443,437;, - 3;420,444,439;, - 3;444,440,439;, - 3;444,445,440;, - 3;445,441,440;, - 3;445,446,441;, - 3;446,447,441;, - 3;441,447,442;, - 3;447,448,442;, - 3;442,448,443;, - 3;420,449,444;, - 3;449,445,444;, - 3;449,450,445;, - 3;450,446,445;, - 3;450,451,446;, - 3;451,452,446;, - 3;446,452,447;, - 3;452,453,447;, - 3;447,453,448;, - 3;420,454,449;, - 3;454,450,449;, - 3;454,455,450;, - 3;455,451,450;, - 3;455,456,451;, - 3;456,457,451;, - 3;451,457,452;, - 3;457,458,452;, - 3;452,458,453;, - 3;420,459,454;, - 3;459,455,454;, - 3;459,460,455;, - 3;460,456,455;, - 3;460,461,456;, - 3;461,462,456;, - 3;456,462,457;, - 3;462,463,457;, - 3;457,463,458;, - 3;420,464,459;, - 3;464,460,459;, - 3;464,465,460;, - 3;465,461,460;, - 3;465,466,461;, - 3;466,467,461;, - 3;461,467,462;, - 3;467,468,462;, - 3;462,468,463;, - 3;420,469,464;, - 3;469,465,464;, - 3;469,470,465;, - 3;470,466,465;, - 3;470,471,466;, - 3;471,472,466;, - 3;466,472,467;, - 3;472,473,467;, - 3;467,473,468;, - 3;420,474,469;, - 3;474,470,469;, - 3;474,475,470;, - 3;475,471,470;, - 3;475,476,471;, - 3;476,477,471;, - 3;471,477,472;, - 3;477,478,472;, - 3;472,478,473;, - 3;420,479,474;, - 3;479,475,474;, - 3;479,480,475;, - 3;480,476,475;, - 3;480,481,476;, - 3;481,482,476;, - 3;476,482,477;, - 3;482,483,477;, - 3;477,483,478;, - 3;420,484,479;, - 3;484,480,479;, - 3;484,485,480;, - 3;485,481,480;, - 3;485,486,481;, - 3;486,487,481;, - 3;481,487,482;, - 3;487,488,482;, - 3;482,488,483;, - 3;420,489,484;, - 3;489,485,484;, - 3;489,490,485;, - 3;490,486,485;, - 3;490,491,486;, - 3;491,492,486;, - 3;486,492,487;, - 3;492,493,487;, - 3;487,493,488;, - 3;420,494,489;, - 3;494,490,489;, - 3;494,495,490;, - 3;495,491,490;, - 3;495,496,491;, - 3;496,497,491;, - 3;491,497,492;, - 3;497,498,492;, - 3;492,498,493;, - 3;420,499,494;, - 3;499,495,494;, - 3;499,500,495;, - 3;500,496,495;, - 3;500,501,496;, - 3;501,502,496;, - 3;496,502,497;, - 3;502,503,497;, - 3;497,503,498;, - 3;420,504,499;, - 3;504,500,499;, - 3;504,505,500;, - 3;505,501,500;, - 3;505,506,501;, - 3;506,507,501;, - 3;501,507,502;, - 3;507,508,502;, - 3;502,508,503;, - 3;420,509,504;, - 3;509,505,504;, - 3;509,510,505;, - 3;510,506,505;, - 3;510,511,506;, - 3;511,512,506;, - 3;506,512,507;, - 3;512,513,507;, - 3;507,513,508;, - 3;513,514,508;, - 3;508,514,515;, - 3;508,515,503;, - 3;509,516,510;, - 3;510,516,517;, - 3;510,517,511;, - 3;511,517,518;, - 3;511,518,519;, - 3;511,519,512;, - 3;519,520,512;, - 3;512,520,513;, - 3;520,521,513;, - 3;513,521,514;, - 3;509,522,516;, - 3;522,523,516;, - 3;516,523,524;, - 3;516,524,517;, - 3;517,524,525;, - 3;517,525,518;, - 3;518,525,526;, - 3;518,526,527;, - 3;519,518,527;, - 3;528,522,509;, - 3;528,529,522;, - 3;522,529,523;, - 3;529,530,523;, - 3;523,530,531;, - 3;523,531,524;, - 3;524,531,532;, - 3;524,532,525;, - 3;525,532,533;, - 3;525,533,526;, - 3;528,534,529;, - 3;529,534,530;, - 3;534,535,530;, - 3;530,535,536;, - 3;530,536,531;, - 3;531,536,537;, - 3;531,537,532;, - 3;532,537,538;, - 3;532,538,533;, - 3;528,539,534;, - 3;534,539,535;, - 3;539,540,535;, - 3;535,540,541;, - 3;535,541,536;, - 3;536,541,542;, - 3;536,542,537;, - 3;537,542,543;, - 3;537,543,538;, - 3;528,544,539;, - 3;539,544,540;, - 3;544,545,540;, - 3;540,545,546;, - 3;540,546,541;, - 3;541,546,547;, - 3;541,547,542;, - 3;542,547,548;, - 3;542,548,543;, - 3;528,549,544;, - 3;544,549,545;, - 3;549,550,545;, - 3;545,550,551;, - 3;545,551,546;, - 3;546,551,552;, - 3;546,552,547;, - 3;547,552,553;, - 3;547,553,548;, - 3;528,554,549;, - 3;549,554,550;, - 3;554,555,550;, - 3;550,555,556;, - 3;550,556,551;, - 3;551,556,557;, - 3;551,557,552;, - 3;552,557,558;, - 3;552,558,553;, - 3;528,559,554;, - 3;554,559,555;, - 3;559,560,555;, - 3;555,560,561;, - 3;555,561,556;, - 3;556,561,562;, - 3;556,562,557;, - 3;557,562,563;, - 3;557,563,558;, - 3;528,564,559;, - 3;559,564,560;, - 3;564,565,560;, - 3;560,565,566;, - 3;560,566,561;, - 3;561,566,567;, - 3;561,567,562;, - 3;562,567,568;, - 3;562,568,563;, - 3;528,569,564;, - 3;564,569,565;, - 3;569,570,565;, - 3;565,570,571;, - 3;565,571,566;, - 3;566,571,572;, - 3;566,572,567;, - 3;567,572,573;, - 3;567,573,568;, - 3;528,574,569;, - 3;569,574,570;, - 3;574,575,570;, - 3;570,575,576;, - 3;570,576,571;, - 3;571,576,577;, - 3;571,577,572;, - 3;572,577,578;, - 3;572,578,573;, - 3;528,579,574;, - 3;574,579,575;, - 3;579,580,575;, - 3;575,580,581;, - 3;575,581,576;, - 3;576,581,582;, - 3;576,582,577;, - 3;577,582,583;, - 3;577,583,578;, - 3;528,584,579;, - 3;579,584,580;, - 3;584,585,580;, - 3;580,585,586;, - 3;580,586,581;, - 3;581,586,587;, - 3;581,587,582;, - 3;582,587,588;, - 3;582,588,583;, - 3;528,589,584;, - 3;584,589,585;, - 3;589,590,585;, - 3;585,590,591;, - 3;585,591,586;, - 3;586,591,592;, - 3;586,592,587;, - 3;587,592,593;, - 3;587,593,588;, - 3;528,594,589;, - 3;589,594,590;, - 3;594,595,590;, - 3;590,595,596;, - 3;590,596,591;, - 3;591,596,597;, - 3;591,597,592;, - 3;592,597,598;, - 3;592,598,593;, - 3;528,599,594;, - 3;594,599,595;, - 3;599,600,595;, - 3;595,600,601;, - 3;595,601,596;, - 3;596,601,602;, - 3;596,602,597;, - 3;597,602,603;, - 3;597,603,598;, - 3;528,604,599;, - 3;599,604,600;, - 3;604,605,600;, - 3;600,605,606;, - 3;600,606,601;, - 3;601,606,607;, - 3;601,607,602;, - 3;602,607,608;, - 3;602,608,603;, - 3;528,609,604;, - 3;604,609,605;, - 3;609,610,605;, - 3;605,610,611;, - 3;605,611,606;, - 3;606,611,612;, - 3;606,612,607;, - 3;607,612,613;, - 3;607,613,608;, - 3;528,614,609;, - 3;609,614,610;, - 3;614,615,610;, - 3;610,615,616;, - 3;610,616,611;, - 3;611,616,617;, - 3;611,617,612;, - 3;612,617,618;, - 3;612,618,613;, - 3;528,619,614;, - 3;614,619,615;, - 3;619,620,615;, - 3;615,620,621;, - 3;615,621,616;, - 3;616,621,622;, - 3;616,622,617;, - 3;617,622,623;, - 3;617,623,618;, - 3;528,624,619;, - 3;619,624,620;, - 3;624,625,620;, - 3;620,625,626;, - 3;620,626,621;, - 3;621,626,627;, - 3;621,627,622;, - 3;622,627,628;, - 3;622,628,623;, - 3;528,629,624;, - 3;624,629,625;, - 3;629,630,625;, - 3;625,630,631;, - 3;625,631,626;, - 3;626,631,632;, - 3;626,632,627;, - 3;627,632,633;, - 3;627,633,628;, - 3;528,634,629;, - 3;629,634,630;, - 3;634,635,630;, - 3;630,635,636;, - 3;630,636,631;, - 3;631,636,637;, - 3;631,637,632;, - 3;632,637,638;, - 3;632,638,633;, - 3;528,639,634;, - 3;634,639,635;, - 3;633,638,640;, - 3;633,640,641;, - 3;628,633,641;, - 3;628,641,642;, - 3;623,628,642;, - 3;623,642,643;, - 3;618,623,643;, - 3;641,640,644;, - 3;641,644,645;, - 3;642,641,645;, - 3;642,645,646;, - 3;643,642,646;, - 3;643,646,647;, - 3;648,643,647;, - 3;618,643,648;, - 3;613,618,648;, - 3;613,648,649;, - 3;608,613,649;, - 3;645,644,650;, - 3;645,650,651;, - 3;646,645,651;, - 3;646,651,652;, - 3;647,646,652;, - 3;647,652,653;, - 3;654,647,653;, - 3;648,647,654;, - 3;649,648,654;, - 3;649,654,655;, - 3;656,649,655;, - 3;608,649,656;, - 3;603,608,656;, - 3;651,650,657;, - 3;651,657,658;, - 3;652,651,658;, - 3;652,658,659;, - 3;653,652,659;, - 3;653,659,660;, - 3;661,653,660;, - 3;654,653,661;, - 3;655,654,661;, - 3;655,661,662;, - 3;663,655,662;, - 3;656,655,663;, - 3;658,657,664;, - 3;658,664,665;, - 3;659,658,665;, - 3;659,665,666;, - 3;660,659,666;, - 3;660,666,667;, - 3;668,660,667;, - 3;661,660,668;, - 3;662,661,668;, - 3;662,668,669;, - 3;670,662,669;, - 3;663,662,670;, - 3;665,664,671;, - 3;665,671,672;, - 3;666,665,672;, - 3;666,672,673;, - 3;667,666,673;, - 3;667,673,674;, - 3;675,667,674;, - 3;668,667,675;, - 3;669,668,675;, - 3;669,675,676;, - 3;677,669,676;, - 3;670,669,677;, - 3;672,671,678;, - 3;672,678,679;, - 3;673,672,679;, - 3;673,679,680;, - 3;674,673,680;, - 3;674,680,681;, - 3;682,674,681;, - 3;675,674,682;, - 3;676,675,682;, - 3;676,682,683;, - 3;684,676,683;, - 3;677,676,684;, - 3;679,678,685;, - 3;679,685,686;, - 3;680,679,686;, - 3;680,686,687;, - 3;681,680,687;, - 3;681,687,688;, - 3;689,681,688;, - 3;682,681,689;, - 3;683,682,689;, - 3;683,689,690;, - 3;691,683,690;, - 3;684,683,691;, - 3;686,685,692;, - 3;686,692,693;, - 3;687,686,693;, - 3;687,693,694;, - 3;688,687,694;, - 3;688,694,695;, - 3;696,688,695;, - 3;689,688,696;, - 3;690,689,696;, - 3;690,696,697;, - 3;698,690,697;, - 3;691,690,698;, - 3;693,692,699;, - 3;693,699,700;, - 3;694,693,700;, - 3;694,700,701;, - 3;695,694,701;, - 3;695,701,702;, - 3;703,695,702;, - 3;696,695,703;, - 3;697,696,703;, - 3;697,703,704;, - 3;705,697,704;, - 3;698,697,705;, - 3;700,699,706;, - 3;700,706,707;, - 3;701,700,707;, - 3;701,707,708;, - 3;702,701,708;, - 3;702,708,709;, - 3;710,702,709;, - 3;703,702,710;, - 3;704,703,710;, - 3;704,710,711;, - 3;712,704,711;, - 3;705,704,712;, - 3;707,706,713;, - 3;707,713,714;, - 3;708,707,714;, - 3;708,714,715;, - 3;709,708,715;, - 3;709,715,716;, - 3;717,709,716;, - 3;710,709,717;, - 3;711,710,717;, - 3;711,717,718;, - 3;719,711,718;, - 3;712,711,719;, - 3;714,713,720;, - 3;714,720,721;, - 3;715,714,721;, - 3;715,721,722;, - 3;716,715,722;, - 3;716,722,723;, - 3;724,716,723;, - 3;717,716,724;, - 3;718,717,724;, - 3;718,724,725;, - 3;726,718,725;, - 3;719,718,726;, - 3;721,720,727;, - 3;721,727,728;, - 3;722,721,728;, - 3;722,728,729;, - 3;723,722,729;, - 3;723,729,730;, - 3;731,723,730;, - 3;724,723,731;, - 3;725,724,731;, - 3;725,731,732;, - 3;733,725,732;, - 3;726,725,733;, - 3;728,727,734;, - 3;728,734,735;, - 3;729,728,735;, - 3;729,735,736;, - 3;730,729,736;, - 3;730,736,737;, - 3;738,730,737;, - 3;731,730,738;, - 3;732,731,738;, - 3;732,738,739;, - 3;740,732,739;, - 3;733,732,740;, - 3;735,734,741;, - 3;735,741,742;, - 3;736,735,742;, - 3;736,742,743;, - 3;737,736,743;, - 3;737,743,744;, - 3;745,737,744;, - 3;738,737,745;, - 3;739,738,745;, - 3;739,745,746;, - 3;747,739,746;, - 3;740,739,747;, - 3;742,741,748;, - 3;742,748,749;, - 3;743,742,749;, - 3;743,749,750;, - 3;744,743,750;, - 3;744,750,751;, - 3;752,744,751;, - 3;745,744,752;, - 3;746,745,752;, - 3;746,752,753;, - 3;754,746,753;, - 3;747,746,754;, - 3;749,748,755;, - 3;749,755,756;, - 3;750,749,756;, - 3;750,756,757;, - 3;751,750,757;, - 3;751,757,758;, - 3;759,751,758;, - 3;752,751,759;, - 3;753,752,759;, - 3;753,759,760;, - 3;761,753,760;, - 3;754,753,761;, - 3;756,755,762;, - 3;756,762,763;, - 3;757,756,763;, - 3;757,763,764;, - 3;758,757,764;, - 3;758,764,765;, - 3;766,758,765;, - 3;759,758,766;, - 3;760,759,766;, - 3;760,766,767;, - 3;768,760,767;, - 3;761,760,768;, - 3;763,762,769;, - 3;763,769,770;, - 3;764,763,770;, - 3;764,770,771;, - 3;765,764,771;, - 3;765,771,772;, - 3;773,765,772;, - 3;766,765,773;, - 3;767,766,773;, - 3;767,773,774;, - 3;775,767,774;, - 3;768,767,775;, - 3;770,769,776;, - 3;770,776,777;, - 3;771,770,777;, - 3;771,777,778;, - 3;772,771,778;, - 3;772,778,779;, - 3;780,772,779;, - 3;773,772,780;, - 3;774,773,780;, - 3;774,780,781;, - 3;782,774,781;, - 3;775,774,782;, - 3;777,776,783;, - 3;777,783,784;, - 3;778,777,784;, - 3;778,784,785;, - 3;779,778,785;, - 3;779,785,786;, - 3;787,779,786;, - 3;780,779,787;, - 3;781,780,787;, - 3;781,787,788;, - 3;789,781,788;, - 3;782,781,789;, - 3;784,783,790;, - 3;784,790,791;, - 3;785,784,791;, - 3;785,791,792;, - 3;786,785,792;, - 3;786,792,793;, - 3;794,786,793;, - 3;787,786,794;, - 3;788,787,794;, - 3;788,794,795;, - 3;796,788,795;, - 3;789,788,796;, - 3;791,790,797;, - 3;791,797,798;, - 3;792,791,798;, - 3;792,798,799;, - 3;793,792,799;, - 3;793,799,800;, - 3;801,793,800;, - 3;794,793,801;, - 3;795,794,801;, - 3;795,801,802;, - 3;803,795,802;, - 3;796,795,803;, - 3;798,797,804;, - 3;798,804,805;, - 3;799,798,805;, - 3;799,805,806;, - 3;800,799,806;, - 3;800,806,807;, - 3;808,800,807;, - 3;801,800,808;, - 3;802,801,808;, - 3;802,808,809;, - 3;810,802,809;, - 3;803,802,810;, - 3;805,804,811;, - 3;805,811,812;, - 3;806,805,812;, - 3;806,812,813;, - 3;807,806,813;, - 3;807,813,814;, - 3;815,807,814;, - 3;808,807,815;, - 3;809,808,815;, - 3;809,815,816;, - 3;817,809,816;, - 3;810,809,817;, - 3;812,811,818;, - 3;812,818,819;, - 3;813,812,819;, - 3;813,819,820;, - 3;814,813,820;, - 3;814,820,821;, - 3;822,814,821;, - 3;815,814,822;, - 3;816,815,822;, - 3;816,822,823;, - 3;824,816,823;, - 3;817,816,824;, - 3;819,818,825;, - 3;819,825,826;, - 3;820,819,826;, - 3;820,826,827;, - 3;821,820,827;, - 3;821,827,828;, - 3;829,821,828;, - 3;822,821,829;, - 3;823,822,829;, - 3;823,829,830;, - 3;831,823,830;, - 3;824,823,831;, - 3;826,825,832;, - 3;826,832,833;, - 3;827,826,833;, - 3;827,833,834;, - 3;828,827,834;, - 3;828,834,835;, - 3;836,828,835;, - 3;829,828,836;, - 3;830,829,836;, - 3;830,836,837;, - 3;838,830,837;, - 3;831,830,838;, - 3;833,832,839;, - 3;833,839,840;, - 3;834,833,840;, - 3;834,840,841;, - 3;835,834,841;, - 3;835,841,842;, - 3;843,835,842;, - 3;836,835,843;, - 3;837,836,843;, - 3;837,843,844;, - 3;845,837,844;, - 3;838,837,845;, - 3;840,839,846;, - 3;840,846,847;, - 3;841,840,847;, - 3;841,847,848;, - 3;842,841,848;, - 3;842,848,849;, - 3;850,842,849;, - 3;843,842,850;, - 3;844,843,850;, - 3;844,850,851;, - 3;852,844,851;, - 3;845,844,852;, - 3;847,846,853;, - 3;847,853,854;, - 3;848,847,854;, - 3;848,854,855;, - 3;849,848,855;, - 3;849,855,856;, - 3;857,849,856;, - 3;850,849,857;, - 3;851,850,857;, - 3;851,857,858;, - 3;859,851,858;, - 3;852,851,859;, - 3;854,853,860;, - 3;854,860,861;, - 3;855,854,861;, - 3;855,861,862;, - 3;856,855,862;, - 3;856,862,863;, - 3;864,856,863;, - 3;857,856,864;, - 3;858,857,864;, - 3;858,864,865;, - 3;866,858,865;, - 3;859,858,866;, - 3;861,860,867;, - 3;861,867,868;, - 3;862,861,868;, - 3;862,868,869;, - 3;863,862,869;, - 3;863,869,870;, - 3;871,863,870;, - 3;864,863,871;, - 3;865,864,871;, - 3;865,871,872;, - 3;873,865,872;, - 3;866,865,873;, - 3;868,867,874;, - 3;868,874,875;, - 3;869,868,875;, - 3;869,875,876;, - 3;870,869,876;, - 3;870,876,877;, - 3;878,870,877;, - 3;871,870,878;, - 3;872,871,878;, - 3;872,878,879;, - 3;880,872,879;, - 3;873,872,880;, - 3;875,874,881;, - 3;875,881,882;, - 3;876,875,882;, - 3;876,882,883;, - 3;877,876,883;, - 3;877,883,884;, - 3;885,877,884;, - 3;878,877,885;, - 3;879,878,885;, - 3;879,885,886;, - 3;887,879,886;, - 3;880,879,887;, - 3;882,881,888;, - 3;882,888,889;, - 3;883,882,889;, - 3;883,889,890;, - 3;884,883,890;, - 3;884,890,891;, - 3;892,884,891;, - 3;885,884,892;, - 3;886,885,892;, - 3;886,892,893;, - 3;894,886,893;, - 3;887,886,894;, - 3;889,888,895;, - 3;889,895,896;, - 3;890,889,896;, - 3;890,896,897;, - 3;891,890,897;, - 3;891,897,898;, - 3;899,891,898;, - 3;892,891,899;, - 3;893,892,899;, - 3;893,899,900;, - 3;901,893,900;, - 3;894,893,901;, - 3;896,895,902;, - 3;896,902,903;, - 3;897,896,903;, - 3;897,903,904;, - 3;898,897,904;, - 3;898,904,905;, - 3;906,898,905;, - 3;899,898,906;, - 3;900,899,906;, - 3;900,906,907;, - 3;908,900,907;, - 3;901,900,908;, - 3;903,902,909;, - 3;903,909,910;, - 3;904,903,910;, - 3;904,910,911;, - 3;905,904,911;, - 3;905,911,912;, - 3;913,905,912;, - 3;906,905,913;, - 3;907,906,913;, - 3;907,913,914;, - 3;915,907,914;, - 3;908,907,915;, - 3;910,909,916;, - 3;910,916,917;, - 3;911,910,917;, - 3;911,917,918;, - 3;912,911,918;, - 3;912,918,919;, - 3;920,912,919;, - 3;913,912,920;, - 3;914,913,920;, - 3;914,920,921;, - 3;922,914,921;, - 3;915,914,922;, - 3;917,916,923;, - 3;917,923,924;, - 3;918,917,924;, - 3;918,924,925;, - 3;919,918,925;, - 3;919,925,926;, - 3;927,919,926;, - 3;920,919,927;, - 3;921,920,927;, - 3;921,927,928;, - 3;929,921,928;, - 3;922,921,929;, - 3;924,923,6;, - 3;925,924,6;, - 3;926,925,6;, - 3;930,926,6;, - 3;927,926,930;, - 3;928,927,930;, - 3;928,930,931;, - 3;932,928,931;, - 3;929,928,932;, - 3;933,929,932;, - 3;934,929,933;, - 3;934,922,929;, - 3;931,930,6;, - 3;935,931,6;, - 3;932,931,935;, - 3;936,932,935;, - 3;933,932,936;, - 3;937,933,936;, - 3;938,933,937;, - 3;938,934,933;, - 3;939,934,938;, - 3;939,940,934;, - 3;940,922,934;, - 3;940,915,922;, - 3;941,935,6;, - 3;936,935,941;, - 3;942,936,941;, - 3;937,936,942;, - 3;943,937,942;, - 3;944,937,943;, - 3;944,938,937;, - 3;945,938,944;, - 3;945,939,938;, - 3;946,941,6;, - 3;942,941,946;, - 3;947,942,946;, - 3;943,942,947;, - 3;948,943,947;, - 3;949,943,948;, - 3;949,944,943;, - 3;950,944,949;, - 3;950,945,944;, - 3;951,946,6;, - 3;947,946,951;, - 3;952,947,951;, - 3;948,947,952;, - 3;953,948,952;, - 3;954,948,953;, - 3;954,949,948;, - 3;955,949,954;, - 3;955,950,949;, - 3;956,951,6;, - 3;952,951,956;, - 3;957,952,956;, - 3;953,952,957;, - 3;958,953,957;, - 3;959,953,958;, - 3;959,954,953;, - 3;960,954,959;, - 3;960,955,954;, - 3;961,956,6;, - 3;957,956,961;, - 3;962,957,961;, - 3;958,957,962;, - 3;963,958,962;, - 3;964,958,963;, - 3;964,959,958;, - 3;965,959,964;, - 3;965,960,959;, - 3;966,961,6;, - 3;962,961,966;, - 3;967,962,966;, - 3;963,962,967;, - 3;968,963,967;, - 3;969,963,968;, - 3;969,964,963;, - 3;970,964,969;, - 3;970,965,964;, - 3;971,966,6;, - 3;967,966,971;, - 3;972,967,971;, - 3;968,967,972;, - 3;973,968,972;, - 3;974,968,973;, - 3;974,969,968;, - 3;975,969,974;, - 3;975,970,969;, - 3;976,971,6;, - 3;972,971,976;, - 3;977,972,976;, - 3;973,972,977;, - 3;978,973,977;, - 3;979,973,978;, - 3;979,974,973;, - 3;980,974,979;, - 3;980,975,974;, - 3;981,976,6;, - 3;977,976,981;, - 3;982,977,981;, - 3;978,977,982;, - 3;983,978,982;, - 3;984,978,983;, - 3;984,979,978;, - 3;985,979,984;, - 3;985,980,979;, - 3;986,981,6;, - 3;982,981,986;, - 3;987,982,986;, - 3;983,982,987;, - 3;988,983,987;, - 3;989,983,988;, - 3;989,984,983;, - 3;990,984,989;, - 3;990,985,984;, - 3;991,986,6;, - 3;987,986,991;, - 3;12,987,991;, - 3;988,987,12;, - 3;11,988,12;, - 3;992,988,11;, - 3;992,989,988;, - 3;993,989,992;, - 3;993,990,989;, - 3;5,991,6;, - 3;12,991,5;, - 3;18,992,11;, - 3;994,992,18;, - 3;994,993,992;, - 3;995,993,994;, - 3;995,996,993;, - 3;996,990,993;, - 3;996,997,990;, - 3;997,985,990;, - 3;998,994,18;, - 3;999,994,998;, - 3;999,995,994;, - 3;1000,995,999;, - 3;1000,1001,995;, - 3;1001,996,995;, - 3;1001,1002,996;, - 3;1002,997,996;, - 3;998,18,17;, - 3;24,998,17;, - 3;1003,998,24;, - 3;1003,999,998;, - 3;1004,999,1003;, - 3;1004,1000,999;, - 3;1005,1000,1004;, - 3;1005,1006,1000;, - 3;1006,1001,1000;, - 3;1006,1007,1001;, - 3;1007,1002,1001;, - 3;1008,1003,24;, - 3;1009,1003,1008;, - 3;1009,1004,1003;, - 3;1010,1004,1009;, - 3;1010,1005,1004;, - 3;1011,1005,1010;, - 3;1011,1012,1005;, - 3;1012,1006,1005;, - 3;1012,1013,1006;, - 3;1013,1007,1006;, - 3;1008,24,23;, - 3;35,1008,23;, - 3;1014,1008,35;, - 3;1014,1009,1008;, - 3;1015,1009,1014;, - 3;1015,1010,1009;, - 3;1016,1010,1015;, - 3;1016,1011,1010;, - 3;1017,1011,1016;, - 3;1017,1018,1011;, - 3;1018,1012,1011;, - 3;1018,1019,1012;, - 3;1019,1013,1012;, - 3;1014,35,41;, - 3;1014,41,1020;, - 3;1015,1014,1020;, - 3;1015,1020,1021;, - 3;1016,1015,1021;, - 3;1016,1021,1022;, - 3;1017,1016,1022;, - 3;1017,1022,1023;, - 3;1024,1017,1023;, - 3;1024,1018,1017;, - 3;1024,1025,1018;, - 3;1025,1019,1018;, - 3;1020,41,47;, - 3;1020,47,1026;, - 3;1021,1020,1026;, - 3;1021,1026,1027;, - 3;1022,1021,1027;, - 3;1022,1027,1028;, - 3;1023,1022,1028;, - 3;1023,1028,1029;, - 3;1030,1023,1029;, - 3;1024,1023,1030;, - 3;1031,1024,1030;, - 3;1031,1025,1024;, - 3;1026,47,53;, - 3;1026,53,1032;, - 3;1027,1026,1032;, - 3;1027,1032,1033;, - 3;1028,1027,1033;, - 3;1028,1033,1034;, - 3;1029,1028,1034;, - 3;1029,1034,1035;, - 3;1036,1029,1035;, - 3;1030,1029,1036;, - 3;1037,1030,1036;, - 3;1031,1030,1037;, - 3;1032,53,59;, - 3;1032,59,1038;, - 3;1033,1032,1038;, - 3;1033,1038,1039;, - 3;1034,1033,1039;, - 3;1034,1039,1040;, - 3;1035,1034,1040;, - 3;1035,1040,1041;, - 3;1042,1035,1041;, - 3;1036,1035,1042;, - 3;1043,1036,1042;, - 3;1037,1036,1043;, - 3;1038,59,65;, - 3;1038,65,1044;, - 3;1039,1038,1044;, - 3;1039,1044,1045;, - 3;1040,1039,1045;, - 3;1040,1045,1046;, - 3;1041,1040,1046;, - 3;1041,1046,1047;, - 3;1048,1041,1047;, - 3;1042,1041,1048;, - 3;1049,1042,1048;, - 3;1043,1042,1049;, - 3;1044,65,71;, - 3;1044,71,1050;, - 3;1045,1044,1050;, - 3;1045,1050,1051;, - 3;1046,1045,1051;, - 3;1046,1051,1052;, - 3;1047,1046,1052;, - 3;1047,1052,1053;, - 3;1054,1047,1053;, - 3;1048,1047,1054;, - 3;1055,1048,1054;, - 3;1049,1048,1055;, - 3;1050,71,77;, - 3;1050,77,1056;, - 3;1051,1050,1056;, - 3;1051,1056,1057;, - 3;1052,1051,1057;, - 3;1052,1057,1058;, - 3;1053,1052,1058;, - 3;1053,1058,1059;, - 3;1060,1053,1059;, - 3;1054,1053,1060;, - 3;1061,1054,1060;, - 3;1055,1054,1061;, - 3;1056,77,83;, - 3;1056,83,1062;, - 3;1057,1056,1062;, - 3;1057,1062,1063;, - 3;1058,1057,1063;, - 3;1058,1063,1064;, - 3;1059,1058,1064;, - 3;1059,1064,1065;, - 3;1066,1059,1065;, - 3;1060,1059,1066;, - 3;1067,1060,1066;, - 3;1061,1060,1067;, - 3;1062,83,89;, - 3;1062,89,1068;, - 3;1063,1062,1068;, - 3;1063,1068,1069;, - 3;1064,1063,1069;, - 3;1064,1069,1070;, - 3;1065,1064,1070;, - 3;1065,1070,1071;, - 3;1072,1065,1071;, - 3;1066,1065,1072;, - 3;1073,1066,1072;, - 3;1067,1066,1073;, - 3;1068,89,95;, - 3;1068,95,1074;, - 3;1069,1068,1074;, - 3;1069,1074,1075;, - 3;1070,1069,1075;, - 3;1070,1075,1076;, - 3;1071,1070,1076;, - 3;1071,1076,1077;, - 3;1078,1071,1077;, - 3;1072,1071,1078;, - 3;1079,1072,1078;, - 3;1073,1072,1079;, - 3;1074,95,101;, - 3;1074,101,1080;, - 3;1075,1074,1080;, - 3;1075,1080,1081;, - 3;1076,1075,1081;, - 3;1076,1081,1082;, - 3;1077,1076,1082;, - 3;1077,1082,1083;, - 3;1084,1077,1083;, - 3;1078,1077,1084;, - 3;1085,1078,1084;, - 3;1079,1078,1085;, - 3;1080,101,107;, - 3;1080,107,1086;, - 3;1081,1080,1086;, - 3;1081,1086,1087;, - 3;1082,1081,1087;, - 3;1082,1087,1088;, - 3;1083,1082,1088;, - 3;1083,1088,1089;, - 3;1090,1083,1089;, - 3;1084,1083,1090;, - 3;1091,1084,1090;, - 3;1085,1084,1091;, - 3;1086,107,113;, - 3;1086,113,1092;, - 3;1087,1086,1092;, - 3;1087,1092,1093;, - 3;1088,1087,1093;, - 3;1088,1093,1094;, - 3;1089,1088,1094;, - 3;1089,1094,1095;, - 3;1096,1089,1095;, - 3;1090,1089,1096;, - 3;1097,1090,1096;, - 3;1091,1090,1097;, - 3;1092,113,119;, - 3;1092,119,1098;, - 3;1093,1092,1098;, - 3;1093,1098,1099;, - 3;1094,1093,1099;, - 3;1094,1099,1100;, - 3;1095,1094,1100;, - 3;1095,1100,1101;, - 3;1102,1095,1101;, - 3;1096,1095,1102;, - 3;1103,1096,1102;, - 3;1097,1096,1103;, - 3;1098,119,125;, - 3;1098,125,1104;, - 3;1099,1098,1104;, - 3;1099,1104,1105;, - 3;1100,1099,1105;, - 3;1100,1105,1106;, - 3;1101,1100,1106;, - 3;1101,1106,1107;, - 3;1108,1101,1107;, - 3;1102,1101,1108;, - 3;1109,1102,1108;, - 3;1103,1102,1109;, - 3;1104,125,131;, - 3;1104,131,1110;, - 3;1105,1104,1110;, - 3;1105,1110,1111;, - 3;1106,1105,1111;, - 3;1106,1111,1112;, - 3;1107,1106,1112;, - 3;1107,1112,1113;, - 3;1114,1107,1113;, - 3;1108,1107,1114;, - 3;1115,1108,1114;, - 3;1109,1108,1115;, - 3;1110,131,137;, - 3;1110,137,1116;, - 3;1111,1110,1116;, - 3;1111,1116,1117;, - 3;1112,1111,1117;, - 3;1112,1117,1118;, - 3;1113,1112,1118;, - 3;1113,1118,1119;, - 3;1120,1113,1119;, - 3;1114,1113,1120;, - 3;1121,1114,1120;, - 3;1115,1114,1121;, - 3;1116,137,143;, - 3;1116,143,1122;, - 3;1117,1116,1122;, - 3;1117,1122,1123;, - 3;1118,1117,1123;, - 3;1118,1123,1124;, - 3;1119,1118,1124;, - 3;1119,1124,1125;, - 3;1126,1119,1125;, - 3;1120,1119,1126;, - 3;1127,1120,1126;, - 3;1121,1120,1127;, - 3;1122,143,149;, - 3;1122,149,183;, - 3;1123,1122,183;, - 3;1123,183,182;, - 3;1124,1123,182;, - 3;1124,182,189;, - 3;1125,1124,189;, - 3;1125,189,195;, - 3;1128,1125,195;, - 3;1126,1125,1128;, - 3;1129,1126,1128;, - 3;1127,1126,1129;, - 3;1130,1127,1129;, - 3;1131,1127,1130;, - 3;1131,1121,1127;, - 3;1132,1121,1131;, - 3;1132,1115,1121;, - 3;1128,195,201;, - 3;1133,1128,201;, - 3;1129,1128,1133;, - 3;1134,1129,1133;, - 3;1130,1129,1134;, - 3;1135,1130,1134;, - 3;1136,1130,1135;, - 3;1136,1131,1130;, - 3;1137,1131,1136;, - 3;1137,1132,1131;, - 3;1133,201,207;, - 3;1138,1133,207;, - 3;1134,1133,1138;, - 3;1139,1134,1138;, - 3;1135,1134,1139;, - 3;1140,1135,1139;, - 3;1141,1135,1140;, - 3;1141,1136,1135;, - 3;1142,1136,1141;, - 3;1142,1137,1136;, - 3;1138,207,213;, - 3;1143,1138,213;, - 3;1139,1138,1143;, - 3;1144,1139,1143;, - 3;1140,1139,1144;, - 3;1145,1140,1144;, - 3;1146,1140,1145;, - 3;1146,1141,1140;, - 3;1147,1141,1146;, - 3;1147,1142,1141;, - 3;1143,213,219;, - 3;1148,1143,219;, - 3;1144,1143,1148;, - 3;1149,1144,1148;, - 3;1145,1144,1149;, - 3;1150,1145,1149;, - 3;1151,1145,1150;, - 3;1151,1146,1145;, - 3;1152,1146,1151;, - 3;1152,1147,1146;, - 3;1148,219,225;, - 3;1153,1148,225;, - 3;1149,1148,1153;, - 3;1154,1149,1153;, - 3;1150,1149,1154;, - 3;1155,1150,1154;, - 3;1156,1150,1155;, - 3;1156,1151,1150;, - 3;1157,1151,1156;, - 3;1157,1152,1151;, - 3;1153,225,231;, - 3;1158,1153,231;, - 3;1154,1153,1158;, - 3;1159,1154,1158;, - 3;1155,1154,1159;, - 3;1160,1155,1159;, - 3;1161,1155,1160;, - 3;1161,1156,1155;, - 3;1162,1156,1161;, - 3;1162,1157,1156;, - 3;1158,231,237;, - 3;1163,1158,237;, - 3;1159,1158,1163;, - 3;1164,1159,1163;, - 3;1160,1159,1164;, - 3;1165,1160,1164;, - 3;1166,1160,1165;, - 3;1166,1161,1160;, - 3;1167,1161,1166;, - 3;1167,1162,1161;, - 3;1163,237,243;, - 3;1168,1163,243;, - 3;1164,1163,1168;, - 3;1169,1164,1168;, - 3;1165,1164,1169;, - 3;1170,1165,1169;, - 3;1171,1165,1170;, - 3;1171,1166,1165;, - 3;1172,1166,1171;, - 3;1172,1167,1166;, - 3;1168,243,249;, - 3;1173,1168,249;, - 3;1169,1168,1173;, - 3;1174,1169,1173;, - 3;1170,1169,1174;, - 3;1175,1170,1174;, - 3;1176,1170,1175;, - 3;1176,1171,1170;, - 3;1177,1171,1176;, - 3;1177,1172,1171;, - 3;1173,249,255;, - 3;1178,1173,255;, - 3;1174,1173,1178;, - 3;1179,1174,1178;, - 3;1175,1174,1179;, - 3;1180,1175,1179;, - 3;1181,1175,1180;, - 3;1181,1176,1175;, - 3;1182,1176,1181;, - 3;1182,1177,1176;, - 3;1178,255,261;, - 3;1183,1178,261;, - 3;1179,1178,1183;, - 3;1184,1179,1183;, - 3;1180,1179,1184;, - 3;1185,1180,1184;, - 3;1186,1180,1185;, - 3;1186,1181,1180;, - 3;1187,1181,1186;, - 3;1187,1182,1181;, - 3;1183,261,267;, - 3;1188,1183,267;, - 3;1184,1183,1188;, - 3;1189,1184,1188;, - 3;1185,1184,1189;, - 3;1190,1185,1189;, - 3;1191,1185,1190;, - 3;1191,1186,1185;, - 3;1192,1186,1191;, - 3;1192,1187,1186;, - 3;1188,267,273;, - 3;1193,1188,273;, - 3;1189,1188,1193;, - 3;1194,1189,1193;, - 3;1190,1189,1194;, - 3;1195,1190,1194;, - 3;1196,1190,1195;, - 3;1196,1191,1190;, - 3;1197,1191,1196;, - 3;1197,1192,1191;, - 3;1193,273,279;, - 3;1198,1193,279;, - 3;1194,1193,1198;, - 3;1199,1194,1198;, - 3;1195,1194,1199;, - 3;1200,1195,1199;, - 3;1201,1195,1200;, - 3;1201,1196,1195;, - 3;1202,1196,1201;, - 3;1202,1197,1196;, - 3;1198,279,285;, - 3;1203,1198,285;, - 3;1199,1198,1203;, - 3;1204,1199,1203;, - 3;1200,1199,1204;, - 3;1205,1200,1204;, - 3;1206,1200,1205;, - 3;1206,1201,1200;, - 3;1207,1201,1206;, - 3;1207,1202,1201;, - 3;1203,285,291;, - 3;1208,1203,291;, - 3;1204,1203,1208;, - 3;1209,1204,1208;, - 3;1205,1204,1209;, - 3;1210,1205,1209;, - 3;1211,1205,1210;, - 3;1211,1206,1205;, - 3;1212,1206,1211;, - 3;1212,1207,1206;, - 3;1208,291,297;, - 3;1213,1208,297;, - 3;1209,1208,1213;, - 3;1214,1209,1213;, - 3;1210,1209,1214;, - 3;1215,1210,1214;, - 3;1216,1210,1215;, - 3;1216,1211,1210;, - 3;1217,1211,1216;, - 3;1217,1212,1211;, - 3;1213,297,303;, - 3;1218,1213,303;, - 3;1214,1213,1218;, - 3;1219,1214,1218;, - 3;1215,1214,1219;, - 3;1220,1215,1219;, - 3;1221,1215,1220;, - 3;1221,1216,1215;, - 3;1222,1216,1221;, - 3;1222,1217,1216;, - 3;1218,303,309;, - 3;1223,1218,309;, - 3;1219,1218,1223;, - 3;1224,1219,1223;, - 3;1220,1219,1224;, - 3;1225,1220,1224;, - 3;1226,1220,1225;, - 3;1226,1221,1220;, - 3;1227,1221,1226;, - 3;1227,1222,1221;, - 3;1223,309,315;, - 3;1228,1223,315;, - 3;1224,1223,1228;, - 3;1229,1224,1228;, - 3;1225,1224,1229;, - 3;1230,1225,1229;, - 3;1231,1225,1230;, - 3;1231,1226,1225;, - 3;1232,1226,1231;, - 3;1232,1227,1226;, - 3;1228,315,321;, - 3;1233,1228,321;, - 3;1229,1228,1233;, - 3;1234,1229,1233;, - 3;1230,1229,1234;, - 3;1235,1230,1234;, - 3;1236,1230,1235;, - 3;1236,1231,1230;, - 3;1237,1231,1236;, - 3;1237,1232,1231;, - 3;1233,321,327;, - 3;1238,1233,327;, - 3;1234,1233,1238;, - 3;1239,1234,1238;, - 3;1235,1234,1239;, - 3;1240,1235,1239;, - 3;1241,1235,1240;, - 3;1241,1236,1235;, - 3;1242,1236,1241;, - 3;1242,1237,1236;, - 3;1238,327,333;, - 3;1243,1238,333;, - 3;1239,1238,1243;, - 3;1244,1239,1243;, - 3;1240,1239,1244;, - 3;1245,1240,1244;, - 3;1246,1240,1245;, - 3;1246,1241,1240;, - 3;1247,1241,1246;, - 3;1247,1242,1241;, - 3;1243,333,339;, - 3;1248,1243,339;, - 3;1244,1243,1248;, - 3;1249,1244,1248;, - 3;1245,1244,1249;, - 3;1250,1245,1249;, - 3;1251,1245,1250;, - 3;1251,1246,1245;, - 3;1252,1246,1251;, - 3;1252,1247,1246;, - 3;1248,339,345;, - 3;1253,1248,345;, - 3;1249,1248,1253;, - 3;1254,1249,1253;, - 3;1250,1249,1254;, - 3;1255,1250,1254;, - 3;1256,1250,1255;, - 3;1256,1251,1250;, - 3;1257,1251,1256;, - 3;1257,1252,1251;, - 3;1253,345,351;, - 3;1258,1253,351;, - 3;1254,1253,1258;, - 3;1259,1254,1258;, - 3;1255,1254,1259;, - 3;1260,1255,1259;, - 3;1261,1255,1260;, - 3;1261,1256,1255;, - 3;1262,1256,1261;, - 3;1262,1257,1256;, - 3;1258,351,357;, - 3;1263,1258,357;, - 3;1259,1258,1263;, - 3;1264,1259,1263;, - 3;1260,1259,1264;, - 3;1265,1260,1264;, - 3;1266,1260,1265;, - 3;1266,1261,1260;, - 3;1267,1261,1266;, - 3;1267,1262,1261;, - 3;1263,357,363;, - 3;1268,1263,363;, - 3;1264,1263,1268;, - 3;1269,1264,1268;, - 3;1265,1264,1269;, - 3;1270,1265,1269;, - 3;1271,1265,1270;, - 3;1271,1266,1265;, - 3;1272,1266,1271;, - 3;1272,1267,1266;, - 3;1268,363,369;, - 3;1273,1268,369;, - 3;1269,1268,1273;, - 3;1274,1269,1273;, - 3;1270,1269,1274;, - 3;1275,1270,1274;, - 3;1276,1270,1275;, - 3;1276,1271,1270;, - 3;1277,1271,1276;, - 3;1277,1272,1271;, - 3;1273,369,375;, - 3;1278,1273,375;, - 3;1274,1273,1278;, - 3;1279,1274,1278;, - 3;1275,1274,1279;, - 3;443,1275,1279;, - 3;448,1275,443;, - 3;448,1276,1275;, - 3;453,1276,448;, - 3;453,1277,1276;, - 3;1278,375,381;, - 3;1280,1278,381;, - 3;1279,1278,1280;, - 3;437,1279,1280;, - 3;443,1279,437;, - 3;1280,381,387;, - 3;438,1280,387;, - 3;437,1280,438;, - 3;438,387,393;, - 3;427,438,393;, - 3;427,393,399;, - 3;458,1277,453;, - 3;458,1281,1277;, - 3;1281,1272,1277;, - 3;1281,1282,1272;, - 3;1282,1267,1272;, - 3;1282,1283,1267;, - 3;1283,1262,1267;, - 3;463,1281,458;, - 3;463,1284,1281;, - 3;1284,1282,1281;, - 3;1284,1285,1282;, - 3;1285,1283,1282;, - 3;1285,1286,1283;, - 3;1286,1287,1283;, - 3;1283,1287,1262;, - 3;1287,1257,1262;, - 3;1287,1288,1257;, - 3;1288,1252,1257;, - 3;468,1284,463;, - 3;468,1289,1284;, - 3;1289,1285,1284;, - 3;1289,1290,1285;, - 3;1290,1286,1285;, - 3;1290,1291,1286;, - 3;1291,1292,1286;, - 3;1286,1292,1287;, - 3;1292,1288,1287;, - 3;1292,1293,1288;, - 3;1293,1294,1288;, - 3;1288,1294,1252;, - 3;1294,1247,1252;, - 3;473,1289,468;, - 3;473,1295,1289;, - 3;1295,1290,1289;, - 3;1295,1296,1290;, - 3;1296,1291,1290;, - 3;1296,1297,1291;, - 3;1297,1298,1291;, - 3;1291,1298,1292;, - 3;1298,1293,1292;, - 3;1298,1299,1293;, - 3;1299,1300,1293;, - 3;1293,1300,1294;, - 3;478,1295,473;, - 3;478,1301,1295;, - 3;1301,1296,1295;, - 3;1301,1302,1296;, - 3;1302,1297,1296;, - 3;1302,1303,1297;, - 3;1303,1304,1297;, - 3;1297,1304,1298;, - 3;1304,1299,1298;, - 3;1304,1305,1299;, - 3;1305,1306,1299;, - 3;1299,1306,1300;, - 3;483,1301,478;, - 3;483,1307,1301;, - 3;1307,1302,1301;, - 3;1307,1308,1302;, - 3;1308,1303,1302;, - 3;1308,1309,1303;, - 3;1309,1310,1303;, - 3;1303,1310,1304;, - 3;1310,1305,1304;, - 3;1310,1311,1305;, - 3;1311,1312,1305;, - 3;1305,1312,1306;, - 3;488,1307,483;, - 3;488,1313,1307;, - 3;1313,1308,1307;, - 3;1313,1314,1308;, - 3;1314,1309,1308;, - 3;1314,1315,1309;, - 3;1315,1316,1309;, - 3;1309,1316,1310;, - 3;1316,1311,1310;, - 3;1316,1317,1311;, - 3;1317,1318,1311;, - 3;1311,1318,1312;, - 3;493,1313,488;, - 3;493,1319,1313;, - 3;1319,1314,1313;, - 3;1319,1320,1314;, - 3;1320,1315,1314;, - 3;1320,1321,1315;, - 3;1321,1322,1315;, - 3;1315,1322,1316;, - 3;1322,1317,1316;, - 3;1322,1323,1317;, - 3;1323,1324,1317;, - 3;1317,1324,1318;, - 3;498,1319,493;, - 3;498,1325,1319;, - 3;1325,1320,1319;, - 3;1325,1326,1320;, - 3;1326,1321,1320;, - 3;1326,1327,1321;, - 3;1327,1328,1321;, - 3;1321,1328,1322;, - 3;1328,1323,1322;, - 3;1328,1329,1323;, - 3;1329,1330,1323;, - 3;1323,1330,1324;, - 3;503,1325,498;, - 3;503,515,1325;, - 3;515,1326,1325;, - 3;515,1331,1326;, - 3;1331,1327,1326;, - 3;1331,1332,1327;, - 3;1332,1333,1327;, - 3;1327,1333,1328;, - 3;1333,1329,1328;, - 3;1333,1334,1329;, - 3;1334,1335,1329;, - 3;1329,1335,1330;, - 3;514,1331,515;, - 3;514,1336,1331;, - 3;1336,1332,1331;, - 3;1336,1337,1332;, - 3;1337,1338,1332;, - 3;1332,1338,1333;, - 3;1338,1334,1333;, - 3;1338,1339,1334;, - 3;1339,1340,1334;, - 3;1334,1340,1335;, - 3;521,1336,514;, - 3;521,1341,1336;, - 3;1341,1337,1336;, - 3;1341,1342,1337;, - 3;1342,1343,1337;, - 3;1337,1343,1338;, - 3;1343,1339,1338;, - 3;1343,1344,1339;, - 3;1344,1345,1339;, - 3;1339,1345,1340;, - 3;1346,1341,521;, - 3;1346,1347,1341;, - 3;1347,1342,1341;, - 3;1347,1348,1342;, - 3;1348,1349,1342;, - 3;1342,1349,1343;, - 3;1349,1344,1343;, - 3;1349,1350,1344;, - 3;1350,1351,1344;, - 3;1344,1351,1345;, - 3;520,1346,521;, - 3;1352,1346,520;, - 3;1352,1353,1346;, - 3;1353,1347,1346;, - 3;1353,1354,1347;, - 3;1354,1348,1347;, - 3;1354,1355,1348;, - 3;1355,1356,1348;, - 3;1348,1356,1349;, - 3;1356,1350,1349;, - 3;519,1352,520;, - 3;519,527,1352;, - 3;1352,527,1357;, - 3;1352,1357,1353;, - 3;1353,1357,1358;, - 3;1353,1358,1354;, - 3;1354,1358,1359;, - 3;1354,1359,1355;, - 3;1355,1359,1360;, - 3;1355,1360,1361;, - 3;1355,1361,1356;, - 3;1361,1362,1356;, - 3;1356,1362,1350;, - 3;527,1363,1357;, - 3;1357,1363,1364;, - 3;1357,1364,1358;, - 3;1358,1364,1365;, - 3;1358,1365,1359;, - 3;1359,1365,1366;, - 3;1359,1366,1360;, - 3;1360,1366,1367;, - 3;1360,1367,1368;, - 3;1361,1360,1368;, - 3;527,526,1363;, - 3;526,1369,1363;, - 3;1363,1369,1370;, - 3;1363,1370,1364;, - 3;1364,1370,1371;, - 3;1364,1371,1365;, - 3;1365,1371,1372;, - 3;1365,1372,1366;, - 3;1366,1372,1373;, - 3;1366,1373,1367;, - 3;526,533,1369;, - 3;533,1374,1369;, - 3;1369,1374,1375;, - 3;1369,1375,1370;, - 3;1370,1375,1376;, - 3;1370,1376,1371;, - 3;1371,1376,1377;, - 3;1371,1377,1372;, - 3;1372,1377,1378;, - 3;1372,1378,1373;, - 3;533,538,1374;, - 3;538,1379,1374;, - 3;1374,1379,1380;, - 3;1374,1380,1375;, - 3;1375,1380,1381;, - 3;1375,1381,1376;, - 3;1376,1381,1382;, - 3;1376,1382,1377;, - 3;1377,1382,1383;, - 3;1377,1383,1378;, - 3;538,543,1379;, - 3;543,1384,1379;, - 3;1379,1384,1385;, - 3;1379,1385,1380;, - 3;1380,1385,1386;, - 3;1380,1386,1381;, - 3;1381,1386,1387;, - 3;1381,1387,1382;, - 3;1382,1387,1388;, - 3;1382,1388,1383;, - 3;543,548,1384;, - 3;548,1389,1384;, - 3;1384,1389,1390;, - 3;1384,1390,1385;, - 3;1385,1390,1391;, - 3;1385,1391,1386;, - 3;1386,1391,1392;, - 3;1386,1392,1387;, - 3;1387,1392,1393;, - 3;1387,1393,1388;, - 3;548,553,1389;, - 3;553,1394,1389;, - 3;1389,1394,1395;, - 3;1389,1395,1390;, - 3;1390,1395,1396;, - 3;1390,1396,1391;, - 3;1391,1396,1397;, - 3;1391,1397,1392;, - 3;1392,1397,1398;, - 3;1392,1398,1393;, - 3;553,558,1394;, - 3;558,1399,1394;, - 3;1394,1399,1400;, - 3;1394,1400,1395;, - 3;1395,1400,1401;, - 3;1395,1401,1396;, - 3;1396,1401,1402;, - 3;1396,1402,1397;, - 3;1397,1402,1403;, - 3;1397,1403,1398;, - 3;558,563,1399;, - 3;563,1404,1399;, - 3;1399,1404,1405;, - 3;1399,1405,1400;, - 3;1400,1405,1406;, - 3;1400,1406,1401;, - 3;1401,1406,1407;, - 3;1401,1407,1402;, - 3;1402,1407,1408;, - 3;1402,1408,1403;, - 3;563,568,1404;, - 3;568,1409,1404;, - 3;1404,1409,1410;, - 3;1404,1410,1405;, - 3;1405,1410,1411;, - 3;1405,1411,1406;, - 3;1406,1411,1412;, - 3;1406,1412,1407;, - 3;1407,1412,1413;, - 3;1407,1413,1408;, - 3;568,573,1409;, - 3;573,1414,1409;, - 3;1409,1414,1415;, - 3;1409,1415,1410;, - 3;1410,1415,1416;, - 3;1410,1416,1411;, - 3;1411,1416,1417;, - 3;1411,1417,1412;, - 3;1412,1417,1418;, - 3;1412,1418,1413;, - 3;573,578,1414;, - 3;578,1419,1414;, - 3;1414,1419,1420;, - 3;1414,1420,1415;, - 3;1415,1420,1421;, - 3;1415,1421,1416;, - 3;1416,1421,1422;, - 3;1416,1422,1417;, - 3;1417,1422,1423;, - 3;1417,1423,1418;, - 3;578,583,1419;, - 3;583,1424,1419;, - 3;1419,1424,1425;, - 3;1419,1425,1420;, - 3;1420,1425,1426;, - 3;1420,1426,1421;, - 3;1421,1426,1427;, - 3;1421,1427,1422;, - 3;1422,1427,1428;, - 3;1422,1428,1423;, - 3;583,588,1424;, - 3;588,1429,1424;, - 3;1424,1429,1430;, - 3;1424,1430,1425;, - 3;1425,1430,1431;, - 3;1425,1431,1426;, - 3;1426,1431,1432;, - 3;1426,1432,1427;, - 3;1427,1432,1433;, - 3;1427,1433,1428;, - 3;588,593,1429;, - 3;593,1434,1429;, - 3;1429,1434,1435;, - 3;1429,1435,1430;, - 3;1430,1435,1436;, - 3;1430,1436,1431;, - 3;1431,1436,1437;, - 3;1431,1437,1432;, - 3;1432,1437,1438;, - 3;1432,1438,1433;, - 3;593,598,1434;, - 3;598,1439,1434;, - 3;1434,1439,1440;, - 3;1434,1440,1435;, - 3;1435,1440,1441;, - 3;1435,1441,1436;, - 3;1436,1441,1442;, - 3;1436,1442,1437;, - 3;1437,1442,1443;, - 3;1437,1443,1438;, - 3;598,603,1439;, - 3;603,656,1439;, - 3;1439,656,663;, - 3;1439,663,1440;, - 3;1440,663,670;, - 3;1440,670,1441;, - 3;1441,670,677;, - 3;1441,677,1442;, - 3;1442,677,684;, - 3;1442,684,1443;, - 3;1443,684,691;, - 3;1443,691,1444;, - 3;1438,1443,1444;, - 3;1438,1444,1445;, - 3;1433,1438,1445;, - 3;1433,1445,1446;, - 3;1428,1433,1446;, - 3;1444,691,698;, - 3;1444,698,1447;, - 3;1445,1444,1447;, - 3;1445,1447,1448;, - 3;1446,1445,1448;, - 3;1446,1448,1449;, - 3;1450,1446,1449;, - 3;1428,1446,1450;, - 3;1423,1428,1450;, - 3;1423,1450,1451;, - 3;1418,1423,1451;, - 3;1447,698,705;, - 3;1447,705,1452;, - 3;1448,1447,1452;, - 3;1448,1452,1453;, - 3;1449,1448,1453;, - 3;1449,1453,1454;, - 3;1455,1449,1454;, - 3;1450,1449,1455;, - 3;1451,1450,1455;, - 3;1451,1455,1456;, - 3;1457,1451,1456;, - 3;1418,1451,1457;, - 3;1413,1418,1457;, - 3;1452,705,712;, - 3;1452,712,1458;, - 3;1453,1452,1458;, - 3;1453,1458,1459;, - 3;1454,1453,1459;, - 3;1454,1459,1460;, - 3;1461,1454,1460;, - 3;1455,1454,1461;, - 3;1456,1455,1461;, - 3;1456,1461,1462;, - 3;1463,1456,1462;, - 3;1457,1456,1463;, - 3;1458,712,719;, - 3;1458,719,1464;, - 3;1459,1458,1464;, - 3;1459,1464,1465;, - 3;1460,1459,1465;, - 3;1460,1465,1466;, - 3;1467,1460,1466;, - 3;1461,1460,1467;, - 3;1462,1461,1467;, - 3;1462,1467,1468;, - 3;1469,1462,1468;, - 3;1463,1462,1469;, - 3;1464,719,726;, - 3;1464,726,1470;, - 3;1465,1464,1470;, - 3;1465,1470,1471;, - 3;1466,1465,1471;, - 3;1466,1471,1472;, - 3;1473,1466,1472;, - 3;1467,1466,1473;, - 3;1468,1467,1473;, - 3;1468,1473,1474;, - 3;1475,1468,1474;, - 3;1469,1468,1475;, - 3;1470,726,733;, - 3;1470,733,1476;, - 3;1471,1470,1476;, - 3;1471,1476,1477;, - 3;1472,1471,1477;, - 3;1472,1477,1478;, - 3;1479,1472,1478;, - 3;1473,1472,1479;, - 3;1474,1473,1479;, - 3;1474,1479,1480;, - 3;1481,1474,1480;, - 3;1475,1474,1481;, - 3;1476,733,740;, - 3;1476,740,1482;, - 3;1477,1476,1482;, - 3;1477,1482,1483;, - 3;1478,1477,1483;, - 3;1478,1483,1484;, - 3;1485,1478,1484;, - 3;1479,1478,1485;, - 3;1480,1479,1485;, - 3;1480,1485,1486;, - 3;1487,1480,1486;, - 3;1481,1480,1487;, - 3;1482,740,747;, - 3;1482,747,1488;, - 3;1483,1482,1488;, - 3;1483,1488,1489;, - 3;1484,1483,1489;, - 3;1484,1489,1490;, - 3;1491,1484,1490;, - 3;1485,1484,1491;, - 3;1486,1485,1491;, - 3;1486,1491,1492;, - 3;1493,1486,1492;, - 3;1487,1486,1493;, - 3;1488,747,754;, - 3;1488,754,1494;, - 3;1489,1488,1494;, - 3;1489,1494,1495;, - 3;1490,1489,1495;, - 3;1490,1495,1496;, - 3;1497,1490,1496;, - 3;1491,1490,1497;, - 3;1492,1491,1497;, - 3;1492,1497,1498;, - 3;1499,1492,1498;, - 3;1493,1492,1499;, - 3;1494,754,761;, - 3;1494,761,1500;, - 3;1495,1494,1500;, - 3;1495,1500,1501;, - 3;1496,1495,1501;, - 3;1496,1501,1502;, - 3;1503,1496,1502;, - 3;1497,1496,1503;, - 3;1498,1497,1503;, - 3;1498,1503,1504;, - 3;1505,1498,1504;, - 3;1499,1498,1505;, - 3;1500,761,768;, - 3;1500,768,1506;, - 3;1501,1500,1506;, - 3;1501,1506,1507;, - 3;1502,1501,1507;, - 3;1502,1507,1508;, - 3;1509,1502,1508;, - 3;1503,1502,1509;, - 3;1504,1503,1509;, - 3;1504,1509,1510;, - 3;1511,1504,1510;, - 3;1505,1504,1511;, - 3;1506,768,775;, - 3;1506,775,1512;, - 3;1507,1506,1512;, - 3;1507,1512,1513;, - 3;1508,1507,1513;, - 3;1508,1513,1514;, - 3;1515,1508,1514;, - 3;1509,1508,1515;, - 3;1510,1509,1515;, - 3;1510,1515,1516;, - 3;1517,1510,1516;, - 3;1511,1510,1517;, - 3;1512,775,782;, - 3;1512,782,1518;, - 3;1513,1512,1518;, - 3;1513,1518,1519;, - 3;1514,1513,1519;, - 3;1514,1519,1520;, - 3;1521,1514,1520;, - 3;1515,1514,1521;, - 3;1516,1515,1521;, - 3;1516,1521,1522;, - 3;1523,1516,1522;, - 3;1517,1516,1523;, - 3;1518,782,789;, - 3;1518,789,1524;, - 3;1519,1518,1524;, - 3;1519,1524,1525;, - 3;1520,1519,1525;, - 3;1520,1525,1526;, - 3;1527,1520,1526;, - 3;1521,1520,1527;, - 3;1522,1521,1527;, - 3;1522,1527,1528;, - 3;1529,1522,1528;, - 3;1523,1522,1529;, - 3;1524,789,796;, - 3;1524,796,1530;, - 3;1525,1524,1530;, - 3;1525,1530,1531;, - 3;1526,1525,1531;, - 3;1526,1531,1532;, - 3;1533,1526,1532;, - 3;1527,1526,1533;, - 3;1528,1527,1533;, - 3;1528,1533,1534;, - 3;1535,1528,1534;, - 3;1529,1528,1535;, - 3;1530,796,803;, - 3;1530,803,1536;, - 3;1531,1530,1536;, - 3;1531,1536,1537;, - 3;1532,1531,1537;, - 3;1532,1537,1538;, - 3;1539,1532,1538;, - 3;1533,1532,1539;, - 3;1534,1533,1539;, - 3;1534,1539,1540;, - 3;1541,1534,1540;, - 3;1535,1534,1541;, - 3;1536,803,810;, - 3;1536,810,1542;, - 3;1537,1536,1542;, - 3;1537,1542,1543;, - 3;1538,1537,1543;, - 3;1538,1543,1544;, - 3;1545,1538,1544;, - 3;1539,1538,1545;, - 3;1540,1539,1545;, - 3;1540,1545,1546;, - 3;1547,1540,1546;, - 3;1541,1540,1547;, - 3;1542,810,817;, - 3;1542,817,1548;, - 3;1543,1542,1548;, - 3;1543,1548,1549;, - 3;1544,1543,1549;, - 3;1544,1549,1550;, - 3;1551,1544,1550;, - 3;1545,1544,1551;, - 3;1546,1545,1551;, - 3;1546,1551,1552;, - 3;1553,1546,1552;, - 3;1547,1546,1553;, - 3;1548,817,824;, - 3;1548,824,1554;, - 3;1549,1548,1554;, - 3;1549,1554,1555;, - 3;1550,1549,1555;, - 3;1550,1555,1556;, - 3;1557,1550,1556;, - 3;1551,1550,1557;, - 3;1552,1551,1557;, - 3;1552,1557,1558;, - 3;1559,1552,1558;, - 3;1553,1552,1559;, - 3;1554,824,831;, - 3;1554,831,1560;, - 3;1555,1554,1560;, - 3;1555,1560,1561;, - 3;1556,1555,1561;, - 3;1556,1561,1562;, - 3;1563,1556,1562;, - 3;1557,1556,1563;, - 3;1558,1557,1563;, - 3;1558,1563,1564;, - 3;1565,1558,1564;, - 3;1559,1558,1565;, - 3;1560,831,838;, - 3;1560,838,1566;, - 3;1561,1560,1566;, - 3;1561,1566,1567;, - 3;1562,1561,1567;, - 3;1562,1567,1568;, - 3;1569,1562,1568;, - 3;1563,1562,1569;, - 3;1564,1563,1569;, - 3;1564,1569,1570;, - 3;1571,1564,1570;, - 3;1565,1564,1571;, - 3;1566,838,845;, - 3;1566,845,1572;, - 3;1567,1566,1572;, - 3;1567,1572,1573;, - 3;1568,1567,1573;, - 3;1568,1573,1574;, - 3;1575,1568,1574;, - 3;1569,1568,1575;, - 3;1570,1569,1575;, - 3;1570,1575,1576;, - 3;1577,1570,1576;, - 3;1571,1570,1577;, - 3;1572,845,852;, - 3;1572,852,1578;, - 3;1573,1572,1578;, - 3;1573,1578,1579;, - 3;1574,1573,1579;, - 3;1574,1579,1580;, - 3;1581,1574,1580;, - 3;1575,1574,1581;, - 3;1576,1575,1581;, - 3;1576,1581,1582;, - 3;1583,1576,1582;, - 3;1577,1576,1583;, - 3;1578,852,859;, - 3;1578,859,1584;, - 3;1579,1578,1584;, - 3;1579,1584,1585;, - 3;1580,1579,1585;, - 3;1580,1585,1586;, - 3;1587,1580,1586;, - 3;1581,1580,1587;, - 3;1582,1581,1587;, - 3;1582,1587,1588;, - 3;1589,1582,1588;, - 3;1583,1582,1589;, - 3;1584,859,866;, - 3;1584,866,1590;, - 3;1585,1584,1590;, - 3;1585,1590,1591;, - 3;1586,1585,1591;, - 3;1586,1591,1592;, - 3;1593,1586,1592;, - 3;1587,1586,1593;, - 3;1588,1587,1593;, - 3;1588,1593,1594;, - 3;1595,1588,1594;, - 3;1589,1588,1595;, - 3;1590,866,873;, - 3;1590,873,1596;, - 3;1591,1590,1596;, - 3;1591,1596,1597;, - 3;1592,1591,1597;, - 3;1592,1597,1598;, - 3;1599,1592,1598;, - 3;1593,1592,1599;, - 3;1594,1593,1599;, - 3;1594,1599,1600;, - 3;1601,1594,1600;, - 3;1595,1594,1601;, - 3;1596,873,880;, - 3;1596,880,1602;, - 3;1597,1596,1602;, - 3;1597,1602,1603;, - 3;1598,1597,1603;, - 3;1598,1603,1604;, - 3;1605,1598,1604;, - 3;1599,1598,1605;, - 3;1600,1599,1605;, - 3;1600,1605,1606;, - 3;1607,1600,1606;, - 3;1601,1600,1607;, - 3;1602,880,887;, - 3;1602,887,1608;, - 3;1603,1602,1608;, - 3;1603,1608,1609;, - 3;1604,1603,1609;, - 3;1604,1609,1610;, - 3;1611,1604,1610;, - 3;1605,1604,1611;, - 3;1606,1605,1611;, - 3;1606,1611,1612;, - 3;1613,1606,1612;, - 3;1607,1606,1613;, - 3;1608,887,894;, - 3;1608,894,1614;, - 3;1609,1608,1614;, - 3;1609,1614,1615;, - 3;1610,1609,1615;, - 3;1610,1615,1616;, - 3;1617,1610,1616;, - 3;1611,1610,1617;, - 3;1612,1611,1617;, - 3;1612,1617,1618;, - 3;1619,1612,1618;, - 3;1613,1612,1619;, - 3;1614,894,901;, - 3;1614,901,1620;, - 3;1615,1614,1620;, - 3;1615,1620,1621;, - 3;1616,1615,1621;, - 3;1616,1621,1622;, - 3;1623,1616,1622;, - 3;1617,1616,1623;, - 3;1618,1617,1623;, - 3;1618,1623,1624;, - 3;1625,1618,1624;, - 3;1619,1618,1625;, - 3;1620,901,908;, - 3;1620,908,1626;, - 3;1621,1620,1626;, - 3;1621,1626,1627;, - 3;1622,1621,1627;, - 3;1622,1627,1628;, - 3;1629,1622,1628;, - 3;1623,1622,1629;, - 3;1624,1623,1629;, - 3;1624,1629,1630;, - 3;1631,1624,1630;, - 3;1625,1624,1631;, - 3;1626,908,915;, - 3;1626,915,940;, - 3;1627,1626,940;, - 3;1627,940,939;, - 3;1628,1627,939;, - 3;1628,939,945;, - 3;1632,1628,945;, - 3;1629,1628,1632;, - 3;1630,1629,1632;, - 3;1630,1632,1633;, - 3;1634,1630,1633;, - 3;1631,1630,1634;, - 3;1635,1631,1634;, - 3;1636,1631,1635;, - 3;1636,1625,1631;, - 3;1632,945,950;, - 3;1633,1632,950;, - 3;1633,950,955;, - 3;1637,1633,955;, - 3;1634,1633,1637;, - 3;1638,1634,1637;, - 3;1635,1634,1638;, - 3;1639,1635,1638;, - 3;1640,1635,1639;, - 3;1640,1636,1635;, - 3;1641,1636,1640;, - 3;1641,1642,1636;, - 3;1642,1625,1636;, - 3;1642,1619,1625;, - 3;1637,955,960;, - 3;1643,1637,960;, - 3;1638,1637,1643;, - 3;1644,1638,1643;, - 3;1639,1638,1644;, - 3;1645,1639,1644;, - 3;1646,1639,1645;, - 3;1646,1640,1639;, - 3;1647,1640,1646;, - 3;1647,1641,1640;, - 3;1643,960,965;, - 3;1648,1643,965;, - 3;1644,1643,1648;, - 3;1649,1644,1648;, - 3;1645,1644,1649;, - 3;1650,1645,1649;, - 3;1651,1645,1650;, - 3;1651,1646,1645;, - 3;1652,1646,1651;, - 3;1652,1647,1646;, - 3;1648,965,970;, - 3;1653,1648,970;, - 3;1649,1648,1653;, - 3;1654,1649,1653;, - 3;1650,1649,1654;, - 3;1655,1650,1654;, - 3;1656,1650,1655;, - 3;1656,1651,1650;, - 3;1657,1651,1656;, - 3;1657,1652,1651;, - 3;1653,970,975;, - 3;1658,1653,975;, - 3;1654,1653,1658;, - 3;1659,1654,1658;, - 3;1655,1654,1659;, - 3;1660,1655,1659;, - 3;1661,1655,1660;, - 3;1661,1656,1655;, - 3;1662,1656,1661;, - 3;1662,1657,1656;, - 3;1658,975,980;, - 3;1663,1658,980;, - 3;1659,1658,1663;, - 3;1664,1659,1663;, - 3;1660,1659,1664;, - 3;1665,1660,1664;, - 3;1666,1660,1665;, - 3;1666,1661,1660;, - 3;1667,1661,1666;, - 3;1667,1662,1661;, - 3;1663,980,985;, - 3;997,1663,985;, - 3;1664,1663,997;, - 3;1002,1664,997;, - 3;1665,1664,1002;, - 3;1007,1665,1002;, - 3;1668,1665,1007;, - 3;1668,1666,1665;, - 3;1669,1666,1668;, - 3;1669,1667,1666;, - 3;1670,1667,1669;, - 3;1670,1671,1667;, - 3;1671,1662,1667;, - 3;1671,1672,1662;, - 3;1672,1657,1662;, - 3;1013,1668,1007;, - 3;1673,1668,1013;, - 3;1673,1669,1668;, - 3;1674,1669,1673;, - 3;1674,1670,1669;, - 3;1675,1670,1674;, - 3;1675,1676,1670;, - 3;1676,1671,1670;, - 3;1676,1677,1671;, - 3;1677,1672,1671;, - 3;1019,1673,1013;, - 3;1678,1673,1019;, - 3;1678,1674,1673;, - 3;1679,1674,1678;, - 3;1679,1675,1674;, - 3;1680,1675,1679;, - 3;1680,1681,1675;, - 3;1681,1676,1675;, - 3;1681,1682,1676;, - 3;1682,1677,1676;, - 3;1025,1678,1019;, - 3;1683,1678,1025;, - 3;1683,1679,1678;, - 3;1684,1679,1683;, - 3;1684,1680,1679;, - 3;1685,1680,1684;, - 3;1685,1686,1680;, - 3;1686,1681,1680;, - 3;1686,1687,1681;, - 3;1687,1682,1681;, - 3;1031,1683,1025;, - 3;1688,1683,1031;, - 3;1688,1684,1683;, - 3;1689,1684,1688;, - 3;1689,1685,1684;, - 3;1690,1685,1689;, - 3;1690,1691,1685;, - 3;1691,1686,1685;, - 3;1691,1692,1686;, - 3;1692,1687,1686;, - 3;1688,1031,1037;, - 3;1688,1037,1693;, - 3;1689,1688,1693;, - 3;1689,1693,1694;, - 3;1690,1689,1694;, - 3;1690,1694,1695;, - 3;1696,1690,1695;, - 3;1696,1691,1690;, - 3;1696,1697,1691;, - 3;1697,1692,1691;, - 3;1693,1037,1043;, - 3;1693,1043,1698;, - 3;1694,1693,1698;, - 3;1694,1698,1699;, - 3;1695,1694,1699;, - 3;1695,1699,1700;, - 3;1701,1695,1700;, - 3;1696,1695,1701;, - 3;1702,1696,1701;, - 3;1702,1697,1696;, - 3;1698,1043,1049;, - 3;1698,1049,1703;, - 3;1699,1698,1703;, - 3;1699,1703,1704;, - 3;1700,1699,1704;, - 3;1700,1704,1705;, - 3;1706,1700,1705;, - 3;1701,1700,1706;, - 3;1707,1701,1706;, - 3;1702,1701,1707;, - 3;1703,1049,1055;, - 3;1703,1055,1708;, - 3;1704,1703,1708;, - 3;1704,1708,1709;, - 3;1705,1704,1709;, - 3;1705,1709,1710;, - 3;1711,1705,1710;, - 3;1706,1705,1711;, - 3;1712,1706,1711;, - 3;1707,1706,1712;, - 3;1708,1055,1061;, - 3;1708,1061,1713;, - 3;1709,1708,1713;, - 3;1709,1713,1714;, - 3;1710,1709,1714;, - 3;1710,1714,1715;, - 3;1716,1710,1715;, - 3;1711,1710,1716;, - 3;1717,1711,1716;, - 3;1712,1711,1717;, - 3;1713,1061,1067;, - 3;1713,1067,1718;, - 3;1714,1713,1718;, - 3;1714,1718,1719;, - 3;1715,1714,1719;, - 3;1715,1719,1720;, - 3;1721,1715,1720;, - 3;1716,1715,1721;, - 3;1722,1716,1721;, - 3;1717,1716,1722;, - 3;1718,1067,1073;, - 3;1718,1073,1723;, - 3;1719,1718,1723;, - 3;1719,1723,1724;, - 3;1720,1719,1724;, - 3;1720,1724,1725;, - 3;1726,1720,1725;, - 3;1721,1720,1726;, - 3;1727,1721,1726;, - 3;1722,1721,1727;, - 3;1723,1073,1079;, - 3;1723,1079,1728;, - 3;1724,1723,1728;, - 3;1724,1728,1729;, - 3;1725,1724,1729;, - 3;1725,1729,1730;, - 3;1731,1725,1730;, - 3;1726,1725,1731;, - 3;1732,1726,1731;, - 3;1727,1726,1732;, - 3;1728,1079,1085;, - 3;1728,1085,1733;, - 3;1729,1728,1733;, - 3;1729,1733,1734;, - 3;1730,1729,1734;, - 3;1730,1734,1735;, - 3;1736,1730,1735;, - 3;1731,1730,1736;, - 3;1737,1731,1736;, - 3;1732,1731,1737;, - 3;1733,1085,1091;, - 3;1733,1091,1738;, - 3;1734,1733,1738;, - 3;1734,1738,1739;, - 3;1735,1734,1739;, - 3;1735,1739,1740;, - 3;1741,1735,1740;, - 3;1736,1735,1741;, - 3;1742,1736,1741;, - 3;1737,1736,1742;, - 3;1738,1091,1097;, - 3;1738,1097,1743;, - 3;1739,1738,1743;, - 3;1739,1743,1744;, - 3;1740,1739,1744;, - 3;1740,1744,1745;, - 3;1746,1740,1745;, - 3;1741,1740,1746;, - 3;1747,1741,1746;, - 3;1742,1741,1747;, - 3;1743,1097,1103;, - 3;1743,1103,1748;, - 3;1744,1743,1748;, - 3;1744,1748,1749;, - 3;1745,1744,1749;, - 3;1745,1749,1750;, - 3;1751,1745,1750;, - 3;1746,1745,1751;, - 3;1752,1746,1751;, - 3;1747,1746,1752;, - 3;1748,1103,1109;, - 3;1748,1109,1753;, - 3;1749,1748,1753;, - 3;1749,1753,1754;, - 3;1750,1749,1754;, - 3;1750,1754,1755;, - 3;1756,1750,1755;, - 3;1751,1750,1756;, - 3;1757,1751,1756;, - 3;1752,1751,1757;, - 3;1753,1109,1115;, - 3;1753,1115,1132;, - 3;1754,1753,1132;, - 3;1754,1132,1137;, - 3;1755,1754,1137;, - 3;1755,1137,1142;, - 3;1758,1755,1142;, - 3;1756,1755,1758;, - 3;1759,1756,1758;, - 3;1757,1756,1759;, - 3;1760,1757,1759;, - 3;1761,1757,1760;, - 3;1761,1752,1757;, - 3;1762,1752,1761;, - 3;1762,1747,1752;, - 3;1758,1142,1147;, - 3;1763,1758,1147;, - 3;1759,1758,1763;, - 3;1764,1759,1763;, - 3;1760,1759,1764;, - 3;1765,1760,1764;, - 3;1766,1760,1765;, - 3;1766,1761,1760;, - 3;1767,1761,1766;, - 3;1767,1762,1761;, - 3;1763,1147,1152;, - 3;1768,1763,1152;, - 3;1764,1763,1768;, - 3;1769,1764,1768;, - 3;1765,1764,1769;, - 3;1770,1765,1769;, - 3;1771,1765,1770;, - 3;1771,1766,1765;, - 3;1772,1766,1771;, - 3;1772,1767,1766;, - 3;1768,1152,1157;, - 3;1773,1768,1157;, - 3;1769,1768,1773;, - 3;1774,1769,1773;, - 3;1770,1769,1774;, - 3;1775,1770,1774;, - 3;1776,1770,1775;, - 3;1776,1771,1770;, - 3;1777,1771,1776;, - 3;1777,1772,1771;, - 3;1773,1157,1162;, - 3;1778,1773,1162;, - 3;1774,1773,1778;, - 3;1779,1774,1778;, - 3;1775,1774,1779;, - 3;1780,1775,1779;, - 3;1781,1775,1780;, - 3;1781,1776,1775;, - 3;1782,1776,1781;, - 3;1782,1777,1776;, - 3;1778,1162,1167;, - 3;1783,1778,1167;, - 3;1779,1778,1783;, - 3;1784,1779,1783;, - 3;1780,1779,1784;, - 3;1785,1780,1784;, - 3;1786,1780,1785;, - 3;1786,1781,1780;, - 3;1787,1781,1786;, - 3;1787,1782,1781;, - 3;1783,1167,1172;, - 3;1788,1783,1172;, - 3;1784,1783,1788;, - 3;1789,1784,1788;, - 3;1785,1784,1789;, - 3;1790,1785,1789;, - 3;1791,1785,1790;, - 3;1791,1786,1785;, - 3;1792,1786,1791;, - 3;1792,1787,1786;, - 3;1788,1172,1177;, - 3;1793,1788,1177;, - 3;1789,1788,1793;, - 3;1794,1789,1793;, - 3;1790,1789,1794;, - 3;1795,1790,1794;, - 3;1796,1790,1795;, - 3;1796,1791,1790;, - 3;1797,1791,1796;, - 3;1797,1792,1791;, - 3;1793,1177,1182;, - 3;1798,1793,1182;, - 3;1794,1793,1798;, - 3;1799,1794,1798;, - 3;1795,1794,1799;, - 3;1800,1795,1799;, - 3;1801,1795,1800;, - 3;1801,1796,1795;, - 3;1802,1796,1801;, - 3;1802,1797,1796;, - 3;1798,1182,1187;, - 3;1803,1798,1187;, - 3;1799,1798,1803;, - 3;1804,1799,1803;, - 3;1800,1799,1804;, - 3;1805,1800,1804;, - 3;1806,1800,1805;, - 3;1806,1801,1800;, - 3;1807,1801,1806;, - 3;1807,1802,1801;, - 3;1803,1187,1192;, - 3;1808,1803,1192;, - 3;1804,1803,1808;, - 3;1809,1804,1808;, - 3;1805,1804,1809;, - 3;1810,1805,1809;, - 3;1811,1805,1810;, - 3;1811,1806,1805;, - 3;1812,1806,1811;, - 3;1812,1807,1806;, - 3;1808,1192,1197;, - 3;1813,1808,1197;, - 3;1809,1808,1813;, - 3;1814,1809,1813;, - 3;1810,1809,1814;, - 3;1815,1810,1814;, - 3;1816,1810,1815;, - 3;1816,1811,1810;, - 3;1817,1811,1816;, - 3;1817,1812,1811;, - 3;1813,1197,1202;, - 3;1818,1813,1202;, - 3;1814,1813,1818;, - 3;1819,1814,1818;, - 3;1815,1814,1819;, - 3;1820,1815,1819;, - 3;1821,1815,1820;, - 3;1821,1816,1815;, - 3;1822,1816,1821;, - 3;1822,1817,1816;, - 3;1818,1202,1207;, - 3;1823,1818,1207;, - 3;1819,1818,1823;, - 3;1824,1819,1823;, - 3;1820,1819,1824;, - 3;1825,1820,1824;, - 3;1826,1820,1825;, - 3;1826,1821,1820;, - 3;1827,1821,1826;, - 3;1827,1822,1821;, - 3;1823,1207,1212;, - 3;1828,1823,1212;, - 3;1824,1823,1828;, - 3;1829,1824,1828;, - 3;1825,1824,1829;, - 3;1830,1825,1829;, - 3;1831,1825,1830;, - 3;1831,1826,1825;, - 3;1832,1826,1831;, - 3;1832,1827,1826;, - 3;1828,1212,1217;, - 3;1833,1828,1217;, - 3;1829,1828,1833;, - 3;1834,1829,1833;, - 3;1830,1829,1834;, - 3;1835,1830,1834;, - 3;1836,1830,1835;, - 3;1836,1831,1830;, - 3;1837,1831,1836;, - 3;1837,1832,1831;, - 3;1833,1217,1222;, - 3;1838,1833,1222;, - 3;1834,1833,1838;, - 3;1839,1834,1838;, - 3;1835,1834,1839;, - 3;1840,1835,1839;, - 3;1841,1835,1840;, - 3;1841,1836,1835;, - 3;1842,1836,1841;, - 3;1842,1837,1836;, - 3;1838,1222,1227;, - 3;1843,1838,1227;, - 3;1839,1838,1843;, - 3;1844,1839,1843;, - 3;1840,1839,1844;, - 3;1845,1840,1844;, - 3;1846,1840,1845;, - 3;1846,1841,1840;, - 3;1847,1841,1846;, - 3;1847,1842,1841;, - 3;1843,1227,1232;, - 3;1848,1843,1232;, - 3;1844,1843,1848;, - 3;1849,1844,1848;, - 3;1845,1844,1849;, - 3;1850,1845,1849;, - 3;1851,1845,1850;, - 3;1851,1846,1845;, - 3;1852,1846,1851;, - 3;1852,1847,1846;, - 3;1848,1232,1237;, - 3;1853,1848,1237;, - 3;1849,1848,1853;, - 3;1854,1849,1853;, - 3;1850,1849,1854;, - 3;1306,1850,1854;, - 3;1312,1850,1306;, - 3;1312,1851,1850;, - 3;1318,1851,1312;, - 3;1318,1852,1851;, - 3;1853,1237,1242;, - 3;1855,1853,1242;, - 3;1854,1853,1855;, - 3;1300,1854,1855;, - 3;1306,1854,1300;, - 3;1855,1242,1247;, - 3;1294,1855,1247;, - 3;1300,1855,1294;, - 3;1324,1852,1318;, - 3;1324,1856,1852;, - 3;1856,1847,1852;, - 3;1856,1857,1847;, - 3;1857,1842,1847;, - 3;1857,1858,1842;, - 3;1858,1837,1842;, - 3;1330,1856,1324;, - 3;1330,1859,1856;, - 3;1859,1857,1856;, - 3;1859,1860,1857;, - 3;1860,1858,1857;, - 3;1860,1861,1858;, - 3;1861,1862,1858;, - 3;1858,1862,1837;, - 3;1862,1832,1837;, - 3;1862,1863,1832;, - 3;1863,1827,1832;, - 3;1335,1859,1330;, - 3;1335,1864,1859;, - 3;1864,1860,1859;, - 3;1864,1865,1860;, - 3;1865,1861,1860;, - 3;1865,1866,1861;, - 3;1866,1867,1861;, - 3;1861,1867,1862;, - 3;1867,1863,1862;, - 3;1867,1868,1863;, - 3;1868,1869,1863;, - 3;1863,1869,1827;, - 3;1869,1822,1827;, - 3;1340,1864,1335;, - 3;1340,1870,1864;, - 3;1870,1865,1864;, - 3;1870,1871,1865;, - 3;1871,1866,1865;, - 3;1871,1872,1866;, - 3;1872,1873,1866;, - 3;1866,1873,1867;, - 3;1873,1868,1867;, - 3;1873,1874,1868;, - 3;1874,1875,1868;, - 3;1868,1875,1869;, - 3;1345,1870,1340;, - 3;1345,1876,1870;, - 3;1876,1871,1870;, - 3;1876,1877,1871;, - 3;1877,1872,1871;, - 3;1877,1878,1872;, - 3;1878,1879,1872;, - 3;1872,1879,1873;, - 3;1879,1874,1873;, - 3;1879,1880,1874;, - 3;1880,1881,1874;, - 3;1874,1881,1875;, - 3;1351,1876,1345;, - 3;1351,1882,1876;, - 3;1882,1877,1876;, - 3;1882,1883,1877;, - 3;1883,1878,1877;, - 3;1883,1884,1878;, - 3;1884,1885,1878;, - 3;1878,1885,1879;, - 3;1885,1880,1879;, - 3;1885,1886,1880;, - 3;1886,1887,1880;, - 3;1880,1887,1881;, - 3;1888,1882,1351;, - 3;1888,1889,1882;, - 3;1889,1883,1882;, - 3;1889,1890,1883;, - 3;1890,1884,1883;, - 3;1890,1891,1884;, - 3;1891,1892,1884;, - 3;1884,1892,1885;, - 3;1892,1886,1885;, - 3;1350,1888,1351;, - 3;1362,1888,1350;, - 3;1362,1893,1888;, - 3;1893,1889,1888;, - 3;1893,1894,1889;, - 3;1894,1890,1889;, - 3;1894,1895,1890;, - 3;1895,1891,1890;, - 3;1895,1896,1891;, - 3;1896,1897,1891;, - 3;1891,1897,1892;, - 3;1897,1898,1892;, - 3;1892,1898,1886;, - 3;1899,1893,1362;, - 3;1899,1900,1893;, - 3;1900,1894,1893;, - 3;1900,1901,1894;, - 3;1901,1895,1894;, - 3;1901,1902,1895;, - 3;1902,1896,1895;, - 3;1902,1903,1896;, - 3;1903,1904,1896;, - 3;1896,1904,1897;, - 3;1361,1899,1362;, - 3;1361,1368,1899;, - 3;1899,1368,1905;, - 3;1899,1905,1900;, - 3;1900,1905,1906;, - 3;1900,1906,1901;, - 3;1901,1906,1907;, - 3;1901,1907,1902;, - 3;1902,1907,1908;, - 3;1902,1908,1903;, - 3;1903,1908,1909;, - 3;1903,1909,1910;, - 3;1903,1910,1904;, - 3;1368,1911,1905;, - 3;1905,1911,1912;, - 3;1905,1912,1906;, - 3;1906,1912,1913;, - 3;1906,1913,1907;, - 3;1907,1913,1914;, - 3;1907,1914,1908;, - 3;1908,1914,1915;, - 3;1908,1915,1909;, - 3;1368,1367,1911;, - 3;1367,1916,1911;, - 3;1911,1916,1917;, - 3;1911,1917,1912;, - 3;1912,1917,1918;, - 3;1912,1918,1913;, - 3;1913,1918,1919;, - 3;1913,1919,1914;, - 3;1914,1919,1920;, - 3;1914,1920,1915;, - 3;1367,1373,1916;, - 3;1373,1921,1916;, - 3;1916,1921,1922;, - 3;1916,1922,1917;, - 3;1917,1922,1923;, - 3;1917,1923,1918;, - 3;1918,1923,1924;, - 3;1918,1924,1919;, - 3;1919,1924,1925;, - 3;1919,1925,1920;, - 3;1373,1378,1921;, - 3;1378,1926,1921;, - 3;1921,1926,1927;, - 3;1921,1927,1922;, - 3;1922,1927,1928;, - 3;1922,1928,1923;, - 3;1923,1928,1929;, - 3;1923,1929,1924;, - 3;1924,1929,1930;, - 3;1924,1930,1925;, - 3;1378,1383,1926;, - 3;1383,1931,1926;, - 3;1926,1931,1932;, - 3;1926,1932,1927;, - 3;1927,1932,1933;, - 3;1927,1933,1928;, - 3;1928,1933,1934;, - 3;1928,1934,1929;, - 3;1929,1934,1935;, - 3;1929,1935,1930;, - 3;1383,1388,1931;, - 3;1388,1936,1931;, - 3;1931,1936,1937;, - 3;1931,1937,1932;, - 3;1932,1937,1938;, - 3;1932,1938,1933;, - 3;1933,1938,1939;, - 3;1933,1939,1934;, - 3;1934,1939,1940;, - 3;1934,1940,1935;, - 3;1388,1393,1936;, - 3;1393,1941,1936;, - 3;1936,1941,1942;, - 3;1936,1942,1937;, - 3;1937,1942,1943;, - 3;1937,1943,1938;, - 3;1938,1943,1944;, - 3;1938,1944,1939;, - 3;1939,1944,1945;, - 3;1939,1945,1940;, - 3;1393,1398,1941;, - 3;1398,1946,1941;, - 3;1941,1946,1947;, - 3;1941,1947,1942;, - 3;1942,1947,1948;, - 3;1942,1948,1943;, - 3;1943,1948,1949;, - 3;1943,1949,1944;, - 3;1944,1949,1950;, - 3;1944,1950,1945;, - 3;1398,1403,1946;, - 3;1403,1951,1946;, - 3;1946,1951,1952;, - 3;1946,1952,1947;, - 3;1947,1952,1953;, - 3;1947,1953,1948;, - 3;1948,1953,1954;, - 3;1948,1954,1949;, - 3;1949,1954,1955;, - 3;1949,1955,1950;, - 3;1403,1408,1951;, - 3;1408,1956,1951;, - 3;1951,1956,1957;, - 3;1951,1957,1952;, - 3;1952,1957,1958;, - 3;1952,1958,1953;, - 3;1953,1958,1959;, - 3;1953,1959,1954;, - 3;1954,1959,1960;, - 3;1954,1960,1955;, - 3;1408,1413,1956;, - 3;1413,1457,1956;, - 3;1956,1457,1463;, - 3;1956,1463,1957;, - 3;1957,1463,1469;, - 3;1957,1469,1958;, - 3;1958,1469,1475;, - 3;1958,1475,1959;, - 3;1959,1475,1481;, - 3;1959,1481,1960;, - 3;1960,1481,1487;, - 3;1960,1487,1961;, - 3;1955,1960,1961;, - 3;1955,1961,1962;, - 3;1950,1955,1962;, - 3;1950,1962,1963;, - 3;1945,1950,1963;, - 3;1961,1487,1493;, - 3;1961,1493,1964;, - 3;1962,1961,1964;, - 3;1962,1964,1965;, - 3;1963,1962,1965;, - 3;1963,1965,1966;, - 3;1967,1963,1966;, - 3;1945,1963,1967;, - 3;1940,1945,1967;, - 3;1940,1967,1968;, - 3;1935,1940,1968;, - 3;1964,1493,1499;, - 3;1964,1499,1969;, - 3;1965,1964,1969;, - 3;1965,1969,1970;, - 3;1966,1965,1970;, - 3;1966,1970,1971;, - 3;1972,1966,1971;, - 3;1967,1966,1972;, - 3;1968,1967,1972;, - 3;1968,1972,1973;, - 3;1974,1968,1973;, - 3;1935,1968,1974;, - 3;1930,1935,1974;, - 3;1969,1499,1505;, - 3;1969,1505,1975;, - 3;1970,1969,1975;, - 3;1970,1975,1976;, - 3;1971,1970,1976;, - 3;1971,1976,1977;, - 3;1978,1971,1977;, - 3;1972,1971,1978;, - 3;1973,1972,1978;, - 3;1973,1978,1979;, - 3;1980,1973,1979;, - 3;1974,1973,1980;, - 3;1975,1505,1511;, - 3;1975,1511,1981;, - 3;1976,1975,1981;, - 3;1976,1981,1982;, - 3;1977,1976,1982;, - 3;1977,1982,1983;, - 3;1984,1977,1983;, - 3;1978,1977,1984;, - 3;1979,1978,1984;, - 3;1979,1984,1985;, - 3;1986,1979,1985;, - 3;1980,1979,1986;, - 3;1981,1511,1517;, - 3;1981,1517,1987;, - 3;1982,1981,1987;, - 3;1982,1987,1988;, - 3;1983,1982,1988;, - 3;1983,1988,1989;, - 3;1990,1983,1989;, - 3;1984,1983,1990;, - 3;1985,1984,1990;, - 3;1985,1990,1991;, - 3;1992,1985,1991;, - 3;1986,1985,1992;, - 3;1987,1517,1523;, - 3;1987,1523,1993;, - 3;1988,1987,1993;, - 3;1988,1993,1994;, - 3;1989,1988,1994;, - 3;1989,1994,1995;, - 3;1996,1989,1995;, - 3;1990,1989,1996;, - 3;1991,1990,1996;, - 3;1991,1996,1997;, - 3;1998,1991,1997;, - 3;1992,1991,1998;, - 3;1993,1523,1529;, - 3;1993,1529,1999;, - 3;1994,1993,1999;, - 3;1994,1999,2000;, - 3;1995,1994,2000;, - 3;1995,2000,2001;, - 3;2002,1995,2001;, - 3;1996,1995,2002;, - 3;1997,1996,2002;, - 3;1997,2002,2003;, - 3;2004,1997,2003;, - 3;1998,1997,2004;, - 3;1999,1529,1535;, - 3;1999,1535,2005;, - 3;2000,1999,2005;, - 3;2000,2005,2006;, - 3;2001,2000,2006;, - 3;2001,2006,2007;, - 3;2008,2001,2007;, - 3;2002,2001,2008;, - 3;2003,2002,2008;, - 3;2003,2008,2009;, - 3;2010,2003,2009;, - 3;2004,2003,2010;, - 3;2005,1535,1541;, - 3;2005,1541,2011;, - 3;2006,2005,2011;, - 3;2006,2011,2012;, - 3;2007,2006,2012;, - 3;2007,2012,2013;, - 3;2014,2007,2013;, - 3;2008,2007,2014;, - 3;2009,2008,2014;, - 3;2009,2014,2015;, - 3;2016,2009,2015;, - 3;2010,2009,2016;, - 3;2011,1541,1547;, - 3;2011,1547,2017;, - 3;2012,2011,2017;, - 3;2012,2017,2018;, - 3;2013,2012,2018;, - 3;2013,2018,2019;, - 3;2020,2013,2019;, - 3;2014,2013,2020;, - 3;2015,2014,2020;, - 3;2015,2020,2021;, - 3;2022,2015,2021;, - 3;2016,2015,2022;, - 3;2017,1547,1553;, - 3;2017,1553,2023;, - 3;2018,2017,2023;, - 3;2018,2023,2024;, - 3;2019,2018,2024;, - 3;2019,2024,2025;, - 3;2026,2019,2025;, - 3;2020,2019,2026;, - 3;2021,2020,2026;, - 3;2021,2026,2027;, - 3;2028,2021,2027;, - 3;2022,2021,2028;, - 3;2023,1553,1559;, - 3;2023,1559,2029;, - 3;2024,2023,2029;, - 3;2024,2029,2030;, - 3;2025,2024,2030;, - 3;2025,2030,2031;, - 3;2032,2025,2031;, - 3;2026,2025,2032;, - 3;2027,2026,2032;, - 3;2027,2032,2033;, - 3;2034,2027,2033;, - 3;2028,2027,2034;, - 3;2029,1559,1565;, - 3;2029,1565,2035;, - 3;2030,2029,2035;, - 3;2030,2035,2036;, - 3;2031,2030,2036;, - 3;2031,2036,2037;, - 3;2038,2031,2037;, - 3;2032,2031,2038;, - 3;2033,2032,2038;, - 3;2033,2038,2039;, - 3;2040,2033,2039;, - 3;2034,2033,2040;, - 3;2035,1565,1571;, - 3;2035,1571,2041;, - 3;2036,2035,2041;, - 3;2036,2041,2042;, - 3;2037,2036,2042;, - 3;2037,2042,2043;, - 3;2044,2037,2043;, - 3;2038,2037,2044;, - 3;2039,2038,2044;, - 3;2039,2044,2045;, - 3;2046,2039,2045;, - 3;2040,2039,2046;, - 3;2041,1571,1577;, - 3;2041,1577,2047;, - 3;2042,2041,2047;, - 3;2042,2047,2048;, - 3;2043,2042,2048;, - 3;2043,2048,2049;, - 3;2050,2043,2049;, - 3;2044,2043,2050;, - 3;2045,2044,2050;, - 3;2045,2050,2051;, - 3;2052,2045,2051;, - 3;2046,2045,2052;, - 3;2047,1577,1583;, - 3;2047,1583,2053;, - 3;2048,2047,2053;, - 3;2048,2053,2054;, - 3;2049,2048,2054;, - 3;2049,2054,2055;, - 3;2056,2049,2055;, - 3;2050,2049,2056;, - 3;2051,2050,2056;, - 3;2051,2056,2057;, - 3;2058,2051,2057;, - 3;2052,2051,2058;, - 3;2053,1583,1589;, - 3;2053,1589,2059;, - 3;2054,2053,2059;, - 3;2054,2059,2060;, - 3;2055,2054,2060;, - 3;2055,2060,2061;, - 3;2062,2055,2061;, - 3;2056,2055,2062;, - 3;2057,2056,2062;, - 3;2057,2062,2063;, - 3;2064,2057,2063;, - 3;2058,2057,2064;, - 3;2059,1589,1595;, - 3;2059,1595,2065;, - 3;2060,2059,2065;, - 3;2060,2065,2066;, - 3;2061,2060,2066;, - 3;2061,2066,2067;, - 3;2068,2061,2067;, - 3;2062,2061,2068;, - 3;2063,2062,2068;, - 3;2063,2068,2069;, - 3;2070,2063,2069;, - 3;2064,2063,2070;, - 3;2065,1595,1601;, - 3;2065,1601,2071;, - 3;2066,2065,2071;, - 3;2066,2071,2072;, - 3;2067,2066,2072;, - 3;2067,2072,2073;, - 3;2074,2067,2073;, - 3;2068,2067,2074;, - 3;2069,2068,2074;, - 3;2069,2074,2075;, - 3;2076,2069,2075;, - 3;2070,2069,2076;, - 3;2071,1601,1607;, - 3;2071,1607,2077;, - 3;2072,2071,2077;, - 3;2072,2077,2078;, - 3;2073,2072,2078;, - 3;2073,2078,2079;, - 3;2080,2073,2079;, - 3;2074,2073,2080;, - 3;2075,2074,2080;, - 3;2075,2080,2081;, - 3;2082,2075,2081;, - 3;2076,2075,2082;, - 3;2077,1607,1613;, - 3;2077,1613,2083;, - 3;2078,2077,2083;, - 3;2078,2083,2084;, - 3;2079,2078,2084;, - 3;2079,2084,2085;, - 3;2086,2079,2085;, - 3;2080,2079,2086;, - 3;2081,2080,2086;, - 3;2081,2086,2087;, - 3;2088,2081,2087;, - 3;2082,2081,2088;, - 3;2083,1613,1619;, - 3;2083,1619,1642;, - 3;2084,2083,1642;, - 3;2084,1642,1641;, - 3;2085,2084,1641;, - 3;2085,1641,1647;, - 3;2089,2085,1647;, - 3;2086,2085,2089;, - 3;2087,2086,2089;, - 3;2087,2089,2090;, - 3;2091,2087,2090;, - 3;2088,2087,2091;, - 3;2092,2088,2091;, - 3;2093,2088,2092;, - 3;2093,2082,2088;, - 3;2089,1647,1652;, - 3;2090,2089,1652;, - 3;2090,1652,1657;, - 3;1672,2090,1657;, - 3;2091,2090,1672;, - 3;1677,2091,1672;, - 3;2092,2091,1677;, - 3;1682,2092,1677;, - 3;2094,2092,1682;, - 3;2094,2093,2092;, - 3;2095,2093,2094;, - 3;2095,2096,2093;, - 3;2096,2082,2093;, - 3;2096,2076,2082;, - 3;2097,2076,2096;, - 3;2097,2070,2076;, - 3;1687,2094,1682;, - 3;2098,2094,1687;, - 3;2098,2095,2094;, - 3;2099,2095,2098;, - 3;2099,2100,2095;, - 3;2100,2096,2095;, - 3;2100,2097,2096;, - 3;2101,2097,2100;, - 3;2101,2102,2097;, - 3;2102,2070,2097;, - 3;2102,2064,2070;, - 3;1692,2098,1687;, - 3;2103,2098,1692;, - 3;2103,2099,2098;, - 3;2104,2099,2103;, - 3;2104,2105,2099;, - 3;2105,2100,2099;, - 3;2105,2101,2100;, - 3;2106,2101,2105;, - 3;2106,2107,2101;, - 3;2107,2102,2101;, - 3;2107,2108,2102;, - 3;2108,2064,2102;, - 3;2108,2058,2064;, - 3;1697,2103,1692;, - 3;2109,2103,1697;, - 3;2109,2104,2103;, - 3;2110,2104,2109;, - 3;2110,2111,2104;, - 3;2111,2105,2104;, - 3;2111,2106,2105;, - 3;2112,2106,2111;, - 3;2112,2113,2106;, - 3;2113,2107,2106;, - 3;2113,2114,2107;, - 3;2114,2108,2107;, - 3;1702,2109,1697;, - 3;2115,2109,1702;, - 3;2115,2110,2109;, - 3;2116,2110,2115;, - 3;2116,2117,2110;, - 3;2117,2111,2110;, - 3;2117,2112,2111;, - 3;2118,2112,2117;, - 3;2118,2119,2112;, - 3;2119,2113,2112;, - 3;2119,2120,2113;, - 3;2120,2114,2113;, - 3;2115,1702,1707;, - 3;2115,1707,2121;, - 3;2116,2115,2121;, - 3;2116,2121,2122;, - 3;2123,2116,2122;, - 3;2123,2117,2116;, - 3;2123,2118,2117;, - 3;2124,2118,2123;, - 3;2124,2125,2118;, - 3;2125,2119,2118;, - 3;2125,2126,2119;, - 3;2126,2120,2119;, - 3;2121,1707,1712;, - 3;2121,1712,2127;, - 3;2122,2121,2127;, - 3;2122,2127,2128;, - 3;2129,2122,2128;, - 3;2123,2122,2129;, - 3;2124,2123,2129;, - 3;2124,2129,2130;, - 3;2131,2124,2130;, - 3;2131,2125,2124;, - 3;2131,2132,2125;, - 3;2132,2126,2125;, - 3;2127,1712,1717;, - 3;2127,1717,2133;, - 3;2128,2127,2133;, - 3;2128,2133,2134;, - 3;2135,2128,2134;, - 3;2129,2128,2135;, - 3;2130,2129,2135;, - 3;2130,2135,2136;, - 3;2137,2130,2136;, - 3;2131,2130,2137;, - 3;2138,2131,2137;, - 3;2138,2132,2131;, - 3;2133,1717,1722;, - 3;2133,1722,2139;, - 3;2134,2133,2139;, - 3;2134,2139,2140;, - 3;2141,2134,2140;, - 3;2135,2134,2141;, - 3;2136,2135,2141;, - 3;2136,2141,2142;, - 3;2143,2136,2142;, - 3;2137,2136,2143;, - 3;2144,2137,2143;, - 3;2138,2137,2144;, - 3;2139,1722,1727;, - 3;2139,1727,2145;, - 3;2140,2139,2145;, - 3;2140,2145,2146;, - 3;2147,2140,2146;, - 3;2141,2140,2147;, - 3;2142,2141,2147;, - 3;2142,2147,2148;, - 3;2149,2142,2148;, - 3;2143,2142,2149;, - 3;2150,2143,2149;, - 3;2144,2143,2150;, - 3;2145,1727,1732;, - 3;2145,1732,2151;, - 3;2146,2145,2151;, - 3;2146,2151,2152;, - 3;2153,2146,2152;, - 3;2147,2146,2153;, - 3;2148,2147,2153;, - 3;2148,2153,2154;, - 3;2155,2148,2154;, - 3;2149,2148,2155;, - 3;2156,2149,2155;, - 3;2150,2149,2156;, - 3;2151,1732,1737;, - 3;2151,1737,2157;, - 3;2152,2151,2157;, - 3;2152,2157,2158;, - 3;2159,2152,2158;, - 3;2153,2152,2159;, - 3;2154,2153,2159;, - 3;2154,2159,2160;, - 3;2161,2154,2160;, - 3;2155,2154,2161;, - 3;2162,2155,2161;, - 3;2156,2155,2162;, - 3;2157,1737,1742;, - 3;2157,1742,2163;, - 3;2158,2157,2163;, - 3;2158,2163,2164;, - 3;2165,2158,2164;, - 3;2159,2158,2165;, - 3;2160,2159,2165;, - 3;2160,2165,2166;, - 3;2167,2160,2166;, - 3;2161,2160,2167;, - 3;2168,2161,2167;, - 3;2162,2161,2168;, - 3;2163,1742,1747;, - 3;2163,1747,1762;, - 3;2164,2163,1762;, - 3;2164,1762,1767;, - 3;2169,2164,1767;, - 3;2165,2164,2169;, - 3;2166,2165,2169;, - 3;2166,2169,2170;, - 3;2171,2166,2170;, - 3;2167,2166,2171;, - 3;2172,2167,2171;, - 3;2168,2167,2172;, - 3;2173,2168,2172;, - 3;2174,2168,2173;, - 3;2174,2162,2168;, - 3;2169,1767,1772;, - 3;2170,2169,1772;, - 3;2170,1772,1777;, - 3;2175,2170,1777;, - 3;2171,2170,2175;, - 3;2176,2171,2175;, - 3;2172,2171,2176;, - 3;2177,2172,2176;, - 3;2173,2172,2177;, - 3;2178,2173,2177;, - 3;2179,2173,2178;, - 3;2179,2174,2173;, - 3;2175,1777,1782;, - 3;2180,2175,1782;, - 3;2176,2175,2180;, - 3;2181,2176,2180;, - 3;2177,2176,2181;, - 3;2182,2177,2181;, - 3;2178,2177,2182;, - 3;2183,2178,2182;, - 3;2184,2178,2183;, - 3;2184,2179,2178;, - 3;2180,1782,1787;, - 3;2185,2180,1787;, - 3;2181,2180,2185;, - 3;2186,2181,2185;, - 3;2182,2181,2186;, - 3;2187,2182,2186;, - 3;2183,2182,2187;, - 3;2188,2183,2187;, - 3;2189,2183,2188;, - 3;2189,2184,2183;, - 3;2185,1787,1792;, - 3;2190,2185,1792;, - 3;2186,2185,2190;, - 3;2191,2186,2190;, - 3;2187,2186,2191;, - 3;2192,2187,2191;, - 3;2188,2187,2192;, - 3;2193,2188,2192;, - 3;2194,2188,2193;, - 3;2194,2189,2188;, - 3;2190,1792,1797;, - 3;2195,2190,1797;, - 3;2191,2190,2195;, - 3;2196,2191,2195;, - 3;2192,2191,2196;, - 3;2197,2192,2196;, - 3;2193,2192,2197;, - 3;2198,2193,2197;, - 3;2199,2193,2198;, - 3;2199,2194,2193;, - 3;2195,1797,1802;, - 3;2200,2195,1802;, - 3;2196,2195,2200;, - 3;2201,2196,2200;, - 3;2197,2196,2201;, - 3;2202,2197,2201;, - 3;2198,2197,2202;, - 3;2203,2198,2202;, - 3;2204,2198,2203;, - 3;2204,2199,2198;, - 3;2200,1802,1807;, - 3;2205,2200,1807;, - 3;2201,2200,2205;, - 3;2206,2201,2205;, - 3;2202,2201,2206;, - 3;2207,2202,2206;, - 3;2203,2202,2207;, - 3;1887,2203,2207;, - 3;2208,2203,1887;, - 3;2208,2204,2203;, - 3;2205,1807,1812;, - 3;2209,2205,1812;, - 3;2206,2205,2209;, - 3;2210,2206,2209;, - 3;2207,2206,2210;, - 3;1881,2207,2210;, - 3;1887,2207,1881;, - 3;2209,1812,1817;, - 3;2211,2209,1817;, - 3;2210,2209,2211;, - 3;1875,2210,2211;, - 3;1881,2210,1875;, - 3;2211,1817,1822;, - 3;1869,2211,1822;, - 3;1875,2211,1869;, - 3;1886,2208,1887;, - 3;1898,2208,1886;, - 3;1898,2212,2208;, - 3;2212,2204,2208;, - 3;2212,2213,2204;, - 3;2213,2199,2204;, - 3;2213,2214,2199;, - 3;2214,2194,2199;, - 3;2215,2212,1898;, - 3;2215,2216,2212;, - 3;2216,2213,2212;, - 3;2216,2217,2213;, - 3;2217,2214,2213;, - 3;2217,2218,2214;, - 3;2218,2219,2214;, - 3;2214,2219,2194;, - 3;2219,2189,2194;, - 3;1897,2215,1898;, - 3;1904,2215,1897;, - 3;1904,2220,2215;, - 3;2220,2216,2215;, - 3;2220,2221,2216;, - 3;2221,2217,2216;, - 3;2221,2222,2217;, - 3;2222,2218,2217;, - 3;2222,2223,2218;, - 3;2223,2224,2218;, - 3;2218,2224,2219;, - 3;2224,2225,2219;, - 3;2219,2225,2189;, - 3;2225,2184,2189;, - 3;1910,2220,1904;, - 3;1910,2226,2220;, - 3;2226,2221,2220;, - 3;2226,2227,2221;, - 3;2227,2222,2221;, - 3;2227,2228,2222;, - 3;2228,2223,2222;, - 3;2228,2229,2223;, - 3;2229,2230,2223;, - 3;2223,2230,2224;, - 3;2230,2231,2224;, - 3;2224,2231,2225;, - 3;1910,2232,2226;, - 3;2226,2232,2233;, - 3;2226,2233,2227;, - 3;2227,2233,2234;, - 3;2227,2234,2228;, - 3;2228,2234,2235;, - 3;2228,2235,2229;, - 3;2229,2235,2236;, - 3;2229,2236,2237;, - 3;2229,2237,2230;, - 3;1910,1909,2232;, - 3;1909,2238,2232;, - 3;2232,2238,2239;, - 3;2232,2239,2233;, - 3;2233,2239,2240;, - 3;2233,2240,2234;, - 3;2234,2240,2241;, - 3;2234,2241,2235;, - 3;2235,2241,2242;, - 3;2235,2242,2236;, - 3;1909,1915,2238;, - 3;1915,2243,2238;, - 3;2238,2243,2244;, - 3;2238,2244,2239;, - 3;2239,2244,2245;, - 3;2239,2245,2240;, - 3;2240,2245,2246;, - 3;2240,2246,2241;, - 3;2241,2246,2247;, - 3;2241,2247,2242;, - 3;1915,1920,2243;, - 3;1920,2248,2243;, - 3;2243,2248,2249;, - 3;2243,2249,2244;, - 3;2244,2249,2250;, - 3;2244,2250,2245;, - 3;2245,2250,2251;, - 3;2245,2251,2246;, - 3;2246,2251,2252;, - 3;2246,2252,2247;, - 3;1920,1925,2248;, - 3;1925,2253,2248;, - 3;2248,2253,2254;, - 3;2248,2254,2249;, - 3;2249,2254,2255;, - 3;2249,2255,2250;, - 3;2250,2255,2256;, - 3;2250,2256,2251;, - 3;2251,2256,2257;, - 3;2251,2257,2252;, - 3;1925,1930,2253;, - 3;1930,1974,2253;, - 3;2253,1974,1980;, - 3;2253,1980,2254;, - 3;2254,1980,1986;, - 3;2254,1986,2255;, - 3;2255,1986,1992;, - 3;2255,1992,2256;, - 3;2256,1992,1998;, - 3;2256,1998,2257;, - 3;2257,1998,2004;, - 3;2257,2004,2258;, - 3;2252,2257,2258;, - 3;2252,2258,2259;, - 3;2247,2252,2259;, - 3;2247,2259,2260;, - 3;2242,2247,2260;, - 3;2258,2004,2010;, - 3;2258,2010,2261;, - 3;2259,2258,2261;, - 3;2259,2261,2262;, - 3;2260,2259,2262;, - 3;2260,2262,2263;, - 3;2264,2260,2263;, - 3;2242,2260,2264;, - 3;2236,2242,2264;, - 3;2236,2264,2265;, - 3;2237,2236,2265;, - 3;2261,2010,2016;, - 3;2261,2016,2266;, - 3;2262,2261,2266;, - 3;2262,2266,2267;, - 3;2263,2262,2267;, - 3;2263,2267,2268;, - 3;2269,2263,2268;, - 3;2264,2263,2269;, - 3;2265,2264,2269;, - 3;2265,2269,2270;, - 3;2271,2265,2270;, - 3;2237,2265,2271;, - 3;2266,2016,2022;, - 3;2266,2022,2272;, - 3;2267,2266,2272;, - 3;2267,2272,2273;, - 3;2268,2267,2273;, - 3;2268,2273,2274;, - 3;2275,2268,2274;, - 3;2269,2268,2275;, - 3;2270,2269,2275;, - 3;2270,2275,2276;, - 3;2277,2270,2276;, - 3;2271,2270,2277;, - 3;2272,2022,2028;, - 3;2272,2028,2278;, - 3;2273,2272,2278;, - 3;2273,2278,2279;, - 3;2274,2273,2279;, - 3;2274,2279,2280;, - 3;2281,2274,2280;, - 3;2275,2274,2281;, - 3;2276,2275,2281;, - 3;2276,2281,2282;, - 3;2283,2276,2282;, - 3;2277,2276,2283;, - 3;2278,2028,2034;, - 3;2278,2034,2284;, - 3;2279,2278,2284;, - 3;2279,2284,2285;, - 3;2280,2279,2285;, - 3;2280,2285,2286;, - 3;2287,2280,2286;, - 3;2281,2280,2287;, - 3;2282,2281,2287;, - 3;2282,2287,2288;, - 3;2289,2282,2288;, - 3;2283,2282,2289;, - 3;2284,2034,2040;, - 3;2284,2040,2290;, - 3;2285,2284,2290;, - 3;2285,2290,2291;, - 3;2286,2285,2291;, - 3;2286,2291,2292;, - 3;2293,2286,2292;, - 3;2287,2286,2293;, - 3;2288,2287,2293;, - 3;2288,2293,2132;, - 3;2138,2288,2132;, - 3;2289,2288,2138;, - 3;2290,2040,2046;, - 3;2290,2046,2294;, - 3;2291,2290,2294;, - 3;2291,2294,2295;, - 3;2292,2291,2295;, - 3;2292,2295,2120;, - 3;2126,2292,2120;, - 3;2293,2292,2126;, - 3;2132,2293,2126;, - 3;2294,2046,2052;, - 3;2294,2052,2296;, - 3;2295,2294,2296;, - 3;2295,2296,2114;, - 3;2120,2295,2114;, - 3;2296,2052,2058;, - 3;2296,2058,2108;, - 3;2114,2296,2108;, - 3;2289,2138,2144;, - 3;2289,2144,2297;, - 3;2283,2289,2297;, - 3;2283,2297,2298;, - 3;2277,2283,2298;, - 3;2277,2298,2299;, - 3;2271,2277,2299;, - 3;2297,2144,2150;, - 3;2297,2150,2300;, - 3;2298,2297,2300;, - 3;2298,2300,2301;, - 3;2299,2298,2301;, - 3;2299,2301,2302;, - 3;2303,2299,2302;, - 3;2271,2299,2303;, - 3;2237,2271,2303;, - 3;2237,2303,2230;, - 3;2230,2303,2231;, - 3;2300,2150,2156;, - 3;2300,2156,2304;, - 3;2301,2300,2304;, - 3;2301,2304,2305;, - 3;2302,2301,2305;, - 3;2302,2305,2306;, - 3;2231,2302,2306;, - 3;2303,2302,2231;, - 3;2304,2156,2162;, - 3;2304,2162,2174;, - 3;2305,2304,2174;, - 3;2305,2174,2179;, - 3;2306,2305,2179;, - 3;2306,2179,2184;, - 3;2225,2306,2184;, - 3;2231,2306,2225;; - - MeshNormals { - 2307; - -0.036282;0.997085;-0.067122;, - -0.044735;0.997085;-0.061811;, - 0.015507;0.999866;-0.005264;, - -0.066112;0.990719;-0.118761;, - -0.081047;0.990720;-0.109116;, - -0.052418;0.997085;-0.055445;, - -0.023664;0.999688;0.008033;, - -0.027213;0.997085;-0.071283;, - -0.050046;0.990719;-0.126374;, - -0.074061;0.980077;-0.184295;, - -0.097484;0.980077;-0.173051;, - -0.119235;0.980077;-0.158848;, - -0.094596;0.990720;-0.097603;, - -0.017674;0.997085;-0.074225;, - -0.033123;0.990719;-0.131825;, - -0.049373;0.980077;-0.192386;, - -0.065651;0.965231;-0.253022;, - -0.098117;0.965231;-0.242287;, - -0.128902;0.965231;-0.227407;, - -0.007831;0.997085;-0.075897;, - -0.015630;0.990719;-0.135021;, - -0.023837;0.980077;-0.197185;, - -0.032065;0.965230;-0.259427;, - -0.040200;0.946251;-0.320926;, - -0.081747;0.946251;-0.312932;, - -0.000000;0.997859;-0.065402;, - 0.000000;0.992279;-0.124023;, - -0.000000;0.982353;-0.187038;, - 0.000000;0.968207;-0.250151;, - 0.000000;0.949908;-0.312529;, - 0.007831;0.997085;-0.075897;, - 0.015630;0.990719;-0.135021;, - 0.023837;0.980077;-0.197185;, - 0.032065;0.965230;-0.259427;, - 0.040200;0.946251;-0.320926;, - 0.000000;0.927544;-0.373713;, - 0.017674;0.997085;-0.074225;, - 0.033123;0.990719;-0.131825;, - 0.049373;0.980077;-0.192386;, - 0.065651;0.965231;-0.253022;, - 0.081747;0.946251;-0.312932;, - 0.048191;0.923218;-0.381243;, - 0.027213;0.997085;-0.071283;, - 0.050046;0.990719;-0.126374;, - 0.074061;0.980077;-0.184295;, - 0.098117;0.965231;-0.242287;, - 0.121896;0.946250;-0.299586;, - 0.097546;0.923217;-0.371692;, - 0.036282;0.997085;-0.067122;, - 0.066112;0.990720;-0.118761;, - 0.097484;0.980077;-0.173051;, - 0.128902;0.965231;-0.227407;, - 0.159955;0.946251;-0.281112;, - 0.145224;0.923217;-0.355781;, - 0.044735;0.997085;-0.061811;, - 0.081047;0.990720;-0.109116;, - 0.119235;0.980077;-0.158848;, - 0.157482;0.965231;-0.208637;, - 0.195281;0.946250;-0.257828;, - 0.190422;0.923217;-0.333781;, - 0.052418;0.997085;-0.055445;, - 0.094596;0.990720;-0.097603;, - 0.138951;0.980077;-0.141924;, - 0.183368;0.965231;-0.186296;, - 0.227264;0.946250;-0.230134;, - 0.232361;0.923217;-0.306070;, - 0.059207;0.997085;-0.048128;, - 0.106528;0.990720;-0.084420;, - 0.156288;0.980077;-0.122572;, - 0.206116;0.965231;-0.160768;, - 0.255356;0.946251;-0.198503;, - 0.270322;0.923217;-0.273123;, - 0.064982;0.997085;-0.039990;, - 0.116635;0.990719;-0.069793;, - 0.170949;0.980077;-0.101125;, - 0.225334;0.965231;-0.132491;, - 0.279081;0.946251;-0.163473;, - 0.303658;0.923217;-0.235504;, - 0.069647;0.997085;-0.031164;, - 0.124746;0.990719;-0.053975;, - 0.182685;0.980077;-0.077949;, - 0.240703;0.965231;-0.101942;, - 0.298033;0.946250;-0.125645;, - 0.331801;0.923217;-0.193852;, - 0.073117;0.997085;-0.021808;, - 0.130724;0.990720;-0.037231;, - 0.191299;0.980076;-0.053433;, - 0.251949;0.965231;-0.069654;, - 0.311882;0.946251;-0.085671;, - 0.354265;0.923217;-0.148886;, - 0.075339;0.997085;-0.012075;, - 0.134466;0.990719;-0.019844;, - 0.196636;0.980077;-0.028007;, - 0.258885;0.965231;-0.036171;, - 0.320396;0.946251;-0.044227;, - 0.370666;0.923218;-0.101372;, - 0.076271;0.997085;-0.002138;, - 0.135906;0.990719;-0.002126;, - 0.198609;0.980077;-0.002103;, - 0.261392;0.965230;-0.002071;, - 0.323428;0.946250;-0.002029;, - 0.380726;0.923218;-0.052120;, - 0.075897;0.997085;0.007831;, - 0.135021;0.990719;0.015630;, - 0.197185;0.980077;0.023837;, - 0.259427;0.965230;0.032065;, - 0.320926;0.946251;0.040200;, - 0.384271;0.923218;-0.001981;, - 0.074225;0.997085;0.017674;, - 0.131825;0.990719;0.033123;, - 0.192386;0.980077;0.049373;, - 0.253022;0.965231;0.065651;, - 0.312932;0.946251;0.081747;, - 0.381243;0.923218;0.048191;, - 0.071283;0.997085;0.027213;, - 0.126374;0.990719;0.050046;, - 0.184295;0.980077;0.074061;, - 0.242287;0.965231;0.098117;, - 0.299586;0.946250;0.121896;, - 0.371692;0.923217;0.097546;, - 0.067122;0.997085;0.036282;, - 0.118761;0.990720;0.066112;, - 0.173051;0.980077;0.097484;, - 0.227407;0.965231;0.128902;, - 0.281112;0.946251;0.159955;, - 0.355781;0.923217;0.145224;, - 0.061811;0.997085;0.044735;, - 0.109116;0.990720;0.081047;, - 0.158848;0.980077;0.119235;, - 0.208637;0.965231;0.157482;, - 0.257828;0.946250;0.195281;, - 0.333781;0.923217;0.190422;, - 0.055445;0.997085;0.052418;, - 0.097603;0.990720;0.094596;, - 0.141924;0.980077;0.138951;, - 0.186296;0.965231;0.183368;, - 0.230134;0.946250;0.227264;, - 0.306070;0.923217;0.232361;, - 0.048128;0.997085;0.059207;, - 0.084420;0.990720;0.106528;, - 0.122572;0.980077;0.156288;, - 0.160768;0.965231;0.206116;, - 0.198503;0.946251;0.255356;, - 0.273123;0.923217;0.270322;, - 0.039990;0.997085;0.064982;, - 0.069793;0.990719;0.116635;, - 0.101125;0.980077;0.170949;, - 0.132491;0.965231;0.225334;, - 0.163473;0.946251;0.279081;, - 0.235504;0.923217;0.303658;, - 0.031164;0.997085;0.069647;, - 0.053975;0.990719;0.124746;, - 0.077949;0.980077;0.182685;, - 0.101942;0.965231;0.240703;, - 0.125645;0.946250;0.298033;, - 0.193852;0.923217;0.331801;, - 0.021808;0.997085;0.073117;, - 0.037231;0.990720;0.130724;, - 0.053433;0.980076;0.191299;, - 0.069654;0.965231;0.251949;, - 0.085671;0.946251;0.311882;, - 0.148886;0.923217;0.354265;, - 0.012075;0.997085;0.075339;, - 0.019844;0.990719;0.134466;, - 0.028007;0.980077;0.196636;, - 0.036171;0.965231;0.258885;, - 0.044227;0.946251;0.320396;, - 0.101372;0.923218;0.370666;, - 0.005351;0.996642;0.081706;, - 0.009461;0.989475;0.144392;, - 0.013623;0.978065;0.207855;, - 0.017753;0.962452;0.270871;, - 0.021817;0.942711;0.332897;, - 0.052120;0.923218;0.380726;, - 0.116669;0.896227;0.427978;, - 0.171533;0.896228;0.409087;, - 0.223461;0.896227;0.383200;, - 0.025794;0.918920;0.393599;, - 0.059806;0.896226;0.439547;, - 0.131478;0.865405;0.483515;, - 0.193466;0.865406;0.462216;, - 0.252141;0.865406;0.433009;, - 0.306506;0.865407;0.396390;, - 0.271569;0.896227;0.350753;, - 0.029671;0.891186;0.452667;, - 0.067243;0.865405;0.496541;, - 0.145742;0.830873;0.537037;, - 0.214595;0.830874;0.513418;, - 0.279773;0.830874;0.481016;, - 0.340167;0.830873;0.440382;, - 0.033417;0.859642;0.509802;, - 0.074399;0.830873;0.551465;, - 0.159392;0.792784;0.588293;, - 0.234816;0.792783;0.562455;, - 0.306224;0.792784;0.526992;, - 0.372390;0.792784;0.482514;, - 0.037018;0.824409;0.564783;, - 0.081242;0.792785;0.604062;, - 0.172365;0.751306;0.637047;, - 0.254044;0.751305;0.609100;, - 0.331374;0.751303;0.570733;, - 0.403034;0.751304;0.522596;, - 0.040463;0.785659;0.617335;, - 0.087739;0.751305;0.654097;, - 0.184607;0.706601;0.683108;, - 0.272194;0.706601;0.653166;, - 0.355118;0.706601;0.612051;, - 0.431968;0.706602;0.560462;, - 0.043736;0.743547;0.667252;, - 0.093865;0.706602;0.701358;, - 0.196064;0.658871;0.726257;, - 0.289183;0.658871;0.694451;, - 0.377350;0.658873;0.650764;, - 0.459062;0.658874;0.595942;, - 0.046821;0.698262;0.714310;, - 0.099591;0.658871;0.745634;, - 0.206681;0.608323;0.766307;, - 0.304936;0.608326;0.732771;, - 0.397973;0.608326;0.686700;, - 0.484200;0.608324;0.628882;, - 0.049701;0.649993;0.758313;, - 0.104891;0.608323;0.786728;, - 0.216418;0.555175;0.803084;, - 0.319390;0.555175;0.767966;, - 0.416899;0.555175;0.719705;, - 0.507274;0.555172;0.659134;, - 0.052373;0.598970;0.799057;, - 0.109744;0.555174;0.824462;, - 0.225232;0.499645;0.836436;, - 0.332481;0.499641;0.799885;, - 0.434044;0.499644;0.749641;, - 0.528179;0.499647;0.686571;, - 0.054823;0.545394;0.836385;, - 0.114128;0.499645;0.858679;, - 0.233085;0.441973;0.866216;, - 0.344154;0.441970;0.828384;, - 0.449335;0.441969;0.776377;, - 0.546828;0.441972;0.711084;, - 0.057032;0.489503;0.870135;, - 0.118026;0.441975;0.889229;, - 0.239941;0.382406;0.892297;, - 0.354355;0.382407;0.853345;, - 0.462705;0.382409;0.799792;, - 0.563141;0.382406;0.732556;, - 0.059001;0.431530;0.900167;, - 0.121420;0.382407;0.915981;, - 0.245771;0.321212;0.914560;, - 0.363041;0.321211;0.874657;, - 0.474099;0.321208;0.819790;, - 0.577048;0.321209;0.750893;, - 0.060717;0.371721;0.926357;, - 0.124292;0.321208;0.938817;, - 0.250550;0.258635;0.932916;, - 0.370176;0.258636;0.892232;, - 0.483469;0.258636;0.836281;, - 0.588488;0.258630;0.766024;, - 0.062174;0.310348;0.948588;, - 0.126635;0.258637;0.957638;, - 0.254258;0.194952;0.947284;, - 0.375729;0.194951;0.905992;, - 0.490768;0.194948;0.849201;, - 0.597414;0.194952;0.777876;, - 0.063366;0.247660;0.966773;, - 0.128436;0.194950;0.972368;, - 0.256879;0.130431;0.957602;, - 0.379675;0.130433;0.915879;, - 0.495971;0.130434;0.858487;, - 0.603783;0.130436;0.786405;, - 0.064284;0.183916;0.980838;, - 0.129688;0.130433;0.982939;, - 0.258402;0.065359;0.963824;, - 0.381996;0.065356;0.921850;, - 0.499052;0.065353;0.864104;, - 0.607569;0.065356;0.791574;, - 0.064936;0.119402;0.990720;, - 0.130385;0.065356;0.989307;, - 0.258819;-0.000002;0.965926;, - 0.382685;-0.000000;0.923879;, - 0.500001;0.000003;0.866025;, - 0.608759;-0.000000;0.793355;, - 0.065307;0.054380;0.996383;, - 0.130525;0.000000;0.991445;, - 0.258130;-0.065356;0.963897;, - 0.381738;-0.065355;0.921957;, - 0.498808;-0.065361;0.864245;, - 0.607348;-0.065357;0.791743;, - 0.065399;-0.010874;0.997800;, - 0.130108;-0.065357;0.989343;, - 0.256337;-0.130436;0.957746;, - 0.379157;-0.130433;0.916094;, - 0.495489;-0.130428;0.858766;, - 0.603337;-0.130435;0.786747;, - 0.065214;-0.076077;0.994967;, - 0.129135;-0.130430;0.983012;, - 0.253453;-0.194947;0.947501;, - 0.374954;-0.194954;0.906313;, - 0.490045;-0.194952;0.849617;, - 0.596748;-0.194949;0.778387;, - 0.064748;-0.140963;0.987895;, - 0.127605;-0.194953;0.972476;, - 0.249477;-0.258638;0.933203;, - 0.369151;-0.258633;0.892657;, - 0.482508;-0.258631;0.836837;, - 0.587607;-0.258633;0.766698;, - 0.064008;-0.205253;0.976614;, - 0.125534;-0.258637;0.957783;, - 0.244439;-0.321212;0.914917;, - 0.361766;-0.321215;0.875184;, - 0.472906;-0.321211;0.820478;, - 0.575955;-0.321206;0.751733;, - 0.063000;-0.268669;0.961170;, - 0.122927;-0.321209;0.938996;, - 0.238358;-0.382404;0.892722;, - 0.352839;-0.382407;0.853973;, - 0.461284;-0.382408;0.800613;, - 0.561839;-0.382409;0.733553;, - 0.061717;-0.330950;0.941628;, - 0.119793;-0.382405;0.916197;, - 0.231253;-0.441972;0.866708;, - 0.342404;-0.441968;0.829110;, - 0.447691;-0.441971;0.777325;, - 0.545324;-0.441973;0.712237;, - 0.060174;-0.391830;0.918068;, - 0.116144;-0.441976;0.889476;, - 0.223159;-0.499646;0.836991;, - 0.330502;-0.499642;0.800703;, - 0.432187;-0.499643;0.750714;, - 0.526478;-0.499643;0.687879;, - 0.058373;-0.451058;0.890584;, - 0.112002;-0.499646;0.858958;, - 0.214116;-0.555175;0.803701;, - 0.317189;-0.555175;0.768877;, - 0.414835;-0.555174;0.720898;, - 0.505383;-0.555172;0.660585;, - 0.056323;-0.508359;0.859301;, - 0.107383;-0.555173;0.824774;, - 0.204161;-0.608324;0.766981;, - 0.302523;-0.608328;0.733769;, - 0.395711;-0.608327;0.688005;, - 0.482130;-0.608326;0.630469;, - 0.054033;-0.563506;0.824343;, - 0.102304;-0.608323;0.787069;, - 0.193335;-0.658867;0.726991;, - 0.286572;-0.658870;0.695534;, - 0.374900;-0.658874;0.652178;, - 0.456820;-0.658873;0.597664;, - 0.051507;-0.616255;0.785861;, - 0.096785;-0.658872;0.746003;, - 0.181676;-0.706604;0.683890;, - 0.269394;-0.706599;0.654327;, - 0.352493;-0.706600;0.613567;, - 0.429560;-0.706603;0.562309;, - 0.048766;-0.666386;0.744010;, - 0.090858;-0.706602;0.701754;, - 0.169250;-0.751305;0.637883;, - 0.251063;-0.751305;0.610334;, - 0.328585;-0.751302;0.572344;, - 0.400474;-0.751305;0.524559;, - 0.045817;-0.713678;0.698974;, - 0.084545;-0.751304;0.654519;, - 0.156107;-0.792784;0.589173;, - 0.231672;-0.792785;0.563756;, - 0.303277;-0.792784;0.528694;, - 0.369695;-0.792783;0.484584;, - 0.042666;-0.757931;0.650938;, - 0.077869;-0.792785;0.604507;, - 0.142299;-0.830873;0.537960;, - 0.211301;-0.830873;0.514784;, - 0.276683;-0.830874;0.482799;, - 0.337339;-0.830873;0.442552;, - 0.039335;-0.798935;0.600129;, - 0.070862;-0.830874;0.551930;, - 0.127890;-0.865406;0.484475;, - 0.190035;-0.865406;0.463636;, - 0.248926;-0.865406;0.434865;, - 0.303559;-0.865406;0.398653;, - 0.035837;-0.836535;0.546741;, - 0.063562;-0.865405;0.497025;, - 0.112953;-0.896227;0.428975;, - 0.167978;-0.896227;0.410561;, - 0.220132;-0.896227;0.385123;, - 0.268515;-0.896228;0.353095;, - 0.032187;-0.870547;0.491031;, - 0.055996;-0.896226;0.440050;, - 0.097546;-0.923217;0.371692;, - 0.145224;-0.923217;0.355781;, - 0.190422;-0.923217;0.333781;, - 0.232361;-0.923217;0.306070;, - 0.028394;-0.900836;0.433231;, - 0.048191;-0.923218;0.381242;, - 0.081747;-0.946251;0.312932;, - 0.121896;-0.946250;0.299586;, - 0.159955;-0.946251;0.281112;, - 0.195281;-0.946250;0.257828;, - 0.024483;-0.927266;0.373601;, - 0.040200;-0.946251;0.320926;, - 0.065651;-0.965231;0.253022;, - 0.098117;-0.965231;0.242287;, - 0.128902;-0.965231;0.227407;, - 0.157482;-0.965231;0.208637;, - 0.020480;-0.949709;0.312464;, - 0.032065;-0.965230;0.259427;, - 0.049373;-0.980077;0.192386;, - 0.074061;-0.980077;0.184295;, - 0.097484;-0.980077;0.173051;, - 0.119235;-0.980077;0.158848;, - 0.016392;-0.968077;0.250117;, - 0.023837;-0.980077;0.197185;, - 0.033123;-0.990719;0.131825;, - 0.050046;-0.990719;0.126374;, - 0.066112;-0.990719;0.118761;, - 0.081047;-0.990720;0.109116;, - 0.012257;-0.982279;0.187024;, - 0.015630;-0.990719;0.135021;, - 0.017674;-0.997085;0.074225;, - 0.027213;-0.997085;0.071283;, - 0.036282;-0.997085;0.067122;, - 0.044735;-0.997085;0.061811;, - 0.008123;-0.992247;0.124019;, - 0.007831;-0.997085;0.075897;, - 0.020895;-0.999782;0.000000;, - 0.052418;-0.997085;0.055445;, - 0.094596;-0.990720;0.097603;, - 0.004282;-0.997850;0.065402;, - 0.138951;-0.980077;0.141924;, - 0.106528;-0.990719;0.084420;, - 0.156288;-0.980077;0.122572;, - 0.183368;-0.965231;0.186296;, - 0.059207;-0.997085;0.048128;, - 0.064982;-0.997085;0.039990;, - 0.116635;-0.990719;0.069793;, - 0.170949;-0.980077;0.101125;, - 0.206116;-0.965231;0.160768;, - 0.069647;-0.997085;0.031164;, - 0.124746;-0.990719;0.053975;, - 0.182685;-0.980077;0.077949;, - 0.225334;-0.965231;0.132491;, - 0.255356;-0.946251;0.198503;, - 0.227264;-0.946250;0.230134;, - 0.073117;-0.997085;0.021808;, - 0.130724;-0.990720;0.037231;, - 0.191299;-0.980076;0.053433;, - 0.240703;-0.965231;0.101942;, - 0.279081;-0.946251;0.163473;, - 0.075339;-0.997085;0.012075;, - 0.134466;-0.990719;0.019844;, - 0.196636;-0.980077;0.028007;, - 0.251949;-0.965231;0.069654;, - 0.298033;-0.946250;0.125645;, - 0.076271;-0.997085;0.002138;, - 0.135906;-0.990719;0.002126;, - 0.198609;-0.980077;0.002103;, - 0.258885;-0.965231;0.036171;, - 0.311882;-0.946251;0.085671;, - 0.075897;-0.997085;-0.007831;, - 0.135021;-0.990719;-0.015630;, - 0.197185;-0.980077;-0.023837;, - 0.261392;-0.965230;0.002071;, - 0.320396;-0.946251;0.044227;, - 0.074225;-0.997085;-0.017674;, - 0.131825;-0.990719;-0.033123;, - 0.192386;-0.980077;-0.049373;, - 0.259427;-0.965230;-0.032065;, - 0.323428;-0.946250;0.002029;, - 0.071283;-0.997085;-0.027213;, - 0.126374;-0.990719;-0.050046;, - 0.184295;-0.980077;-0.074061;, - 0.253022;-0.965231;-0.065651;, - 0.320926;-0.946251;-0.040200;, - 0.067122;-0.997085;-0.036282;, - 0.118761;-0.990720;-0.066112;, - 0.173051;-0.980077;-0.097484;, - 0.242287;-0.965231;-0.098117;, - 0.312932;-0.946251;-0.081747;, - 0.061811;-0.997085;-0.044735;, - 0.109116;-0.990720;-0.081047;, - 0.158848;-0.980077;-0.119235;, - 0.227407;-0.965231;-0.128902;, - 0.299586;-0.946250;-0.121896;, - 0.055445;-0.997085;-0.052418;, - 0.097603;-0.990720;-0.094596;, - 0.141924;-0.980077;-0.138951;, - 0.208637;-0.965231;-0.157482;, - 0.281112;-0.946251;-0.159955;, - 0.048128;-0.997085;-0.059207;, - 0.084420;-0.990719;-0.106528;, - 0.122572;-0.980077;-0.156288;, - 0.186296;-0.965231;-0.183368;, - 0.257828;-0.946250;-0.195281;, - 0.039990;-0.997085;-0.064982;, - 0.069793;-0.990719;-0.116635;, - 0.101125;-0.980077;-0.170949;, - 0.160768;-0.965231;-0.206116;, - 0.230134;-0.946250;-0.227264;, - 0.031164;-0.997085;-0.069647;, - 0.053975;-0.990719;-0.124746;, - 0.077949;-0.980077;-0.182685;, - 0.132491;-0.965231;-0.225334;, - 0.198503;-0.946251;-0.255356;, - 0.021808;-0.997085;-0.073117;, - 0.037231;-0.990720;-0.130724;, - 0.053433;-0.980076;-0.191299;, - 0.101942;-0.965231;-0.240703;, - 0.163473;-0.946251;-0.279081;, - 0.012075;-0.997085;-0.075339;, - 0.019844;-0.990719;-0.134466;, - 0.028007;-0.980077;-0.196636;, - 0.069654;-0.965231;-0.251949;, - 0.125645;-0.946250;-0.298033;, - -0.000000;-0.996656;-0.081707;, - 0.000000;-0.989520;-0.144398;, - 0.000000;-0.978156;-0.207874;, - 0.036171;-0.965231;-0.258885;, - 0.085671;-0.946250;-0.311882;, - 0.148886;-0.923217;-0.354265;, - 0.193852;-0.923217;-0.331801;, - -0.019844;-0.990719;-0.134466;, - -0.028007;-0.980077;-0.196636;, - -0.036171;-0.965231;-0.258885;, - 0.000000;-0.962604;-0.270914;, - 0.044227;-0.946251;-0.320396;, - 0.101372;-0.923218;-0.370666;, - -0.012075;-0.997085;-0.075339;, - -0.037231;-0.990720;-0.130724;, - -0.053433;-0.980076;-0.191299;, - -0.069654;-0.965231;-0.251949;, - -0.085671;-0.946251;-0.311882;, - -0.044227;-0.946251;-0.320396;, - -0.020895;-0.999782;0.000000;, - -0.021808;-0.997085;-0.073117;, - -0.053975;-0.990719;-0.124746;, - -0.077949;-0.980077;-0.182685;, - -0.101942;-0.965231;-0.240703;, - -0.125645;-0.946250;-0.298033;, - -0.031164;-0.997085;-0.069647;, - -0.069793;-0.990719;-0.116635;, - -0.101125;-0.980077;-0.170949;, - -0.132491;-0.965231;-0.225334;, - -0.163473;-0.946251;-0.279081;, - -0.039990;-0.997085;-0.064982;, - -0.084420;-0.990719;-0.106528;, - -0.122572;-0.980077;-0.156288;, - -0.160768;-0.965231;-0.206116;, - -0.198503;-0.946251;-0.255356;, - -0.048128;-0.997085;-0.059207;, - -0.097603;-0.990720;-0.094596;, - -0.141924;-0.980077;-0.138951;, - -0.186296;-0.965231;-0.183368;, - -0.230134;-0.946250;-0.227264;, - -0.055445;-0.997085;-0.052418;, - -0.109116;-0.990720;-0.081047;, - -0.158848;-0.980077;-0.119235;, - -0.208637;-0.965231;-0.157482;, - -0.257828;-0.946250;-0.195281;, - -0.061811;-0.997085;-0.044735;, - -0.118761;-0.990720;-0.066112;, - -0.173051;-0.980077;-0.097484;, - -0.227407;-0.965231;-0.128902;, - -0.281112;-0.946251;-0.159955;, - -0.067122;-0.997085;-0.036282;, - -0.126374;-0.990719;-0.050046;, - -0.184295;-0.980077;-0.074061;, - -0.242287;-0.965231;-0.098117;, - -0.299586;-0.946250;-0.121896;, - -0.071283;-0.997085;-0.027213;, - -0.131825;-0.990719;-0.033123;, - -0.192386;-0.980077;-0.049373;, - -0.253022;-0.965231;-0.065651;, - -0.312932;-0.946251;-0.081747;, - -0.074225;-0.997085;-0.017674;, - -0.135021;-0.990719;-0.015630;, - -0.197185;-0.980077;-0.023837;, - -0.259427;-0.965230;-0.032065;, - -0.320926;-0.946251;-0.040200;, - -0.075897;-0.997085;-0.007831;, - -0.135906;-0.990719;0.002126;, - -0.198609;-0.980077;0.002103;, - -0.261392;-0.965230;0.002071;, - -0.323428;-0.946250;0.002029;, - -0.076271;-0.997085;0.002138;, - -0.134466;-0.990719;0.019844;, - -0.196636;-0.980077;0.028007;, - -0.258885;-0.965231;0.036171;, - -0.320396;-0.946251;0.044227;, - -0.075339;-0.997085;0.012075;, - -0.130724;-0.990720;0.037231;, - -0.191299;-0.980076;0.053433;, - -0.251949;-0.965231;0.069654;, - -0.311882;-0.946251;0.085671;, - -0.073117;-0.997085;0.021808;, - -0.124746;-0.990719;0.053975;, - -0.182685;-0.980077;0.077949;, - -0.240703;-0.965231;0.101942;, - -0.298033;-0.946250;0.125645;, - -0.069647;-0.997085;0.031164;, - -0.116635;-0.990719;0.069793;, - -0.170949;-0.980077;0.101125;, - -0.225334;-0.965231;0.132491;, - -0.279081;-0.946251;0.163473;, - -0.064982;-0.997085;0.039990;, - -0.106528;-0.990719;0.084420;, - -0.156288;-0.980077;0.122572;, - -0.206116;-0.965231;0.160768;, - -0.255356;-0.946251;0.198503;, - -0.059207;-0.997085;0.048128;, - -0.094596;-0.990720;0.097603;, - -0.138951;-0.980077;0.141924;, - -0.183368;-0.965231;0.186296;, - -0.227264;-0.946250;0.230134;, - -0.052418;-0.997085;0.055445;, - -0.081047;-0.990720;0.109116;, - -0.119235;-0.980077;0.158848;, - -0.157482;-0.965231;0.208637;, - -0.195281;-0.946250;0.257828;, - -0.044735;-0.997085;0.061811;, - -0.066112;-0.990720;0.118761;, - -0.097484;-0.980077;0.173051;, - -0.128902;-0.965231;0.227407;, - -0.159955;-0.946251;0.281112;, - -0.036282;-0.997085;0.067122;, - -0.050046;-0.990719;0.126374;, - -0.074061;-0.980077;0.184295;, - -0.098117;-0.965231;0.242287;, - -0.121896;-0.946250;0.299586;, - -0.027213;-0.997085;0.071283;, - -0.033123;-0.990719;0.131825;, - -0.049373;-0.980077;0.192386;, - -0.065651;-0.965231;0.253022;, - -0.081747;-0.946251;0.312932;, - -0.017674;-0.997085;0.074225;, - -0.015630;-0.990719;0.135021;, - -0.023837;-0.980077;0.197185;, - -0.032065;-0.965230;0.259427;, - -0.040200;-0.946251;0.320926;, - -0.007831;-0.997085;0.075897;, - -0.008123;-0.992247;0.124019;, - -0.012257;-0.982279;0.187024;, - -0.016392;-0.968077;0.250117;, - -0.020480;-0.949709;0.312464;, - -0.004282;-0.997850;0.065402;, - -0.024483;-0.927266;0.373601;, - -0.048191;-0.923218;0.381243;, - -0.097546;-0.923217;0.371692;, - -0.145224;-0.923217;0.355781;, - -0.028394;-0.900836;0.433231;, - -0.055996;-0.896226;0.440050;, - -0.112953;-0.896227;0.428975;, - -0.167978;-0.896227;0.410561;, - -0.190422;-0.923217;0.333781;, - -0.232361;-0.923217;0.306070;, - -0.032187;-0.870547;0.491031;, - -0.063562;-0.865405;0.497025;, - -0.127890;-0.865406;0.484475;, - -0.190035;-0.865406;0.463636;, - -0.220132;-0.896227;0.385123;, - -0.268515;-0.896228;0.353095;, - -0.270322;-0.923217;0.273123;, - -0.035837;-0.836535;0.546741;, - -0.070862;-0.830874;0.551930;, - -0.142299;-0.830873;0.537960;, - -0.211301;-0.830873;0.514784;, - -0.248926;-0.865406;0.434865;, - -0.303559;-0.865406;0.398653;, - -0.312308;-0.896227;0.315026;, - -0.039335;-0.798935;0.600129;, - -0.077869;-0.792785;0.604507;, - -0.156107;-0.792784;0.589173;, - -0.231672;-0.792785;0.563756;, - -0.276683;-0.830874;0.482799;, - -0.337339;-0.830873;0.442552;, - -0.352997;-0.865406;0.355621;, - -0.042666;-0.757931;0.650938;, - -0.084545;-0.751304;0.654519;, - -0.169250;-0.751305;0.637883;, - -0.251063;-0.751305;0.610334;, - -0.303277;-0.792784;0.528694;, - -0.369695;-0.792783;0.484584;, - -0.392214;-0.830874;0.394737;, - -0.045817;-0.713678;0.698974;, - -0.090858;-0.706602;0.701754;, - -0.181676;-0.706604;0.683890;, - -0.269394;-0.706599;0.654327;, - -0.328585;-0.751302;0.572344;, - -0.400474;-0.751305;0.524559;, - -0.429776;-0.792785;0.432185;, - -0.048766;-0.666386;0.744010;, - -0.096785;-0.658872;0.746003;, - -0.193335;-0.658867;0.726991;, - -0.286572;-0.658870;0.695534;, - -0.352493;-0.706600;0.613567;, - -0.429560;-0.706603;0.562309;, - -0.465517;-0.751305;0.467797;, - -0.051507;-0.616255;0.785861;, - -0.102304;-0.608323;0.787069;, - -0.204161;-0.608324;0.766981;, - -0.302523;-0.608328;0.733769;, - -0.374900;-0.658874;0.652178;, - -0.456820;-0.658873;0.597663;, - -0.499285;-0.706601;0.501428;, - -0.054033;-0.563506;0.824343;, - -0.107383;-0.555173;0.824774;, - -0.214116;-0.555175;0.803701;, - -0.317189;-0.555175;0.768877;, - -0.395711;-0.608327;0.688005;, - -0.482130;-0.608326;0.630469;, - -0.530922;-0.658874;0.532923;, - -0.056323;-0.508359;0.859301;, - -0.112002;-0.499646;0.858958;, - -0.223159;-0.499646;0.836991;, - -0.330502;-0.499642;0.800703;, - -0.414835;-0.555174;0.720898;, - -0.505383;-0.555172;0.660585;, - -0.560298;-0.608326;0.562144;, - -0.058373;-0.451058;0.890584;, - -0.116144;-0.441976;0.889476;, - -0.231253;-0.441972;0.866708;, - -0.342404;-0.441968;0.829110;, - -0.432187;-0.499643;0.750714;, - -0.526478;-0.499643;0.687879;, - -0.587285;-0.555169;0.588968;, - -0.060174;-0.391829;0.918068;, - -0.119793;-0.382405;0.916197;, - -0.238358;-0.382404;0.892722;, - -0.352839;-0.382407;0.853973;, - -0.447691;-0.441971;0.777325;, - -0.545324;-0.441973;0.712237;, - -0.611759;-0.499645;0.613275;, - -0.061717;-0.330950;0.941628;, - -0.122927;-0.321209;0.938996;, - -0.244439;-0.321212;0.914917;, - -0.361766;-0.321215;0.875184;, - -0.461284;-0.382408;0.800613;, - -0.561839;-0.382409;0.733553;, - -0.633621;-0.441977;0.634965;, - -0.063000;-0.268669;0.961170;, - -0.125534;-0.258637;0.957783;, - -0.249477;-0.258638;0.933203;, - -0.369151;-0.258633;0.892657;, - -0.472906;-0.321211;0.820478;, - -0.575955;-0.321206;0.751733;, - -0.652782;-0.382408;0.653942;, - -0.064008;-0.205253;0.976614;, - -0.127605;-0.194953;0.972476;, - -0.253453;-0.194947;0.947501;, - -0.374954;-0.194954;0.906313;, - -0.482508;-0.258631;0.836837;, - -0.587607;-0.258633;0.766698;, - -0.669148;-0.321208;0.670124;, - -0.064748;-0.140963;0.987895;, - -0.129135;-0.130430;0.983012;, - -0.256337;-0.130436;0.957746;, - -0.379157;-0.130433;0.916094;, - -0.490046;-0.194952;0.849617;, - -0.596748;-0.194949;0.778387;, - -0.682655;-0.258632;0.683441;, - -0.065214;-0.076077;0.994967;, - -0.130108;-0.065357;0.989343;, - -0.258130;-0.065356;0.963897;, - -0.381738;-0.065355;0.921957;, - -0.495489;-0.130428;0.858766;, - -0.603337;-0.130435;0.786747;, - -0.693245;-0.194947;0.693835;, - -0.065399;-0.010874;0.997800;, - -0.130525;0.000000;0.991445;, - -0.258819;-0.000002;0.965926;, - -0.382685;-0.000000;0.923879;, - -0.498808;-0.065361;0.864244;, - -0.607348;-0.065357;0.791743;, - -0.700868;-0.130435;0.701263;, - -0.065307;0.054380;0.996382;, - -0.130385;0.065356;0.989307;, - -0.258402;0.065359;0.963824;, - -0.381996;0.065356;0.921850;, - -0.500001;0.000003;0.866025;, - -0.608759;-0.000000;0.793355;, - -0.705495;-0.065360;0.705695;, - -0.064936;0.119402;0.990720;, - -0.129688;0.130433;0.982939;, - -0.256879;0.130431;0.957602;, - -0.379675;0.130433;0.915879;, - -0.499052;0.065353;0.864104;, - -0.607569;0.065356;0.791574;, - -0.707107;0.000000;0.707107;, - -0.064284;0.183916;0.980838;, - -0.128436;0.194951;0.972368;, - -0.254258;0.194952;0.947284;, - -0.375729;0.194951;0.905992;, - -0.495971;0.130434;0.858487;, - -0.603783;0.130436;0.786405;, - -0.705695;0.065360;0.705495;, - -0.063366;0.247660;0.966773;, - -0.126635;0.258637;0.957638;, - -0.250550;0.258635;0.932916;, - -0.370176;0.258636;0.892232;, - -0.490768;0.194948;0.849201;, - -0.597414;0.194952;0.777876;, - -0.701263;0.130435;0.700868;, - -0.062174;0.310348;0.948588;, - -0.124292;0.321208;0.938817;, - -0.245771;0.321212;0.914560;, - -0.363040;0.321211;0.874657;, - -0.483469;0.258636;0.836281;, - -0.588488;0.258630;0.766024;, - -0.693835;0.194947;0.693245;, - -0.060717;0.371721;0.926357;, - -0.121420;0.382407;0.915981;, - -0.239941;0.382406;0.892297;, - -0.354355;0.382407;0.853345;, - -0.474099;0.321208;0.819790;, - -0.577047;0.321209;0.750893;, - -0.683441;0.258632;0.682655;, - -0.059001;0.431530;0.900167;, - -0.118026;0.441975;0.889229;, - -0.233086;0.441973;0.866216;, - -0.344154;0.441970;0.828384;, - -0.462705;0.382409;0.799792;, - -0.563141;0.382406;0.732556;, - -0.670124;0.321208;0.669148;, - -0.057032;0.489503;0.870135;, - -0.114128;0.499645;0.858679;, - -0.225232;0.499645;0.836436;, - -0.332481;0.499641;0.799885;, - -0.449335;0.441969;0.776377;, - -0.546828;0.441972;0.711084;, - -0.653942;0.382408;0.652782;, - -0.054823;0.545394;0.836385;, - -0.109745;0.555174;0.824462;, - -0.216418;0.555175;0.803084;, - -0.319390;0.555175;0.767966;, - -0.434044;0.499644;0.749641;, - -0.528179;0.499647;0.686571;, - -0.634965;0.441977;0.633621;, - -0.052373;0.598970;0.799057;, - -0.104891;0.608323;0.786728;, - -0.206681;0.608323;0.766307;, - -0.304936;0.608326;0.732771;, - -0.416899;0.555175;0.719705;, - -0.507273;0.555172;0.659134;, - -0.613275;0.499645;0.611759;, - -0.049701;0.649993;0.758313;, - -0.099591;0.658871;0.745634;, - -0.196064;0.658871;0.726257;, - -0.289183;0.658871;0.694451;, - -0.397973;0.608326;0.686700;, - -0.484200;0.608324;0.628882;, - -0.588968;0.555169;0.587285;, - -0.046821;0.698262;0.714310;, - -0.093865;0.706602;0.701358;, - -0.184607;0.706601;0.683108;, - -0.272194;0.706601;0.653166;, - -0.377350;0.658873;0.650764;, - -0.459062;0.658874;0.595942;, - -0.562144;0.608326;0.560298;, - -0.043736;0.743547;0.667252;, - -0.087739;0.751305;0.654097;, - -0.172365;0.751306;0.637047;, - -0.254044;0.751305;0.609100;, - -0.355118;0.706601;0.612051;, - -0.431968;0.706602;0.560462;, - -0.532922;0.658874;0.530923;, - -0.040463;0.785659;0.617335;, - -0.081242;0.792785;0.604062;, - -0.159392;0.792784;0.588293;, - -0.234816;0.792783;0.562455;, - -0.331374;0.751303;0.570733;, - -0.403034;0.751304;0.522596;, - -0.501428;0.706601;0.499285;, - -0.037018;0.824409;0.564783;, - -0.074399;0.830873;0.551465;, - -0.145742;0.830873;0.537037;, - -0.214595;0.830874;0.513418;, - -0.306224;0.792784;0.526992;, - -0.372390;0.792784;0.482514;, - -0.467797;0.751305;0.465517;, - -0.033417;0.859642;0.509802;, - -0.067243;0.865405;0.496541;, - -0.131478;0.865405;0.483515;, - -0.193466;0.865406;0.462216;, - -0.279773;0.830874;0.481016;, - -0.340167;0.830873;0.440382;, - -0.432185;0.792785;0.429776;, - -0.029671;0.891186;0.452667;, - -0.059806;0.896226;0.439547;, - -0.116669;0.896227;0.427978;, - -0.171533;0.896228;0.409087;, - -0.252141;0.865406;0.433009;, - -0.306506;0.865407;0.396390;, - -0.394737;0.830874;0.392214;, - -0.025794;0.918920;0.393599;, - -0.052120;0.923218;0.380726;, - -0.101372;0.923218;0.370666;, - -0.148886;0.923217;0.354265;, - -0.223461;0.896227;0.383200;, - -0.271569;0.896227;0.350753;, - -0.355621;0.865406;0.352997;, - -0.021817;0.942711;0.332897;, - -0.044227;0.946251;0.320396;, - -0.085671;0.946251;0.311882;, - -0.125645;0.946250;0.298033;, - -0.193852;0.923217;0.331801;, - -0.235504;0.923217;0.303658;, - -0.315026;0.896227;0.312308;, - -0.017753;0.962452;0.270871;, - -0.036171;0.965231;0.258885;, - -0.069654;0.965231;0.251949;, - -0.101942;0.965231;0.240703;, - -0.163473;0.946251;0.279081;, - -0.198503;0.946251;0.255356;, - -0.273123;0.923217;0.270322;, - -0.013623;0.978065;0.207855;, - -0.028007;0.980076;0.196636;, - -0.053433;0.980076;0.191299;, - -0.077949;0.980077;0.182685;, - -0.132491;0.965231;0.225335;, - -0.160768;0.965231;0.206116;, - -0.230134;0.946250;0.227264;, - -0.009461;0.989475;0.144392;, - -0.019844;0.990719;0.134466;, - -0.037231;0.990720;0.130724;, - -0.053975;0.990719;0.124746;, - -0.101125;0.980077;0.170949;, - -0.122572;0.980077;0.156288;, - -0.186296;0.965231;0.183368;, - -0.005351;0.996642;0.081706;, - -0.012075;0.997085;0.075339;, - -0.021808;0.997085;0.073117;, - -0.031164;0.997085;0.069647;, - -0.069793;0.990719;0.116635;, - -0.084420;0.990719;0.106528;, - -0.141924;0.980077;0.138951;, - -0.039990;0.997085;0.064982;, - -0.048128;0.997085;0.059207;, - -0.097603;0.990720;0.094596;, - -0.158848;0.980077;0.119235;, - -0.208637;0.965231;0.157482;, - -0.055445;0.997085;0.052418;, - -0.109116;0.990720;0.081047;, - -0.173051;0.980077;0.097484;, - -0.227407;0.965231;0.128902;, - -0.281112;0.946251;0.159955;, - -0.257828;0.946250;0.195281;, - -0.061811;0.997085;0.044735;, - -0.118761;0.990720;0.066112;, - -0.184295;0.980077;0.074061;, - -0.242287;0.965231;0.098117;, - -0.299586;0.946250;0.121896;, - -0.067122;0.997085;0.036282;, - -0.126374;0.990719;0.050046;, - -0.192386;0.980077;0.049373;, - -0.253022;0.965231;0.065651;, - -0.312932;0.946251;0.081747;, - -0.071283;0.997085;0.027213;, - -0.131825;0.990719;0.033123;, - -0.197185;0.980077;0.023837;, - -0.259427;0.965230;0.032065;, - -0.320926;0.946251;0.040200;, - -0.074225;0.997085;0.017674;, - -0.135021;0.990719;0.015630;, - -0.198609;0.980077;-0.002103;, - -0.261392;0.965230;-0.002071;, - -0.323428;0.946250;-0.002029;, - -0.075897;0.997085;0.007831;, - -0.135906;0.990719;-0.002126;, - -0.196636;0.980077;-0.028007;, - -0.258885;0.965231;-0.036171;, - -0.320396;0.946251;-0.044227;, - -0.076271;0.997085;-0.002138;, - -0.134466;0.990719;-0.019844;, - -0.191299;0.980076;-0.053433;, - -0.251949;0.965231;-0.069654;, - -0.311882;0.946251;-0.085671;, - -0.075339;0.997085;-0.012075;, - -0.130724;0.990720;-0.037231;, - -0.182685;0.980077;-0.077949;, - -0.240703;0.965231;-0.101942;, - -0.298033;0.946250;-0.125645;, - -0.073117;0.997085;-0.021808;, - -0.124746;0.990719;-0.053975;, - -0.170949;0.980077;-0.101125;, - -0.225334;0.965231;-0.132491;, - -0.279081;0.946251;-0.163473;, - -0.069647;0.997085;-0.031164;, - -0.116635;0.990719;-0.069793;, - -0.156288;0.980077;-0.122572;, - -0.206116;0.965231;-0.160768;, - -0.255356;0.946251;-0.198503;, - -0.064982;0.997085;-0.039990;, - -0.106528;0.990719;-0.084420;, - -0.138951;0.980077;-0.141924;, - -0.183368;0.965231;-0.186296;, - -0.227264;0.946250;-0.230134;, - -0.059207;0.997085;-0.048128;, - -0.157482;0.965231;-0.208637;, - -0.195281;0.946250;-0.257828;, - -0.159955;0.946251;-0.281112;, - -0.190422;0.923217;-0.333781;, - -0.232361;0.923217;-0.306070;, - -0.270322;0.923217;-0.273123;, - -0.121896;0.946250;-0.299586;, - -0.145224;0.923217;-0.355781;, - -0.167978;0.896227;-0.410561;, - -0.220132;0.896227;-0.385123;, - -0.268515;0.896228;-0.353095;, - -0.097546;0.923217;-0.371692;, - -0.112953;0.896227;-0.428975;, - -0.127890;0.865406;-0.484475;, - -0.190035;0.865406;-0.463636;, - -0.248926;0.865406;-0.434865;, - -0.048191;0.923218;-0.381242;, - -0.055996;0.896226;-0.440050;, - -0.063562;0.865405;-0.497025;, - -0.070862;0.830874;-0.551930;, - -0.142299;0.830873;-0.537960;, - -0.211301;0.830873;-0.514784;, - 0.000000;0.901199;-0.433406;, - -0.000000;0.870999;-0.491286;, - 0.000000;0.837073;-0.547092;, - 0.000000;0.799554;-0.600594;, - -0.077869;0.792785;-0.604507;, - -0.156107;0.792784;-0.589173;, - 0.055996;0.896226;-0.440050;, - 0.063562;0.865405;-0.497025;, - 0.070862;0.830874;-0.551930;, - 0.077869;0.792785;-0.604507;, - 0.000000;0.758621;-0.651532;, - -0.084545;0.751304;-0.654519;, - 0.112953;0.896227;-0.428975;, - 0.127890;0.865406;-0.484475;, - 0.142299;0.830873;-0.537960;, - 0.156107;0.792784;-0.589173;, - 0.084545;0.751304;-0.654519;, - 0.000000;0.714428;-0.699709;, - 0.167978;0.896227;-0.410561;, - 0.190035;0.865406;-0.463636;, - 0.211301;0.830873;-0.514784;, - 0.231672;0.792785;-0.563756;, - 0.169250;0.751305;-0.637883;, - 0.090858;0.706602;-0.701754;, - 0.220132;0.896227;-0.385123;, - 0.248926;0.865406;-0.434865;, - 0.276683;0.830874;-0.482799;, - 0.303277;0.792784;-0.528694;, - 0.251063;0.751305;-0.610334;, - 0.181676;0.706604;-0.683890;, - 0.268515;0.896228;-0.353095;, - 0.303559;0.865406;-0.398653;, - 0.337339;0.830873;-0.442552;, - 0.369695;0.792783;-0.484584;, - 0.328585;0.751302;-0.572344;, - 0.269394;0.706599;-0.654327;, - 0.312308;0.896227;-0.315026;, - 0.352997;0.865406;-0.355621;, - 0.392214;0.830874;-0.394737;, - 0.429776;0.792785;-0.432185;, - 0.400474;0.751305;-0.524559;, - 0.352493;0.706600;-0.613567;, - 0.350753;0.896227;-0.271569;, - 0.396390;0.865407;-0.306506;, - 0.440382;0.830873;-0.340167;, - 0.482514;0.792784;-0.372390;, - 0.465517;0.751305;-0.467797;, - 0.429560;0.706603;-0.562309;, - 0.383200;0.896227;-0.223461;, - 0.433009;0.865406;-0.252141;, - 0.481016;0.830874;-0.279773;, - 0.526992;0.792784;-0.306224;, - 0.522596;0.751304;-0.403034;, - 0.499285;0.706601;-0.501428;, - 0.409087;0.896228;-0.171533;, - 0.462216;0.865406;-0.193466;, - 0.513418;0.830874;-0.214595;, - 0.562455;0.792783;-0.234816;, - 0.570733;0.751303;-0.331374;, - 0.560462;0.706602;-0.431968;, - 0.427978;0.896227;-0.116669;, - 0.483515;0.865405;-0.131478;, - 0.537037;0.830873;-0.145742;, - 0.588293;0.792784;-0.159392;, - 0.609100;0.751305;-0.254044;, - 0.612051;0.706601;-0.355118;, - 0.439547;0.896226;-0.059806;, - 0.496541;0.865405;-0.067243;, - 0.551465;0.830873;-0.074399;, - 0.604062;0.792785;-0.081242;, - 0.637047;0.751306;-0.172365;, - 0.653166;0.706601;-0.272194;, - 0.443592;0.896227;-0.001925;, - 0.501070;0.865405;-0.001856;, - 0.556458;0.830874;-0.001782;, - 0.609498;0.792786;-0.001701;, - 0.654097;0.751305;-0.087739;, - 0.683108;0.706601;-0.184607;, - 0.440050;0.896226;0.055996;, - 0.497025;0.865405;0.063562;, - 0.551930;0.830874;0.070862;, - 0.604507;0.792785;0.077869;, - 0.659953;0.751305;-0.001613;, - 0.701358;0.706602;-0.093865;, - 0.428975;0.896227;0.112953;, - 0.484475;0.865406;0.127890;, - 0.537960;0.830873;0.142299;, - 0.589173;0.792784;0.156107;, - 0.654519;0.751304;0.084545;, - 0.707610;0.706601;-0.001516;, - 0.410561;0.896227;0.167978;, - 0.463636;0.865406;0.190035;, - 0.514784;0.830873;0.211301;, - 0.563756;0.792785;0.231672;, - 0.637883;0.751305;0.169250;, - 0.701754;0.706602;0.090858;, - 0.385123;0.896227;0.220132;, - 0.434865;0.865406;0.248926;, - 0.482799;0.830874;0.276683;, - 0.528694;0.792784;0.303277;, - 0.610334;0.751305;0.251063;, - 0.683890;0.706604;0.181676;, - 0.353095;0.896228;0.268515;, - 0.398653;0.865406;0.303559;, - 0.442552;0.830873;0.337339;, - 0.484584;0.792783;0.369695;, - 0.572344;0.751302;0.328585;, - 0.654327;0.706599;0.269394;, - 0.315026;0.896227;0.312308;, - 0.355621;0.865406;0.352997;, - 0.394737;0.830874;0.392214;, - 0.432185;0.792785;0.429776;, - 0.524559;0.751305;0.400474;, - 0.613567;0.706600;0.352493;, - 0.467797;0.751305;0.465517;, - 0.562309;0.706603;0.429560;, - 0.652178;0.658874;0.374900;, - 0.695534;0.658870;0.286572;, - 0.726991;0.658867;0.193335;, - 0.501428;0.706601;0.499285;, - 0.597663;0.658873;0.456820;, - 0.688005;0.608327;0.395711;, - 0.733769;0.608328;0.302523;, - 0.766981;0.608324;0.204161;, - 0.532923;0.658874;0.530922;, - 0.630469;0.608326;0.482130;, - 0.720898;0.555174;0.414835;, - 0.768877;0.555175;0.317189;, - 0.803701;0.555175;0.214116;, - 0.562144;0.608326;0.560298;, - 0.660585;0.555172;0.505383;, - 0.750714;0.499643;0.432187;, - 0.800703;0.499642;0.330502;, - 0.836991;0.499647;0.223159;, - 0.588968;0.555169;0.587285;, - 0.687879;0.499643;0.526478;, - 0.777325;0.441971;0.447691;, - 0.829110;0.441968;0.342404;, - 0.866708;0.441972;0.231253;, - 0.613275;0.499645;0.611759;, - 0.712237;0.441973;0.545324;, - 0.800613;0.382408;0.461284;, - 0.853973;0.382407;0.352839;, - 0.892722;0.382404;0.238358;, - 0.634965;0.441977;0.633621;, - 0.733553;0.382409;0.561839;, - 0.820478;0.321211;0.472906;, - 0.875184;0.321215;0.361766;, - 0.914917;0.321212;0.244439;, - 0.653942;0.382408;0.652782;, - 0.751733;0.321206;0.575955;, - 0.836837;0.258631;0.482508;, - 0.892657;0.258633;0.369151;, - 0.933203;0.258638;0.249477;, - 0.670124;0.321208;0.669148;, - 0.766698;0.258633;0.587607;, - 0.849617;0.194952;0.490046;, - 0.906313;0.194954;0.374954;, - 0.947501;0.194947;0.253453;, - 0.683441;0.258632;0.682655;, - 0.778387;0.194949;0.596748;, - 0.858766;0.130428;0.495489;, - 0.916094;0.130433;0.379157;, - 0.957746;0.130436;0.256337;, - 0.693835;0.194947;0.693245;, - 0.786747;0.130435;0.603337;, - 0.864245;0.065361;0.498808;, - 0.921957;0.065355;0.381738;, - 0.963897;0.065356;0.258130;, - 0.701263;0.130435;0.700868;, - 0.791743;0.065357;0.607348;, - 0.866025;-0.000003;0.500001;, - 0.923879;0.000000;0.382685;, - 0.965926;0.000002;0.258819;, - 0.705695;0.065360;0.705495;, - 0.793355;0.000000;0.608759;, - 0.864104;-0.065353;0.499052;, - 0.921850;-0.065356;0.381996;, - 0.963824;-0.065359;0.258402;, - 0.707107;0.000000;0.707107;, - 0.791574;-0.065356;0.607569;, - 0.858487;-0.130434;0.495971;, - 0.915879;-0.130433;0.379675;, - 0.957602;-0.130431;0.256879;, - 0.705495;-0.065360;0.705695;, - 0.786405;-0.130436;0.603783;, - 0.849201;-0.194948;0.490768;, - 0.905992;-0.194951;0.375729;, - 0.947284;-0.194952;0.254258;, - 0.700868;-0.130435;0.701263;, - 0.777876;-0.194952;0.597414;, - 0.836281;-0.258636;0.483469;, - 0.892232;-0.258636;0.370176;, - 0.932916;-0.258635;0.250550;, - 0.693245;-0.194947;0.693835;, - 0.766024;-0.258630;0.588488;, - 0.819790;-0.321208;0.474100;, - 0.874657;-0.321211;0.363041;, - 0.914560;-0.321212;0.245771;, - 0.682655;-0.258632;0.683441;, - 0.750893;-0.321209;0.577047;, - 0.799792;-0.382409;0.462705;, - 0.853345;-0.382408;0.354355;, - 0.892297;-0.382406;0.239941;, - 0.669148;-0.321208;0.670124;, - 0.732556;-0.382406;0.563141;, - 0.776377;-0.441969;0.449335;, - 0.828384;-0.441970;0.344154;, - 0.866216;-0.441973;0.233086;, - 0.652782;-0.382408;0.653942;, - 0.711084;-0.441972;0.546828;, - 0.749641;-0.499644;0.434044;, - 0.799885;-0.499641;0.332481;, - 0.836436;-0.499645;0.225232;, - 0.633621;-0.441977;0.634965;, - 0.686571;-0.499647;0.528179;, - 0.719705;-0.555175;0.416899;, - 0.767966;-0.555175;0.319390;, - 0.803084;-0.555175;0.216418;, - 0.611759;-0.499645;0.613275;, - 0.659135;-0.555172;0.507274;, - 0.686700;-0.608326;0.397973;, - 0.732771;-0.608326;0.304936;, - 0.766307;-0.608323;0.206681;, - 0.587285;-0.555169;0.588968;, - 0.628882;-0.608324;0.484200;, - 0.650764;-0.658873;0.377350;, - 0.694451;-0.658871;0.289183;, - 0.726257;-0.658871;0.196064;, - 0.560298;-0.608326;0.562144;, - 0.595942;-0.658874;0.459062;, - 0.612051;-0.706601;0.355118;, - 0.653166;-0.706601;0.272194;, - 0.683108;-0.706601;0.184607;, - 0.530923;-0.658874;0.532923;, - 0.560462;-0.706602;0.431968;, - 0.570733;-0.751303;0.331374;, - 0.609100;-0.751305;0.254044;, - 0.637047;-0.751306;0.172365;, - 0.499285;-0.706601;0.501428;, - 0.522596;-0.751304;0.403034;, - 0.526992;-0.792784;0.306224;, - 0.562455;-0.792783;0.234816;, - 0.588293;-0.792784;0.159392;, - 0.465517;-0.751305;0.467797;, - 0.482514;-0.792784;0.372390;, - 0.481016;-0.830874;0.279773;, - 0.513418;-0.830874;0.214595;, - 0.537037;-0.830873;0.145742;, - 0.429776;-0.792785;0.432185;, - 0.440382;-0.830873;0.340167;, - 0.433009;-0.865406;0.252141;, - 0.462216;-0.865406;0.193466;, - 0.483515;-0.865405;0.131478;, - 0.392214;-0.830874;0.394737;, - 0.396390;-0.865407;0.306506;, - 0.383200;-0.896227;0.223461;, - 0.409087;-0.896228;0.171533;, - 0.427979;-0.896227;0.116669;, - 0.352997;-0.865406;0.355621;, - 0.350753;-0.896227;0.271569;, - 0.331801;-0.923217;0.193852;, - 0.354265;-0.923217;0.148886;, - 0.370666;-0.923218;0.101372;, - 0.312308;-0.896227;0.315026;, - 0.303658;-0.923217;0.235504;, - 0.270322;-0.923217;0.273123;, - 0.380726;-0.923218;0.052120;, - 0.439547;-0.896226;0.059806;, - 0.496541;-0.865405;0.067243;, - 0.384271;-0.923218;0.001981;, - 0.443592;-0.896227;0.001925;, - 0.501070;-0.865405;0.001856;, - 0.551465;-0.830873;0.074399;, - 0.604062;-0.792785;0.081242;, - 0.381243;-0.923218;-0.048191;, - 0.440050;-0.896226;-0.055996;, - 0.497025;-0.865405;-0.063562;, - 0.556458;-0.830874;0.001782;, - 0.609498;-0.792786;0.001701;, - 0.654097;-0.751305;0.087739;, - 0.371692;-0.923217;-0.097546;, - 0.428975;-0.896227;-0.112953;, - 0.484475;-0.865406;-0.127890;, - 0.551930;-0.830874;-0.070862;, - 0.604507;-0.792785;-0.077869;, - 0.659953;-0.751305;0.001613;, - 0.355781;-0.923217;-0.145224;, - 0.410561;-0.896227;-0.167978;, - 0.463636;-0.865406;-0.190035;, - 0.537960;-0.830873;-0.142299;, - 0.589173;-0.792784;-0.156107;, - 0.654519;-0.751304;-0.084545;, - 0.333781;-0.923217;-0.190422;, - 0.385123;-0.896227;-0.220132;, - 0.434865;-0.865406;-0.248926;, - 0.514784;-0.830873;-0.211301;, - 0.563756;-0.792785;-0.231672;, - 0.637883;-0.751305;-0.169250;, - 0.306070;-0.923217;-0.232361;, - 0.353095;-0.896228;-0.268515;, - 0.398653;-0.865406;-0.303559;, - 0.482799;-0.830874;-0.276683;, - 0.528694;-0.792784;-0.303277;, - 0.610334;-0.751305;-0.251063;, - 0.273123;-0.923217;-0.270322;, - 0.315026;-0.896227;-0.312308;, - 0.355621;-0.865406;-0.352997;, - 0.442552;-0.830873;-0.337339;, - 0.484584;-0.792783;-0.369695;, - 0.572344;-0.751302;-0.328585;, - 0.235504;-0.923217;-0.303657;, - 0.271569;-0.896227;-0.350753;, - 0.306506;-0.865407;-0.396390;, - 0.394737;-0.830874;-0.392214;, - 0.432185;-0.792785;-0.429776;, - 0.524559;-0.751305;-0.400474;, - 0.223461;-0.896227;-0.383200;, - 0.252141;-0.865406;-0.433009;, - 0.340167;-0.830873;-0.440382;, - 0.372390;-0.792784;-0.482514;, - 0.467797;-0.751305;-0.465517;, - 0.171533;-0.896228;-0.409087;, - 0.193466;-0.865406;-0.462216;, - 0.279773;-0.830874;-0.481016;, - 0.306224;-0.792784;-0.526992;, - 0.403034;-0.751304;-0.522596;, - 0.116669;-0.896227;-0.427978;, - 0.131478;-0.865405;-0.483515;, - 0.214595;-0.830874;-0.513418;, - 0.234816;-0.792783;-0.562455;, - 0.331374;-0.751303;-0.570733;, - 0.052120;-0.923218;-0.380726;, - 0.059806;-0.896226;-0.439547;, - 0.067243;-0.865405;-0.496541;, - 0.145742;-0.830873;-0.537037;, - 0.159392;-0.792784;-0.588293;, - 0.254044;-0.751305;-0.609100;, - -0.000000;-0.942935;-0.332977;, - -0.000000;-0.919226;-0.393730;, - -0.000000;-0.891578;-0.452867;, - 0.000000;-0.860123;-0.510087;, - 0.074399;-0.830873;-0.551465;, - -0.052120;-0.923218;-0.380726;, - -0.059806;-0.896226;-0.439547;, - -0.067243;-0.865405;-0.496541;, - -0.074399;-0.830873;-0.551465;, - 0.000000;-0.824974;-0.565170;, - 0.081242;-0.792785;-0.604062;, - -0.101372;-0.923218;-0.370666;, - -0.116669;-0.896227;-0.427978;, - -0.131478;-0.865405;-0.483515;, - -0.145742;-0.830873;-0.537037;, - -0.159392;-0.792784;-0.588293;, - -0.081242;-0.792785;-0.604062;, - -0.148886;-0.923217;-0.354265;, - -0.171533;-0.896228;-0.409087;, - -0.193466;-0.865406;-0.462216;, - -0.214595;-0.830874;-0.513418;, - -0.234816;-0.792783;-0.562455;, - -0.193852;-0.923217;-0.331801;, - -0.223461;-0.896227;-0.383200;, - -0.252141;-0.865406;-0.433009;, - -0.279773;-0.830874;-0.481016;, - -0.306224;-0.792784;-0.526992;, - -0.235504;-0.923217;-0.303658;, - -0.271569;-0.896227;-0.350753;, - -0.306506;-0.865407;-0.396390;, - -0.340167;-0.830873;-0.440382;, - -0.372390;-0.792784;-0.482514;, - -0.273123;-0.923217;-0.270322;, - -0.315026;-0.896227;-0.312308;, - -0.355621;-0.865406;-0.352997;, - -0.394737;-0.830874;-0.392214;, - -0.432185;-0.792785;-0.429776;, - -0.306070;-0.923217;-0.232361;, - -0.353095;-0.896228;-0.268515;, - -0.398653;-0.865406;-0.303559;, - -0.442552;-0.830873;-0.337339;, - -0.484584;-0.792783;-0.369695;, - -0.333781;-0.923217;-0.190422;, - -0.385123;-0.896227;-0.220132;, - -0.434865;-0.865406;-0.248926;, - -0.482799;-0.830874;-0.276683;, - -0.528694;-0.792784;-0.303277;, - -0.355781;-0.923217;-0.145224;, - -0.410561;-0.896227;-0.167978;, - -0.463636;-0.865406;-0.190035;, - -0.514784;-0.830873;-0.211301;, - -0.563756;-0.792785;-0.231672;, - -0.371692;-0.923217;-0.097546;, - -0.428975;-0.896227;-0.112953;, - -0.484475;-0.865406;-0.127890;, - -0.537960;-0.830873;-0.142299;, - -0.589173;-0.792784;-0.156107;, - -0.381242;-0.923218;-0.048191;, - -0.440050;-0.896226;-0.055996;, - -0.497025;-0.865405;-0.063562;, - -0.551930;-0.830874;-0.070862;, - -0.604507;-0.792785;-0.077869;, - -0.384271;-0.923218;0.001981;, - -0.443592;-0.896227;0.001925;, - -0.501070;-0.865405;0.001856;, - -0.556458;-0.830874;0.001782;, - -0.609498;-0.792786;0.001701;, - -0.380726;-0.923218;0.052120;, - -0.439547;-0.896226;0.059806;, - -0.496541;-0.865405;0.067243;, - -0.551465;-0.830873;0.074399;, - -0.604062;-0.792785;0.081242;, - -0.370666;-0.923218;0.101372;, - -0.427978;-0.896227;0.116669;, - -0.483515;-0.865405;0.131478;, - -0.537037;-0.830873;0.145742;, - -0.588293;-0.792784;0.159392;, - -0.354265;-0.923217;0.148886;, - -0.409087;-0.896228;0.171533;, - -0.462216;-0.865406;0.193466;, - -0.513418;-0.830874;0.214595;, - -0.562455;-0.792783;0.234816;, - -0.331801;-0.923217;0.193852;, - -0.383200;-0.896227;0.223461;, - -0.433009;-0.865406;0.252141;, - -0.481016;-0.830874;0.279773;, - -0.526992;-0.792784;0.306224;, - -0.303658;-0.923217;0.235504;, - -0.350753;-0.896227;0.271569;, - -0.396390;-0.865407;0.306506;, - -0.440382;-0.830873;0.340167;, - -0.482514;-0.792784;0.372390;, - -0.522596;-0.751304;0.403034;, - -0.570733;-0.751303;0.331374;, - -0.609100;-0.751305;0.254044;, - -0.560462;-0.706602;0.431968;, - -0.612051;-0.706601;0.355118;, - -0.653166;-0.706601;0.272194;, - -0.637047;-0.751306;0.172365;, - -0.654097;-0.751305;0.087739;, - -0.595942;-0.658874;0.459062;, - -0.650764;-0.658873;0.377350;, - -0.694451;-0.658871;0.289183;, - -0.683108;-0.706601;0.184607;, - -0.701358;-0.706602;0.093865;, - -0.659953;-0.751305;0.001613;, - -0.628882;-0.608324;0.484200;, - -0.686700;-0.608326;0.397973;, - -0.732771;-0.608326;0.304936;, - -0.726257;-0.658871;0.196064;, - -0.745634;-0.658871;0.099591;, - -0.707610;-0.706601;0.001516;, - -0.659134;-0.555172;0.507274;, - -0.719705;-0.555175;0.416899;, - -0.767965;-0.555175;0.319390;, - -0.766307;-0.608323;0.206681;, - -0.786728;-0.608323;0.104891;, - -0.752255;-0.658870;0.001413;, - -0.686571;-0.499647;0.528179;, - -0.749641;-0.499644;0.434044;, - -0.799885;-0.499641;0.332481;, - -0.803084;-0.555175;0.216418;, - -0.824462;-0.555174;0.109745;, - -0.793687;-0.608325;0.001306;, - -0.711084;-0.441972;0.546828;, - -0.776377;-0.441969;0.449335;, - -0.828384;-0.441970;0.344154;, - -0.836436;-0.499645;0.225232;, - -0.858679;-0.499645;0.114128;, - -0.831734;-0.555173;0.001192;, - -0.732556;-0.382406;0.563141;, - -0.799792;-0.382409;0.462705;, - -0.853345;-0.382408;0.354355;, - -0.866216;-0.441973;0.233086;, - -0.889229;-0.441975;0.118026;, - -0.866230;-0.499644;0.001071;, - -0.750893;-0.321209;0.577048;, - -0.819790;-0.321208;0.474099;, - -0.874657;-0.321211;0.363041;, - -0.892297;-0.382406;0.239941;, - -0.915981;-0.382408;0.121421;, - -0.897026;-0.441977;0.000949;, - -0.766024;-0.258630;0.588488;, - -0.836281;-0.258636;0.483469;, - -0.892232;-0.258636;0.370176;, - -0.914560;-0.321212;0.245771;, - -0.938817;-0.321208;0.124292;, - -0.923994;-0.382406;0.000820;, - -0.777876;-0.194952;0.597414;, - -0.849201;-0.194948;0.490768;, - -0.905992;-0.194951;0.375729;, - -0.932916;-0.258635;0.250550;, - -0.957638;-0.258637;0.126635;, - -0.947008;-0.321208;0.000690;, - -0.786405;-0.130436;0.603783;, - -0.858487;-0.130434;0.495971;, - -0.915879;-0.130433;0.379675;, - -0.947284;-0.194952;0.254258;, - -0.972368;-0.194951;0.128436;, - -0.965975;-0.258635;0.000554;, - -0.791574;-0.065356;0.607569;, - -0.864104;-0.065353;0.499052;, - -0.921850;-0.065356;0.381996;, - -0.957602;-0.130431;0.256879;, - -0.982939;-0.130433;0.129688;, - -0.980813;-0.194951;0.000418;, - -0.793355;0.000000;0.608759;, - -0.866025;-0.000003;0.500001;, - -0.923879;0.000000;0.382685;, - -0.963824;-0.065359;0.258402;, - -0.989307;-0.065356;0.130385;, - -0.991457;-0.130434;0.000281;, - -0.791743;0.065357;0.607348;, - -0.864244;0.065361;0.498808;, - -0.921957;0.065355;0.381738;, - -0.965926;0.000002;0.258819;, - -0.991445;-0.000000;0.130525;, - -0.997862;-0.065356;0.000140;, - -0.786747;0.130435;0.603337;, - -0.858766;0.130428;0.495489;, - -0.916094;0.130433;0.379157;, - -0.963897;0.065356;0.258130;, - -0.989343;0.065357;0.130108;, - -1.000000;-0.000000;-0.000000;, - -0.778387;0.194949;0.596748;, - -0.849617;0.194952;0.490046;, - -0.906313;0.194954;0.374954;, - -0.957746;0.130436;0.256337;, - -0.983012;0.130430;0.129135;, - -0.997862;0.065356;-0.000140;, - -0.766698;0.258633;0.587607;, - -0.836837;0.258631;0.482508;, - -0.892657;0.258633;0.369151;, - -0.947501;0.194947;0.253453;, - -0.972476;0.194953;0.127605;, - -0.991457;0.130434;-0.000281;, - -0.751733;0.321206;0.575955;, - -0.820478;0.321211;0.472906;, - -0.875184;0.321215;0.361766;, - -0.933203;0.258638;0.249477;, - -0.957783;0.258637;0.125534;, - -0.980813;0.194951;-0.000418;, - -0.733553;0.382409;0.561839;, - -0.800613;0.382408;0.461284;, - -0.853973;0.382407;0.352839;, - -0.914917;0.321212;0.244439;, - -0.938996;0.321209;0.122927;, - -0.965975;0.258635;-0.000554;, - -0.712237;0.441973;0.545324;, - -0.777325;0.441971;0.447691;, - -0.829110;0.441968;0.342404;, - -0.892722;0.382404;0.238358;, - -0.916197;0.382405;0.119793;, - -0.947008;0.321208;-0.000690;, - -0.687879;0.499643;0.526478;, - -0.750714;0.499643;0.432187;, - -0.800703;0.499642;0.330502;, - -0.866708;0.441972;0.231253;, - -0.889476;0.441976;0.116144;, - -0.923994;0.382406;-0.000820;, - -0.660585;0.555172;0.505383;, - -0.720898;0.555174;0.414835;, - -0.768877;0.555175;0.317189;, - -0.836991;0.499647;0.223159;, - -0.858958;0.499646;0.112002;, - -0.897026;0.441977;-0.000949;, - -0.630469;0.608326;0.482130;, - -0.688005;0.608327;0.395711;, - -0.733769;0.608328;0.302523;, - -0.803701;0.555175;0.214116;, - -0.824774;0.555173;0.107383;, - -0.866230;0.499645;-0.001071;, - -0.597664;0.658873;0.456820;, - -0.652178;0.658874;0.374900;, - -0.695534;0.658870;0.286572;, - -0.766981;0.608324;0.204161;, - -0.787069;0.608323;0.102304;, - -0.831734;0.555173;-0.001192;, - -0.562309;0.706603;0.429560;, - -0.613567;0.706600;0.352493;, - -0.654327;0.706599;0.269394;, - -0.726991;0.658867;0.193335;, - -0.746003;0.658872;0.096785;, - -0.793687;0.608325;-0.001306;, - -0.524559;0.751305;0.400474;, - -0.572344;0.751302;0.328585;, - -0.610334;0.751305;0.251063;, - -0.683890;0.706604;0.181676;, - -0.701754;0.706602;0.090858;, - -0.752255;0.658870;-0.001413;, - -0.484584;0.792783;0.369695;, - -0.528694;0.792784;0.303277;, - -0.563756;0.792785;0.231672;, - -0.637883;0.751305;0.169250;, - -0.654519;0.751304;0.084545;, - -0.707610;0.706601;-0.001516;, - -0.442552;0.830874;0.337339;, - -0.482799;0.830874;0.276683;, - -0.514784;0.830873;0.211301;, - -0.589173;0.792784;0.156107;, - -0.604507;0.792785;0.077869;, - -0.659953;0.751305;-0.001613;, - -0.398653;0.865406;0.303559;, - -0.434865;0.865406;0.248926;, - -0.463636;0.865406;0.190035;, - -0.537960;0.830873;0.142299;, - -0.551930;0.830874;0.070862;, - -0.609498;0.792786;-0.001701;, - -0.353095;0.896228;0.268515;, - -0.385123;0.896227;0.220132;, - -0.410561;0.896227;0.167978;, - -0.484475;0.865406;0.127890;, - -0.497025;0.865405;0.063562;, - -0.556458;0.830874;-0.001782;, - -0.306070;0.923217;0.232361;, - -0.333781;0.923217;0.190422;, - -0.355781;0.923217;0.145224;, - -0.428975;0.896227;0.112953;, - -0.440050;0.896226;0.055996;, - -0.501070;0.865405;-0.001856;, - -0.371692;0.923217;0.097546;, - -0.381242;0.923218;0.048191;, - -0.443592;0.896227;-0.001925;, - -0.496541;0.865405;-0.067243;, - -0.551465;0.830873;-0.074399;, - -0.384271;0.923218;-0.001981;, - -0.439547;0.896226;-0.059806;, - -0.483515;0.865405;-0.131478;, - -0.537037;0.830873;-0.145742;, - -0.588293;0.792784;-0.159392;, - -0.604062;0.792785;-0.081242;, - -0.380726;0.923218;-0.052120;, - -0.427978;0.896227;-0.116669;, - -0.462216;0.865406;-0.193466;, - -0.513418;0.830874;-0.214595;, - -0.562455;0.792783;-0.234816;, - -0.370666;0.923218;-0.101372;, - -0.409087;0.896228;-0.171533;, - -0.433009;0.865406;-0.252141;, - -0.481016;0.830874;-0.279773;, - -0.526992;0.792784;-0.306224;, - -0.354265;0.923217;-0.148886;, - -0.383200;0.896227;-0.223461;, - -0.396390;0.865407;-0.306506;, - -0.440382;0.830873;-0.340167;, - -0.482514;0.792784;-0.372390;, - -0.331801;0.923217;-0.193852;, - -0.350753;0.896227;-0.271569;, - -0.352997;0.865406;-0.355621;, - -0.392214;0.830874;-0.394737;, - -0.429776;0.792785;-0.432185;, - -0.303658;0.923217;-0.235504;, - -0.312308;0.896227;-0.315026;, - -0.303559;0.865406;-0.398653;, - -0.337339;0.830873;-0.442552;, - -0.369695;0.792783;-0.484584;, - -0.276683;0.830874;-0.482799;, - -0.303277;0.792784;-0.528694;, - -0.328585;0.751302;-0.572344;, - -0.400474;0.751305;-0.524559;, - -0.465517;0.751305;-0.467797;, - -0.231672;0.792785;-0.563756;, - -0.251063;0.751305;-0.610334;, - -0.269394;0.706599;-0.654327;, - -0.352493;0.706600;-0.613567;, - -0.429560;0.706603;-0.562309;, - -0.169250;0.751305;-0.637883;, - -0.181676;0.706604;-0.683890;, - -0.193335;0.658867;-0.726991;, - -0.286572;0.658870;-0.695534;, - -0.374900;0.658874;-0.652178;, - -0.090858;0.706602;-0.701754;, - -0.096785;0.658872;-0.746003;, - -0.102304;0.608323;-0.787069;, - -0.204161;0.608324;-0.766981;, - -0.302523;0.608328;-0.733769;, - 0.000000;0.667180;-0.744897;, - 0.000000;0.617074;-0.786905;, - 0.000000;0.564331;-0.825549;, - -0.107383;0.555173;-0.824774;, - -0.214116;0.555175;-0.803701;, - 0.096785;0.658872;-0.746003;, - 0.102304;0.608323;-0.787069;, - 0.107383;0.555173;-0.824774;, - 0.000000;0.509167;-0.860668;, - -0.112002;0.499646;-0.858958;, - 0.193335;0.658867;-0.726991;, - 0.204161;0.608324;-0.766981;, - 0.214116;0.555175;-0.803701;, - 0.112002;0.499646;-0.858958;, - 0.000000;0.451828;-0.892105;, - 0.286572;0.658870;-0.695534;, - 0.302523;0.608328;-0.733769;, - 0.317189;0.555175;-0.768877;, - 0.223159;0.499646;-0.836991;, - 0.116144;0.441976;-0.889476;, - 0.374900;0.658874;-0.652178;, - 0.395711;0.608327;-0.688005;, - 0.414835;0.555174;-0.720898;, - 0.330502;0.499642;-0.800703;, - 0.231253;0.441972;-0.866708;, - 0.456820;0.658873;-0.597663;, - 0.482130;0.608326;-0.630469;, - 0.505383;0.555172;-0.660585;, - 0.432187;0.499643;-0.750714;, - 0.342404;0.441968;-0.829110;, - 0.530923;0.658874;-0.532923;, - 0.560298;0.608326;-0.562144;, - 0.587285;0.555169;-0.588968;, - 0.526478;0.499643;-0.687879;, - 0.447691;0.441971;-0.777325;, - 0.595942;0.658874;-0.459062;, - 0.628882;0.608324;-0.484200;, - 0.659134;0.555172;-0.507274;, - 0.611759;0.499645;-0.613275;, - 0.545324;0.441973;-0.712237;, - 0.650764;0.658873;-0.377350;, - 0.686700;0.608326;-0.397973;, - 0.719705;0.555175;-0.416899;, - 0.686571;0.499647;-0.528179;, - 0.633621;0.441977;-0.634965;, - 0.694451;0.658871;-0.289183;, - 0.732771;0.608326;-0.304936;, - 0.767966;0.555175;-0.319390;, - 0.749641;0.499644;-0.434044;, - 0.711084;0.441972;-0.546828;, - 0.726257;0.658871;-0.196064;, - 0.766307;0.608323;-0.206681;, - 0.803084;0.555175;-0.216418;, - 0.799885;0.499641;-0.332481;, - 0.776377;0.441969;-0.449335;, - 0.745634;0.658871;-0.099591;, - 0.786728;0.608323;-0.104891;, - 0.824462;0.555174;-0.109744;, - 0.836436;0.499645;-0.225232;, - 0.828384;0.441970;-0.344154;, - 0.752255;0.658870;-0.001413;, - 0.793687;0.608325;-0.001306;, - 0.831734;0.555173;-0.001192;, - 0.858679;0.499645;-0.114128;, - 0.866216;0.441973;-0.233085;, - 0.746003;0.658872;0.096785;, - 0.787069;0.608323;0.102304;, - 0.824774;0.555173;0.107383;, - 0.866230;0.499645;-0.001071;, - 0.889229;0.441975;-0.118026;, - 0.858958;0.499646;0.112002;, - 0.897026;0.441977;-0.000949;, - 0.915981;0.382407;-0.121420;, - 0.892297;0.382406;-0.239941;, - 0.853345;0.382407;-0.354355;, - 0.889476;0.441976;0.116144;, - 0.923994;0.382406;-0.000820;, - 0.938817;0.321208;-0.124292;, - 0.914560;0.321212;-0.245771;, - 0.874657;0.321211;-0.363041;, - 0.916197;0.382405;0.119793;, - 0.947008;0.321208;-0.000690;, - 0.957638;0.258637;-0.126635;, - 0.932916;0.258635;-0.250550;, - 0.892232;0.258636;-0.370176;, - 0.938996;0.321209;0.122927;, - 0.965975;0.258635;-0.000554;, - 0.972368;0.194951;-0.128436;, - 0.947284;0.194952;-0.254258;, - 0.905992;0.194951;-0.375729;, - 0.957783;0.258637;0.125534;, - 0.980813;0.194951;-0.000418;, - 0.982939;0.130433;-0.129688;, - 0.957602;0.130431;-0.256879;, - 0.915879;0.130433;-0.379675;, - 0.972476;0.194953;0.127605;, - 0.991457;0.130434;-0.000281;, - 0.989307;0.065356;-0.130385;, - 0.963824;0.065359;-0.258402;, - 0.921850;0.065356;-0.381996;, - 0.983012;0.130430;0.129135;, - 0.997862;0.065356;-0.000140;, - 0.991445;0.000000;-0.130525;, - 0.965926;-0.000002;-0.258819;, - 0.923879;-0.000000;-0.382685;, - 0.989343;0.065357;0.130108;, - 1.000000;0.000000;0.000000;, - 0.989343;-0.065357;-0.130108;, - 0.963897;-0.065356;-0.258130;, - 0.921957;-0.065355;-0.381738;, - 0.991445;-0.000000;0.130525;, - 0.997862;-0.065356;0.000140;, - 0.983012;-0.130430;-0.129135;, - 0.957746;-0.130436;-0.256337;, - 0.916094;-0.130433;-0.379157;, - 0.989307;-0.065356;0.130385;, - 0.991457;-0.130434;0.000281;, - 0.972476;-0.194953;-0.127605;, - 0.947501;-0.194947;-0.253453;, - 0.906313;-0.194954;-0.374954;, - 0.982939;-0.130433;0.129688;, - 0.980813;-0.194951;0.000418;, - 0.957783;-0.258637;-0.125534;, - 0.933203;-0.258638;-0.249477;, - 0.892657;-0.258633;-0.369151;, - 0.972368;-0.194951;0.128436;, - 0.965975;-0.258635;0.000554;, - 0.938996;-0.321209;-0.122927;, - 0.914917;-0.321212;-0.244439;, - 0.875184;-0.321215;-0.361766;, - 0.957638;-0.258637;0.126635;, - 0.947008;-0.321208;0.000690;, - 0.916197;-0.382405;-0.119793;, - 0.892722;-0.382404;-0.238358;, - 0.853973;-0.382407;-0.352839;, - 0.938817;-0.321208;0.124292;, - 0.923994;-0.382406;0.000820;, - 0.889476;-0.441976;-0.116144;, - 0.866708;-0.441972;-0.231253;, - 0.829110;-0.441968;-0.342404;, - 0.915981;-0.382407;0.121420;, - 0.897026;-0.441977;0.000949;, - 0.858958;-0.499646;-0.112002;, - 0.836991;-0.499646;-0.223159;, - 0.800703;-0.499642;-0.330502;, - 0.889229;-0.441975;0.118026;, - 0.866230;-0.499644;0.001071;, - 0.824774;-0.555173;-0.107383;, - 0.803701;-0.555175;-0.214116;, - 0.768877;-0.555175;-0.317189;, - 0.858679;-0.499645;0.114128;, - 0.831734;-0.555173;0.001192;, - 0.787069;-0.608323;-0.102304;, - 0.766981;-0.608324;-0.204161;, - 0.733769;-0.608328;-0.302523;, - 0.824462;-0.555174;0.109745;, - 0.793687;-0.608325;0.001306;, - 0.746003;-0.658872;-0.096785;, - 0.726991;-0.658867;-0.193335;, - 0.695534;-0.658870;-0.286572;, - 0.786728;-0.608323;0.104891;, - 0.752255;-0.658870;0.001413;, - 0.701754;-0.706602;-0.090858;, - 0.683890;-0.706604;-0.181676;, - 0.654327;-0.706599;-0.269394;, - 0.745634;-0.658871;0.099591;, - 0.707610;-0.706601;0.001516;, - 0.701358;-0.706602;0.093865;, - 0.613567;-0.706600;-0.352493;, - 0.652178;-0.658874;-0.374900;, - 0.688005;-0.608327;-0.395711;, - 0.562309;-0.706603;-0.429560;, - 0.597664;-0.658873;-0.456820;, - 0.630469;-0.608326;-0.482130;, - 0.720898;-0.555174;-0.414835;, - 0.750714;-0.499643;-0.432187;, - 0.501428;-0.706601;-0.499285;, - 0.532923;-0.658874;-0.530922;, - 0.562144;-0.608326;-0.560298;, - 0.660585;-0.555172;-0.505383;, - 0.687879;-0.499643;-0.526478;, - 0.777325;-0.441971;-0.447691;, - 0.431968;-0.706602;-0.560462;, - 0.459062;-0.658874;-0.595942;, - 0.484200;-0.608324;-0.628882;, - 0.588968;-0.555169;-0.587285;, - 0.613275;-0.499645;-0.611759;, - 0.712237;-0.441973;-0.545324;, - 0.355118;-0.706601;-0.612051;, - 0.377350;-0.658873;-0.650764;, - 0.397973;-0.608326;-0.686700;, - 0.507273;-0.555172;-0.659134;, - 0.528179;-0.499647;-0.686571;, - 0.634965;-0.441977;-0.633621;, - 0.272194;-0.706601;-0.653166;, - 0.289183;-0.658871;-0.694451;, - 0.304936;-0.608326;-0.732771;, - 0.416899;-0.555175;-0.719705;, - 0.434044;-0.499644;-0.749641;, - 0.546828;-0.441972;-0.711084;, - 0.172365;-0.751306;-0.637047;, - 0.184607;-0.706601;-0.683108;, - 0.196064;-0.658871;-0.726257;, - 0.206681;-0.608323;-0.766307;, - 0.319390;-0.555175;-0.767966;, - 0.087739;-0.751305;-0.654097;, - 0.093865;-0.706602;-0.701358;, - 0.099591;-0.658871;-0.745634;, - 0.104891;-0.608323;-0.786728;, - 0.216418;-0.555175;-0.803084;, - 0.332481;-0.499641;-0.799885;, - 0.000000;-0.786303;-0.617841;, - -0.000000;-0.744259;-0.667891;, - 0.000000;-0.699029;-0.715094;, - 0.000000;-0.650798;-0.759251;, - 0.000000;-0.599793;-0.800155;, - 0.109745;-0.555174;-0.824462;, - -0.087739;-0.751305;-0.654097;, - -0.093865;-0.706602;-0.701358;, - -0.099591;-0.658871;-0.745634;, - -0.104891;-0.608323;-0.786728;, - -0.109745;-0.555174;-0.824462;, - 0.000000;-0.546215;-0.837645;, - -0.172365;-0.751306;-0.637047;, - -0.184607;-0.706601;-0.683108;, - -0.196064;-0.658871;-0.726257;, - -0.206681;-0.608323;-0.766307;, - -0.216418;-0.555175;-0.803084;, - -0.254044;-0.751305;-0.609100;, - -0.272194;-0.706601;-0.653166;, - -0.289183;-0.658871;-0.694451;, - -0.304936;-0.608326;-0.732771;, - -0.319390;-0.555175;-0.767966;, - -0.331374;-0.751303;-0.570733;, - -0.355118;-0.706601;-0.612051;, - -0.377350;-0.658873;-0.650764;, - -0.397973;-0.608326;-0.686700;, - -0.416899;-0.555175;-0.719705;, - -0.403034;-0.751304;-0.522596;, - -0.431968;-0.706602;-0.560462;, - -0.459062;-0.658874;-0.595942;, - -0.484200;-0.608324;-0.628882;, - -0.507274;-0.555171;-0.659134;, - -0.467797;-0.751305;-0.465517;, - -0.501428;-0.706601;-0.499285;, - -0.532922;-0.658874;-0.530922;, - -0.562144;-0.608326;-0.560298;, - -0.588968;-0.555169;-0.587285;, - -0.524559;-0.751305;-0.400474;, - -0.562309;-0.706603;-0.429560;, - -0.597663;-0.658873;-0.456820;, - -0.630469;-0.608326;-0.482130;, - -0.660585;-0.555172;-0.505383;, - -0.572344;-0.751302;-0.328585;, - -0.613567;-0.706600;-0.352493;, - -0.652178;-0.658874;-0.374900;, - -0.688005;-0.608327;-0.395711;, - -0.720898;-0.555174;-0.414835;, - -0.610334;-0.751305;-0.251063;, - -0.654327;-0.706599;-0.269394;, - -0.695534;-0.658870;-0.286572;, - -0.733769;-0.608328;-0.302523;, - -0.768877;-0.555175;-0.317189;, - -0.637883;-0.751305;-0.169250;, - -0.683890;-0.706604;-0.181676;, - -0.726991;-0.658867;-0.193335;, - -0.766981;-0.608324;-0.204161;, - -0.803701;-0.555175;-0.214116;, - -0.654519;-0.751304;-0.084545;, - -0.701754;-0.706602;-0.090858;, - -0.746003;-0.658872;-0.096785;, - -0.787069;-0.608323;-0.102304;, - -0.824774;-0.555173;-0.107383;, - -0.858958;-0.499646;-0.112002;, - -0.836991;-0.499646;-0.223159;, - -0.800703;-0.499642;-0.330502;, - -0.889476;-0.441976;-0.116144;, - -0.866708;-0.441972;-0.231253;, - -0.829110;-0.441968;-0.342404;, - -0.750714;-0.499643;-0.432187;, - -0.687879;-0.499643;-0.526478;, - -0.916197;-0.382405;-0.119793;, - -0.892722;-0.382404;-0.238358;, - -0.853973;-0.382407;-0.352839;, - -0.777325;-0.441971;-0.447691;, - -0.712237;-0.441973;-0.545324;, - -0.613275;-0.499645;-0.611759;, - -0.938996;-0.321209;-0.122927;, - -0.914917;-0.321212;-0.244439;, - -0.875184;-0.321215;-0.361766;, - -0.800613;-0.382408;-0.461284;, - -0.733553;-0.382409;-0.561839;, - -0.634965;-0.441977;-0.633621;, - -0.957783;-0.258637;-0.125534;, - -0.933203;-0.258638;-0.249477;, - -0.892657;-0.258633;-0.369151;, - -0.820478;-0.321211;-0.472906;, - -0.751733;-0.321206;-0.575955;, - -0.653942;-0.382408;-0.652782;, - -0.972476;-0.194953;-0.127605;, - -0.947501;-0.194947;-0.253453;, - -0.906313;-0.194954;-0.374954;, - -0.836837;-0.258631;-0.482508;, - -0.766698;-0.258633;-0.587607;, - -0.670124;-0.321208;-0.669148;, - -0.983012;-0.130430;-0.129135;, - -0.957746;-0.130436;-0.256337;, - -0.916094;-0.130433;-0.379157;, - -0.849617;-0.194952;-0.490046;, - -0.778387;-0.194949;-0.596748;, - -0.683441;-0.258632;-0.682655;, - -0.989343;-0.065357;-0.130108;, - -0.963897;-0.065356;-0.258130;, - -0.921957;-0.065355;-0.381738;, - -0.858766;-0.130428;-0.495489;, - -0.786747;-0.130435;-0.603337;, - -0.693835;-0.194947;-0.693245;, - -0.991445;0.000000;-0.130525;, - -0.965926;-0.000002;-0.258819;, - -0.923879;-0.000000;-0.382685;, - -0.864244;-0.065361;-0.498808;, - -0.791743;-0.065357;-0.607348;, - -0.701263;-0.130435;-0.700868;, - -0.989307;0.065356;-0.130385;, - -0.963824;0.065359;-0.258402;, - -0.921850;0.065356;-0.381996;, - -0.866025;0.000003;-0.500001;, - -0.793355;-0.000000;-0.608759;, - -0.705695;-0.065360;-0.705495;, - -0.982939;0.130433;-0.129688;, - -0.957602;0.130431;-0.256879;, - -0.915879;0.130433;-0.379675;, - -0.864104;0.065353;-0.499052;, - -0.791574;0.065356;-0.607569;, - -0.707107;0.000000;-0.707107;, - -0.972368;0.194951;-0.128436;, - -0.947284;0.194952;-0.254258;, - -0.905992;0.194951;-0.375729;, - -0.858487;0.130434;-0.495971;, - -0.786405;0.130436;-0.603783;, - -0.705495;0.065360;-0.705695;, - -0.957638;0.258637;-0.126635;, - -0.932916;0.258635;-0.250550;, - -0.892232;0.258636;-0.370176;, - -0.849201;0.194948;-0.490768;, - -0.777876;0.194952;-0.597414;, - -0.700868;0.130435;-0.701263;, - -0.938817;0.321208;-0.124292;, - -0.914560;0.321212;-0.245771;, - -0.874657;0.321211;-0.363040;, - -0.836281;0.258636;-0.483469;, - -0.766024;0.258630;-0.588488;, - -0.693245;0.194947;-0.693835;, - -0.915981;0.382407;-0.121420;, - -0.892297;0.382406;-0.239941;, - -0.853345;0.382407;-0.354355;, - -0.819790;0.321208;-0.474099;, - -0.750893;0.321209;-0.577047;, - -0.682655;0.258632;-0.683441;, - -0.889229;0.441975;-0.118026;, - -0.866216;0.441973;-0.233086;, - -0.828384;0.441970;-0.344154;, - -0.799792;0.382409;-0.462705;, - -0.732556;0.382406;-0.563141;, - -0.669148;0.321208;-0.670124;, - -0.858679;0.499645;-0.114128;, - -0.836436;0.499645;-0.225232;, - -0.799885;0.499641;-0.332481;, - -0.776377;0.441969;-0.449335;, - -0.711084;0.441972;-0.546828;, - -0.652782;0.382408;-0.653942;, - -0.824462;0.555174;-0.109745;, - -0.803084;0.555175;-0.216418;, - -0.767966;0.555175;-0.319390;, - -0.749641;0.499644;-0.434044;, - -0.686571;0.499647;-0.528179;, - -0.633621;0.441977;-0.634965;, - -0.786728;0.608323;-0.104891;, - -0.766307;0.608323;-0.206681;, - -0.732771;0.608326;-0.304936;, - -0.719705;0.555175;-0.416899;, - -0.659134;0.555172;-0.507273;, - -0.611759;0.499645;-0.613275;, - -0.745634;0.658871;-0.099591;, - -0.726257;0.658871;-0.196064;, - -0.694451;0.658871;-0.289183;, - -0.686700;0.608326;-0.397973;, - -0.628882;0.608324;-0.484200;, - -0.587285;0.555169;-0.588968;, - -0.701358;0.706602;-0.093865;, - -0.683108;0.706601;-0.184607;, - -0.653166;0.706601;-0.272194;, - -0.650764;0.658873;-0.377350;, - -0.595942;0.658874;-0.459062;, - -0.560298;0.608326;-0.562144;, - -0.654097;0.751305;-0.087739;, - -0.637047;0.751306;-0.172365;, - -0.609100;0.751305;-0.254044;, - -0.612051;0.706601;-0.355118;, - -0.560462;0.706602;-0.431968;, - -0.530923;0.658874;-0.532922;, - -0.570733;0.751303;-0.331374;, - -0.522596;0.751304;-0.403034;, - -0.499285;0.706601;-0.501428;, - -0.456820;0.658873;-0.597663;, - -0.482130;0.608326;-0.630469;, - -0.395711;0.608327;-0.688005;, - -0.414835;0.555174;-0.720898;, - -0.505383;0.555172;-0.660585;, - -0.526478;0.499643;-0.687879;, - -0.317189;0.555175;-0.768877;, - -0.330502;0.499642;-0.800703;, - -0.432187;0.499643;-0.750714;, - -0.447691;0.441971;-0.777325;, - -0.545324;0.441973;-0.712237;, - -0.223159;0.499647;-0.836991;, - -0.231253;0.441972;-0.866708;, - -0.342404;0.441968;-0.829110;, - -0.352839;0.382407;-0.853973;, - -0.461284;0.382408;-0.800613;, - -0.561839;0.382409;-0.733553;, - -0.116144;0.441976;-0.889476;, - -0.119793;0.382405;-0.916197;, - -0.238358;0.382404;-0.892722;, - -0.244439;0.321212;-0.914917;, - -0.361766;0.321215;-0.875184;, - -0.472906;0.321211;-0.820478;, - 0.000000;0.392541;-0.919735;, - -0.000000;0.331582;-0.943426;, - -0.122927;0.321209;-0.938996;, - -0.125534;0.258637;-0.957783;, - -0.249477;0.258638;-0.933203;, - -0.369151;0.258633;-0.892657;, - 0.119793;0.382405;-0.916197;, - 0.122927;0.321209;-0.938996;, - 0.000000;0.269204;-0.963083;, - -0.000000;0.205675;-0.978620;, - -0.127605;0.194953;-0.972476;, - -0.253453;0.194947;-0.947501;, - 0.238358;0.382404;-0.892722;, - 0.244439;0.321212;-0.914917;, - 0.125534;0.258637;-0.957783;, - 0.127605;0.194953;-0.972476;, - 0.000000;0.141259;-0.989973;, - -0.129135;0.130430;-0.983012;, - 0.352839;0.382407;-0.853973;, - 0.361766;0.321215;-0.875184;, - 0.249477;0.258638;-0.933203;, - 0.253453;0.194947;-0.947501;, - 0.129135;0.130430;-0.983012;, - 0.000000;0.076239;-0.997090;, - 0.461284;0.382408;-0.800613;, - 0.472906;0.321211;-0.820478;, - 0.369151;0.258633;-0.892657;, - 0.374954;0.194954;-0.906313;, - 0.256337;0.130436;-0.957746;, - 0.130108;0.065357;-0.989343;, - 0.561839;0.382409;-0.733553;, - 0.575955;0.321206;-0.751733;, - 0.482508;0.258631;-0.836837;, - 0.490046;0.194952;-0.849617;, - 0.379157;0.130433;-0.916094;, - 0.258130;0.065356;-0.963897;, - 0.652782;0.382408;-0.653942;, - 0.669148;0.321208;-0.670124;, - 0.587607;0.258633;-0.766698;, - 0.596748;0.194949;-0.778387;, - 0.495489;0.130428;-0.858766;, - 0.381738;0.065355;-0.921957;, - 0.732556;0.382406;-0.563141;, - 0.750893;0.321209;-0.577048;, - 0.682655;0.258632;-0.683441;, - 0.693245;0.194947;-0.693835;, - 0.603337;0.130435;-0.786747;, - 0.498808;0.065361;-0.864245;, - 0.799792;0.382409;-0.462705;, - 0.819790;0.321208;-0.474099;, - 0.766024;0.258630;-0.588488;, - 0.777876;0.194952;-0.597414;, - 0.700868;0.130435;-0.701263;, - 0.607348;0.065357;-0.791743;, - 0.836281;0.258636;-0.483469;, - 0.849201;0.194948;-0.490768;, - 0.786405;0.130436;-0.603783;, - 0.705495;0.065360;-0.705695;, - 0.608759;0.000000;-0.793355;, - 0.500001;-0.000003;-0.866025;, - 0.858487;0.130434;-0.495971;, - 0.791574;0.065356;-0.607569;, - 0.707107;0.000000;-0.707107;, - 0.607569;-0.065356;-0.791574;, - 0.499052;-0.065353;-0.864104;, - 0.864104;0.065353;-0.499053;, - 0.793355;-0.000000;-0.608759;, - 0.705695;-0.065360;-0.705495;, - 0.603783;-0.130436;-0.786405;, - 0.495971;-0.130434;-0.858487;, - 0.866025;0.000003;-0.500001;, - 0.791743;-0.065357;-0.607348;, - 0.701263;-0.130435;-0.700868;, - 0.597414;-0.194952;-0.777876;, - 0.490768;-0.194948;-0.849201;, - 0.864244;-0.065361;-0.498808;, - 0.786747;-0.130435;-0.603337;, - 0.693835;-0.194947;-0.693245;, - 0.588488;-0.258630;-0.766024;, - 0.483469;-0.258636;-0.836280;, - 0.858766;-0.130428;-0.495489;, - 0.778387;-0.194949;-0.596748;, - 0.683441;-0.258632;-0.682655;, - 0.577048;-0.321209;-0.750893;, - 0.474099;-0.321208;-0.819790;, - 0.849617;-0.194952;-0.490046;, - 0.766698;-0.258633;-0.587607;, - 0.670124;-0.321208;-0.669148;, - 0.563141;-0.382406;-0.732556;, - 0.462705;-0.382409;-0.799792;, - 0.836837;-0.258631;-0.482508;, - 0.751733;-0.321206;-0.575955;, - 0.653942;-0.382408;-0.652782;, - 0.449335;-0.441969;-0.776377;, - 0.820478;-0.321211;-0.472906;, - 0.733553;-0.382409;-0.561839;, - 0.800613;-0.382408;-0.461284;, - 0.344154;-0.441970;-0.828384;, - 0.354355;-0.382408;-0.853345;, - 0.363041;-0.321211;-0.874657;, - 0.225232;-0.499645;-0.836436;, - 0.233086;-0.441973;-0.866216;, - 0.239941;-0.382406;-0.892297;, - 0.245771;-0.321212;-0.914560;, - 0.370176;-0.258636;-0.892232;, - 0.114128;-0.499645;-0.858679;, - 0.118026;-0.441975;-0.889229;, - 0.121420;-0.382407;-0.915981;, - 0.124292;-0.321208;-0.938817;, - 0.250550;-0.258635;-0.932916;, - 0.375729;-0.194951;-0.905992;, - 0.000000;-0.490301;-0.871553;, - -0.000000;-0.432283;-0.901738;, - 0.000000;-0.372408;-0.928069;, - 0.000000;-0.310949;-0.950427;, - 0.126635;-0.258637;-0.957638;, - 0.254258;-0.194952;-0.947284;, - -0.114128;-0.499645;-0.858679;, - -0.118026;-0.441975;-0.889229;, - -0.121420;-0.382407;-0.915981;, - -0.124292;-0.321208;-0.938817;, - -0.126635;-0.258637;-0.957638;, - -0.000000;-0.248158;-0.968720;, - -0.225232;-0.499645;-0.836436;, - -0.233086;-0.441973;-0.866216;, - -0.239941;-0.382406;-0.892297;, - -0.245771;-0.321212;-0.914560;, - -0.250550;-0.258635;-0.932916;, - -0.332481;-0.499641;-0.799885;, - -0.344154;-0.441970;-0.828384;, - -0.354355;-0.382407;-0.853345;, - -0.363041;-0.321211;-0.874657;, - -0.370176;-0.258636;-0.892232;, - -0.434044;-0.499644;-0.749641;, - -0.449335;-0.441969;-0.776377;, - -0.462705;-0.382409;-0.799792;, - -0.474099;-0.321208;-0.819790;, - -0.483469;-0.258636;-0.836281;, - -0.528179;-0.499647;-0.686571;, - -0.546828;-0.441972;-0.711084;, - -0.563141;-0.382406;-0.732556;, - -0.577047;-0.321209;-0.750893;, - -0.588488;-0.258630;-0.766024;, - -0.597414;-0.194952;-0.777876;, - -0.490768;-0.194948;-0.849201;, - -0.375729;-0.194951;-0.905992;, - -0.603783;-0.130436;-0.786405;, - -0.495971;-0.130434;-0.858487;, - -0.379675;-0.130433;-0.915879;, - -0.254258;-0.194952;-0.947284;, - -0.128436;-0.194951;-0.972368;, - -0.607569;-0.065356;-0.791574;, - -0.499052;-0.065353;-0.864104;, - -0.381996;-0.065356;-0.921850;, - -0.256879;-0.130431;-0.957602;, - -0.129688;-0.130433;-0.982939;, - 0.000000;-0.184298;-0.982871;, - -0.608759;0.000000;-0.793355;, - -0.500001;-0.000003;-0.866025;, - -0.382685;0.000000;-0.923879;, - -0.258402;-0.065359;-0.963824;, - -0.130385;-0.065356;-0.989307;, - 0.000000;-0.119654;-0.992816;, - -0.607348;0.065357;-0.791743;, - -0.498808;0.065361;-0.864244;, - -0.381738;0.065355;-0.921957;, - -0.258819;0.000002;-0.965926;, - -0.130525;-0.000000;-0.991445;, - 0.000000;-0.054496;-0.998514;, - -0.603337;0.130435;-0.786747;, - -0.495489;0.130428;-0.858766;, - -0.379157;0.130433;-0.916094;, - -0.258130;0.065356;-0.963897;, - -0.130108;0.065357;-0.989343;, - 0.000000;0.010897;-0.999941;, - -0.596748;0.194949;-0.778387;, - -0.490046;0.194952;-0.849617;, - -0.374954;0.194954;-0.906313;, - -0.256337;0.130436;-0.957746;, - -0.587607;0.258633;-0.766698;, - -0.482508;0.258631;-0.836837;, - -0.575955;0.321206;-0.751733;, - 0.130525;-0.000000;-0.991445;, - 0.130385;-0.065356;-0.989307;, - 0.129688;-0.130433;-0.982939;, - 0.258819;0.000002;-0.965926;, - 0.258402;-0.065359;-0.963824;, - 0.256879;-0.130431;-0.957602;, - 0.128436;-0.194951;-0.972368;, - 0.382685;0.000000;-0.923879;, - 0.381996;-0.065356;-0.921850;, - 0.379675;-0.130433;-0.915879;; - 4512; - 3;0,1,2;, - 3;3,1,0;, - 3;3,4,1;, - 3;4,5,1;, - 3;1,5,6;, - 3;7,0,2;, - 3;8,0,7;, - 3;8,3,0;, - 3;9,3,8;, - 3;9,10,3;, - 3;10,4,3;, - 3;10,11,4;, - 3;11,12,4;, - 3;4,12,5;, - 3;13,7,2;, - 3;14,7,13;, - 3;14,8,7;, - 3;15,8,14;, - 3;15,9,8;, - 3;16,9,15;, - 3;16,17,9;, - 3;17,10,9;, - 3;17,18,10;, - 3;18,11,10;, - 3;19,13,2;, - 3;20,13,19;, - 3;20,14,13;, - 3;21,14,20;, - 3;21,15,14;, - 3;22,15,21;, - 3;22,16,15;, - 3;23,16,22;, - 3;23,24,16;, - 3;24,17,16;, - 3;25,19,2;, - 3;26,19,25;, - 3;26,20,19;, - 3;27,20,26;, - 3;27,21,20;, - 3;28,21,27;, - 3;28,22,21;, - 3;29,22,28;, - 3;29,23,22;, - 3;25,2,30;, - 3;26,25,30;, - 3;26,30,31;, - 3;27,26,31;, - 3;27,31,32;, - 3;28,27,32;, - 3;28,32,33;, - 3;29,28,33;, - 3;29,33,34;, - 3;35,29,34;, - 3;35,23,29;, - 3;30,2,36;, - 3;31,30,36;, - 3;31,36,37;, - 3;32,31,37;, - 3;32,37,38;, - 3;33,32,38;, - 3;33,38,39;, - 3;34,33,39;, - 3;34,39,40;, - 3;41,34,40;, - 3;35,34,41;, - 3;36,2,42;, - 3;37,36,42;, - 3;37,42,43;, - 3;38,37,43;, - 3;38,43,44;, - 3;39,38,44;, - 3;39,44,45;, - 3;40,39,45;, - 3;40,45,46;, - 3;47,40,46;, - 3;41,40,47;, - 3;42,2,48;, - 3;43,42,48;, - 3;43,48,49;, - 3;44,43,49;, - 3;44,49,50;, - 3;45,44,50;, - 3;45,50,51;, - 3;46,45,51;, - 3;46,51,52;, - 3;53,46,52;, - 3;47,46,53;, - 3;48,2,54;, - 3;49,48,54;, - 3;49,54,55;, - 3;50,49,55;, - 3;50,55,56;, - 3;51,50,56;, - 3;51,56,57;, - 3;52,51,57;, - 3;52,57,58;, - 3;59,52,58;, - 3;53,52,59;, - 3;54,2,60;, - 3;55,54,60;, - 3;55,60,61;, - 3;56,55,61;, - 3;56,61,62;, - 3;57,56,62;, - 3;57,62,63;, - 3;58,57,63;, - 3;58,63,64;, - 3;65,58,64;, - 3;59,58,65;, - 3;60,2,66;, - 3;61,60,66;, - 3;61,66,67;, - 3;62,61,67;, - 3;62,67,68;, - 3;63,62,68;, - 3;63,68,69;, - 3;64,63,69;, - 3;64,69,70;, - 3;71,64,70;, - 3;65,64,71;, - 3;66,2,72;, - 3;67,66,72;, - 3;67,72,73;, - 3;68,67,73;, - 3;68,73,74;, - 3;69,68,74;, - 3;69,74,75;, - 3;70,69,75;, - 3;70,75,76;, - 3;77,70,76;, - 3;71,70,77;, - 3;72,2,78;, - 3;73,72,78;, - 3;73,78,79;, - 3;74,73,79;, - 3;74,79,80;, - 3;75,74,80;, - 3;75,80,81;, - 3;76,75,81;, - 3;76,81,82;, - 3;83,76,82;, - 3;77,76,83;, - 3;78,2,84;, - 3;79,78,84;, - 3;79,84,85;, - 3;80,79,85;, - 3;80,85,86;, - 3;81,80,86;, - 3;81,86,87;, - 3;82,81,87;, - 3;82,87,88;, - 3;89,82,88;, - 3;83,82,89;, - 3;84,2,90;, - 3;85,84,90;, - 3;85,90,91;, - 3;86,85,91;, - 3;86,91,92;, - 3;87,86,92;, - 3;87,92,93;, - 3;88,87,93;, - 3;88,93,94;, - 3;95,88,94;, - 3;89,88,95;, - 3;90,2,96;, - 3;91,90,96;, - 3;91,96,97;, - 3;92,91,97;, - 3;92,97,98;, - 3;93,92,98;, - 3;93,98,99;, - 3;94,93,99;, - 3;94,99,100;, - 3;101,94,100;, - 3;95,94,101;, - 3;96,2,102;, - 3;97,96,102;, - 3;97,102,103;, - 3;98,97,103;, - 3;98,103,104;, - 3;99,98,104;, - 3;99,104,105;, - 3;100,99,105;, - 3;100,105,106;, - 3;107,100,106;, - 3;101,100,107;, - 3;102,2,108;, - 3;103,102,108;, - 3;103,108,109;, - 3;104,103,109;, - 3;104,109,110;, - 3;105,104,110;, - 3;105,110,111;, - 3;106,105,111;, - 3;106,111,112;, - 3;113,106,112;, - 3;107,106,113;, - 3;108,2,114;, - 3;109,108,114;, - 3;109,114,115;, - 3;110,109,115;, - 3;110,115,116;, - 3;111,110,116;, - 3;111,116,117;, - 3;112,111,117;, - 3;112,117,118;, - 3;119,112,118;, - 3;113,112,119;, - 3;114,2,120;, - 3;115,114,120;, - 3;115,120,121;, - 3;116,115,121;, - 3;116,121,122;, - 3;117,116,122;, - 3;117,122,123;, - 3;118,117,123;, - 3;118,123,124;, - 3;125,118,124;, - 3;119,118,125;, - 3;120,2,126;, - 3;121,120,126;, - 3;121,126,127;, - 3;122,121,127;, - 3;122,127,128;, - 3;123,122,128;, - 3;123,128,129;, - 3;124,123,129;, - 3;124,129,130;, - 3;131,124,130;, - 3;125,124,131;, - 3;126,2,132;, - 3;127,126,132;, - 3;127,132,133;, - 3;128,127,133;, - 3;128,133,134;, - 3;129,128,134;, - 3;129,134,135;, - 3;130,129,135;, - 3;130,135,136;, - 3;137,130,136;, - 3;131,130,137;, - 3;132,2,138;, - 3;133,132,138;, - 3;133,138,139;, - 3;134,133,139;, - 3;134,139,140;, - 3;135,134,140;, - 3;135,140,141;, - 3;136,135,141;, - 3;136,141,142;, - 3;143,136,142;, - 3;137,136,143;, - 3;138,2,144;, - 3;139,138,144;, - 3;139,144,145;, - 3;140,139,145;, - 3;140,145,146;, - 3;141,140,146;, - 3;141,146,147;, - 3;142,141,147;, - 3;142,147,148;, - 3;149,142,148;, - 3;143,142,149;, - 3;144,2,150;, - 3;145,144,150;, - 3;145,150,151;, - 3;146,145,151;, - 3;146,151,152;, - 3;147,146,152;, - 3;147,152,153;, - 3;148,147,153;, - 3;148,153,154;, - 3;155,148,154;, - 3;149,148,155;, - 3;150,2,156;, - 3;151,150,156;, - 3;151,156,157;, - 3;152,151,157;, - 3;152,157,158;, - 3;153,152,158;, - 3;153,158,159;, - 3;154,153,159;, - 3;154,159,160;, - 3;161,154,160;, - 3;155,154,161;, - 3;156,2,162;, - 3;157,156,162;, - 3;157,162,163;, - 3;158,157,163;, - 3;158,163,164;, - 3;159,158,164;, - 3;159,164,165;, - 3;160,159,165;, - 3;160,165,166;, - 3;167,160,166;, - 3;161,160,167;, - 3;162,2,168;, - 3;163,162,168;, - 3;163,168,169;, - 3;164,163,169;, - 3;164,169,170;, - 3;165,164,170;, - 3;165,170,171;, - 3;166,165,171;, - 3;166,171,172;, - 3;173,166,172;, - 3;167,166,173;, - 3;174,167,173;, - 3;175,167,174;, - 3;175,161,167;, - 3;176,161,175;, - 3;176,155,161;, - 3;173,172,177;, - 3;178,173,177;, - 3;174,173,178;, - 3;179,174,178;, - 3;180,174,179;, - 3;180,175,174;, - 3;181,175,180;, - 3;181,176,175;, - 3;182,176,181;, - 3;182,183,176;, - 3;183,155,176;, - 3;183,149,155;, - 3;178,177,184;, - 3;185,178,184;, - 3;179,178,185;, - 3;186,179,185;, - 3;187,179,186;, - 3;187,180,179;, - 3;188,180,187;, - 3;188,181,180;, - 3;189,181,188;, - 3;189,182,181;, - 3;185,184,190;, - 3;191,185,190;, - 3;186,185,191;, - 3;192,186,191;, - 3;193,186,192;, - 3;193,187,186;, - 3;194,187,193;, - 3;194,188,187;, - 3;195,188,194;, - 3;195,189,188;, - 3;191,190,196;, - 3;197,191,196;, - 3;192,191,197;, - 3;198,192,197;, - 3;199,192,198;, - 3;199,193,192;, - 3;200,193,199;, - 3;200,194,193;, - 3;201,194,200;, - 3;201,195,194;, - 3;197,196,202;, - 3;203,197,202;, - 3;198,197,203;, - 3;204,198,203;, - 3;205,198,204;, - 3;205,199,198;, - 3;206,199,205;, - 3;206,200,199;, - 3;207,200,206;, - 3;207,201,200;, - 3;203,202,208;, - 3;209,203,208;, - 3;204,203,209;, - 3;210,204,209;, - 3;211,204,210;, - 3;211,205,204;, - 3;212,205,211;, - 3;212,206,205;, - 3;213,206,212;, - 3;213,207,206;, - 3;209,208,214;, - 3;215,209,214;, - 3;210,209,215;, - 3;216,210,215;, - 3;217,210,216;, - 3;217,211,210;, - 3;218,211,217;, - 3;218,212,211;, - 3;219,212,218;, - 3;219,213,212;, - 3;215,214,220;, - 3;221,215,220;, - 3;216,215,221;, - 3;222,216,221;, - 3;223,216,222;, - 3;223,217,216;, - 3;224,217,223;, - 3;224,218,217;, - 3;225,218,224;, - 3;225,219,218;, - 3;221,220,226;, - 3;227,221,226;, - 3;222,221,227;, - 3;228,222,227;, - 3;229,222,228;, - 3;229,223,222;, - 3;230,223,229;, - 3;230,224,223;, - 3;231,224,230;, - 3;231,225,224;, - 3;227,226,232;, - 3;233,227,232;, - 3;228,227,233;, - 3;234,228,233;, - 3;235,228,234;, - 3;235,229,228;, - 3;236,229,235;, - 3;236,230,229;, - 3;237,230,236;, - 3;237,231,230;, - 3;233,232,238;, - 3;239,233,238;, - 3;234,233,239;, - 3;240,234,239;, - 3;241,234,240;, - 3;241,235,234;, - 3;242,235,241;, - 3;242,236,235;, - 3;243,236,242;, - 3;243,237,236;, - 3;239,238,244;, - 3;245,239,244;, - 3;240,239,245;, - 3;246,240,245;, - 3;247,240,246;, - 3;247,241,240;, - 3;248,241,247;, - 3;248,242,241;, - 3;249,242,248;, - 3;249,243,242;, - 3;245,244,250;, - 3;251,245,250;, - 3;246,245,251;, - 3;252,246,251;, - 3;253,246,252;, - 3;253,247,246;, - 3;254,247,253;, - 3;254,248,247;, - 3;255,248,254;, - 3;255,249,248;, - 3;251,250,256;, - 3;257,251,256;, - 3;252,251,257;, - 3;258,252,257;, - 3;259,252,258;, - 3;259,253,252;, - 3;260,253,259;, - 3;260,254,253;, - 3;261,254,260;, - 3;261,255,254;, - 3;257,256,262;, - 3;263,257,262;, - 3;258,257,263;, - 3;264,258,263;, - 3;265,258,264;, - 3;265,259,258;, - 3;266,259,265;, - 3;266,260,259;, - 3;267,260,266;, - 3;267,261,260;, - 3;263,262,268;, - 3;269,263,268;, - 3;264,263,269;, - 3;270,264,269;, - 3;271,264,270;, - 3;271,265,264;, - 3;272,265,271;, - 3;272,266,265;, - 3;273,266,272;, - 3;273,267,266;, - 3;269,268,274;, - 3;275,269,274;, - 3;270,269,275;, - 3;276,270,275;, - 3;277,270,276;, - 3;277,271,270;, - 3;278,271,277;, - 3;278,272,271;, - 3;279,272,278;, - 3;279,273,272;, - 3;275,274,280;, - 3;281,275,280;, - 3;276,275,281;, - 3;282,276,281;, - 3;283,276,282;, - 3;283,277,276;, - 3;284,277,283;, - 3;284,278,277;, - 3;285,278,284;, - 3;285,279,278;, - 3;281,280,286;, - 3;287,281,286;, - 3;282,281,287;, - 3;288,282,287;, - 3;289,282,288;, - 3;289,283,282;, - 3;290,283,289;, - 3;290,284,283;, - 3;291,284,290;, - 3;291,285,284;, - 3;287,286,292;, - 3;293,287,292;, - 3;288,287,293;, - 3;294,288,293;, - 3;295,288,294;, - 3;295,289,288;, - 3;296,289,295;, - 3;296,290,289;, - 3;297,290,296;, - 3;297,291,290;, - 3;293,292,298;, - 3;299,293,298;, - 3;294,293,299;, - 3;300,294,299;, - 3;301,294,300;, - 3;301,295,294;, - 3;302,295,301;, - 3;302,296,295;, - 3;303,296,302;, - 3;303,297,296;, - 3;299,298,304;, - 3;305,299,304;, - 3;300,299,305;, - 3;306,300,305;, - 3;307,300,306;, - 3;307,301,300;, - 3;308,301,307;, - 3;308,302,301;, - 3;309,302,308;, - 3;309,303,302;, - 3;305,304,310;, - 3;311,305,310;, - 3;306,305,311;, - 3;312,306,311;, - 3;313,306,312;, - 3;313,307,306;, - 3;314,307,313;, - 3;314,308,307;, - 3;315,308,314;, - 3;315,309,308;, - 3;311,310,316;, - 3;317,311,316;, - 3;312,311,317;, - 3;318,312,317;, - 3;319,312,318;, - 3;319,313,312;, - 3;320,313,319;, - 3;320,314,313;, - 3;321,314,320;, - 3;321,315,314;, - 3;317,316,322;, - 3;323,317,322;, - 3;318,317,323;, - 3;324,318,323;, - 3;325,318,324;, - 3;325,319,318;, - 3;326,319,325;, - 3;326,320,319;, - 3;327,320,326;, - 3;327,321,320;, - 3;323,322,328;, - 3;329,323,328;, - 3;324,323,329;, - 3;330,324,329;, - 3;331,324,330;, - 3;331,325,324;, - 3;332,325,331;, - 3;332,326,325;, - 3;333,326,332;, - 3;333,327,326;, - 3;329,328,334;, - 3;335,329,334;, - 3;330,329,335;, - 3;336,330,335;, - 3;337,330,336;, - 3;337,331,330;, - 3;338,331,337;, - 3;338,332,331;, - 3;339,332,338;, - 3;339,333,332;, - 3;335,334,340;, - 3;341,335,340;, - 3;336,335,341;, - 3;342,336,341;, - 3;343,336,342;, - 3;343,337,336;, - 3;344,337,343;, - 3;344,338,337;, - 3;345,338,344;, - 3;345,339,338;, - 3;341,340,346;, - 3;347,341,346;, - 3;342,341,347;, - 3;348,342,347;, - 3;349,342,348;, - 3;349,343,342;, - 3;350,343,349;, - 3;350,344,343;, - 3;351,344,350;, - 3;351,345,344;, - 3;347,346,352;, - 3;353,347,352;, - 3;348,347,353;, - 3;354,348,353;, - 3;355,348,354;, - 3;355,349,348;, - 3;356,349,355;, - 3;356,350,349;, - 3;357,350,356;, - 3;357,351,350;, - 3;353,352,358;, - 3;359,353,358;, - 3;354,353,359;, - 3;360,354,359;, - 3;361,354,360;, - 3;361,355,354;, - 3;362,355,361;, - 3;362,356,355;, - 3;363,356,362;, - 3;363,357,356;, - 3;359,358,364;, - 3;365,359,364;, - 3;360,359,365;, - 3;366,360,365;, - 3;367,360,366;, - 3;367,361,360;, - 3;368,361,367;, - 3;368,362,361;, - 3;369,362,368;, - 3;369,363,362;, - 3;365,364,370;, - 3;371,365,370;, - 3;366,365,371;, - 3;372,366,371;, - 3;373,366,372;, - 3;373,367,366;, - 3;374,367,373;, - 3;374,368,367;, - 3;375,368,374;, - 3;375,369,368;, - 3;371,370,376;, - 3;377,371,376;, - 3;372,371,377;, - 3;378,372,377;, - 3;379,372,378;, - 3;379,373,372;, - 3;380,373,379;, - 3;380,374,373;, - 3;381,374,380;, - 3;381,375,374;, - 3;377,376,382;, - 3;383,377,382;, - 3;378,377,383;, - 3;384,378,383;, - 3;385,378,384;, - 3;385,379,378;, - 3;386,379,385;, - 3;386,380,379;, - 3;387,380,386;, - 3;387,381,380;, - 3;383,382,388;, - 3;389,383,388;, - 3;384,383,389;, - 3;390,384,389;, - 3;391,384,390;, - 3;391,385,384;, - 3;392,385,391;, - 3;392,386,385;, - 3;393,386,392;, - 3;393,387,386;, - 3;389,388,394;, - 3;395,389,394;, - 3;390,389,395;, - 3;396,390,395;, - 3;397,390,396;, - 3;397,391,390;, - 3;398,391,397;, - 3;398,392,391;, - 3;399,392,398;, - 3;399,393,392;, - 3;395,394,400;, - 3;401,395,400;, - 3;396,395,401;, - 3;402,396,401;, - 3;403,396,402;, - 3;403,397,396;, - 3;404,397,403;, - 3;404,398,397;, - 3;405,398,404;, - 3;405,399,398;, - 3;401,400,406;, - 3;407,401,406;, - 3;402,401,407;, - 3;408,402,407;, - 3;409,402,408;, - 3;409,403,402;, - 3;410,403,409;, - 3;410,404,403;, - 3;411,404,410;, - 3;411,405,404;, - 3;407,406,412;, - 3;413,407,412;, - 3;408,407,413;, - 3;414,408,413;, - 3;415,408,414;, - 3;415,409,408;, - 3;416,409,415;, - 3;416,410,409;, - 3;417,410,416;, - 3;417,411,410;, - 3;413,412,418;, - 3;419,413,418;, - 3;414,413,419;, - 3;420,414,419;, - 3;420,415,414;, - 3;420,416,415;, - 3;420,417,416;, - 3;420,421,417;, - 3;421,411,417;, - 3;421,422,411;, - 3;422,405,411;, - 3;419,418,423;, - 3;420,419,423;, - 3;422,424,405;, - 3;425,424,422;, - 3;425,426,424;, - 3;426,427,424;, - 3;424,427,399;, - 3;424,399,405;, - 3;428,425,422;, - 3;429,425,428;, - 3;429,430,425;, - 3;430,426,425;, - 3;430,431,426;, - 3;431,432,426;, - 3;426,432,427;, - 3;428,422,421;, - 3;420,428,421;, - 3;420,429,428;, - 3;420,433,429;, - 3;433,430,429;, - 3;433,434,430;, - 3;434,431,430;, - 3;434,435,431;, - 3;435,436,431;, - 3;431,436,432;, - 3;436,437,432;, - 3;432,437,438;, - 3;432,438,427;, - 3;420,439,433;, - 3;439,434,433;, - 3;439,440,434;, - 3;440,435,434;, - 3;440,441,435;, - 3;441,442,435;, - 3;435,442,436;, - 3;442,443,436;, - 3;436,443,437;, - 3;420,444,439;, - 3;444,440,439;, - 3;444,445,440;, - 3;445,441,440;, - 3;445,446,441;, - 3;446,447,441;, - 3;441,447,442;, - 3;447,448,442;, - 3;442,448,443;, - 3;420,449,444;, - 3;449,445,444;, - 3;449,450,445;, - 3;450,446,445;, - 3;450,451,446;, - 3;451,452,446;, - 3;446,452,447;, - 3;452,453,447;, - 3;447,453,448;, - 3;420,454,449;, - 3;454,450,449;, - 3;454,455,450;, - 3;455,451,450;, - 3;455,456,451;, - 3;456,457,451;, - 3;451,457,452;, - 3;457,458,452;, - 3;452,458,453;, - 3;420,459,454;, - 3;459,455,454;, - 3;459,460,455;, - 3;460,456,455;, - 3;460,461,456;, - 3;461,462,456;, - 3;456,462,457;, - 3;462,463,457;, - 3;457,463,458;, - 3;420,464,459;, - 3;464,460,459;, - 3;464,465,460;, - 3;465,461,460;, - 3;465,466,461;, - 3;466,467,461;, - 3;461,467,462;, - 3;467,468,462;, - 3;462,468,463;, - 3;420,469,464;, - 3;469,465,464;, - 3;469,470,465;, - 3;470,466,465;, - 3;470,471,466;, - 3;471,472,466;, - 3;466,472,467;, - 3;472,473,467;, - 3;467,473,468;, - 3;420,474,469;, - 3;474,470,469;, - 3;474,475,470;, - 3;475,471,470;, - 3;475,476,471;, - 3;476,477,471;, - 3;471,477,472;, - 3;477,478,472;, - 3;472,478,473;, - 3;420,479,474;, - 3;479,475,474;, - 3;479,480,475;, - 3;480,476,475;, - 3;480,481,476;, - 3;481,482,476;, - 3;476,482,477;, - 3;482,483,477;, - 3;477,483,478;, - 3;420,484,479;, - 3;484,480,479;, - 3;484,485,480;, - 3;485,481,480;, - 3;485,486,481;, - 3;486,487,481;, - 3;481,487,482;, - 3;487,488,482;, - 3;482,488,483;, - 3;420,489,484;, - 3;489,485,484;, - 3;489,490,485;, - 3;490,486,485;, - 3;490,491,486;, - 3;491,492,486;, - 3;486,492,487;, - 3;492,493,487;, - 3;487,493,488;, - 3;420,494,489;, - 3;494,490,489;, - 3;494,495,490;, - 3;495,491,490;, - 3;495,496,491;, - 3;496,497,491;, - 3;491,497,492;, - 3;497,498,492;, - 3;492,498,493;, - 3;420,499,494;, - 3;499,495,494;, - 3;499,500,495;, - 3;500,496,495;, - 3;500,501,496;, - 3;501,502,496;, - 3;496,502,497;, - 3;502,503,497;, - 3;497,503,498;, - 3;420,504,499;, - 3;504,500,499;, - 3;504,505,500;, - 3;505,501,500;, - 3;505,506,501;, - 3;506,507,501;, - 3;501,507,502;, - 3;507,508,502;, - 3;502,508,503;, - 3;420,509,504;, - 3;509,505,504;, - 3;509,510,505;, - 3;510,506,505;, - 3;510,511,506;, - 3;511,512,506;, - 3;506,512,507;, - 3;512,513,507;, - 3;507,513,508;, - 3;513,514,508;, - 3;508,514,515;, - 3;508,515,503;, - 3;509,516,510;, - 3;510,516,517;, - 3;510,517,511;, - 3;511,517,518;, - 3;511,518,519;, - 3;511,519,512;, - 3;519,520,512;, - 3;512,520,513;, - 3;520,521,513;, - 3;513,521,514;, - 3;509,522,516;, - 3;522,523,516;, - 3;516,523,524;, - 3;516,524,517;, - 3;517,524,525;, - 3;517,525,518;, - 3;518,525,526;, - 3;518,526,527;, - 3;519,518,527;, - 3;528,522,509;, - 3;528,529,522;, - 3;522,529,523;, - 3;529,530,523;, - 3;523,530,531;, - 3;523,531,524;, - 3;524,531,532;, - 3;524,532,525;, - 3;525,532,533;, - 3;525,533,526;, - 3;528,534,529;, - 3;529,534,530;, - 3;534,535,530;, - 3;530,535,536;, - 3;530,536,531;, - 3;531,536,537;, - 3;531,537,532;, - 3;532,537,538;, - 3;532,538,533;, - 3;528,539,534;, - 3;534,539,535;, - 3;539,540,535;, - 3;535,540,541;, - 3;535,541,536;, - 3;536,541,542;, - 3;536,542,537;, - 3;537,542,543;, - 3;537,543,538;, - 3;528,544,539;, - 3;539,544,540;, - 3;544,545,540;, - 3;540,545,546;, - 3;540,546,541;, - 3;541,546,547;, - 3;541,547,542;, - 3;542,547,548;, - 3;542,548,543;, - 3;528,549,544;, - 3;544,549,545;, - 3;549,550,545;, - 3;545,550,551;, - 3;545,551,546;, - 3;546,551,552;, - 3;546,552,547;, - 3;547,552,553;, - 3;547,553,548;, - 3;528,554,549;, - 3;549,554,550;, - 3;554,555,550;, - 3;550,555,556;, - 3;550,556,551;, - 3;551,556,557;, - 3;551,557,552;, - 3;552,557,558;, - 3;552,558,553;, - 3;528,559,554;, - 3;554,559,555;, - 3;559,560,555;, - 3;555,560,561;, - 3;555,561,556;, - 3;556,561,562;, - 3;556,562,557;, - 3;557,562,563;, - 3;557,563,558;, - 3;528,564,559;, - 3;559,564,560;, - 3;564,565,560;, - 3;560,565,566;, - 3;560,566,561;, - 3;561,566,567;, - 3;561,567,562;, - 3;562,567,568;, - 3;562,568,563;, - 3;528,569,564;, - 3;564,569,565;, - 3;569,570,565;, - 3;565,570,571;, - 3;565,571,566;, - 3;566,571,572;, - 3;566,572,567;, - 3;567,572,573;, - 3;567,573,568;, - 3;528,574,569;, - 3;569,574,570;, - 3;574,575,570;, - 3;570,575,576;, - 3;570,576,571;, - 3;571,576,577;, - 3;571,577,572;, - 3;572,577,578;, - 3;572,578,573;, - 3;528,579,574;, - 3;574,579,575;, - 3;579,580,575;, - 3;575,580,581;, - 3;575,581,576;, - 3;576,581,582;, - 3;576,582,577;, - 3;577,582,583;, - 3;577,583,578;, - 3;528,584,579;, - 3;579,584,580;, - 3;584,585,580;, - 3;580,585,586;, - 3;580,586,581;, - 3;581,586,587;, - 3;581,587,582;, - 3;582,587,588;, - 3;582,588,583;, - 3;528,589,584;, - 3;584,589,585;, - 3;589,590,585;, - 3;585,590,591;, - 3;585,591,586;, - 3;586,591,592;, - 3;586,592,587;, - 3;587,592,593;, - 3;587,593,588;, - 3;528,594,589;, - 3;589,594,590;, - 3;594,595,590;, - 3;590,595,596;, - 3;590,596,591;, - 3;591,596,597;, - 3;591,597,592;, - 3;592,597,598;, - 3;592,598,593;, - 3;528,599,594;, - 3;594,599,595;, - 3;599,600,595;, - 3;595,600,601;, - 3;595,601,596;, - 3;596,601,602;, - 3;596,602,597;, - 3;597,602,603;, - 3;597,603,598;, - 3;528,604,599;, - 3;599,604,600;, - 3;604,605,600;, - 3;600,605,606;, - 3;600,606,601;, - 3;601,606,607;, - 3;601,607,602;, - 3;602,607,608;, - 3;602,608,603;, - 3;528,609,604;, - 3;604,609,605;, - 3;609,610,605;, - 3;605,610,611;, - 3;605,611,606;, - 3;606,611,612;, - 3;606,612,607;, - 3;607,612,613;, - 3;607,613,608;, - 3;528,614,609;, - 3;609,614,610;, - 3;614,615,610;, - 3;610,615,616;, - 3;610,616,611;, - 3;611,616,617;, - 3;611,617,612;, - 3;612,617,618;, - 3;612,618,613;, - 3;528,619,614;, - 3;614,619,615;, - 3;619,620,615;, - 3;615,620,621;, - 3;615,621,616;, - 3;616,621,622;, - 3;616,622,617;, - 3;617,622,623;, - 3;617,623,618;, - 3;528,624,619;, - 3;619,624,620;, - 3;624,625,620;, - 3;620,625,626;, - 3;620,626,621;, - 3;621,626,627;, - 3;621,627,622;, - 3;622,627,628;, - 3;622,628,623;, - 3;528,629,624;, - 3;624,629,625;, - 3;629,630,625;, - 3;625,630,631;, - 3;625,631,626;, - 3;626,631,632;, - 3;626,632,627;, - 3;627,632,633;, - 3;627,633,628;, - 3;528,634,629;, - 3;629,634,630;, - 3;634,635,630;, - 3;630,635,636;, - 3;630,636,631;, - 3;631,636,637;, - 3;631,637,632;, - 3;632,637,638;, - 3;632,638,633;, - 3;528,639,634;, - 3;634,639,635;, - 3;633,638,640;, - 3;633,640,641;, - 3;628,633,641;, - 3;628,641,642;, - 3;623,628,642;, - 3;623,642,643;, - 3;618,623,643;, - 3;641,640,644;, - 3;641,644,645;, - 3;642,641,645;, - 3;642,645,646;, - 3;643,642,646;, - 3;643,646,647;, - 3;648,643,647;, - 3;618,643,648;, - 3;613,618,648;, - 3;613,648,649;, - 3;608,613,649;, - 3;645,644,650;, - 3;645,650,651;, - 3;646,645,651;, - 3;646,651,652;, - 3;647,646,652;, - 3;647,652,653;, - 3;654,647,653;, - 3;648,647,654;, - 3;649,648,654;, - 3;649,654,655;, - 3;656,649,655;, - 3;608,649,656;, - 3;603,608,656;, - 3;651,650,657;, - 3;651,657,658;, - 3;652,651,658;, - 3;652,658,659;, - 3;653,652,659;, - 3;653,659,660;, - 3;661,653,660;, - 3;654,653,661;, - 3;655,654,661;, - 3;655,661,662;, - 3;663,655,662;, - 3;656,655,663;, - 3;658,657,664;, - 3;658,664,665;, - 3;659,658,665;, - 3;659,665,666;, - 3;660,659,666;, - 3;660,666,667;, - 3;668,660,667;, - 3;661,660,668;, - 3;662,661,668;, - 3;662,668,669;, - 3;670,662,669;, - 3;663,662,670;, - 3;665,664,671;, - 3;665,671,672;, - 3;666,665,672;, - 3;666,672,673;, - 3;667,666,673;, - 3;667,673,674;, - 3;675,667,674;, - 3;668,667,675;, - 3;669,668,675;, - 3;669,675,676;, - 3;677,669,676;, - 3;670,669,677;, - 3;672,671,678;, - 3;672,678,679;, - 3;673,672,679;, - 3;673,679,680;, - 3;674,673,680;, - 3;674,680,681;, - 3;682,674,681;, - 3;675,674,682;, - 3;676,675,682;, - 3;676,682,683;, - 3;684,676,683;, - 3;677,676,684;, - 3;679,678,685;, - 3;679,685,686;, - 3;680,679,686;, - 3;680,686,687;, - 3;681,680,687;, - 3;681,687,688;, - 3;689,681,688;, - 3;682,681,689;, - 3;683,682,689;, - 3;683,689,690;, - 3;691,683,690;, - 3;684,683,691;, - 3;686,685,692;, - 3;686,692,693;, - 3;687,686,693;, - 3;687,693,694;, - 3;688,687,694;, - 3;688,694,695;, - 3;696,688,695;, - 3;689,688,696;, - 3;690,689,696;, - 3;690,696,697;, - 3;698,690,697;, - 3;691,690,698;, - 3;693,692,699;, - 3;693,699,700;, - 3;694,693,700;, - 3;694,700,701;, - 3;695,694,701;, - 3;695,701,702;, - 3;703,695,702;, - 3;696,695,703;, - 3;697,696,703;, - 3;697,703,704;, - 3;705,697,704;, - 3;698,697,705;, - 3;700,699,706;, - 3;700,706,707;, - 3;701,700,707;, - 3;701,707,708;, - 3;702,701,708;, - 3;702,708,709;, - 3;710,702,709;, - 3;703,702,710;, - 3;704,703,710;, - 3;704,710,711;, - 3;712,704,711;, - 3;705,704,712;, - 3;707,706,713;, - 3;707,713,714;, - 3;708,707,714;, - 3;708,714,715;, - 3;709,708,715;, - 3;709,715,716;, - 3;717,709,716;, - 3;710,709,717;, - 3;711,710,717;, - 3;711,717,718;, - 3;719,711,718;, - 3;712,711,719;, - 3;714,713,720;, - 3;714,720,721;, - 3;715,714,721;, - 3;715,721,722;, - 3;716,715,722;, - 3;716,722,723;, - 3;724,716,723;, - 3;717,716,724;, - 3;718,717,724;, - 3;718,724,725;, - 3;726,718,725;, - 3;719,718,726;, - 3;721,720,727;, - 3;721,727,728;, - 3;722,721,728;, - 3;722,728,729;, - 3;723,722,729;, - 3;723,729,730;, - 3;731,723,730;, - 3;724,723,731;, - 3;725,724,731;, - 3;725,731,732;, - 3;733,725,732;, - 3;726,725,733;, - 3;728,727,734;, - 3;728,734,735;, - 3;729,728,735;, - 3;729,735,736;, - 3;730,729,736;, - 3;730,736,737;, - 3;738,730,737;, - 3;731,730,738;, - 3;732,731,738;, - 3;732,738,739;, - 3;740,732,739;, - 3;733,732,740;, - 3;735,734,741;, - 3;735,741,742;, - 3;736,735,742;, - 3;736,742,743;, - 3;737,736,743;, - 3;737,743,744;, - 3;745,737,744;, - 3;738,737,745;, - 3;739,738,745;, - 3;739,745,746;, - 3;747,739,746;, - 3;740,739,747;, - 3;742,741,748;, - 3;742,748,749;, - 3;743,742,749;, - 3;743,749,750;, - 3;744,743,750;, - 3;744,750,751;, - 3;752,744,751;, - 3;745,744,752;, - 3;746,745,752;, - 3;746,752,753;, - 3;754,746,753;, - 3;747,746,754;, - 3;749,748,755;, - 3;749,755,756;, - 3;750,749,756;, - 3;750,756,757;, - 3;751,750,757;, - 3;751,757,758;, - 3;759,751,758;, - 3;752,751,759;, - 3;753,752,759;, - 3;753,759,760;, - 3;761,753,760;, - 3;754,753,761;, - 3;756,755,762;, - 3;756,762,763;, - 3;757,756,763;, - 3;757,763,764;, - 3;758,757,764;, - 3;758,764,765;, - 3;766,758,765;, - 3;759,758,766;, - 3;760,759,766;, - 3;760,766,767;, - 3;768,760,767;, - 3;761,760,768;, - 3;763,762,769;, - 3;763,769,770;, - 3;764,763,770;, - 3;764,770,771;, - 3;765,764,771;, - 3;765,771,772;, - 3;773,765,772;, - 3;766,765,773;, - 3;767,766,773;, - 3;767,773,774;, - 3;775,767,774;, - 3;768,767,775;, - 3;770,769,776;, - 3;770,776,777;, - 3;771,770,777;, - 3;771,777,778;, - 3;772,771,778;, - 3;772,778,779;, - 3;780,772,779;, - 3;773,772,780;, - 3;774,773,780;, - 3;774,780,781;, - 3;782,774,781;, - 3;775,774,782;, - 3;777,776,783;, - 3;777,783,784;, - 3;778,777,784;, - 3;778,784,785;, - 3;779,778,785;, - 3;779,785,786;, - 3;787,779,786;, - 3;780,779,787;, - 3;781,780,787;, - 3;781,787,788;, - 3;789,781,788;, - 3;782,781,789;, - 3;784,783,790;, - 3;784,790,791;, - 3;785,784,791;, - 3;785,791,792;, - 3;786,785,792;, - 3;786,792,793;, - 3;794,786,793;, - 3;787,786,794;, - 3;788,787,794;, - 3;788,794,795;, - 3;796,788,795;, - 3;789,788,796;, - 3;791,790,797;, - 3;791,797,798;, - 3;792,791,798;, - 3;792,798,799;, - 3;793,792,799;, - 3;793,799,800;, - 3;801,793,800;, - 3;794,793,801;, - 3;795,794,801;, - 3;795,801,802;, - 3;803,795,802;, - 3;796,795,803;, - 3;798,797,804;, - 3;798,804,805;, - 3;799,798,805;, - 3;799,805,806;, - 3;800,799,806;, - 3;800,806,807;, - 3;808,800,807;, - 3;801,800,808;, - 3;802,801,808;, - 3;802,808,809;, - 3;810,802,809;, - 3;803,802,810;, - 3;805,804,811;, - 3;805,811,812;, - 3;806,805,812;, - 3;806,812,813;, - 3;807,806,813;, - 3;807,813,814;, - 3;815,807,814;, - 3;808,807,815;, - 3;809,808,815;, - 3;809,815,816;, - 3;817,809,816;, - 3;810,809,817;, - 3;812,811,818;, - 3;812,818,819;, - 3;813,812,819;, - 3;813,819,820;, - 3;814,813,820;, - 3;814,820,821;, - 3;822,814,821;, - 3;815,814,822;, - 3;816,815,822;, - 3;816,822,823;, - 3;824,816,823;, - 3;817,816,824;, - 3;819,818,825;, - 3;819,825,826;, - 3;820,819,826;, - 3;820,826,827;, - 3;821,820,827;, - 3;821,827,828;, - 3;829,821,828;, - 3;822,821,829;, - 3;823,822,829;, - 3;823,829,830;, - 3;831,823,830;, - 3;824,823,831;, - 3;826,825,832;, - 3;826,832,833;, - 3;827,826,833;, - 3;827,833,834;, - 3;828,827,834;, - 3;828,834,835;, - 3;836,828,835;, - 3;829,828,836;, - 3;830,829,836;, - 3;830,836,837;, - 3;838,830,837;, - 3;831,830,838;, - 3;833,832,839;, - 3;833,839,840;, - 3;834,833,840;, - 3;834,840,841;, - 3;835,834,841;, - 3;835,841,842;, - 3;843,835,842;, - 3;836,835,843;, - 3;837,836,843;, - 3;837,843,844;, - 3;845,837,844;, - 3;838,837,845;, - 3;840,839,846;, - 3;840,846,847;, - 3;841,840,847;, - 3;841,847,848;, - 3;842,841,848;, - 3;842,848,849;, - 3;850,842,849;, - 3;843,842,850;, - 3;844,843,850;, - 3;844,850,851;, - 3;852,844,851;, - 3;845,844,852;, - 3;847,846,853;, - 3;847,853,854;, - 3;848,847,854;, - 3;848,854,855;, - 3;849,848,855;, - 3;849,855,856;, - 3;857,849,856;, - 3;850,849,857;, - 3;851,850,857;, - 3;851,857,858;, - 3;859,851,858;, - 3;852,851,859;, - 3;854,853,860;, - 3;854,860,861;, - 3;855,854,861;, - 3;855,861,862;, - 3;856,855,862;, - 3;856,862,863;, - 3;864,856,863;, - 3;857,856,864;, - 3;858,857,864;, - 3;858,864,865;, - 3;866,858,865;, - 3;859,858,866;, - 3;861,860,867;, - 3;861,867,868;, - 3;862,861,868;, - 3;862,868,869;, - 3;863,862,869;, - 3;863,869,870;, - 3;871,863,870;, - 3;864,863,871;, - 3;865,864,871;, - 3;865,871,872;, - 3;873,865,872;, - 3;866,865,873;, - 3;868,867,874;, - 3;868,874,875;, - 3;869,868,875;, - 3;869,875,876;, - 3;870,869,876;, - 3;870,876,877;, - 3;878,870,877;, - 3;871,870,878;, - 3;872,871,878;, - 3;872,878,879;, - 3;880,872,879;, - 3;873,872,880;, - 3;875,874,881;, - 3;875,881,882;, - 3;876,875,882;, - 3;876,882,883;, - 3;877,876,883;, - 3;877,883,884;, - 3;885,877,884;, - 3;878,877,885;, - 3;879,878,885;, - 3;879,885,886;, - 3;887,879,886;, - 3;880,879,887;, - 3;882,881,888;, - 3;882,888,889;, - 3;883,882,889;, - 3;883,889,890;, - 3;884,883,890;, - 3;884,890,891;, - 3;892,884,891;, - 3;885,884,892;, - 3;886,885,892;, - 3;886,892,893;, - 3;894,886,893;, - 3;887,886,894;, - 3;889,888,895;, - 3;889,895,896;, - 3;890,889,896;, - 3;890,896,897;, - 3;891,890,897;, - 3;891,897,898;, - 3;899,891,898;, - 3;892,891,899;, - 3;893,892,899;, - 3;893,899,900;, - 3;901,893,900;, - 3;894,893,901;, - 3;896,895,902;, - 3;896,902,903;, - 3;897,896,903;, - 3;897,903,904;, - 3;898,897,904;, - 3;898,904,905;, - 3;906,898,905;, - 3;899,898,906;, - 3;900,899,906;, - 3;900,906,907;, - 3;908,900,907;, - 3;901,900,908;, - 3;903,902,909;, - 3;903,909,910;, - 3;904,903,910;, - 3;904,910,911;, - 3;905,904,911;, - 3;905,911,912;, - 3;913,905,912;, - 3;906,905,913;, - 3;907,906,913;, - 3;907,913,914;, - 3;915,907,914;, - 3;908,907,915;, - 3;910,909,916;, - 3;910,916,917;, - 3;911,910,917;, - 3;911,917,918;, - 3;912,911,918;, - 3;912,918,919;, - 3;920,912,919;, - 3;913,912,920;, - 3;914,913,920;, - 3;914,920,921;, - 3;922,914,921;, - 3;915,914,922;, - 3;917,916,923;, - 3;917,923,924;, - 3;918,917,924;, - 3;918,924,925;, - 3;919,918,925;, - 3;919,925,926;, - 3;927,919,926;, - 3;920,919,927;, - 3;921,920,927;, - 3;921,927,928;, - 3;929,921,928;, - 3;922,921,929;, - 3;924,923,6;, - 3;925,924,6;, - 3;926,925,6;, - 3;930,926,6;, - 3;927,926,930;, - 3;928,927,930;, - 3;928,930,931;, - 3;932,928,931;, - 3;929,928,932;, - 3;933,929,932;, - 3;934,929,933;, - 3;934,922,929;, - 3;931,930,6;, - 3;935,931,6;, - 3;932,931,935;, - 3;936,932,935;, - 3;933,932,936;, - 3;937,933,936;, - 3;938,933,937;, - 3;938,934,933;, - 3;939,934,938;, - 3;939,940,934;, - 3;940,922,934;, - 3;940,915,922;, - 3;941,935,6;, - 3;936,935,941;, - 3;942,936,941;, - 3;937,936,942;, - 3;943,937,942;, - 3;944,937,943;, - 3;944,938,937;, - 3;945,938,944;, - 3;945,939,938;, - 3;946,941,6;, - 3;942,941,946;, - 3;947,942,946;, - 3;943,942,947;, - 3;948,943,947;, - 3;949,943,948;, - 3;949,944,943;, - 3;950,944,949;, - 3;950,945,944;, - 3;951,946,6;, - 3;947,946,951;, - 3;952,947,951;, - 3;948,947,952;, - 3;953,948,952;, - 3;954,948,953;, - 3;954,949,948;, - 3;955,949,954;, - 3;955,950,949;, - 3;956,951,6;, - 3;952,951,956;, - 3;957,952,956;, - 3;953,952,957;, - 3;958,953,957;, - 3;959,953,958;, - 3;959,954,953;, - 3;960,954,959;, - 3;960,955,954;, - 3;961,956,6;, - 3;957,956,961;, - 3;962,957,961;, - 3;958,957,962;, - 3;963,958,962;, - 3;964,958,963;, - 3;964,959,958;, - 3;965,959,964;, - 3;965,960,959;, - 3;966,961,6;, - 3;962,961,966;, - 3;967,962,966;, - 3;963,962,967;, - 3;968,963,967;, - 3;969,963,968;, - 3;969,964,963;, - 3;970,964,969;, - 3;970,965,964;, - 3;971,966,6;, - 3;967,966,971;, - 3;972,967,971;, - 3;968,967,972;, - 3;973,968,972;, - 3;974,968,973;, - 3;974,969,968;, - 3;975,969,974;, - 3;975,970,969;, - 3;976,971,6;, - 3;972,971,976;, - 3;977,972,976;, - 3;973,972,977;, - 3;978,973,977;, - 3;979,973,978;, - 3;979,974,973;, - 3;980,974,979;, - 3;980,975,974;, - 3;981,976,6;, - 3;977,976,981;, - 3;982,977,981;, - 3;978,977,982;, - 3;983,978,982;, - 3;984,978,983;, - 3;984,979,978;, - 3;985,979,984;, - 3;985,980,979;, - 3;986,981,6;, - 3;982,981,986;, - 3;987,982,986;, - 3;983,982,987;, - 3;988,983,987;, - 3;989,983,988;, - 3;989,984,983;, - 3;990,984,989;, - 3;990,985,984;, - 3;991,986,6;, - 3;987,986,991;, - 3;12,987,991;, - 3;988,987,12;, - 3;11,988,12;, - 3;992,988,11;, - 3;992,989,988;, - 3;993,989,992;, - 3;993,990,989;, - 3;5,991,6;, - 3;12,991,5;, - 3;18,992,11;, - 3;994,992,18;, - 3;994,993,992;, - 3;995,993,994;, - 3;995,996,993;, - 3;996,990,993;, - 3;996,997,990;, - 3;997,985,990;, - 3;998,994,18;, - 3;999,994,998;, - 3;999,995,994;, - 3;1000,995,999;, - 3;1000,1001,995;, - 3;1001,996,995;, - 3;1001,1002,996;, - 3;1002,997,996;, - 3;998,18,17;, - 3;24,998,17;, - 3;1003,998,24;, - 3;1003,999,998;, - 3;1004,999,1003;, - 3;1004,1000,999;, - 3;1005,1000,1004;, - 3;1005,1006,1000;, - 3;1006,1001,1000;, - 3;1006,1007,1001;, - 3;1007,1002,1001;, - 3;1008,1003,24;, - 3;1009,1003,1008;, - 3;1009,1004,1003;, - 3;1010,1004,1009;, - 3;1010,1005,1004;, - 3;1011,1005,1010;, - 3;1011,1012,1005;, - 3;1012,1006,1005;, - 3;1012,1013,1006;, - 3;1013,1007,1006;, - 3;1008,24,23;, - 3;35,1008,23;, - 3;1014,1008,35;, - 3;1014,1009,1008;, - 3;1015,1009,1014;, - 3;1015,1010,1009;, - 3;1016,1010,1015;, - 3;1016,1011,1010;, - 3;1017,1011,1016;, - 3;1017,1018,1011;, - 3;1018,1012,1011;, - 3;1018,1019,1012;, - 3;1019,1013,1012;, - 3;1014,35,41;, - 3;1014,41,1020;, - 3;1015,1014,1020;, - 3;1015,1020,1021;, - 3;1016,1015,1021;, - 3;1016,1021,1022;, - 3;1017,1016,1022;, - 3;1017,1022,1023;, - 3;1024,1017,1023;, - 3;1024,1018,1017;, - 3;1024,1025,1018;, - 3;1025,1019,1018;, - 3;1020,41,47;, - 3;1020,47,1026;, - 3;1021,1020,1026;, - 3;1021,1026,1027;, - 3;1022,1021,1027;, - 3;1022,1027,1028;, - 3;1023,1022,1028;, - 3;1023,1028,1029;, - 3;1030,1023,1029;, - 3;1024,1023,1030;, - 3;1031,1024,1030;, - 3;1031,1025,1024;, - 3;1026,47,53;, - 3;1026,53,1032;, - 3;1027,1026,1032;, - 3;1027,1032,1033;, - 3;1028,1027,1033;, - 3;1028,1033,1034;, - 3;1029,1028,1034;, - 3;1029,1034,1035;, - 3;1036,1029,1035;, - 3;1030,1029,1036;, - 3;1037,1030,1036;, - 3;1031,1030,1037;, - 3;1032,53,59;, - 3;1032,59,1038;, - 3;1033,1032,1038;, - 3;1033,1038,1039;, - 3;1034,1033,1039;, - 3;1034,1039,1040;, - 3;1035,1034,1040;, - 3;1035,1040,1041;, - 3;1042,1035,1041;, - 3;1036,1035,1042;, - 3;1043,1036,1042;, - 3;1037,1036,1043;, - 3;1038,59,65;, - 3;1038,65,1044;, - 3;1039,1038,1044;, - 3;1039,1044,1045;, - 3;1040,1039,1045;, - 3;1040,1045,1046;, - 3;1041,1040,1046;, - 3;1041,1046,1047;, - 3;1048,1041,1047;, - 3;1042,1041,1048;, - 3;1049,1042,1048;, - 3;1043,1042,1049;, - 3;1044,65,71;, - 3;1044,71,1050;, - 3;1045,1044,1050;, - 3;1045,1050,1051;, - 3;1046,1045,1051;, - 3;1046,1051,1052;, - 3;1047,1046,1052;, - 3;1047,1052,1053;, - 3;1054,1047,1053;, - 3;1048,1047,1054;, - 3;1055,1048,1054;, - 3;1049,1048,1055;, - 3;1050,71,77;, - 3;1050,77,1056;, - 3;1051,1050,1056;, - 3;1051,1056,1057;, - 3;1052,1051,1057;, - 3;1052,1057,1058;, - 3;1053,1052,1058;, - 3;1053,1058,1059;, - 3;1060,1053,1059;, - 3;1054,1053,1060;, - 3;1061,1054,1060;, - 3;1055,1054,1061;, - 3;1056,77,83;, - 3;1056,83,1062;, - 3;1057,1056,1062;, - 3;1057,1062,1063;, - 3;1058,1057,1063;, - 3;1058,1063,1064;, - 3;1059,1058,1064;, - 3;1059,1064,1065;, - 3;1066,1059,1065;, - 3;1060,1059,1066;, - 3;1067,1060,1066;, - 3;1061,1060,1067;, - 3;1062,83,89;, - 3;1062,89,1068;, - 3;1063,1062,1068;, - 3;1063,1068,1069;, - 3;1064,1063,1069;, - 3;1064,1069,1070;, - 3;1065,1064,1070;, - 3;1065,1070,1071;, - 3;1072,1065,1071;, - 3;1066,1065,1072;, - 3;1073,1066,1072;, - 3;1067,1066,1073;, - 3;1068,89,95;, - 3;1068,95,1074;, - 3;1069,1068,1074;, - 3;1069,1074,1075;, - 3;1070,1069,1075;, - 3;1070,1075,1076;, - 3;1071,1070,1076;, - 3;1071,1076,1077;, - 3;1078,1071,1077;, - 3;1072,1071,1078;, - 3;1079,1072,1078;, - 3;1073,1072,1079;, - 3;1074,95,101;, - 3;1074,101,1080;, - 3;1075,1074,1080;, - 3;1075,1080,1081;, - 3;1076,1075,1081;, - 3;1076,1081,1082;, - 3;1077,1076,1082;, - 3;1077,1082,1083;, - 3;1084,1077,1083;, - 3;1078,1077,1084;, - 3;1085,1078,1084;, - 3;1079,1078,1085;, - 3;1080,101,107;, - 3;1080,107,1086;, - 3;1081,1080,1086;, - 3;1081,1086,1087;, - 3;1082,1081,1087;, - 3;1082,1087,1088;, - 3;1083,1082,1088;, - 3;1083,1088,1089;, - 3;1090,1083,1089;, - 3;1084,1083,1090;, - 3;1091,1084,1090;, - 3;1085,1084,1091;, - 3;1086,107,113;, - 3;1086,113,1092;, - 3;1087,1086,1092;, - 3;1087,1092,1093;, - 3;1088,1087,1093;, - 3;1088,1093,1094;, - 3;1089,1088,1094;, - 3;1089,1094,1095;, - 3;1096,1089,1095;, - 3;1090,1089,1096;, - 3;1097,1090,1096;, - 3;1091,1090,1097;, - 3;1092,113,119;, - 3;1092,119,1098;, - 3;1093,1092,1098;, - 3;1093,1098,1099;, - 3;1094,1093,1099;, - 3;1094,1099,1100;, - 3;1095,1094,1100;, - 3;1095,1100,1101;, - 3;1102,1095,1101;, - 3;1096,1095,1102;, - 3;1103,1096,1102;, - 3;1097,1096,1103;, - 3;1098,119,125;, - 3;1098,125,1104;, - 3;1099,1098,1104;, - 3;1099,1104,1105;, - 3;1100,1099,1105;, - 3;1100,1105,1106;, - 3;1101,1100,1106;, - 3;1101,1106,1107;, - 3;1108,1101,1107;, - 3;1102,1101,1108;, - 3;1109,1102,1108;, - 3;1103,1102,1109;, - 3;1104,125,131;, - 3;1104,131,1110;, - 3;1105,1104,1110;, - 3;1105,1110,1111;, - 3;1106,1105,1111;, - 3;1106,1111,1112;, - 3;1107,1106,1112;, - 3;1107,1112,1113;, - 3;1114,1107,1113;, - 3;1108,1107,1114;, - 3;1115,1108,1114;, - 3;1109,1108,1115;, - 3;1110,131,137;, - 3;1110,137,1116;, - 3;1111,1110,1116;, - 3;1111,1116,1117;, - 3;1112,1111,1117;, - 3;1112,1117,1118;, - 3;1113,1112,1118;, - 3;1113,1118,1119;, - 3;1120,1113,1119;, - 3;1114,1113,1120;, - 3;1121,1114,1120;, - 3;1115,1114,1121;, - 3;1116,137,143;, - 3;1116,143,1122;, - 3;1117,1116,1122;, - 3;1117,1122,1123;, - 3;1118,1117,1123;, - 3;1118,1123,1124;, - 3;1119,1118,1124;, - 3;1119,1124,1125;, - 3;1126,1119,1125;, - 3;1120,1119,1126;, - 3;1127,1120,1126;, - 3;1121,1120,1127;, - 3;1122,143,149;, - 3;1122,149,183;, - 3;1123,1122,183;, - 3;1123,183,182;, - 3;1124,1123,182;, - 3;1124,182,189;, - 3;1125,1124,189;, - 3;1125,189,195;, - 3;1128,1125,195;, - 3;1126,1125,1128;, - 3;1129,1126,1128;, - 3;1127,1126,1129;, - 3;1130,1127,1129;, - 3;1131,1127,1130;, - 3;1131,1121,1127;, - 3;1132,1121,1131;, - 3;1132,1115,1121;, - 3;1128,195,201;, - 3;1133,1128,201;, - 3;1129,1128,1133;, - 3;1134,1129,1133;, - 3;1130,1129,1134;, - 3;1135,1130,1134;, - 3;1136,1130,1135;, - 3;1136,1131,1130;, - 3;1137,1131,1136;, - 3;1137,1132,1131;, - 3;1133,201,207;, - 3;1138,1133,207;, - 3;1134,1133,1138;, - 3;1139,1134,1138;, - 3;1135,1134,1139;, - 3;1140,1135,1139;, - 3;1141,1135,1140;, - 3;1141,1136,1135;, - 3;1142,1136,1141;, - 3;1142,1137,1136;, - 3;1138,207,213;, - 3;1143,1138,213;, - 3;1139,1138,1143;, - 3;1144,1139,1143;, - 3;1140,1139,1144;, - 3;1145,1140,1144;, - 3;1146,1140,1145;, - 3;1146,1141,1140;, - 3;1147,1141,1146;, - 3;1147,1142,1141;, - 3;1143,213,219;, - 3;1148,1143,219;, - 3;1144,1143,1148;, - 3;1149,1144,1148;, - 3;1145,1144,1149;, - 3;1150,1145,1149;, - 3;1151,1145,1150;, - 3;1151,1146,1145;, - 3;1152,1146,1151;, - 3;1152,1147,1146;, - 3;1148,219,225;, - 3;1153,1148,225;, - 3;1149,1148,1153;, - 3;1154,1149,1153;, - 3;1150,1149,1154;, - 3;1155,1150,1154;, - 3;1156,1150,1155;, - 3;1156,1151,1150;, - 3;1157,1151,1156;, - 3;1157,1152,1151;, - 3;1153,225,231;, - 3;1158,1153,231;, - 3;1154,1153,1158;, - 3;1159,1154,1158;, - 3;1155,1154,1159;, - 3;1160,1155,1159;, - 3;1161,1155,1160;, - 3;1161,1156,1155;, - 3;1162,1156,1161;, - 3;1162,1157,1156;, - 3;1158,231,237;, - 3;1163,1158,237;, - 3;1159,1158,1163;, - 3;1164,1159,1163;, - 3;1160,1159,1164;, - 3;1165,1160,1164;, - 3;1166,1160,1165;, - 3;1166,1161,1160;, - 3;1167,1161,1166;, - 3;1167,1162,1161;, - 3;1163,237,243;, - 3;1168,1163,243;, - 3;1164,1163,1168;, - 3;1169,1164,1168;, - 3;1165,1164,1169;, - 3;1170,1165,1169;, - 3;1171,1165,1170;, - 3;1171,1166,1165;, - 3;1172,1166,1171;, - 3;1172,1167,1166;, - 3;1168,243,249;, - 3;1173,1168,249;, - 3;1169,1168,1173;, - 3;1174,1169,1173;, - 3;1170,1169,1174;, - 3;1175,1170,1174;, - 3;1176,1170,1175;, - 3;1176,1171,1170;, - 3;1177,1171,1176;, - 3;1177,1172,1171;, - 3;1173,249,255;, - 3;1178,1173,255;, - 3;1174,1173,1178;, - 3;1179,1174,1178;, - 3;1175,1174,1179;, - 3;1180,1175,1179;, - 3;1181,1175,1180;, - 3;1181,1176,1175;, - 3;1182,1176,1181;, - 3;1182,1177,1176;, - 3;1178,255,261;, - 3;1183,1178,261;, - 3;1179,1178,1183;, - 3;1184,1179,1183;, - 3;1180,1179,1184;, - 3;1185,1180,1184;, - 3;1186,1180,1185;, - 3;1186,1181,1180;, - 3;1187,1181,1186;, - 3;1187,1182,1181;, - 3;1183,261,267;, - 3;1188,1183,267;, - 3;1184,1183,1188;, - 3;1189,1184,1188;, - 3;1185,1184,1189;, - 3;1190,1185,1189;, - 3;1191,1185,1190;, - 3;1191,1186,1185;, - 3;1192,1186,1191;, - 3;1192,1187,1186;, - 3;1188,267,273;, - 3;1193,1188,273;, - 3;1189,1188,1193;, - 3;1194,1189,1193;, - 3;1190,1189,1194;, - 3;1195,1190,1194;, - 3;1196,1190,1195;, - 3;1196,1191,1190;, - 3;1197,1191,1196;, - 3;1197,1192,1191;, - 3;1193,273,279;, - 3;1198,1193,279;, - 3;1194,1193,1198;, - 3;1199,1194,1198;, - 3;1195,1194,1199;, - 3;1200,1195,1199;, - 3;1201,1195,1200;, - 3;1201,1196,1195;, - 3;1202,1196,1201;, - 3;1202,1197,1196;, - 3;1198,279,285;, - 3;1203,1198,285;, - 3;1199,1198,1203;, - 3;1204,1199,1203;, - 3;1200,1199,1204;, - 3;1205,1200,1204;, - 3;1206,1200,1205;, - 3;1206,1201,1200;, - 3;1207,1201,1206;, - 3;1207,1202,1201;, - 3;1203,285,291;, - 3;1208,1203,291;, - 3;1204,1203,1208;, - 3;1209,1204,1208;, - 3;1205,1204,1209;, - 3;1210,1205,1209;, - 3;1211,1205,1210;, - 3;1211,1206,1205;, - 3;1212,1206,1211;, - 3;1212,1207,1206;, - 3;1208,291,297;, - 3;1213,1208,297;, - 3;1209,1208,1213;, - 3;1214,1209,1213;, - 3;1210,1209,1214;, - 3;1215,1210,1214;, - 3;1216,1210,1215;, - 3;1216,1211,1210;, - 3;1217,1211,1216;, - 3;1217,1212,1211;, - 3;1213,297,303;, - 3;1218,1213,303;, - 3;1214,1213,1218;, - 3;1219,1214,1218;, - 3;1215,1214,1219;, - 3;1220,1215,1219;, - 3;1221,1215,1220;, - 3;1221,1216,1215;, - 3;1222,1216,1221;, - 3;1222,1217,1216;, - 3;1218,303,309;, - 3;1223,1218,309;, - 3;1219,1218,1223;, - 3;1224,1219,1223;, - 3;1220,1219,1224;, - 3;1225,1220,1224;, - 3;1226,1220,1225;, - 3;1226,1221,1220;, - 3;1227,1221,1226;, - 3;1227,1222,1221;, - 3;1223,309,315;, - 3;1228,1223,315;, - 3;1224,1223,1228;, - 3;1229,1224,1228;, - 3;1225,1224,1229;, - 3;1230,1225,1229;, - 3;1231,1225,1230;, - 3;1231,1226,1225;, - 3;1232,1226,1231;, - 3;1232,1227,1226;, - 3;1228,315,321;, - 3;1233,1228,321;, - 3;1229,1228,1233;, - 3;1234,1229,1233;, - 3;1230,1229,1234;, - 3;1235,1230,1234;, - 3;1236,1230,1235;, - 3;1236,1231,1230;, - 3;1237,1231,1236;, - 3;1237,1232,1231;, - 3;1233,321,327;, - 3;1238,1233,327;, - 3;1234,1233,1238;, - 3;1239,1234,1238;, - 3;1235,1234,1239;, - 3;1240,1235,1239;, - 3;1241,1235,1240;, - 3;1241,1236,1235;, - 3;1242,1236,1241;, - 3;1242,1237,1236;, - 3;1238,327,333;, - 3;1243,1238,333;, - 3;1239,1238,1243;, - 3;1244,1239,1243;, - 3;1240,1239,1244;, - 3;1245,1240,1244;, - 3;1246,1240,1245;, - 3;1246,1241,1240;, - 3;1247,1241,1246;, - 3;1247,1242,1241;, - 3;1243,333,339;, - 3;1248,1243,339;, - 3;1244,1243,1248;, - 3;1249,1244,1248;, - 3;1245,1244,1249;, - 3;1250,1245,1249;, - 3;1251,1245,1250;, - 3;1251,1246,1245;, - 3;1252,1246,1251;, - 3;1252,1247,1246;, - 3;1248,339,345;, - 3;1253,1248,345;, - 3;1249,1248,1253;, - 3;1254,1249,1253;, - 3;1250,1249,1254;, - 3;1255,1250,1254;, - 3;1256,1250,1255;, - 3;1256,1251,1250;, - 3;1257,1251,1256;, - 3;1257,1252,1251;, - 3;1253,345,351;, - 3;1258,1253,351;, - 3;1254,1253,1258;, - 3;1259,1254,1258;, - 3;1255,1254,1259;, - 3;1260,1255,1259;, - 3;1261,1255,1260;, - 3;1261,1256,1255;, - 3;1262,1256,1261;, - 3;1262,1257,1256;, - 3;1258,351,357;, - 3;1263,1258,357;, - 3;1259,1258,1263;, - 3;1264,1259,1263;, - 3;1260,1259,1264;, - 3;1265,1260,1264;, - 3;1266,1260,1265;, - 3;1266,1261,1260;, - 3;1267,1261,1266;, - 3;1267,1262,1261;, - 3;1263,357,363;, - 3;1268,1263,363;, - 3;1264,1263,1268;, - 3;1269,1264,1268;, - 3;1265,1264,1269;, - 3;1270,1265,1269;, - 3;1271,1265,1270;, - 3;1271,1266,1265;, - 3;1272,1266,1271;, - 3;1272,1267,1266;, - 3;1268,363,369;, - 3;1273,1268,369;, - 3;1269,1268,1273;, - 3;1274,1269,1273;, - 3;1270,1269,1274;, - 3;1275,1270,1274;, - 3;1276,1270,1275;, - 3;1276,1271,1270;, - 3;1277,1271,1276;, - 3;1277,1272,1271;, - 3;1273,369,375;, - 3;1278,1273,375;, - 3;1274,1273,1278;, - 3;1279,1274,1278;, - 3;1275,1274,1279;, - 3;443,1275,1279;, - 3;448,1275,443;, - 3;448,1276,1275;, - 3;453,1276,448;, - 3;453,1277,1276;, - 3;1278,375,381;, - 3;1280,1278,381;, - 3;1279,1278,1280;, - 3;437,1279,1280;, - 3;443,1279,437;, - 3;1280,381,387;, - 3;438,1280,387;, - 3;437,1280,438;, - 3;438,387,393;, - 3;427,438,393;, - 3;427,393,399;, - 3;458,1277,453;, - 3;458,1281,1277;, - 3;1281,1272,1277;, - 3;1281,1282,1272;, - 3;1282,1267,1272;, - 3;1282,1283,1267;, - 3;1283,1262,1267;, - 3;463,1281,458;, - 3;463,1284,1281;, - 3;1284,1282,1281;, - 3;1284,1285,1282;, - 3;1285,1283,1282;, - 3;1285,1286,1283;, - 3;1286,1287,1283;, - 3;1283,1287,1262;, - 3;1287,1257,1262;, - 3;1287,1288,1257;, - 3;1288,1252,1257;, - 3;468,1284,463;, - 3;468,1289,1284;, - 3;1289,1285,1284;, - 3;1289,1290,1285;, - 3;1290,1286,1285;, - 3;1290,1291,1286;, - 3;1291,1292,1286;, - 3;1286,1292,1287;, - 3;1292,1288,1287;, - 3;1292,1293,1288;, - 3;1293,1294,1288;, - 3;1288,1294,1252;, - 3;1294,1247,1252;, - 3;473,1289,468;, - 3;473,1295,1289;, - 3;1295,1290,1289;, - 3;1295,1296,1290;, - 3;1296,1291,1290;, - 3;1296,1297,1291;, - 3;1297,1298,1291;, - 3;1291,1298,1292;, - 3;1298,1293,1292;, - 3;1298,1299,1293;, - 3;1299,1300,1293;, - 3;1293,1300,1294;, - 3;478,1295,473;, - 3;478,1301,1295;, - 3;1301,1296,1295;, - 3;1301,1302,1296;, - 3;1302,1297,1296;, - 3;1302,1303,1297;, - 3;1303,1304,1297;, - 3;1297,1304,1298;, - 3;1304,1299,1298;, - 3;1304,1305,1299;, - 3;1305,1306,1299;, - 3;1299,1306,1300;, - 3;483,1301,478;, - 3;483,1307,1301;, - 3;1307,1302,1301;, - 3;1307,1308,1302;, - 3;1308,1303,1302;, - 3;1308,1309,1303;, - 3;1309,1310,1303;, - 3;1303,1310,1304;, - 3;1310,1305,1304;, - 3;1310,1311,1305;, - 3;1311,1312,1305;, - 3;1305,1312,1306;, - 3;488,1307,483;, - 3;488,1313,1307;, - 3;1313,1308,1307;, - 3;1313,1314,1308;, - 3;1314,1309,1308;, - 3;1314,1315,1309;, - 3;1315,1316,1309;, - 3;1309,1316,1310;, - 3;1316,1311,1310;, - 3;1316,1317,1311;, - 3;1317,1318,1311;, - 3;1311,1318,1312;, - 3;493,1313,488;, - 3;493,1319,1313;, - 3;1319,1314,1313;, - 3;1319,1320,1314;, - 3;1320,1315,1314;, - 3;1320,1321,1315;, - 3;1321,1322,1315;, - 3;1315,1322,1316;, - 3;1322,1317,1316;, - 3;1322,1323,1317;, - 3;1323,1324,1317;, - 3;1317,1324,1318;, - 3;498,1319,493;, - 3;498,1325,1319;, - 3;1325,1320,1319;, - 3;1325,1326,1320;, - 3;1326,1321,1320;, - 3;1326,1327,1321;, - 3;1327,1328,1321;, - 3;1321,1328,1322;, - 3;1328,1323,1322;, - 3;1328,1329,1323;, - 3;1329,1330,1323;, - 3;1323,1330,1324;, - 3;503,1325,498;, - 3;503,515,1325;, - 3;515,1326,1325;, - 3;515,1331,1326;, - 3;1331,1327,1326;, - 3;1331,1332,1327;, - 3;1332,1333,1327;, - 3;1327,1333,1328;, - 3;1333,1329,1328;, - 3;1333,1334,1329;, - 3;1334,1335,1329;, - 3;1329,1335,1330;, - 3;514,1331,515;, - 3;514,1336,1331;, - 3;1336,1332,1331;, - 3;1336,1337,1332;, - 3;1337,1338,1332;, - 3;1332,1338,1333;, - 3;1338,1334,1333;, - 3;1338,1339,1334;, - 3;1339,1340,1334;, - 3;1334,1340,1335;, - 3;521,1336,514;, - 3;521,1341,1336;, - 3;1341,1337,1336;, - 3;1341,1342,1337;, - 3;1342,1343,1337;, - 3;1337,1343,1338;, - 3;1343,1339,1338;, - 3;1343,1344,1339;, - 3;1344,1345,1339;, - 3;1339,1345,1340;, - 3;1346,1341,521;, - 3;1346,1347,1341;, - 3;1347,1342,1341;, - 3;1347,1348,1342;, - 3;1348,1349,1342;, - 3;1342,1349,1343;, - 3;1349,1344,1343;, - 3;1349,1350,1344;, - 3;1350,1351,1344;, - 3;1344,1351,1345;, - 3;520,1346,521;, - 3;1352,1346,520;, - 3;1352,1353,1346;, - 3;1353,1347,1346;, - 3;1353,1354,1347;, - 3;1354,1348,1347;, - 3;1354,1355,1348;, - 3;1355,1356,1348;, - 3;1348,1356,1349;, - 3;1356,1350,1349;, - 3;519,1352,520;, - 3;519,527,1352;, - 3;1352,527,1357;, - 3;1352,1357,1353;, - 3;1353,1357,1358;, - 3;1353,1358,1354;, - 3;1354,1358,1359;, - 3;1354,1359,1355;, - 3;1355,1359,1360;, - 3;1355,1360,1361;, - 3;1355,1361,1356;, - 3;1361,1362,1356;, - 3;1356,1362,1350;, - 3;527,1363,1357;, - 3;1357,1363,1364;, - 3;1357,1364,1358;, - 3;1358,1364,1365;, - 3;1358,1365,1359;, - 3;1359,1365,1366;, - 3;1359,1366,1360;, - 3;1360,1366,1367;, - 3;1360,1367,1368;, - 3;1361,1360,1368;, - 3;527,526,1363;, - 3;526,1369,1363;, - 3;1363,1369,1370;, - 3;1363,1370,1364;, - 3;1364,1370,1371;, - 3;1364,1371,1365;, - 3;1365,1371,1372;, - 3;1365,1372,1366;, - 3;1366,1372,1373;, - 3;1366,1373,1367;, - 3;526,533,1369;, - 3;533,1374,1369;, - 3;1369,1374,1375;, - 3;1369,1375,1370;, - 3;1370,1375,1376;, - 3;1370,1376,1371;, - 3;1371,1376,1377;, - 3;1371,1377,1372;, - 3;1372,1377,1378;, - 3;1372,1378,1373;, - 3;533,538,1374;, - 3;538,1379,1374;, - 3;1374,1379,1380;, - 3;1374,1380,1375;, - 3;1375,1380,1381;, - 3;1375,1381,1376;, - 3;1376,1381,1382;, - 3;1376,1382,1377;, - 3;1377,1382,1383;, - 3;1377,1383,1378;, - 3;538,543,1379;, - 3;543,1384,1379;, - 3;1379,1384,1385;, - 3;1379,1385,1380;, - 3;1380,1385,1386;, - 3;1380,1386,1381;, - 3;1381,1386,1387;, - 3;1381,1387,1382;, - 3;1382,1387,1388;, - 3;1382,1388,1383;, - 3;543,548,1384;, - 3;548,1389,1384;, - 3;1384,1389,1390;, - 3;1384,1390,1385;, - 3;1385,1390,1391;, - 3;1385,1391,1386;, - 3;1386,1391,1392;, - 3;1386,1392,1387;, - 3;1387,1392,1393;, - 3;1387,1393,1388;, - 3;548,553,1389;, - 3;553,1394,1389;, - 3;1389,1394,1395;, - 3;1389,1395,1390;, - 3;1390,1395,1396;, - 3;1390,1396,1391;, - 3;1391,1396,1397;, - 3;1391,1397,1392;, - 3;1392,1397,1398;, - 3;1392,1398,1393;, - 3;553,558,1394;, - 3;558,1399,1394;, - 3;1394,1399,1400;, - 3;1394,1400,1395;, - 3;1395,1400,1401;, - 3;1395,1401,1396;, - 3;1396,1401,1402;, - 3;1396,1402,1397;, - 3;1397,1402,1403;, - 3;1397,1403,1398;, - 3;558,563,1399;, - 3;563,1404,1399;, - 3;1399,1404,1405;, - 3;1399,1405,1400;, - 3;1400,1405,1406;, - 3;1400,1406,1401;, - 3;1401,1406,1407;, - 3;1401,1407,1402;, - 3;1402,1407,1408;, - 3;1402,1408,1403;, - 3;563,568,1404;, - 3;568,1409,1404;, - 3;1404,1409,1410;, - 3;1404,1410,1405;, - 3;1405,1410,1411;, - 3;1405,1411,1406;, - 3;1406,1411,1412;, - 3;1406,1412,1407;, - 3;1407,1412,1413;, - 3;1407,1413,1408;, - 3;568,573,1409;, - 3;573,1414,1409;, - 3;1409,1414,1415;, - 3;1409,1415,1410;, - 3;1410,1415,1416;, - 3;1410,1416,1411;, - 3;1411,1416,1417;, - 3;1411,1417,1412;, - 3;1412,1417,1418;, - 3;1412,1418,1413;, - 3;573,578,1414;, - 3;578,1419,1414;, - 3;1414,1419,1420;, - 3;1414,1420,1415;, - 3;1415,1420,1421;, - 3;1415,1421,1416;, - 3;1416,1421,1422;, - 3;1416,1422,1417;, - 3;1417,1422,1423;, - 3;1417,1423,1418;, - 3;578,583,1419;, - 3;583,1424,1419;, - 3;1419,1424,1425;, - 3;1419,1425,1420;, - 3;1420,1425,1426;, - 3;1420,1426,1421;, - 3;1421,1426,1427;, - 3;1421,1427,1422;, - 3;1422,1427,1428;, - 3;1422,1428,1423;, - 3;583,588,1424;, - 3;588,1429,1424;, - 3;1424,1429,1430;, - 3;1424,1430,1425;, - 3;1425,1430,1431;, - 3;1425,1431,1426;, - 3;1426,1431,1432;, - 3;1426,1432,1427;, - 3;1427,1432,1433;, - 3;1427,1433,1428;, - 3;588,593,1429;, - 3;593,1434,1429;, - 3;1429,1434,1435;, - 3;1429,1435,1430;, - 3;1430,1435,1436;, - 3;1430,1436,1431;, - 3;1431,1436,1437;, - 3;1431,1437,1432;, - 3;1432,1437,1438;, - 3;1432,1438,1433;, - 3;593,598,1434;, - 3;598,1439,1434;, - 3;1434,1439,1440;, - 3;1434,1440,1435;, - 3;1435,1440,1441;, - 3;1435,1441,1436;, - 3;1436,1441,1442;, - 3;1436,1442,1437;, - 3;1437,1442,1443;, - 3;1437,1443,1438;, - 3;598,603,1439;, - 3;603,656,1439;, - 3;1439,656,663;, - 3;1439,663,1440;, - 3;1440,663,670;, - 3;1440,670,1441;, - 3;1441,670,677;, - 3;1441,677,1442;, - 3;1442,677,684;, - 3;1442,684,1443;, - 3;1443,684,691;, - 3;1443,691,1444;, - 3;1438,1443,1444;, - 3;1438,1444,1445;, - 3;1433,1438,1445;, - 3;1433,1445,1446;, - 3;1428,1433,1446;, - 3;1444,691,698;, - 3;1444,698,1447;, - 3;1445,1444,1447;, - 3;1445,1447,1448;, - 3;1446,1445,1448;, - 3;1446,1448,1449;, - 3;1450,1446,1449;, - 3;1428,1446,1450;, - 3;1423,1428,1450;, - 3;1423,1450,1451;, - 3;1418,1423,1451;, - 3;1447,698,705;, - 3;1447,705,1452;, - 3;1448,1447,1452;, - 3;1448,1452,1453;, - 3;1449,1448,1453;, - 3;1449,1453,1454;, - 3;1455,1449,1454;, - 3;1450,1449,1455;, - 3;1451,1450,1455;, - 3;1451,1455,1456;, - 3;1457,1451,1456;, - 3;1418,1451,1457;, - 3;1413,1418,1457;, - 3;1452,705,712;, - 3;1452,712,1458;, - 3;1453,1452,1458;, - 3;1453,1458,1459;, - 3;1454,1453,1459;, - 3;1454,1459,1460;, - 3;1461,1454,1460;, - 3;1455,1454,1461;, - 3;1456,1455,1461;, - 3;1456,1461,1462;, - 3;1463,1456,1462;, - 3;1457,1456,1463;, - 3;1458,712,719;, - 3;1458,719,1464;, - 3;1459,1458,1464;, - 3;1459,1464,1465;, - 3;1460,1459,1465;, - 3;1460,1465,1466;, - 3;1467,1460,1466;, - 3;1461,1460,1467;, - 3;1462,1461,1467;, - 3;1462,1467,1468;, - 3;1469,1462,1468;, - 3;1463,1462,1469;, - 3;1464,719,726;, - 3;1464,726,1470;, - 3;1465,1464,1470;, - 3;1465,1470,1471;, - 3;1466,1465,1471;, - 3;1466,1471,1472;, - 3;1473,1466,1472;, - 3;1467,1466,1473;, - 3;1468,1467,1473;, - 3;1468,1473,1474;, - 3;1475,1468,1474;, - 3;1469,1468,1475;, - 3;1470,726,733;, - 3;1470,733,1476;, - 3;1471,1470,1476;, - 3;1471,1476,1477;, - 3;1472,1471,1477;, - 3;1472,1477,1478;, - 3;1479,1472,1478;, - 3;1473,1472,1479;, - 3;1474,1473,1479;, - 3;1474,1479,1480;, - 3;1481,1474,1480;, - 3;1475,1474,1481;, - 3;1476,733,740;, - 3;1476,740,1482;, - 3;1477,1476,1482;, - 3;1477,1482,1483;, - 3;1478,1477,1483;, - 3;1478,1483,1484;, - 3;1485,1478,1484;, - 3;1479,1478,1485;, - 3;1480,1479,1485;, - 3;1480,1485,1486;, - 3;1487,1480,1486;, - 3;1481,1480,1487;, - 3;1482,740,747;, - 3;1482,747,1488;, - 3;1483,1482,1488;, - 3;1483,1488,1489;, - 3;1484,1483,1489;, - 3;1484,1489,1490;, - 3;1491,1484,1490;, - 3;1485,1484,1491;, - 3;1486,1485,1491;, - 3;1486,1491,1492;, - 3;1493,1486,1492;, - 3;1487,1486,1493;, - 3;1488,747,754;, - 3;1488,754,1494;, - 3;1489,1488,1494;, - 3;1489,1494,1495;, - 3;1490,1489,1495;, - 3;1490,1495,1496;, - 3;1497,1490,1496;, - 3;1491,1490,1497;, - 3;1492,1491,1497;, - 3;1492,1497,1498;, - 3;1499,1492,1498;, - 3;1493,1492,1499;, - 3;1494,754,761;, - 3;1494,761,1500;, - 3;1495,1494,1500;, - 3;1495,1500,1501;, - 3;1496,1495,1501;, - 3;1496,1501,1502;, - 3;1503,1496,1502;, - 3;1497,1496,1503;, - 3;1498,1497,1503;, - 3;1498,1503,1504;, - 3;1505,1498,1504;, - 3;1499,1498,1505;, - 3;1500,761,768;, - 3;1500,768,1506;, - 3;1501,1500,1506;, - 3;1501,1506,1507;, - 3;1502,1501,1507;, - 3;1502,1507,1508;, - 3;1509,1502,1508;, - 3;1503,1502,1509;, - 3;1504,1503,1509;, - 3;1504,1509,1510;, - 3;1511,1504,1510;, - 3;1505,1504,1511;, - 3;1506,768,775;, - 3;1506,775,1512;, - 3;1507,1506,1512;, - 3;1507,1512,1513;, - 3;1508,1507,1513;, - 3;1508,1513,1514;, - 3;1515,1508,1514;, - 3;1509,1508,1515;, - 3;1510,1509,1515;, - 3;1510,1515,1516;, - 3;1517,1510,1516;, - 3;1511,1510,1517;, - 3;1512,775,782;, - 3;1512,782,1518;, - 3;1513,1512,1518;, - 3;1513,1518,1519;, - 3;1514,1513,1519;, - 3;1514,1519,1520;, - 3;1521,1514,1520;, - 3;1515,1514,1521;, - 3;1516,1515,1521;, - 3;1516,1521,1522;, - 3;1523,1516,1522;, - 3;1517,1516,1523;, - 3;1518,782,789;, - 3;1518,789,1524;, - 3;1519,1518,1524;, - 3;1519,1524,1525;, - 3;1520,1519,1525;, - 3;1520,1525,1526;, - 3;1527,1520,1526;, - 3;1521,1520,1527;, - 3;1522,1521,1527;, - 3;1522,1527,1528;, - 3;1529,1522,1528;, - 3;1523,1522,1529;, - 3;1524,789,796;, - 3;1524,796,1530;, - 3;1525,1524,1530;, - 3;1525,1530,1531;, - 3;1526,1525,1531;, - 3;1526,1531,1532;, - 3;1533,1526,1532;, - 3;1527,1526,1533;, - 3;1528,1527,1533;, - 3;1528,1533,1534;, - 3;1535,1528,1534;, - 3;1529,1528,1535;, - 3;1530,796,803;, - 3;1530,803,1536;, - 3;1531,1530,1536;, - 3;1531,1536,1537;, - 3;1532,1531,1537;, - 3;1532,1537,1538;, - 3;1539,1532,1538;, - 3;1533,1532,1539;, - 3;1534,1533,1539;, - 3;1534,1539,1540;, - 3;1541,1534,1540;, - 3;1535,1534,1541;, - 3;1536,803,810;, - 3;1536,810,1542;, - 3;1537,1536,1542;, - 3;1537,1542,1543;, - 3;1538,1537,1543;, - 3;1538,1543,1544;, - 3;1545,1538,1544;, - 3;1539,1538,1545;, - 3;1540,1539,1545;, - 3;1540,1545,1546;, - 3;1547,1540,1546;, - 3;1541,1540,1547;, - 3;1542,810,817;, - 3;1542,817,1548;, - 3;1543,1542,1548;, - 3;1543,1548,1549;, - 3;1544,1543,1549;, - 3;1544,1549,1550;, - 3;1551,1544,1550;, - 3;1545,1544,1551;, - 3;1546,1545,1551;, - 3;1546,1551,1552;, - 3;1553,1546,1552;, - 3;1547,1546,1553;, - 3;1548,817,824;, - 3;1548,824,1554;, - 3;1549,1548,1554;, - 3;1549,1554,1555;, - 3;1550,1549,1555;, - 3;1550,1555,1556;, - 3;1557,1550,1556;, - 3;1551,1550,1557;, - 3;1552,1551,1557;, - 3;1552,1557,1558;, - 3;1559,1552,1558;, - 3;1553,1552,1559;, - 3;1554,824,831;, - 3;1554,831,1560;, - 3;1555,1554,1560;, - 3;1555,1560,1561;, - 3;1556,1555,1561;, - 3;1556,1561,1562;, - 3;1563,1556,1562;, - 3;1557,1556,1563;, - 3;1558,1557,1563;, - 3;1558,1563,1564;, - 3;1565,1558,1564;, - 3;1559,1558,1565;, - 3;1560,831,838;, - 3;1560,838,1566;, - 3;1561,1560,1566;, - 3;1561,1566,1567;, - 3;1562,1561,1567;, - 3;1562,1567,1568;, - 3;1569,1562,1568;, - 3;1563,1562,1569;, - 3;1564,1563,1569;, - 3;1564,1569,1570;, - 3;1571,1564,1570;, - 3;1565,1564,1571;, - 3;1566,838,845;, - 3;1566,845,1572;, - 3;1567,1566,1572;, - 3;1567,1572,1573;, - 3;1568,1567,1573;, - 3;1568,1573,1574;, - 3;1575,1568,1574;, - 3;1569,1568,1575;, - 3;1570,1569,1575;, - 3;1570,1575,1576;, - 3;1577,1570,1576;, - 3;1571,1570,1577;, - 3;1572,845,852;, - 3;1572,852,1578;, - 3;1573,1572,1578;, - 3;1573,1578,1579;, - 3;1574,1573,1579;, - 3;1574,1579,1580;, - 3;1581,1574,1580;, - 3;1575,1574,1581;, - 3;1576,1575,1581;, - 3;1576,1581,1582;, - 3;1583,1576,1582;, - 3;1577,1576,1583;, - 3;1578,852,859;, - 3;1578,859,1584;, - 3;1579,1578,1584;, - 3;1579,1584,1585;, - 3;1580,1579,1585;, - 3;1580,1585,1586;, - 3;1587,1580,1586;, - 3;1581,1580,1587;, - 3;1582,1581,1587;, - 3;1582,1587,1588;, - 3;1589,1582,1588;, - 3;1583,1582,1589;, - 3;1584,859,866;, - 3;1584,866,1590;, - 3;1585,1584,1590;, - 3;1585,1590,1591;, - 3;1586,1585,1591;, - 3;1586,1591,1592;, - 3;1593,1586,1592;, - 3;1587,1586,1593;, - 3;1588,1587,1593;, - 3;1588,1593,1594;, - 3;1595,1588,1594;, - 3;1589,1588,1595;, - 3;1590,866,873;, - 3;1590,873,1596;, - 3;1591,1590,1596;, - 3;1591,1596,1597;, - 3;1592,1591,1597;, - 3;1592,1597,1598;, - 3;1599,1592,1598;, - 3;1593,1592,1599;, - 3;1594,1593,1599;, - 3;1594,1599,1600;, - 3;1601,1594,1600;, - 3;1595,1594,1601;, - 3;1596,873,880;, - 3;1596,880,1602;, - 3;1597,1596,1602;, - 3;1597,1602,1603;, - 3;1598,1597,1603;, - 3;1598,1603,1604;, - 3;1605,1598,1604;, - 3;1599,1598,1605;, - 3;1600,1599,1605;, - 3;1600,1605,1606;, - 3;1607,1600,1606;, - 3;1601,1600,1607;, - 3;1602,880,887;, - 3;1602,887,1608;, - 3;1603,1602,1608;, - 3;1603,1608,1609;, - 3;1604,1603,1609;, - 3;1604,1609,1610;, - 3;1611,1604,1610;, - 3;1605,1604,1611;, - 3;1606,1605,1611;, - 3;1606,1611,1612;, - 3;1613,1606,1612;, - 3;1607,1606,1613;, - 3;1608,887,894;, - 3;1608,894,1614;, - 3;1609,1608,1614;, - 3;1609,1614,1615;, - 3;1610,1609,1615;, - 3;1610,1615,1616;, - 3;1617,1610,1616;, - 3;1611,1610,1617;, - 3;1612,1611,1617;, - 3;1612,1617,1618;, - 3;1619,1612,1618;, - 3;1613,1612,1619;, - 3;1614,894,901;, - 3;1614,901,1620;, - 3;1615,1614,1620;, - 3;1615,1620,1621;, - 3;1616,1615,1621;, - 3;1616,1621,1622;, - 3;1623,1616,1622;, - 3;1617,1616,1623;, - 3;1618,1617,1623;, - 3;1618,1623,1624;, - 3;1625,1618,1624;, - 3;1619,1618,1625;, - 3;1620,901,908;, - 3;1620,908,1626;, - 3;1621,1620,1626;, - 3;1621,1626,1627;, - 3;1622,1621,1627;, - 3;1622,1627,1628;, - 3;1629,1622,1628;, - 3;1623,1622,1629;, - 3;1624,1623,1629;, - 3;1624,1629,1630;, - 3;1631,1624,1630;, - 3;1625,1624,1631;, - 3;1626,908,915;, - 3;1626,915,940;, - 3;1627,1626,940;, - 3;1627,940,939;, - 3;1628,1627,939;, - 3;1628,939,945;, - 3;1632,1628,945;, - 3;1629,1628,1632;, - 3;1630,1629,1632;, - 3;1630,1632,1633;, - 3;1634,1630,1633;, - 3;1631,1630,1634;, - 3;1635,1631,1634;, - 3;1636,1631,1635;, - 3;1636,1625,1631;, - 3;1632,945,950;, - 3;1633,1632,950;, - 3;1633,950,955;, - 3;1637,1633,955;, - 3;1634,1633,1637;, - 3;1638,1634,1637;, - 3;1635,1634,1638;, - 3;1639,1635,1638;, - 3;1640,1635,1639;, - 3;1640,1636,1635;, - 3;1641,1636,1640;, - 3;1641,1642,1636;, - 3;1642,1625,1636;, - 3;1642,1619,1625;, - 3;1637,955,960;, - 3;1643,1637,960;, - 3;1638,1637,1643;, - 3;1644,1638,1643;, - 3;1639,1638,1644;, - 3;1645,1639,1644;, - 3;1646,1639,1645;, - 3;1646,1640,1639;, - 3;1647,1640,1646;, - 3;1647,1641,1640;, - 3;1643,960,965;, - 3;1648,1643,965;, - 3;1644,1643,1648;, - 3;1649,1644,1648;, - 3;1645,1644,1649;, - 3;1650,1645,1649;, - 3;1651,1645,1650;, - 3;1651,1646,1645;, - 3;1652,1646,1651;, - 3;1652,1647,1646;, - 3;1648,965,970;, - 3;1653,1648,970;, - 3;1649,1648,1653;, - 3;1654,1649,1653;, - 3;1650,1649,1654;, - 3;1655,1650,1654;, - 3;1656,1650,1655;, - 3;1656,1651,1650;, - 3;1657,1651,1656;, - 3;1657,1652,1651;, - 3;1653,970,975;, - 3;1658,1653,975;, - 3;1654,1653,1658;, - 3;1659,1654,1658;, - 3;1655,1654,1659;, - 3;1660,1655,1659;, - 3;1661,1655,1660;, - 3;1661,1656,1655;, - 3;1662,1656,1661;, - 3;1662,1657,1656;, - 3;1658,975,980;, - 3;1663,1658,980;, - 3;1659,1658,1663;, - 3;1664,1659,1663;, - 3;1660,1659,1664;, - 3;1665,1660,1664;, - 3;1666,1660,1665;, - 3;1666,1661,1660;, - 3;1667,1661,1666;, - 3;1667,1662,1661;, - 3;1663,980,985;, - 3;997,1663,985;, - 3;1664,1663,997;, - 3;1002,1664,997;, - 3;1665,1664,1002;, - 3;1007,1665,1002;, - 3;1668,1665,1007;, - 3;1668,1666,1665;, - 3;1669,1666,1668;, - 3;1669,1667,1666;, - 3;1670,1667,1669;, - 3;1670,1671,1667;, - 3;1671,1662,1667;, - 3;1671,1672,1662;, - 3;1672,1657,1662;, - 3;1013,1668,1007;, - 3;1673,1668,1013;, - 3;1673,1669,1668;, - 3;1674,1669,1673;, - 3;1674,1670,1669;, - 3;1675,1670,1674;, - 3;1675,1676,1670;, - 3;1676,1671,1670;, - 3;1676,1677,1671;, - 3;1677,1672,1671;, - 3;1019,1673,1013;, - 3;1678,1673,1019;, - 3;1678,1674,1673;, - 3;1679,1674,1678;, - 3;1679,1675,1674;, - 3;1680,1675,1679;, - 3;1680,1681,1675;, - 3;1681,1676,1675;, - 3;1681,1682,1676;, - 3;1682,1677,1676;, - 3;1025,1678,1019;, - 3;1683,1678,1025;, - 3;1683,1679,1678;, - 3;1684,1679,1683;, - 3;1684,1680,1679;, - 3;1685,1680,1684;, - 3;1685,1686,1680;, - 3;1686,1681,1680;, - 3;1686,1687,1681;, - 3;1687,1682,1681;, - 3;1031,1683,1025;, - 3;1688,1683,1031;, - 3;1688,1684,1683;, - 3;1689,1684,1688;, - 3;1689,1685,1684;, - 3;1690,1685,1689;, - 3;1690,1691,1685;, - 3;1691,1686,1685;, - 3;1691,1692,1686;, - 3;1692,1687,1686;, - 3;1688,1031,1037;, - 3;1688,1037,1693;, - 3;1689,1688,1693;, - 3;1689,1693,1694;, - 3;1690,1689,1694;, - 3;1690,1694,1695;, - 3;1696,1690,1695;, - 3;1696,1691,1690;, - 3;1696,1697,1691;, - 3;1697,1692,1691;, - 3;1693,1037,1043;, - 3;1693,1043,1698;, - 3;1694,1693,1698;, - 3;1694,1698,1699;, - 3;1695,1694,1699;, - 3;1695,1699,1700;, - 3;1701,1695,1700;, - 3;1696,1695,1701;, - 3;1702,1696,1701;, - 3;1702,1697,1696;, - 3;1698,1043,1049;, - 3;1698,1049,1703;, - 3;1699,1698,1703;, - 3;1699,1703,1704;, - 3;1700,1699,1704;, - 3;1700,1704,1705;, - 3;1706,1700,1705;, - 3;1701,1700,1706;, - 3;1707,1701,1706;, - 3;1702,1701,1707;, - 3;1703,1049,1055;, - 3;1703,1055,1708;, - 3;1704,1703,1708;, - 3;1704,1708,1709;, - 3;1705,1704,1709;, - 3;1705,1709,1710;, - 3;1711,1705,1710;, - 3;1706,1705,1711;, - 3;1712,1706,1711;, - 3;1707,1706,1712;, - 3;1708,1055,1061;, - 3;1708,1061,1713;, - 3;1709,1708,1713;, - 3;1709,1713,1714;, - 3;1710,1709,1714;, - 3;1710,1714,1715;, - 3;1716,1710,1715;, - 3;1711,1710,1716;, - 3;1717,1711,1716;, - 3;1712,1711,1717;, - 3;1713,1061,1067;, - 3;1713,1067,1718;, - 3;1714,1713,1718;, - 3;1714,1718,1719;, - 3;1715,1714,1719;, - 3;1715,1719,1720;, - 3;1721,1715,1720;, - 3;1716,1715,1721;, - 3;1722,1716,1721;, - 3;1717,1716,1722;, - 3;1718,1067,1073;, - 3;1718,1073,1723;, - 3;1719,1718,1723;, - 3;1719,1723,1724;, - 3;1720,1719,1724;, - 3;1720,1724,1725;, - 3;1726,1720,1725;, - 3;1721,1720,1726;, - 3;1727,1721,1726;, - 3;1722,1721,1727;, - 3;1723,1073,1079;, - 3;1723,1079,1728;, - 3;1724,1723,1728;, - 3;1724,1728,1729;, - 3;1725,1724,1729;, - 3;1725,1729,1730;, - 3;1731,1725,1730;, - 3;1726,1725,1731;, - 3;1732,1726,1731;, - 3;1727,1726,1732;, - 3;1728,1079,1085;, - 3;1728,1085,1733;, - 3;1729,1728,1733;, - 3;1729,1733,1734;, - 3;1730,1729,1734;, - 3;1730,1734,1735;, - 3;1736,1730,1735;, - 3;1731,1730,1736;, - 3;1737,1731,1736;, - 3;1732,1731,1737;, - 3;1733,1085,1091;, - 3;1733,1091,1738;, - 3;1734,1733,1738;, - 3;1734,1738,1739;, - 3;1735,1734,1739;, - 3;1735,1739,1740;, - 3;1741,1735,1740;, - 3;1736,1735,1741;, - 3;1742,1736,1741;, - 3;1737,1736,1742;, - 3;1738,1091,1097;, - 3;1738,1097,1743;, - 3;1739,1738,1743;, - 3;1739,1743,1744;, - 3;1740,1739,1744;, - 3;1740,1744,1745;, - 3;1746,1740,1745;, - 3;1741,1740,1746;, - 3;1747,1741,1746;, - 3;1742,1741,1747;, - 3;1743,1097,1103;, - 3;1743,1103,1748;, - 3;1744,1743,1748;, - 3;1744,1748,1749;, - 3;1745,1744,1749;, - 3;1745,1749,1750;, - 3;1751,1745,1750;, - 3;1746,1745,1751;, - 3;1752,1746,1751;, - 3;1747,1746,1752;, - 3;1748,1103,1109;, - 3;1748,1109,1753;, - 3;1749,1748,1753;, - 3;1749,1753,1754;, - 3;1750,1749,1754;, - 3;1750,1754,1755;, - 3;1756,1750,1755;, - 3;1751,1750,1756;, - 3;1757,1751,1756;, - 3;1752,1751,1757;, - 3;1753,1109,1115;, - 3;1753,1115,1132;, - 3;1754,1753,1132;, - 3;1754,1132,1137;, - 3;1755,1754,1137;, - 3;1755,1137,1142;, - 3;1758,1755,1142;, - 3;1756,1755,1758;, - 3;1759,1756,1758;, - 3;1757,1756,1759;, - 3;1760,1757,1759;, - 3;1761,1757,1760;, - 3;1761,1752,1757;, - 3;1762,1752,1761;, - 3;1762,1747,1752;, - 3;1758,1142,1147;, - 3;1763,1758,1147;, - 3;1759,1758,1763;, - 3;1764,1759,1763;, - 3;1760,1759,1764;, - 3;1765,1760,1764;, - 3;1766,1760,1765;, - 3;1766,1761,1760;, - 3;1767,1761,1766;, - 3;1767,1762,1761;, - 3;1763,1147,1152;, - 3;1768,1763,1152;, - 3;1764,1763,1768;, - 3;1769,1764,1768;, - 3;1765,1764,1769;, - 3;1770,1765,1769;, - 3;1771,1765,1770;, - 3;1771,1766,1765;, - 3;1772,1766,1771;, - 3;1772,1767,1766;, - 3;1768,1152,1157;, - 3;1773,1768,1157;, - 3;1769,1768,1773;, - 3;1774,1769,1773;, - 3;1770,1769,1774;, - 3;1775,1770,1774;, - 3;1776,1770,1775;, - 3;1776,1771,1770;, - 3;1777,1771,1776;, - 3;1777,1772,1771;, - 3;1773,1157,1162;, - 3;1778,1773,1162;, - 3;1774,1773,1778;, - 3;1779,1774,1778;, - 3;1775,1774,1779;, - 3;1780,1775,1779;, - 3;1781,1775,1780;, - 3;1781,1776,1775;, - 3;1782,1776,1781;, - 3;1782,1777,1776;, - 3;1778,1162,1167;, - 3;1783,1778,1167;, - 3;1779,1778,1783;, - 3;1784,1779,1783;, - 3;1780,1779,1784;, - 3;1785,1780,1784;, - 3;1786,1780,1785;, - 3;1786,1781,1780;, - 3;1787,1781,1786;, - 3;1787,1782,1781;, - 3;1783,1167,1172;, - 3;1788,1783,1172;, - 3;1784,1783,1788;, - 3;1789,1784,1788;, - 3;1785,1784,1789;, - 3;1790,1785,1789;, - 3;1791,1785,1790;, - 3;1791,1786,1785;, - 3;1792,1786,1791;, - 3;1792,1787,1786;, - 3;1788,1172,1177;, - 3;1793,1788,1177;, - 3;1789,1788,1793;, - 3;1794,1789,1793;, - 3;1790,1789,1794;, - 3;1795,1790,1794;, - 3;1796,1790,1795;, - 3;1796,1791,1790;, - 3;1797,1791,1796;, - 3;1797,1792,1791;, - 3;1793,1177,1182;, - 3;1798,1793,1182;, - 3;1794,1793,1798;, - 3;1799,1794,1798;, - 3;1795,1794,1799;, - 3;1800,1795,1799;, - 3;1801,1795,1800;, - 3;1801,1796,1795;, - 3;1802,1796,1801;, - 3;1802,1797,1796;, - 3;1798,1182,1187;, - 3;1803,1798,1187;, - 3;1799,1798,1803;, - 3;1804,1799,1803;, - 3;1800,1799,1804;, - 3;1805,1800,1804;, - 3;1806,1800,1805;, - 3;1806,1801,1800;, - 3;1807,1801,1806;, - 3;1807,1802,1801;, - 3;1803,1187,1192;, - 3;1808,1803,1192;, - 3;1804,1803,1808;, - 3;1809,1804,1808;, - 3;1805,1804,1809;, - 3;1810,1805,1809;, - 3;1811,1805,1810;, - 3;1811,1806,1805;, - 3;1812,1806,1811;, - 3;1812,1807,1806;, - 3;1808,1192,1197;, - 3;1813,1808,1197;, - 3;1809,1808,1813;, - 3;1814,1809,1813;, - 3;1810,1809,1814;, - 3;1815,1810,1814;, - 3;1816,1810,1815;, - 3;1816,1811,1810;, - 3;1817,1811,1816;, - 3;1817,1812,1811;, - 3;1813,1197,1202;, - 3;1818,1813,1202;, - 3;1814,1813,1818;, - 3;1819,1814,1818;, - 3;1815,1814,1819;, - 3;1820,1815,1819;, - 3;1821,1815,1820;, - 3;1821,1816,1815;, - 3;1822,1816,1821;, - 3;1822,1817,1816;, - 3;1818,1202,1207;, - 3;1823,1818,1207;, - 3;1819,1818,1823;, - 3;1824,1819,1823;, - 3;1820,1819,1824;, - 3;1825,1820,1824;, - 3;1826,1820,1825;, - 3;1826,1821,1820;, - 3;1827,1821,1826;, - 3;1827,1822,1821;, - 3;1823,1207,1212;, - 3;1828,1823,1212;, - 3;1824,1823,1828;, - 3;1829,1824,1828;, - 3;1825,1824,1829;, - 3;1830,1825,1829;, - 3;1831,1825,1830;, - 3;1831,1826,1825;, - 3;1832,1826,1831;, - 3;1832,1827,1826;, - 3;1828,1212,1217;, - 3;1833,1828,1217;, - 3;1829,1828,1833;, - 3;1834,1829,1833;, - 3;1830,1829,1834;, - 3;1835,1830,1834;, - 3;1836,1830,1835;, - 3;1836,1831,1830;, - 3;1837,1831,1836;, - 3;1837,1832,1831;, - 3;1833,1217,1222;, - 3;1838,1833,1222;, - 3;1834,1833,1838;, - 3;1839,1834,1838;, - 3;1835,1834,1839;, - 3;1840,1835,1839;, - 3;1841,1835,1840;, - 3;1841,1836,1835;, - 3;1842,1836,1841;, - 3;1842,1837,1836;, - 3;1838,1222,1227;, - 3;1843,1838,1227;, - 3;1839,1838,1843;, - 3;1844,1839,1843;, - 3;1840,1839,1844;, - 3;1845,1840,1844;, - 3;1846,1840,1845;, - 3;1846,1841,1840;, - 3;1847,1841,1846;, - 3;1847,1842,1841;, - 3;1843,1227,1232;, - 3;1848,1843,1232;, - 3;1844,1843,1848;, - 3;1849,1844,1848;, - 3;1845,1844,1849;, - 3;1850,1845,1849;, - 3;1851,1845,1850;, - 3;1851,1846,1845;, - 3;1852,1846,1851;, - 3;1852,1847,1846;, - 3;1848,1232,1237;, - 3;1853,1848,1237;, - 3;1849,1848,1853;, - 3;1854,1849,1853;, - 3;1850,1849,1854;, - 3;1306,1850,1854;, - 3;1312,1850,1306;, - 3;1312,1851,1850;, - 3;1318,1851,1312;, - 3;1318,1852,1851;, - 3;1853,1237,1242;, - 3;1855,1853,1242;, - 3;1854,1853,1855;, - 3;1300,1854,1855;, - 3;1306,1854,1300;, - 3;1855,1242,1247;, - 3;1294,1855,1247;, - 3;1300,1855,1294;, - 3;1324,1852,1318;, - 3;1324,1856,1852;, - 3;1856,1847,1852;, - 3;1856,1857,1847;, - 3;1857,1842,1847;, - 3;1857,1858,1842;, - 3;1858,1837,1842;, - 3;1330,1856,1324;, - 3;1330,1859,1856;, - 3;1859,1857,1856;, - 3;1859,1860,1857;, - 3;1860,1858,1857;, - 3;1860,1861,1858;, - 3;1861,1862,1858;, - 3;1858,1862,1837;, - 3;1862,1832,1837;, - 3;1862,1863,1832;, - 3;1863,1827,1832;, - 3;1335,1859,1330;, - 3;1335,1864,1859;, - 3;1864,1860,1859;, - 3;1864,1865,1860;, - 3;1865,1861,1860;, - 3;1865,1866,1861;, - 3;1866,1867,1861;, - 3;1861,1867,1862;, - 3;1867,1863,1862;, - 3;1867,1868,1863;, - 3;1868,1869,1863;, - 3;1863,1869,1827;, - 3;1869,1822,1827;, - 3;1340,1864,1335;, - 3;1340,1870,1864;, - 3;1870,1865,1864;, - 3;1870,1871,1865;, - 3;1871,1866,1865;, - 3;1871,1872,1866;, - 3;1872,1873,1866;, - 3;1866,1873,1867;, - 3;1873,1868,1867;, - 3;1873,1874,1868;, - 3;1874,1875,1868;, - 3;1868,1875,1869;, - 3;1345,1870,1340;, - 3;1345,1876,1870;, - 3;1876,1871,1870;, - 3;1876,1877,1871;, - 3;1877,1872,1871;, - 3;1877,1878,1872;, - 3;1878,1879,1872;, - 3;1872,1879,1873;, - 3;1879,1874,1873;, - 3;1879,1880,1874;, - 3;1880,1881,1874;, - 3;1874,1881,1875;, - 3;1351,1876,1345;, - 3;1351,1882,1876;, - 3;1882,1877,1876;, - 3;1882,1883,1877;, - 3;1883,1878,1877;, - 3;1883,1884,1878;, - 3;1884,1885,1878;, - 3;1878,1885,1879;, - 3;1885,1880,1879;, - 3;1885,1886,1880;, - 3;1886,1887,1880;, - 3;1880,1887,1881;, - 3;1888,1882,1351;, - 3;1888,1889,1882;, - 3;1889,1883,1882;, - 3;1889,1890,1883;, - 3;1890,1884,1883;, - 3;1890,1891,1884;, - 3;1891,1892,1884;, - 3;1884,1892,1885;, - 3;1892,1886,1885;, - 3;1350,1888,1351;, - 3;1362,1888,1350;, - 3;1362,1893,1888;, - 3;1893,1889,1888;, - 3;1893,1894,1889;, - 3;1894,1890,1889;, - 3;1894,1895,1890;, - 3;1895,1891,1890;, - 3;1895,1896,1891;, - 3;1896,1897,1891;, - 3;1891,1897,1892;, - 3;1897,1898,1892;, - 3;1892,1898,1886;, - 3;1899,1893,1362;, - 3;1899,1900,1893;, - 3;1900,1894,1893;, - 3;1900,1901,1894;, - 3;1901,1895,1894;, - 3;1901,1902,1895;, - 3;1902,1896,1895;, - 3;1902,1903,1896;, - 3;1903,1904,1896;, - 3;1896,1904,1897;, - 3;1361,1899,1362;, - 3;1361,1368,1899;, - 3;1899,1368,1905;, - 3;1899,1905,1900;, - 3;1900,1905,1906;, - 3;1900,1906,1901;, - 3;1901,1906,1907;, - 3;1901,1907,1902;, - 3;1902,1907,1908;, - 3;1902,1908,1903;, - 3;1903,1908,1909;, - 3;1903,1909,1910;, - 3;1903,1910,1904;, - 3;1368,1911,1905;, - 3;1905,1911,1912;, - 3;1905,1912,1906;, - 3;1906,1912,1913;, - 3;1906,1913,1907;, - 3;1907,1913,1914;, - 3;1907,1914,1908;, - 3;1908,1914,1915;, - 3;1908,1915,1909;, - 3;1368,1367,1911;, - 3;1367,1916,1911;, - 3;1911,1916,1917;, - 3;1911,1917,1912;, - 3;1912,1917,1918;, - 3;1912,1918,1913;, - 3;1913,1918,1919;, - 3;1913,1919,1914;, - 3;1914,1919,1920;, - 3;1914,1920,1915;, - 3;1367,1373,1916;, - 3;1373,1921,1916;, - 3;1916,1921,1922;, - 3;1916,1922,1917;, - 3;1917,1922,1923;, - 3;1917,1923,1918;, - 3;1918,1923,1924;, - 3;1918,1924,1919;, - 3;1919,1924,1925;, - 3;1919,1925,1920;, - 3;1373,1378,1921;, - 3;1378,1926,1921;, - 3;1921,1926,1927;, - 3;1921,1927,1922;, - 3;1922,1927,1928;, - 3;1922,1928,1923;, - 3;1923,1928,1929;, - 3;1923,1929,1924;, - 3;1924,1929,1930;, - 3;1924,1930,1925;, - 3;1378,1383,1926;, - 3;1383,1931,1926;, - 3;1926,1931,1932;, - 3;1926,1932,1927;, - 3;1927,1932,1933;, - 3;1927,1933,1928;, - 3;1928,1933,1934;, - 3;1928,1934,1929;, - 3;1929,1934,1935;, - 3;1929,1935,1930;, - 3;1383,1388,1931;, - 3;1388,1936,1931;, - 3;1931,1936,1937;, - 3;1931,1937,1932;, - 3;1932,1937,1938;, - 3;1932,1938,1933;, - 3;1933,1938,1939;, - 3;1933,1939,1934;, - 3;1934,1939,1940;, - 3;1934,1940,1935;, - 3;1388,1393,1936;, - 3;1393,1941,1936;, - 3;1936,1941,1942;, - 3;1936,1942,1937;, - 3;1937,1942,1943;, - 3;1937,1943,1938;, - 3;1938,1943,1944;, - 3;1938,1944,1939;, - 3;1939,1944,1945;, - 3;1939,1945,1940;, - 3;1393,1398,1941;, - 3;1398,1946,1941;, - 3;1941,1946,1947;, - 3;1941,1947,1942;, - 3;1942,1947,1948;, - 3;1942,1948,1943;, - 3;1943,1948,1949;, - 3;1943,1949,1944;, - 3;1944,1949,1950;, - 3;1944,1950,1945;, - 3;1398,1403,1946;, - 3;1403,1951,1946;, - 3;1946,1951,1952;, - 3;1946,1952,1947;, - 3;1947,1952,1953;, - 3;1947,1953,1948;, - 3;1948,1953,1954;, - 3;1948,1954,1949;, - 3;1949,1954,1955;, - 3;1949,1955,1950;, - 3;1403,1408,1951;, - 3;1408,1956,1951;, - 3;1951,1956,1957;, - 3;1951,1957,1952;, - 3;1952,1957,1958;, - 3;1952,1958,1953;, - 3;1953,1958,1959;, - 3;1953,1959,1954;, - 3;1954,1959,1960;, - 3;1954,1960,1955;, - 3;1408,1413,1956;, - 3;1413,1457,1956;, - 3;1956,1457,1463;, - 3;1956,1463,1957;, - 3;1957,1463,1469;, - 3;1957,1469,1958;, - 3;1958,1469,1475;, - 3;1958,1475,1959;, - 3;1959,1475,1481;, - 3;1959,1481,1960;, - 3;1960,1481,1487;, - 3;1960,1487,1961;, - 3;1955,1960,1961;, - 3;1955,1961,1962;, - 3;1950,1955,1962;, - 3;1950,1962,1963;, - 3;1945,1950,1963;, - 3;1961,1487,1493;, - 3;1961,1493,1964;, - 3;1962,1961,1964;, - 3;1962,1964,1965;, - 3;1963,1962,1965;, - 3;1963,1965,1966;, - 3;1967,1963,1966;, - 3;1945,1963,1967;, - 3;1940,1945,1967;, - 3;1940,1967,1968;, - 3;1935,1940,1968;, - 3;1964,1493,1499;, - 3;1964,1499,1969;, - 3;1965,1964,1969;, - 3;1965,1969,1970;, - 3;1966,1965,1970;, - 3;1966,1970,1971;, - 3;1972,1966,1971;, - 3;1967,1966,1972;, - 3;1968,1967,1972;, - 3;1968,1972,1973;, - 3;1974,1968,1973;, - 3;1935,1968,1974;, - 3;1930,1935,1974;, - 3;1969,1499,1505;, - 3;1969,1505,1975;, - 3;1970,1969,1975;, - 3;1970,1975,1976;, - 3;1971,1970,1976;, - 3;1971,1976,1977;, - 3;1978,1971,1977;, - 3;1972,1971,1978;, - 3;1973,1972,1978;, - 3;1973,1978,1979;, - 3;1980,1973,1979;, - 3;1974,1973,1980;, - 3;1975,1505,1511;, - 3;1975,1511,1981;, - 3;1976,1975,1981;, - 3;1976,1981,1982;, - 3;1977,1976,1982;, - 3;1977,1982,1983;, - 3;1984,1977,1983;, - 3;1978,1977,1984;, - 3;1979,1978,1984;, - 3;1979,1984,1985;, - 3;1986,1979,1985;, - 3;1980,1979,1986;, - 3;1981,1511,1517;, - 3;1981,1517,1987;, - 3;1982,1981,1987;, - 3;1982,1987,1988;, - 3;1983,1982,1988;, - 3;1983,1988,1989;, - 3;1990,1983,1989;, - 3;1984,1983,1990;, - 3;1985,1984,1990;, - 3;1985,1990,1991;, - 3;1992,1985,1991;, - 3;1986,1985,1992;, - 3;1987,1517,1523;, - 3;1987,1523,1993;, - 3;1988,1987,1993;, - 3;1988,1993,1994;, - 3;1989,1988,1994;, - 3;1989,1994,1995;, - 3;1996,1989,1995;, - 3;1990,1989,1996;, - 3;1991,1990,1996;, - 3;1991,1996,1997;, - 3;1998,1991,1997;, - 3;1992,1991,1998;, - 3;1993,1523,1529;, - 3;1993,1529,1999;, - 3;1994,1993,1999;, - 3;1994,1999,2000;, - 3;1995,1994,2000;, - 3;1995,2000,2001;, - 3;2002,1995,2001;, - 3;1996,1995,2002;, - 3;1997,1996,2002;, - 3;1997,2002,2003;, - 3;2004,1997,2003;, - 3;1998,1997,2004;, - 3;1999,1529,1535;, - 3;1999,1535,2005;, - 3;2000,1999,2005;, - 3;2000,2005,2006;, - 3;2001,2000,2006;, - 3;2001,2006,2007;, - 3;2008,2001,2007;, - 3;2002,2001,2008;, - 3;2003,2002,2008;, - 3;2003,2008,2009;, - 3;2010,2003,2009;, - 3;2004,2003,2010;, - 3;2005,1535,1541;, - 3;2005,1541,2011;, - 3;2006,2005,2011;, - 3;2006,2011,2012;, - 3;2007,2006,2012;, - 3;2007,2012,2013;, - 3;2014,2007,2013;, - 3;2008,2007,2014;, - 3;2009,2008,2014;, - 3;2009,2014,2015;, - 3;2016,2009,2015;, - 3;2010,2009,2016;, - 3;2011,1541,1547;, - 3;2011,1547,2017;, - 3;2012,2011,2017;, - 3;2012,2017,2018;, - 3;2013,2012,2018;, - 3;2013,2018,2019;, - 3;2020,2013,2019;, - 3;2014,2013,2020;, - 3;2015,2014,2020;, - 3;2015,2020,2021;, - 3;2022,2015,2021;, - 3;2016,2015,2022;, - 3;2017,1547,1553;, - 3;2017,1553,2023;, - 3;2018,2017,2023;, - 3;2018,2023,2024;, - 3;2019,2018,2024;, - 3;2019,2024,2025;, - 3;2026,2019,2025;, - 3;2020,2019,2026;, - 3;2021,2020,2026;, - 3;2021,2026,2027;, - 3;2028,2021,2027;, - 3;2022,2021,2028;, - 3;2023,1553,1559;, - 3;2023,1559,2029;, - 3;2024,2023,2029;, - 3;2024,2029,2030;, - 3;2025,2024,2030;, - 3;2025,2030,2031;, - 3;2032,2025,2031;, - 3;2026,2025,2032;, - 3;2027,2026,2032;, - 3;2027,2032,2033;, - 3;2034,2027,2033;, - 3;2028,2027,2034;, - 3;2029,1559,1565;, - 3;2029,1565,2035;, - 3;2030,2029,2035;, - 3;2030,2035,2036;, - 3;2031,2030,2036;, - 3;2031,2036,2037;, - 3;2038,2031,2037;, - 3;2032,2031,2038;, - 3;2033,2032,2038;, - 3;2033,2038,2039;, - 3;2040,2033,2039;, - 3;2034,2033,2040;, - 3;2035,1565,1571;, - 3;2035,1571,2041;, - 3;2036,2035,2041;, - 3;2036,2041,2042;, - 3;2037,2036,2042;, - 3;2037,2042,2043;, - 3;2044,2037,2043;, - 3;2038,2037,2044;, - 3;2039,2038,2044;, - 3;2039,2044,2045;, - 3;2046,2039,2045;, - 3;2040,2039,2046;, - 3;2041,1571,1577;, - 3;2041,1577,2047;, - 3;2042,2041,2047;, - 3;2042,2047,2048;, - 3;2043,2042,2048;, - 3;2043,2048,2049;, - 3;2050,2043,2049;, - 3;2044,2043,2050;, - 3;2045,2044,2050;, - 3;2045,2050,2051;, - 3;2052,2045,2051;, - 3;2046,2045,2052;, - 3;2047,1577,1583;, - 3;2047,1583,2053;, - 3;2048,2047,2053;, - 3;2048,2053,2054;, - 3;2049,2048,2054;, - 3;2049,2054,2055;, - 3;2056,2049,2055;, - 3;2050,2049,2056;, - 3;2051,2050,2056;, - 3;2051,2056,2057;, - 3;2058,2051,2057;, - 3;2052,2051,2058;, - 3;2053,1583,1589;, - 3;2053,1589,2059;, - 3;2054,2053,2059;, - 3;2054,2059,2060;, - 3;2055,2054,2060;, - 3;2055,2060,2061;, - 3;2062,2055,2061;, - 3;2056,2055,2062;, - 3;2057,2056,2062;, - 3;2057,2062,2063;, - 3;2064,2057,2063;, - 3;2058,2057,2064;, - 3;2059,1589,1595;, - 3;2059,1595,2065;, - 3;2060,2059,2065;, - 3;2060,2065,2066;, - 3;2061,2060,2066;, - 3;2061,2066,2067;, - 3;2068,2061,2067;, - 3;2062,2061,2068;, - 3;2063,2062,2068;, - 3;2063,2068,2069;, - 3;2070,2063,2069;, - 3;2064,2063,2070;, - 3;2065,1595,1601;, - 3;2065,1601,2071;, - 3;2066,2065,2071;, - 3;2066,2071,2072;, - 3;2067,2066,2072;, - 3;2067,2072,2073;, - 3;2074,2067,2073;, - 3;2068,2067,2074;, - 3;2069,2068,2074;, - 3;2069,2074,2075;, - 3;2076,2069,2075;, - 3;2070,2069,2076;, - 3;2071,1601,1607;, - 3;2071,1607,2077;, - 3;2072,2071,2077;, - 3;2072,2077,2078;, - 3;2073,2072,2078;, - 3;2073,2078,2079;, - 3;2080,2073,2079;, - 3;2074,2073,2080;, - 3;2075,2074,2080;, - 3;2075,2080,2081;, - 3;2082,2075,2081;, - 3;2076,2075,2082;, - 3;2077,1607,1613;, - 3;2077,1613,2083;, - 3;2078,2077,2083;, - 3;2078,2083,2084;, - 3;2079,2078,2084;, - 3;2079,2084,2085;, - 3;2086,2079,2085;, - 3;2080,2079,2086;, - 3;2081,2080,2086;, - 3;2081,2086,2087;, - 3;2088,2081,2087;, - 3;2082,2081,2088;, - 3;2083,1613,1619;, - 3;2083,1619,1642;, - 3;2084,2083,1642;, - 3;2084,1642,1641;, - 3;2085,2084,1641;, - 3;2085,1641,1647;, - 3;2089,2085,1647;, - 3;2086,2085,2089;, - 3;2087,2086,2089;, - 3;2087,2089,2090;, - 3;2091,2087,2090;, - 3;2088,2087,2091;, - 3;2092,2088,2091;, - 3;2093,2088,2092;, - 3;2093,2082,2088;, - 3;2089,1647,1652;, - 3;2090,2089,1652;, - 3;2090,1652,1657;, - 3;1672,2090,1657;, - 3;2091,2090,1672;, - 3;1677,2091,1672;, - 3;2092,2091,1677;, - 3;1682,2092,1677;, - 3;2094,2092,1682;, - 3;2094,2093,2092;, - 3;2095,2093,2094;, - 3;2095,2096,2093;, - 3;2096,2082,2093;, - 3;2096,2076,2082;, - 3;2097,2076,2096;, - 3;2097,2070,2076;, - 3;1687,2094,1682;, - 3;2098,2094,1687;, - 3;2098,2095,2094;, - 3;2099,2095,2098;, - 3;2099,2100,2095;, - 3;2100,2096,2095;, - 3;2100,2097,2096;, - 3;2101,2097,2100;, - 3;2101,2102,2097;, - 3;2102,2070,2097;, - 3;2102,2064,2070;, - 3;1692,2098,1687;, - 3;2103,2098,1692;, - 3;2103,2099,2098;, - 3;2104,2099,2103;, - 3;2104,2105,2099;, - 3;2105,2100,2099;, - 3;2105,2101,2100;, - 3;2106,2101,2105;, - 3;2106,2107,2101;, - 3;2107,2102,2101;, - 3;2107,2108,2102;, - 3;2108,2064,2102;, - 3;2108,2058,2064;, - 3;1697,2103,1692;, - 3;2109,2103,1697;, - 3;2109,2104,2103;, - 3;2110,2104,2109;, - 3;2110,2111,2104;, - 3;2111,2105,2104;, - 3;2111,2106,2105;, - 3;2112,2106,2111;, - 3;2112,2113,2106;, - 3;2113,2107,2106;, - 3;2113,2114,2107;, - 3;2114,2108,2107;, - 3;1702,2109,1697;, - 3;2115,2109,1702;, - 3;2115,2110,2109;, - 3;2116,2110,2115;, - 3;2116,2117,2110;, - 3;2117,2111,2110;, - 3;2117,2112,2111;, - 3;2118,2112,2117;, - 3;2118,2119,2112;, - 3;2119,2113,2112;, - 3;2119,2120,2113;, - 3;2120,2114,2113;, - 3;2115,1702,1707;, - 3;2115,1707,2121;, - 3;2116,2115,2121;, - 3;2116,2121,2122;, - 3;2123,2116,2122;, - 3;2123,2117,2116;, - 3;2123,2118,2117;, - 3;2124,2118,2123;, - 3;2124,2125,2118;, - 3;2125,2119,2118;, - 3;2125,2126,2119;, - 3;2126,2120,2119;, - 3;2121,1707,1712;, - 3;2121,1712,2127;, - 3;2122,2121,2127;, - 3;2122,2127,2128;, - 3;2129,2122,2128;, - 3;2123,2122,2129;, - 3;2124,2123,2129;, - 3;2124,2129,2130;, - 3;2131,2124,2130;, - 3;2131,2125,2124;, - 3;2131,2132,2125;, - 3;2132,2126,2125;, - 3;2127,1712,1717;, - 3;2127,1717,2133;, - 3;2128,2127,2133;, - 3;2128,2133,2134;, - 3;2135,2128,2134;, - 3;2129,2128,2135;, - 3;2130,2129,2135;, - 3;2130,2135,2136;, - 3;2137,2130,2136;, - 3;2131,2130,2137;, - 3;2138,2131,2137;, - 3;2138,2132,2131;, - 3;2133,1717,1722;, - 3;2133,1722,2139;, - 3;2134,2133,2139;, - 3;2134,2139,2140;, - 3;2141,2134,2140;, - 3;2135,2134,2141;, - 3;2136,2135,2141;, - 3;2136,2141,2142;, - 3;2143,2136,2142;, - 3;2137,2136,2143;, - 3;2144,2137,2143;, - 3;2138,2137,2144;, - 3;2139,1722,1727;, - 3;2139,1727,2145;, - 3;2140,2139,2145;, - 3;2140,2145,2146;, - 3;2147,2140,2146;, - 3;2141,2140,2147;, - 3;2142,2141,2147;, - 3;2142,2147,2148;, - 3;2149,2142,2148;, - 3;2143,2142,2149;, - 3;2150,2143,2149;, - 3;2144,2143,2150;, - 3;2145,1727,1732;, - 3;2145,1732,2151;, - 3;2146,2145,2151;, - 3;2146,2151,2152;, - 3;2153,2146,2152;, - 3;2147,2146,2153;, - 3;2148,2147,2153;, - 3;2148,2153,2154;, - 3;2155,2148,2154;, - 3;2149,2148,2155;, - 3;2156,2149,2155;, - 3;2150,2149,2156;, - 3;2151,1732,1737;, - 3;2151,1737,2157;, - 3;2152,2151,2157;, - 3;2152,2157,2158;, - 3;2159,2152,2158;, - 3;2153,2152,2159;, - 3;2154,2153,2159;, - 3;2154,2159,2160;, - 3;2161,2154,2160;, - 3;2155,2154,2161;, - 3;2162,2155,2161;, - 3;2156,2155,2162;, - 3;2157,1737,1742;, - 3;2157,1742,2163;, - 3;2158,2157,2163;, - 3;2158,2163,2164;, - 3;2165,2158,2164;, - 3;2159,2158,2165;, - 3;2160,2159,2165;, - 3;2160,2165,2166;, - 3;2167,2160,2166;, - 3;2161,2160,2167;, - 3;2168,2161,2167;, - 3;2162,2161,2168;, - 3;2163,1742,1747;, - 3;2163,1747,1762;, - 3;2164,2163,1762;, - 3;2164,1762,1767;, - 3;2169,2164,1767;, - 3;2165,2164,2169;, - 3;2166,2165,2169;, - 3;2166,2169,2170;, - 3;2171,2166,2170;, - 3;2167,2166,2171;, - 3;2172,2167,2171;, - 3;2168,2167,2172;, - 3;2173,2168,2172;, - 3;2174,2168,2173;, - 3;2174,2162,2168;, - 3;2169,1767,1772;, - 3;2170,2169,1772;, - 3;2170,1772,1777;, - 3;2175,2170,1777;, - 3;2171,2170,2175;, - 3;2176,2171,2175;, - 3;2172,2171,2176;, - 3;2177,2172,2176;, - 3;2173,2172,2177;, - 3;2178,2173,2177;, - 3;2179,2173,2178;, - 3;2179,2174,2173;, - 3;2175,1777,1782;, - 3;2180,2175,1782;, - 3;2176,2175,2180;, - 3;2181,2176,2180;, - 3;2177,2176,2181;, - 3;2182,2177,2181;, - 3;2178,2177,2182;, - 3;2183,2178,2182;, - 3;2184,2178,2183;, - 3;2184,2179,2178;, - 3;2180,1782,1787;, - 3;2185,2180,1787;, - 3;2181,2180,2185;, - 3;2186,2181,2185;, - 3;2182,2181,2186;, - 3;2187,2182,2186;, - 3;2183,2182,2187;, - 3;2188,2183,2187;, - 3;2189,2183,2188;, - 3;2189,2184,2183;, - 3;2185,1787,1792;, - 3;2190,2185,1792;, - 3;2186,2185,2190;, - 3;2191,2186,2190;, - 3;2187,2186,2191;, - 3;2192,2187,2191;, - 3;2188,2187,2192;, - 3;2193,2188,2192;, - 3;2194,2188,2193;, - 3;2194,2189,2188;, - 3;2190,1792,1797;, - 3;2195,2190,1797;, - 3;2191,2190,2195;, - 3;2196,2191,2195;, - 3;2192,2191,2196;, - 3;2197,2192,2196;, - 3;2193,2192,2197;, - 3;2198,2193,2197;, - 3;2199,2193,2198;, - 3;2199,2194,2193;, - 3;2195,1797,1802;, - 3;2200,2195,1802;, - 3;2196,2195,2200;, - 3;2201,2196,2200;, - 3;2197,2196,2201;, - 3;2202,2197,2201;, - 3;2198,2197,2202;, - 3;2203,2198,2202;, - 3;2204,2198,2203;, - 3;2204,2199,2198;, - 3;2200,1802,1807;, - 3;2205,2200,1807;, - 3;2201,2200,2205;, - 3;2206,2201,2205;, - 3;2202,2201,2206;, - 3;2207,2202,2206;, - 3;2203,2202,2207;, - 3;1887,2203,2207;, - 3;2208,2203,1887;, - 3;2208,2204,2203;, - 3;2205,1807,1812;, - 3;2209,2205,1812;, - 3;2206,2205,2209;, - 3;2210,2206,2209;, - 3;2207,2206,2210;, - 3;1881,2207,2210;, - 3;1887,2207,1881;, - 3;2209,1812,1817;, - 3;2211,2209,1817;, - 3;2210,2209,2211;, - 3;1875,2210,2211;, - 3;1881,2210,1875;, - 3;2211,1817,1822;, - 3;1869,2211,1822;, - 3;1875,2211,1869;, - 3;1886,2208,1887;, - 3;1898,2208,1886;, - 3;1898,2212,2208;, - 3;2212,2204,2208;, - 3;2212,2213,2204;, - 3;2213,2199,2204;, - 3;2213,2214,2199;, - 3;2214,2194,2199;, - 3;2215,2212,1898;, - 3;2215,2216,2212;, - 3;2216,2213,2212;, - 3;2216,2217,2213;, - 3;2217,2214,2213;, - 3;2217,2218,2214;, - 3;2218,2219,2214;, - 3;2214,2219,2194;, - 3;2219,2189,2194;, - 3;1897,2215,1898;, - 3;1904,2215,1897;, - 3;1904,2220,2215;, - 3;2220,2216,2215;, - 3;2220,2221,2216;, - 3;2221,2217,2216;, - 3;2221,2222,2217;, - 3;2222,2218,2217;, - 3;2222,2223,2218;, - 3;2223,2224,2218;, - 3;2218,2224,2219;, - 3;2224,2225,2219;, - 3;2219,2225,2189;, - 3;2225,2184,2189;, - 3;1910,2220,1904;, - 3;1910,2226,2220;, - 3;2226,2221,2220;, - 3;2226,2227,2221;, - 3;2227,2222,2221;, - 3;2227,2228,2222;, - 3;2228,2223,2222;, - 3;2228,2229,2223;, - 3;2229,2230,2223;, - 3;2223,2230,2224;, - 3;2230,2231,2224;, - 3;2224,2231,2225;, - 3;1910,2232,2226;, - 3;2226,2232,2233;, - 3;2226,2233,2227;, - 3;2227,2233,2234;, - 3;2227,2234,2228;, - 3;2228,2234,2235;, - 3;2228,2235,2229;, - 3;2229,2235,2236;, - 3;2229,2236,2237;, - 3;2229,2237,2230;, - 3;1910,1909,2232;, - 3;1909,2238,2232;, - 3;2232,2238,2239;, - 3;2232,2239,2233;, - 3;2233,2239,2240;, - 3;2233,2240,2234;, - 3;2234,2240,2241;, - 3;2234,2241,2235;, - 3;2235,2241,2242;, - 3;2235,2242,2236;, - 3;1909,1915,2238;, - 3;1915,2243,2238;, - 3;2238,2243,2244;, - 3;2238,2244,2239;, - 3;2239,2244,2245;, - 3;2239,2245,2240;, - 3;2240,2245,2246;, - 3;2240,2246,2241;, - 3;2241,2246,2247;, - 3;2241,2247,2242;, - 3;1915,1920,2243;, - 3;1920,2248,2243;, - 3;2243,2248,2249;, - 3;2243,2249,2244;, - 3;2244,2249,2250;, - 3;2244,2250,2245;, - 3;2245,2250,2251;, - 3;2245,2251,2246;, - 3;2246,2251,2252;, - 3;2246,2252,2247;, - 3;1920,1925,2248;, - 3;1925,2253,2248;, - 3;2248,2253,2254;, - 3;2248,2254,2249;, - 3;2249,2254,2255;, - 3;2249,2255,2250;, - 3;2250,2255,2256;, - 3;2250,2256,2251;, - 3;2251,2256,2257;, - 3;2251,2257,2252;, - 3;1925,1930,2253;, - 3;1930,1974,2253;, - 3;2253,1974,1980;, - 3;2253,1980,2254;, - 3;2254,1980,1986;, - 3;2254,1986,2255;, - 3;2255,1986,1992;, - 3;2255,1992,2256;, - 3;2256,1992,1998;, - 3;2256,1998,2257;, - 3;2257,1998,2004;, - 3;2257,2004,2258;, - 3;2252,2257,2258;, - 3;2252,2258,2259;, - 3;2247,2252,2259;, - 3;2247,2259,2260;, - 3;2242,2247,2260;, - 3;2258,2004,2010;, - 3;2258,2010,2261;, - 3;2259,2258,2261;, - 3;2259,2261,2262;, - 3;2260,2259,2262;, - 3;2260,2262,2263;, - 3;2264,2260,2263;, - 3;2242,2260,2264;, - 3;2236,2242,2264;, - 3;2236,2264,2265;, - 3;2237,2236,2265;, - 3;2261,2010,2016;, - 3;2261,2016,2266;, - 3;2262,2261,2266;, - 3;2262,2266,2267;, - 3;2263,2262,2267;, - 3;2263,2267,2268;, - 3;2269,2263,2268;, - 3;2264,2263,2269;, - 3;2265,2264,2269;, - 3;2265,2269,2270;, - 3;2271,2265,2270;, - 3;2237,2265,2271;, - 3;2266,2016,2022;, - 3;2266,2022,2272;, - 3;2267,2266,2272;, - 3;2267,2272,2273;, - 3;2268,2267,2273;, - 3;2268,2273,2274;, - 3;2275,2268,2274;, - 3;2269,2268,2275;, - 3;2270,2269,2275;, - 3;2270,2275,2276;, - 3;2277,2270,2276;, - 3;2271,2270,2277;, - 3;2272,2022,2028;, - 3;2272,2028,2278;, - 3;2273,2272,2278;, - 3;2273,2278,2279;, - 3;2274,2273,2279;, - 3;2274,2279,2280;, - 3;2281,2274,2280;, - 3;2275,2274,2281;, - 3;2276,2275,2281;, - 3;2276,2281,2282;, - 3;2283,2276,2282;, - 3;2277,2276,2283;, - 3;2278,2028,2034;, - 3;2278,2034,2284;, - 3;2279,2278,2284;, - 3;2279,2284,2285;, - 3;2280,2279,2285;, - 3;2280,2285,2286;, - 3;2287,2280,2286;, - 3;2281,2280,2287;, - 3;2282,2281,2287;, - 3;2282,2287,2288;, - 3;2289,2282,2288;, - 3;2283,2282,2289;, - 3;2284,2034,2040;, - 3;2284,2040,2290;, - 3;2285,2284,2290;, - 3;2285,2290,2291;, - 3;2286,2285,2291;, - 3;2286,2291,2292;, - 3;2293,2286,2292;, - 3;2287,2286,2293;, - 3;2288,2287,2293;, - 3;2288,2293,2132;, - 3;2138,2288,2132;, - 3;2289,2288,2138;, - 3;2290,2040,2046;, - 3;2290,2046,2294;, - 3;2291,2290,2294;, - 3;2291,2294,2295;, - 3;2292,2291,2295;, - 3;2292,2295,2120;, - 3;2126,2292,2120;, - 3;2293,2292,2126;, - 3;2132,2293,2126;, - 3;2294,2046,2052;, - 3;2294,2052,2296;, - 3;2295,2294,2296;, - 3;2295,2296,2114;, - 3;2120,2295,2114;, - 3;2296,2052,2058;, - 3;2296,2058,2108;, - 3;2114,2296,2108;, - 3;2289,2138,2144;, - 3;2289,2144,2297;, - 3;2283,2289,2297;, - 3;2283,2297,2298;, - 3;2277,2283,2298;, - 3;2277,2298,2299;, - 3;2271,2277,2299;, - 3;2297,2144,2150;, - 3;2297,2150,2300;, - 3;2298,2297,2300;, - 3;2298,2300,2301;, - 3;2299,2298,2301;, - 3;2299,2301,2302;, - 3;2303,2299,2302;, - 3;2271,2299,2303;, - 3;2237,2271,2303;, - 3;2237,2303,2230;, - 3;2230,2303,2231;, - 3;2300,2150,2156;, - 3;2300,2156,2304;, - 3;2301,2300,2304;, - 3;2301,2304,2305;, - 3;2302,2301,2305;, - 3;2302,2305,2306;, - 3;2231,2302,2306;, - 3;2303,2302,2231;, - 3;2304,2156,2162;, - 3;2304,2162,2174;, - 3;2305,2304,2174;, - 3;2305,2174,2179;, - 3;2306,2305,2179;, - 3;2306,2179,2184;, - 3;2225,2306,2184;, - 3;2231,2306,2225;; - } - - MeshTextureCoords { - 2307; - 0.281886;0.010641;, - 0.257541;0.012708;, - 1.000000;0.015902;, - 0.372241;0.029051;, - 0.344386;0.030669;, - 0.237113;0.014790;, - 0.000000;0.015902;, - 0.312811;0.008647;, - 0.401990;0.027694;, - 0.417159;0.048346;, - 0.390687;0.049523;, - 0.365054;0.050960;, - 0.318390;0.032482;, - 0.355259;0.006841;, - 0.433490;0.026663;, - 0.444339;0.047471;, - 0.448562;0.068432;, - 0.423216;0.069238;, - 0.398287;0.070330;, - 0.416933;0.005462;, - 0.466364;0.026017;, - 0.472034;0.046932;, - 0.474204;0.067938;, - 0.475347;0.089019;, - 0.450799;0.089485;, - 0.500000;0.004913;, - 0.500000;0.025797;, - 0.500000;0.046749;, - 0.500000;0.067771;, - 0.500000;0.088861;, - 0.583067;0.005462;, - 0.533636;0.026017;, - 0.527966;0.046932;, - 0.525796;0.067938;, - 0.524653;0.089019;, - 0.500000;0.110020;, - 0.644741;0.006841;, - 0.566510;0.026663;, - 0.555661;0.047471;, - 0.551438;0.068432;, - 0.549201;0.089485;, - 0.523951;0.110170;, - 0.687189;0.008647;, - 0.598010;0.027694;, - 0.582841;0.048346;, - 0.576784;0.069238;, - 0.573546;0.090248;, - 0.547823;0.110616;, - 0.718114;0.010641;, - 0.627759;0.029051;, - 0.609313;0.049523;, - 0.601713;0.070330;, - 0.597600;0.091285;, - 0.571540;0.111345;, - 0.742459;0.012708;, - 0.655614;0.030669;, - 0.634946;0.050960;, - 0.626131;0.071676;, - 0.621293;0.092568;, - 0.595036;0.112338;, - 0.762887;0.014790;, - 0.681610;0.032482;, - 0.659668;0.052612;, - 0.649974;0.073236;, - 0.644570;0.094062;, - 0.618253;0.113568;, - 0.780848;0.016852;, - 0.705888;0.034431;, - 0.683460;0.054429;, - 0.673204;0.074969;, - 0.667396;0.095730;, - 0.641145;0.115005;, - 0.797175;0.018870;, - 0.728639;0.036461;, - 0.706341;0.056366;, - 0.695811;0.076835;, - 0.689751;0.097534;, - 0.663681;0.116615;, - 0.812371;0.020826;, - 0.750066;0.038527;, - 0.728361;0.058378;, - 0.717802;0.078789;, - 0.711633;0.099434;, - 0.685841;0.118360;, - 0.826757;0.022708;, - 0.770360;0.040590;, - 0.749584;0.060422;, - 0.739202;0.080794;, - 0.733049;0.101391;, - 0.707615;0.120203;, - 0.840545;0.024503;, - 0.789695;0.042618;, - 0.770082;0.062463;, - 0.760045;0.082810;, - 0.754016;0.103368;, - 0.729005;0.122107;, - 0.853882;0.026202;, - 0.808222;0.044582;, - 0.789931;0.064466;, - 0.780372;0.084803;, - 0.774560;0.105330;, - 0.750021;0.124036;, - 0.866872;0.027795;, - 0.826070;0.046459;, - 0.809204;0.066402;, - 0.800228;0.086742;, - 0.794709;0.107246;, - 0.770677;0.125955;, - 0.879590;0.029275;, - 0.843348;0.048229;, - 0.827973;0.068246;, - 0.819659;0.088598;, - 0.814496;0.109087;, - 0.790996;0.127833;, - 0.892093;0.030635;, - 0.860148;0.049874;, - 0.846302;0.069974;, - 0.838711;0.090346;, - 0.833956;0.110825;, - 0.811000;0.129641;, - 0.904426;0.031868;, - 0.876550;0.051381;, - 0.864251;0.071568;, - 0.857429;0.091964;, - 0.853123;0.112439;, - 0.830717;0.131351;, - 0.916623;0.032969;, - 0.892622;0.052737;, - 0.881877;0.073010;, - 0.875857;0.093434;, - 0.872033;0.113908;, - 0.850174;0.132942;, - 0.928710;0.033933;, - 0.908422;0.053932;, - 0.899229;0.074287;, - 0.894037;0.094739;, - 0.890720;0.115214;, - 0.869402;0.134391;, - 0.940711;0.034756;, - 0.923999;0.054956;, - 0.916354;0.075386;, - 0.912007;0.095865;, - 0.909217;0.116343;, - 0.888428;0.135682;, - 0.952644;0.035434;, - 0.939401;0.055804;, - 0.933296;0.076298;, - 0.929807;0.096802;, - 0.927558;0.117283;, - 0.907284;0.136798;, - 0.964526;0.035964;, - 0.954665;0.056469;, - 0.950095;0.077015;, - 0.947471;0.097539;, - 0.945776;0.118023;, - 0.925996;0.137728;, - 0.976370;0.036345;, - 0.969831;0.056947;, - 0.966788;0.077531;, - 0.965036;0.098071;, - 0.963902;0.118558;, - 0.944596;0.138462;, - 0.988191;0.036574;, - 0.984932;0.057235;, - 0.983411;0.077843;, - 0.982534;0.098391;, - 0.981966;0.118881;, - 0.963111;0.138991;, - 1.000000;0.036650;, - 1.000000;0.057331;, - 1.000000;0.077947;, - 1.000000;0.098499;, - 1.000000;0.118988;, - 0.981569;0.139311;, - 0.962531;0.159371;, - 0.943731;0.158852;, - 0.924853;0.158133;, - 1.000000;0.139418;, - 0.981278;0.159685;, - 0.962089;0.179699;, - 0.943073;0.179195;, - 0.923985;0.178497;, - 0.904800;0.177612;, - 0.905871;0.157222;, - 1.000000;0.159790;, - 0.981057;0.180004;, - 0.961744;0.199977;, - 0.942559;0.199491;, - 0.923307;0.198818;, - 0.903965;0.197965;, - 1.000000;0.180106;, - 0.980883;0.200270;, - 0.961468;0.220206;, - 0.942148;0.219742;, - 0.922766;0.219098;, - 0.903299;0.218283;, - 1.000000;0.200369;, - 0.980744;0.220487;, - 0.961244;0.240390;, - 0.941815;0.239949;, - 0.922327;0.239339;, - 0.902759;0.238566;, - 1.000000;0.220581;, - 0.980632;0.240656;, - 0.961060;0.260531;, - 0.941542;0.260116;, - 0.921967;0.259542;, - 0.902317;0.258815;, - 1.000000;0.240746;, - 0.980539;0.260782;, - 0.960907;0.280632;, - 0.941315;0.280245;, - 0.921669;0.279710;, - 0.901951;0.279031;, - 1.000000;0.260865;, - 0.980463;0.280865;, - 0.960780;0.300695;, - 0.941127;0.300339;, - 0.921421;0.299845;, - 0.901646;0.299219;, - 1.000000;0.280944;, - 0.980399;0.300911;, - 0.960674;0.320725;, - 0.940969;0.320400;, - 0.921214;0.319949;, - 0.901392;0.319378;, - 1.000000;0.300983;, - 0.980346;0.320921;, - 0.960586;0.340723;, - 0.940838;0.340431;, - 0.921041;0.340026;, - 0.901180;0.339512;, - 1.000000;0.320987;, - 0.980301;0.340900;, - 0.960512;0.360694;, - 0.940729;0.360436;, - 0.920898;0.360078;, - 0.901004;0.359624;, - 1.000000;0.340959;, - 0.980264;0.360851;, - 0.960452;0.380641;, - 0.940639;0.380417;, - 0.920780;0.380108;, - 0.900859;0.379715;, - 1.000000;0.360903;, - 0.980234;0.380776;, - 0.960403;0.400566;, - 0.940566;0.400379;, - 0.920684;0.400119;, - 0.900742;0.399789;, - 1.000000;0.380821;, - 0.980209;0.400680;, - 0.960364;0.420474;, - 0.940508;0.420323;, - 0.920608;0.420114;, - 0.900649;0.419849;, - 1.000000;0.400718;, - 0.980190;0.420565;, - 0.960335;0.440368;, - 0.940465;0.440254;, - 0.920551;0.440097;, - 0.900579;0.439897;, - 1.000000;0.420596;, - 0.980175;0.440437;, - 0.960314;0.460251;, - 0.940435;0.460175;, - 0.920511;0.460070;, - 0.900530;0.459936;, - 1.000000;0.440460;, - 0.980164;0.460297;, - 0.960302;0.480127;, - 0.940416;0.480089;, - 0.920488;0.480037;, - 0.900501;0.479970;, - 1.000000;0.460313;, - 0.980158;0.480150;, - 0.960298;0.500000;, - 0.940410;0.500000;, - 0.920480;0.500000;, - 0.900492;0.500000;, - 1.000000;0.480158;, - 0.980156;0.500000;, - 0.960302;0.519873;, - 0.940416;0.519911;, - 0.920488;0.519963;, - 0.900501;0.520030;, - 1.000000;0.500000;, - 0.980158;0.519850;, - 0.960314;0.539749;, - 0.940435;0.539825;, - 0.920511;0.539930;, - 0.900530;0.540064;, - 1.000000;0.519842;, - 0.980164;0.539703;, - 0.960335;0.559632;, - 0.940465;0.559746;, - 0.920551;0.559903;, - 0.900579;0.560103;, - 1.000000;0.539687;, - 0.980175;0.559563;, - 0.960364;0.579526;, - 0.940508;0.579677;, - 0.920608;0.579886;, - 0.900649;0.580151;, - 1.000000;0.559540;, - 0.980190;0.579435;, - 0.960403;0.599434;, - 0.940566;0.599621;, - 0.920684;0.599881;, - 0.900742;0.600211;, - 1.000000;0.579404;, - 0.980209;0.599320;, - 0.960452;0.619359;, - 0.940639;0.619583;, - 0.920780;0.619892;, - 0.900859;0.620285;, - 1.000000;0.599282;, - 0.980234;0.619224;, - 0.960512;0.639306;, - 0.940729;0.639564;, - 0.920898;0.639922;, - 0.901004;0.640376;, - 1.000000;0.619179;, - 0.980264;0.639149;, - 0.960586;0.659277;, - 0.940838;0.659569;, - 0.921041;0.659974;, - 0.901180;0.660488;, - 1.000000;0.639097;, - 0.980301;0.659100;, - 0.960674;0.679275;, - 0.940969;0.679600;, - 0.921214;0.680051;, - 0.901392;0.680622;, - 1.000000;0.659041;, - 0.980346;0.679079;, - 0.960780;0.699305;, - 0.941127;0.699661;, - 0.921421;0.700155;, - 0.901646;0.700781;, - 1.000000;0.679013;, - 0.980399;0.699089;, - 0.960907;0.719368;, - 0.941315;0.719755;, - 0.921669;0.720290;, - 0.901951;0.720969;, - 1.000000;0.699017;, - 0.980463;0.719135;, - 0.961060;0.739469;, - 0.941542;0.739884;, - 0.921967;0.740458;, - 0.902317;0.741186;, - 1.000000;0.719056;, - 0.980539;0.739218;, - 0.961244;0.759610;, - 0.941815;0.760051;, - 0.922327;0.760661;, - 0.902759;0.761434;, - 1.000000;0.739135;, - 0.980632;0.759344;, - 0.961468;0.779794;, - 0.942148;0.780258;, - 0.922766;0.780902;, - 0.903299;0.781717;, - 1.000000;0.759254;, - 0.980744;0.779513;, - 0.961744;0.800023;, - 0.942559;0.800509;, - 0.923307;0.801182;, - 0.903965;0.802035;, - 1.000000;0.779419;, - 0.980883;0.799730;, - 0.962089;0.820301;, - 0.943073;0.820805;, - 0.923985;0.821503;, - 0.904800;0.822388;, - 1.000000;0.799631;, - 0.981057;0.819996;, - 0.962531;0.840629;, - 0.943731;0.841148;, - 0.924853;0.841867;, - 0.905871;0.842778;, - 1.000000;0.819894;, - 0.981278;0.840315;, - 0.963111;0.861009;, - 0.944596;0.861538;, - 0.925996;0.862272;, - 0.907284;0.863202;, - 1.000000;0.840210;, - 0.981569;0.860689;, - 0.963902;0.881442;, - 0.945776;0.881977;, - 0.927558;0.882717;, - 0.909217;0.883657;, - 1.000000;0.860582;, - 0.981966;0.881119;, - 0.965036;0.901929;, - 0.947471;0.902461;, - 0.929807;0.903198;, - 0.912007;0.904135;, - 1.000000;0.881012;, - 0.982534;0.901609;, - 0.966788;0.922469;, - 0.950095;0.922985;, - 0.933296;0.923702;, - 0.916354;0.924614;, - 1.000000;0.901501;, - 0.983411;0.922157;, - 0.969831;0.943053;, - 0.954665;0.943531;, - 0.939401;0.944196;, - 0.923999;0.945044;, - 1.000000;0.922053;, - 0.984932;0.942765;, - 0.976370;0.963655;, - 0.964526;0.964036;, - 0.952644;0.964566;, - 0.940711;0.965244;, - 1.000000;0.942669;, - 0.988191;0.963426;, - 1.000000;0.984098;, - 0.928710;0.966067;, - 0.908422;0.946068;, - 1.000000;0.963350;, - 0.899229;0.925713;, - 0.892622;0.947263;, - 0.881877;0.926990;, - 0.894037;0.905261;, - 0.916623;0.967031;, - 0.904426;0.968132;, - 0.876550;0.948619;, - 0.864251;0.928432;, - 0.875857;0.906566;, - 0.892093;0.969365;, - 0.860148;0.950126;, - 0.846302;0.930026;, - 0.857429;0.908036;, - 0.872033;0.886092;, - 0.890720;0.884786;, - 0.879590;0.970725;, - 0.843348;0.951772;, - 0.827973;0.931754;, - 0.838711;0.909654;, - 0.853123;0.887561;, - 0.866872;0.972205;, - 0.826070;0.953541;, - 0.809204;0.933598;, - 0.819659;0.911402;, - 0.833956;0.889175;, - 0.853882;0.973798;, - 0.808222;0.955418;, - 0.789931;0.935534;, - 0.800228;0.913258;, - 0.814496;0.890913;, - 0.840545;0.975497;, - 0.789695;0.957382;, - 0.770082;0.937537;, - 0.780372;0.915197;, - 0.794709;0.892754;, - 0.826757;0.977292;, - 0.770360;0.959410;, - 0.749584;0.939578;, - 0.760045;0.917190;, - 0.774560;0.894670;, - 0.812371;0.979174;, - 0.750066;0.961473;, - 0.728361;0.941622;, - 0.739202;0.919206;, - 0.754016;0.896632;, - 0.797175;0.981130;, - 0.728639;0.963539;, - 0.706341;0.943634;, - 0.717802;0.921211;, - 0.733049;0.898609;, - 0.780848;0.983148;, - 0.705888;0.965569;, - 0.683460;0.945571;, - 0.695811;0.923165;, - 0.711633;0.900566;, - 0.762887;0.985210;, - 0.681610;0.967518;, - 0.659668;0.947388;, - 0.673204;0.925031;, - 0.689751;0.902466;, - 0.742459;0.987292;, - 0.655614;0.969331;, - 0.634946;0.949040;, - 0.649974;0.926764;, - 0.667396;0.904270;, - 0.718114;0.989359;, - 0.627759;0.970949;, - 0.609313;0.950477;, - 0.626131;0.928324;, - 0.644570;0.905938;, - 0.687189;0.991353;, - 0.598010;0.972307;, - 0.582841;0.951654;, - 0.601713;0.929670;, - 0.621293;0.907432;, - 0.644741;0.993159;, - 0.566510;0.973337;, - 0.555661;0.952529;, - 0.576784;0.930762;, - 0.597600;0.908715;, - 0.583067;0.994538;, - 0.533636;0.973983;, - 0.527966;0.953068;, - 0.551438;0.931568;, - 0.573546;0.909752;, - 0.500000;0.995087;, - 0.500000;0.974203;, - 0.500000;0.953251;, - 0.525796;0.932062;, - 0.549201;0.910515;, - 0.571540;0.888655;, - 0.595036;0.887662;, - 0.466364;0.973983;, - 0.472034;0.953068;, - 0.474204;0.932062;, - 0.500000;0.932229;, - 0.524653;0.910981;, - 0.547823;0.889384;, - 0.416933;0.994538;, - 0.433490;0.973337;, - 0.444339;0.952529;, - 0.448562;0.931568;, - 0.450799;0.910515;, - 0.475347;0.910981;, - 0.000000;0.984098;, - 0.355259;0.993159;, - 0.401990;0.972307;, - 0.417159;0.951654;, - 0.423216;0.930762;, - 0.426454;0.909752;, - 0.312811;0.991353;, - 0.372241;0.970949;, - 0.390687;0.950477;, - 0.398287;0.929670;, - 0.402400;0.908715;, - 0.281886;0.989359;, - 0.344386;0.969331;, - 0.365054;0.949040;, - 0.373869;0.928324;, - 0.378707;0.907432;, - 0.257541;0.987292;, - 0.318390;0.967518;, - 0.340332;0.947388;, - 0.350026;0.926764;, - 0.355430;0.905938;, - 0.237113;0.985210;, - 0.294112;0.965569;, - 0.316540;0.945571;, - 0.326796;0.925031;, - 0.332604;0.904270;, - 0.219152;0.983148;, - 0.271361;0.963539;, - 0.293659;0.943634;, - 0.304189;0.923165;, - 0.310249;0.902466;, - 0.202825;0.981130;, - 0.249934;0.961473;, - 0.271639;0.941622;, - 0.282198;0.921211;, - 0.288367;0.900566;, - 0.187629;0.979174;, - 0.229640;0.959410;, - 0.250416;0.939578;, - 0.260798;0.919206;, - 0.266951;0.898609;, - 0.173243;0.977292;, - 0.210305;0.957382;, - 0.229918;0.937537;, - 0.239955;0.917190;, - 0.245984;0.896632;, - 0.159455;0.975497;, - 0.191778;0.955418;, - 0.210069;0.935534;, - 0.219628;0.915197;, - 0.225440;0.894670;, - 0.146118;0.973798;, - 0.173930;0.953541;, - 0.190796;0.933598;, - 0.199772;0.913258;, - 0.205291;0.892754;, - 0.133128;0.972205;, - 0.156652;0.951772;, - 0.172027;0.931754;, - 0.180341;0.911402;, - 0.185504;0.890913;, - 0.120410;0.970725;, - 0.139852;0.950126;, - 0.153698;0.930026;, - 0.161289;0.909654;, - 0.166044;0.889175;, - 0.107907;0.969365;, - 0.123450;0.948619;, - 0.135749;0.928432;, - 0.142571;0.908036;, - 0.146877;0.887561;, - 0.095574;0.968132;, - 0.107378;0.947263;, - 0.118123;0.926990;, - 0.124143;0.906566;, - 0.127967;0.886092;, - 0.083377;0.967031;, - 0.091578;0.946068;, - 0.100771;0.925713;, - 0.105963;0.905261;, - 0.109280;0.884786;, - 0.071290;0.966067;, - 0.076001;0.945044;, - 0.083646;0.924614;, - 0.087993;0.904135;, - 0.090783;0.883657;, - 0.059289;0.965244;, - 0.060599;0.944196;, - 0.066704;0.923702;, - 0.070193;0.903198;, - 0.072442;0.882717;, - 0.047356;0.964566;, - 0.045335;0.943531;, - 0.049905;0.922985;, - 0.052529;0.902461;, - 0.054224;0.881977;, - 0.035474;0.964036;, - 0.030169;0.943053;, - 0.033212;0.922469;, - 0.034964;0.901929;, - 0.036098;0.881442;, - 0.023630;0.963655;, - 0.015068;0.942765;, - 0.016589;0.922157;, - 0.017466;0.901609;, - 0.018034;0.881119;, - 0.011809;0.963426;, - 0.000000;0.942669;, - 0.000000;0.922053;, - 0.000000;0.901501;, - 0.000000;0.881012;, - 0.000000;0.963350;, - 0.000000;0.860582;, - 0.018431;0.860689;, - 0.036889;0.861009;, - 0.055404;0.861538;, - 0.000000;0.840210;, - 0.018722;0.840315;, - 0.037469;0.840629;, - 0.056269;0.841148;, - 0.074004;0.862272;, - 0.092716;0.863202;, - 0.000000;0.819894;, - 0.018943;0.819996;, - 0.037911;0.820301;, - 0.056927;0.820805;, - 0.075147;0.841867;, - 0.094129;0.842778;, - 0.111572;0.864319;, - 0.000000;0.799631;, - 0.019117;0.799730;, - 0.038256;0.800023;, - 0.057441;0.800509;, - 0.076015;0.821503;, - 0.095200;0.822388;, - 0.113241;0.843871;, - 0.000000;0.779419;, - 0.019256;0.779513;, - 0.038532;0.779794;, - 0.057852;0.780258;, - 0.076693;0.801182;, - 0.096035;0.802035;, - 0.114505;0.823449;, - 0.000000;0.759254;, - 0.019368;0.759344;, - 0.038756;0.759610;, - 0.058185;0.760051;, - 0.077234;0.780902;, - 0.096701;0.781717;, - 0.115489;0.803057;, - 0.000000;0.739135;, - 0.019461;0.739218;, - 0.038940;0.739469;, - 0.058458;0.739884;, - 0.077673;0.760661;, - 0.097241;0.761434;, - 0.116273;0.782694;, - 0.000000;0.719056;, - 0.019537;0.719135;, - 0.039093;0.719368;, - 0.058685;0.719755;, - 0.078033;0.740458;, - 0.097683;0.741186;, - 0.116907;0.762362;, - 0.000000;0.699017;, - 0.019601;0.699089;, - 0.039220;0.699305;, - 0.058873;0.699661;, - 0.078331;0.720290;, - 0.098049;0.720969;, - 0.117427;0.742058;, - 0.000000;0.679013;, - 0.019654;0.679079;, - 0.039326;0.679275;, - 0.059031;0.679600;, - 0.078579;0.700155;, - 0.098354;0.700781;, - 0.117857;0.721782;, - 0.000000;0.659041;, - 0.019699;0.659100;, - 0.039414;0.659277;, - 0.059162;0.659569;, - 0.078786;0.680051;, - 0.098608;0.680622;, - 0.118214;0.701532;, - 0.000000;0.639097;, - 0.019736;0.639149;, - 0.039488;0.639306;, - 0.059271;0.639564;, - 0.078959;0.659974;, - 0.098820;0.660488;, - 0.118512;0.681307;, - 0.000000;0.619179;, - 0.019766;0.619224;, - 0.039548;0.619359;, - 0.059361;0.619583;, - 0.079102;0.639922;, - 0.098996;0.640376;, - 0.118761;0.661104;, - 0.000000;0.599282;, - 0.019791;0.599320;, - 0.039597;0.599434;, - 0.059434;0.599621;, - 0.079220;0.619892;, - 0.099141;0.620285;, - 0.118967;0.640921;, - 0.000000;0.579404;, - 0.019811;0.579435;, - 0.039636;0.579526;, - 0.059492;0.579677;, - 0.079316;0.599881;, - 0.099258;0.600211;, - 0.119137;0.620755;, - 0.000000;0.559540;, - 0.019825;0.559563;, - 0.039665;0.559632;, - 0.059535;0.559746;, - 0.079392;0.579886;, - 0.099351;0.580151;, - 0.119274;0.600606;, - 0.000000;0.539687;, - 0.019836;0.539703;, - 0.039686;0.539749;, - 0.059565;0.539825;, - 0.079449;0.559903;, - 0.099421;0.560103;, - 0.119383;0.580469;, - 0.000000;0.519842;, - 0.019842;0.519850;, - 0.039698;0.519873;, - 0.059584;0.519911;, - 0.079489;0.539930;, - 0.099470;0.540064;, - 0.119465;0.560342;, - 0.000000;0.500000;, - 0.019844;0.500000;, - 0.039702;0.500000;, - 0.059589;0.500000;, - 0.079512;0.519963;, - 0.099499;0.520030;, - 0.119522;0.540224;, - 0.000000;0.480158;, - 0.019842;0.480150;, - 0.039698;0.480127;, - 0.059584;0.480089;, - 0.079520;0.500000;, - 0.099508;0.500000;, - 0.119556;0.520111;, - 0.000000;0.460313;, - 0.019836;0.460297;, - 0.039686;0.460251;, - 0.059565;0.460175;, - 0.079512;0.480037;, - 0.099499;0.479970;, - 0.119567;0.500000;, - 0.000000;0.440460;, - 0.019825;0.440437;, - 0.039665;0.440368;, - 0.059535;0.440254;, - 0.079489;0.460070;, - 0.099470;0.459936;, - 0.119556;0.479889;, - 0.000000;0.420596;, - 0.019811;0.420565;, - 0.039636;0.420474;, - 0.059492;0.420323;, - 0.079449;0.440097;, - 0.099421;0.439897;, - 0.119522;0.459776;, - 0.000000;0.400718;, - 0.019791;0.400680;, - 0.039597;0.400566;, - 0.059434;0.400379;, - 0.079392;0.420114;, - 0.099351;0.419849;, - 0.119465;0.439658;, - 0.000000;0.380821;, - 0.019766;0.380776;, - 0.039548;0.380641;, - 0.059361;0.380417;, - 0.079316;0.400119;, - 0.099258;0.399789;, - 0.119383;0.419531;, - 0.000000;0.360903;, - 0.019736;0.360851;, - 0.039488;0.360694;, - 0.059271;0.360436;, - 0.079220;0.380108;, - 0.099141;0.379715;, - 0.119274;0.399394;, - 0.000000;0.340959;, - 0.019699;0.340900;, - 0.039414;0.340723;, - 0.059162;0.340431;, - 0.079102;0.360078;, - 0.098996;0.359624;, - 0.119137;0.379245;, - 0.000000;0.320987;, - 0.019654;0.320921;, - 0.039326;0.320725;, - 0.059031;0.320400;, - 0.078959;0.340026;, - 0.098820;0.339512;, - 0.118967;0.359079;, - 0.000000;0.300983;, - 0.019601;0.300911;, - 0.039220;0.300695;, - 0.058873;0.300339;, - 0.078786;0.319949;, - 0.098608;0.319378;, - 0.118761;0.338896;, - 0.000000;0.280944;, - 0.019537;0.280865;, - 0.039093;0.280632;, - 0.058685;0.280245;, - 0.078579;0.299845;, - 0.098354;0.299219;, - 0.118512;0.318693;, - 0.000000;0.260865;, - 0.019461;0.260782;, - 0.038940;0.260531;, - 0.058458;0.260116;, - 0.078331;0.279710;, - 0.098049;0.279031;, - 0.118214;0.298468;, - 0.000000;0.240746;, - 0.019368;0.240656;, - 0.038756;0.240390;, - 0.058185;0.239949;, - 0.078033;0.259542;, - 0.097683;0.258815;, - 0.117857;0.278218;, - 0.000000;0.220581;, - 0.019256;0.220487;, - 0.038532;0.220206;, - 0.057852;0.219742;, - 0.077673;0.239339;, - 0.097241;0.238566;, - 0.117427;0.257942;, - 0.000000;0.200369;, - 0.019117;0.200270;, - 0.038256;0.199977;, - 0.057441;0.199491;, - 0.077234;0.219098;, - 0.096701;0.218283;, - 0.116907;0.237638;, - 0.000000;0.180106;, - 0.018943;0.180004;, - 0.037911;0.179699;, - 0.056927;0.179195;, - 0.076693;0.198818;, - 0.096035;0.197965;, - 0.116273;0.217306;, - 0.000000;0.159790;, - 0.018722;0.159685;, - 0.037469;0.159371;, - 0.056269;0.158852;, - 0.076015;0.178497;, - 0.095200;0.177612;, - 0.115489;0.196943;, - 0.000000;0.139418;, - 0.018431;0.139311;, - 0.036889;0.138991;, - 0.055404;0.138462;, - 0.075147;0.158133;, - 0.094129;0.157222;, - 0.114505;0.176551;, - 0.000000;0.118988;, - 0.018034;0.118881;, - 0.036098;0.118558;, - 0.054224;0.118023;, - 0.074004;0.137728;, - 0.092716;0.136798;, - 0.113241;0.156129;, - 0.000000;0.098499;, - 0.017466;0.098391;, - 0.034964;0.098071;, - 0.052529;0.097539;, - 0.072442;0.117283;, - 0.090783;0.116343;, - 0.111572;0.135682;, - 0.000000;0.077947;, - 0.016589;0.077843;, - 0.033212;0.077531;, - 0.049905;0.077015;, - 0.070193;0.096802;, - 0.087993;0.095865;, - 0.109280;0.115214;, - 0.000000;0.057331;, - 0.015068;0.057235;, - 0.030169;0.056947;, - 0.045335;0.056469;, - 0.066704;0.076298;, - 0.083646;0.075386;, - 0.105963;0.094739;, - 0.000000;0.036650;, - 0.011809;0.036574;, - 0.023630;0.036345;, - 0.035474;0.035964;, - 0.060599;0.055804;, - 0.076001;0.054956;, - 0.100771;0.074287;, - 0.047356;0.035434;, - 0.059289;0.034756;, - 0.091578;0.053932;, - 0.118123;0.073010;, - 0.124143;0.093434;, - 0.071290;0.033933;, - 0.107378;0.052737;, - 0.135749;0.071568;, - 0.142571;0.091964;, - 0.146877;0.112439;, - 0.127967;0.113908;, - 0.083377;0.032969;, - 0.123450;0.051381;, - 0.153698;0.069974;, - 0.161289;0.090346;, - 0.166044;0.110825;, - 0.095574;0.031868;, - 0.139852;0.049874;, - 0.172027;0.068246;, - 0.180341;0.088598;, - 0.185504;0.109087;, - 0.107907;0.030635;, - 0.156652;0.048229;, - 0.190796;0.066402;, - 0.199772;0.086742;, - 0.205291;0.107246;, - 0.120410;0.029275;, - 0.173930;0.046459;, - 0.210069;0.064466;, - 0.219628;0.084803;, - 0.225440;0.105330;, - 0.133128;0.027795;, - 0.191778;0.044582;, - 0.229918;0.062463;, - 0.239955;0.082810;, - 0.245984;0.103368;, - 0.146118;0.026202;, - 0.210305;0.042618;, - 0.250416;0.060422;, - 0.260798;0.080794;, - 0.266951;0.101391;, - 0.159455;0.024503;, - 0.229640;0.040590;, - 0.271639;0.058378;, - 0.282198;0.078789;, - 0.288367;0.099434;, - 0.173243;0.022708;, - 0.249934;0.038527;, - 0.293659;0.056366;, - 0.304189;0.076835;, - 0.310249;0.097534;, - 0.187629;0.020826;, - 0.271361;0.036461;, - 0.316540;0.054429;, - 0.326796;0.074969;, - 0.332604;0.095730;, - 0.202825;0.018870;, - 0.294112;0.034431;, - 0.340332;0.052612;, - 0.350026;0.073236;, - 0.355430;0.094062;, - 0.219152;0.016852;, - 0.373869;0.071676;, - 0.378707;0.092568;, - 0.402400;0.091285;, - 0.404964;0.112338;, - 0.381747;0.113568;, - 0.358855;0.115005;, - 0.426454;0.090248;, - 0.428460;0.111345;, - 0.429818;0.132516;, - 0.406707;0.133469;, - 0.383824;0.134651;, - 0.452177;0.110616;, - 0.453108;0.131817;, - 0.453775;0.153086;, - 0.430793;0.153755;, - 0.407963;0.154668;, - 0.476049;0.110170;, - 0.476522;0.131390;, - 0.476861;0.152677;, - 0.477114;0.174028;, - 0.454274;0.174419;, - 0.431524;0.175059;, - 0.500000;0.131247;, - 0.500000;0.152539;, - 0.500000;0.173897;, - 0.500000;0.195318;, - 0.477309;0.195442;, - 0.454659;0.195814;, - 0.523478;0.131390;, - 0.523139;0.152677;, - 0.522886;0.174028;, - 0.522691;0.195442;, - 0.500000;0.216799;, - 0.477463;0.216917;, - 0.546892;0.131817;, - 0.546225;0.153086;, - 0.545726;0.174419;, - 0.545341;0.195814;, - 0.522537;0.216917;, - 0.500000;0.238339;, - 0.570182;0.132516;, - 0.569207;0.153755;, - 0.568476;0.175059;, - 0.567911;0.196423;, - 0.545037;0.217269;, - 0.522413;0.238450;, - 0.593293;0.133469;, - 0.592037;0.154668;, - 0.591094;0.175932;, - 0.590365;0.197254;, - 0.567465;0.217845;, - 0.544793;0.238780;, - 0.616176;0.134651;, - 0.614675;0.155803;, - 0.613546;0.177017;, - 0.612671;0.198287;, - 0.589789;0.218632;, - 0.567106;0.239322;, - 0.638793;0.136034;, - 0.637087;0.157131;, - 0.635800;0.178288;, - 0.634801;0.199498;, - 0.611978;0.219610;, - 0.589325;0.240062;, - 0.661115;0.137586;, - 0.659247;0.158623;, - 0.657833;0.179716;, - 0.656733;0.200859;, - 0.634008;0.220756;, - 0.611420;0.240982;, - 0.683123;0.139271;, - 0.681135;0.160245;, - 0.679627;0.181271;, - 0.678451;0.202340;, - 0.655859;0.222045;, - 0.633369;0.242060;, - 0.704806;0.141054;, - 0.702742;0.161963;, - 0.701172;0.182918;, - 0.699943;0.203911;, - 0.677514;0.223449;, - 0.655153;0.243272;, - 0.726161;0.142899;, - 0.724064;0.163742;, - 0.722462;0.184626;, - 0.721206;0.205540;, - 0.698964;0.224937;, - 0.676757;0.244592;, - 0.747195;0.144771;, - 0.745101;0.165550;, - 0.743498;0.186361;, - 0.742238;0.207196;, - 0.720203;0.226481;, - 0.698170;0.245992;, - 0.767916;0.146637;, - 0.765863;0.167353;, - 0.764285;0.188094;, - 0.763043;0.208850;, - 0.741229;0.228051;, - 0.719389;0.247445;, - 0.788341;0.148465;, - 0.786360;0.169122;, - 0.784833;0.189794;, - 0.783628;0.210474;, - 0.762046;0.229619;, - 0.740410;0.248922;, - 0.808489;0.150227;, - 0.806608;0.170828;, - 0.805155;0.191434;, - 0.804006;0.212041;, - 0.782660;0.231158;, - 0.761235;0.250397;, - 0.828380;0.151896;, - 0.826625;0.172445;, - 0.825265;0.192990;, - 0.824188;0.213528;, - 0.803081;0.232644;, - 0.781871;0.251845;, - 0.848039;0.153450;, - 0.846431;0.173951;, - 0.845182;0.194440;, - 0.844191;0.214913;, - 0.823319;0.234055;, - 0.802326;0.253243;, - 0.867491;0.154866;, - 0.866047;0.175325;, - 0.864924;0.195763;, - 0.864031;0.216178;, - 0.843390;0.235368;, - 0.822610;0.254570;, - 0.886759;0.156129;, - 0.885495;0.176551;, - 0.884511;0.196943;, - 0.883727;0.217306;, - 0.863309;0.236568;, - 0.842736;0.255806;, - 0.883093;0.237638;, - 0.862718;0.256935;, - 0.842196;0.276227;, - 0.822025;0.275074;, - 0.801704;0.273836;, - 0.882573;0.257942;, - 0.862230;0.277279;, - 0.841747;0.296630;, - 0.821539;0.295565;, - 0.801189;0.294423;, - 0.882143;0.278218;, - 0.861824;0.297601;, - 0.841373;0.317016;, - 0.821135;0.316045;, - 0.800760;0.315003;, - 0.881786;0.298468;, - 0.861486;0.317903;, - 0.841062;0.337388;, - 0.820798;0.336514;, - 0.800403;0.335576;, - 0.881488;0.318693;, - 0.861205;0.338185;, - 0.840804;0.357746;, - 0.820519;0.356973;, - 0.800107;0.356144;, - 0.881239;0.338896;, - 0.860971;0.358451;, - 0.840591;0.378091;, - 0.820290;0.377423;, - 0.799864;0.376706;, - 0.881033;0.359079;, - 0.860778;0.378701;, - 0.840419;0.398426;, - 0.820104;0.397865;, - 0.799668;0.397263;, - 0.880863;0.379245;, - 0.860623;0.398938;, - 0.840284;0.418752;, - 0.819958;0.418300;, - 0.799513;0.417815;, - 0.880726;0.399394;, - 0.860500;0.419164;, - 0.840181;0.439070;, - 0.819847;0.438730;, - 0.799396;0.438365;, - 0.880617;0.419531;, - 0.860407;0.439381;, - 0.840109;0.459383;, - 0.819770;0.459156;, - 0.799314;0.458911;, - 0.880535;0.439658;, - 0.860342;0.459591;, - 0.840067;0.479693;, - 0.819724;0.479579;, - 0.799265;0.479456;, - 0.880478;0.459776;, - 0.860303;0.479797;, - 0.840053;0.500000;, - 0.819709;0.500000;, - 0.799249;0.500000;, - 0.880444;0.479889;, - 0.860290;0.500000;, - 0.840067;0.520307;, - 0.819724;0.520421;, - 0.799265;0.520544;, - 0.880433;0.500000;, - 0.860303;0.520203;, - 0.840109;0.540617;, - 0.819770;0.540844;, - 0.799314;0.541089;, - 0.880444;0.520111;, - 0.860342;0.540409;, - 0.840181;0.560930;, - 0.819847;0.561270;, - 0.799396;0.561636;, - 0.880478;0.540224;, - 0.860407;0.560619;, - 0.840284;0.581248;, - 0.819958;0.581700;, - 0.799513;0.582185;, - 0.880535;0.560342;, - 0.860500;0.580836;, - 0.840419;0.601574;, - 0.820104;0.602135;, - 0.799668;0.602738;, - 0.880617;0.580469;, - 0.860623;0.601062;, - 0.840591;0.621909;, - 0.820290;0.622577;, - 0.799864;0.623294;, - 0.880726;0.600606;, - 0.860778;0.621299;, - 0.840804;0.642254;, - 0.820519;0.643027;, - 0.800107;0.643856;, - 0.880863;0.620755;, - 0.860971;0.641549;, - 0.841062;0.662612;, - 0.820798;0.663486;, - 0.800403;0.664424;, - 0.881033;0.640921;, - 0.861205;0.661815;, - 0.841373;0.682984;, - 0.821135;0.683955;, - 0.800760;0.684997;, - 0.881239;0.661104;, - 0.861486;0.682097;, - 0.841747;0.703370;, - 0.821539;0.704435;, - 0.801189;0.705577;, - 0.881488;0.681307;, - 0.861824;0.702399;, - 0.842196;0.723773;, - 0.822025;0.724926;, - 0.801704;0.726164;, - 0.881786;0.701532;, - 0.862230;0.722721;, - 0.842736;0.744194;, - 0.822610;0.745430;, - 0.802326;0.746757;, - 0.882143;0.721782;, - 0.862718;0.743065;, - 0.843390;0.764631;, - 0.823319;0.765945;, - 0.803081;0.767355;, - 0.882573;0.742058;, - 0.863309;0.763432;, - 0.844191;0.785087;, - 0.824188;0.786472;, - 0.804006;0.787959;, - 0.883093;0.762362;, - 0.864031;0.783822;, - 0.845182;0.805560;, - 0.825265;0.807010;, - 0.805155;0.808566;, - 0.883727;0.782694;, - 0.864924;0.804237;, - 0.846431;0.826049;, - 0.826625;0.827555;, - 0.806608;0.829172;, - 0.884511;0.803057;, - 0.866047;0.824675;, - 0.848039;0.846550;, - 0.828380;0.848104;, - 0.808489;0.849773;, - 0.885495;0.823449;, - 0.867491;0.845134;, - 0.850174;0.867058;, - 0.830717;0.868649;, - 0.811000;0.870359;, - 0.886759;0.843871;, - 0.869402;0.865609;, - 0.888428;0.864319;, - 0.790996;0.872167;, - 0.788341;0.851535;, - 0.786360;0.830878;, - 0.770677;0.874045;, - 0.767916;0.853363;, - 0.765863;0.832647;, - 0.784833;0.810206;, - 0.783628;0.789526;, - 0.750021;0.875964;, - 0.747195;0.855229;, - 0.745101;0.834450;, - 0.764285;0.811906;, - 0.763043;0.791150;, - 0.782660;0.768842;, - 0.729005;0.877893;, - 0.726161;0.857101;, - 0.724064;0.836258;, - 0.743498;0.813639;, - 0.742238;0.792804;, - 0.762046;0.770381;, - 0.707615;0.879797;, - 0.704806;0.858946;, - 0.702742;0.838037;, - 0.722462;0.815374;, - 0.721206;0.794460;, - 0.741229;0.771949;, - 0.685841;0.881640;, - 0.683123;0.860729;, - 0.681135;0.839755;, - 0.701172;0.817082;, - 0.699943;0.796089;, - 0.720203;0.773519;, - 0.663681;0.883385;, - 0.661115;0.862414;, - 0.659247;0.841377;, - 0.679627;0.818729;, - 0.678451;0.797660;, - 0.698964;0.775063;, - 0.641145;0.884995;, - 0.638793;0.863966;, - 0.637087;0.842869;, - 0.657833;0.820284;, - 0.656733;0.799141;, - 0.677514;0.776551;, - 0.618253;0.886432;, - 0.616176;0.865349;, - 0.614675;0.844197;, - 0.635800;0.821712;, - 0.634801;0.800502;, - 0.655859;0.777955;, - 0.593293;0.866532;, - 0.592037;0.845332;, - 0.613546;0.822983;, - 0.612671;0.801713;, - 0.634008;0.779244;, - 0.570182;0.867484;, - 0.569207;0.846245;, - 0.591094;0.824068;, - 0.590365;0.802746;, - 0.611978;0.780390;, - 0.546892;0.868183;, - 0.546225;0.846914;, - 0.568476;0.824941;, - 0.567911;0.803577;, - 0.589789;0.781368;, - 0.523951;0.889830;, - 0.523478;0.868610;, - 0.523139;0.847323;, - 0.545726;0.825581;, - 0.545341;0.804186;, - 0.567465;0.782155;, - 0.500000;0.911139;, - 0.500000;0.889980;, - 0.500000;0.868753;, - 0.500000;0.847461;, - 0.522886;0.825972;, - 0.476049;0.889830;, - 0.476522;0.868610;, - 0.476861;0.847323;, - 0.477114;0.825972;, - 0.500000;0.826103;, - 0.522691;0.804558;, - 0.452177;0.889384;, - 0.453108;0.868183;, - 0.453775;0.846914;, - 0.454274;0.825581;, - 0.454659;0.804186;, - 0.477309;0.804558;, - 0.428460;0.888655;, - 0.429818;0.867484;, - 0.430793;0.846245;, - 0.431524;0.824941;, - 0.432089;0.803577;, - 0.404964;0.887662;, - 0.406707;0.866532;, - 0.407963;0.845332;, - 0.408906;0.824068;, - 0.409635;0.802746;, - 0.381747;0.886432;, - 0.383824;0.865349;, - 0.385325;0.844197;, - 0.386454;0.822983;, - 0.387329;0.801713;, - 0.358855;0.884995;, - 0.361207;0.863966;, - 0.362913;0.842869;, - 0.364200;0.821712;, - 0.365199;0.800502;, - 0.336319;0.883385;, - 0.338885;0.862414;, - 0.340753;0.841377;, - 0.342167;0.820284;, - 0.343267;0.799141;, - 0.314159;0.881640;, - 0.316877;0.860729;, - 0.318865;0.839755;, - 0.320373;0.818729;, - 0.321549;0.797660;, - 0.292385;0.879797;, - 0.295194;0.858946;, - 0.297258;0.838037;, - 0.298828;0.817082;, - 0.300057;0.796089;, - 0.270995;0.877893;, - 0.273839;0.857101;, - 0.275936;0.836258;, - 0.277538;0.815374;, - 0.278794;0.794460;, - 0.249979;0.875964;, - 0.252805;0.855229;, - 0.254899;0.834450;, - 0.256502;0.813639;, - 0.257762;0.792804;, - 0.229323;0.874045;, - 0.232084;0.853363;, - 0.234137;0.832647;, - 0.235715;0.811906;, - 0.236957;0.791150;, - 0.209004;0.872167;, - 0.211659;0.851535;, - 0.213640;0.830878;, - 0.215167;0.810206;, - 0.216372;0.789526;, - 0.189000;0.870359;, - 0.191511;0.849773;, - 0.193392;0.829172;, - 0.194845;0.808566;, - 0.195994;0.787959;, - 0.169283;0.868649;, - 0.171620;0.848104;, - 0.173375;0.827555;, - 0.174735;0.807010;, - 0.175812;0.786472;, - 0.149825;0.867058;, - 0.151961;0.846550;, - 0.153569;0.826049;, - 0.154818;0.805560;, - 0.155809;0.785087;, - 0.130598;0.865609;, - 0.132509;0.845134;, - 0.133953;0.824675;, - 0.135076;0.804237;, - 0.135969;0.783822;, - 0.136691;0.763432;, - 0.156610;0.764631;, - 0.176681;0.765945;, - 0.137282;0.743065;, - 0.157264;0.744194;, - 0.177390;0.745430;, - 0.196919;0.767355;, - 0.217340;0.768842;, - 0.137770;0.722721;, - 0.157805;0.723773;, - 0.177975;0.724926;, - 0.197674;0.746757;, - 0.218129;0.748155;, - 0.237954;0.770381;, - 0.138176;0.702399;, - 0.158253;0.703370;, - 0.178461;0.704435;, - 0.198296;0.726164;, - 0.218778;0.727468;, - 0.238765;0.749603;, - 0.138514;0.682097;, - 0.158627;0.682984;, - 0.178865;0.683955;, - 0.198811;0.705577;, - 0.219316;0.706781;, - 0.239431;0.728819;, - 0.138795;0.661815;, - 0.158938;0.662612;, - 0.179202;0.663486;, - 0.199240;0.684997;, - 0.219763;0.686096;, - 0.239983;0.708029;, - 0.139029;0.641549;, - 0.159196;0.642254;, - 0.179481;0.643027;, - 0.199597;0.664424;, - 0.220134;0.665413;, - 0.240441;0.687235;, - 0.139222;0.621299;, - 0.159409;0.621909;, - 0.179710;0.622577;, - 0.199893;0.643856;, - 0.220442;0.644731;, - 0.240821;0.666437;, - 0.139377;0.601062;, - 0.159581;0.601574;, - 0.179896;0.602135;, - 0.200136;0.623294;, - 0.220695;0.624051;, - 0.241136;0.645638;, - 0.139500;0.580836;, - 0.159716;0.581248;, - 0.180042;0.581700;, - 0.200332;0.602738;, - 0.220899;0.603373;, - 0.241395;0.624836;, - 0.139593;0.560619;, - 0.159819;0.560930;, - 0.180153;0.561270;, - 0.200487;0.582185;, - 0.221061;0.582696;, - 0.241604;0.604032;, - 0.139658;0.540409;, - 0.159891;0.540617;, - 0.180230;0.540844;, - 0.200604;0.561636;, - 0.221182;0.562021;, - 0.241769;0.583227;, - 0.139697;0.520203;, - 0.159933;0.520307;, - 0.180276;0.520421;, - 0.200686;0.541089;, - 0.221267;0.541347;, - 0.241893;0.562421;, - 0.139710;0.500000;, - 0.159947;0.500000;, - 0.180291;0.500000;, - 0.200735;0.520544;, - 0.221318;0.520673;, - 0.241980;0.541614;, - 0.139697;0.479797;, - 0.159933;0.479693;, - 0.180276;0.479579;, - 0.200751;0.500000;, - 0.221334;0.500000;, - 0.242032;0.520807;, - 0.139658;0.459591;, - 0.159891;0.459383;, - 0.180230;0.459156;, - 0.200735;0.479456;, - 0.221318;0.479327;, - 0.242049;0.500000;, - 0.139593;0.439381;, - 0.159819;0.439070;, - 0.180153;0.438730;, - 0.200686;0.458911;, - 0.221267;0.458653;, - 0.242032;0.479193;, - 0.139500;0.419164;, - 0.159716;0.418752;, - 0.180042;0.418300;, - 0.200604;0.438365;, - 0.221182;0.437979;, - 0.241980;0.458386;, - 0.139377;0.398938;, - 0.159581;0.398426;, - 0.179896;0.397865;, - 0.200487;0.417815;, - 0.221061;0.417304;, - 0.241893;0.437579;, - 0.139222;0.378701;, - 0.159409;0.378091;, - 0.179710;0.377423;, - 0.200332;0.397263;, - 0.220899;0.396627;, - 0.241769;0.416773;, - 0.139029;0.358451;, - 0.159196;0.357746;, - 0.179481;0.356973;, - 0.200136;0.376706;, - 0.220695;0.375949;, - 0.241604;0.395968;, - 0.138795;0.338185;, - 0.158938;0.337388;, - 0.179202;0.336514;, - 0.199893;0.356144;, - 0.220442;0.355269;, - 0.241395;0.375165;, - 0.138514;0.317903;, - 0.158627;0.317016;, - 0.178865;0.316045;, - 0.199597;0.335576;, - 0.220134;0.334587;, - 0.241136;0.354362;, - 0.138176;0.297601;, - 0.158253;0.296630;, - 0.178461;0.295565;, - 0.199240;0.315003;, - 0.219763;0.313904;, - 0.240821;0.333563;, - 0.137770;0.277279;, - 0.157805;0.276227;, - 0.177975;0.275074;, - 0.198811;0.294423;, - 0.219316;0.293219;, - 0.240441;0.312765;, - 0.137282;0.256935;, - 0.157264;0.255806;, - 0.177390;0.254570;, - 0.198296;0.273836;, - 0.218778;0.272532;, - 0.239983;0.291971;, - 0.136691;0.236568;, - 0.156610;0.235368;, - 0.176681;0.234055;, - 0.197674;0.253243;, - 0.218129;0.251845;, - 0.239431;0.271181;, - 0.135969;0.216178;, - 0.155809;0.214913;, - 0.175812;0.213528;, - 0.196919;0.232644;, - 0.217340;0.231158;, - 0.238765;0.250397;, - 0.135076;0.195763;, - 0.154818;0.194440;, - 0.174735;0.192990;, - 0.195994;0.212041;, - 0.216372;0.210474;, - 0.237954;0.229619;, - 0.133953;0.175325;, - 0.153569;0.173951;, - 0.173375;0.172445;, - 0.194845;0.191434;, - 0.215167;0.189794;, - 0.236957;0.208850;, - 0.132509;0.154866;, - 0.151961;0.153450;, - 0.171620;0.151896;, - 0.193392;0.170828;, - 0.213640;0.169122;, - 0.235715;0.188094;, - 0.130598;0.134391;, - 0.149825;0.132942;, - 0.169283;0.131351;, - 0.191511;0.150227;, - 0.211659;0.148465;, - 0.234137;0.167353;, - 0.189000;0.129641;, - 0.209004;0.127833;, - 0.232084;0.146637;, - 0.254899;0.165550;, - 0.256502;0.186361;, - 0.229323;0.125955;, - 0.252805;0.144771;, - 0.275936;0.163742;, - 0.277538;0.184626;, - 0.278794;0.205540;, - 0.257762;0.207196;, - 0.249979;0.124036;, - 0.273839;0.142899;, - 0.297258;0.161963;, - 0.298828;0.182918;, - 0.300057;0.203911;, - 0.270995;0.122107;, - 0.295194;0.141054;, - 0.318865;0.160245;, - 0.320373;0.181271;, - 0.321549;0.202340;, - 0.292385;0.120203;, - 0.316877;0.139271;, - 0.340753;0.158623;, - 0.342167;0.179716;, - 0.343267;0.200859;, - 0.314159;0.118360;, - 0.338885;0.137586;, - 0.362913;0.157131;, - 0.364200;0.178288;, - 0.365199;0.199498;, - 0.336319;0.116615;, - 0.361207;0.136034;, - 0.385325;0.155803;, - 0.386454;0.177017;, - 0.387329;0.198287;, - 0.408906;0.175932;, - 0.409635;0.197254;, - 0.410211;0.218632;, - 0.388022;0.219610;, - 0.365992;0.220756;, - 0.432089;0.196423;, - 0.432535;0.217845;, - 0.432894;0.239322;, - 0.410675;0.240062;, - 0.388580;0.240982;, - 0.454963;0.217269;, - 0.455207;0.238780;, - 0.455406;0.260346;, - 0.433185;0.260851;, - 0.411053;0.261541;, - 0.477587;0.238450;, - 0.477688;0.260038;, - 0.477770;0.281677;, - 0.455569;0.281962;, - 0.433425;0.282429;, - 0.500000;0.259934;, - 0.500000;0.281581;, - 0.500000;0.303277;, - 0.477838;0.303364;, - 0.455704;0.303625;, - 0.522312;0.260038;, - 0.522230;0.281677;, - 0.522162;0.303364;, - 0.500000;0.325017;, - 0.477894;0.325096;, - 0.544594;0.260346;, - 0.544431;0.281962;, - 0.544296;0.303625;, - 0.522106;0.325096;, - 0.500000;0.346798;, - 0.566815;0.260851;, - 0.566575;0.282429;, - 0.566377;0.304051;, - 0.544185;0.325331;, - 0.522059;0.346868;, - 0.588947;0.261541;, - 0.588636;0.283066;, - 0.588380;0.304633;, - 0.566214;0.325715;, - 0.544094;0.347076;, - 0.610965;0.262399;, - 0.610591;0.283859;, - 0.610282;0.305358;, - 0.588168;0.326240;, - 0.566079;0.347416;, - 0.632847;0.263405;, - 0.632418;0.284788;, - 0.632063;0.306206;, - 0.610026;0.326892;, - 0.587993;0.347881;, - 0.654576;0.264536;, - 0.654101;0.285833;, - 0.653708;0.307160;, - 0.631770;0.327657;, - 0.609816;0.348458;, - 0.676137;0.265767;, - 0.675627;0.286970;, - 0.675204;0.308199;, - 0.653383;0.328516;, - 0.631528;0.349135;, - 0.697521;0.267073;, - 0.696985;0.288177;, - 0.696541;0.309301;, - 0.674854;0.329452;, - 0.653115;0.349896;, - 0.718721;0.268428;, - 0.718170;0.289428;, - 0.717713;0.310444;, - 0.696173;0.330444;, - 0.674565;0.350725;, - 0.739737;0.269805;, - 0.739181;0.290700;, - 0.738719;0.311605;, - 0.717334;0.331473;, - 0.695868;0.351603;, - 0.760569;0.271181;, - 0.760017;0.291971;, - 0.759559;0.312765;, - 0.738336;0.332518;, - 0.717021;0.352513;, - 0.781222;0.272532;, - 0.780684;0.293219;, - 0.780237;0.313904;, - 0.759179;0.333563;, - 0.738019;0.353439;, - 0.779866;0.334587;, - 0.758864;0.354362;, - 0.737759;0.374365;, - 0.716764;0.373564;, - 0.695619;0.372776;, - 0.779558;0.355269;, - 0.758605;0.375165;, - 0.737549;0.395297;, - 0.716556;0.394624;, - 0.695418;0.393961;, - 0.779305;0.375949;, - 0.758396;0.395968;, - 0.737383;0.416232;, - 0.716392;0.415690;, - 0.695259;0.415157;, - 0.779101;0.396627;, - 0.758231;0.416773;, - 0.737258;0.437171;, - 0.716269;0.436763;, - 0.695139;0.436360;, - 0.778939;0.417304;, - 0.758107;0.437579;, - 0.737170;0.458113;, - 0.716182;0.457839;, - 0.695056;0.457570;, - 0.778818;0.437979;, - 0.758020;0.458386;, - 0.737119;0.479056;, - 0.716131;0.478919;, - 0.695006;0.478784;, - 0.778733;0.458653;, - 0.757968;0.479193;, - 0.737102;0.500000;, - 0.716115;0.500000;, - 0.694990;0.500000;, - 0.778682;0.479327;, - 0.757951;0.500000;, - 0.737119;0.520944;, - 0.716131;0.521081;, - 0.695006;0.521216;, - 0.778665;0.500000;, - 0.757968;0.520807;, - 0.737170;0.541887;, - 0.716182;0.542161;, - 0.695056;0.542430;, - 0.778682;0.520673;, - 0.758020;0.541614;, - 0.737258;0.562829;, - 0.716269;0.563237;, - 0.695139;0.563639;, - 0.778733;0.541347;, - 0.758107;0.562421;, - 0.737383;0.583768;, - 0.716392;0.584310;, - 0.695259;0.584843;, - 0.778818;0.562021;, - 0.758231;0.583227;, - 0.737549;0.604703;, - 0.716556;0.605376;, - 0.695418;0.606039;, - 0.778939;0.582696;, - 0.758396;0.604032;, - 0.737759;0.625635;, - 0.716764;0.626436;, - 0.695619;0.627224;, - 0.779101;0.603373;, - 0.758605;0.624836;, - 0.738019;0.646561;, - 0.717021;0.647487;, - 0.695868;0.648397;, - 0.779305;0.624051;, - 0.758864;0.645638;, - 0.738336;0.667482;, - 0.717334;0.668528;, - 0.696173;0.669556;, - 0.779558;0.644731;, - 0.759179;0.666437;, - 0.738719;0.688395;, - 0.717713;0.689556;, - 0.696541;0.690699;, - 0.779866;0.665413;, - 0.759559;0.687235;, - 0.739181;0.709299;, - 0.718170;0.710572;, - 0.696985;0.711823;, - 0.780237;0.686096;, - 0.760017;0.708029;, - 0.739737;0.730195;, - 0.718721;0.731572;, - 0.697521;0.732927;, - 0.780684;0.706781;, - 0.760569;0.728819;, - 0.740410;0.751078;, - 0.719389;0.752555;, - 0.698170;0.754008;, - 0.781222;0.727468;, - 0.761235;0.749603;, - 0.781871;0.748155;, - 0.676757;0.755408;, - 0.676137;0.734233;, - 0.675627;0.713030;, - 0.655153;0.756728;, - 0.654576;0.735464;, - 0.654101;0.714167;, - 0.675204;0.691801;, - 0.674854;0.670548;, - 0.633369;0.757940;, - 0.632847;0.736595;, - 0.632418;0.715212;, - 0.653708;0.692839;, - 0.653383;0.671484;, - 0.674565;0.649275;, - 0.611420;0.759018;, - 0.610965;0.737601;, - 0.610591;0.716141;, - 0.632063;0.693794;, - 0.631770;0.672343;, - 0.653115;0.650104;, - 0.589325;0.759938;, - 0.588947;0.738459;, - 0.588636;0.716934;, - 0.610282;0.694642;, - 0.610026;0.673108;, - 0.631528;0.650865;, - 0.567106;0.760678;, - 0.566815;0.739149;, - 0.566575;0.717571;, - 0.588380;0.695367;, - 0.588168;0.673760;, - 0.609816;0.651542;, - 0.545037;0.782731;, - 0.544793;0.761220;, - 0.544594;0.739654;, - 0.544431;0.718038;, - 0.566377;0.695949;, - 0.522537;0.783083;, - 0.522413;0.761550;, - 0.522312;0.739962;, - 0.522230;0.718323;, - 0.544296;0.696375;, - 0.566214;0.674285;, - 0.500000;0.804682;, - 0.500000;0.783201;, - 0.500000;0.761661;, - 0.500000;0.740066;, - 0.500000;0.718419;, - 0.522162;0.696636;, - 0.477463;0.783083;, - 0.477587;0.761550;, - 0.477688;0.739962;, - 0.477770;0.718323;, - 0.477838;0.696636;, - 0.500000;0.696723;, - 0.454963;0.782731;, - 0.455207;0.761220;, - 0.455406;0.739654;, - 0.455569;0.718038;, - 0.455704;0.696375;, - 0.432535;0.782155;, - 0.432894;0.760678;, - 0.433185;0.739149;, - 0.433425;0.717571;, - 0.433623;0.695949;, - 0.410211;0.781368;, - 0.410675;0.759938;, - 0.411053;0.738459;, - 0.411364;0.716934;, - 0.411620;0.695367;, - 0.388022;0.780390;, - 0.388580;0.759018;, - 0.389035;0.737601;, - 0.389409;0.716141;, - 0.389718;0.694642;, - 0.365992;0.779244;, - 0.366631;0.757940;, - 0.367153;0.736595;, - 0.367582;0.715212;, - 0.367937;0.693794;, - 0.344141;0.777955;, - 0.344847;0.756728;, - 0.345424;0.735464;, - 0.345899;0.714167;, - 0.346292;0.692839;, - 0.322486;0.776551;, - 0.323243;0.755408;, - 0.323863;0.734233;, - 0.324373;0.713030;, - 0.324796;0.691801;, - 0.301036;0.775063;, - 0.301830;0.754008;, - 0.302479;0.732927;, - 0.303015;0.711823;, - 0.303459;0.690699;, - 0.279797;0.773519;, - 0.280611;0.752555;, - 0.281279;0.731572;, - 0.281830;0.710572;, - 0.282287;0.689556;, - 0.258771;0.771949;, - 0.259590;0.751078;, - 0.260263;0.730195;, - 0.260819;0.709299;, - 0.261281;0.688395;, - 0.261664;0.667482;, - 0.282666;0.668528;, - 0.303827;0.669556;, - 0.261981;0.646561;, - 0.282979;0.647487;, - 0.304132;0.648397;, - 0.325146;0.670548;, - 0.346617;0.671484;, - 0.262241;0.625635;, - 0.283236;0.626436;, - 0.304381;0.627224;, - 0.325435;0.649275;, - 0.346885;0.650104;, - 0.368230;0.672343;, - 0.262451;0.604703;, - 0.283444;0.605376;, - 0.304582;0.606039;, - 0.325672;0.627984;, - 0.347105;0.628701;, - 0.368472;0.650865;, - 0.262617;0.583768;, - 0.283608;0.584310;, - 0.304741;0.584843;, - 0.325864;0.606678;, - 0.347282;0.607280;, - 0.368670;0.629360;, - 0.262742;0.562829;, - 0.283731;0.563237;, - 0.304861;0.563639;, - 0.326014;0.585358;, - 0.347422;0.585843;, - 0.368830;0.607834;, - 0.262830;0.541887;, - 0.283818;0.542161;, - 0.304944;0.542430;, - 0.326128;0.564028;, - 0.347527;0.564394;, - 0.368956;0.586290;, - 0.262881;0.520944;, - 0.283869;0.521081;, - 0.304994;0.521216;, - 0.326207;0.542689;, - 0.347601;0.542935;, - 0.369051;0.564730;, - 0.262898;0.500000;, - 0.283886;0.500000;, - 0.305010;0.500000;, - 0.326254;0.521346;, - 0.347644;0.521469;, - 0.369117;0.543160;, - 0.262881;0.479056;, - 0.283869;0.478919;, - 0.304994;0.478784;, - 0.326270;0.500000;, - 0.347659;0.500000;, - 0.369156;0.521582;, - 0.262830;0.458113;, - 0.283818;0.457839;, - 0.304944;0.457570;, - 0.326254;0.478654;, - 0.347644;0.478531;, - 0.369169;0.500000;, - 0.262742;0.437171;, - 0.283731;0.436763;, - 0.304861;0.436360;, - 0.326207;0.457311;, - 0.347601;0.457065;, - 0.369156;0.478418;, - 0.262617;0.416232;, - 0.283608;0.415690;, - 0.304741;0.415157;, - 0.326128;0.435972;, - 0.347527;0.435606;, - 0.369117;0.456840;, - 0.262451;0.395297;, - 0.283444;0.394624;, - 0.304582;0.393961;, - 0.326014;0.414642;, - 0.347422;0.414157;, - 0.369051;0.435270;, - 0.262241;0.374365;, - 0.283236;0.373564;, - 0.304381;0.372776;, - 0.325864;0.393322;, - 0.347282;0.392720;, - 0.368956;0.413710;, - 0.261981;0.353439;, - 0.282979;0.352513;, - 0.304132;0.351603;, - 0.325672;0.372016;, - 0.347105;0.371299;, - 0.368830;0.392166;, - 0.261664;0.332518;, - 0.282666;0.331473;, - 0.303827;0.330444;, - 0.325435;0.350725;, - 0.346885;0.349896;, - 0.368670;0.370640;, - 0.261281;0.311605;, - 0.282287;0.310444;, - 0.303459;0.309301;, - 0.325146;0.329452;, - 0.346617;0.328516;, - 0.368472;0.349135;, - 0.260819;0.290700;, - 0.281830;0.289428;, - 0.303015;0.288177;, - 0.324796;0.308199;, - 0.346292;0.307160;, - 0.368230;0.327657;, - 0.260263;0.269805;, - 0.281279;0.268428;, - 0.302479;0.267073;, - 0.324373;0.286970;, - 0.345899;0.285833;, - 0.367937;0.306206;, - 0.259590;0.248922;, - 0.280611;0.247445;, - 0.301830;0.245992;, - 0.323863;0.265767;, - 0.345424;0.264536;, - 0.367582;0.284788;, - 0.258771;0.228051;, - 0.279797;0.226481;, - 0.301036;0.224937;, - 0.323243;0.244592;, - 0.344847;0.243272;, - 0.367153;0.263405;, - 0.322486;0.223449;, - 0.344141;0.222045;, - 0.366631;0.242060;, - 0.389035;0.262399;, - 0.389409;0.283859;, - 0.411364;0.283066;, - 0.411620;0.304633;, - 0.389718;0.305358;, - 0.389974;0.326892;, - 0.433623;0.304051;, - 0.433786;0.325715;, - 0.411832;0.326240;, - 0.412007;0.347881;, - 0.390184;0.348458;, - 0.455815;0.325331;, - 0.455906;0.347076;, - 0.433921;0.347416;, - 0.434031;0.369151;, - 0.412149;0.369553;, - 0.390357;0.370053;, - 0.477941;0.346868;, - 0.477979;0.368676;, - 0.455981;0.368856;, - 0.456042;0.390666;, - 0.434120;0.390914;, - 0.412265;0.391252;, - 0.500000;0.368615;, - 0.500000;0.390464;, - 0.478009;0.390515;, - 0.478033;0.412380;, - 0.456089;0.412502;, - 0.434189;0.412701;, - 0.522021;0.368676;, - 0.521991;0.390515;, - 0.500000;0.412339;, - 0.500000;0.434235;, - 0.478051;0.434266;, - 0.456125;0.434358;, - 0.544019;0.368856;, - 0.543958;0.390666;, - 0.521967;0.412380;, - 0.521949;0.434266;, - 0.500000;0.456148;, - 0.478064;0.456168;, - 0.565969;0.369151;, - 0.565880;0.390914;, - 0.543911;0.412502;, - 0.543875;0.434358;, - 0.521936;0.456168;, - 0.500000;0.478071;, - 0.587851;0.369553;, - 0.587735;0.391252;, - 0.565811;0.412701;, - 0.565758;0.434509;, - 0.543850;0.456230;, - 0.521929;0.478081;, - 0.609643;0.370053;, - 0.609504;0.391673;, - 0.587645;0.412974;, - 0.587577;0.434714;, - 0.565721;0.456331;, - 0.543836;0.478112;, - 0.631330;0.370640;, - 0.631170;0.392166;, - 0.609395;0.413313;, - 0.609312;0.434970;, - 0.587529;0.456469;, - 0.565700;0.478163;, - 0.652895;0.371299;, - 0.652718;0.392720;, - 0.631044;0.413710;, - 0.630949;0.435270;, - 0.609255;0.456640;, - 0.587501;0.478232;, - 0.674328;0.372016;, - 0.674136;0.393322;, - 0.652578;0.414157;, - 0.652473;0.435606;, - 0.630883;0.456840;, - 0.609221;0.478318;, - 0.673986;0.414642;, - 0.673872;0.435972;, - 0.652399;0.457065;, - 0.630844;0.478418;, - 0.609209;0.500000;, - 0.587491;0.500000;, - 0.673793;0.457311;, - 0.652356;0.478531;, - 0.630831;0.500000;, - 0.609221;0.521682;, - 0.587501;0.521768;, - 0.673746;0.478654;, - 0.652341;0.500000;, - 0.630844;0.521582;, - 0.609255;0.543360;, - 0.587529;0.543531;, - 0.673730;0.500000;, - 0.652356;0.521469;, - 0.630883;0.543160;, - 0.609312;0.565030;, - 0.587577;0.565286;, - 0.673746;0.521346;, - 0.652399;0.542935;, - 0.630949;0.564730;, - 0.609395;0.586687;, - 0.587645;0.587026;, - 0.673793;0.542689;, - 0.652473;0.564394;, - 0.631044;0.586290;, - 0.609504;0.608327;, - 0.587735;0.608748;, - 0.673872;0.564028;, - 0.652578;0.585843;, - 0.631170;0.607834;, - 0.609643;0.629947;, - 0.587851;0.630447;, - 0.673986;0.585358;, - 0.652718;0.607280;, - 0.631330;0.629360;, - 0.587993;0.652119;, - 0.674136;0.606678;, - 0.652895;0.628701;, - 0.674328;0.627984;, - 0.566079;0.652584;, - 0.565969;0.630849;, - 0.565880;0.609086;, - 0.544185;0.674669;, - 0.544094;0.652924;, - 0.544019;0.631144;, - 0.543958;0.609334;, - 0.565811;0.587299;, - 0.522106;0.674904;, - 0.522059;0.653132;, - 0.522021;0.631324;, - 0.521991;0.609485;, - 0.543911;0.587498;, - 0.565758;0.565491;, - 0.500000;0.674983;, - 0.500000;0.653202;, - 0.500000;0.631385;, - 0.500000;0.609536;, - 0.521967;0.587620;, - 0.543875;0.565642;, - 0.477894;0.674904;, - 0.477941;0.653132;, - 0.477979;0.631324;, - 0.478009;0.609485;, - 0.478033;0.587620;, - 0.500000;0.587661;, - 0.455815;0.674669;, - 0.455906;0.652924;, - 0.455981;0.631144;, - 0.456042;0.609334;, - 0.456089;0.587498;, - 0.433786;0.674285;, - 0.433921;0.652584;, - 0.434031;0.630849;, - 0.434120;0.609086;, - 0.434189;0.587299;, - 0.411832;0.673760;, - 0.412007;0.652119;, - 0.412149;0.630447;, - 0.412265;0.608748;, - 0.412355;0.587026;, - 0.389974;0.673108;, - 0.390184;0.651542;, - 0.390357;0.629947;, - 0.390496;0.608327;, - 0.390605;0.586687;, - 0.390688;0.565030;, - 0.412423;0.565286;, - 0.434242;0.565491;, - 0.390745;0.543360;, - 0.412471;0.543531;, - 0.434279;0.543669;, - 0.456125;0.565642;, - 0.478051;0.565734;, - 0.390779;0.521682;, - 0.412499;0.521768;, - 0.434300;0.521837;, - 0.456150;0.543770;, - 0.478064;0.543832;, - 0.500000;0.565765;, - 0.390791;0.500000;, - 0.412509;0.500000;, - 0.434308;0.500000;, - 0.456164;0.521888;, - 0.478071;0.521919;, - 0.500000;0.543852;, - 0.390779;0.478318;, - 0.412499;0.478232;, - 0.434300;0.478163;, - 0.456169;0.500000;, - 0.478074;0.500000;, - 0.500000;0.521929;, - 0.390745;0.456640;, - 0.412471;0.456469;, - 0.434279;0.456331;, - 0.456164;0.478112;, - 0.478071;0.478081;, - 0.500000;0.500000;, - 0.390688;0.434970;, - 0.412423;0.434714;, - 0.434242;0.434509;, - 0.456150;0.456230;, - 0.390605;0.413313;, - 0.412355;0.412974;, - 0.390496;0.391673;, - 0.521926;0.500000;, - 0.521929;0.521919;, - 0.521936;0.543832;, - 0.543831;0.500000;, - 0.543836;0.521888;, - 0.543850;0.543770;, - 0.521949;0.565734;, - 0.565692;0.500000;, - 0.565700;0.521837;, - 0.565721;0.543669;; - } - - MeshMaterialList { - 1; - 4512; - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0; - - Material { - 1.000000;1.000000;1.000000;1.000000;; - 51.200000; - 0.000000;0.000000;0.000000;; - 0.000000;0.000000;0.000000;; - - TextureFilename { - "earth.jpg"; - } - } - } - } - } -} - -AnimationSet AnimationSet_sphere { - - - Animation { - - - AnimationKey { - 0; - 61; - 0;4;1.000000,0.000000,0.000000,0.000000;;, - 1;4;1.000000,0.000000,0.000000,0.000000;;, - 2;4;1.000000,0.000000,0.000000,0.000000;;, - 3;4;1.000000,0.000000,0.000000,0.000000;;, - 4;4;1.000000,0.000000,0.000000,0.000000;;, - 5;4;1.000000,0.000000,0.000000,0.000000;;, - 6;4;1.000000,0.000000,0.000000,0.000000;;, - 7;4;1.000000,0.000000,0.000000,0.000000;;, - 8;4;1.000000,0.000000,0.000000,0.000000;;, - 9;4;1.000000,0.000000,0.000000,0.000000;;, - 10;4;1.000000,0.000000,0.000000,0.000000;;, - 11;4;1.000000,0.000000,0.000000,0.000000;;, - 12;4;1.000000,0.000000,0.000000,0.000000;;, - 13;4;1.000000,0.000000,0.000000,0.000000;;, - 14;4;1.000000,0.000000,0.000000,0.000000;;, - 15;4;1.000000,0.000000,0.000000,0.000000;;, - 16;4;1.000000,0.000000,0.000000,0.000000;;, - 17;4;1.000000,0.000000,0.000000,0.000000;;, - 18;4;1.000000,0.000000,0.000000,0.000000;;, - 19;4;1.000000,0.000000,0.000000,0.000000;;, - 20;4;1.000000,0.000000,0.000000,0.000000;;, - 21;4;1.000000,0.000000,0.000000,0.000000;;, - 22;4;1.000000,0.000000,0.000000,0.000000;;, - 23;4;1.000000,0.000000,0.000000,0.000000;;, - 24;4;1.000000,0.000000,0.000000,0.000000;;, - 25;4;1.000000,0.000000,0.000000,0.000000;;, - 26;4;1.000000,0.000000,0.000000,0.000000;;, - 27;4;1.000000,0.000000,0.000000,0.000000;;, - 28;4;1.000000,0.000000,0.000000,0.000000;;, - 29;4;1.000000,0.000000,0.000000,0.000000;;, - 30;4;1.000000,0.000000,0.000000,0.000000;;, - 31;4;1.000000,0.000000,0.000000,0.000000;;, - 32;4;1.000000,0.000000,0.000000,0.000000;;, - 33;4;1.000000,0.000000,0.000000,0.000000;;, - 34;4;1.000000,0.000000,0.000000,0.000000;;, - 35;4;1.000000,0.000000,0.000000,0.000000;;, - 36;4;1.000000,0.000000,0.000000,0.000000;;, - 37;4;1.000000,0.000000,0.000000,0.000000;;, - 38;4;1.000000,0.000000,0.000000,0.000000;;, - 39;4;1.000000,0.000000,0.000000,0.000000;;, - 40;4;1.000000,0.000000,0.000000,0.000000;;, - 41;4;1.000000,0.000000,0.000000,0.000000;;, - 42;4;1.000000,0.000000,0.000000,0.000000;;, - 43;4;1.000000,0.000000,0.000000,0.000000;;, - 44;4;1.000000,0.000000,0.000000,0.000000;;, - 45;4;1.000000,0.000000,0.000000,0.000000;;, - 46;4;1.000000,0.000000,0.000000,0.000000;;, - 47;4;1.000000,0.000000,0.000000,0.000000;;, - 48;4;1.000000,0.000000,0.000000,0.000000;;, - 49;4;1.000000,0.000000,0.000000,0.000000;;, - 50;4;1.000000,0.000000,0.000000,0.000000;;, - 51;4;1.000000,0.000000,0.000000,0.000000;;, - 52;4;1.000000,0.000000,0.000000,0.000000;;, - 53;4;1.000000,0.000000,0.000000,0.000000;;, - 54;4;1.000000,0.000000,0.000000,0.000000;;, - 55;4;1.000000,0.000000,0.000000,0.000000;;, - 56;4;1.000000,0.000000,0.000000,0.000000;;, - 57;4;1.000000,0.000000,0.000000,0.000000;;, - 58;4;1.000000,0.000000,0.000000,0.000000;;, - 59;4;1.000000,0.000000,0.000000,0.000000;;, - 60;4;1.000000,0.000000,0.000000,0.000000;;; - } - - AnimationKey { - 1; - 61; - 0;3;1.000000,1.000000,1.000000;;, - 1;3;1.000000,1.000000,1.000000;;, - 2;3;1.000000,1.000000,1.000000;;, - 3;3;1.000000,1.000000,1.000000;;, - 4;3;1.000000,1.000000,1.000000;;, - 5;3;1.000000,1.000000,1.000000;;, - 6;3;1.000000,1.000000,1.000000;;, - 7;3;1.000000,1.000000,1.000000;;, - 8;3;1.000000,1.000000,1.000000;;, - 9;3;1.000000,1.000000,1.000000;;, - 10;3;1.000000,1.000000,1.000000;;, - 11;3;1.000000,1.000000,1.000000;;, - 12;3;1.000000,1.000000,1.000000;;, - 13;3;1.000000,1.000000,1.000000;;, - 14;3;1.000000,1.000000,1.000000;;, - 15;3;1.000000,1.000000,1.000000;;, - 16;3;1.000000,1.000000,1.000000;;, - 17;3;1.000000,1.000000,1.000000;;, - 18;3;1.000000,1.000000,1.000000;;, - 19;3;1.000000,1.000000,1.000000;;, - 20;3;1.000000,1.000000,1.000000;;, - 21;3;1.000000,1.000000,1.000000;;, - 22;3;1.000000,1.000000,1.000000;;, - 23;3;1.000000,1.000000,1.000000;;, - 24;3;1.000000,1.000000,1.000000;;, - 25;3;1.000000,1.000000,1.000000;;, - 26;3;1.000000,1.000000,1.000000;;, - 27;3;1.000000,1.000000,1.000000;;, - 28;3;1.000000,1.000000,1.000000;;, - 29;3;1.000000,1.000000,1.000000;;, - 30;3;1.000000,1.000000,1.000000;;, - 31;3;1.000000,1.000000,1.000000;;, - 32;3;1.000000,1.000000,1.000000;;, - 33;3;1.000000,1.000000,1.000000;;, - 34;3;1.000000,1.000000,1.000000;;, - 35;3;1.000000,1.000000,1.000000;;, - 36;3;1.000000,1.000000,1.000000;;, - 37;3;1.000000,1.000000,1.000000;;, - 38;3;1.000000,1.000000,1.000000;;, - 39;3;1.000000,1.000000,1.000000;;, - 40;3;1.000000,1.000000,1.000000;;, - 41;3;1.000000,1.000000,1.000000;;, - 42;3;1.000000,1.000000,1.000000;;, - 43;3;1.000000,1.000000,1.000000;;, - 44;3;1.000000,1.000000,1.000000;;, - 45;3;1.000000,1.000000,1.000000;;, - 46;3;1.000000,1.000000,1.000000;;, - 47;3;1.000000,1.000000,1.000000;;, - 48;3;1.000000,1.000000,1.000000;;, - 49;3;1.000000,1.000000,1.000000;;, - 50;3;1.000000,1.000000,1.000000;;, - 51;3;1.000000,1.000000,1.000000;;, - 52;3;1.000000,1.000000,1.000000;;, - 53;3;1.000000,1.000000,1.000000;;, - 54;3;1.000000,1.000000,1.000000;;, - 55;3;1.000000,1.000000,1.000000;;, - 56;3;1.000000,1.000000,1.000000;;, - 57;3;1.000000,1.000000,1.000000;;, - 58;3;1.000000,1.000000,1.000000;;, - 59;3;1.000000,1.000000,1.000000;;, - 60;3;1.000000,1.000000,1.000000;;; - } - - AnimationKey { - 2; - 61; - 0;3;0.000000,0.000000,0.000000;;, - 1;3;0.000000,0.000000,0.000000;;, - 2;3;0.000000,0.000000,0.000000;;, - 3;3;0.000000,0.000000,0.000000;;, - 4;3;0.000000,0.000000,0.000000;;, - 5;3;0.000000,0.000000,0.000000;;, - 6;3;0.000000,0.000000,0.000000;;, - 7;3;0.000000,0.000000,0.000000;;, - 8;3;0.000000,0.000000,0.000000;;, - 9;3;0.000000,0.000000,0.000000;;, - 10;3;0.000000,0.000000,0.000000;;, - 11;3;0.000000,0.000000,0.000000;;, - 12;3;0.000000,0.000000,0.000000;;, - 13;3;0.000000,0.000000,0.000000;;, - 14;3;0.000000,0.000000,0.000000;;, - 15;3;0.000000,0.000000,0.000000;;, - 16;3;0.000000,0.000000,0.000000;;, - 17;3;0.000000,0.000000,0.000000;;, - 18;3;0.000000,0.000000,0.000000;;, - 19;3;0.000000,0.000000,0.000000;;, - 20;3;0.000000,0.000000,0.000000;;, - 21;3;0.000000,0.000000,0.000000;;, - 22;3;0.000000,0.000000,0.000000;;, - 23;3;0.000000,0.000000,0.000000;;, - 24;3;0.000000,0.000000,0.000000;;, - 25;3;0.000000,0.000000,0.000000;;, - 26;3;0.000000,0.000000,0.000000;;, - 27;3;0.000000,0.000000,0.000000;;, - 28;3;0.000000,0.000000,0.000000;;, - 29;3;0.000000,0.000000,0.000000;;, - 30;3;0.000000,0.000000,0.000000;;, - 31;3;0.000000,0.000000,0.000000;;, - 32;3;0.000000,0.000000,0.000000;;, - 33;3;0.000000,0.000000,0.000000;;, - 34;3;0.000000,0.000000,0.000000;;, - 35;3;0.000000,0.000000,0.000000;;, - 36;3;0.000000,0.000000,0.000000;;, - 37;3;0.000000,0.000000,0.000000;;, - 38;3;0.000000,0.000000,0.000000;;, - 39;3;0.000000,0.000000,0.000000;;, - 40;3;0.000000,0.000000,0.000000;;, - 41;3;0.000000,0.000000,0.000000;;, - 42;3;0.000000,0.000000,0.000000;;, - 43;3;0.000000,0.000000,0.000000;;, - 44;3;0.000000,0.000000,0.000000;;, - 45;3;0.000000,0.000000,0.000000;;, - 46;3;0.000000,0.000000,0.000000;;, - 47;3;0.000000,0.000000,0.000000;;, - 48;3;0.000000,0.000000,0.000000;;, - 49;3;0.000000,0.000000,0.000000;;, - 50;3;0.000000,0.000000,0.000000;;, - 51;3;0.000000,0.000000,0.000000;;, - 52;3;0.000000,0.000000,0.000000;;, - 53;3;0.000000,0.000000,0.000000;;, - 54;3;0.000000,0.000000,0.000000;;, - 55;3;0.000000,0.000000,0.000000;;, - 56;3;0.000000,0.000000,0.000000;;, - 57;3;0.000000,0.000000,0.000000;;, - 58;3;0.000000,0.000000,0.000000;;, - 59;3;0.000000,0.000000,0.000000;;, - 60;3;0.000000,0.000000,0.000000;;; - } - { Frame1_sphere_lwo_layer1 } - } -} diff --git a/media/earthbump.jpg b/media/earthbump.jpg deleted file mode 100644 index feb5ae48..00000000 Binary files a/media/earthbump.jpg and /dev/null differ diff --git a/media/enano.jpg b/media/enano.jpg deleted file mode 100644 index b749eb95..00000000 Binary files a/media/enano.jpg and /dev/null differ diff --git a/media/example.irr b/media/example.irr deleted file mode 100644 index 4035bd5b..00000000 Binary files a/media/example.irr and /dev/null differ diff --git a/media/example_screenshots/001shot.jpg b/media/example_screenshots/001shot.jpg deleted file mode 100644 index b7438d61..00000000 Binary files a/media/example_screenshots/001shot.jpg and /dev/null differ diff --git a/media/example_screenshots/002shot.jpg b/media/example_screenshots/002shot.jpg deleted file mode 100644 index a8659aa4..00000000 Binary files a/media/example_screenshots/002shot.jpg and /dev/null differ diff --git a/media/example_screenshots/003shot.jpg b/media/example_screenshots/003shot.jpg deleted file mode 100644 index c4865f1b..00000000 Binary files a/media/example_screenshots/003shot.jpg and /dev/null differ diff --git a/media/example_screenshots/004shot.jpg b/media/example_screenshots/004shot.jpg deleted file mode 100644 index 20091c24..00000000 Binary files a/media/example_screenshots/004shot.jpg and /dev/null differ diff --git a/media/example_screenshots/005shot.jpg b/media/example_screenshots/005shot.jpg deleted file mode 100644 index 9d1c975a..00000000 Binary files a/media/example_screenshots/005shot.jpg and /dev/null differ diff --git a/media/example_screenshots/006shot.jpg b/media/example_screenshots/006shot.jpg deleted file mode 100644 index 8044e075..00000000 Binary files a/media/example_screenshots/006shot.jpg and /dev/null differ diff --git a/media/example_screenshots/007shot.jpg b/media/example_screenshots/007shot.jpg deleted file mode 100644 index 24ce868f..00000000 Binary files a/media/example_screenshots/007shot.jpg and /dev/null differ diff --git a/media/example_screenshots/008shot.jpg b/media/example_screenshots/008shot.jpg deleted file mode 100644 index 529174ba..00000000 Binary files a/media/example_screenshots/008shot.jpg and /dev/null differ diff --git a/media/example_screenshots/009shot.jpg b/media/example_screenshots/009shot.jpg deleted file mode 100644 index 9bfa1958..00000000 Binary files a/media/example_screenshots/009shot.jpg and /dev/null differ diff --git a/media/example_screenshots/010shot.jpg b/media/example_screenshots/010shot.jpg deleted file mode 100644 index 0e798d3f..00000000 Binary files a/media/example_screenshots/010shot.jpg and /dev/null differ diff --git a/media/example_screenshots/011shot.jpg b/media/example_screenshots/011shot.jpg deleted file mode 100644 index 840a599c..00000000 Binary files a/media/example_screenshots/011shot.jpg and /dev/null differ diff --git a/media/example_screenshots/012shot.jpg b/media/example_screenshots/012shot.jpg deleted file mode 100644 index aefd2613..00000000 Binary files a/media/example_screenshots/012shot.jpg and /dev/null differ diff --git a/media/example_screenshots/013shot.jpg b/media/example_screenshots/013shot.jpg deleted file mode 100644 index 49640195..00000000 Binary files a/media/example_screenshots/013shot.jpg and /dev/null differ diff --git a/media/example_screenshots/014shot.jpg b/media/example_screenshots/014shot.jpg deleted file mode 100644 index af6b7c65..00000000 Binary files a/media/example_screenshots/014shot.jpg and /dev/null differ diff --git a/media/example_screenshots/015shot.jpg b/media/example_screenshots/015shot.jpg deleted file mode 100644 index 9de0f8bf..00000000 Binary files a/media/example_screenshots/015shot.jpg and /dev/null differ diff --git a/media/example_screenshots/016shot.jpg b/media/example_screenshots/016shot.jpg deleted file mode 100644 index 58f450f2..00000000 Binary files a/media/example_screenshots/016shot.jpg and /dev/null differ diff --git a/media/example_screenshots/017shot.jpg b/media/example_screenshots/017shot.jpg deleted file mode 100644 index 0ff80d2b..00000000 Binary files a/media/example_screenshots/017shot.jpg and /dev/null differ diff --git a/media/example_screenshots/018shot.jpg b/media/example_screenshots/018shot.jpg deleted file mode 100644 index 0cba94ce..00000000 Binary files a/media/example_screenshots/018shot.jpg and /dev/null differ diff --git a/media/example_screenshots/019shot.jpg b/media/example_screenshots/019shot.jpg deleted file mode 100644 index 8faa9157..00000000 Binary files a/media/example_screenshots/019shot.jpg and /dev/null differ diff --git a/media/example_screenshots/020shot.jpg b/media/example_screenshots/020shot.jpg deleted file mode 100644 index da5d98b8..00000000 Binary files a/media/example_screenshots/020shot.jpg and /dev/null differ diff --git a/media/example_screenshots/021shot.jpg b/media/example_screenshots/021shot.jpg deleted file mode 100644 index 48b28d7f..00000000 Binary files a/media/example_screenshots/021shot.jpg and /dev/null differ diff --git a/media/example_screenshots/022shot.jpg b/media/example_screenshots/022shot.jpg deleted file mode 100644 index c2821974..00000000 Binary files a/media/example_screenshots/022shot.jpg and /dev/null differ diff --git a/media/example_screenshots/023shot.jpg b/media/example_screenshots/023shot.jpg deleted file mode 100644 index 2be47ce4..00000000 Binary files a/media/example_screenshots/023shot.jpg and /dev/null differ diff --git a/media/example_screenshots/024shot.jpg b/media/example_screenshots/024shot.jpg deleted file mode 100644 index 9cfc0d18..00000000 Binary files a/media/example_screenshots/024shot.jpg and /dev/null differ diff --git a/media/example_screenshots/025shot.jpg b/media/example_screenshots/025shot.jpg deleted file mode 100644 index 91c81160..00000000 Binary files a/media/example_screenshots/025shot.jpg and /dev/null differ diff --git a/media/example_screenshots/026shot.jpg b/media/example_screenshots/026shot.jpg deleted file mode 100644 index b2acfcf0..00000000 Binary files a/media/example_screenshots/026shot.jpg and /dev/null differ diff --git a/media/example_screenshots/027shot.jpg b/media/example_screenshots/027shot.jpg deleted file mode 100644 index 274bada7..00000000 Binary files a/media/example_screenshots/027shot.jpg and /dev/null differ diff --git a/media/example_screenshots/028shot.jpg b/media/example_screenshots/028shot.jpg deleted file mode 100644 index 84ee7f31..00000000 Binary files a/media/example_screenshots/028shot.jpg and /dev/null differ diff --git a/media/faerie.md2 b/media/faerie.md2 deleted file mode 100644 index 74ce5a8d..00000000 Binary files a/media/faerie.md2 and /dev/null differ diff --git a/media/faerie2.bmp b/media/faerie2.bmp deleted file mode 100644 index 56a486a6..00000000 Binary files a/media/faerie2.bmp and /dev/null differ diff --git a/media/fire.bmp b/media/fire.bmp deleted file mode 100644 index c33be5ce..00000000 Binary files a/media/fire.bmp and /dev/null differ diff --git a/media/fireball.bmp b/media/fireball.bmp deleted file mode 100644 index f14bdc1e..00000000 Binary files a/media/fireball.bmp and /dev/null differ diff --git a/media/fontcourier.bmp b/media/fontcourier.bmp deleted file mode 100644 index e6dae7e4..00000000 Binary files a/media/fontcourier.bmp and /dev/null differ diff --git a/media/fonthaettenschweiler.bmp b/media/fonthaettenschweiler.bmp deleted file mode 100644 index d2786d8e..00000000 Binary files a/media/fonthaettenschweiler.bmp and /dev/null differ diff --git a/media/fontlucida.png b/media/fontlucida.png deleted file mode 100644 index b81ec9f3..00000000 Binary files a/media/fontlucida.png and /dev/null differ diff --git a/media/gun.jpg b/media/gun.jpg deleted file mode 100644 index 0e954982..00000000 Binary files a/media/gun.jpg and /dev/null differ diff --git a/media/gun.md2 b/media/gun.md2 deleted file mode 100644 index 082d07c7..00000000 Binary files a/media/gun.md2 and /dev/null differ diff --git a/media/help.png b/media/help.png deleted file mode 100644 index f0b909aa..00000000 Binary files a/media/help.png and /dev/null differ diff --git a/media/icon_crosshairs16x16bw1.png b/media/icon_crosshairs16x16bw1.png deleted file mode 100644 index 314bb0f7..00000000 Binary files a/media/icon_crosshairs16x16bw1.png and /dev/null differ diff --git a/media/icon_crosshairs16x16bw2.png b/media/icon_crosshairs16x16bw2.png deleted file mode 100644 index 7aca0717..00000000 Binary files a/media/icon_crosshairs16x16bw2.png and /dev/null differ diff --git a/media/icon_crosshairs16x16bw3.png b/media/icon_crosshairs16x16bw3.png deleted file mode 100644 index 0f82a883..00000000 Binary files a/media/icon_crosshairs16x16bw3.png and /dev/null differ diff --git a/media/icon_crosshairs16x16col.png b/media/icon_crosshairs16x16col.png deleted file mode 100644 index 335ee10e..00000000 Binary files a/media/icon_crosshairs16x16col.png and /dev/null differ diff --git a/media/iconlist.png b/media/iconlist.png deleted file mode 100644 index e22ce8bf..00000000 Binary files a/media/iconlist.png and /dev/null differ diff --git a/media/impact.wav b/media/impact.wav deleted file mode 100644 index 36396179..00000000 Binary files a/media/impact.wav and /dev/null differ diff --git a/media/info_ios.plist b/media/info_ios.plist deleted file mode 100644 index bbd8066e..00000000 --- a/media/info_ios.plist +++ /dev/null @@ -1,46 +0,0 @@ - - - - - CFBundleDevelopmentRegion - en - CFBundleExecutable - $(EXECUTABLE_NAME) - CFBundleIdentifier - $(PRODUCT_BUNDLE_IDENTIFIER) - CFBundleInfoDictionaryVersion - 6.0 - CFBundleName - $(PRODUCT_NAME) - CFBundlePackageType - APPL - CFBundleShortVersionString - 1.0 - CFBundleSignature - ???? - CFBundleVersion - 1 - LSRequiresIPhoneOS - - UILaunchStoryboardName - LaunchScreen - UIRequiredDeviceCapabilities - - armv7 - - UIRequiresFullScreen - - UIStatusBarHidden - - UISupportedInterfaceOrientations - - UIInterfaceOrientationPortrait - - UISupportedInterfaceOrientations~ipad - - UIInterfaceOrientationPortrait - - UIViewControllerBasedStatusBarAppearance - - - diff --git a/media/info_osx.plist b/media/info_osx.plist deleted file mode 100644 index 908cdd4d..00000000 --- a/media/info_osx.plist +++ /dev/null @@ -1,30 +0,0 @@ - - - - - CFBundleDevelopmentRegion - en - CFBundleExecutable - $(EXECUTABLE_NAME) - CFBundleIconFile - - CFBundleIdentifier - $(PRODUCT_BUNDLE_IDENTIFIER) - CFBundleInfoDictionaryVersion - 6.0 - CFBundleName - $(PRODUCT_NAME) - CFBundlePackageType - APPL - CFBundleShortVersionString - 1.0 - CFBundleSignature - ???? - CFBundleVersion - 1 - LSMinimumSystemVersion - $(MACOSX_DEPLOYMENT_TARGET) - NSPrincipalClass - NSApplication - - diff --git a/media/irr.ico b/media/irr.ico deleted file mode 100644 index 49f8eabb..00000000 Binary files a/media/irr.ico and /dev/null differ diff --git a/media/irrlicht.dat b/media/irrlicht.dat deleted file mode 100644 index 30178bd0..00000000 Binary files a/media/irrlicht.dat and /dev/null differ diff --git a/media/irrlicht2_bk.jpg b/media/irrlicht2_bk.jpg deleted file mode 100644 index 509446b8..00000000 Binary files a/media/irrlicht2_bk.jpg and /dev/null differ diff --git a/media/irrlicht2_dn.jpg b/media/irrlicht2_dn.jpg deleted file mode 100644 index 4735dbee..00000000 Binary files a/media/irrlicht2_dn.jpg and /dev/null differ diff --git a/media/irrlicht2_ft.jpg b/media/irrlicht2_ft.jpg deleted file mode 100644 index fdfae236..00000000 Binary files a/media/irrlicht2_ft.jpg and /dev/null differ diff --git a/media/irrlicht2_lf.jpg b/media/irrlicht2_lf.jpg deleted file mode 100644 index 384b269d..00000000 Binary files a/media/irrlicht2_lf.jpg and /dev/null differ diff --git a/media/irrlicht2_rt.jpg b/media/irrlicht2_rt.jpg deleted file mode 100644 index b29e01af..00000000 Binary files a/media/irrlicht2_rt.jpg and /dev/null differ diff --git a/media/irrlicht2_up.jpg b/media/irrlicht2_up.jpg deleted file mode 100644 index 80f30687..00000000 Binary files a/media/irrlicht2_up.jpg and /dev/null differ diff --git a/media/irrlichtlogo.BMP b/media/irrlichtlogo.BMP deleted file mode 100644 index 33193830..00000000 Binary files a/media/irrlichtlogo.BMP and /dev/null differ diff --git a/media/irrlichtlogo.jpg b/media/irrlichtlogo.jpg deleted file mode 100644 index d33c926c..00000000 Binary files a/media/irrlichtlogo.jpg and /dev/null differ diff --git a/media/irrlichtlogo2.png b/media/irrlichtlogo2.png deleted file mode 100644 index 9086b122..00000000 Binary files a/media/irrlichtlogo2.png and /dev/null differ diff --git a/media/irrlichtlogo3.png b/media/irrlichtlogo3.png deleted file mode 100644 index 255b3ac0..00000000 Binary files a/media/irrlichtlogo3.png and /dev/null differ diff --git a/media/irrlichtlogoaligned.jpg b/media/irrlichtlogoaligned.jpg deleted file mode 100644 index ea6deafa..00000000 Binary files a/media/irrlichtlogoaligned.jpg and /dev/null differ diff --git a/media/irrlichtlogoalpha.tga b/media/irrlichtlogoalpha.tga deleted file mode 100644 index 5f58885b..00000000 Binary files a/media/irrlichtlogoalpha.tga and /dev/null differ diff --git a/media/irrlichtlogoalpha2.tga b/media/irrlichtlogoalpha2.tga deleted file mode 100644 index faa6c1a5..00000000 Binary files a/media/irrlichtlogoalpha2.tga and /dev/null differ diff --git a/media/lightFalloff.png b/media/lightFalloff.png deleted file mode 100644 index 21b2142a..00000000 Binary files a/media/lightFalloff.png and /dev/null differ diff --git a/media/lucida.xml b/media/lucida.xml deleted file mode 100644 index 3d18bdab..00000000 Binary files a/media/lucida.xml and /dev/null differ diff --git a/media/lucida0.png b/media/lucida0.png deleted file mode 100644 index 3c176889..00000000 Binary files a/media/lucida0.png and /dev/null differ diff --git a/media/map-20kdm2.pk3 b/media/map-20kdm2.pk3 deleted file mode 100644 index d86083ef..00000000 Binary files a/media/map-20kdm2.pk3 and /dev/null differ diff --git a/media/map-20kdm2.txt b/media/map-20kdm2.txt deleted file mode 100644 index 6db34ffa..00000000 --- a/media/map-20kdm2.txt +++ /dev/null @@ -1,50 +0,0 @@ - --=( Map Information )=- ----------------------------------------------- - - : Return to Castle: Quake -<Date> : 02/02/02 - ren 11/17/2002 -<Filename> : map-20kdm2.pk3 -<Author> : Michael "<|3FG20K>" Cook -<Email Address> : bfg20k@nycap.rr.com / bfg20k@planetquake.com -<Website> : http://www.planetquake.com/bfg20k -<Description> : This is an Evil7 Castle! It has three tiers, - tight spaces, and plenty of room for various - battles. - -<Additional Credits> : [HFX]Evil, for making great textures. - --=( Construction )=- -------------------------------------------------- - -<Base> : None. -<Editor(s) Used> : Q3Radiant - Build 202 & Q3Build -<Known Bugs> : This isn't really a bug, but an added feature; - you can walk on top of the battlements. -<Construction Time> : 3 weeks. -<Compile Machine> : 866mhz PIII, 512mb RAM - --=( Play Information )=- ---------------------------------------------- - -<Mod> : A good one. -<Players> : 2-8 Players -<Bots> : Duh! wait, I THINK they're smarter than Forrest - Gump... You'll have to clarify that for me =). - --={ Installation }=- -------------------------------------------------- - -<Installation> : Unzip the the zip file map-20kdm2.zip into - your "Quake III Arena\baseq3" directory - Run Quake III Arena, and under console type - "/map 20kdm2" or select under Skirmish in - SIngle Player mode. - --=( Copyright / Permissions )=- --------------------------------------- - -<Copyright> : You not include or distribute this map in any - sort of commercial product without permission - from the author. You may not mass distribute - this level via any non-electronic means - including but not limited to compact disks, - and floppy disks without permission from the - author. - --=( This is the End )=- ----------------------------------------------- diff --git a/media/ninja animation ranges.txt b/media/ninja animation ranges.txt deleted file mode 100644 index eaf12fef..00000000 --- a/media/ninja animation ranges.txt +++ /dev/null @@ -1,36 +0,0 @@ -hey guys heres all the ranges for the ninja model, 20 ranges and 300 frames....Phew!! - -you may need to scale or rotate the model and change animation speeds for various 3D game engines... - -Please check the numbers carefully cus they dont follow any order and in between ranges often skip a few frames, this as how I achieved certain moves in Character FX its not a mistake :) - -1-14 Walk (normal) -15-30 Stealth Walk -32-44 Punch and swipe sword -45-59 Swipe and spin sword -60-68 Overhead twohanded downswipe -69-72 Up to block position (play backwards to lower sword if you want) -73-83 Forward kick -84-93 Pick up from floor (or down to crouch at frame 87) -94-102 Jump -103-111 Jump without height (for programmer controlled jumps) -112-125 High jump to Sword Kill (Finish em off move??) -126-133 Side Kick -134-145 Spinning Sword attack (might wanna speed this up in game) -146-158 Backflip -159-165 Climb wall -166-173 Death 1 - Fall back onto ground -174-182 Death 2 - Fall forward onto ground -184-205 Idle 1 - Breathe heavily -206-250 Idle 2 -251-300 Idle 3 - -Ok there it is, have fun and maybe drop by my forums hang out, ask questions, post your own work etc - -Feel free to use however you like, commercial etc, credits are Appreciated as a LOT of work went into this! ;-) - -Psionic - -http://www.psionic3d.co.uk - -Note for Irrlicht: Irrlicht uses a 0-based frame index. So subtract 1 from each of the loops! \ No newline at end of file diff --git a/media/ninja.b3d b/media/ninja.b3d deleted file mode 100644 index fbc78724..00000000 Binary files a/media/ninja.b3d and /dev/null differ diff --git a/media/nskinbl.jpg b/media/nskinbl.jpg deleted file mode 100644 index b701adb9..00000000 Binary files a/media/nskinbl.jpg and /dev/null differ diff --git a/media/nskinrd.jpg b/media/nskinrd.jpg deleted file mode 100644 index 458dbfcd..00000000 Binary files a/media/nskinrd.jpg and /dev/null differ diff --git a/media/ogles2.frag b/media/ogles2.frag deleted file mode 100644 index e0a03cda..00000000 --- a/media/ogles2.frag +++ /dev/null @@ -1,13 +0,0 @@ -precision mediump float; - -varying vec2 v_texCoord; -varying vec4 v_color; - -uniform sampler2D myTexture; - -void main (void) -{ - vec4 col = texture2D(myTexture, v_texCoord); - col *= v_color; - gl_FragColor = col * 4.0; -} diff --git a/media/ogles2.vert b/media/ogles2.vert deleted file mode 100644 index 6007c83c..00000000 --- a/media/ogles2.vert +++ /dev/null @@ -1,34 +0,0 @@ -attribute vec3 inVertexPosition; -attribute vec3 inVertexNormal; -attribute vec4 inVertexColor; -attribute vec2 inTexCoord0; - -uniform mat4 mWorldViewProj; -uniform mat4 mInvWorld; -uniform mat4 mTransWorld; -uniform vec3 mLightPos; -uniform vec4 mLightColor; - -varying mediump vec4 v_color; -varying mediump vec2 v_texCoord; - -void main(void) -{ - gl_Position = mWorldViewProj * vec4(inVertexPosition,1.0); - - vec4 normal = vec4(inVertexNormal, 0.0); - normal = mInvWorld * normal; - normal = normalize(normal); - - vec4 worldpos = vec4(inVertexPosition,1.0) * mTransWorld; - - vec4 lightVector = worldpos - vec4(mLightPos,1.0); - lightVector = normalize(lightVector); - - float tmp2 = dot(-lightVector, normal); - - vec4 tmp = mLightColor * tmp2; - v_color = vec4(tmp.x, tmp.y, tmp.z, 0.0); - - v_texCoord = inTexCoord0; -} diff --git a/media/open.png b/media/open.png deleted file mode 100644 index b85229d2..00000000 Binary files a/media/open.png and /dev/null differ diff --git a/media/opengl.frag b/media/opengl.frag deleted file mode 100644 index 82c3d5c9..00000000 --- a/media/opengl.frag +++ /dev/null @@ -1,9 +0,0 @@ - -uniform sampler2D myTexture; - -void main (void) -{ - vec4 col = texture2D(myTexture, vec2(gl_TexCoord[0])); - col *= gl_Color; - gl_FragColor = col * 4.0; -} diff --git a/media/opengl.psh b/media/opengl.psh deleted file mode 100644 index 9f9d03bb..00000000 --- a/media/opengl.psh +++ /dev/null @@ -1,22 +0,0 @@ -!!ARBfp1.0 -# part of the Irrlicht Engine Shader example. -# Please note that these example shaders don't do anything really useful. -# They only demonstrate that shaders can be used in Irrlicht. - -#Input -ATTRIB inTexCoord = fragment.texcoord; # texture coordinates -ATTRIB inColor = fragment.color.primary; # interpolated diffuse color - -#Output -OUTPUT outColor = result.color; - -TEMP texelColor; -TEMP tmp; -TXP texelColor, inTexCoord, texture, 2D; - -ADD tmp, inColor, inColor; # mulitply with color -MUL texelColor, texelColor, tmp; # mulitply with color -ADD outColor, texelColor, texelColor; # make it brighter and store result - -END - diff --git a/media/opengl.vert b/media/opengl.vert deleted file mode 100644 index 9a15dd04..00000000 --- a/media/opengl.vert +++ /dev/null @@ -1,34 +0,0 @@ -// Part of the Irrlicht Engine Shader example. -// Simple GLSL vertex shader -// Please note that these example shaders don't do anything really useful. -// They only demonstrate that shaders can be used in Irrlicht. - - -uniform mat4 mWorldViewProj; -uniform mat4 mInvWorld; -uniform mat4 mTransWorld; -uniform vec3 mLightPos; // actually just camera-pos in this case -uniform vec4 mLightColor; - -void main(void) -{ - gl_Position = mWorldViewProj * gl_Vertex; - - // transform normal somehow (NOTE: for the real vertex normal you would use an inverse-transpose world matrix instead of mInvWorld) - vec4 normal = vec4(gl_Normal, 0.0); - normal = mInvWorld * normal; - normal = normalize(normal); - - // (NOTE: not sure why transposed world is used instead of world?) - vec4 worldpos = gl_Vertex * mTransWorld; - - vec4 lightVector = worldpos - vec4(mLightPos,1.0); - lightVector = normalize(lightVector); - - float tmp2 = dot(-lightVector, normal); - - vec4 tmp = mLightColor * tmp2; - gl_FrontColor = gl_BackColor = vec4(tmp.x, tmp.y, tmp.z, 0.0); - - gl_TexCoord[0] = gl_MultiTexCoord0; -} diff --git a/media/opengl.vsh b/media/opengl.vsh deleted file mode 100644 index 9cd71bf2..00000000 --- a/media/opengl.vsh +++ /dev/null @@ -1,60 +0,0 @@ -!!ARBvp1.0 -# part of the Irrlicht Engine Shader example. -# Please note that these example shaders don't do anything really useful. -# They only demonstrate that shaders can be used in Irrlicht. - -#input -ATTRIB InPos = vertex.position; -ATTRIB InColor = vertex.color; -ATTRIB InNormal = vertex.normal; -ATTRIB InTexCoord = vertex.texcoord; - -#output -OUTPUT OutPos = result.position; -OUTPUT OutColor = result.color; -OUTPUT OutTexCoord = result.texcoord; - -PARAM MVP[4] = { state.matrix.mvp }; # modelViewProjection matrix. -TEMP Temp; -TEMP TempColor; -TEMP TempNormal; -TEMP TempPos; - -#transform position to clip space -DP4 Temp.x, MVP[0], InPos; -DP4 Temp.y, MVP[1], InPos; -DP4 Temp.z, MVP[2], InPos; -DP4 Temp.w, MVP[3], InPos; - -#transform normal -DP3 TempNormal.x, InNormal.x, program.local[0]; -DP3 TempNormal.y, InNormal.y, program.local[1]; -DP3 TempNormal.z, InNormal.z, program.local[2]; - -#renormalize normal -DP3 TempNormal.w, TempNormal, TempNormal; -RSQ TempNormal.w, TempNormal.w; -MUL TempNormal, TempNormal, TempNormal.w; - -# calculate light vector -DP4 TempPos.x, InPos, program.local[10]; # vertex into world position -DP4 TempPos.y, InPos, program.local[11]; -DP4 TempPos.z, InPos, program.local[12]; -DP4 TempPos.w, InPos, program.local[13]; - -ADD TempPos, program.local[8], -TempPos; # vtxpos - lightpos - -# normalize light vector -DP3 TempPos.w, TempPos, TempPos; -RSQ TempPos.w, TempPos.w; -MUL TempPos, TempPos, TempPos.w; - -# calculate light color -DP3 TempColor, TempNormal, TempPos; # dp3 with negative light vector -LIT OutColor, TempColor; # clamp to zero if r3 < 0, r5 has diffuce component in r5.y -MUL OutColor, TempColor.y, program.local[9]; # ouput diffuse color -MOV OutColor.w, 1.0; # we want alpha to be always 1 -MOV OutTexCoord, InTexCoord; # store texture coordinate -MOV OutPos, Temp; - -END \ No newline at end of file diff --git a/media/opengllogo.png b/media/opengllogo.png deleted file mode 100644 index 2e837263..00000000 Binary files a/media/opengllogo.png and /dev/null differ diff --git a/media/particle.bmp b/media/particle.bmp deleted file mode 100644 index b92a7f9a..00000000 Binary files a/media/particle.bmp and /dev/null differ diff --git a/media/particlegreen.jpg b/media/particlegreen.jpg deleted file mode 100644 index b39f171c..00000000 Binary files a/media/particlegreen.jpg and /dev/null differ diff --git a/media/particlered.bmp b/media/particlered.bmp deleted file mode 100644 index 1a542145..00000000 Binary files a/media/particlered.bmp and /dev/null differ diff --git a/media/particlewhite.bmp b/media/particlewhite.bmp deleted file mode 100644 index 267845da..00000000 Binary files a/media/particlewhite.bmp and /dev/null differ diff --git a/media/portal1.bmp b/media/portal1.bmp deleted file mode 100644 index 8bd032e3..00000000 Binary files a/media/portal1.bmp and /dev/null differ diff --git a/media/portal2.bmp b/media/portal2.bmp deleted file mode 100644 index 85f33228..00000000 Binary files a/media/portal2.bmp and /dev/null differ diff --git a/media/portal3.bmp b/media/portal3.bmp deleted file mode 100644 index 6d174ac1..00000000 Binary files a/media/portal3.bmp and /dev/null differ diff --git a/media/portal4.bmp b/media/portal4.bmp deleted file mode 100644 index 5e7fa352..00000000 Binary files a/media/portal4.bmp and /dev/null differ diff --git a/media/portal5.bmp b/media/portal5.bmp deleted file mode 100644 index 36f573f5..00000000 Binary files a/media/portal5.bmp and /dev/null differ diff --git a/media/portal6.bmp b/media/portal6.bmp deleted file mode 100644 index 972d053e..00000000 Binary files a/media/portal6.bmp and /dev/null differ diff --git a/media/portal7.bmp b/media/portal7.bmp deleted file mode 100644 index d9e54056..00000000 Binary files a/media/portal7.bmp and /dev/null differ diff --git a/media/pp_d3d9.hlsl b/media/pp_d3d9.hlsl deleted file mode 100644 index 33d47ec9..00000000 --- a/media/pp_d3d9.hlsl +++ /dev/null @@ -1,43 +0,0 @@ - -// Texture size to calculate texel center -float2 TextureSize; - -// Vertex shader output struct -struct VS_OUTPUT -{ - float4 Position : POSITION0; - float2 TexCoords : TEXCOORD0; -}; - -VS_OUTPUT vertexMain( - float4 Position : POSITION0, - float2 TexCoords : TEXCOORD0 - ) -{ - VS_OUTPUT OUT; - OUT.Position = Position; - - // In practice, instead of passing in TextureSize, - // pass 1.0 / TextureSize for better performance - - // TexCoords is set to the texel center - OUT.TexCoords = TexCoords + 1.0 / TextureSize / 2.0; - - return OUT; -} - -// Texture sampler -sampler2D TextureSampler; - -float4 pixelMain ( float2 Texcoords : TEXCOORD0 ) : COLOR0 -{ - // Texture is sampled at Texcoords using tex2D - float4 Color = tex2D(TextureSampler, Texcoords); - - // Change Texcoords to sample pixels around - - // Inverse the color to produce negative image effect - Color.rgb = 1.0 - Color.rgb; - - return Color; -}; diff --git a/media/pp_opengl.frag b/media/pp_opengl.frag deleted file mode 100644 index 85ab768a..00000000 --- a/media/pp_opengl.frag +++ /dev/null @@ -1,17 +0,0 @@ - -// Texture sampler -uniform sampler2D TextureSampler; - -// TexCoords from vertex shader -varying vec2 TexCoords; - -void main (void) -{ - // Texture is sampled at Texcoords using texture2D - vec4 Color = texture2D(TextureSampler, TexCoords); - - // Inverse the color to produce negative image effect - Color.rgb = 1.0 - Color.rgb; - - gl_FragColor = Color; -} \ No newline at end of file diff --git a/media/pp_opengl.vert b/media/pp_opengl.vert deleted file mode 100644 index d1c9ae66..00000000 --- a/media/pp_opengl.vert +++ /dev/null @@ -1,24 +0,0 @@ - -// Pass to fragment shader with the same name -varying vec2 TexCoords; - -void main(void) -{ - gl_Position = gl_Vertex; - - // The origin of the texture coordinates locates at bottom-left - // corner rather than top-left corner as defined on screen quad. - // Instead of using texture coordinates passed in by OpenGL, we - // calculate TexCoords based on vertex position as follows. - // - // Vertex[0] (-1, -1) to (0, 0) - // Vertex[1] (-1, 1) to (0, 1) - // Vertex[2] ( 1, 1) to (1, 1) - // Vertex[3] ( 1, -1) to (1, 0) - // - // Texture coordinate system in OpenGL operates differently from - // DirectX 3D. It is not necessary to offset TexCoords to texel - // center by adding 1.0 / TextureSize / 2.0 - - TexCoords = (gl_Vertex.xy * 0.5 + 0.5); -} diff --git a/media/rockwall.jpg b/media/rockwall.jpg deleted file mode 100644 index 85a7dd72..00000000 Binary files a/media/rockwall.jpg and /dev/null differ diff --git a/media/rockwall_height.bmp b/media/rockwall_height.bmp deleted file mode 100644 index 90f4d7bd..00000000 Binary files a/media/rockwall_height.bmp and /dev/null differ diff --git a/media/room.3ds b/media/room.3ds deleted file mode 100644 index f0bfbe63..00000000 Binary files a/media/room.3ds and /dev/null differ diff --git a/media/rsptnback.jpg b/media/rsptnback.jpg deleted file mode 100644 index 9984dcd7..00000000 Binary files a/media/rsptnback.jpg and /dev/null differ diff --git a/media/skydome.jpg b/media/skydome.jpg deleted file mode 100644 index 74815130..00000000 Binary files a/media/skydome.jpg and /dev/null differ diff --git a/media/skydome2.jpg b/media/skydome2.jpg deleted file mode 100644 index 7bfe713f..00000000 Binary files a/media/skydome2.jpg and /dev/null differ diff --git a/media/smoke.bmp b/media/smoke.bmp deleted file mode 100644 index 64949888..00000000 Binary files a/media/smoke.bmp and /dev/null differ diff --git a/media/smoke2.jpg b/media/smoke2.jpg deleted file mode 100644 index 3d169de6..00000000 Binary files a/media/smoke2.jpg and /dev/null differ diff --git a/media/smoke3.jpg b/media/smoke3.jpg deleted file mode 100644 index 5dee86bf..00000000 Binary files a/media/smoke3.jpg and /dev/null differ diff --git a/media/spheremap.jpg b/media/spheremap.jpg deleted file mode 100644 index 6b785fbf..00000000 Binary files a/media/spheremap.jpg and /dev/null differ diff --git a/media/stones.jpg b/media/stones.jpg deleted file mode 100644 index 99ce6f41..00000000 Binary files a/media/stones.jpg and /dev/null differ diff --git a/media/sydney.bmp b/media/sydney.bmp deleted file mode 100644 index 0ba9aad9..00000000 Binary files a/media/sydney.bmp and /dev/null differ diff --git a/media/sydney.md2 b/media/sydney.md2 deleted file mode 100644 index 7d3521dd..00000000 Binary files a/media/sydney.md2 and /dev/null differ diff --git a/media/t351sml.jpg b/media/t351sml.jpg deleted file mode 100644 index e3561f37..00000000 Binary files a/media/t351sml.jpg and /dev/null differ diff --git a/media/terrain-heightmap.bmp b/media/terrain-heightmap.bmp deleted file mode 100644 index a4753df3..00000000 Binary files a/media/terrain-heightmap.bmp and /dev/null differ diff --git a/media/terrain-texture.jpg b/media/terrain-texture.jpg deleted file mode 100644 index fdfe7c6f..00000000 Binary files a/media/terrain-texture.jpg and /dev/null differ diff --git a/media/tools.png b/media/tools.png deleted file mode 100644 index b7e86c93..00000000 Binary files a/media/tools.png and /dev/null differ diff --git a/media/vc6include.jpg b/media/vc6include.jpg deleted file mode 100644 index d3e65eae..00000000 Binary files a/media/vc6include.jpg and /dev/null differ diff --git a/media/vc6optionsdir.jpg b/media/vc6optionsdir.jpg deleted file mode 100644 index c745d83b..00000000 Binary files a/media/vc6optionsdir.jpg and /dev/null differ diff --git a/media/vcnetinclude.jpg b/media/vcnetinclude.jpg deleted file mode 100644 index ce37fcb3..00000000 Binary files a/media/vcnetinclude.jpg and /dev/null differ diff --git a/media/wall.bmp b/media/wall.bmp deleted file mode 100644 index ff1a8c14..00000000 Binary files a/media/wall.bmp and /dev/null differ diff --git a/media/wall.jpg b/media/wall.jpg deleted file mode 100644 index b63c2260..00000000 Binary files a/media/wall.jpg and /dev/null differ diff --git a/media/water.jpg b/media/water.jpg deleted file mode 100644 index 47c0599a..00000000 Binary files a/media/water.jpg and /dev/null differ diff --git a/media/yodan mdl - readme.txt b/media/yodan mdl - readme.txt deleted file mode 100644 index 53c72a3d..00000000 --- a/media/yodan mdl - readme.txt +++ /dev/null @@ -1,53 +0,0 @@ -Yodan the Silencer - -Experiment 2 - -Can I add elements to the construction of the Biped and also extra external bones? - -Well, yes and no. - -I discovered that it is possible to add both extra links and extra bones without any detremental effects. However, with the exaggerated biped deformation, I came across a problem that hadn't been that obvious on Knute and Bolte. most weapons are rigid non-deformable objects, however the Egon reference model is actually physiqued to a humanoid biped the same way as the player model mesh is. This means that when you deform the biped, it will in turn deform the Egon. It is possible to adjust the Egon model to fit Yodan, but that would mean including the altered Egon gun with the model which would replace the standard one. It would then screw up on standard models, defeating the whole point. - -So, the Egon gun screws up on Yodan. Nothing I can do about it. I also didn't account for his spikes so one of them impales the pack aswell. Oh well! - -Beyond this, I feel the lupine legs and tail work quite well, though I realised that the legs are allready quite 'crouched' in the standing position which didn't leave much room for actual crouching =( However, the root Bip 01 bone is in the same place as the standard Human ones when standing and crouching. - -I have totally re-animated all of the sequences, but largely based those animations on the Valve ones so no points for originality. However, I have made him fire most weapons, including the missile launcher one-handed, I felt it kind of suited him =) - -So I present to you, chunk the second of my planned three-chunk experiment with Halflife modelling. - - -'Yodan the silencer' PPM for Half-Life - -to install: - -unzip the zipfile into the path: Sierra/half-life/valve/models/player -it will automatically create a folder called 'Yodan' and place the mdl and bmp files inside. - -skins: 1x255x255x255colour bmp. -Chrome: no -Team colours: no -triangles: 505 -animations: Custom - -Thanks to: - -Alexis for the constructive criticism. -Chris for the original name, 'Hugo the Silencer' from which Yodan is derived -Raxogg,DaBalrog and Spine[TDA3] for nagging me -White Dragon, Ian Waugh and Nsi among others, for being competent and friendly competition =) -White Dragon, Raxogg and Mist for testing the model for me. -George Lucas, Gene Roddenberry, Wolfgang Amadeus Motzart, Bruce Li and the Pixies for the background noise =) -The Spanish for their onions - -See chunk the first, 'Knute and Bolte' at all good PPM websites near you =) - -also available on my web-site - -http://dspace.dial.pipex.com/scarecrow - -or E-Mail me with questions, advice, complaints etc... - -Scarecrow@dial.pipex.com - -Please note - I don't have time to make clan models or to commit myself to a mod or TC unless you are offering large sums of cash =) \ No newline at end of file diff --git a/media/yodan.mdl b/media/yodan.mdl deleted file mode 100644 index 543c1596..00000000 Binary files a/media/yodan.mdl and /dev/null differ diff --git a/media/zip.png b/media/zip.png deleted file mode 100644 index c4f9dde5..00000000 Binary files a/media/zip.png and /dev/null differ diff --git a/source/Irrlicht/C3DSMeshFileLoader.cpp b/source/Irrlicht/C3DSMeshFileLoader.cpp deleted file mode 100644 index 1ac77cc2..00000000 --- a/source/Irrlicht/C3DSMeshFileLoader.cpp +++ /dev/null @@ -1,1371 +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_3DS_LOADER_ - -#include "C3DSMeshFileLoader.h" -#include "CMeshTextureLoader.h" -#include "os.h" -#include "SMeshBuffer.h" -#include "SAnimatedMesh.h" -#include "IReadFile.h" -#include "IVideoDriver.h" -#include "IMeshManipulator.h" - -#ifdef _DEBUG -#define _IRR_DEBUG_3DS_LOADER_ -#endif - -namespace irr -{ -namespace scene -{ - - -namespace -{ -enum e3DSChunk -{ - // Primary chunk - C3DS_MAIN3DS = 0x4D4D, - - // Main Chunks - C3DS_EDIT3DS = 0x3D3D, - C3DS_KEYF3DS = 0xB000, - C3DS_VERSION = 0x0002, - C3DS_MESHVERSION = 0x3D3E, - - // sub chunks of C3DS_EDIT3DS - C3DS_EDIT_MATERIAL = 0xAFFF, - C3DS_EDIT_OBJECT = 0x4000, - - // sub chunks of C3DS_EDIT_MATERIAL - C3DS_MATNAME = 0xA000, - C3DS_MATAMBIENT = 0xA010, - C3DS_MATDIFFUSE = 0xA020, - C3DS_MATSPECULAR = 0xA030, - C3DS_MATSHININESS = 0xA040, - C3DS_MATSHIN2PCT = 0xA041, - C3DS_TRANSPARENCY = 0xA050, - C3DS_TRANSPARENCY_FALLOFF = 0xA052, - C3DS_REFL_BLUR = 0xA053, - C3DS_TWO_SIDE = 0xA081, - C3DS_WIRE = 0xA085, - C3DS_SHADING = 0xA100, - C3DS_MATTEXMAP = 0xA200, - C3DS_MATSPECMAP = 0xA204, - C3DS_MATOPACMAP = 0xA210, - C3DS_MATREFLMAP = 0xA220, - C3DS_MATBUMPMAP = 0xA230, - C3DS_MATMAPFILE = 0xA300, - C3DS_MAT_TEXTILING = 0xA351, - C3DS_MAT_USCALE = 0xA354, - C3DS_MAT_VSCALE = 0xA356, - C3DS_MAT_UOFFSET = 0xA358, - C3DS_MAT_VOFFSET = 0xA35A, - - // subs of C3DS_EDIT_OBJECT - C3DS_OBJTRIMESH = 0x4100, - - // subs of C3DS_OBJTRIMESH - C3DS_TRIVERT = 0x4110, - C3DS_POINTFLAGARRAY= 0x4111, - C3DS_TRIFACE = 0x4120, - C3DS_TRIFACEMAT = 0x4130, - C3DS_TRIUV = 0x4140, - C3DS_TRISMOOTH = 0x4150, - C3DS_TRIMATRIX = 0x4160, - C3DS_MESHCOLOR = 0x4165, - C3DS_DIRECT_LIGHT = 0x4600, - C3DS_DL_INNER_RANGE= 0x4659, - C3DS_DL_OUTER_RANGE= 0x465A, - C3DS_DL_MULTIPLIER = 0x465B, - C3DS_CAMERA = 0x4700, - C3DS_CAM_SEE_CONE = 0x4710, - C3DS_CAM_RANGES = 0x4720, - - // subs of C3DS_KEYF3DS - C3DS_KF_HDR = 0xB00A, - C3DS_AMBIENT_TAG = 0xB001, - C3DS_OBJECT_TAG = 0xB002, - C3DS_CAMERA_TAG = 0xB003, - C3DS_TARGET_TAG = 0xB004, - C3DS_LIGHTNODE_TAG = 0xB005, - C3DS_KF_SEG = 0xB008, - C3DS_KF_CURTIME = 0xB009, - C3DS_KF_NODE_HDR = 0xB010, - C3DS_PIVOTPOINT = 0xB013, - C3DS_BOUNDBOX = 0xB014, - C3DS_MORPH_SMOOTH = 0xB015, - C3DS_POS_TRACK_TAG = 0xB020, - C3DS_ROT_TRACK_TAG = 0xB021, - C3DS_SCL_TRACK_TAG = 0xB022, - C3DS_NODE_ID = 0xB030, - - // Viewport definitions - C3DS_VIEWPORT_LAYOUT = 0x7001, - C3DS_VIEWPORT_DATA = 0x7011, - C3DS_VIEWPORT_DATA_3 = 0x7012, - C3DS_VIEWPORT_SIZE = 0x7020, - - // different color chunk types - C3DS_COL_RGB = 0x0010, - C3DS_COL_TRU = 0x0011, - C3DS_COL_LIN_24 = 0x0012, - C3DS_COL_LIN_F = 0x0013, - - // percentage chunk types - C3DS_PERCENTAGE_I = 0x0030, - C3DS_PERCENTAGE_F = 0x0031, - - C3DS_CHUNK_MAX = 0xFFFF -}; -} - - -//! Constructor -C3DSMeshFileLoader::C3DSMeshFileLoader(ISceneManager* smgr, io::IFileSystem* fs) -: SceneManager(smgr), FileSystem(fs), Vertices(0), Indices(0), SmoothingGroups(0), TCoords(0), - CountVertices(0), CountFaces(0), CountTCoords(0), Mesh(0) -{ - - #ifdef _DEBUG - setDebugName("C3DSMeshFileLoader"); - #endif - - if (FileSystem) - FileSystem->grab(); - - TextureLoader = new CMeshTextureLoader( FileSystem, SceneManager->getVideoDriver() ); -} - - -//! destructor -C3DSMeshFileLoader::~C3DSMeshFileLoader() -{ - cleanUp(); - - if (FileSystem) - FileSystem->drop(); - - if (Mesh) - Mesh->drop(); -} - - -//! returns true if the file maybe is able to be loaded by this class -//! based on the file extension (e.g. ".bsp") -bool C3DSMeshFileLoader::isALoadableFileExtension(const io::path& filename) const -{ - return core::hasFileExtension ( filename, "3ds" ); -} - - -//! 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* C3DSMeshFileLoader::createMesh(io::IReadFile* file) -{ - if ( getMeshTextureLoader() ) - getMeshTextureLoader()->setMeshFile(file); - - ChunkData data; - - readChunkData(file, data); - - if (data.header.id != C3DS_MAIN3DS ) - return 0; - - CurrentMaterial.clear(); - Materials.clear(); - MeshBufferNames.clear(); - cleanUp(); - - if (Mesh) - Mesh->drop(); - - Mesh = new SMesh(); - - if (readChunk(file, &data)) - { - // success - - for (u32 i=0; i<Mesh->getMeshBufferCount(); ++i) - { - SMeshBuffer* mb = ((SMeshBuffer*)Mesh->getMeshBuffer(i)); - // drop empty buffers - if (mb->getIndexCount() == 0 || mb->getVertexCount() == 0) - { - Mesh->MeshBuffers.erase(i--); - mb->drop(); - } - else - { - if (mb->Material.MaterialType == video::EMT_PARALLAX_MAP_SOLID) - { - SMesh tmp; - tmp.addMeshBuffer(mb); - mb->drop(); - IMesh* tangentMesh = SceneManager->getMeshManipulator()->createMeshWithTangents(&tmp); - Mesh->MeshBuffers[i]=tangentMesh->getMeshBuffer(0); - // we need to grab because we replace the buffer manually. - Mesh->MeshBuffers[i]->grab(); - // clean up intermediate mesh struct - tangentMesh->drop(); - } - Mesh->MeshBuffers[i]->recalculateBoundingBox(); - } - } - - Mesh->recalculateBoundingBox(); - - SAnimatedMesh* am = new SAnimatedMesh(); - am->Type = EAMT_3DS; - am->addMesh(Mesh); - am->recalculateBoundingBox(); - Mesh->drop(); - Mesh = 0; - return am; - } - - Mesh->drop(); - Mesh = 0; - - return 0; -} - - -bool C3DSMeshFileLoader::readPercentageChunk(io::IReadFile* file, - ChunkData* chunk, f32& percentage) -{ -#ifdef _IRR_DEBUG_3DS_LOADER_ - os::Printer::log("Load percentage chunk.", ELL_DEBUG); -#endif - - ChunkData data; - readChunkData(file, data); - - short intpercentage; - float fpercentage; - - switch(data.header.id) - { - case C3DS_PERCENTAGE_I: - { - // read short - file->read(&intpercentage, 2); -#ifdef __BIG_ENDIAN__ - intpercentage = os::Byteswap::byteswap(intpercentage); -#endif - percentage=intpercentage/100.0f; - data.read += 2; - } - break; - case C3DS_PERCENTAGE_F: - { - // read float - file->read(&fpercentage, sizeof(float)); - data.read += sizeof(float); -#ifdef __BIG_ENDIAN__ - percentage = os::Byteswap::byteswap(fpercentage); -#else - percentage = (f32)fpercentage; -#endif - } - break; - default: - { - // unknown percentage chunk - os::Printer::log("Unknown percentage chunk in 3Ds file.", ELL_WARNING); - file->seek(data.header.length - data.read, true); - data.read += data.header.length - data.read; - } - } - - chunk->read += data.read; - - return true; -} - -bool C3DSMeshFileLoader::readColorChunk(io::IReadFile* file, ChunkData* chunk, - video::SColor& out) -{ -#ifdef _IRR_DEBUG_3DS_LOADER_ - os::Printer::log("Load color chunk.", ELL_DEBUG); -#endif - ChunkData data; - readChunkData(file, data); - - u8 c[3]; - f32 cf[3]; - - switch(data.header.id) - { - case C3DS_COL_TRU: - case C3DS_COL_LIN_24: - { - // read 8 bit data - file->read(c, sizeof(c)); - out.set(255, c[0], c[1], c[2]); - data.read += sizeof(c); - } - break; - case C3DS_COL_RGB: - case C3DS_COL_LIN_F: - { - // read float data - file->read(cf, sizeof(cf)); -#ifdef __BIG_ENDIAN__ - cf[0] = os::Byteswap::byteswap(cf[0]); - cf[1] = os::Byteswap::byteswap(cf[1]); - cf[2] = os::Byteswap::byteswap(cf[2]); -#endif - out.set(255, (s32)(cf[0]*255.0f), (s32)(cf[1]*255.0f), (s32)(cf[2]*255.0f)); - data.read += sizeof(cf); - } - break; - default: - { - // unknown color chunk size - os::Printer::log("Unknown size of color chunk in 3Ds file.", ELL_WARNING); - file->seek(data.header.length - data.read, true); - data.read += data.header.length - data.read; - } - } - - chunk->read += data.read; - - return true; -} - - -bool C3DSMeshFileLoader::readMaterialChunk(io::IReadFile* file, ChunkData* parent) -{ -#ifdef _IRR_DEBUG_3DS_LOADER_ - os::Printer::log("Load material chunk.", ELL_DEBUG); -#endif - u16 matSection=0; - - while(parent->read < parent->header.length) - { - ChunkData data; - readChunkData(file, data); - - switch(data.header.id) - { - case C3DS_MATNAME: - { - c8* c = new c8[data.header.length - data.read]; - file->read(c, data.header.length - data.read); - - if (strlen(c)) - CurrentMaterial.Name = c; - - data.read += data.header.length - data.read; - delete [] c; - } - break; - case C3DS_MATAMBIENT: - readColorChunk(file, &data, CurrentMaterial.Material.AmbientColor); - break; - case C3DS_MATDIFFUSE: - readColorChunk(file, &data, CurrentMaterial.Material.DiffuseColor); - break; - case C3DS_MATSPECULAR: - readColorChunk(file, &data, CurrentMaterial.Material.SpecularColor); - break; - case C3DS_MATSHININESS: - readPercentageChunk(file, &data, CurrentMaterial.Material.Shininess); - CurrentMaterial.Material.Shininess = (1.f-CurrentMaterial.Material.Shininess)*128.f; - break; - case C3DS_TRANSPARENCY: - { - f32 percentage; - readPercentageChunk(file, &data, percentage); - if (percentage>0.0f) - { - CurrentMaterial.Material.MaterialTypeParam=percentage; - CurrentMaterial.Material.MaterialType=video::EMT_TRANSPARENT_VERTEX_ALPHA; - } - else - { - CurrentMaterial.Material.MaterialType=video::EMT_SOLID; - } - } - break; - case C3DS_WIRE: - CurrentMaterial.Material.Wireframe=true; - break; - case C3DS_TWO_SIDE: - CurrentMaterial.Material.BackfaceCulling=false; - break; - case C3DS_SHADING: - { - s16 flags; - file->read(&flags, 2); -#ifdef __BIG_ENDIAN__ - flags = os::Byteswap::byteswap(flags); -#endif - switch (flags) - { - case 0: - CurrentMaterial.Material.Wireframe=true; - break; - case 1: - CurrentMaterial.Material.Wireframe=false; - CurrentMaterial.Material.GouraudShading=false; - break; - case 2: - CurrentMaterial.Material.Wireframe=false; - CurrentMaterial.Material.GouraudShading=true; - break; - default: - // phong and metal missing - break; - } - data.read += data.header.length - data.read; - } - break; - case C3DS_MATTEXMAP: - case C3DS_MATSPECMAP: - case C3DS_MATOPACMAP: - case C3DS_MATREFLMAP: - case C3DS_MATBUMPMAP: - { - matSection=data.header.id; - // Should contain a percentage chunk, but does - // not always have it - s16 testval; - const long pos = file->getPos(); - file->read(&testval, 2); -#ifdef __BIG_ENDIAN__ - testval = os::Byteswap::byteswap(testval); -#endif - file->seek(pos, false); - if ((testval == C3DS_PERCENTAGE_I) || - (testval == C3DS_PERCENTAGE_F)) - switch (matSection) - { - case C3DS_MATTEXMAP: - readPercentageChunk(file, &data, CurrentMaterial.Strength[0]); - break; - case C3DS_MATSPECMAP: - readPercentageChunk(file, &data, CurrentMaterial.Strength[1]); - break; - case C3DS_MATOPACMAP: - readPercentageChunk(file, &data, CurrentMaterial.Strength[2]); - break; - case C3DS_MATBUMPMAP: - readPercentageChunk(file, &data, CurrentMaterial.Strength[4]); - break; - } - } - break; - case C3DS_MATMAPFILE: - { - // read texture file name - c8* c = new c8[data.header.length - data.read]; - file->read(c, data.header.length - data.read); - switch (matSection) - { - case C3DS_MATTEXMAP: - CurrentMaterial.Filename[0] = c; - break; - case C3DS_MATSPECMAP: - CurrentMaterial.Filename[1] = c; - break; - case C3DS_MATOPACMAP: - CurrentMaterial.Filename[2] = c; - break; - case C3DS_MATREFLMAP: - CurrentMaterial.Filename[3] = c; - break; - case C3DS_MATBUMPMAP: - CurrentMaterial.Filename[4] = c; - break; - } - data.read += data.header.length - data.read; - delete [] c; - } - break; - case C3DS_MAT_TEXTILING: - { - s16 flags; - file->read(&flags, 2); -#ifdef __BIG_ENDIAN__ - flags = os::Byteswap::byteswap(flags); -#endif - data.read += 2; - } - break; - case C3DS_MAT_USCALE: - case C3DS_MAT_VSCALE: - case C3DS_MAT_UOFFSET: - case C3DS_MAT_VOFFSET: - { - f32 value; - file->read(&value, 4); -#ifdef __BIG_ENDIAN__ - value = os::Byteswap::byteswap(value); -#endif - u32 i=0; - if (matSection != C3DS_MATTEXMAP) - i=1; - u32 j=0,k=0; - if (data.header.id == C3DS_MAT_VSCALE) - { - j=1; - k=1; - } - else if (data.header.id == C3DS_MAT_UOFFSET) - { - j=2; - k=0; - } - else if (data.header.id == C3DS_MAT_VOFFSET) - { - j=2; - k=1; - } - CurrentMaterial.Material.getTextureMatrix(i)(j,k)=value; - - data.read += 4; - } - break; - default: - // ignore chunk - file->seek(data.header.length - data.read, true); - data.read += data.header.length - data.read; - } - - parent->read += data.read; - } - - Materials.push_back(CurrentMaterial); - CurrentMaterial.clear(); - - return true; -} - - - -bool C3DSMeshFileLoader::readTrackChunk(io::IReadFile* file, ChunkData& data, - IMeshBuffer* mb, const core::vector3df& pivot) -{ -#ifdef _IRR_DEBUG_3DS_LOADER_ - os::Printer::log("Load track chunk.", ELL_DEBUG); -#endif - u16 flags; - u32 flags2; - // Track flags - file->read(&flags, 2); -#ifdef __BIG_ENDIAN__ - flags = os::Byteswap::byteswap(flags); -#endif - file->read(&flags2, 4); -#ifdef __BIG_ENDIAN__ - flags2 = os::Byteswap::byteswap(flags2); -#endif - file->read(&flags2, 4); -#ifdef __BIG_ENDIAN__ - flags2 = os::Byteswap::byteswap(flags2); -#endif - // Num keys - file->read(&flags2, 4); -#ifdef __BIG_ENDIAN__ - flags2 = os::Byteswap::byteswap(flags2); -#endif - file->read(&flags2, 4); -#ifdef __BIG_ENDIAN__ - flags2 = os::Byteswap::byteswap(flags2); -#endif - // TCB flags - file->read(&flags, 2); -#ifdef __BIG_ENDIAN__ - flags = os::Byteswap::byteswap(flags); -#endif - data.read += 20; - - f32 angle=0.0f; - if (data.header.id== C3DS_ROT_TRACK_TAG) - { - // Angle - file->read(&angle, sizeof(f32)); -#ifdef __BIG_ENDIAN__ - angle = os::Byteswap::byteswap(angle); -#endif - data.read += sizeof(f32); - } - core::vector3df vec; - file->read(&vec.X, sizeof(f32)); - file->read(&vec.Y, sizeof(f32)); - file->read(&vec.Z, sizeof(f32)); -#ifdef __BIG_ENDIAN__ - vec.X = os::Byteswap::byteswap(vec.X); - vec.Y = os::Byteswap::byteswap(vec.Y); - vec.Z = os::Byteswap::byteswap(vec.Z); -#endif - data.read += 12; - vec-=pivot; - - // apply transformation to mesh buffer - if (false)//mb) - { - video::S3DVertex *vertices=(video::S3DVertex*)mb->getVertices(); - if (data.header.id==C3DS_POS_TRACK_TAG) - { - for (u32 i=0; i<mb->getVertexCount(); ++i) - vertices[i].Pos+=vec; - } - else if (data.header.id==C3DS_ROT_TRACK_TAG) - { - //TODO - } - else if (data.header.id==C3DS_SCL_TRACK_TAG) - { - //TODO - } - } - // skip further frames - file->seek(data.header.length - data.read, true); - data.read += data.header.length - data.read; - return true; -} - - -bool C3DSMeshFileLoader::readFrameChunk(io::IReadFile* file, ChunkData* parent) -{ -#ifdef _IRR_DEBUG_3DS_LOADER_ - os::Printer::log("Load frame chunk.", ELL_DEBUG); -#endif - ChunkData data; - - //KF_HDR is always at the beginning - readChunkData(file, data); - if (data.header.id != C3DS_KF_HDR) - return false; - else - { -#ifdef _IRR_DEBUG_3DS_LOADER_ - os::Printer::log("Load keyframe header.", ELL_DEBUG); -#endif - u16 version; - file->read(&version, 2); -#ifdef __BIG_ENDIAN__ - version = os::Byteswap::byteswap(version); -#endif - core::stringc name; - readString(file, data, name); - u32 flags; - file->read(&flags, 4); -#ifdef __BIG_ENDIAN__ - flags = os::Byteswap::byteswap(flags); -#endif - - data.read += 4; - parent->read += data.read; - } - data.read=0; - - IMeshBuffer* mb=0; - core::vector3df pivot,bboxCenter; - while(parent->read < parent->header.length) - { - readChunkData(file, data); - - switch(data.header.id) - { - case C3DS_OBJECT_TAG: - { -#ifdef _IRR_DEBUG_3DS_LOADER_ - os::Printer::log("Load object tag.", ELL_DEBUG); -#endif - mb=0; - pivot.set(0.0f, 0.0f, 0.0f); - } - break; - case C3DS_KF_SEG: - { -#ifdef _IRR_DEBUG_3DS_LOADER_ - os::Printer::log("Load keyframe segment.", ELL_DEBUG); -#endif - u32 flags; - file->read(&flags, 4); -#ifdef __BIG_ENDIAN__ - flags = os::Byteswap::byteswap(flags); -#endif - file->read(&flags, 4); -#ifdef __BIG_ENDIAN__ - flags = os::Byteswap::byteswap(flags); -#endif - data.read += 8; - } - break; - case C3DS_KF_NODE_HDR: - { -#ifdef _IRR_DEBUG_3DS_LOADER_ - os::Printer::log("Load keyframe node header.", ELL_DEBUG); -#endif - s16 flags; - c8* c = new c8[data.header.length - data.read-6]; - file->read(c, data.header.length - data.read-6); - - // search mesh buffer to apply these transformations to - for (u32 i=0; i<MeshBufferNames.size(); ++i) - { - if (MeshBufferNames[i]==c) - { - mb=Mesh->getMeshBuffer(i); - break; - } - } - - file->read(&flags, 2); -#ifdef __BIG_ENDIAN__ - flags = os::Byteswap::byteswap(flags); -#endif - file->read(&flags, 2); -#ifdef __BIG_ENDIAN__ - flags = os::Byteswap::byteswap(flags); -#endif - file->read(&flags, 2); -#ifdef __BIG_ENDIAN__ - flags = os::Byteswap::byteswap(flags); -#endif - data.read += data.header.length - data.read; - delete [] c; - } - break; - case C3DS_KF_CURTIME: - { -#ifdef _IRR_DEBUG_3DS_LOADER_ - os::Printer::log("Load keyframe current time.", ELL_DEBUG); -#endif - u32 flags; - file->read(&flags, 4); -#ifdef __BIG_ENDIAN__ - flags = os::Byteswap::byteswap(flags); -#endif - data.read += 4; - } - break; - case C3DS_NODE_ID: - { -#ifdef _IRR_DEBUG_3DS_LOADER_ - os::Printer::log("Load node ID.", ELL_DEBUG); -#endif - u16 flags; - file->read(&flags, 2); -#ifdef __BIG_ENDIAN__ - flags = os::Byteswap::byteswap(flags); -#endif - data.read += 2; - } - break; - case C3DS_PIVOTPOINT: - { -#ifdef _IRR_DEBUG_3DS_LOADER_ - os::Printer::log("Load pivot point.", ELL_DEBUG); -#endif - file->read(&pivot.X, sizeof(f32)); - file->read(&pivot.Y, sizeof(f32)); - file->read(&pivot.Z, sizeof(f32)); -#ifdef __BIG_ENDIAN__ - pivot.X = os::Byteswap::byteswap(pivot.X); - pivot.Y = os::Byteswap::byteswap(pivot.Y); - pivot.Z = os::Byteswap::byteswap(pivot.Z); -#endif - data.read += 12; - } - break; - case C3DS_BOUNDBOX: - { -#ifdef _IRR_DEBUG_3DS_LOADER_ - os::Printer::log("Load bounding box.", ELL_DEBUG); -#endif - core::aabbox3df bbox; - // abuse bboxCenter as temporary variable - file->read(&bboxCenter.X, sizeof(f32)); - file->read(&bboxCenter.Y, sizeof(f32)); - file->read(&bboxCenter.Z, sizeof(f32)); -#ifdef __BIG_ENDIAN__ - bboxCenter.X = os::Byteswap::byteswap(bboxCenter.X); - bboxCenter.Y = os::Byteswap::byteswap(bboxCenter.Y); - bboxCenter.Z = os::Byteswap::byteswap(bboxCenter.Z); -#endif - bbox.reset(bboxCenter); - file->read(&bboxCenter.X, sizeof(f32)); - file->read(&bboxCenter.Y, sizeof(f32)); - file->read(&bboxCenter.Z, sizeof(f32)); -#ifdef __BIG_ENDIAN__ - bboxCenter.X = os::Byteswap::byteswap(bboxCenter.X); - bboxCenter.Y = os::Byteswap::byteswap(bboxCenter.Y); - bboxCenter.Z = os::Byteswap::byteswap(bboxCenter.Z); -#endif - bbox.addInternalPoint(bboxCenter); - bboxCenter=bbox.getCenter(); - data.read += 24; - } - break; - case C3DS_MORPH_SMOOTH: - { -#ifdef _IRR_DEBUG_3DS_LOADER_ - os::Printer::log("Load morph smooth.", ELL_DEBUG); -#endif - f32 flag; - file->read(&flag, 4); -#ifdef __BIG_ENDIAN__ - flag = os::Byteswap::byteswap(flag); -#endif - data.read += 4; - } - break; - case C3DS_POS_TRACK_TAG: - case C3DS_ROT_TRACK_TAG: - case C3DS_SCL_TRACK_TAG: - readTrackChunk(file, data, mb, bboxCenter-pivot); - break; - default: - // ignore chunk - file->seek(data.header.length - data.read, true); - data.read += data.header.length - data.read; - } - - parent->read += data.read; - data.read=0; - } - - return true; -} - - -bool C3DSMeshFileLoader::readChunk(io::IReadFile* file, ChunkData* parent) -{ - while(parent->read < parent->header.length) - { - ChunkData data; - readChunkData(file, data); - - switch(data.header.id) - { - case C3DS_VERSION: - { - u16 version; - file->read(&version, sizeof(u16)); -#ifdef __BIG_ENDIAN__ - version = os::Byteswap::byteswap(version); -#endif - file->seek(data.header.length - data.read - 2, true); - data.read += data.header.length - data.read; - if (version != 0x03) - os::Printer::log("3ds file version is other than 3.", ELL_ERROR); - } - break; - case C3DS_EDIT_MATERIAL: - readMaterialChunk(file, &data); - break; - case C3DS_KEYF3DS: - readFrameChunk(file, &data); - break; - case C3DS_EDIT3DS: - break; - case C3DS_MESHVERSION: - case 0x01: - { - u32 version; - file->read(&version, sizeof(u32)); -#ifdef __BIG_ENDIAN__ - version = os::Byteswap::byteswap(version); -#endif - data.read += sizeof(u32); - } - break; - case C3DS_EDIT_OBJECT: - { - core::stringc name; - readString(file, data, name); - readObjectChunk(file, &data); - composeObject(file, name); - } - break; - - default: - // ignore chunk - file->seek(data.header.length - data.read, true); - data.read += data.header.length - data.read; - } - - parent->read += data.read; - } - - return true; -} - - -bool C3DSMeshFileLoader::readObjectChunk(io::IReadFile* file, ChunkData* parent) -{ -#ifdef _IRR_DEBUG_3DS_LOADER_ - os::Printer::log("Load object chunk.", ELL_DEBUG); -#endif - while(parent->read < parent->header.length) - { - ChunkData data; - readChunkData(file, data); - - switch(data.header.id) - { - case C3DS_OBJTRIMESH: - readObjectChunk(file, &data); - break; - - case C3DS_TRIVERT: - readVertices(file, data); - break; - - case C3DS_POINTFLAGARRAY: - { - u16 numVertex, flags; - file->read(&numVertex, sizeof(u16)); -#ifdef __BIG_ENDIAN__ - numVertex= os::Byteswap::byteswap(numVertex); -#endif - for (u16 i=0; i<numVertex; ++i) - { - file->read(&flags, sizeof(u16)); -#ifdef __BIG_ENDIAN__ - flags = os::Byteswap::byteswap(flags); -#endif - } - data.read += (numVertex+1)*sizeof(u16); - } - break; - - case C3DS_TRIFACE: - readIndices(file, data); - readObjectChunk(file, &data); // read smooth and material groups - break; - - case C3DS_TRIFACEMAT: - readMaterialGroup(file, data); - break; - - case C3DS_TRIUV: // getting texture coordinates - readTextureCoords(file, data); - break; - - case C3DS_TRIMATRIX: - { - f32 mat[4][3]; - file->read(&mat, 12*sizeof(f32)); - TransformationMatrix.makeIdentity(); - for (int i=0; i<4; ++i) - { - for (int j=0; j<3; ++j) - { -#ifdef __BIG_ENDIAN__ - TransformationMatrix(i,j)=os::Byteswap::byteswap(mat[i][j]); -#else - TransformationMatrix(i,j)=mat[i][j]; -#endif - } - } - data.read += 12*sizeof(f32); - } - break; - case C3DS_MESHCOLOR: - { - u8 flag; - file->read(&flag, sizeof(u8)); - ++data.read; - } - break; - case C3DS_TRISMOOTH: // TODO - { - SmoothingGroups = new u32[CountFaces]; - file->read(SmoothingGroups, CountFaces*sizeof(u32)); -#ifdef __BIG_ENDIAN__ - for (u16 i=0; i<CountFaces; ++i) - SmoothingGroups[i] = os::Byteswap::byteswap(SmoothingGroups[i]); -#endif - data.read += CountFaces*sizeof(u32); - } - break; - - default: - // ignore chunk - file->seek(data.header.length - data.read, true); - data.read += data.header.length - data.read; - } - - parent->read += data.read; - } - - return true; -} - - -void C3DSMeshFileLoader::composeObject(io::IReadFile* file, const core::stringc& name) -{ -#ifdef _IRR_DEBUG_3DS_LOADER_ - os::Printer::log("Compose object.", ELL_DEBUG); -#endif - if (Mesh->getMeshBufferCount() != Materials.size()) - loadMaterials(file); - - if (MaterialGroups.empty()) - { - // no material group, so add all - SMaterialGroup group; - group.faceCount = CountFaces; - group.faces = new u16[group.faceCount]; - for (u16 i=0; i<group.faceCount; ++i) - group.faces[i] = i; - MaterialGroups.push_back(group); - - // if we've got no material, add one without a texture - if (Materials.empty()) - { - SCurrentMaterial m; - Materials.push_back(m); - SMeshBuffer* mb = new scene::SMeshBuffer(); - Mesh->addMeshBuffer(mb); - mb->getMaterial() = Materials[0].Material; - mb->drop(); - // add an empty mesh buffer name - MeshBufferNames.push_back(""); - } - } - - for (u32 i=0; i<MaterialGroups.size(); ++i) - { - SMeshBuffer* mb = 0; - video::SMaterial* mat=0; - u32 mbPos; - // -3 because we add three vertices at once - u32 maxPrimitives = core::min_(SceneManager->getVideoDriver()->getMaximalPrimitiveCount(), (u32)((1<<16)-1))-3; // currently hardcoded s16 max value for index pointers - - // find mesh buffer for this group - for (mbPos=0; mbPos<Materials.size(); ++mbPos) - { - if (MaterialGroups[i].MaterialName == Materials[mbPos].Name) - { - mb = (SMeshBuffer*)Mesh->getMeshBuffer(mbPos); - mat=&Materials[mbPos].Material; - MeshBufferNames[mbPos]=name; - break; - } - } - - if (mb != 0) - { - // add geometry to the buffer. - - video::S3DVertex vtx; - core::vector3df vec; - vtx.Color=mat->DiffuseColor; - if (mat->MaterialType==video::EMT_TRANSPARENT_VERTEX_ALPHA) - { - vtx.Color.setAlpha((int)(255.0f*mat->MaterialTypeParam)); - } - vtx.Normal.set(0,0,0); - - for (s32 f=0; f<MaterialGroups[i].faceCount; ++f) - { - u32 vtxCount = mb->Vertices.size(); - if (vtxCount>maxPrimitives) - { - IMeshBuffer* tmp = mb; - mb = new SMeshBuffer(); - Mesh->addMeshBuffer(mb); - mb->drop(); - Mesh->MeshBuffers[mbPos] = Mesh->MeshBuffers.getLast(); - Mesh->MeshBuffers[Mesh->MeshBuffers.size()-1] = tmp; - mb->getMaterial() = tmp->getMaterial(); - vtxCount=0; - } - - for (s32 v=0; v<3; ++v) - { - s32 idx = Indices[MaterialGroups[i].faces[f]*4 +v]; - - if (CountVertices > idx) - { - vtx.Pos.X = Vertices[idx*3 + 0]; - vtx.Pos.Z = Vertices[idx*3 + 1]; - vtx.Pos.Y = Vertices[idx*3 + 2]; -// TransformationMatrix.transformVect(vtx.Pos); - } - - if (CountTCoords > idx) - { - vtx.TCoords.X = TCoords[idx*2 + 0]; - vtx.TCoords.Y = 1.0f -TCoords[idx*2 + 1]; - } - - mb->Vertices.push_back(vtx); - } - - // compute normal - core::plane3d<f32> pl(mb->Vertices[vtxCount].Pos, mb->Vertices[vtxCount+2].Pos, - mb->Vertices[vtxCount+1].Pos); - - mb->Vertices[vtxCount].Normal = pl.Normal; - mb->Vertices[vtxCount+1].Normal = pl.Normal; - mb->Vertices[vtxCount+2].Normal = pl.Normal; - - // add indices - - mb->Indices.push_back(vtxCount); - mb->Indices.push_back(vtxCount+2); - mb->Indices.push_back(vtxCount+1); - } - } - else - os::Printer::log("Found no matching material for Group in 3ds file.", ELL_WARNING); - } - - cleanUp(); -} - - -void C3DSMeshFileLoader::loadMaterials(io::IReadFile* file) -{ - if (Materials.empty()) - os::Printer::log("No materials found in 3ds file.", ELL_INFORMATION); - - // create a mesh buffer for every material - MeshBufferNames.reallocate(Materials.size()); - for (u32 i=0; i<Materials.size(); ++i) - { - MeshBufferNames.push_back(""); - SMeshBuffer* m = new scene::SMeshBuffer(); - Mesh->addMeshBuffer(m); - - m->getMaterial() = Materials[i].Material; - if (Materials[i].Filename[0].size()) - { - video::ITexture* texture = getMeshTextureLoader() ? getMeshTextureLoader()->getTexture(Materials[i].Filename[0]) : NULL; - if (!texture) - { - os::Printer::log("Could not load a texture for entry in 3ds file", - Materials[i].Filename[0].c_str(), ELL_WARNING); - } - else - m->getMaterial().setTexture(0, texture); - } - - if (Materials[i].Filename[2].size()) - { - video::ITexture* texture = getMeshTextureLoader() ? getMeshTextureLoader()->getTexture(Materials[i].Filename[2]) : NULL; - if (!texture) - { - os::Printer::log("Could not load a texture for entry in 3ds file", - Materials[i].Filename[2].c_str(), ELL_WARNING); - } - else - { - m->getMaterial().setTexture(0, texture); - m->getMaterial().MaterialType = video::EMT_TRANSPARENT_ADD_COLOR; - } - } - - if (Materials[i].Filename[3].size()) - { - video::ITexture* texture = getMeshTextureLoader() ? getMeshTextureLoader()->getTexture(Materials[i].Filename[3]) : NULL; - if (!texture) - { - os::Printer::log("Could not load a texture for entry in 3ds file", - Materials[i].Filename[3].c_str(), ELL_WARNING); - } - else - { - m->getMaterial().setTexture(1, m->getMaterial().getTexture(0)); - m->getMaterial().setTexture(0, texture); - m->getMaterial().MaterialType = video::EMT_REFLECTION_2_LAYER; - } - } - - if (Materials[i].Filename[4].size()) - { - video::ITexture* texture = getMeshTextureLoader() ? getMeshTextureLoader()->getTexture(Materials[i].Filename[4]) : NULL; - if (!texture) - { - os::Printer::log("Could not load a texture for entry in 3ds file", - Materials[i].Filename[4].c_str(), ELL_WARNING); - } - else - { - m->getMaterial().setTexture(1, texture); - SceneManager->getVideoDriver()->makeNormalMapTexture(texture, Materials[i].Strength[4]*10.f); - m->getMaterial().MaterialType=video::EMT_PARALLAX_MAP_SOLID; - m->getMaterial().MaterialTypeParam=.035f; - } - } - - m->drop(); - } -} - - -void C3DSMeshFileLoader::cleanUp() -{ - delete [] Vertices; - CountVertices = 0; - Vertices = 0; - delete [] Indices; - Indices = 0; - CountFaces = 0; - delete [] SmoothingGroups; - SmoothingGroups = 0; - delete [] TCoords; - TCoords = 0; - CountTCoords = 0; - - MaterialGroups.clear(); -} - - -void C3DSMeshFileLoader::readTextureCoords(io::IReadFile* file, ChunkData& data) -{ -#ifdef _IRR_DEBUG_3DS_LOADER_ - os::Printer::log("Load texture coords.", ELL_DEBUG); -#endif - file->read(&CountTCoords, sizeof(CountTCoords)); -#ifdef __BIG_ENDIAN__ - CountTCoords = os::Byteswap::byteswap(CountTCoords); -#endif - data.read += sizeof(CountTCoords); - - s32 tcoordsBufferByteSize = CountTCoords * sizeof(f32) * 2; - - if (data.header.length - data.read != tcoordsBufferByteSize) - { - os::Printer::log("Invalid size of tcoords found in 3ds file.", ELL_WARNING); - return; - } - - TCoords = new f32[CountTCoords * 3]; - file->read(TCoords, tcoordsBufferByteSize); -#ifdef __BIG_ENDIAN__ - for (int i=0;i<CountTCoords*2;i++) TCoords[i] = os::Byteswap::byteswap(TCoords[i]); -#endif - data.read += tcoordsBufferByteSize; -} - - -void C3DSMeshFileLoader::readMaterialGroup(io::IReadFile* file, ChunkData& data) -{ -#ifdef _IRR_DEBUG_3DS_LOADER_ - os::Printer::log("Load material group.", ELL_DEBUG); -#endif - SMaterialGroup group; - - readString(file, data, group.MaterialName); - - file->read(&group.faceCount, sizeof(group.faceCount)); -#ifdef __BIG_ENDIAN__ - group.faceCount = os::Byteswap::byteswap(group.faceCount); -#endif - data.read += sizeof(group.faceCount); - - // read faces - group.faces = new u16[group.faceCount]; - file->read(group.faces, sizeof(u16) * group.faceCount); -#ifdef __BIG_ENDIAN__ - for (u32 i=0;i<group.faceCount;++i) - group.faces[i] = os::Byteswap::byteswap(group.faces[i]); -#endif - data.read += sizeof(u16) * group.faceCount; - - MaterialGroups.push_back(group); -} - - -void C3DSMeshFileLoader::readIndices(io::IReadFile* file, ChunkData& data) -{ -#ifdef _IRR_DEBUG_3DS_LOADER_ - os::Printer::log("Load indices.", ELL_DEBUG); -#endif - file->read(&CountFaces, sizeof(CountFaces)); -#ifdef __BIG_ENDIAN__ - CountFaces = os::Byteswap::byteswap(CountFaces); -#endif - data.read += sizeof(CountFaces); - - s32 indexBufferByteSize = CountFaces * sizeof(u16) * 4; - - // Indices are u16s. - // After every 3 Indices in the array, there follows an edge flag. - Indices = new u16[CountFaces * 4]; - file->read(Indices, indexBufferByteSize); -#ifdef __BIG_ENDIAN__ - for (int i=0;i<CountFaces*4;++i) - Indices[i] = os::Byteswap::byteswap(Indices[i]); -#endif - data.read += indexBufferByteSize; -} - - -void C3DSMeshFileLoader::readVertices(io::IReadFile* file, ChunkData& data) -{ -#ifdef _IRR_DEBUG_3DS_LOADER_ - os::Printer::log("Load vertices.", ELL_DEBUG); -#endif - file->read(&CountVertices, sizeof(CountVertices)); -#ifdef __BIG_ENDIAN__ - CountVertices = os::Byteswap::byteswap(CountVertices); -#endif - data.read += sizeof(CountVertices); - - const s32 vertexBufferByteSize = CountVertices * sizeof(f32) * 3; - - if (data.header.length - data.read != vertexBufferByteSize) - { - os::Printer::log("Invalid size of vertices found in 3ds file", core::stringc(CountVertices), ELL_ERROR); - return; - } - - Vertices = new f32[CountVertices * 3]; - file->read(Vertices, vertexBufferByteSize); -#ifdef __BIG_ENDIAN__ - for (int i=0;i<CountVertices*3;i++) - Vertices[i] = os::Byteswap::byteswap(Vertices[i]); -#endif - data.read += vertexBufferByteSize; -} - - -void C3DSMeshFileLoader::readChunkData(io::IReadFile* file, ChunkData& data) -{ - file->read(&data.header, sizeof(ChunkHeader)); -#ifdef __BIG_ENDIAN__ - data.header.id = os::Byteswap::byteswap(data.header.id); - data.header.length = os::Byteswap::byteswap(data.header.length); -#endif - data.read += sizeof(ChunkHeader); -} - - -void C3DSMeshFileLoader::readString(io::IReadFile* file, ChunkData& data, core::stringc& out) -{ - c8 c = 1; - out = ""; - - while (c) - { - file->read(&c, sizeof(c8)); - if (c) - out.append(c); - } - data.read+=out.size()+1; -} - - -} // end namespace scene -} // end namespace irr - -#endif // _IRR_COMPILE_WITH_3DS_LOADER_ - diff --git a/source/Irrlicht/C3DSMeshFileLoader.h b/source/Irrlicht/C3DSMeshFileLoader.h deleted file mode 100644 index 93bc437c..00000000 --- a/source/Irrlicht/C3DSMeshFileLoader.h +++ /dev/null @@ -1,166 +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_3DS_MESH_FILE_LOADER_H_INCLUDED__ -#define __C_3DS_MESH_FILE_LOADER_H_INCLUDED__ - -#include "IMeshLoader.h" -#include "IFileSystem.h" -#include "ISceneManager.h" -#include "irrString.h" -#include "SMesh.h" -#include "matrix4.h" - -namespace irr -{ -namespace scene -{ - -//! Meshloader capable of loading 3ds meshes. -class C3DSMeshFileLoader : public IMeshLoader -{ -public: - - //! Constructor - C3DSMeshFileLoader(ISceneManager* smgr, io::IFileSystem* fs); - - //! destructor - virtual ~C3DSMeshFileLoader(); - - //! 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: - -// byte-align structures -#include "irrpack.h" - - struct ChunkHeader - { - u16 id; - s32 length; - } PACK_STRUCT; - -// Default alignment -#include "irrunpack.h" - - struct ChunkData - { - ChunkData() : read(0) {} - - ChunkHeader header; - s32 read; - }; - - struct SCurrentMaterial - { - void clear() { - Material=video::SMaterial(); - Name=""; - Filename[0]=""; - Filename[1]=""; - Filename[2]=""; - Filename[3]=""; - Filename[4]=""; - Strength[0]=0.f; - Strength[1]=0.f; - Strength[2]=0.f; - Strength[3]=0.f; - Strength[4]=0.f; - } - - video::SMaterial Material; - core::stringc Name; - core::stringc Filename[5]; - f32 Strength[5]; - }; - - struct SMaterialGroup - { - SMaterialGroup() : faceCount(0), faces(0) {}; - - SMaterialGroup(const SMaterialGroup& o) - { - *this = o; - } - - ~SMaterialGroup() - { - clear(); - } - - void clear() - { - delete [] faces; - faces = 0; - faceCount = 0; - } - - void operator =(const SMaterialGroup& o) - { - MaterialName = o.MaterialName; - faceCount = o.faceCount; - faces = new u16[faceCount]; - for (u16 i=0; i<faceCount; ++i) - faces[i] = o.faces[i]; - } - - core::stringc MaterialName; - u16 faceCount; - u16* faces; - }; - - bool readChunk(io::IReadFile* file, ChunkData* parent); - bool readMaterialChunk(io::IReadFile* file, ChunkData* parent); - bool readFrameChunk(io::IReadFile* file, ChunkData* parent); - bool readTrackChunk(io::IReadFile* file, ChunkData& data, - IMeshBuffer* mb, const core::vector3df& pivot); - bool readObjectChunk(io::IReadFile* file, ChunkData* parent); - bool readPercentageChunk(io::IReadFile* file, ChunkData* chunk, f32& percentage); - bool readColorChunk(io::IReadFile* file, ChunkData* chunk, video::SColor& out); - - void readChunkData(io::IReadFile* file, ChunkData& data); - void readString(io::IReadFile* file, ChunkData& data, core::stringc& out); - void readVertices(io::IReadFile* file, ChunkData& data); - void readIndices(io::IReadFile* file, ChunkData& data); - void readMaterialGroup(io::IReadFile* file, ChunkData& data); - void readTextureCoords(io::IReadFile* file, ChunkData& data); - - void composeObject(io::IReadFile* file, const core::stringc& name); - void loadMaterials(io::IReadFile* file); - void cleanUp(); - - scene::ISceneManager* SceneManager; - io::IFileSystem* FileSystem; - - f32* Vertices; - u16* Indices; - u32* SmoothingGroups; - core::array<u16> TempIndices; - f32* TCoords; - u16 CountVertices; - u16 CountFaces; // = CountIndices/4 - u16 CountTCoords; - core::array<SMaterialGroup> MaterialGroups; - - SCurrentMaterial CurrentMaterial; - core::array<SCurrentMaterial> Materials; - core::array<core::stringc> MeshBufferNames; - core::matrix4 TransformationMatrix; - - SMesh* Mesh; -}; - -} // end namespace scene -} // end namespace irr - -#endif - diff --git a/source/Irrlicht/CAnimatedMeshHalfLife.cpp b/source/Irrlicht/CAnimatedMeshHalfLife.cpp deleted file mode 100644 index f8abfa8e..00000000 --- a/source/Irrlicht/CAnimatedMeshHalfLife.cpp +++ /dev/null @@ -1,1679 +0,0 @@ -// Copyright (C) 2002-2012 Nikolaus Gebhardt / Fabio Concas / Thomas Alten -// 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_HALFLIFE_LOADER_ - -#include "CAnimatedMeshHalfLife.h" -#include "os.h" -#include "CColorConverter.h" -#include "CImage.h" -#include "coreutil.h" -#include "SMeshBuffer.h" -#include "IVideoDriver.h" -#include "IFileSystem.h" - -namespace irr -{ -namespace scene -{ - - using namespace video; - - void AngleQuaternion(const core::vector3df& angles, vec4_hl quaternion) - { - // FIXME: rescale the inputs to 1/2 angle - double angle = angles.Z * 0.5; - - const double sy = sin(angle); - const double cy = cos(angle); - angle = angles.Y * 0.5; - const double sp = sin(angle); - const double cp = cos(angle); - angle = angles.X * 0.5; - const double sr = sin(angle); - const double cr = cos(angle); - - quaternion[0] = (irr::f32)(sr*cp*cy-cr*sp*sy); // X - quaternion[1] = (irr::f32)(cr*sp*cy+sr*cp*sy); // Y - quaternion[2] = (irr::f32)(cr*cp*sy-sr*sp*cy); // Z - quaternion[3] = (irr::f32)(cr*cp*cy+sr*sp*sy); // W - } - - void QuaternionMatrix( const vec4_hl quaternion, f32 (*matrix)[4] ) - { - matrix[0][0] = 1.f - 2.f * quaternion[1] * quaternion[1] - 2.f * quaternion[2] * quaternion[2]; - matrix[1][0] = 2.f * quaternion[0] * quaternion[1] + 2.f * quaternion[3] * quaternion[2]; - matrix[2][0] = 2.f * quaternion[0] * quaternion[2] - 2.f * quaternion[3] * quaternion[1]; - - matrix[0][1] = 2.f * quaternion[0] * quaternion[1] - 2.f * quaternion[3] * quaternion[2]; - matrix[1][1] = 1.f - 2.f * quaternion[0] * quaternion[0] - 2.f * quaternion[2] * quaternion[2]; - matrix[2][1] = 2.f * quaternion[1] * quaternion[2] + 2.f * quaternion[3] * quaternion[0]; - - matrix[0][2] = 2.f * quaternion[0] * quaternion[2] + 2.f * quaternion[3] * quaternion[1]; - matrix[1][2] = 2.f * quaternion[1] * quaternion[2] - 2.f * quaternion[3] * quaternion[0]; - matrix[2][2] = 1.f - 2.f * quaternion[0] * quaternion[0] - 2.f * quaternion[1] * quaternion[1]; - } - - void QuaternionSlerp( const vec4_hl p, vec4_hl q, f32 t, vec4_hl qt ) - { - // decide if one of the quaternions is backwards - f32 a = 0; - f32 b = 0; - for (s32 i = 0; i < 4; i++) { - a += (p[i]-q[i])*(p[i]-q[i]); - b += (p[i]+q[i])*(p[i]+q[i]); - } - if (a > b) { - for (s32 i = 0; i < 4; i++) { - q[i] = -q[i]; - } - } - - double sclp, sclq; - const double cosom = p[0]*q[0] + p[1]*q[1] + p[2]*q[2] + p[3]*q[3]; - - if ((1.f + cosom) > 0.00000001) { - if ((1.f - cosom) > 0.00000001) { - const double omega = acos( cosom ); - const double sinom = sin( omega ); - sclp = sin( (1.f - t)*omega) / sinom; - sclq = sin( t*omega ) / sinom; - } - else { - sclp = 1.f - t; - sclq = t; - } - for (s32 i = 0; i < 4; i++) { - qt[i] = f32(sclp * p[i] + sclq * q[i]); - } - } - else { - qt[0] = -p[1]; - qt[1] = p[0]; - qt[2] = -p[3]; - qt[3] = p[2]; - sclp = sin( (1.f - t) * 0.5f * core::PI); - sclq = sin( t * 0.5f * core::PI); - for (s32 i = 0; i < 3; i++) { - qt[i] = f32(sclp * p[i] + sclq * qt[i]); - } - } - } - - void R_ConcatTransforms (const f32 in1[3][4], const f32 in2[3][4], f32 out[3][4]) - { - out[0][0] = in1[0][0] * in2[0][0] + in1[0][1] * in2[1][0] + in1[0][2] * in2[2][0]; - out[0][1] = in1[0][0] * in2[0][1] + in1[0][1] * in2[1][1] + in1[0][2] * in2[2][1]; - out[0][2] = in1[0][0] * in2[0][2] + in1[0][1] * in2[1][2] + in1[0][2] * in2[2][2]; - out[0][3] = in1[0][0] * in2[0][3] + in1[0][1] * in2[1][3] + in1[0][2] * in2[2][3] + in1[0][3]; - out[1][0] = in1[1][0] * in2[0][0] + in1[1][1] * in2[1][0] + in1[1][2] * in2[2][0]; - out[1][1] = in1[1][0] * in2[0][1] + in1[1][1] * in2[1][1] + in1[1][2] * in2[2][1]; - out[1][2] = in1[1][0] * in2[0][2] + in1[1][1] * in2[1][2] + in1[1][2] * in2[2][2]; - out[1][3] = in1[1][0] * in2[0][3] + in1[1][1] * in2[1][3] + in1[1][2] * in2[2][3] + in1[1][3]; - out[2][0] = in1[2][0] * in2[0][0] + in1[2][1] * in2[1][0] + in1[2][2] * in2[2][0]; - out[2][1] = in1[2][0] * in2[0][1] + in1[2][1] * in2[1][1] + in1[2][2] * in2[2][1]; - out[2][2] = in1[2][0] * in2[0][2] + in1[2][1] * in2[1][2] + in1[2][2] * in2[2][2]; - out[2][3] = in1[2][0] * in2[0][3] + in1[2][1] * in2[1][3] + in1[2][2] * in2[2][3] + in1[2][3]; - } - - #define DotProduct(x,y) ((x)[0]*(y)[0]+(x)[1]*(y)[1]+(x)[2]*(y)[2]) - - inline void VectorTransform(const vec3_hl in1, const f32 in2[3][4], core::vector3df& out) - { - out.X = DotProduct(in1, in2[0]) + in2[0][3]; - out.Z = DotProduct(in1, in2[1]) + in2[1][3]; - out.Y = DotProduct(in1, in2[2]) + in2[2][3]; - } - - static f32 BoneTransform[MAXSTUDIOBONES][3][4]; // bone transformation matrix - - void getBoneVector ( core::vector3df &out, u32 index ) - { - out.X = BoneTransform[index][0][3]; - out.Z = BoneTransform[index][1][3]; - out.Y = BoneTransform[index][2][3]; - } - - void getBoneBox ( core::aabbox3df &box, u32 index, f32 size = 0.5f ) - { - box.MinEdge.X = BoneTransform[index][0][3] - size; - box.MinEdge.Z = BoneTransform[index][1][3] - size; - box.MinEdge.Y = BoneTransform[index][2][3] - size; - - size *= 2.f; - box.MaxEdge.X = box.MinEdge.X + size; - box.MaxEdge.Y = box.MinEdge.Y + size; - box.MaxEdge.Z = box.MinEdge.Z + size; - } - - void getTransformedBoneVector ( core::vector3df &out, u32 index, const vec3_hl in) - { - out.X = DotProduct(in, BoneTransform[index][0]) + BoneTransform[index][0][3]; - out.Z = DotProduct(in, BoneTransform[index][1]) + BoneTransform[index][1][3]; - out.Y = DotProduct(in, BoneTransform[index][2]) + BoneTransform[index][2][3]; - - } - - -//! Constructor -CHalflifeMDLMeshFileLoader::CHalflifeMDLMeshFileLoader( - scene::ISceneManager* smgr) : SceneManager(smgr) -{ -#ifdef _DEBUG - setDebugName("CHalflifeMDLMeshFileLoader"); -#endif -} - - -//! returns true if the file maybe is able to be loaded by this class -//! based on the file extension (e.g. ".bsp") -bool CHalflifeMDLMeshFileLoader::isALoadableFileExtension(const io::path& filename) const -{ - return core::hasFileExtension(filename, "mdl"); -} - - -//! 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* CHalflifeMDLMeshFileLoader::createMesh(io::IReadFile* file) -{ - CAnimatedMeshHalfLife* msh = new CAnimatedMeshHalfLife(); - if (msh) - { - if (msh->loadModelFile(file, SceneManager)) - return msh; - msh->drop(); - } - - return 0; -} - - -//! Constructor -CAnimatedMeshHalfLife::CAnimatedMeshHalfLife() - : FrameCount(0), MeshIPol(0), SceneManager(0), Header(0), TextureHeader(0), - OwnTexModel(false), SequenceIndex(0), CurrentFrame(0), FramesPerSecond(25.f), - SkinGroupSelection(0) -#ifdef HL_TEXTURE_ATLAS -// , TextureMaster(0) -#endif -{ -#ifdef _DEBUG - setDebugName("CAnimatedMeshHalfLife"); -#endif - initData(); -} - -/*! - loads a complete model -*/ -bool CAnimatedMeshHalfLife::loadModelFile(io::IReadFile* file, - ISceneManager* smgr) -{ - if (!file) - return false; - - SceneManager = smgr; - - if ( loadModel(file, file->getFileName()) ) - { - if ( postLoadModel ( file->getFileName() ) ) - { - initModel (); - //dumpModelInfo ( 1 ); - return true; - } - } - return false; -} - - -//! Destructor -CAnimatedMeshHalfLife::~CAnimatedMeshHalfLife() -{ - delete [] (u8*) Header; - if (OwnTexModel) - delete [] (u8*) TextureHeader; - - for (u32 i = 0; i < 32; ++i) - delete [] (u8*) AnimationHeader[i]; - - if (MeshIPol) - MeshIPol->drop(); -} - - -//! Returns the amount of frames in milliseconds. If the amount is 1, it is a static (=non animated) mesh. -u32 CAnimatedMeshHalfLife::getFrameCount() const -{ - return FrameCount; -} - - -//! set the hardware mapping hint, for driver -void CAnimatedMeshHalfLife::setHardwareMappingHint(E_HARDWARE_MAPPING newMappingHint,E_BUFFER_TYPE buffer) -{ -} - - -//! flags the meshbuffer as changed, reloads hardware buffers -void CAnimatedMeshHalfLife::setDirty(E_BUFFER_TYPE buffer) -{ -} - - -static core::vector3df TransformedVerts[MAXSTUDIOVERTS]; // transformed vertices -//static core::vector3df TransformedNormals[MAXSTUDIOVERTS]; // light surface normals - - -/*! -*/ -void CAnimatedMeshHalfLife::initModel() -{ - // init Sequences to Animation - KeyFrameInterpolation ipol; - ipol.Name.reserve ( 64 ); - - AnimList.clear(); - FrameCount = 0; - - const SHalflifeSequence *seq = (SHalflifeSequence*) ((u8*) Header + Header->seqindex); - for (u32 i = 0; i < Header->numseq; i++) - { - ipol.Name = seq[i].label; - ipol.StartFrame = FrameCount; - ipol.Frames = core::max_ ( 1, seq[i].numframes - 1 ); - ipol.EndFrame = ipol.StartFrame + ipol.Frames - 1; - ipol.FramesPerSecond = seq[i].fps; - ipol.AnimationType = seq[i].flags & STUDIO_LOOPING ? EAMT_LOOPING : EAMT_WAYPOINT; - AnimList.push_back ( ipol ); - - FrameCount += ipol.Frames; - } - - // initBoneControllers -/* - SHalflifeBoneController *bonecontroller = (SHalflifeBoneController *)((u8*) Header + Header->bonecontrollerindex); - for ( i = 0; i < Header->numbonecontrollers; i++) - { - printf ( "BoneController%d index:%d%s range:%f - %f\n", - i, - bonecontroller[i].index, bonecontroller[i].index == MOUTH_CONTROLLER ? " (Mouth)": "", - bonecontroller[i].start,bonecontroller[i].end - ); - } - - // initSkins - for (i = 0; i < TextureHeader->numskinfamilies; i++) - { - printf ( "Skin%d\n", i + 1); - } -*/ - - // initBodyparts - u32 meshBuffer = 0; - BodyList.clear(); - const SHalflifeBody *body = (const SHalflifeBody *) ((u8*) Header + Header->bodypartindex); - for (u32 i=0; i < Header->numbodyparts; ++i) - { - BodyPart part; - part.name = body[i].name; - part.defaultModel = core::max_ ( 0, (s32) body[i].base - 1 ); - - const SHalflifeModel * model = (SHalflifeModel *)((u8*) Header + body[i].modelindex); - for ( u32 g = 0; g < body[i].nummodels; ++g) - { - SubModel sub; - sub.name = model[g].name; - sub.startBuffer = meshBuffer; - sub.endBuffer = sub.startBuffer + model[g].nummesh; - sub.state = g == part.defaultModel; - part.model.push_back ( sub ); - meshBuffer += model[g].nummesh; - } - BodyList.push_back ( part ); - } - - SequenceIndex = 0; - CurrentFrame = 0.f; - - SetController(0, 0.f); - SetController(1, 0.f); - SetController(2, 0.f); - SetController(3, 0.f); - SetController(MOUTH_CONTROLLER, 0.f); - - SetSkin (0); - - // init Meshbuffers - const SHalflifeTexture *tex = (SHalflifeTexture *) ((u8*) TextureHeader + TextureHeader->textureindex); - const u16 *skinref = (u16 *)((u8*)TextureHeader + TextureHeader->skinindex); - if ((SkinGroupSelection != 0) && (SkinGroupSelection < TextureHeader->numskinfamilies)) - skinref += (SkinGroupSelection * TextureHeader->numskinref); - - core::vector2df tex_scale; - core::vector2di tex_trans ( 0, 0 ); - -#ifdef HL_TEXTURE_ATLAS - TextureAtlas.getScale(tex_scale); -#endif - - for (u32 bodypart=0 ; bodypart < Header->numbodyparts ; ++bodypart) - { - body = (const SHalflifeBody *)((u8*) Header + Header->bodypartindex) + bodypart; - - for (u32 modelnr = 0; modelnr < body->nummodels; ++modelnr) - { - const SHalflifeModel *model = (SHalflifeModel *)((u8*) Header + body->modelindex) + modelnr; -#if 0 - const vec3_hl *studioverts = (vec3_hl *)((u8*)Header + model->vertindex); - const vec3_hl *studionorms = (vec3_hl *)((u8*)Header + model->normindex); -#endif - for (u32 i = 0; i < model->nummesh; ++i) - { - const SHalflifeMesh *mesh = (SHalflifeMesh *)((u8*)Header + model->meshindex) + i; - const SHalflifeTexture *currentex = &tex[skinref[mesh->skinref]]; - -#ifdef HL_TEXTURE_ATLAS - TextureAtlas.getTranslation ( currentex->name, tex_trans ); -#else - tex_scale.X = 1.f/(f32)currentex->width; - tex_scale.Y = 1.f/(f32)currentex->height; -#endif - - SMeshBuffer * buffer = new SMeshBuffer(); - - // count index vertex size indexcount = mesh->numtris * 3 - u32 indexCount = 0; - u32 vertexCount = 0; - - const s16 *tricmd = (s16*)((u8*)Header + mesh->triindex); - s32 c; - while ( (c = *(tricmd++)) ) - { - if (c < 0) - c = -c; - - indexCount += ( c - 2 ) * 3; - vertexCount += c; - tricmd += ( 4 * c ); - } - - // indices - buffer->Indices.set_used ( indexCount ); - buffer->Vertices.set_used ( vertexCount ); - - // fill in static indices and vertex - u16 *index = buffer->Indices.pointer(); - video::S3DVertex * v = buffer->Vertices.pointer(); - - // blow up gl_triangle_fan/gl_triangle_strip to indexed triangle list - E_PRIMITIVE_TYPE type; - vertexCount = 0; - indexCount = 0; - tricmd = (s16*)((u8*)Header + mesh->triindex); - while ( (c = *(tricmd++)) ) - { - if (c < 0) - { - // triangle fan - c = -c; - type = EPT_TRIANGLE_FAN; - } - else - { - type = EPT_TRIANGLE_STRIP; - } - - for ( s32 g = 0; g < c; ++g, v += 1, tricmd += 4 ) - { - // fill vertex - #if 0 - const f32 *av = studioverts[tricmd[0]]; - v->Pos.X = av[0]; - v->Pos.Z = av[1]; - v->Pos.Y = av[2]; - - av = studionorms[tricmd[1]]; - v->Normal.X = av[0]; - v->Normal.Z = av[1]; - v->Normal.Y = av[2]; - - #endif - v->Normal.X = 0.f; - v->Normal.Z = 0.f; - v->Normal.Y = 1.f; - - v->TCoords.X = (tex_trans.X + tricmd[2])*tex_scale.X; - v->TCoords.Y = (tex_trans.Y + tricmd[3])*tex_scale.Y; - - v->Color.color = 0xFFFFFFFF; - - // fill index - if ( g < c - 2 ) - { - if ( type == EPT_TRIANGLE_FAN ) - { - index[indexCount+0] = vertexCount; - index[indexCount+1] = vertexCount+g+1; - index[indexCount+2] = vertexCount+g+2; - } - else - { - if ( g & 1 ) - { - index[indexCount+0] = vertexCount+g+1; - index[indexCount+1] = vertexCount+g+0; - index[indexCount+2] = vertexCount+g+2; - } - else - { - index[indexCount+0] = vertexCount+g+0; - index[indexCount+1] = vertexCount+g+1; - index[indexCount+2] = vertexCount+g+2; - } - } - - indexCount += 3; - } - } - - vertexCount += c; - } - - // material - video::SMaterial &m = buffer->getMaterial(); - - m.MaterialType = video::EMT_SOLID; - m.BackfaceCulling = true; - - if ( currentex->flags & STUDIO_NF_CHROME ) - { - // don't know what to do with chrome here - } - -#ifdef HL_TEXTURE_ATLAS - io::path store = TextureBaseName + "atlas"; -#else - io::path fname; - io::path ext; - core::splitFilename ( currentex->name, 0, &fname, &ext ); - io::path store = TextureBaseName + fname; -#endif - m.TextureLayer[0].Texture = SceneManager->getVideoDriver()->getTexture ( store ); - m.Lighting = false; - - MeshIPol->addMeshBuffer(buffer); - buffer->recalculateBoundingBox(); - buffer->drop(); - } // mesh - MeshIPol->recalculateBoundingBox(); - } // model - } // body part -} - - -/*! -*/ -void CAnimatedMeshHalfLife::buildVertices() -{ -/* - const u16 *skinref = (u16 *)((u8*)TextureHeader + TextureHeader->skinindex); - if (SkinGroupSelection != 0 && SkinGroupSelection < TextureHeader->numskinfamilies) - skinref += (SkinGroupSelection * TextureHeader->numskinref); -*/ - u32 meshBufferNr = 0; - for ( u32 bodypart = 0 ; bodypart < Header->numbodyparts; ++bodypart) - { - const SHalflifeBody *body = (SHalflifeBody *)((u8*) Header + Header->bodypartindex) + bodypart; - - for ( u32 modelnr = 0; modelnr < body->nummodels; ++modelnr ) - { - const SHalflifeModel *model = (SHalflifeModel *)((u8*) Header + body->modelindex) + modelnr; - - const u8 *vertbone = ((u8*)Header + model->vertinfoindex); - - const vec3_hl *studioverts = (vec3_hl *)((u8*)Header + model->vertindex); - - for (u32 i = 0; i < model->numverts; i++) - { - VectorTransform ( studioverts[i], BoneTransform[vertbone[i]], TransformedVerts[i] ); - } - /* - const u8 *normbone = ((u8*)Header + model->norminfoindex); - const vec3_hl *studionorms = (vec3_hl *)((u8*)Header + model->normindex); - for ( i = 0; i < model->numnorms; i++) - { - VectorTransform ( studionorms[i], BoneTransform[normbone[i]], TransformedNormals[i] ); - } - */ - for (u32 i = 0; i < model->nummesh; i++) - { - const SHalflifeMesh *mesh = (SHalflifeMesh *)((u8*)Header + model->meshindex) + i; - - IMeshBuffer * buffer = MeshIPol->getMeshBuffer ( meshBufferNr++ ); - video::S3DVertex* v = (video::S3DVertex* ) buffer->getVertices(); - - const s16 *tricmd = (s16*)((u8*)Header + mesh->triindex); - s32 c = 0; - while ( (c = *(tricmd++)) ) - { - if (c < 0) - c = -c; - - for (s32 g = 0; g < c; ++g, v += 1, tricmd += 4 ) - { - // fill vertex - const core::vector3df& av = TransformedVerts[tricmd[0]]; - v->Pos = av; - /* - const core::vector3df& an = TransformedNormals[tricmd[1]]; - v->Normal = an; - //v->Normal.normalize(); - */ - } - } // tricmd - } // nummesh - } // model - } // bodypart -} - - -/*! - render Bones -*/ -void CAnimatedMeshHalfLife::renderModel(u32 param, IVideoDriver * driver, const core::matrix4 &absoluteTransformation) -{ - const SHalflifeBone *bone = (SHalflifeBone *) ((u8 *) Header + Header->boneindex); - - const video::SColor blue(0xFF000080); - const video::SColor red(0xFF800000); - const video::SColor yellow(0xFF808000); - const video::SColor cyan(0xFF008080); - - core::aabbox3df box; - - for (u32 i = 0; i < Header->numbones; i++) - { - if (bone[i].parent >= 0) - { - getBoneVector ( box.MinEdge, bone[i].parent ); - getBoneVector ( box.MaxEdge, i ); - driver->draw3DLine ( box.MinEdge, box.MaxEdge, blue ); - - // draw parent bone node - if (bone[bone[i].parent].parent >=0 ) - { - getBoneBox ( box, bone[i].parent ); - driver->draw3DBox ( box, blue ); - } - getBoneBox ( box, i ); - driver->draw3DBox ( box, blue ); - } - else - { - // draw parent bone node - getBoneBox ( box, i, 1.f ); - driver->draw3DBox ( box , red ); - } - } - - // attachements - const SHalflifeAttachment *attach = (SHalflifeAttachment *) ((u8*) Header + Header->attachmentindex); - core::vector3df v[8]; - for (u32 i = 0; i < Header->numattachments; i++) - { - getTransformedBoneVector ( v[0],attach[i].bone,attach[i].org ); - getTransformedBoneVector ( v[1],attach[i].bone,attach[i].vectors[0] ); - getTransformedBoneVector ( v[2],attach[i].bone,attach[i].vectors[1] ); - getTransformedBoneVector ( v[3],attach[i].bone,attach[i].vectors[2] ); - driver->draw3DLine ( v[0], v[1], cyan ); - driver->draw3DLine ( v[0], v[2], cyan ); - driver->draw3DLine ( v[0], v[3], cyan ); - } - - // hit boxes - SHalflifeBBox *hitbox = (SHalflifeBBox *) ((u8*) Header + Header->hitboxindex); - vec3_hl v2[8]; - for (u32 i = 0; i < Header->numhitboxes; i++) - { - f32 *bbmin = hitbox[i].bbmin; - f32 *bbmax = hitbox[i].bbmax; - - v2[0][0] = bbmin[0]; - v2[0][1] = bbmax[1]; - v2[0][2] = bbmin[2]; - - v2[1][0] = bbmin[0]; - v2[1][1] = bbmin[1]; - v2[1][2] = bbmin[2]; - - v2[2][0] = bbmax[0]; - v2[2][1] = bbmax[1]; - v2[2][2] = bbmin[2]; - - v2[3][0] = bbmax[0]; - v2[3][1] = bbmin[1]; - v2[3][2] = bbmin[2]; - - v2[4][0] = bbmax[0]; - v2[4][1] = bbmax[1]; - v2[4][2] = bbmax[2]; - - v2[5][0] = bbmax[0]; - v2[5][1] = bbmin[1]; - v2[5][2] = bbmax[2]; - - v2[6][0] = bbmin[0]; - v2[6][1] = bbmax[1]; - v2[6][2] = bbmax[2]; - - v2[7][0] = bbmin[0]; - v2[7][1] = bbmin[1]; - v2[7][2] = bbmax[2]; - - for ( u32 g = 0; g < 8; ++g ) - getTransformedBoneVector ( v[g],hitbox[i].bone,v2[g] ); - - driver->draw3DLine(v[0], v[1], yellow); - driver->draw3DLine(v[1], v[3], yellow); - driver->draw3DLine(v[3], v[2], yellow); - driver->draw3DLine(v[2], v[0], yellow); - - driver->draw3DLine(v[4], v[5], yellow); - driver->draw3DLine(v[5], v[7], yellow); - driver->draw3DLine(v[7], v[6], yellow); - driver->draw3DLine(v[6], v[4], yellow); - - driver->draw3DLine(v[0], v[6], yellow); - driver->draw3DLine(v[1], v[7], yellow); - driver->draw3DLine(v[3], v[5], yellow); - driver->draw3DLine(v[2], v[4], yellow); - } -} - - -//! Returns the animated mesh based on a detail level. 0 is the lowest, 255 the highest detail. -IMesh* CAnimatedMeshHalfLife::getMesh(s32 frameInt, s32 detailLevel, s32 startFrameLoop, s32 endFrameLoop) -{ - const f32 frame = frameInt + (detailLevel * 0.001f); - const u32 frameA = core::floor32 ( frame ); -// f32 blend = core::fract ( frame ); - - SHalflifeSequence *seq = (SHalflifeSequence*) ((u8*) Header + Header->seqindex); - - // find SequenceIndex from summed list - u32 frameCount = 0; - for (u32 i = 0; i < Header->numseq; ++i) - { - const u32 val = core::max_ ( 1, seq[i].numframes - 1 ); - if ( frameCount + val > frameA ) - { - SequenceIndex = i; - CurrentFrame = frame - frameCount; - break; - } - frameCount += val; - } - - seq += SequenceIndex; - - //SetBodyPart ( 1, 1 ); - setUpBones (); - buildVertices(); - - MeshIPol->BoundingBox.MinEdge.X = seq->bbmin[0]; - MeshIPol->BoundingBox.MinEdge.Z = seq->bbmin[1]; - MeshIPol->BoundingBox.MinEdge.Y = seq->bbmin[2]; - - MeshIPol->BoundingBox.MaxEdge.X = seq->bbmax[0]; - MeshIPol->BoundingBox.MaxEdge.Z = seq->bbmax[1]; - MeshIPol->BoundingBox.MaxEdge.Y = seq->bbmax[2]; - - return MeshIPol; -} - - -/*! -*/ -void CAnimatedMeshHalfLife::initData () -{ - Header = 0; - TextureHeader = 0; - OwnTexModel = false; - - for (u32 i = 0; i < 32; ++i ) - AnimationHeader[i] = 0; - - SequenceIndex = 0; - CurrentFrame = 0.f; - - for (u32 i = 0; i < 5; ++i ) - BoneController[i] = 0; - - for (u32 i = 0; i < 2; ++i ) - Blending[i] = 0; - - SkinGroupSelection = 0; - - AnimList.clear(); - FrameCount = 0; - - if (!MeshIPol) - MeshIPol = new SMesh(); - MeshIPol->clear(); - -#ifdef HL_TEXTURE_ATLAS - TextureAtlas.release(); -#endif -} - - -/*! -*/ -void STextureAtlas::release() -{ - for (u32 i = 0; i < atlas.size(); i++) - { - if ( atlas[i].image ) - { - atlas[i].image->drop(); - atlas[i].image = 0; - } - } - Master = 0; -} - - -/*! -*/ -void STextureAtlas::addSource ( const c8 * name, video::IImage * image ) -{ - TextureAtlasEntry entry; - entry.name = name; - entry.image = image; - entry.width = image->getDimension().Width; - entry.height = image->getDimension().Height; - entry.pos.X = 0; - entry.pos.Y = 0; - atlas.push_back ( entry ); -} - - -/*! -*/ -void STextureAtlas::getScale(core::vector2df& scale) -{ - for (s32 i = static_cast<s32>(atlas.size()) - 1; i >= 0; --i) - { - if ( atlas[i].name == "_merged_" ) - { - scale.X = 1.f / atlas[i].width; - scale.Y = 1.f / atlas[i].height; - return; - } - } - scale.X = 1.f; - scale.Y = 1.f; -} - - -/*! -*/ -void STextureAtlas::getTranslation(const c8* name, core::vector2di& pos) -{ - for ( u32 i = 0; i < atlas.size(); ++i) - { - if ( atlas[i].name == name ) - { - pos = atlas[i].pos; - return; - } - } -} - - -/*! -*/ -void STextureAtlas::create(u32 border, E_TEXTURE_CLAMP texmode) -{ - u32 w = 0; - u32 w2; - u32 h2; - u32 h; - u32 wsum; - u32 hsum = 0; - ECOLOR_FORMAT format = ECF_R8G8B8; - - const s32 frame = core::s32_max ( 0, (border - 1 ) / 2 ); - - // sort for biggest coming first - atlas.sort(); - - // split size - wsum = frame; - for (u32 i = 0; i < atlas.size(); i++) - { - // make space - w2 = atlas[i].width + border; - - // align - w2 = (w2 + 1) & ~1; - wsum += w2; - } - u32 splitsize = 256; - if ( wsum > 512 ) - splitsize = 512; - - wsum = frame; - hsum = frame; - w = frame; - h = 0; - for (u32 i = 0; i < atlas.size(); i++) - { - if ( atlas[i].image->getColorFormat() == ECF_A8R8G8B8 ) - { - format = ECF_A8R8G8B8; - } - - // make space - w2 = atlas[i].width + border; - h2 = atlas[i].height + border; - - // align - w2 = (w2 + 1) & ~1; - h2 = (h2 + 1) & ~1; - - h = core::s32_max ( h, h2 ); - - if ( w + w2 >= splitsize ) - { - hsum += h; - wsum = core::s32_max ( wsum, w ); - h = h2; - w = frame; - } - - atlas[i].pos.X = w; - atlas[i].pos.Y = hsum; - - w += w2; - - } - hsum += h; - wsum = core::s32_max ( wsum, w ); - - // build image - const core::dimension2d<u32> dim = core::dimension2d<u32>( wsum, hsum ).getOptimalSize(); - IImage* master = new CImage(format, dim); - master->fill(0); - - video::SColor col[2]; - - static const u8 wrap[][4] = - { - {1, 0}, // ETC_REPEAT - {0, 1}, // ETC_CLAMP - {0, 1}, // ETC_CLAMP_TO_EDGE - {0, 1} // ETC_MIRROR - }; - - for (u32 i = 0; i < atlas.size(); i++) - { - atlas[i].image->copyTo ( master, atlas[i].pos ); - - // clamp/wrap ( copy edges, filtering needs it ) - - for (s32 b = 0; b < frame; ++b ) - { - for (s32 a = 0 - b; a <= (s32) atlas[i].width + b; ++a ) - { - col[0] = atlas[i].image->getPixel ( core::s32_clamp ( a, 0, atlas[i].width - 1 ), 0 ); - col[1] = atlas[i].image->getPixel ( core::s32_clamp ( a, 0, atlas[i].width - 1 ), atlas[i].height - 1 ); - - master->setPixel ( atlas[i].pos.X + a, atlas[i].pos.Y + ( b + 1 ) * -1, col[wrap[texmode][0]] ); - master->setPixel ( atlas[i].pos.X + a, atlas[i].pos.Y + atlas[i].height - 1 + ( b + 1 ) * 1, col[wrap[texmode][1]] ); - } - - for (s32 a = -1 - b; a <= (s32) atlas[i].height + b; ++a ) - { - col[0] = atlas[i].image->getPixel ( 0, core::s32_clamp ( a, 0, atlas[i].height - 1 ) ); - col[1] = atlas[i].image->getPixel ( atlas[i].width - 1, core::s32_clamp ( a, 0, atlas[i].height - 1 ) ); - - master->setPixel ( atlas[i].pos.X + ( b + 1 ) * -1, atlas[i].pos.Y + a, col[wrap[texmode][0]] ); - master->setPixel ( atlas[i].pos.X + atlas[i].width + b, atlas[i].pos.Y + a, col[wrap[texmode][1]] ); - } - } - } - - addSource ( "_merged_", master ); - Master = master; -} - - -/*! -*/ -SHalflifeHeader* CAnimatedMeshHalfLife::loadModel(io::IReadFile* file, const io::path& filename) -{ - bool closefile = false; - - // if secondary files are needed, open here and mark for closing - if ( 0 == file ) - { - file = SceneManager->getFileSystem()->createAndOpenFile(filename); - closefile = true; - } - - if ( 0 == file ) - return 0; - - // read into memory - u8* pin = new u8[file->getSize()]; - file->read(pin, file->getSize()); - - SHalflifeHeader* header = (SHalflifeHeader*) pin; - - const bool idst = (0 == strncmp(header->id, "IDST", 4)); - const bool idsq = (0 == strncmp(header->id, "IDSQ", 4)); - - if ( (!idst && !idsq) || (idsq && !Header) ) - { - os::Printer::log("MDL Halflife Loader: Wrong file header", file->getFileName(), ELL_WARNING); - if ( closefile ) - { - file->drop(); - file = 0; - } - delete [] pin; - return 0; - } - - // don't know the real header.. idsg might be different - if (header->textureindex && idst ) - { - io::path path; - io::path fname; - io::path ext; - - core::splitFilename(file->getFileName(), &path, &fname, &ext); - TextureBaseName = path + fname + "_"; - - const SHalflifeTexture *tex = (SHalflifeTexture *)(pin + header->textureindex); - u32 *palette = new u32[256]; - for (u32 i = 0; i < header->numtextures; ++i) - { - const u8 *src = pin + tex[i].index; - - // convert rgb to argb palette - { - const u8 *pal = src + tex[i].width * tex[i].height; - for( u32 g=0; g<256; ++g ) - { - palette[g] = 0xFF000000 | pal[0] << 16 | pal[1] << 8 | pal[2]; - pal += 3; - } - } - - IImage* image = SceneManager->getVideoDriver()->createImage(ECF_R8G8B8, core::dimension2d<u32>(tex[i].width, tex[i].height)); - - CColorConverter::convert8BitTo24Bit(src, (u8*)image->getData(), tex[i].width, tex[i].height, (u8*) palette, 0, false); - -#ifdef HL_TEXTURE_ATLAS - TextureAtlas.addSource ( tex[i].name, image ); -#else - core::splitFilename ( tex[i].name, 0, &fname, &ext ); - SceneManager->getVideoDriver()->addTexture ( TextureBaseName + fname, image ); - image->drop(); -#endif - } - delete [] palette; - -#ifdef HL_TEXTURE_ATLAS - TextureAtlas.create ( 2 * 2 + 1, ETC_CLAMP ); - SceneManager->getVideoDriver()->addTexture ( TextureBaseName + "atlas", TextureAtlas.Master ); - TextureAtlas.release(); -#endif - } - - if (!Header) - Header = header; - - if ( closefile ) - { - file->drop(); - file = 0; - } - - return header; -} - - -/*! -*/ -f32 CAnimatedMeshHalfLife::SetController( s32 controllerIndex, f32 value ) -{ - if (!Header) - return 0.f; - - SHalflifeBoneController *bonecontroller = (SHalflifeBoneController *)((u8*) Header + Header->bonecontrollerindex); - - // find first controller that matches the index - u32 i; - for (i = 0; i < Header->numbonecontrollers; i++, bonecontroller++) - { - if (bonecontroller->index == controllerIndex) - break; - } - if (i >= Header->numbonecontrollers) - return value; - - // wrap 0..360 if it's a rotational controller - if (bonecontroller->type & (STUDIO_XR | STUDIO_YR | STUDIO_ZR)) - { - // ugly hack, invert value if end < start - if (bonecontroller->end < bonecontroller->start) - value = -value; - - // does the controller not wrap? - if (bonecontroller->start + 359.f >= bonecontroller->end) - { - if (value > ((bonecontroller->start + bonecontroller->end) / 2.f) + 180.f) - value = value - 360.f; - if (value < ((bonecontroller->start + bonecontroller->end) / 2.f) - 180.f) - value = value + 360.f; - } - else - { - if (value > 360.f) - value = value - (s32)(value / 360.f) * 360.f; - else if (value < 0.f) - value = value + (s32)((value / -360.f) + 1) * 360.f; - } - } - - const s32 range = controllerIndex == MOUTH_CONTROLLER ? 64 : 255; - - s32 setting = (s32) ( (f32) range * (value - bonecontroller->start) / (bonecontroller->end - bonecontroller->start)); - - if (setting < 0) setting = 0; - if (setting > range) setting = range; - - BoneController[controllerIndex] = setting; - - return setting * (1.f / (f32) range ) * (bonecontroller->end - bonecontroller->start) + bonecontroller->start; -} - - -/*! -*/ -u32 CAnimatedMeshHalfLife::SetSkin( u32 value ) -{ - if (value < Header->numskinfamilies) - SkinGroupSelection = value; - - return SkinGroupSelection; -} - - -/*! -*/ -bool CAnimatedMeshHalfLife::postLoadModel( const io::path &filename ) -{ - io::path path; - io::path texname; - io::path submodel; - - core::splitFilename ( filename ,&path, &texname, 0 ); - - // preload textures - // if no textures are stored in main file, use texfile - if (Header->numtextures == 0) - { - submodel = path + texname + "T.mdl"; - TextureHeader = loadModel(0, submodel); - if (!TextureHeader) - return false; - OwnTexModel = true; - } - else - { - TextureHeader = Header; - OwnTexModel = false; - } - - // preload animations - if (Header->numseqgroups > 1) - { - c8 seq[8]; - for (u32 i = 1; i < Header->numseqgroups; i++) - { - snprintf_irr( seq, 8, "%02u.mdl", i ); - submodel = path + texname + seq; - - AnimationHeader[i] = loadModel(0, submodel); - if (!AnimationHeader[i]) - return false; - } - } - - return true; -} - - -/*! -*/ -void CAnimatedMeshHalfLife::dumpModelInfo(u32 level) const -{ - const u8 *phdr = (const u8*) Header; - const SHalflifeHeader * hdr = Header; - - if (level == 0) - { - printf ( - "Bones: %u\n" - "Bone Controllers: %u\n" - "Hit Boxes: %u\n" - "Sequences: %u\n" - "Sequence Groups: %u\n", - hdr->numbones, - hdr->numbonecontrollers, - hdr->numhitboxes, - hdr->numseq, - hdr->numseqgroups - ); - printf ( - "Textures: %u\n" - "Skin Families: %u\n" - "Bodyparts: %u\n" - "Attachments: %u\n" - "Transitions: %d\n", - hdr->numtextures, - hdr->numskinfamilies, - hdr->numbodyparts, - hdr->numattachments, - hdr->numtransitions); - return; - } - - printf("id: %c%c%c%c\n", phdr[0], phdr[1], phdr[2], phdr[3]); - printf("version: %d\n", hdr->version); - printf("name: \"%s\"\n", hdr->name); - printf("length: %d\n\n", hdr->length); - - printf("eyeposition: %f %f %f\n", hdr->eyeposition[0], hdr->eyeposition[1], hdr->eyeposition[2]); - printf("min: %f %f %f\n", hdr->min[0], hdr->min[1], hdr->min[2]); - printf("max: %f %f %f\n", hdr->max[0], hdr->max[1], hdr->max[2]); - printf("bbmin: %f %f %f\n", hdr->bbmin[0], hdr->bbmin[1], hdr->bbmin[2]); - printf("bbmax: %f %f %f\n", hdr->bbmax[0], hdr->bbmax[1], hdr->bbmax[2]); - - printf("flags: %d\n\n", hdr->flags); - - printf("numbones: %u\n", hdr->numbones); - for (u32 i = 0; i < hdr->numbones; i++) - { - const SHalflifeBone *bone = (const SHalflifeBone *) (phdr + hdr->boneindex); - printf("bone %u.name: \"%s\"\n", i + 1, bone[i].name); - printf("bone %u.parent: %d\n", i + 1, bone[i].parent); - printf("bone %u.flags: %d\n", i + 1, bone[i].flags); - printf("bone %u.bonecontroller: %d %d %d %d %d %d\n", i + 1, bone[i].bonecontroller[0], bone[i].bonecontroller[1], bone[i].bonecontroller[2], bone[i].bonecontroller[3], bone[i].bonecontroller[4], bone[i].bonecontroller[5]); - printf("bone %u.value: %f %f %f %f %f %f\n", i + 1, bone[i].value[0], bone[i].value[1], bone[i].value[2], bone[i].value[3], bone[i].value[4], bone[i].value[5]); - printf("bone %u.scale: %f %f %f %f %f %f\n", i + 1, bone[i].scale[0], bone[i].scale[1], bone[i].scale[2], bone[i].scale[3], bone[i].scale[4], bone[i].scale[5]); - } - - printf("\nnumbonecontrollers: %u\n", hdr->numbonecontrollers); - const SHalflifeBoneController *bonecontrollers = (const SHalflifeBoneController *) (phdr + hdr->bonecontrollerindex); - for (u32 i = 0; i < hdr->numbonecontrollers; i++) - { - printf("bonecontroller %u.bone: %d\n", i + 1, bonecontrollers[i].bone); - printf("bonecontroller %u.type: %d\n", i + 1, bonecontrollers[i].type); - printf("bonecontroller %u.start: %f\n", i + 1, bonecontrollers[i].start); - printf("bonecontroller %u.end: %f\n", i + 1, bonecontrollers[i].end); - printf("bonecontroller %u.rest: %d\n", i + 1, bonecontrollers[i].rest); - printf("bonecontroller %u.index: %d\n", i + 1, bonecontrollers[i].index); - } - - printf("\nnumhitboxes: %u\n", hdr->numhitboxes); - const SHalflifeBBox *box = (const SHalflifeBBox *) (phdr + hdr->hitboxindex); - for (u32 i = 0; i < hdr->numhitboxes; i++) - { - printf("hitbox %u.bone: %d\n", i + 1, box[i].bone); - printf("hitbox %u.group: %d\n", i + 1, box[i].group); - printf("hitbox %u.bbmin: %f %f %f\n", i + 1, box[i].bbmin[0], box[i].bbmin[1], box[i].bbmin[2]); - printf("hitbox %u.bbmax: %f %f %f\n", i + 1, box[i].bbmax[0], box[i].bbmax[1], box[i].bbmax[2]); - } - - printf("\nnumseq: %u\n", hdr->numseq); - const SHalflifeSequence *seq = (const SHalflifeSequence *) (phdr + hdr->seqindex); - for (u32 i = 0; i < hdr->numseq; i++) - { - printf("seqdesc %u.label: \"%s\"\n", i + 1, seq[i].label); - printf("seqdesc %u.fps: %f\n", i + 1, seq[i].fps); - printf("seqdesc %u.flags: %d\n", i + 1, seq[i].flags); - printf("<...>\n"); - } - - printf("\nnumseqgroups: %u\n", hdr->numseqgroups); - for (u32 i = 0; i < hdr->numseqgroups; i++) - { - const SHalflifeSequenceGroup *group = (const SHalflifeSequenceGroup *) (phdr + hdr->seqgroupindex); - printf("\nseqgroup %u.label: \"%s\"\n", i + 1, group[i].label); - printf("\nseqgroup %u.namel: \"%s\"\n", i + 1, group[i].name); - printf("\nseqgroup %u.data: %d\n", i + 1, group[i].data); - } - - printf("\nnumskinref: %u\n", hdr->numskinref); - printf("numskinfamilies: %u\n", hdr->numskinfamilies); - - printf("\nnumbodyparts: %u\n", hdr->numbodyparts); - const SHalflifeBody *pbodyparts = (const SHalflifeBody*) ((const u8*) hdr + hdr->bodypartindex); - for (u32 i = 0; i < hdr->numbodyparts; i++) - { - printf("bodypart %u.name: \"%s\"\n", i + 1, pbodyparts[i].name); - printf("bodypart %u.nummodels: %u\n", i + 1, pbodyparts[i].nummodels); - printf("bodypart %u.base: %u\n", i + 1, pbodyparts[i].base); - printf("bodypart %u.modelindex: %u\n", i + 1, pbodyparts[i].modelindex); - } - - printf("\nnumattachments: %u\n", hdr->numattachments); - for (u32 i = 0; i < hdr->numattachments; i++) - { - const SHalflifeAttachment *attach = (const SHalflifeAttachment *) ((const u8*) hdr + hdr->attachmentindex); - printf("attachment %u.name: \"%s\"\n", i + 1, attach[i].name); - } - - hdr = TextureHeader; - printf("\nnumtextures: %u\n", hdr->numtextures); - printf("textureindex: %u\n", hdr->textureindex); - printf("texturedataindex: %u\n", hdr->texturedataindex); - const SHalflifeTexture *ptextures = (const SHalflifeTexture *) ((const u8*) hdr + hdr->textureindex); - for (u32 i = 0; i < hdr->numtextures; i++) - { - printf("texture %u.name: \"%s\"\n", i + 1, ptextures[i].name); - printf("texture %u.flags: %d\n", i + 1, ptextures[i].flags); - printf("texture %u.width: %d\n", i + 1, ptextures[i].width); - printf("texture %u.height: %d\n", i + 1, ptextures[i].height); - printf("texture %u.index: %d\n", i + 1, ptextures[i].index); - } -} - - -/*! -*/ -void CAnimatedMeshHalfLife::ExtractBbox(s32 sequence, core::aabbox3df &box) const -{ - const SHalflifeSequence *seq = (const SHalflifeSequence *)((const u8*)Header + Header->seqindex) + sequence; - - box.MinEdge.X = seq[0].bbmin[0]; - box.MinEdge.Y = seq[0].bbmin[1]; - box.MinEdge.Z = seq[0].bbmin[2]; - - box.MaxEdge.X = seq[0].bbmax[0]; - box.MaxEdge.Y = seq[0].bbmax[1]; - box.MaxEdge.Z = seq[0].bbmax[2]; -} - - -/*! -*/ -void CAnimatedMeshHalfLife::calcBoneAdj() -{ - const SHalflifeBoneController *bonecontroller = - (const SHalflifeBoneController *)((const u8*) Header + Header->bonecontrollerindex); - - for (u32 j = 0; j < Header->numbonecontrollers; j++) - { - const s32 i = bonecontroller[j].index; - // check for 360% wrapping - f32 value; - if (bonecontroller[j].type & STUDIO_RLOOP) - { - value = BoneController[i] * (360.f/256.f) + bonecontroller[j].start; - } - else - { - const f32 range = i <= 3 ? 255.f : 64.f; - value = core::clamp(BoneController[i] / range,0.f,1.f); - value = (1.f - value) * bonecontroller[j].start + value * bonecontroller[j].end; - } - - switch(bonecontroller[j].type & STUDIO_TYPES) - { - case STUDIO_XR: - case STUDIO_YR: - case STUDIO_ZR: - BoneAdj[j] = value * core::DEGTORAD; - break; - case STUDIO_X: - case STUDIO_Y: - case STUDIO_Z: - BoneAdj[j] = value; - break; - } - } -} - - -/*! -*/ -void CAnimatedMeshHalfLife::calcBoneQuaternion(const s32 frame, const SHalflifeBone * const bone, - SHalflifeAnimOffset *anim, const u32 j, f32& angle1, f32& angle2) const -{ - // three vector components - if (anim->offset[j+3] == 0) - { - angle2 = angle1 = bone->value[j+3]; // default - } - else - { - SHalflifeAnimationFrame *animvalue = (SHalflifeAnimationFrame *)((u8*)anim + anim->offset[j+3]); - s32 k = frame; - while (animvalue->num.total <= k) - { - k -= animvalue->num.total; - animvalue += animvalue->num.valid + 1; - } - // Bah, missing blend! - if (animvalue->num.valid > k) - { - angle1 = animvalue[k+1].value; - - if (animvalue->num.valid > k + 1) - { - angle2 = animvalue[k+2].value; - } - else - { - if (animvalue->num.total > k + 1) - angle2 = angle1; - else - angle2 = animvalue[animvalue->num.valid+2].value; - } - } - else - { - angle1 = animvalue[animvalue->num.valid].value; - if (animvalue->num.total > k + 1) - { - angle2 = angle1; - } - else - { - angle2 = animvalue[animvalue->num.valid + 2].value; - } - } - angle1 = bone->value[j+3] + angle1 * bone->scale[j+3]; - angle2 = bone->value[j+3] + angle2 * bone->scale[j+3]; - } - - if (bone->bonecontroller[j+3] != -1) - { - angle1 += BoneAdj[bone->bonecontroller[j+3]]; - angle2 += BoneAdj[bone->bonecontroller[j+3]]; - } -} - - -/*! -*/ -void CAnimatedMeshHalfLife::calcBonePosition(const s32 frame, f32 s, - const SHalflifeBone * const bone, SHalflifeAnimOffset *anim, f32 *pos) const -{ - for (s32 j = 0; j < 3; ++j) - { - pos[j] = bone->value[j]; // default; - if (anim->offset[j] != 0) - { - SHalflifeAnimationFrame *animvalue = (SHalflifeAnimationFrame *)((u8*)anim + anim->offset[j]); - - s32 k = frame; - // find span of values that includes the frame we want - while (animvalue->num.total <= k) - { - k -= animvalue->num.total; - animvalue += animvalue->num.valid + 1; - } - // if we're inside the span - if (animvalue->num.valid > k) - { - // and there's more data in the span - if (animvalue->num.valid > k + 1) - { - pos[j] += (animvalue[k+1].value * (1.f - s) + s * animvalue[k+2].value) * bone->scale[j]; - } - else - { - pos[j] += animvalue[k+1].value * bone->scale[j]; - } - } - else - { - // are we at the end of the repeating values section and there's another section with data? - if (animvalue->num.total <= k + 1) - { - pos[j] += (animvalue[animvalue->num.valid].value * (1.f - s) + s * animvalue[animvalue->num.valid + 2].value) * bone->scale[j]; - } - else - { - pos[j] += animvalue[animvalue->num.valid].value * bone->scale[j]; - } - } - } - if (bone->bonecontroller[j] != -1) - { - pos[j] += BoneAdj[bone->bonecontroller[j]]; - } - } -} - - -/*! -*/ -void CAnimatedMeshHalfLife::calcRotations(vec3_hl *pos, vec4_hl *q, - SHalflifeSequence *seq, SHalflifeAnimOffset *anim, f32 f) -{ - const s32 frame = (s32)f; - const f32 s = (f - frame); - - // add in programatic controllers - calcBoneAdj(); - - SHalflifeBone *bone = (SHalflifeBone *)((u8 *)Header + Header->boneindex); - for ( u32 i = 0; i < Header->numbones; i++, bone++, anim++) - { - core::vector3df angle1, angle2; - calcBoneQuaternion(frame, bone, anim, 0, angle1.X, angle2.X); - calcBoneQuaternion(frame, bone, anim, 1, angle1.Y, angle2.Y); - calcBoneQuaternion(frame, bone, anim, 2, angle1.Z, angle2.Z); - - if (!angle1.equals(angle2)) - { - vec4_hl q1, q2; - AngleQuaternion( angle1, q1 ); - AngleQuaternion( angle2, q2 ); - QuaternionSlerp( q1, q2, s, q[i] ); - } - else - { - AngleQuaternion( angle1, q[i] ); - } - - calcBonePosition(frame, s, bone, anim, pos[i]); - } - - if (seq->motiontype & STUDIO_X) - pos[seq->motionbone][0] = 0.f; - if (seq->motiontype & STUDIO_Y) - pos[seq->motionbone][1] = 0.f; - if (seq->motiontype & STUDIO_Z) - pos[seq->motionbone][2] = 0.f; -} - - -/*! -*/ -SHalflifeAnimOffset * CAnimatedMeshHalfLife::getAnim( SHalflifeSequence *seq ) -{ - SHalflifeSequenceGroup *seqgroup = (SHalflifeSequenceGroup *)((u8*)Header + Header->seqgroupindex) + seq->seqgroup; - - if (seq->seqgroup == 0) - { - return (SHalflifeAnimOffset *)((u8*)Header + seqgroup->data + seq->animindex); - } - - return (SHalflifeAnimOffset *)((u8*)AnimationHeader[seq->seqgroup] + seq->animindex); -} - - -/*! -*/ -void CAnimatedMeshHalfLife::slerpBones(vec4_hl q1[], vec3_hl pos1[], vec4_hl q2[], vec3_hl pos2[], f32 s) -{ - if (s < 0) - s = 0; - else if (s > 1.f) - s = 1.f; - - f32 s1 = 1.f - s; - - for ( u32 i = 0; i < Header->numbones; i++) - { - vec4_hl q3; - QuaternionSlerp( q1[i], q2[i], s, q3 ); - q1[i][0] = q3[0]; - q1[i][1] = q3[1]; - q1[i][2] = q3[2]; - q1[i][3] = q3[3]; - pos1[i][0] = pos1[i][0] * s1 + pos2[i][0] * s; - pos1[i][1] = pos1[i][1] * s1 + pos2[i][1] * s; - pos1[i][2] = pos1[i][2] * s1 + pos2[i][2] * s; - } -} - - -/*! -*/ -void CAnimatedMeshHalfLife::setUpBones() -{ - static vec3_hl pos[MAXSTUDIOBONES]; - f32 bonematrix[3][4]; - static vec4_hl q[MAXSTUDIOBONES]; - - static vec3_hl pos2[MAXSTUDIOBONES]; - static vec4_hl q2[MAXSTUDIOBONES]; - static vec3_hl pos3[MAXSTUDIOBONES]; - static vec4_hl q3[MAXSTUDIOBONES]; - static vec3_hl pos4[MAXSTUDIOBONES]; - static vec4_hl q4[MAXSTUDIOBONES]; - - if (SequenceIndex >= Header->numseq) - SequenceIndex = 0; - - SHalflifeSequence *seq = (SHalflifeSequence *)((u8*) Header + Header->seqindex) + SequenceIndex; - - SHalflifeAnimOffset *anim = getAnim(seq); - calcRotations(pos, q, seq, anim, CurrentFrame); - - if (seq->numblends > 1) - { - anim += Header->numbones; - calcRotations( pos2, q2, seq, anim, CurrentFrame ); - f32 s = Blending[0] / 255.f; - - slerpBones( q, pos, q2, pos2, s ); - - if (seq->numblends == 4) - { - anim += Header->numbones; - calcRotations( pos3, q3, seq, anim, CurrentFrame ); - - anim += Header->numbones; - calcRotations( pos4, q4, seq, anim, CurrentFrame ); - - s = Blending[0] / 255.f; - slerpBones( q3, pos3, q4, pos4, s ); - - s = Blending[1] / 255.f; - slerpBones( q, pos, q3, pos3, s ); - } - } - - const SHalflifeBone *bone = (SHalflifeBone *)((u8*) Header + Header->boneindex); - - for (u32 i = 0; i < Header->numbones; i++) - { - QuaternionMatrix( q[i], bonematrix ); - - bonematrix[0][3] = pos[i][0]; - bonematrix[1][3] = pos[i][1]; - bonematrix[2][3] = pos[i][2]; - - if (bone[i].parent == -1) { - memcpy(BoneTransform[i], bonematrix, sizeof(f32) * 12); - } - else { - R_ConcatTransforms (BoneTransform[bone[i].parent], bonematrix, BoneTransform[i]); - } - } -} - - -//! Returns an axis aligned bounding box -const core::aabbox3d<f32>& CAnimatedMeshHalfLife::getBoundingBox() const -{ - return MeshIPol->BoundingBox; -} - - -//! Returns the type of the animated mesh. -E_ANIMATED_MESH_TYPE CAnimatedMeshHalfLife::getMeshType() const -{ - return EAMT_MDL_HALFLIFE; -} - - -//! returns amount of mesh buffers. -u32 CAnimatedMeshHalfLife::getMeshBufferCount() const -{ - return MeshIPol->getMeshBufferCount(); -} - - -//! returns pointer to a mesh buffer -IMeshBuffer* CAnimatedMeshHalfLife::getMeshBuffer(u32 nr) const -{ - return MeshIPol->getMeshBuffer(nr); -} - - -//! Returns pointer to a mesh buffer which fits a material -/** \param material: material to search for -\return Returns the pointer to the mesh buffer or -NULL if there is no such mesh buffer. */ -IMeshBuffer* CAnimatedMeshHalfLife::getMeshBuffer(const video::SMaterial &material) const -{ - return MeshIPol->getMeshBuffer(material); -} - - -void CAnimatedMeshHalfLife::setMaterialFlag(video::E_MATERIAL_FLAG flag, bool newvalue) -{ - MeshIPol->setMaterialFlag ( flag, newvalue ); -} - - -//! set user axis aligned bounding box -void CAnimatedMeshHalfLife::setBoundingBox(const core::aabbox3df& box) -{ - MeshIPol->setBoundingBox(box); -} - - -} // end namespace scene -} // end namespace irr - -#endif // _IRR_COMPILE_WITH_MD3_LOADER_ - diff --git a/source/Irrlicht/CAnimatedMeshHalfLife.h b/source/Irrlicht/CAnimatedMeshHalfLife.h deleted file mode 100644 index 19c14c00..00000000 --- a/source/Irrlicht/CAnimatedMeshHalfLife.h +++ /dev/null @@ -1,630 +0,0 @@ -// Copyright (C) 2002-2012 Thomas Alten -// This file is part of the "Irrlicht Engine". -// For conditions of distribution and use, see copyright notice in irrlicht.h - -#ifndef __C_ANIMATED_MESH_HALFLIFE_H_INCLUDED__ -#define __C_ANIMATED_MESH_HALFLIFE_H_INCLUDED__ - -#include "IAnimatedMesh.h" -#include "ISceneManager.h" -#include "irrArray.h" -#include "irrString.h" -#include "IMeshLoader.h" -#include "SMesh.h" -#include "IReadFile.h" - -namespace irr -{ -namespace scene -{ - - - // STUDIO MODELS, Copyright (c) 1998, Valve LLC. All rights reserved. - #define MAXSTUDIOTRIANGLES 20000 // TODO: tune this - #define MAXSTUDIOVERTS 2048 // TODO: tune this - #define MAXSTUDIOSEQUENCES 256 // total animation sequences - #define MAXSTUDIOSKINS 100 // total textures - #define MAXSTUDIOSRCBONES 512 // bones allowed at source movement - #define MAXSTUDIOBONES 128 // total bones actually used - #define MAXSTUDIOMODELS 32 // sub-models per model - #define MAXSTUDIOBODYPARTS 32 - #define MAXSTUDIOGROUPS 4 - #define MAXSTUDIOANIMATIONS 512 // per sequence - #define MAXSTUDIOMESHES 256 - #define MAXSTUDIOEVENTS 1024 - #define MAXSTUDIOPIVOTS 256 - #define MAXSTUDIOCONTROLLERS 8 - - typedef f32 vec3_hl[3]; // x,y,z - typedef f32 vec4_hl[4]; // x,y,z,w - -// byte-align structures -#include "irrpack.h" - - struct SHalflifeHeader - { - c8 id[4]; - s32 version; - - c8 name[64]; - s32 length; - - vec3_hl eyeposition; // ideal eye position - vec3_hl min; // ideal movement hull size - vec3_hl max; - - vec3_hl bbmin; // clipping bounding box - vec3_hl bbmax; - - s32 flags; - - u32 numbones; // bones - u32 boneindex; - - u32 numbonecontrollers; // bone controllers - u32 bonecontrollerindex; - - u32 numhitboxes; // complex bounding boxes - u32 hitboxindex; - - u32 numseq; // animation sequences - u32 seqindex; - - u32 numseqgroups; // demand loaded sequences - u32 seqgroupindex; - - u32 numtextures; // raw textures - u32 textureindex; - u32 texturedataindex; - - u32 numskinref; // replaceable textures - u32 numskinfamilies; - u32 skinindex; - - u32 numbodyparts; - u32 bodypartindex; - - u32 numattachments; // queryable attachable points - u32 attachmentindex; - - s32 soundtable; - s32 soundindex; - s32 soundgroups; - s32 soundgroupindex; - - s32 numtransitions; // animation node to animation node transition graph - s32 transitionindex; - } PACK_STRUCT; - - // header for demand loaded sequence group data - struct studioseqhdr_t - { - s32 id; - s32 version; - - c8 name[64]; - s32 length; - } PACK_STRUCT; - - // bones - struct SHalflifeBone - { - c8 name[32]; // bone name for symbolic links - s32 parent; // parent bone - s32 flags; // ?? - s32 bonecontroller[6]; // bone controller index, -1 == none - f32 value[6]; // default DoF values - f32 scale[6]; // scale for delta DoF values - } PACK_STRUCT; - - - // bone controllers - struct SHalflifeBoneController - { - s32 bone; // -1 == 0 - s32 type; // X, Y, Z, XR, YR, ZR, M - f32 start; - f32 end; - s32 rest; // byte index value at rest - s32 index; // 0-3 user set controller, 4 mouth - } PACK_STRUCT; - - // intersection boxes - struct SHalflifeBBox - { - s32 bone; - s32 group; // intersection group - vec3_hl bbmin; // bounding box - vec3_hl bbmax; - } PACK_STRUCT; - -#ifndef ZONE_H - // NOTE: this was a void*, but that crashes on 64bit. - // I have found no mdl format desc, so not sure what it's meant to be, but s32 at least works. - typedef s32 cache_user_t; -#endif - - // demand loaded sequence groups - struct SHalflifeSequenceGroup - { - c8 label[32]; // textual name - c8 name[64]; // file name - cache_user_t cache; // cache index pointer - s32 data; // hack for group 0 - } PACK_STRUCT; - - // sequence descriptions - struct SHalflifeSequence - { - c8 label[32]; // sequence label - - f32 fps; // frames per second - s32 flags; // looping/non-looping flags - - s32 activity; - s32 actweight; - - s32 numevents; - s32 eventindex; - - s32 numframes; // number of frames per sequence - - u32 numpivots; // number of foot pivots - u32 pivotindex; - - s32 motiontype; - s32 motionbone; - vec3_hl linearmovement; - s32 automoveposindex; - s32 automoveangleindex; - - vec3_hl bbmin; // per sequence bounding box - vec3_hl bbmax; - - s32 numblends; - s32 animindex; // SHalflifeAnimOffset pointer relative to start of sequence group data - // [blend][bone][X, Y, Z, XR, YR, ZR] - - s32 blendtype[2]; // X, Y, Z, XR, YR, ZR - f32 blendstart[2]; // starting value - f32 blendend[2]; // ending value - s32 blendparent; - - s32 seqgroup; // sequence group for demand loading - - s32 entrynode; // transition node at entry - s32 exitnode; // transition node at exit - s32 nodeflags; // transition rules - - s32 nextseq; // auto advancing sequences - } PACK_STRUCT; - - // events - struct mstudioevent_t - { - s32 frame; - s32 event; - s32 type; - c8 options[64]; - } PACK_STRUCT; - - - // pivots - struct mstudiopivot_t - { - vec3_hl org; // pivot point - s32 start; - s32 end; - } PACK_STRUCT; - - // attachment - struct SHalflifeAttachment - { - c8 name[32]; - s32 type; - s32 bone; - vec3_hl org; // attachment point - vec3_hl vectors[3]; - } PACK_STRUCT; - - struct SHalflifeAnimOffset - { - u16 offset[6]; - } PACK_STRUCT; - - // animation frames - union SHalflifeAnimationFrame - { - struct { - u8 valid; - u8 total; - } PACK_STRUCT num; - s16 value; - } PACK_STRUCT; - - - // body part index - struct SHalflifeBody - { - c8 name[64]; - u32 nummodels; - u32 base; - u32 modelindex; // index into models array - } PACK_STRUCT; - - - // skin info - struct SHalflifeTexture - { - c8 name[64]; - s32 flags; - s32 width; - s32 height; - s32 index; - } PACK_STRUCT; - - - // skin families - // short index[skinfamilies][skinref] - - // studio models - struct SHalflifeModel - { - c8 name[64]; - s32 type; - - f32 boundingradius; - - u32 nummesh; - u32 meshindex; - - u32 numverts; // number of unique vertices - u32 vertinfoindex; // vertex bone info - u32 vertindex; // vertex vec3_hl - u32 numnorms; // number of unique surface normals - u32 norminfoindex; // normal bone info - u32 normindex; // normal vec3_hl - - u32 numgroups; // deformation groups - u32 groupindex; - } PACK_STRUCT; - - - // meshes - struct SHalflifeMesh - { - u32 numtris; - u32 triindex; - u32 skinref; - u32 numnorms; // per mesh normals - u32 normindex; // normal vec3_hl - } PACK_STRUCT; - -// Default alignment -#include "irrunpack.h" - - // lighting options - #define STUDIO_NF_FLATSHADE 0x0001 - #define STUDIO_NF_CHROME 0x0002 - #define STUDIO_NF_FULLBRIGHT 0x0004 - - // motion flags - #define STUDIO_X 0x0001 - #define STUDIO_Y 0x0002 - #define STUDIO_Z 0x0004 - #define STUDIO_XR 0x0008 - #define STUDIO_YR 0x0010 - #define STUDIO_ZR 0x0020 - #define STUDIO_LX 0x0040 - #define STUDIO_LY 0x0080 - #define STUDIO_LZ 0x0100 - #define STUDIO_AX 0x0200 - #define STUDIO_AY 0x0400 - #define STUDIO_AZ 0x0800 - #define STUDIO_AXR 0x1000 - #define STUDIO_AYR 0x2000 - #define STUDIO_AZR 0x4000 - #define STUDIO_TYPES 0x7FFF - #define STUDIO_RLOOP 0x8000 // controller that wraps shortest distance - - // sequence flags - #define STUDIO_LOOPING 0x0001 - - // bone flags - #define STUDIO_HAS_NORMALS 0x0001 - #define STUDIO_HAS_VERTICES 0x0002 - #define STUDIO_HAS_BBOX 0x0004 - #define STUDIO_HAS_CHROME 0x0008 // if any of the textures have chrome on them - - #define RAD_TO_STUDIO (32768.0/M_PI) - #define STUDIO_TO_RAD (M_PI/32768.0) - - /*! - Textureatlas - Combine Source Images with arbitrary size and bithdepth to an Image with 2^n size - borders from the source images are copied around for allowing filtering ( bilinear, mipmap ) - */ - struct STextureAtlas - { - STextureAtlas () - { - release(); - } - - virtual ~STextureAtlas () - { - release (); - } - - void release (); - void addSource ( const c8 * name, video::IImage * image ); - void create ( u32 pixelborder, video::E_TEXTURE_CLAMP texmode ); - void getScale ( core::vector2df &scale ); - void getTranslation ( const c8 * name, core::vector2di &pos ); - - struct TextureAtlasEntry - { - io::path name; - u32 width; - u32 height; - - core::vector2di pos; - - video::IImage * image; - - bool operator < ( const TextureAtlasEntry & other ) - { - return height > other.height; - } - }; - - - core::array < TextureAtlasEntry > atlas; - video::IImage * Master; - }; - - - //! Possible types of Animation Type - enum E_ANIMATION_TYPE - { - //! No Animation - EAMT_STILL, - //! From Start to End, then Stop ( Limited Line ) - EAMT_WAYPOINT, - //! Linear Cycling Animation ( Sawtooth ) - EAMT_LOOPING, - //! Linear bobbing ( Triangle ) - EAMT_PINGPONG - }; - - //! Names for Animation Type - const c8* const MeshAnimationTypeNames[] = - { - "still", - "waypoint", - "looping", - "pingpong", - 0 - }; - - - //! Data for holding named Animation Info - struct KeyFrameInterpolation - { - core::stringc Name; // Name of the current Animation/Bone - E_ANIMATION_TYPE AnimationType; // Type of Animation ( looping, usw..) - - f32 CurrentFrame; // Current Frame - s32 NextFrame; // Frame which will be used next. For blending - - s32 StartFrame; // Absolute Frame where the current animation start - s32 Frames; // Relative Frames how much Frames this animation have - s32 LoopingFrames; // How much of Frames sould be looped - s32 EndFrame; // Absolute Frame where the current animation ends End = start + frames - 1 - - f32 FramesPerSecond; // Speed in Frames/Seconds the animation is played - f32 RelativeSpeed; // Factor Original fps is modified - - u32 BeginTime; // Animation started at this thime - u32 EndTime; // Animation end at this time - u32 LastTime; // Last Keyframe was done at this time - - KeyFrameInterpolation ( const c8 * name = "", s32 start = 0, s32 frames = 0, s32 loopingframes = 0, - f32 fps = 0.f, f32 relativefps = 1.f ) - : Name ( name ), AnimationType ( loopingframes ? EAMT_LOOPING : EAMT_WAYPOINT), - CurrentFrame ( (f32) start ), NextFrame ( start ), StartFrame ( start ), - Frames ( frames ), LoopingFrames ( loopingframes ), EndFrame ( start + frames - 1 ), - FramesPerSecond ( fps ), RelativeSpeed ( relativefps ), - BeginTime ( 0 ), EndTime ( 0 ), LastTime ( 0 ) - { - } - - // linear search - bool operator == ( const KeyFrameInterpolation & other ) const - { - return Name.equals_ignore_case ( other.Name ); - } - - }; - - - //! a List holding named Animations - typedef core::array < KeyFrameInterpolation > IAnimationList; - - //! a List holding named Skins - typedef core::array < core::stringc > ISkinList; - - - // Current Model per Body - struct SubModel - { - core::stringc name; - u32 startBuffer; - u32 endBuffer; - u32 state; - }; - - struct BodyPart - { - core::stringc name; - u32 defaultModel; - core::array < SubModel > model; - }; - //! a List holding named Models and SubModels - typedef core::array < BodyPart > IBodyList; - - - class CAnimatedMeshHalfLife : public IAnimatedMesh - { - public: - - //! constructor - CAnimatedMeshHalfLife(); - - //! destructor - virtual ~CAnimatedMeshHalfLife(); - - //! loads a Halflife mdl file - bool loadModelFile( io::IReadFile* file, ISceneManager * smgr ); - - //IAnimatedMesh - virtual u32 getFrameCount() const _IRR_OVERRIDE_; - virtual IMesh* getMesh(s32 frame, s32 detailLevel, s32 startFrameLoop, s32 endFrameLoop) _IRR_OVERRIDE_; - virtual const core::aabbox3d<f32>& getBoundingBox() const _IRR_OVERRIDE_; - virtual E_ANIMATED_MESH_TYPE getMeshType() const _IRR_OVERRIDE_; - void renderModel ( u32 param, video::IVideoDriver * driver, const core::matrix4 &absoluteTransformation); - - //! returns amount of mesh buffers. - virtual u32 getMeshBufferCount() const _IRR_OVERRIDE_; - //! returns pointer to a mesh buffer - virtual IMeshBuffer* getMeshBuffer(u32 nr) const _IRR_OVERRIDE_; - //! Returns pointer to a mesh buffer which fits a material - virtual IMeshBuffer* getMeshBuffer( const video::SMaterial &material) const _IRR_OVERRIDE_; - - virtual void setMaterialFlag(video::E_MATERIAL_FLAG flag, bool newvalue) _IRR_OVERRIDE_; - - //! set the hardware mapping hint, for driver - virtual void setHardwareMappingHint(E_HARDWARE_MAPPING newMappingHint, E_BUFFER_TYPE buffer=EBT_VERTEX_AND_INDEX) _IRR_OVERRIDE_; - - //! flags the meshbuffer as changed, reloads hardware buffers - virtual void setDirty(E_BUFFER_TYPE buffer=EBT_VERTEX_AND_INDEX) _IRR_OVERRIDE_; - - //! set user axis aligned bounding box - virtual void setBoundingBox(const core::aabbox3df& box) _IRR_OVERRIDE_; - - //! Gets the default animation speed of the animated mesh. - /** \return Amount of frames per second. If the amount is 0, it is a static, non animated mesh. */ - virtual f32 getAnimationSpeed() const _IRR_OVERRIDE_ - { - return FramesPerSecond; - } - - //! Gets the frame count of the animated mesh. - /** \param fps Frames per second to play the animation with. If the amount is 0, it is not animated. - The actual speed is set in the scene node the mesh is instantiated in.*/ - virtual void setAnimationSpeed(f32 fps) _IRR_OVERRIDE_ - { - FramesPerSecond=fps; - } - - //! Get the Animation List - IAnimationList* getAnimList () { return &AnimList; } - - //! Return the named Body List of this Animated Mesh - IBodyList *getBodyList() { return &BodyList; } - - private: - - // KeyFrame Animation List - IAnimationList AnimList; - // Sum of all sequences - u32 FrameCount; - - // Named meshes of the Body - IBodyList BodyList; - - //! return a Mesh per frame - SMesh* MeshIPol; - - ISceneManager *SceneManager; - - SHalflifeHeader *Header; - SHalflifeHeader *TextureHeader; - bool OwnTexModel; // do we have a modelT.mdl ? - SHalflifeHeader *AnimationHeader[32]; // sequences named model01.mdl, model02.mdl - - void initData (); - SHalflifeHeader * loadModel( io::IReadFile* file, const io::path &filename ); - bool postLoadModel( const io::path &filename ); - - u32 SequenceIndex; // sequence index - f32 CurrentFrame; // Current Frame - f32 FramesPerSecond; - - #define MOUTH_CONTROLLER 4 - u8 BoneController[4 + 1 ]; // bone controllers + mouth position - u8 Blending[2]; // animation blending - - vec4_hl BoneAdj; - f32 SetController( s32 controllerIndex, f32 value ); - - u32 SkinGroupSelection; // skin group selection - u32 SetSkin( u32 value ); - - void initModel(); - void dumpModelInfo(u32 level) const; - - void ExtractBbox(s32 sequence, core::aabbox3df &box) const; - - void setUpBones (); - SHalflifeAnimOffset * getAnim( SHalflifeSequence *seq ); - void slerpBones( vec4_hl q1[], vec3_hl pos1[], vec4_hl q2[], vec3_hl pos2[], f32 s ); - void calcRotations ( vec3_hl *pos, vec4_hl *q, SHalflifeSequence *seq, SHalflifeAnimOffset *anim, f32 f ); - - void calcBoneAdj(); - void calcBoneQuaternion(const s32 frame, const SHalflifeBone *bone, SHalflifeAnimOffset *anim, const u32 j, f32& angle1, f32& angle2) const; - void calcBonePosition(const s32 frame, f32 s, const SHalflifeBone *bone, SHalflifeAnimOffset *anim, f32 *pos ) const; - - void buildVertices (); - - io::path TextureBaseName; - -#define HL_TEXTURE_ATLAS - -#ifdef HL_TEXTURE_ATLAS - STextureAtlas TextureAtlas; -// video::ITexture *TextureMaster; -#endif - - }; - - - //! Meshloader capable of loading HalfLife Model files - class CHalflifeMDLMeshFileLoader : public IMeshLoader - { - public: - - //! Constructor - CHalflifeMDLMeshFileLoader( scene::ISceneManager* smgr ); - - //! returns true if the file maybe is able to be loaded by this class - /** based on the file extension (e.g. ".bsp") */ - 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: - scene::ISceneManager* SceneManager; - }; - - -} // end namespace scene -} // end namespace irr - -#endif - diff --git a/source/Irrlicht/CAnimatedMeshMD2.cpp b/source/Irrlicht/CAnimatedMeshMD2.cpp deleted file mode 100644 index b97417ae..00000000 --- a/source/Irrlicht/CAnimatedMeshMD2.cpp +++ /dev/null @@ -1,465 +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_MD2_LOADER_ - -#include "CAnimatedMeshMD2.h" -#include "SColor.h" -#include "irrMath.h" - -namespace irr -{ -namespace scene -{ - -const s32 MD2_FRAME_SHIFT = 2; -const f32 MD2_FRAME_SHIFT_RECIPROCAL = 1.f / (1 << MD2_FRAME_SHIFT); - -const s32 Q2_VERTEX_NORMAL_TABLE_SIZE = 162; - -static const f32 Q2_VERTEX_NORMAL_TABLE[Q2_VERTEX_NORMAL_TABLE_SIZE][3] = { - {-0.525731f, 0.000000f, 0.850651f}, - {-0.442863f, 0.238856f, 0.864188f}, - {-0.295242f, 0.000000f, 0.955423f}, - {-0.309017f, 0.500000f, 0.809017f}, - {-0.162460f, 0.262866f, 0.951056f}, - {0.000000f, 0.000000f, 1.000000f}, - {0.000000f, 0.850651f, 0.525731f}, - {-0.147621f, 0.716567f, 0.681718f}, - {0.147621f, 0.716567f, 0.681718f}, - {0.000000f, 0.525731f, 0.850651f}, - {0.309017f, 0.500000f, 0.809017f}, - {0.525731f, 0.000000f, 0.850651f}, - {0.295242f, 0.000000f, 0.955423f}, - {0.442863f, 0.238856f, 0.864188f}, - {0.162460f, 0.262866f, 0.951056f}, - {-0.681718f, 0.147621f, 0.716567f}, - {-0.809017f, 0.309017f, 0.500000f}, - {-0.587785f, 0.425325f, 0.688191f}, - {-0.850651f, 0.525731f, 0.000000f}, - {-0.864188f, 0.442863f, 0.238856f}, - {-0.716567f, 0.681718f, 0.147621f}, - {-0.688191f, 0.587785f, 0.425325f}, - {-0.500000f, 0.809017f, 0.309017f}, - {-0.238856f, 0.864188f, 0.442863f}, - {-0.425325f, 0.688191f, 0.587785f}, - {-0.716567f, 0.681718f, -0.147621f}, - {-0.500000f, 0.809017f, -0.309017f}, - {-0.525731f, 0.850651f, 0.000000f}, - {0.000000f, 0.850651f, -0.525731f}, - {-0.238856f, 0.864188f, -0.442863f}, - {0.000000f, 0.955423f, -0.295242f}, - {-0.262866f, 0.951056f, -0.162460f}, - {0.000000f, 1.000000f, 0.000000f}, - {0.000000f, 0.955423f, 0.295242f}, - {-0.262866f, 0.951056f, 0.162460f}, - {0.238856f, 0.864188f, 0.442863f}, - {0.262866f, 0.951056f, 0.162460f}, - {0.500000f, 0.809017f, 0.309017f}, - {0.238856f, 0.864188f, -0.442863f}, - {0.262866f, 0.951056f, -0.162460f}, - {0.500000f, 0.809017f, -0.309017f}, - {0.850651f, 0.525731f, 0.000000f}, - {0.716567f, 0.681718f, 0.147621f}, - {0.716567f, 0.681718f, -0.147621f}, - {0.525731f, 0.850651f, 0.000000f}, - {0.425325f, 0.688191f, 0.587785f}, - {0.864188f, 0.442863f, 0.238856f}, - {0.688191f, 0.587785f, 0.425325f}, - {0.809017f, 0.309017f, 0.500000f}, - {0.681718f, 0.147621f, 0.716567f}, - {0.587785f, 0.425325f, 0.688191f}, - {0.955423f, 0.295242f, 0.000000f}, - {1.000000f, 0.000000f, 0.000000f}, - {0.951056f, 0.162460f, 0.262866f}, - {0.850651f, -0.525731f, 0.000000f}, - {0.955423f, -0.295242f, 0.000000f}, - {0.864188f, -0.442863f, 0.238856f}, - {0.951056f, -0.162460f, 0.262866f}, - {0.809017f, -0.309017f, 0.500000f}, - {0.681718f, -0.147621f, 0.716567f}, - {0.850651f, 0.000000f, 0.525731f}, - {0.864188f, 0.442863f, -0.238856f}, - {0.809017f, 0.309017f, -0.500000f}, - {0.951056f, 0.162460f, -0.262866f}, - {0.525731f, 0.000000f, -0.850651f}, - {0.681718f, 0.147621f, -0.716567f}, - {0.681718f, -0.147621f, -0.716567f}, - {0.850651f, 0.000000f, -0.525731f}, - {0.809017f, -0.309017f, -0.500000f}, - {0.864188f, -0.442863f, -0.238856f}, - {0.951056f, -0.162460f, -0.262866f}, - {0.147621f, 0.716567f, -0.681718f}, - {0.309017f, 0.500000f, -0.809017f}, - {0.425325f, 0.688191f, -0.587785f}, - {0.442863f, 0.238856f, -0.864188f}, - {0.587785f, 0.425325f, -0.688191f}, - {0.688191f, 0.587785f, -0.425325f}, - {-0.147621f, 0.716567f, -0.681718f}, - {-0.309017f, 0.500000f, -0.809017f}, - {0.000000f, 0.525731f, -0.850651f}, - {-0.525731f, 0.000000f, -0.850651f}, - {-0.442863f, 0.238856f, -0.864188f}, - {-0.295242f, 0.000000f, -0.955423f}, - {-0.162460f, 0.262866f, -0.951056f}, - {0.000000f, 0.000000f, -1.000000f}, - {0.295242f, 0.000000f, -0.955423f}, - {0.162460f, 0.262866f, -0.951056f}, - {-0.442863f, -0.238856f, -0.864188f}, - {-0.309017f, -0.500000f, -0.809017f}, - {-0.162460f, -0.262866f, -0.951056f}, - {0.000000f, -0.850651f, -0.525731f}, - {-0.147621f, -0.716567f, -0.681718f}, - {0.147621f, -0.716567f, -0.681718f}, - {0.000000f, -0.525731f, -0.850651f}, - {0.309017f, -0.500000f, -0.809017f}, - {0.442863f, -0.238856f, -0.864188f}, - {0.162460f, -0.262866f, -0.951056f}, - {0.238856f, -0.864188f, -0.442863f}, - {0.500000f, -0.809017f, -0.309017f}, - {0.425325f, -0.688191f, -0.587785f}, - {0.716567f, -0.681718f, -0.147621f}, - {0.688191f, -0.587785f, -0.425325f}, - {0.587785f, -0.425325f, -0.688191f}, - {0.000000f, -0.955423f, -0.295242f}, - {0.000000f, -1.000000f, 0.000000f}, - {0.262866f, -0.951056f, -0.162460f}, - {0.000000f, -0.850651f, 0.525731f}, - {0.000000f, -0.955423f, 0.295242f}, - {0.238856f, -0.864188f, 0.442863f}, - {0.262866f, -0.951056f, 0.162460f}, - {0.500000f, -0.809017f, 0.309017f}, - {0.716567f, -0.681718f, 0.147621f}, - {0.525731f, -0.850651f, 0.000000f}, - {-0.238856f, -0.864188f, -0.442863f}, - {-0.500000f, -0.809017f, -0.309017f}, - {-0.262866f, -0.951056f, -0.162460f}, - {-0.850651f, -0.525731f, 0.000000f}, - {-0.716567f, -0.681718f, -0.147621f}, - {-0.716567f, -0.681718f, 0.147621f}, - {-0.525731f, -0.850651f, 0.000000f}, - {-0.500000f, -0.809017f, 0.309017f}, - {-0.238856f, -0.864188f, 0.442863f}, - {-0.262866f, -0.951056f, 0.162460f}, - {-0.864188f, -0.442863f, 0.238856f}, - {-0.809017f, -0.309017f, 0.500000f}, - {-0.688191f, -0.587785f, 0.425325f}, - {-0.681718f, -0.147621f, 0.716567f}, - {-0.442863f, -0.238856f, 0.864188f}, - {-0.587785f, -0.425325f, 0.688191f}, - {-0.309017f, -0.500000f, 0.809017f}, - {-0.147621f, -0.716567f, 0.681718f}, - {-0.425325f, -0.688191f, 0.587785f}, - {-0.162460f, -0.262866f, 0.951056f}, - {0.442863f, -0.238856f, 0.864188f}, - {0.162460f, -0.262866f, 0.951056f}, - {0.309017f, -0.500000f, 0.809017f}, - {0.147621f, -0.716567f, 0.681718f}, - {0.000000f, -0.525731f, 0.850651f}, - {0.425325f, -0.688191f, 0.587785f}, - {0.587785f, -0.425325f, 0.688191f}, - {0.688191f, -0.587785f, 0.425325f}, - {-0.955423f, 0.295242f, 0.000000f}, - {-0.951056f, 0.162460f, 0.262866f}, - {-1.000000f, 0.000000f, 0.000000f}, - {-0.850651f, 0.000000f, 0.525731f}, - {-0.955423f, -0.295242f, 0.000000f}, - {-0.951056f, -0.162460f, 0.262866f}, - {-0.864188f, 0.442863f, -0.238856f}, - {-0.951056f, 0.162460f, -0.262866f}, - {-0.809017f, 0.309017f, -0.500000f}, - {-0.864188f, -0.442863f, -0.238856f}, - {-0.951056f, -0.162460f, -0.262866f}, - {-0.809017f, -0.309017f, -0.500000f}, - {-0.681718f, 0.147621f, -0.716567f}, - {-0.681718f, -0.147621f, -0.716567f}, - {-0.850651f, 0.000000f, -0.525731f}, - {-0.688191f, 0.587785f, -0.425325f}, - {-0.587785f, 0.425325f, -0.688191f}, - {-0.425325f, 0.688191f, -0.587785f}, - {-0.425325f, -0.688191f, -0.587785f}, - {-0.587785f, -0.425325f, -0.688191f}, - {-0.688191f, -0.587785f, -0.425325f}, - }; - -struct SMD2AnimationType -{ - s32 begin; - s32 end; - s32 fps; -}; - -static const SMD2AnimationType MD2AnimationTypeList[21] = -{ - { 0, 39, 9}, // STAND - { 40, 45, 10}, // RUN - { 46, 53, 10}, // ATTACK - { 54, 57, 7}, // PAIN_A - { 58, 61, 7}, // PAIN_B - { 62, 65, 7}, // PAIN_C - { 66, 71, 7}, // JUMP - { 72, 83, 7}, // FLIP - { 84, 94, 7}, // SALUTE - { 95, 111, 10}, // FALLBACK - {112, 122, 7}, // WAVE - {123, 134, 6}, // POINT - {135, 153, 10}, // CROUCH_STAND - {154, 159, 7}, // CROUCH_WALK - {160, 168, 10}, // CROUCH_ATTACK - {169, 172, 7}, // CROUCH_PAIN - {173, 177, 5}, // CROUCH_DEATH - {178, 183, 7}, // DEATH_FALLBACK - {184, 189, 7}, // DEATH_FALLFORWARD - {190, 197, 7}, // DEATH_FALLBACKSLOW - {198, 198, 5}, // BOOM -}; - - -//! constructor -CAnimatedMeshMD2::CAnimatedMeshMD2() - : InterpolationBuffer(0), InterpolationFirstFrame(-1), InterpolationSecondFrame(-1), InterpolationFrameDiv(0.f) - , FrameList(0), FrameCount(0), FramesPerSecond((f32)(MD2AnimationTypeList[0].fps << MD2_FRAME_SHIFT)) -{ - #ifdef _DEBUG - IAnimatedMesh::setDebugName("CAnimatedMeshMD2 IAnimatedMesh"); - IMesh::setDebugName("CAnimatedMeshMD2 IMesh"); - #endif - InterpolationBuffer = new SMeshBuffer; -} - - -//! destructor -CAnimatedMeshMD2::~CAnimatedMeshMD2() -{ - delete [] FrameList; - if (InterpolationBuffer) - InterpolationBuffer->drop(); -} - - -//! returns the amount of frames in milliseconds. If the amount is 1, it is a static (=non animated) mesh. -u32 CAnimatedMeshMD2::getFrameCount() const -{ - return FrameCount<<MD2_FRAME_SHIFT; -} - - -//! returns the animated mesh based on a detail level. 0 is the lowest, 255 the highest detail. Note, that some Meshes will ignore the detail level. -IMesh* CAnimatedMeshMD2::getMesh(s32 frame, s32 detailLevel, s32 startFrameLoop, s32 endFrameLoop) -{ - if ((u32)frame > getFrameCount()) - frame = (frame % getFrameCount()); - - if (startFrameLoop == -1 && endFrameLoop == -1) - { - startFrameLoop = 0; - endFrameLoop = getFrameCount(); - } - - updateInterpolationBuffer(frame, startFrameLoop, endFrameLoop); - return this; -} - - -//! returns amount of mesh buffers. MD2 meshes only have one buffer -u32 CAnimatedMeshMD2::getMeshBufferCount() const -{ - return 1; -} - - -//! returns pointer to a mesh buffer -IMeshBuffer* CAnimatedMeshMD2::getMeshBuffer(u32 nr) const -{ - if (nr == 0) - return InterpolationBuffer; - else - return 0; -} - - -//! Returns pointer to a mesh buffer which fits a material -IMeshBuffer* CAnimatedMeshMD2::getMeshBuffer(const video::SMaterial &material) const -{ - if (InterpolationBuffer->Material == material) - return InterpolationBuffer; - else - return 0; -} - - -// updates the interpolation buffer -void CAnimatedMeshMD2::updateInterpolationBuffer(s32 frame, s32 startFrameLoop, s32 endFrameLoop) -{ - u32 firstFrame, secondFrame; - f32 div; - - // TA: resolve missing ipol in loop between end-start - - if (endFrameLoop - startFrameLoop == 0) - { - firstFrame = frame>>MD2_FRAME_SHIFT; - secondFrame = frame>>MD2_FRAME_SHIFT; - div = 1.0f; - } - else - { - // key frames - u32 s = startFrameLoop >> MD2_FRAME_SHIFT; - u32 e = endFrameLoop >> MD2_FRAME_SHIFT; - - firstFrame = frame >> MD2_FRAME_SHIFT; - secondFrame = core::if_c_a_else_b(firstFrame + 1 > e, s, firstFrame + 1); - - firstFrame = core::s32_min(FrameCount - 1, firstFrame); - secondFrame = core::s32_min(FrameCount - 1, secondFrame); - - //div = (frame % (1<<MD2_FRAME_SHIFT)) / (f32)(1<<MD2_FRAME_SHIFT); - frame &= (1<<MD2_FRAME_SHIFT) - 1; - div = frame * MD2_FRAME_SHIFT_RECIPROCAL; - } - - if ( firstFrame != InterpolationFirstFrame || secondFrame != InterpolationSecondFrame || div != InterpolationFrameDiv ) - { - InterpolationFirstFrame = firstFrame; - InterpolationSecondFrame = secondFrame; - InterpolationFrameDiv = div; - - video::S3DVertex* target = static_cast<video::S3DVertex*>(InterpolationBuffer->getVertices()); - SMD2Vert* first = FrameList[firstFrame].pointer(); - SMD2Vert* second = FrameList[secondFrame].pointer(); - - // interpolate both frames - const u32 count = FrameList[firstFrame].size(); - for (u32 i=0; i<count; ++i) - { - const core::vector3df one = core::vector3df(f32(first->Pos.X) * FrameTransforms[firstFrame].scale.X + FrameTransforms[firstFrame].translate.X, - f32(first->Pos.Y) * FrameTransforms[firstFrame].scale.Y + FrameTransforms[firstFrame].translate.Y, - f32(first->Pos.Z) * FrameTransforms[firstFrame].scale.Z + FrameTransforms[firstFrame].translate.Z); - const core::vector3df two = core::vector3df(f32(second->Pos.X) * FrameTransforms[secondFrame].scale.X + FrameTransforms[secondFrame].translate.X, - f32(second->Pos.Y) * FrameTransforms[secondFrame].scale.Y + FrameTransforms[secondFrame].translate.Y, - f32(second->Pos.Z) * FrameTransforms[secondFrame].scale.Z + FrameTransforms[secondFrame].translate.Z); - target->Pos = two.getInterpolated(one, div); - const core::vector3df n1( - Q2_VERTEX_NORMAL_TABLE[first->NormalIdx][0], - Q2_VERTEX_NORMAL_TABLE[first->NormalIdx][2], - Q2_VERTEX_NORMAL_TABLE[first->NormalIdx][1]); - const core::vector3df n2( - Q2_VERTEX_NORMAL_TABLE[second->NormalIdx][0], - Q2_VERTEX_NORMAL_TABLE[second->NormalIdx][2], - Q2_VERTEX_NORMAL_TABLE[second->NormalIdx][1]); - target->Normal = n2.getInterpolated(n1, div); - ++target; - ++first; - ++second; - } - - //update bounding box - InterpolationBuffer->setBoundingBox(BoxList[secondFrame].getInterpolated(BoxList[firstFrame], div)); - InterpolationBuffer->setDirty(); - } -} - - -//! sets a flag of all contained materials to a new value -void CAnimatedMeshMD2::setMaterialFlag(video::E_MATERIAL_FLAG flag, bool newvalue) -{ - InterpolationBuffer->Material.setFlag(flag, newvalue); -} - - -//! set the hardware mapping hint, for driver -void CAnimatedMeshMD2::setHardwareMappingHint(E_HARDWARE_MAPPING newMappingHint, - E_BUFFER_TYPE buffer) -{ - InterpolationBuffer->setHardwareMappingHint(newMappingHint, buffer); -} - - -//! flags the meshbuffer as changed, reloads hardware buffers -void CAnimatedMeshMD2::setDirty(E_BUFFER_TYPE buffer) -{ - InterpolationBuffer->setDirty(buffer); -} - - -//! returns an axis aligned bounding box -const core::aabbox3d<f32>& CAnimatedMeshMD2::getBoundingBox() const -{ - return InterpolationBuffer->BoundingBox; -} - - -//! set user axis aligned bounding box -void CAnimatedMeshMD2::setBoundingBox(const core::aabbox3df& box) -{ - InterpolationBuffer->BoundingBox = box; -} - - -//! Returns the type of the animated mesh. -E_ANIMATED_MESH_TYPE CAnimatedMeshMD2::getMeshType() const -{ - return EAMT_MD2; -} - - -//! Returns frame loop data for a special MD2 animation type. -void CAnimatedMeshMD2::getFrameLoop(EMD2_ANIMATION_TYPE l, - s32& outBegin, s32& outEnd, s32& outFPS) const -{ - if (l < 0 || l >= EMAT_COUNT) - return; - - outBegin = MD2AnimationTypeList[l].begin << MD2_FRAME_SHIFT; - outEnd = MD2AnimationTypeList[l].end << MD2_FRAME_SHIFT; - - // correct to anim between last->first frame - outEnd += MD2_FRAME_SHIFT == 0 ? 1 : (1 << MD2_FRAME_SHIFT) - 1; - outFPS = MD2AnimationTypeList[l].fps << MD2_FRAME_SHIFT; -} - - -//! Returns frame loop data for a special MD2 animation type. -bool CAnimatedMeshMD2::getFrameLoop(const c8* name, - s32& outBegin, s32&outEnd, s32& outFPS) const -{ - for (u32 i=0; i < AnimationData.size(); ++i) - { - if (AnimationData[i].name == name) - { - outBegin = AnimationData[i].begin << MD2_FRAME_SHIFT; - outEnd = AnimationData[i].end << MD2_FRAME_SHIFT; - outEnd += MD2_FRAME_SHIFT == 0 ? 1 : (1 << MD2_FRAME_SHIFT) - 1; - outFPS = AnimationData[i].fps << MD2_FRAME_SHIFT; - return true; - } - } - - return false; -} - - -//! Returns amount of md2 animations in this file. -s32 CAnimatedMeshMD2::getAnimationCount() const -{ - return AnimationData.size(); -} - - -//! Returns name of md2 animation. -const c8* CAnimatedMeshMD2::getAnimationName(s32 nr) const -{ - if ((u32)nr >= AnimationData.size()) - return 0; - - return AnimationData[nr].name.c_str(); -} - - -} // end namespace scene -} // end namespace irr - -#endif // _IRR_COMPILE_WITH_MD2_LOADER_ diff --git a/source/Irrlicht/CAnimatedMeshMD2.h b/source/Irrlicht/CAnimatedMeshMD2.h deleted file mode 100644 index a614f18a..00000000 --- a/source/Irrlicht/CAnimatedMeshMD2.h +++ /dev/null @@ -1,158 +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_ANIMATED_MESH_MD2_H_INCLUDED__ -#define __C_ANIMATED_MESH_MD2_H_INCLUDED__ - -#include "IAnimatedMeshMD2.h" -#include "IMesh.h" -#include "CMeshBuffer.h" -#include "IReadFile.h" -#include "S3DVertex.h" -#include "irrArray.h" -#include "irrString.h" - -namespace irr -{ -namespace scene -{ - - class CAnimatedMeshMD2 : public IAnimatedMeshMD2 - { - public: - - //! constructor - CAnimatedMeshMD2(); - - //! destructor - virtual ~CAnimatedMeshMD2(); - - //! returns the amount of frames. If the amount is 1, it is a static (=non animated) mesh. - virtual u32 getFrameCount() const _IRR_OVERRIDE_; - - //! Gets the default animation speed of the animated mesh. - /** \return Amount of frames per second. If the amount is 0, it is a static, non animated mesh. */ - virtual f32 getAnimationSpeed() const _IRR_OVERRIDE_ - { - return FramesPerSecond; - } - - //! Gets the frame count of the animated mesh. - /** \param fps Frames per second to play the animation with. If the amount is 0, it is not animated. - The actual speed is set in the scene node the mesh is instantiated in.*/ - virtual void setAnimationSpeed(f32 fps) _IRR_OVERRIDE_ - { - FramesPerSecond=fps; - } - - //! returns the animated mesh based on a detail level. 0 is the lowest, 255 the highest detail. Note, that some Meshes will ignore the detail level. - virtual IMesh* getMesh(s32 frame, s32 detailLevel=255, s32 startFrameLoop=-1, s32 endFrameLoop=-1) _IRR_OVERRIDE_; - - //! returns amount of mesh buffers. - virtual u32 getMeshBufferCount() const _IRR_OVERRIDE_; - - //! returns pointer to a mesh buffer - virtual IMeshBuffer* getMeshBuffer(u32 nr) const _IRR_OVERRIDE_; - - //! Returns pointer to a mesh buffer which fits a material - /** \param material: material to search for - \return Returns the pointer to the mesh buffer or - NULL if there is no such mesh buffer. */ - virtual IMeshBuffer* getMeshBuffer( const video::SMaterial &material) const _IRR_OVERRIDE_; - - //! returns an axis aligned bounding box - virtual const core::aabbox3d<f32>& getBoundingBox() const _IRR_OVERRIDE_; - - //! set user axis aligned bounding box - virtual void setBoundingBox( const core::aabbox3df& box) _IRR_OVERRIDE_; - - //! sets a flag of all contained materials to a new value - virtual void setMaterialFlag(video::E_MATERIAL_FLAG flag, bool newvalue) _IRR_OVERRIDE_; - - //! set the hardware mapping hint, for driver - virtual void setHardwareMappingHint(E_HARDWARE_MAPPING newMappingHint, E_BUFFER_TYPE buffer=EBT_VERTEX_AND_INDEX) _IRR_OVERRIDE_; - - //! flags the meshbuffer as changed, reloads hardware buffers - virtual void setDirty(E_BUFFER_TYPE buffer=EBT_VERTEX_AND_INDEX) _IRR_OVERRIDE_; - - //! Returns the type of the animated mesh. - virtual E_ANIMATED_MESH_TYPE getMeshType() const _IRR_OVERRIDE_; - - //! Returns frame loop data for a special MD2 animation type. - virtual void getFrameLoop(EMD2_ANIMATION_TYPE, - s32& outBegin, s32& outEnd, s32& outFps) const _IRR_OVERRIDE_; - - //! Returns frame loop data for a special MD2 animation type. - virtual bool getFrameLoop(const c8* name, - s32& outBegin, s32& outEnd, s32& outFps) const _IRR_OVERRIDE_; - - //! Returns amount of md2 animations in this file. - virtual s32 getAnimationCount() const _IRR_OVERRIDE_; - - //! Returns name of md2 animation. - //! \param nr: Zero based index of animation. - virtual const c8* getAnimationName(s32 nr) const _IRR_OVERRIDE_; - - - // - // exposed for loader - // - - //! the buffer that contains the most recent animation - SMeshBuffer* InterpolationBuffer; - - //! Frames used to calculate InterpolationBuffer - u32 InterpolationFirstFrame, InterpolationSecondFrame; - f32 InterpolationFrameDiv; - - //! named animations - struct SAnimationData - { - core::stringc name; - s32 begin; - s32 end; - s32 fps; - }; - - //! scale and translations for keyframes - struct SKeyFrameTransform - { - core::vector3df scale; - core::vector3df translate; - }; - - //! md2 vertex data - struct SMD2Vert - { - core::vector3d<u8> Pos; - u8 NormalIdx; - }; - - //! keyframe transformations - core::array<SKeyFrameTransform> FrameTransforms; - - //! keyframe vertex data - core::array<SMD2Vert> *FrameList; - - //! bounding boxes for each keyframe - core::array<core::aabbox3d<f32> > BoxList; - - //! named animations - core::array< SAnimationData > AnimationData; - - u32 FrameCount; - - private: - - //! updates the interpolation buffer - void updateInterpolationBuffer(s32 frame, s32 startFrame, s32 endFrame); - - f32 FramesPerSecond; - }; - -} // end namespace scene -} // end namespace irr - -#endif - diff --git a/source/Irrlicht/CAnimatedMeshMD3.cpp b/source/Irrlicht/CAnimatedMeshMD3.cpp deleted file mode 100644 index 0d3a091b..00000000 --- a/source/Irrlicht/CAnimatedMeshMD3.cpp +++ /dev/null @@ -1,468 +0,0 @@ -// Copyright (C) 2002-2012 Nikolaus Gebhardt / Fabio Concas / Thomas Alten -// 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_MD3_LOADER_ - -#include "CAnimatedMeshMD3.h" -#include "os.h" - -namespace irr -{ -namespace scene -{ - - -// byte-align structures -#include "irrpack.h" - -//! General properties of a single animation frame. -struct SMD3Frame -{ - f32 mins[3]; // bounding box per frame - f32 maxs[3]; - f32 position[3]; // position of bounding box - f32 radius; // radius of bounding sphere - c8 creator[16]; // name of frame -} PACK_STRUCT; - - -//! An attachment point for another MD3 model. -struct SMD3Tag -{ - c8 Name[64]; //name of 'tag' as it's usually called in the md3 files try to see it as a sub-mesh/seperate mesh-part. - f32 position[3]; //relative position of tag - f32 rotationMatrix[9]; //3x3 rotation direction of tag -} PACK_STRUCT; - -//!Shader -struct SMD3Shader -{ - c8 name[64]; // name of shader - s32 shaderIndex; -} PACK_STRUCT; - -// Default alignment -#include "irrunpack.h" - - -//! Constructor -CAnimatedMeshMD3::CAnimatedMeshMD3() -:Mesh(0), IPolShift(0), LoopMode(0), Scaling(1.f)//, FramesPerSecond(25.f) -{ -#ifdef _DEBUG - setDebugName("CAnimatedMeshMD3"); -#endif - - Mesh = new SMD3Mesh(); - MeshIPol = new SMesh(); - setInterpolationShift(0, 0); -} - - -//! Destructor -CAnimatedMeshMD3::~CAnimatedMeshMD3() -{ - if (Mesh) - Mesh->drop(); - if (MeshIPol) - MeshIPol->drop(); -} - - -//! Returns the amount of frames in milliseconds. If the amount is 1, it is a static (=non animated) mesh. -u32 CAnimatedMeshMD3::getFrameCount() const -{ - return Mesh->MD3Header.numFrames << IPolShift; -} - - -//! Rendering Hint -void CAnimatedMeshMD3::setInterpolationShift(u32 shift, u32 loopMode) -{ - IPolShift = shift; - LoopMode = loopMode; -} - - -//! returns amount of mesh buffers. -u32 CAnimatedMeshMD3::getMeshBufferCount() const -{ - return MeshIPol->getMeshBufferCount(); -} - - -//! returns pointer to a mesh buffer -IMeshBuffer* CAnimatedMeshMD3::getMeshBuffer(u32 nr) const -{ - return MeshIPol->getMeshBuffer(nr); -} - - -//! Returns pointer to a mesh buffer which fits a material -IMeshBuffer* CAnimatedMeshMD3::getMeshBuffer(const video::SMaterial &material) const -{ - return MeshIPol->getMeshBuffer(material); -} - - -void CAnimatedMeshMD3::setMaterialFlag(video::E_MATERIAL_FLAG flag, bool newvalue) -{ - MeshIPol->setMaterialFlag(flag, newvalue); -} - - -//! set the hardware mapping hint, for driver -void CAnimatedMeshMD3::setHardwareMappingHint(E_HARDWARE_MAPPING newMappingHint, - E_BUFFER_TYPE buffer) -{ - MeshIPol->setHardwareMappingHint(newMappingHint, buffer); -} - - -//! flags the meshbuffer as changed, reloads hardware buffers -void CAnimatedMeshMD3::setDirty(E_BUFFER_TYPE buffer) -{ - MeshIPol->setDirty(buffer); -} - - -//! set user axis aligned bounding box -void CAnimatedMeshMD3::setBoundingBox(const core::aabbox3df& box) -{ - MeshIPol->setBoundingBox(box); -} - - -//! Returns the animated tag list based on a detail level. 0 is the lowest, 255 the highest detail. -SMD3QuaternionTagList *CAnimatedMeshMD3::getTagList(s32 frame, s32 detailLevel, s32 startFrameLoop, s32 endFrameLoop) -{ - if (0 == Mesh) - return 0; - - getMesh(frame, detailLevel, startFrameLoop, endFrameLoop); - return &TagListIPol; -} - - -//! Returns the animated mesh based on a detail level. 0 is the lowest, 255 the highest detail. -IMesh* CAnimatedMeshMD3::getMesh(s32 frame, s32 detailLevel, s32 startFrameLoop, s32 endFrameLoop) -{ - if (0 == Mesh) - return 0; - - //! check if we have the mesh in our private cache - SCacheInfo candidate(frame, startFrameLoop, endFrameLoop); - if (candidate == Current) - return MeshIPol; - - startFrameLoop = core::s32_max(0, startFrameLoop >> IPolShift); - endFrameLoop = core::if_c_a_else_b(endFrameLoop < 0, Mesh->MD3Header.numFrames - 1, endFrameLoop >> IPolShift); - - const u32 mask = 1 << IPolShift; - - s32 frameA; - s32 frameB; - f32 iPol; - - if (LoopMode) - { - // correct frame to "pixel center" - frame -= mask >> 1; - - // interpolation - iPol = f32(frame & (mask - 1)) * core::reciprocal(f32(mask)); - - // wrap anim - frame >>= IPolShift; - frameA = core::if_c_a_else_b(frame < startFrameLoop, endFrameLoop, frame); - frameB = core::if_c_a_else_b(frameA + 1 > endFrameLoop, startFrameLoop, frameA + 1); - } - else - { - // correct frame to "pixel center" - frame -= mask >> 1; - - iPol = f32(frame & (mask - 1)) * core::reciprocal(f32(mask)); - - // clamp anim - frame >>= IPolShift; - frameA = core::s32_clamp(frame, startFrameLoop, endFrameLoop); - frameB = core::s32_min(frameA + 1, endFrameLoop); - } - - // build current vertex - for (u32 i = 0; i!= Mesh->Buffer.size(); ++i) - { - buildVertexArray(frameA, frameB, iPol, - Mesh->Buffer[i], - (SMeshBufferLightMap*) MeshIPol->getMeshBuffer(i)); - } - MeshIPol->recalculateBoundingBox(); - - // build current tags - buildTagArray(frameA, frameB, iPol); - - Current = candidate; - return MeshIPol; -} - - -//! create a Irrlicht MeshBuffer for a MD3 MeshBuffer -IMeshBuffer * CAnimatedMeshMD3::createMeshBuffer(const SMD3MeshBuffer* source, - io::IFileSystem* fs, video::IVideoDriver * driver) -{ - SMeshBufferLightMap * dest = new SMeshBufferLightMap(); - dest->Vertices.set_used(source->MeshHeader.numVertices); - dest->Indices.set_used(source->Indices.size()); - - u32 i; - - // fill in static face info - for (i = 0; i < source->Indices.size(); i += 3) - { - dest->Indices[i + 0] = (u16) source->Indices[i + 0]; - dest->Indices[i + 1] = (u16) source->Indices[i + 1]; - dest->Indices[i + 2] = (u16) source->Indices[i + 2]; - } - - // fill in static vertex info - for (i = 0; i!= (u32)source->MeshHeader.numVertices; ++i) - { - video::S3DVertex2TCoords &v = dest->Vertices[i]; - v.Color = 0xFFFFFFFF; - v.TCoords.X = source->Tex[i].u; - v.TCoords.Y = source->Tex[i].v; - v.TCoords2.X = 0.f; - v.TCoords2.Y = 0.f; - } - - // load static texture - u32 pos = 0; - quake3::tTexArray textureArray; - quake3::getTextures(textureArray, source->Shader, pos, fs, driver); - dest->Material.MaterialType = video::EMT_SOLID; - dest->Material.setTexture(0, textureArray[0]); - dest->Material.Lighting = false; - - return dest; -} - - -//! build final mesh's vertices from frames frameA and frameB with linear interpolation. -void CAnimatedMeshMD3::buildVertexArray(u32 frameA, u32 frameB, f32 interpolate, - const SMD3MeshBuffer* source, - SMeshBufferLightMap* dest) -{ - const u32 frameOffsetA = frameA * source->MeshHeader.numVertices; - const u32 frameOffsetB = frameB * source->MeshHeader.numVertices; - const f32 scale = (1.f/ 64.f); - - for (s32 i = 0; i != source->MeshHeader.numVertices; ++i) - { - video::S3DVertex2TCoords &v = dest->Vertices [ i ]; - - const SMD3Vertex &vA = source->Vertices [ frameOffsetA + i ]; - const SMD3Vertex &vB = source->Vertices [ frameOffsetB + i ]; - - // position - v.Pos.X = scale * (vA.position[0] + interpolate * (vB.position[0] - vA.position[0])); - v.Pos.Y = scale * (vA.position[2] + interpolate * (vB.position[2] - vA.position[2])); - v.Pos.Z = scale * (vA.position[1] + interpolate * (vB.position[1] - vA.position[1])); - - // normal - const core::vector3df nA(quake3::getMD3Normal(vA.normal[0], vA.normal[1])); - const core::vector3df nB(quake3::getMD3Normal(vB.normal[0], vB.normal[1])); - - v.Normal.X = nA.X + interpolate * (nB.X - nA.X); - v.Normal.Y = nA.Z + interpolate * (nB.Z - nA.Z); - v.Normal.Z = nA.Y + interpolate * (nB.Y - nA.Y); - } - - dest->recalculateBoundingBox(); -} - - -//! build final mesh's tag from frames frameA and frameB with linear interpolation. -void CAnimatedMeshMD3::buildTagArray(u32 frameA, u32 frameB, f32 interpolate) -{ - const u32 frameOffsetA = frameA * Mesh->MD3Header.numTags; - const u32 frameOffsetB = frameB * Mesh->MD3Header.numTags; - - for (s32 i = 0; i != Mesh->MD3Header.numTags; ++i) - { - SMD3QuaternionTag &d = TagListIPol [ i ]; - - const SMD3QuaternionTag &qA = Mesh->TagList[ frameOffsetA + i]; - const SMD3QuaternionTag &qB = Mesh->TagList[ frameOffsetB + i]; - - // rotation - d.rotation.slerp(qA.rotation, qB.rotation, interpolate); - - // position - d.position.X = qA.position.X + interpolate * (qB.position.X - qA.position.X); - d.position.Y = qA.position.Y + interpolate * (qB.position.Y - qA.position.Y); - d.position.Z = qA.position.Z + interpolate * (qB.position.Z - qA.position.Z); - } -} - - -/*! - loads a model -*/ -bool CAnimatedMeshMD3::loadModelFile(u32 modelIndex, io::IReadFile* file, - io::IFileSystem* fs, video::IVideoDriver* driver) -{ - if (!file) - return false; - - //! Check MD3Header - { - file->read(&Mesh->MD3Header, sizeof(SMD3Header)); - - if (strncmp("IDP3", Mesh->MD3Header.headerID, 4)) - { - os::Printer::log("MD3 Loader: invalid header"); - return false; - } - } - - //! store model name - Mesh->Name = file->getFileName(); - - u32 i; - - //! Frame Data (ignore) -#if 0 - SMD3Frame frameImport; - file->seek(Mesh->MD3Header.frameStart); - for (i = 0; i != Mesh->MD3Header.numFrames; ++i) - { - file->read(&frameImport, sizeof(frameImport)); - } -#endif - - //! Tag Data - const u32 totalTags = Mesh->MD3Header.numTags * Mesh->MD3Header.numFrames; - - SMD3Tag import; - - file->seek(Mesh->MD3Header.tagStart); - Mesh->TagList.set_used(totalTags); - for (i = 0; i != totalTags; ++i) - { - file->read(&import, sizeof(import)); - - SMD3QuaternionTag &exp = Mesh->TagList[i]; - - //! tag name - exp.Name = import.Name; - - //! position - exp.position.X = import.position[0]; - exp.position.Y = import.position[2]; - exp.position.Z = import.position[1]; - - //! construct quaternion from a RH 3x3 Matrix - exp.rotation.set(import.rotationMatrix[7], - 0.f, - -import.rotationMatrix[6], - 1 + import.rotationMatrix[8]); - exp.rotation.normalize(); - } - - //! Meshes - u32 offset = Mesh->MD3Header.tagEnd; - - for (i = 0; i != (u32)Mesh->MD3Header.numMeshes; ++i) - { - //! construct a new mesh buffer - SMD3MeshBuffer * buf = new SMD3MeshBuffer(); - - // !read mesh header info - SMD3MeshHeader &meshHeader = buf->MeshHeader; - - //! read mesh info - file->seek(offset); - file->read(&meshHeader, sizeof(SMD3MeshHeader)); - - //! prepare memory - buf->Vertices.set_used(meshHeader.numVertices * Mesh->MD3Header.numFrames); - buf->Indices.set_used(meshHeader.numTriangles * 3); - buf->Tex.set_used(meshHeader.numVertices); - - //! read skins (shaders). should be 1 per meshbuffer - SMD3Shader skin; - file->seek(offset + buf->MeshHeader.offset_shaders); - for (s32 g = 0; g != buf->MeshHeader.numShader; ++g) - { - file->read(&skin, sizeof(skin)); - - io::path name; - cutFilenameExtension(name, skin.name); - name.replace('\\', '/'); - buf->Shader = name; - } - - //! read texture coordinates - file->seek(offset + buf->MeshHeader.offset_st); - file->read(buf->Tex.pointer(), buf->MeshHeader.numVertices * sizeof(SMD3TexCoord)); - - //! read vertices - file->seek(offset + meshHeader.vertexStart); - file->read(buf->Vertices.pointer(), Mesh->MD3Header.numFrames * meshHeader.numVertices * sizeof(SMD3Vertex)); - - //! read indices - file->seek(offset + meshHeader.offset_triangles); - file->read(buf->Indices.pointer(), meshHeader.numTriangles * sizeof(SMD3Face)); - - //! store meshBuffer - Mesh->Buffer.push_back(buf); - - offset += meshHeader.offset_end; - } - - // Init Mesh Interpolation - for (i = 0; i != Mesh->Buffer.size(); ++i) - { - IMeshBuffer * buffer = createMeshBuffer(Mesh->Buffer[i], fs, driver); - MeshIPol->addMeshBuffer(buffer); - buffer->drop(); - } - MeshIPol->recalculateBoundingBox(); - - // Init Tag Interpolation - for (i = 0; i != (u32)Mesh->MD3Header.numTags; ++i) - { - TagListIPol.push_back(Mesh->TagList[i]); - } - - return true; -} - - -SMD3Mesh * CAnimatedMeshMD3::getOriginalMesh() -{ - return Mesh; -} - - -//! Returns an axis aligned bounding box -const core::aabbox3d<f32>& CAnimatedMeshMD3::getBoundingBox() const -{ - return MeshIPol->BoundingBox; -} - - -//! Returns the type of the animated mesh. -E_ANIMATED_MESH_TYPE CAnimatedMeshMD3::getMeshType() const -{ - return EAMT_MD3; -} - - -} // end namespace scene -} // end namespace irr - -#endif // _IRR_COMPILE_WITH_MD3_LOADER_ diff --git a/source/Irrlicht/CAnimatedMeshMD3.h b/source/Irrlicht/CAnimatedMeshMD3.h deleted file mode 100644 index cc96b58c..00000000 --- a/source/Irrlicht/CAnimatedMeshMD3.h +++ /dev/null @@ -1,135 +0,0 @@ -// Copyright (C) 2002-2012 Nikolaus Gebhardt / Thomas Alten -// This file is part of the "Irrlicht Engine". -// For conditions of distribution and use, see copyright notice in irrlicht.h - -#ifndef __C_ANIMATED_MESH_MD3_H_INCLUDED__ -#define __C_ANIMATED_MESH_MD3_H_INCLUDED__ - -#include "IAnimatedMeshMD3.h" -#include "IReadFile.h" -#include "IFileSystem.h" -#include "irrArray.h" -#include "irrString.h" -#include "SMesh.h" -#include "SMeshBuffer.h" -#include "IQ3Shader.h" - -namespace irr -{ -namespace scene -{ - - class CAnimatedMeshMD3 : public IAnimatedMeshMD3 - { - public: - - //! constructor - CAnimatedMeshMD3(); - - //! destructor - virtual ~CAnimatedMeshMD3(); - - //! loads a quake3 md3 file - bool loadModelFile(u32 modelIndex, io::IReadFile* file, - io::IFileSystem* fs, video::IVideoDriver* driver); - - // IAnimatedMeshMD3 - virtual void setInterpolationShift(u32 shift, u32 loopMode) _IRR_OVERRIDE_; - virtual SMD3Mesh* getOriginalMesh() _IRR_OVERRIDE_; - virtual SMD3QuaternionTagList* getTagList(s32 frame, s32 detailLevel, s32 startFrameLoop, s32 endFrameLoop) _IRR_OVERRIDE_; - - //IAnimatedMesh - virtual u32 getFrameCount() const _IRR_OVERRIDE_; - - //! Gets the default animation speed of the animated mesh. - /** \return Amount of frames per second. If the amount is 0, it is a static, non animated mesh. */ - virtual f32 getAnimationSpeed() const _IRR_OVERRIDE_ - { - return FramesPerSecond; - } - - //! Gets the frame count of the animated mesh. - /** \param fps Frames per second to play the animation with. If the amount is 0, it is not animated. - The actual speed is set in the scene node the mesh is instantiated in.*/ - virtual void setAnimationSpeed(f32 fps) _IRR_OVERRIDE_ - { - FramesPerSecond=fps; - } - - virtual IMesh* getMesh(s32 frame, s32 detailLevel, - s32 startFrameLoop, s32 endFrameLoop) _IRR_OVERRIDE_; - virtual const core::aabbox3d<f32>& getBoundingBox() const _IRR_OVERRIDE_; - virtual E_ANIMATED_MESH_TYPE getMeshType() const _IRR_OVERRIDE_; - - //! returns amount of mesh buffers. - virtual u32 getMeshBufferCount() const _IRR_OVERRIDE_; - - //! returns pointer to a mesh buffer - virtual IMeshBuffer* getMeshBuffer(u32 nr) const _IRR_OVERRIDE_; - - //! Returns pointer to a mesh buffer which fits a material - virtual IMeshBuffer* getMeshBuffer(const video::SMaterial &material) const _IRR_OVERRIDE_; - - virtual void setMaterialFlag(video::E_MATERIAL_FLAG flag, bool newvalue) _IRR_OVERRIDE_; - - //! set user axis aligned bounding box - virtual void setBoundingBox(const core::aabbox3df& box) _IRR_OVERRIDE_; - - //! set the hardware mapping hint, for driver - virtual void setHardwareMappingHint(E_HARDWARE_MAPPING newMappingHint, E_BUFFER_TYPE buffer=EBT_VERTEX_AND_INDEX) _IRR_OVERRIDE_; - - //! flags the meshbuffer as changed, reloads hardware buffers - virtual void setDirty(E_BUFFER_TYPE buffer=EBT_VERTEX_AND_INDEX) _IRR_OVERRIDE_; - - private: - //! animates one frame - inline void Animate(u32 frame); - - video::SMaterial Material; - - //! hold original compressed MD3 Info - SMD3Mesh *Mesh; - - u32 IPolShift; - u32 LoopMode; - f32 Scaling; - - //! Cache Info - struct SCacheInfo - { - SCacheInfo(s32 frame=-1, s32 start=-1, s32 end=-1 ) : - Frame(frame), startFrameLoop(start), - endFrameLoop(end) - {} - - bool operator == ( const SCacheInfo &other ) const - { - return 0 == memcmp ( this, &other, sizeof ( SCacheInfo ) ); - } - s32 Frame; - s32 startFrameLoop; - s32 endFrameLoop; - }; - SCacheInfo Current; - - //! return a Mesh per frame - SMesh* MeshIPol; - SMD3QuaternionTagList TagListIPol; - - IMeshBuffer* createMeshBuffer(const SMD3MeshBuffer* source, - io::IFileSystem* fs, video::IVideoDriver* driver); - - void buildVertexArray(u32 frameA, u32 frameB, f32 interpolate, - const SMD3MeshBuffer* source, - SMeshBufferLightMap* dest); - - void buildTagArray(u32 frameA, u32 frameB, f32 interpolate); - f32 FramesPerSecond; - }; - - -} // end namespace scene -} // end namespace irr - -#endif - diff --git a/source/Irrlicht/CAnimatedMeshSceneNode.cpp b/source/Irrlicht/CAnimatedMeshSceneNode.cpp index de96749b..21733a0e 100644 --- a/source/Irrlicht/CAnimatedMeshSceneNode.cpp +++ b/source/Irrlicht/CAnimatedMeshSceneNode.cpp @@ -7,12 +7,6 @@ #include "ISceneManager.h" #include "S3DVertex.h" #include "os.h" -#ifdef _IRR_COMPILE_WITH_SHADOW_VOLUME_SCENENODE_ -#include "CShadowVolumeSceneNode.h" -#else -#include "IShadowVolumeSceneNode.h" -#endif // _IRR_COMPILE_WITH_SHADOW_VOLUME_SCENENODE_ -#include "IAnimatedMeshMD3.h" #include "CSkinnedMesh.h" #include "IDummyTransformationSceneNode.h" #include "IBoneSceneNode.h" @@ -20,6 +14,7 @@ #include "IMesh.h" #include "IMeshCache.h" #include "IAnimatedMesh.h" +#include "IFileSystem.h" #include "quaternion.h" @@ -41,7 +36,7 @@ CAnimatedMeshSceneNode::CAnimatedMeshSceneNode(IAnimatedMesh* mesh, TransitionTime(0), Transiting(0.f), TransitingBlend(0.f), JointMode(EJUOR_NONE), JointsUsed(false), Looping(true), ReadOnlyMaterials(false), RenderFromIdentity(false), - LoopCallBack(0), PassCount(0), Shadow(0), MD3Special(0) + LoopCallBack(0), PassCount(0) { #ifdef _DEBUG setDebugName("CAnimatedMeshSceneNode"); @@ -54,15 +49,6 @@ CAnimatedMeshSceneNode::CAnimatedMeshSceneNode(IAnimatedMesh* mesh, //! destructor CAnimatedMeshSceneNode::~CAnimatedMeshSceneNode() { - if (MD3Special) - MD3Special->drop(); - - if (Mesh) - Mesh->drop(); - - if (Shadow) - Shadow->drop(); - if (LoopCallBack) LoopCallBack->drop(); } @@ -294,9 +280,6 @@ void CAnimatedMeshSceneNode::render() driver->setTransform(video::ETS_WORLD, AbsoluteTransformation); - if (Shadow && PassCount==1) - Shadow->updateShadowVolumes(); - // for debug purposes only: bool renderMeshes = true; @@ -416,40 +399,6 @@ void CAnimatedMeshSceneNode::render() } } } - - // show tag for quake3 models - if (Mesh->getMeshType() == EAMT_MD3) - { - IAnimatedMesh * arrow = - SceneManager->addArrowMesh ( - "__tag_show", - 0xFF0000FF, 0xFF000088, - 4, 8, 5.f, 4.f, 0.5f, - 1.f); - if (!arrow) - { - arrow = SceneManager->getMesh ( "__tag_show" ); - } - IMesh *arrowMesh = arrow->getMesh(0); - - core::matrix4 matr; - - SMD3QuaternionTagList *taglist = ((IAnimatedMeshMD3*)Mesh)->getTagList( - (s32)getFrameNr(), 255, - getStartFrame(), getEndFrame()); - if (taglist) - { - for ( u32 ts = 0; ts != taglist->size(); ++ts ) - { - (*taglist)[ts].setto(matr); - - driver->setTransform(video::ETS_WORLD, matr ); - - for ( u32 a = 0; a != arrowMesh->getMeshBufferCount(); ++a ) - driver->drawMeshBuffer(arrowMesh->getMeshBuffer(a)); - } - } - } } // show mesh @@ -550,28 +499,6 @@ u32 CAnimatedMeshSceneNode::getMaterialCount() const } -//! Creates shadow volume scene node as child of this node -//! and returns a pointer to it. -IShadowVolumeSceneNode* CAnimatedMeshSceneNode::addShadowVolumeSceneNode( - const IMesh* shadowMesh, s32 id, bool zfailmethod, f32 infinity) -{ -#ifdef _IRR_COMPILE_WITH_SHADOW_VOLUME_SCENENODE_ - if (!SceneManager->getVideoDriver()->queryFeature(video::EVDF_STENCIL_BUFFER)) - return 0; - - if (!shadowMesh) - shadowMesh = Mesh; // if null is given, use the mesh of node - - if (Shadow) - Shadow->drop(); - - Shadow = new CShadowVolumeSceneNode(shadowMesh, this, SceneManager, id, zfailmethod, infinity); - return Shadow; -#else - return 0; -#endif -} - //! Returns a pointer to a child node, which has the same transformation as //! the corresponding joint, if the mesh in this scene node is a skinned mesh. IBoneSceneNode* CAnimatedMeshSceneNode::getJointNode(const c8* jointName) @@ -660,12 +587,6 @@ u32 CAnimatedMeshSceneNode::getJointCount() const //! or to remove attached childs. bool CAnimatedMeshSceneNode::removeChild(ISceneNode* child) { - if (child && Shadow == child) - { - Shadow->drop(); - Shadow = 0; - } - if (ISceneNode::removeChild(child)) { if (JointsUsed) //stop weird bugs caused while changing parents as the joints are being created @@ -686,41 +607,6 @@ bool CAnimatedMeshSceneNode::removeChild(ISceneNode* child) } -//! Starts a MD2 animation. -bool CAnimatedMeshSceneNode::setMD2Animation(EMD2_ANIMATION_TYPE anim) -{ - if (!Mesh || Mesh->getMeshType() != EAMT_MD2) - return false; - - IAnimatedMeshMD2* md = (IAnimatedMeshMD2*)Mesh; - - s32 begin, end, speed; - md->getFrameLoop(anim, begin, end, speed); - - setAnimationSpeed( f32(speed) ); - setFrameLoop(begin, end); - return true; -} - - -//! Starts a special MD2 animation. -bool CAnimatedMeshSceneNode::setMD2Animation(const c8* animationName) -{ - if (!Mesh || Mesh->getMeshType() != EAMT_MD2) - return false; - - IAnimatedMeshMD2* md = (IAnimatedMeshMD2*)Mesh; - - s32 begin, end, speed; - if (!md->getFrameLoop(animationName, begin, end, speed)) - return false; - - setAnimationSpeed( (f32)speed ); - setFrameLoop(begin, end); - return true; -} - - //! Sets looping mode which is on by default. If set to false, //! animations will not be looped. void CAnimatedMeshSceneNode::setLoopMode(bool playAnimationLooped) @@ -863,50 +749,10 @@ void CAnimatedMeshSceneNode::setMesh(IAnimatedMesh* mesh) } -// returns the absolute transformation for a special MD3 Tag if the mesh is a md3 mesh, -// or the absolutetransformation if it's a normal scenenode -const SMD3QuaternionTag* CAnimatedMeshSceneNode::getMD3TagTransformation(const core::stringc& tagname) -{ - return MD3Special ? MD3Special->AbsoluteTagList.get(tagname) : 0; -} - - //! updates the absolute position based on the relative and the parents position void CAnimatedMeshSceneNode::updateAbsolutePosition() { IAnimatedMeshSceneNode::updateAbsolutePosition(); - - if (!Mesh || Mesh->getMeshType() != EAMT_MD3) - return; - - SMD3QuaternionTagList *taglist; - taglist = ( (IAnimatedMeshMD3*) Mesh )->getTagList ( (s32)getFrameNr(),255,getStartFrame (),getEndFrame () ); - if (taglist) - { - if (!MD3Special) - { - MD3Special = new SMD3Special(); - } - - SMD3QuaternionTag parent ( MD3Special->Tagname ); - if (Parent && Parent->getType() == ESNT_ANIMATED_MESH) - { - const SMD3QuaternionTag * p = ((IAnimatedMeshSceneNode*) Parent)->getMD3TagTransformation - ( MD3Special->Tagname ); - - if (p) - parent = *p; - } - - SMD3QuaternionTag relative( RelativeTranslation, RelativeRotation ); - - MD3Special->AbsoluteTagList.set_used ( taglist->size () ); - for ( u32 i=0; i!= taglist->size (); ++i ) - { - MD3Special->AbsoluteTagList[i].position = parent.position + (*taglist)[i].position + relative.position; - MD3Special->AbsoluteTagList[i].rotation = parent.rotation * (*taglist)[i].rotation * relative.rotation; - } - } } //! Set the joint update mode (0-unused, 1-get joints only, 2-set joints only, 3-move and set) @@ -1110,13 +956,9 @@ ISceneNode* CAnimatedMeshSceneNode::clone(ISceneNode* newParent, ISceneManager* if (newNode->LoopCallBack) newNode->LoopCallBack->grab(); newNode->PassCount = PassCount; - newNode->Shadow = Shadow; - if (newNode->Shadow) - newNode->Shadow->grab(); newNode->JointChildSceneNodes = JointChildSceneNodes; newNode->PretransitingSave = PretransitingSave; newNode->RenderFromIdentity = RenderFromIdentity; - newNode->MD3Special = MD3Special; return newNode; } diff --git a/source/Irrlicht/CAnimatedMeshSceneNode.h b/source/Irrlicht/CAnimatedMeshSceneNode.h index 6a5914e9..6bf057b4 100644 --- a/source/Irrlicht/CAnimatedMeshSceneNode.h +++ b/source/Irrlicht/CAnimatedMeshSceneNode.h @@ -78,11 +78,6 @@ namespace scene //! returns amount of materials used by this scene node. virtual u32 getMaterialCount() const _IRR_OVERRIDE_; - //! Creates shadow volume scene node as child of this node - //! and returns a pointer to it. - virtual IShadowVolumeSceneNode* addShadowVolumeSceneNode(const IMesh* shadowMesh, - s32 id, bool zfailmethod=true, f32 infinity=1000.0f) _IRR_OVERRIDE_; - //! Returns a pointer to a child node, which has the same transformation as //! the corresponding joint, if the mesh in this scene node is a skinned mesh. virtual IBoneSceneNode* getJointNode(const c8* jointName) _IRR_OVERRIDE_; @@ -98,12 +93,6 @@ namespace scene //! or to remove attached child. virtual bool removeChild(ISceneNode* child) _IRR_OVERRIDE_; - //! Starts a MD2 animation. - virtual bool setMD2Animation(EMD2_ANIMATION_TYPE anim) _IRR_OVERRIDE_; - - //! Starts a special MD2 animation. - virtual bool setMD2Animation(const c8* animationName) _IRR_OVERRIDE_; - //! Returns the current displayed frame number. virtual f32 getFrameNr() const _IRR_OVERRIDE_; //! Returns the current start frame number. @@ -134,10 +123,6 @@ namespace scene //! Returns type of the scene node virtual ESCENE_NODE_TYPE getType() const _IRR_OVERRIDE_ { return ESNT_ANIMATED_MESH; } - // returns the absolute transformation for a special MD3 Tag if the mesh is a md3 mesh, - // or the absolutetransformation if it's a normal scenenode - const SMD3QuaternionTag* getMD3TagTransformation( const core::stringc & tagname) _IRR_OVERRIDE_; - //! updates the absolute position based on the relative and the parents position virtual void updateAbsolutePosition() _IRR_OVERRIDE_; @@ -195,25 +180,8 @@ namespace scene IAnimationEndCallBack* LoopCallBack; s32 PassCount; - IShadowVolumeSceneNode* Shadow; - core::array<IBoneSceneNode* > JointChildSceneNodes; core::array<core::matrix4> PretransitingSave; - - // Quake3 Model - struct SMD3Special : public virtual IReferenceCounted - { - core::stringc Tagname; - SMD3QuaternionTagList AbsoluteTagList; - - SMD3Special & operator = (const SMD3Special & copyMe) - { - Tagname = copyMe.Tagname; - AbsoluteTagList = copyMe.AbsoluteTagList; - return *this; - } - }; - SMD3Special *MD3Special; }; } // end namespace scene diff --git a/source/Irrlicht/CB3DMeshFileLoader.cpp b/source/Irrlicht/CB3DMeshFileLoader.cpp index c473d529..ec20bf8d 100644 --- a/source/Irrlicht/CB3DMeshFileLoader.cpp +++ b/source/Irrlicht/CB3DMeshFileLoader.cpp @@ -10,7 +10,6 @@ #ifdef _IRR_COMPILE_WITH_B3D_LOADER_ #include "CB3DMeshFileLoader.h" -#include "CMeshTextureLoader.h" #include "IVideoDriver.h" #include "IFileSystem.h" @@ -33,8 +32,6 @@ CB3DMeshFileLoader::CB3DMeshFileLoader(scene::ISceneManager* smgr) #ifdef _DEBUG setDebugName("CB3DMeshFileLoader"); #endif - - TextureLoader = new CMeshTextureLoader( SceneManager->getFileSystem(), SceneManager->getVideoDriver() ); } @@ -55,9 +52,6 @@ IAnimatedMesh* CB3DMeshFileLoader::createMesh(io::IReadFile* file) if (!file) return 0; - if ( getMeshTextureLoader() ) - getMeshTextureLoader()->setMeshFile(file); - B3DFile = file; AnimatedMesh = new scene::CSkinnedMesh(); ShowWarning = true; // If true a warning is issued if too many textures are used @@ -283,7 +277,6 @@ bool CB3DMeshFileLoader::readChunkMESH(CSkinnedMesh::SJoint *inJoint) if (brushID!=-1) { - loadTextures(Materials[brushID]); meshBuffer->Material=Materials[brushID].Material; } @@ -467,7 +460,6 @@ bool CB3DMeshFileLoader::readChunkTRIS(scene::SSkinMeshBuffer *meshBuffer, u32 m if (triangle_brush_id != -1) { - loadTextures(Materials[triangle_brush_id]); B3dMaterial = &Materials[triangle_brush_id]; meshBuffer->Material = B3dMaterial->Material; } @@ -1035,46 +1027,6 @@ bool CB3DMeshFileLoader::readChunkBRUS() } -void CB3DMeshFileLoader::loadTextures(SB3dMaterial& material) const -{ - if ( getMeshTextureLoader() ) - { - if ( SceneManager->getParameters()->existsAttribute(B3D_TEXTURE_PATH) ) - getMeshTextureLoader()->setTexturePath( SceneManager->getParameters()->getAttributeAsString(B3D_TEXTURE_PATH) ); - } - - const bool previous32BitTextureFlag = SceneManager->getVideoDriver()->getTextureCreationFlag(video::ETCF_ALWAYS_32_BIT); - SceneManager->getVideoDriver()->setTextureCreationFlag(video::ETCF_ALWAYS_32_BIT, true); - - // read texture from disk - // note that mipmaps might be disabled by Flags & 0x8 - const bool doMipMaps = SceneManager->getVideoDriver()->getTextureCreationFlag(video::ETCF_CREATE_MIP_MAPS); - - for (u32 i=0; i<video::MATERIAL_MAX_TEXTURES; ++i) - { - SB3dTexture* B3dTexture = material.Textures[i]; - if (B3dTexture && B3dTexture->TextureName.size() && !material.Material.getTexture(i)) - { - if (!SceneManager->getParameters()->getAttributeAsBool(B3D_LOADER_IGNORE_MIPMAP_FLAG)) - SceneManager->getVideoDriver()->setTextureCreationFlag(video::ETCF_CREATE_MIP_MAPS, (B3dTexture->Flags & 0x8) ? true:false); - { - video::ITexture* tex = getMeshTextureLoader() ? getMeshTextureLoader()->getTexture(B3dTexture->TextureName) : NULL; - material.Material.setTexture(i, tex); - } - if (material.Textures[i]->Flags & 0x10) // Clamp U - material.Material.TextureLayer[i].TextureWrapU=video::ETC_CLAMP; - if (material.Textures[i]->Flags & 0x20) // Clamp V - material.Material.TextureLayer[i].TextureWrapV=video::ETC_CLAMP; - if (material.Textures[i]->Flags & 0x20) // Clamp R - material.Material.TextureLayer[i].TextureWrapW=video::ETC_CLAMP; - } - } - - SceneManager->getVideoDriver()->setTextureCreationFlag(video::ETCF_CREATE_MIP_MAPS, doMipMaps); - SceneManager->getVideoDriver()->setTextureCreationFlag(video::ETCF_ALWAYS_32_BIT, previous32BitTextureFlag); -} - - void CB3DMeshFileLoader::readString(core::stringc& newstring) { newstring=""; diff --git a/source/Irrlicht/CB3DMeshFileLoader.h b/source/Irrlicht/CB3DMeshFileLoader.h index ea78e532..6a3c4c73 100644 --- a/source/Irrlicht/CB3DMeshFileLoader.h +++ b/source/Irrlicht/CB3DMeshFileLoader.h @@ -54,8 +54,6 @@ private: bool readChunkTEXS(); bool readChunkBRUS(); - void loadTextures(SB3dMaterial& material) const; - void readString(core::stringc& newstring); void readFloats(f32* vec, u32 count); diff --git a/source/Irrlicht/CBSPMeshFileLoader.cpp b/source/Irrlicht/CBSPMeshFileLoader.cpp deleted file mode 100644 index 01ac04aa..00000000 --- a/source/Irrlicht/CBSPMeshFileLoader.cpp +++ /dev/null @@ -1,107 +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_BSP_LOADER_ - -#include "CBSPMeshFileLoader.h" -#include "CQ3LevelMesh.h" - -namespace irr -{ -namespace scene -{ - -//! Constructor -CBSPMeshFileLoader::CBSPMeshFileLoader(scene::ISceneManager* smgr, - io::IFileSystem* fs) -: FileSystem(fs), SceneManager(smgr) -{ - - #ifdef _DEBUG - setDebugName("CBSPMeshFileLoader"); - #endif - - if (FileSystem) - FileSystem->grab(); -} - - -//! destructor -CBSPMeshFileLoader::~CBSPMeshFileLoader() -{ - if (FileSystem) - FileSystem->drop(); -} - - -//! returns true if the file maybe is able to be loaded by this class -//! based on the file extension (e.g. ".bsp") -bool CBSPMeshFileLoader::isALoadableFileExtension(const io::path& filename) const -{ - return core::hasFileExtension ( filename, "bsp", "shader", "cfg" ); -} - - -//! 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* CBSPMeshFileLoader::createMesh(io::IReadFile* file) -{ - s32 type = core::isFileExtension ( file->getFileName(), "bsp", "shader", "cfg" ); - CQ3LevelMesh* q = 0; - - switch ( type ) - { - case 1: - q = new CQ3LevelMesh(FileSystem, SceneManager, LoadParam); - - // determine real shaders in LoadParam - if ( 0 == LoadParam.loadAllShaders ) - { - q->getShader("scripts/common.shader"); - q->getShader("scripts/sfx.shader"); - q->getShader("scripts/gfx.shader"); - q->getShader("scripts/liquid.shader"); - q->getShader("scripts/models.shader"); - q->getShader("scripts/walls.shader"); - //q->getShader("scripts/sky.shader"); - } - - if ( q->loadFile(file) ) - return q; - - q->drop(); - break; - - case 2: - q = new CQ3LevelMesh(FileSystem, SceneManager,LoadParam); - q->getShader( file ); - return q; - break; - - case 3: - // load quake 3 loading parameter - if ( file->getFileName() == "levelparameter.cfg" ) - { - file->read ( &LoadParam, sizeof ( LoadParam ) ); - } - else - { - q = new CQ3LevelMesh(FileSystem, SceneManager,LoadParam); - q->getConfiguration( file ); - return q; - } - break; - } - - return 0; -} - -} // end namespace scene -} // end namespace irr - -#endif // _IRR_COMPILE_WITH_BSP_LOADER_ - diff --git a/source/Irrlicht/CBSPMeshFileLoader.h b/source/Irrlicht/CBSPMeshFileLoader.h deleted file mode 100644 index e636f989..00000000 --- a/source/Irrlicht/CBSPMeshFileLoader.h +++ /dev/null @@ -1,52 +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_BSP_MESH_FILE_LOADER_H_INCLUDED__ -#define __C_BSP_MESH_FILE_LOADER_H_INCLUDED__ - -#include "IMeshLoader.h" -#include "IFileSystem.h" -#include "IVideoDriver.h" -#include "ISceneManager.h" -#include "IQ3Shader.h" - -namespace irr -{ -namespace scene -{ - -//! Meshloader capable of loading Quake 3 BSP files and shaders -class CBSPMeshFileLoader : public IMeshLoader -{ -public: - - //! Constructor - CBSPMeshFileLoader(scene::ISceneManager* smgr, io::IFileSystem* fs); - - //! destructor - virtual ~CBSPMeshFileLoader(); - - //! returns true if the file maybe is able to be loaded by this class - //! based on the file extension (e.g. ".bsp") - 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: - - io::IFileSystem* FileSystem; - scene::ISceneManager* SceneManager; - - quake3::Q3LevelLoadParameter LoadParam; -}; - -} // end namespace scene -} // end namespace irr - -#endif - diff --git a/source/Irrlicht/CBoneSceneNode.cpp b/source/Irrlicht/CBoneSceneNode.cpp index af540110..87955423 100644 --- a/source/Irrlicht/CBoneSceneNode.cpp +++ b/source/Irrlicht/CBoneSceneNode.cpp @@ -67,12 +67,6 @@ void CBoneSceneNode::OnAnimate(u32 timeMs) { if (IsVisible) { - // animate this node with all animators - - ISceneNodeAnimatorList::Iterator ait = Animators.begin(); - for (; ait != Animators.end(); ++ait) - (*ait)->animateNode(this, timeMs); - // update absolute position //updateAbsolutePosition(); diff --git a/source/Irrlicht/CBurningShader_Raster_Reference.cpp b/source/Irrlicht/CBurningShader_Raster_Reference.cpp deleted file mode 100644 index 45858a07..00000000 --- a/source/Irrlicht/CBurningShader_Raster_Reference.cpp +++ /dev/null @@ -1,1149 +0,0 @@ -// Copyright (C) 2002-2012 Nikolaus Gebhardt / Thomas Alten -// This file is part of the "Irrlicht Engine". -// For conditions of distribution and use, see copyright notice in irrlicht.h - -#include "IrrCompileConfig.h" -#include "IBurningShader.h" - -#if defined(_IRR_COMPILE_WITH_BURNINGSVIDEO_) && 0 - - -namespace irr -{ - -namespace video -{ - - /*! Render states define set-up states for all kinds of vertex and pixel processing. - Some render states set up vertex processing, and some set up pixel processing (see Render States). - Render states can be saved and restored using stateblocks (see State Blocks Save and Restore State). - */ - enum BD3DRENDERSTATETYPE - { - /*! BD3DRS_ZENABLE - Depth-buffering state as one member of the BD3DZBUFFERTYPE enumerated type. - Set this state to D3DZB_TRUE to enable z-buffering, - D3DZB_USEW to enable w-buffering, or D3DZB_FALSE to disable depth buffering. - The default value for this render state is D3DZB_TRUE if a depth stencil was created - along with the swap chain by setting the EnableAutoDepthStencil member of the - D3DPRESENT_PARAMETERS structure to TRUE, and D3DZB_FALSE otherwise. - */ - BD3DRS_ZENABLE, - - /*! BD3DRS_FILLMODE - One or more members of the D3DFILLMODE enumerated type. The default value is D3DFILL_SOLID. - */ - BD3DRS_FILLMODE, - - /*! BD3DRS_SHADEMODE - One or more members of the D3DSHADEMODE enumerated type. The default value is D3DSHADE_GOURAUD. - */ - BD3DRS_SHADEMODE, - - /*! BD3DRS_ZWRITEENABLE - TRUE to enable the application to write to the depth buffer. The default value is TRUE. - This member enables an application to prevent the system from updating the depth buffer with - new depth values. If FALSE, depth comparisons are still made according to the render state - D3DRS_ZFUNC, assuming that depth buffering is taking place, but depth values are not written - to the buffer. - */ - BD3DRS_ZWRITEENABLE, - - /*! BD3DRS_ALPHATESTENABLE - TRUE to enable per pixel alpha testing. If the test passes, the pixel is processed by the frame - buffer. Otherwise, all frame-buffer processing is skipped for the pixel. The test is done by - comparing the incoming alpha value with the reference alpha value, using the comparison function - provided by the D3DRS_ALPHAFUNC render state. The reference alpha value is determined by the value - set for D3DRS_ALPHAREF. For more information, see Alpha Testing State. - The default value of this parameter is FALSE. - */ - BD3DRS_ALPHATESTENABLE, - - /*! BD3DRS_SRCBLEND - One member of the BD3DBLEND enumerated type. The default value is BD3DBLEND_ONE. - */ - BD3DRS_SRCBLEND, - - /*! BD3DRS_DESTBLEND - One member of the BD3DBLEND enumerated type. The default value is BD3DBLEND_ZERO. - */ - BD3DRS_DESTBLEND, - - /*! BD3DRS_CULLMODE - Specifies how back-facing triangles are culled, if at all. This can be set to one - member of the BD3DCULL enumerated type. The default value is BD3DCULL_CCW. - */ - BD3DRS_CULLMODE, - - /*! BD3DRS_ZFUNC - One member of the BD3DCMPFUNC enumerated type. The default value is BD3DCMP_LESSEQUAL. - This member enables an application to accept or reject a pixel, based on its distance from - the camera. The depth value of the pixel is compared with the depth-buffer value. If the depth - value of the pixel passes the comparison function, the pixel is written. - - The depth value is written to the depth buffer only if the render state is TRUE. - Software rasterizers and many hardware accelerators work faster if the depth test fails, - because there is no need to filter and modulate the texture if the pixel is not going to be - rendered. - */ - BD3DRS_ZFUNC, - - /*! BD3DRS_ALPHAREF - Value that specifies a reference alpha value against which pixels are tested when alpha testing - is enabled. This is an 8-bit value placed in the low 8 bits of the DWORD render-state value. - Values can range from 0x00000000 through 0x000000FF. The default value is 0. - */ - BD3DRS_ALPHAREF, - - /*! BD3DRS_ALPHAFUNC - One member of the BD3DCMPFUNC enumerated type. The default value is BD3DCMP_ALWAYS. - This member enables an application to accept or reject a pixel, based on its alpha value. - */ - BD3DRS_ALPHAFUNC, - - /*! BD3DRS_DITHERENABLE - TRUE to enable dithering. The default value is FALSE. - */ - BD3DRS_DITHERENABLE, - - /*! BD3DRS_ALPHABLENDENABLE - TRUE to enable alpha-blended transparency. The default value is FALSE. - The type of alpha blending is determined by the BD3DRS_SRCBLEND and BD3DRS_DESTBLEND render states. - */ - BD3DRS_ALPHABLENDENABLE, - - /*! BD3DRS_FOGENABLE - TRUE to enable fog blending. The default value is FALSE. For more information about using fog - blending, see Fog. - */ - BD3DRS_FOGENABLE, - - /*! BD3DRS_SPECULARENABLE - TRUE to enable specular highlights. The default value is FALSE. - Specular highlights are calculated as though every vertex in the object being lit is at the - object's origin. This gives the expected results as long as the object is modeled around the - origin and the distance from the light to the object is relatively large. In other cases, the - results as undefined. - When this member is set to TRUE, the specular color is added to the base color after the - texture cascade but before alpha blending. - */ - BD3DRS_SPECULARENABLE, - - /*! BD3DRS_FOGCOLOR - Value whose type is D3DCOLOR. The default value is 0. For more information about fog color, - see Fog Color. - */ - BD3DRS_FOGCOLOR, - - /*! BD3DRS_FOGTABLEMODE - The fog formula to be used for pixel fog. Set to one of the members of the D3DFOGMODE - enumerated type. The default value is D3DFOG_NONE. For more information about pixel fog, - see Pixel Fog. - */ - BD3DRS_FOGTABLEMODE, - - /*! BD3DRS_FOGSTART - Depth at which pixel or vertex fog effects begin for linear fog mode. The default value is 0.0f. - Depth is specified in world space for vertex fog and either device space [0.0, 1.0] or world - space for pixel fog. For pixel fog, these values are in device space when the system uses z for - fog calculations and world-world space when the system is using eye-relative fog (w-fog). For - more information, see Fog Parameters and Eye-Relative vs. Z-based Depth. - Values for the this render state are floating-point values. - Because the IDirect3DDevice9::SetRenderState method accepts DWORD values, your - application must cast a variable that contains the value, as shown in the following code example. - pDevice9->SetRenderState( BD3DRS_FOGSTART, *((DWORD*) (&fFogStart))); - */ - BD3DRS_FOGSTART, - - /*! BD3DRS_FOGEND - Depth at which pixel or vertex fog effects end for linear fog mode. The default value is 1.0f. - Depth is specified in world space for vertex fog and either device space [0.0, 1.0] or world space - for pixel fog. For pixel fog, these values are in device space when the system uses z for fog - calculations and in world space when the system is using eye-relative fog (w-fog). For more - information, see Fog Parameters and Eye-Relative vs. Z-based Depth. - Values for this render state are floating-point values. - */ - BD3DRS_FOGEND, - - /*! BD3DRS_FOGDENSITY - Fog density for pixel or vertex fog used in the exponential fog modes (D3DFOG_EXP and D3DFOG_EXP2). - Valid density values range from 0.0 through 1.0. The default value is 1.0. For more information, - see Fog Parameters. - Values for this render state are floating-point values. - */ - BD3DRS_FOGDENSITY, - - - /*! BD3DRS_RANGEFOGENABLE - TRUE to enable range-based vertex fog. The default value is FALSE, in which case the system - uses depth-based fog. In range-based fog, the distance of an object from the viewer is used - to compute fog effects, not the depth of the object (that is, the z-coordinate) in the scene. - In range-based fog, all fog methods work as usual, except that they use range instead of depth - in the computations. - Range is the correct factor to use for fog computations, but depth is commonly used instead - because range is time-consuming to compute and depth is generally already available. Using depth - to calculate fog has the undesirable effect of having the fogginess of peripheral objects change - as the viewer's eye moves - in this case, the depth changes and the range remains constant. - - Because no hardware currently supports per-pixel range-based fog, range correction is offered - only for vertex fog. - For more information, see Vertex Fog. - */ - BD3DRS_RANGEFOGENABLE = 48, - - /*! BD3DRS_STENCILENABLE - TRUE to enable stenciling, or FALSE to disable stenciling. The default value is FALSE. - For more information, see Stencil Buffer Techniques. - */ - BD3DRS_STENCILENABLE = 52, - - /*! BD3DRS_STENCILFAIL - Stencil operation to perform if the stencil test fails. Values are from the D3DSTENCILOP - enumerated type. The default value is D3DSTENCILOP_KEEP. - */ - BD3DRS_STENCILFAIL = 53, - - /*! BD3DRS_STENCILZFAIL - Stencil operation to perform if the stencil test passes and the depth test (z-test) fails. - Values are from the D3DSTENCILOP enumerated type. The default value is D3DSTENCILOP_KEEP. - */ - BD3DRS_STENCILZFAIL = 54, - - /*! BD3DRS_STENCILPASS - Stencil operation to perform if both the stencil and the depth (z) tests pass. Values are - from the D3DSTENCILOP enumerated type. The default value is D3DSTENCILOP_KEEP. - */ - BD3DRS_STENCILPASS = 55, - - /*! BD3DRS_STENCILFUNC - Comparison function for the stencil test. Values are from the D3DCMPFUNC enumerated type. - The default value is D3DCMP_ALWAYS. - The comparison function is used to compare the reference value to a stencil buffer entry. - This comparison applies only to the bits in the reference value and stencil buffer entry that - are set in the stencil mask (set by the D3DRS_STENCILMASK render state). If TRUE, the stencil - test passes. - */ - BD3DRS_STENCILFUNC = 56, - - /*! BD3DRS_STENCILREF - An int reference value for the stencil test. The default value is 0. - */ - BD3DRS_STENCILREF = 57, - - /*! BD3DRS_STENCILMASK - Mask applied to the reference value and each stencil buffer entry to determine the significant - bits for the stencil test. The default mask is 0xFFFFFFFF. - */ - BD3DRS_STENCILMASK = 58, - - /*! BD3DRS_STENCILWRITEMASK - Write mask applied to values written into the stencil buffer. The default mask is 0xFFFFFFFF. - */ - BD3DRS_STENCILWRITEMASK = 59, - - /*! BD3DRS_TEXTUREFACTOR - Color used for multiple-texture blending with the D3DTA_TFACTOR texture-blending argument or the - D3DTOP_BLENDFACTORALPHA texture-blending operation. The associated value is a D3DCOLOR variable. - The default value is opaque white (0xFFFFFFFF). - */ - BD3DRS_TEXTUREFACTOR = 60, - - /*! BD3DRS_WRAP0 - Texture-wrapping behavior for multiple sets of texture coordinates. Valid values for this - render state can be any combination of the D3DWRAPCOORD_0 (or D3DWRAP_U), D3DWRAPCOORD_1 - (or D3DWRAP_V), D3DWRAPCOORD_2 (or D3DWRAP_W), and D3DWRAPCOORD_3 flags. These cause the system - to wrap in the direction of the first, second, third, and fourth dimensions, sometimes referred - to as the s, t, r, and q directions, for a given texture. The default value for this render state - is 0 (wrapping disabled in all directions). - */ - BD3DRS_WRAP0 = 128, - BD3DRS_WRAP1 = 129, - BD3DRS_WRAP2 = 130, - BD3DRS_WRAP3 = 131, - BD3DRS_WRAP4 = 132, - BD3DRS_WRAP5 = 133, - BD3DRS_WRAP6 = 134, - BD3DRS_WRAP7 = 135, - - /*! BD3DRS_CLIPPING - TRUE to enable primitive clipping by Direct3D, or FALSE to disable it. The default value is TRUE. - */ - BD3DRS_CLIPPING = 136, - - /*! BD3DRS_LIGHTING - TRUE to enable Direct3D lighting, or FALSE to disable it. The default value is TRUE. Only - vertices that include a vertex normal are properly lit; vertices that do not contain a normal - employ a dot product of 0 in all lighting calculations. - */ - BD3DRS_LIGHTING = 137, - - /*! D3DRS_AMBIENT - Ambient light color. This value is of type D3DCOLOR. The default value is 0. - */ - BD3DRS_AMBIENT = 139, - - /*! BD3DRS_FOGVERTEXMODE - Fog formula to be used for vertex fog. Set to one member of the BD3DFOGMODE enumerated type. - The default value is D3DFOG_NONE. - */ - BD3DRS_FOGVERTEXMODE = 140, - - /*! BD3DRS_COLORVERTEX - TRUE to enable per-vertex color or FALSE to disable it. The default value is TRUE. Enabling - per-vertex color allows the system to include the color defined for individual vertices in its - lighting calculations. - For more information, see the following render states: - BD3DRS_DIFFUSEMATERIALSOURCE - BD3DRS_SPECULARMATERIALSOURCE - BD3DRS_AMBIENTMATERIALSOURCE - BD3DRS_EMISSIVEMATERIALSOURCE - */ - BD3DRS_COLORVERTEX = 141, - - /*! BD3DRS_LOCALVIEWER - TRUE to enable camera-relative specular highlights, or FALSE to use orthogonal specular - highlights. The default value is TRUE. Applications that use orthogonal projection should - specify false. - */ - BD3DRS_LOCALVIEWER = 142, - - /*! BD3DRS_NORMALIZENORMALS - TRUE to enable automatic normalization of vertex normals, or FALSE to disable it. The default - value is FALSE. Enabling this feature causes the system to normalize the vertex normals for - vertices after transforming them to camera space, which can be computationally time-consuming. - */ - BD3DRS_NORMALIZENORMALS = 143, - - /*! BD3DRS_DIFFUSEMATERIALSOURCE - Diffuse color source for lighting calculations. Valid values are members of the - D3DMATERIALCOLORSOURCE enumerated type. The default value is D3DMCS_COLOR1. The value for this - render state is used only if the D3DRS_COLORVERTEX render state is set to TRUE. - */ - BD3DRS_DIFFUSEMATERIALSOURCE = 145, - - /*! BD3DRS_SPECULARMATERIALSOURCE - Specular color source for lighting calculations. Valid values are members of the - D3DMATERIALCOLORSOURCE enumerated type. The default value is D3DMCS_COLOR2. - */ - BD3DRS_SPECULARMATERIALSOURCE = 146, - - /*! D3DRS_AMBIENTMATERIALSOURCE - Ambient color source for lighting calculations. Valid values are members of the - D3DMATERIALCOLORSOURCE enumerated type. The default value is D3DMCS_MATERIAL. - */ - BD3DRS_AMBIENTMATERIALSOURCE = 147, - - /*! D3DRS_EMISSIVEMATERIALSOURCE - Emissive color source for lighting calculations. Valid values are members of the - D3DMATERIALCOLORSOURCE enumerated type. The default value is D3DMCS_MATERIAL. - */ - BD3DRS_EMISSIVEMATERIALSOURCE = 148, - - /*! D3DRS_VERTEXBLEND - Number of matrices to use to perform geometry blending, if any. Valid values are members - of the D3DVERTEXBLENDFLAGS enumerated type. The default value is D3DVBF_DISABLE. - */ - BD3DRS_VERTEXBLEND = 151, - - /* D3DRS_CLIPPLANEENABLE - Enables or disables user-defined clipping planes. Valid values are any DWORD in which the - status of each bit (set or not set) toggles the activation state of a corresponding user-defined - clipping plane. The least significant bit (bit 0) controls the first clipping plane at index 0, - and subsequent bits control the activation of clipping planes at higher indexes. If a bit is set, - the system applies the appropriate clipping plane during scene rendering. The default value is 0. - The D3DCLIPPLANEn macros are defined to provide a convenient way to enable clipping planes. - */ - BD3DRS_CLIPPLANEENABLE = 152, - BD3DRS_POINTSIZE = 154, - BD3DRS_POINTSIZE_MIN = 155, - BD3DRS_POINTSPRITEENABLE = 156, - BD3DRS_POINTSCALEENABLE = 157, - BD3DRS_POINTSCALE_A = 158, - BD3DRS_POINTSCALE_B = 159, - BD3DRS_POINTSCALE_C = 160, - BD3DRS_MULTISAMPLEANTIALIAS = 161, - BD3DRS_MULTISAMPLEMASK = 162, - BD3DRS_PATCHEDGESTYLE = 163, - BD3DRS_DEBUGMONITORTOKEN = 165, - BD3DRS_POINTSIZE_MAX = 166, - BD3DRS_INDEXEDVERTEXBLENDENABLE = 167, - BD3DRS_COLORWRITEENABLE = 168, - BD3DRS_TWEENFACTOR = 170, - BD3DRS_BLENDOP = 171, - BD3DRS_POSITIONDEGREE = 172, - BD3DRS_NORMALDEGREE = 173, - BD3DRS_SCISSORTESTENABLE = 174, - BD3DRS_SLOPESCALEDEPTHBIAS = 175, - BD3DRS_ANTIALIASEDLINEENABLE = 176, - BD3DRS_MINTESSELLATIONLEVEL = 178, - BD3DRS_MAXTESSELLATIONLEVEL = 179, - BD3DRS_ADAPTIVETESS_X = 180, - BD3DRS_ADAPTIVETESS_Y = 181, - BD3DRS_ADAPTIVETESS_Z = 182, - BD3DRS_ADAPTIVETESS_W = 183, - BD3DRS_ENABLEADAPTIVETESSELLATION = 184, - BD3DRS_TWOSIDEDSTENCILMODE = 185, - BD3DRS_CCW_STENCILFAIL = 186, - BD3DRS_CCW_STENCILZFAIL = 187, - BD3DRS_CCW_STENCILPASS = 188, - BD3DRS_CCW_STENCILFUNC = 189, - BD3DRS_COLORWRITEENABLE1 = 190, - BD3DRS_COLORWRITEENABLE2 = 191, - BD3DRS_COLORWRITEENABLE3 = 192, - BD3DRS_BLENDFACTOR = 193, - BD3DRS_SRGBWRITEENABLE = 194, - BD3DRS_DEPTHBIAS = 195, - BD3DRS_WRAP8 = 198, - BD3DRS_WRAP9 = 199, - BD3DRS_WRAP10 = 200, - BD3DRS_WRAP11 = 201, - BD3DRS_WRAP12 = 202, - BD3DRS_WRAP13 = 203, - BD3DRS_WRAP14 = 204, - BD3DRS_WRAP15 = 205, - BD3DRS_SEPARATEALPHABLENDENABLE = 206, - BD3DRS_SRCBLENDALPHA = 207, - BD3DRS_DESTBLENDALPHA = 208, - BD3DRS_BLENDOPALPHA = 209, - - BD3DRS_MAX_TYPE - }; - - - - /*! Defines constants that describe depth-buffer formats - Members of this enumerated type are used with the D3DRS_ZENABLE render state. - */ - enum BD3DZBUFFERTYPE - { - BD3DZB_FALSE = 0, // Disable depth buffering - BD3DZB_TRUE = 1, // Enable z-buffering - BD3DZB_USEW = 2 //Enable w-buffering. - }; - - //! Defines the supported compare functions. - enum BD3DCMPFUNC - { - BD3DCMP_NEVER = 1,// Always fail the test. - BD3DCMP_LESS, // Accept the new pixel if its value is less than the value of the current pixel. - BD3DCMP_EQUAL, // Accept the new pixel if its value equals the value of the current pixel. - BD3DCMP_LESSEQUAL, // Accept the new pixel if its value is less than or equal to the value of the current pixel. - BD3DCMP_GREATER, // Accept the new pixel if its value is greater than the value of the current pixel. - BD3DCMP_NOTEQUAL, // Accept the new pixel if its value does not equal the value of the current pixel. - BD3DCMP_GREATEREQUAL,// Accept the new pixel if its value is greater than or equal to the value of the current pixel. - BD3DCMP_ALWAYS // Always pass the test. - }; - - enum BD3DMATERIALCOLORSOURCE - { - BD3DMCS_MATERIAL = 0, // Use the color from the current material. - BD3DMCS_COLOR1 = 1, // Use the diffuse vertex color. - BD3DMCS_COLOR2 = 2 // Use the specular vertex color. - }; - - - //! Defines constants that describe the supported shading modes. - enum BD3DSHADEMODE - { - /*! BD3DSHADE_FLAT - Flat shading mode. The color and specular component of the first vertex in the triangle - are used to determine the color and specular component of the face. These colors remain - constant across the triangle; that is, they are not interpolated. The specular alpha is - interpolated. - */ - BD3DSHADE_FLAT = 1, - - /*! BD3DSHADE_GOURAUD - Gouraud shading mode. The color and specular components of the face are determined by a - linear interpolation between all three of the triangle's vertices. - */ - BD3DSHADE_GOURAUD = 2, - - /*! BD3DSHADE_PHONG - Not supported. - */ - BD3DSHADE_PHONG = 3 - }; - - /*! Defines constants describing the fill mode - The values in this enumerated type are used by the BD3DRS_FILLMODE render state - */ - enum BD3DFILLMODE - { - BD3DFILL_POINT = 1, // Fill points. - BD3DFILL_WIREFRAME = 2, // Fill wireframes. - BD3DFILL_SOLID = 3 // Fill solids. - }; - - - - /*! Defines the supported culling modes. - The values in this enumerated type are used by the B3DRS_CULLMODE render state. - The culling modes define how back faces are culled when rendering a geometry. - */ - enum BD3DCULL - { - BD3DCULL_NONE = 1, // Do not cull back faces. - BD3DCULL_CW = 2, // Cull back faces with clockwise vertices. - BD3DCULL_CCW = 3 // Cull back faces with counterclockwise vertices. - }; - - struct SShaderParam - { - u32 ColorUnits; - u32 TextureUnits; - - u32 RenderState [ BD3DRS_MAX_TYPE ]; - void SetRenderState ( BD3DRENDERSTATETYPE state, u32 value ); - }; - - void SShaderParam::SetRenderState ( BD3DRENDERSTATETYPE state, u32 value ) - { - RenderState [ state ] = value; - } - - - -class CBurningShader_Raster_Reference : public IBurningShader -{ -public: - - //! constructor - CBurningShader_Raster_Reference(CBurningVideoDriver* driver); - - //! draws an indexed triangle list - virtual void drawTriangle ( const s4DVertex *a,const s4DVertex *b,const s4DVertex *c ) _IRR_OVERRIDE_; - - virtual void setMaterial ( const SBurningShaderMaterial &material ) _IRR_OVERRIDE_; - - -private: - void scanline (); - void scanline2 (); - - sScanLineData line; - sPixelShaderData pShader; - - void pShader_1 (); - void pShader_EMT_LIGHTMAP_M4 (); - - SShaderParam ShaderParam; - - REALINLINE u32 depthFunc (); - REALINLINE void depthWrite (); - - -}; - -//! constructor -CBurningShader_Raster_Reference::CBurningShader_Raster_Reference(CBurningVideoDriver* driver) -: IBurningShader(driver) -{ - #ifdef _DEBUG - setDebugName("CBurningShader_Raster_Reference"); - #endif -} - - -/*! -*/ -void CBurningShader_Raster_Reference::pShader_EMT_LIGHTMAP_M4 () -{ - tFixPoint r0, g0, b0; - tFixPoint r1, g1, b1; - - f32 inversew = fix_inverse32 ( line.w[0] ); - - getSample_texture ( r0, g0, b0, &IT[0], tofix ( line.t[0][0].x,inversew), tofix ( line.t[0][0].y,inversew) ); - getSample_texture ( r1, g1, b1, &IT[1], tofix ( line.t[1][0].x,inversew), tofix ( line.t[1][0].y,inversew) ); - - - pShader.dst[pShader.i] = fix_to_sample( clampfix_maxcolor ( imulFix_tex2 ( r0, r1 ) ), - clampfix_maxcolor ( imulFix_tex2 ( g0, g1 ) ), - clampfix_maxcolor ( imulFix_tex2 ( b0, b1 ) ) - ); - -} - -/*! -*/ -void CBurningShader_Raster_Reference::pShader_1 () -{ - tFixPoint r0, g0, b0; - tFixPoint tx0, ty0; - - const f32 inversew = fix_inverse32 ( line.w[0] ); - - tx0 = tofix ( line.t[0][0].x, inversew ); - ty0 = tofix ( line.t[0][0].y, inversew ); - - getSample_texture ( r0, g0, b0, &IT[0], tx0, ty0 ); - pShader.dst[pShader.i] = fix_to_sample( r0, g0, b0 ); - -} - - -/*! -*/ -void CBurningShader_Raster_Reference::setMaterial ( const SBurningShaderMaterial &material ) -{ - const video::SMaterial &m = material.org; - - u32 i; - u32 enable; - - ShaderParam.ColorUnits = 0; - ShaderParam.TextureUnits = 0; - for ( i = 0; i != BURNING_MATERIAL_MAX_TEXTURES; ++i ) - { - if ( m.getTexture( i ) ) - ShaderParam.TextureUnits = i; - } - - // shademode - ShaderParam.SetRenderState( BD3DRS_SHADEMODE, - m.GouraudShading ? BD3DSHADE_GOURAUD : BD3DSHADE_FLAT - ); - - // fillmode - ShaderParam.SetRenderState( BD3DRS_FILLMODE, - m.Wireframe ? BD3DFILL_WIREFRAME : m.PointCloud ? BD3DFILL_POINT : BD3DFILL_SOLID - ); - - // back face culling - ShaderParam.SetRenderState( BD3DRS_CULLMODE, - m.BackfaceCulling ? BD3DCULL_CCW : BD3DCULL_NONE - ); - - // lighting - ShaderParam.SetRenderState( BD3DRS_LIGHTING, m.Lighting ); - - // specular highlights - enable = F32_LOWER_EQUAL_0 ( m.Shininess ); - ShaderParam.SetRenderState( BD3DRS_SPECULARENABLE, enable); - ShaderParam.SetRenderState( BD3DRS_NORMALIZENORMALS, enable); - ShaderParam.SetRenderState( BD3DRS_SPECULARMATERIALSOURCE, (m.ColorMaterial==ECM_SPECULAR)?BD3DMCS_COLOR1:BD3DMCS_MATERIAL); - - // depth buffer enable and compare - ShaderParam.SetRenderState( BD3DRS_ZENABLE, (material.org.ZBuffer==video::ECFN_DISABLED) ? BD3DZB_FALSE : BD3DZB_USEW); - switch (material.org.ZBuffer) - { - case ECFN_NEVER: - ShaderParam.SetRenderState(BD3DRS_ZFUNC, BD3DCMP_NEVER); - break; - case ECFN_LESSEQUAL: - ShaderParam.SetRenderState(BD3DRS_ZFUNC, BD3DCMP_LESSEQUAL); - break; - case ECFN_EQUAL: - ShaderParam.SetRenderState(BD3DRS_ZFUNC, BD3DCMP_EQUAL); - break; - case ECFN_LESS: - ShaderParam.SetRenderState(BD3DRS_ZFUNC, BD3DCMP_LESSEQUAL); - break; - case ECFN_NOTEQUAL: - ShaderParam.SetRenderState(BD3DRS_ZFUNC, BD3DCMP_NOTEQUAL); - break; - case ECFN_GREATEREQUAL: - ShaderParam.SetRenderState(BD3DRS_ZFUNC, BD3DCMP_GREATEREQUAL); - break; - case ECFN_GREATER: - ShaderParam.SetRenderState(BD3DRS_ZFUNC, BD3DCMP_GREATER); - break; - case ECFN_ALWAYS: - ShaderParam.SetRenderState(BD3DRS_ZFUNC, BD3DCMP_ALWAYS); - break; - } - - // depth buffer write - ShaderParam.SetRenderState( BD3DRS_ZWRITEENABLE, m.ZWriteEnable != video::EZW_OFF ); -} - -/*! -*/ -REALINLINE u32 CBurningShader_Raster_Reference::depthFunc () -{ - if ( ShaderParam.RenderState [ BD3DRS_ZENABLE ] ) - { - switch ( ShaderParam.RenderState [ BD3DRS_ZFUNC ] ) - { - case BD3DCMP_LESSEQUAL: - return line.w[0] >= pShader.z[ pShader.i]; - case BD3DCMP_EQUAL: - return line.w[0] == pShader.z[ pShader.i]; - } - } - return 1; -} - -/*! -*/ -REALINLINE void CBurningShader_Raster_Reference::depthWrite () -{ - if ( ShaderParam.RenderState [ BD3DRS_ZWRITEENABLE ] ) - { - pShader.z[pShader.i] = line.w[0]; - } -} - -/*! -*/ -REALINLINE void CBurningShader_Raster_Reference::scanline2() -{ - // apply top-left fill-convention, left - pShader.xStart = fill_convention_left( line.x[0] ); - pShader.xEnd = fill_convention_right( line.x[1] ); - - pShader.dx = pShader.xEnd - pShader.xStart; - if ( pShader.dx < 0 ) - return; - - // slopes - const f32 invDeltaX = fill_step_x( line.x[1] - line.x[0] ); - const f32 subPixel = ( (f32) pShader.xStart ) - line.x[0]; - - // store slopes in endpoint, and correct first pixel - - line.w[0] += (line.w[1] = (line.w[1] - line.w[0]) * invDeltaX) * subPixel; - - u32 i; - -#if BURNING_MATERIAL_MAX_COLORS > 0 - for ( i = 0; i != ShaderParam.ColorUnits; ++i ) - { - line.c[i][1] = (line.c[i][1] - line.c[i][0]) * invDeltaX; - line.c[i][0] += line.c[i][1] * subPixel; - } -#endif - - for ( i = 0; i != ShaderParam.TextureUnits; ++i ) - { - line.t[i][1] = (line.t[i][1] - line.t[i][0]) * invDeltaX; - line.t[i][0] += line.t[i][1] * subPixel; - } - - SOFTWARE_DRIVER_2_CLIPCHECK_REF; - pShader.dst = (tVideoSample*) ( (u8*) RenderTarget->getData() + ( line.y * RenderTarget->getPitch() ) + ( pShader.xStart << SOFTWARE_DRIVER_2_RENDERTARGET_GRANULARITY) ); - pShader.z = (fp24*) ( (u8*) DepthBuffer->lock() + ( line.y * DepthBuffer->getPitch() ) + ( pShader.xStart << SOFTWARE_DRIVER_2_RENDERTARGET_GRANULARITY) ); - - for ( pShader.i = 0; pShader.i <= pShader.dx; ++pShader.i ) - { - if ( depthFunc() ) - { - depthWrite (); - } - - // advance next pixel - line.w[0] += line.w[1]; - -#if BURNING_MATERIAL_MAX_COLORS > 0 - for ( i = 0; i != ShaderParam.ColorUnits; ++i ) - { - line.c[i][0] += line.c[i][1]; - } -#endif - for ( i = 0; i != ShaderParam.TextureUnits; ++i ) - { - line.t[i][0] += line.t[i][1]; - } - } -} - - -/*! -*/ -REALINLINE void CBurningShader_Raster_Reference::scanline () -{ - u32 i; - - // apply top-left fill-convention, left - pShader.xStart = fill_convention_left( line.x[0] ); - pShader.xEnd = fill_convention_right( line.x[1] ); - - pShader.dx = pShader.xEnd - pShader.xStart; - if ( pShader.dx < 0 ) - return; - - // slopes - const f32 invDeltaX = fill_step_x( line.x[1] - line.x[0] ); - - // search z-buffer for first not occulled pixel - pShader.z = (fp24*) ( (u8*) DepthBuffer->lock() + ( line.y * DepthBuffer->getPitch() ) + ( pShader.xStart << SOFTWARE_DRIVER_2_RENDERTARGET_GRANULARITY) ); - - // subTexel - const f32 subPixel = ( (f32) pShader.xStart ) - line.x[0]; - - const f32 b = (line.w[1] - line.w[0]) * invDeltaX; - f32 a = line.w[0] + ( b * subPixel ); - - pShader.i = 0; - - if ( ShaderParam.RenderState [ BD3DRS_ZENABLE ] ) - { - u32 condition; - switch ( ShaderParam.RenderState [ BD3DRS_ZFUNC ] ) - { - case BD3DCMP_LESSEQUAL: - condition = a < pShader.z[pShader.i]; - break; - case BD3DCMP_EQUAL: - condition = a != pShader.z[pShader.i]; - break; - default: - condition = 0; - break; - } - while ( a < pShader.z[pShader.i] ) - { - a += b; - - pShader.i += 1; - if ( pShader.i > pShader.dx ) - return; - } - } - - // lazy setup rest of scanline - - line.w[0] = a; - line.w[1] = b; - - pShader.dst = (tVideoSample*) ( (u8*) RenderTarget->getData() + ( line.y * RenderTarget->getPitch() ) + ( pShader.xStart << SOFTWARE_DRIVER_2_RENDERTARGET_GRANULARITY) ); - - a = (f32) pShader.i + subPixel; - -#if BURNING_MATERIAL_MAX_COLORS > 0 - for ( i = 0; i != ShaderParam.ColorUnits; ++i ) - { - line.c[i][1] = (line.c[i][1] - line.c[i][0]) * invDeltaX; - line.c[i][0] += line.c[i][1] * a; - } -#endif - - for ( i = 0; i != ShaderParam.TextureUnits; ++i ) - { - line.t[i][1] = (line.t[i][1] - line.t[i][0]) * invDeltaX; - line.t[i][0] += line.t[i][1] * a; - } - - for ( ; pShader.i <= pShader.dx; ++pShader.i ) - { - if ( line.w[0] >= pShader.z[pShader.i] ) - { - pShader.z[pShader.i] = line.w[0]; - - pShader_EMT_LIGHTMAP_M4 (); - } - - line.w[0] += line.w[1]; - -#if BURNING_MATERIAL_MAX_COLORS > 0 - for ( i = 0; i != ShaderParam.ColorUnits; ++i ) - { - line.c[i][0] += line.c[i][1]; - } -#endif - for ( i = 0; i != ShaderParam.TextureUnits; ++i ) - { - line.t[i][0] += line.t[i][1]; - } - } - -} - - -void CBurningShader_Raster_Reference::drawTriangle(const s4DVertex* burning_restrict a, const s4DVertex* burning_restrict b, const s4DVertex* burning_restrict c) -{ - sScanConvertData scan; - u32 i; - - // sort on height, y - if ( F32_A_GREATER_B ( a->Pos.y , b->Pos.y ) ) swapVertexPointer(&a, &b); - if ( F32_A_GREATER_B ( b->Pos.y , c->Pos.y ) ) swapVertexPointer(&b, &c); - if ( F32_A_GREATER_B ( a->Pos.y , b->Pos.y ) ) swapVertexPointer(&a, &b); - - - // calculate delta y of the edges - scan.invDeltaY[0] = fill_step_y( c->Pos.y - a->Pos.y ); - scan.invDeltaY[1] = fill_step_y( b->Pos.y - a->Pos.y ); - scan.invDeltaY[2] = fill_step_y( c->Pos.y - b->Pos.y ); - - if ( F32_LOWER_EQUAL_0 ( scan.invDeltaY[0] ) ) - return; - - - // find if the major edge is left or right aligned - f32 temp[4]; - - temp[0] = a->Pos.x - c->Pos.x; - temp[1] = a->Pos.y - c->Pos.y; - temp[2] = b->Pos.x - a->Pos.x; - temp[3] = b->Pos.y - a->Pos.y; - - scan.left = ( temp[0] * temp[3] - temp[1] * temp[2] ) > (f32) 0.0 ? 0 : 1; - scan.right = 1 - scan.left; - - // calculate slopes for the major edge - scan.slopeX[0] = (c->Pos.x - a->Pos.x) * scan.invDeltaY[0]; - scan.x[0] = a->Pos.x; - - scan.slopeW[0] = (c->Pos.w - a->Pos.w) * scan.invDeltaY[0]; - scan.w[0] = a->Pos.w; - -#if BURNING_MATERIAL_MAX_COLORS > 0 - for ( i = 0; i != ShaderParam.ColorUnits; ++i ) - { - scan.c[i][0] = a->Color[i]; - scan.slopeC[i][0] = (c->Color[i] - a->Color[i]) * scan.invDeltaY[0]; - } -#endif - - for ( i = 0; i != ShaderParam.TextureUnits; ++i ) - { - scan.t[i][0] = a->Tex[i]; - scan.slopeT[i][0] = (c->Tex[i] - a->Tex[i]) * scan.invDeltaY[0]; - } - - // top left fill convention y run - s32 yStart; - s32 yEnd; - - f32 subPixel; - - // rasterize upper sub-triangle - if ( F32_GREATER_0 ( scan.invDeltaY[1] ) ) - { - // calculate slopes for top edge - scan.slopeX[1] = (b->Pos.x - a->Pos.x) * scan.invDeltaY[1]; - scan.x[1] = a->Pos.x; - - scan.slopeW[1] = (b->Pos.w - a->Pos.w) * scan.invDeltaY[1]; - scan.w[1] = a->Pos.w; - -#if BURNING_MATERIAL_MAX_COLORS > 0 - for ( i = 0; i != ShaderParam.ColorUnits; ++i ) - { - scan.c[i][1] = a->Color[i]; - scan.slopeC[i][1] = (b->Color[i] - a->Color[i]) * scan.invDeltaY[1]; - } -#endif - for ( i = 0; i != ShaderParam.TextureUnits; ++i ) - { - scan.t[i][1] = a->Tex[i]; - scan.slopeT[i][1] = (b->Tex[i] - a->Tex[i]) * scan.invDeltaY[1]; - } - - // apply top-left fill convention, top part - yStart = fill_convention_left( a->Pos.y ); - yEnd = fill_convention_right( b->Pos.y ); - - subPixel = ( (f32) yStart ) - a->Pos.y; - - // correct to pixel center - scan.x[0] += scan.slopeX[0] * subPixel; - scan.x[1] += scan.slopeX[1] * subPixel; - - scan.w[0] += scan.slopeW[0] * subPixel; - scan.w[1] += scan.slopeW[1] * subPixel; - -#if BURNING_MATERIAL_MAX_COLORS > 0 - for ( i = 0; i != ShaderParam.ColorUnits; ++i ) - { - scan.c[i][0] += scan.slopeC[i][0] * subPixel; - scan.c[i][1] += scan.slopeC[i][1] * subPixel; - } -#endif - for ( i = 0; i != ShaderParam.TextureUnits; ++i ) - { - scan.t[i][0] += scan.slopeT[i][0] * subPixel; - scan.t[i][1] += scan.slopeT[i][1] * subPixel; - } - - // rasterize the edge scanlines - for( line.y = yStart; line.y <= yEnd; line.y += SOFTWARE_DRIVER_2_STEP_Y) - { - line.x[scan.left] = scan.x[0]; - line.w[scan.left] = scan.w[0]; - - line.x[scan.right] = scan.x[1]; - line.w[scan.right] = scan.w[1]; - -#if BURNING_MATERIAL_MAX_COLORS > 0 - for ( i = 0; i != ShaderParam.ColorUnits; ++i ) - { - line.c[i][scan.left] = scan.c[i][0]; - line.c[i][scan.right] = scan.c[i][1]; - } -#endif - for ( i = 0; i != ShaderParam.TextureUnits; ++i ) - { - line.t[i][scan.left] = scan.t[i][0]; - line.t[i][scan.right] = scan.t[i][1]; - } - - // render a scanline - scanline (); - - scan.x[0] += scan.slopeX[0]; - scan.x[1] += scan.slopeX[1]; - - scan.w[0] += scan.slopeW[0]; - scan.w[1] += scan.slopeW[1]; - -#if BURNING_MATERIAL_MAX_COLORS > 0 - for ( i = 0; i != ShaderParam.ColorUnits; ++i ) - { - scan.c[i][0] += scan.slopeC[i][0]; - scan.c[i][1] += scan.slopeC[i][1]; - } -#endif - for ( i = 0; i != ShaderParam.TextureUnits; ++i ) - { - scan.t[i][0] += scan.slopeT[i][0]; - scan.t[i][1] += scan.slopeT[i][1]; - } - - } - } - - // rasterize lower sub-triangle - if ( F32_GREATER_0 ( scan.invDeltaY[2] ) ) - { - // advance to middle point - if ( F32_GREATER_0 ( scan.invDeltaY[1] ) ) - { - temp[0] = b->Pos.y - a->Pos.y; // dy - - scan.x[0] = a->Pos.x + scan.slopeX[0] * temp[0]; - scan.w[0] = a->Pos.w + scan.slopeW[0] * temp[0]; - -#if BURNING_MATERIAL_MAX_COLORS > 0 - for ( i = 0; i != ShaderParam.ColorUnits; ++i ) - { - scan.c[i][0] = a->Color[i] + scan.slopeC[i][0] * temp[0]; - } -#endif - for ( i = 0; i != ShaderParam.TextureUnits; ++i ) - { - scan.t[i][0] = a->Tex[i] + scan.slopeT[i][0] * temp[0]; - } - } - - // calculate slopes for bottom edge - scan.slopeX[1] = (c->Pos.x - b->Pos.x) * scan.invDeltaY[2]; - scan.x[1] = b->Pos.x; - - scan.slopeW[1] = (c->Pos.w - b->Pos.w) * scan.invDeltaY[2]; - scan.w[1] = b->Pos.w; - -#if BURNING_MATERIAL_MAX_COLORS > 0 - for ( i = 0; i != ShaderParam.ColorUnits; ++i ) - { - scan.c[i][1] = b->Color[i]; - scan.slopeC[i][1] = (c->Color[i] - b->Color[i]) * scan.invDeltaY[2]; - } -#endif - for ( i = 0; i != ShaderParam.TextureUnits; ++i ) - { - scan.t[i][1] = b->Tex[i]; - scan.slopeT[i][1] = (c->Tex[i] - b->Tex[i]) * scan.invDeltaY[2]; - } - - // apply top-left fill convention, top part - yStart = fill_convention_left( b->Pos.y ); - yEnd = fill_convention_right( c->Pos.y ); - - - subPixel = ( (f32) yStart ) - b->Pos.y; - - // correct to pixel center - scan.x[0] += scan.slopeX[0] * subPixel; - scan.x[1] += scan.slopeX[1] * subPixel; - - scan.w[0] += scan.slopeW[0] * subPixel; - scan.w[1] += scan.slopeW[1] * subPixel; - -#if BURNING_MATERIAL_MAX_COLORS > 0 - for ( i = 0; i != ShaderParam.ColorUnits; ++i ) - { - scan.c[i][0] += scan.slopeC[i][0] * subPixel; - scan.c[i][1] += scan.slopeC[i][1] * subPixel; - } -#endif - for ( i = 0; i != ShaderParam.TextureUnits; ++i ) - { - scan.t[i][0] += scan.slopeT[i][0] * subPixel; - scan.t[i][1] += scan.slopeT[i][1] * subPixel; - } - - // rasterize the edge scanlines - for( line.y = yStart; line.y <= yEnd; line.y += SOFTWARE_DRIVER_2_STEP_Y) - { - line.x[scan.left] = scan.x[0]; - line.w[scan.left] = scan.w[0]; - - line.x[scan.right] = scan.x[1]; - line.w[scan.right] = scan.w[1]; - -#if BURNING_MATERIAL_MAX_COLORS > 0 - for ( i = 0; i != ShaderParam.ColorUnits; ++i ) - { - line.c[i][scan.left] = scan.c[i][0]; - line.c[i][scan.right] = scan.c[i][1]; - } -#endif - for ( i = 0; i != ShaderParam.TextureUnits; ++i ) - { - line.t[i][scan.left] = scan.t[i][0]; - line.t[i][scan.right] = scan.t[i][1]; - } - - // render a scanline - scanline (); - - scan.x[0] += scan.slopeX[0]; - scan.x[1] += scan.slopeX[1]; - - scan.w[0] += scan.slopeW[0]; - scan.w[1] += scan.slopeW[1]; - -#if BURNING_MATERIAL_MAX_COLORS > 0 - for ( i = 0; i != ShaderParam.ColorUnits; ++i ) - { - scan.c[i][0] += scan.slopeC[i][0]; - scan.c[i][1] += scan.slopeC[i][1]; - } -#endif - for ( i = 0; i != ShaderParam.TextureUnits; ++i ) - { - scan.t[i][0] += scan.slopeT[i][0]; - scan.t[i][1] += scan.slopeT[i][1]; - } - } - } -} - - -} // end namespace video -} // end namespace irr - - -namespace irr -{ -namespace video -{ - - - -//! creates a flat triangle renderer -IBurningShader* createTriangleRendererReference(CBurningVideoDriver* driver) -{ - return new CBurningShader_Raster_Reference(driver); -} - - -} // end namespace video -} // end namespace irr - -#endif // _IRR_COMPILE_WITH_BURNINGSVIDEO_ - - diff --git a/source/Irrlicht/CCSMLoader.cpp b/source/Irrlicht/CCSMLoader.cpp deleted file mode 100644 index d560311c..00000000 --- a/source/Irrlicht/CCSMLoader.cpp +++ /dev/null @@ -1,859 +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 -// -// This file was written by Saurav Mohapatra and modified by Nikolaus Gebhardt. -// See CCSMLoader.h for details. - -#include "IrrCompileConfig.h" -#ifdef _IRR_COMPILE_WITH_CSM_LOADER_ - -#include "CCSMLoader.h" -#include "CMeshTextureLoader.h" -#include "os.h" -#include "IFileSystem.h" -#include "IReadFile.h" -#include "ISceneManager.h" -#include "IAttributes.h" -#include "SMesh.h" -#include "IVideoDriver.h" -#include "SAnimatedMesh.h" -#include "SMeshBufferLightMap.h" - -#ifdef _DEBUG -#define _IRR_DEBUG_CSM_LOADER_ -#endif - -namespace irr -{ -namespace scene -{ - // - // the CSM data types - // - struct color_rgb_t - { - s32 red; - s32 green; - s32 blue; - - color_rgb_t() : red(0), green(0), blue(0) {} - void clear() { red=0; green=0; blue=0; } - video::SColor toSColor() const { return video::SColor(255, red, green, blue); } - }; - - - // - // A Binary File Reader - // - struct BinaryFileReader - { - BinaryFileReader(io::IReadFile* pFile) : file(pFile) { } - - size_t readBuffer(void* buffer, s32 len) - { - return file->read(buffer,len); - } - - s32 readLong(); - f32 readFloat(); - - void readString(core::stringc &str); - void readVec3f(core::vector3df* v); - void readVec2f(core::vector2df* v); - void readColorRGB(color_rgb_t* color); - - io::IReadFile *file; - }; - - // - // The file header - // - class Header - { - public: - - enum E_CSM_VERSION - { - VERSION_4 = 4, - VERSION_4_1 = 5 - }; - - Header(){ clear(); } - - s32 getVersion() const { return version; } - void clear(){ version = 0; } - void load(BinaryFileReader* pReader) - { - version = pReader->readLong(); - } - - private: - - s32 version; - }; - - - // - // The groups - // - class Group - { - public: - - Group(){ clear(); } - ~Group(){ clear(); } - - void clear(); - void load(BinaryFileReader* pReader); - - s32 getFlags() const { return flags; } - s32 getParentGroupID() const { return parentGroup; } - const core::stringc& getProperties() const { return props; } - video::SColor getColor() const { return color.toSColor(); } - - private: - - s32 flags; - s32 parentGroup; - core::stringc props; - color_rgb_t color; - }; - - - // - // The visgroups - // - class VisGroup - { - public: - - VisGroup(){ clear(); } - ~VisGroup(){ clear(); } - void clear(); - void load(BinaryFileReader* pReader); - - s32 getFlags() const{ return flags; } - const core::stringc& getName() const{ return name; } - video::SColor getColor() const{ return color.toSColor(); } - - private: - - core::stringc name; - s32 flags; - color_rgb_t color; - }; - - - // - // Lightmaps - // - class LightMap - { - public: - - LightMap() : pixelData(0){ clear(); } - ~LightMap(){ clear(); } - void clear(); - void load(BinaryFileReader* pReader); - s32 getWidth() const{ return width; } - s32 getHeight() const{ return height; } - s32* getPixelData() const{ return pixelData; } - - private: - - s32 width; - s32 height; - s32* pixelData; - }; - - struct Triangle - { - s32 a,b,c; - }; - - - struct Line - { - s32 a,b; - }; - - - class Vertex - { - public: - - Vertex(){ clear(); } - ~Vertex(){ clear(); } - void clear(); - void load(BinaryFileReader* pReader); - - const core::vector3df& getPosition() const { return position; } - const core::vector3df& getNormal() const { return normal; } - video::SColor getColor() const { return color.toSColor(); } - const core::vector3df& getTextureCoordinates() const { return texCoords; } - const core::vector3df& getLightMapCoordinates() const { return lmapCoords; } - - private: - - core::vector3df position; - core::vector3df normal; - color_rgb_t color; - core::vector3df texCoords; - core::vector3df lmapCoords; - }; - - - class Surface - { - public: - - Surface() { clear(); } - ~Surface(){ clear(); } - - void clear(); - void load(BinaryFileReader *pReader); - - s32 getFlags() const{ return flags; } - const core::stringc& getTextureName() const{ return textureName; } - s32 getLightMapId() const{ return lightMapId; } - const core::vector2df* getUVOffset() const{ return &uvOffset; } - const core::vector2df* getUVScale() const{ return &uvScale; } - f32 getUVRotation() const{ return uvRotation; } - - u32 getVertexCount() const{ return vertices.size(); } - const Vertex& getVertexAt(const s32 index) const{ return vertices[index]; } - - u32 getTriangleCount() const{ return triangles.size(); } - const Triangle& getTriangleAt(const s32 index) const{ return triangles[index]; } - - private: - - s32 flags; - core::stringc textureName; - s32 lightMapId; - core::vector2df uvOffset; - core::vector2df uvScale; - f32 uvRotation; - core::array<Vertex> vertices; - core::array<Triangle> triangles; - core::array<Line> lines; - }; - - class Mesh - { - public: - - Mesh(){ clear(); } - ~Mesh(){ clear(); } - - void clear(); - void load(BinaryFileReader* pReader, bool bReadVisGroups); - - s32 getFlags() const { return flags; } - s32 getGroupID() const { return groupId; } - const core::stringc& getProperties() const { return props; } - video::SColor getColor() const { return color.toSColor(); } - const core::vector3df* getPosition() const { return &position; } - s32 getVisgroupID() const { return visgroupId; } - s32 getSurfaceCount() const { return surfaces.size(); } - const Surface* getSurfaceAt(const s32 index) const { return surfaces[index]; } - - private: - - s32 flags; - s32 groupId; - core::stringc props; - color_rgb_t color; - core::vector3df position; - s32 visgroupId; - - core::array<Surface*> surfaces; - }; - - class Entity - { - public: - - Entity() { clear(); } - ~Entity() { clear(); } - - void clear(); - void load(BinaryFileReader* pReader); - s32 getVisgroupID() const { return visgroupId; } - s32 getGroupID() const { return groupId; } - const core::stringc& getProperties() const { return props; } - const core::vector3df* getPosition() const { return &position; } - - private: - - s32 visgroupId; - s32 groupId; - core::stringc props; - core::vector3df position; - }; - - - class CameraData - { - public: - - CameraData(){ clear(); } - ~CameraData(){ clear(); } - - void clear(); - void load(BinaryFileReader* pReader); - - const core::vector3df* getPosition(){ return &position; } - f32 getPitch(){ return pitch; } - f32 getYaw(){ return yaw; } - - private: - - core::vector3df position; - f32 pitch; - f32 yaw; - }; - - // - // A CSM File - // - class CSMFile - { - public: - - CSMFile(){ clear(); } - ~CSMFile(){ clear(); } - void clear(); - void load(BinaryFileReader* pReader); - - const Header* getHeader() const{ return &header; } - - u32 getGroupCount() const{ return groups.size(); } - const Group* getGroupAt(const s32 index) const{ return groups[index]; } - - u32 getVisGroupCount() const{ return visgroups.size(); } - const VisGroup* getVisGroupAt(const s32 index) const{ return visgroups[index]; } - - u32 getLightMapCount() const{ return lightmaps.size(); } - const LightMap* getLightMapAt(const s32 index) const { return lightmaps[index]; } - - u32 getMeshCount() const{ return meshes.size(); } - const Mesh* getMeshAt(const s32 index) const{ return meshes[index]; } - - u32 getEntityCount() const{ return entities.size(); } - const Entity* getEntityAt(const s32 index) const{ return entities[index]; } - - const CameraData* getCameraData() const{ return &cameraData; } - - private: - - Header header; - core::array<Group*> groups; - core::array<VisGroup*> visgroups; - core::array<LightMap*> lightmaps; - core::array<Mesh*> meshes; - core::array<Entity*> entities; - CameraData cameraData; - }; - - CCSMLoader::CCSMLoader(scene::ISceneManager* manager, io::IFileSystem* fs) - : FileSystem(fs), SceneManager(manager) - { - #ifdef _DEBUG - setDebugName("CCSMLoader"); - #endif - - TextureLoader = new CMeshTextureLoader( FileSystem, SceneManager->getVideoDriver() ); - } - - - //! returns true if the file maybe is able to be loaded by this class - //! based on the file extension (e.g. ".bsp") - bool CCSMLoader::isALoadableFileExtension(const io::path& filename) const - { - return core::hasFileExtension ( filename, "csm" ); - } - - - //! creates/loads an animated mesh from the file. - IAnimatedMesh* CCSMLoader::createMesh(io::IReadFile* file) - { - if ( getMeshTextureLoader() ) - getMeshTextureLoader()->setMeshFile(file); - - scene::IMesh* m = createCSMMesh(file); - - if (!m) - return 0; - - SAnimatedMesh* am = new SAnimatedMesh(); - am->Type = EAMT_CSM; - am->addMesh(m); - m->drop(); - - am->recalculateBoundingBox(); - return am; - } - - scene::IMesh* CCSMLoader::createCSMMesh(io::IReadFile* file) - { - if (!file) - return 0; - - BinaryFileReader reader(file); - CSMFile csmFile; - csmFile.load(&reader); - - return createIrrlichtMesh(&csmFile, file->getFileName()); - } - - - scene::IMesh* CCSMLoader::createIrrlichtMesh(const CSMFile* csmFile, const io::path& lmprefix) - { - if ( getMeshTextureLoader() ) - { - if ( SceneManager->getParameters()->existsAttribute(CSM_TEXTURE_PATH) ) - getMeshTextureLoader()->setTexturePath( SceneManager->getParameters()->getAttributeAsString(CSM_TEXTURE_PATH) ); - } - - scene::SMesh *pMesh = new scene::SMesh(); - video::IVideoDriver* driver = SceneManager->getVideoDriver(); - - for(u32 l = 0; l<csmFile->getLightMapCount(); l++) - { - const LightMap* lmap = csmFile->getLightMapAt(l); - - io::path lmapName = lmprefix; - lmapName += "LMAP_"; - lmapName += io::path(l+1); - os::Printer::log("CCSMLoader loading light map", lmapName.c_str()); - - video::IImage* lmapImg = driver->createImageFromData( - video::ECF_A8R8G8B8, - core::dimension2d<u32>(lmap->getWidth(),lmap->getHeight()), - lmap->getPixelData()); - - driver->addTexture(lmapName.c_str(), lmapImg); - lmapImg->drop(); - } - - for(u32 m = 0; m<csmFile->getMeshCount(); m++) - { - const Mesh* mshPtr = csmFile->getMeshAt(m); - - for(s32 s = 0; s < mshPtr->getSurfaceCount(); s++) - { - const Surface* surface = mshPtr->getSurfaceAt(s); - - video::ITexture* texture = getMeshTextureLoader() ? getMeshTextureLoader()->getTexture(surface->getTextureName()) : NULL; - - // same lightmap name as above where they are created - io::path lmapName = lmprefix; - lmapName += "LMAP_"; - lmapName += io::path(surface->getLightMapId()); - - scene::SMeshBufferLightMap *buffer = new scene::SMeshBufferLightMap(); - buffer->Material.setTexture(0, texture); - if (surface->getLightMapId()) - { - buffer->Material.setTexture(1, driver->getTexture(lmapName)); - buffer->Material.Lighting = false; - buffer->Material.MaterialType = video::EMT_LIGHTMAP_ADD; - } - - buffer->Vertices.reallocate(surface->getVertexCount()); - for(u32 v = 0; v < surface->getVertexCount(); ++v) - { - const Vertex& vtxPtr = surface->getVertexAt(v); - video::S3DVertex2TCoords vtx; - vtx.Pos = vtxPtr.getPosition(); - vtx.Normal = vtxPtr.getPosition(); - vtx.Color=vtxPtr.getColor(); - vtx.TCoords.set(vtxPtr.getTextureCoordinates().X, 1.f-vtxPtr.getTextureCoordinates().Y); - vtx.TCoords2.set(vtxPtr.getLightMapCoordinates().X, 1.f-vtxPtr.getLightMapCoordinates().Y); - - buffer->Vertices.push_back(vtx); - } - - buffer->Indices.reallocate(surface->getTriangleCount()*3); - for(u32 t = 0; t < surface->getTriangleCount(); ++t) - { - const Triangle& tri = surface->getTriangleAt(t); - buffer->Indices.push_back(tri.c); - buffer->Indices.push_back(tri.b); - buffer->Indices.push_back(tri.a); - } - - buffer->recalculateBoundingBox(); - pMesh->addMeshBuffer(buffer); - buffer->drop(); - } - } - - pMesh->recalculateBoundingBox(); - return pMesh; - } - - void Group::clear() - { - color.clear(); - flags = 0; - parentGroup = 0; - props = ""; - } - - void Group::load(BinaryFileReader* pReader) - { - flags = pReader->readLong(); - parentGroup = pReader->readLong(); - pReader->readString(props); - pReader->readColorRGB(&color); - } - - void VisGroup::clear() - { - color.clear(); - flags = 0; - name = ""; - } - - void VisGroup::load(BinaryFileReader* pReader) - { - pReader->readString(name); - flags = pReader->readLong(); - pReader->readColorRGB(&color); - } - - void LightMap::clear() - { - delete[] pixelData; - pixelData = 0; - width = height = 0; - } - - void LightMap::load(BinaryFileReader* pReader) - { - width = pReader->readLong(); - height = pReader->readLong(); - pixelData = new s32[width * height]; - pReader->readBuffer(pixelData, width * height * sizeof(s32)); - } - - void Mesh::clear() - { - flags = 0; - groupId = 0; - visgroupId = 0; - props = ""; - color.clear(); - position.set(0,0,0); - - for(u32 s = 0; s < surfaces.size(); s++) - { - delete surfaces[s]; - } - surfaces.clear(); - } - - void Mesh::load(BinaryFileReader* pReader, bool bReadVisGroups) - { - flags = pReader->readLong(); - groupId = pReader->readLong(); - pReader->readString(props); - pReader->readColorRGB(&color); - pReader->readVec3f(&position); - if(bReadVisGroups) - visgroupId = pReader->readLong(); - else - visgroupId = 0; - - s32 count = pReader->readLong(); - - for(s32 i = 0; i < count; i++) - { - Surface* surf = new Surface(); - surf->load(pReader); - surfaces.push_back(surf); - } - } - - void Surface::clear() - { - flags = 0; - lightMapId = 0; - textureName = ""; - uvOffset.set(0.0f,0.0f); - uvScale.set(0.0f,0.0f); - uvRotation = 0.0f; - triangles.clear(); - lines.clear(); - vertices.clear(); - } - - void Surface::load(BinaryFileReader* pReader) - { - flags = pReader->readLong(); - pReader->readString(textureName); - textureName.replace('\\', '/'); - - lightMapId = pReader->readLong(); - pReader->readVec2f(&uvOffset); - pReader->readVec2f(&uvScale); - uvRotation = pReader->readFloat(); - s32 vtxCount = pReader->readLong(); - s32 triCount = pReader->readLong(); - s32 lineCount = pReader->readLong(); - - for(s32 v = 0; v < vtxCount; v++) - { - vertices.push_back(Vertex()); - vertices.getLast().load(pReader); - } - - for(s32 t = 0; t < triCount; t++) - { - Triangle tri; - pReader->readBuffer(&tri, sizeof(tri)); - triangles.push_back(tri); - } - - for(s32 l = 0; l < lineCount; l++) - { - Line line; - pReader->readBuffer(&line,sizeof(line)); - lines.push_back(line); - - } - - } - - void Vertex::clear() - { - position.set(0,0,0); - normal.set(0,0,0); - color.clear(); - texCoords.set(0,0,0); - lmapCoords.set(0,0,0); - } - - void Vertex::load(BinaryFileReader* pReader) - { - pReader->readVec3f(&position); - pReader->readVec3f(&normal); - pReader->readColorRGB(&color); - pReader->readVec3f(&texCoords); - pReader->readVec3f(&lmapCoords); - } - - void Entity::clear() - { - visgroupId = groupId = 0; - props = ""; - position.set(0,0,0); - } - - void Entity::load(BinaryFileReader* pReader) - { - visgroupId = pReader->readLong(); - groupId = pReader->readLong(); - pReader->readString(props); - pReader->readVec3f(&position); - } - - void CameraData::clear() - { - position.set(0,0,0); - pitch = 0; - yaw = 0; - } - - void CameraData::load(BinaryFileReader* pReader) - { - pReader->readVec3f(&position); - pitch = pReader->readFloat(); - yaw = pReader->readFloat(); - } - - void CSMFile::clear() - { - header.clear(); - cameraData.clear(); - - u32 x =0; - for( x= 0; x < groups.size(); x++) - delete groups[x]; - - groups.clear(); - - for(x= 0; x < visgroups.size(); x++) - delete visgroups[x]; - - visgroups.clear(); - - for(x= 0; x < lightmaps.size(); x++) - delete lightmaps[x]; - - lightmaps.clear(); - - for(x= 0; x < meshes.size(); x++) - delete meshes[x]; - - meshes.clear(); - - for(x= 0; x < entities.size(); x++) - delete entities[x]; - - entities.clear(); - } - - void CSMFile::load(BinaryFileReader* pReader) - { - clear(); - - header.load(pReader); - - //groups - { - const s32 count = pReader->readLong(); -#ifdef _IRR_DEBUG_CSM_LOADER_ - os::Printer::log("CSM Version", core::stringc(header.getVersion()).c_str()); - os::Printer::log("Loading groups. Count", core::stringc(count)); -#endif - - groups.reallocate(count); - for (s32 i = 0; i < count; i++) - { - Group* grp = new Group(); - grp->load(pReader); - groups.push_back(grp); - } - } - const bool bHasVGroups = (header.getVersion() == Header::VERSION_4_1); - - if (bHasVGroups) - { - //visgroups - const s32 count = pReader->readLong(); -#ifdef _IRR_DEBUG_CSM_LOADER_ - os::Printer::log("Loading visgroups. Count", core::stringc(count)); -#endif - - visgroups.reallocate(count); - for (s32 i = 0; i < count; i++) - { - VisGroup* grp = new VisGroup(); - grp->load(pReader); - visgroups.push_back(grp); - } - } - - //lightmaps - { - const s32 count = pReader->readLong(); -#ifdef _IRR_DEBUG_CSM_LOADER_ - os::Printer::log("Loading lightmaps. Count", core::stringc(count)); -#endif - - lightmaps.reallocate(count); - for(s32 i = 0; i < count; i++) - { - LightMap* lm = new LightMap(); - lm->load(pReader); - lightmaps.push_back(lm); - } - } - - //meshes - { - const s32 count = pReader->readLong(); -#ifdef _IRR_DEBUG_CSM_LOADER_ - os::Printer::log("Loading meshes. Count", core::stringc(count)); -#endif - - meshes.reallocate(count); - for(s32 i = 0; i < count; i++) - { - Mesh* mesh = new Mesh(); - mesh->load(pReader,bHasVGroups); - meshes.push_back(mesh); - } - } - - //entities - { - const s32 count = pReader->readLong(); -#ifdef _IRR_DEBUG_CSM_LOADER_ - os::Printer::log("Loading entitites. Count", core::stringc(count)); -#endif - - entities.reallocate(count); - for(s32 i = 0; i < count; i++) - { - Entity* ent = new Entity(); - ent->load(pReader); - entities.push_back(ent); - } - } - - //camera data -#ifdef _IRR_DEBUG_CSM_LOADER_ - os::Printer::log("Loading camera data."); -#endif - cameraData.load(pReader); - } - - s32 BinaryFileReader::readLong() - { - int ret = 0; - readBuffer(&ret,sizeof(int)); -#ifdef __BIG_ENDIAN__ - ret = os::Byteswap::byteswap(ret); -#endif - return ret; - } - - f32 BinaryFileReader::readFloat() - { - float ret = 0; - readBuffer(&ret,sizeof(float)); -#ifdef __BIG_ENDIAN__ - ret = os::Byteswap::byteswap(ret); -#endif - return ret; - } - - void BinaryFileReader::readString(core::stringc &str) - { - str = ""; - c8 c; - readBuffer(&c,sizeof(char)); - while(c != 0) - { - str += c; - readBuffer(&c,sizeof(char)); - } - } - - void BinaryFileReader::readVec3f(core::vector3df* v) - { - v->X = readFloat(); - v->Y = readFloat(); - v->Z = readFloat(); - } - - void BinaryFileReader::readVec2f(core::vector2df* v) - { - v->X = readFloat(); - v->Y = readFloat(); - } - - void BinaryFileReader::readColorRGB(color_rgb_t* color) - { - readBuffer(color,sizeof(color_rgb_t)); - } - -} // end namespace -} // end namespace - -#endif // _IRR_COMPILE_WITH_CSM_LOADER_ diff --git a/source/Irrlicht/CCSMLoader.h b/source/Irrlicht/CCSMLoader.h deleted file mode 100644 index ed5fbda2..00000000 --- a/source/Irrlicht/CCSMLoader.h +++ /dev/null @@ -1,81 +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 -// -// This Loader has been originally written by Saurav Mohapatra. I (Nikolaus Gebhardt) -// modified some minor things and integrated it into Irrlicht 0.9. Thanks a lot -// to Saurav Mohapatra for his work on this and that he gave me his permission to -// add it into Irrlicht. -// I did some changes to Saurav Mohapatra's loader, so I'm writing this down here: -// - Replaced all dependencies to STL and stdio with irr:: methods/constructs. -// - Moved everything into namespace irr::scene -// - Replaced logging with Irrlicht's internal logger. -// - Removed dependency to IrrlichtDevice -// - Moved all internal structures into CCSMLoader.cpp -// - Made the texture root parameter dependent on a ISceneManager string parameter -// - removed exceptions -// - Implemented CCCSMLoader as IMeshLoader -// - Fixed some problems with memory leaks -// - Fixed bounding box calculation -// -// The original readme of this file looks like this: -// -// This component provides a loader for the Cartography shop 4.x .csm maps for Irrlicht Engine. -// This is a part of the M_TRIX Project. -// This is licensed under the ZLib/LibPNG license -// The IrrCSM library is written by Saurav Mohapatra. -// -// Features -// -// The IrrCSM library features the following capabilities -// -// * Loads the .csm 4.0 and 4.1 files transparently -// * Presents the loaded file as irr::scene::IAnimatedMesh for easy creation of IOctreeSceneNode -// * Loads the textures given the correct texture root. hence map and textures can be in separate directories -// -// For more information go to http://www.geocities.com/standard_template/irrcsm/downloads.html - -#ifndef __CSM_LOADER_H_INCLUDED__ -#define __CSM_LOADER_H_INCLUDED__ - -#include "irrArray.h" -#include "IMesh.h" -#include "irrString.h" -#include "IFileSystem.h" -#include "IMeshLoader.h" - -namespace irr -{ -namespace scene -{ - class CSMFile; - class ISceneManager; - - class CCSMLoader : public scene::IMeshLoader - { - public: - - CCSMLoader(ISceneManager* manager, io::IFileSystem* fs); - - //! returns true if the file maybe is able to be loaded by this class - //! based on the file extension (e.g. ".bsp") - virtual bool isALoadableFileExtension(const io::path& filename) const _IRR_OVERRIDE_; - - //! creates/loads an animated mesh from the file. - virtual IAnimatedMesh* createMesh(io::IReadFile* file) _IRR_OVERRIDE_; - - private: - - scene::IMesh* createCSMMesh(io::IReadFile* file); - - scene::IMesh* createIrrlichtMesh(const CSMFile* csmFile, const io::path& lmprefix); - - io::IFileSystem* FileSystem; - scene::ISceneManager* SceneManager; - }; - -} // end namespace -} // end namespace - -#endif - diff --git a/source/Irrlicht/CCameraSceneNode.cpp b/source/Irrlicht/CCameraSceneNode.cpp index e0b68fc7..8592dcc3 100644 --- a/source/Irrlicht/CCameraSceneNode.cpp +++ b/source/Irrlicht/CCameraSceneNode.cpp @@ -110,18 +110,7 @@ const core::matrix4& CCameraSceneNode::getViewMatrixAffector() const //! for changing their position, look at target or whatever. bool CCameraSceneNode::OnEvent(const SEvent& event) { - if (!InputReceiverEnabled) - return false; - - // send events to event receiving animators - - ISceneNodeAnimatorList::Iterator ait = Animators.begin(); - - for (; ait != Animators.end(); ++ait) - if ((*ait)->isEventReceiverEnabled() && (*ait)->OnEvent(event)) - return true; - - // if nobody processed the event, return false + // animators have been deleted; nothing happens here now! return false; } @@ -289,9 +278,6 @@ void CCameraSceneNode::updateMatrices() //! returns the axis aligned bounding box of this node const core::aabbox3d<f32>& CCameraSceneNode::getBoundingBox() const { - // NOTE: We deliberately don't return the boundingbox of the ViewArea. People can access that already. - // We want to prevent cameras from having their bounding box colliding in the SceneCollisionManager. - // If another boundingbox is ever necessary then please move BoundingBox to ICameraSceneNode and make it accessible (via a setter or an enum with options). return BoundingBox; } diff --git a/source/Irrlicht/CCubeSceneNode.cpp b/source/Irrlicht/CCubeSceneNode.cpp deleted file mode 100644 index 0400c116..00000000 --- a/source/Irrlicht/CCubeSceneNode.cpp +++ /dev/null @@ -1,246 +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_CUBE_SCENENODE_ -#include "CCubeSceneNode.h" -#include "IVideoDriver.h" -#include "ISceneManager.h" -#include "S3DVertex.h" -#include "SMeshBuffer.h" -#include "os.h" -#ifdef _IRR_COMPILE_WITH_SHADOW_VOLUME_SCENENODE_ -#include "CShadowVolumeSceneNode.h" -#else -#include "IShadowVolumeSceneNode.h" -#endif // _IRR_COMPILE_WITH_SHADOW_VOLUME_SCENENODE_ - -namespace irr -{ -namespace scene -{ - - /* - 011 111 - /6,8------/5 y - / | / | ^ z - / | / | | / - 010 3,9-------2 | |/ - | 7- - -10,4 101 *---->x - | / | / - |/ | / - 0------11,1/ - 000 100 - */ - -//! constructor -CCubeSceneNode::CCubeSceneNode(f32 size, ISceneNode* parent, ISceneManager* mgr, - s32 id, const core::vector3df& position, - const core::vector3df& rotation, const core::vector3df& scale) - : IMeshSceneNode(parent, mgr, id, position, rotation, scale), - Mesh(0), Shadow(0), Size(size) -{ - #ifdef _DEBUG - setDebugName("CCubeSceneNode"); - #endif - - setSize(); -} - - -CCubeSceneNode::~CCubeSceneNode() -{ - if (Shadow) - Shadow->drop(); - if (Mesh) - Mesh->drop(); -} - - -void CCubeSceneNode::setSize() -{ - if (Mesh) - Mesh->drop(); - Mesh = SceneManager->getGeometryCreator()->createCubeMesh(core::vector3df(Size)); -} - - -//! renders the node. -void CCubeSceneNode::render() -{ - video::IVideoDriver* driver = SceneManager->getVideoDriver(); - driver->setTransform(video::ETS_WORLD, AbsoluteTransformation); - - if (Shadow) - Shadow->updateShadowVolumes(); - - // for debug purposes only: - video::SMaterial mat = Mesh->getMeshBuffer(0)->getMaterial(); - - // overwrite half transparency - if (DebugDataVisible & scene::EDS_HALF_TRANSPARENCY) - mat.MaterialType = video::EMT_TRANSPARENT_ADD_COLOR; - driver->setMaterial(mat); - driver->drawMeshBuffer(Mesh->getMeshBuffer(0)); - - // for debug purposes only: - if (DebugDataVisible) - { - video::SMaterial m; - m.Lighting = false; - m.AntiAliasing=0; - driver->setMaterial(m); - - if (DebugDataVisible & scene::EDS_BBOX) - { - driver->draw3DBox(Mesh->getMeshBuffer(0)->getBoundingBox(), video::SColor(255,255,255,255)); - } - if (DebugDataVisible & scene::EDS_BBOX_BUFFERS) - { - driver->draw3DBox(Mesh->getMeshBuffer(0)->getBoundingBox(), - video::SColor(255,190,128,128)); - } - if (DebugDataVisible & scene::EDS_NORMALS) - { - // draw normals - const f32 debugNormalLength = SceneManager->getParameters()->getAttributeAsFloat(DEBUG_NORMAL_LENGTH); - const video::SColor debugNormalColor = SceneManager->getParameters()->getAttributeAsColor(DEBUG_NORMAL_COLOR); - const u32 count = Mesh->getMeshBufferCount(); - - for (u32 i=0; i != count; ++i) - { - driver->drawMeshBufferNormals(Mesh->getMeshBuffer(i), debugNormalLength, debugNormalColor); - } - } - - // show mesh - if (DebugDataVisible & scene::EDS_MESH_WIRE_OVERLAY) - { - m.Wireframe = true; - driver->setMaterial(m); - - driver->drawMeshBuffer(Mesh->getMeshBuffer(0)); - } - } -} - - -//! returns the axis aligned bounding box of this node -const core::aabbox3d<f32>& CCubeSceneNode::getBoundingBox() const -{ - return Mesh->getMeshBuffer(0)->getBoundingBox(); -} - - -//! Removes a child from this scene node. -//! Implemented here, to be able to remove the shadow properly, if there is one, -//! or to remove attached childs. -bool CCubeSceneNode::removeChild(ISceneNode* child) -{ - if (child && Shadow == child) - { - Shadow->drop(); - Shadow = 0; - } - - return ISceneNode::removeChild(child); -} - - -//! Creates shadow volume scene node as child of this node -//! and returns a pointer to it. -IShadowVolumeSceneNode* CCubeSceneNode::addShadowVolumeSceneNode( - const IMesh* shadowMesh, s32 id, bool zfailmethod, f32 infinity) -{ -#ifdef _IRR_COMPILE_WITH_SHADOW_VOLUME_SCENENODE_ - if (!SceneManager->getVideoDriver()->queryFeature(video::EVDF_STENCIL_BUFFER)) - return 0; - - if (!shadowMesh) - shadowMesh = Mesh; // if null is given, use the mesh of node - - if (Shadow) - Shadow->drop(); - - Shadow = new CShadowVolumeSceneNode(shadowMesh, this, SceneManager, id, zfailmethod, infinity); - return Shadow; -#else - return 0; -#endif -} - - -void CCubeSceneNode::OnRegisterSceneNode() -{ - if (IsVisible) - SceneManager->registerNodeForRendering(this); - ISceneNode::OnRegisterSceneNode(); -} - - -//! returns the material based on the zero based index i. -video::SMaterial& CCubeSceneNode::getMaterial(u32 i) -{ - return Mesh->getMeshBuffer(0)->getMaterial(); -} - - -//! returns amount of materials used by this scene node. -u32 CCubeSceneNode::getMaterialCount() const -{ - return 1; -} - - -//! Writes attributes of the scene node. -void CCubeSceneNode::serializeAttributes(io::IAttributes* out, io::SAttributeReadWriteOptions* options) const -{ - ISceneNode::serializeAttributes(out, options); - - out->addFloat("Size", Size); -} - - -//! Reads attributes of the scene node. -void CCubeSceneNode::deserializeAttributes(io::IAttributes* in, io::SAttributeReadWriteOptions* options) -{ - f32 newSize = in->getAttributeAsFloat("Size"); - newSize = core::max_(newSize, 0.0001f); - if (newSize != Size) - { - Size = newSize; - setSize(); - } - - ISceneNode::deserializeAttributes(in, options); -} - - -//! Creates a clone of this scene node and its children. -ISceneNode* CCubeSceneNode::clone(ISceneNode* newParent, ISceneManager* newManager) -{ - if (!newParent) - newParent = Parent; - if (!newManager) - newManager = SceneManager; - - CCubeSceneNode* nb = new CCubeSceneNode(Size, newParent, - newManager, ID, RelativeTranslation); - - nb->cloneMembers(this, newManager); - nb->getMaterial(0) = getMaterial(0); - nb->Shadow = Shadow; - if ( nb->Shadow ) - nb->Shadow->grab(); - - if ( newParent ) - nb->drop(); - return nb; -} - - -} // end namespace scene -} // end namespace irr - -#endif // _IRR_COMPILE_WITH_CUBE_SCENENODE_ diff --git a/source/Irrlicht/CCubeSceneNode.h b/source/Irrlicht/CCubeSceneNode.h deleted file mode 100644 index f8ad068f..00000000 --- a/source/Irrlicht/CCubeSceneNode.h +++ /dev/null @@ -1,93 +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_CUBE_SCENE_NODE_H_INCLUDED__ -#define __C_CUBE_SCENE_NODE_H_INCLUDED__ - -#include "IMeshSceneNode.h" -#include "SMesh.h" - -namespace irr -{ -namespace scene -{ - class CCubeSceneNode : public IMeshSceneNode - { - public: - - //! constructor - CCubeSceneNode(f32 size, ISceneNode* parent, ISceneManager* mgr, s32 id, - const core::vector3df& position = core::vector3df(0,0,0), - const core::vector3df& rotation = core::vector3df(0,0,0), - const core::vector3df& scale = core::vector3df(1.0f, 1.0f, 1.0f)); - - virtual ~CCubeSceneNode(); - - virtual void OnRegisterSceneNode() _IRR_OVERRIDE_; - - //! renders the node. - virtual void render() _IRR_OVERRIDE_; - - //! returns the axis aligned bounding box of this node - virtual const core::aabbox3d<f32>& getBoundingBox() const _IRR_OVERRIDE_; - - //! returns the material based on the zero based index i. To get the amount - //! of materials used by this scene node, use getMaterialCount(). - //! This function is needed for inserting the node into the scene hierarchy on a - //! optimal position for minimizing renderstate changes, but can also be used - //! to directly modify the material of a scene node. - virtual video::SMaterial& getMaterial(u32 i) _IRR_OVERRIDE_; - - //! returns amount of materials used by this scene node. - virtual u32 getMaterialCount() const _IRR_OVERRIDE_; - - //! Returns type of the scene node - virtual ESCENE_NODE_TYPE getType() const _IRR_OVERRIDE_ { return ESNT_CUBE; } - - //! Creates shadow volume scene node as child of this node - //! and returns a pointer to it. - virtual IShadowVolumeSceneNode* addShadowVolumeSceneNode(const IMesh* shadowMesh, - s32 id, bool zfailmethod=true, f32 infinity=10000.0f) _IRR_OVERRIDE_; - - //! Writes attributes of the scene node. - virtual void serializeAttributes(io::IAttributes* out, io::SAttributeReadWriteOptions* options=0) const _IRR_OVERRIDE_; - - //! Reads attributes of the scene node. - virtual void deserializeAttributes(io::IAttributes* in, io::SAttributeReadWriteOptions* options=0) _IRR_OVERRIDE_; - - //! Creates a clone of this scene node and its children. - virtual ISceneNode* clone(ISceneNode* newParent=0, ISceneManager* newManager=0) _IRR_OVERRIDE_; - - //! Sets a new mesh to display - virtual void setMesh(IMesh* mesh) _IRR_OVERRIDE_ {} - - //! Returns the current mesh - virtual IMesh* getMesh(void) _IRR_OVERRIDE_ { return Mesh; } - - //! Sets if the scene node should not copy the materials of the mesh but use them in a read only style. - /* In this way it is possible to change the materials a mesh causing all mesh scene nodes - referencing this mesh to change too. */ - virtual void setReadOnlyMaterials(bool readonly) _IRR_OVERRIDE_ {} - - //! Returns if the scene node should not copy the materials of the mesh but use them in a read only style - virtual bool isReadOnlyMaterials() const _IRR_OVERRIDE_ { return false; } - - //! Removes a child from this scene node. - //! Implemented here, to be able to remove the shadow properly, if there is one, - //! or to remove attached child. - virtual bool removeChild(ISceneNode* child) _IRR_OVERRIDE_; - - private: - void setSize(); - - IMesh* Mesh; - IShadowVolumeSceneNode* Shadow; - f32 Size; - }; - -} // end namespace scene -} // end namespace irr - -#endif - diff --git a/source/Irrlicht/CD3D9Driver.cpp b/source/Irrlicht/CD3D9Driver.cpp deleted file mode 100644 index 629baa40..00000000 --- a/source/Irrlicht/CD3D9Driver.cpp +++ /dev/null @@ -1,3826 +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 - -#define _IRR_DONT_DO_MEMORY_DEBUGGING_HERE -#include "CD3D9Driver.h" - -#ifdef _IRR_COMPILE_WITH_DIRECT3D_9_ - -#include "os.h" -#include "S3DVertex.h" -#include "CD3D9Texture.h" -#include "CD3D9RenderTarget.h" -#include "CD3D9MaterialRenderer.h" -#include "CD3D9ShaderMaterialRenderer.h" -#include "CD3D9NormalMapRenderer.h" -#include "CD3D9ParallaxMapRenderer.h" -#include "CD3D9HLSLMaterialRenderer.h" -#include "SIrrCreationParameters.h" - -namespace irr -{ -namespace video -{ - -namespace -{ - inline DWORD F2DW( FLOAT f ) { return *((DWORD*)&f); } -} - -//! constructor -CD3D9Driver::CD3D9Driver(const SIrrlichtCreationParameters& params, io::IFileSystem* io) - : CNullDriver(io, params.WindowSize), BridgeCalls(0), CurrentRenderMode(ERM_NONE), - ResetRenderStates(true), Transformation3DChanged(false), - D3DLibrary(0), pID3D(0), pID3DDevice(0), BackBufferSurface(0), - DepthStencilSurface(0), WindowId(0), SceneSourceRect(0), - LastVertexType((video::E_VERTEX_TYPE)-1), VendorID(0), - MaxTextureUnits(0), MaxFixedPipelineTextureUnits(0), MaxUserClipPlanes(0), - MaxLightDistance(0.f), LastSetLight(-1), - ColorFormat(ECF_A8R8G8B8), DeviceLost(false), - DriverWasReset(true), OcclusionQuerySupport(false), - AlphaToCoverageSupport(false), Params(params) -{ - #ifdef _DEBUG - setDebugName("CD3D9Driver"); - #endif - - printVersion(); - - for (u32 i=0; i<MATERIAL_MAX_TEXTURES; ++i) - { - CurrentTexture[i] = 0; - LastTextureMipMapsAvailable[i] = false; - } - MaxLightDistance = sqrtf(FLT_MAX); - // create sphere map matrix - - SphereMapMatrixD3D9._11 = 0.5f; SphereMapMatrixD3D9._12 = 0.0f; - SphereMapMatrixD3D9._13 = 0.0f; SphereMapMatrixD3D9._14 = 0.0f; - SphereMapMatrixD3D9._21 = 0.0f; SphereMapMatrixD3D9._22 =-0.5f; - SphereMapMatrixD3D9._23 = 0.0f; SphereMapMatrixD3D9._24 = 0.0f; - SphereMapMatrixD3D9._31 = 0.0f; SphereMapMatrixD3D9._32 = 0.0f; - SphereMapMatrixD3D9._33 = 1.0f; SphereMapMatrixD3D9._34 = 0.0f; - SphereMapMatrixD3D9._41 = 0.5f; SphereMapMatrixD3D9._42 = 0.5f; - SphereMapMatrixD3D9._43 = 0.0f; SphereMapMatrixD3D9._44 = 1.0f; - - core::matrix4 mat; - UnitMatrixD3D9 = *(D3DMATRIX*)((void*)mat.pointer()); - - // init direct 3d is done in the factory function -} - - -//! destructor -CD3D9Driver::~CD3D9Driver() -{ - deleteMaterialRenders(); - deleteAllTextures(); - removeAllOcclusionQueries(); - removeAllHardwareBuffers(); - - if (DepthStencilSurface) - DepthStencilSurface->Release(); - - delete BridgeCalls; - - // drop d3d9 - - if (pID3DDevice) - pID3DDevice->Release(); - - if (pID3D) - pID3D->Release(); -} - - -void CD3D9Driver::createMaterialRenderers() -{ - // create D3D9 material renderers - - addAndDropMaterialRenderer(new CD3D9MaterialRenderer_SOLID(pID3DDevice, this)); - addAndDropMaterialRenderer(new CD3D9MaterialRenderer_SOLID_2_LAYER(pID3DDevice, this)); - - // add the same renderer for all lightmap types - - CD3D9MaterialRenderer_LIGHTMAP* lmr = new CD3D9MaterialRenderer_LIGHTMAP(pID3DDevice, this); - addMaterialRenderer(lmr); // for EMT_LIGHTMAP: - addMaterialRenderer(lmr); // for EMT_LIGHTMAP_ADD: - addMaterialRenderer(lmr); // for EMT_LIGHTMAP_M2: - addMaterialRenderer(lmr); // for EMT_LIGHTMAP_M4: - addMaterialRenderer(lmr); // for EMT_LIGHTMAP_LIGHTING: - addMaterialRenderer(lmr); // for EMT_LIGHTMAP_LIGHTING_M2: - addMaterialRenderer(lmr); // for EMT_LIGHTMAP_LIGHTING_M4: - lmr->drop(); - - // add remaining fixed function pipeline material renderers - - addAndDropMaterialRenderer(new CD3D9MaterialRenderer_DETAIL_MAP(pID3DDevice, this)); - addAndDropMaterialRenderer(new CD3D9MaterialRenderer_SPHERE_MAP(pID3DDevice, this)); - addAndDropMaterialRenderer(new CD3D9MaterialRenderer_REFLECTION_2_LAYER(pID3DDevice, this)); - addAndDropMaterialRenderer(new CD3D9MaterialRenderer_TRANSPARENT_ADD_COLOR(pID3DDevice, this)); - addAndDropMaterialRenderer(new CD3D9MaterialRenderer_TRANSPARENT_ALPHA_CHANNEL(pID3DDevice, this)); - addAndDropMaterialRenderer(new CD3D9MaterialRenderer_TRANSPARENT_ALPHA_CHANNEL_REF(pID3DDevice, this)); - addAndDropMaterialRenderer(new CD3D9MaterialRenderer_TRANSPARENT_VERTEX_ALPHA(pID3DDevice, this)); - addAndDropMaterialRenderer(new CD3D9MaterialRenderer_TRANSPARENT_REFLECTION_2_LAYER(pID3DDevice, this)); - - // add normal map renderers - - s32 tmp = 0; - video::IMaterialRenderer* renderer = 0; - - renderer = new CD3D9NormalMapRenderer(pID3DDevice, this, tmp, - MaterialRenderers[EMT_SOLID].Renderer); - renderer->drop(); - - renderer = new CD3D9NormalMapRenderer(pID3DDevice, this, tmp, - MaterialRenderers[EMT_TRANSPARENT_ADD_COLOR].Renderer); - renderer->drop(); - - renderer = new CD3D9NormalMapRenderer(pID3DDevice, this, tmp, - MaterialRenderers[EMT_TRANSPARENT_VERTEX_ALPHA].Renderer); - renderer->drop(); - - // add parallax map renderers - - renderer = new CD3D9ParallaxMapRenderer(pID3DDevice, this, tmp, - MaterialRenderers[EMT_SOLID].Renderer); - renderer->drop(); - - renderer = new CD3D9ParallaxMapRenderer(pID3DDevice, this, tmp, - MaterialRenderers[EMT_TRANSPARENT_ADD_COLOR].Renderer); - renderer->drop(); - - renderer = new CD3D9ParallaxMapRenderer(pID3DDevice, this, tmp, - MaterialRenderers[EMT_TRANSPARENT_VERTEX_ALPHA].Renderer); - renderer->drop(); - - // add basic 1 texture blending - addAndDropMaterialRenderer(new CD3D9MaterialRenderer_ONETEXTURE_BLEND(pID3DDevice, this)); -} - - -//! initialises the Direct3D API -bool CD3D9Driver::initDriver(HWND hwnd, bool pureSoftware) -{ - if (!pID3D) - { - D3DLibrary = LoadLibrary( __TEXT("d3d9.dll") ); - - if (!D3DLibrary) - { - os::Printer::log("Error, could not load d3d9.dll.", ELL_ERROR); - return false; - } - - typedef IDirect3D9 * (__stdcall *D3DCREATETYPE)(UINT); - D3DCREATETYPE d3dCreate = (D3DCREATETYPE) GetProcAddress(D3DLibrary, "Direct3DCreate9"); - - if (!d3dCreate) - { - os::Printer::log("Error, could not get proc adress of Direct3DCreate9.", ELL_ERROR); - return false; - } - - //just like pID3D = Direct3DCreate9(D3D_SDK_VERSION); - pID3D = (*d3dCreate)(D3D_SDK_VERSION); - - if (!pID3D) - { - os::Printer::log("Error initializing D3D.", ELL_ERROR); - return false; - } - } - - // print device information - D3DADAPTER_IDENTIFIER9 dai; - if (!FAILED(pID3D->GetAdapterIdentifier(Params.DisplayAdapter, 0, &dai))) - { - char tmp[512]; - - s32 Product = HIWORD(dai.DriverVersion.HighPart); - s32 Version = LOWORD(dai.DriverVersion.HighPart); - s32 SubVersion = HIWORD(dai.DriverVersion.LowPart); - s32 Build = LOWORD(dai.DriverVersion.LowPart); - - sprintf(tmp, "%s %s %d.%d.%d.%d", dai.Description, dai.Driver, Product, Version, - SubVersion, Build); - os::Printer::log(tmp, ELL_INFORMATION); - - // Assign vendor name based on vendor id. - VendorID= static_cast<u16>(dai.VendorId); - switch(dai.VendorId) - { - case 0x1002 : VendorName = "ATI Technologies Inc."; break; - case 0x10DE : VendorName = "NVIDIA Corporation"; break; - case 0x102B : VendorName = "Matrox Electronic Systems Ltd."; break; - case 0x121A : VendorName = "3dfx Interactive Inc"; break; - case 0x5333 : VendorName = "S3 Graphics Co., Ltd."; break; - case 0x8086 : VendorName = "Intel Corporation"; break; - default: VendorName = "Unknown VendorId: ";VendorName += (u32)dai.VendorId; break; - } - } - - D3DDISPLAYMODE d3ddm; - if (FAILED(pID3D->GetAdapterDisplayMode(Params.DisplayAdapter, &d3ddm))) - { - os::Printer::log("Error: Could not get Adapter Display mode.", ELL_ERROR); - return false; - } - - ZeroMemory(&present, sizeof(present)); - - present.BackBufferCount = 1; - present.EnableAutoDepthStencil = TRUE; - if (Params.Vsync) - present.PresentationInterval = D3DPRESENT_INTERVAL_ONE; - else - present.PresentationInterval = D3DPRESENT_INTERVAL_IMMEDIATE; - - if (Params.Fullscreen) - { - present.BackBufferWidth = Params.WindowSize.Width; - present.BackBufferHeight = Params.WindowSize.Height; - // request 32bit mode if user specified 32 bit, added by Thomas Stuefe - if (Params.Bits == 32) - present.BackBufferFormat = D3DFMT_X8R8G8B8; - else - present.BackBufferFormat = D3DFMT_R5G6B5; - present.SwapEffect = D3DSWAPEFFECT_FLIP; - present.Windowed = FALSE; - present.FullScreen_RefreshRateInHz = D3DPRESENT_RATE_DEFAULT; - } - else - { - present.BackBufferFormat = d3ddm.Format; - present.SwapEffect = D3DSWAPEFFECT_DISCARD; - present.Windowed = TRUE; - } - - UINT adapter = Params.DisplayAdapter; - D3DDEVTYPE devtype = D3DDEVTYPE_HAL; - #ifndef _IRR_D3D_NO_SHADER_DEBUGGING - devtype = D3DDEVTYPE_REF; - #elif defined(_IRR_USE_NVIDIA_PERFHUD_) - for (UINT adapter_i = 0; adapter_i < pID3D->GetAdapterCount(); ++adapter_i) - { - D3DADAPTER_IDENTIFIER9 identifier; - pID3D->GetAdapterIdentifier(adapter_i,0,&identifier); - if (strstr(identifier.Description,"PerfHUD") != 0) - { - adapter = adapter_i; - devtype = D3DDEVTYPE_REF; - break; - } - } - #endif - - // enable anti alias if possible and desired - if (Params.AntiAlias > 0) - { - if (Params.AntiAlias > 32) - Params.AntiAlias = 32; - - DWORD qualityLevels = 0; - - while(Params.AntiAlias > 0) - { - if(SUCCEEDED(pID3D->CheckDeviceMultiSampleType(adapter, - devtype, present.BackBufferFormat, !Params.Fullscreen, - (D3DMULTISAMPLE_TYPE)Params.AntiAlias, &qualityLevels))) - { - present.MultiSampleType = (D3DMULTISAMPLE_TYPE)Params.AntiAlias; - present.MultiSampleQuality = qualityLevels-1; - present.SwapEffect = D3DSWAPEFFECT_DISCARD; - break; - } - --Params.AntiAlias; - } - - if (Params.AntiAlias==0) - { - os::Printer::log("Anti aliasing disabled because hardware/driver lacks necessary caps.", ELL_WARNING); - } - } - - // check stencil buffer compatibility - if (Params.Stencilbuffer) - { - present.AutoDepthStencilFormat = D3DFMT_D24S8; - if(FAILED(pID3D->CheckDeviceFormat(adapter, devtype, - present.BackBufferFormat, D3DUSAGE_DEPTHSTENCIL, - D3DRTYPE_SURFACE, present.AutoDepthStencilFormat))) - { - present.AutoDepthStencilFormat = D3DFMT_D24X4S4; - if(FAILED(pID3D->CheckDeviceFormat(adapter, devtype, - present.BackBufferFormat, D3DUSAGE_DEPTHSTENCIL, - D3DRTYPE_SURFACE, present.AutoDepthStencilFormat))) - { - present.AutoDepthStencilFormat = D3DFMT_D15S1; - if(FAILED(pID3D->CheckDeviceFormat(adapter, devtype, - present.BackBufferFormat, D3DUSAGE_DEPTHSTENCIL, - D3DRTYPE_SURFACE, present.AutoDepthStencilFormat))) - { - os::Printer::log("Device does not support stencilbuffer, disabling stencil buffer.", ELL_WARNING); - Params.Stencilbuffer = false; - } - } - } - else - if(FAILED(pID3D->CheckDepthStencilMatch(adapter, devtype, - present.BackBufferFormat, present.BackBufferFormat, present.AutoDepthStencilFormat))) - { - os::Printer::log("Depth-stencil format is not compatible with display format, disabling stencil buffer.", ELL_WARNING); - Params.Stencilbuffer = false; - } - } - // do not use else here to cope with flag change in previous block - if (!Params.Stencilbuffer) - { - present.AutoDepthStencilFormat = D3DFMT_D32; - if(FAILED(pID3D->CheckDeviceFormat(adapter, devtype, - present.BackBufferFormat, D3DUSAGE_DEPTHSTENCIL, - D3DRTYPE_SURFACE, present.AutoDepthStencilFormat))) - { - present.AutoDepthStencilFormat = D3DFMT_D24X8; - if(FAILED(pID3D->CheckDeviceFormat(adapter, devtype, - present.BackBufferFormat, D3DUSAGE_DEPTHSTENCIL, - D3DRTYPE_SURFACE, present.AutoDepthStencilFormat))) - { - present.AutoDepthStencilFormat = D3DFMT_D16; - if(FAILED(pID3D->CheckDeviceFormat(adapter, devtype, - present.BackBufferFormat, D3DUSAGE_DEPTHSTENCIL, - D3DRTYPE_SURFACE, present.AutoDepthStencilFormat))) - { - os::Printer::log("Device does not support required depth buffer.", ELL_WARNING); - return false; - } - } - } - } - - // create device - - DWORD fpuPrecision = Params.HighPrecisionFPU ? D3DCREATE_FPU_PRESERVE : 0; - DWORD multithreaded = Params.DriverMultithreaded ? D3DCREATE_MULTITHREADED : 0; - if (pureSoftware) - { - if (FAILED(pID3D->CreateDevice(Params.DisplayAdapter, D3DDEVTYPE_REF, hwnd, - fpuPrecision | D3DCREATE_SOFTWARE_VERTEXPROCESSING, &present, &pID3DDevice))) - os::Printer::log("Was not able to create Direct3D9 software device.", ELL_ERROR); - } - else - { - HRESULT hr = pID3D->CreateDevice(adapter, devtype, hwnd, - fpuPrecision | multithreaded | D3DCREATE_HARDWARE_VERTEXPROCESSING, &present, &pID3DDevice); - - if(FAILED(hr)) - hr = pID3D->CreateDevice(adapter, devtype, hwnd, - fpuPrecision | multithreaded | D3DCREATE_MIXED_VERTEXPROCESSING , &present, &pID3DDevice); - - if(FAILED(hr)) - hr = pID3D->CreateDevice(adapter, devtype, hwnd, - fpuPrecision | multithreaded | D3DCREATE_SOFTWARE_VERTEXPROCESSING, &present, &pID3DDevice); - - if (FAILED(hr)) - os::Printer::log("Was not able to create Direct3D9 device.", ELL_ERROR); - } - - if (!pID3DDevice) - { - os::Printer::log("Was not able to create DIRECT3D9 device.", ELL_ERROR); - return false; - } - - // get caps - pID3DDevice->GetDeviceCaps(&Caps); - - os::Printer::log("Currently available Video Memory (kB)", core::stringc(pID3DDevice->GetAvailableTextureMem()/1024).c_str()); - - // disable stencilbuffer if necessary - if (Params.Stencilbuffer && - (!(Caps.StencilCaps & D3DSTENCILCAPS_DECRSAT) || - !(Caps.StencilCaps & D3DSTENCILCAPS_INCRSAT) || - !(Caps.StencilCaps & D3DSTENCILCAPS_KEEP))) - { - os::Printer::log("Device not able to use stencil buffer, disabling stencil buffer.", ELL_WARNING); - Params.Stencilbuffer = false; - } - - if (!BridgeCalls) - BridgeCalls = new CD3D9CallBridge(pID3DDevice, this); - - // set default vertex shader - setVertexShader(EVT_STANDARD); - - // set fog mode - setFog(FogColor, FogType, FogStart, FogEnd, FogDensity, PixelFog, RangeFog); - - // set exposed data - ExposedData.D3D9.D3D9 = pID3D; - ExposedData.D3D9.D3DDev9 = pID3DDevice; - ExposedData.D3D9.HWnd = hwnd; - - ResetRenderStates = true; - - // create materials - createMaterialRenderers(); - - MaxFixedPipelineTextureUnits = (u32)Caps.MaxSimultaneousTextures; - DriverAttributes->setAttribute("MaxSupportedTextures", (s32)MaxFixedPipelineTextureUnits); - - u32 maxTextureSamplers = (Caps.PixelShaderVersion >= D3DPS_VERSION(2, 0)) ? 16 : (Caps.PixelShaderVersion >= D3DPS_VERSION(1, 4)) ? - 6 : (Caps.PixelShaderVersion >= D3DPS_VERSION(1, 0)) ? 4 : 0; - - MaxTextureUnits = core::max_(MaxFixedPipelineTextureUnits, maxTextureSamplers); - MaxTextureUnits = core::min_(MaxTextureUnits, MATERIAL_MAX_TEXTURES); - MaxTextureUnits = core::min_(MaxTextureUnits, MATERIAL_MAX_TEXTURES_USED); - - MaxUserClipPlanes = (u32)Caps.MaxUserClipPlanes; - OcclusionQuerySupport=(pID3DDevice->CreateQuery(D3DQUERYTYPE_OCCLUSION, NULL) == S_OK); - - if (VendorID==0x10DE)//NVidia - AlphaToCoverageSupport = (pID3D->CheckDeviceFormat(adapter, D3DDEVTYPE_HAL, - D3DFMT_X8R8G8B8, 0,D3DRTYPE_SURFACE, - (D3DFORMAT)MAKEFOURCC('A', 'T', 'O', 'C')) == S_OK); - else if (VendorID==0x1002)//ATI - AlphaToCoverageSupport = true; // TODO: Check unknown -#if 0 - AlphaToCoverageSupport = (pID3D->CheckDeviceFormat(adapter, D3DDEVTYPE_HAL, - D3DFMT_X8R8G8B8, 0,D3DRTYPE_SURFACE, - (D3DFORMAT)MAKEFOURCC('A','2','M','1')) == S_OK); -#endif - - DriverAttributes->setAttribute("MaxTextures", (s32)MaxTextureUnits); - DriverAttributes->setAttribute("MaxLights", (s32)Caps.MaxActiveLights); - DriverAttributes->setAttribute("MaxAnisotropy", (s32)Caps.MaxAnisotropy); - DriverAttributes->setAttribute("MaxUserClipPlanes", (s32)Caps.MaxUserClipPlanes); - DriverAttributes->setAttribute("MaxMultipleRenderTargets", (s32)Caps.NumSimultaneousRTs); - DriverAttributes->setAttribute("MaxIndices", (s32)Caps.MaxVertexIndex); - DriverAttributes->setAttribute("MaxTextureSize", (s32)core::min_(Caps.MaxTextureHeight,Caps.MaxTextureWidth)); - DriverAttributes->setAttribute("MaxTextureLODBias", 16); - DriverAttributes->setAttribute("Version", 901); - DriverAttributes->setAttribute("ShaderLanguageVersion", (s32)(((0x00ff00 & Caps.VertexShaderVersion)>>8)*100 + (Caps.VertexShaderVersion&0xff))); - DriverAttributes->setAttribute("AntiAlias", Params.AntiAlias); - - // set the renderstates - setRenderStates3DMode(); - - // store the screen's depth buffer descriptor - if (!SUCCEEDED(pID3DDevice->GetDepthStencilSurface(&DepthStencilSurface))) - { - os::Printer::log("Was not able to get main depth buffer.", ELL_ERROR); - return false; - } - - D3DColorFormat = D3DFMT_A8R8G8B8; - IDirect3DSurface9* bb = 0; - if (SUCCEEDED(pID3DDevice->GetBackBuffer(0, 0, D3DBACKBUFFER_TYPE_MONO, &bb))) - { - D3DSURFACE_DESC desc; - bb->GetDesc(&desc); - D3DColorFormat = desc.Format; - - if (D3DColorFormat == D3DFMT_X8R8G8B8) - D3DColorFormat = D3DFMT_A8R8G8B8; - - bb->Release(); - } - ColorFormat = getColorFormatFromD3DFormat(D3DColorFormat); - - ActiveRenderTarget.set_used((u32)Caps.NumSimultaneousRTs); - - for (u32 i = 0; i < ActiveRenderTarget.size(); ++i) - ActiveRenderTarget[i] = false; - - // so far so good. - return true; -} - -bool CD3D9Driver::beginScene(u16 clearFlag, SColor clearColor, f32 clearDepth, u8 clearStencil, const SExposedVideoData& videoData, core::rect<s32>* sourceRect) -{ - CNullDriver::beginScene(clearFlag, clearColor, clearDepth, clearStencil, videoData, sourceRect); - WindowId = (HWND)videoData.D3D9.HWnd; - SceneSourceRect = sourceRect; - - if (!pID3DDevice) - return false; - - HRESULT hr; - if (DeviceLost) - { - if ( !retrieveDevice(1) ) - return false; - } - - clearBuffers(clearFlag, clearColor, clearDepth, clearStencil); - - hr = pID3DDevice->BeginScene(); - if (FAILED(hr)) - { - os::Printer::log("DIRECT3D9 begin scene failed.", ELL_WARNING); - return false; - } - - return true; -} - -bool CD3D9Driver::endScene() -{ - CNullDriver::endScene(); - DriverWasReset=false; - - HRESULT hr = pID3DDevice->EndScene(); - if (FAILED(hr)) - { - os::Printer::log("DIRECT3D9 end scene failed.", ELL_WARNING); - return false; - } - - RECT* srcRct = 0; - RECT sourceRectData; - if ( SceneSourceRect ) - { - srcRct = &sourceRectData; - sourceRectData.left = SceneSourceRect->UpperLeftCorner.X; - sourceRectData.top = SceneSourceRect->UpperLeftCorner.Y; - sourceRectData.right = SceneSourceRect->LowerRightCorner.X; - sourceRectData.bottom = SceneSourceRect->LowerRightCorner.Y; - } - - IDirect3DSwapChain9* swChain; - hr = pID3DDevice->GetSwapChain(0, &swChain); - DWORD flags = (Params.HandleSRGB && (Caps.Caps3&D3DCAPS3_LINEAR_TO_SRGB_PRESENTATION))?D3DPRESENT_LINEAR_CONTENT:0; - hr = swChain->Present(srcRct, NULL, WindowId, NULL, flags); - swChain->Release(); - - if (SUCCEEDED(hr)) - return true; - - if (hr == D3DERR_DEVICELOST) - { - DeviceLost = true; - os::Printer::log("Present failed", "DIRECT3D9 device lost.", ELL_WARNING); - } -#ifdef D3DERR_DEVICEREMOVED - else if (hr == D3DERR_DEVICEREMOVED) - { - os::Printer::log("Present failed", "Device removed.", ELL_WARNING); - } -#endif - else if (hr == D3DERR_INVALIDCALL) - { - os::Printer::log("Present failed", "Invalid Call", ELL_WARNING); - } - else - os::Printer::log("DIRECT3D9 present failed.", ELL_WARNING); - return false; -} - - -//! queries the features of the driver, returns true if feature is available -bool CD3D9Driver::queryFeature(E_VIDEO_DRIVER_FEATURE feature) const -{ - if (!FeatureEnabled[feature]) - return false; - - switch (feature) - { - case EVDF_MULTITEXTURE: - case EVDF_BILINEAR_FILTER: - return true; - case EVDF_RENDER_TO_TARGET: - return Caps.NumSimultaneousRTs > 0; - case EVDF_HARDWARE_TL: - return (Caps.DevCaps & D3DDEVCAPS_HWTRANSFORMANDLIGHT) != 0; - case EVDF_MIP_MAP: - return (Caps.TextureCaps & D3DPTEXTURECAPS_MIPMAP) != 0; - case EVDF_MIP_MAP_AUTO_UPDATE: - return (Caps.Caps2 & D3DCAPS2_CANAUTOGENMIPMAP) != 0; - case EVDF_STENCIL_BUFFER: - return Params.Stencilbuffer && Caps.StencilCaps; - case EVDF_VERTEX_SHADER_1_1: - return Caps.VertexShaderVersion >= D3DVS_VERSION(1,1); - case EVDF_VERTEX_SHADER_2_0: - return Caps.VertexShaderVersion >= D3DVS_VERSION(2,0); - case EVDF_VERTEX_SHADER_3_0: - return Caps.VertexShaderVersion >= D3DVS_VERSION(3,0); - case EVDF_PIXEL_SHADER_1_1: - return Caps.PixelShaderVersion >= D3DPS_VERSION(1,1); - case EVDF_PIXEL_SHADER_1_2: - return Caps.PixelShaderVersion >= D3DPS_VERSION(1,2); - case EVDF_PIXEL_SHADER_1_3: - return Caps.PixelShaderVersion >= D3DPS_VERSION(1,3); - case EVDF_PIXEL_SHADER_1_4: - return Caps.PixelShaderVersion >= D3DPS_VERSION(1,4); - case EVDF_PIXEL_SHADER_2_0: - return Caps.PixelShaderVersion >= D3DPS_VERSION(2,0); - case EVDF_PIXEL_SHADER_3_0: - return Caps.PixelShaderVersion >= D3DPS_VERSION(3,0); - case EVDF_HLSL: - return Caps.VertexShaderVersion >= D3DVS_VERSION(1,1); - case EVDF_TEXTURE_NSQUARE: - return (Caps.TextureCaps & D3DPTEXTURECAPS_SQUAREONLY) == 0; - case EVDF_TEXTURE_NPOT: - return (Caps.TextureCaps & D3DPTEXTURECAPS_POW2) == 0; - case EVDF_COLOR_MASK: - return (Caps.PrimitiveMiscCaps & D3DPMISCCAPS_COLORWRITEENABLE) != 0; - case EVDF_MULTIPLE_RENDER_TARGETS: - return Caps.NumSimultaneousRTs > 1; - case EVDF_MRT_COLOR_MASK: - return (Caps.PrimitiveMiscCaps & D3DPMISCCAPS_INDEPENDENTWRITEMASKS) != 0; - case EVDF_MRT_BLEND: - return (Caps.PrimitiveMiscCaps & D3DPMISCCAPS_MRTPOSTPIXELSHADERBLENDING) != 0; - case EVDF_OCCLUSION_QUERY: - return OcclusionQuerySupport; - case EVDF_POLYGON_OFFSET: - return (Caps.RasterCaps & (D3DPRASTERCAPS_DEPTHBIAS|D3DPRASTERCAPS_SLOPESCALEDEPTHBIAS)) != 0; - case EVDF_BLEND_OPERATIONS: - return true; - case EVDF_BLEND_SEPARATE: - return (Caps.PrimitiveMiscCaps & D3DPMISCCAPS_SEPARATEALPHABLEND) != 0; - case EVDF_TEXTURE_MATRIX: - return true; - case EVDF_TEXTURE_COMPRESSED_DXT: - return true; - case EVDF_TEXTURE_CUBEMAP: - return true; - default: - return false; - }; -} - - -//! sets transformation -void CD3D9Driver::setTransform(E_TRANSFORMATION_STATE state, const core::matrix4& mat) -{ - Transformation3DChanged = true; - - switch(state) - { - case ETS_VIEW: - pID3DDevice->SetTransform(D3DTS_VIEW, (D3DMATRIX*)((void*)mat.pointer())); - break; - case ETS_WORLD: - pID3DDevice->SetTransform(D3DTS_WORLD, (D3DMATRIX*)((void*)mat.pointer())); - break; - case ETS_PROJECTION: - pID3DDevice->SetTransform( D3DTS_PROJECTION, (D3DMATRIX*)((void*)mat.pointer())); - break; - case ETS_COUNT: - return; - default: - { - const s32 stage = state - ETS_TEXTURE_0; - - if ( stage < static_cast<s32>(MaxTextureUnits) - && stage < static_cast<s32>(MaxFixedPipelineTextureUnits)) // texture transforms for shader pipeline have to be passed by user - { - if (mat.isIdentity()) - pID3DDevice->SetTextureStageState(stage, D3DTSS_TEXTURETRANSFORMFLAGS, D3DTTFF_DISABLE); - else - { - pID3DDevice->SetTextureStageState(stage, D3DTSS_TEXTURETRANSFORMFLAGS, D3DTTFF_COUNT2); - pID3DDevice->SetTransform((D3DTRANSFORMSTATETYPE)(D3DTS_TEXTURE0 + stage), (D3DMATRIX*)((void*)mat.pointer())); - } - } - } - break; - } - - Matrices[state] = mat; -} - - -//! sets the current Texture -bool CD3D9Driver::setActiveTexture(u32 stage, const video::ITexture* texture) -{ - if (CurrentTexture[stage] == texture) - return true; - - if (texture && texture->getDriverType() != EDT_DIRECT3D9) - { - os::Printer::log("Fatal Error: Tried to set a texture not owned by this driver.", ELL_ERROR); - return false; - } - - CurrentTexture[stage] = texture; - - if (!texture) - { - pID3DDevice->SetTexture(stage, 0); - pID3DDevice->SetTextureStageState( stage, D3DTSS_TEXTURETRANSFORMFLAGS, D3DTTFF_DISABLE ); - } - else - { - pID3DDevice->SetTexture(stage, ((const CD3D9Texture*)texture)->getDX9BaseTexture()); - - if (stage <= 4) - pID3DDevice->SetTexture(D3DVERTEXTEXTURESAMPLER0 + stage, ((const CD3D9Texture*)texture)->getDX9BaseTexture()); - } - return true; -} - - -//! sets a material -void CD3D9Driver::setMaterial(const SMaterial& material) -{ - Material = material; - OverrideMaterial.apply(Material); - - for (u32 i=0; i<MaxTextureUnits; ++i) - { - const ITexture* texture = Material.getTexture(i); - setActiveTexture(i, texture); - if ( texture ) - { - setTransform((E_TRANSFORMATION_STATE) ( ETS_TEXTURE_0 + i ), - material.getTextureMatrix(i)); - } - } -} - -ITexture* CD3D9Driver::createDeviceDependentTexture(const io::path& name, IImage* image) -{ - core::array<IImage*> imageArray(1); - imageArray.push_back(image); - - CD3D9Texture* texture = new CD3D9Texture(name, imageArray, ETT_2D, this); - if ( !texture->getDX9Texture() ) - { - texture->drop(); - return 0; - } - - return texture; -} - -ITexture* CD3D9Driver::createDeviceDependentTextureCubemap(const io::path& name, const core::array<IImage*>& image) -{ - CD3D9Texture* texture = new CD3D9Texture(name, image, ETT_CUBEMAP, this); - - if ( !texture->getDX9CubeTexture() ) - { - texture->drop(); - return 0; - } - - return texture; -} - -bool CD3D9Driver::setRenderTargetEx(IRenderTarget* target, u16 clearFlag, SColor clearColor, f32 clearDepth, u8 clearStencil) -{ - if (target && target->getDriverType() != EDT_DIRECT3D9) - { - os::Printer::log("Fatal Error: Tried to set a render target not owned by this driver.", ELL_ERROR); - return false; - } - - if (target) - { - // Store main render target. - - if (!BackBufferSurface) - { - if (FAILED(pID3DDevice->GetRenderTarget(0, &BackBufferSurface))) - { - os::Printer::log("Could not get main render target.", ELL_ERROR); - return false; - } - } - - // Set new color textures. - - CD3D9RenderTarget* renderTarget = static_cast<CD3D9RenderTarget*>(target); - - const u32 surfaceSize = core::min_(renderTarget->getSurfaceCount(), ActiveRenderTarget.size()); - - for (u32 i = 0; i < surfaceSize; ++i) - { - ActiveRenderTarget[i] = true; - - if (FAILED(pID3DDevice->SetRenderTarget(i, renderTarget->getSurface(i)))) - { - ActiveRenderTarget[i] = false; - - os::Printer::log("Error: Could not set render target.", ELL_ERROR); - } - } - - // Reset other render target channels. - - for (u32 i = surfaceSize; i < ActiveRenderTarget.size(); ++i) - { - if (ActiveRenderTarget[i]) - { - pID3DDevice->SetRenderTarget(i, 0); - ActiveRenderTarget[i] = false; - } - } - - // Set depth stencil buffer. - - IDirect3DSurface9* depthStencilSurface = renderTarget->getDepthStencilSurface(); - - if (depthStencilSurface && FAILED(pID3DDevice->SetDepthStencilSurface(depthStencilSurface))) - { - os::Printer::log("Error: Could not set depth-stencil buffer.", ELL_ERROR); - } - - // Set other settings. - - CurrentRenderTargetSize = renderTarget->getSize(); - Transformation3DChanged = true; - } - else if (CurrentRenderTarget != target) - { - // Set main render target. - - if (BackBufferSurface) - { - ActiveRenderTarget[0] = true; - - if (FAILED(pID3DDevice->SetRenderTarget(0, BackBufferSurface))) - { - os::Printer::log("Error: Could not set main render target.", ELL_ERROR); - ActiveRenderTarget[0] = false; - - return false; - } - - BackBufferSurface->Release(); - BackBufferSurface = 0; - } - - // Reset other render target channels. - - for (u32 i = 1; i < ActiveRenderTarget.size(); ++i) - { - if (ActiveRenderTarget[i]) - { - pID3DDevice->SetRenderTarget(i, 0); - ActiveRenderTarget[i] = false; - } - } - - // Set main depth-stencil stencil buffer. - - if (FAILED(pID3DDevice->SetDepthStencilSurface(DepthStencilSurface))) - { - os::Printer::log("Error: Could not set main depth-stencil buffer.", ELL_ERROR); - } - - // Set other settings. - - CurrentRenderTargetSize = core::dimension2d<u32>(0, 0); - Transformation3DChanged = true; - } - - CurrentRenderTarget = target; - - clearBuffers(clearFlag, clearColor, clearDepth, clearStencil); - - return true; -} - - -//! sets a viewport -void CD3D9Driver::setViewPort(const core::rect<s32>& area) -{ - core::rect<s32> vp = area; - core::rect<s32> rendert(0,0, getCurrentRenderTargetSize().Width, getCurrentRenderTargetSize().Height); - vp.clipAgainst(rendert); - if (vp.getHeight()>0 && vp.getWidth()>0) - { - D3DVIEWPORT9 viewPort; - viewPort.X = vp.UpperLeftCorner.X; - viewPort.Y = vp.UpperLeftCorner.Y; - viewPort.Width = vp.getWidth(); - viewPort.Height = vp.getHeight(); - viewPort.MinZ = 0.0f; - viewPort.MaxZ = 1.0f; - - HRESULT hr = pID3DDevice->SetViewport(&viewPort); - if (FAILED(hr)) - os::Printer::log("Failed setting the viewport.", ELL_WARNING); - else - ViewPort = vp; - } -} - - -//! gets the area of the current viewport -const core::rect<s32>& CD3D9Driver::getViewPort() const -{ - return ViewPort; -} - - -bool CD3D9Driver::updateVertexHardwareBuffer(SHWBufferLink_d3d9 *hwBuffer) -{ - if (!hwBuffer) - return false; - - const scene::IMeshBuffer* mb = hwBuffer->MeshBuffer; - const void* vertices=mb->getVertices(); - const u32 vertexCount=mb->getVertexCount(); - const E_VERTEX_TYPE vType=mb->getVertexType(); - const u32 vertexSize = getVertexPitchFromType(vType); - const u32 bufSize = vertexSize * vertexCount; - - if (!hwBuffer->vertexBuffer || (bufSize > hwBuffer->vertexBufferSize)) - { - if (hwBuffer->vertexBuffer) - { - hwBuffer->vertexBuffer->Release(); - hwBuffer->vertexBuffer=0; - } - - DWORD FVF; - // Get the vertex sizes and cvf - switch (vType) - { - case EVT_STANDARD: - FVF = D3DFVF_XYZ | D3DFVF_NORMAL | D3DFVF_DIFFUSE | D3DFVF_TEX1; - break; - case EVT_2TCOORDS: - FVF = D3DFVF_XYZ | D3DFVF_NORMAL | D3DFVF_DIFFUSE | D3DFVF_TEX2; - break; - case EVT_TANGENTS: - FVF = D3DFVF_XYZ | D3DFVF_NORMAL | D3DFVF_DIFFUSE | D3DFVF_TEX3; - break; - default: - return false; - } - - DWORD flags = D3DUSAGE_WRITEONLY; // SIO2: Default to D3DUSAGE_WRITEONLY - if (hwBuffer->Mapped_Vertex != scene::EHM_STATIC) - flags |= D3DUSAGE_DYNAMIC; - - if (FAILED(pID3DDevice->CreateVertexBuffer(bufSize, flags, FVF, D3DPOOL_DEFAULT, &hwBuffer->vertexBuffer, NULL))) - return false; - hwBuffer->vertexBufferSize = bufSize; - - flags = 0; // SIO2: Reset flags before Lock - if (hwBuffer->Mapped_Vertex != scene::EHM_STATIC) - flags = D3DLOCK_DISCARD; - - void* lockedBuffer = 0; - hwBuffer->vertexBuffer->Lock(0, bufSize, (void**)&lockedBuffer, flags); - memcpy(lockedBuffer, vertices, bufSize); - hwBuffer->vertexBuffer->Unlock(); - } - else - { - void* lockedBuffer = 0; - hwBuffer->vertexBuffer->Lock(0, bufSize, (void**)&lockedBuffer, D3DLOCK_DISCARD); - memcpy(lockedBuffer, vertices, bufSize); - hwBuffer->vertexBuffer->Unlock(); - } - - return true; -} - - -bool CD3D9Driver::updateIndexHardwareBuffer(SHWBufferLink_d3d9 *hwBuffer) -{ - if (!hwBuffer) - return false; - - const scene::IMeshBuffer* mb = hwBuffer->MeshBuffer; - const u16* indices=mb->getIndices(); - const u32 indexCount=mb->getIndexCount(); - u32 indexSize = 2; - D3DFORMAT indexType=D3DFMT_UNKNOWN; - switch (mb->getIndexType()) - { - case EIT_16BIT: - { - indexType=D3DFMT_INDEX16; - indexSize = 2; - break; - } - case EIT_32BIT: - { - indexType=D3DFMT_INDEX32; - indexSize = 4; - break; - } - } - - const u32 bufSize = indexSize * indexCount; - if (!hwBuffer->indexBuffer || (bufSize > hwBuffer->indexBufferSize)) - { - if (hwBuffer->indexBuffer) - { - hwBuffer->indexBuffer->Release(); - hwBuffer->indexBuffer=0; - } - - DWORD flags = D3DUSAGE_WRITEONLY; // SIO2: Default to D3DUSAGE_WRITEONLY - if (hwBuffer->Mapped_Index != scene::EHM_STATIC) - flags |= D3DUSAGE_DYNAMIC; // SIO2: Add DYNAMIC flag for dynamic buffer data - - if (FAILED(pID3DDevice->CreateIndexBuffer(bufSize, flags, indexType, D3DPOOL_DEFAULT, &hwBuffer->indexBuffer, NULL))) - return false; - - flags = 0; // SIO2: Reset flags before Lock - if (hwBuffer->Mapped_Index != scene::EHM_STATIC) - flags = D3DLOCK_DISCARD; - - void* lockedBuffer = 0; - if (FAILED(hwBuffer->indexBuffer->Lock( 0, 0, (void**)&lockedBuffer, flags))) - return false; - - memcpy(lockedBuffer, indices, bufSize); - hwBuffer->indexBuffer->Unlock(); - - hwBuffer->indexBufferSize = bufSize; - } - else - { - void* lockedBuffer = 0; - if( SUCCEEDED(hwBuffer->indexBuffer->Lock( 0, 0, (void**)&lockedBuffer, D3DLOCK_DISCARD))) - { - memcpy(lockedBuffer, indices, bufSize); - hwBuffer->indexBuffer->Unlock(); - } - } - - return true; -} - - -//! updates hardware buffer if needed -bool CD3D9Driver::updateHardwareBuffer(SHWBufferLink *hwBuffer) -{ - if (!hwBuffer) - return false; - - if (hwBuffer->Mapped_Vertex!=scene::EHM_NEVER) - { - if (hwBuffer->ChangedID_Vertex != hwBuffer->MeshBuffer->getChangedID_Vertex() - || !((SHWBufferLink_d3d9*)hwBuffer)->vertexBuffer) - { - hwBuffer->ChangedID_Vertex = hwBuffer->MeshBuffer->getChangedID_Vertex(); - - if (!updateVertexHardwareBuffer((SHWBufferLink_d3d9*)hwBuffer)) - return false; - } - } - - if (hwBuffer->Mapped_Index!=scene::EHM_NEVER) - { - if (hwBuffer->ChangedID_Index != hwBuffer->MeshBuffer->getChangedID_Index() - || !((SHWBufferLink_d3d9*)hwBuffer)->indexBuffer) - { - hwBuffer->ChangedID_Index = hwBuffer->MeshBuffer->getChangedID_Index(); - - if (!updateIndexHardwareBuffer((SHWBufferLink_d3d9*)hwBuffer)) - return false; - } - } - - return true; -} - - -//! Create hardware buffer from meshbuffer -CD3D9Driver::SHWBufferLink *CD3D9Driver::createHardwareBuffer(const scene::IMeshBuffer* mb) -{ - // Looks like d3d does not support only partial buffering, so refuse - // in any case of NEVER - if (!mb || (mb->getHardwareMappingHint_Index()==scene::EHM_NEVER || mb->getHardwareMappingHint_Vertex()==scene::EHM_NEVER)) - return 0; - - SHWBufferLink_d3d9 *hwBuffer=new SHWBufferLink_d3d9(mb); - - //add to map - HWBufferMap.insert(hwBuffer->MeshBuffer, hwBuffer); - - hwBuffer->ChangedID_Vertex=hwBuffer->MeshBuffer->getChangedID_Vertex(); - hwBuffer->ChangedID_Index=hwBuffer->MeshBuffer->getChangedID_Index(); - hwBuffer->Mapped_Vertex=mb->getHardwareMappingHint_Vertex(); - hwBuffer->Mapped_Index=mb->getHardwareMappingHint_Index(); - hwBuffer->LastUsed=0; - hwBuffer->vertexBuffer=0; - hwBuffer->indexBuffer=0; - hwBuffer->vertexBufferSize=0; - hwBuffer->indexBufferSize=0; - - if (!updateHardwareBuffer(hwBuffer)) - { - deleteHardwareBuffer(hwBuffer); - return 0; - } - - return hwBuffer; -} - - -void CD3D9Driver::deleteHardwareBuffer(SHWBufferLink *_HWBuffer) -{ - if (!_HWBuffer) - return; - - SHWBufferLink_d3d9 *HWBuffer=(SHWBufferLink_d3d9*)_HWBuffer; - if (HWBuffer->indexBuffer) - { - HWBuffer->indexBuffer->Release(); - HWBuffer->indexBuffer = 0; - } - - if (HWBuffer->vertexBuffer) - { - HWBuffer->vertexBuffer->Release(); - HWBuffer->vertexBuffer = 0; - } - - CNullDriver::deleteHardwareBuffer(_HWBuffer); -} - - -//! Draw hardware buffer -void CD3D9Driver::drawHardwareBuffer(SHWBufferLink *_HWBuffer) -{ - if (!_HWBuffer) - return; - - SHWBufferLink_d3d9 *HWBuffer=(SHWBufferLink_d3d9*)_HWBuffer; - - updateHardwareBuffer(HWBuffer); //check if update is needed - - HWBuffer->LastUsed=0;//reset count - - const scene::IMeshBuffer* mb = HWBuffer->MeshBuffer; - const E_VERTEX_TYPE vType = mb->getVertexType(); - const u32 stride = getVertexPitchFromType(vType); - const void* vPtr = mb->getVertices(); - const void* iPtr = mb->getIndices(); - if (HWBuffer->vertexBuffer) - { - pID3DDevice->SetStreamSource(0, HWBuffer->vertexBuffer, 0, stride); - vPtr=0; - } - if (HWBuffer->indexBuffer) - { - pID3DDevice->SetIndices(HWBuffer->indexBuffer); - iPtr=0; - } - - drawVertexPrimitiveList(vPtr, mb->getVertexCount(), iPtr, mb->getPrimitiveCount(), mb->getVertexType(), mb->getPrimitiveType(), mb->getIndexType()); - - if (HWBuffer->vertexBuffer) - pID3DDevice->SetStreamSource(0, 0, 0, 0); - if (HWBuffer->indexBuffer) - pID3DDevice->SetIndices(0); -} - - -//! Create occlusion query. -/** Use node for identification and mesh for occlusion test. */ -void CD3D9Driver::addOcclusionQuery(scene::ISceneNode* node, - const scene::IMesh* mesh) -{ - if (!queryFeature(EVDF_OCCLUSION_QUERY)) - return; - CNullDriver::addOcclusionQuery(node, mesh); - const s32 index = OcclusionQueries.linear_search(SOccQuery(node)); - if ((index != -1) && (OcclusionQueries[index].PID == 0)) - pID3DDevice->CreateQuery(D3DQUERYTYPE_OCCLUSION, reinterpret_cast<IDirect3DQuery9**>(&OcclusionQueries[index].PID)); -} - - -//! Remove occlusion query. -void CD3D9Driver::removeOcclusionQuery(scene::ISceneNode* node) -{ - const s32 index = OcclusionQueries.linear_search(SOccQuery(node)); - if (index != -1) - { - if (OcclusionQueries[index].PID != 0) - reinterpret_cast<IDirect3DQuery9*>(OcclusionQueries[index].PID)->Release(); - CNullDriver::removeOcclusionQuery(node); - } -} - - -//! Run occlusion query. Draws mesh stored in query. -/** If the mesh shall not be rendered visible, use -overrideMaterial to disable the color and depth buffer. */ -void CD3D9Driver::runOcclusionQuery(scene::ISceneNode* node, bool visible) -{ - if (!node) - return; - - const s32 index = OcclusionQueries.linear_search(SOccQuery(node)); - if (index != -1) - { - if (OcclusionQueries[index].PID) - reinterpret_cast<IDirect3DQuery9*>(OcclusionQueries[index].PID)->Issue(D3DISSUE_BEGIN); - CNullDriver::runOcclusionQuery(node,visible); - if (OcclusionQueries[index].PID) - reinterpret_cast<IDirect3DQuery9*>(OcclusionQueries[index].PID)->Issue(D3DISSUE_END); - } -} - - -//! Update occlusion query. Retrieves results from GPU. -/** If the query shall not block, set the flag to false. -Update might not occur in this case, though */ -void CD3D9Driver::updateOcclusionQuery(scene::ISceneNode* node, bool block) -{ - const s32 index = OcclusionQueries.linear_search(SOccQuery(node)); - if (index != -1) - { - // not yet started - if (OcclusionQueries[index].Run==u32(~0)) - return; - bool available = block?true:false; - int tmp=0; - if (!block) - available=(reinterpret_cast<IDirect3DQuery9*>(OcclusionQueries[index].PID)->GetData(&tmp, sizeof(DWORD), 0)==S_OK); - else - { - do - { - HRESULT hr = reinterpret_cast<IDirect3DQuery9*>(OcclusionQueries[index].PID)->GetData(&tmp, sizeof(DWORD), D3DGETDATA_FLUSH); - available = (hr == S_OK); - if (hr!=S_FALSE) - break; - } while (!available); - } - if (available) - OcclusionQueries[index].Result = tmp; - } -} - - -//! Return query result. -/** Return value is the number of visible pixels/fragments. -The value is a safe approximation, i.e. can be larger than the -actual value of pixels. */ -u32 CD3D9Driver::getOcclusionQueryResult(scene::ISceneNode* node) const -{ - const s32 index = OcclusionQueries.linear_search(SOccQuery(node)); - if (index != -1) - return OcclusionQueries[index].Result; - else - return ~0; -} - - -//! Create render target. -IRenderTarget* CD3D9Driver::addRenderTarget() -{ - CD3D9RenderTarget* renderTarget = new CD3D9RenderTarget(this); - RenderTargets.push_back(renderTarget); - - return renderTarget; -} - - -//! draws a vertex primitive list -void CD3D9Driver::drawVertexPrimitiveList(const void* vertices, - u32 vertexCount, const void* indexList, u32 primitiveCount, - E_VERTEX_TYPE vType, scene::E_PRIMITIVE_TYPE pType, - E_INDEX_TYPE iType) -{ - if (!checkPrimitiveCount(primitiveCount)) - return; - - CNullDriver::drawVertexPrimitiveList(vertices, vertexCount, indexList, primitiveCount, vType, pType,iType); - - if (!vertexCount || !primitiveCount) - return; - - draw2D3DVertexPrimitiveList(vertices, vertexCount, indexList, primitiveCount, - vType, pType, iType, true); -} - - -//! draws a vertex primitive list -void CD3D9Driver::draw2DVertexPrimitiveList(const void* vertices, - u32 vertexCount, const void* indexList, u32 primitiveCount, - E_VERTEX_TYPE vType, scene::E_PRIMITIVE_TYPE pType, - E_INDEX_TYPE iType) -{ - if (!checkPrimitiveCount(primitiveCount)) - return; - - CNullDriver::draw2DVertexPrimitiveList(vertices, vertexCount, indexList, primitiveCount, vType, pType,iType); - - if (!vertexCount || !primitiveCount) - return; - - draw2D3DVertexPrimitiveList(vertices, vertexCount, indexList, primitiveCount, - vType, pType, iType, false); -} - - -void CD3D9Driver::draw2D3DVertexPrimitiveList(const void* vertices, - u32 vertexCount, const void* indexList, u32 primitiveCount, - E_VERTEX_TYPE vType, scene::E_PRIMITIVE_TYPE pType, - E_INDEX_TYPE iType, bool is3D) -{ - setVertexShader(vType); - - const u32 stride = getVertexPitchFromType(vType); - - D3DFORMAT indexType=D3DFMT_UNKNOWN; - switch (iType) - { - case (EIT_16BIT): - { - indexType=D3DFMT_INDEX16; - break; - } - case (EIT_32BIT): - { - indexType=D3DFMT_INDEX32; - break; - } - } - - if (is3D) - { - if (!setRenderStates3DMode()) - return; - } - else - { - if (Material.MaterialType==EMT_ONETEXTURE_BLEND) - { - E_BLEND_FACTOR srcFact; - E_BLEND_FACTOR dstFact; - E_MODULATE_FUNC modulo; - u32 alphaSource; - unpack_textureBlendFunc ( srcFact, dstFact, modulo, alphaSource, Material.MaterialTypeParam); - setRenderStates2DMode(alphaSource&video::EAS_VERTEX_COLOR, (Material.getTexture(0) != 0), (alphaSource&video::EAS_TEXTURE) != 0); - } - else - setRenderStates2DMode(Material.MaterialType==EMT_TRANSPARENT_VERTEX_ALPHA, (Material.getTexture(0) != 0), Material.MaterialType==EMT_TRANSPARENT_ALPHA_CHANNEL); - } - - switch (pType) - { - case scene::EPT_POINT_SPRITES: - case scene::EPT_POINTS: - { - f32 tmp=Material.Thickness/getScreenSize().Height; - if (pType==scene::EPT_POINT_SPRITES) - pID3DDevice->SetRenderState(D3DRS_POINTSPRITEENABLE, TRUE); - pID3DDevice->SetRenderState(D3DRS_POINTSCALEENABLE, TRUE); - pID3DDevice->SetRenderState(D3DRS_POINTSIZE, F2DW(tmp)); - tmp=1.0f; - pID3DDevice->SetRenderState(D3DRS_POINTSCALE_A, F2DW(tmp)); - pID3DDevice->SetRenderState(D3DRS_POINTSCALE_B, F2DW(tmp)); - pID3DDevice->SetRenderState(D3DRS_POINTSIZE_MIN, F2DW(tmp)); - tmp=0.0f; - pID3DDevice->SetRenderState(D3DRS_POINTSCALE_C, F2DW(tmp)); - - if (!vertices) - { - pID3DDevice->DrawIndexedPrimitive(D3DPT_POINTLIST, 0, 0, vertexCount, 0, primitiveCount); - } - else - { - pID3DDevice->DrawIndexedPrimitiveUP(D3DPT_POINTLIST, 0, vertexCount, - primitiveCount, indexList, indexType, vertices, stride); - } - - pID3DDevice->SetRenderState(D3DRS_POINTSCALEENABLE, FALSE); - if (pType==scene::EPT_POINT_SPRITES) - pID3DDevice->SetRenderState(D3DRS_POINTSPRITEENABLE, FALSE); - } - break; - case scene::EPT_LINE_STRIP: - if(!vertices) - pID3DDevice->DrawIndexedPrimitive(D3DPT_LINESTRIP, 0, 0, vertexCount, 0, primitiveCount); - else - pID3DDevice->DrawIndexedPrimitiveUP(D3DPT_LINESTRIP, 0, vertexCount, - primitiveCount, indexList, indexType, vertices, stride); - break; - case scene::EPT_LINE_LOOP: - if(!vertices) - { - // TODO: Implement proper hardware support for this primitive type. - // (No looping occurs currently because this would require a way to - // draw the hardware buffer with a custom set of indices. We may even - // need to create a new mini index buffer specifically for this - // primitive type.) - pID3DDevice->DrawIndexedPrimitive(D3DPT_LINELIST, 0, 0, vertexCount, 0, primitiveCount); - } - else - { - pID3DDevice->DrawIndexedPrimitiveUP(D3DPT_LINESTRIP, 0, vertexCount, - primitiveCount - 1, indexList, indexType, vertices, stride); - - u16 tmpIndices[] = {static_cast<u16>(primitiveCount - 1), 0}; - - pID3DDevice->DrawIndexedPrimitiveUP(D3DPT_LINELIST, 0, vertexCount, - 1, tmpIndices, indexType, vertices, stride); - } - break; - case scene::EPT_LINES: - if(!vertices) - pID3DDevice->DrawIndexedPrimitive(D3DPT_LINELIST, 0, 0, vertexCount, 0, primitiveCount); - else - pID3DDevice->DrawIndexedPrimitiveUP(D3DPT_LINELIST, 0, vertexCount, - primitiveCount, indexList, indexType, vertices, stride); - break; - case scene::EPT_TRIANGLE_STRIP: - if(!vertices) - pID3DDevice->DrawIndexedPrimitive(D3DPT_TRIANGLESTRIP, 0, 0, vertexCount, 0, primitiveCount); - else - pID3DDevice->DrawIndexedPrimitiveUP(D3DPT_TRIANGLESTRIP, 0, vertexCount, primitiveCount, - indexList, indexType, vertices, stride); - break; - case scene::EPT_TRIANGLE_FAN: - if(!vertices) - pID3DDevice->DrawIndexedPrimitive(D3DPT_TRIANGLEFAN, 0, 0, vertexCount, 0, primitiveCount); - else - pID3DDevice->DrawIndexedPrimitiveUP(D3DPT_TRIANGLEFAN, 0, vertexCount, primitiveCount, - indexList, indexType, vertices, stride); - break; - case scene::EPT_TRIANGLES: - if(!vertices) - { - pID3DDevice->DrawIndexedPrimitive(D3DPT_TRIANGLELIST, 0, 0, vertexCount, 0, primitiveCount); - } - else - { - pID3DDevice->DrawIndexedPrimitiveUP(D3DPT_TRIANGLELIST, 0, vertexCount, - primitiveCount, indexList, indexType, vertices, stride); - } - break; - } -} - - -void CD3D9Driver::draw2DImage(const video::ITexture* texture, - const core::rect<s32>& destRect, - const core::rect<s32>& sourceRect, - const core::rect<s32>* clipRect, - const video::SColor* const colors, - bool useAlphaChannelOfTexture) -{ - if(!texture) - return; - - const core::dimension2d<u32>& ss = texture->getOriginalSize(); - core::rect<f32> tcoords; - tcoords.UpperLeftCorner.X = (f32)sourceRect.UpperLeftCorner.X / (f32)ss.Width; - tcoords.UpperLeftCorner.Y = (f32)sourceRect.UpperLeftCorner.Y / (f32)ss.Height; - tcoords.LowerRightCorner.X = (f32)sourceRect.LowerRightCorner.X / (f32)ss.Width; - tcoords.LowerRightCorner.Y = (f32)sourceRect.LowerRightCorner.Y / (f32)ss.Height; - - const core::dimension2d<u32>& renderTargetSize = getCurrentRenderTargetSize(); - - const video::SColor temp[4] = - { - 0xFFFFFFFF, - 0xFFFFFFFF, - 0xFFFFFFFF, - 0xFFFFFFFF - }; - - const video::SColor* const useColor = colors ? colors : temp; - - S3DVertex vtx[4]; // clock wise - vtx[0] = S3DVertex((f32)destRect.UpperLeftCorner.X, (f32)destRect.UpperLeftCorner.Y, 0.0f, - 0.0f, 0.0f, 0.0f, useColor[0], - tcoords.UpperLeftCorner.X, tcoords.UpperLeftCorner.Y); - vtx[1] = S3DVertex((f32)destRect.LowerRightCorner.X, (f32)destRect.UpperLeftCorner.Y, 0.0f, - 0.0f, 0.0f, 0.0f, useColor[3], - tcoords.LowerRightCorner.X, tcoords.UpperLeftCorner.Y); - vtx[2] = S3DVertex((f32)destRect.LowerRightCorner.X, (f32)destRect.LowerRightCorner.Y, 0.0f, - 0.0f, 0.0f, 0.0f, useColor[2], - tcoords.LowerRightCorner.X, tcoords.LowerRightCorner.Y); - vtx[3] = S3DVertex((f32)destRect.UpperLeftCorner.X, (f32)destRect.LowerRightCorner.Y, 0.0f, - 0.0f, 0.0f, 0.0f, useColor[1], - tcoords.UpperLeftCorner.X, tcoords.LowerRightCorner.Y); - - s16 indices[6] = {0,1,2,0,2,3}; - - setActiveTexture(0, texture); - - setRenderStates2DMode(useColor[0].getAlpha()<255 || useColor[1].getAlpha()<255 || - useColor[2].getAlpha()<255 || useColor[3].getAlpha()<255, - true, useAlphaChannelOfTexture); - - setVertexShader(EVT_STANDARD); - - if (clipRect) - { - pID3DDevice->SetRenderState(D3DRS_SCISSORTESTENABLE, TRUE); - RECT scissor; - scissor.left = clipRect->UpperLeftCorner.X; - scissor.top = clipRect->UpperLeftCorner.Y; - scissor.right = clipRect->LowerRightCorner.X; - scissor.bottom = clipRect->LowerRightCorner.Y; - pID3DDevice->SetScissorRect(&scissor); - } - - pID3DDevice->DrawIndexedPrimitiveUP(D3DPT_TRIANGLELIST, 0, 4, 2, &indices[0], - D3DFMT_INDEX16,&vtx[0], sizeof(S3DVertex)); - - if (clipRect) - pID3DDevice->SetRenderState(D3DRS_SCISSORTESTENABLE, FALSE); -} - - -void CD3D9Driver::draw2DImageBatch(const video::ITexture* texture, - const core::array<core::position2d<s32> >& positions, - const core::array<core::rect<s32> >& sourceRects, - const core::rect<s32>* clipRect, - SColor color, - bool useAlphaChannelOfTexture) -{ - if (!texture) - return; - - if (!setActiveTexture(0, texture)) - return; - - setRenderStates2DMode(color.getAlpha()<255, true, useAlphaChannelOfTexture); - - const irr::u32 drawCount = core::min_<u32>(positions.size(), sourceRects.size()); - - core::array<S3DVertex> vtx(drawCount * 4); - core::array<u16> indices(drawCount * 6); - - for(u32 i = 0;i < drawCount;i++) - { - core::position2d<s32> targetPos = positions[i]; - core::position2d<s32> sourcePos = sourceRects[i].UpperLeftCorner; - // This needs to be signed as it may go negative. - core::dimension2d<s32> sourceSize(sourceRects[i].getSize()); - - if (clipRect) - { - if (targetPos.X < clipRect->UpperLeftCorner.X) - { - sourceSize.Width += targetPos.X - clipRect->UpperLeftCorner.X; - if (sourceSize.Width <= 0) - continue; - - sourcePos.X -= targetPos.X - clipRect->UpperLeftCorner.X; - targetPos.X = clipRect->UpperLeftCorner.X; - } - - if (targetPos.X + (s32)sourceSize.Width > clipRect->LowerRightCorner.X) - { - sourceSize.Width -= (targetPos.X + sourceSize.Width) - clipRect->LowerRightCorner.X; - if (sourceSize.Width <= 0) - continue; - } - - if (targetPos.Y < clipRect->UpperLeftCorner.Y) - { - sourceSize.Height += targetPos.Y - clipRect->UpperLeftCorner.Y; - if (sourceSize.Height <= 0) - continue; - - sourcePos.Y -= targetPos.Y - clipRect->UpperLeftCorner.Y; - targetPos.Y = clipRect->UpperLeftCorner.Y; - } - - if (targetPos.Y + (s32)sourceSize.Height > clipRect->LowerRightCorner.Y) - { - sourceSize.Height -= (targetPos.Y + sourceSize.Height) - clipRect->LowerRightCorner.Y; - if (sourceSize.Height <= 0) - continue; - } - } - - // clip these coordinates - - if (targetPos.X<0) - { - sourceSize.Width += targetPos.X; - if (sourceSize.Width <= 0) - continue; - - sourcePos.X -= targetPos.X; - targetPos.X = 0; - } - - const core::dimension2d<u32>& renderTargetSize = getCurrentRenderTargetSize(); - - if (targetPos.X + sourceSize.Width > (s32)renderTargetSize.Width) - { - sourceSize.Width -= (targetPos.X + sourceSize.Width) - renderTargetSize.Width; - if (sourceSize.Width <= 0) - continue; - } - - if (targetPos.Y<0) - { - sourceSize.Height += targetPos.Y; - if (sourceSize.Height <= 0) - continue; - - sourcePos.Y -= targetPos.Y; - targetPos.Y = 0; - } - - if (targetPos.Y + sourceSize.Height > (s32)renderTargetSize.Height) - { - sourceSize.Height -= (targetPos.Y + sourceSize.Height) - renderTargetSize.Height; - if (sourceSize.Height <= 0) - continue; - } - - // ok, we've clipped everything. - // now draw it. - - core::rect<f32> tcoords; - tcoords.UpperLeftCorner.X = (((f32)sourcePos.X)) / texture->getOriginalSize().Width ; - tcoords.UpperLeftCorner.Y = (((f32)sourcePos.Y)) / texture->getOriginalSize().Height; - tcoords.LowerRightCorner.X = tcoords.UpperLeftCorner.X + ((f32)(sourceSize.Width) / texture->getOriginalSize().Width); - tcoords.LowerRightCorner.Y = tcoords.UpperLeftCorner.Y + ((f32)(sourceSize.Height) / texture->getOriginalSize().Height); - - const core::rect<s32> poss(targetPos, sourceSize); - - vtx.push_back(S3DVertex((f32)poss.UpperLeftCorner.X, (f32)poss.UpperLeftCorner.Y, 0.0f, - 0.0f, 0.0f, 0.0f, color, - tcoords.UpperLeftCorner.X, tcoords.UpperLeftCorner.Y)); - vtx.push_back(S3DVertex((f32)poss.LowerRightCorner.X, (f32)poss.UpperLeftCorner.Y, 0.0f, - 0.0f, 0.0f, 0.0f, color, - tcoords.LowerRightCorner.X, tcoords.UpperLeftCorner.Y)); - vtx.push_back(S3DVertex((f32)poss.LowerRightCorner.X, (f32)poss.LowerRightCorner.Y, 0.0f, - 0.0f, 0.0f, 0.0f, color, - tcoords.LowerRightCorner.X, tcoords.LowerRightCorner.Y)); - vtx.push_back(S3DVertex((f32)poss.UpperLeftCorner.X, (f32)poss.LowerRightCorner.Y, 0.0f, - 0.0f, 0.0f, 0.0f, color, - tcoords.UpperLeftCorner.X, tcoords.LowerRightCorner.Y)); - - const u32 curPos = vtx.size()-4; - indices.push_back(0+curPos); - indices.push_back(1+curPos); - indices.push_back(2+curPos); - - indices.push_back(0+curPos); - indices.push_back(2+curPos); - indices.push_back(3+curPos); - } - - if (vtx.size()) - { - setVertexShader(EVT_STANDARD); - - pID3DDevice->DrawIndexedPrimitiveUP(D3DPT_TRIANGLELIST, 0, vtx.size(), indices.size() / 3, indices.pointer(), - D3DFMT_INDEX16,vtx.pointer(), sizeof(S3DVertex)); - } -} - - -//! draws a 2d image, using a color and the alpha channel of the texture if -//! desired. The image is drawn at pos and clipped against clipRect (if != 0). -void CD3D9Driver::draw2DImage(const video::ITexture* texture, - const core::position2d<s32>& pos, - const core::rect<s32>& sourceRect, - const core::rect<s32>* clipRect, SColor color, - bool useAlphaChannelOfTexture) -{ - if (!texture) - return; - - if (!sourceRect.isValid()) - return; - - if (!setActiveTexture(0, texture)) - return; - - core::position2d<s32> targetPos = pos; - core::position2d<s32> sourcePos = sourceRect.UpperLeftCorner; - // This needs to be signed as it may go negative. - core::dimension2d<s32> sourceSize(sourceRect.getSize()); - - if (clipRect) - { - if (targetPos.X < clipRect->UpperLeftCorner.X) - { - sourceSize.Width += targetPos.X - clipRect->UpperLeftCorner.X; - if (sourceSize.Width <= 0) - return; - - sourcePos.X -= targetPos.X - clipRect->UpperLeftCorner.X; - targetPos.X = clipRect->UpperLeftCorner.X; - } - - if (targetPos.X + (s32)sourceSize.Width > clipRect->LowerRightCorner.X) - { - sourceSize.Width -= (targetPos.X + sourceSize.Width) - clipRect->LowerRightCorner.X; - if (sourceSize.Width <= 0) - return; - } - - if (targetPos.Y < clipRect->UpperLeftCorner.Y) - { - sourceSize.Height += targetPos.Y - clipRect->UpperLeftCorner.Y; - if (sourceSize.Height <= 0) - return; - - sourcePos.Y -= targetPos.Y - clipRect->UpperLeftCorner.Y; - targetPos.Y = clipRect->UpperLeftCorner.Y; - } - - if (targetPos.Y + (s32)sourceSize.Height > clipRect->LowerRightCorner.Y) - { - sourceSize.Height -= (targetPos.Y + sourceSize.Height) - clipRect->LowerRightCorner.Y; - if (sourceSize.Height <= 0) - return; - } - } - - // clip these coordinates - - if (targetPos.X<0) - { - sourceSize.Width += targetPos.X; - if (sourceSize.Width <= 0) - return; - - sourcePos.X -= targetPos.X; - targetPos.X = 0; - } - - const core::dimension2d<u32>& renderTargetSize = getCurrentRenderTargetSize(); - - if (targetPos.X + sourceSize.Width > (s32)renderTargetSize.Width) - { - sourceSize.Width -= (targetPos.X + sourceSize.Width) - renderTargetSize.Width; - if (sourceSize.Width <= 0) - return; - } - - if (targetPos.Y<0) - { - sourceSize.Height += targetPos.Y; - if (sourceSize.Height <= 0) - return; - - sourcePos.Y -= targetPos.Y; - targetPos.Y = 0; - } - - if (targetPos.Y + sourceSize.Height > (s32)renderTargetSize.Height) - { - sourceSize.Height -= (targetPos.Y + sourceSize.Height) - renderTargetSize.Height; - if (sourceSize.Height <= 0) - return; - } - - // ok, we've clipped everything. - // now draw it. - - core::rect<f32> tcoords; - tcoords.UpperLeftCorner.X = (((f32)sourcePos.X)) / texture->getOriginalSize().Width ; - tcoords.UpperLeftCorner.Y = (((f32)sourcePos.Y)) / texture->getOriginalSize().Height; - tcoords.LowerRightCorner.X = tcoords.UpperLeftCorner.X + ((f32)(sourceSize.Width) / texture->getOriginalSize().Width); - tcoords.LowerRightCorner.Y = tcoords.UpperLeftCorner.Y + ((f32)(sourceSize.Height) / texture->getOriginalSize().Height); - - const core::rect<s32> poss(targetPos, sourceSize); - - setRenderStates2DMode(color.getAlpha()<255, true, useAlphaChannelOfTexture); - - S3DVertex vtx[4]; - vtx[0] = S3DVertex((f32)poss.UpperLeftCorner.X, (f32)poss.UpperLeftCorner.Y, 0.0f, - 0.0f, 0.0f, 0.0f, color, - tcoords.UpperLeftCorner.X, tcoords.UpperLeftCorner.Y); - vtx[1] = S3DVertex((f32)poss.LowerRightCorner.X, (f32)poss.UpperLeftCorner.Y, 0.0f, - 0.0f, 0.0f, 0.0f, color, - tcoords.LowerRightCorner.X, tcoords.UpperLeftCorner.Y); - vtx[2] = S3DVertex((f32)poss.LowerRightCorner.X, (f32)poss.LowerRightCorner.Y, 0.0f, - 0.0f, 0.0f, 0.0f, color, - tcoords.LowerRightCorner.X, tcoords.LowerRightCorner.Y); - vtx[3] = S3DVertex((f32)poss.UpperLeftCorner.X, (f32)poss.LowerRightCorner.Y, 0.0f, - 0.0f, 0.0f, 0.0f, color, - tcoords.UpperLeftCorner.X, tcoords.LowerRightCorner.Y); - - s16 indices[6] = {0,1,2,0,2,3}; - - setVertexShader(EVT_STANDARD); - - pID3DDevice->DrawIndexedPrimitiveUP(D3DPT_TRIANGLELIST, 0, 4, 2, &indices[0], - D3DFMT_INDEX16,&vtx[0], sizeof(S3DVertex)); -} - - -//!Draws a 2d rectangle with a gradient. -void CD3D9Driver::draw2DRectangle(const core::rect<s32>& position, - SColor colorLeftUp, SColor colorRightUp, SColor colorLeftDown, SColor colorRightDown, - const core::rect<s32>* clip) -{ - core::rect<s32> pos(position); - - if (clip) - pos.clipAgainst(*clip); - - if (!pos.isValid()) - return; - - S3DVertex vtx[4]; - vtx[0] = S3DVertex((f32)pos.UpperLeftCorner.X, (f32)pos.UpperLeftCorner.Y, 0.0f, - 0.0f, 0.0f, 0.0f, colorLeftUp, 0.0f, 0.0f); - vtx[1] = S3DVertex((f32)pos.LowerRightCorner.X, (f32)pos.UpperLeftCorner.Y, 0.0f, - 0.0f, 0.0f, 0.0f, colorRightUp, 0.0f, 1.0f); - vtx[2] = S3DVertex((f32)pos.LowerRightCorner.X, (f32)pos.LowerRightCorner.Y, 0.0f, - 0.0f, 0.0f, 0.0f, colorRightDown, 1.0f, 0.0f); - vtx[3] = S3DVertex((f32)pos.UpperLeftCorner.X, (f32)pos.LowerRightCorner.Y, 0.0f, - 0.0f, 0.0f, 0.0f, colorLeftDown, 1.0f, 1.0f); - - s16 indices[6] = {0,1,2,0,2,3}; - - setRenderStates2DMode( - colorLeftUp.getAlpha() < 255 || - colorRightUp.getAlpha() < 255 || - colorLeftDown.getAlpha() < 255 || - colorRightDown.getAlpha() < 255, false, false); - - setActiveTexture(0,0); - - setVertexShader(EVT_STANDARD); - - pID3DDevice->DrawIndexedPrimitiveUP(D3DPT_TRIANGLELIST, 0, 4, 2, &indices[0], - D3DFMT_INDEX16, &vtx[0], sizeof(S3DVertex)); -} - - -//! Draws a 2d line. -void CD3D9Driver::draw2DLine(const core::position2d<s32>& start, - const core::position2d<s32>& end, - SColor color) -{ - if (start==end) - drawPixel(start.X, start.Y, color); - else - { - // thanks to Vash TheStampede who sent in his implementation - S3DVertex vtx[2]; - vtx[0] = S3DVertex((f32)start.X+0.375f, (f32)start.Y+0.375f, 0.0f, - 0.0f, 0.0f, 0.0f, // normal - color, 0.0f, 0.0f); // texture - - vtx[1] = S3DVertex((f32)end.X+0.375f, (f32)end.Y+0.375f, 0.0f, - 0.0f, 0.0f, 0.0f, - color, 0.0f, 0.0f); - - setRenderStates2DMode(color.getAlpha() < 255, false, false); - setActiveTexture(0,0); - - setVertexShader(EVT_STANDARD); - - pID3DDevice->DrawPrimitiveUP(D3DPT_LINELIST, 1, - &vtx[0], sizeof(S3DVertex) ); - } -} - - -//! Draws a pixel -void CD3D9Driver::drawPixel(u32 x, u32 y, const SColor & color) -{ - const core::dimension2d<u32>& renderTargetSize = getCurrentRenderTargetSize(); - if(x > (u32)renderTargetSize.Width || y > (u32)renderTargetSize.Height) - return; - - setRenderStates2DMode(color.getAlpha() < 255, false, false); - setActiveTexture(0,0); - - setVertexShader(EVT_STANDARD); - - S3DVertex vertex((f32)x+0.375f, (f32)y+0.375f, 0.f, 0.f, 0.f, 0.f, color, 0.f, 0.f); - - pID3DDevice->DrawPrimitiveUP(D3DPT_POINTLIST, 1, &vertex, sizeof(vertex)); -} - - -//! sets right vertex shader -void CD3D9Driver::setVertexShader(E_VERTEX_TYPE newType) -{ - if (newType != LastVertexType) - { - LastVertexType = newType; - HRESULT hr = 0; - - switch(newType) - { - case EVT_STANDARD: - hr = pID3DDevice->SetFVF(D3DFVF_XYZ | D3DFVF_NORMAL | D3DFVF_DIFFUSE | D3DFVF_TEX1); - break; - case EVT_2TCOORDS: - hr = pID3DDevice->SetFVF(D3DFVF_XYZ | D3DFVF_NORMAL | D3DFVF_DIFFUSE | D3DFVF_TEX2); - break; - case EVT_TANGENTS: - hr = pID3DDevice->SetFVF(D3DFVF_XYZ | D3DFVF_NORMAL | D3DFVF_DIFFUSE | D3DFVF_TEX3 | - D3DFVF_TEXCOORDSIZE2(0) | // real texture coord - D3DFVF_TEXCOORDSIZE3(1) | // misuse texture coord 2 for tangent - D3DFVF_TEXCOORDSIZE3(2) // misuse texture coord 3 for binormal - ); - break; - } - - if (FAILED(hr)) - { - os::Printer::log("Could not set vertex Shader.", ELL_ERROR); - return; - } - } -} - - -//! sets the needed renderstates -bool CD3D9Driver::setRenderStates3DMode() -{ - if (!pID3DDevice) - return false; - - if (CurrentRenderMode != ERM_3D) - { - // switch back the matrices - pID3DDevice->SetTransform(D3DTS_VIEW, (D3DMATRIX*)((void*)&Matrices[ETS_VIEW])); - pID3DDevice->SetTransform(D3DTS_WORLD, (D3DMATRIX*)((void*)&Matrices[ETS_WORLD])); - pID3DDevice->SetTransform(D3DTS_PROJECTION, (D3DMATRIX*)((void*)&Matrices[ETS_PROJECTION])); - - pID3DDevice->SetRenderState(D3DRS_STENCILENABLE, FALSE); - pID3DDevice->SetRenderState(D3DRS_CLIPPING, TRUE); - - ResetRenderStates = true; - } - - if (ResetRenderStates || LastMaterial != Material) - { - // unset old material - - if (CurrentRenderMode == ERM_3D && - LastMaterial.MaterialType != Material.MaterialType && - LastMaterial.MaterialType >= 0 && LastMaterial.MaterialType < (s32)MaterialRenderers.size()) - MaterialRenderers[LastMaterial.MaterialType].Renderer->OnUnsetMaterial(); - - // set new material. - - if (Material.MaterialType >= 0 && Material.MaterialType < (s32)MaterialRenderers.size()) - MaterialRenderers[Material.MaterialType].Renderer->OnSetMaterial( - Material, LastMaterial, ResetRenderStates, this); - } - - bool shaderOK = true; - if (Material.MaterialType >= 0 && Material.MaterialType < (s32)MaterialRenderers.size()) - shaderOK = MaterialRenderers[Material.MaterialType].Renderer->OnRender(this, LastVertexType); - - LastMaterial = Material; - - ResetRenderStates = false; - - CurrentRenderMode = ERM_3D; - - return shaderOK; -} - - -//! Map Irrlicht texture wrap mode to native values -D3DTEXTUREADDRESS CD3D9Driver::getTextureWrapMode(const u8 clamp) -{ - switch (clamp) - { - case ETC_REPEAT: - if (Caps.TextureAddressCaps & D3DPTADDRESSCAPS_WRAP) - return D3DTADDRESS_WRAP; - case ETC_CLAMP: - case ETC_CLAMP_TO_EDGE: - if (Caps.TextureAddressCaps & D3DPTADDRESSCAPS_CLAMP) - return D3DTADDRESS_CLAMP; - case ETC_MIRROR: - if (Caps.TextureAddressCaps & D3DPTADDRESSCAPS_MIRROR) - return D3DTADDRESS_MIRROR; - case ETC_CLAMP_TO_BORDER: - if (Caps.TextureAddressCaps & D3DPTADDRESSCAPS_BORDER) - return D3DTADDRESS_BORDER; - else - return D3DTADDRESS_CLAMP; - case ETC_MIRROR_CLAMP: - case ETC_MIRROR_CLAMP_TO_EDGE: - case ETC_MIRROR_CLAMP_TO_BORDER: - if (Caps.TextureAddressCaps & D3DPTADDRESSCAPS_MIRRORONCE) - return D3DTADDRESS_MIRRORONCE; - else - return D3DTADDRESS_CLAMP; - default: - return D3DTADDRESS_WRAP; - } -} - - -//! Can be called by an IMaterialRenderer to make its work easier. -void CD3D9Driver::setBasicRenderStates(const SMaterial& material, const SMaterial& lastmaterial, - bool resetAllRenderstates) -{ - // This needs only to be updated onresets - if (Params.HandleSRGB && resetAllRenderstates) - pID3DDevice->SetRenderState(D3DRS_SRGBWRITEENABLE, TRUE); - - if (resetAllRenderstates || - lastmaterial.AmbientColor != material.AmbientColor || - lastmaterial.DiffuseColor != material.DiffuseColor || - lastmaterial.SpecularColor != material.SpecularColor || - lastmaterial.EmissiveColor != material.EmissiveColor || - lastmaterial.Shininess != material.Shininess) - { - D3DMATERIAL9 mat; - mat.Diffuse = colorToD3D(material.DiffuseColor); - mat.Ambient = colorToD3D(material.AmbientColor); - mat.Specular = colorToD3D(material.SpecularColor); - mat.Emissive = colorToD3D(material.EmissiveColor); - mat.Power = material.Shininess; - pID3DDevice->SetMaterial(&mat); - } - - if (lastmaterial.ColorMaterial != material.ColorMaterial) - { - pID3DDevice->SetRenderState(D3DRS_COLORVERTEX, (material.ColorMaterial != ECM_NONE)); - pID3DDevice->SetRenderState(D3DRS_DIFFUSEMATERIALSOURCE, - ((material.ColorMaterial == ECM_DIFFUSE)|| - (material.ColorMaterial == ECM_DIFFUSE_AND_AMBIENT))?D3DMCS_COLOR1:D3DMCS_MATERIAL); - pID3DDevice->SetRenderState(D3DRS_AMBIENTMATERIALSOURCE, - ((material.ColorMaterial == ECM_AMBIENT)|| - (material.ColorMaterial == ECM_DIFFUSE_AND_AMBIENT))?D3DMCS_COLOR1:D3DMCS_MATERIAL); - pID3DDevice->SetRenderState(D3DRS_EMISSIVEMATERIALSOURCE, - (material.ColorMaterial == ECM_EMISSIVE)?D3DMCS_COLOR1:D3DMCS_MATERIAL); - pID3DDevice->SetRenderState(D3DRS_SPECULARMATERIALSOURCE, - (material.ColorMaterial == ECM_SPECULAR)?D3DMCS_COLOR1:D3DMCS_MATERIAL); - } - - // fillmode - if (resetAllRenderstates || lastmaterial.Wireframe != material.Wireframe || lastmaterial.PointCloud != material.PointCloud) - { - if (material.Wireframe) - pID3DDevice->SetRenderState(D3DRS_FILLMODE, D3DFILL_WIREFRAME); - else - if (material.PointCloud) - pID3DDevice->SetRenderState(D3DRS_FILLMODE, D3DFILL_POINT); - else - pID3DDevice->SetRenderState(D3DRS_FILLMODE, D3DFILL_SOLID); - } - - // shademode - - if (resetAllRenderstates || lastmaterial.GouraudShading != material.GouraudShading) - { - if (material.GouraudShading) - pID3DDevice->SetRenderState(D3DRS_SHADEMODE, D3DSHADE_GOURAUD); - else - pID3DDevice->SetRenderState(D3DRS_SHADEMODE, D3DSHADE_FLAT); - } - - // lighting - - if (resetAllRenderstates || lastmaterial.Lighting != material.Lighting) - { - if (material.Lighting) - pID3DDevice->SetRenderState(D3DRS_LIGHTING, TRUE); - else - pID3DDevice->SetRenderState(D3DRS_LIGHTING, FALSE); - } - - // zbuffer - - if (resetAllRenderstates || lastmaterial.ZBuffer != material.ZBuffer) - { - switch (material.ZBuffer) - { - case ECFN_DISABLED: - pID3DDevice->SetRenderState(D3DRS_ZENABLE, FALSE); - break; - case ECFN_LESSEQUAL: - pID3DDevice->SetRenderState(D3DRS_ZENABLE, TRUE); - pID3DDevice->SetRenderState(D3DRS_ZFUNC, D3DCMP_LESSEQUAL); - break; - case ECFN_EQUAL: - pID3DDevice->SetRenderState(D3DRS_ZENABLE, TRUE); - pID3DDevice->SetRenderState(D3DRS_ZFUNC, D3DCMP_EQUAL); - break; - case ECFN_LESS: - pID3DDevice->SetRenderState(D3DRS_ZENABLE, TRUE); - pID3DDevice->SetRenderState(D3DRS_ZFUNC, D3DCMP_LESS); - break; - case ECFN_NOTEQUAL: - pID3DDevice->SetRenderState(D3DRS_ZENABLE, TRUE); - pID3DDevice->SetRenderState(D3DRS_ZFUNC, D3DCMP_NOTEQUAL); - break; - case ECFN_GREATEREQUAL: - pID3DDevice->SetRenderState(D3DRS_ZENABLE, TRUE); - pID3DDevice->SetRenderState(D3DRS_ZFUNC, D3DCMP_GREATEREQUAL); - break; - case ECFN_GREATER: - pID3DDevice->SetRenderState(D3DRS_ZENABLE, TRUE); - pID3DDevice->SetRenderState(D3DRS_ZFUNC, D3DCMP_GREATER); - break; - case ECFN_ALWAYS: - pID3DDevice->SetRenderState(D3DRS_ZENABLE, TRUE); - pID3DDevice->SetRenderState(D3DRS_ZFUNC, D3DCMP_ALWAYS); - break; - case ECFN_NEVER: - pID3DDevice->SetRenderState(D3DRS_ZENABLE, TRUE); - pID3DDevice->SetRenderState(D3DRS_ZFUNC, D3DCMP_NEVER); - } - } - - // zwrite - if (getWriteZBuffer(material)) - { - pID3DDevice->SetRenderState( D3DRS_ZWRITEENABLE, TRUE); - } - else - { - pID3DDevice->SetRenderState(D3DRS_ZWRITEENABLE, FALSE); - } - - // back face culling - - if (resetAllRenderstates || (lastmaterial.FrontfaceCulling != material.FrontfaceCulling) || (lastmaterial.BackfaceCulling != material.BackfaceCulling)) - { -// if (material.FrontfaceCulling && material.BackfaceCulling) -// pID3DDevice->SetRenderState(D3DRS_CULLMODE, D3DCULL_CW|D3DCULL_CCW); -// else - if (material.FrontfaceCulling) - pID3DDevice->SetRenderState(D3DRS_CULLMODE, D3DCULL_CW); - else - if (material.BackfaceCulling) - pID3DDevice->SetRenderState(D3DRS_CULLMODE, D3DCULL_CCW); - else - pID3DDevice->SetRenderState(D3DRS_CULLMODE, D3DCULL_NONE); - } - - // fog - if (resetAllRenderstates || lastmaterial.FogEnable != material.FogEnable) - { - pID3DDevice->SetRenderState(D3DRS_FOGENABLE, material.FogEnable); - } - - // specular highlights - if (resetAllRenderstates || !core::equals(lastmaterial.Shininess,material.Shininess)) - { - const bool enable = (material.Shininess!=0.0f); - pID3DDevice->SetRenderState(D3DRS_SPECULARENABLE, enable); - pID3DDevice->SetRenderState(D3DRS_SPECULARMATERIALSOURCE, D3DMCS_MATERIAL); - } - - // normalization - if (resetAllRenderstates || lastmaterial.NormalizeNormals != material.NormalizeNormals) - { - pID3DDevice->SetRenderState(D3DRS_NORMALIZENORMALS, material.NormalizeNormals); - } - - // Color Mask - if (queryFeature(EVDF_COLOR_MASK) && - (resetAllRenderstates || lastmaterial.ColorMask != material.ColorMask)) - { - const DWORD flag = - ((material.ColorMask & ECP_RED)?D3DCOLORWRITEENABLE_RED:0) | - ((material.ColorMask & ECP_GREEN)?D3DCOLORWRITEENABLE_GREEN:0) | - ((material.ColorMask & ECP_BLUE)?D3DCOLORWRITEENABLE_BLUE:0) | - ((material.ColorMask & ECP_ALPHA)?D3DCOLORWRITEENABLE_ALPHA:0); - pID3DDevice->SetRenderState(D3DRS_COLORWRITEENABLE, flag); - } - - // Blend Operation - if (material.BlendOperation == EBO_NONE) - BridgeCalls->setBlend(false); - else - { - BridgeCalls->setBlend(true); - - if (queryFeature(EVDF_BLEND_OPERATIONS)) - { - switch (material.BlendOperation) - { - case EBO_MAX: - case EBO_MAX_FACTOR: - case EBO_MAX_ALPHA: - BridgeCalls->setBlendOperation(D3DBLENDOP_MAX); - break; - case EBO_MIN: - case EBO_MIN_FACTOR: - case EBO_MIN_ALPHA: - BridgeCalls->setBlendOperation(D3DBLENDOP_MIN); - break; - case EBO_SUBTRACT: - BridgeCalls->setBlendOperation(D3DBLENDOP_SUBTRACT); - break; - case EBO_REVSUBTRACT: - BridgeCalls->setBlendOperation(D3DBLENDOP_REVSUBTRACT); - break; - default: - BridgeCalls->setBlendOperation(D3DBLENDOP_ADD); - break; - } - } - } - - // Blend Factor - if (IR(material.BlendFactor) & 0xFFFFFFFF // TODO: why the & 0xFFFFFFFF? - && material.MaterialType != EMT_ONETEXTURE_BLEND - ) - { - E_BLEND_FACTOR srcRGBFact = EBF_ZERO; - E_BLEND_FACTOR dstRGBFact = EBF_ZERO; - E_BLEND_FACTOR srcAlphaFact = EBF_ZERO; - E_BLEND_FACTOR dstAlphaFact = EBF_ZERO; - E_MODULATE_FUNC modulo = EMFN_MODULATE_1X; - u32 alphaSource = 0; - - unpack_textureBlendFuncSeparate(srcRGBFact, dstRGBFact, srcAlphaFact, dstAlphaFact, modulo, alphaSource, material.BlendFactor); - - BridgeCalls->setBlendFuncSeparate(getD3DBlend(srcRGBFact), getD3DBlend(dstRGBFact), - getD3DBlend(srcAlphaFact), getD3DBlend(dstAlphaFact)); - } - - // Polygon offset - if (queryFeature(EVDF_POLYGON_OFFSET) && (resetAllRenderstates || - lastmaterial.PolygonOffsetDirection != material.PolygonOffsetDirection || - lastmaterial.PolygonOffsetFactor != material.PolygonOffsetFactor || - lastmaterial.PolygonOffsetSlopeScale != material.PolygonOffsetSlopeScale || - lastmaterial.PolygonOffsetDepthBias != material.PolygonOffsetDepthBias )) - { - if ( material.PolygonOffsetSlopeScale || material.PolygonOffsetDepthBias ) - { - pID3DDevice->SetRenderState(D3DRS_SLOPESCALEDEPTHBIAS, F2DW(material.PolygonOffsetSlopeScale)); - pID3DDevice->SetRenderState(D3DRS_DEPTHBIAS, F2DW(material.PolygonOffsetDepthBias)); - } - else if (material.PolygonOffsetFactor) - { - if (material.PolygonOffsetDirection==EPO_BACK) - { - pID3DDevice->SetRenderState(D3DRS_SLOPESCALEDEPTHBIAS, F2DW(1.f)); - pID3DDevice->SetRenderState(D3DRS_DEPTHBIAS, F2DW((FLOAT)material.PolygonOffsetFactor)); - } - else - { - pID3DDevice->SetRenderState(D3DRS_SLOPESCALEDEPTHBIAS, F2DW(-1.f)); - pID3DDevice->SetRenderState(D3DRS_DEPTHBIAS, F2DW((FLOAT)-material.PolygonOffsetFactor)); - } - } - else - { - pID3DDevice->SetRenderState(D3DRS_SLOPESCALEDEPTHBIAS, 0); - pID3DDevice->SetRenderState(D3DRS_DEPTHBIAS, 0); - } - } - - // Anti Aliasing - if (resetAllRenderstates || lastmaterial.AntiAliasing != material.AntiAliasing) - { - if (AlphaToCoverageSupport && (material.AntiAliasing & EAAM_ALPHA_TO_COVERAGE)) - { - if (VendorID==0x10DE)//NVidia - pID3DDevice->SetRenderState(D3DRS_ADAPTIVETESS_Y, MAKEFOURCC('A','T','O','C')); - // SSAA could give better results on NVidia cards - else if (VendorID==0x1002)//ATI - pID3DDevice->SetRenderState(D3DRS_POINTSIZE, MAKEFOURCC('A','2','M','1')); - } - else if (AlphaToCoverageSupport && (lastmaterial.AntiAliasing & EAAM_ALPHA_TO_COVERAGE)) - { - if (VendorID==0x10DE) - pID3DDevice->SetRenderState(D3DRS_ADAPTIVETESS_Y, D3DFMT_UNKNOWN); - else if (VendorID==0x1002) - pID3DDevice->SetRenderState(D3DRS_POINTSIZE, MAKEFOURCC('A','2','M','0')); - } - - // enable antialiasing - if (Params.AntiAlias) - { - if (material.AntiAliasing & (EAAM_SIMPLE|EAAM_QUALITY)) - pID3DDevice->SetRenderState(D3DRS_MULTISAMPLEANTIALIAS, TRUE); - else if (lastmaterial.AntiAliasing & (EAAM_SIMPLE|EAAM_QUALITY)) - pID3DDevice->SetRenderState(D3DRS_MULTISAMPLEANTIALIAS, FALSE); - if (material.AntiAliasing & (EAAM_LINE_SMOOTH)) - pID3DDevice->SetRenderState(D3DRS_ANTIALIASEDLINEENABLE, TRUE); - else if (lastmaterial.AntiAliasing & (EAAM_LINE_SMOOTH)) - pID3DDevice->SetRenderState(D3DRS_ANTIALIASEDLINEENABLE, FALSE); - } - } - - // thickness - if (resetAllRenderstates || lastmaterial.Thickness != material.Thickness) - { - pID3DDevice->SetRenderState(D3DRS_POINTSIZE, F2DW(material.Thickness)); - } - - // texture address mode - for (u32 st=0; st<MaxTextureUnits; ++st) - { - if (resetAllRenderstates && Params.HandleSRGB) - pID3DDevice->SetSamplerState(st, D3DSAMP_SRGBTEXTURE, TRUE); - - if (resetAllRenderstates || lastmaterial.TextureLayer[st].LODBias != material.TextureLayer[st].LODBias) - { - const float tmp = material.TextureLayer[st].LODBias * 0.125f; - pID3DDevice->SetSamplerState(st, D3DSAMP_MIPMAPLODBIAS, F2DW(tmp)); - } - - if (resetAllRenderstates || lastmaterial.TextureLayer[st].TextureWrapU != material.TextureLayer[st].TextureWrapU) - pID3DDevice->SetSamplerState(st, D3DSAMP_ADDRESSU, getTextureWrapMode(material.TextureLayer[st].TextureWrapU)); - // If separate UV not supported reuse U for V - if (!(Caps.TextureAddressCaps & D3DPTADDRESSCAPS_INDEPENDENTUV)) - { - pID3DDevice->SetSamplerState(st, D3DSAMP_ADDRESSV, getTextureWrapMode(material.TextureLayer[st].TextureWrapU)); - pID3DDevice->SetSamplerState(st, D3DSAMP_ADDRESSW, getTextureWrapMode(material.TextureLayer[st].TextureWrapU)); - } - else - { - if (resetAllRenderstates || lastmaterial.TextureLayer[st].TextureWrapV != material.TextureLayer[st].TextureWrapV) - pID3DDevice->SetSamplerState(st, D3DSAMP_ADDRESSV, getTextureWrapMode(material.TextureLayer[st].TextureWrapV)); - - if (resetAllRenderstates || lastmaterial.TextureLayer[st].TextureWrapW != material.TextureLayer[st].TextureWrapW) - pID3DDevice->SetSamplerState(st, D3DSAMP_ADDRESSW, getTextureWrapMode(material.TextureLayer[st].TextureWrapW)); - } - - // Bilinear, trilinear, and anisotropic filter - if (resetAllRenderstates || - lastmaterial.TextureLayer[st].BilinearFilter != material.TextureLayer[st].BilinearFilter || - lastmaterial.TextureLayer[st].TrilinearFilter != material.TextureLayer[st].TrilinearFilter || - lastmaterial.TextureLayer[st].AnisotropicFilter != material.TextureLayer[st].AnisotropicFilter || - lastmaterial.UseMipMaps != material.UseMipMaps) - { - if (material.TextureLayer[st].BilinearFilter || material.TextureLayer[st].TrilinearFilter || material.TextureLayer[st].AnisotropicFilter) - { - D3DTEXTUREFILTERTYPE tftMag = ((Caps.TextureFilterCaps & D3DPTFILTERCAPS_MAGFANISOTROPIC) && - material.TextureLayer[st].AnisotropicFilter) ? D3DTEXF_ANISOTROPIC : D3DTEXF_LINEAR; - D3DTEXTUREFILTERTYPE tftMin = ((Caps.TextureFilterCaps & D3DPTFILTERCAPS_MINFANISOTROPIC) && - material.TextureLayer[st].AnisotropicFilter) ? D3DTEXF_ANISOTROPIC : D3DTEXF_LINEAR; - D3DTEXTUREFILTERTYPE tftMip = material.UseMipMaps? (material.TextureLayer[st].TrilinearFilter ? D3DTEXF_LINEAR : D3DTEXF_POINT) : D3DTEXF_NONE; - - if (tftMag==D3DTEXF_ANISOTROPIC || tftMin == D3DTEXF_ANISOTROPIC) - pID3DDevice->SetSamplerState(st, D3DSAMP_MAXANISOTROPY, core::min_((DWORD)material.TextureLayer[st].AnisotropicFilter, Caps.MaxAnisotropy)); - pID3DDevice->SetSamplerState(st, D3DSAMP_MAGFILTER, tftMag); - pID3DDevice->SetSamplerState(st, D3DSAMP_MINFILTER, tftMin); - pID3DDevice->SetSamplerState(st, D3DSAMP_MIPFILTER, tftMip); - } - else - { - pID3DDevice->SetSamplerState(st, D3DSAMP_MINFILTER, D3DTEXF_POINT); - pID3DDevice->SetSamplerState(st, D3DSAMP_MIPFILTER, D3DTEXF_NONE); - pID3DDevice->SetSamplerState(st, D3DSAMP_MAGFILTER, D3DTEXF_POINT); - } - } - } -} - - -//! sets the needed renderstates -void CD3D9Driver::setRenderStatesStencilShadowMode(bool zfail, u32 debugDataVisible) -{ - if ((CurrentRenderMode != ERM_SHADOW_VOLUME_ZFAIL && - CurrentRenderMode != ERM_SHADOW_VOLUME_ZPASS) || - Transformation3DChanged) - { - // unset last 3d material - if (CurrentRenderMode == ERM_3D && - static_cast<u32>(Material.MaterialType) < MaterialRenderers.size()) - { - MaterialRenderers[Material.MaterialType].Renderer->OnUnsetMaterial(); - ResetRenderStates = true; - } - // switch back the matrices - pID3DDevice->SetTransform(D3DTS_VIEW, (D3DMATRIX*)((void*)&Matrices[ETS_VIEW])); - pID3DDevice->SetTransform(D3DTS_WORLD, (D3DMATRIX*)((void*)&Matrices[ETS_WORLD])); - pID3DDevice->SetTransform(D3DTS_PROJECTION, (D3DMATRIX*)((void*)&Matrices[ETS_PROJECTION])); - - Transformation3DChanged = false; - - setActiveTexture(0,0); - setActiveTexture(1,0); - setActiveTexture(2,0); - setActiveTexture(3,0); - - pID3DDevice->SetTextureStageState(0, D3DTSS_COLOROP, D3DTOP_DISABLE); - - pID3DDevice->SetFVF(D3DFVF_XYZ); - LastVertexType = (video::E_VERTEX_TYPE)(-1); - - pID3DDevice->SetRenderState(D3DRS_ZWRITEENABLE, FALSE); - pID3DDevice->SetRenderState(D3DRS_STENCILENABLE, TRUE); - pID3DDevice->SetRenderState(D3DRS_SHADEMODE, D3DSHADE_FLAT); - //pID3DDevice->SetRenderState(D3DRS_FOGENABLE, FALSE); - //pID3DDevice->SetRenderState(D3DRS_ALPHATESTENABLE, FALSE); - - pID3DDevice->SetRenderState(D3DRS_STENCILFUNC, D3DCMP_ALWAYS); - pID3DDevice->SetRenderState(D3DRS_STENCILREF, 0x0); - pID3DDevice->SetRenderState(D3DRS_STENCILMASK, 0xffffffff); - pID3DDevice->SetRenderState(D3DRS_STENCILWRITEMASK, 0xffffffff); - - BridgeCalls->setBlend(true); - BridgeCalls->setBlendFunc(D3DBLEND_ZERO, D3DBLEND_ONE); - - pID3DDevice->SetRenderState(D3DRS_ZENABLE, TRUE); - pID3DDevice->SetRenderState(D3DRS_ZFUNC, D3DCMP_LESS); - - //if (!(debugDataVisible & (scene::EDS_SKELETON|scene::EDS_MESH_WIRE_OVERLAY))) - // pID3DDevice->SetRenderState(D3DRS_COLORWRITEENABLE, 0); - if ((debugDataVisible & scene::EDS_MESH_WIRE_OVERLAY)) - pID3DDevice->SetRenderState(D3DRS_FILLMODE, D3DFILL_WIREFRAME); - } - - if (CurrentRenderMode != ERM_SHADOW_VOLUME_ZPASS && !zfail) - { - // USE THE ZPASS METHOD - pID3DDevice->SetRenderState(D3DRS_STENCILFAIL, D3DSTENCILOP_KEEP); - pID3DDevice->SetRenderState(D3DRS_STENCILZFAIL, D3DSTENCILOP_KEEP); - //pID3DDevice->SetRenderState(D3DRS_STENCILPASS, D3DSTENCILOP_INCR); // does not matter, will be set later - } - else - if (CurrentRenderMode != ERM_SHADOW_VOLUME_ZFAIL && zfail) - { - // USE THE ZFAIL METHOD - pID3DDevice->SetRenderState(D3DRS_STENCILFAIL, D3DSTENCILOP_KEEP); - //pID3DDevice->SetRenderState(D3DRS_STENCILZFAIL, D3DSTENCILOP_INCR); // does not matter, will be set later - pID3DDevice->SetRenderState(D3DRS_STENCILPASS, D3DSTENCILOP_KEEP); - } - - CurrentRenderMode = zfail ? ERM_SHADOW_VOLUME_ZFAIL : ERM_SHADOW_VOLUME_ZPASS; -} - - -//! sets the needed renderstates -void CD3D9Driver::setRenderStatesStencilFillMode(bool alpha) -{ - if (CurrentRenderMode != ERM_STENCIL_FILL || Transformation3DChanged) - { - core::matrix4 mat; - pID3DDevice->SetTransform(D3DTS_VIEW, &UnitMatrixD3D9); - pID3DDevice->SetTransform(D3DTS_WORLD, &UnitMatrixD3D9); - pID3DDevice->SetTransform(D3DTS_PROJECTION, &UnitMatrixD3D9); - - pID3DDevice->SetRenderState(D3DRS_ZENABLE, FALSE); - pID3DDevice->SetRenderState(D3DRS_LIGHTING, FALSE); - pID3DDevice->SetRenderState(D3DRS_FOGENABLE, FALSE); - - pID3DDevice->SetTextureStageState(1, D3DTSS_COLOROP, D3DTOP_DISABLE); - - pID3DDevice->SetRenderState(D3DRS_STENCILREF, 0x1); - pID3DDevice->SetRenderState(D3DRS_STENCILFUNC, D3DCMP_LESSEQUAL); - //pID3DDevice->SetRenderState(D3DRS_STENCILFUNC, D3DCMP_GREATEREQUAL); - pID3DDevice->SetRenderState(D3DRS_STENCILFAIL, D3DSTENCILOP_KEEP); - pID3DDevice->SetRenderState(D3DRS_STENCILZFAIL, D3DSTENCILOP_KEEP); - pID3DDevice->SetRenderState(D3DRS_STENCILPASS, D3DSTENCILOP_KEEP); - pID3DDevice->SetRenderState(D3DRS_STENCILMASK, 0xffffffff); - pID3DDevice->SetRenderState(D3DRS_STENCILWRITEMASK, 0xffffffff); - - pID3DDevice->SetRenderState(D3DRS_CULLMODE, D3DCULL_CCW); - - Transformation3DChanged = false; - - pID3DDevice->SetTextureStageState(0, D3DTSS_COLOROP, D3DTOP_MODULATE); - pID3DDevice->SetTextureStageState(0, D3DTSS_COLORARG1, D3DTA_TEXTURE); - pID3DDevice->SetTextureStageState(0, D3DTSS_COLORARG2, D3DTA_DIFFUSE); - pID3DDevice->SetTextureStageState(0, D3DTSS_ALPHAOP, D3DTOP_SELECTARG1); - pID3DDevice->SetTextureStageState(0, D3DTSS_ALPHAARG1, D3DTA_DIFFUSE); - if (alpha) - { - BridgeCalls->setBlend(true); - BridgeCalls->setBlendFunc(D3DBLEND_SRCALPHA, D3DBLEND_INVSRCALPHA); - } - else - { - BridgeCalls->setBlend(false); - } - } - - CurrentRenderMode = ERM_STENCIL_FILL; -} - - -//! Enable the 2d override material -void CD3D9Driver::enableMaterial2D(bool enable) -{ - if (!enable) - CurrentRenderMode = ERM_NONE; - CNullDriver::enableMaterial2D(enable); -} - - -//! sets the needed renderstates -void CD3D9Driver::setRenderStates2DMode(bool alpha, bool texture, bool alphaChannel) -{ - if (!pID3DDevice) - return; - - if (CurrentRenderMode != ERM_2D || Transformation3DChanged) - { - // unset last 3d material - if (CurrentRenderMode == ERM_3D) - { - if (static_cast<u32>(LastMaterial.MaterialType) < MaterialRenderers.size()) - MaterialRenderers[LastMaterial.MaterialType].Renderer->OnUnsetMaterial(); - } - if (!OverrideMaterial2DEnabled) - { - setBasicRenderStates(InitMaterial2D, LastMaterial, true); - LastMaterial=InitMaterial2D; - - // fix everything that is wrongly set by InitMaterial2D default - pID3DDevice->SetTextureStageState(1, D3DTSS_COLOROP, D3DTOP_DISABLE); - - pID3DDevice->SetRenderState(D3DRS_STENCILENABLE, FALSE); - } - core::matrix4 m; -// this fixes some problems with pixel exact rendering, but also breaks nice texturing -// moreover, it would have to be tested in each call, as the texture flag can change each time -// if (!texture) -// m.setTranslation(core::vector3df(0.5f,0.5f,0)); - pID3DDevice->SetTransform(D3DTS_WORLD, (D3DMATRIX*)((void*)m.pointer())); - - // adjust the view such that pixel center aligns with texels - // Otherwise, subpixel artifacts will occur - m.setTranslation(core::vector3df(-0.5f,-0.5f,0)); - pID3DDevice->SetTransform(D3DTS_VIEW, (D3DMATRIX*)((void*)m.pointer())); - - const core::dimension2d<u32>& renderTargetSize = getCurrentRenderTargetSize(); - m.buildProjectionMatrixOrthoLH(f32(renderTargetSize.Width), f32(-(s32)(renderTargetSize.Height)), -1.0, 1.0); - m.setTranslation(core::vector3df(-1,1,0)); - pID3DDevice->SetTransform(D3DTS_PROJECTION, (D3DMATRIX*)((void*)m.pointer())); - - // 2d elements are clipped in software - pID3DDevice->SetRenderState(D3DRS_CLIPPING, FALSE); - - Transformation3DChanged = false; - } - if (OverrideMaterial2DEnabled) - { - OverrideMaterial2D.Lighting=false; - setBasicRenderStates(OverrideMaterial2D, LastMaterial, false); - LastMaterial = OverrideMaterial2D; - } - - // no alphaChannel without texture - alphaChannel &= texture; - - if (alpha || alphaChannel) - { - BridgeCalls->setBlend(true); - BridgeCalls->setBlendFunc(D3DBLEND_SRCALPHA, D3DBLEND_INVSRCALPHA); - } - else - BridgeCalls->setBlend(false); - pID3DDevice->SetTextureStageState(0, D3DTSS_COLOROP, D3DTOP_MODULATE); - pID3DDevice->SetTextureStageState(0, D3DTSS_COLORARG1, D3DTA_TEXTURE); - pID3DDevice->SetTextureStageState(0, D3DTSS_COLORARG2, D3DTA_DIFFUSE); - if (texture) - { - setTransform(ETS_TEXTURE_0, core::IdentityMatrix); - // Due to the transformation change, the previous line would call a reset each frame - // but we can safely reset the variable as it was false before - Transformation3DChanged=false; - } - if (alphaChannel) - { - pID3DDevice->SetTextureStageState(0, D3DTSS_ALPHAARG1, D3DTA_TEXTURE); - - if (alpha) - { - pID3DDevice->SetTextureStageState(0, D3DTSS_ALPHAOP, D3DTOP_MODULATE); - pID3DDevice->SetTextureStageState(0, D3DTSS_ALPHAARG2, D3DTA_DIFFUSE); - } - else - { - pID3DDevice->SetTextureStageState(0, D3DTSS_ALPHAOP, D3DTOP_SELECTARG1); - } - } - else - { - pID3DDevice->SetTextureStageState(0, D3DTSS_ALPHAARG2, D3DTA_DIFFUSE); - if (alpha) - { - pID3DDevice->SetTextureStageState(0, D3DTSS_ALPHAOP, D3DTOP_SELECTARG2); - } - else - { - pID3DDevice->SetTextureStageState(0, D3DTSS_ALPHAARG1, D3DTA_TEXTURE); - pID3DDevice->SetTextureStageState(0, D3DTSS_ALPHAOP, D3DTOP_MODULATE); - } - } - - CurrentRenderMode = ERM_2D; -} - - -//! deletes all dynamic lights there are -void CD3D9Driver::deleteAllDynamicLights() -{ - for (s32 i=0; i<LastSetLight+1; ++i) - pID3DDevice->LightEnable(i, false); - - LastSetLight = -1; - - CNullDriver::deleteAllDynamicLights(); -} - - -//! adds a dynamic light -s32 CD3D9Driver::addDynamicLight(const SLight& dl) -{ - CNullDriver::addDynamicLight(dl); - - D3DLIGHT9 light; - - switch (dl.Type) - { - case ELT_POINT: - light.Type = D3DLIGHT_POINT; - break; - case ELT_SPOT: - light.Type = D3DLIGHT_SPOT; - break; - case ELT_DIRECTIONAL: - light.Type = D3DLIGHT_DIRECTIONAL; - break; - } - - light.Position = *(D3DVECTOR*)((void*)(&dl.Position)); - light.Direction = *(D3DVECTOR*)((void*)(&dl.Direction)); - - light.Range = core::min_(dl.Radius, MaxLightDistance); - light.Falloff = dl.Falloff; - - light.Diffuse = *(D3DCOLORVALUE*)((void*)(&dl.DiffuseColor)); - light.Specular = *(D3DCOLORVALUE*)((void*)(&dl.SpecularColor)); - light.Ambient = *(D3DCOLORVALUE*)((void*)(&dl.AmbientColor)); - - light.Attenuation0 = dl.Attenuation.X; - light.Attenuation1 = dl.Attenuation.Y; - light.Attenuation2 = dl.Attenuation.Z; - - light.Theta = dl.InnerCone * 2.0f * core::DEGTORAD; - light.Phi = dl.OuterCone * 2.0f * core::DEGTORAD; - - ++LastSetLight; - - if(D3D_OK == pID3DDevice->SetLight(LastSetLight, &light)) - { - // I don't care if this succeeds - (void)pID3DDevice->LightEnable(LastSetLight, true); - return LastSetLight; - } - - return -1; -} - -//! Turns a dynamic light on or off -//! \param lightIndex: the index returned by addDynamicLight -//! \param turnOn: true to turn the light on, false to turn it off -void CD3D9Driver::turnLightOn(s32 lightIndex, bool turnOn) -{ - if(lightIndex < 0 || lightIndex > LastSetLight) - return; - - (void)pID3DDevice->LightEnable(lightIndex, turnOn); -} - - -//! returns the maximal amount of dynamic lights the device can handle -u32 CD3D9Driver::getMaximalDynamicLightAmount() const -{ - return Caps.MaxActiveLights; -} - - -//! Sets the dynamic ambient light color. The default color is -//! (0,0,0,0) which means it is dark. -//! \param color: New color of the ambient light. -void CD3D9Driver::setAmbientLight(const SColorf& color) -{ - CNullDriver::setAmbientLight(color); - - if (!pID3DDevice) - return; - - D3DCOLOR col = color.toSColor().color; - pID3DDevice->SetRenderState(D3DRS_AMBIENT, col); -} - - -//! \return Returns the name of the video driver. Example: In case of the DIRECT3D9 -//! driver, it would return "Direct3D9.0". -const wchar_t* CD3D9Driver::getName() const -{ - return L"Direct3D 9.0"; -} - - -//! Draws a shadow volume into the stencil buffer. To draw a stencil shadow, do -//! this: First, draw all geometry. Then use this method, to draw the shadow -//! volume. Then, use IVideoDriver::drawStencilShadow() to visualize the shadow. -void CD3D9Driver::drawStencilShadowVolume(const core::array<core::vector3df>& triangles, bool zfail, u32 debugDataVisible) -{ - if (!Params.Stencilbuffer) - return; - - setRenderStatesStencilShadowMode(zfail, debugDataVisible); - - const u32 count = triangles.size(); - if (!count) - return; - - if (!zfail) - { - // ZPASS Method - - // Draw front-side of shadow volume in stencil only - pID3DDevice->SetRenderState(D3DRS_CULLMODE, D3DCULL_CCW); - pID3DDevice->SetRenderState(D3DRS_STENCILPASS, D3DSTENCILOP_INCR); - pID3DDevice->DrawPrimitiveUP(D3DPT_TRIANGLELIST, count / 3, triangles.const_pointer(), sizeof(core::vector3df)); - - // Now reverse cull order so front sides of shadow volume are written. - pID3DDevice->SetRenderState(D3DRS_CULLMODE, D3DCULL_CW); - pID3DDevice->SetRenderState(D3DRS_STENCILPASS, D3DSTENCILOP_DECR); - pID3DDevice->DrawPrimitiveUP(D3DPT_TRIANGLELIST, count / 3, triangles.const_pointer(), sizeof(core::vector3df)); - } - else - { - // ZFAIL Method - - // Draw front-side of shadow volume in stencil only - pID3DDevice->SetRenderState(D3DRS_CULLMODE, D3DCULL_CW); - pID3DDevice->SetRenderState(D3DRS_STENCILZFAIL, D3DSTENCILOP_INCR); - pID3DDevice->DrawPrimitiveUP(D3DPT_TRIANGLELIST, count / 3, triangles.const_pointer(), sizeof(core::vector3df)); - - // Now reverse cull order so front sides of shadow volume are written. - pID3DDevice->SetRenderState( D3DRS_CULLMODE, D3DCULL_CCW); - pID3DDevice->SetRenderState( D3DRS_STENCILZFAIL, D3DSTENCILOP_DECR); - pID3DDevice->DrawPrimitiveUP(D3DPT_TRIANGLELIST, count / 3, triangles.const_pointer(), sizeof(core::vector3df)); - } -} - - -//! Fills the stencil shadow with color. After the shadow volume has been drawn -//! into the stencil buffer using IVideoDriver::drawStencilShadowVolume(), use this -//! to draw the color of the shadow. -void CD3D9Driver::drawStencilShadow(bool clearStencilBuffer, video::SColor leftUpEdge, - video::SColor rightUpEdge, video::SColor leftDownEdge, video::SColor rightDownEdge) -{ - if (!Params.Stencilbuffer) - return; - - S3DVertex vtx[4]; - vtx[0] = S3DVertex(1.0f, 1.0f, 0.0f, 0.0f, 0.0f, 0.0f, leftUpEdge, 0.0f, 0.0f); - vtx[1] = S3DVertex(1.0f, -1.0f, 0.0f, 0.0f, 0.0f, 0.0f, rightUpEdge, 0.0f, 1.0f); - vtx[2] = S3DVertex(-1.0f, 1.0f, 0.0f, 0.0f, 0.0f, 0.0f, leftDownEdge, 1.0f, 0.0f); - vtx[3] = S3DVertex(-1.0f, -1.0f, 0.0f, 0.0f, 0.0f, 0.0f, rightDownEdge, 1.0f, 1.0f); - - s16 indices[6] = {0,1,2,1,3,2}; - - setRenderStatesStencilFillMode( - leftUpEdge.getAlpha() < 255 || - rightUpEdge.getAlpha() < 255 || - leftDownEdge.getAlpha() < 255 || - rightDownEdge.getAlpha() < 255); - - setActiveTexture(0,0); - - setVertexShader(EVT_STANDARD); - - pID3DDevice->DrawIndexedPrimitiveUP(D3DPT_TRIANGLELIST, 0, 4, 2, &indices[0], - D3DFMT_INDEX16, &vtx[0], sizeof(S3DVertex)); - - if (clearStencilBuffer) - pID3DDevice->Clear( 0, NULL, D3DCLEAR_STENCIL,0, 1.0, 0); -} - - -//! Returns the maximum amount of primitives (mostly vertices) which -//! the device is able to render with one drawIndexedTriangleList -//! call. -u32 CD3D9Driver::getMaximalPrimitiveCount() const -{ - return Caps.MaxPrimitiveCount; -} - - -//! Sets the fog mode. -void CD3D9Driver::setFog(SColor color, E_FOG_TYPE fogType, f32 start, - f32 end, f32 density, bool pixelFog, bool rangeFog) -{ - CNullDriver::setFog(color, fogType, start, end, density, pixelFog, rangeFog); - - if (!pID3DDevice) - return; - - pID3DDevice->SetRenderState(D3DRS_FOGCOLOR, color.color); - - pID3DDevice->SetRenderState( - pixelFog ? D3DRS_FOGTABLEMODE : D3DRS_FOGVERTEXMODE, - (fogType==EFT_FOG_LINEAR)? D3DFOG_LINEAR : (fogType==EFT_FOG_EXP)?D3DFOG_EXP:D3DFOG_EXP2); - - if (fogType==EFT_FOG_LINEAR) - { - pID3DDevice->SetRenderState(D3DRS_FOGSTART, F2DW(start)); - pID3DDevice->SetRenderState(D3DRS_FOGEND, F2DW(end)); - } - else - pID3DDevice->SetRenderState(D3DRS_FOGDENSITY, F2DW(density)); - - if(!pixelFog) - pID3DDevice->SetRenderState(D3DRS_RANGEFOGENABLE, rangeFog); -} - - -//! Draws a 3d line. -void CD3D9Driver::draw3DLine(const core::vector3df& start, - const core::vector3df& end, SColor color) -{ - setVertexShader(EVT_STANDARD); - setRenderStates3DMode(); - video::S3DVertex v[2]; - v[0].Color = color; - v[1].Color = color; - v[0].Pos = start; - v[1].Pos = end; - - pID3DDevice->DrawPrimitiveUP(D3DPT_LINELIST, 1, v, sizeof(S3DVertex)); -} - -void CD3D9Driver::draw3DBox( const core::aabbox3d<f32>& box, SColor color) -{ - core::vector3df edges[8]; - box.getEdges(edges); - - setVertexShader(EVT_STANDARD); - setRenderStates3DMode(); - - video::S3DVertex v[24]; - - for(u32 i = 0; i < 24; i++) - v[i].Color = color; - - v[0].Pos = edges[5]; - v[1].Pos = edges[1]; - v[2].Pos = edges[1]; - v[3].Pos = edges[3]; - v[4].Pos = edges[3]; - v[5].Pos = edges[7]; - v[6].Pos = edges[7]; - v[7].Pos = edges[5]; - v[8].Pos = edges[0]; - v[9].Pos = edges[2]; - v[10].Pos = edges[2]; - v[11].Pos = edges[6]; - v[12].Pos = edges[6]; - v[13].Pos = edges[4]; - v[14].Pos = edges[4]; - v[15].Pos = edges[0]; - v[16].Pos = edges[1]; - v[17].Pos = edges[0]; - v[18].Pos = edges[3]; - v[19].Pos = edges[2]; - v[20].Pos = edges[7]; - v[21].Pos = edges[6]; - v[22].Pos = edges[5]; - v[23].Pos = edges[4]; - - pID3DDevice->DrawPrimitiveUP(D3DPT_LINELIST, 12, v, sizeof(S3DVertex)); -} - -bool CD3D9Driver::retrieveDevice(int numTries, int msSleepBetweenTries) -{ - while ( numTries > 0) - { - HRESULT hr; - if ( FAILED(hr = pID3DDevice->TestCooperativeLevel()) ) - { - // hr can be: D3DERR_DEVICELOST, D3DERR_DEVICENOTRESET or D3DERR_DRIVERINTERNALERROR - switch ( hr ) - { - case D3DERR_DEVICENOTRESET: - if ( reset() ) - return true; - // when reset fails, just try again, maybe device got lost in between TestCooperativeLevel and reset calls? - break; - case D3DERR_DEVICELOST: - break; - case D3DERR_DRIVERINTERNALERROR: - return false; - } - - Sleep(msSleepBetweenTries); - --numTries; - } - else - return true; - } - return false; -} - -//! resets the device -bool CD3D9Driver::reset() -{ - os::Printer::log("Resetting D3D9 device.", ELL_INFORMATION); - - for (u32 i = 0; i<RenderTargets.size(); ++i) - { - if (RenderTargets[i]->getDriverType() == EDT_DIRECT3D9) - { - static_cast<CD3D9RenderTarget*>(RenderTargets[i])->releaseSurfaces(); - - const core::array<ITexture*> texArray = RenderTargets[i]->getTexture(); - - for (u32 j = 0; j < texArray.size(); ++j) - { - CD3D9Texture* tex = static_cast<CD3D9Texture*>(texArray[j]); - - if (tex) - tex->releaseTexture(); - } - - CD3D9Texture* tex = static_cast<CD3D9Texture*>(RenderTargets[i]->getDepthStencil()); - - if (tex) - tex->releaseTexture(); - } - } - for (u32 i=0; i<Textures.size(); ++i) - { - if (Textures[i].Surface->isRenderTarget()) - { - CD3D9Texture* tex = static_cast<CD3D9Texture*>(Textures[i].Surface); - - if (tex) - tex->releaseTexture(); - } - } - for (u32 i=0; i<OcclusionQueries.size(); ++i) - { - if (OcclusionQueries[i].PID) - { - reinterpret_cast<IDirect3DQuery9*>(OcclusionQueries[i].PID)->Release(); - OcclusionQueries[i].PID=0; - } - } - // this does not require a restore in the reset method, it's updated - // automatically in the next render cycle. - removeAllHardwareBuffers(); - - // reset render target usage information. - for (u32 i = 0; i < ActiveRenderTarget.size(); ++i) - ActiveRenderTarget[i] = false; - - if (DepthStencilSurface) - { - DepthStencilSurface->Release(); - DepthStencilSurface = 0; - } - - if (BackBufferSurface) - { - BackBufferSurface->Release(); - BackBufferSurface = 0; - } - - DriverWasReset=true; - - HRESULT hr = pID3DDevice->Reset(&present); - if (FAILED(hr)) - { - if (hr == D3DERR_DEVICELOST) - { - DeviceLost = true; - os::Printer::log("Resetting failed due to device lost.", ELL_WARNING); - } -#ifdef D3DERR_DEVICEREMOVED - else if (hr == D3DERR_DEVICEREMOVED) - { - os::Printer::log("Resetting failed due to device removed.", ELL_WARNING); - } -#endif - else if (hr == D3DERR_DRIVERINTERNALERROR) - { - os::Printer::log("Resetting failed due to internal error.", ELL_WARNING); - } - else if (hr == D3DERR_OUTOFVIDEOMEMORY) - { - os::Printer::log("Resetting failed due to out of memory.", ELL_WARNING); - } - else if (hr == D3DERR_DEVICENOTRESET) - { - os::Printer::log("Resetting failed due to not reset.", ELL_WARNING); - } - else if (hr == D3DERR_INVALIDCALL) - { - os::Printer::log("Resetting failed due to invalid call", "You need to release some more surfaces.", ELL_WARNING); - } - else - { - os::Printer::log("Resetting failed due to unknown reason.", core::stringc((int)hr).c_str(), ELL_WARNING); - } - return false; - } - DeviceLost = false; - - // reset bridge calls. - if (BridgeCalls) - BridgeCalls->reset(); - - // restore screen depthbuffer descriptor - if (!SUCCEEDED(pID3DDevice->GetDepthStencilSurface(&DepthStencilSurface))) - { - os::Printer::log("Was not able to get main depth buffer.", ELL_ERROR); - return false; - } - - // restore RTTs - for (u32 i=0; i<Textures.size(); ++i) - { - if (Textures[i].Surface->isRenderTarget()) - ((CD3D9Texture*)(Textures[i].Surface))->generateRenderTarget(); - } - for (u32 i = 0; i<RenderTargets.size(); ++i) - { - if (RenderTargets[i]->getDriverType() == EDT_DIRECT3D9) - { - const core::array<ITexture*> texArray = RenderTargets[i]->getTexture(); - - for (u32 j = 0; j < texArray.size(); ++j) - { - CD3D9Texture* tex = static_cast<CD3D9Texture*>(texArray[j]); - - if (tex) - tex->generateRenderTarget(); - } - - CD3D9Texture* tex = static_cast<CD3D9Texture*>(RenderTargets[i]->getDepthStencil()); - - if (tex) - tex->generateRenderTarget(); - - static_cast<CD3D9RenderTarget*>(RenderTargets[i])->generateSurfaces(); - } - } - - // restore occlusion queries - for (u32 i=0; i<OcclusionQueries.size(); ++i) - { - pID3DDevice->CreateQuery(D3DQUERYTYPE_OCCLUSION, reinterpret_cast<IDirect3DQuery9**>(&OcclusionQueries[i].PID)); - } - - ResetRenderStates = true; - LastVertexType = (E_VERTEX_TYPE)-1; - - for (u32 i=0; i<MATERIAL_MAX_TEXTURES; ++i) - CurrentTexture[i] = 0; - - setVertexShader(EVT_STANDARD); - setRenderStates3DMode(); - setFog(FogColor, FogType, FogStart, FogEnd, FogDensity, PixelFog, RangeFog); - setAmbientLight(getAmbientLight()); - - return true; -} - - -void CD3D9Driver::OnResize(const core::dimension2d<u32>& size) -{ - if (!pID3DDevice) - return; - - CNullDriver::OnResize(size); - present.BackBufferWidth = size.Width; - present.BackBufferHeight = size.Height; - - if ( !reset() ) - { - if ( !retrieveDevice(20, 200) ) // retrying for 3 seconds, I hope that's long enough? - { - os::Printer::log("Failed to retrieve device in OnResize.", ELL_ERROR); - } - } -} - - -//! Returns type of video driver -E_DRIVER_TYPE CD3D9Driver::getDriverType() const -{ - return EDT_DIRECT3D9; -} - - -//! Returns the transformation set by setTransform -const core::matrix4& CD3D9Driver::getTransform(E_TRANSFORMATION_STATE state) const -{ - return Matrices[state]; -} - - -//! Get a vertex shader constant index. -s32 CD3D9Driver::getVertexShaderConstantID(const c8* name) -{ - if (Material.MaterialType >= 0 && Material.MaterialType < (s32)MaterialRenderers.size()) - { - CD3D9MaterialRenderer* r = (CD3D9MaterialRenderer*)MaterialRenderers[Material.MaterialType].Renderer; - return r->getVariableID(true, name); - } - - return -1; -} - -//! Get a pixel shader constant index. -s32 CD3D9Driver::getPixelShaderConstantID(const c8* name) -{ - if (Material.MaterialType >= 0 && Material.MaterialType < (s32)MaterialRenderers.size()) - { - CD3D9MaterialRenderer* r = (CD3D9MaterialRenderer*)MaterialRenderers[Material.MaterialType].Renderer; - return r->getVariableID(false, name); - } - - return -1; -} - - -//! Sets a vertex shader constant. -void CD3D9Driver::setVertexShaderConstant(const f32* data, s32 startRegister, s32 constantAmount) -{ - if (data) - pID3DDevice->SetVertexShaderConstantF(startRegister, data, constantAmount); -} - - -//! Sets a pixel shader constant. -void CD3D9Driver::setPixelShaderConstant(const f32* data, s32 startRegister, s32 constantAmount) -{ - if (data) - pID3DDevice->SetPixelShaderConstantF(startRegister, data, constantAmount); -} - - -//! Sets a constant for the vertex shader based on an index. -bool CD3D9Driver::setVertexShaderConstant(s32 index, const f32* floats, int count) -{ - if (Material.MaterialType >= 0 && Material.MaterialType < (s32)MaterialRenderers.size()) - { - CD3D9MaterialRenderer* r = (CD3D9MaterialRenderer*)MaterialRenderers[Material.MaterialType].Renderer; - return r->setVariable(true, index, floats, count); - } - - return false; -} - - -//! Int interface for the above. -bool CD3D9Driver::setVertexShaderConstant(s32 index, const s32* ints, int count) -{ - if (Material.MaterialType >= 0 && Material.MaterialType < (s32)MaterialRenderers.size()) - { - CD3D9MaterialRenderer* r = (CD3D9MaterialRenderer*)MaterialRenderers[Material.MaterialType].Renderer; - return r->setVariable(true, index, ints, count); - } - - return false; -} - - -//! Uint interface for the above. -bool CD3D9Driver::setVertexShaderConstant(s32 index, const u32* ints, int count) -{ - if (Material.MaterialType >= 0 && Material.MaterialType < (s32)MaterialRenderers.size()) - { - CD3D9MaterialRenderer* r = (CD3D9MaterialRenderer*)MaterialRenderers[Material.MaterialType].Renderer; - return r->setVariable(true, index, ints, count); - } - - return false; -} - - -//! Sets a constant for the pixel shader based on an index. -bool CD3D9Driver::setPixelShaderConstant(s32 index, const f32* floats, int count) -{ - if (Material.MaterialType >= 0 && Material.MaterialType < (s32)MaterialRenderers.size()) - { - CD3D9MaterialRenderer* r = (CD3D9MaterialRenderer*)MaterialRenderers[Material.MaterialType].Renderer; - return r->setVariable(false, index, floats, count); - } - - return false; -} - - -//! Int interface for the above. -bool CD3D9Driver::setPixelShaderConstant(s32 index, const s32* ints, int count) -{ - if (Material.MaterialType >= 0 && Material.MaterialType < (s32)MaterialRenderers.size()) - { - CD3D9MaterialRenderer* r = (CD3D9MaterialRenderer*)MaterialRenderers[Material.MaterialType].Renderer; - return r->setVariable(false, index, ints, count); - } - - return false; -} - - -//! Uint interface for the above. -bool CD3D9Driver::setPixelShaderConstant(s32 index, const u32* ints, int count) -{ - if (Material.MaterialType >= 0 && Material.MaterialType < (s32)MaterialRenderers.size()) - { - CD3D9MaterialRenderer* r = (CD3D9MaterialRenderer*)MaterialRenderers[Material.MaterialType].Renderer; - return r->setVariable(false, index, ints, count); - } - - return false; -} - - - -//! Adds a new material renderer to the VideoDriver, using pixel and/or -//! vertex shaders to render geometry. -s32 CD3D9Driver::addShaderMaterial(const c8* vertexShaderProgram, - const c8* pixelShaderProgram, - IShaderConstantSetCallBack* callback, - E_MATERIAL_TYPE baseMaterial, s32 userData) -{ - s32 nr = -1; - CD3D9ShaderMaterialRenderer* r = new CD3D9ShaderMaterialRenderer( - pID3DDevice, this, nr, vertexShaderProgram, pixelShaderProgram, - callback, getMaterialRenderer(baseMaterial), userData); - - r->drop(); - return nr; -} - - -//! Adds a new material renderer to the VideoDriver, based on a high level shading -//! language. -s32 CD3D9Driver::addHighLevelShaderMaterial( - const c8* vertexShaderProgram, - const c8* vertexShaderEntryPointName, - E_VERTEX_SHADER_TYPE vsCompileTarget, - const c8* pixelShaderProgram, - const c8* pixelShaderEntryPointName, - E_PIXEL_SHADER_TYPE psCompileTarget, - const c8* geometryShaderProgram, - const c8* geometryShaderEntryPointName, - E_GEOMETRY_SHADER_TYPE gsCompileTarget, - scene::E_PRIMITIVE_TYPE inType, scene::E_PRIMITIVE_TYPE outType, - u32 verticesOut, - IShaderConstantSetCallBack* callback, - E_MATERIAL_TYPE baseMaterial, s32 userData) -{ - s32 nr = -1; - - CD3D9HLSLMaterialRenderer* r = new CD3D9HLSLMaterialRenderer( - pID3DDevice, this, nr, - vertexShaderProgram, - vertexShaderEntryPointName, - vsCompileTarget, - pixelShaderProgram, - pixelShaderEntryPointName, - psCompileTarget, - callback, - getMaterialRenderer(baseMaterial), - userData); - - r->drop(); - - return nr; -} - - -//! Returns a pointer to the IVideoDriver interface. (Implementation for -//! IMaterialRendererServices) -IVideoDriver* CD3D9Driver::getVideoDriver() -{ - return this; -} - - -//! Creates a render target texture. -ITexture* CD3D9Driver::addRenderTargetTexture(const core::dimension2d<u32>& size, - const io::path& name, - const ECOLOR_FORMAT format) -{ - if ( IImage::isCompressedFormat(format) ) - return 0; - - CD3D9Texture* tex = new CD3D9Texture(this, size, name, ETT_2D, format); - if (tex) - { - if (!tex->Texture) - { - tex->drop(); - return 0; - } - - addTexture(tex); - tex->drop(); - } - return tex; -} - -ITexture* CD3D9Driver::addRenderTargetTextureCubemap(const irr::u32 sideLen, - const io::path& name, const ECOLOR_FORMAT format) -{ - if ( IImage::isCompressedFormat(format) ) - return 0; - - CD3D9Texture* tex = new CD3D9Texture(this, core::dimension2d<u32>(sideLen, sideLen), name, ETT_CUBEMAP, format); - if (tex) - { - if (!tex->CubeTexture) - { - tex->drop(); - return 0; - } - - addTexture(tex); - tex->drop(); - } - return tex; -} - -void CD3D9Driver::clearBuffers(u16 flag, SColor color, f32 depth, u8 stencil) -{ - DWORD internalFlag = 0; - - if (flag & ECBF_COLOR) - internalFlag |= D3DCLEAR_TARGET; - - if (flag & ECBF_DEPTH) - internalFlag |= D3DCLEAR_ZBUFFER; - - if (flag & ECBF_STENCIL) - internalFlag |= D3DCLEAR_STENCIL; - - if (internalFlag) - { - HRESULT hr = pID3DDevice->Clear(0, NULL, internalFlag, color.color, depth, stencil); - - if (FAILED(hr)) - os::Printer::log("DIRECT3D9 clear failed.", ELL_WARNING); - } -} - - -//! Returns an image created from the last rendered frame. -IImage* CD3D9Driver::createScreenShot(video::ECOLOR_FORMAT format, video::E_RENDER_TARGET target) -{ - if (target != video::ERT_FRAME_BUFFER) - return 0; - - if (format==video::ECF_UNKNOWN) - format=getColorFormat(); - - // TODO: Maybe we could support more formats (floating point and some of those beyond ECF_R8), didn't really try yet - if (IImage::isCompressedFormat(format) || IImage::isDepthFormat(format) || IImage::isFloatingPointFormat(format) || format >= ECF_R8) - return 0; - - // query the screen dimensions of the current adapter - D3DDISPLAYMODE displayMode; - pID3DDevice->GetDisplayMode(0, &displayMode); - - // create the image surface to store the front buffer image [always A8R8G8B8] - HRESULT hr; - LPDIRECT3DSURFACE9 lpSurface; - if (FAILED(hr = pID3DDevice->CreateOffscreenPlainSurface(displayMode.Width, displayMode.Height, D3DFMT_A8R8G8B8, D3DPOOL_SCRATCH, &lpSurface, 0))) - return 0; - - // read the front buffer into the image surface - if (FAILED(hr = pID3DDevice->GetFrontBufferData(0, lpSurface))) - { - lpSurface->Release(); - return 0; - } - - RECT clientRect; - { - POINT clientPoint; - clientPoint.x = 0; - clientPoint.y = 0; - - ClientToScreen((HWND)getExposedVideoData().D3D9.HWnd, &clientPoint); - - clientRect.left = clientPoint.x; - clientRect.top = clientPoint.y; - clientRect.right = clientRect.left + ScreenSize.Width; - clientRect.bottom = clientRect.top + ScreenSize.Height; - - // window can be off-screen partly, we can't take screenshots from that - clientRect.left = core::max_(clientRect.left, 0l); - clientRect.top = core::max_(clientRect.top, 0l); - clientRect.right = core::min_(clientRect.right, (long)displayMode.Width); - clientRect.bottom = core::min_(clientRect.bottom, (long)displayMode.Height ); - } - - // lock our area of the surface - D3DLOCKED_RECT lockedRect; - if (FAILED(lpSurface->LockRect(&lockedRect, &clientRect, D3DLOCK_READONLY))) - { - lpSurface->Release(); - return 0; - } - - irr::core::dimension2d<u32> shotSize; - shotSize.Width = core::min_( ScreenSize.Width, (u32)(clientRect.right-clientRect.left) ); - shotSize.Height = core::min_( ScreenSize.Height, (u32)(clientRect.bottom-clientRect.top) ); - - // this could throw, but we aren't going to worry about that case very much - IImage* newImage = createImage(format, shotSize); - - if (newImage) - { - // d3d pads the image, so we need to copy the correct number of bytes - u32* dP = (u32*)newImage->lock(); - u8 * sP = (u8 *)lockedRect.pBits; - - // If the display mode format doesn't promise anything about the Alpha value - // and it appears that it's not presenting 255, then we should manually - // set each pixel alpha value to 255. - if (D3DFMT_X8R8G8B8 == displayMode.Format && (0xFF000000 != (*dP & 0xFF000000))) - { - for (u32 y = 0; y < shotSize.Height; ++y) - { - for (u32 x = 0; x < shotSize.Width; ++x) - { - newImage->setPixel(x,y,*((u32*)sP) | 0xFF000000); - sP += 4; - } - - sP += lockedRect.Pitch - (4 * shotSize.Width); - } - } - else - { - for (u32 y = 0; y < shotSize.Height; ++y) - { - convertColor(sP, video::ECF_A8R8G8B8, shotSize.Width, dP, format); - sP += lockedRect.Pitch; - dP += shotSize.Width; - } - } - - newImage->unlock(); - } - - // we can unlock and release the surface - lpSurface->UnlockRect(); - - // release the image surface - lpSurface->Release(); - - // return status of save operation to caller - return newImage; -} - - -//! returns color format -ECOLOR_FORMAT CD3D9Driver::getColorFormat() const -{ - return ColorFormat; -} - - -//! returns color format -D3DFORMAT CD3D9Driver::getD3DColorFormat() const -{ - return D3DColorFormat; -} - - -// Set/unset a clipping plane. -bool CD3D9Driver::setClipPlane(u32 index, const core::plane3df& plane, bool enable) -{ - if (index >= MaxUserClipPlanes) - return false; - - HRESULT ok = pID3DDevice->SetClipPlane(index, (const float*)&(plane.Normal.X)); - if (D3D_OK == ok) - enableClipPlane(index, enable); - return true; -} - - -// Enable/disable a clipping plane. -void CD3D9Driver::enableClipPlane(u32 index, bool enable) -{ - if (index >= MaxUserClipPlanes) - return; - DWORD renderstate; - HRESULT ok = pID3DDevice->GetRenderState(D3DRS_CLIPPLANEENABLE, &renderstate); - if (S_OK == ok) - { - if (enable) - renderstate |= (1 << index); - else - renderstate &= ~(1 << index); - ok = pID3DDevice->SetRenderState(D3DRS_CLIPPLANEENABLE, renderstate); - } -} - - -D3DFORMAT CD3D9Driver::getD3DFormatFromColorFormat(ECOLOR_FORMAT format) const -{ - switch(format) - { - case ECF_A1R5G5B5: - return D3DFMT_A1R5G5B5; - case ECF_R5G6B5: - return D3DFMT_R5G6B5; - case ECF_R8G8B8: - return D3DFMT_R8G8B8; - case ECF_A8R8G8B8: - return D3DFMT_A8R8G8B8; - - case ECF_DXT1: - return D3DFMT_DXT1; - case ECF_DXT2: - return D3DFMT_DXT2; - case ECF_DXT3: - return D3DFMT_DXT3; - case ECF_DXT4: - return D3DFMT_DXT4; - case ECF_DXT5: - return D3DFMT_DXT5; - case ECF_R16F: - return D3DFMT_R16F; - case ECF_G16R16F: - return D3DFMT_G16R16F; - case ECF_A16B16G16R16F: - return D3DFMT_A16B16G16R16F; - case ECF_R32F: - return D3DFMT_R32F; - case ECF_G32R32F: - return D3DFMT_G32R32F; - case ECF_A32B32G32R32F: - return D3DFMT_A32B32G32R32F; - - case ECF_R8: - return D3DFMT_A8; // not correct, but somewhat similar - case ECF_R8G8: - return D3DFMT_A8L8; // not correct, but somewhat similar - case ECF_R16: - return D3DFMT_L16; // not correct, but somewhat similar - case ECF_R16G16: - return D3DFMT_G16R16; // flipped :-( - - case ECF_D16: - return D3DFMT_D16; - case ECF_D24S8: - return D3DFMT_D24S8; - case ECF_D32: - return D3DFMT_D32; - } - return D3DFMT_UNKNOWN; -} - - -ECOLOR_FORMAT CD3D9Driver::getColorFormatFromD3DFormat(D3DFORMAT format) const -{ - switch(format) - { - case D3DFMT_X1R5G5B5: - case D3DFMT_A1R5G5B5: - return ECF_A1R5G5B5; - case D3DFMT_A8B8G8R8: - case D3DFMT_A8R8G8B8: - case D3DFMT_X8R8G8B8: - return ECF_A8R8G8B8; - case D3DFMT_R5G6B5: - return ECF_R5G6B5; - case D3DFMT_R8G8B8: - return ECF_R8G8B8; - - // Floating Point formats. Thanks to Patryk "Nadro" Nadrowski. - case D3DFMT_R16F: - return ECF_R16F; - case D3DFMT_G16R16F: - return ECF_G16R16F; - case D3DFMT_A16B16G16R16F: - return ECF_A16B16G16R16F; - case D3DFMT_R32F: - return ECF_R32F; - case D3DFMT_G32R32F: - return ECF_G32R32F; - case D3DFMT_A32B32G32R32F: - return ECF_A32B32G32R32F; - default: - return (ECOLOR_FORMAT)0; - }; -} - - -core::dimension2du CD3D9Driver::getMaxTextureSize() const -{ - return core::dimension2du(Caps.MaxTextureWidth, Caps.MaxTextureHeight); -} - -bool CD3D9Driver::queryTextureFormat(ECOLOR_FORMAT format) const -{ - return getD3DFormatFromColorFormat(format) != D3DFMT_UNKNOWN; -} - -bool CD3D9Driver::needsTransparentRenderPass(const irr::video::SMaterial& material) const -{ - return CNullDriver::needsTransparentRenderPass(material) || material.isAlphaBlendOperation(); -} - -u32 CD3D9Driver::getD3DBlend(E_BLEND_FACTOR factor) const -{ - u32 r = 0; - switch (factor) - { - case EBF_ZERO: r = D3DBLEND_ZERO; break; - case EBF_ONE: r = D3DBLEND_ONE; break; - case EBF_DST_COLOR: r = D3DBLEND_DESTCOLOR; break; - case EBF_ONE_MINUS_DST_COLOR: r = D3DBLEND_INVDESTCOLOR; break; - case EBF_SRC_COLOR: r = D3DBLEND_SRCCOLOR; break; - case EBF_ONE_MINUS_SRC_COLOR: r = D3DBLEND_INVSRCCOLOR; break; - case EBF_SRC_ALPHA: r = D3DBLEND_SRCALPHA; break; - case EBF_ONE_MINUS_SRC_ALPHA: r = D3DBLEND_INVSRCALPHA; break; - case EBF_DST_ALPHA: r = D3DBLEND_DESTALPHA; break; - case EBF_ONE_MINUS_DST_ALPHA: r = D3DBLEND_INVDESTALPHA; break; - case EBF_SRC_ALPHA_SATURATE: r = D3DBLEND_SRCALPHASAT; break; - } - return r; -} - - -u32 CD3D9Driver::getD3DModulate(E_MODULATE_FUNC func) const -{ - u32 r = D3DTOP_MODULATE; - switch (func) - { - case EMFN_MODULATE_1X: r = D3DTOP_MODULATE; break; - case EMFN_MODULATE_2X: r = D3DTOP_MODULATE2X; break; - case EMFN_MODULATE_4X: r = D3DTOP_MODULATE4X; break; - } - return r; -} - - -CD3D9CallBridge* CD3D9Driver::getBridgeCalls() const -{ - return BridgeCalls; -} - -CD3D9CallBridge::CD3D9CallBridge(IDirect3DDevice9* p, CD3D9Driver* driver) : pID3DDevice(p), - BlendOperation(D3DBLENDOP_ADD), BlendSourceRGB(D3DBLEND_ONE), BlendDestinationRGB(D3DBLEND_ZERO), - BlendSourceAlpha(D3DBLEND_ONE), BlendDestinationAlpha(D3DBLEND_ZERO), Blend(false), BlendSeparate(false), - FeatureBlendSeparate(false) -{ - FeatureBlendSeparate = driver->queryFeature(EVDF_BLEND_SEPARATE); - - reset(); -} - -void CD3D9CallBridge::reset() -{ - BlendOperation = D3DBLENDOP_ADD; - - BlendSourceRGB = D3DBLEND_ONE; - BlendDestinationRGB = D3DBLEND_ZERO; - BlendSourceAlpha = D3DBLEND_ONE; - BlendDestinationAlpha = D3DBLEND_ZERO; - - Blend = false; - BlendSeparate = false; - - pID3DDevice->SetRenderState(D3DRS_BLENDOP, D3DBLENDOP_ADD); - pID3DDevice->SetRenderState(D3DRS_SRCBLEND, D3DBLEND_ONE); - pID3DDevice->SetRenderState(D3DRS_DESTBLEND, D3DBLEND_ZERO); - pID3DDevice->SetRenderState(D3DRS_ALPHABLENDENABLE, FALSE); - - if (FeatureBlendSeparate) - { - pID3DDevice->SetRenderState(D3DRS_SRCBLENDALPHA, D3DBLEND_ONE); - pID3DDevice->SetRenderState(D3DRS_DESTBLENDALPHA, D3DBLEND_ZERO); - pID3DDevice->SetRenderState(D3DRS_SEPARATEALPHABLENDENABLE, FALSE); - } -} - -void CD3D9CallBridge::setBlendOperation(DWORD mode) -{ - if (BlendOperation != mode) - { - pID3DDevice->SetRenderState(D3DRS_BLENDOP, mode); - - BlendOperation = mode; - } -} - -void CD3D9CallBridge::setBlendFunc(DWORD source, DWORD destination) -{ - if (BlendSourceRGB != source) - { - pID3DDevice->SetRenderState(D3DRS_SRCBLEND, source); - - BlendSourceRGB = source; - } - - if (BlendDestinationRGB != destination) - { - pID3DDevice->SetRenderState(D3DRS_DESTBLEND, destination); - - BlendDestinationRGB = destination; - } - - if (FeatureBlendSeparate && BlendSeparate) - { - pID3DDevice->SetRenderState(D3DRS_SEPARATEALPHABLENDENABLE, FALSE); - - BlendSeparate = false; - } -} - -void CD3D9CallBridge::setBlendFuncSeparate(DWORD sourceRGB, DWORD destinationRGB, DWORD sourceAlpha, DWORD destinationAlpha) -{ - if (BlendSourceRGB != sourceRGB) - { - pID3DDevice->SetRenderState(D3DRS_SRCBLEND, sourceRGB); - - BlendSourceRGB = sourceRGB; - } - - if (BlendDestinationRGB != destinationRGB) - { - pID3DDevice->SetRenderState(D3DRS_DESTBLEND, destinationRGB); - - BlendDestinationRGB = destinationRGB; - } - - if (FeatureBlendSeparate) - { - if (sourceRGB != sourceAlpha || destinationRGB != destinationAlpha) - { - if (BlendSourceAlpha != sourceAlpha) - { - pID3DDevice->SetRenderState(D3DRS_SRCBLENDALPHA, sourceAlpha); - - BlendSourceAlpha = sourceAlpha; - } - - if (BlendDestinationAlpha != destinationAlpha) - { - pID3DDevice->SetRenderState(D3DRS_DESTBLENDALPHA, destinationAlpha); - - BlendDestinationAlpha = destinationAlpha; - } - - if (!BlendSeparate) - { - pID3DDevice->SetRenderState(D3DRS_SEPARATEALPHABLENDENABLE, TRUE); - - BlendSeparate = true; - } - } - else if (BlendSeparate) - { - pID3DDevice->SetRenderState(D3DRS_SEPARATEALPHABLENDENABLE, FALSE); - - BlendSeparate = false; - } - } -} - -void CD3D9CallBridge::setBlend(bool enable) -{ - if (Blend != enable) - { - if (enable) - pID3DDevice->SetRenderState(D3DRS_ALPHABLENDENABLE, TRUE); - else - pID3DDevice->SetRenderState(D3DRS_ALPHABLENDENABLE, FALSE); - - Blend = enable; - } -} - -} // end namespace video -} // end namespace irr - -#endif // _IRR_COMPILE_WITH_DIRECT3D_9_ - - - -namespace irr -{ -namespace video -{ - -#ifdef _IRR_COMPILE_WITH_DIRECT3D_9_ -//! creates a video driver -IVideoDriver* createDirectX9Driver(const SIrrlichtCreationParameters& params, - io::IFileSystem* io, HWND window) -{ - const bool pureSoftware = false; - CD3D9Driver* dx9 = new CD3D9Driver(params, io); - if (!dx9->initDriver(window, pureSoftware)) - { - dx9->drop(); - dx9 = 0; - } - - return dx9; -} -#endif // _IRR_COMPILE_WITH_DIRECT3D_9_ - -} // end namespace video -} // end namespace irr - diff --git a/source/Irrlicht/CD3D9Driver.h b/source/Irrlicht/CD3D9Driver.h deleted file mode 100644 index d28c0f43..00000000 --- a/source/Irrlicht/CD3D9Driver.h +++ /dev/null @@ -1,513 +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_VIDEO_DIRECTX_9_H_INCLUDED__ -#define __C_VIDEO_DIRECTX_9_H_INCLUDED__ - -#include "IrrCompileConfig.h" - -#ifdef _IRR_COMPILE_WITH_DIRECT3D_9_ - -#ifdef _IRR_WINDOWS_ -#define WIN32_LEAN_AND_MEAN -#include <windows.h> -#endif - -#include "CNullDriver.h" -#include "SIrrCreationParameters.h" -#include "IMaterialRendererServices.h" -#if defined(__BORLANDC__) || defined (__BCPLUSPLUS__) -#include "irrMath.h" // needed by borland for sqrtf define -#endif -#include <d3d9.h> - -namespace irr -{ -namespace video -{ - class CD3D9CallBridge; - class CD3D9RenderTarget; - class CD3D9Texture; - - class CD3D9Driver : public CNullDriver, IMaterialRendererServices - { - public: - - friend class CD3D9CallBridge; - friend class CD3D9RenderTarget; - friend class CD3D9Texture; - - //! constructor - CD3D9Driver(const SIrrlichtCreationParameters& params, io::IFileSystem* io); - - //! destructor - virtual ~CD3D9Driver(); - - virtual bool beginScene(u16 clearFlag, SColor clearColor = SColor(255,0,0,0), f32 clearDepth = 1.f, u8 clearStencil = 0, - const SExposedVideoData& videoData = SExposedVideoData(), core::rect<s32>* sourceRect = 0) _IRR_OVERRIDE_; - - virtual bool endScene() _IRR_OVERRIDE_; - - //! queries the features of the driver, returns true if feature is available - virtual bool queryFeature(E_VIDEO_DRIVER_FEATURE feature) const _IRR_OVERRIDE_; - - //! sets transformation - virtual void setTransform(E_TRANSFORMATION_STATE state, const core::matrix4& mat) _IRR_OVERRIDE_; - - //! sets a material - virtual void setMaterial(const SMaterial& material) _IRR_OVERRIDE_; - - virtual bool setRenderTargetEx(IRenderTarget* target, u16 clearFlag, SColor clearColor = SColor(255,0,0,0), - f32 clearDepth = 1.f, u8 clearStencil = 0) _IRR_OVERRIDE_; - - //! sets a viewport - virtual void setViewPort(const core::rect<s32>& area) _IRR_OVERRIDE_; - - //! gets the area of the current viewport - virtual const core::rect<s32>& getViewPort() const _IRR_OVERRIDE_; - - struct SHWBufferLink_d3d9 : public SHWBufferLink - { - SHWBufferLink_d3d9(const scene::IMeshBuffer *_MeshBuffer): - SHWBufferLink(_MeshBuffer), - vertexBuffer(0), indexBuffer(0), - vertexBufferSize(0), indexBufferSize(0) {} - - IDirect3DVertexBuffer9* vertexBuffer; - IDirect3DIndexBuffer9* indexBuffer; - - u32 vertexBufferSize; - u32 indexBufferSize; - }; - - bool updateVertexHardwareBuffer(SHWBufferLink_d3d9 *HWBuffer); - bool updateIndexHardwareBuffer(SHWBufferLink_d3d9 *HWBuffer); - - //! updates hardware buffer if needed - virtual bool updateHardwareBuffer(SHWBufferLink *HWBuffer) _IRR_OVERRIDE_; - - //! Create hardware buffer from mesh - virtual SHWBufferLink *createHardwareBuffer(const scene::IMeshBuffer* mb) _IRR_OVERRIDE_; - - //! Delete hardware buffer (only some drivers can) - virtual void deleteHardwareBuffer(SHWBufferLink *HWBuffer) _IRR_OVERRIDE_; - - //! Draw hardware buffer - virtual void drawHardwareBuffer(SHWBufferLink *HWBuffer) _IRR_OVERRIDE_; - - //! Create occlusion query. - /** Use node for identification and mesh for occlusion test. */ - virtual void addOcclusionQuery(scene::ISceneNode* node, - const scene::IMesh* mesh=0) _IRR_OVERRIDE_; - - //! Remove occlusion query. - virtual void removeOcclusionQuery(scene::ISceneNode* node) _IRR_OVERRIDE_; - - //! Run occlusion query. Draws mesh stored in query. - /** If the mesh shall not be rendered visible, use - overrideMaterial to disable the color and depth buffer. */ - virtual void runOcclusionQuery(scene::ISceneNode* node, bool visible=false) _IRR_OVERRIDE_; - - //! Update occlusion query. Retrieves results from GPU. - /** If the query shall not block, set the flag to false. - Update might not occur in this case, though */ - virtual void updateOcclusionQuery(scene::ISceneNode* node, bool block=true) _IRR_OVERRIDE_; - - //! Return query result. - /** Return value is the number of visible pixels/fragments. - The value is a safe approximation, i.e. can be larger then the - actual value of pixels. */ - virtual u32 getOcclusionQueryResult(scene::ISceneNode* node) const _IRR_OVERRIDE_; - - //! Create render target. - virtual IRenderTarget* addRenderTarget() _IRR_OVERRIDE_; - - //! draws a vertex primitive list - virtual void drawVertexPrimitiveList(const void* vertices, u32 vertexCount, - const void* indexList, u32 primitiveCount, - E_VERTEX_TYPE vType, scene::E_PRIMITIVE_TYPE pType, - E_INDEX_TYPE iType) _IRR_OVERRIDE_; - - //! draws a vertex primitive list in 2d - virtual void draw2DVertexPrimitiveList(const void* vertices, u32 vertexCount, - const void* indexList, u32 primitiveCount, - E_VERTEX_TYPE vType, scene::E_PRIMITIVE_TYPE pType, - E_INDEX_TYPE iType) _IRR_OVERRIDE_; - - //! draws an 2d image, using a color (if color is other then Color(255,255,255,255)) and the alpha channel of the texture if wanted. - virtual void draw2DImage(const video::ITexture* texture, const core::position2d<s32>& destPos, - const core::rect<s32>& sourceRect, const core::rect<s32>* clipRect = 0, - SColor color=SColor(255,255,255,255), bool useAlphaChannelOfTexture=false) _IRR_OVERRIDE_; - - //! Draws a part of the texture into the rectangle. - virtual void draw2DImage(const video::ITexture* texture, const core::rect<s32>& destRect, - const core::rect<s32>& sourceRect, const core::rect<s32>* clipRect = 0, - const video::SColor* const colors=0, bool useAlphaChannelOfTexture=false) _IRR_OVERRIDE_; - - //! Draws a set of 2d images, using a color and the alpha channel of the texture. - virtual void draw2DImageBatch(const video::ITexture* texture, - const core::array<core::position2d<s32> >& positions, - const core::array<core::rect<s32> >& sourceRects, - const core::rect<s32>* clipRect=0, - SColor color=SColor(255,255,255,255), - bool useAlphaChannelOfTexture=false) _IRR_OVERRIDE_; - - //!Draws an 2d rectangle with a gradient. - virtual void draw2DRectangle(const core::rect<s32>& pos, - SColor colorLeftUp, SColor colorRightUp, SColor colorLeftDown, SColor colorRightDown, - const core::rect<s32>* clip) _IRR_OVERRIDE_; - - //! Draws a 2d line. - virtual void draw2DLine(const core::position2d<s32>& start, - const core::position2d<s32>& end, - SColor color=SColor(255,255,255,255)) _IRR_OVERRIDE_; - - //! Draws a pixel. - virtual void drawPixel(u32 x, u32 y, const SColor & color) _IRR_OVERRIDE_; - - //! Draws a 3d line. - virtual void draw3DLine(const core::vector3df& start, - const core::vector3df& end, SColor color = SColor(255,255,255,255)) _IRR_OVERRIDE_; - - //! Draws a 3d box. - virtual void draw3DBox( const core::aabbox3d<f32>& box, SColor color = SColor(255,255,255,255 ) ) _IRR_OVERRIDE_; - - //! initialises the Direct3D API - bool initDriver(HWND hwnd, bool pureSoftware); - - //! \return Returns the name of the video driver. Example: In case of the DIRECT3D8 - //! driver, it would return "Direct3D8.1". - virtual const wchar_t* getName() const _IRR_OVERRIDE_; - - //! deletes all dynamic lights there are - virtual void deleteAllDynamicLights() _IRR_OVERRIDE_; - - //! adds a dynamic light, returning an index to the light - //! \param light: the light data to use to create the light - //! \return An index to the light, or -1 if an error occurs - virtual s32 addDynamicLight(const SLight& light) _IRR_OVERRIDE_; - - //! Turns a dynamic light on or off - //! \param lightIndex: the index returned by addDynamicLight - //! \param turnOn: true to turn the light on, false to turn it off - virtual void turnLightOn(s32 lightIndex, bool turnOn) _IRR_OVERRIDE_; - - //! returns the maximal amount of dynamic lights the device can handle - virtual u32 getMaximalDynamicLightAmount() const _IRR_OVERRIDE_; - - //! Sets the dynamic ambient light color. The default color is - //! (0,0,0,0) which means it is dark. - //! \param color: New color of the ambient light. - virtual void setAmbientLight(const SColorf& color) _IRR_OVERRIDE_; - - //! Draws a shadow volume into the stencil buffer. - virtual void drawStencilShadowVolume(const core::array<core::vector3df>& triangles, bool zfail=true, u32 debugDataVisible=0) _IRR_OVERRIDE_; - - //! Fills the stencil shadow with color. - virtual void drawStencilShadow(bool clearStencilBuffer=false, - video::SColor leftUpEdge = video::SColor(0,0,0,0), - video::SColor rightUpEdge = video::SColor(0,0,0,0), - video::SColor leftDownEdge = video::SColor(0,0,0,0), - video::SColor rightDownEdge = video::SColor(0,0,0,0)) _IRR_OVERRIDE_; - - //! Returns the maximum amount of primitives (mostly vertices) which - //! the device is able to render with one drawIndexedTriangleList - //! call. - virtual u32 getMaximalPrimitiveCount() const _IRR_OVERRIDE_; - - //! Sets the fog mode. - virtual void setFog(SColor color, E_FOG_TYPE fogType, f32 start, - f32 end, f32 density, bool pixelFog, bool rangeFog) _IRR_OVERRIDE_; - - //! Only used by the internal engine. Used to notify the driver that - //! the window was resized. - virtual void OnResize(const core::dimension2d<u32>& size) _IRR_OVERRIDE_; - - //! Can be called by an IMaterialRenderer to make its work easier. - virtual void setBasicRenderStates(const SMaterial& material, const SMaterial& lastMaterial, - bool resetAllRenderstates) _IRR_OVERRIDE_; - - //! Returns type of video driver - virtual E_DRIVER_TYPE getDriverType() const _IRR_OVERRIDE_; - - //! Returns the transformation set by setTransform - virtual const core::matrix4& getTransform(E_TRANSFORMATION_STATE state) const _IRR_OVERRIDE_; - - //! Get a vertex shader constant index. - virtual s32 getVertexShaderConstantID(const c8* name) _IRR_OVERRIDE_; - - //! Get a pixel shader constant index. - virtual s32 getPixelShaderConstantID(const c8* name) _IRR_OVERRIDE_; - - //! Sets a vertex shader constant. - virtual void setVertexShaderConstant(const f32* data, s32 startRegister, s32 constantAmount=1) _IRR_OVERRIDE_; - - //! Sets a pixel shader constant. - virtual void setPixelShaderConstant(const f32* data, s32 startRegister, s32 constantAmount=1) _IRR_OVERRIDE_; - - //! Sets a constant for the vertex shader based on an index. - virtual bool setVertexShaderConstant(s32 index, const f32* floats, int count) _IRR_OVERRIDE_; - - //! Int interface for the above. - virtual bool setVertexShaderConstant(s32 index, const s32* ints, int count) _IRR_OVERRIDE_; - - //! Uint interface for the above. - virtual bool setVertexShaderConstant(s32 index, const u32* ints, int count) _IRR_OVERRIDE_; - - //! Sets a constant for the pixel shader based on an index. - virtual bool setPixelShaderConstant(s32 index, const f32* floats, int count) _IRR_OVERRIDE_; - - //! Int interface for the above. - virtual bool setPixelShaderConstant(s32 index, const s32* ints, int count) _IRR_OVERRIDE_; - - //! Uint interface for the above. - virtual bool setPixelShaderConstant(s32 index, const u32* ints, int count) _IRR_OVERRIDE_; - - //! Returns a pointer to the IVideoDriver interface. (Implementation for - //! IMaterialRendererServices) - virtual IVideoDriver* getVideoDriver() _IRR_OVERRIDE_; - - //! Creates a render target texture. - virtual ITexture* addRenderTargetTexture(const core::dimension2d<u32>& size, - const io::path& name, const ECOLOR_FORMAT format = ECF_UNKNOWN) _IRR_OVERRIDE_; - - //! Creates a render target texture for a cubemap - ITexture* addRenderTargetTextureCubemap(const irr::u32 sideLen, - const io::path& name, const ECOLOR_FORMAT format) _IRR_OVERRIDE_; - - virtual void clearBuffers(u16 flag, SColor color = SColor(255,0,0,0), f32 depth = 1.f, u8 stencil = 0) _IRR_OVERRIDE_; - - //! Returns an image created from the last rendered frame. - virtual IImage* createScreenShot(video::ECOLOR_FORMAT format=video::ECF_UNKNOWN, video::E_RENDER_TARGET target=video::ERT_FRAME_BUFFER) _IRR_OVERRIDE_; - - //! Set/unset a clipping plane. - virtual bool setClipPlane(u32 index, const core::plane3df& plane, bool enable=false) _IRR_OVERRIDE_; - - //! Enable/disable a clipping plane. - virtual void enableClipPlane(u32 index, bool enable) _IRR_OVERRIDE_; - - //! Returns the graphics card vendor name. - virtual core::stringc getVendorInfo() _IRR_OVERRIDE_ {return VendorName;} - - //! Enable the 2d override material - virtual void enableMaterial2D(bool enable=true) _IRR_OVERRIDE_; - - //! Check if the driver was recently reset. - virtual bool checkDriverReset() _IRR_OVERRIDE_ {return DriverWasReset;} - - //! Get the current color format of the color buffer - /** \return Color format of the color buffer. */ - virtual ECOLOR_FORMAT getColorFormat() const _IRR_OVERRIDE_; - - //! Returns the maximum texture size supported. - virtual core::dimension2du getMaxTextureSize() const _IRR_OVERRIDE_; - - //! Check if the driver supports creating textures with the given color format - virtual bool queryTextureFormat(ECOLOR_FORMAT format) const _IRR_OVERRIDE_; - - //! Used by some SceneNodes to check if a material should be rendered in the transparent render pass - virtual bool needsTransparentRenderPass(const irr::video::SMaterial& material) const _IRR_OVERRIDE_; - - //! Get the current color format of the color buffer - /** \return Color format of the color buffer as D3D color value. */ - D3DFORMAT getD3DColorFormat() const; - - //! Get D3D color format from Irrlicht color format. - D3DFORMAT getD3DFormatFromColorFormat(ECOLOR_FORMAT format) const; - - //! Get Irrlicht color format from D3D color format. - ECOLOR_FORMAT getColorFormatFromD3DFormat(D3DFORMAT format) const; - - //! Get D3D blending factor. - u32 getD3DBlend(E_BLEND_FACTOR factor) const; - - //! Get D3D modulate. - u32 getD3DModulate(E_MODULATE_FUNC func) const; - - //! Get bridge calls. - CD3D9CallBridge* getBridgeCalls() const; - - private: - - //! enumeration for rendering modes such as 2d and 3d for minimizing the switching of renderStates. - enum E_RENDER_MODE - { - ERM_NONE = 0, // no render state has been set yet. - ERM_2D, // 2d drawing rendermode - ERM_3D, // 3d rendering mode - ERM_STENCIL_FILL, // stencil fill mode - ERM_SHADOW_VOLUME_ZFAIL, // stencil volume draw mode - ERM_SHADOW_VOLUME_ZPASS // stencil volume draw mode - }; - - //! sets right vertex shader - void setVertexShader(video::E_VERTEX_TYPE newType); - - //! sets the needed renderstates - bool setRenderStates3DMode(); - - //! sets the needed renderstates - void setRenderStates2DMode(bool alpha, bool texture, bool alphaChannel); - - //! sets the needed renderstates - void setRenderStatesStencilFillMode(bool alpha); - - //! sets the needed renderstates - void setRenderStatesStencilShadowMode(bool zfail, u32 debugDataVisible); - - //! sets the current Texture - bool setActiveTexture(u32 stage, const video::ITexture* texture); - - //! resets the device - bool reset(); - - //! Try to get back a lost device - bool retrieveDevice(int numTries, int msSleepBetweenTries=100); - - virtual ITexture* createDeviceDependentTexture(const io::path& name, IImage* image) _IRR_OVERRIDE_; - - virtual ITexture* createDeviceDependentTextureCubemap(const io::path& name, const core::array<IImage*>& image) _IRR_OVERRIDE_; - - //! Adds a new material renderer to the VideoDriver, using pixel and/or - //! vertex shaders to render geometry. - s32 addShaderMaterial(const c8* vertexShaderProgram, const c8* pixelShaderProgram, - IShaderConstantSetCallBack* callback, - E_MATERIAL_TYPE baseMaterial, s32 userData) _IRR_OVERRIDE_; - - //! Adds a new material renderer to the VideoDriver, based on a high level shading - //! language. - virtual s32 addHighLevelShaderMaterial( - const c8* vertexShaderProgram, - const c8* vertexShaderEntryPointName, - E_VERTEX_SHADER_TYPE vsCompileTarget, - const c8* pixelShaderProgram, - const c8* pixelShaderEntryPointName, - E_PIXEL_SHADER_TYPE psCompileTarget, - const c8* geometryShaderProgram, - const c8* geometryShaderEntryPointName = "main", - E_GEOMETRY_SHADER_TYPE gsCompileTarget = EGST_GS_4_0, - scene::E_PRIMITIVE_TYPE inType = scene::EPT_TRIANGLES, - scene::E_PRIMITIVE_TYPE outType = scene::EPT_TRIANGLE_STRIP, - u32 verticesOut = 0, - IShaderConstantSetCallBack* callback = 0, - E_MATERIAL_TYPE baseMaterial = video::EMT_SOLID, - s32 userData = 0) _IRR_OVERRIDE_; - - void createMaterialRenderers(); - - void draw2D3DVertexPrimitiveList(const void* vertices, - u32 vertexCount, const void* indexList, u32 primitiveCount, - E_VERTEX_TYPE vType, scene::E_PRIMITIVE_TYPE pType, - E_INDEX_TYPE iType, bool is3D); - - D3DTEXTUREADDRESS getTextureWrapMode(const u8 clamp); - - inline D3DCOLORVALUE colorToD3D(const SColor& col) - { - const f32 f = 1.0f / 255.0f; - D3DCOLORVALUE v; - v.r = col.getRed() * f; - v.g = col.getGreen() * f; - v.b = col.getBlue() * f; - v.a = col.getAlpha() * f; - return v; - } - - CD3D9CallBridge* BridgeCalls; - - E_RENDER_MODE CurrentRenderMode; - D3DPRESENT_PARAMETERS present; - - SMaterial Material, LastMaterial; - bool ResetRenderStates; // bool to make all renderstates be reseted if set. - bool Transformation3DChanged; - const ITexture* CurrentTexture[MATERIAL_MAX_TEXTURES]; - bool LastTextureMipMapsAvailable[MATERIAL_MAX_TEXTURES]; - core::matrix4 Matrices[ETS_COUNT]; // matrices of the 3d mode we need to restore when we switch back from the 2d mode. - - HINSTANCE D3DLibrary; - IDirect3D9* pID3D; - IDirect3DDevice9* pID3DDevice; - - IDirect3DSurface9* BackBufferSurface; - IDirect3DSurface9* DepthStencilSurface; - - core::array<bool> ActiveRenderTarget; - - HWND WindowId; - core::rect<s32>* SceneSourceRect; - - D3DCAPS9 Caps; - - SIrrlichtCreationParameters Params; - - E_VERTEX_TYPE LastVertexType; - - core::stringc VendorName; - u16 VendorID; - - u32 MaxTextureUnits; - u32 MaxFixedPipelineTextureUnits; - u32 MaxUserClipPlanes; - f32 MaxLightDistance; - s32 LastSetLight; - - enum E_CACHE_2D_ATTRIBUTES - { - EC2D_ALPHA = 0x1, - EC2D_TEXTURE = 0x2, - EC2D_ALPHA_CHANNEL = 0x4 - }; - - ECOLOR_FORMAT ColorFormat; - D3DFORMAT D3DColorFormat; - bool DeviceLost; - bool DriverWasReset; - bool OcclusionQuerySupport; - bool AlphaToCoverageSupport; - }; - - //! This bridge between Irrlicht pseudo D3D9 calls - //! and true D3D9 calls. - - class CD3D9CallBridge - { - public: - CD3D9CallBridge(IDirect3DDevice9* p, CD3D9Driver* driver); - - // Reset to default state. - - void reset(); - - // Blending calls. - - void setBlendOperation(DWORD mode); - - void setBlendFunc(DWORD source, DWORD destination); - - void setBlendFuncSeparate(DWORD sourceRGB, DWORD destinationRGB, DWORD sourceAlpha, DWORD destinationAlpha); - - void setBlend(bool enable); - - private: - IDirect3DDevice9* pID3DDevice; - - DWORD BlendOperation; - DWORD BlendSourceRGB; - DWORD BlendDestinationRGB; - DWORD BlendSourceAlpha; - DWORD BlendDestinationAlpha; - bool Blend; - bool BlendSeparate; - - bool FeatureBlendSeparate; - }; - -} // end namespace video -} // end namespace irr - - -#endif // _IRR_COMPILE_WITH_DIRECT3D_9_ -#endif // __C_VIDEO_DIRECTX_9_H_INCLUDED__ - diff --git a/source/Irrlicht/CD3D9HLSLMaterialRenderer.cpp b/source/Irrlicht/CD3D9HLSLMaterialRenderer.cpp deleted file mode 100644 index b7007d63..00000000 --- a/source/Irrlicht/CD3D9HLSLMaterialRenderer.cpp +++ /dev/null @@ -1,424 +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_DIRECT3D_9_ - -#include "CD3D9HLSLMaterialRenderer.h" -#include "IShaderConstantSetCallBack.h" -#include "IVideoDriver.h" -#include "os.h" -#include "irrString.h" - -#ifndef _IRR_D3D_NO_SHADER_DEBUGGING -#include <stdio.h> -#endif - - -namespace irr -{ -namespace video -{ - - -//! Public constructor -CD3D9HLSLMaterialRenderer::CD3D9HLSLMaterialRenderer(IDirect3DDevice9* d3ddev, - video::IVideoDriver* driver, s32& outMaterialTypeNr, - const c8* vertexShaderProgram, - const c8* vertexShaderEntryPointName, - E_VERTEX_SHADER_TYPE vsCompileTarget, - const c8* pixelShaderProgram, - const c8* pixelShaderEntryPointName, - E_PIXEL_SHADER_TYPE psCompileTarget, - IShaderConstantSetCallBack* callback, - IMaterialRenderer* baseMaterial, - s32 userData) - : CD3D9ShaderMaterialRenderer(d3ddev, driver, callback, baseMaterial, userData), - VSConstantsTable(0), PSConstantsTable(0) -{ - - #ifdef _DEBUG - setDebugName("CD3D9HLSLMaterialRenderer"); - #endif - - outMaterialTypeNr = -1; - - // now create shaders - - if (vsCompileTarget < 0 || vsCompileTarget > EVST_COUNT) - { - os::Printer::log("Invalid HLSL vertex shader compilation target", ELL_ERROR); - return; - } - - if (!createHLSLVertexShader(vertexShaderProgram, - vertexShaderEntryPointName, VERTEX_SHADER_TYPE_NAMES[vsCompileTarget])) - return; - - if (!createHLSLPixelShader(pixelShaderProgram, - pixelShaderEntryPointName, PIXEL_SHADER_TYPE_NAMES[psCompileTarget])) - return; - - // register myself as new material - outMaterialTypeNr = Driver->addMaterialRenderer(this); -} - - -//! Destructor -CD3D9HLSLMaterialRenderer::~CD3D9HLSLMaterialRenderer() -{ - if (VSConstantsTable) - VSConstantsTable->Release(); - - if (PSConstantsTable) - PSConstantsTable->Release(); -} - - -bool CD3D9HLSLMaterialRenderer::createHLSLVertexShader(const char* vertexShaderProgram, - const char* shaderEntryPointName, - const char* shaderTargetName) -{ - if (!vertexShaderProgram) - return true; - - LPD3DXBUFFER buffer = 0; - LPD3DXBUFFER errors = 0; - -#ifdef _IRR_D3D_NO_SHADER_DEBUGGING - - size_t dataLen_t = strlen(vertexShaderProgram); - UINT dataLen = (UINT)dataLen_t; - if ( dataLen != dataLen_t ) - return false; - - // compile without debug info - HRESULT h = stubD3DXCompileShader( - vertexShaderProgram, - dataLen, - 0, // macros - 0, // no includes - shaderEntryPointName, - shaderTargetName, - 0, // no flags - &buffer, - &errors, - &VSConstantsTable); - -#else - - // compile shader and emit some debug information to - // make it possible to debug the shader in visual studio - - static int irr_dbg_hlsl_file_nr = 0; - ++irr_dbg_hlsl_file_nr; - char tmp[32]; - sprintf(tmp, "irr_d3d9_dbg_hlsl_%d.vsh", irr_dbg_hlsl_file_nr); - - FILE* f = fopen(tmp, "wb"); - fwrite(vertexShaderProgram, strlen(vertexShaderProgram), 1, f); - fflush(f); - fclose(f); - - HRESULT h = stubD3DXCompileShaderFromFile( - tmp, - 0, // macros - 0, // no includes - shaderEntryPointName, - shaderTargetName, - D3DXSHADER_DEBUG | D3DXSHADER_SKIPOPTIMIZATION, - &buffer, - &errors, - &VSConstantsTable); - -#endif - - if (FAILED(h)) - { - os::Printer::log("HLSL vertex shader compilation failed:", ELL_ERROR); - if (errors) - { - os::Printer::log((c8*)errors->GetBufferPointer(), ELL_ERROR); - errors->Release(); - if (buffer) - buffer->Release(); - } - return false; - } - - if (errors) - errors->Release(); - - if (buffer) - { - if (FAILED(pID3DDevice->CreateVertexShader((DWORD*)buffer->GetBufferPointer(), - &VertexShader))) - { - os::Printer::log("Could not create hlsl vertex shader.", ELL_ERROR); - buffer->Release(); - return false; - } - - buffer->Release(); - return true; - } - - return false; -} - - -bool CD3D9HLSLMaterialRenderer::createHLSLPixelShader(const char* pixelShaderProgram, - const char* shaderEntryPointName, - const char* shaderTargetName) -{ - if (!pixelShaderProgram) - return true; - - LPD3DXBUFFER buffer = 0; - LPD3DXBUFFER errors = 0; - - DWORD flags = 0; - -#ifdef D3DXSHADER_ENABLE_BACKWARDS_COMPATIBILITY - if (Driver->queryFeature(video::EVDF_VERTEX_SHADER_2_0) || Driver->queryFeature(video::EVDF_VERTEX_SHADER_3_0)) - // this one's for newer DX SDKs which don't support ps_1_x anymore - // instead they'll silently compile 1_x as 2_x when using this flag - flags |= D3DXSHADER_ENABLE_BACKWARDS_COMPATIBILITY; -#endif -#if defined(_IRR_D3D_USE_LEGACY_HLSL_COMPILER) && defined(D3DXSHADER_USE_LEGACY_D3DX9_31_DLL) -#ifdef D3DXSHADER_ENABLE_BACKWARDS_COMPATIBILITY - else -#endif - flags |= D3DXSHADER_USE_LEGACY_D3DX9_31_DLL; -#endif - -#ifdef _IRR_D3D_NO_SHADER_DEBUGGING - - size_t dataLen_t = strlen(pixelShaderProgram); - UINT dataLen = (UINT)dataLen_t; - if ( dataLen != dataLen_t ) - return false; - - // compile without debug info - HRESULT h = stubD3DXCompileShader( - pixelShaderProgram, - dataLen, - 0, // macros - 0, // no includes - shaderEntryPointName, - shaderTargetName, - flags, - &buffer, - &errors, - &PSConstantsTable); - -#else - - // compile shader and emit some debug information to - // make it possible to debug the shader in visual studio - - static int irr_dbg_hlsl_file_nr = 0; - ++irr_dbg_hlsl_file_nr; - char tmp[32]; - sprintf(tmp, "irr_d3d9_dbg_hlsl_%d.psh", irr_dbg_hlsl_file_nr); - - FILE* f = fopen(tmp, "wb"); - fwrite(pixelShaderProgram, strlen(pixelShaderProgram), 1, f); - fflush(f); - fclose(f); - - HRESULT h = stubD3DXCompileShaderFromFile( - tmp, - 0, // macros - 0, // no includes - shaderEntryPointName, - shaderTargetName, - flags | D3DXSHADER_DEBUG | D3DXSHADER_SKIPOPTIMIZATION, - &buffer, - &errors, - &PSConstantsTable); - -#endif - - if (FAILED(h)) - { - os::Printer::log("HLSL pixel shader compilation failed:", ELL_ERROR); - if (errors) - { - os::Printer::log((c8*)errors->GetBufferPointer(), ELL_ERROR); - errors->Release(); - if (buffer) - buffer->Release(); - } - return false; - } - - if (errors) - errors->Release(); - - if (buffer) - { - if (FAILED(pID3DDevice->CreatePixelShader((DWORD*)buffer->GetBufferPointer(), - &PixelShader))) - { - os::Printer::log("Could not create hlsl pixel shader.", ELL_ERROR); - buffer->Release(); - return false; - } - - buffer->Release(); - return true; - } - - return false; -} - - -s32 CD3D9HLSLMaterialRenderer::getVariableID(bool vertexShader, const c8* name) -{ - LPD3DXCONSTANTTABLE tbl = vertexShader ? VSConstantsTable : PSConstantsTable; - if (!tbl) - return -1; - - D3DXCONSTANTTABLE_DESC tblDesc; - if (!FAILED(tbl->GetDesc(&tblDesc))) - { - for (u32 i = 0; i < tblDesc.Constants; ++i) - { - D3DXHANDLE curConst = tbl->GetConstant(NULL, i); - D3DXCONSTANT_DESC constDesc; - UINT ucount = 1; - - if (!FAILED(tbl->GetConstantDesc(curConst, &constDesc, &ucount))) - if(strcmp(name, constDesc.Name) == 0) - return i; - } - } - - core::stringc s = "HLSL Variable to get ID not found: '"; - s += name; - s += "'. Available variables are:"; - os::Printer::log(s.c_str(), ELL_WARNING); - printHLSLVariables(tbl); - - return -1; -} - - -bool CD3D9HLSLMaterialRenderer::setVariable(bool vertexShader, s32 index, - const f32* floats, int count) -{ - LPD3DXCONSTANTTABLE tbl = vertexShader ? VSConstantsTable : PSConstantsTable; - if (index < 0 || !tbl) - return false; - - // currently we only support top level parameters. - // Should be enough for the beginning. (TODO) - - D3DXHANDLE hndl = tbl->GetConstant(NULL, index); - if (!hndl) - return false; - - D3DXCONSTANT_DESC Description; - UINT ucount = 1; - tbl->GetConstantDesc(hndl, &Description, &ucount); - - if(Description.RegisterSet != D3DXRS_SAMPLER) - { - HRESULT hr = tbl->SetFloatArray(pID3DDevice, hndl, floats, count); - if (FAILED(hr)) - { - os::Printer::log("Error setting float array for HLSL variable", ELL_WARNING); - return false; - } - } - - return true; -} - - -bool CD3D9HLSLMaterialRenderer::setVariable(bool vertexShader, s32 index, - const s32* ints, int count) -{ - LPD3DXCONSTANTTABLE tbl = vertexShader ? VSConstantsTable : PSConstantsTable; - if (index < 0 || !tbl) - return false; - - // currently we only support top level parameters. - // Should be enough for the beginning. (TODO) - - D3DXHANDLE hndl = tbl->GetConstant(NULL, index); - if (!hndl) - return false; - - D3DXCONSTANT_DESC Description; - UINT ucount = 1; - tbl->GetConstantDesc(hndl, &Description, &ucount); - - if(Description.RegisterSet != D3DXRS_SAMPLER) - { - HRESULT hr = tbl->SetIntArray(pID3DDevice, hndl, ints, count); - if (FAILED(hr)) - { - os::Printer::log("Error setting int array for HLSL variable", ELL_WARNING); - return false; - } - } - - return true; -} - - -bool CD3D9HLSLMaterialRenderer::setVariable(bool vertexShader, s32 index, - const u32* ints, int count) -{ - os::Printer::log("Error DirectX 9 does not support unsigned integer constants in shaders.", ELL_ERROR); - return false; -} - - -bool CD3D9HLSLMaterialRenderer::OnRender(IMaterialRendererServices* service, E_VERTEX_TYPE vtxtype) -{ - if (VSConstantsTable) - VSConstantsTable->SetDefaults(pID3DDevice); - - return CD3D9ShaderMaterialRenderer::OnRender(service, vtxtype); -} - - -void CD3D9HLSLMaterialRenderer::printHLSLVariables(LPD3DXCONSTANTTABLE table) -{ - // currently we only support top level parameters. - // Should be enough for the beginning. (TODO) - - // print out constant names - D3DXCONSTANTTABLE_DESC tblDesc; - HRESULT hr = table->GetDesc(&tblDesc); - if (!FAILED(hr)) - { - for (int i=0; i<(int)tblDesc.Constants; ++i) - { - D3DXCONSTANT_DESC d; - UINT n = 1; - D3DXHANDLE cHndl = table->GetConstant(NULL, i); - if (!FAILED(table->GetConstantDesc(cHndl, &d, &n))) - { - core::stringc s = " '"; - s += d.Name; - s += "' Registers:[begin:"; - s += (int)d.RegisterIndex; - s += ", count:"; - s += (int)d.RegisterCount; - s += "]"; - os::Printer::log(s.c_str()); - } - } - } -} - - -} // end namespace video -} // end namespace irr - -#endif // _IRR_COMPILE_WITH_DIRECT3D_9_ diff --git a/source/Irrlicht/CD3D9HLSLMaterialRenderer.h b/source/Irrlicht/CD3D9HLSLMaterialRenderer.h deleted file mode 100644 index f02c8032..00000000 --- a/source/Irrlicht/CD3D9HLSLMaterialRenderer.h +++ /dev/null @@ -1,87 +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_D3D9_HLSL_MATERIAL_RENDERER_H_INCLUDED__ -#define __C_D3D9_HLSL_MATERIAL_RENDERER_H_INCLUDED__ - -#include "IrrCompileConfig.h" -#ifdef _IRR_WINDOWS_ - -#ifdef _IRR_COMPILE_WITH_DIRECT3D_9_ - -#include "CD3D9ShaderMaterialRenderer.h" -#include "IGPUProgrammingServices.h" - -namespace irr -{ -namespace video -{ - -class IVideoDriver; -class IShaderConstantSetCallBack; -class IMaterialRenderer; - -//! Class for using vertex and pixel shaders via HLSL with D3D9 -class CD3D9HLSLMaterialRenderer : public CD3D9ShaderMaterialRenderer -{ -public: - - //! Public constructor - CD3D9HLSLMaterialRenderer(IDirect3DDevice9* d3ddev, video::IVideoDriver* driver, - s32& outMaterialTypeNr, - const c8* vertexShaderProgram, - const c8* vertexShaderEntryPointName, - E_VERTEX_SHADER_TYPE vsCompileTarget, - const c8* pixelShaderProgram, - const c8* pixelShaderEntryPointName, - E_PIXEL_SHADER_TYPE psCompileTarget, - IShaderConstantSetCallBack* callback, - IMaterialRenderer* baseMaterial, - s32 userData); - - //! Destructor - ~CD3D9HLSLMaterialRenderer(); - - virtual s32 getVariableID(bool vertexShader, const c8* name); - - //! sets a variable in the shader. - //! \param vertexShader: True if this should be set in the vertex shader, false if - //! in the pixel shader. - //! \param index: Index of the variable - //! \param floats: Pointer to array of floats - //! \param count: Amount of floats in array. - virtual bool setVariable(bool vertexShader, s32 index, const f32* floats, int count); - - //! Int interface for the above. - virtual bool setVariable(bool vertexShader, s32 index, const s32* ints, int count); - - //! Uint interface for the above. - virtual bool setVariable(bool vertexShader, s32 index, const u32* ints, int count); - - bool OnRender(IMaterialRendererServices* service, E_VERTEX_TYPE vtxtype) _IRR_OVERRIDE_; - -protected: - - bool createHLSLVertexShader(const char* vertexShaderProgram, - const char* shaderEntryPointName, - const char* shaderTargetName); - - bool createHLSLPixelShader(const char* pixelShaderProgram, - const char* shaderEntryPointName, - const char* shaderTargetName); - - void printHLSLVariables(LPD3DXCONSTANTTABLE table); - - LPD3DXCONSTANTTABLE VSConstantsTable; - LPD3DXCONSTANTTABLE PSConstantsTable; -}; - - -} // end namespace video -} // end namespace irr - -#endif -#endif -#endif - diff --git a/source/Irrlicht/CD3D9MaterialRenderer.h b/source/Irrlicht/CD3D9MaterialRenderer.h deleted file mode 100644 index fca6bed4..00000000 --- a/source/Irrlicht/CD3D9MaterialRenderer.h +++ /dev/null @@ -1,584 +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_D3D9_MATERIAL_RENDERER_H_INCLUDED__ -#define __C_D3D9_MATERIAL_RENDERER_H_INCLUDED__ - -#include "IrrCompileConfig.h" -#ifdef _IRR_WINDOWS_ - -#ifdef _IRR_COMPILE_WITH_DIRECT3D_9_ -#if defined(__BORLANDC__) || defined (__BCPLUSPLUS__) -#include "irrMath.h" // needed by borland for sqrtf define -#endif -#include <d3d9.h> - -#include "IMaterialRenderer.h" -#include "CD3D9Driver.h" - -namespace irr -{ -namespace video -{ - -namespace -{ -D3DMATRIX UnitMatrixD3D9; -D3DMATRIX SphereMapMatrixD3D9; -inline void setTextureColorStage(IDirect3DDevice9* dev, DWORD i, - DWORD arg1, DWORD op, DWORD arg2) -{ - dev->SetTextureStageState(i, D3DTSS_COLOROP, op); - dev->SetTextureStageState(i, D3DTSS_COLORARG1, arg1); - dev->SetTextureStageState(i, D3DTSS_COLORARG2, arg2); -} -inline void setTextureColorStage(IDirect3DDevice9* dev, DWORD i, DWORD arg1) -{ - dev->SetTextureStageState(i, D3DTSS_COLOROP, D3DTOP_SELECTARG1); - dev->SetTextureStageState(i, D3DTSS_COLORARG1, arg1); -} - -inline void setTextureAlphaStage(IDirect3DDevice9* dev, DWORD i, - DWORD arg1, DWORD op, DWORD arg2) -{ - dev->SetTextureStageState(i, D3DTSS_ALPHAOP, op); - dev->SetTextureStageState(i, D3DTSS_ALPHAARG1, arg1); - dev->SetTextureStageState(i, D3DTSS_ALPHAARG2, arg2); -} -inline void setTextureAlphaStage(IDirect3DDevice9* dev, DWORD i, DWORD arg1) -{ - dev->SetTextureStageState(i, D3DTSS_ALPHAOP, D3DTOP_SELECTARG1); - dev->SetTextureStageState(i, D3DTSS_ALPHAARG1, arg1); -} -} // anonymous namespace - -//! Base class for all internal D3D9 material renderers -class CD3D9MaterialRenderer : public IMaterialRenderer -{ -public: - - //! Constructor - CD3D9MaterialRenderer(IDirect3DDevice9* d3ddev, CD3D9Driver* driver) - : pID3DDevice(d3ddev), Driver(driver) - { - } - - virtual s32 getVariableID(bool vertexShader, const c8* name) - { - os::Printer::log("Invalid material to set variable in."); - return -1; - } - - //! sets a variable in the shader. - //! \param vertexShader: True if this should be set in the vertex shader, false if - //! in the pixel shader. - //! \param index: Index of the variable - //! \param floats: Pointer to array of floats - //! \param count: Amount of floats in array. - virtual bool setVariable(bool vertexShader, s32 index, const f32* floats, int count) - { - os::Printer::log("Invalid material to set variable in."); - return false; - } - - //! Int interface for the above. - virtual bool setVariable(bool vertexShader, s32 index, const s32* ints, int count) - { - os::Printer::log("Invalid material to set variable in."); - return false; - } - - //! Uint interface for the above. - virtual bool setVariable(bool vertexShader, s32 index, const u32* ints, int count) - { - os::Printer::log("Invalid material to set variable in."); - return false; - } - -protected: - - IDirect3DDevice9* pID3DDevice; - CD3D9Driver* Driver; -}; - - -//! Solid material renderer -class CD3D9MaterialRenderer_SOLID : public CD3D9MaterialRenderer -{ -public: - - CD3D9MaterialRenderer_SOLID(IDirect3DDevice9* p, CD3D9Driver* d) - : CD3D9MaterialRenderer(p, d) {} - - virtual void OnSetMaterial(const SMaterial& material, const SMaterial& lastMaterial, - bool resetAllRenderstates, IMaterialRendererServices* services) _IRR_OVERRIDE_ - { - services->setBasicRenderStates(material, lastMaterial, resetAllRenderstates); - - if (material.MaterialType != lastMaterial.MaterialType || resetAllRenderstates) - { - setTextureColorStage(pID3DDevice, 0, - D3DTA_TEXTURE, D3DTOP_MODULATE, D3DTA_DIFFUSE); - } - - pID3DDevice->SetTextureStageState(1, D3DTSS_COLOROP, D3DTOP_DISABLE); - } -}; - -//! Generic Texture Blend -class CD3D9MaterialRenderer_ONETEXTURE_BLEND : public CD3D9MaterialRenderer -{ -public: - - CD3D9MaterialRenderer_ONETEXTURE_BLEND(IDirect3DDevice9* p, CD3D9Driver* d) - : CD3D9MaterialRenderer(p, d) {} - - virtual void OnSetMaterial(const SMaterial& material, const SMaterial& lastMaterial, - bool resetAllRenderstates, IMaterialRendererServices* services) _IRR_OVERRIDE_ - { - services->setBasicRenderStates(material, lastMaterial, resetAllRenderstates); - -// if (material.MaterialType != lastMaterial.MaterialType || -// material.MaterialTypeParam != lastMaterial.MaterialTypeParam || -// resetAllRenderstates) - { - E_BLEND_FACTOR srcRGBFact,dstRGBFact,srcAlphaFact,dstAlphaFact; - E_MODULATE_FUNC modulate; - u32 alphaSource; - unpack_textureBlendFuncSeparate(srcRGBFact, dstRGBFact, srcAlphaFact, dstAlphaFact, modulate, alphaSource, material.MaterialTypeParam); - - Driver->getBridgeCalls()->setBlend(true); - Driver->getBridgeCalls()->setBlendFuncSeparate(Driver->getD3DBlend(srcRGBFact), Driver->getD3DBlend(dstRGBFact), - Driver->getD3DBlend(srcAlphaFact), Driver->getD3DBlend(dstAlphaFact)); - - setTextureColorStage(pID3DDevice, 0, - D3DTA_TEXTURE, Driver->getD3DModulate(modulate), D3DTA_DIFFUSE); - - if (textureBlendFunc_hasAlpha(srcRGBFact) || textureBlendFunc_hasAlpha(dstRGBFact) || - textureBlendFunc_hasAlpha(srcAlphaFact) || textureBlendFunc_hasAlpha(dstAlphaFact)) - { - if (alphaSource==EAS_VERTEX_COLOR) - { - setTextureAlphaStage(pID3DDevice, 0, D3DTA_DIFFUSE); - } - else if (alphaSource==EAS_TEXTURE) - { - setTextureAlphaStage(pID3DDevice, 0, D3DTA_TEXTURE); - } - else - { - setTextureAlphaStage(pID3DDevice, 0, - D3DTA_TEXTURE, D3DTOP_MODULATE, D3DTA_DIFFUSE); - } - } - - pID3DDevice->SetTextureStageState(1, D3DTSS_COLOROP, D3DTOP_DISABLE); - - } - } - - virtual void OnUnsetMaterial() _IRR_OVERRIDE_ - { - Driver->getBridgeCalls()->setBlend(false); - } - - //! Returns if the material is transparent. - /** The scene management needs to know this for being able to sort the - materials by opaque and transparent. - The return value could be optimized, but we'd need to know the - MaterialTypeParam for it. */ - virtual bool isTransparent() const _IRR_OVERRIDE_ - { - return true; - } -}; - - - -//! Solid 2 layer material renderer -class CD3D9MaterialRenderer_SOLID_2_LAYER : public CD3D9MaterialRenderer -{ -public: - - CD3D9MaterialRenderer_SOLID_2_LAYER(IDirect3DDevice9* p, CD3D9Driver* d) - : CD3D9MaterialRenderer(p, d) {} - - virtual void OnSetMaterial(const SMaterial& material, const SMaterial& lastMaterial, - bool resetAllRenderstates, IMaterialRendererServices* services) _IRR_OVERRIDE_ - { - services->setBasicRenderStates(material, lastMaterial, resetAllRenderstates); - - if (material.MaterialType != lastMaterial.MaterialType || resetAllRenderstates) - { - setTextureColorStage(pID3DDevice, 0, D3DTA_TEXTURE); - - pID3DDevice->SetTextureStageState(1, D3DTSS_TEXCOORDINDEX, 0); - pID3DDevice->SetTextureStageState(1, D3DTSS_COLOROP, D3DTOP_BLENDDIFFUSEALPHA); - } - } -}; - - -//! Transparent add color material renderer -class CD3D9MaterialRenderer_TRANSPARENT_ADD_COLOR : public CD3D9MaterialRenderer -{ -public: - - CD3D9MaterialRenderer_TRANSPARENT_ADD_COLOR(IDirect3DDevice9* p, CD3D9Driver* d) - : CD3D9MaterialRenderer(p, d) {} - - virtual void OnSetMaterial(const SMaterial& material, const SMaterial& lastMaterial, - bool resetAllRenderstates, IMaterialRendererServices* services) _IRR_OVERRIDE_ - { - services->setBasicRenderStates(material, lastMaterial, resetAllRenderstates); - - Driver->getBridgeCalls()->setBlend(true); - Driver->getBridgeCalls()->setBlendFunc(D3DBLEND_ONE, D3DBLEND_INVSRCCOLOR); - - if (material.MaterialType != lastMaterial.MaterialType || resetAllRenderstates) - { - setTextureColorStage(pID3DDevice, 0, - D3DTA_TEXTURE, D3DTOP_MODULATE, D3DTA_DIFFUSE); - - pID3DDevice->SetTextureStageState(1, D3DTSS_COLOROP, D3DTOP_DISABLE); - } - } - - virtual void OnUnsetMaterial() _IRR_OVERRIDE_ - { - Driver->getBridgeCalls()->setBlend(false); - } - - //! Returns if the material is transparent. The scene management needs to know this - //! for being able to sort the materials by opaque and transparent. - virtual bool isTransparent() const _IRR_OVERRIDE_ - { - return true; - } -}; - - -//! Transparent vertex alpha material renderer -class CD3D9MaterialRenderer_TRANSPARENT_VERTEX_ALPHA : public CD3D9MaterialRenderer -{ -public: - - CD3D9MaterialRenderer_TRANSPARENT_VERTEX_ALPHA(IDirect3DDevice9* p, CD3D9Driver* d) - : CD3D9MaterialRenderer(p, d) {} - - virtual void OnSetMaterial(const SMaterial& material, const SMaterial& lastMaterial, - bool resetAllRenderstates, IMaterialRendererServices* services) _IRR_OVERRIDE_ - { - services->setBasicRenderStates(material, lastMaterial, resetAllRenderstates); - - Driver->getBridgeCalls()->setBlend(true); - Driver->getBridgeCalls()->setBlendFunc(D3DBLEND_SRCALPHA, D3DBLEND_INVSRCALPHA); - - if (material.MaterialType != lastMaterial.MaterialType || resetAllRenderstates) - { - setTextureColorStage(pID3DDevice, 0, - D3DTA_TEXTURE, D3DTOP_MODULATE, D3DTA_DIFFUSE); - setTextureAlphaStage(pID3DDevice, 0, D3DTA_DIFFUSE); - - pID3DDevice->SetTextureStageState(1, D3DTSS_COLOROP, D3DTOP_DISABLE); - } - } - - virtual void OnUnsetMaterial() _IRR_OVERRIDE_ - { - Driver->getBridgeCalls()->setBlend(false); - } - - //! Returns if the material is transparent. The scene management needs to know this - //! for being able to sort the materials by opaque and transparent. - virtual bool isTransparent() const _IRR_OVERRIDE_ - { - return true; - } -}; - - -//! Transparent alpha channel material renderer -class CD3D9MaterialRenderer_TRANSPARENT_ALPHA_CHANNEL : public CD3D9MaterialRenderer -{ -public: - - CD3D9MaterialRenderer_TRANSPARENT_ALPHA_CHANNEL(IDirect3DDevice9* p, CD3D9Driver* d) - : CD3D9MaterialRenderer(p, d) {} - - virtual void OnSetMaterial(const SMaterial& material, const SMaterial& lastMaterial, - bool resetAllRenderstates, IMaterialRendererServices* services) _IRR_OVERRIDE_ - { - services->setBasicRenderStates(material, lastMaterial, resetAllRenderstates); - - Driver->getBridgeCalls()->setBlend(true); - Driver->getBridgeCalls()->setBlendFunc(D3DBLEND_SRCALPHA, D3DBLEND_INVSRCALPHA); - - if (material.MaterialType != lastMaterial.MaterialType || resetAllRenderstates - || material.MaterialTypeParam != lastMaterial.MaterialTypeParam ) - { - setTextureColorStage(pID3DDevice, 0, - D3DTA_TEXTURE, D3DTOP_MODULATE, D3DTA_CURRENT); - setTextureAlphaStage(pID3DDevice, 0, D3DTA_TEXTURE); - - pID3DDevice->SetTextureStageState(1, D3DTSS_COLOROP, D3DTOP_DISABLE); - - pID3DDevice->SetRenderState(D3DRS_ALPHAREF, core::floor32(material.MaterialTypeParam * 255.f)); - pID3DDevice->SetRenderState(D3DRS_ALPHAFUNC, D3DCMP_GREATEREQUAL); - pID3DDevice->SetRenderState(D3DRS_ALPHATESTENABLE, TRUE); - } - } - - virtual void OnUnsetMaterial() _IRR_OVERRIDE_ - { - pID3DDevice->SetRenderState(D3DRS_ALPHATESTENABLE, FALSE); - Driver->getBridgeCalls()->setBlend(false); - } - - //! Returns if the material is transparent. The scene management needs to know this - //! for being able to sort the materials by opaque and transparent. - virtual bool isTransparent() const _IRR_OVERRIDE_ - { - return true; - } -}; - - - -//! Transparent alpha channel material renderer -class CD3D9MaterialRenderer_TRANSPARENT_ALPHA_CHANNEL_REF : public CD3D9MaterialRenderer -{ -public: - - CD3D9MaterialRenderer_TRANSPARENT_ALPHA_CHANNEL_REF(IDirect3DDevice9* p, CD3D9Driver* d) - : CD3D9MaterialRenderer(p, d) {} - - virtual void OnSetMaterial(const SMaterial& material, const SMaterial& lastMaterial, - bool resetAllRenderstates, IMaterialRendererServices* services) _IRR_OVERRIDE_ - { - services->setBasicRenderStates(material, lastMaterial, resetAllRenderstates); - - if (material.MaterialType != lastMaterial.MaterialType || resetAllRenderstates) - { - setTextureColorStage(pID3DDevice, 0, - D3DTA_TEXTURE, D3DTOP_MODULATE, D3DTA_CURRENT); - setTextureAlphaStage(pID3DDevice, 0, D3DTA_TEXTURE); - - pID3DDevice->SetTextureStageState(1, D3DTSS_COLOROP, D3DTOP_DISABLE); - - // 127 is required by EMT_TRANSPARENT_ALPHA_CHANNEL_REF - pID3DDevice->SetRenderState(D3DRS_ALPHAREF, 127); - pID3DDevice->SetRenderState(D3DRS_ALPHAFUNC, D3DCMP_GREATEREQUAL); - pID3DDevice->SetRenderState(D3DRS_ALPHATESTENABLE, TRUE); - } - } - - virtual void OnUnsetMaterial() _IRR_OVERRIDE_ - { - pID3DDevice->SetRenderState(D3DRS_ALPHATESTENABLE, FALSE); - } - - //! Returns if the material is transparent. The scene management needs to know this - //! for being able to sort the materials by opaque and transparent. - virtual bool isTransparent() const _IRR_OVERRIDE_ - { - return false; // this material is not really transparent because it does no blending. - } -}; - - -//! material renderer for all kinds of lightmaps -class CD3D9MaterialRenderer_LIGHTMAP : public CD3D9MaterialRenderer -{ -public: - - CD3D9MaterialRenderer_LIGHTMAP(IDirect3DDevice9* p, CD3D9Driver* d) - : CD3D9MaterialRenderer(p, d) {} - - virtual void OnSetMaterial(const SMaterial& material, const SMaterial& lastMaterial, - bool resetAllRenderstates, IMaterialRendererServices* services) _IRR_OVERRIDE_ - { - services->setBasicRenderStates(material, lastMaterial, resetAllRenderstates); - - if (material.MaterialType != lastMaterial.MaterialType || resetAllRenderstates) - { - if (material.MaterialType >= EMT_LIGHTMAP_LIGHTING) - { - // with lighting - setTextureColorStage(pID3DDevice, 0, - D3DTA_TEXTURE, D3DTOP_MODULATE, D3DTA_DIFFUSE); - } - else - { - setTextureColorStage(pID3DDevice, 0, D3DTA_TEXTURE); - } - - pID3DDevice->SetTextureStageState(1, D3DTSS_TEXCOORDINDEX, 1); - - setTextureColorStage(pID3DDevice, 1, - D3DTA_TEXTURE, - (material.MaterialType == EMT_LIGHTMAP_ADD)? - D3DTOP_ADD: - (material.MaterialType == EMT_LIGHTMAP_M4 || material.MaterialType == EMT_LIGHTMAP_LIGHTING_M4)? - D3DTOP_MODULATE4X: - (material.MaterialType == EMT_LIGHTMAP_M2 || material.MaterialType == EMT_LIGHTMAP_LIGHTING_M2)? - D3DTOP_MODULATE2X: - D3DTOP_MODULATE, - D3DTA_CURRENT); - } - } -}; - - - -//! material renderer for detail maps -class CD3D9MaterialRenderer_DETAIL_MAP : public CD3D9MaterialRenderer -{ -public: - - CD3D9MaterialRenderer_DETAIL_MAP(IDirect3DDevice9* p, CD3D9Driver* d) - : CD3D9MaterialRenderer(p, d) {} - - virtual void OnSetMaterial(const SMaterial& material, const SMaterial& lastMaterial, - bool resetAllRenderstates, IMaterialRendererServices* services) _IRR_OVERRIDE_ - { - services->setBasicRenderStates(material, lastMaterial, resetAllRenderstates); - - if (material.MaterialType != lastMaterial.MaterialType || resetAllRenderstates) - { - setTextureColorStage(pID3DDevice, 0, - D3DTA_TEXTURE, D3DTOP_MODULATE, D3DTA_DIFFUSE); - setTextureColorStage(pID3DDevice, 1, - D3DTA_TEXTURE, D3DTOP_ADDSIGNED, D3DTA_CURRENT); - pID3DDevice->SetTextureStageState(1, D3DTSS_TEXCOORDINDEX, 1); - } - } -}; - - -//! sphere map material renderer -class CD3D9MaterialRenderer_SPHERE_MAP : public CD3D9MaterialRenderer -{ -public: - - CD3D9MaterialRenderer_SPHERE_MAP(IDirect3DDevice9* p, CD3D9Driver* d) - : CD3D9MaterialRenderer(p, d) {} - - virtual void OnSetMaterial(const SMaterial& material, const SMaterial& lastMaterial, - bool resetAllRenderstates, IMaterialRendererServices* services) _IRR_OVERRIDE_ - { - services->setBasicRenderStates(material, lastMaterial, resetAllRenderstates); - - if (material.MaterialType != lastMaterial.MaterialType || resetAllRenderstates) - { - setTextureColorStage(pID3DDevice, 0, - D3DTA_TEXTURE, D3DTOP_MODULATE, D3DTA_DIFFUSE); - - pID3DDevice->SetTextureStageState(1, D3DTSS_COLOROP, D3DTOP_DISABLE); - - pID3DDevice->SetTransform( D3DTS_TEXTURE0, &SphereMapMatrixD3D9 ); - pID3DDevice->SetTextureStageState( 0, D3DTSS_TEXTURETRANSFORMFLAGS, D3DTTFF_COUNT2 ); - pID3DDevice->SetTextureStageState( 0, D3DTSS_TEXCOORDINDEX, D3DTSS_TCI_CAMERASPACENORMAL ); - } - } - - virtual void OnUnsetMaterial() _IRR_OVERRIDE_ - { - pID3DDevice->SetTextureStageState( 0, D3DTSS_TEXTURETRANSFORMFLAGS, D3DTTFF_DISABLE ); - pID3DDevice->SetTextureStageState( 0, D3DTSS_TEXCOORDINDEX, 0); - pID3DDevice->SetTransform( D3DTS_TEXTURE0, &UnitMatrixD3D9 ); - } -}; - - -//! reflection 2 layer material renderer -class CD3D9MaterialRenderer_REFLECTION_2_LAYER : public CD3D9MaterialRenderer -{ -public: - - CD3D9MaterialRenderer_REFLECTION_2_LAYER(IDirect3DDevice9* p, CD3D9Driver* d) - : CD3D9MaterialRenderer(p, d) {} - - virtual void OnSetMaterial(const SMaterial& material, const SMaterial& lastMaterial, - bool resetAllRenderstates, IMaterialRendererServices* services) _IRR_OVERRIDE_ - { - services->setBasicRenderStates(material, lastMaterial, resetAllRenderstates); - - if (material.MaterialType != lastMaterial.MaterialType || resetAllRenderstates) - { - setTextureColorStage(pID3DDevice, 0, - D3DTA_TEXTURE, D3DTOP_MODULATE, D3DTA_DIFFUSE); - - setTextureColorStage(pID3DDevice, 1, - D3DTA_TEXTURE, D3DTOP_MODULATE, D3DTA_CURRENT); - - pID3DDevice->SetTransform( D3DTS_TEXTURE1, &SphereMapMatrixD3D9 ); - pID3DDevice->SetTextureStageState( 1, D3DTSS_TEXTURETRANSFORMFLAGS, D3DTTFF_COUNT2 ); - pID3DDevice->SetTextureStageState( 1, D3DTSS_TEXCOORDINDEX, D3DTSS_TCI_CAMERASPACEREFLECTIONVECTOR); - } - } - - virtual void OnUnsetMaterial() _IRR_OVERRIDE_ - { - pID3DDevice->SetTextureStageState( 1, D3DTSS_TEXTURETRANSFORMFLAGS, D3DTTFF_DISABLE ); - pID3DDevice->SetTextureStageState( 1, D3DTSS_TEXCOORDINDEX, 1); - pID3DDevice->SetTransform( D3DTS_TEXTURE1, &UnitMatrixD3D9 ); - } -}; - - -//! reflection 2 layer material renderer -class CD3D9MaterialRenderer_TRANSPARENT_REFLECTION_2_LAYER : public CD3D9MaterialRenderer -{ -public: - - CD3D9MaterialRenderer_TRANSPARENT_REFLECTION_2_LAYER(IDirect3DDevice9* p, CD3D9Driver* d) - : CD3D9MaterialRenderer(p, d) {} - - virtual void OnSetMaterial(const SMaterial& material, const SMaterial& lastMaterial, - bool resetAllRenderstates, IMaterialRendererServices* services) _IRR_OVERRIDE_ - { - services->setBasicRenderStates(material, lastMaterial, resetAllRenderstates); - - Driver->getBridgeCalls()->setBlend(true); - Driver->getBridgeCalls()->setBlendFunc(D3DBLEND_SRCALPHA, D3DBLEND_INVSRCALPHA); - - if (material.MaterialType != lastMaterial.MaterialType || resetAllRenderstates) - { - setTextureColorStage(pID3DDevice, 0, - D3DTA_TEXTURE, D3DTOP_MODULATE, D3DTA_DIFFUSE); - setTextureAlphaStage(pID3DDevice, 0, D3DTA_DIFFUSE); - setTextureColorStage(pID3DDevice, 1, - D3DTA_TEXTURE, D3DTOP_MODULATE, D3DTA_CURRENT); - setTextureAlphaStage(pID3DDevice, 1, D3DTA_CURRENT); - - pID3DDevice->SetTransform(D3DTS_TEXTURE1, &SphereMapMatrixD3D9 ); - pID3DDevice->SetTextureStageState(1, D3DTSS_TEXTURETRANSFORMFLAGS, D3DTTFF_COUNT2 ); - pID3DDevice->SetTextureStageState(1, D3DTSS_TEXCOORDINDEX, D3DTSS_TCI_CAMERASPACEREFLECTIONVECTOR); - } - } - - virtual void OnUnsetMaterial() _IRR_OVERRIDE_ - { - pID3DDevice->SetTextureStageState(1, D3DTSS_TEXTURETRANSFORMFLAGS, D3DTTFF_DISABLE); - pID3DDevice->SetTextureStageState(1, D3DTSS_TEXCOORDINDEX, 1); - pID3DDevice->SetTransform(D3DTS_TEXTURE1, &UnitMatrixD3D9); - Driver->getBridgeCalls()->setBlend(false); - } - - //! Returns if the material is transparent. The scene management needs to know this - //! for being able to sort the materials by opaque and transparent. - virtual bool isTransparent() const _IRR_OVERRIDE_ - { - return true; - } -}; - -} // end namespace video -} // end namespace irr - -#endif -#endif -#endif - diff --git a/source/Irrlicht/CD3D9NormalMapRenderer.cpp b/source/Irrlicht/CD3D9NormalMapRenderer.cpp deleted file mode 100644 index 13c6d361..00000000 --- a/source/Irrlicht/CD3D9NormalMapRenderer.cpp +++ /dev/null @@ -1,306 +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_DIRECT3D_9_ - -#include "CD3D9NormalMapRenderer.h" -#include "IVideoDriver.h" -#include "IMaterialRendererServices.h" -#include "os.h" -#include "SLight.h" - -namespace irr -{ -namespace video -{ - - // 1.1 Shaders with two lights and vertex based attenuation - - // Irrlicht Engine D3D9 render path normal map vertex shader - const char D3D9_NORMAL_MAP_VSH[] = - ";Irrlicht Engine 0.8 D3D9 render path normal map vertex shader\n"\ - "; c0-3: Transposed world matrix \n"\ - "; c8-11: Transposed worldViewProj matrix (Projection * View * World) \n"\ - "; c12: Light01 position \n"\ - "; c13: x,y,z: Light01 color; .w: 1/LightRadius² \n"\ - "; c14: Light02 position \n"\ - "; c15: x,y,z: Light02 color; .w: 1/LightRadius² \n"\ - "vs.1.1\n"\ - "dcl_position v0 ; position \n"\ - "dcl_normal v1 ; normal \n"\ - "dcl_color v2 ; color \n"\ - "dcl_texcoord0 v3 ; texture coord \n"\ - "dcl_texcoord1 v4 ; tangent \n"\ - "dcl_texcoord2 v5 ; binormal \n"\ - "\n"\ - "def c95, 0.5, 0.5, 0.5, 0.5 ; used for moving light vector to ps \n"\ - "\n"\ - "m4x4 oPos, v0, c8 ; transform position to clip space with worldViewProj matrix\n"\ - "\n"\ - "m3x3 r5, v4, c0 ; transform tangent U\n"\ - "m3x3 r7, v1, c0 ; transform normal W\n"\ - "m3x3 r6, v5, c0 ; transform binormal V\n"\ - "\n"\ - "m4x4 r4, v0, c0 ; vertex into world position\n"\ - "add r2, c12, -r4 ; vtxpos - lightpos1\n"\ - "add r3, c14, -r4 ; vtxpos - lightpos2\n"\ - "\n"\ - "dp3 r8.x, r5, r2 ; transform the light vector 1 with U, V, W\n"\ - "dp3 r8.y, r6, r2 \n"\ - "dp3 r8.z, r7, r2 \n"\ - "dp3 r9.x, r5, r3 ; transform the light vector 2 with U, V, W\n"\ - "dp3 r9.y, r6, r3 \n"\ - "dp3 r9.z, r7, r3 \n"\ - "\n"\ - "dp3 r8.w, r8, r8 ; normalize light vector 1 (r8)\n"\ - "rsq r8.w, r8.w \n"\ - "mul r8, r8, r8.w \n"\ - "dp3 r9.w, r9, r9 ; normalize light vector 2 (r9)\n"\ - "rsq r9.w, r9.w \n"\ - "mul r9, r9, r9.w \n"\ - "\n"\ - "mad oT2.xyz, r8.xyz, c95, c95 ; move light vector 1 from -1..1 into 0..1 \n"\ - "mad oT3.xyz, r9.xyz, c95, c95 ; move light vector 2 from -1..1 into 0..1 \n"\ - "\n"\ - " ; calculate attenuation of light 1 \n"\ - "dp3 r2.x, r2.xyz, r2.xyz ; r2.x = r2.x² + r2.y² + r2.z² \n"\ - "mul r2.x, r2.x, c13.w ; r2.x * attenutation \n"\ - "rsq r2, r2.x ; r2.xyzw = 1/sqrt(r2.x * attenutation)\n"\ - "mul oD0, r2, c13 ; resulting light color = lightcolor * attenuation \n"\ - "\n"\ - " ; calculate attenuation of light 2 \n"\ - "dp3 r3.x, r3.xyz, r3.xyz ; r3.x = r3.x² + r3.y² + r3.z² \n"\ - "mul r3.x, r3.x, c15.w ; r2.x * attenutation \n"\ - "rsq r3, r3.x ; r2.xyzw = 1/sqrt(r2.x * attenutation)\n"\ - "mul oD1, r3, c15 ; resulting light color = lightcolor * attenuation \n"\ - "\n"\ - "mov oT0.xy, v3.xy ; move out texture coordinates 1\n"\ - "mov oT1.xy, v3.xy ; move out texture coordinates 2\n"\ - "mov oD0.a, v2.a ; move out original alpha value \n"\ - "\n"; - - // Irrlicht Engine D3D9 render path normal map pixel shader - const char D3D9_NORMAL_MAP_PSH_1_1[] = - ";Irrlicht Engine 0.8 D3D9 render path normal map pixel shader\n"\ - ";Input: \n"\ - ";t0: color map texture coord \n"\ - ";t1: normal map texture coords \n"\ - ";t2: light 1 vector in tangent space \n"\ - ";v0: light 1 color \n"\ - ";t3: light 2 vector in tangent space \n"\ - ";v1: light 2 color \n"\ - ";v0.a: vertex alpha value \n"\ - "ps.1.1 \n"\ - "tex t0 ; sample color map \n"\ - "tex t1 ; sample normal map\n"\ - "texcoord t2 ; fetch light vector 1\n"\ - "texcoord t3 ; fetch light vector 2\n"\ - "\n"\ - "dp3_sat r0, t1_bx2, t2_bx2 ; normal dot light 1 (_bx2 because moved into 0..1)\n"\ - "mul r0, r0, v0 ; luminance1 * light color 1 \n"\ - "\n"\ - "dp3_sat r1, t1_bx2, t3_bx2 ; normal dot light 2 (_bx2 because moved into 0..1)\n"\ - "mad r0, r1, v1, r0 ; (luminance2 * light color 2) + luminance 1 \n"\ - "\n"\ - "mul r0.xyz, t0, r0 ; total luminance * base color\n"\ - "+mov r0.a, v0.a ; write interpolated vertex alpha value \n"\ - "\n"\ - ""; - - // Higher-quality normal map pixel shader (requires PS 2.0) - // uses per-pixel normalization for improved accuracy - const char D3D9_NORMAL_MAP_PSH_2_0[] = - ";Irrlicht Engine 0.8 D3D9 render path normal map pixel shader\n"\ - ";Input: \n"\ - ";t0: color map texture coord \n"\ - ";t1: normal map texture coords \n"\ - ";t2: light 1 vector in tangent space \n"\ - ";v0: light 1 color \n"\ - ";t3: light 2 vector in tangent space \n"\ - ";v1: light 2 color \n"\ - ";v0.a: vertex alpha value \n"\ - - "ps_2_0 \n"\ - "def c0, 0, 0, 0, 0\n"\ - "def c1, 1.0, 1.0, 1.0, 1.0\n"\ - "def c2, 2.0, 2.0, 2.0, 2.0\n"\ - "def c3, -.5, -.5, -.5, -.5\n"\ - "dcl t0\n"\ - "dcl t1\n"\ - "dcl t2\n"\ - "dcl t3\n"\ - "dcl v1\n"\ - "dcl v0\n"\ - "dcl_2d s0\n"\ - "dcl_2d s1\n"\ - - "texld r0, t0, s0 ; sample color map into r0 \n"\ - "texld r4, t0, s1 ; sample normal map into r4\n"\ - "add r4, r4, c3 ; bias the normal vector\n"\ - "add r5, t2, c3 ; bias the light 1 vector into r5\n"\ - "add r6, t3, c3 ; bias the light 2 vector into r6\n"\ - - "nrm r1, r4 ; normalize the normal vector into r1\n"\ - "nrm r2, r5 ; normalize the light1 vector into r2\n"\ - "nrm r3, r6 ; normalize the light2 vector into r3\n"\ - - "dp3 r2, r2, r1 ; let r2 = normal DOT light 1 vector\n"\ - "max r2, r2, c0 ; clamp result to positive numbers\n"\ - "mul r2, r2, v0 ; let r2 = luminance1 * light color 1 \n"\ - - "dp3 r3, r3, r1 ; let r3 = normal DOT light 2 vector\n"\ - "max r3, r3, c0 ; clamp result to positive numbers\n"\ - - "mad r2, r3, v1, r2 ; let r2 = (luminance2 * light color 2) + (luminance2 * light color 1) \n"\ - - "mul r2, r2, r0 ; let r2 = total luminance * base color\n"\ - "mov r2.w, v0.w ; write interpolated vertex alpha value \n"\ - - "mov oC0, r2 ; copy r2 to the output register \n"\ - - "\n"\ - ""; - - CD3D9NormalMapRenderer::CD3D9NormalMapRenderer( - IDirect3DDevice9* d3ddev, video::IVideoDriver* driver, - s32& outMaterialTypeNr, IMaterialRenderer* baseMaterial) - : CD3D9ShaderMaterialRenderer(d3ddev, driver, 0, baseMaterial) - { - #ifdef _DEBUG - setDebugName("CD3D9NormalMapRenderer"); - #endif - - // set this as callback. We could have done this in - // the initialization list, but some compilers don't like it. - - CallBack = this; - - // basically, this thing simply compiles the hardcoded shaders - // if the hardware is able to do them, otherwise it maps to the - // base material - - if (!driver->queryFeature(video::EVDF_PIXEL_SHADER_1_1) || - !driver->queryFeature(video::EVDF_VERTEX_SHADER_1_1)) - { - // this hardware is not able to do shaders. Fall back to - // base material. - outMaterialTypeNr = driver->addMaterialRenderer(this); - return; - } - - // check if already compiled normal map shaders are there. - - video::IMaterialRenderer* renderer = driver->getMaterialRenderer(EMT_NORMAL_MAP_SOLID); - if (renderer) - { - // use the already compiled shaders - video::CD3D9NormalMapRenderer* nmr = (video::CD3D9NormalMapRenderer*)renderer; - VertexShader = nmr->VertexShader; - if (VertexShader) - VertexShader->AddRef(); - - PixelShader = nmr->PixelShader; - if (PixelShader) - PixelShader->AddRef(); - - outMaterialTypeNr = driver->addMaterialRenderer(this); - } - else - { - // compile shaders on our own - if (driver->queryFeature(video::EVDF_PIXEL_SHADER_2_0)) - { - init(outMaterialTypeNr, D3D9_NORMAL_MAP_VSH, D3D9_NORMAL_MAP_PSH_2_0); - } - else - { - init(outMaterialTypeNr, D3D9_NORMAL_MAP_VSH, D3D9_NORMAL_MAP_PSH_1_1); - } - } - // something failed, use base material - if (-1==outMaterialTypeNr) - driver->addMaterialRenderer(this); - } - - - CD3D9NormalMapRenderer::~CD3D9NormalMapRenderer() - { - if (CallBack == this) - CallBack = 0; - } - - - bool CD3D9NormalMapRenderer::OnRender(IMaterialRendererServices* service, E_VERTEX_TYPE vtxtype) - { - if (vtxtype != video::EVT_TANGENTS) - { - os::Printer::log("Error: Normal map renderer only supports vertices of type EVT_TANGENTS", ELL_ERROR); - return false; - } - - return CD3D9ShaderMaterialRenderer::OnRender(service, vtxtype); - } - - - //! Returns the render capability of the material. - s32 CD3D9NormalMapRenderer::getRenderCapability() const - { - if (Driver->queryFeature(video::EVDF_PIXEL_SHADER_1_1) && - Driver->queryFeature(video::EVDF_VERTEX_SHADER_1_1)) - return 0; - - return 1; - } - - - //! Called by the engine when the vertex and/or pixel shader constants - //! for an material renderer should be set. - void CD3D9NormalMapRenderer::OnSetConstants(IMaterialRendererServices* services, s32 userData) - { - video::IVideoDriver* driver = services->getVideoDriver(); - - // set transposed world matrix - services->setVertexShaderConstant(driver->getTransform(video::ETS_WORLD).getTransposed().pointer(), 0, 4); - - // set transposed worldViewProj matrix - core::matrix4 worldViewProj(driver->getTransform(video::ETS_PROJECTION)); - worldViewProj *= driver->getTransform(video::ETS_VIEW); - worldViewProj *= driver->getTransform(video::ETS_WORLD); - services->setVertexShaderConstant(worldViewProj.getTransposed().pointer(), 8, 4); - - // here we've got to fetch the fixed function lights from the - // driver and set them as constants - - u32 cnt = driver->getDynamicLightCount(); - - for (u32 i=0; i<2; ++i) - { - SLight light; - - if (i<cnt) - light = driver->getDynamicLight(i); - else - { - light.DiffuseColor.set(0,0,0); // make light dark - light.Radius = 1.0f; - } - - light.DiffuseColor.a = 1.0f/(light.Radius*light.Radius); // set attenuation - - services->setVertexShaderConstant(reinterpret_cast<const f32*>(&light.Position), 12+(i*2), 1); - services->setVertexShaderConstant(reinterpret_cast<const f32*>(&light.DiffuseColor), 13+(i*2), 1); - } - - // this is not really necessary in d3d9 (used a def instruction), but to be sure: - f32 c95[] = {0.5f, 0.5f, 0.5f, 0.5f}; - services->setVertexShaderConstant(c95, 95, 1); - } - - -} // end namespace video -} // end namespace irr - -#endif // _IRR_COMPILE_WITH_DIRECT3D_9_ - diff --git a/source/Irrlicht/CD3D9NormalMapRenderer.h b/source/Irrlicht/CD3D9NormalMapRenderer.h deleted file mode 100644 index 56cbde92..00000000 --- a/source/Irrlicht/CD3D9NormalMapRenderer.h +++ /dev/null @@ -1,56 +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_D3D9_NORMAL_MAPMATERIAL_RENDERER_H_INCLUDED__ -#define __C_D3D9_NORMAL_MAPMATERIAL_RENDERER_H_INCLUDED__ - -#include "IrrCompileConfig.h" -#ifdef _IRR_WINDOWS_ - -#ifdef _IRR_COMPILE_WITH_DIRECT3D_9_ -#if defined(__BORLANDC__) || defined (__BCPLUSPLUS__) -#include "irrMath.h" // needed by borland for sqrtf define -#endif -#include <d3d9.h> - -#include "CD3D9ShaderMaterialRenderer.h" -#include "IShaderConstantSetCallBack.h" - -namespace irr -{ -namespace video -{ - -//! Renderer for normal maps -class CD3D9NormalMapRenderer : - public CD3D9ShaderMaterialRenderer, IShaderConstantSetCallBack -{ -public: - - CD3D9NormalMapRenderer( - IDirect3DDevice9* d3ddev, video::IVideoDriver* driver, - s32& outMaterialTypeNr, IMaterialRenderer* baseMaterial); - - ~CD3D9NormalMapRenderer(); - - //! Called by the engine when the vertex and/or pixel shader constants for an - //! material renderer should be set. - virtual void OnSetConstants(IMaterialRendererServices* services, s32 userData) _IRR_OVERRIDE_; - - virtual bool OnRender(IMaterialRendererServices* service, E_VERTEX_TYPE vtxtype) _IRR_OVERRIDE_; - - //! Returns the render capability of the material. - virtual s32 getRenderCapability() const _IRR_OVERRIDE_; - -private: - -}; - -} // end namespace video -} // end namespace irr - -#endif -#endif -#endif - diff --git a/source/Irrlicht/CD3D9ParallaxMapRenderer.cpp b/source/Irrlicht/CD3D9ParallaxMapRenderer.cpp deleted file mode 100644 index f036fb72..00000000 --- a/source/Irrlicht/CD3D9ParallaxMapRenderer.cpp +++ /dev/null @@ -1,409 +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_DIRECT3D_9_ - -#include "CD3D9ParallaxMapRenderer.h" -#include "IMaterialRendererServices.h" -#include "IVideoDriver.h" -#include "os.h" -#include "SLight.h" - -//#define SHADER_EXTERNAL_DEBUG - -#ifdef SHADER_EXTERNAL_DEBUG -#include "CReadFile.h" -#endif - -namespace irr -{ -namespace video -{ - // 1.1/1.4 Shaders with two lights and vertex based attenuation - - // Irrlicht Engine D3D9 render path normal map vertex shader - const char D3D9_PARALLAX_MAP_VSH[] = - ";Irrlicht Engine 0.10 D3D9 render path parallax mapping vertex shader\n"\ - "; c0-3: Transposed world matrix \n"\ - "; c4: Eye position \n"\ - "; c8-11: Transposed worldViewProj matrix (Projection * View * World) \n"\ - "; c12: Light01 position \n"\ - "; c13: x,y,z: Light01 color; .w: 1/LightRadius² \n"\ - "; c14: Light02 position \n"\ - "; c15: x,y,z: Light02 color; .w: 1/LightRadius² \n"\ - "vs.1.1\n"\ - "dcl_position v0 ; position \n"\ - "dcl_normal v1 ; normal \n"\ - "dcl_color v2 ; color \n"\ - "dcl_texcoord0 v3 ; texture coord \n"\ - "dcl_texcoord1 v4 ; tangent \n"\ - "dcl_texcoord2 v5 ; binormal \n"\ - "\n"\ - "def c95, 0.5, 0.5, 0.5, 0.5 ; used for moving light vector to ps \n"\ - "def c96, -1, 1, 1, 1 ; somewhere I've got a bug. flipping the vectors with this fixes it. \n"\ - "\n"\ - "m4x4 oPos, v0, c8 ; transform position to clip space with worldViewProj matrix\n"\ - "\n"\ - "m3x3 r5, v4, c0 ; transform tangent U\n"\ - "m3x3 r7, v1, c0 ; transform normal W\n"\ - "m3x3 r6, v5, c0 ; transform binormal V\n"\ - "\n"\ - "m4x4 r4, v0, c0 ; vertex into world position\n"\ - "add r2, c12, -r4 ; vtxpos - light1 pos\n"\ - "add r3, c14, -r4 ; vtxpos - light2 pos\n"\ - "add r1, -c4, r4 ; eye - vtxpos \n"\ - "\n"\ - "dp3 r8.x, r5, r2 ; transform the light1 vector with U, V, W\n"\ - "dp3 r8.y, r6, r2 \n"\ - "dp3 r8.z, r7, r2 \n"\ - "dp3 r9.x, r5, r3 ; transform the light2 vector with U, V, W\n"\ - "dp3 r9.y, r6, r3 \n"\ - "dp3 r9.z, r7, r3 \n"\ - "dp3 r10.x, r5, r1 ; transform the eye vector with U, V, W\n"\ - "dp3 r10.y, r6, r1 \n"\ - "dp3 r10.z, r7, r1 \n"\ - "\n"\ - "dp3 r8.w, r8, r8 ; normalize light vector 1 (r8)\n"\ - "rsq r8.w, r8.w \n"\ - "mul r8, r8, r8.w \n"\ - ";mul r8, r8, c96 \n"\ - "dp3 r9.w, r9, r9 ; normalize light vector 2 (r9)\n"\ - "rsq r9.w, r9.w \n"\ - "mul r9, r9, r9.w \n"\ - ";mul r9, r9, c96 \n"\ - "dp3 r10.w, r10, r10 ; normalize eye vector (r10)\n"\ - "rsq r10.w, r10.w \n"\ - "mul r10, r10, r10.w \n"\ - "mul r10, r10, c96 \n"\ - "\n"\ - "\n"\ - "mad oT2.xyz, r8.xyz, c95, c95 ; move light vector 1 from -1..1 into 0..1 \n"\ - "mad oT3.xyz, r9.xyz, c95, c95 ; move light vector 2 from -1..1 into 0..1 \n"\ - "mad oT4.xyz, r10.xyz, c95, c95 ; move eye vector from -1..1 into 0..1 \n"\ - "\n"\ - " ; calculate attenuation of light 1 \n"\ - "dp3 r2.x, r2.xyz, r2.xyz ; r2.x = r2.x² + r2.y² + r2.z² \n"\ - "mul r2.x, r2.x, c13.w ; r2.x * attenutation \n"\ - "rsq r2, r2.x ; r2.xyzw = 1/sqrt(r2.x * attenutation)\n"\ - "mul oD0, r2, c13 ; resulting light color = lightcolor * attenuation \n"\ - "\n"\ - " ; calculate attenuation of light 2 \n"\ - "dp3 r3.x, r3.xyz, r3.xyz ; r3.x = r3.x² + r3.y² + r3.z² \n"\ - "mul r3.x, r3.x, c15.w ; r2.x * attenutation \n"\ - "rsq r3, r3.x ; r2.xyzw = 1/sqrt(r2.x * attenutation)\n"\ - "mul oD1, r3, c15 ; resulting light color = lightcolor * attenuation \n"\ - "\n"\ - "mov oT0.xy, v3.xy ; move out texture coordinates 1\n"\ - "mov oT1.xy, v3.xy ; move out texture coordinates 2\n"\ - "mov oD0.a, v2.a ; move out original alpha value \n"\ - "\n"; - - - // Irrlicht Engine D3D9 render path normal map pixel shader version 1.4 - const char D3D9_PARALLAX_MAP_PSH[] = - ";Irrlicht Engine 0.10 D3D9 render path parallax mapping pixel shader \n"\ - ";Input: \n"\ - ";t0: color map texture coord \n"\ - ";t1: normal map texture coords \n"\ - ";t2: light 1 vector in tangent space \n"\ - ";t4: eye vector in tangent space \n"\ - ";v0: light 1 color \n"\ - ";t3: light 2 vector in tangent space \n"\ - ";v1: light 2 color \n"\ - ";v0.a: vertex alpha value \n"\ - " \n"\ - "ps.1.4 \n"\ - " \n"\ - ";def c6, 0.02f, 0.02f, 0.02f, 0.0f ; scale factor, now set in callback \n"\ - "def c5, 0.5f, 0.5f, 0.5f, 0.0f ; for specular division \n"\ - " \n"\ - "texld r1, t1 ; sample (normal.x, normal.y, normal.z, height) \n"\ - "texcrd r4.xyz, t4 ; fetch eye vector \n"\ - "texcrd r0.xyz, t0 ; color map \n"\ - " \n"\ - "; original parallax mapping: \n"\ - ";mul r3, r1_bx2.wwww, c6; ; r3 = (height, height, height) * scale \n"\ - ";mad r2.xyz, r3, r4_bx2, r0 ; newTexCoord = height * eye + oldTexCoord \n"\ - " \n"\ - "; modified parallax mapping to reduce swimming effect: \n"\ - "mul r3, r1_bx2.wwww, r1_bx2.zzzz ; (nh,nh,nh,nh) = (h,h,h,h) * (n.z,n.z,n.z,n.z,) \n"\ - "mul r3, r3, c6; ; r3 = (nh, nh, nh) * scale \n"\ - "mad r2.xyz, r3, r4_bx2, r0 ; newTexCoord = height * eye + oldTexCoord \n"\ - " \n"\ - "phase \n"\ - " \n"\ - "texld r0, r2 ; load diffuse texture with new tex coord \n"\ - "texld r1, r2 ; sample normal map \n"\ - "texcrd r2.xyz, t2 ; fetch light vector 1 \n"\ - "texcrd r3.xyz, t3 ; fetch light vector 2 \n"\ - " \n"\ - "dp3_sat r5, r1_bx2, r2_bx2 ; normal dot light 1 (_bx2 because moved into 0..1) \n"\ - "mul r5, r5, v0 ; luminance1 * light color 1 \n"\ - " \n"\ - "dp3_sat r3, r1_bx2, r3_bx2 ; normal dot light 2 (_bx2 because moved into 0..1) \n"\ - "mad r3, r3, v1, r5 ; (luminance2 * light color 2) + luminance1 \n"\ - " \n"\ - "mul r0.xyz, r0, r3 ; total luminance * base color \n"\ - "+mov r0.a, v0.a ; write original alpha value \n"\ - "\n"; - - // Irrlicht Engine D3D9 render path normal map pixel shader version 2.0 - const char D3D9_PARALLAX_MAP_PSH_20[] = - ";Irrlicht Engine D3D9 render path parallax mapping pixel shader \n"\ - ";Input: \n"\ - " \n"\ - ";t0: color map texture coord \n"\ - ";t1: normal map texture coords \n"\ - ";t2: light 1 vector in tangent space \n"\ - ";t4: eye vector in tangent space \n"\ - ";v0: light 1 color \n"\ - ";t3: light 2 vector in tangent space \n"\ - ";v1: light 2 color \n"\ - ";v0.a: vertex alpha value \n"\ - " \n"\ - "ps.2.0 \n"\ - " \n"\ - "dcl_2d s0 ; Declare the s0 register to be the sampler for stage 0 \n"\ - "dcl t0.xy ; Declare t0 to have 2D texture coordinates from stage 0 \n"\ - "dcl t1.xy ; Declare t0 to have 2D texture coordinates from stage 0 \n"\ - "dcl_2d s1 ; Declare the s1 register to be the sampler for stage 1 \n"\ - " \n"\ - "dcl t2.xyz ; \n"\ - "dcl t3.xyz ; \n"\ - "dcl t4.xyz ; \n"\ - "dcl v0.xyzw; \n"\ - "dcl v1.xyzw; \n"\ - " \n"\ - "def c0, -1.0f, -1.0f, -1.0f, -1.0f ; for _bx2 emulation \n"\ - "def c1, 2.0f, 2.0f, 2.0f, 2.0f ; for _bx2 emulation \n"\ - "mov r11, c1; \n"\ - " \n"\ - "texld r1, t1, s1 ; sample (normal.x, normal.y, normal.z, height) \n"\ - "mov r4.xyz, t4 ; fetch eye vector \n"\ - "mov r0.xy, t0 ; color map \n"\ - " \n"\ - "; original parallax mapping: \n"\ - "; emulate ps1x _bx2, so substract 0.5f and multiply by 2 \n"\ - "mad r1.xyz, r1, r11, c0; \n"\ - " \n"\ - "mul r3, r1.wwww, c6; ; r3 = (height, height, height) * scale \n"\ - " \n"\ - "; emulate ps1x _bx2, so substract 0.5f and multiply by 2 \n"\ - "mad r4.xyz, r4, r11, c0; \n"\ - " \n"\ - "mad r2.xy, r3, r4, r0 ; newTexCoord = height * eye + oldTexCoord \n"\ - " \n"\ - "; modified parallax mapping to avoid swimming: \n"\ - ";mul r3, r1_bx2.wwww, r1_bx2.zzzz ; r3 = (h,h,h,h) * (n.z, n.z, n.z, n.z,) \n"\ - ";mul r3, r3, c6; ; r3 = (nh, nh, nh) * scale \n"\ - ";mad r2.xyz, r3, r4_bx2, r0 ; newTexCoord = height * eye + oldTexCoord \n"\ - " \n"\ - "texld r0, r2, s0 ; load diffuse texture with new tex coord \n"\ - "texld r1, r2, s1 ; sample normal map \n"\ - "mov r2.xyz, t2 ; fetch light vector 1 \n"\ - "mov r3.xyz, t3 ; fetch light vector 2 \n"\ - " \n"\ - "; emulate ps1x _bx2, so substract 0.5f and multiply by 2 \n"\ - "mad r1.xyz, r1, r11, c0; \n"\ - "mad r2.xyz, r2, r11, c0; \n"\ - "mad r3.xyz, r3, r11, c0; \n"\ - " \n"\ - "dp3_sat r2, r1, r2 ; normal dot light 1 (_bx2 because moved into 0..1) \n"\ - "mul r2, r2, v0 ; luminance1 * light color 1 \n"\ - " \n"\ - "dp3_sat r3, r1, r3 ; normal dot light 2 (_bx2 because moved into 0..1) \n"\ - "mad r3, r3, v1, r2 ; (luminance2 * light color 2) + luminance1 \n"\ - " \n"\ - "mul r0.xyz, r0, r3 ; total luminance * base color \n"\ - "mov r0.a, v0.a ; write original alpha value \n"\ - "mov oC0, r0; \n"\ - "\n"; - - CD3D9ParallaxMapRenderer::CD3D9ParallaxMapRenderer( - IDirect3DDevice9* d3ddev, video::IVideoDriver* driver, - s32& outMaterialTypeNr, IMaterialRenderer* baseMaterial) - : CD3D9ShaderMaterialRenderer(d3ddev, driver, 0, baseMaterial), - CurrentScale(0.0f) - { - #ifdef _DEBUG - setDebugName("CD3D9ParallaxMapRenderer"); - #endif - - // set this as callback. We could have done this in - // the initialization list, but some compilers don't like it. - - CallBack = this; - - // basically, this thing simply compiles these hardcoded shaders if the - // hardware is able to do them, otherwise it maps to the base material - - if (!driver->queryFeature(video::EVDF_PIXEL_SHADER_1_4) || - !driver->queryFeature(video::EVDF_VERTEX_SHADER_1_1)) - { - // this hardware is not able to do shaders. Fall back to - // base material. - outMaterialTypeNr = driver->addMaterialRenderer(this); - return; - } - - // check if already compiled parallax map shaders are there. - - video::IMaterialRenderer* renderer = driver->getMaterialRenderer(EMT_PARALLAX_MAP_SOLID); - if (renderer) - { - // use the already compiled shaders - video::CD3D9ParallaxMapRenderer* nmr = (video::CD3D9ParallaxMapRenderer*)renderer; - VertexShader = nmr->VertexShader; - if (VertexShader) - VertexShader->AddRef(); - - PixelShader = nmr->PixelShader; - if (PixelShader) - PixelShader->AddRef(); - - outMaterialTypeNr = driver->addMaterialRenderer(this); - } - else - { - #ifdef SHADER_EXTERNAL_DEBUG - - // quickly load shader from external file - io::CReadFile* file = new io::CReadFile("parallax.psh"); - s32 sz = file->getSize(); - char* s = new char[sz+1]; - file->read(s, sz); - s[sz] = 0; - - init(outMaterialTypeNr, D3D9_PARALLAX_MAP_VSH, s); - - delete [] s; - file->drop(); - - #else - - // compile shaders on our own - init(outMaterialTypeNr, D3D9_PARALLAX_MAP_VSH, D3D9_PARALLAX_MAP_PSH); - - #endif // SHADER_EXTERNAL_DEBUG - } - // something failed, use base material - if (-1==outMaterialTypeNr) - driver->addMaterialRenderer(this); - } - - - CD3D9ParallaxMapRenderer::~CD3D9ParallaxMapRenderer() - { - if (CallBack == this) - CallBack = 0; - } - - bool CD3D9ParallaxMapRenderer::OnRender(IMaterialRendererServices* service, E_VERTEX_TYPE vtxtype) - { - if (vtxtype != video::EVT_TANGENTS) - { - os::Printer::log("Error: Parallax map renderer only supports vertices of type EVT_TANGENTS", ELL_ERROR); - return false; - } - - return CD3D9ShaderMaterialRenderer::OnRender(service, vtxtype); - } - - - void CD3D9ParallaxMapRenderer::OnSetMaterial(const video::SMaterial& material, - const video::SMaterial& lastMaterial, - bool resetAllRenderstates, video::IMaterialRendererServices* services) - { - CD3D9ShaderMaterialRenderer::OnSetMaterial(material, lastMaterial, - resetAllRenderstates, services); - - CurrentScale = material.MaterialTypeParam; - } - - - //! Returns the render capability of the material. - s32 CD3D9ParallaxMapRenderer::getRenderCapability() const - { - if (Driver->queryFeature(video::EVDF_PIXEL_SHADER_1_4) && - Driver->queryFeature(video::EVDF_VERTEX_SHADER_1_1)) - return 0; - - return 1; - } - - - //! Called by the engine when the vertex and/or pixel shader constants - //! for an material renderer should be set. - void CD3D9ParallaxMapRenderer::OnSetConstants(IMaterialRendererServices* services, s32 userData) - { - video::IVideoDriver* driver = services->getVideoDriver(); - - // set transposed world matrix - services->setVertexShaderConstant(driver->getTransform(video::ETS_WORLD).getTransposed().pointer(), 0, 4); - - // set eye position - - // The viewpoint is at (0., 0., 0.) in eye space. - // Turning this into a vector [0 0 0 1] and multiply it by - // the inverse of the view matrix, the resulting vector is the - // object space location of the camera. - - f32 floats[4] = {0,0,0,1}; - core::matrix4 minv = driver->getTransform(video::ETS_VIEW); - minv.makeInverse(); - minv.multiplyWith1x4Matrix(floats); - services->setVertexShaderConstant(floats, 4, 1); - - // set transposed worldViewProj matrix - core::matrix4 worldViewProj; - worldViewProj = driver->getTransform(video::ETS_PROJECTION); - worldViewProj *= driver->getTransform(video::ETS_VIEW); - worldViewProj *= driver->getTransform(video::ETS_WORLD); - services->setVertexShaderConstant(worldViewProj.getTransposed().pointer(), 8, 4); - - // here we've got to fetch the fixed function lights from the - // driver and set them as constants - - const u32 cnt = driver->getDynamicLightCount(); - - for (u32 i=0; i<2; ++i) - { - SLight light; - - if (i<cnt) - light = driver->getDynamicLight(i); - else - { - light.DiffuseColor.set(0,0,0); // make light dark - light.Radius = 1.0f; - } - - light.DiffuseColor.a = 1.0f/(light.Radius*light.Radius); // set attenuation - - services->setVertexShaderConstant(reinterpret_cast<const f32*>(&light.Position), 12+(i*2), 1); - services->setVertexShaderConstant(reinterpret_cast<const f32*>(&light.DiffuseColor), 13+(i*2), 1); - } - - // this is not really necessary in d3d9 (used a def instruction), but to be sure: - f32 c95[] = {0.5f, 0.5f, 0.5f, 0.5f}; - services->setVertexShaderConstant(c95, 95, 1); - f32 c96[] = {-1, 1, 1, 1}; - services->setVertexShaderConstant(c96, 96, 1); - - // set scale factor - f32 factor = 0.02f; // default value - if (CurrentScale != 0) - factor = CurrentScale; - - f32 c6[] = {factor, factor, factor, 0}; - services->setPixelShaderConstant(c6, 6, 1); - } - - -} // end namespace video -} // end namespace irr - -#endif // _IRR_COMPILE_WITH_DIRECT3D_9_ - diff --git a/source/Irrlicht/CD3D9ParallaxMapRenderer.h b/source/Irrlicht/CD3D9ParallaxMapRenderer.h deleted file mode 100644 index 187b6f9d..00000000 --- a/source/Irrlicht/CD3D9ParallaxMapRenderer.h +++ /dev/null @@ -1,63 +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_D3D9_PARALLAX_MAPMATERIAL_RENDERER_H_INCLUDED__ -#define __C_D3D9_PARALLAX_MAPMATERIAL_RENDERER_H_INCLUDED__ - -#include "IrrCompileConfig.h" -#ifdef _IRR_WINDOWS_ - -#ifdef _IRR_COMPILE_WITH_DIRECT3D_9_ -#if defined(__BORLANDC__) || defined (__BCPLUSPLUS__) -#include "irrMath.h" // needed by borland for sqrtf define -#endif -#include <d3d9.h> - -#include "CD3D9ShaderMaterialRenderer.h" -#include "IShaderConstantSetCallBack.h" - -namespace irr -{ -namespace video -{ - -//! Renderer for normal maps using parallax mapping -class CD3D9ParallaxMapRenderer : - public CD3D9ShaderMaterialRenderer, IShaderConstantSetCallBack -{ -public: - - CD3D9ParallaxMapRenderer( - IDirect3DDevice9* d3ddev, video::IVideoDriver* driver, - s32& outMaterialTypeNr, IMaterialRenderer* baseMaterial); - - ~CD3D9ParallaxMapRenderer(); - - //! Called by the engine when the vertex and/or pixel shader constants for an - //! material renderer should be set. - virtual void OnSetConstants(IMaterialRendererServices* services, s32 userData) _IRR_OVERRIDE_; - - virtual bool OnRender(IMaterialRendererServices* service, E_VERTEX_TYPE vtxtype) _IRR_OVERRIDE_; - - //! Returns the render capability of the material. - virtual s32 getRenderCapability() const _IRR_OVERRIDE_; - - virtual void OnSetMaterial(const SMaterial& material) _IRR_OVERRIDE_ { } - virtual void OnSetMaterial(const video::SMaterial& material, - const video::SMaterial& lastMaterial, - bool resetAllRenderstates, video::IMaterialRendererServices* services) _IRR_OVERRIDE_; - -private: - - f32 CurrentScale; - -}; - -} // end namespace video -} // end namespace irr - -#endif -#endif -#endif - diff --git a/source/Irrlicht/CD3D9RenderTarget.cpp b/source/Irrlicht/CD3D9RenderTarget.cpp deleted file mode 100644 index 630c428d..00000000 --- a/source/Irrlicht/CD3D9RenderTarget.cpp +++ /dev/null @@ -1,281 +0,0 @@ -// Copyright (C) 2015 Patryk Nadrowski -// This file is part of the "Irrlicht Engine". -// For conditions of distribution and use, see copyright notice in irrlicht.h - -#include "CD3D9RenderTarget.h" - -#ifdef _IRR_COMPILE_WITH_DIRECT3D_9_ - -#include "IImage.h" -#include "irrMath.h" -#include "irrString.h" - -#include "CD3D9Driver.h" -#include "CD3D9Texture.h" - -namespace irr -{ - namespace video - { - - CD3D9RenderTarget::CD3D9RenderTarget(CD3D9Driver* driver) : DepthStencilSurface(0), Driver(driver) - { -#ifdef _DEBUG - setDebugName("CD3D9RenderTarget"); -#endif - - DriverType = EDT_DIRECT3D9; - Size = Driver->getScreenSize(); - } - - CD3D9RenderTarget::~CD3D9RenderTarget() - { - for (u32 i = 0; i < Surface.size(); ++i) - { - if (Surface[i]) - Surface[i]->Release(); - } - - if (DepthStencilSurface) - DepthStencilSurface->Release(); - - for (u32 i = 0; i < Texture.size(); ++i) - { - if (Texture[i]) - Texture[i]->drop(); - } - - if (DepthStencil) - DepthStencil->drop(); - } - - void CD3D9RenderTarget::setTexture(const core::array<ITexture*>& texture, ITexture* depthStencil, const core::array<E_CUBE_SURFACE>& cubeSurfaces) - { - bool needSizeUpdate = false; - - // Set color attachments. - if ((Texture != texture) || (CubeSurfaces != cubeSurfaces)) - { - needSizeUpdate = true; - CubeSurfaces = cubeSurfaces; // TODO: we can probably avoid some memory allocating/de-allocating if _only_ CubeSurfaces change. - - if (texture.size() > Driver->ActiveRenderTarget.size()) - { - core::stringc message = "This GPU supports up to "; - message += Driver->ActiveRenderTarget.size(); - message += " textures per render target."; - - os::Printer::log(message.c_str(), ELL_WARNING); - } - - const u32 size = core::min_(texture.size(), static_cast<u32>(Driver->ActiveRenderTarget.size())); - - for (u32 i = 0; i < Surface.size(); ++i) - { - if (Surface[i]) - Surface[i]->Release(); - } - - Surface.set_used(size); - - core::array<ITexture*> prevTextures(Texture); - - Texture.set_used(size); - - for (u32 i = 0; i < size; ++i) - { - CD3D9Texture* currentTexture = (texture[i] && texture[i]->getDriverType() == DriverType) ? static_cast<CD3D9Texture*>(texture[i]) : 0; - - IDirect3DTexture9* textureID = 0; - IDirect3DCubeTexture9* cubeTextureId = 0; - UINT level = 0; // no support for rendering to to other mip-levels so far - - if (currentTexture) - { - if (currentTexture->getType() == ETT_2D) - textureID = currentTexture->getDX9Texture(); - else if ( currentTexture->getType() == ETT_CUBEMAP ) - cubeTextureId = currentTexture->getDX9CubeTexture(); - } - - if (textureID) - { - Texture[i] = texture[i]; - Texture[i]->grab(); - - IDirect3DSurface9* currentSurface = 0; - textureID->GetSurfaceLevel(level, ¤tSurface); - - Surface[i] = currentSurface; - } - else if ( cubeTextureId ) - { - Texture[i] = texture[i]; - Texture[i]->grab(); - - IDirect3DSurface9* currentSurface = 0; - D3DCUBEMAP_FACES face = (D3DCUBEMAP_FACES)CubeSurfaces[i]; // we use same numbering - cubeTextureId->GetCubeMapSurface(face, level, ¤tSurface); - - Surface[i] = currentSurface; - } - else - { - Surface[i] = 0; - Texture[i] = 0; - } - } - - for (u32 i = 0; i < prevTextures.size(); ++i) - { - if (prevTextures[i]) - prevTextures[i]->drop(); - } - } - - // Set depth and stencil attachments. - - if (DepthStencil != depthStencil) - { - if (DepthStencilSurface) - { - DepthStencilSurface->Release(); - DepthStencilSurface = 0; - } - - if (DepthStencil) - { - DepthStencil->drop(); - DepthStencil = 0; - - DepthStencilSurface = 0; - } - - needSizeUpdate = true; - CD3D9Texture* currentTexture = (depthStencil && depthStencil->getDriverType() == DriverType) ? static_cast<CD3D9Texture*>(depthStencil) : 0; - - if (currentTexture) - { - if (currentTexture->getType() == ETT_2D) - { - IDirect3DTexture9* textureID = currentTexture->getDX9Texture(); - if (textureID) - { - const ECOLOR_FORMAT textureFormat = depthStencil->getColorFormat(); - if (IImage::isDepthFormat(textureFormat)) - { - DepthStencil = depthStencil; - DepthStencil->grab(); - - IDirect3DSurface9* currentSurface = 0; - textureID->GetSurfaceLevel(0, ¤tSurface); - - DepthStencilSurface = currentSurface; - } - else - { - os::Printer::log("Ignoring depth/stencil texture without depth color format.", ELL_WARNING); - } - } - } - else - os::Printer::log("This driver doesn't support depth/stencil to cubemaps.", ELL_WARNING); - } - } - - if (needSizeUpdate) - { - // Set size required for a viewport. - - bool sizeDetected = false; - - for (u32 i = 0; i < Texture.size(); ++i) - { - if (Texture[i]) - { - Size = Texture[i]->getSize(); - sizeDetected = true; - - break; - } - } - - if (!sizeDetected) - { - if (DepthStencil) - Size = DepthStencil->getSize(); - else - Size = Driver->getScreenSize(); - } - } - } - - const core::dimension2d<u32>& CD3D9RenderTarget::getSize() const - { - return Size; - } - - IDirect3DSurface9* CD3D9RenderTarget::getSurface(u32 id) const - { - return (id < Surface.size()) ? Surface[id] : 0; - } - - u32 CD3D9RenderTarget::getSurfaceCount() const - { - return Surface.size(); - } - - IDirect3DSurface9* CD3D9RenderTarget::getDepthStencilSurface() const - { - return DepthStencilSurface; - } - - void CD3D9RenderTarget::releaseSurfaces() - { - for (u32 i = 0; i < Surface.size(); ++i) - { - if (Surface[i]) - { - Surface[i]->Release(); - Surface[i] = 0; - } - } - - if (DepthStencilSurface) - { - DepthStencilSurface->Release(); - DepthStencilSurface = 0; - } - } - - void CD3D9RenderTarget::generateSurfaces() - { - for (u32 i = 0; i < Surface.size(); ++i) - { - if (!Surface[i] && Texture[i]) - { - IDirect3DTexture9* currentTexture = static_cast<CD3D9Texture*>(Texture[i])->getDX9Texture(); - if ( currentTexture ) - { - IDirect3DSurface9* currentSurface = 0; - currentTexture->GetSurfaceLevel(0, ¤tSurface); - Surface[i] = currentSurface; - } - } - } - - if (!DepthStencilSurface && DepthStencil) - { - IDirect3DTexture9* currentTexture = static_cast<CD3D9Texture*>(DepthStencil)->getDX9Texture(); - if ( currentTexture ) - { - IDirect3DSurface9* currentSurface = 0; - currentTexture->GetSurfaceLevel(0, ¤tSurface); - DepthStencilSurface = currentSurface; - } - } - } - } -} - -#endif diff --git a/source/Irrlicht/CD3D9RenderTarget.h b/source/Irrlicht/CD3D9RenderTarget.h deleted file mode 100644 index 1f643f09..00000000 --- a/source/Irrlicht/CD3D9RenderTarget.h +++ /dev/null @@ -1,60 +0,0 @@ -// Copyright (C) 2015 Patryk Nadrowski -// This file is part of the "Irrlicht Engine". -// For conditions of distribution and use, see copyright notice in irrlicht.h - -#ifndef __C_OPEN_GL_RENDER_TARGET_H_INCLUDED__ -#define __C_OPEN_GL_RENDER_TARGET_H_INCLUDED__ - -#include "IrrCompileConfig.h" - -#ifdef _IRR_COMPILE_WITH_DIRECT3D_9_ - -#include "IRenderTarget.h" - -#include "dimension2d.h" -#include "os.h" - -#include <d3d9.h> - -namespace irr -{ - namespace video - { - - class CD3D9Driver; - - class CD3D9RenderTarget : public IRenderTarget - { - public: - CD3D9RenderTarget(CD3D9Driver* driver); - virtual ~CD3D9RenderTarget(); - - virtual void setTexture(const core::array<ITexture*>& texture, ITexture* depthStencil, const core::array<E_CUBE_SURFACE>& cubeSurfaces) _IRR_OVERRIDE_; - - const core::dimension2d<u32>& getSize() const; - - IDirect3DSurface9* getSurface(u32 id) const; - - u32 getSurfaceCount() const; - - IDirect3DSurface9* getDepthStencilSurface() const; - - void releaseSurfaces(); - - void generateSurfaces(); - - protected: - core::dimension2d<u32> Size; - - core::array<IDirect3DSurface9*> Surface; - - IDirect3DSurface9* DepthStencilSurface; - - CD3D9Driver* Driver; - }; - - } -} - -#endif -#endif diff --git a/source/Irrlicht/CD3D9ShaderMaterialRenderer.cpp b/source/Irrlicht/CD3D9ShaderMaterialRenderer.cpp deleted file mode 100644 index fecc85fa..00000000 --- a/source/Irrlicht/CD3D9ShaderMaterialRenderer.cpp +++ /dev/null @@ -1,539 +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_DIRECT3D_9_ - -#include "CD3D9ShaderMaterialRenderer.h" -#include "IShaderConstantSetCallBack.h" -#include "IMaterialRendererServices.h" -#include "IVideoDriver.h" -#include "os.h" -#include "irrString.h" - -#ifndef _IRR_D3D_NO_SHADER_DEBUGGING -#include <stdio.h> -#endif - - -namespace irr -{ -namespace video -{ - -//! Public constructor -CD3D9ShaderMaterialRenderer::CD3D9ShaderMaterialRenderer(IDirect3DDevice9* d3ddev, video::IVideoDriver* driver, - s32& outMaterialTypeNr, const c8* vertexShaderProgram, const c8* pixelShaderProgram, - IShaderConstantSetCallBack* callback, IMaterialRenderer* baseMaterial, s32 userData) -: pID3DDevice(d3ddev), Driver(driver), CallBack(callback), BaseMaterial(baseMaterial), - VertexShader(0), OldVertexShader(0), PixelShader(0), UserData(userData) -{ - #ifdef _DEBUG - setDebugName("CD3D9ShaderMaterialRenderer"); - #endif - - if (BaseMaterial) - BaseMaterial->grab(); - - if (CallBack) - CallBack->grab(); - - init(outMaterialTypeNr, vertexShaderProgram, pixelShaderProgram); -} - - -//! constructor only for use by derived classes who want to -//! create a fall back material for example. -CD3D9ShaderMaterialRenderer::CD3D9ShaderMaterialRenderer(IDirect3DDevice9* d3ddev, - video::IVideoDriver* driver, - IShaderConstantSetCallBack* callback, - IMaterialRenderer* baseMaterial, s32 userData) -: pID3DDevice(d3ddev), Driver(driver), CallBack(callback), BaseMaterial(baseMaterial), - VertexShader(0), OldVertexShader(0), PixelShader(0), UserData(userData) -{ - #ifdef _DEBUG - setDebugName("CD3D9ShaderMaterialRenderer"); - #endif - - if (BaseMaterial) - BaseMaterial->grab(); - - if (CallBack) - CallBack->grab(); -} - - -void CD3D9ShaderMaterialRenderer::init(s32& outMaterialTypeNr, - const c8* vertexShaderProgram, const c8* pixelShaderProgram) -{ - outMaterialTypeNr = -1; - - // create vertex shader - if (!createVertexShader(vertexShaderProgram)) - return; - - // create pixel shader - if (!createPixelShader(pixelShaderProgram)) - return; - - // register myself as new material - outMaterialTypeNr = Driver->addMaterialRenderer(this); -} - - -//! Destructor -CD3D9ShaderMaterialRenderer::~CD3D9ShaderMaterialRenderer() -{ - if (CallBack) - CallBack->drop(); - - if (VertexShader) - VertexShader->Release(); - - if (PixelShader) - PixelShader->Release(); - - if (BaseMaterial) - BaseMaterial->drop(); -} - - -bool CD3D9ShaderMaterialRenderer::OnRender(IMaterialRendererServices* service, E_VERTEX_TYPE vtxtype) -{ - // call callback to set shader constants - if (CallBack && (VertexShader || PixelShader)) - CallBack->OnSetConstants(service, UserData); - - return true; -} - - -void CD3D9ShaderMaterialRenderer::OnSetMaterial(const video::SMaterial& material, const video::SMaterial& lastMaterial, - bool resetAllRenderstates, video::IMaterialRendererServices* services) -{ - if (material.MaterialType != lastMaterial.MaterialType || resetAllRenderstates) - { - if (VertexShader) - { - // save old vertex shader - pID3DDevice->GetVertexShader(&OldVertexShader); - - // set new vertex shader - if (FAILED(pID3DDevice->SetVertexShader(VertexShader))) - os::Printer::log("Could not set vertex shader.", ELL_WARNING); - } - - // set new pixel shader - if (PixelShader) - { - if (FAILED(pID3DDevice->SetPixelShader(PixelShader))) - os::Printer::log("Could not set pixel shader.", ELL_WARNING); - } - } - - services->setBasicRenderStates(material, lastMaterial, resetAllRenderstates); - - if (BaseMaterial) - BaseMaterial->OnSetMaterial(material, lastMaterial, resetAllRenderstates, services); - - if (CallBack) - CallBack->OnSetMaterial(material); -} - - -void CD3D9ShaderMaterialRenderer::OnUnsetMaterial() -{ - if (VertexShader) - pID3DDevice->SetVertexShader(OldVertexShader); - - if (PixelShader) - pID3DDevice->SetPixelShader(0); - - if (BaseMaterial) - BaseMaterial->OnUnsetMaterial(); -} - - -//! Returns if the material is transparent. The scene management needs to know this -//! for being able to sort the materials by opaque and transparent. -bool CD3D9ShaderMaterialRenderer::isTransparent() const -{ - return BaseMaterial ? BaseMaterial->isTransparent() : false; -} - - -bool CD3D9ShaderMaterialRenderer::createPixelShader(const c8* pxsh) -{ - if (!pxsh) - return true; - - // compile shader - - LPD3DXBUFFER code = 0; - LPD3DXBUFFER errors = 0; - - #ifdef _IRR_D3D_NO_SHADER_DEBUGGING - - // compile shader without debug info - stubD3DXAssembleShader(pxsh, (UINT)strlen(pxsh), 0, 0, 0, &code, &errors); - #else - - // compile shader and emit some debug information to - // make it possible to debug the shader in visual studio - - static int irr_dbg_file_nr = 0; - ++irr_dbg_file_nr; - char tmp[32]; - sprintf(tmp, "irr_d3d9_dbg_shader_%d.psh", irr_dbg_file_nr); - - FILE* f = fopen(tmp, "wb"); - fwrite(pxsh, strlen(pxsh), 1, f); - fflush(f); - fclose(f); - - stubD3DXAssembleShaderFromFile(tmp, 0, 0, D3DXSHADER_DEBUG, &code, &errors); - - #endif - - - if (errors) - { - // print out compilation errors. - os::Printer::log("Pixel shader compilation failed:", ELL_ERROR); - os::Printer::log((c8*)errors->GetBufferPointer(), ELL_ERROR); - - if (code) - code->Release(); - - errors->Release(); - return false; - } - - if (FAILED(pID3DDevice->CreatePixelShader((DWORD*)code->GetBufferPointer(), &PixelShader))) - { - os::Printer::log("Could not create pixel shader.", ELL_ERROR); - code->Release(); - return false; - } - - code->Release(); - return true; -} - - -bool CD3D9ShaderMaterialRenderer::createVertexShader(const char* vtxsh) -{ - if (!vtxsh) - return true; - - // compile shader - - LPD3DXBUFFER code = 0; - LPD3DXBUFFER errors = 0; - - #ifdef _IRR_D3D_NO_SHADER_DEBUGGING - - // compile shader without debug info - stubD3DXAssembleShader(vtxsh, (UINT)strlen(vtxsh), 0, 0, 0, &code, &errors); - - #else - - // compile shader and emit some debug information to - // make it possible to debug the shader in visual studio - - static int irr_dbg_file_nr = 0; - ++irr_dbg_file_nr; - char tmp[32]; - sprintf(tmp, "irr_d3d9_dbg_shader_%d.vsh", irr_dbg_file_nr); - - FILE* f = fopen(tmp, "wb"); - fwrite(vtxsh, strlen(vtxsh), 1, f); - fflush(f); - fclose(f); - - stubD3DXAssembleShaderFromFile(tmp, 0, 0, D3DXSHADER_DEBUG, &code, &errors); - - #endif - - if (errors) - { - // print out compilation errors. - os::Printer::log("Vertex shader compilation failed:", ELL_ERROR); - os::Printer::log((c8*)errors->GetBufferPointer(), ELL_ERROR); - - if (code) - code->Release(); - - errors->Release(); - return false; - } - - if (!code || FAILED(pID3DDevice->CreateVertexShader((DWORD*)code->GetBufferPointer(), &VertexShader))) - { - os::Printer::log("Could not create vertex shader.", ELL_ERROR); - if (code) - code->Release(); - return false; - } - - code->Release(); - return true; -} - - -HRESULT CD3D9ShaderMaterialRenderer::stubD3DXAssembleShader(LPCSTR pSrcData, - UINT SrcDataLen, CONST D3DXMACRO* pDefines, - LPD3DXINCLUDE pInclude, DWORD Flags, LPD3DXBUFFER* ppShader, - LPD3DXBUFFER* ppErrorMsgs) -{ - // Because Irrlicht needs to be able to start up even without installed d3d dlls, it - // needs to load external d3d dlls manually. examples for the dlls are: - // SDK dll name D3DX_SDK_VERSION - // Summer 2004: no dll 22 - // February 2005: d3dx9_24.dll 24 - // April 2005: d3dx9_25.dll 25 - // June 2005: d3dx9_26.dll 26 - // August 2005: d3dx9_27.dll 27 - // October 2005, - // December 2005: d3dx9_28.dll 28 - - #if ( D3DX_SDK_VERSION < 24 ) - // directly link functions, old d3d sdks didn't try to load external dlls - // when linking to the d3dx9.lib - #ifdef _MSC_VER - #pragma comment (lib, "d3dx9.lib") - #endif - - // invoke static linked function - return D3DXAssembleShader(pSrcData, SrcDataLen, pDefines, pInclude, - Flags, ppShader, ppErrorMsgs); - #else - { - // try to load shader functions from the dll and print error if failed. - - // D3DXAssembleShader signature - typedef HRESULT (WINAPI *AssembleShaderFunction)(LPCSTR pSrcData, UINT SrcDataLen, - CONST D3DXMACRO* pDefines, LPD3DXINCLUDE pInclude, - DWORD Flags, LPD3DXBUFFER* ppShader, - LPD3DXBUFFER* ppErrorMsgs); - - static bool LoadFailed = false; - static AssembleShaderFunction pFn = 0; - - if (!pFn && !LoadFailed) - { - // try to load dll - io::path strDllName = "d3dx9_"; - strDllName += (int)D3DX_SDK_VERSION; - strDllName += ".dll"; - - HMODULE hMod = LoadLibrary(strDllName.c_str()); - if (hMod) - pFn = (AssembleShaderFunction)GetProcAddress(hMod, "D3DXAssembleShader"); - - if (!pFn) - { - LoadFailed = true; - os::Printer::log("Could not load shader function D3DXAssembleShader from dll, shaders disabled", - strDllName.c_str(), ELL_ERROR); - } - } - - if (pFn) - { - // call already loaded function - return (*pFn)(pSrcData, SrcDataLen, pDefines, pInclude, Flags, ppShader, ppErrorMsgs); - } - } - #endif // D3DX_SDK_VERSION < 24 - - return 0; -} - - -HRESULT CD3D9ShaderMaterialRenderer::stubD3DXAssembleShaderFromFile(LPCSTR pSrcFile, - CONST D3DXMACRO* pDefines, LPD3DXINCLUDE pInclude, DWORD Flags, - LPD3DXBUFFER* ppShader, LPD3DXBUFFER* ppErrorMsgs) -{ - // wondering what I'm doing here? - // see comment in CD3D9ShaderMaterialRenderer::stubD3DXAssembleShader() - - #if ( D3DX_SDK_VERSION < 24 ) - // directly link functions, old d3d sdks didn't try to load external dlls - // when linking to the d3dx9.lib - #ifdef _MSC_VER - #pragma comment (lib, "d3dx9.lib") - #endif - - // invoke static linked function - return D3DXAssembleShaderFromFileA(pSrcFile, pDefines, pInclude, Flags, - ppShader, ppErrorMsgs); - #else - { - // try to load shader functions from the dll and print error if failed. - - // D3DXAssembleShaderFromFileA signature - typedef HRESULT (WINAPI *AssembleShaderFromFileFunction)(LPCSTR pSrcFile, - CONST D3DXMACRO* pDefines, LPD3DXINCLUDE pInclude, DWORD Flags, - LPD3DXBUFFER* ppShader, LPD3DXBUFFER* ppErrorMsgs); - - static bool LoadFailed = false; - static AssembleShaderFromFileFunction pFn = 0; - - if (!pFn && !LoadFailed) - { - // try to load dll - io::path strDllName = "d3dx9_"; - strDllName += (int)D3DX_SDK_VERSION; - strDllName += ".dll"; - - HMODULE hMod = LoadLibrary(strDllName.c_str()); - if (hMod) - pFn = (AssembleShaderFromFileFunction)GetProcAddress(hMod, "D3DXAssembleShaderFromFileA"); - - if (!pFn) - { - LoadFailed = true; - os::Printer::log("Could not load shader function D3DXAssembleShaderFromFileA from dll, shaders disabled", - strDllName.c_str(), ELL_ERROR); - } - } - - if (pFn) - { - // call already loaded function - return (*pFn)(pSrcFile, pDefines, pInclude, Flags, ppShader, ppErrorMsgs); - } - } - #endif // D3DX_SDK_VERSION < 24 - - return 0; -} - - -HRESULT CD3D9ShaderMaterialRenderer::stubD3DXCompileShader(LPCSTR pSrcData, UINT SrcDataLen, CONST D3DXMACRO* pDefines, - LPD3DXINCLUDE pInclude, LPCSTR pFunctionName, - LPCSTR pProfile, DWORD Flags, LPD3DXBUFFER* ppShader, - LPD3DXBUFFER* ppErrorMsgs, LPD3DXCONSTANTTABLE* ppConstantTable) -{ - // wondering what I'm doing here? - // see comment in CD3D9ShaderMaterialRenderer::stubD3DXAssembleShader() - - #if ( D3DX_SDK_VERSION < 24 ) - // directly link functions, old d3d sdks didn't try to load external dlls - // when linking to the d3dx9.lib - #ifdef _MSC_VER - #pragma comment (lib, "d3dx9.lib") - #endif - - // invoke static linked function - return D3DXCompileShader(pSrcData, SrcDataLen, pDefines, pInclude, pFunctionName, pProfile, Flags, ppShader, ppErrorMsgs, ppConstantTable); - #else - { - // try to load shader functions from the dll and print error if failed. - - // D3DXCompileShader - typedef HRESULT (WINAPI *D3DXCompileShaderFunction)(LPCSTR pSrcData, UINT SrcDataLen, CONST D3DXMACRO* pDefines, - LPD3DXINCLUDE pInclude, LPCSTR pFunctionName, - LPCSTR pProfile, DWORD Flags, LPD3DXBUFFER* ppShader, - LPD3DXBUFFER* ppErrorMsgs, LPD3DXCONSTANTTABLE* ppConstantTable); - - static bool LoadFailed = false; - static D3DXCompileShaderFunction pFn = 0; - - if (!pFn && !LoadFailed) - { - // try to load dll - io::path strDllName = "d3dx9_"; - strDllName += (int)D3DX_SDK_VERSION; - strDllName += ".dll"; - - HMODULE hMod = LoadLibrary(strDllName.c_str()); - if (hMod) - pFn = (D3DXCompileShaderFunction)GetProcAddress(hMod, "D3DXCompileShader"); - - if (!pFn) - { - LoadFailed = true; - os::Printer::log("Could not load shader function D3DXCompileShader from dll, shaders disabled", - strDllName.c_str(), ELL_ERROR); - } - } - - if (pFn) - { - // call already loaded function - return (*pFn)(pSrcData, SrcDataLen, pDefines, pInclude, pFunctionName, pProfile, Flags, ppShader, ppErrorMsgs, ppConstantTable); - } - } - #endif // D3DX_SDK_VERSION < 24 - - return 0; -} - -HRESULT CD3D9ShaderMaterialRenderer::stubD3DXCompileShaderFromFile(LPCSTR pSrcFile, CONST D3DXMACRO* pDefines, - LPD3DXINCLUDE pInclude, LPCSTR pFunctionName, - LPCSTR pProfile, DWORD Flags, LPD3DXBUFFER* ppShader, LPD3DXBUFFER* ppErrorMsgs, - LPD3DXCONSTANTTABLE* ppConstantTable) -{ - // wondering what I'm doing here? - // see comment in CD3D9ShaderMaterialRenderer::stubD3DXAssembleShader() - - #if ( D3DX_SDK_VERSION < 24 ) - // directly link functions, old d3d sdks didn't try to load external dlls - // when linking to the d3dx9.lib - #ifdef _MSC_VER - #pragma comment (lib, "d3dx9.lib") - #endif - - // invoke static linked function - return D3DXCompileShaderFromFileA(pSrcFile, pDefines, pInclude, pFunctionName, pProfile, Flags, ppShader, ppErrorMsgs, ppConstantTable); - #else - { - // try to load shader functions from the dll and print error if failed. - - // D3DXCompileShaderFromFileA - typedef HRESULT (WINAPI *D3DXCompileShaderFromFileFunction)(LPCSTR pSrcFile, - CONST D3DXMACRO* pDefines, LPD3DXINCLUDE pInclude, LPCSTR pFunctionName, - LPCSTR pProfile, DWORD Flags, LPD3DXBUFFER* ppShader, LPD3DXBUFFER* ppErrorMsgs, - LPD3DXCONSTANTTABLE* ppConstantTable); - - static bool LoadFailed = false; - static D3DXCompileShaderFromFileFunction pFn = 0; - - if (!pFn && !LoadFailed) - { - // try to load dll - io::path strDllName = "d3dx9_"; - strDllName += (int)D3DX_SDK_VERSION; - strDllName += ".dll"; - - HMODULE hMod = LoadLibrary(strDllName.c_str()); - if (hMod) - pFn = (D3DXCompileShaderFromFileFunction)GetProcAddress(hMod, "D3DXCompileShaderFromFileA"); - - if (!pFn) - { - LoadFailed = true; - os::Printer::log("Could not load shader function D3DXCompileShaderFromFileA from dll, shaders disabled", - strDllName.c_str(), ELL_ERROR); - } - } - - if (pFn) - { - // call already loaded function - return (*pFn)(pSrcFile, pDefines, pInclude, pFunctionName, pProfile, Flags, ppShader, ppErrorMsgs, ppConstantTable); - } - } - #endif // D3DX_SDK_VERSION < 24 - - return 0; -} - - -} // end namespace video -} // end namespace irr - -#endif // _IRR_COMPILE_WITH_DIRECT3D_9_ diff --git a/source/Irrlicht/CD3D9ShaderMaterialRenderer.h b/source/Irrlicht/CD3D9ShaderMaterialRenderer.h deleted file mode 100644 index e7517906..00000000 --- a/source/Irrlicht/CD3D9ShaderMaterialRenderer.h +++ /dev/null @@ -1,108 +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_D3D9_SHADER_MATERIAL_RENDERER_H_INCLUDED__ -#define __C_D3D9_SHADER_MATERIAL_RENDERER_H_INCLUDED__ - -#include "IrrCompileConfig.h" -#ifdef _IRR_WINDOWS_ - -#ifdef _IRR_COMPILE_WITH_DIRECT3D_9_ -#if defined(__BORLANDC__) || defined (__BCPLUSPLUS__) -#include "irrMath.h" // needed by borland for sqrtf define -#endif -#include <d3dx9shader.h> - -#include "IMaterialRenderer.h" - -namespace irr -{ -namespace video -{ - -class IVideoDriver; -class IShaderConstantSetCallBack; -class IMaterialRenderer; - -//! Class for using vertex and pixel shaders with D3D9 -class CD3D9ShaderMaterialRenderer : public IMaterialRenderer -{ -public: - - //! Public constructor - CD3D9ShaderMaterialRenderer(IDirect3DDevice9* d3ddev, video::IVideoDriver* driver, - s32& outMaterialTypeNr, const c8* vertexShaderProgram, const c8* pixelShaderProgram, - IShaderConstantSetCallBack* callback, IMaterialRenderer* baseMaterial, s32 userData); - - //! Destructor - ~CD3D9ShaderMaterialRenderer(); - - virtual void OnSetMaterial(const video::SMaterial& material, const video::SMaterial& lastMaterial, - bool resetAllRenderstates, video::IMaterialRendererServices* services) _IRR_OVERRIDE_; - - virtual void OnUnsetMaterial() _IRR_OVERRIDE_; - - virtual bool OnRender(IMaterialRendererServices* service, E_VERTEX_TYPE vtxtype) _IRR_OVERRIDE_; - - //! Returns if the material is transparent. - virtual bool isTransparent() const _IRR_OVERRIDE_; - - //! Access the callback provided by the users when creating shader materials - virtual IShaderConstantSetCallBack* getShaderConstantSetCallBack() const _IRR_OVERRIDE_ - { - return CallBack; - } - -protected: - - //! constructor only for use by derived classes who want to - //! create a fall back material for example. - CD3D9ShaderMaterialRenderer(IDirect3DDevice9* d3ddev, - video::IVideoDriver* driver, - IShaderConstantSetCallBack* callback, - IMaterialRenderer* baseMaterial, - s32 userData=0); - - void init(s32& outMaterialTypeNr, const c8* vertexShaderProgram, const c8* pixelShaderProgram); - bool createPixelShader(const c8* pxsh); - bool createVertexShader(const char* vtxsh); - - HRESULT stubD3DXAssembleShader(LPCSTR pSrcData, UINT SrcDataLen, - CONST D3DXMACRO* pDefines, LPD3DXINCLUDE pInclude, - DWORD Flags, LPD3DXBUFFER* ppShader, - LPD3DXBUFFER* ppErrorMsgs); - - HRESULT stubD3DXAssembleShaderFromFile(LPCSTR pSrcFile, - CONST D3DXMACRO* pDefines, LPD3DXINCLUDE pInclude, DWORD Flags, - LPD3DXBUFFER* ppShader, LPD3DXBUFFER* ppErrorMsgs); - - HRESULT stubD3DXCompileShader(LPCSTR pSrcData, UINT SrcDataLen, CONST D3DXMACRO* pDefines, - LPD3DXINCLUDE pInclude, LPCSTR pFunctionName, - LPCSTR pProfile, DWORD Flags, LPD3DXBUFFER* ppShader, - LPD3DXBUFFER* ppErrorMsgs, LPD3DXCONSTANTTABLE* ppConstantTable); - - HRESULT stubD3DXCompileShaderFromFile(LPCSTR pSrcFile, CONST D3DXMACRO* pDefines, - LPD3DXINCLUDE pInclude, LPCSTR pFunctionName, - LPCSTR pProfile, DWORD Flags, LPD3DXBUFFER* ppShader, LPD3DXBUFFER* ppErrorMsgs, - LPD3DXCONSTANTTABLE* ppConstantTable); - - IDirect3DDevice9* pID3DDevice; - video::IVideoDriver* Driver; - IShaderConstantSetCallBack* CallBack; - IMaterialRenderer* BaseMaterial; - - IDirect3DVertexShader9* VertexShader; - IDirect3DVertexShader9* OldVertexShader; - IDirect3DPixelShader9* PixelShader; - s32 UserData; -}; - - -} // end namespace video -} // end namespace irr - -#endif -#endif -#endif - diff --git a/source/Irrlicht/CD3D9Texture.cpp b/source/Irrlicht/CD3D9Texture.cpp deleted file mode 100644 index 42a8df55..00000000 --- a/source/Irrlicht/CD3D9Texture.cpp +++ /dev/null @@ -1,758 +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_DIRECT3D_9_ - -#include "CD3D9Texture.h" -#include "CD3D9Driver.h" -#include "os.h" - -namespace irr -{ -namespace video -{ - -CD3D9Texture::CD3D9Texture(const io::path& name, const core::array<IImage*>& image, E_TEXTURE_TYPE type, CD3D9Driver* driver) - : ITexture(name, type), Driver(driver), InternalFormat(D3DFMT_UNKNOWN), LockReadOnly(false), LockData(0), LockLayer(0), - MipLevelLocked(0), HardwareMipMaps(false), Device(0), Texture(0), CubeTexture(0), RTTSurface(0) -{ -#ifdef _DEBUG - setDebugName("CD3D9Texture"); -#endif - - _IRR_DEBUG_BREAK_IF(image.size() == 0) - - Device=driver->getExposedVideoData().D3D9.D3DDev9; - - if (Device) - Device->AddRef(); - - DriverType = Driver->getDriverType(); - HasMipMaps = Driver->getTextureCreationFlag(ETCF_CREATE_MIP_MAPS); - HardwareMipMaps = Driver->getTextureCreationFlag(ETCF_AUTO_GENERATE_MIP_MAPS) && Driver->queryFeature(EVDF_MIP_MAP_AUTO_UPDATE); - - getImageValues(image[0]); - - DWORD flags = 0; - - if (HasMipMaps && HardwareMipMaps) - { - LPDIRECT3D9 intf = Driver->getExposedVideoData().D3D9.D3D9; - D3DDISPLAYMODE d3ddm; - intf->GetAdapterDisplayMode(Driver->Params.DisplayAdapter, &d3ddm); - - if (D3D_OK == intf->CheckDeviceFormat(Driver->Params.DisplayAdapter, D3DDEVTYPE_HAL, d3ddm.Format, D3DUSAGE_AUTOGENMIPMAP, D3DRTYPE_TEXTURE, InternalFormat)) - flags = D3DUSAGE_AUTOGENMIPMAP; - else - HardwareMipMaps = false; - } - - HRESULT hr = 0; - - switch (Type) - { - case ETT_2D: - hr = Device->CreateTexture(Size.Width, Size.Height, HasMipMaps ? 0 : 1, flags, InternalFormat, D3DPOOL_MANAGED, &Texture, NULL); - break; - case ETT_CUBEMAP: - hr = Device->CreateCubeTexture(Size.Width, HasMipMaps ? 0 : 1, flags, InternalFormat, D3DPOOL_MANAGED, &CubeTexture, NULL); - break; - default: - _IRR_DEBUG_BREAK_IF(true) - break; - } - - if (FAILED(hr)) - { - // Try again with 16-bit format - if (InternalFormat == D3DFMT_A8R8G8B8) - { - InternalFormat = D3DFMT_A1R5G5B5; - ColorFormat = ECF_A1R5G5B5; - } - else if (InternalFormat == D3DFMT_R8G8B8) // (24 bit is usually failing in d3d9, not sure if it's ever supported) - { - InternalFormat = D3DFMT_R5G6B5; - ColorFormat = ECF_R5G6B5; - } - switch (Type) - { - case ETT_2D: - hr = Device->CreateTexture(Size.Width, Size.Height, HasMipMaps ? 0 : 1, flags, InternalFormat, D3DPOOL_MANAGED, &Texture, NULL); - break; - case ETT_CUBEMAP: - hr = Device->CreateCubeTexture(Size.Width, HasMipMaps ? 0 : 1, flags, InternalFormat, D3DPOOL_MANAGED, &CubeTexture, NULL); - break; - } - } - - core::array<IImage*> tmpImage = image; - bool releaseImageData = false; - - if (SUCCEEDED(hr)) - { - if (OriginalSize != Size || OriginalColorFormat != ColorFormat) - { - releaseImageData = true; - - for (u32 i = 0; i < image.size(); ++i) - { - tmpImage[i] = Driver->createImage(ColorFormat, Size); - - if (image[i]->getDimension() == Size) - image[i]->copyTo(tmpImage[i]); - else - image[i]->copyToScaling(tmpImage[i]); - } - } - - for (u32 i = 0; i < tmpImage.size(); ++i) - uploadTexture(tmpImage[i]->getData(), 0, i); - - bool autoGenerateRequired = true; - - for (u32 i = 0; i < tmpImage.size(); ++i) - { - void* mipmapsData = tmpImage[i]->getMipMapsData(); - - if (autoGenerateRequired || mipmapsData) - regenerateMipMapLevels(mipmapsData, i); - - if (!mipmapsData) - autoGenerateRequired = false; - } - } - else - { - switch (hr ) - { - case D3DERR_INVALIDCALL: - os::Printer::log("Could not create DIRECT3D9 Texture. D3DERR_INVALIDCALL", ELL_WARNING); - break; - case D3DERR_OUTOFVIDEOMEMORY: - os::Printer::log("Could not create DIRECT3D9 Texture. D3DERR_OUTOFVIDEOMEMORY", ELL_WARNING); - break; - case E_OUTOFMEMORY: - os::Printer::log("Could not create DIRECT3D9 Texture. E_OUTOFMEMORY", ELL_WARNING); - break; - default: - os::Printer::log("Could not create DIRECT3D9 Texture.", ELL_WARNING); - } - } - - if (releaseImageData) - { - for (u32 i = 0; i < tmpImage.size(); ++i) - tmpImage[i]->drop(); - } -} - -CD3D9Texture::CD3D9Texture(CD3D9Driver* driver, const core::dimension2d<u32>& size, const io::path& name, E_TEXTURE_TYPE type, const ECOLOR_FORMAT format) - : ITexture(name, type), Driver(driver), InternalFormat(D3DFMT_UNKNOWN), LockReadOnly(false), LockData(0), LockLayer(0), - MipLevelLocked(0), HardwareMipMaps(false), Device(0), Texture(0), CubeTexture(0), RTTSurface(0) -{ -#ifdef _DEBUG - setDebugName("CD3D9Texture"); -#endif - - Device = driver->getExposedVideoData().D3D9.D3DDev9; - - if (Device) - Device->AddRef(); - - DriverType = Driver->getDriverType(); - HasMipMaps = false; - IsRenderTarget = true; - - OriginalColorFormat = format; - - if (ECF_UNKNOWN == OriginalColorFormat) - ColorFormat = getBestColorFormat(Driver->getColorFormat()); - else - ColorFormat = OriginalColorFormat; - - OriginalSize = size; - Size = OriginalSize; - - if (!Driver->queryFeature(EVDF_TEXTURE_NPOT)) - { - Size = Size.getOptimalSize(true, !Driver->queryFeature(EVDF_TEXTURE_NSQUARE), true, Driver->Caps.MaxTextureWidth); - - if (Size != OriginalSize) - os::Printer::log("RenderTarget size has to be a power of two", ELL_INFORMATION); - } - - Pitch = Size.Width * IImage::getBitsPerPixelFromFormat(ColorFormat) / 8; - - InternalFormat = Driver->getD3DFormatFromColorFormat(ColorFormat); - - generateRenderTarget(); -} - -CD3D9Texture::~CD3D9Texture() -{ - releaseTexture(); - - if (Device) - Device->Release(); -} - -void* CD3D9Texture::lock(E_TEXTURE_LOCK_MODE mode, u32 mipmapLevel, u32 layer, E_TEXTURE_LOCK_FLAGS lockFlags) -{ - if (LockData) - return LockData; - - if (IImage::isCompressedFormat(ColorFormat)) - return 0; - - MipLevelLocked = mipmapLevel; - LockReadOnly = (mode == ETLM_READ_ONLY); - LockLayer = layer; - - HRESULT hr; - D3DLOCKED_RECT rect; - - if (!IsRenderTarget) - { - if (Texture) - { - hr = Texture->LockRect(MipLevelLocked, &rect, 0, LockReadOnly ? D3DLOCK_READONLY : 0); - } - else if (CubeTexture) - { - _IRR_DEBUG_BREAK_IF(layer > 5) - - hr = CubeTexture->LockRect(static_cast<_D3DCUBEMAP_FACES>(layer), MipLevelLocked, &rect, 0, LockReadOnly ? D3DLOCK_READONLY : 0); - } - else - { - os::Printer::log("Could not lock DIRECT3D9 Texture. Missing internal D3D texture.", ELL_ERROR); - return 0; - } - - if (FAILED(hr)) - { - os::Printer::log("Could not lock DIRECT3D9 Texture.", ELL_ERROR); - return 0; - } - } - else - { - if (!RTTSurface) - { - // Make RTT surface large enough for all miplevels (including 0) - D3DSURFACE_DESC desc; - if (Texture) - Texture->GetLevelDesc(0, &desc); - else if (CubeTexture) - CubeTexture->GetLevelDesc(0, &desc); - hr = Device->CreateOffscreenPlainSurface(desc.Width, desc.Height, desc.Format, D3DPOOL_SYSTEMMEM, &RTTSurface, 0); - if (FAILED(hr)) - { - os::Printer::log("Could not lock DIRECT3D9 Texture", "Offscreen surface creation failed.", ELL_ERROR); - return 0; - } - } - - IDirect3DSurface9 *surface = 0; - if (Texture) - hr = Texture->GetSurfaceLevel(MipLevelLocked, &surface); - else if (CubeTexture) - hr = CubeTexture->GetCubeMapSurface(static_cast<_D3DCUBEMAP_FACES>(layer), MipLevelLocked, &surface); - if (FAILED(hr)) - { - os::Printer::log("Could not lock DIRECT3D9 Texture", "Could not get surface.", ELL_ERROR); - return 0; - } - hr = Device->GetRenderTargetData(surface, RTTSurface); - surface->Release(); - if(FAILED(hr)) - { - os::Printer::log("Could not lock DIRECT3D9 Texture", "Data copy failed.", ELL_ERROR); - return 0; - } - hr = RTTSurface->LockRect(&rect, 0, LockReadOnly ? D3DLOCK_READONLY : 0); - if(FAILED(hr)) - { - os::Printer::log("Could not lock DIRECT3D9 Texture", "LockRect failed.", ELL_ERROR); - return 0; - } - } - - LockData = rect.pBits; - - return LockData; -} - -void CD3D9Texture::unlock() -{ - if (!LockData) - return; - - if (!IsRenderTarget) - { - if (Texture) - { - Texture->UnlockRect(MipLevelLocked); - } - else if (CubeTexture) - { - CubeTexture->UnlockRect(static_cast<_D3DCUBEMAP_FACES>(LockLayer), MipLevelLocked); - } - } - else if (RTTSurface) - { - RTTSurface->UnlockRect(); - } - - LockReadOnly = false; - LockData = 0; - LockLayer = 0; -} - -void CD3D9Texture::regenerateMipMapLevels(void* data, u32 layer) -{ - if (!HasMipMaps || (Size.Width <= 1 && Size.Height <= 1)) - return; - - if ( HardwareMipMaps ) - { - // Can't update with custom data with those unfortunately - // Also MSDN docs don't mention it, but GenerateMipSubLevels only works when AUTOGENMIPMAP is set. - // So we can't call this to get hardware mipmaps when not setting AUTOGENMIPMAP. - if (Texture) - Texture->GenerateMipSubLevels(); - else if (CubeTexture) - CubeTexture->GenerateMipSubLevels(); - } - else if (data) - { - u32 width = Size.Width; - u32 height = Size.Height; - u8* tmpData = static_cast<u8*>(data); - u32 dataSize = 0; - u32 level = 0; - - do - { - if (width > 1) - width >>= 1; - - if (height > 1) - height >>= 1; - - dataSize = IImage::getDataSizeFromFormat(ColorFormat, width, height); - ++level; - - uploadTexture(tmpData, level, layer); - - tmpData += dataSize; - } while (width != 1 || height != 1); - } - else - { - createManualMipMaps(1); - } -} - -void CD3D9Texture::copy16BitMipMap(char* src, char* tgt, - s32 width, s32 height, - s32 pitchsrc, s32 pitchtgt) const -{ - for (s32 y=0; y<height; ++y) - { - for (s32 x=0; x<width; ++x) - { - u32 a=0, r=0, g=0, b=0; - - for (s32 dy=0; dy<2; ++dy) - { - const s32 tgy = (y*2)+dy; - for (s32 dx=0; dx<2; ++dx) - { - const s32 tgx = (x*2)+dx; - - SColor c; - if (ColorFormat == ECF_A1R5G5B5) - c = A1R5G5B5toA8R8G8B8(*(u16*)(&src[(tgx*2)+(tgy*pitchsrc)])); - else - c = R5G6B5toA8R8G8B8(*(u16*)(&src[(tgx*2)+(tgy*pitchsrc)])); - - a += c.getAlpha(); - r += c.getRed(); - g += c.getGreen(); - b += c.getBlue(); - } - } - - a /= 4; - r /= 4; - g /= 4; - b /= 4; - - u16 c; - if (ColorFormat == ECF_A1R5G5B5) - c = RGBA16(r,g,b,a); - else - c = A8R8G8B8toR5G6B5(SColor(a,r,g,b).color); - *(u16*)(&tgt[(x*2)+(y*pitchtgt)]) = c; - } - } -} - -void CD3D9Texture::copy32BitMipMap(char* src, char* tgt, - s32 width, s32 height, - s32 pitchsrc, s32 pitchtgt) const -{ - for (s32 y=0; y<height; ++y) - { - for (s32 x=0; x<width; ++x) - { - u32 a=0, r=0, g=0, b=0; - SColor c; - - for (s32 dy=0; dy<2; ++dy) - { - const s32 tgy = (y*2)+dy; - for (s32 dx=0; dx<2; ++dx) - { - const s32 tgx = (x*2)+dx; - - c = *(u32*)(&src[(tgx*4)+(tgy*pitchsrc)]); - - a += c.getAlpha(); - r += c.getRed(); - g += c.getGreen(); - b += c.getBlue(); - } - } - - a /= 4; - r /= 4; - g /= 4; - b /= 4; - - c.set(a, r, g, b); - *(u32*)(&tgt[(x*4)+(y*pitchtgt)]) = c.color; - } - } -} - -bool CD3D9Texture::createManualMipMaps(u32 level) -{ - if (level==0) - return true; - - if (!Texture) //Manual mips for CubeTexture not supported yet - { - return true; - } - - // manual mipmap generation - IDirect3DSurface9* upperSurface = 0; - IDirect3DSurface9* lowerSurface = 0; - - // get upper level - HRESULT hr = Texture->GetSurfaceLevel(level-1, &upperSurface); - if (FAILED(hr) || !upperSurface) - { - os::Printer::log("Could not get upper surface level for mip map generation", ELL_WARNING); - return false; - } - - // get lower level - hr = Texture->GetSurfaceLevel(level, &lowerSurface); - if (FAILED(hr) || !lowerSurface) - { - os::Printer::log("Could not get lower surface level for mip map generation", ELL_WARNING); - upperSurface->Release(); - return false; - } - - D3DSURFACE_DESC upperDesc, lowerDesc; - upperSurface->GetDesc(&upperDesc); - lowerSurface->GetDesc(&lowerDesc); - - D3DLOCKED_RECT upperlr; - D3DLOCKED_RECT lowerlr; - - // lock upper surface - if (FAILED(upperSurface->LockRect(&upperlr, NULL, 0))) - { - upperSurface->Release(); - lowerSurface->Release(); - os::Printer::log("Could not lock upper texture for mip map generation", ELL_WARNING); - return false; - } - - // lock lower surface - if (FAILED(lowerSurface->LockRect(&lowerlr, NULL, 0))) - { - upperSurface->UnlockRect(); - upperSurface->Release(); - lowerSurface->Release(); - os::Printer::log("Could not lock lower texture for mip map generation", ELL_WARNING); - return false; - } - - if (upperDesc.Format != lowerDesc.Format) - { - os::Printer::log("Cannot copy mip maps with different formats.", ELL_WARNING); - } - else - { - if ((upperDesc.Format == D3DFMT_A1R5G5B5) || (upperDesc.Format == D3DFMT_R5G6B5)) - copy16BitMipMap((char*)upperlr.pBits, (char*)lowerlr.pBits, - lowerDesc.Width, lowerDesc.Height, - upperlr.Pitch, lowerlr.Pitch); - else - if (upperDesc.Format == D3DFMT_A8R8G8B8) - copy32BitMipMap((char*)upperlr.pBits, (char*)lowerlr.pBits, - lowerDesc.Width, lowerDesc.Height, - upperlr.Pitch, lowerlr.Pitch); - else - os::Printer::log("Unsupported mipmap format, cannot copy.", ELL_WARNING); - } - - bool result=true; - // unlock - if (FAILED(upperSurface->UnlockRect())) - result=false; - if (FAILED(lowerSurface->UnlockRect())) - result=false; - - // release - upperSurface->Release(); - lowerSurface->Release(); - - if (!result || (upperDesc.Width <= 3 && upperDesc.Height <= 3)) - return result; // stop generating levels - - // generate next level - return createManualMipMaps(level+1); -} - - -IDirect3DBaseTexture9* CD3D9Texture::getDX9BaseTexture() const -{ - return (Texture) ? static_cast<IDirect3DBaseTexture9*>(Texture) : static_cast<IDirect3DBaseTexture9*>(CubeTexture); -} - -IDirect3DTexture9* CD3D9Texture::getDX9Texture() const -{ - return Texture; -} - -IDirect3DCubeTexture9* CD3D9Texture::getDX9CubeTexture() const -{ - return CubeTexture; -} - -void CD3D9Texture::releaseTexture() -{ - if (RTTSurface) - { - if (RTTSurface->Release() == 0) - RTTSurface = 0; - } - - if (Texture) - { - if (Texture->Release() == 0) - Texture = 0; - } - - if (CubeTexture) - { - if (CubeTexture->Release() == 0) - CubeTexture = 0; - } -} - -void CD3D9Texture::generateRenderTarget() -{ - DWORD flags = (IImage::isDepthFormat(ColorFormat)) ? D3DUSAGE_DEPTHSTENCIL : D3DUSAGE_RENDERTARGET; - - HRESULT hr = 0; - - switch (Type) - { - case ETT_2D: - if (!Texture ) - hr = Device->CreateTexture(Size.Width, Size.Height, 1, flags, InternalFormat, D3DPOOL_DEFAULT, &Texture, NULL); - break; - case ETT_CUBEMAP: - if (!CubeTexture) - hr = Device->CreateCubeTexture(Size.Width, 1, flags, InternalFormat, D3DPOOL_DEFAULT, &CubeTexture, NULL); - break; - default: - _IRR_DEBUG_BREAK_IF(true) - break; - } - - if (FAILED(hr)) - { - if (D3DERR_INVALIDCALL == hr) - os::Printer::log("Could not create render target texture", "Invalid Call", irr::ELL_ERROR); - else if (D3DERR_OUTOFVIDEOMEMORY == hr) - os::Printer::log("Could not create render target texture", "Out of Video Memory", irr::ELL_ERROR); - else if (E_OUTOFMEMORY == hr) - os::Printer::log("Could not create render target texture", "Out of Memory", irr::ELL_ERROR); - else - os::Printer::log("Could not create render target texture", irr::ELL_ERROR); - core::stringc params("Width:"); - params += (unsigned int)Size.Width; - params += " Height: "; - params += (unsigned int)Size.Height; - params += " flag: "; - params += (unsigned int)flags; - params += " format"; - params += (unsigned int)InternalFormat; - params += " Type: "; - params += (unsigned int)Type; - os::Printer::log(params.c_str(), irr::ELL_ERROR); - } -} - -ECOLOR_FORMAT CD3D9Texture::getBestColorFormat(ECOLOR_FORMAT format) -{ - // We only try for to adapt "simple" formats - ECOLOR_FORMAT destFormat = (format <= ECF_A8R8G8B8) ? ECF_A8R8G8B8 : format; - - switch (format) - { - case ECF_A1R5G5B5: - if (!Driver->getTextureCreationFlag(ETCF_ALWAYS_32_BIT)) - destFormat = ECF_A1R5G5B5; - break; - case ECF_R5G6B5: - if (!Driver->getTextureCreationFlag(ETCF_ALWAYS_32_BIT)) - destFormat = ECF_R5G6B5; - break; - case ECF_A8R8G8B8: - if (Driver->getTextureCreationFlag(ETCF_ALWAYS_16_BIT) || - Driver->getTextureCreationFlag(ETCF_OPTIMIZED_FOR_SPEED)) - destFormat = ECF_A1R5G5B5; - break; - case ECF_R8G8B8: - // Note: Using ECF_A8R8G8B8 even when ETCF_ALWAYS_32_BIT is not set as 24 bit textures fail with too many cards - if (Driver->getTextureCreationFlag(ETCF_ALWAYS_16_BIT) || Driver->getTextureCreationFlag(ETCF_OPTIMIZED_FOR_SPEED)) - destFormat = ECF_A1R5G5B5; - default: - break; - } - - if (Driver->getTextureCreationFlag(ETCF_NO_ALPHA_CHANNEL)) - { - switch (destFormat) - { - case ECF_A1R5G5B5: - destFormat = ECF_R5G6B5; - break; - case ECF_A8R8G8B8: - destFormat = ECF_R8G8B8; - break; - default: - break; - } - } - - return destFormat; -} - -void CD3D9Texture::getImageValues(const IImage* image) -{ - OriginalColorFormat = image->getColorFormat(); - ColorFormat = getBestColorFormat(OriginalColorFormat); - - InternalFormat = Driver->getD3DFormatFromColorFormat(ColorFormat); - - if (IImage::isCompressedFormat(image->getColorFormat())) - { - HardwareMipMaps = false; - } - - OriginalSize = image->getDimension(); - Size = OriginalSize; - - if (Size.Width == 0 || Size.Height == 0) - { - os::Printer::log("Invalid size of image for texture.", ELL_ERROR); - return; - } - - const f32 ratio = (f32)Size.Width / (f32)Size.Height; - - if ((Size.Width > Driver->Caps.MaxTextureWidth) && (ratio >= 1.f)) - { - Size.Width = Driver->Caps.MaxTextureWidth; - Size.Height = (u32)(Driver->Caps.MaxTextureWidth / ratio); - } - else if (Size.Height > Driver->Caps.MaxTextureHeight) - { - Size.Height = Driver->Caps.MaxTextureHeight; - Size.Width = (u32)(Driver->Caps.MaxTextureHeight * ratio); - } - - bool needSquare = (!Driver->queryFeature(EVDF_TEXTURE_NSQUARE) || Type == ETT_CUBEMAP); - - Size = Size.getOptimalSize(!Driver->queryFeature(EVDF_TEXTURE_NPOT), needSquare, true, Driver->Caps.MaxTextureWidth); - - Pitch = Size.Width * IImage::getBitsPerPixelFromFormat(ColorFormat) / 8; -} - -void CD3D9Texture::uploadTexture(void* data, u32 mipmapLevel, u32 layer) -{ - if (!data) - return; - - u32 width = Size.Width >> mipmapLevel; - u32 height = Size.Height >> mipmapLevel; - - u32 dataSize = IImage::getDataSizeFromFormat(ColorFormat, width, height); - - HRESULT hr = 0; - - D3DLOCKED_RECT lockRectangle; - - if (Texture) - { - hr = Texture->LockRect(mipmapLevel, &lockRectangle, 0, 0); - } - else if (CubeTexture) - { - _IRR_DEBUG_BREAK_IF(layer > 5) - - hr = CubeTexture->LockRect(static_cast<_D3DCUBEMAP_FACES>(layer), mipmapLevel, &lockRectangle, 0, 0); - } - - if (FAILED(hr)) - { - os::Printer::log("Texture data not copied", "Could not LockRect D3D9 Texture.", ELL_ERROR); - return; - } - - memcpy(lockRectangle.pBits, data, dataSize); - - if (Texture) - { - hr = Texture->UnlockRect(mipmapLevel); - } - else if (CubeTexture) - { - hr = CubeTexture->UnlockRect(static_cast<_D3DCUBEMAP_FACES>(layer), mipmapLevel); - } - - if (FAILED(hr)) - { - os::Printer::log("Texture data not copied", "Could not UnlockRect D3D9 Texture.", ELL_ERROR); - } -} - -} -} - -#endif diff --git a/source/Irrlicht/CD3D9Texture.h b/source/Irrlicht/CD3D9Texture.h deleted file mode 100644 index 879f1437..00000000 --- a/source/Irrlicht/CD3D9Texture.h +++ /dev/null @@ -1,91 +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_DIRECTX9_TEXTURE_H_INCLUDED__ -#define __C_DIRECTX9_TEXTURE_H_INCLUDED__ - -#include "IrrCompileConfig.h" -#ifdef _IRR_COMPILE_WITH_DIRECT3D_9_ - -#include "irrArray.h" -#include "ITexture.h" -#include "IImage.h" -#if defined(__BORLANDC__) || defined (__BCPLUSPLUS__) -#include "irrMath.h" // needed by borland for sqrtf define -#endif -#include <d3d9.h> - -namespace irr -{ -namespace video -{ - -class CD3D9Driver; - -class CD3D9Texture : public ITexture -{ -public: - CD3D9Texture(const io::path& name, const core::array<IImage*>& image, E_TEXTURE_TYPE type, CD3D9Driver* driver); - - CD3D9Texture(CD3D9Driver* driver, const core::dimension2d<u32>& size, const io::path& name, E_TEXTURE_TYPE type, const ECOLOR_FORMAT format = ECF_UNKNOWN); - - virtual ~CD3D9Texture(); - - virtual void* lock(E_TEXTURE_LOCK_MODE mode = ETLM_READ_WRITE, u32 mipmapLevel=0, u32 layer = 0, E_TEXTURE_LOCK_FLAGS lockFlags = ETLF_FLIP_Y_UP_RTT) _IRR_OVERRIDE_; - - virtual void unlock() _IRR_OVERRIDE_; - - virtual void regenerateMipMapLevels(void* data = 0, u32 layer = 0) _IRR_OVERRIDE_; - - IDirect3DBaseTexture9* getDX9BaseTexture() const; - IDirect3DTexture9* getDX9Texture() const; - IDirect3DCubeTexture9* getDX9CubeTexture() const; - -private: - friend class CD3D9Driver; - - void releaseTexture(); - - void generateRenderTarget(); - - ECOLOR_FORMAT getBestColorFormat(ECOLOR_FORMAT format); - - void getImageValues(const IImage* image); - - void uploadTexture(void* data, u32 mipmapLevel, u32 layer); - - //! Helper function for mipmap generation. - bool createManualMipMaps(u32 level); - - //! Helper function for mipmap generation. - void copy16BitMipMap(char* src, char* tgt, - s32 width, s32 height, s32 pitchsrc, s32 pitchtgt) const; - - //! Helper function for mipmap generation. - void copy32BitMipMap(char* src, char* tgt, - s32 width, s32 height, s32 pitchsrc, s32 pitchtgt) const; - - - CD3D9Driver* Driver; - - D3DFORMAT InternalFormat; - - bool LockReadOnly; - void* LockData; - u32 LockLayer; - u32 MipLevelLocked; - - bool HardwareMipMaps; - - IDirect3DDevice9* Device; - IDirect3DTexture9* Texture; - IDirect3DCubeTexture9* CubeTexture; - IDirect3DSurface9* RTTSurface; -}; - -} -} - -#endif -#endif diff --git a/source/Irrlicht/CDMFLoader.cpp b/source/Irrlicht/CDMFLoader.cpp deleted file mode 100644 index 0e42363a..00000000 --- a/source/Irrlicht/CDMFLoader.cpp +++ /dev/null @@ -1,431 +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 -// -// This file was originally written by Salvatore Russo. -// I (Nikolaus Gebhardt) did some minor modifications and changes to it and -// integrated it into Irrlicht. -// Thanks a lot to Salvatore for his work on this and that he gave me -// his permission to add it into Irrlicht using the zlib license. -/* - CDMFLoader by Salvatore Russo (September 2005) - - See the header file for additional information including use and distribution rights. -*/ - -#include "IrrCompileConfig.h" -#ifdef _IRR_COMPILE_WITH_DMF_LOADER_ - -#ifdef _DEBUG -#define _IRR_DMF_DEBUG_ -#include "os.h" -#endif - -#include "CDMFLoader.h" -#include "CMeshTextureLoader.h" -#include "ISceneManager.h" -#include "IAttributes.h" -#include "SAnimatedMesh.h" -#include "SSkinMeshBuffer.h" -#include "irrString.h" -#include "irrMath.h" -#include "dmfsupport.h" - -namespace irr -{ -namespace scene -{ - -/** Constructor*/ -CDMFLoader::CDMFLoader(ISceneManager* smgr, io::IFileSystem* filesys) -: SceneMgr(smgr), FileSystem(filesys) -{ - #ifdef _DEBUG - IReferenceCounted::setDebugName("CDMFLoader"); - #endif - - TextureLoader = new CMeshTextureLoader( FileSystem, SceneMgr->getVideoDriver() ); -} - -void CDMFLoader::addMaterialPath(core::stringc& filename, const core::stringc& matPath) -{ - c8 last = matPath.lastChar(); - if ( last == '/' || last == '\\' ) - filename = matPath+filename; - else - { - core::stringc matPathSlash(matPath); - matPathSlash.append('/'); - filename = matPathSlash+filename; - } -} - - -/**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* CDMFLoader::createMesh(io::IReadFile* file) -{ - if (!file) - return 0; - - if ( getMeshTextureLoader() ) - { - getMeshTextureLoader()->setMeshFile(file); - - if ( SceneMgr->getParameters()->existsAttribute(DMF_TEXTURE_PATH) ) - getMeshTextureLoader()->setTexturePath( SceneMgr->getParameters()->getAttributeAsString(DMF_TEXTURE_PATH) ); - } - - video::IVideoDriver* driver = SceneMgr->getVideoDriver(); - - //Load stringlist - StringList dmfRawFile; - LoadFromFile(file, dmfRawFile); - - if (dmfRawFile.size()==0) - return 0; - - SMesh * mesh = new SMesh(); - - u32 i; - - dmfHeader header; - - //load header - core::array<dmfMaterial> materiali; - if (GetDMFHeader(dmfRawFile, header)) - { - //let's set ambient light - SceneMgr->setAmbientLight(header.dmfAmbient); - - //let's create the correct number of materials, vertices and faces - dmfVert *verts=new dmfVert[header.numVertices]; - dmfFace *faces=new dmfFace[header.numFaces]; - - //let's get the materials -#ifdef _IRR_DMF_DEBUG_ - os::Printer::log("Loading materials", core::stringc(header.numMaterials).c_str()); -#endif - GetDMFMaterials(dmfRawFile, materiali, header.numMaterials); - - //let's get vertices and faces -#ifdef _IRR_DMF_DEBUG_ - os::Printer::log("Loading geometry"); -#endif - GetDMFVerticesFaces(dmfRawFile, verts, faces); - - //create a meshbuffer for each material, then we'll remove empty ones -#ifdef _IRR_DMF_DEBUG_ - os::Printer::log("Creating meshbuffers."); -#endif - for (i=0; i<header.numMaterials; i++) - { - //create a new SMeshBufferLightMap for each material - SSkinMeshBuffer* buffer = new SSkinMeshBuffer(); - buffer->Material.MaterialType = video::EMT_LIGHTMAP_LIGHTING; - buffer->Material.Wireframe = false; - buffer->Material.Lighting = true; - mesh->addMeshBuffer(buffer); - buffer->drop(); - } - - // Build the mesh buffers -#ifdef _IRR_DMF_DEBUG_ - os::Printer::log("Adding geometry to mesh."); -#endif - for (i = 0; i < header.numFaces; i++) - { -#ifdef _IRR_DMF_DEBUG_ - os::Printer::log("Polygon with #vertices", core::stringc(faces[i].numVerts).c_str()); -#endif - if (faces[i].numVerts < 3) - continue; - - const core::vector3df normal = - core::triangle3df(verts[faces[i].firstVert].pos, - verts[faces[i].firstVert+1].pos, - verts[faces[i].firstVert+2].pos).getNormal().normalize(); - - SSkinMeshBuffer* meshBuffer = (SSkinMeshBuffer*)mesh->getMeshBuffer( - faces[i].materialID); - - const bool use2TCoords = meshBuffer->Vertices_2TCoords.size() || - materiali[faces[i].materialID].lightmapName.size(); - if (use2TCoords && meshBuffer->Vertices_Standard.size()) - meshBuffer->convertTo2TCoords(); - const u32 base = meshBuffer->Vertices_2TCoords.size()?meshBuffer->Vertices_2TCoords.size():meshBuffer->Vertices_Standard.size(); - - // Add this face's verts - if (use2TCoords) - { - // make sure we have the proper type set - meshBuffer->VertexType=video::EVT_2TCOORDS; - for (u32 v = 0; v < faces[i].numVerts; v++) - { - const dmfVert& vv = verts[faces[i].firstVert + v]; - video::S3DVertex2TCoords vert(vv.pos, - normal, video::SColor(255,255,255,255), vv.tc, vv.lc); - if (materiali[faces[i].materialID].textureBlend==4 && - SceneMgr->getParameters()->getAttributeAsBool(DMF_FLIP_ALPHA_TEXTURES)) - { - vert.TCoords.set(vv.tc.X,-vv.tc.Y); - } - meshBuffer->Vertices_2TCoords.push_back(vert); - } - } - else - { - for (u32 v = 0; v < faces[i].numVerts; v++) - { - const dmfVert& vv = verts[faces[i].firstVert + v]; - video::S3DVertex vert(vv.pos, - normal, video::SColor(255,255,255,255), vv.tc); - if (materiali[faces[i].materialID].textureBlend==4 && - SceneMgr->getParameters()->getAttributeAsBool(DMF_FLIP_ALPHA_TEXTURES)) - { - vert.TCoords.set(vv.tc.X,-vv.tc.Y); - } - meshBuffer->Vertices_Standard.push_back(vert); - } - } - - // Now add the indices - // This weird loop turns convex polygons into triangle strips. - // I do it this way instead of a simple fan because it usually - // looks a lot better in wireframe, for example. - u32 h = faces[i].numVerts - 1, l = 0, c; // High, Low, Center - for (u32 v = 0; v < faces[i].numVerts - 2; v++) - { - if (v & 1) // odd - c = h - 1; - else // even - c = l + 1; - - meshBuffer->Indices.push_back(base + h); - meshBuffer->Indices.push_back(base + l); - meshBuffer->Indices.push_back(base + c); - - if (v & 1) // odd - h--; - else // even - l++; - } - } - - delete [] verts; - delete [] faces; - } - - // delete all buffers without geometry in it. -#ifdef _IRR_DMF_DEBUG_ - os::Printer::log("Cleaning meshbuffers."); -#endif - i = 0; - while(i < mesh->MeshBuffers.size()) - { - if (mesh->MeshBuffers[i]->getVertexCount() == 0 || - mesh->MeshBuffers[i]->getIndexCount() == 0) - { - // Meshbuffer is empty -- drop it - mesh->MeshBuffers[i]->drop(); - mesh->MeshBuffers.erase(i); - materiali.erase(i); - } - else - { - i++; - } - } - - - { - //load textures and lightmaps in materials. - //don't worry if you receive a could not load texture, cause if you don't need - //a particular material in your scene it will be loaded and then destroyed. -#ifdef _IRR_DMF_DEBUG_ - os::Printer::log("Loading textures."); -#endif - const bool use_mat_dirs=!SceneMgr->getParameters()->getAttributeAsBool(DMF_IGNORE_MATERIALS_DIRS); - - for (i=0; i<mesh->getMeshBufferCount(); i++) - { - //texture and lightmap - video::ITexture *tex = 0; - video::ITexture *lig = 0; - - //current buffer to apply material - video::SMaterial& mat = mesh->getMeshBuffer(i)->getMaterial(); - - //Primary texture is normal - if (materiali[i].textureFlag==0) - { - if (materiali[i].textureBlend==4) - driver->setTextureCreationFlag(video::ETCF_ALWAYS_32_BIT,true); - - if ( use_mat_dirs ) - addMaterialPath(materiali[i].textureName, materiali[i].pathName); - tex = getMeshTextureLoader() ? getMeshTextureLoader()->getTexture( materiali[i].textureName ) : NULL; - } - //Primary texture is just a color - else if(materiali[i].textureFlag==1) - { - video::SColor color(axtoi(materiali[i].textureName.c_str())); - - //just for compatibility with older Irrlicht versions - //to support transparent materials - if (color.getAlpha()!=255 && materiali[i].textureBlend==4) - driver->setTextureCreationFlag(video::ETCF_ALWAYS_32_BIT,true); - - video::IImage *immagine= driver->createImage(video::ECF_A8R8G8B8, - core::dimension2d<u32>(8,8)); - immagine->fill(color); - tex = driver->addTexture("", immagine); - immagine->drop(); - - //to support transparent materials - if (color.getAlpha()!=255 && materiali[i].textureBlend==4) - { - mat.MaterialType = video::EMT_TRANSPARENT_ALPHA_CHANNEL; - mat.MaterialTypeParam =(((f32) (color.getAlpha()-1))/255.0f); - } - } - - //Lightmap is present - if (materiali[i].lightmapFlag == 0) - { - if ( use_mat_dirs ) - addMaterialPath(materiali[i].lightmapName, materiali[i].pathName); - lig = getMeshTextureLoader() ? getMeshTextureLoader()->getTexture(materiali[i].lightmapName) : NULL; - } - else //no lightmap - { - mat.MaterialType = video::EMT_SOLID; - const f32 mult = 100.0f - header.dmfShadow; - mat.AmbientColor=header.dmfAmbient.getInterpolated(video::SColor(255,0,0,0),mult/100.f); - } - - if (materiali[i].textureBlend==4) - { - mat.MaterialType = video::EMT_TRANSPARENT_ALPHA_CHANNEL; - mat.MaterialTypeParam = - SceneMgr->getParameters()->getAttributeAsFloat(DMF_ALPHA_CHANNEL_REF); - } - - //if texture is present mirror vertically owing to DeleD representation - if (tex && header.dmfVersion<1.1) - { - const core::dimension2d<u32> texsize = tex->getSize(); - void* pp = tex->lock(); - if (pp) - { - const video::ECOLOR_FORMAT format = tex->getColorFormat(); - if (format == video::ECF_A1R5G5B5) - { - s16* p = (s16*)pp; - s16 tmp=0; - for (u32 x=0; x<texsize.Width; x++) - for (u32 y=0; y<texsize.Height/2; y++) - { - tmp=p[y*texsize.Width + x]; - p[y*texsize.Width + x] = p[(texsize.Height-y-1)*texsize.Width + x]; - p[(texsize.Height-y-1)*texsize.Width + x]=tmp; - } - } - else - if (format == video::ECF_A8R8G8B8) - { - s32* p = (s32*)pp; - s32 tmp=0; - for (u32 x=0; x<texsize.Width; x++) - for (u32 y=0; y<texsize.Height/2; y++) - { - tmp=p[y*texsize.Width + x]; - p[y*texsize.Width + x] = p[(texsize.Height-y-1)*texsize.Width + x]; - p[(texsize.Height-y-1)*texsize.Width + x]=tmp; - } - } - } - tex->unlock(); - tex->regenerateMipMapLevels(); - } - - //if lightmap is present mirror vertically owing to DeleD rapresentation - if (lig && header.dmfVersion<1.1) - { - const core::dimension2d<u32> ligsize=lig->getSize(); - void* pp = lig->lock(); - if (pp) - { - video::ECOLOR_FORMAT format = lig->getColorFormat(); - if (format == video::ECF_A1R5G5B5) - { - s16* p = (s16*)pp; - s16 tmp=0; - for (u32 x=0; x<ligsize.Width; x++) - { - for (u32 y=0; y<ligsize.Height/2; y++) - { - tmp=p[y*ligsize.Width + x]; - p[y*ligsize.Width + x] = p[(ligsize.Height-y-1)*ligsize.Width + x]; - p[(ligsize.Height-y-1)*ligsize.Width + x]=tmp; - } - } - } - else if (format == video::ECF_A8R8G8B8) - { - s32* p = (s32*)pp; - s32 tmp=0; - for (u32 x=0; x<ligsize.Width; x++) - { - for (u32 y=0; y<ligsize.Height/2; y++) - { - tmp=p[y*ligsize.Width + x]; - p[y*ligsize.Width + x] = p[(ligsize.Height-y-1)*ligsize.Width + x]; - p[(ligsize.Height-y-1)*ligsize.Width + x]=tmp; - } - } - } - } - lig->unlock(); - lig->regenerateMipMapLevels(); - } - - mat.setTexture(0, tex); - mat.setTexture(1, lig); - } - } - - // create bounding box - for (i = 0; i < mesh->MeshBuffers.size(); ++i) - { - mesh->MeshBuffers[i]->recalculateBoundingBox(); - } - mesh->recalculateBoundingBox(); - - // Set up an animated mesh to hold the mesh - SAnimatedMesh* AMesh = new SAnimatedMesh(); - AMesh->Type = EAMT_UNKNOWN; - AMesh->addMesh(mesh); - AMesh->recalculateBoundingBox(); - mesh->drop(); - - return AMesh; -} - - -/** \brief Tell us if this file is able to be loaded by this class - based on the file extension (e.g. ".bsp") - \return true if file is loadable.*/ -bool CDMFLoader::isALoadableFileExtension(const io::path& filename) const -{ - return core::hasFileExtension ( filename, "dmf" ); -} - - -} // end namespace scene -} // end namespace irr - -#endif // _IRR_COMPILE_WITH_DMF_LOADER_ - diff --git a/source/Irrlicht/CDMFLoader.h b/source/Irrlicht/CDMFLoader.h deleted file mode 100644 index c2d70911..00000000 --- a/source/Irrlicht/CDMFLoader.h +++ /dev/null @@ -1,91 +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 -// -// This file was originally written by Salvatore Russo. -// I (Nikolaus Gebhardt) did some minor modifications changes to it and integrated -// it into Irrlicht: -// - removed STL dependency -// - removed log file and replaced it with irrlicht logging -// - adapted code formatting a bit to Irrlicht style -// - removed memory leaks -// Thanks a lot to Salvatore for his work on this and that he gave me -// his permission to add it into Irrlicht. - -/* - CDMFLoader by Salvatore Russo - Version 1.3 - - This loader is used to load DMF files in Irrlicht. - Look at the documentation for a sample application. - - Parts of this code are from Murphy McCauley COCTLoader just like - GetFaceNormal() or indexes creation routines and a routine to add faces. So - please refer to COCTLoader.h to know more about rights granted. - - You can use this software as you wish but you must not remove these notes about license nor - credits to others for parts of this code. -*/ - -#ifndef __C_DMF_LOADER_H_INCLUDED__ -#define __C_DMF_LOADER_H_INCLUDED__ - -#include "IMeshLoader.h" -#include "IReadFile.h" -#include "IFileSystem.h" -#include "SMesh.h" -#include "IVideoDriver.h" -#include "ISceneManager.h" -#include "SAnimatedMesh.h" - -namespace irr -{ -namespace scene -{ - /** A class to load DeleD mesh files.*/ - class CDMFLoader : public IMeshLoader - { - public: - - /** constructor*/ - CDMFLoader(ISceneManager* smgr, io::IFileSystem* filesys); - - //! 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_; - - /** loads dynamic lights present in this scene. - Note that loaded lights from DeleD must have the suffix \b dynamic_ and must be \b pointlight. - Irrlicht correctly loads specular color, diffuse color , position and distance of object affected by light. - \return number of lights loaded or 0 if loading failed.*/ - int loadLights(const c8 * filename, ISceneManager* smgr, - ISceneNode* parent = 0, s32 base_id = 1000); - - /** loads water plains present in this scene. - Note that loaded water plains from DeleD must have the suffix \b water_ and must be \b rectangle (with just 1 rectangular face). - Irrlicht correctly loads position and rotation of water plain as well as texture layers. - \return number of water plains loaded or 0 if loading failed.*/ - int loadWaterPlains(const c8 *filename, - ISceneManager* smgr, - ISceneNode * parent = 0, - s32 base_id = 2000, - bool mode = true); - - private: - void addMaterialPath(core::stringc& filename, const core::stringc& matPath); - - ISceneManager* SceneMgr; - io::IFileSystem* FileSystem; - }; - -} // end namespace scene -} // end namespace irr - -#endif - diff --git a/source/Irrlicht/CDefaultSceneNodeAnimatorFactory.cpp b/source/Irrlicht/CDefaultSceneNodeAnimatorFactory.cpp deleted file mode 100644 index 33859989..00000000 --- a/source/Irrlicht/CDefaultSceneNodeAnimatorFactory.cpp +++ /dev/null @@ -1,162 +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 "CDefaultSceneNodeAnimatorFactory.h" -#include "CSceneNodeAnimatorCameraFPS.h" -#include "CSceneNodeAnimatorCameraMaya.h" -#include "ICursorControl.h" -#include "ISceneNodeAnimatorCollisionResponse.h" -#include "ISceneManager.h" - -namespace irr -{ -namespace scene -{ - -//! Names for scene node types -const c8* const SceneNodeAnimatorTypeNames[] = -{ - "flyCircle", - "flyStraight", - "followSpline", - "rotation", - "texture", - "deletion", - "collisionResponse", - "cameraFPS", - "cameraMaya", - 0 -}; - - -CDefaultSceneNodeAnimatorFactory::CDefaultSceneNodeAnimatorFactory(ISceneManager* mgr, gui::ICursorControl* crs) -: Manager(mgr), CursorControl(crs) -{ - #ifdef _DEBUG - setDebugName("CDefaultSceneNodeAnimatorFactory"); - #endif - - // don't grab the scene manager here to prevent cyclic references - if (CursorControl) - CursorControl->grab(); -} - - -CDefaultSceneNodeAnimatorFactory::~CDefaultSceneNodeAnimatorFactory() -{ - if (CursorControl) - CursorControl->drop(); -} - - -//! creates a scene node animator based on its type id -ISceneNodeAnimator* CDefaultSceneNodeAnimatorFactory::createSceneNodeAnimator(ESCENE_NODE_ANIMATOR_TYPE type, ISceneNode* target) -{ - scene::ISceneNodeAnimator* anim = 0; - - switch(type) - { - case ESNAT_FLY_CIRCLE: - anim = Manager->createFlyCircleAnimator(core::vector3df(0,0,0), 10); - break; - case ESNAT_FLY_STRAIGHT: - anim = Manager->createFlyStraightAnimator(core::vector3df(0,0,0), core::vector3df(100,100,100), 10000, true ); - break; - case ESNAT_FOLLOW_SPLINE: - { - core::array<core::vector3df> points; - points.push_back(core::vector3df(0,0,0)); - points.push_back(core::vector3df(10,5,10)); - anim = Manager->createFollowSplineAnimator(0, points); - } - break; - case ESNAT_ROTATION: - anim = Manager->createRotationAnimator(core::vector3df(0.3f,0,0)); - break; - case ESNAT_TEXTURE: - { - core::array<video::ITexture*> textures; - anim = Manager->createTextureAnimator(textures, 250); - } - break; - case ESNAT_DELETION: - anim = Manager->createDeleteAnimator(5000); - break; - case ESNAT_COLLISION_RESPONSE: - anim = Manager->createCollisionResponseAnimator(0, target); - break; - case ESNAT_CAMERA_FPS: - anim = new CSceneNodeAnimatorCameraFPS(CursorControl); - break; - case ESNAT_CAMERA_MAYA: - anim = new CSceneNodeAnimatorCameraMaya(CursorControl); - break; - default: - break; - } - - if (anim && target) - target->addAnimator(anim); - - return anim; -} - - -//! creates a scene node animator based on its type name -ISceneNodeAnimator* CDefaultSceneNodeAnimatorFactory::createSceneNodeAnimator(const c8* typeName, ISceneNode* target) -{ - return createSceneNodeAnimator( getTypeFromName(typeName), target ); -} - - -//! returns amount of scene node animator types this factory is able to create -u32 CDefaultSceneNodeAnimatorFactory::getCreatableSceneNodeAnimatorTypeCount() const -{ - return ESNAT_COUNT; -} - - -//! returns type of a creatable scene node animator type -ESCENE_NODE_ANIMATOR_TYPE CDefaultSceneNodeAnimatorFactory::getCreateableSceneNodeAnimatorType(u32 idx) const -{ - if (idx<ESNAT_COUNT) - return (ESCENE_NODE_ANIMATOR_TYPE)idx; - else - return ESNAT_UNKNOWN; -} - - -//! returns type name of a creatable scene node animator type -const c8* CDefaultSceneNodeAnimatorFactory::getCreateableSceneNodeAnimatorTypeName(u32 idx) const -{ - if (idx<ESNAT_COUNT) - return SceneNodeAnimatorTypeNames[idx]; - else - return 0; -} - -//! returns type name of a creatable scene node animator type -const c8* CDefaultSceneNodeAnimatorFactory::getCreateableSceneNodeAnimatorTypeName(ESCENE_NODE_ANIMATOR_TYPE type) const -{ - // for this factory: index == type - - if (type<ESNAT_COUNT) - return SceneNodeAnimatorTypeNames[type]; - else - return 0; -} - -ESCENE_NODE_ANIMATOR_TYPE CDefaultSceneNodeAnimatorFactory::getTypeFromName(const c8* name) const -{ - for ( u32 i=0; SceneNodeAnimatorTypeNames[i]; ++i) - if (!strcmp(name, SceneNodeAnimatorTypeNames[i]) ) - return (ESCENE_NODE_ANIMATOR_TYPE)i; - - return ESNAT_UNKNOWN; -} - - -} // end namespace scene -} // end namespace irr - diff --git a/source/Irrlicht/CDefaultSceneNodeAnimatorFactory.h b/source/Irrlicht/CDefaultSceneNodeAnimatorFactory.h deleted file mode 100644 index e6cf292b..00000000 --- a/source/Irrlicht/CDefaultSceneNodeAnimatorFactory.h +++ /dev/null @@ -1,75 +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_DEFAULT_SCENE_NODE_ANIMATOR_FACTORY_H_INCLUDED__ -#define __C_DEFAULT_SCENE_NODE_ANIMATOR_FACTORY_H_INCLUDED__ - -#include "ISceneNodeAnimatorFactory.h" - -namespace irr -{ -namespace gui -{ - class ICursorControl; -} -namespace scene -{ - class ISceneNodeAnimator; - class ISceneManager; - - //! Interface making it possible to dynamicly create scene nodes animators - class CDefaultSceneNodeAnimatorFactory : public ISceneNodeAnimatorFactory - { - public: - - CDefaultSceneNodeAnimatorFactory(ISceneManager* mgr, gui::ICursorControl* crs); - - virtual ~CDefaultSceneNodeAnimatorFactory(); - - //! creates a scene node animator based on its type id - /** \param type: Type of the scene node animator to add. - \param target: Target scene node of the new animator. - \return Returns pointer to the new scene node animator or null if not successful. You need to - drop this pointer after calling this, see IReferenceCounted::drop() for details. */ - virtual ISceneNodeAnimator* createSceneNodeAnimator(ESCENE_NODE_ANIMATOR_TYPE type, ISceneNode* target) _IRR_OVERRIDE_; - - //! creates a scene node animator based on its type name - /** \param typeName: Type of the scene node animator to add. - \param target: Target scene node of the new animator. - \return Returns pointer to the new scene node animator or null if not successful. You need to - drop this pointer after calling this, see IReferenceCounted::drop() for details. */ - virtual ISceneNodeAnimator* createSceneNodeAnimator(const char* typeName, ISceneNode* target) _IRR_OVERRIDE_; - - //! returns amount of scene node animator types this factory is able to create - virtual u32 getCreatableSceneNodeAnimatorTypeCount() const _IRR_OVERRIDE_; - - //! returns type of a creatable scene node animator type - /** \param idx: Index of scene node animator type in this factory. Must be a value between 0 and - getCreatableSceneNodeTypeCount() */ - virtual ESCENE_NODE_ANIMATOR_TYPE getCreateableSceneNodeAnimatorType(u32 idx) const _IRR_OVERRIDE_; - - //! returns type name of a creatable scene node animator type - /** \param idx: Index of scene node animator type in this factory. Must be a value between 0 and - getCreatableSceneNodeAnimatorTypeCount() */ - virtual const c8* getCreateableSceneNodeAnimatorTypeName(u32 idx) const _IRR_OVERRIDE_; - - //! returns type name of a creatable scene node animator type - /** \param type: Type of scene node animator. - \return: Returns name of scene node animator type if this factory can create the type, otherwise 0. */ - virtual const c8* getCreateableSceneNodeAnimatorTypeName(ESCENE_NODE_ANIMATOR_TYPE type) const _IRR_OVERRIDE_; - - private: - - ESCENE_NODE_ANIMATOR_TYPE getTypeFromName(const c8* name) const; - - ISceneManager* Manager; - gui::ICursorControl* CursorControl; - }; - - -} // end namespace scene -} // end namespace irr - -#endif - diff --git a/source/Irrlicht/CDefaultSceneNodeFactory.cpp b/source/Irrlicht/CDefaultSceneNodeFactory.cpp index 0a82918f..06dbf930 100644 --- a/source/Irrlicht/CDefaultSceneNodeFactory.cpp +++ b/source/Irrlicht/CDefaultSceneNodeFactory.cpp @@ -4,17 +4,11 @@ #include "CDefaultSceneNodeFactory.h" #include "ISceneManager.h" -#include "ITextSceneNode.h" -#include "IBillboardTextSceneNode.h" -#include "ITerrainSceneNode.h" #include "IDummyTransformationSceneNode.h" #include "ICameraSceneNode.h" #include "IBillboardSceneNode.h" #include "IAnimatedMeshSceneNode.h" -#include "IParticleSystemSceneNode.h" -#include "ILightSceneNode.h" #include "IMeshSceneNode.h" -#include "IOctreeSceneNode.h" namespace irr { @@ -32,33 +26,12 @@ CDefaultSceneNodeFactory::CDefaultSceneNodeFactory(ISceneManager* mgr) // don't grab the scene manager here to prevent cyclic references - SupportedSceneNodeTypes.push_back(SSceneNodeTypePair(ESNT_CUBE, "cube")); - SupportedSceneNodeTypes.push_back(SSceneNodeTypePair(ESNT_SPHERE, "sphere")); - SupportedSceneNodeTypes.push_back(SSceneNodeTypePair(ESNT_TEXT, "text")); - SupportedSceneNodeTypes.push_back(SSceneNodeTypePair(ESNT_BILLBOARD_TEXT, "billboardText")); - SupportedSceneNodeTypes.push_back(SSceneNodeTypePair(ESNT_WATER_SURFACE, "waterSurface")); - SupportedSceneNodeTypes.push_back(SSceneNodeTypePair(ESNT_TERRAIN, "terrain")); - SupportedSceneNodeTypes.push_back(SSceneNodeTypePair(ESNT_SKY_BOX, "skyBox")); - SupportedSceneNodeTypes.push_back(SSceneNodeTypePair(ESNT_SKY_DOME, "skyDome")); - SupportedSceneNodeTypes.push_back(SSceneNodeTypePair(ESNT_SHADOW_VOLUME, "shadowVolume")); - SupportedSceneNodeTypes.push_back(SSceneNodeTypePair(ESNT_OCTREE, "octree")); - // Legacy support - SupportedSceneNodeTypes.push_back(SSceneNodeTypePair(ESNT_OCTREE, "octTree")); SupportedSceneNodeTypes.push_back(SSceneNodeTypePair(ESNT_MESH, "mesh")); - SupportedSceneNodeTypes.push_back(SSceneNodeTypePair(ESNT_LIGHT, "light")); SupportedSceneNodeTypes.push_back(SSceneNodeTypePair(ESNT_EMPTY, "empty")); SupportedSceneNodeTypes.push_back(SSceneNodeTypePair(ESNT_DUMMY_TRANSFORMATION, "dummyTransformation")); SupportedSceneNodeTypes.push_back(SSceneNodeTypePair(ESNT_CAMERA, "camera")); SupportedSceneNodeTypes.push_back(SSceneNodeTypePair(ESNT_BILLBOARD, "billBoard")); SupportedSceneNodeTypes.push_back(SSceneNodeTypePair(ESNT_ANIMATED_MESH, "animatedMesh")); - SupportedSceneNodeTypes.push_back(SSceneNodeTypePair(ESNT_PARTICLE_SYSTEM, "particleSystem")); - SupportedSceneNodeTypes.push_back(SSceneNodeTypePair(ESNT_VOLUME_LIGHT, "volumeLight")); - // SupportedSceneNodeTypes.push_back(SSceneNodeTypePair(ESNT_MD3_SCENE_NODE, "md3")); - - // legacy, for version <= 1.4.x irr files - SupportedSceneNodeTypes.push_back(SSceneNodeTypePair(ESNT_CAMERA_MAYA, "cameraMaya")); - SupportedSceneNodeTypes.push_back(SSceneNodeTypePair(ESNT_CAMERA_FPS, "cameraFPS")); - SupportedSceneNodeTypes.push_back(SSceneNodeTypePair(ESNT_Q3SHADER_SCENE_NODE, "quake3Shader")); } @@ -67,55 +40,20 @@ ISceneNode* CDefaultSceneNodeFactory::addSceneNode(ESCENE_NODE_TYPE type, IScene { switch(type) { - case ESNT_CUBE: - return Manager->addCubeSceneNode(10, parent); - case ESNT_SPHERE: - return Manager->addSphereSceneNode(5, 16, parent); - case ESNT_TEXT: - return Manager->addTextSceneNode(0, L"example"); - case ESNT_BILLBOARD_TEXT: - return Manager->addBillboardTextSceneNode(0, L"example"); - case ESNT_WATER_SURFACE: - return Manager->addWaterSurfaceSceneNode(0, 2.0f, 300.0f, 10.0f, parent); - case ESNT_TERRAIN: - return Manager->addTerrainSceneNode("", parent, -1, - core::vector3df(0.0f,0.0f,0.0f), - core::vector3df(0.0f,0.0f,0.0f), - core::vector3df(1.0f,1.0f,1.0f), - video::SColor(255,255,255,255), - 4, ETPS_17, 0, true); - case ESNT_SKY_BOX: - return Manager->addSkyBoxSceneNode(0,0,0,0,0,0, parent); - case ESNT_SKY_DOME: - return Manager->addSkyDomeSceneNode(0, 16, 8, 0.9f, 2.0f, 1000.0f, parent); - case ESNT_SHADOW_VOLUME: - return 0; - case ESNT_OCTREE: - return Manager->addOctreeSceneNode((IMesh*)0, parent, -1, 128, true); case ESNT_MESH: return Manager->addMeshSceneNode(0, parent, -1, core::vector3df(), core::vector3df(), core::vector3df(1,1,1), true); - case ESNT_LIGHT: - return Manager->addLightSceneNode(parent); case ESNT_EMPTY: return Manager->addEmptySceneNode(parent); case ESNT_DUMMY_TRANSFORMATION: return Manager->addDummyTransformationSceneNode(parent); case ESNT_CAMERA: return Manager->addCameraSceneNode(parent); - case ESNT_CAMERA_MAYA: - return Manager->addCameraSceneNodeMaya(parent); - case ESNT_CAMERA_FPS: - return Manager->addCameraSceneNodeFPS(parent); case ESNT_BILLBOARD: return Manager->addBillboardSceneNode(parent); case ESNT_ANIMATED_MESH: return Manager->addAnimatedMeshSceneNode(0, parent, -1, core::vector3df(), core::vector3df(), core::vector3df(1,1,1), true); - case ESNT_PARTICLE_SYSTEM: - return Manager->addParticleSystemSceneNode(true, parent); - case ESNT_VOLUME_LIGHT: - return (ISceneNode*)Manager->addVolumeLightSceneNode(parent); default: break; } diff --git a/source/Irrlicht/CDepthBuffer.cpp b/source/Irrlicht/CDepthBuffer.cpp deleted file mode 100644 index ec05bdab..00000000 --- a/source/Irrlicht/CDepthBuffer.cpp +++ /dev/null @@ -1,186 +0,0 @@ -// Copyright (C) 2002-2012 Nikolaus Gebhardt / Thomas Alten -// This file is part of the "Irrlicht Engine". -// For conditions of distribution and use, see copyright notice in irrlicht.h - -#include "IrrCompileConfig.h" -#include "SoftwareDriver2_compile_config.h" -#include "CDepthBuffer.h" - -#ifdef _IRR_COMPILE_WITH_BURNINGSVIDEO_ - -namespace irr -{ -namespace video -{ - - -//! constructor -CDepthBuffer::CDepthBuffer(const core::dimension2d<u32>& size) -: Buffer(0), Size(0,0) -{ - #ifdef _DEBUG - setDebugName("CDepthBuffer"); - #endif - - setSize(size); -} - - - -//! destructor -CDepthBuffer::~CDepthBuffer() -{ - if (Buffer) - { - delete[] Buffer; - Buffer = 0; - } -} - - - -//! clears the zbuffer -void CDepthBuffer::clear(f32 value, interlaced_control interlaced) -{ - ieee754 zMaxValue; - -#ifdef SOFTWARE_DRIVER_2_USE_WBUFFER - zMaxValue.f = 1.f-value; -#else - zMaxValue.f = value; -#endif - - memset32_interlaced(Buffer, zMaxValue.u, Pitch, Size.Height, interlaced); -} - - - -//! sets the new size of the buffer -void CDepthBuffer::setSize(const core::dimension2d<u32>& size) -{ - if (size == Size) - return; - - Size = size; - - delete [] Buffer; - - Pitch = size.Width * sizeof ( fp24 ); - size_t TotalSize = Pitch * size.Height; - Buffer = new u8[align_next(TotalSize,16)]; - - clear( 1.f, interlace_disabled()); -} - - - -//! returns the size of the buffer -const core::dimension2d<u32>& CDepthBuffer::getSize() const -{ - return Size; -} - -// ----------------------------------------------------------------- - -//! constructor -CStencilBuffer::CStencilBuffer(const core::dimension2d<u32>& size, unsigned bit) -: Buffer(0), Size(0,0),Bit(bit) -{ - #ifdef _DEBUG - setDebugName("CStencilBuffer"); - #endif - - setSize(size); -} - - - -//! destructor -CStencilBuffer::~CStencilBuffer() -{ - if (Buffer) - { - delete[] Buffer; - Buffer = 0; - } -} - - - -//! clears the buffer -void CStencilBuffer::clear(u32 value, const interlaced_control interlaced) -{ - u32 set = value; - if (Bit == 8) - { - set |= set << 8; - set |= set << 16; - } - memset32_interlaced ( Buffer, set, Pitch,Size.Height,interlaced ); -} - - - -//! sets the new size of the buffer -void CStencilBuffer::setSize(const core::dimension2d<u32>& size) -{ - if (size == Size) - return; - - Size = size; - - delete [] Buffer; - - Pitch = size.Width * sizeof (tStencilSample); - size_t TotalSize = Pitch * size.Height; - Buffer = new u8[align_next(TotalSize,16)]; - - clear(0, interlace_disabled()); -} - - - -//! returns the size of the buffer -const core::dimension2d<u32>& CStencilBuffer::getSize() const -{ - return Size; -} - - - -} // end namespace video -} // end namespace irr - -#endif // _IRR_COMPILE_WITH_BURNINGSVIDEO_ - -namespace irr -{ -namespace video -{ - -//! creates a ZBuffer -IDepthBuffer* createDepthBuffer(const core::dimension2d<u32>& size) -{ - #ifdef _IRR_COMPILE_WITH_BURNINGSVIDEO_ - return new CDepthBuffer(size); - #else - return 0; - #endif // _IRR_COMPILE_WITH_BURNINGSVIDEO_ -} - - -//! creates a Stencil Buffer -IStencilBuffer* createStencilBuffer(const core::dimension2d<u32>& size, u32 bit) -{ - #ifdef _IRR_COMPILE_WITH_BURNINGSVIDEO_ - return new CStencilBuffer(size,bit); - #else - return 0; - #endif // _IRR_COMPILE_WITH_BURNINGSVIDEO_ -} - -} // end namespace video -} // end namespace irr - - - diff --git a/source/Irrlicht/CDepthBuffer.h b/source/Irrlicht/CDepthBuffer.h deleted file mode 100644 index 609f7a73..00000000 --- a/source/Irrlicht/CDepthBuffer.h +++ /dev/null @@ -1,92 +0,0 @@ -// Copyright (C) 2002-2012 Nikolaus Gebhardt / Thomas Alten -// This file is part of the "Irrlicht Engine". -// For conditions of distribution and use, see copyright notice in irrlicht.h - -#ifndef __C_Z_BUFFER_H_INCLUDED__ -#define __C_Z_BUFFER_H_INCLUDED__ - -#include "IDepthBuffer.h" - -namespace irr -{ -namespace video -{ - - class CDepthBuffer : public IDepthBuffer - { - public: - - //! constructor - CDepthBuffer(const core::dimension2d<u32>& size); - - //! destructor - virtual ~CDepthBuffer(); - - //! clears the zbuffer - virtual void clear(f32 value, const interlaced_control interlaced) _IRR_OVERRIDE_; - - //! sets the new size of the zbuffer - virtual void setSize(const core::dimension2d<u32>& size) _IRR_OVERRIDE_; - - //! returns the size of the zbuffer - virtual const core::dimension2d<u32>& getSize() const _IRR_OVERRIDE_; - - //! locks the zbuffer - virtual void* lock() _IRR_OVERRIDE_ { return (void*) Buffer; } - - //! unlocks the zbuffer - virtual void unlock() _IRR_OVERRIDE_ {} - - //! returns pitch of depthbuffer (in bytes) - virtual u32 getPitch() const _IRR_OVERRIDE_ { return Pitch; } - - - private: - - u8* Buffer; - core::dimension2d<u32> Size; - u32 Pitch; - }; - - - class CStencilBuffer : public IStencilBuffer - { - public: - - //! constructor - CStencilBuffer(const core::dimension2d<u32>& size, unsigned bit); - - //! destructor - virtual ~CStencilBuffer(); - - //! clears the zbuffer - virtual void clear(u32 value, const interlaced_control interlaced) _IRR_OVERRIDE_; - - //! sets the new size of the zbuffer - virtual void setSize(const core::dimension2d<u32>& size) _IRR_OVERRIDE_; - - //! returns the size of the zbuffer - virtual const core::dimension2d<u32>& getSize() const _IRR_OVERRIDE_; - - //! locks the zbuffer - virtual void* lock() _IRR_OVERRIDE_ { return (void*) Buffer; } - - //! unlocks the zbuffer - virtual void unlock() _IRR_OVERRIDE_ {} - - //! returns pitch of depthbuffer (in bytes) - virtual u32 getPitch() const _IRR_OVERRIDE_ { return Pitch; } - - - private: - u8* Buffer; - core::dimension2d<u32> Size; - u32 Pitch; - u32 Bit; - }; - -} // end namespace video -} // end namespace irr - -#endif - diff --git a/source/Irrlicht/CFileSystem.cpp b/source/Irrlicht/CFileSystem.cpp index 6cdb0c68..7ba441f6 100644 --- a/source/Irrlicht/CFileSystem.cpp +++ b/source/Irrlicht/CFileSystem.cpp @@ -9,10 +9,6 @@ #include "IWriteFile.h" #include "CZipReader.h" #include "CMountPointReader.h" -#include "CPakReader.h" -#include "CNPKReader.h" -#include "CTarReader.h" -#include "CWADReader.h" #include "CFileList.h" #include "stdio.h" #include "os.h" diff --git a/source/Irrlicht/CGeometryCreator.cpp b/source/Irrlicht/CGeometryCreator.cpp deleted file mode 100644 index 22ce7170..00000000 --- a/source/Irrlicht/CGeometryCreator.cpp +++ /dev/null @@ -1,1084 +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 "CGeometryCreator.h" -#include "SAnimatedMesh.h" -#include "SMeshBuffer.h" -#include "SMesh.h" -#include "IMesh.h" -#include "IVideoDriver.h" -#include "os.h" - -namespace irr -{ -namespace scene -{ - -IMesh* CGeometryCreator::createCubeMesh(const core::vector3df& size, ECUBE_MESH_TYPE type) const -{ - SMesh* mesh = new SMesh; - - const video::SColor clr(255,255,255,255); - - if ( type == ECMT_1BUF_12VTX_NA ) - { - SMeshBuffer* buffer = new SMeshBuffer(); - - // Create indices (pos, neg describes normal direction of front-face) - const u16 u[36] = { 0,2,1, 0,3,2, // NEG_Z - 1,5,4, 1,2,5, // POS_X - 4,6,7, 4,5,6, // POS_Z - 7,3,0, 7,6,3, // NEG_X - 9,5,2, 9,8,5, // POS_Y - 0,11,10, 0,10,7}; // NEG_Y - - buffer->Indices.set_used(36); - - for (u32 i=0; i<36; ++i) - buffer->Indices[i] = u[i]; - - // Create vertices - buffer->Vertices.reallocate(12); - - buffer->Vertices.push_back(video::S3DVertex(0,0,0, -1,-1,-1, clr, 0, 1)); // 0 - buffer->Vertices.push_back(video::S3DVertex(1,0,0, 1,-1,-1, clr, 1, 1)); // 1 - buffer->Vertices.push_back(video::S3DVertex(1,1,0, 1, 1,-1, clr, 1, 0)); // 2 - buffer->Vertices.push_back(video::S3DVertex(0,1,0, -1, 1,-1, clr, 0, 0)); // 3 - buffer->Vertices.push_back(video::S3DVertex(1,0,1, 1,-1, 1, clr, 0, 1)); // 4 - buffer->Vertices.push_back(video::S3DVertex(1,1,1, 1, 1, 1, clr, 0, 0)); // 5 - buffer->Vertices.push_back(video::S3DVertex(0,1,1, -1, 1, 1, clr, 1, 0)); // 6 - buffer->Vertices.push_back(video::S3DVertex(0,0,1, -1,-1, 1, clr, 1, 1)); // 7 - buffer->Vertices.push_back(video::S3DVertex(0,1,1, -1, 1, 1, clr, 0, 1)); // 8 - buffer->Vertices.push_back(video::S3DVertex(0,1,0, -1, 1,-1, clr, 1, 1)); // 9 - buffer->Vertices.push_back(video::S3DVertex(1,0,1, 1,-1, 1, clr, 1, 0)); // 10 - buffer->Vertices.push_back(video::S3DVertex(1,0,0, 1,-1,-1, clr, 0, 0)); // 11 - - // Recalculate bounding box and set cube size - buffer->BoundingBox.reset(0,0,0); - - for (u32 i=0; i<12; ++i) - { - buffer->Vertices[i].Pos -= core::vector3df(0.5f, 0.5f, 0.5f); - buffer->Vertices[i].Pos *= size; - buffer->Vertices[i].Normal.normalize(); - buffer->BoundingBox.addInternalPoint(buffer->Vertices[i].Pos); - } - - mesh->addMeshBuffer(buffer); - buffer->drop(); - } - else if ( type == ECMT_6BUF_4VTX_NP ) - { - for ( int b=0; b<6; ++b ) - { - SMeshBuffer* buffer = new SMeshBuffer(); - - // Create indices - const u16 u[6] = { 0,2,1,0,3,2}; - - buffer->Indices.set_used(6); - - for ( int i=0; i<6; ++i ) - buffer->Indices[i] = u[i]; - - // Create vertices - buffer->Vertices.reallocate(4); - - switch ( b ) - { - case 0: - buffer->Vertices.push_back(video::S3DVertex(0,0,0, 0, 0,-1, clr, 0, 1)); - buffer->Vertices.push_back(video::S3DVertex(1,0,0, 0, 0,-1, clr, 1, 1)); - buffer->Vertices.push_back(video::S3DVertex(1,1,0, 0, 0,-1, clr, 1, 0)); - buffer->Vertices.push_back(video::S3DVertex(0,1,0, 0, 0,-1, clr, 0, 0)); - break; - case 1: - buffer->Vertices.push_back(video::S3DVertex(1,0,0, 1, 0, 0, clr, 0, 1)); - buffer->Vertices.push_back(video::S3DVertex(1,0,1, 1, 0, 0, clr, 1, 1)); - buffer->Vertices.push_back(video::S3DVertex(1,1,1, 1, 0, 0, clr, 1, 0)); - buffer->Vertices.push_back(video::S3DVertex(1,1,0, 1, 0, 0, clr, 0, 0)); - break; - case 2: - buffer->Vertices.push_back(video::S3DVertex(1,0,1, 0, 0, 1, clr, 0, 1)); - buffer->Vertices.push_back(video::S3DVertex(0,0,1, 0, 0, 1, clr, 1, 1)); - buffer->Vertices.push_back(video::S3DVertex(0,1,1, 0, 0, 1, clr, 1, 0)); - buffer->Vertices.push_back(video::S3DVertex(1,1,1, 0, 0, 1, clr, 0, 0)); - break; - case 3: - buffer->Vertices.push_back(video::S3DVertex(0,0,1, -1, 0, 0, clr, 0, 1)); - buffer->Vertices.push_back(video::S3DVertex(0,0,0, -1, 0, 0, clr, 1, 1)); - buffer->Vertices.push_back(video::S3DVertex(0,1,0, -1, 0, 0, clr, 1, 0)); - buffer->Vertices.push_back(video::S3DVertex(0,1,1, -1, 0, 0, clr, 0, 0)); - break; - case 4: - buffer->Vertices.push_back(video::S3DVertex(0,1,0, 0, 1, 0, clr, 0, 1)); - buffer->Vertices.push_back(video::S3DVertex(1,1,0, 0, 1, 0, clr, 1, 1)); - buffer->Vertices.push_back(video::S3DVertex(1,1,1, 0, 1, 0, clr, 1, 0)); - buffer->Vertices.push_back(video::S3DVertex(0,1,1, 0, 1, 0, clr, 0, 0)); - break; - case 5: - buffer->Vertices.push_back(video::S3DVertex(0,0,1, 0, -1, 0, clr, 0, 1)); - buffer->Vertices.push_back(video::S3DVertex(1,0,1, 0, -1, 0, clr, 1, 1)); - buffer->Vertices.push_back(video::S3DVertex(1,0,0, 0, -1, 0, clr, 1, 0)); - buffer->Vertices.push_back(video::S3DVertex(0,0,0, 0, -1, 0, clr, 0, 0)); - break; - } - - // Recalculate bounding box and set cube size - for (u32 i=0; i<4; ++i) - { - buffer->Vertices[i].Pos -= core::vector3df(0.5f, 0.5f, 0.5f); - buffer->Vertices[i].Pos *= size; - if ( i == 0 ) - buffer->BoundingBox.reset(buffer->Vertices[i].Pos); - else - buffer->BoundingBox.addInternalPoint(buffer->Vertices[i].Pos); - } - - mesh->addMeshBuffer(buffer); - buffer->drop(); - } - } - - mesh->recalculateBoundingBox(); - return mesh; -} - - -// creates a hill plane -IMesh* CGeometryCreator::createHillPlaneMesh( - const core::dimension2d<f32>& tileSize, - const core::dimension2d<u32>& tc, video::SMaterial* material, - f32 hillHeight, const core::dimension2d<f32>& ch, - const core::dimension2d<f32>& textureRepeatCount) const -{ - core::dimension2d<u32> tileCount = tc; - core::dimension2d<f32> countHills = ch; - - if (countHills.Width < 0.01f) - countHills.Width = 1.f; - if (countHills.Height < 0.01f) - countHills.Height = 1.f; - - // center - const core::position2d<f32> center((tileSize.Width * tileCount.Width) * 0.5f, (tileSize.Height * tileCount.Height) * 0.5f); - - // texture coord step - const core::dimension2d<f32> tx( - textureRepeatCount.Width / tileCount.Width, - textureRepeatCount.Height / tileCount.Height); - - // add one more point in each direction for proper tile count - ++tileCount.Height; - ++tileCount.Width; - - SMeshBuffer* buffer = new SMeshBuffer(); - video::S3DVertex vtx; - vtx.Color.set(255,255,255,255); - - // create vertices from left-front to right-back - u32 x; - - f32 sx=0.f, tsx=0.f; - for (x=0; x<tileCount.Width; ++x) - { - f32 sy=0.f, tsy=0.f; - for (u32 y=0; y<tileCount.Height; ++y) - { - vtx.Pos.set(sx - center.X, 0, sy - center.Y); - vtx.TCoords.set(tsx, 1.0f - tsy); - - if (core::isnotzero(hillHeight)) - vtx.Pos.Y = sinf(vtx.Pos.X * countHills.Width * core::PI / center.X) * - cosf(vtx.Pos.Z * countHills.Height * core::PI / center.Y) * - hillHeight; - - buffer->Vertices.push_back(vtx); - sy += tileSize.Height; - tsy += tx.Height; - } - sx += tileSize.Width; - tsx += tx.Width; - } - - // create indices - - for (x=0; x<tileCount.Width-1; ++x) - { - for (u32 y=0; y<tileCount.Height-1; ++y) - { - const s32 current = x*tileCount.Height + y; - - buffer->Indices.push_back(current); - buffer->Indices.push_back(current + 1); - buffer->Indices.push_back(current + tileCount.Height); - - buffer->Indices.push_back(current + 1); - buffer->Indices.push_back(current + 1 + tileCount.Height); - buffer->Indices.push_back(current + tileCount.Height); - } - } - - // recalculate normals - for (u32 i=0; i<buffer->Indices.size(); i+=3) - { - const core::vector3df normal = core::plane3d<f32>( - buffer->Vertices[buffer->Indices[i+0]].Pos, - buffer->Vertices[buffer->Indices[i+1]].Pos, - buffer->Vertices[buffer->Indices[i+2]].Pos).Normal; - - buffer->Vertices[buffer->Indices[i+0]].Normal = normal; - buffer->Vertices[buffer->Indices[i+1]].Normal = normal; - buffer->Vertices[buffer->Indices[i+2]].Normal = normal; - } - - if (material) - buffer->Material = *material; - - buffer->recalculateBoundingBox(); - buffer->setHardwareMappingHint(EHM_STATIC); - - SMesh* mesh = new SMesh(); - mesh->addMeshBuffer(buffer); - mesh->recalculateBoundingBox(); - buffer->drop(); - return mesh; -} - -namespace -{ - -// Return the position on an exponential curve. Input from 0 to 1. -float geopos(float pos) -{ - pos = core::clamp<float>(pos, 0, 1); - pos *= 5; - - const float out = powf(2.5f, pos - 5); - - return out; -} - -} - -//! Create a geoplane. -IMesh* CGeometryCreator::createGeoplaneMesh(f32 radius, u32 rows, u32 columns) const -{ - using namespace core; - using namespace video; - - rows = clamp<u32>(rows, 3, 2048); - columns = clamp<u32>(columns, 3, 2048); - - SMeshBuffer * const mb = new SMeshBuffer(); - S3DVertex v(0, 0, 0, 0, 1, 0, SColor(255, 255, 255, 255), 0, 0); - const float anglestep = (2 * PI) / columns; - - mb->Vertices.reallocate((rows * columns) + 1); - mb->Indices.reallocate((((rows - 2) * columns * 2) + columns) * 3); - - u32 i, j; - mb->Vertices.push_back(v); - for (j = 1; j < rows; j++) - { - const float len = radius * geopos((float) j/(rows-1)); - - for (i = 0; i < columns; i++) - { - const float angle = anglestep * i; - v.Pos = vector3df(len * sinf(angle), 0, len * cosf(angle)); - - mb->Vertices.push_back(v); - } - } - - // Indices - // First the inner fan - for (i = 0; i < columns; i++) - { - mb->Indices.push_back(0); - mb->Indices.push_back(1 + i); - - if (i == columns - 1) - mb->Indices.push_back(1); - else - mb->Indices.push_back(2 + i); - } - - // Then the surrounding quads - for (j = 0; j < rows - 2; j++) - { - for (i = 0; i < columns; i++) - { - u32 start = ((j * columns) + i) + 1; - u32 next = start + 1; - u32 far = (((j + 1) * columns) + i) + 1; - u32 farnext = far + 1; - - if (i == columns - 1) - { - next = ((j * columns)) + 1; - farnext = (((j + 1) * columns)) + 1; - } - - mb->Indices.push_back(start); - mb->Indices.push_back(far); - mb->Indices.push_back(next); - - mb->Indices.push_back(next); - mb->Indices.push_back(far); - mb->Indices.push_back(farnext); - } - } - - // Done - SMesh * const mesh = new SMesh(); - mesh->addMeshBuffer(mb); - mb->recalculateBoundingBox(); - mb->setHardwareMappingHint(EHM_STATIC); - mesh->recalculateBoundingBox(); - mb->drop(); - - return mesh; -} - -IMesh* CGeometryCreator::createTerrainMesh(video::IImage* texture, - video::IImage* heightmap, const core::dimension2d<f32>& stretchSize, - f32 maxHeight, video::IVideoDriver* driver, - const core::dimension2d<u32>& maxVtxBlockSize, - bool debugBorders) const -{ - if (!texture || !heightmap) - return 0; - - // debug border - const s32 borderSkip = debugBorders ? 0 : 1; - - video::S3DVertex vtx; - vtx.Color.set(255,255,255,255); - - SMesh* mesh = new SMesh(); - - const u32 tm = os::Timer::getRealTime()/1000; - const core::dimension2d<u32> hMapSize= heightmap->getDimension(); - const core::dimension2d<u32> tMapSize= texture->getDimension(); - const core::position2d<f32> thRel(static_cast<f32>(tMapSize.Width) / hMapSize.Width, static_cast<f32>(tMapSize.Height) / hMapSize.Height); - maxHeight /= 255.0f; // height step per color value - - core::position2d<u32> processed(0,0); - while (processed.Y<hMapSize.Height) - { - while(processed.X<hMapSize.Width) - { - core::dimension2d<u32> blockSize = maxVtxBlockSize; - if (processed.X + blockSize.Width > hMapSize.Width) - blockSize.Width = hMapSize.Width - processed.X; - if (processed.Y + blockSize.Height > hMapSize.Height) - blockSize.Height = hMapSize.Height - processed.Y; - - SMeshBuffer* buffer = new SMeshBuffer(); - buffer->setHardwareMappingHint(scene::EHM_STATIC); - buffer->Vertices.reallocate(blockSize.getArea()); - // add vertices of vertex block - u32 y; - core::vector2df pos(0.f, processed.Y*stretchSize.Height); - const core::vector2df bs(1.f/blockSize.Width, 1.f/blockSize.Height); - core::vector2df tc(0.f, 0.5f*bs.Y); - for (y=0; y<blockSize.Height; ++y) - { - pos.X=processed.X*stretchSize.Width; - tc.X=0.5f*bs.X; - for (u32 x=0; x<blockSize.Width; ++x) - { - const f32 height = heightmap->getPixel(x+processed.X, y+processed.Y).getAverage() * maxHeight; - - vtx.Pos.set(pos.X, height, pos.Y); - vtx.TCoords.set(tc); - buffer->Vertices.push_back(vtx); - pos.X += stretchSize.Width; - tc.X += bs.X; - } - pos.Y += stretchSize.Height; - tc.Y += bs.Y; - } - - buffer->Indices.reallocate((blockSize.Height-1)*(blockSize.Width-1)*6); - // add indices of vertex block - s32 c1 = 0; - for (y=0; y<blockSize.Height-1; ++y) - { - for (u32 x=0; x<blockSize.Width-1; ++x) - { - const s32 c = c1 + x; - - buffer->Indices.push_back(c); - buffer->Indices.push_back(c + blockSize.Width); - buffer->Indices.push_back(c + 1); - - buffer->Indices.push_back(c + 1); - buffer->Indices.push_back(c + blockSize.Width); - buffer->Indices.push_back(c + 1 + blockSize.Width); - } - c1 += blockSize.Width; - } - - // recalculate normals - for (u32 i=0; i<buffer->Indices.size(); i+=3) - { - const core::vector3df normal = core::plane3d<f32>( - buffer->Vertices[buffer->Indices[i+0]].Pos, - buffer->Vertices[buffer->Indices[i+1]].Pos, - buffer->Vertices[buffer->Indices[i+2]].Pos).Normal; - - buffer->Vertices[buffer->Indices[i+0]].Normal = normal; - buffer->Vertices[buffer->Indices[i+1]].Normal = normal; - buffer->Vertices[buffer->Indices[i+2]].Normal = normal; - } - - if (buffer->Vertices.size()) - { - c8 textureName[64]; - // create texture for this block - video::IImage* img = driver->createImage(texture->getColorFormat(), core::dimension2d<u32>(core::floor32(blockSize.Width*thRel.X), core::floor32(blockSize.Height*thRel.Y))); - texture->copyTo(img, core::position2di(0,0), core::recti( - core::position2d<s32>(core::floor32(processed.X*thRel.X), core::floor32(processed.Y*thRel.Y)), - core::dimension2d<u32>(core::floor32(blockSize.Width*thRel.X), core::floor32(blockSize.Height*thRel.Y))), 0); - - sprintf(textureName, "terrain%u_%u", tm, mesh->getMeshBufferCount()); - - buffer->Material.setTexture(0, driver->addTexture(textureName, img)); - - if (buffer->Material.getTexture(0)) - { - c8 tmp[255]; - sprintf(tmp, "Generated terrain texture (%ux%u): %s", - buffer->Material.getTexture(0)->getSize().Width, - buffer->Material.getTexture(0)->getSize().Height, - textureName); - os::Printer::log(tmp); - } - else - os::Printer::log("Could not create terrain texture.", textureName, ELL_ERROR); - - img->drop(); - } - - buffer->recalculateBoundingBox(); - mesh->addMeshBuffer(buffer); - buffer->drop(); - - // keep on processing - processed.X += maxVtxBlockSize.Width - borderSkip; - } - - // keep on processing - processed.X = 0; - processed.Y += maxVtxBlockSize.Height - borderSkip; - } - - mesh->recalculateBoundingBox(); - return mesh; -} - - -/* - a cylinder, a cone and a cross - point up on (0,1.f, 0.f ) -*/ -IMesh* CGeometryCreator::createArrowMesh(const u32 tesselationCylinder, - const u32 tesselationCone, - const f32 height, - const f32 cylinderHeight, - const f32 width0, - const f32 width1, - const video::SColor vtxColor0, - const video::SColor vtxColor1) const -{ - SMesh* mesh = (SMesh*)createCylinderMesh(width0, cylinderHeight, tesselationCylinder, vtxColor0, false); - - IMesh* mesh2 = createConeMesh(width1, height-cylinderHeight, tesselationCone, vtxColor1, vtxColor0); - for (u32 i=0; i<mesh2->getMeshBufferCount(); ++i) - { - scene::IMeshBuffer* buffer = mesh2->getMeshBuffer(i); - for (u32 j=0; j<buffer->getVertexCount(); ++j) - buffer->getPosition(j).Y += cylinderHeight; - buffer->setDirty(EBT_VERTEX); - buffer->recalculateBoundingBox(); - mesh->addMeshBuffer(buffer); - } - mesh2->drop(); - mesh->setHardwareMappingHint(EHM_STATIC); - - mesh->recalculateBoundingBox(); - return mesh; -} - - -/* A sphere with proper normals and texture coords */ -IMesh* CGeometryCreator::createSphereMesh(f32 radius, u32 polyCountX, u32 polyCountY) const -{ - // thanks to Alfaz93 who made his code available for Irrlicht on which - // this one is based! - - // we are creating the sphere mesh here. - - if (polyCountX < 2) - polyCountX = 2; - if (polyCountY < 2) - polyCountY = 2; - while (polyCountX * polyCountY > 32767) // prevent u16 overflow - { - polyCountX /= 2; - polyCountY /= 2; - } - - const u32 polyCountXPitch = polyCountX+1; // get to same vertex on next level - - SMeshBuffer* buffer = new SMeshBuffer(); - - buffer->Indices.reallocate((polyCountX * polyCountY) * 6); - - const video::SColor clr(255, 255,255,255); - - u32 level = 0; - - for (u32 p1 = 0; p1 < polyCountY-1; ++p1) - { - //main quads, top to bottom - for (u32 p2 = 0; p2 < polyCountX - 1; ++p2) - { - const u32 curr = level + p2; - buffer->Indices.push_back(curr + polyCountXPitch); - buffer->Indices.push_back(curr); - buffer->Indices.push_back(curr + 1); - buffer->Indices.push_back(curr + polyCountXPitch); - buffer->Indices.push_back(curr+1); - buffer->Indices.push_back(curr + 1 + polyCountXPitch); - } - - // the connectors from front to end - buffer->Indices.push_back(level + polyCountX - 1 + polyCountXPitch); - buffer->Indices.push_back(level + polyCountX - 1); - buffer->Indices.push_back(level + polyCountX); - - buffer->Indices.push_back(level + polyCountX - 1 + polyCountXPitch); - buffer->Indices.push_back(level + polyCountX); - buffer->Indices.push_back(level + polyCountX + polyCountXPitch); - level += polyCountXPitch; - } - - const u32 polyCountSq = polyCountXPitch * polyCountY; // top point - const u32 polyCountSq1 = polyCountSq + 1; // bottom point - const u32 polyCountSqM1 = (polyCountY - 1) * polyCountXPitch; // last row's first vertex - - for (u32 p2 = 0; p2 < polyCountX - 1; ++p2) - { - // create triangles which are at the top of the sphere - - buffer->Indices.push_back(polyCountSq); - buffer->Indices.push_back(p2 + 1); - buffer->Indices.push_back(p2); - - // create triangles which are at the bottom of the sphere - - buffer->Indices.push_back(polyCountSqM1 + p2); - buffer->Indices.push_back(polyCountSqM1 + p2 + 1); - buffer->Indices.push_back(polyCountSq1); - } - - // create final triangle which is at the top of the sphere - - buffer->Indices.push_back(polyCountSq); - buffer->Indices.push_back(polyCountX); - buffer->Indices.push_back(polyCountX-1); - - // create final triangle which is at the bottom of the sphere - - buffer->Indices.push_back(polyCountSqM1 + polyCountX - 1); - buffer->Indices.push_back(polyCountSqM1); - buffer->Indices.push_back(polyCountSq1); - - // calculate the angle which separates all points in a circle - const f64 AngleX = 2 * core::PI / polyCountX; - const f64 AngleY = core::PI / polyCountY; - - u32 i=0; - f64 axz; - - // we don't start at 0. - - f64 ay = 0;//AngleY / 2; - - buffer->Vertices.set_used((polyCountXPitch * polyCountY) + 2); - for (u32 y = 0; y < polyCountY; ++y) - { - ay += AngleY; - const f64 sinay = sin(ay); - axz = 0; - - // calculate the necessary vertices without the doubled one - for (u32 xz = 0;xz < polyCountX; ++xz) - { - // calculate points position - - const core::vector3df pos(static_cast<f32>(radius * cos(axz) * sinay), - static_cast<f32>(radius * cos(ay)), - static_cast<f32>(radius * sin(axz) * sinay)); - // for spheres the normal is the position - core::vector3df normal(pos); - normal.normalize(); - - // calculate texture coordinates via sphere mapping - // tu is the same on each level, so only calculate once - f32 tu = 0.5f; - if (y==0) - { - if (normal.Y != -1.0f && normal.Y != 1.0f) - tu = static_cast<f32>(acos(core::clamp(normal.X/sinay, -1.0, 1.0)) * 0.5 *core::RECIPROCAL_PI64); - if (normal.Z < 0.0f) - tu=1-tu; - } - else - tu = buffer->Vertices[i-polyCountXPitch].TCoords.X; - buffer->Vertices[i] = video::S3DVertex(pos.X, pos.Y, pos.Z, - normal.X, normal.Y, normal.Z, - clr, tu, - static_cast<f32>(ay*core::RECIPROCAL_PI64)); - ++i; - axz += AngleX; - } - // This is the doubled vertex on the initial position - buffer->Vertices[i] = video::S3DVertex(buffer->Vertices[i-polyCountX]); - buffer->Vertices[i].TCoords.X=1.0f; - ++i; - } - - // the vertex at the top of the sphere - buffer->Vertices[i] = video::S3DVertex(0.0f,radius,0.0f, 0.0f,1.0f,0.0f, clr, 0.5f, 0.0f); - - // the vertex at the bottom of the sphere - ++i; - buffer->Vertices[i] = video::S3DVertex(0.0f,-radius,0.0f, 0.0f,-1.0f,0.0f, clr, 0.5f, 1.0f); - - // recalculate bounding box - - buffer->BoundingBox.reset(buffer->Vertices[i].Pos); - buffer->BoundingBox.addInternalPoint(buffer->Vertices[i-1].Pos); - buffer->BoundingBox.addInternalPoint(radius,0.0f,0.0f); - buffer->BoundingBox.addInternalPoint(-radius,0.0f,0.0f); - buffer->BoundingBox.addInternalPoint(0.0f,0.0f,radius); - buffer->BoundingBox.addInternalPoint(0.0f,0.0f,-radius); - - SMesh* mesh = new SMesh(); - mesh->addMeshBuffer(buffer); - buffer->drop(); - - mesh->setHardwareMappingHint(EHM_STATIC); - mesh->recalculateBoundingBox(); - return mesh; -} - - -/* A cylinder with proper normals and texture coords */ -IMesh* CGeometryCreator::createCylinderMesh(f32 radius, f32 length, - u32 tesselation, const video::SColor& color, - bool closeTop, f32 oblique, u32 normalType) const -{ - SMeshBuffer* buffer = new SMeshBuffer(); - - const f32 recTesselation = core::reciprocal((f32)tesselation); - const f32 recTesselationHalf = recTesselation * 0.5f; - const f32 angleStep = (core::PI * 2.f ) * recTesselation; - const f32 angleStepHalf = angleStep*0.5f; - - u32 i; - video::S3DVertex v; - v.Color = color; - buffer->Vertices.reallocate(tesselation*4+4+(closeTop?2:1)); - buffer->Indices.reallocate((tesselation*2+1)*(closeTop?12:9)); - f32 tcx = 0.f; - for ( i = 0; i <= tesselation; ++i ) - { - const f32 angle = angleStep * i; - v.Pos.X = radius * cosf(angle); - v.Pos.Y = 0.f; - v.Pos.Z = radius * sinf(angle); - switch (normalType) - { - case 0: v.Normal = v.Pos; break; - case 1: v.Normal = v.Pos; break; - } - v.Normal.normalize(); - v.TCoords.X=tcx; - v.TCoords.Y=0.f; - buffer->Vertices.push_back(v); - - v.Pos.X += oblique; - v.Pos.Y = length; - switch (normalType) - { - case 0: v.Normal = v.Pos; break; - case 1: v.Normal = core::vector3df(v.Pos.X-oblique, 0, v.Pos.Z); break; - } - v.Normal.normalize(); - v.TCoords.Y=1.f; - buffer->Vertices.push_back(v); - - v.Pos.X = radius * cosf(angle + angleStepHalf); - v.Pos.Y = 0.f; - v.Pos.Z = radius * sinf(angle + angleStepHalf); - switch (normalType) - { - case 0: v.Normal = v.Pos; break; - case 1: v.Normal = v.Pos; break; - } - v.Normal.normalize(); - v.TCoords.X=tcx+recTesselationHalf; - v.TCoords.Y=0.f; - buffer->Vertices.push_back(v); - - v.Pos.X += oblique; - v.Pos.Y = length; - switch (normalType) - { - case 0: v.Normal = v.Pos; break; - case 1: v.Normal = core::vector3df(v.Pos.X-oblique, 0, v.Pos.Z); break; - } - v.Normal.normalize(); - v.TCoords.Y=1.f; - buffer->Vertices.push_back(v); - tcx += recTesselation; - } - - // indices for the main hull part - const u32 nonWrappedSize = tesselation* 4; - for (i=0; i != nonWrappedSize; i += 2) - { - buffer->Indices.push_back(i + 2); - buffer->Indices.push_back(i + 0); - buffer->Indices.push_back(i + 1); - - buffer->Indices.push_back(i + 2); - buffer->Indices.push_back(i + 1); - buffer->Indices.push_back(i + 3); - } - - // two closing quads between end and start - buffer->Indices.push_back(0); - buffer->Indices.push_back(i + 0); - buffer->Indices.push_back(i + 1); - - buffer->Indices.push_back(0); - buffer->Indices.push_back(i + 1); - buffer->Indices.push_back(1); - - // close down - v.Pos.X = 0.f; - v.Pos.Y = 0.f; - v.Pos.Z = 0.f; - v.Normal.X = 0.f; - v.Normal.Y = -1.f; - v.Normal.Z = 0.f; - v.TCoords.X = 1.f; - v.TCoords.Y = 1.f; - buffer->Vertices.push_back(v); - - u32 index = buffer->Vertices.size() - 1; - - for ( i = 0; i != nonWrappedSize; i += 2 ) - { - buffer->Indices.push_back(index); - buffer->Indices.push_back(i + 0); - buffer->Indices.push_back(i + 2); - } - - buffer->Indices.push_back(index); - buffer->Indices.push_back(i + 0); - buffer->Indices.push_back(0); - - if (closeTop) - { - // close top - v.Pos.X = oblique; - v.Pos.Y = length; - v.Pos.Z = 0.f; - v.Normal.X = 0.f; - v.Normal.Y = 1.f; - v.Normal.Z = 0.f; - v.TCoords.X = 0.f; - v.TCoords.Y = 0.f; - buffer->Vertices.push_back(v); - - index = buffer->Vertices.size() - 1; - - for ( i = 0; i != nonWrappedSize; i += 2 ) - { - buffer->Indices.push_back(i + 1); - buffer->Indices.push_back(index); - buffer->Indices.push_back(i + 3); - } - - buffer->Indices.push_back(i + 1); - buffer->Indices.push_back(index); - buffer->Indices.push_back(1); - } - - buffer->recalculateBoundingBox(); - SMesh* mesh = new SMesh(); - mesh->addMeshBuffer(buffer); - mesh->setHardwareMappingHint(EHM_STATIC); - mesh->recalculateBoundingBox(); - buffer->drop(); - return mesh; -} - - -/* A cone with proper normals and texture coords */ -IMesh* CGeometryCreator::createConeMesh(f32 radius, f32 length, u32 tesselation, - const video::SColor& colorTop, - const video::SColor& colorBottom, - f32 oblique) const -{ - SMeshBuffer* buffer = new SMeshBuffer(); - - const f32 angleStep = (core::PI * 2.f ) / tesselation; - const f32 angleStepHalf = angleStep*0.5f; - - video::S3DVertex v; - u32 i; - - v.Color = colorTop; - for ( i = 0; i != tesselation; ++i ) - { - f32 angle = angleStep * f32(i); - - v.Pos.X = radius * cosf(angle); - v.Pos.Y = 0.f; - v.Pos.Z = radius * sinf(angle); - v.Normal = v.Pos; - v.Normal.normalize(); - buffer->Vertices.push_back(v); - - angle += angleStepHalf; - v.Pos.X = radius * cosf(angle); - v.Pos.Y = 0.f; - v.Pos.Z = radius * sinf(angle); - v.Normal = v.Pos; - v.Normal.normalize(); - buffer->Vertices.push_back(v); - } - const u32 nonWrappedSize = buffer->Vertices.size() - 1; - - // close top - v.Pos.X = oblique; - v.Pos.Y = length; - v.Pos.Z = 0.f; - v.Normal.X = 0.f; - v.Normal.Y = 1.f; - v.Normal.Z = 0.f; - buffer->Vertices.push_back(v); - - u32 index = buffer->Vertices.size() - 1; - - for ( i = 0; i != nonWrappedSize; i += 1 ) - { - buffer->Indices.push_back(i + 0); - buffer->Indices.push_back(index); - buffer->Indices.push_back(i + 1); - } - - buffer->Indices.push_back(i + 0); - buffer->Indices.push_back(index); - buffer->Indices.push_back(0); - - // close down - v.Color = colorBottom; - v.Pos.X = 0.f; - v.Pos.Y = 0.f; - v.Pos.Z = 0.f; - v.Normal.X = 0.f; - v.Normal.Y = -1.f; - v.Normal.Z = 0.f; - buffer->Vertices.push_back(v); - - index = buffer->Vertices.size() - 1; - - for ( i = 0; i != nonWrappedSize; i += 1 ) - { - buffer->Indices.push_back(index); - buffer->Indices.push_back(i + 0); - buffer->Indices.push_back(i + 1); - } - - buffer->Indices.push_back(index); - buffer->Indices.push_back(i + 0); - buffer->Indices.push_back(0); - - buffer->recalculateBoundingBox(); - SMesh* mesh = new SMesh(); - mesh->addMeshBuffer(buffer); - buffer->drop(); - - mesh->setHardwareMappingHint(EHM_STATIC); - mesh->recalculateBoundingBox(); - return mesh; -} - - -void CGeometryCreator::addToBuffer(const video::S3DVertex& v, SMeshBuffer* Buffer) const -{ - const s32 tnidx = Buffer->Vertices.linear_reverse_search(v); - const bool alreadyIn = (tnidx != -1); - u16 nidx = (u16)tnidx; - if (!alreadyIn) - { - nidx = (u16)Buffer->Vertices.size(); - Buffer->Indices.push_back(nidx); - Buffer->Vertices.push_back(v); - } - else - Buffer->Indices.push_back(nidx); -} - - -IMesh* CGeometryCreator::createVolumeLightMesh( - const u32 subdivideU, const u32 subdivideV, - const video::SColor footColor, const video::SColor tailColor, - const f32 lpDistance, const core::vector3df& lightDim) const -{ - SMeshBuffer* Buffer = new SMeshBuffer(); - Buffer->setHardwareMappingHint(EHM_STATIC); - - const core::vector3df lightPoint(0, -(lpDistance*lightDim.Y), 0); - const f32 ax = lightDim.X * 0.5f; // X Axis - const f32 az = lightDim.Z * 0.5f; // Z Axis - - Buffer->Vertices.clear(); - Buffer->Vertices.reallocate(6+12*(subdivideU+subdivideV)); - Buffer->Indices.clear(); - Buffer->Indices.reallocate(6+12*(subdivideU+subdivideV)); - //draw the bottom foot.. the glowing region - addToBuffer(video::S3DVertex(-ax, 0, az, 0,0,0, footColor, 0, 1),Buffer); - addToBuffer(video::S3DVertex( ax, 0, az, 0,0,0, footColor, 1, 1),Buffer); - addToBuffer(video::S3DVertex( ax, 0,-az, 0,0,0, footColor, 1, 0),Buffer); - - addToBuffer(video::S3DVertex( ax, 0,-az, 0,0,0, footColor, 1, 0),Buffer); - addToBuffer(video::S3DVertex(-ax, 0,-az, 0,0,0, footColor, 0, 0),Buffer); - addToBuffer(video::S3DVertex(-ax, 0, az, 0,0,0, footColor, 0, 1),Buffer); - - f32 tu = 0.f; - const f32 tuStep = 1.f/subdivideU; - f32 bx = -ax; - const f32 bxStep = lightDim.X * tuStep; - // Slices in X/U space - for (u32 i = 0; i <= subdivideU; ++i) - { - // These are the two endpoints for a slice at the foot - core::vector3df end1(bx, 0.0f, -az); - core::vector3df end2(bx, 0.0f, az); - - end1 -= lightPoint; // get a vector from point to lightsource - end1.normalize(); // normalize vector - end1 *= lightDim.Y; // multiply it out by shootlength - - end1.X += bx; // Add the original point location to the vector - end1.Z -= az; - - // Do it again for the other point. - end2 -= lightPoint; - end2.normalize(); - end2 *= lightDim.Y; - - end2.X += bx; - end2.Z += az; - - addToBuffer(video::S3DVertex(bx , 0, az, 0,0,0, footColor, tu, 1),Buffer); - addToBuffer(video::S3DVertex(bx , 0, -az, 0,0,0, footColor, tu, 0),Buffer); - addToBuffer(video::S3DVertex(end2.X , end2.Y, end2.Z, 0,0,0, tailColor, tu, 1),Buffer); - - addToBuffer(video::S3DVertex(bx , 0, -az, 0,0,0, footColor, tu, 0),Buffer); - addToBuffer(video::S3DVertex(end1.X , end1.Y, end1.Z, 0,0,0, tailColor, tu, 0),Buffer); - addToBuffer(video::S3DVertex(end2.X , end2.Y, end2.Z, 0,0,0, tailColor, tu, 1),Buffer); - - //back side - addToBuffer(video::S3DVertex(-end2.X , end2.Y, -end2.Z, 0,0,0, tailColor, tu, 1),Buffer); - addToBuffer(video::S3DVertex(-bx , 0, -az, 0,0,0, footColor, tu, 1),Buffer); - addToBuffer(video::S3DVertex(-bx , 0, az, 0,0,0, footColor, tu, 0),Buffer); - - addToBuffer(video::S3DVertex(-bx , 0, az, 0,0,0, footColor, tu, 0),Buffer); - addToBuffer(video::S3DVertex(-end1.X , end1.Y, -end1.Z, 0,0,0, tailColor, tu, 0),Buffer); - addToBuffer(video::S3DVertex(-end2.X , end2.Y, -end2.Z, 0,0,0, tailColor, tu, 1),Buffer); - tu += tuStep; - bx += bxStep; - } - - f32 tv = 0.f; - const f32 tvStep = 1.f/subdivideV; - f32 bz = -az; - const f32 bzStep = lightDim.Z * tvStep; - // Slices in Z/V space - for(u32 i = 0; i <= subdivideV; ++i) - { - // These are the two endpoints for a slice at the foot - core::vector3df end1(-ax, 0.0f, bz); - core::vector3df end2(ax, 0.0f, bz); - - end1 -= lightPoint; // get a vector from point to lightsource - end1.normalize(); // normalize vector - end1 *= lightDim.Y; // multiply it out by shootlength - - end1.X -= ax; // Add the original point location to the vector - end1.Z += bz; - - // Do it again for the other point. - end2 -= lightPoint; - end2.normalize(); - end2 *= lightDim.Y; - - end2.X += ax; - end2.Z += bz; - - addToBuffer(video::S3DVertex(-ax , 0, bz, 0,0,0, footColor, 0, tv),Buffer); - addToBuffer(video::S3DVertex(ax , 0, bz, 0,0,0, footColor, 1, tv),Buffer); - addToBuffer(video::S3DVertex(end2.X , end2.Y, end2.Z, 0,0,0, tailColor, 1, tv),Buffer); - - addToBuffer(video::S3DVertex(end2.X , end2.Y, end2.Z, 0,0,0, tailColor, 1, tv),Buffer); - addToBuffer(video::S3DVertex(end1.X , end1.Y, end1.Z, 0,0,0, tailColor, 0, tv),Buffer); - addToBuffer(video::S3DVertex(-ax , 0, bz, 0,0,0, footColor, 0, tv),Buffer); - - //back side - addToBuffer(video::S3DVertex(ax , 0, -bz, 0,0,0, footColor, 0, tv),Buffer); - addToBuffer(video::S3DVertex(-ax , 0, -bz, 0,0,0, footColor, 1, tv),Buffer); - addToBuffer(video::S3DVertex(-end2.X , end2.Y, -end2.Z, 0,0,0, tailColor, 1, tv),Buffer); - - addToBuffer(video::S3DVertex(-end2.X , end2.Y, -end2.Z, 0,0,0, tailColor, 1, tv),Buffer); - addToBuffer(video::S3DVertex(-end1.X , end1.Y, -end1.Z, 0,0,0, tailColor, 0, tv),Buffer); - addToBuffer(video::S3DVertex(ax , 0, -bz, 0,0,0, footColor, 0, tv),Buffer); - tv += tvStep; - bz += bzStep; - } - - Buffer->recalculateBoundingBox(); - - Buffer->Material.MaterialType = video::EMT_ONETEXTURE_BLEND; - Buffer->Material.MaterialTypeParam = pack_textureBlendFunc( video::EBF_SRC_COLOR, video::EBF_SRC_ALPHA, video::EMFN_MODULATE_1X ); - - Buffer->Material.Lighting = false; - Buffer->Material.ZWriteEnable = video::EZW_OFF; - - Buffer->setDirty(EBT_VERTEX_AND_INDEX); - - Buffer->recalculateBoundingBox(); - SMesh* mesh = new SMesh(); - mesh->addMeshBuffer(Buffer); - Buffer->drop(); - - mesh->recalculateBoundingBox(); - return mesh; -} - - -} // end namespace scene -} // end namespace irr - diff --git a/source/Irrlicht/CGeometryCreator.h b/source/Irrlicht/CGeometryCreator.h deleted file mode 100644 index 4c918bdc..00000000 --- a/source/Irrlicht/CGeometryCreator.h +++ /dev/null @@ -1,67 +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_GEOMETRY_CREATOR_H_INCLUDED__ -#define __C_GEOMETRY_CREATOR_H_INCLUDED__ - -#include "IGeometryCreator.h" -#include "SMeshBuffer.h" - -namespace irr -{ - -namespace scene -{ - -//! class for creating geometry on the fly -class CGeometryCreator : public IGeometryCreator -{ - void addToBuffer(const video::S3DVertex& v, SMeshBuffer* Buffer) const; -public: - virtual IMesh* createCubeMesh(const core::vector3df& size, ECUBE_MESH_TYPE type) const _IRR_OVERRIDE_; - - virtual IMesh* createHillPlaneMesh( - const core::dimension2d<f32>& tileSize, const core::dimension2d<u32>& tileCount, - video::SMaterial* material, f32 hillHeight, const core::dimension2d<f32>& countHills, - const core::dimension2d<f32>& textureRepeatCount) const _IRR_OVERRIDE_; - - virtual IMesh* createGeoplaneMesh(f32 radius, u32 rows, u32 columns) const _IRR_OVERRIDE_; - - virtual IMesh* createTerrainMesh(video::IImage* texture, - video::IImage* heightmap, const core::dimension2d<f32>& stretchSize, - f32 maxHeight, video::IVideoDriver* driver, - const core::dimension2d<u32>& defaultVertexBlockSize, - bool debugBorders=false) const _IRR_OVERRIDE_; - - virtual IMesh* createArrowMesh(const u32 tesselationCylinder, - const u32 tesselationCone, const f32 height, - const f32 cylinderHeight, const f32 width0, - const f32 width1, const video::SColor vtxColor0, - const video::SColor vtxColor1) const _IRR_OVERRIDE_; - - virtual IMesh* createSphereMesh(f32 radius, u32 polyCountX, u32 polyCountY) const _IRR_OVERRIDE_; - - virtual IMesh* createCylinderMesh(f32 radius, f32 length, u32 tesselation, - const video::SColor& color=0xffffffff, - bool closeTop=true, f32 oblique=0.f, u32 normalType=0) const _IRR_OVERRIDE_; - - virtual IMesh* createConeMesh(f32 radius, f32 length, u32 tesselation, - const video::SColor& colorTop=0xffffffff, - const video::SColor& colorBottom=0xffffffff, - f32 oblique=0.f) const _IRR_OVERRIDE_; - - virtual IMesh* createVolumeLightMesh( - const u32 subdivideU=32, const u32 subdivideV=32, - const video::SColor footColor=0xffffffff, - const video::SColor tailColor=0xffffffff, - const f32 lpDistance = 8.f, - const core::vector3df& lightDim = core::vector3df(1.f,1.2f,1.f)) const _IRR_OVERRIDE_; -}; - - -} // end namespace scene -} // end namespace irr - -#endif - diff --git a/source/Irrlicht/CImageLoaderDDS.cpp b/source/Irrlicht/CImageLoaderDDS.cpp deleted file mode 100644 index 0a4ab3d7..00000000 --- a/source/Irrlicht/CImageLoaderDDS.cpp +++ /dev/null @@ -1,887 +0,0 @@ -// Copyright (C) 2013 Patryk Nadrowski -// Heavily based on the DDS loader implemented by Thomas Alten -// and DDS loader from IrrSpintz implemented by Thomas Ince -// This file is part of the "Irrlicht Engine". -// For conditions of distribution and use, see copyright notice in irrlicht.h - -/* - Based on Code from Copyright (c) 2003 Randy Reddig - Based on code from Nvidia's DDS example: - http://www.nvidia.com/object/dxtc_decompression_code.html - - mainly c to cpp -*/ - -#include "CImageLoaderDDS.h" - -#if defined(_IRR_COMPILE_WITH_DDS_LOADER_) || defined(_IRR_COMPILE_WITH_DDS_DECODER_LOADER_) - -#include "IReadFile.h" -#include "os.h" -#include "CColorConverter.h" -#include "CImage.h" -#include "irrString.h" - -// Header flag values -#define DDSD_CAPS 0x00000001 -#define DDSD_HEIGHT 0x00000002 -#define DDSD_WIDTH 0x00000004 -#define DDSD_PITCH 0x00000008 -#define DDSD_PIXELFORMAT 0x00001000 -#define DDSD_MIPMAPCOUNT 0x00020000 -#define DDSD_LINEARSIZE 0x00080000 -#define DDSD_DEPTH 0x00800000 - -// Pixel format flag values -#define DDPF_ALPHAPIXELS 0x00000001 -#define DDPF_ALPHA 0x00000002 -#define DDPF_FOURCC 0x00000004 -#define DDPF_RGB 0x00000040 -#define DDPF_COMPRESSED 0x00000080 -#define DDPF_LUMINANCE 0x00020000 - -// Caps1 values -#define DDSCAPS1_COMPLEX 0x00000008 -#define DDSCAPS1_TEXTURE 0x00001000 -#define DDSCAPS1_MIPMAP 0x00400000 - -// Caps2 values -#define DDSCAPS2_CUBEMAP 0x00000200 -#define DDSCAPS2_CUBEMAP_POSITIVEX 0x00000400 -#define DDSCAPS2_CUBEMAP_NEGATIVEX 0x00000800 -#define DDSCAPS2_CUBEMAP_POSITIVEY 0x00001000 -#define DDSCAPS2_CUBEMAP_NEGATIVEY 0x00002000 -#define DDSCAPS2_CUBEMAP_POSITIVEZ 0x00004000 -#define DDSCAPS2_CUBEMAP_NEGATIVEZ 0x00008000 -#define DDSCAPS2_VOLUME 0x00200000 - -namespace irr -{ - -namespace video -{ - -/* -DDSGetInfo() -extracts relevant info from a dds texture, returns 0 on success -*/ -s32 DDSGetInfo(ddsHeader* dds, s32* width, s32* height, eDDSPixelFormat* pf) -{ - /* dummy test */ - if( dds == NULL ) - return -1; - - /* test dds header */ - if( *((s32*) dds->Magic) != *((s32*) "DDS ") ) - return -1; - if( DDSLittleLong( dds->Size ) != 124 ) - return -1; - if( !(DDSLittleLong( dds->Flags ) & DDSD_PIXELFORMAT) ) - return -1; - if( !(DDSLittleLong( dds->Flags ) & DDSD_CAPS) ) - return -1; - - /* extract width and height */ - if( width != NULL ) - *width = DDSLittleLong( dds->Width ); - if( height != NULL ) - *height = DDSLittleLong( dds->Height ); - - /* get pixel format */ - - /* extract fourCC */ - const u32 fourCC = dds->PixelFormat.FourCC; - - /* test it */ - if( fourCC == 0 ) - *pf = DDS_PF_ARGB8888; - else if( fourCC == *((u32*) "DXT1") ) - *pf = DDS_PF_DXT1; - else if( fourCC == *((u32*) "DXT2") ) - *pf = DDS_PF_DXT2; - else if( fourCC == *((u32*) "DXT3") ) - *pf = DDS_PF_DXT3; - else if( fourCC == *((u32*) "DXT4") ) - *pf = DDS_PF_DXT4; - else if( fourCC == *((u32*) "DXT5") ) - *pf = DDS_PF_DXT5; - else - *pf = DDS_PF_UNKNOWN; - - /* return ok */ - return 0; -} - - -#ifdef _IRR_COMPILE_WITH_DDS_DECODER_LOADER_ - -/* -DDSDecompressARGB8888() -decompresses an argb 8888 format texture -*/ -s32 DDSDecompressARGB8888(ddsHeader* dds, u8* data, s32 width, s32 height, u8* pixels) -{ - /* setup */ - u8* in = data; - u8* out = pixels; - - /* walk y */ - for(s32 y = 0; y < height; y++) - { - /* walk x */ - for(s32 x = 0; x < width; x++) - { - *out++ = *in++; - *out++ = *in++; - *out++ = *in++; - *out++ = *in++; - } - } - - /* return ok */ - return 0; -} - - -/*! - DDSGetColorBlockColors() - extracts colors from a dds color block -*/ -void DDSGetColorBlockColors(ddsColorBlock* block, ddsColor colors[4]) -{ - u16 word; - - - /* color 0 */ - word = DDSLittleShort( block->colors[ 0 ] ); - colors[ 0 ].a = 0xff; - - /* extract rgb bits */ - colors[ 0 ].b = (u8) word; - colors[ 0 ].b <<= 3; - colors[ 0 ].b |= (colors[ 0 ].b >> 5); - word >>= 5; - colors[ 0 ].g = (u8) word; - colors[ 0 ].g <<= 2; - colors[ 0 ].g |= (colors[ 0 ].g >> 5); - word >>= 6; - colors[ 0 ].r = (u8) word; - colors[ 0 ].r <<= 3; - colors[ 0 ].r |= (colors[ 0 ].r >> 5); - - /* same for color 1 */ - word = DDSLittleShort( block->colors[ 1 ] ); - colors[ 1 ].a = 0xff; - - /* extract rgb bits */ - colors[ 1 ].b = (u8) word; - colors[ 1 ].b <<= 3; - colors[ 1 ].b |= (colors[ 1 ].b >> 5); - word >>= 5; - colors[ 1 ].g = (u8) word; - colors[ 1 ].g <<= 2; - colors[ 1 ].g |= (colors[ 1 ].g >> 5); - word >>= 6; - colors[ 1 ].r = (u8) word; - colors[ 1 ].r <<= 3; - colors[ 1 ].r |= (colors[ 1 ].r >> 5); - - /* use this for all but the super-freak math method */ - if( block->colors[ 0 ] > block->colors[ 1 ] ) - { - /* four-color block: derive the other two colors. - 00 = color 0, 01 = color 1, 10 = color 2, 11 = color 3 - these two bit codes correspond to the 2-bit fields - stored in the 64-bit block. */ - - word = ((u16) colors[ 0 ].r * 2 + (u16) colors[ 1 ].r ) / 3; - /* no +1 for rounding */ - /* as bits have been shifted to 888 */ - colors[ 2 ].r = (u8) word; - word = ((u16) colors[ 0 ].g * 2 + (u16) colors[ 1 ].g) / 3; - colors[ 2 ].g = (u8) word; - word = ((u16) colors[ 0 ].b * 2 + (u16) colors[ 1 ].b) / 3; - colors[ 2 ].b = (u8) word; - colors[ 2 ].a = 0xff; - - word = ((u16) colors[ 0 ].r + (u16) colors[ 1 ].r * 2) / 3; - colors[ 3 ].r = (u8) word; - word = ((u16) colors[ 0 ].g + (u16) colors[ 1 ].g * 2) / 3; - colors[ 3 ].g = (u8) word; - word = ((u16) colors[ 0 ].b + (u16) colors[ 1 ].b * 2) / 3; - colors[ 3 ].b = (u8) word; - colors[ 3 ].a = 0xff; - } - else - { - /* three-color block: derive the other color. - 00 = color 0, 01 = color 1, 10 = color 2, - 11 = transparent. - These two bit codes correspond to the 2-bit fields - stored in the 64-bit block */ - - word = ((u16) colors[ 0 ].r + (u16) colors[ 1 ].r) / 2; - colors[ 2 ].r = (u8) word; - word = ((u16) colors[ 0 ].g + (u16) colors[ 1 ].g) / 2; - colors[ 2 ].g = (u8) word; - word = ((u16) colors[ 0 ].b + (u16) colors[ 1 ].b) / 2; - colors[ 2 ].b = (u8) word; - colors[ 2 ].a = 0xff; - - /* random color to indicate alpha */ - colors[ 3 ].r = 0x00; - colors[ 3 ].g = 0xff; - colors[ 3 ].b = 0xff; - colors[ 3 ].a = 0x00; - } -} - - -/* -DDSDecodeColorBlock() -decodes a dds color block -fixme: make endian-safe -*/ - -void DDSDecodeColorBlock(u32* pixel, ddsColorBlock* block, s32 width, u32 colors[4]) -{ - s32 r, n; - u32 bits; - u32 masks[] = { 3, 12, 3 << 4, 3 << 6 }; /* bit masks = 00000011, 00001100, 00110000, 11000000 */ - s32 shift[] = { 0, 2, 4, 6 }; - - - /* r steps through lines in y */ - for( r = 0; r < 4; r++, pixel += (width - 4) ) /* no width * 4 as u32 ptr inc will * 4 */ - { - /* width * 4 bytes per pixel per line, each j dxtc row is 4 lines of pixels */ - - /* n steps through pixels */ - for( n = 0; n < 4; n++ ) - { - bits = block->row[ r ] & masks[ n ]; - bits >>= shift[ n ]; - - switch( bits ) - { - case 0: - *pixel = colors[ 0 ]; - pixel++; - break; - - case 1: - *pixel = colors[ 1 ]; - pixel++; - break; - - case 2: - *pixel = colors[ 2 ]; - pixel++; - break; - - case 3: - *pixel = colors[ 3 ]; - pixel++; - break; - - default: - /* invalid */ - pixel++; - break; - } - } - } -} - - -/* -DDSDecodeAlphaExplicit() -decodes a dds explicit alpha block -*/ -void DDSDecodeAlphaExplicit(u32* pixel, ddsAlphaBlockExplicit* alphaBlock, s32 width, u32 alphaZero) -{ - s32 row, pix; - u16 word; - ddsColor color; - - - /* clear color */ - color.r = 0; - color.g = 0; - color.b = 0; - - /* walk rows */ - for( row = 0; row < 4; row++, pixel += (width - 4) ) - { - word = DDSLittleShort( alphaBlock->row[ row ] ); - - /* walk pixels */ - for( pix = 0; pix < 4; pix++ ) - { - /* zero the alpha bits of image pixel */ - *pixel &= alphaZero; - color.a = word & 0x000F; - color.a = color.a | (color.a << 4); - *pixel |= *((u32*) &color); - word >>= 4; /* move next bits to lowest 4 */ - pixel++; /* move to next pixel in the row */ - } - } -} - - - -/* -DDSDecodeAlpha3BitLinear() -decodes interpolated alpha block -*/ -void DDSDecodeAlpha3BitLinear(u32* pixel, ddsAlphaBlock3BitLinear* alphaBlock, s32 width, u32 alphaZero) -{ - - s32 row, pix; - u32 stuff; - u8 bits[ 4 ][ 4 ]; - u16 alphas[ 8 ]; - ddsColor aColors[ 4 ][ 4 ]; - - /* get initial alphas */ - alphas[ 0 ] = alphaBlock->alpha0; - alphas[ 1 ] = alphaBlock->alpha1; - - /* 8-alpha block */ - if( alphas[ 0 ] > alphas[ 1 ] ) - { - /* 000 = alpha_0, 001 = alpha_1, others are interpolated */ - alphas[ 2 ] = ( 6 * alphas[ 0 ] + alphas[ 1 ]) / 7; /* bit code 010 */ - alphas[ 3 ] = ( 5 * alphas[ 0 ] + 2 * alphas[ 1 ]) / 7; /* bit code 011 */ - alphas[ 4 ] = ( 4 * alphas[ 0 ] + 3 * alphas[ 1 ]) / 7; /* bit code 100 */ - alphas[ 5 ] = ( 3 * alphas[ 0 ] + 4 * alphas[ 1 ]) / 7; /* bit code 101 */ - alphas[ 6 ] = ( 2 * alphas[ 0 ] + 5 * alphas[ 1 ]) / 7; /* bit code 110 */ - alphas[ 7 ] = ( alphas[ 0 ] + 6 * alphas[ 1 ]) / 7; /* bit code 111 */ - } - - /* 6-alpha block */ - else - { - /* 000 = alpha_0, 001 = alpha_1, others are interpolated */ - alphas[ 2 ] = (4 * alphas[ 0 ] + alphas[ 1 ]) / 5; /* bit code 010 */ - alphas[ 3 ] = (3 * alphas[ 0 ] + 2 * alphas[ 1 ]) / 5; /* bit code 011 */ - alphas[ 4 ] = (2 * alphas[ 0 ] + 3 * alphas[ 1 ]) / 5; /* bit code 100 */ - alphas[ 5 ] = ( alphas[ 0 ] + 4 * alphas[ 1 ]) / 5; /* bit code 101 */ - alphas[ 6 ] = 0; /* bit code 110 */ - alphas[ 7 ] = 255; /* bit code 111 */ - } - - /* decode 3-bit fields into array of 16 bytes with same value */ - - /* first two rows of 4 pixels each */ - stuff = *((u32*) &(alphaBlock->stuff[ 0 ])); - - bits[ 0 ][ 0 ] = (u8) (stuff & 0x00000007); - stuff >>= 3; - bits[ 0 ][ 1 ] = (u8) (stuff & 0x00000007); - stuff >>= 3; - bits[ 0 ][ 2 ] = (u8) (stuff & 0x00000007); - stuff >>= 3; - bits[ 0 ][ 3 ] = (u8) (stuff & 0x00000007); - stuff >>= 3; - bits[ 1 ][ 0 ] = (u8) (stuff & 0x00000007); - stuff >>= 3; - bits[ 1 ][ 1 ] = (u8) (stuff & 0x00000007); - stuff >>= 3; - bits[ 1 ][ 2 ] = (u8) (stuff & 0x00000007); - stuff >>= 3; - bits[ 1 ][ 3 ] = (u8) (stuff & 0x00000007); - - /* last two rows */ - stuff = *((u32*) &(alphaBlock->stuff[ 3 ])); /* last 3 bytes */ - - bits[ 2 ][ 0 ] = (u8) (stuff & 0x00000007); - stuff >>= 3; - bits[ 2 ][ 1 ] = (u8) (stuff & 0x00000007); - stuff >>= 3; - bits[ 2 ][ 2 ] = (u8) (stuff & 0x00000007); - stuff >>= 3; - bits[ 2 ][ 3 ] = (u8) (stuff & 0x00000007); - stuff >>= 3; - bits[ 3 ][ 0 ] = (u8) (stuff & 0x00000007); - stuff >>= 3; - bits[ 3 ][ 1 ] = (u8) (stuff & 0x00000007); - stuff >>= 3; - bits[ 3 ][ 2 ] = (u8) (stuff & 0x00000007); - stuff >>= 3; - bits[ 3 ][ 3 ] = (u8) (stuff & 0x00000007); - - /* decode the codes into alpha values */ - for( row = 0; row < 4; row++ ) - { - for( pix=0; pix < 4; pix++ ) - { - aColors[ row ][ pix ].r = 0; - aColors[ row ][ pix ].g = 0; - aColors[ row ][ pix ].b = 0; - aColors[ row ][ pix ].a = (u8) alphas[ bits[ row ][ pix ] ]; - } - } - - /* write out alpha values to the image bits */ - for( row = 0; row < 4; row++, pixel += width-4 ) - { - for( pix = 0; pix < 4; pix++ ) - { - /* zero the alpha bits of image pixel */ - *pixel &= alphaZero; - - /* or the bits into the prev. nulled alpha */ - *pixel |= *((u32*) &(aColors[ row ][ pix ])); - pixel++; - } - } -} - - -/* -DDSDecompressDXT1() -decompresses a dxt1 format texture -*/ -s32 DDSDecompressDXT1(ddsHeader* dds, u8* data, s32 width, s32 height, u8* pixels) -{ - s32 x, y, xBlocks, yBlocks; - u32 *pixel; - ddsColorBlock *block; - ddsColor colors[ 4 ]; - - /* setup */ - xBlocks = width / 4; - yBlocks = height / 4; - - /* walk y */ - for( y = 0; y < yBlocks; y++ ) - { - /* 8 bytes per block */ - block = (ddsColorBlock*) (data + y * xBlocks * 8); - - /* walk x */ - for( x = 0; x < xBlocks; x++, block++ ) - { - DDSGetColorBlockColors( block, colors ); - pixel = (u32*) (pixels + x * 16 + (y * 4) * width * 4); - DDSDecodeColorBlock( pixel, block, width, (u32*) colors ); - } - } - - /* return ok */ - return 0; -} - - -/* -DDSDecompressDXT3() -decompresses a dxt3 format texture -*/ - -s32 DDSDecompressDXT3(ddsHeader* dds, u8* data, s32 width, s32 height, u8* pixels) -{ - s32 x, y, xBlocks, yBlocks; - u32 *pixel, alphaZero; - ddsColorBlock *block; - ddsAlphaBlockExplicit *alphaBlock; - ddsColor colors[ 4 ]; - - /* setup */ - xBlocks = width / 4; - yBlocks = height / 4; - - /* create zero alpha */ - colors[ 0 ].a = 0; - colors[ 0 ].r = 0xFF; - colors[ 0 ].g = 0xFF; - colors[ 0 ].b = 0xFF; - alphaZero = *((u32*) &colors[ 0 ]); - - /* walk y */ - for( y = 0; y < yBlocks; y++ ) - { - /* 8 bytes per block, 1 block for alpha, 1 block for color */ - block = (ddsColorBlock*) (data + y * xBlocks * 16); - - /* walk x */ - for( x = 0; x < xBlocks; x++, block++ ) - { - /* get alpha block */ - alphaBlock = (ddsAlphaBlockExplicit*) block; - - /* get color block */ - block++; - DDSGetColorBlockColors( block, colors ); - - /* decode color block */ - pixel = (u32*) (pixels + x * 16 + (y * 4) * width * 4); - DDSDecodeColorBlock( pixel, block, width, (u32*) colors ); - - /* overwrite alpha bits with alpha block */ - DDSDecodeAlphaExplicit( pixel, alphaBlock, width, alphaZero ); - } - } - - /* return ok */ - return 0; -} - - -/* -DDSDecompressDXT5() -decompresses a dxt5 format texture -*/ -s32 DDSDecompressDXT5(ddsHeader* dds, u8* data, s32 width, s32 height, u8* pixels) -{ - s32 x, y, xBlocks, yBlocks; - u32 *pixel, alphaZero; - ddsColorBlock *block; - ddsAlphaBlock3BitLinear *alphaBlock; - ddsColor colors[ 4 ]; - - /* setup */ - xBlocks = width / 4; - yBlocks = height / 4; - - /* create zero alpha */ - colors[ 0 ].a = 0; - colors[ 0 ].r = 0xFF; - colors[ 0 ].g = 0xFF; - colors[ 0 ].b = 0xFF; - alphaZero = *((u32*) &colors[ 0 ]); - - /* walk y */ - for( y = 0; y < yBlocks; y++ ) - { - /* 8 bytes per block, 1 block for alpha, 1 block for color */ - block = (ddsColorBlock*) (data + y * xBlocks * 16); - - /* walk x */ - for( x = 0; x < xBlocks; x++, block++ ) - { - /* get alpha block */ - alphaBlock = (ddsAlphaBlock3BitLinear*) block; - - /* get color block */ - block++; - DDSGetColorBlockColors( block, colors ); - - /* decode color block */ - pixel = (u32*) (pixels + x * 16 + (y * 4) * width * 4); - DDSDecodeColorBlock( pixel, block, width, (u32*) colors ); - - /* overwrite alpha bits with alpha block */ - DDSDecodeAlpha3BitLinear( pixel, alphaBlock, width, alphaZero ); - } - } - - /* return ok */ - return 0; -} - - -/* -DDSDecompressDXT2() -decompresses a dxt2 format texture (fixme: un-premultiply alpha) -*/ -s32 DDSDecompressDXT2(ddsHeader* dds, u8* data, s32 width, s32 height, u8* pixels) -{ - /* decompress dxt3 first */ - const s32 r = DDSDecompressDXT3( dds, data, width, height, pixels ); - - /* return to sender */ - return r; -} - - -/* -DDSDecompressDXT4() -decompresses a dxt4 format texture (fixme: un-premultiply alpha) -*/ -s32 DDSDecompressDXT4(ddsHeader* dds, u8* data, s32 width, s32 height, u8* pixels) -{ - /* decompress dxt5 first */ - const s32 r = DDSDecompressDXT5( dds, data, width, height, pixels ); - - /* return to sender */ - return r; -} - - -/* -DDSDecompress() -decompresses a dds texture into an rgba image buffer, returns 0 on success -*/ -s32 DDSDecompress(ddsHeader* dds, u8* data, u8* pixels) -{ - s32 width, height; - eDDSPixelFormat pf; - - /* get dds info */ - s32 r = DDSGetInfo( dds, &width, &height, &pf ); - if ( r ) - return r; - - /* decompress */ - switch( pf ) - { - case DDS_PF_ARGB8888: - /* fixme: support other [a]rgb formats */ - r = DDSDecompressARGB8888( dds, data, width, height, pixels ); - break; - - case DDS_PF_DXT1: - r = DDSDecompressDXT1( dds, data, width, height, pixels ); - break; - - case DDS_PF_DXT2: - r = DDSDecompressDXT2( dds, data, width, height, pixels ); - break; - - case DDS_PF_DXT3: - r = DDSDecompressDXT3( dds, data, width, height, pixels ); - break; - - case DDS_PF_DXT4: - r = DDSDecompressDXT4( dds, data, width, height, pixels ); - break; - - case DDS_PF_DXT5: - r = DDSDecompressDXT5( dds, data, width, height, pixels ); - break; - - default: // DDS_PF_UNKNOWN - r = -1; - break; - } - - /* return to sender */ - return r; -} - -#endif - - -//! returns true if the file maybe is able to be loaded by this class -//! based on the file extension (e.g. ".tga") -bool CImageLoaderDDS::isALoadableFileExtension(const io::path& filename) const -{ - return core::hasFileExtension(filename, "dds"); -} - - -//! returns true if the file maybe is able to be loaded by this class -bool CImageLoaderDDS::isALoadableFileFormat(io::IReadFile* file) const -{ - if (!file) - return false; - - c8 MagicWord[4]; - file->read(&MagicWord, 4); - - return (MagicWord[0] == 'D' && MagicWord[1] == 'D' && MagicWord[2] == 'S'); -} - - -//! creates a surface from the file -IImage* CImageLoaderDDS::loadImage(io::IReadFile* file) const -{ - ddsHeader header; - IImage* image = 0; - s32 width, height; - eDDSPixelFormat pixelFormat; - ECOLOR_FORMAT format = ECF_UNKNOWN; - u32 dataSize = 0; - u32 mipMapsDataSize = 0; - bool is3D = false; - bool useAlpha = false; - u32 mipMapCount = 0; - - file->seek(0); - file->read(&header, sizeof(ddsHeader)); - - if (0 == DDSGetInfo(&header, &width, &height, &pixelFormat)) - { - is3D = header.Depth > 0 && (header.Flags & DDSD_DEPTH); - - if (!is3D) - header.Depth = 1; - - useAlpha = header.PixelFormat.Flags & DDPF_ALPHAPIXELS; - - if (header.MipMapCount > 0 && (header.Flags & DDSD_MIPMAPCOUNT)) - mipMapCount = header.MipMapCount; - -#ifdef _IRR_COMPILE_WITH_DDS_DECODER_LOADER_ - u32 newSize = file->getSize() - sizeof(ddsHeader); - u8* memFile = new u8[newSize]; - file->read(memFile, newSize); - - image = new CImage(ECF_A8R8G8B8, core::dimension2d<u32>(width, height)); - - if (DDSDecompress(&header, memFile, (u8*)image->lock()) == -1) - { - image->unlock(); - image->drop(); - image = 0; - } - - delete[] memFile; -#else - if (header.PixelFormat.Flags & DDPF_RGB) // Uncompressed formats - { -// u32 byteCount = header.PixelFormat.RGBBitCount / 8; - - if( header.Flags & DDSD_PITCH ) - dataSize = header.PitchOrLinearSize * header.Height * header.Depth * (header.PixelFormat.RGBBitCount / 8); - else - dataSize = header.Width * header.Height * header.Depth * (header.PixelFormat.RGBBitCount / 8); - - u8* data = new u8[dataSize]; - file->read(data, dataSize); - - switch (header.PixelFormat.RGBBitCount) // Bytes per pixel - { - case 16: - { - if (useAlpha) - { - if (header.PixelFormat.ABitMask == 0x8000) - format = ECF_A1R5G5B5; - } - else - { - if (header.PixelFormat.RBitMask == 0xf800) - format = ECF_R5G6B5; - } - - break; - } - case 24: - { - if (!useAlpha) - { - if (header.PixelFormat.RBitMask == 0xff0000) - format = ECF_R8G8B8; - } - - break; - } - case 32: - { - if (useAlpha) - { - if (header.PixelFormat.RBitMask & 0xff0000) - format = ECF_A8R8G8B8; - else if (header.PixelFormat.RBitMask & 0xff) - { - // convert from A8B8G8R8 to A8R8G8B8 - u8 tmp = 0; - - for (u32 i = 0; i < dataSize; i += 4) - { - tmp = data[i]; - data[i] = data[i+2]; - data[i+2] = tmp; - } - } - } - - break; - } - } - - if (format != ECF_UNKNOWN) - { - if (!is3D) // Currently 3D textures are unsupported. - { - image = new CImage(format, core::dimension2d<u32>(header.Width, header.Height), data, true, true); - } - } - else - { - delete[] data; - } - } - else if (header.PixelFormat.Flags & DDPF_FOURCC) // Compressed formats - { - switch(pixelFormat) - { - case DDS_PF_DXT1: - { - format = ECF_DXT1; - break; - } - case DDS_PF_DXT2: - case DDS_PF_DXT3: - { - format = ECF_DXT3; - break; - } - case DDS_PF_DXT4: - case DDS_PF_DXT5: - { - format = ECF_DXT5; - break; - } - default: // either not compressed or unknown - break; - } - - if( format != ECF_UNKNOWN ) - { - if (!is3D) // Currently 3D textures are unsupported. - { - dataSize = IImage::getDataSizeFromFormat(format, header.Width, header.Height); - - u8* data = new u8[dataSize]; - file->read(data, dataSize); - - image = new CImage(format, core::dimension2d<u32>(header.Width, header.Height), data, true, true); - - if (mipMapCount > 0) - { - u32 tmpWidth = header.Width; - u32 tmpHeight = header.Height; - - do - { - if (tmpWidth > 1) - tmpWidth >>= 1; - - if (tmpHeight > 1) - tmpHeight >>= 1; - - mipMapsDataSize += IImage::getDataSizeFromFormat(format, tmpWidth, tmpHeight); - } - while (tmpWidth != 1 || tmpHeight != 1); - - u8* mipMapsData = new u8[mipMapsDataSize]; - file->read(mipMapsData, mipMapsDataSize); - - image->setMipMapsData(mipMapsData, true, true); - } - } - } - } -#endif - } - - return image; -} - - -//! creates a loader which is able to load dds images -IImageLoader* createImageLoaderDDS() -{ - return new CImageLoaderDDS(); -} - - -} // end namespace video -} // end namespace irr - -#endif - diff --git a/source/Irrlicht/CImageLoaderDDS.h b/source/Irrlicht/CImageLoaderDDS.h deleted file mode 100644 index 4f825397..00000000 --- a/source/Irrlicht/CImageLoaderDDS.h +++ /dev/null @@ -1,215 +0,0 @@ -// Copyright (C) 2002-2012 Thomas Alten -// This file is part of the "Irrlicht Engine". -// For conditions of distribution and use, see copyright notice in irrlicht.h - -#ifndef __C_IMAGE_LOADER_DDS_H_INCLUDED__ -#define __C_IMAGE_LOADER_DDS_H_INCLUDED__ - -#include "IrrCompileConfig.h" - -#if defined(_IRR_COMPILE_WITH_DDS_LOADER_) || defined(_IRR_COMPILE_WITH_DDS_DECODER_LOADER_) - -#include "IImageLoader.h" - -namespace irr -{ -namespace video -{ - -/* dds pixel format types */ -enum eDDSPixelFormat -{ - DDS_PF_ARGB8888, - DDS_PF_DXT1, - DDS_PF_DXT2, - DDS_PF_DXT3, - DDS_PF_DXT4, - DDS_PF_DXT5, - DDS_PF_UNKNOWN -}; - -// byte-align structures -#include "irrpack.h" - -/* structures */ - -struct ddsPixelFormat -{ - u32 Size; - u32 Flags; - u32 FourCC; - u32 RGBBitCount; - u32 RBitMask; - u32 GBitMask; - u32 BBitMask; - u32 ABitMask; -} PACK_STRUCT; - - -struct ddsCaps -{ - u32 caps1; - u32 caps2; - u32 caps3; - u32 caps4; -} PACK_STRUCT; - - -struct ddsHeader -{ - c8 Magic[4]; - u32 Size; - u32 Flags; - u32 Height; - u32 Width; - u32 PitchOrLinearSize; - u32 Depth; - u32 MipMapCount; - u32 Reserved1[11]; - ddsPixelFormat PixelFormat; - ddsCaps Caps; - u32 Reserved2; -} PACK_STRUCT; - - -#ifdef _IRR_COMPILE_WITH_DDS_DECODER_LOADER_ - -struct ddsColorBlock -{ - u16 colors[ 2 ]; - u8 row[ 4 ]; -} PACK_STRUCT; - - -struct ddsAlphaBlockExplicit -{ - u16 row[ 4 ]; -} PACK_STRUCT; - - -struct ddsAlphaBlock3BitLinear -{ - u8 alpha0; - u8 alpha1; - u8 stuff[ 6 ]; -} PACK_STRUCT; - - -struct ddsColor -{ - u8 r, g, b, a; -} PACK_STRUCT; - -#endif - - -// Default alignment -#include "irrunpack.h" - - -/* endian tomfoolery */ -typedef union -{ - f32 f; - c8 c[ 4 ]; -} -floatSwapUnion; - - -#ifndef __BIG_ENDIAN__ -#ifdef _SGI_SOURCE -#define __BIG_ENDIAN__ -#endif -#endif - - -#ifdef __BIG_ENDIAN__ - - s32 DDSBigLong( s32 src ) { return src; } - s16 DDSBigShort( s16 src ) { return src; } - f32 DDSBigFloat( f32 src ) { return src; } - - s32 DDSLittleLong( s32 src ) - { - return ((src & 0xFF000000) >> 24) | - ((src & 0x00FF0000) >> 8) | - ((src & 0x0000FF00) << 8) | - ((src & 0x000000FF) << 24); - } - - s16 DDSLittleShort( s16 src ) - { - return ((src & 0xFF00) >> 8) | - ((src & 0x00FF) << 8); - } - - f32 DDSLittleFloat( f32 src ) - { - floatSwapUnion in,out; - in.f = src; - out.c[ 0 ] = in.c[ 3 ]; - out.c[ 1 ] = in.c[ 2 ]; - out.c[ 2 ] = in.c[ 1 ]; - out.c[ 3 ] = in.c[ 0 ]; - return out.f; - } - -#else /*__BIG_ENDIAN__*/ - - s32 DDSLittleLong( s32 src ) { return src; } - s16 DDSLittleShort( s16 src ) { return src; } - f32 DDSLittleFloat( f32 src ) { return src; } - - s32 DDSBigLong( s32 src ) - { - return ((src & 0xFF000000) >> 24) | - ((src & 0x00FF0000) >> 8) | - ((src & 0x0000FF00) << 8) | - ((src & 0x000000FF) << 24); - } - - s16 DDSBigShort( s16 src ) - { - return ((src & 0xFF00) >> 8) | - ((src & 0x00FF) << 8); - } - - f32 DDSBigFloat( f32 src ) - { - floatSwapUnion in,out; - in.f = src; - out.c[ 0 ] = in.c[ 3 ]; - out.c[ 1 ] = in.c[ 2 ]; - out.c[ 2 ] = in.c[ 1 ]; - out.c[ 3 ] = in.c[ 0 ]; - return out.f; - } - -#endif /*__BIG_ENDIAN__*/ - - -/*! - Surface Loader for DDS images -*/ -class CImageLoaderDDS : public IImageLoader -{ -public: - - //! returns true if the file maybe is able to be loaded by this class - //! based on the file extension (e.g. ".tga") - virtual bool isALoadableFileExtension(const io::path& filename) const _IRR_OVERRIDE_; - - //! returns true if the file maybe is able to be loaded by this class - virtual bool isALoadableFileFormat(io::IReadFile* file) const _IRR_OVERRIDE_; - - //! creates a surface from the file - virtual IImage* loadImage(io::IReadFile* file) const _IRR_OVERRIDE_; -}; - - -} // end namespace video -} // end namespace irr - -#endif // compiled with DDS loader -#endif - diff --git a/source/Irrlicht/CImageLoaderPCX.cpp b/source/Irrlicht/CImageLoaderPCX.cpp deleted file mode 100644 index 1c594472..00000000 --- a/source/Irrlicht/CImageLoaderPCX.cpp +++ /dev/null @@ -1,229 +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 "CImageLoaderPCX.h" - -#ifdef _IRR_COMPILE_WITH_PCX_LOADER_ - -#include "IReadFile.h" -#include "SColor.h" -#include "CColorConverter.h" -#include "CImage.h" -#include "os.h" -#include "irrString.h" - - -namespace irr -{ -namespace video -{ - - -//! constructor -CImageLoaderPCX::CImageLoaderPCX() -{ - #ifdef _DEBUG - setDebugName("CImageLoaderPCX"); - #endif -} - - -//! returns true if the file maybe is able to be loaded by this class -//! based on the file extension (e.g. ".tga") -bool CImageLoaderPCX::isALoadableFileExtension(const io::path& filename) const -{ - return core::hasFileExtension ( filename, "pcx" ); -} - - - -//! returns true if the file maybe is able to be loaded by this class -bool CImageLoaderPCX::isALoadableFileFormat(io::IReadFile* file) const -{ - u8 headerID; - file->read(&headerID, sizeof(headerID)); - return headerID == 0x0a; -} - - -//! creates a image from the file -IImage* CImageLoaderPCX::loadImage(io::IReadFile* file) const -{ - SPCXHeader header; - s32* paletteData = 0; - - file->read(&header, sizeof(header)); - #ifdef __BIG_ENDIAN__ - header.XMin = os::Byteswap::byteswap(header.XMin); - header.YMin = os::Byteswap::byteswap(header.YMin); - header.XMax = os::Byteswap::byteswap(header.XMax); - header.YMax = os::Byteswap::byteswap(header.YMax); - header.HorizDPI = os::Byteswap::byteswap(header.HorizDPI); - header.VertDPI = os::Byteswap::byteswap(header.VertDPI); - header.BytesPerLine = os::Byteswap::byteswap(header.BytesPerLine); - header.PaletteType = os::Byteswap::byteswap(header.PaletteType); - header.HScrSize = os::Byteswap::byteswap(header.HScrSize); - header.VScrSize = os::Byteswap::byteswap(header.VScrSize); - #endif - - //! return if the header is wrong - if (header.Manufacturer != 0x0a && header.Encoding != 0x01) - return 0; - - // return if this isn't a supported type - if ((header.BitsPerPixel != 8) && (header.BitsPerPixel != 4) && (header.BitsPerPixel != 1)) - { - os::Printer::log("Unsupported bits per pixel in PCX file.", - file->getFileName(), irr::ELL_WARNING); - return 0; - } - - // read palette - if( (header.BitsPerPixel == 8) && (header.Planes == 1) ) - { - // the palette indicator (usually a 0x0c is found infront of the actual palette data) - // is ignored because some exporters seem to forget to write it. This would result in - // no image loaded before, now only wrong colors will be set. - const long pos = file->getPos(); - file->seek( file->getSize()-256*3, false ); - - u8 *tempPalette = new u8[768]; - paletteData = new s32[256]; - file->read( tempPalette, 768 ); - - for( s32 i=0; i<256; i++ ) - { - paletteData[i] = (0xff000000 | - (tempPalette[i*3+0] << 16) | - (tempPalette[i*3+1] << 8) | - (tempPalette[i*3+2])); - } - - delete [] tempPalette; - - file->seek(pos); - } - else if( header.BitsPerPixel == 4 ) - { - paletteData = new s32[16]; - for( s32 i=0; i<16; i++ ) - { - paletteData[i] = (0xff000000 | - (header.Palette[i*3+0] << 16) | - (header.Palette[i*3+1] << 8) | - (header.Palette[i*3+2])); - } - } - - // read image data - const s32 width = header.XMax - header.XMin + 1; - const s32 height = header.YMax - header.YMin + 1; - const s32 imagebytes = header.BytesPerLine * header.Planes * header.BitsPerPixel * height / 8; - u8* PCXData = new u8[imagebytes]; - - u8 cnt, value; - s32 lineoffset=0, linestart=0, nextmode=1; - for(s32 offset = 0; offset < imagebytes; offset += cnt) - { - file->read(&cnt, 1); - if( !((cnt & 0xc0) == 0xc0) ) - { - value = cnt; - cnt = 1; - } - else - { - cnt &= 0x3f; - file->read(&value, 1); - } - if (header.Planes==1) - memset(PCXData+offset, value, cnt); - else - { - for (u8 i=0; i<cnt; ++i) - { - PCXData[linestart+lineoffset]=value; - lineoffset += 3; - if (lineoffset>=3*header.BytesPerLine) - { - lineoffset=nextmode; - if (++nextmode==3) - nextmode=0; - if (lineoffset==0) - linestart += 3*header.BytesPerLine; - } - } - } - } - - // create image - video::IImage* image = 0; - s32 pad = (header.BytesPerLine - width * header.BitsPerPixel / 8) * header.Planes; - - if (pad < 0) - pad = -pad; - - if (header.BitsPerPixel==8) - { - switch(header.Planes) // TODO: Other formats - { - case 1: - image = new CImage(ECF_A1R5G5B5, core::dimension2d<u32>(width, height)); - if (image) - CColorConverter::convert8BitTo16Bit(PCXData, (s16*)image->getData(), width, height, paletteData, pad); - break; - case 3: - image = new CImage(ECF_R8G8B8, core::dimension2d<u32>(width, height)); - if (image) - CColorConverter::convert24BitTo24Bit(PCXData, (u8*)image->getData(), width, height, pad); - break; - } - } - else if (header.BitsPerPixel==4) - { - if (header.Planes==1) - { - image = new CImage(ECF_A1R5G5B5, core::dimension2d<u32>(width, height)); - if (image) - CColorConverter::convert4BitTo16Bit(PCXData, (s16*)image->getData(), width, height, paletteData, pad); - } - } - else if (header.BitsPerPixel==1) - { - if (header.Planes==4) - { - image = new CImage(ECF_A1R5G5B5, core::dimension2d<u32>(width, height)); - if (image) - CColorConverter::convert4BitTo16Bit(PCXData, (s16*)image->getData(), width, height, paletteData, pad); - } - else if (header.Planes==1) - { - image = new CImage(ECF_A1R5G5B5, core::dimension2d<u32>(width, height)); - if (image) - CColorConverter::convert1BitTo16Bit(PCXData, (s16*)image->getData(), width, height, pad); - } - } - - // clean up - - delete [] paletteData; - delete [] PCXData; - - return image; -} - - -//! creates a loader which is able to load pcx images -IImageLoader* createImageLoaderPCX() -{ - return new CImageLoaderPCX(); -} - - - -} // end namespace video -} // end namespace irr - -#endif - diff --git a/source/Irrlicht/CImageLoaderPCX.h b/source/Irrlicht/CImageLoaderPCX.h deleted file mode 100644 index 4809d7b7..00000000 --- a/source/Irrlicht/CImageLoaderPCX.h +++ /dev/null @@ -1,82 +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_IMAGE_LOADER_PCX_H_INCLUDED__ -#define __C_IMAGE_LOADER_PCX_H_INCLUDED__ - -#include "IrrCompileConfig.h" - -#include "IImageLoader.h" - -namespace irr -{ -namespace video -{ - -#if defined(_IRR_COMPILE_WITH_PCX_LOADER_) || defined(_IRR_COMPILE_WITH_PCX_WRITER_) - -// byte-align structures -#include "irrpack.h" - - struct SPCXHeader - { - u8 Manufacturer; - u8 Version; - u8 Encoding; - u8 BitsPerPixel; - u16 XMin; - u16 YMin; - u16 XMax; - u16 YMax; - u16 HorizDPI; - u16 VertDPI; - u8 Palette[48]; - u8 Reserved; - u8 Planes; - u16 BytesPerLine; - u16 PaletteType; - u16 HScrSize; - u16 VScrSize; - u8 Filler[54]; - } PACK_STRUCT; - - -// Default alignment -#include "irrunpack.h" - -#endif // compile with loader or writer - -#ifdef _IRR_COMPILE_WITH_PCX_LOADER_ - -/*! - Image Loader for Windows PCX bitmaps. - This loader was written and sent in by Dean P. Macri. I modified - only some small bits of it. -*/ -class CImageLoaderPCX : public IImageLoader -{ -public: - - //! constructor - CImageLoaderPCX(); - - //! returns true if the file maybe is able to be loaded by this class - //! based on the file extension (e.g. ".tga") - virtual bool isALoadableFileExtension(const io::path& filename) const _IRR_OVERRIDE_; - - //! returns true if the file maybe is able to be loaded by this class - virtual bool isALoadableFileFormat(io::IReadFile* file) const _IRR_OVERRIDE_; - - //! creates a surface from the file - virtual IImage* loadImage(io::IReadFile* file) const _IRR_OVERRIDE_; - -}; - -#endif // compile with loader - -} // end namespace video -} // end namespace irr - -#endif - diff --git a/source/Irrlicht/CImageLoaderPPM.cpp b/source/Irrlicht/CImageLoaderPPM.cpp deleted file mode 100644 index 7ebf6955..00000000 --- a/source/Irrlicht/CImageLoaderPPM.cpp +++ /dev/null @@ -1,274 +0,0 @@ -// Copyright (C) 2007-2012 Christian Stehno -// This file is part of the "Irrlicht Engine". -// For conditions of distribution and use, see copyright notice in irrlicht.h - -#include "CImageLoaderPPM.h" - -#ifdef _IRR_COMPILE_WITH_PPM_LOADER_ - -#include "IReadFile.h" -#include "CColorConverter.h" -#include "CImage.h" -#include "os.h" -#include "fast_atof.h" -#include "coreutil.h" - -namespace irr -{ -namespace video -{ - - -//! constructor -CImageLoaderPPM::CImageLoaderPPM() -{ - #ifdef _DEBUG - setDebugName("CImageLoaderPPM"); - #endif -} - - -//! returns true if the file maybe is able to be loaded by this class -//! based on the file extension (e.g. ".tga") -bool CImageLoaderPPM::isALoadableFileExtension(const io::path& filename) const -{ - return core::hasFileExtension ( filename, "ppm", "pgm", "pbm" ); -} - - -//! returns true if the file maybe is able to be loaded by this class -bool CImageLoaderPPM::isALoadableFileFormat(io::IReadFile* file) const -{ - c8 id[2]={0}; - file->read(&id, 2); - return (id[0]=='P' && id[1]>'0' && id[1]<'7'); -} - - -//! creates a surface from the file -IImage* CImageLoaderPPM::loadImage(io::IReadFile* file) const -{ - IImage* image; - - if (file->getSize() < 12) - return 0; - - c8 id[2]; - file->read(&id, 2); - - if (id[0]!='P' || id[1]<'1' || id[1]>'6') - return 0; - - const u8 format = id[1] - '0'; - const bool binary = format>3; - - core::stringc token; - getNextToken(file, token); - const u32 width = core::strtoul10(token.c_str()); - - getNextToken(file, token); - const u32 height = core::strtoul10(token.c_str()); - - u8* data = 0; - const u32 size = width*height; - if (format==1 || format==4) - { - skipToNextToken(file); // go to start of data - - const u32 bytesize = size/8+(size & 3)?1:0; - if (binary) - { - if (file->getSize()-file->getPos() < (long)bytesize) - return 0; - data = new u8[bytesize]; - file->read(data, bytesize); - } - else - { - if (file->getSize()-file->getPos() < (long)(2*size)) // optimistic test - return 0; - data = new u8[bytesize]; - memset(data, 0, bytesize); - u32 shift=0; - for (u32 i=0; i<size; ++i) - { - getNextToken(file, token); - if (token == "1") - data[i/8] |= (0x01 << shift); - if (++shift == 8) - shift=0; - } - } - image = new CImage(ECF_A1R5G5B5, core::dimension2d<u32>(width, height)); - if (image) - CColorConverter::convert1BitTo16Bit(data, (s16*)image->getData(), width, height); - } - else - { - getNextToken(file, token); - const u32 maxDepth = core::strtoul10(token.c_str()); - if (maxDepth > 255) // no double bytes yet - return 0; - - skipToNextToken(file); // go to start of data - - if (format==2 || format==5) - { - if (binary) - { - if (file->getSize()-file->getPos() < (long)size) - return 0; - data = new u8[size]; - file->read(data, size); - image = new CImage(ECF_A8R8G8B8, core::dimension2d<u32>(width, height)); - if (image) - { - u8* ptr = (u8*)image->getData(); - for (u32 i=0; i<size; ++i) - { - *ptr++ = data[i]; - *ptr++ = data[i]; - *ptr++ = data[i]; - *ptr++ = 255; - } - } - } - else - { - if (file->getSize()-file->getPos() < (long)(2*size)) // optimistic test - return 0; - image = new CImage(ECF_A8R8G8B8, core::dimension2d<u32>(width, height)); - if (image) - { - u8* ptr = (u8*)image->getData(); - for (u32 i=0; i<size; ++i) - { - getNextToken(file, token); - const u8 num = (u8)core::strtoul10(token.c_str()); - *ptr++ = num; - *ptr++ = num; - *ptr++ = num; - *ptr++ = 255; - } - } - } - } - else - { - const u32 bytesize = 3*size; - if (binary) - { - if (file->getSize()-file->getPos() < (long)bytesize) - return 0; - data = new u8[bytesize]; - file->read(data, bytesize); - image = new CImage(ECF_A8R8G8B8, core::dimension2d<u32>(width, height)); - if (image) - { - u8* ptr = (u8*)image->getData(); - for (u32 i=0; i<size; ++i) - { - *ptr++ = data[3*i]; - *ptr++ = data[3*i+1]; - *ptr++ = data[3*i+2]; - *ptr++ = 255; - } - } - } - else - { - if (file->getSize()-file->getPos() < (long)(2*bytesize)) // optimistic test - return 0; - image = new CImage(ECF_A8R8G8B8, core::dimension2d<u32>(width, height)); - if (image) - { - u8* ptr = (u8*)image->getData(); - for (u32 i=0; i<size; ++i) - { - getNextToken(file, token); - *ptr++ = (u8)core::strtoul10(token.c_str()); - getNextToken(file, token); - *ptr++ = (u8)core::strtoul10(token.c_str()); - getNextToken(file, token); - *ptr++ = (u8)core::strtoul10(token.c_str()); - *ptr++ = 255; - } - } - } - } - } - - delete [] data; - - return image; -} - - -//! read the next token from file -void CImageLoaderPPM::getNextToken(io::IReadFile* file, core::stringc& token) const -{ - token = ""; - c8 c; - while(file->getPos()<file->getSize()) - { - file->read(&c, 1); - if (c=='#') - { - while (c!='\n' && c!='\r' && (file->getPos()<file->getSize())) - file->read(&c, 1); - } - else if (!core::isspace(c)) - { - token.append(c); - break; - } - } - while(file->getPos()<file->getSize()) - { - file->read(&c, 1); - if (c=='#') - { - while (c!='\n' && c!='\r' && (file->getPos()<file->getSize())) - file->read(&c, 1); - } - else if (!core::isspace(c)) - token.append(c); - else - break; - } -} - - -//! skip to next token (skip whitespace) -void CImageLoaderPPM::skipToNextToken(io::IReadFile* file) const -{ - c8 c; - while(file->getPos()<file->getSize()) - { - file->read(&c, 1); - if (c=='#') - { - while (c!='\n' && c!='\r' && (file->getPos()<file->getSize())) - file->read(&c, 1); - } - else if (!core::isspace(c)) - { - file->seek(-1, true); // put back - break; - } - } -} - - -//! creates a loader which is able to load windows bitmaps -IImageLoader* createImageLoaderPPM() -{ - return new CImageLoaderPPM; -} - - -} // end namespace video -} // end namespace irr - -#endif - diff --git a/source/Irrlicht/CImageLoaderPPM.h b/source/Irrlicht/CImageLoaderPPM.h deleted file mode 100644 index 8fe1c603..00000000 --- a/source/Irrlicht/CImageLoaderPPM.h +++ /dev/null @@ -1,55 +0,0 @@ -// Copyright (C) 2007-2012 Christian Stehno -// This file is part of the "Irrlicht Engine". -// For conditions of distribution and use, see copyright notice in irrlicht.h - -#ifndef __C_IMAGE_LOADER_PPM_H_INCLUDED__ -#define __C_IMAGE_LOADER_PPM_H_INCLUDED__ - -#include "IrrCompileConfig.h" - -#ifdef _IRR_COMPILE_WITH_PPM_LOADER_ - -#include "IImageLoader.h" -#include "irrString.h" - - -namespace irr -{ -namespace video -{ - - -/*! - Surface Loader for SUN Pixmaps -*/ -class CImageLoaderPPM : public IImageLoader -{ -public: - - //! constructor - CImageLoaderPPM(); - - //! returns true if the file maybe is able to be loaded by this class - //! based on the file extension (e.g. ".tga") - virtual bool isALoadableFileExtension(const io::path& filename) const _IRR_OVERRIDE_; - - //! returns true if the file maybe is able to be loaded by this class - virtual bool isALoadableFileFormat(io::IReadFile* file) const _IRR_OVERRIDE_; - - //! creates a surface from the file - virtual IImage* loadImage(io::IReadFile* file) const _IRR_OVERRIDE_; - -private: - //! read the next token from file - void getNextToken(io::IReadFile* file, core::stringc& token) const; - //! skip to next token (skip whitespace) - void skipToNextToken(io::IReadFile* file) const; -}; - -} // end namespace video -} // end namespace irr - - -#endif -#endif - diff --git a/source/Irrlicht/CImageLoaderPSD.cpp b/source/Irrlicht/CImageLoaderPSD.cpp deleted file mode 100644 index 3eb5c3b8..00000000 --- a/source/Irrlicht/CImageLoaderPSD.cpp +++ /dev/null @@ -1,375 +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 "CImageLoaderPSD.h" - -#ifdef _IRR_COMPILE_WITH_PSD_LOADER_ - -#include "IReadFile.h" -#include "os.h" -#include "CImage.h" -#include "irrString.h" - - -namespace irr -{ -namespace video -{ - - -//! constructor -CImageLoaderPSD::CImageLoaderPSD() -{ - #ifdef _DEBUG - setDebugName("CImageLoaderPSD"); - #endif -} - - -//! returns true if the file maybe is able to be loaded by this class -//! based on the file extension (e.g. ".tga") -bool CImageLoaderPSD::isALoadableFileExtension(const io::path& filename) const -{ - return core::hasFileExtension ( filename, "psd" ); -} - - - -//! returns true if the file maybe is able to be loaded by this class -bool CImageLoaderPSD::isALoadableFileFormat(io::IReadFile* file) const -{ - if (!file) - return false; - - u8 type[3]; - file->read(&type, sizeof(u8)*3); - return (type[2]==2); // we currently only handle tgas of type 2. -} - - - -//! creates a surface from the file -IImage* CImageLoaderPSD::loadImage(io::IReadFile* file) const -{ - u32* imageData = 0; - - PsdHeader header; - file->read(&header, sizeof(PsdHeader)); - -#ifndef __BIG_ENDIAN__ - header.version = os::Byteswap::byteswap(header.version); - header.channels = os::Byteswap::byteswap(header.channels); - header.height = os::Byteswap::byteswap(header.height); - header.width = os::Byteswap::byteswap(header.width); - header.depth = os::Byteswap::byteswap(header.depth); - header.mode = os::Byteswap::byteswap(header.mode); -#endif - - if (header.signature[0] != '8' || - header.signature[1] != 'B' || - header.signature[2] != 'P' || - header.signature[3] != 'S') - return 0; - - if (header.version != 1) - { - os::Printer::log("Unsupported PSD file version", file->getFileName(), ELL_ERROR); - return 0; - } - - if (header.mode != 3 || header.depth != 8) - { - os::Printer::log("Unsupported PSD color mode or depth.\n", file->getFileName(), ELL_ERROR); - return 0; - } - - // skip color mode data - - u32 l; - file->read(&l, sizeof(u32)); -#ifndef __BIG_ENDIAN__ - l = os::Byteswap::byteswap(l); -#endif - if (!file->seek(l, true)) - { - os::Printer::log("Error seeking file pos to image resources.\n", file->getFileName(), ELL_ERROR); - return 0; - } - - // skip image resources - - file->read(&l, sizeof(u32)); -#ifndef __BIG_ENDIAN__ - l = os::Byteswap::byteswap(l); -#endif - if (!file->seek(l, true)) - { - os::Printer::log("Error seeking file pos to layer and mask.\n", file->getFileName(), ELL_ERROR); - return 0; - } - - // skip layer & mask - - file->read(&l, sizeof(u32)); -#ifndef __BIG_ENDIAN__ - l = os::Byteswap::byteswap(l); -#endif - if (!file->seek(l, true)) - { - os::Printer::log("Error seeking file pos to image data section.\n", file->getFileName(), ELL_ERROR); - return 0; - } - - // read image data - - u16 compressionType; - file->read(&compressionType, sizeof(u16)); -#ifndef __BIG_ENDIAN__ - compressionType = os::Byteswap::byteswap(compressionType); -#endif - - if (compressionType != 1 && compressionType != 0) - { - os::Printer::log("Unsupported psd compression mode.\n", file->getFileName(), ELL_ERROR); - return 0; - } - - // create image data block - - imageData = new u32[header.width * header.height]; - - bool res = false; - - if (compressionType == 0) - res = readRawImageData(file, header, imageData); // RAW image data - else - res = readRLEImageData(file, header, imageData); // RLE compressed data - - video::IImage* image = 0; - - if (res) - { - // create surface - image = new CImage(ECF_A8R8G8B8, - core::dimension2d<u32>(header.width, header.height), imageData); - } - - if (!image) - delete [] imageData; - imageData = 0; - - return image; -} - - -bool CImageLoaderPSD::readRawImageData(io::IReadFile* file, const PsdHeader& header, u32* imageData) const -{ - u8* tmpData = new u8[header.width * header.height]; - - for (s32 channel=0; channel<header.channels && channel < 3; ++channel) - { - if (!file->read(tmpData, sizeof(c8) * header.width * header.height)) - { - os::Printer::log("Error reading color channel\n", file->getFileName(), ELL_ERROR); - break; - } - - s16 shift = getShiftFromChannel((c8)channel, header); - if (shift != -1) - { - u32 mask = 0xff << shift; - - for (u32 x=0; x<header.width; ++x) - { - for (u32 y=0; y<header.height; ++y) - { - s32 index = x + y*header.width; - imageData[index] = ~(~imageData[index] | mask); - imageData[index] |= tmpData[index] << shift; - } - } - } - - } - - delete [] tmpData; - return true; -} - - -bool CImageLoaderPSD::readRLEImageData(io::IReadFile* file, const PsdHeader& header, u32* imageData) const -{ - /* If the compression code is 1, the image data - starts with the byte counts for all the scan lines in the channel - (LayerBottom LayerTop), with each count stored as a two - byte value. The RLE compressed data follows, with each scan line - compressed separately. The RLE compression is the same compres-sion - algorithm used by the Macintosh ROM routine PackBits, and - the TIFF standard. - If the Layer's Size, and therefore the data, is odd, a pad byte will - be inserted at the end of the row. - */ - - /* - A pseudo code fragment to unpack might look like this: - - Loop until you get the number of unpacked bytes you are expecting: - Read the next source byte into n. - If n is between 0 and 127 inclusive, copy the next n+1 bytes literally. - Else if n is between -127 and -1 inclusive, copy the next byte -n+1 - times. - Else if n is -128, noop. - Endloop - - In the inverse routine, it is best to encode a 2-byte repeat run as a replicate run - except when preceded and followed by a literal run. In that case, it is best to merge - the three runs into one literal run. Always encode 3-byte repeats as replicate runs. - That is the essence of the algorithm. Here are some additional rules: - - Pack each row separately. Do not compress across row boundaries. - - The number of uncompressed bytes per row is defined to be (ImageWidth + 7) - / 8. If the uncompressed bitmap is required to have an even number of bytes per - row, decompress into word-aligned buffers. - - If a run is larger than 128 bytes, encode the remainder of the run as one or more - additional replicate runs. - When PackBits data is decompressed, the result should be interpreted as per com-pression - type 1 (no compression). - */ - - u8* tmpData = new u8[header.width * header.height]; - u16 *rleCount= new u16 [header.height * header.channels]; - - s32 size=0; - - for (u32 y=0; y<header.height * header.channels; ++y) - { - if (!file->read(&rleCount[y], sizeof(u16))) - { - delete [] tmpData; - delete [] rleCount; - os::Printer::log("Error reading rle rows\n", file->getFileName(), ELL_ERROR); - return false; - } - -#ifndef __BIG_ENDIAN__ - rleCount[y] = os::Byteswap::byteswap(rleCount[y]); -#endif - size += rleCount[y]; - } - - s8 *buf = new s8[size]; - if (!file->read(buf, size)) - { - delete [] rleCount; - delete [] buf; - delete [] tmpData; - os::Printer::log("Error reading rle rows\n", file->getFileName(), ELL_ERROR); - return false; - } - - u16 *rcount=rleCount; - - s8 rh; - u16 bytesRead; - u8 *dest; - s8 *pBuf = buf; - - // decompress packbit rle - - for (s32 channel=0; channel<header.channels; channel++) - { - for (u32 y=0; y<header.height; ++y, ++rcount) - { - bytesRead=0; - dest = &tmpData[y*header.width]; - - while (bytesRead < *rcount) - { - rh = *pBuf++; - ++bytesRead; - - if (rh >= 0) - { - ++rh; - - while (rh--) - { - *dest = *pBuf++; - ++bytesRead; - ++dest; - } - } - else - if (rh > -128) - { - rh = -rh +1; - - while (rh--) - { - *dest = *pBuf; - ++dest; - } - - ++pBuf; - ++bytesRead; - } - } - } - - s16 shift = getShiftFromChannel((c8)channel, header); - - if (shift != -1) - { - u32 mask = 0xff << shift; - - for (u32 x=0; x<header.width; ++x) - for (u32 y=0; y<header.height; ++y) - { - s32 index = x + y*header.width; - imageData[index] = ~(~imageData[index] | mask); - imageData[index] |= tmpData[index] << shift; - } - } - } - - delete [] rleCount; - delete [] buf; - delete [] tmpData; - - return true; -} - - -s16 CImageLoaderPSD::getShiftFromChannel(c8 channelNr, const PsdHeader& header) const -{ - switch(channelNr) - { - case 0: - return 16; // red - case 1: - return 8; // green - case 2: - return 0; // blue - case 3: - return header.channels == 4 ? 24 : -1; // ? - case 4: - return 24; // alpha - default: - return -1; - } -} - - - -//! creates a loader which is able to load tgas -IImageLoader* createImageLoaderPSD() -{ - return new CImageLoaderPSD(); -} - - -} // end namespace video -} // end namespace irr - -#endif - diff --git a/source/Irrlicht/CImageLoaderPSD.h b/source/Irrlicht/CImageLoaderPSD.h deleted file mode 100644 index 7e2c0c90..00000000 --- a/source/Irrlicht/CImageLoaderPSD.h +++ /dev/null @@ -1,72 +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_IMAGE_LOADER_PSD_H_INCLUDED__ -#define __C_IMAGE_LOADER_PSD_H_INCLUDED__ - -#include "IrrCompileConfig.h" - -#ifdef _IRR_COMPILE_WITH_PSD_LOADER_ - -#include "IImageLoader.h" - -namespace irr -{ -namespace video -{ - - -// byte-align structures -#include "irrpack.h" - - struct PsdHeader - { - c8 signature [4]; // Always equal to 8BPS. - u16 version; // Always equal to 1 - c8 reserved [6]; // Must be zero - u16 channels; // Number of any channels inc. alphas - u32 height; // Rows Height of image in pixel - u32 width; // Colums Width of image in pixel - u16 depth; // Bits/channel - u16 mode; // Color mode of the file (Bitmap/Grayscale..) - } PACK_STRUCT; - - -// Default alignment -#include "irrunpack.h" - -/*! - Surface Loader for psd images -*/ -class CImageLoaderPSD : public IImageLoader -{ -public: - - //! constructor - CImageLoaderPSD(); - - //! returns true if the file maybe is able to be loaded by this class - //! based on the file extension (e.g. ".tga") - virtual bool isALoadableFileExtension(const io::path& filename) const _IRR_OVERRIDE_; - - //! returns true if the file maybe is able to be loaded by this class - virtual bool isALoadableFileFormat(io::IReadFile* file) const _IRR_OVERRIDE_; - - //! creates a surface from the file - virtual IImage* loadImage(io::IReadFile* file) const _IRR_OVERRIDE_; - -private: - - bool readRawImageData(io::IReadFile* file, const PsdHeader& header, u32* imageData) const; - bool readRLEImageData(io::IReadFile* file, const PsdHeader& header, u32* imageData) const; - s16 getShiftFromChannel(c8 channelNr, const PsdHeader& header) const; -}; - - -} // end namespace video -} // end namespace irr - -#endif -#endif - diff --git a/source/Irrlicht/CImageLoaderPVR.cpp b/source/Irrlicht/CImageLoaderPVR.cpp deleted file mode 100644 index 0da9300e..00000000 --- a/source/Irrlicht/CImageLoaderPVR.cpp +++ /dev/null @@ -1,266 +0,0 @@ -// Copyright (C) 2013-2016 Patryk Nadrowski -// This file is part of the "Irrlicht Engine". -// For conditions of distribution and use, see copyright notice in irrlicht.h - -#include "CImageLoaderPVR.h" - -#ifdef _IRR_COMPILE_WITH_PVR_LOADER_ - -#include "IReadFile.h" -#include "os.h" -#include "CImage.h" -#include "irrString.h" - -namespace irr -{ -namespace video -{ - -bool CImageLoaderPVR::isALoadableFileExtension(const io::path& filename) const -{ - return core::hasFileExtension(filename, "pvr"); -} - -bool CImageLoaderPVR::isALoadableFileFormat(io::IReadFile* file) const -{ - if (!file) - return false; - - c8 fourCC[4]; - file->seek(0); - file->read(&fourCC, 4); - - /*if (header.Version == 0x03525650) // TO-DO - fix endiannes - { - fourCC[0] = os::Byteswap::byteswap(fourCC[0]); - fourCC[1] = os::Byteswap::byteswap(fourCC[1]); - fourCC[2] = os::Byteswap::byteswap(fourCC[2]); - fourCC[3] = os::Byteswap::byteswap(fourCC[3]); - }*/ - - return (fourCC[0] == 'P' && fourCC[1] == 'V' && fourCC[2] == 'R'); -} - -IImage* CImageLoaderPVR::loadImage(io::IReadFile* file) const -{ - core::array<IImage*> imageArray = loadImages(file, 0); - - const u32 imageCount = imageArray.size(); - - for (u32 i = 1; i < imageCount; ++i) - { - if (imageArray[i]) - imageArray[i]->drop(); - } - - if (imageCount > 1) - imageArray.erase(1, imageCount - 1); - - return (imageCount > 1) ? imageArray[0] : 0; -} - -core::array<IImage*> CImageLoaderPVR::loadImages(io::IReadFile* file, E_TEXTURE_TYPE* type) const -{ - // TO-DO -> use 'move' feature from C++11 standard. - - SPVRHeader header; - - core::array<IImage*> imageArray; - core::array<u8*> mipMapsDataArray; - - ECOLOR_FORMAT format = ECF_UNKNOWN; - u32 dataSize = 0; - - file->seek(0); - file->read(&header, sizeof(SPVRHeader)); - - /*if (header.Version == 0x03525650) // TO-DO - fix endiannes - { - header.Flags = os::Byteswap::byteswap(header.Flags); - header.PixelFormat = os::Byteswap::byteswap(header.PixelFormat); - header.ColourSpace = os::Byteswap::byteswap(header.ColourSpace); - header.ChannelType = os::Byteswap::byteswap(header.ChannelType); - header.Height = os::Byteswap::byteswap(header.Height); - header.Width = os::Byteswap::byteswap(header.Width); - header.Depth = os::Byteswap::byteswap(header.Depth); - header.NumSurfaces = os::Byteswap::byteswap(header.NumSurfaces); - header.NumFaces = os::Byteswap::byteswap(header.NumFaces); - header.MipMapCount = os::Byteswap::byteswap(header.MipMapCount); - header.MetDataSize = os::Byteswap::byteswap(header.MetDataSize); - }*/ - - c8 fourCC[4]; - u32 key; - u32 helperDataSize; - - if (header.MetDataSize > 0) - { - file->read(&fourCC, 4); - file->read(&key, sizeof(u32)); - file->read(&helperDataSize, sizeof(u32)); - file->seek(helperDataSize, true); - } - - if (header.PixelFormat & 0xFFFFFFFF00000000) - { - switch (header.PixelFormat) - { - case 0x505050162677261: - format = ECF_A1R5G5B5; - break; - case 0x5060500626772: - format = ECF_R5G6B5; - break; - case 0x8080800626772: - format = ECF_R8G8B8; - break; - case 0x808080861726762: - format = ECF_A8R8G8B8; - break; - default: - break; - } - } - else // Compressed texture formats - { - switch (header.PixelFormat) - { - case 0: // PVRTC 2bpp RGB - format = ECF_PVRTC_RGB2; - break; - case 1: // PVRTC 2bpp RGBA - format = ECF_PVRTC_ARGB2; - break; - case 2: // PVRTC 4bpp RGB - format = ECF_PVRTC_RGB4; - break; - case 3: // PVRTC 4bpp RGBA - format = ECF_PVRTC_ARGB4; - break; - case 4: // PVRTC-II 2bpp - format = ECF_PVRTC2_ARGB2; - break; - case 5: // PVRTC-II 4bpp - format = ECF_PVRTC2_ARGB4; - break; - case 6: // ETC1 - format = ECF_ETC1; - break; - case 7: // DXT1 / BC1 - format = ECF_DXT1; - break; - case 8: // DXT2 - case 9: // DXT3 / BC2 - format = ECF_DXT3; - break; - case 10: // DXT4 - case 11: // DXT5 / BC3 - format = ECF_DXT5; - break; - case 22: // ETC2 RGB - format = ECF_ETC2_RGB; - break; - case 23: // ETC2 RGBA - format = ECF_ETC2_ARGB; - break; - default: - format = ECF_UNKNOWN; - break; - } - } - - if (format != ECF_UNKNOWN) - { - imageArray.set_used(1); - E_TEXTURE_TYPE tmpType = ETT_2D; - - // check for texture type - - if (header.NumFaces == 6) // cube map - { - imageArray.set_used(6); - tmpType = ETT_CUBEMAP; - } - else if (header.Depth > 1) // 3d texture - { - // TO-DO - } - else if (header.NumSurfaces > 1) // texture array - { - // To-DO - } - - if (type) - *type = tmpType; - - // prepare mipmaps data - - dataSize = 0; - - for (u32 i = 1; i < header.MipMapCount; ++i) - { - u32 tmpWidth = header.Width >> i; - u32 tmpHeight = header.Height >> i; - - dataSize += IImage::getDataSizeFromFormat(format, tmpWidth, tmpHeight); - } - - if (header.MipMapCount > 1) - { - mipMapsDataArray.set_used(imageArray.size()); - - for (u32 j = 0; j < mipMapsDataArray.size(); ++j) - mipMapsDataArray[j] = new u8[dataSize]; - } - - // read texture - - dataSize = 0; - long offset = 0; - - for (u32 i = 0; i < header.MipMapCount; ++i) - { - if (i == 0) - { - for (u32 j = 0; j < imageArray.size(); ++j) - { - dataSize = IImage::getDataSizeFromFormat(format, header.Width, header.Height); - - u8* data = new u8[dataSize]; - file->read(data, dataSize); - - imageArray[j] = new CImage(format, core::dimension2d<u32>(header.Width, header.Height), data, true, true); - } - } - else - { - u32 tmpWidth = header.Width >> i; - u32 tmpHeight = header.Height >> i; - - dataSize = IImage::getDataSizeFromFormat(format, tmpWidth, tmpHeight); - - for (u32 j = 0; j < imageArray.size(); ++j) - file->read(mipMapsDataArray[j] + offset, dataSize); - - offset += dataSize; - } - } - - // assign mipmaps data - - for (u32 i = 0; i < mipMapsDataArray.size(); ++i) - imageArray[i]->setMipMapsData(mipMapsDataArray[i], true, true); - } - - return imageArray; -} - -IImageLoader* createImageLoaderPVR() -{ - return new CImageLoaderPVR(); -} - -} -} - -#endif diff --git a/source/Irrlicht/CImageLoaderPVR.h b/source/Irrlicht/CImageLoaderPVR.h deleted file mode 100644 index 4a4cfee3..00000000 --- a/source/Irrlicht/CImageLoaderPVR.h +++ /dev/null @@ -1,55 +0,0 @@ -// Copyright (C) 2013-2016 Patryk Nadrowski -// This file is part of the "Irrlicht Engine". -// For conditions of distribution and use, see copyright notice in irrlicht.h - -#ifndef __C_IMAGE_LOADER_PVR_H_INCLUDED__ -#define __C_IMAGE_LOADER_PVR_H_INCLUDED__ - -#include "IrrCompileConfig.h" - -#ifdef _IRR_COMPILE_WITH_PVR_LOADER_ - -#include "IImageLoader.h" - -namespace irr -{ -namespace video -{ - -#include "irrpack.h" - -struct SPVRHeader -{ - u32 Version; - u32 Flags; - u64 PixelFormat; - u32 ColourSpace; - u32 ChannelType; - u32 Height; - u32 Width; - u32 Depth; - u32 NumSurfaces; - u32 NumFaces; - u32 MipMapCount; - u32 MetDataSize; -} PACK_STRUCT; - -#include "irrunpack.h" - -class CImageLoaderPVR : public IImageLoader -{ -public: - virtual bool isALoadableFileExtension(const io::path& filename) const _IRR_OVERRIDE_; - - virtual bool isALoadableFileFormat(io::IReadFile* file) const _IRR_OVERRIDE_; - - virtual IImage* loadImage(io::IReadFile* file) const _IRR_OVERRIDE_; - - virtual core::array<IImage*> loadImages(io::IReadFile* file, E_TEXTURE_TYPE* type) const _IRR_OVERRIDE_; -}; - -} -} - -#endif -#endif diff --git a/source/Irrlicht/CImageLoaderRGB.cpp b/source/Irrlicht/CImageLoaderRGB.cpp deleted file mode 100644 index dfb4b8b0..00000000 --- a/source/Irrlicht/CImageLoaderRGB.cpp +++ /dev/null @@ -1,651 +0,0 @@ -//! Copyright (C) 2009-2012 Gary Conway -//! This file is part of the "Irrlicht Engine". -//! For conditions of distribution and use, see copyright notice in irrlicht.h - -/* - Author: Gary Conway (Viper) - co-author of the ZIP file format, Feb 1989, - see the story at http://www.idcnet.us/ziphistory.html - Website: http://idcnet.us - Email: codeslinger@vipergc.com - Created: March 1, 2009 - Version: 1.0 - Updated: - - This module will load SGI .rgb files (along with the other extensions). The module complies - with version 1.0 of the SGI Image File Format by Paul Haeberli of Silicon Graphics Computer Systems - The module handles BW, RGB and RGBA images. - - RGB images are stored with either 8 bits per COLOR VALUE, one each for red,green,blue (24bpp) - or 16 bits per COLOR VALUE, again one each for red,green,blue (48 bpp), not including the alpha channel - - - OPTIONS NOT SUPPORTED - - 1. 16 bit COLOR VALUES (48bpp modes) - 2. COLORMAP = DITHERED mode - - - -For non- run length encoded files, this is the structure - - The Header - The Image Data - -If the image is run length encoded, this is the structure: - The Header - The Offset Tables - The Image Data - -The Header consists of the following: - - Size | Type | Name | Description - - 2 bytes | short | MAGIC | IRIS image file magic number - 1 byte | char | STORAGE | Storage format - 1 byte | char | BPC | Number of bytes per pixel channel - 2 bytes | ushort | DIMENSION | Number of dimensions - 2 bytes | ushort | XSIZE | X size in pixels - 2 bytes | ushort | YSIZE | Y size in pixels - 2 bytes | ushort | ZSIZE | Number of channels - 4 bytes | long | PIXMIN | Minimum pixel value - 4 bytes | long | PIXMAX | Maximum pixel value - 4 bytes | char | DUMMY | Ignored - 80 bytes | char | IMAGENAME | Image name - 4 bytes | long | COLORMAP | Colormap ID - 404 bytes | char | DUMMY | Ignored - -Here is a description of each field in the image file Header: - -MAGIC - This is the decimal value 474 saved as a short. This identifies the file as an SGI image file. - -STORAGE - specifies whether the image is stored using run length encoding (RLE) or not (VERBATIM). - If RLE is used, the value of this byte will be 1. Otherwise the value of this byte will - be 0. The only allowed values for this field are 0 or 1. - -BPC - describes the precision that is used to store each channel of an image. This is the number of - bytes per pixel component. The majority of SGI image files use 1 byte per pixel component, - giving 256 levels. Some SGI image files use 2 bytes per component. The only allowed values - for this field are 1 or 2. - -DIMENSION - described the number of dimensions in the data stored in the image file. - The only allowed values are 1, 2, or 3. If this value is 1, the image file - consists of only 1 channel and only 1 scanline (row). The length of this - scanline is given by the value of XSIZE below. If this value is 2, the file - consists of a single channel with a number of scanlines. The width and height - of the image are given by the values of XSIZE and YSIZE below. - If this value is 3, the file consists of a number of channels. - The width and height of the image are given by the values of XSIZE and YSIZE below. - The number of channels is given by the value of ZSIZE below. - -XSIZE - The width of the image in pixels - -YSIZE - The height of the image in pixels - -ZSIZE - The number of channels in the image. B/W (greyscale) images are stored as 2 dimensional - images with a ZSIZE of 1. RGB color images are stored as 3 dimensional images with a - ZSIZE of 3. An RGB image with an ALPHA channel is stored as a 3 dimensional image with - a ZSIZE of 4. There are no inherent limitations in the SGI image file format that would - preclude the creation of image files with more than 4 channels. - -PINMIN - The minimum pixel value in the image. The value of 0 may be used if no pixel has a value - that is smaller than 0. - -PINMAX - The maximum pixel value in the image. The value of 255 may be used if no pixel has a - value that is greater than 255. This is the value that is considered to be full - brightness in the image. - -DUMMY - This 4 bytes of data should be set to 0. - -IMAGENAME - An null terminated ascii string of up to 79 characters terminated by a null may be - included here. This is not commonly used. - -COLORMAP - This controls how the pixel values in the file should be interpreted. It can have one - of these four values: - -0: NORMAL - The data in the channels represent B/W values for images with 1 channel, RGB values - for images with 3 channels, and RGBA values for images with 4 channels. Almost all - the SGI image files are of this type. - -1: DITHERED - The image will have only 1 channel of data. For each pixel, RGB data is packed - into one 8 bit value. 3 bits are used for red and green, while blue uses 2 bits. - Red data is found in bits[2..0], green data in bits[5..3], and blue data in - bits[7..6]. This format is obsolete. - -2: SCREEN - The image will have only 1 channel of data. This format was used to store - color-indexed pixels. To convert the pixel values into RGB values a colormap - must be used. The appropriate color map varies from image to image. This format is obsolete. - -3: COLORMAP - The image is used to store a color map from an SGI machine. In this case the - image is not displayable in the conventional sense. - -DUMMY - This 404 bytes of data should be set to 0. This makes the Header exactly 512 bytes. -*/ - -#include "CImageLoaderRGB.h" - -#ifdef _IRR_COMPILE_WITH_RGB_LOADER_ - -#include "IReadFile.h" -#include "SColor.h" -#include "CColorConverter.h" -#include "CImage.h" -#include "os.h" -#include "irrString.h" - - -namespace irr -{ -namespace video -{ - -//! constructor -CImageLoaderRGB::CImageLoaderRGB() -{ - #ifdef _DEBUG - setDebugName("CImageLoaderRGB"); - #endif -} - - -//! returns true if the file maybe is able to be loaded by this class -//! based on the file extensions listed here -bool CImageLoaderRGB::isALoadableFileExtension(const io::path& filename) const -{ - return core::hasFileExtension( filename, "rgb", "rgba", "sgi" ) || - core::hasFileExtension( filename, "int", "inta", "bw" ); -} - - -//! returns true if the file maybe is able to be loaded by this class -bool CImageLoaderRGB::isALoadableFileFormat(io::IReadFile* file) const -{ - rgbStruct rgb; - return checkFormat(file, rgb); -} - - -/** The main entry point, read and format the image file. -\return Pointer to the image data on success - null pointer on fail */ -IImage* CImageLoaderRGB::loadImage(io::IReadFile* file) const -{ - IImage* image = 0; - s32* paletteData = 0; - - rgbStruct rgb; // construct our structure for holding data - - // read Header information - if (checkFormat(file, rgb)) - { - // 16 bits per COLOR VALUE, not supported, this is 48bpp mode - if (rgb.Header.BPC != 1) - { - os::Printer::log("Only one byte per pixel RGB files are supported", file->getFileName(), ELL_ERROR); - } - else if (rgb.Header.Colormap != 0) - { - os::Printer::log("Dithered, Screen and Colormap RGB files are not supported", file->getFileName(), ELL_ERROR); - } - else if (rgb.Header.Storage == 1 && !readOffsetTables(file, rgb)) - { - os::Printer::log("Failed to read RLE table in RGB file", file->getFileName(), ELL_ERROR); - } - else if (!rgb.allocateTemps()) - { - os::Printer::log("Out of memory in RGB file loader", file->getFileName(), ELL_ERROR); - } - else - { - // read and process the file to rgbData - processFile(file, rgb); - -/* - ZSIZE Description - 1 BW (grayscale) image - 3 RGB image - 4 RGBa image with one alpha channel - - When the Alpha channel is present, I am not sure with RGB files if - it's a precomputed RGB color or it needs to be completely calculated. My guess - would be that it's not precomputed for two reasons. - - 1. the loss of precision when calculating the fraction, then storing the result as an int - 2. the loss of the original color data when the image might be composited with another. Yes - the original color data could be computed, however, not without another loss in precision - - Also, I don't know where to find the background color - Pixmin and Pixmax are apparently the min and max alpha blend values (0-100%) - - Complete Alpha blending computation - The actual resulting merged color is computed this way: - (image color â—Š alpha) + (background color â—Š (100% - alpha)). - - Using precomputed blending - (image color) + (background color â—Š (100% - alpha)). - - Alternatively, the RGB files could use another blending technique entirely -*/ - - switch (rgb.Header.Zsize) - { - case 1: - // BW (grayscale) image - paletteData = new s32[256]; - for (int n=0; n<256; n++) - paletteData[n] = n; - - image = new CImage(ECF_A1R5G5B5, core::dimension2d<u32>(rgb.Header.Xsize, rgb.Header.Ysize)); - if (image) - CColorConverter::convert8BitTo16Bit(rgb.rgbData, (s16*)image->getData(), rgb.Header.Xsize, rgb.Header.Ysize, paletteData, 0, true); - break; - case 3: - // RGB image - // one byte per COLOR VALUE, eg, 24bpp - image = new CImage(ECF_R8G8B8, core::dimension2d<u32>(rgb.Header.Xsize, rgb.Header.Ysize)); - if (image) - CColorConverter::convert24BitTo24Bit(rgb.rgbData, (u8*)image->getData(), rgb.Header.Xsize, rgb.Header.Ysize, 0, true, false); - break; - case 4: - // RGBa image with one alpha channel (32bpp) - // image is stored in rgbData as RGBA - - converttoARGB(reinterpret_cast<u32*>(rgb.rgbData), rgb.Header.Ysize * rgb.Header.Xsize); - - image = new CImage(ECF_A8R8G8B8, core::dimension2d<u32>(rgb.Header.Xsize, rgb.Header.Ysize)); - if (image) - CColorConverter::convert32BitTo32Bit((s32*)rgb.rgbData, (s32*)image->getData(), rgb.Header.Xsize, rgb.Header.Ysize, 0, true); - - break; - default: - // Format unknown - os::Printer::log("Unsupported pixel format in RGB file", file->getFileName(), ELL_ERROR); - } - } - } - - // and tidy up allocated memory - delete [] paletteData; - - return image; -} - -// returns true on success -bool CImageLoaderRGB::readHeader(io::IReadFile* file, rgbStruct& rgb) const -{ - if ( file->read(&rgb.Header, sizeof(rgb.Header)) < s32(sizeof(rgb.Header)) ) - return false; - - // test for INTEL or BIG ENDIAN processor - // if INTEL, then swap the byte order on 16 bit INT's to make them BIG ENDIAN - // because that is the native format for the .rgb file -#ifndef __BIG_ENDIAN__ - rgb.Header.Magic = os::Byteswap::byteswap(rgb.Header.Magic); - rgb.Header.Storage = os::Byteswap::byteswap(rgb.Header.Storage); - rgb.Header.Dimension = os::Byteswap::byteswap(rgb.Header.Dimension); - rgb.Header.Xsize = os::Byteswap::byteswap(rgb.Header.Xsize); - rgb.Header.Ysize = os::Byteswap::byteswap(rgb.Header.Ysize); - rgb.Header.Zsize = os::Byteswap::byteswap(rgb.Header.Zsize); - rgb.Header.Pixmin = os::Byteswap::byteswap(rgb.Header.Pixmin); - rgb.Header.Pixmax = os::Byteswap::byteswap(rgb.Header.Pixmax); - rgb.Header.Colormap = os::Byteswap::byteswap(rgb.Header.Colormap); -#endif - - // calculate the size of the buffer needed: XSIZE * YSIZE * ZSIZE * BPC - rgb.ImageSize = (rgb.Header.Xsize)*(rgb.Header.Ysize)*(rgb.Header.Zsize)*(rgb.Header.BPC); - - return true; -} - - -bool CImageLoaderRGB::checkFormat(io::IReadFile* file, rgbStruct& rgb) const -{ - if (!readHeader(file, rgb)) - return false; - - return (rgb.Header.Magic == 0x1DA); -} - -/* -If the image is stored using run length encoding, offset tables follow the Header that -describe what the file offsets are to the RLE for each scanline. This information only -applies if the value for STORAGE above is 1. - - Size | Type | Name | Description - - tablen longs | long | STARTTAB | Start table - tablen longs | long | LENGTHTAB | Length table - -One entry in each table is needed for each scanline of RLE data. The total number of scanlines in the image (tablen) is determined by the product of the YSIZE and ZSIZE. There are two tables of longs that are written. Each consists of tablen longs of data. The first table has the file offsets to the RLE data for each scanline in the image. In a file with more than 1 channel (ZSIZE > 1) this table first has all the offsets for the scanlines in the first channel, followed be offsets for the scanlines in the second channel, etc. The second table has the RLE data length for each scanline in the image. In a file with more than 1 channel (ZSIZE > 1) this table first has all the RLE data lengths for the scanlines in the first channel, followed be RLE data lengths for the scanlines in the second channel, etc. - -To find the the file offset, and the number of bytes in the RLE data for a particular scanline, these -two arrays may be read in and indexed as follows: - -To read in the tables: - - unsigned long *starttab, *lengthtab; - - tablen = YSIZE*ZSIZE*sizeof(long); - starttab = (unsigned long *)mymalloc(tablen); - lengthtab = (unsigned long *)mymalloc(tablen); - fseek(rgb->inf,512,SEEK_SET); - readlongtab(rgb->inf,starttab); - readlongtab(rgb->inf,lengthtab); - -To find the file offset and RLE data length for a scanline: - -rowno is an integer in the range 0 to YSIZE-1 channo is an integer in the range 0 to ZSIZE-1 - - rleoffset = starttab[rowno+channo*YSIZE] - rlelength = lengthtab[rowno+channo*YSIZE] - -It is possible for two identical rows (scanlines) to share compressed data. A completely -white image could be written as a single compressed row and having all table entries point -to that row. Another little hack that should work is if you are writing out a RGB RLE file, -and a particular scanline is achromatic (greyscale), you could just make the r, g and b rows -point to the same data!! - - RETURNS: on success true, else returns false -*/ - -bool CImageLoaderRGB::readOffsetTables(io::IReadFile* file, rgbStruct& rgb) const -{ - rgb.TableLen = rgb.Header.Ysize * rgb.Header.Zsize ; // calc size of tables - - // return error if unable to allocate tables - rgb.StartTable = new u32[rgb.TableLen]; - if (!rgb.StartTable) - return false; - rgb.LengthTable = new u32[rgb.TableLen]; - if (!rgb.LengthTable) - return false; - - file->seek(512); - file->read(rgb.StartTable, rgb.TableLen* sizeof(u32)); - file->read(rgb.LengthTable, rgb.TableLen* sizeof(u32)); - - // if we are on an INTEL platform, swap the bytes -#ifndef __BIG_ENDIAN__ - const u32 length = rgb.TableLen; - for (u32 i=0; i<length; ++i) - { - rgb.StartTable[i] = os::Byteswap::byteswap(rgb.StartTable[i]); - rgb.LengthTable[i] = os::Byteswap::byteswap(rgb.LengthTable[i]); - } -#endif - - return true; -} - - -/* - The Header has already been read into rgb structure - The Tables have been read if necessary - Now process the actual data -*/ -void CImageLoaderRGB::processFile(io::IReadFile* file, rgbStruct& rgb) const -{ - u16 *tempShort; - - // calculate the size of the buffer needed: XSIZE * YSIZE * ZSIZE * BPC - rgb.rgbData = new u8 [(rgb.Header.Xsize)*(rgb.Header.Ysize)*(rgb.Header.Zsize)*(rgb.Header.BPC)]; - u8 *ptr = rgb.rgbData; - - // cycle through all scanlines - -#ifdef _IRR_RGB_FILE_INVERTED_IMAGE_ - // preserve the image as stored, eg, inverted - for (u16 i = 0; i < rgb.Header.Ysize; ++i) -#else - // invert the image to make it upright - for (s32 i = (s32)(rgb.Header.Ysize)-1; i>=0; --i) -#endif - { - // check the number of channels and read a row of data - if (rgb.Header.Zsize >= 1) - readRGBrow( rgb.tmpR, i, 0, file, rgb); - if (rgb.Header.Zsize >= 2) - readRGBrow( rgb.tmpG, i, 1, file, rgb); - if (rgb.Header.Zsize >= 3) - readRGBrow( rgb.tmpB, i, 2, file, rgb); - if (rgb.Header.Zsize >= 4) - readRGBrow( rgb.tmpA, i, 3, file, rgb); - - // cycle thru all values for this row - for (u16 j = 0; j < rgb.Header.Xsize; ++j) - { - if(rgb.Header.BPC == 1) - { - // ONE byte per color - if (rgb.Header.Zsize >= 1) - *ptr++ = rgb.tmpR[j]; - if (rgb.Header.Zsize >= 2) - *ptr++ = rgb.tmpG[j]; - if (rgb.Header.Zsize >= 3) - *ptr++ = rgb.tmpB[j]; - if (rgb.Header.Zsize >= 4) - *ptr++ = rgb.tmpA[j]; - } - else - { - // TWO bytes per color - if( rgb.Header.Zsize >= 1 ) - { - // two bytes of color data - tempShort = (u16 *) (ptr); - *tempShort = *( (u16 *) (rgb.tmpR) + j); - tempShort++; - ptr = ( u8 *)(tempShort); - } - if( rgb.Header.Zsize >= 2 ) - { - tempShort = ( u16 *) (ptr); - *tempShort = *( ( u16 *) (rgb.tmpG) + j); - tempShort++; - ptr = ( u8 *) (tempShort); - } - if( rgb.Header.Zsize >= 3 ) - { - tempShort = ( u16 *) (ptr); - *tempShort = *( ( u16 *) (rgb.tmpB) + j); - tempShort++; - ptr = ( u8 *)(tempShort); - } - if( rgb.Header.Zsize >= 4 ) - { - tempShort = ( u16 *) (ptr); - *tempShort = *( ( u16 *) (rgb.tmpA) + j); - tempShort++; - ptr = ( u8 *)(tempShort); - } - } // end if(rgb.Header.BPC == 1) - } // end for - } // end for -} - - -/* - This information only applies if the value for STORAGE is 1. If the image is - stored using run length encoding, the image data follows the offset/length tables. - The RLE data is not in any particular order. The offset tables are used to - locate the rle data for any scanline. - - The RLE data must be read in from the file and expanded into pixel data in the following manner: - - If BPC is 1, then there is one byte per pixel. In this case the RLE data should be - read into an array of chars. To expand data, the low order seven bits of the first - byte: bits[6..0] are used to form a count. If the high order bit of the first byte - is 1: bit[7], then the count is used to specify how many bytes to copy from the RLE - data buffer to the destination. Otherwise, if the high order bit of the first byte - is 0: bit[7], then the count is used to specify how many times to repeat the value - of the following byte, in the destination. This process continues until a count - of 0 is found. This should decompress exactly XSIZE pixels. - - - One entry in each table is needed for each scanline of RLE data. The total number of - scanlines in the image (tablen) is determined by the product of the YSIZE and ZSIZE. - There are two tables of longs that are written. Each consists of tablen longs of data. - The first table has the file offsets to the RLE data for each scanline in the image. In - a file with more than 1 channel (ZSIZE > 1) this table first has all the offsets for the - scanlines in the first channel, followed be offsets for the scanlines in the second - channel, etc. The second table has the RLE data length for each scanline in the image. - In a file with more than 1 channel (ZSIZE > 1) this table first has all the RLE data - lengths for the scanlines in the first channel, followed be RLE data lengths for the - scanlines in the second channel, etc. - - Return a row of data, expanding RLE compression if necessary -*/ -void CImageLoaderRGB::readRGBrow(u8 *buf, int y, int z, io::IReadFile* file, rgbStruct& rgb) const -{ - if (rgb.Header.Storage != 1) - { - // stored VERBATIM - - file->seek(512+(y*rgb.Header.Xsize * rgb.Header.BPC)+(z* rgb.Header.Xsize * rgb.Header.Ysize * rgb.Header.BPC)); - file->read(buf, rgb.Header.Xsize * rgb.Header.BPC); - -#ifndef __BIG_ENDIAN__ - if (rgb.Header.BPC != 1) - { - u16* tmpbuf = reinterpret_cast<u16*>(buf); - for (u16 i=0; i<rgb.Header.Xsize; ++i) - tmpbuf[i] = os::Byteswap::byteswap(tmpbuf[i]); - } -#endif - return; - } - - // the file is stored as Run Length Encoding (RLE) - // each sequence is stored as 0x80 NumRepeats ByteToRepeat - - // get the file offset from StartTable and SEEK - // then read the data - - file->seek((long) rgb.StartTable[y+z * rgb.Header.Ysize]); - file->read(rgb.tmp, rgb.LengthTable[y+z * rgb.Header.Ysize]); - - // rgb.tmp has the data - - u16 pixel; - u16 *tempShort; - u8* iPtr = rgb.tmp; - u8* oPtr = buf; - while (true) - { - // if BPC = 1, then one byte per pixel - if (rgb.Header.BPC == 1) - { - pixel = *iPtr++; - } - else - { - // BPC = 2, so two bytes per pixel - tempShort = (u16 *) iPtr; - pixel = *tempShort; - tempShort++; - iPtr = (u8 *) tempShort; - } - -#ifndef __BIG_ENDIAN__ - if (rgb.Header.BPC != 1) - pixel = os::Byteswap::byteswap(pixel); -#endif - - s32 count = (s32)(pixel & 0x7F); - - // limit the count value to the remaining row size - if (oPtr + count*rgb.Header.BPC > buf + rgb.Header.Xsize * rgb.Header.BPC) - { - count = (s32)( (buf + rgb.Header.Xsize * rgb.Header.BPC) - oPtr ) / rgb.Header.BPC; - } - - if (count<=0) - break; - else if (pixel & 0x80) - { - // repeat the byte pointed to by iPtr, count times - while (count--) - { - if(rgb.Header.BPC == 1) - { - *oPtr++ = *iPtr++; - } - else - { - // write pixel from iPtr to oPtr, move both two bytes ahead - tempShort = (u16 *) (iPtr); - pixel = *tempShort; - tempShort++; - iPtr = (u8 *) (tempShort); -#ifndef __BIG_ENDIAN__ - pixel = os::Byteswap::byteswap(pixel); -#endif - tempShort = (u16 *) (oPtr); - *tempShort = pixel; - tempShort++; - oPtr = (u8 *) (tempShort); - } - } - } - else - { - if (rgb.Header.BPC == 1) - { - pixel = *iPtr++; - } - else - { - tempShort = (u16 *) (iPtr); - pixel = *tempShort; - tempShort++; - iPtr = (u8 *) (tempShort); - } - -#ifndef __BIG_ENDIAN__ - if (rgb.Header.BPC != 1) - pixel = os::Byteswap::byteswap(pixel); -#endif - - while (count--) - { - if(rgb.Header.BPC == 1) - { - *oPtr++ = (u8) pixel; - } - else - { - tempShort = (u16 *) (oPtr); - *tempShort = pixel; - tempShort++; - oPtr = (u8 *) (tempShort); - } - } - } // else if (pixel & 0x80) - } // while (true) -} - - -// we have 1 byte per COLOR VALUE, eg 24bpp and 1 alpha channel -// color values are stored as RGBA, convert to ARGB -// todo: replace with CColorConverter method -void CImageLoaderRGB::converttoARGB(u32* in, const u32 size) const -{ - for (u32 x=0; x < size; ++x) - { - *in=(*in>>8)|(*in<<24); - ++in; - } -} - - -//! creates a loader which is able to load SGI RGB images -IImageLoader* createImageLoaderRGB() -{ - return new CImageLoaderRGB; -} - - -} // end namespace video -} // end namespace irr - -#endif - diff --git a/source/Irrlicht/CImageLoaderRGB.h b/source/Irrlicht/CImageLoaderRGB.h deleted file mode 100644 index 4360cffb..00000000 --- a/source/Irrlicht/CImageLoaderRGB.h +++ /dev/null @@ -1,164 +0,0 @@ -// Copyright (C) 2009-2012 Gary Conway -// This file is part of the "Irrlicht Engine". -// For conditions of distribution and use, see copyright notice in irrlicht.h - - -/* - Author: Gary Conway (Viper) - co-author of the ZIP file format, Feb 1989, - see the story at http://www.idcnet.us/ziphistory.html - Website: http://idcnet.us - Email: codeslinger@vipergc.com - Created: March 1, 2009 - Version: 1.0 - Updated: -*/ - -#ifndef __C_IMAGE_LOADER_RGB_H_INCLUDED__ -#define __C_IMAGE_LOADER_RGB_H_INCLUDED__ - -// define _IRR_RGB_FILE_INVERTED_IMAGE_ to preserve the inverted format of the RGB file -// commenting this out will invert the inverted image,resulting in the image being upright -#define _IRR_RGB_FILE_INVERTED_IMAGE_ - -#include "IrrCompileConfig.h" - -#ifdef _IRR_COMPILE_WITH_RGB_LOADER_ - -#include "IImageLoader.h" - -namespace irr -{ -namespace video -{ - -// byte-align structures -#include "irrpack.h" - - // the RGB image file header structure - - struct SRGBHeader - { - u16 Magic; // IRIS image file magic number - u8 Storage; // Storage format - u8 BPC; // Number of bytes per pixel channel - u16 Dimension; // Number of dimensions - u16 Xsize; // X size in pixels - u16 Ysize; // Y size in pixels - u16 Zsize; // Z size in pixels - u32 Pixmin; // Minimum pixel value - u32 Pixmax; // Maximum pixel value - u32 Dummy1; // ignored - char Imagename[80];// Image name - u32 Colormap; // Colormap ID -// char Dummy2[404];// Ignored - } PACK_STRUCT; - -// Default alignment -#include "irrunpack.h" - - // this structure holds context specific data about the file being loaded. - - typedef struct _RGBdata - { - u8 *tmp; - u8 *tmpR; - u8 *tmpG; - u8 *tmpB; - u8 *tmpA; - - u32 *StartTable; // compressed data table, holds file offsets - u32 *LengthTable; // length for the above data, hold lengths for above - u32 TableLen; // len of above tables - - SRGBHeader Header; // define the .rgb file header - u32 ImageSize; - u8 *rgbData; - - public: - _RGBdata() : tmp(0), tmpR(0), tmpG(0), tmpB(0), tmpA(0), - StartTable(0), LengthTable(0), TableLen(0), ImageSize(0), rgbData(0) - { - } - - ~_RGBdata() - { - delete [] tmp; - delete [] tmpR; - delete [] tmpG; - delete [] tmpB; - delete [] tmpA; - delete [] StartTable; - delete [] LengthTable; - delete [] rgbData; - } - - bool allocateTemps() - { - tmp = tmpR = tmpG = tmpB = tmpA = 0; - tmp = new u8 [Header.Xsize * 256 * Header.BPC]; - if (!tmp) - return false; - - if (Header.Zsize >= 1) - { - tmpR = new u8[Header.Xsize * Header.BPC]; - if (!tmpR) - return false; - } - if (Header.Zsize >= 2) - { - tmpG = new u8[Header.Xsize * Header.BPC]; - if (!tmpG) - return false; - } - if (Header.Zsize >= 3) - { - tmpB = new u8[Header.Xsize * Header.BPC]; - if (!tmpB) - return false; - } - if (Header.Zsize >= 4) - { - tmpA = new u8[Header.Xsize * Header.BPC]; - if (!tmpA) - return false; - } - return true; - } - } rgbStruct; - - -//! Surface Loader for Silicon Graphics RGB files -class CImageLoaderRGB : public IImageLoader -{ -public: - - //! constructor - CImageLoaderRGB(); - - //! returns true if the file maybe is able to be loaded by this class - //! based on the file extension (e.g. ".tga") - virtual bool isALoadableFileExtension(const io::path& filename) const _IRR_OVERRIDE_; - - //! returns true if the file maybe is able to be loaded by this class - virtual bool isALoadableFileFormat(io::IReadFile* file) const _IRR_OVERRIDE_; - - //! creates a surface from the file - virtual IImage* loadImage(io::IReadFile* file) const _IRR_OVERRIDE_; - -private: - - bool readHeader(io::IReadFile* file, rgbStruct& rgb) const; - void readRGBrow(u8 *buf, int y, int z, io::IReadFile* file, rgbStruct& rgb) const; - void processFile(io::IReadFile *file, rgbStruct& rgb) const; - bool checkFormat(io::IReadFile *file, rgbStruct& rgb) const; - bool readOffsetTables(io::IReadFile* file, rgbStruct& rgb) const; - void converttoARGB(u32* in, const u32 size) const; -}; - -} // end namespace video -} // end namespace irr - -#endif // _IRR_COMPILE_WITH_RGB_LOADER_ -#endif // __C_IMAGE_LOADER_RGB_H_INCLUDED__ - diff --git a/source/Irrlicht/CImageLoaderTGA.cpp b/source/Irrlicht/CImageLoaderTGA.cpp deleted file mode 100644 index c9b3a9d5..00000000 --- a/source/Irrlicht/CImageLoaderTGA.cpp +++ /dev/null @@ -1,237 +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 "CImageLoaderTGA.h" - -#ifdef _IRR_COMPILE_WITH_TGA_LOADER_ - -#include "IReadFile.h" -#include "os.h" -#include "CColorConverter.h" -#include "CImage.h" -#include "irrString.h" - - -namespace irr -{ -namespace video -{ - - -//! returns true if the file maybe is able to be loaded by this class -//! based on the file extension (e.g. ".tga") -bool CImageLoaderTGA::isALoadableFileExtension(const io::path& filename) const -{ - return core::hasFileExtension ( filename, "tga" ); -} - - -//! loads a compressed tga. -u8 *CImageLoaderTGA::loadCompressedImage(io::IReadFile *file, const STGAHeader& header) const -{ - // This was written and sent in by Jon Pry, thank you very much! - // I only changed the formatting a little bit. - - s32 bytesPerPixel = header.PixelDepth/8; - s32 imageSize = header.ImageHeight * header.ImageWidth * bytesPerPixel; - u8* data = new u8[imageSize]; - s32 currentByte = 0; - - while(currentByte < imageSize) - { - u8 chunkheader = 0; - file->read(&chunkheader, sizeof(u8)); // Read The Chunk's Header - - if(chunkheader < 128) // If The Chunk Is A 'RAW' Chunk - { - chunkheader++; // Add 1 To The Value To Get Total Number Of Raw Pixels - - file->read(&data[currentByte], bytesPerPixel * chunkheader); - currentByte += bytesPerPixel * chunkheader; - } - else - { - // thnx to neojzs for some fixes with this code - - // If It's An RLE Header - chunkheader -= 127; // Subtract 127 To Get Rid Of The ID Bit - - s32 dataOffset = currentByte; - file->read(&data[dataOffset], bytesPerPixel); - - currentByte += bytesPerPixel; - - for(s32 counter = 1; counter < chunkheader; counter++) - { - for(s32 elementCounter=0; elementCounter < bytesPerPixel; elementCounter++) - data[currentByte + elementCounter] = data[dataOffset + elementCounter]; - - currentByte += bytesPerPixel; - } - } - } - - return data; -} - - - -//! returns true if the file maybe is able to be loaded by this class -bool CImageLoaderTGA::isALoadableFileFormat(io::IReadFile* file) const -{ - if (!file) - return false; - - STGAFooter footer; - memset(&footer, 0, sizeof(STGAFooter)); - file->seek(file->getSize()-sizeof(STGAFooter)); - file->read(&footer, sizeof(STGAFooter)); - return (!strcmp(footer.Signature,"TRUEVISION-XFILE.")); // very old tgas are refused. -} - - - -//! creates a surface from the file -IImage* CImageLoaderTGA::loadImage(io::IReadFile* file) const -{ - STGAHeader header; - u32 *palette = 0; - - file->read(&header, sizeof(STGAHeader)); - -#ifdef __BIG_ENDIAN__ - header.ColorMapLength = os::Byteswap::byteswap(header.ColorMapLength); - header.ImageWidth = os::Byteswap::byteswap(header.ImageWidth); - header.ImageHeight = os::Byteswap::byteswap(header.ImageHeight); -#endif - - // skip image identification field - if (header.IdLength) - file->seek(header.IdLength, true); - - if (header.ColorMapType) - { - // create 32 bit palette - palette = new u32[ header.ColorMapLength]; - - // read color map - u8 * colorMap = new u8[header.ColorMapEntrySize/8 * header.ColorMapLength]; - file->read(colorMap,header.ColorMapEntrySize/8 * header.ColorMapLength); - - // convert to 32-bit palette - switch ( header.ColorMapEntrySize ) - { - case 16: - CColorConverter::convert_A1R5G5B5toA8R8G8B8(colorMap, header.ColorMapLength, palette); - break; - case 24: - CColorConverter::convert_B8G8R8toA8R8G8B8(colorMap, header.ColorMapLength, palette); - break; - case 32: - CColorConverter::convert_B8G8R8A8toA8R8G8B8(colorMap, header.ColorMapLength, palette); - break; - } - delete [] colorMap; - } - - // read image - - u8* data = 0; - - if ( header.ImageType == 1 || // Uncompressed, color-mapped images. - header.ImageType == 2 || // Uncompressed, RGB images - header.ImageType == 3 // Uncompressed, black and white images - ) - { - const s32 imageSize = header.ImageHeight * header.ImageWidth * header.PixelDepth/8; - data = new u8[imageSize]; - file->read(data, imageSize); - } - else - if(header.ImageType == 10) - { - // Runlength encoded RGB images - data = loadCompressedImage(file, header); - } - else - { - os::Printer::log("Unsupported TGA file type", file->getFileName(), ELL_ERROR); - delete [] palette; - return 0; - } - - IImage* image = 0; - - switch(header.PixelDepth) - { - case 8: - { - if (header.ImageType==3) // grey image - { - image = new CImage(ECF_R8G8B8, - core::dimension2d<u32>(header.ImageWidth, header.ImageHeight)); - if (image) - CColorConverter::convert8BitTo24Bit((u8*)data, - (u8*)image->getData(), - header.ImageWidth,header.ImageHeight, - 0, 0, (header.ImageDescriptor&0x20)==0); - } - else - { - image = new CImage(ECF_A1R5G5B5, - core::dimension2d<u32>(header.ImageWidth, header.ImageHeight)); - if (image) - CColorConverter::convert8BitTo16Bit((u8*)data, - (s16*)image->getData(), - header.ImageWidth,header.ImageHeight, - (s32*) palette, 0, - (header.ImageDescriptor&0x20)==0); - } - } - break; - case 16: - image = new CImage(ECF_A1R5G5B5, - core::dimension2d<u32>(header.ImageWidth, header.ImageHeight)); - if (image) - CColorConverter::convert16BitTo16Bit((s16*)data, - (s16*)image->getData(), header.ImageWidth, header.ImageHeight, 0, (header.ImageDescriptor&0x20)==0); - break; - case 24: - image = new CImage(ECF_R8G8B8, - core::dimension2d<u32>(header.ImageWidth, header.ImageHeight)); - if (image) - CColorConverter::convert24BitTo24Bit( - (u8*)data, (u8*)image->getData(), header.ImageWidth, header.ImageHeight, 0, (header.ImageDescriptor&0x20)==0, true); - break; - case 32: - image = new CImage(ECF_A8R8G8B8, - core::dimension2d<u32>(header.ImageWidth, header.ImageHeight)); - if (image) - CColorConverter::convert32BitTo32Bit((s32*)data, - (s32*)image->getData(), header.ImageWidth, header.ImageHeight, 0, (header.ImageDescriptor&0x20)==0); - break; - default: - os::Printer::log("Unsupported TGA format", file->getFileName(), ELL_ERROR); - break; - } - - delete [] data; - delete [] palette; - - return image; -} - - -//! creates a loader which is able to load tgas -IImageLoader* createImageLoaderTGA() -{ - return new CImageLoaderTGA(); -} - - -} // end namespace video -} // end namespace irr - -#endif - diff --git a/source/Irrlicht/CImageLoaderTGA.h b/source/Irrlicht/CImageLoaderTGA.h deleted file mode 100644 index 8ea0246f..00000000 --- a/source/Irrlicht/CImageLoaderTGA.h +++ /dev/null @@ -1,82 +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_IMAGE_LOADER_TGA_H_INCLUDED__ -#define __C_IMAGE_LOADER_TGA_H_INCLUDED__ - -#include "IrrCompileConfig.h" - -#include "IImageLoader.h" - - -namespace irr -{ -namespace video -{ - -#if defined(_IRR_COMPILE_WITH_TGA_LOADER_) || defined(_IRR_COMPILE_WITH_TGA_WRITER_) - -// byte-align structures -#include "irrpack.h" - - // these structs are also used in the TGA writer - struct STGAHeader{ - u8 IdLength; - u8 ColorMapType; - u8 ImageType; - u8 FirstEntryIndex[2]; - u16 ColorMapLength; - u8 ColorMapEntrySize; - u8 XOrigin[2]; - u8 YOrigin[2]; - u16 ImageWidth; - u16 ImageHeight; - u8 PixelDepth; - u8 ImageDescriptor; - } PACK_STRUCT; - - struct STGAFooter - { - u32 ExtensionOffset; - u32 DeveloperOffset; - c8 Signature[18]; - } PACK_STRUCT; - -// Default alignment -#include "irrunpack.h" - -#endif // compiled with loader or reader - -#ifdef _IRR_COMPILE_WITH_TGA_LOADER_ - -/*! - Surface Loader for targa images -*/ -class CImageLoaderTGA : public IImageLoader -{ -public: - - //! returns true if the file maybe is able to be loaded by this class - //! based on the file extension (e.g. ".tga") - virtual bool isALoadableFileExtension(const io::path& filename) const _IRR_OVERRIDE_; - - //! returns true if the file maybe is able to be loaded by this class - virtual bool isALoadableFileFormat(io::IReadFile* file) const _IRR_OVERRIDE_; - - //! creates a surface from the file - virtual IImage* loadImage(io::IReadFile* file) const _IRR_OVERRIDE_; - -private: - - //! loads a compressed tga. Was written and sent in by Jon Pry, thank you very much! - u8* loadCompressedImage(io::IReadFile *file, const STGAHeader& header) const; -}; - -#endif // compiled with loader - -} // end namespace video -} // end namespace irr - -#endif - diff --git a/source/Irrlicht/CImageLoaderWAL.cpp b/source/Irrlicht/CImageLoaderWAL.cpp deleted file mode 100644 index cd210ded..00000000 --- a/source/Irrlicht/CImageLoaderWAL.cpp +++ /dev/null @@ -1,282 +0,0 @@ -// Copyright (C) 2004 Murphy McCauley -// Copyright (C) 2007-2012 Christian Stehno -// This file is part of the "Irrlicht Engine". -// For conditions of distribution and use, see copyright notice in irrlicht.h - -#include "CImageLoaderWAL.h" - -#include "CColorConverter.h" -#include "CImage.h" -#include "os.h" -#include "dimension2d.h" -#include "IVideoDriver.h" -#include "IFileSystem.h" -#include "IReadFile.h" -#include "irrString.h" - -namespace irr -{ -namespace video -{ - -#ifdef _IRR_COMPILE_WITH_LMP_LOADER_ - -// Palette quake2 colormap.h, 768 byte, last is transparent -static const u32 colormap_h[256] = { - 0xFF000000,0xFF0F0F0F,0xFF1F1F1F,0xFF2F2F2F,0xFF3F3F3F,0xFF4B4B4B,0xFF5B5B5B,0xFF6B6B6B, - 0xFF7B7B7B,0xFF8B8B8B,0xFF9B9B9B,0xFFABABAB,0xFFBBBBBB,0xFFCBCBCB,0xFFDBDBDB,0xFFEBEBEB, - 0xFF0F0B07,0xFF170F0B,0xFF1F170B,0xFF271B0F,0xFF2F2313,0xFF372B17,0xFF3F2F17,0xFF4B371B, - 0xFF533B1B,0xFF5B431F,0xFF634B1F,0xFF6B531F,0xFF73571F,0xFF7B5F23,0xFF836723,0xFF8F6F23, - 0xFF0B0B0F,0xFF13131B,0xFF1B1B27,0xFF272733,0xFF2F2F3F,0xFF37374B,0xFF3F3F57,0xFF474767, - 0xFF4F4F73,0xFF5B5B7F,0xFF63638B,0xFF6B6B97,0xFF7373A3,0xFF7B7BAF,0xFF8383BB,0xFF8B8BCB, - 0xFF000000,0xFF070700,0xFF0B0B00,0xFF131300,0xFF1B1B00,0xFF232300,0xFF2B2B07,0xFF2F2F07, - 0xFF373707,0xFF3F3F07,0xFF474707,0xFF4B4B0B,0xFF53530B,0xFF5B5B0B,0xFF63630B,0xFF6B6B0F, - 0xFF070000,0xFF0F0000,0xFF170000,0xFF1F0000,0xFF270000,0xFF2F0000,0xFF370000,0xFF3F0000, - 0xFF470000,0xFF4F0000,0xFF570000,0xFF5F0000,0xFF670000,0xFF6F0000,0xFF770000,0xFF7F0000, - 0xFF131300,0xFF1B1B00,0xFF232300,0xFF2F2B00,0xFF372F00,0xFF433700,0xFF4B3B07,0xFF574307, - 0xFF5F4707,0xFF6B4B0B,0xFF77530F,0xFF835713,0xFF8B5B13,0xFF975F1B,0xFFA3631F,0xFFAF6723, - 0xFF231307,0xFF2F170B,0xFF3B1F0F,0xFF4B2313,0xFF572B17,0xFF632F1F,0xFF733723,0xFF7F3B2B, - 0xFF8F4333,0xFF9F4F33,0xFFAF632F,0xFFBF772F,0xFFCF8F2B,0xFFDFAB27,0xFFEFCB1F,0xFFFFF31B, - 0xFF0B0700,0xFF1B1300,0xFF2B230F,0xFF372B13,0xFF47331B,0xFF533723,0xFF633F2B,0xFF6F4733, - 0xFF7F533F,0xFF8B5F47,0xFF9B6B53,0xFFA77B5F,0xFFB7876B,0xFFC3937B,0xFFD3A38B,0xFFE3B397, - 0xFFAB8BA3,0xFF9F7F97,0xFF937387,0xFF8B677B,0xFF7F5B6F,0xFF775363,0xFF6B4B57,0xFF5F3F4B, - 0xFF573743,0xFF4B2F37,0xFF43272F,0xFF371F23,0xFF2B171B,0xFF231313,0xFF170B0B,0xFF0F0707, - 0xFFBB739F,0xFFAF6B8F,0xFFA35F83,0xFF975777,0xFF8B4F6B,0xFF7F4B5F,0xFF734353,0xFF6B3B4B, - 0xFF5F333F,0xFF532B37,0xFF47232B,0xFF3B1F23,0xFF2F171B,0xFF231313,0xFF170B0B,0xFF0F0707, - 0xFFDBC3BB,0xFFCBB3A7,0xFFBFA39B,0xFFAF978B,0xFFA3877B,0xFF977B6F,0xFF876F5F,0xFF7B6353, - 0xFF6B5747,0xFF5F4B3B,0xFF533F33,0xFF433327,0xFF372B1F,0xFF271F17,0xFF1B130F,0xFF0F0B07, - 0xFF6F837B,0xFF677B6F,0xFF5F7367,0xFF576B5F,0xFF4F6357,0xFF475B4F,0xFF3F5347,0xFF374B3F, - 0xFF2F4337,0xFF2B3B2F,0xFF233327,0xFF1F2B1F,0xFF172317,0xFF0F1B13,0xFF0B130B,0xFF070B07, - 0xFFFFF31B,0xFFEFDF17,0xFFDBCB13,0xFFCBB70F,0xFFBBA70F,0xFFAB970B,0xFF9B8307,0xFF8B7307, - 0xFF7B6307,0xFF6B5300,0xFF5B4700,0xFF4B3700,0xFF3B2B00,0xFF2B1F00,0xFF1B0F00,0xFF0B0700, - 0xFF0000FF,0xFF0B0BEF,0xFF1313DF,0xFF1B1BCF,0xFF2323BF,0xFF2B2BAF,0xFF2F2F9F,0xFF2F2F8F, - 0xFF2F2F7F,0xFF2F2F6F,0xFF2F2F5F,0xFF2B2B4F,0xFF23233F,0xFF1B1B2F,0xFF13131F,0xFF0B0B0F, - 0xFF2B0000,0xFF3B0000,0xFF4B0700,0xFF5F0700,0xFF6F0F00,0xFF7F1707,0xFF931F07,0xFFA3270B, - 0xFFB7330F,0xFFC34B1B,0xFFCF632B,0xFFDB7F3B,0xFFE3974F,0xFFE7AB5F,0xFFEFBF77,0xFFF7D38B, - 0xFFA77B3B,0xFFB79B37,0xFFC7C337,0xFFE7E357,0xFF7FBFFF,0xFFABE7FF,0xFFD7FFFF,0xFF670000, - 0xFF8B0000,0xFFB30000,0xFFD70000,0xFFFF0000,0xFFFFF393,0xFFFFF7C7,0xFFFFFFFF,0x009F5B53 -}; - -bool CImageLoaderLMP::isALoadableFileExtension(const io::path& filename) const -{ - return core::hasFileExtension ( filename, "lmp" ); -} - - -bool CImageLoaderLMP::isALoadableFileFormat(irr::io::IReadFile* file) const -{ - return false; -} - -/*! - Quake1, Quake2, Hallife lmp texture -*/ -IImage* CImageLoaderLMP::loadImage(irr::io::IReadFile* file) const -{ - SLMPHeader header; - - file->seek(0); - file->read(&header, sizeof(header)); - - // maybe palette file - u32 rawtexsize = header.width * header.height; - if ( rawtexsize + sizeof ( header ) != (u32)file->getSize() ) - return 0; - - u8 *rawtex = new u8 [ rawtexsize ]; - - file->read(rawtex, rawtexsize); - - IImage* image = new CImage(ECF_A8R8G8B8, core::dimension2d<u32>(header.width, header.height)); - - CColorConverter::convert8BitTo32Bit(rawtex, (u8*)image->getData(), header.width, header.height, (u8*) colormap_h, 0, false); - - delete [] rawtex; - - return image; -} - - -IImageLoader* createImageLoaderLMP() -{ - return new irr::video::CImageLoaderLMP(); -} - -#endif - -#ifdef _IRR_COMPILE_WITH_WAL_LOADER_ - -// Palette quake2 demo pics/colormap.pcx, last is transparent -static const u32 colormap_pcx[256] = { - 0xFF000000,0xFF0F0F0F,0xFF1F1F1F,0xFF2F2F2F,0xFF3F3F3F,0xFF4B4B4B,0xFF5B5B5B,0xFF6B6B6B, - 0xFF7B7B7B,0xFF8B8B8B,0xFF9B9B9B,0xFFABABAB,0xFFBBBBBB,0xFFCBCBCB,0xFFDBDBDB,0xFFEBEBEB, - 0xFF634B23,0xFF5B431F,0xFF533F1F,0xFF4F3B1B,0xFF47371B,0xFF3F2F17,0xFF3B2B17,0xFF332713, - 0xFF2F2313,0xFF2B1F13,0xFF271B0F,0xFF23170F,0xFF1B130B,0xFF170F0B,0xFF130F07,0xFF0F0B07, - 0xFF5F5F6F,0xFF5B5B67,0xFF5B535F,0xFF574F5B,0xFF534B53,0xFF4F474B,0xFF473F43,0xFF3F3B3B, - 0xFF3B3737,0xFF332F2F,0xFF2F2B2B,0xFF272727,0xFF232323,0xFF1B1B1B,0xFF171717,0xFF131313, - 0xFF8F7753,0xFF7B6343,0xFF735B3B,0xFF674F2F,0xFFCF974B,0xFFA77B3B,0xFF8B672F,0xFF6F5327, - 0xFFEB9F27,0xFFCB8B23,0xFFAF771F,0xFF93631B,0xFF774F17,0xFF5B3B0F,0xFF3F270B,0xFF231707, - 0xFFA73B2B,0xFF9F2F23,0xFF972B1B,0xFF8B2713,0xFF7F1F0F,0xFF73170B,0xFF671707,0xFF571300, - 0xFF4B0F00,0xFF430F00,0xFF3B0F00,0xFF330B00,0xFF2B0B00,0xFF230B00,0xFF1B0700,0xFF130700, - 0xFF7B5F4B,0xFF735743,0xFF6B533F,0xFF674F3B,0xFF5F4737,0xFF574333,0xFF533F2F,0xFF4B372B, - 0xFF433327,0xFF3F2F23,0xFF37271B,0xFF2F2317,0xFF271B13,0xFF1F170F,0xFF170F0B,0xFF0F0B07, - 0xFF6F3B17,0xFF5F3717,0xFF532F17,0xFF432B17,0xFF372313,0xFF271B0F,0xFF1B130B,0xFF0F0B07, - 0xFFB35B4F,0xFFBF7B6F,0xFFCB9B93,0xFFD7BBB7,0xFFCBD7DF,0xFFB3C7D3,0xFF9FB7C3,0xFF87A7B7, - 0xFF7397A7,0xFF5B879B,0xFF47778B,0xFF2F677F,0xFF17536F,0xFF134B67,0xFF0F435B,0xFF0B3F53, - 0xFF07374B,0xFF072F3F,0xFF072733,0xFF001F2B,0xFF00171F,0xFF000F13,0xFF00070B,0xFF000000, - 0xFF8B5757,0xFF834F4F,0xFF7B4747,0xFF734343,0xFF6B3B3B,0xFF633333,0xFF5B2F2F,0xFF572B2B, - 0xFF4B2323,0xFF3F1F1F,0xFF331B1B,0xFF2B1313,0xFF1F0F0F,0xFF130B0B,0xFF0B0707,0xFF000000, - 0xFF979F7B,0xFF8F9773,0xFF878B6B,0xFF7F8363,0xFF777B5F,0xFF737357,0xFF6B6B4F,0xFF636347, - 0xFF5B5B43,0xFF4F4F3B,0xFF434333,0xFF37372B,0xFF2F2F23,0xFF23231B,0xFF171713,0xFF0F0F0B, - 0xFF9F4B3F,0xFF934337,0xFF8B3B2F,0xFF7F3727,0xFF772F23,0xFF6B2B1B,0xFF632317,0xFF571F13, - 0xFF4F1B0F,0xFF43170B,0xFF37130B,0xFF2B0F07,0xFF1F0B07,0xFF170700,0xFF0B0000,0xFF000000, - 0xFF777BCF,0xFF6F73C3,0xFF676BB7,0xFF6363A7,0xFF5B5B9B,0xFF53578F,0xFF4B4F7F,0xFF474773, - 0xFF3F3F67,0xFF373757,0xFF2F2F4B,0xFF27273F,0xFF231F2F,0xFF1B1723,0xFF130F17,0xFF0B0707, - 0xFF9BAB7B,0xFF8F9F6F,0xFF879763,0xFF7B8B57,0xFF73834B,0xFF677743,0xFF5F6F3B,0xFF576733, - 0xFF4B5B27,0xFF3F4F1B,0xFF374313,0xFF2F3B0B,0xFF232F07,0xFF1B2300,0xFF131700,0xFF0B0F00, - 0xFF00FF00,0xFF23E70F,0xFF3FD31B,0xFF53BB27,0xFF5FA72F,0xFF5F8F33,0xFF5F7B33,0xFFFFFFFF, - 0xFFFFFFD3,0xFFFFFFA7,0xFFFFFF7F,0xFFFFFF53,0xFFFFFF27,0xFFFFEB1F,0xFFFFD717,0xFFFFBF0F, - 0xFFFFAB07,0xFFFF9300,0xFFEF7F00,0xFFE36B00,0xFFD35700,0xFFC74700,0xFFB73B00,0xFFAB2B00, - 0xFF9B1F00,0xFF8F1700,0xFF7F0F00,0xFF730700,0xFF5F0000,0xFF470000,0xFF2F0000,0xFF1B0000, - 0xFFEF0000,0xFF3737FF,0xFFFF0000,0xFF0000FF,0xFF2B2B23,0xFF1B1B17,0xFF13130F,0xFFEB977F, - 0xFFC37353,0xFF9F5733,0xFF7B3F1B,0xFFEBD3C7,0xFFC7AB9B,0xFFA78B77,0xFF876B57,0x009F5B53 -}; - -/*! - Halflife -*/ -bool CImageLoaderWAL2::isALoadableFileExtension(const io::path& filename) const -{ - // embedded in Wad(WAD3 format). originally it has no extension - return core::hasFileExtension ( filename, "wal2" ); -} - - -bool CImageLoaderWAL2::isALoadableFileFormat(irr::io::IReadFile* file) const -{ - return false; -} - -/* - Halflite Texture WAD -*/ -IImage* CImageLoaderWAL2::loadImage(irr::io::IReadFile* file) const -{ - miptex_halflife header; - - file->seek(0); - file->read(&header, sizeof(header)); - -#ifdef __BIG_ENDIAN__ - header.width = os::Byteswap::byteswap(header.width); - header.height = os::Byteswap::byteswap(header.height); -#endif - - // palette - //u32 paletteofs = header.mipmap[0] + ((rawtexsize * 85) >> 6) + 2; - u32 *pal = new u32 [ 192 + 256 ]; - u8 *s = (u8*) pal; - - file->seek ( file->getSize() - 768 - 2 ); - file->read ( s, 768 ); - u32 i; - - for ( i = 0; i < 256; ++i, s+= 3 ) - { - pal [ 192 + i ] = 0xFF000000 | s[0] << 16 | s[1] << 8 | s[2]; - } - - ECOLOR_FORMAT format = ECF_R8G8B8; - - // transparency in filename;-) funny. rgb:0x0000FF is colorkey - if ( file->getFileName().findFirst ( '{' ) >= 0 ) - { - format = ECF_A8R8G8B8; - pal [ 192 + 255 ] &= 0x00FFFFFF; - } - - u32 rawtexsize = header.width * header.height; - u8 *rawtex = new u8 [ rawtexsize ]; - - file->seek ( header.mipmap[0] ); - file->read(rawtex, rawtexsize); - - IImage* image = new CImage(format, core::dimension2d<u32>(header.width, header.height)); - - switch ( format ) - { - case ECF_R8G8B8: - CColorConverter::convert8BitTo24Bit(rawtex, (u8*)image->getData(), header.width, header.height, (u8*) pal + 768, 0, false); - break; - case ECF_A8R8G8B8: - CColorConverter::convert8BitTo32Bit(rawtex, (u8*)image->getData(), header.width, header.height, (u8*) pal + 768, 0, false); - break; - default: - // Assuming there are no other color formats (I found no information about this format) - break; - } - - delete [] rawtex; - delete [] pal; - - return image; -} - -bool CImageLoaderWAL::isALoadableFileExtension(const io::path& filename) const -{ - return core::hasFileExtension ( filename, "wal" ); -} - - -bool CImageLoaderWAL::isALoadableFileFormat(irr::io::IReadFile* file) const -{ - return false; -} - - -/*! - quake2 -*/ -IImage* CImageLoaderWAL::loadImage(irr::io::IReadFile* file) const -{ - miptex_quake2 header; - - file->seek(0); - file->read(&header, sizeof(header)); - -#ifdef __BIG_ENDIAN__ - header.width = os::Byteswap::byteswap(header.width); - header.height = os::Byteswap::byteswap(header.height); -#endif - - u32 rawtexsize = header.width * header.height; - - u8 *rawtex = new u8 [ rawtexsize ]; - - file->seek ( header.mipmap[0] ); - file->read(rawtex, rawtexsize); - - IImage* image = new CImage(ECF_A8R8G8B8, core::dimension2d<u32>(header.width, header.height)); - - CColorConverter::convert8BitTo32Bit(rawtex, (u8*)image->getData(), header.width, header.height, (u8*) colormap_pcx, 0, false); - - delete [] rawtex; - - return image; -} - -IImageLoader* createImageLoaderWAL() -{ - return new irr::video::CImageLoaderWAL(); -} - -IImageLoader* createImageLoaderHalfLife() -{ - return new irr::video::CImageLoaderWAL2(); -} - -#endif - -} // end namespace video -} // end namespace irr - diff --git a/source/Irrlicht/CImageLoaderWAL.h b/source/Irrlicht/CImageLoaderWAL.h deleted file mode 100644 index 7c8ab6ec..00000000 --- a/source/Irrlicht/CImageLoaderWAL.h +++ /dev/null @@ -1,100 +0,0 @@ -// Copyright (C) 2004 Murphy McCauley -// Copyright (C) 2007-2012 Christian Stehno -// This file is part of the "Irrlicht Engine". -// For conditions of distribution and use, see copyright notice in irrlicht.h -/* - Thanks to: - Max McGuire for his Flipcode article about WAL textures - Nikolaus Gebhardt for the Irrlicht 3D engine -*/ - -#ifndef __C_IMAGE_LOADER_WAL_H_INCLUDED__ -#define __C_IMAGE_LOADER_WAL_H_INCLUDED__ - -#include "IrrCompileConfig.h" -#include "IImageLoader.h" - -namespace irr -{ -namespace video -{ - -#ifdef _IRR_COMPILE_WITH_LMP_LOADER_ - -// byte-align structures -#include "irrpack.h" - - struct SLMPHeader { - u32 width; // width - u32 height; // height - // variably sized - } PACK_STRUCT; - -// Default alignment -#include "irrunpack.h" - -//! An Irrlicht image loader for Quake1,2 engine lmp textures/palette -class CImageLoaderLMP : public irr::video::IImageLoader -{ -public: - virtual bool isALoadableFileExtension(const io::path& filename) const _IRR_OVERRIDE_; - virtual bool isALoadableFileFormat(irr::io::IReadFile* file) const _IRR_OVERRIDE_; - virtual irr::video::IImage* loadImage(irr::io::IReadFile* file) const _IRR_OVERRIDE_; -}; - -#endif - -#ifdef _IRR_COMPILE_WITH_WAL_LOADER_ - -//! An Irrlicht image loader for quake2 wal engine textures -class CImageLoaderWAL : public irr::video::IImageLoader -{ -public: - virtual bool isALoadableFileExtension(const io::path& filename) const _IRR_OVERRIDE_; - virtual bool isALoadableFileFormat(irr::io::IReadFile* file) const _IRR_OVERRIDE_; - virtual irr::video::IImage* loadImage(irr::io::IReadFile* file) const _IRR_OVERRIDE_; -}; - -//! An Irrlicht image loader for Halflife 1 engine textures -class CImageLoaderWAL2 : public irr::video::IImageLoader -{ -public: - virtual bool isALoadableFileExtension(const io::path& filename) const _IRR_OVERRIDE_; - virtual bool isALoadableFileFormat(irr::io::IReadFile* file) const _IRR_OVERRIDE_; - virtual irr::video::IImage* loadImage(irr::io::IReadFile* file) const _IRR_OVERRIDE_; -}; - -// byte-align structures -#include "irrpack.h" - - // Halfelife wad3 type 67 file - struct miptex_halflife - { - c8 name[16]; - u32 width, height; - u32 mipmap[4]; // four mip maps stored - } PACK_STRUCT; - - //quake2 texture - struct miptex_quake2 - { - c8 name[32]; - u32 width; - u32 height; - u32 mipmap[4]; // four mip maps stored - c8 animname[32]; // next frame in animation chain - s32 flags; - s32 contents; - s32 value; - } PACK_STRUCT; - -// Default alignment -#include "irrunpack.h" - -#endif - -} -} - -#endif - diff --git a/source/Irrlicht/CImageWriterBMP.cpp b/source/Irrlicht/CImageWriterBMP.cpp deleted file mode 100644 index 84fdc7ba..00000000 --- a/source/Irrlicht/CImageWriterBMP.cpp +++ /dev/null @@ -1,137 +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 "CImageWriterBMP.h" - -#ifdef _IRR_COMPILE_WITH_BMP_WRITER_ - -#include "CImageLoaderBMP.h" -#include "IWriteFile.h" -#include "CColorConverter.h" -#include "irrString.h" -#include "os.h" - -namespace irr -{ -namespace video -{ - -IImageWriter* createImageWriterBMP() -{ - return new CImageWriterBMP; -} - -CImageWriterBMP::CImageWriterBMP() -{ -#ifdef _DEBUG - setDebugName("CImageWriterBMP"); -#endif -} - -bool CImageWriterBMP::isAWriteableFileExtension(const io::path& filename) const -{ - return core::hasFileExtension ( filename, "bmp" ); -} - -bool CImageWriterBMP::writeImage(io::IWriteFile* file, IImage* image, u32 param) const -{ - // we always write 24-bit color because nothing really reads 32-bit - - SBMPHeader imageHeader; - imageHeader.Id = 0x4d42; - imageHeader.Reserved = 0; - imageHeader.BitmapDataOffset = sizeof(imageHeader); - imageHeader.BitmapHeaderSize = 0x28; - imageHeader.Width = image->getDimension().Width; - imageHeader.Height = image->getDimension().Height; - imageHeader.Planes = 1; - imageHeader.BPP = 24; - imageHeader.Compression = 0; - imageHeader.PixelPerMeterX = 0; - imageHeader.PixelPerMeterY = 0; - imageHeader.Colors = 0; - imageHeader.ImportantColors = 0; - - // data size is rounded up to next larger 4 bytes boundary - imageHeader.BitmapDataSize = imageHeader.Width * imageHeader.BPP / 8; - imageHeader.BitmapDataSize = (imageHeader.BitmapDataSize + 3) & ~3; - imageHeader.BitmapDataSize *= imageHeader.Height; - - // file size is data size plus offset to data - imageHeader.FileSize = imageHeader.BitmapDataOffset + imageHeader.BitmapDataSize; - - // bitmaps are stored upside down and padded so we always do this - void (*CColorConverter_convertFORMATtoFORMAT)(const void*, s32, void*) = 0; - switch(image->getColorFormat()) - { - case ECF_R8G8B8: - CColorConverter_convertFORMATtoFORMAT - = CColorConverter::convert_R8G8B8toR8G8B8; - break; - case ECF_A8R8G8B8: - CColorConverter_convertFORMATtoFORMAT - = CColorConverter::convert_A8R8G8B8toB8G8R8; - break; - case ECF_A1R5G5B5: - CColorConverter_convertFORMATtoFORMAT - = CColorConverter::convert_A1R5G5B5toR8G8B8; - break; - case ECF_R5G6B5: - CColorConverter_convertFORMATtoFORMAT - = CColorConverter::convert_R5G6B5toR8G8B8; - break; - default: - os::Printer::log("CImageWriterBMP does not support image format", ColorFormatNames[image->getColorFormat()], ELL_WARNING); - break; - } - - // couldn't find a color converter - if (!CColorConverter_convertFORMATtoFORMAT) - return false; - - // write the bitmap header - if (file->write(&imageHeader, sizeof(imageHeader)) != sizeof(imageHeader)) - return false; - - u8* scan_lines = (u8*)image->getData(); - if (!scan_lines) - return false; - - // size of one pixel in bytes - u32 pixel_size = image->getBytesPerPixel(); - - // length of one row of the source image in bytes - u32 row_stride = (pixel_size * imageHeader.Width); - - // length of one row in bytes, rounded up to nearest 4-byte boundary - size_t row_size = ((3 * imageHeader.Width) + 3) & ~3; - - // allocate and clear memory for our scan line - u8* row_pointer = new u8[row_size]; - memset(row_pointer, 0, row_size); - - // convert the image to 24-bit BGR and flip it over - s32 y; - for (y = imageHeader.Height - 1; 0 <= y; --y) - { - if (image->getColorFormat()==ECF_R8G8B8) - CColorConverter::convert24BitTo24Bit(&scan_lines[y * row_stride], row_pointer, imageHeader.Width, 1, 0, false, true); - else - // source, length [pixels], destination - CColorConverter_convertFORMATtoFORMAT(&scan_lines[y * row_stride], imageHeader.Width, row_pointer); - if (file->write(row_pointer, row_size) < row_size) - break; - } - - // clean up our scratch area - delete [] row_pointer; - - return y < 0; -} - -} // namespace video -} // namespace irr - -#endif - diff --git a/source/Irrlicht/CImageWriterBMP.h b/source/Irrlicht/CImageWriterBMP.h deleted file mode 100644 index 3d9584c0..00000000 --- a/source/Irrlicht/CImageWriterBMP.h +++ /dev/null @@ -1,37 +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_IMAGE_WRITER_BMP_H_INCLUDED__ -#define _C_IMAGE_WRITER_BMP_H_INCLUDED__ - -#include "IrrCompileConfig.h" - -#ifdef _IRR_COMPILE_WITH_BMP_WRITER_ - -#include "IImageWriter.h" - -namespace irr -{ -namespace video -{ - -class CImageWriterBMP : public IImageWriter -{ -public: - //! constructor - CImageWriterBMP(); - - //! return true if this writer can write a file with the given extension - virtual bool isAWriteableFileExtension(const io::path& filename) const _IRR_OVERRIDE_; - - //! write image to file - virtual bool writeImage(io::IWriteFile *file, IImage *image, u32 param) const _IRR_OVERRIDE_; -}; - -} // namespace video -} // namespace irr - -#endif -#endif // _C_IMAGE_WRITER_BMP_H_INCLUDED__ - diff --git a/source/Irrlicht/CImageWriterPCX.cpp b/source/Irrlicht/CImageWriterPCX.cpp deleted file mode 100644 index 5ace3426..00000000 --- a/source/Irrlicht/CImageWriterPCX.cpp +++ /dev/null @@ -1,162 +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 "CImageWriterPCX.h" - -#ifdef _IRR_COMPILE_WITH_PCX_WRITER_ - -#include "CImageLoaderPCX.h" -#include "IWriteFile.h" -#include "os.h" // for logging -#include "irrString.h" - -namespace irr -{ -namespace video -{ - -IImageWriter* createImageWriterPCX() -{ - return new CImageWriterPCX; -} - -CImageWriterPCX::CImageWriterPCX() -{ -#ifdef _DEBUG - setDebugName("CImageWriterPCX"); -#endif -} - -bool CImageWriterPCX::isAWriteableFileExtension(const io::path& filename) const -{ - return core::hasFileExtension ( filename, "pcx" ); -} - -bool CImageWriterPCX::writeImage(io::IWriteFile *file, IImage *image,u32 param) const -{ - if (!file || !image) - return false; - - u8 d1; - u16 d2; - u32 i; - - d1 = 10; // Manufacturer - file->write(&d1, 1); - d1 = 5; // Version - file->write(&d1, 1); - d1 = 1; // Encoding - file->write(&d1, 1); - d1 = 8; // Bits per Pixel - file->write(&d1, 1); - d2 = 0; // pixel origin - file->write(&d2, 2); - file->write(&d2, 2); - d2 = image->getDimension().Width-1; // width -#ifdef __BIG_ENDIAN__ - d2 = os::Byteswap::byteswap(d2); -#endif - file->write(&d2, 2); - d2 = image->getDimension().Height-1; // height -#ifdef __BIG_ENDIAN__ - d2 = os::Byteswap::byteswap(d2); -#endif - file->write(&d2, 2); - d2 = 300; // dpi -#ifdef __BIG_ENDIAN__ - d2 = os::Byteswap::byteswap(d2); -#endif - file->write(&d2, 2); - file->write(&d2, 2); - d2 = 0; // palette (not used) - for (i=0; i<24; ++i) - { - file->write(&d2, 2); - } - d1 = 0; // reserved - file->write(&d1, 1); - d1 = 3; // planes - file->write(&d1, 1); - d2 = image->getDimension().Width; // pitch - if (d2&0x0001) // must be even - ++d2; -#ifdef __BIG_ENDIAN__ - d2 = os::Byteswap::byteswap(d2); -#endif - file->write(&d2, 2); - d2 = 1; // color mode -#ifdef __BIG_ENDIAN__ - d2 = os::Byteswap::byteswap(d2); -#endif - file->write(&d2, 2); - d2 = 800; // screen width -#ifdef __BIG_ENDIAN__ - d2 = os::Byteswap::byteswap(d2); -#endif - file->write(&d2, 2); - d2 = 600; // screen height -#ifdef __BIG_ENDIAN__ - d2 = os::Byteswap::byteswap(d2); -#endif - file->write(&d2, 2); - d2 = 0; // filler (not used) - for (i=0; i<27; ++i) - { - file->write(&d2, 2); - } - - u8 cnt, value; - for (i=0; i<image->getDimension().Height; ++i) - { - cnt = 0; - value = 0; - for (u32 j=0; j<3; ++j) // color planes - { - for (u32 k=0; k<image->getDimension().Width; ++k) - { - const SColor pix = image->getPixel(k,i); - if ((cnt!=0) && (cnt<63) && - (((j==0) && (value==pix.getRed())) || - ((j==1) && (value==pix.getGreen())) || - ((j==2) && (value==pix.getBlue())))) - { - ++cnt; - } - else - { - if (cnt!=0) - { - if ((cnt>1) || ((value&0xc0)==0xc0)) - { - cnt |= 0xc0; - file->write(&cnt, 1); - } - file->write(&value, 1); - } - cnt=1; - if (j==0) - value=(u8)pix.getRed(); - else if (j==1) - value=(u8)pix.getGreen(); - else if (j==2) - value=(u8)pix.getBlue(); - } - } - } - if ((cnt>1) || ((value&0xc0)==0xc0)) - { - cnt |= 0xc0; - file->write(&cnt, 1); - } - file->write(&value, 1); - } - - return true; -} - -} // namespace video -} // namespace irr - -#endif - diff --git a/source/Irrlicht/CImageWriterPCX.h b/source/Irrlicht/CImageWriterPCX.h deleted file mode 100644 index b819d119..00000000 --- a/source/Irrlicht/CImageWriterPCX.h +++ /dev/null @@ -1,37 +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_IMAGE_WRITER_PCX_H_INCLUDED__ -#define _C_IMAGE_WRITER_PCX_H_INCLUDED__ - -#include "IrrCompileConfig.h" - -#ifdef _IRR_COMPILE_WITH_PCX_WRITER_ - -#include "IImageWriter.h" - -namespace irr -{ -namespace video -{ - -class CImageWriterPCX : public IImageWriter -{ -public: - //! constructor - CImageWriterPCX(); - - //! return true if this writer can write a file with the given extension - virtual bool isAWriteableFileExtension(const io::path& filename) const _IRR_OVERRIDE_; - - //! write image to file - virtual bool writeImage(io::IWriteFile *file, IImage *image, u32 param) const _IRR_OVERRIDE_; -}; - -} // namespace video -} // namespace irr - -#endif -#endif // _C_IMAGE_WRITER_PCX_H_INCLUDED__ - diff --git a/source/Irrlicht/CImageWriterPPM.cpp b/source/Irrlicht/CImageWriterPPM.cpp deleted file mode 100644 index fd0db971..00000000 --- a/source/Irrlicht/CImageWriterPPM.cpp +++ /dev/null @@ -1,113 +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 "CImageWriterPPM.h" - -#ifdef _IRR_COMPILE_WITH_PPM_WRITER_ - -#include "IWriteFile.h" -#include "IImage.h" -#include "dimension2d.h" -#include "irrString.h" - -namespace irr -{ -namespace video -{ - - -IImageWriter* createImageWriterPPM() -{ - return new CImageWriterPPM; -} - - -CImageWriterPPM::CImageWriterPPM() -{ -#ifdef _DEBUG - setDebugName("CImageWriterPPM"); -#endif -} - - -bool CImageWriterPPM::isAWriteableFileExtension(const io::path& filename) const -{ - return core::hasFileExtension ( filename, "ppm" ); -} - - -bool CImageWriterPPM::writeImage(io::IWriteFile *file, IImage *image, u32 param) const -{ - char cache[70]; - int size; - - const core::dimension2d<u32>& imageSize = image->getDimension(); - - const bool binary = false; - - if (binary) - size = snprintf_irr(cache, 70, "P6\n"); - else - size = snprintf_irr(cache, 70, "P3\n"); - if ( size < 0 ) - return false; - - if (file->write(cache, (size_t)size) != (size_t)size) - return false; - - size = snprintf_irr(cache, 70, "%u %u\n", imageSize.Width, imageSize.Height); - if ( size < 0 ) - return false; - if (file->write(cache, (size_t)size) != (size_t)size) - return false; - - size = snprintf_irr(cache, 70, "255\n"); - if ( size < 0 ) - return false; - if (file->write(cache, (size_t)size) != (size_t)size) - return false; - - if (binary) - { - for (u32 h = 0; h < imageSize.Height; ++h) - { - for (u32 c = 0; c < imageSize.Width; ++c) - { - const video::SColor& pixel = image->getPixel(c, h); - const u8 r = (u8)(pixel.getRed() & 0xff); - const u8 g = (u8)(pixel.getGreen() & 0xff); - const u8 b = (u8)(pixel.getBlue() & 0xff); - file->write(&r, 1); - file->write(&g, 1); - file->write(&b, 1); - } - } - } - else - { - s32 n = 0; - - for (u32 h = 0; h < imageSize.Height; ++h) - { - for (u32 c = 0; c < imageSize.Width; ++c, ++n) - { - const video::SColor& pixel = image->getPixel(c, h); - size = snprintf_irr(cache, 70, "%.3u %.3u %.3u%s", pixel.getRed(), pixel.getGreen(), pixel.getBlue(), n % 5 == 4 ? "\n" : " "); - if ( size < 0 ) - return false; - if (file->write(cache, (size_t)size) != (size_t)size) - return false; - } - } - } - - return true; -} - - -} // namespace video -} // namespace irr - -#endif - diff --git a/source/Irrlicht/CImageWriterPPM.h b/source/Irrlicht/CImageWriterPPM.h deleted file mode 100644 index c7df272d..00000000 --- a/source/Irrlicht/CImageWriterPPM.h +++ /dev/null @@ -1,37 +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_IMAGE_WRITER_PPM_H_INCLUDED__ -#define _C_IMAGE_WRITER_PPM_H_INCLUDED__ - -#include "IrrCompileConfig.h" - -#ifdef _IRR_COMPILE_WITH_PPM_WRITER_ - -#include "IImageWriter.h" - -namespace irr -{ -namespace video -{ - -class CImageWriterPPM : public IImageWriter -{ -public: - //! constructor - CImageWriterPPM(); - - //! return true if this writer can write a file with the given extension - virtual bool isAWriteableFileExtension(const io::path& filename) const _IRR_OVERRIDE_; - - //! write image to file - virtual bool writeImage(io::IWriteFile *file, IImage *image, u32 param) const _IRR_OVERRIDE_; -}; - -} // namespace video -} // namespace irr - -#endif // _C_IMAGE_WRITER_PPM_H_INCLUDED__ -#endif - diff --git a/source/Irrlicht/CImageWriterPSD.cpp b/source/Irrlicht/CImageWriterPSD.cpp deleted file mode 100644 index 952eb0b3..00000000 --- a/source/Irrlicht/CImageWriterPSD.cpp +++ /dev/null @@ -1,46 +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 "CImageWriterPSD.h" - -#ifdef _IRR_COMPILE_WITH_PSD_WRITER_ - -#include "CImageLoaderPSD.h" -#include "IWriteFile.h" -#include "os.h" // for logging -#include "irrString.h" - -namespace irr -{ -namespace video -{ - -IImageWriter* createImageWriterPSD() -{ - return new CImageWriterPSD; -} - -CImageWriterPSD::CImageWriterPSD() -{ -#ifdef _DEBUG - setDebugName("CImageWriterPSD"); -#endif -} - -bool CImageWriterPSD::isAWriteableFileExtension(const io::path& filename) const -{ - return core::hasFileExtension ( filename, "psd" ); -} - -bool CImageWriterPSD::writeImage(io::IWriteFile *file, IImage *image,u32 param) const -{ - os::Printer::log("PSD writer not yet implemented. Image not written.", ELL_WARNING); - return false; -} - -} // namespace video -} // namespace irr - -#endif - diff --git a/source/Irrlicht/CImageWriterPSD.h b/source/Irrlicht/CImageWriterPSD.h deleted file mode 100644 index 2ca92ded..00000000 --- a/source/Irrlicht/CImageWriterPSD.h +++ /dev/null @@ -1,37 +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_IMAGE_WRITER_PSD_H_INCLUDED__ -#define _C_IMAGE_WRITER_PSD_H_INCLUDED__ - -#include "IrrCompileConfig.h" - -#ifdef _IRR_COMPILE_WITH_PSD_WRITER_ - -#include "IImageWriter.h" - -namespace irr -{ -namespace video -{ - -class CImageWriterPSD : public IImageWriter -{ -public: - //! constructor - CImageWriterPSD(); - - //! return true if this writer can write a file with the given extension - virtual bool isAWriteableFileExtension(const io::path& filename) const _IRR_OVERRIDE_; - - //! write image to file - virtual bool writeImage(io::IWriteFile *file, IImage *image,u32 param) const _IRR_OVERRIDE_; -}; - -} // namespace video -} // namespace irr - -#endif // _I_IMAGE_WRITER_PSD_H_INCLUDED__ -#endif - diff --git a/source/Irrlicht/CImageWriterTGA.cpp b/source/Irrlicht/CImageWriterTGA.cpp deleted file mode 100644 index dd8c0705..00000000 --- a/source/Irrlicht/CImageWriterTGA.cpp +++ /dev/null @@ -1,145 +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 "CImageWriterTGA.h" - -#ifdef _IRR_COMPILE_WITH_TGA_WRITER_ - -#include "CImageLoaderTGA.h" -#include "IWriteFile.h" -#include "CColorConverter.h" -#include "irrString.h" -#include "os.h" - -namespace irr -{ -namespace video -{ - -IImageWriter* createImageWriterTGA() -{ - return new CImageWriterTGA; -} - -CImageWriterTGA::CImageWriterTGA() -{ -#ifdef _DEBUG - setDebugName("CImageWriterTGA"); -#endif -} - -bool CImageWriterTGA::isAWriteableFileExtension(const io::path& filename) const -{ - return core::hasFileExtension ( filename, "tga" ); -} - -bool CImageWriterTGA::writeImage(io::IWriteFile *file, IImage *image,u32 param) const -{ - STGAHeader imageHeader; - imageHeader.IdLength = 0; - imageHeader.ColorMapType = 0; - imageHeader.ImageType = 2; - imageHeader.FirstEntryIndex[0] = 0; - imageHeader.FirstEntryIndex[1] = 0; - imageHeader.ColorMapLength = 0; - imageHeader.ColorMapEntrySize = 0; - imageHeader.XOrigin[0] = 0; - imageHeader.XOrigin[1] = 0; - imageHeader.YOrigin[0] = 0; - imageHeader.YOrigin[1] = 0; - imageHeader.ImageWidth = image->getDimension().Width; - imageHeader.ImageHeight = image->getDimension().Height; - - // top left of image is the top. the image loader needs to - // be fixed to only swap/flip - imageHeader.ImageDescriptor = (1 << 5); - - // chances are good we'll need to swizzle data, so i'm going - // to convert and write one scan line at a time. it's also - // a bit cleaner this way - void (*CColorConverter_convertFORMATtoFORMAT)(const void*, s32, void*) = 0; - switch(image->getColorFormat()) - { - case ECF_A8R8G8B8: - CColorConverter_convertFORMATtoFORMAT - = CColorConverter::convert_A8R8G8B8toA8R8G8B8; - imageHeader.PixelDepth = 32; - imageHeader.ImageDescriptor |= 8; - break; - case ECF_A1R5G5B5: - CColorConverter_convertFORMATtoFORMAT - = CColorConverter::convert_A1R5G5B5toA1R5G5B5; - imageHeader.PixelDepth = 16; - imageHeader.ImageDescriptor |= 1; - break; - case ECF_R5G6B5: - CColorConverter_convertFORMATtoFORMAT - = CColorConverter::convert_R5G6B5toA1R5G5B5; - imageHeader.PixelDepth = 16; - imageHeader.ImageDescriptor |= 1; - break; - case ECF_R8G8B8: - CColorConverter_convertFORMATtoFORMAT - = CColorConverter::convert_R8G8B8toR8G8B8; - imageHeader.PixelDepth = 24; - imageHeader.ImageDescriptor |= 0; - break; - default: - os::Printer::log("CImageWriterTGA does not support image format", ColorFormatNames[image->getColorFormat()], ELL_WARNING); - break; - } - - // couldn't find a color converter - if (!CColorConverter_convertFORMATtoFORMAT) - return false; - - if (file->write(&imageHeader, sizeof(imageHeader)) != sizeof(imageHeader)) - return false; - - u8* scan_lines = (u8*)image->getData(); - if (!scan_lines) - return false; - - // size of one pixel in bytes - u32 pixel_size = image->getBytesPerPixel(); - - // length of one row of the source image in bytes - u32 row_stride = (pixel_size * imageHeader.ImageWidth); - - // length of one output row in bytes - size_t row_size = ((imageHeader.PixelDepth / 8) * imageHeader.ImageWidth); - - // allocate a row do translate data into - u8* row_pointer = new u8[row_size]; - - u32 y; - for (y = 0; y < imageHeader.ImageHeight; ++y) - { - // source, length [pixels], destination - if (image->getColorFormat()==ECF_R8G8B8) - CColorConverter::convert24BitTo24Bit(&scan_lines[y * row_stride], row_pointer, imageHeader.ImageWidth, 1, 0, 0, true); - else - CColorConverter_convertFORMATtoFORMAT(&scan_lines[y * row_stride], imageHeader.ImageWidth, row_pointer); - if (file->write(row_pointer, row_size) != row_size) - break; - } - - delete [] row_pointer; - - STGAFooter imageFooter; - imageFooter.ExtensionOffset = 0; - imageFooter.DeveloperOffset = 0; - strncpy(imageFooter.Signature, "TRUEVISION-XFILE.", 18); - - if (file->write(&imageFooter, sizeof(imageFooter)) < (s32)sizeof(imageFooter)) - return false; - - return imageHeader.ImageHeight <= y; -} - -} // namespace video -} // namespace irr - -#endif - diff --git a/source/Irrlicht/CImageWriterTGA.h b/source/Irrlicht/CImageWriterTGA.h deleted file mode 100644 index 0d3fd3d7..00000000 --- a/source/Irrlicht/CImageWriterTGA.h +++ /dev/null @@ -1,37 +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_IMAGE_WRITER_TGA_H_INCLUDED__ -#define _C_IMAGE_WRITER_TGA_H_INCLUDED__ - -#include "IrrCompileConfig.h" - -#ifdef _IRR_COMPILE_WITH_TGA_WRITER_ - -#include "IImageWriter.h" - -namespace irr -{ -namespace video -{ - -class CImageWriterTGA : public IImageWriter -{ -public: - //! constructor - CImageWriterTGA(); - - //! return true if this writer can write a file with the given extension - virtual bool isAWriteableFileExtension(const io::path& filename) const _IRR_OVERRIDE_; - - //! write image to file - virtual bool writeImage(io::IWriteFile *file, IImage *image,u32 param) const _IRR_OVERRIDE_; -}; - -} // namespace video -} // namespace irr - -#endif // _C_IMAGE_WRITER_TGA_H_INCLUDED__ -#endif - diff --git a/source/Irrlicht/CLMTSMeshFileLoader.cpp b/source/Irrlicht/CLMTSMeshFileLoader.cpp deleted file mode 100644 index b972ec51..00000000 --- a/source/Irrlicht/CLMTSMeshFileLoader.cpp +++ /dev/null @@ -1,380 +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 -// This file was written by Jonas Petersen and modified by Nikolaus Gebhardt. -// See CLMTSMeshFileLoder.h for details. -/* - -CLMTSMeshFileLoader.cpp - -LMTSMeshFileLoader -Written by Jonas Petersen (a.k.a. jox) - -Version 1.5 - 15 March 2005 - -Get the latest version here: http://development.mindfloaters.de/ - -This class allows loading meshes with lightmaps (*.lmts + *.tga files) that were created -using Pulsar LMTools by Lord Trancos (http://www.geocities.com/dxlab/index_en.html) - -Notes: -- This version does not support user data in the *.lmts files, but still loads those files (by skipping the extra data). - -License: --------- - -It's free. You are encouraged to give me credit if you use it in your software. - -Version History: ----------------- - -Version 1.5 - 15 March 2005 -- Did a better cleanup. No memory leaks in case of an loading error. -- Added "#include <stdio.h>" for sprintf. - -Version 1.4 - 12 March 2005 -- Fixed bug in texture and subset loading code that would possibly cause crash. -- Fixed memory cleanup to avoid leak when loading more then one mesh -- Used the irrlicht Logger instead of cerr to output warnings and errors. - For this I had to change the constructor - from: - CLMTSMeshFileLoader(io::IFileSystem* fs, video::IVideoDriver* driver) - to: - CLMTSMeshFileLoader(IrrlichtDevice* device) - -Version 1.3 - 15 February 2005 -- Fixed bug that prevented loading more than one different lmts files. -- Removed unnecessary "#include <os.h>". -- Added "std::" in front of "cerr". This was necessary for Visual Studio .NET, - I hope it's not disturbing other compilers. -- Added warning message when a texture can not be loaded. -- Changed the documentation a bit (minor). - -Version 1.2 -- To avoid confusion I skipped version 1.2 because the website was offering -version 1.2 even though it was only version 1.1. Sorry about that. - -Version 1.1 - 29 July 2004 -- Added setTexturePath() function -- Minor improvements - -Version 1.0 - 29 July 2004 -- Initial release - - -*/ -////////////////////////////////////////////////////////////////////// - -#include "IrrCompileConfig.h" -#ifdef _IRR_COMPILE_WITH_LMTS_LOADER_ - -#include "CLMTSMeshFileLoader.h" -#include "CMeshTextureLoader.h" -#include "SMeshBufferLightMap.h" -#include "SAnimatedMesh.h" -#include "SMeshBuffer.h" -#include "irrString.h" -#include "IReadFile.h" -#include "IAttributes.h" -#include "ISceneManager.h" -#include "os.h" - -namespace irr -{ -namespace scene -{ - -CLMTSMeshFileLoader::CLMTSMeshFileLoader(io::IFileSystem* fs, - video::IVideoDriver* driver, io::IAttributes* parameters) - : Textures(0), Subsets(0), Triangles(0), - Parameters(parameters), Driver(driver), FileSystem(fs), FlipEndianess(false) -{ - #ifdef _DEBUG - setDebugName("CLMTSMeshFileLoader"); - #endif - - if (Driver) - Driver->grab(); - - if (FileSystem) - FileSystem->grab(); - - TextureLoader = new CMeshTextureLoader( FileSystem, Driver ); -} - - -CLMTSMeshFileLoader::~CLMTSMeshFileLoader() -{ - cleanup(); - - if (Driver) - Driver->drop(); - - if (FileSystem) - FileSystem->drop(); -} - - -void CLMTSMeshFileLoader::cleanup() -{ - delete [] Textures; - Textures = 0; - delete [] Subsets; - Subsets = 0; - delete [] Triangles; - Triangles = 0; -} - - -bool CLMTSMeshFileLoader::isALoadableFileExtension(const io::path& filename) const -{ - return core::hasFileExtension ( filename, "lmts" ); -} - - -IAnimatedMesh* CLMTSMeshFileLoader::createMesh(io::IReadFile* file) -{ - if ( getMeshTextureLoader() ) - getMeshTextureLoader()->setMeshFile(file); - - u32 i; - u32 id; - - // HEADER - - file->read(&Header, sizeof(SLMTSHeader)); - if (Header.MagicID == 0x4C4D5354) - { - FlipEndianess = true; - Header.MagicID = os::Byteswap::byteswap(Header.MagicID); - Header.Version = os::Byteswap::byteswap(Header.Version); - Header.HeaderSize = os::Byteswap::byteswap(Header.HeaderSize); - Header.TextureCount = os::Byteswap::byteswap(Header.TextureCount); - Header.SubsetCount = os::Byteswap::byteswap(Header.SubsetCount); - Header.TriangleCount = os::Byteswap::byteswap(Header.TriangleCount); - Header.SubsetSize = os::Byteswap::byteswap(Header.SubsetSize); - Header.VertexSize = os::Byteswap::byteswap(Header.VertexSize); - } - if (Header.MagicID != 0x53544D4C) { // "LMTS" - os::Printer::log("LMTS ERROR: wrong header magic id!", ELL_ERROR); - return 0; - } - - //Skip any User Data (arbitrary app specific data) - - const s32 userSize = Header.HeaderSize - sizeof(SLMTSHeader); - if (userSize>0) - file->seek(userSize,true); - - // TEXTURES - - file->read(&id, sizeof(u32)); - if (FlipEndianess) - id = os::Byteswap::byteswap(id); - if (id != 0x54584554) { // "TEXT" - os::Printer::log("LMTS ERROR: wrong texture magic id!", ELL_ERROR); - return 0; - } - - Textures = new SLMTSTextureInfoEntry[Header.TextureCount]; - - file->read(Textures, sizeof(SLMTSTextureInfoEntry)*Header.TextureCount); - if (FlipEndianess) - { - for (i=0; i<Header.TextureCount; ++i) - Textures[i].Flags = os::Byteswap::byteswap(Textures[i].Flags); - } - - // SUBSETS - - file->read(&id, sizeof(u32)); - if (FlipEndianess) - id = os::Byteswap::byteswap(id); - if (id != 0x53425553) // "SUBS" - { - os::Printer::log("LMTS ERROR: wrong subset magic id!", ELL_ERROR); - cleanup(); - return 0; - } - - Subsets = new SLMTSSubsetInfoEntry[Header.SubsetCount]; - const s32 subsetUserSize = Header.SubsetSize - sizeof(SLMTSSubsetInfoEntry); - - for (i=0; i<Header.SubsetCount; ++i) - { - file->read(&Subsets[i], sizeof(SLMTSSubsetInfoEntry)); - if (FlipEndianess) - { - Subsets[i].Offset = os::Byteswap::byteswap(Subsets[i].Offset); - Subsets[i].Count = os::Byteswap::byteswap(Subsets[i].Count); - Subsets[i].TextID1 = os::Byteswap::byteswap(Subsets[i].TextID1); - Subsets[i].TextID2 = os::Byteswap::byteswap(Subsets[i].TextID2); - } - if (subsetUserSize>0) - file->seek(subsetUserSize,true); - } - - // TRIANGLES - - file->read(&id, sizeof(u32)); - if (FlipEndianess) - id = os::Byteswap::byteswap(id); - if (id != 0x53495254) // "TRIS" - { - os::Printer::log("LMTS ERROR: wrong triangle magic id!", ELL_ERROR); - cleanup(); - return 0; - } - - Triangles = new SLMTSTriangleDataEntry[(Header.TriangleCount*3)]; - const s32 triUserSize = Header.VertexSize - sizeof(SLMTSTriangleDataEntry); - - for (i=0; i<(Header.TriangleCount*3); ++i) - { - file->read(&Triangles[i], sizeof(SLMTSTriangleDataEntry)); - if (FlipEndianess) - { - Triangles[i].X = os::Byteswap::byteswap(Triangles[i].X); - Triangles[i].Y = os::Byteswap::byteswap(Triangles[i].Y); - Triangles[i].Z = os::Byteswap::byteswap(Triangles[i].Z); - Triangles[i].U1 = os::Byteswap::byteswap(Triangles[i].U1); - Triangles[i].V1 = os::Byteswap::byteswap(Triangles[i].U2); - Triangles[i].U2 = os::Byteswap::byteswap(Triangles[i].V1); - Triangles[i].V2 = os::Byteswap::byteswap(Triangles[i].V2); - } - if (triUserSize>0) - file->seek(triUserSize,true); - } - - ///////////////////////////////////////////////////////////////// - - SMesh* mesh = new SMesh(); - - constructMesh(mesh); - - loadTextures(mesh); - - cleanup(); - - SAnimatedMesh* am = new SAnimatedMesh(); - am->Type = EAMT_LMTS; // not unknown to irrlicht anymore - - am->addMesh(mesh); - am->recalculateBoundingBox(); - mesh->drop(); - return am; -} - - -void CLMTSMeshFileLoader::constructMesh(SMesh* mesh) -{ - for (s32 i=0; i<Header.SubsetCount; ++i) - { - scene::SMeshBufferLightMap* meshBuffer = new scene::SMeshBufferLightMap(); - - // EMT_LIGHTMAP_M2/EMT_LIGHTMAP_M4 also possible - meshBuffer->Material.MaterialType = video::EMT_LIGHTMAP; - meshBuffer->Material.Wireframe = false; - meshBuffer->Material.Lighting = false; - - mesh->addMeshBuffer(meshBuffer); - - const u32 offs = Subsets[i].Offset * 3; - - for (u32 sc=0; sc<Subsets[i].Count; sc++) - { - const u32 idx = meshBuffer->getVertexCount(); - - for (u32 vu=0; vu<3; ++vu) - { - const SLMTSTriangleDataEntry& v = Triangles[offs+(3*sc)+vu]; - meshBuffer->Vertices.push_back( - video::S3DVertex2TCoords( - v.X, v.Y, v.Z, - video::SColor(255,255,255,255), - v.U1, v.V1, v.U2, v.V2)); - } - const core::vector3df normal = core::plane3df( - meshBuffer->Vertices[idx].Pos, - meshBuffer->Vertices[idx+1].Pos, - meshBuffer->Vertices[idx+2].Pos).Normal; - - meshBuffer->Vertices[idx].Normal = normal; - meshBuffer->Vertices[idx+1].Normal = normal; - meshBuffer->Vertices[idx+2].Normal = normal; - - meshBuffer->Indices.push_back(idx); - meshBuffer->Indices.push_back(idx+1); - meshBuffer->Indices.push_back(idx+2); - } - meshBuffer->drop(); - } - - for (u32 j=0; j<mesh->MeshBuffers.size(); ++j) - mesh->MeshBuffers[j]->recalculateBoundingBox(); - - mesh->recalculateBoundingBox(); -} - - -void CLMTSMeshFileLoader::loadTextures(SMesh* mesh) -{ - if (!Driver || !FileSystem) - return; - - // load textures - - // a little too much space, but won't matter here - core::array<video::ITexture*> tex; - tex.reallocate(Header.TextureCount); - core::array<video::ITexture*> lig; - lig.reallocate(Header.TextureCount); - core::array<u32> id2id; - id2id.reallocate(Header.TextureCount); - - if ( getMeshTextureLoader() ) - { - if ( Parameters->existsAttribute(LMTS_TEXTURE_PATH) ) - getMeshTextureLoader()->setTexturePath(Parameters->getAttributeAsString(LMTS_TEXTURE_PATH)); - } - - core::stringc s; - for (u32 t=0; t<Header.TextureCount; ++t) - { - video::ITexture* tmptex = getMeshTextureLoader() ? getMeshTextureLoader()->getTexture(Textures[t].Filename) : NULL; - if ( !tmptex ) - { - os::Printer::log("LMTS WARNING: Texture does not exist", s.c_str(), ELL_WARNING); - } - - if (Textures[t].Flags & 0x01) - { - id2id.push_back(lig.size()); - lig.push_back(tmptex); - } - else - { - id2id.push_back(tex.size()); - tex.push_back(tmptex); - } - } - - // attach textures to materials. - - for (u32 i=0; i<Header.SubsetCount; ++i) - { - if (Subsets[i].TextID1 < Header.TextureCount && id2id[Subsets[i].TextID1] < tex.size()) - mesh->getMeshBuffer(i)->getMaterial().setTexture(0, tex[id2id[Subsets[i].TextID1]]); - if (Subsets[i].TextID2 < Header.TextureCount && id2id[Subsets[i].TextID2] < lig.size()) - mesh->getMeshBuffer(i)->getMaterial().setTexture(1, lig[id2id[Subsets[i].TextID2]]); - - if (!mesh->getMeshBuffer(i)->getMaterial().getTexture(1)) - mesh->getMeshBuffer(i)->getMaterial().MaterialType = video::EMT_SOLID; - } -} - - -} // end namespace scene -} // end namespace irr - -#endif // _IRR_COMPILE_WITH_LMTS_LOADER_ diff --git a/source/Irrlicht/CLMTSMeshFileLoader.h b/source/Irrlicht/CLMTSMeshFileLoader.h deleted file mode 100644 index b607f910..00000000 --- a/source/Irrlicht/CLMTSMeshFileLoader.h +++ /dev/null @@ -1,109 +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 -// -// I (Nikolaus Gebhardt) did some few changes to Jonas Petersen's original loader: -// - removed setTexturePath() and replaced with the ISceneManager::getStringParameter()-stuff. -// - added EAMT_LMTS enumeration value -// Thanks a lot to Jonas Petersen for his work -// on this and that he gave me his permission to add it into Irrlicht. -/* - -CLMTSMeshFileLoader.h - -LMTSMeshFileLoader -Written by Jonas Petersen (a.k.a. jox) - -Version 1.5 - 15 March 2005 - -*/ - -#if !defined(__C_LMTS_MESH_FILE_LOADER_H_INCLUDED__) -#define __C_LMTS_MESH_FILE_LOADER_H_INCLUDED__ - -#include "IMeshLoader.h" -#include "SMesh.h" -#include "IFileSystem.h" -#include "IVideoDriver.h" - -namespace irr -{ -namespace scene -{ - -class CLMTSMeshFileLoader : public IMeshLoader -{ -public: - - CLMTSMeshFileLoader(io::IFileSystem* fs, - video::IVideoDriver* driver, io::IAttributes* parameters); - - virtual ~CLMTSMeshFileLoader(); - - virtual bool isALoadableFileExtension(const io::path& filename) const _IRR_OVERRIDE_; - - virtual IAnimatedMesh* createMesh(io::IReadFile* file) _IRR_OVERRIDE_; - -private: - void constructMesh(SMesh* mesh); - void loadTextures(SMesh* mesh); - void cleanup(); - -// byte-align structures -#include "irrpack.h" - - struct SLMTSHeader - { - u32 MagicID; - u32 Version; - u32 HeaderSize; - u16 TextureCount; - u16 SubsetCount; - u32 TriangleCount; - u16 SubsetSize; - u16 VertexSize; - } PACK_STRUCT; - - struct SLMTSTextureInfoEntry - { - c8 Filename[256]; - u16 Flags; - } PACK_STRUCT; - - struct SLMTSSubsetInfoEntry - { - u32 Offset; - u32 Count; - u16 TextID1; - u16 TextID2; - } PACK_STRUCT; - - struct SLMTSTriangleDataEntry - { - f32 X; - f32 Y; - f32 Z; - f32 U1; - f32 V1; - f32 U2; - f32 V2; - } PACK_STRUCT; - -// Default alignment -#include "irrunpack.h" - - SLMTSHeader Header; - SLMTSTextureInfoEntry* Textures; - SLMTSSubsetInfoEntry* Subsets; - SLMTSTriangleDataEntry* Triangles; - - io::IAttributes* Parameters; - video::IVideoDriver* Driver; - io::IFileSystem* FileSystem; - bool FlipEndianess; -}; - -} // end namespace scene -} // end namespace irr - -#endif // !defined(__C_LMTS_MESH_FILE_LOADER_H_INCLUDED__) diff --git a/source/Irrlicht/CLWOMeshFileLoader.cpp b/source/Irrlicht/CLWOMeshFileLoader.cpp deleted file mode 100644 index ce158440..00000000 --- a/source/Irrlicht/CLWOMeshFileLoader.cpp +++ /dev/null @@ -1,2115 +0,0 @@ -// Copyright (C) 2007-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_LWO_LOADER_ - -#include "CLWOMeshFileLoader.h" -#include "CMeshTextureLoader.h" -#include "os.h" -#include "SAnimatedMesh.h" -#include "SMesh.h" -#include "IReadFile.h" -#include "ISceneManager.h" -#include "IFileSystem.h" -#include "IVideoDriver.h" -#include "IMeshManipulator.h" - -namespace irr -{ -namespace scene -{ - -#ifdef _DEBUG -#define LWO_READER_DEBUG -#endif - -#define charsToUIntD(a, b, c, d) ((a << 24) | (b << 16) | (c << 8) | d) -inline unsigned int charsToUInt(const char *str) -{ - return (str[0] << 24) | (str[1] << 16) | (str[2] << 8) | str[3]; -} - - -struct tLWOTextureInfo -{ - tLWOTextureInfo() : UVTag(0), DUVTag(0), Flags(0), WidthWrap(2), - HeightWrap(2), OpacType(0), Color(0xffffffff), - Value(0.0f), AntiAliasing(1.0f), Opacity(1.0f), - Axis(255), Projection(0), Active(false) {} - core::stringc Type; - core::stringc Map; - core::stringc AlphaMap; - core::stringc UVname; - u16 UVTag; - u16 DUVTag; - u16 Flags; - u16 WidthWrap; - u16 HeightWrap; - u16 OpacType; - u16 IParam[3]; - core::vector3df Size; - core::vector3df Center; - core::vector3df Falloff; - core::vector3df Velocity; - video::SColor Color; - f32 Value; - f32 AntiAliasing; - f32 Opacity; - f32 FParam[3]; - u8 Axis; - u8 Projection; - bool Active; -}; - -struct CLWOMeshFileLoader::tLWOMaterial -{ - tLWOMaterial() : Meshbuffer(0), TagType(0), Flags(0), ReflMode(3), TranspMode(3), - Glow(0), AlphaMode(2), Luminance(0.0f), Diffuse(1.0f), Specular(0.0f), - Reflection(0.0f), Transparency(0.0f), Translucency(0.0f), - Sharpness(0.0f), ReflSeamAngle(0.0f), ReflBlur(0.0f), - RefrIndex(1.0f), TranspBlur(0.0f), SmoothingAngle(0.0f), - EdgeTransparency(0.0f), HighlightColor(0.0f), ColorFilter(0.0f), - AdditiveTransparency(0.0f), GlowIntensity(0.0f), GlowSize(0.0f), - AlphaValue(0.0f), VertexColorIntensity(0.0f), VertexColor() {} - - core::stringc Name; - scene::SMeshBuffer *Meshbuffer; - core::stringc ReflMap; - u16 TagType; - u16 Flags; - u16 ReflMode; - u16 TranspMode; - u16 Glow; - u16 AlphaMode; - f32 Luminance; - f32 Diffuse; - f32 Specular; - f32 Reflection; - f32 Transparency; - f32 Translucency; - f32 Sharpness; - f32 ReflSeamAngle; - f32 ReflBlur; - f32 RefrIndex; - f32 TranspBlur; - f32 SmoothingAngle; - f32 EdgeTransparency; - f32 HighlightColor; - f32 ColorFilter; - f32 AdditiveTransparency; - f32 GlowIntensity; - f32 GlowSize; - f32 AlphaValue; - f32 VertexColorIntensity; - video::SColorf VertexColor; - u32 Envelope[23]; - tLWOTextureInfo Texture[7]; -}; - -struct tLWOLayerInfo -{ - u16 Number; - u16 Parent; - u16 Flags; - bool Active; - core::stringc Name; - core::vector3df Pivot; -}; - - -//! Constructor -CLWOMeshFileLoader::CLWOMeshFileLoader(scene::ISceneManager* smgr, - io::IFileSystem* fs) -: SceneManager(smgr), FileSystem(fs), File(0), Mesh(0) -{ - #ifdef _DEBUG - setDebugName("CLWOMeshFileLoader"); - #endif - - TextureLoader = new CMeshTextureLoader( FileSystem, SceneManager->getVideoDriver() ); -} - - -//! destructor -CLWOMeshFileLoader::~CLWOMeshFileLoader() -{ - if (Mesh) - Mesh->drop(); -} - - -//! returns true if the file maybe is able to be loaded by this class -//! based on the file extension (e.g. ".bsp") -bool CLWOMeshFileLoader::isALoadableFileExtension(const io::path& filename) const -{ - return core::hasFileExtension(filename, "lwo"); -} - - -//! creates/loads an animated mesh from the file. -IAnimatedMesh* CLWOMeshFileLoader::createMesh(io::IReadFile* file) -{ - if ( getMeshTextureLoader() ) - getMeshTextureLoader()->setMeshFile(file); - - File = file; - - if (Mesh) - Mesh->drop(); - - Mesh = new SMesh(); - - if (!readFileHeader()) - return 0; - - if (!readChunks()) - return 0; - -#ifdef LWO_READER_DEBUG - os::Printer::log("LWO loader: Creating geometry."); - os::Printer::log("LWO loader: Assigning UV maps."); -#endif - for (u32 i=0; i<Materials.size(); ++i) - { - u16 uvTag; - for (u32 j=0; j<2; ++j) // max 2 texture coords - { - if (Materials[i]->Texture[j].UVname.size()) - { - for (uvTag=0; uvTag<UvName.size(); ++uvTag) - { - if (Materials[i]->Texture[j].UVname == UvName[uvTag]) - { - Materials[i]->Texture[j].UVTag=uvTag; - break; - } - } - for (uvTag=0; uvTag<DUvName.size(); ++uvTag) - { - if (Materials[i]->Texture[j].UVname == DUvName[uvTag]) - { - Materials[i]->Texture[j].DUVTag=uvTag; - break; - } - } - } - } - } -#ifdef LWO_READER_DEBUG - os::Printer::log("LWO loader: Creating polys."); -#endif - // create actual geometry for lwo2 - if (FormatVersion==2) - { - core::array<u32> vertexCount; - vertexCount.reallocate(Materials.size()); - for (u32 i=0; i<Materials.size(); ++i) - vertexCount.push_back(0); - for (u32 polyIndex=0; polyIndex<Indices.size(); ++polyIndex) - vertexCount[MaterialMapping[polyIndex]] += Indices[polyIndex].size(); - for (u32 i=0; i<Materials.size(); ++i) - { - Materials[i]->Meshbuffer->Vertices.reallocate(vertexCount[i]); - Materials[i]->Meshbuffer->Indices.reallocate(vertexCount[i]); - } - } - // create actual geometry for lwo2 - for (u32 polyIndex=0; polyIndex<Indices.size(); ++polyIndex) - { - const u16 tag = MaterialMapping[polyIndex]; - scene::SMeshBuffer *mb=Materials[tag]->Meshbuffer; - const core::array<u32>& poly = Indices[polyIndex]; - const u32 polySize=poly.size(); - const u16 uvTag = Materials[tag]->Texture[0].UVTag; - const u16 duvTag = Materials[tag]->Texture[0].DUVTag; - video::S3DVertex vertex; - vertex.Color=0xffffffff; - const u32 vertCount=mb->Vertices.size(); - for (u32 i=0; i<polySize; ++i) - { - const u32 j=poly[i]; - vertex.Pos=Points[j]; - if (uvTag<UvIndex.size()) - { - for (u32 uvsearch=0; uvsearch < UvIndex[uvTag].size(); ++uvsearch) - { - if(j==UvIndex[uvTag][uvsearch]) - { - vertex.TCoords=TCoords[uvTag][uvsearch]; - break; - } - } - if (duvTag<DUvName.size()) - { - for (u32 polysearch = 0; polysearch < VmPolyPointsIndex[duvTag].size(); polysearch += 2) - { - if (polyIndex==VmPolyPointsIndex[duvTag][polysearch] && j==VmPolyPointsIndex[duvTag][polysearch+1]) - { - vertex.TCoords=VmCoordsIndex[duvTag][polysearch/2]; - break; - } - } - } - } - mb->Vertices.push_back(vertex); - } - // triangulate as trifan - if (polySize>2) - { - for (u32 i=1; i<polySize-1; ++i) - { - mb->Indices.push_back(vertCount); - mb->Indices.push_back(vertCount+i); - mb->Indices.push_back(vertCount+i+1); - } - } - } -#ifdef LWO_READER_DEBUG - os::Printer::log("LWO loader: Fixing meshbuffers."); -#endif - for (u32 i=0; i<Materials.size(); ++i) - { -#ifdef LWO_READER_DEBUG - os::Printer::log("LWO loader: Material name", Materials[i]->Name); - os::Printer::log("LWO loader: Vertex count", core::stringc(Materials[i]->Meshbuffer->Vertices.size())); -#endif - if (!Materials[i]->Meshbuffer->Vertices.size()) - { - Materials[i]->Meshbuffer->drop(); - delete Materials[i]; - continue; - } - for (u32 j=0; j<Materials[i]->Meshbuffer->Vertices.size(); ++j) - Materials[i]->Meshbuffer->Vertices[j].Color=Materials[i]->Meshbuffer->Material.DiffuseColor; - Materials[i]->Meshbuffer->recalculateBoundingBox(); - - // load textures - video::SMaterial& irrMat=Materials[i]->Meshbuffer->Material; - if (Materials[i]->Texture[0].Map != "") // diffuse - irrMat.setTexture(0,loadTexture(Materials[i]->Texture[0].Map)); - if (Materials[i]->Texture[3].Map != "") // reflection - { -#ifdef LWO_READER_DEBUG - os::Printer::log("LWO loader: loading reflection texture."); -#endif - video::ITexture* reflTexture = loadTexture(Materials[i]->Texture[3].Map); - if (reflTexture && irrMat.getTexture(0)) - irrMat.setTexture(1, irrMat.getTexture(0)); - irrMat.setTexture(0, reflTexture); - irrMat.MaterialType=video::EMT_REFLECTION_2_LAYER; - } - if (Materials[i]->Texture[4].Map != "") // transparency - { -#ifdef LWO_READER_DEBUG - os::Printer::log("LWO loader: loading transparency texture."); -#endif - video::ITexture* transTexture = loadTexture(Materials[i]->Texture[4].Map); - if (transTexture && irrMat.getTexture(0)) - irrMat.setTexture(1, irrMat.getTexture(0)); - irrMat.setTexture(0, transTexture); - irrMat.MaterialType=video::EMT_TRANSPARENT_ADD_COLOR; - } - if (Materials[i]->Texture[6].Map != "") // bump - { -#ifdef LWO_READER_DEBUG - os::Printer::log("LWO loader: loading bump texture."); -#endif - const u8 pos = irrMat.getTexture(0)?1:0; - irrMat.setTexture(pos, loadTexture(Materials[i]->Texture[6].Map)); - if (irrMat.getTexture(pos)) - { - // SceneManager->getVideoDriver()->makeNormalMapTexture(irrMat.getTexture(1)); - // irrMat.MaterialType=video::EMT_NORMAL_MAP_SOLID; - } - } - - // cope with planar mapping texture coords - if (Materials[i]->Texture[0].Projection != 5) - { - if (FormatVersion!=2) - { - if (Materials[i]->Texture[0].Flags&1) - Materials[i]->Texture[0].Axis=0; - else if (Materials[i]->Texture[0].Flags&2) - Materials[i]->Texture[0].Axis=1; - else if (Materials[i]->Texture[0].Flags&4) - Materials[i]->Texture[0].Axis=2; - } - // if no axis given choose the dominant one - else if (Materials[i]->Texture[0].Axis>2) - { - if (Materials[i]->Meshbuffer->getBoundingBox().getExtent().Y<Materials[i]->Meshbuffer->getBoundingBox().getExtent().X) - { - if (Materials[i]->Meshbuffer->getBoundingBox().getExtent().Y<Materials[i]->Meshbuffer->getBoundingBox().getExtent().Z) - Materials[i]->Texture[0].Axis=1; - else - Materials[i]->Texture[0].Axis=2; - } - else - { - if (Materials[i]->Meshbuffer->getBoundingBox().getExtent().X<Materials[i]->Meshbuffer->getBoundingBox().getExtent().Z) - Materials[i]->Texture[0].Axis=0; - else - Materials[i]->Texture[0].Axis=2; - } - } - // get the resolution for this axis - f32 resolutionS = core::reciprocal(Materials[i]->Texture[0].Size.Z); - f32 resolutionT = core::reciprocal(Materials[i]->Texture[0].Size.Y); - if (Materials[i]->Texture[0].Axis==1) - { - resolutionS = core::reciprocal(Materials[i]->Texture[0].Size.X); - resolutionT = core::reciprocal(Materials[i]->Texture[0].Size.Z); - } - else if (Materials[i]->Texture[0].Axis==2) - { - resolutionS = core::reciprocal(Materials[i]->Texture[0].Size.X); - resolutionT = core::reciprocal(Materials[i]->Texture[0].Size.Y); - } - // use the two-way planar mapping - SceneManager->getMeshManipulator()->makePlanarTextureMapping(Materials[i]->Meshbuffer, resolutionS, resolutionT, Materials[i]->Texture[0].Axis, Materials[i]->Texture[0].Center); - } - - // add bump maps - if (Materials[i]->Meshbuffer->Material.MaterialType==video::EMT_NORMAL_MAP_SOLID) - { - SMesh* tmpmesh = new SMesh(); - tmpmesh->addMeshBuffer(Materials[i]->Meshbuffer); - SceneManager->getMeshManipulator()->createMeshWithTangents(tmpmesh, true, true); - Mesh->addMeshBuffer(tmpmesh->getMeshBuffer(0)); - tmpmesh->getMeshBuffer(0)->drop(); - tmpmesh->drop(); - } - else - { - SceneManager->getMeshManipulator()->recalculateNormals(Materials[i]->Meshbuffer); - Mesh->addMeshBuffer(Materials[i]->Meshbuffer); - } - Materials[i]->Meshbuffer->drop(); - // clear the material array elements - delete Materials[i]; - } - Mesh->recalculateBoundingBox(); - - SAnimatedMesh* am = new SAnimatedMesh(); - am->Type = EAMT_3DS; - am->addMesh(Mesh); - am->recalculateBoundingBox(); - Mesh->drop(); - Mesh = 0; - - Points.clear(); - Indices.clear(); - MaterialMapping.clear(); - TCoords.clear(); - Materials.clear(); - Images.clear(); - VmPolyPointsIndex.clear(); - VmCoordsIndex.clear(); - UvIndex.clear(); - UvName.clear(); - - return am; -} - - -bool CLWOMeshFileLoader::readChunks() -{ - s32 lastPos; - u32 size; - unsigned int uiType; - char type[5]; - type[4]=0; - tLWOLayerInfo layer; - - while(File->getPos()<File->getSize()) - { - File->read(&type, 4); - //Convert 4-char string to 4-byte integer - //Makes it possible to do a switch statement - uiType = charsToUInt(type); - File->read(&size, 4); -#ifndef __BIG_ENDIAN__ - size=os::Byteswap::byteswap(size); -#endif - lastPos=File->getPos(); - - switch(uiType) - { - case charsToUIntD('L','A','Y','R'): - { -#ifdef LWO_READER_DEBUG - os::Printer::log("LWO loader: loading layer."); -#endif - u16 tmp16; - File->read(&tmp16, 2); // number - File->read(&tmp16, 2); // flags - size -= 4; -#ifndef __BIG_ENDIAN__ - tmp16=os::Byteswap::byteswap(tmp16); -#endif - if (((FormatVersion==1)&&(tmp16!=1)) || - ((FormatVersion==2)&&(tmp16&1))) - layer.Active=false; - else - layer.Active=true; - if (FormatVersion==2) - size -= readVec(layer.Pivot); - size -= readString(layer.Name); - if (size) - { - File->read(&tmp16, 2); -#ifndef __BIG_ENDIAN__ - tmp16=os::Byteswap::byteswap(tmp16); -#endif - layer.Parent = tmp16; - } - } - break; - case charsToUIntD('P','N','T','S'): - { -#ifdef LWO_READER_DEBUG - os::Printer::log("LWO loader: loading points."); -#endif - core::vector3df vec; - Points.clear(); - const u32 tmpsize = size/12; - Points.reallocate(tmpsize); - for (u32 i=0; i<tmpsize; ++i) - { - readVec(vec); - Points.push_back(vec); - } - } - break; - case charsToUIntD('V','M','A','P'): -#ifdef LWO_READER_DEBUG - os::Printer::log("LWO loader: loading Vertex mapping."); -#endif - readVertexMapping(size); - break; - case charsToUIntD('P','O','L','S'): - case charsToUIntD('P','T','C','H'): // TODO: should be a subdivison mesh -#ifdef LWO_READER_DEBUG - os::Printer::log("LWO loader: loading polygons."); -#endif - if (FormatVersion!=2) - readObj1(size); - else - readObj2(size); -#ifdef LWO_READER_DEBUG - os::Printer::log("LWO loader: Done loading polygons."); -#endif - break; - case charsToUIntD('T','A','G','S'): - case charsToUIntD('S','R','F','S'): - { -#ifdef LWO_READER_DEBUG - os::Printer::log("LWO loader: loading surface names."); -#endif - while (size!=0) - { - tLWOMaterial *mat=new tLWOMaterial(); - mat->Name=""; - mat->Meshbuffer=new scene::SMeshBuffer(); - size -= readString(mat->Name); - if (FormatVersion!=2) - mat->TagType = 1; // format 2 has more types - Materials.push_back(mat); - } - } - break; - case charsToUIntD('P','T','A','G'): -#ifdef LWO_READER_DEBUG - os::Printer::log("LWO loader: loading tag mapping."); -#endif - readTagMapping(size); - break; - case charsToUIntD('V','M','A','D'): // discontinuous vertex mapping, i.e. additional texcoords -#ifdef LWO_READER_DEBUG - os::Printer::log("LWO loader: loading Vertex mapping VMAD."); -#endif - readDiscVertexMapping(size); -// case charsToUIntD('V','M','P','A'): -// case charsToUIntD('E','N','V','L'): - break; - case charsToUIntD('C','L','I','P'): - { -#ifdef LWO_READER_DEBUG - os::Printer::log("LWO loader: loading clips."); -#endif - u32 index; - u16 subsize; - File->read(&index, 4); -#ifndef __BIG_ENDIAN__ - index=os::Byteswap::byteswap(index); -#endif - size -= 4; - while (size != 0) - { - File->read(&type, 4); - File->read(&subsize, 2); -#ifndef __BIG_ENDIAN__ - subsize=os::Byteswap::byteswap(subsize); -#endif - size -= 6; - if (strncmp(type, "STIL", 4)) - { - File->seek(subsize, true); - size -= subsize; - continue; - } - core::stringc path; - size -= readString(path, subsize); - #ifdef LWO_READER_DEBUG - os::Printer::log("LWO loader: loaded clip", path.c_str()); - #endif - Images.push_back(path); - } - } - break; - case charsToUIntD('S','U','R','F'): -#ifdef LWO_READER_DEBUG - os::Printer::log("LWO loader: loading material."); -#endif - readMat(size); - break; - case charsToUIntD('B','B','O','X'): - { -#ifdef LWO_READER_DEBUG - os::Printer::log("LWO loader: loading bbox."); -#endif - // not stored - core::vector3df vec; - for (u32 i=0; i<2; ++i) - readVec(vec); - size -= 24; - } - break; - case charsToUIntD('D','E','S','C'): - case charsToUIntD('T','E','X','T'): - { - core::stringc text; - size -= readString(text, size); -#ifdef LWO_READER_DEBUG - os::Printer::log("LWO loader text", text); -#endif - } - break; - // not needed - case charsToUIntD('I','C','O','N'): - // not yet supported - case charsToUIntD('P','C','H','S'): - case charsToUIntD('C','R','V','S'): - default: -#ifdef LWO_READER_DEBUG - os::Printer::log("LWO loader: skipping ", type); -#endif - //Go to next chunk - File->seek(lastPos + size, false); - break; - } - } - return true; -} - - -void CLWOMeshFileLoader::readObj1(u32 size) -{ - u32 pos; - u16 numVerts, vertIndex; - s16 material; - video::S3DVertex vertex; - vertex.Color=0xffffffff; - - while (size!=0) - { - File->read(&numVerts, 2); -#ifndef __BIG_ENDIAN__ - numVerts=os::Byteswap::byteswap(numVerts); -#endif - pos=File->getPos(); - // skip forward to material number - File->seek(2*numVerts, true); - File->read(&material, 2); -#ifndef __BIG_ENDIAN__ - material=os::Byteswap::byteswap(material); -#endif - size -=2*numVerts+4; - // detail meshes ? - scene::SMeshBuffer *mb; - if (material<0) - mb=Materials[-material-1]->Meshbuffer; - else - mb=Materials[material-1]->Meshbuffer; - // back to vertex list start - File->seek(pos, false); - - const u16 vertCount=mb->Vertices.size(); - for (u16 i=0; i<numVerts; ++i) - { - File->read(&vertIndex, 2); -#ifndef __BIG_ENDIAN__ - vertIndex=os::Byteswap::byteswap(vertIndex); -#endif - vertex.Pos=Points[vertIndex]; - mb->Vertices.push_back(vertex); - } - for (u16 i=1; i<numVerts-1; ++i) - { - mb->Indices.push_back(vertCount); - mb->Indices.push_back(vertCount+i); - mb->Indices.push_back(vertCount+i+1); - } - // skip material number and detail surface count - // detail surface can be read just as a normal one now - if (material<0) - File->read(&material, 2); - File->read(&material, 2); - } -} - - -void CLWOMeshFileLoader::readVertexMapping(u32 size) -{ - char type[5]={0}; - u16 dimension; - core::stringc name; - File->read(&type, 4); -#ifdef LWO_READER_DEBUG - os::Printer::log("LWO loader: Vertex map type", type); -#endif - File->read(&dimension,2); -#ifndef __BIG_ENDIAN__ - dimension=os::Byteswap::byteswap(dimension); -#endif - size -= 6; - size -= readString(name); -#ifdef LWO_READER_DEBUG - os::Printer::log("LWO loader: Vertex map", name.c_str()); -#endif - if (strncmp(type, "TXUV", 4)) // also support RGB, RGBA, WGHT, ... - { - File->seek(size, true); - return; - } - UvName.push_back(name); - - TCoords.push_back(core::array<core::vector2df>()); - core::array<core::vector2df>& UvCoords=TCoords.getLast(); - UvCoords.reallocate(Points.size()); - UvIndex.push_back(core::array<u32>()); - core::array<u32>& UvPointsArray=UvIndex.getLast(); - UvPointsArray.reallocate(Points.size()); - - u32 index; - core::vector2df tcoord; - while (size) - { - size -= readVX(index); - File->read(&tcoord.X, 4); - File->read(&tcoord.Y, 4); - size -= 8; -#ifndef __BIG_ENDIAN__ - index=os::Byteswap::byteswap(index); - tcoord.X=os::Byteswap::byteswap(tcoord.X); - tcoord.Y=os::Byteswap::byteswap(tcoord.Y); -#endif - UvCoords.push_back(tcoord); - UvPointsArray.push_back(index); - } -#ifdef LWO_READER_DEBUG - os::Printer::log("LWO loader: UvCoords", core::stringc(UvCoords.size())); -#endif -} - - -void CLWOMeshFileLoader::readDiscVertexMapping(u32 size) -{ - char type[5]={0}; - u16 dimension; - core::stringc name; - File->read(&type, 4); -#ifdef LWO_READER_DEBUG - os::Printer::log("LWO loader: Discontinuous vertex map type", type); -#endif - File->read(&dimension,2); -#ifndef __BIG_ENDIAN__ - dimension=os::Byteswap::byteswap(dimension); -#endif - size -= 6; - size -= readString(name); -#ifdef LWO_READER_DEBUG - os::Printer::log("LWO loader: Discontinuous vertex map", name.c_str()); -#endif - if (strncmp(type, "TXUV", 4)) - { - File->seek(size, true); - return; - } - DUvName.push_back(name); - VmPolyPointsIndex.push_back(core::array<u32>()); - core::array<u32>& VmPolyPoints=VmPolyPointsIndex.getLast(); - - VmCoordsIndex.push_back(core::array<core::vector2df>()); - core::array<core::vector2df>& VmCoords=VmCoordsIndex.getLast(); - - u32 vmpolys; - u32 vmpoints; - core::vector2df vmcoords; - while (size) - { - size-=readVX(vmpoints); - size-=readVX(vmpolys); - File->read(&vmcoords.X, 4); - File->read(&vmcoords.Y, 4); - size -= 8; -#ifndef __BIG_ENDIAN__ - vmpoints=os::Byteswap::byteswap(vmpoints); - vmpolys=os::Byteswap::byteswap(vmpolys); - vmcoords.X=os::Byteswap::byteswap(vmcoords.X); - vmcoords.Y=os::Byteswap::byteswap(vmcoords.Y); -#endif - VmCoords.push_back(vmcoords); - VmPolyPoints.push_back(vmpolys); - VmPolyPoints.push_back(vmpoints); - } -#ifdef LWO_READER_DEBUG - os::Printer::log("LWO loader: VmCoords", core::stringc(VmCoords.size())); -#endif -} - - -void CLWOMeshFileLoader::readTagMapping(u32 size) -{ - char type[5]; - type[4]=0; - File->read(&type, 4); - size -= 4; - if ((strncmp(type, "SURF", 4))||(Indices.size()==0)) - { - File->seek(size, true); - return; - } - - while (size!=0) - { - u16 tag; - u32 polyIndex; - size-=readVX(polyIndex); - File->read(&tag, 2); -#ifndef __BIG_ENDIAN__ - tag=os::Byteswap::byteswap(tag); -#endif - size -= 2; - MaterialMapping[polyIndex]=tag; - Materials[tag]->TagType=1; - } -} - - -void CLWOMeshFileLoader::readObj2(u32 size) -{ - char type[5]; - type[4]=0; - File->read(&type, 4); - size -= 4; - Indices.clear(); - if (strncmp(type, "FACE", 4)) // also possible are splines, subdivision patches, metaballs, and bones - { - File->seek(size, true); - return; - } - u16 numVerts=0; - while (size!=0) - { - File->read(&numVerts, 2); -#ifndef __BIG_ENDIAN__ - numVerts=os::Byteswap::byteswap(numVerts); -#endif - // mask out flags - numVerts &= 0x03FF; - - size -= 2; - Indices.push_back(core::array<u32>()); - u32 vertIndex; - core::array<u32>& polyArray = Indices.getLast(); - polyArray.reallocate(numVerts); - for (u16 i=0; i<numVerts; ++i) - { - size -= readVX(vertIndex); - polyArray.push_back(vertIndex); - } - } - MaterialMapping.reallocate(Indices.size()); - for (u32 j=0; j<Indices.size(); ++j) - MaterialMapping.push_back(0); -} - - -void CLWOMeshFileLoader::readMat(u32 size) -{ - core::stringc name; - - tLWOMaterial* mat=0; - size -= readString(name); -#ifdef LWO_READER_DEBUG - os::Printer::log("LWO loader: material name", name.c_str()); -#endif - for (u32 i=0; i<Materials.size(); ++i) - { - if ((Materials[i]->TagType==1) && (Materials[i]->Name==name)) - { - mat=Materials[i]; - break; - } - } - if (!mat) - { - File->seek(size, true); - return; - } - if (FormatVersion==2) - size -= readString(name); - - video::SMaterial& irrMat=mat->Meshbuffer->Material; - - u8 currTexture=0; - while (size!=0) - { - char type[5]; - type[4]=0; - u32 uiType; - u32 tmp32; - u16 subsize, tmp16; - f32 tmpf32; - File->read(&type, 4); - //Convert 4-char string to 4-byte integer - //Makes it possible to do a switch statement - uiType = charsToUInt(type); - File->read(&subsize, 2); -#ifndef __BIG_ENDIAN__ - subsize=os::Byteswap::byteswap(subsize); -#endif - size -= 6; - switch (uiType) - { - case charsToUIntD('C','O','L','R'): -#ifdef LWO_READER_DEBUG - os::Printer::log("LWO loader: loading Ambient color."); -#endif - { - s32 colSize = readColor(irrMat.DiffuseColor); - irrMat.AmbientColor=irrMat.DiffuseColor; - size -= colSize; - subsize -= colSize; - if (FormatVersion==2) - size -= readVX(mat->Envelope[0]); - } - break; - case charsToUIntD('D','I','F','F'): -#ifdef LWO_READER_DEBUG - os::Printer::log("LWO loader: loading Diffuse color."); -#endif - { - if (FormatVersion==2) - { - File->read(&mat->Diffuse, 4); -#ifndef __BIG_ENDIAN__ - mat->Diffuse=os::Byteswap::byteswap(mat->Diffuse); -#endif - size -= 4; - subsize -= 4; - size -= readVX(mat->Envelope[1]); - } - else - { - File->read(&tmp16, 2); -#ifndef __BIG_ENDIAN__ - tmp16=os::Byteswap::byteswap(tmp16); -#endif - mat->Diffuse=tmp16/256.0f; - size -= 2; - subsize -= 2; - } - } - break; - case charsToUIntD('V','D','I','F'): -#ifdef LWO_READER_DEBUG - os::Printer::log("LWO loader: loading Diffuse color."); -#endif - { - File->read(&mat->Diffuse, 4); -#ifndef __BIG_ENDIAN__ - mat->Diffuse=os::Byteswap::byteswap(mat->Diffuse); -#endif - size -= 4; - } - break; - case charsToUIntD('L','U','M','I'): -#ifdef LWO_READER_DEBUG - os::Printer::log("LWO loader: loading luminance."); -#endif - { - if (FormatVersion==2) - { - File->read(&mat->Luminance, 4); -#ifndef __BIG_ENDIAN__ - mat->Luminance=os::Byteswap::byteswap(mat->Luminance); -#endif - size -= 4; - subsize -= 4; - size -= readVX(mat->Envelope[2]); - } - else - { - File->read(&tmp16, 2); -#ifndef __BIG_ENDIAN__ - tmp16=os::Byteswap::byteswap(tmp16); -#endif - mat->Luminance=tmp16/256.0f; - size -= 2; - subsize -= 2; - } } - break; - case charsToUIntD('V','L','U','M'): -#ifdef LWO_READER_DEBUG - os::Printer::log("LWO loader: loading luminance."); -#endif - { - File->read(&mat->Luminance, 4); -#ifndef __BIG_ENDIAN__ - mat->Luminance=os::Byteswap::byteswap(mat->Luminance); -#endif - size -= 4; - } - break; - case charsToUIntD('S','P','E','C'): -#ifdef LWO_READER_DEBUG - os::Printer::log("LWO loader: loading specular."); -#endif - { - if (FormatVersion==2) - { - File->read(&mat->Specular, 4); -#ifndef __BIG_ENDIAN__ - mat->Specular=os::Byteswap::byteswap(mat->Specular); -#endif - size -= 4; - subsize -= 4; - size -= readVX(mat->Envelope[3]); - } - else - { - File->read(&tmp16, 2); -#ifndef __BIG_ENDIAN__ - tmp16=os::Byteswap::byteswap(tmp16); -#endif - mat->Specular=tmp16/256.0f;; - size -= 2; - subsize -= 2; - } - } - break; - case charsToUIntD('V','S','P','C'): -#ifdef LWO_READER_DEBUG - os::Printer::log("LWO loader: loading specular."); -#endif - { - File->read(&mat->Specular, 4); -#ifndef __BIG_ENDIAN__ - mat->Specular=os::Byteswap::byteswap(mat->Specular); -#endif - size -= 4; - } - break; - case charsToUIntD('R','E','F','L'): -#ifdef LWO_READER_DEBUG - os::Printer::log("LWO loader: loading reflection."); -#endif - { - if (FormatVersion==2) - { - File->read(&mat->Reflection, 4); -#ifndef __BIG_ENDIAN__ - mat->Reflection=os::Byteswap::byteswap(mat->Reflection); -#endif - size -= 4; - subsize -= 4; - size -= readVX(mat->Envelope[4]); - } - else - { - File->read(&tmp16, 2); -#ifndef __BIG_ENDIAN__ - tmp16=os::Byteswap::byteswap(tmp16); -#endif - mat->Reflection=tmp16/256.0f; - size -= 2; - subsize -= 2; - } - } - break; - case charsToUIntD('V','R','F','L'): -#ifdef LWO_READER_DEBUG - os::Printer::log("LWO loader: loading reflection."); -#endif - { - File->read(&mat->Reflection, 4); -#ifndef __BIG_ENDIAN__ - mat->Reflection=os::Byteswap::byteswap(mat->Reflection); -#endif - size -= 4; - } - break; - case charsToUIntD('T','R','A','N'): - { - if (FormatVersion==2) - { - File->read(&mat->Transparency, 4); -#ifndef __BIG_ENDIAN__ - mat->Transparency=os::Byteswap::byteswap(mat->Transparency); -#endif - size -= 4; - subsize -= 4; - size -= readVX(mat->Envelope[5]); - } - else - { - File->read(&tmp16, 2); -#ifndef __BIG_ENDIAN__ - tmp16=os::Byteswap::byteswap(tmp16); -#endif - mat->Transparency=tmp16/256.0f; - size -= 2; - subsize -= 2; - } -#ifdef LWO_READER_DEBUG - os::Printer::log("LWO loader: loading transparency", core::stringc(mat->Transparency).c_str()); -#endif - } - break; - case charsToUIntD('V','T','R','N'): - { - File->read(&mat->Transparency, 4); -#ifndef __BIG_ENDIAN__ - mat->Transparency=os::Byteswap::byteswap(mat->Transparency); -#endif - size -= 4; - } -#ifdef LWO_READER_DEBUG - os::Printer::log("LWO loader: loading transparency", core::stringc(mat->Transparency).c_str()); -#endif - break; - case charsToUIntD('T','R','N','L'): -#ifdef LWO_READER_DEBUG - os::Printer::log("LWO loader: loading translucency."); -#endif - { - File->read(&mat->Translucency, 4); -#ifndef __BIG_ENDIAN__ - mat->Translucency=os::Byteswap::byteswap(mat->Translucency); -#endif - size -= 4; - subsize -= 4; - if (FormatVersion==2) - size -= readVX(mat->Envelope[6]); - } - break; - case charsToUIntD('G','L','O','S'): -#ifdef LWO_READER_DEBUG - os::Printer::log("LWO loader: loading glossy."); -#endif - { - if (FormatVersion == 2) - { - File->read(&irrMat.Shininess, 4); -#ifndef __BIG_ENDIAN__ - irrMat.Shininess=os::Byteswap::byteswap(irrMat.Shininess); -#endif - size -= 4; - subsize -= 4; - size -= readVX(mat->Envelope[7]); - } - else - { - File->read(&tmp16, 2); -#ifndef __BIG_ENDIAN__ - tmp16=os::Byteswap::byteswap(tmp16); -#endif - irrMat.Shininess=tmp16/16.f; - size -= 2; - subsize -= 2; - } - } - break; - case charsToUIntD('S','H','R','P'): -#ifdef LWO_READER_DEBUG - os::Printer::log("LWO loader: loading sharpness."); -#endif - { - File->read(&mat->Sharpness, 4); -#ifndef __BIG_ENDIAN__ - mat->Sharpness=os::Byteswap::byteswap(mat->Sharpness); -#endif - size -= 4; - subsize -= 4; - if (FormatVersion==2) - size -= readVX(mat->Envelope[8]); - } - break; - case charsToUIntD('B','U','M','P'): - case charsToUIntD('T','A','M','P'): -#ifdef LWO_READER_DEBUG - os::Printer::log("LWO loader: loading bumpiness."); -#endif - { - File->read(&tmpf32, 4); -#ifndef __BIG_ENDIAN__ - tmpf32=os::Byteswap::byteswap(tmpf32); -#endif - if (currTexture==6) - irrMat.MaterialTypeParam=tmpf32; - size -= 4; - subsize -= 4; - if (FormatVersion==2) - size -= readVX(mat->Envelope[9]); - } - break; - case charsToUIntD('S','I','D','E'): -#ifdef LWO_READER_DEBUG - os::Printer::log("LWO loader: loading backface culled."); -#endif - { - File->read(&tmp16, 2); -#ifndef __BIG_ENDIAN__ - tmp16=os::Byteswap::byteswap(tmp16); -#endif - if (tmp16==1) - irrMat.BackfaceCulling=true; - else if (tmp16==3) - irrMat.BackfaceCulling=false; - size -= 2; - } - break; - case charsToUIntD('S','M','A','N'): -#ifdef LWO_READER_DEBUG - os::Printer::log("LWO loader: loading smoothing angle."); -#endif - { - File->read(&mat->SmoothingAngle, 4); -#ifndef __BIG_ENDIAN__ - mat->SmoothingAngle=os::Byteswap::byteswap(mat->SmoothingAngle); -#endif - size -= 4; - } - break; - case charsToUIntD('R','F','O','P'): - case charsToUIntD('R','F','L','T'): -#ifdef LWO_READER_DEBUG - os::Printer::log("LWO loader: loading reflection mode."); -#endif - { - File->read(&mat->ReflMode, 2); -#ifndef __BIG_ENDIAN__ - mat->ReflMode=os::Byteswap::byteswap(mat->ReflMode); -#endif - size -= 2; - } - break; - case charsToUIntD('R','I','M','G'): -#ifdef LWO_READER_DEBUG - os::Printer::log("LWO loader: loading reflection map."); -#endif - { - if (FormatVersion==2) - { - size -= readVX(tmp32); - if (tmp32) - mat->ReflMap=Images[tmp32-1]; - } - else - size -= readString(mat->ReflMap, size); - } - break; - case charsToUIntD('R','S','A','N'): -#ifdef LWO_READER_DEBUG - os::Printer::log("LWO loader: loading reflection seam angle."); -#endif - { - File->read(&mat->ReflSeamAngle, 4); -#ifndef __BIG_ENDIAN__ - mat->ReflSeamAngle=os::Byteswap::byteswap(mat->ReflSeamAngle); -#endif - size -= 4; - if (FormatVersion==2) - size -= readVX(mat->Envelope[10]); - } - break; - case charsToUIntD('R','B','L','R'): -#ifdef LWO_READER_DEBUG - os::Printer::log("LWO loader: loading reflection blur."); -#endif - { - File->read(&mat->ReflBlur, 4); -#ifndef __BIG_ENDIAN__ - mat->ReflBlur=os::Byteswap::byteswap(mat->ReflBlur); -#endif - size -= 4; - if (FormatVersion==2) - size -= readVX(mat->Envelope[11]); - } - break; - case charsToUIntD('R','I','N','D'): -#ifdef LWO_READER_DEBUG - os::Printer::log("LWO loader: loading refraction index."); -#endif - { - File->read(&mat->RefrIndex, 4); -#ifndef __BIG_ENDIAN__ - mat->RefrIndex=os::Byteswap::byteswap(mat->RefrIndex); -#endif - size -= 4; - subsize -= 4; - if (FormatVersion==2) - size -= readVX(mat->Envelope[12]); - } - break; - case charsToUIntD('T','R','O','P'): -#ifdef LWO_READER_DEBUG - os::Printer::log("LWO loader: loading refraction options."); -#endif - { - File->read(&mat->TranspMode, 2); -#ifndef __BIG_ENDIAN__ - mat->TranspMode=os::Byteswap::byteswap(mat->TranspMode); -#endif - size -= 2; - } - break; - case charsToUIntD('T','I','M','G'): - { - if (FormatVersion==2) - { -#ifdef LWO_READER_DEBUG - os::Printer::log("LWO loader: loading refraction map."); -#endif - size -= readVX(tmp32); -#ifndef __BIG_ENDIAN__ - tmp32=os::Byteswap::byteswap(tmp32); -#endif - if (tmp32) - mat->Texture[currTexture].Map=Images[tmp32-1]; - } - else - { - size -= readString(mat->Texture[currTexture].Map, size); -#ifdef LWO_READER_DEBUG - os::Printer::log("LWO loader: loading image", mat->Texture[currTexture].Map.c_str()); -#endif - } - } - break; - case charsToUIntD('T','B','L','R'): -#ifdef LWO_READER_DEBUG - os::Printer::log("LWO loader: loading transparency blur."); -#endif - { - File->read(&mat->TranspBlur, 4); -#ifndef __BIG_ENDIAN__ - mat->TranspBlur=os::Byteswap::byteswap(mat->TranspBlur); -#endif - size -= 4; - if (FormatVersion==2) - size -= readVX(mat->Envelope[13]); - } - break; - case charsToUIntD('C','L','R','H'): -#ifdef LWO_READER_DEBUG - os::Printer::log("LWO loader: loading highlight color."); -#endif - { - File->read(&mat->HighlightColor, 4); -#ifndef __BIG_ENDIAN__ - mat->HighlightColor=os::Byteswap::byteswap(mat->HighlightColor); -#endif - size -= 4; - if (FormatVersion==2) - size -= readVX(mat->Envelope[14]); - } - break; - case charsToUIntD('C','L','R','F'): -#ifdef LWO_READER_DEBUG - os::Printer::log("LWO loader: loading color filter."); -#endif - { - File->read(&mat->ColorFilter, 4); -#ifndef __BIG_ENDIAN__ - mat->ColorFilter=os::Byteswap::byteswap(mat->ColorFilter); -#endif - size -= 4; - if (FormatVersion==2) - size -= readVX(mat->Envelope[15]); - } - break; - case charsToUIntD('A','D','T','R'): -#ifdef LWO_READER_DEBUG - os::Printer::log("LWO loader: loading additive transparency."); -#endif - { - File->read(&mat->AdditiveTransparency, 4); -#ifndef __BIG_ENDIAN__ - mat->AdditiveTransparency=os::Byteswap::byteswap(mat->AdditiveTransparency); -#endif - size -= 4; - if (FormatVersion==2) - size -= readVX(mat->Envelope[16]); - } - break; - case charsToUIntD('G','L','O','W'): -#ifdef LWO_READER_DEBUG - os::Printer::log("LWO loader: loading glow."); -#endif - { - if (FormatVersion==0) - { - File->read(&mat->GlowIntensity, 4); -#ifndef __BIG_ENDIAN__ - mat->GlowIntensity=os::Byteswap::byteswap(mat->GlowIntensity); -#endif - size -= 4; - } - else - { - File->read(&mat->Glow, 2); -#ifndef __BIG_ENDIAN__ - mat->Glow=os::Byteswap::byteswap(mat->Glow); -#endif - size -= 2; - File->read(&mat->GlowIntensity, 4); -#ifndef __BIG_ENDIAN__ - mat->GlowIntensity=os::Byteswap::byteswap(mat->GlowIntensity); -#endif - size -= 4; - if (FormatVersion==2) - size -= readVX(mat->Envelope[17]); - File->read(&mat->GlowSize, 4); -#ifndef __BIG_ENDIAN__ - mat->GlowSize=os::Byteswap::byteswap(mat->GlowSize); -#endif - size -= 4; - if (FormatVersion==2) - size -= readVX(mat->Envelope[18]); - } - } - break; - case charsToUIntD('G','V','A','L'): -#ifdef LWO_READER_DEBUG - os::Printer::log("LWO loader: loading glow intensity."); -#endif - { - File->read(&mat->GlowIntensity, 4); -#ifndef __BIG_ENDIAN__ - mat->GlowIntensity=os::Byteswap::byteswap(mat->GlowIntensity); -#endif - size -= 4; - if (FormatVersion==2) - size -= readVX(mat->Envelope[17]); - } - break; - case charsToUIntD('L','I','N','E'): -#ifdef LWO_READER_DEBUG - os::Printer::log("LWO loader: loading isWireframe."); -#endif - { - File->read(&tmp16, 2); -#ifndef __BIG_ENDIAN__ - tmp16=os::Byteswap::byteswap(tmp16); -#endif - if (tmp16&1) - irrMat.Wireframe=true; - size -= 2; - if (size!=0) - { - File->read(&irrMat.Thickness, 4); -#ifndef __BIG_ENDIAN__ - irrMat.Thickness=os::Byteswap::byteswap(irrMat.Thickness); -#endif - size -= 4; - if (FormatVersion==2) - size -= readVX(mat->Envelope[19]); - } - if (size!=0) - { - video::SColor lineColor; - size -= readColor(lineColor); - if (FormatVersion==2) - size -= readVX(mat->Envelope[20]); - } - } - break; - case charsToUIntD('A','L','P','H'): -#ifdef LWO_READER_DEBUG - os::Printer::log("LWO loader: loading alpha mode."); -#endif - { - File->read(&mat->AlphaMode, 2); -#ifndef __BIG_ENDIAN__ - mat->AlphaMode=os::Byteswap::byteswap(mat->AlphaMode); -#endif - size -= 2; - File->read(&mat->AlphaValue, 4); -#ifndef __BIG_ENDIAN__ - mat->AlphaValue=os::Byteswap::byteswap(mat->AlphaValue); -#endif - size -= 4; - } - break; - case charsToUIntD('V','C','O','L'): -#ifdef LWO_READER_DEBUG - os::Printer::log("LWO loader: loading vertex color."); -#endif - { - File->read(&mat->VertexColorIntensity, 4); -#ifndef __BIG_ENDIAN__ - mat->VertexColorIntensity=os::Byteswap::byteswap(mat->VertexColorIntensity); -#endif - size -= 4; - if (FormatVersion==2) - size -= readVX(mat->Envelope[21]); - File->read(&tmp32, 4); // skip type - size -= 4; - core::stringc tmpname; - size -= readString(tmpname, size); -// mat->VertexColor = getColorVMAP(tmpname); - } - break; - case charsToUIntD('F','L','A','G'): -#ifdef LWO_READER_DEBUG - os::Printer::log("LWO loader: loading flag."); -#endif - { - File->read(&mat->Flags, 2); -#ifndef __BIG_ENDIAN__ - mat->Flags=os::Byteswap::byteswap(mat->Flags); -#endif - if (mat->Flags&1) - mat->Luminance=1.0f; - if (mat->Flags&256) - irrMat.BackfaceCulling=false; - size -= 2; - } - break; - case charsToUIntD('E','D','G','E'): -#ifdef LWO_READER_DEBUG - os::Printer::log("LWO loader: loading edge."); -#endif - { - File->read(&mat->EdgeTransparency, 4); -#ifndef __BIG_ENDIAN__ - mat->EdgeTransparency=os::Byteswap::byteswap(mat->EdgeTransparency); -#endif - size -= 4; - } - break; - case charsToUIntD('C','T','E','X'): -#ifdef LWO_READER_DEBUG - os::Printer::log("LWO loader: loading ctex."); -#endif - currTexture=0; - size -= readString(mat->Texture[currTexture].Type, size); - break; - case charsToUIntD('D','T','E','X'): -#ifdef LWO_READER_DEBUG - os::Printer::log("LWO loader: loading dtex."); -#endif - currTexture=1; - size -= readString(mat->Texture[currTexture].Type, size); - break; - case charsToUIntD('S','T','E','X'): -#ifdef LWO_READER_DEBUG - os::Printer::log("LWO loader: loading stex."); -#endif - currTexture=2; - size -= readString(mat->Texture[currTexture].Type, size); - break; - case charsToUIntD('R','T','E','X'): -#ifdef LWO_READER_DEBUG - os::Printer::log("LWO loader: loading rtex."); -#endif - currTexture=3; - size -= readString(mat->Texture[currTexture].Type, size); - break; - case charsToUIntD('T','T','E','X'): -#ifdef LWO_READER_DEBUG - os::Printer::log("LWO loader: loading ttex."); -#endif - currTexture=4; - size -= readString(mat->Texture[currTexture].Type, size); - break; - case charsToUIntD('L','T','E','X'): -#ifdef LWO_READER_DEBUG - os::Printer::log("LWO loader: loading ltex."); -#endif - currTexture=5; - size -= readString(mat->Texture[currTexture].Type, size); - break; - case charsToUIntD('B','T','E','X'): -#ifdef LWO_READER_DEBUG - os::Printer::log("LWO loader: loading btex."); -#endif - currTexture=6; - size -= readString(mat->Texture[currTexture].Type, size); - break; - case charsToUIntD('T','A','L','P'): -#ifdef LWO_READER_DEBUG - os::Printer::log("LWO loader: loading alpha map."); -#endif - size -= readString(mat->Texture[currTexture].AlphaMap, size); - break; - case charsToUIntD('T','F','L','G'): -#ifdef LWO_READER_DEBUG - os::Printer::log("LWO loader: loading texture flag."); -#endif - { - File->read(&mat->Texture[currTexture].Flags, 2); -#ifndef __BIG_ENDIAN__ - mat->Texture[currTexture].Flags=os::Byteswap::byteswap(mat->Texture[currTexture].Flags); -#endif - size -= 2; - } - break; - case charsToUIntD('E','N','A','B'): -#ifdef LWO_READER_DEBUG - os::Printer::log("LWO loader: loading isEnabled."); -#endif - { - File->read(&tmp16, 2); -#ifndef __BIG_ENDIAN__ - tmp16=os::Byteswap::byteswap(tmp16); -#endif - mat->Texture[currTexture].Active=(tmp16!=0); - size -= 2; - } - break; - case charsToUIntD('W','R','A','P'): - case charsToUIntD('T','W','R','P'): -#ifdef LWO_READER_DEBUG - os::Printer::log("LWO loader: loading texture wrap."); -#endif - { - File->read(&mat->Texture[currTexture].WidthWrap, 2); -#ifndef __BIG_ENDIAN__ - mat->Texture[currTexture].WidthWrap=os::Byteswap::byteswap(mat->Texture[currTexture].WidthWrap); -#endif - File->read(&mat->Texture[currTexture].HeightWrap, 2); -#ifndef __BIG_ENDIAN__ - mat->Texture[currTexture].HeightWrap=os::Byteswap::byteswap(mat->Texture[currTexture].HeightWrap); -#endif - size -= 4; - } - break; - case charsToUIntD('T','V','E','L'): -#ifdef LWO_READER_DEBUG - os::Printer::log("LWO loader: loading texture velocity."); -#endif - size -= readVec(mat->Texture[currTexture].Velocity); - break; - case charsToUIntD('T','C','L','R'): -#ifdef LWO_READER_DEBUG - os::Printer::log("LWO loader: loading texture color."); -#endif - size -= readColor(mat->Texture[currTexture].Color); - break; - case charsToUIntD('A','A','S','T'): - case charsToUIntD('T','A','A','S'): -#ifdef LWO_READER_DEBUG - os::Printer::log("LWO loader: loading texture antialias."); -#endif - { - tmp16=0; - if (FormatVersion==2) - { - File->read(&tmp16, 2); -#ifndef __BIG_ENDIAN__ - tmp16=os::Byteswap::byteswap(tmp16); -#endif - size -= 2; - } - File->read(&mat->Texture[currTexture].AntiAliasing, 4); -#ifndef __BIG_ENDIAN__ - mat->Texture[currTexture].AntiAliasing=os::Byteswap::byteswap(mat->Texture[currTexture].AntiAliasing); -#endif - if (tmp16 & ~0x01) - mat->Texture[currTexture].AntiAliasing=0.0f; // disabled - size -= 4; - } - break; - case charsToUIntD('T','O','P','C'): -#ifdef LWO_READER_DEBUG - os::Printer::log("LWO loader: loading texture opacity."); -#endif - { - File->read(&mat->Texture[currTexture].Opacity, 4); -#ifndef __BIG_ENDIAN__ - mat->Texture[currTexture].Opacity=os::Byteswap::byteswap(mat->Texture[currTexture].Opacity); -#endif - size -= 4; - } - break; - case charsToUIntD('O','P','A','C'): - { -#ifdef LWO_READER_DEBUG - os::Printer::log("LWO loader: loading texture opacity and type."); -#endif - File->read(&mat->Texture[currTexture].OpacType, 2); -#ifndef __BIG_ENDIAN__ - mat->Texture[currTexture].OpacType=os::Byteswap::byteswap(mat->Texture[currTexture].OpacType); -#endif - File->read(&mat->Texture[currTexture].Opacity, 4); -#ifndef __BIG_ENDIAN__ - mat->Texture[currTexture].Opacity=os::Byteswap::byteswap(mat->Texture[currTexture].Opacity); -#endif - size -= 6; - subsize -= 6; - if (FormatVersion==2) - size -= readVX(mat->Envelope[22]); - } - break; - case charsToUIntD('A','X','I','S'): - { - File->read(&tmp16, 2); -#ifndef __BIG_ENDIAN__ - tmp16=os::Byteswap::byteswap(tmp16); -#endif - mat->Texture[currTexture].Axis=(u8)tmp16; - size -= 2; -#ifdef LWO_READER_DEBUG - os::Printer::log("LWO loader: loading axis value", core::stringc(tmp16).c_str()); -#endif - } - break; - case charsToUIntD('T','M','A','P'): // empty separation chunk - break; - case charsToUIntD('T','C','T','R'): - case charsToUIntD('C','N','T','R'): - { - core::vector3df& center=mat->Texture[currTexture].Center; - size -= readVec(center); - if (FormatVersion==2) - size -= readVX(mat->Envelope[22]); -#ifdef LWO_READER_DEBUG - os::Printer::log("LWO loader: loading texture center", (core::stringc(center.X)+" "+core::stringc(center.Y)+" "+core::stringc(center.Z)).c_str()); -#endif - } - break; - case charsToUIntD('T','S','I','Z'): - case charsToUIntD('S','I','Z','E'): - { - core::vector3df& tsize=mat->Texture[currTexture].Size; - size -= readVec(tsize); - if (FormatVersion==2) - size -= readVX(mat->Envelope[22]); -#ifdef LWO_READER_DEBUG - os::Printer::log("LWO loader: loading texture size", (core::stringc(tsize.X)+" "+core::stringc(tsize.Y)+" "+core::stringc(tsize.Z)).c_str()); -#endif - } - break; - case charsToUIntD('R','O','T','A'): - { - core::vector3df rotation; - size -= readVec(rotation); - if (FormatVersion==2) - size -= readVX(mat->Envelope[22]); -#ifdef LWO_READER_DEBUG - os::Printer::log("LWO loader: loading texture rotation", (core::stringc(rotation.X)+" "+core::stringc(rotation.Y)+" "+core::stringc(rotation.Z)).c_str()); -#endif - } - break; - case charsToUIntD('O','R','E','F'): - { - core::stringc tmpname; - size -= readString(tmpname); -#ifdef LWO_READER_DEBUG - os::Printer::log("LWO loader: texture reference object", tmpname.c_str()); -#endif - } - break; - case charsToUIntD('T','F','A','L'): - case charsToUIntD('F','A','L','L'): - { - if (FormatVersion==2) - { - u16 tmp16; - File->read(&tmp16, 2); - size -= 2; -#ifndef __BIG_ENDIAN__ - tmp16=os::Byteswap::byteswap(tmp16); -#endif - } - - core::vector3df& falloff=mat->Texture[currTexture].Falloff; - size -= readVec(falloff); - if (FormatVersion==2) - size -= readVX(mat->Envelope[22]); -#ifdef LWO_READER_DEBUG - os::Printer::log("LWO loader: loading texture falloff"); -#endif - } - break; - case charsToUIntD('C','S','Y','S'): - { - u16 tmp16; - File->read(&tmp16, 2); - size -= 2; -#ifndef __BIG_ENDIAN__ - tmp16=os::Byteswap::byteswap(tmp16); -#endif -#ifdef LWO_READER_DEBUG - os::Printer::log("LWO loader: texture coordinate system", tmp16==0?"object coords":"world coords"); -#endif - } - break; - case charsToUIntD('T','V','A','L'): -#ifdef LWO_READER_DEBUG - os::Printer::log("LWO loader: loading texture value."); -#endif - { - File->read(&tmp16, 2); -#ifndef __BIG_ENDIAN__ - tmp16=os::Byteswap::byteswap(tmp16); -#endif - mat->Texture[currTexture].Value=tmp16/256.0f; - size -= 2; - } - break; - case charsToUIntD('T','F','P','0'): - case charsToUIntD('T','S','P','0'): -#ifdef LWO_READER_DEBUG - os::Printer::log("LWO loader: loading texture param 0."); -#endif - { - File->read(&mat->Texture[currTexture].FParam[0], 4); -#ifndef __BIG_ENDIAN__ - mat->Texture[currTexture].FParam[0]=os::Byteswap::byteswap(mat->Texture[currTexture].FParam[0]); -#endif - size -= 4; - } - break; - case charsToUIntD('T','F','P','1'): - case charsToUIntD('T','S','P','1'): -#ifdef LWO_READER_DEBUG - os::Printer::log("LWO loader: loading texture param 1."); -#endif - { - File->read(&mat->Texture[currTexture].FParam[1], 4); -#ifndef __BIG_ENDIAN__ - mat->Texture[currTexture].FParam[1]=os::Byteswap::byteswap(mat->Texture[currTexture].FParam[1]); -#endif - size -= 4; - } - break; - case charsToUIntD('T','F','P','2'): - case charsToUIntD('T','S','P','2'): -#ifdef LWO_READER_DEBUG - os::Printer::log("LWO loader: loading texture param 2."); -#endif - { - File->read(&mat->Texture[currTexture].FParam[2], 4); -#ifndef __BIG_ENDIAN__ - mat->Texture[currTexture].FParam[2]=os::Byteswap::byteswap(mat->Texture[currTexture].FParam[2]); -#endif - size -= 4; - } - break; - case charsToUIntD('T','F','R','Q'): - case charsToUIntD('T','I','P','0'): -#ifdef LWO_READER_DEBUG - os::Printer::log("LWO loader: loading texture iparam 0."); -#endif - { - File->read(&mat->Texture[currTexture].IParam[0], 2); -#ifndef __BIG_ENDIAN__ - mat->Texture[currTexture].IParam[0]=os::Byteswap::byteswap(mat->Texture[currTexture].IParam[0]); -#endif - size -= 2; - } - break; - case charsToUIntD('T','I','P','1'): -#ifdef LWO_READER_DEBUG - os::Printer::log("LWO loader: loading texture param 1."); -#endif - { - File->read(&mat->Texture[currTexture].IParam[1], 2); -#ifndef __BIG_ENDIAN__ - mat->Texture[currTexture].IParam[1]=os::Byteswap::byteswap(mat->Texture[currTexture].IParam[1]); -#endif - size -= 2; - } - break; - case charsToUIntD('T','I','P','2'): -#ifdef LWO_READER_DEBUG - os::Printer::log("LWO loader: loading texture param 2."); -#endif - { - File->read(&mat->Texture[currTexture].IParam[2], 2); -#ifndef __BIG_ENDIAN__ - mat->Texture[currTexture].IParam[2]=os::Byteswap::byteswap(mat->Texture[currTexture].IParam[2]); -#endif - size -= 2; - } - break; - case charsToUIntD('V','M','A','P'): - { - size -= readString(mat->Texture[currTexture].UVname); -#ifdef LWO_READER_DEBUG - os::Printer::log("LWO loader: loading material vmap binding",mat->Texture[currTexture].UVname.c_str()); -#endif - } - break; - case charsToUIntD('B','L','O','K'): -#ifdef LWO_READER_DEBUG - os::Printer::log("LWO loader: loading blok."); -#endif - { - core::stringc ordinal; - File->read(&type, 4); - File->read(&subsize, 2); -#ifndef __BIG_ENDIAN__ - subsize=os::Byteswap::byteswap(subsize); -#endif - size -= 6; - size -= readString(ordinal, size); - } - break; - case charsToUIntD('C','H','A','N'): - { - File->read(&type, 4); - size -= 4; - if (!strncmp(type, "COLR", 4)) - currTexture=0; - else if (!strncmp(type, "DIFF", 4)) - currTexture=1; - else if (!strncmp(type, "LUMI", 4)) - currTexture=5; - else if (!strncmp(type, "SPEC", 4)) - currTexture=2; - else if (!strncmp(type, "REFL", 4)) - currTexture=3; - else if (!strncmp(type, "TRAN", 4)) - currTexture=4; - else if (!strncmp(type, "BUMP", 4)) - currTexture=6; - } -#ifdef LWO_READER_DEBUG - os::Printer::log("LWO loader: loading channel ", type); -#endif - break; - case charsToUIntD('I','M','A','G'): -#ifdef LWO_READER_DEBUG - os::Printer::log("LWO loader: loading channel map."); -#endif - { - u16 index; - File->read(&index, 2); -#ifndef __BIG_ENDIAN__ - index=os::Byteswap::byteswap(index); -#endif - size -= 2; - if (index) - mat->Texture[currTexture].Map=Images[index-1]; - } - break; - case charsToUIntD('P','R','O','J'): // define the projection type -#ifdef LWO_READER_DEBUG - os::Printer::log("LWO loader: loading channel projection type."); -#endif - { - u16 index; - File->read(&index, 2); -#ifndef __BIG_ENDIAN__ - index=os::Byteswap::byteswap(index); -#endif - size -= 2; -#ifdef LWO_READER_DEBUG - if (index != 5) - os::Printer::log("LWO loader: wrong channel projection type", core::stringc(index).c_str()); -#endif - mat->Texture[currTexture].Projection=(u8)index; - } - break; - case charsToUIntD('W','R','P','W'): // for cylindrical and spherical projections - case charsToUIntD('W','R','P','H'): // for cylindrical and spherical projections - default: - { -#ifdef LWO_READER_DEBUG - os::Printer::log("LWO loader: skipping ", core::stringc((char*)&uiType, 4)); -#endif - File->seek(subsize, true); - size -= subsize; - } - } - } - - if (mat->Transparency != 0.f) - { - irrMat.MaterialType=video::EMT_TRANSPARENT_ADD_COLOR; - } -} - - -u32 CLWOMeshFileLoader::readColor(video::SColor& color) -{ - if (FormatVersion!=2) - { - u8 colorComponent; - File->read(&colorComponent, 1); - color.setRed(colorComponent); - File->read(&colorComponent, 1); - color.setGreen(colorComponent); - File->read(&colorComponent, 1); - color.setBlue(colorComponent); - // unknown value - File->read(&colorComponent, 1); - return 4; - } - else - { - video::SColorf col; - File->read(&col.r, 4); -#ifndef __BIG_ENDIAN__ - col.r=os::Byteswap::byteswap(col.r); -#endif - File->read(&col.g, 4); -#ifndef __BIG_ENDIAN__ - col.g=os::Byteswap::byteswap(col.g); -#endif - File->read(&col.b, 4); -#ifndef __BIG_ENDIAN__ - col.b=os::Byteswap::byteswap(col.b); -#endif - color=col.toSColor(); - return 12; - } -} - -u32 CLWOMeshFileLoader::readString(core::stringc& name, u32 size) -{ - c8 c; - - name=""; - if (size) - name.reserve(size); - File->read(&c, 1); - while (c) - { - name.append(c); - File->read(&c, 1); - } - // read extra 0 upon odd file position - if (File->getPos() & 0x1) - { - File->read(&c, 1); - return (name.size()+2); - } - return (name.size()+1); -} - - -u32 CLWOMeshFileLoader::readVec(core::vector3df& vec) -{ - File->read(&vec.X, 4); -#ifndef __BIG_ENDIAN__ - vec.X=os::Byteswap::byteswap(vec.X); -#endif - File->read(&vec.Y, 4); -#ifndef __BIG_ENDIAN__ - vec.Y=os::Byteswap::byteswap(vec.Y); -#endif - File->read(&vec.Z, 4); -#ifndef __BIG_ENDIAN__ - vec.Z=os::Byteswap::byteswap(vec.Z); -#endif - return 12; -} - - -u32 CLWOMeshFileLoader::readVX(u32& num) -{ - u16 tmpIndex; - - File->read(&tmpIndex, 2); -#ifndef __BIG_ENDIAN__ - tmpIndex=os::Byteswap::byteswap(tmpIndex); -#endif - num=tmpIndex; - if (num >= 0xFF00) - { - File->read(&tmpIndex, 2); -#ifndef __BIG_ENDIAN__ - tmpIndex=os::Byteswap::byteswap(tmpIndex); -#endif - num=((num << 16)|tmpIndex) & ~0xFF000000; - return 4; - } - return 2; -} - - -bool CLWOMeshFileLoader::readFileHeader() -{ - u32 Id; - - File->read(&Id, 4); -#ifndef __BIG_ENDIAN__ - Id=os::Byteswap::byteswap(Id); -#endif - if (Id != 0x464f524d) // FORM - return false; - - //skip the file length - File->read(&Id, 4); - - File->read(&Id, 4); -#ifndef __BIG_ENDIAN__ - Id=os::Byteswap::byteswap(Id); -#endif - // Currently supported: LWOB, LWLO, LWO2 - switch (Id) - { - case 0x4c574f42: - FormatVersion = 0; // LWOB - break; - case 0x4c574c4f: - FormatVersion = 1; // LWLO - break; - case 0x4c574f32: - FormatVersion = 2; // LWO2 - break; - default: - return false; // unsupported - } - - return true; -} - - -video::ITexture* CLWOMeshFileLoader::loadTexture(const core::stringc& file) -{ - video::ITexture* texture = getMeshTextureLoader() ? getMeshTextureLoader()->getTexture(file) : NULL; - - if (!texture) - { - os::Printer::log("Could not load texture", file.c_str(), ELL_WARNING); - } - - return texture; -} - - -} // end namespace scene -} // end namespace irr - -#endif // _IRR_COMPILE_WITH_LWO_LOADER_ diff --git a/source/Irrlicht/CLWOMeshFileLoader.h b/source/Irrlicht/CLWOMeshFileLoader.h deleted file mode 100644 index 5f77ed0e..00000000 --- a/source/Irrlicht/CLWOMeshFileLoader.h +++ /dev/null @@ -1,87 +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_LWO_MESH_FILE_LOADER_H_INCLUDED__ -#define __C_LWO_MESH_FILE_LOADER_H_INCLUDED__ - -#include "IMeshLoader.h" -#include "SMeshBuffer.h" -#include "irrString.h" - -namespace irr -{ -namespace io -{ - class IReadFile; - class IFileSystem; -} // end namespace io -namespace scene -{ - - struct SMesh; - class ISceneManager; - -//! Meshloader capable of loading Lightwave 3D meshes. -class CLWOMeshFileLoader : public IMeshLoader -{ -public: - - //! Constructor - CLWOMeshFileLoader(scene::ISceneManager* smgr, io::IFileSystem* fs); - - //! destructor - virtual ~CLWOMeshFileLoader(); - - //! returns true if the file maybe is able to be loaded by this class - //! based on the file extension (e.g. ".bsp") - 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 IUnknown::drop() for more information. - virtual IAnimatedMesh* createMesh(io::IReadFile* file) _IRR_OVERRIDE_; - -private: - - struct tLWOMaterial; - - bool readFileHeader(); - bool readChunks(); - void readObj1(u32 size); - void readTagMapping(u32 size); - void readVertexMapping(u32 size); - void readDiscVertexMapping (u32 size); - void readObj2(u32 size); - void readMat(u32 size); - u32 readString(core::stringc& name, u32 size=0); - u32 readVec(core::vector3df& vec); - u32 readVX(u32& num); - u32 readColor(video::SColor& color); - video::ITexture* loadTexture(const core::stringc& file); - - scene::ISceneManager* SceneManager; - io::IFileSystem* FileSystem; - io::IReadFile* File; - SMesh* Mesh; - - core::array<core::vector3df> Points; - core::array<core::array<u32> > Indices; - core::array<core::stringc> UvName; - core::array<core::array<u32> > UvIndex; - core::array<core::stringc> DUvName; - core::array<core::array<u32> > VmPolyPointsIndex; - core::array<core::array<core::vector2df> > VmCoordsIndex; - - core::array<u16> MaterialMapping; - core::array<core::array<core::vector2df> > TCoords; - core::array<tLWOMaterial*> Materials; - core::array<core::stringc> Images; - u8 FormatVersion; -}; - -} // end namespace scene -} // end namespace irr - -#endif diff --git a/source/Irrlicht/CLightSceneNode.cpp b/source/Irrlicht/CLightSceneNode.cpp deleted file mode 100644 index 7728ba82..00000000 --- a/source/Irrlicht/CLightSceneNode.cpp +++ /dev/null @@ -1,281 +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 "CLightSceneNode.h" -#include "IVideoDriver.h" -#include "ISceneManager.h" -#include "ICameraSceneNode.h" - -#include "os.h" - -namespace irr -{ -namespace scene -{ - -//! constructor -CLightSceneNode::CLightSceneNode(ISceneNode* parent, ISceneManager* mgr, s32 id, - const core::vector3df& position, video::SColorf color, f32 radius) -: ILightSceneNode(parent, mgr, id, position), DriverLightIndex(-1), LightIsOn(true) -{ - #ifdef _DEBUG - setDebugName("CLightSceneNode"); - #endif - - LightData.DiffuseColor = color; - // set some useful specular color - LightData.SpecularColor = color.getInterpolated(video::SColor(255,255,255,255),0.7f); - - setRadius(radius); -} - - -//! pre render event -void CLightSceneNode::OnRegisterSceneNode() -{ - doLightRecalc(); // TODO: since doLightRecalc has now been added to updateAbsolutePosition it might be possible to remove this one. - - if (IsVisible) - SceneManager->registerNodeForRendering(this, ESNRP_LIGHT); - - ISceneNode::OnRegisterSceneNode(); -} - - -//! render -void CLightSceneNode::render() -{ - video::IVideoDriver* driver = SceneManager->getVideoDriver(); - if (!driver) - return; - - if ( DebugDataVisible & scene::EDS_BBOX ) - { - driver->setTransform(video::ETS_WORLD, AbsoluteTransformation); - video::SMaterial m; - m.Lighting = false; - driver->setMaterial(m); - - switch ( LightData.Type ) - { - case video::ELT_POINT: - case video::ELT_SPOT: - driver->draw3DBox(BBox, LightData.DiffuseColor.toSColor()); - break; - - case video::ELT_DIRECTIONAL: - driver->draw3DLine(core::vector3df(0.f, 0.f, 0.f), - LightData.Direction * LightData.Radius, - LightData.DiffuseColor.toSColor()); - break; - default: - break; - } - } - - DriverLightIndex = driver->addDynamicLight(LightData); - setVisible(LightIsOn); -} - - -//! sets the light data -void CLightSceneNode::setLightData(const video::SLight& light) -{ - LightData = light; -} - - -//! \return Returns the light data. -const video::SLight& CLightSceneNode::getLightData() const -{ - return LightData; -} - - -//! \return Returns the light data. -video::SLight& CLightSceneNode::getLightData() -{ - return LightData; -} - -void CLightSceneNode::setVisible(bool isVisible) -{ - ISceneNode::setVisible(isVisible); - - if(DriverLightIndex < 0) - return; - video::IVideoDriver* driver = SceneManager->getVideoDriver(); - if (!driver) - return; - - LightIsOn = isVisible; - driver->turnLightOn((u32)DriverLightIndex, LightIsOn); -} - -//! returns the axis aligned bounding box of this node -const core::aabbox3d<f32>& CLightSceneNode::getBoundingBox() const -{ - return BBox; -} - - -//! Sets the light's radius of influence. -/** Outside this radius the light won't lighten geometry and cast no -shadows. Setting the radius will also influence the attenuation, setting -it to (0,1/radius,0). If you want to override this behavior, set the -attenuation after the radius. -\param radius The new radius. */ -void CLightSceneNode::setRadius(f32 radius) -{ - LightData.Radius=radius; - LightData.Attenuation.set(0.f, 1.f/radius, 0.f); - doLightRecalc(); -} - - -//! Gets the light's radius of influence. -/** \return The current radius. */ -f32 CLightSceneNode::getRadius() const -{ - return LightData.Radius; -} - - -//! Sets the light type. -/** \param type The new type. */ -void CLightSceneNode::setLightType(video::E_LIGHT_TYPE type) -{ - LightData.Type=type; -} - - -//! Gets the light type. -/** \return The current light type. */ -video::E_LIGHT_TYPE CLightSceneNode::getLightType() const -{ - return LightData.Type; -} - - -//! Sets whether this light casts shadows. -/** Enabling this flag won't automatically cast shadows, the meshes -will still need shadow scene nodes attached. But one can enable or -disable distinct lights for shadow casting for performance reasons. -\param shadow True if this light shall cast shadows. */ -void CLightSceneNode::enableCastShadow(bool shadow) -{ - LightData.CastShadows=shadow; -} - - -//! Check whether this light casts shadows. -/** \return True if light would cast shadows, else false. */ -bool CLightSceneNode::getCastShadow() const -{ - return LightData.CastShadows; -} - - -void CLightSceneNode::doLightRecalc() -{ - if ((LightData.Type == video::ELT_SPOT) || (LightData.Type == video::ELT_DIRECTIONAL)) - { - LightData.Direction = core::vector3df(.0f,.0f,1.0f); - getAbsoluteTransformation().rotateVect(LightData.Direction); - LightData.Direction.normalize(); - } - if ((LightData.Type == video::ELT_SPOT) || (LightData.Type == video::ELT_POINT)) - { - const f32 r = LightData.Radius * LightData.Radius * 0.5f; - BBox.MaxEdge.set( r, r, r ); - BBox.MinEdge.set( -r, -r, -r ); - //setAutomaticCulling( scene::EAC_BOX ); - setAutomaticCulling( scene::EAC_OFF ); - LightData.Position = getAbsolutePosition(); - } - if (LightData.Type == video::ELT_DIRECTIONAL) - { - BBox.reset( 0, 0, 0 ); - setAutomaticCulling( scene::EAC_OFF ); - } -} - -void CLightSceneNode::updateAbsolutePosition() -{ - ILightSceneNode::updateAbsolutePosition(); - doLightRecalc(); -} - - -//! Writes attributes of the scene node. -void CLightSceneNode::serializeAttributes(io::IAttributes* out, io::SAttributeReadWriteOptions* options) const -{ - ILightSceneNode::serializeAttributes(out, options); - - out->addColorf ("AmbientColor", LightData.AmbientColor); - out->addColorf ("DiffuseColor", LightData.DiffuseColor); - out->addColorf ("SpecularColor", LightData.SpecularColor); - out->addVector3d("Attenuation", LightData.Attenuation); - out->addFloat ("Radius", LightData.Radius); - out->addFloat ("OuterCone", LightData.OuterCone); - out->addFloat ("InnerCone", LightData.InnerCone); - out->addFloat ("Falloff", LightData.Falloff); - out->addBool ("CastShadows", LightData.CastShadows); - out->addEnum ("LightType", LightData.Type, video::LightTypeNames); -} - -//! Reads attributes of the scene node. -void CLightSceneNode::deserializeAttributes(io::IAttributes* in, io::SAttributeReadWriteOptions* options) -{ - LightData.AmbientColor = in->getAttributeAsColorf("AmbientColor"); - LightData.DiffuseColor = in->getAttributeAsColorf("DiffuseColor"); - LightData.SpecularColor = in->getAttributeAsColorf("SpecularColor"); - - //TODO: clearify Radius and Linear Attenuation -#if 0 - setRadius ( in->getAttributeAsFloat("Radius") ); -#else - LightData.Radius = in->getAttributeAsFloat("Radius"); -#endif - - if (in->existsAttribute("Attenuation")) // might not exist in older files - LightData.Attenuation = in->getAttributeAsVector3d("Attenuation"); - - if (in->existsAttribute("OuterCone")) // might not exist in older files - LightData.OuterCone = in->getAttributeAsFloat("OuterCone"); - if (in->existsAttribute("InnerCone")) // might not exist in older files - LightData.InnerCone = in->getAttributeAsFloat("InnerCone"); - if (in->existsAttribute("Falloff")) // might not exist in older files - LightData.Falloff = in->getAttributeAsFloat("Falloff"); - LightData.CastShadows = in->getAttributeAsBool("CastShadows"); - LightData.Type = (video::E_LIGHT_TYPE)in->getAttributeAsEnumeration("LightType", video::LightTypeNames); - - doLightRecalc (); - - ILightSceneNode::deserializeAttributes(in, options); -} - -//! Creates a clone of this scene node and its children. -ISceneNode* CLightSceneNode::clone(ISceneNode* newParent, ISceneManager* newManager) -{ - if (!newParent) - newParent = Parent; - if (!newManager) - newManager = SceneManager; - - CLightSceneNode* nb = new CLightSceneNode(newParent, - newManager, ID, RelativeTranslation, LightData.DiffuseColor, LightData.Radius); - - nb->cloneMembers(this, newManager); - nb->LightData = LightData; - nb->BBox = BBox; - - if ( newParent ) - nb->drop(); - return nb; -} - -} // end namespace scene -} // end namespace irr - diff --git a/source/Irrlicht/CLightSceneNode.h b/source/Irrlicht/CLightSceneNode.h deleted file mode 100644 index a3c96c88..00000000 --- a/source/Irrlicht/CLightSceneNode.h +++ /dev/null @@ -1,109 +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_LIGHT_SCENE_NODE_H_INCLUDED__ -#define __C_LIGHT_SCENE_NODE_H_INCLUDED__ - -#include "ILightSceneNode.h" - -namespace irr -{ -namespace scene -{ - -//! Scene node which is a dynamic light. You can switch the light on and off by -//! making it visible or not, and let it be animated by ordinary scene node animators. -class CLightSceneNode : public ILightSceneNode -{ -public: - - //! constructor - CLightSceneNode(ISceneNode* parent, ISceneManager* mgr, s32 id, - const core::vector3df& position, video::SColorf color, f32 range); - - //! pre render event - virtual void OnRegisterSceneNode() _IRR_OVERRIDE_; - - //! render - virtual void render() _IRR_OVERRIDE_; - - //! set node light data from light info - virtual void setLightData(const video::SLight& light) _IRR_OVERRIDE_; - - //! \return Returns the light data. - virtual const video::SLight& getLightData() const _IRR_OVERRIDE_; - - //! \return Returns the light data. - virtual video::SLight& getLightData() _IRR_OVERRIDE_; - - //! Sets if the node should be visible or not. - /** All children of this node won't be visible either, when set - to true. - \param isVisible If the node shall be visible. */ - virtual void setVisible(bool isVisible) _IRR_OVERRIDE_; - - //! returns the axis aligned bounding box of this node - virtual const core::aabbox3d<f32>& getBoundingBox() const _IRR_OVERRIDE_; - - //! Returns type of the scene node - virtual ESCENE_NODE_TYPE getType() const _IRR_OVERRIDE_ { return ESNT_LIGHT; } - - //! Writes attributes of the scene node. - virtual void serializeAttributes(io::IAttributes* out, io::SAttributeReadWriteOptions* options=0) const _IRR_OVERRIDE_; - - //! Reads attributes of the scene node. - virtual void deserializeAttributes(io::IAttributes* in, io::SAttributeReadWriteOptions* options=0) _IRR_OVERRIDE_; - - //! Creates a clone of this scene node and its children. - virtual ISceneNode* clone(ISceneNode* newParent=0, ISceneManager* newManager=0) _IRR_OVERRIDE_; - - //! Sets the light's radius of influence. - /** Outside this radius the light won't lighten geometry and cast no - shadows. Setting the radius will also influence the attenuation, setting - it to (0,1/radius,0). If you want to override this behavior, set the - attenuation after the radius. - \param radius The new radius. */ - virtual void setRadius(f32 radius) _IRR_OVERRIDE_; - - //! Gets the light's radius of influence. - /** \return The current radius. */ - virtual f32 getRadius() const _IRR_OVERRIDE_; - - //! Sets the light type. - /** \param type The new type. */ - virtual void setLightType(video::E_LIGHT_TYPE type) _IRR_OVERRIDE_; - - //! Gets the light type. - /** \return The current light type. */ - virtual video::E_LIGHT_TYPE getLightType() const _IRR_OVERRIDE_; - - //! Sets whether this light casts shadows. - /** Enabling this flag won't automatically cast shadows, the meshes - will still need shadow scene nodes attached. But one can enable or - disable distinct lights for shadow casting for performance reasons. - \param shadow True if this light shall cast shadows. */ - virtual void enableCastShadow(bool shadow=true) _IRR_OVERRIDE_; - - //! Check whether this light casts shadows. - /** \return True if light would cast shadows, else false. */ - virtual bool getCastShadow() const _IRR_OVERRIDE_; - - //! Updates the absolute position based on the relative and the parents position - virtual void updateAbsolutePosition() _IRR_OVERRIDE_; - -private: - - video::SLight LightData; - core::aabbox3d<f32> BBox; - s32 DriverLightIndex; - bool LightIsOn; - void doLightRecalc(); -}; - - -} // end namespace scene -} // end namespace irr - -#endif - diff --git a/source/Irrlicht/CMD2MeshFileLoader.cpp b/source/Irrlicht/CMD2MeshFileLoader.cpp deleted file mode 100644 index f32e4e3a..00000000 --- a/source/Irrlicht/CMD2MeshFileLoader.cpp +++ /dev/null @@ -1,363 +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_MD2_LOADER_ - -#include "CMD2MeshFileLoader.h" -#include "CAnimatedMeshMD2.h" -#include "os.h" - -namespace irr -{ -namespace scene -{ - - - // structs needed to load the md2-format - - const s32 MD2_MAGIC_NUMBER = 844121161; - const s32 MD2_VERSION = 8; - const s32 MD2_MAX_VERTS = 2048; - -// byte-align structures -#include "irrpack.h" - - struct SMD2Header - { - s32 magic; // four character code "IDP2" - s32 version; // must be 8 - s32 skinWidth; // width of the texture - s32 skinHeight; // height of the texture - s32 frameSize; // size in bytes of an animation frame - s32 numSkins; // number of textures - s32 numVertices; // total number of vertices - s32 numTexcoords; // number of vertices with texture coords - s32 numTriangles; // number of triangles - s32 numGlCommands; // number of opengl commands (triangle strip or triangle fan) - s32 numFrames; // animation keyframe count - s32 offsetSkins; // offset in bytes to 64 character skin names - s32 offsetTexcoords; // offset in bytes to texture coordinate list - s32 offsetTriangles; // offset in bytes to triangle list - s32 offsetFrames; // offset in bytes to frame list - s32 offsetGlCommands;// offset in bytes to opengl commands - s32 offsetEnd; // offset in bytes to end of file - } PACK_STRUCT; - - struct SMD2Vertex - { - u8 vertex[3]; // [0] = X, [1] = Z, [2] = Y - u8 lightNormalIndex; // index in the normal table - } PACK_STRUCT; - - struct SMD2Frame - { - f32 scale[3]; // first scale the vertex position - f32 translate[3]; // then translate the position - c8 name[16]; // the name of the animation that this key belongs to - SMD2Vertex vertices[1]; // vertex 1 of SMD2Header.numVertices - } PACK_STRUCT; - - struct SMD2Triangle - { - u16 vertexIndices[3]; - u16 textureIndices[3]; - } PACK_STRUCT; - - struct SMD2TextureCoordinate - { - s16 s; - s16 t; - } PACK_STRUCT; - - struct SMD2GLCommand - { - f32 s, t; - s32 vertexIndex; - } PACK_STRUCT; - -// Default alignment -#include "irrunpack.h" - -//! Constructor -CMD2MeshFileLoader::CMD2MeshFileLoader() -{ - #ifdef _DEBUG - setDebugName("CMD2MeshFileLoader"); - #endif -} - - -//! returns true if the file maybe is able to be loaded by this class -//! based on the file extension (e.g. ".bsp") -bool CMD2MeshFileLoader::isALoadableFileExtension(const io::path& filename) const -{ - return core::hasFileExtension ( filename, "md2" ); -} - - -//! 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* CMD2MeshFileLoader::createMesh(io::IReadFile* file) -{ - IAnimatedMesh* msh = new CAnimatedMeshMD2(); - if (msh) - { - if (loadFile(file, (CAnimatedMeshMD2*)msh) ) - return msh; - - msh->drop(); - } - - return 0; -} - -//! loads an md2 file -bool CMD2MeshFileLoader::loadFile(io::IReadFile* file, CAnimatedMeshMD2* mesh) -{ - if (!file) - return false; - - SMD2Header header; - - file->read(&header, sizeof(SMD2Header)); - -#ifdef __BIG_ENDIAN__ - header.magic = os::Byteswap::byteswap(header.magic); - header.version = os::Byteswap::byteswap(header.version); - header.skinWidth = os::Byteswap::byteswap(header.skinWidth); - header.skinHeight = os::Byteswap::byteswap(header.skinHeight); - header.frameSize = os::Byteswap::byteswap(header.frameSize); - header.numSkins = os::Byteswap::byteswap(header.numSkins); - header.numVertices = os::Byteswap::byteswap(header.numVertices); - header.numTexcoords = os::Byteswap::byteswap(header.numTexcoords); - header.numTriangles = os::Byteswap::byteswap(header.numTriangles); - header.numGlCommands = os::Byteswap::byteswap(header.numGlCommands); - header.numFrames = os::Byteswap::byteswap(header.numFrames); - header.offsetSkins = os::Byteswap::byteswap(header.offsetSkins); - header.offsetTexcoords = os::Byteswap::byteswap(header.offsetTexcoords); - header.offsetTriangles = os::Byteswap::byteswap(header.offsetTriangles); - header.offsetFrames = os::Byteswap::byteswap(header.offsetFrames); - header.offsetGlCommands = os::Byteswap::byteswap(header.offsetGlCommands); - header.offsetEnd = os::Byteswap::byteswap(header.offsetEnd); -#endif - - if (header.magic != MD2_MAGIC_NUMBER || header.version != MD2_VERSION) - { - os::Printer::log("MD2 Loader: Wrong file header", file->getFileName(), ELL_WARNING); - return false; - } - - // - // prepare mesh and allocate memory - // - - mesh->FrameCount = header.numFrames; - - // create keyframes - mesh->FrameTransforms.set_used(header.numFrames); - - // create vertex arrays for each keyframe - delete [] mesh->FrameList; - mesh->FrameList = new core::array<CAnimatedMeshMD2::SMD2Vert>[header.numFrames]; - - // allocate space in vertex arrays - s32 i; - for (i=0; i<header.numFrames; ++i) - mesh->FrameList[i].reallocate(header.numVertices); - - // allocate interpolation buffer vertices - mesh->InterpolationBuffer->Vertices.set_used(header.numTriangles*3); - - // populate triangles - mesh->InterpolationBuffer->Indices.reallocate(header.numTriangles*3); - const s32 count = header.numTriangles*3; - for (i=0; i<count; i+=3) - { - mesh->InterpolationBuffer->Indices.push_back(i); - mesh->InterpolationBuffer->Indices.push_back(i+1); - mesh->InterpolationBuffer->Indices.push_back(i+2); - } - - // - // read texture coordinates - // - - file->seek(header.offsetTexcoords); - SMD2TextureCoordinate* textureCoords = new SMD2TextureCoordinate[header.numTexcoords]; - - if (!file->read(textureCoords, sizeof(SMD2TextureCoordinate)*header.numTexcoords)) - { - delete[] textureCoords; - os::Printer::log("MD2 Loader: Error reading TextureCoords.", file->getFileName(), ELL_ERROR); - return false; - } - -#ifdef __BIG_ENDIAN__ - for (i=0; i<header.numTexcoords; ++i) - { - textureCoords[i].s = os::Byteswap::byteswap(textureCoords[i].s); - textureCoords[i].t = os::Byteswap::byteswap(textureCoords[i].t); - } -#endif - - // read Triangles - - file->seek(header.offsetTriangles); - - SMD2Triangle *triangles = new SMD2Triangle[header.numTriangles]; - if (!file->read(triangles, header.numTriangles *sizeof(SMD2Triangle))) - { - delete[] triangles; - delete[] textureCoords; - - os::Printer::log("MD2 Loader: Error reading triangles.", file->getFileName(), ELL_ERROR); - return false; - } - -#ifdef __BIG_ENDIAN__ - for (i=0; i<header.numTriangles; ++i) - { - triangles[i].vertexIndices[0] = os::Byteswap::byteswap(triangles[i].vertexIndices[0]); - triangles[i].vertexIndices[1] = os::Byteswap::byteswap(triangles[i].vertexIndices[1]); - triangles[i].vertexIndices[2] = os::Byteswap::byteswap(triangles[i].vertexIndices[2]); - triangles[i].textureIndices[0] = os::Byteswap::byteswap(triangles[i].textureIndices[0]); - triangles[i].textureIndices[1] = os::Byteswap::byteswap(triangles[i].textureIndices[1]); - triangles[i].textureIndices[2] = os::Byteswap::byteswap(triangles[i].textureIndices[2]); - } -#endif - - // read Vertices - - u8 buffer[MD2_MAX_VERTS*4+128]; - SMD2Frame* frame = (SMD2Frame*)buffer; - - file->seek(header.offsetFrames); - - for (i = 0; i<header.numFrames; ++i) - { - // read vertices - - file->read(frame, header.frameSize); - -#ifdef __BIG_ENDIAN__ - frame->scale[0] = os::Byteswap::byteswap(frame->scale[0]); - frame->scale[1] = os::Byteswap::byteswap(frame->scale[1]); - frame->scale[2] = os::Byteswap::byteswap(frame->scale[2]); - frame->translate[0] = os::Byteswap::byteswap(frame->translate[0]); - frame->translate[1] = os::Byteswap::byteswap(frame->translate[1]); - frame->translate[2] = os::Byteswap::byteswap(frame->translate[2]); -#endif - // - // store frame data - // - - CAnimatedMeshMD2::SAnimationData adata; - adata.begin = i; - adata.end = i; - adata.fps = 7; - - // Add new named animation if necessary - if (frame->name[0]) - { - // get animation name - for (s32 s = 0; s < 16 && frame->name[s]!=0 && (frame->name[s] < '0' || frame->name[s] > '9'); ++s) - { - adata.name += frame->name[s]; - } - - // Does this keyframe have the same animation name as the current animation? - if (!mesh->AnimationData.empty() && mesh->AnimationData[mesh->AnimationData.size()-1].name == adata.name) - { - // Increase the length of the animation - ++mesh->AnimationData[mesh->AnimationData.size() - 1].end; - } - else - { - // Add the new animation - mesh->AnimationData.push_back(adata); - } - } - - // save keyframe scale and translation - - mesh->FrameTransforms[i].scale.X = frame->scale[0]; - mesh->FrameTransforms[i].scale.Z = frame->scale[1]; - mesh->FrameTransforms[i].scale.Y = frame->scale[2]; - mesh->FrameTransforms[i].translate.X = frame->translate[0]; - mesh->FrameTransforms[i].translate.Z = frame->translate[1]; - mesh->FrameTransforms[i].translate.Y = frame->translate[2]; - - // add vertices - for (s32 j=0; j<header.numTriangles; ++j) - { - for (u32 ti=0; ti<3; ++ti) - { - CAnimatedMeshMD2::SMD2Vert v; - u32 num = triangles[j].vertexIndices[ti]; - v.Pos.X = frame->vertices[num].vertex[0]; - v.Pos.Z = frame->vertices[num].vertex[1]; - v.Pos.Y = frame->vertices[num].vertex[2]; - v.NormalIdx = frame->vertices[num].lightNormalIndex; - - mesh->FrameList[i].push_back(v); - } - } - - // calculate bounding boxes - if (header.numVertices) - { - core::aabbox3d<f32> box; - core::vector3df pos; - pos.X = f32(mesh->FrameList[i] [0].Pos.X) * mesh->FrameTransforms[i].scale.X + mesh->FrameTransforms[i].translate.X; - pos.Y = f32(mesh->FrameList[i] [0].Pos.Y) * mesh->FrameTransforms[i].scale.Y + mesh->FrameTransforms[i].translate.Y; - pos.Z = f32(mesh->FrameList[i] [0].Pos.Z) * mesh->FrameTransforms[i].scale.Z + mesh->FrameTransforms[i].translate.Z; - - box.reset(pos); - - for (s32 j=1; j<header.numTriangles*3; ++j) - { - pos.X = f32(mesh->FrameList[i] [j].Pos.X) * mesh->FrameTransforms[i].scale.X + mesh->FrameTransforms[i].translate.X; - pos.Y = f32(mesh->FrameList[i] [j].Pos.Y) * mesh->FrameTransforms[i].scale.Y + mesh->FrameTransforms[i].translate.Y; - pos.Z = f32(mesh->FrameList[i] [j].Pos.Z) * mesh->FrameTransforms[i].scale.Z + mesh->FrameTransforms[i].translate.Z; - - box.addInternalPoint(pos); - } - mesh->BoxList.push_back(box); - } - } - - // populate interpolation buffer with texture coordinates and colors - if (header.numFrames) - { - f32 dmaxs = 1.0f/(header.skinWidth); - f32 dmaxt = 1.0f/(header.skinHeight); - - for (s32 t=0; t<header.numTriangles; ++t) - { - for (s32 n=0; n<3; ++n) - { - mesh->InterpolationBuffer->Vertices[t*3 + n].TCoords.X = (textureCoords[triangles[t].textureIndices[n]].s + 0.5f) * dmaxs; - mesh->InterpolationBuffer->Vertices[t*3 + n].TCoords.Y = (textureCoords[triangles[t].textureIndices[n]].t + 0.5f) * dmaxt; - mesh->InterpolationBuffer->Vertices[t*3 + n].Color = video::SColor(255,255,255,255); - } - } - } - - // clean up - delete [] triangles; - delete [] textureCoords; - - // init buffer with start frame. - mesh->getMesh(0); - return true; -} - -} // end namespace scene -} // end namespace irr - - -#endif // _IRR_COMPILE_WITH_MD2_LOADER_ diff --git a/source/Irrlicht/CMD2MeshFileLoader.h b/source/Irrlicht/CMD2MeshFileLoader.h deleted file mode 100644 index 73711a52..00000000 --- a/source/Irrlicht/CMD2MeshFileLoader.h +++ /dev/null @@ -1,45 +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_MD2_MESH_FILE_LOADER_H_INCLUDED__ -#define __C_MD2_MESH_FILE_LOADER_H_INCLUDED__ - -#include "IMeshLoader.h" - -namespace irr -{ -namespace scene -{ - -class CAnimatedMeshMD2; - -//! Meshloader capable of loading MD2 files -class CMD2MeshFileLoader : public IMeshLoader -{ -public: - - //! Constructor - CMD2MeshFileLoader(); - - //! returns true if the file maybe is able to be loaded by this class - //! based on the file extension (e.g. ".bsp") - 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: - //! Loads the file data into the mesh - bool loadFile(io::IReadFile* file, CAnimatedMeshMD2* mesh); - -}; - -} // end namespace scene -} // end namespace irr - -#endif // __C_MD2_MESH_LOADER_H_INCLUDED__ - diff --git a/source/Irrlicht/CMD3MeshFileLoader.cpp b/source/Irrlicht/CMD3MeshFileLoader.cpp deleted file mode 100644 index 68f8d80d..00000000 --- a/source/Irrlicht/CMD3MeshFileLoader.cpp +++ /dev/null @@ -1,53 +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_MD3_LOADER_ - -#include "CMD3MeshFileLoader.h" -#include "CAnimatedMeshMD3.h" -#include "irrString.h" - -namespace irr -{ -namespace scene -{ - -//! Constructor -CMD3MeshFileLoader::CMD3MeshFileLoader( scene::ISceneManager* smgr) -: SceneManager(smgr) -{ -} - - -//! destructor -CMD3MeshFileLoader::~CMD3MeshFileLoader() -{ -} - - -//! returns true if the file maybe is able to be loaded by this class -//! based on the file extension (e.g. ".bsp") -bool CMD3MeshFileLoader::isALoadableFileExtension(const io::path& filename) const -{ - return core::hasFileExtension ( filename, "md3" ); -} - - -IAnimatedMesh* CMD3MeshFileLoader::createMesh(io::IReadFile* file) -{ - CAnimatedMeshMD3 * mesh = new CAnimatedMeshMD3(); - - if ( mesh->loadModelFile ( 0, file, SceneManager->getFileSystem(), SceneManager->getVideoDriver() ) ) - return mesh; - - mesh->drop (); - return 0; -} - - -} // end namespace scene -} // end namespace irr - -#endif // _IRR_COMPILE_WITH_MD3_LOADER_ diff --git a/source/Irrlicht/CMD3MeshFileLoader.h b/source/Irrlicht/CMD3MeshFileLoader.h deleted file mode 100644 index c2684502..00000000 --- a/source/Irrlicht/CMD3MeshFileLoader.h +++ /dev/null @@ -1,49 +0,0 @@ -// Copyright (C) 2002-2012 Nikolaus Gebhardt / Thomas Alten -// This file is part of the "Irrlicht Engine". -// For conditions of distribution and use, see copyright notice in irrlicht.h - -#ifndef __C_MD3_MESH_FILE_LOADER_H_INCLUDED__ -#define __C_MD3_MESH_FILE_LOADER_H_INCLUDED__ - -#include "IMeshLoader.h" -#include "IFileSystem.h" -#include "IVideoDriver.h" -#include "ISceneManager.h" -#include "IQ3Shader.h" - -namespace irr -{ -namespace scene -{ - -//! Meshloader capable of loading md3 files. -class CMD3MeshFileLoader : public IMeshLoader -{ -public: - - //! Constructor - CMD3MeshFileLoader( scene::ISceneManager* smgr ); - - //! destructor - virtual ~CMD3MeshFileLoader(); - - //! returns true if the file maybe is able to be loaded by this class - //! based on the file extension (e.g. ".bsp") - 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: - scene::ISceneManager* SceneManager; - -}; - -} // end namespace scene -} // end namespace irr - -#endif - diff --git a/source/Irrlicht/CMS3DMeshFileLoader.cpp b/source/Irrlicht/CMS3DMeshFileLoader.cpp deleted file mode 100644 index 4ad18aa2..00000000 --- a/source/Irrlicht/CMS3DMeshFileLoader.cpp +++ /dev/null @@ -1,872 +0,0 @@ -// Copyright (C) 2002-2012 Nikolaus Gebhardt -// 2019 additional alignment and big_endian fixes by Corto and Salas00 -// 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_MS3D_LOADER_ - -#include "IReadFile.h" -#include "os.h" -#include "CMS3DMeshFileLoader.h" -#include "CSkinnedMesh.h" - - -namespace irr -{ -namespace scene -{ - -#ifdef _DEBUG -#define _IRR_DEBUG_MS3D_LOADER_ -#endif - -// byte-align structures -#include "irrpack.h" - -namespace { -// File header -struct MS3DHeader -{ - char ID[10]; - int Version; -} PACK_STRUCT; - -// Vertex information -struct MS3DVertex -{ - u8 pad1[3]; - u8 Flags; - float Vertex[3]; - char BoneID; - u8 RefCount; - u8 pad2[2]; -} PACK_STRUCT; - -#define MS3DVERTEX_NUM_PAD_BYTES 5 - -// Triangle information -struct MS3DTriangle -{ - u16 Flags; - u16 VertexIndices[3]; - float VertexNormals[3][3]; - float S[3], T[3]; - u8 SmoothingGroup; - u8 GroupIndex; - u8 pad1[2]; -} PACK_STRUCT; - -#define MS3DTRIANGLE_NUM_PAD_BYTES 2 - -// Material information -struct MS3DMaterial -{ - char Name[32]; - float Ambient[4]; - float Diffuse[4]; - float Specular[4]; - float Emissive[4]; - float Shininess; // 0.0f - 128.0f - float Transparency; // 0.0f - 1.0f - u8 Mode; // 0, 1, 2 is unused now - char Texture[128]; - char Alphamap[128]; - u8 pad1[3]; -} PACK_STRUCT; - -#define MS3DMATERIAL_NUM_PAD_BYTES 3 - -// Joint information -struct MS3DJoint -{ - u8 pad[3]; - u8 Flags; - char Name[32]; - char ParentName[32]; - float Rotation[3]; - float Translation[3]; - u16 NumRotationKeyframes; - u16 NumTranslationKeyframes; -} PACK_STRUCT; - -#define MS3DJOINT_NUM_PAD_BYTES 3 - -// Keyframe data -struct MS3DKeyframe -{ - float Time; - float Parameter[3]; -} PACK_STRUCT; - -// vertex weights in 1.8.x -struct MS3DVertexWeights -{ - char boneIds[3]; - u8 weights[3]; -} PACK_STRUCT; - -} // end namespace - -// Default alignment -#include "irrunpack.h" - -// Get float encoded in little endian in way not causing troubles when floats have to be memory aligned. -static inline float get_unaligned_le_float(const u8 *ptr) -{ - union { - u8 u[4]; - float f; - } tmp; -#ifdef __BIG_ENDIAN__ - tmp.u[0] = ptr[3]; - tmp.u[1] = ptr[2]; - tmp.u[2] = ptr[1]; - tmp.u[3] = ptr[0]; -#else - tmp.f = *(float*)ptr; -#endif - return tmp.f; -} - - -struct SGroup -{ - core::stringc Name; - core::array<u16> VertexIds; - u16 MaterialIdx; -}; - -//! Constructor -CMS3DMeshFileLoader::CMS3DMeshFileLoader(video::IVideoDriver *driver) -: Driver(driver), AnimatedMesh(0) -{ - #ifdef _DEBUG - setDebugName("CMS3DMeshFileLoader"); - #endif -} - - -//! returns true if the file maybe is able to be loaded by this class -//! based on the file extension (e.g. ".bsp") -bool CMS3DMeshFileLoader::isALoadableFileExtension(const io::path& filename) const -{ - return core::hasFileExtension ( filename, "ms3d" ); -} - - -//! 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* CMS3DMeshFileLoader::createMesh(io::IReadFile* file) -{ - if (!file) - return 0; - - AnimatedMesh = new CSkinnedMesh(); - - if ( load(file) ) - { - AnimatedMesh->finalize(); - } - else - { - AnimatedMesh->drop(); - AnimatedMesh = 0; - } - - return AnimatedMesh; -} - - -//! loads a milkshape file -bool CMS3DMeshFileLoader::load(io::IReadFile* file) -{ - if (!file) - return false; - - // find file size - const long fileSize = file->getSize(); - - // read whole file - - u8* buffer = new u8[fileSize]; - size_t read = file->read(buffer, fileSize); - if (read != (size_t)fileSize) - { - delete [] buffer; - os::Printer::log("Could not read full file. Loading failed", file->getFileName(), ELL_ERROR); - return false; - } - - // read header - - const u8 *pPtr = (u8*)((void*)buffer); - MS3DHeader *pHeader = (MS3DHeader*)pPtr; - pPtr += sizeof(MS3DHeader); - - if ( strncmp( pHeader->ID, "MS3D000000", 10 ) != 0 ) - { - delete [] buffer; - os::Printer::log("Not a valid Milkshape3D Model File. Loading failed", file->getFileName(), ELL_ERROR); - return false; - } - -#ifdef __BIG_ENDIAN__ - pHeader->Version = os::Byteswap::byteswap(pHeader->Version); -#endif - if ( pHeader->Version < 3 || pHeader->Version > 4 ) - { - delete [] buffer; - os::Printer::log("Only Milkshape3D version 3 and 4 (1.3 to 1.8) is supported. Loading failed", file->getFileName(), ELL_ERROR); - return false; - } -#ifdef _IRR_DEBUG_MS3D_LOADER_ - os::Printer::log("Loaded header version", core::stringc(pHeader->Version).c_str()); -#endif - - // get pointers to data - - // vertices - u16 numVertices = *(u16*)pPtr; -#ifdef __BIG_ENDIAN__ - numVertices = os::Byteswap::byteswap(numVertices); -#endif -#ifdef _IRR_DEBUG_MS3D_LOADER_ - os::Printer::log("Load vertices", core::stringc(numVertices).c_str()); -#endif - - pPtr += sizeof(u16); - MS3DVertex *vertices = new MS3DVertex[numVertices]; - if (pPtr + ((sizeof(MS3DVertex) - MS3DVERTEX_NUM_PAD_BYTES) * numVertices) > buffer+fileSize) - { - delete [] buffer; - os::Printer::log("Loading failed. Corrupted data found.", file->getFileName(), ELL_ERROR); - return false; - } - for (u16 tmp=0; tmp<numVertices; ++tmp) - { - //printf("&vertices[tmp].Vertex[0] = %p (%d)\n", &vertices[tmp].Vertex[0], (int)((long long)(&vertices[tmp].Vertex[0]) % 4)); - memcpy(&vertices[tmp].Flags, pPtr, sizeof(struct MS3DVertex) - MS3DVERTEX_NUM_PAD_BYTES); -#ifdef __BIG_ENDIAN__ - vertices[tmp].Vertex[0] = os::Byteswap::byteswap(vertices[tmp].Vertex[0]); - vertices[tmp].Vertex[1] = os::Byteswap::byteswap(vertices[tmp].Vertex[1]); - vertices[tmp].Vertex[2] = -os::Byteswap::byteswap(vertices[tmp].Vertex[2]); -#else - vertices[tmp].Vertex[2] = -vertices[tmp].Vertex[2]; -#endif - // Go to the next vertex structure - pPtr += sizeof(struct MS3DVertex) - MS3DVERTEX_NUM_PAD_BYTES; - } - - // triangles - u16 numTriangles = *(u16*)pPtr; -#ifdef __BIG_ENDIAN__ - numTriangles = os::Byteswap::byteswap(numTriangles); -#endif -#ifdef _IRR_DEBUG_MS3D_LOADER_ - os::Printer::log("Load Triangles", core::stringc(numTriangles).c_str()); -#endif - pPtr += sizeof(u16); - MS3DTriangle *triangles = new MS3DTriangle[numTriangles]; - if (pPtr + ((sizeof(MS3DTriangle) - MS3DTRIANGLE_NUM_PAD_BYTES) * numTriangles) > buffer+fileSize) - { - delete [] buffer; - os::Printer::log("Loading failed. Corrupted data found.", file->getFileName(), ELL_ERROR); - return false; - } - for (u16 tmp=0; tmp<numTriangles; ++tmp) - { - memcpy(&triangles[tmp].Flags, pPtr, sizeof(struct MS3DTriangle) - MS3DTRIANGLE_NUM_PAD_BYTES); -#ifdef __BIG_ENDIAN__ - triangles[tmp].Flags = os::Byteswap::byteswap(triangles[tmp].Flags); - for (u16 j=0; j<3; ++j) - { - triangles[tmp].VertexIndices[j] = os::Byteswap::byteswap(triangles[tmp].VertexIndices[j]); - triangles[tmp].VertexNormals[j][0] = os::Byteswap::byteswap(triangles[tmp].VertexNormals[j][0]); - triangles[tmp].VertexNormals[j][1] = os::Byteswap::byteswap(triangles[tmp].VertexNormals[j][1]); - triangles[tmp].VertexNormals[j][2] = -os::Byteswap::byteswap(triangles[tmp].VertexNormals[j][2]); - triangles[tmp].S[j] = os::Byteswap::byteswap(triangles[tmp].S[j]); - triangles[tmp].T[j] = os::Byteswap::byteswap(triangles[tmp].T[j]); - } -#else - triangles[tmp].VertexNormals[0][2] = -triangles[tmp].VertexNormals[0][2]; - triangles[tmp].VertexNormals[1][2] = -triangles[tmp].VertexNormals[1][2]; - triangles[tmp].VertexNormals[2][2] = -triangles[tmp].VertexNormals[2][2]; -#endif - // Go to the next triangle structure - pPtr += sizeof(struct MS3DTriangle) - MS3DTRIANGLE_NUM_PAD_BYTES; - } - - // groups - u16 numGroups = *(u16*)pPtr; -#ifdef __BIG_ENDIAN__ - numGroups = os::Byteswap::byteswap(numGroups); -#endif -#ifdef _IRR_DEBUG_MS3D_LOADER_ - os::Printer::log("Load Groups", core::stringc(numGroups).c_str()); -#endif - pPtr += sizeof(u16); - - core::array<SGroup> groups; - groups.reallocate(numGroups); - - //store groups - u32 i; - for (i=0; i<numGroups; ++i) - { - groups.push_back(SGroup()); - SGroup& grp = groups.getLast(); - - // The byte flag is before the name, so add 1 - grp.Name = ((const c8*) pPtr) + 1; - - pPtr += 33; // name and 1 byte flags - u16 triangleCount = *(u16*)pPtr; -#ifdef __BIG_ENDIAN__ - triangleCount = os::Byteswap::byteswap(triangleCount); -#endif - pPtr += sizeof(u16); - grp.VertexIds.reallocate(triangleCount); - - //pPtr += sizeof(u16) * triangleCount; // triangle indices - for (u16 j=0; j<triangleCount; ++j) - { -#ifdef __BIG_ENDIAN__ - grp.VertexIds.push_back(os::Byteswap::byteswap(*(u16*)pPtr)); -#else - grp.VertexIds.push_back(*(u16*)pPtr); -#endif - pPtr += sizeof (u16); - } - - grp.MaterialIdx = *(u8*)pPtr; - if (grp.MaterialIdx == 255) - grp.MaterialIdx = 0; - - pPtr += sizeof(c8); // material index - if (pPtr > buffer+fileSize) - { - delete [] buffer; - os::Printer::log("Loading failed. Corrupted data found.", file->getFileName(), ELL_ERROR); - return false; - } - } - - // load materials - u16 numMaterials = *(u16*)pPtr; -#ifdef __BIG_ENDIAN__ - numMaterials = os::Byteswap::byteswap(numMaterials); -#endif -#ifdef _IRR_DEBUG_MS3D_LOADER_ - os::Printer::log("Load Materials", core::stringc(numMaterials).c_str()); -#endif - pPtr += sizeof(u16); - - if(numMaterials == 0) - { - // if there are no materials, add at least one buffer - AnimatedMesh->addMeshBuffer(); - } - - MS3DMaterial *material = new MS3DMaterial; - for (i=0; i<numMaterials; ++i) - { - memcpy(material, pPtr, sizeof(struct MS3DMaterial) - MS3DMATERIAL_NUM_PAD_BYTES); -#ifdef __BIG_ENDIAN__ - for (u16 j=0; j<4; ++j) - material->Ambient[j] = os::Byteswap::byteswap(material->Ambient[j]); - for (u16 j=0; j<4; ++j) - material->Diffuse[j] = os::Byteswap::byteswap(material->Diffuse[j]); - for (u16 j=0; j<4; ++j) - material->Specular[j] = os::Byteswap::byteswap(material->Specular[j]); - for (u16 j=0; j<4; ++j) - material->Emissive[j] = os::Byteswap::byteswap(material->Emissive[j]); - material->Shininess = os::Byteswap::byteswap(material->Shininess); - material->Transparency = os::Byteswap::byteswap(material->Transparency); -#endif - pPtr += (sizeof(MS3DMaterial) - MS3DMATERIAL_NUM_PAD_BYTES); - if (pPtr > buffer+fileSize) - { - delete [] buffer; - os::Printer::log("Loading failed. Corrupted data found.", file->getFileName(), ELL_ERROR); - return false; - } - - scene::SSkinMeshBuffer *tmpBuffer = AnimatedMesh->addMeshBuffer(); - - tmpBuffer->Material.MaterialType = video::EMT_SOLID; - - tmpBuffer->Material.AmbientColor = video::SColorf(material->Ambient[0], material->Ambient[1], material->Ambient[2], material->Ambient[3]).toSColor (); - tmpBuffer->Material.DiffuseColor = video::SColorf(material->Diffuse[0], material->Diffuse[1], material->Diffuse[2], material->Diffuse[3]).toSColor (); - tmpBuffer->Material.EmissiveColor = video::SColorf(material->Emissive[0], material->Emissive[1], material->Emissive[2], material->Emissive[3]).toSColor (); - tmpBuffer->Material.SpecularColor = video::SColorf(material->Specular[0], material->Specular[1], material->Specular[2], material->Specular[3]).toSColor (); - tmpBuffer->Material.Shininess = material->Shininess; - - core::stringc TexturePath(material->Texture); - if (TexturePath.trim()!="") - { - TexturePath=stripPathFromString(file->getFileName(),true) + stripPathFromString(TexturePath,false); - tmpBuffer->Material.setTexture(0, Driver->getTexture(TexturePath)); - } - - core::stringc AlphamapPath=(const c8*)material->Alphamap; - if (AlphamapPath.trim()!="") - { - AlphamapPath=stripPathFromString(file->getFileName(),true) + stripPathFromString(AlphamapPath,false); - tmpBuffer->Material.setTexture(2, Driver->getTexture(AlphamapPath)); - } - } - delete material; - - // animation time - - - f32 framesPerSecond = get_unaligned_le_float(pPtr); - -#ifdef _IRR_DEBUG_MS3D_LOADER_ - os::Printer::log("FPS", core::stringc(framesPerSecond).c_str()); -#endif - pPtr += sizeof(float) * 2; // fps and current time - - if (framesPerSecond<1.f) - framesPerSecond=1.f; - AnimatedMesh->setAnimationSpeed(framesPerSecond); - -// ignore, calculated inside SkinnedMesh -// s32 frameCount = *(int*)pPtr; -#ifdef __BIG_ENDIAN__ -// frameCount = os::Byteswap::byteswap(frameCount); -#endif - pPtr += sizeof(int); - - u16 jointCount = *(u16*)pPtr; -#ifdef __BIG_ENDIAN__ - jointCount = os::Byteswap::byteswap(jointCount); -#endif -#ifdef _IRR_DEBUG_MS3D_LOADER_ - os::Printer::log("Joints", core::stringc(jointCount).c_str()); -#endif - pPtr += sizeof(u16); - if (pPtr > buffer+fileSize) - { - delete [] buffer; - os::Printer::log("Loading failed. Corrupted data found.", file->getFileName(), ELL_ERROR); - return false; - } - - core::array<core::stringc> parentNames; - parentNames.reallocate(jointCount); - - // load joints - for (i=0; i<jointCount; ++i) - { - u32 j; - MS3DJoint *pJoint = new MS3DJoint; - //printf("&pJoint->Rotation[0] = %p (%d)\n", &pJoint->Rotation[0], (int)((long long)(&pJoint->Rotation[0]) % 4)); - memcpy(&pJoint->Flags, pPtr, sizeof(MS3DJoint) - MS3DJOINT_NUM_PAD_BYTES); - -#ifdef __BIG_ENDIAN__ - for (j=0; j<3; ++j) - pJoint->Rotation[j] = os::Byteswap::byteswap(pJoint->Rotation[j]); - for (j=0; j<3; ++j) - pJoint->Translation[j] = os::Byteswap::byteswap(pJoint->Translation[j]); - pJoint->NumRotationKeyframes= os::Byteswap::byteswap(pJoint->NumRotationKeyframes); - pJoint->NumTranslationKeyframes = os::Byteswap::byteswap(pJoint->NumTranslationKeyframes); -#endif - pPtr = pPtr + sizeof(MS3DJoint) - MS3DJOINT_NUM_PAD_BYTES; - if (pPtr > buffer+fileSize) - { - delete [] buffer; - os::Printer::log("Loading failed. Corrupted data found.", file->getFileName(), ELL_ERROR); - return false; - } - - ISkinnedMesh::SJoint *jnt = AnimatedMesh->addJoint(); - - jnt->Name = pJoint->Name; -#ifdef _IRR_DEBUG_MS3D_LOADER_ - os::Printer::log("Joint", jnt->Name.c_str()); - os::Printer::log("Rotation keyframes", core::stringc(pJoint->NumRotationKeyframes).c_str()); - os::Printer::log("Translation keyframes", core::stringc(pJoint->NumTranslationKeyframes).c_str()); -#endif - jnt->LocalMatrix.makeIdentity(); - jnt->LocalMatrix.setRotationRadians( - core::vector3df(pJoint->Rotation[0], pJoint->Rotation[1], pJoint->Rotation[2]) ); - // convert right-handed to left-handed - jnt->LocalMatrix[2]=-jnt->LocalMatrix[2]; - jnt->LocalMatrix[6]=-jnt->LocalMatrix[6]; - jnt->LocalMatrix[8]=-jnt->LocalMatrix[8]; - jnt->LocalMatrix[9]=-jnt->LocalMatrix[9]; - - jnt->LocalMatrix.setTranslation( - core::vector3df(pJoint->Translation[0], pJoint->Translation[1], -pJoint->Translation[2]) ); - jnt->Animatedposition.set(jnt->LocalMatrix.getTranslation()); - jnt->Animatedrotation.set(jnt->LocalMatrix.getRotationDegrees()); - - parentNames.push_back( (c8*)pJoint->ParentName ); - - /*if (pJoint->NumRotationKeyframes || - pJoint->NumTranslationKeyframes) - HasAnimation = true; - */ - - MS3DKeyframe* kf = new MS3DKeyframe; - - // get rotation keyframes - const u16 numRotationKeyframes = pJoint->NumRotationKeyframes; - for (j=0; j < numRotationKeyframes; ++j) - { - memcpy(kf, pPtr, sizeof(MS3DKeyframe)); - //printf("rotation kf = %p (%d)\n", kf, (int)((long long)kf % 4)); -#ifdef __BIG_ENDIAN__ - kf->Time = os::Byteswap::byteswap(kf->Time); - for (u32 l=0; l<3; ++l) - kf->Parameter[l] = os::Byteswap::byteswap(kf->Parameter[l]); -#endif - pPtr += sizeof(MS3DKeyframe); - if (pPtr > buffer+fileSize) - { - delete [] buffer; - os::Printer::log("Loading failed. Corrupted data found.", file->getFileName(), ELL_ERROR); - return false; - } - - ISkinnedMesh::SRotationKey *k=AnimatedMesh->addRotationKey(jnt); - k->frame = kf->Time * framesPerSecond-1; - - core::matrix4 tmpMatrix; - - tmpMatrix.setRotationRadians( - core::vector3df(kf->Parameter[0], kf->Parameter[1], kf->Parameter[2]) ); - // convert right-handed to left-handed - tmpMatrix[2]=-tmpMatrix[2]; - tmpMatrix[6]=-tmpMatrix[6]; - tmpMatrix[8]=-tmpMatrix[8]; - tmpMatrix[9]=-tmpMatrix[9]; - - tmpMatrix=jnt->LocalMatrix*tmpMatrix; - - // IRR_TEST_BROKEN_QUATERNION_USE: TODO - switched from tmpMatrix to tmpMatrix.getTransposed() for downward compatibility. - // Not tested so far if this was correct or wrong before quaternion fix! - k->rotation = core::quaternion(tmpMatrix.getTransposed()); - } - - // get translation keyframes - const u16 numTranslationKeyframes = pJoint->NumTranslationKeyframes; - for (j=0; j<numTranslationKeyframes; ++j) - { - memcpy(kf, pPtr, sizeof(MS3DKeyframe)); - //printf("translation kf = %p (%d)\n", kf, (int)((long long)kf % 4)); - -#ifdef __BIG_ENDIAN__ - kf->Time = os::Byteswap::byteswap(kf->Time); - for (u32 l=0; l<3; ++l) - kf->Parameter[l] = os::Byteswap::byteswap(kf->Parameter[l]); -#endif - pPtr += sizeof(MS3DKeyframe); - if (pPtr > buffer+fileSize) - { - delete [] buffer; - os::Printer::log("Loading failed. Corrupted data found.", file->getFileName(), ELL_ERROR); - return false; - } - - ISkinnedMesh::SPositionKey *k=AnimatedMesh->addPositionKey(jnt); - k->frame = kf->Time * framesPerSecond-1; - - k->position = core::vector3df - (kf->Parameter[0]+pJoint->Translation[0], - kf->Parameter[1]+pJoint->Translation[1], - -kf->Parameter[2]-pJoint->Translation[2]); - } - - delete kf; - delete pJoint; - } - - core::array<MS3DVertexWeights> vertexWeights; - f32 weightFactor=0; - - if (jointCount && (pHeader->Version == 4) && (pPtr < buffer+fileSize)) - { - s32 subVersion = *(s32*)pPtr; // comment subVersion, always 1 -#ifdef __BIG_ENDIAN__ - subVersion = os::Byteswap::byteswap(subVersion); -#endif - pPtr += sizeof(s32); - - for (u32 j=0; j<4; ++j) // four comment groups - { -#ifdef _IRR_DEBUG_MS3D_LOADER_ - os::Printer::log("Skipping comment group", core::stringc(j+1).c_str()); -#endif - u32 numComments = *(u32*)pPtr; -#ifdef __BIG_ENDIAN__ - numComments = os::Byteswap::byteswap(numComments); -#endif - pPtr += sizeof(u32); - for (i=0; i<numComments; ++i) - { - // according to scorpiomidget this field does - // not exist for model comments. So avoid to - // read it - if (j!=3) - pPtr += sizeof(s32); // index - s32 commentLength = *(s32*)pPtr; -#ifdef __BIG_ENDIAN__ - commentLength = os::Byteswap::byteswap(commentLength); -#endif - pPtr += sizeof(s32); - pPtr += commentLength; - } - - if (pPtr > buffer+fileSize) - { - delete [] buffer; - os::Printer::log("Loading failed. Corrupted data found.", file->getFileName(), ELL_ERROR); - return false; - } - } - - if (pPtr < buffer+fileSize) - { - subVersion = *(s32*)pPtr; // vertex subVersion, 1 or 2 -#ifdef __BIG_ENDIAN__ - subVersion = os::Byteswap::byteswap(subVersion); -#endif - if (subVersion==1) - weightFactor=1.f/255.f; - else - weightFactor=1.f/100.f; - pPtr += sizeof(s32); - -#ifdef _IRR_DEBUG_MS3D_LOADER_ - os::Printer::log("Reading vertex weights"); -#endif - // read vertex weights, ignoring data 'extra' from 1.8.2 - vertexWeights.reallocate(numVertices); - const char offset = (subVersion==1)?6:10; - for (i=0; i<numVertices; ++i) - { - vertexWeights.push_back(*(MS3DVertexWeights*)pPtr); - pPtr += offset; - } - - if (pPtr > buffer+fileSize) - { - delete [] buffer; - os::Printer::log("Loading failed. Corrupted data found.", file->getFileName(), ELL_ERROR); - return false; - } - } - - if (pPtr < buffer+fileSize) - { - subVersion = *(s32*)pPtr; // joint subVersion, 1 or 2 -#ifdef __BIG_ENDIAN__ - subVersion = os::Byteswap::byteswap(subVersion); -#endif - pPtr += sizeof(s32); - // skip joint colors -#ifdef _IRR_DEBUG_MS3D_LOADER_ - os::Printer::log("Skip joint color"); -#endif - pPtr += 3*sizeof(float)*jointCount; - - if (pPtr > buffer+fileSize) - { - delete [] buffer; - os::Printer::log("Loading failed. Corrupted data found", file->getFileName(), ELL_ERROR); - return false; - } - } - - if (pPtr < buffer+fileSize) - { - subVersion = *(s32*)pPtr; // model subVersion, 1 or 2 -#ifdef __BIG_ENDIAN__ - subVersion = os::Byteswap::byteswap(subVersion); -#endif - pPtr += sizeof(s32); -#ifdef _IRR_DEBUG_MS3D_LOADER_ - os::Printer::log("Skip model extra information"); -#endif - // now the model extra information would follow - // we also skip this for now - } - } - - //find parent of every joint - for (u32 jointnum=0; jointnum<AnimatedMesh->getAllJoints().size(); ++jointnum) - { - for (u32 j2=0; j2<AnimatedMesh->getAllJoints().size(); ++j2) - { - if (jointnum != j2 && parentNames[jointnum] == AnimatedMesh->getAllJoints()[j2]->Name ) - { - AnimatedMesh->getAllJoints()[j2]->Children.push_back(AnimatedMesh->getAllJoints()[jointnum]); - break; - } - } - } - - // create vertices and indices, attach them to the joints. - video::S3DVertex v; - core::array<video::S3DVertex> *Vertices; - core::array<u16> Indices; - - for (i=0; i<numTriangles; ++i) - { - u32 tmp = groups[triangles[i].GroupIndex].MaterialIdx; - Vertices = &AnimatedMesh->getMeshBuffers()[tmp]->Vertices_Standard; - - for (s32 j = 2; j!=-1; --j) - { - const u32 vertidx = triangles[i].VertexIndices[j]; - - v.TCoords.X = triangles[i].S[j]; - v.TCoords.Y = triangles[i].T[j]; - - v.Normal.X = triangles[i].VertexNormals[j][0]; - v.Normal.Y = triangles[i].VertexNormals[j][1]; - v.Normal.Z = triangles[i].VertexNormals[j][2]; - - if(triangles[i].GroupIndex < groups.size() && - groups[triangles[i].GroupIndex].MaterialIdx < AnimatedMesh->getMeshBuffers().size()) - v.Color = AnimatedMesh->getMeshBuffers()[groups[triangles[i].GroupIndex].MaterialIdx]->Material.DiffuseColor; - else - v.Color.set(255,255,255,255); - - v.Pos.X = vertices[vertidx].Vertex[0]; - v.Pos.Y = vertices[vertidx].Vertex[1]; - v.Pos.Z = vertices[vertidx].Vertex[2]; - - // check if we already have this vertex in our vertex array - s32 index = -1; - for (u32 iV = 0; iV < Vertices->size(); ++iV) - { - if (v == (*Vertices)[iV]) - { - index = (s32)iV; - break; - } - } - - if (index == -1) - { - index = Vertices->size(); - const u32 matidx = groups[triangles[i].GroupIndex].MaterialIdx; - if (vertexWeights.size()==0) - { - const s32 boneid = vertices[vertidx].BoneID; - if ((u32)boneid < AnimatedMesh->getAllJoints().size()) - { - ISkinnedMesh::SWeight *w=AnimatedMesh->addWeight(AnimatedMesh->getAllJoints()[boneid]); - w->buffer_id = matidx; - w->strength = 1.0f; - w->vertex_id = index; - } - } - else if (jointCount) // new weights from 1.8.x - { - f32 sum = 1.0f; - s32 boneid = vertices[vertidx].BoneID; - if (((u32)boneid < AnimatedMesh->getAllJoints().size()) && (vertexWeights[vertidx].weights[0] != 0)) - { - ISkinnedMesh::SWeight *w=AnimatedMesh->addWeight(AnimatedMesh->getAllJoints()[boneid]); - w->buffer_id = matidx; - sum -= (w->strength = vertexWeights[vertidx].weights[0]*weightFactor); - w->vertex_id = index; - } - boneid = vertexWeights[vertidx].boneIds[0]; - if (((u32)boneid < AnimatedMesh->getAllJoints().size()) && (vertexWeights[vertidx].weights[1] != 0)) - { - ISkinnedMesh::SWeight *w=AnimatedMesh->addWeight(AnimatedMesh->getAllJoints()[boneid]); - w->buffer_id = matidx; - sum -= (w->strength = vertexWeights[vertidx].weights[1]*weightFactor); - w->vertex_id = index; - } - boneid = vertexWeights[vertidx].boneIds[1]; - if (((u32)boneid < AnimatedMesh->getAllJoints().size()) && (vertexWeights[vertidx].weights[2] != 0)) - { - ISkinnedMesh::SWeight *w=AnimatedMesh->addWeight(AnimatedMesh->getAllJoints()[boneid]); - w->buffer_id = matidx; - sum -= (w->strength = vertexWeights[vertidx].weights[2]*weightFactor); - w->vertex_id = index; - } - boneid = vertexWeights[vertidx].boneIds[2]; - if (((u32)boneid < AnimatedMesh->getAllJoints().size()) && (sum > 0.f)) - { - ISkinnedMesh::SWeight *w=AnimatedMesh->addWeight(AnimatedMesh->getAllJoints()[boneid]); - w->buffer_id = matidx; - w->strength = sum; - w->vertex_id = index; - } - // fallback, if no bone chosen. Seems to be an error in the specs - boneid = vertices[vertidx].BoneID; - if ((sum == 1.f) && ((u32)boneid < AnimatedMesh->getAllJoints().size())) - { - ISkinnedMesh::SWeight *w=AnimatedMesh->addWeight(AnimatedMesh->getAllJoints()[boneid]); - w->buffer_id = matidx; - w->strength = 1.f; - w->vertex_id = index; - } - } - - Vertices->push_back(v); - } - Indices.push_back(index); - } - } - - //create groups - s32 iIndex = -1; - for (i=0; i<groups.size(); ++i) - { - SGroup& grp = groups[i]; - - if (grp.MaterialIdx >= AnimatedMesh->getMeshBuffers().size()) - grp.MaterialIdx = 0; - - core::array<u16>& indices = AnimatedMesh->getMeshBuffers()[grp.MaterialIdx]->Indices; - - for (u32 k=0; k < grp.VertexIds.size(); ++k) - for (u32 l=0; l<3; ++l) - indices.push_back(Indices[++iIndex]); - } - - delete [] buffer; - delete [] triangles; - delete [] vertices; - - return true; -} - - -core::stringc CMS3DMeshFileLoader::stripPathFromString(const core::stringc& inString, bool returnPath) const -{ - s32 slashIndex=inString.findLast('/'); // forward slash - s32 backSlash=inString.findLast('\\'); // back slash - - if (backSlash>slashIndex) slashIndex=backSlash; - - if (slashIndex==-1)//no slashes found - { - if (returnPath) - return core::stringc(); //no path to return - else - return inString; - } - - if (returnPath) - return inString.subString(0, slashIndex + 1); - else - return inString.subString(slashIndex+1, inString.size() - (slashIndex+1)); -} - - -} // end namespace scene -} // end namespace irr - -#endif diff --git a/source/Irrlicht/CMS3DMeshFileLoader.h b/source/Irrlicht/CMS3DMeshFileLoader.h deleted file mode 100644 index 5bcefb41..00000000 --- a/source/Irrlicht/CMS3DMeshFileLoader.h +++ /dev/null @@ -1,49 +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_MS3D_MESH_FILE_LOADER_H_INCLUDED__ -#define __C_MS3D_MESH_FILE_LOADER_H_INCLUDED__ - -#include "IMeshLoader.h" -#include "IVideoDriver.h" -#include "CSkinnedMesh.h" - -namespace irr -{ -namespace scene -{ - -//! Meshloader capable of loading Milkshape 3D files -class CMS3DMeshFileLoader : public IMeshLoader -{ -public: - - //! Constructor - CMS3DMeshFileLoader(video::IVideoDriver* driver); - - //! returns true if the file might be loadable by this class - //! based on the file extension (e.g. ".bsp") - 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: - - core::stringc stripPathFromString(const core::stringc& inString, bool returnPath) const; - - bool load(io::IReadFile* file); - video::IVideoDriver* Driver; - CSkinnedMesh* AnimatedMesh; -}; - -} // end namespace scene -} // end namespace irr - -#endif - - diff --git a/source/Irrlicht/CMY3DHelper.h b/source/Irrlicht/CMY3DHelper.h deleted file mode 100644 index c1566d11..00000000 --- a/source/Irrlicht/CMY3DHelper.h +++ /dev/null @@ -1,445 +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 -// -// This file was originally written by ZDimitor. - -//---------------------------------------------------------------------- -// somefuncs.h - part of the My3D Tools -// -// This tool was created by Zhuck Dmitry (ZDimitor). -// Everyone can use it as wants ( i'll be happy if it helps to someone :) ). -//---------------------------------------------------------------------- - -//********************************************************************** -// some useful functions -//********************************************************************** - -#ifndef __C_MY3D_HELPER_H_INCLUDED__ -#define __C_MY3D_HELPER_H_INCLUDED__ - -#include "irrTypes.h" - -namespace irr -{ -namespace scene -{ - -//********************************************************************** -// MY3D stuff -//********************************************************************** - -// byte-align structures -#include "irrpack.h" - -struct SMyVector3 -{ SMyVector3 () {;} - SMyVector3 (f32 __X, f32 __Y, f32 __Z) - : X(__X), Y(__Y), Z(__Z) {} - f32 X, Y, Z; -} PACK_STRUCT; - -struct SMyVector2 -{ SMyVector2 () {;} - SMyVector2(f32 __X, f32 __Y) - : X(__X), Y(__Y) {} - f32 X, Y; -} PACK_STRUCT; - -struct SMyVertex -{ SMyVertex () {;} - SMyVertex (SMyVector3 _Coord, SMyColor _Color, SMyVector3 _Normal) - :Coord(_Coord), Color(_Color), Normal(_Normal) {;} - SMyVector3 Coord; - SMyColor Color; - SMyVector3 Normal; -} PACK_STRUCT; - -struct SMyTVertex -{ SMyTVertex () {;} - SMyTVertex (SMyVector2 _TCoord) - : TCoord(_TCoord) {;} - SMyVector2 TCoord; -} PACK_STRUCT; - -struct SMyFace -{ SMyFace() {;} - SMyFace(u32 __A, u32 __B, u32 __C) - : A(__A), B(__B), C(__C) {} - u32 A, B, C; -} PACK_STRUCT; - -// file header (6 bytes) -struct SMyFileHeader -{ u32 MyId; // MY3D - u16 Ver; // Version -} PACK_STRUCT; - -// scene header -struct SMySceneHeader -{ SMyColor BackgrColor; // background color - SMyColor AmbientColor; // ambient color - s32 MaterialCount; // material count - s32 MeshCount; // mesh count -} PACK_STRUCT; - -// mesh header -struct SMyMeshHeader -{ c8 Name[256]; // material name - u32 MatIndex; // index of the mesh material - u32 TChannelCnt; // mesh mapping channels count -} PACK_STRUCT; - -// texture data header -struct SMyTexDataHeader -{ c8 Name[256]; // texture name - u32 ComprMode; //compression mode - u32 PixelFormat; - u32 Width; // image width - u32 Height; // image height -} PACK_STRUCT; - -// pixel color 24bit (R8G8B8) -struct SMyPixelColor24 -{ SMyPixelColor24() {;} - SMyPixelColor24(u8 __r, u8 __g, u8 __b) - : r(__r), g(__g), b(__b) {} - u8 r, g, b; -} PACK_STRUCT; - -// pixel color 16bit (A1R5G5B5) -struct SMyPixelColor16 -{ SMyPixelColor16() {;} - SMyPixelColor16(s16 _argb): argb(_argb) {;} - SMyPixelColor16(u8 r, u8 g, u8 b) - { argb = ((r&0x1F)<<10) | ((g&0x1F)<<5) | (b&0x1F); - } - s16 argb; -} PACK_STRUCT; - -// RLE Header -struct SMyRLEHeader -{ SMyRLEHeader() {} - u32 nEncodedBytes; - u32 nDecodedBytes; -} PACK_STRUCT; - -// Default alignment -#include "irrunpack.h" - -} // end namespace -} // end namespace - -//----------------------------------------------------------------------------- -namespace irr -{ -namespace core -{ - -//-----------------RLE stuff----------------------------------------- - -int rle_encode ( - unsigned char *in_buf, int in_buf_size, - unsigned char *out_buf, int out_buf_size - ); -unsigned long process_comp( - unsigned char *buf, int buf_size, - unsigned char *out_buf, int out_buf_size - ); -void process_uncomp( - unsigned char, unsigned char *out_buf, int out_buf_size - ); -void flush_outbuf( - unsigned char *out_buf, int out_buf_size - ); -unsigned long get_byte ( - unsigned char *ch, - unsigned char *in_buf, int in_buf_size, - unsigned char *out_buf, int out_buf_size - ); -void put_byte( - unsigned char ch, unsigned char *out_buf, int out_buf_size - ); -//----------------------------------------------------------- -const unsigned long LIMIT = 1; // was #define LIMIT 1 -const unsigned long NON_MATCH = 2; // was: #define NON_MATCH 2 -const unsigned long EOD_FOUND = 3; // was: #define EOD_FOUND 3 -const unsigned long EOD = 0x00454f44; // was: #define EOD 'EOD' -//----------------------------------------------------------- -// number of decoded bytes -static int nDecodedBytes=0; -// number of coded bytes -static int nCodedBytes=0; -// number of read bytes -static int nReadedBytes=0; -// table used to look for sequences of repeating bytes -static unsigned char tmpbuf[4]; // we use subscripts 1 - 3 -static int tmpbuf_cnt; -// output buffer for non-compressed output data -static unsigned char outbuf[128]; -static int outbuf_cnt; - - -//----------------------------------------------------------- -int rle_encode ( - unsigned char *in_buf, int in_buf_size, - unsigned char *out_buf, int out_buf_size - ) -{ - unsigned long ret_code; - - unsigned char ch=0; - - nCodedBytes=0; - nReadedBytes=0; - - tmpbuf_cnt = 0; // no. of char's in tmpbuf - outbuf_cnt = 0; // no. of char's in outbuf - while (1) - { - if (get_byte(&ch, in_buf, in_buf_size, - out_buf, out_buf_size) == (int)EOD) // read next byte into ch - break; - - tmpbuf[++tmpbuf_cnt] = (unsigned char) ch; - if (tmpbuf_cnt == 3) - { - // see if all 3 match each other - if ((tmpbuf[1] == tmpbuf[2]) && (tmpbuf[2] == tmpbuf[3])) - { - // they do - add compression - // this will process all bytes in input file until - // a non-match occurs, or 128 bytes are processed, - // or we find eod */ - ret_code = process_comp(in_buf, in_buf_size, out_buf, out_buf_size); - if (ret_code == (int)EOD_FOUND) - break; // stop compressing - if (ret_code == (int)NON_MATCH) - tmpbuf_cnt=1; /* save the char that didn't match */ - else - // we just compressed the max. of 128 bytes - tmpbuf_cnt=0; /* start over for next chunk */ - } - else - { - // we know the first byte doesn't match 2 or more - // others, so just send it out as uncompressed. */ - process_uncomp(tmpbuf[1], out_buf, out_buf_size); - - // see if the last 2 bytes in the buffer match - if (tmpbuf[2] == tmpbuf[3]) - { - // move byte 3 to position 1 and pretend we just - // have 2 bytes -- note that the first byte was - // already sent to output */ - tmpbuf[1]=tmpbuf[3]; - tmpbuf_cnt=2; - } - else - { - // send byte 2 and keep byte 3 - it may match the - // next byte. Move byte 3 to position 1 and set - // count to 1. Note that the first byte was - // already sent to output - process_uncomp(tmpbuf[2], out_buf, out_buf_size); - tmpbuf[1]=tmpbuf[3]; - tmpbuf_cnt=1; - } - } - } - } // end while - flush_outbuf(out_buf, out_buf_size); - - return nCodedBytes; -} - - -//------------------------------------------------------------------ -// This flushes any non-compressed data not yet sent, then it processes -// repeating bytes until > 128, or EOD, or non-match. -// return values: LIMIT, EOD_FOUND, NON_MATCH -// Prior to ANY return, it writes out the 2 byte compressed code. -// If a NON_MATCH was found, this returns with the non-matching char -// residing in tmpbuf[0]. -// Inputs: tmpbuf[0], input file -// Outputs: tmpbuf[0] (sometimes), output file, and return code -//------------------------------------------------------------------ -unsigned long process_comp( - unsigned char *buf, int buf_size, - unsigned char *out_buf, int out_buf_size) -{ - // we start out with 3 repeating bytes - int len = 3; - - unsigned char ch = 0; - - // we're starting a repeating chunk - end the non-repeaters - flush_outbuf(out_buf, out_buf_size); - - while (get_byte(&ch, buf, buf_size, out_buf, out_buf_size) != (int)EOD) - { - if (ch != tmpbuf[1]) - { - // send no. of repeated bytes to be encoded - put_byte((unsigned char)((--len) | 0x80), out_buf, out_buf_size); - // send the byte's value being repeated - put_byte((unsigned char)tmpbuf[1], out_buf, out_buf_size); - /* save the non-matching character just read */ - tmpbuf[1]=(unsigned char) ch; - return NON_MATCH; - } - /* we know the new byte is part of the repeating seq */ - len++; - if (len == 128) - { - // send no. of repeated bytes to be encoded - put_byte((unsigned char)((--len) | 0x80), out_buf, out_buf_size); - // send the byte's value being repeated - put_byte((unsigned char)tmpbuf[1], out_buf, out_buf_size); - return LIMIT; - } - } // end while - - // if flow comes here, we just read an EOD - // send no. of repeated bytes to be encoded - put_byte((unsigned char)((--len) | 0x80), out_buf, out_buf_size); - // send the byte's value being repeated - put_byte((unsigned char)tmpbuf[1], out_buf, out_buf_size); - return EOD_FOUND; -} - - -//---------------------------------------------------------------- -// This adds 1 non-repeating byte to outbuf. If outbuf becomes full -// with 128 bytes, it flushes outbuf. -// There are no return codes and no bytes are read from the input. -//---------------------------------------------------------------- -void process_uncomp( - unsigned char char1, unsigned char *out_buf, int out_buf_size - ) -{ - outbuf[outbuf_cnt++] = char1; - if (outbuf_cnt == 128) - flush_outbuf(out_buf, out_buf_size); -} -//----------------------------------------------------------- -// This flushes any non-compressed data not yet sent. -// On exit, outbuf_cnt will equal zero. -//----------------------------------------------------------- -void flush_outbuf(unsigned char *out_buf, int out_buf_size) -{ - if (!outbuf_cnt) - return; // nothing to do */ - - // send no. of unencoded bytes to be sent - put_byte((unsigned char)(outbuf_cnt - 1), out_buf, out_buf_size); - - for (int pos=0; outbuf_cnt; outbuf_cnt--) - put_byte((unsigned char)outbuf[pos++], out_buf, out_buf_size); -} -//--------------------------------------------------- -void put_byte(unsigned char b, unsigned char *out_buf, int out_buf_size) -{ - if (nCodedBytes<=(out_buf_size-1)) - { - out_buf[nCodedBytes++] = b; - out_buf[nCodedBytes] = 0; - } -} -//--------------------------------------------------- -// This reads the next byte into ch. It returns EOD -// at end-of-data -//--------------------------------------------------- -unsigned long get_byte( - unsigned char *ch, - unsigned char *in_buf, int in_buf_size, - unsigned char *out_buf, int out_buf_size - ) -{ - if (nReadedBytes>=in_buf_size) - { - // there are either 0, 1, or 2 char's to write before we quit - if (tmpbuf_cnt == 1) - process_uncomp(tmpbuf[1], out_buf, out_buf_size); - else - { - if (tmpbuf_cnt == 2) - { - process_uncomp(tmpbuf[1], out_buf, out_buf_size); - process_uncomp(tmpbuf[2], out_buf, out_buf_size); - } - } - nReadedBytes =0; - - return EOD; - } - - (*ch) = (unsigned char)in_buf[nReadedBytes++]; - - return 0; -} -//----------------------------------------------------------- -int rle_decode ( - unsigned char *in_buf, int in_buf_size, - unsigned char *out_buf, int out_buf_size - ) -{ - nDecodedBytes=0; - nReadedBytes=0; - - int ch, i; - while (1) - { - - if (nReadedBytes>=in_buf_size) - break; - else - ch=in_buf[nReadedBytes]; - nReadedBytes++; - - if (ch > 127) - { - i = ch - 127; // i is the number of repetitions - // get the byte to be repeated - if (nReadedBytes>=in_buf_size) - break; - else - ch=in_buf[nReadedBytes]; - nReadedBytes++; - - // uncompress a chunk - for (; i; --i) - { - if (nDecodedBytes<out_buf_size) - out_buf[nDecodedBytes] = ch; - nDecodedBytes++; - } - } - else - { - // copy out some uncompressed bytes - // i is the no. of bytes - for (i = ch + 1; i; --i) - { - if (nReadedBytes>=in_buf_size) - break; - else - ch=in_buf[nReadedBytes]; - nReadedBytes++; - - if (nDecodedBytes<out_buf_size) - out_buf[nDecodedBytes] = ch; - nDecodedBytes++; - } - } - } // end while - - return nDecodedBytes; -} - -} //end namespace core -} //end namespace irr - - -#endif // __C_MY3D_HELPER_H_INCLUDED__ - diff --git a/source/Irrlicht/CMY3DMeshFileLoader.cpp b/source/Irrlicht/CMY3DMeshFileLoader.cpp deleted file mode 100644 index 91a01248..00000000 --- a/source/Irrlicht/CMY3DMeshFileLoader.cpp +++ /dev/null @@ -1,886 +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 -// -// This file was originally written by ZDimitor. - -//----------------------------------------------------------------------------- -// This tool created by ZDimitor everyone can use it as wants -//----------------------------------------------------------------------------- - -#include "IrrCompileConfig.h" -#ifdef _IRR_COMPILE_WITH_MY3D_LOADER_ - -#include "CMY3DMeshFileLoader.h" -#include "CMeshTextureLoader.h" - -#include "SAnimatedMesh.h" -#include "SMeshBuffer.h" -#include "IReadFile.h" -#include "IAttributes.h" - -#include "CMY3DHelper.h" -#include "os.h" - -// v3.15 - May 16, 2005 - -namespace irr -{ -namespace scene -{ - -static const u32 MY3D_ID = 0x4d593344; -static const u16 MY3D_VER = 0x0003; -static const u16 MY3D_SCENE_HEADER_ID = 0x1000; -static const u16 MY3D_MAT_LIST_ID = 0x2000; -static const u16 MY3D_MAT_HEADER_ID = 0x2100; -static const u16 MY3D_TEX_FNAME_ID = 0x2101; -static const u16 MY3D_TEXDATA_HEADER_ID = 0x2501; -static const u16 MY3D_TEXDATA_RLE_HEADER_ID = 0x2502; -static const u16 MY3D_MESH_LIST_ID = 0x3000; -static const u16 MY3D_MESH_HEADER_ID = 0x3100; -static const u16 MY3D_VERTS_ID = 0x3101; -static const u16 MY3D_FACES_ID = 0x3102; -static const u16 MY3D_TVERTS_ID = 0x3103; -static const u16 MY3D_TFACES_ID = 0x3104; -static const u16 MY3D_FILE_END_ID = 0xFFFF; - -static const unsigned long MY3D_TEXDATA_COMPR_NONE_ID = 0x4e4f4e45; -static const unsigned long MY3D_TEXDATA_COMPR_SIMPLE_ID = 0x53494d50; -static const unsigned long MY3D_TEXDATA_COMPR_RLE_ID = 0x20524c45; - -static const unsigned long MY3D_PIXEL_FORMAT_24 = 0x5f32345f; -static const unsigned long MY3D_PIXEL_FORMAT_16 = 0x5f31365f; - -CMY3DMeshFileLoader::CMY3DMeshFileLoader(ISceneManager* scmgr, io::IFileSystem* fs) - : SceneManager(scmgr), FileSystem(fs) -{ - #ifdef _DEBUG - setDebugName("CMY3DMeshFileLoader"); - #endif - - if (FileSystem) - FileSystem->grab(); - - TextureLoader = new CMeshTextureLoader( FileSystem, SceneManager->getVideoDriver() ); -} - - -CMY3DMeshFileLoader::~CMY3DMeshFileLoader() -{ - if (FileSystem) - FileSystem->drop(); -} - - -bool CMY3DMeshFileLoader::isALoadableFileExtension(const io::path& filename) const -{ - return core::hasFileExtension ( filename, "my3d" ); -} - - -IAnimatedMesh* CMY3DMeshFileLoader::createMesh(io::IReadFile* file) -{ - if ( getMeshTextureLoader() ) - { - getMeshTextureLoader()->setMeshFile(file); - if ( SceneManager->getParameters()->existsAttribute(MY3D_TEXTURE_PATH) ) - getMeshTextureLoader()->setTexturePath(SceneManager->getParameters()->getAttributeAsString(MY3D_TEXTURE_PATH)); - } - - MaterialEntry.clear(); - MeshBufferEntry.clear(); - ChildNodes.clear(); - - // read file into memory - SMyFileHeader fileHeader; - file->read(&fileHeader, sizeof(SMyFileHeader)); -#ifdef __BIG_ENDIAN__ - fileHeader.MyId = os::Byteswap::byteswap(fileHeader.MyId); - fileHeader.Ver = os::Byteswap::byteswap(fileHeader.Ver); -#endif - - if (fileHeader.MyId!=MY3D_ID || fileHeader.Ver!=MY3D_VER) - { - os::Printer::log("Bad MY3D file header, loading failed!", ELL_ERROR); - return 0; - } - - u16 id; - - file->read(&id, sizeof(id)); -#ifdef __BIG_ENDIAN__ - id = os::Byteswap::byteswap(id); -#endif - - if (id!=MY3D_SCENE_HEADER_ID) - { - os::Printer::log("Cannot find MY3D_SCENE_HEADER_ID, loading failed!", ELL_ERROR); - return 0; - } - - SMySceneHeader sceneHeader; - file->read(&sceneHeader, sizeof(SMySceneHeader)); -#ifdef __BIG_ENDIAN__ - sceneHeader.MaterialCount = os::Byteswap::byteswap(sceneHeader.MaterialCount); - sceneHeader.MeshCount = os::Byteswap::byteswap(sceneHeader.MeshCount); -#endif - - file->read(&id, sizeof(id)); -#ifdef __BIG_ENDIAN__ - id = os::Byteswap::byteswap(id); -#endif - - if (id!=MY3D_MAT_LIST_ID) - { - os::Printer::log("Can not find MY3D_MAT_LIST_ID, loading failed!", ELL_ERROR); - return 0; - } - - file->read(&id, sizeof(id)); -#ifdef __BIG_ENDIAN__ - id = os::Byteswap::byteswap(id); -#endif - - c8 namebuf[256]; - for (s32 m=0; m<sceneHeader.MaterialCount; ++m) - { - if (id != MY3D_MAT_HEADER_ID) - { - os::Printer::log("Cannot find MY3D_MAT_HEADER_ID, loading failed!", ELL_ERROR); - return 0; - } - - // read material header - MaterialEntry.push_back(SMyMaterialEntry()); - SMyMaterialEntry& me=MaterialEntry.getLast(); - file->read(&(me.Header), sizeof(SMyMaterialHeader)); - - // read next identificator - file->read(&id, sizeof(id)); -#ifdef __BIG_ENDIAN__ - id = os::Byteswap::byteswap(id); -#endif - - bool gotLightMap=false, gotMainMap=false; - - for (u32 t=0; t<me.Header.TextureCount; ++t) - { - if (id==MY3D_TEX_FNAME_ID) - file->read(namebuf, 256); - else - { - me.Texture2 = readEmbeddedLightmap(file, namebuf); - if (!me.Texture2) - return 0; - gotLightMap = true; - } - - const core::stringc name(namebuf); - const s32 pos = name.findLast('.'); - const core::stringc LightingMapStr = "LightingMap"; - const s32 ls = LightingMapStr.size(); - const bool isSubString = (LightingMapStr == name.subString(core::max_(0, (pos - ls)), ls)); - if ((isSubString || (name[pos-1]=='m' && - name[pos-2]=='l' && name[pos-3]=='_')) && - !gotLightMap) - { - const bool oldMipMapState = SceneManager->getVideoDriver()->getTextureCreationFlag(video::ETCF_CREATE_MIP_MAPS); - SceneManager->getVideoDriver()->setTextureCreationFlag(video::ETCF_CREATE_MIP_MAPS, false); - - me.Texture2FileName = "Lightmaps/"; - me.Texture2FileName.append(name); - me.Texture2 = getMeshTextureLoader() ? getMeshTextureLoader()->getTexture(me.Texture2FileName) : NULL; - - me.MaterialType = video::EMT_LIGHTMAP_M2; - gotLightMap = true; - - SceneManager->getVideoDriver()->setTextureCreationFlag(video::ETCF_CREATE_MIP_MAPS, oldMipMapState); - } - else - if (!gotLightMap && gotMainMap) - { - if ( getMeshTextureLoader() ) - { - me.Texture2 = getMeshTextureLoader() ? getMeshTextureLoader()->getTexture(name) : NULL; - if ( me.Texture2 ) - me.Texture2FileName = me.Texture2->getName(); - } - else - me.Texture2FileName = name; - - me.MaterialType = video::EMT_REFLECTION_2_LAYER; - } - else - if (!gotMainMap && !gotLightMap) - { - if ( getMeshTextureLoader() ) - { - me.Texture1 = getMeshTextureLoader() ? getMeshTextureLoader()->getTexture(name) : NULL; - if ( me.Texture1 ) - me.Texture1FileName = me.Texture1->getName(); - } - else - me.Texture1FileName = name; - - gotMainMap = true; - me.MaterialType = video::EMT_SOLID; - } - else - if (gotLightMap) - { - me.MaterialType = video::EMT_LIGHTMAP_M2; - } - - file->read(&id, sizeof(id)); -#ifdef __BIG_ENDIAN__ - id = os::Byteswap::byteswap(id); -#endif - } - - // override material types based on their names - if (!strncmp(me.Header.Name, "AlphaChannel-", 13)) - me.MaterialType = video::EMT_TRANSPARENT_ALPHA_CHANNEL; - else - if (!strncmp(me.Header.Name, "SphereMap-", 10)) - me.MaterialType = video::EMT_SPHERE_MAP; - } - - // loading meshes - - if (id!=MY3D_MESH_LIST_ID) - { - os::Printer::log("Can not find MY3D_MESH_LIST_ID, loading failed!", ELL_ERROR); - return 0; - } - - file->read(&id, sizeof(id)); -#ifdef __BIG_ENDIAN__ - id = os::Byteswap::byteswap(id); -#endif - - for (s32 mesh_id=0; mesh_id<sceneHeader.MeshCount; mesh_id++) - { - // Warning!!! In some cases MY3D exporter uncorrectly calculates - // MeshCount (it's a problem, has to be solved) thats why - // i added this code line - if (id!=MY3D_MESH_HEADER_ID) - break; - - if (id!=MY3D_MESH_HEADER_ID) - { - os::Printer::log("Can not find MY3D_MESH_HEADER_ID, loading failed!", ELL_ERROR); - return 0; - } - - SMyMeshHeader meshHeader; - file->read(&meshHeader, sizeof(SMyMeshHeader)); - - core::array <SMyVertex> Vertex; - core::array <SMyFace> Face; - core::array <SMyTVertex> TVertex1, TVertex2; - core::array <SMyFace> TFace1, TFace2; - - s32 vertsNum=0; - s32 facesNum=0; - - // vertices - file->read(&id, sizeof(id)); -#ifdef __BIG_ENDIAN__ - id = os::Byteswap::byteswap(id); -#endif - if (id!=MY3D_VERTS_ID) - { - os::Printer::log("Can not find MY3D_VERTS_ID, loading failed!", ELL_ERROR); - return 0; - } - - file->read(&vertsNum, sizeof(vertsNum)); - Vertex.set_used(vertsNum); - file->read(Vertex.pointer(), sizeof(SMyVertex)*vertsNum); - - // faces - file->read(&id, sizeof(id)); -#ifdef __BIG_ENDIAN__ - id = os::Byteswap::byteswap(id); -#endif - if (id!=MY3D_FACES_ID) - { - os::Printer::log("Can not find MY3D_FACES_ID, loading failed!", ELL_ERROR); - return 0; - } - - file->read(&facesNum, sizeof(facesNum)); - Face.set_used(facesNum); - file->read(Face.pointer(), sizeof(SMyFace)*facesNum); - - // reading texture channels - for (s32 tex=0; tex<(s32)meshHeader.TChannelCnt; tex++) - { - // Max 2 texture channels allowed (but in format .my3d can be more) - s32 tVertsNum=0, tFacesNum=0; - - // reading texture coords - file->read(&id, sizeof(id)); -#ifdef __BIG_ENDIAN__ - id = os::Byteswap::byteswap(id); -#endif - - if (id!=MY3D_TVERTS_ID) - { - core::stringc msg="Can not find MY3D_TVERTS_ID ("; - msg.append(core::stringc(tex)); - msg.append("texture channel), loading failed!"); - os::Printer::log(msg.c_str(), ELL_ERROR); - return 0; - } - - file->read(&tVertsNum, sizeof(tVertsNum)); - - if (tex==0) - { - // 1st texture channel - TVertex1.set_used(tVertsNum); - file->read(TVertex1.pointer(), sizeof(SMyTVertex)*tVertsNum); - } - else - if (tex==1) - { - // 2nd texture channel - TVertex2.set_used(tVertsNum); - file->read(TVertex2.pointer(), sizeof(SMyTVertex)*tVertsNum); - } - else - { - // skip other texture channels - file->seek(file->getPos()+sizeof(SMyTVertex)*tVertsNum); - } - - // reading texture faces - file->read(&id, sizeof(id)); -#ifdef __BIG_ENDIAN__ - id = os::Byteswap::byteswap(id); -#endif - - if (id!=MY3D_TFACES_ID) - { - core::stringc msg="Can not find MY3D_TFACES_ID ("; - msg.append(core::stringc(tex)); - msg.append("texture channel), loading failed!"); - os::Printer::log(msg.c_str(), ELL_ERROR); - return 0; - } - - file->read(&tFacesNum, sizeof(tFacesNum)); - - if (tex==0) - { - // 1st texture channel - TFace1.set_used(tFacesNum); - file->read(TFace1.pointer(), sizeof(SMyFace)*tFacesNum); - } - else if (tex==1) - { - // 2nd texture channel - TFace2.set_used(tFacesNum); - file->read(TFace2.pointer(), sizeof(SMyFace)*tFacesNum); - } - else - { - // skip other texture channels - file->seek(file->getPos()+sizeof(SMyFace)*tFacesNum); - } - } - - // trying to find material - - SMyMaterialEntry* matEnt = getMaterialEntryByIndex(meshHeader.MatIndex); - - // creating geometry for the mesh - - // trying to find mesh buffer for this material - SMeshBufferLightMap* buffer = getMeshBufferByMaterialIndex(meshHeader.MatIndex); - - if (!buffer || - (buffer->Vertices.size()+vertsNum) > SceneManager->getVideoDriver()->getMaximalPrimitiveCount()) - { - // creating new mesh buffer for this material - buffer = new scene::SMeshBufferLightMap(); - - buffer->Material.MaterialType = video::EMT_LIGHTMAP_M2; // EMT_LIGHTMAP_M4 also possible - buffer->Material.Wireframe = false; - buffer->Material.Lighting = false; - - if (matEnt) - { - buffer->Material.MaterialType = matEnt->MaterialType; - - if (buffer->Material.MaterialType == video::EMT_REFLECTION_2_LAYER) - { - buffer->Material.Lighting = true; - buffer->Material.setTexture(1, matEnt->Texture1); - buffer->Material.setTexture(0, matEnt->Texture2); - } - else - { - buffer->Material.setTexture(0, matEnt->Texture1); - buffer->Material.setTexture(1, matEnt->Texture2); - } - - if (buffer->Material.MaterialType == video::EMT_TRANSPARENT_ALPHA_CHANNEL) - { - buffer->Material.BackfaceCulling = true; - buffer->Material.Lighting = true; - } - else - if (buffer->Material.MaterialType == video::EMT_SPHERE_MAP) - { - buffer->Material.Lighting = true; - } - - buffer->Material.AmbientColor = video::SColor( - matEnt->Header.AmbientColor.A, matEnt->Header.AmbientColor.R, - matEnt->Header.AmbientColor.G, matEnt->Header.AmbientColor.B - ); - buffer->Material.DiffuseColor = video::SColor( - matEnt->Header.DiffuseColor.A, matEnt->Header.DiffuseColor.R, - matEnt->Header.DiffuseColor.G, matEnt->Header.DiffuseColor.B - ); - buffer->Material.EmissiveColor = video::SColor( - matEnt->Header.EmissiveColor.A, matEnt->Header.EmissiveColor.R, - matEnt->Header.EmissiveColor.G, matEnt->Header.EmissiveColor.B - ); - buffer->Material.SpecularColor = video::SColor( - matEnt->Header.SpecularColor.A, matEnt->Header.SpecularColor.R, - matEnt->Header.SpecularColor.G, matEnt->Header.SpecularColor.B - ); - } - else - { - buffer->Material.setTexture(0, 0); - buffer->Material.setTexture(1, 0); - - buffer->Material.AmbientColor = video::SColor(255, 255, 255, 255); - buffer->Material.DiffuseColor = video::SColor(255, 255, 255, 255); - buffer->Material.EmissiveColor = video::SColor(0, 0, 0, 0); - buffer->Material.SpecularColor = video::SColor(0, 0, 0, 0); - } - - if (matEnt && matEnt->Header.Transparency!=0) - { - if (buffer->Material.MaterialType == video::EMT_REFLECTION_2_LAYER ) - { - buffer->Material.MaterialType = video::EMT_TRANSPARENT_REFLECTION_2_LAYER; - buffer->Material.Lighting = true; - buffer->Material.BackfaceCulling = true; - } - else - { - buffer->Material.MaterialType = video::EMT_TRANSPARENT_VERTEX_ALPHA; - buffer->Material.Lighting = false; - buffer->Material.BackfaceCulling = false; - } - } - else if ( - !buffer->Material.getTexture(1) && - buffer->Material.MaterialType != video::EMT_TRANSPARENT_ALPHA_CHANNEL && - buffer->Material.MaterialType != video::EMT_SPHERE_MAP) - { - buffer->Material.MaterialType = video::EMT_SOLID; - buffer->Material.Lighting = true; - } - - MeshBufferEntry.push_back( - SMyMeshBufferEntry(meshHeader.MatIndex, buffer)); - } - - video::S3DVertex2TCoords VertexA, VertexB, VertexC; - - // vertices (A, B, C) color - video::SColor vert_color; - if (matEnt && - (buffer->Material.MaterialType == video::EMT_TRANSPARENT_VERTEX_ALPHA || - buffer->Material.MaterialType == video::EMT_TRANSPARENT_REFLECTION_2_LAYER)) - { - video::SColor color( - matEnt->Header.DiffuseColor.A, matEnt->Header.DiffuseColor.R, - matEnt->Header.DiffuseColor.G, matEnt->Header.DiffuseColor.B); - - vert_color = color.getInterpolated(video::SColor(0,0,0,0), - 1-matEnt->Header.Transparency); - } - else - { - vert_color = buffer->Material.DiffuseColor; - } - - VertexA.Color = VertexB.Color = VertexC.Color = vert_color; - - if (buffer->Material.MaterialType == video::EMT_TRANSPARENT_ALPHA_CHANNEL) - { - buffer->Indices.reallocate(buffer->Indices.size()+6*facesNum); - buffer->Vertices.reallocate(buffer->Vertices.size()+6*facesNum); - } - else - { - buffer->Indices.reallocate(buffer->Indices.size()+3*facesNum); - buffer->Vertices.reallocate(buffer->Vertices.size()+3*facesNum); - } - for (int f=0; f<facesNum; f++) - { - // vertex A - - VertexA.Pos.X = Vertex[Face[f].C].Coord.X; - VertexA.Pos.Y = Vertex[Face[f].C].Coord.Y; - VertexA.Pos.Z = Vertex[Face[f].C].Coord.Z; - - VertexA.Normal.X = Vertex[Face[f].C].Normal.X; - VertexA.Normal.Y = Vertex[Face[f].C].Normal.Y; - VertexA.Normal.Z = Vertex[Face[f].C].Normal.Z; - - if (meshHeader.TChannelCnt>0) - { - VertexA.TCoords.X = TVertex1[TFace1[f].C].TCoord.X; - VertexA.TCoords.Y = TVertex1[TFace1[f].C].TCoord.Y; - } - - if (meshHeader.TChannelCnt>1) - { - VertexA.TCoords2.X = TVertex2[TFace2[f].C].TCoord.X; - VertexA.TCoords2.Y = TVertex2[TFace2[f].C].TCoord.Y; - } - - // vertex B - - VertexB.Pos.X = Vertex[Face[f].B].Coord.X; - VertexB.Pos.Y = Vertex[Face[f].B].Coord.Y; - VertexB.Pos.Z = Vertex[Face[f].B].Coord.Z; - - VertexB.Normal.X = Vertex[Face[f].B].Normal.X; - VertexB.Normal.Y = Vertex[Face[f].B].Normal.Y; - VertexB.Normal.Z = Vertex[Face[f].B].Normal.Z; - - if (meshHeader.TChannelCnt>0) - { - VertexB.TCoords.X = TVertex1[TFace1[f].B].TCoord.X; - VertexB.TCoords.Y = TVertex1[TFace1[f].B].TCoord.Y; - } - - if (meshHeader.TChannelCnt>1) - { - VertexB.TCoords2.X = TVertex2[TFace2[f].B].TCoord.X; - VertexB.TCoords2.Y = TVertex2[TFace2[f].B].TCoord.Y; - } - - // vertex C - - VertexC.Pos.X = Vertex[Face[f].A].Coord.X; - VertexC.Pos.Y = Vertex[Face[f].A].Coord.Y; - VertexC.Pos.Z = Vertex[Face[f].A].Coord.Z; - - VertexC.Normal.X = Vertex[Face[f].A].Normal.X; - VertexC.Normal.Y = Vertex[Face[f].A].Normal.Y; - VertexC.Normal.Z = Vertex[Face[f].A].Normal.Z; - - if (meshHeader.TChannelCnt>0) - { - VertexC.TCoords.X = TVertex1[TFace1[f].A].TCoord.X; - VertexC.TCoords.Y = TVertex1[TFace1[f].A].TCoord.Y; - } - if (meshHeader.TChannelCnt>1) - { - VertexC.TCoords2.X = TVertex2[TFace2[f].A].TCoord.X; - VertexC.TCoords2.Y = TVertex2[TFace2[f].A].TCoord.Y; - } - - // store 3d data in mesh buffer - - buffer->Indices.push_back(buffer->Vertices.size()); - buffer->Vertices.push_back(VertexA); - - buffer->Indices.push_back(buffer->Vertices.size()); - buffer->Vertices.push_back(VertexB); - - buffer->Indices.push_back(buffer->Vertices.size()); - buffer->Vertices.push_back(VertexC); - - //***************************************************************** - // !!!!!! W A R N I N G !!!!!!! - //***************************************************************** - // For materials with alpha channel we duplicate all faces. - // This has be done for proper lighting calculation of the back faces. - // So you must remember this while you creating your models !!!!! - //***************************************************************** - // !!!!!! W A R N I N G !!!!!!! - //***************************************************************** - - if (buffer->Material.MaterialType == video::EMT_TRANSPARENT_ALPHA_CHANNEL) - { - VertexA.Normal = core::vector3df(-VertexA.Normal.X, -VertexA.Normal.Y, -VertexA.Normal.Z); - VertexB.Normal = core::vector3df(-VertexB.Normal.X, -VertexB.Normal.Y, -VertexB.Normal.Z); - VertexC.Normal = core::vector3df(-VertexC.Normal.X, -VertexC.Normal.Y, -VertexC.Normal.Z); - - buffer->Indices.push_back(buffer->Vertices.size()); - buffer->Vertices.push_back(VertexC); - - buffer->Indices.push_back(buffer->Vertices.size()); - buffer->Vertices.push_back(VertexB); - - buffer->Indices.push_back(buffer->Vertices.size()); - buffer->Vertices.push_back(VertexA); - } - } - file->read(&id, sizeof(id)); -#ifdef __BIG_ENDIAN__ - id = os::Byteswap::byteswap(id); -#endif - } - - // creating mesh - SMesh* mesh = new SMesh(); - - for (u32 num=0; num<MeshBufferEntry.size(); ++num) - { - SMeshBufferLightMap* buffer = MeshBufferEntry[num].MeshBuffer; - - if (!buffer) - continue; - - mesh->addMeshBuffer(buffer); - - buffer->recalculateBoundingBox(); - buffer->drop(); - } - - mesh->recalculateBoundingBox(); - - if (id != MY3D_FILE_END_ID) - os::Printer::log("Loading finished, but can not find MY3D_FILE_END_ID token.", ELL_WARNING); - - SAnimatedMesh* am = new SAnimatedMesh(); - - am->addMesh(mesh); - mesh->drop(); - am->recalculateBoundingBox(); - - return am; -} - - -video::ITexture* CMY3DMeshFileLoader::readEmbeddedLightmap(io::IReadFile* file, char* namebuf) -{ - static int LightMapIndex=0; - u16 id; - file->read(&id, sizeof(id)); -#ifdef __BIG_ENDIAN__ - id = os::Byteswap::byteswap(id); -#endif - if (id!=MY3D_TEXDATA_HEADER_ID) - { - os::Printer::log("Can not find MY3D_TEXDATA_HEADER_ID, loading failed!", ELL_ERROR); - return 0; - } - - SMyTexDataHeader texDataHeader; - - file->read(&texDataHeader, sizeof(SMyTexDataHeader)); - - strcpy(texDataHeader.Name, namebuf); - - char LightMapName[255]; - sprintf(LightMapName,"My3D.Lightmap.%d",++LightMapIndex); - - core::stringc pixFormatStr; - if (texDataHeader.PixelFormat == MY3D_PIXEL_FORMAT_24) - pixFormatStr = "24bit,"; - else - if (texDataHeader.PixelFormat == MY3D_PIXEL_FORMAT_16) - pixFormatStr = "16bit,"; - else - { - core::stringc msg="Unknown format of image data ("; - msg.append(LightMapName); - msg.append("), loading failed!"); - os::Printer::log(msg.c_str(), ELL_ERROR); - return 0; - } - - if (texDataHeader.ComprMode != MY3D_TEXDATA_COMPR_NONE_ID && - texDataHeader.ComprMode != MY3D_TEXDATA_COMPR_RLE_ID && - texDataHeader.ComprMode != MY3D_TEXDATA_COMPR_SIMPLE_ID ) - { - os::Printer::log("Unknown method of compression image data, loading failed!", ELL_ERROR); - return 0; - } - - const u32 num_pixels = texDataHeader.Width*texDataHeader.Height; - - void* data = 0; - - if (texDataHeader.ComprMode==MY3D_TEXDATA_COMPR_NONE_ID) - { - // none compressed image data - if (texDataHeader.PixelFormat == MY3D_PIXEL_FORMAT_24) - { - data = (void*) new SMyPixelColor24[num_pixels]; - file->read(data, sizeof(SMyPixelColor24)*num_pixels); - } - else - { - data = (void*) new SMyPixelColor16[num_pixels]; - file->read(data, sizeof(SMyPixelColor16)*num_pixels); - } - } - else - if (texDataHeader.ComprMode==MY3D_TEXDATA_COMPR_RLE_ID) - { - // read RLE header identificator - file->read(&id, sizeof(id)); -#ifdef __BIG_ENDIAN__ - id = os::Byteswap::byteswap(id); -#endif - if (id!=MY3D_TEXDATA_RLE_HEADER_ID) - { - os::Printer::log("Can not find MY3D_TEXDATA_RLE_HEADER_ID, loading failed!", ELL_ERROR); - return 0; - } - - // read RLE header - SMyRLEHeader rleHeader; - file->read(&rleHeader, sizeof(SMyRLEHeader)); - - //allocate memory for input and output buffers - void *input_buffer = (void*) new unsigned char[rleHeader.nEncodedBytes]; - void *output_buffer = (void*) new unsigned char[rleHeader.nDecodedBytes]; - - // read encoded data - file->read(input_buffer, rleHeader.nEncodedBytes); - - // decode data - data = 0;//(void*) new unsigned char[rleHeader.nDecodedBytes]; - s32 decodedBytes = core::rle_decode( - (unsigned char*)input_buffer, rleHeader.nEncodedBytes, - (unsigned char*)output_buffer, rleHeader.nDecodedBytes); - - if (decodedBytes!=(s32)rleHeader.nDecodedBytes) - { - os::Printer::log("Error extracting data from RLE compression, loading failed!", ELL_ERROR); - return 0; - } - - // free input buffer - delete [] (unsigned char*)input_buffer; - - // here decoded data - data = output_buffer; - } - else if (texDataHeader.ComprMode==MY3D_TEXDATA_COMPR_SIMPLE_ID) - { - // simple compressed image data - if (texDataHeader.PixelFormat == MY3D_PIXEL_FORMAT_24) - data = (void*) new SMyPixelColor24[num_pixels]; - else - data = (void*) new SMyPixelColor16[num_pixels]; - - u32 nReadedPixels=0, nToRead=0; - while (true) - { - file->read(&nToRead, sizeof(nToRead)); - - if ((nReadedPixels+nToRead) > num_pixels) - break; - - if (texDataHeader.PixelFormat == MY3D_PIXEL_FORMAT_24) - { - SMyPixelColor24 col24; - file->read(&col24, sizeof(SMyPixelColor24)); - for (u32 p=0; p<nToRead; p++) - { - ((SMyPixelColor24*)data)[nReadedPixels+p] = - SMyPixelColor24(col24.r, col24.g, col24.b); - } - } - else - { - SMyPixelColor16 col16; - file->read(&col16, sizeof(SMyPixelColor16)); - for (u32 p=0; p<nToRead; p++) - ((SMyPixelColor16*)data)[nReadedPixels+p].argb = col16.argb; - } - - nReadedPixels+=nToRead; - - if (nReadedPixels >= num_pixels) - break; - } - - if (nReadedPixels != num_pixels) - { - os::Printer::log("Image data seems to be corrupted, loading failed!", ELL_ERROR); - return 0; - } - } - - //! Creates a software image from a byte array. - video::IImage* light_img = 0; - - if (texDataHeader.PixelFormat == MY3D_PIXEL_FORMAT_24) - { - // 24 bit lightmap format - light_img = SceneManager->getVideoDriver()->createImageFromData( - video::ECF_R8G8B8, - core::dimension2d<u32>(texDataHeader.Width, texDataHeader.Height), - data, true); - } - else - { - // 16 bit lightmap format - light_img = SceneManager->getVideoDriver()->createImageFromData( - video::ECF_A1R5G5B5, - core::dimension2d<u32>(texDataHeader.Width, texDataHeader.Height), - data, true); - } - - const bool oldMipMapState = SceneManager->getVideoDriver()->getTextureCreationFlag(video::ETCF_CREATE_MIP_MAPS); - SceneManager->getVideoDriver()->setTextureCreationFlag(video::ETCF_CREATE_MIP_MAPS, false); - video::ITexture* lmtex = SceneManager->getVideoDriver()->addTexture(LightMapName, light_img); - SceneManager->getVideoDriver()->setTextureCreationFlag(video::ETCF_CREATE_MIP_MAPS, oldMipMapState); - - light_img->drop(); - return lmtex; -} - - -CMY3DMeshFileLoader::SMyMaterialEntry* CMY3DMeshFileLoader::getMaterialEntryByIndex(u32 matInd) -{ - for (u32 m=0; m<MaterialEntry.size(); ++m) - if (MaterialEntry[m].Header.Index == matInd) - return &MaterialEntry[m]; - - return 0; -} - - - -SMeshBufferLightMap* CMY3DMeshFileLoader::getMeshBufferByMaterialIndex(u32 matInd) -{ - for (u32 m=0; m<MeshBufferEntry.size(); ++m) - { - if (MeshBufferEntry[m].MaterialIndex == (s32)matInd) - return MeshBufferEntry[m].MeshBuffer; - } - return 0; -} - - -const core::array<ISceneNode*>& CMY3DMeshFileLoader::getChildNodes() const -{ - return ChildNodes; -} - - -} // end namespace scnene -} // end namespace irr - -#endif // _IRR_COMPILE_WITH_MY3D_LOADER_ - diff --git a/source/Irrlicht/CMY3DMeshFileLoader.h b/source/Irrlicht/CMY3DMeshFileLoader.h deleted file mode 100644 index c0369d49..00000000 --- a/source/Irrlicht/CMY3DMeshFileLoader.h +++ /dev/null @@ -1,131 +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 -// -// This file was originally written by ZDimitor. -// I (Nikolaus Gebhardt) did some few changes to this: -// - replaced logging calls to their os:: counterparts -// - removed some logging calls -// - removed setTexture path and replaced it with the directory of the mesh -// - added EAMT_MY3D file type -// - fixed a memory leak when decompressing RLE data. -// - cleaned multi character constant problems with gcc -// - removed octree child scene node generation because irrlicht is now able to draw -// scene nodes with transparent and sold materials in them at the same time. (see changes.txt) -// Thanks a lot to ZDimitor for his work on this and that he gave me -// his permission to add it into Irrlicht. - -//-------------------------------------------------------------------------------- -// This tool created by ZDimitor everyone can use it as wants -//-------------------------------------------------------------------------------- - -#ifndef __CMY3D_MESH_FILE_LOADER_H_INCLUDED__ -#define __CMY3D_MESH_FILE_LOADER_H_INCLUDED__ - - -#ifdef _MSC_VER -#pragma once -#endif - - -#include "IMeshLoader.h" -#include "SMesh.h" -#include "SMeshBufferLightMap.h" -#include "IFileSystem.h" -#include "IVideoDriver.h" -#include "irrString.h" -#include "ISceneManager.h" - -namespace irr -{ -namespace scene -{ - -// byte-align structures -#include "irrpack.h" - -struct SMyColor -{ SMyColor () {;} - SMyColor (s32 __R, s32 __G, s32 __B, s32 __A) - : R(__R), G(__G), B(__B), A(__A) {} - s32 R, G, B, A; -} PACK_STRUCT; - -// material header -struct SMyMaterialHeader -{ c8 Name[256]; // material name - u32 Index; - SMyColor AmbientColor; - SMyColor DiffuseColor; - SMyColor EmissiveColor; - SMyColor SpecularColor; - f32 Shininess; - f32 Transparency; - u32 TextureCount; // texture count -} PACK_STRUCT; - -// Default alignment -#include "irrunpack.h" - -class CMY3DMeshFileLoader : public IMeshLoader -{ -public: - CMY3DMeshFileLoader(ISceneManager *scmgr, io::IFileSystem* fs); - virtual ~CMY3DMeshFileLoader(); - - virtual bool isALoadableFileExtension(const io::path& filename) const _IRR_OVERRIDE_; - - virtual IAnimatedMesh* createMesh(io::IReadFile* file) _IRR_OVERRIDE_; - - //! getting access to the nodes (with transparent material), creating - //! while loading .my3d file - const core::array<ISceneNode*>& getChildNodes() const; - -private: - - video::ITexture* readEmbeddedLightmap(io::IReadFile* file, char* namebuf); - - scene::ISceneManager* SceneManager; - io::IFileSystem* FileSystem; - - struct SMyMaterialEntry - { - SMyMaterialEntry () - : Texture1FileName("null"), Texture2FileName("null"), - Texture1(0), Texture2(0), MaterialType(video::EMT_SOLID) { - Header.Name[0] = 0; - } - - SMyMaterialHeader Header; - core::stringc Texture1FileName; - core::stringc Texture2FileName; - video::ITexture *Texture1; - video::ITexture *Texture2; - video::E_MATERIAL_TYPE MaterialType; - }; - - struct SMyMeshBufferEntry - { - SMyMeshBufferEntry() : MaterialIndex(-1), MeshBuffer(0) {} - SMyMeshBufferEntry(s32 mi, SMeshBufferLightMap* mb) - : MaterialIndex(mi), MeshBuffer(mb) {} - - s32 MaterialIndex; - SMeshBufferLightMap* MeshBuffer; - }; - - SMyMaterialEntry* getMaterialEntryByIndex (u32 matInd); - SMeshBufferLightMap* getMeshBufferByMaterialIndex(u32 matInd); - - core::array<SMyMaterialEntry> MaterialEntry; - core::array<SMyMeshBufferEntry> MeshBufferEntry; - - core::array<ISceneNode*> ChildNodes; -}; - - -} // end namespace scene -} // end namespace irr - - -#endif // __CMY3D_MESH_FILE_LOADER_H_INCLUDED__ diff --git a/source/Irrlicht/CMakeLists.txt b/source/Irrlicht/CMakeLists.txt index 5d803f0d..bb17563f 100644 --- a/source/Irrlicht/CMakeLists.txt +++ b/source/Irrlicht/CMakeLists.txt @@ -107,32 +107,9 @@ set(link_libs # Source files set(IRRMESHLOADER - CBSPMeshFileLoader.cpp - CMD2MeshFileLoader.cpp - CMD3MeshFileLoader.cpp - CMS3DMeshFileLoader.cpp CB3DMeshFileLoader.cpp - C3DSMeshFileLoader.cpp - COgreMeshFileLoader.cpp COBJMeshFileLoader.cpp - CCSMLoader.cpp - CDMFLoader.cpp - CLMTSMeshFileLoader.cpp - CMY3DMeshFileLoader.cpp - COCTLoader.cpp CXMeshFileLoader.cpp - CSTLMeshFileLoader.cpp - CLWOMeshFileLoader.cpp - CPLYMeshFileLoader.cpp - CSMFMeshFileLoader.cpp - CMeshTextureLoader.cpp -) - -set(IRRMESHWRITER - CSTLMeshWriter.cpp - COBJMeshWriter.cpp - CPLYMeshWriter.cpp - CB3DMeshWriter.cpp ) add_library(IRRMESHOBJ OBJECT @@ -140,13 +117,7 @@ add_library(IRRMESHOBJ OBJECT CBoneSceneNode.cpp CMeshSceneNode.cpp CAnimatedMeshSceneNode.cpp - CAnimatedMeshMD2.cpp - CAnimatedMeshMD3.cpp - CQ3LevelMesh.cpp - CQuake3ShaderSceneNode.cpp - CAnimatedMeshHalfLife.cpp ${IRRMESHLOADER} - ${IRRMESHWRITER} ) add_library(IRROBJ OBJECT @@ -154,59 +125,12 @@ add_library(IRROBJ OBJECT CCameraSceneNode.cpp CDummyTransformationSceneNode.cpp CEmptySceneNode.cpp - CGeometryCreator.cpp - CLightSceneNode.cpp CMeshManipulator.cpp - CMetaTriangleSelector.cpp - COctreeSceneNode.cpp - COctreeTriangleSelector.cpp - CSceneCollisionManager.cpp CSceneManager.cpp - CShadowVolumeSceneNode.cpp - CSkyBoxSceneNode.cpp - CSkyDomeSceneNode.cpp - CTerrainSceneNode.cpp - CTerrainTriangleSelector.cpp - CVolumeLightSceneNode.cpp - CCubeSceneNode.cpp - CSphereSceneNode.cpp - CTextSceneNode.cpp - CTriangleBBSelector.cpp - CTriangleSelector.cpp - CWaterSurfaceSceneNode.cpp CMeshCache.cpp - CDefaultSceneNodeAnimatorFactory.cpp CDefaultSceneNodeFactory.cpp ) -add_library(IRRPARTICLEOBJ OBJECT - CParticleAnimatedMeshSceneNodeEmitter.cpp - CParticleBoxEmitter.cpp - CParticleCylinderEmitter.cpp - CParticleMeshEmitter.cpp - CParticlePointEmitter.cpp - CParticleRingEmitter.cpp - CParticleSphereEmitter.cpp - CParticleAttractionAffector.cpp - CParticleFadeOutAffector.cpp - CParticleGravityAffector.cpp - CParticleRotationAffector.cpp - CParticleSystemSceneNode.cpp - CParticleScaleAffector.cpp -) - -add_library(IRRANIMOBJ OBJECT - CSceneNodeAnimatorCameraFPS.cpp - CSceneNodeAnimatorCameraMaya.cpp - CSceneNodeAnimatorCollisionResponse.cpp - CSceneNodeAnimatorDelete.cpp - CSceneNodeAnimatorFlyCircle.cpp - CSceneNodeAnimatorFlyStraight.cpp - CSceneNodeAnimatorFollowSpline.cpp - CSceneNodeAnimatorRotation.cpp - CSceneNodeAnimatorTexture.cpp -) - set(IRRDRVROBJ CNullDriver.cpp COpenGLCacheHandler.cpp @@ -216,12 +140,6 @@ set(IRRDRVROBJ COpenGLShaderMaterialRenderer.cpp COpenGLSLMaterialRenderer.cpp COpenGLExtensionHandler.cpp - CD3D9Driver.cpp - CD3D9HLSLMaterialRenderer.cpp - CD3D9NormalMapRenderer.cpp - CD3D9ParallaxMapRenderer.cpp - CD3D9ShaderMaterialRenderer.cpp - CD3D9Texture.cpp COGLESDriver.cpp COGLESExtensionHandler.cpp COGLES2Driver.cpp @@ -241,23 +159,10 @@ set(IRRIMAGEOBJ CColorConverter.cpp CImage.cpp CImageLoaderBMP.cpp - CImageLoaderDDS.cpp CImageLoaderJPG.cpp - CImageLoaderPCX.cpp CImageLoaderPNG.cpp - CImageLoaderPSD.cpp - CImageLoaderPVR.cpp - CImageLoaderTGA.cpp - CImageLoaderPPM.cpp - CImageLoaderWAL.cpp - CImageLoaderRGB.cpp - CImageWriterBMP.cpp CImageWriterJPG.cpp - CImageWriterPCX.cpp CImageWriterPNG.cpp - CImageWriterPPM.cpp - CImageWriterPSD.cpp - CImageWriterTGA.cpp ) add_library(IRRVIDEOOBJ OBJECT @@ -267,50 +172,6 @@ add_library(IRRVIDEOOBJ OBJECT ${IRRIMAGEOBJ} ) -add_library(IRRSWRENDEROBJ OBJECT - CSoftwareDriver.cpp - CSoftwareTexture.cpp - CTRFlat.cpp - CTRFlatWire.cpp - CTRGouraud.cpp - CTRGouraudWire.cpp - CTRNormalMap.cpp - CTRStencilShadow.cpp - CTRTextureFlat.cpp - CTRTextureFlatWire.cpp - CTRTextureGouraud.cpp - CTRTextureGouraudAdd.cpp - CTRTextureGouraudNoZ.cpp - CTRTextureGouraudWire.cpp - CZBuffer.cpp - CTRTextureGouraudVertexAlpha2.cpp - CTRTextureGouraudNoZ2.cpp - CTRTextureLightMap2_M2.cpp - CTRTextureLightMap2_M4.cpp - CTRTextureLightMap2_M1.cpp - CSoftwareDriver2.cpp - CSoftwareTexture2.cpp - CTRTextureGouraud2.cpp - CTRGouraud2.cpp - CTRGouraudAlpha2.cpp - CTRGouraudAlphaNoZ2.cpp - CTRTextureDetailMap2.cpp - CTRTextureGouraudAdd2.cpp - CTRTextureGouraudAddNoZ2.cpp - CTRTextureWire2.cpp - CTRTextureLightMap2_Add.cpp - CTRTextureLightMapGouraud2_M4.cpp - IBurningShader.cpp - CTRTextureBlend.cpp - CTRTextureGouraudAlpha.cpp - CTRTextureGouraudAlphaNoZ.cpp - CDepthBuffer.cpp - CBurningShader_Raster_Reference.cpp - CTR_transparent_reflection_2_layer.cpp - CTRGouraudNoZ2.cpp - burning_shader_color.cpp -) - add_library(IRRIOOBJ OBJECT CFileList.cpp CFileSystem.cpp @@ -318,11 +179,7 @@ add_library(IRRIOOBJ OBJECT CMemoryFile.cpp CReadFile.cpp CWriteFile.cpp - CWADReader.cpp CZipReader.cpp - CPakReader.cpp - CNPKReader.cpp - CTarReader.cpp CMountPointReader.cpp CAttributes.cpp ) @@ -395,7 +252,7 @@ add_library(IRRGUIOBJ OBJECT add_library(IrrlichtMt) foreach(object_lib - IRRMESHOBJ IRROBJ IRRPARTICLEOBJ IRRANIMOBJ IRRVIDEOOBJ IRRSWRENDEROBJ + IRRMESHOBJ IRROBJ IRRVIDEOOBJ IRRIOOBJ IRROTHEROBJ IRRGUIOBJ) # Set include directories for object library compilation target_include_directories(${object_lib} PRIVATE ${link_includes}) diff --git a/source/Irrlicht/CMeshSceneNode.cpp b/source/Irrlicht/CMeshSceneNode.cpp index 59d1c1cd..0f5abd6b 100644 --- a/source/Irrlicht/CMeshSceneNode.cpp +++ b/source/Irrlicht/CMeshSceneNode.cpp @@ -11,11 +11,6 @@ #include "IAnimatedMesh.h" #include "IMaterialRenderer.h" #include "IFileSystem.h" -#ifdef _IRR_COMPILE_WITH_SHADOW_VOLUME_SCENENODE_ -#include "CShadowVolumeSceneNode.h" -#else -#include "IShadowVolumeSceneNode.h" -#endif // _IRR_COMPILE_WITH_SHADOW_VOLUME_SCENENODE_ namespace irr { @@ -28,7 +23,7 @@ namespace scene CMeshSceneNode::CMeshSceneNode(IMesh* mesh, ISceneNode* parent, ISceneManager* mgr, s32 id, const core::vector3df& position, const core::vector3df& rotation, const core::vector3df& scale) -: IMeshSceneNode(parent, mgr, id, position, rotation, scale), Mesh(0), Shadow(0), +: IMeshSceneNode(parent, mgr, id, position, rotation, scale), Mesh(0), PassCount(0), ReadOnlyMaterials(false) { #ifdef _DEBUG @@ -42,8 +37,6 @@ CMeshSceneNode::CMeshSceneNode(IMesh* mesh, ISceneNode* parent, ISceneManager* m //! destructor CMeshSceneNode::~CMeshSceneNode() { - if (Shadow) - Shadow->drop(); if (Mesh) Mesh->drop(); } @@ -109,9 +102,6 @@ void CMeshSceneNode::render() driver->setTransform(video::ETS_WORLD, AbsoluteTransformation); Box = Mesh->getBoundingBox(); - if (Shadow && PassCount==1) - Shadow->updateShadowVolumes(); - // for debug purposes only: bool renderMeshes = true; @@ -210,12 +200,6 @@ void CMeshSceneNode::render() //! or to remove attached childs. bool CMeshSceneNode::removeChild(ISceneNode* child) { - if (child && Shadow == child) - { - Shadow->drop(); - Shadow = 0; - } - return ISceneNode::removeChild(child); } @@ -272,29 +256,6 @@ void CMeshSceneNode::setMesh(IMesh* mesh) } -//! Creates shadow volume scene node as child of this node -//! and returns a pointer to it. -IShadowVolumeSceneNode* CMeshSceneNode::addShadowVolumeSceneNode( - const IMesh* shadowMesh, s32 id, bool zfailmethod, f32 infinity) -{ -#ifdef _IRR_COMPILE_WITH_SHADOW_VOLUME_SCENENODE_ - if (!SceneManager->getVideoDriver()->queryFeature(video::EVDF_STENCIL_BUFFER)) - return 0; - - if (!shadowMesh) - shadowMesh = Mesh; // if null is given, use the mesh of node - - if (Shadow) - Shadow->drop(); - - Shadow = new CShadowVolumeSceneNode(shadowMesh, this, SceneManager, id, zfailmethod, infinity); - return Shadow; -#else - return 0; -#endif -} - - void CMeshSceneNode::copyMaterials() { Materials.clear(); @@ -414,9 +375,6 @@ ISceneNode* CMeshSceneNode::clone(ISceneNode* newParent, ISceneManager* newManag nb->cloneMembers(this, newManager); nb->ReadOnlyMaterials = ReadOnlyMaterials; nb->Materials = Materials; - nb->Shadow = Shadow; - if ( nb->Shadow ) - nb->Shadow->grab(); if (newParent) nb->drop(); diff --git a/source/Irrlicht/CMeshSceneNode.h b/source/Irrlicht/CMeshSceneNode.h index b7b10be3..4da820b2 100644 --- a/source/Irrlicht/CMeshSceneNode.h +++ b/source/Irrlicht/CMeshSceneNode.h @@ -60,11 +60,6 @@ namespace scene //! Returns the current mesh virtual IMesh* getMesh(void) _IRR_OVERRIDE_ { return Mesh; } - //! Creates shadow volume scene node as child of this node - //! and returns a pointer to it. - virtual IShadowVolumeSceneNode* addShadowVolumeSceneNode(const IMesh* shadowMesh, - s32 id, bool zfailmethod=true, f32 infinity=10000.0f) _IRR_OVERRIDE_; - //! Sets if the scene node should not copy the materials of the mesh but use them in a read only style. /* In this way it is possible to change the materials a mesh causing all mesh scene nodes referencing this mesh to change too. */ @@ -90,7 +85,6 @@ namespace scene video::SMaterial ReadOnlyMaterial; IMesh* Mesh; - IShadowVolumeSceneNode* Shadow; s32 PassCount; bool ReadOnlyMaterials; diff --git a/source/Irrlicht/CMeshTextureLoader.cpp b/source/Irrlicht/CMeshTextureLoader.cpp deleted file mode 100644 index 08f4678a..00000000 --- a/source/Irrlicht/CMeshTextureLoader.cpp +++ /dev/null @@ -1,130 +0,0 @@ -#include "CMeshTextureLoader.h" -#include "IFileSystem.h" -#include "IVideoDriver.h" -#include "os.h" - -namespace irr -{ -namespace scene -{ - -CMeshTextureLoader::CMeshTextureLoader(irr::io::IFileSystem* fs, irr::video::IVideoDriver* driver) -: FileSystem(fs) -, VideoDriver(driver) -, MeshFile(0) -, MaterialFile(0) -{ -} - -//! Set a custom texture path. -void CMeshTextureLoader::setTexturePath(const irr::io::path& path) -{ - TexturePath = path; - preparePath(TexturePath); -} - -//! Get the current custom texture path. -const irr::io::path& CMeshTextureLoader::getTexturePath() const -{ - return TexturePath; -} - -bool CMeshTextureLoader::checkTextureName( const irr::io::path& filename) -{ - //os::Printer::log("CheckTextureName:", core::stringc(filename).c_str(), ELL_DEBUG); - if (FileSystem->existFile(filename)) - { - //os::Printer::log("file exists", ELL_DEBUG); - TextureName = filename; - return true; - } - - return false; -} - -//! Get the texture by searching for it in all paths that makes sense for the given textureName. -irr::video::ITexture* CMeshTextureLoader::getTexture(const irr::io::path& textureName) -{ - if ( textureName.empty() || !FileSystem || !VideoDriver) - return NULL; - - // Pre-process texture filename. - irr::io::path simplifiedTexName(textureName); - simplifiedTexName.replace(_IRR_TEXT('\\'),_IRR_TEXT('/')); - - // user defined texture path - if ( !TexturePath.empty() ) - { - if ( checkTextureName(TexturePath + simplifiedTexName) ) - return VideoDriver->getTexture(TextureName); - - if ( checkTextureName(TexturePath + FileSystem->getFileBasename(simplifiedTexName)) ) - return VideoDriver->getTexture(TextureName); - } - - // just the name itself - if ( checkTextureName(simplifiedTexName) ) - return VideoDriver->getTexture(TextureName); - - // look in files relative to the folder of the meshfile - if ( MeshFile ) - { - if ( MeshPath.empty() ) - { - MeshPath = FileSystem->getFileDir(MeshFile->getFileName()); - preparePath(MeshPath); - } - if ( !MeshPath.empty() ) - { - if ( checkTextureName(MeshPath + simplifiedTexName) ) - return VideoDriver->getTexture(TextureName); - - if ( checkTextureName(MeshPath + FileSystem->getFileBasename(simplifiedTexName)) ) - return VideoDriver->getTexture(TextureName); - } - } - - // look in files relative to the folder of the materialfile - if ( MaterialFile ) - { - if ( MaterialPath.empty() ) - { - MaterialPath = FileSystem->getFileDir(MaterialFile->getFileName()); - preparePath(MaterialPath); - } - if ( !MaterialPath.empty() ) - { - if ( checkTextureName(MaterialPath + simplifiedTexName) ) - return VideoDriver->getTexture(TextureName); - - if ( checkTextureName(MaterialPath + FileSystem->getFileBasename(simplifiedTexName)) ) - return VideoDriver->getTexture(TextureName); - } - } - - // check current working directory - if ( checkTextureName(FileSystem->getFileBasename(simplifiedTexName)) ) - return VideoDriver->getTexture(TextureName); - - TextureName = _IRR_TEXT(""); - return NULL; -} - -//! Meshloaders will search paths relative to the meshFile. -void CMeshTextureLoader::setMeshFile(const irr::io::IReadFile* meshFile) -{ - // no grab (would need a weak_ptr) - MeshFile = meshFile; - MeshPath = _IRR_TEXT(""); // do a lazy evaluation later -} - -//! Meshloaders will try to look relative to the path of the materialFile -void CMeshTextureLoader::setMaterialFile(const irr::io::IReadFile* materialFile) -{ - // no grab (would need a weak_ptr) - MaterialFile = materialFile; - MaterialPath = _IRR_TEXT(""); // do a lazy evaluation later -} - -} // end namespace scnene -} // end namespace irr diff --git a/source/Irrlicht/CMeshTextureLoader.h b/source/Irrlicht/CMeshTextureLoader.h deleted file mode 100644 index dac4929e..00000000 --- a/source/Irrlicht/CMeshTextureLoader.h +++ /dev/null @@ -1,81 +0,0 @@ -#ifndef IRR_C_MESH_TEXTURE_LOADER_H_INCLUDED -#define IRR_C_MESH_TEXTURE_LOADER_H_INCLUDED - -#include "IMeshTextureLoader.h" - -namespace irr -{ -namespace io -{ - class IFileSystem; -} // end namespace io -namespace video -{ - class IVideoDriver; -} - -namespace scene -{ - -class CMeshTextureLoader : public IMeshTextureLoader -{ -public: - CMeshTextureLoader(irr::io::IFileSystem* fs, irr::video::IVideoDriver* driver); - - //! Set a custom texture path. - /** This is the first path the texture-loader should search. */ - virtual void setTexturePath(const irr::io::path& path) _IRR_OVERRIDE_; - - //! Get the current custom texture path. - virtual const irr::io::path& getTexturePath() const _IRR_OVERRIDE_; - - //! Get the texture by searching for it in all paths that makes sense for the given textureName. - /** Usually you do not have to use this method, it is used internally by IMeshLoader's. - \param textureName Texturename as used in the mesh-format - \return Pointer to the texture. Returns 0 if loading failed.*/ - virtual irr::video::ITexture* getTexture(const irr::io::path& textureName) _IRR_OVERRIDE_; - - //! Meshloaders will search paths relative to the meshFile. - /** Usually you do not have to use this method, it is used internally by IMeshLoader's. - Any values you set here will likely be overwritten internally. */ - virtual void setMeshFile(const irr::io::IReadFile* meshFile) _IRR_OVERRIDE_; - - //! Meshloaders will try to look relative to the path of the materialFile - /** Usually you do not have to use this method, it is used internally by IMeshLoader's. - Any values you set here will likely be overwritten internally. */ - virtual void setMaterialFile(const irr::io::IReadFile* materialFile) _IRR_OVERRIDE_; - -protected: - // make certain path's have a certain internal format - void preparePath(irr::io::path& directory) - { - if (!directory.empty()) - { - if (directory == _IRR_TEXT(".")) - directory = _IRR_TEXT(""); - - directory.replace(_IRR_TEXT('\\'),_IRR_TEXT('/')); - if (directory.lastChar() != _IRR_TEXT('/')) - directory.append(_IRR_TEXT('/')); - } - } - - // Save the texturename when it's a an existing file - bool checkTextureName( const irr::io::path& filename); - -private: - irr::io::IFileSystem * FileSystem; - irr::video::IVideoDriver* VideoDriver; - irr::io::path TexturePath; - const irr::io::IReadFile* MeshFile; - irr::io::path MeshPath; - const irr::io::IReadFile* MaterialFile; - irr::io::path MaterialPath; - irr::io::path TextureName; -}; - -} // end namespace scene -} // end namespace irr - -#endif - diff --git a/source/Irrlicht/CMetaTriangleSelector.cpp b/source/Irrlicht/CMetaTriangleSelector.cpp deleted file mode 100644 index 9675268b..00000000 --- a/source/Irrlicht/CMetaTriangleSelector.cpp +++ /dev/null @@ -1,225 +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 "CMetaTriangleSelector.h" - -namespace irr -{ -namespace scene -{ - -//! constructor -CMetaTriangleSelector::CMetaTriangleSelector() -{ - #ifdef _DEBUG - setDebugName("CMetaTriangleSelector"); - #endif -} - - -//! destructor -CMetaTriangleSelector::~CMetaTriangleSelector() -{ - removeAllTriangleSelectors(); -} - - -//! Returns amount of all available triangles in this selector -s32 CMetaTriangleSelector::getTriangleCount() const -{ - s32 count = 0; - for (u32 i=0; i<TriangleSelectors.size(); ++i) - count += TriangleSelectors[i]->getTriangleCount(); - - return count; -} - - -//! Gets all triangles. -void CMetaTriangleSelector::getTriangles(core::triangle3df* triangles, s32 arraySize, - s32& outTriangleCount, const core::matrix4* transform, bool useNodeTransform, - irr::core::array<SCollisionTriangleRange>* outTriangleInfo) const -{ - s32 outWritten = 0; - irr::u32 outTriangleInfoSize = outTriangleInfo ? outTriangleInfo->size() : 0; - for (u32 i=0; i<TriangleSelectors.size(); ++i) - { - s32 t = 0; - TriangleSelectors[i]->getTriangles(triangles + outWritten, - arraySize - outWritten, t, transform, useNodeTransform, outTriangleInfo); - - if ( outTriangleInfo ) - { - irr::u32 newTriangleInfoSize = outTriangleInfo->size(); - for ( u32 ti=outTriangleInfoSize; ti<newTriangleInfoSize; ++ti ) - { - (*outTriangleInfo)[ti].RangeStart += outWritten; - } - outTriangleInfoSize = newTriangleInfoSize; - } - - outWritten += t; - if (outWritten==arraySize) - break; - } - - outTriangleCount = outWritten; -} - - -//! Gets all triangles which lie within a specific bounding box. -void CMetaTriangleSelector::getTriangles(core::triangle3df* triangles, s32 arraySize, - s32& outTriangleCount, const core::aabbox3d<f32>& box, - const core::matrix4* transform, bool useNodeTransform, - irr::core::array<SCollisionTriangleRange>* outTriangleInfo) const -{ - s32 outWritten = 0; - irr::u32 outTriangleInfoSize = outTriangleInfo ? outTriangleInfo->size() : 0; - for (u32 i=0; i<TriangleSelectors.size(); ++i) - { - s32 t = 0; - TriangleSelectors[i]->getTriangles(triangles + outWritten, - arraySize - outWritten, t, box, transform, useNodeTransform, outTriangleInfo); - - if ( outTriangleInfo ) - { - irr::u32 newTriangleInfoSize = outTriangleInfo->size(); - for ( u32 ti=outTriangleInfoSize; ti<newTriangleInfoSize; ++ti ) - { - (*outTriangleInfo)[ti].RangeStart += outWritten; - } - outTriangleInfoSize = newTriangleInfoSize; - } - - outWritten += t; - if (outWritten==arraySize) - break; - } - - outTriangleCount = outWritten; -} - - -//! Gets all triangles which have or may have contact with a 3d line. -void CMetaTriangleSelector::getTriangles(core::triangle3df* triangles, s32 arraySize, - s32& outTriangleCount, const core::line3d<f32>& line, - const core::matrix4* transform, bool useNodeTransform, - irr::core::array<SCollisionTriangleRange>* outTriangleInfo) const -{ - s32 outWritten = 0; - irr::u32 outTriangleInfoSize = outTriangleInfo ? outTriangleInfo->size() : 0; - for (u32 i=0; i<TriangleSelectors.size(); ++i) - { - s32 t = 0; - TriangleSelectors[i]->getTriangles(triangles + outWritten, - arraySize - outWritten, t, line, transform, useNodeTransform, outTriangleInfo); - - if ( outTriangleInfo ) - { - irr::u32 newTriangleInfoSize = outTriangleInfo->size(); - for ( u32 ti=outTriangleInfoSize; ti<newTriangleInfoSize; ++ti ) - { - (*outTriangleInfo)[ti].RangeStart += outWritten; - } - outTriangleInfoSize = newTriangleInfoSize; - } - - outWritten += t; - if (outWritten==arraySize) - break; - } - - outTriangleCount = outWritten; -} - - -//! Adds a triangle selector to the collection of triangle selectors -//! in this metaTriangleSelector. -void CMetaTriangleSelector::addTriangleSelector(ITriangleSelector* toAdd) -{ - if (!toAdd) - return; - - TriangleSelectors.push_back(toAdd); - toAdd->grab(); -} - - -//! Removes a specific triangle selector which was added before from the collection. -bool CMetaTriangleSelector::removeTriangleSelector(ITriangleSelector* toRemove) -{ - for (u32 i=0; i<TriangleSelectors.size(); ++i) - { - if (toRemove == TriangleSelectors[i]) - { - TriangleSelectors[i]->drop(); - TriangleSelectors.erase(i); - return true; - } - } - - return false; -} - - -//! Removes all triangle selectors from the collection. -void CMetaTriangleSelector::removeAllTriangleSelectors() -{ - for (u32 i=0; i<TriangleSelectors.size(); ++i) - TriangleSelectors[i]->drop(); - - TriangleSelectors.clear(); -} - - -//! Return the scene node associated with a given triangle. -ISceneNode* CMetaTriangleSelector::getSceneNodeForTriangle(u32 triangleIndex) const -{ - u32 totalTriangles = 0; - - for (u32 i=0; i<TriangleSelectors.size(); ++i) - { - totalTriangles += TriangleSelectors[i]->getTriangleCount(); - - if(totalTriangles > triangleIndex) - return TriangleSelectors[i]->getSceneNodeForTriangle(0); - } - - return 0; -} - -/* Return the number of TriangleSelectors that are inside this one, -Only useful for MetaTriangleSelector others return 1 -*/ -u32 CMetaTriangleSelector::getSelectorCount() const -{ - return TriangleSelectors.size(); -} - - -/* Returns the TriangleSelector based on index based on getSelectorCount -Only useful for MetaTriangleSelector others return 'this' -*/ -ITriangleSelector* CMetaTriangleSelector::getSelector(u32 index) -{ - if (index >= TriangleSelectors.size()) - return 0; - return TriangleSelectors[index]; -} - - -/* Returns the TriangleSelector based on index based on getSelectorCount -Only useful for MetaTriangleSelector others return 'this' -*/ -const ITriangleSelector* CMetaTriangleSelector::getSelector(u32 index) const -{ - if (index >= TriangleSelectors.size()) - return 0; - return TriangleSelectors[index]; -} - - -} // end namespace scene -} // end namespace irr - diff --git a/source/Irrlicht/CMetaTriangleSelector.h b/source/Irrlicht/CMetaTriangleSelector.h deleted file mode 100644 index b5202621..00000000 --- a/source/Irrlicht/CMetaTriangleSelector.h +++ /dev/null @@ -1,79 +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_META_TRIANGLE_SELECTOR_H_INCLUDED__ -#define __C_META_TRIANGLE_SELECTOR_H_INCLUDED__ - -#include "IMetaTriangleSelector.h" -#include "irrArray.h" - -namespace irr -{ -namespace scene -{ - -//! Interface for making multiple triangle selectors work as one big selector. -class CMetaTriangleSelector : public IMetaTriangleSelector -{ -public: - - //! constructor - CMetaTriangleSelector(); - - //! destructor - virtual ~CMetaTriangleSelector(); - - //! Get amount of all available triangles in this selector - virtual s32 getTriangleCount() const _IRR_OVERRIDE_; - - //! Gets all triangles. - virtual void getTriangles(core::triangle3df* triangles, s32 arraySize, - s32& outTriangleCount, const core::matrix4* transform, bool useNodeTransform, - irr::core::array<SCollisionTriangleRange>* outTriangleInfo) const _IRR_OVERRIDE_; - - //! Gets all triangles which lie within a specific bounding box. - virtual void getTriangles(core::triangle3df* triangles, s32 arraySize, - s32& outTriangleCount, const core::aabbox3d<f32>& box, - const core::matrix4* transform, bool useNodeTransform, - irr::core::array<SCollisionTriangleRange>* outTriangleInfo) const _IRR_OVERRIDE_; - - //! Gets all triangles which have or may have contact with a 3d line. - virtual void getTriangles(core::triangle3df* triangles, s32 arraySize, - s32& outTriangleCount, const core::line3d<f32>& line, - const core::matrix4* transform, bool useNodeTransform, - irr::core::array<SCollisionTriangleRange>* outTriangleInfo) const _IRR_OVERRIDE_; - - //! Adds a triangle selector to the collection of triangle selectors - //! in this metaTriangleSelector. - virtual void addTriangleSelector(ITriangleSelector* toAdd) _IRR_OVERRIDE_; - - //! Removes a specific triangle selector which was added before from the collection. - virtual bool removeTriangleSelector(ITriangleSelector* toRemove) _IRR_OVERRIDE_; - - //! Removes all triangle selectors from the collection. - virtual void removeAllTriangleSelectors() _IRR_OVERRIDE_; - - //! Get the scene node associated with a given triangle. - virtual ISceneNode* getSceneNodeForTriangle(u32 triangleIndex) const _IRR_OVERRIDE_; - - // Get the number of TriangleSelectors that are part of this one - virtual u32 getSelectorCount() const _IRR_OVERRIDE_; - - // Get the TriangleSelector based on index based on getSelectorCount - virtual ITriangleSelector* getSelector(u32 index) _IRR_OVERRIDE_; - - // Get the TriangleSelector based on index based on getSelectorCount - virtual const ITriangleSelector* getSelector(u32 index) const _IRR_OVERRIDE_; - -private: - - core::array<ITriangleSelector*> TriangleSelectors; -}; - -} // end namespace scene -} // end namespace irr - - -#endif - diff --git a/source/Irrlicht/CNPKReader.cpp b/source/Irrlicht/CNPKReader.cpp deleted file mode 100644 index fc02786c..00000000 --- a/source/Irrlicht/CNPKReader.cpp +++ /dev/null @@ -1,277 +0,0 @@ -// Copyright (C) 2002-2012 Nikolaus Gebhardt -// Copyright (C) 2009-2012 Christian Stehno -// This file is part of the "Irrlicht Engine". -// For conditions of distribution and use, see copyright notice in irrlicht.h -// Based on the NPK reader from Irrlicht - -#include "CNPKReader.h" - -#ifdef __IRR_COMPILE_WITH_NPK_ARCHIVE_LOADER_ - -#include "os.h" -#include "coreutil.h" - -#ifdef _DEBUG -#define IRR_DEBUG_NPK_READER -#endif - -namespace irr -{ -namespace io -{ - -namespace -{ - bool isHeaderValid(const SNPKHeader& header) - { - const c8* const tag = header.Tag; - return tag[0] == '0' && - tag[1] == 'K' && - tag[2] == 'P' && - tag[3] == 'N'; - } -} // end namespace - - -//! Constructor -CArchiveLoaderNPK::CArchiveLoaderNPK( io::IFileSystem* fs) -: FileSystem(fs) -{ -#ifdef _DEBUG - setDebugName("CArchiveLoaderNPK"); -#endif -} - - -//! returns true if the file maybe is able to be loaded by this class -bool CArchiveLoaderNPK::isALoadableFileFormat(const io::path& filename) const -{ - return core::hasFileExtension(filename, "npk"); -} - -//! Check to see if the loader can create archives of this type. -bool CArchiveLoaderNPK::isALoadableFileFormat(E_FILE_ARCHIVE_TYPE fileType) const -{ - return fileType == EFAT_NPK; -} - -//! Creates an archive from the filename -/** \param file File handle to check. -\return Pointer to newly created archive, or 0 upon error. */ -IFileArchive* CArchiveLoaderNPK::createArchive(const io::path& filename, bool ignoreCase, bool ignorePaths) const -{ - IFileArchive *archive = 0; - io::IReadFile* file = FileSystem->createAndOpenFile(filename); - - if (file) - { - archive = createArchive(file, ignoreCase, ignorePaths); - file->drop (); - } - - return archive; -} - -//! creates/loads an archive from the file. -//! \return Pointer to the created archive. Returns 0 if loading failed. -IFileArchive* CArchiveLoaderNPK::createArchive(io::IReadFile* file, bool ignoreCase, bool ignorePaths) const -{ - IFileArchive *archive = 0; - if ( file ) - { - file->seek ( 0 ); - archive = new CNPKReader(file, ignoreCase, ignorePaths); - } - return archive; -} - - -//! Check if the file might be loaded by this class -/** Check might look into the file. -\param file File handle to check. -\return True if file seems to be loadable. */ -bool CArchiveLoaderNPK::isALoadableFileFormat(io::IReadFile* file) const -{ - SNPKHeader header; - - file->read(&header, sizeof(header)); - - return isHeaderValid(header); -} - - -/*! - NPK Reader -*/ -CNPKReader::CNPKReader(IReadFile* file, bool ignoreCase, bool ignorePaths) -: CFileList((file ? file->getFileName() : io::path("")), ignoreCase, ignorePaths), File(file) -{ -#ifdef _DEBUG - setDebugName("CNPKReader"); -#endif - - if (File) - { - File->grab(); - if (scanLocalHeader()) - sort(); - else - os::Printer::log("Failed to load NPK archive."); - } -} - - -CNPKReader::~CNPKReader() -{ - if (File) - File->drop(); -} - - -const IFileList* CNPKReader::getFileList() const -{ - return this; -} - - -bool CNPKReader::scanLocalHeader() -{ - SNPKHeader header; - - // Read and validate the header - File->read(&header, sizeof(header)); - if (!isHeaderValid(header)) - return false; - - // Seek to the table of contents -#ifdef __BIG_ENDIAN__ - header.Offset = os::Byteswap::byteswap(header.Offset); - header.Length = os::Byteswap::byteswap(header.Length); -#endif - header.Offset += 8; - core::stringc dirName; - bool inTOC=true; - // Loop through each entry in the table of contents - while (inTOC && (File->getPos() < File->getSize())) - { - // read an entry - char tag[4]={0}; - SNPKFileEntry entry; - File->read(tag, 4); - const int numTag = MAKE_IRR_ID(tag[3],tag[2],tag[1],tag[0]); - int size; - - bool isDir=true; - - switch (numTag) - { - case MAKE_IRR_ID('D','I','R','_'): - { - File->read(&size, 4); - readString(entry.Name); - entry.Length=0; - entry.Offset=0; -#ifdef IRR_DEBUG_NPK_READER - os::Printer::log("Dir", entry.Name); -#endif - } - break; - case MAKE_IRR_ID('F','I','L','E'): - { - File->read(&size, 4); - File->read(&entry.Offset, 4); - File->read(&entry.Length, 4); - readString(entry.Name); - isDir=false; -#ifdef IRR_DEBUG_NPK_READER - os::Printer::log("File", entry.Name); -#endif -#ifdef __BIG_ENDIAN__ - entry.Offset = os::Byteswap::byteswap(entry.Offset); - entry.Length = os::Byteswap::byteswap(entry.Length); -#endif - } - break; - case MAKE_IRR_ID('D','E','N','D'): - { - File->read(&size, 4); - entry.Name=""; - entry.Length=0; - entry.Offset=0; - const s32 pos = dirName.findLast('/', dirName.size()-2); - if (pos==-1) - dirName=""; - else - dirName=dirName.subString(0, pos); -#ifdef IRR_DEBUG_NPK_READER - os::Printer::log("Dirend", dirName); -#endif - } - break; - default: - inTOC=false; - } - // skip root dir - if (isDir) - { - if (!entry.Name.size() || (entry.Name==".") || (entry.Name=="<noname>")) - continue; - dirName += entry.Name; - dirName += "/"; - } -#ifdef IRR_DEBUG_NPK_READER - os::Printer::log("Name", entry.Name); -#endif - addItem((isDir?dirName:dirName+entry.Name), entry.Offset+header.Offset, entry.Length, isDir); - } - return true; -} - - -//! opens a file by file name -IReadFile* CNPKReader::createAndOpenFile(const io::path& filename) -{ - s32 index = findFile(filename, false); - - if (index != -1) - return createAndOpenFile(index); - - return 0; -} - - -//! opens a file by index -IReadFile* CNPKReader::createAndOpenFile(u32 index) -{ - if (index >= Files.size() ) - return 0; - - const SFileListEntry &entry = Files[index]; - return createLimitReadFile( entry.FullName, File, entry.Offset, entry.Size ); -} - -void CNPKReader::readString(core::stringc& name) -{ - short stringSize; - char buf[256]; - File->read(&stringSize, 2); -#ifdef __BIG_ENDIAN__ - stringSize = os::Byteswap::byteswap(stringSize); -#endif - name.reserve(stringSize); - while(stringSize) - { - const short next = core::min_(stringSize, (short)255); - File->read(buf,next); - buf[next]=0; - name.append(buf); - stringSize -= next; - } -} - - -} // end namespace io -} // end namespace irr - -#endif // __IRR_COMPILE_WITH_NPK_ARCHIVE_LOADER_ - diff --git a/source/Irrlicht/CNPKReader.h b/source/Irrlicht/CNPKReader.h deleted file mode 100644 index 204a34c3..00000000 --- a/source/Irrlicht/CNPKReader.h +++ /dev/null @@ -1,125 +0,0 @@ -// Copyright (C) 2002-2012 Nikolaus Gebhardt -// Copyright (C) 2009-2012 Christian Stehno -// This file is part of the "Irrlicht Engine". -// For conditions of distribution and use, see copyright notice in irrlicht.h - -#ifndef __C_NPK_READER_H_INCLUDED__ -#define __C_NPK_READER_H_INCLUDED__ - -#include "IrrCompileConfig.h" - -#ifdef __IRR_COMPILE_WITH_NPK_ARCHIVE_LOADER_ - -#include "IReferenceCounted.h" -#include "IReadFile.h" -#include "irrArray.h" -#include "irrString.h" -#include "IFileSystem.h" -#include "CFileList.h" - -namespace irr -{ -namespace io -{ - namespace - { - //! File header containing location and size of the table of contents - struct SNPKHeader - { - // Don't change the order of these fields! They must match the order stored on disk. - c8 Tag[4]; - u32 Length; - u32 Offset; - }; - - //! An entry in the NPK file's table of contents. - struct SNPKFileEntry - { - core::stringc Name; - u32 Offset; - u32 Length; - }; - } // end namespace - - //! Archiveloader capable of loading Nebula Device 2 NPK Archives - class CArchiveLoaderNPK : public IArchiveLoader - { - public: - - //! Constructor - CArchiveLoaderNPK(io::IFileSystem* fs); - - //! returns true if the file maybe is able to be loaded by this class - //! based on the file extension (e.g. ".zip") - virtual bool isALoadableFileFormat(const io::path& filename) const _IRR_OVERRIDE_; - - //! Check if the file might be loaded by this class - /** Check might look into the file. - \param file File handle to check. - \return True if file seems to be loadable. */ - virtual bool isALoadableFileFormat(io::IReadFile* file) const _IRR_OVERRIDE_; - - //! Check to see if the loader can create archives of this type. - /** Check based on the archive type. - \param fileType The archive type to check. - \return True if the archile loader supports this type, false if not */ - virtual bool isALoadableFileFormat(E_FILE_ARCHIVE_TYPE fileType) const _IRR_OVERRIDE_; - - //! Creates an archive from the filename - /** \param file File handle to check. - \return Pointer to newly created archive, or 0 upon error. */ - virtual IFileArchive* createArchive(const io::path& filename, bool ignoreCase, bool ignorePaths) const _IRR_OVERRIDE_; - - //! creates/loads an archive from the file. - //! \return Pointer to the created archive. Returns 0 if loading failed. - virtual io::IFileArchive* createArchive(io::IReadFile* file, bool ignoreCase, bool ignorePaths) const _IRR_OVERRIDE_; - - private: - io::IFileSystem* FileSystem; - }; - - - //! reads from NPK - class CNPKReader : public virtual IFileArchive, virtual CFileList - { - public: - - CNPKReader(IReadFile* file, bool ignoreCase, bool ignorePaths); - virtual ~CNPKReader(); - - // file archive methods - - //! return the id of the file Archive - virtual const io::path& getArchiveName() const _IRR_OVERRIDE_ - { - return File->getFileName(); - } - - //! opens a file by file name - virtual IReadFile* createAndOpenFile(const io::path& filename) _IRR_OVERRIDE_; - - //! opens a file by index - virtual IReadFile* createAndOpenFile(u32 index) _IRR_OVERRIDE_; - - //! returns the list of files - virtual const IFileList* getFileList() const _IRR_OVERRIDE_; - - //! get the class Type - virtual E_FILE_ARCHIVE_TYPE getType() const _IRR_OVERRIDE_ { return EFAT_NPK; } - - private: - - //! scans for a local header, returns false if the header is invalid - bool scanLocalHeader(); - void readString(core::stringc& name); - - IReadFile* File; - }; - -} // end namespace io -} // end namespace irr - -#endif // __IRR_COMPILE_WITH_NPK_ARCHIVE_LOADER_ - -#endif // __C_NPK_READER_H_INCLUDED__ - diff --git a/source/Irrlicht/COBJMeshFileLoader.cpp b/source/Irrlicht/COBJMeshFileLoader.cpp index 17dcec99..f16cf9e0 100644 --- a/source/Irrlicht/COBJMeshFileLoader.cpp +++ b/source/Irrlicht/COBJMeshFileLoader.cpp @@ -6,7 +6,6 @@ #ifdef _IRR_COMPILE_WITH_OBJ_LOADER_ #include "COBJMeshFileLoader.h" -#include "CMeshTextureLoader.h" #include "IMeshManipulator.h" #include "IVideoDriver.h" #include "SMesh.h" @@ -39,8 +38,6 @@ COBJMeshFileLoader::COBJMeshFileLoader(scene::ISceneManager* smgr, io::IFileSyst if (FileSystem) FileSystem->grab(); - - TextureLoader = new CMeshTextureLoader( FileSystem, SceneManager->getVideoDriver() ); } @@ -69,9 +66,6 @@ IAnimatedMesh* COBJMeshFileLoader::createMesh(io::IReadFile* file) if (!file) return 0; - if ( getMeshTextureLoader() ) - getMeshTextureLoader()->setMeshFile(file); - const long filesize = file->getSize(); if (!filesize) return 0; @@ -119,7 +113,6 @@ IAnimatedMesh* COBJMeshFileLoader::createMesh(io::IReadFile* file) #ifdef _IRR_DEBUG_OBJ_LOADER_ os::Printer::log("Reading material file",name); #endif - readMTL(name, relPath); } } break; @@ -358,352 +351,6 @@ IAnimatedMesh* COBJMeshFileLoader::createMesh(io::IReadFile* file) return animMesh; } - -const c8* COBJMeshFileLoader::readTextures(const c8* bufPtr, const c8* const bufEnd, SObjMtl* currMaterial, const io::path& relPath) -{ - u8 type=0; // map_Kd - diffuse color texture map - // map_Ks - specular color texture map - // map_Ka - ambient color texture map - // map_Ns - shininess texture map - if ((!strncmp(bufPtr,"map_bump",8)) || (!strncmp(bufPtr,"bump",4))) - type=1; // normal map - else if ((!strncmp(bufPtr,"map_d",5)) || (!strncmp(bufPtr,"map_opacity",11))) - type=2; // opacity map - else if (!strncmp(bufPtr,"map_refl",8)) - type=3; // reflection map - // extract new material's name - c8 textureNameBuf[WORD_BUFFER_LENGTH]; - bufPtr = goAndCopyNextWord(textureNameBuf, bufPtr, WORD_BUFFER_LENGTH, bufEnd); - - f32 bumpiness = 6.0f; - bool clamp = false; - core::vector3df tscale(1.f); //For map_Kd texture scaling - core::vector3df tpos(0.f); //For map_Kd texture translation - // handle options - while (textureNameBuf[0]=='-') - { - if (!strncmp(bufPtr,"-bm",3)) - { - bufPtr = goAndCopyNextWord(textureNameBuf, bufPtr, WORD_BUFFER_LENGTH, bufEnd); - currMaterial->Meshbuffer->Material.MaterialTypeParam=core::fast_atof(textureNameBuf); - bufPtr = goAndCopyNextWord(textureNameBuf, bufPtr, WORD_BUFFER_LENGTH, bufEnd); - continue; - } - else - if (!strncmp(bufPtr,"-blendu",7)) - bufPtr = goAndCopyNextWord(textureNameBuf, bufPtr, WORD_BUFFER_LENGTH, bufEnd); - else - if (!strncmp(bufPtr,"-blendv",7)) - bufPtr = goAndCopyNextWord(textureNameBuf, bufPtr, WORD_BUFFER_LENGTH, bufEnd); - else - if (!strncmp(bufPtr,"-cc",3)) - bufPtr = goAndCopyNextWord(textureNameBuf, bufPtr, WORD_BUFFER_LENGTH, bufEnd); - else - if (!strncmp(bufPtr,"-clamp",6)) - bufPtr = readBool(bufPtr, clamp, bufEnd); - else - if (!strncmp(bufPtr,"-texres",7)) - bufPtr = goAndCopyNextWord(textureNameBuf, bufPtr, WORD_BUFFER_LENGTH, bufEnd); - else - if (!strncmp(bufPtr,"-type",5)) - bufPtr = goAndCopyNextWord(textureNameBuf, bufPtr, WORD_BUFFER_LENGTH, bufEnd); - else - if (!strncmp(bufPtr,"-mm",3)) - { - bufPtr = goAndCopyNextWord(textureNameBuf, bufPtr, WORD_BUFFER_LENGTH, bufEnd); - bufPtr = goAndCopyNextWord(textureNameBuf, bufPtr, WORD_BUFFER_LENGTH, bufEnd); - } - else - if (!strncmp(bufPtr,"-o",2)) // texture coord translation - { - bufPtr = goAndCopyNextWord(textureNameBuf, bufPtr, WORD_BUFFER_LENGTH, bufEnd); - if (core::isdigit(textureNameBuf[0]) || (textureNameBuf[0] == '-' && core::isdigit(textureNameBuf[1]))) - tpos.X = core::fast_atof(textureNameBuf); - - // next parameters are optional, so skip rest of loop if no number is found - bufPtr = goAndCopyNextWord(textureNameBuf, bufPtr, WORD_BUFFER_LENGTH, bufEnd); - if (!(core::isdigit(textureNameBuf[0]) || (textureNameBuf[0] == '-' && core::isdigit(textureNameBuf[1])))) - continue; - tpos.Y = core::fast_atof(textureNameBuf); - bufPtr = goAndCopyNextWord(textureNameBuf, bufPtr, WORD_BUFFER_LENGTH, bufEnd); - if (!(core::isdigit(textureNameBuf[0]) || (textureNameBuf[0] == '-' && core::isdigit(textureNameBuf[1])))) - continue; - tpos.Z = core::fast_atof(textureNameBuf); - } - else - if (!strncmp(bufPtr,"-s",2)) // texture coord scale - { - bufPtr = goAndCopyNextWord(textureNameBuf, bufPtr, WORD_BUFFER_LENGTH, bufEnd); - if (core::isdigit(textureNameBuf[0]) || (textureNameBuf[0] == '-' && core::isdigit(textureNameBuf[1]))) - tscale.X = core::fast_atof(textureNameBuf); - - // next parameters are optional, so skip rest of loop if no number is found - bufPtr = goAndCopyNextWord(textureNameBuf, bufPtr, WORD_BUFFER_LENGTH, bufEnd); - if (!(core::isdigit(textureNameBuf[0]) || (textureNameBuf[0] == '-' && core::isdigit(textureNameBuf[1])))) - continue; - tscale.Y = core::fast_atof(textureNameBuf); - bufPtr = goAndCopyNextWord(textureNameBuf, bufPtr, WORD_BUFFER_LENGTH, bufEnd); - if (!(core::isdigit(textureNameBuf[0]) || (textureNameBuf[0] == '-' && core::isdigit(textureNameBuf[1])))) - continue; - tscale.Z = core::fast_atof(textureNameBuf); - } - else - if (!strncmp(bufPtr,"-t",2)) - { - bufPtr = goAndCopyNextWord(textureNameBuf, bufPtr, WORD_BUFFER_LENGTH, bufEnd); - // next parameters are optional, so skip rest of loop if no number is found - bufPtr = goAndCopyNextWord(textureNameBuf, bufPtr, WORD_BUFFER_LENGTH, bufEnd); - if (!(core::isdigit(textureNameBuf[0]) || (textureNameBuf[0] == '-' && core::isdigit(textureNameBuf[1])))) - continue; - bufPtr = goAndCopyNextWord(textureNameBuf, bufPtr, WORD_BUFFER_LENGTH, bufEnd); - if (!(core::isdigit(textureNameBuf[0]) || (textureNameBuf[0] == '-' && core::isdigit(textureNameBuf[1])))) - continue; - } - // get next word - bufPtr = goAndCopyNextWord(textureNameBuf, bufPtr, WORD_BUFFER_LENGTH, bufEnd); - } - - if ((type==1) && (core::isdigit(textureNameBuf[0]))) - { - currMaterial->Meshbuffer->Material.MaterialTypeParam=core::fast_atof(textureNameBuf); - bufPtr = goAndCopyNextWord(textureNameBuf, bufPtr, WORD_BUFFER_LENGTH, bufEnd); - } - if (clamp) - currMaterial->Meshbuffer->Material.setFlag(video::EMF_TEXTURE_WRAP, video::ETC_CLAMP); - - io::path texname(textureNameBuf); - if (texname.size() && getMeshTextureLoader()) - { - video::ITexture * texture = getMeshTextureLoader()->getTexture(texname); - if ( texture ) - { - if (type==0) - { - currMaterial->Meshbuffer->Material.setTexture(0, texture); - bool needsTextureMatrix = tscale != core::vector3df(1.f) || tpos != core::vector3df(0.f); - if (needsTextureMatrix) - { - currMaterial->Meshbuffer->Material.getTextureMatrix(0).setTextureScale(tscale.X, tscale.Y); - currMaterial->Meshbuffer->Material.getTextureMatrix(0).setTextureTranslate(tpos.X, tpos.Y); - } - } - else if (type==1) - { - if ( texture->getSource() == video::ETS_FROM_FILE) - SceneManager->getVideoDriver()->makeNormalMapTexture(texture, bumpiness); - currMaterial->Meshbuffer->Material.setTexture(1, texture); - currMaterial->Meshbuffer->Material.MaterialType=video::EMT_PARALLAX_MAP_SOLID; - currMaterial->Meshbuffer->Material.MaterialTypeParam=0.035f; - } - else if (type==2) - { - currMaterial->Meshbuffer->Material.setTexture(0, texture); - currMaterial->Meshbuffer->Material.MaterialType=video::EMT_TRANSPARENT_ADD_COLOR; - } - else if (type==3) - { - // currMaterial->Meshbuffer->Material.Textures[1] = texture; - // currMaterial->Meshbuffer->Material.MaterialType=video::EMT_REFLECTION_2_LAYER; - } - // Set diffuse material color to white so as not to affect texture color - // Because Maya set diffuse color Kd to black when you use a diffuse color map - // But is this the right thing to do? - currMaterial->Meshbuffer->Material.DiffuseColor.set( - currMaterial->Meshbuffer->Material.DiffuseColor.getAlpha(), 255, 255, 255 ); - } - } - return bufPtr; -} - - -void COBJMeshFileLoader::readMTL(const c8* fileName, const io::path& relPath) -{ - const io::path realFile(fileName); - io::IReadFile * mtlReader; - - if (FileSystem->existFile(realFile)) - mtlReader = FileSystem->createAndOpenFile(realFile); - else if (FileSystem->existFile(relPath + realFile)) - mtlReader = FileSystem->createAndOpenFile(relPath + realFile); - else if (FileSystem->existFile(FileSystem->getFileBasename(realFile))) - mtlReader = FileSystem->createAndOpenFile(FileSystem->getFileBasename(realFile)); - else - mtlReader = FileSystem->createAndOpenFile(relPath + FileSystem->getFileBasename(realFile)); - if (!mtlReader) // fail to open and read file - { - os::Printer::log("Could not open material file", realFile, ELL_WARNING); - return; - } - - if ( getMeshTextureLoader() ) - { - getMeshTextureLoader()->setMaterialFile(mtlReader); - if ( SceneManager->getParameters()->existsAttribute(OBJ_TEXTURE_PATH) ) - getMeshTextureLoader()->setTexturePath(SceneManager->getParameters()->getAttributeAsString(OBJ_TEXTURE_PATH)); - } - - const long filesize = mtlReader->getSize(); - if (!filesize) - { - os::Printer::log("Skipping empty material file", realFile, ELL_WARNING); - mtlReader->drop(); - return; - } - - c8* buf = new c8[filesize]; - mtlReader->read((void*)buf, filesize); - const c8* bufEnd = buf+filesize; - - SObjMtl* currMaterial = 0; - - const c8* bufPtr = buf; - while(bufPtr != bufEnd) - { - switch(*bufPtr) - { - case 'n': // newmtl - { - // if there's an existing material, store it first - if ( currMaterial ) - Materials.push_back( currMaterial ); - - // extract new material's name - c8 mtlNameBuf[WORD_BUFFER_LENGTH]; - bufPtr = goAndCopyNextWord(mtlNameBuf, bufPtr, WORD_BUFFER_LENGTH, bufEnd); - - currMaterial = new SObjMtl; - currMaterial->Name = mtlNameBuf; - } - break; - case 'i': // illum - illumination - if ( currMaterial ) - { - const u32 COLOR_BUFFER_LENGTH = 16; - c8 illumStr[COLOR_BUFFER_LENGTH]; - - bufPtr = goAndCopyNextWord(illumStr, bufPtr, COLOR_BUFFER_LENGTH, bufEnd); - currMaterial->Illumination = (c8)atol(illumStr); - } - break; - case 'N': - if ( currMaterial ) - { - switch(bufPtr[1]) - { - case 's': // Ns - shininess - { - const u32 COLOR_BUFFER_LENGTH = 16; - c8 nsStr[COLOR_BUFFER_LENGTH]; - - bufPtr = goAndCopyNextWord(nsStr, bufPtr, COLOR_BUFFER_LENGTH, bufEnd); - f32 shininessValue = core::fast_atof(nsStr); - - // wavefront shininess is from [0, 1000], so scale for OpenGL - shininessValue *= 0.128f; - currMaterial->Meshbuffer->Material.Shininess = shininessValue; - } - break; - case 'i': // Ni - refraction index - { - c8 tmpbuf[WORD_BUFFER_LENGTH]; - bufPtr = goAndCopyNextWord(tmpbuf, bufPtr, WORD_BUFFER_LENGTH, bufEnd); - } - break; - } - } - break; - case 'K': - if ( currMaterial ) - { - switch(bufPtr[1]) - { - case 'd': // Kd = diffuse - { - bufPtr = readColor(bufPtr, currMaterial->Meshbuffer->Material.DiffuseColor, bufEnd); - - } - break; - - case 's': // Ks = specular - { - bufPtr = readColor(bufPtr, currMaterial->Meshbuffer->Material.SpecularColor, bufEnd); - } - break; - - case 'a': // Ka = ambience - { - bufPtr=readColor(bufPtr, currMaterial->Meshbuffer->Material.AmbientColor, bufEnd); - } - break; - case 'e': // Ke = emissive - { - currMaterial->Meshbuffer->Material.EmissiveColor.setAlpha(255); - bufPtr=readColor(bufPtr, currMaterial->Meshbuffer->Material.EmissiveColor, bufEnd); - } - break; - } // end switch(bufPtr[1]) - } // end case 'K': if ( 0 != currMaterial )... - break; - case 'b': // bump - case 'm': // texture maps - if (currMaterial) - { - bufPtr=readTextures(bufPtr, bufEnd, currMaterial, relPath); - } - break; - case 'd': // d - transparency - if ( currMaterial ) - { - const u32 COLOR_BUFFER_LENGTH = 16; - c8 dStr[COLOR_BUFFER_LENGTH]; - - bufPtr = goAndCopyNextWord(dStr, bufPtr, COLOR_BUFFER_LENGTH, bufEnd); - f32 dValue = core::fast_atof(dStr); - - currMaterial->Meshbuffer->Material.DiffuseColor.setAlpha( (s32)(dValue * 255) ); - if (dValue<1.0f) - currMaterial->Meshbuffer->Material.MaterialType = video::EMT_TRANSPARENT_VERTEX_ALPHA; - } - break; - case 'T': - if ( currMaterial ) - { - switch ( bufPtr[1] ) - { - case 'f': // Tf - Transmitivity - const u32 COLOR_BUFFER_LENGTH = 16; - c8 redStr[COLOR_BUFFER_LENGTH]; - c8 greenStr[COLOR_BUFFER_LENGTH]; - c8 blueStr[COLOR_BUFFER_LENGTH]; - - bufPtr = goAndCopyNextWord(redStr, bufPtr, COLOR_BUFFER_LENGTH, bufEnd); - bufPtr = goAndCopyNextWord(greenStr, bufPtr, COLOR_BUFFER_LENGTH, bufEnd); - bufPtr = goAndCopyNextWord(blueStr, bufPtr, COLOR_BUFFER_LENGTH, bufEnd); - - f32 transparency = ( core::fast_atof(redStr) + core::fast_atof(greenStr) + core::fast_atof(blueStr) ) / 3; - - currMaterial->Meshbuffer->Material.DiffuseColor.setAlpha( (s32)(transparency * 255) ); - if (transparency < 1.0f) - currMaterial->Meshbuffer->Material.MaterialType = video::EMT_TRANSPARENT_VERTEX_ALPHA; - } - } - break; - default: // comments or not recognised - break; - } // end switch(bufPtr[0]) - // go to next line - bufPtr = goNextLine(bufPtr, bufEnd); - } // end while (bufPtr) - - // end of file. if there's an existing material, store it - if ( currMaterial ) - Materials.push_back( currMaterial ); - - delete [] buf; - mtlReader->drop(); -} - - //! Read RGB color const c8* COBJMeshFileLoader::readColor(const c8* bufPtr, video::SColor& color, const c8* const bufEnd) { diff --git a/source/Irrlicht/COBJMeshFileLoader.h b/source/Irrlicht/COBJMeshFileLoader.h index 22183eb6..bc815df4 100644 --- a/source/Irrlicht/COBJMeshFileLoader.h +++ b/source/Irrlicht/COBJMeshFileLoader.h @@ -70,9 +70,6 @@ private: bool RecalculateNormals; }; - // helper method for material reading - const c8* readTextures(const c8* bufPtr, const c8* const bufEnd, SObjMtl* currMaterial, const io::path& relPath); - // returns a pointer to the first printable character available in the buffer const c8* goFirstWord(const c8* buf, const c8* const bufEnd, bool acrossNewlines=true); // returns a pointer to the first printable character after the first non-printable @@ -87,9 +84,6 @@ private: // combination of goNextWord followed by copyWord const c8* goAndCopyNextWord(c8* outBuf, const c8* inBuf, u32 outBufLength, const c8* const pBufEnd); - //! Read the material from the given file - void readMTL(const c8* fileName, const io::path& relPath); - //! Find and return the material with the given name SObjMtl* findMtl(const core::stringc& mtlName, const core::stringc& grpName); diff --git a/source/Irrlicht/COBJMeshWriter.cpp b/source/Irrlicht/COBJMeshWriter.cpp deleted file mode 100644 index c784caf1..00000000 --- a/source/Irrlicht/COBJMeshWriter.cpp +++ /dev/null @@ -1,282 +0,0 @@ -// Copyright (C) 2008-2012 Christian Stehno -// 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_OBJ_WRITER_ - -#include "COBJMeshWriter.h" -#include "os.h" -#include "IMesh.h" -#include "IMeshBuffer.h" -#include "IAttributes.h" -#include "ISceneManager.h" -#include "IMeshCache.h" -#include "IWriteFile.h" -#include "IFileSystem.h" -#include "ITexture.h" - -namespace irr -{ -namespace scene -{ - -COBJMeshWriter::COBJMeshWriter(scene::ISceneManager* smgr, io::IFileSystem* fs) - : SceneManager(smgr), FileSystem(fs) -{ - #ifdef _DEBUG - setDebugName("COBJMeshWriter"); - #endif - - if (SceneManager) - SceneManager->grab(); - - if (FileSystem) - FileSystem->grab(); -} - - -COBJMeshWriter::~COBJMeshWriter() -{ - if (SceneManager) - SceneManager->drop(); - - if (FileSystem) - FileSystem->drop(); -} - - -//! Returns the type of the mesh writer -EMESH_WRITER_TYPE COBJMeshWriter::getType() const -{ - return EMWT_OBJ; -} - - -//! writes a mesh -bool COBJMeshWriter::writeMesh(io::IWriteFile* file, scene::IMesh* mesh, s32 flags) -{ - if (!file) - return false; - - os::Printer::log("Writing mesh", file->getFileName()); - - // write OBJ MESH header - - io::path name; - core::cutFilenameExtension(name,file->getFileName()) += ".mtl"; - file->write("# exported by Irrlicht\n",23); - file->write("mtllib ",7); - file->write(name.c_str(),name.size()); - file->write("\n\n",2); - - // write mesh buffers - - core::array<video::SMaterial*> mat; - - u32 allVertexCount=1; // count vertices over the whole file - for (u32 i=0; i<mesh->getMeshBufferCount(); ++i) - { - core::stringc num(i+1); - IMeshBuffer* buffer = mesh->getMeshBuffer(i); - if (buffer && buffer->getVertexCount()) - { - file->write("g grp", 5); - file->write(num.c_str(), num.size()); - file->write("\n",1); - - u32 j; - const u32 vertexCount = buffer->getVertexCount(); - for (j=0; j<vertexCount; ++j) - { - file->write("v ",2); - getVectorAsStringLine(buffer->getPosition(j), num); - file->write(num.c_str(), num.size()); - } - - for (j=0; j<vertexCount; ++j) - { - file->write("vt ",3); - getVectorAsStringLine(buffer->getTCoords(j), num); - file->write(num.c_str(), num.size()); - } - - for (j=0; j<vertexCount; ++j) - { - file->write("vn ",3); - getVectorAsStringLine(buffer->getNormal(j), num); - file->write(num.c_str(), num.size()); - } - - file->write("usemtl mat",10); - num = ""; - for (j=0; j<mat.size(); ++j) - { - if (*mat[j]==buffer->getMaterial()) - { - num = core::stringc(j); - break; - } - } - if (num == "") - { - num = core::stringc(mat.size()); - mat.push_back(&buffer->getMaterial()); - } - file->write(num.c_str(), num.size()); - file->write("\n",1); - - const u32 indexCount = buffer->getIndexCount(); - for (j=0; j<indexCount; j+=3) - { - file->write("f ",2); - num = core::stringc(buffer->getIndices()[j+2]+allVertexCount); - file->write(num.c_str(), num.size()); - file->write("/",1); - file->write(num.c_str(), num.size()); - file->write("/",1); - file->write(num.c_str(), num.size()); - file->write(" ",1); - - num = core::stringc(buffer->getIndices()[j+1]+allVertexCount); - file->write(num.c_str(), num.size()); - file->write("/",1); - file->write(num.c_str(), num.size()); - file->write("/",1); - file->write(num.c_str(), num.size()); - file->write(" ",1); - - num = core::stringc(buffer->getIndices()[j+0]+allVertexCount); - file->write(num.c_str(), num.size()); - file->write("/",1); - file->write(num.c_str(), num.size()); - file->write("/",1); - file->write(num.c_str(), num.size()); - file->write(" ",1); - - file->write("\n",1); - } - file->write("\n",1); - allVertexCount += vertexCount; - } - } - - if (mat.size() == 0) - return true; - - file = FileSystem->createAndWriteFile( name ); - if (file) - { - os::Printer::log("Writing material", file->getFileName()); - - file->write("# exported by Irrlicht\n\n",24); - for (u32 i=0; i<mat.size(); ++i) - { - core::stringc num(i); - file->write("newmtl mat",10); - file->write(num.c_str(),num.size()); - file->write("\n",1); - - getColorAsStringLine(mat[i]->AmbientColor, "Ka", num); - file->write(num.c_str(),num.size()); - getColorAsStringLine(mat[i]->DiffuseColor, "Kd", num); - file->write(num.c_str(),num.size()); - getColorAsStringLine(mat[i]->SpecularColor, "Ks", num); - file->write(num.c_str(),num.size()); - getColorAsStringLine(mat[i]->EmissiveColor, "Ke", num); - file->write(num.c_str(),num.size()); - num = core::stringc((double)(mat[i]->Shininess/0.128f)); - file->write("Ns ", 3); - file->write(num.c_str(),num.size()); - file->write("\n", 1); - if (mat[i]->getTexture(0)) - { - file->write("map_Kd ", 7); - - f32 tposX, tposY, tscaleX, tscaleY; - const core::matrix4& textureMatrix = mat[i]->getTextureMatrix(0); - textureMatrix.getTextureTranslate(tposX, tposY); - textureMatrix.getTextureScale(tscaleX, tscaleY); - - //Write texture translation values - if ( !core::equals(tposX, 0.f) || !core::equals(tposY, 0.f) ) - { - file->write("-o ", 3); - core::stringc tx(tposX); - core::stringc ty(tposY); - - file->write(tx.c_str(), tx.size()); - file->write(" ", 1); - file->write(ty.c_str(), ty.size()); - file->write(" ", 1); - } - - //Write texture scaling values - if ( !core::equals(tscaleX, 1.f) || !core::equals(tscaleY, 1.f) ) - { - file->write("-s ", 3); - - core::stringc sx(tscaleX); - core::stringc sy(tscaleY); - - file->write(sx.c_str(), sx.size()); - file->write(" ", 1); - file->write(sy.c_str(), sy.size()); - file->write(" ", 1); - } - - io::path tname = FileSystem->getRelativeFilename(mat[i]->getTexture(0)->getName(), - FileSystem->getFileDir(file->getFileName())); - // avoid blanks as .obj cannot handle strings with spaces - if (tname.findFirst(' ') != -1) - tname = FileSystem->getFileBasename(tname); - file->write(tname.c_str(), tname.size()); - file->write("\n",1); - } - file->write("\n",1); - } - file->drop(); - } - return true; -} - - -void COBJMeshWriter::getVectorAsStringLine(const core::vector3df& v, core::stringc& s) const -{ - s = core::stringc(-v.X); - s += " "; - s += core::stringc(v.Y); - s += " "; - s += core::stringc(v.Z); - s += "\n"; -} - - -void COBJMeshWriter::getVectorAsStringLine(const core::vector2df& v, core::stringc& s) const -{ - s = core::stringc(v.X); - s += " "; - s += core::stringc(1-v.Y); - s += "\n"; -} - - -void COBJMeshWriter::getColorAsStringLine(const video::SColor& color, const c8* const prefix, core::stringc& s) const -{ - s = prefix; - s += " "; - s += core::stringc((double)(color.getRed()/255.f)); - s += " "; - s += core::stringc((double)(color.getGreen()/255.f)); - s += " "; - s += core::stringc((double)(color.getBlue()/255.f)); - s += "\n"; -} - - -} // end namespace -} // end namespace - -#endif - diff --git a/source/Irrlicht/COBJMeshWriter.h b/source/Irrlicht/COBJMeshWriter.h deleted file mode 100644 index 962b1795..00000000 --- a/source/Irrlicht/COBJMeshWriter.h +++ /dev/null @@ -1,58 +0,0 @@ -// Copyright (C) 2008-2012 Christian Stehno -// This file is part of the "Irrlicht Engine". -// For conditions of distribution and use, see copyright notice in irrlicht.h - -#ifndef __IRR_OBJ_MESH_WRITER_H_INCLUDED__ -#define __IRR_OBJ_MESH_WRITER_H_INCLUDED__ - -#include "IMeshWriter.h" -#include "S3DVertex.h" -#include "irrString.h" - -namespace irr -{ -namespace io -{ - class IFileSystem; -} // end namespace io -namespace scene -{ - class IMeshBuffer; - class ISceneManager; - - //! class to write meshes, implementing a OBJ writer - class COBJMeshWriter : public IMeshWriter - { - public: - - COBJMeshWriter(scene::ISceneManager* smgr, io::IFileSystem* fs); - virtual ~COBJMeshWriter(); - - //! 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: - // create vector output with line end into string - void getVectorAsStringLine(const core::vector3df& v, - core::stringc& s) const; - - // create vector output with line end into string - void getVectorAsStringLine(const core::vector2df& v, - core::stringc& s) const; - - // create color output with line end into string - void getColorAsStringLine(const video::SColor& color, - const c8* const prefix, core::stringc& s) const; - - scene::ISceneManager* SceneManager; - io::IFileSystem* FileSystem; - }; - -} // end namespace -} // end namespace - -#endif - diff --git a/source/Irrlicht/COCTLoader.cpp b/source/Irrlicht/COCTLoader.cpp deleted file mode 100644 index fb7025f7..00000000 --- a/source/Irrlicht/COCTLoader.cpp +++ /dev/null @@ -1,335 +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 -// -// originally written by Murphy McCauley, see COCTLoader.h for details. -// -// COCTLoader by Murphy McCauley (February 2005) -// An Irrlicht loader for OCT files -// -// See the header file for additional information including use and distribution rights. - -#include "IrrCompileConfig.h" -#ifdef _IRR_COMPILE_WITH_OCT_LOADER_ - -#include "COCTLoader.h" -#include "CMeshTextureLoader.h" -#include "IVideoDriver.h" -#include "IFileSystem.h" -#include "os.h" -#include "SAnimatedMesh.h" -#include "SMeshBufferLightMap.h" -#include "irrString.h" -#include "ISceneManager.h" - -namespace irr -{ -namespace scene -{ - -//! constructor -COCTLoader::COCTLoader(ISceneManager* smgr, io::IFileSystem* fs) - : SceneManager(smgr), FileSystem(fs) -{ - #ifdef _DEBUG - setDebugName("COCTLoader"); - #endif - if (FileSystem) - FileSystem->grab(); - - TextureLoader = new CMeshTextureLoader( FileSystem, SceneManager->getVideoDriver() ); -} - - -//! destructor -COCTLoader::~COCTLoader() -{ - if (FileSystem) - FileSystem->drop(); -} - - -// Doesn't really belong here, but it's jammed in for now. -void COCTLoader::OCTLoadLights(io::IReadFile* file, scene::ISceneNode * parent, f32 radius, f32 intensityScale, bool rewind) -{ - if (rewind) - file->seek(0); - - octHeader header; - file->read(&header, sizeof(octHeader)); - - file->seek(sizeof(octVert)*header.numVerts, true); - file->seek(sizeof(octFace)*header.numFaces, true); - file->seek(sizeof(octTexture)*header.numTextures, true); - file->seek(sizeof(octLightmap)*header.numLightmaps, true); - - octLight * lights = new octLight[header.numLights]; - file->read(lights, header.numLights * sizeof(octLight)); - - //TODO: Skip past my extended data just for good form - - for (u32 i = 0; i < header.numLights; i++) - { - const f32 intensity = lights[i].intensity * intensityScale; - - SceneManager->addLightSceneNode(parent, core::vector3df(lights[i].pos[0], lights[i].pos[2], lights[i].pos[1]), - video::SColorf(lights[i].color[0] * intensity, lights[i].color[1] * intensity, lights[i].color[2] * intensity, 1.0f), - radius); - } -} - - -//! 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* COCTLoader::createMesh(io::IReadFile* file) -{ - if (!file) - return 0; - - if ( getMeshTextureLoader() ) - getMeshTextureLoader()->setMeshFile(file); - - octHeader header; - file->read(&header, sizeof(octHeader)); - - octVert * verts = new octVert[header.numVerts]; - octFace * faces = new octFace[header.numFaces]; - octTexture * textures = new octTexture[header.numTextures]; - octLightmap * lightmaps = new octLightmap[header.numLightmaps]; - octLight * lights = new octLight[header.numLights]; - - file->read(verts, sizeof(octVert) * header.numVerts); - file->read(faces, sizeof(octFace) * header.numFaces); - //TODO: Make sure id is in the legal range for Textures and Lightmaps - - u32 i; - for (i = 0; i < header.numTextures; i++) { - octTexture t; - file->read(&t, sizeof(octTexture)); - textures[t.id] = t; - } - for (i = 0; i < header.numLightmaps; i++) { - octLightmap t; - file->read(&t, sizeof(octLightmap)); - lightmaps[t.id] = t; - } - file->read(lights, sizeof(octLight) * header.numLights); - - //TODO: Now read in my extended OCT header (flexible lightmaps and vertex normals) - - - // This is the method Nikolaus Gebhardt used in the Q3 loader -- create a - // meshbuffer for every possible combination of lightmap and texture including - // a "null" texture and "null" lightmap. Ones that end up with nothing in them - // will be removed later. - - SMesh * Mesh = new SMesh(); - for (i=0; i<(header.numTextures+1) * (header.numLightmaps+1); ++i) - { - scene::SMeshBufferLightMap* buffer = new scene::SMeshBufferLightMap(); - - buffer->Material.MaterialType = video::EMT_LIGHTMAP; - buffer->Material.Lighting = false; - Mesh->addMeshBuffer(buffer); - buffer->drop(); - } - - - // Build the mesh buffers - for (i = 0; i < header.numFaces; i++) - { - if (faces[i].numVerts < 3) - continue; - - const f32* const a = verts[faces[i].firstVert].pos; - const f32* const b = verts[faces[i].firstVert+1].pos; - const f32* const c = verts[faces[i].firstVert+2].pos; - const core::vector3df normal = - core::plane3df(core::vector3df(a[0],a[1],a[2]), core::vector3df(b[0],c[1],c[2]), core::vector3df(c[0],c[1],c[2])).Normal; - - const u32 textureID = core::min_(s32(faces[i].textureID), s32(header.numTextures - 1)) + 1; - const u32 lightmapID = core::min_(s32(faces[i].lightmapID),s32(header.numLightmaps - 1)) + 1; - SMeshBufferLightMap * meshBuffer = (SMeshBufferLightMap*)Mesh->getMeshBuffer(lightmapID * (header.numTextures + 1) + textureID); - const u32 base = meshBuffer->Vertices.size(); - - // Add this face's verts - u32 v; - for (v = 0; v < faces[i].numVerts; ++v) - { - octVert * vv = &verts[faces[i].firstVert + v]; - video::S3DVertex2TCoords vert; - vert.Pos.set(vv->pos[0], vv->pos[1], vv->pos[2]); - vert.Color = video::SColor(0,255,255,255); - vert.Normal.set(normal); - - if (textureID == 0) - { - // No texture -- just a lightmap. Thus, use lightmap coords for texture 1. - // (the actual texture will be swapped later) - vert.TCoords.set(vv->lc[0], vv->lc[1]); - } - else - { - vert.TCoords.set(vv->tc[0], vv->tc[1]); - vert.TCoords2.set(vv->lc[0], vv->lc[1]); - } - - meshBuffer->Vertices.push_back(vert); - } - - // Now add the indices - // This weird loop turns convex polygons into triangle strips. - // I do it this way instead of a simple fan because it usually looks a lot better in wireframe, for example. - // High, Low - u32 h = faces[i].numVerts - 1; - u32 l = 0; - for (v = 0; v < faces[i].numVerts - 2; ++v) - { - const u32 center = (v & 1)? h - 1: l + 1; - - meshBuffer->Indices.push_back(base + h); - meshBuffer->Indices.push_back(base + l); - meshBuffer->Indices.push_back(base + center); - - if (v & 1) - --h; - else - ++l; - } - } - - // load textures - core::array<video::ITexture*> tex; - tex.reallocate(header.numTextures + 1); - tex.push_back(0); - - for (i = 1; i < (header.numTextures + 1); i++) - { - tex.push_back( getMeshTextureLoader() ? getMeshTextureLoader()->getTexture(textures[i-1].fileName) : NULL ); - } - - // prepare lightmaps - core::array<video::ITexture*> lig; - lig.set_used(header.numLightmaps + 1); - lig[0] = 0; - - const u32 lightmapWidth = 128; - const u32 lightmapHeight = 128; - const core::dimension2d<u32> lmapsize(lightmapWidth, lightmapHeight); - - bool oldMipMapState = SceneManager->getVideoDriver()->getTextureCreationFlag(video::ETCF_CREATE_MIP_MAPS); - SceneManager->getVideoDriver()->setTextureCreationFlag(video::ETCF_CREATE_MIP_MAPS, false); - - video::IImage* tmpImage = SceneManager->getVideoDriver()->createImage(video::ECF_R8G8B8, lmapsize); - for (i = 1; i < (header.numLightmaps + 1); ++i) - { - core::stringc lightmapname = file->getFileName(); - lightmapname += ".lightmap."; - lightmapname += (int)i; - - const octLightmap* lm = &lightmaps[i-1]; - - for (u32 x=0; x<lightmapWidth; ++x) - { - for (u32 y=0; y<lightmapHeight; ++y) - { - tmpImage->setPixel(x, y, - video::SColor(255, - lm->data[x][y][2], - lm->data[x][y][1], - lm->data[x][y][0])); - } - } - - lig[i] = SceneManager->getVideoDriver()->addTexture(lightmapname.c_str(), tmpImage); - } - tmpImage->drop(); - SceneManager->getVideoDriver()->setTextureCreationFlag(video::ETCF_CREATE_MIP_MAPS, oldMipMapState); - - // Free stuff - delete [] verts; - delete [] faces; - delete [] textures; - delete [] lightmaps; - delete [] lights; - - // attach materials - for (i = 0; i < header.numLightmaps + 1; i++) - { - for (u32 j = 0; j < header.numTextures + 1; j++) - { - u32 mb = i * (header.numTextures + 1) + j; - SMeshBufferLightMap * meshBuffer = (SMeshBufferLightMap*)Mesh->getMeshBuffer(mb); - meshBuffer->Material.setTexture(0, tex[j]); - meshBuffer->Material.setTexture(1, lig[i]); - - if (meshBuffer->Material.getTexture(0) == 0) - { - // This material has no texture, so we'll just show the lightmap if there is one. - // We swapped the texture coordinates earlier. - meshBuffer->Material.setTexture(0, meshBuffer->Material.getTexture(1)); - meshBuffer->Material.setTexture(1, 0); - } - if (meshBuffer->Material.getTexture(1) == 0) - { - // If there is only one texture, it should be solid and lit. - // Among other things, this way you can preview OCT lights. - meshBuffer->Material.MaterialType = video::EMT_SOLID; - meshBuffer->Material.Lighting = true; - } - } - } - - // delete all buffers without geometry in it. - i = 0; - while(i < Mesh->MeshBuffers.size()) - { - if (Mesh->MeshBuffers[i]->getVertexCount() == 0 || - Mesh->MeshBuffers[i]->getIndexCount() == 0 || - Mesh->MeshBuffers[i]->getMaterial().getTexture(0) == 0) - { - // Meshbuffer is empty -- drop it - Mesh->MeshBuffers[i]->drop(); - Mesh->MeshBuffers.erase(i); - } - else - { - ++i; - } - } - - - // create bounding box - for (i = 0; i < Mesh->MeshBuffers.size(); ++i) - { - Mesh->MeshBuffers[i]->recalculateBoundingBox(); - } - Mesh->recalculateBoundingBox(); - - - // Set up an animated mesh to hold the mesh - SAnimatedMesh* AMesh = new SAnimatedMesh(); - AMesh->Type = EAMT_OCT; - AMesh->addMesh(Mesh); - AMesh->recalculateBoundingBox(); - Mesh->drop(); - - return AMesh; -} - - -//! returns true if the file maybe is able to be loaded by this class -//! based on the file extension (e.g. ".bsp") -bool COCTLoader::isALoadableFileExtension(const io::path& filename) const -{ - return core::hasFileExtension ( filename, "oct" ); -} - - -} // end namespace scene -} // end namespace irr - -#endif // _IRR_COMPILE_WITH_OCT_LOADER_ - diff --git a/source/Irrlicht/COCTLoader.h b/source/Irrlicht/COCTLoader.h deleted file mode 100644 index 560d1190..00000000 --- a/source/Irrlicht/COCTLoader.h +++ /dev/null @@ -1,141 +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 -// -// Because I (Nikolaus Gebhardt) did some changes to Murphy McCauley's loader, -// I'm writing this down here: -// - Replaced all dependencies to STL and stdio with irr:: methods/constructs -// - Disabled logging define -// - Changed some minor things (Don't remember what exactly.) -// Thanks a lot to Murphy McCauley for writing this loader. - -// -// COCTLoader by Murphy McCauley (February 2005) -// An Irrlicht loader for OCT files -// -// OCT file format information comes from the sourcecode of the Fluid Studios -// Radiosity Processor by Paul Nettle. You can get that sourcecode from -// http://www.fluidstudios.com . -// -// Parts of this code are from Irrlicht's CQ3LevelMesh and C3DSMeshFileLoader, -// and are Copyright (C) 2002-2004 Nikolaus Gebhardt. -// -// Use of this code is subject to the following: -// -// 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. -// 4. You may not use this software to directly or indirectly cause harm to others. - - -#ifndef __C_OCT_LOADER_H_INCLUDED__ -#define __C_OCT_LOADER_H_INCLUDED__ - -#include "IMeshLoader.h" -#include "IReadFile.h" -#include "SMesh.h" -#include "irrString.h" - -namespace irr -{ -namespace io -{ - class IFileSystem; -} // end namespace io -namespace scene -{ - class ISceneManager; - class ISceneNode; - - class COCTLoader : public IMeshLoader - { - public: - //! constructor - COCTLoader(ISceneManager* smgr, io::IFileSystem* fs); - - //! destructor - virtual ~COCTLoader(); - - //! 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_; - - void OCTLoadLights(io::IReadFile* file, - ISceneNode * parent = 0, f32 radius = 500.0f, - f32 intensityScale = 0.0000001f*2.5, - bool rewind = true); - - private: - struct octHeader { - u32 numVerts; - u32 numFaces; - u32 numTextures; - u32 numLightmaps; - u32 numLights; - }; - - struct octHeaderEx { - u32 magic; // 'OCTX' - 0x4F435458L - u32 numLightmaps; - u32 lightmapWidth; - u32 lightmapHeight; - u32 containsVertexNormals; - }; - - struct octFace { - u32 firstVert; - u32 numVerts; - u32 textureID; - u32 lightmapID; - f32 plane[4]; - }; - - struct octVert { - f32 tc[2]; - f32 lc[2]; - f32 pos[3]; - }; - - struct octTexture { - u32 id; - char fileName[64]; - }; - - struct octLightmap { - u32 id; - u8 data[128][128][3]; - }; - - struct octLight { - f32 pos[3]; - f32 color[3]; - u32 intensity; - }; - - ISceneManager* SceneManager; - io::IFileSystem* FileSystem; - }; - -} // end namespace scene -} // end namespace irr - -#endif - diff --git a/source/Irrlicht/COctreeSceneNode.cpp b/source/Irrlicht/COctreeSceneNode.cpp deleted file mode 100644 index 16df1199..00000000 --- a/source/Irrlicht/COctreeSceneNode.cpp +++ /dev/null @@ -1,677 +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_OCTREE_SCENENODE_ - -#include "COctreeSceneNode.h" -#include "Octree.h" -#include "ISceneManager.h" -#include "IVideoDriver.h" -#include "ICameraSceneNode.h" -#include "IMeshCache.h" -#include "IAnimatedMesh.h" -#include "IMaterialRenderer.h" -#include "os.h" -#ifdef _IRR_COMPILE_WITH_SHADOW_VOLUME_SCENENODE_ -#include "CShadowVolumeSceneNode.h" -#else -#include "IShadowVolumeSceneNode.h" -#endif // _IRR_COMPILE_WITH_SHADOW_VOLUME_SCENENODE_ -#include "EProfileIDs.h" -#include "IProfiler.h" - -namespace irr -{ -namespace scene -{ - - -//! constructor -COctreeSceneNode::COctreeSceneNode(ISceneNode* parent, ISceneManager* mgr, - s32 id, s32 minimalPolysPerNode) - : IOctreeSceneNode(parent, mgr, id), StdOctree(0), LightMapOctree(0), - TangentsOctree(0), VertexType((video::E_VERTEX_TYPE)-1), - MinimalPolysPerNode(minimalPolysPerNode), Mesh(0), Shadow(0), - UseVBOs(EOV_NO_VBO), PolygonChecks(EOPC_BOX) -{ -#ifdef _DEBUG - setDebugName("COctreeSceneNode"); -#endif - - IRR_PROFILE( - static bool initProfile = false; - if (!initProfile ) - { - initProfile = true; - getProfiler().add(EPID_OC_RENDER, L"render octnode", L"Irrlicht scene"); - getProfiler().add(EPID_OC_CALCPOLYS, L"calc octnode", L"Irrlicht scene"); - } - ) -} - - -//! destructor -COctreeSceneNode::~COctreeSceneNode() -{ - if (Shadow) - Shadow->drop(); - deleteTree(); -} - - -void COctreeSceneNode::OnRegisterSceneNode() -{ - if (IsVisible) - { - // because this node supports rendering of mixed mode meshes consisting of - // transparent and solid material at the same time, we need to go through all - // materials, check of what type they are and register this node for the right - // render pass according to that. - - video::IVideoDriver* driver = SceneManager->getVideoDriver(); - - PassCount = 0; - u32 transparentCount = 0; - u32 solidCount = 0; - - // count transparent and solid materials in this scene node - for (u32 i=0; i<Materials.size(); ++i) - { - if (driver->needsTransparentRenderPass(Materials[i])) - ++transparentCount; - else - ++solidCount; - - if (solidCount && transparentCount) - break; - } - - // register according to material types counted - - if (solidCount) - SceneManager->registerNodeForRendering(this, scene::ESNRP_SOLID); - - if (transparentCount) - SceneManager->registerNodeForRendering(this, scene::ESNRP_TRANSPARENT); - - ISceneNode::OnRegisterSceneNode(); - } -} - -template <class VT> -void renderMeshBuffer(video::IVideoDriver* driver, EOCTREENODE_VBO useVBO, typename Octree<VT>::SMeshChunk& meshChunk, const typename Octree<VT>::SIndexData& indexData) -{ - switch ( useVBO ) - { - case EOV_NO_VBO: - driver->drawIndexedTriangleList( - &meshChunk.Vertices[0], - meshChunk.Vertices.size(), - indexData.Indices, indexData.CurrentSize / 3); - break; - case EOV_USE_VBO: - driver->drawMeshBuffer ( &meshChunk ); - break; - case EOV_USE_VBO_WITH_VISIBITLY: - { - u16* oldPointer = meshChunk.Indices.pointer(); - const u32 oldSize = meshChunk.Indices.size(); - meshChunk.Indices.set_free_when_destroyed(false); - meshChunk.Indices.set_pointer(indexData.Indices, indexData.CurrentSize, false, false); - meshChunk.setDirty(scene::EBT_INDEX); - driver->drawMeshBuffer ( &meshChunk ); - meshChunk.Indices.set_pointer(oldPointer, oldSize); - meshChunk.setDirty(scene::EBT_INDEX); - break; - } - } -} - -//! renders the node. -void COctreeSceneNode::render() -{ - IRR_PROFILE(CProfileScope psRender(EPID_OC_RENDER);) - video::IVideoDriver* driver = SceneManager->getVideoDriver(); - - if (!driver) - return; - - ICameraSceneNode* camera = SceneManager->getActiveCamera(); - if (!camera) - return; - - const bool isTransparentPass = - SceneManager->getSceneNodeRenderPass() == scene::ESNRP_TRANSPARENT; - ++PassCount; - - driver->setTransform(video::ETS_WORLD, AbsoluteTransformation); - - if (Shadow) - Shadow->updateShadowVolumes(); - - SViewFrustum frust = *camera->getViewFrustum(); - - //transform the frustum to the current absolute transformation - if ( !AbsoluteTransformation.isIdentity() ) - { - core::matrix4 invTrans(AbsoluteTransformation, core::matrix4::EM4CONST_INVERSE); - frust.transform(invTrans); - } - - const core::aabbox3d<float> &box = frust.getBoundingBox(); - - switch (VertexType) - { - case video::EVT_STANDARD: - { - IRR_PROFILE(getProfiler().start(EPID_OC_CALCPOLYS)); - switch ( PolygonChecks ) - { - case EOPC_BOX: - StdOctree->calculatePolys(box); - break; - case EOPC_FRUSTUM: - StdOctree->calculatePolys(frust); - break; - } - IRR_PROFILE(getProfiler().stop(EPID_OC_CALCPOLYS)); - - const Octree<video::S3DVertex>::SIndexData* d = StdOctree->getIndexData(); - - for (u32 i=0; i<Materials.size(); ++i) - { - if ( 0 == d[i].CurrentSize ) - continue; - - const bool transparent = driver->needsTransparentRenderPass(Materials[i]); - - // only render transparent buffer if this is the transparent render pass - // and solid only in solid pass - if (transparent == isTransparentPass) - { - driver->setMaterial(Materials[i]); - renderMeshBuffer<video::S3DVertex>(driver, UseVBOs, StdMeshes[i], d[i]); - } - } - } - break; - case video::EVT_2TCOORDS: - { - IRR_PROFILE(getProfiler().start(EPID_OC_CALCPOLYS)); - switch ( PolygonChecks ) - { - case EOPC_BOX: - LightMapOctree->calculatePolys(box); - break; - case EOPC_FRUSTUM: - LightMapOctree->calculatePolys(frust); - break; - } - IRR_PROFILE(getProfiler().stop(EPID_OC_CALCPOLYS)); - - const Octree<video::S3DVertex2TCoords>::SIndexData* d = LightMapOctree->getIndexData(); - - for (u32 i=0; i<Materials.size(); ++i) - { - if ( 0 == d[i].CurrentSize ) - continue; - - const video::IMaterialRenderer* const rnd = driver->getMaterialRenderer(Materials[i].MaterialType); - const bool transparent = (rnd && rnd->isTransparent()); - - // only render transparent buffer if this is the transparent render pass - // and solid only in solid pass - if (transparent == isTransparentPass) - { - driver->setMaterial(Materials[i]); - - renderMeshBuffer<video::S3DVertex2TCoords>(driver, UseVBOs, LightMapMeshes[i], d[i]); - } - } - } - break; - case video::EVT_TANGENTS: - { - IRR_PROFILE(getProfiler().start(EPID_OC_CALCPOLYS)); - switch ( PolygonChecks ) - { - case EOPC_BOX: - TangentsOctree->calculatePolys(box); - break; - case EOPC_FRUSTUM: - TangentsOctree->calculatePolys(frust); - break; - } - IRR_PROFILE(getProfiler().stop(EPID_OC_CALCPOLYS)); - - const Octree<video::S3DVertexTangents>::SIndexData* d = TangentsOctree->getIndexData(); - - for (u32 i=0; i<Materials.size(); ++i) - { - if ( 0 == d[i].CurrentSize ) - continue; - - const video::IMaterialRenderer* const rnd = driver->getMaterialRenderer(Materials[i].MaterialType); - const bool transparent = (rnd && rnd->isTransparent()); - - // only render transparent buffer if this is the transparent render pass - // and solid only in solid pass - if (transparent == isTransparentPass) - { - driver->setMaterial(Materials[i]); - renderMeshBuffer<video::S3DVertexTangents>(driver, UseVBOs, TangentsMeshes[i], d[i]); - } - } - } - break; - } - - // for debug purposes only - if (DebugDataVisible && !Materials.empty() && PassCount==1) - { - core::array< const core::aabbox3d<f32>* > boxes; - video::SMaterial m; - m.Lighting = false; - driver->setMaterial(m); - if ( DebugDataVisible & scene::EDS_BBOX_BUFFERS ) - { - switch (VertexType) - { - case video::EVT_STANDARD: - StdOctree->getBoundingBoxes(box, boxes); - break; - case video::EVT_2TCOORDS: - LightMapOctree->getBoundingBoxes(box, boxes); - break; - case video::EVT_TANGENTS: - TangentsOctree->getBoundingBoxes(box, boxes); - break; - } - - for (u32 b=0; b!=boxes.size(); ++b) - driver->draw3DBox(*boxes[b]); - } - - if ( DebugDataVisible & scene::EDS_BBOX ) - driver->draw3DBox(Box,video::SColor(0,255,0,0)); - } - -} - - -//! Removes a child from this scene node. -//! Implemented here, to be able to remove the shadow properly, if there is one, -//! or to remove attached childs. -bool COctreeSceneNode::removeChild(ISceneNode* child) -{ - if (child && Shadow == child) - { - Shadow->drop(); - Shadow = 0; - } - - return ISceneNode::removeChild(child); -} - -void COctreeSceneNode::setUseVBO(EOCTREENODE_VBO useVBO) -{ - UseVBOs = useVBO; - if ( Mesh ) - createTree(Mesh); -} - -EOCTREENODE_VBO COctreeSceneNode::getUseVBO() const -{ - return UseVBOs; -} - -void COctreeSceneNode::setPolygonChecks(EOCTREE_POLYGON_CHECKS checks) -{ - PolygonChecks = checks; -} - -EOCTREE_POLYGON_CHECKS COctreeSceneNode::getPolygonChecks() const -{ - return PolygonChecks; -} - -//! Creates shadow volume scene node as child of this node -//! and returns a pointer to it. -IShadowVolumeSceneNode* COctreeSceneNode::addShadowVolumeSceneNode( - const IMesh* shadowMesh, s32 id, bool zfailmethod, f32 infinity) -{ -#ifdef _IRR_COMPILE_WITH_SHADOW_VOLUME_SCENENODE_ - if (!SceneManager->getVideoDriver()->queryFeature(video::EVDF_STENCIL_BUFFER)) - return 0; - - if (!shadowMesh) - shadowMesh = Mesh; // if null is given, use the mesh of node - - if (Shadow) - Shadow->drop(); - - Shadow = new CShadowVolumeSceneNode(shadowMesh, this, SceneManager, id, zfailmethod, infinity); - return Shadow; -#else - return 0; -#endif -} - - -//! returns the axis aligned bounding box of this node -const core::aabbox3d<f32>& COctreeSceneNode::getBoundingBox() const -{ - return Box; -} - - -//! creates the tree -/* This method has a lot of duplication and overhead. Moreover, the tangents mesh conversion does not really work. I think we need a a proper mesh implementation for octrees, which handle all vertex types internally. Converting all structures to just one vertex type is always problematic. -Thanks to Auria for fixing major parts of this method. */ -bool COctreeSceneNode::createTree(IMesh* mesh) -{ - if (!mesh) - return false; - - MeshName = SceneManager->getMeshCache()->getMeshName(mesh); - - mesh->grab(); - deleteTree(); - - Mesh = mesh; - - const u32 beginTime = os::Timer::getRealTime(); - - u32 nodeCount = 0; - u32 polyCount = 0; - u32 i; - - Box = mesh->getBoundingBox(); - - if (mesh->getMeshBufferCount()) - { - // check for "largest" buffer types - // Also dropping buffers/materials for empty buffer - // (which looks like a horrible idea. If a user wanted that material without mesh he should still get it... - // but not going to change that now. Only documenting it after figuring out what happens here. - // It works at least as Materials are reset in deleteTree). - VertexType = video::EVT_STANDARD; - u32 meshReserve = 0; - for (i=0; i<mesh->getMeshBufferCount(); ++i) - { - const IMeshBuffer* b = mesh->getMeshBuffer(i); - if (b->getVertexCount() && b->getIndexCount()) - { - ++meshReserve; - if (b->getVertexType() == video::EVT_2TCOORDS) - VertexType = video::EVT_2TCOORDS; - else if (b->getVertexType() == video::EVT_TANGENTS) - VertexType = video::EVT_TANGENTS; - } - } - Materials.reallocate(Materials.size()+meshReserve); - - switch(VertexType) - { - case video::EVT_STANDARD: - { - StdMeshes.reallocate(StdMeshes.size() + meshReserve); - for (i=0; i<mesh->getMeshBufferCount(); ++i) - { - IMeshBuffer* b = mesh->getMeshBuffer(i); - - if (b->getVertexCount() && b->getIndexCount()) - { - Materials.push_back(b->getMaterial()); - - StdMeshes.push_back(Octree<video::S3DVertex>::SMeshChunk()); - Octree<video::S3DVertex>::SMeshChunk &nchunk = StdMeshes.getLast(); - nchunk.MaterialId = Materials.size() - 1; - - u32 v; - nchunk.Vertices.reallocate(b->getVertexCount()); - switch (b->getVertexType()) - { - case video::EVT_STANDARD: - for (v=0; v<b->getVertexCount(); ++v) - nchunk.Vertices.push_back(((video::S3DVertex*)b->getVertices())[v]); - break; - case video::EVT_2TCOORDS: - for (v=0; v<b->getVertexCount(); ++v) - nchunk.Vertices.push_back(((video::S3DVertex2TCoords*)b->getVertices())[v]); - break; - case video::EVT_TANGENTS: - for (v=0; v<b->getVertexCount(); ++v) - nchunk.Vertices.push_back(((video::S3DVertexTangents*)b->getVertices())[v]); - break; - } - - polyCount += b->getIndexCount(); - - nchunk.Indices.reallocate(b->getIndexCount()); - for (v=0; v<b->getIndexCount(); ++v) - nchunk.Indices.push_back(b->getIndices()[v]); - } - } - - StdOctree = new Octree<video::S3DVertex>(StdMeshes, MinimalPolysPerNode); - nodeCount = StdOctree->getNodeCount(); - } - break; - case video::EVT_2TCOORDS: - { - LightMapMeshes.reallocate(LightMapMeshes.size() + meshReserve); - - for ( i=0; i < mesh->getMeshBufferCount(); ++i) - { - IMeshBuffer* b = mesh->getMeshBuffer(i); - - if (b->getVertexCount() && b->getIndexCount()) - { - Materials.push_back(b->getMaterial()); - LightMapMeshes.push_back(Octree<video::S3DVertex2TCoords>::SMeshChunk()); - Octree<video::S3DVertex2TCoords>::SMeshChunk& nchunk = LightMapMeshes.getLast(); - nchunk.MaterialId = Materials.size() - 1; - - if (UseVBOs == EOV_USE_VBO_WITH_VISIBITLY) - { - nchunk.setHardwareMappingHint(scene::EHM_STATIC, scene::EBT_VERTEX); - nchunk.setHardwareMappingHint(scene::EHM_DYNAMIC, scene::EBT_INDEX); - } - else - nchunk.setHardwareMappingHint(scene::EHM_STATIC); - - u32 v; - nchunk.Vertices.reallocate(b->getVertexCount()); - switch (b->getVertexType()) - { - case video::EVT_STANDARD: - for (v=0; v<b->getVertexCount(); ++v) - nchunk.Vertices.push_back(((video::S3DVertex*)b->getVertices())[v]); - break; - case video::EVT_2TCOORDS: - for (v=0; v<b->getVertexCount(); ++v) - nchunk.Vertices.push_back(((video::S3DVertex2TCoords*)b->getVertices())[v]); - break; - case video::EVT_TANGENTS: - for (v=0; v<b->getVertexCount(); ++v) - nchunk.Vertices.push_back(((video::S3DVertexTangents*)b->getVertices())[v]); - break; - } - - polyCount += b->getIndexCount(); - nchunk.Indices.reallocate(b->getIndexCount()); - for (v=0; v<b->getIndexCount(); ++v) - nchunk.Indices.push_back(b->getIndices()[v]); - } - } - - LightMapOctree = new Octree<video::S3DVertex2TCoords>(LightMapMeshes, MinimalPolysPerNode); - nodeCount = LightMapOctree->getNodeCount(); - } - break; - case video::EVT_TANGENTS: - { - TangentsMeshes.reallocate(TangentsMeshes.size() + meshReserve); - - for (u32 i=0; i<mesh->getMeshBufferCount(); ++i) - { - IMeshBuffer* b = mesh->getMeshBuffer(i); - - if (b->getVertexCount() && b->getIndexCount()) - { - Materials.push_back(b->getMaterial()); - TangentsMeshes.push_back(Octree<video::S3DVertexTangents>::SMeshChunk()); - Octree<video::S3DVertexTangents>::SMeshChunk& nchunk = TangentsMeshes.getLast(); - nchunk.MaterialId = Materials.size() - 1; - - u32 v; - nchunk.Vertices.reallocate(b->getVertexCount()); - switch (b->getVertexType()) - { - case video::EVT_STANDARD: - for (v=0; v<b->getVertexCount(); ++v) - { - const video::S3DVertex& tmpV = ((video::S3DVertex*)b->getVertices())[v]; - nchunk.Vertices.push_back(video::S3DVertexTangents(tmpV.Pos, tmpV.Color, tmpV.TCoords)); - } - break; - case video::EVT_2TCOORDS: - for (v=0; v<b->getVertexCount(); ++v) - { - const video::S3DVertex2TCoords& tmpV = ((video::S3DVertex2TCoords*)b->getVertices())[v]; - nchunk.Vertices.push_back(video::S3DVertexTangents(tmpV.Pos, tmpV.Color, tmpV.TCoords)); - } - break; - case video::EVT_TANGENTS: - for (v=0; v<b->getVertexCount(); ++v) - nchunk.Vertices.push_back(((video::S3DVertexTangents*)b->getVertices())[v]); - break; - } - - polyCount += b->getIndexCount(); - nchunk.Indices.reallocate(b->getIndexCount()); - for (v=0; v<b->getIndexCount(); ++v) - nchunk.Indices.push_back(b->getIndices()[v]); - } - } - - TangentsOctree = new Octree<video::S3DVertexTangents>(TangentsMeshes, MinimalPolysPerNode); - nodeCount = TangentsOctree->getNodeCount(); - } - break; - } - } - - const u32 endTime = os::Timer::getRealTime(); - c8 tmp[255]; - sprintf(tmp, "Needed %ums to create Octree SceneNode.(%u nodes, %u polys)", - endTime - beginTime, nodeCount, polyCount/3); - os::Printer::log(tmp, ELL_INFORMATION); - - return true; -} - - -//! returns the material based on the zero based index i. -video::SMaterial& COctreeSceneNode::getMaterial(u32 i) -{ - if ( i >= Materials.size() ) - return ISceneNode::getMaterial(i); - - return Materials[i]; -} - - -//! returns amount of materials used by this scene node. -u32 COctreeSceneNode::getMaterialCount() const -{ - return Materials.size(); -} - - -//! Writes attributes of the scene node. -void COctreeSceneNode::serializeAttributes(io::IAttributes* out, io::SAttributeReadWriteOptions* options) const -{ - ISceneNode::serializeAttributes(out, options); - - out->addInt("MinimalPolysPerNode", MinimalPolysPerNode); - out->addString("Mesh", MeshName.c_str()); -} - - -//! Reads attributes of the scene node. -void COctreeSceneNode::deserializeAttributes(io::IAttributes* in, io::SAttributeReadWriteOptions* options) -{ - const s32 oldMinimal = MinimalPolysPerNode; - - MinimalPolysPerNode = in->getAttributeAsInt("MinimalPolysPerNode"); - io::path newMeshStr = in->getAttributeAsString("Mesh"); - - IMesh* newMesh = 0; - - if (newMeshStr == "") - newMeshStr = MeshName; - - IAnimatedMesh* newAnimatedMesh = SceneManager->getMesh(newMeshStr.c_str()); - - if (newAnimatedMesh) - newMesh = newAnimatedMesh->getMesh(0); - - if (newMesh && ((MeshName != newMeshStr) || (MinimalPolysPerNode != oldMinimal))) - { - // recalculate tree - createTree(newMesh); - } - - ISceneNode::deserializeAttributes(in, options); -} - - -void COctreeSceneNode::deleteTree() -{ - delete StdOctree; - StdOctree = 0; - StdMeshes.clear(); - - delete LightMapOctree; - LightMapOctree = 0; - LightMapMeshes.clear(); - - delete TangentsOctree; - TangentsOctree = 0; - TangentsMeshes.clear(); - - Materials.clear(); - - if(Mesh) - Mesh->drop(); -} - -void COctreeSceneNode::setMesh(IMesh* mesh) -{ - createTree(mesh); -} - -IMesh* COctreeSceneNode::getMesh(void) -{ - return Mesh; -} - -void COctreeSceneNode::setReadOnlyMaterials(bool readonly) -{ - // Do nothing -} - -bool COctreeSceneNode::isReadOnlyMaterials() const -{ - return false; -} - - -} // end namespace scene -} // end namespace irr - -#endif // _IRR_COMPILE_WITH_OCTREE_SCENENODE_ diff --git a/source/Irrlicht/COctreeSceneNode.h b/source/Irrlicht/COctreeSceneNode.h deleted file mode 100644 index 5ef28088..00000000 --- a/source/Irrlicht/COctreeSceneNode.h +++ /dev/null @@ -1,132 +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_OCTREE_SCENE_NODE_H_INCLUDED__ -#define __C_OCTREE_SCENE_NODE_H_INCLUDED__ - -#include "IOctreeSceneNode.h" -#include "Octree.h" - -namespace irr -{ -namespace scene -{ - class COctreeSceneNode; - - //! implementation of the IOctreeSceneNode - class COctreeSceneNode : public IOctreeSceneNode - { - public: - - //! constructor - COctreeSceneNode(ISceneNode* parent, ISceneManager* mgr, s32 id, - s32 minimalPolysPerNode=512); - - //! destructor - virtual ~COctreeSceneNode(); - - virtual void OnRegisterSceneNode() _IRR_OVERRIDE_; - - //! renders the node. - virtual void render() _IRR_OVERRIDE_; - - //! returns the axis aligned bounding box of this node - virtual const core::aabbox3d<f32>& getBoundingBox() const _IRR_OVERRIDE_; - - //! creates the tree - bool createTree(IMesh* mesh); - - //! returns the material based on the zero based index i. To get the amount - //! of materials used by this scene node, use getMaterialCount(). - //! This function is needed for inserting the node into the scene hierarchy on a - //! optimal position for minimizing renderstate changes, but can also be used - //! to directly modify the material of a scene node. - virtual video::SMaterial& getMaterial(u32 i) _IRR_OVERRIDE_; - - //! returns amount of materials used by this scene node. - virtual u32 getMaterialCount() const _IRR_OVERRIDE_; - - //! Writes attributes of the scene node. - virtual void serializeAttributes(io::IAttributes* out, io::SAttributeReadWriteOptions* options=0) const _IRR_OVERRIDE_; - - //! Reads attributes of the scene node. - virtual void deserializeAttributes(io::IAttributes* in, io::SAttributeReadWriteOptions* options=0) _IRR_OVERRIDE_; - - //! Returns type of the scene node - virtual ESCENE_NODE_TYPE getType() const _IRR_OVERRIDE_ { return ESNT_OCTREE; } - - //! Sets a new mesh to display - virtual void setMesh(IMesh* mesh) _IRR_OVERRIDE_; - - //! Get the currently defined mesh for display. - virtual IMesh* getMesh(void) _IRR_OVERRIDE_; - - //! Sets if the scene node should not copy the materials of the mesh but use them in a read only style. - virtual void setReadOnlyMaterials(bool readonly) _IRR_OVERRIDE_; - - //! Check if the scene node should not copy the materials of the mesh but use them in a read only style - virtual bool isReadOnlyMaterials() const _IRR_OVERRIDE_; - - //! Creates shadow volume scene node as child of this node - //! and returns a pointer to it. - virtual IShadowVolumeSceneNode* addShadowVolumeSceneNode(const IMesh* shadowMesh, - s32 id, bool zfailmethod=true, f32 infinity=10000.0f) _IRR_OVERRIDE_; - - //! Removes a child from this scene node. - //! Implemented here, to be able to remove the shadow properly, if there is one, - //! or to remove attached child. - virtual bool removeChild(ISceneNode* child) _IRR_OVERRIDE_; - - // TODO: Currently using VBO's will crash when reloading the model. - // The reason is that COctreeSceneNode uses Octree::SMeshChunk - // which does use a an IReferenceCounted object on the stack. - // Which breaks VBO's which correctly use reference counting., - //! Set if/how vertex buffer object are used for the meshbuffers - /** NOTE: When there is already a mesh in the node this will rebuild - the octree. */ - virtual void setUseVBO(EOCTREENODE_VBO useVBO); - - //! Get if/how vertex buffer object are used for the meshbuffers - virtual EOCTREENODE_VBO getUseVBO() const _IRR_OVERRIDE_; - - //! Set the kind of tests polygons do for visibility against the camera - virtual void setPolygonChecks(EOCTREE_POLYGON_CHECKS checks) _IRR_OVERRIDE_; - - //! Get the kind of tests polygons do for visibility against the camera - virtual EOCTREE_POLYGON_CHECKS getPolygonChecks() const _IRR_OVERRIDE_; - - private: - - void deleteTree(); - - core::aabbox3d<f32> Box; - - Octree<video::S3DVertex>* StdOctree; - core::array< Octree<video::S3DVertex>::SMeshChunk > StdMeshes; - - Octree<video::S3DVertex2TCoords>* LightMapOctree; - core::array< Octree<video::S3DVertex2TCoords>::SMeshChunk > LightMapMeshes; - - Octree<video::S3DVertexTangents>* TangentsOctree; - core::array< Octree<video::S3DVertexTangents>::SMeshChunk > TangentsMeshes; - - video::E_VERTEX_TYPE VertexType; - core::array< video::SMaterial > Materials; - - core::stringc MeshName; - s32 MinimalPolysPerNode; - s32 PassCount; - - IMesh * Mesh; - IShadowVolumeSceneNode* Shadow; - - EOCTREENODE_VBO UseVBOs; - EOCTREE_POLYGON_CHECKS PolygonChecks; - }; - -} // end namespace scene -} // end namespace irr - -#endif - diff --git a/source/Irrlicht/COctreeTriangleSelector.cpp b/source/Irrlicht/COctreeTriangleSelector.cpp deleted file mode 100644 index a7627463..00000000 --- a/source/Irrlicht/COctreeTriangleSelector.cpp +++ /dev/null @@ -1,327 +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 "COctreeTriangleSelector.h" -#include "ISceneNode.h" - -#include "os.h" - -namespace irr -{ -namespace scene -{ - -//! constructor -COctreeTriangleSelector::COctreeTriangleSelector(const IMesh* mesh, - ISceneNode* node, s32 minimalPolysPerNode) - : CTriangleSelector(mesh, node, false) - , Root(0), NodeCount(0) - , MinimalPolysPerNode(minimalPolysPerNode) -{ - #ifdef _DEBUG - setDebugName("COctreeTriangleSelector"); - #endif - - if (!Triangles.empty()) - { - const u32 start = os::Timer::getRealTime(); - - // create the triangle octree - Root = new SOctreeNode(); - Root->Triangles = Triangles; - constructOctree(Root); - - c8 tmp[256]; - sprintf(tmp, "Needed %ums to create OctreeTriangleSelector.(%d nodes, %u polys)", - os::Timer::getRealTime() - start, NodeCount, Triangles.size()); - os::Printer::log(tmp, ELL_INFORMATION); - } -} - -COctreeTriangleSelector::COctreeTriangleSelector(const IMeshBuffer* meshBuffer, irr::u32 materialIndex, ISceneNode* node, s32 minimalPolysPerNode) - : CTriangleSelector(meshBuffer, materialIndex, node) - , Root(0), NodeCount(0) - , MinimalPolysPerNode(minimalPolysPerNode) -{ - #ifdef _DEBUG - setDebugName("COctreeTriangleSelector"); - #endif - - if (!Triangles.empty()) - { - const u32 start = os::Timer::getRealTime(); - - // create the triangle octree - Root = new SOctreeNode(); - Root->Triangles = Triangles; - constructOctree(Root); - - c8 tmp[256]; - sprintf(tmp, "Needed %ums to create OctreeTriangleSelector.(%d nodes, %u polys)", - os::Timer::getRealTime() - start, NodeCount, Triangles.size()); - os::Printer::log(tmp, ELL_INFORMATION); - } -} - -//! destructor -COctreeTriangleSelector::~COctreeTriangleSelector() -{ - delete Root; -} - - -void COctreeTriangleSelector::constructOctree(SOctreeNode* node) -{ - ++NodeCount; - - node->Box.reset(node->Triangles[0].pointA); - - // get bounding box - const u32 cnt = node->Triangles.size(); - for (u32 i=0; i<cnt; ++i) - { - node->Box.addInternalPoint(node->Triangles[i].pointA); - node->Box.addInternalPoint(node->Triangles[i].pointB); - node->Box.addInternalPoint(node->Triangles[i].pointC); - } - - // calculate children - - if (!node->Box.isEmpty() && (s32)node->Triangles.size() > MinimalPolysPerNode) - { - const core::vector3df& middle = node->Box.getCenter(); - core::vector3df edges[8]; - node->Box.getEdges(edges); - - core::aabbox3d<f32> box; - core::array<core::triangle3df> keepTriangles(node->Triangles.size()); // reserving enough memory, so we don't get re-allocations per child - - for (s32 ch=0; ch<8; ++ch) - { - box.reset(middle); - box.addInternalPoint(edges[ch]); - node->Child[ch] = new SOctreeNode(); - - for (s32 i=0; i<(s32)node->Triangles.size(); ++i) - { - if (node->Triangles[i].isTotalInsideBox(box)) - { - node->Child[ch]->Triangles.push_back(node->Triangles[i]); - //node->Triangles.erase(i); - //--i; - } - else - { - keepTriangles.push_back(node->Triangles[i]); - } - } - memcpy(node->Triangles.pointer(), keepTriangles.pointer(), - sizeof(core::triangle3df)*keepTriangles.size()); - - node->Triangles.set_used(keepTriangles.size()); - keepTriangles.set_used(0); - } - keepTriangles.clear(); // release memory early, for large meshes it can matter. - node->Triangles.reallocate(node->Triangles.size(), true); // shrink memory to minimum necessary - - // Note: We use an extra loop to construct child-nodes instead of doing - // that in above loop to avoid memory fragmentation which happens if - // the code has to switch between allocating memory for this node and - // the child nodes (thanks @Squarefox for noting this). - for (s32 ch=0; ch<8; ++ch) - { - if (node->Child[ch]->Triangles.empty()) - { - delete node->Child[ch]; - node->Child[ch] = 0; - } - else - constructOctree(node->Child[ch]); - } - } -} - - -//! Gets all triangles which lie within a specific bounding box. -void COctreeTriangleSelector::getTriangles(core::triangle3df* triangles, - s32 arraySize, s32& outTriangleCount, - const core::aabbox3d<f32>& box, - const core::matrix4* transform, bool useNodeTransform, - irr::core::array<SCollisionTriangleRange>* outTriangleInfo) const -{ - core::matrix4 mat(core::matrix4::EM4CONST_NOTHING); - core::aabbox3d<f32> invbox = box; - - if (SceneNode && useNodeTransform) - { - if ( SceneNode->getAbsoluteTransformation().getInverse(mat) ) - mat.transformBoxEx(invbox); - else - // TODO: case not handled well, we can only return all triangles - return CTriangleSelector::getTriangles(triangles, arraySize, outTriangleCount, transform, useNodeTransform, outTriangleInfo); - } - - if (transform) - mat = *transform; - else - mat.makeIdentity(); - - if (SceneNode && useNodeTransform) - mat *= SceneNode->getAbsoluteTransformation(); - - s32 trianglesWritten = 0; - - if (Root) - getTrianglesFromOctree(Root, trianglesWritten, - arraySize, invbox, &mat, triangles); - - if ( outTriangleInfo ) - { - SCollisionTriangleRange triRange; - triRange.RangeSize = trianglesWritten; - triRange.Selector = const_cast<COctreeTriangleSelector*>(this); - triRange.SceneNode = SceneNode; - triRange.MeshBuffer = MeshBuffer; - triRange.MaterialIndex = MaterialIndex; - outTriangleInfo->push_back(triRange); - } - - outTriangleCount = trianglesWritten; -} - - -void COctreeTriangleSelector::getTrianglesFromOctree( - SOctreeNode* node, s32& trianglesWritten, - s32 maximumSize, const core::aabbox3d<f32>& box, - const core::matrix4* mat, core::triangle3df* triangles) const -{ - if (!box.intersectsWithBox(node->Box)) - return; - - const u32 cnt = node->Triangles.size(); - - for (u32 i=0; i<cnt; ++i) - { - const core::triangle3df& srcTri = node->Triangles[i]; - // This isn't an accurate test, but it's fast, and the - // API contract doesn't guarantee complete accuracy. - if (srcTri.isTotalOutsideBox(box)) - continue; - - core::triangle3df& dstTri = triangles[trianglesWritten]; - mat->transformVect(dstTri.pointA, srcTri.pointA ); - mat->transformVect(dstTri.pointB, srcTri.pointB ); - mat->transformVect(dstTri.pointC, srcTri.pointC ); - ++trianglesWritten; - - // Halt when the out array is full. - if (trianglesWritten == maximumSize) - return; - } - - for (u32 i=0; i<8; ++i) - if (node->Child[i]) - getTrianglesFromOctree(node->Child[i], trianglesWritten, - maximumSize, box, mat, triangles); -} - - -//! Gets all triangles which have or may have contact with a 3d line. -// new version: from user Piraaate -void COctreeTriangleSelector::getTriangles(core::triangle3df* triangles, s32 arraySize, - s32& outTriangleCount, const core::line3d<f32>& line, - const core::matrix4* transform, bool useNodeTransform, - irr::core::array<SCollisionTriangleRange>* outTriangleInfo) const -{ -#if 0 - core::aabbox3d<f32> box(line.start); - box.addInternalPoint(line.end); - - // TODO: Could be optimized for line a little bit more. - COctreeTriangleSelector::getTriangles(triangles, arraySize, outTriangleCount, - box, transform); -#else - - core::matrix4 mat ( core::matrix4::EM4CONST_NOTHING ); - - core::vector3df vectStartInv ( line.start ), vectEndInv ( line.end ); - if (SceneNode && useNodeTransform) - { - mat = SceneNode->getAbsoluteTransformation(); - mat.makeInverse(); - mat.transformVect(vectStartInv, line.start); - mat.transformVect(vectEndInv, line.end); - } - core::line3d<f32> invline(vectStartInv, vectEndInv); - - mat.makeIdentity(); - - if (transform) - mat = (*transform); - - if (SceneNode && useNodeTransform) - mat *= SceneNode->getAbsoluteTransformation(); - - s32 trianglesWritten = 0; - - if (Root) - getTrianglesFromOctree(Root, trianglesWritten, arraySize, invline, &mat, triangles); - - if ( outTriangleInfo ) - { - SCollisionTriangleRange triRange; - triRange.RangeSize = trianglesWritten; - triRange.Selector = const_cast<COctreeTriangleSelector*>(this); - triRange.SceneNode = SceneNode; - triRange.MeshBuffer = MeshBuffer; - triRange.MaterialIndex = MaterialIndex; - outTriangleInfo->push_back(triRange); - } - - outTriangleCount = trianglesWritten; -#endif -} - -void COctreeTriangleSelector::getTrianglesFromOctree(SOctreeNode* node, - s32& trianglesWritten, s32 maximumSize, const core::line3d<f32>& line, - const core::matrix4* transform, core::triangle3df* triangles) const -{ - if (!node->Box.intersectsWithLine(line)) - return; - - s32 cnt = node->Triangles.size(); - if (cnt + trianglesWritten > maximumSize) - cnt -= cnt + trianglesWritten - maximumSize; - - s32 i; - - if ( transform->isIdentity() ) - { - for (i=0; i<cnt; ++i) - { - triangles[trianglesWritten] = node->Triangles[i]; - ++trianglesWritten; - } - } - else - { - for (i=0; i<cnt; ++i) - { - triangles[trianglesWritten] = node->Triangles[i]; - transform->transformVect(triangles[trianglesWritten].pointA); - transform->transformVect(triangles[trianglesWritten].pointB); - transform->transformVect(triangles[trianglesWritten].pointC); - ++trianglesWritten; - } - } - - for (i=0; i<8; ++i) - if (node->Child[i]) - getTrianglesFromOctree(node->Child[i], trianglesWritten, - maximumSize, line, transform, triangles); -} - - -} // end namespace scene -} // end namespace irr diff --git a/source/Irrlicht/COctreeTriangleSelector.h b/source/Irrlicht/COctreeTriangleSelector.h deleted file mode 100644 index b022b2ab..00000000 --- a/source/Irrlicht/COctreeTriangleSelector.h +++ /dev/null @@ -1,85 +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_OCTREE_TRIANGLE_SELECTOR_H_INCLUDED__ -#define __C_OCTREE_TRIANGLE_SELECTOR_H_INCLUDED__ - -#include "CTriangleSelector.h" - -namespace irr -{ -namespace scene -{ - -class ISceneNode; - -//! Stupid triangle selector without optimization -class COctreeTriangleSelector : public CTriangleSelector -{ -public: - - //! Constructs a selector based on a mesh - COctreeTriangleSelector(const IMesh* mesh, ISceneNode* node, s32 minimalPolysPerNode); - - //! Constructs a selector based on a meshbuffer - COctreeTriangleSelector(const IMeshBuffer* meshBuffer, irr::u32 materialIndex, ISceneNode* node, s32 minimalPolysPerNode); - - virtual ~COctreeTriangleSelector(); - - //! Gets all triangles which lie within a specific bounding box. - virtual void getTriangles(core::triangle3df* triangles, s32 arraySize, s32& outTriangleCount, - const core::aabbox3d<f32>& box, const core::matrix4* transform, bool useNodeTransform, - irr::core::array<SCollisionTriangleRange>* outTriangleInfo) const _IRR_OVERRIDE_; - - //! Gets all triangles which have or may have contact with a 3d line. - virtual void getTriangles(core::triangle3df* triangles, s32 arraySize, - s32& outTriangleCount, const core::line3d<f32>& line, - const core::matrix4* transform, bool useNodeTransform, - irr::core::array<SCollisionTriangleRange>* outTriangleInfo) const _IRR_OVERRIDE_; - -private: - - struct SOctreeNode - { - SOctreeNode() - { - for (u32 i=0; i!=8; ++i) - Child[i] = 0; - } - - ~SOctreeNode() - { - for (u32 i=0; i!=8; ++i) - delete Child[i]; - } - - core::array<core::triangle3df> Triangles; - SOctreeNode* Child[8]; - core::aabbox3d<f32> Box; - }; - - - void constructOctree(SOctreeNode* node); - void deleteEmptyNodes(SOctreeNode* node); - void getTrianglesFromOctree(SOctreeNode* node, s32& trianglesWritten, - s32 maximumSize, const core::aabbox3d<f32>& box, - const core::matrix4* transform, - core::triangle3df* triangles) const; - - void getTrianglesFromOctree(SOctreeNode* node, s32& trianglesWritten, - s32 maximumSize, const core::line3d<f32>& line, - const core::matrix4* transform, - core::triangle3df* triangles) const; - - SOctreeNode* Root; - s32 NodeCount; - s32 MinimalPolysPerNode; -}; - -} // end namespace scene -} // end namespace irr - - -#endif - diff --git a/source/Irrlicht/COgreMeshFileLoader.cpp b/source/Irrlicht/COgreMeshFileLoader.cpp deleted file mode 100644 index 9df20871..00000000 --- a/source/Irrlicht/COgreMeshFileLoader.cpp +++ /dev/null @@ -1,1607 +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 -// Originally written by Christian Stehno, modified by Nikolaus Gebhardt - -#include "IrrCompileConfig.h" -#ifdef _IRR_COMPILE_WITH_OGRE_LOADER_ - -#include "COgreMeshFileLoader.h" -#include "CMeshTextureLoader.h" -#include "os.h" -#include "SMeshBuffer.h" -#include "SAnimatedMesh.h" -#include "IReadFile.h" -#include "fast_atof.h" -#include "coreutil.h" - -#ifdef _DEBUG -#define IRR_OGRE_LOADER_DEBUG -#endif - -namespace irr -{ -namespace scene -{ - -namespace -{ - enum OGRE_CHUNKS - { - // Main Chunks - COGRE_HEADER= 0x1000, - COGRE_SKELETON= 0x2000, - COGRE_MESH= 0x3000, - - // sub chunks of COGRE_MESH - COGRE_SUBMESH= 0x4000, - COGRE_GEOMETRY= 0x5000, - COGRE_SKELETON_LINK= 0x6000, - COGRE_BONE_ASSIGNMENT= 0x7000, - COGRE_MESH_LOD= 0x8000, - COGRE_MESH_BOUNDS= 0x9000, - COGRE_MESH_SUBMESH_NAME_TABLE= 0xA000, - COGRE_MESH_EDGE_LISTS= 0xB000, - - // sub chunks of COGRE_SKELETON - COGRE_BONE_PARENT= 0x3000, - COGRE_ANIMATION= 0x4000, - COGRE_ANIMATION_TRACK= 0x4100, - COGRE_ANIMATION_KEYFRAME= 0x4110, - COGRE_ANIMATION_LINK= 0x5000, - - // sub chunks of COGRE_SUBMESH - COGRE_SUBMESH_OPERATION= 0x4010, - COGRE_SUBMESH_BONE_ASSIGNMENT= 0x4100, - COGRE_SUBMESH_TEXTURE_ALIAS= 0x4200, - - // sub chunks of COGRE_GEOMETRY - COGRE_GEOMETRY_VERTEX_DECLARATION= 0x5100, - COGRE_GEOMETRY_VERTEX_ELEMENT= 0x5110, - COGRE_GEOMETRY_VERTEX_BUFFER= 0x5200, - COGRE_GEOMETRY_VERTEX_BUFFER_DATA= 0x5210 - }; -} - -//! Constructor -COgreMeshFileLoader::COgreMeshFileLoader(io::IFileSystem* fs, video::IVideoDriver* driver) -: FileSystem(fs), Driver(driver), SwapEndian(false), Mesh(0), NumUV(0) -{ - - #ifdef _DEBUG - setDebugName("COgreMeshFileLoader"); - #endif - - if (FileSystem) - FileSystem->grab(); - - if (Driver) - Driver->grab(); - - TextureLoader = new CMeshTextureLoader( FileSystem, Driver ); -} - - -//! destructor -COgreMeshFileLoader::~COgreMeshFileLoader() -{ - clearMeshes(); - - if (FileSystem) - FileSystem->drop(); - - if (Driver) - Driver->drop(); - - if (Mesh) - Mesh->drop(); -} - - -//! returns true if the file maybe is able to be loaded by this class -//! based on the file extension (e.g. ".bsp") -bool COgreMeshFileLoader::isALoadableFileExtension(const io::path& filename) const -{ - return core::hasFileExtension ( filename, "mesh" ); -} - - -//! 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* COgreMeshFileLoader::createMesh(io::IReadFile* file) -{ - if ( !file ) - return 0; - - if ( getMeshTextureLoader() ) - getMeshTextureLoader()->setMeshFile(file); - - s16 id; - - file->read(&id, 2); - - if (id == COGRE_HEADER) - SwapEndian=false; - else if (id == 0x0010) - SwapEndian=true; - else - return 0; - ChunkData data; - readString(file, data, Version); - if ((Version != "[MeshSerializer_v1.30]") && (Version != "[MeshSerializer_v1.40]") && (Version != "[MeshSerializer_v1.41]")) - { - os::Printer::log("Unsupported ogre mesh version", Version.c_str(), ELL_INFORMATION); - return 0; - } - - clearMeshes(); - if (Mesh) - Mesh->drop(); - - CurrentlyLoadingFromPath = FileSystem->getFileDir(file->getFileName()); - loadMaterials(file); - - if (readChunk(file)) - { - // delete data loaded from file - clearMeshes(); - - if (Skeleton.Bones.size()) - { - ISkinnedMesh* tmp = static_cast<CSkinnedMesh*>(Mesh); - static_cast<CSkinnedMesh*>(Mesh)->updateBoundingBox(); - Skeleton.Animations.clear(); - Skeleton.Bones.clear(); - Mesh=0; - return tmp; - } - else - { - for (u32 i=0; i<Mesh->getMeshBufferCount(); ++i) - ((SMeshBuffer*)Mesh->getMeshBuffer(i))->recalculateBoundingBox(); - - ((SMesh*)Mesh)->recalculateBoundingBox(); - SAnimatedMesh* am = new SAnimatedMesh(); - am->Type = EAMT_3DS; - am->addMesh(Mesh); - am->recalculateBoundingBox(); - Mesh->drop(); - Mesh = 0; - return am; - } - } - - Mesh->drop(); - Mesh = 0; - - return 0; -} - - -bool COgreMeshFileLoader::readChunk(io::IReadFile* file) -{ - while(file->getPos() < file->getSize()) - { - ChunkData data; - readChunkData(file, data); - - switch(data.header.id) - { - case COGRE_MESH: - { - Meshes.push_back(OgreMesh()); - readObjectChunk(file, data, Meshes.getLast()); - if (Skeleton.Bones.size()) - Mesh = new CSkinnedMesh(); - else - Mesh = new SMesh(); - composeObject(); - } - break; - default: - return true; - } - } - - return true; -} - - -bool COgreMeshFileLoader::readObjectChunk(io::IReadFile* file, ChunkData& parent, OgreMesh& mesh) -{ -#ifdef IRR_OGRE_LOADER_DEBUG - os::Printer::log("Read Object Chunk", ELL_DEBUG); -#endif - readBool(file, parent, mesh.SkeletalAnimation); - bool skeleton_loaded=false; - while ((parent.read < parent.header.length)&&(file->getPos() < file->getSize())) - { - ChunkData data; - readChunkData(file, data); - - switch(data.header.id) - { - case COGRE_GEOMETRY: - readGeometry(file, data, mesh.Geometry); - break; - case COGRE_SUBMESH: - mesh.SubMeshes.push_back(OgreSubMesh()); - readSubMesh(file, data, mesh.SubMeshes.getLast()); - break; - case COGRE_MESH_BOUNDS: - { -#ifdef IRR_OGRE_LOADER_DEBUG - os::Printer::log("Read Mesh Bounds", ELL_DEBUG); -#endif - readVector(file, data, mesh.BBoxMinEdge); - readVector(file, data, mesh.BBoxMaxEdge); - readFloat(file, data, &mesh.BBoxRadius); - } - break; - case COGRE_SKELETON_LINK: - { -#ifdef IRR_OGRE_LOADER_DEBUG - os::Printer::log("Read Skeleton link", ELL_DEBUG); -#endif - core::stringc name; - readString(file, data, name); - loadSkeleton(file, name); - skeleton_loaded=true; - } - break; - case COGRE_BONE_ASSIGNMENT: - { - mesh.BoneAssignments.push_back(OgreBoneAssignment()); - readInt(file, data, &mesh.BoneAssignments.getLast().VertexID); - readShort(file, data, &mesh.BoneAssignments.getLast().BoneID); - readFloat(file, data, &mesh.BoneAssignments.getLast().Weight); - } - break; - case COGRE_MESH_LOD: - case COGRE_MESH_SUBMESH_NAME_TABLE: - case COGRE_MESH_EDGE_LISTS: - // ignore chunk - file->seek(data.header.length-data.read, true); - data.read += data.header.length-data.read; - break; - default: -#ifdef IRR_OGRE_LOADER_DEBUG - os::Printer::log("Skipping", core::stringc(data.header.id), ELL_DEBUG); -#endif - // ignore chunk - file->seek(data.header.length-data.read, true); - data.read += data.header.length-data.read; - break; - } - parent.read += data.read; - } - if (!skeleton_loaded) - loadSkeleton(file, FileSystem->getFileBasename(file->getFileName(), false)); - return true; -} - - -bool COgreMeshFileLoader::readGeometry(io::IReadFile* file, ChunkData& parent, OgreGeometry& geometry) -{ -#ifdef IRR_OGRE_LOADER_DEBUG - os::Printer::log("Read Geometry", ELL_DEBUG); -#endif - readInt(file, parent, &geometry.NumVertex); - while(parent.read < parent.header.length) - { - ChunkData data; - readChunkData(file, data); - - switch(data.header.id) - { - case COGRE_GEOMETRY_VERTEX_DECLARATION: - readVertexDeclaration(file, data, geometry); - break; - case COGRE_GEOMETRY_VERTEX_BUFFER: - readVertexBuffer(file, data, geometry); - break; - default: - // ignore chunk -#ifdef IRR_OGRE_LOADER_DEBUG - os::Printer::log("Skipping", core::stringc(data.header.id), ELL_DEBUG); -#endif - file->seek(data.header.length-data.read, true); - data.read += data.header.length-data.read; - } - parent.read += data.read; - } - if (parent.read != parent.header.length) - os::Printer::log("Incorrect geometry length. File might be corrupted."); - return true; -} - - -bool COgreMeshFileLoader::readVertexDeclaration(io::IReadFile* file, ChunkData& parent, OgreGeometry& geometry) -{ -#ifdef IRR_OGRE_LOADER_DEBUG - os::Printer::log("Read Vertex Declaration", ELL_DEBUG); -#endif - NumUV = 0; - while(parent.read < parent.header.length) - { - ChunkData data; - readChunkData(file, data); - - switch(data.header.id) - { - case COGRE_GEOMETRY_VERTEX_ELEMENT: - { - geometry.Elements.push_back(OgreVertexElement()); - OgreVertexElement& elem = geometry.Elements.getLast(); - readShort(file, data, &elem.Source); - readShort(file, data, &elem.Type); - readShort(file, data, &elem.Semantic); - if (elem.Semantic == 7) //Tex coords - { - ++NumUV; - } - readShort(file, data, &elem.Offset); - elem.Offset /= sizeof(f32); - readShort(file, data, &elem.Index); - } - break; - default: - // ignore chunk - file->seek(data.header.length-data.read, true); - data.read += data.header.length-data.read; - } - parent.read += data.read; - } - if (parent.read != parent.header.length) - os::Printer::log("Incorrect vertex declaration length. File might be corrupted."); - return true; -} - - -bool COgreMeshFileLoader::readVertexBuffer(io::IReadFile* file, ChunkData& parent, OgreGeometry& geometry) -{ -#ifdef IRR_OGRE_LOADER_DEBUG - os::Printer::log("Read Vertex Buffer", ELL_DEBUG); -#endif - OgreVertexBuffer buf; - readShort(file, parent, &buf.BindIndex); - readShort(file, parent, &buf.VertexSize); - buf.VertexSize /= sizeof(f32); - ChunkData data; - readChunkData(file, data); - - if (data.header.id == COGRE_GEOMETRY_VERTEX_BUFFER_DATA) - { - buf.Data.set_used(geometry.NumVertex*buf.VertexSize); - readFloat(file, data, buf.Data.pointer(), geometry.NumVertex*buf.VertexSize); - } - - geometry.Buffers.push_back(buf); - parent.read += data.read; - if (parent.read != parent.header.length) - os::Printer::log("Incorrect vertex buffer length. File might be corrupted."); - return true; -} - - -bool COgreMeshFileLoader::readSubMesh(io::IReadFile* file, ChunkData& parent, OgreSubMesh& subMesh) -{ -#ifdef IRR_OGRE_LOADER_DEBUG - os::Printer::log("Read Submesh", ELL_DEBUG); -#endif - readString(file, parent, subMesh.Material); -#ifdef IRR_OGRE_LOADER_DEBUG - os::Printer::log("using material", subMesh.Material, ELL_DEBUG); -#endif - readBool(file, parent, subMesh.SharedVertices); - - s32 numIndices; - readInt(file, parent, &numIndices); - subMesh.Indices.set_used(numIndices); - - readBool(file, parent, subMesh.Indices32Bit); - - if (subMesh.Indices32Bit) - readInt(file, parent, subMesh.Indices.pointer(), numIndices); - else - { - for (s32 i=0; i<numIndices; ++i) - { - u16 num; - readShort(file, parent, &num); - subMesh.Indices[i]=num; - } - } - - while(parent.read < parent.header.length) - { - ChunkData data; - readChunkData(file, data); - - switch(data.header.id) - { - case COGRE_GEOMETRY: - readGeometry(file, data, subMesh.Geometry); - break; - case COGRE_SUBMESH_OPERATION: - readShort(file, data, &subMesh.Operation); -#ifdef IRR_OGRE_LOADER_DEBUG - os::Printer::log("Read Submesh Operation",core::stringc(subMesh.Operation), ELL_DEBUG); -#endif - if (subMesh.Operation != 4) - os::Printer::log("Primitive type != trilist not yet implemented", ELL_WARNING); - break; - case COGRE_SUBMESH_TEXTURE_ALIAS: - { -#ifdef IRR_OGRE_LOADER_DEBUG - os::Printer::log("Read Submesh Texture Alias", ELL_DEBUG); -#endif - core::stringc texture, alias; - readString(file, data, texture); - readString(file, data, alias); - subMesh.TextureAliases.push_back(OgreTextureAlias(texture,alias)); - } - break; - case COGRE_SUBMESH_BONE_ASSIGNMENT: - { - subMesh.BoneAssignments.push_back(OgreBoneAssignment()); - readInt(file, data, &subMesh.BoneAssignments.getLast().VertexID); - readShort(file, data, &subMesh.BoneAssignments.getLast().BoneID); - readFloat(file, data, &subMesh.BoneAssignments.getLast().Weight); - } - break; - default: -#ifdef IRR_OGRE_LOADER_DEBUG - os::Printer::log("Skipping", core::stringc(data.header.id), ELL_DEBUG); -#endif - parent.read=parent.header.length; - file->seek(-(long)sizeof(ChunkHeader), true); - return true; - } - parent.read += data.read; - } - if (parent.read != parent.header.length) - os::Printer::log("Incorrect submesh length. File might be corrupted."); -#ifdef IRR_OGRE_LOADER_DEBUG - os::Printer::log("Done with submesh", ELL_DEBUG); -#endif - return true; -} - - -void COgreMeshFileLoader::composeMeshBufferMaterial(scene::IMeshBuffer* mb, const core::stringc& materialName) -{ - video::SMaterial& material=mb->getMaterial(); - for (u32 k=0; k<Materials.size(); ++k) - { - if ((materialName==Materials[k].Name)&&(Materials[k].Techniques.size())&&(Materials[k].Techniques[0].Passes.size())) - { - material=Materials[k].Techniques[0].Passes[0].Material; - for (u32 i=0; i<Materials[k].Techniques[0].Passes[0].Texture.Filename.size(); ++i) - { - video::ITexture * texture = NULL; - if ( getMeshTextureLoader() ) - { - texture = getMeshTextureLoader()->getTexture(Materials[k].Techniques[0].Passes[0].Texture.Filename[i]); - if ( texture ) - material.setTexture(i, texture); - } - } - break; - } - } -} - - -scene::SMeshBuffer* COgreMeshFileLoader::composeMeshBuffer(const core::array<s32>& indices, const OgreGeometry& geom) -{ - scene::SMeshBuffer *mb=new scene::SMeshBuffer(); - - u32 i; - mb->Indices.set_used(indices.size()); - for (i=0; i<indices.size(); ++i) - mb->Indices[i]=indices[i]; - - mb->Vertices.set_used(geom.NumVertex); - for (i=0; i<geom.Elements.size(); ++i) - { - if (geom.Elements[i].Semantic==1) //Pos - { - for (u32 j=0; j<geom.Buffers.size(); ++j) - { - if (geom.Elements[i].Source==geom.Buffers[j].BindIndex) - { - u32 eSize=geom.Buffers[j].VertexSize; - u32 ePos=geom.Elements[i].Offset; - for (s32 k=0; k<geom.NumVertex; ++k) - { - mb->Vertices[k].Color=mb->Material.DiffuseColor; - mb->Vertices[k].Pos.set(geom.Buffers[j].Data[ePos],geom.Buffers[j].Data[ePos+1],geom.Buffers[j].Data[ePos+2]); - ePos += eSize; - } - } - } - } - - if (geom.Elements[i].Semantic==4) //Normal - { - for (u32 j=0; j<geom.Buffers.size(); ++j) - { - if (geom.Elements[i].Source==geom.Buffers[j].BindIndex) - { - u32 eSize=geom.Buffers[j].VertexSize; - u32 ePos=geom.Elements[i].Offset; - for (s32 k=0; k<geom.NumVertex; ++k) - { - mb->Vertices[k].Normal.set(geom.Buffers[j].Data[ePos],geom.Buffers[j].Data[ePos+1],geom.Buffers[j].Data[ePos+2]); - ePos += eSize; - } - } - } - } - - if (geom.Elements[i].Semantic==7) //TexCoord - { - for (u32 j=0; j<geom.Buffers.size(); ++j) - { - if (geom.Elements[i].Source==geom.Buffers[j].BindIndex) - { - u32 eSize=geom.Buffers[j].VertexSize; - u32 ePos=geom.Elements[i].Offset; - for (s32 k=0; k<geom.NumVertex; ++k) - { - mb->Vertices[k].TCoords.set(geom.Buffers[j].Data[ePos],geom.Buffers[j].Data[ePos+1]); - ePos += eSize; - } - } - } - } - } - return mb; -} - - -scene::SMeshBufferLightMap* COgreMeshFileLoader::composeMeshBufferLightMap(const core::array<s32>& indices, const OgreGeometry& geom) -{ - scene::SMeshBufferLightMap *mb=new scene::SMeshBufferLightMap(); - - u32 i; - mb->Indices.set_used(indices.size()); - for (i=0; i<indices.size(); ++i) - mb->Indices[i]=indices[i]; - - mb->Vertices.set_used(geom.NumVertex); - - for (i=0; i<geom.Elements.size(); ++i) - { - if (geom.Elements[i].Semantic==1) //Pos - { - for (u32 j=0; j<geom.Buffers.size(); ++j) - { - if (geom.Elements[i].Source==geom.Buffers[j].BindIndex) - { - u32 eSize=geom.Buffers[j].VertexSize; - u32 ePos=geom.Elements[i].Offset; - for (s32 k=0; k<geom.NumVertex; ++k) - { - mb->Vertices[k].Color=mb->Material.DiffuseColor; - mb->Vertices[k].Pos.set(geom.Buffers[j].Data[ePos],geom.Buffers[j].Data[ePos+1],geom.Buffers[j].Data[ePos+2]); - ePos += eSize; - } - } - } - } - - if (geom.Elements[i].Semantic==4) //Normal - { - for (u32 j=0; j<geom.Buffers.size(); ++j) - { - if (geom.Elements[i].Source==geom.Buffers[j].BindIndex) - { - u32 eSize=geom.Buffers[j].VertexSize; - u32 ePos=geom.Elements[i].Offset; - for (s32 k=0; k<geom.NumVertex; ++k) - { - mb->Vertices[k].Normal.set(geom.Buffers[j].Data[ePos],geom.Buffers[j].Data[ePos+1],geom.Buffers[j].Data[ePos+2]); - ePos += eSize; - } - } - } - } - - if (geom.Elements[i].Semantic==7) //TexCoord - { - for (u32 j=0; j<geom.Buffers.size(); ++j) - { - if (geom.Elements[i].Source==geom.Buffers[j].BindIndex) - { - u32 eSize=geom.Buffers[j].VertexSize; - u32 ePos=geom.Elements[i].Offset; - // make sure we have data for a second texture coord - const bool secondCoord = (eSize>ePos+3); - for (s32 k=0; k<geom.NumVertex; ++k) - { - mb->Vertices[k].TCoords.set(geom.Buffers[j].Data[ePos], geom.Buffers[j].Data[ePos+1]); - if (secondCoord) - mb->Vertices[k].TCoords2.set(geom.Buffers[j].Data[ePos+2], geom.Buffers[j].Data[ePos+3]); - else - mb->Vertices[k].TCoords2.set(geom.Buffers[j].Data[ePos], geom.Buffers[j].Data[ePos+1]); - ePos += eSize; - } - } - } - } - } - - return mb; -} - - -scene::IMeshBuffer* COgreMeshFileLoader::composeMeshBufferSkinned(scene::CSkinnedMesh& mesh, const core::array<s32>& indices, const OgreGeometry& geom) -{ - scene::SSkinMeshBuffer *mb=mesh.addMeshBuffer(); - if (NumUV>1) - { - mb->convertTo2TCoords(); - mb->Vertices_2TCoords.set_used(geom.NumVertex); - } - else - mb->Vertices_Standard.set_used(geom.NumVertex); - - u32 i; - mb->Indices.set_used(indices.size()); - for (i=0; i<indices.size(); i+=3) - { - mb->Indices[i+0]=indices[i+2]; - mb->Indices[i+1]=indices[i+1]; - mb->Indices[i+2]=indices[i+0]; - } - - for (i=0; i<geom.Elements.size(); ++i) - { - if (geom.Elements[i].Semantic==1) //Pos - { - for (u32 j=0; j<geom.Buffers.size(); ++j) - { - if (geom.Elements[i].Source==geom.Buffers[j].BindIndex) - { - u32 eSize=geom.Buffers[j].VertexSize; - u32 ePos=geom.Elements[i].Offset; - for (s32 k=0; k<geom.NumVertex; ++k) - { - if (NumUV>1) - mb->Vertices_2TCoords[k].Color=mb->Material.DiffuseColor; - else - mb->Vertices_Standard[k].Color=mb->Material.DiffuseColor; - mb->getPosition(k).set(-geom.Buffers[j].Data[ePos],geom.Buffers[j].Data[ePos+1],geom.Buffers[j].Data[ePos+2]); - ePos += eSize; - } - } - } - } - - if (geom.Elements[i].Semantic==4) //Normal - { - for (u32 j=0; j<geom.Buffers.size(); ++j) - { - if (geom.Elements[i].Source==geom.Buffers[j].BindIndex) - { - u32 eSize=geom.Buffers[j].VertexSize; - u32 ePos=geom.Elements[i].Offset; - for (s32 k=0; k<geom.NumVertex; ++k) - { - mb->getNormal(k).set(-geom.Buffers[j].Data[ePos],geom.Buffers[j].Data[ePos+1],geom.Buffers[j].Data[ePos+2]); - ePos += eSize; - } - } - } - } - - if (geom.Elements[i].Semantic==7) //TexCoord - { - for (u32 j=0; j<geom.Buffers.size(); ++j) - { - if (geom.Elements[i].Source==geom.Buffers[j].BindIndex) - { - u32 eSize=geom.Buffers[j].VertexSize; - u32 ePos=geom.Elements[i].Offset; - // make sure we have data for a second texture coord - const bool secondCoord = (eSize>ePos+3); - for (s32 k=0; k<geom.NumVertex; ++k) - { - mb->getTCoords(k).set(geom.Buffers[j].Data[ePos], geom.Buffers[j].Data[ePos+1]); - if (NumUV>1) - { - if (secondCoord) - mb->Vertices_2TCoords[k].TCoords2.set(geom.Buffers[j].Data[ePos+2], geom.Buffers[j].Data[ePos+3]); - else - mb->Vertices_2TCoords[k].TCoords2.set(geom.Buffers[j].Data[ePos], geom.Buffers[j].Data[ePos+1]); - } - ePos += eSize; - } - } - } - } - } - - return mb; -} - - -void COgreMeshFileLoader::composeObject(void) -{ - for (u32 i=0; i<Meshes.size(); ++i) - { - for (u32 j=0; j<Meshes[i].SubMeshes.size(); ++j) - { - IMeshBuffer* mb; - if (Meshes[i].SubMeshes[j].SharedVertices) - { - if (Skeleton.Bones.size()) - { - mb = composeMeshBufferSkinned(*(CSkinnedMesh*)Mesh, Meshes[i].SubMeshes[j].Indices, Meshes[i].Geometry); - } - else if (NumUV < 2) - { - mb = composeMeshBuffer(Meshes[i].SubMeshes[j].Indices, Meshes[i].Geometry); - } - else - { - mb = composeMeshBufferLightMap(Meshes[i].SubMeshes[j].Indices, Meshes[i].Geometry); - } - } - else - { - if (Skeleton.Bones.size()) - { - mb = composeMeshBufferSkinned(*(CSkinnedMesh*)Mesh, Meshes[i].SubMeshes[j].Indices, Meshes[i].SubMeshes[j].Geometry); - } - else if (NumUV < 2) - { - mb = composeMeshBuffer(Meshes[i].SubMeshes[j].Indices, Meshes[i].SubMeshes[j].Geometry); - } - else - { - mb = composeMeshBufferLightMap(Meshes[i].SubMeshes[j].Indices, Meshes[i].SubMeshes[j].Geometry); - } - } - - if (mb != 0) - { - composeMeshBufferMaterial(mb, Meshes[i].SubMeshes[j].Material); - if (!Skeleton.Bones.size()) - { - ((SMesh*)Mesh)->addMeshBuffer(mb); - mb->drop(); - } - } - } - } - if (Skeleton.Bones.size()) - { - CSkinnedMesh* m = (CSkinnedMesh*)Mesh; - // Create Joints - for (u32 i=0; i<Skeleton.Bones.size(); ++i) - { - ISkinnedMesh::SJoint* joint = m->addJoint(); - joint->Name=Skeleton.Bones[i].Name; - - // IRR_TEST_BROKEN_QUATERNION_USE: TODO - switched to getMatrix_transposed instead of getMatrix for downward compatibility. - // Not tested so far if this was correct or wrong before quaternion fix! - Skeleton.Bones[i].Orientation.getMatrix_transposed(joint->LocalMatrix); - - if (Skeleton.Bones[i].Scale != core::vector3df(1,1,1)) - { - core::matrix4 scaleMatrix; - scaleMatrix.setScale( Skeleton.Bones[i].Scale ); - joint->LocalMatrix *= scaleMatrix; - } - joint->LocalMatrix.setTranslation( Skeleton.Bones[i].Position ); - } - // Joints hierarchy - for (u32 i=0; i<Skeleton.Bones.size(); ++i) - { - if (Skeleton.Bones[i].Parent<m->getJointCount()) - { - m->getAllJoints()[Skeleton.Bones[i].Parent]->Children.push_back(m->getAllJoints()[Skeleton.Bones[i].Handle]); - } - } - - // Weights - u32 bufCount=0; - for (u32 i=0; i<Meshes.size(); ++i) - { - for (u32 j=0; j<Meshes[i].SubMeshes.size(); ++j) - { - for (u32 k=0; k<Meshes[i].SubMeshes[j].BoneAssignments.size(); ++k) - { - const OgreBoneAssignment& ba = Meshes[i].SubMeshes[j].BoneAssignments[k]; - if (ba.BoneID<m->getJointCount()) - { - ISkinnedMesh::SWeight* w = m->addWeight(m->getAllJoints()[ba.BoneID]); - w->strength=ba.Weight; - w->vertex_id=ba.VertexID; - w->buffer_id=bufCount; - } - } - ++bufCount; - } - } - - for (u32 i=0; i<Skeleton.Animations.size(); ++i) - { - for (u32 j=0; j<Skeleton.Animations[i].Keyframes.size(); ++j) - { - OgreKeyframe& frame = Skeleton.Animations[i].Keyframes[j]; - ISkinnedMesh::SJoint* keyjoint = m->getAllJoints()[frame.BoneID]; - ISkinnedMesh::SPositionKey* poskey = m->addPositionKey(keyjoint); - poskey->frame=frame.Time*25; - poskey->position=keyjoint->LocalMatrix.getTranslation()+frame.Position; - ISkinnedMesh::SRotationKey* rotkey = m->addRotationKey(keyjoint); - rotkey->frame=frame.Time*25; - - // IRR_TEST_BROKEN_QUATERNION_USE: TODO - switched from keyjoint->LocalMatrix to keyjoint->LocalMatrix.getTransposed() for downward compatibility. - // Not tested so far if this was correct or wrong before quaternion fix! - rotkey->rotation=core::quaternion(keyjoint->LocalMatrix.getTransposed())*frame.Orientation; - - ISkinnedMesh::SScaleKey* scalekey = m->addScaleKey(keyjoint); - scalekey->frame=frame.Time*25; - scalekey->scale=frame.Scale; - } - } - m->finalize(); - } -} - - -void COgreMeshFileLoader::getMaterialToken(io::IReadFile* file, core::stringc& token, bool noNewLine) -{ - bool parseString=false; - c8 c=0; - token = ""; - - if (file->getPos() >= file->getSize()) - return; - - file->read(&c, sizeof(c8)); - // search for word beginning - while ( core::isspace(c) && (file->getPos() < file->getSize())) - { - if (noNewLine && c=='\n') - { - file->seek(-1, true); - return; - } - file->read(&c, sizeof(c8)); - } - // check if we read a string - if (c=='"') - { - parseString = true; - file->read(&c, sizeof(c8)); - } - do - { - if (c=='/') - { - file->read(&c, sizeof(c8)); - // check for comments, cannot be part of strings - if (!parseString && (c=='/')) - { - // skip comments - while(c!='\n') - file->read(&c, sizeof(c8)); - if (!token.size()) - { - // if we start with a comment we need to skip - // following whitespaces, so restart - getMaterialToken(file, token, noNewLine); - return; - } - else - { - // else continue with next character - file->read(&c, sizeof(c8)); - continue; - } - } - else - { - // else append first slash and check if second char - // ends this token - token.append('/'); - if ((!parseString && core::isspace(c)) || - (parseString && (c=='"'))) - return; - } - } - token.append(c); - file->read(&c, sizeof(c8)); - // read until a token delimiter is found - } - while (((!parseString && !core::isspace(c)) || (parseString && (c!='"'))) && - (file->getPos() < file->getSize())); - // we want to skip the last quotes of a string , but other chars might be the next - // token already. - if (!parseString) - file->seek(-1, true); -} - - -bool COgreMeshFileLoader::readColor(io::IReadFile* file, video::SColor& col) -{ - core::stringc token; - - getMaterialToken(file, token); - if (token!="vertexcolour") - { - video::SColorf col_f; - col_f.r=core::fast_atof(token.c_str()); - getMaterialToken(file, token); - col_f.g=core::fast_atof(token.c_str()); - getMaterialToken(file, token); - col_f.b=core::fast_atof(token.c_str()); - getMaterialToken(file, token, true); - if (token.size()) - col_f.a=core::fast_atof(token.c_str()); - else - col_f.a=1.0f; - if ((col_f.r==0.0f)&&(col_f.g==0.0f)&&(col_f.b==0.0f)) - col.set(255,255,255,255); - else - col=col_f.toSColor(); - return false; - } - return true; -} - - -void COgreMeshFileLoader::readPass(io::IReadFile* file, OgreTechnique& technique) -{ -#ifdef IRR_OGRE_LOADER_DEBUG - os::Printer::log("Read Pass"); -#endif - core::stringc token; - technique.Passes.push_back(OgrePass()); - OgrePass& pass=technique.Passes.getLast(); - - getMaterialToken(file, token); //open brace or name - if (token != "{") - getMaterialToken(file, token); //open brace - - getMaterialToken(file, token); - if (token == "}") - return; - u32 inBlocks=1; - u32 textureUnit=0; - while(inBlocks) - { - if (token=="ambient") - pass.AmbientTokenColor=readColor(file, pass.Material.AmbientColor); - else if (token=="diffuse") - pass.DiffuseTokenColor=readColor(file, pass.Material.DiffuseColor); - else if (token=="specular") - { - pass.SpecularTokenColor=readColor(file, pass.Material.SpecularColor); - getMaterialToken(file, token); - pass.Material.Shininess=core::fast_atof(token.c_str()); - } - else if (token=="emissive") - pass.EmissiveTokenColor=readColor(file, pass.Material.EmissiveColor); - else if (token=="scene_blend") - { // TODO: Choose correct values - getMaterialToken(file, token); - if (token=="add") - pass.Material.MaterialType=video::EMT_TRANSPARENT_ADD_COLOR; - else if (token=="modulate") - pass.Material.MaterialType=video::EMT_SOLID; - else if (token=="alpha_blend") - pass.Material.MaterialType=video::EMT_TRANSPARENT_ALPHA_CHANNEL; - else if (token=="colour_blend") - pass.Material.MaterialType=video::EMT_TRANSPARENT_VERTEX_ALPHA; - else - getMaterialToken(file, token); - } - else if (token=="depth_check") - { - getMaterialToken(file, token); - if (token!="on") - pass.Material.ZBuffer=video::ECFN_DISABLED; - } - else if (token=="depth_write") - { - getMaterialToken(file, token); - pass.Material.ZWriteEnable=(token=="on") ? video::EZW_ON : video::EZW_OFF; - } - else if (token=="depth_func") - { - getMaterialToken(file, token); // Function name - if (token=="always_fail") - pass.Material.ZBuffer=video::ECFN_NEVER; - else if (token=="always_pass") - pass.Material.ZBuffer=video::ECFN_ALWAYS; - else if (token=="equal") - pass.Material.ZBuffer=video::ECFN_EQUAL; - else if (token=="greater") - pass.Material.ZBuffer=video::ECFN_GREATER; - else if (token=="greater_equal") - pass.Material.ZBuffer=video::ECFN_GREATEREQUAL; - else if (token=="less") - pass.Material.ZBuffer=video::ECFN_LESS; - else if (token=="less_equal") - pass.Material.ZBuffer=video::ECFN_LESSEQUAL; - else if (token=="not_equal") - pass.Material.ZBuffer=video::ECFN_NOTEQUAL; - } - else if (token=="normalise_normals") - { - getMaterialToken(file, token); - pass.Material.NormalizeNormals=(token=="on"); - } - else if (token=="depth_bias") - { - getMaterialToken(file, token); // bias value - } - else if (token=="alpha_rejection") - { - getMaterialToken(file, token); // function name - getMaterialToken(file, token); // value - pass.Material.MaterialTypeParam=core::fast_atof(token.c_str()); - } - else if (token=="alpha_to_coverage") - { - getMaterialToken(file, token); - if (token=="on") - pass.Material.AntiAliasing |= video::EAAM_ALPHA_TO_COVERAGE; - } - else if (token=="colour_write") - { - getMaterialToken(file, token); - pass.Material.ColorMask = (token=="on")?video::ECP_ALL:video::ECP_NONE; - } - else if (token=="cull_hardware") - { - getMaterialToken(file, token); // rotation name - } - else if (token=="cull_software") - { - getMaterialToken(file, token); // culling side - } - else if (token=="lighting") - { - getMaterialToken(file, token); - pass.Material.Lighting=(token=="on"); - } - else if (token=="shading") - { - getMaterialToken(file, token); - // We take phong as gouraud - pass.Material.GouraudShading=(token!="flat"); - } - else if (token=="polygon_mode") - { - getMaterialToken(file, token); - pass.Material.Wireframe=(token=="wireframe"); - pass.Material.PointCloud=(token=="points"); - } - else if (token=="max_lights") - { - getMaterialToken(file, token); - pass.MaxLights=core::strtoul10(token.c_str()); - } - else if (token=="point_size") - { - getMaterialToken(file, token); - pass.PointSize=core::fast_atof(token.c_str()); - } - else if (token=="point_sprites") - { - getMaterialToken(file, token); - pass.PointSprites=(token=="on"); - } - else if (token=="point_size_min") - { - getMaterialToken(file, token); - pass.PointSizeMin=core::strtoul10(token.c_str()); - } - else if (token=="point_size_max") - { - getMaterialToken(file, token); - pass.PointSizeMax=core::strtoul10(token.c_str()); - } - else if (token=="texture_unit") - { -#ifdef IRR_OGRE_LOADER_DEBUG - os::Printer::log("Read Texture unit", ELL_DEBUG); -#endif - getMaterialToken(file, token); //open brace - getMaterialToken(file, token); - while(token != "}") - { - if (token=="texture") - { - getMaterialToken(file, token); - pass.Texture.Filename.push_back(token); -#ifdef IRR_OGRE_LOADER_DEBUG - os::Printer::log("Read Texture", token, ELL_DEBUG); -#endif - getMaterialToken(file, pass.Texture.CoordsType, true); - getMaterialToken(file, pass.Texture.MipMaps, true); - getMaterialToken(file, pass.Texture.Alpha, true); - // Hmm, we might need more hints for other material types using two textures... - if (textureUnit>0) - pass.Material.MaterialType=video::EMT_LIGHTMAP; - } - else if (token=="filtering") - { - getMaterialToken(file, token); - pass.Material.TextureLayer[textureUnit].AnisotropicFilter=0; - if (token=="point") - { - pass.Material.TextureLayer[textureUnit].BilinearFilter=false; - pass.Material.TextureLayer[textureUnit].TrilinearFilter=false; - getMaterialToken(file, token); - getMaterialToken(file, token); - } - else if (token=="linear") - { - getMaterialToken(file, token); - if (token=="point") - { - pass.Material.TextureLayer[textureUnit].BilinearFilter=false; - pass.Material.TextureLayer[textureUnit].TrilinearFilter=false; - getMaterialToken(file, token); - } - else - { - pass.Material.TextureLayer[textureUnit].BilinearFilter=true; - getMaterialToken(file, token); - pass.Material.TextureLayer[textureUnit].TrilinearFilter=(token=="linear"); - } - } - else - { - pass.Material.TextureLayer[textureUnit].BilinearFilter=(token=="bilinear"); - pass.Material.TextureLayer[textureUnit].TrilinearFilter=(token=="trilinear"); - pass.Material.TextureLayer[textureUnit].AnisotropicFilter=(token=="anisotropic")?2:1; - } - } - else if (token=="max_anisotropy") - { - getMaterialToken(file, token); - pass.Material.TextureLayer[textureUnit].AnisotropicFilter=(u8)core::strtoul10(token.c_str()); - } - else if (token=="texture_alias") - { - getMaterialToken(file, pass.Texture.Alias); - } - else if (token=="mipmap_bias") - { - getMaterialToken(file, token); - pass.Material.TextureLayer[textureUnit].LODBias=(s8)core::fast_atof(token.c_str()); - } - else if (token=="colour_op") - { // TODO: Choose correct values - getMaterialToken(file, token); - if (token=="add") - pass.Material.MaterialType=video::EMT_TRANSPARENT_ADD_COLOR; - else if (token=="modulate") - pass.Material.MaterialType=video::EMT_SOLID; - else if (token=="alpha_blend") - pass.Material.MaterialType=video::EMT_TRANSPARENT_ALPHA_CHANNEL; - else if (token=="colour_blend") - pass.Material.MaterialType=video::EMT_TRANSPARENT_VERTEX_ALPHA; - else - getMaterialToken(file, token); - } - getMaterialToken(file, token); - } - ++textureUnit; - } - else if (token=="shadow_caster_program_ref") - { - do - { - getMaterialToken(file, token); - } while (token != "}"); - } - else if (token=="shadow_caster_vertex_program_ref") - { - do - { - getMaterialToken(file, token); - } while (token != "}"); - } - else if (token=="vertex_program_ref") - { - do - { - getMaterialToken(file, token); - } while (token != "}"); - } - //fog_override, iteration, point_size_attenuation - //not considered yet! - getMaterialToken(file, token); - if (token=="{") - ++inBlocks; - else if (token=="}") - --inBlocks; - } -} - - -void COgreMeshFileLoader::readTechnique(io::IReadFile* file, OgreMaterial& mat) -{ -#ifdef IRR_OGRE_LOADER_DEBUG - os::Printer::log("Read Technique"); -#endif - core::stringc token; - mat.Techniques.push_back(OgreTechnique()); - OgreTechnique& technique=mat.Techniques.getLast(); - - getMaterialToken(file, technique.Name); //open brace or name - if (technique.Name != "{") - getMaterialToken(file, token); //open brace - else - technique.Name=core::stringc((int)mat.Techniques.size()); - - getMaterialToken(file, token); - while (token != "}") - { - if (token == "pass") - readPass(file, technique); - else if (token == "scheme") - getMaterialToken(file, token); - else if (token == "lod_index") - getMaterialToken(file, token); - getMaterialToken(file, token); - } -} - - -void COgreMeshFileLoader::loadMaterials(io::IReadFile* meshFile) -{ -#ifdef IRR_OGRE_LOADER_DEBUG - os::Printer::log("Load Materials", ELL_DEBUG); -#endif - core::stringc token; - io::IReadFile* file = 0; - io::path filename = FileSystem->getFileBasename(meshFile->getFileName(), false) + ".material"; - if (FileSystem->existFile(filename)) - file = FileSystem->createAndOpenFile(filename); - else - file = FileSystem->createAndOpenFile(FileSystem->getFileDir(meshFile->getFileName())+"/"+filename); - - if (!file) - { - os::Printer::log("Could not load OGRE material", filename); - return; - } - - getMaterialToken(file, token); - - while (file->getPos() < file->getSize()) - { - if ((token == "fragment_program") || (token == "vertex_program")) - { - // skip whole block - u32 blocks=1; - do - { - getMaterialToken(file, token); - } while (token != "{"); - do - { - getMaterialToken(file, token); - if (token == "{") - ++blocks; - else if (token == "}") - --blocks; - } while (blocks); - getMaterialToken(file, token); - continue; - } - if (token != "material") - { - if (token.trim().size()) - os::Printer::log("Unknown material group", token.c_str()); - break; - } - - Materials.push_back(OgreMaterial()); - OgreMaterial& mat = Materials.getLast(); - - getMaterialToken(file, mat.Name); -#ifdef IRR_OGRE_LOADER_DEBUG - os::Printer::log("Load Material", mat.Name.c_str(), ELL_DEBUG); -#endif - getMaterialToken(file, token); //open brace - getMaterialToken(file, token); - while(token != "}") - { - if (token=="lod_distances") // can have several items - getMaterialToken(file, token); - else if (token=="receive_shadows") - { - getMaterialToken(file, token); - mat.ReceiveShadows=(token=="on"); - } - else if (token=="transparency_casts_shadows") - { - getMaterialToken(file, token); - mat.TransparencyCastsShadows=(token=="on"); - } - else if (token=="set_texture_alias") - { - getMaterialToken(file, token); - getMaterialToken(file, token); - } - else if (token=="technique") - readTechnique(file, mat); - getMaterialToken(file, token); - } - getMaterialToken(file, token); - } - - file->drop(); -#ifdef IRR_OGRE_LOADER_DEBUG - os::Printer::log("Finished loading Materials", ELL_DEBUG); -#endif -} - - -bool COgreMeshFileLoader::loadSkeleton(io::IReadFile* meshFile, const core::stringc& name) -{ -#ifdef IRR_OGRE_LOADER_DEBUG - os::Printer::log("Load Skeleton", name, ELL_DEBUG); -#endif - io::IReadFile* file = 0; - io::path filename; - if (FileSystem->existFile(name)) - file = FileSystem->createAndOpenFile(name); - else if (FileSystem->existFile(filename = FileSystem->getFileDir(meshFile->getFileName())+"/"+name)) - file = FileSystem->createAndOpenFile(filename); - else if (FileSystem->existFile(filename = FileSystem->getFileBasename(meshFile->getFileName(), false) + ".skeleton")) - file = FileSystem->createAndOpenFile(filename); - else - file = FileSystem->createAndOpenFile(FileSystem->getFileDir(meshFile->getFileName())+"/"+filename); - if (!file) - { - os::Printer::log("Could not load matching skeleton", name); - return false; - } - - s16 id; - file->read(&id, 2); - if (SwapEndian) - id = os::Byteswap::byteswap(id); - if (id != COGRE_HEADER) - { - file->drop(); - return false; - } - - core::stringc skeletonVersion; - ChunkData head; - readString(file, head, skeletonVersion); - if (skeletonVersion != "[Serializer_v1.10]") - { - file->drop(); - return false; - } - - u16 bone=0; - f32 animationTotal=0.f; - while(file->getPos() < file->getSize()) - { - ChunkData data; - readChunkData(file, data); - - switch(data.header.id) - { - case COGRE_SKELETON: - { - Skeleton.Bones.push_back(OgreBone()); - OgreBone& bone = Skeleton.Bones.getLast(); - readString(file, data, bone.Name); - readShort(file, data, &bone.Handle); - readVector(file, data, bone.Position); - readQuaternion(file, data, bone.Orientation); -#ifdef IRR_OGRE_LOADER_DEBUG - os::Printer::log("Bone", bone.Name+" ("+core::stringc(bone.Handle)+")", ELL_DEBUG); - os::Printer::log("Position", core::stringc(bone.Position.X)+" "+core::stringc(bone.Position.Y)+" "+core::stringc(bone.Position.Z), ELL_DEBUG); - os::Printer::log("Rotation quat", core::stringc(bone.Orientation.W)+" "+core::stringc(bone.Orientation.X)+" "+core::stringc(bone.Orientation.Y)+" "+core::stringc(bone.Orientation.Z), ELL_DEBUG); -// core::vector3df rot; -// bone.Orientation.toEuler(rot); -// rot *= core::RADTODEG; -// os::Printer::log("Rotation", core::stringc(rot.X)+" "+core::stringc(rot.Y)+" "+core::stringc(rot.Z)); -#endif - if (data.read<(data.header.length-bone.Name.size())) - { - readVector(file, data, bone.Scale); - bone.Scale.X *= -1.f; - } - else - bone.Scale=core::vector3df(1,1,1); - bone.Parent=0xffff; - } - break; - case COGRE_BONE_PARENT: - { - u16 parent; - readShort(file, data, &bone); - readShort(file, data, &parent); - if (bone<Skeleton.Bones.size() && parent<Skeleton.Bones.size()) - Skeleton.Bones[bone].Parent=parent; - } - break; - case COGRE_ANIMATION: - { - if (Skeleton.Animations.size()) - animationTotal+=Skeleton.Animations.getLast().Length; - Skeleton.Animations.push_back(OgreAnimation()); - OgreAnimation& anim = Skeleton.Animations.getLast(); - readString(file, data, anim.Name); - readFloat(file, data, &anim.Length); -#ifdef IRR_OGRE_LOADER_DEBUG - os::Printer::log("Animation", anim.Name, ELL_DEBUG); - os::Printer::log("Length", core::stringc(anim.Length), ELL_DEBUG); -#endif - } - break; - case COGRE_ANIMATION_TRACK: -#ifdef IRR_OGRE_LOADER_DEBUG - os::Printer::log("for Bone ", core::stringc(bone), ELL_DEBUG); -#endif - readShort(file, data, &bone); // store current bone - break; - case COGRE_ANIMATION_KEYFRAME: - { - Skeleton.Animations.getLast().Keyframes.push_back(OgreKeyframe()); - OgreKeyframe& keyframe = Skeleton.Animations.getLast().Keyframes.getLast(); - readFloat(file, data, &keyframe.Time); - keyframe.Time+=animationTotal; - readQuaternion(file, data, keyframe.Orientation); - readVector(file, data, keyframe.Position); - if (data.read<data.header.length) - { - readVector(file, data, keyframe.Scale); - keyframe.Scale.X *= -1.f; - } - else - keyframe.Scale=core::vector3df(1,1,1); - keyframe.BoneID=bone; - } - break; - case COGRE_ANIMATION_LINK: -#ifdef IRR_OGRE_LOADER_DEBUG - os::Printer::log("Animation link", ELL_DEBUG); -#endif - break; - default: - break; - } - } - file->drop(); - return true; -} - - -void COgreMeshFileLoader::readChunkData(io::IReadFile* file, ChunkData& data) -{ - file->read(&data.header, sizeof(ChunkHeader)); - if (SwapEndian) - { - data.header.id = os::Byteswap::byteswap(data.header.id); - data.header.length = os::Byteswap::byteswap(data.header.length); - } - data.read += sizeof(ChunkHeader); -} - - -void COgreMeshFileLoader::readString(io::IReadFile* file, ChunkData& data, core::stringc& out) -{ - c8 c = 0; - out = ""; - - while (c!='\n') - { - file->read(&c, sizeof(c8)); - if (c!='\n') - out.append(c); - - } - data.read+=out.size()+1; -} - - -void COgreMeshFileLoader::readBool(io::IReadFile* file, ChunkData& data, bool& out) -{ - // normal C type because we read a bit string - char c = 0; - file->read(&c, sizeof(char)); - out=(c!=0); - ++data.read; -} - - -void COgreMeshFileLoader::readInt(io::IReadFile* file, ChunkData& data, s32* out, u32 num) -{ - // normal C type because we read a bit string - file->read(out, sizeof(int)*num); - if (SwapEndian) - { - for (u32 i=0; i<num; ++i) - out[i] = os::Byteswap::byteswap(out[i]); - } - data.read+=sizeof(int)*num; -} - - -void COgreMeshFileLoader::readShort(io::IReadFile* file, ChunkData& data, u16* out, u32 num) -{ - // normal C type because we read a bit string - file->read(out, sizeof(short)*num); - if (SwapEndian) - { - for (u32 i=0; i<num; ++i) - out[i] = os::Byteswap::byteswap(out[i]); - } - data.read+=sizeof(short)*num; -} - - -void COgreMeshFileLoader::readFloat(io::IReadFile* file, ChunkData& data, f32* out, u32 num) -{ - // normal C type because we read a bit string - file->read(out, sizeof(float)*num); - if (SwapEndian) - { - for (u32 i=0; i<num; ++i) - out[i] = os::Byteswap::byteswap(out[i]); - } - data.read+=sizeof(float)*num; -} - - -void COgreMeshFileLoader::readVector(io::IReadFile* file, ChunkData& data, core::vector3df& out) -{ - readFloat(file, data, &out.X); - readFloat(file, data, &out.Y); - readFloat(file, data, &out.Z); - out.X *= -1.f; -} - - -void COgreMeshFileLoader::readQuaternion(io::IReadFile* file, ChunkData& data, core::quaternion& out) -{ - readVector(file, data, *((core::vector3df*)&out.X)); - readFloat(file, data, &out.W); -} - - -void COgreMeshFileLoader::clearMeshes() -{ - for (u32 i=0; i<Meshes.size(); ++i) - { - for (int k=0; k<(int)Meshes[i].Geometry.Buffers.size(); ++k) - Meshes[i].Geometry.Buffers[k].Data.clear(); - - for (u32 j=0; j<Meshes[i].SubMeshes.size(); ++j) - { - for (int h=0; h<(int)Meshes[i].SubMeshes[j].Geometry.Buffers.size(); ++h) - Meshes[i].SubMeshes[j].Geometry.Buffers[h].Data.clear(); - } - } - - Meshes.clear(); -} - - -} // end namespace scene -} // end namespace irr - -#endif // _IRR_COMPILE_WITH_OGRE_LOADER_ - diff --git a/source/Irrlicht/COgreMeshFileLoader.h b/source/Irrlicht/COgreMeshFileLoader.h deleted file mode 100644 index c4c4e479..00000000 --- a/source/Irrlicht/COgreMeshFileLoader.h +++ /dev/null @@ -1,269 +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 -// originally written by Christian Stehno, modified by Nikolaus Gebhardt - -#ifndef __C_OGRE_MESH_FILE_LOADER_H_INCLUDED__ -#define __C_OGRE_MESH_FILE_LOADER_H_INCLUDED__ - -#include "IMeshLoader.h" -#include "IFileSystem.h" -#include "IVideoDriver.h" -#include "irrString.h" -#include "SMesh.h" -#include "SMeshBuffer.h" -#include "SMeshBufferLightMap.h" -#include "IMeshManipulator.h" -#include "matrix4.h" -#include "quaternion.h" -#include "CSkinnedMesh.h" - -namespace irr -{ -namespace scene -{ - -//! Meshloader capable of loading ogre meshes. -class COgreMeshFileLoader : public IMeshLoader -{ -public: - - //! Constructor - COgreMeshFileLoader(io::IFileSystem* fs, video::IVideoDriver* driver); - - //! destructor - virtual ~COgreMeshFileLoader(); - - //! 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: - -// byte-align structures -#include "irrpack.h" - - struct ChunkHeader - { - u16 id; - u32 length; - } PACK_STRUCT; - -// Default alignment -#include "irrunpack.h" - - - struct ChunkData - { - ChunkData() : read(0) {} - - ChunkHeader header; - u32 read; - }; - - struct OgreTexture - { - core::array<core::stringc> Filename; - core::stringc Alias; - core::stringc CoordsType; - core::stringc MipMaps; - core::stringc Alpha; - }; - - struct OgrePass - { - OgrePass() : AmbientTokenColor(false), - DiffuseTokenColor(false), SpecularTokenColor(false), - EmissiveTokenColor(false), - MaxLights(8), PointSize(1.0f), PointSprites(false), - PointSizeMin(0), PointSizeMax(0) {} - - video::SMaterial Material; - OgreTexture Texture; - bool AmbientTokenColor; - bool DiffuseTokenColor; - bool SpecularTokenColor; - bool EmissiveTokenColor; - u32 MaxLights; - f32 PointSize; - bool PointSprites; - u32 PointSizeMin; - u32 PointSizeMax; - }; - - struct OgreTechnique - { - OgreTechnique() : Name(""), LODIndex(0) {} - - core::stringc Name; - core::stringc Scheme; - u16 LODIndex; - core::array<OgrePass> Passes; - }; - - struct OgreMaterial - { - OgreMaterial() : Name(""), ReceiveShadows(true), - TransparencyCastsShadows(false) {} - - core::stringc Name; - bool ReceiveShadows; - bool TransparencyCastsShadows; - core::array<f32> LODDistances; - core::array<OgreTechnique> Techniques; - }; - - struct OgreVertexBuffer - { - OgreVertexBuffer() : BindIndex(0), VertexSize(0), Data(0) {} - - u16 BindIndex; - u16 VertexSize; - core::array<f32> Data; - }; - - struct OgreVertexElement - { - u16 Source, - Type, - Semantic, - Offset, - Index; - }; - - struct OgreGeometry - { - s32 NumVertex; - core::array<OgreVertexElement> Elements; - core::array<OgreVertexBuffer> Buffers; - core::array<core::vector3df> Vertices; - core::array<core::vector3df> Normals; - core::array<s32> Colors; - core::array<core::vector2df> TexCoords; - }; - - struct OgreTextureAlias - { - OgreTextureAlias() {}; - OgreTextureAlias(const core::stringc& a, const core::stringc& b) : Texture(a), Alias(b) {}; - core::stringc Texture; - core::stringc Alias; - }; - - struct OgreBoneAssignment - { - s32 VertexID; - u16 BoneID; - f32 Weight; - }; - - struct OgreSubMesh - { - core::stringc Material; - bool SharedVertices; - core::array<s32> Indices; - OgreGeometry Geometry; - u16 Operation; - core::array<OgreTextureAlias> TextureAliases; - core::array<OgreBoneAssignment> BoneAssignments; - bool Indices32Bit; - }; - - struct OgreMesh - { - bool SkeletalAnimation; - OgreGeometry Geometry; - core::array<OgreSubMesh> SubMeshes; - core::array<OgreBoneAssignment> BoneAssignments; - core::vector3df BBoxMinEdge; - core::vector3df BBoxMaxEdge; - f32 BBoxRadius; - }; - - struct OgreBone - { - core::stringc Name; - core::vector3df Position; - core::quaternion Orientation; - core::vector3df Scale; - u16 Handle; - u16 Parent; - }; - - struct OgreKeyframe - { - u16 BoneID; - f32 Time; - core::vector3df Position; - core::quaternion Orientation; - core::vector3df Scale; - }; - - struct OgreAnimation - { - core::stringc Name; - f32 Length; - core::array<OgreKeyframe> Keyframes; - }; - - struct OgreSkeleton - { - core::array<OgreBone> Bones; - core::array<OgreAnimation> Animations; - }; - - bool readChunk(io::IReadFile* file); - bool readObjectChunk(io::IReadFile* file, ChunkData& parent, OgreMesh& mesh); - bool readGeometry(io::IReadFile* file, ChunkData& parent, OgreGeometry& geometry); - bool readVertexDeclaration(io::IReadFile* file, ChunkData& parent, OgreGeometry& geometry); - bool readVertexBuffer(io::IReadFile* file, ChunkData& parent, OgreGeometry& geometry); - bool readSubMesh(io::IReadFile* file, ChunkData& parent, OgreSubMesh& subMesh); - - void readChunkData(io::IReadFile* file, ChunkData& data); - void readString(io::IReadFile* file, ChunkData& data, core::stringc& out); - void readBool(io::IReadFile* file, ChunkData& data, bool& out); - void readInt(io::IReadFile* file, ChunkData& data, s32* out, u32 num=1); - void readShort(io::IReadFile* file, ChunkData& data, u16* out, u32 num=1); - void readFloat(io::IReadFile* file, ChunkData& data, f32* out, u32 num=1); - void readVector(io::IReadFile* file, ChunkData& data, core::vector3df& out); - void readQuaternion(io::IReadFile* file, ChunkData& data, core::quaternion& out); - - void composeMeshBufferMaterial(scene::IMeshBuffer* mb, const core::stringc& materialName); - scene::SMeshBuffer* composeMeshBuffer(const core::array<s32>& indices, const OgreGeometry& geom); - scene::SMeshBufferLightMap* composeMeshBufferLightMap(const core::array<s32>& indices, const OgreGeometry& geom); - scene::IMeshBuffer* composeMeshBufferSkinned(scene::CSkinnedMesh& mesh, const core::array<s32>& indices, const OgreGeometry& geom); - void composeObject(void); - bool readColor(io::IReadFile* meshFile, video::SColor& col); - void getMaterialToken(io::IReadFile* file, core::stringc& token, bool noNewLine=false); - void readTechnique(io::IReadFile* meshFile, OgreMaterial& mat); - void readPass(io::IReadFile* file, OgreTechnique& technique); - void loadMaterials(io::IReadFile* file); - bool loadSkeleton(io::IReadFile* meshFile, const core::stringc& name); - void clearMeshes(); - - io::IFileSystem* FileSystem; - video::IVideoDriver* Driver; - - core::stringc Version; - bool SwapEndian; - core::array<OgreMesh> Meshes; - io::path CurrentlyLoadingFromPath; - - core::array<OgreMaterial> Materials; - OgreSkeleton Skeleton; - - IMesh* Mesh; - u32 NumUV; -}; - -} // end namespace scene -} // end namespace irr - -#endif - diff --git a/source/Irrlicht/CPLYMeshFileLoader.cpp b/source/Irrlicht/CPLYMeshFileLoader.cpp deleted file mode 100644 index f963ab94..00000000 --- a/source/Irrlicht/CPLYMeshFileLoader.cpp +++ /dev/null @@ -1,821 +0,0 @@ -// Copyright (C) 2009-2012 Gaz Davidson -// 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_PLY_LOADER_ - -#include "CPLYMeshFileLoader.h" -#include "IMeshManipulator.h" -#include "SMesh.h" -#include "CDynamicMeshBuffer.h" -#include "SAnimatedMesh.h" -#include "IReadFile.h" -#include "fast_atof.h" -#include "os.h" - -namespace irr -{ -namespace scene -{ - -// input buffer must be at least twice as long as the longest line in the file -#define PLY_INPUT_BUFFER_SIZE 51200 // file is loaded in 50k chunks - -// constructor -CPLYMeshFileLoader::CPLYMeshFileLoader(scene::ISceneManager* smgr) -: SceneManager(smgr), File(0), Buffer(0) -{ -} - - -CPLYMeshFileLoader::~CPLYMeshFileLoader() -{ - // delete the buffer in case we didn't earlier - // (we do, but this could be disabled to increase the speed of loading hundreds of meshes) - if (Buffer) - { - delete [] Buffer; - Buffer = 0; - } - - // Destroy the element list if it exists - for (u32 i=0; i<ElementList.size(); ++i) - delete ElementList[i]; - ElementList.clear(); -} - - -//! returns true if the file maybe is able to be loaded by this class -bool CPLYMeshFileLoader::isALoadableFileExtension(const io::path& filename) const -{ - return core::hasFileExtension(filename, "ply"); -} - - -//! creates/loads an animated mesh from the file. -IAnimatedMesh* CPLYMeshFileLoader::createMesh(io::IReadFile* file) -{ - if (!file) - return 0; - - File = file; - File->grab(); - - // attempt to allocate the buffer and fill with data - if (!allocateBuffer()) - { - File->drop(); - File = 0; - return 0; - } - - // start with empty mesh - SAnimatedMesh* animMesh = 0; - u32 vertCount=0; - - // Currently only supports ASCII meshes - if (strcmp(getNextLine(), "ply")) - { - os::Printer::log("Not a valid PLY file", file->getFileName().c_str(), ELL_ERROR); - } - else - { - // cut the next line out - getNextLine(); - // grab the word from this line - c8 *word = getNextWord(); - - // ignore comments - while (strcmp(word, "comment") == 0) - { - getNextLine(); - word = getNextWord(); - } - - bool readingHeader = true; - bool continueReading = true; - IsBinaryFile = false; - IsWrongEndian= false; - - do - { - if (strcmp(word, "format") == 0) - { - word = getNextWord(); - - if (strcmp(word, "binary_little_endian") == 0) - { - IsBinaryFile = true; -#ifdef __BIG_ENDIAN__ - IsWrongEndian = true; -#endif - - } - else if (strcmp(word, "binary_big_endian") == 0) - { - IsBinaryFile = true; -#ifndef __BIG_ENDIAN__ - IsWrongEndian = true; -#endif - } - else if (strcmp(word, "ascii")) - { - // abort if this isn't an ascii or a binary mesh - os::Printer::log("Unsupported PLY mesh format", word, ELL_ERROR); - continueReading = false; - } - - if (continueReading) - { - word = getNextWord(); - if (strcmp(word, "1.0")) - { - os::Printer::log("Unsupported PLY mesh version", word, ELL_WARNING); - } - } - } - else if (strcmp(word, "property") == 0) - { - word = getNextWord(); - - if (!ElementList.size()) - { - os::Printer::log("PLY property found before element", word, ELL_WARNING); - } - else - { - // get element - SPLYElement* el = ElementList[ElementList.size()-1]; - - // fill property struct - SPLYProperty prop; - prop.Type = getPropertyType(word); - el->KnownSize += prop.size(); - - if (prop.Type == EPLYPT_LIST) - { - el->IsFixedWidth = false; - - word = getNextWord(); - - prop.Data.List.CountType = getPropertyType(word); - if (IsBinaryFile && prop.Data.List.CountType == EPLYPT_UNKNOWN) - { - os::Printer::log("Cannot read binary PLY file containing data types of unknown length", word, ELL_ERROR); - continueReading = false; - } - else - { - word = getNextWord(); - prop.Data.List.ItemType = getPropertyType(word); - if (IsBinaryFile && prop.Data.List.ItemType == EPLYPT_UNKNOWN) - { - os::Printer::log("Cannot read binary PLY file containing data types of unknown length", word, ELL_ERROR); - continueReading = false; - } - } - } - else if (IsBinaryFile && prop.Type == EPLYPT_UNKNOWN) - { - os::Printer::log("Cannot read binary PLY file containing data types of unknown length", word, ELL_ERROR); - continueReading = false; - } - - prop.Name = getNextWord(); - - // add property to element - el->Properties.push_back(prop); - } - } - else if (strcmp(word, "element") == 0) - { - SPLYElement* el = new SPLYElement; - el->Name = getNextWord(); - el->Count = atoi(getNextWord()); - el->IsFixedWidth = true; - el->KnownSize = 0; - ElementList.push_back(el); - - if (el->Name == "vertex") - vertCount = el->Count; - - } - else if (strcmp(word, "end_header") == 0) - { - readingHeader = false; - if (IsBinaryFile) - { - StartPointer = LineEndPointer + 1; - } - } - else if (strcmp(word, "comment") == 0) - { - // ignore line - } - else - { - os::Printer::log("Unknown item in PLY file", word, ELL_WARNING); - } - - if (readingHeader && continueReading) - { - getNextLine(); - word = getNextWord(); - } - } - while (readingHeader && continueReading); - - // now to read the actual data from the file - if (continueReading) - { - // create a mesh buffer - CDynamicMeshBuffer *mb = new CDynamicMeshBuffer(video::EVT_STANDARD, vertCount > 65536 ? video::EIT_32BIT : video::EIT_16BIT); - mb->getVertexBuffer().reallocate(vertCount); - mb->getIndexBuffer().reallocate(vertCount); - mb->setHardwareMappingHint(EHM_STATIC); - - bool hasNormals=true; - // loop through each of the elements - for (u32 i=0; i<ElementList.size(); ++i) - { - // do we want this element type? - if (ElementList[i]->Name == "vertex") - { - // loop through vertex properties - for (u32 j=0; j < ElementList[i]->Count; ++j) - hasNormals &= readVertex(*ElementList[i], mb); - } - else if (ElementList[i]->Name == "face") - { - // read faces - for (u32 j=0; j < ElementList[i]->Count; ++j) - readFace(*ElementList[i], mb); - } - else - { - // skip these elements - for (u32 j=0; j < ElementList[i]->Count; ++j) - skipElement(*ElementList[i]); - } - } - mb->recalculateBoundingBox(); - if (!hasNormals) - SceneManager->getMeshManipulator()->recalculateNormals(mb); - SMesh* m = new SMesh(); - m->addMeshBuffer(mb); - m->recalculateBoundingBox(); - mb->drop(); - animMesh = new SAnimatedMesh(); - animMesh->addMesh(m); - animMesh->recalculateBoundingBox(); - m->drop(); - } - } - - - // free the buffer - delete [] Buffer; - Buffer = 0; - File->drop(); - File = 0; - - // if we managed to create a mesh, return it - return animMesh; -} - - -bool CPLYMeshFileLoader::readVertex(const SPLYElement &Element, scene::CDynamicMeshBuffer* mb) -{ - if (!IsBinaryFile) - getNextLine(); - - video::S3DVertex vert; - vert.Color.set(255,255,255,255); - vert.TCoords.X = 0.0f; - vert.TCoords.Y = 0.0f; - vert.Normal.X = 0.0f; - vert.Normal.Y = 1.0f; - vert.Normal.Z = 0.0f; - - bool result=false; - for (u32 i=0; i < Element.Properties.size(); ++i) - { - E_PLY_PROPERTY_TYPE t = Element.Properties[i].Type; - const core::stringc& name = Element.Properties[i].Name; - - if (name == "x") - vert.Pos.X = getFloat(t); - else if (name == "y") - vert.Pos.Z = getFloat(t); - else if (name == "z") - vert.Pos.Y = getFloat(t); - else if (name == "nx") - { - vert.Normal.X = getFloat(t); - result=true; - } - else if (name == "ny") - { - vert.Normal.Z = getFloat(t); - result=true; - } - else if (name == "nz") - { - vert.Normal.Y = getFloat(t); - result=true; - } - // There isn't a single convention for the UV, some software like Blender or Assimp uses "st" instead of "uv" - // Not sure which tool creates texture_u/texture_v, but those exist as well. - else if (name == "u" || name == "s" || name == "texture_u") - vert.TCoords.X = getFloat(t); - else if (name == "v" || name == "t" || name == "texture_v") - vert.TCoords.Y = getFloat(t); - else if (name == "red") - { - u32 value = Element.Properties[i].isFloat() ? (u32)(getFloat(t)*255.0f) : getInt(t); - vert.Color.setRed(value); - } - else if (name == "green") - { - u32 value = Element.Properties[i].isFloat() ? (u32)(getFloat(t)*255.0f) : getInt(t); - vert.Color.setGreen(value); - } - else if (name == "blue") - { - u32 value = Element.Properties[i].isFloat() ? (u32)(getFloat(t)*255.0f) : getInt(t); - vert.Color.setBlue(value); - } - else if (name == "alpha") - { - u32 value = Element.Properties[i].isFloat() ? (u32)(getFloat(t)*255.0f) : getInt(t); - vert.Color.setAlpha(value); - } - else - skipProperty(Element.Properties[i]); - } - - mb->getVertexBuffer().push_back(vert); - - return result; -} - - -bool CPLYMeshFileLoader::readFace(const SPLYElement &Element, scene::CDynamicMeshBuffer* mb) -{ - if (!IsBinaryFile) - getNextLine(); - - for (u32 i=0; i < Element.Properties.size(); ++i) - { - const SPLYProperty& property = Element.Properties[i]; - if ( (property.Name == "vertex_indices" || property.Name == "vertex_index") - && property.Type == EPLYPT_LIST) - { - // get count - s32 count = getInt(property.Data.List.CountType); - u32 a = getInt(property.Data.List.ItemType), - b = getInt(property.Data.List.ItemType), - c = getInt(property.Data.List.ItemType); - s32 j = 3; - - mb->getIndexBuffer().push_back(a); - mb->getIndexBuffer().push_back(c); - mb->getIndexBuffer().push_back(b); - - for (; j < count; ++j) - { - b = c; - c = getInt(property.Data.List.ItemType); - mb->getIndexBuffer().push_back(a); - mb->getIndexBuffer().push_back(c); - mb->getIndexBuffer().push_back(b); - } - } - else if (property.Name == "intensity") - { - // todo: face intensity - skipProperty(property); - } - else - skipProperty(property); - } - return true; -} - - -// skips an element and all properties. return false on EOF -void CPLYMeshFileLoader::skipElement(const SPLYElement &Element) -{ - if (IsBinaryFile) - if (Element.IsFixedWidth) - moveForward(Element.KnownSize); - else - for (u32 i=0; i < Element.Properties.size(); ++i) - skipProperty(Element.Properties[i]); - else - getNextLine(); -} - - -void CPLYMeshFileLoader::skipProperty(const SPLYProperty &Property) -{ - if (Property.Type == EPLYPT_LIST) - { - s32 count = getInt(Property.Data.List.CountType); - - for (s32 i=0; i < count; ++i) - getInt(Property.Data.List.CountType); - } - else - { - if (IsBinaryFile) - moveForward(Property.size()); - else - getNextWord(); - } -} - - -bool CPLYMeshFileLoader::allocateBuffer() -{ - // Destroy the element list if it exists - for (u32 i=0; i<ElementList.size(); ++i) - delete ElementList[i]; - ElementList.clear(); - - if (!Buffer) - Buffer = new c8[PLY_INPUT_BUFFER_SIZE]; - - // not enough memory? - if (!Buffer) - return false; - - // blank memory - memset(Buffer, 0, PLY_INPUT_BUFFER_SIZE); - - StartPointer = Buffer; - EndPointer = Buffer; - LineEndPointer = Buffer-1; - WordLength = -1; - EndOfFile = false; - - // get data from the file - fillBuffer(); - - return true; -} - - -// gets more data from the file. returns false on EOF -void CPLYMeshFileLoader::fillBuffer() -{ - if (EndOfFile) - return; - - size_t length = (size_t)(EndPointer - StartPointer); - if (length && StartPointer != Buffer) - { - // copy the remaining data to the start of the buffer - memcpy(Buffer, StartPointer, length); - } - // reset start position - StartPointer = Buffer; - EndPointer = StartPointer + length; - - if (File->getPos() == File->getSize()) - { - EndOfFile = true; - } - else - { - // read data from the file - size_t count = File->read(EndPointer, PLY_INPUT_BUFFER_SIZE - length); - - // increment the end pointer by the number of bytes read - EndPointer = EndPointer + count; - - // if we didn't completely fill the buffer - if (count != PLY_INPUT_BUFFER_SIZE - length) - { - // blank the rest of the memory - memset(EndPointer, 0, Buffer + PLY_INPUT_BUFFER_SIZE - EndPointer); - - // end of file - EndOfFile = true; - } - } -} - - -// skips x bytes in the file, getting more data if required -void CPLYMeshFileLoader::moveForward(u32 bytes) -{ - if (StartPointer + bytes >= EndPointer) - fillBuffer(); - if (StartPointer + bytes < EndPointer) - StartPointer += bytes; - else - StartPointer = EndPointer; -} - - -E_PLY_PROPERTY_TYPE CPLYMeshFileLoader::getPropertyType(const c8* typeString) const -{ - if (strcmp(typeString, "char") == 0 || - strcmp(typeString, "uchar") == 0 || - strcmp(typeString, "int8") == 0 || - strcmp(typeString, "uint8") == 0) - { - return EPLYPT_INT8; - } - else if (strcmp(typeString, "uint") == 0 || - strcmp(typeString, "int16") == 0 || - strcmp(typeString, "uint16") == 0 || - strcmp(typeString, "short") == 0 || - strcmp(typeString, "ushort") == 0) - { - return EPLYPT_INT16; - } - else if (strcmp(typeString, "int") == 0 || - strcmp(typeString, "long") == 0 || - strcmp(typeString, "ulong") == 0 || - strcmp(typeString, "int32") == 0 || - strcmp(typeString, "uint32") == 0) - { - return EPLYPT_INT32; - } - else if (strcmp(typeString, "float") == 0 || - strcmp(typeString, "float32") == 0) - { - return EPLYPT_FLOAT32; - } - else if (strcmp(typeString, "float64") == 0 || - strcmp(typeString, "double") == 0) - { - return EPLYPT_FLOAT64; - } - else if ( strcmp(typeString, "list") == 0 ) - { - return EPLYPT_LIST; - } - else - { - // unsupported type. - // cannot be loaded in binary mode - return EPLYPT_UNKNOWN; - } -} - - -// Split the string data into a line in place by terminating it instead of copying. -c8* CPLYMeshFileLoader::getNextLine() -{ - // move the start pointer along - StartPointer = LineEndPointer + 1; - - // crlf split across buffer move - if (StartPointer<EndPointer && *StartPointer == '\n') - { - *StartPointer = '\0'; - ++StartPointer; - } - - // begin at the start of the next line - c8* pos = StartPointer; - while (pos < EndPointer && *pos && *pos != '\r' && *pos != '\n') - ++pos; - - if ( (pos+1) < EndPointer && ( *(pos+1) == '\r' || *(pos+1) == '\n') ) - { - *pos = '\0'; - ++pos; - } - - // we have reached the end of the buffer - if (pos >= EndPointer) - { - // get data from the file - if (!EndOfFile) - { - fillBuffer(); - // reset line end pointer - LineEndPointer = StartPointer - 1; - - if (StartPointer != EndPointer) - return getNextLine(); - else - return Buffer; - } - else - { - // EOF - StartPointer = EndPointer-1; - *StartPointer = '\0'; - return StartPointer; - } - } - else - { - // null terminate the string in place - *pos = '\0'; - LineEndPointer = pos; - WordLength = -1; - // return pointer to the start of the line - return StartPointer; - } -} - - -// null terminate the next word on the previous line and move the next word pointer along -// since we already have a full line in the buffer, we never need to retrieve more data -c8* CPLYMeshFileLoader::getNextWord() -{ - // move the start pointer along - StartPointer += WordLength + 1; - - if (StartPointer == LineEndPointer) - { - WordLength = -1; // - return LineEndPointer; - } - // begin at the start of the next word - c8* pos = StartPointer; - while (*pos && pos < LineEndPointer && pos < EndPointer && *pos != ' ' && *pos != '\t') - ++pos; - - while(*pos && pos < LineEndPointer && pos < EndPointer && (*pos == ' ' || *pos == '\t') ) - { - // null terminate the string in place - *pos = '\0'; - ++pos; - } - --pos; - WordLength = (s32)(pos-StartPointer); - // return pointer to the start of the word - return StartPointer; -} - - -// read the next float from the file and move the start pointer along -f32 CPLYMeshFileLoader::getFloat(E_PLY_PROPERTY_TYPE t) -{ - f32 retVal = 0.0f; - - if (IsBinaryFile) - { - if (EndPointer - StartPointer < 8) - fillBuffer(); - - if (EndPointer - StartPointer > 0) - { - switch (t) - { - case EPLYPT_INT8: - retVal = *StartPointer; - StartPointer++; - break; - case EPLYPT_INT16: - if (IsWrongEndian) - retVal = os::Byteswap::byteswap(*(reinterpret_cast<s16*>(StartPointer))); - else - retVal = *(reinterpret_cast<s16*>(StartPointer)); - StartPointer += 2; - break; - case EPLYPT_INT32: - if (IsWrongEndian) - retVal = f32(os::Byteswap::byteswap(*(reinterpret_cast<s32*>(StartPointer)))); - else - retVal = f32(*(reinterpret_cast<s32*>(StartPointer))); - StartPointer += 4; - break; - case EPLYPT_FLOAT32: - if (IsWrongEndian) - retVal = os::Byteswap::byteswap(*(reinterpret_cast<f32*>(StartPointer))); - else - retVal = *(reinterpret_cast<f32*>(StartPointer)); - StartPointer += 4; - break; - case EPLYPT_FLOAT64: - // todo: byteswap 64-bit - retVal = f32(*(reinterpret_cast<f64*>(StartPointer))); - StartPointer += 8; - break; - case EPLYPT_LIST: - case EPLYPT_UNKNOWN: - default: - retVal = 0.0f; - StartPointer++; // ouch! - } - } - else - retVal = 0.0f; - } - else - { - c8* word = getNextWord(); - switch (t) - { - case EPLYPT_INT8: - case EPLYPT_INT16: - case EPLYPT_INT32: - retVal = f32(atoi(word)); - break; - case EPLYPT_FLOAT32: - case EPLYPT_FLOAT64: - retVal = f32(atof(word)); - break; - case EPLYPT_LIST: - case EPLYPT_UNKNOWN: - default: - retVal = 0.0f; - } - } - return retVal; -} - - -// read the next int from the file and move the start pointer along -u32 CPLYMeshFileLoader::getInt(E_PLY_PROPERTY_TYPE t) -{ - u32 retVal = 0; - - if (IsBinaryFile) - { - if (!EndOfFile && EndPointer - StartPointer < 8) - fillBuffer(); - - if (EndPointer - StartPointer) - { - switch (t) - { - case EPLYPT_INT8: - retVal = *StartPointer; - StartPointer++; - break; - case EPLYPT_INT16: - if (IsWrongEndian) - retVal = os::Byteswap::byteswap(*(reinterpret_cast<u16*>(StartPointer))); - else - retVal = *(reinterpret_cast<u16*>(StartPointer)); - StartPointer += 2; - break; - case EPLYPT_INT32: - if (IsWrongEndian) - retVal = os::Byteswap::byteswap(*(reinterpret_cast<s32*>(StartPointer))); - else - retVal = *(reinterpret_cast<s32*>(StartPointer)); - StartPointer += 4; - break; - case EPLYPT_FLOAT32: - if (IsWrongEndian) - retVal = (u32)os::Byteswap::byteswap(*(reinterpret_cast<f32*>(StartPointer))); - else - retVal = (u32)(*(reinterpret_cast<f32*>(StartPointer))); - StartPointer += 4; - break; - case EPLYPT_FLOAT64: - // todo: byteswap 64-bit - retVal = (u32)(*(reinterpret_cast<f64*>(StartPointer))); - StartPointer += 8; - break; - case EPLYPT_LIST: - case EPLYPT_UNKNOWN: - default: - retVal = 0; - StartPointer++; // ouch! - } - } - else - retVal = 0; - } - else - { - c8* word = getNextWord(); - switch (t) - { - case EPLYPT_INT8: - case EPLYPT_INT16: - case EPLYPT_INT32: - retVal = atoi(word); - break; - case EPLYPT_FLOAT32: - case EPLYPT_FLOAT64: - retVal = u32(atof(word)); - break; - case EPLYPT_LIST: - case EPLYPT_UNKNOWN: - default: - retVal = 0; - } - } - return retVal; -} - - - -} // end namespace scene -} // end namespace irr - -#endif // _IRR_COMPILE_WITH_PLY_LOADER_ - diff --git a/source/Irrlicht/CPLYMeshFileLoader.h b/source/Irrlicht/CPLYMeshFileLoader.h deleted file mode 100644 index 4335c924..00000000 --- a/source/Irrlicht/CPLYMeshFileLoader.h +++ /dev/null @@ -1,148 +0,0 @@ -// Copyright (C) 2009-2012 Gaz Davidson -// This file is part of the "Irrlicht Engine". -// For conditions of distribution and use, see copyright notice in irrlicht.h - -#ifndef __C_PLY_MESH_FILE_LOADER_H_INCLUDED__ -#define __C_PLY_MESH_FILE_LOADER_H_INCLUDED__ - -#include "IMeshLoader.h" -#include "ISceneManager.h" -#include "CDynamicMeshBuffer.h" - -namespace irr -{ -namespace scene -{ - -enum E_PLY_PROPERTY_TYPE -{ - EPLYPT_INT8 = 0, - EPLYPT_INT16, - EPLYPT_INT32, - EPLYPT_FLOAT32, - EPLYPT_FLOAT64, - EPLYPT_LIST, - EPLYPT_UNKNOWN -}; - -//! Meshloader capable of loading obj meshes. -class CPLYMeshFileLoader : public IMeshLoader -{ -public: - - //! Constructor - CPLYMeshFileLoader(scene::ISceneManager* smgr); - - //! Destructor - virtual ~CPLYMeshFileLoader(); - - //! returns true if the file maybe is able to be loaded by this class - //! based on the file extension (e.g. ".ply") - virtual bool isALoadableFileExtension(const io::path& filename) const _IRR_OVERRIDE_; - - //! creates/loads an animated mesh from the file. - virtual IAnimatedMesh* createMesh(io::IReadFile* file) _IRR_OVERRIDE_; - -private: - - struct SPLYProperty - { - core::stringc Name; - E_PLY_PROPERTY_TYPE Type; - union - { - u8 Int8; - u16 Int16; - u32 Int32; - f32 Float32; - f64 Double; - struct SPLYListProperty - { - E_PLY_PROPERTY_TYPE CountType; - E_PLY_PROPERTY_TYPE ItemType; - } List; - - } Data; - - inline u32 size() const - { - switch(Type) - { - case EPLYPT_INT8: - return 1; - case EPLYPT_INT16: - return 2; - case EPLYPT_INT32: - case EPLYPT_FLOAT32: - return 4; - case EPLYPT_FLOAT64: - return 8; - case EPLYPT_LIST: - case EPLYPT_UNKNOWN: - default: - return 0; - } - } - - inline bool isFloat() const - { - switch(Type) - { - case EPLYPT_FLOAT32: - case EPLYPT_FLOAT64: - return true; - case EPLYPT_INT8: - case EPLYPT_INT16: - case EPLYPT_INT32: - case EPLYPT_LIST: - case EPLYPT_UNKNOWN: - default: - return false; - } - } - }; - - struct SPLYElement - { - // name of the element. We only want "vertex" and "face" elements - // but we have to parse the others anyway. - core::stringc Name; - // The number of elements in the file - u32 Count; - // Properties of this element - core::array<SPLYProperty> Properties; - // in binary files, true if this is a fixed size - bool IsFixedWidth; - // known size in bytes, 0 if unknown - u32 KnownSize; - }; - - bool allocateBuffer(); - c8* getNextLine(); - c8* getNextWord(); - void fillBuffer(); - E_PLY_PROPERTY_TYPE getPropertyType(const c8* typeString) const; - - bool readVertex(const SPLYElement &Element, scene::CDynamicMeshBuffer* mb); - bool readFace(const SPLYElement &Element, scene::CDynamicMeshBuffer* mb); - void skipElement(const SPLYElement &Element); - void skipProperty(const SPLYProperty &Property); - f32 getFloat(E_PLY_PROPERTY_TYPE t); - u32 getInt(E_PLY_PROPERTY_TYPE t); - void moveForward(u32 bytes); - - core::array<SPLYElement*> ElementList; - - scene::ISceneManager* SceneManager; - io::IReadFile *File; - c8 *Buffer; - bool IsBinaryFile, IsWrongEndian, EndOfFile; - s32 WordLength; - c8 *StartPointer, *EndPointer, *LineEndPointer; -}; - -} // end namespace scene -} // end namespace irr - -#endif - diff --git a/source/Irrlicht/CPLYMeshWriter.cpp b/source/Irrlicht/CPLYMeshWriter.cpp deleted file mode 100644 index 8713c582..00000000 --- a/source/Irrlicht/CPLYMeshWriter.cpp +++ /dev/null @@ -1,220 +0,0 @@ -// Copyright (C) 2008-2012 Christian Stehno -// 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_PLY_WRITER_ - -#include "CPLYMeshWriter.h" -#include "os.h" -#include "IMesh.h" -#include "IMeshBuffer.h" -#include "IWriteFile.h" - -namespace irr -{ -namespace scene -{ - -CPLYMeshWriter::CPLYMeshWriter() -{ - #ifdef _DEBUG - setDebugName("CPLYMeshWriter"); - #endif -} - - -//! Returns the type of the mesh writer -EMESH_WRITER_TYPE CPLYMeshWriter::getType() const -{ - return EMWT_PLY; -} - -//! writes a mesh -bool CPLYMeshWriter::writeMesh(io::IWriteFile* file, scene::IMesh* mesh, s32 flags) -{ - if (!file || !mesh) - return false; - - os::Printer::log("Writing mesh", file->getFileName()); - - // write PLY header - core::stringc header = "ply\n"; - - if (flags & scene::EMWF_WRITE_BINARY) - { - #ifdef __BIG_ENDIAN__ - header += "format binary_big_endian 1.0\n"; - #else - header += "format binary_little_endian 1.0\n"; - #endif - } - else - header += "format ascii 1.0\n"; - - header += "comment Irrlicht Engine "; - header += IRRLICHT_SDK_VERSION; - - // get vertex and triangle counts - u32 VertexCount = 0; - u32 TriangleCount = 0; - - for (u32 i=0; i < mesh->getMeshBufferCount(); ++i) - { - VertexCount += mesh->getMeshBuffer(i)->getVertexCount(); - TriangleCount += mesh->getMeshBuffer(i)->getIndexCount() / 3; - } - - // vertex definition - header += "\nelement vertex "; - header += VertexCount; - - header += "\n" - "property float x\n" - "property float y\n" - "property float z\n" - "property float nx\n" - "property float ny\n" - "property float nz\n" - "property float s\n" - "property float t\n" - "property uchar red\n" - "property uchar green\n" - "property uchar blue\n"; - // "property float tx\n" - // "property float ty\n" - // "property float tz\n" - - // face definition - - header += "element face "; - header += TriangleCount; - header += "\n" - "property list uchar int vertex_indices\n" - "end_header\n"; - - // write header - file->write(header.c_str(), header.size()); - - // write vertices - - c8 outLine[1024]; - - for (u32 i=0; i < mesh->getMeshBufferCount(); ++i) - { - const scene::IMeshBuffer* mb = mesh->getMeshBuffer(i); - u32 vertexSize = 0; - switch(mb->getVertexType()) - { - case video::EVT_STANDARD: - vertexSize = sizeof(video::S3DVertex); - break; - case video::EVT_2TCOORDS: - vertexSize = sizeof(video::S3DVertex2TCoords); - break; - case video::EVT_TANGENTS: - vertexSize = sizeof(video::S3DVertexTangents); - break; - } - u8 *vertices = (u8*)mb->getVertices() ; - - for (u32 j=0; j < mb->getVertexCount(); ++j) - { - u8 *buf = vertices + j * vertexSize; - const video::S3DVertex* vertex = ( (video::S3DVertex*)buf ); - const core::vector3df& pos = vertex->Pos; - const core::vector3df& n = vertex->Normal; - const core::vector2df& uv = vertex->TCoords; - const video::SColor& color = vertex->Color; - - if (flags & scene::EMWF_WRITE_BINARY) - { - // Y and Z are flipped - file->write(&pos.X, 4); - file->write(&pos.Z, 4); - file->write(&pos.Y, 4); - - file->write(&n.X, 4); - file->write(&n.Z, 4); - file->write(&n.Y, 4); - - file->write(&uv, 8); - - const u32 r = color.getRed(), g = color.getGreen(), b = color.getBlue(); - file->write(&r, 1); - file->write(&g, 1); - file->write(&b, 1); - } - else - { - // x y z nx ny nz u v red green blue [u1 v1 | tx ty tz]\n - snprintf_irr(outLine, 1024, - "%f %f %f %f %f %f %f %f %d %d %d\n",// %u %u %u %u %f %f\n", - pos.X, pos.Z, pos.Y, // Y and Z are flipped - n.X, n.Z, n.Y, - uv.X, uv.Y, - color.getRed(), color.getGreen(), color.getBlue()); - - file->write(outLine, strlen(outLine)); - } - } - } - - // index of the first vertex in the current mesh buffer - u32 StartOffset = 0; - - // write triangles - const unsigned char nbIndicesParFace = 3; - for (u32 i=0; i < mesh->getMeshBufferCount(); ++i) - { - scene::IMeshBuffer* mb = mesh->getMeshBuffer(i); - for (u32 j=0; j < mb->getIndexCount(); j+=3) - { - // y and z are flipped so triangles are reversed - u32 a=StartOffset; - u32 b=StartOffset; - u32 c=StartOffset; - - switch(mb->getIndexType()) - { - case video::EIT_16BIT: - a += mb->getIndices()[j+0]; - c += mb->getIndices()[j+1]; - b += mb->getIndices()[j+2]; - break; - case video::EIT_32BIT: - a += ((u32*)mb->getIndices()) [j+0]; - c += ((u32*)mb->getIndices()) [j+1]; - b += ((u32*)mb->getIndices()) [j+2]; - break; - } - - if (flags & scene::EMWF_WRITE_BINARY) - { - file->write(&nbIndicesParFace, 1); - file->write(&a, 4); - file->write(&b, 4); - file->write(&c, 4); - } - else - { - // count a b c\n - snprintf_irr(outLine, 1024, "3 %u %u %u\n", a, b, c); - file->write(outLine, strlen(outLine)); - } - } - - // increment offset - StartOffset += mb->getVertexCount(); - } - - // all done! - return true; -} - -} // end namespace -} // end namespace - -#endif // _IRR_COMPILE_WITH_PLY_WRITER_ - diff --git a/source/Irrlicht/CPLYMeshWriter.h b/source/Irrlicht/CPLYMeshWriter.h deleted file mode 100644 index d87a1d05..00000000 --- a/source/Irrlicht/CPLYMeshWriter.h +++ /dev/null @@ -1,35 +0,0 @@ -// Copyright (C) 2009-2012 Gaz Davidson -// This file is part of the "Irrlicht Engine". -// For conditions of distribution and use, see copyright notice in irrlicht.h - -#ifndef __IRR_PLY_MESH_WRITER_H_INCLUDED__ -#define __IRR_PLY_MESH_WRITER_H_INCLUDED__ - -#include "IMeshWriter.h" - -namespace irr -{ - -namespace scene -{ - class IMeshBuffer; - - //! class to write PLY mesh files - class CPLYMeshWriter : public IMeshWriter - { - public: - - CPLYMeshWriter(); - - //! 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_; - - }; - -} // end namespace -} // end namespace - -#endif diff --git a/source/Irrlicht/CPakReader.cpp b/source/Irrlicht/CPakReader.cpp deleted file mode 100644 index 7b968425..00000000 --- a/source/Irrlicht/CPakReader.cpp +++ /dev/null @@ -1,196 +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 -// Code contributed by skreamz - -#include "CPakReader.h" - -#ifdef __IRR_COMPILE_WITH_PAK_ARCHIVE_LOADER_ - -#include "os.h" -#include "coreutil.h" - -namespace irr -{ -namespace io -{ - -namespace -{ - -inline bool isHeaderValid(const SPAKFileHeader& header) -{ - const c8* tag = header.tag; - return tag[0] == 'P' && - tag[1] == 'A' && - tag[2] == 'C' && - tag[3] == 'K'; -} - -} // end namespace - -//! Constructor -CArchiveLoaderPAK::CArchiveLoaderPAK( io::IFileSystem* fs) -: FileSystem(fs) -{ -#ifdef _DEBUG - setDebugName("CArchiveLoaderPAK"); -#endif -} - - -//! returns true if the file maybe is able to be loaded by this class -bool CArchiveLoaderPAK::isALoadableFileFormat(const io::path& filename) const -{ - return core::hasFileExtension(filename, "pak"); -} - -//! Check to see if the loader can create archives of this type. -bool CArchiveLoaderPAK::isALoadableFileFormat(E_FILE_ARCHIVE_TYPE fileType) const -{ - return fileType == EFAT_PAK; -} - -//! Creates an archive from the filename -/** \param file File handle to check. -\return Pointer to newly created archive, or 0 upon error. */ -IFileArchive* CArchiveLoaderPAK::createArchive(const io::path& filename, bool ignoreCase, bool ignorePaths) const -{ - IFileArchive *archive = 0; - io::IReadFile* file = FileSystem->createAndOpenFile(filename); - - if (file) - { - archive = createArchive(file, ignoreCase, ignorePaths); - file->drop (); - } - - return archive; -} - -//! creates/loads an archive from the file. -//! \return Pointer to the created archive. Returns 0 if loading failed. -IFileArchive* CArchiveLoaderPAK::createArchive(io::IReadFile* file, bool ignoreCase, bool ignorePaths) const -{ - IFileArchive *archive = 0; - if ( file ) - { - file->seek ( 0 ); - archive = new CPakReader(file, ignoreCase, ignorePaths); - } - return archive; -} - - -//! Check if the file might be loaded by this class -/** Check might look into the file. -\param file File handle to check. -\return True if file seems to be loadable. */ -bool CArchiveLoaderPAK::isALoadableFileFormat(io::IReadFile* file) const -{ - SPAKFileHeader header; - - file->read(&header, sizeof(header)); - - return isHeaderValid(header); -} - - -/*! - PAK Reader -*/ -CPakReader::CPakReader(IReadFile* file, bool ignoreCase, bool ignorePaths) -: CFileList((file ? file->getFileName() : io::path("")), ignoreCase, ignorePaths), File(file) -{ -#ifdef _DEBUG - setDebugName("CPakReader"); -#endif - - if (File) - { - File->grab(); - scanLocalHeader(); - sort(); - } -} - - -CPakReader::~CPakReader() -{ - if (File) - File->drop(); -} - - -const IFileList* CPakReader::getFileList() const -{ - return this; -} - -bool CPakReader::scanLocalHeader() -{ - SPAKFileHeader header; - - // Read and validate the header - File->read(&header, sizeof(header)); - if (!isHeaderValid(header)) - return false; - - // Seek to the table of contents -#ifdef __BIG_ENDIAN__ - header.offset = os::Byteswap::byteswap(header.offset); - header.length = os::Byteswap::byteswap(header.length); -#endif - File->seek(header.offset); - - const int numberOfFiles = header.length / sizeof(SPAKFileEntry); - - // Loop through each entry in the table of contents - for(int i = 0; i < numberOfFiles; i++) - { - // read an entry - SPAKFileEntry entry; - File->read(&entry, sizeof(entry)); - -#ifdef _DEBUG - os::Printer::log(entry.name); -#endif - -#ifdef __BIG_ENDIAN__ - entry.offset = os::Byteswap::byteswap(entry.offset); - entry.length = os::Byteswap::byteswap(entry.length); -#endif - - addItem(io::path(entry.name), entry.offset, entry.length, false ); - } - return true; -} - - -//! opens a file by file name -IReadFile* CPakReader::createAndOpenFile(const io::path& filename) -{ - s32 index = findFile(filename, false); - - if (index != -1) - return createAndOpenFile(index); - - return 0; -} - - -//! opens a file by index -IReadFile* CPakReader::createAndOpenFile(u32 index) -{ - if (index >= Files.size() ) - return 0; - - const SFileListEntry &entry = Files[index]; - return createLimitReadFile( entry.FullName, File, entry.Offset, entry.Size ); -} - -} // end namespace io -} // end namespace irr - -#endif // __IRR_COMPILE_WITH_PAK_ARCHIVE_LOADER_ - diff --git a/source/Irrlicht/CPakReader.h b/source/Irrlicht/CPakReader.h deleted file mode 100644 index 2301b170..00000000 --- a/source/Irrlicht/CPakReader.h +++ /dev/null @@ -1,122 +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_PAK_READER_H_INCLUDED__ -#define __C_PAK_READER_H_INCLUDED__ - -#include "IrrCompileConfig.h" - -#ifdef __IRR_COMPILE_WITH_PAK_ARCHIVE_LOADER_ - -#include "IReferenceCounted.h" -#include "IReadFile.h" -#include "irrArray.h" -#include "irrString.h" -#include "IFileSystem.h" -#include "CFileList.h" - -namespace irr -{ -namespace io -{ - //! File header containing location and size of the table of contents - struct SPAKFileHeader - { - // Don't change the order of these fields! They must match the order stored on disk. - c8 tag[4]; - u32 offset; - u32 length; - }; - - //! An entry in the PAK file's table of contents. - struct SPAKFileEntry - { - // Don't change the order of these fields! They must match the order stored on disk. - c8 name[56]; - u32 offset; - u32 length; - }; - - //! Archiveloader capable of loading PAK Archives - class CArchiveLoaderPAK : public IArchiveLoader - { - public: - - //! Constructor - CArchiveLoaderPAK(io::IFileSystem* fs); - - //! returns true if the file maybe is able to be loaded by this class - //! based on the file extension (e.g. ".zip") - virtual bool isALoadableFileFormat(const io::path& filename) const _IRR_OVERRIDE_; - - //! Check if the file might be loaded by this class - /** Check might look into the file. - \param file File handle to check. - \return True if file seems to be loadable. */ - virtual bool isALoadableFileFormat(io::IReadFile* file) const _IRR_OVERRIDE_; - - //! Check to see if the loader can create archives of this type. - /** Check based on the archive type. - \param fileType The archive type to check. - \return True if the archile loader supports this type, false if not */ - virtual bool isALoadableFileFormat(E_FILE_ARCHIVE_TYPE fileType) const _IRR_OVERRIDE_; - - //! Creates an archive from the filename - /** \param file File handle to check. - \return Pointer to newly created archive, or 0 upon error. */ - virtual IFileArchive* createArchive(const io::path& filename, bool ignoreCase, bool ignorePaths) const _IRR_OVERRIDE_; - - //! creates/loads an archive from the file. - //! \return Pointer to the created archive. Returns 0 if loading failed. - virtual io::IFileArchive* createArchive(io::IReadFile* file, bool ignoreCase, bool ignorePaths) const _IRR_OVERRIDE_; - - private: - io::IFileSystem* FileSystem; - }; - - - //! reads from pak - class CPakReader : public virtual IFileArchive, virtual CFileList - { - public: - - CPakReader(IReadFile* file, bool ignoreCase, bool ignorePaths); - virtual ~CPakReader(); - - // file archive methods - - //! return the id of the file Archive - virtual const io::path& getArchiveName() const _IRR_OVERRIDE_ - { - return File->getFileName(); - } - - //! opens a file by file name - virtual IReadFile* createAndOpenFile(const io::path& filename) _IRR_OVERRIDE_; - - //! opens a file by index - virtual IReadFile* createAndOpenFile(u32 index) _IRR_OVERRIDE_; - - //! returns the list of files - virtual const IFileList* getFileList() const _IRR_OVERRIDE_; - - //! get the class Type - virtual E_FILE_ARCHIVE_TYPE getType() const _IRR_OVERRIDE_ { return EFAT_PAK; } - - private: - - //! scans for a local header, returns false if the header is invalid - bool scanLocalHeader(); - - IReadFile* File; - - }; - -} // end namespace io -} // end namespace irr - -#endif // __IRR_COMPILE_WITH_PAK_ARCHIVE_LOADER_ - -#endif // __C_PAK_READER_H_INCLUDED__ - diff --git a/source/Irrlicht/CParticleAnimatedMeshSceneNodeEmitter.cpp b/source/Irrlicht/CParticleAnimatedMeshSceneNodeEmitter.cpp deleted file mode 100644 index c0549916..00000000 --- a/source/Irrlicht/CParticleAnimatedMeshSceneNodeEmitter.cpp +++ /dev/null @@ -1,200 +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 "CParticleAnimatedMeshSceneNodeEmitter.h" -#include "IAnimatedMeshSceneNode.h" -#include "IMesh.h" -#include "os.h" - -namespace irr -{ -namespace scene -{ - -//! constructor -CParticleAnimatedMeshSceneNodeEmitter::CParticleAnimatedMeshSceneNodeEmitter( - IAnimatedMeshSceneNode* node, bool useNormalDirection, - const core::vector3df& direction, f32 normalDirectionModifier, - s32 mbNumber, bool everyMeshVertex, - u32 minParticlesPerSecond, u32 maxParticlesPerSecond, - const video::SColor& minStartColor, const video::SColor& maxStartColor, - u32 lifeTimeMin, u32 lifeTimeMax, s32 maxAngleDegrees, - const core::dimension2df& minStartSize, const core::dimension2df& maxStartSize ) - : Node(0), AnimatedMesh(0), BaseMesh(0), TotalVertices(0), MBCount(0), MBNumber(mbNumber), - Direction(direction), NormalDirectionModifier(normalDirectionModifier), - MinParticlesPerSecond(minParticlesPerSecond), MaxParticlesPerSecond(maxParticlesPerSecond), - MinStartColor(minStartColor), MaxStartColor(maxStartColor), - MinLifeTime(lifeTimeMin), MaxLifeTime(lifeTimeMax), - MaxStartSize(maxStartSize), MinStartSize(minStartSize), - Time(0), MaxAngleDegrees(maxAngleDegrees), - EveryMeshVertex(everyMeshVertex), UseNormalDirection(useNormalDirection) -{ - #ifdef _DEBUG - setDebugName("CParticleAnimatedMeshSceneNodeEmitter"); - #endif - setAnimatedMeshSceneNode(node); -} - - -//! Prepares an array with new particles to emitt into the system -//! and returns how much new particles there are. -s32 CParticleAnimatedMeshSceneNodeEmitter::emitt(u32 now, u32 timeSinceLastCall, SParticle*& outArray) -{ - Time += timeSinceLastCall; - - const u32 pps = (MaxParticlesPerSecond - MinParticlesPerSecond); - const f32 perSecond = pps ? ((f32)MinParticlesPerSecond + os::Randomizer::frand() * pps) : MinParticlesPerSecond; - const f32 everyWhatMillisecond = 1000.0f / perSecond; - - if(Time > everyWhatMillisecond) - { - Particles.set_used(0); - u32 amount = (u32)((Time / everyWhatMillisecond) + 0.5f); - Time = 0; - SParticle p; - - if(amount > MaxParticlesPerSecond * 2) - amount = MaxParticlesPerSecond * 2; - - // Get Mesh for this frame - IMesh* frameMesh = AnimatedMesh->getMesh( core::floor32(Node->getFrameNr()), - 255, Node->getStartFrame(), Node->getEndFrame() ); - for(u32 i=0; i<amount; ++i) - { - if( EveryMeshVertex ) - { - for( u32 j=0; j<frameMesh->getMeshBufferCount(); ++j ) - { - for( u32 k=0; k<frameMesh->getMeshBuffer(j)->getVertexCount(); ++k ) - { - p.pos = frameMesh->getMeshBuffer(j)->getPosition(k); - if( UseNormalDirection ) - p.vector = frameMesh->getMeshBuffer(j)->getNormal(k) / - NormalDirectionModifier; - else - p.vector = Direction; - - p.startTime = now; - - if( MaxAngleDegrees ) - { - core::vector3df tgt = p.vector; - tgt.rotateXYBy(os::Randomizer::frand() * MaxAngleDegrees); - tgt.rotateYZBy(os::Randomizer::frand() * MaxAngleDegrees); - tgt.rotateXZBy(os::Randomizer::frand() * MaxAngleDegrees); - p.vector = tgt; - } - - p.endTime = now + MinLifeTime; - if (MaxLifeTime != MinLifeTime) - p.endTime += os::Randomizer::rand() % (MaxLifeTime - MinLifeTime); - - if (MinStartColor==MaxStartColor) - p.color=MinStartColor; - else - p.color = MinStartColor.getInterpolated(MaxStartColor, os::Randomizer::frand()); - - p.startColor = p.color; - p.startVector = p.vector; - - if (MinStartSize==MaxStartSize) - p.startSize = MinStartSize; - else - p.startSize = MinStartSize.getInterpolated(MaxStartSize, os::Randomizer::frand()); - p.size = p.startSize; - - Particles.push_back(p); - } - } - } - else - { - s32 randomMB = 0; - if( MBNumber < 0 ) - randomMB = os::Randomizer::rand() % MBCount; - else - randomMB = MBNumber; - - u32 vertexNumber = frameMesh->getMeshBuffer(randomMB)->getVertexCount(); - if (!vertexNumber) - continue; - vertexNumber = os::Randomizer::rand() % vertexNumber; - - p.pos = frameMesh->getMeshBuffer(randomMB)->getPosition(vertexNumber); - if( UseNormalDirection ) - p.vector = frameMesh->getMeshBuffer(randomMB)->getNormal(vertexNumber) / - NormalDirectionModifier; - else - p.vector = Direction; - - p.startTime = now; - - if( MaxAngleDegrees ) - { - core::vector3df tgt = Direction; - tgt.rotateXYBy(os::Randomizer::frand() * MaxAngleDegrees); - tgt.rotateYZBy(os::Randomizer::frand() * MaxAngleDegrees); - tgt.rotateXZBy(os::Randomizer::frand() * MaxAngleDegrees); - p.vector = tgt; - } - - p.endTime = now + MinLifeTime; - if (MaxLifeTime != MinLifeTime) - p.endTime += os::Randomizer::rand() % (MaxLifeTime - MinLifeTime); - - if (MinStartColor==MaxStartColor) - p.color=MinStartColor; - else - p.color = MinStartColor.getInterpolated(MaxStartColor, os::Randomizer::frand()); - - p.startColor = p.color; - p.startVector = p.vector; - - if (MinStartSize==MaxStartSize) - p.startSize = MinStartSize; - else - p.startSize = MinStartSize.getInterpolated(MaxStartSize, os::Randomizer::frand()); - p.size = p.startSize; - - Particles.push_back(p); - } - } - - outArray = Particles.pointer(); - - return Particles.size(); - } - - return 0; -} - - -//! Set Mesh to emit particles from -void CParticleAnimatedMeshSceneNodeEmitter::setAnimatedMeshSceneNode( IAnimatedMeshSceneNode* node ) -{ - Node = node; - AnimatedMesh = 0; - BaseMesh = 0; - TotalVertices = 0; - VertexPerMeshBufferList.clear(); - if ( !node ) - { - return; - } - - AnimatedMesh = node->getMesh(); - BaseMesh = AnimatedMesh->getMesh(0); - - MBCount = BaseMesh->getMeshBufferCount(); - VertexPerMeshBufferList.reallocate(MBCount); - for( u32 i = 0; i < MBCount; ++i ) - { - VertexPerMeshBufferList.push_back( BaseMesh->getMeshBuffer(i)->getVertexCount() ); - TotalVertices += BaseMesh->getMeshBuffer(i)->getVertexCount(); - } -} - -} // end namespace scene -} // end namespace irr - diff --git a/source/Irrlicht/CParticleAnimatedMeshSceneNodeEmitter.h b/source/Irrlicht/CParticleAnimatedMeshSceneNodeEmitter.h deleted file mode 100644 index 176abf97..00000000 --- a/source/Irrlicht/CParticleAnimatedMeshSceneNodeEmitter.h +++ /dev/null @@ -1,160 +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_PARTICLE_ANIMATED_MESH_SCENE_NODE_EMITTER_H_INCLUDED__ -#define __C_PARTICLE_ANIMATED_MESH_SCENE_NODE_EMITTER_H_INCLUDED__ - -#include "IParticleAnimatedMeshSceneNodeEmitter.h" -#include "irrArray.h" - -namespace irr -{ -namespace scene -{ - -//! An animated mesh emitter -class CParticleAnimatedMeshSceneNodeEmitter : public IParticleAnimatedMeshSceneNodeEmitter -{ -public: - - //! constructor - CParticleAnimatedMeshSceneNodeEmitter( - IAnimatedMeshSceneNode* node, - bool useNormalDirection = true, - const core::vector3df& direction = core::vector3df(0.0f,0.0f,-1.0f), - f32 normalDirectionModifier = 100.0f, - s32 mbNumber = -1, - bool everyMeshVertex = false, - u32 minParticlesPerSecond = 20, - u32 maxParticlesPerSecond = 40, - const video::SColor& minStartColor = video::SColor(255,0,0,0), - const video::SColor& maxStartColor = video::SColor(255,255,255,255), - u32 lifeTimeMin = 2000, - u32 lifeTimeMax = 4000, - s32 maxAngleDegrees = 0, - const core::dimension2df& minStartSize = core::dimension2df(5.0f,5.0f), - const core::dimension2df& maxStartSize = core::dimension2df(5.0f,5.0f) - ); - - //! Prepares an array with new particles to emitt into the system - //! and returns how much new particles there are. - virtual s32 emitt(u32 now, u32 timeSinceLastCall, SParticle*& outArray) _IRR_OVERRIDE_; - - //! Set Mesh to emit particles from - virtual void setAnimatedMeshSceneNode( IAnimatedMeshSceneNode* node ) _IRR_OVERRIDE_; - - //! Set whether to use vertex normal for direction, or direction specified - virtual void setUseNormalDirection( bool useNormalDirection ) _IRR_OVERRIDE_ { UseNormalDirection = useNormalDirection; } - - //! Set direction the emitter emits particles - virtual void setDirection( const core::vector3df& newDirection ) _IRR_OVERRIDE_ { Direction = newDirection; } - - //! Set the amount that the normal is divided by for getting a particles direction - virtual void setNormalDirectionModifier( f32 normalDirectionModifier ) _IRR_OVERRIDE_ { NormalDirectionModifier = normalDirectionModifier; } - - //! Sets whether to emit min<->max particles for every vertex per second, or to pick - //! min<->max vertices every second - virtual void setEveryMeshVertex( bool everyMeshVertex ) _IRR_OVERRIDE_ { EveryMeshVertex = everyMeshVertex; } - - //! Set minimum number of particles the emitter emits per second - virtual void setMinParticlesPerSecond( u32 minPPS ) _IRR_OVERRIDE_ { MinParticlesPerSecond = minPPS; } - - //! Set maximum number of particles the emitter emits per second - virtual void setMaxParticlesPerSecond( u32 maxPPS ) _IRR_OVERRIDE_ { MaxParticlesPerSecond = maxPPS; } - - //! Set minimum starting color for particles - virtual void setMinStartColor( const video::SColor& color ) _IRR_OVERRIDE_ { MinStartColor = color; } - - //! Set maximum starting color for particles - virtual void setMaxStartColor( const video::SColor& color ) _IRR_OVERRIDE_ { MaxStartColor = color; } - - //! Set the maximum starting size for particles - virtual void setMaxStartSize( const core::dimension2df& size ) _IRR_OVERRIDE_ { MaxStartSize = size; } - - //! Set the minimum starting size for particles - virtual void setMinStartSize( const core::dimension2df& size ) _IRR_OVERRIDE_ { MinStartSize = size; } - - //! Set the minimum particle life-time in milliseconds - virtual void setMinLifeTime( u32 lifeTimeMin ) _IRR_OVERRIDE_ { MinLifeTime = lifeTimeMin; } - - //! Set the maximum particle life-time in milliseconds - virtual void setMaxLifeTime( u32 lifeTimeMax ) _IRR_OVERRIDE_ { MaxLifeTime = lifeTimeMax; } - - //! Maximal random derivation from the direction - virtual void setMaxAngleDegrees( s32 maxAngleDegrees ) _IRR_OVERRIDE_ { MaxAngleDegrees = maxAngleDegrees; } - - //! Get Mesh we're emitting particles from - virtual const IAnimatedMeshSceneNode* getAnimatedMeshSceneNode() const _IRR_OVERRIDE_ { return Node; } - - //! Get whether to use vertex normal for direciton, or direction specified - virtual bool isUsingNormalDirection() const _IRR_OVERRIDE_ { return UseNormalDirection; } - - //! Get direction the emitter emits particles - virtual const core::vector3df& getDirection() const _IRR_OVERRIDE_ { return Direction; } - - //! Get the amount that the normal is divided by for getting a particles direction - virtual f32 getNormalDirectionModifier() const _IRR_OVERRIDE_ { return NormalDirectionModifier; } - - //! Gets whether to emit min<->max particles for every vertex per second, or to pick - //! min<->max vertices every second - virtual bool getEveryMeshVertex() const _IRR_OVERRIDE_ { return EveryMeshVertex; } - - //! Get the minimum number of particles the emitter emits per second - virtual u32 getMinParticlesPerSecond() const _IRR_OVERRIDE_ { return MinParticlesPerSecond; } - - //! Get the maximum number of particles the emitter emits per second - virtual u32 getMaxParticlesPerSecond() const _IRR_OVERRIDE_ { return MaxParticlesPerSecond; } - - //! Get the minimum starting color for particles - virtual const video::SColor& getMinStartColor() const _IRR_OVERRIDE_ { return MinStartColor; } - - //! Get the maximum starting color for particles - virtual const video::SColor& getMaxStartColor() const _IRR_OVERRIDE_ { return MaxStartColor; } - - //! Get the maximum starting size for particles - virtual const core::dimension2df& getMaxStartSize() const _IRR_OVERRIDE_ { return MaxStartSize; } - - //! Get the minimum starting size for particles - virtual const core::dimension2df& getMinStartSize() const _IRR_OVERRIDE_ { return MinStartSize; } - - //! Get the minimum particle life-time in milliseconds - virtual u32 getMinLifeTime() const _IRR_OVERRIDE_ { return MinLifeTime; } - - //! Get the maximum particle life-time in milliseconds - virtual u32 getMaxLifeTime() const _IRR_OVERRIDE_ { return MaxLifeTime; } - - //! Maximal random derivation from the direction - virtual s32 getMaxAngleDegrees() const _IRR_OVERRIDE_ { return MaxAngleDegrees; } - -private: - - IAnimatedMeshSceneNode* Node; - IAnimatedMesh* AnimatedMesh; - const IMesh* BaseMesh; - s32 TotalVertices; - u32 MBCount; - s32 MBNumber; - core::array<s32> VertexPerMeshBufferList; - - core::array<SParticle> Particles; - core::vector3df Direction; - f32 NormalDirectionModifier; - u32 MinParticlesPerSecond, MaxParticlesPerSecond; - video::SColor MinStartColor, MaxStartColor; - u32 MinLifeTime, MaxLifeTime; - core::dimension2df MaxStartSize, MinStartSize; - - u32 Time; - s32 MaxAngleDegrees; - - bool EveryMeshVertex; - bool UseNormalDirection; -}; - -} // end namespace scene -} // end namespace irr - - -#endif // __C_PARTICLE_ANIMATED_MESH_SCENE_NODE_EMITTER_H_INCLUDED__ - diff --git a/source/Irrlicht/CParticleAttractionAffector.cpp b/source/Irrlicht/CParticleAttractionAffector.cpp deleted file mode 100644 index 8ae7367e..00000000 --- a/source/Irrlicht/CParticleAttractionAffector.cpp +++ /dev/null @@ -1,88 +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 "CParticleAttractionAffector.h" - -#ifdef _IRR_COMPILE_WITH_PARTICLES_ - -#include "IAttributes.h" - -namespace irr -{ -namespace scene -{ - -//! constructor -CParticleAttractionAffector::CParticleAttractionAffector( - const core::vector3df& point, f32 speed, bool attract, - bool affectX, bool affectY, bool affectZ ) - : Point(point), Speed(speed), AffectX(affectX), AffectY(affectY), - AffectZ(affectZ), Attract(attract), LastTime(0) -{ - #ifdef _DEBUG - setDebugName("CParticleAttractionAffector"); - #endif -} - - -//! Affects an array of particles. -void CParticleAttractionAffector::affect(u32 now, SParticle* particlearray, u32 count) -{ - if( LastTime == 0 ) - { - LastTime = now; - return; - } - - f32 timeDelta = ( now - LastTime ) / 1000.0f; - LastTime = now; - - if( !Enabled ) - return; - - for(u32 i=0; i<count; ++i) - { - core::vector3df direction = (Point - particlearray[i].pos).normalize(); - direction *= Speed * timeDelta; - - if( !Attract ) - direction *= -1.0f; - - if( AffectX ) - particlearray[i].pos.X += direction.X; - - if( AffectY ) - particlearray[i].pos.Y += direction.Y; - - if( AffectZ ) - particlearray[i].pos.Z += direction.Z; - } -} - -//! Writes attributes of the object. -void CParticleAttractionAffector::serializeAttributes(io::IAttributes* out, io::SAttributeReadWriteOptions* options) const -{ - out->addVector3d("Point", Point); - out->addFloat("Speed", Speed); - out->addBool("AffectX", AffectX); - out->addBool("AffectY", AffectY); - out->addBool("AffectZ", AffectZ); - out->addBool("Attract", Attract); -} - -//! Reads attributes of the object. -void CParticleAttractionAffector::deserializeAttributes(io::IAttributes* in, io::SAttributeReadWriteOptions* options) -{ - Point = in->getAttributeAsVector3d("Point"); - Speed = in->getAttributeAsFloat("Speed"); - AffectX = in->getAttributeAsBool("AffectX"); - AffectY = in->getAttributeAsBool("AffectY"); - AffectZ = in->getAttributeAsBool("AffectZ"); - Attract = in->getAttributeAsBool("Attract"); -} - -} // end namespace scene -} // end namespace irr - -#endif // _IRR_COMPILE_WITH_PARTICLES_ diff --git a/source/Irrlicht/CParticleAttractionAffector.h b/source/Irrlicht/CParticleAttractionAffector.h deleted file mode 100644 index 6e126cd9..00000000 --- a/source/Irrlicht/CParticleAttractionAffector.h +++ /dev/null @@ -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_PARTICLE_ATTRACTION_AFFECTOR_H_INCLUDED__ -#define __C_PARTICLE_ATTRACTION_AFFECTOR_H_INCLUDED__ - -#include "IrrCompileConfig.h" -#ifdef _IRR_COMPILE_WITH_PARTICLES_ - -#include "IParticleAttractionAffector.h" - -namespace irr -{ -namespace scene -{ - -//! Particle Affector for attracting particles to a point -class CParticleAttractionAffector : public IParticleAttractionAffector -{ -public: - - CParticleAttractionAffector( - const core::vector3df& point = core::vector3df(), f32 speed = 1.0f, - bool attract = true, bool affectX = true, - bool affectY = true, bool affectZ = true ); - - //! Affects a particle. - virtual void affect(u32 now, SParticle* particlearray, u32 count) _IRR_OVERRIDE_; - - //! Set the point that particles will attract to - virtual void setPoint( const core::vector3df& point ) _IRR_OVERRIDE_ { Point = point; } - - //! Set the speed, in game units per second that the particles will attract to the specified point - virtual void setSpeed( f32 speed ) _IRR_OVERRIDE_ { Speed = speed; } - - //! Set whether or not the particles are attracting or detracting - virtual void setAttract( bool attract ) _IRR_OVERRIDE_ { Attract = attract; } - - //! Set whether or not this will affect particles in the X direction - virtual void setAffectX( bool affect ) _IRR_OVERRIDE_ { AffectX = affect; } - - //! Set whether or not this will affect particles in the Y direction - virtual void setAffectY( bool affect ) _IRR_OVERRIDE_ { AffectY = affect; } - - //! Set whether or not this will affect particles in the Z direction - virtual void setAffectZ( bool affect ) _IRR_OVERRIDE_ { AffectZ = affect; } - - //! Get the point that particles are attracted to - virtual const core::vector3df& getPoint() const _IRR_OVERRIDE_ { return Point; } - - //! Get the speed that points attract to the specified point - virtual f32 getSpeed() const _IRR_OVERRIDE_ { return Speed; } - - //! Get whether or not the particles are attracting or detracting - virtual bool getAttract() const _IRR_OVERRIDE_ { return Attract; } - - //! Get whether or not the particles X position are affected - virtual bool getAffectX() const _IRR_OVERRIDE_ { return AffectX; } - - //! Get whether or not the particles Y position are affected - virtual bool getAffectY() const _IRR_OVERRIDE_ { return AffectY; } - - //! Get whether or not the particles Z position are affected - virtual bool getAffectZ() const _IRR_OVERRIDE_ { return AffectZ; } - - //! Writes attributes of the object. - virtual void serializeAttributes(io::IAttributes* out, io::SAttributeReadWriteOptions* options) const _IRR_OVERRIDE_; - - //! Reads attributes of the object. - virtual void deserializeAttributes(io::IAttributes* in, io::SAttributeReadWriteOptions* options) _IRR_OVERRIDE_; - -private: - - core::vector3df Point; - f32 Speed; - bool AffectX; - bool AffectY; - bool AffectZ; - bool Attract; - u32 LastTime; -}; - -} // end namespace scene -} // end namespace irr - -#endif // _IRR_COMPILE_WITH_PARTICLES_ - -#endif // __C_PARTICLE_ATTRACTION_AFFECTOR_H_INCLUDED__ - diff --git a/source/Irrlicht/CParticleBoxEmitter.cpp b/source/Irrlicht/CParticleBoxEmitter.cpp deleted file mode 100644 index 1ff40ee7..00000000 --- a/source/Irrlicht/CParticleBoxEmitter.cpp +++ /dev/null @@ -1,192 +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 "CParticleBoxEmitter.h" - -#ifdef _IRR_COMPILE_WITH_PARTICLES_ - -#include "os.h" -#include "IAttributes.h" -#include "irrMath.h" - -namespace irr -{ -namespace scene -{ - -//! constructor -CParticleBoxEmitter::CParticleBoxEmitter( - const core::aabbox3df& box, const core::vector3df& direction, - u32 minParticlesPerSecond, u32 maxParticlesPerSecond, - video::SColor minStartColor, video::SColor maxStartColor, - u32 lifeTimeMin, u32 lifeTimeMax, s32 maxAngleDegrees, - const core::dimension2df& minStartSize, const core::dimension2df& maxStartSize) - : Box(box), Direction(direction), - MaxStartSize(maxStartSize), MinStartSize(minStartSize), - MinParticlesPerSecond(minParticlesPerSecond), - MaxParticlesPerSecond(maxParticlesPerSecond), - MinStartColor(minStartColor), MaxStartColor(maxStartColor), - MinLifeTime(lifeTimeMin), MaxLifeTime(lifeTimeMax), - Time(0), MaxAngleDegrees(maxAngleDegrees) -{ - #ifdef _DEBUG - setDebugName("CParticleBoxEmitter"); - #endif -} - - -//! Prepares an array with new particles to emitt into the system -//! and returns how much new particles there are. -s32 CParticleBoxEmitter::emitt(u32 now, u32 timeSinceLastCall, SParticle*& outArray) -{ - Time += timeSinceLastCall; - - const u32 pps = (MaxParticlesPerSecond - MinParticlesPerSecond); - const f32 perSecond = pps ? ((f32)MinParticlesPerSecond + os::Randomizer::frand() * pps) : MinParticlesPerSecond; - const f32 everyWhatMillisecond = 1000.0f / perSecond; - - if (Time > everyWhatMillisecond) - { - Particles.set_used(0); - u32 amount = (u32)((Time / everyWhatMillisecond) + 0.5f); - Time = 0; - SParticle p; - const core::vector3df& extent = Box.getExtent(); - - if (amount > MaxParticlesPerSecond*2) - amount = MaxParticlesPerSecond * 2; - - for (u32 i=0; i<amount; ++i) - { - p.pos.X = Box.MinEdge.X + os::Randomizer::frand() * extent.X; - p.pos.Y = Box.MinEdge.Y + os::Randomizer::frand() * extent.Y; - p.pos.Z = Box.MinEdge.Z + os::Randomizer::frand() * extent.Z; - - p.startTime = now; - p.vector = Direction; - - if (MaxAngleDegrees) - { - core::vector3df tgt = Direction; - tgt.rotateXYBy(os::Randomizer::frand() * MaxAngleDegrees); - tgt.rotateYZBy(os::Randomizer::frand() * MaxAngleDegrees); - tgt.rotateXZBy(os::Randomizer::frand() * MaxAngleDegrees); - p.vector = tgt; - } - - p.endTime = now + MinLifeTime; - if (MaxLifeTime != MinLifeTime) - p.endTime += os::Randomizer::rand() % (MaxLifeTime - MinLifeTime); - - if (MinStartColor==MaxStartColor) - p.color=MinStartColor; - else - p.color = MinStartColor.getInterpolated(MaxStartColor, os::Randomizer::frand()); - - p.startColor = p.color; - p.startVector = p.vector; - - if (MinStartSize==MaxStartSize) - p.startSize = MinStartSize; - else - p.startSize = MinStartSize.getInterpolated(MaxStartSize, os::Randomizer::frand()); - p.size = p.startSize; - - Particles.push_back(p); - } - - outArray = Particles.pointer(); - - return Particles.size(); - } - - return 0; -} - - -//! Writes attributes of the object. -void CParticleBoxEmitter::serializeAttributes(io::IAttributes* out, io::SAttributeReadWriteOptions* options) const -{ - core::vector3df b = Box.getExtent(); - b *= 0.5f; - out->addVector3d("Box", b); - out->addVector3d("Direction", Direction); - out->addFloat("MinStartSizeWidth", MinStartSize.Width); - out->addFloat("MinStartSizeHeight", MinStartSize.Height); - out->addFloat("MaxStartSizeWidth", MaxStartSize.Width); - out->addFloat("MaxStartSizeHeight", MaxStartSize.Height); - out->addInt("MinParticlesPerSecond", MinParticlesPerSecond); - out->addInt("MaxParticlesPerSecond", MaxParticlesPerSecond); - out->addColor("MinStartColor", MinStartColor); - out->addColor("MaxStartColor", MaxStartColor); - out->addInt("MinLifeTime", MinLifeTime); - out->addInt("MaxLifeTime", MaxLifeTime); - out->addInt("MaxAngleDegrees", MaxAngleDegrees); -} - - -//! Reads attributes of the object. -void CParticleBoxEmitter::deserializeAttributes(io::IAttributes* in, io::SAttributeReadWriteOptions* options) -{ - // read data and correct input values here - - core::vector3df b = in->getAttributeAsVector3d("Box"); - - if (b.X <= 0) - b.X = 1.0f; - if (b.Y <= 0) - b.Y = 1.0f; - if (b.Z <= 0) - b.Z = 1.0f; - - Box.MinEdge.X = -b.X; - Box.MinEdge.Y = -b.Y; - Box.MinEdge.Z = -b.Z; - Box.MaxEdge.X = b.X; - Box.MaxEdge.Y = b.Y; - Box.MaxEdge.Z = b.Z; - - Direction = in->getAttributeAsVector3d("Direction"); - if (Direction.getLength() == 0) - Direction.set(0,0.01f,0); - - int idx = -1; - idx = in->findAttribute("MinStartSizeWidth"); - if ( idx >= 0 ) - MinStartSize.Width = in->getAttributeAsFloat(idx); - idx = in->findAttribute("MinStartSizeHeight"); - if ( idx >= 0 ) - MinStartSize.Height = in->getAttributeAsFloat(idx); - idx = in->findAttribute("MaxStartSizeWidth"); - if ( idx >= 0 ) - MaxStartSize.Width = in->getAttributeAsFloat(idx); - idx = in->findAttribute("MaxStartSizeHeight"); - if ( idx >= 0 ) - MaxStartSize.Height = in->getAttributeAsFloat(idx); - - MinParticlesPerSecond = in->getAttributeAsInt("MinParticlesPerSecond"); - MaxParticlesPerSecond = in->getAttributeAsInt("MaxParticlesPerSecond"); - - MinParticlesPerSecond = core::max_(1u, MinParticlesPerSecond); - MaxParticlesPerSecond = core::max_(MaxParticlesPerSecond, 1u); - MaxParticlesPerSecond = core::min_(MaxParticlesPerSecond, 200u); - MinParticlesPerSecond = core::min_(MinParticlesPerSecond, MaxParticlesPerSecond); - - MinStartColor = in->getAttributeAsColor("MinStartColor"); - MaxStartColor = in->getAttributeAsColor("MaxStartColor"); - MinLifeTime = in->getAttributeAsInt("MinLifeTime"); - MaxLifeTime = in->getAttributeAsInt("MaxLifeTime"); - MaxAngleDegrees = in->getAttributeAsInt("MaxAngleDegrees"); - - MinLifeTime = core::max_(0u, MinLifeTime); - MaxLifeTime = core::max_(MaxLifeTime, MinLifeTime); - MinLifeTime = core::min_(MinLifeTime, MaxLifeTime); - -} - - -} // end namespace scene -} // end namespace irr - -#endif // _IRR_COMPILE_WITH_PARTICLES_ diff --git a/source/Irrlicht/CParticleBoxEmitter.h b/source/Irrlicht/CParticleBoxEmitter.h deleted file mode 100644 index 21d8dd3e..00000000 --- a/source/Irrlicht/CParticleBoxEmitter.h +++ /dev/null @@ -1,136 +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_PARTICLE_BOX_EMITTER_H_INCLUDED__ -#define __C_PARTICLE_BOX_EMITTER_H_INCLUDED__ - -#include "IrrCompileConfig.h" -#ifdef _IRR_COMPILE_WITH_PARTICLES_ - -#include "IParticleBoxEmitter.h" -#include "irrArray.h" -#include "aabbox3d.h" - -namespace irr -{ -namespace scene -{ - -//! A default box emitter -class CParticleBoxEmitter : public IParticleBoxEmitter -{ -public: - - //! constructor - CParticleBoxEmitter( - const core::aabbox3df& box, - const core::vector3df& direction = core::vector3df(0.0f,0.03f,0.0f), - u32 minParticlesPerSecond = 20, - u32 maxParticlesPerSecond = 40, - video::SColor minStartColor = video::SColor(255,0,0,0), - video::SColor maxStartColor = video::SColor(255,255,255,255), - u32 lifeTimeMin=2000, - u32 lifeTimeMax=4000, - s32 maxAngleDegrees=0, - const core::dimension2df& minStartSize = core::dimension2df(5.0f,5.0f), - const core::dimension2df& maxStartSize = core::dimension2df(5.0f,5.0f) - ); - - //! Prepares an array with new particles to emitt into the system - //! and returns how much new particles there are. - virtual s32 emitt(u32 now, u32 timeSinceLastCall, SParticle*& outArray) _IRR_OVERRIDE_; - - //! Set direction the emitter emits particles. - virtual void setDirection( const core::vector3df& newDirection ) _IRR_OVERRIDE_ { Direction = newDirection; } - - //! Set minimum number of particles emitted per second. - virtual void setMinParticlesPerSecond( u32 minPPS ) _IRR_OVERRIDE_ { MinParticlesPerSecond = minPPS; } - - //! Set maximum number of particles emitted per second. - virtual void setMaxParticlesPerSecond( u32 maxPPS ) _IRR_OVERRIDE_ { MaxParticlesPerSecond = maxPPS; } - - //! Set minimum start color. - virtual void setMinStartColor( const video::SColor& color ) _IRR_OVERRIDE_ { MinStartColor = color; } - - //! Set maximum start color. - virtual void setMaxStartColor( const video::SColor& color ) _IRR_OVERRIDE_ { MaxStartColor = color; } - - //! Set the maximum starting size for particles - virtual void setMaxStartSize( const core::dimension2df& size ) _IRR_OVERRIDE_ { MaxStartSize = size; } - - //! Set the minimum starting size for particles - virtual void setMinStartSize( const core::dimension2df& size ) _IRR_OVERRIDE_ { MinStartSize = size; } - - //! Set the minimum particle life-time in milliseconds - virtual void setMinLifeTime( u32 lifeTimeMin ) _IRR_OVERRIDE_ { MinLifeTime = lifeTimeMin; } - - //! Set the maximum particle life-time in milliseconds - virtual void setMaxLifeTime( u32 lifeTimeMax ) _IRR_OVERRIDE_ { MaxLifeTime = lifeTimeMax; } - - //! Maximal random derivation from the direction - virtual void setMaxAngleDegrees( s32 maxAngleDegrees ) _IRR_OVERRIDE_ { MaxAngleDegrees = maxAngleDegrees; } - - //! Set box from which the particles are emitted. - virtual void setBox( const core::aabbox3df& box ) _IRR_OVERRIDE_ { Box = box; } - - //! Gets direction the emitter emits particles. - virtual const core::vector3df& getDirection() const _IRR_OVERRIDE_ { return Direction; } - - //! Gets minimum number of particles emitted per second. - virtual u32 getMinParticlesPerSecond() const _IRR_OVERRIDE_ { return MinParticlesPerSecond; } - - //! Gets maximum number of particles emitted per second. - virtual u32 getMaxParticlesPerSecond() const _IRR_OVERRIDE_ { return MaxParticlesPerSecond; } - - //! Gets minimum start color. - virtual const video::SColor& getMinStartColor() const _IRR_OVERRIDE_ { return MinStartColor; } - - //! Gets maximum start color. - virtual const video::SColor& getMaxStartColor() const _IRR_OVERRIDE_ { return MaxStartColor; } - - //! Gets the maximum starting size for particles - virtual const core::dimension2df& getMaxStartSize() const _IRR_OVERRIDE_ { return MaxStartSize; } - - //! Gets the minimum starting size for particles - virtual const core::dimension2df& getMinStartSize() const _IRR_OVERRIDE_ { return MinStartSize; } - - //! Get the minimum particle life-time in milliseconds - virtual u32 getMinLifeTime() const _IRR_OVERRIDE_ { return MinLifeTime; } - - //! Get the maximum particle life-time in milliseconds - virtual u32 getMaxLifeTime() const _IRR_OVERRIDE_ { return MaxLifeTime; } - - //! Maximal random derivation from the direction - virtual s32 getMaxAngleDegrees() const _IRR_OVERRIDE_ { return MaxAngleDegrees; } - - //! Get box from which the particles are emitted. - virtual const core::aabbox3df& getBox() const _IRR_OVERRIDE_ { return Box; } - - //! Writes attributes of the object. - virtual void serializeAttributes(io::IAttributes* out, io::SAttributeReadWriteOptions* options) const _IRR_OVERRIDE_; - - //! Reads attributes of the object. - virtual void deserializeAttributes(io::IAttributes* in, io::SAttributeReadWriteOptions* options) _IRR_OVERRIDE_; - -private: - - core::array<SParticle> Particles; - core::aabbox3df Box; - core::vector3df Direction; - core::dimension2df MaxStartSize, MinStartSize; - u32 MinParticlesPerSecond, MaxParticlesPerSecond; - video::SColor MinStartColor, MaxStartColor; - u32 MinLifeTime, MaxLifeTime; - - u32 Time; - s32 MaxAngleDegrees; -}; - -} // end namespace scene -} // end namespace irr - -#endif // _IRR_COMPILE_WITH_PARTICLES_ - -#endif - diff --git a/source/Irrlicht/CParticleCylinderEmitter.cpp b/source/Irrlicht/CParticleCylinderEmitter.cpp deleted file mode 100644 index a0d0ef2e..00000000 --- a/source/Irrlicht/CParticleCylinderEmitter.cpp +++ /dev/null @@ -1,193 +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 "CParticleCylinderEmitter.h" - -#include "IrrCompileConfig.h" -#ifdef _IRR_COMPILE_WITH_PARTICLES_ - -#include "os.h" -#include "IAttributes.h" - -namespace irr -{ -namespace scene -{ - -//! constructor -CParticleCylinderEmitter::CParticleCylinderEmitter( - const core::vector3df& center, f32 radius, - const core::vector3df& normal, f32 length, - bool outlineOnly, const core::vector3df& direction, - u32 minParticlesPerSecond, u32 maxParticlesPerSecond, - const video::SColor& minStartColor, const video::SColor& maxStartColor, - u32 lifeTimeMin, u32 lifeTimeMax, s32 maxAngleDegrees, - const core::dimension2df& minStartSize, - const core::dimension2df& maxStartSize ) - : Center(center), Normal(normal), Direction(direction), - MaxStartSize(maxStartSize), MinStartSize(minStartSize), - MinParticlesPerSecond(minParticlesPerSecond), - MaxParticlesPerSecond(maxParticlesPerSecond), - MinStartColor(minStartColor), MaxStartColor(maxStartColor), - MinLifeTime(lifeTimeMin), MaxLifeTime(lifeTimeMax), - Radius(radius), Length(length), Time(0), - MaxAngleDegrees(maxAngleDegrees), OutlineOnly(outlineOnly) -{ - #ifdef _DEBUG - setDebugName("CParticleCylinderEmitter"); - #endif -} - - -//! Prepares an array with new particles to emitt into the system -//! and returns how much new particles there are. -s32 CParticleCylinderEmitter::emitt(u32 now, u32 timeSinceLastCall, SParticle*& outArray) -{ - Time += timeSinceLastCall; - - const u32 pps = (MaxParticlesPerSecond - MinParticlesPerSecond); - const f32 perSecond = pps ? ((f32)MinParticlesPerSecond + os::Randomizer::frand() * pps) : MinParticlesPerSecond; - const f32 everyWhatMillisecond = 1000.0f / perSecond; - - if(Time > everyWhatMillisecond) - { - Particles.set_used(0); - u32 amount = (u32)((Time / everyWhatMillisecond) + 0.5f); - Time = 0; - SParticle p; - - if(amount > MaxParticlesPerSecond*2) - amount = MaxParticlesPerSecond * 2; - - for(u32 i=0; i<amount; ++i) - { - // Random distance from center if outline only is not true - const f32 distance = (!OutlineOnly) ? (os::Randomizer::frand() * Radius) : Radius; - - // Random direction from center - p.pos.set(Center.X + distance, Center.Y, Center.Z + distance); - p.pos.rotateXZBy(os::Randomizer::frand() * 360, Center); - - // Random length - const f32 length = os::Randomizer::frand() * Length; - - // Random point along the cylinders length - p.pos += Normal * length; - - p.startTime = now; - p.vector = Direction; - - if( MaxAngleDegrees ) - { - core::vector3df tgt = Direction; - tgt.rotateXYBy(os::Randomizer::frand() * MaxAngleDegrees); - tgt.rotateYZBy(os::Randomizer::frand() * MaxAngleDegrees); - tgt.rotateXZBy(os::Randomizer::frand() * MaxAngleDegrees); - p.vector = tgt; - } - - p.endTime = now + MinLifeTime; - if (MaxLifeTime != MinLifeTime) - p.endTime += os::Randomizer::rand() % (MaxLifeTime - MinLifeTime); - - if (MinStartColor==MaxStartColor) - p.color=MinStartColor; - else - p.color = MinStartColor.getInterpolated(MaxStartColor, os::Randomizer::frand()); - - p.startColor = p.color; - p.startVector = p.vector; - - if (MinStartSize==MaxStartSize) - p.startSize = MinStartSize; - else - p.startSize = MinStartSize.getInterpolated(MaxStartSize, os::Randomizer::frand()); - p.size = p.startSize; - - Particles.push_back(p); - } - - outArray = Particles.pointer(); - - return Particles.size(); - } - - return 0; -} - -//! Writes attributes of the object. -void CParticleCylinderEmitter::serializeAttributes(io::IAttributes* out, io::SAttributeReadWriteOptions* options) const -{ - out->addVector3d("Center", Center); - out->addVector3d("Normal", Normal); - out->addVector3d("Direction", Direction); - out->addFloat("MinStartSizeWidth", MinStartSize.Width); - out->addFloat("MinStartSizeHeight", MinStartSize.Height); - out->addFloat("MaxStartSizeWidth", MaxStartSize.Width); - out->addFloat("MaxStartSizeHeight", MaxStartSize.Height); - out->addInt("MinParticlesPerSecond", MinParticlesPerSecond); - out->addInt("MaxParticlesPerSecond", MaxParticlesPerSecond); - out->addColor("MinStartColor", MinStartColor); - out->addColor("MaxStartColor", MaxStartColor); - out->addInt("MinLifeTime", MinLifeTime); - out->addInt("MaxLifeTime", MaxLifeTime); - out->addFloat("Radius", Radius); - out->addFloat("Length", Length); - out->addInt("MaxAngleDegrees", MaxAngleDegrees); - out->addBool("OutlineOnly", OutlineOnly); -} - -//! Reads attributes of the object. -void CParticleCylinderEmitter::deserializeAttributes(io::IAttributes* in, io::SAttributeReadWriteOptions* options) -{ - Center = in->getAttributeAsVector3d("Center"); - Normal = in->getAttributeAsVector3d("Normal"); - if (Normal.getLength() == 0) - Normal.set(0,1.f,0); - Direction = in->getAttributeAsVector3d("Direction"); - if (Direction.getLength() == 0) - Direction.set(0,0.01f,0); - - int idx = -1; - idx = in->findAttribute("MinStartSizeWidth"); - if ( idx >= 0 ) - MinStartSize.Width = in->getAttributeAsFloat(idx); - idx = in->findAttribute("MinStartSizeHeight"); - if ( idx >= 0 ) - MinStartSize.Height = in->getAttributeAsFloat(idx); - idx = in->findAttribute("MaxStartSizeWidth"); - if ( idx >= 0 ) - MaxStartSize.Width = in->getAttributeAsFloat(idx); - idx = in->findAttribute("MaxStartSizeHeight"); - if ( idx >= 0 ) - MaxStartSize.Height = in->getAttributeAsFloat(idx); - - MinParticlesPerSecond = in->getAttributeAsInt("MinParticlesPerSecond"); - MaxParticlesPerSecond = in->getAttributeAsInt("MaxParticlesPerSecond"); - - MinParticlesPerSecond = core::max_(1u, MinParticlesPerSecond); - MaxParticlesPerSecond = core::max_(MaxParticlesPerSecond, 1u); - MaxParticlesPerSecond = core::min_(MaxParticlesPerSecond, 200u); - MinParticlesPerSecond = core::min_(MinParticlesPerSecond, MaxParticlesPerSecond); - - MinStartColor = in->getAttributeAsColor("MinStartColor"); - MaxStartColor = in->getAttributeAsColor("MaxStartColor"); - MinLifeTime = in->getAttributeAsInt("MinLifeTime"); - MaxLifeTime = in->getAttributeAsInt("MaxLifeTime"); - MinLifeTime = core::max_(0u, MinLifeTime); - MaxLifeTime = core::max_(MaxLifeTime, MinLifeTime); - MinLifeTime = core::min_(MinLifeTime, MaxLifeTime); - - Radius = in->getAttributeAsFloat("Radius"); - Length = in->getAttributeAsFloat("Length"); - MaxAngleDegrees = in->getAttributeAsInt("MaxAngleDegrees"); - OutlineOnly = in->getAttributeAsBool("OutlineOnly"); -} - - -} // end namespace scene -} // end namespace irr - -#endif // _IRR_COMPILE_WITH_PARTICLES_ - diff --git a/source/Irrlicht/CParticleCylinderEmitter.h b/source/Irrlicht/CParticleCylinderEmitter.h deleted file mode 100644 index c49c939a..00000000 --- a/source/Irrlicht/CParticleCylinderEmitter.h +++ /dev/null @@ -1,167 +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_PARTICLE_CYLINDER_EMITTER_H_INCLUDED__ -#define __C_PARTICLE_CYLINDER_EMITTER_H_INCLUDED__ - -#include "IrrCompileConfig.h" -#ifdef _IRR_COMPILE_WITH_PARTICLES_ - -#include "IParticleCylinderEmitter.h" -#include "irrArray.h" - -namespace irr -{ -namespace scene -{ - -//! A default box emitter -class CParticleCylinderEmitter : public IParticleCylinderEmitter -{ -public: - - //! constructor - CParticleCylinderEmitter( - const core::vector3df& center, f32 radius, - const core::vector3df& normal, f32 length, - bool outlineOnly = false, const core::vector3df& direction = core::vector3df(0.0f,0.03f,0.0f), - u32 minParticlesPerSecond = 20, - u32 maxParticlesPerSecond = 40, - const video::SColor& minStartColor = video::SColor(255,0,0,0), - const video::SColor& maxStartColor = video::SColor(255,255,255,255), - u32 lifeTimeMin=2000, - u32 lifeTimeMax=4000, - s32 maxAngleDegrees=0, - const core::dimension2df& minStartSize = core::dimension2df(5.0f,5.0f), - const core::dimension2df& maxStartSize = core::dimension2df(5.0f,5.0f) - ); - - //! Prepares an array with new particles to emitt into the system - //! and returns how much new particles there are. - virtual s32 emitt(u32 now, u32 timeSinceLastCall, SParticle*& outArray) _IRR_OVERRIDE_; - - //! Set the center of the radius for the cylinder, at one end of the cylinder - virtual void setCenter( const core::vector3df& center ) _IRR_OVERRIDE_ { Center = center; } - - //! Set the normal of the cylinder - virtual void setNormal( const core::vector3df& normal ) _IRR_OVERRIDE_ { Normal = normal; } - - //! Set the radius of the cylinder - virtual void setRadius( f32 radius ) _IRR_OVERRIDE_ { Radius = radius; } - - //! Set the length of the cylinder - virtual void setLength( f32 length ) _IRR_OVERRIDE_ { Length = length; } - - //! Set whether or not to draw points inside the cylinder - virtual void setOutlineOnly( bool outlineOnly ) _IRR_OVERRIDE_ { OutlineOnly = outlineOnly; } - - //! Set direction the emitter emits particles - virtual void setDirection( const core::vector3df& newDirection ) _IRR_OVERRIDE_ { Direction = newDirection; } - - //! Set direction the emitter emits particles - virtual void setMinParticlesPerSecond( u32 minPPS ) _IRR_OVERRIDE_ { MinParticlesPerSecond = minPPS; } - - //! Set direction the emitter emits particles - virtual void setMaxParticlesPerSecond( u32 maxPPS ) _IRR_OVERRIDE_ { MaxParticlesPerSecond = maxPPS; } - - //! Set direction the emitter emits particles - virtual void setMinStartColor( const video::SColor& color ) _IRR_OVERRIDE_ { MinStartColor = color; } - - //! Set direction the emitter emits particles - virtual void setMaxStartColor( const video::SColor& color ) _IRR_OVERRIDE_ { MaxStartColor = color; } - - //! Set the maximum starting size for particles - virtual void setMaxStartSize( const core::dimension2df& size ) _IRR_OVERRIDE_ { MaxStartSize = size; } - - //! Set the minimum starting size for particles - virtual void setMinStartSize( const core::dimension2df& size ) _IRR_OVERRIDE_ { MinStartSize = size; } - - //! Set the minimum particle life-time in milliseconds - virtual void setMinLifeTime( u32 lifeTimeMin ) _IRR_OVERRIDE_ { MinLifeTime = lifeTimeMin; } - - //! Set the maximum particle life-time in milliseconds - virtual void setMaxLifeTime( u32 lifeTimeMax ) _IRR_OVERRIDE_ { MaxLifeTime = lifeTimeMax; } - - //! Maximal random derivation from the direction - virtual void setMaxAngleDegrees( s32 maxAngleDegrees ) _IRR_OVERRIDE_ { MaxAngleDegrees = maxAngleDegrees; } - - //! Get the center of the cylinder - virtual const core::vector3df& getCenter() const _IRR_OVERRIDE_ { return Center; } - - //! Get the normal of the cylinder - virtual const core::vector3df& getNormal() const _IRR_OVERRIDE_ { return Normal; } - - //! Get the radius of the cylinder - virtual f32 getRadius() const _IRR_OVERRIDE_ { return Radius; } - - //! Get the center of the cylinder - virtual f32 getLength() const _IRR_OVERRIDE_ { return Length; } - - //! Get whether or not to draw points inside the cylinder - virtual bool getOutlineOnly() const _IRR_OVERRIDE_ { return OutlineOnly; } - - //! Gets direction the emitter emits particles - virtual const core::vector3df& getDirection() const _IRR_OVERRIDE_ { return Direction; } - - //! Gets direction the emitter emits particles - virtual u32 getMinParticlesPerSecond() const _IRR_OVERRIDE_ { return MinParticlesPerSecond; } - - //! Gets direction the emitter emits particles - virtual u32 getMaxParticlesPerSecond() const _IRR_OVERRIDE_ { return MaxParticlesPerSecond; } - - //! Gets direction the emitter emits particles - virtual const video::SColor& getMinStartColor() const _IRR_OVERRIDE_ { return MinStartColor; } - - //! Gets direction the emitter emits particles - virtual const video::SColor& getMaxStartColor() const _IRR_OVERRIDE_ { return MaxStartColor; } - - //! Gets the maximum starting size for particles - virtual const core::dimension2df& getMaxStartSize() const _IRR_OVERRIDE_ { return MaxStartSize; } - - //! Gets the minimum starting size for particles - virtual const core::dimension2df& getMinStartSize() const _IRR_OVERRIDE_ { return MinStartSize; } - - //! Get the minimum particle life-time in milliseconds - virtual u32 getMinLifeTime() const _IRR_OVERRIDE_ { return MinLifeTime; } - - //! Get the maximum particle life-time in milliseconds - virtual u32 getMaxLifeTime() const _IRR_OVERRIDE_ { return MaxLifeTime; } - - //! Maximal random derivation from the direction - virtual s32 getMaxAngleDegrees() const _IRR_OVERRIDE_ { return MaxAngleDegrees; } - - //! Writes attributes of the object. - virtual void serializeAttributes(io::IAttributes* out, io::SAttributeReadWriteOptions* options) const _IRR_OVERRIDE_; - - //! Reads attributes of the object. - virtual void deserializeAttributes(io::IAttributes* in, io::SAttributeReadWriteOptions* options) _IRR_OVERRIDE_; - -private: - - core::array<SParticle> Particles; - - core::vector3df Center; - core::vector3df Normal; - core::vector3df Direction; - core::dimension2df MaxStartSize, MinStartSize; - u32 MinParticlesPerSecond, MaxParticlesPerSecond; - video::SColor MinStartColor, MaxStartColor; - u32 MinLifeTime, MaxLifeTime; - - f32 Radius; - f32 Length; - - u32 Time; - s32 MaxAngleDegrees; - - bool OutlineOnly; -}; - -} // end namespace scene -} // end namespace irr - -#endif // _IRR_COMPILE_WITH_PARTICLES_ - -#endif - diff --git a/source/Irrlicht/CParticleFadeOutAffector.cpp b/source/Irrlicht/CParticleFadeOutAffector.cpp deleted file mode 100644 index 4c6957e8..00000000 --- a/source/Irrlicht/CParticleFadeOutAffector.cpp +++ /dev/null @@ -1,74 +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 "CParticleFadeOutAffector.h" - -#ifdef _IRR_COMPILE_WITH_PARTICLES_ - -#include "IAttributes.h" -#include "os.h" - -namespace irr -{ -namespace scene -{ - -//! constructor -CParticleFadeOutAffector::CParticleFadeOutAffector( - const video::SColor& targetColor, u32 fadeOutTime) - : IParticleFadeOutAffector(), TargetColor(targetColor) -{ - - #ifdef _DEBUG - setDebugName("CParticleFadeOutAffector"); - #endif - - FadeOutTime = fadeOutTime ? static_cast<f32>(fadeOutTime) : 1.0f; -} - - -//! Affects an array of particles. -void CParticleFadeOutAffector::affect(u32 now, SParticle* particlearray, u32 count) -{ - if (!Enabled) - return; - f32 d; - - for (u32 i=0; i<count; ++i) - { - if (particlearray[i].endTime - now < FadeOutTime) - { - d = (particlearray[i].endTime - now) / FadeOutTime; // FadeOutTime probably f32 to save casts here (just guessing) - particlearray[i].color = particlearray[i].startColor.getInterpolated( - TargetColor, d); - } - } -} - - -//! Writes attributes of the object. -//! Implement this to expose the attributes of your scene node animator for -//! scripting languages, editors, debuggers or xml serialization purposes. -void CParticleFadeOutAffector::serializeAttributes(io::IAttributes* out, io::SAttributeReadWriteOptions* options) const -{ - out->addColor("TargetColor", TargetColor); - out->addFloat("FadeOutTime", FadeOutTime); -} - -//! Reads attributes of the object. -//! Implement this to set the attributes of your scene node animator for -//! scripting languages, editors, debuggers or xml deserialization purposes. -//! \param startIndex: start index where to start reading attributes. -//! \return: returns last index of an attribute read by this affector -void CParticleFadeOutAffector::deserializeAttributes(io::IAttributes* in, io::SAttributeReadWriteOptions* options) -{ - TargetColor = in->getAttributeAsColor("TargetColor"); - FadeOutTime = in->getAttributeAsFloat("FadeOutTime"); -} - - -} // end namespace scene -} // end namespace irr - -#endif // _IRR_COMPILE_WITH_PARTICLES_ diff --git a/source/Irrlicht/CParticleFadeOutAffector.h b/source/Irrlicht/CParticleFadeOutAffector.h deleted file mode 100644 index f0bbf057..00000000 --- a/source/Irrlicht/CParticleFadeOutAffector.h +++ /dev/null @@ -1,68 +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_PARTICLE_FADE_OUT_AFFECTOR_H_INCLUDED__ -#define __C_PARTICLE_FADE_OUT_AFFECTOR_H_INCLUDED__ - -#include "IrrCompileConfig.h" -#ifdef _IRR_COMPILE_WITH_PARTICLES_ - -#include "IParticleFadeOutAffector.h" -#include "SColor.h" - -namespace irr -{ -namespace scene -{ - -//! Particle Affector for fading out a color -class CParticleFadeOutAffector : public IParticleFadeOutAffector -{ -public: - - CParticleFadeOutAffector(const video::SColor& targetColor, u32 fadeOutTime); - - //! Affects a particle. - virtual void affect(u32 now, SParticle* particlearray, u32 count) _IRR_OVERRIDE_; - - //! Sets the targetColor, i.e. the color the particles will interpolate - //! to over time. - virtual void setTargetColor( const video::SColor& targetColor ) _IRR_OVERRIDE_ { TargetColor = targetColor; } - - //! Sets the amount of time it takes for each particle to fade out. - virtual void setFadeOutTime( u32 fadeOutTime ) _IRR_OVERRIDE_ { FadeOutTime = fadeOutTime ? static_cast<f32>(fadeOutTime) : 1.0f; } - - //! Sets the targetColor, i.e. the color the particles will interpolate - //! to over time. - virtual const video::SColor& getTargetColor() const _IRR_OVERRIDE_ { return TargetColor; } - - //! Sets the amount of time it takes for each particle to fade out. - virtual u32 getFadeOutTime() const _IRR_OVERRIDE_ { return static_cast<u32>(FadeOutTime); } - - //! Writes attributes of the object. - //! Implement this to expose the attributes of your scene node animator for - //! scripting languages, editors, debuggers or xml serialization purposes. - virtual void serializeAttributes(io::IAttributes* out, io::SAttributeReadWriteOptions* options) const _IRR_OVERRIDE_; - - //! Reads attributes of the object. - //! Implement this to set the attributes of your scene node animator for - //! scripting languages, editors, debuggers or xml deserialization purposes. - //! \param startIndex: start index where to start reading attributes. - //! \return: returns last index of an attribute read by this affector - virtual void deserializeAttributes(io::IAttributes* in, io::SAttributeReadWriteOptions* options) _IRR_OVERRIDE_; - -private: - - video::SColor TargetColor; - f32 FadeOutTime; -}; - -} // end namespace scene -} // end namespace irr - - -#endif // _IRR_COMPILE_WITH_PARTICLES_ - -#endif - diff --git a/source/Irrlicht/CParticleGravityAffector.cpp b/source/Irrlicht/CParticleGravityAffector.cpp deleted file mode 100644 index 1938a542..00000000 --- a/source/Irrlicht/CParticleGravityAffector.cpp +++ /dev/null @@ -1,68 +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 "CParticleGravityAffector.h" - -#ifdef _IRR_COMPILE_WITH_PARTICLES_ - -#include "os.h" -#include "IAttributes.h" - -namespace irr -{ -namespace scene -{ - -//! constructor -CParticleGravityAffector::CParticleGravityAffector( - const core::vector3df& gravity, u32 timeForceLost) - : IParticleGravityAffector(), TimeForceLost(static_cast<f32>(timeForceLost)), Gravity(gravity) -{ - #ifdef _DEBUG - setDebugName("CParticleGravityAffector"); - #endif -} - - -//! Affects an array of particles. -void CParticleGravityAffector::affect(u32 now, SParticle* particlearray, u32 count) -{ - if (!Enabled) - return; - f32 d; - - for (u32 i=0; i<count; ++i) - { - d = (now - particlearray[i].startTime) / TimeForceLost; - if (d > 1.0f) - d = 1.0f; - if (d < 0.0f) - d = 0.0f; - d = 1.0f - d; - - particlearray[i].vector = particlearray[i].startVector.getInterpolated(Gravity, d); - } -} - -//! Writes attributes of the object. -void CParticleGravityAffector::serializeAttributes(io::IAttributes* out, io::SAttributeReadWriteOptions* options) const -{ - out->addVector3d("Gravity", Gravity); - out->addFloat("TimeForceLost", TimeForceLost); -} - - -//! Reads attributes of the object. -void CParticleGravityAffector::deserializeAttributes(io::IAttributes* in, io::SAttributeReadWriteOptions* options) -{ - Gravity = in->getAttributeAsVector3d("Gravity"); - TimeForceLost = in->getAttributeAsFloat("TimeForceLost"); -} - - - -} // end namespace scene -} // end namespace irr - -#endif // _IRR_COMPILE_WITH_PARTICLES_ diff --git a/source/Irrlicht/CParticleGravityAffector.h b/source/Irrlicht/CParticleGravityAffector.h deleted file mode 100644 index 1c926fc2..00000000 --- a/source/Irrlicht/CParticleGravityAffector.h +++ /dev/null @@ -1,68 +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_PARTICLE_GRAVITY_AFFECTOR_H_INCLUDED__ -#define __C_PARTICLE_GRAVITY_AFFECTOR_H_INCLUDED__ - -#include "IrrCompileConfig.h" -#ifdef _IRR_COMPILE_WITH_PARTICLES_ - -#include "IParticleGravityAffector.h" -#include "SColor.h" - -namespace irr -{ -namespace scene -{ - -//! Particle Affector for affecting direction of particle -class CParticleGravityAffector : public IParticleGravityAffector -{ -public: - - CParticleGravityAffector( - const core::vector3df& gravity = core::vector3df(0.0f,-0.03f,0.0f), - u32 timeForceLost = 1000); - - //! Affects a particle. - virtual void affect(u32 now, SParticle* particlearray, u32 count) _IRR_OVERRIDE_; - - //! Set the time in milliseconds when the gravity force is totally - //! lost and the particle does not move any more. - virtual void setTimeForceLost( f32 timeForceLost ) _IRR_OVERRIDE_ { TimeForceLost = timeForceLost; } - - //! Set the direction and force of gravity. - virtual void setGravity( const core::vector3df& gravity ) _IRR_OVERRIDE_ { Gravity = gravity; } - - //! Set the time in milliseconds when the gravity force is totally - //! lost and the particle does not move any more. - virtual f32 getTimeForceLost() const _IRR_OVERRIDE_ { return TimeForceLost; } - - //! Set the direction and force of gravity. - virtual const core::vector3df& getGravity() const _IRR_OVERRIDE_ { return Gravity; } - - //! Writes attributes of the object. - //! Implement this to expose the attributes of your scene node animator for - //! scripting languages, editors, debuggers or xml serialization purposes. - virtual void serializeAttributes(io::IAttributes* out, io::SAttributeReadWriteOptions* options) const _IRR_OVERRIDE_; - - //! Reads attributes of the object. - //! Implement this to set the attributes of your scene node animator for - //! scripting languages, editors, debuggers or xml deserialization purposes. - //! \param startIndex: start index where to start reading attributes. - //! \return: returns last index of an attribute read by this affector - virtual void deserializeAttributes(io::IAttributes* in, io::SAttributeReadWriteOptions* options) _IRR_OVERRIDE_; - -private: - f32 TimeForceLost; - core::vector3df Gravity; -}; - -} // end namespace scene -} // end namespace irr - -#endif // _IRR_COMPILE_WITH_PARTICLES_ - -#endif - diff --git a/source/Irrlicht/CParticleMeshEmitter.cpp b/source/Irrlicht/CParticleMeshEmitter.cpp deleted file mode 100644 index ef667c52..00000000 --- a/source/Irrlicht/CParticleMeshEmitter.cpp +++ /dev/null @@ -1,194 +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 "CParticleMeshEmitter.h" - -#include "IrrCompileConfig.h" -#ifdef _IRR_COMPILE_WITH_PARTICLES_ - -#include "os.h" - -namespace irr -{ -namespace scene -{ - -//! constructor -CParticleMeshEmitter::CParticleMeshEmitter( - IMesh* mesh, bool useNormalDirection, - const core::vector3df& direction, f32 normalDirectionModifier, - s32 mbNumber, bool everyMeshVertex, - u32 minParticlesPerSecond, u32 maxParticlesPerSecond, - const video::SColor& minStartColor, const video::SColor& maxStartColor, - u32 lifeTimeMin, u32 lifeTimeMax, s32 maxAngleDegrees, - const core::dimension2df& minStartSize, - const core::dimension2df& maxStartSize ) - : Mesh(0), TotalVertices(0), MBCount(0), MBNumber(mbNumber), - NormalDirectionModifier(normalDirectionModifier), Direction(direction), - MaxStartSize(maxStartSize), MinStartSize(minStartSize), - MinParticlesPerSecond(minParticlesPerSecond), MaxParticlesPerSecond(maxParticlesPerSecond), - MinStartColor(minStartColor), MaxStartColor(maxStartColor), - MinLifeTime(lifeTimeMin), MaxLifeTime(lifeTimeMax), - Time(0), MaxAngleDegrees(maxAngleDegrees), - EveryMeshVertex(everyMeshVertex), UseNormalDirection(useNormalDirection) -{ - #ifdef _DEBUG - setDebugName("CParticleMeshEmitter"); - #endif - setMesh(mesh); -} - - -//! Prepares an array with new particles to emitt into the system -//! and returns how much new particles there are. -s32 CParticleMeshEmitter::emitt(u32 now, u32 timeSinceLastCall, SParticle*& outArray) -{ - Time += timeSinceLastCall; - - const u32 pps = (MaxParticlesPerSecond - MinParticlesPerSecond); - const f32 perSecond = pps ? ((f32)MinParticlesPerSecond + os::Randomizer::frand() * pps) : MinParticlesPerSecond; - const f32 everyWhatMillisecond = 1000.0f / perSecond; - - if(Time > everyWhatMillisecond) - { - Particles.set_used(0); - u32 amount = (u32)((Time / everyWhatMillisecond) + 0.5f); - Time = 0; - SParticle p; - - if(amount > MaxParticlesPerSecond * 2) - amount = MaxParticlesPerSecond * 2; - - for(u32 i=0; i<amount; ++i) - { - if( EveryMeshVertex ) - { - for( u32 j=0; j<Mesh->getMeshBufferCount(); ++j ) - { - for( u32 k=0; k<Mesh->getMeshBuffer(j)->getVertexCount(); ++k ) - { - p.pos = Mesh->getMeshBuffer(j)->getPosition(k); - if( UseNormalDirection ) - p.vector = Mesh->getMeshBuffer(j)->getNormal(k) / - NormalDirectionModifier; - else - p.vector = Direction; - - p.startTime = now; - - if( MaxAngleDegrees ) - { - core::vector3df tgt = p.vector; - tgt.rotateXYBy(os::Randomizer::frand() * MaxAngleDegrees); - tgt.rotateYZBy(os::Randomizer::frand() * MaxAngleDegrees); - tgt.rotateXZBy(os::Randomizer::frand() * MaxAngleDegrees); - p.vector = tgt; - } - - p.endTime = now + MinLifeTime; - if (MaxLifeTime != MinLifeTime) - p.endTime += os::Randomizer::rand() % (MaxLifeTime - MinLifeTime); - - if (MinStartColor==MaxStartColor) - p.color=MinStartColor; - else - p.color = MinStartColor.getInterpolated(MaxStartColor, os::Randomizer::frand()); - - p.startColor = p.color; - p.startVector = p.vector; - - if (MinStartSize==MaxStartSize) - p.startSize = MinStartSize; - else - p.startSize = MinStartSize.getInterpolated(MaxStartSize, os::Randomizer::frand()); - p.size = p.startSize; - - Particles.push_back(p); - } - } - } - else - { - const s32 randomMB = (MBNumber < 0) ? (os::Randomizer::rand() % MBCount) : MBNumber; - - u32 vertexNumber = Mesh->getMeshBuffer(randomMB)->getVertexCount(); - if (!vertexNumber) - continue; - vertexNumber = os::Randomizer::rand() % vertexNumber; - - p.pos = Mesh->getMeshBuffer(randomMB)->getPosition(vertexNumber); - if( UseNormalDirection ) - p.vector = Mesh->getMeshBuffer(randomMB)->getNormal(vertexNumber) / - NormalDirectionModifier; - else - p.vector = Direction; - - p.startTime = now; - - if( MaxAngleDegrees ) - { - core::vector3df tgt = Direction; - tgt.rotateXYBy(os::Randomizer::frand() * MaxAngleDegrees); - tgt.rotateYZBy(os::Randomizer::frand() * MaxAngleDegrees); - tgt.rotateXZBy(os::Randomizer::frand() * MaxAngleDegrees); - p.vector = tgt; - } - - p.endTime = now + MinLifeTime; - if (MaxLifeTime != MinLifeTime) - p.endTime += os::Randomizer::rand() % (MaxLifeTime - MinLifeTime); - - if (MinStartColor==MaxStartColor) - p.color=MinStartColor; - else - p.color = MinStartColor.getInterpolated(MaxStartColor, os::Randomizer::frand()); - - p.startColor = p.color; - p.startVector = p.vector; - - if (MinStartSize==MaxStartSize) - p.startSize = MinStartSize; - else - p.startSize = MinStartSize.getInterpolated(MaxStartSize, os::Randomizer::frand()); - p.size = p.startSize; - - Particles.push_back(p); - } - } - - outArray = Particles.pointer(); - - return Particles.size(); - } - - return 0; -} - - -//! Set Mesh to emit particles from -void CParticleMeshEmitter::setMesh(IMesh* mesh) -{ - Mesh = mesh; - - TotalVertices = 0; - MBCount = 0; - VertexPerMeshBufferList.clear(); - - if ( !Mesh ) - return; - - MBCount = Mesh->getMeshBufferCount(); - VertexPerMeshBufferList.reallocate(MBCount); - for( u32 i = 0; i < MBCount; ++i ) - { - VertexPerMeshBufferList.push_back( Mesh->getMeshBuffer(i)->getVertexCount() ); - TotalVertices += Mesh->getMeshBuffer(i)->getVertexCount(); - } -} - - -} // end namespace scene -} // end namespace irr - -#endif // _IRR_COMPILE_WITH_PARTICLES_ diff --git a/source/Irrlicht/CParticleMeshEmitter.h b/source/Irrlicht/CParticleMeshEmitter.h deleted file mode 100644 index 08a076c1..00000000 --- a/source/Irrlicht/CParticleMeshEmitter.h +++ /dev/null @@ -1,163 +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_PARTICLE_MESH_EMITTER_H_INCLUDED__ -#define __C_PARTICLE_MESH_EMITTER_H_INCLUDED__ - -#include "IrrCompileConfig.h" -#ifdef _IRR_COMPILE_WITH_PARTICLES_ - -#include "IParticleMeshEmitter.h" -#include "irrArray.h" -#include "aabbox3d.h" -#include "IMeshBuffer.h" - -namespace irr -{ -namespace scene -{ - -//! A default box emitter -class CParticleMeshEmitter : public IParticleMeshEmitter -{ -public: - - //! constructor - CParticleMeshEmitter( - IMesh* mesh, bool useNormalDirection = true, - const core::vector3df& direction = core::vector3df(0.0f,0.0f,0.0f), - f32 normalDirectionModifier = 100.0f, - s32 mbNumber = -1, - bool everyMeshVertex = false, - u32 minParticlesPerSecond = 20, - u32 maxParticlesPerSecond = 40, - const video::SColor& minStartColor = video::SColor(255,0,0,0), - const video::SColor& maxStartColor = video::SColor(255,255,255,255), - u32 lifeTimeMin = 2000, - u32 lifeTimeMax = 4000, - s32 maxAngleDegrees = 0, - const core::dimension2df& minStartSize = core::dimension2df(5.0f,5.0f), - const core::dimension2df& maxStartSize = core::dimension2df(5.0f,5.0f) - ); - - //! Prepares an array with new particles to emitt into the system - //! and returns how much new particles there are. - virtual s32 emitt(u32 now, u32 timeSinceLastCall, SParticle*& outArray) _IRR_OVERRIDE_; - - //! Set Mesh to emit particles from - virtual void setMesh( IMesh* mesh ) _IRR_OVERRIDE_; - - //! Set whether to use vertex normal for direction, or direction specified - virtual void setUseNormalDirection( bool useNormalDirection ) _IRR_OVERRIDE_ { UseNormalDirection = useNormalDirection; } - - //! Set direction the emitter emits particles - virtual void setDirection( const core::vector3df& newDirection ) _IRR_OVERRIDE_ { Direction = newDirection; } - - //! Set the amount that the normal is divided by for getting a particles direction - virtual void setNormalDirectionModifier( f32 normalDirectionModifier ) _IRR_OVERRIDE_ { NormalDirectionModifier = normalDirectionModifier; } - - //! Sets whether to emit min<->max particles for every vertex per second, or to pick - //! min<->max vertices every second - virtual void setEveryMeshVertex( bool everyMeshVertex ) _IRR_OVERRIDE_ { EveryMeshVertex = everyMeshVertex; } - - //! Set minimum number of particles the emitter emits per second - virtual void setMinParticlesPerSecond( u32 minPPS ) _IRR_OVERRIDE_ { MinParticlesPerSecond = minPPS; } - - //! Set maximum number of particles the emitter emits per second - virtual void setMaxParticlesPerSecond( u32 maxPPS ) _IRR_OVERRIDE_ { MaxParticlesPerSecond = maxPPS; } - - //! Set minimum starting color for particles - virtual void setMinStartColor( const video::SColor& color ) _IRR_OVERRIDE_ { MinStartColor = color; } - - //! Set maximum starting color for particles - virtual void setMaxStartColor( const video::SColor& color ) _IRR_OVERRIDE_ { MaxStartColor = color; } - - //! Set the maximum starting size for particles - virtual void setMaxStartSize( const core::dimension2df& size ) _IRR_OVERRIDE_ { MaxStartSize = size; } - - //! Set the minimum starting size for particles - virtual void setMinStartSize( const core::dimension2df& size ) _IRR_OVERRIDE_ { MinStartSize = size; } - - //! Set the minimum particle life-time in milliseconds - virtual void setMinLifeTime( u32 lifeTimeMin ) _IRR_OVERRIDE_ { MinLifeTime = lifeTimeMin; } - - //! Set the maximum particle life-time in milliseconds - virtual void setMaxLifeTime( u32 lifeTimeMax ) _IRR_OVERRIDE_ { MaxLifeTime = lifeTimeMax; } - - //! Set maximal random derivation from the direction - virtual void setMaxAngleDegrees( s32 maxAngleDegrees ) _IRR_OVERRIDE_ { MaxAngleDegrees = maxAngleDegrees; } - - //! Get Mesh we're emitting particles from - virtual const IMesh* getMesh() const _IRR_OVERRIDE_ { return Mesh; } - - //! Get whether to use vertex normal for direciton, or direction specified - virtual bool isUsingNormalDirection() const _IRR_OVERRIDE_ { return UseNormalDirection; } - - //! Get direction the emitter emits particles - virtual const core::vector3df& getDirection() const _IRR_OVERRIDE_ { return Direction; } - - //! Get the amount that the normal is divided by for getting a particles direction - virtual f32 getNormalDirectionModifier() const _IRR_OVERRIDE_ { return NormalDirectionModifier; } - - //! Gets whether to emit min<->max particles for every vertex per second, or to pick - //! min<->max vertices every second - virtual bool getEveryMeshVertex() const _IRR_OVERRIDE_ { return EveryMeshVertex; } - - //! Get the minimum number of particles the emitter emits per second - virtual u32 getMinParticlesPerSecond() const _IRR_OVERRIDE_ { return MinParticlesPerSecond; } - - //! Get the maximum number of particles the emitter emits per second - virtual u32 getMaxParticlesPerSecond() const _IRR_OVERRIDE_ { return MaxParticlesPerSecond; } - - //! Get the minimum starting color for particles - virtual const video::SColor& getMinStartColor() const _IRR_OVERRIDE_ { return MinStartColor; } - - //! Get the maximum starting color for particles - virtual const video::SColor& getMaxStartColor() const _IRR_OVERRIDE_ { return MaxStartColor; } - - //! Gets the maximum starting size for particles - virtual const core::dimension2df& getMaxStartSize() const _IRR_OVERRIDE_ { return MaxStartSize; } - - //! Gets the minimum starting size for particles - virtual const core::dimension2df& getMinStartSize() const _IRR_OVERRIDE_ { return MinStartSize; } - - //! Get the minimum particle life-time in milliseconds - virtual u32 getMinLifeTime() const _IRR_OVERRIDE_ { return MinLifeTime; } - - //! Get the maximum particle life-time in milliseconds - virtual u32 getMaxLifeTime() const _IRR_OVERRIDE_ { return MaxLifeTime; } - - //! Get maximal random derivation from the direction - virtual s32 getMaxAngleDegrees() const _IRR_OVERRIDE_ { return MaxAngleDegrees; } - -private: - - const IMesh* Mesh; - core::array<s32> VertexPerMeshBufferList; - s32 TotalVertices; - u32 MBCount; - s32 MBNumber; - - f32 NormalDirectionModifier; - core::array<SParticle> Particles; - core::vector3df Direction; - core::dimension2df MaxStartSize, MinStartSize; - u32 MinParticlesPerSecond, MaxParticlesPerSecond; - video::SColor MinStartColor, MaxStartColor; - u32 MinLifeTime, MaxLifeTime; - - u32 Time; - s32 MaxAngleDegrees; - - bool EveryMeshVertex; - bool UseNormalDirection; -}; - -} // end namespace scene -} // end namespace irr - -#endif // _IRR_COMPILE_WITH_PARTICLES_ - -#endif // __C_PARTICLE_MESH_EMITTER_H_INCLUDED__ - diff --git a/source/Irrlicht/CParticlePointEmitter.cpp b/source/Irrlicht/CParticlePointEmitter.cpp deleted file mode 100644 index 38c7e276..00000000 --- a/source/Irrlicht/CParticlePointEmitter.cpp +++ /dev/null @@ -1,151 +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 "CParticlePointEmitter.h" - -#ifdef _IRR_COMPILE_WITH_PARTICLES_ - -#include "os.h" -#include "IAttributes.h" - -namespace irr -{ -namespace scene -{ - -//! constructor -CParticlePointEmitter::CParticlePointEmitter( - const core::vector3df& direction, u32 minParticlesPerSecond, - u32 maxParticlesPerSecond, video::SColor minStartColor, - video::SColor maxStartColor, u32 lifeTimeMin, u32 lifeTimeMax, - s32 maxAngleDegrees, - const core::dimension2df& minStartSize, - const core::dimension2df& maxStartSize) - : Direction(direction), - MinStartSize(minStartSize), MaxStartSize(maxStartSize), - MinParticlesPerSecond(minParticlesPerSecond), - MaxParticlesPerSecond(maxParticlesPerSecond), - MinStartColor(minStartColor), MaxStartColor(maxStartColor), - MinLifeTime(lifeTimeMin), MaxLifeTime(lifeTimeMax), - MaxAngleDegrees(maxAngleDegrees), Time(0) -{ - #ifdef _DEBUG - setDebugName("CParticlePointEmitter"); - #endif -} - - -//! Prepares an array with new particles to emitt into the system -//! and returns how much new particles there are. -s32 CParticlePointEmitter::emitt(u32 now, u32 timeSinceLastCall, SParticle*& outArray) -{ - Time += timeSinceLastCall; - - const u32 pps = (MaxParticlesPerSecond - MinParticlesPerSecond); - const f32 perSecond = pps ? ((f32)MinParticlesPerSecond + os::Randomizer::frand() * pps) : MinParticlesPerSecond; - const f32 everyWhatMillisecond = 1000.0f / perSecond; - - if (Time > everyWhatMillisecond) - { - Time = 0; - Particle.startTime = now; - Particle.vector = Direction; - - if (MaxAngleDegrees) - { - core::vector3df tgt = Direction; - tgt.rotateXYBy(os::Randomizer::frand() * MaxAngleDegrees); - tgt.rotateYZBy(os::Randomizer::frand() * MaxAngleDegrees); - tgt.rotateXZBy(os::Randomizer::frand() * MaxAngleDegrees); - Particle.vector = tgt; - } - - Particle.endTime = now + MinLifeTime; - if (MaxLifeTime != MinLifeTime) - Particle.endTime += os::Randomizer::rand() % (MaxLifeTime - MinLifeTime); - - if (MinStartColor==MaxStartColor) - Particle.color=MinStartColor; - else - Particle.color = MinStartColor.getInterpolated(MaxStartColor, os::Randomizer::frand()); - - Particle.startColor = Particle.color; - Particle.startVector = Particle.vector; - - if (MinStartSize==MaxStartSize) - Particle.startSize = MinStartSize; - else - Particle.startSize = MinStartSize.getInterpolated(MaxStartSize, os::Randomizer::frand()); - Particle.size = Particle.startSize; - - outArray = &Particle; - return 1; - } - - return 0; -} - - -//! Writes attributes of the object. -void CParticlePointEmitter::serializeAttributes(io::IAttributes* out, io::SAttributeReadWriteOptions* options) const -{ - out->addVector3d("Direction", Direction); - out->addFloat("MinStartSizeWidth", MinStartSize.Width); - out->addFloat("MinStartSizeHeight", MinStartSize.Height); - out->addFloat("MaxStartSizeWidth", MaxStartSize.Width); - out->addFloat("MaxStartSizeHeight", MaxStartSize.Height); - out->addInt("MinParticlesPerSecond", MinParticlesPerSecond); - out->addInt("MaxParticlesPerSecond", MaxParticlesPerSecond); - out->addColor("MinStartColor", MinStartColor); - out->addColor("MaxStartColor", MaxStartColor); - out->addInt("MinLifeTime", MinLifeTime); - out->addInt("MaxLifeTime", MaxLifeTime); - out->addInt("MaxAngleDegrees", MaxAngleDegrees); -} - -//! Reads attributes of the object. -void CParticlePointEmitter::deserializeAttributes(io::IAttributes* in, io::SAttributeReadWriteOptions* options) -{ - Direction = in->getAttributeAsVector3d("Direction"); - if (Direction.getLength() == 0) - Direction.set(0,0.01f,0); - - int idx = -1; - idx = in->findAttribute("MinStartSizeWidth"); - if ( idx >= 0 ) - MinStartSize.Width = in->getAttributeAsFloat(idx); - idx = in->findAttribute("MinStartSizeHeight"); - if ( idx >= 0 ) - MinStartSize.Height = in->getAttributeAsFloat(idx); - idx = in->findAttribute("MaxStartSizeWidth"); - if ( idx >= 0 ) - MaxStartSize.Width = in->getAttributeAsFloat(idx); - idx = in->findAttribute("MaxStartSizeHeight"); - if ( idx >= 0 ) - MaxStartSize.Height = in->getAttributeAsFloat(idx); - - MinParticlesPerSecond = in->getAttributeAsInt("MinParticlesPerSecond"); - MaxParticlesPerSecond = in->getAttributeAsInt("MaxParticlesPerSecond"); - - MinParticlesPerSecond = core::max_(1u, MinParticlesPerSecond); - MaxParticlesPerSecond = core::max_(MaxParticlesPerSecond, 1u); - MaxParticlesPerSecond = core::min_(MaxParticlesPerSecond, 200u); - MinParticlesPerSecond = core::min_(MinParticlesPerSecond, MaxParticlesPerSecond); - - MinStartColor = in->getAttributeAsColor("MinStartColor"); - MaxStartColor = in->getAttributeAsColor("MaxStartColor"); - MinLifeTime = in->getAttributeAsInt("MinLifeTime"); - MaxLifeTime = in->getAttributeAsInt("MaxLifeTime"); - MaxAngleDegrees = in->getAttributeAsInt("MaxAngleDegrees"); - - MinLifeTime = core::max_(0u, MinLifeTime); - MaxLifeTime = core::max_(MaxLifeTime, MinLifeTime); - MinLifeTime = core::min_(MinLifeTime, MaxLifeTime); -} - - -} // end namespace scene -} // end namespace irr - -#endif // _IRR_COMPILE_WITH_PARTICLES_ diff --git a/source/Irrlicht/CParticlePointEmitter.h b/source/Irrlicht/CParticlePointEmitter.h deleted file mode 100644 index 985bb490..00000000 --- a/source/Irrlicht/CParticlePointEmitter.h +++ /dev/null @@ -1,125 +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_PARTICLE_POINT_EMITTER_H_INCLUDED__ -#define __C_PARTICLE_POINT_EMITTER_H_INCLUDED__ - -#include "IrrCompileConfig.h" -#ifdef _IRR_COMPILE_WITH_PARTICLES_ - -#include "IParticleEmitter.h" -#include "irrArray.h" - -namespace irr -{ -namespace scene -{ - -//! A default point emitter -class CParticlePointEmitter : public IParticlePointEmitter -{ -public: - - //! constructor - CParticlePointEmitter( - const core::vector3df& direction = core::vector3df(0.0f,0.03f,0.0f), - u32 minParticlesPerSecond = 5, - u32 maxParticlesPerSecond = 10, - video::SColor minStartColor = video::SColor(255,0,0,0), - video::SColor maxStartColor = video::SColor(255,255,255,255), - u32 lifeTimeMin=2000, - u32 lifeTimeMax=4000, - s32 maxAngleDegrees=0, - const core::dimension2df& minStartSize = core::dimension2df(5.0f,5.0f), - const core::dimension2df& maxStartSize = core::dimension2df(5.0f,5.0f) ); - - //! Prepares an array with new particles to emitt into the system - //! and returns how much new particles there are. - virtual s32 emitt(u32 now, u32 timeSinceLastCall, SParticle*& outArray) _IRR_OVERRIDE_; - - //! Set direction the emitter emits particles. - virtual void setDirection( const core::vector3df& newDirection ) _IRR_OVERRIDE_ { Direction = newDirection; } - - //! Set minimum number of particles emitted per second. - virtual void setMinParticlesPerSecond( u32 minPPS ) _IRR_OVERRIDE_ { MinParticlesPerSecond = minPPS; } - - //! Set maximum number of particles emitted per second. - virtual void setMaxParticlesPerSecond( u32 maxPPS ) _IRR_OVERRIDE_ { MaxParticlesPerSecond = maxPPS; } - - //! Set minimum start color. - virtual void setMinStartColor( const video::SColor& color ) _IRR_OVERRIDE_ { MinStartColor = color; } - - //! Set maximum start color. - virtual void setMaxStartColor( const video::SColor& color ) _IRR_OVERRIDE_ { MaxStartColor = color; } - - //! Set the maximum starting size for particles - virtual void setMaxStartSize( const core::dimension2df& size ) _IRR_OVERRIDE_ { MaxStartSize = size; } - - //! Set the minimum starting size for particles - virtual void setMinStartSize( const core::dimension2df& size ) _IRR_OVERRIDE_ { MinStartSize = size; } - - //! Set the minimum particle life-time in milliseconds - virtual void setMinLifeTime( u32 lifeTimeMin ) _IRR_OVERRIDE_ { MinLifeTime = lifeTimeMin; } - - //! Set the maximum particle life-time in milliseconds - virtual void setMaxLifeTime( u32 lifeTimeMax ) _IRR_OVERRIDE_ { MaxLifeTime = lifeTimeMax; } - - //! Set maximal random derivation from the direction - virtual void setMaxAngleDegrees( s32 maxAngleDegrees ) _IRR_OVERRIDE_ { MaxAngleDegrees = maxAngleDegrees; } - - //! Gets direction the emitter emits particles. - virtual const core::vector3df& getDirection() const _IRR_OVERRIDE_ { return Direction; } - - //! Gets minimum number of particles emitted per second. - virtual u32 getMinParticlesPerSecond() const _IRR_OVERRIDE_ { return MinParticlesPerSecond; } - - //! Gets maximum number of particles emitted per second. - virtual u32 getMaxParticlesPerSecond() const _IRR_OVERRIDE_ { return MaxParticlesPerSecond; } - - //! Gets minimum start color. - virtual const video::SColor& getMinStartColor() const _IRR_OVERRIDE_ { return MinStartColor; } - - //! Gets maximum start color. - virtual const video::SColor& getMaxStartColor() const _IRR_OVERRIDE_ { return MaxStartColor; } - - //! Gets the maximum starting size for particles - virtual const core::dimension2df& getMaxStartSize() const _IRR_OVERRIDE_ { return MaxStartSize; } - - //! Gets the minimum starting size for particles - virtual const core::dimension2df& getMinStartSize() const _IRR_OVERRIDE_ { return MinStartSize; } - - //! Get the minimum particle life-time in milliseconds - virtual u32 getMinLifeTime() const _IRR_OVERRIDE_ { return MinLifeTime; } - - //! Get the maximum particle life-time in milliseconds - virtual u32 getMaxLifeTime() const _IRR_OVERRIDE_ { return MaxLifeTime; } - - //! Get maximal random derivation from the direction - virtual s32 getMaxAngleDegrees() const _IRR_OVERRIDE_ { return MaxAngleDegrees; } - - //! Writes attributes of the object. - virtual void serializeAttributes(io::IAttributes* out, io::SAttributeReadWriteOptions* options) const _IRR_OVERRIDE_; - - //! Reads attributes of the object. - virtual void deserializeAttributes(io::IAttributes* in, io::SAttributeReadWriteOptions* options) _IRR_OVERRIDE_; - -private: - - SParticle Particle; - core::vector3df Direction; - core::dimension2df MinStartSize, MaxStartSize; - u32 MinParticlesPerSecond, MaxParticlesPerSecond; - video::SColor MinStartColor, MaxStartColor; - u32 MinLifeTime, MaxLifeTime; - s32 MaxAngleDegrees; - - u32 Time; -}; - -} // end namespace scene -} // end namespace irr - -#endif // _IRR_COMPILE_WITH_PARTICLES_ - -#endif diff --git a/source/Irrlicht/CParticleRingEmitter.cpp b/source/Irrlicht/CParticleRingEmitter.cpp deleted file mode 100644 index 7fc6ec86..00000000 --- a/source/Irrlicht/CParticleRingEmitter.cpp +++ /dev/null @@ -1,181 +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 "CParticleRingEmitter.h" - -#ifdef _IRR_COMPILE_WITH_PARTICLES_ - -#include "os.h" -#include "IAttributes.h" - -namespace irr -{ -namespace scene -{ - -//! constructor -CParticleRingEmitter::CParticleRingEmitter( - const core::vector3df& center, f32 radius, f32 ringThickness, - const core::vector3df& direction, u32 minParticlesPerSecond, - u32 maxParticlesPerSecond, const video::SColor& minStartColor, - const video::SColor& maxStartColor, u32 lifeTimeMin, u32 lifeTimeMax, - s32 maxAngleDegrees, - const core::dimension2df& minStartSize, - const core::dimension2df& maxStartSize ) - : Center(center), Radius(radius), RingThickness(ringThickness), - Direction(direction), - MaxStartSize(maxStartSize), MinStartSize(minStartSize), - MinParticlesPerSecond(minParticlesPerSecond), - MaxParticlesPerSecond(maxParticlesPerSecond), - MinStartColor(minStartColor), MaxStartColor(maxStartColor), - MinLifeTime(lifeTimeMin), MaxLifeTime(lifeTimeMax), - Time(0), MaxAngleDegrees(maxAngleDegrees) -{ - #ifdef _DEBUG - setDebugName("CParticleRingEmitter"); - #endif -} - - -//! Prepares an array with new particles to emitt into the system -//! and returns how much new particles there are. -s32 CParticleRingEmitter::emitt(u32 now, u32 timeSinceLastCall, SParticle*& outArray) -{ - Time += timeSinceLastCall; - - u32 pps = (MaxParticlesPerSecond - MinParticlesPerSecond); - f32 perSecond = pps ? ((f32)MinParticlesPerSecond + os::Randomizer::frand() * pps) : MinParticlesPerSecond; - f32 everyWhatMillisecond = 1000.0f / perSecond; - - if(Time > everyWhatMillisecond) - { - Particles.set_used(0); - u32 amount = (u32)((Time / everyWhatMillisecond) + 0.5f); - Time = 0; - SParticle p; - - if(amount > MaxParticlesPerSecond*2) - amount = MaxParticlesPerSecond * 2; - - for(u32 i=0; i<amount; ++i) - { - f32 distance = os::Randomizer::frand() * RingThickness * 0.5f; - if (os::Randomizer::rand() % 2) - distance -= Radius; - else - distance += Radius; - - p.pos.set(Center.X + distance, Center.Y, Center.Z + distance); - p.pos.rotateXZBy(os::Randomizer::frand() * 360, Center ); - - p.startTime = now; - p.vector = Direction; - - if(MaxAngleDegrees) - { - core::vector3df tgt = Direction; - tgt.rotateXYBy(os::Randomizer::frand() * MaxAngleDegrees, Center ); - tgt.rotateYZBy(os::Randomizer::frand() * MaxAngleDegrees, Center ); - tgt.rotateXZBy(os::Randomizer::frand() * MaxAngleDegrees, Center ); - p.vector = tgt; - } - - p.endTime = now + MinLifeTime; - if (MaxLifeTime != MinLifeTime) - p.endTime += os::Randomizer::rand() % (MaxLifeTime - MinLifeTime); - - if (MinStartColor==MaxStartColor) - p.color=MinStartColor; - else - p.color = MinStartColor.getInterpolated(MaxStartColor, os::Randomizer::frand()); - - p.startColor = p.color; - p.startVector = p.vector; - - if (MinStartSize==MaxStartSize) - p.startSize = MinStartSize; - else - p.startSize = MinStartSize.getInterpolated(MaxStartSize, os::Randomizer::frand()); - p.size = p.startSize; - - Particles.push_back(p); - } - - outArray = Particles.pointer(); - - return Particles.size(); - } - - return 0; -} - -//! Writes attributes of the object. -void CParticleRingEmitter::serializeAttributes(io::IAttributes* out, io::SAttributeReadWriteOptions* options) const -{ - out->addVector3d("Center", Center); - out->addFloat("Radius", Radius); - out->addFloat("RingThickness", RingThickness); - - out->addVector3d("Direction", Direction); - out->addFloat("MinStartSizeWidth", MinStartSize.Width); - out->addFloat("MinStartSizeHeight", MinStartSize.Height); - out->addFloat("MaxStartSizeWidth", MaxStartSize.Width); - out->addFloat("MaxStartSizeHeight", MaxStartSize.Height); - out->addInt("MinParticlesPerSecond", MinParticlesPerSecond); - out->addInt("MaxParticlesPerSecond", MaxParticlesPerSecond); - out->addColor("MinStartColor", MinStartColor); - out->addColor("MaxStartColor", MaxStartColor); - out->addInt("MinLifeTime", MinLifeTime); - out->addInt("MaxLifeTime", MaxLifeTime); - out->addInt("MaxAngleDegrees", MaxAngleDegrees); -} - -//! Reads attributes of the object. -void CParticleRingEmitter::deserializeAttributes(io::IAttributes* in, io::SAttributeReadWriteOptions* options) -{ - Center = in->getAttributeAsVector3d("Center"); - Radius = in->getAttributeAsFloat("Radius"); - RingThickness = in->getAttributeAsFloat("RingThickness"); - - Direction = in->getAttributeAsVector3d("Direction"); - if (Direction.getLength() == 0) - Direction.set(0,0.01f,0); - - int idx = -1; - idx = in->findAttribute("MinStartSizeWidth"); - if ( idx >= 0 ) - MinStartSize.Width = in->getAttributeAsFloat(idx); - idx = in->findAttribute("MinStartSizeHeight"); - if ( idx >= 0 ) - MinStartSize.Height = in->getAttributeAsFloat(idx); - idx = in->findAttribute("MaxStartSizeWidth"); - if ( idx >= 0 ) - MaxStartSize.Width = in->getAttributeAsFloat(idx); - idx = in->findAttribute("MaxStartSizeHeight"); - if ( idx >= 0 ) - MaxStartSize.Height = in->getAttributeAsFloat(idx); - - MinParticlesPerSecond = in->getAttributeAsInt("MinParticlesPerSecond"); - MaxParticlesPerSecond = in->getAttributeAsInt("MaxParticlesPerSecond"); - - MinParticlesPerSecond = core::max_(1u, MinParticlesPerSecond); - MaxParticlesPerSecond = core::max_(MaxParticlesPerSecond, 1u); - MaxParticlesPerSecond = core::min_(MaxParticlesPerSecond, 200u); - MinParticlesPerSecond = core::min_(MinParticlesPerSecond, MaxParticlesPerSecond); - - MinStartColor = in->getAttributeAsColor("MinStartColor"); - MaxStartColor = in->getAttributeAsColor("MaxStartColor"); - MinLifeTime = in->getAttributeAsInt("MinLifeTime"); - MaxLifeTime = in->getAttributeAsInt("MaxLifeTime"); - MinLifeTime = core::max_(0u, MinLifeTime); - MaxLifeTime = core::max_(MaxLifeTime, MinLifeTime); - MinLifeTime = core::min_(MinLifeTime, MaxLifeTime); - - MaxAngleDegrees = in->getAttributeAsInt("MaxAngleDegrees"); -} - -} // end namespace scene -} // end namespace irr - -#endif // _IRR_COMPILE_WITH_PARTICLES_ diff --git a/source/Irrlicht/CParticleRingEmitter.h b/source/Irrlicht/CParticleRingEmitter.h deleted file mode 100644 index f36254dd..00000000 --- a/source/Irrlicht/CParticleRingEmitter.h +++ /dev/null @@ -1,151 +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_PARTICLE_RING_EMITTER_H_INCLUDED__ -#define __C_PARTICLE_RING_EMITTER_H_INCLUDED__ - -#include "IrrCompileConfig.h" -#ifdef _IRR_COMPILE_WITH_PARTICLES_ - -#include "IParticleRingEmitter.h" -#include "irrArray.h" - -namespace irr -{ -namespace scene -{ - -//! A ring emitter -class CParticleRingEmitter : public IParticleRingEmitter -{ -public: - - //! constructor - CParticleRingEmitter( - const core::vector3df& center, f32 radius, f32 ringThickness, - const core::vector3df& direction = core::vector3df(0.0f,0.03f,0.0f), - u32 minParticlesPerSecond = 20, - u32 maxParticlesPerSecond = 40, - const video::SColor& minStartColor = video::SColor(255,0,0,0), - const video::SColor& maxStartColor = video::SColor(255,255,255,255), - u32 lifeTimeMin=2000, - u32 lifeTimeMax=4000, - s32 maxAngleDegrees=0, - const core::dimension2df& minStartSize = core::dimension2df(5.0f,5.0f), - const core::dimension2df& maxStartSize = core::dimension2df(5.0f,5.0f) - ); - - //! Prepares an array with new particles to emitt into the system - //! and returns how much new particles there are. - virtual s32 emitt(u32 now, u32 timeSinceLastCall, SParticle*& outArray) _IRR_OVERRIDE_; - - //! Set direction the emitter emits particles - virtual void setDirection( const core::vector3df& newDirection ) _IRR_OVERRIDE_ { Direction = newDirection; } - - //! Set minimum number of particles the emitter emits per second - virtual void setMinParticlesPerSecond( u32 minPPS ) _IRR_OVERRIDE_ { MinParticlesPerSecond = minPPS; } - - //! Set maximum number of particles the emitter emits per second - virtual void setMaxParticlesPerSecond( u32 maxPPS ) _IRR_OVERRIDE_ { MaxParticlesPerSecond = maxPPS; } - - //! Set minimum starting color for particles - virtual void setMinStartColor( const video::SColor& color ) _IRR_OVERRIDE_ { MinStartColor = color; } - - //! Set maximum starting color for particles - virtual void setMaxStartColor( const video::SColor& color ) _IRR_OVERRIDE_ { MaxStartColor = color; } - - //! Set the maximum starting size for particles - virtual void setMaxStartSize( const core::dimension2df& size ) _IRR_OVERRIDE_ { MaxStartSize = size; } - - //! Set the minimum starting size for particles - virtual void setMinStartSize( const core::dimension2df& size ) _IRR_OVERRIDE_ { MinStartSize = size; } - - //! Set the minimum particle life-time in milliseconds - virtual void setMinLifeTime( u32 lifeTimeMin ) _IRR_OVERRIDE_ { MinLifeTime = lifeTimeMin; } - - //! Set the maximum particle life-time in milliseconds - virtual void setMaxLifeTime( u32 lifeTimeMax ) _IRR_OVERRIDE_ { MaxLifeTime = lifeTimeMax; } - - //! Set maximal random derivation from the direction - virtual void setMaxAngleDegrees( s32 maxAngleDegrees ) _IRR_OVERRIDE_ { MaxAngleDegrees = maxAngleDegrees; } - - //! Set the center of the ring - virtual void setCenter( const core::vector3df& center ) _IRR_OVERRIDE_ { Center = center; } - - //! Set the radius of the ring - virtual void setRadius( f32 radius ) _IRR_OVERRIDE_ { Radius = radius; } - - //! Set the thickness of the ring - virtual void setRingThickness( f32 ringThickness ) _IRR_OVERRIDE_ { RingThickness = ringThickness; } - - //! Gets direction the emitter emits particles - virtual const core::vector3df& getDirection() const _IRR_OVERRIDE_ { return Direction; } - - //! Gets the minimum number of particles the emitter emits per second - virtual u32 getMinParticlesPerSecond() const _IRR_OVERRIDE_ { return MinParticlesPerSecond; } - - //! Gets the maximum number of particles the emitter emits per second - virtual u32 getMaxParticlesPerSecond() const _IRR_OVERRIDE_ { return MaxParticlesPerSecond; } - - //! Gets the minimum starting color for particles - virtual const video::SColor& getMinStartColor() const _IRR_OVERRIDE_ { return MinStartColor; } - - //! Gets the maximum starting color for particles - virtual const video::SColor& getMaxStartColor() const _IRR_OVERRIDE_ { return MaxStartColor; } - - //! Gets the maximum starting size for particles - virtual const core::dimension2df& getMaxStartSize() const _IRR_OVERRIDE_ { return MaxStartSize; } - - //! Gets the minimum starting size for particles - virtual const core::dimension2df& getMinStartSize() const _IRR_OVERRIDE_ { return MinStartSize; } - - //! Get the minimum particle life-time in milliseconds - virtual u32 getMinLifeTime() const _IRR_OVERRIDE_ { return MinLifeTime; } - - //! Get the maximum particle life-time in milliseconds - virtual u32 getMaxLifeTime() const _IRR_OVERRIDE_ { return MaxLifeTime; } - - //! Get maximal random derivation from the direction - virtual s32 getMaxAngleDegrees() const _IRR_OVERRIDE_ { return MaxAngleDegrees; } - - //! Get the center of the ring - virtual const core::vector3df& getCenter() const _IRR_OVERRIDE_ { return Center; } - - //! Get the radius of the ring - virtual f32 getRadius() const _IRR_OVERRIDE_ { return Radius; } - - //! Get the thickness of the ring - virtual f32 getRingThickness() const _IRR_OVERRIDE_ { return RingThickness; } - - //! Writes attributes of the object. - virtual void serializeAttributes(io::IAttributes* out, io::SAttributeReadWriteOptions* options) const _IRR_OVERRIDE_; - - //! Reads attributes of the object. - virtual void deserializeAttributes(io::IAttributes* in, io::SAttributeReadWriteOptions* options) _IRR_OVERRIDE_; - -private: - - core::array<SParticle> Particles; - - core::vector3df Center; - f32 Radius; - f32 RingThickness; - - core::vector3df Direction; - core::dimension2df MaxStartSize, MinStartSize; - u32 MinParticlesPerSecond, MaxParticlesPerSecond; - video::SColor MinStartColor, MaxStartColor; - u32 MinLifeTime, MaxLifeTime; - - u32 Time; - s32 MaxAngleDegrees; -}; - -} // end namespace scene -} // end namespace irr - -#endif // _IRR_COMPILE_WITH_PARTICLES_ - -#endif - diff --git a/source/Irrlicht/CParticleRotationAffector.cpp b/source/Irrlicht/CParticleRotationAffector.cpp deleted file mode 100644 index f30ab964..00000000 --- a/source/Irrlicht/CParticleRotationAffector.cpp +++ /dev/null @@ -1,72 +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 "CParticleRotationAffector.h" - -#include "IrrCompileConfig.h" -#ifdef _IRR_COMPILE_WITH_PARTICLES_ - -#include "IAttributes.h" - -namespace irr -{ -namespace scene -{ - -//! constructor -CParticleRotationAffector::CParticleRotationAffector( const core::vector3df& speed, const core::vector3df& pivotPoint ) - : PivotPoint(pivotPoint), Speed(speed), LastTime(0) -{ - #ifdef _DEBUG - setDebugName("CParticleRotationAffector"); - #endif -} - - -//! Affects an array of particles. -void CParticleRotationAffector::affect(u32 now, SParticle* particlearray, u32 count) -{ - if( LastTime == 0 ) - { - LastTime = now; - return; - } - - f32 timeDelta = ( now - LastTime ) / 1000.0f; - LastTime = now; - - if( !Enabled ) - return; - - for(u32 i=0; i<count; ++i) - { - if( Speed.X != 0.0f ) - particlearray[i].pos.rotateYZBy( timeDelta * Speed.X, PivotPoint ); - - if( Speed.Y != 0.0f ) - particlearray[i].pos.rotateXZBy( timeDelta * Speed.Y, PivotPoint ); - - if( Speed.Z != 0.0f ) - particlearray[i].pos.rotateXYBy( timeDelta * Speed.Z, PivotPoint ); - } -} - -//! Writes attributes of the object. -void CParticleRotationAffector::serializeAttributes(io::IAttributes* out, io::SAttributeReadWriteOptions* options) const -{ - out->addVector3d("PivotPoint", PivotPoint); - out->addVector3d("Speed", Speed); -} - -//! Reads attributes of the object. -void CParticleRotationAffector::deserializeAttributes(io::IAttributes* in, io::SAttributeReadWriteOptions* options) -{ - PivotPoint = in->getAttributeAsVector3d("PivotPoint"); - Speed = in->getAttributeAsVector3d("Speed"); -} - -} // end namespace scene -} // end namespace irr - -#endif // _IRR_COMPILE_WITH_PARTICLES_ diff --git a/source/Irrlicht/CParticleRotationAffector.h b/source/Irrlicht/CParticleRotationAffector.h deleted file mode 100644 index 2828b8ef..00000000 --- a/source/Irrlicht/CParticleRotationAffector.h +++ /dev/null @@ -1,59 +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_PARTICLE_ROTATION_AFFECTOR_H_INCLUDED__ -#define __C_PARTICLE_ROTATION_AFFECTOR_H_INCLUDED__ - -#include "IrrCompileConfig.h" -#ifdef _IRR_COMPILE_WITH_PARTICLES_ - -#include "IParticleRotationAffector.h" - -namespace irr -{ -namespace scene -{ - -//! Particle Affector for rotating particles about a point -class CParticleRotationAffector : public IParticleRotationAffector -{ -public: - - CParticleRotationAffector( const core::vector3df& speed = core::vector3df(5.0f, 5.0f, 5.0f), - const core::vector3df& point = core::vector3df() ); - - //! Affects a particle. - virtual void affect(u32 now, SParticle* particlearray, u32 count) _IRR_OVERRIDE_; - - //! Set the point that particles will attract to - virtual void setPivotPoint( const core::vector3df& point ) _IRR_OVERRIDE_ { PivotPoint = point; } - - //! Set the speed in degrees per second - virtual void setSpeed( const core::vector3df& speed ) _IRR_OVERRIDE_ { Speed = speed; } - - //! Get the point that particles are attracted to - virtual const core::vector3df& getPivotPoint() const _IRR_OVERRIDE_ { return PivotPoint; } - - //! Get the speed in degrees per second - virtual const core::vector3df& getSpeed() const _IRR_OVERRIDE_ { return Speed; } - - //! Writes attributes of the object. - virtual void serializeAttributes(io::IAttributes* out, io::SAttributeReadWriteOptions* options) const _IRR_OVERRIDE_; - - //! Reads attributes of the object. - virtual void deserializeAttributes(io::IAttributes* in, io::SAttributeReadWriteOptions* options) _IRR_OVERRIDE_; - -private: - - core::vector3df PivotPoint; - core::vector3df Speed; - u32 LastTime; -}; - -} // end namespace scene -} // end namespace irr - -#endif // _IRR_COMPILE_WITH_PARTICLES_ - -#endif // __C_PARTICLE_ROTATION_AFFECTOR_H_INCLUDED__ diff --git a/source/Irrlicht/CParticleScaleAffector.cpp b/source/Irrlicht/CParticleScaleAffector.cpp deleted file mode 100644 index 9b8d0262..00000000 --- a/source/Irrlicht/CParticleScaleAffector.cpp +++ /dev/null @@ -1,57 +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 "CParticleScaleAffector.h" - -#ifdef _IRR_COMPILE_WITH_PARTICLES_ - -#include "IAttributes.h" - -namespace irr -{ - namespace scene - { - CParticleScaleAffector::CParticleScaleAffector(const core::dimension2df& scaleTo) - : ScaleTo(scaleTo) - { - #ifdef _DEBUG - setDebugName("CParticleScaleAffector"); - #endif - } - - - void CParticleScaleAffector::affect (u32 now, SParticle *particlearray, u32 count) - { - for(u32 i=0;i<count;i++) - { - const u32 maxdiff = particlearray[i].endTime - particlearray[i].startTime; - const u32 curdiff = now - particlearray[i].startTime; - const f32 newscale = (f32)curdiff/maxdiff; - particlearray[i].size = particlearray[i].startSize+ScaleTo*newscale; - } - } - - - void CParticleScaleAffector::serializeAttributes(io::IAttributes* out, io::SAttributeReadWriteOptions* options) const - { - out->addFloat("ScaleToWidth", ScaleTo.Width); - out->addFloat("ScaleToHeight", ScaleTo.Height); - } - - - void CParticleScaleAffector::deserializeAttributes(io::IAttributes* in, io::SAttributeReadWriteOptions* options) - { - ScaleTo.Width = in->getAttributeAsFloat("ScaleToWidth"); - ScaleTo.Height = in->getAttributeAsFloat("ScaleToHeight"); - } - - - E_PARTICLE_AFFECTOR_TYPE CParticleScaleAffector::getType() const - { - return scene::EPAT_SCALE; - } - } -} - -#endif // _IRR_COMPILE_WITH_PARTICLES_ diff --git a/source/Irrlicht/CParticleScaleAffector.h b/source/Irrlicht/CParticleScaleAffector.h deleted file mode 100644 index 0f403c91..00000000 --- a/source/Irrlicht/CParticleScaleAffector.h +++ /dev/null @@ -1,48 +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_PARTICLE_SCALE_AFFECTOR_H -#define C_PARTICLE_SCALE_AFFECTOR_H - -#include "IrrCompileConfig.h" -#ifdef _IRR_COMPILE_WITH_PARTICLES_ - -#include "IParticleAffector.h" - -namespace irr -{ - namespace scene - { - class CParticleScaleAffector : public IParticleAffector - { - public: - CParticleScaleAffector(const core::dimension2df& scaleTo = core::dimension2df(1.0f, 1.0f)); - - virtual void affect(u32 now, SParticle *particlearray, u32 count) _IRR_OVERRIDE_; - - //! Writes attributes of the object. - //! Implement this to expose the attributes of your scene node animator for - //! scripting languages, editors, debuggers or xml serialization purposes. - virtual void serializeAttributes(io::IAttributes* out, io::SAttributeReadWriteOptions* options) const _IRR_OVERRIDE_; - - //! Reads attributes of the object. - //! Implement this to set the attributes of your scene node animator for - //! scripting languages, editors, debuggers or xml deserialization purposes. - //! \param startIndex: start index where to start reading attributes. - //! \return: returns last index of an attribute read by this affector - virtual void deserializeAttributes(io::IAttributes* in, io::SAttributeReadWriteOptions* options) _IRR_OVERRIDE_; - - //! Get emitter type - virtual E_PARTICLE_AFFECTOR_TYPE getType() const _IRR_OVERRIDE_; - - protected: - core::dimension2df ScaleTo; - }; - } -} - -#endif // _IRR_COMPILE_WITH_PARTICLES_ - -#endif // C_PARTICLE_SCALE_AFFECTOR_H - diff --git a/source/Irrlicht/CParticleSphereEmitter.cpp b/source/Irrlicht/CParticleSphereEmitter.cpp deleted file mode 100644 index c97d6daa..00000000 --- a/source/Irrlicht/CParticleSphereEmitter.cpp +++ /dev/null @@ -1,178 +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 "CParticleSphereEmitter.h" - -#ifdef _IRR_COMPILE_WITH_PARTICLES_ - -#include "os.h" -#include "IAttributes.h" - -namespace irr -{ -namespace scene -{ - -//! constructor -CParticleSphereEmitter::CParticleSphereEmitter( - const core::vector3df& center, f32 radius, - const core::vector3df& direction, u32 minParticlesPerSecond, - u32 maxParticlesPerSecond, const video::SColor& minStartColor, - const video::SColor& maxStartColor, u32 lifeTimeMin, u32 lifeTimeMax, - s32 maxAngleDegrees, - const core::dimension2df& minStartSize, - const core::dimension2df& maxStartSize ) - : Center(center), Radius(radius), Direction(direction), - MinStartSize(minStartSize), MaxStartSize(maxStartSize), - MinParticlesPerSecond(minParticlesPerSecond), - MaxParticlesPerSecond(maxParticlesPerSecond), - MinStartColor(minStartColor), MaxStartColor(maxStartColor), - MinLifeTime(lifeTimeMin), MaxLifeTime(lifeTimeMax), - Time(0), MaxAngleDegrees(maxAngleDegrees) -{ - #ifdef _DEBUG - setDebugName("CParticleSphereEmitter"); - #endif - -} - - -//! Prepares an array with new particles to emitt into the system -//! and returns how much new particles there are. -s32 CParticleSphereEmitter::emitt(u32 now, u32 timeSinceLastCall, SParticle*& outArray) -{ - Time += timeSinceLastCall; - - const u32 pps = (MaxParticlesPerSecond - MinParticlesPerSecond); - const f32 perSecond = pps ? ((f32)MinParticlesPerSecond + os::Randomizer::frand() * pps) : MinParticlesPerSecond; - const f32 everyWhatMillisecond = 1000.0f / perSecond; - - if(Time > everyWhatMillisecond) - { - Particles.set_used(0); - u32 amount = (u32)((Time / everyWhatMillisecond) + 0.5f); - Time = 0; - SParticle p; - - if(amount > MaxParticlesPerSecond*2) - amount = MaxParticlesPerSecond * 2; - - for(u32 i=0; i<amount; ++i) - { - // Random distance from center - const f32 distance = os::Randomizer::frand() * Radius; - - // Random direction from center - p.pos.set(Center + distance); - p.pos.rotateXYBy(os::Randomizer::frand() * 360.f, Center ); - p.pos.rotateYZBy(os::Randomizer::frand() * 360.f, Center ); - p.pos.rotateXZBy(os::Randomizer::frand() * 360.f, Center ); - - p.startTime = now; - p.vector = Direction; - - if(MaxAngleDegrees) - { - core::vector3df tgt = Direction; - tgt.rotateXYBy(os::Randomizer::frand() * MaxAngleDegrees); - tgt.rotateYZBy(os::Randomizer::frand() * MaxAngleDegrees); - tgt.rotateXZBy(os::Randomizer::frand() * MaxAngleDegrees); - p.vector = tgt; - } - - p.endTime = now + MinLifeTime; - if (MaxLifeTime != MinLifeTime) - p.endTime += os::Randomizer::rand() % (MaxLifeTime - MinLifeTime); - - if (MinStartColor==MaxStartColor) - p.color=MinStartColor; - else - p.color = MinStartColor.getInterpolated(MaxStartColor, os::Randomizer::frand()); - - p.startColor = p.color; - p.startVector = p.vector; - - if (MinStartSize==MaxStartSize) - p.startSize = MinStartSize; - else - p.startSize = MinStartSize.getInterpolated(MaxStartSize, os::Randomizer::frand()); - p.size = p.startSize; - - Particles.push_back(p); - } - - outArray = Particles.pointer(); - - return Particles.size(); - } - - return 0; -} - -//! Writes attributes of the object. -void CParticleSphereEmitter::serializeAttributes(io::IAttributes* out, io::SAttributeReadWriteOptions* options) const -{ - out->addVector3d("Center", Direction); - out->addFloat("Radius", Radius); - - out->addVector3d("Direction", Direction); - out->addFloat("MinStartSizeWidth", MinStartSize.Width); - out->addFloat("MinStartSizeHeight", MinStartSize.Height); - out->addFloat("MaxStartSizeWidth", MaxStartSize.Width); - out->addFloat("MaxStartSizeHeight", MaxStartSize.Height); - out->addInt("MinParticlesPerSecond", MinParticlesPerSecond); - out->addInt("MaxParticlesPerSecond", MaxParticlesPerSecond); - out->addColor("MinStartColor", MinStartColor); - out->addColor("MaxStartColor", MaxStartColor); - out->addInt("MinLifeTime", MinLifeTime); - out->addInt("MaxLifeTime", MaxLifeTime); - out->addInt("MaxAngleDegrees", MaxAngleDegrees); -} - -//! Reads attributes of the object. -void CParticleSphereEmitter::deserializeAttributes(io::IAttributes* in, io::SAttributeReadWriteOptions* options) -{ - Center = in->getAttributeAsVector3d("Center"); - Radius = in->getAttributeAsFloat("Radius"); - - Direction = in->getAttributeAsVector3d("Direction"); - if (Direction.getLength() == 0) - Direction.set(0,0.01f,0); - - int idx = -1; - idx = in->findAttribute("MinStartSizeWidth"); - if ( idx >= 0 ) - MinStartSize.Width = in->getAttributeAsFloat(idx); - idx = in->findAttribute("MinStartSizeHeight"); - if ( idx >= 0 ) - MinStartSize.Height = in->getAttributeAsFloat(idx); - idx = in->findAttribute("MaxStartSizeWidth"); - if ( idx >= 0 ) - MaxStartSize.Width = in->getAttributeAsFloat(idx); - idx = in->findAttribute("MaxStartSizeHeight"); - if ( idx >= 0 ) - MaxStartSize.Height = in->getAttributeAsFloat(idx); - MinParticlesPerSecond = in->getAttributeAsInt("MinParticlesPerSecond"); - MaxParticlesPerSecond = in->getAttributeAsInt("MaxParticlesPerSecond"); - - MinParticlesPerSecond = core::max_(1u, MinParticlesPerSecond); - MaxParticlesPerSecond = core::max_(MaxParticlesPerSecond, 1u); - MaxParticlesPerSecond = core::min_(MaxParticlesPerSecond, 200u); - MinParticlesPerSecond = core::min_(MinParticlesPerSecond, MaxParticlesPerSecond); - - MinStartColor = in->getAttributeAsColor("MinStartColor"); - MaxStartColor = in->getAttributeAsColor("MaxStartColor"); - MinLifeTime = in->getAttributeAsInt("MinLifeTime"); - MaxLifeTime = in->getAttributeAsInt("MaxLifeTime"); - MinLifeTime = core::max_(0u, MinLifeTime); - MaxLifeTime = core::max_(MaxLifeTime, MinLifeTime); - MinLifeTime = core::min_(MinLifeTime, MaxLifeTime); - - MaxAngleDegrees = in->getAttributeAsInt("MaxAngleDegrees"); -} - -} // end namespace scene -} // end namespace irr - -#endif // _IRR_COMPILE_WITH_PARTICLES_ diff --git a/source/Irrlicht/CParticleSphereEmitter.h b/source/Irrlicht/CParticleSphereEmitter.h deleted file mode 100644 index 1d9475bd..00000000 --- a/source/Irrlicht/CParticleSphereEmitter.h +++ /dev/null @@ -1,144 +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_PARTICLE_SPHERE_EMITTER_H_INCLUDED__ -#define __C_PARTICLE_SPHERE_EMITTER_H_INCLUDED__ - -#include "IrrCompileConfig.h" -#ifdef _IRR_COMPILE_WITH_PARTICLES_ - -#include "IParticleSphereEmitter.h" -#include "irrArray.h" -#include "aabbox3d.h" - -namespace irr -{ -namespace scene -{ - -//! A default box emitter -class CParticleSphereEmitter : public IParticleSphereEmitter -{ -public: - - //! constructor - CParticleSphereEmitter( - const core::vector3df& center, f32 radius, - const core::vector3df& direction = core::vector3df(0.0f,0.03f,0.0f), - u32 minParticlesPerSecond = 20, - u32 maxParticlesPerSecond = 40, - const video::SColor& minStartColor = video::SColor(255,0,0,0), - const video::SColor& maxStartColor = video::SColor(255,255,255,255), - u32 lifeTimeMin=2000, - u32 lifeTimeMax=4000, - s32 maxAngleDegrees=0, - const core::dimension2df& minStartSize = core::dimension2df(5.0f,5.0f), - const core::dimension2df& maxStartSize = core::dimension2df(5.0f,5.0f) ); - - //! Prepares an array with new particles to emitt into the system - //! and returns how much new particles there are. - virtual s32 emitt(u32 now, u32 timeSinceLastCall, SParticle*& outArray) _IRR_OVERRIDE_; - - //! Set direction the emitter emits particles - virtual void setDirection( const core::vector3df& newDirection ) _IRR_OVERRIDE_ { Direction = newDirection; } - - //! Set minimum number of particles per second. - virtual void setMinParticlesPerSecond( u32 minPPS ) _IRR_OVERRIDE_ { MinParticlesPerSecond = minPPS; } - - //! Set maximum number of particles per second. - virtual void setMaxParticlesPerSecond( u32 maxPPS ) _IRR_OVERRIDE_ { MaxParticlesPerSecond = maxPPS; } - - //! Set minimum start color - virtual void setMinStartColor( const video::SColor& color ) _IRR_OVERRIDE_ { MinStartColor = color; } - - //! Set maximum start color - virtual void setMaxStartColor( const video::SColor& color ) _IRR_OVERRIDE_ { MaxStartColor = color; } - - //! Set the maximum starting size for particles - virtual void setMaxStartSize( const core::dimension2df& size ) _IRR_OVERRIDE_ { MaxStartSize = size; } - - //! Set the minimum starting size for particles - virtual void setMinStartSize( const core::dimension2df& size ) _IRR_OVERRIDE_ { MinStartSize = size; } - - //! Set the minimum particle life-time in milliseconds - virtual void setMinLifeTime( u32 lifeTimeMin ) _IRR_OVERRIDE_ { MinLifeTime = lifeTimeMin; } - - //! Set the maximum particle life-time in milliseconds - virtual void setMaxLifeTime( u32 lifeTimeMax ) _IRR_OVERRIDE_ { MaxLifeTime = lifeTimeMax; } - - //! Set maximal random derivation from the direction - virtual void setMaxAngleDegrees( s32 maxAngleDegrees ) _IRR_OVERRIDE_ { MaxAngleDegrees = maxAngleDegrees; } - - //! Set the center of the sphere for particle emissions - virtual void setCenter( const core::vector3df& center ) _IRR_OVERRIDE_ { Center = center; } - - //! Set the radius of the sphere for particle emissions - virtual void setRadius( f32 radius ) _IRR_OVERRIDE_ { Radius = radius; } - - //! Gets direction the emitter emits particles - virtual const core::vector3df& getDirection() const _IRR_OVERRIDE_ { return Direction; } - - //! Get minimum number of particles per second. - virtual u32 getMinParticlesPerSecond() const _IRR_OVERRIDE_ { return MinParticlesPerSecond; } - - //! Get maximum number of particles per second. - virtual u32 getMaxParticlesPerSecond() const _IRR_OVERRIDE_ { return MaxParticlesPerSecond; } - - //! Get minimum start color - virtual const video::SColor& getMinStartColor() const _IRR_OVERRIDE_ { return MinStartColor; } - - //! Get maximum start color - virtual const video::SColor& getMaxStartColor() const _IRR_OVERRIDE_ { return MaxStartColor; } - - //! Gets the maximum starting size for particles - virtual const core::dimension2df& getMaxStartSize() const _IRR_OVERRIDE_ { return MaxStartSize; } - - //! Gets the minimum starting size for particles - virtual const core::dimension2df& getMinStartSize() const _IRR_OVERRIDE_ { return MinStartSize; } - - //! Get the minimum particle life-time in milliseconds - virtual u32 getMinLifeTime() const _IRR_OVERRIDE_ { return MinLifeTime; } - - //! Get the maximum particle life-time in milliseconds - virtual u32 getMaxLifeTime() const _IRR_OVERRIDE_ { return MaxLifeTime; } - - //! Get maximal random derivation from the direction - virtual s32 getMaxAngleDegrees() const _IRR_OVERRIDE_ { return MaxAngleDegrees; } - - //! Get the center of the sphere for particle emissions - virtual const core::vector3df& getCenter() const _IRR_OVERRIDE_ { return Center; } - - //! Get the radius of the sphere for particle emissions - virtual f32 getRadius() const _IRR_OVERRIDE_ { return Radius; } - - //! Writes attributes of the object. - virtual void serializeAttributes(io::IAttributes* out, io::SAttributeReadWriteOptions* options) const _IRR_OVERRIDE_; - - //! Reads attributes of the object. - virtual void deserializeAttributes(io::IAttributes* in, io::SAttributeReadWriteOptions* options) _IRR_OVERRIDE_; - -private: - - core::array<SParticle> Particles; - - core::vector3df Center; - f32 Radius; - core::vector3df Direction; - - core::dimension2df MinStartSize, MaxStartSize; - u32 MinParticlesPerSecond, MaxParticlesPerSecond; - video::SColor MinStartColor, MaxStartColor; - u32 MinLifeTime, MaxLifeTime; - - u32 Time; - s32 MaxAngleDegrees; -}; - -} // end namespace scene -} // end namespace irr - -#endif // _IRR_COMPILE_WITH_PARTICLES_ - -#endif - diff --git a/source/Irrlicht/CParticleSystemSceneNode.cpp b/source/Irrlicht/CParticleSystemSceneNode.cpp deleted file mode 100644 index 994a43c3..00000000 --- a/source/Irrlicht/CParticleSystemSceneNode.cpp +++ /dev/null @@ -1,786 +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 "CParticleSystemSceneNode.h" - -#ifdef _IRR_COMPILE_WITH_PARTICLES_ - -#include "os.h" -#include "ISceneManager.h" -#include "ICameraSceneNode.h" -#include "IVideoDriver.h" - -#include "CParticleAnimatedMeshSceneNodeEmitter.h" -#include "CParticleBoxEmitter.h" -#include "CParticleCylinderEmitter.h" -#include "CParticleMeshEmitter.h" -#include "CParticlePointEmitter.h" -#include "CParticleRingEmitter.h" -#include "CParticleSphereEmitter.h" -#include "CParticleAttractionAffector.h" -#include "CParticleFadeOutAffector.h" -#include "CParticleGravityAffector.h" -#include "CParticleRotationAffector.h" -#include "CParticleScaleAffector.h" -#include "SViewFrustum.h" - -namespace irr -{ -namespace scene -{ - -//! constructor -CParticleSystemSceneNode::CParticleSystemSceneNode(bool createDefaultEmitter, - ISceneNode* parent, ISceneManager* mgr, s32 id, - const core::vector3df& position, const core::vector3df& rotation, - const core::vector3df& scale) - : IParticleSystemSceneNode(parent, mgr, id, position, rotation, scale), - Emitter(0), ParticleSize(core::dimension2d<f32>(5.0f, 5.0f)), LastEmitTime(0), - Buffer(0), ParticlesAreGlobal(true) -{ - #ifdef _DEBUG - setDebugName("CParticleSystemSceneNode"); - #endif - - Buffer = new SMeshBuffer(); - if (createDefaultEmitter) - { - IParticleEmitter* e = createBoxEmitter(); - setEmitter(e); - e->drop(); - } -} - - -//! destructor -CParticleSystemSceneNode::~CParticleSystemSceneNode() -{ - if (Emitter) - Emitter->drop(); - if (Buffer) - Buffer->drop(); - - removeAllAffectors(); -} - - -//! Gets the particle emitter, which creates the particles. -IParticleEmitter* CParticleSystemSceneNode::getEmitter() -{ - return Emitter; -} - - -//! Sets the particle emitter, which creates the particles. -void CParticleSystemSceneNode::setEmitter(IParticleEmitter* emitter) -{ - if (emitter == Emitter) - return; - if (Emitter) - Emitter->drop(); - - Emitter = emitter; - - if (Emitter) - Emitter->grab(); -} - - -//! Adds new particle effector to the particle system. -void CParticleSystemSceneNode::addAffector(IParticleAffector* affector) -{ - affector->grab(); - AffectorList.push_back(affector); -} - -//! Get a list of all particle affectors. -const core::list<IParticleAffector*>& CParticleSystemSceneNode::getAffectors() const -{ - return AffectorList; -} - -//! Removes all particle affectors in the particle system. -void CParticleSystemSceneNode::removeAllAffectors() -{ - core::list<IParticleAffector*>::Iterator it = AffectorList.begin(); - while (it != AffectorList.end()) - { - (*it)->drop(); - it = AffectorList.erase(it); - } -} - - -//! Returns the material based on the zero based index i. -video::SMaterial& CParticleSystemSceneNode::getMaterial(u32 i) -{ - return Buffer->Material; -} - - -//! Returns amount of materials used by this scene node. -u32 CParticleSystemSceneNode::getMaterialCount() const -{ - return 1; -} - - -//! Creates a particle emitter for an animated mesh scene node -IParticleAnimatedMeshSceneNodeEmitter* -CParticleSystemSceneNode::createAnimatedMeshSceneNodeEmitter( - scene::IAnimatedMeshSceneNode* node, bool useNormalDirection, - const core::vector3df& direction, f32 normalDirectionModifier, - s32 mbNumber, bool everyMeshVertex, - u32 minParticlesPerSecond, u32 maxParticlesPerSecond, - const video::SColor& minStartColor, const video::SColor& maxStartColor, - u32 lifeTimeMin, u32 lifeTimeMax, s32 maxAngleDegrees, - const core::dimension2df& minStartSize, - const core::dimension2df& maxStartSize ) -{ - return new CParticleAnimatedMeshSceneNodeEmitter( node, - useNormalDirection, direction, normalDirectionModifier, - mbNumber, everyMeshVertex, - minParticlesPerSecond, maxParticlesPerSecond, - minStartColor, maxStartColor, - lifeTimeMin, lifeTimeMax, maxAngleDegrees, - minStartSize, maxStartSize ); -} - - -//! Creates a box particle emitter. -IParticleBoxEmitter* CParticleSystemSceneNode::createBoxEmitter( - const core::aabbox3df& box, const core::vector3df& direction, - u32 minParticlesPerSecond, u32 maxParticlesPerSecond, - const video::SColor& minStartColor, const video::SColor& maxStartColor, - u32 lifeTimeMin, u32 lifeTimeMax, - s32 maxAngleDegrees, const core::dimension2df& minStartSize, - const core::dimension2df& maxStartSize ) -{ - return new CParticleBoxEmitter(box, direction, minParticlesPerSecond, - maxParticlesPerSecond, minStartColor, maxStartColor, - lifeTimeMin, lifeTimeMax, maxAngleDegrees, - minStartSize, maxStartSize ); -} - - -//! Creates a particle emitter for emitting from a cylinder -IParticleCylinderEmitter* CParticleSystemSceneNode::createCylinderEmitter( - const core::vector3df& center, f32 radius, - const core::vector3df& normal, f32 length, - bool outlineOnly, const core::vector3df& direction, - u32 minParticlesPerSecond, u32 maxParticlesPerSecond, - const video::SColor& minStartColor, const video::SColor& maxStartColor, - u32 lifeTimeMin, u32 lifeTimeMax, s32 maxAngleDegrees, - const core::dimension2df& minStartSize, - const core::dimension2df& maxStartSize ) -{ - return new CParticleCylinderEmitter( center, radius, normal, length, - outlineOnly, direction, - minParticlesPerSecond, maxParticlesPerSecond, - minStartColor, maxStartColor, - lifeTimeMin, lifeTimeMax, maxAngleDegrees, - minStartSize, maxStartSize ); -} - - -//! Creates a mesh particle emitter. -IParticleMeshEmitter* CParticleSystemSceneNode::createMeshEmitter( - scene::IMesh* mesh, bool useNormalDirection, - const core::vector3df& direction, f32 normalDirectionModifier, - s32 mbNumber, bool everyMeshVertex, - u32 minParticlesPerSecond, u32 maxParticlesPerSecond, - const video::SColor& minStartColor, const video::SColor& maxStartColor, - u32 lifeTimeMin, u32 lifeTimeMax, s32 maxAngleDegrees, - const core::dimension2df& minStartSize, - const core::dimension2df& maxStartSize) -{ - return new CParticleMeshEmitter( mesh, useNormalDirection, direction, - normalDirectionModifier, mbNumber, everyMeshVertex, - minParticlesPerSecond, maxParticlesPerSecond, - minStartColor, maxStartColor, - lifeTimeMin, lifeTimeMax, maxAngleDegrees, - minStartSize, maxStartSize ); -} - - -//! Creates a point particle emitter. -IParticlePointEmitter* CParticleSystemSceneNode::createPointEmitter( - const core::vector3df& direction, u32 minParticlesPerSecond, - u32 maxParticlesPerSecond, const video::SColor& minStartColor, - const video::SColor& maxStartColor, u32 lifeTimeMin, u32 lifeTimeMax, - s32 maxAngleDegrees, const core::dimension2df& minStartSize, - const core::dimension2df& maxStartSize ) -{ - return new CParticlePointEmitter(direction, minParticlesPerSecond, - maxParticlesPerSecond, minStartColor, maxStartColor, - lifeTimeMin, lifeTimeMax, maxAngleDegrees, - minStartSize, maxStartSize ); -} - - -//! Creates a ring particle emitter. -IParticleRingEmitter* CParticleSystemSceneNode::createRingEmitter( - const core::vector3df& center, f32 radius, f32 ringThickness, - const core::vector3df& direction, - u32 minParticlesPerSecond, u32 maxParticlesPerSecond, - const video::SColor& minStartColor, const video::SColor& maxStartColor, - u32 lifeTimeMin, u32 lifeTimeMax, s32 maxAngleDegrees, - const core::dimension2df& minStartSize, const core::dimension2df& maxStartSize ) -{ - return new CParticleRingEmitter( center, radius, ringThickness, direction, - minParticlesPerSecond, maxParticlesPerSecond, minStartColor, - maxStartColor, lifeTimeMin, lifeTimeMax, maxAngleDegrees, - minStartSize, maxStartSize ); -} - - -//! Creates a sphere particle emitter. -IParticleSphereEmitter* CParticleSystemSceneNode::createSphereEmitter( - const core::vector3df& center, f32 radius, const core::vector3df& direction, - u32 minParticlesPerSecond, u32 maxParticlesPerSecond, - const video::SColor& minStartColor, const video::SColor& maxStartColor, - u32 lifeTimeMin, u32 lifeTimeMax, - s32 maxAngleDegrees, const core::dimension2df& minStartSize, - const core::dimension2df& maxStartSize ) -{ - return new CParticleSphereEmitter(center, radius, direction, - minParticlesPerSecond, maxParticlesPerSecond, - minStartColor, maxStartColor, - lifeTimeMin, lifeTimeMax, maxAngleDegrees, - minStartSize, maxStartSize ); -} - - -//! Creates a point attraction affector. This affector modifies the positions of the -//! particles and attracts them to a specified point at a specified speed per second. -IParticleAttractionAffector* CParticleSystemSceneNode::createAttractionAffector( - const core::vector3df& point, f32 speed, bool attract, - bool affectX, bool affectY, bool affectZ ) -{ - return new CParticleAttractionAffector( point, speed, attract, affectX, affectY, affectZ ); -} - -//! Creates a scale particle affector. -IParticleAffector* CParticleSystemSceneNode::createScaleParticleAffector(const core::dimension2df& scaleTo) -{ - return new CParticleScaleAffector(scaleTo); -} - - -//! Creates a fade out particle affector. -IParticleFadeOutAffector* CParticleSystemSceneNode::createFadeOutParticleAffector( - const video::SColor& targetColor, u32 timeNeededToFadeOut) -{ - return new CParticleFadeOutAffector(targetColor, timeNeededToFadeOut); -} - - -//! Creates a gravity affector. -IParticleGravityAffector* CParticleSystemSceneNode::createGravityAffector( - const core::vector3df& gravity, u32 timeForceLost) -{ - return new CParticleGravityAffector(gravity, timeForceLost); -} - - -//! Creates a rotation affector. This affector rotates the particles around a specified pivot -//! point. The speed represents Degrees of rotation per second. -IParticleRotationAffector* CParticleSystemSceneNode::createRotationAffector( - const core::vector3df& speed, const core::vector3df& pivotPoint ) -{ - return new CParticleRotationAffector( speed, pivotPoint ); -} - - -//! pre render event -void CParticleSystemSceneNode::OnRegisterSceneNode() -{ - doParticleSystem(os::Timer::getTime()); - - if (IsVisible && (Particles.size() != 0)) - { - SceneManager->registerNodeForRendering(this); - ISceneNode::OnRegisterSceneNode(); - } -} - - -//! render -void CParticleSystemSceneNode::render() -{ - video::IVideoDriver* driver = SceneManager->getVideoDriver(); - ICameraSceneNode* camera = SceneManager->getActiveCamera(); - - if (!camera || !driver) - return; - - -#if 0 - // calculate vectors for letting particles look to camera - core::vector3df view(camera->getTarget() - camera->getAbsolutePosition()); - view.normalize(); - - view *= -1.0f; - -#else - - const core::matrix4 &m = camera->getViewFrustum()->getTransform( video::ETS_VIEW ); - - const core::vector3df view ( -m[2], -m[6] , -m[10] ); - -#endif - - // reallocate arrays, if they are too small - reallocateBuffers(); - - // create particle vertex data - s32 idx = 0; - for (u32 i=0; i<Particles.size(); ++i) - { - const SParticle& particle = Particles[i]; - - #if 0 - core::vector3df horizontal = camera->getUpVector().crossProduct(view); - horizontal.normalize(); - horizontal *= 0.5f * particle.size.Width; - - core::vector3df vertical = horizontal.crossProduct(view); - vertical.normalize(); - vertical *= 0.5f * particle.size.Height; - - #else - f32 f; - - f = 0.5f * particle.size.Width; - const core::vector3df horizontal ( m[0] * f, m[4] * f, m[8] * f ); - - f = -0.5f * particle.size.Height; - const core::vector3df vertical ( m[1] * f, m[5] * f, m[9] * f ); - #endif - - Buffer->Vertices[0+idx].Pos = particle.pos + horizontal + vertical; - Buffer->Vertices[0+idx].Color = particle.color; - Buffer->Vertices[0+idx].Normal = view; - - Buffer->Vertices[1+idx].Pos = particle.pos + horizontal - vertical; - Buffer->Vertices[1+idx].Color = particle.color; - Buffer->Vertices[1+idx].Normal = view; - - Buffer->Vertices[2+idx].Pos = particle.pos - horizontal - vertical; - Buffer->Vertices[2+idx].Color = particle.color; - Buffer->Vertices[2+idx].Normal = view; - - Buffer->Vertices[3+idx].Pos = particle.pos - horizontal + vertical; - Buffer->Vertices[3+idx].Color = particle.color; - Buffer->Vertices[3+idx].Normal = view; - - idx +=4; - } - - // render all - core::matrix4 mat; - if (!ParticlesAreGlobal) - mat.setTranslation(AbsoluteTransformation.getTranslation()); - driver->setTransform(video::ETS_WORLD, mat); - - driver->setMaterial(Buffer->Material); - - driver->drawVertexPrimitiveList(Buffer->getVertices(), Particles.size()*4, - Buffer->getIndices(), Particles.size()*2, video::EVT_STANDARD, EPT_TRIANGLES,Buffer->getIndexType()); - - // for debug purposes only: - if ( DebugDataVisible & scene::EDS_BBOX ) - { - driver->setTransform(video::ETS_WORLD, AbsoluteTransformation); - video::SMaterial deb_m; - deb_m.Lighting = false; - driver->setMaterial(deb_m); - driver->draw3DBox(Buffer->BoundingBox, video::SColor(0,255,255,255)); - } -} - - -//! returns the axis aligned bounding box of this node -const core::aabbox3d<f32>& CParticleSystemSceneNode::getBoundingBox() const -{ - return Buffer->getBoundingBox(); -} - - -void CParticleSystemSceneNode::doParticleSystem(u32 time) -{ - if (LastEmitTime==0) - { - LastEmitTime = time; - LastAbsoluteTransformation = AbsoluteTransformation; - return; - } - - u32 now = time; - u32 timediff = time - LastEmitTime; - LastEmitTime = time; - - - bool visible = isVisible(); - int behavior = getParticleBehavior(); - // run emitter - - if (Emitter && (visible || behavior & EPB_INVISIBLE_EMITTING) ) - { - SParticle* array = 0; - s32 newParticles = Emitter->emitt(now, timediff, array); - - if (newParticles && array) - { - s32 j=Particles.size(); - if (newParticles > 16250-j) // avoid having more than 64k vertices in the scenenode - newParticles=16250-j; - Particles.set_used(j+newParticles); - for (s32 i=j; i<j+newParticles; ++i) - { - Particles[i]=array[i-j]; - - if ( ParticlesAreGlobal && behavior & EPB_EMITTER_FRAME_INTERPOLATION ) - { - // Interpolate between current node transformations and last ones. - // (Lazy solution - calculating twice and interpolating results) - f32 randInterpolate = (f32)(os::Randomizer::rand() % 101) / 100.f; // 0 to 1 - core::vector3df posNow(Particles[i].pos); - core::vector3df posLast(Particles[i].pos); - - AbsoluteTransformation.transformVect(posNow); - LastAbsoluteTransformation.transformVect(posLast); - Particles[i].pos = posNow.getInterpolated(posLast, randInterpolate); - - if ( !(behavior & EPB_EMITTER_VECTOR_IGNORE_ROTATION) ) - { - core::vector3df vecNow(Particles[i].startVector); - core::vector3df vecOld(Particles[i].startVector); - AbsoluteTransformation.rotateVect(vecNow); - LastAbsoluteTransformation.rotateVect(vecOld); - Particles[i].startVector = vecNow.getInterpolated(vecOld, randInterpolate); - - vecNow = Particles[i].vector; - vecOld = Particles[i].vector; - AbsoluteTransformation.rotateVect(vecNow); - LastAbsoluteTransformation.rotateVect(vecOld); - Particles[i].vector = vecNow.getInterpolated(vecOld, randInterpolate); - } - } - else - { - if (ParticlesAreGlobal) - AbsoluteTransformation.transformVect(Particles[i].pos); - - if ( !(behavior & EPB_EMITTER_VECTOR_IGNORE_ROTATION) ) - { - if (!ParticlesAreGlobal) - AbsoluteTransformation.rotateVect(Particles[i].pos); - - AbsoluteTransformation.rotateVect(Particles[i].startVector); - AbsoluteTransformation.rotateVect(Particles[i].vector); - } - } - } - } - } - - // run affectors - if ( visible || behavior & EPB_INVISIBLE_AFFECTING ) - { - core::list<IParticleAffector*>::Iterator ait = AffectorList.begin(); - for (; ait != AffectorList.end(); ++ait) - (*ait)->affect(now, Particles.pointer(), Particles.size()); - } - - if (ParticlesAreGlobal) - Buffer->BoundingBox.reset(AbsoluteTransformation.getTranslation()); - else - Buffer->BoundingBox.reset(core::vector3df(0,0,0)); - - // animate all particles - if ( visible || behavior & EPB_INVISIBLE_ANIMATING ) - { - f32 scale = (f32)timediff; - - for (u32 i=0; i<Particles.size();) - { - // erase is pretty expensive! - if (now > Particles[i].endTime) - { - // Particle order does not seem to matter. - // So we can delete by switching with last particle and deleting that one. - // This is a lot faster and speed is very important here as the erase otherwise - // can cause noticable freezes. - Particles[i] = Particles[Particles.size()-1]; - Particles.erase( Particles.size()-1 ); - } - else - { - Particles[i].pos += (Particles[i].vector * scale); - Buffer->BoundingBox.addInternalPoint(Particles[i].pos); - ++i; - } - } - } - - const f32 m = (ParticleSize.Width > ParticleSize.Height ? ParticleSize.Width : ParticleSize.Height) * 0.5f; - Buffer->BoundingBox.MaxEdge.X += m; - Buffer->BoundingBox.MaxEdge.Y += m; - Buffer->BoundingBox.MaxEdge.Z += m; - - Buffer->BoundingBox.MinEdge.X -= m; - Buffer->BoundingBox.MinEdge.Y -= m; - Buffer->BoundingBox.MinEdge.Z -= m; - - if (ParticlesAreGlobal) - { - core::matrix4 absinv( AbsoluteTransformation, core::matrix4::EM4CONST_INVERSE ); - absinv.transformBoxEx(Buffer->BoundingBox); - } - - LastAbsoluteTransformation = AbsoluteTransformation; -} - - -//! Sets if the particles should be global. If it is, the particles are affected by -//! the movement of the particle system scene node too, otherwise they completely -//! ignore it. Default is true. -void CParticleSystemSceneNode::setParticlesAreGlobal(bool global) -{ - ParticlesAreGlobal = global; -} - -//! Remove all currently visible particles -void CParticleSystemSceneNode::clearParticles() -{ - Particles.set_used(0); -} - -//! Sets if the node should be visible or not. -void CParticleSystemSceneNode::setVisible(bool isVisible) -{ - IParticleSystemSceneNode::setVisible(isVisible); - if ( !isVisible && getParticleBehavior() & EPB_CLEAR_ON_INVISIBLE ) - { - clearParticles(); - LastEmitTime = 0; - } -} - -//! Sets the size of all particles. -void CParticleSystemSceneNode::setParticleSize(const core::dimension2d<f32> &size) -{ - os::Printer::log("setParticleSize is deprecated, use setMinStartSize/setMaxStartSize in emitter.", irr::ELL_WARNING); - //A bit of a hack, but better here than in the particle code - if (Emitter) - { - Emitter->setMinStartSize(size); - Emitter->setMaxStartSize(size); - } - ParticleSize = size; -} - - -void CParticleSystemSceneNode::reallocateBuffers() -{ - if (Particles.size() * 4 > Buffer->getVertexCount() || - Particles.size() * 6 > Buffer->getIndexCount()) - { - u32 oldSize = Buffer->getVertexCount(); - Buffer->Vertices.set_used(Particles.size() * 4); - - u32 i; - - // fill remaining vertices - for (i=oldSize; i<Buffer->Vertices.size(); i+=4) - { - Buffer->Vertices[0+i].TCoords.set(0.0f, 0.0f); - Buffer->Vertices[1+i].TCoords.set(0.0f, 1.0f); - Buffer->Vertices[2+i].TCoords.set(1.0f, 1.0f); - Buffer->Vertices[3+i].TCoords.set(1.0f, 0.0f); - } - - // fill remaining indices - u32 oldIdxSize = Buffer->getIndexCount(); - u32 oldvertices = oldSize; - Buffer->Indices.set_used(Particles.size() * 6); - - for (i=oldIdxSize; i<Buffer->Indices.size(); i+=6) - { - Buffer->Indices[0+i] = (u16)0+oldvertices; - Buffer->Indices[1+i] = (u16)2+oldvertices; - Buffer->Indices[2+i] = (u16)1+oldvertices; - Buffer->Indices[3+i] = (u16)0+oldvertices; - Buffer->Indices[4+i] = (u16)3+oldvertices; - Buffer->Indices[5+i] = (u16)2+oldvertices; - oldvertices += 4; - } - } -} - - -//! Writes attributes of the scene node. -void CParticleSystemSceneNode::serializeAttributes(io::IAttributes* out, io::SAttributeReadWriteOptions* options) const -{ - IParticleSystemSceneNode::serializeAttributes(out, options); - - out->addBool("GlobalParticles", ParticlesAreGlobal); - out->addFloat("ParticleWidth", ParticleSize.Width); - out->addFloat("ParticleHeight", ParticleSize.Height); - - // write emitter - - E_PARTICLE_EMITTER_TYPE type = EPET_COUNT; - if (Emitter) - type = Emitter->getType(); - - out->addEnum("Emitter", (s32)type, ParticleEmitterTypeNames); - - if (Emitter) - Emitter->serializeAttributes(out, options); - - // write affectors - - E_PARTICLE_AFFECTOR_TYPE atype = EPAT_NONE; - - for (core::list<IParticleAffector*>::ConstIterator it = AffectorList.begin(); - it != AffectorList.end(); ++it) - { - atype = (*it)->getType(); - - out->addEnum("Affector", (s32)atype, ParticleAffectorTypeNames); - - (*it)->serializeAttributes(out); - } - - // add empty affector to make it possible to add further affectors - - if (options && options->Flags & io::EARWF_FOR_EDITOR) - out->addEnum("Affector", EPAT_NONE, ParticleAffectorTypeNames); -} - - -//! Reads attributes of the scene node. -void CParticleSystemSceneNode::deserializeAttributes(io::IAttributes* in, io::SAttributeReadWriteOptions* options) -{ - IParticleSystemSceneNode::deserializeAttributes(in, options); - - ParticlesAreGlobal = in->getAttributeAsBool("GlobalParticles"); - ParticleSize.Width = in->getAttributeAsFloat("ParticleWidth"); - ParticleSize.Height = in->getAttributeAsFloat("ParticleHeight"); - - // read emitter - - int emitterIdx = in->findAttribute("Emitter"); - if (emitterIdx == -1) - return; - - if (Emitter) - Emitter->drop(); - Emitter = 0; - - E_PARTICLE_EMITTER_TYPE type = (E_PARTICLE_EMITTER_TYPE) - in->getAttributeAsEnumeration("Emitter", ParticleEmitterTypeNames); - - switch(type) - { - case EPET_POINT: - Emitter = createPointEmitter(); - break; - case EPET_ANIMATED_MESH: - Emitter = createAnimatedMeshSceneNodeEmitter(NULL); // we can't set the node - the user will have to do this - break; - case EPET_BOX: - Emitter = createBoxEmitter(); - break; - case EPET_CYLINDER: - Emitter = createCylinderEmitter(core::vector3df(0,0,0), 10.f, core::vector3df(0,1,0), 10.f); // (values here don't matter) - break; - case EPET_MESH: - Emitter = createMeshEmitter(NULL); // we can't set the mesh - the user will have to do this - break; - case EPET_RING: - Emitter = createRingEmitter(core::vector3df(0,0,0), 10.f, 10.f); // (values here don't matter) - break; - case EPET_SPHERE: - Emitter = createSphereEmitter(core::vector3df(0,0,0), 10.f); // (values here don't matter) - break; - default: - break; - } - - u32 idx = 0; - -#if 0 - if (Emitter) - idx = Emitter->deserializeAttributes(idx, in); - - ++idx; -#else - if (Emitter) - Emitter->deserializeAttributes(in); -#endif - - // read affectors - - removeAllAffectors(); - u32 cnt = in->getAttributeCount(); - - while(idx < cnt) - { - const char* name = in->getAttributeName(idx); - - if (!name || strcmp("Affector", name)) - return; - - E_PARTICLE_AFFECTOR_TYPE atype = - (E_PARTICLE_AFFECTOR_TYPE)in->getAttributeAsEnumeration(idx, ParticleAffectorTypeNames); - - IParticleAffector* aff = 0; - - switch(atype) - { - case EPAT_ATTRACT: - aff = createAttractionAffector(core::vector3df(0,0,0)); - break; - case EPAT_FADE_OUT: - aff = createFadeOutParticleAffector(); - break; - case EPAT_GRAVITY: - aff = createGravityAffector(); - break; - case EPAT_ROTATE: - aff = createRotationAffector(); - break; - case EPAT_SCALE: - aff = createScaleParticleAffector(); - break; - case EPAT_NONE: - default: - break; - } - - ++idx; - - if (aff) - { -#if 0 - idx = aff->deserializeAttributes(idx, in, options); - ++idx; -#else - aff->deserializeAttributes(in, options); -#endif - - addAffector(aff); - aff->drop(); - } - } -} - - -} // end namespace scene -} // end namespace irr - -#endif // _IRR_COMPILE_WITH_PARTICLES_ diff --git a/source/Irrlicht/CParticleSystemSceneNode.h b/source/Irrlicht/CParticleSystemSceneNode.h deleted file mode 100644 index 779f7141..00000000 --- a/source/Irrlicht/CParticleSystemSceneNode.h +++ /dev/null @@ -1,249 +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_PARTICLE_SYSTEM_SCENE_NODE_H_INCLUDED__ -#define __C_PARTICLE_SYSTEM_SCENE_NODE_H_INCLUDED__ - -#include "IrrCompileConfig.h" -#ifdef _IRR_COMPILE_WITH_PARTICLES_ - -#include "IParticleSystemSceneNode.h" -#include "irrArray.h" -#include "irrList.h" -#include "SMeshBuffer.h" - -namespace irr -{ -namespace scene -{ - -//! A particle system scene node. -/** A scene node controlling a particle system. The behavior of the particles -can be controlled by setting the right particle emitters and affectors. -*/ -class CParticleSystemSceneNode : public IParticleSystemSceneNode -{ -public: - - //! constructor - CParticleSystemSceneNode(bool createDefaultEmitter, - ISceneNode* parent, ISceneManager* mgr, s32 id, - const core::vector3df& position, - const core::vector3df& rotation, - const core::vector3df& scale); - - //! destructor - virtual ~CParticleSystemSceneNode(); - - //! Gets the particle emitter, which creates the particles. - virtual IParticleEmitter* getEmitter() _IRR_OVERRIDE_; - - //! Sets the particle emitter, which creates the particles. - virtual void setEmitter(IParticleEmitter* emitter) _IRR_OVERRIDE_; - - //! Adds new particle affector to the particle system. - virtual void addAffector(IParticleAffector* affector) _IRR_OVERRIDE_; - - //! Get a list of all particle affectors. - virtual const core::list<IParticleAffector*>& getAffectors() const _IRR_OVERRIDE_; - - //! Removes all particle affectors in the particle system. - virtual void removeAllAffectors() _IRR_OVERRIDE_; - - //! Returns the material based on the zero based index i. - virtual video::SMaterial& getMaterial(u32 i) _IRR_OVERRIDE_; - - //! Returns amount of materials used by this scene node. - virtual u32 getMaterialCount() const _IRR_OVERRIDE_; - - //! pre render event - virtual void OnRegisterSceneNode() _IRR_OVERRIDE_; - - //! render - virtual void render() _IRR_OVERRIDE_; - - //! returns the axis aligned bounding box of this node - virtual const core::aabbox3d<f32>& getBoundingBox() const _IRR_OVERRIDE_; - - //! Creates a particle emitter for an animated mesh scene node - virtual IParticleAnimatedMeshSceneNodeEmitter* createAnimatedMeshSceneNodeEmitter( - scene::IAnimatedMeshSceneNode* node, bool useNormalDirection = true, - const core::vector3df& direction = core::vector3df(0.0f,0.03f,0.0f), - f32 normalDirectionModifier = 100.0f, s32 mbNumber = -1, - bool everyMeshVertex = false, u32 minParticlesPerSecond = 5, - u32 maxParticlesPerSecond = 10, - const video::SColor& minStartColor = video::SColor(255,0,0,0), - const video::SColor& maxStartColor = video::SColor(255,255,255,255), - u32 lifeTimeMin = 2000, u32 lifeTimeMax = 4000, - s32 maxAngleDegrees = 0, - const core::dimension2df& minStartSize = core::dimension2df(5.0f,5.0f), - const core::dimension2df& maxStartSize = core::dimension2df(5.0f,5.0f) ) _IRR_OVERRIDE_; - - //! Creates a box particle emitter. - virtual IParticleBoxEmitter* createBoxEmitter( - const core::aabbox3df& box = core::aabbox3d<f32>(-10,0,-10,5,30,10), - const core::vector3df& direction = core::vector3df(0.0f,0.03f,0.0f), - u32 minParticlesPerSecond = 5, - u32 maxParticlesPerSecond = 10, - const video::SColor& minStartColor = video::SColor(255,0,0,0), - const video::SColor& maxStartColor = video::SColor(255,255,255,255), - u32 lifeTimeMin=2000, u32 lifeTimeMax=4000, - s32 maxAngleDegrees=0, - const core::dimension2df& minStartSize = core::dimension2df(5.0f,5.0f), - const core::dimension2df& maxStartSize = core::dimension2df(5.0f,5.0f) ) _IRR_OVERRIDE_; - - //! Creates a particle emitter for emitting from a cylinder - virtual IParticleCylinderEmitter* createCylinderEmitter( - const core::vector3df& center, f32 radius, - const core::vector3df& normal, f32 length, - bool outlineOnly = false, const core::vector3df& direction = core::vector3df(0.0f,0.5f,0.0f), - u32 minParticlesPerSecond = 5, u32 maxParticlesPersSecond = 10, - const video::SColor& minStartColor = video::SColor(255,0,0,0), - const video::SColor& maxStartColor = video::SColor(255,255,255,255), - u32 lifeTimeMin = 2000, u32 lifeTimeMax = 4000, - s32 maxAngleDegrees = 0, - const core::dimension2df& minStartSize = core::dimension2df(5.0f,5.0f), - const core::dimension2df& maxStartSize = core::dimension2df(5.0f,5.0f) ) _IRR_OVERRIDE_; - - //! Creates a mesh particle emitter. - virtual IParticleMeshEmitter* createMeshEmitter( - scene::IMesh* mesh, bool useNormalDirection = true, - const core::vector3df& direction = core::vector3df(0.0f,0.03f,0.0f), - f32 normalDirectionModifier = 100.0f, s32 mbNumber = -1, - bool everyMeshVertex = false, - u32 minParticlesPerSecond = 5, - u32 maxParticlesPerSecond = 10, - const video::SColor& minStartColor = video::SColor(255,0,0,0), - const video::SColor& maxStartColor = video::SColor(255,255,255,255), - u32 lifeTimeMin = 2000, u32 lifeTimeMax = 4000, - s32 maxAngleDegrees = 0, - const core::dimension2df& minStartSize = core::dimension2df(5.0f,5.0f), - const core::dimension2df& maxStartSize = core::dimension2df(5.0f,5.0f) ) _IRR_OVERRIDE_; - - //! Creates a point particle emitter. - virtual IParticlePointEmitter* createPointEmitter( - const core::vector3df& direction = core::vector3df(0.0f,0.03f,0.0f), - u32 minParticlesPerSecond = 5, - u32 maxParticlesPerSecond = 10, - const video::SColor& minStartColor = video::SColor(255,0,0,0), - const video::SColor& maxStartColor = video::SColor(255,255,255,255), - u32 lifeTimeMin=2000, u32 lifeTimeMax=4000, - s32 maxAngleDegrees=0, - const core::dimension2df& minStartSize = core::dimension2df(5.0f,5.0f), - const core::dimension2df& maxStartSize = core::dimension2df(5.0f,5.0f) ) _IRR_OVERRIDE_; - - //! Creates a ring particle emitter. - virtual IParticleRingEmitter* createRingEmitter( - const core::vector3df& center, f32 radius, f32 ringThickness, - const core::vector3df& direction = core::vector3df(0.0f,0.03f,0.0f), - u32 minParticlesPerSecond = 5, - u32 maxParticlesPerSecond = 10, - const video::SColor& minStartColor = video::SColor(255,0,0,0), - const video::SColor& maxStartColor = video::SColor(255,255,255,255), - u32 lifeTimeMin=2000, u32 lifeTimeMax=4000, - s32 maxAngleDegrees=0, - const core::dimension2df& minStartSize = core::dimension2df(5.0f,5.0f), - const core::dimension2df& maxStartSize = core::dimension2df(5.0f,5.0f) ) _IRR_OVERRIDE_; - - //! Creates a sphere particle emitter. - virtual IParticleSphereEmitter* createSphereEmitter( - const core::vector3df& center, f32 radius, - const core::vector3df& direction = core::vector3df(0.0f,0.03f,0.0f), - u32 minParticlesPerSecond = 5, - u32 maxParticlesPerSecond = 10, - const video::SColor& minStartColor = video::SColor(255,0,0,0), - const video::SColor& maxStartColor = video::SColor(255,255,255,255), - u32 lifeTimeMin=2000, u32 lifeTimeMax=4000, - s32 maxAngleDegrees=0, - const core::dimension2df& minStartSize = core::dimension2df(5.0f,5.0f), - const core::dimension2df& maxStartSize = core::dimension2df(5.0f,5.0f) ) _IRR_OVERRIDE_; - - //! Creates a point attraction affector. This affector modifies the positions of the - //! particles and attracts them to a specified point at a specified speed per second. - virtual IParticleAttractionAffector* createAttractionAffector( - const core::vector3df& point, f32 speed = 1.0f, bool attract = true, - bool affectX = true, bool affectY = true, bool affectZ = true) _IRR_OVERRIDE_; - - //! Creates a scale particle affector. - virtual IParticleAffector* createScaleParticleAffector( - const core::dimension2df& scaleTo = core::dimension2df(1.0f, 1.0f)) _IRR_OVERRIDE_; - - //! Creates a fade out particle affector. - virtual IParticleFadeOutAffector* createFadeOutParticleAffector( - const video::SColor& targetColor = video::SColor(0,0,0,0), - u32 timeNeededToFadeOut = 1000) _IRR_OVERRIDE_; - - //! Creates a gravity affector. - virtual IParticleGravityAffector* createGravityAffector( - const core::vector3df& gravity = core::vector3df(0.0f,-0.03f,0.0f), - u32 timeForceLost = 1000) _IRR_OVERRIDE_; - - //! Creates a rotation affector. This affector rotates the particles - //! around a specified pivot point. The speed is in Degrees per second. - virtual IParticleRotationAffector* createRotationAffector( - const core::vector3df& speed = core::vector3df(5.0f,5.0f,5.0f), - const core::vector3df& pivotPoint = core::vector3df(0.0f,0.0f,0.0f) ) _IRR_OVERRIDE_; - - //! Sets the size of all particles. - virtual void setParticleSize( - const core::dimension2d<f32> &size = core::dimension2d<f32>(5.0f, 5.0f)) _IRR_OVERRIDE_; - - //! Sets if the particles should be global. If they are, the particles are affected by - //! the movement of the particle system scene node too, otherwise they completely - //! ignore it. Default is true. - virtual void setParticlesAreGlobal(bool global=true) _IRR_OVERRIDE_; - - //! Remove all currently visible particles - virtual void clearParticles() _IRR_OVERRIDE_; - - //! Sets if the node should be visible or not. - virtual void setVisible(bool isVisible) _IRR_OVERRIDE_; - - //! Do manually update the particles. - //! This should only be called when you want to render the node outside the scenegraph, - //! as the node will care about this otherwise automatically. - virtual void doParticleSystem(u32 time) _IRR_OVERRIDE_; - - //! Writes attributes of the scene node. - virtual void serializeAttributes(io::IAttributes* out, io::SAttributeReadWriteOptions* options=0) const _IRR_OVERRIDE_; - - //! Reads attributes of the scene node. - virtual void deserializeAttributes(io::IAttributes* in, io::SAttributeReadWriteOptions* options=0) _IRR_OVERRIDE_; - - //! Returns type of the scene node - virtual ESCENE_NODE_TYPE getType() const _IRR_OVERRIDE_ { return ESNT_PARTICLE_SYSTEM; } - -private: - - void reallocateBuffers(); - - core::list<IParticleAffector*> AffectorList; - IParticleEmitter* Emitter; - core::array<SParticle> Particles; - core::dimension2d<f32> ParticleSize; - u32 LastEmitTime; - core::matrix4 LastAbsoluteTransformation; - - SMeshBuffer* Buffer; - -// TODO: That was obviously planned by someone at some point and sounds like a good idea. -// But seems it was never implemented. -// enum E_PARTICLES_PRIMITIVE -// { -// EPP_POINT=0, -// EPP_BILLBOARD, -// EPP_POINTSPRITE -// }; -// E_PARTICLES_PRIMITIVE ParticlePrimitive; - - bool ParticlesAreGlobal; -}; - -} // end namespace scene -} // end namespace irr - -#endif // _IRR_COMPILE_WITH_PARTICLES_ - -#endif - diff --git a/source/Irrlicht/CQ3LevelMesh.cpp b/source/Irrlicht/CQ3LevelMesh.cpp deleted file mode 100644 index b2f9060e..00000000 --- a/source/Irrlicht/CQ3LevelMesh.cpp +++ /dev/null @@ -1,2082 +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_BSP_LOADER_ - -#include "CQ3LevelMesh.h" -#include "ISceneManager.h" -#include "os.h" -#include "SMeshBufferLightMap.h" -#include "irrString.h" -#include "ILightSceneNode.h" -#include "IQ3Shader.h" -#include "IFileList.h" - -//#define TJUNCTION_SOLVER_ROUND -//#define TJUNCTION_SOLVER_0125 - -namespace irr -{ -namespace scene -{ - - using namespace quake3; - -//! constructor -CQ3LevelMesh::CQ3LevelMesh(io::IFileSystem* fs, scene::ISceneManager* smgr, - const Q3LevelLoadParameter &loadParam) - : LoadParam(loadParam), Textures(0), NumTextures(0), LightMaps(0), NumLightMaps(0), - Vertices(0), NumVertices(0), Faces(0), NumFaces(0), Models(0), NumModels(0), - Planes(0), NumPlanes(0), Nodes(0), NumNodes(0), Leafs(0), NumLeafs(0), - LeafFaces(0), NumLeafFaces(0), MeshVerts(0), NumMeshVerts(0), - Brushes(0), NumBrushes(0), BrushEntities(0), FileSystem(fs), - SceneManager(smgr), FramesPerSecond(25.f) -{ - #ifdef _DEBUG - IReferenceCounted::setDebugName("CQ3LevelMesh"); - #endif - - for ( s32 i = 0; i!= E_Q3_MESH_SIZE; ++i ) - { - Mesh[i] = 0; - } - - Driver = smgr ? smgr->getVideoDriver() : 0; - if (Driver) - Driver->grab(); - - if (FileSystem) - FileSystem->grab(); - - // load default shaders - InitShader(); -} - - -//! destructor -CQ3LevelMesh::~CQ3LevelMesh() -{ - cleanLoader (); - - if (Driver) - Driver->drop(); - - if (FileSystem) - FileSystem->drop(); - - s32 i; - - for ( i = 0; i!= E_Q3_MESH_SIZE; ++i ) - { - if ( Mesh[i] ) - { - Mesh[i]->drop(); - Mesh[i] = 0; - } - } - - for ( i = 1; i < NumModels; i++ ) - { - BrushEntities[i]->drop(); - } - delete [] BrushEntities; BrushEntities = 0; - - ReleaseShader(); - ReleaseEntity(); -} - - -//! loads a level from a .bsp-File. Also tries to load all needed textures. Returns true if successful. -bool CQ3LevelMesh::loadFile(io::IReadFile* file) -{ - if (!file) - return false; - - LevelName = file->getFileName(); - - file->read(&header, sizeof(tBSPHeader)); - - #ifdef __BIG_ENDIAN__ - header.strID = os::Byteswap::byteswap(header.strID); - header.version = os::Byteswap::byteswap(header.version); - #endif - - if ( (header.strID != 0x50534249 || // IBSP - ( header.version != 0x2e // quake3 - && header.version != 0x2f // rtcw - ) - ) - && - ( header.strID != 0x50534252 || header.version != 1 ) // RBSP, starwars jedi, sof - ) - { - os::Printer::log("Could not load .bsp file, unknown header.", file->getFileName(), ELL_ERROR); - return false; - } - -#if 0 - if ( header.strID == 0x50534252 ) // RBSP Raven - { - LoadParam.swapHeader = 1; - } -#endif - - // now read lumps - file->read(&Lumps[0], sizeof(tBSPLump)*kMaxLumps); - - s32 i; - if ( LoadParam.swapHeader ) - { - for ( i=0; i< kMaxLumps;++i) - { - Lumps[i].offset = os::Byteswap::byteswap(Lumps[i].offset); - Lumps[i].length = os::Byteswap::byteswap(Lumps[i].length); - } - } - - ReleaseEntity(); - - // load everything - loadEntities(&Lumps[kEntities], file); // load the entities - loadTextures(&Lumps[kShaders], file); // Load the textures - loadLightmaps(&Lumps[kLightmaps], file); // Load the lightmaps - loadVerts(&Lumps[kVertices], file); // Load the vertices - loadFaces(&Lumps[kFaces], file); // Load the faces - loadPlanes(&Lumps[kPlanes], file); // Load the Planes of the BSP - loadNodes(&Lumps[kNodes], file); // load the Nodes of the BSP - loadLeafs(&Lumps[kLeafs], file); // load the Leafs of the BSP - loadLeafFaces(&Lumps[kLeafFaces], file); // load the Faces of the Leafs of the BSP - loadVisData(&Lumps[kVisData], file); // load the visibility data of the clusters - loadModels(&Lumps[kModels], file); // load the models - loadMeshVerts(&Lumps[kMeshVerts], file); // load the mesh vertices - loadBrushes(&Lumps[kBrushes], file); // load the brushes of the BSP - loadBrushSides(&Lumps[kBrushSides], file); // load the brushsides of the BSP - loadLeafBrushes(&Lumps[kLeafBrushes], file); // load the brushes of the leaf - loadFogs(&Lumps[kFogs], file ); // load the fogs - - loadTextures(); - constructMesh(); - solveTJunction(); - - cleanMeshes(); - calcBoundingBoxes(); - cleanLoader(); - - return true; -} - -/*! -*/ -void CQ3LevelMesh::cleanLoader () -{ - delete [] Textures; Textures = 0; - delete [] LightMaps; LightMaps = 0; - delete [] Vertices; Vertices = 0; - delete [] Faces; Faces = 0; - delete [] Models; Models = 0; - delete [] Planes; Planes = 0; - delete [] Nodes; Nodes = 0; - delete [] Leafs; Leafs = 0; - delete [] LeafFaces; LeafFaces = 0; - delete [] MeshVerts; MeshVerts = 0; - delete [] Brushes; Brushes = 0; - - Lightmap.clear(); - Tex.clear(); -} - -//! returns the amount of frames in milliseconds. If the amount is 1, it is a static (=non animated) mesh. -u32 CQ3LevelMesh::getFrameCount() const -{ - return 1; -} - - -//! returns the animated mesh based on a detail level. 0 is the lowest, 255 the highest detail. Note, that some Meshes will ignore the detail level. -IMesh* CQ3LevelMesh::getMesh(s32 frameInMs, s32 detailLevel, s32 startFrameLoop, s32 endFrameLoop) -{ - return Mesh[frameInMs]; -} - - -void CQ3LevelMesh::loadTextures(tBSPLump* l, io::IReadFile* file) -{ - NumTextures = l->length / sizeof(tBSPTexture); - if ( !NumTextures ) - return; - Textures = new tBSPTexture[NumTextures]; - - file->seek(l->offset); - file->read(Textures, l->length); - - if ( LoadParam.swapHeader ) - { - for (s32 i=0;i<NumTextures;++i) - { - Textures[i].flags = os::Byteswap::byteswap(Textures[i].flags); - Textures[i].contents = os::Byteswap::byteswap(Textures[i].contents); - //os::Printer::log("Loaded texture", Textures[i].strName, ELL_INFORMATION); - } - } -} - - -void CQ3LevelMesh::loadLightmaps(tBSPLump* l, io::IReadFile* file) -{ - NumLightMaps = l->length / sizeof(tBSPLightmap); - if ( !NumLightMaps ) - return; - LightMaps = new tBSPLightmap[NumLightMaps]; - - file->seek(l->offset); - file->read(LightMaps, l->length); -} - -/*! -*/ -void CQ3LevelMesh::loadVerts(tBSPLump* l, io::IReadFile* file) -{ - NumVertices = l->length / sizeof(tBSPVertex); - if ( !NumVertices ) - return; - Vertices = new tBSPVertex[NumVertices]; - - file->seek(l->offset); - file->read(Vertices, l->length); - - if ( LoadParam.swapHeader ) - for (s32 i=0;i<NumVertices;i++) - { - Vertices[i].vPosition[0] = os::Byteswap::byteswap(Vertices[i].vPosition[0]); - Vertices[i].vPosition[1] = os::Byteswap::byteswap(Vertices[i].vPosition[1]); - Vertices[i].vPosition[2] = os::Byteswap::byteswap(Vertices[i].vPosition[2]); - Vertices[i].vTextureCoord[0] = os::Byteswap::byteswap(Vertices[i].vTextureCoord[0]); - Vertices[i].vTextureCoord[1] = os::Byteswap::byteswap(Vertices[i].vTextureCoord[1]); - Vertices[i].vLightmapCoord[0] = os::Byteswap::byteswap(Vertices[i].vLightmapCoord[0]); - Vertices[i].vLightmapCoord[1] = os::Byteswap::byteswap(Vertices[i].vLightmapCoord[1]); - Vertices[i].vNormal[0] = os::Byteswap::byteswap(Vertices[i].vNormal[0]); - Vertices[i].vNormal[1] = os::Byteswap::byteswap(Vertices[i].vNormal[1]); - Vertices[i].vNormal[2] = os::Byteswap::byteswap(Vertices[i].vNormal[2]); - } -} - - -/*! -*/ -void CQ3LevelMesh::loadFaces(tBSPLump* l, io::IReadFile* file) -{ - NumFaces = l->length / sizeof(tBSPFace); - if (!NumFaces) - return; - Faces = new tBSPFace[NumFaces]; - - file->seek(l->offset); - file->read(Faces, l->length); - - if ( LoadParam.swapHeader ) - { - for ( s32 i=0;i<NumFaces;i++) - { - Faces[i].textureID = os::Byteswap::byteswap(Faces[i].textureID); - Faces[i].fogNum = os::Byteswap::byteswap(Faces[i].fogNum); - Faces[i].type = os::Byteswap::byteswap(Faces[i].type); - Faces[i].vertexIndex = os::Byteswap::byteswap(Faces[i].vertexIndex); - Faces[i].numOfVerts = os::Byteswap::byteswap(Faces[i].numOfVerts); - Faces[i].meshVertIndex = os::Byteswap::byteswap(Faces[i].meshVertIndex); - Faces[i].numMeshVerts = os::Byteswap::byteswap(Faces[i].numMeshVerts); - Faces[i].lightmapID = os::Byteswap::byteswap(Faces[i].lightmapID); - Faces[i].lMapCorner[0] = os::Byteswap::byteswap(Faces[i].lMapCorner[0]); - Faces[i].lMapCorner[1] = os::Byteswap::byteswap(Faces[i].lMapCorner[1]); - Faces[i].lMapSize[0] = os::Byteswap::byteswap(Faces[i].lMapSize[0]); - Faces[i].lMapSize[1] = os::Byteswap::byteswap(Faces[i].lMapSize[1]); - Faces[i].lMapPos[0] = os::Byteswap::byteswap(Faces[i].lMapPos[0]); - Faces[i].lMapPos[1] = os::Byteswap::byteswap(Faces[i].lMapPos[1]); - Faces[i].lMapPos[2] = os::Byteswap::byteswap(Faces[i].lMapPos[2]); - Faces[i].lMapBitsets[0][0] = os::Byteswap::byteswap(Faces[i].lMapBitsets[0][0]); - Faces[i].lMapBitsets[0][1] = os::Byteswap::byteswap(Faces[i].lMapBitsets[0][1]); - Faces[i].lMapBitsets[0][2] = os::Byteswap::byteswap(Faces[i].lMapBitsets[0][2]); - Faces[i].lMapBitsets[1][0] = os::Byteswap::byteswap(Faces[i].lMapBitsets[1][0]); - Faces[i].lMapBitsets[1][1] = os::Byteswap::byteswap(Faces[i].lMapBitsets[1][1]); - Faces[i].lMapBitsets[1][2] = os::Byteswap::byteswap(Faces[i].lMapBitsets[1][2]); - Faces[i].vNormal[0] = os::Byteswap::byteswap(Faces[i].vNormal[0]); - Faces[i].vNormal[1] = os::Byteswap::byteswap(Faces[i].vNormal[1]); - Faces[i].vNormal[2] = os::Byteswap::byteswap(Faces[i].vNormal[2]); - Faces[i].size[0] = os::Byteswap::byteswap(Faces[i].size[0]); - Faces[i].size[1] = os::Byteswap::byteswap(Faces[i].size[1]); - } - } -} - - -/*! -*/ -void CQ3LevelMesh::loadPlanes(tBSPLump* l, io::IReadFile* file) -{ - // ignore -} - - -/*! -*/ -void CQ3LevelMesh::loadNodes(tBSPLump* l, io::IReadFile* file) -{ - // ignore -} - - -/*! -*/ -void CQ3LevelMesh::loadLeafs(tBSPLump* l, io::IReadFile* file) -{ - // ignore -} - - -/*! -*/ -void CQ3LevelMesh::loadLeafFaces(tBSPLump* l, io::IReadFile* file) -{ - // ignore -} - - -/*! -*/ -void CQ3LevelMesh::loadVisData(tBSPLump* l, io::IReadFile* file) -{ - // ignore -} - - -/*! -*/ -void CQ3LevelMesh::loadEntities(tBSPLump* l, io::IReadFile* file) -{ - core::array<u8> entity; - entity.set_used( l->length + 2 ); - entity[l->length + 1 ] = 0; - - file->seek(l->offset); - file->read( entity.pointer(), l->length); - - parser_parse( entity.pointer(), l->length, &CQ3LevelMesh::scriptcallback_entity ); -} - - -/*! - load fog brushes -*/ -void CQ3LevelMesh::loadFogs(tBSPLump* l, io::IReadFile* file) -{ - u32 files = l->length / sizeof(tBSPFog); - - file->seek( l->offset ); - tBSPFog fog; - const IShader *shader; - STexShader t; - for ( u32 i = 0; i!= files; ++i ) - { - file->read( &fog, sizeof( fog ) ); - - shader = getShader( fog.shader ); - t.Texture = 0; - t.ShaderID = shader ? shader->ID : -1; - - FogMap.push_back ( t ); - } -} - - -/*! - load models named in bsp -*/ -void CQ3LevelMesh::loadModels(tBSPLump* l, io::IReadFile* file) -{ - NumModels = l->length / sizeof(tBSPModel); - Models = new tBSPModel[NumModels]; - - file->seek( l->offset ); - file->read(Models, l->length); - - if ( LoadParam.swapHeader ) - { - for ( s32 i = 0; i < NumModels; i++) - { - Models[i].min[0] = os::Byteswap::byteswap(Models[i].min[0]); - Models[i].min[1] = os::Byteswap::byteswap(Models[i].min[1]); - Models[i].min[2] = os::Byteswap::byteswap(Models[i].min[2]); - Models[i].max[0] = os::Byteswap::byteswap(Models[i].max[0]); - Models[i].max[1] = os::Byteswap::byteswap(Models[i].max[1]); - Models[i].max[2] = os::Byteswap::byteswap(Models[i].max[2]); - - Models[i].faceIndex = os::Byteswap::byteswap(Models[i].faceIndex); - Models[i].numOfFaces = os::Byteswap::byteswap(Models[i].numOfFaces); - Models[i].brushIndex = os::Byteswap::byteswap(Models[i].brushIndex); - Models[i].numOfBrushes = os::Byteswap::byteswap(Models[i].numOfBrushes); - } - } - - BrushEntities = new SMesh*[NumModels]; -} - -/*! -*/ -void CQ3LevelMesh::loadMeshVerts(tBSPLump* l, io::IReadFile* file) -{ - NumMeshVerts = l->length / sizeof(s32); - if (!NumMeshVerts) - return; - MeshVerts = new s32[NumMeshVerts]; - - file->seek(l->offset); - file->read(MeshVerts, l->length); - - if ( LoadParam.swapHeader ) - { - for (int i=0;i<NumMeshVerts;i++) - MeshVerts[i] = os::Byteswap::byteswap(MeshVerts[i]); - } -} - -/*! -*/ -void CQ3LevelMesh::loadBrushes(tBSPLump* l, io::IReadFile* file) -{ - // ignore -} - -/*! -*/ -void CQ3LevelMesh::loadBrushSides(tBSPLump* l, io::IReadFile* file) -{ - // ignore -} - -/*! -*/ -void CQ3LevelMesh::loadLeafBrushes(tBSPLump* l, io::IReadFile* file) -{ - // ignore -} - -/*! -*/ -inline bool isQ3WhiteSpace( const u8 symbol ) -{ - return symbol == ' ' || symbol == '\t' || symbol == '\r'; -} - -/*! -*/ -inline bool isQ3ValidName( const u8 symbol ) -{ - return (symbol >= 'a' && symbol <= 'z' ) || - (symbol >= 'A' && symbol <= 'Z' ) || - (symbol >= '0' && symbol <= '9' ) || - (symbol == '/' || symbol == '_' || symbol == '.' ); -} - -/*! -*/ -void CQ3LevelMesh::parser_nextToken() -{ - u8 symbol; - - Parser.token = ""; - Parser.tokenresult = Q3_TOKEN_UNRESOLVED; - - // skip white space - do - { - if ( Parser.index >= Parser.sourcesize ) - { - Parser.tokenresult = Q3_TOKEN_EOF; - return; - } - - symbol = Parser.source [ Parser.index ]; - Parser.index += 1; - } while ( isQ3WhiteSpace( symbol ) ); - - // first symbol, one symbol - switch ( symbol ) - { - case 0: - Parser.tokenresult = Q3_TOKEN_EOF; - return; - - case '/': - // comment or divide - if ( Parser.index >= Parser.sourcesize ) - { - Parser.tokenresult = Q3_TOKEN_EOF; - return; - } - symbol = Parser.source [ Parser.index ]; - Parser.index += 1; - if ( isQ3WhiteSpace( symbol ) ) - { - Parser.tokenresult = Q3_TOKEN_MATH_DIVIDE; - return; - } - else - if ( symbol == '*' ) - { - // C-style comment in quake? - } - else - if ( symbol == '/' ) - { - // skip to eol - do - { - if ( Parser.index >= Parser.sourcesize ) - { - Parser.tokenresult = Q3_TOKEN_EOF; - return; - } - symbol = Parser.source [ Parser.index ]; - Parser.index += 1; - } while ( symbol != '\n' ); - Parser.tokenresult = Q3_TOKEN_COMMENT; - return; - } - // take /[name] as valid token..?!?!?. mhmm, maybe - break; - - case '\n': - Parser.tokenresult = Q3_TOKEN_EOL; - return; - case '{': - Parser.tokenresult = Q3_TOKEN_START_LIST; - return; - case '}': - Parser.tokenresult = Q3_TOKEN_END_LIST; - return; - - case '"': - // string literal - do - { - if ( Parser.index >= Parser.sourcesize ) - { - Parser.tokenresult = Q3_TOKEN_EOF; - return; - } - symbol = Parser.source [ Parser.index ]; - Parser.index += 1; - if ( symbol != '"' ) - Parser.token.append( symbol ); - } while ( symbol != '"' ); - Parser.tokenresult = Q3_TOKEN_ENTITY; - return; - } - - // user identity - Parser.token.append( symbol ); - - // continue till whitespace - bool validName = true; - do - { - if ( Parser.index >= Parser.sourcesize ) - { - Parser.tokenresult = Q3_TOKEN_EOF; - return; - } - symbol = Parser.source [ Parser.index ]; - - validName = isQ3ValidName( symbol ); - if ( validName ) - { - Parser.token.append( symbol ); - Parser.index += 1; - } - } while ( validName ); - - Parser.tokenresult = Q3_TOKEN_TOKEN; - return; -} - - -/* - parse entity & shader - calls callback on content in {} -*/ -void CQ3LevelMesh::parser_parse( const void * data, const u32 size, CQ3LevelMesh::tParserCallback callback ) -{ - Parser.source = static_cast<const c8*>(data); - Parser.sourcesize = size; - Parser.index = 0; - - SVarGroupList *groupList; - - s32 active; - s32 last; - - SVariable entity ( "" ); - - groupList = new SVarGroupList(); - - groupList->VariableGroup.push_back( SVarGroup() ); - active = last = 0; - - do - { - parser_nextToken(); - - switch ( Parser.tokenresult ) - { - case Q3_TOKEN_START_LIST: - { - //stack = core::min_( stack + 1, 7 ); - - groupList->VariableGroup.push_back( SVarGroup() ); - last = active; - active = groupList->VariableGroup.size() - 1; - entity.clear(); - } break; - - // a unregisterd variable is finished - case Q3_TOKEN_EOL: - { - if ( entity.isValid() ) - { - groupList->VariableGroup[active].Variable.push_back( entity ); - entity.clear(); - } - } break; - - case Q3_TOKEN_TOKEN: - case Q3_TOKEN_ENTITY: - { - Parser.token.make_lower(); - - // store content based on line-delemiter - if ( 0 == entity.isValid() ) - { - entity.name = Parser.token; - entity.content = ""; - - } - else - { - if ( entity.content.size() ) - { - entity.content += " "; - } - entity.content += Parser.token; - } - } break; - - case Q3_TOKEN_END_LIST: - { - //stack = core::max_( stack - 1, 0 ); - - // close tag for first - if ( active == 1 ) - { - (this->*callback)( groupList, Q3_TOKEN_END_LIST ); - - // new group - groupList->drop(); - groupList = new SVarGroupList(); - groupList->VariableGroup.push_back( SVarGroup() ); - last = 0; - } - - active = last; - entity.clear(); - - } break; - - default: - break; - } - - } while ( Parser.tokenresult != Q3_TOKEN_EOF ); - - (this->*callback)( groupList, Q3_TOKEN_EOF ); - - groupList->drop(); -} - - -/* - this loader applies only textures for stage 1 & 2 -*/ -s32 CQ3LevelMesh::setShaderFogMaterial( video::SMaterial &material, const tBSPFace * face ) const -{ - material.MaterialType = video::EMT_SOLID; - material.Wireframe = false; - material.Lighting = false; - material.BackfaceCulling = false; - material.setTexture(0, 0); - material.setTexture(1, 0); - material.setTexture(2, 0); - material.setTexture(3, 0); - material.ZBuffer = video::ECFN_LESSEQUAL; - material.ZWriteEnable = video::EZW_OFF; - material.MaterialTypeParam = 0.f; - - s32 shaderState = -1; - - if ( (u32) face->fogNum < FogMap.size() ) - { - material.setTexture(0, FogMap [ face->fogNum ].Texture); - shaderState = FogMap [ face->fogNum ].ShaderID; - } - - return shaderState; - -} -/* - this loader applies only textures for stage 1 & 2 -*/ -s32 CQ3LevelMesh::setShaderMaterial( video::SMaterial &material, const tBSPFace * face ) const -{ - material.MaterialType = video::EMT_SOLID; - material.Wireframe = false; - material.Lighting = false; - material.BackfaceCulling = true; - material.setTexture(0, 0); - material.setTexture(1, 0); - material.setTexture(2, 0); - material.setTexture(3, 0); - material.ZBuffer = video::ECFN_LESSEQUAL; - material.ZWriteEnable = video::EZW_AUTO; - material.MaterialTypeParam = 0.f; - - s32 shaderState = -1; - - if ( face->textureID >= 0 && face->textureID < (s32)Tex.size() ) - { - material.setTexture(0, Tex [ face->textureID ].Texture); - shaderState = Tex [ face->textureID ].ShaderID; - } - - if ( face->lightmapID >= 0 && face->lightmapID < (s32)Lightmap.size() ) - { - material.setTexture(1, Lightmap [ face->lightmapID ]); - material.MaterialType = LoadParam.defaultLightMapMaterial; - } - - // store shader ID - material.MaterialTypeParam2 = (f32) shaderState; - - const IShader *shader = getShader(shaderState); - if ( 0 == shader ) - return shaderState; - - return shaderState; - -#if 0 - const SVarGroup *group; - - - // generic - group = shader->getGroup( 1 ); - if ( group ) - { - material.BackfaceCulling = getCullingFunction( group->get( "cull" ) ); - - if ( group->isDefined( "surfaceparm", "nolightmap" ) ) - { - material.MaterialType = video::EMT_SOLID; - material.setTexture(1, 0); - } - - } - - // try to get the best of the 8 texture stages.. - - // texture 1, texture 2 - u32 startPos; - for ( s32 g = 2; g <= 3; ++g ) - { - group = shader->getGroup( g ); - if ( 0 == group ) - continue; - - startPos = 0; - - if ( group->isDefined( "depthwrite" ) ) - { - material.ZWriteEnable = video::EZW_ON; - } - - SBlendFunc blendfunc ( LoadParam.defaultModulate ); - getBlendFunc( group->get( "blendfunc" ), blendfunc ); - getBlendFunc( group->get( "alphafunc" ), blendfunc ); - - if ( 0 == LoadParam.alpharef && - ( blendfunc.type == video::EMT_TRANSPARENT_ALPHA_CHANNEL || - blendfunc.type == video::EMT_TRANSPARENT_ALPHA_CHANNEL_REF - ) - ) - { - blendfunc.type = video::EMT_TRANSPARENT_ALPHA_CHANNEL; - blendfunc.param0 = 0.f; - } - - material.MaterialType = blendfunc.type; - material.MaterialTypeParam = blendfunc.param0; - - // try if we can match better - shaderState |= (material.MaterialType == video::EMT_SOLID ) ? 0x00020000 : 0; - } - - //material.BackfaceCulling = false; - - if ( shader->VarGroup->VariableGroup.size() <= 4 ) - { - shaderState |= 0x00010000; - } - - material.MaterialTypeParam2 = (f32) shaderState; - return shaderState; -#endif -} - -/*! - Internal function to build a mesh. -*/ -scene::SMesh** CQ3LevelMesh::buildMesh(s32 num) -{ - scene::SMesh** newmesh = new SMesh *[quake3::E_Q3_MESH_SIZE]; - - s32 i, j, k,s; - - for (i = 0; i < E_Q3_MESH_SIZE; i++) - { - newmesh[i] = new SMesh(); - } - - s32 *index; - - video::S3DVertex2TCoords temp[3]; - video::SMaterial material; - video::SMaterial material2; - - SToBuffer item [ E_Q3_MESH_SIZE ]; - u32 itemSize; - - for (i = Models[num].faceIndex; i < Models[num].numOfFaces + Models[num].faceIndex; ++i) - { - const tBSPFace * face = Faces + i; - - s32 shaderState = setShaderMaterial( material, face ); - itemSize = 0; - - const IShader *shader = getShader(shaderState); - - if ( face->fogNum >= 0 ) - { - setShaderFogMaterial ( material2, face ); - item[itemSize].index = E_Q3_MESH_FOG; - item[itemSize].takeVertexColor = 1; - itemSize += 1; - } - - switch( face->type ) - { - case 1: // normal polygons - case 2: // patches - case 3: // meshes - if ( 0 == shader ) - { - if ( LoadParam.cleanUnResolvedMeshes || material.getTexture(0) ) - { - item[itemSize].takeVertexColor = 1; - item[itemSize].index = E_Q3_MESH_GEOMETRY; - itemSize += 1; - } - else - { - item[itemSize].takeVertexColor = 1; - item[itemSize].index = E_Q3_MESH_UNRESOLVED; - itemSize += 1; - } - } - else - { - item[itemSize].takeVertexColor = 1; - item[itemSize].index = E_Q3_MESH_ITEMS; - itemSize += 1; - } - break; - - case 4: // billboards - //item[itemSize].takeVertexColor = 1; - //item[itemSize].index = E_Q3_MESH_ITEMS; - //itemSize += 1; - break; - - } - - for ( u32 g = 0; g != itemSize; ++g ) - { - scene::SMeshBufferLightMap* buffer = 0; - - if ( item[g].index == E_Q3_MESH_GEOMETRY ) - { - if ( 0 == item[g].takeVertexColor ) - { - item[g].takeVertexColor = material.getTexture(0) == 0 || material.getTexture(1) == 0; - } - - if (Faces[i].lightmapID < -1 || Faces[i].lightmapID > NumLightMaps-1) - { - Faces[i].lightmapID = -1; - } - -#if 0 - // there are lightmapsids and textureid with -1 - const s32 tmp_index = ((Faces[i].lightmapID+1) * (NumTextures+1)) + (Faces[i].textureID+1); - buffer = (SMeshBufferLightMap*) newmesh[E_Q3_MESH_GEOMETRY]->getMeshBuffer(tmp_index); - buffer->setHardwareMappingHint ( EHM_STATIC ); - buffer->getMaterial() = material; -#endif - } - - // Construct a unique mesh for each shader or combine meshbuffers for same shader - if ( 0 == buffer ) - { - - if ( LoadParam.mergeShaderBuffer == 1 ) - { - // combine - buffer = (SMeshBufferLightMap*) newmesh[ item[g].index ]->getMeshBuffer( - item[g].index != E_Q3_MESH_FOG ? material : material2 ); - } - - // create a seperate mesh buffer - if ( 0 == buffer ) - { - buffer = new scene::SMeshBufferLightMap(); - newmesh[ item[g].index ]->addMeshBuffer( buffer ); - buffer->drop(); - buffer->getMaterial() = item[g].index != E_Q3_MESH_FOG ? material : material2; - if ( item[g].index == E_Q3_MESH_GEOMETRY ) - buffer->setHardwareMappingHint ( EHM_STATIC ); - } - } - - - switch(Faces[i].type) - { - case 4: // billboards - break; - case 2: // patches - createCurvedSurface_bezier( buffer, i, - LoadParam.patchTesselation, - item[g].takeVertexColor - ); - break; - - case 1: // normal polygons - case 3: // mesh vertices - index = MeshVerts + face->meshVertIndex; - k = buffer->getVertexCount(); - - // reallocate better if many small meshes are used - s = buffer->getIndexCount()+face->numMeshVerts; - if ( buffer->Indices.allocated_size () < (u32) s ) - { - if ( buffer->Indices.allocated_size () > 0 && - face->numMeshVerts < 20 && NumFaces > 1000 - ) - { - s = buffer->getIndexCount() + (NumFaces >> 3 * face->numMeshVerts ); - } - buffer->Indices.reallocate( s); - } - - for ( j = 0; j < face->numMeshVerts; ++j ) - { - buffer->Indices.push_back( k + index [j] ); - } - - s = k+face->numOfVerts; - if ( buffer->Vertices.allocated_size () < (u32) s ) - { - if ( buffer->Indices.allocated_size () > 0 && - face->numOfVerts < 20 && NumFaces > 1000 - ) - { - s = buffer->getIndexCount() + (NumFaces >> 3 * face->numOfVerts ); - } - buffer->Vertices.reallocate( s); - } - for ( j = 0; j != face->numOfVerts; ++j ) - { - copy( &temp[0], &Vertices[ j + face->vertexIndex ], item[g].takeVertexColor ); - buffer->Vertices.push_back( temp[0] ); - } - break; - - } // end switch - } - } - - return newmesh; -} - -/*! -*/ -void CQ3LevelMesh::solveTJunction() -{ -} - -/*! - constructs a mesh from the quake 3 level file. -*/ -void CQ3LevelMesh::constructMesh() -{ - if ( LoadParam.verbose > 0 ) - { - LoadParam.startTime = os::Timer::getRealTime(); - - if ( LoadParam.verbose > 1 ) - { - snprintf_irr( buf, sizeof ( buf ), - "quake3::constructMesh start to create %d faces, %d vertices,%d mesh vertices", - NumFaces, - NumVertices, - NumMeshVerts - ); - os::Printer::log(buf, ELL_INFORMATION); - } - - } - - s32 i, j; - - // First the main level - SMesh **tmp = buildMesh(0); - - for (i = 0; i < E_Q3_MESH_SIZE; i++) - { - Mesh[i] = tmp[i]; - } - delete [] tmp; - - // Then the brush entities - - for (i = 1; i < NumModels; i++) - { - tmp = buildMesh(i); - BrushEntities[i] = tmp[0]; - - // We only care about the main geometry here - for (j = 1; j < E_Q3_MESH_SIZE; j++) - { - tmp[j]->drop(); - } - delete [] tmp; - } - - if ( LoadParam.verbose > 0 ) - { - LoadParam.endTime = os::Timer::getRealTime(); - - snprintf_irr( buf, sizeof ( buf ), - "quake3::constructMesh needed %04u ms to create %d faces, %d vertices,%d mesh vertices", - LoadParam.endTime - LoadParam.startTime, - NumFaces, - NumVertices, - NumMeshVerts - ); - os::Printer::log(buf, ELL_INFORMATION); - } - -} - - -void CQ3LevelMesh::S3DVertex2TCoords_64::copy( video::S3DVertex2TCoords &dest ) const -{ -#if defined (TJUNCTION_SOLVER_ROUND) - dest.Pos.X = core::round_( (f32) Pos.X ); - dest.Pos.Y = core::round_( (f32) Pos.Y ); - dest.Pos.Z = core::round_( (f32) Pos.Z ); -#elif defined (TJUNCTION_SOLVER_0125) - dest.Pos.X = (f32) ( floor ( Pos.X * 8.f + 0.5 ) * 0.125 ); - dest.Pos.Y = (f32) ( floor ( Pos.Y * 8.f + 0.5 ) * 0.125 ); - dest.Pos.Z = (f32) ( floor ( Pos.Z * 8.f + 0.5 ) * 0.125 ); -#else - dest.Pos.X = (f32) Pos.X; - dest.Pos.Y = (f32) Pos.Y; - dest.Pos.Z = (f32) Pos.Z; -#endif - - dest.Normal.X = (f32) Normal.X; - dest.Normal.Y = (f32) Normal.Y; - dest.Normal.Z = (f32) Normal.Z; - dest.Normal.normalize(); - - dest.Color = Color.toSColor(); - - dest.TCoords.X = (f32) TCoords.X; - dest.TCoords.Y = (f32) TCoords.Y; - - dest.TCoords2.X = (f32) TCoords2.X; - dest.TCoords2.Y = (f32) TCoords2.Y; -} - - -void CQ3LevelMesh::copy( S3DVertex2TCoords_64 * dest, const tBSPVertex * source, s32 vertexcolor ) const -{ -#if defined (TJUNCTION_SOLVER_ROUND) - dest->Pos.X = core::round_( source->vPosition[0] ); - dest->Pos.Y = core::round_( source->vPosition[2] ); - dest->Pos.Z = core::round_( source->vPosition[1] ); -#elif defined (TJUNCTION_SOLVER_0125) - dest->Pos.X = (f32) ( floor ( source->vPosition[0] * 8.f + 0.5 ) * 0.125 ); - dest->Pos.Y = (f32) ( floor ( source->vPosition[2] * 8.f + 0.5 ) * 0.125 ); - dest->Pos.Z = (f32) ( floor ( source->vPosition[1] * 8.f + 0.5 ) * 0.125 ); -#else - dest->Pos.X = source->vPosition[0]; - dest->Pos.Y = source->vPosition[2]; - dest->Pos.Z = source->vPosition[1]; -#endif - - dest->Normal.X = source->vNormal[0]; - dest->Normal.Y = source->vNormal[2]; - dest->Normal.Z = source->vNormal[1]; - dest->Normal.normalize(); - - dest->TCoords.X = source->vTextureCoord[0]; - dest->TCoords.Y = source->vTextureCoord[1]; - dest->TCoords2.X = source->vLightmapCoord[0]; - dest->TCoords2.Y = source->vLightmapCoord[1]; - - if ( vertexcolor ) - { - //u32 a = core::s32_min( source->color[3] * LoadParam.defaultModulate, 255 ); - u32 a = source->color[3]; - u32 r = core::s32_min( source->color[0] * LoadParam.defaultModulate, 255 ); - u32 g = core::s32_min( source->color[1] * LoadParam.defaultModulate, 255 ); - u32 b = core::s32_min( source->color[2] * LoadParam.defaultModulate, 255 ); - - dest->Color.set(a * 1.f/255.f, r * 1.f/255.f, - g * 1.f/255.f, b * 1.f/255.f); - } - else - { - dest->Color.set( 1.f, 1.f, 1.f, 1.f ); - } -} - - -inline void CQ3LevelMesh::copy( video::S3DVertex2TCoords * dest, const tBSPVertex * source, s32 vertexcolor ) const -{ -#if defined (TJUNCTION_SOLVER_ROUND) - dest->Pos.X = core::round_( source->vPosition[0] ); - dest->Pos.Y = core::round_( source->vPosition[2] ); - dest->Pos.Z = core::round_( source->vPosition[1] ); -#elif defined (TJUNCTION_SOLVER_0125) - dest->Pos.X = (f32) ( floor ( source->vPosition[0] * 8.f + 0.5 ) * 0.125 ); - dest->Pos.Y = (f32) ( floor ( source->vPosition[2] * 8.f + 0.5 ) * 0.125 ); - dest->Pos.Z = (f32) ( floor ( source->vPosition[1] * 8.f + 0.5 ) * 0.125 ); -#else - dest->Pos.X = source->vPosition[0]; - dest->Pos.Y = source->vPosition[2]; - dest->Pos.Z = source->vPosition[1]; -#endif - - dest->Normal.X = source->vNormal[0]; - dest->Normal.Y = source->vNormal[2]; - dest->Normal.Z = source->vNormal[1]; - dest->Normal.normalize(); - - dest->TCoords.X = source->vTextureCoord[0]; - dest->TCoords.Y = source->vTextureCoord[1]; - dest->TCoords2.X = source->vLightmapCoord[0]; - dest->TCoords2.Y = source->vLightmapCoord[1]; - - if ( vertexcolor ) - { - //u32 a = core::s32_min( source->color[3] * LoadParam.defaultModulate, 255 ); - u32 a = source->color[3]; - u32 r = core::s32_min( source->color[0] * LoadParam.defaultModulate, 255 ); - u32 g = core::s32_min( source->color[1] * LoadParam.defaultModulate, 255 ); - u32 b = core::s32_min( source->color[2] * LoadParam.defaultModulate, 255 ); - - dest->Color.set(a << 24 | r << 16 | g << 8 | b); - } - else - { - dest->Color.set(0xFFFFFFFF); - } -} - - -void CQ3LevelMesh::SBezier::tesselate( s32 level ) -{ - //Calculate how many vertices across/down there are - s32 j, k; - - column[0].set_used( level + 1 ); - column[1].set_used( level + 1 ); - column[2].set_used( level + 1 ); - - const f64 w = 0.0 + (1.0 / (f64) level ); - - //Tesselate along the columns - for( j = 0; j <= level; ++j) - { - const f64 f = w * (f64) j; - - column[0][j] = control[0].getInterpolated_quadratic(control[3], control[6], f ); - column[1][j] = control[1].getInterpolated_quadratic(control[4], control[7], f ); - column[2][j] = control[2].getInterpolated_quadratic(control[5], control[8], f ); - } - - const u32 idx = Patch->Vertices.size(); - Patch->Vertices.reallocate(idx+level*level); - //Tesselate across the rows to get final vertices - video::S3DVertex2TCoords v; - S3DVertex2TCoords_64 f; - for( j = 0; j <= level; ++j) - { - for( k = 0; k <= level; ++k) - { - f = column[0][j].getInterpolated_quadratic(column[1][j], column[2][j], w * (f64) k); - f.copy( v ); - Patch->Vertices.push_back( v ); - } - } - - Patch->Indices.reallocate(Patch->Indices.size()+6*level*level); - // connect - for( j = 0; j < level; ++j) - { - for( k = 0; k < level; ++k) - { - const s32 inx = idx + ( k * ( level + 1 ) ) + j; - - Patch->Indices.push_back( inx + 0 ); - Patch->Indices.push_back( inx + (level + 1 ) + 0 ); - Patch->Indices.push_back( inx + (level + 1 ) + 1 ); - - Patch->Indices.push_back( inx + 0 ); - Patch->Indices.push_back( inx + (level + 1 ) + 1 ); - Patch->Indices.push_back( inx + 1 ); - } - } -} - - -/*! - no subdivision -*/ -void CQ3LevelMesh::createCurvedSurface_nosubdivision(SMeshBufferLightMap* meshBuffer, - s32 faceIndex, - s32 patchTesselation, - s32 storevertexcolor) -{ - tBSPFace * face = &Faces[faceIndex]; - u32 j,k,m; - - // number of control points across & up - const u32 controlWidth = face->size[0]; - const u32 controlHeight = face->size[1]; - if ( 0 == controlWidth || 0 == controlHeight ) - return; - - video::S3DVertex2TCoords v; - - m = meshBuffer->Vertices.size(); - meshBuffer->Vertices.reallocate(m+controlHeight * controlWidth); - for ( j = 0; j!= controlHeight * controlWidth; ++j ) - { - copy( &v, &Vertices [ face->vertexIndex + j ], storevertexcolor ); - meshBuffer->Vertices.push_back( v ); - } - - meshBuffer->Indices.reallocate(meshBuffer->Indices.size()+6*(controlHeight-1) * (controlWidth-1)); - for ( j = 0; j!= controlHeight - 1; ++j ) - { - for ( k = 0; k!= controlWidth - 1; ++k ) - { - meshBuffer->Indices.push_back( m + k + 0 ); - meshBuffer->Indices.push_back( m + k + controlWidth + 0 ); - meshBuffer->Indices.push_back( m + k + controlWidth + 1 ); - - meshBuffer->Indices.push_back( m + k + 0 ); - meshBuffer->Indices.push_back( m + k + controlWidth + 1 ); - meshBuffer->Indices.push_back( m + k + 1 ); - } - m += controlWidth; - } -} - - -/*! -*/ -void CQ3LevelMesh::createCurvedSurface_bezier(SMeshBufferLightMap* meshBuffer, - s32 faceIndex, - s32 patchTesselation, - s32 storevertexcolor) -{ - - tBSPFace * face = &Faces[faceIndex]; - u32 j,k; - - // number of control points across & up - const u32 controlWidth = face->size[0]; - const u32 controlHeight = face->size[1]; - - if ( 0 == controlWidth || 0 == controlHeight ) - return; - - // number of biquadratic patches - const u32 biquadWidth = (controlWidth - 1)/2; - const u32 biquadHeight = (controlHeight -1)/2; - - if ( LoadParam.verbose > 1 ) - { - LoadParam.startTime = os::Timer::getRealTime(); - } - - // Create space for a temporary array of the patch's control points - core::array<S3DVertex2TCoords_64> controlPoint; - controlPoint.set_used( controlWidth * controlHeight ); - - for( j = 0; j < controlPoint.size(); ++j) - { - copy( &controlPoint[j], &Vertices [ face->vertexIndex + j ], storevertexcolor ); - } - - // create a temporary patch - Bezier.Patch = new scene::SMeshBufferLightMap(); - - //Loop through the biquadratic patches - for( j = 0; j < biquadHeight; ++j) - { - for( k = 0; k < biquadWidth; ++k) - { - // set up this patch - const s32 inx = j*controlWidth*2 + k*2; - - // setup bezier control points for this patch - Bezier.control[0] = controlPoint[ inx + 0]; - Bezier.control[1] = controlPoint[ inx + 1]; - Bezier.control[2] = controlPoint[ inx + 2]; - Bezier.control[3] = controlPoint[ inx + controlWidth + 0 ]; - Bezier.control[4] = controlPoint[ inx + controlWidth + 1 ]; - Bezier.control[5] = controlPoint[ inx + controlWidth + 2 ]; - Bezier.control[6] = controlPoint[ inx + controlWidth * 2 + 0]; - Bezier.control[7] = controlPoint[ inx + controlWidth * 2 + 1]; - Bezier.control[8] = controlPoint[ inx + controlWidth * 2 + 2]; - - Bezier.tesselate( patchTesselation ); - } - } - - // stitch together with existing geometry - // TODO: only border needs to be checked - const u32 bsize = Bezier.Patch->getVertexCount(); - const u32 msize = meshBuffer->getVertexCount(); -/* - for ( j = 0; j!= bsize; ++j ) - { - const core::vector3df &v = Bezier.Patch->Vertices[j].Pos; - - for ( k = 0; k!= msize; ++k ) - { - const core::vector3df &m = meshBuffer->Vertices[k].Pos; - - if ( !v.equals( m, tolerance ) ) - continue; - - meshBuffer->Vertices[k].Pos = v; - //Bezier.Patch->Vertices[j].Pos = m; - } - } -*/ - - // add Patch to meshbuffer - meshBuffer->Vertices.reallocate(msize+bsize); - for ( j = 0; j!= bsize; ++j ) - { - meshBuffer->Vertices.push_back( Bezier.Patch->Vertices[j] ); - } - - // add indices to meshbuffer - meshBuffer->Indices.reallocate(meshBuffer->getIndexCount()+Bezier.Patch->getIndexCount()); - for ( j = 0; j!= Bezier.Patch->getIndexCount(); ++j ) - { - meshBuffer->Indices.push_back( msize + Bezier.Patch->Indices[j] ); - } - - delete Bezier.Patch; - - if ( LoadParam.verbose > 1 ) - { - LoadParam.endTime = os::Timer::getRealTime(); - - snprintf_irr( buf, sizeof ( buf ), - "quake3::createCurvedSurface_bezier needed %04u ms to create bezier patch.(%ux%u)", - LoadParam.endTime - LoadParam.startTime, - biquadWidth, - biquadHeight - ); - os::Printer::log(buf, ELL_INFORMATION); - } - -} - - - -/*! - Loads entities from file -*/ -void CQ3LevelMesh::getConfiguration( io::IReadFile* file ) -{ - tBSPLump l; - l.offset = file->getPos(); - l.length = file->getSize (); - - core::array<u8> entity; - entity.set_used( l.length + 2 ); - entity[l.length + 1 ] = 0; - - file->seek(l.offset); - file->read( entity.pointer(), l.length); - - parser_parse( entity.pointer(), l.length, &CQ3LevelMesh::scriptcallback_config ); - - if ( Entity.size () ) - Entity.getLast().name = file->getFileName(); -} - - -//! get's an interface to the entities -tQ3EntityList & CQ3LevelMesh::getEntityList() -{ -// Entity.sort(); - return Entity; -} - -//! returns the requested brush entity -IMesh* CQ3LevelMesh::getBrushEntityMesh(s32 num) const -{ - if (num < 1 || num >= NumModels) - return 0; - - return BrushEntities[num]; -} - -//! returns the requested brush entity -IMesh* CQ3LevelMesh::getBrushEntityMesh(quake3::IEntity &ent) const -{ - // This is a helper function to parse the entity, - // so you don't have to. - - s32 num; - - const quake3::SVarGroup* group = ent.getGroup(1); - const core::stringc& modnum = group->get("model"); - - if (!group->isDefined("model")) - return 0; - - const char *temp = modnum.c_str() + 1; // We skip the first character. - num = core::strtol10(temp); - - return getBrushEntityMesh(num); -} - - -/*! -*/ -const IShader * CQ3LevelMesh::getShader(u32 index) const -{ - index &= 0xFFFF; - - if ( index < Shader.size() ) - { - return &Shader[index]; - } - - return 0; -} - - -/*! - loads the shader definition -*/ -const IShader* CQ3LevelMesh::getShader( const c8 * filename, bool fileNameIsValid ) -{ - core::stringc searchName ( filename ); - - IShader search; - search.name = searchName; - search.name.replace( '\\', '/' ); - search.name.make_lower(); - - - core::stringc message; - s32 index; - - //! is Shader already in cache? - index = Shader.linear_search( search ); - if ( index >= 0 ) - { - if ( LoadParam.verbose > 1 ) - { - message = searchName + " found " + Shader[index].name; - os::Printer::log("quake3:getShader", message.c_str(), ELL_INFORMATION); - } - - return &Shader[index]; - } - - io::path loadFile; - - if ( !fileNameIsValid ) - { - // extract the shader name from the last path component in filename - // "scripts/[name].shader" - core::stringc cut( search.name ); - - s32 end = cut.findLast( '/' ); - s32 start = cut.findLast( '/', end - 1 ); - - loadFile = LoadParam.scriptDir; - loadFile.append( cut.subString( start, end - start ) ); - loadFile.append( ".shader" ); - } - else - { - loadFile = search.name; - } - - // already loaded the file ? - index = ShaderFile.binary_search( loadFile ); - if ( index >= 0 ) - return 0; - - // add file to loaded files - ShaderFile.push_back( loadFile ); - - if ( !FileSystem->existFile( loadFile.c_str() ) ) - { - if ( LoadParam.verbose > 1 ) - { - message = loadFile + " for " + searchName + " failed "; - os::Printer::log("quake3:getShader", message.c_str(), ELL_INFORMATION); - } - return 0; - } - - if ( LoadParam.verbose ) - { - message = loadFile + " for " + searchName; - os::Printer::log("quake3:getShader Load shader", message.c_str(), ELL_INFORMATION); - } - - - io::IReadFile *file = FileSystem->createAndOpenFile( loadFile.c_str() ); - if ( file ) - { - getShader ( file ); - file->drop (); - } - - - // search again - index = Shader.linear_search( search ); - return index >= 0 ? &Shader[index] : 0; -} - -/*! - loads the shader definition -*/ -void CQ3LevelMesh::getShader( io::IReadFile* file ) -{ - if ( 0 == file ) - return; - - // load script - core::array<u8> script; - const long len = file->getSize(); - - script.set_used( len + 2 ); - - file->seek( 0 ); - file->read( script.pointer(), len ); - script[ len + 1 ] = 0; - - // start a parser instance - parser_parse( script.pointer(), len, &CQ3LevelMesh::scriptcallback_shader ); -} - - -//! adding default shaders -void CQ3LevelMesh::InitShader() -{ - ReleaseShader(); - - IShader element; - - SVarGroup group; - SVariable variable ( "noshader" ); - - group.Variable.push_back( variable ); - - element.VarGroup = new SVarGroupList(); - element.VarGroup->VariableGroup.push_back( group ); - element.VarGroup->VariableGroup.push_back( SVarGroup() ); - element.name = element.VarGroup->VariableGroup[0].Variable[0].name; - element.ID = Shader.size(); - Shader.push_back( element ); - - if ( LoadParam.loadAllShaders ) - { - io::EFileSystemType current = FileSystem->setFileListSystem ( io::FILESYSTEM_VIRTUAL ); - io::path save = FileSystem->getWorkingDirectory(); - - io::path newDir; - newDir = "/"; - newDir += LoadParam.scriptDir; - newDir += "/"; - FileSystem->changeWorkingDirectoryTo ( newDir.c_str() ); - - core::stringc s; - io::IFileList *fileList = FileSystem->createFileList (); - for (u32 i=0; i< fileList->getFileCount(); ++i) - { - s = fileList->getFullFileName(i); - if ( s.find ( ".shader" ) >= 0 ) - { - if ( 0 == LoadParam.loadSkyShader && s.find ( "sky.shader" ) >= 0 ) - { - } - else - { - getShader ( s.c_str () ); - } - } - } - fileList->drop (); - - FileSystem->changeWorkingDirectoryTo ( save ); - FileSystem->setFileListSystem ( current ); - } -} - - -//! script callback for shaders -//! i'm having troubles with the reference counting, during callback.. resorting.. -void CQ3LevelMesh::ReleaseShader() -{ - for ( u32 i = 0; i!= Shader.size(); ++i ) - { - Shader[i].VarGroup->drop(); - } - Shader.clear(); - ShaderFile.clear(); -} - - -/*! -*/ -void CQ3LevelMesh::ReleaseEntity() -{ - for ( u32 i = 0; i!= Entity.size(); ++i ) - { - Entity[i].VarGroup->drop(); - } - Entity.clear(); -} - - -// config in simple (quake3) and advanced style -void CQ3LevelMesh::scriptcallback_config( SVarGroupList *& grouplist, eToken token ) -{ - IShader element; - - if ( token == Q3_TOKEN_END_LIST ) - { - if ( 0 == grouplist->VariableGroup[0].Variable.size() ) - return; - - element.name = grouplist->VariableGroup[0].Variable[0].name; - } - else - { - if ( grouplist->VariableGroup.size() != 2 ) - return; - - element.name = "configuration"; - } - - grouplist->grab(); - element.VarGroup = grouplist; - element.ID = Entity.size(); - Entity.push_back( element ); -} - - -// entity only has only one valid level.. and no assoziative name.. -void CQ3LevelMesh::scriptcallback_entity( SVarGroupList *& grouplist, eToken token ) -{ - if ( token != Q3_TOKEN_END_LIST || grouplist->VariableGroup.size() != 2 ) - return; - - grouplist->grab(); - - IEntity element; - element.VarGroup = grouplist; - element.ID = Entity.size(); - element.name = grouplist->VariableGroup[1].get( "classname" ); - - - Entity.push_back( element ); -} - - -//!. script callback for shaders -void CQ3LevelMesh::scriptcallback_shader( SVarGroupList *& grouplist,eToken token ) -{ - if ( token != Q3_TOKEN_END_LIST || grouplist->VariableGroup[0].Variable.size()==0) - return; - - - IShader element; - - grouplist->grab(); - element.VarGroup = grouplist; - element.name = element.VarGroup->VariableGroup[0].Variable[0].name; - element.ID = Shader.size(); -/* - core::stringc s; - dumpShader ( s, &element ); - printf ( s.c_str () ); -*/ - Shader.push_back( element ); -} - - -/*! - delete all buffers without geometry in it. -*/ -void CQ3LevelMesh::cleanMeshes() -{ - if ( 0 == LoadParam.cleanUnResolvedMeshes ) - return; - - s32 i; - - // First the main level - for (i = 0; i < E_Q3_MESH_SIZE; i++) - { - bool texture0important = ( i == 0 ); - - cleanMesh(Mesh[i], texture0important); - } - - // Then the brush entities - for (i = 1; i < NumModels; i++) - { - cleanMesh(BrushEntities[i], true); - } -} - -void CQ3LevelMesh::cleanMesh(SMesh *m, const bool texture0important) -{ - // delete all buffers without geometry in it. - u32 run = 0; - u32 remove = 0; - - IMeshBuffer *b; - - run = 0; - remove = 0; - - if ( LoadParam.verbose > 0 ) - { - LoadParam.startTime = os::Timer::getRealTime(); - if ( LoadParam.verbose > 1 ) - { - snprintf_irr( buf, sizeof ( buf ), - "quake3::cleanMeshes start for %u meshes", - m->MeshBuffers.size() - ); - os::Printer::log(buf, ELL_INFORMATION); - } - } - - u32 i = 0; - s32 blockstart = -1; - s32 blockcount = 0; - - while( i < m->MeshBuffers.size()) - { - run += 1; - - b = m->MeshBuffers[i]; - - if ( b->getVertexCount() == 0 || b->getIndexCount() == 0 || - ( texture0important && b->getMaterial().getTexture(0) == 0 ) - ) - { - if ( blockstart < 0 ) - { - blockstart = i; - blockcount = 0; - } - blockcount += 1; - i += 1; - - // delete Meshbuffer - i -= 1; - remove += 1; - b->drop(); - m->MeshBuffers.erase(i); - } - else - { - // clean blockwise - if ( blockstart >= 0 ) - { - if ( LoadParam.verbose > 1 ) - { - snprintf_irr( buf, sizeof ( buf ), - "quake3::cleanMeshes cleaning mesh %d %d size", - blockstart, - blockcount - ); - os::Printer::log(buf, ELL_INFORMATION); - } - blockstart = -1; - } - i += 1; - } - } - - if ( LoadParam.verbose > 0 ) - { - LoadParam.endTime = os::Timer::getRealTime(); - snprintf_irr( buf, sizeof ( buf ), - "quake3::cleanMeshes needed %04u ms to clean %u of %u meshes", - LoadParam.endTime - LoadParam.startTime, - remove, - run - ); - os::Printer::log(buf, ELL_INFORMATION); - } -} - - -// recalculate bounding boxes -void CQ3LevelMesh::calcBoundingBoxes() -{ - if ( LoadParam.verbose > 0 ) - { - LoadParam.startTime = os::Timer::getRealTime(); - - if ( LoadParam.verbose > 1 ) - { - snprintf_irr( buf, sizeof ( buf ), - "quake3::calcBoundingBoxes start create %d textures and %d lightmaps", - NumTextures, - NumLightMaps - ); - os::Printer::log(buf, ELL_INFORMATION); - } - } - - s32 g; - - // create bounding box - for ( g = 0; g != E_Q3_MESH_SIZE; ++g ) - { - for ( u32 j=0; j < Mesh[g]->MeshBuffers.size(); ++j) - { - ((SMeshBufferLightMap*)Mesh[g]->MeshBuffers[j])->recalculateBoundingBox(); - } - - Mesh[g]->recalculateBoundingBox(); - // Mesh[0] is the main bbox - if (g!=0) - Mesh[0]->BoundingBox.addInternalBox(Mesh[g]->getBoundingBox()); - } - - for (g = 1; g < NumModels; g++) - { - for ( u32 j=0; j < BrushEntities[g]->MeshBuffers.size(); ++j) - { - ((SMeshBufferLightMap*)BrushEntities[g]->MeshBuffers[j])-> - recalculateBoundingBox(); - } - - BrushEntities[g]->recalculateBoundingBox(); - } - - if ( LoadParam.verbose > 0 ) - { - LoadParam.endTime = os::Timer::getRealTime(); - - snprintf_irr( buf, sizeof ( buf ), - "quake3::calcBoundingBoxes needed %04u ms to create %d textures and %d lightmaps", - LoadParam.endTime - LoadParam.startTime, - NumTextures, - NumLightMaps - ); - os::Printer::log( buf, ELL_INFORMATION); - } -} - - -//! loads the textures -void CQ3LevelMesh::loadTextures() -{ - if (!Driver) - return; - - if ( LoadParam.verbose > 0 ) - { - LoadParam.startTime = os::Timer::getRealTime(); - - if ( LoadParam.verbose > 1 ) - { - snprintf_irr( buf, sizeof ( buf ), - "quake3::loadTextures start create %d textures and %d lightmaps", - NumTextures, - NumLightMaps - ); - os::Printer::log( buf, ELL_INFORMATION); - } - } - - c8 lightmapname[255]; - s32 t; - - // load lightmaps. - Lightmap.set_used(NumLightMaps); - -/* - bool oldMipMapState = Driver->getTextureCreationFlag(video::ETCF_CREATE_MIP_MAPS); - Driver->setTextureCreationFlag(video::ETCF_CREATE_MIP_MAPS, false); -*/ - core::dimension2d<u32> lmapsize(128,128); - - video::IImage* lmapImg; - for ( t = 0; t < NumLightMaps ; ++t) - { - sprintf(lightmapname, "%s.lightmap.%d", LevelName.c_str(), t); - - // lightmap is a CTexture::R8G8B8 format - lmapImg = Driver->createImageFromData( - video::ECF_R8G8B8, lmapsize, - LightMaps[t].imageBits, false, true ); - - Lightmap[t] = Driver->addTexture( lightmapname, lmapImg ); - lmapImg->drop(); - } - -// Driver->setTextureCreationFlag(video::ETCF_CREATE_MIP_MAPS, oldMipMapState); - - // load textures - Tex.set_used( NumTextures ); - - const IShader* shader; - - core::stringc list; - io::path check; - tTexArray textureArray; - - // pre-load shaders - for ( t=0; t< NumTextures; ++t) - { - shader = getShader(Textures[t].strName, false); - } - - for ( t=0; t< NumTextures; ++t) - { - Tex[t].ShaderID = -1; - Tex[t].Texture = 0; - - list = ""; - - // get a shader ( if one exists ) - shader = getShader( Textures[t].strName, false); - if ( shader ) - { - Tex[t].ShaderID = shader->ID; - - // if texture name == stage1 Texture map - const SVarGroup * group; - - group = shader->getGroup( 2 ); - if ( group ) - { - if ( core::cutFilenameExtension( check, group->get( "map" ) ) == Textures[t].strName ) - { - list += check; - } - else - if ( check == "$lightmap" ) - { - // we check if lightmap is in stage 1 and texture in stage 2 - group = shader->getGroup( 3 ); - if ( group ) - list += group->get( "map" ); - } - } - } - else - { - // no shader, take it - list += Textures[t].strName; - } - - u32 pos = 0; - getTextures( textureArray, list, pos, FileSystem, Driver ); - - Tex[t].Texture = textureArray[0]; - } - - if ( LoadParam.verbose > 0 ) - { - LoadParam.endTime = os::Timer::getRealTime(); - - snprintf_irr( buf, sizeof ( buf ), - "quake3::loadTextures needed %04u ms to create %d textures and %d lightmaps", - LoadParam.endTime - LoadParam.startTime, - NumTextures, - NumLightMaps - ); - os::Printer::log( buf, ELL_INFORMATION); - } -} - - -//! Returns an axis aligned bounding box of the mesh. -const core::aabbox3d<f32>& CQ3LevelMesh::getBoundingBox() const -{ - return Mesh[0]->getBoundingBox(); -} - - -void CQ3LevelMesh::setBoundingBox(const core::aabbox3df& box) -{ - Mesh[0]->setBoundingBox(box); -} - - -//! Returns the type of the animated mesh. -E_ANIMATED_MESH_TYPE CQ3LevelMesh::getMeshType() const -{ - return scene::EAMT_BSP; -} - -} // end namespace scene -} // end namespace irr - -#endif // _IRR_COMPILE_WITH_BSP_LOADER_ diff --git a/source/Irrlicht/CQ3LevelMesh.h b/source/Irrlicht/CQ3LevelMesh.h deleted file mode 100644 index 595f6c95..00000000 --- a/source/Irrlicht/CQ3LevelMesh.h +++ /dev/null @@ -1,488 +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_Q3_LEVEL_MESH_H_INCLUDED__ -#define __C_Q3_LEVEL_MESH_H_INCLUDED__ - -#include "IQ3LevelMesh.h" -#include "IReadFile.h" -#include "IFileSystem.h" -#include "SMesh.h" -#include "SMeshBufferLightMap.h" -#include "IVideoDriver.h" -#include "irrString.h" -#include "ISceneManager.h" -#include "os.h" - -namespace irr -{ -namespace scene -{ - class CQ3LevelMesh : public IQ3LevelMesh - { - public: - - //! constructor - CQ3LevelMesh(io::IFileSystem* fs, scene::ISceneManager* smgr, - const quake3::Q3LevelLoadParameter &loadParam); - - //! destructor - virtual ~CQ3LevelMesh(); - - //! loads a level from a .bsp-File. Also tries to load all - //! needed textures. Returns true if successful. - bool loadFile(io::IReadFile* file); - - //! returns the amount of frames in milliseconds. If the amount - //! is 1, it is a static (=non animated) mesh. - virtual u32 getFrameCount() const _IRR_OVERRIDE_; - - //! Gets the default animation speed of the animated mesh. - /** \return Amount of frames per second. If the amount is 0, it is a static, non animated mesh. */ - virtual f32 getAnimationSpeed() const _IRR_OVERRIDE_ - { - return FramesPerSecond; - } - - //! Gets the frame count of the animated mesh. - /** \param fps Frames per second to play the animation with. If the amount is 0, it is not animated. - The actual speed is set in the scene node the mesh is instantiated in.*/ - virtual void setAnimationSpeed(f32 fps) _IRR_OVERRIDE_ - { - FramesPerSecond=fps; - } - - //! returns the animated mesh based on a detail level. 0 is the - //! lowest, 255 the highest detail. Note, that some Meshes will - //! ignore the detail level. - virtual IMesh* getMesh(s32 frameInMs, s32 detailLevel=255, - s32 startFrameLoop=-1, s32 endFrameLoop=-1) _IRR_OVERRIDE_; - - //! Returns an axis aligned bounding box of the mesh. - //! \return A bounding box of this mesh is returned. - virtual const core::aabbox3d<f32>& getBoundingBox() const _IRR_OVERRIDE_; - - virtual void setBoundingBox( const core::aabbox3df& box) _IRR_OVERRIDE_; - - //! Returns the type of the animated mesh. - virtual E_ANIMATED_MESH_TYPE getMeshType() const _IRR_OVERRIDE_; - - //! loads the shader definition - void getShader( io::IReadFile* file ); - - //! loads the shader definition - virtual const quake3::IShader * getShader( const c8 * filename, bool fileNameIsValid=true ) _IRR_OVERRIDE_; - - //! returns a already loaded Shader - virtual const quake3::IShader * getShader( u32 index ) const _IRR_OVERRIDE_; - - - //! loads a configuration file - void getConfiguration( io::IReadFile* file ); - //! get's an interface to the entities - virtual quake3::tQ3EntityList & getEntityList() _IRR_OVERRIDE_; - - //! returns the requested brush entity - virtual IMesh* getBrushEntityMesh(s32 num) const _IRR_OVERRIDE_; - - //! returns the requested brush entity - virtual IMesh* getBrushEntityMesh(quake3::IEntity &ent) const _IRR_OVERRIDE_; - - //Link to held meshes? ... - - - //! returns amount of mesh buffers. - virtual u32 getMeshBufferCount() const _IRR_OVERRIDE_ - { - return 0; - } - - //! returns pointer to a mesh buffer - virtual IMeshBuffer* getMeshBuffer(u32 nr) const _IRR_OVERRIDE_ - { - return 0; - } - - //! Returns pointer to a mesh buffer which fits a material - /** \param material: material to search for - \return Pointer to the mesh buffer or 0 if there is no such mesh buffer. */ - virtual IMeshBuffer* getMeshBuffer( const video::SMaterial &material) const _IRR_OVERRIDE_ - { - return 0; - } - - virtual void setMaterialFlag(video::E_MATERIAL_FLAG flag, bool newvalue) _IRR_OVERRIDE_ - { - return; - } - - //! set the hardware mapping hint, for driver - virtual void setHardwareMappingHint(E_HARDWARE_MAPPING newMappingHint, E_BUFFER_TYPE buffer=EBT_VERTEX_AND_INDEX) _IRR_OVERRIDE_ - { - return; - } - - //! flags the meshbuffer as changed, reloads hardware buffers - virtual void setDirty(E_BUFFER_TYPE buffer=EBT_VERTEX_AND_INDEX) _IRR_OVERRIDE_ - { - return; - } - - private: - - - void constructMesh(); - void solveTJunction(); - void loadTextures(); - scene::SMesh** buildMesh(s32 num); - - struct STexShader - { - video::ITexture* Texture; - s32 ShaderID; - }; - - core::array< STexShader > Tex; - core::array<video::ITexture*> Lightmap; - - enum eLumps - { - kEntities = 0, // Stores player/object positions, etc... - kShaders = 1, // Stores texture information - kPlanes = 2, // Stores the splitting planes - kNodes = 3, // Stores the BSP nodes - kLeafs = 4, // Stores the leafs of the nodes - kLeafFaces = 5, // Stores the leaf's indices into the faces - kLeafBrushes = 6, // Stores the leaf's indices into the brushes - kModels = 7, // Stores the info of world models - kBrushes = 8, // Stores the brushes info (for collision) - kBrushSides = 9, // Stores the brush surfaces info - kVertices = 10, // Stores the level vertices - kMeshVerts = 11, // Stores the model vertices offsets - kFogs = 12, // Stores the shader files (blending, anims..) - kFaces = 13, // Stores the faces for the level - kLightmaps = 14, // Stores the lightmaps for the level - kLightGrid = 15, // Stores extra world lighting information - kVisData = 16, // Stores PVS and cluster info (visibility) - kLightArray = 17, // RBSP - kMaxLumps // A constant to store the number of lumps - }; - - enum eBspSurfaceType - { - BSP_MST_BAD, - BSP_MST_PLANAR, - BSP_MST_PATCH, - BSP_MST_TRIANGLE_SOUP, - BSP_MST_FLARE, - BSP_MST_FOLIAGE - - }; - - struct tBSPHeader - { - s32 strID; // This should always be 'IBSP' - s32 version; // This should be 0x2e for Quake 3 files - }; - tBSPHeader header; - - struct tBSPLump - { - s32 offset; - s32 length; - }; - - - struct tBSPVertex - { - f32 vPosition[3]; // (x, y, z) position. - f32 vTextureCoord[2]; // (u, v) texture coordinate - f32 vLightmapCoord[2]; // (u, v) lightmap coordinate - f32 vNormal[3]; // (x, y, z) normal vector - u8 color[4]; // RGBA color for the vertex - }; - - struct tBSPFace - { - s32 textureID; // The index into the texture array - s32 fogNum; // The index for the effects (or -1 = n/a) - s32 type; // 1=polygon, 2=patch, 3=mesh, 4=billboard - s32 vertexIndex; // The index into this face's first vertex - s32 numOfVerts; // The number of vertices for this face - s32 meshVertIndex; // The index into the first meshvertex - s32 numMeshVerts; // The number of mesh vertices - s32 lightmapID; // The texture index for the lightmap - s32 lMapCorner[2]; // The face's lightmap corner in the image - s32 lMapSize[2]; // The size of the lightmap section - f32 lMapPos[3]; // The 3D origin of lightmap. - f32 lMapBitsets[2][3]; // The 3D space for s and t unit vectors. - f32 vNormal[3]; // The face normal. - s32 size[2]; // The bezier patch dimensions. - }; - - struct tBSPTexture - { - c8 strName[64]; // The name of the texture w/o the extension - u32 flags; // The surface flags (unknown) - u32 contents; // The content flags (unknown) - }; - - struct tBSPLightmap - { - u8 imageBits[128][128][3]; // The RGB data in a 128x128 image - }; - - struct tBSPNode - { - s32 plane; // The index into the planes array - s32 front; // The child index for the front node - s32 back; // The child index for the back node - s32 mins[3]; // The bounding box min position. - s32 maxs[3]; // The bounding box max position. - }; - - struct tBSPLeaf - { - s32 cluster; // The visibility cluster - s32 area; // The area portal - s32 mins[3]; // The bounding box min position - s32 maxs[3]; // The bounding box max position - s32 leafface; // The first index into the face array - s32 numOfLeafFaces; // The number of faces for this leaf - s32 leafBrush; // The first index for into the brushes - s32 numOfLeafBrushes; // The number of brushes for this leaf - }; - - struct tBSPPlane - { - f32 vNormal[3]; // Plane normal. - f32 d; // The plane distance from origin - }; - - struct tBSPVisData - { - s32 numOfClusters; // The number of clusters - s32 bytesPerCluster; // Bytes (8 bits) in the cluster's bitset - c8 *pBitsets; // Array of bytes holding the cluster vis. - }; - - struct tBSPBrush - { - s32 brushSide; // The starting brush side for the brush - s32 numOfBrushSides; // Number of brush sides for the brush - s32 textureID; // The texture index for the brush - }; - - struct tBSPBrushSide - { - s32 plane; // The plane index - s32 textureID; // The texture index - }; - - struct tBSPModel - { - f32 min[3]; // The min position for the bounding box - f32 max[3]; // The max position for the bounding box. - s32 faceIndex; // The first face index in the model - s32 numOfFaces; // The number of faces in the model - s32 brushIndex; // The first brush index in the model - s32 numOfBrushes; // The number brushes for the model - }; - - struct tBSPFog - { - c8 shader[64]; // The name of the shader file - s32 brushIndex; // The brush index for this shader - s32 visibleSide; // the brush side that ray tests need to clip against (-1 == none - }; - core::array < STexShader > FogMap; - - struct tBSPLights - { - u8 ambient[3]; // This is the ambient color in RGB - u8 directional[3]; // This is the directional color in RGB - u8 direction[2]; // The direction of the light: [phi,theta] - }; - - void loadTextures (tBSPLump* l, io::IReadFile* file); // Load the textures - void loadLightmaps (tBSPLump* l, io::IReadFile* file); // Load the lightmaps - void loadVerts (tBSPLump* l, io::IReadFile* file); // Load the vertices - void loadFaces (tBSPLump* l, io::IReadFile* file); // Load the faces - void loadPlanes (tBSPLump* l, io::IReadFile* file); // Load the Planes of the BSP - void loadNodes (tBSPLump* l, io::IReadFile* file); // load the Nodes of the BSP - void loadLeafs (tBSPLump* l, io::IReadFile* file); // load the Leafs of the BSP - void loadLeafFaces (tBSPLump* l, io::IReadFile* file); // load the Faces of the Leafs of the BSP - void loadVisData (tBSPLump* l, io::IReadFile* file); // load the visibility data of the clusters - void loadEntities (tBSPLump* l, io::IReadFile* file); // load the entities - void loadModels (tBSPLump* l, io::IReadFile* file); // load the models - void loadMeshVerts (tBSPLump* l, io::IReadFile* file); // load the mesh vertices - void loadBrushes (tBSPLump* l, io::IReadFile* file); // load the brushes of the BSP - void loadBrushSides (tBSPLump* l, io::IReadFile* file); // load the brushsides of the BSP - void loadLeafBrushes(tBSPLump* l, io::IReadFile* file); // load the brushes of the leaf - void loadFogs (tBSPLump* l, io::IReadFile* file); // load the shaders - - //bi-quadratic bezier patches - void createCurvedSurface_bezier(SMeshBufferLightMap* meshBuffer, - s32 faceIndex, s32 patchTesselation, s32 storevertexcolor); - - void createCurvedSurface_nosubdivision(SMeshBufferLightMap* meshBuffer, - s32 faceIndex, s32 patchTesselation, s32 storevertexcolor); - - struct S3DVertex2TCoords_64 - { - core::vector3d<f64> Pos; - core::vector3d<f64> Normal; - video::SColorf Color; - core::vector2d<f64> TCoords; - core::vector2d<f64> TCoords2; - - void copy( video::S3DVertex2TCoords &dest ) const; - - S3DVertex2TCoords_64() {} - S3DVertex2TCoords_64(const core::vector3d<f64>& pos, const core::vector3d<f64>& normal, const video::SColorf& color, - const core::vector2d<f64>& tcoords, const core::vector2d<f64>& tcoords2) - : Pos(pos), Normal(normal), Color(color), TCoords(tcoords), TCoords2(tcoords2) {} - - S3DVertex2TCoords_64 getInterpolated_quadratic(const S3DVertex2TCoords_64& v2, - const S3DVertex2TCoords_64& v3, const f64 d) const - { - return S3DVertex2TCoords_64 ( - Pos.getInterpolated_quadratic ( v2.Pos, v3.Pos, d ), - Normal.getInterpolated_quadratic ( v2.Normal, v3.Normal, d ), - Color.getInterpolated_quadratic ( v2.Color, v3.Color, (f32) d ), - TCoords.getInterpolated_quadratic ( v2.TCoords, v3.TCoords, d ), - TCoords2.getInterpolated_quadratic ( v2.TCoords2, v3.TCoords2, d )); - } - }; - - inline void copy( video::S3DVertex2TCoords * dest, const tBSPVertex * source, - s32 vertexcolor ) const; - void copy( S3DVertex2TCoords_64 * dest, const tBSPVertex * source, s32 vertexcolor ) const; - - - struct SBezier - { - SMeshBufferLightMap *Patch; - S3DVertex2TCoords_64 control[9]; - - void tesselate(s32 level); - - private: - core::array<S3DVertex2TCoords_64> column[3]; - }; - SBezier Bezier; - - quake3::Q3LevelLoadParameter LoadParam; - - tBSPLump Lumps[kMaxLumps]; - - tBSPTexture* Textures; - s32 NumTextures; - - tBSPLightmap* LightMaps; - s32 NumLightMaps; - - tBSPVertex* Vertices; - s32 NumVertices; - - tBSPFace* Faces; - s32 NumFaces; - - tBSPModel* Models; - s32 NumModels; - - tBSPPlane* Planes; - s32 NumPlanes; - - tBSPNode* Nodes; - s32 NumNodes; - - tBSPLeaf* Leafs; - s32 NumLeafs; - - s32 *LeafFaces; - s32 NumLeafFaces; - - s32 *MeshVerts; // The vertex offsets for a mesh - s32 NumMeshVerts; - - tBSPBrush* Brushes; - s32 NumBrushes; - - scene::SMesh** BrushEntities; - - scene::SMesh* Mesh[quake3::E_Q3_MESH_SIZE]; - video::IVideoDriver* Driver; - core::stringc LevelName; - io::IFileSystem* FileSystem; // needs because there are no file extenstions stored in .bsp files. - - // Additional content - scene::ISceneManager* SceneManager; - enum eToken - { - Q3_TOKEN_UNRESOLVED = 0, - Q3_TOKEN_EOF = 1, - Q3_TOKEN_START_LIST, - Q3_TOKEN_END_LIST, - Q3_TOKEN_ENTITY, - Q3_TOKEN_TOKEN, - Q3_TOKEN_EOL, - Q3_TOKEN_COMMENT, - Q3_TOKEN_MATH_DIVIDE, - Q3_TOKEN_MATH_ADD, - Q3_TOKEN_MATH_MULTIPY - }; - struct SQ3Parser - { - const c8 *source; - u32 sourcesize; - u32 index; - core::stringc token; - eToken tokenresult; - }; - SQ3Parser Parser; - - - typedef void( CQ3LevelMesh::*tParserCallback ) ( quake3::SVarGroupList *& groupList, eToken token ); - void parser_parse( const void * data, u32 size, tParserCallback callback ); - void parser_nextToken(); - - void dumpVarGroup( const quake3::SVarGroup * group, s32 stack ) const; - - void scriptcallback_entity( quake3::SVarGroupList *& grouplist, eToken token ); - void scriptcallback_shader( quake3::SVarGroupList *& grouplist, eToken token ); - void scriptcallback_config( quake3::SVarGroupList *& grouplist, eToken token ); - - core::array < quake3::IShader > Shader; - core::array < quake3::IShader > Entity; //quake3::tQ3EntityList Entity; - - - quake3::tStringList ShaderFile; - void InitShader(); - void ReleaseShader(); - void ReleaseEntity(); - - - s32 setShaderMaterial( video::SMaterial & material, const tBSPFace * face ) const; - s32 setShaderFogMaterial( video::SMaterial &material, const tBSPFace * face ) const; - - struct SToBuffer - { - s32 takeVertexColor; - u32 index; - }; - - void cleanMeshes(); - void cleanMesh(SMesh *m, const bool texture0important = false); - void cleanLoader (); - void calcBoundingBoxes(); - c8 buf[128]; - f32 FramesPerSecond; - }; - -} // end namespace scene -} // end namespace irr - -#endif - diff --git a/source/Irrlicht/CQuake3ShaderSceneNode.cpp b/source/Irrlicht/CQuake3ShaderSceneNode.cpp deleted file mode 100644 index 972f131d..00000000 --- a/source/Irrlicht/CQuake3ShaderSceneNode.cpp +++ /dev/null @@ -1,1385 +0,0 @@ -// Copyright (C) 2002-2012 Thomas Alten / 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_BSP_LOADER_ - -#include "CQuake3ShaderSceneNode.h" -#include "ISceneManager.h" -#include "IVideoDriver.h" -#include "ICameraSceneNode.h" -#include "SViewFrustum.h" -#include "IMeshManipulator.h" -#include "SMesh.h" -#include "IMaterialRenderer.h" -#ifdef _IRR_COMPILE_WITH_SHADOW_VOLUME_SCENENODE_ -#include "CShadowVolumeSceneNode.h" -#else -#include "IShadowVolumeSceneNode.h" -#endif - -namespace irr -{ -namespace scene -{ - -// who, if not you.. -using namespace quake3; - -/*! -*/ -CQuake3ShaderSceneNode::CQuake3ShaderSceneNode( - scene::ISceneNode* parent, scene::ISceneManager* mgr,s32 id, - io::IFileSystem *fileSystem, const scene::IMeshBuffer *original, - const IShader * shader) -: scene::IMeshSceneNode(parent, mgr, id, - core::vector3df(0.f, 0.f, 0.f), - core::vector3df(0.f, 0.f, 0.f), - core::vector3df(1.f, 1.f, 1.f)), - Shader(shader), Mesh(0), Shadow(0), Original(0), MeshBuffer(0), TimeAbs(0.f) -{ - #ifdef _DEBUG - core::stringc dName = "CQuake3ShaderSceneNode "; - dName += Shader->name; - - setDebugName( dName.c_str() ); - #endif - - // name the Scene Node - this->Name = Shader->name; - - // take lightmap vertex type - MeshBuffer = new SMeshBuffer(); - - Mesh = new SMesh (); - Mesh->addMeshBuffer ( MeshBuffer ); - MeshBuffer->drop (); - - //Original = new SMeshBufferLightMap(); - Original = (const scene::SMeshBufferLightMap*) original; - Original->grab(); - - // clone meshbuffer to modifiable buffer - cloneBuffer(MeshBuffer, Original, - Original->getMaterial().ColorMask != 0); - - // load all Textures in all stages - loadTextures( fileSystem ); - - setAutomaticCulling( scene::EAC_OFF ); -} - - -/*! -*/ -CQuake3ShaderSceneNode::~CQuake3ShaderSceneNode() -{ - if (Shadow) - Shadow->drop(); - - if (Mesh) - Mesh->drop(); - - if (Original) - Original->drop(); -} - - - -/* - create single copies -*/ -void CQuake3ShaderSceneNode::cloneBuffer( scene::SMeshBuffer *dest, const scene::SMeshBufferLightMap * buffer, bool translateCenter ) -{ - dest->Material = buffer->Material; - dest->Indices = buffer->Indices; - - const u32 vsize = buffer->Vertices.size(); - - dest->Vertices.set_used( vsize ); - for ( u32 i = 0; i!= vsize; ++i ) - { - const video::S3DVertex2TCoords& src = buffer->Vertices[i]; - video::S3DVertex &dst = dest->Vertices[i]; - - dst.Pos = src.Pos; - dst.Normal = src.Normal; - dst.Color = 0xFFFFFFFF; - dst.TCoords = src.TCoords; - - if ( i == 0 ) - dest->BoundingBox.reset ( src.Pos ); - else - dest->BoundingBox.addInternalPoint ( src.Pos ); - } - - // move the (temp) Mesh to a ScenePosititon - // set Scene Node Position - - if ( translateCenter ) - { - MeshOffset = dest->BoundingBox.getCenter(); - setPosition( MeshOffset ); - - core::matrix4 m; - m.setTranslation( -MeshOffset ); - SceneManager->getMeshManipulator()->transform( dest, m ); - } - - // No Texture!. Use Shader-Pointer for sorting - dest->Material.setTexture(0, (video::ITexture*) Shader); -} - - -/* - load the textures for all stages -*/ -void CQuake3ShaderSceneNode::loadTextures( io::IFileSystem * fileSystem ) -{ - const SVarGroup *group; - u32 i; - - video::IVideoDriver *driver = SceneManager->getVideoDriver(); - - // generic stage - u32 mipmap = 0; - group = Shader->getGroup( 1 ); - if ( group->isDefined ( "nomipmaps" ) ) - { - mipmap = 2 | (driver->getTextureCreationFlag(video::ETCF_CREATE_MIP_MAPS)? 1: 0 ); - driver->setTextureCreationFlag(video::ETCF_CREATE_MIP_MAPS, false); - } - - // clear all stages and prefill empty - Q3Texture.setAllocStrategy ( core::ALLOC_STRATEGY_SAFE ); - Q3Texture.clear(); - for ( i = 0; i != Shader->VarGroup->VariableGroup.size(); ++i ) - { - Q3Texture.push_back( SQ3Texture() ); - } - - u32 pos; - - // get texture map - for ( i = 0; i < Shader->VarGroup->VariableGroup.size(); ++i ) - { - group = Shader->getGroup( i ); - - const core::stringc &mapname = group->get( "map" ); - if ( 0 == mapname.size() ) - continue; - - // our lightmap is passed in material.Texture[2] - if ( mapname == "$lightmap" ) - { - Q3Texture [i].Texture.push_back( Original->getMaterial().getTexture(1) ); - } - else - { - pos = 0; - getTextures( Q3Texture [i].Texture, mapname, pos, fileSystem, driver ); - } - } - - // get anim map - for ( i = 0; i < Shader->VarGroup->VariableGroup.size(); ++i ) - { - if ( Q3Texture [i].Texture.size() ) - continue; - - group = Shader->getGroup( i ); - - const core::stringc &animmap = group->get( "animmap" ); - if ( 0 == animmap.size() ) - continue; - - // first parameter is frequency - pos = 0; - Q3Texture [i].TextureFrequency = core::max_( 0.0001f, getAsFloat( animmap, pos ) ); - - getTextures( Q3Texture [i].Texture, animmap, pos,fileSystem, driver ); - } - - // get clamp map - for ( i = 0; i < Shader->VarGroup->VariableGroup.size(); ++i ) - { - if ( Q3Texture [i].Texture.size() ) - continue; - - group = Shader->getGroup( i ); - - const core::stringc &clampmap = group->get( "clampmap" ); - if ( 0 == clampmap.size() ) - continue; - - Q3Texture [i].TextureAddressMode = video::ETC_CLAMP_TO_EDGE; - pos = 0; - getTextures( Q3Texture [i].Texture, clampmap, pos,fileSystem, driver ); - } - - if ( mipmap & 2 ) - driver->setTextureCreationFlag(video::ETCF_CREATE_MIP_MAPS, mipmap & 1); -} - -/* - Register each texture stage, if first is visible -*/ -void CQuake3ShaderSceneNode::OnRegisterSceneNode() -{ - if ( isVisible() ) - { - SceneManager->registerNodeForRendering(this, getRenderStage() ); - } - ISceneNode::OnRegisterSceneNode(); -} - -/* - is this a transparent node ? -*/ -E_SCENE_NODE_RENDER_PASS CQuake3ShaderSceneNode::getRenderStage() const -{ - E_SCENE_NODE_RENDER_PASS ret = ESNRP_SOLID; - - // generic stage - const SVarGroup *group; - - group = Shader->getGroup( 1 ); -/* - else - if ( group->getIndex( "portal" ) >= 0 ) - { - ret = ESNRP_TRANSPARENT_EFFECT; - } - else -*/ - if ( group->isDefined( "sort", "opaque" ) ) - { - ret = ESNRP_SOLID; - } - else - if ( group->isDefined( "sort", "additive" ) ) - { - ret = ESNRP_TRANSPARENT; - } - else - if ( strstr ( Shader->name.c_str(), "flame" ) || - group->isDefined( "surfaceparm", "water" ) || - group->isDefined( "sort", "underwater" ) - ) - { - ret = ESNRP_TRANSPARENT_EFFECT; - } - else - { - // Look if first drawing stage needs graphical underlay - for ( u32 stage = 2; stage < Shader->VarGroup->VariableGroup.size(); ++stage ) - { - if ( 0 == Q3Texture [ stage ].Texture.size() ) - continue; - - group = Shader->getGroup( stage ); - - SBlendFunc blendfunc ( video::EMFN_MODULATE_1X ); - getBlendFunc( group->get( "blendfunc" ), blendfunc ); - getBlendFunc( group->get( "alphafunc" ), blendfunc ); - - //ret = blendfunc.isTransparent ? ESNRP_TRANSPARENT : ESNRP_SOLID; - if ( blendfunc.isTransparent ) - { - ret = ESNRP_TRANSPARENT; - } - break; - } - } - - return ret; -} - - -/* - render in multipass technique -*/ -void CQuake3ShaderSceneNode::render() -{ - video::IVideoDriver* driver = SceneManager->getVideoDriver(); - E_SCENE_NODE_RENDER_PASS pass = SceneManager->getSceneNodeRenderPass(); - - video::SMaterial material; - const SVarGroup *group; - - material.Lighting = false; - material.setTexture(1, 0); - material.NormalizeNormals = false; - - // generic stage - group = Shader->getGroup( 1 ); - material.BackfaceCulling = getCullingFunction( group->get( "cull" ) ); - - u32 pushProjection = 0; - core::matrix4 projection ( core::matrix4::EM4CONST_NOTHING ); - - // decal ( solve z-fighting ) - if ( group->isDefined( "polygonoffset" ) ) - { - projection = driver->getTransform( video::ETS_PROJECTION ); - - core::matrix4 decalProjection ( projection ); - -/* - f32 n = SceneManager->getActiveCamera()->getNearValue(); - f32 f = SceneManager->getActiveCamera()->getFarValue (); - - f32 delta = 0.01f; - f32 pz = 0.2f; - f32 epsilon = -2.f * f * n * delta / ( ( f + n ) * pz * ( pz + delta ) ); - decalProjection[10] *= 1.f + epsilon; -*/ - // TODO: involve camera - decalProjection[10] -= 0.0002f; - driver->setTransform( video::ETS_PROJECTION, decalProjection ); - pushProjection |= 1; - } - - driver->setTransform(video::ETS_WORLD, AbsoluteTransformation ); - if (Shadow) - Shadow->updateShadowVolumes(); - - //! render all stages - u32 drawCount = (pass == ESNRP_TRANSPARENT_EFFECT) ? 1 : 0; - core::matrix4 textureMatrix ( core::matrix4::EM4CONST_NOTHING ); - for ( u32 stage = 1; stage < Shader->VarGroup->VariableGroup.size(); ++stage ) - { - SQ3Texture &q = Q3Texture[stage]; - - // advance current stage - textureMatrix.makeIdentity(); - animate( stage, textureMatrix ); - - // stage finished, no drawing stage ( vertex transform only ) - video::ITexture * tex = q.Texture.size() ? q.Texture [ q.TextureIndex ] : 0; - if ( 0 == tex ) - continue; - - // current stage - group = Shader->getGroup( stage ); - - material.setTexture(0, tex ); - material.ZBuffer = getDepthFunction( group->get( "depthfunc" ) ); - - // TODO: maybe should be video::EZW_ON instead of EZW_AUTO now (we didn't have that before and I just kept old values here when introducing it to not break anything) - if ( group->isDefined( "depthwrite" ) ) - { - material.ZWriteEnable = video::EZW_AUTO; - } - else - { - material.ZWriteEnable = drawCount == 0 ? video::EZW_AUTO : video::EZW_OFF; - } - - //resolve quake3 blendfunction to irrlicht Material Type - SBlendFunc blendfunc ( video::EMFN_MODULATE_1X ); - getBlendFunc( group->get( "blendfunc" ), blendfunc ); - getBlendFunc( group->get( "alphafunc" ), blendfunc ); - - material.MaterialType = blendfunc.type; - material.MaterialTypeParam = blendfunc.param0; - - material.TextureLayer[0].TextureWrapU = q.TextureAddressMode; - material.TextureLayer[0].TextureWrapV = q.TextureAddressMode; - material.TextureLayer[0].TextureWrapW = q.TextureAddressMode; - //material.TextureLayer[0].TrilinearFilter = 1; - //material.TextureLayer[0].AnisotropicFilter = 0xFF; - material.setTextureMatrix( 0, textureMatrix ); - - driver->setMaterial( material ); - driver->drawMeshBuffer( MeshBuffer ); - drawCount += 1; - - } - - if ( DebugDataVisible & scene::EDS_MESH_WIRE_OVERLAY ) - { - video::SMaterial deb_m; - deb_m.Wireframe = true; - deb_m.Lighting = false; - deb_m.BackfaceCulling = material.BackfaceCulling; - driver->setMaterial( deb_m ); - - driver->drawMeshBuffer( MeshBuffer ); - } - - // show normals - if ( DebugDataVisible & scene::EDS_NORMALS ) - { - video::SMaterial deb_m; - - IAnimatedMesh * arrow = SceneManager->addArrowMesh ( - "__debugnormalq3", - 0xFFECEC00,0xFF999900, - 4, 8, - 8.f, 6.f, - 0.5f,1.f - ); - if ( 0 == arrow ) - { - arrow = SceneManager->getMesh ( "__debugnormalq3" ); - } - const IMesh *mesh = arrow->getMesh ( 0 ); - - // find a good scaling factor - - core::matrix4 m2; - - // draw normals - const scene::IMeshBuffer* mb = MeshBuffer; - const u32 vSize = video::getVertexPitchFromType(mb->getVertexType()); - const video::S3DVertex* v = ( const video::S3DVertex*)mb->getVertices(); - - //f32 colCycle = 270.f / (f32) core::s32_max ( mb->getVertexCount() - 1, 1 ); - - for ( u32 i=0; i != mb->getVertexCount(); ++i ) - { - // Align to v->normal - m2.buildRotateFromTo ( core::vector3df ( 0.f, 1.f, 0 ), v->Normal ); - m2.setTranslation ( v->Pos + AbsoluteTransformation.getTranslation () ); -/* - core::quaternion quatRot( v->Normal.Z, 0.f, -v->Normal.X, 1 + v->Normal.Y ); - quatRot.normalize(); - quatRot.getMatrix ( m2, v->Pos ); - - m2 [ 12 ] += AbsoluteTransformation [ 12 ]; - m2 [ 13 ] += AbsoluteTransformation [ 13 ]; - m2 [ 14 ] += AbsoluteTransformation [ 14 ]; -*/ - driver->setTransform(video::ETS_WORLD, m2 ); - - deb_m.Lighting = true; -/* - irr::video::SColorHSL color; - irr::video::SColor rgb(0); - color.Hue = i * colCycle * core::DEGTORAD; - color.Saturation = 1.f; - color.Luminance = 0.5f; - color.toRGB( deb_m.EmissiveColor ); -*/ - switch ( i ) - { - case 0: deb_m.EmissiveColor.set(0xFFFFFFFF); break; - case 1: deb_m.EmissiveColor.set(0xFFFF0000); break; - case 2: deb_m.EmissiveColor.set(0xFF00FF00); break; - case 3: deb_m.EmissiveColor.set(0xFF0000FF); break; - default: - deb_m.EmissiveColor = v->Color; break; - } - driver->setMaterial( deb_m ); - - for ( u32 a = 0; a != mesh->getMeshBufferCount(); ++a ) - driver->drawMeshBuffer ( mesh->getMeshBuffer ( a ) ); - - v = (const video::S3DVertex*) ( (u8*) v + vSize ); - } - driver->setTransform(video::ETS_WORLD, AbsoluteTransformation); - } - - - if ( pushProjection & 1 ) - { - driver->setTransform( video::ETS_PROJECTION, projection ); - } - - if ( DebugDataVisible & scene::EDS_BBOX ) - { - video::SMaterial deb_m; - deb_m.Lighting = false; - driver->setMaterial(deb_m); - driver->setTransform(video::ETS_WORLD, AbsoluteTransformation); - driver->draw3DBox( getBoundingBox(), video::SColor(255,255,0,0)); - } - -} - - -//! Removes a child from this scene node. -//! Implemented here, to be able to remove the shadow properly, if there is one, -//! or to remove attached childs. -bool CQuake3ShaderSceneNode::removeChild(ISceneNode* child) -{ - if (child && Shadow == child) - { - Shadow->drop(); - Shadow = 0; - } - - return ISceneNode::removeChild(child); -} - - -//! Creates shadow volume scene node as child of this node -//! and returns a pointer to it. -IShadowVolumeSceneNode* CQuake3ShaderSceneNode::addShadowVolumeSceneNode( - const IMesh* shadowMesh, s32 id, bool zfailmethod, f32 infinity) -{ -#ifdef _IRR_COMPILE_WITH_SHADOW_VOLUME_SCENENODE_ - if (!SceneManager->getVideoDriver()->queryFeature(video::EVDF_STENCIL_BUFFER)) - return 0; - - if (!shadowMesh) - shadowMesh = Mesh; // if null is given, use the mesh of node - - if (Shadow) - Shadow->drop(); - - Shadow = new CShadowVolumeSceneNode(shadowMesh, this, SceneManager, id, zfailmethod, infinity); - return Shadow; -#else - return 0; -#endif -} - - -/*! -3.3.1 deformVertexes wave <div> <func> <base> <amplitude> <phase> <freq> - Designed for water surfaces, modifying the values differently at each point. - It accepts the standard wave functions of the type sin, triangle, square, sawtooth - or inversesawtooth. The "div" parameter is used to control the wave "spread" - - a value equal to the tessSize of the surface is a good default value - (tessSize is subdivision size, in game units, used for the shader when seen in the game world) . -*/ -void CQuake3ShaderSceneNode::deformvertexes_wave( f32 dt, SModifierFunction &function ) -{ - function.wave = core::reciprocal( function.wave ); - - const f32 phase = function.phase; - - const u32 vsize = Original->Vertices.size(); - for ( u32 i = 0; i != vsize; ++i ) - { - const video::S3DVertex2TCoords &src = Original->Vertices[i]; - video::S3DVertex &dst = MeshBuffer->Vertices[i]; - - if ( 0 == function.count ) - dst.Pos = src.Pos - MeshOffset; - - const f32 wavephase = (dst.Pos.X + dst.Pos.Y + dst.Pos.Z) * function.wave; - function.phase = phase + wavephase; - - const f32 f = function.evaluate( dt ); - - dst.Pos.X += f * src.Normal.X; - dst.Pos.Y += f * src.Normal.Y; - dst.Pos.Z += f * src.Normal.Z; - - if ( i == 0 ) - MeshBuffer->BoundingBox.reset ( dst.Pos ); - else - MeshBuffer->BoundingBox.addInternalPoint ( dst.Pos ); - } - function.count = 1; -} - -/*! - deformVertexes move x y z func base amplitude phase freq - The move parameter is used to make a brush, curve patch or model - appear to move together as a unit. The x y z values are the distance - and direction in game units the object appears to move relative to - it's point of origin in the map. The func base amplitude phase freq values are - the same as found in other waveform manipulations. - - The product of the function modifies the values x, y, and z. - Therefore, if you have an amplitude of 5 and an x value of 2, - the object will travel 10 units from its point of origin along the x axis. - This results in a total of 20 units of motion along the x axis, since the - amplitude is the variation both above and below the base. - - It must be noted that an object made with this shader does not actually - change position, it only appears to. - - Design Notes: - If an object is made up of surfaces with different shaders, all must have - matching deformVertexes move values or the object will appear to tear itself apart. -*/ -void CQuake3ShaderSceneNode::deformvertexes_move( f32 dt, SModifierFunction &function ) -{ - function.wave = core::reciprocal( function.wave ); - const f32 f = function.evaluate( dt ); - - const u32 vsize = Original->Vertices.size(); - for ( u32 i = 0; i != vsize; ++i ) - { - const video::S3DVertex2TCoords &src = Original->Vertices[i]; - video::S3DVertex &dst = MeshBuffer->Vertices[i]; - - if ( 0 == function.count ) - dst.Pos = src.Pos - MeshOffset; - - dst.Pos.X += f * function.x; - dst.Pos.Y += f * function.y; - dst.Pos.Z += f * function.z; - - if ( i == 0 ) - MeshBuffer->BoundingBox.reset ( dst.Pos ); - else - MeshBuffer->BoundingBox.addInternalPoint ( dst.Pos ); - } - function.count = 1; - -} - -/*! - 3.3.2 deformVertexes normal <div> <func> <base> <amplitude ~0.1-~0.5> <frequency ~1.0-~4.0> - This deformation affects the normals of a vertex without actually moving it, - which will effect later shader options like lighting and especially environment mapping. - If the shader stages don't use normals in any of their calculations, there will - be no visible effect. - - Design Notes: Putting values of 0.1 t o 0.5 in Amplitude and 1.0 to 4.0 in the - Frequency can produce some satisfying results. Some things that have been - done with it: A small fluttering bat, falling leaves, rain, flags. -*/ -void CQuake3ShaderSceneNode::deformvertexes_normal( f32 dt, SModifierFunction &function ) -{ - function.func = SINUS; - const u32 vsize = Original->Vertices.size(); - for ( u32 i = 0; i != vsize; ++i ) - { - const video::S3DVertex2TCoords &src = Original->Vertices[i]; - video::S3DVertex &dst = MeshBuffer->Vertices[i]; - - function.base = atan2f ( src.Pos.X, src.Pos.Y ); - function.phase = src.Pos.X + src.Pos.Z; - - const f32 lat = function.evaluate( dt ); - - function.base = src.Normal.Y; - function.phase = src.Normal.Z + src.Normal.X; - - const f32 lng = function.evaluate( dt ); - - dst.Normal.X = cosf ( lat ) * sinf ( lng ); - dst.Normal.Y = sinf ( lat ) * sinf ( lng ); - dst.Normal.Z = cosf ( lng ); - - } -} - - -/*! - 3.3.3 deformVertexes bulge <bulgeWidth> <bulgeHeight> <bulgeSpeed> - This forces a bulge to move along the given s and t directions. Designed for use - on curved pipes. - - Specific parameter definitions for deform keywords: - <div> This is roughly defined as the size of the waves that occur. - It is measured in game units. Smaller values create a greater - density of smaller wave forms occurring in a given area. - Larger values create a lesser density of waves, or otherwise put, - the appearance of larger waves. To look correct this value should - closely correspond to the value (in pixels) set for tessSize (tessellation size) - of the texture. A value of 100.0 is a good default value - (which means your tessSize should be close to that for things to look "wavelike"). - - <func> This is the type of wave form being created. Sin stands for sine wave, - a regular smoothly flowing wave. Triangle is a wave with a sharp ascent - and a sharp decay. It will make a choppy looking wave forms. - A square wave is simply on or off for the period of the - frequency with no in between. The sawtooth wave has the ascent of a - triangle wave, but has the decay cut off sharply like a square wave. - An inversesawtooth wave reverses this. - - <base> This is the distance, in game units that the apparent surface of the - texture is displaced from the actual surface of the brush as placed - in the editor. A positive value appears above the brush surface. - A negative value appears below the brush surface. - An example of this is the Quad effect, which essentially is a - shell with a positive base value to stand it away from the model - surface and a 0 (zero) value for amplitude. - - <amplitude> The distance that the deformation moves away from the base value. - See Wave Forms in the introduction for a description of amplitude. - - <phase> See Wave Forms in the introduction for a description of phase) - - <frequency> See Wave Forms in the introduction for a description of frequency) - - Design Note: The div and amplitude parameters, when used in conjunction with - liquid volumes like water should take into consideration how much the water - will be moving. A large ocean area would have have massive swells (big div values) - that rose and fell dramatically (big amplitude values). While a small, quiet pool - may move very little. -*/ -void CQuake3ShaderSceneNode::deformvertexes_bulge( f32 dt, SModifierFunction &function ) -{ - function.func = SINUS; - function.wave = core::reciprocal( function.bulgewidth ); - - dt *= function.bulgespeed * 0.1f; - const f32 phase = function.phase; - - const u32 vsize = Original->Vertices.size(); - for ( u32 i = 0; i != vsize; ++i ) - { - const video::S3DVertex2TCoords &src = Original->Vertices[i]; - video::S3DVertex &dst = MeshBuffer->Vertices[i]; - - const f32 wavephase = (Original->Vertices[i].TCoords.X ) * function.wave; - function.phase = phase + wavephase; - - const f32 f = function.evaluate( dt ); - - if ( 0 == function.count ) - dst.Pos = src.Pos - MeshOffset; - - dst.Pos.X += f * src.Normal.X; - dst.Pos.Y += f * src.Normal.Y; - dst.Pos.Z += f * src.Normal.Z; - - if ( i == 0 ) - MeshBuffer->BoundingBox.reset ( dst.Pos ); - else - MeshBuffer->BoundingBox.addInternalPoint ( dst.Pos ); - } - - function.count = 1; -} - - -/*! - deformVertexes autosprite - - This function can be used to make any given triangle quad - (pair of triangles that form a square rectangle) automatically behave - like a sprite without having to make it a separate entity. This means - that the "sprite" on which the texture is placed will rotate to always - appear at right angles to the player's view as a sprite would. Any four-sided - brush side, flat patch, or pair of triangles in a model can have the autosprite - effect on it. The brush face containing a texture with this shader keyword must - be square. -*/ -void CQuake3ShaderSceneNode::deformvertexes_autosprite( f32 dt, SModifierFunction &function ) -{ - u32 vsize = Original->Vertices.size(); - u32 g; - u32 i; - - const core::vector3df& camPos = SceneManager->getActiveCamera()->getPosition(); - - video::S3DVertex * dv = MeshBuffer->Vertices.pointer(); - const video::S3DVertex2TCoords * vin = Original->Vertices.const_pointer(); - - core::matrix4 lookat ( core::matrix4::EM4CONST_NOTHING ); - core::quaternion q; - for ( i = 0; i < vsize; i += 4 ) - { - // quad-plane - core::vector3df center = 0.25f * ( vin[i+0].Pos + vin[i+1].Pos + vin[i+2].Pos + vin[i+3].Pos ); - core::vector3df forward = camPos - center; - - q.rotationFromTo ( vin[i].Normal, forward ); - q.getMatrixCenter ( lookat, center, MeshOffset ); - - for ( g = 0; g < 4; ++g ) - { - lookat.transformVect ( dv[i+g].Pos, vin[i+g].Pos ); - lookat.rotateVect ( dv[i+g].Normal, vin[i+g].Normal ); - } - - } - function.count = 1; -} - - -/*! - deformVertexes autosprite2 - Is a slightly modified "sprite" that only rotates around the middle of its longest axis. - This allows you to make a pillar of fire that you can walk around, or an energy beam - stretched across the room. -*/ - -struct sortaxis -{ - core::vector3df v; - bool operator < ( const sortaxis &other ) const - { - return v.getLengthSQ () < other.v.getLengthSQ (); - } -}; -/*! -*/ -void CQuake3ShaderSceneNode::deformvertexes_autosprite2( f32 dt, SModifierFunction &function ) -{ - u32 vsize = Original->Vertices.size(); - u32 g; - u32 i; - - const core::vector3df camPos = SceneManager->getActiveCamera()->getAbsolutePosition(); - - video::S3DVertex * dv = MeshBuffer->Vertices.pointer(); - const video::S3DVertex2TCoords * vin = Original->Vertices.const_pointer(); - - core::matrix4 lookat ( core::matrix4::EM4CONST_NOTHING ); - - core::array < sortaxis > axis; - axis.set_used ( 3 ); - - for ( i = 0; i < vsize; i += 4 ) - { - // quad-plane - core::vector3df center = 0.25f * ( vin[i+0].Pos + vin[i+1].Pos + vin[i+2].Pos + vin[i+3].Pos ); - - // longes axe - axis[0].v = vin[i+1].Pos - vin[i+0].Pos; - axis[1].v = vin[i+2].Pos - vin[i+0].Pos; - axis[2].v = vin[i+3].Pos - vin[i+0].Pos; - axis.set_sorted ( false ); - axis.sort (); - - lookat.buildAxisAlignedBillboard ( camPos, center, MeshOffset, axis[1].v, vin[i+0].Normal ); - - for ( g = 0; g < 4; ++g ) - { - lookat.transformVect ( dv[i+g].Pos, vin[i+g].Pos ); - lookat.rotateVect ( dv[i+g].Normal, vin[i+g].Normal ); - } - } - function.count = 1; -} - -/* - Generate Vertex Color -*/ -void CQuake3ShaderSceneNode::vertextransform_rgbgen( f32 dt, SModifierFunction &function ) -{ - u32 i; - const u32 vsize = Original->Vertices.size(); - - switch ( function.rgbgen ) - { - case IDENTITY: - //rgbgen identity - for ( i = 0; i != vsize; ++i ) - MeshBuffer->Vertices[i].Color.set(0xFFFFFFFF); - break; - - case IDENTITYLIGHTING: - // rgbgen identitylighting TODO: overbright - for ( i = 0; i != vsize; ++i ) - MeshBuffer->Vertices[i].Color.set(0xFF7F7F7F); - break; - - case EXACTVERTEX: - // alphagen exactvertex TODO lighting - case VERTEX: - // rgbgen vertex - for ( i = 0; i != vsize; ++i ) - MeshBuffer->Vertices[i].Color=Original->Vertices[i].Color; - break; - case WAVE: - { - // rgbGen wave <func> <base> <amp> <phase> <freq> - f32 f = function.evaluate( dt ) * 255.f; - s32 value = core::clamp( core::floor32(f), 0, 255 ); - value = 0xFF000000 | value << 16 | value << 8 | value; - - for ( i = 0; i != vsize; ++i ) - MeshBuffer->Vertices[i].Color.set(value); - } break; - case CONSTANT: - { - //rgbgen const ( x y z ) - video::SColorf cf( function.x, function.y, function.z ); - video::SColor col = cf.toSColor(); - for ( i = 0; i != vsize; ++i ) - MeshBuffer->Vertices[i].Color=col; - } break; - default: - break; - } -} - -/* - Generate Vertex Color, Alpha -*/ -void CQuake3ShaderSceneNode::vertextransform_alphagen( f32 dt, SModifierFunction &function ) -{ - u32 i; - const u32 vsize = Original->Vertices.size(); - - switch ( function.alphagen ) - { - case IDENTITY: - //alphagen identity - for ( i = 0; i != vsize; ++i ) - MeshBuffer->Vertices[i].Color.setAlpha ( 0xFF ); - break; - - case EXACTVERTEX: - // alphagen exactvertex TODO lighting - case VERTEX: - // alphagen vertex - for ( i = 0; i != vsize; ++i ) - MeshBuffer->Vertices[i].Color.setAlpha ( Original->Vertices[i].Color.getAlpha() ); - break; - case CONSTANT: - { - // alphagen const - u32 a = (u32) ( function.x * 255.f ); - for ( i = 0; i != vsize; ++i ) - MeshBuffer->Vertices[i].Color.setAlpha ( a ); - } break; - - case LIGHTINGSPECULAR: - { - // alphagen lightingspecular TODO!!! - const SViewFrustum *frustum = SceneManager->getActiveCamera()->getViewFrustum(); - const core::matrix4 &view = frustum->getTransform ( video::ETS_VIEW ); - - const f32 *m = view.pointer(); - - for ( i = 0; i != vsize; ++i ) - { - const core::vector3df &n = Original->Vertices[i].Normal; - MeshBuffer->Vertices[i].Color.setAlpha ((u32)( 128.f *(1.f+(n.X*m[0]+n.Y*m[1]+n.Z*m[2])))); - } - - } break; - - - case WAVE: - { - // alphagen wave - f32 f = function.evaluate( dt ) * 255.f; - s32 value = core::clamp( core::floor32(f), 0, 255 ); - - for ( i = 0; i != vsize; ++i ) - MeshBuffer->Vertices[i].Color.setAlpha ( value ); - } break; - default: - break; - } -} - - - -/* - Generate Texture Coordinates -*/ -void CQuake3ShaderSceneNode::vertextransform_tcgen( f32 dt, SModifierFunction &function ) -{ - u32 i; - const u32 vsize = Original->Vertices.size(); - - switch ( function.tcgen ) - { - case TURBULENCE: - //tcgen turb - { - function.wave = core::reciprocal( function.phase ); - - const f32 phase = function.phase; - - for ( i = 0; i != vsize; ++i ) - { - const video::S3DVertex2TCoords &src = Original->Vertices[i]; - video::S3DVertex &dst = MeshBuffer->Vertices[i]; - - const f32 wavephase = (src.Pos.X + src.Pos.Y + src.Pos.Z) * function.wave; - function.phase = phase + wavephase; - - const f32 f = function.evaluate( dt ); - - dst.TCoords.X = src.TCoords.X + f * src.Normal.X; - dst.TCoords.Y = src.TCoords.Y + f * src.Normal.Y; - } - } - break; - - case TEXTURE: - // tcgen texture - for ( i = 0; i != vsize; ++i ) - MeshBuffer->Vertices[i].TCoords = Original->Vertices[i].TCoords; - break; - case LIGHTMAP: - // tcgen lightmap - for ( i = 0; i != vsize; ++i ) - MeshBuffer->Vertices[i].TCoords = Original->Vertices[i].TCoords2; - break; - case ENVIRONMENT: - { - // tcgen environment - const SViewFrustum *frustum = SceneManager->getActiveCamera()->getViewFrustum(); - const core::matrix4 &view = frustum->getTransform ( video::ETS_VIEW ); - - const f32 *m = view.pointer(); - - core::vector3df n; - for ( i = 0; i != vsize; ++i ) - { - //const core::vector3df &n = Original->Vertices[i].Normal; - - n = frustum->cameraPosition - Original->Vertices[i].Pos; - n.normalize(); - n += Original->Vertices[i].Normal; - n.normalize(); - - MeshBuffer->Vertices[i].TCoords.X = 0.5f*(1.f+(n.X*m[0]+n.Y*m[1]+n.Z*m[2])); - MeshBuffer->Vertices[i].TCoords.Y = 0.5f*(1.f+(n.X*m[4]+n.Y*m[5]+n.Z*m[6])); - } - - } break; - default: - break; - } -} - - -#if 0 -/* - Transform Texture Coordinates -*/ -void CQuake3ShaderSceneNode::transformtex( const core::matrix4 &m, const u32 addressMode ) -{ - u32 i; - const u32 vsize = MeshBuffer->Vertices.size(); - - f32 tx1; - f32 ty1; - - if ( addressMode ) - { - for ( i = 0; i != vsize; ++i ) - { - core::vector2df &tx = MeshBuffer->Vertices[i].TCoords; - - tx1 = m[0] * tx.X + m[4] * tx.Y + m[8]; - ty1 = m[1] * tx.X + m[5] * tx.Y + m[9]; - - tx.X = tx1; - tx.Y = ty1; - } - } - else - { - - for ( i = 0; i != vsize; ++i ) - { - core::vector2df &tx = MeshBuffer->Vertices[i].TCoords; - - tx1 = m[0] * tx.X + m[4] * tx.Y + m[8]; - ty1 = m[1] * tx.X + m[5] * tx.Y + m[9]; - - tx.X = tx1 <= 0.f ? 0.f : tx1 >= 1.f ? 1.f : tx1; - tx.Y = ty1 <= 0.f ? 0.f : ty1 >= 1.f ? 1.f : ty1; - - //tx.X = core::clamp( tx1, 0.f, 1.f ); - //tx.Y = core::clamp( ty1, 0.f, 1.f ); - } - } -} - -#endif - - -/* - Texture & Vertex Transform Animator - - Return a Texture Transformation for this stage - Vertex transformation are called if found - -*/ -void CQuake3ShaderSceneNode::animate( u32 stage,core::matrix4 &texture ) -{ - const SVarGroup *group = Shader->getGroup( stage ); - - // select current texture - SQ3Texture &q3Tex = Q3Texture [ stage ]; - if ( q3Tex.TextureFrequency != 0.f ) - { - s32 v = core::floor32( TimeAbs * q3Tex.TextureFrequency ); - q3Tex.TextureIndex = v % q3Tex.Texture.size(); - } - - core::matrix4 m2; - SModifierFunction function; - - f32 f[16]; - - // walk group for all modifiers - for ( u32 g = 0; g != group->Variable.size(); ++g ) - { - const SVariable &v = group->Variable[g]; - - // get the modifier - static const c8 * const modifierList[] = - { - "tcmod","deformvertexes","rgbgen","tcgen","map","alphagen" - }; - - u32 pos = 0; - function.masterfunc0 = (eQ3ModifierFunction) isEqual( v.name, pos, modifierList, 6 ); - - if ( UNKNOWN == function.masterfunc0 ) - continue; - - switch ( function.masterfunc0 ) - { - //tcmod - case TCMOD: - m2.makeIdentity(); - break; - default: - break; - } - - // get the modifier function - static const c8 * const funclist[] = - { - "scroll","scale","rotate","stretch","turb", - "wave","identity","vertex", - "texture","lightmap","environment","$lightmap", - "bulge","autosprite","autosprite2","transform", - "exactvertex","const","lightingspecular","move","normal", - "identitylighting" - }; - static const c8 * const groupToken[] = { "(", ")" }; - - pos = 0; - function.masterfunc1 = (eQ3ModifierFunction) isEqual( v.content, pos, funclist, 22 ); - if ( function.masterfunc1 != UNKNOWN ) - function.masterfunc1 = (eQ3ModifierFunction) ((u32) function.masterfunc1 + FUNCTION2 + 1); - - switch ( function.masterfunc1 ) - { - case SCROLL: - // tcMod scroll <sSpeed> <tSpeed> - f[0] = getAsFloat( v.content, pos ) * TimeAbs; - f[1] = getAsFloat( v.content, pos ) * TimeAbs; - m2.setTextureTranslate( f[0], f[1] ); - break; - case SCALE: - // tcmod scale <sScale> <tScale> - f[0] = getAsFloat( v.content, pos ); - f[1] = getAsFloat( v.content, pos ); - m2.setTextureScale( f[0], f[1] ); - break; - case ROTATE: - // tcmod rotate <degrees per second> - m2.setTextureRotationCenter( getAsFloat( v.content, pos ) * - core::DEGTORAD * - TimeAbs - ); - break; - case TRANSFORM: - // tcMod <transform> <m00> <m01> <m10> <m11> <t0> <t1> - memset(f, 0, sizeof ( f )); - f[10] = f[15] = 1.f; - - f[0] = getAsFloat( v.content, pos ); - f[1] = getAsFloat( v.content, pos ); - f[4] = getAsFloat( v.content, pos ); - f[5] = getAsFloat( v.content, pos ); - f[8] = getAsFloat( v.content, pos ); - f[9] = getAsFloat( v.content, pos ); - m2.setM ( f ); - break; - - case STRETCH: // stretch - case TURBULENCE: // turb - case WAVE: // wave - case IDENTITY: // identity - case IDENTITYLIGHTING: - case VERTEX: // vertex - case MOVE: - case CONSTANT: - { - // turb == sin, default == sin - function.func = SINUS; - - if ( function.masterfunc0 == DEFORMVERTEXES ) - { - switch ( function.masterfunc1 ) - { - case WAVE: - // deformvertexes wave - function.wave = getAsFloat( v.content, pos ); - break; - case MOVE: - //deformvertexes move - function.x = getAsFloat( v.content, pos ); - function.z = getAsFloat( v.content, pos ); - function.y = getAsFloat( v.content, pos ); - break; - default: - break; - } - } - - switch ( function.masterfunc1 ) - { - case STRETCH: - case TURBULENCE: - case WAVE: - case MOVE: - getModifierFunc( function, v.content, pos ); - break; - default: - break; - } - - switch ( function.masterfunc1 ) - { - case STRETCH: - //tcMod stretch <func> <base> <amplitude> <phase> <frequency> - f[0] = core::reciprocal( function.evaluate(TimeAbs) ); - m2.setTextureScaleCenter( f[0], f[0] ); - break; - case TURBULENCE: - //tcMod turb <base> <amplitude> <phase> <freq> - //function.tcgen = TURBULENCE; - m2.setTextureRotationCenter( function.frequency * - core::DEGTORAD * - TimeAbs - ); - break; - case WAVE: - case IDENTITY: - case IDENTITYLIGHTING: - case VERTEX: - case EXACTVERTEX: - case CONSTANT: - case LIGHTINGSPECULAR: - case MOVE: - switch ( function.masterfunc0 ) - { - case DEFORMVERTEXES: - switch ( function.masterfunc1 ) - { - case WAVE: - deformvertexes_wave( TimeAbs, function ); - break; - case MOVE: - deformvertexes_move( TimeAbs, function ); - break; - default: - break; - } - break; - case RGBGEN: - function.rgbgen = function.masterfunc1; - if ( function.rgbgen == CONSTANT ) - { - isEqual ( v.content, pos, groupToken, 2 ); - function.x = getAsFloat( v.content, pos ); - function.y = getAsFloat( v.content, pos ); - function.z = getAsFloat( v.content, pos ); - } - //vertextransform_rgbgen( TimeAbs, function ); - break; - case ALPHAGEN: - function.alphagen = function.masterfunc1; - if ( function.alphagen == CONSTANT ) - { - function.x = getAsFloat( v.content, pos ); - } - - //vertextransform_alphagen( TimeAbs, function ); - break; - default: - break; - } - break; - default: - break; - } - - } break; - case TEXTURE: - case LIGHTMAP: - case ENVIRONMENT: - // "texture","lightmap","environment" - function.tcgen = function.masterfunc1; - break; - case DOLLAR_LIGHTMAP: - // map == lightmap, tcgen == lightmap - function.tcgen = LIGHTMAP; - break; - case BULGE: - // deformvertexes bulge - function.bulgewidth = getAsFloat( v.content, pos ); - function.bulgeheight = getAsFloat( v.content, pos ); - function.bulgespeed = getAsFloat( v.content, pos ); - - deformvertexes_bulge(TimeAbs, function); - break; - - case NORMAL: - // deformvertexes normal - function.amp = getAsFloat( v.content, pos ); - function.frequency = getAsFloat( v.content, pos ); - - deformvertexes_normal(TimeAbs, function); - break; - - case AUTOSPRITE: - // deformvertexes autosprite - deformvertexes_autosprite(TimeAbs, function); - break; - - case AUTOSPRITE2: - // deformvertexes autosprite2 - deformvertexes_autosprite2(TimeAbs, function); - break; - default: - break; - } // func - - switch ( function.masterfunc0 ) - { - case TCMOD: - texture *= m2; - break; - default: - break; - } - - } // group - - vertextransform_rgbgen( TimeAbs, function ); - vertextransform_alphagen( TimeAbs, function ); - vertextransform_tcgen( TimeAbs, function ); -} - - -void CQuake3ShaderSceneNode::OnAnimate(u32 timeMs) -{ - TimeAbs = f32( timeMs ) * (1.f/1000.f); - ISceneNode::OnAnimate( timeMs ); -} - -const core::aabbox3d<f32>& CQuake3ShaderSceneNode::getBoundingBox() const -{ - return MeshBuffer->getBoundingBox(); -} - - -u32 CQuake3ShaderSceneNode::getMaterialCount() const -{ - return Q3Texture.size(); -} - -video::SMaterial& CQuake3ShaderSceneNode::getMaterial(u32 i) -{ - video::SMaterial& m = MeshBuffer->Material; - m.setTexture(0, 0); - if ( Q3Texture [ i ].TextureIndex ) - m.setTexture(0, Q3Texture [ i ].Texture [ Q3Texture [ i ].TextureIndex ]); - return m; -} - - -} // end namespace scene -} // end namespace irr - -#endif - diff --git a/source/Irrlicht/CQuake3ShaderSceneNode.h b/source/Irrlicht/CQuake3ShaderSceneNode.h deleted file mode 100644 index 874bae83..00000000 --- a/source/Irrlicht/CQuake3ShaderSceneNode.h +++ /dev/null @@ -1,118 +0,0 @@ -// Copyright (C) 2002-2012 Nikolaus Gebhardt / Thomas Alten -// This file is part of the "Irrlicht Engine". -// For conditions of distribution and use, see copyright notice in irrlicht.h - -#ifndef __C_QUAKE3_SCENE_NODE_H_INCLUDED__ -#define __C_QUAKE3_SCENE_NODE_H_INCLUDED__ - -#include "IMeshSceneNode.h" -#include "IQ3Shader.h" -#include "IFileSystem.h" -#include "SMeshBuffer.h" -#include "SMeshBufferLightMap.h" -#include "SMesh.h" -#include "ISceneManager.h" - -namespace irr -{ -namespace scene -{ - -//! Scene node which is a quake3 shader. -class CQuake3ShaderSceneNode : public scene::IMeshSceneNode -{ -public: - - CQuake3ShaderSceneNode( ISceneNode* parent, ISceneManager* mgr, s32 id, - io::IFileSystem* fileSystem, - const IMeshBuffer* original, - const quake3::IShader* shader - ); - - virtual ~CQuake3ShaderSceneNode(); - - virtual void OnRegisterSceneNode() _IRR_OVERRIDE_; - virtual void render() _IRR_OVERRIDE_; - virtual void OnAnimate(u32 timeMs) _IRR_OVERRIDE_; - virtual const core::aabbox3d<f32>& getBoundingBox() const _IRR_OVERRIDE_; - - virtual u32 getMaterialCount() const _IRR_OVERRIDE_; - virtual video::SMaterial& getMaterial(u32 i) _IRR_OVERRIDE_; - - //! Returns type of the scene node - virtual ESCENE_NODE_TYPE getType() const _IRR_OVERRIDE_ { return ESNT_Q3SHADER_SCENE_NODE; } - - virtual void setMesh(IMesh* mesh)_IRR_OVERRIDE_ {} - virtual IMesh* getMesh() _IRR_OVERRIDE_ { return Mesh; } - virtual void setReadOnlyMaterials(bool readonly) _IRR_OVERRIDE_ {} - virtual bool isReadOnlyMaterials() const _IRR_OVERRIDE_ { return true; } - - //! Creates shadow volume scene node as child of this node - //! and returns a pointer to it. - virtual IShadowVolumeSceneNode* addShadowVolumeSceneNode(const IMesh* shadowMesh, - s32 id, bool zfailmethod=true, f32 infinity=10000.0f) _IRR_OVERRIDE_; - - //! Removes a child from this scene node. - //! Implemented here, to be able to remove the shadow properly, if there is one, - //! or to remove attached childs. - virtual bool removeChild(ISceneNode* child) _IRR_OVERRIDE_; - -private: - const quake3::IShader* Shader; - SMesh *Mesh; - IShadowVolumeSceneNode* Shadow; - const SMeshBufferLightMap* Original; - SMeshBuffer* MeshBuffer; - core::vector3df MeshOffset; - - struct SQ3Texture - { - SQ3Texture () : - TextureIndex ( 0 ), - TextureFrequency(0.f), - TextureAddressMode( video::ETC_REPEAT ) - { - Texture.setAllocStrategy ( core::ALLOC_STRATEGY_SAFE ); - } - - quake3::tTexArray Texture; - - u32 TextureIndex; - f32 TextureFrequency; - video::E_TEXTURE_CLAMP TextureAddressMode; // Wrapping/Clamping - }; - - core::array< SQ3Texture > Q3Texture; - - void loadTextures ( io::IFileSystem * fileSystem ); - void addBuffer ( scene::SMeshBufferLightMap * buffer ); - void cloneBuffer ( scene::SMeshBuffer *dest, const scene::SMeshBufferLightMap * buffer, bool translateCenter ); - - void deformvertexes_wave ( f32 dt, quake3::SModifierFunction &function ); - void deformvertexes_move ( f32 dt, quake3::SModifierFunction &function ); - void deformvertexes_bulge( f32 dt, quake3::SModifierFunction &function ); - void deformvertexes_autosprite( f32 dt, quake3::SModifierFunction &function ); - void deformvertexes_autosprite2( f32 dt, quake3::SModifierFunction &function ); - void deformvertexes_normal ( f32 dt, quake3::SModifierFunction &function ); - - void vertextransform_tcgen ( f32 dt, quake3::SModifierFunction &function ); - void vertextransform_rgbgen ( f32 dt, quake3::SModifierFunction &function ); - void vertextransform_alphagen ( f32 dt, quake3::SModifierFunction &function ); - - void transformtex ( const core::matrix4 &m, const u32 clamp ); - - f32 TimeAbs; - - void animate( u32 stage, core::matrix4 &texture ); - - E_SCENE_NODE_RENDER_PASS getRenderStage() const; - -}; - - -} // end namespace scene -} // end namespace irr - - -#endif - diff --git a/source/Irrlicht/CSMFMeshFileLoader.cpp b/source/Irrlicht/CSMFMeshFileLoader.cpp deleted file mode 100644 index d6ddb133..00000000 --- a/source/Irrlicht/CSMFMeshFileLoader.cpp +++ /dev/null @@ -1,242 +0,0 @@ -// Copyright (C) 2010-2012 Gaz Davidson / Joseph Ellis -// 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_SMF_LOADER_ - -#include "CSMFMeshFileLoader.h" -#include "CMeshTextureLoader.h" -#include "SAnimatedMesh.h" -#include "SMeshBuffer.h" -#include "IReadFile.h" -#include "coreutil.h" -#include "os.h" -#include "IVideoDriver.h" - -namespace irr -{ -namespace scene -{ - -CSMFMeshFileLoader::CSMFMeshFileLoader(irr::io::IFileSystem* fs, video::IVideoDriver* driver) -{ - TextureLoader = new CMeshTextureLoader( fs, driver ); -} - -//! Returns true if the file might be loaded by this class. -bool CSMFMeshFileLoader::isALoadableFileExtension(const io::path& filename) const -{ - return core::hasFileExtension(filename, "smf"); -} - -//! Creates/loads an animated mesh from the file. -IAnimatedMesh* CSMFMeshFileLoader::createMesh(io::IReadFile* file) -{ - if ( !file ) - return 0; - - if ( getMeshTextureLoader() ) - getMeshTextureLoader()->setMeshFile(file); - - // create empty mesh - SMesh *mesh = new SMesh(); - - // load file - u16 version; - u8 flags; - s32 limbCount; - s32 i; - - io::BinaryFile::read(file, version); - io::BinaryFile::read(file, flags); - io::BinaryFile::read(file, limbCount); - - // load mesh data - core::matrix4 identity; - for (i=0; i < limbCount; ++i) - loadLimb(file, mesh, identity); - - // recalculate buffer bounding boxes - for (i=0; i < (s32)mesh->getMeshBufferCount(); ++i) - mesh->getMeshBuffer(i)->recalculateBoundingBox(); - - mesh->recalculateBoundingBox(); - SAnimatedMesh *am = new SAnimatedMesh(); - am->addMesh(mesh); - mesh->drop(); - am->recalculateBoundingBox(); - - return am; -} - -void CSMFMeshFileLoader::loadLimb(io::IReadFile* file, SMesh* mesh, const core::matrix4 &parentTransformation) -{ - core::matrix4 transformation; - - // limb transformation - core::vector3df translate, rotate, scale; - io::BinaryFile::read(file, translate); - io::BinaryFile::read(file, rotate); - io::BinaryFile::read(file, scale); - - transformation.setTranslation(translate); - transformation.setRotationDegrees(rotate); - transformation.setScale(scale); - - transformation = parentTransformation * transformation; - - core::stringc textureName, textureGroupName; - - // texture information - io::BinaryFile::read(file, textureGroupName); - io::BinaryFile::read(file, textureName); - - // attempt to load texture using known formats - video::ITexture* texture = 0; - - const c8* extensions[] = {".jpg", ".png", ".tga", ".bmp", 0}; - - for (const c8 **ext = extensions; !texture && *ext; ++ext) - { - texture = getMeshTextureLoader() ? getMeshTextureLoader()->getTexture(textureName + *ext) : NULL; - if (texture) - { - textureName = textureName + *ext; - break; - } - } - // find the correct mesh buffer - u32 i; - for (i=0; i<mesh->MeshBuffers.size(); ++i) - if (mesh->MeshBuffers[i]->getMaterial().TextureLayer[0].Texture == texture) - break; - - // create mesh buffer if none was found - if (i == mesh->MeshBuffers.size()) - { - CMeshBuffer<video::S3DVertex>* mb = new CMeshBuffer<video::S3DVertex>(); - mb->Material.TextureLayer[0].Texture = texture; - - // horribly hacky way to do this, maybe it's in the flags? - if (core::hasFileExtension(textureName, "tga", "png")) - mb->Material.MaterialType = video::EMT_TRANSPARENT_ALPHA_CHANNEL; - else - mb->Material.MaterialType = video::EMT_SOLID; - - mesh->MeshBuffers.push_back(mb); - } - - CMeshBuffer<video::S3DVertex>* mb = (CMeshBuffer<video::S3DVertex>*)mesh->MeshBuffers[i]; - - u16 vertexCount, firstVertex = mb->getVertexCount(); - - io::BinaryFile::read(file, vertexCount); - mb->Vertices.reallocate(mb->Vertices.size() + vertexCount); - - // add vertices and set positions - for (i=0; i<vertexCount; ++i) - { - core::vector3df pos; - io::BinaryFile::read(file, pos); - transformation.transformVect(pos); - video::S3DVertex vert; - vert.Color = 0xFFFFFFFF; - vert.Pos = pos; - mb->Vertices.push_back(vert); - } - - // set vertex normals - for (i=0; i < vertexCount; ++i) - { - core::vector3df normal; - io::BinaryFile::read(file, normal); - transformation.rotateVect(normal); - mb->Vertices[firstVertex + i].Normal = normal; - } - // set texture coordinates - - for (i=0; i < vertexCount; ++i) - { - core::vector2df tcoords; - io::BinaryFile::read(file, tcoords); - mb->Vertices[firstVertex + i].TCoords = tcoords; - } - - // triangles - u32 triangleCount; - // vertexCount used as temporary - io::BinaryFile::read(file, vertexCount); - triangleCount=3*vertexCount; - mb->Indices.reallocate(mb->Indices.size() + triangleCount); - - for (i=0; i < triangleCount; ++i) - { - u16 index; - io::BinaryFile::read(file, index); - mb->Indices.push_back(firstVertex + index); - } - - // read limbs - s32 limbCount; - io::BinaryFile::read(file, limbCount); - - for (s32 l=0; l < limbCount; ++l) - loadLimb(file, mesh, transformation); -} - -} // namespace scene - -// todo: at some point in the future let's move these to a place where everyone can use them. -namespace io -{ - -#if _BIGENDIAN -#define _SYSTEM_BIG_ENDIAN_ (true) -#else -#define _SYSTEM_BIG_ENDIAN_ (false) -#endif - -template <class T> -void BinaryFile::read(io::IReadFile* file, T &out, bool bigEndian) -{ - file->read((void*)&out, sizeof(out)); - if (bigEndian != (_SYSTEM_BIG_ENDIAN_)) - out = os::Byteswap::byteswap(out); -} - -//! reads a 3d vector from the file, moving the file pointer along -void BinaryFile::read(io::IReadFile* file, core::vector3df &outVector2d, bool bigEndian) -{ - BinaryFile::read(file, outVector2d.X, bigEndian); - BinaryFile::read(file, outVector2d.Y, bigEndian); - BinaryFile::read(file, outVector2d.Z, bigEndian); -} - -//! reads a 2d vector from the file, moving the file pointer along -void BinaryFile::read(io::IReadFile* file, core::vector2df &outVector2d, bool bigEndian) -{ - BinaryFile::read(file, outVector2d.X, bigEndian); - BinaryFile::read(file, outVector2d.Y, bigEndian); -} - -//! reads a null terminated string from the file, moving the file pointer along -void BinaryFile::read(io::IReadFile* file, core::stringc &outString, bool bigEndian) -{ - c8 c; - file->read((void*)&c, 1); - - while (c) - { - outString += c; - file->read((void*)&c, 1); - } -} - -} // namespace io - -} // namespace irr - -#endif // compile with SMF loader - diff --git a/source/Irrlicht/CSMFMeshFileLoader.h b/source/Irrlicht/CSMFMeshFileLoader.h deleted file mode 100644 index 9f89ef75..00000000 --- a/source/Irrlicht/CSMFMeshFileLoader.h +++ /dev/null @@ -1,69 +0,0 @@ -// Copyright (C) 2010-2012 Gaz Davidson -// This file is part of the "Irrlicht Engine". -// For conditions of distribution and use, see copyright notice in irrlicht.h - -#ifndef __C_SMF_MESH_LOADER_H_INCLUDED__ -#define __C_SMF_MESH_LOADER_H_INCLUDED__ - -#include "IMeshLoader.h" -#include "SMesh.h" - -namespace irr -{ - -namespace video -{ - class IVideoDriver; -} -namespace io -{ - class IFileSystem; -} - -namespace scene -{ - -//! Class which can load -class CSMFMeshFileLoader : public virtual IMeshLoader -{ -public: - - CSMFMeshFileLoader(irr::io::IFileSystem* fs, video::IVideoDriver* driver); - - //! Returns true if the file might be loaded by this class. - virtual bool isALoadableFileExtension(const io::path& filename) const _IRR_OVERRIDE_; - - //! Creates/loads an animated mesh from the file. - virtual IAnimatedMesh* createMesh(io::IReadFile* file) _IRR_OVERRIDE_; -private: - - void loadLimb(io::IReadFile* file, scene::SMesh* mesh, const core::matrix4 &parentTransformation); -}; - -} // end namespace scene - -namespace io -{ - class BinaryFile - { - public: - //! reads most types from the given file, moving the file pointer along - template <class T> - static void read(io::IReadFile* file, T &out, bool bigEndian=false); - - //! reads a 3d vector from the file, moving the file pointer along - static void read(io::IReadFile* file, core::vector3df &outVector2d, bool bigEndian=false); - - //! reads a 2d vector from the file, moving the file pointer along - static void read(io::IReadFile* file, core::vector2df &outVector2d, bool bigEndian=false); - - //! reads a null terminated string from the file, moving the file pointer along - static void read(io::IReadFile* file, core::stringc &outString, bool bigEndian=false); - - }; -} - -} // end namespace irr - -#endif // __C_SMF_MESH_LOADER_H_INCLUDED__ - diff --git a/source/Irrlicht/CSTLMeshFileLoader.cpp b/source/Irrlicht/CSTLMeshFileLoader.cpp deleted file mode 100644 index bf9ffb30..00000000 --- a/source/Irrlicht/CSTLMeshFileLoader.cpp +++ /dev/null @@ -1,253 +0,0 @@ -// Copyright (C) 2007-2012 Christian Stehno -// 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_STL_LOADER_ - -#include "CSTLMeshFileLoader.h" -#include "SMesh.h" -#include "SMeshBuffer.h" -#include "SAnimatedMesh.h" -#include "IReadFile.h" -#include "fast_atof.h" -#include "coreutil.h" -#include "os.h" - -namespace irr -{ -namespace scene -{ - - -//! returns true if the file maybe is able to be loaded by this class -//! based on the file extension (e.g. ".bsp") -bool CSTLMeshFileLoader::isALoadableFileExtension(const io::path& filename) const -{ - return core::hasFileExtension ( filename, "stl" ); -} - - - -//! 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* CSTLMeshFileLoader::createMesh(io::IReadFile* file) -{ - const long filesize = file->getSize(); - if (filesize < 6) // we need a header - return 0; - - SMesh* mesh = new SMesh(); - SMeshBuffer* meshBuffer = new SMeshBuffer(); - mesh->addMeshBuffer(meshBuffer); - meshBuffer->drop(); - - core::vector3df vertex[3]; - core::vector3df normal; - - bool binary = false; - core::stringc token; - if (getNextToken(file, token) != "solid") - binary = true; - // read/skip header - u32 binFaceCount = 0; - if (binary) - { - file->seek(80); - file->read(&binFaceCount, 4); -#ifdef __BIG_ENDIAN__ - binFaceCount = os::Byteswap::byteswap(binFaceCount); -#endif - } - else - goNextLine(file); - - u16 attrib=0; - token.reserve(32); - - while (file->getPos() < filesize) - { - if (!binary) - { - if (getNextToken(file, token) != "facet") - { - if (token=="endsolid") - break; - mesh->drop(); - return 0; - } - if (getNextToken(file, token) != "normal") - { - mesh->drop(); - return 0; - } - } - getNextVector(file, normal, binary); - if (!binary) - { - if (getNextToken(file, token) != "outer") - { - mesh->drop(); - return 0; - } - if (getNextToken(file, token) != "loop") - { - mesh->drop(); - return 0; - } - } - for (u32 i=0; i<3; ++i) - { - if (!binary) - { - if (getNextToken(file, token) != "vertex") - { - mesh->drop(); - return 0; - } - } - getNextVector(file, vertex[i], binary); - } - if (!binary) - { - if (getNextToken(file, token) != "endloop") - { - mesh->drop(); - return 0; - } - if (getNextToken(file, token) != "endfacet") - { - mesh->drop(); - return 0; - } - } - else - { - file->read(&attrib, 2); -#ifdef __BIG_ENDIAN__ - attrib = os::Byteswap::byteswap(attrib); -#endif - } - - SMeshBuffer* mb = reinterpret_cast<SMeshBuffer*>(mesh->getMeshBuffer(mesh->getMeshBufferCount()-1)); - u32 vCount = mb->getVertexCount(); - video::SColor color(0xffffffff); - if (attrib & 0x8000) - color = video::A1R5G5B5toA8R8G8B8(attrib); - if (normal==core::vector3df()) - normal=core::plane3df(vertex[2],vertex[1],vertex[0]).Normal; - mb->Vertices.push_back(video::S3DVertex(vertex[2],normal,color, core::vector2df())); - mb->Vertices.push_back(video::S3DVertex(vertex[1],normal,color, core::vector2df())); - mb->Vertices.push_back(video::S3DVertex(vertex[0],normal,color, core::vector2df())); - mb->Indices.push_back(vCount); - mb->Indices.push_back(vCount+1); - mb->Indices.push_back(vCount+2); - } // end while (file->getPos() < filesize) - mesh->getMeshBuffer(0)->recalculateBoundingBox(); - - // Create the Animated mesh if there's anything in the mesh - SAnimatedMesh* pAM = 0; - if ( 0 != mesh->getMeshBufferCount() ) - { - mesh->recalculateBoundingBox(); - pAM = new SAnimatedMesh(); - pAM->Type = EAMT_OBJ; - pAM->addMesh(mesh); - pAM->recalculateBoundingBox(); - } - - mesh->drop(); - - return pAM; -} - - -//! Read 3d vector of floats -void CSTLMeshFileLoader::getNextVector(io::IReadFile* file, core::vector3df& vec, bool binary) const -{ - if (binary) - { - file->read(&vec.X, 4); - file->read(&vec.Y, 4); - file->read(&vec.Z, 4); -#ifdef __BIG_ENDIAN__ - vec.X = os::Byteswap::byteswap(vec.X); - vec.Y = os::Byteswap::byteswap(vec.Y); - vec.Z = os::Byteswap::byteswap(vec.Z); -#endif - } - else - { - goNextWord(file); - core::stringc tmp; - - getNextToken(file, tmp); - core::fast_atof_move(tmp.c_str(), vec.X); - getNextToken(file, tmp); - core::fast_atof_move(tmp.c_str(), vec.Y); - getNextToken(file, tmp); - core::fast_atof_move(tmp.c_str(), vec.Z); - } - vec.X=-vec.X; -} - - -//! Read next word -const core::stringc& CSTLMeshFileLoader::getNextToken(io::IReadFile* file, core::stringc& token) const -{ - goNextWord(file); - u8 c; - token = ""; - while(file->getPos() != file->getSize()) - { - file->read(&c, 1); - // found it, so leave - if (core::isspace(c)) - break; - token.append(c); - } - return token; -} - - -//! skip to next word -void CSTLMeshFileLoader::goNextWord(io::IReadFile* file) const -{ - u8 c; - while(file->getPos() != file->getSize()) - { - file->read(&c, 1); - // found it, so leave - if (!core::isspace(c)) - { - file->seek(-1, true); - break; - } - } -} - - -//! Read until line break is reached and stop at the next non-space character -void CSTLMeshFileLoader::goNextLine(io::IReadFile* file) const -{ - u8 c; - // look for newline characters - while(file->getPos() != file->getSize()) - { - file->read(&c, 1); - // found it, so leave - if (c=='\n' || c=='\r') - break; - } -} - - -} // end namespace scene -} // end namespace irr - - -#endif // _IRR_COMPILE_WITH_STL_LOADER_ - diff --git a/source/Irrlicht/CSTLMeshFileLoader.h b/source/Irrlicht/CSTLMeshFileLoader.h deleted file mode 100644 index d15a9f42..00000000 --- a/source/Irrlicht/CSTLMeshFileLoader.h +++ /dev/null @@ -1,49 +0,0 @@ -// Copyright (C) 2007-2012 Christian Stehno -// This file is part of the "Irrlicht Engine". -// For conditions of distribution and use, see copyright notice in irrlicht.h - -#ifndef __C_STL_MESH_FILE_LOADER_H_INCLUDED__ -#define __C_STL_MESH_FILE_LOADER_H_INCLUDED__ - -#include "IMeshLoader.h" -#include "irrString.h" -#include "vector3d.h" - -namespace irr -{ -namespace scene -{ - -//! Meshloader capable of loading STL meshes. -class CSTLMeshFileLoader : public IMeshLoader -{ -public: - - //! returns true if the file maybe is able to be loaded by this class - //! based on the file extension (i.e. ".stl") - 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 to the first non-space character available - void goNextWord(io::IReadFile* file) const; - // returns the next word - const core::stringc& getNextToken(io::IReadFile* file, core::stringc& token) const; - // skip to next printable character after the first line break - void goNextLine(io::IReadFile* file) const; - - //! Read 3d vector of floats - void getNextVector(io::IReadFile* file, core::vector3df& vec, bool binary) const; -}; - -} // end namespace scene -} // end namespace irr - -#endif - diff --git a/source/Irrlicht/CSTLMeshWriter.cpp b/source/Irrlicht/CSTLMeshWriter.cpp deleted file mode 100644 index f3b14133..00000000 --- a/source/Irrlicht/CSTLMeshWriter.cpp +++ /dev/null @@ -1,187 +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_STL_WRITER_ - -#include "CSTLMeshWriter.h" -#include "os.h" -#include "IMesh.h" -#include "IMeshBuffer.h" -#include "IAttributes.h" -#include "ISceneManager.h" -#include "IMeshCache.h" -#include "IWriteFile.h" - -namespace irr -{ -namespace scene -{ - -CSTLMeshWriter::CSTLMeshWriter(scene::ISceneManager* smgr) - : SceneManager(smgr) -{ - #ifdef _DEBUG - setDebugName("CSTLMeshWriter"); - #endif - - if (SceneManager) - SceneManager->grab(); -} - - -CSTLMeshWriter::~CSTLMeshWriter() -{ - if (SceneManager) - SceneManager->drop(); -} - - -//! Returns the type of the mesh writer -EMESH_WRITER_TYPE CSTLMeshWriter::getType() const -{ - return EMWT_STL; -} - - -//! writes a mesh -bool CSTLMeshWriter::writeMesh(io::IWriteFile* file, scene::IMesh* mesh, s32 flags) -{ - if (!file) - return false; - - os::Printer::log("Writing mesh", file->getFileName()); - - if (flags & (scene::EMWF_WRITE_BINARY|scene::EMWF_WRITE_COMPRESSED) ) - return writeMeshBinary(file, mesh, flags); - else - return writeMeshASCII(file, mesh, flags); -} - - -bool CSTLMeshWriter::writeMeshBinary(io::IWriteFile* file, scene::IMesh* mesh, s32 flags) -{ - // write STL MESH header - - file->write("binary ",7); - const core::stringc name(SceneManager->getMeshCache()->getMeshName(mesh)); - const s32 sizeleft = 73-name.size(); // 80 byte header - if (sizeleft<0) - file->write(name.c_str(),73); - else - { - char* buf = new char[80]; - memset(buf, 0, 80); - file->write(name.c_str(),name.size()); - file->write(buf,sizeleft); - delete [] buf; - } - u32 facenum = 0; - for (u32 j=0; j<mesh->getMeshBufferCount(); ++j) - facenum += mesh->getMeshBuffer(j)->getIndexCount()/3; - file->write(&facenum,4); - - // write mesh buffers - - for (u32 i=0; i<mesh->getMeshBufferCount(); ++i) - { - IMeshBuffer* buffer = mesh->getMeshBuffer(i); - if (buffer) - { - const u32 indexCount = buffer->getIndexCount(); - const u16 attributes = 0; - for (u32 j=0; j<indexCount; j+=3) - { - const core::vector3df& v1 = buffer->getPosition(buffer->getIndices()[j]); - const core::vector3df& v2 = buffer->getPosition(buffer->getIndices()[j+1]); - const core::vector3df& v3 = buffer->getPosition(buffer->getIndices()[j+2]); - const core::plane3df tmpplane(v1,v2,v3); - file->write(&tmpplane.Normal, 12); - file->write(&v1, 12); - file->write(&v2, 12); - file->write(&v3, 12); - file->write(&attributes, 2); - } - } - } - return true; -} - - -bool CSTLMeshWriter::writeMeshASCII(io::IWriteFile* file, scene::IMesh* mesh, s32 flags) -{ - // write STL MESH header - - file->write("solid ",6); - const core::stringc name(SceneManager->getMeshCache()->getMeshName(mesh)); - file->write(name.c_str(),name.size()); - file->write("\n\n",2); - - // write mesh buffers - - for (u32 i=0; i<mesh->getMeshBufferCount(); ++i) - { - IMeshBuffer* buffer = mesh->getMeshBuffer(i); - if (buffer) - { - const u32 indexCount = buffer->getIndexCount(); - for (u32 j=0; j<indexCount; j+=3) - { - writeFace(file, - buffer->getPosition(buffer->getIndices()[j]), - buffer->getPosition(buffer->getIndices()[j+1]), - buffer->getPosition(buffer->getIndices()[j+2])); - } - file->write("\n",1); - } - } - - file->write("endsolid ",9); - file->write(name.c_str(),name.size()); - - return true; -} - - -void CSTLMeshWriter::getVectorAsStringLine(const core::vector3df& v, core::stringc& s) const -{ - s = core::stringc(v.X); - s += " "; - s += core::stringc(v.Y); - s += " "; - s += core::stringc(v.Z); - s += "\n"; -} - - -void CSTLMeshWriter::writeFace(io::IWriteFile* file, - const core::vector3df& v1, - const core::vector3df& v2, - const core::vector3df& v3) -{ - core::stringc tmp; - file->write("facet normal ",13); - getVectorAsStringLine(core::plane3df(v1,v2,v3).Normal, tmp); - file->write(tmp.c_str(),tmp.size()); - file->write(" outer loop\n",13); - file->write(" vertex ",11); - getVectorAsStringLine(v1, tmp); - file->write(tmp.c_str(),tmp.size()); - file->write(" vertex ",11); - getVectorAsStringLine(v2, tmp); - file->write(tmp.c_str(),tmp.size()); - file->write(" vertex ",11); - getVectorAsStringLine(v3, tmp); - file->write(tmp.c_str(),tmp.size()); - file->write(" endloop\n",10); - file->write("endfacet\n",9); -} - - -} // end namespace -} // end namespace - -#endif - diff --git a/source/Irrlicht/CSTLMeshWriter.h b/source/Irrlicht/CSTLMeshWriter.h deleted file mode 100644 index 18ac6b70..00000000 --- a/source/Irrlicht/CSTLMeshWriter.h +++ /dev/null @@ -1,55 +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_STL_MESH_WRITER_H_INCLUDED__ -#define __IRR_STL_MESH_WRITER_H_INCLUDED__ - -#include "IMeshWriter.h" -#include "S3DVertex.h" -#include "irrString.h" - -namespace irr -{ -namespace scene -{ - class IMeshBuffer; - class ISceneManager; - - //! class to write meshes, implementing a STL writer - class CSTLMeshWriter : public IMeshWriter - { - public: - - CSTLMeshWriter(scene::ISceneManager* smgr); - virtual ~CSTLMeshWriter(); - - //! 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: - // write binary format - bool writeMeshBinary(io::IWriteFile* file, scene::IMesh* mesh, s32 flags); - - // write text format - bool writeMeshASCII(io::IWriteFile* file, scene::IMesh* mesh, s32 flags); - - // create vector output with line end into string - void getVectorAsStringLine(const core::vector3df& v, - core::stringc& s) const; - - // write face information to file - void writeFace(io::IWriteFile* file, const core::vector3df& v1, - const core::vector3df& v2, const core::vector3df& v3); - - scene::ISceneManager* SceneManager; - }; - -} // end namespace -} // end namespace - -#endif - diff --git a/source/Irrlicht/CSceneCollisionManager.cpp b/source/Irrlicht/CSceneCollisionManager.cpp deleted file mode 100644 index 78ba1318..00000000 --- a/source/Irrlicht/CSceneCollisionManager.cpp +++ /dev/null @@ -1,983 +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 "CSceneCollisionManager.h" -#include "ISceneNode.h" -#include "ICameraSceneNode.h" -#include "ITriangleSelector.h" -#include "SViewFrustum.h" - -#include "os.h" -#include "irrMath.h" - -namespace irr -{ -namespace scene -{ - -//! constructor -CSceneCollisionManager::CSceneCollisionManager(ISceneManager* smanager, video::IVideoDriver* driver) -: SceneManager(smanager), Driver(driver) -{ - #ifdef _DEBUG - setDebugName("CSceneCollisionManager"); - #endif - - if (Driver) - Driver->grab(); -} - - -//! destructor -CSceneCollisionManager::~CSceneCollisionManager() -{ - if (Driver) - Driver->drop(); -} - - -//! Returns the scene node, which is currently visible at the given -//! screen coordinates, viewed from the currently active camera. -ISceneNode* CSceneCollisionManager::getSceneNodeFromScreenCoordinatesBB( - const core::position2d<s32>& pos, s32 idBitMask, bool noDebugObjects, scene::ISceneNode* root) -{ - const core::line3d<f32> ln = getRayFromScreenCoordinates(pos, 0); - - if ( ln.start == ln.end ) - return 0; - - return getSceneNodeFromRayBB(ln, idBitMask, noDebugObjects, root); -} - - -//! Returns the nearest scene node which collides with a 3d ray and -//! which id matches a bitmask. -ISceneNode* CSceneCollisionManager::getSceneNodeFromRayBB( - const core::line3d<f32>& ray, - s32 idBitMask, bool noDebugObjects, scene::ISceneNode* root) -{ - ISceneNode* best = 0; - f32 dist = FLT_MAX; - - core::line3d<f32> truncatableRay(ray); - - getPickedNodeBB((root==0)?SceneManager->getRootSceneNode():root, truncatableRay, - idBitMask, noDebugObjects, dist, best); - - return best; -} - - -//! recursive method for going through all scene nodes -void CSceneCollisionManager::getPickedNodeBB(ISceneNode* root, - core::line3df& ray, s32 bits, bool noDebugObjects, - f32& outbestdistance, ISceneNode*& outbestnode) -{ - const ISceneNodeList& children = root->getChildren(); - const core::vector3df rayVector = ray.getVector().normalize(); - - ISceneNodeList::ConstIterator it = children.begin(); - for (; it != children.end(); ++it) - { - ISceneNode* current = *it; - - if (current->isVisible()) - { - if((noDebugObjects ? !current->isDebugObject() : true) && - (bits==0 || (bits != 0 && (current->getID() & bits)))) - { - // Assume that single-point bounding-boxes are not meant for collision - const core::aabbox3df & objectBox = current->getBoundingBox(); - if ( objectBox.isEmpty() ) - continue; - - // get world to object space transform - core::matrix4 worldToObject; - if (!current->getAbsoluteTransformation().getInverse(worldToObject)) - continue; - - // transform vector from world space to object space - core::line3df objectRay(ray); - worldToObject.transformVect(objectRay.start); - worldToObject.transformVect(objectRay.end); - - // Do the initial intersection test in object space, since the - // object space box test is more accurate. - if(objectBox.isPointInside(objectRay.start)) - { - // use fast bbox intersection to find distance to hitpoint - // algorithm from Kay et al., code from gamedev.net - const core::vector3df dir = (objectRay.end-objectRay.start).normalize(); - const core::vector3df minDist = (objectBox.MinEdge - objectRay.start)/dir; - const core::vector3df maxDist = (objectBox.MaxEdge - objectRay.start)/dir; - const core::vector3df realMin(core::min_(minDist.X, maxDist.X),core::min_(minDist.Y, maxDist.Y),core::min_(minDist.Z, maxDist.Z)); - const core::vector3df realMax(core::max_(minDist.X, maxDist.X),core::max_(minDist.Y, maxDist.Y),core::max_(minDist.Z, maxDist.Z)); - - const f32 minmax = core::min_(realMax.X, realMax.Y, realMax.Z); - // nearest distance to intersection - const f32 maxmin = core::max_(realMin.X, realMin.Y, realMin.Z); - - const f32 toIntersectionSq = (maxmin>0?maxmin*maxmin:minmax*minmax); - if (toIntersectionSq < outbestdistance) - { - outbestdistance = toIntersectionSq; - outbestnode = current; - - // And we can truncate the ray to stop us hitting further nodes. - ray.end = ray.start + (rayVector * sqrtf(toIntersectionSq)); - } - } - else - if (objectBox.intersectsWithLine(objectRay)) - { - // Now transform into world space, since we need to use world space - // scales and distances. - core::aabbox3df worldBox(objectBox); - current->getAbsoluteTransformation().transformBoxEx(worldBox); - - core::vector3df edges[8]; - worldBox.getEdges(edges); - - /* We need to check against each of 6 faces, composed of these corners: - /3--------/7 - / | / | - / | / | - 1---------5 | - | 2- - -| -6 - | / | / - |/ | / - 0---------4/ - - Note that we define them as opposite pairs of faces. - */ - static const s32 faceEdges[6][3] = - { - { 0, 1, 5 }, // Front - { 6, 7, 3 }, // Back - { 2, 3, 1 }, // Left - { 4, 5, 7 }, // Right - { 1, 3, 7 }, // Top - { 2, 0, 4 } // Bottom - }; - - core::vector3df intersection; - core::plane3df facePlane; - f32 bestDistToBoxBorder = FLT_MAX; - f32 bestToIntersectionSq = FLT_MAX; - - for(s32 face = 0; face < 6; ++face) - { - facePlane.setPlane(edges[faceEdges[face][0]], - edges[faceEdges[face][1]], - edges[faceEdges[face][2]]); - - // Only consider lines that might be entering through this face, since we - // already know that the start point is outside the box. - if(facePlane.classifyPointRelation(ray.start) != core::ISREL3D_FRONT) - continue; - - // Don't bother using a limited ray, since we already know that it should be long - // enough to intersect with the box. - if(facePlane.getIntersectionWithLine(ray.start, rayVector, intersection)) - { - const f32 toIntersectionSq = ray.start.getDistanceFromSQ(intersection); - if(toIntersectionSq < outbestdistance) - { - // We have to check that the intersection with this plane is actually - // on the box, so need to go back to object space again. - worldToObject.transformVect(intersection); - - // find the closest point on the box borders. Have to do this as exact checks will fail due to floating point problems. - f32 distToBorder = core::max_ ( core::min_ (core::abs_(objectBox.MinEdge.X-intersection.X), core::abs_(objectBox.MaxEdge.X-intersection.X)), - core::min_ (core::abs_(objectBox.MinEdge.Y-intersection.Y), core::abs_(objectBox.MaxEdge.Y-intersection.Y)), - core::min_ (core::abs_(objectBox.MinEdge.Z-intersection.Z), core::abs_(objectBox.MaxEdge.Z-intersection.Z)) ); - if ( distToBorder < bestDistToBoxBorder ) - { - bestDistToBoxBorder = distToBorder; - bestToIntersectionSq = toIntersectionSq; - } - } - } - - // If the ray could be entering through the first face of a pair, then it can't - // also be entering through the opposite face, and so we can skip that face. - if (!(face & 0x01)) - ++face; - } - - if ( bestDistToBoxBorder < FLT_MAX ) - { - outbestdistance = bestToIntersectionSq; - outbestnode = current; - - // If we got a hit, we can now truncate the ray to stop us hitting further nodes. - ray.end = ray.start + (rayVector * sqrtf(outbestdistance)); - } - } - } - - // Only check the children if this node is visible. - getPickedNodeBB(current, ray, bits, noDebugObjects, outbestdistance, outbestnode); - } - } -} - - -ISceneNode* CSceneCollisionManager::getSceneNodeAndCollisionPointFromRay( - SCollisionHit& hitResult, - const core::line3df& ray, - s32 idBitMask, - ISceneNode * collisionRootNode, - bool noDebugObjects) -{ - if(0 == collisionRootNode) - collisionRootNode = SceneManager->getRootSceneNode(); - - // We don't try to do anything too clever, like sorting the candidate - // nodes by distance to bounding-box. In the example below, we could do the - // triangle collision check with node A first, but we'd have to check node B - // anyway, as the actual collision point could be (and is) closer than the - // collision point in node A. - // - // ray end - // | - // AAAAAAAAAA - // A | - // A | B - // A | B - // A BBBBB - // A | - // A | - // | - // | - // ray start - // - // We therefore have to do a full BB and triangle collision on every scene - // node in order to find the nearest collision point, so sorting them by - // bounding box would be pointless. - - f32 bestDistanceSquared = FLT_MAX; - core::line3df rayRest(ray); - getPickedNodeFromBBAndSelector(hitResult, collisionRootNode, rayRest, idBitMask, - noDebugObjects, bestDistanceSquared); - return hitResult.Node; -} - - -void CSceneCollisionManager::getPickedNodeFromBBAndSelector( - SCollisionHit& hitResult, - ISceneNode * root, - core::line3df & ray, - s32 bits, - bool noDebugObjects, - f32 & outBestDistanceSquared) -{ - const ISceneNodeList& children = root->getChildren(); - - ISceneNodeList::ConstIterator it = children.begin(); - for (; it != children.end(); ++it) - { - ISceneNode* current = *it; - ITriangleSelector * selector = current->getTriangleSelector(); - - if (selector && current->isVisible() && - (noDebugObjects ? !current->isDebugObject() : true) && - (bits==0 || (bits != 0 && (current->getID() & bits)))) - { - // get world to object space transform - core::matrix4 mat; - if (!current->getAbsoluteTransformation().getInverse(mat)) - continue; - - // transform vector from world space to object space - core::line3df line(ray); - mat.transformVect(line.start); - mat.transformVect(line.end); - - const core::aabbox3df& box = current->getBoundingBox(); - - SCollisionHit candidateHitResult; - - // do intersection test in object space - if (box.intersectsWithLine(line) && - getCollisionPoint(candidateHitResult, ray, selector)) - { - const f32 distanceSquared = (candidateHitResult.Intersection - ray.start).getLengthSQ(); - - if(distanceSquared < outBestDistanceSquared) - { - outBestDistanceSquared = distanceSquared; - hitResult = candidateHitResult; - const core::vector3df rayVector = ray.getVector().normalize(); - ray.end = ray.start + (rayVector * sqrtf(distanceSquared)); - } - } - } - - getPickedNodeFromBBAndSelector(hitResult, current, ray, bits, noDebugObjects, - outBestDistanceSquared); - } -} - - -//! Returns the scene node, at which the given camera is looking at and -//! which id matches the bitmask. -ISceneNode* CSceneCollisionManager::getSceneNodeFromCameraBB( - const ICameraSceneNode* camera, s32 idBitMask, bool noDebugObjects) -{ - if (!camera) - return 0; - - const core::vector3df start = camera->getAbsolutePosition(); - core::vector3df end = camera->getTarget(); - - end = start + ((end - start).normalize() * camera->getFarValue()); - - return getSceneNodeFromRayBB(core::line3d<f32>(start, end), idBitMask, noDebugObjects); -} - -bool CSceneCollisionManager::getCollisionPoint(SCollisionHit& hitResult, const core::line3d<f32>& ray, ITriangleSelector* selector) -{ - if (!selector) - { - return false; - } - - s32 totalcnt = selector->getTriangleCount(); - if ( totalcnt <= 0 ) - return false; - - Triangles.set_used(totalcnt); - - s32 cnt = 0; - irr::core::array<SCollisionTriangleRange> outTriangleInfo; - selector->getTriangles(Triangles.pointer(), totalcnt, cnt, ray, 0, true, &outTriangleInfo); - - const core::vector3df linevect = ray.getVector().normalize(); - core::vector3df intersection; - f32 nearest = FLT_MAX; - irr::s32 foundIndex = -1; - const f32 raylength = ray.getLengthSQ(); - - const f32 minX = core::min_(ray.start.X, ray.end.X); - const f32 maxX = core::max_(ray.start.X, ray.end.X); - const f32 minY = core::min_(ray.start.Y, ray.end.Y); - const f32 maxY = core::max_(ray.start.Y, ray.end.Y); - const f32 minZ = core::min_(ray.start.Z, ray.end.Z); - const f32 maxZ = core::max_(ray.start.Z, ray.end.Z); - - for (s32 i=0; i<cnt; ++i) - { - const core::triangle3df & triangle = Triangles[i]; - - if(minX > triangle.pointA.X && minX > triangle.pointB.X && minX > triangle.pointC.X) - continue; - if(maxX < triangle.pointA.X && maxX < triangle.pointB.X && maxX < triangle.pointC.X) - continue; - if(minY > triangle.pointA.Y && minY > triangle.pointB.Y && minY > triangle.pointC.Y) - continue; - if(maxY < triangle.pointA.Y && maxY < triangle.pointB.Y && maxY < triangle.pointC.Y) - continue; - if(minZ > triangle.pointA.Z && minZ > triangle.pointB.Z && minZ > triangle.pointC.Z) - continue; - if(maxZ < triangle.pointA.Z && maxZ < triangle.pointB.Z && maxZ < triangle.pointC.Z) - continue; - - if (triangle.getIntersectionWithLine(ray.start, linevect, intersection)) - { - const f32 tmp = intersection.getDistanceFromSQ(ray.start); - const f32 tmp2 = intersection.getDistanceFromSQ(ray.end); - - if (tmp < raylength && tmp2 < raylength && tmp < nearest) - { - nearest = tmp; - - hitResult.Triangle = triangle; - hitResult.Intersection = intersection; - foundIndex = i; - } - } - } - - if ( foundIndex >= 0 ) - { - for ( irr::u32 t=0; t<outTriangleInfo.size(); ++t ) - { - if ( outTriangleInfo[t].isIndexInRange(foundIndex) ) - { - hitResult.Node = outTriangleInfo[t].SceneNode; - hitResult.MeshBuffer = outTriangleInfo[t].MeshBuffer; - hitResult.MaterialIndex = outTriangleInfo[t].MaterialIndex; - hitResult.TriangleSelector = outTriangleInfo[t].Selector; - - break; - } - } - - return true; - } - - return false; -} - -//! Collides a moving ellipsoid with a 3d world with gravity and returns -//! the resulting new position of the ellipsoid. -core::vector3df CSceneCollisionManager::getCollisionResultPosition( - ITriangleSelector* selector, - const core::vector3df &position, const core::vector3df& radius, - const core::vector3df& direction, - core::triangle3df& triout, - core::vector3df& hitPosition, - bool& outFalling, - ISceneNode*& outNode, - f32 slidingSpeed, - const core::vector3df& gravity) -{ - return collideEllipsoidWithWorld(selector, position, - radius, direction, slidingSpeed, gravity, triout, hitPosition, outFalling, outNode); -} - - -bool CSceneCollisionManager::testTriangleIntersection(SCollisionData* colData, - const core::triangle3df& triangle) -{ - const core::plane3d<f32> trianglePlane = triangle.getPlane(); - - // only check front facing polygons - if ( !trianglePlane.isFrontFacing(colData->normalizedVelocity) ) - return false; - - // get interval of plane intersection - - f32 t1, t0; - bool embeddedInPlane = false; - - // calculate signed distance from sphere position to triangle plane - f32 signedDistToTrianglePlane = trianglePlane.getDistanceTo( - colData->basePoint); - - f32 normalDotVelocity = - trianglePlane.Normal.dotProduct(colData->velocity); - - if ( core::iszero ( normalDotVelocity ) ) - { - // sphere is traveling parallel to plane - - if (fabs(signedDistToTrianglePlane) >= 1.0f) - return false; // no collision possible - else - { - // sphere is embedded in plane - embeddedInPlane = true; - t0 = 0.0; - t1 = 1.0; - } - } - else - { - normalDotVelocity = core::reciprocal ( normalDotVelocity ); - - // N.D is not 0. Calculate intersection interval - t0 = (-1.f - signedDistToTrianglePlane) * normalDotVelocity; - t1 = (1.f - signedDistToTrianglePlane) * normalDotVelocity; - - // Swap so t0 < t1 - if (t0 > t1) { f32 tmp = t1; t1 = t0; t0 = tmp; } - - // check if at least one value is within the range - if (t0 > 1.0f || t1 < 0.0f) - return false; // both t values are outside 1 and 0, no collision possible - - // clamp to 0 and 1 - t0 = core::clamp ( t0, 0.f, 1.f ); - t1 = core::clamp ( t1, 0.f, 1.f ); - } - - // at this point we have t0 and t1, if there is any intersection, it - // is between this interval - core::vector3df collisionPoint; - bool foundCollision = false; - f32 t = 1.0f; - - // first check the easy case: Collision within the triangle; - // if this happens, it must be at t0 and this is when the sphere - // rests on the front side of the triangle plane. This can only happen - // if the sphere is not embedded in the triangle plane. - - if (!embeddedInPlane) - { - core::vector3df planeIntersectionPoint = - (colData->basePoint - trianglePlane.Normal) - + (colData->velocity * t0); - - if (triangle.isPointInside(planeIntersectionPoint)) - { - foundCollision = true; - t = t0; - collisionPoint = planeIntersectionPoint; - } - } - - // if we haven't found a collision already we will have to sweep - // the sphere against points and edges of the triangle. Note: A - // collision inside the triangle will always happen before a - // vertex or edge collision. - - if (!foundCollision) - { - core::vector3df velocity = colData->velocity; - core::vector3df base = colData->basePoint; - - f32 velocitySqaredLength = velocity.getLengthSQ(); - f32 a,b,c; - f32 newT; - - // for each edge or vertex a quadratic equation has to be solved: - // a*t^2 + b*t + c = 0. We calculate a,b, and c for each test. - - // check against points - a = velocitySqaredLength; - - // p1 - b = 2.0f * (velocity.dotProduct(base - triangle.pointA)); - c = (triangle.pointA-base).getLengthSQ() - 1.f; - if (getLowestRoot(a,b,c,t, &newT)) - { - t = newT; - foundCollision = true; - collisionPoint = triangle.pointA; - } - - // p2 - if (!foundCollision) - { - b = 2.0f * (velocity.dotProduct(base - triangle.pointB)); - c = (triangle.pointB-base).getLengthSQ() - 1.f; - if (getLowestRoot(a,b,c,t, &newT)) - { - t = newT; - foundCollision = true; - collisionPoint = triangle.pointB; - } - } - - // p3 - if (!foundCollision) - { - b = 2.0f * (velocity.dotProduct(base - triangle.pointC)); - c = (triangle.pointC-base).getLengthSQ() - 1.f; - if (getLowestRoot(a,b,c,t, &newT)) - { - t = newT; - foundCollision = true; - collisionPoint = triangle.pointC; - } - } - - // check against edges: - - // p1 --- p2 - core::vector3df edge = triangle.pointB - triangle.pointA; - core::vector3df baseToVertex = triangle.pointA - base; - f32 edgeSqaredLength = edge.getLengthSQ(); - f32 edgeDotVelocity = edge.dotProduct(velocity); - f32 edgeDotBaseToVertex = edge.dotProduct(baseToVertex); - - // calculate parameters for equation - a = edgeSqaredLength* -velocitySqaredLength + - edgeDotVelocity*edgeDotVelocity; - b = edgeSqaredLength* (2.f *velocity.dotProduct(baseToVertex)) - - 2.0f*edgeDotVelocity*edgeDotBaseToVertex; - c = edgeSqaredLength* (1.f -baseToVertex.getLengthSQ()) + - edgeDotBaseToVertex*edgeDotBaseToVertex; - - // does the swept sphere collide against infinite edge? - if (getLowestRoot(a,b,c,t,&newT)) - { - f32 f = (edgeDotVelocity*newT - edgeDotBaseToVertex) / edgeSqaredLength; - if (f >=0.0f && f <= 1.0f) - { - // intersection took place within segment - t = newT; - foundCollision = true; - collisionPoint = triangle.pointA + (edge*f); - } - } - - // p2 --- p3 - edge = triangle.pointC-triangle.pointB; - baseToVertex = triangle.pointB - base; - edgeSqaredLength = edge.getLengthSQ(); - edgeDotVelocity = edge.dotProduct(velocity); - edgeDotBaseToVertex = edge.dotProduct(baseToVertex); - - // calculate parameters for equation - a = edgeSqaredLength* -velocitySqaredLength + - edgeDotVelocity*edgeDotVelocity; - b = edgeSqaredLength* (2*velocity.dotProduct(baseToVertex)) - - 2.0f*edgeDotVelocity*edgeDotBaseToVertex; - c = edgeSqaredLength* (1-baseToVertex.getLengthSQ()) + - edgeDotBaseToVertex*edgeDotBaseToVertex; - - // does the swept sphere collide against infinite edge? - if (getLowestRoot(a,b,c,t,&newT)) - { - f32 f = (edgeDotVelocity*newT-edgeDotBaseToVertex) / - edgeSqaredLength; - if (f >=0.0f && f <= 1.0f) - { - // intersection took place within segment - t = newT; - foundCollision = true; - collisionPoint = triangle.pointB + (edge*f); - } - } - - - // p3 --- p1 - edge = triangle.pointA-triangle.pointC; - baseToVertex = triangle.pointC - base; - edgeSqaredLength = edge.getLengthSQ(); - edgeDotVelocity = edge.dotProduct(velocity); - edgeDotBaseToVertex = edge.dotProduct(baseToVertex); - - // calculate parameters for equation - a = edgeSqaredLength* -velocitySqaredLength + - edgeDotVelocity*edgeDotVelocity; - b = edgeSqaredLength* (2*velocity.dotProduct(baseToVertex)) - - 2.0f*edgeDotVelocity*edgeDotBaseToVertex; - c = edgeSqaredLength* (1-baseToVertex.getLengthSQ()) + - edgeDotBaseToVertex*edgeDotBaseToVertex; - - // does the swept sphere collide against infinite edge? - if (getLowestRoot(a,b,c,t,&newT)) - { - f32 f = (edgeDotVelocity*newT-edgeDotBaseToVertex) / - edgeSqaredLength; - if (f >=0.0f && f <= 1.0f) - { - // intersection took place within segment - t = newT; - foundCollision = true; - collisionPoint = triangle.pointC + (edge*f); - } - } - }// end no collision found - - // set result: - if (foundCollision) - { - ++colData->triangleHits; - - // distance to collision is t - f32 distToCollision = t*colData->velocity.getLength(); - - // does this triangle qualify for closest hit? - if (!colData->foundCollision || - distToCollision < colData->nearestDistance) - { - colData->nearestDistance = distToCollision; - colData->intersectionPoint = collisionPoint; - colData->foundCollision = true; - colData->intersectionTriangle = triangle; - return true; - } - }// end found collision - - return false; -} - - -//! Collides a moving ellipsoid with a 3d world with gravity and returns -//! the resulting new position of the ellipsoid. -core::vector3df CSceneCollisionManager::collideEllipsoidWithWorld( - ITriangleSelector* selector, const core::vector3df &position, - const core::vector3df& radius, const core::vector3df& velocity, - f32 slidingSpeed, - const core::vector3df& gravity, - core::triangle3df& triout, - core::vector3df& hitPosition, - bool& outFalling, - ISceneNode*& outNode) -{ - if (!selector || radius.X == 0.0f || radius.Y == 0.0f || radius.Z == 0.0f) - return position; - - // This code is based on the paper "Improved Collision detection and Response" - // by Kasper Fauerby, but some parts are modified. - - SCollisionData colData; - colData.R3Position = position; - colData.R3Velocity = velocity; - colData.eRadius = radius; - colData.nearestDistance = FLT_MAX; - colData.selector = selector; - colData.slidingSpeed = slidingSpeed; - colData.triangleHits = 0; - colData.node = 0; - - core::vector3df eSpacePosition = colData.R3Position / colData.eRadius; - core::vector3df eSpaceVelocity = colData.R3Velocity / colData.eRadius; - - // iterate until we have our final position - - core::vector3df finalPos = collideWithWorld( - 0, colData, eSpacePosition, eSpaceVelocity); - - outFalling = false; - - // add gravity - - if (gravity != core::vector3df(0,0,0)) - { - colData.R3Position = finalPos * colData.eRadius; - colData.R3Velocity = gravity; - colData.triangleHits = 0; - - eSpaceVelocity = gravity/colData.eRadius; - - finalPos = collideWithWorld(0, colData, - finalPos, eSpaceVelocity); - - outFalling = (colData.triangleHits == 0); - } - - if (colData.triangleHits) - { - triout = colData.intersectionTriangle; - triout.pointA *= colData.eRadius; - triout.pointB *= colData.eRadius; - triout.pointC *= colData.eRadius; - outNode = colData.node; - } - - finalPos *= colData.eRadius; - hitPosition = colData.intersectionPoint * colData.eRadius; - return finalPos; -} - - -core::vector3df CSceneCollisionManager::collideWithWorld(s32 recursionDepth, - SCollisionData &colData, const core::vector3df& pos, const core::vector3df& vel) -{ - f32 veryCloseDistance = colData.slidingSpeed; - - if (recursionDepth > 5) - return pos; - - colData.velocity = vel; - colData.normalizedVelocity = vel; - colData.normalizedVelocity.normalize(); - colData.basePoint = pos; - colData.foundCollision = false; - colData.nearestDistance = FLT_MAX; - - //------------------ collide with world - - // get all triangles with which we might collide - core::aabbox3d<f32> box(colData.R3Position); - box.addInternalPoint(colData.R3Position + colData.R3Velocity); - box.MinEdge -= colData.eRadius; - box.MaxEdge += colData.eRadius; - - s32 totalTriangleCnt = colData.selector->getTriangleCount(); - Triangles.set_used(totalTriangleCnt); - - core::matrix4 scaleMatrix; - scaleMatrix.setScale( - core::vector3df(1.0f / colData.eRadius.X, - 1.0f / colData.eRadius.Y, - 1.0f / colData.eRadius.Z)); - - irr::core::array<SCollisionTriangleRange> outTriangleInfo; - s32 triangleCnt = 0; - colData.selector->getTriangles(Triangles.pointer(), totalTriangleCnt, triangleCnt, box, &scaleMatrix, true, &outTriangleInfo); - - // Find closest intersection - irr::s32 nearestTriangleIndex = -1; - for (s32 i=0; i<triangleCnt; ++i) - { - if(testTriangleIntersection(&colData, Triangles[i])) - { - nearestTriangleIndex = i; - } - } - if ( nearestTriangleIndex >= 0 ) - { - for ( irr::u32 t=0; t<outTriangleInfo.size(); ++t ) - { - if ( outTriangleInfo[t].isIndexInRange(nearestTriangleIndex) ) - { - colData.node = outTriangleInfo[t].SceneNode; - break; - } - } - } - - //---------------- end collide with world - - if (!colData.foundCollision) - return pos + vel; - - // original destination point - const core::vector3df destinationPoint = pos + vel; - core::vector3df newBasePoint = pos; - - // only update if we are not already very close - // and if so only move very close to intersection, not to the - // exact point - if (colData.nearestDistance >= veryCloseDistance) - { - core::vector3df v = vel; - v.setLength( colData.nearestDistance - veryCloseDistance ); - newBasePoint = colData.basePoint + v; - - v.normalize(); - colData.intersectionPoint -= (v * veryCloseDistance); - } - - // calculate sliding plane - - const core::vector3df slidePlaneOrigin = colData.intersectionPoint; - const core::vector3df slidePlaneNormal = (newBasePoint - colData.intersectionPoint).normalize(); - core::plane3d<f32> slidingPlane(slidePlaneOrigin, slidePlaneNormal); - - core::vector3df newDestinationPoint = - destinationPoint - - (slidePlaneNormal * slidingPlane.getDistanceTo(destinationPoint)); - - // generate slide vector - - const core::vector3df newVelocityVector = newDestinationPoint - - colData.intersectionPoint; - - if (newVelocityVector.getLength() < veryCloseDistance) - return newBasePoint; - - return collideWithWorld(recursionDepth+1, colData, - newBasePoint, newVelocityVector); -} - - -//! Returns a 3d ray which would go through the 2d screen coordinates. -core::line3d<f32> CSceneCollisionManager::getRayFromScreenCoordinates( - const core::position2d<s32> & pos, const ICameraSceneNode* camera) -{ - core::line3d<f32> ln(0,0,0,0,0,0); - - if (!SceneManager) - return ln; - - if (!camera) - camera = SceneManager->getActiveCamera(); - - if (!camera) - return ln; - - const scene::SViewFrustum* f = camera->getViewFrustum(); - - core::vector3df farLeftUp = f->getFarLeftUp(); - core::vector3df lefttoright = f->getFarRightUp() - farLeftUp; - core::vector3df uptodown = f->getFarLeftDown() - farLeftUp; - - const core::rect<s32>& viewPort = Driver->getViewPort(); - core::dimension2d<u32> screenSize(viewPort.getWidth(), viewPort.getHeight()); - - f32 dx = pos.X / (f32)screenSize.Width; - f32 dy = pos.Y / (f32)screenSize.Height; - - if (camera->isOrthogonal()) - ln.start = f->cameraPosition + (lefttoright * (dx-0.5f)) + (uptodown * (dy-0.5f)); - else - ln.start = f->cameraPosition; - - ln.end = farLeftUp + (lefttoright * dx) + (uptodown * dy); - - return ln; -} - - -//! Calculates 2d screen position from a 3d position. -core::position2d<s32> CSceneCollisionManager::getScreenCoordinatesFrom3DPosition( - const core::vector3df & pos3d, const ICameraSceneNode* camera, bool useViewPort) -{ - if (!SceneManager || !Driver) - return core::position2d<s32>(-1000,-1000); - - if (!camera) - camera = SceneManager->getActiveCamera(); - - if (!camera) - return core::position2d<s32>(-1000,-1000); - - core::dimension2d<u32> dim; - if (useViewPort) - dim.set(Driver->getViewPort().getWidth(), Driver->getViewPort().getHeight()); - else - dim=(Driver->getCurrentRenderTargetSize()); - - dim.Width /= 2; - dim.Height /= 2; - - core::matrix4 trans = camera->getProjectionMatrix(); - trans *= camera->getViewMatrix(); - - f32 transformedPos[4] = { pos3d.X, pos3d.Y, pos3d.Z, 1.0f }; - - trans.multiplyWith1x4Matrix(transformedPos); - - if (transformedPos[3] < 0) - return core::position2d<s32>(-10000,-10000); - - const f32 zDiv = transformedPos[3] == 0.0f ? 1.0f : - core::reciprocal(transformedPos[3]); - - return core::position2d<s32>( - dim.Width + core::round32(dim.Width * (transformedPos[0] * zDiv)), - dim.Height - core::round32(dim.Height * (transformedPos[1] * zDiv))); -} - - -inline bool CSceneCollisionManager::getLowestRoot(f32 a, f32 b, f32 c, f32 maxR, f32* root) const -{ - // check if solution exists - const f32 determinant = b*b - 4.0f*a*c; - - // if determinant is negative, no solution - if (determinant < 0.0f || a == 0.f ) - return false; - - // calculate two roots: (if det==0 then x1==x2 - // but lets disregard that slight optimization) - - const f32 sqrtD = sqrtf(determinant); - const f32 invDA = core::reciprocal(2*a); - f32 r1 = (-b - sqrtD) * invDA; - f32 r2 = (-b + sqrtD) * invDA; - - // sort so x1 <= x2 - if (r1 > r2) - core::swap(r1,r2); - - // get lowest root - if (r1 > 0 && r1 < maxR) - { - *root = r1; - return true; - } - - // its possible that we want x2, this can happen if x1 < 0 - if (r2 > 0 && r2 < maxR) - { - *root = r2; - return true; - } - - return false; -} - - -} // end namespace scene -} // end namespace irr - diff --git a/source/Irrlicht/CSceneCollisionManager.h b/source/Irrlicht/CSceneCollisionManager.h deleted file mode 100644 index 93d0d277..00000000 --- a/source/Irrlicht/CSceneCollisionManager.h +++ /dev/null @@ -1,153 +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_SCENE_COLLISION_MANAGER_H_INCLUDED__ -#define __C_SCENE_COLLISION_MANAGER_H_INCLUDED__ - -#include "ISceneCollisionManager.h" -#include "ISceneManager.h" -#include "IVideoDriver.h" - -namespace irr -{ -namespace scene -{ - - //! The Scene Collision Manager provides methods for performing collision tests and picking on scene nodes. - class CSceneCollisionManager : public ISceneCollisionManager - { - public: - - //! constructor - CSceneCollisionManager(ISceneManager* smanager, video::IVideoDriver* driver); - - //! destructor - virtual ~CSceneCollisionManager(); - - //! Returns the scene node, which is currently visible at the given - //! screen coordinates, viewed from the currently active camera. - virtual ISceneNode* getSceneNodeFromScreenCoordinatesBB(const core::position2d<s32>& pos, - s32 idBitMask=0, bool bNoDebugObjects=false, ISceneNode* root=0) _IRR_OVERRIDE_; - - //! Returns the nearest scene node which collides with a 3d ray and - //! whose id matches a bitmask. - virtual ISceneNode* getSceneNodeFromRayBB(const core::line3d<f32>& ray, - s32 idBitMask=0, bool bNoDebugObjects=false, - ISceneNode* root=0) _IRR_OVERRIDE_; - - //! Returns the scene node, at which the given camera is looking at and - //! which id matches the bitmask. - virtual ISceneNode* getSceneNodeFromCameraBB(const ICameraSceneNode* camera, - s32 idBitMask=0, bool bNoDebugObjects = false) _IRR_OVERRIDE_; - - //! Finds the nearest collision point of a line and lots of triangles, if there is one. - virtual bool getCollisionPoint(SCollisionHit& hitResult, const core::line3d<f32>& ray, - ITriangleSelector* selector) _IRR_OVERRIDE_; - - //! Collides a moving ellipsoid with a 3d world with gravity and returns - //! the resulting new position of the ellipsoid. - virtual core::vector3df getCollisionResultPosition( - ITriangleSelector* selector, - const core::vector3df &ellipsoidPosition, - const core::vector3df& ellipsoidRadius, - const core::vector3df& ellipsoidDirectionAndSpeed, - core::triangle3df& triout, - core::vector3df& hitPosition, - bool& outFalling, - ISceneNode*& outNode, - f32 slidingSpeed, - const core::vector3df& gravityDirectionAndSpeed) _IRR_OVERRIDE_; - - //! Returns a 3d ray which would go through the 2d screen coordinates. - virtual core::line3d<f32> getRayFromScreenCoordinates( - const core::position2d<s32> & pos, const ICameraSceneNode* camera = 0) _IRR_OVERRIDE_; - - //! Calculates 2d screen position from a 3d position. - virtual core::position2d<s32> getScreenCoordinatesFrom3DPosition( - const core::vector3df & pos, const ICameraSceneNode* camera=0, bool useViewPort=false) _IRR_OVERRIDE_; - - //! Gets the scene node and nearest collision point for a ray based on - //! the nodes' id bitmasks, bounding boxes and triangle selectors. - virtual ISceneNode* getSceneNodeAndCollisionPointFromRay( - SCollisionHit& hitResult, - const core::line3df& ray, - s32 idBitMask = 0, - ISceneNode * collisionRootNode = 0, - bool noDebugObjects = false) _IRR_OVERRIDE_; - - private: - - //! recursive method for going through all scene nodes - void getPickedNodeBB(ISceneNode* root, core::line3df& ray, s32 bits, - bool bNoDebugObjects, - f32& outbestdistance, ISceneNode*& outbestnode); - - //! recursive method for going through all scene nodes - void getPickedNodeFromBBAndSelector( - SCollisionHit& hitResult, - ISceneNode * root, - core::line3df & ray, - s32 bits, - bool noDebugObjects, - f32 & outBestDistanceSquared); - - - struct SCollisionData - { - core::vector3df eRadius; - - core::vector3df R3Velocity; - core::vector3df R3Position; - - core::vector3df velocity; - core::vector3df normalizedVelocity; - core::vector3df basePoint; - - bool foundCollision; - f32 nearestDistance; - core::vector3df intersectionPoint; - - core::triangle3df intersectionTriangle; - irr::scene::ISceneNode* node; - s32 triangleHits; - - f32 slidingSpeed; - - ITriangleSelector* selector; - }; - - //! Tests the current collision data against an individual triangle. - /** - \param colData: the collision data. - \param triangle: the triangle to test against. - \return true if the triangle is hit (and is the closest hit), false otherwise */ - bool testTriangleIntersection(SCollisionData* colData, - const core::triangle3df& triangle); - - //! recursive method for doing collision response - core::vector3df collideEllipsoidWithWorld(ITriangleSelector* selector, - const core::vector3df &position, - const core::vector3df& radius, const core::vector3df& velocity, - f32 slidingSpeed, - const core::vector3df& gravity, core::triangle3df& triout, - core::vector3df& hitPosition, - bool& outFalling, - ISceneNode*& outNode); - - core::vector3df collideWithWorld(s32 recursionDepth, SCollisionData &colData, - const core::vector3df& pos, const core::vector3df& vel); - - inline bool getLowestRoot(f32 a, f32 b, f32 c, f32 maxR, f32* root) const; - - ISceneManager* SceneManager; - video::IVideoDriver* Driver; - core::array<core::triangle3df> Triangles; // triangle buffer - }; - - -} // end namespace scene -} // end namespace irr - -#endif - diff --git a/source/Irrlicht/CSceneManager.cpp b/source/Irrlicht/CSceneManager.cpp index 70cb19c0..cf8749d7 100644 --- a/source/Irrlicht/CSceneManager.cpp +++ b/source/Irrlicht/CSceneManager.cpp @@ -25,165 +25,29 @@ #include "CSkinnedMesh.h" #endif -#ifdef _IRR_COMPILE_WITH_BSP_LOADER_ -#include "CBSPMeshFileLoader.h" -#endif - -#ifdef _IRR_COMPILE_WITH_MD2_LOADER_ -#include "CMD2MeshFileLoader.h" -#endif - -#ifdef _IRR_COMPILE_WITH_HALFLIFE_LOADER_ -#include "CAnimatedMeshHalfLife.h" -#endif - -#ifdef _IRR_COMPILE_WITH_MS3D_LOADER_ -#include "CMS3DMeshFileLoader.h" -#endif - -#ifdef _IRR_COMPILE_WITH_3DS_LOADER_ -#include "C3DSMeshFileLoader.h" -#endif - #ifdef _IRR_COMPILE_WITH_X_LOADER_ #include "CXMeshFileLoader.h" #endif -#ifdef _IRR_COMPILE_WITH_OCT_LOADER_ -#include "COCTLoader.h" -#endif - -#ifdef _IRR_COMPILE_WITH_CSM_LOADER_ -#include "CCSMLoader.h" -#endif - -#ifdef _IRR_COMPILE_WITH_LMTS_LOADER_ -#include "CLMTSMeshFileLoader.h" -#endif - -#ifdef _IRR_COMPILE_WITH_MY3D_LOADER_ -#include "CMY3DMeshFileLoader.h" -#endif - -#ifdef _IRR_COMPILE_WITH_DMF_LOADER_ -#include "CDMFLoader.h" -#endif - -#ifdef _IRR_COMPILE_WITH_OGRE_LOADER_ -#include "COgreMeshFileLoader.h" -#endif - #ifdef _IRR_COMPILE_WITH_OBJ_LOADER_ #include "COBJMeshFileLoader.h" #endif -#ifdef _IRR_COMPILE_WITH_MD3_LOADER_ -#include "CMD3MeshFileLoader.h" -#endif - #ifdef _IRR_COMPILE_WITH_B3D_LOADER_ #include "CB3DMeshFileLoader.h" #endif -#ifdef _IRR_COMPILE_WITH_LWO_LOADER_ -#include "CLWOMeshFileLoader.h" -#endif - -#ifdef _IRR_COMPILE_WITH_STL_LOADER_ -#include "CSTLMeshFileLoader.h" -#endif - -#ifdef _IRR_COMPILE_WITH_PLY_LOADER_ -#include "CPLYMeshFileLoader.h" -#endif - -#ifdef _IRR_COMPILE_WITH_SMF_LOADER_ -#include "CSMFMeshFileLoader.h" -#endif - -#ifdef _IRR_COMPILE_WITH_STL_WRITER_ -#include "CSTLMeshWriter.h" -#endif - -#ifdef _IRR_COMPILE_WITH_OBJ_WRITER_ -#include "COBJMeshWriter.h" -#endif - -#ifdef _IRR_COMPILE_WITH_PLY_WRITER_ -#include "CPLYMeshWriter.h" -#endif - -#ifdef _IRR_COMPILE_WITH_B3D_WRITER_ -#include "CB3DMeshWriter.h" -#endif - -#ifdef _IRR_COMPILE_WITH_CUBE_SCENENODE_ -#include "CCubeSceneNode.h" -#endif // _IRR_COMPILE_WITH_CUBE_SCENENODE_ -#ifdef _IRR_COMPILE_WITH_SPHERE_SCENENODE_ -#include "CSphereSceneNode.h" -#endif -#include "CAnimatedMeshSceneNode.h" -#ifdef _IRR_COMPILE_WITH_OCTREE_SCENENODE_ -#include "COctreeSceneNode.h" -#endif // #ifdef _IRR_COMPILE_WITH_OCTREE_SCENENODE_ -#include "CCameraSceneNode.h" -#include "CLightSceneNode.h" #ifdef _IRR_COMPILE_WITH_BILLBOARD_SCENENODE_ #include "CBillboardSceneNode.h" #endif // _IRR_COMPILE_WITH_BILLBOARD_SCENENODE_ +#include "CAnimatedMeshSceneNode.h" +#include "CCameraSceneNode.h" #include "CMeshSceneNode.h" -#include "CSkyBoxSceneNode.h" -#ifdef _IRR_COMPILE_WITH_SKYDOME_SCENENODE_ -#include "CSkyDomeSceneNode.h" -#endif // _IRR_COMPILE_WITH_SKYDOME_SCENENODE_ - -#ifdef _IRR_COMPILE_WITH_SHADOW_VOLUME_SCENENODE_ -#include "CShadowVolumeSceneNode.h" -#else -#include "IShadowVolumeSceneNode.h" -#endif // _IRR_COMPILE_WITH_SHADOW_VOLUME_SCENENODE_ - -#ifdef _IRR_COMPILE_WITH_PARTICLES_ -#include "CParticleSystemSceneNode.h" -#endif // _IRR_COMPILE_WITH_PARTICLES_ - #include "CDummyTransformationSceneNode.h" -#ifdef _IRR_COMPILE_WITH_WATER_SURFACE_SCENENODE_ -#include "CWaterSurfaceSceneNode.h" -#endif // _IRR_COMPILE_WITH_WATER_SURFACE_SCENENODE_ -#ifdef _IRR_COMPILE_WITH_TERRAIN_SCENENODE_ -#include "CTerrainSceneNode.h" -#endif // _IRR_COMPILE_WITH_TERRAIN_SCENENODE_ #include "CEmptySceneNode.h" -#include "CTextSceneNode.h" -#include "CQuake3ShaderSceneNode.h" -#include "CVolumeLightSceneNode.h" #include "CDefaultSceneNodeFactory.h" -#include "CSceneCollisionManager.h" -#include "CTriangleSelector.h" -#include "COctreeTriangleSelector.h" -#include "CTriangleBBSelector.h" -#include "CMetaTriangleSelector.h" -#ifdef _IRR_COMPILE_WITH_TERRAIN_SCENENODE_ -#include "CTerrainTriangleSelector.h" -#endif // _IRR_COMPILE_WITH_TERRAIN_SCENENODE_ - -#include "CSceneNodeAnimatorRotation.h" -#include "CSceneNodeAnimatorFlyCircle.h" -#include "CSceneNodeAnimatorFlyStraight.h" -#include "CSceneNodeAnimatorTexture.h" -#include "CSceneNodeAnimatorCollisionResponse.h" -#include "CSceneNodeAnimatorDelete.h" -#include "CSceneNodeAnimatorFollowSpline.h" -#include "CSceneNodeAnimatorCameraFPS.h" -#include "CSceneNodeAnimatorCameraMaya.h" -#include "CDefaultSceneNodeAnimatorFactory.h" - -#include "CGeometryCreator.h" - #include <locale.h> namespace irr @@ -196,9 +60,9 @@ CSceneManager::CSceneManager(video::IVideoDriver* driver, io::IFileSystem* fs, gui::ICursorControl* cursorControl, IMeshCache* cache, gui::IGUIEnvironment* gui) : ISceneNode(0, 0), Driver(driver), FileSystem(fs), GUIEnvironment(gui), - CursorControl(cursorControl), CollisionManager(0), + CursorControl(cursorControl), 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) { #ifdef _DEBUG ISceneManager::setDebugName("CSceneManager ISceneManager"); @@ -231,69 +95,15 @@ CSceneManager::CSceneManager(video::IVideoDriver* driver, io::IFileSystem* fs, Parameters->setAttribute(DEBUG_NORMAL_LENGTH, 1.f); Parameters->setAttribute(DEBUG_NORMAL_COLOR, video::SColor(255, 34, 221, 221)); - // create collision manager - CollisionManager = new CSceneCollisionManager(this, Driver); - - // create geometry creator - GeometryCreator = new CGeometryCreator(); - // add file format loaders. add the least commonly used ones first, // as these are checked last // TODO: now that we have multiple scene managers, these should be // shallow copies from the previous manager if there is one. - #ifdef _IRR_COMPILE_WITH_STL_LOADER_ - MeshLoaderList.push_back(new CSTLMeshFileLoader()); - #endif - #ifdef _IRR_COMPILE_WITH_PLY_LOADER_ - MeshLoaderList.push_back(new CPLYMeshFileLoader(this)); - #endif - #ifdef _IRR_COMPILE_WITH_SMF_LOADER_ - MeshLoaderList.push_back(new CSMFMeshFileLoader(FileSystem, Driver)); - #endif - #ifdef _IRR_COMPILE_WITH_OCT_LOADER_ - MeshLoaderList.push_back(new COCTLoader(this, FileSystem)); - #endif - #ifdef _IRR_COMPILE_WITH_CSM_LOADER_ - MeshLoaderList.push_back(new CCSMLoader(this, FileSystem)); - #endif - #ifdef _IRR_COMPILE_WITH_LMTS_LOADER_ - MeshLoaderList.push_back(new CLMTSMeshFileLoader(FileSystem, Driver, Parameters)); - #endif - #ifdef _IRR_COMPILE_WITH_MY3D_LOADER_ - MeshLoaderList.push_back(new CMY3DMeshFileLoader(this, FileSystem)); - #endif - #ifdef _IRR_COMPILE_WITH_DMF_LOADER_ - MeshLoaderList.push_back(new CDMFLoader(this, FileSystem)); - #endif - #ifdef _IRR_COMPILE_WITH_OGRE_LOADER_ - MeshLoaderList.push_back(new COgreMeshFileLoader(FileSystem, Driver)); - #endif - #ifdef _IRR_COMPILE_WITH_HALFLIFE_LOADER_ - MeshLoaderList.push_back(new CHalflifeMDLMeshFileLoader( this )); - #endif - #ifdef _IRR_COMPILE_WITH_MD3_LOADER_ - MeshLoaderList.push_back(new CMD3MeshFileLoader( this)); - #endif - #ifdef _IRR_COMPILE_WITH_LWO_LOADER_ - MeshLoaderList.push_back(new CLWOMeshFileLoader(this, FileSystem)); - #endif - #ifdef _IRR_COMPILE_WITH_MD2_LOADER_ - MeshLoaderList.push_back(new CMD2MeshFileLoader()); - #endif - #ifdef _IRR_COMPILE_WITH_BSP_LOADER_ - MeshLoaderList.push_back(new CBSPMeshFileLoader(this, FileSystem)); - #endif - #ifdef _IRR_COMPILE_WITH_3DS_LOADER_ - MeshLoaderList.push_back(new C3DSMeshFileLoader(this, FileSystem)); - #endif #ifdef _IRR_COMPILE_WITH_X_LOADER_ MeshLoaderList.push_back(new CXMeshFileLoader(this, FileSystem)); #endif - #ifdef _IRR_COMPILE_WITH_MS3D_LOADER_ - MeshLoaderList.push_back(new CMS3DMeshFileLoader(Driver)); - #endif #ifdef _IRR_COMPILE_WITH_OBJ_LOADER_ MeshLoaderList.push_back(new COBJMeshFileLoader(this, FileSystem)); #endif @@ -306,10 +116,6 @@ CSceneManager::CSceneManager(video::IVideoDriver* driver, io::IFileSystem* fs, registerSceneNodeFactory(factory); factory->drop(); - ISceneNodeAnimatorFactory* animatorFactory = new CDefaultSceneNodeAnimatorFactory(this, CursorControl); - registerSceneNodeAnimatorFactory(animatorFactory); - animatorFactory->drop(); - IRR_PROFILE( static bool initProfile = false; if (!initProfile ) @@ -348,12 +154,6 @@ CSceneManager::~CSceneManager() if (CursorControl) CursorControl->drop(); - if (CollisionManager) - CollisionManager->drop(); - - if (GeometryCreator) - GeometryCreator->drop(); - if (GUIEnvironment) GUIEnvironment->drop(); @@ -377,17 +177,10 @@ CSceneManager::~CSceneManager() for (i=0; i<SceneNodeFactoryList.size(); ++i) SceneNodeFactoryList[i]->drop(); - for (i=0; i<SceneNodeAnimatorFactoryList.size(); ++i) - SceneNodeAnimatorFactoryList[i]->drop(); - - if (LightManager) - LightManager->drop(); - - // remove all nodes and animators before dropping the driver + // remove all nodes before dropping the driver // as render targets may be destroyed twice removeAll(); - removeAnimators(); if (Driver) Driver->drop(); @@ -485,131 +278,6 @@ io::IFileSystem* CSceneManager::getFileSystem() return FileSystem; } -//! Adds a text scene node, which is able to display -//! 2d text at a position in three dimensional space -ITextSceneNode* CSceneManager::addTextSceneNode(gui::IGUIFont* font, - const wchar_t* text, video::SColor color, ISceneNode* parent, - const core::vector3df& position, s32 id) -{ - if (!font) - return 0; - - if (!parent) - parent = this; - - ITextSceneNode* t = new CTextSceneNode(parent, this, id, font, - getSceneCollisionManager(), position, text, color); - t->drop(); - - return t; -} - - -//! Adds a text scene node, which uses billboards -IBillboardTextSceneNode* CSceneManager::addBillboardTextSceneNode(gui::IGUIFont* font, - const wchar_t* text, ISceneNode* parent, - const core::dimension2d<f32>& size, - const core::vector3df& position, s32 id, - video::SColor colorTop, video::SColor colorBottom) -{ - if (!font && GUIEnvironment) - font = GUIEnvironment->getBuiltInFont(); - - if (!font) - return 0; - - if (!parent) - parent = this; - - IBillboardTextSceneNode* node = new CBillboardTextSceneNode(parent, this, id, font, text, position, size, - colorTop, colorBottom); - node->drop(); - - return node; - -} - - -//! Adds a scene node, which can render a quake3 shader -IMeshSceneNode* CSceneManager::addQuake3SceneNode(const IMeshBuffer* meshBuffer, - const quake3::IShader * shader, - ISceneNode* parent, s32 id ) -{ -#ifdef _IRR_COMPILE_WITH_BSP_LOADER_ - if (!shader) - return 0; - - if (!parent) - parent = this; - - CQuake3ShaderSceneNode* node = new CQuake3ShaderSceneNode( parent, - this, id, FileSystem, - meshBuffer, shader ); - node->drop(); - - return node; -#else - return 0; -#endif -} - - -//! adds Volume Lighting Scene Node. -//! the returned pointer must not be dropped. -IVolumeLightSceneNode* CSceneManager::addVolumeLightSceneNode( - ISceneNode* parent, s32 id, - const u32 subdivU, const u32 subdivV, - const video::SColor foot, const video::SColor tail, - const core::vector3df& position, const core::vector3df& rotation, const core::vector3df& scale) -{ - if (!parent) - parent = this; - - IVolumeLightSceneNode* node = new CVolumeLightSceneNode(parent, this, id, subdivU, subdivV, foot, tail, position, rotation, scale); - node->drop(); - - return node; -} - - -//! adds a test scene node for test purposes to the scene. It is a simple cube of (1,1,1) size. -//! the returned pointer must not be dropped. -IMeshSceneNode* CSceneManager::addCubeSceneNode(f32 size, ISceneNode* parent, - s32 id, const core::vector3df& position, - const core::vector3df& rotation, const core::vector3df& scale) -{ -#ifdef _IRR_COMPILE_WITH_CUBE_SCENENODE_ - if (!parent) - parent = this; - - IMeshSceneNode* node = new CCubeSceneNode(size, parent, this, id, position, rotation, scale); - node->drop(); - - return node; -#else - return 0; -#endif -} - - -//! Adds a sphere scene node for test purposes to the scene. -IMeshSceneNode* CSceneManager::addSphereSceneNode(f32 radius, s32 polyCount, - ISceneNode* parent, s32 id, const core::vector3df& position, - const core::vector3df& rotation, const core::vector3df& scale) -{ -#ifdef _IRR_COMPILE_WITH_SPHERE_SCENENODE_ - if (!parent) - parent = this; - - IMeshSceneNode* node = new CSphereSceneNode(radius, polyCount, polyCount, parent, this, id, position, rotation, scale); - node->drop(); - - return node; -#else - return 0; -#endif // _IRR_COMPILE_WITH_SPHERE_SCENENODE_ -} - //! adds a scene node for rendering a static mesh //! the returned pointer must not be dropped. @@ -630,27 +298,6 @@ IMeshSceneNode* CSceneManager::addMeshSceneNode(IMesh* mesh, ISceneNode* parent, } -//! Adds a scene node for rendering a animated water surface mesh. -ISceneNode* CSceneManager::addWaterSurfaceSceneNode(IMesh* mesh, f32 waveHeight, f32 waveSpeed, f32 waveLength, - ISceneNode* parent, s32 id, const core::vector3df& position, - const core::vector3df& rotation, const core::vector3df& scale) -{ -#ifdef _IRR_COMPILE_WITH_WATER_SURFACE_SCENENODE_ - if (!parent) - parent = this; - - ISceneNode* node = new CWaterSurfaceSceneNode(waveHeight, waveSpeed, waveLength, - mesh, parent, this, id, position, rotation, scale); - - node->drop(); - - return node; -#else - return 0; -#endif -} - - //! adds a scene node for rendering an animated mesh model IAnimatedMeshSceneNode* CSceneManager::addAnimatedMeshSceneNode(IAnimatedMesh* mesh, ISceneNode* parent, s32 id, const core::vector3df& position, const core::vector3df& rotation, @@ -670,49 +317,6 @@ IAnimatedMeshSceneNode* CSceneManager::addAnimatedMeshSceneNode(IAnimatedMesh* m } -//! Adds a scene node for rendering using a octree to the scene graph. This a good method for rendering -//! scenes with lots of geometry. The Octree is built on the fly from the mesh, much -//! faster then a bsp tree. -IOctreeSceneNode* CSceneManager::addOctreeSceneNode(IAnimatedMesh* mesh, ISceneNode* parent, - s32 id, s32 minimalPolysPerNode, bool alsoAddIfMeshPointerZero) -{ - if (!alsoAddIfMeshPointerZero && (!mesh || !mesh->getFrameCount())) - return 0; - - return addOctreeSceneNode(mesh ? mesh->getMesh(0) : 0, - parent, id, minimalPolysPerNode, - alsoAddIfMeshPointerZero); -} - - -//! Adds a scene node for rendering using a octree. This a good method for rendering -//! scenes with lots of geometry. The Octree is built on the fly from the mesh, much -//! faster then a bsp tree. -IOctreeSceneNode* CSceneManager::addOctreeSceneNode(IMesh* mesh, ISceneNode* parent, - s32 id, s32 minimalPolysPerNode, bool alsoAddIfMeshPointerZero) -{ -#ifdef _IRR_COMPILE_WITH_OCTREE_SCENENODE_ - if (!alsoAddIfMeshPointerZero && !mesh) - return 0; - - if (!parent) - parent = this; - - COctreeSceneNode* node = new COctreeSceneNode(parent, this, id, minimalPolysPerNode); - - if (node) - { - node->setMesh(mesh); - node->drop(); - } - - return node; -#else - return 0; -#endif -} - - //! Adds a camera scene node to the tree and sets it as active camera. //! \param position: Position of the space relative to its parent where the camera will be placed. //! \param lookat: Position where the camera will look at. Also known as target. @@ -736,69 +340,6 @@ ICameraSceneNode* CSceneManager::addCameraSceneNode(ISceneNode* parent, } -//! Adds a camera scene node which is able to be controlled with the mouse similar -//! to in the 3D Software Maya by Alias Wavefront. -//! The returned pointer must not be dropped. -ICameraSceneNode* CSceneManager::addCameraSceneNodeMaya(ISceneNode* parent, - f32 rotateSpeed, f32 zoomSpeed, f32 translationSpeed, s32 id, f32 distance, - bool makeActive) -{ - ICameraSceneNode* node = addCameraSceneNode(parent, core::vector3df(), - core::vector3df(0,0,100), id, makeActive); - if (node) - { - ISceneNodeAnimator* anm = new CSceneNodeAnimatorCameraMaya(CursorControl, - rotateSpeed, zoomSpeed, translationSpeed, distance); - - node->addAnimator(anm); - anm->drop(); - } - - return node; -} - - -//! Adds a camera scene node which is able to be controlled with the mouse and keys -//! like in most first person shooters (FPS): -ICameraSceneNode* CSceneManager::addCameraSceneNodeFPS(ISceneNode* parent, - f32 rotateSpeed, f32 moveSpeed, s32 id, SKeyMap* keyMapArray, - s32 keyMapSize, bool noVerticalMovement, f32 jumpSpeed, - bool invertMouseY, bool makeActive) -{ - ICameraSceneNode* node = addCameraSceneNode(parent, core::vector3df(), - core::vector3df(0,0,100), id, makeActive); - if (node) - { - ISceneNodeAnimator* anm = new CSceneNodeAnimatorCameraFPS(CursorControl, - rotateSpeed, moveSpeed, jumpSpeed, - keyMapArray, keyMapSize, noVerticalMovement, invertMouseY); - - // Bind the node's rotation to its target. This is consistent with 1.4.2 and below. - node->bindTargetAndRotation(true); - node->addAnimator(anm); - anm->drop(); - } - - return node; -} - - -//! Adds a dynamic light scene node. The light will cast dynamic light on all -//! other scene nodes in the scene, which have the material flag video::MTF_LIGHTING -//! turned on. (This is the default setting in most scene nodes). -ILightSceneNode* CSceneManager::addLightSceneNode(ISceneNode* parent, - const core::vector3df& position, video::SColorf color, f32 range, s32 id) -{ - if (!parent) - parent = this; - - ILightSceneNode* node = new CLightSceneNode(parent, this, id, position, color, range); - node->drop(); - - return node; -} - - //! Adds a billboard scene node to the scene. A billboard is like a 3d sprite: A 2d element, //! which always looks to the camera. It is usually used for things like explosions, fire, //! lensflares and things like that. @@ -822,138 +363,6 @@ IBillboardSceneNode* CSceneManager::addBillboardSceneNode(ISceneNode* parent, } -//! Adds a skybox scene node. A skybox is a big cube with 6 textures on it and -//! is drawn around the camera position. -ISceneNode* CSceneManager::addSkyBoxSceneNode(video::ITexture* top, video::ITexture* bottom, - video::ITexture* left, video::ITexture* right, video::ITexture* front, - video::ITexture* back, ISceneNode* parent, s32 id) -{ - if (!parent) - parent = this; - - ISceneNode* node = new CSkyBoxSceneNode(top, bottom, left, right, - front, back, parent, this, id); - - node->drop(); - return node; -} - - -//! Adds a skydome scene node. A skydome is a large (half-) sphere with a -//! panoramic texture on it and is drawn around the camera position. -ISceneNode* CSceneManager::addSkyDomeSceneNode(video::ITexture* texture, - u32 horiRes, u32 vertRes, f32 texturePercentage,f32 spherePercentage, f32 radius, - ISceneNode* parent, s32 id) -{ -#ifdef _IRR_COMPILE_WITH_SKYDOME_SCENENODE_ - if (!parent) - parent = this; - - ISceneNode* node = new CSkyDomeSceneNode(texture, horiRes, vertRes, - texturePercentage, spherePercentage, radius, parent, this, id); - - node->drop(); - return node; -#else - return 0; -#endif -} - - -//! Adds a particle system scene node. -IParticleSystemSceneNode* CSceneManager::addParticleSystemSceneNode( - bool withDefaultEmitter, ISceneNode* parent, s32 id, - const core::vector3df& position, const core::vector3df& rotation, - const core::vector3df& scale) -{ -#ifdef _IRR_COMPILE_WITH_PARTICLES_ - if (!parent) - parent = this; - - IParticleSystemSceneNode* node = new CParticleSystemSceneNode(withDefaultEmitter, - parent, this, id, position, rotation, scale); - node->drop(); - - return node; -#else - return 0; -#endif // _IRR_COMPILE_WITH_PARTICLES_ -} - - -//! Adds a terrain scene node to the scene graph. -ITerrainSceneNode* CSceneManager::addTerrainSceneNode( - const io::path& heightMapFileName, - ISceneNode* parent, s32 id, - const core::vector3df& position, - const core::vector3df& rotation, - const core::vector3df& scale, - video::SColor vertexColor, - s32 maxLOD, E_TERRAIN_PATCH_SIZE patchSize, s32 smoothFactor, - bool addAlsoIfHeightmapEmpty) -{ - io::IReadFile* file = FileSystem->createAndOpenFile(heightMapFileName); - - if (!file && !addAlsoIfHeightmapEmpty) - { - os::Printer::log("Could not load terrain, because file could not be opened.", - heightMapFileName, ELL_ERROR); - return 0; - } - - ITerrainSceneNode* terrain = addTerrainSceneNode(file, parent, id, - position, rotation, scale, vertexColor, maxLOD, patchSize, - smoothFactor, addAlsoIfHeightmapEmpty); - - if (file) - file->drop(); - - return terrain; -} - -//! Adds a terrain scene node to the scene graph. -ITerrainSceneNode* CSceneManager::addTerrainSceneNode( - io::IReadFile* heightMapFile, - ISceneNode* parent, s32 id, - const core::vector3df& position, - const core::vector3df& rotation, - const core::vector3df& scale, - video::SColor vertexColor, - s32 maxLOD, E_TERRAIN_PATCH_SIZE patchSize, - s32 smoothFactor, - bool addAlsoIfHeightmapEmpty) -{ -#ifdef _IRR_COMPILE_WITH_TERRAIN_SCENENODE_ - if (!parent) - parent = this; - - if (!heightMapFile && !addAlsoIfHeightmapEmpty) - { - os::Printer::log("Could not load terrain, because file could not be opened.", ELL_ERROR); - return 0; - } - - CTerrainSceneNode* node = new CTerrainSceneNode(parent, this, FileSystem, id, - maxLOD, patchSize, position, rotation, scale); - - if (!node->loadHeightMap(heightMapFile, vertexColor, smoothFactor)) - { - if (!addAlsoIfHeightmapEmpty) - { - node->remove(); - node->drop(); - return 0; - } - } - - node->drop(); - return node; -#else - return 0; -#endif // _IRR_COMPILE_WITH_TERRAIN_SCENENODE_ -} - - //! Adds an empty scene node. ISceneNode* CSceneManager::addEmptySceneNode(ISceneNode* parent, s32 id) { @@ -981,173 +390,6 @@ IDummyTransformationSceneNode* CSceneManager::addDummyTransformationSceneNode( return node; } -//! Adds a Hill Plane mesh to the mesh pool. The mesh is generated on the fly -//! and looks like a plane with some hills on it. You can specify how many hills -//! there should be on the plane and how high they should be. Also you must -//! specify a name for the mesh, because the mesh is added to the mesh pool, -//! and can be retrieved again using ISceneManager::getMesh with the name as -//! parameter. -IAnimatedMesh* CSceneManager::addHillPlaneMesh(const io::path& name, - const core::dimension2d<f32>& tileSize, - const core::dimension2d<u32>& tileCount, - video::SMaterial* material, f32 hillHeight, - const core::dimension2d<f32>& countHills, - const core::dimension2d<f32>& textureRepeatCount) -{ - if (MeshCache->isMeshLoaded(name)) - return MeshCache->getMeshByName(name); - - IMesh* mesh = GeometryCreator->createHillPlaneMesh(tileSize, - tileCount, material, hillHeight, countHills, - textureRepeatCount); - if (!mesh) - return 0; - - SAnimatedMesh* animatedMesh = new SAnimatedMesh(); - if (!animatedMesh) - { - mesh->drop(); - return 0; - } - - animatedMesh->addMesh(mesh); - mesh->drop(); - animatedMesh->recalculateBoundingBox(); - - MeshCache->addMesh(name, animatedMesh); - animatedMesh->drop(); - - return animatedMesh; -} - - -//! Adds a terrain mesh to the mesh pool. -IAnimatedMesh* CSceneManager::addTerrainMesh(const io::path& name, - video::IImage* texture, video::IImage* heightmap, - const core::dimension2d<f32>& stretchSize, - f32 maxHeight, - const core::dimension2d<u32>& defaultVertexBlockSize) -{ - if (MeshCache->isMeshLoaded(name)) - return MeshCache->getMeshByName(name); - - const bool debugBorders=false; - IMesh* mesh = GeometryCreator->createTerrainMesh(texture, heightmap, - stretchSize, maxHeight, Driver, - defaultVertexBlockSize, debugBorders); - if (!mesh) - return 0; - - SAnimatedMesh* animatedMesh = new SAnimatedMesh(); - if (!animatedMesh) - { - mesh->drop(); - return 0; - } - - animatedMesh->addMesh(mesh); - mesh->drop(); - animatedMesh->recalculateBoundingBox(); - - MeshCache->addMesh(name, animatedMesh); - animatedMesh->drop(); - - return animatedMesh; -} - - -//! Adds an arrow mesh to the mesh pool. -IAnimatedMesh* CSceneManager::addArrowMesh(const io::path& name, - video::SColor vtxColor0, video::SColor vtxColor1, - u32 tesselationCylinder, u32 tesselationCone, f32 height, - f32 cylinderHeight, f32 width0,f32 width1) -{ - if (MeshCache->isMeshLoaded(name)) - return MeshCache->getMeshByName(name); - - IMesh* mesh = GeometryCreator->createArrowMesh( tesselationCylinder, - tesselationCone, height, cylinderHeight, width0,width1, - vtxColor0, vtxColor1); - if (!mesh) - return 0; - - SAnimatedMesh* animatedMesh = new SAnimatedMesh(); - if (!animatedMesh) - { - mesh->drop(); - return 0; - } - - animatedMesh->addMesh(mesh); - mesh->drop(); - animatedMesh->recalculateBoundingBox(); - - MeshCache->addMesh(name, animatedMesh); - animatedMesh->drop(); - - return animatedMesh; -} - - -//! Adds a static sphere mesh to the mesh pool. -IAnimatedMesh* CSceneManager::addSphereMesh(const io::path& name, - f32 radius, u32 polyCountX, u32 polyCountY) -{ - if (MeshCache->isMeshLoaded(name)) - return MeshCache->getMeshByName(name); - - IMesh* mesh = GeometryCreator->createSphereMesh(radius, polyCountX, polyCountY); - if (!mesh) - return 0; - - SAnimatedMesh* animatedMesh = new SAnimatedMesh(); - if (!animatedMesh) - { - mesh->drop(); - return 0; - } - - animatedMesh->addMesh(mesh); - mesh->drop(); - animatedMesh->recalculateBoundingBox(); - - MeshCache->addMesh(name, animatedMesh); - animatedMesh->drop(); - - return animatedMesh; -} - - - -//! Adds a static volume light mesh to the mesh pool. -IAnimatedMesh* CSceneManager::addVolumeLightMesh(const io::path& name, - const u32 SubdivideU, const u32 SubdivideV, - const video::SColor FootColor, const video::SColor TailColor) -{ - if (MeshCache->isMeshLoaded(name)) - return MeshCache->getMeshByName(name); - - IMesh* mesh = GeometryCreator->createVolumeLightMesh(SubdivideU, SubdivideV, FootColor, TailColor); - if (!mesh) - return 0; - - SAnimatedMesh* animatedMesh = new SAnimatedMesh(); - if (!animatedMesh) - { - mesh->drop(); - return 0; - } - - animatedMesh->addMesh(mesh); - mesh->drop(); - animatedMesh->recalculateBoundingBox(); - - MeshCache->addMesh(name, animatedMesh); - animatedMesh->drop(); - - return animatedMesh; -} - //! Returns the root scene node. This is the scene node which is parent //! of all scene nodes. The root scene node is a special scene node which @@ -1301,17 +543,6 @@ u32 CSceneManager::registerNodeForRendering(ISceneNode* node, E_SCENE_NODE_RENDE } } break; - - case ESNRP_LIGHT: - // TODO: Point Light culling.. - // Lighting model in irrlicht has to be redone.. - //if (!isCulled(node)) - { - LightList.push_back(node); - taken = 1; - } - break; - case ESNRP_SKY_BOX: SkyBoxList.push_back(node); taken = 1; @@ -1363,14 +594,6 @@ u32 CSceneManager::registerNodeForRendering(ISceneNode* node, E_SCENE_NODE_RENDE } } break; - case ESNRP_SHADOW: - if (!isCulled(node)) - { - ShadowNodeList.push_back(node); - taken = 1; - } - break; - case ESNRP_GUI: if (!isCulled(node)) { @@ -1399,12 +622,10 @@ u32 CSceneManager::registerNodeForRendering(ISceneNode* node, E_SCENE_NODE_RENDE void CSceneManager::clearAllRegisteredNodesForRendering() { CameraList.clear(); - LightList.clear(); SkyBoxList.clear(); SolidNodeList.clear(); TransparentNodeList.clear(); TransparentEffectNodeList.clear(); - ShadowNodeList.clear(); GuiNodeList.clear(); } @@ -1459,102 +680,30 @@ void CSceneManager::drawAll() // let all nodes register themselves OnRegisterSceneNode(); - if (LightManager) - LightManager->OnPreRender(LightList); - //render camera scenes { IRR_PROFILE(CProfileScope psCam(EPID_SM_RENDER_CAMERAS);) CurrentRenderPass = ESNRP_CAMERA; Driver->getOverrideMaterial().Enabled = ((Driver->getOverrideMaterial().EnablePasses & CurrentRenderPass) != 0); - if (LightManager) - LightManager->OnRenderPassPreRender(CurrentRenderPass); - for (i=0; i<CameraList.size(); ++i) CameraList[i]->render(); CameraList.set_used(0); - - if (LightManager) - LightManager->OnRenderPassPostRender(CurrentRenderPass); } - - //render lights scenes - { - IRR_PROFILE(CProfileScope psLights(EPID_SM_RENDER_LIGHTS);) - CurrentRenderPass = ESNRP_LIGHT; - Driver->getOverrideMaterial().Enabled = ((Driver->getOverrideMaterial().EnablePasses & CurrentRenderPass) != 0); - - if (LightManager) - { - LightManager->OnRenderPassPreRender(CurrentRenderPass); - } - else - { - // Sort the lights by distance from the camera - core::vector3df camWorldPos(0, 0, 0); - if (ActiveCamera) - camWorldPos = ActiveCamera->getAbsolutePosition(); - - core::array<DistanceNodeEntry> SortedLights; - SortedLights.set_used(LightList.size()); - for (s32 light = (s32)LightList.size() - 1; light >= 0; --light) - SortedLights[light].setNodeAndDistanceFromPosition(LightList[light], camWorldPos); - - SortedLights.set_sorted(false); - SortedLights.sort(); - - for(s32 light = (s32)LightList.size() - 1; light >= 0; --light) - LightList[light] = SortedLights[light].Node; - } - - Driver->deleteAllDynamicLights(); - - Driver->setAmbientLight(AmbientLight); - - u32 maxLights = LightList.size(); - - if (!LightManager) - maxLights = core::min_ ( Driver->getMaximalDynamicLightAmount(), maxLights); - - for (i=0; i< maxLights; ++i) - LightList[i]->render(); - - if (LightManager) - LightManager->OnRenderPassPostRender(CurrentRenderPass); - } - + // render skyboxes { IRR_PROFILE(CProfileScope psSkyBox(EPID_SM_RENDER_SKYBOXES);) CurrentRenderPass = ESNRP_SKY_BOX; Driver->getOverrideMaterial().Enabled = ((Driver->getOverrideMaterial().EnablePasses & CurrentRenderPass) != 0); - if (LightManager) - { - LightManager->OnRenderPassPreRender(CurrentRenderPass); - for (i=0; i<SkyBoxList.size(); ++i) - { - ISceneNode* node = SkyBoxList[i]; - LightManager->OnNodePreRender(node); - node->render(); - LightManager->OnNodePostRender(node); - } - } - else - { - for (i=0; i<SkyBoxList.size(); ++i) - SkyBoxList[i]->render(); - } + for (i=0; i<SkyBoxList.size(); ++i) + SkyBoxList[i]->render(); SkyBoxList.set_used(0); - - if (LightManager) - LightManager->OnRenderPassPostRender(CurrentRenderPass); } - - + // render default objects { IRR_PROFILE(CProfileScope psDefault(EPID_SM_RENDER_DEFAULT);) @@ -1563,63 +712,13 @@ void CSceneManager::drawAll() SolidNodeList.sort(); // sort by textures - if (LightManager) - { - LightManager->OnRenderPassPreRender(CurrentRenderPass); - for (i=0; i<SolidNodeList.size(); ++i) - { - ISceneNode* node = SolidNodeList[i].Node; - LightManager->OnNodePreRender(node); - node->render(); - LightManager->OnNodePostRender(node); - } - } - else - { - for (i=0; i<SolidNodeList.size(); ++i) - SolidNodeList[i].Node->render(); - } + for (i=0; i<SolidNodeList.size(); ++i) + SolidNodeList[i].Node->render(); #ifdef _IRR_SCENEMANAGER_DEBUG Parameters->setAttribute("drawn_solid", (s32) SolidNodeList.size() ); #endif SolidNodeList.set_used(0); - - if (LightManager) - LightManager->OnRenderPassPostRender(CurrentRenderPass); - } - - // render shadows - { - IRR_PROFILE(CProfileScope psShadow(EPID_SM_RENDER_SHADOWS);) - CurrentRenderPass = ESNRP_SHADOW; - Driver->getOverrideMaterial().Enabled = ((Driver->getOverrideMaterial().EnablePasses & CurrentRenderPass) != 0); - - if (LightManager) - { - LightManager->OnRenderPassPreRender(CurrentRenderPass); - for (i=0; i<ShadowNodeList.size(); ++i) - { - ISceneNode* node = ShadowNodeList[i]; - LightManager->OnNodePreRender(node); - node->render(); - LightManager->OnNodePostRender(node); - } - } - else - { - for (i=0; i<ShadowNodeList.size(); ++i) - ShadowNodeList[i]->render(); - } - - if (!ShadowNodeList.empty()) - Driver->drawStencilShadow(true,ShadowColor, ShadowColor, - ShadowColor, ShadowColor); - - ShadowNodeList.set_used(0); - - if (LightManager) - LightManager->OnRenderPassPostRender(CurrentRenderPass); } // render transparent objects. @@ -1629,31 +728,13 @@ void CSceneManager::drawAll() Driver->getOverrideMaterial().Enabled = ((Driver->getOverrideMaterial().EnablePasses & CurrentRenderPass) != 0); TransparentNodeList.sort(); // sort by distance from camera - if (LightManager) - { - LightManager->OnRenderPassPreRender(CurrentRenderPass); - - for (i=0; i<TransparentNodeList.size(); ++i) - { - ISceneNode* node = TransparentNodeList[i].Node; - LightManager->OnNodePreRender(node); - node->render(); - LightManager->OnNodePostRender(node); - } - } - else - { - for (i=0; i<TransparentNodeList.size(); ++i) - TransparentNodeList[i].Node->render(); - } + for (i=0; i<TransparentNodeList.size(); ++i) + TransparentNodeList[i].Node->render(); #ifdef _IRR_SCENEMANAGER_DEBUG Parameters->setAttribute ( "drawn_transparent", (s32) TransparentNodeList.size() ); #endif TransparentNodeList.set_used(0); - - if (LightManager) - LightManager->OnRenderPassPostRender(CurrentRenderPass); } // render transparent effect objects. @@ -1664,23 +745,8 @@ void CSceneManager::drawAll() TransparentEffectNodeList.sort(); // sort by distance from camera - if (LightManager) - { - LightManager->OnRenderPassPreRender(CurrentRenderPass); - - for (i=0; i<TransparentEffectNodeList.size(); ++i) - { - ISceneNode* node = TransparentEffectNodeList[i].Node; - LightManager->OnNodePreRender(node); - node->render(); - LightManager->OnNodePostRender(node); - } - } - else - { - for (i=0; i<TransparentEffectNodeList.size(); ++i) - TransparentEffectNodeList[i].Node->render(); - } + for (i=0; i<TransparentEffectNodeList.size(); ++i) + TransparentEffectNodeList[i].Node->render(); #ifdef _IRR_SCENEMANAGER_DEBUG Parameters->setAttribute("drawn_transparent_effect", (s32) TransparentEffectNodeList.size()); #endif @@ -1693,159 +759,18 @@ void CSceneManager::drawAll() CurrentRenderPass = ESNRP_GUI; Driver->getOverrideMaterial().Enabled = ((Driver->getOverrideMaterial().EnablePasses & CurrentRenderPass) != 0); - if (LightManager) - { - LightManager->OnRenderPassPreRender(CurrentRenderPass); - - for (i=0; i<GuiNodeList.size(); ++i) - { - ISceneNode* node = GuiNodeList[i]; - LightManager->OnNodePreRender(node); - node->render(); - LightManager->OnNodePostRender(node); - } - } - else - { - for (i=0; i<GuiNodeList.size(); ++i) - GuiNodeList[i]->render(); - } + for (i=0; i<GuiNodeList.size(); ++i) + GuiNodeList[i]->render(); #ifdef _IRR_SCENEMANAGER_DEBUG Parameters->setAttribute("drawn_gui_nodes", (s32) GuiNodeList.size()); #endif GuiNodeList.set_used(0); } - - - if (LightManager) - LightManager->OnPostRender(); - - LightList.set_used(0); clearDeletionList(); CurrentRenderPass = ESNRP_NONE; } -void CSceneManager::setLightManager(ILightManager* lightManager) -{ - if (lightManager) - lightManager->grab(); - if (LightManager) - LightManager->drop(); - - LightManager = lightManager; -} - - -//! Sets the color of stencil buffers shadows drawn by the scene manager. -void CSceneManager::setShadowColor(video::SColor color) -{ - ShadowColor = color; -} - - -//! Returns the current color of shadows. -video::SColor CSceneManager::getShadowColor() const -{ - return ShadowColor; -} - -IShadowVolumeSceneNode* CSceneManager::createShadowVolumeSceneNode(const IMesh* shadowMesh, ISceneNode* parent, s32 id, bool zfailmethod, f32 infinity) -{ -#ifdef _IRR_COMPILE_WITH_SHADOW_VOLUME_SCENENODE_ - return new CShadowVolumeSceneNode(shadowMesh, parent, this, id, zfailmethod, infinity); -#else - return 0; -#endif -} - - - -//! creates a rotation animator, which rotates the attached scene node around itself. -ISceneNodeAnimator* CSceneManager::createRotationAnimator(const core::vector3df& rotationPerSecond) -{ - ISceneNodeAnimator* anim = new CSceneNodeAnimatorRotation(os::Timer::getTime(), - rotationPerSecond); - - return anim; -} - - -//! creates a fly circle animator, which lets the attached scene node fly around a center. -ISceneNodeAnimator* CSceneManager::createFlyCircleAnimator( - const core::vector3df& center, f32 radius, f32 speed, - const core::vector3df& direction, - f32 startPosition, - f32 radiusEllipsoid) -{ - const f32 orbitDurationMs = (core::DEGTORAD * 360.f) / speed; - const u32 effectiveTime = os::Timer::getTime() + (u32)(orbitDurationMs * startPosition); - - ISceneNodeAnimator* anim = new CSceneNodeAnimatorFlyCircle( - effectiveTime, center, - radius, speed, direction,radiusEllipsoid); - return anim; -} - - -//! Creates a fly straight animator, which lets the attached scene node -//! fly or move along a line between two points. -ISceneNodeAnimator* CSceneManager::createFlyStraightAnimator(const core::vector3df& startPoint, - const core::vector3df& endPoint, u32 timeForWay, bool loop,bool pingpong) -{ - ISceneNodeAnimator* anim = new CSceneNodeAnimatorFlyStraight(startPoint, - endPoint, timeForWay, loop, os::Timer::getTime(), pingpong); - - return anim; -} - - -//! Creates a texture animator, which switches the textures of the target scene -//! node based on a list of textures. -ISceneNodeAnimator* CSceneManager::createTextureAnimator(const core::array<video::ITexture*>& textures, - s32 timePerFrame, bool loop) -{ - ISceneNodeAnimator* anim = new CSceneNodeAnimatorTexture(textures, - timePerFrame, loop, os::Timer::getTime()); - - return anim; -} - - -//! Creates a scene node animator, which deletes the scene node after -//! some time automatically. -ISceneNodeAnimator* CSceneManager::createDeleteAnimator(u32 when) -{ - return new CSceneNodeAnimatorDelete(this, os::Timer::getTime() + when); -} - - -//! Creates a special scene node animator for doing automatic collision detection -//! and response. -ISceneNodeAnimatorCollisionResponse* CSceneManager::createCollisionResponseAnimator( - ITriangleSelector* world, ISceneNode* sceneNode, const core::vector3df& ellipsoidRadius, - const core::vector3df& gravityPerSecond, - const core::vector3df& ellipsoidTranslation, f32 slidingValue) -{ - ISceneNodeAnimatorCollisionResponse* anim = new - CSceneNodeAnimatorCollisionResponse(this, world, sceneNode, - ellipsoidRadius, gravityPerSecond, - ellipsoidTranslation, slidingValue); - - return anim; -} - - -//! Creates a follow spline animator. -ISceneNodeAnimator* CSceneManager::createFollowSplineAnimator(s32 startTime, - const core::array< core::vector3df >& points, - f32 speed, f32 tightness, bool loop, bool pingpong) -{ - ISceneNodeAnimator* a = new CSceneNodeAnimatorFollowSpline(startTime, points, - speed, tightness, loop, pingpong); - return a; -} - //! Adds an external mesh loader. void CSceneManager::addExternalMeshLoader(IMeshLoader* externalLoader) @@ -1903,13 +828,6 @@ ISceneLoader* CSceneManager::getSceneLoader(u32 index) const } -//! Returns a pointer to the scene collision manager. -ISceneCollisionManager* CSceneManager::getSceneCollisionManager() -{ - return CollisionManager; -} - - //! Returns a pointer to the mesh manipulator. IMeshManipulator* CSceneManager::getMeshManipulator() { @@ -1917,82 +835,6 @@ IMeshManipulator* CSceneManager::getMeshManipulator() } -//! Creates a simple ITriangleSelector, based on a mesh. -ITriangleSelector* CSceneManager::createTriangleSelector(IMesh* mesh, ISceneNode* node, bool separateMeshbuffers) -{ - if (!mesh) - return 0; - - return new CTriangleSelector(mesh, node, separateMeshbuffers); -} - -ITriangleSelector* CSceneManager::createTriangleSelector(const IMeshBuffer* meshBuffer, irr::u32 materialIndex, ISceneNode* node) -{ - if ( !meshBuffer) - return 0; - return new CTriangleSelector(meshBuffer, materialIndex, node); -} - - -//! Creates a ITriangleSelector, based on a the mesh owned by an animated scene node -ITriangleSelector* CSceneManager::createTriangleSelector(IAnimatedMeshSceneNode* node, bool separateMeshbuffers) -{ - if (!node || !node->getMesh()) - return 0; - - return new CTriangleSelector(node, separateMeshbuffers); -} - - -//! Creates a simple dynamic ITriangleSelector, based on a axis aligned bounding box. -ITriangleSelector* CSceneManager::createTriangleSelectorFromBoundingBox(ISceneNode* node) -{ - if (!node) - return 0; - - return new CTriangleBBSelector(node); -} - - -//! Creates a simple ITriangleSelector, based on a mesh. -ITriangleSelector* CSceneManager::createOctreeTriangleSelector(IMesh* mesh, - ISceneNode* node, s32 minimalPolysPerNode) -{ - if (!mesh) - return 0; - - return new COctreeTriangleSelector(mesh, node, minimalPolysPerNode); -} - -ITriangleSelector* CSceneManager::createOctreeTriangleSelector(IMeshBuffer* meshBuffer, irr::u32 materialIndex, - ISceneNode* node, s32 minimalPolysPerNode) -{ - if ( !meshBuffer) - return 0; - - return new COctreeTriangleSelector(meshBuffer, materialIndex, node, minimalPolysPerNode); -} - -//! Creates a meta triangle selector. -IMetaTriangleSelector* CSceneManager::createMetaTriangleSelector() -{ - return new CMetaTriangleSelector(); -} - - -//! Creates a triangle selector which can select triangles from a terrain scene node -ITriangleSelector* CSceneManager::createTerrainTriangleSelector( - ITerrainSceneNode* node, s32 LOD) -{ -#ifdef _IRR_COMPILE_WITH_TERRAIN_SCENENODE_ - return new CTerrainTriangleSelector(node, LOD); -#else - return 0; -#endif -} - - - //! Adds a scene node to the deletion queue. void CSceneManager::addToDeletionQueue(ISceneNode* node) { @@ -2209,41 +1051,6 @@ ISceneNodeFactory* CSceneManager::getSceneNodeFactory(u32 index) return 0; } - -//! Returns the default scene node animator factory which can create all built-in scene node animators -ISceneNodeAnimatorFactory* CSceneManager::getDefaultSceneNodeAnimatorFactory() -{ - return getSceneNodeAnimatorFactory(0); -} - -//! Adds a scene node animator factory to the scene manager. -void CSceneManager::registerSceneNodeAnimatorFactory(ISceneNodeAnimatorFactory* factoryToAdd) -{ - if (factoryToAdd) - { - factoryToAdd->grab(); - SceneNodeAnimatorFactoryList.push_back(factoryToAdd); - } -} - - -//! Returns amount of registered scene node animator factories. -u32 CSceneManager::getRegisteredSceneNodeAnimatorFactoryCount() const -{ - return SceneNodeAnimatorFactoryList.size(); -} - - -//! Returns a scene node animator factory by index -ISceneNodeAnimatorFactory* CSceneManager::getSceneNodeAnimatorFactory(u32 index) -{ - if (index < SceneNodeAnimatorFactoryList.size()) - return SceneNodeAnimatorFactoryList[index]; - - return 0; -} - - //! Saves the current scene into a file. //! \param filename: Name of the file . bool CSceneManager::saveScene(const io::path& filename, ISceneUserDataSerializer* userDataSerializer, ISceneNode* node) @@ -2332,29 +1139,6 @@ ISceneNode* CSceneManager::addSceneNode(const char* sceneNodeTypeName, ISceneNod return node; } -ISceneNodeAnimator* CSceneManager::createSceneNodeAnimator(const char* typeName, ISceneNode* target) -{ - ISceneNodeAnimator *animator = 0; - - for (s32 i=(s32)SceneNodeAnimatorFactoryList.size()-1; i>=0 && !animator; --i) - animator = SceneNodeAnimatorFactoryList[i]->createSceneNodeAnimator(typeName, target); - - return animator; -} - - -//! Returns a typename from a scene node animator type or null if not found -const c8* CSceneManager::getAnimatorTypeName(ESCENE_NODE_ANIMATOR_TYPE type) -{ - const char* name = 0; - - for (s32 i=SceneNodeAnimatorFactoryList.size()-1; !name && i >= 0; --i) - name = SceneNodeAnimatorFactoryList[i]->getCreateableSceneNodeAnimatorTypeName(type); - - return name; -} - - //! Writes attributes of the scene node. void CSceneManager::serializeAttributes(io::IAttributes* out, io::SAttributeReadWriteOptions* options) const { diff --git a/source/Irrlicht/CSceneManager.h b/source/Irrlicht/CSceneManager.h index 516fd721..882a7049 100644 --- a/source/Irrlicht/CSceneManager.h +++ b/source/Irrlicht/CSceneManager.h @@ -12,7 +12,6 @@ #include "irrArray.h" #include "IMeshLoader.h" #include "CAttributes.h" -#include "ILightManager.h" namespace irr { @@ -23,7 +22,6 @@ namespace io namespace scene { class IMeshCache; - class IGeometryCreator; /*! The Scene Manager manages scene nodes, mesh resources, cameras and all the other stuff. @@ -58,29 +56,6 @@ namespace scene //! return the filesystem virtual io::IFileSystem* getFileSystem() _IRR_OVERRIDE_; - //! adds Volume Lighting Scene Node. - //! the returned pointer must not be dropped. - virtual IVolumeLightSceneNode* addVolumeLightSceneNode(ISceneNode* parent=0, s32 id=-1, - const u32 subdivU = 32, const u32 subdivV = 32, - const video::SColor foot = video::SColor(51, 0, 230, 180), - const video::SColor tail = video::SColor(0, 0, 0, 0), - const core::vector3df& position = core::vector3df(0,0,0), - const core::vector3df& rotation = core::vector3df(0,0,0), - const core::vector3df& scale = core::vector3df(1.0f, 1.0f, 1.0f)) _IRR_OVERRIDE_; - - //! adds a cube scene node to the scene. It is a simple cube of (1,1,1) size. - //! the returned pointer must not be dropped. - virtual IMeshSceneNode* addCubeSceneNode(f32 size=10.0f, ISceneNode* parent=0, s32 id=-1, - const core::vector3df& position = core::vector3df(0,0,0), - const core::vector3df& rotation = core::vector3df(0,0,0), - const core::vector3df& scale = core::vector3df(1.0f, 1.0f, 1.0f)) _IRR_OVERRIDE_; - - //! Adds a sphere scene node to the scene. - virtual IMeshSceneNode* addSphereSceneNode(f32 radius=5.0f, s32 polyCount=16, ISceneNode* parent=0, s32 id=-1, - const core::vector3df& position = core::vector3df(0,0,0), - const core::vector3df& rotation = core::vector3df(0,0,0), - const core::vector3df& scale = core::vector3df(1.0f, 1.0f, 1.0f)) _IRR_OVERRIDE_; - //! adds a scene node for rendering an animated mesh model virtual IAnimatedMeshSceneNode* addAnimatedMeshSceneNode(IAnimatedMesh* mesh, ISceneNode* parent=0, s32 id=-1, const core::vector3df& position = core::vector3df(0,0,0), @@ -96,12 +71,6 @@ namespace scene const core::vector3df& scale = core::vector3df(1.0f, 1.0f, 1.0f), bool alsoAddIfMeshPointerZero=false) _IRR_OVERRIDE_; - //! Adds a scene node for rendering a animated water surface mesh. - virtual ISceneNode* addWaterSurfaceSceneNode(IMesh* mesh, f32 waveHeight, f32 waveSpeed, f32 wlength, ISceneNode* parent=0, s32 id=-1, - const core::vector3df& position = core::vector3df(0,0,0), - const core::vector3df& rotation = core::vector3df(0,0,0), - const core::vector3df& scale = core::vector3df(1.0f, 1.0f, 1.0f)) _IRR_OVERRIDE_; - //! renders the node. virtual void render() _IRR_OVERRIDE_; @@ -117,18 +86,6 @@ namespace scene //! draws all scene nodes virtual void drawAll() _IRR_OVERRIDE_; - //! Adds a scene node for rendering using a octree to the scene graph. This a good method for rendering - //! scenes with lots of geometry. The Octree is built on the fly from the mesh, much - //! faster then a bsp tree. - virtual IOctreeSceneNode* addOctreeSceneNode(IAnimatedMesh* mesh, ISceneNode* parent=0, - s32 id=-1, s32 minimalPolysPerNode=512, bool alsoAddIfMeshPointerZero=false) _IRR_OVERRIDE_; - - //! Adss a scene node for rendering using a octree. This a good method for rendering - //! scenes with lots of geometry. The Octree is built on the fly from the mesh, much - //! faster then a bsp tree. - virtual IOctreeSceneNode* addOctreeSceneNode(IMesh* mesh, ISceneNode* parent=0, - s32 id=-1, s32 minimalPolysPerNode=128, bool alsoAddIfMeshPointerZero=false) _IRR_OVERRIDE_; - //! Adds a camera scene node to the tree and sets it as active camera. //! \param position: Position of the space relative to its parent where the camera will be placed. //! \param lookat: Position where the camera will look at. Also known as target. @@ -140,30 +97,6 @@ namespace scene const core::vector3df& lookat = core::vector3df(0,0,100), s32 id=-1, bool makeActive=true) _IRR_OVERRIDE_; - //! Adds a camera scene node which is able to be controlle with the mouse similar - //! like in the 3D Software Maya by Alias Wavefront. - //! The returned pointer must not be dropped. - virtual ICameraSceneNode* addCameraSceneNodeMaya(ISceneNode* parent=0, - f32 rotateSpeed=-1500.f, f32 zoomSpeed=200.f, - f32 translationSpeed=1500.f, s32 id=-1, f32 distance=70.f, - bool makeActive=true) _IRR_OVERRIDE_; - - //! Adds a camera scene node which is able to be controled with the mouse and keys - //! like in most first person shooters (FPS): - virtual ICameraSceneNode* addCameraSceneNodeFPS(ISceneNode* parent = 0, - f32 rotateSpeed = 100.0f, f32 moveSpeed = .5f, s32 id=-1, - SKeyMap* keyMapArray=0, s32 keyMapSize=0, - bool noVerticalMovement=false, f32 jumpSpeed = 0.f, - bool invertMouseY=false, bool makeActive=true) _IRR_OVERRIDE_; - - //! Adds a dynamic light scene node. The light will cast dynamic light on all - //! other scene nodes in the scene, which have the material flag video::MTF_LIGHTING - //! turned on. (This is the default setting in most scene nodes). - virtual ILightSceneNode* addLightSceneNode(ISceneNode* parent = 0, - const core::vector3df& position = core::vector3df(0,0,0), - video::SColorf color = video::SColorf(1.0f, 1.0f, 1.0f), - f32 range=100.0f, s32 id=-1) _IRR_OVERRIDE_; - //! Adds a billboard scene node to the scene. A billboard is like a 3d sprite: A 2d element, //! which always looks to the camera. It is usually used for things like explosions, fire, //! lensflares and things like that. @@ -172,103 +105,6 @@ namespace scene const core::vector3df& position = core::vector3df(0,0,0), s32 id=-1, video::SColor shadeTop = 0xFFFFFFFF, video::SColor shadeBottom = 0xFFFFFFFF) _IRR_OVERRIDE_; - //! Adds a skybox scene node. A skybox is a big cube with 6 textures on it and - //! is drawn around the camera position. - virtual ISceneNode* addSkyBoxSceneNode(video::ITexture* top, video::ITexture* bottom, - video::ITexture* left, video::ITexture* right, video::ITexture* front, - video::ITexture* back, ISceneNode* parent = 0, s32 id=-1) _IRR_OVERRIDE_; - - //! Adds a skydome scene node. A skydome is a large (half-) sphere with a - //! panoramic texture on it and is drawn around the camera position. - virtual ISceneNode* addSkyDomeSceneNode(video::ITexture* texture, - u32 horiRes=16, u32 vertRes=8, - f32 texturePercentage=0.9, f32 spherePercentage=2.0,f32 radius = 1000.f, - ISceneNode* parent=0, s32 id=-1) _IRR_OVERRIDE_; - - //! Adds a text scene node, which is able to display - //! 2d text at a position in three dimensional space - virtual ITextSceneNode* addTextSceneNode(gui::IGUIFont* font, const wchar_t* text, - video::SColor color=video::SColor(100,255,255,255), - ISceneNode* parent = 0, const core::vector3df& position = core::vector3df(0,0,0), - s32 id=-1) _IRR_OVERRIDE_; - - //! Adds a text scene node, which uses billboards - virtual IBillboardTextSceneNode* addBillboardTextSceneNode(gui::IGUIFont* font, const wchar_t* text, - ISceneNode* parent = 0, - const core::dimension2d<f32>& size = core::dimension2d<f32>(10.0f, 10.0f), - const core::vector3df& position = core::vector3df(0,0,0), s32 id=-1, - video::SColor colorTop = 0xFFFFFFFF, video::SColor colorBottom = 0xFFFFFFFF) _IRR_OVERRIDE_; - - //! Adds a scene node, which can render a quake3 shader - virtual IMeshSceneNode* addQuake3SceneNode(const IMeshBuffer* meshBuffer, const quake3::IShader * shader, - ISceneNode* parent=0, s32 id=-1) _IRR_OVERRIDE_; - - - //! Adds a Hill Plane mesh to the mesh pool. The mesh is - //! generated on the fly and looks like a plane with some hills - //! on it. You can specify how many hills should be on the plane - //! and how high they should be. Also you must specify a name - //! for the mesh because the mesh is added to the mesh pool and - //! can be retrieved back using ISceneManager::getMesh with the - //! name as parameter. - virtual IAnimatedMesh* addHillPlaneMesh(const io::path& name, - const core::dimension2d<f32>& tileSize, const core::dimension2d<u32>& tileCount, - video::SMaterial* material = 0, f32 hillHeight = 0.0f, - const core::dimension2d<f32>& countHills = core::dimension2d<f32>(1.0f, 1.0f), - const core::dimension2d<f32>& textureRepeatCount = core::dimension2d<f32>(1.0f, 1.0f)) _IRR_OVERRIDE_; - - //! Adds a terrain mesh to the mesh pool. - virtual IAnimatedMesh* addTerrainMesh(const io::path& meshname, video::IImage* texture, video::IImage* heightmap, - const core::dimension2d<f32>& stretchSize = core::dimension2d<f32>(10.0f,10.0f), - f32 maxHeight=200.0f, - const core::dimension2d<u32>& defaultVertexBlockSize = core::dimension2d<u32>(64,64)) _IRR_OVERRIDE_; - - //! Add a arrow mesh to the mesh pool - virtual IAnimatedMesh* addArrowMesh(const io::path& name, - video::SColor vtxColor0, video::SColor vtxColor1, - u32 tesselationCylinder, u32 tesselationCone, - f32 height, f32 cylinderHeight, f32 width0, - f32 width1) _IRR_OVERRIDE_; - - //! Adds a static sphere mesh to the mesh pool. - virtual IAnimatedMesh* addSphereMesh(const io::path& name, - f32 radius=5.f, u32 polyCountX=16, u32 polyCountY=16) _IRR_OVERRIDE_; - - //! Adds a static volume light mesh to the mesh pool. - virtual IAnimatedMesh* addVolumeLightMesh(const io::path& name, - const u32 SubdivideU = 32, const u32 SubdivideV = 32, - const video::SColor FootColor = video::SColor(51, 0, 230, 180), - const video::SColor TailColor = video::SColor(0, 0, 0, 0)) _IRR_OVERRIDE_; - - //! Adds a particle system scene node. - virtual IParticleSystemSceneNode* addParticleSystemSceneNode( - bool withDefaultEmitter=true, ISceneNode* parent=0, s32 id=-1, - const core::vector3df& position = core::vector3df(0,0,0), - const core::vector3df& rotation = core::vector3df(0,0,0), - const core::vector3df& scale = core::vector3df(1.0f, 1.0f, 1.0f)) _IRR_OVERRIDE_; - - //! Adds a terrain scene node to the scene graph. - virtual ITerrainSceneNode* addTerrainSceneNode( - const io::path& heightMapFileName, - ISceneNode* parent=0, s32 id=-1, - const core::vector3df& position = core::vector3df(0.0f,0.0f,0.0f), - const core::vector3df& rotation = core::vector3df(0.0f,0.0f,0.0f), - const core::vector3df& scale = core::vector3df(1.0f,1.0f,1.0f), - video::SColor vertexColor = video::SColor(255,255,255,255), - s32 maxLOD=4, E_TERRAIN_PATCH_SIZE patchSize=ETPS_17,s32 smoothFactor=0, - bool addAlsoIfHeightmapEmpty = false) _IRR_OVERRIDE_; - - //! Adds a terrain scene node to the scene graph. - virtual ITerrainSceneNode* addTerrainSceneNode( - io::IReadFile* heightMap, - ISceneNode* parent=0, s32 id=-1, - const core::vector3df& position = core::vector3df(0.0f,0.0f,0.0f), - const core::vector3df& rotation = core::vector3df(0.0f,0.0f,0.0f), - const core::vector3df& scale = core::vector3df(1.0f,1.0f,1.0f), - video::SColor vertexColor = video::SColor(255,255,255,255), - s32 maxLOD=4, E_TERRAIN_PATCH_SIZE patchSize=ETPS_17,s32 smoothFactor=0, - bool addAlsoIfHeightmapEmpty=false) _IRR_OVERRIDE_; - //! Adds a dummy transformation scene node to the scene graph. virtual IDummyTransformationSceneNode* addDummyTransformationSceneNode( ISceneNode* parent=0, s32 id=-1) _IRR_OVERRIDE_; @@ -292,92 +128,6 @@ namespace scene //! \param camera: The new camera which should be active. virtual void setActiveCamera(ICameraSceneNode* camera) _IRR_OVERRIDE_; - //! creates a rotation animator, which rotates the attached scene node around itself. - //! \param rotationPerSecond: Specifies the speed of the animation - //! \return The animator. Attach it to a scene node with ISceneNode::addAnimator() - //! and the animator will animate it. - virtual ISceneNodeAnimator* createRotationAnimator(const core::vector3df& rotationPerSecond) _IRR_OVERRIDE_; - - //! creates a fly circle animator - /** Lets the attached scene node fly around a center. - \param center Center relative to node origin - \param speed: The orbital speed, in radians per millisecond. - \param direction: Specifies the upvector used for alignment of the mesh. - \param startPosition: The position on the circle where the animator will - begin. Value is in multiples of a circle, i.e. 0.5 is half way around. - \return The animator. Attach it to a scene node with ISceneNode::addAnimator() - */ - virtual ISceneNodeAnimator* createFlyCircleAnimator( - const core::vector3df& center=core::vector3df(0.f, 0.f, 0.f), - f32 radius=100.f, f32 speed=0.001f, - const core::vector3df& direction=core::vector3df(0.f, 1.f, 0.f), - f32 startPosition = 0.f, - f32 radiusEllipsoid = 0.f) _IRR_OVERRIDE_; - - //! Creates a fly straight animator, which lets the attached scene node - //! fly or move along a line between two points. - virtual ISceneNodeAnimator* createFlyStraightAnimator(const core::vector3df& startPoint, - const core::vector3df& endPoint, u32 timeForWay, bool loop=false,bool pingpong = false) _IRR_OVERRIDE_; - - //! Creates a texture animator, which switches the textures of the target scene - //! node based on a list of textures. - virtual ISceneNodeAnimator* createTextureAnimator(const core::array<video::ITexture*>& textures, - s32 timePerFrame, bool loop) _IRR_OVERRIDE_; - - //! Creates a scene node animator, which deletes the scene node after - //! some time automatically. - virtual ISceneNodeAnimator* createDeleteAnimator(u32 timeMS) _IRR_OVERRIDE_; - - - //! Creates a special scene node animator for doing automatic collision detection - //! and response. - virtual ISceneNodeAnimatorCollisionResponse* createCollisionResponseAnimator( - ITriangleSelector* world, ISceneNode* sceneNode, - const core::vector3df& ellipsoidRadius = core::vector3df(30,60,30), - const core::vector3df& gravityPerSecond = core::vector3df(0,-1.0f,0), - const core::vector3df& ellipsoidTranslation = core::vector3df(0,0,0), - f32 slidingValue = 0.0005f) _IRR_OVERRIDE_; - - //! Creates a follow spline animator. - virtual ISceneNodeAnimator* createFollowSplineAnimator(s32 startTime, - const core::array< core::vector3df >& points, - f32 speed, f32 tightness, bool loop, bool pingpong) _IRR_OVERRIDE_; - - - //! Creates a simple ITriangleSelector, based on a mesh. - virtual ITriangleSelector* createTriangleSelector(IMesh* mesh, ISceneNode* node, bool separateMeshbuffers) _IRR_OVERRIDE_; - - //! Creates a simple ITriangleSelector, based on a meshbuffer. - virtual ITriangleSelector* createTriangleSelector(const IMeshBuffer* meshBuffer, irr::u32 materialIndex, ISceneNode* node) _IRR_OVERRIDE_; - - //! Creates a simple ITriangleSelector, based on an animated mesh scene node. - //! Details of the mesh associated with the node will be extracted internally. - //! Call ITriangleSelector::update() to have the triangle selector updated based - //! on the current frame of the animated mesh scene node. - //! \param: The animated mesh scene node from which to build the selector - virtual ITriangleSelector* createTriangleSelector(IAnimatedMeshSceneNode* node, bool separateMeshbuffers) _IRR_OVERRIDE_; - - //! Creates a simple ITriangleSelector, based on a mesh. - virtual ITriangleSelector* createOctreeTriangleSelector(IMesh* mesh, - ISceneNode* node, s32 minimalPolysPerNode) _IRR_OVERRIDE_; - - //! Creates a simple ITriangleSelector, based on a meshbuffer. - virtual ITriangleSelector* createOctreeTriangleSelector(IMeshBuffer* meshBuffer, irr::u32 materialIndex, - ISceneNode* node, s32 minimalPolysPerNode=32) _IRR_OVERRIDE_; - - //! Creates a simple dynamic ITriangleSelector, based on a axis aligned bounding box. - virtual ITriangleSelector* createTriangleSelectorFromBoundingBox( - ISceneNode* node) _IRR_OVERRIDE_; - - //! Creates a meta triangle selector. - virtual IMetaTriangleSelector* createMetaTriangleSelector() _IRR_OVERRIDE_; - - //! Creates a triangle selector which can select triangles from a terrain scene node - //! \param: Pointer to the created terrain scene node - //! \param: Level of detail, 0 for highest detail. - virtual ITriangleSelector* createTerrainTriangleSelector( - ITerrainSceneNode* node, s32 LOD=0) _IRR_OVERRIDE_; - //! Adds an external mesh loader. virtual void addExternalMeshLoader(IMeshLoader* externalLoader) _IRR_OVERRIDE_; @@ -396,21 +146,9 @@ namespace scene //! Retrieve the given scene loader virtual ISceneLoader* getSceneLoader(u32 index) const _IRR_OVERRIDE_; - //! Returns a pointer to the scene collision manager. - virtual ISceneCollisionManager* getSceneCollisionManager() _IRR_OVERRIDE_; - //! Returns a pointer to the mesh manipulator. virtual IMeshManipulator* getMeshManipulator() _IRR_OVERRIDE_; - //! Sets the color of stencil buffers shadows drawn by the scene manager. - virtual void setShadowColor(video::SColor color) _IRR_OVERRIDE_; - - //! Returns the current color of shadows. - virtual video::SColor getShadowColor() const _IRR_OVERRIDE_; - - //! Create a shadow volume scene node to be used with custom nodes - virtual IShadowVolumeSceneNode* createShadowVolumeSceneNode(const IMesh* shadowMesh, ISceneNode* parent, s32 id, bool zfailmethod, f32 infinity) _IRR_OVERRIDE_; - //! Adds a scene node to the deletion queue. virtual void addToDeletionQueue(ISceneNode* node) _IRR_OVERRIDE_; @@ -465,27 +203,9 @@ namespace scene //! Returns a typename from a scene node type or null if not found virtual const c8* getSceneNodeTypeName(ESCENE_NODE_TYPE type) _IRR_OVERRIDE_; - //! Returns a typename from a scene node animator type or null if not found - virtual const c8* getAnimatorTypeName(ESCENE_NODE_ANIMATOR_TYPE type) _IRR_OVERRIDE_; - //! Adds a scene node to the scene by name virtual ISceneNode* addSceneNode(const char* sceneNodeTypeName, ISceneNode* parent=0) _IRR_OVERRIDE_; - //! creates a scene node animator based on its type name - virtual ISceneNodeAnimator* createSceneNodeAnimator(const char* typeName, ISceneNode* target=0) _IRR_OVERRIDE_; - - //! Returns the default scene node animator factory which can create all built-in scene node animators - virtual ISceneNodeAnimatorFactory* getDefaultSceneNodeAnimatorFactory() _IRR_OVERRIDE_; - - //! Adds a scene node animator factory to the scene manager. - virtual void registerSceneNodeAnimatorFactory(ISceneNodeAnimatorFactory* factoryToAdd) _IRR_OVERRIDE_; - - //! Returns amount of registered scene node animator factories. - virtual u32 getRegisteredSceneNodeAnimatorFactoryCount() const _IRR_OVERRIDE_; - - //! Returns a scene node animator factory by index - virtual ISceneNodeAnimatorFactory* getSceneNodeAnimatorFactory(u32 index) _IRR_OVERRIDE_; - //! Saves the current scene into a file. virtual bool saveScene(const io::path& filename, ISceneUserDataSerializer* userDataSerializer=0, ISceneNode* node=0) _IRR_OVERRIDE_; @@ -516,18 +236,12 @@ namespace scene //! Returns ambient color of the scene virtual const video::SColorf& getAmbientLight() const _IRR_OVERRIDE_; - //! Register a custom callbacks manager which gets callbacks during scene rendering. - virtual void setLightManager(ILightManager* lightManager) _IRR_OVERRIDE_; - //! Get current render time. virtual E_SCENE_NODE_RENDER_PASS getCurrentRenderPass() const _IRR_OVERRIDE_ { return CurrentRenderPass; } //! Set current render time. virtual void setCurrentRenderPass(E_SCENE_NODE_RENDER_PASS nextPass) _IRR_OVERRIDE_ { CurrentRenderPass = nextPass; } - //! Get an instance of a geometry creator. - virtual const IGeometryCreator* getGeometryCreator(void) const _IRR_OVERRIDE_ { return GeometryCreator; } - //! returns if node is culled virtual bool isCulled(const ISceneNode* node) const _IRR_OVERRIDE_; @@ -615,13 +329,8 @@ namespace scene //! cursor control gui::ICursorControl* CursorControl; - //! collision manager - ISceneCollisionManager* CollisionManager; - //! render pass lists core::array<ISceneNode*> CameraList; - core::array<ISceneNode*> LightList; - core::array<ISceneNode*> ShadowNodeList; core::array<ISceneNode*> SkyBoxList; core::array<DefaultNodeEntry> SolidNodeList; core::array<TransparentNodeEntry> TransparentNodeList; @@ -632,7 +341,6 @@ namespace scene core::array<ISceneLoader*> SceneLoaderList; core::array<ISceneNode*> DeletionList; core::array<ISceneNodeFactory*> SceneNodeFactoryList; - core::array<ISceneNodeAnimatorFactory*> SceneNodeAnimatorFactoryList; //! current active camera ICameraSceneNode* ActiveCamera; @@ -649,12 +357,6 @@ namespace scene IMeshCache* MeshCache; E_SCENE_NODE_RENDER_PASS CurrentRenderPass; - - //! An optional callbacks manager to allow the user app finer control - //! over the scene lighting and rendering. - ILightManager* LightManager; - - IGeometryCreator* GeometryCreator; }; } // end namespace video diff --git a/source/Irrlicht/CSceneNodeAnimatorCameraFPS.cpp b/source/Irrlicht/CSceneNodeAnimatorCameraFPS.cpp deleted file mode 100644 index a5f71b4f..00000000 --- a/source/Irrlicht/CSceneNodeAnimatorCameraFPS.cpp +++ /dev/null @@ -1,425 +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 "CSceneNodeAnimatorCameraFPS.h" -#include "IVideoDriver.h" -#include "ISceneManager.h" -#include "Keycodes.h" -#include "ICursorControl.h" -#include "ICameraSceneNode.h" -#include "ISceneNodeAnimatorCollisionResponse.h" - -namespace irr -{ -namespace scene -{ - -//! constructor -CSceneNodeAnimatorCameraFPS::CSceneNodeAnimatorCameraFPS(gui::ICursorControl* cursorControl, - f32 rotateSpeed, f32 moveSpeed, f32 jumpSpeed, - SKeyMap* keyMapArray, u32 keyMapSize, bool noVerticalMovement, bool invertY, float rotateSpeedKeyboard) -: CursorControl(cursorControl), -// On X11 we get events even when mouse is not inside the Irrlicht window, on Windows we don't. -// It might be possible to add grabbing on Windows as well in which case this has to be somewhat changed. -// TODO: I don't know about OSX, but in theory it should be like old Irrlicht 1.8 behavior whatever that was there. -#ifdef _IRR_COMPILE_WITH_X11_DEVICE_ - GrabMouse(false), -#else - GrabMouse(true), -#endif - MaxVerticalAngle(88.0f), NoVerticalMovement(noVerticalMovement), - MoveSpeed(moveSpeed), - RotateSpeedKeyboard(rotateSpeedKeyboard), RotateSpeed(rotateSpeed), - JumpSpeed(jumpSpeed), - MouseYDirection(invertY ? -1.0f : 1.0f), - LastAnimationTime(0), HadMouseEvent(false), firstUpdate(true), firstInput(true) -{ - #ifdef _DEBUG - setDebugName("CCameraSceneNodeAnimatorFPS"); - #endif - - if (CursorControl) - CursorControl->grab(); - - allKeysUp(); - - // create key map - if (!keyMapArray || !keyMapSize) - { - // create default key map - KeyMap.push_back(SKeyMap(EKA_MOVE_FORWARD, irr::KEY_UP)); - KeyMap.push_back(SKeyMap(EKA_MOVE_BACKWARD, irr::KEY_DOWN)); - KeyMap.push_back(SKeyMap(EKA_STRAFE_LEFT, irr::KEY_LEFT)); - KeyMap.push_back(SKeyMap(EKA_STRAFE_RIGHT, irr::KEY_RIGHT)); - KeyMap.push_back(SKeyMap(EKA_JUMP_UP, irr::KEY_KEY_J)); - } - else - { - // create custom key map - setKeyMap(keyMapArray, keyMapSize); - } -} - - -//! destructor -CSceneNodeAnimatorCameraFPS::~CSceneNodeAnimatorCameraFPS() -{ - if (CursorControl) - CursorControl->drop(); -} - - -//! It is possible to send mouse and key events to the camera. Most cameras -//! may ignore this input, but camera scene nodes which are created for -//! example with scene::ISceneManager::addMayaCameraSceneNode or -//! scene::ISceneManager::addFPSCameraSceneNode, may want to get this input -//! for changing their position, look at target or whatever. -bool CSceneNodeAnimatorCameraFPS::OnEvent(const SEvent& evt) -{ - switch(evt.EventType) - { - case EET_KEY_INPUT_EVENT: - for (u32 i=0; i<KeyMap.size(); ++i) - { - if (KeyMap[i].KeyCode == evt.KeyInput.Key) - { - CursorKeys[KeyMap[i].Action] = evt.KeyInput.PressedDown; - return true; - } - } - break; - - case EET_MOUSE_INPUT_EVENT: - HadMouseEvent = true; - if ( evt.MouseInput.Event == EMIE_MOUSE_ENTER_CANVAS && CursorControl) - { - CursorControl->setPosition(0.5f, 0.5f); - CenterCursor = CursorControl->getRelativePosition(false); - CursorPos = CenterCursor; - } - break; - - default: - break; - } - - return false; -} - - -void CSceneNodeAnimatorCameraFPS::animateNode(ISceneNode* node, u32 timeMs) -{ - if (!node || node->getType() != ESNT_CAMERA) - return; - - ICameraSceneNode* camera = static_cast<ICameraSceneNode*>(node); - - if (firstUpdate) - { - camera->updateAbsolutePosition(); - if (CursorControl ) - { - CursorControl->setPosition(0.5f, 0.5f); - CursorPos = CenterCursor = CursorControl->getRelativePosition(false); - } - - LastAnimationTime = timeMs; - - firstUpdate = false; - } - - // If the camera isn't the active camera, and receiving input, then don't process it. - if(!camera->isInputReceiverEnabled()) - { - firstInput = true; - return; - } - - if ( firstInput ) - { - allKeysUp(); - firstInput = false; - } - - scene::ISceneManager * smgr = camera->getSceneManager(); - if(smgr && smgr->getActiveCamera() != camera) - return; - - // get time - f32 timeDiff = (f32) ( timeMs - LastAnimationTime ); - LastAnimationTime = timeMs; - - // Update rotation - core::vector3df target = (camera->getTarget() - camera->getAbsolutePosition()); - core::vector3df relativeRotation = target.getHorizontalAngle(); - - if (CursorControl) - { - bool reset = false; - - if ( HadMouseEvent || GrabMouse) - CursorPos = CursorControl->getRelativePosition(); - - if (CursorPos != CenterCursor) - { - relativeRotation.Y -= (CenterCursor.X - CursorPos.X) * RotateSpeed; - relativeRotation.X -= (CenterCursor.Y - CursorPos.Y) * RotateSpeed * MouseYDirection; - - reset = true; - } - - if ( GrabMouse && !reset) - { - // Special case, mouse is whipped outside of window before it can update. - video::IVideoDriver* driver = smgr->getVideoDriver(); - core::vector2d<u32> mousepos(u32(CursorPos.X), u32(CursorPos.Y)); - core::rect<u32> screenRect(0, 0, driver->getScreenSize().Width, driver->getScreenSize().Height); - - // Only if we are moving outside quickly. - reset = !screenRect.isPointInside(mousepos); - } - - if(reset) - { - CursorControl->setPosition(0.5f, 0.5f); - CenterCursor = CursorControl->getRelativePosition(false); // often no longer 0.5 due to int/float conversions - CursorPos = CenterCursor; - } - } - HadMouseEvent = false; - - // keyboard rotation - if (CursorKeys[EKA_ROTATE_LEFT]) - relativeRotation.Y -= timeDiff * RotateSpeedKeyboard; - - if (CursorKeys[EKA_ROTATE_RIGHT]) - relativeRotation.Y += timeDiff * RotateSpeedKeyboard; - - // X < MaxVerticalAngle or X > 360-MaxVerticalAngle - - if (relativeRotation.X > MaxVerticalAngle*2 && - relativeRotation.X < 360.0f-MaxVerticalAngle) - { - relativeRotation.X = 360.0f-MaxVerticalAngle; - } - else - if (relativeRotation.X > MaxVerticalAngle && - relativeRotation.X < 360.0f-MaxVerticalAngle) - { - relativeRotation.X = MaxVerticalAngle; - } - - // set target - core::vector3df pos = camera->getPosition(); - target.set(0,0, core::max_(1.f, pos.getLength())); // better float precision than (0,0,1) in target-pos calculation in camera - core::vector3df movedir(target); - - core::matrix4 mat; - mat.setRotationDegrees(core::vector3df(relativeRotation.X, relativeRotation.Y, 0)); - mat.transformVect(target); - - if (NoVerticalMovement) - { - mat.setRotationDegrees(core::vector3df(0, relativeRotation.Y, 0)); - mat.transformVect(movedir); - } - else - { - movedir = target; - } - - movedir.normalize(); - - if (CursorKeys[EKA_MOVE_FORWARD]) - pos += movedir * timeDiff * MoveSpeed; - - if (CursorKeys[EKA_MOVE_BACKWARD]) - pos -= movedir * timeDiff * MoveSpeed; - - // strafing - - core::vector3df strafevect(target); - strafevect = strafevect.crossProduct(camera->getUpVector()); - - if (NoVerticalMovement) - strafevect.Y = 0.0f; - - strafevect.normalize(); - - if (CursorKeys[EKA_STRAFE_LEFT]) - pos += strafevect * timeDiff * MoveSpeed; - - if (CursorKeys[EKA_STRAFE_RIGHT]) - pos -= strafevect * timeDiff * MoveSpeed; - - // For jumping, we find the collision response animator attached to our camera - // and if it's not falling, we tell it to jump. - if (CursorKeys[EKA_JUMP_UP]) - { - const ISceneNodeAnimatorList& animators = camera->getAnimators(); - ISceneNodeAnimatorList::ConstIterator it = animators.begin(); - while(it != animators.end()) - { - if(ESNAT_COLLISION_RESPONSE == (*it)->getType()) - { - ISceneNodeAnimatorCollisionResponse * collisionResponse = - static_cast<ISceneNodeAnimatorCollisionResponse *>(*it); - - if(!collisionResponse->isFalling()) - collisionResponse->jump(JumpSpeed); - } - - it++; - } - } - - // write translation - camera->setPosition(pos); - - // write right target - target += pos; - camera->setTarget(target); -} - -void CSceneNodeAnimatorCameraFPS::allKeysUp() -{ - for (u32 i=0; i<EKA_COUNT; ++i) - CursorKeys[i] = false; -} - - -//! Sets the rotation speed -void CSceneNodeAnimatorCameraFPS::setRotateSpeed(f32 speed) -{ - RotateSpeed = speed; -} - - -//! Sets the movement speed -void CSceneNodeAnimatorCameraFPS::setMoveSpeed(f32 speed) -{ - MoveSpeed = speed; -} - - -//! Gets the rotation speed -f32 CSceneNodeAnimatorCameraFPS::getRotateSpeed() const -{ - return RotateSpeed; -} - - -// Gets the movement speed -f32 CSceneNodeAnimatorCameraFPS::getMoveSpeed() const -{ - return MoveSpeed; -} - -//! Sets the keyboard mapping for this animator -void CSceneNodeAnimatorCameraFPS::setKeyMap(SKeyMap *map, u32 count) -{ - // clear the keymap - KeyMap.clear(); - - // add actions - for (u32 i=0; i<count; ++i) - { - KeyMap.push_back(map[i]); - } -} - -void CSceneNodeAnimatorCameraFPS::setKeyMap(const core::array<SKeyMap>& keymap) -{ - KeyMap=keymap; -} - -const core::array<SKeyMap>& CSceneNodeAnimatorCameraFPS::getKeyMap() const -{ - return KeyMap; -} - - -//! Sets whether vertical movement should be allowed. -void CSceneNodeAnimatorCameraFPS::setVerticalMovement(bool allow) -{ - NoVerticalMovement = !allow; -} - - -//! Sets whether the Y axis of the mouse should be inverted. -void CSceneNodeAnimatorCameraFPS::setInvertMouse(bool invert) -{ - if (invert) - MouseYDirection = -1.0f; - else - MouseYDirection = 1.0f; -} - - -ISceneNodeAnimator* CSceneNodeAnimatorCameraFPS::createClone(ISceneNode* node, ISceneManager* newManager) -{ - CSceneNodeAnimatorCameraFPS * newAnimator = - new CSceneNodeAnimatorCameraFPS(CursorControl, RotateSpeed, MoveSpeed, JumpSpeed, - 0, 0, NoVerticalMovement); - newAnimator->cloneMembers(this); - newAnimator->setKeyMap(KeyMap); - return newAnimator; -} - -void CSceneNodeAnimatorCameraFPS::serializeAttributes(io::IAttributes* out, io::SAttributeReadWriteOptions* options) const -{ - ISceneNodeAnimator::serializeAttributes(out, options); - - out->addFloat("MaxVerticalAngle", MaxVerticalAngle); - out->addBool("NoVerticalMovement", NoVerticalMovement); - out->addFloat("MoveSpeed", MoveSpeed); - out->addFloat("RotateSpeedKeyboard", RotateSpeedKeyboard); - out->addFloat("RotateSpeed", RotateSpeed); - out->addFloat("JumpSpeed", JumpSpeed); - out->addFloat("MouseYDirection", MouseYDirection); - - out->addInt("KeyMapSize", (s32)KeyMap.size()); - for ( u32 i=0; i < KeyMap.size(); ++i ) - { - core::stringc name("Action"); - name += core::stringc(i); - out->addInt(name.c_str(), (int)KeyMap[i].Action); - name = core::stringc("KeyCode") + core::stringc(i); - out->addInt(name.c_str(), (int)KeyMap[i].KeyCode); - } -} - -void CSceneNodeAnimatorCameraFPS::deserializeAttributes(io::IAttributes* in, io::SAttributeReadWriteOptions* options) -{ - ISceneNodeAnimator::deserializeAttributes(in, options); - - MaxVerticalAngle = in->getAttributeAsFloat("MaxVerticalAngle", MaxVerticalAngle); - NoVerticalMovement = in->getAttributeAsBool("NoVerticalMovement", NoVerticalMovement); - MoveSpeed = in->getAttributeAsFloat("MoveSpeed", MoveSpeed); - RotateSpeedKeyboard = in->getAttributeAsFloat("RotateSpeedKeyboard", RotateSpeedKeyboard); - RotateSpeed = in->getAttributeAsFloat("RotateSpeed", RotateSpeed); - JumpSpeed = in->getAttributeAsFloat("JumpSpeed", JumpSpeed); - MouseYDirection = in->getAttributeAsFloat("MouseYDirection", MouseYDirection); - - if ( in->findAttribute("KeyMapSize") ) - { - KeyMap.clear(); - s32 keyMapSize = in->getAttributeAsInt("KeyMapSize"); - for ( u32 i=0; i < (u32)keyMapSize; ++i ) - { - SKeyMap keyMapEntry; - core::stringc name("Action"); - name += core::stringc(i); - keyMapEntry.Action = static_cast<EKEY_ACTION>(in->getAttributeAsInt(name.c_str())); - name = core::stringc("KeyCode") + core::stringc(i); - keyMapEntry.KeyCode = static_cast<EKEY_CODE>(in->getAttributeAsInt(name.c_str())); - KeyMap.push_back(keyMapEntry); - } - } -} - - -} // namespace scene -} // namespace irr - diff --git a/source/Irrlicht/CSceneNodeAnimatorCameraFPS.h b/source/Irrlicht/CSceneNodeAnimatorCameraFPS.h deleted file mode 100644 index 127ea590..00000000 --- a/source/Irrlicht/CSceneNodeAnimatorCameraFPS.h +++ /dev/null @@ -1,145 +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_SCENE_NODE_ANIMATOR_CAMERA_FPS_H_INCLUDED__ -#define __C_SCENE_NODE_ANIMATOR_CAMERA_FPS_H_INCLUDED__ - -#include "ISceneNodeAnimatorCameraFPS.h" -#include "vector2d.h" -#include "position2d.h" -#include "SKeyMap.h" -#include "irrArray.h" - -namespace irr -{ -namespace gui -{ - class ICursorControl; -} - -namespace scene -{ - - //! Special scene node animator for FPS cameras - class CSceneNodeAnimatorCameraFPS : public ISceneNodeAnimatorCameraFPS - { - public: - - //! Constructor - CSceneNodeAnimatorCameraFPS(gui::ICursorControl* cursorControl, - f32 rotateSpeed = 100.0f, f32 moveSpeed = .5f, f32 jumpSpeed=0.f, - SKeyMap* keyMapArray=0, u32 keyMapSize=0, bool noVerticalMovement=false, - bool invertY=false, float rotateSpeedKeyboard = 0.3f); - - //! Destructor - virtual ~CSceneNodeAnimatorCameraFPS(); - - //! Animates the scene node, currently only works on cameras - virtual void animateNode(ISceneNode* node, u32 timeMs) _IRR_OVERRIDE_; - - //! Event receiver - virtual bool OnEvent(const SEvent& event) _IRR_OVERRIDE_; - - //! Returns the speed of movement in units per second - virtual f32 getMoveSpeed() const _IRR_OVERRIDE_; - - //! Sets the speed of movement in units per second - virtual void setMoveSpeed(f32 moveSpeed) _IRR_OVERRIDE_; - - //! Returns the rotation speed when moving mouse - virtual f32 getRotateSpeed() const _IRR_OVERRIDE_; - - //! Set the rotation speed when moving mouse - virtual void setRotateSpeed(f32 rotateSpeed) _IRR_OVERRIDE_; - - //! Returns the rotation speed when using keyboard - virtual f32 getRotateSpeedKeyboard() const _IRR_OVERRIDE_ - { - return RotateSpeedKeyboard; - } - - //! Set the rotation speed when using keyboard - virtual void setRotateSpeedKeyboard(f32 rotateSpeed) _IRR_OVERRIDE_ - { - RotateSpeedKeyboard = rotateSpeed; - } - - //! Sets the keyboard mapping for this animator (old style) - //! \param keymap: an array of keyboard mappings, see SKeyMap - //! \param count: the size of the keyboard map array - virtual void setKeyMap(SKeyMap *map, u32 count) _IRR_OVERRIDE_; - - //! Sets the keyboard mapping for this animator - //! \param keymap The new keymap array - virtual void setKeyMap(const core::array<SKeyMap>& keymap) _IRR_OVERRIDE_; - - //! Gets the keyboard mapping for this animator - virtual const core::array<SKeyMap>& getKeyMap() const _IRR_OVERRIDE_; - - //! Sets whether vertical movement should be allowed. - virtual void setVerticalMovement(bool allow) _IRR_OVERRIDE_; - - //! Sets whether the Y axis of the mouse should be inverted. - /** If enabled then moving the mouse down will cause - the camera to look up. It is disabled by default. */ - virtual void setInvertMouse(bool invert) _IRR_OVERRIDE_; - - //! This animator will receive events when attached to the active camera - virtual bool isEventReceiverEnabled() const _IRR_OVERRIDE_ - { - return true; - } - - //! Returns the type of this animator - virtual ESCENE_NODE_ANIMATOR_TYPE getType() const _IRR_OVERRIDE_ - { - return ESNAT_CAMERA_FPS; - } - - //! Creates a clone of this animator. - /** Please note that you will have to drop - (IReferenceCounted::drop()) the returned pointer once you're - done with it. */ - virtual ISceneNodeAnimator* createClone(ISceneNode* node, ISceneManager* newManager=0) _IRR_OVERRIDE_; - - //! Writes attributes of the scene node animator. - virtual void serializeAttributes(io::IAttributes* out, io::SAttributeReadWriteOptions* options=0) const _IRR_OVERRIDE_; - - //! Reads attributes of the scene node animator. - virtual void deserializeAttributes(io::IAttributes* in, io::SAttributeReadWriteOptions* options=0) _IRR_OVERRIDE_; - - private: - - void allKeysUp(); - - gui::ICursorControl *CursorControl; - bool GrabMouse; - - f32 MaxVerticalAngle; - bool NoVerticalMovement; - - f32 MoveSpeed; - f32 RotateSpeedKeyboard; - f32 RotateSpeed; - f32 JumpSpeed; - // -1.0f for inverted mouse, defaults to 1.0f - f32 MouseYDirection; - - s32 LastAnimationTime; - - core::array<SKeyMap> KeyMap; - core::position2d<f32> CenterCursor, CursorPos; - bool HadMouseEvent; - - bool CursorKeys[EKA_COUNT]; - - bool firstUpdate; - bool firstInput; - }; - -} // end namespace scene -} // end namespace irr - -#endif // __C_SCENE_NODE_ANIMATOR_CAMERA_FPS_H_INCLUDED__ - diff --git a/source/Irrlicht/CSceneNodeAnimatorCameraMaya.cpp b/source/Irrlicht/CSceneNodeAnimatorCameraMaya.cpp deleted file mode 100644 index 69fee69f..00000000 --- a/source/Irrlicht/CSceneNodeAnimatorCameraMaya.cpp +++ /dev/null @@ -1,362 +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 "CSceneNodeAnimatorCameraMaya.h" -#include "ICursorControl.h" -#include "ICameraSceneNode.h" -#include "SViewFrustum.h" -#include "ISceneManager.h" - -namespace irr -{ -namespace scene -{ - -//! constructor -CSceneNodeAnimatorCameraMaya::CSceneNodeAnimatorCameraMaya(gui::ICursorControl* cursor, - f32 rotateSpeed, f32 zoomSpeed, f32 translateSpeed, f32 distance) - : CursorControl(cursor), OldCamera(0), MousePos(0.5f, 0.5f), - TargetMinDistance(0.f), - ZoomSpeed(zoomSpeed), RotateSpeed(rotateSpeed), TranslateSpeed(translateSpeed), - CurrentZoom(distance), RotX(0.0f), RotY(0.0f), - Zooming(false), Rotating(false), Moving(false), Translating(false) -{ - #ifdef _DEBUG - setDebugName("CSceneNodeAnimatorCameraMaya"); - #endif - - if (CursorControl) - { - CursorControl->grab(); - MousePos = CursorControl->getRelativePosition(); - } - - allKeysUp(); -} - - -//! destructor -CSceneNodeAnimatorCameraMaya::~CSceneNodeAnimatorCameraMaya() -{ - if (CursorControl) - CursorControl->drop(); -} - - -//! It is possible to send mouse and key events to the camera. Most cameras -//! may ignore this input, but camera scene nodes which are created for -//! example with scene::ISceneManager::addMayaCameraSceneNode or -//! scene::ISceneManager::addMeshViewerCameraSceneNode, may want to get this input -//! for changing their position, look at target or whatever. -bool CSceneNodeAnimatorCameraMaya::OnEvent(const SEvent& event) -{ - if (event.EventType != EET_MOUSE_INPUT_EVENT) - return false; - - switch(event.MouseInput.Event) - { - case EMIE_LMOUSE_PRESSED_DOWN: - MouseKeys[0] = true; - updateMousePos(); - break; - case EMIE_RMOUSE_PRESSED_DOWN: - MouseKeys[2] = true; - updateMousePos(); - break; - case EMIE_MMOUSE_PRESSED_DOWN: - MouseKeys[1] = true; - updateMousePos(); - break; - case EMIE_LMOUSE_LEFT_UP: - MouseKeys[0] = false; - updateMousePos(); - break; - case EMIE_RMOUSE_LEFT_UP: - MouseKeys[2] = false; - updateMousePos(); - break; - case EMIE_MMOUSE_LEFT_UP: - MouseKeys[1] = false; - updateMousePos(); - break; - case EMIE_MOUSE_MOVED: - // check states again because sometimes the gui has already caught events - MouseKeys[0] = event.MouseInput.isLeftPressed(); - MouseKeys[2] = event.MouseInput.isRightPressed(); - MouseKeys[1] = event.MouseInput.isMiddlePressed(); - updateMousePos(); - break; - default: - return false; - } - return true; -} - -void CSceneNodeAnimatorCameraMaya::updateMousePos() -{ - if ( CursorControl ) - { - MousePos = CursorControl->getRelativePosition(); - } -} - -//! OnAnimate() is called just before rendering the whole scene. -void CSceneNodeAnimatorCameraMaya::animateNode(ISceneNode *node, u32 timeMs) -{ - //Alt + LM = Rotate around camera pivot - //Alt + LM + MM = Dolly forth/back in view direction (speed % distance camera pivot - max distance to pivot) - //Alt + MM = Move on camera plane (Screen center is about the mouse pointer, depending on move speed) - - if (!node || node->getType() != ESNT_CAMERA) - return; - - ICameraSceneNode* camera = static_cast<ICameraSceneNode*>(node); - - // If the camera isn't the active camera, and receiving input, then don't process it. - if (!camera->isInputReceiverEnabled()) - return; - - scene::ISceneManager * smgr = camera->getSceneManager(); - if (smgr && smgr->getActiveCamera() != camera) - return; - - if (OldCamera != camera) - { - LastCameraTarget = OldTarget = camera->getTarget(); - OldCamera = camera; - } - else - { - OldTarget += camera->getTarget() - LastCameraTarget; - } - - f32 nRotX = RotX; - f32 nRotY = RotY; - f32 nZoom = CurrentZoom; - - if ( (isMouseKeyDown(0) && isMouseKeyDown(2)) || isMouseKeyDown(1) ) - { - if (!Zooming) - { - ZoomStart = MousePos; - Zooming = true; - } - else - { - nZoom += (ZoomStart.X - MousePos.X) * ZoomSpeed; - - if (nZoom < TargetMinDistance+0.1f) // jox: fixed bug: bounce back when zooming too close - nZoom = TargetMinDistance+0.1f; - } - } - else if (Zooming) - { - const f32 old = CurrentZoom; - CurrentZoom = CurrentZoom + (ZoomStart.X - MousePos.X ) * ZoomSpeed; - nZoom = CurrentZoom; - - if (nZoom < TargetMinDistance) - nZoom = CurrentZoom = old; - Zooming = false; - } - - // Translation --------------------------------- - - core::vector3df translate(OldTarget); - const core::vector3df upVector(camera->getUpVector()); - const core::vector3df target = camera->getTarget(); - - core::vector3df pos = camera->getPosition(); - core::vector3df tvectX = pos - target; - tvectX = tvectX.crossProduct(upVector); - tvectX.normalize(); - - const SViewFrustum* const va = camera->getViewFrustum(); - core::vector3df tvectY = (va->getFarLeftDown() - va->getFarRightDown()); - tvectY = tvectY.crossProduct(upVector.Y > 0 ? pos - target : target - pos); - tvectY.normalize(); - - if (isMouseKeyDown(2) && !Zooming) - { - if (!Translating) - { - TranslateStart = MousePos; - Translating = true; - } - else - { - translate += tvectX * (TranslateStart.X - MousePos.X)*TranslateSpeed + - tvectY * (TranslateStart.Y - MousePos.Y)*TranslateSpeed; - } - } - else if (Translating) - { - translate += tvectX * (TranslateStart.X - MousePos.X)*TranslateSpeed + - tvectY * (TranslateStart.Y - MousePos.Y)*TranslateSpeed; - OldTarget = translate; - Translating = false; - } - - // Rotation ------------------------------------ - - if (isMouseKeyDown(0) && !Zooming) - { - if (!Rotating) - { - RotateStart = MousePos; - Rotating = true; - nRotX = RotX; - nRotY = RotY; - } - else - { - nRotX += (RotateStart.X - MousePos.X) * RotateSpeed; - nRotY += (RotateStart.Y - MousePos.Y) * RotateSpeed; - } - } - else if (Rotating) - { - RotX += (RotateStart.X - MousePos.X) * RotateSpeed; - RotY += (RotateStart.Y - MousePos.Y) * RotateSpeed; - nRotX = RotX; - nRotY = RotY; - Rotating = false; - } - - // Set pos ------------------------------------ - - pos = translate; - pos.X += nZoom; - - pos.rotateXYBy(nRotY, translate); - pos.rotateXZBy(-nRotX, translate); - - camera->setPosition(pos); - camera->setTarget(translate); - - // Rotation Error ---------------------------- - - // jox: fixed bug: jitter when rotating to the top and bottom of y - pos.set(0,1,0); - pos.rotateXYBy(-nRotY); - pos.rotateXZBy(-nRotX+180.f); - camera->setUpVector(pos); - LastCameraTarget = camera->getTarget(); -} - - -bool CSceneNodeAnimatorCameraMaya::isMouseKeyDown(s32 key) const -{ - return MouseKeys[key]; -} - - -void CSceneNodeAnimatorCameraMaya::allKeysUp() -{ - for (s32 i=0; i<3; ++i) - MouseKeys[i] = false; -} - - -//! Sets the rotation speed -void CSceneNodeAnimatorCameraMaya::setRotateSpeed(f32 speed) -{ - RotateSpeed = speed; -} - - -//! Sets the movement speed -void CSceneNodeAnimatorCameraMaya::setMoveSpeed(f32 speed) -{ - TranslateSpeed = speed; -} - - -//! Sets the zoom speed -void CSceneNodeAnimatorCameraMaya::setZoomSpeed(f32 speed) -{ - ZoomSpeed = speed; -} - - -//! Set the distance -void CSceneNodeAnimatorCameraMaya::setDistance(f32 distance) -{ - CurrentZoom=distance; -} - - -//! Gets the rotation speed -f32 CSceneNodeAnimatorCameraMaya::getRotateSpeed() const -{ - return RotateSpeed; -} - - -// Gets the movement speed -f32 CSceneNodeAnimatorCameraMaya::getMoveSpeed() const -{ - return TranslateSpeed; -} - - -//! Gets the zoom speed -f32 CSceneNodeAnimatorCameraMaya::getZoomSpeed() const -{ - return ZoomSpeed; -} - - -//! Returns the current distance, i.e. orbit radius -f32 CSceneNodeAnimatorCameraMaya::getDistance() const -{ - return CurrentZoom; -} - -void CSceneNodeAnimatorCameraMaya::setTargetMinDistance(f32 minDistance) -{ - TargetMinDistance = minDistance; - if ( CurrentZoom < TargetMinDistance ) - CurrentZoom = TargetMinDistance; -} - -f32 CSceneNodeAnimatorCameraMaya::getTargetMinDistance() const -{ - return TargetMinDistance; -} - - -ISceneNodeAnimator* CSceneNodeAnimatorCameraMaya::createClone(ISceneNode* node, ISceneManager* newManager) -{ - CSceneNodeAnimatorCameraMaya * newAnimator = - new CSceneNodeAnimatorCameraMaya(CursorControl, RotateSpeed, ZoomSpeed, TranslateSpeed); - newAnimator->cloneMembers(this); - return newAnimator; -} - -void CSceneNodeAnimatorCameraMaya::serializeAttributes(io::IAttributes* out, io::SAttributeReadWriteOptions* options) const -{ - ISceneNodeAnimator::serializeAttributes(out, options); - - out->addFloat("TargetMinDistance", TargetMinDistance); - out->addFloat("ZoomSpeed", ZoomSpeed); - out->addFloat("RotateSpeed", RotateSpeed); - out->addFloat("TranslateSpeed", TranslateSpeed); - out->addFloat("CurrentZoom", CurrentZoom); -} - -void CSceneNodeAnimatorCameraMaya::deserializeAttributes(io::IAttributes* in, io::SAttributeReadWriteOptions* options) -{ - ISceneNodeAnimator::deserializeAttributes(in, options); - - TargetMinDistance = in->getAttributeAsFloat("TargetMinDistance", TargetMinDistance); - ZoomSpeed = in->getAttributeAsFloat("ZoomSpeed", ZoomSpeed); - RotateSpeed = in->getAttributeAsFloat("RotateSpeed", RotateSpeed); - TranslateSpeed = in->getAttributeAsFloat("TranslateSpeed", TranslateSpeed); - CurrentZoom = in->getAttributeAsFloat("CurrentZoom", CurrentZoom); -} - -} // end namespace -} // end namespace - diff --git a/source/Irrlicht/CSceneNodeAnimatorCameraMaya.h b/source/Irrlicht/CSceneNodeAnimatorCameraMaya.h deleted file mode 100644 index de03358e..00000000 --- a/source/Irrlicht/CSceneNodeAnimatorCameraMaya.h +++ /dev/null @@ -1,130 +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_SCENE_NODE_ANIMATOR_CAMERA_MAYA_H_INCLUDED__ -#define __C_SCENE_NODE_ANIMATOR_CAMERA_MAYA_H_INCLUDED__ - -#include "ISceneNodeAnimatorCameraMaya.h" -#include "ICameraSceneNode.h" -#include "vector2d.h" - -namespace irr -{ - -namespace gui -{ - class ICursorControl; -} - -namespace scene -{ - - //! Special scene node animator for FPS cameras - /** This scene node animator can be attached to a camera to make it act - like a 3d modeling tool camera - */ - class CSceneNodeAnimatorCameraMaya : public ISceneNodeAnimatorCameraMaya - { - public: - //! Constructor - CSceneNodeAnimatorCameraMaya(gui::ICursorControl* cursor, f32 rotateSpeed = -1500.f, - f32 zoomSpeed = 200.f, f32 translationSpeed = 1500.f, f32 distance=70.f); - - //! Destructor - virtual ~CSceneNodeAnimatorCameraMaya(); - - //! Animates the scene node, currently only works on cameras - virtual void animateNode(ISceneNode* node, u32 timeMs) _IRR_OVERRIDE_; - - //! Event receiver - virtual bool OnEvent(const SEvent& event) _IRR_OVERRIDE_; - - //! Returns the speed of movement in units per millisecond - virtual f32 getMoveSpeed() const _IRR_OVERRIDE_; - - //! Sets the speed of movement in units per millisecond - virtual void setMoveSpeed(f32 moveSpeed) _IRR_OVERRIDE_; - - //! Returns the rotation speed - virtual f32 getRotateSpeed() const _IRR_OVERRIDE_; - - //! Set the rotation speed - virtual void setRotateSpeed(f32 rotateSpeed) _IRR_OVERRIDE_; - - //! Returns the zoom speed - virtual f32 getZoomSpeed() const _IRR_OVERRIDE_; - - //! Set the zoom speed - virtual void setZoomSpeed(f32 zoomSpeed) _IRR_OVERRIDE_; - - //! Returns the current distance, i.e. orbit radius - virtual f32 getDistance() const _IRR_OVERRIDE_; - - //! Set the distance - virtual void setDistance(f32 distance) _IRR_OVERRIDE_; - - //! Set the minimal distance to the camera target for zoom - virtual void setTargetMinDistance(f32 minDistance) _IRR_OVERRIDE_; - - //! Returns the minimal distance to the camera target for zoom - virtual f32 getTargetMinDistance() const _IRR_OVERRIDE_; - - //! This animator will receive events when attached to the active camera - virtual bool isEventReceiverEnabled() const _IRR_OVERRIDE_ - { - return true; - } - - //! Returns type of the scene node - virtual ESCENE_NODE_ANIMATOR_TYPE getType() const _IRR_OVERRIDE_ - { - return ESNAT_CAMERA_MAYA; - } - - //! Creates a clone of this animator. - /** Please note that you will have to drop - (IReferenceCounted::drop()) the returned pointer after calling - this. */ - virtual ISceneNodeAnimator* createClone(ISceneNode* node, ISceneManager* newManager=0) _IRR_OVERRIDE_; - - //! Writes attributes of the scene node animator. - virtual void serializeAttributes(io::IAttributes* out, io::SAttributeReadWriteOptions* options=0) const _IRR_OVERRIDE_; - - //! Reads attributes of the scene node animator. - virtual void deserializeAttributes(io::IAttributes* in, io::SAttributeReadWriteOptions* options=0) _IRR_OVERRIDE_; - - private: - - void updateMousePos(); - void allKeysUp(); - void animate(); - bool isMouseKeyDown(s32 key) const; - - bool MouseKeys[3]; - - gui::ICursorControl *CursorControl; - scene::ICameraSceneNode* OldCamera; - core::vector3df OldTarget; - core::vector3df LastCameraTarget; // to find out if the camera target was moved outside this animator - core::position2df RotateStart; - core::position2df ZoomStart; - core::position2df TranslateStart; - core::position2df MousePos; - f32 TargetMinDistance; - f32 ZoomSpeed; - f32 RotateSpeed; - f32 TranslateSpeed; - f32 CurrentZoom; - f32 RotX, RotY; - bool Zooming; - bool Rotating; - bool Moving; - bool Translating; - }; - -} // end namespace scene -} // end namespace irr - -#endif - diff --git a/source/Irrlicht/CSceneNodeAnimatorCollisionResponse.cpp b/source/Irrlicht/CSceneNodeAnimatorCollisionResponse.cpp deleted file mode 100644 index 8d5b1701..00000000 --- a/source/Irrlicht/CSceneNodeAnimatorCollisionResponse.cpp +++ /dev/null @@ -1,310 +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 "CSceneNodeAnimatorCollisionResponse.h" -#include "ISceneCollisionManager.h" -#include "ISceneManager.h" -#include "ICameraSceneNode.h" -#include "os.h" - -namespace irr -{ -namespace scene -{ - -//! constructor -CSceneNodeAnimatorCollisionResponse::CSceneNodeAnimatorCollisionResponse( - ISceneManager* scenemanager, - ITriangleSelector* world, ISceneNode* object, - const core::vector3df& ellipsoidRadius, - const core::vector3df& gravityPerSecond, - const core::vector3df& ellipsoidTranslation, - f32 slidingSpeed) -: Radius(ellipsoidRadius), Gravity(gravityPerSecond), Translation(ellipsoidTranslation), - World(world), Object(object), SceneManager(scenemanager), LastTime(0), - SlidingSpeed(slidingSpeed), CollisionNode(0), CollisionCallback(0), - Falling(false), IsCamera(false), AnimateCameraTarget(true), CollisionOccurred(false), - FirstUpdate(true) -{ - #ifdef _DEBUG - setDebugName("CSceneNodeAnimatorCollisionResponse"); - #endif - - if (World) - World->grab(); - - setNode(Object); -} - - -//! destructor -CSceneNodeAnimatorCollisionResponse::~CSceneNodeAnimatorCollisionResponse() -{ - if (World) - World->drop(); - - if (CollisionCallback) - CollisionCallback->drop(); -} - - -//! Returns if the attached scene node is falling, which means that -//! there is no blocking wall from the scene node in the direction of -//! the gravity. -bool CSceneNodeAnimatorCollisionResponse::isFalling() const -{ - return Falling; -} - - -//! Sets the radius of the ellipsoid with which collision detection and -//! response is done. -void CSceneNodeAnimatorCollisionResponse::setEllipsoidRadius( - const core::vector3df& radius) -{ - Radius = radius; - FirstUpdate = true; -} - - -//! Returns the radius of the ellipsoid with which the collision detection and -//! response is done. -core::vector3df CSceneNodeAnimatorCollisionResponse::getEllipsoidRadius() const -{ - return Radius; -} - - -//! Sets the gravity of the environment. -void CSceneNodeAnimatorCollisionResponse::setGravity(const core::vector3df& gravity) -{ - Gravity = gravity; - FirstUpdate = true; -} - - -//! Returns current vector of gravity. -core::vector3df CSceneNodeAnimatorCollisionResponse::getGravity() const -{ - return Gravity; -} - - -//! 'Jump' the animator, by adding a jump speed opposite to its gravity -void CSceneNodeAnimatorCollisionResponse::jump(f32 jumpSpeed) -{ - FallingVelocity -= (core::vector3df(Gravity).normalize()) * jumpSpeed; - Falling = true; -} - - -//! Sets the translation of the ellipsoid for collision detection. -void CSceneNodeAnimatorCollisionResponse::setEllipsoidTranslation(const core::vector3df &translation) -{ - Translation = translation; -} - - -//! Returns the translation of the ellipsoid for collision detection. -core::vector3df CSceneNodeAnimatorCollisionResponse::getEllipsoidTranslation() const -{ - return Translation; -} - - -//! Sets a triangle selector holding all triangles of the world with which -//! the scene node may collide. -void CSceneNodeAnimatorCollisionResponse::setWorld(ITriangleSelector* newWorld) -{ - if (newWorld) - newWorld->grab(); - - if (World) - World->drop(); - - World = newWorld; - - FirstUpdate = true; -} - - -//! Returns the current triangle selector containing all triangles for -//! collision detection. -ITriangleSelector* CSceneNodeAnimatorCollisionResponse::getWorld() const -{ - return World; -} - - -void CSceneNodeAnimatorCollisionResponse::animateNode(ISceneNode* node, u32 timeMs) -{ - CollisionOccurred = false; - - if (node != Object) - setNode(node); - - if(!Object || !World) - return; - - // trigger reset - if ( timeMs == 0 ) - { - FirstUpdate = true; - timeMs = LastTime; - } - - if ( FirstUpdate ) - { - LastPosition = Object->getPosition(); - Falling = false; - LastTime = timeMs; - FallingVelocity.set ( 0, 0, 0 ); - - FirstUpdate = false; - } - - const f32 diffSec = (f32)(timeMs - LastTime)*0.001f; - LastTime = timeMs; - - CollisionResultPosition = Object->getPosition(); - core::vector3df vel = CollisionResultPosition - LastPosition; - - FallingVelocity += Gravity * diffSec; - - CollisionTriangle = RefTriangle; - CollisionPoint = core::vector3df(); - CollisionResultPosition = core::vector3df(); - CollisionNode = 0; - - // core::vector3df force = vel + FallingVelocity; - - if ( AnimateCameraTarget ) - { - // TODO: divide SlidingSpeed by frame time - - bool f = false; - CollisionResultPosition - = SceneManager->getSceneCollisionManager()->getCollisionResultPosition( - World, LastPosition-Translation, - Radius, vel, CollisionTriangle, CollisionPoint, f, - CollisionNode, SlidingSpeed, FallingVelocity*diffSec); - - CollisionOccurred = (CollisionTriangle != RefTriangle); - - CollisionResultPosition += Translation; - - if ( diffSec > 0 ) // don't change the state when there was no time - { - if (f)//CollisionTriangle == RefTriangle) - { - Falling = true; - } - else - { - if ( CollisionOccurred ) // f can also happen to be false when FallingVelocity was already 0 (p.e. at top of a jump) - Falling = false; - FallingVelocity.set(0, 0, 0); - } - } - - bool collisionConsumed = false; - - if (CollisionOccurred && CollisionCallback) - collisionConsumed = CollisionCallback->onCollision(*this); - - if(!collisionConsumed) - Object->setPosition(CollisionResultPosition); - } - - // move camera target - if (AnimateCameraTarget && IsCamera) - { - const core::vector3df pdiff = Object->getPosition() - LastPosition - vel; - ICameraSceneNode* cam = (ICameraSceneNode*)Object; - cam->setTarget(cam->getTarget() + pdiff); - } - - LastPosition = Object->getPosition(); -} - - -void CSceneNodeAnimatorCollisionResponse::setNode(ISceneNode* node) -{ - Object = node; - - if (Object) - { - LastPosition = Object->getPosition(); - IsCamera = (Object->getType() == ESNT_CAMERA); - } - - LastTime = os::Timer::getTime(); -} - - -//! Writes attributes of the scene node animator. -void CSceneNodeAnimatorCollisionResponse::serializeAttributes(io::IAttributes* out, io::SAttributeReadWriteOptions* options) const -{ - ISceneNodeAnimatorCollisionResponse::serializeAttributes(out, options); - - out->addVector3d("Radius", Radius); - out->addVector3d("Gravity", Gravity); - out->addVector3d("Translation", Translation); - out->addBool("AnimateCameraTarget", AnimateCameraTarget); -} - - -//! Reads attributes of the scene node animator. -void CSceneNodeAnimatorCollisionResponse::deserializeAttributes(io::IAttributes* in, io::SAttributeReadWriteOptions* options) -{ - ISceneNodeAnimatorCollisionResponse::deserializeAttributes(in, options); - - Radius = in->getAttributeAsVector3d("Radius", Radius); - Gravity = in->getAttributeAsVector3d("Gravity", Gravity); - Translation = in->getAttributeAsVector3d("Translation", Translation); - AnimateCameraTarget = in->getAttributeAsBool("AnimateCameraTarget", AnimateCameraTarget); -} - - -ISceneNodeAnimator* CSceneNodeAnimatorCollisionResponse::createClone(ISceneNode* node, ISceneManager* newManager) -{ - if (!newManager) newManager = SceneManager; - - CSceneNodeAnimatorCollisionResponse * newAnimator = - new CSceneNodeAnimatorCollisionResponse(newManager, World, Object, Radius, - Gravity, Translation, SlidingSpeed); - newAnimator->cloneMembers(this); - return newAnimator; -} - -void CSceneNodeAnimatorCollisionResponse::setCollisionCallback(ICollisionCallback* callback) -{ - if ( CollisionCallback == callback ) - return; - - if (CollisionCallback) - CollisionCallback->drop(); - - CollisionCallback = callback; - - if (CollisionCallback) - CollisionCallback->grab(); -} - -//! Should the Target react on collision ( default = true ) -void CSceneNodeAnimatorCollisionResponse::setAnimateTarget ( bool enable ) -{ - AnimateCameraTarget = enable; - FirstUpdate = true; -} - -//! Should the Target react on collision ( default = true ) -bool CSceneNodeAnimatorCollisionResponse::getAnimateTarget () const -{ - return AnimateCameraTarget; -} - -} // end namespace scene -} // end namespace irr - diff --git a/source/Irrlicht/CSceneNodeAnimatorCollisionResponse.h b/source/Irrlicht/CSceneNodeAnimatorCollisionResponse.h deleted file mode 100644 index 1d490a9e..00000000 --- a/source/Irrlicht/CSceneNodeAnimatorCollisionResponse.h +++ /dev/null @@ -1,157 +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_SCENE_NODE_ANIMATOR_COLLISION_RESPONSE_H_INCLUDED__ -#define __C_SCENE_NODE_ANIMATOR_COLLISION_RESPONSE_H_INCLUDED__ - -#include "ISceneNodeAnimatorCollisionResponse.h" - -namespace irr -{ -namespace scene -{ - - //! Special scene node animator for doing automatic collision detection and response. - /** This scene node animator can be attached to any scene node modifying it in that - way, that it cannot move through walls of the world, is influenced by gravity and - acceleration. This animator is useful for example for first person shooter - games. Attach it for example to a first person shooter camera, and the camera will - behave as the player control in a first person shooter game: The camera stops and - slides at walls, walks up stairs, falls down if there is no floor under it, and so on. - */ - class CSceneNodeAnimatorCollisionResponse : public ISceneNodeAnimatorCollisionResponse - { - public: - - //! constructor - CSceneNodeAnimatorCollisionResponse(ISceneManager* scenemanager, - ITriangleSelector* world, ISceneNode* object, - const core::vector3df& ellipsoidRadius = core::vector3df(30,60,30), - const core::vector3df& gravityPerSecond = core::vector3df(0,-100.0f,0), - const core::vector3df& ellipsoidTranslation = core::vector3df(0,0,0), - f32 slidingSpeed = 0.0005f); - - //! destructor - virtual ~CSceneNodeAnimatorCollisionResponse(); - - //! Returns if the attached scene node is falling, which means that - //! there is no blocking wall from the scene node in the direction of - //! the gravity. - virtual bool isFalling() const _IRR_OVERRIDE_; - - //! Sets the radius of the ellipsoid with which collision detection and - //! response is done. - virtual void setEllipsoidRadius(const core::vector3df& radius) _IRR_OVERRIDE_; - - //! Returns the radius of the ellipsoid with which the collision detection and - //! response is done. - virtual core::vector3df getEllipsoidRadius() const _IRR_OVERRIDE_; - - //! Sets the gravity of the environment. - virtual void setGravity(const core::vector3df& gravity) _IRR_OVERRIDE_; - - //! 'Jump' the animator, by adding a jump speed opposite to its gravity - virtual void jump(f32 jumpSpeed) _IRR_OVERRIDE_; - - //! Should the Target react on collision ( default = true ) - virtual void setAnimateTarget ( bool enable ) _IRR_OVERRIDE_; - virtual bool getAnimateTarget () const _IRR_OVERRIDE_; - - //! Returns current vector of gravity. - virtual core::vector3df getGravity() const _IRR_OVERRIDE_; - - //! Sets the translation of the ellipsoid for collision detection. - virtual void setEllipsoidTranslation(const core::vector3df &translation) _IRR_OVERRIDE_; - - //! Returns the translation of the ellipsoid for collision detection. - virtual core::vector3df getEllipsoidTranslation() const _IRR_OVERRIDE_; - - //! Sets a triangle selector holding all triangles of the world with which - //! the scene node may collide. - virtual void setWorld(ITriangleSelector* newWorld) _IRR_OVERRIDE_; - - //! Returns the current triangle selector containing all triangles for - //! collision detection. - virtual ITriangleSelector* getWorld() const _IRR_OVERRIDE_; - - //! animates a scene node - virtual void animateNode(ISceneNode* node, u32 timeMs) _IRR_OVERRIDE_; - - //! Writes attributes of the scene node animator. - virtual void serializeAttributes(io::IAttributes* out, io::SAttributeReadWriteOptions* options=0) const _IRR_OVERRIDE_; - - //! Reads attributes of the scene node animator. - virtual void deserializeAttributes(io::IAttributes* in, io::SAttributeReadWriteOptions* options=0) _IRR_OVERRIDE_; - - //! Returns type of the scene node animator - virtual ESCENE_NODE_ANIMATOR_TYPE getType() const _IRR_OVERRIDE_ { return ESNAT_COLLISION_RESPONSE; } - - //! Creates a clone of this animator. - /** Please note that you will have to drop - (IReferenceCounted::drop()) the returned pointer after calling - this. */ - virtual ISceneNodeAnimator* createClone(ISceneNode* node, ISceneManager* newManager=0) _IRR_OVERRIDE_; - - //! Set the single node that this animator will act on. - virtual void setTargetNode(ISceneNode * node) _IRR_OVERRIDE_ { setNode(node); } - - //! Gets the single node that this animator is acting on. - virtual ISceneNode* getTargetNode(void) const _IRR_OVERRIDE_ { return Object; } - - //! Returns true if a collision occurred during the last animateNode() - virtual bool collisionOccurred() const _IRR_OVERRIDE_ { return CollisionOccurred; } - - //! Returns the last point of collision. - virtual const core::vector3df & getCollisionPoint() const _IRR_OVERRIDE_ { return CollisionPoint; } - - //! Returns the last triangle that caused a collision. - virtual const core::triangle3df & getCollisionTriangle() const _IRR_OVERRIDE_ { return CollisionTriangle; } - - virtual const core::vector3df & getCollisionResultPosition(void) const _IRR_OVERRIDE_ { return CollisionResultPosition; } - - virtual ISceneNode* getCollisionNode(void) const _IRR_OVERRIDE_ { return CollisionNode; } - - - //! Sets a callback interface which will be called if a collision occurs. - /** \param callback: collision callback handler that will be called when a collision - occurs. Set this to 0 to disable the callback. - */ - virtual void setCollisionCallback(ICollisionCallback* callback) _IRR_OVERRIDE_; - - private: - - void setNode(ISceneNode* node); - - core::vector3df Radius; - core::vector3df Gravity; - core::vector3df Translation; - core::vector3df FallingVelocity; // In the direction of Gravity. - - core::vector3df LastPosition; - core::triangle3df RefTriangle; - - ITriangleSelector* World; - ISceneNode* Object; - ISceneManager* SceneManager; - u32 LastTime; - f32 SlidingSpeed; - - core::vector3df CollisionPoint; - core::triangle3df CollisionTriangle; - core::vector3df CollisionResultPosition; - ISceneNode * CollisionNode; - ICollisionCallback* CollisionCallback; - - bool Falling; - bool IsCamera; - bool AnimateCameraTarget; - bool CollisionOccurred; - bool FirstUpdate; - }; - -} // end namespace scene -} // end namespace irr - -#endif - diff --git a/source/Irrlicht/CSceneNodeAnimatorDelete.cpp b/source/Irrlicht/CSceneNodeAnimatorDelete.cpp deleted file mode 100644 index d152e06c..00000000 --- a/source/Irrlicht/CSceneNodeAnimatorDelete.cpp +++ /dev/null @@ -1,55 +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 "CSceneNodeAnimatorDelete.h" -#include "ISceneManager.h" - -namespace irr -{ -namespace scene -{ - - -//! constructor -CSceneNodeAnimatorDelete::CSceneNodeAnimatorDelete(ISceneManager* manager, u32 time) -: ISceneNodeAnimatorFinishing(time), SceneManager(manager) -{ - #ifdef _DEBUG - setDebugName("CSceneNodeAnimatorDelete"); - #endif -} - - -//! animates a scene node -void CSceneNodeAnimatorDelete::animateNode(ISceneNode* node, u32 timeMs) -{ - if (timeMs > FinishTime+PauseTimeSum) - { - HasFinished = true; - if(node && SceneManager) - { - // don't delete if scene manager is attached to an editor - if (!SceneManager->getParameters()->getAttributeAsBool(IRR_SCENE_MANAGER_IS_EDITOR)) - SceneManager->addToDeletionQueue(node); - } - } -} - - -ISceneNodeAnimator* CSceneNodeAnimatorDelete::createClone(ISceneNode* node, ISceneManager* newManager) -{ - if (!newManager) - newManager = SceneManager; - - CSceneNodeAnimatorDelete* newAnimator = - new CSceneNodeAnimatorDelete(newManager, FinishTime); - newAnimator->cloneMembers(this); - - return newAnimator; -} - - -} // end namespace scene -} // end namespace irr - diff --git a/source/Irrlicht/CSceneNodeAnimatorDelete.h b/source/Irrlicht/CSceneNodeAnimatorDelete.h deleted file mode 100644 index 2e78b416..00000000 --- a/source/Irrlicht/CSceneNodeAnimatorDelete.h +++ /dev/null @@ -1,46 +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_SCENE_NODE_ANIMATOR_DELETE_H_INCLUDED__ -#define __C_SCENE_NODE_ANIMATOR_DELETE_H_INCLUDED__ - -#include "ISceneNodeAnimatorFinishing.h" - -namespace irr -{ -namespace scene -{ - class CSceneNodeAnimatorDelete : public ISceneNodeAnimatorFinishing - { - public: - - //! constructor - CSceneNodeAnimatorDelete(ISceneManager* manager, u32 when); - - //! animates a scene node - virtual void animateNode(ISceneNode* node, u32 timeMs) _IRR_OVERRIDE_; - - //! Returns type of the scene node animator - virtual ESCENE_NODE_ANIMATOR_TYPE getType() const _IRR_OVERRIDE_ - { - return ESNAT_DELETION; - } - - //! Creates a clone of this animator. - /** Please note that you will have to drop - (IReferenceCounted::drop()) the returned pointer after calling - this. */ - virtual ISceneNodeAnimator* createClone(ISceneNode* node, ISceneManager* newManager=0) _IRR_OVERRIDE_; - - private: - - ISceneManager* SceneManager; - }; - - -} // end namespace scene -} // end namespace irr - -#endif - diff --git a/source/Irrlicht/CSceneNodeAnimatorFlyCircle.cpp b/source/Irrlicht/CSceneNodeAnimatorFlyCircle.cpp deleted file mode 100644 index 243ada68..00000000 --- a/source/Irrlicht/CSceneNodeAnimatorFlyCircle.cpp +++ /dev/null @@ -1,107 +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 "CSceneNodeAnimatorFlyCircle.h" - -namespace irr -{ -namespace scene -{ - - -//! constructor -CSceneNodeAnimatorFlyCircle::CSceneNodeAnimatorFlyCircle(u32 time, - const core::vector3df& center, f32 radius, f32 speed, - const core::vector3df& direction, f32 radiusEllipsoid) - : Center(center), Direction(direction), Radius(radius), - RadiusEllipsoid(radiusEllipsoid), Speed(speed) -{ - #ifdef _DEBUG - setDebugName("CSceneNodeAnimatorFlyCircle"); - #endif - - StartTime = time; - - init(); -} - - -void CSceneNodeAnimatorFlyCircle::init() -{ - Direction.normalize(); - - if (Direction.Y != 0) - VecV = core::vector3df(50,0,0).crossProduct(Direction).normalize(); - else - VecV = core::vector3df(0,50,0).crossProduct(Direction).normalize(); - VecU = VecV.crossProduct(Direction).normalize(); -} - - -//! animates a scene node -void CSceneNodeAnimatorFlyCircle::animateNode(ISceneNode* node, u32 timeMs) -{ - if ( 0 == node ) - return; - - f32 time; - - // Check for the condition where the StartTime is in the future. - if(StartTime+PauseTimeSum > timeMs) - time = ((s32)timeMs - (s32)(StartTime+PauseTimeSum)) * Speed; - else - time = (timeMs-(StartTime+PauseTimeSum)) * Speed; - -// node->setPosition(Center + Radius * ((VecU*cosf(time)) + (VecV*sinf(time)))); - f32 r2 = RadiusEllipsoid == 0.f ? Radius : RadiusEllipsoid; - node->setPosition(Center + (Radius*cosf(time)*VecU) + (r2*sinf(time)*VecV ) ); -} - - -//! Writes attributes of the scene node animator. -void CSceneNodeAnimatorFlyCircle::serializeAttributes(io::IAttributes* out, io::SAttributeReadWriteOptions* options) const -{ - ISceneNodeAnimator::serializeAttributes(out, options); - - out->addVector3d("Center", Center); - out->addFloat("Radius", Radius); - out->addFloat("Speed", Speed); - out->addVector3d("Direction", Direction); - out->addFloat("RadiusEllipsoid", RadiusEllipsoid); -} - - -//! Reads attributes of the scene node animator. -void CSceneNodeAnimatorFlyCircle::deserializeAttributes(io::IAttributes* in, io::SAttributeReadWriteOptions* options) -{ - ISceneNodeAnimator::deserializeAttributes(in, options); - - Center = in->getAttributeAsVector3d("Center"); - Radius = in->getAttributeAsFloat("Radius"); - Speed = in->getAttributeAsFloat("Speed"); - Direction = in->getAttributeAsVector3d("Direction"); - - if (Direction.equals(core::vector3df(0,0,0))) - Direction.set(0,1,0); // irrlicht 1.1 backwards compatibility - else - Direction.normalize(); - - RadiusEllipsoid = in->getAttributeAsFloat("RadiusEllipsoid"); - init(); -} - - -ISceneNodeAnimator* CSceneNodeAnimatorFlyCircle::createClone(ISceneNode* node, ISceneManager* newManager) -{ - CSceneNodeAnimatorFlyCircle * newAnimator = - new CSceneNodeAnimatorFlyCircle(StartTime, Center, Radius, Speed, Direction, RadiusEllipsoid); - newAnimator->cloneMembers(this); - - return newAnimator; -} - - -} // end namespace scene -} // end namespace irr - diff --git a/source/Irrlicht/CSceneNodeAnimatorFlyCircle.h b/source/Irrlicht/CSceneNodeAnimatorFlyCircle.h deleted file mode 100644 index ee838755..00000000 --- a/source/Irrlicht/CSceneNodeAnimatorFlyCircle.h +++ /dev/null @@ -1,63 +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_SCENE_NODE_ANIMATOR_FLY_CIRCLE_H_INCLUDED__ -#define __C_SCENE_NODE_ANIMATOR_FLY_CIRCLE_H_INCLUDED__ - -#include "ISceneNode.h" - -namespace irr -{ -namespace scene -{ - class CSceneNodeAnimatorFlyCircle : public ISceneNodeAnimator - { - public: - - //! constructor - CSceneNodeAnimatorFlyCircle(u32 time, - const core::vector3df& center, f32 radius, - f32 speed, const core::vector3df& direction, - f32 radiusEllipsoid); - - //! animates a scene node - virtual void animateNode(ISceneNode* node, u32 timeMs) _IRR_OVERRIDE_; - - //! Writes attributes of the scene node animator. - virtual void serializeAttributes(io::IAttributes* out, io::SAttributeReadWriteOptions* options=0) const _IRR_OVERRIDE_; - - //! Reads attributes of the scene node animator. - virtual void deserializeAttributes(io::IAttributes* in, io::SAttributeReadWriteOptions* options=0) _IRR_OVERRIDE_; - - //! Returns type of the scene node animator - virtual ESCENE_NODE_ANIMATOR_TYPE getType() const _IRR_OVERRIDE_ { return ESNAT_FLY_CIRCLE; } - - //! Creates a clone of this animator. - /** Please note that you will have to drop - (IReferenceCounted::drop()) the returned pointer after calling - this. */ - virtual ISceneNodeAnimator* createClone(ISceneNode* node, ISceneManager* newManager=0) _IRR_OVERRIDE_; - - private: - // do some initial calculations - void init(); - - // circle center - core::vector3df Center; - // up-vector, normal to the circle's plane - core::vector3df Direction; - // Two helper vectors - core::vector3df VecU; - core::vector3df VecV; - f32 Radius; - f32 RadiusEllipsoid; - f32 Speed; - }; - - -} // end namespace scene -} // end namespace irr - -#endif - diff --git a/source/Irrlicht/CSceneNodeAnimatorFlyStraight.cpp b/source/Irrlicht/CSceneNodeAnimatorFlyStraight.cpp deleted file mode 100644 index 1cc6af1b..00000000 --- a/source/Irrlicht/CSceneNodeAnimatorFlyStraight.cpp +++ /dev/null @@ -1,119 +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 "CSceneNodeAnimatorFlyStraight.h" - -namespace irr -{ -namespace scene -{ - - -//! constructor -CSceneNodeAnimatorFlyStraight::CSceneNodeAnimatorFlyStraight(const core::vector3df& startPoint, - const core::vector3df& endPoint, u32 timeForWay, - bool loop, u32 now, bool pingpong) -: ISceneNodeAnimatorFinishing(now + timeForWay), - Start(startPoint), End(endPoint), TimeFactor(0.0f), - TimeForWay(timeForWay), Loop(loop), PingPong(pingpong) -{ - #ifdef _DEBUG - setDebugName("CSceneNodeAnimatorFlyStraight"); - #endif - - StartTime = now; - - recalculateIntermediateValues(); -} - - -void CSceneNodeAnimatorFlyStraight::recalculateIntermediateValues() -{ - Vector = End - Start; - TimeFactor = (f32)Vector.getLength() / TimeForWay; - Vector.normalize(); -} - - -//! animates a scene node -void CSceneNodeAnimatorFlyStraight::animateNode(ISceneNode* node, u32 timeMs) -{ - if (!node) - return; - - u32 t = (timeMs-(StartTime+PauseTimeSum)); - - core::vector3df pos; - - if (!Loop && !PingPong && t >= TimeForWay) - { - pos = End; - HasFinished = true; - } - else if (!Loop && PingPong && t >= TimeForWay * 2.f ) - { - pos = Start; - HasFinished = true; - } - else - { - f32 phase = fmodf( (f32) t, (f32) TimeForWay ); - core::vector3df rel = Vector * phase * TimeFactor; - const bool pong = PingPong && fmodf( (f32) t, (f32) TimeForWay*2.f ) >= TimeForWay; - - if ( !pong ) - { - pos += Start + rel; - } - else - { - pos = End - rel; - } - } - - node->setPosition(pos); -} - - -//! Writes attributes of the scene node animator. -void CSceneNodeAnimatorFlyStraight::serializeAttributes(io::IAttributes* out, io::SAttributeReadWriteOptions* options) const -{ - ISceneNodeAnimatorFinishing::serializeAttributes(out, options); - - out->addVector3d("Start", Start); - out->addVector3d("End", End); - out->addInt("TimeForWay", TimeForWay); - out->addBool("Loop", Loop); - out->addBool("PingPong", PingPong); -} - - -//! Reads attributes of the scene node animator. -void CSceneNodeAnimatorFlyStraight::deserializeAttributes(io::IAttributes* in, io::SAttributeReadWriteOptions* options) -{ - ISceneNodeAnimatorFinishing::deserializeAttributes(in, options); - - Start = in->getAttributeAsVector3d("Start"); - End = in->getAttributeAsVector3d("End"); - TimeForWay = in->getAttributeAsInt("TimeForWay"); - Loop = in->getAttributeAsBool("Loop"); - PingPong = in->getAttributeAsBool("PingPong"); - - recalculateIntermediateValues(); -} - - -ISceneNodeAnimator* CSceneNodeAnimatorFlyStraight::createClone(ISceneNode* node, ISceneManager* newManager) -{ - CSceneNodeAnimatorFlyStraight * newAnimator = - new CSceneNodeAnimatorFlyStraight(Start, End, TimeForWay, Loop, StartTime, PingPong); - newAnimator->cloneMembers(this); - - return newAnimator; -} - - -} // end namespace scene -} // end namespace irr - diff --git a/source/Irrlicht/CSceneNodeAnimatorFlyStraight.h b/source/Irrlicht/CSceneNodeAnimatorFlyStraight.h deleted file mode 100644 index c7040a00..00000000 --- a/source/Irrlicht/CSceneNodeAnimatorFlyStraight.h +++ /dev/null @@ -1,58 +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_SCENE_NODE_ANIMATOR_FLY_STRAIGHT_H_INCLUDED__ -#define __C_SCENE_NODE_ANIMATOR_FLY_STRAIGHT_H_INCLUDED__ - -#include "ISceneNodeAnimatorFinishing.h" - -namespace irr -{ -namespace scene -{ - class CSceneNodeAnimatorFlyStraight : public ISceneNodeAnimatorFinishing - { - public: - - //! constructor - CSceneNodeAnimatorFlyStraight(const core::vector3df& startPoint, - const core::vector3df& endPoint, - u32 timeForWay, - bool loop, u32 now, bool pingpong); - - //! animates a scene node - virtual void animateNode(ISceneNode* node, u32 timeMs) _IRR_OVERRIDE_; - - //! Writes attributes of the scene node animator. - virtual void serializeAttributes(io::IAttributes* out, io::SAttributeReadWriteOptions* options=0) const _IRR_OVERRIDE_; - - //! Reads attributes of the scene node animator. - virtual void deserializeAttributes(io::IAttributes* in, io::SAttributeReadWriteOptions* options=0) _IRR_OVERRIDE_; - - //! Returns type of the scene node animator - virtual ESCENE_NODE_ANIMATOR_TYPE getType() const _IRR_OVERRIDE_ { return ESNAT_FLY_STRAIGHT; } - - //! Creates a clone of this animator. - /** Please note that you will have to drop - (IReferenceCounted::drop()) the returned pointer after calling this. */ - virtual ISceneNodeAnimator* createClone(ISceneNode* node, ISceneManager* newManager=0) _IRR_OVERRIDE_; - - private: - - void recalculateIntermediateValues(); - - core::vector3df Start; - core::vector3df End; - core::vector3df Vector; - f32 TimeFactor; - u32 TimeForWay; - bool Loop; - bool PingPong; - }; - - -} // end namespace scene -} // end namespace irr - -#endif diff --git a/source/Irrlicht/CSceneNodeAnimatorFollowSpline.cpp b/source/Irrlicht/CSceneNodeAnimatorFollowSpline.cpp deleted file mode 100644 index 6bbf20c3..00000000 --- a/source/Irrlicht/CSceneNodeAnimatorFollowSpline.cpp +++ /dev/null @@ -1,168 +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 "CSceneNodeAnimatorFollowSpline.h" - -namespace irr -{ -namespace scene -{ - - -//! constructor -CSceneNodeAnimatorFollowSpline::CSceneNodeAnimatorFollowSpline(u32 time, - const core::array<core::vector3df>& points, f32 speed, - f32 tightness, bool loop, bool pingpong) -: ISceneNodeAnimatorFinishing(0), Points(points), Speed(speed), Tightness(tightness) -, Loop(loop), PingPong(pingpong) -{ - #ifdef _DEBUG - setDebugName("CSceneNodeAnimatorFollowSpline"); - #endif - - StartTime = time; -} - - -inline s32 CSceneNodeAnimatorFollowSpline::clamp(s32 idx, s32 size) -{ - return ( idx<0 ? size+idx : ( idx>=size ? idx-size : idx ) ); -} - - -//! animates a scene node -void CSceneNodeAnimatorFollowSpline::animateNode(ISceneNode* node, u32 timeMs) -{ - if(!node) - return; - - const u32 pSize = Points.size(); - if (pSize==0) - { - if ( !Loop ) - HasFinished = true; - return; - } - if (pSize==1) - { - if ( timeMs > (StartTime+PauseTimeSum) ) - { - node->setPosition(Points[0]); - if ( !Loop ) - HasFinished = true; - } - return; - } - - const f32 dt = ( (timeMs-(StartTime+PauseTimeSum)) * Speed * 0.001f ); - const s32 unwrappedIdx = core::floor32( dt ); - if ( !Loop && unwrappedIdx >= (s32)pSize-1 ) - { - node->setPosition(Points[pSize-1]); - HasFinished = true; - return; - } - const bool pong = PingPong && (unwrappedIdx/(pSize-1))%2; - const f32 u = pong ? 1.f-core::fract ( dt ) : core::fract ( dt ); - const s32 idx = pong ? (pSize-2) - (unwrappedIdx % (pSize-1)) - : (PingPong ? unwrappedIdx % (pSize-1) - : unwrappedIdx % pSize); - //const f32 u = 0.001f * fmodf( dt, 1000.0f ); - - const core::vector3df& p0 = Points[ clamp( idx - 1, pSize ) ]; - const core::vector3df& p1 = Points[ clamp( idx + 0, pSize ) ]; // starting point - const core::vector3df& p2 = Points[ clamp( idx + 1, pSize ) ]; // end point - const core::vector3df& p3 = Points[ clamp( idx + 2, pSize ) ]; - - // hermite polynomials - const f32 h1 = 2.0f * u * u * u - 3.0f * u * u + 1.0f; - const f32 h2 = -2.0f * u * u * u + 3.0f * u * u; - const f32 h3 = u * u * u - 2.0f * u * u + u; - const f32 h4 = u * u * u - u * u; - - // tangents - const core::vector3df t1 = ( p2 - p0 ) * Tightness; - const core::vector3df t2 = ( p3 - p1 ) * Tightness; - - // interpolated point - node->setPosition(p1 * h1 + p2 * h2 + t1 * h3 + t2 * h4); -} - - -//! Writes attributes of the scene node animator. -void CSceneNodeAnimatorFollowSpline::serializeAttributes(io::IAttributes* out, io::SAttributeReadWriteOptions* options) const -{ - ISceneNodeAnimatorFinishing::serializeAttributes(out, options); - - out->addFloat("Speed", Speed); - out->addFloat("Tightness", Tightness); - out->addBool("Loop", Loop); - out->addBool("PingPong", PingPong); - - u32 count = Points.size(); - - if ( options && (options->Flags & io::EARWF_FOR_EDITOR)) - { - // add one point in addition when serializing for editors - // to make it easier to add points quickly - count += 1; - } - - for (u32 i=0; i<count; ++i) - { - core::stringc tname = "Point"; - tname += (int)(i+1); - - out->addVector3d(tname.c_str(), i<Points.size() ? Points[i] : core::vector3df(0,0,0) ); - } -} - - -//! Reads attributes of the scene node animator. -void CSceneNodeAnimatorFollowSpline::deserializeAttributes(io::IAttributes* in, io::SAttributeReadWriteOptions* options) -{ - ISceneNodeAnimatorFinishing::deserializeAttributes(in, options); - - Speed = in->getAttributeAsFloat("Speed"); - Tightness = in->getAttributeAsFloat("Tightness"); - Loop = in->getAttributeAsBool("Loop"); - PingPong = in->getAttributeAsBool("PingPong"); - Points.clear(); - - for(u32 i=1; true; ++i) - { - core::stringc pname = "Point"; - pname += i; - - if (in->existsAttribute(pname.c_str())) - Points.push_back(in->getAttributeAsVector3d(pname.c_str())); - else - break; - } - - // remove last point if double entry from editor - if ( options && (options->Flags & io::EARWF_FOR_EDITOR) && - Points.size() > 2 && Points.getLast() == core::vector3df(0,0,0)) - { - Points.erase(Points.size()-1); - - if (Points.size() > 2 && Points.getLast() == core::vector3df(0,0,0)) - Points.erase(Points.size()-1); - } -} - - -ISceneNodeAnimator* CSceneNodeAnimatorFollowSpline::createClone(ISceneNode* node, ISceneManager* newManager) -{ - CSceneNodeAnimatorFollowSpline * newAnimator = - new CSceneNodeAnimatorFollowSpline(StartTime, Points, Speed, Tightness); - newAnimator->cloneMembers(this); - - return newAnimator; -} - - -} // end namespace scene -} // end namespace irr - diff --git a/source/Irrlicht/CSceneNodeAnimatorFollowSpline.h b/source/Irrlicht/CSceneNodeAnimatorFollowSpline.h deleted file mode 100644 index b0eec698..00000000 --- a/source/Irrlicht/CSceneNodeAnimatorFollowSpline.h +++ /dev/null @@ -1,62 +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_SCENE_NODE_ANIMATOR_FOLLOW_SPLINE_H_INCLUDED__ -#define __C_SCENE_NODE_ANIMATOR_FOLLOW_SPLINE_H_INCLUDED__ - -#include "ISceneNode.h" -#include "irrArray.h" -#include "ISceneNodeAnimatorFinishing.h" - -namespace irr -{ -namespace scene -{ - //! Scene node animator based free code Matthias Gall wrote and sent in. (Most of - //! this code is written by him, I only modified bits.) - class CSceneNodeAnimatorFollowSpline : public ISceneNodeAnimatorFinishing - { - public: - - //! constructor - CSceneNodeAnimatorFollowSpline(u32 startTime, - const core::array< core::vector3df >& points, - f32 speed = 1.0f, f32 tightness = 0.5f, bool loop=true, bool pingpong=false); - - //! animates a scene node - virtual void animateNode(ISceneNode* node, u32 timeMs) _IRR_OVERRIDE_; - - //! Writes attributes of the scene node animator. - virtual void serializeAttributes(io::IAttributes* out, io::SAttributeReadWriteOptions* options=0) const _IRR_OVERRIDE_; - - //! Reads attributes of the scene node animator. - virtual void deserializeAttributes(io::IAttributes* in, io::SAttributeReadWriteOptions* options=0) _IRR_OVERRIDE_; - - //! Returns type of the scene node animator - virtual ESCENE_NODE_ANIMATOR_TYPE getType() const _IRR_OVERRIDE_ { return ESNAT_FOLLOW_SPLINE; } - - //! Creates a clone of this animator. - /** Please note that you will have to drop - (IReferenceCounted::drop()) the returned pointer after calling - this. */ - virtual ISceneNodeAnimator* createClone(ISceneNode* node, ISceneManager* newManager=0) _IRR_OVERRIDE_; - - protected: - - //! clamps a the value idx to fit into range 0..size-1 - s32 clamp(s32 idx, s32 size); - - core::array< core::vector3df > Points; - f32 Speed; - f32 Tightness; - bool Loop; - bool PingPong; - }; - - -} // end namespace scene -} // end namespace irr - -#endif - diff --git a/source/Irrlicht/CSceneNodeAnimatorRotation.cpp b/source/Irrlicht/CSceneNodeAnimatorRotation.cpp deleted file mode 100644 index d9119f90..00000000 --- a/source/Irrlicht/CSceneNodeAnimatorRotation.cpp +++ /dev/null @@ -1,80 +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 "CSceneNodeAnimatorRotation.h" - -namespace irr -{ -namespace scene -{ - - -//! constructor -CSceneNodeAnimatorRotation::CSceneNodeAnimatorRotation(u32 time, const core::vector3df& rotation) -: Rotation(rotation) -{ - #ifdef _DEBUG - setDebugName("CSceneNodeAnimatorRotation"); - #endif - - StartTime = time; -} - - -//! animates a scene node -void CSceneNodeAnimatorRotation::animateNode(ISceneNode* node, u32 timeMs) -{ - if (node) // thanks to warui for this fix - { - const u32 diffTime = timeMs - StartTime; - - if (diffTime != 0) - { - // clip the rotation to small values, to avoid - // precision problems with huge floats. - core::vector3df rot = node->getRotation() + Rotation*(diffTime*0.1f); - if (rot.X>360.f) - rot.X=fmodf(rot.X, 360.f); - if (rot.Y>360.f) - rot.Y=fmodf(rot.Y, 360.f); - if (rot.Z>360.f) - rot.Z=fmodf(rot.Z, 360.f); - node->setRotation(rot); - StartTime=timeMs; - } - } -} - - -//! Writes attributes of the scene node animator. -void CSceneNodeAnimatorRotation::serializeAttributes(io::IAttributes* out, io::SAttributeReadWriteOptions* options) const -{ - ISceneNodeAnimator::serializeAttributes(out, options); - - out->addVector3d("Rotation", Rotation); -} - - -//! Reads attributes of the scene node animator. -void CSceneNodeAnimatorRotation::deserializeAttributes(io::IAttributes* in, io::SAttributeReadWriteOptions* options) -{ - ISceneNodeAnimator::deserializeAttributes(in, options); - - Rotation = in->getAttributeAsVector3d("Rotation"); -} - - -ISceneNodeAnimator* CSceneNodeAnimatorRotation::createClone(ISceneNode* node, ISceneManager* newManager) -{ - CSceneNodeAnimatorRotation * newAnimator = - new CSceneNodeAnimatorRotation(StartTime, Rotation); - newAnimator->cloneMembers(this); - - return newAnimator; -} - - -} // end namespace scene -} // end namespace irr - diff --git a/source/Irrlicht/CSceneNodeAnimatorRotation.h b/source/Irrlicht/CSceneNodeAnimatorRotation.h deleted file mode 100644 index a62a8ed4..00000000 --- a/source/Irrlicht/CSceneNodeAnimatorRotation.h +++ /dev/null @@ -1,48 +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_SCENE_NODE_ANIMATOR_ROTATION_H_INCLUDED__ -#define __C_SCENE_NODE_ANIMATOR_ROTATION_H_INCLUDED__ - -#include "ISceneNode.h" - -namespace irr -{ -namespace scene -{ - class CSceneNodeAnimatorRotation : public ISceneNodeAnimator - { - public: - - //! constructor - CSceneNodeAnimatorRotation(u32 time, const core::vector3df& rotation); - - //! animates a scene node - virtual void animateNode(ISceneNode* node, u32 timeMs) _IRR_OVERRIDE_; - - //! Writes attributes of the scene node animator. - virtual void serializeAttributes(io::IAttributes* out, io::SAttributeReadWriteOptions* options=0) const _IRR_OVERRIDE_; - - //! Reads attributes of the scene node animator. - virtual void deserializeAttributes(io::IAttributes* in, io::SAttributeReadWriteOptions* options=0) _IRR_OVERRIDE_; - - //! Returns type of the scene node animator - virtual ESCENE_NODE_ANIMATOR_TYPE getType() const _IRR_OVERRIDE_ { return ESNAT_ROTATION; } - - //! Creates a clone of this animator. - /** Please note that you will have to drop - (IReferenceCounted::drop()) the returned pointer after calling this. */ - virtual ISceneNodeAnimator* createClone(ISceneNode* node, ISceneManager* newManager=0) _IRR_OVERRIDE_; - - private: - - core::vector3df Rotation; - }; - - -} // end namespace scene -} // end namespace irr - -#endif - diff --git a/source/Irrlicht/CSceneNodeAnimatorTexture.cpp b/source/Irrlicht/CSceneNodeAnimatorTexture.cpp deleted file mode 100644 index 149639b4..00000000 --- a/source/Irrlicht/CSceneNodeAnimatorTexture.cpp +++ /dev/null @@ -1,146 +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 "CSceneNodeAnimatorTexture.h" -#include "ITexture.h" - -namespace irr -{ -namespace scene -{ - - -//! constructor -CSceneNodeAnimatorTexture::CSceneNodeAnimatorTexture(const core::array<video::ITexture*>& textures, - s32 timePerFrame, bool loop, u32 now) -: ISceneNodeAnimatorFinishing(0), - TimePerFrame(timePerFrame), Loop(loop) -{ - #ifdef _DEBUG - setDebugName("CSceneNodeAnimatorTexture"); - #endif - - for (u32 i=0; i<textures.size(); ++i) - { - if (textures[i]) - textures[i]->grab(); - - Textures.push_back(textures[i]); - } - - StartTime = now; - FinishTime = now + (timePerFrame * Textures.size()); -} - - -//! destructor -CSceneNodeAnimatorTexture::~CSceneNodeAnimatorTexture() -{ - clearTextures(); -} - - -void CSceneNodeAnimatorTexture::clearTextures() -{ - for (u32 i=0; i<Textures.size(); ++i) - if (Textures[i]) - Textures[i]->drop(); -} - - -//! animates a scene node -void CSceneNodeAnimatorTexture::animateNode(ISceneNode* node, u32 timeMs) -{ - if(!node) - return; - - if (Textures.size()) - { - const u32 t = (timeMs-(StartTime+PauseTimeSum)); - - u32 idx = 0; - if (!Loop && timeMs >= FinishTime+PauseTimeSum) - { - idx = Textures.size() - 1; - HasFinished = true; - } - else - { - idx = (t/TimePerFrame) % Textures.size(); - } - - if (idx < Textures.size()) - node->setMaterialTexture(0, Textures[idx]); - } -} - - -//! Writes attributes of the scene node animator. -void CSceneNodeAnimatorTexture::serializeAttributes(io::IAttributes* out, io::SAttributeReadWriteOptions* options) const -{ - ISceneNodeAnimatorFinishing::serializeAttributes(out, options); - - out->addInt("TimePerFrame", TimePerFrame); - out->addBool("Loop", Loop); - - // add one texture in addition when serializing for editors - // to make it easier to add textures quickly - - u32 count = Textures.size(); - if ( options && (options->Flags & io::EARWF_FOR_EDITOR)) - count += 1; - - for (u32 i=0; i<count; ++i) - { - core::stringc tname = "Texture"; - tname += (int)(i+1); - - out->addTexture(tname.c_str(), i<Textures.size() ? Textures[i] : 0); - } -} - - -//! Reads attributes of the scene node animator. -void CSceneNodeAnimatorTexture::deserializeAttributes(io::IAttributes* in, io::SAttributeReadWriteOptions* options) -{ - ISceneNodeAnimatorFinishing::deserializeAttributes(in, options); - - TimePerFrame = in->getAttributeAsInt("TimePerFrame"); - Loop = in->getAttributeAsBool("Loop"); - - clearTextures(); - - for(u32 i=1; true; ++i) - { - core::stringc tname = "Texture"; - tname += (int)i; - - if (in->existsAttribute(tname.c_str())) - { - video::ITexture* tex = in->getAttributeAsTexture(tname.c_str()); - if (tex) - { - tex->grab(); - Textures.push_back(tex); - } - } - else - break; - } -} - - -ISceneNodeAnimator* CSceneNodeAnimatorTexture::createClone(ISceneNode* node, ISceneManager* newManager) -{ - CSceneNodeAnimatorTexture * newAnimator = - new CSceneNodeAnimatorTexture(Textures, TimePerFrame, Loop, StartTime); - newAnimator->cloneMembers(this); - - return newAnimator; -} - - -} // end namespace scene -} // end namespace irr - diff --git a/source/Irrlicht/CSceneNodeAnimatorTexture.h b/source/Irrlicht/CSceneNodeAnimatorTexture.h deleted file mode 100644 index 08c1a727..00000000 --- a/source/Irrlicht/CSceneNodeAnimatorTexture.h +++ /dev/null @@ -1,59 +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_SCENE_NODE_ANIMATOR_TEXTURE_H_INCLUDED__ -#define __C_SCENE_NODE_ANIMATOR_TEXTURE_H_INCLUDED__ - -#include "irrArray.h" -#include "ISceneNodeAnimatorFinishing.h" - -namespace irr -{ -namespace scene -{ - class CSceneNodeAnimatorTexture : public ISceneNodeAnimatorFinishing - { - public: - - //! constructor - CSceneNodeAnimatorTexture(const core::array<video::ITexture*>& textures, - s32 timePerFrame, bool loop, u32 now); - - //! destructor - virtual ~CSceneNodeAnimatorTexture(); - - //! animates a scene node - virtual void animateNode(ISceneNode* node, u32 timeMs) _IRR_OVERRIDE_; - - //! Writes attributes of the scene node animator. - virtual void serializeAttributes(io::IAttributes* out, io::SAttributeReadWriteOptions* options=0) const _IRR_OVERRIDE_; - - //! Reads attributes of the scene node animator. - virtual void deserializeAttributes(io::IAttributes* in, io::SAttributeReadWriteOptions* options=0) _IRR_OVERRIDE_; - - //! Returns type of the scene node animator - virtual ESCENE_NODE_ANIMATOR_TYPE getType() const _IRR_OVERRIDE_ { return ESNAT_TEXTURE; } - - //! Creates a clone of this animator. - /** Please note that you will have to drop - (IReferenceCounted::drop()) the returned pointer after calling - this. */ - virtual ISceneNodeAnimator* createClone(ISceneNode* node, ISceneManager* newManager=0) _IRR_OVERRIDE_; - - - private: - - void clearTextures(); - - core::array<video::ITexture*> Textures; - u32 TimePerFrame; - bool Loop; - }; - - -} // end namespace scene -} // end namespace irr - -#endif - diff --git a/source/Irrlicht/CShadowVolumeSceneNode.cpp b/source/Irrlicht/CShadowVolumeSceneNode.cpp deleted file mode 100644 index 9c7b3ab1..00000000 --- a/source/Irrlicht/CShadowVolumeSceneNode.cpp +++ /dev/null @@ -1,531 +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_SHADOW_VOLUME_SCENENODE_ - -#include "CShadowVolumeSceneNode.h" -#include "ISceneManager.h" -#include "IMesh.h" -#include "IVideoDriver.h" -#include "ICameraSceneNode.h" -#include "SViewFrustum.h" -#include "SLight.h" -#include "os.h" - -namespace irr -{ -namespace scene -{ - - -//! constructor -CShadowVolumeSceneNode::CShadowVolumeSceneNode(const IMesh* shadowMesh, ISceneNode* parent, - ISceneManager* mgr, s32 id, bool zfailmethod, f32 infinity) -: IShadowVolumeSceneNode(parent, mgr, id), - AdjacencyDirtyFlag(true), - ShadowMesh(0), IndexCount(0), VertexCount(0), ShadowVolumesUsed(0), - Infinity(infinity), UseZFailMethod(zfailmethod), Optimization(ESV_SILHOUETTE_BY_POS) -{ - #ifdef _DEBUG - setDebugName("CShadowVolumeSceneNode"); - #endif - setShadowMesh(shadowMesh); - setAutomaticCulling(scene::EAC_OFF); -} - - -//! destructor -CShadowVolumeSceneNode::~CShadowVolumeSceneNode() -{ - if (ShadowMesh) - ShadowMesh->drop(); -} - - -void CShadowVolumeSceneNode::createShadowVolume(const core::vector3df& light, bool isDirectional) -{ - SShadowVolume* svp = 0; - core::aabbox3d<f32>* bb = 0; - - // builds the shadow volume and adds it to the shadow volume list. - - if (ShadowVolumes.size() > ShadowVolumesUsed) - { - // get the next unused buffer - - svp = &ShadowVolumes[ShadowVolumesUsed]; - svp->set_used(0); - - bb = &ShadowBBox[ShadowVolumesUsed]; - } - else - { - ShadowVolumes.push_back(SShadowVolume()); - svp = &ShadowVolumes.getLast(); - - ShadowBBox.push_back(core::aabbox3d<f32>()); - bb = &ShadowBBox.getLast(); - } - svp->reallocate(IndexCount*5); - ++ShadowVolumesUsed; - - // We use triangle lists - Edges.set_used(IndexCount*2); - u32 numEdges = 0; - - numEdges=createEdgesAndCaps(light, isDirectional, svp, bb); - - // for all edges add the near->far quads - core::vector3df lightDir1(light*Infinity); - core::vector3df lightDir2(light*Infinity); - for (u32 i=0; i<numEdges; ++i) - { - const core::vector3df &v1 = Vertices[Edges[2*i+0]]; - const core::vector3df &v2 = Vertices[Edges[2*i+1]]; - if ( !isDirectional ) - { - lightDir1 = (v1 - light).normalize()*Infinity; - lightDir2 = (v2 - light).normalize()*Infinity; - } - const core::vector3df v3(v1+lightDir1); - const core::vector3df v4(v2+lightDir2); - - // Add a quad (two triangles) to the vertex list -#ifdef _DEBUG - if (svp->size() >= svp->allocated_size()-5) - os::Printer::log("Allocation too small.", ELL_DEBUG); -#endif - svp->push_back(v1); - svp->push_back(v2); - svp->push_back(v3); - - svp->push_back(v2); - svp->push_back(v4); - svp->push_back(v3); - } -} - -// TODO. -// Not sure what's going on. Either FaceData should mean the opposite and true should mean facing away from light -// or I'm missing something else. Anyway - when not setting this then Shadows will look wrong on Burnings driver -// while they seem to look OK on first view either way on other drivers. Only tested with z-fail so far. -// Maybe errors only show up close to near/far plane on other drivers as otherwise the stencil-buffer-count -// is probably ending up with same value anyway -#define IRR_USE_REVERSE_EXTRUDED - -u32 CShadowVolumeSceneNode::createEdgesAndCaps(const core::vector3df& light, bool isDirectional, - SShadowVolume* svp, core::aabbox3d<f32>* bb) -{ - u32 numEdges=0; - const u32 faceCount = IndexCount / 3; - - if(faceCount >= 1) - bb->reset(Vertices[Indices[0]]); - else - bb->reset(0,0,0); - - // Check every face if it is front or back facing the light. - core::vector3df lightDir0(light); - core::vector3df lightDir1(light); - core::vector3df lightDir2(light); - for (u32 i=0; i<faceCount; ++i) - { - const core::vector3df v0 = Vertices[Indices[3*i+0]]; - const core::vector3df v1 = Vertices[Indices[3*i+1]]; - const core::vector3df v2 = Vertices[Indices[3*i+2]]; - - if ( !isDirectional ) - { - lightDir0 = (v0-light).normalize(); - } -#ifdef IRR_USE_REVERSE_EXTRUDED - FaceData[i]=core::triangle3df(v2,v1,v0).isFrontFacing(lightDir0); // actually the back-facing polygons -#else - FaceData[i]=core::triangle3df(v0,v1,v2).isFrontFacing(lightDir0); -#endif - -#if 0 // Useful for internal debugging & testing. Show all the faces in the light. - if ( FaceData[i] ) - { - video::SMaterial m; - m.Lighting = false; - SceneManager->getVideoDriver()->setMaterial(m); -#ifdef IRR_USE_REVERSE_EXTRUDED - SceneManager->getVideoDriver()->draw3DTriangle(core::triangle3df(v0+lightDir0,v1+lightDir0,v2+lightDir0), irr::video::SColor(255,255, 0, 0)); -#else - SceneManager->getVideoDriver()->draw3DTriangle(core::triangle3df(v0-lightDir0,v1-lightDir0,v2-lightDir0), irr::video::SColor(255,255, 0, 0)); -#endif - } -#endif - - if (UseZFailMethod && FaceData[i]) - { -#ifdef _DEBUG - if (svp->size() >= svp->allocated_size()-5) - os::Printer::log("Allocation too small.", ELL_DEBUG); -#endif - // add front cap from light-facing faces - svp->push_back(v2); - svp->push_back(v1); - svp->push_back(v0); - - // add back cap - if ( !isDirectional ) - { - lightDir1 = (v1-light).normalize(); - lightDir2 = (v2-light).normalize(); - } - const core::vector3df i0 = v0+lightDir0*Infinity; - const core::vector3df i1 = v1+lightDir1*Infinity; - const core::vector3df i2 = v2+lightDir2*Infinity; - - svp->push_back(i0); - svp->push_back(i1); - svp->push_back(i2); - - bb->addInternalPoint(i0); - bb->addInternalPoint(i1); - bb->addInternalPoint(i2); - } - } - - // Create edges - for (u32 i=0; i<faceCount; ++i) - { - // check all front facing faces - if (FaceData[i] == true) - { - const u16 wFace0 = Indices[3*i+0]; - const u16 wFace1 = Indices[3*i+1]; - const u16 wFace2 = Indices[3*i+2]; - - if ( Optimization == ESV_NONE ) - { - // add edge v0-v1 - Edges[2*numEdges+0] = wFace0; - Edges[2*numEdges+1] = wFace1; - ++numEdges; - - // add edge v1-v2 - Edges[2*numEdges+0] = wFace1; - Edges[2*numEdges+1] = wFace2; - ++numEdges; - - // add edge v2-v0 - Edges[2*numEdges+0] = wFace2; - Edges[2*numEdges+1] = wFace0; - ++numEdges; - } - else - { - const u16 adj0 = Adjacency[3*i+0]; - const u16 adj1 = Adjacency[3*i+1]; - const u16 adj2 = Adjacency[3*i+2]; - - // add edges if face is adjacent to back-facing face - // or if no adjacent face was found - if (adj0 == i || FaceData[adj0] == false) - { - // add edge v0-v1 - Edges[2*numEdges+0] = wFace0; - Edges[2*numEdges+1] = wFace1; - ++numEdges; - } - - if (adj1 == i || FaceData[adj1] == false) - { - // add edge v1-v2 - Edges[2*numEdges+0] = wFace1; - Edges[2*numEdges+1] = wFace2; - ++numEdges; - } - - if (adj2 == i || FaceData[adj2] == false) - { - // add edge v2-v0 - Edges[2*numEdges+0] = wFace2; - Edges[2*numEdges+1] = wFace0; - ++numEdges; - } - } - } - } - return numEdges; -} - - -void CShadowVolumeSceneNode::setShadowMesh(const IMesh* mesh) -{ - if (ShadowMesh == mesh) - return; - if (ShadowMesh) - ShadowMesh->drop(); - ShadowMesh = mesh; - if (ShadowMesh) - { - ShadowMesh->grab(); - Box = ShadowMesh->getBoundingBox(); - } -} - - -void CShadowVolumeSceneNode::updateShadowVolumes() -{ - const u32 oldIndexCount = IndexCount; - const u32 oldVertexCount = VertexCount; - - VertexCount = 0; - IndexCount = 0; - ShadowVolumesUsed = 0; - - const IMesh* const mesh = ShadowMesh; - if (!mesh) - return; - - // create as much shadow volumes as there are lights but - // do not ignore the max light settings. - const u32 lightCount = SceneManager->getVideoDriver()->getDynamicLightCount(); - if (!lightCount) - return; - - // calculate total amount of vertices and indices - - u32 i; - u32 totalVertices = 0; - u32 totalIndices = 0; - const u32 bufcnt = mesh->getMeshBufferCount(); - - for (i=0; i<bufcnt; ++i) - { - const IMeshBuffer* buf = mesh->getMeshBuffer(i); - if ( buf->getIndexType() == video::EIT_16BIT - && buf->getPrimitiveType() == scene::EPT_TRIANGLES ) - { - totalIndices += buf->getIndexCount(); - totalVertices += buf->getVertexCount(); - } - else - { - os::Printer::log("ShadowVolumeSceneNode only supports meshbuffers with 16 bit indices and triangles", ELL_WARNING); - return; - } - } - if ( totalIndices != (u32)(u16)totalIndices) - { - // We could switch to 32-bit indices, not much work and just bit of extra memory (< 192k) per shadow volume. - // If anyone ever complains and really needs that just switch it. But huge shadows are usually a bad idea as they will be slow. - os::Printer::log("ShadowVolumeSceneNode does not yet support shadowvolumes which need more than 16 bit indices", ELL_WARNING); - return; - } - - // allocate memory if necessary - - Vertices.set_used(totalVertices); - Indices.set_used(totalIndices); - FaceData.set_used(totalIndices / 3); - - // copy mesh - // (could speed this up for static meshes by adding some user flag to prevents copying) - for (i=0; i<bufcnt; ++i) - { - const IMeshBuffer* buf = mesh->getMeshBuffer(i); - - const u16* idxp = buf->getIndices(); - const u16* idxpend = idxp + buf->getIndexCount(); - for (; idxp!=idxpend; ++idxp) - Indices[IndexCount++] = *idxp + VertexCount; - - const u32 vtxcnt = buf->getVertexCount(); - for (u32 j=0; j<vtxcnt; ++j) - Vertices[VertexCount++] = buf->getPosition(j); - } - - // recalculate adjacency if necessary - if (oldVertexCount != VertexCount || oldIndexCount != IndexCount || AdjacencyDirtyFlag) - calculateAdjacency(); - - core::matrix4 matInv(Parent->getAbsoluteTransformation()); - matInv.makeInverse(); - core::matrix4 matTransp(Parent->getAbsoluteTransformation(), core::matrix4::EM4CONST_TRANSPOSED); - const core::vector3df parentpos = Parent->getAbsolutePosition(); - - for (i=0; i<lightCount; ++i) - { - const video::SLight& dl = SceneManager->getVideoDriver()->getDynamicLight(i); - - if ( dl.Type == video::ELT_DIRECTIONAL ) - { - core::vector3df ldir(dl.Direction); - matTransp.transformVect(ldir); - createShadowVolume(ldir, true); - } - else - { - core::vector3df lpos(dl.Position); - if (dl.CastShadows && - fabs((lpos - parentpos).getLengthSQ()) <= (dl.Radius*dl.Radius*4.0f)) - { - matInv.transformVect(lpos); - createShadowVolume(lpos, false); - } - } - } -} - -void CShadowVolumeSceneNode::setOptimization(ESHADOWVOLUME_OPTIMIZATION optimization) -{ - if ( Optimization != optimization ) - { - Optimization = optimization; - AdjacencyDirtyFlag = true; - } -} - -//! pre render method -void CShadowVolumeSceneNode::OnRegisterSceneNode() -{ - if (IsVisible) - { - SceneManager->registerNodeForRendering(this, scene::ESNRP_SHADOW); - ISceneNode::OnRegisterSceneNode(); - } -} - -//! renders the node. -void CShadowVolumeSceneNode::render() -{ - video::IVideoDriver* driver = SceneManager->getVideoDriver(); - - if (!ShadowVolumesUsed || !driver) - return; - - driver->setTransform(video::ETS_WORLD, Parent->getAbsoluteTransformation()); - - bool checkFarPlaneClipping = UseZFailMethod && !driver->queryFeature(video::EVDF_DEPTH_CLAMP); - - // get camera frustum converted to local coordinates when we have to check for far plane clipping - SViewFrustum frust; - if ( checkFarPlaneClipping ) - { - const irr::scene::ICameraSceneNode* camera = SceneManager->getActiveCamera(); - if ( camera ) - { - frust = *camera->getViewFrustum(); - core::matrix4 invTrans(Parent->getAbsoluteTransformation(), core::matrix4::EM4CONST_INVERSE); - frust.transform(invTrans); - } - else - checkFarPlaneClipping = false; - } - - for (u32 i=0; i<ShadowVolumesUsed; ++i) - { - bool drawShadow = true; - - if (checkFarPlaneClipping) - { - // Disable shadows drawing, when back cap is behind of ZFar plane. - // TODO: Using infinite projection matrices instead is said to work better - // as then we wouldn't fail when the shadow clip the far plane. - // I couldn't get it working (and neither anyone before me it seems). - // Anyone who can figure it out is welcome to provide a patch. - - core::vector3df edges[8]; - ShadowBBox[i].getEdges(edges); - - for(int j = 0; j < 8; ++j) - { - if (frust.planes[scene::SViewFrustum::VF_FAR_PLANE].classifyPointRelation(edges[j]) == core::ISREL3D_FRONT) - { - drawShadow = false; - break; - } - } - } - - if(drawShadow) - driver->drawStencilShadowVolume(ShadowVolumes[i], UseZFailMethod, DebugDataVisible); - else - { - // TODO: For some reason (not yet further investigated), Direct3D needs a call to drawStencilShadowVolume - // even if we have nothing to draw here to set the renderstate into a StencilShadowMode. - // If that's not done it has effect on further render calls. - core::array<core::vector3df> triangles; - driver->drawStencilShadowVolume(triangles, UseZFailMethod, DebugDataVisible); - } - } -} - - -//! returns the axis aligned bounding box of this node -const core::aabbox3d<f32>& CShadowVolumeSceneNode::getBoundingBox() const -{ - return Box; -} - - -//! Generates adjacency information based on mesh indices. -void CShadowVolumeSceneNode::calculateAdjacency() -{ - AdjacencyDirtyFlag = false; - - if ( Optimization == ESV_NONE ) - { - Adjacency.clear(); - } - else if ( Optimization == ESV_SILHOUETTE_BY_POS ) - { - Adjacency.set_used(IndexCount); - - // go through all faces and fetch their three neighbours - for (u32 f=0; f<IndexCount; f+=3) - { - for (u32 edge = 0; edge<3; ++edge) - { - const core::vector3df& v1 = Vertices[Indices[f+edge]]; - const core::vector3df& v2 = Vertices[Indices[f+((edge+1)%3)]]; - - // now we search an_O_ther _F_ace with these two - // vertices, which is not the current face. - u32 of; - - for (of=0; of<IndexCount; of+=3) - { - // only other faces - if (of != f) - { - bool cnt1 = false; - bool cnt2 = false; - - for (s32 e=0; e<3; ++e) - { - if (v1.equals(Vertices[Indices[of+e]])) - cnt1=true; - - if (v2.equals(Vertices[Indices[of+e]])) - cnt2=true; - } - // one match for each vertex, i.e. edge is the same - if (cnt1 && cnt2) - break; - } - } - - // no adjacent edges -> store face number, else store adjacent face - if (of >= IndexCount) - Adjacency[f + edge] = f/3; - else - Adjacency[f + edge] = of/3; - } - } - } -} - - -} // end namespace scene -} // end namespace irr - -#endif // _IRR_COMPILE_WITH_SHADOW_VOLUME_SCENENODE_ diff --git a/source/Irrlicht/CShadowVolumeSceneNode.h b/source/Irrlicht/CShadowVolumeSceneNode.h deleted file mode 100644 index 6501652e..00000000 --- a/source/Irrlicht/CShadowVolumeSceneNode.h +++ /dev/null @@ -1,99 +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_SHADOW_VOLUME_SCENE_NODE_H_INCLUDED__ -#define __C_SHADOW_VOLUME_SCENE_NODE_H_INCLUDED__ - -#include "IShadowVolumeSceneNode.h" - -namespace irr -{ -namespace scene -{ - - //! Scene node for rendering a shadow volume into a stencil buffer. - class CShadowVolumeSceneNode : public IShadowVolumeSceneNode - { - public: - - //! constructor - CShadowVolumeSceneNode(const IMesh* shadowMesh, ISceneNode* parent, ISceneManager* mgr, - s32 id, bool zfailmethod=true, f32 infinity=10000.0f); - - //! destructor - virtual ~CShadowVolumeSceneNode(); - - //! Sets the mesh from which the shadow volume should be generated. - /** To optimize shadow rendering, use a simpler mesh for shadows. - */ - virtual void setShadowMesh(const IMesh* mesh) _IRR_OVERRIDE_; - - //! Updates the shadow volumes for current light positions. - /** Called each render cycle from Animated Mesh SceneNode render method. */ - virtual void updateShadowVolumes() _IRR_OVERRIDE_; - - //! Set optimization used to create shadow volumes - /** Default is ESV_SILHOUETTE_BY_POS. If the shadow - looks bad then give ESV_NONE a try (which will be slower). */ - virtual void setOptimization(ESHADOWVOLUME_OPTIMIZATION optimization) _IRR_OVERRIDE_; - - //! Get currently active optimization used to create shadow volumes - virtual ESHADOWVOLUME_OPTIMIZATION getOptimization() const _IRR_OVERRIDE_ - { - return Optimization; - } - - //! pre render method - virtual void OnRegisterSceneNode() _IRR_OVERRIDE_; - - //! renders the node. - virtual void render() _IRR_OVERRIDE_; - - //! returns the axis aligned bounding box of this node - virtual const core::aabbox3d<f32>& getBoundingBox() const _IRR_OVERRIDE_; - - //! Returns type of the scene node - virtual ESCENE_NODE_TYPE getType() const _IRR_OVERRIDE_ { return ESNT_SHADOW_VOLUME; } - - private: - - typedef core::array<core::vector3df> SShadowVolume; - - void createShadowVolume(const core::vector3df& pos, bool isDirectional); - u32 createEdgesAndCaps(const core::vector3df& light, bool isDirectional, SShadowVolume* svp, core::aabbox3d<f32>* bb); - - //! Generates adjacency information based on mesh indices. - void calculateAdjacency(); - - core::aabbox3d<f32> Box; - - // a shadow volume for every light - core::array<SShadowVolume> ShadowVolumes; - - // a back cap bounding box for every light - core::array<core::aabbox3d<f32> > ShadowBBox; - - core::array<core::vector3df> Vertices; - core::array<u16> Indices; - core::array<u16> Adjacency; - core::array<u16> Edges; - // tells if face is front facing - core::array<bool> FaceData; - bool AdjacencyDirtyFlag; - - const scene::IMesh* ShadowMesh; - - u32 IndexCount; - u32 VertexCount; - u32 ShadowVolumesUsed; - - f32 Infinity; - bool UseZFailMethod; - ESHADOWVOLUME_OPTIMIZATION Optimization; - }; - -} // end namespace scene -} // end namespace irr - -#endif diff --git a/source/Irrlicht/CSkyBoxSceneNode.cpp b/source/Irrlicht/CSkyBoxSceneNode.cpp deleted file mode 100644 index 2ad3fe6e..00000000 --- a/source/Irrlicht/CSkyBoxSceneNode.cpp +++ /dev/null @@ -1,260 +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 "CSkyBoxSceneNode.h" -#include "IVideoDriver.h" -#include "ISceneManager.h" -#include "ICameraSceneNode.h" -#include "S3DVertex.h" -#include "os.h" - -namespace irr -{ -namespace scene -{ - -//! constructor -CSkyBoxSceneNode::CSkyBoxSceneNode(video::ITexture* top, video::ITexture* bottom, video::ITexture* left, - video::ITexture* right, video::ITexture* front, video::ITexture* back, ISceneNode* parent, ISceneManager* mgr, s32 id) -: ISceneNode(parent, mgr, id) -{ - #ifdef _DEBUG - setDebugName("CSkyBoxSceneNode"); - #endif - - setAutomaticCulling(scene::EAC_OFF); - Box.MaxEdge.set(0,0,0); - Box.MinEdge.set(0,0,0); - - // create indices - - Indices[0] = 0; - Indices[1] = 1; - Indices[2] = 2; - Indices[3] = 3; - - // create material - - video::SMaterial mat; - mat.Lighting = false; - mat.ZBuffer = video::ECFN_DISABLED; - mat.ZWriteEnable = video::EZW_OFF; - mat.AntiAliasing=0; - mat.TextureLayer[0].TextureWrapU = video::ETC_CLAMP_TO_EDGE; - mat.TextureLayer[0].TextureWrapV = video::ETC_CLAMP_TO_EDGE; - mat.TextureLayer[0].TextureWrapW = video::ETC_CLAMP_TO_EDGE; - - /* Hey, I am no artist, but look at that - cool ASCII art I made! ;) - - -111 111 - /6--------/5 y - / | / | ^ z - / | 11-1 | | / - -11-1 3---------2 | |/ - | 7- - -| -4 1-11 *---->x - | -1-11 | / 3-------|2 - |/ | / | //| - 0---------1/ | // | - -1-1-1 1-1-1 |// | - 0--------1 - */ - - video::ITexture* tex = front; - if (!tex) tex = left; - if (!tex) tex = back; - if (!tex) tex = right; - if (!tex) tex = top; - if (!tex) tex = bottom; - - const f32 onepixel = tex?(1.0f / (tex->getSize().Width * 1.5f)) : 0.0f; - const f32 t = 1.0f - onepixel; - const f32 o = 0.0f + onepixel; - - // create front side - - Material[0] = mat; - Material[0].setTexture(0, front); - Vertices[0] = video::S3DVertex(-1,-1,-1, 0,0,1, video::SColor(255,255,255,255), t, t); - Vertices[1] = video::S3DVertex( 1,-1,-1, 0,0,1, video::SColor(255,255,255,255), o, t); - Vertices[2] = video::S3DVertex( 1, 1,-1, 0,0,1, video::SColor(255,255,255,255), o, o); - Vertices[3] = video::S3DVertex(-1, 1,-1, 0,0,1, video::SColor(255,255,255,255), t, o); - - // create left side - - Material[1] = mat; - Material[1].setTexture(0, left); - Vertices[4] = video::S3DVertex( 1,-1,-1, -1,0,0, video::SColor(255,255,255,255), t, t); - Vertices[5] = video::S3DVertex( 1,-1, 1, -1,0,0, video::SColor(255,255,255,255), o, t); - Vertices[6] = video::S3DVertex( 1, 1, 1, -1,0,0, video::SColor(255,255,255,255), o, o); - Vertices[7] = video::S3DVertex( 1, 1,-1, -1,0,0, video::SColor(255,255,255,255), t, o); - - // create back side - - Material[2] = mat; - Material[2].setTexture(0, back); - Vertices[8] = video::S3DVertex( 1,-1, 1, 0,0,-1, video::SColor(255,255,255,255), t, t); - Vertices[9] = video::S3DVertex(-1,-1, 1, 0,0,-1, video::SColor(255,255,255,255), o, t); - Vertices[10] = video::S3DVertex(-1, 1, 1, 0,0,-1, video::SColor(255,255,255,255), o, o); - Vertices[11] = video::S3DVertex( 1, 1, 1, 0,0,-1, video::SColor(255,255,255,255), t, o); - - // create right side - - Material[3] = mat; - Material[3].setTexture(0, right); - Vertices[12] = video::S3DVertex(-1,-1, 1, 1,0,0, video::SColor(255,255,255,255), t, t); - Vertices[13] = video::S3DVertex(-1,-1,-1, 1,0,0, video::SColor(255,255,255,255), o, t); - Vertices[14] = video::S3DVertex(-1, 1,-1, 1,0,0, video::SColor(255,255,255,255), o, o); - Vertices[15] = video::S3DVertex(-1, 1, 1, 1,0,0, video::SColor(255,255,255,255), t, o); - - // create top side - - Material[4] = mat; - Material[4].setTexture(0, top); - Vertices[16] = video::S3DVertex( 1, 1,-1, 0,-1,0, video::SColor(255,255,255,255), t, t); - Vertices[17] = video::S3DVertex( 1, 1, 1, 0,-1,0, video::SColor(255,255,255,255), o, t); - Vertices[18] = video::S3DVertex(-1, 1, 1, 0,-1,0, video::SColor(255,255,255,255), o, o); - Vertices[19] = video::S3DVertex(-1, 1,-1, 0,-1,0, video::SColor(255,255,255,255), t, o); - - // create bottom side - - Material[5] = mat; - Material[5].setTexture(0, bottom); - Vertices[20] = video::S3DVertex( 1,-1, 1, 0,1,0, video::SColor(255,255,255,255), o, o); - Vertices[21] = video::S3DVertex( 1,-1,-1, 0,1,0, video::SColor(255,255,255,255), t, o); - Vertices[22] = video::S3DVertex(-1,-1,-1, 0,1,0, video::SColor(255,255,255,255), t, t); - Vertices[23] = video::S3DVertex(-1,-1, 1, 0,1,0, video::SColor(255,255,255,255), o, t); -} - - -//! renders the node. -void CSkyBoxSceneNode::render() -{ - video::IVideoDriver* driver = SceneManager->getVideoDriver(); - scene::ICameraSceneNode* camera = SceneManager->getActiveCamera(); - - if (!camera || !driver) - return; - - if ( !camera->isOrthogonal() ) - { - // draw perspective skybox - - core::matrix4 translate(AbsoluteTransformation); - translate.setTranslation(camera->getAbsolutePosition()); - - // Draw the sky box between the near and far clip plane - const f32 viewDistance = (camera->getNearValue() + camera->getFarValue()) * 0.5f; - core::matrix4 scale; - scale.setScale(core::vector3df(viewDistance, viewDistance, viewDistance)); - - driver->setTransform(video::ETS_WORLD, translate * scale); - - for (s32 i=0; i<6; ++i) - { - driver->setMaterial(Material[i]); - driver->drawIndexedTriangleFan(&Vertices[i*4], 4, Indices, 2); - } - } - else - { - // draw orthogonal skybox, - // simply choose one texture and draw it as 2d picture. - // there could be better ways to do this, but currently I think this is ok. - - core::vector3df lookVect = camera->getTarget() - camera->getAbsolutePosition(); - lookVect.normalize(); - core::vector3df absVect( core::abs_(lookVect.X), - core::abs_(lookVect.Y), - core::abs_(lookVect.Z)); - - int idx = 0; - - if ( absVect.X >= absVect.Y && absVect.X >= absVect.Z ) - { - // x direction - idx = lookVect.X > 0 ? 0 : 2; - } - else - if ( absVect.Y >= absVect.X && absVect.Y >= absVect.Z ) - { - // y direction - idx = lookVect.Y > 0 ? 4 : 5; - } - else - if ( absVect.Z >= absVect.X && absVect.Z >= absVect.Y ) - { - // z direction - idx = lookVect.Z > 0 ? 1 : 3; - } - - video::ITexture* tex = Material[idx].getTexture(0); - - if ( tex ) - { - core::rect<s32> rctDest(core::position2d<s32>(-1,0), - core::dimension2di(driver->getCurrentRenderTargetSize())); - core::rect<s32> rctSrc(core::position2d<s32>(0,0), - core::dimension2di(tex->getOriginalSize())); - - driver->draw2DImage(tex, rctDest, rctSrc); - } - } -} - - - -//! returns the axis aligned bounding box of this node -const core::aabbox3d<f32>& CSkyBoxSceneNode::getBoundingBox() const -{ - return Box; -} - - -void CSkyBoxSceneNode::OnRegisterSceneNode() -{ - if (IsVisible) - SceneManager->registerNodeForRendering(this, ESNRP_SKY_BOX); - - ISceneNode::OnRegisterSceneNode(); -} - - -//! returns the material based on the zero based index i. -video::SMaterial& CSkyBoxSceneNode::getMaterial(u32 i) -{ - return Material[i]; -} - - -//! returns amount of materials used by this scene node. -u32 CSkyBoxSceneNode::getMaterialCount() const -{ - return 6; -} - - -//! Creates a clone of this scene node and its children. -ISceneNode* CSkyBoxSceneNode::clone(ISceneNode* newParent, ISceneManager* newManager) -{ - if (!newParent) newParent = Parent; - if (!newManager) newManager = SceneManager; - - CSkyBoxSceneNode* nb = new CSkyBoxSceneNode(0,0,0,0,0,0, newParent, - newManager, ID); - - nb->cloneMembers(this, newManager); - - for (u32 i=0; i<6; ++i) - nb->Material[i] = Material[i]; - - if ( newParent ) - nb->drop(); - return nb; -} - - -} // end namespace scene -} // end namespace irr - diff --git a/source/Irrlicht/CSkyBoxSceneNode.h b/source/Irrlicht/CSkyBoxSceneNode.h deleted file mode 100644 index a153b50a..00000000 --- a/source/Irrlicht/CSkyBoxSceneNode.h +++ /dev/null @@ -1,62 +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_SKY_BOX_SCENE_NODE_H_INCLUDED__ -#define __C_SKY_BOX_SCENE_NODE_H_INCLUDED__ - -#include "ISceneNode.h" -#include "S3DVertex.h" - -namespace irr -{ -namespace scene -{ - - // Skybox, rendered with zbuffer turned off, before all other nodes. - class CSkyBoxSceneNode : public ISceneNode - { - public: - - //! constructor - CSkyBoxSceneNode(video::ITexture* top, video::ITexture* bottom, video::ITexture* left, - video::ITexture* right, video::ITexture* front, video::ITexture* back, - ISceneNode* parent, ISceneManager* mgr, s32 id); - - virtual void OnRegisterSceneNode() _IRR_OVERRIDE_; - - //! renders the node. - virtual void render() _IRR_OVERRIDE_; - - //! returns the axis aligned bounding box of this node - virtual const core::aabbox3d<f32>& getBoundingBox() const _IRR_OVERRIDE_; - - //! returns the material based on the zero based index i. To get the amount - //! of materials used by this scene node, use getMaterialCount(). - //! This function is needed for inserting the node into the scene hierarchy on a - //! optimal position for minimizing renderstate changes, but can also be used - //! to directly modify the material of a scene node. - virtual video::SMaterial& getMaterial(u32 i) _IRR_OVERRIDE_; - - //! returns amount of materials used by this scene node. - virtual u32 getMaterialCount() const _IRR_OVERRIDE_; - - //! Returns type of the scene node - virtual ESCENE_NODE_TYPE getType() const _IRR_OVERRIDE_ { return ESNT_SKY_BOX; } - - //! Creates a clone of this scene node and its children. - virtual ISceneNode* clone(ISceneNode* newParent=0, ISceneManager* newManager=0) _IRR_OVERRIDE_; - - private: - - core::aabbox3d<f32> Box; - u16 Indices[4]; - video::S3DVertex Vertices[4*6]; - video::SMaterial Material[6]; - }; - -} // end namespace scene -} // end namespace irr - -#endif - diff --git a/source/Irrlicht/CSkyDomeSceneNode.cpp b/source/Irrlicht/CSkyDomeSceneNode.cpp deleted file mode 100644 index 7cf81f39..00000000 --- a/source/Irrlicht/CSkyDomeSceneNode.cpp +++ /dev/null @@ -1,264 +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 -// Code for this scene node has been contributed by Anders la Cour-Harbo (alc) - -#include "IrrCompileConfig.h" -#ifdef _IRR_COMPILE_WITH_SKYDOME_SCENENODE_ -#include "CSkyDomeSceneNode.h" -#include "IVideoDriver.h" -#include "ISceneManager.h" -#include "ICameraSceneNode.h" -#include "IAnimatedMesh.h" -#include "os.h" - -namespace irr -{ -namespace scene -{ - -/* horiRes and vertRes: - Controls the number of faces along the horizontal axis (30 is a good value) - and the number of faces along the vertical axis (8 is a good value). - - texturePercentage: - Only the top texturePercentage of the image is used, e.g. 0.8 uses the top 80% of the image, - 1.0 uses the entire image. This is useful as some landscape images have a small banner - at the bottom that you don't want. - - spherePercentage: - This controls how far around the sphere the sky dome goes. For value 1.0 you get exactly the upper - hemisphere, for 1.1 you get slightly more, and for 2.0 you get a full sphere. It is sometimes useful - to use a value slightly bigger than 1 to avoid a gap between some ground place and the sky. This - parameters stretches the image to fit the chosen "sphere-size". */ - -CSkyDomeSceneNode::CSkyDomeSceneNode(video::ITexture* sky, u32 horiRes, u32 vertRes, - f32 texturePercentage, f32 spherePercentage, f32 radius, - ISceneNode* parent, ISceneManager* mgr, s32 id) - : ISceneNode(parent, mgr, id), Buffer(0), - HorizontalResolution(horiRes), VerticalResolution(vertRes), - TexturePercentage(texturePercentage), - SpherePercentage(spherePercentage), Radius(radius) -{ - #ifdef _DEBUG - setDebugName("CSkyDomeSceneNode"); - #endif - - setAutomaticCulling(scene::EAC_OFF); - - Buffer = new SMeshBuffer(); - Buffer->Material.Lighting = false; - Buffer->Material.ZBuffer = video::ECFN_DISABLED; - Buffer->Material.ZWriteEnable = video::EZW_OFF; - Buffer->Material.AntiAliasing = video::EAAM_OFF; - Buffer->Material.setTexture(0, sky); - Buffer->BoundingBox.MaxEdge.set(0,0,0); - Buffer->BoundingBox.MinEdge.set(0,0,0); - - // regenerate the mesh - generateMesh(); -} - - -CSkyDomeSceneNode::~CSkyDomeSceneNode() -{ - if (Buffer) - Buffer->drop(); -} - - -void CSkyDomeSceneNode::generateMesh() -{ - f32 azimuth; - u32 k; - - Buffer->Vertices.clear(); - Buffer->Indices.clear(); - - const f32 azimuth_step = (core::PI * 2.f) / HorizontalResolution; - if (SpherePercentage < 0.f) - SpherePercentage = -SpherePercentage; - if (SpherePercentage > 2.f) - SpherePercentage = 2.f; - const f32 elevation_step = SpherePercentage * core::HALF_PI / (f32)VerticalResolution; - - Buffer->Vertices.reallocate( (HorizontalResolution + 1) * (VerticalResolution + 1) ); - Buffer->Indices.reallocate(3 * (2*VerticalResolution - 1) * HorizontalResolution); - - video::S3DVertex vtx; - vtx.Color.set(255,255,255,255); - vtx.Normal.set(0.0f,-1.f,0.0f); - - const f32 tcV = TexturePercentage / VerticalResolution; - for (k = 0, azimuth = 0; k <= HorizontalResolution; ++k) - { - f32 elevation = core::HALF_PI; - const f32 tcU = (f32)k / (f32)HorizontalResolution; - const f32 sinA = sinf(azimuth); - const f32 cosA = cosf(azimuth); - for (u32 j = 0; j <= VerticalResolution; ++j) - { - const f32 cosEr = Radius * cosf(elevation); - vtx.Pos.set(cosEr*sinA, Radius*sinf(elevation), cosEr*cosA); - vtx.TCoords.set(tcU, j*tcV); - - vtx.Normal = -vtx.Pos; - vtx.Normal.normalize(); - - Buffer->Vertices.push_back(vtx); - elevation -= elevation_step; - } - azimuth += azimuth_step; - } - - for (k = 0; k < HorizontalResolution; ++k) - { - Buffer->Indices.push_back(VerticalResolution + 2 + (VerticalResolution + 1)*k); - Buffer->Indices.push_back(1 + (VerticalResolution + 1)*k); - Buffer->Indices.push_back(0 + (VerticalResolution + 1)*k); - - for (u32 j = 1; j < VerticalResolution; ++j) - { - Buffer->Indices.push_back(VerticalResolution + 2 + (VerticalResolution + 1)*k + j); - Buffer->Indices.push_back(1 + (VerticalResolution + 1)*k + j); - Buffer->Indices.push_back(0 + (VerticalResolution + 1)*k + j); - - Buffer->Indices.push_back(VerticalResolution + 1 + (VerticalResolution + 1)*k + j); - Buffer->Indices.push_back(VerticalResolution + 2 + (VerticalResolution + 1)*k + j); - Buffer->Indices.push_back(0 + (VerticalResolution + 1)*k + j); - } - } - Buffer->setHardwareMappingHint(scene::EHM_STATIC); -} - - -//! renders the node. -void CSkyDomeSceneNode::render() -{ - video::IVideoDriver* driver = SceneManager->getVideoDriver(); - scene::ICameraSceneNode* camera = SceneManager->getActiveCamera(); - - if (!camera || !driver) - return; - - if ( !camera->isOrthogonal() ) - { - core::matrix4 mat(AbsoluteTransformation); - mat.setTranslation(camera->getAbsolutePosition()); - - driver->setTransform(video::ETS_WORLD, mat); - - driver->setMaterial(Buffer->Material); - driver->drawMeshBuffer(Buffer); - } - - // for debug purposes only: - if ( DebugDataVisible ) - { - video::SMaterial m; - m.Lighting = false; - driver->setMaterial(m); - - if ( DebugDataVisible & scene::EDS_NORMALS ) - { - // draw normals - const f32 debugNormalLength = SceneManager->getParameters()->getAttributeAsFloat(DEBUG_NORMAL_LENGTH); - const video::SColor debugNormalColor = SceneManager->getParameters()->getAttributeAsColor(DEBUG_NORMAL_COLOR); - driver->drawMeshBufferNormals(Buffer, debugNormalLength, debugNormalColor); - } - - // show mesh - if ( DebugDataVisible & scene::EDS_MESH_WIRE_OVERLAY ) - { - m.Wireframe = true; - driver->setMaterial(m); - - driver->drawMeshBuffer(Buffer); - } - } -} - - -//! returns the axis aligned bounding box of this node -const core::aabbox3d<f32>& CSkyDomeSceneNode::getBoundingBox() const -{ - return Buffer->BoundingBox; -} - - -void CSkyDomeSceneNode::OnRegisterSceneNode() -{ - if (IsVisible) - { - SceneManager->registerNodeForRendering(this, ESNRP_SKY_BOX ); - } - - ISceneNode::OnRegisterSceneNode(); -} - - -//! returns the material based on the zero based index i. -video::SMaterial& CSkyDomeSceneNode::getMaterial(u32 i) -{ - return Buffer->Material; -} - - -//! returns amount of materials used by this scene node. -u32 CSkyDomeSceneNode::getMaterialCount() const -{ - return 1; -} - - -//! Writes attributes of the scene node. -void CSkyDomeSceneNode::serializeAttributes(io::IAttributes* out, io::SAttributeReadWriteOptions* options) const -{ - ISceneNode::serializeAttributes(out, options); - - out->addInt ("HorizontalResolution", HorizontalResolution); - out->addInt ("VerticalResolution", VerticalResolution); - out->addFloat("TexturePercentage", TexturePercentage); - out->addFloat("SpherePercentage", SpherePercentage); - out->addFloat("Radius", Radius); -} - - -//! Reads attributes of the scene node. -void CSkyDomeSceneNode::deserializeAttributes(io::IAttributes* in, io::SAttributeReadWriteOptions* options) -{ - HorizontalResolution = in->getAttributeAsInt ("HorizontalResolution"); - VerticalResolution = in->getAttributeAsInt ("VerticalResolution"); - TexturePercentage = in->getAttributeAsFloat("TexturePercentage"); - SpherePercentage = in->getAttributeAsFloat("SpherePercentage"); - Radius = in->getAttributeAsFloat("Radius"); - - ISceneNode::deserializeAttributes(in, options); - - // regenerate the mesh - generateMesh(); -} - -//! Creates a clone of this scene node and its children. -ISceneNode* CSkyDomeSceneNode::clone(ISceneNode* newParent, ISceneManager* newManager) -{ - if (!newParent) - newParent = Parent; - if (!newManager) - newManager = SceneManager; - - CSkyDomeSceneNode* nb = new CSkyDomeSceneNode(Buffer->Material.TextureLayer[0].Texture, HorizontalResolution, VerticalResolution, TexturePercentage, - SpherePercentage, Radius, newParent, newManager, ID); - - nb->cloneMembers(this, newManager); - - if ( newParent ) - nb->drop(); - return nb; -} - - -} // namespace scene -} // namespace irr - -#endif // _IRR_COMPILE_WITH_SKYDOME_SCENENODE_ diff --git a/source/Irrlicht/CSkyDomeSceneNode.h b/source/Irrlicht/CSkyDomeSceneNode.h deleted file mode 100644 index e1a8be0a..00000000 --- a/source/Irrlicht/CSkyDomeSceneNode.h +++ /dev/null @@ -1,50 +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 -// Code for this scene node has been contributed by Anders la Cour-Harbo (alc) - -#ifndef __C_SKY_DOME_SCENE_NODE_H_INCLUDED__ -#define __C_SKY_DOME_SCENE_NODE_H_INCLUDED__ - -#include "ISceneNode.h" -#include "SMeshBuffer.h" - -namespace irr -{ -namespace scene -{ - -class CSkyDomeSceneNode : public ISceneNode -{ - public: - CSkyDomeSceneNode(video::ITexture* texture, u32 horiRes, u32 vertRes, - f32 texturePercentage, f32 spherePercentage, f32 radius, - ISceneNode* parent, ISceneManager* smgr, s32 id); - virtual ~CSkyDomeSceneNode(); - virtual void OnRegisterSceneNode() _IRR_OVERRIDE_; - virtual void render() _IRR_OVERRIDE_; - virtual const core::aabbox3d<f32>& getBoundingBox() const _IRR_OVERRIDE_; - virtual video::SMaterial& getMaterial(u32 i) _IRR_OVERRIDE_; - virtual u32 getMaterialCount() const _IRR_OVERRIDE_; - virtual ESCENE_NODE_TYPE getType() const _IRR_OVERRIDE_ { return ESNT_SKY_DOME; } - - virtual void serializeAttributes(io::IAttributes* out, io::SAttributeReadWriteOptions* options) const _IRR_OVERRIDE_; - virtual void deserializeAttributes(io::IAttributes* in, io::SAttributeReadWriteOptions* options) _IRR_OVERRIDE_; - virtual ISceneNode* clone(ISceneNode* newParent=0, ISceneManager* newManager=0) _IRR_OVERRIDE_; - - private: - - void generateMesh(); - - SMeshBuffer* Buffer; - - u32 HorizontalResolution, VerticalResolution; - f32 TexturePercentage, SpherePercentage, Radius; -}; - - -} -} - -#endif - diff --git a/source/Irrlicht/CSoftware2MaterialRenderer.h b/source/Irrlicht/CSoftware2MaterialRenderer.h deleted file mode 100644 index 9715dc9d..00000000 --- a/source/Irrlicht/CSoftware2MaterialRenderer.h +++ /dev/null @@ -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_SOFTWARE2_MATERIAL_RENDERER_H_INCLUDED__ -#define __C_SOFTWARE2_MATERIAL_RENDERER_H_INCLUDED__ - -#include "SoftwareDriver2_compile_config.h" - -#include "IMaterialRenderer.h" -#include "CSoftwareDriver2.h" - -namespace irr -{ -namespace video -{ - -//! Base class for all internal Software2 material renderers -class CSoftware2MaterialRenderer : public IMaterialRenderer -{ -public: - - //! Constructor - CSoftware2MaterialRenderer(video::CBurningVideoDriver* driver) - : Driver(driver) - { - } - - virtual void OnSetMaterial(const SMaterial& material, const SMaterial& lastMaterial, - bool resetAllRenderstates, IMaterialRendererServices* services) _IRR_OVERRIDE_ - { - if (Driver) - Driver->setFallback_Material(material.MaterialType); - } - -protected: - - video::CBurningVideoDriver* Driver; -}; - -//! solid material renderer -class CSoftware2MaterialRenderer_SOLID : public CSoftware2MaterialRenderer -{ -public: - CSoftware2MaterialRenderer_SOLID ( video::CBurningVideoDriver* driver ) - :CSoftware2MaterialRenderer ( driver ) {} - - //! Returns if the material is transparent. - virtual bool isTransparent() const _IRR_OVERRIDE_ - { - return false; - } - -}; - - -//! Transparent material renderer -class CSoftware2MaterialRenderer_TRANSPARENT_ADD_COLOR : public CSoftware2MaterialRenderer -{ -public: - CSoftware2MaterialRenderer_TRANSPARENT_ADD_COLOR ( video::CBurningVideoDriver* driver ) - : CSoftware2MaterialRenderer ( driver ) {} - - - //! Returns if the material is transparent. - virtual bool isTransparent() const _IRR_OVERRIDE_ - { - return true; - } - -}; - -//! unsupported material renderer -class CSoftware2MaterialRenderer_UNSUPPORTED : public CSoftware2MaterialRenderer -{ -public: - CSoftware2MaterialRenderer_UNSUPPORTED ( video::CBurningVideoDriver* driver ) - : CSoftware2MaterialRenderer ( driver ) {} - - virtual s32 getRenderCapability() const _IRR_OVERRIDE_ { return 1; } - -}; - - - -} // end namespace video -} // end namespace irr - -#endif - diff --git a/source/Irrlicht/CSoftwareDriver.cpp b/source/Irrlicht/CSoftwareDriver.cpp deleted file mode 100644 index 426aac29..00000000 --- a/source/Irrlicht/CSoftwareDriver.cpp +++ /dev/null @@ -1,976 +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" -#include "CSoftwareDriver.h" - -#ifdef _IRR_COMPILE_WITH_SOFTWARE_ - -#include "CSoftwareTexture.h" -#include "CBlit.h" -#include "os.h" -#include "S3DVertex.h" - -namespace irr -{ -namespace video -{ - - -//! constructor -CSoftwareDriver::CSoftwareDriver(const core::dimension2d<u32>& windowSize, bool fullscreen, io::IFileSystem* io, video::IImagePresenter* presenter) -: CNullDriver(io, windowSize), BackBuffer(0), Presenter(presenter), WindowId(0), - SceneSourceRect(0), RenderTargetTexture(0), RenderTargetSurface(0), - CurrentTriangleRenderer(0), ZBuffer(0), Texture(0) -{ - #ifdef _DEBUG - setDebugName("CSoftwareDriver"); - #endif - - // create backbuffer - - BackBuffer = new CImage(ECF_A1R5G5B5, windowSize); - if (BackBuffer) - { - BackBuffer->fill(SColor(0)); - - // create z buffer - ZBuffer = video::createZBuffer(BackBuffer->getDimension()); - } - - DriverAttributes->setAttribute("MaxTextures", 1); - DriverAttributes->setAttribute("MaxIndices", 1<<16); - DriverAttributes->setAttribute("MaxTextureSize", 1024); - DriverAttributes->setAttribute("Version", 1); - - // create triangle renderers - - TriangleRenderers[ETR_FLAT] = createTriangleRendererFlat(ZBuffer); - TriangleRenderers[ETR_FLAT_WIRE] = createTriangleRendererFlatWire(ZBuffer); - TriangleRenderers[ETR_GOURAUD] = createTriangleRendererGouraud(ZBuffer); - TriangleRenderers[ETR_GOURAUD_WIRE] = createTriangleRendererGouraudWire(ZBuffer); - TriangleRenderers[ETR_TEXTURE_FLAT] = createTriangleRendererTextureFlat(ZBuffer); - TriangleRenderers[ETR_TEXTURE_FLAT_WIRE] = createTriangleRendererTextureFlatWire(ZBuffer); - TriangleRenderers[ETR_TEXTURE_GOURAUD] = createTriangleRendererTextureGouraud(ZBuffer); - TriangleRenderers[ETR_TEXTURE_GOURAUD_WIRE] = createTriangleRendererTextureGouraudWire(ZBuffer); - TriangleRenderers[ETR_TEXTURE_GOURAUD_NOZ] = createTriangleRendererTextureGouraudNoZ(); - TriangleRenderers[ETR_TEXTURE_GOURAUD_ADD] = createTriangleRendererTextureGouraudAdd(ZBuffer); - - // select render target - - setRenderTargetImage(BackBuffer); - - // select the right renderer - - selectRightTriangleRenderer(); -} - - - -//! destructor -CSoftwareDriver::~CSoftwareDriver() -{ - // delete Backbuffer - if (BackBuffer) - BackBuffer->drop(); - - // delete triangle renderers - - for (s32 i=0; i<ETR_COUNT; ++i) - if (TriangleRenderers[i]) - TriangleRenderers[i]->drop(); - - // delete zbuffer - - if (ZBuffer) - ZBuffer->drop(); - - // delete current texture - - if (Texture) - Texture->drop(); - - if (RenderTargetTexture) - RenderTargetTexture->drop(); - - if (RenderTargetSurface) - RenderTargetSurface->drop(); -} - - - -//! switches to a triangle renderer -void CSoftwareDriver::switchToTriangleRenderer(ETriangleRenderer renderer) -{ - video::IImage* s = 0; - if (Texture) - s = ((CSoftwareTexture*)Texture)->getTexture(); - - CurrentTriangleRenderer = TriangleRenderers[renderer]; - CurrentTriangleRenderer->setBackfaceCulling(Material.BackfaceCulling == true); - CurrentTriangleRenderer->setTexture(s); - CurrentTriangleRenderer->setRenderTarget(RenderTargetSurface, ViewPort); -} - - -//! void selects the right triangle renderer based on the render states. -void CSoftwareDriver::selectRightTriangleRenderer() -{ - - ETriangleRenderer renderer = ETR_FLAT; - - if (Texture) - { - if (!Material.GouraudShading) - renderer = (!Material.Wireframe) ? ETR_TEXTURE_FLAT : ETR_TEXTURE_FLAT_WIRE; - else - { - if (Material.Wireframe) - renderer = ETR_TEXTURE_GOURAUD_WIRE; - else - { - if (Material.MaterialType == EMT_TRANSPARENT_ADD_COLOR || - Material.MaterialType == EMT_TRANSPARENT_ALPHA_CHANNEL || - Material.MaterialType == EMT_TRANSPARENT_VERTEX_ALPHA) - { - // simply draw all transparent stuff with the same renderer. at - // least it is transparent then. - renderer = ETR_TEXTURE_GOURAUD_ADD; - } - else - if ((Material.ZBuffer==ECFN_DISABLED) && Material.ZWriteEnable == video::EZW_OFF) - renderer = ETR_TEXTURE_GOURAUD_NOZ; - else - { - renderer = ETR_TEXTURE_GOURAUD; - } - } - } - } - else - { - if (!Material.GouraudShading) - renderer = (!Material.Wireframe) ? ETR_FLAT : ETR_FLAT_WIRE; - else - renderer = (!Material.Wireframe) ? ETR_GOURAUD : ETR_GOURAUD_WIRE; - } - - switchToTriangleRenderer(renderer); -} - - -//! queries the features of the driver, returns true if feature is available -bool CSoftwareDriver::queryFeature(E_VIDEO_DRIVER_FEATURE feature) const -{ - switch (feature) - { - case EVDF_RENDER_TO_TARGET: - case EVDF_TEXTURE_NSQUARE: - return FeatureEnabled[feature]; - default: - return false; - }; -} - - -//! Create render target. -IRenderTarget* CSoftwareDriver::addRenderTarget() -{ - CSoftwareRenderTarget* renderTarget = new CSoftwareRenderTarget(this); - RenderTargets.push_back(renderTarget); - - return renderTarget; -} - - -//! sets transformation -void CSoftwareDriver::setTransform(E_TRANSFORMATION_STATE state, const core::matrix4& mat) -{ - TransformationMatrix[state] = mat; -} - - -//! sets the current Texture -bool CSoftwareDriver::setActiveTexture(u32 stage, video::ITexture* texture) -{ - if (texture && texture->getDriverType() != EDT_SOFTWARE) - { - os::Printer::log("Fatal Error: Tried to set a texture not owned by this driver.", ELL_ERROR); - return false; - } - - if (Texture) - Texture->drop(); - - Texture = texture; - - if (Texture) - Texture->grab(); - - selectRightTriangleRenderer(); - return true; -} - - -//! sets a material -void CSoftwareDriver::setMaterial(const SMaterial& material) -{ - Material = material; - OverrideMaterial.apply(Material); - - for (u32 i = 0; i < 1; ++i) - { - setActiveTexture(i, Material.getTexture(i)); - setTransform ((E_TRANSFORMATION_STATE) ( ETS_TEXTURE_0 + i ), - material.getTextureMatrix(i)); - } -} - -bool CSoftwareDriver::beginScene(u16 clearFlag, SColor clearColor, f32 clearDepth, u8 clearStencil, const SExposedVideoData& videoData, core::rect<s32>* sourceRect) -{ - CNullDriver::beginScene(clearFlag, clearColor, clearDepth, clearStencil, videoData, sourceRect); - WindowId=videoData.D3D9.HWnd; - SceneSourceRect = sourceRect; - - clearBuffers(clearFlag, clearColor, clearDepth, clearStencil); - - return true; -} - -bool CSoftwareDriver::endScene() -{ - CNullDriver::endScene(); - - return Presenter->present(BackBuffer, WindowId, SceneSourceRect); -} - -ITexture* CSoftwareDriver::createDeviceDependentTexture(const io::path& name, IImage* image) -{ - CSoftwareTexture* texture = new CSoftwareTexture(image, name, false); - - return texture; -} - -ITexture* CSoftwareDriver::createDeviceDependentTextureCubemap(const io::path& name, const core::array<IImage*>& image) -{ - return 0; -} - -bool CSoftwareDriver::setRenderTargetEx(IRenderTarget* target, u16 clearFlag, SColor clearColor, f32 clearDepth, u8 clearStencil) -{ - if (target && target->getDriverType() != EDT_SOFTWARE) - { - os::Printer::log("Fatal Error: Tried to set a render target not owned by this driver.", ELL_ERROR); - return false; - } - - if (RenderTargetTexture) - RenderTargetTexture->drop(); - - CSoftwareRenderTarget* renderTarget = static_cast<CSoftwareRenderTarget*>(target); - RenderTargetTexture = (renderTarget) ? renderTarget->getTexture() : 0; - - if (RenderTargetTexture) - { - RenderTargetTexture->grab(); - setRenderTargetImage(((CSoftwareTexture*)RenderTargetTexture)->getTexture()); - } - else - { - setRenderTargetImage(BackBuffer); - } - - clearBuffers(clearFlag, clearColor, clearDepth, clearStencil); - - return true; -} - - -//! sets a render target -void CSoftwareDriver::setRenderTargetImage(video::CImage* image) -{ - if (RenderTargetSurface) - RenderTargetSurface->drop(); - - RenderTargetSurface = image; - RenderTargetSize.Width = 0; - RenderTargetSize.Height = 0; - Render2DTranslation.X = 0; - Render2DTranslation.Y = 0; - - if (RenderTargetSurface) - { - RenderTargetSurface->grab(); - RenderTargetSize = RenderTargetSurface->getDimension(); - } - - setViewPort(core::rect<s32>(0,0,RenderTargetSize.Width,RenderTargetSize.Height)); - - if (ZBuffer) - ZBuffer->setSize(RenderTargetSize); -} - - -//! sets a viewport -void CSoftwareDriver::setViewPort(const core::rect<s32>& area) -{ - ViewPort = area; - - //TODO: the clipping is not correct, because the projection is affected. - // to correct this, ViewPortSize and Render2DTranslation will have to be corrected. - core::rect<s32> rendert(0,0,RenderTargetSize.Width,RenderTargetSize.Height); - ViewPort.clipAgainst(rendert); - - ViewPortSize = core::dimension2du(ViewPort.getSize()); - Render2DTranslation.X = (ViewPortSize.Width / 2) + ViewPort.UpperLeftCorner.X; - Render2DTranslation.Y = ViewPort.UpperLeftCorner.Y + ViewPortSize.Height - (ViewPortSize.Height / 2);// + ViewPort.UpperLeftCorner.Y; - - if (CurrentTriangleRenderer) - CurrentTriangleRenderer->setRenderTarget(RenderTargetSurface, ViewPort); -} - - -void CSoftwareDriver::drawVertexPrimitiveList(const void* vertices, u32 vertexCount, - const void* indexList, u32 primitiveCount, - E_VERTEX_TYPE vType, scene::E_PRIMITIVE_TYPE pType, E_INDEX_TYPE iType) - -{ - switch (iType) - { - case (EIT_16BIT): - { - drawVertexPrimitiveList16(vertices, vertexCount, (const u16*)indexList, primitiveCount, vType, pType); - break; - } - case (EIT_32BIT): - { - os::Printer::log("Software driver can not render 32bit buffers", ELL_ERROR); - break; - } - } -} - - -//! draws a vertex primitive list -void CSoftwareDriver::drawVertexPrimitiveList16(const void* vertices, u32 vertexCount, const u16* indexList, u32 primitiveCount, E_VERTEX_TYPE vType, scene::E_PRIMITIVE_TYPE pType) -{ - const u16* indexPointer=0; - core::array<u16> newBuffer; - switch (pType) - { - case scene::EPT_LINE_STRIP: - { - switch (vType) - { - case EVT_STANDARD: - { - for (u32 i=0; i < primitiveCount-1; ++i) - draw3DLine(((S3DVertex*)vertices)[indexList[i]].Pos, - ((S3DVertex*)vertices)[indexList[i+1]].Pos, - ((S3DVertex*)vertices)[indexList[i]].Color); - } - break; - case EVT_2TCOORDS: - { - for (u32 i=0; i < primitiveCount-1; ++i) - draw3DLine(((S3DVertex2TCoords*)vertices)[indexList[i]].Pos, - ((S3DVertex2TCoords*)vertices)[indexList[i+1]].Pos, - ((S3DVertex2TCoords*)vertices)[indexList[i]].Color); - } - break; - case EVT_TANGENTS: - { - for (u32 i=0; i < primitiveCount-1; ++i) - draw3DLine(((S3DVertexTangents*)vertices)[indexList[i]].Pos, - ((S3DVertexTangents*)vertices)[indexList[i+1]].Pos, - ((S3DVertexTangents*)vertices)[indexList[i]].Color); - } - break; - } - } - return; - case scene::EPT_LINE_LOOP: - drawVertexPrimitiveList16(vertices, vertexCount, indexList, primitiveCount-1, vType, scene::EPT_LINE_STRIP); - switch (vType) - { - case EVT_STANDARD: - draw3DLine(((S3DVertex*)vertices)[indexList[primitiveCount-1]].Pos, - ((S3DVertex*)vertices)[indexList[0]].Pos, - ((S3DVertex*)vertices)[indexList[primitiveCount-1]].Color); - break; - case EVT_2TCOORDS: - draw3DLine(((S3DVertex2TCoords*)vertices)[indexList[primitiveCount-1]].Pos, - ((S3DVertex2TCoords*)vertices)[indexList[0]].Pos, - ((S3DVertex2TCoords*)vertices)[indexList[primitiveCount-1]].Color); - break; - case EVT_TANGENTS: - draw3DLine(((S3DVertexTangents*)vertices)[indexList[primitiveCount-1]].Pos, - ((S3DVertexTangents*)vertices)[indexList[0]].Pos, - ((S3DVertexTangents*)vertices)[indexList[primitiveCount-1]].Color); - break; - } - return; - case scene::EPT_LINES: - { - switch (vType) - { - case EVT_STANDARD: - { - for (u32 i=0; i < 2*primitiveCount; i+=2) - draw3DLine(((S3DVertex*)vertices)[indexList[i]].Pos, - ((S3DVertex*)vertices)[indexList[i+1]].Pos, - ((S3DVertex*)vertices)[indexList[i]].Color); - } - break; - case EVT_2TCOORDS: - { - for (u32 i=0; i < 2*primitiveCount; i+=2) - draw3DLine(((S3DVertex2TCoords*)vertices)[indexList[i]].Pos, - ((S3DVertex2TCoords*)vertices)[indexList[i+1]].Pos, - ((S3DVertex2TCoords*)vertices)[indexList[i]].Color); - } - break; - case EVT_TANGENTS: - { - for (u32 i=0; i < 2*primitiveCount; i+=2) - draw3DLine(((S3DVertexTangents*)vertices)[indexList[i]].Pos, - ((S3DVertexTangents*)vertices)[indexList[i+1]].Pos, - ((S3DVertexTangents*)vertices)[indexList[i]].Color); - } - break; - } - } - return; - case scene::EPT_TRIANGLE_FAN: - { - // TODO: don't convert fan to list - newBuffer.reallocate(primitiveCount*3); - for( u32 t=0; t<primitiveCount; ++t ) - { - newBuffer.push_back(indexList[0]); - newBuffer.push_back(indexList[t+1]); - newBuffer.push_back(indexList[t+2]); - } - - indexPointer = newBuffer.pointer(); - } - break; - case scene::EPT_TRIANGLES: - indexPointer=indexList; - break; - default: - return; - } - switch (vType) - { - case EVT_STANDARD: - drawClippedIndexedTriangleListT((S3DVertex*)vertices, vertexCount, indexPointer, primitiveCount); - break; - case EVT_2TCOORDS: - drawClippedIndexedTriangleListT((S3DVertex2TCoords*)vertices, vertexCount, indexPointer, primitiveCount); - break; - case EVT_TANGENTS: - drawClippedIndexedTriangleListT((S3DVertexTangents*)vertices, vertexCount, indexPointer, primitiveCount); - break; - } -} - - -template<class VERTEXTYPE> -void CSoftwareDriver::drawClippedIndexedTriangleListT(const VERTEXTYPE* vertices, - s32 vertexCount, const u16* indexList, s32 triangleCount) -{ - if (!RenderTargetSurface || !ZBuffer || !triangleCount) - return; - - if (!checkPrimitiveCount(triangleCount)) - return; - - // arrays for storing clipped vertices - core::array<VERTEXTYPE> clippedVertices; - core::array<u16> clippedIndices; - - // calculate inverse world transformation - core::matrix4 worldinv(TransformationMatrix[ETS_WORLD]); - worldinv.makeInverse(); - - // calculate view frustum planes - scene::SViewFrustum frustum(TransformationMatrix[ETS_PROJECTION] * TransformationMatrix[ETS_VIEW], true); - - // copy and transform clipping planes ignoring far plane - core::plane3df planes[5]; // ordered by near, left, right, bottom, top - for (int p=0; p<5; ++p) - worldinv.transformPlane(frustum.planes[p+1], planes[p]); - - core::EIntersectionRelation3D inout[3]; // is point in front or back of plane? - - // temporary buffer for vertices to be clipped by all planes - core::array<VERTEXTYPE> tClpBuf; - int t; - - int i; - for (i=0; i<triangleCount; ++i) // for all input triangles - { - // add next triangle to tempClipBuffer - for (t=0; t<3; ++t) - tClpBuf.push_back(vertices[indexList[(i*3)+t]]); - - for (int p=0; p<5; ++p) // for all clip planes - for (int v=0; v<(int)tClpBuf.size(); v+=3) // for all vertices in temp clip buffer - { - int inside = 0; - int outside = 0; - - // test intersection relation of the current vertices - for (t=0; t<3; ++t) - { - inout[t] = planes[p].classifyPointRelation(tClpBuf[v+t].Pos); - if (inout[t] != core::ISREL3D_FRONT) - ++inside; - else - if (inout[t] == core::ISREL3D_FRONT) - ++outside; - } - - if (!outside) - { - // add all vertices to new buffer, this triangle needs no clipping. - // so simply don't change this part of the temporary triangle buffer - continue; - } - - if (!inside) - { - // all vertices are outside, don't add this triangle, so erase this - // triangle from the tClpBuf - tClpBuf.erase(v,3); - v -= 3; - continue; - } - - // this vertex has to be clipped by this clipping plane. - - // The following lines represent my try to implement some real clipping. - // There is a bug somewhere, and after some time I've given up. - // So now it is commented out, resulting that triangles which would need clipping - // are simply taken out (in the next two lines). -#ifndef __SOFTWARE_CLIPPING_PROBLEM__ - tClpBuf.erase(v,3); - v -= 3; -#endif - - /* - // my idea is the following: - // current vertex to next vertex relation: - // out - out : add nothing - // out - in : add middle point - // in - out : add first and middle point - // in - in : add both - - - // now based on the number of intersections, create new vertices - // into tClpBuf (at the front for not letting them be clipped again) - - int added = 0; - int prev = v+2; - for (int index=v; index<v+3; ++index) - { - if (inout[prev] == core::ISREL3D_BACK) - { - if (inout[index] != core::ISREL3D_BACK) - { - VERTEXTYPE& vt1 = tClpBuf[prev]; - VERTEXTYPE& vt2 = tClpBuf[index]; - - f32 fact = planes[p].getKnownIntersectionWithLine(vt1.Pos, vt2.Pos); - VERTEXTYPE nvt; - nvt.Pos = vt1.Pos.getInterpolated(vt2.Pos, fact); - nvt.Color = vt1.Color.getInterpolated(vt2.Color, fact); - nvt.TCoords = vt1.TCoords.getInterpolated(vt2.TCoords, fact); - - tClpBuf.push_front(nvt); ++index; ++prev; ++v; - ++added; - } - } - else - { - if (inout[index] != core::ISREL3D_BACK) - { - VERTEXTYPE vt1 = tClpBuf[index]; - VERTEXTYPE vt2 = tClpBuf[prev]; - tClpBuf.push_front(vt1); ++index; ++prev; ++v; - tClpBuf.push_front(vt2); ++index; ++prev; ++v; - added+= 2; - } - else - { - // same as above, but other way round. - VERTEXTYPE vt1 = tClpBuf[index]; - VERTEXTYPE vt2 = tClpBuf[prev]; - - f32 fact = planes[p].getKnownIntersectionWithLine(vt1.Pos, vt2.Pos); - VERTEXTYPE nvt; - nvt.Pos = vt1.Pos.getInterpolated(vt2.Pos, fact); - nvt.Color = vt1.Color.getInterpolated(vt2.Color, fact); - nvt.TCoords = vt1.TCoords.getInterpolated(vt2.TCoords, fact); - - tClpBuf.push_front(vt2); ++index; ++prev; ++v; - tClpBuf.push_front(nvt); ++index; ++prev; ++v; - added += 2; - } - } - - prev = index; - } - - // erase original vertices - tClpBuf.erase(v,3); - v -= 3; - */ - - - } // end for all clip planes - - // now add all remaining triangles in tempClipBuffer to clippedIndices - // and clippedVertices array. - if (clippedIndices.size() + tClpBuf.size() < 65535) - for (t=0; t<(int)tClpBuf.size(); ++t) - { - clippedIndices.push_back(clippedVertices.size()); - clippedVertices.push_back(tClpBuf[t]); - } - tClpBuf.clear(); - - } // end for all input triangles - - - // draw newly created triangles. - - // ----------------------------------------------------------- - // here all triangles are being drawn. I put this in a separate - // method, but the visual studio 6 compiler has great problems - // with templates and didn't accept two template methods in this - // class. - - // draw triangles - - CNullDriver::drawVertexPrimitiveList(clippedVertices.pointer(), clippedVertices.size(), - clippedIndices.pointer(), clippedIndices.size()/3, EVT_STANDARD, scene::EPT_TRIANGLES, EIT_16BIT); - - if (TransformedPoints.size() < clippedVertices.size()) - TransformedPoints.set_used(clippedVertices.size()); - - if (TransformedPoints.empty()) - return; - - const VERTEXTYPE* currentVertex = clippedVertices.pointer(); - S2DVertex* tp = &TransformedPoints[0]; - - core::dimension2d<u32> textureSize(0,0); - f32 zDiv; - - if (Texture) - textureSize = ((CSoftwareTexture*)Texture)->getTexture()->getDimension(); - - f32 transformedPos[4]; // transform all points in the list - - core::matrix4 matrix(TransformationMatrix[ETS_PROJECTION]); - matrix *= TransformationMatrix[ETS_VIEW]; - matrix *= TransformationMatrix[ETS_WORLD]; - - s32 ViewTransformWidth = (ViewPortSize.Width>>1); - s32 ViewTransformHeight = (ViewPortSize.Height>>1); - - for (i=0; i<(int)clippedVertices.size(); ++i) - { - transformedPos[0] = currentVertex->Pos.X; - transformedPos[1] = currentVertex->Pos.Y; - transformedPos[2] = currentVertex->Pos.Z; - transformedPos[3] = 1.0f; - - matrix.multiplyWith1x4Matrix(transformedPos); - zDiv = transformedPos[3] == 0.0f ? 1.0f : (1.0f / transformedPos[3]); - - tp->Pos.X = (s32)(ViewTransformWidth * (transformedPos[0] * zDiv) + (Render2DTranslation.X)); - tp->Pos.Y = (Render2DTranslation.Y - (s32)(ViewTransformHeight * (transformedPos[1] * zDiv))); - tp->Color = currentVertex->Color.toA1R5G5B5(); - tp->ZValue = (TZBufferType)(32767.0f * zDiv); - - tp->TCoords.X = (s32)(currentVertex->TCoords.X * textureSize.Width); - tp->TCoords.X <<= 8; - tp->TCoords.Y = (s32)(currentVertex->TCoords.Y * textureSize.Height); - tp->TCoords.Y <<= 8; - - ++currentVertex; - ++tp; - } - - // draw all transformed points from the index list - CurrentTriangleRenderer->drawIndexedTriangleList(&TransformedPoints[0], - clippedVertices.size(), clippedIndices.pointer(), clippedIndices.size()/3); -} - - -//! Draws a 3d line. -void CSoftwareDriver::draw3DLine(const core::vector3df& start, - const core::vector3df& end, SColor color) -{ - core::vector3df vect = start.crossProduct(end); - vect.normalize(); - vect *= Material.Thickness*0.3f; - - S3DVertex vtx[4]; - - vtx[0].Color = color; - vtx[1].Color = color; - vtx[2].Color = color; - vtx[3].Color = color; - - vtx[0].Pos = start; - vtx[1].Pos = end; - - vtx[2].Pos = start + vect; - vtx[3].Pos = end + vect; - - u16 idx[12] = {0,1,2, 0,2,1, 0,1,3, 0,3,1}; - - drawIndexedTriangleList(vtx, 4, idx, 4); -} - - -//! clips a triangle against the viewing frustum -void CSoftwareDriver::clipTriangle(f32* transformedPos) -{ -} - - -//! Only used by the internal engine. Used to notify the driver that -//! the window was resized. -void CSoftwareDriver::OnResize(const core::dimension2d<u32>& size) -{ - // make sure width and height are multiples of 2 - core::dimension2d<u32> realSize(size); - - if (realSize.Width % 2) - realSize.Width += 1; - - if (realSize.Height % 2) - realSize.Height += 1; - - if (ScreenSize != realSize) - { - if (ViewPort.getWidth() == (s32)ScreenSize.Width && - ViewPort.getHeight() == (s32)ScreenSize.Height) - { - ViewPort = core::rect<s32>(core::position2d<s32>(0,0), - core::dimension2di(realSize)); - } - - ScreenSize = realSize; - - bool resetRT = (RenderTargetSurface == BackBuffer); - - if (BackBuffer) - BackBuffer->drop(); - BackBuffer = new CImage(ECF_A1R5G5B5, realSize); - - if (resetRT) - setRenderTargetImage(BackBuffer); - } -} - -//! returns the current render target size -const core::dimension2d<u32>& CSoftwareDriver::getCurrentRenderTargetSize() const -{ - return RenderTargetSize; -} - - -//! draws an 2d image, using a color (if color is other then Color(255,255,255,255)) and the alpha channel of the texture if wanted. -void CSoftwareDriver::draw2DImage(const video::ITexture* texture, const core::position2d<s32>& destPos, - const core::rect<s32>& sourceRect, - const core::rect<s32>* clipRect, SColor color, - bool useAlphaChannelOfTexture) -{ - if (texture) - { - if (texture->getDriverType() != EDT_SOFTWARE) - { - os::Printer::log("Fatal Error: Tried to copy from a surface not owned by this driver.", ELL_ERROR); - return; - } - - if (useAlphaChannelOfTexture) - ((CSoftwareTexture*)texture)->getImage()->copyToWithAlpha( - RenderTargetSurface, destPos, sourceRect, color, clipRect); - else - ((CSoftwareTexture*)texture)->getImage()->copyTo( - RenderTargetSurface, destPos, sourceRect, clipRect); - } -} - - - -//! Draws a 2d line. -void CSoftwareDriver::draw2DLine(const core::position2d<s32>& start, - const core::position2d<s32>& end, - SColor color) -{ - drawLine(RenderTargetSurface, start, end, color ); -} - - -//! Draws a pixel -void CSoftwareDriver::drawPixel(u32 x, u32 y, const SColor & color) -{ - BackBuffer->setPixel(x, y, color, true); -} - - -//! draw a 2d rectangle -void CSoftwareDriver::draw2DRectangle(SColor color, const core::rect<s32>& pos, - const core::rect<s32>* clip) -{ - if (clip) - { - core::rect<s32> p(pos); - - p.clipAgainst(*clip); - - if(!p.isValid()) - return; - - drawRectangle(RenderTargetSurface, p, color); - } - else - { - if(!pos.isValid()) - return; - - drawRectangle(RenderTargetSurface, pos, color); - } -} - - -//!Draws an 2d rectangle with a gradient. -void CSoftwareDriver::draw2DRectangle(const core::rect<s32>& pos, - SColor colorLeftUp, SColor colorRightUp, SColor colorLeftDown, SColor colorRightDown, - const core::rect<s32>* clip) -{ - // TODO: implement - draw2DRectangle(colorLeftUp, pos, clip); -} - - -//! \return Returns the name of the video driver. Example: In case of the Direct3D8 -//! driver, it would return "Direct3D8.1". -const wchar_t* CSoftwareDriver::getName() const -{ - return L"Irrlicht Software Driver 1.0"; -} - - -//! Returns type of video driver -E_DRIVER_TYPE CSoftwareDriver::getDriverType() const -{ - return EDT_SOFTWARE; -} - - -//! returns color format -ECOLOR_FORMAT CSoftwareDriver::getColorFormat() const -{ - if (BackBuffer) - return BackBuffer->getColorFormat(); - else - return CNullDriver::getColorFormat(); -} - - -//! Returns the transformation set by setTransform -const core::matrix4& CSoftwareDriver::getTransform(E_TRANSFORMATION_STATE state) const -{ - return TransformationMatrix[state]; -} - - -//! Creates a render target texture. -ITexture* CSoftwareDriver::addRenderTargetTexture(const core::dimension2d<u32>& size, - const io::path& name, - const ECOLOR_FORMAT format) -{ - IImage* img = createImage(video::ECF_A1R5G5B5, size); - ITexture* tex = new CSoftwareTexture(img, name, true); - img->drop(); - addTexture(tex); - tex->drop(); - return tex; -} - -void CSoftwareDriver::clearBuffers(u16 flag, SColor color, f32 depth, u8 stencil) -{ - if ((flag & ECBF_COLOR) && RenderTargetSurface) - RenderTargetSurface->fill(color); - - if ((flag & ECBF_DEPTH) && ZBuffer) - ZBuffer->clear(); -} - - -//! Returns an image created from the last rendered frame. -IImage* CSoftwareDriver::createScreenShot(video::ECOLOR_FORMAT format, video::E_RENDER_TARGET target) -{ - if (target != video::ERT_FRAME_BUFFER) - return 0; - - if (BackBuffer) - { - IImage* tmp = createImage(BackBuffer->getColorFormat(), BackBuffer->getDimension()); - BackBuffer->copyTo(tmp); - return tmp; - } - else - return 0; -} - - -//! Returns the maximum amount of primitives (mostly vertices) which -//! the device is able to render with one drawIndexedTriangleList -//! call. -u32 CSoftwareDriver::getMaximalPrimitiveCount() const -{ - return 0x00800000; -} - -bool CSoftwareDriver::queryTextureFormat(ECOLOR_FORMAT format) const -{ - return format == ECF_A1R5G5B5; -} - - -} // end namespace video -} // end namespace irr - -#endif // _IRR_COMPILE_WITH_SOFTWARE_ - -namespace irr -{ -namespace video -{ - - -//! creates a video driver -IVideoDriver* createSoftwareDriver(const core::dimension2d<u32>& windowSize, bool fullscreen, io::IFileSystem* io, video::IImagePresenter* presenter) -{ - #ifdef _IRR_COMPILE_WITH_SOFTWARE_ - return new CSoftwareDriver(windowSize, fullscreen, io, presenter); - #else - return 0; - #endif -} - - -} // end namespace video -} // end namespace irr - diff --git a/source/Irrlicht/CSoftwareDriver.h b/source/Irrlicht/CSoftwareDriver.h deleted file mode 100644 index c816142e..00000000 --- a/source/Irrlicht/CSoftwareDriver.h +++ /dev/null @@ -1,180 +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_VIDEO_SOFTWARE_H_INCLUDED__ -#define __C_VIDEO_SOFTWARE_H_INCLUDED__ - -#include "ITriangleRenderer.h" -#include "CNullDriver.h" -#include "SViewFrustum.h" -#include "CImage.h" - -namespace irr -{ -namespace video -{ - class CSoftwareDriver : public CNullDriver - { - public: - - //! constructor - CSoftwareDriver(const core::dimension2d<u32>& windowSize, bool fullscreen, io::IFileSystem* io, video::IImagePresenter* presenter); - - //! destructor - virtual ~CSoftwareDriver(); - - //! queries the features of the driver, returns true if feature is available - virtual bool queryFeature(E_VIDEO_DRIVER_FEATURE feature) const _IRR_OVERRIDE_; - - //! Create render target. - virtual IRenderTarget* addRenderTarget() _IRR_OVERRIDE_; - - //! sets transformation - virtual void setTransform(E_TRANSFORMATION_STATE state, const core::matrix4& mat) _IRR_OVERRIDE_; - - //! sets a material - virtual void setMaterial(const SMaterial& material) _IRR_OVERRIDE_; - - virtual bool setRenderTargetEx(IRenderTarget* target, u16 clearFlag, SColor clearColor = SColor(255,0,0,0), - f32 clearDepth = 1.f, u8 clearStencil = 0) _IRR_OVERRIDE_; - - //! sets a viewport - virtual void setViewPort(const core::rect<s32>& area) _IRR_OVERRIDE_; - - virtual bool beginScene(u16 clearFlag, SColor clearColor = SColor(255,0,0,0), f32 clearDepth = 1.f, u8 clearStencil = 0, - const SExposedVideoData& videoData = SExposedVideoData(), core::rect<s32>* sourceRect = 0) _IRR_OVERRIDE_; - - virtual bool endScene() _IRR_OVERRIDE_; - - //! Only used by the internal engine. Used to notify the driver that - //! the window was resized. - virtual void OnResize(const core::dimension2d<u32>& size) _IRR_OVERRIDE_; - - //! returns size of the current render target - virtual const core::dimension2d<u32>& getCurrentRenderTargetSize() const _IRR_OVERRIDE_; - - //! draws a vertex primitive list - virtual void drawVertexPrimitiveList(const void* vertices, u32 vertexCount, - const void* indexList, u32 primitiveCount, - E_VERTEX_TYPE vType, scene::E_PRIMITIVE_TYPE pType, E_INDEX_TYPE iType) _IRR_OVERRIDE_; - - //! Draws a 3d line. - virtual void draw3DLine(const core::vector3df& start, - const core::vector3df& end, SColor color = SColor(255,255,255,255)) _IRR_OVERRIDE_; - - //! draws an 2d image, using a color (if color is other then Color(255,255,255,255)) and the alpha channel of the texture if wanted. - virtual void draw2DImage(const video::ITexture* texture, const core::position2d<s32>& destPos, - const core::rect<s32>& sourceRect, const core::rect<s32>* clipRect = 0, - SColor color=SColor(255,255,255,255), bool useAlphaChannelOfTexture=false) _IRR_OVERRIDE_; - - //! draw an 2d rectangle - virtual void draw2DRectangle(SColor color, const core::rect<s32>& pos, - const core::rect<s32>* clip = 0) _IRR_OVERRIDE_; - - //!Draws an 2d rectangle with a gradient. - virtual void draw2DRectangle(const core::rect<s32>& pos, - SColor colorLeftUp, SColor colorRightUp, SColor colorLeftDown, SColor colorRightDown, - const core::rect<s32>* clip = 0) _IRR_OVERRIDE_; - - //! Draws a 2d line. - virtual void draw2DLine(const core::position2d<s32>& start, - const core::position2d<s32>& end, - SColor color=SColor(255,255,255,255)) _IRR_OVERRIDE_; - - //! Draws a single pixel - virtual void drawPixel(u32 x, u32 y, const SColor & color) _IRR_OVERRIDE_; - - //! \return Returns the name of the video driver. Example: In case of the Direct3D8 - //! driver, it would return "Direct3D8.1". - virtual const wchar_t* getName() const _IRR_OVERRIDE_; - - //! Returns type of video driver - virtual E_DRIVER_TYPE getDriverType() const _IRR_OVERRIDE_; - - //! get color format of the current color buffer - virtual ECOLOR_FORMAT getColorFormat() const _IRR_OVERRIDE_; - - //! Returns the transformation set by setTransform - virtual const core::matrix4& getTransform(E_TRANSFORMATION_STATE state) const _IRR_OVERRIDE_; - - virtual ITexture* createDeviceDependentTexture(const io::path& name, IImage* image) _IRR_OVERRIDE_; - virtual ITexture* createDeviceDependentTextureCubemap(const io::path& name, const core::array<IImage*>& image) _IRR_OVERRIDE_; - - //! Creates a render target texture. - virtual ITexture* addRenderTargetTexture(const core::dimension2d<u32>& size, - const io::path& name, const ECOLOR_FORMAT format = ECF_UNKNOWN) _IRR_OVERRIDE_; - - virtual void clearBuffers(u16 flag, SColor color = SColor(255,0,0,0), f32 depth = 1.f, u8 stencil = 0) _IRR_OVERRIDE_; - - //! Returns an image created from the last rendered frame. - virtual IImage* createScreenShot(video::ECOLOR_FORMAT format=video::ECF_UNKNOWN, video::E_RENDER_TARGET target=video::ERT_FRAME_BUFFER) _IRR_OVERRIDE_; - - //! Returns the maximum amount of primitives (mostly vertices) which - //! the device is able to render with one drawIndexedTriangleList - //! call. - virtual u32 getMaximalPrimitiveCount() const _IRR_OVERRIDE_; - - //! Check if the driver supports creating textures with the given color format - virtual bool queryTextureFormat(ECOLOR_FORMAT format) const _IRR_OVERRIDE_; - - protected: - - //! sets a render target - void setRenderTargetImage(video::CImage* image); - - //! sets the current Texture - bool setActiveTexture(u32 stage, video::ITexture* texture); - - //! switches to a triangle renderer - void switchToTriangleRenderer(ETriangleRenderer renderer); - - //! void selects the right triangle renderer based on the render states. - void selectRightTriangleRenderer(); - - //! clips a triangle agains the viewing frustum - void clipTriangle(f32* transformedPos); - - - //! draws a vertex primitive list - void drawVertexPrimitiveList16(const void* vertices, u32 vertexCount, - const u16* indexList, u32 primitiveCount, - E_VERTEX_TYPE vType, scene::E_PRIMITIVE_TYPE pType); - - - template<class VERTEXTYPE> - void drawClippedIndexedTriangleListT(const VERTEXTYPE* vertices, - s32 vertexCount, const u16* indexList, s32 triangleCount); - - video::CImage* BackBuffer; - video::IImagePresenter* Presenter; - void* WindowId; - core::rect<s32>* SceneSourceRect; - - core::array<S2DVertex> TransformedPoints; - - video::ITexture* RenderTargetTexture; - video::CImage* RenderTargetSurface; - core::position2d<s32> Render2DTranslation; - core::dimension2d<u32> RenderTargetSize; - core::dimension2d<u32> ViewPortSize; - - core::matrix4 TransformationMatrix[ETS_COUNT]; - - ITriangleRenderer* CurrentTriangleRenderer; - ITriangleRenderer* TriangleRenderers[ETR_COUNT]; - ETriangleRenderer CurrentRenderer; - - IZBuffer* ZBuffer; - - video::ITexture* Texture; - - SMaterial Material; - }; - -} // end namespace video -} // end namespace irr - - -#endif - diff --git a/source/Irrlicht/CSoftwareDriver2.cpp b/source/Irrlicht/CSoftwareDriver2.cpp deleted file mode 100644 index 8fa5a9de..00000000 --- a/source/Irrlicht/CSoftwareDriver2.cpp +++ /dev/null @@ -1,3821 +0,0 @@ -// Copyright (C) 2002-2012 Nikolaus Gebhardt / Thomas Alten -// This file is part of the "Irrlicht Engine". -// For conditions of distribution and use, see copyright notice in irrlicht.h - -#include "IrrCompileConfig.h" -#include "CSoftwareDriver2.h" - -#ifdef _IRR_COMPILE_WITH_BURNINGSVIDEO_ - -#include "SoftwareDriver2_helper.h" -#include "CSoftwareTexture.h" -#include "CSoftwareTexture2.h" -#include "CSoftware2MaterialRenderer.h" -#include "S3DVertex.h" -#include "S4DVertex.h" -#include "CBlit.h" - - -// Matrix now here - -template <class T> -bool mat44_transposed_inverse(irr::core::CMatrix4<T>& out, const irr::core::CMatrix4<T>& M) -{ - const T* burning_restrict m = M.pointer(); - - double d = - (m[0] * m[5] - m[1] * m[4]) * (m[10] * m[15] - m[11] * m[14]) - - (m[0] * m[6] - m[2] * m[4]) * (m[9] * m[15] - m[11] * m[13]) + - (m[0] * m[7] - m[3] * m[4]) * (m[9] * m[14] - m[10] * m[13]) + - (m[1] * m[6] - m[2] * m[5]) * (m[8] * m[15] - m[11] * m[12]) - - (m[1] * m[7] - m[3] * m[5]) * (m[8] * m[14] - m[10] * m[12]) + - (m[2] * m[7] - m[3] * m[6]) * (m[8] * m[13] - m[9] * m[12]); - - if (fabs(d) < DBL_MIN) - { - out.makeIdentity(); - return false; - } - - d = 1.0 / d; - T* burning_restrict o = out.pointer(); - o[0] = (T)(d * (m[5] * (m[10] * m[15] - m[11] * m[14]) + m[6] * (m[11] * m[13] - m[9] * m[15]) + m[7] * (m[9] * m[14] - m[10] * m[13]))); - o[4] = (T)(d * (m[9] * (m[2] * m[15] - m[3] * m[14]) + m[10] * (m[3] * m[13] - m[1] * m[15]) + m[11] * (m[1] * m[14] - m[2] * m[13]))); - o[8] = (T)(d * (m[13] * (m[2] * m[7] - m[3] * m[6]) + m[14] * (m[3] * m[5] - m[1] * m[7]) + m[15] * (m[1] * m[6] - m[2] * m[5]))); - o[12] = (T)(d * (m[1] * (m[7] * m[10] - m[6] * m[11]) + m[2] * (m[5] * m[11] - m[7] * m[9]) + m[3] * (m[6] * m[9] - m[5] * m[10]))); - - o[1] = (T)(d * (m[6] * (m[8] * m[15] - m[11] * m[12]) + m[7] * (m[10] * m[12] - m[8] * m[14]) + m[4] * (m[11] * m[14] - m[10] * m[15]))); - o[5] = (T)(d * (m[10] * (m[0] * m[15] - m[3] * m[12]) + m[11] * (m[2] * m[12] - m[0] * m[14]) + m[8] * (m[3] * m[14] - m[2] * m[15]))); - o[9] = (T)(d * (m[14] * (m[0] * m[7] - m[3] * m[4]) + m[15] * (m[2] * m[4] - m[0] * m[6]) + m[12] * (m[3] * m[6] - m[2] * m[7]))); - o[13] = (T)(d * (m[2] * (m[7] * m[8] - m[4] * m[11]) + m[3] * (m[4] * m[10] - m[6] * m[8]) + m[0] * (m[6] * m[11] - m[7] * m[10]))); - - o[2] = (T)(d * (m[7] * (m[8] * m[13] - m[9] * m[12]) + m[4] * (m[9] * m[15] - m[11] * m[13]) + m[5] * (m[11] * m[12] - m[8] * m[15]))); - o[6] = (T)(d * (m[11] * (m[0] * m[13] - m[1] * m[12]) + m[8] * (m[1] * m[15] - m[3] * m[13]) + m[9] * (m[3] * m[12] - m[0] * m[15]))); - o[10] = (T)(d * (m[15] * (m[0] * m[5] - m[1] * m[4]) + m[12] * (m[1] * m[7] - m[3] * m[5]) + m[13] * (m[3] * m[4] - m[0] * m[7]))); - o[14] = (T)(d * (m[3] * (m[5] * m[8] - m[4] * m[9]) + m[0] * (m[7] * m[9] - m[5] * m[11]) + m[1] * (m[4] * m[11] - m[7] * m[8]))); - - o[3] = (T)(d * (m[4] * (m[10] * m[13] - m[9] * m[14]) + m[5] * (m[8] * m[14] - m[10] * m[12]) + m[6] * (m[9] * m[12] - m[8] * m[13]))); - o[7] = (T)(d * (m[8] * (m[2] * m[13] - m[1] * m[14]) + m[9] * (m[0] * m[14] - m[2] * m[12]) + m[10] * (m[1] * m[12] - m[0] * m[13]))); - o[11] = (T)(d * (m[12] * (m[2] * m[5] - m[1] * m[6]) + m[13] * (m[0] * m[6] - m[2] * m[4]) + m[14] * (m[1] * m[4] - m[0] * m[5]))); - o[15] = (T)(d * (m[0] * (m[5] * m[10] - m[6] * m[9]) + m[1] * (m[6] * m[8] - m[4] * m[10]) + m[2] * (m[4] * m[9] - m[5] * m[8]))); - - return true; -} - -#if 0 -// difference to CMatrix4<T>::getInverse . higher precision in determinant. return identity on failure -template <class T> -bool mat44_inverse(CMatrix4<T>& out, const CMatrix4<T>& M) -{ - const T* m = M.pointer(); - - double d = - (m[0] * m[5] - m[1] * m[4]) * (m[10] * m[15] - m[11] * m[14]) - - (m[0] * m[6] - m[2] * m[4]) * (m[9] * m[15] - m[11] * m[13]) + - (m[0] * m[7] - m[3] * m[4]) * (m[9] * m[14] - m[10] * m[13]) + - (m[1] * m[6] - m[2] * m[5]) * (m[8] * m[15] - m[11] * m[12]) - - (m[1] * m[7] - m[3] * m[5]) * (m[8] * m[14] - m[10] * m[12]) + - (m[2] * m[7] - m[3] * m[6]) * (m[8] * m[13] - m[9] * m[12]); - - if (fabs(d) < DBL_MIN) - { - out.makeIdentity(); - return false; - } - - d = 1.0 / d; - T* o = out.pointer(); - o[0] = (T)(d * (m[5] * (m[10] * m[15] - m[11] * m[14]) + m[6] * (m[11] * m[13] - m[9] * m[15]) + m[7] * (m[9] * m[14] - m[10] * m[13]))); - o[1] = (T)(d * (m[9] * (m[2] * m[15] - m[3] * m[14]) + m[10] * (m[3] * m[13] - m[1] * m[15]) + m[11] * (m[1] * m[14] - m[2] * m[13]))); - o[2] = (T)(d * (m[13] * (m[2] * m[7] - m[3] * m[6]) + m[14] * (m[3] * m[5] - m[1] * m[7]) + m[15] * (m[1] * m[6] - m[2] * m[5]))); - o[3] = (T)(d * (m[1] * (m[7] * m[10] - m[6] * m[11]) + m[2] * (m[5] * m[11] - m[7] * m[9]) + m[3] * (m[6] * m[9] - m[5] * m[10]))); - - o[4] = (T)(d * (m[6] * (m[8] * m[15] - m[11] * m[12]) + m[7] * (m[10] * m[12] - m[8] * m[14]) + m[4] * (m[11] * m[14] - m[10] * m[15]))); - o[5] = (T)(d * (m[10] * (m[0] * m[15] - m[3] * m[12]) + m[11] * (m[2] * m[12] - m[0] * m[14]) + m[8] * (m[3] * m[14] - m[2] * m[15]))); - o[6] = (T)(d * (m[14] * (m[0] * m[7] - m[3] * m[4]) + m[15] * (m[2] * m[4] - m[0] * m[6]) + m[12] * (m[3] * m[6] - m[2] * m[7]))); - o[7] = (T)(d * (m[2] * (m[7] * m[8] - m[4] * m[11]) + m[3] * (m[4] * m[10] - m[6] * m[8]) + m[0] * (m[6] * m[11] - m[7] * m[10]))); - - o[8] = (T)(d * (m[7] * (m[8] * m[13] - m[9] * m[12]) + m[4] * (m[9] * m[15] - m[11] * m[13]) + m[5] * (m[11] * m[12] - m[8] * m[15]))); - o[9] = (T)(d * (m[11] * (m[0] * m[13] - m[1] * m[12]) + m[8] * (m[1] * m[15] - m[3] * m[13]) + m[9] * (m[3] * m[12] - m[0] * m[15]))); - o[10] = (T)(d * (m[15] * (m[0] * m[5] - m[1] * m[4]) + m[12] * (m[1] * m[7] - m[3] * m[5]) + m[13] * (m[3] * m[4] - m[0] * m[7]))); - o[11] = (T)(d * (m[3] * (m[5] * m[8] - m[4] * m[9]) + m[0] * (m[7] * m[9] - m[5] * m[11]) + m[1] * (m[4] * m[11] - m[7] * m[8]))); - - o[12] = (T)(d * (m[4] * (m[10] * m[13] - m[9] * m[14]) + m[5] * (m[8] * m[14] - m[10] * m[12]) + m[6] * (m[9] * m[12] - m[8] * m[13]))); - o[13] = (T)(d * (m[8] * (m[2] * m[13] - m[1] * m[14]) + m[9] * (m[0] * m[14] - m[2] * m[12]) + m[10] * (m[1] * m[12] - m[0] * m[13]))); - o[14] = (T)(d * (m[12] * (m[2] * m[5] - m[1] * m[6]) + m[13] * (m[0] * m[6] - m[2] * m[4]) + m[14] * (m[1] * m[4] - m[0] * m[5]))); - o[15] = (T)(d * (m[0] * (m[5] * m[10] - m[6] * m[9]) + m[1] * (m[6] * m[8] - m[4] * m[10]) + m[2] * (m[4] * m[9] - m[5] * m[8]))); - - return true; -} -#endif - -// void CMatrix4<T>::transformVec4(T *out, const T * in) const -template <class T> -inline void transformVec4Vec4(const irr::core::CMatrix4<T>& m, T* burning_restrict out, const T* burning_restrict in) -{ - const T* burning_restrict M = m.pointer(); - - out[0] = in[0] * M[0] + in[1] * M[4] + in[2] * M[8] + in[3] * M[12]; - out[1] = in[0] * M[1] + in[1] * M[5] + in[2] * M[9] + in[3] * M[13]; - out[2] = in[0] * M[2] + in[1] * M[6] + in[2] * M[10] + in[3] * M[14]; - out[3] = in[0] * M[3] + in[1] * M[7] + in[2] * M[11] + in[3] * M[15]; -} - -#if 0 -// void CMatrix4<T>::transformVect(T *out, const core::vector3df &in) const -template <class T> -inline void transformVec3Vec4(const irr::core::CMatrix4<T>& m, T* burning_restrict out, const core::vector3df& in) -{ - const T* burning_restrict M = m.pointer(); - out[0] = in.X * M[0] + in.Y * M[4] + in.Z * M[8] + M[12]; - out[1] = in.X * M[1] + in.Y * M[5] + in.Z * M[9] + M[13]; - out[2] = in.X * M[2] + in.Y * M[6] + in.Z * M[10] + M[14]; - out[3] = in.X * M[3] + in.Y * M[7] + in.Z * M[11] + M[15]; -} -#endif - -template <class T> -inline void rotateVec3Vec4(const irr::core::CMatrix4<T>& m, T* burning_restrict out, const T* burning_restrict in) -{ - const T* burning_restrict M = m.pointer(); - - out[0] = in[0] * M[0] + in[1] * M[4] + in[2] * M[8]; - out[1] = in[0] * M[1] + in[1] * M[5] + in[2] * M[9]; - out[2] = in[0] * M[2] + in[1] * M[6] + in[2] * M[10]; - out[3] = 0.f; -} - -//based on https://github.com/ekmett/approximate/blob/master/cbits/fast.c powf_fast_precise -static inline float powf_limit(const float a, const float b) -{ - if (a <= 0.0000001f) return 0.f; - else if (a >= 1.f) return 1.f; - - /* calculate approximation with fraction of the exponent */ - int e = (int)b; - union { float f; int x; } u = { a }; - u.x = (int)((b - e) * (u.x - 1065353216) + 1065353216); - - float r = 1.0f; - float ua = a; - while (e) { - if (e & 1) { - r *= ua; - } - if (ua < 0.00000001f) - break; - ua *= ua; - e >>= 1; - } - - r *= u.f; - return r; -} - -//! clamp(value,0,1) -static inline const float clampf01(const float v) -{ - return v < 0.f ? 0.f : v > 1.f ? 1.f : v; -} - -// IImage::fill -static void image_fill(irr::video::IImage* image, const irr::video::SColor& color, const interlaced_control interlaced) -{ - if (0 == image) - return; - - unsigned int c = color.color; - - switch (image->getColorFormat()) - { - case irr::video::ECF_A1R5G5B5: - c = color.toA1R5G5B5(); - c |= c << 16; - break; - default: - break; - } - irr::memset32_interlaced(image->getData(), c, image->getPitch(), image->getDimension().Height, interlaced); -} - - -union scale_setup -{ - struct - { - unsigned char x : 3; - unsigned char y : 3; - unsigned char i : 2; - }; - unsigned char v; -}; - -//setup Antialias. v0.52 uses as Interlaced -void get_scale(scale_setup& s, const irr::SIrrlichtCreationParameters& params) -{ - s.x = 1; - s.y = 1; - s.i = 0; - if (params.AntiAlias && params.WindowSize.Width <= 160 && params.WindowSize.Height <= 120) - { - return; - } - - switch (params.AntiAlias) - { - case 2: s.x = 1; s.y = 1; s.i = 1; break; - case 4: s.x = 2; s.y = 2; s.i = 0; break; - case 8: s.x = 2; s.y = 2; s.i = 1; break; - case 16:s.x = 4; s.y = 4; s.i = 0; break; - case 32:s.x = 4; s.y = 4; s.i = 1; break; - - case 3: s.x = 3; s.y = 3; s.i = 0; break; - case 5: s.x = 3; s.y = 3; s.i = 1; break; - } -} - -//turn on/off fpu exception -void fpu_exception(int on) -{ - return; -#if defined(_WIN32) - _clearfp(); - _controlfp(on ? _EM_INEXACT : -1, _MCW_EM); -#endif -} - -namespace irr -{ -namespace video -{ - -//! constructor -CBurningVideoDriver::CBurningVideoDriver(const irr::SIrrlichtCreationParameters& params, io::IFileSystem* io, video::IImagePresenter* presenter) - : CNullDriver(io, params.WindowSize), BackBuffer(0), Presenter(presenter), - WindowId(0), SceneSourceRect(0), - RenderTargetTexture(0), RenderTargetSurface(0), CurrentShader(0), - DepthBuffer(0), StencilBuffer(0) -{ - //enable fpu exception - fpu_exception(1); - -#ifdef _DEBUG - setDebugName("CBurningVideoDriver"); -#endif - - VertexCache_map_source_format(); - - //Use AntiAlias(hack) to shrink BackBuffer Size and keep ScreenSize the same as Input - scale_setup scale; - get_scale(scale, params); - - //Control Interlaced BackBuffer - Interlaced.enable = scale.i; - Interlaced.bypass = !Interlaced.enable; - Interlaced.nr = 0; - - // create backbuffer. - core::dimension2du use(params.WindowSize.Width / scale.x, params.WindowSize.Height / scale.y); - BackBuffer = new CImage(SOFTWARE_DRIVER_2_RENDERTARGET_COLOR_FORMAT, use); - if (BackBuffer) - { - //BackBuffer->fill(SColor(0)); - image_fill(BackBuffer, SColor(0), interlace_disabled()); - - // create z buffer - if (params.ZBufferBits) - DepthBuffer = video::createDepthBuffer(BackBuffer->getDimension()); - - // create stencil buffer - if (params.Stencilbuffer) - StencilBuffer = video::createStencilBuffer(BackBuffer->getDimension(), 8); - } - - DriverAttributes->setAttribute("MaxIndices", 1 << 16); - DriverAttributes->setAttribute("MaxTextures", BURNING_MATERIAL_MAX_TEXTURES); - DriverAttributes->setAttribute("MaxTextureSize", SOFTWARE_DRIVER_2_TEXTURE_MAXSIZE); - DriverAttributes->setAttribute("MaxLights", 1024); //glsl::gl_MaxLights); - DriverAttributes->setAttribute("MaxTextureLODBias", 16.f); - DriverAttributes->setAttribute("Version", 50); - - // create triangle renderers - - memset(BurningShader, 0, sizeof(BurningShader)); - //BurningShader[ETR_FLAT] = createTRFlat2(DepthBuffer); - //BurningShader[ETR_FLAT_WIRE] = createTRFlatWire2(DepthBuffer); - BurningShader[ETR_GOURAUD] = createTriangleRendererGouraud2(this); - BurningShader[ETR_GOURAUD_NOZ] = createTriangleRendererGouraudNoZ2(this); - //BurningShader[ETR_GOURAUD_ALPHA] = createTriangleRendererGouraudAlpha2(this ); - BurningShader[ETR_GOURAUD_ALPHA_NOZ] = createTRGouraudAlphaNoZ2(this); // 2D - //BurningShader[ETR_GOURAUD_WIRE] = createTriangleRendererGouraudWire2(DepthBuffer); - //BurningShader[ETR_TEXTURE_FLAT] = createTriangleRendererTextureFlat2(DepthBuffer); - //BurningShader[ETR_TEXTURE_FLAT_WIRE] = createTriangleRendererTextureFlatWire2(DepthBuffer); - BurningShader[ETR_TEXTURE_GOURAUD] = createTriangleRendererTextureGouraud2(this); - BurningShader[ETR_TEXTURE_GOURAUD_LIGHTMAP_M1] = createTriangleRendererTextureLightMap2_M1(this); - BurningShader[ETR_TEXTURE_GOURAUD_LIGHTMAP_M2] = createTriangleRendererTextureLightMap2_M2(this); - BurningShader[ETR_TEXTURE_GOURAUD_LIGHTMAP_M4] = createTriangleRendererGTextureLightMap2_M4(this); - BurningShader[ETR_TEXTURE_LIGHTMAP_M4] = createTriangleRendererTextureLightMap2_M4(this); - BurningShader[ETR_TEXTURE_GOURAUD_LIGHTMAP_ADD] = createTriangleRendererTextureLightMap2_Add(this); - BurningShader[ETR_TEXTURE_GOURAUD_DETAIL_MAP] = createTriangleRendererTextureDetailMap2(this); - - BurningShader[ETR_TEXTURE_GOURAUD_WIRE] = createTriangleRendererTextureGouraudWire2(this); - BurningShader[ETR_TEXTURE_GOURAUD_NOZ] = createTRTextureGouraudNoZ2(this); - BurningShader[ETR_TEXTURE_GOURAUD_ADD] = createTRTextureGouraudAdd2(this); - BurningShader[ETR_TEXTURE_GOURAUD_ADD_NO_Z] = createTRTextureGouraudAddNoZ2(this); - BurningShader[ETR_TEXTURE_GOURAUD_VERTEX_ALPHA] = createTriangleRendererTextureVertexAlpha2(this); - - BurningShader[ETR_TEXTURE_GOURAUD_ALPHA] = createTRTextureGouraudAlpha(this); - BurningShader[ETR_TEXTURE_GOURAUD_ALPHA_NOZ] = createTRTextureGouraudAlphaNoZ(this); - - BurningShader[ETR_NORMAL_MAP_SOLID] = createTRNormalMap(this); - BurningShader[ETR_STENCIL_SHADOW] = createTRStencilShadow(this); - BurningShader[ETR_TEXTURE_BLEND] = createTRTextureBlend(this); - - BurningShader[ETR_TRANSPARENT_REFLECTION_2_LAYER] = createTriangleRendererTexture_transparent_reflection_2_layer(this); - //BurningShader[ETR_REFERENCE] = createTriangleRendererReference ( this ); - - BurningShader[ETR_COLOR] = create_burning_shader_color(this); - - // add the same renderer for all solid types - CSoftware2MaterialRenderer_SOLID* smr = new CSoftware2MaterialRenderer_SOLID(this); - CSoftware2MaterialRenderer_TRANSPARENT_ADD_COLOR* tmr = new CSoftware2MaterialRenderer_TRANSPARENT_ADD_COLOR(this); - //CSoftware2MaterialRenderer_UNSUPPORTED * umr = new CSoftware2MaterialRenderer_UNSUPPORTED ( this ); - - //!TODO: addMaterialRenderer depends on pushing order.... - addMaterialRenderer(smr); // EMT_SOLID - addMaterialRenderer(smr); // EMT_SOLID_2_LAYER, - addMaterialRenderer(smr); // EMT_LIGHTMAP, - addMaterialRenderer(tmr); // EMT_LIGHTMAP_ADD, - addMaterialRenderer(smr); // EMT_LIGHTMAP_M2, - addMaterialRenderer(smr); // EMT_LIGHTMAP_M4, - addMaterialRenderer(smr); // EMT_LIGHTMAP_LIGHTING, - addMaterialRenderer(smr); // EMT_LIGHTMAP_LIGHTING_M2, - addMaterialRenderer(smr); // EMT_LIGHTMAP_LIGHTING_M4, - addMaterialRenderer(smr); // EMT_DETAIL_MAP, - addMaterialRenderer(smr); // EMT_SPHERE_MAP, - addMaterialRenderer(smr); // EMT_REFLECTION_2_LAYER, - addMaterialRenderer(tmr); // EMT_TRANSPARENT_ADD_COLOR, - addMaterialRenderer(tmr); // EMT_TRANSPARENT_ALPHA_CHANNEL, - addMaterialRenderer(tmr); // EMT_TRANSPARENT_ALPHA_CHANNEL_REF, - addMaterialRenderer(tmr); // EMT_TRANSPARENT_VERTEX_ALPHA, - addMaterialRenderer(tmr); // EMT_TRANSPARENT_REFLECTION_2_LAYER, - addMaterialRenderer(smr); // EMT_NORMAL_MAP_SOLID, - addMaterialRenderer(tmr); // EMT_NORMAL_MAP_TRANSPARENT_ADD_COLOR, - addMaterialRenderer(tmr); // EMT_NORMAL_MAP_TRANSPARENT_VERTEX_ALPHA, - addMaterialRenderer(smr); // EMT_PARALLAX_MAP_SOLID, - addMaterialRenderer(tmr); // EMT_PARALLAX_MAP_TRANSPARENT_ADD_COLOR, - addMaterialRenderer(tmr); // EMT_PARALLAX_MAP_TRANSPARENT_VERTEX_ALPHA, - addMaterialRenderer(tmr); // EMT_ONETEXTURE_BLEND - - smr->drop(); - tmr->drop(); - //umr->drop (); - - // select render target - setRenderTargetImage2(BackBuffer,0, 0); - - //reset Lightspace - EyeSpace.reset(); - EyeSpace.resetFog(); - - // select the right renderer - setMaterial(Material.org); -} - - -//! destructor -CBurningVideoDriver::~CBurningVideoDriver() -{ - // delete Backbuffer - if (BackBuffer) - { - BackBuffer->drop(); - BackBuffer = 0; - } - - // delete triangle renderers - for (s32 i = 0; i < ETR2_COUNT; ++i) - { - if (BurningShader[i]) - { - BurningShader[i]->drop(); - BurningShader[i] = 0; - } - } - - // delete Additional buffer - if (StencilBuffer) - { - StencilBuffer->drop(); - StencilBuffer = 0; - } - - if (DepthBuffer) - { - DepthBuffer->drop(); - DepthBuffer = 0; - } - - if (RenderTargetTexture) - { - RenderTargetTexture->drop(); - RenderTargetTexture = 0; - } - - if (RenderTargetSurface) - { - RenderTargetSurface->drop(); - RenderTargetSurface = 0; - } - - fpu_exception(0); - -} - - - -//! queries the features of the driver, returns true if feature is available -bool CBurningVideoDriver::queryFeature(E_VIDEO_DRIVER_FEATURE feature) const -{ - int on = 0; - switch (feature) - { -#ifdef SOFTWARE_DRIVER_2_BILINEAR - case EVDF_BILINEAR_FILTER: - on = 1; - break; -#endif -#if SOFTWARE_DRIVER_2_MIPMAPPING_MAX > 1 - case EVDF_MIP_MAP: - on = 1; - break; -#endif - case EVDF_STENCIL_BUFFER: - on = StencilBuffer != 0; - break; - - case EVDF_RENDER_TO_TARGET: - case EVDF_MULTITEXTURE: - case EVDF_HARDWARE_TL: - case EVDF_TEXTURE_NSQUARE: - case EVDF_TEXTURE_MATRIX: - on = 1; - break; - - case EVDF_DEPTH_CLAMP: // shadow - on = 1; - break; - - case EVDF_ARB_FRAGMENT_PROGRAM_1: - case EVDF_ARB_VERTEX_PROGRAM_1: - on = 1; - break; -#if defined(PATCH_SUPERTUX_8_0_1_with_1_9_0) - case EVDF_TEXTURE_NPOT: - case EVDF_ARB_GLSL: - on = 1; - break; -#else - case EVDF_TEXTURE_NPOT: // for 2D - on = 0; - break; -#endif - -#if defined(SOFTWARE_DRIVER_2_2D_AS_3D) -#if defined(IRRLICHT_FREE_CANVAS) - case EVDF_VIEWPORT_SCALE_GUI: - on = 1; - break; -#endif -#endif - default: - on = 0; - break; - } - - return on && FeatureEnabled[feature]; -} - - -//matrix multiplication -void CBurningVideoDriver::transform_calc(E_TRANSFORMATION_STATE_BURNING_VIDEO state) -{ - size_t* flag = TransformationFlag[TransformationStack]; - if (flag[state] & ETF_VALID) return; - - //check - size_t ok = 0; - switch (state) - { - case ETS_PROJ_MODEL_VIEW: - if (0 == (flag[ETS_VIEW_PROJECTION] & ETF_VALID)) transform_calc(ETS_VIEW_PROJECTION); - ok = flag[ETS_WORLD] & flag[ETS_VIEW] & flag[ETS_PROJECTION] & flag[ETS_VIEW_PROJECTION] & ETF_VALID; - break; - case ETS_VIEW_PROJECTION: - ok = flag[ETS_VIEW] & flag[ETS_PROJECTION] & ETF_VALID; - break; - case ETS_MODEL_VIEW: - ok = flag[ETS_WORLD] & flag[ETS_VIEW] & ETF_VALID; - break; - case ETS_NORMAL: - ok = flag[ETS_MODEL_VIEW] & ETF_VALID; - break; - default: - break; - } - - if (!ok) - { - char buf[256]; - sprintf(buf, "transform_calc not valid for %d\n", state); - os::Printer::log(buf, ELL_WARNING); - } - - core::matrix4* matrix = Transformation[TransformationStack]; - - switch (state) - { - case ETS_PROJ_MODEL_VIEW: - if (flag[ETS_WORLD] & ETF_IDENTITY) - { - matrix[state] = matrix[ETS_VIEW_PROJECTION]; - } - else - { - matrix[state].setbyproduct_nocheck(matrix[ETS_VIEW_PROJECTION], matrix[ETS_WORLD]); - } - break; - - case ETS_VIEW_PROJECTION: - matrix[state].setbyproduct_nocheck(matrix[ETS_PROJECTION], matrix[ETS_VIEW]); - break; - case ETS_MODEL_VIEW: - if (flag[ETS_WORLD] & ETF_IDENTITY) - { - matrix[state] = matrix[ETS_VIEW]; - } - else - { - matrix[state].setbyproduct_nocheck(matrix[ETS_VIEW], matrix[ETS_WORLD]); - } - break; - case ETS_NORMAL: - mat44_transposed_inverse(matrix[state], matrix[ETS_MODEL_VIEW]); - break; - - default: - break; - } - flag[state] |= ETF_VALID; -} - - -//! sets transformation -void CBurningVideoDriver::setTransform(E_TRANSFORMATION_STATE state, const core::matrix4& mat) -{ - size_t* flag = TransformationFlag[TransformationStack]; - core::matrix4* matrix = Transformation[TransformationStack]; - -#if 0 - int changed = 1; - if (flag[state] & ETF_VALID) - { - changed = memcmp(mat.pointer(), matrix[state].pointer(), sizeof(mat)); - } - if (changed) -#endif - { - matrix[state] = mat; - flag[state] |= ETF_VALID; - } - - //maybe identity (mostly for texturematrix to avoid costly multiplication) -#if defined ( USE_MATRIX_TEST ) - burning_setbit(TransformationFlag[state], mat.getDefinitelyIdentityMatrix(), ETF_IDENTITY); -#else - burning_setbit(flag[state], - !memcmp(mat.pointer(), core::IdentityMatrix.pointer(), sizeof(mat)), ETF_IDENTITY - ); -#endif - -#if 0 - if (changed) -#endif - switch (state) - { - case ETS_PROJECTION: - flag[ETS_PROJ_MODEL_VIEW] &= ~ETF_VALID; - flag[ETS_VIEW_PROJECTION] &= ~ETF_VALID; - break; - case ETS_VIEW: - flag[ETS_PROJ_MODEL_VIEW] &= ~ETF_VALID; - flag[ETS_VIEW_PROJECTION] &= ~ETF_VALID; - flag[ETS_MODEL_VIEW] &= ~ETF_VALID; - flag[ETS_NORMAL] &= ~ETF_VALID; - break; - case ETS_WORLD: - flag[ETS_PROJ_MODEL_VIEW] &= ~ETF_VALID; - flag[ETS_MODEL_VIEW] &= ~ETF_VALID; - flag[ETS_NORMAL] &= ~ETF_VALID; - break; - case ETS_TEXTURE_0: - case ETS_TEXTURE_1: - case ETS_TEXTURE_2: - case ETS_TEXTURE_3: -#if _IRR_MATERIAL_MAX_TEXTURES_>4 - case ETS_TEXTURE_4: -#endif -#if _IRR_MATERIAL_MAX_TEXTURES_>5 - case ETS_TEXTURE_5: -#endif -#if _IRR_MATERIAL_MAX_TEXTURES_>6 - case ETS_TEXTURE_6: -#endif -#if _IRR_MATERIAL_MAX_TEXTURES_>7 - case ETS_TEXTURE_7: -#endif - if (0 == (flag[state] & ETF_IDENTITY)) - { - EyeSpace.TL_Flag |= TL_TEXTURE_TRANSFORM; - } - break; - default: - break; - } - -} - -//! Returns the transformation set by setTransform -const core::matrix4& CBurningVideoDriver::getTransform(E_TRANSFORMATION_STATE state) const -{ - return Transformation[TransformationStack][state]; -} - - -bool CBurningVideoDriver::beginScene(u16 clearFlag, SColor clearColor, f32 clearDepth, u8 clearStencil, const SExposedVideoData& videoData, core::rect<s32>* sourceRect) -{ -#if defined(PATCH_SUPERTUX_8_0_1_with_1_9_0) - CNullDriver::beginScene(clearFlag & ECBF_COLOR, clearFlag & ECBF_DEPTH, clearColor, videoData, sourceRect); -#else - CNullDriver::beginScene(clearFlag, clearColor, clearDepth, clearStencil, videoData, sourceRect); -#endif - - Interlaced.nr = (Interlaced.nr + 1) & interlace_control_mask; - WindowId = videoData.D3D9.HWnd; - SceneSourceRect = sourceRect; - - clearBuffers(clearFlag, clearColor, clearDepth, clearStencil); - - //memset ( TransformationFlag, 0, sizeof ( TransformationFlag ) ); - return true; -} - -bool CBurningVideoDriver::endScene() -{ - CNullDriver::endScene(); - - return Presenter->present(BackBuffer, WindowId, SceneSourceRect); -} - - -//! Create render target. -IRenderTarget* CBurningVideoDriver::addRenderTarget() -{ - CSoftwareRenderTarget2* renderTarget = new CSoftwareRenderTarget2(this); - RenderTargets.push_back(renderTarget); - - return renderTarget; -} - -#if defined(PATCH_SUPERTUX_8_0_1_with_1_9_0) -bool CBurningVideoDriver::setRenderTarget(video::ITexture* texture, bool clearBackBuffer, bool clearZBuffer, SColor color) -{ - CSoftwareRenderTarget2 target(this); - target.RenderTexture = texture; - target.TargetType = ERT_RENDER_TEXTURE; - target.Texture[0] = texture; - - if (texture) - texture->grab(); - - u16 flag = 0; - if (clearBackBuffer) flag |= ECBF_COLOR; - if (clearZBuffer) flag |= ECBF_DEPTH; - - return setRenderTargetEx(texture ? &target : 0, flag, color, 1.f, true); -} -#endif - -bool CBurningVideoDriver::setRenderTargetEx(IRenderTarget* target, u16 clearFlag, SColor clearColor, f32 clearDepth, u8 clearStencil) -{ -#if !defined(PATCH_SUPERTUX_8_0_1_with_1_9_0) - if (target && target->getDriverType() != EDT_BURNINGSVIDEO) - { - os::Printer::log("Fatal Error: Tried to set a render target not owned by this driver.", ELL_ERROR); - return false; - } -#endif - if (RenderTargetTexture) - { - //switching from texture to backbuffer - if (target == 0) - { - RenderTargetTexture->regenerateMipMapLevels(); - } - RenderTargetTexture->drop(); - } - -#if !defined(PATCH_SUPERTUX_8_0_1_with_1_9_0) - RenderTargetTexture = target ? target->getTexture()[0] : 0; -#else - RenderTargetTexture = target ? ((CSoftwareRenderTarget2*)target)->Texture[0] : 0; -#endif - - if (RenderTargetTexture) - { - RenderTargetTexture->grab(); - Interlaced.bypass = 1; - setRenderTargetImage2(((CSoftwareTexture2*)RenderTargetTexture)->getImage()); - } - else - { - Interlaced.bypass = !Interlaced.enable; - setRenderTargetImage2(BackBuffer); - } - - clearBuffers(clearFlag, clearColor, clearDepth, clearStencil); - - return true; -} - -static inline f32 map_value(f32 x, f32 in_min, f32 in_max, f32 out_min, f32 out_max) { - return (x - in_min) * (out_max - out_min) / (f32)(in_max - in_min) + out_min; -} - -//! sets a render target -void CBurningVideoDriver::setRenderTargetImage2(video::IImage* color, video::IImage* depth, video::IImage* stencil) -{ - if (RenderTargetSurface) - RenderTargetSurface->drop(); - - core::dimension2d<u32> current = RenderTargetSize; - RenderTargetSurface = color; - RenderTargetSize.Width = 0; - RenderTargetSize.Height = 0; - - if (RenderTargetSurface) - { - RenderTargetSurface->grab(); - RenderTargetSize = RenderTargetSurface->getDimension(); - } - - RatioRenderTargetScreen.x = ScreenSize.Width ? (f32)RenderTargetSize.Width / ScreenSize.Width : 1.f; - RatioRenderTargetScreen.y = ScreenSize.Height ? (f32)RenderTargetSize.Height / ScreenSize.Height : 1.f; - - int not_changed = current == RenderTargetSize; - burning_setbit(TransformationFlag[0][ETS_PROJECTION], not_changed, ETF_VALID); - burning_setbit(TransformationFlag[1][ETS_PROJECTION], not_changed, ETF_VALID); - - setViewPort(core::recti(RenderTargetSize)); - - if (DepthBuffer) - DepthBuffer->setSize(RenderTargetSize); - - if (StencilBuffer) - StencilBuffer->setSize(RenderTargetSize); -} - - -//--------- Transform from NDC to DC, transform TexCoo ---------------------------------------------- - - -//! Blur 2D Image with PixelOffset. (default 0.375f for OpenGL and Burning) -/** SideEffects: -* if IRRLICHT_2D_TEXEL_OFFSET > 0 is applied to OpenGL/Burning, Pixel-exact Texture Coordinates do not match. -* Currently Version 1.8,1.9 has that in the Irrlicht 2D Examples where you get a Magenta Border on the Sprites -* and in the draw2DImage4cFilter Tests -*/ -#define IRRLICHT_2D_TEXEL_OFFSET 0.f - - -//--------- Transform from NDC to DC ---------------------------------------------- - -// used to scale <-1,-1><1,1> to viewport [center,scale] -// controls subtexel and fill convention. -// Don't tweak SOFTWARE_DRIVER_2_SUBTEXEL (-0.5f in m[1]) anymore to control texture blur effect, it's used for viewport scaling. -// naming is misleading. it will write outside memory location.. - -void buildNDCToDCMatrix(f32* m, const core::rect<s32>& viewport, f32 tx) -{ - m[0] = (viewport.LowerRightCorner.X - viewport.UpperLeftCorner.X + tx) * 0.5f; - m[1] = (viewport.UpperLeftCorner.X + viewport.LowerRightCorner.X-1) * 0.5f; - - m[2] = (viewport.LowerRightCorner.Y - viewport.UpperLeftCorner.Y + tx) * -0.5f; - m[3] = (viewport.UpperLeftCorner.Y + viewport.LowerRightCorner.Y-1) * 0.5f; -} - - - -//! sets a viewport -void CBurningVideoDriver::setViewPort(const core::rect<s32>& area) -{ - ViewPort = area; - - core::rect<s32> rendert(0, 0, RenderTargetSize.Width, RenderTargetSize.Height); - ViewPort.clipAgainst(rendert); - - buildNDCToDCMatrix(Transformation_ETS_CLIPSCALE[0], ViewPort, 1.f/2048.f); //SkyBox,Billboard 90° problem - buildNDCToDCMatrix(Transformation_ETS_CLIPSCALE[1], ViewPort, 0.f); // OverrideMaterial2DEnabled ? -IRRLICHT_2D_TEXEL_OFFSET : 0.f); - - if (CurrentShader) - CurrentShader->setRenderTarget(RenderTargetSurface, ViewPort, Interlaced); -} - -void CBurningVideoDriver::setScissor(int x, int y, int width, int height) -{ - //openGL - //y = rt.Height - y - height; - - //coming from GUI - AbsRectangle v0; - v0.x0 = core::floor32(x * RatioRenderTargetScreen.x); - v0.y0 = core::floor32(y * RatioRenderTargetScreen.y); - v0.x1 = core::floor32((x + width) * RatioRenderTargetScreen.x); - v0.y1 = core::floor32((y + height) * RatioRenderTargetScreen.y); - - AbsRectangle v1; - v1.x0 = 0; - v1.y0 = 0; - v1.x1 = RenderTargetSize.Width; - v1.y1 = RenderTargetSize.Height; - - intersect(Scissor, v0, v1); -} - -/* - generic plane clipping in homogenous coordinates - special case ndc frustum <-w,w>,<-w,w>,<-w,w> - can be rewritten with compares e.q near plane, a.z < -a.w and b.z < -b.w - - cam is (0,0,-1) -*/ - -const sVec4 CBurningVideoDriver::NDCPlane[6 + 2] = -{ - sVec4(0.f, 0.f, -1.f, -1.f), // near - sVec4(0.f, 0.f, 1.f, -1.f), // far - sVec4(1.f, 0.f, 0.f, -1.f), // left - sVec4(-1.f, 0.f, 0.f, -1.f), // right - sVec4(0.f, 1.f, 0.f, -1.f), // bottom - sVec4(0.f, -1.f, 0.f, -1.f) // top -}; - - -/* - test a vertex if it's inside the standard frustum - - this is the generic one.. - - f32 dotPlane; - for ( u32 i = 0; i!= 6; ++i ) - { - dotPlane = v->Pos.dotProduct ( NDCPlane[i] ); - burning_setbit32( flag, dotPlane <= 0.f, 1 << i ); - } - - // this is the base for ndc frustum <-w,w>,<-w,w>,<-w,w> - burning_setbit32( flag, ( v->Pos.z - v->Pos.w ) <= 0.f, 1 ); - burning_setbit32( flag, (-v->Pos.z - v->Pos.w ) <= 0.f, 2 ); - burning_setbit32( flag, ( v->Pos.x - v->Pos.w ) <= 0.f, 4 ); - burning_setbit32( flag, (-v->Pos.x - v->Pos.w ) <= 0.f, 8 ); - burning_setbit32( flag, ( v->Pos.y - v->Pos.w ) <= 0.f, 16 ); - burning_setbit32( flag, (-v->Pos.y - v->Pos.w ) <= 0.f, 32 ); - -*/ -#ifdef IRRLICHT_FAST_MATH - -REALINLINE size_t CBurningVideoDriver::clipToFrustumTest(const s4DVertex* v) const -{ - size_t flag; - f32 test[8]; - const f32 w = -v->Pos.w; - - // a conditional move is needed....FCOMI ( but we don't have it ) - // so let the fpu calculate and write it back. - // cpu makes the compare, interleaving - - test[0] = v->Pos.z + w; - test[1] = -v->Pos.z + w; - test[2] = v->Pos.x + w; - test[3] = -v->Pos.x + w; - test[4] = v->Pos.y + w; - test[5] = -v->Pos.y + w; - - const u32* a = F32_AS_U32_POINTER(test); - flag = (a[0]) >> 31; - flag |= (a[1] & 0x80000000) >> 30; - flag |= (a[2] & 0x80000000) >> 29; - flag |= (a[3] & 0x80000000) >> 28; - flag |= (a[4] & 0x80000000) >> 27; - flag |= (a[5] & 0x80000000) >> 26; - - /* - flag = (IR ( test[0] ) ) >> 31; - flag |= (IR ( test[1] ) & 0x80000000 ) >> 30; - flag |= (IR ( test[2] ) & 0x80000000 ) >> 29; - flag |= (IR ( test[3] ) & 0x80000000 ) >> 28; - flag |= (IR ( test[4] ) & 0x80000000 ) >> 27; - flag |= (IR ( test[5] ) & 0x80000000 ) >> 26; - */ - /* - flag = F32_LOWER_EQUAL_0 ( test[0] ); - flag |= F32_LOWER_EQUAL_0 ( test[1] ) << 1; - flag |= F32_LOWER_EQUAL_0 ( test[2] ) << 2; - flag |= F32_LOWER_EQUAL_0 ( test[3] ) << 3; - flag |= F32_LOWER_EQUAL_0 ( test[4] ) << 4; - flag |= F32_LOWER_EQUAL_0 ( test[5] ) << 5; - */ - return flag; -} - -#else - - -REALINLINE size_t clipToFrustumTest(const s4DVertex* v) -{ - size_t flag = 0; - - flag |= v->Pos.z <= v->Pos.w ? VERTEX4D_CLIP_NEAR : 0; - flag |= -v->Pos.z <= v->Pos.w ? VERTEX4D_CLIP_FAR : 0; - - flag |= v->Pos.x <= v->Pos.w ? VERTEX4D_CLIP_LEFT : 0; - flag |= -v->Pos.x <= v->Pos.w ? VERTEX4D_CLIP_RIGHT : 0; - - flag |= v->Pos.y <= v->Pos.w ? VERTEX4D_CLIP_BOTTOM : 0; - flag |= -v->Pos.y <= v->Pos.w ? VERTEX4D_CLIP_TOP : 0; - - - /* - for ( u32 i = 0; i <= 6; ++i ) - { - if (v->Pos.dot_xyzw(NDCPlane[i]) <= 0.f) flag |= ((size_t)1) << i; - } - */ - return flag; -} - -#endif // _MSC_VER - - -size_t clipToHyperPlane( - s4DVertexPair* burning_restrict dest, - const s4DVertexPair* burning_restrict source, - const size_t inCount, - const sVec4& plane -) -{ - size_t outCount = 0; - s4DVertexPair* out = dest; - - const s4DVertex* a; - const s4DVertex* b = source; - - ipoltype bDotPlane; - bDotPlane = b->Pos.dot_xyzw(plane); - - /* - for( u32 i = 1; i < inCount + 1; ++i) - { - #if 0 - a = source + (i%inCount)*2; - #else - const s32 condition = i - inCount; - const s32 index = (( ( condition >> 31 ) & ( i ^ condition ) ) ^ condition ) << 1; - a = source + index; - #endif - */ - //Sutherland–Hodgman - for (size_t i = 0; i < inCount; ++i) - { - a = source + (i == inCount - 1 ? 0 : s4DVertex_ofs(i + 1)); - - // current point inside - if (ipol_lower_equal_0(a->Pos.dot_xyzw(plane))) - { - // last point outside - if (ipol_greater_0(bDotPlane)) - { - // intersect line segment with plane - out->interpolate(*b, *a, bDotPlane / (b->Pos - a->Pos).dot_xyzw(plane)); - out += sizeof_s4DVertexPairRel; - outCount += 1; - } - - // copy current to out - //*out = *a; - memcpy_s4DVertexPair(out, a); - b = out; - - out += sizeof_s4DVertexPairRel; - outCount += 1; - } - else - { - // current point outside - if (ipol_lower_equal_0(bDotPlane)) - { - // previous was inside - // intersect line segment with plane - out->interpolate(*b, *a, bDotPlane / (b->Pos - a->Pos).dot_xyzw(plane)); - out += sizeof_s4DVertexPairRel; - outCount += 1; - } - // pointer - b = a; - } - - bDotPlane = b->Pos.dot_xyzw(plane); - } - - return outCount; -} - - -/* - Clip on all planes. Clipper.data - clipmask per face -*/ -size_t CBurningVideoDriver::clipToFrustum(const size_t vIn /*, const size_t clipmask_for_face*/) -{ - s4DVertexPair* v0 = Clipper.data; - s4DVertexPair* v1 = Clipper_temp.data; - size_t vOut = vIn; - - //clear all clipping & projected flags - const u32 flag = v0[0].flag & VERTEX4D_FORMAT_MASK; - for (size_t g = 0; g != Clipper.ElementSize; ++g) - { - v0[g].flag = flag; - v1[g].flag = flag; - } - -#if 0 - for (size_t i = 0; i < 6; ++i) - { - v0 = i & 1 ? Clipper_temp.data : Clipper.data; - v1 = i & 1 ? Clipper.data : Clipper_temp.data; - - //clipMask checked outside - always clip all planes -#if 0 - if (0 == (clipMask & ((size_t)1 << i))) - { - vOut = vIn; - memcpy_s4DVertexPair(v1, v0); - } - else -#endif - { - vOut = clipToHyperPlane(v1, v0, vOut, NDCPlane[i]); - if (vOut < vIn) return vOut; - } - } -#endif - - - vOut = clipToHyperPlane(v1, v0, vOut, NDCPlane[0]); if (vOut < vIn) return vOut; - vOut = clipToHyperPlane(v0, v1, vOut, NDCPlane[1]); if (vOut < vIn) return vOut; - vOut = clipToHyperPlane(v1, v0, vOut, NDCPlane[2]); if (vOut < vIn) return vOut; - vOut = clipToHyperPlane(v0, v1, vOut, NDCPlane[3]); if (vOut < vIn) return vOut; - vOut = clipToHyperPlane(v1, v0, vOut, NDCPlane[4]); if (vOut < vIn) return vOut; - vOut = clipToHyperPlane(v0, v1, vOut, NDCPlane[5]); - - return vOut; -} - -/*! - Part I: - apply Clip Scale matrix - From Normalized Device Coordiante ( NDC ) Space to Device Coordinate ( DC ) Space - - Part II: - Project homogeneous vector - homogeneous to non-homogenous coordinates ( dividebyW ) - - Incoming: ( xw, yw, zw, w, u, v, 1, R, G, B, A ) - Outgoing: ( xw/w, yw/w, zw/w, w/w, u/w, v/w, 1/w, R/w, G/w, B/w, A/w ) - - replace w/w by 1/w -*/ -//aliasing problems! [dest = source + 1] -inline void CBurningVideoDriver::ndc_2_dc_and_project(s4DVertexPair* dest, const s4DVertexPair* source, const size_t vIn) const -{ - const f32* dc = Transformation_ETS_CLIPSCALE[TransformationStack]; - - for (size_t g = 0; g != vIn; g += sizeof_s4DVertexPairRel) - { - //cache doesn't work anymore? - //if ( dest[g].flag & VERTEX4D_PROJECTED ) - // continue; - //dest[g].flag = source[g].flag | VERTEX4D_PROJECTED; - - const f32 iw = reciprocal_zero(source[g].Pos.w); - - // to device coordinates - dest[g].Pos.x = iw * source[g].Pos.x * dc[0] + dc[1]; - dest[g].Pos.y = iw * source[g].Pos.y * dc[2] + dc[3]; - - //burning uses direct Z. for OpenGL it should be -Z,[-1;1] and texture flip -#if !defined(SOFTWARE_DRIVER_2_USE_WBUFFER) || 1 - dest[g].Pos.z = -iw * source[g].Pos.z * 0.5f + 0.5f; -#endif - dest[g].Pos.w = iw; - - // Texture Coordinates will be projected after mipmap selection - // satisfy write-combiner -#if 1 -#if BURNING_MATERIAL_MAX_TEXTURES > 0 - dest[g].Tex[0] = source[g].Tex[0]; -#endif -#if BURNING_MATERIAL_MAX_TEXTURES > 1 - dest[g].Tex[1] = source[g].Tex[1]; -#endif -#if BURNING_MATERIAL_MAX_TEXTURES > 2 - dest[g].Tex[2] = source[g].Tex[2]; -#endif -#if BURNING_MATERIAL_MAX_TEXTURES > 3 - dest[g].Tex[3] = source[g].Tex[3]; -#endif - -#endif - -#if BURNING_MATERIAL_MAX_COLORS > 0 -#ifdef SOFTWARE_DRIVER_2_PERSPECTIVE_CORRECT - dest[g].Color[0] = source[g].Color[0] * iw; // alpha? -#else - dest[g].Color[0] = source[g].Color[0]; -#endif -#endif - -#if BURNING_MATERIAL_MAX_COLORS > 1 -#ifdef SOFTWARE_DRIVER_2_PERSPECTIVE_CORRECT - dest[g].Color[1] = source[g].Color[1] * iw; // alpha? -#else - dest[g].Color[1] = source[g].Color[1]; -#endif -#endif - -#if BURNING_MATERIAL_MAX_COLORS > 2 -#ifdef SOFTWARE_DRIVER_2_PERSPECTIVE_CORRECT - dest[g].Color[2] = source[g].Color[2] * iw; // alpha? -#else - dest[g].Color[2] = source[g].Color[2]; -#endif -#endif - -#if BURNING_MATERIAL_MAX_COLORS > 3 -#ifdef SOFTWARE_DRIVER_2_PERSPECTIVE_CORRECT - dest[g].Color[3] = source[g].Color[3] * iw; // alpha? -#else - dest[g].Color[3] = source[g].Color[3]; -#endif -#endif - -#if BURNING_MATERIAL_MAX_LIGHT_TANGENT > 0 - dest[g].LightTangent[0] = source[g].LightTangent[0] * iw; -#endif - - } -} - - - -#if 0 -/*! - crossproduct in projected 2D, face -*/ -REALINLINE f32 CBurningVideoDriver::screenarea_inside(const s4DVertexPair* burning_restrict const face[]) const -{ - return (((face[1] + 1)->Pos.x - (face[0] + 1)->Pos.x) * ((face[2] + 1)->Pos.y - (face[0] + 1)->Pos.y)) - - (((face[2] + 1)->Pos.x - (face[0] + 1)->Pos.x) * ((face[1] + 1)->Pos.y - (face[0] + 1)->Pos.y)); - /* - float signedArea = 0; - for (int k = 1; k < output->count; k++) { - signedArea += (output->vertices[k - 1].values[0] * output->vertices[k - 0].values[1]); - signedArea -= (output->vertices[k - 0].values[0] * output->vertices[k - 1].values[1]); - } - */ -} - - -static inline f32 dot(const sVec2& a, const sVec2& b) { return a.x * b.x + a.y * b.y; } -sVec2 dFdx(const sVec2& v) { return v; } -sVec2 dFdy(const sVec2& v) { return v; } - -f32 MipmapLevel(const sVec2& uv, const sVec2& textureSize) -{ - sVec2 dx = dFdx(uv * textureSize.x); - sVec2 dy = dFdy(uv * textureSize.y); - f32 d = core::max_(dot(dx, dx), dot(dy, dy)); - return log2f(sqrtf(d)); -} -#endif - -//#define MAT_TEXTURE(tex) ( (video::CSoftwareTexture2*) Material.org.getTexture ( (u32)tex ) ) -#define MAT_TEXTURE(tex) ( (video::CSoftwareTexture2*) Material.org.TextureLayer[tex].Texture ) - -/*! - calculate from unprojected. - attribute need not to follow winding rule from position. - Edge-walking problem - Texture Wrapping problem - Atlas problem -*/ -REALINLINE s32 CBurningVideoDriver::lodFactor_inside(const s4DVertexPair* burning_restrict const face[], - const size_t m, const f32 dc_area, const f32 lod_bias) const -{ - /* - sVec2 a(v[1]->Tex[tex].x - v[0]->Tex[tex].x,v[1]->Tex[tex].y - v[0]->Tex[tex].y); - sVec2 b(v[2]->Tex[tex].x - v[0]->Tex[tex].x,v[2]->Tex[tex].y - v[0]->Tex[tex].y); - f32 area = a.x * b.y - b.x * a.y; - */ - - - /* - degenerate(A, B, C, minarea) = ((B - A).cross(C - A)).lengthSquared() < (4.0f * minarea * minarea); - check for collapsed or "long thin triangles" - */ - ieee754 signedArea; - - ieee754 t[4]; - t[0].f = face[1]->Tex[m].x - face[0]->Tex[m].x; - t[1].f = face[1]->Tex[m].y - face[0]->Tex[m].y; - - t[2].f = face[2]->Tex[m].x - face[0]->Tex[m].x; - t[3].f = face[2]->Tex[m].y - face[0]->Tex[m].y; - - //crossproduct in projected 2D -> screen area triangle - signedArea.f = t[0].f * t[3].f - t[2].f * t[1].f; - - //signedArea = - // ((face[1]->Tex[m].x - face[0]->Tex[m].x) * (face[2]->Tex[m].y - face[0]->Tex[m].y)) - // - ((face[2]->Tex[m].x - face[0]->Tex[m].x) * (face[1]->Tex[m].y - face[0]->Tex[m].y)); - - //if (signedArea*signedArea <= 0.00000000001f) - if (signedArea.fields.exp == 0) - { - ieee754 _max; - _max.u = t[0].abs.frac_exp; - if (t[1].abs.frac_exp > _max.u) _max.u = t[1].abs.frac_exp; - if (t[2].abs.frac_exp > _max.u) _max.u = t[2].abs.frac_exp; - if (t[3].abs.frac_exp > _max.u) _max.u = t[3].abs.frac_exp; - - signedArea.u = _max.fields.exp ? _max.u : ieee754_one; - - /* - //dot,length - ieee754 v[2]; - v[0].f = t[0] * t[2]; - v[1].f = t[1] * t[3]; - - //signedArea.f = t[4] > t[5] ? t[4] : t[5]; - signedArea.u = v[0].fields.frac > v[1].fields.frac ? v[0].u : v[1].u; - if (signedArea.fields.exp == 0) - { - return -1; - } - */ - } - - //only guessing: take more detail (lower mipmap) in light+bump textures - //assume transparent add is ~50% transparent -> more detail - - // 2.f from dc_area, 2.f from tex triangle ( parallelogram area) - const u32* d = MAT_TEXTURE(m)->getMipMap0_Area(); - f32 texelspace = d[0] * d[1] * lod_bias; //(m ? 0.5f : 0.5f); - - ieee754 ratio; - ratio.f = (signedArea.f * texelspace) * dc_area; - ratio.fields.sign = 0; - - //log2(0)==denormal [ use high lod] [ only if dc_area == 0 checked outside ] - return (ratio.fields.exp & 0x80) ? ratio.fields.exp - 127 : 0; /*denormal very high lod*/ - -} - - -/*! - texcoo in current mipmap dimension (face, already clipped) - -> want to help fixpoint -*/ -inline void CBurningVideoDriver::select_polygon_mipmap_inside(s4DVertex* burning_restrict face[], const size_t tex, const CSoftwareTexture2_Bound& b) const -{ -#ifdef SOFTWARE_DRIVER_2_PERSPECTIVE_CORRECT - (face[0] + 1)->Tex[tex].x = face[0]->Tex[tex].x * (face[0] + 1)->Pos.w * b.w + b.cx; - (face[0] + 1)->Tex[tex].y = face[0]->Tex[tex].y * (face[0] + 1)->Pos.w * b.h + b.cy; - - (face[1] + 1)->Tex[tex].x = face[1]->Tex[tex].x * (face[1] + 1)->Pos.w * b.w + b.cx; - (face[1] + 1)->Tex[tex].y = face[1]->Tex[tex].y * (face[1] + 1)->Pos.w * b.h + b.cy; - - (face[2] + 1)->Tex[tex].x = face[2]->Tex[tex].x * (face[2] + 1)->Pos.w * b.w + b.cx; - (face[2] + 1)->Tex[tex].y = face[2]->Tex[tex].y * (face[2] + 1)->Pos.w * b.h + b.cy; -#else - (face[0] + 1)->Tex[tex].x = face[0]->Tex[tex].x * b.w; - (face[0] + 1)->Tex[tex].y = face[0]->Tex[tex].y * b.h; - - (face[1] + 1)->Tex[tex].x = face[1]->Tex[tex].x * b.w; - (face[1] + 1)->Tex[tex].y = face[1]->Tex[tex].y * b.h; - - (face[2] + 1)->Tex[tex].x = face[2]->Tex[tex].x * b.w; - (face[2] + 1)->Tex[tex].y = face[2]->Tex[tex].y * b.h; -#endif - -} - - -// Vertex Cache - -//! setup Vertex Format -void CBurningVideoDriver::VertexCache_map_source_format() -{ - u32 s0 = sizeof(s4DVertex); - u32 s1 = sizeof(s4DVertex_proxy); - - if (s1 <= sizeof_s4DVertex / 2) - { - os::Printer::log("BurningVideo vertex format unnecessary to large", ELL_WARNING); - } - - //memcpy_vertex - if (s0 != sizeof_s4DVertex || ((sizeof_s4DVertex * sizeof_s4DVertexPairRel) & 31)) - { - os::Printer::log("BurningVideo vertex format compile problem", ELL_ERROR); - _IRR_DEBUG_BREAK_IF(1); - } - -#if defined(ENV64BIT) - if (sizeof(void*) != 8) - { - os::Printer::log("BurningVideo pointer should be 8 bytes", ELL_ERROR); - _IRR_DEBUG_BREAK_IF(1); - } - - if (((unsigned long long)Transformation&15) || ((unsigned long long)TransformationFlag & 15)) - { - os::Printer::log("BurningVideo Matrix Stack not 16 byte aligned", ELL_ERROR); - _IRR_DEBUG_BREAK_IF(1); - } -#endif - - - SVSize* vSize = VertexCache.vSize; - //vSize[E4VT_STANDARD].Format = VERTEX4D_FORMAT_TEXTURE_1 | VERTEX4D_FORMAT_COLOR_1 | VERTEX4D_FORMAT_LIGHT_1 | VERTEX4D_FORMAT_SPECULAR; - vSize[E4VT_STANDARD].Format = VERTEX4D_FORMAT_TEXTURE_1 | VERTEX4D_FORMAT_COLOR_2_FOG; - vSize[E4VT_STANDARD].Pitch = sizeof(S3DVertex); - vSize[E4VT_STANDARD].TexSize = 1; - vSize[E4VT_STANDARD].TexCooSize = 1; - - vSize[E4VT_2TCOORDS].Format = VERTEX4D_FORMAT_TEXTURE_2 | VERTEX4D_FORMAT_COLOR_1; - vSize[E4VT_2TCOORDS].Pitch = sizeof(S3DVertex2TCoords); - vSize[E4VT_2TCOORDS].TexSize = 2; - vSize[E4VT_2TCOORDS].TexCooSize = 2; - - //vSize[E4VT_TANGENTS].Format = VERTEX4D_FORMAT_TEXTURE_2 | VERTEX4D_FORMAT_COLOR_1 | VERTEX4D_FORMAT_LIGHT_1 | VERTEX4D_FORMAT_BUMP_DOT3; - vSize[E4VT_TANGENTS].Format = VERTEX4D_FORMAT_TEXTURE_2 | VERTEX4D_FORMAT_COLOR_2_FOG | VERTEX4D_FORMAT_LIGHT_1 | VERTEX4D_FORMAT_BUMP_DOT3; - vSize[E4VT_TANGENTS].Pitch = sizeof(S3DVertexTangents); - vSize[E4VT_TANGENTS].TexSize = 2; - vSize[E4VT_TANGENTS].TexCooSize = 2; - - // reflection map - vSize[E4VT_REFLECTION_MAP].Format = VERTEX4D_FORMAT_TEXTURE_2 | VERTEX4D_FORMAT_COLOR_1; - vSize[E4VT_REFLECTION_MAP].Pitch = sizeof(S3DVertex); - vSize[E4VT_REFLECTION_MAP].TexSize = 2; - vSize[E4VT_REFLECTION_MAP].TexCooSize = 1; //TexCoo2 generated - - // shadow - vSize[E4VT_SHADOW].Format = 0; - vSize[E4VT_SHADOW].Pitch = sizeof(f32) * 3; // core::vector3df* - vSize[E4VT_SHADOW].TexSize = 0; - vSize[E4VT_SHADOW].TexCooSize = 0; - - // color shading only (no texture) - vSize[E4VT_NO_TEXTURE].Format = VERTEX4D_FORMAT_COLOR_1 | VERTEX4D_FORMAT_LIGHT_1 | VERTEX4D_FORMAT_SPECULAR; - vSize[E4VT_NO_TEXTURE].Pitch = sizeof(S3DVertex); - vSize[E4VT_NO_TEXTURE].TexSize = 0; - vSize[E4VT_NO_TEXTURE].TexCooSize = 0; - - //Line - vSize[E4VT_LINE].Format = VERTEX4D_FORMAT_COLOR_1; - vSize[E4VT_LINE].Pitch = sizeof(S3DVertex); - vSize[E4VT_LINE].TexSize = 0; - vSize[E4VT_LINE].TexCooSize = 0; - - size_t size; - for (size_t i = 0; i < E4VT_COUNT; ++i) - { - size_t& flag = vSize[i].Format; - -#if !defined(SOFTWARE_DRIVER_2_USE_SEPARATE_SPECULAR_COLOR) - flag &= ~VERTEX4D_FORMAT_SPECULAR; -#endif - if (vSize[i].TexSize > BURNING_MATERIAL_MAX_TEXTURES) - vSize[i].TexSize = BURNING_MATERIAL_MAX_TEXTURES; - - size = (flag & VERTEX4D_FORMAT_MASK_TEXTURE) >> 16; - if (size > BURNING_MATERIAL_MAX_TEXTURES) - { - flag = (flag & ~VERTEX4D_FORMAT_MASK_TEXTURE) | (BURNING_MATERIAL_MAX_TEXTURES << 16); - } - - size = (flag & VERTEX4D_FORMAT_MASK_COLOR) >> 20; - if (size > BURNING_MATERIAL_MAX_COLORS) - { - flag = (flag & ~VERTEX4D_FORMAT_MASK_COLOR) | (BURNING_MATERIAL_MAX_COLORS << 20); - } - - size = (flag & VERTEX4D_FORMAT_MASK_LIGHT) >> 24; - if (size > BURNING_MATERIAL_MAX_LIGHT_TANGENT) - { - flag = (flag & ~VERTEX4D_FORMAT_MASK_LIGHT) | (BURNING_MATERIAL_MAX_LIGHT_TANGENT << 24); - } - } - - VertexCache.mem.resize(VERTEXCACHE_ELEMENT * 2); - VertexCache.vType = E4VT_STANDARD; - - Clipper.resize(VERTEXCACHE_ELEMENT * 2); - Clipper_temp.resize(VERTEXCACHE_ELEMENT * 2); - - TransformationStack = 0; - memset(TransformationFlag, 0, sizeof(TransformationFlag)); - memset(Transformation_ETS_CLIPSCALE, 0, sizeof(Transformation_ETS_CLIPSCALE)); - - Material.resetRenderStates = true; - Material.Fallback_MaterialType = EMT_SOLID; -} - - - -/*! - fill a cache line with transformed, light and clip test triangles - overhead - if primitive is outside or culled, vertexLighting and TextureTransform is still done -*/ -void CBurningVideoDriver::VertexCache_fill(const u32 sourceIndex, const u32 destIndex) -{ - u8* burning_restrict source; - s4DVertex* burning_restrict dest; - - source = (u8*)VertexCache.vertices + (sourceIndex * VertexCache.vSize[VertexCache.vType].Pitch); - - // it's a look ahead so we never hit it.. - // but give priority... - //VertexCache.info[ destIndex ].hit = hitCount; - - // store info - VertexCache.info[destIndex].index = sourceIndex; - VertexCache.info[destIndex].hit = 0; - - // destination Vertex - dest = VertexCache.mem.data + s4DVertex_ofs(destIndex); - - //Irrlicht S3DVertex,S3DVertex2TCoords,S3DVertexTangents - const S3DVertex* base = ((S3DVertex*)source); - - // transform Model * World * Camera * Projection * NDCSpace matrix - const core::matrix4* matrix = Transformation[TransformationStack]; - matrix[ETS_PROJ_MODEL_VIEW].transformVect(&dest->Pos.x, base->Pos); - - //mhm ... maybe no goto - if (VertexCache.vType == E4VT_SHADOW) - { - //core::vector3df i = base->Pos; - //i.Z -= 0.5f; - //matrix[ETS_PROJ_MODEL_VIEW].transformVect(&dest->Pos.x, i); - - //GL_DEPTH_CLAMP,EVDF_DEPTH_CLAMP - //if ( dest->Pos.z < dest->Pos.w) - // dest->Pos.z = dest->Pos.w*0.99f; - - //glPolygonOffset // self shadow wanted or not? - dest->Pos.w *= 1.005f; - - //flag |= v->Pos.z <= v->Pos.w ? VERTEX4D_CLIP_NEAR : 0; - //flag |= -v->Pos.z <= v->Pos.w ? VERTEX4D_CLIP_FAR : 0; - - goto clipandproject; - } - - -#if defined (SOFTWARE_DRIVER_2_LIGHTING) || defined ( SOFTWARE_DRIVER_2_TEXTURE_TRANSFORM ) - - // vertex, normal in light(eye) space - if (Material.org.Lighting || (EyeSpace.TL_Flag & (TL_TEXTURE_TRANSFORM | TL_FOG))) - { - sVec4 vertex4; //eye coordinate position of vertex - matrix[ETS_MODEL_VIEW].transformVect(&vertex4.x, base->Pos); - - const f32 iw = reciprocal_zero(vertex4.w); - EyeSpace.vertex.x = vertex4.x * iw; - EyeSpace.vertex.y = vertex4.y * iw; - EyeSpace.vertex.z = vertex4.z * iw; - EyeSpace.vertex.w = iw; - - //EyeSpace.cam_distance = EyeSpace.vertex.length_xyz(); - EyeSpace.cam_dir = EyeSpace.vertex; - EyeSpace.cam_dir.normalize_dir_xyz(); - - matrix[ETS_NORMAL].rotateVect(&EyeSpace.normal.x, base->Normal); - if (EyeSpace.TL_Flag & TL_NORMALIZE_NORMALS) - EyeSpace.normal.normalize_dir_xyz(); - - } - -#endif - -#if BURNING_MATERIAL_MAX_COLORS > 1 - dest->Color[1].a = 1.f; - dest->Color[1].r = 0.f; - dest->Color[1].g = 0.f; - dest->Color[1].b = 0.f; -#endif - -#if BURNING_MATERIAL_MAX_COLORS > 2 - dest->Color[2].a = 1.f; - dest->Color[2].r = 0.f; - dest->Color[2].g = 0.f; - dest->Color[2].b = 0.f; -#endif - -#if BURNING_MATERIAL_MAX_COLORS > 3 - dest->Color[3].a = 1.f; - dest->Color[3].r = 0.f; - dest->Color[3].g = 0.f; - dest->Color[3].b = 0.f; -#endif - -#if BURNING_MATERIAL_MAX_LIGHT_TANGENT > 0 - dest->LightTangent[0].x = 0.f; - dest->LightTangent[0].y = 0.f; - dest->LightTangent[0].z = 0.f; -#endif - - -#if BURNING_MATERIAL_MAX_COLORS > 0 - // apply lighting model -#if defined (SOFTWARE_DRIVER_2_LIGHTING) - if (Material.org.Lighting) - { - lightVertex_eye(dest, base->Color.color); - } - else - { - dest->Color[0].setA8R8G8B8(base->Color.color); - } -#else - dest->Color[0].setA8R8G8B8(base->Color.color); -#endif -#endif - - //vertex fog - if (EyeSpace.TL_Flag & TL_FOG) //Material.org.FogEnable - { - f32 fog_factor = 1.f; - - // GL_FRAGMENT_DEPTH -> abs(EyeSpace.vertex.z) - ieee754 fog_frag_coord; - fog_frag_coord.f = EyeSpace.vertex.z; - fog_frag_coord.fields.sign = 0; - - switch (FogType) - { - case EFT_FOG_LINEAR: - fog_factor = (FogEnd - fog_frag_coord.f) * EyeSpace.fog_scale; - break; - case EFT_FOG_EXP: - fog_factor = (f32)exp(-FogDensity * fog_frag_coord.f); - break; - case EFT_FOG_EXP2: - fog_factor = (f32)exp(-FogDensity * FogDensity * fog_frag_coord.f * fog_frag_coord.f); - break; - } - - sVec4* a = dest->Color + ((VertexCache.vSize[VertexCache.vType].Format & VERTEX4D_FORMAT_COLOR_2_FOG) ? 1 : 0); - a->a = clampf01(fog_factor); - } - - // Texture Coo Transform - // Always set all internal uv (v1.9 SOFTWARE_DRIVER_2_TEXTURE_TRANSFORM always on) - for (size_t t = 0; t < BURNING_MATERIAL_MAX_TEXTURES; ++t) - { - sVec4 r; - f32 tx, ty; - - // texgen - const size_t flag = TransformationFlag[TransformationStack][ETS_TEXTURE_0 + t]; - if (flag & ETF_TEXGEN_CAMERA_SPHERE) - { - //reflect(u,N) u - 2.0 * dot(N, u) * N - // cam is (0,0,-1), tex flipped - - const sVec4& u = EyeSpace.cam_dir; // EyeSpace.vertex.normalized - const sVec4& n = EyeSpace.normal; - - f32 dot = -2.f * n.dot_xyz(u); - r.x = u.x + dot * n.x; - r.y = u.y + dot * n.y; - r.z = u.z + dot * n.z; - - //openGL - f32 m = 2.f * sqrtf(r.x * r.x + r.y * r.y + (r.z + 1.f) * (r.z + 1.f)); - tx = r.x / m + 0.5f; - ty = -r.y / m + 0.5f; - - /* - //~d3d with spheremap scale - f32 m = 0.25f / (0.00001f + sqrtf(r.x*r.x+r.y*r.y+r.z*r.z)); - dest[0].Tex[t].x = r.x * m + 0.5f; - dest[0].Tex[t].y = -r.y * m + 0.5f; - */ - } - else if (flag & ETF_TEXGEN_CAMERA_REFLECTION) - { - //reflect(u,N) u - 2.0 * dot(N, u) * N - // cam is (0,0,-1), tex flipped - - const sVec4& u = EyeSpace.cam_dir; // EyeSpace.vertex.normalized - const sVec4& n = EyeSpace.normal; - - f32 dot = -2.f * n.dot_xyz(u); - r.x = u.x + dot * n.x; - r.y = u.y + dot * n.y; - r.z = u.z + dot * n.z; - - //openGL - tx = r.x; - ty = -r.y; - /* - //~d3d with spheremap scale - dest[0].Tex[t].x = r.x; - dest[0].Tex[t].y = r.y; - */ - } - else - if (t < VertexCache.vSize[VertexCache.vType].TexCooSize) - { - // Irrlicht TCoords and TCoords2 must be contiguous memory. baseTCoord has no 4 byte aligned start address! - const sVec2Pack* baseTCoord = (const sVec2Pack*)&base->TCoords.X; - - tx = baseTCoord[t].x; - ty = baseTCoord[t].y; - } - else - { - tx = 0.f; - ty = 0.f; - } - - //transform - if (!(flag & ETF_IDENTITY)) - { - /* - Generate texture coordinates as linear functions so that: - u = Ux*x + Uy*y + Uz*z + Uw - v = Vx*x + Vy*y + Vz*z + Vw - The matrix M for this case is: - Ux Vx 0 0 - Uy Vy 0 0 - Uz Vz 0 0 - Uw Vw 0 0 - */ - - const f32* M = matrix[ETS_TEXTURE_0 + t].pointer(); - - f32 _tx = tx; - f32 _ty = ty; - tx = M[0] * _tx + M[4] * _ty + M[8]; - ty = M[1] * _tx + M[5] * _ty + M[9]; - } - - switch (Material.org.TextureLayer[t].TextureWrapU) - { - case ETC_CLAMP: - case ETC_CLAMP_TO_EDGE: - case ETC_CLAMP_TO_BORDER: - tx = clampf01(tx); - break; - case ETC_MIRROR: - if (core::fract(tx) > 0.5f) - tx = 1.f - tx; - break; - case ETC_MIRROR_CLAMP: - case ETC_MIRROR_CLAMP_TO_EDGE: - case ETC_MIRROR_CLAMP_TO_BORDER: - tx = clampf01(tx); - if (core::fract(tx) > 0.5f) - tx = 1.f - tx; - break; - case ETC_REPEAT: - // texel access is always modulo - default: - break; - } - switch (Material.org.TextureLayer[t].TextureWrapV) - { - case ETC_CLAMP: - case ETC_CLAMP_TO_EDGE: - case ETC_CLAMP_TO_BORDER: - ty = clampf01(ty); - break; - case ETC_MIRROR: - if (core::fract(ty) > 0.5f) - ty = 1.f - ty; - break; - case ETC_MIRROR_CLAMP: - case ETC_MIRROR_CLAMP_TO_EDGE: - case ETC_MIRROR_CLAMP_TO_BORDER: - ty = clampf01(ty); - if (core::fract(ty) > 0.5f) - ty = 1.f - ty; - break; - case ETC_REPEAT: - // texel access is always modulo - default: - break; - } - - dest->Tex[t].x = tx; - dest->Tex[t].y = ty; - } - - -#if BURNING_MATERIAL_MAX_LIGHT_TANGENT > 0 - if ((EyeSpace.TL_Flag & TL_LIGHT0_IS_NORMAL_MAP) && - ((VertexCache.vSize[VertexCache.vType].Format & VERTEX4D_FORMAT_MASK_TANGENT) == VERTEX4D_FORMAT_BUMP_DOT3) - ) - { - const S3DVertexTangents* tangent = ((S3DVertexTangents*)source); - - sVec4 vp; - sVec4 light_accu; - light_accu.x = 0.f; - light_accu.y = 0.f; - light_accu.z = 0.f; - light_accu.w = 0.f; - for (u32 i = 0; i < 2 && i < EyeSpace.Light.size(); ++i) - { - const SBurningShaderLight& light = EyeSpace.Light[i]; - if (!light.LightIsOn) - continue; - - // lightcolor with standard model - // but shader is different. treating light and vertex in same space -#if 1 - vp.x = light.pos.x - base->Pos.X; - vp.y = light.pos.y - base->Pos.Y; - vp.z = light.pos.z - base->Pos.Z; -#else - vp.x = light.pos4.x - EyeSpace.vertex.x; - vp.y = light.pos4.y - EyeSpace.vertex.y; - vp.z = light.pos4.z - EyeSpace.vertex.z; -#endif - - // transform by tangent matrix - light_accu.x += (vp.x * tangent->Tangent.X + vp.y * tangent->Tangent.Y + vp.z * tangent->Tangent.Z); - light_accu.y += (vp.x * tangent->Binormal.X + vp.y * tangent->Binormal.Y + vp.z * tangent->Binormal.Z); - light_accu.z += (vp.x * tangent->Normal.X + vp.y * tangent->Normal.Y + vp.z * tangent->Normal.Z); - } - //normalize [-1,+1] to [0,1] -> obsolete - light_accu.normalize_pack_xyz(dest->LightTangent[0], 1.f, 0.f); - dest->Tex[1].x = dest->Tex[0].x; - dest->Tex[1].y = dest->Tex[0].y; - - } - else if (Material.org.Lighting) - { - //dest->LightTangent[0].x = 0.f; - //dest->LightTangent[0].y = 0.f; - //dest->LightTangent[0].z = 0.f; - } -#endif //if BURNING_MATERIAL_MAX_LIGHT_TANGENT > 0 - -//#endif // SOFTWARE_DRIVER_2_TEXTURE_TRANSFORM - -clipandproject: - - // test vertex visible - dest[0].flag = (u32)(clipToFrustumTest(dest) | VertexCache.vSize[VertexCache.vType].Format); - dest[1].flag = dest[0].flag; - - // to DC Space, project homogenous vertex - if ((dest[0].flag & VERTEX4D_CLIPMASK) == VERTEX4D_INSIDE) - { - ndc_2_dc_and_project(dest + s4DVertex_proj(0), dest + s4DVertex_ofs(0), s4DVertex_ofs(1)); - } - -} - - -//todo: this should return only index -s4DVertexPair* CBurningVideoDriver::VertexCache_getVertex(const u32 sourceIndex) const -{ - for (size_t i = 0; i < VERTEXCACHE_ELEMENT; ++i) - { - if (VertexCache.info[i].index == sourceIndex) - { - return VertexCache.mem.data + s4DVertex_ofs(i); - } - } - return VertexCache.mem.data; //error -} - - -/* - Cache based on linear walk indices - fill blockwise on the next 16(Cache_Size) unique vertices in indexlist - merge the next 16 vertices with the current -*/ -void CBurningVideoDriver::VertexCache_get(s4DVertexPair* face[4]) -{ - // next primitive must be complete in cache - if (VertexCache.indicesIndex - VertexCache.indicesRun < VertexCache.primitiveHasVertex && - VertexCache.indicesIndex < VertexCache.indexCount - ) - { - - size_t i; - //memset(info, VERTEXCACHE_MISS, sizeof(info)); - for (i = 0; i != VERTEXCACHE_ELEMENT; ++i) - { - VertexCache.info_temp[i].hit = VERTEXCACHE_MISS; - VertexCache.info_temp[i].index = VERTEXCACHE_MISS; - } - - // rewind to start of primitive - VertexCache.indicesIndex = VertexCache.indicesRun; - - - // get the next unique vertices cache line - u32 fillIndex = 0; - u32 dIndex = 0; - u32 sourceIndex = 0; - - while (VertexCache.indicesIndex < VertexCache.indexCount && - fillIndex < VERTEXCACHE_ELEMENT - ) - { - switch (VertexCache.iType) - { - case E4IT_16BIT: - sourceIndex = ((u16*)VertexCache.indices)[VertexCache.indicesIndex]; - break; - case E4IT_32BIT: - sourceIndex = ((u32*)VertexCache.indices)[VertexCache.indicesIndex]; - break; - default: - case E4IT_NONE: - sourceIndex = VertexCache.indicesIndex; - break; - } - - VertexCache.indicesIndex += 1; - - // if not exist, push back - s32 exist = 0; - for (dIndex = 0; dIndex < fillIndex; ++dIndex) - { - if (VertexCache.info_temp[dIndex].index == sourceIndex) - { - exist = 1; - break; - } - } - - if (0 == exist) - { - VertexCache.info_temp[fillIndex++].index = sourceIndex; - } - } - - // clear marks - for (i = 0; i != VERTEXCACHE_ELEMENT; ++i) - { - VertexCache.info[i].hit = 0; - } - - // mark all existing - for (i = 0; i != fillIndex; ++i) - { - for (dIndex = 0; dIndex < VERTEXCACHE_ELEMENT; ++dIndex) - { - if (VertexCache.info[dIndex].index == VertexCache.info_temp[i].index) - { - VertexCache.info_temp[i].hit = dIndex; - VertexCache.info[dIndex].hit = 1; - break; - } - } - } - - // fill new - for (i = 0; i != fillIndex; ++i) - { - if (VertexCache.info_temp[i].hit != VERTEXCACHE_MISS) - continue; - - for (dIndex = 0; dIndex < VERTEXCACHE_ELEMENT; ++dIndex) - { - if (0 == VertexCache.info[dIndex].hit) - { - VertexCache_fill(VertexCache.info_temp[i].index, dIndex); - VertexCache.info[dIndex].hit += 1; - VertexCache.info_temp[i].hit = dIndex; - break; - } - } - } - } - - //const u32 i0 = core::if_c_a_else_0 ( VertexCache.pType != scene::EPT_TRIANGLE_FAN, VertexCache.indicesRun ); - const u32 i0 = VertexCache.pType != scene::EPT_TRIANGLE_FAN ? VertexCache.indicesRun : 0; - - switch (VertexCache.iType) - { - case E4IT_16BIT: - { - const u16* p = (const u16*)VertexCache.indices; - face[0] = VertexCache_getVertex(p[i0]); - face[1] = VertexCache_getVertex(p[VertexCache.indicesRun + 1]); - face[2] = VertexCache_getVertex(p[VertexCache.indicesRun + 2]); - } - break; - - case E4IT_32BIT: - { - const u32* p = (const u32*)VertexCache.indices; - face[0] = VertexCache_getVertex(p[i0]); - face[1] = VertexCache_getVertex(p[VertexCache.indicesRun + 1]); - face[2] = VertexCache_getVertex(p[VertexCache.indicesRun + 2]); - } - break; - - case E4IT_NONE: - face[0] = VertexCache_getVertex(VertexCache.indicesRun + 0); - face[1] = VertexCache_getVertex(VertexCache.indicesRun + 1); - face[2] = VertexCache_getVertex(VertexCache.indicesRun + 2); - break; - default: - face[0] = face[1] = face[2] = VertexCache_getVertex(VertexCache.indicesRun + 0); - break; - } - face[3] = face[0]; // quad unsupported - VertexCache.indicesRun += VertexCache.indicesPitch; -} - - -/*! -*/ -int CBurningVideoDriver::VertexCache_reset(const void* vertices, u32 vertexCount, - const void* indices, u32 primitiveCount, - E_VERTEX_TYPE vType, - scene::E_PRIMITIVE_TYPE pType, - E_INDEX_TYPE iType) -{ - - // These calls would lead to crashes due to wrong index usage. - // The vertex cache needs to be rewritten for these primitives. - if (0 == CurrentShader || - pType == scene::EPT_POINTS || pType == scene::EPT_LINE_STRIP || - pType == scene::EPT_LINE_LOOP || pType == scene::EPT_LINES || - pType == scene::EPT_POLYGON || - pType == scene::EPT_POINT_SPRITES) - { - return 1; - } - - VertexCache.vertices = vertices; - VertexCache.vertexCount = vertexCount; - - switch (Material.org.MaterialType) // (Material.Fallback_MaterialType) - { - case EMT_REFLECTION_2_LAYER: - case EMT_TRANSPARENT_REFLECTION_2_LAYER: - VertexCache.vType = E4VT_REFLECTION_MAP; - break; - default: - VertexCache.vType = (e4DVertexType)vType; - break; - } - - //check material - SVSize* vSize = VertexCache.vSize; - for (int m = (int)vSize[VertexCache.vType].TexSize - 1; m >= 0; --m) - { - ITexture* tex = MAT_TEXTURE(m); - if (!tex) - { - vSize[E4VT_NO_TEXTURE] = vSize[VertexCache.vType]; - vSize[E4VT_NO_TEXTURE].TexSize = m; - vSize[E4VT_NO_TEXTURE].TexCooSize = m; - VertexCache.vType = E4VT_NO_TEXTURE; - //flags downconvert? - } - } - - VertexCache.indices = indices; - VertexCache.indicesIndex = 0; - VertexCache.indicesRun = 0; - - switch (iType) - { - case EIT_16BIT: VertexCache.iType = E4IT_16BIT; break; - case EIT_32BIT: VertexCache.iType = E4IT_32BIT; break; - default: - VertexCache.iType = (e4DIndexType)iType; break; - } - if (!VertexCache.indices) - VertexCache.iType = E4IT_NONE; - - VertexCache.pType = pType; - VertexCache.primitiveHasVertex = 3; - VertexCache.indicesPitch = 1; - switch (VertexCache.pType) - { - // most types here will not work as expected, only triangles/triangle_fan - // is known to work. - case scene::EPT_POINTS: - VertexCache.indexCount = primitiveCount; - VertexCache.indicesPitch = 1; - VertexCache.primitiveHasVertex = 1; - break; - case scene::EPT_LINE_STRIP: - VertexCache.indexCount = primitiveCount + 1; - VertexCache.indicesPitch = 1; - VertexCache.primitiveHasVertex = 2; - break; - case scene::EPT_LINE_LOOP: - VertexCache.indexCount = primitiveCount + 1; - VertexCache.indicesPitch = 1; - VertexCache.primitiveHasVertex = 2; - break; - case scene::EPT_LINES: - VertexCache.indexCount = 2 * primitiveCount; - VertexCache.indicesPitch = 2; - VertexCache.primitiveHasVertex = 2; - break; - case scene::EPT_TRIANGLE_STRIP: - VertexCache.indexCount = primitiveCount + 2; - VertexCache.indicesPitch = 1; - VertexCache.primitiveHasVertex = 3; - break; - case scene::EPT_TRIANGLES: - VertexCache.indexCount = primitiveCount + primitiveCount + primitiveCount; - VertexCache.indicesPitch = 3; - VertexCache.primitiveHasVertex = 3; - break; - case scene::EPT_TRIANGLE_FAN: - VertexCache.indexCount = primitiveCount + 2; - VertexCache.indicesPitch = 1; - VertexCache.primitiveHasVertex = 3; - break; - case scene::EPT_QUAD_STRIP: - VertexCache.indexCount = 2 * primitiveCount + 2; - VertexCache.indicesPitch = 2; - VertexCache.primitiveHasVertex = 4; - break; - case scene::EPT_QUADS: - VertexCache.indexCount = 4 * primitiveCount; - VertexCache.indicesPitch = 4; - VertexCache.primitiveHasVertex = 4; - break; - case scene::EPT_POLYGON: - VertexCache.indexCount = primitiveCount + 1; - VertexCache.indicesPitch = 1; - VertexCache.primitiveHasVertex = primitiveCount; - break; - case scene::EPT_POINT_SPRITES: - VertexCache.indexCount = primitiveCount; - VertexCache.indicesPitch = 1; - VertexCache.primitiveHasVertex = 1; - break; - } - - //memset( VertexCache.info, VERTEXCACHE_MISS, sizeof ( VertexCache.info ) ); - for (size_t i = 0; i != VERTEXCACHE_ELEMENT; ++i) - { - VertexCache.info[i].hit = VERTEXCACHE_MISS; - VertexCache.info[i].index = VERTEXCACHE_MISS; - } - return 0; -} - - -//! draws a vertex primitive list -void CBurningVideoDriver::drawVertexPrimitiveList(const void* vertices, u32 vertexCount, - const void* indexList, u32 primitiveCount, - E_VERTEX_TYPE vType, scene::E_PRIMITIVE_TYPE pType, E_INDEX_TYPE iType) - -{ - if (!checkPrimitiveCount(primitiveCount)) - return; - - CNullDriver::drawVertexPrimitiveList(vertices, vertexCount, indexList, primitiveCount, vType, pType, iType); - - if (VertexCache_reset(vertices, vertexCount, indexList, primitiveCount, vType, pType, iType)) - return; - - if ((u32)Material.org.MaterialType < MaterialRenderers.size()) - { - MaterialRenderers[Material.org.MaterialType].Renderer->OnRender(this, vType); - } - - //Matrices needed for this primitive - transform_calc(ETS_PROJ_MODEL_VIEW); - if (Material.org.Lighting || (EyeSpace.TL_Flag & (TL_TEXTURE_TRANSFORM | TL_FOG))) - { - transform_calc(ETS_MODEL_VIEW); - transform_calc(ETS_NORMAL); - } - - - s4DVertexPair* face[4]; - - size_t vOut; - size_t vertex_from_clipper; // from VertexCache or CurrentOut - size_t has_vertex_run; - - for (size_t primitive_run = 0; primitive_run < primitiveCount; ++primitive_run) - { - //collect pointer to face vertices - VertexCache_get(face); - - size_t clipMask_i; - size_t clipMask_o; - - clipMask_i = face[0]->flag; - clipMask_o = face[0]->flag; - - for (has_vertex_run = 1; has_vertex_run < VertexCache.primitiveHasVertex; ++has_vertex_run) - { - clipMask_i |= face[has_vertex_run]->flag; // if fully outside or outside on same side - clipMask_o &= face[has_vertex_run]->flag; // if fully inside - } - - clipMask_i &= VERTEX4D_CLIPMASK; - clipMask_o &= VERTEX4D_CLIPMASK; - - if (clipMask_i != VERTEX4D_INSIDE) - { - // if primitive fully outside or outside on same side - continue; - vOut = 0; - vertex_from_clipper = 0; - } - else if (clipMask_o == VERTEX4D_INSIDE) - { - // if primitive fully inside - vOut = VertexCache.primitiveHasVertex; - vertex_from_clipper = 0; - } - else -#if defined(SOFTWARE_DRIVER_2_CLIPPING) - { - // else if not complete inside clipping necessary - // check: clipping should reuse vertexcache (try to minimize clipping) - for (has_vertex_run = 0; has_vertex_run < VertexCache.primitiveHasVertex; ++has_vertex_run) - { - memcpy_s4DVertexPair(Clipper.data + s4DVertex_ofs(has_vertex_run), face[has_vertex_run]); - } - - vOut = clipToFrustum(VertexCache.primitiveHasVertex); - vertex_from_clipper = 1; - - // to DC Space, project homogenous vertex - ndc_2_dc_and_project(Clipper.data + s4DVertex_proj(0), Clipper.data + s4DVertex_ofs(0), s4DVertex_ofs(vOut)); - } -#else - { - continue; - vOut = 0; - vertex_from_clipper = 0; - } -#endif - // re-tesselate ( triangle-fan, 0-1-2,0-2-3.. ) - for (has_vertex_run = 0; (has_vertex_run + VertexCache.primitiveHasVertex) <= vOut; has_vertex_run += 1) - { - // set from clipped geometry - if (vertex_from_clipper) - { - face[0] = Clipper.data + s4DVertex_ofs(0); - face[1] = Clipper.data + s4DVertex_ofs(has_vertex_run + 1); - face[2] = Clipper.data + s4DVertex_ofs(has_vertex_run + 2); - } - - //area of primitive in device space - // projected triangle screen area is used for culling ( sign of normal ) and mipmap selection - //f32 dc_area = screenarea_inside(face); - - // crossproduct (area of parallelogram * 0.5 = triangle screen size) - f32 dc_area; - { - const sVec4& v0 = (face[0] + s4DVertex_proj(0))->Pos; - const sVec4& v1 = (face[1] + s4DVertex_proj(0))->Pos; - const sVec4& v2 = (face[2] + s4DVertex_proj(0))->Pos; - - //dc_area = a.x * b.y - b.x * a.y; - dc_area = ((v1.x - v0.x) * (v2.y - v0.y) - (v2.x - v0.x) * (v1.y - v0.y)) * 0.5f; - } - - //geometric clipping has problem with invisible or very small Triangles - //size_t sign = dc_area < 0.001f ? CULL_BACK : dc_area > 0.001f ? CULL_FRONT : CULL_INVISIBLE; - ieee754 t; - t.f = dc_area; - size_t sign = t.fields.sign ? CULL_BACK : CULL_FRONT; - sign |= t.abs.frac_exp < 981668463 /*0.01f*/ ? CULL_INVISIBLE : 0; - if (Material.CullFlag & sign) - break; //continue; - - //select mipmap ratio between drawing space and texture space (for multiply divide here) - dc_area = reciprocal_zero(dc_area); - - // select mipmap - for (size_t m = 0; m < VertexCache.vSize[VertexCache.vType].TexSize; ++m) - { - video::CSoftwareTexture2* tex = MAT_TEXTURE(m); - - //only guessing: take more detail (lower mipmap) in light+bump textures - f32 lod_bias = 0.100f;// core::clamp(map_value((f32)ScreenSize.Width * ScreenSize.Height, 160 * 120, 640 * 480, 1.f / 8.f, 1.f / 8.f), 0.01f, 1.f); - - //assume transparent add is ~50% transparent -> more detail - switch (Material.org.MaterialType) - { - case EMT_TRANSPARENT_ADD_COLOR: - case EMT_TRANSPARENT_ALPHA_CHANNEL: - lod_bias *= 0.5f; - break; - default: - break; - } - lod_bias *= tex->get_lod_bias(); - //lod_bias += Material.org.TextureLayer[m].LODBias * 0.125f; - - s32 lodFactor = lodFactor_inside(face, m, dc_area, lod_bias); - - CurrentShader->setTextureParam(m, tex, lodFactor); - //currently shader receives texture coordinate as Pixelcoo of 1 Texture - select_polygon_mipmap_inside(face, m, tex->getTexBound()); - } - - CurrentShader->drawWireFrameTriangle(face[0] + s4DVertex_proj(0), face[1] + s4DVertex_proj(0), face[2] + s4DVertex_proj(0)); - vertex_from_clipper = 1; - } - - } - - //release texture - for (size_t m = 0; m < VertexCache.vSize[VertexCache.vType].TexSize; ++m) - { - CurrentShader->setTextureParam(m, 0, 0); - } - -} - - -//! Sets the dynamic ambient light color. The default color is -//! (0,0,0,0) which means it is dark. -//! \param color: New color of the ambient light. -void CBurningVideoDriver::setAmbientLight(const SColorf& color) -{ - EyeSpace.Global_AmbientLight.setColorf(color); -} - - -//! adds a dynamic light -s32 CBurningVideoDriver::addDynamicLight(const SLight& dl) -{ - (void)CNullDriver::addDynamicLight(dl); - - SBurningShaderLight l; - // l.org = dl; - l.Type = dl.Type; - l.LightIsOn = true; - - l.AmbientColor.setColorf(dl.AmbientColor); - l.DiffuseColor.setColorf(dl.DiffuseColor); - l.SpecularColor.setColorf(dl.SpecularColor); - - //should always be valid? - sVec4 nDirection; - nDirection.x = dl.Direction.X; - nDirection.y = dl.Direction.Y; - nDirection.z = dl.Direction.Z; - nDirection.normalize_dir_xyz(); - - - switch (dl.Type) - { - case ELT_DIRECTIONAL: - l.pos.x = dl.Position.X; - l.pos.y = dl.Position.Y; - l.pos.z = dl.Position.Z; - l.pos.w = 0.f; - - l.constantAttenuation = 1.f; - l.linearAttenuation = 0.f; - l.quadraticAttenuation = 0.f; - - l.spotDirection.x = -nDirection.x; - l.spotDirection.y = -nDirection.y; - l.spotDirection.z = -nDirection.z; - l.spotDirection.w = 0.f; - l.spotCosCutoff = -1.f; - l.spotCosInnerCutoff = 1.f; - l.spotExponent = 0.f; - break; - - case ELT_POINT: - l.pos.x = dl.Position.X; - l.pos.y = dl.Position.Y; - l.pos.z = dl.Position.Z; - l.pos.w = 1.f; - - l.constantAttenuation = dl.Attenuation.X; - l.linearAttenuation = dl.Attenuation.Y; - l.quadraticAttenuation = dl.Attenuation.Z; - - l.spotDirection.x = -nDirection.x; - l.spotDirection.y = -nDirection.y; - l.spotDirection.z = -nDirection.z; - l.spotDirection.w = 0.f; - l.spotCosCutoff = -1.f; - l.spotCosInnerCutoff = 1.f; - l.spotExponent = 0.f; - break; - - case ELT_SPOT: - l.pos.x = dl.Position.X; - l.pos.y = dl.Position.Y; - l.pos.z = dl.Position.Z; - l.pos.w = 1.f; - - l.constantAttenuation = dl.Attenuation.X; - l.linearAttenuation = dl.Attenuation.Y; - l.quadraticAttenuation = dl.Attenuation.Z; - - l.spotDirection.x = nDirection.x; - l.spotDirection.y = nDirection.y; - l.spotDirection.z = nDirection.z; - l.spotDirection.w = 0.0f; - l.spotCosCutoff = cosf(dl.OuterCone * 2.0f * core::DEGTORAD * 0.5f); - l.spotCosInnerCutoff = cosf(dl.InnerCone * 2.0f * core::DEGTORAD * 0.5f); - l.spotExponent = dl.Falloff; - break; - default: - break; - } - - //which means ETS_VIEW - setTransform(ETS_WORLD, irr::core::IdentityMatrix); - transform_calc(ETS_MODEL_VIEW); - - const core::matrix4* matrix = Transformation[TransformationStack]; - transformVec4Vec4(matrix[ETS_MODEL_VIEW], &l.pos4.x, &l.pos.x); - rotateVec3Vec4(matrix[ETS_MODEL_VIEW], &l.spotDirection4.x, &l.spotDirection.x); - - EyeSpace.Light.push_back(l); - return EyeSpace.Light.size() - 1; -} - - -//! Turns a dynamic light on or off -void CBurningVideoDriver::turnLightOn(s32 lightIndex, bool turnOn) -{ - if ((u32)lightIndex < EyeSpace.Light.size()) - { - EyeSpace.Light[lightIndex].LightIsOn = turnOn; - } -} - -//! deletes all dynamic lights there are -void CBurningVideoDriver::deleteAllDynamicLights() -{ - EyeSpace.reset(); - CNullDriver::deleteAllDynamicLights(); - -} - -//! returns the maximal amount of dynamic lights the device can handle -u32 CBurningVideoDriver::getMaximalDynamicLightAmount() const -{ - return 8; //no limit 8 only for convenience -} - - -//! sets a material -void CBurningVideoDriver::setMaterial(const SMaterial& material) -{ - // ---------- Override - Material.org = material; - OverrideMaterial.apply(Material.org); - - const SMaterial& in = Material.org; - - // ---------- Notify Shader - // unset old material - u32 mi; - mi = (u32)Material.lastMaterial.MaterialType; - if (mi != material.MaterialType && mi < MaterialRenderers.size()) - MaterialRenderers[mi].Renderer->OnUnsetMaterial(); - - // set new material. - mi = (u32)in.MaterialType; - if (mi < MaterialRenderers.size()) - MaterialRenderers[mi].Renderer->OnSetMaterial( - in, Material.lastMaterial, Material.resetRenderStates, this); - - Material.lastMaterial = in; - Material.resetRenderStates = false; - - //CSoftware2MaterialRenderer sets Material.Fallback_MaterialType - - //Material.Fallback_MaterialType = material.MaterialType; - -//----------------- - - //Material.org = material; - Material.CullFlag = CULL_INVISIBLE | (in.BackfaceCulling ? CULL_BACK : 0) | (in.FrontfaceCulling ? CULL_FRONT : 0); - - size_t* flag = TransformationFlag[TransformationStack]; - -#ifdef SOFTWARE_DRIVER_2_TEXTURE_TRANSFORM - for (u32 m = 0; m < BURNING_MATERIAL_MAX_TEXTURES /*&& m < vSize[VertexCache.vType].TexSize*/; ++m) - { - setTransform((E_TRANSFORMATION_STATE)(ETS_TEXTURE_0 + m), in.getTextureMatrix(m)); - flag[ETS_TEXTURE_0 + m] &= ~ETF_TEXGEN_MASK; - } -#endif - -#ifdef SOFTWARE_DRIVER_2_LIGHTING - - Material.AmbientColor.setA8R8G8B8(in.AmbientColor.color); - Material.DiffuseColor.setA8R8G8B8(in.ColorMaterial ? 0xFFFFFFFF : in.DiffuseColor.color); - Material.EmissiveColor.setA8R8G8B8(in.EmissiveColor.color); - Material.SpecularColor.setA8R8G8B8(in.SpecularColor.color); - - burning_setbit(EyeSpace.TL_Flag, in.Lighting, TL_LIGHT); - burning_setbit(EyeSpace.TL_Flag, (in.Shininess != 0.f) && (in.SpecularColor.color & 0x00ffffff), TL_SPECULAR); - burning_setbit(EyeSpace.TL_Flag, in.FogEnable, TL_FOG); - burning_setbit(EyeSpace.TL_Flag, in.NormalizeNormals, TL_NORMALIZE_NORMALS); - //if (EyeSpace.Flags & SPECULAR ) EyeSpace.Flags |= NORMALIZE_NORMALS; - -#endif - -//--------------- setCurrentShader - - ITexture* texture0 = in.getTexture(0); - ITexture* texture1 = in.getTexture(1); - //ITexture* texture2 = in.getTexture(2); - //ITexture* texture3 = in.getTexture(3); - - //visual studio code analysis - u32 maxTex = BURNING_MATERIAL_MAX_TEXTURES; - if (maxTex < 1) texture0 = 0; - if (maxTex < 2) texture1 = 0; - //if (maxTex < 3) texture2 = 0; - //if (maxTex < 4) texture3 = 0; - - EyeSpace.TL_Flag &= ~(TL_TEXTURE_TRANSFORM | TL_LIGHT0_IS_NORMAL_MAP); - - //todo: seperate depth test from depth write - Material.depth_write = getWriteZBuffer(in); - Material.depth_test = in.ZBuffer != ECFN_DISABLED && Material.depth_write; - - EBurningFFShader shader = Material.depth_test ? ETR_TEXTURE_GOURAUD : ETR_TEXTURE_GOURAUD_NOZ; - - switch (Material.Fallback_MaterialType) //(Material.org.MaterialType) - { - case EMT_ONETEXTURE_BLEND: - shader = ETR_TEXTURE_BLEND; - break; - - case EMT_TRANSPARENT_ALPHA_CHANNEL_REF: - Material.org.MaterialTypeParam = 0.5f; - //fallthrough - - case EMT_TRANSPARENT_ALPHA_CHANNEL: - if (texture0 && texture0->hasAlpha()) - { - shader = Material.depth_test ? ETR_TEXTURE_GOURAUD_ALPHA : ETR_TEXTURE_GOURAUD_ALPHA_NOZ; - } - else - { - //fall back to EMT_TRANSPARENT_VERTEX_ALPHA - shader = ETR_TEXTURE_GOURAUD_VERTEX_ALPHA; - } - break; - - case EMT_TRANSPARENT_ADD_COLOR: - shader = Material.depth_test ? ETR_TEXTURE_GOURAUD_ADD : ETR_TEXTURE_GOURAUD_ADD_NO_Z; - break; - - case EMT_TRANSPARENT_VERTEX_ALPHA: - shader = ETR_TEXTURE_GOURAUD_VERTEX_ALPHA; - break; - - case EMT_LIGHTMAP: - case EMT_LIGHTMAP_LIGHTING: - if (texture1) - shader = ETR_TEXTURE_GOURAUD_LIGHTMAP_M1; - break; - - case EMT_LIGHTMAP_M2: - case EMT_LIGHTMAP_LIGHTING_M2: - if (texture1) - shader = ETR_TEXTURE_GOURAUD_LIGHTMAP_M2; - break; - - case EMT_LIGHTMAP_LIGHTING_M4: - if (texture1) - shader = ETR_TEXTURE_GOURAUD_LIGHTMAP_M4; - break; - case EMT_LIGHTMAP_M4: - if (texture1) - shader = ETR_TEXTURE_LIGHTMAP_M4; - break; - - case EMT_LIGHTMAP_ADD: - if (texture1) - shader = ETR_TEXTURE_GOURAUD_LIGHTMAP_ADD; - break; - - case EMT_DETAIL_MAP: - if (texture1) - shader = ETR_TEXTURE_GOURAUD_DETAIL_MAP; - break; - - case EMT_SPHERE_MAP: - flag[ETS_TEXTURE_0] |= ETF_TEXGEN_CAMERA_SPHERE; - EyeSpace.TL_Flag |= TL_TEXTURE_TRANSFORM; - break; - case EMT_REFLECTION_2_LAYER: - case EMT_TRANSPARENT_REFLECTION_2_LAYER: - if (texture1) - { - shader = ETR_TRANSPARENT_REFLECTION_2_LAYER; - flag[ETS_TEXTURE_1] |= ETF_TEXGEN_CAMERA_REFLECTION; - EyeSpace.TL_Flag |= TL_TEXTURE_TRANSFORM; - } - break; - - case EMT_NORMAL_MAP_SOLID: - case EMT_NORMAL_MAP_TRANSPARENT_ADD_COLOR: - case EMT_NORMAL_MAP_TRANSPARENT_VERTEX_ALPHA: - if (texture1) - { - shader = ETR_NORMAL_MAP_SOLID; - EyeSpace.TL_Flag |= TL_TEXTURE_TRANSFORM | TL_LIGHT0_IS_NORMAL_MAP; - } - break; - case EMT_PARALLAX_MAP_SOLID: - case EMT_PARALLAX_MAP_TRANSPARENT_ADD_COLOR: - case EMT_PARALLAX_MAP_TRANSPARENT_VERTEX_ALPHA: - if (texture1) - { - shader = ETR_NORMAL_MAP_SOLID; - EyeSpace.TL_Flag |= TL_TEXTURE_TRANSFORM | TL_LIGHT0_IS_NORMAL_MAP; - } - break; - - default: - break; - - } - - if (!texture0) - { - shader = Material.depth_test ? ETR_GOURAUD : - shader == ETR_TEXTURE_GOURAUD_VERTEX_ALPHA ? - ETR_GOURAUD_ALPHA_NOZ : // 2D Gradient - ETR_GOURAUD_NOZ; - - shader = ETR_COLOR; - } - - if (in.Wireframe) - { - IBurningShader* candidate = BurningShader[shader]; - if (!candidate || (candidate && !candidate->canWireFrame())) - { - shader = ETR_TEXTURE_GOURAUD_WIRE; - } - } - - if (in.PointCloud) - { - IBurningShader* candidate = BurningShader[shader]; - if (!candidate || (candidate && !candidate->canPointCloud())) - { - shader = ETR_TEXTURE_GOURAUD_WIRE; - } - } - - //shader = ETR_REFERENCE; - - // switchToTriangleRenderer - CurrentShader = BurningShader[shader]; - if (CurrentShader) - { - CurrentShader->setTLFlag(EyeSpace.TL_Flag); - if (EyeSpace.TL_Flag & TL_FOG) CurrentShader->setFog(FogColor); - if (EyeSpace.TL_Flag & TL_SCISSOR) CurrentShader->setScissor(Scissor); - CurrentShader->setRenderTarget(RenderTargetSurface, ViewPort, Interlaced); - CurrentShader->OnSetMaterial(Material); - CurrentShader->pushEdgeTest(in.Wireframe, in.PointCloud, 0); - } - - - /* - mi = (u32)Material.org.MaterialType; - if (mi < MaterialRenderers.size()) - MaterialRenderers[mi].Renderer->OnRender(this, (video::E_VERTEX_TYPE)VertexCache.vType); - */ -} - - -//! Sets the fog mode. -void CBurningVideoDriver::setFog(SColor color, E_FOG_TYPE fogType, f32 start, - f32 end, f32 density, bool pixelFog, bool rangeFog) -{ - CNullDriver::setFog(color, fogType, start, end, density, pixelFog, rangeFog); - - EyeSpace.fog_scale = reciprocal_zero(FogEnd - FogStart); -} - - - -#if defined(SOFTWARE_DRIVER_2_LIGHTING) && BURNING_MATERIAL_MAX_COLORS > 0 - - -/*! - applies lighting model -*/ -void CBurningVideoDriver::lightVertex_eye(s4DVertex* dest, u32 vertexargb) -{ - //gl_FrontLightModelProduct.sceneColor = gl_FrontMaterial.emission + gl_FrontMaterial.ambient * gl_LightModel.ambient - - sVec3Color ambient; - sVec3Color diffuse; - sVec3Color specular; - - - // the universe started in darkness.. - ambient = EyeSpace.Global_AmbientLight; - diffuse.set(0.f); - specular.set(0.f); - - - u32 i; - f32 dot; - f32 distance; - f32 attenuation; - sVec4 vp; // unit vector vertex to light - sVec4 lightHalf; // blinn-phong reflection - - f32 spotDot; // cos of angle between spotlight and point on surface - - for (i = 0; i < EyeSpace.Light.size(); ++i) - { - const SBurningShaderLight& light = EyeSpace.Light[i]; - if (!light.LightIsOn) - continue; - - switch (light.Type) - { - case ELT_DIRECTIONAL: - - //angle between normal and light vector - dot = EyeSpace.normal.dot_xyz(light.spotDirection4); - - // accumulate ambient - ambient.add_rgb(light.AmbientColor); - - // diffuse component - if (dot > 0.f) - diffuse.mad_rgb(light.DiffuseColor, dot); - break; - - case ELT_POINT: - // surface to light - vp.x = light.pos4.x - EyeSpace.vertex.x; - vp.y = light.pos4.y - EyeSpace.vertex.y; - vp.z = light.pos4.z - EyeSpace.vertex.z; - - distance = vp.length_xyz(); - - attenuation = light.constantAttenuation - + light.linearAttenuation * distance - + light.quadraticAttenuation * (distance * distance); - attenuation = reciprocal_one(attenuation); - - //att = clamp(1.0 - dist/radius, 0.0, 1.0); att *= att - - // accumulate ambient - ambient.mad_rgb(light.AmbientColor, attenuation); - - // build diffuse reflection - - //angle between normal and light vector - vp.mul_xyz(reciprocal_zero(distance)); //normalize - dot = EyeSpace.normal.dot_xyz(vp); - if (dot <= 0.f) continue; - - // diffuse component - diffuse.mad_rgb(light.DiffuseColor, dot * attenuation); - - if (!(EyeSpace.TL_Flag & TL_SPECULAR)) - continue; - - lightHalf.x = vp.x + 0.f; // EyeSpace.cam_eye_pos.x; - lightHalf.y = vp.y + 0.f; // EyeSpace.cam_eye_pos.y; - lightHalf.z = vp.z - 1.f; // EyeSpace.cam_eye_pos.z; - lightHalf.normalize_dir_xyz(); - - //specular += light.SpecularColor * pow(max(dot(Eyespace.normal,lighthalf),0,Material.org.Shininess)*attenuation - specular.mad_rgb(light.SpecularColor, - powf_limit(EyeSpace.normal.dot_xyz(lightHalf), Material.org.Shininess) * attenuation - ); - break; - - case ELT_SPOT: - // surface to light - vp.x = light.pos4.x - EyeSpace.vertex.x; - vp.y = light.pos4.y - EyeSpace.vertex.y; - vp.z = light.pos4.z - EyeSpace.vertex.z; - - distance = vp.length_xyz(); - - //normalize - vp.mul_xyz(reciprocal_zero(distance)); - - // point on surface inside cone of illumination - spotDot = vp.dot_minus_xyz(light.spotDirection4); - if (spotDot < light.spotCosCutoff) - continue; - - attenuation = light.constantAttenuation - + light.linearAttenuation * distance - + light.quadraticAttenuation * distance * distance; - attenuation = reciprocal_one(attenuation); - attenuation *= powf_limit(spotDot, light.spotExponent); - - // accumulate ambient - ambient.mad_rgb(light.AmbientColor, attenuation); - - - // build diffuse reflection - //angle between normal and light vector - dot = EyeSpace.normal.dot_xyz(vp); - if (dot < 0.f) continue; - - // diffuse component - diffuse.mad_rgb(light.DiffuseColor, dot * attenuation); - - if (!(EyeSpace.TL_Flag & TL_SPECULAR)) - continue; - - lightHalf.x = vp.x + 0.f; // EyeSpace.cam_eye_pos.x; - lightHalf.y = vp.y + 0.f; // EyeSpace.cam_eye_pos.y; - lightHalf.z = vp.z - 1.f; // EyeSpace.cam_eye_pos.z; - lightHalf.normalize_dir_xyz(); - - //specular += light.SpecularColor * pow(max(dot(Eyespace.normal,lighthalf),0,Material.org.Shininess)*attenuation - specular.mad_rgb(light.SpecularColor, - powf_limit(EyeSpace.normal.dot_xyz(lightHalf), Material.org.Shininess) * attenuation - ); - break; - - default: - break; - } - - } - - // sum up lights - sVec3Color dColor; - dColor.set(0.f); - dColor.mad_rgbv(diffuse, Material.DiffuseColor); - - //diffuse * vertex color. - //has to move to shader (for vertex color only this will fit [except clamping]) - - sVec3Color c; - c.setA8R8G8B8(vertexargb); - dColor.r *= c.r; - dColor.g *= c.g; - dColor.b *= c.b; - - //separate specular -#if defined(SOFTWARE_DRIVER_2_USE_SEPARATE_SPECULAR_COLOR) - if ((VertexCache.vSize[VertexCache.vType].Format & VERTEX4D_FORMAT_COLOR_2_FOG)) - { - specular.sat_xyz(dest->Color[1], Material.SpecularColor); - } - else - if (!(EyeSpace.TL_Flag & TL_LIGHT0_IS_NORMAL_MAP) && - (VertexCache.vSize[VertexCache.vType].Format & VERTEX4D_FORMAT_MASK_LIGHT) - ) - { - specular.sat_xyz(dest->LightTangent[0], Material.SpecularColor); - } - else -#endif - { - dColor.mad_rgbv(specular, Material.SpecularColor); - } - - - dColor.mad_rgbv(ambient, Material.AmbientColor); - dColor.add_rgb(Material.EmissiveColor); - - - dColor.sat(dest->Color[0], vertexargb); - -} - -#endif -/* -CImage* getImage(const video::ITexture* texture) -{ - if (!texture) return 0; - - CImage* img = 0; - switch (texture->getDriverType()) - { - case EDT_BURNINGSVIDEO: - img = ((CSoftwareTexture2*)texture)->getImage(); - break; - case EDT_SOFTWARE: - img = ((CSoftwareTexture*)texture)->getImage(); - break; - default: - os::Printer::log("Fatal Error: Tried to copy from a surface not owned by this driver.", ELL_ERROR); - break; - } - return img; -} -*/ -/* - draw2DImage with single color scales into destination quad & cliprect(more like viewport) - draw2DImage with 4 color scales on destination and cliprect is scissor -*/ - -static const u16 quad_triangle_indexList[6] = { 0,1,2,0,2,3 }; - - -#if defined(SOFTWARE_DRIVER_2_2D_AS_2D) - -//! draws an 2d image, using a color (if color is other then Color(255,255,255,255)) and the alpha channel of the texture if wanted. -void CBurningVideoDriver::draw2DImage(const video::ITexture* texture, const core::position2d<s32>& destPos, - const core::rect<s32>& sourceRect, - const core::rect<s32>* clipRect, SColor color, - bool useAlphaChannelOfTexture) -{ - if (texture) - { - if (texture->getOriginalSize() != texture->getSize()) - { - core::rect<s32> destRect(destPos, sourceRect.getSize()); - SColor c4[4] = { color,color,color,color }; - draw2DImage(texture, destRect, sourceRect, clipRect, c4, useAlphaChannelOfTexture); - return; - } - - if (texture->getDriverType() != EDT_BURNINGSVIDEO) - { - os::Printer::log("Fatal Error: Tried to copy from a surface not owned by this driver.", ELL_ERROR); - return; - } - - if (useAlphaChannelOfTexture) - ((CSoftwareTexture2*)texture)->getImage()->copyToWithAlpha( - RenderTargetSurface, destPos, sourceRect, color, clipRect); - else - ((CSoftwareTexture2*)texture)->getImage()->copyTo( - RenderTargetSurface, destPos, sourceRect, clipRect); - } -} - - -//! Draws a part of the texture into the rectangle. -void CBurningVideoDriver::draw2DImage(const video::ITexture* texture, const core::rect<s32>& destRect, - const core::rect<s32>& sourceRect, const core::rect<s32>* clipRect, - const video::SColor* const colors, bool useAlphaChannelOfTexture) -{ - if (texture) - { - if (texture->getDriverType() != EDT_BURNINGSVIDEO) - { - os::Printer::log("Fatal Error: Tried to copy from a surface not owned by this driver.", ELL_ERROR); - return; - } - - u32 argb = (colors ? colors[0].color : 0xFFFFFFFF); - eBlitter op = useAlphaChannelOfTexture ? - (argb == 0xFFFFFFFF ? BLITTER_TEXTURE_ALPHA_BLEND : BLITTER_TEXTURE_ALPHA_COLOR_BLEND) : BLITTER_TEXTURE; - - StretchBlit(op, RenderTargetSurface, clipRect, &destRect, - ((CSoftwareTexture2*)texture)->getImage(), &sourceRect, &texture->getOriginalSize(), argb); - - } -} - -//!Draws an 2d rectangle with a gradient. -void CBurningVideoDriver::draw2DRectangle(const core::rect<s32>& position, - SColor colorLeftUp, SColor colorRightUp, SColor colorLeftDown, SColor colorRightDown, - const core::rect<s32>* clip) -{ - core::rect<s32> p(position); - if (clip) p.clipAgainst(*clip); - if (p.isValid()) drawRectangle(RenderTargetSurface, p, colorLeftUp); -} - -#endif //defined(SOFTWARE_DRIVER_2_2D_AS_2D) - - - -//! Enable the 2d override material -void CBurningVideoDriver::enableMaterial2D(bool enable) -{ - CNullDriver::enableMaterial2D(enable); - burning_setbit(TransformationFlag[1][ETS_PROJECTION], 0, ETF_VALID); -} - -size_t compare_2d_material(const SMaterial& a, const SMaterial& b) -{ - size_t flag = 0; - flag |= a.MaterialType == b.MaterialType ? 0 : 1; - flag |= a.ZBuffer == b.ZBuffer ? 0 : 2; - flag |= a.TextureLayer[0].Texture == b.TextureLayer[0].Texture ? 0 : 4; - flag |= a.TextureLayer[0].BilinearFilter == b.TextureLayer[0].BilinearFilter ? 0 : 8; - flag |= a.MaterialTypeParam == b.MaterialTypeParam ? 0 : 16; - if (flag) return flag; - - flag |= a.TextureLayer[1].Texture == b.TextureLayer[1].Texture ? 0 : 32; - flag |= a.ZWriteEnable == b.ZWriteEnable ? 0 : 64; - - return flag; -} - -void CBurningVideoDriver::setRenderStates2DMode(const video::SColor& color, const video::ITexture* texture, bool useAlphaChannelOfTexture) -{ - //save current 3D Material - //Material.save3D = Material.org; - - //build new 2D Material - - bool vertexAlpha = color.getAlpha() < 255; - - //2D uses textureAlpa*vertexAlpha 3D not.. - if (useAlphaChannelOfTexture && texture && texture->hasAlpha()) - { - Material.mat2D.MaterialType = EMT_TRANSPARENT_ALPHA_CHANNEL; - } - else if (vertexAlpha) - { - Material.mat2D.MaterialType = EMT_TRANSPARENT_VERTEX_ALPHA; - } - else - { - Material.mat2D.MaterialType = EMT_SOLID; - } - - Material.mat2D.ZBuffer = ECFN_DISABLED; - Material.mat2D.ZWriteEnable = EZW_OFF; - Material.mat2D.Lighting = false; - - Material.mat2D.setTexture(0, (video::ITexture*)texture); - - //used for text. so stay as sharp as possible (like HW Driver) - bool mip = false; - - const SMaterial& currentMaterial = (!OverrideMaterial2DEnabled) ? InitMaterial2D : OverrideMaterial2D; - mip = currentMaterial.TextureLayer[0].Texture && currentMaterial.TextureLayer[0].BilinearFilter; - - Material.mat2D.setFlag(video::EMF_BILINEAR_FILTER, mip); - - - //switch to 2D Matrix Stack [ Material set Texture Matrix ] - TransformationStack = 1; - - //2D GUI Matrix - if (!(TransformationFlag[TransformationStack][ETS_PROJECTION] & ETF_VALID)) - { - const core::dimension2d<u32>& renderTargetSize = getCurrentRenderTargetSize(); - core::matrix4 m(core::matrix4::EM4CONST_NOTHING); - m.buildProjectionMatrixOrthoLH(f32(renderTargetSize.Width), f32(-(s32)(renderTargetSize.Height)), -1.0f, 1.0f); - m.setTranslation(core::vector3df(-1.f, 1.f, 0)); - setTransform(ETS_PROJECTION, m); - - m.makeIdentity(); - setTransform(ETS_WORLD, m); - - if (mip) - m.setTranslation(core::vector3df(IRRLICHT_2D_TEXEL_OFFSET, IRRLICHT_2D_TEXEL_OFFSET, 0.0f)); - - setTransform(ETS_VIEW, m); - - //Tweak 2D Pixel Center for openGL compatibility (guessing) - //buildNDCToDCMatrix(Transformation_ETS_CLIPSCALE[TransformationStack], ViewPort, mip ? (IRRLICHT_2D_TEXEL_OFFSET) * 0.5f : 0.f); - } - - //compare - if (compare_2d_material(Material.org, Material.mat2D)) - { - setMaterial(Material.mat2D); - } - if (CurrentShader) - { - CurrentShader->setPrimitiveColor(color.color); - CurrentShader->setTLFlag(EyeSpace.TL_Flag); - if (EyeSpace.TL_Flag & TL_SCISSOR) CurrentShader->setScissor(Scissor); - } - -} - -void CBurningVideoDriver::setRenderStates3DMode() -{ - //restoreRenderStates3DMode - - //setMaterial(Material.save3D); - //switch to 3D Matrix Stack - TransformationStack = 0; -} - -//! draws a vertex primitive list in 2d -void CBurningVideoDriver::draw2DVertexPrimitiveList(const void* vertices, u32 vertexCount, - const void* indexList, u32 primitiveCount, - E_VERTEX_TYPE vType, scene::E_PRIMITIVE_TYPE pType, E_INDEX_TYPE iType) -{ - if (!checkPrimitiveCount(primitiveCount)) - return; - - CNullDriver::draw2DVertexPrimitiveList(vertices, vertexCount, indexList, primitiveCount, vType, pType, iType); - - bool useAlphaChannelOfTexture = false; - video::SColor color(0xFFFFFFFF); - switch (Material.org.MaterialType) - { - case EMT_TRANSPARENT_ALPHA_CHANNEL: - useAlphaChannelOfTexture = true; - break; - case EMT_TRANSPARENT_VERTEX_ALPHA: - color.setAlpha(127); - break; - default: - break; - } - setRenderStates2DMode(color, Material.org.getTexture(0), useAlphaChannelOfTexture); - - drawVertexPrimitiveList(vertices, vertexCount, - indexList, primitiveCount, - vType, pType, iType); - - setRenderStates3DMode(); - -} - -//setup a quad -#if defined(SOFTWARE_DRIVER_2_2D_AS_3D) - -//! draws an 2d image, using a color (if color is other then Color(255,255,255,255)) and the alpha channel of the texture if wanted. -void CBurningVideoDriver::draw2DImage(const video::ITexture* texture, const core::position2d<s32>& destPos, - const core::rect<s32>& sourceRect, - const core::rect<s32>* clipRect, SColor color, - bool useAlphaChannelOfTexture) -{ - if (!texture) - return; - - if (!sourceRect.isValid()) - return; - - // clip these coordinates - core::rect<s32> targetRect(destPos, sourceRect.getSize()); - if (clipRect) - { - targetRect.clipAgainst(*clipRect); - if (targetRect.getWidth() < 0 || targetRect.getHeight() < 0) - return; - } - - const core::dimension2d<u32>& renderTargetSize = getCurrentRenderTargetSize(); - targetRect.clipAgainst(core::rect<s32>(0, 0, (s32)renderTargetSize.Width, (s32)renderTargetSize.Height)); - if (targetRect.getWidth() < 0 || targetRect.getHeight() < 0) - return; - - // ok, we've clipped everything. - // now draw it. - const core::dimension2d<s32> sourceSize(targetRect.getSize()); - const core::position2d<s32> sourcePos(sourceRect.UpperLeftCorner + (targetRect.UpperLeftCorner - destPos)); - - const core::dimension2d<u32>& tex_orgsize = texture->getOriginalSize(); - const f32 invW = 1.f / static_cast<f32>(tex_orgsize.Width); - const f32 invH = 1.f / static_cast<f32>(tex_orgsize.Height); - const core::rect<f32> tcoords( - sourcePos.X * invW, - sourcePos.Y * invH, - (sourcePos.X + sourceSize.Width) * invW, - (sourcePos.Y + sourceSize.Height) * invH); - - - Quad2DVertices[0].Color = color; - Quad2DVertices[1].Color = color; - Quad2DVertices[2].Color = color; - Quad2DVertices[3].Color = color; - - Quad2DVertices[0].Pos = core::vector3df((f32)targetRect.UpperLeftCorner.X, (f32)targetRect.UpperLeftCorner.Y, 0.0f); - Quad2DVertices[1].Pos = core::vector3df((f32)targetRect.LowerRightCorner.X, (f32)targetRect.UpperLeftCorner.Y, 0.0f); - Quad2DVertices[2].Pos = core::vector3df((f32)targetRect.LowerRightCorner.X, (f32)targetRect.LowerRightCorner.Y, 0.0f); - Quad2DVertices[3].Pos = core::vector3df((f32)targetRect.UpperLeftCorner.X, (f32)targetRect.LowerRightCorner.Y, 0.0f); - - Quad2DVertices[0].TCoords = core::vector2df(tcoords.UpperLeftCorner.X, tcoords.UpperLeftCorner.Y); - Quad2DVertices[1].TCoords = core::vector2df(tcoords.LowerRightCorner.X, tcoords.UpperLeftCorner.Y); - Quad2DVertices[2].TCoords = core::vector2df(tcoords.LowerRightCorner.X, tcoords.LowerRightCorner.Y); - Quad2DVertices[3].TCoords = core::vector2df(tcoords.UpperLeftCorner.X, tcoords.LowerRightCorner.Y); - - setRenderStates2DMode(color, texture, useAlphaChannelOfTexture); - - drawVertexPrimitiveList(Quad2DVertices, 4, - quad_triangle_indexList, 2, - EVT_STANDARD, scene::EPT_TRIANGLES, EIT_16BIT); - - setRenderStates3DMode(); - -} - - -//! Draws a part of the texture into the rectangle. -void CBurningVideoDriver::draw2DImage(const video::ITexture* texture, const core::rect<s32>& destRect, - const core::rect<s32>& sourceRect, const core::rect<s32>* clipRect, - const video::SColor* const colors, bool useAlphaChannelOfTexture) -{ - const core::dimension2d<u32>& st = texture->getOriginalSize(); - const f32 invW = 1.f / static_cast<f32>(st.Width); - const f32 invH = 1.f / static_cast<f32>(st.Height); - const core::rect<f32> tcoords( - sourceRect.UpperLeftCorner.X * invW, - sourceRect.UpperLeftCorner.Y * invH, - sourceRect.LowerRightCorner.X * invW, - sourceRect.LowerRightCorner.Y * invH); - - const video::SColor temp[4] = - { - 0xFFFFFFFF, - 0xFFFFFFFF, - 0xFFFFFFFF, - 0xFFFFFFFF - }; - - const video::SColor* const useColor = colors ? colors : temp; - - - Quad2DVertices[0].Color = useColor[0]; - Quad2DVertices[1].Color = useColor[3]; - Quad2DVertices[2].Color = useColor[2]; - Quad2DVertices[3].Color = useColor[1]; - - Quad2DVertices[0].Pos = core::vector3df((f32)destRect.UpperLeftCorner.X, (f32)destRect.UpperLeftCorner.Y, 0.0f); - Quad2DVertices[1].Pos = core::vector3df((f32)destRect.LowerRightCorner.X, (f32)destRect.UpperLeftCorner.Y, 0.0f); - Quad2DVertices[2].Pos = core::vector3df((f32)destRect.LowerRightCorner.X, (f32)destRect.LowerRightCorner.Y, 0.0f); - Quad2DVertices[3].Pos = core::vector3df((f32)destRect.UpperLeftCorner.X, (f32)destRect.LowerRightCorner.Y, 0.0f); - - Quad2DVertices[0].TCoords = core::vector2df(tcoords.UpperLeftCorner.X, tcoords.UpperLeftCorner.Y); - Quad2DVertices[1].TCoords = core::vector2df(tcoords.LowerRightCorner.X, tcoords.UpperLeftCorner.Y); - Quad2DVertices[2].TCoords = core::vector2df(tcoords.LowerRightCorner.X, tcoords.LowerRightCorner.Y); - Quad2DVertices[3].TCoords = core::vector2df(tcoords.UpperLeftCorner.X, tcoords.LowerRightCorner.Y); - - - if (clipRect) - { - if (!clipRect->isValid()) - return; - - //glEnable(GL_SCISSOR_TEST); - EyeSpace.TL_Flag |= TL_SCISSOR; - setScissor(clipRect->UpperLeftCorner.X, clipRect->UpperLeftCorner.Y,//renderTargetSize.Height - clipRect->LowerRightCorner.Y - clipRect->getWidth(), clipRect->getHeight()); - } - - video::SColor alphaTest; - alphaTest.color = useColor[0].color & useColor[0].color & useColor[0].color & useColor[0].color; - - - setRenderStates2DMode(alphaTest,texture, useAlphaChannelOfTexture); - - drawVertexPrimitiveList(Quad2DVertices, 4, - quad_triangle_indexList, 2, - EVT_STANDARD, scene::EPT_TRIANGLES, EIT_16BIT); - - if (clipRect) - EyeSpace.TL_Flag &= ~TL_SCISSOR; - - setRenderStates3DMode(); - -} - - -//!Draws an 2d rectangle with a gradient. -void CBurningVideoDriver::draw2DRectangle(const core::rect<s32>& position, - SColor colorLeftUp, SColor colorRightUp, SColor colorLeftDown, SColor colorRightDown, - const core::rect<s32>* clip) -{ - core::rect<s32> pos = position; - - if (clip) - pos.clipAgainst(*clip); - - if (!pos.isValid()) - return; - - Quad2DVertices[0].Color = colorLeftUp; - Quad2DVertices[1].Color = colorRightUp; - Quad2DVertices[2].Color = colorRightDown; - Quad2DVertices[3].Color = colorLeftDown; - - Quad2DVertices[0].Pos = core::vector3df((f32)pos.UpperLeftCorner.X, (f32)pos.UpperLeftCorner.Y, 0.0f); - Quad2DVertices[1].Pos = core::vector3df((f32)pos.LowerRightCorner.X, (f32)pos.UpperLeftCorner.Y, 0.0f); - Quad2DVertices[2].Pos = core::vector3df((f32)pos.LowerRightCorner.X, (f32)pos.LowerRightCorner.Y, 0.0f); - Quad2DVertices[3].Pos = core::vector3df((f32)pos.UpperLeftCorner.X, (f32)pos.LowerRightCorner.Y, 0.0f); - - Quad2DVertices[0].TCoords.X = 0.f; - Quad2DVertices[0].TCoords.Y = 0.f; - Quad2DVertices[1].TCoords.X = 0.f; - Quad2DVertices[1].TCoords.Y = 0.f; - Quad2DVertices[2].TCoords.X = 0.f; - Quad2DVertices[3].TCoords.Y = 0.f; - Quad2DVertices[3].TCoords.X = 0.f; - Quad2DVertices[3].TCoords.Y = 0.f; - - - video::SColor alphaTest; - alphaTest.color = colorLeftUp.color & colorRightUp.color & colorRightDown.color & colorLeftDown.color; - setRenderStates2DMode(alphaTest, 0, 0); - - drawVertexPrimitiveList(Quad2DVertices, 4, - quad_triangle_indexList, 2, - EVT_STANDARD, scene::EPT_TRIANGLES, EIT_16BIT); - - setRenderStates3DMode(); - -} - - -#endif // SOFTWARE_DRIVER_2_2D_AS_3D - - - - - -//! Draws a 2d line. -void CBurningVideoDriver::draw2DLine(const core::position2d<s32>& start, - const core::position2d<s32>& end, - SColor color) -{ - drawLine(RenderTargetSurface, start, end, color); -} - - -//! Draws a pixel -void CBurningVideoDriver::drawPixel(u32 x, u32 y, const SColor& color) -{ - RenderTargetSurface->setPixel(x, y, color, true); -} - - -//! Only used by the internal engine. Used to notify the driver that -//! the window was resized. -void CBurningVideoDriver::OnResize(const core::dimension2d<u32>& size) -{ - // make sure width and height are multiples of 2 - core::dimension2d<u32> realSize(size); - /* - if (realSize.Width % 2) - realSize.Width += 1; - - if (realSize.Height % 2) - realSize.Height += 1; - */ - if (ScreenSize != realSize) - { - if (ViewPort.getWidth() == (s32)ScreenSize.Width && - ViewPort.getHeight() == (s32)ScreenSize.Height) - { - ViewPort.UpperLeftCorner.X = 0; - ViewPort.UpperLeftCorner.Y = 0; - ViewPort.LowerRightCorner.X = realSize.Width; - ViewPort.LowerRightCorner.X = realSize.Height; - } - - ScreenSize = realSize; - - bool resetRT = (RenderTargetSurface == BackBuffer); - - if (BackBuffer) - BackBuffer->drop(); - BackBuffer = new CImage(SOFTWARE_DRIVER_2_RENDERTARGET_COLOR_FORMAT, realSize); - - if (resetRT) - setRenderTargetImage2(BackBuffer); - } -} - - -//! returns the current render target size -const core::dimension2d<u32>& CBurningVideoDriver::getCurrentRenderTargetSize() const -{ - return (RenderTargetSurface == BackBuffer) ? ScreenSize : RenderTargetSize; -} - - - -//! Draws a 3d line. -void CBurningVideoDriver::draw3DLine(const core::vector3df& start, - const core::vector3df& end, SColor color_start) -{ - SColor color_end = color_start; - - VertexCache.primitiveHasVertex = 2; - VertexCache.vType = E4VT_LINE; - - s4DVertex* v = Clipper.data; - - transform_calc(ETS_PROJ_MODEL_VIEW); - const core::matrix4* matrix = Transformation[TransformationStack]; - matrix[ETS_PROJ_MODEL_VIEW].transformVect(&v[s4DVertex_ofs(0)].Pos.x, start); - matrix[ETS_PROJ_MODEL_VIEW].transformVect(&v[s4DVertex_ofs(1)].Pos.x, end); - -#if BURNING_MATERIAL_MAX_COLORS > 0 - v[s4DVertex_ofs(0)].Color[0].setA8R8G8B8(color_start.color); - v[s4DVertex_ofs(1)].Color[0].setA8R8G8B8(color_end.color); -#endif - - size_t has_vertex_run; - for (has_vertex_run = 0; has_vertex_run < VertexCache.primitiveHasVertex; has_vertex_run += 1) - { - v[s4DVertex_ofs(has_vertex_run)].flag = (u32)(VertexCache.vSize[VertexCache.vType].Format); - v[s4DVertex_proj(has_vertex_run)].flag = v[s4DVertex_ofs(has_vertex_run)].flag; - } - - - size_t vOut; - - // vertices count per line - vOut = clipToFrustum(VertexCache.primitiveHasVertex); - if (vOut < VertexCache.primitiveHasVertex) - return; - - // to DC Space, project homogenous vertex - ndc_2_dc_and_project(v + s4DVertex_proj(0), v+ s4DVertex_ofs(0), s4DVertex_ofs(vOut)); - - // unproject vertex color -#if 0 -#if BURNING_MATERIAL_MAX_COLORS > 0 - for (g = 0; g != vOut; g += 2) - { - v[g + 1].Color[0].setA8R8G8B8(color.color); - } -#endif -#endif - - IBurningShader* shader = 0; - if (CurrentShader && CurrentShader->canWireFrame()) shader = CurrentShader; - else shader = BurningShader[ETR_TEXTURE_GOURAUD_WIRE]; - shader = BurningShader[ETR_TEXTURE_GOURAUD_WIRE]; - - shader->pushEdgeTest(1, 0, 1); - shader->setRenderTarget(RenderTargetSurface, ViewPort, Interlaced); - - for (has_vertex_run = 0; (has_vertex_run + VertexCache.primitiveHasVertex) <= vOut; has_vertex_run += 1) - { - shader->drawLine(v + s4DVertex_proj(has_vertex_run), v + s4DVertex_proj(has_vertex_run+1)); - } - - shader->popEdgeTest(); - -} - - -//! \return Returns the name of the video driver. Example: In case of the DirectX8 -//! driver, it would return "Direct3D8.1". -const wchar_t* CBurningVideoDriver::getName() const -{ -#ifdef BURNINGVIDEO_RENDERER_BEAUTIFUL - return L"Burning's Video 0.52 beautiful"; -#elif defined ( BURNINGVIDEO_RENDERER_ULTRA_FAST ) - return L"Burning's Video 0.52 ultra fast"; -#elif defined ( BURNINGVIDEO_RENDERER_FAST ) - return L"Burning's Video 0.52 fast"; -#elif defined ( BURNINGVIDEO_RENDERER_CE ) - return L"Burning's Video 0.52 CE"; -#else - return L"Burning's Video 0.52"; -#endif -} - -//! Returns the graphics card vendor name. -core::stringc CBurningVideoDriver::getVendorInfo() -{ - return "Burning's Video: Ing. Thomas Alten (c) 2006-2020"; -} - - -//! Returns type of video driver -E_DRIVER_TYPE CBurningVideoDriver::getDriverType() const -{ - return EDT_BURNINGSVIDEO; -} - - -//! returns color format -ECOLOR_FORMAT CBurningVideoDriver::getColorFormat() const -{ - return BackBuffer ? BackBuffer->getColorFormat() : CNullDriver::getColorFormat(); -} - - -//! Creates a render target texture. -ITexture* CBurningVideoDriver::addRenderTargetTexture(const core::dimension2d<u32>& size, - const io::path& name, const ECOLOR_FORMAT format -#if defined(PATCH_SUPERTUX_8_0_1_with_1_9_0) - , const bool useStencil -#endif -) -{ - //IImage* img = createImage(SOFTWARE_DRIVER_2_RENDERTARGET_COLOR_FORMAT, size); - //empty proxy image - IImage* img = createImageFromData(format, size, 0, true, false); - ITexture* tex = new CSoftwareTexture2(img, name, CSoftwareTexture2::IS_RENDERTARGET /*| CSoftwareTexture2::GEN_MIPMAP */, this); - if ( img ) img->drop(); - addTexture(tex); - tex->drop(); - return tex; -} - -void CBurningVideoDriver::clearBuffers(u16 flag, SColor color, f32 depth, u8 stencil) -{ - if ((flag & ECBF_COLOR) && RenderTargetSurface) image_fill(RenderTargetSurface, color, Interlaced); - if ((flag & ECBF_DEPTH) && DepthBuffer) DepthBuffer->clear(depth, Interlaced); - if ((flag & ECBF_STENCIL) && StencilBuffer) StencilBuffer->clear(stencil, Interlaced); -} - -#if 0 -void CBurningVideoDriver::saveBuffer() -{ - static int shotCount = 0; - char buf[256]; - if (BackBuffer) - { - sprintf(buf, "shot/%04d_b.png", shotCount); - writeImageToFile(BackBuffer, buf); - } - if (StencilBuffer) - { - CImage stencil(ECF_A8R8G8B8, StencilBuffer->getSize(), StencilBuffer->lock(), true, false); - sprintf(buf, "shot/%04d_s.ppm", shotCount); - writeImageToFile(&stencil, buf); - } - shotCount += 1; -} -#endif - -//! Returns an image created from the last rendered frame. -IImage* CBurningVideoDriver::createScreenShot(video::ECOLOR_FORMAT format, video::E_RENDER_TARGET target) -{ - if (target != video::ERT_FRAME_BUFFER) - return 0; - - if (BackBuffer) - { - IImage* tmp = createImage(BackBuffer->getColorFormat(), BackBuffer->getDimension()); - BackBuffer->copyTo(tmp); - return tmp; - } - else - return 0; -} - -ITexture* CBurningVideoDriver::createDeviceDependentTexture(const io::path& name, IImage* image) -{ - u32 flags = - ((TextureCreationFlags & ETCF_CREATE_MIP_MAPS) ? CSoftwareTexture2::GEN_MIPMAP : 0) -#if defined(PATCH_SUPERTUX_8_0_1_with_1_9_0) - | CSoftwareTexture2::GEN_MIPMAP_AUTO -#else - | ((TextureCreationFlags & ETCF_AUTO_GENERATE_MIP_MAPS) ? CSoftwareTexture2::GEN_MIPMAP_AUTO : 0) -#endif - | ((TextureCreationFlags & ETCF_ALLOW_NON_POWER_2) ? CSoftwareTexture2::ALLOW_NPOT : 0) -#if defined(IRRLICHT_sRGB) - | ((TextureCreationFlags & ETCF_IMAGE_IS_LINEAR) ? CSoftwareTexture2::IMAGE_IS_LINEAR : 0) - | ((TextureCreationFlags & ETCF_TEXTURE_IS_LINEAR) ? CSoftwareTexture2::TEXTURE_IS_LINEAR : 0) -#endif - ; - - CSoftwareTexture2* texture = new CSoftwareTexture2(image, name, flags, this); - return texture; -} - -ITexture* CBurningVideoDriver::createDeviceDependentTextureCubemap(const io::path& name, const core::array<IImage*>& image) -{ - return 0; -} - -//! Returns the maximum amount of primitives (mostly vertices) which -//! the device is able to render with one drawIndexedTriangleList -//! call. -u32 CBurningVideoDriver::getMaximalPrimitiveCount() const -{ - return 0x7FFFFFFF; -} - - -//! Draws a shadow volume into the stencil buffer. To draw a stencil shadow, do -//! this: First, draw all geometry. Then use this method, to draw the shadow -//! volume. Next use IVideoDriver::drawStencilShadow() to visualize the shadow. -void CBurningVideoDriver::drawStencilShadowVolume(const core::array<core::vector3df>& triangles, bool zfail, u32 debugDataVisible) -{ - const u32 count = triangles.size(); - if (!StencilBuffer || !count) - return; - - Material.org.MaterialType = video::EMT_SOLID; - Material.org.Lighting = false; - Material.org.ZWriteEnable = video::EZW_OFF; - Material.org.ZBuffer = ECFN_LESS; - - CurrentShader = BurningShader[ETR_STENCIL_SHADOW]; - - CurrentShader->setRenderTarget(RenderTargetSurface, ViewPort, Interlaced); - CurrentShader->pushEdgeTest(Material.org.Wireframe, 0, 0); - - //setMaterial - EyeSpace.TL_Flag &= ~(TL_TEXTURE_TRANSFORM | TL_LIGHT0_IS_NORMAL_MAP); - CurrentShader->setTLFlag(EyeSpace.TL_Flag); - //glStencilMask(~0); - //glStencilFunc(GL_ALWAYS, 0, ~0); - - //glEnable(GL_DEPTH_CLAMP); - - if (zfail) - { - Material.org.BackfaceCulling = false; - Material.org.FrontfaceCulling = true; - Material.CullFlag = CULL_FRONT | CULL_INVISIBLE; - - CurrentShader->setStencilOp(StencilOp_KEEP, StencilOp_INCR, StencilOp_KEEP); - drawVertexPrimitiveList(triangles.const_pointer(), count, 0, count / 3, (video::E_VERTEX_TYPE) E4VT_SHADOW, scene::EPT_TRIANGLES, (video::E_INDEX_TYPE) E4IT_NONE); - - Material.org.BackfaceCulling = true; - Material.org.FrontfaceCulling = false; - Material.CullFlag = CULL_BACK | CULL_INVISIBLE; - - CurrentShader->setStencilOp(StencilOp_KEEP, StencilOp_DECR, StencilOp_KEEP); - drawVertexPrimitiveList(triangles.const_pointer(), count, 0, count / 3, (video::E_VERTEX_TYPE) E4VT_SHADOW, scene::EPT_TRIANGLES, (video::E_INDEX_TYPE) E4IT_NONE); - } - else // zpass - { - Material.org.BackfaceCulling = true; - Material.org.FrontfaceCulling = false; - Material.CullFlag = CULL_BACK | CULL_INVISIBLE; - - CurrentShader->setStencilOp(StencilOp_KEEP, StencilOp_KEEP, StencilOp_INCR); - drawVertexPrimitiveList(triangles.const_pointer(), count, 0, count / 3, (video::E_VERTEX_TYPE) E4VT_SHADOW, scene::EPT_TRIANGLES, (video::E_INDEX_TYPE) E4IT_NONE); - - Material.org.BackfaceCulling = false; - Material.org.FrontfaceCulling = true; - Material.CullFlag = CULL_FRONT | CULL_INVISIBLE; - - CurrentShader->setStencilOp(StencilOp_KEEP, StencilOp_KEEP, StencilOp_DECR); - drawVertexPrimitiveList(triangles.const_pointer(), count, 0, count / 3, (video::E_VERTEX_TYPE) E4VT_SHADOW, scene::EPT_TRIANGLES, (video::E_INDEX_TYPE) E4IT_NONE); - } - //glDisable(GL_DEPTH_CLAMP); - -} - -//! Fills the stencil shadow with color. After the shadow volume has been drawn -//! into the stencil buffer using IVideoDriver::drawStencilShadowVolume(), use this -//! to draw the color of the shadow. -void CBurningVideoDriver::drawStencilShadow(bool clearStencilBuffer, video::SColor leftUpEdge, - video::SColor rightUpEdge, video::SColor leftDownEdge, video::SColor rightDownEdge) -{ - if (!StencilBuffer) - return; - - // draw a shadow rectangle covering the entire screen using stencil buffer - const u32 h = RenderTargetSurface->getDimension().Height; - const u32 w = RenderTargetSurface->getDimension().Width; - - const bool bit32 = RenderTargetSurface->getColorFormat() == ECF_A8R8G8B8; - const tVideoSample alpha = extractAlpha(leftUpEdge.color) >> (bit32 ? 0 : 3); - const tVideoSample src = bit32 ? leftUpEdge.color : video::A8R8G8B8toA1R5G5B5(leftUpEdge.color); - - interlace_scanline_data line; - for (line.y = 0; line.y < h; line.y += SOFTWARE_DRIVER_2_STEP_Y) - { - interlace_scanline - { - tVideoSample * dst = (tVideoSample*)RenderTargetSurface->getData() + (line.y * w); - const tStencilSample* stencil = (tStencilSample*)StencilBuffer->lock() + (line.y * w); - - if (bit32) - { - for (u32 x = 0; x < w; x += SOFTWARE_DRIVER_2_STEP_X) - { - if (stencil[x]) dst[x] = PixelBlend32(dst[x], src, alpha); - } - } - else - { - for (u32 x = 0; x < w; x += SOFTWARE_DRIVER_2_STEP_X) - { - if (stencil[x]) dst[x] = PixelBlend16(dst[x], src, alpha); - } - } - - } - } - - if (clearStencilBuffer) - StencilBuffer->clear(0, Interlaced); -} - - -core::dimension2du CBurningVideoDriver::getMaxTextureSize() const -{ - return core::dimension2du(SOFTWARE_DRIVER_2_TEXTURE_MAXSIZE, SOFTWARE_DRIVER_2_TEXTURE_MAXSIZE); -} - -bool CBurningVideoDriver::queryTextureFormat(ECOLOR_FORMAT format) const -{ - return format == SOFTWARE_DRIVER_2_RENDERTARGET_COLOR_FORMAT || format == SOFTWARE_DRIVER_2_TEXTURE_COLOR_FORMAT; -} - -#if !defined(PATCH_SUPERTUX_8_0_1_with_1_9_0) -bool CBurningVideoDriver::needsTransparentRenderPass(const irr::video::SMaterial& material) const -{ - return CNullDriver::needsTransparentRenderPass(material) || material.isAlphaBlendOperation(); // || material.isTransparent(); -} -#endif - -s32 CBurningVideoDriver::addShaderMaterial(const c8* vertexShaderProgram, - const c8* pixelShaderProgram, - IShaderConstantSetCallBack* callback, - E_MATERIAL_TYPE baseMaterial, - s32 userData) -{ - s32 materialID = -1; - - IBurningShader* shader = new IBurningShader( - this, materialID, - vertexShaderProgram, 0, video::EVST_VS_1_1, - pixelShaderProgram, 0, video::EPST_PS_1_1, - 0, 0, EGST_GS_4_0, - scene::EPT_TRIANGLES, scene::EPT_TRIANGLE_STRIP, 0, - callback, baseMaterial, userData); - - shader->drop(); - - return materialID; -} - -//! Adds a new material renderer to the VideoDriver, based on a high level shading language. -s32 CBurningVideoDriver::addHighLevelShaderMaterial( - const c8* vertexShaderProgram, - const c8* vertexShaderEntryPointName, - E_VERTEX_SHADER_TYPE vsCompileTarget, - const c8* pixelShaderProgram, - const c8* pixelShaderEntryPointName, - E_PIXEL_SHADER_TYPE psCompileTarget, - const c8* geometryShaderProgram, - const c8* geometryShaderEntryPointName, - E_GEOMETRY_SHADER_TYPE gsCompileTarget, - scene::E_PRIMITIVE_TYPE inType, - scene::E_PRIMITIVE_TYPE outType, - u32 verticesOut, - IShaderConstantSetCallBack* callback, - E_MATERIAL_TYPE baseMaterial, - s32 userData -#if defined(PATCH_SUPERTUX_8_0_1_with_1_9_0) - , E_GPU_SHADING_LANGUAGE shadingLang -#endif -) -{ - s32 materialID = -1; - - IBurningShader* shader = new IBurningShader( - this, materialID, - vertexShaderProgram, vertexShaderEntryPointName, vsCompileTarget, - pixelShaderProgram, pixelShaderEntryPointName, psCompileTarget, - geometryShaderProgram, geometryShaderEntryPointName, gsCompileTarget, - inType, outType, verticesOut, - callback, baseMaterial, userData); - - shader->drop(); - - return materialID; -} - - -void CBurningVideoDriver::setFallback_Material(E_MATERIAL_TYPE fallback_MaterialType) -{ - //this should be in material.... - Material.Fallback_MaterialType = fallback_MaterialType; -} - -void CBurningVideoDriver::setBasicRenderStates(const SMaterial& material, - const SMaterial& lastMaterial, - bool resetAllRenderstates) -{ - -} - -//! Return an index constant for the vertex shader based on a name. -s32 CBurningVideoDriver::getVertexShaderConstantID(const c8* name) -{ - return -1; -} - -bool CBurningVideoDriver::setVertexShaderConstant(s32 index, const f32* floats, int count) -{ - return true; -} - -bool CBurningVideoDriver::setVertexShaderConstant(s32 index, const s32* ints, int count) -{ - return true; -} - -bool CBurningVideoDriver::setVertexShaderConstant(s32 index, const u32* ints, int count) -{ - return true; -} - -void CBurningVideoDriver::setVertexShaderConstant(const f32* data, s32 startRegister, s32 constantAmount) -{ -} - -//! Return an index constant for the pixel shader based on a name. -s32 CBurningVideoDriver::getPixelShaderConstantID(const c8* name) -{ - return -1; -} - -bool CBurningVideoDriver::setPixelShaderConstant(s32 index, const f32* floats, int count) -{ - return false; -} - -bool CBurningVideoDriver::setPixelShaderConstant(s32 index, const s32* ints, int count) -{ - return false; -} - -bool CBurningVideoDriver::setPixelShaderConstant(s32 index, const u32* ints, int count) -{ - return false; -} - -void CBurningVideoDriver::setPixelShaderConstant(const f32* data, s32 startRegister, s32 constantAmount = 1) -{ -} - -//! Get pointer to the IVideoDriver interface -/** \return Pointer to the IVideoDriver interface */ -IVideoDriver* CBurningVideoDriver::getVideoDriver() -{ - return this; -} - -} // end namespace video -} // end namespace irr - -#endif // _IRR_COMPILE_WITH_BURNINGSVIDEO_ - - -namespace irr -{ -namespace video -{ - -//! creates a video driver -IVideoDriver* createBurningVideoDriver(const irr::SIrrlichtCreationParameters& params, io::IFileSystem* io, video::IImagePresenter* presenter) -{ -#ifdef _IRR_COMPILE_WITH_BURNINGSVIDEO_ - return new CBurningVideoDriver(params, io, presenter); -#else - return 0; -#endif // _IRR_COMPILE_WITH_BURNINGSVIDEO_ -} - - - -} // end namespace video -} // end namespace irr - diff --git a/source/Irrlicht/CSoftwareDriver2.h b/source/Irrlicht/CSoftwareDriver2.h deleted file mode 100644 index 62a1bcc5..00000000 --- a/source/Irrlicht/CSoftwareDriver2.h +++ /dev/null @@ -1,450 +0,0 @@ -// Copyright (C) 2002-2012 Nikolaus Gebhardt / Thomas Alten -// This file is part of the "Irrlicht Engine". -// For conditions of distribution and use, see copyright notice in irrlicht.h - -#ifndef __C_VIDEO_2_SOFTWARE_H_INCLUDED__ -#define __C_VIDEO_2_SOFTWARE_H_INCLUDED__ - -#include "SoftwareDriver2_compile_config.h" -#include "IBurningShader.h" -#include "CNullDriver.h" -#include "CImage.h" -#include "os.h" -#include "irrString.h" -#include "SIrrCreationParameters.h" - - -namespace irr -{ -namespace video -{ - class CBurningVideoDriver : public CNullDriver, public IMaterialRendererServices - { - public: - - //! constructor - CBurningVideoDriver(const irr::SIrrlichtCreationParameters& params, io::IFileSystem* io, video::IImagePresenter* presenter); - - //! destructor - virtual ~CBurningVideoDriver(); - - //! queries the features of the driver, returns true if feature is available - virtual bool queryFeature(E_VIDEO_DRIVER_FEATURE feature) const _IRR_OVERRIDE_; - - //! Create render target. - virtual IRenderTarget* addRenderTarget() _IRR_OVERRIDE_; - - //! sets transformation - virtual void setTransform(E_TRANSFORMATION_STATE state, const core::matrix4& mat) _IRR_OVERRIDE_; - - //! sets a material - virtual void setMaterial(const SMaterial& material) _IRR_OVERRIDE_; - - virtual bool setRenderTargetEx(IRenderTarget* target, u16 clearFlag, SColor clearColor, - f32 clearDepth, u8 clearStencil) _IRR_OVERRIDE_; - - //! sets a viewport - virtual void setViewPort(const core::rect<s32>& area) _IRR_OVERRIDE_; - virtual void setScissor(int x, int y, int width, int height); - - virtual bool beginScene(u16 clearFlag, SColor clearColor, f32 clearDepth, u8 clearStencil, - const SExposedVideoData& videoData, core::rect<s32>* sourceRect) _IRR_OVERRIDE_; - -#if defined(PATCH_SUPERTUX_8_0_1_with_1_9_0) - virtual bool beginScene(bool backBuffer, bool zBuffer, SColor color, - const SExposedVideoData& videoData, core::rect<s32>* sourceRect) - { - u16 flag = 0; - if (backBuffer) flag |= ECBF_COLOR; - if (zBuffer) flag |= ECBF_DEPTH; - return beginScene(flag, color, 1.f, 0, videoData, sourceRect); - } - virtual bool setRenderTarget(video::ITexture* texture, bool clearBackBuffer, bool clearZBuffer, SColor color); -#endif - - virtual bool endScene() _IRR_OVERRIDE_; - - //! Only used by the internal engine. Used to notify the driver that - //! the window was resized. - virtual void OnResize(const core::dimension2d<u32>& size) _IRR_OVERRIDE_; - - //! returns size of the current render target - virtual const core::dimension2d<u32>& getCurrentRenderTargetSize() const _IRR_OVERRIDE_; - - //! deletes all dynamic lights there are - virtual void deleteAllDynamicLights() _IRR_OVERRIDE_; - - //! adds a dynamic light, returning an index to the light - //! \param light: the light data to use to create the light - //! \return An index to the light, or -1 if an error occurs - virtual s32 addDynamicLight(const SLight& light) _IRR_OVERRIDE_; - - //! Turns a dynamic light on or off - //! \param lightIndex: the index returned by addDynamicLight - //! \param turnOn: true to turn the light on, false to turn it off - virtual void turnLightOn(s32 lightIndex, bool turnOn) _IRR_OVERRIDE_; - - //! returns the maximal amount of dynamic lights the device can handle - virtual u32 getMaximalDynamicLightAmount() const _IRR_OVERRIDE_; - - //! Sets the dynamic ambient light color. The default color is - //! (0,0,0,0) which means it is dark. - //! \param color: New color of the ambient light. - virtual void setAmbientLight(const SColorf& color) _IRR_OVERRIDE_; - - //! draws a vertex primitive list - virtual void drawVertexPrimitiveList(const void* vertices, u32 vertexCount, - const void* indexList, u32 primitiveCount, - E_VERTEX_TYPE vType, scene::E_PRIMITIVE_TYPE pType, E_INDEX_TYPE iType) _IRR_OVERRIDE_; - - //! draws a vertex primitive list in 2d - virtual void draw2DVertexPrimitiveList(const void* vertices, u32 vertexCount, - const void* indexList, u32 primitiveCount, - E_VERTEX_TYPE vType, scene::E_PRIMITIVE_TYPE pType, E_INDEX_TYPE iType) _IRR_OVERRIDE_; - - - //! draws an 2d image - //virtual void draw2DImage(const video::ITexture* texture, const core::position2d<s32>& destPos, bool useAlphaChannelOfTexture) _IRR_OVERRIDE_; - - /* NullDriver calls - draw2DImage(texture, destPos, - core::rect<s32>(core::position2d<s32>(0, 0), core::dimension2di(texture->getOriginalSize())), - 0, - SColor(255, 255, 255, 255), - useAlphaChannelOfTexture - */ - - //! draws an 2d image, using a color (if color is other then Color(255,255,255,255)) and the alpha channel of the texture if wanted. - virtual void draw2DImage(const video::ITexture* texture, const core::position2d<s32>& destPos, - const core::rect<s32>& sourceRect, const core::rect<s32>* clipRect = 0, - SColor color=SColor(255,255,255,255), bool useAlphaChannelOfTexture=false) _IRR_OVERRIDE_; - - //! Draws a part of the texture into the rectangle. - virtual void draw2DImage(const video::ITexture* texture, const core::rect<s32>& destRect, - const core::rect<s32>& sourceRect, const core::rect<s32>* clipRect = 0, - const video::SColor* const colors=0, bool useAlphaChannelOfTexture=false) _IRR_OVERRIDE_; - - //! Draws a 3d line. - virtual void draw3DLine(const core::vector3df& start, - const core::vector3df& end, SColor color_start) _IRR_OVERRIDE_; - - //! draw an 2d rectangle - //virtual void draw2DRectangle(SColor color, const core::rect<s32>& pos, - // const core::rect<s32>* clip = 0) _IRR_OVERRIDE_; - - /* NullDriver calls - draw2DRectangle(pos, color, color, color, color, clip); - */ - - //!Draws an 2d rectangle with a gradient. - virtual void draw2DRectangle(const core::rect<s32>& pos, - SColor colorLeftUp, SColor colorRightUp, SColor colorLeftDown, SColor colorRightDown, - const core::rect<s32>* clip = 0) _IRR_OVERRIDE_; - - //! Draws a 2d line. - virtual void draw2DLine(const core::position2d<s32>& start, - const core::position2d<s32>& end, - SColor color=SColor(255,255,255,255)) _IRR_OVERRIDE_; - - //! Draws a single pixel - virtual void drawPixel(u32 x, u32 y, const SColor & color) _IRR_OVERRIDE_; - - //! \return Returns the name of the video driver. Example: In case of the DirectX8 - //! driver, it would return "Direct3D8.1". - virtual const wchar_t* getName() const _IRR_OVERRIDE_; - - //! Returns type of video driver - virtual E_DRIVER_TYPE getDriverType() const _IRR_OVERRIDE_; - - //! get color format of the current color buffer - virtual ECOLOR_FORMAT getColorFormat() const _IRR_OVERRIDE_; - - //! Returns the transformation set by setTransform - virtual const core::matrix4& getTransform(E_TRANSFORMATION_STATE state) const _IRR_OVERRIDE_; - - //! Creates a render target texture. - virtual ITexture* addRenderTargetTexture(const core::dimension2d<u32>& size, - const io::path& name, const ECOLOR_FORMAT format = ECF_UNKNOWN -#if defined(PATCH_SUPERTUX_8_0_1_with_1_9_0) - , const bool useStencil = false -#endif - ) _IRR_OVERRIDE_; - - - virtual void clearBuffers(u16 flag, SColor color, f32 depth, u8 stencil) _IRR_OVERRIDE_; - - //! Returns an image created from the last rendered frame. - virtual IImage* createScreenShot(video::ECOLOR_FORMAT format=video::ECF_UNKNOWN, video::E_RENDER_TARGET target=video::ERT_FRAME_BUFFER) _IRR_OVERRIDE_; - - //! Returns the maximum amount of primitives (mostly vertices) which - //! the device is able to render with one drawIndexedTriangleList - //! call. - virtual u32 getMaximalPrimitiveCount() const _IRR_OVERRIDE_; - - //! Draws a shadow volume into the stencil buffer. To draw a stencil shadow, do - //! this: First, draw all geometry. Then use this method, to draw the shadow - //! volume. Then, use IVideoDriver::drawStencilShadow() to visualize the shadow. - virtual void drawStencilShadowVolume(const core::array<core::vector3df>& triangles, bool zfail=true, u32 debugDataVisible=0) _IRR_OVERRIDE_; - - //! Fills the stencil shadow with color. After the shadow volume has been drawn - //! into the stencil buffer using IVideoDriver::drawStencilShadowVolume(), use this - //! to draw the color of the shadow. - virtual void drawStencilShadow(bool clearStencilBuffer=false, - video::SColor leftUpEdge = video::SColor(0,0,0,0), - video::SColor rightUpEdge = video::SColor(0,0,0,0), - video::SColor leftDownEdge = video::SColor(0,0,0,0), - video::SColor rightDownEdge = video::SColor(0,0,0,0)) _IRR_OVERRIDE_; - - //! Enable the 2d override material - virtual void enableMaterial2D(bool enable = true) _IRR_OVERRIDE_; - - //! Returns the graphics card vendor name. - virtual core::stringc getVendorInfo() _IRR_OVERRIDE_; - - //! Returns the maximum texture size supported. - virtual core::dimension2du getMaxTextureSize() const _IRR_OVERRIDE_; - - //! Check if the driver supports creating textures with the given color format - virtual bool queryTextureFormat(ECOLOR_FORMAT format) const _IRR_OVERRIDE_; - -#if !defined(PATCH_SUPERTUX_8_0_1_with_1_9_0) - //! Used by some SceneNodes to check if a material should be rendered in the transparent render pass - virtual bool needsTransparentRenderPass(const irr::video::SMaterial& material) const _IRR_OVERRIDE_; -#endif - - IDepthBuffer * getDepthBuffer () { return DepthBuffer; } - IStencilBuffer * getStencilBuffer () { return StencilBuffer; } - - //! Adds a new material renderer to the VideoDriver, using pixel and/or - //! vertex shaders to render geometry. - virtual s32 addShaderMaterial(const c8* vertexShaderProgram, - const c8* pixelShaderProgram, - IShaderConstantSetCallBack* callback, - E_MATERIAL_TYPE baseMaterial, - s32 userData) _IRR_OVERRIDE_; - - //! Adds a new material renderer to the VideoDriver, based on a high level shading - //! language. Currently only HLSL in D3D9 is supported. - virtual s32 addHighLevelShaderMaterial( - const c8* vertexShaderProgram, - const c8* vertexShaderEntryPointName = 0, - E_VERTEX_SHADER_TYPE vsCompileTarget = EVST_VS_1_1, - const c8* pixelShaderProgram = 0, - const c8* pixelShaderEntryPointName = 0, - E_PIXEL_SHADER_TYPE psCompileTarget = EPST_PS_1_1, - const c8* geometryShaderProgram = 0, - const c8* geometryShaderEntryPointName = "main", - E_GEOMETRY_SHADER_TYPE gsCompileTarget = EGST_GS_4_0, - scene::E_PRIMITIVE_TYPE inType = scene::EPT_TRIANGLES, - scene::E_PRIMITIVE_TYPE outType = scene::EPT_TRIANGLE_STRIP, - u32 verticesOut = 0, - IShaderConstantSetCallBack* callback = 0, - E_MATERIAL_TYPE baseMaterial = video::EMT_SOLID, - s32 userData = 0 -#if defined(PATCH_SUPERTUX_8_0_1_with_1_9_0) - , E_GPU_SHADING_LANGUAGE shadingLang = EGSL_DEFAULT -#endif - ) _IRR_OVERRIDE_; - - //IMaterialRendererService - - virtual void setBasicRenderStates(const SMaterial& material, - const SMaterial& lastMaterial, - bool resetAllRenderstates) _IRR_OVERRIDE_; - - //pass BaseMaterialID - void setFallback_Material(E_MATERIAL_TYPE fallback_MaterialType); - - //! Return an index constant for the vertex shader based on a name. - virtual s32 getVertexShaderConstantID(const c8* name) _IRR_OVERRIDE_; - virtual bool setVertexShaderConstant(s32 index, const f32* floats, int count) _IRR_OVERRIDE_; - virtual bool setVertexShaderConstant(s32 index, const s32* ints, int count) _IRR_OVERRIDE_; - virtual bool setVertexShaderConstant(s32 index, const u32* ints, int count) _IRR_OVERRIDE_; - virtual void setVertexShaderConstant(const f32* data, s32 startRegister, s32 constantAmount) _IRR_OVERRIDE_; - - //! Return an index constant for the pixel shader based on a name. - virtual s32 getPixelShaderConstantID(const c8* name) _IRR_OVERRIDE_; - virtual bool setPixelShaderConstant(s32 index, const f32* floats, int count) _IRR_OVERRIDE_; - virtual bool setPixelShaderConstant(s32 index, const s32* ints, int count) _IRR_OVERRIDE_; - virtual bool setPixelShaderConstant(s32 index, const u32* ints, int count) _IRR_OVERRIDE_; - - virtual void setPixelShaderConstant(const f32* data, s32 startRegister, s32 constantAmount) _IRR_OVERRIDE_; - -#if defined(PATCH_SUPERTUX_8_0_1_with_1_9_0) - virtual bool setVertexShaderConstant(const c8* name, const f32* floats, int count) - { - return setVertexShaderConstant(getVertexShaderConstantID(name), floats, count); - } - virtual bool setVertexShaderConstant(const c8* name, const bool* bools, int count) - { - return setVertexShaderConstant(getVertexShaderConstantID(name), (const s32*)bools, count); - } - virtual bool setVertexShaderConstant(const c8* name, const s32* ints, int count) - { - return setVertexShaderConstant(getVertexShaderConstantID(name), ints, count); - } - - virtual bool setPixelShaderConstant(const c8* name, const f32* floats, int count) - { - return setPixelShaderConstant(getPixelShaderConstantID(name), floats, count); - } - virtual bool setPixelShaderConstant(const c8* name, const bool* bools, int count) - { - return setPixelShaderConstant(getPixelShaderConstantID(name), (const s32*)bools, count); - } - virtual bool setPixelShaderConstant(const c8* name, const s32* ints, int count) - { - return setPixelShaderConstant(getPixelShaderConstantID(name), ints, count); - } -#endif - //! Get pointer to the IVideoDriver interface - /** \return Pointer to the IVideoDriver interface */ - virtual IVideoDriver* getVideoDriver() _IRR_OVERRIDE_; - - protected: - - void saveBuffer(); - - //! sets a render target - void setRenderTargetImage2(video::IImage* color, video::IImage* depth=0, video::IImage* stencil=0); - - //! sets the current Texture - //bool setTexture(u32 stage, video::ITexture* texture); - - virtual ITexture* createDeviceDependentTexture(const io::path& name, IImage* image) _IRR_OVERRIDE_; - virtual ITexture* createDeviceDependentTextureCubemap(const io::path& name, const core::array<IImage*>& image) _IRR_OVERRIDE_; - - video::CImage* BackBuffer; - video::IImagePresenter* Presenter; - - void* WindowId; - core::rect<s32>* SceneSourceRect; - - video::ITexture* RenderTargetTexture; - video::IImage* RenderTargetSurface; - core::dimension2d<u32> RenderTargetSize; - sVec4 RatioRenderTargetScreen; // Smaller Render Target - - IBurningShader* CurrentShader; - IBurningShader* BurningShader[ETR2_COUNT]; - - IDepthBuffer* DepthBuffer; - IStencilBuffer* StencilBuffer; - - - /* - extend Matrix Stack - -> combined CameraProjection - -> combined CameraProjectionWorld - -> ClipScale from NDC to DC Space - */ - enum E_TRANSFORMATION_STATE_BURNING_VIDEO - { - ETS_VIEW_PROJECTION = ETS_COUNT, - ETS_PROJ_MODEL_VIEW, - ETS_MODEL_VIEW, - ETS_NORMAL, //3x3 ModelView Tansposed Inverse - - ETS_COUNT_BURNING = 16 - }; - - // align manually to 16 byte start address - //u8 _pack_0[8]; - enum E_TRANSFORMATION_FLAG - { - ETF_VALID = 1, - ETF_IDENTITY = 2, - ETF_TEXGEN_CAMERA_SPHERE = 4, - ETF_TEXGEN_CAMERA_REFLECTION = 8, - ETF_TEXGEN_WRAP = 16, - ETF_TEXGEN_MASK = ETF_TEXGEN_CAMERA_SPHERE | ETF_TEXGEN_CAMERA_REFLECTION | ETF_TEXGEN_WRAP - }; - size_t TransformationStack; // 0 .. 3D , 1 .. 2D - core::matrix4 ALIGN(16) Transformation[2][ETS_COUNT_BURNING]; - size_t TransformationFlag[2][ETS_COUNT_BURNING]; // E_TRANSFORMATION_FLAG - - - void setRenderStates2DMode(const video::SColor& color,const video::ITexture* texture,bool useAlphaChannelOfTexture); - void setRenderStates3DMode(); - - //ETS_CLIPSCALE, // moved outside to stay at 16 matrices - f32 Transformation_ETS_CLIPSCALE[2][4]; - void transform_calc(E_TRANSFORMATION_STATE_BURNING_VIDEO state); - - //core::recti ViewPort; - AbsRectangle Scissor; - - // Vertex Cache - SVertexCache VertexCache; - - int VertexCache_reset (const void* vertices, u32 vertexCount, - const void* indices, u32 indexCount, - E_VERTEX_TYPE vType,scene::E_PRIMITIVE_TYPE pType, - E_INDEX_TYPE iType); - void VertexCache_get (s4DVertexPair* face[4] ); - - void VertexCache_map_source_format(); - void VertexCache_fill ( const u32 sourceIndex,const u32 destIndex ); - s4DVertexPair* VertexCache_getVertex ( const u32 sourceIndex ) const; - - - // culling & clipping - //size_t inline clipToHyperPlane (s4DVertexPair* burning_restrict dest, const s4DVertexPair* burning_restrict source, const size_t inCount, const sVec4 &plane ); - //size_t inline clipToFrustumTest ( const s4DVertex * v ) const; - public: - size_t clipToFrustum( const size_t vIn /*, const size_t clipmask_for_face*/ ); - protected: - - // holds transformed, clipped vertices for a triangle. triangle expands on clipping - // Buffer is in in pairs of 4DVertex (0 ... ndc, 1 .. dc and projected) - SAligned4DVertex Clipper; - SAligned4DVertex Clipper_temp; - - -#ifdef SOFTWARE_DRIVER_2_LIGHTING - void lightVertex_eye ( s4DVertex *dest, u32 vertexargb ); -#endif - - //! Sets the fog mode. - virtual void setFog(SColor color, E_FOG_TYPE fogType, f32 start, - f32 end, f32 density, bool pixelFog, bool rangeFog) _IRR_OVERRIDE_; - - - void ndc_2_dc_and_project (s4DVertexPair* dest,const s4DVertexPair* source, const size_t vIn ) const; - - //const is misleading. **v is const that true, but not *v.. - f32 screenarea_inside (const s4DVertexPair* burning_restrict const face[] ) const; - s32 lodFactor_inside ( const s4DVertexPair* burning_restrict const face[], const size_t tex, const f32 dc_area, const f32 lod_bias ) const; - void select_polygon_mipmap_inside ( s4DVertex* burning_restrict face[], const size_t tex, const CSoftwareTexture2_Bound& b ) const; - - void getCameraPosWorldSpace(); - SBurningShaderEyeSpace EyeSpace; - SBurningShaderMaterial Material; - - static const sVec4 NDCPlane[6+2]; - - //! Built-in 2D quad for 2D rendering. - S3DVertex Quad2DVertices[4]; - interlaced_control Interlaced; - -#if defined(PATCH_SUPERTUX_8_0_1_with_1_9_0) - core::array<IRenderTarget*> RenderTargets; - - inline bool getWriteZBuffer(const SMaterial& material) const - { - return material.ZWriteEnable && (AllowZWriteOnTransparent || !material.isTransparent()); - } - virtual video::ITexture* createDeviceDependentTexture(IImage* surface, const io::path& name, void* mipmapData = 0) - { - return createDeviceDependentTexture(name, surface); - } -#endif - - }; - -} // end namespace video -} // end namespace irr - - -#endif - diff --git a/source/Irrlicht/CSoftwareTexture.cpp b/source/Irrlicht/CSoftwareTexture.cpp deleted file mode 100644 index 8a0b5077..00000000 --- a/source/Irrlicht/CSoftwareTexture.cpp +++ /dev/null @@ -1,170 +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_SOFTWARE_ - -#include "CSoftwareTexture.h" -#include "CSoftwareDriver.h" -#include "os.h" - -namespace irr -{ -namespace video -{ - -//! constructor -CSoftwareTexture::CSoftwareTexture(IImage* image, const io::path& name, bool renderTarget) - : ITexture(name, ETT_2D), Texture(0) -{ - #ifdef _DEBUG - setDebugName("CSoftwareTexture"); - #endif - - DriverType = EDT_SOFTWARE; - ColorFormat = ECF_A1R5G5B5; - HasMipMaps = false; - IsRenderTarget = renderTarget; - - if (image) - { - bool IsCompressed = false; - - if(IImage::isCompressedFormat(image->getColorFormat())) - { - os::Printer::log("Texture compression not available.", ELL_ERROR); - IsCompressed = true; - } - - OriginalSize = image->getDimension(); - core::dimension2d<u32> optSize = OriginalSize.getOptimalSize(); - - Image = new CImage(ECF_A1R5G5B5, OriginalSize); - - if (!IsCompressed) - image->copyTo(Image); - - if (optSize == OriginalSize) - { - Texture = Image; - Texture->grab(); - } - else - { - Texture = new CImage(ECF_A1R5G5B5, optSize); - Image->copyToScaling(Texture); - } - - Size = Texture->getDimension(); - Pitch = Texture->getDimension().Width * 2; - } -} - - - -//! destructor -CSoftwareTexture::~CSoftwareTexture() -{ - if (Image) - Image->drop(); - - if (Texture) - Texture->drop(); -} - - - -//! lock function -void* CSoftwareTexture::lock(E_TEXTURE_LOCK_MODE mode, u32 mipmapLevel, u32 layer, E_TEXTURE_LOCK_FLAGS lockFlags) -{ - return Image->getData(); -} - - - -//! unlock function -void CSoftwareTexture::unlock() -{ - if (Image != Texture) - { - os::Printer::log("Performance warning, slow unlock of non power of 2 texture.", ELL_WARNING); - Image->copyToScaling(Texture); - } -} - - -//! returns unoptimized surface -CImage* CSoftwareTexture::getImage() -{ - return Image; -} - - -//! returns texture surface -CImage* CSoftwareTexture::getTexture() -{ - return Texture; -} - -void CSoftwareTexture::regenerateMipMapLevels(void* data, u32 layer) -{ - // our software textures don't have mip maps -} - - -/* Software Render Target */ - -CSoftwareRenderTarget::CSoftwareRenderTarget(CSoftwareDriver* driver) : Driver(driver) -{ - DriverType = EDT_SOFTWARE; - - Texture.set_used(1); - Texture[0] = 0; -} - -CSoftwareRenderTarget::~CSoftwareRenderTarget() -{ - if (Texture[0]) - Texture[0]->drop(); -} - -void CSoftwareRenderTarget::setTexture(const core::array<ITexture*>& texture, ITexture* depthStencil, const core::array<E_CUBE_SURFACE>& cubeSurfaces) -{ - if (Texture != texture) - { - ITexture* prevTexture = Texture[0]; - - bool textureDetected = false; - - for (u32 i = 0; i < texture.size(); ++i) - { - if (texture[i] && texture[i]->getDriverType() == EDT_SOFTWARE) - { - Texture[0] = texture[i]; - Texture[0]->grab(); - textureDetected = true; - - break; - } - } - - if (prevTexture) - prevTexture->drop(); - - if (!textureDetected) - Texture[0] = 0; - } -} - -ITexture* CSoftwareRenderTarget::getTexture() const -{ - return Texture[0]; -} - - -} // end namespace video -} // end namespace irr - -#endif // _IRR_COMPILE_WITH_SOFTWARE_ - diff --git a/source/Irrlicht/CSoftwareTexture.h b/source/Irrlicht/CSoftwareTexture.h deleted file mode 100644 index 5d6d97e4..00000000 --- a/source/Irrlicht/CSoftwareTexture.h +++ /dev/null @@ -1,73 +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_SOFTWARE_TEXTURE_H_INCLUDED__ -#define __C_SOFTWARE_TEXTURE_H_INCLUDED__ - -#include "ITexture.h" -#include "IRenderTarget.h" -#include "CImage.h" - -namespace irr -{ -namespace video -{ - -class CSoftwareDriver; - -/*! - interface for a Video Driver dependent Texture. -*/ -class CSoftwareTexture : public ITexture -{ -public: - - //! constructor - CSoftwareTexture(IImage* surface, const io::path& name, bool renderTarget=false); - - //! destructor - virtual ~CSoftwareTexture(); - - //! lock function - virtual void* lock(E_TEXTURE_LOCK_MODE mode = ETLM_READ_WRITE, u32 mipmapLevel=0, u32 layer = 0, E_TEXTURE_LOCK_FLAGS lockFlags = ETLF_FLIP_Y_UP_RTT) _IRR_OVERRIDE_; - - //! unlock function - virtual void unlock() _IRR_OVERRIDE_; - - //! returns unoptimized surface - virtual CImage* getImage(); - - //! returns texture surface - virtual CImage* getTexture(); - - virtual void regenerateMipMapLevels(void* data = 0, u32 layer = 0) _IRR_OVERRIDE_; - -private: - CImage* Image; - CImage* Texture; -}; - -/*! - interface for a Video Driver dependent render target. -*/ -class CSoftwareRenderTarget : public IRenderTarget -{ -public: - CSoftwareRenderTarget(CSoftwareDriver* driver); - virtual ~CSoftwareRenderTarget(); - - virtual void setTexture(const core::array<ITexture*>& texture, ITexture* depthStencil, const core::array<E_CUBE_SURFACE>& cubeSurfaces) _IRR_OVERRIDE_; - - ITexture* getTexture() const; - -protected: - CSoftwareDriver* Driver; -}; - - -} // end namespace video -} // end namespace irr - -#endif - diff --git a/source/Irrlicht/CSphereSceneNode.cpp b/source/Irrlicht/CSphereSceneNode.cpp deleted file mode 100644 index 1693f5e2..00000000 --- a/source/Irrlicht/CSphereSceneNode.cpp +++ /dev/null @@ -1,206 +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_SPHERE_SCENENODE_ -#include "CSphereSceneNode.h" -#include "IVideoDriver.h" -#include "ISceneManager.h" -#include "S3DVertex.h" -#include "os.h" -#ifdef _IRR_COMPILE_WITH_SHADOW_VOLUME_SCENENODE_ -#include "CShadowVolumeSceneNode.h" -#else -#include "IShadowVolumeSceneNode.h" -#endif // _IRR_COMPILE_WITH_SHADOW_VOLUME_SCENENODE_ - -namespace irr -{ -namespace scene -{ - -//! constructor -CSphereSceneNode::CSphereSceneNode(f32 radius, u32 polyCountX, u32 polyCountY, ISceneNode* parent, ISceneManager* mgr, s32 id, - const core::vector3df& position, const core::vector3df& rotation, const core::vector3df& scale) -: IMeshSceneNode(parent, mgr, id, position, rotation, scale), Mesh(0), Shadow(0), - Radius(radius), PolyCountX(polyCountX), PolyCountY(polyCountY) -{ - #ifdef _DEBUG - setDebugName("CSphereSceneNode"); - #endif - - Mesh = SceneManager->getGeometryCreator()->createSphereMesh(radius, polyCountX, polyCountY); -} - - - -//! destructor -CSphereSceneNode::~CSphereSceneNode() -{ - if (Shadow) - Shadow->drop(); - if (Mesh) - Mesh->drop(); -} - - -//! renders the node. -void CSphereSceneNode::render() -{ - video::IVideoDriver* driver = SceneManager->getVideoDriver(); - - if (Mesh && driver) - { - driver->setMaterial(Mesh->getMeshBuffer(0)->getMaterial()); - driver->setTransform(video::ETS_WORLD, AbsoluteTransformation); - if (Shadow) - Shadow->updateShadowVolumes(); - - driver->drawMeshBuffer(Mesh->getMeshBuffer(0)); - if ( DebugDataVisible & scene::EDS_BBOX ) - { - video::SMaterial m; - m.Lighting = false; - driver->setMaterial(m); - driver->draw3DBox(Mesh->getMeshBuffer(0)->getBoundingBox(), video::SColor(255,255,255,255)); - } - } -} - - -//! Removes a child from this scene node. -//! Implemented here, to be able to remove the shadow properly, if there is one, -//! or to remove attached child. -bool CSphereSceneNode::removeChild(ISceneNode* child) -{ - if (child && Shadow == child) - { - Shadow->drop(); - Shadow = 0; - } - - return ISceneNode::removeChild(child); -} - - -//! Creates shadow volume scene node as child of this node -//! and returns a pointer to it. -IShadowVolumeSceneNode* CSphereSceneNode::addShadowVolumeSceneNode( - const IMesh* shadowMesh, s32 id, bool zfailmethod, f32 infinity) -{ -#ifdef _IRR_COMPILE_WITH_SHADOW_VOLUME_SCENENODE_ - if (!SceneManager->getVideoDriver()->queryFeature(video::EVDF_STENCIL_BUFFER)) - return 0; - - if (!shadowMesh) - shadowMesh = Mesh; // if null is given, use the mesh of node - - if (Shadow) - Shadow->drop(); - - Shadow = new CShadowVolumeSceneNode(shadowMesh, this, SceneManager, id, zfailmethod, infinity); - return Shadow; -#else - return 0; -#endif -} - - -//! returns the axis aligned bounding box of this node -const core::aabbox3d<f32>& CSphereSceneNode::getBoundingBox() const -{ - return Mesh ? Mesh->getBoundingBox() : Box; -} - - -void CSphereSceneNode::OnRegisterSceneNode() -{ - if (IsVisible) - SceneManager->registerNodeForRendering(this); - - ISceneNode::OnRegisterSceneNode(); -} - - -//! returns the material based on the zero based index i. -video::SMaterial& CSphereSceneNode::getMaterial(u32 i) -{ - if (i>0 || !Mesh) - return ISceneNode::getMaterial(i); - else - return Mesh->getMeshBuffer(i)->getMaterial(); -} - - -//! returns amount of materials used by this scene node. -u32 CSphereSceneNode::getMaterialCount() const -{ - return 1; -} - - -//! Writes attributes of the scene node. -void CSphereSceneNode::serializeAttributes(io::IAttributes* out, io::SAttributeReadWriteOptions* options) const -{ - ISceneNode::serializeAttributes(out, options); - - out->addFloat("Radius", Radius); - out->addInt("PolyCountX", PolyCountX); - out->addInt("PolyCountY", PolyCountY); -} - - -//! Reads attributes of the scene node. -void CSphereSceneNode::deserializeAttributes(io::IAttributes* in, io::SAttributeReadWriteOptions* options) -{ - f32 oldRadius = Radius; - u32 oldPolyCountX = PolyCountX; - u32 oldPolyCountY = PolyCountY; - - Radius = in->getAttributeAsFloat("Radius"); - PolyCountX = in->getAttributeAsInt("PolyCountX"); - PolyCountY = in->getAttributeAsInt("PolyCountY"); - // legacy values read for compatibility with older versions - u32 polyCount = in->getAttributeAsInt("PolyCount"); - if (PolyCountX ==0 && PolyCountY == 0) - PolyCountX = PolyCountY = polyCount; - - Radius = core::max_(Radius, 0.0001f); - - if ( !core::equals(Radius, oldRadius) || PolyCountX != oldPolyCountX || PolyCountY != oldPolyCountY) - { - if (Mesh) - Mesh->drop(); - Mesh = SceneManager->getGeometryCreator()->createSphereMesh(Radius, PolyCountX, PolyCountY); - } - - ISceneNode::deserializeAttributes(in, options); -} - -//! Creates a clone of this scene node and its children. -ISceneNode* CSphereSceneNode::clone(ISceneNode* newParent, ISceneManager* newManager) -{ - if (!newParent) - newParent = Parent; - if (!newManager) - newManager = SceneManager; - - CSphereSceneNode* nb = new CSphereSceneNode(Radius, PolyCountX, PolyCountY, newParent, - newManager, ID, RelativeTranslation); - - nb->cloneMembers(this, newManager); - nb->getMaterial(0) = Mesh->getMeshBuffer(0)->getMaterial(); - nb->Shadow = Shadow; - if ( nb->Shadow ) - nb->Shadow->grab(); - - if ( newParent ) - nb->drop(); - return nb; -} - -} // end namespace scene -} // end namespace irr - -#endif // _IRR_COMPILE_WITH_SPHERE_SCENENODE_ diff --git a/source/Irrlicht/CSphereSceneNode.h b/source/Irrlicht/CSphereSceneNode.h deleted file mode 100644 index 480881cb..00000000 --- a/source/Irrlicht/CSphereSceneNode.h +++ /dev/null @@ -1,96 +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_SPHERE_SCENE_NODE_H_INCLUDED__ -#define __C_SPHERE_SCENE_NODE_H_INCLUDED__ - -#include "IMeshSceneNode.h" -#include "IMesh.h" - -namespace irr -{ -namespace scene -{ - class CSphereSceneNode : public IMeshSceneNode - { - public: - - //! constructor - CSphereSceneNode(f32 size, u32 polyCountX, u32 polyCountY, ISceneNode* parent, ISceneManager* mgr, s32 id, - const core::vector3df& position = core::vector3df(0,0,0), - const core::vector3df& rotation = core::vector3df(0,0,0), - const core::vector3df& scale = core::vector3df(1.0f, 1.0f, 1.0f)); - - //! destructor - virtual ~CSphereSceneNode(); - - virtual void OnRegisterSceneNode() _IRR_OVERRIDE_; - - //! renders the node. - virtual void render() _IRR_OVERRIDE_; - - //! returns the axis aligned bounding box of this node - virtual const core::aabbox3d<f32>& getBoundingBox() const _IRR_OVERRIDE_; - - //! returns the material based on the zero based index i. To get the amount - //! of materials used by this scene node, use getMaterialCount(). - //! This function is needed for inserting the node into the scene hierarchy on a - //! optimal position for minimizing renderstate changes, but can also be used - //! to directly modify the material of a scene node. - virtual video::SMaterial& getMaterial(u32 i) _IRR_OVERRIDE_; - - //! returns amount of materials used by this scene node. - virtual u32 getMaterialCount() const _IRR_OVERRIDE_; - - //! Returns type of the scene node - virtual ESCENE_NODE_TYPE getType() const _IRR_OVERRIDE_ { return ESNT_SPHERE; } - - //! Writes attributes of the scene node. - virtual void serializeAttributes(io::IAttributes* out, io::SAttributeReadWriteOptions* options=0) const _IRR_OVERRIDE_; - - //! Reads attributes of the scene node. - virtual void deserializeAttributes(io::IAttributes* in, io::SAttributeReadWriteOptions* options=0) _IRR_OVERRIDE_; - - //! Creates a clone of this scene node and its children. - virtual ISceneNode* clone(ISceneNode* newParent=0, ISceneManager* newManager=0) _IRR_OVERRIDE_; - - //! The mesh cannot be changed - virtual void setMesh(IMesh* mesh) _IRR_OVERRIDE_ {} - - //! Returns the current mesh - virtual IMesh* getMesh() _IRR_OVERRIDE_ { return Mesh; } - - //! Sets if the scene node should not copy the materials of the mesh but use them in a read only style. - /* In this way it is possible to change the materials a mesh causing all mesh scene nodes - referencing this mesh to change too. */ - virtual void setReadOnlyMaterials(bool readonly) _IRR_OVERRIDE_ {} - - //! Returns if the scene node should not copy the materials of the mesh but use them in a read only style - virtual bool isReadOnlyMaterials() const _IRR_OVERRIDE_ { return false; } - - //! Creates shadow volume scene node as child of this node - //! and returns a pointer to it. - virtual IShadowVolumeSceneNode* addShadowVolumeSceneNode(const IMesh* shadowMesh, - s32 id, bool zfailmethod=true, f32 infinity=10000.0f) _IRR_OVERRIDE_; - - //! Removes a child from this scene node. - //! Implemented here, to be able to remove the shadow properly, if there is one, - //! or to remove attached child. - virtual bool removeChild(ISceneNode* child) _IRR_OVERRIDE_; - - private: - - IMesh* Mesh; - IShadowVolumeSceneNode* Shadow; - core::aabbox3d<f32> Box; - f32 Radius; - u32 PolyCountX; - u32 PolyCountY; - }; - -} // end namespace scene -} // end namespace irr - -#endif - diff --git a/source/Irrlicht/CTRFlat.cpp b/source/Irrlicht/CTRFlat.cpp deleted file mode 100644 index b3910b1a..00000000 --- a/source/Irrlicht/CTRFlat.cpp +++ /dev/null @@ -1,299 +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" -#include "CTRTextureGouraud.h" - -#ifdef _IRR_COMPILE_WITH_SOFTWARE_ - -namespace irr -{ -namespace video -{ - -class CTRFlat : public CTRTextureGouraud -{ -public: - - CTRFlat(IZBuffer* zbuffer) - : CTRTextureGouraud(zbuffer) - { - #ifdef _DEBUG - setDebugName("CTRFlat"); - #endif - } - - //! draws an indexed triangle list - virtual void drawIndexedTriangleList(S2DVertex* vertices, s32 vertexCount, const u16* indexList, s32 triangleCount) _IRR_OVERRIDE_ - { - const S2DVertex *v1, *v2, *v3; - - u16 color; - f32 tmpDiv; // temporary division factor - f32 longest; // saves the longest span - s32 height; // saves height of triangle - u16* targetSurface; // target pointer where to plot pixels - s32 spanEnd; // saves end of spans - f32 leftdeltaxf; // amount of pixels to increase on left side of triangle - f32 rightdeltaxf; // amount of pixels to increase on right side of triangle - s32 leftx, rightx; // position where we are - f32 leftxf, rightxf; // same as above, but as f32 values - s32 span; // current span - u16 *hSpanBegin, *hSpanEnd; // pointer used when plotting pixels - core::rect<s32> TriangleRect; - - s32 leftZValue, rightZValue; - s32 leftZStep, rightZStep; - s32 spanZValue, spanZStep; // ZValues when drawing a span - TZBufferType* zTarget, *spanZTarget; // target of ZBuffer; - - lockedSurface = (u16*)RenderTarget->getData(); - lockedZBuffer = ZBuffer->lock(); - - for (s32 i=0; i<triangleCount; ++i) - { - v1 = &vertices[*indexList]; - ++indexList; - v2 = &vertices[*indexList]; - ++indexList; - v3 = &vertices[*indexList]; - ++indexList; - - // back face culling - - if (BackFaceCullingEnabled) - { - s32 z = ((v3->Pos.X - v1->Pos.X) * (v3->Pos.Y - v2->Pos.Y)) - - ((v3->Pos.Y - v1->Pos.Y) * (v3->Pos.X - v2->Pos.X)); - - if (z < 0) - continue; - } - - //near plane clipping - - if (v1->ZValue<0 && v2->ZValue<0 && v3->ZValue<0) - continue; - - // sort for width for inscreen clipping - - if (v1->Pos.X > v2->Pos.X) swapVertices(&v1, &v2); - if (v1->Pos.X > v3->Pos.X) swapVertices(&v1, &v3); - if (v2->Pos.X > v3->Pos.X) swapVertices(&v2, &v3); - - if ((v1->Pos.X - v3->Pos.X) == 0) - continue; - - TriangleRect.UpperLeftCorner.X = v1->Pos.X; - TriangleRect.LowerRightCorner.X = v3->Pos.X; - - // sort for height for faster drawing. - - if (v1->Pos.Y > v2->Pos.Y) swapVertices(&v1, &v2); - if (v1->Pos.Y > v3->Pos.Y) swapVertices(&v1, &v3); - if (v2->Pos.Y > v3->Pos.Y) swapVertices(&v2, &v3); - - TriangleRect.UpperLeftCorner.Y = v1->Pos.Y; - TriangleRect.LowerRightCorner.Y = v3->Pos.Y; - - if (!TriangleRect.isRectCollided(ViewPortRect)) - continue; - - // calculate height of triangle - height = v3->Pos.Y - v1->Pos.Y; - if (!height) - continue; - - // calculate longest span - - longest = (v2->Pos.Y - v1->Pos.Y) / (f32)height * (v3->Pos.X - v1->Pos.X) + (v1->Pos.X - v2->Pos.X); - - spanEnd = v2->Pos.Y; - span = v1->Pos.Y; - leftxf = (f32)v1->Pos.X; - rightxf = (f32)v1->Pos.X; - - leftZValue = v1->ZValue; - rightZValue = v1->ZValue; - - color = v1->Color; - - targetSurface = lockedSurface + span * SurfaceWidth; - zTarget = lockedZBuffer + span * SurfaceWidth; - - if (longest < 0.0f) - { - tmpDiv = 1.0f / (f32)(v2->Pos.Y - v1->Pos.Y); - rightdeltaxf = (v2->Pos.X - v1->Pos.X) * tmpDiv; - rightZStep = (s32)((v2->ZValue - v1->ZValue) * tmpDiv); - - tmpDiv = 1.0f / (f32)height; - leftdeltaxf = (v3->Pos.X - v1->Pos.X) * tmpDiv; - leftZStep = (s32)((v3->ZValue - v1->ZValue) * tmpDiv); - } - else - { - tmpDiv = 1.0f / (f32)height; - rightdeltaxf = (v3->Pos.X - v1->Pos.X) * tmpDiv; - rightZStep = (s32)((v3->ZValue - v1->ZValue) * tmpDiv); - - tmpDiv = 1.0f / (f32)(v2->Pos.Y - v1->Pos.Y); - leftdeltaxf = (v2->Pos.X - v1->Pos.X) * tmpDiv; - leftZStep = (s32)((v2->ZValue - v1->ZValue) * tmpDiv); - } - - - // do it twice, once for the first half of the triangle, - // end then for the second half. - - for (s32 triangleHalf=0; triangleHalf<2; ++triangleHalf) - { - if (spanEnd > ViewPortRect.LowerRightCorner.Y) - spanEnd = ViewPortRect.LowerRightCorner.Y; - - // if the span <0, than we can skip these spans, - // and proceed to the next spans which are really on the screen. - if (span < ViewPortRect.UpperLeftCorner.Y) - { - // we'll use leftx as temp variable - if (spanEnd < ViewPortRect.UpperLeftCorner.Y) - { - leftx = spanEnd - span; - span = spanEnd; - } - else - { - leftx = ViewPortRect.UpperLeftCorner.Y - span; - span = ViewPortRect.UpperLeftCorner.Y; - } - - leftxf += leftdeltaxf*leftx; - rightxf += rightdeltaxf*leftx; - targetSurface += SurfaceWidth*leftx; - zTarget += SurfaceWidth*leftx; - leftZValue += leftZStep*leftx; - rightZValue += rightZStep*leftx; - } - - - // the main loop. Go through every span and draw it. - - while (span < spanEnd) - { - leftx = (s32)(leftxf); - rightx = (s32)(rightxf + 0.5f); - - // perform some clipping - - // TODO: clipping is not correct when leftx is clipped. - - if (leftx<ViewPortRect.UpperLeftCorner.X) - leftx = ViewPortRect.UpperLeftCorner.X; - else - if (leftx>ViewPortRect.LowerRightCorner.X) - leftx = ViewPortRect.LowerRightCorner.X; - - if (rightx<ViewPortRect.UpperLeftCorner.X) - rightx = ViewPortRect.UpperLeftCorner.X; - else - if (rightx>ViewPortRect.LowerRightCorner.X) - rightx = ViewPortRect.LowerRightCorner.X; - - // draw the span - - if (rightx - leftx != 0) - { - tmpDiv = 1.0f / (rightx - leftx); - spanZValue = leftZValue; - spanZStep = (s32)((rightZValue - leftZValue) * tmpDiv); - - hSpanBegin = targetSurface + leftx; - spanZTarget = zTarget + leftx; - hSpanEnd = targetSurface + rightx; - - while (hSpanBegin < hSpanEnd) - { - if (spanZValue > *spanZTarget) - { - *spanZTarget = spanZValue; - *hSpanBegin = color; - } - - spanZValue += spanZStep; - ++hSpanBegin; - ++spanZTarget; - } - } - - leftxf += leftdeltaxf; - rightxf += rightdeltaxf; - ++span; - targetSurface += SurfaceWidth; - zTarget += SurfaceWidth; - leftZValue += leftZStep; - rightZValue += rightZStep; - } - - if (triangleHalf>0) // break, we've gout only two halves - break; - - - // setup variables for second half of the triangle. - - if (longest < 0.0f) - { - tmpDiv = 1.0f / (v3->Pos.Y - v2->Pos.Y); - - rightdeltaxf = (v3->Pos.X - v2->Pos.X) * tmpDiv; - rightxf = (f32)v2->Pos.X; - - rightZValue = v2->ZValue; - rightZStep = (s32)((v3->ZValue - v2->ZValue) * tmpDiv); - } - else - { - tmpDiv = 1.0f / (v3->Pos.Y - v2->Pos.Y); - - leftdeltaxf = (v3->Pos.X - v2->Pos.X) * tmpDiv; - leftxf = (f32)v2->Pos.X; - - leftZValue = v2->ZValue; - leftZStep = (s32)((v3->ZValue - v2->ZValue) * tmpDiv); - } - - - spanEnd = v3->Pos.Y; - } - - } - - ZBuffer->unlock(); - } -}; - -} // end namespace video -} // end namespace irr - -#endif // _IRR_COMPILE_WITH_SOFTWARE_ - -namespace irr -{ -namespace video -{ - -//! creates a flat triangle renderer -ITriangleRenderer* createTriangleRendererFlat(IZBuffer* zbuffer) -{ - #ifdef _IRR_COMPILE_WITH_SOFTWARE_ - return new CTRFlat(zbuffer); - #else - return 0; - #endif // _IRR_COMPILE_WITH_SOFTWARE_ -} - -} // end namespace video -} // end namespace irr - - - diff --git a/source/Irrlicht/CTRFlatWire.cpp b/source/Irrlicht/CTRFlatWire.cpp deleted file mode 100644 index 2f1cca56..00000000 --- a/source/Irrlicht/CTRFlatWire.cpp +++ /dev/null @@ -1,280 +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" -#include "CTRTextureGouraud.h" - -#ifdef _IRR_COMPILE_WITH_SOFTWARE_ - -namespace irr -{ -namespace video -{ - -class CTRFlatWire : public CTRTextureGouraud -{ -public: - - CTRFlatWire(IZBuffer* zbuffer) - : CTRTextureGouraud(zbuffer) - { - #ifdef _DEBUG - setDebugName("CTRWire"); - #endif - } - - //! draws an indexed triangle list - virtual void drawIndexedTriangleList(S2DVertex* vertices, s32 vertexCount, const u16* indexList, s32 triangleCount) _IRR_OVERRIDE_ - { - const S2DVertex *v1, *v2, *v3; - - u16 color; - f32 tmpDiv; // temporary division factor - f32 longest; // saves the longest span - s32 height; // saves height of triangle - u16* targetSurface; // target pointer where to plot pixels - s32 spanEnd; // saves end of spans - f32 leftdeltaxf; // amount of pixels to increase on left side of triangle - f32 rightdeltaxf; // amount of pixels to increase on right side of triangle - s32 leftx, rightx; // position where we are - f32 leftxf, rightxf; // same as above, but as f32 values - s32 span; // current span - core::rect<s32> TriangleRect; - - s32 leftZValue, rightZValue; - s32 leftZStep, rightZStep; - TZBufferType* zTarget; // target of ZBuffer; - - lockedSurface = (u16*)RenderTarget->getData(); - lockedZBuffer = ZBuffer->lock(); - - for (s32 i=0; i<triangleCount; ++i) - { - v1 = &vertices[*indexList]; - ++indexList; - v2 = &vertices[*indexList]; - ++indexList; - v3 = &vertices[*indexList]; - ++indexList; - - // back face culling - - if (BackFaceCullingEnabled) - { - s32 z = ((v3->Pos.X - v1->Pos.X) * (v3->Pos.Y - v2->Pos.Y)) - - ((v3->Pos.Y - v1->Pos.Y) * (v3->Pos.X - v2->Pos.X)); - - if (z < 0) - continue; - } - - //near plane clipping - - if (v1->ZValue<0 && v2->ZValue<0 && v3->ZValue<0) - continue; - - // sort for width for inscreen clipping - - if (v1->Pos.X > v2->Pos.X) swapVertices(&v1, &v2); - if (v1->Pos.X > v3->Pos.X) swapVertices(&v1, &v3); - if (v2->Pos.X > v3->Pos.X) swapVertices(&v2, &v3); - - if ((v1->Pos.X - v3->Pos.X) == 0) - continue; - - TriangleRect.UpperLeftCorner.X = v1->Pos.X; - TriangleRect.LowerRightCorner.X = v3->Pos.X; - - // sort for height for faster drawing. - - if (v1->Pos.Y > v2->Pos.Y) swapVertices(&v1, &v2); - if (v1->Pos.Y > v3->Pos.Y) swapVertices(&v1, &v3); - if (v2->Pos.Y > v3->Pos.Y) swapVertices(&v2, &v3); - - TriangleRect.UpperLeftCorner.Y = v1->Pos.Y; - TriangleRect.LowerRightCorner.Y = v3->Pos.Y; - - if (!TriangleRect.isRectCollided(ViewPortRect)) - continue; - - // calculate height of triangle - height = v3->Pos.Y - v1->Pos.Y; - if (!height) - continue; - - // calculate longest span - - longest = (v2->Pos.Y - v1->Pos.Y) / (f32)height * (v3->Pos.X - v1->Pos.X) + (v1->Pos.X - v2->Pos.X); - - spanEnd = v2->Pos.Y; - span = v1->Pos.Y; - leftxf = (f32)v1->Pos.X; - rightxf = (f32)v1->Pos.X; - - leftZValue = v1->ZValue; - rightZValue = v1->ZValue; - - color = v1->Color; - - targetSurface = lockedSurface + span * SurfaceWidth; - zTarget = lockedZBuffer + span * SurfaceWidth; - - if (longest < 0.0f) - { - tmpDiv = 1.0f / (f32)(v2->Pos.Y - v1->Pos.Y); - rightdeltaxf = (v2->Pos.X - v1->Pos.X) * tmpDiv; - rightZStep = (s32)((v2->ZValue - v1->ZValue) * tmpDiv); - - tmpDiv = 1.0f / (f32)height; - leftdeltaxf = (v3->Pos.X - v1->Pos.X) * tmpDiv; - leftZStep = (s32)((v3->ZValue - v1->ZValue) * tmpDiv); - } - else - { - tmpDiv = 1.0f / (f32)height; - rightdeltaxf = (v3->Pos.X - v1->Pos.X) * tmpDiv; - rightZStep = (s32)((v3->ZValue - v1->ZValue) * tmpDiv); - - tmpDiv = 1.0f / (f32)(v2->Pos.Y - v1->Pos.Y); - leftdeltaxf = (v2->Pos.X - v1->Pos.X) * tmpDiv; - leftZStep = (s32)((v2->ZValue - v1->ZValue) * tmpDiv); - } - - - // do it twice, once for the first half of the triangle, - // end then for the second half. - - for (s32 triangleHalf=0; triangleHalf<2; ++triangleHalf) - { - if (spanEnd > ViewPortRect.LowerRightCorner.Y) - spanEnd = ViewPortRect.LowerRightCorner.Y; - - // if the span <0, than we can skip these spans, - // and proceed to the next spans which are really on the screen. - if (span < ViewPortRect.UpperLeftCorner.Y) - { - // we'll use leftx as temp variable - if (spanEnd < ViewPortRect.UpperLeftCorner.Y) - { - leftx = spanEnd - span; - span = spanEnd; - } - else - { - leftx = ViewPortRect.UpperLeftCorner.Y - span; - span = ViewPortRect.UpperLeftCorner.Y; - } - - leftxf += leftdeltaxf*leftx; - rightxf += rightdeltaxf*leftx; - targetSurface += SurfaceWidth*leftx; - zTarget += SurfaceWidth*leftx; - leftZValue += leftZStep*leftx; - rightZValue += rightZStep*leftx; - } - - - // the main loop. Go through every span and draw it. - - while (span < spanEnd) - { - leftx = (s32)(leftxf); - rightx = (s32)(rightxf + 0.5f); - - // perform some clipping - - if (leftx>=ViewPortRect.UpperLeftCorner.X && - leftx<=ViewPortRect.LowerRightCorner.X) - { - if (leftZValue > *(zTarget + leftx)) - { - *(zTarget + leftx) = leftZValue; - *(targetSurface + leftx) = color; - } - } - - - if (rightx>=ViewPortRect.UpperLeftCorner.X && - rightx<=ViewPortRect.LowerRightCorner.X) - { - if (rightZValue > *(zTarget + rightx)) - { - *(zTarget + rightx) = rightZValue; - *(targetSurface + rightx) = color; - } - - } - - // draw the span - - leftxf += leftdeltaxf; - rightxf += rightdeltaxf; - ++span; - targetSurface += SurfaceWidth; - zTarget += SurfaceWidth; - leftZValue += leftZStep; - rightZValue += rightZStep; - } - - if (triangleHalf>0) // break, we've gout only two halves - break; - - - // setup variables for second half of the triangle. - - if (longest < 0.0f) - { - tmpDiv = 1.0f / (v3->Pos.Y - v2->Pos.Y); - - rightdeltaxf = (v3->Pos.X - v2->Pos.X) * tmpDiv; - rightxf = (f32)v2->Pos.X; - - rightZValue = v2->ZValue; - rightZStep = (s32)((v3->ZValue - v2->ZValue) * tmpDiv); - } - else - { - tmpDiv = 1.0f / (v3->Pos.Y - v2->Pos.Y); - - leftdeltaxf = (v3->Pos.X - v2->Pos.X) * tmpDiv; - leftxf = (f32)v2->Pos.X; - - leftZValue = v2->ZValue; - leftZStep = (s32)((v3->ZValue - v2->ZValue) * tmpDiv); - } - - - spanEnd = v3->Pos.Y; - } - - } - - ZBuffer->unlock(); - } -}; - -} // end namespace video -} // end namespace irr - -#endif // _IRR_COMPILE_WITH_SOFTWARE_ - -namespace irr -{ -namespace video -{ - -//! creates a flat triangle renderer -ITriangleRenderer* createTriangleRendererFlatWire(IZBuffer* zbuffer) -{ - #ifdef _IRR_COMPILE_WITH_SOFTWARE_ - return new CTRFlatWire(zbuffer); - #else - return 0; - #endif // _IRR_COMPILE_WITH_SOFTWARE_ -} - -} // end namespace video -} // end namespace irr - - diff --git a/source/Irrlicht/CTRGouraud.cpp b/source/Irrlicht/CTRGouraud.cpp deleted file mode 100644 index 830aa55a..00000000 --- a/source/Irrlicht/CTRGouraud.cpp +++ /dev/null @@ -1,357 +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" -#include "CTRTextureGouraud.h" - -#ifdef _IRR_COMPILE_WITH_SOFTWARE_ - -namespace irr -{ -namespace video -{ - - -class CTRGouraud : public CTRTextureGouraud -{ -public: - - CTRGouraud(IZBuffer* zbuffer) - : CTRTextureGouraud(zbuffer) - { - #ifdef _DEBUG - setDebugName("CTRGouraud"); - #endif - } - - //! draws an indexed triangle list - virtual void drawIndexedTriangleList(S2DVertex* vertices, s32 vertexCount, const u16* indexList, s32 triangleCount) _IRR_OVERRIDE_ - { - const S2DVertex *v1, *v2, *v3; - - f32 tmpDiv; // temporary division factor - f32 longest; // saves the longest span - s32 height; // saves height of triangle - u16* targetSurface; // target pointer where to plot pixels - s32 spanEnd; // saves end of spans - f32 leftdeltaxf; // amount of pixels to increase on left side of triangle - f32 rightdeltaxf; // amount of pixels to increase on right side of triangle - s32 leftx, rightx; // position where we are - f32 leftxf, rightxf; // same as above, but as f32 values - s32 span; // current span - u16 *hSpanBegin, *hSpanEnd; // pointer used when plotting pixels - s32 leftR, leftG, leftB, rightR, rightG, rightB; // color values - s32 leftStepR, leftStepG, leftStepB, - rightStepR, rightStepG, rightStepB; // color steps - s32 spanR, spanG, spanB, spanStepR, spanStepG, spanStepB; // color interpolating values while drawing a span. - - core::rect<s32> TriangleRect; - - s32 leftZValue, rightZValue; - s32 leftZStep, rightZStep; - s32 spanZValue, spanZStep; // ZValues when drawing a span - TZBufferType* zTarget, *spanZTarget; // target of ZBuffer; - - lockedSurface = (u16*)RenderTarget->getData(); - lockedZBuffer = ZBuffer->lock(); - - for (s32 i=0; i<triangleCount; ++i) - { - v1 = &vertices[*indexList]; - ++indexList; - v2 = &vertices[*indexList]; - ++indexList; - v3 = &vertices[*indexList]; - ++indexList; - - // back face culling - - if (BackFaceCullingEnabled) - { - s32 z = ((v3->Pos.X - v1->Pos.X) * (v3->Pos.Y - v2->Pos.Y)) - - ((v3->Pos.Y - v1->Pos.Y) * (v3->Pos.X - v2->Pos.X)); - - if (z < 0) - continue; - } - - //near plane clipping - - if (v1->ZValue<0 && v2->ZValue<0 && v3->ZValue<0) - continue; - - // sort for width for inscreen clipping - - if (v1->Pos.X > v2->Pos.X) swapVertices(&v1, &v2); - if (v1->Pos.X > v3->Pos.X) swapVertices(&v1, &v3); - if (v2->Pos.X > v3->Pos.X) swapVertices(&v2, &v3); - - if ((v1->Pos.X - v3->Pos.X) == 0) - continue; - - TriangleRect.UpperLeftCorner.X = v1->Pos.X; - TriangleRect.LowerRightCorner.X = v3->Pos.X; - - // sort for height for faster drawing. - - if (v1->Pos.Y > v2->Pos.Y) swapVertices(&v1, &v2); - if (v1->Pos.Y > v3->Pos.Y) swapVertices(&v1, &v3); - if (v2->Pos.Y > v3->Pos.Y) swapVertices(&v2, &v3); - - TriangleRect.UpperLeftCorner.Y = v1->Pos.Y; - TriangleRect.LowerRightCorner.Y = v3->Pos.Y; - - if (!TriangleRect.isRectCollided(ViewPortRect)) - continue; - - // calculate height of triangle - height = v3->Pos.Y - v1->Pos.Y; - if (!height) - continue; - - // calculate longest span - - longest = (v2->Pos.Y - v1->Pos.Y) / (f32)height * (v3->Pos.X - v1->Pos.X) + (v1->Pos.X - v2->Pos.X); - - spanEnd = v2->Pos.Y; - span = v1->Pos.Y; - leftxf = (f32)v1->Pos.X; - rightxf = (f32)v1->Pos.X; - - leftZValue = v1->ZValue; - rightZValue = v1->ZValue; - - leftR = rightR = video::getRed(v1->Color)<<11; - leftG = rightG = video::getGreen(v1->Color)<<11; - leftB = rightB = video::getBlue(v1->Color)<<11; - - targetSurface = lockedSurface + span * SurfaceWidth; - zTarget = lockedZBuffer + span * SurfaceWidth; - - if (longest < 0.0f) - { - tmpDiv = 1.0f / (f32)(v2->Pos.Y - v1->Pos.Y); - rightdeltaxf = (v2->Pos.X - v1->Pos.X) * tmpDiv; - rightZStep = (s32)((v2->ZValue - v1->ZValue) * tmpDiv); - rightStepR = (s32)(((s32)(video::getRed(v2->Color)<<11) - rightR) * tmpDiv); - rightStepG = (s32)(((s32)(video::getGreen(v2->Color)<<11) - rightG) * tmpDiv); - rightStepB = (s32)(((s32)(video::getBlue(v2->Color)<<11) - rightB) * tmpDiv); - - tmpDiv = 1.0f / (f32)height; - leftdeltaxf = (v3->Pos.X - v1->Pos.X) * tmpDiv; - leftZStep = (s32)((v3->ZValue - v1->ZValue) * tmpDiv); - leftStepR = (s32)(((s32)(video::getRed(v3->Color)<<11) - leftR) * tmpDiv); - leftStepG = (s32)(((s32)(video::getGreen(v3->Color)<<11) - leftG) * tmpDiv); - leftStepB = (s32)(((s32)(video::getBlue(v3->Color)<<11) - leftB) * tmpDiv); - } - else - { - tmpDiv = 1.0f / (f32)height; - rightdeltaxf = (v3->Pos.X - v1->Pos.X) * tmpDiv; - rightZStep = (s32)((v3->ZValue - v1->ZValue) * tmpDiv); - rightStepR = (s32)(((s32)(video::getRed(v3->Color)<<11) - rightR) * tmpDiv); - rightStepG = (s32)(((s32)(video::getGreen(v3->Color)<<11) - rightG) * tmpDiv); - rightStepB = (s32)(((s32)(video::getBlue(v3->Color)<<11) - rightB) * tmpDiv); - - tmpDiv = 1.0f / (f32)(v2->Pos.Y - v1->Pos.Y); - leftdeltaxf = (v2->Pos.X - v1->Pos.X) * tmpDiv; - leftZStep = (s32)((v2->ZValue - v1->ZValue) * tmpDiv); - leftStepR = (s32)(((s32)(video::getRed(v2->Color)<<11) - leftR) * tmpDiv); - leftStepG = (s32)(((s32)(video::getGreen(v2->Color)<<11) - leftG) * tmpDiv); - leftStepB = (s32)(((s32)(video::getBlue(v2->Color)<<11) - leftB) * tmpDiv); - } - - - // do it twice, once for the first half of the triangle, - // end then for the second half. - - for (s32 triangleHalf=0; triangleHalf<2; ++triangleHalf) - { - if (spanEnd > ViewPortRect.LowerRightCorner.Y) - spanEnd = ViewPortRect.LowerRightCorner.Y; - - // if the span <0, than we can skip these spans, - // and proceed to the next spans which are really on the screen. - if (span < ViewPortRect.UpperLeftCorner.Y) - { - // we'll use leftx as temp variable - if (spanEnd < ViewPortRect.UpperLeftCorner.Y) - { - leftx = spanEnd - span; - span = spanEnd; - } - else - { - leftx = ViewPortRect.UpperLeftCorner.Y - span; - span = ViewPortRect.UpperLeftCorner.Y; - } - - leftxf += leftdeltaxf*leftx; - rightxf += rightdeltaxf*leftx; - targetSurface += SurfaceWidth*leftx; - zTarget += SurfaceWidth*leftx; - leftZValue += leftZStep*leftx; - rightZValue += rightZStep*leftx; - - leftR += leftStepR*leftx; - leftG += leftStepG*leftx; - leftB += leftStepB*leftx; - rightR += rightStepR*leftx; - rightG += rightStepG*leftx; - rightB += rightStepB*leftx; - } - - - // the main loop. Go through every span and draw it. - - while (span < spanEnd) - { - leftx = (s32)(leftxf); - rightx = (s32)(rightxf + 0.5f); - - // perform some clipping - - // TODO: clipping is not correct when leftx is clipped. - - if (leftx<ViewPortRect.UpperLeftCorner.X) - leftx = ViewPortRect.UpperLeftCorner.X; - else - if (leftx>ViewPortRect.LowerRightCorner.X) - leftx = ViewPortRect.LowerRightCorner.X; - - if (rightx<ViewPortRect.UpperLeftCorner.X) - rightx = ViewPortRect.UpperLeftCorner.X; - else - if (rightx>ViewPortRect.LowerRightCorner.X) - rightx = ViewPortRect.LowerRightCorner.X; - - // draw the span - - if (rightx - leftx != 0) - { - tmpDiv = 1.0f / (rightx - leftx); - spanZValue = leftZValue; - spanZStep = (s32)((rightZValue - leftZValue) * tmpDiv); - - hSpanBegin = targetSurface + leftx; - spanZTarget = zTarget + leftx; - hSpanEnd = targetSurface + rightx; - - spanR = leftR; - spanG = leftG; - spanB = leftB; - spanStepR = (s32)((rightR - leftR) * tmpDiv); - spanStepG = (s32)((rightG - leftG) * tmpDiv); - spanStepB = (s32)((rightB - leftB) * tmpDiv); - - while (hSpanBegin < hSpanEnd) - { - if (spanZValue > *spanZTarget) - { - *spanZTarget = spanZValue; - *hSpanBegin = video::RGB16(spanR>>8, spanG>>8, spanB>>8); - } - - spanR += spanStepR; - spanG += spanStepG; - spanB += spanStepB; - - spanZValue += spanZStep; - ++hSpanBegin; - ++spanZTarget; - } - } - - leftxf += leftdeltaxf; - rightxf += rightdeltaxf; - ++span; - targetSurface += SurfaceWidth; - zTarget += SurfaceWidth; - leftZValue += leftZStep; - rightZValue += rightZStep; - - leftR += leftStepR; - leftG += leftStepG; - leftB += leftStepB; - rightR += rightStepR; - rightG += rightStepG; - rightB += rightStepB; - } - - if (triangleHalf>0) // break, we've gout only two halves - break; - - - // setup variables for second half of the triangle. - - if (longest < 0.0f) - { - tmpDiv = 1.0f / (v3->Pos.Y - v2->Pos.Y); - - rightdeltaxf = (v3->Pos.X - v2->Pos.X) * tmpDiv; - rightxf = (f32)v2->Pos.X; - - rightZValue = v2->ZValue; - rightZStep = (s32)((v3->ZValue - v2->ZValue) * tmpDiv); - - rightR = video::getRed(v2->Color)<<11; - rightG = video::getGreen(v2->Color)<<11; - rightB = video::getBlue(v2->Color)<<11; - rightStepR = (s32)(((s32)(video::getRed(v3->Color)<<11) - rightR) * tmpDiv); - rightStepG = (s32)(((s32)(video::getGreen(v3->Color)<<11) - rightG) * tmpDiv); - rightStepB = (s32)(((s32)(video::getBlue(v3->Color)<<11) - rightB) * tmpDiv); - } - else - { - tmpDiv = 1.0f / (v3->Pos.Y - v2->Pos.Y); - - leftdeltaxf = (v3->Pos.X - v2->Pos.X) * tmpDiv; - leftxf = (f32)v2->Pos.X; - - leftZValue = v2->ZValue; - leftZStep = (s32)((v3->ZValue - v2->ZValue) * tmpDiv); - - leftR = video::getRed(v2->Color)<<11; - leftG = video::getGreen(v2->Color)<<11; - leftB = video::getBlue(v2->Color)<<11; - leftStepR = (s32)(((s32)(video::getRed(v3->Color)<<11) - leftR) * tmpDiv); - leftStepG = (s32)(((s32)(video::getGreen(v3->Color)<<11) - leftG) * tmpDiv); - leftStepB = (s32)(((s32)(video::getBlue(v3->Color)<<11) - leftB) * tmpDiv); - } - - - spanEnd = v3->Pos.Y; - } - - } - - ZBuffer->unlock(); - } - -}; - -} // end namespace video -} // end namespace irr - -#endif // _IRR_COMPILE_WITH_SOFTWARE_ - -namespace irr -{ -namespace video -{ - -//! creates a flat triangle renderer -ITriangleRenderer* createTriangleRendererGouraud(IZBuffer* zbuffer) -{ - #ifdef _IRR_COMPILE_WITH_SOFTWARE_ - return new CTRGouraud(zbuffer); - #else - return 0; - #endif // _IRR_COMPILE_WITH_SOFTWARE_ -} - -} // end namespace video -} // end namespace irr - - diff --git a/source/Irrlicht/CTRGouraud2.cpp b/source/Irrlicht/CTRGouraud2.cpp deleted file mode 100644 index 5558f061..00000000 --- a/source/Irrlicht/CTRGouraud2.cpp +++ /dev/null @@ -1,646 +0,0 @@ -// Copyright (C) 2002-2012 Nikolaus Gebhardt / Thomas Alten -// This file is part of the "Irrlicht Engine". -// For conditions of distribution and use, see copyright notice in irrlicht.h - -#include "IrrCompileConfig.h" -#include "IBurningShader.h" - -#ifdef _IRR_COMPILE_WITH_BURNINGSVIDEO_ - -// compile flag for this file -#undef USE_ZBUFFER -#undef IPOL_Z -#undef CMP_Z -#undef WRITE_Z - -#undef IPOL_W -#undef CMP_W -#undef WRITE_W - -#undef SUBTEXEL -#undef INVERSE_W - -#undef IPOL_C0 -#undef IPOL_T0 -#undef IPOL_T1 - -// define render case -#define SUBTEXEL -#define INVERSE_W - -#define USE_ZBUFFER -#define IPOL_W -#define CMP_W -#define WRITE_W - -#define IPOL_C0 -//#define IPOL_T0 -//#define IPOL_T1 - -// apply global override -#ifndef SOFTWARE_DRIVER_2_PERSPECTIVE_CORRECT - #undef INVERSE_W -#endif - -#ifndef SOFTWARE_DRIVER_2_SUBTEXEL - #undef SUBTEXEL -#endif - -#if BURNING_MATERIAL_MAX_COLORS < 1 - #undef IPOL_C0 -#endif - -#if !defined ( SOFTWARE_DRIVER_2_USE_WBUFFER ) && defined ( USE_ZBUFFER ) - #ifndef SOFTWARE_DRIVER_2_PERSPECTIVE_CORRECT - #undef IPOL_W - #endif - #define IPOL_Z - - #ifdef CMP_W - #undef CMP_W - #define CMP_Z - #endif - - #ifdef WRITE_W - #undef WRITE_W - #define WRITE_Z - #endif - -#endif - - -namespace irr -{ - -namespace video -{ - -class CTRGouraud2 : public IBurningShader -{ -public: - - //! constructor - CTRGouraud2(CBurningVideoDriver* driver); - - //! draws an indexed triangle list - virtual void drawTriangle (const s4DVertex* burning_restrict a, const s4DVertex* burning_restrict b, const s4DVertex* burning_restrict c) _IRR_OVERRIDE_; - //virtual bool canWireFrame () { return true; } - -protected: - virtual void fragmentShader(); - -}; - -//! constructor -CTRGouraud2::CTRGouraud2(CBurningVideoDriver* driver) -: IBurningShader(driver) -{ - #ifdef _DEBUG - setDebugName("CTRGouraud2"); - #endif -} - - - -/*! -*/ -void CTRGouraud2::fragmentShader() -{ - tVideoSample *dst; - -#ifdef USE_ZBUFFER - fp24 *z; -#endif - - s32 xStart; - s32 xEnd; - s32 dx; - -#ifdef SUBTEXEL - f32 subPixel; -#endif - -#ifdef IPOL_Z - f32 slopeZ; -#endif -#ifdef IPOL_W - fp24 slopeW; -#endif -#ifdef IPOL_C0 - sVec4 slopeC; -#endif -#ifdef IPOL_T0 - sVec2 slopeT[BURNING_MATERIAL_MAX_TEXTURES]; -#endif - - // apply top-left fill-convention, left - xStart = fill_convention_left( line.x[0] ); - xEnd = fill_convention_right( line.x[1] ); - - dx = xEnd - xStart; - - if ( dx < 0 ) - return; - - // slopes - const f32 invDeltaX = fill_step_x( line.x[1] - line.x[0] ); - -#ifdef IPOL_Z - slopeZ = (line.z[1] - line.z[0]) * invDeltaX; -#endif -#ifdef IPOL_W - slopeW = (line.w[1] - line.w[0]) * invDeltaX; -#endif -#ifdef IPOL_C0 - slopeC = (line.c[0][1] - line.c[0][0]) * invDeltaX; -#endif -#ifdef IPOL_T0 - slopeT[0] = (line.t[0][1] - line.t[0][0]) * invDeltaX; -#endif -#ifdef IPOL_T1 - slopeT[1] = (line.t[1][1] - line.t[1][0]) * invDeltaX; -#endif - -#ifdef SUBTEXEL - subPixel = ( (f32) xStart ) - line.x[0]; -#ifdef IPOL_Z - line.z[0] += slopeZ * subPixel; -#endif -#ifdef IPOL_W - line.w[0] += slopeW * subPixel; -#endif -#ifdef IPOL_C0 - line.c[0][0] += slopeC * subPixel; -#endif -#ifdef IPOL_T0 - line.t[0][0] += slopeT[0] * subPixel; -#endif -#ifdef IPOL_T1 - line.t[1][0] += slopeT[1] * subPixel; -#endif -#endif - - SOFTWARE_DRIVER_2_CLIPCHECK; - dst = (tVideoSample*)RenderTarget->getData() + ( line.y * RenderTarget->getDimension().Width ) + xStart; - -#ifdef USE_ZBUFFER - z = (fp24*) DepthBuffer->lock() + ( line.y * RenderTarget->getDimension().Width ) + xStart; -#endif - - - -#ifdef IPOL_C0 - tFixPoint r0, g0, b0; - - f32 inversew = FIX_POINT_F32_MUL * COLOR_MAX; - -#endif - - for ( s32 i = 0; i <= dx; i += SOFTWARE_DRIVER_2_STEP_X) - { - //if test active only first pixel - if ((0 == EdgeTestPass) & (i > line.x_edgetest)) break; - -#ifdef CMP_Z - if ( line.z[0] < z[i] ) -#endif -#ifdef CMP_W - if (line.w[0] >= z[i] ) -#endif - - { -#ifdef IPOL_C0 - -#ifdef INVERSE_W - inversew = fix_inverse32_color(line.w[0]); -#endif - vec4_to_fix( r0, g0, b0, line.c[0][0],inversew ); - dst[i] = fix_to_sample( r0, g0, b0 ); -#else - dst[i] = PrimitiveColor; -#endif - -#ifdef WRITE_Z - z[i] = line.z[0]; -#endif -#ifdef WRITE_W - z[i] = line.w[0]; -#endif - - } - -#ifdef IPOL_Z - line.z[0] += slopeZ; -#endif -#ifdef IPOL_W - line.w[0] += slopeW; -#endif -#ifdef IPOL_C0 - line.c[0][0] += slopeC; -#endif -#ifdef IPOL_T0 - line.t[0][0] += slopeT[0]; -#endif -#ifdef IPOL_T1 - line.t[1][0] += slopeT[1]; -#endif - } - -} - -void CTRGouraud2::drawTriangle(const s4DVertex* burning_restrict a, const s4DVertex* burning_restrict b, const s4DVertex* burning_restrict c) -{ - // sort on height, y - if ( a->Pos.y > b->Pos.y ) swapVertexPointer(&a, &b); - if ( a->Pos.y > c->Pos.y ) swapVertexPointer(&a, &c); - if ( b->Pos.y > c->Pos.y ) swapVertexPointer(&b, &c); - - const f32 ca = c->Pos.y - a->Pos.y; - const f32 ba = b->Pos.y - a->Pos.y; - const f32 cb = c->Pos.y - b->Pos.y; - // calculate delta y of the edges - - scan.invDeltaY[0] = reciprocal_edge( ca ); - scan.invDeltaY[1] = reciprocal_edge( ba ); - scan.invDeltaY[2] = reciprocal_edge( cb ); - if ( F32_LOWER_EQUAL_0 ( scan.invDeltaY[0] ) ) - return; - - // find if the major edge is left or right aligned - f32 temp[4]; - - temp[0] = a->Pos.x - c->Pos.x; - temp[1] = -ca; - temp[2] = b->Pos.x - a->Pos.x; - temp[3] = ba; - - scan.left = ( temp[0] * temp[3] - temp[1] * temp[2] ) > 0.f ? 0 : 1; - scan.right = 1 - scan.left; - - // calculate slopes for the major edge - scan.slopeX[0] = (c->Pos.x - a->Pos.x) * scan.invDeltaY[0]; - scan.x[0] = a->Pos.x; - -#ifdef IPOL_Z - scan.slopeZ[0] = (c->Pos.z - a->Pos.z) * scan.invDeltaY[0]; - scan.z[0] = a->Pos.z; -#endif - -#ifdef IPOL_W - scan.slopeW[0] = (c->Pos.w - a->Pos.w) * scan.invDeltaY[0]; - scan.w[0] = a->Pos.w; -#endif - -#ifdef IPOL_C0 - scan.slopeC[0][0] = (c->Color[0] - a->Color[0]) * scan.invDeltaY[0]; - scan.c[0][0] = a->Color[0]; -#endif - -#ifdef IPOL_T0 - scan.slopeT[0][0] = (c->Tex[0] - a->Tex[0]) * scan.invDeltaY[0]; - scan.t[0][0] = a->Tex[0]; -#endif - -#ifdef IPOL_T1 - scan.slopeT[1][0] = (c->Tex[1] - a->Tex[1]) * scan.invDeltaY[0]; - scan.t[1][0] = a->Tex[1]; -#endif - - // top left fill convention y run - s32 yStart; - s32 yEnd; - -#ifdef SUBTEXEL - f32 subPixel; -#endif - - - // rasterize upper sub-triangle - if ( (f32) 0.0 != scan.invDeltaY[1] ) - { - // calculate slopes for top edge - scan.slopeX[1] = (b->Pos.x - a->Pos.x) * scan.invDeltaY[1]; - scan.x[1] = a->Pos.x; - -#ifdef IPOL_Z - scan.slopeZ[1] = (b->Pos.z - a->Pos.z) * scan.invDeltaY[1]; - scan.z[1] = a->Pos.z; -#endif - -#ifdef IPOL_W - scan.slopeW[1] = (b->Pos.w - a->Pos.w) * scan.invDeltaY[1]; - scan.w[1] = a->Pos.w; -#endif - -#ifdef IPOL_C0 - scan.slopeC[0][1] = (b->Color[0] - a->Color[0]) * scan.invDeltaY[1]; - scan.c[0][1] = a->Color[0]; -#endif - -#ifdef IPOL_T0 - scan.slopeT[0][1] = (b->Tex[0] - a->Tex[0]) * scan.invDeltaY[1]; - scan.t[0][1] = a->Tex[0]; -#endif - -#ifdef IPOL_T1 - scan.slopeT[1][1] = (b->Tex[1] - a->Tex[1]) * scan.invDeltaY[1]; - scan.t[1][1] = a->Tex[1]; -#endif - - // apply top-left fill convention, top part - yStart = fill_convention_left( a->Pos.y ); - yEnd = fill_convention_right( b->Pos.y ); - -#ifdef SUBTEXEL - subPixel = ( (f32) yStart ) - a->Pos.y; - - // correct to pixel center - scan.x[0] += scan.slopeX[0] * subPixel; - scan.x[1] += scan.slopeX[1] * subPixel; - -#ifdef IPOL_Z - scan.z[0] += scan.slopeZ[0] * subPixel; - scan.z[1] += scan.slopeZ[1] * subPixel; -#endif - -#ifdef IPOL_W - scan.w[0] += scan.slopeW[0] * subPixel; - scan.w[1] += scan.slopeW[1] * subPixel; -#endif - -#ifdef IPOL_C0 - scan.c[0][0] += scan.slopeC[0][0] * subPixel; - scan.c[0][1] += scan.slopeC[0][1] * subPixel; -#endif - -#ifdef IPOL_T0 - scan.t[0][0] += scan.slopeT[0][0] * subPixel; - scan.t[0][1] += scan.slopeT[0][1] * subPixel; -#endif - -#ifdef IPOL_T1 - scan.t[1][0] += scan.slopeT[1][0] * subPixel; - scan.t[1][1] += scan.slopeT[1][1] * subPixel; -#endif - -#endif - - line.x_edgetest = fill_convention_edge(scan.slopeX[scan.left]); - // rasterize the edge scanlines - for( line.y = yStart; line.y <= yEnd; line.y += SOFTWARE_DRIVER_2_STEP_Y) - { - line.x[scan.left] = scan.x[0]; - line.x[scan.right] = scan.x[1]; - -#ifdef IPOL_Z - line.z[scan.left] = scan.z[0]; - line.z[scan.right] = scan.z[1]; -#endif - -#ifdef IPOL_W - line.w[scan.left] = scan.w[0]; - line.w[scan.right] = scan.w[1]; -#endif - -#ifdef IPOL_C0 - line.c[0][scan.left] = scan.c[0][0]; - line.c[0][scan.right] = scan.c[0][1]; -#endif - -#ifdef IPOL_T0 - line.t[0][scan.left] = scan.t[0][0]; - line.t[0][scan.right] = scan.t[0][1]; -#endif - -#ifdef IPOL_T1 - line.t[1][scan.left] = scan.t[1][0]; - line.t[1][scan.right] = scan.t[1][1]; -#endif - - // render a scanline - interlace_scanline fragmentShader(); - if ( EdgeTestPass & edge_test_first_line ) break; - - scan.x[0] += scan.slopeX[0]; - scan.x[1] += scan.slopeX[1]; - -#ifdef IPOL_Z - scan.z[0] += scan.slopeZ[0]; - scan.z[1] += scan.slopeZ[1]; -#endif - -#ifdef IPOL_W - scan.w[0] += scan.slopeW[0]; - scan.w[1] += scan.slopeW[1]; -#endif - -#ifdef IPOL_C0 - scan.c[0][0] += scan.slopeC[0][0]; - scan.c[0][1] += scan.slopeC[0][1]; -#endif - -#ifdef IPOL_T0 - scan.t[0][0] += scan.slopeT[0][0]; - scan.t[0][1] += scan.slopeT[0][1]; -#endif - -#ifdef IPOL_T1 - scan.t[1][0] += scan.slopeT[1][0]; - scan.t[1][1] += scan.slopeT[1][1]; -#endif - - } - } - - // rasterize lower sub-triangle - if ( (f32) 0.0 != scan.invDeltaY[2] ) - { - // advance to middle point - if( (f32) 0.0 != scan.invDeltaY[1] ) - { - temp[0] = b->Pos.y - a->Pos.y; // dy - - scan.x[0] = a->Pos.x + scan.slopeX[0] * temp[0]; -#ifdef IPOL_Z - scan.z[0] = a->Pos.z + scan.slopeZ[0] * temp[0]; -#endif -#ifdef IPOL_W - scan.w[0] = a->Pos.w + scan.slopeW[0] * temp[0]; -#endif -#ifdef IPOL_C0 - scan.c[0][0] = a->Color[0] + scan.slopeC[0][0] * temp[0]; -#endif -#ifdef IPOL_T0 - scan.t[0][0] = a->Tex[0] + scan.slopeT[0][0] * temp[0]; -#endif -#ifdef IPOL_T1 - scan.t[1][0] = a->Tex[1] + scan.slopeT[1][0] * temp[0]; -#endif - - } - - // calculate slopes for bottom edge - scan.slopeX[1] = (c->Pos.x - b->Pos.x) * scan.invDeltaY[2]; - scan.x[1] = b->Pos.x; - -#ifdef IPOL_Z - scan.slopeZ[1] = (c->Pos.z - b->Pos.z) * scan.invDeltaY[2]; - scan.z[1] = b->Pos.z; -#endif - -#ifdef IPOL_W - scan.slopeW[1] = (c->Pos.w - b->Pos.w) * scan.invDeltaY[2]; - scan.w[1] = b->Pos.w; -#endif - -#ifdef IPOL_C0 - scan.slopeC[0][1] = (c->Color[0] - b->Color[0]) * scan.invDeltaY[2]; - scan.c[0][1] = b->Color[0]; -#endif - -#ifdef IPOL_T0 - scan.slopeT[0][1] = (c->Tex[0] - b->Tex[0]) * scan.invDeltaY[2]; - scan.t[0][1] = b->Tex[0]; -#endif - -#ifdef IPOL_T1 - scan.slopeT[1][1] = (c->Tex[1] - b->Tex[1]) * scan.invDeltaY[2]; - scan.t[1][1] = b->Tex[1]; -#endif - - // apply top-left fill convention, top part - yStart = fill_convention_left( b->Pos.y ); - yEnd = fill_convention_right( c->Pos.y ); - -#ifdef SUBTEXEL - subPixel = ( (f32) yStart ) - b->Pos.y; - - // correct to pixel center - scan.x[0] += scan.slopeX[0] * subPixel; - scan.x[1] += scan.slopeX[1] * subPixel; - -#ifdef IPOL_Z - scan.z[0] += scan.slopeZ[0] * subPixel; - scan.z[1] += scan.slopeZ[1] * subPixel; -#endif - -#ifdef IPOL_W - scan.w[0] += scan.slopeW[0] * subPixel; - scan.w[1] += scan.slopeW[1] * subPixel; -#endif - -#ifdef IPOL_C0 - scan.c[0][0] += scan.slopeC[0][0] * subPixel; - scan.c[0][1] += scan.slopeC[0][1] * subPixel; -#endif - -#ifdef IPOL_T0 - scan.t[0][0] += scan.slopeT[0][0] * subPixel; - scan.t[0][1] += scan.slopeT[0][1] * subPixel; -#endif - -#ifdef IPOL_T1 - scan.t[1][0] += scan.slopeT[1][0] * subPixel; - scan.t[1][1] += scan.slopeT[1][1] * subPixel; -#endif - -#endif - - line.x_edgetest = fill_convention_edge(scan.slopeX[scan.left]); - // rasterize the edge scanlines - for( line.y = yStart; line.y <= yEnd; line.y += SOFTWARE_DRIVER_2_STEP_Y) - { - line.x[scan.left] = scan.x[0]; - line.x[scan.right] = scan.x[1]; - -#ifdef IPOL_Z - line.z[scan.left] = scan.z[0]; - line.z[scan.right] = scan.z[1]; -#endif - -#ifdef IPOL_W - line.w[scan.left] = scan.w[0]; - line.w[scan.right] = scan.w[1]; -#endif - -#ifdef IPOL_C0 - line.c[0][scan.left] = scan.c[0][0]; - line.c[0][scan.right] = scan.c[0][1]; -#endif - -#ifdef IPOL_T0 - line.t[0][scan.left] = scan.t[0][0]; - line.t[0][scan.right] = scan.t[0][1]; -#endif - -#ifdef IPOL_T1 - line.t[1][scan.left] = scan.t[1][0]; - line.t[1][scan.right] = scan.t[1][1]; -#endif - - // render a scanline - interlace_scanline fragmentShader(); - if ( EdgeTestPass & edge_test_first_line ) break; - - scan.x[0] += scan.slopeX[0]; - scan.x[1] += scan.slopeX[1]; - -#ifdef IPOL_Z - scan.z[0] += scan.slopeZ[0]; - scan.z[1] += scan.slopeZ[1]; -#endif - -#ifdef IPOL_W - scan.w[0] += scan.slopeW[0]; - scan.w[1] += scan.slopeW[1]; -#endif - -#ifdef IPOL_C0 - scan.c[0][0] += scan.slopeC[0][0]; - scan.c[0][1] += scan.slopeC[0][1]; -#endif - -#ifdef IPOL_T0 - scan.t[0][0] += scan.slopeT[0][0]; - scan.t[0][1] += scan.slopeT[0][1]; -#endif - -#ifdef IPOL_T1 - scan.t[1][0] += scan.slopeT[1][0]; - scan.t[1][1] += scan.slopeT[1][1]; -#endif - - } - } - - -} - - -} // end namespace video -} // end namespace irr - -#endif // _IRR_COMPILE_WITH_BURNINGSVIDEO_ - -namespace irr -{ -namespace video -{ - -//! creates a flat triangle renderer -IBurningShader* createTriangleRendererGouraud2(CBurningVideoDriver* driver) -{ - // ETR_GOURAUD . no texture - #ifdef _IRR_COMPILE_WITH_BURNINGSVIDEO_ - return new CTRGouraud2(driver); - #else - return 0; - #endif // _IRR_COMPILE_WITH_BURNINGSVIDEO_ -} - - -} // end namespace video -} // end namespace irr - - - diff --git a/source/Irrlicht/CTRGouraudAlpha2.cpp b/source/Irrlicht/CTRGouraudAlpha2.cpp deleted file mode 100644 index 7fc27e30..00000000 --- a/source/Irrlicht/CTRGouraudAlpha2.cpp +++ /dev/null @@ -1,651 +0,0 @@ -// Copyright (C) 2002-2012 Nikolaus Gebhardt / Thomas Alten -// This file is part of the "Irrlicht Engine". -// For conditions of distribution and use, see copyright notice in irrlicht.h - -#include "IrrCompileConfig.h" -#include "IBurningShader.h" - -#ifdef _IRR_COMPILE_WITH_BURNINGSVIDEO_ - -// compile flag for this file -#undef USE_ZBUFFER -#undef IPOL_Z -#undef CMP_Z -#undef WRITE_Z - -#undef IPOL_W -#undef CMP_W -#undef WRITE_W - -#undef SUBTEXEL -#undef INVERSE_W - -#undef IPOL_C0 -#undef IPOL_T0 -#undef IPOL_T1 - -// define render case -#define SUBTEXEL -#define INVERSE_W - -#define USE_ZBUFFER -#define IPOL_W -#define CMP_W -#define WRITE_W - -#define IPOL_C0 -//#define IPOL_T0 -//#define IPOL_T1 - -// apply global override -#ifndef SOFTWARE_DRIVER_2_PERSPECTIVE_CORRECT - #undef INVERSE_W -#endif - -#ifndef SOFTWARE_DRIVER_2_SUBTEXEL - #undef SUBTEXEL -#endif - -#if BURNING_MATERIAL_MAX_COLORS < 1 - #undef IPOL_C0 -#endif - -#if !defined ( SOFTWARE_DRIVER_2_USE_WBUFFER ) && defined ( USE_ZBUFFER ) - #ifndef SOFTWARE_DRIVER_2_PERSPECTIVE_CORRECT - #undef IPOL_W - #endif - #define IPOL_Z - - #ifdef CMP_W - #undef CMP_W - #define CMP_Z - #endif - - #ifdef WRITE_W - #undef WRITE_W - #define WRITE_Z - #endif - -#endif - - - -namespace irr -{ - -namespace video -{ - -class CTRGouraudAlpha2 : public IBurningShader -{ -public: - - //! constructor - CTRGouraudAlpha2(CBurningVideoDriver* driver); - - //! draws an indexed triangle list - virtual void drawTriangle ( const s4DVertex* burning_restrict a,const s4DVertex* burning_restrict b,const s4DVertex* burning_restrict c ) _IRR_OVERRIDE_; - - -private: - void fragmentShader(); - -}; - -//! constructor -CTRGouraudAlpha2::CTRGouraudAlpha2(CBurningVideoDriver* driver) -: IBurningShader(driver) -{ - #ifdef _DEBUG - setDebugName("CTRGouraudAlpha2"); - #endif -} - - - -/*! -*/ -void CTRGouraudAlpha2::fragmentShader() -{ - tVideoSample *dst; - -#ifdef USE_ZBUFFER - fp24 *z; -#endif - - s32 xStart; - s32 xEnd; - s32 dx; - - -#ifdef SUBTEXEL - f32 subPixel; -#endif - -#ifdef IPOL_Z - f32 slopeZ; -#endif -#ifdef IPOL_W - fp24 slopeW; -#endif -#ifdef IPOL_C0 - sVec4 slopeC; -#endif -#ifdef IPOL_T0 - sVec2 slopeT[0]; -#endif -#ifdef IPOL_T1 - sVec2 slopeT[1]; -#endif - - // apply top-left fill-convention, left - xStart = fill_convention_left( line.x[0] ); - xEnd = fill_convention_right( line.x[1] ); - - dx = xEnd - xStart; - - if ( dx < 0 ) - return; - - // slopes - const f32 invDeltaX = fill_step_x( line.x[1] - line.x[0] ); - -#ifdef IPOL_Z - slopeZ = (line.z[1] - line.z[0]) * invDeltaX; -#endif -#ifdef IPOL_W - slopeW = (line.w[1] - line.w[0]) * invDeltaX; -#endif -#ifdef IPOL_C0 - slopeC = (line.c[0][1] - line.c[0][0]) * invDeltaX; -#endif -#ifdef IPOL_T0 - slopeT[0] = (line.t[0][1] - line.t[0][0]) * invDeltaX; -#endif -#ifdef IPOL_T1 - slopeT[1] = (line.t[1][1] - line.t[1][0]) * invDeltaX; -#endif - -#ifdef SUBTEXEL - subPixel = ( (f32) xStart ) - line.x[0]; -#ifdef IPOL_Z - line.z[0] += slopeZ * subPixel; -#endif -#ifdef IPOL_W - line.w[0] += slopeW * subPixel; -#endif -#ifdef IPOL_C0 - line.c[0][0] += slopeC * subPixel; -#endif -#ifdef IPOL_T0 - line.t[0][0] += slopeT[0] * subPixel; -#endif -#ifdef IPOL_T1 - line.t[1][0] += slopeT[1] * subPixel; -#endif -#endif - - SOFTWARE_DRIVER_2_CLIPCHECK; - dst = (tVideoSample*)RenderTarget->getData() + ( line.y * RenderTarget->getDimension().Width ) + xStart; - -#ifdef USE_ZBUFFER - z = (fp24*) DepthBuffer->lock() + ( line.y * RenderTarget->getDimension().Width ) + xStart; -#endif - - - -#ifdef IPOL_C0 - - f32 inversew = FIX_POINT_F32_MUL; - - tFixPoint a0; - tFixPoint r0, g0, b0; - tFixPoint r1, g1, b1; - tFixPoint r2, g2, b2; -#endif - - for ( s32 i = 0; i <= dx; i += SOFTWARE_DRIVER_2_STEP_X) - { -#ifdef CMP_Z - if ( line.z[0] < z[i] ) -#endif -#ifdef CMP_W - if ( line.w[0] >= z[i] ) -#endif - - { -#ifdef IPOL_C0 -#ifdef INVERSE_W - inversew = reciprocal_zero_no ( line.w[0] ); -#endif - vec4_to_fix( a0, r0, g0, b0, line.c[0][0],inversew ); - - color_to_fix ( r1, g1, b1, dst[i] ); - - fix_color_norm(a0); - r2 = r1 + imulFix ( a0, r0 - r1 ); - g2 = g1 + imulFix ( a0, g0 - g1 ); - b2 = b1 + imulFix ( a0, b0 - b1 ); - - dst[i] = fix4_to_sample( a0,r2, g2, b2 ); -#else - dst[i] = PrimitiveColor; -#endif -#ifdef WRITE_Z - z[i] = line.z[0]; -#endif -#ifdef WRITE_W - z[i] = line.w[0]; -#endif - - } - -#ifdef IPOL_Z - line.z[0] += slopeZ; -#endif -#ifdef IPOL_W - line.w[0] += slopeW; -#endif -#ifdef IPOL_C0 - line.c[0][0] += slopeC; -#endif -#ifdef IPOL_T0 - line.t[0][0] += slopeT[0]; -#endif -#ifdef IPOL_T1 - line.t[1][0] += slopeT[1]; -#endif - } - -} - -void CTRGouraudAlpha2::drawTriangle(const s4DVertex* burning_restrict a, const s4DVertex* burning_restrict b, const s4DVertex* burning_restrict c) -{ - // sort on height, y - if ( F32_A_GREATER_B ( a->Pos.y , b->Pos.y ) ) swapVertexPointer(&a, &b); - if ( F32_A_GREATER_B ( b->Pos.y , c->Pos.y ) ) swapVertexPointer(&b, &c); - if ( F32_A_GREATER_B ( a->Pos.y , b->Pos.y ) ) swapVertexPointer(&a, &b); - - const f32 ca = c->Pos.y - a->Pos.y; - const f32 ba = b->Pos.y - a->Pos.y; - const f32 cb = c->Pos.y - b->Pos.y; - // calculate delta y of the edges - scan.invDeltaY[0] = fill_step_y( ca ); - scan.invDeltaY[1] = fill_step_y( ba ); - scan.invDeltaY[2] = fill_step_y( cb ); - - if ( F32_LOWER_EQUAL_0 ( scan.invDeltaY[0] ) ) - return; - - // find if the major edge is left or right aligned - f32 temp[4]; - - temp[0] = a->Pos.x - c->Pos.x; - temp[1] = -ca; - temp[2] = b->Pos.x - a->Pos.x; - temp[3] = ba; - - scan.left = ( temp[0] * temp[3] - temp[1] * temp[2] ) > 0.f ? 0 : 1; - scan.right = 1 - scan.left; - - // calculate slopes for the major edge - scan.slopeX[0] = (c->Pos.x - a->Pos.x) * scan.invDeltaY[0]; - scan.x[0] = a->Pos.x; - -#ifdef IPOL_Z - scan.slopeZ[0] = (c->Pos.z - a->Pos.z) * scan.invDeltaY[0]; - scan.z[0] = a->Pos.z; -#endif - -#ifdef IPOL_W - scan.slopeW[0] = (c->Pos.w - a->Pos.w) * scan.invDeltaY[0]; - scan.w[0] = a->Pos.w; -#endif - -#ifdef IPOL_C0 - scan.slopeC[0][0] = (c->Color[0] - a->Color[0]) * scan.invDeltaY[0]; - scan.c[0][0] = a->Color[0]; -#endif - -#ifdef IPOL_T0 - scan.slopeT[0][0] = (c->Tex[0] - a->Tex[0]) * scan.invDeltaY[0]; - scan.t[0][0] = a->Tex[0]; -#endif - -#ifdef IPOL_T1 - scan.slopeT[1][0] = (c->Tex[1] - a->Tex[1]) * scan.invDeltaY[0]; - scan.t[1][0] = a->Tex[1]; -#endif - - // top left fill convention y run - s32 yStart; - s32 yEnd; - -#ifdef SUBTEXEL - f32 subPixel; -#endif - - - // rasterize upper sub-triangle - if ( (f32) 0.0 != scan.invDeltaY[1] ) - { - // calculate slopes for top edge - scan.slopeX[1] = (b->Pos.x - a->Pos.x) * scan.invDeltaY[1]; - scan.x[1] = a->Pos.x; - -#ifdef IPOL_Z - scan.slopeZ[1] = (b->Pos.z - a->Pos.z) * scan.invDeltaY[1]; - scan.z[1] = a->Pos.z; -#endif - -#ifdef IPOL_W - scan.slopeW[1] = (b->Pos.w - a->Pos.w) * scan.invDeltaY[1]; - scan.w[1] = a->Pos.w; -#endif - -#ifdef IPOL_C0 - scan.slopeC[0][1] = (b->Color[0] - a->Color[0]) * scan.invDeltaY[1]; - scan.c[0][1] = a->Color[0]; -#endif - -#ifdef IPOL_T0 - scan.slopeT[0][1] = (b->Tex[0] - a->Tex[0]) * scan.invDeltaY[1]; - scan.t[0][1] = a->Tex[0]; -#endif - -#ifdef IPOL_T1 - scan.slopeT[1][1] = (b->Tex[1] - a->Tex[1]) * scan.invDeltaY[1]; - scan.t[1][1] = a->Tex[1]; -#endif - - // apply top-left fill convention, top part - yStart = fill_convention_left( a->Pos.y ); - yEnd = fill_convention_right( b->Pos.y ); - -#ifdef SUBTEXEL - subPixel = ( (f32) yStart ) - a->Pos.y; - - // correct to pixel center - scan.x[0] += scan.slopeX[0] * subPixel; - scan.x[1] += scan.slopeX[1] * subPixel; - -#ifdef IPOL_Z - scan.z[0] += scan.slopeZ[0] * subPixel; - scan.z[1] += scan.slopeZ[1] * subPixel; -#endif - -#ifdef IPOL_W - scan.w[0] += scan.slopeW[0] * subPixel; - scan.w[1] += scan.slopeW[1] * subPixel; -#endif - -#ifdef IPOL_C0 - scan.c[0][0] += scan.slopeC[0][0] * subPixel; - scan.c[0][1] += scan.slopeC[0][1] * subPixel; -#endif - -#ifdef IPOL_T0 - scan.t[0][0] += scan.slopeT[0][0] * subPixel; - scan.t[0][1] += scan.slopeT[0][1] * subPixel; -#endif - -#ifdef IPOL_T1 - scan.t[1][0] += scan.slopeT[1][0] * subPixel; - scan.t[1][1] += scan.slopeT[1][1] * subPixel; -#endif - -#endif - - // rasterize the edge scanlines - for( line.y = yStart; line.y <= yEnd; line.y += SOFTWARE_DRIVER_2_STEP_Y) - { - line.x[scan.left] = scan.x[0]; - line.x[scan.right] = scan.x[1]; - -#ifdef IPOL_Z - line.z[scan.left] = scan.z[0]; - line.z[scan.right] = scan.z[1]; -#endif - -#ifdef IPOL_W - line.w[scan.left] = scan.w[0]; - line.w[scan.right] = scan.w[1]; -#endif - -#ifdef IPOL_C0 - line.c[0][scan.left] = scan.c[0][0]; - line.c[0][scan.right] = scan.c[0][1]; -#endif - -#ifdef IPOL_T0 - line.t[0][scan.left] = scan.t[0][0]; - line.t[0][scan.right] = scan.t[0][1]; -#endif - -#ifdef IPOL_T1 - line.t[1][scan.left] = scan.t[1][0]; - line.t[1][scan.right] = scan.t[1][1]; -#endif - - // render a scanline - interlace_scanline fragmentShader(); - - scan.x[0] += scan.slopeX[0]; - scan.x[1] += scan.slopeX[1]; - -#ifdef IPOL_Z - scan.z[0] += scan.slopeZ[0]; - scan.z[1] += scan.slopeZ[1]; -#endif - -#ifdef IPOL_W - scan.w[0] += scan.slopeW[0]; - scan.w[1] += scan.slopeW[1]; -#endif - -#ifdef IPOL_C0 - scan.c[0][0] += scan.slopeC[0][0]; - scan.c[0][1] += scan.slopeC[0][1]; -#endif - -#ifdef IPOL_T0 - scan.t[0][0] += scan.slopeT[0][0]; - scan.t[0][1] += scan.slopeT[0][1]; -#endif - -#ifdef IPOL_T1 - scan.t[1][0] += scan.slopeT[1][0]; - scan.t[1][1] += scan.slopeT[1][1]; -#endif - - } - } - - // rasterize lower sub-triangle - if ( (f32) 0.0 != scan.invDeltaY[2] ) - { - // advance to middle point - if( (f32) 0.0 != scan.invDeltaY[1] ) - { - temp[0] = b->Pos.y - a->Pos.y; // dy - - scan.x[0] = a->Pos.x + scan.slopeX[0] * temp[0]; -#ifdef IPOL_Z - scan.z[0] = a->Pos.z + scan.slopeZ[0] * temp[0]; -#endif -#ifdef IPOL_W - scan.w[0] = a->Pos.w + scan.slopeW[0] * temp[0]; -#endif -#ifdef IPOL_C0 - scan.c[0][0] = a->Color[0] + scan.slopeC[0][0] * temp[0]; -#endif -#ifdef IPOL_T0 - scan.t[0][0] = a->Tex[0] + scan.slopeT[0][0] * temp[0]; -#endif -#ifdef IPOL_T1 - scan.t[1][0] = a->Tex[1] + scan.slopeT[1][0] * temp[0]; -#endif - - } - - // calculate slopes for bottom edge - scan.slopeX[1] = (c->Pos.x - b->Pos.x) * scan.invDeltaY[2]; - scan.x[1] = b->Pos.x; - -#ifdef IPOL_Z - scan.slopeZ[1] = (c->Pos.z - b->Pos.z) * scan.invDeltaY[2]; - scan.z[1] = b->Pos.z; -#endif - -#ifdef IPOL_W - scan.slopeW[1] = (c->Pos.w - b->Pos.w) * scan.invDeltaY[2]; - scan.w[1] = b->Pos.w; -#endif - -#ifdef IPOL_C0 - scan.slopeC[0][1] = (c->Color[0] - b->Color[0]) * scan.invDeltaY[2]; - scan.c[0][1] = b->Color[0]; -#endif - -#ifdef IPOL_T0 - scan.slopeT[0][1] = (c->Tex[0] - b->Tex[0]) * scan.invDeltaY[2]; - scan.t[0][1] = b->Tex[0]; -#endif - -#ifdef IPOL_T1 - scan.slopeT[1][1] = (c->Tex[1] - b->Tex[1]) * scan.invDeltaY[2]; - scan.t[1][1] = b->Tex[1]; -#endif - - // apply top-left fill convention, top part - yStart = fill_convention_left( b->Pos.y ); - yEnd = fill_convention_right( c->Pos.y ); - -#ifdef SUBTEXEL - subPixel = ( (f32) yStart ) - b->Pos.y; - - // correct to pixel center - scan.x[0] += scan.slopeX[0] * subPixel; - scan.x[1] += scan.slopeX[1] * subPixel; - -#ifdef IPOL_Z - scan.z[0] += scan.slopeZ[0] * subPixel; - scan.z[1] += scan.slopeZ[1] * subPixel; -#endif - -#ifdef IPOL_W - scan.w[0] += scan.slopeW[0] * subPixel; - scan.w[1] += scan.slopeW[1] * subPixel; -#endif - -#ifdef IPOL_C0 - scan.c[0][0] += scan.slopeC[0][0] * subPixel; - scan.c[0][1] += scan.slopeC[0][1] * subPixel; -#endif - -#ifdef IPOL_T0 - scan.t[0][0] += scan.slopeT[0][0] * subPixel; - scan.t[0][1] += scan.slopeT[0][1] * subPixel; -#endif - -#ifdef IPOL_T1 - scan.t[1][0] += scan.slopeT[1][0] * subPixel; - scan.t[1][1] += scan.slopeT[1][1] * subPixel; -#endif - -#endif - - // rasterize the edge scanlines - for( line.y = yStart; line.y <= yEnd; line.y += SOFTWARE_DRIVER_2_STEP_Y) - { - line.x[scan.left] = scan.x[0]; - line.x[scan.right] = scan.x[1]; - -#ifdef IPOL_Z - line.z[scan.left] = scan.z[0]; - line.z[scan.right] = scan.z[1]; -#endif - -#ifdef IPOL_W - line.w[scan.left] = scan.w[0]; - line.w[scan.right] = scan.w[1]; -#endif - -#ifdef IPOL_C0 - line.c[0][scan.left] = scan.c[0][0]; - line.c[0][scan.right] = scan.c[0][1]; -#endif - -#ifdef IPOL_T0 - line.t[0][scan.left] = scan.t[0][0]; - line.t[0][scan.right] = scan.t[0][1]; -#endif - -#ifdef IPOL_T1 - line.t[1][scan.left] = scan.t[1][0]; - line.t[1][scan.right] = scan.t[1][1]; -#endif - - // render a scanline - interlace_scanline fragmentShader(); - - scan.x[0] += scan.slopeX[0]; - scan.x[1] += scan.slopeX[1]; - -#ifdef IPOL_Z - scan.z[0] += scan.slopeZ[0]; - scan.z[1] += scan.slopeZ[1]; -#endif - -#ifdef IPOL_W - scan.w[0] += scan.slopeW[0]; - scan.w[1] += scan.slopeW[1]; -#endif - -#ifdef IPOL_C0 - scan.c[0][0] += scan.slopeC[0][0]; - scan.c[0][1] += scan.slopeC[0][1]; -#endif - -#ifdef IPOL_T0 - scan.t[0][0] += scan.slopeT[0][0]; - scan.t[0][1] += scan.slopeT[0][1]; -#endif - -#ifdef IPOL_T1 - scan.t[1][0] += scan.slopeT[1][0]; - scan.t[1][1] += scan.slopeT[1][1]; -#endif - - } - } - -} - -} // end namespace video -} // end namespace irr - -#endif // _IRR_COMPILE_WITH_BURNINGSVIDEO_ - -namespace irr -{ -namespace video -{ - -//! creates a flat triangle renderer -IBurningShader* createTriangleRendererGouraudAlpha2(CBurningVideoDriver* driver) -{ - // ETR_GOURAUD_ALPHA unused - #ifdef _IRR_COMPILE_WITH_BURNINGSVIDEO_ - return new CTRGouraudAlpha2(driver); - #else - return 0; - #endif // _IRR_COMPILE_WITH_BURNINGSVIDEO_ -} - - -} // end namespace video -} // end namespace irr - - - diff --git a/source/Irrlicht/CTRGouraudAlphaNoZ2.cpp b/source/Irrlicht/CTRGouraudAlphaNoZ2.cpp deleted file mode 100644 index 08b798a8..00000000 --- a/source/Irrlicht/CTRGouraudAlphaNoZ2.cpp +++ /dev/null @@ -1,651 +0,0 @@ -// Copyright (C) 2002-2012 Nikolaus Gebhardt / Thomas Alten -// This file is part of the "Irrlicht Engine". -// For conditions of distribution and use, see copyright notice in irrlicht.h - -#include "IrrCompileConfig.h" -#include "IBurningShader.h" - -#ifdef _IRR_COMPILE_WITH_BURNINGSVIDEO_ - -// compile flag for this file -#undef USE_ZBUFFER -#undef IPOL_Z -#undef CMP_Z -#undef WRITE_Z - -#undef IPOL_W -#undef CMP_W -#undef WRITE_W - -#undef SUBTEXEL -#undef INVERSE_W - -#undef IPOL_C0 -#undef IPOL_T0 -#undef IPOL_T1 - -// define render case -#define SUBTEXEL -//#define INVERSE_W - -//#define USE_ZBUFFER -//#define IPOL_W -//#define CMP_W -//#define WRITE_W - -#define IPOL_C0 -//#define IPOL_T0 -//#define IPOL_T1 - -// apply global override -#ifndef SOFTWARE_DRIVER_2_PERSPECTIVE_CORRECT - #undef INVERSE_W -#endif - -#ifndef SOFTWARE_DRIVER_2_SUBTEXEL - #undef SUBTEXEL -#endif - -#if BURNING_MATERIAL_MAX_COLORS < 1 - #undef IPOL_C0 -#endif - -#if !defined ( SOFTWARE_DRIVER_2_USE_WBUFFER ) && defined ( USE_ZBUFFER ) - #ifndef SOFTWARE_DRIVER_2_PERSPECTIVE_CORRECT - #undef IPOL_W - #endif - //#define IPOL_Z - - #ifdef CMP_W - #undef CMP_W - #define CMP_Z - #endif - - #ifdef WRITE_W - #undef WRITE_W - #define WRITE_Z - #endif - -#endif - - - -namespace irr -{ - -namespace video -{ - -class CTRGouraudAlphaNoZ2 : public IBurningShader -{ -public: - - //! constructor - CTRGouraudAlphaNoZ2(CBurningVideoDriver* driver); - - //! draws an indexed triangle list - virtual void drawTriangle (const s4DVertex* burning_restrict a, const s4DVertex* burning_restrict b, const s4DVertex* burning_restrict c) _IRR_OVERRIDE_; - - -private: - void fragmentShader(); -}; - -//! constructor -CTRGouraudAlphaNoZ2::CTRGouraudAlphaNoZ2(CBurningVideoDriver* driver) -: IBurningShader(driver) -{ - #ifdef _DEBUG - setDebugName("CTRGouraudAlphaNoZ2"); - #endif -} - - - -/*! -*/ -void CTRGouraudAlphaNoZ2::fragmentShader() -{ - tVideoSample *dst; - -#ifdef USE_ZBUFFER - fp24 *z; -#endif - - s32 xStart; - s32 xEnd; - s32 dx; - - -#ifdef SUBTEXEL - f32 subPixel; -#endif - -#ifdef IPOL_Z - f32 slopeZ; -#endif -#ifdef IPOL_W - fp24 slopeW; -#endif -#ifdef IPOL_C0 - sVec4 slopeC; -#endif -#ifdef IPOL_T0 - sVec2 slopeT[BURNING_MATERIAL_MAX_TEXTURES]; -#endif - - // apply top-left fill-convention, left - xStart = fill_convention_left( line.x[0] ); - xEnd = fill_convention_right( line.x[1] ); - - dx = xEnd - xStart; - - if ( dx < 0 ) - return; - - // slopes - const f32 invDeltaX = fill_step_x( line.x[1] - line.x[0] ); - -#ifdef IPOL_Z - slopeZ = (line.z[1] - line.z[0]) * invDeltaX; -#endif -#ifdef IPOL_W - slopeW = (line.w[1] - line.w[0]) * invDeltaX; -#endif -#ifdef IPOL_C0 - slopeC = (line.c[0][1] - line.c[0][0]) * invDeltaX; -#endif -#ifdef IPOL_T0 - slopeT[0] = (line.t[0][1] - line.t[0][0]) * invDeltaX; -#endif -#ifdef IPOL_T1 - slopeT[1] = (line.t[1][1] - line.t[1][0]) * invDeltaX; -#endif - -#ifdef SUBTEXEL - subPixel = ( (f32) xStart ) - line.x[0]; -#ifdef IPOL_Z - line.z[0] += slopeZ * subPixel; -#endif -#ifdef IPOL_W - line.w[0] += slopeW * subPixel; -#endif -#ifdef IPOL_C0 - line.c[0][0] += slopeC * subPixel; -#endif -#ifdef IPOL_T0 - line.t[0][0] += slopeT[0] * subPixel; -#endif -#ifdef IPOL_T1 - line.t[1][0] += slopeT[1] * subPixel; -#endif -#endif - - SOFTWARE_DRIVER_2_CLIPCHECK; - dst = (tVideoSample*)RenderTarget->getData() + ( line.y * RenderTarget->getDimension().Width ) + xStart; - -#ifdef USE_ZBUFFER - z = (fp24*) DepthBuffer->lock() + ( line.y * RenderTarget->getDimension().Width ) + xStart; -#endif - - - - f32 inversew = FIX_POINT_F32_MUL * COLOR_MAX; - -#ifdef IPOL_C0 - - - tFixPoint a0; - tFixPoint r0, g0, b0; - tFixPoint r1, g1, b1; - tFixPoint r2, g2, b2; -#endif - - for ( s32 i = 0; i <= dx; i += SOFTWARE_DRIVER_2_STEP_X) - { -#ifdef CMP_Z - if ( line.z[0] < z[i] ) -#endif -#ifdef CMP_W - if ( line.w[0] >= z[i] ) -#endif - { - -#ifdef WRITE_Z - z[i] = line.z[0]; -#endif - -#ifdef WRITE_W - z[i] = line.w[0]; -#endif - -#ifdef IPOL_C0 -#ifdef IPOL_W - inversew = fix_inverse32_color(line.w[0]); -#endif - - vec4_to_fix( a0, r0, g0, b0, line.c[0][0],inversew ); - - color_to_fix ( r1, g1, b1, dst[i] ); - - fix_color_norm(a0); - r2 = r1 + imulFix ( a0, r0 - r1 ); - g2 = g1 + imulFix ( a0, g0 - g1 ); - b2 = b1 + imulFix ( a0, b0 - b1 ); - - dst[i] = fix_to_sample( r2, g2, b2 ); -#else - dst[i] = PrimitiveColor; -#endif - - - } - -#ifdef IPOL_Z - line.z[0] += slopeZ; -#endif -#ifdef IPOL_W - line.w[0] += slopeW; -#endif -#ifdef IPOL_C0 - line.c[0][0] += slopeC; -#endif -#ifdef IPOL_T0 - line.t[0][0] += slopeT[0]; -#endif -#ifdef IPOL_T1 - line.t[1][0] += slopeT[1]; -#endif - } - -} - -void CTRGouraudAlphaNoZ2::drawTriangle(const s4DVertex* burning_restrict a, const s4DVertex* burning_restrict b, const s4DVertex* burning_restrict c) -{ - // sort on height, y - if ( F32_A_GREATER_B ( a->Pos.y , b->Pos.y ) ) swapVertexPointer(&a, &b); - if ( F32_A_GREATER_B ( b->Pos.y , c->Pos.y ) ) swapVertexPointer(&b, &c); - if ( F32_A_GREATER_B ( a->Pos.y , b->Pos.y ) ) swapVertexPointer(&a, &b); - - const f32 ca = c->Pos.y - a->Pos.y; - const f32 ba = b->Pos.y - a->Pos.y; - const f32 cb = c->Pos.y - b->Pos.y; - // calculate delta y of the edges - scan.invDeltaY[0] = fill_step_y( ca ); - scan.invDeltaY[1] = fill_step_y( ba ); - scan.invDeltaY[2] = fill_step_y( cb ); - - if ( F32_LOWER_EQUAL_0 ( scan.invDeltaY[0] ) ) - return; - - // find if the major edge is left or right aligned - f32 temp[4]; - - temp[0] = a->Pos.x - c->Pos.x; - temp[1] = -ca; - temp[2] = b->Pos.x - a->Pos.x; - temp[3] = ba; - - scan.left = ( temp[0] * temp[3] - temp[1] * temp[2] ) > 0.f ? 0 : 1; - scan.right = 1 - scan.left; - - // calculate slopes for the major edge - scan.slopeX[0] = (c->Pos.x - a->Pos.x) * scan.invDeltaY[0]; - scan.x[0] = a->Pos.x; - -#ifdef IPOL_Z - scan.slopeZ[0] = (c->Pos.z - a->Pos.z) * scan.invDeltaY[0]; - scan.z[0] = a->Pos.z; -#endif - -#ifdef IPOL_W - scan.slopeW[0] = (c->Pos.w - a->Pos.w) * scan.invDeltaY[0]; - scan.w[0] = a->Pos.w; -#endif - -#ifdef IPOL_C0 - scan.slopeC[0][0] = (c->Color[0] - a->Color[0]) * scan.invDeltaY[0]; - scan.c[0][0] = a->Color[0]; -#endif - -#ifdef IPOL_T0 - scan.slopeT[0][0] = (c->Tex[0] - a->Tex[0]) * scan.invDeltaY[0]; - scan.t[0][0] = a->Tex[0]; -#endif - -#ifdef IPOL_T1 - scan.slopeT[1][0] = (c->Tex[1] - a->Tex[1]) * scan.invDeltaY[0]; - scan.t[1][0] = a->Tex[1]; -#endif - - // top left fill convention y run - s32 yStart; - s32 yEnd; - -#ifdef SUBTEXEL - f32 subPixel; -#endif - - // rasterize upper sub-triangle - if ( (f32) 0.0 != scan.invDeltaY[1] ) - { - // calculate slopes for top edge - scan.slopeX[1] = (b->Pos.x - a->Pos.x) * scan.invDeltaY[1]; - scan.x[1] = a->Pos.x; - -#ifdef IPOL_Z - scan.slopeZ[1] = (b->Pos.z - a->Pos.z) * scan.invDeltaY[1]; - scan.z[1] = a->Pos.z; -#endif - -#ifdef IPOL_W - scan.slopeW[1] = (b->Pos.w - a->Pos.w) * scan.invDeltaY[1]; - scan.w[1] = a->Pos.w; -#endif - -#ifdef IPOL_C0 - scan.slopeC[0][1] = (b->Color[0] - a->Color[0]) * scan.invDeltaY[1]; - scan.c[0][1] = a->Color[0]; -#endif - -#ifdef IPOL_T0 - scan.slopeT[0][1] = (b->Tex[0] - a->Tex[0]) * scan.invDeltaY[1]; - scan.t[0][1] = a->Tex[0]; -#endif - -#ifdef IPOL_T1 - scan.slopeT[1][1] = (b->Tex[1] - a->Tex[1]) * scan.invDeltaY[1]; - scan.t[1][1] = a->Tex[1]; -#endif - - // apply top-left fill convention, top part - yStart = fill_convention_left( a->Pos.y ); - yEnd = fill_convention_right( b->Pos.y ); - -#ifdef SUBTEXEL - subPixel = ( (f32) yStart ) - a->Pos.y; - - // correct to pixel center - scan.x[0] += scan.slopeX[0] * subPixel; - scan.x[1] += scan.slopeX[1] * subPixel; - -#ifdef IPOL_Z - scan.z[0] += scan.slopeZ[0] * subPixel; - scan.z[1] += scan.slopeZ[1] * subPixel; -#endif - -#ifdef IPOL_W - scan.w[0] += scan.slopeW[0] * subPixel; - scan.w[1] += scan.slopeW[1] * subPixel; -#endif - -#ifdef IPOL_C0 - scan.c[0][0] += scan.slopeC[0][0] * subPixel; - scan.c[0][1] += scan.slopeC[0][1] * subPixel; -#endif - -#ifdef IPOL_T0 - scan.t[0][0] += scan.slopeT[0][0] * subPixel; - scan.t[0][1] += scan.slopeT[0][1] * subPixel; -#endif - -#ifdef IPOL_T1 - scan.t[1][0] += scan.slopeT[1][0] * subPixel; - scan.t[1][1] += scan.slopeT[1][1] * subPixel; -#endif - -#endif - - // rasterize the edge scanlines - for( line.y = yStart; line.y <= yEnd; line.y += SOFTWARE_DRIVER_2_STEP_Y) - { - line.x[scan.left] = scan.x[0]; - line.x[scan.right] = scan.x[1]; - -#ifdef IPOL_Z - line.z[scan.left] = scan.z[0]; - line.z[scan.right] = scan.z[1]; -#endif - -#ifdef IPOL_W - line.w[scan.left] = scan.w[0]; - line.w[scan.right] = scan.w[1]; -#endif - -#ifdef IPOL_C0 - line.c[0][scan.left] = scan.c[0][0]; - line.c[0][scan.right] = scan.c[0][1]; -#endif - -#ifdef IPOL_T0 - line.t[0][scan.left] = scan.t[0][0]; - line.t[0][scan.right] = scan.t[0][1]; -#endif - -#ifdef IPOL_T1 - line.t[1][scan.left] = scan.t[1][0]; - line.t[1][scan.right] = scan.t[1][1]; -#endif - - // render a scanline - interlace_scanline fragmentShader(); - - scan.x[0] += scan.slopeX[0]; - scan.x[1] += scan.slopeX[1]; - -#ifdef IPOL_Z - scan.z[0] += scan.slopeZ[0]; - scan.z[1] += scan.slopeZ[1]; -#endif - -#ifdef IPOL_W - scan.w[0] += scan.slopeW[0]; - scan.w[1] += scan.slopeW[1]; -#endif - -#ifdef IPOL_C0 - scan.c[0][0] += scan.slopeC[0][0]; - scan.c[0][1] += scan.slopeC[0][1]; -#endif - -#ifdef IPOL_T0 - scan.t[0][0] += scan.slopeT[0][0]; - scan.t[0][1] += scan.slopeT[0][1]; -#endif - -#ifdef IPOL_T1 - scan.t[1][0] += scan.slopeT[1][0]; - scan.t[1][1] += scan.slopeT[1][1]; -#endif - - } - } - - // rasterize lower sub-triangle - if ( (f32) 0.0 != scan.invDeltaY[2] ) - { - // advance to middle point - if( (f32) 0.0 != scan.invDeltaY[1] ) - { - temp[0] = b->Pos.y - a->Pos.y; // dy - - scan.x[0] = a->Pos.x + scan.slopeX[0] * temp[0]; -#ifdef IPOL_Z - scan.z[0] = a->Pos.z + scan.slopeZ[0] * temp[0]; -#endif -#ifdef IPOL_W - scan.w[0] = a->Pos.w + scan.slopeW[0] * temp[0]; -#endif -#ifdef IPOL_C0 - scan.c[0][0] = a->Color[0] + scan.slopeC[0][0] * temp[0]; -#endif -#ifdef IPOL_T0 - scan.t[0][0] = a->Tex[0] + scan.slopeT[0][0] * temp[0]; -#endif -#ifdef IPOL_T1 - scan.t[1][0] = a->Tex[1] + scan.slopeT[1][0] * temp[0]; -#endif - - } - - // calculate slopes for bottom edge - scan.slopeX[1] = (c->Pos.x - b->Pos.x) * scan.invDeltaY[2]; - scan.x[1] = b->Pos.x; - -#ifdef IPOL_Z - scan.slopeZ[1] = (c->Pos.z - b->Pos.z) * scan.invDeltaY[2]; - scan.z[1] = b->Pos.z; -#endif - -#ifdef IPOL_W - scan.slopeW[1] = (c->Pos.w - b->Pos.w) * scan.invDeltaY[2]; - scan.w[1] = b->Pos.w; -#endif - -#ifdef IPOL_C0 - scan.slopeC[0][1] = (c->Color[0] - b->Color[0]) * scan.invDeltaY[2]; - scan.c[0][1] = b->Color[0]; -#endif - -#ifdef IPOL_T0 - scan.slopeT[0][1] = (c->Tex[0] - b->Tex[0]) * scan.invDeltaY[2]; - scan.t[0][1] = b->Tex[0]; -#endif - -#ifdef IPOL_T1 - scan.slopeT[1][1] = (c->Tex[1] - b->Tex[1]) * scan.invDeltaY[2]; - scan.t[1][1] = b->Tex[1]; -#endif - - // apply top-left fill convention, top part - yStart = fill_convention_left( b->Pos.y ); - yEnd = fill_convention_right( c->Pos.y ); - -#ifdef SUBTEXEL - - subPixel = ( (f32) yStart ) - b->Pos.y; - - // correct to pixel center - scan.x[0] += scan.slopeX[0] * subPixel; - scan.x[1] += scan.slopeX[1] * subPixel; - -#ifdef IPOL_Z - scan.z[0] += scan.slopeZ[0] * subPixel; - scan.z[1] += scan.slopeZ[1] * subPixel; -#endif - -#ifdef IPOL_W - scan.w[0] += scan.slopeW[0] * subPixel; - scan.w[1] += scan.slopeW[1] * subPixel; -#endif - -#ifdef IPOL_C0 - scan.c[0][0] += scan.slopeC[0][0] * subPixel; - scan.c[0][1] += scan.slopeC[0][1] * subPixel; -#endif - -#ifdef IPOL_T0 - scan.t[0][0] += scan.slopeT[0][0] * subPixel; - scan.t[0][1] += scan.slopeT[0][1] * subPixel; -#endif - -#ifdef IPOL_T1 - scan.t[1][0] += scan.slopeT[1][0] * subPixel; - scan.t[1][1] += scan.slopeT[1][1] * subPixel; -#endif - -#endif - - // rasterize the edge scanlines - for( line.y = yStart; line.y <= yEnd; line.y += SOFTWARE_DRIVER_2_STEP_Y) - { - line.x[scan.left] = scan.x[0]; - line.x[scan.right] = scan.x[1]; - -#ifdef IPOL_Z - line.z[scan.left] = scan.z[0]; - line.z[scan.right] = scan.z[1]; -#endif - -#ifdef IPOL_W - line.w[scan.left] = scan.w[0]; - line.w[scan.right] = scan.w[1]; -#endif - -#ifdef IPOL_C0 - line.c[0][scan.left] = scan.c[0][0]; - line.c[0][scan.right] = scan.c[0][1]; -#endif - -#ifdef IPOL_T0 - line.t[0][scan.left] = scan.t[0][0]; - line.t[0][scan.right] = scan.t[0][1]; -#endif - -#ifdef IPOL_T1 - line.t[1][scan.left] = scan.t[1][0]; - line.t[1][scan.right] = scan.t[1][1]; -#endif - - // render a scanline - interlace_scanline fragmentShader(); - - scan.x[0] += scan.slopeX[0]; - scan.x[1] += scan.slopeX[1]; - -#ifdef IPOL_Z - scan.z[0] += scan.slopeZ[0]; - scan.z[1] += scan.slopeZ[1]; -#endif - -#ifdef IPOL_W - scan.w[0] += scan.slopeW[0]; - scan.w[1] += scan.slopeW[1]; -#endif - -#ifdef IPOL_C0 - scan.c[0][0] += scan.slopeC[0][0]; - scan.c[0][1] += scan.slopeC[0][1]; -#endif - -#ifdef IPOL_T0 - scan.t[0][0] += scan.slopeT[0][0]; - scan.t[0][1] += scan.slopeT[0][1]; -#endif - -#ifdef IPOL_T1 - scan.t[1][0] += scan.slopeT[1][0]; - scan.t[1][1] += scan.slopeT[1][1]; -#endif - - } - } - -} - -} // end namespace video -} // end namespace irr - -#endif // _IRR_COMPILE_WITH_BURNINGSVIDEO_ - -namespace irr -{ -namespace video -{ - -//! creates a flat triangle renderer -IBurningShader* createTRGouraudAlphaNoZ2(CBurningVideoDriver* driver) -{ - //ETR_GOURAUD_ALPHA_NOZ - draw2DRectangle Gradient - #ifdef _IRR_COMPILE_WITH_BURNINGSVIDEO_ - return new CTRGouraudAlphaNoZ2(driver); - #else - return 0; - #endif // _IRR_COMPILE_WITH_BURNINGSVIDEO_ -} - - -} // end namespace video -} // end namespace irr - - diff --git a/source/Irrlicht/CTRGouraudNoZ2.cpp b/source/Irrlicht/CTRGouraudNoZ2.cpp deleted file mode 100644 index b7201832..00000000 --- a/source/Irrlicht/CTRGouraudNoZ2.cpp +++ /dev/null @@ -1,643 +0,0 @@ -// Copyright (C) 2002-2012 Nikolaus Gebhardt / Thomas Alten -// This file is part of the "Irrlicht Engine". -// For conditions of distribution and use, see copyright notice in irrlicht.h - -#include "IrrCompileConfig.h" -#include "IBurningShader.h" - -#ifdef _IRR_COMPILE_WITH_BURNINGSVIDEO_ - -// compile flag for this file -#undef USE_ZBUFFER -#undef IPOL_Z -#undef CMP_Z -#undef WRITE_Z - -#undef IPOL_W -#undef CMP_W -#undef WRITE_W - -#undef SUBTEXEL -#undef INVERSE_W - -#undef IPOL_C0 -#undef IPOL_T0 -#undef IPOL_T1 - -// define render case -#define SUBTEXEL -#define INVERSE_W - -#define USE_ZBUFFER -#define IPOL_W -//#define CMP_W -//#define WRITE_W - -#define IPOL_C0 -//#define IPOL_T0 -//#define IPOL_T1 - -// apply global override -#ifndef SOFTWARE_DRIVER_2_PERSPECTIVE_CORRECT - #undef INVERSE_W -#endif - -#ifndef SOFTWARE_DRIVER_2_SUBTEXEL - #undef SUBTEXEL -#endif - -#if BURNING_MATERIAL_MAX_COLORS < 1 - #undef IPOL_C0 -#endif - -#if !defined ( SOFTWARE_DRIVER_2_USE_WBUFFER ) && defined ( USE_ZBUFFER ) - #ifndef SOFTWARE_DRIVER_2_PERSPECTIVE_CORRECT - #undef IPOL_W - #endif - #define IPOL_Z - - #ifdef CMP_W - #undef CMP_W - #define CMP_Z - #endif - - #ifdef WRITE_W - #undef WRITE_W - #define WRITE_Z - #endif - -#endif - - -namespace irr -{ - -namespace video -{ - -class CTRGouraudNoZ2 : public IBurningShader -{ -public: - - //! constructor - CTRGouraudNoZ2(CBurningVideoDriver* driver); - - //! draws an indexed triangle list - virtual void drawTriangle(const s4DVertex* burning_restrict a, const s4DVertex* burning_restrict b, const s4DVertex* burning_restrict c) _IRR_OVERRIDE_; - virtual bool canWireFrame () { return true; } - -protected: - virtual void fragmentShader(); -}; - -//! constructor -CTRGouraudNoZ2::CTRGouraudNoZ2(CBurningVideoDriver* driver) -: IBurningShader(driver) -{ - #ifdef _DEBUG - setDebugName("CTRGouraudNoZ2"); - #endif -} - - - -/*! -*/ -void CTRGouraudNoZ2::fragmentShader() -{ - tVideoSample *dst; - -#ifdef USE_ZBUFFER - //fp24 *z; -#endif - - s32 xStart; - s32 xEnd; - s32 dx; - -#ifdef SUBTEXEL - f32 subPixel; -#endif - -#ifdef IPOL_Z - f32 slopeZ; -#endif -#ifdef IPOL_W - fp24 slopeW; -#endif -#ifdef IPOL_C0 - sVec4 slopeC; -#endif -#ifdef IPOL_T0 - sVec2 slopeT[BURNING_MATERIAL_MAX_TEXTURES]; -#endif - - // apply top-left fill-convention, left - xStart = fill_convention_left( line.x[0] ); - xEnd = fill_convention_right( line.x[1] ); - - dx = xEnd - xStart; - - if ( dx < 0 ) - return; - - // slopes - const f32 invDeltaX = fill_step_x( line.x[1] - line.x[0] ); - -#ifdef IPOL_Z - slopeZ = (line.z[1] - line.z[0]) * invDeltaX; -#endif -#ifdef IPOL_W - slopeW = (line.w[1] - line.w[0]) * invDeltaX; -#endif -#ifdef IPOL_C0 - slopeC = (line.c[0][1] - line.c[0][0]) * invDeltaX; -#endif -#ifdef IPOL_T0 - slopeT[0] = (line.t[0][1] - line.t[0][0]) * invDeltaX; -#endif -#ifdef IPOL_T1 - slopeT[1] = (line.t[1][1] - line.t[1][0]) * invDeltaX; -#endif - -#ifdef SUBTEXEL - subPixel = ( (f32) xStart ) - line.x[0]; -#ifdef IPOL_Z - line.z[0] += slopeZ * subPixel; -#endif -#ifdef IPOL_W - line.w[0] += slopeW * subPixel; -#endif -#ifdef IPOL_C0 - line.c[0][0] += slopeC * subPixel; -#endif -#ifdef IPOL_T0 - line.t[0][0] += slopeT[0] * subPixel; -#endif -#ifdef IPOL_T1 - line.t[1][0] += slopeT[1] * subPixel; -#endif -#endif - - SOFTWARE_DRIVER_2_CLIPCHECK; - dst = (tVideoSample*)RenderTarget->getData() + ( line.y * RenderTarget->getDimension().Width ) + xStart; - -#ifdef USE_ZBUFFER - //z = (fp24*) DepthBuffer->lock() + ( line.y * RenderTarget->getDimension().Width ) + xStart; -#endif - - - -#ifdef IPOL_C0 - tFixPoint r0, g0, b0; - - f32 inversew = FIX_POINT_F32_MUL * COLOR_MAX; - -#endif - - for ( s32 i = 0; i <= dx; i += SOFTWARE_DRIVER_2_STEP_X) - { - if ((0 == EdgeTestPass) & (i > line.x_edgetest)) break; - -#ifdef CMP_Z - if ( line.z[0] < z[i] ) -#endif -#ifdef CMP_W - if (line.w[0] >= z[i] ) -#endif - - { -#ifdef IPOL_C0 -#ifdef INVERSE_W - inversew = fix_inverse32_color(line.w[0]); -#endif - vec4_to_fix(r0, g0, b0, line.c[0][0], inversew); - dst[i] = fix_to_sample(r0, g0, b0); -#else - dst[i] = PrimitiveColor; -#endif - -#ifdef WRITE_Z - z[i] = line.z[0]; -#endif -#ifdef WRITE_W - z[i] = line.w[0]; -#endif - - } - -#ifdef IPOL_Z - line.z[0] += slopeZ; -#endif -#ifdef IPOL_W - line.w[0] += slopeW; -#endif -#ifdef IPOL_C0 - line.c[0][0] += slopeC; -#endif -#ifdef IPOL_T0 - line.t[0][0] += slopeT[0]; -#endif -#ifdef IPOL_T1 - line.t[1][0] += slopeT[1]; -#endif - } - -} - -void CTRGouraudNoZ2::drawTriangle(const s4DVertex* burning_restrict a, const s4DVertex* burning_restrict b, const s4DVertex* burning_restrict c) -{ - // sort on height, y - if ( a->Pos.y > b->Pos.y ) swapVertexPointer(&a, &b); - if ( a->Pos.y > c->Pos.y ) swapVertexPointer(&a, &c); - if ( b->Pos.y > c->Pos.y ) swapVertexPointer(&b, &c); - - const f32 ca = c->Pos.y - a->Pos.y; - const f32 ba = b->Pos.y - a->Pos.y; - const f32 cb = c->Pos.y - b->Pos.y; - - // calculate delta y of the edges - scan.invDeltaY[0] = reciprocal_edge( ca ); - scan.invDeltaY[1] = reciprocal_edge( ba ); - scan.invDeltaY[2] = reciprocal_edge( cb ); - - if ( F32_LOWER_EQUAL_0 ( scan.invDeltaY[0] ) ) - return; - - // find if the major edge is left or right aligned - f32 temp[4]; - - temp[0] = a->Pos.x - c->Pos.x; - temp[1] = -ca; - temp[2] = b->Pos.x - a->Pos.x; - temp[3] = ba; - - scan.left = ( temp[0] * temp[3] - temp[1] * temp[2] ) > 0.f ? 0 : 1; - scan.right = 1 - scan.left; - - // calculate slopes for the major edge - scan.slopeX[0] = (c->Pos.x - a->Pos.x) * scan.invDeltaY[0]; - scan.x[0] = a->Pos.x; - -#ifdef IPOL_Z - scan.slopeZ[0] = (c->Pos.z - a->Pos.z) * scan.invDeltaY[0]; - scan.z[0] = a->Pos.z; -#endif - -#ifdef IPOL_W - scan.slopeW[0] = (c->Pos.w - a->Pos.w) * scan.invDeltaY[0]; - scan.w[0] = a->Pos.w; -#endif - -#ifdef IPOL_C0 - scan.slopeC[0][0] = (c->Color[0] - a->Color[0]) * scan.invDeltaY[0]; - scan.c[0][0] = a->Color[0]; -#endif - -#ifdef IPOL_T0 - scan.slopeT[0][0] = (c->Tex[0] - a->Tex[0]) * scan.invDeltaY[0]; - scan.t[0][0] = a->Tex[0]; -#endif - -#ifdef IPOL_T1 - scan.slopeT[1][0] = (c->Tex[1] - a->Tex[1]) * scan.invDeltaY[0]; - scan.t[1][0] = a->Tex[1]; -#endif - - // top left fill convention y run - s32 yStart; - s32 yEnd; - -#ifdef SUBTEXEL - f32 subPixel; -#endif - - - // rasterize upper sub-triangle - if ( (f32) 0.0 != scan.invDeltaY[1] ) - { - // calculate slopes for top edge - scan.slopeX[1] = (b->Pos.x - a->Pos.x) * scan.invDeltaY[1]; - scan.x[1] = a->Pos.x; - -#ifdef IPOL_Z - scan.slopeZ[1] = (b->Pos.z - a->Pos.z) * scan.invDeltaY[1]; - scan.z[1] = a->Pos.z; -#endif - -#ifdef IPOL_W - scan.slopeW[1] = (b->Pos.w - a->Pos.w) * scan.invDeltaY[1]; - scan.w[1] = a->Pos.w; -#endif - -#ifdef IPOL_C0 - scan.slopeC[0][1] = (b->Color[0] - a->Color[0]) * scan.invDeltaY[1]; - scan.c[0][1] = a->Color[0]; -#endif - -#ifdef IPOL_T0 - scan.slopeT[0][1] = (b->Tex[0] - a->Tex[0]) * scan.invDeltaY[1]; - scan.t[0][1] = a->Tex[0]; -#endif - -#ifdef IPOL_T1 - scan.slopeT[1][1] = (b->Tex[1] - a->Tex[1]) * scan.invDeltaY[1]; - scan.t[1][1] = a->Tex[1]; -#endif - - // apply top-left fill convention, top part - yStart = fill_convention_left( a->Pos.y ); - yEnd = fill_convention_right( b->Pos.y ); - -#ifdef SUBTEXEL - subPixel = ( (f32) yStart ) - a->Pos.y; - - // correct to pixel center - scan.x[0] += scan.slopeX[0] * subPixel; - scan.x[1] += scan.slopeX[1] * subPixel; - -#ifdef IPOL_Z - scan.z[0] += scan.slopeZ[0] * subPixel; - scan.z[1] += scan.slopeZ[1] * subPixel; -#endif - -#ifdef IPOL_W - scan.w[0] += scan.slopeW[0] * subPixel; - scan.w[1] += scan.slopeW[1] * subPixel; -#endif - -#ifdef IPOL_C0 - scan.c[0][0] += scan.slopeC[0][0] * subPixel; - scan.c[0][1] += scan.slopeC[0][1] * subPixel; -#endif - -#ifdef IPOL_T0 - scan.t[0][0] += scan.slopeT[0][0] * subPixel; - scan.t[0][1] += scan.slopeT[0][1] * subPixel; -#endif - -#ifdef IPOL_T1 - scan.t[1][0] += scan.slopeT[1][0] * subPixel; - scan.t[1][1] += scan.slopeT[1][1] * subPixel; -#endif - -#endif - - line.x_edgetest = fill_convention_edge(scan.slopeX[scan.left]); - - // rasterize the edge scanlines - for( line.y = yStart; line.y <= yEnd; line.y += SOFTWARE_DRIVER_2_STEP_Y) - { - line.x[scan.left] = scan.x[0]; - line.x[scan.right] = scan.x[1]; - -#ifdef IPOL_Z - line.z[scan.left] = scan.z[0]; - line.z[scan.right] = scan.z[1]; -#endif - -#ifdef IPOL_W - line.w[scan.left] = scan.w[0]; - line.w[scan.right] = scan.w[1]; -#endif - -#ifdef IPOL_C0 - line.c[0][scan.left] = scan.c[0][0]; - line.c[0][scan.right] = scan.c[0][1]; -#endif - -#ifdef IPOL_T0 - line.t[0][scan.left] = scan.t[0][0]; - line.t[0][scan.right] = scan.t[0][1]; -#endif - -#ifdef IPOL_T1 - line.t[1][scan.left] = scan.t[1][0]; - line.t[1][scan.right] = scan.t[1][1]; -#endif - - // render a scanline - interlace_scanline fragmentShader(); - if ( EdgeTestPass & edge_test_first_line ) break; - - scan.x[0] += scan.slopeX[0]; - scan.x[1] += scan.slopeX[1]; - -#ifdef IPOL_Z - scan.z[0] += scan.slopeZ[0]; - scan.z[1] += scan.slopeZ[1]; -#endif - -#ifdef IPOL_W - scan.w[0] += scan.slopeW[0]; - scan.w[1] += scan.slopeW[1]; -#endif - -#ifdef IPOL_C0 - scan.c[0][0] += scan.slopeC[0][0]; - scan.c[0][1] += scan.slopeC[0][1]; -#endif - -#ifdef IPOL_T0 - scan.t[0][0] += scan.slopeT[0][0]; - scan.t[0][1] += scan.slopeT[0][1]; -#endif - -#ifdef IPOL_T1 - scan.t[1][0] += scan.slopeT[1][0]; - scan.t[1][1] += scan.slopeT[1][1]; -#endif - } - } - - // rasterize lower sub-triangle - if ( (f32) 0.0 != scan.invDeltaY[2] ) - { - // advance to middle point - if( (f32) 0.0 != scan.invDeltaY[1] ) - { - temp[0] = b->Pos.y - a->Pos.y; // dy - - scan.x[0] = a->Pos.x + scan.slopeX[0] * temp[0]; -#ifdef IPOL_Z - scan.z[0] = a->Pos.z + scan.slopeZ[0] * temp[0]; -#endif -#ifdef IPOL_W - scan.w[0] = a->Pos.w + scan.slopeW[0] * temp[0]; -#endif -#ifdef IPOL_C0 - scan.c[0][0] = a->Color[0] + scan.slopeC[0][0] * temp[0]; -#endif -#ifdef IPOL_T0 - scan.t[0][0] = a->Tex[0] + scan.slopeT[0][0] * temp[0]; -#endif -#ifdef IPOL_T1 - scan.t[1][0] = a->Tex[1] + scan.slopeT[1][0] * temp[0]; -#endif - - } - - // calculate slopes for bottom edge - scan.slopeX[1] = (c->Pos.x - b->Pos.x) * scan.invDeltaY[2]; - scan.x[1] = b->Pos.x; - -#ifdef IPOL_Z - scan.slopeZ[1] = (c->Pos.z - b->Pos.z) * scan.invDeltaY[2]; - scan.z[1] = b->Pos.z; -#endif - -#ifdef IPOL_W - scan.slopeW[1] = (c->Pos.w - b->Pos.w) * scan.invDeltaY[2]; - scan.w[1] = b->Pos.w; -#endif - -#ifdef IPOL_C0 - scan.slopeC[0][1] = (c->Color[0] - b->Color[0]) * scan.invDeltaY[2]; - scan.c[0][1] = b->Color[0]; -#endif - -#ifdef IPOL_T0 - scan.slopeT[0][1] = (c->Tex[0] - b->Tex[0]) * scan.invDeltaY[2]; - scan.t[0][1] = b->Tex[0]; -#endif - -#ifdef IPOL_T1 - scan.slopeT[1][1] = (c->Tex[1] - b->Tex[1]) * scan.invDeltaY[2]; - scan.t[1][1] = b->Tex[1]; -#endif - - // apply top-left fill convention, top part - yStart = fill_convention_left( b->Pos.y ); - yEnd = fill_convention_right( c->Pos.y ); - -#ifdef SUBTEXEL - subPixel = ( (f32) yStart ) - b->Pos.y; - - // correct to pixel center - scan.x[0] += scan.slopeX[0] * subPixel; - scan.x[1] += scan.slopeX[1] * subPixel; - -#ifdef IPOL_Z - scan.z[0] += scan.slopeZ[0] * subPixel; - scan.z[1] += scan.slopeZ[1] * subPixel; -#endif - -#ifdef IPOL_W - scan.w[0] += scan.slopeW[0] * subPixel; - scan.w[1] += scan.slopeW[1] * subPixel; -#endif - -#ifdef IPOL_C0 - scan.c[0][0] += scan.slopeC[0][0] * subPixel; - scan.c[0][1] += scan.slopeC[0][1] * subPixel; -#endif - -#ifdef IPOL_T0 - scan.t[0][0] += scan.slopeT[0][0] * subPixel; - scan.t[0][1] += scan.slopeT[0][1] * subPixel; -#endif - -#ifdef IPOL_T1 - scan.t[1][0] += scan.slopeT[1][0] * subPixel; - scan.t[1][1] += scan.slopeT[1][1] * subPixel; -#endif - -#endif - line.x_edgetest = fill_convention_edge(scan.slopeX[scan.left]); - - // rasterize the edge scanlines - for( line.y = yStart; line.y <= yEnd; line.y += SOFTWARE_DRIVER_2_STEP_Y) - { - line.x[scan.left] = scan.x[0]; - line.x[scan.right] = scan.x[1]; - -#ifdef IPOL_Z - line.z[scan.left] = scan.z[0]; - line.z[scan.right] = scan.z[1]; -#endif - -#ifdef IPOL_W - line.w[scan.left] = scan.w[0]; - line.w[scan.right] = scan.w[1]; -#endif - -#ifdef IPOL_C0 - line.c[0][scan.left] = scan.c[0][0]; - line.c[0][scan.right] = scan.c[0][1]; -#endif - -#ifdef IPOL_T0 - line.t[0][scan.left] = scan.t[0][0]; - line.t[0][scan.right] = scan.t[0][1]; -#endif - -#ifdef IPOL_T1 - line.t[1][scan.left] = scan.t[1][0]; - line.t[1][scan.right] = scan.t[1][1]; -#endif - - // render a scanline - interlace_scanline fragmentShader(); - if ( EdgeTestPass & edge_test_first_line ) break; - - scan.x[0] += scan.slopeX[0]; - scan.x[1] += scan.slopeX[1]; - -#ifdef IPOL_Z - scan.z[0] += scan.slopeZ[0]; - scan.z[1] += scan.slopeZ[1]; -#endif - -#ifdef IPOL_W - scan.w[0] += scan.slopeW[0]; - scan.w[1] += scan.slopeW[1]; -#endif - -#ifdef IPOL_C0 - scan.c[0][0] += scan.slopeC[0][0]; - scan.c[0][1] += scan.slopeC[0][1]; -#endif - -#ifdef IPOL_T0 - scan.t[0][0] += scan.slopeT[0][0]; - scan.t[0][1] += scan.slopeT[0][1]; -#endif - -#ifdef IPOL_T1 - scan.t[1][0] += scan.slopeT[1][0]; - scan.t[1][1] += scan.slopeT[1][1]; -#endif - - } - } - -} - - -} // end namespace video -} // end namespace irr - -#endif // _IRR_COMPILE_WITH_BURNINGSVIDEO_ - -namespace irr -{ -namespace video -{ - -//! creates a flat triangle renderer -IBurningShader* createTriangleRendererGouraudNoZ2(CBurningVideoDriver* driver) -{ - //ETR_GOURAUD_NOZ - no texture no depth test no depth write - #ifdef _IRR_COMPILE_WITH_BURNINGSVIDEO_ - return new CTRGouraudNoZ2(driver); - #else - return 0; - #endif // _IRR_COMPILE_WITH_BURNINGSVIDEO_ -} - - -} // end namespace video -} // end namespace irr - - - diff --git a/source/Irrlicht/CTRGouraudWire.cpp b/source/Irrlicht/CTRGouraudWire.cpp deleted file mode 100644 index fa3402c1..00000000 --- a/source/Irrlicht/CTRGouraudWire.cpp +++ /dev/null @@ -1,325 +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" -#include "CTRTextureGouraud.h" - -#ifdef _IRR_COMPILE_WITH_SOFTWARE_ - -namespace irr -{ -namespace video -{ - -class CTRGouraudWire : public CTRTextureGouraud -{ -public: - - CTRGouraudWire(IZBuffer* zbuffer) - : CTRTextureGouraud(zbuffer) - { - #ifdef _DEBUG - setDebugName("CTRGouraudWire"); - #endif - } - - //! draws an indexed triangle list - virtual void drawIndexedTriangleList(S2DVertex* vertices, s32 vertexCount, const u16* indexList, s32 triangleCount) _IRR_OVERRIDE_ - { - const S2DVertex *v1, *v2, *v3; - - f32 tmpDiv; // temporary division factor - f32 longest; // saves the longest span - s32 height; // saves height of triangle - u16* targetSurface; // target pointer where to plot pixels - s32 spanEnd; // saves end of spans - f32 leftdeltaxf; // amount of pixels to increase on left side of triangle - f32 rightdeltaxf; // amount of pixels to increase on right side of triangle - s32 leftx, rightx; // position where we are - f32 leftxf, rightxf; // same as above, but as f32 values - s32 span; // current span - s32 leftR, leftG, leftB, rightR, rightG, rightB; // color values - s32 leftStepR, leftStepG, leftStepB, - rightStepR, rightStepG, rightStepB; // color steps - - core::rect<s32> TriangleRect; - - s32 leftZValue, rightZValue; - s32 leftZStep, rightZStep; - TZBufferType* zTarget; // target of ZBuffer; - - lockedSurface = (u16*)RenderTarget->getData(); - lockedZBuffer = ZBuffer->lock(); - - for (s32 i=0; i<triangleCount; ++i) - { - v1 = &vertices[*indexList]; - ++indexList; - v2 = &vertices[*indexList]; - ++indexList; - v3 = &vertices[*indexList]; - ++indexList; - - // back face culling - - if (BackFaceCullingEnabled) - { - s32 z = ((v3->Pos.X - v1->Pos.X) * (v3->Pos.Y - v2->Pos.Y)) - - ((v3->Pos.Y - v1->Pos.Y) * (v3->Pos.X - v2->Pos.X)); - - if (z < 0) - continue; - } - - //near plane clipping - - if (v1->ZValue<0 && v2->ZValue<0 && v3->ZValue<0) - continue; - - // sort for width for inscreen clipping - - if (v1->Pos.X > v2->Pos.X) swapVertices(&v1, &v2); - if (v1->Pos.X > v3->Pos.X) swapVertices(&v1, &v3); - if (v2->Pos.X > v3->Pos.X) swapVertices(&v2, &v3); - - if ((v1->Pos.X - v3->Pos.X) == 0) - continue; - - TriangleRect.UpperLeftCorner.X = v1->Pos.X; - TriangleRect.LowerRightCorner.X = v3->Pos.X; - - // sort for height for faster drawing. - - if (v1->Pos.Y > v2->Pos.Y) swapVertices(&v1, &v2); - if (v1->Pos.Y > v3->Pos.Y) swapVertices(&v1, &v3); - if (v2->Pos.Y > v3->Pos.Y) swapVertices(&v2, &v3); - - TriangleRect.UpperLeftCorner.Y = v1->Pos.Y; - TriangleRect.LowerRightCorner.Y = v3->Pos.Y; - - if (!TriangleRect.isRectCollided(ViewPortRect)) - continue; - - // calculate height of triangle - height = v3->Pos.Y - v1->Pos.Y; - if (!height) - continue; - - // calculate longest span - - longest = (v2->Pos.Y - v1->Pos.Y) / (f32)height * (v3->Pos.X - v1->Pos.X) + (v1->Pos.X - v2->Pos.X); - - spanEnd = v2->Pos.Y; - span = v1->Pos.Y; - leftxf = (f32)v1->Pos.X; - rightxf = (f32)v1->Pos.X; - - leftZValue = v1->ZValue; - rightZValue = v1->ZValue; - - leftR = rightR = video::getRed(v1->Color)<<11; - leftG = rightG = video::getGreen(v1->Color)<<11; - leftB = rightB = video::getBlue(v1->Color)<<11; - - targetSurface = lockedSurface + span * SurfaceWidth; - zTarget = lockedZBuffer + span * SurfaceWidth; - - if (longest < 0.0f) - { - tmpDiv = 1.0f / (f32)(v2->Pos.Y - v1->Pos.Y); - rightdeltaxf = (v2->Pos.X - v1->Pos.X) * tmpDiv; - rightZStep = (s32)((v2->ZValue - v1->ZValue) * tmpDiv); - rightStepR = (s32)(((s32)(video::getRed(v2->Color)<<11) - rightR) * tmpDiv); - rightStepG = (s32)(((s32)(video::getGreen(v2->Color)<<11) - rightG) * tmpDiv); - rightStepB = (s32)(((s32)(video::getBlue(v2->Color)<<11) - rightB) * tmpDiv); - - tmpDiv = 1.0f / (f32)height; - leftdeltaxf = (v3->Pos.X - v1->Pos.X) * tmpDiv; - leftZStep = (s32)((v3->ZValue - v1->ZValue) * tmpDiv); - leftStepR = (s32)(((s32)(video::getRed(v3->Color)<<11) - leftR) * tmpDiv); - leftStepG = (s32)(((s32)(video::getGreen(v3->Color)<<11) - leftG) * tmpDiv); - leftStepB = (s32)(((s32)(video::getBlue(v3->Color)<<11) - leftB) * tmpDiv); - } - else - { - tmpDiv = 1.0f / (f32)height; - rightdeltaxf = (v3->Pos.X - v1->Pos.X) * tmpDiv; - rightZStep = (s32)((v3->ZValue - v1->ZValue) * tmpDiv); - rightStepR = (s32)(((s32)(video::getRed(v3->Color)<<11) - rightR) * tmpDiv); - rightStepG = (s32)(((s32)(video::getGreen(v3->Color)<<11) - rightG) * tmpDiv); - rightStepB = (s32)(((s32)(video::getBlue(v3->Color)<<11) - rightB) * tmpDiv); - - tmpDiv = 1.0f / (f32)(v2->Pos.Y - v1->Pos.Y); - leftdeltaxf = (v2->Pos.X - v1->Pos.X) * tmpDiv; - leftZStep = (s32)((v2->ZValue - v1->ZValue) * tmpDiv); - leftStepR = (s32)(((s32)(video::getRed(v2->Color)<<11) - leftR) * tmpDiv); - leftStepG = (s32)(((s32)(video::getGreen(v2->Color)<<11) - leftG) * tmpDiv); - leftStepB = (s32)(((s32)(video::getBlue(v2->Color)<<11) - leftB) * tmpDiv); - } - - - // do it twice, once for the first half of the triangle, - // end then for the second half. - - for (s32 triangleHalf=0; triangleHalf<2; ++triangleHalf) - { - if (spanEnd > ViewPortRect.LowerRightCorner.Y) - spanEnd = ViewPortRect.LowerRightCorner.Y; - - // if the span <0, than we can skip these spans, - // and proceed to the next spans which are really on the screen. - if (span < ViewPortRect.UpperLeftCorner.Y) - { - // we'll use leftx as temp variable - if (spanEnd < ViewPortRect.UpperLeftCorner.Y) - { - leftx = spanEnd - span; - span = spanEnd; - } - else - { - leftx = ViewPortRect.UpperLeftCorner.Y - span; - span = ViewPortRect.UpperLeftCorner.Y; - } - - leftxf += leftdeltaxf*leftx; - rightxf += rightdeltaxf*leftx; - targetSurface += SurfaceWidth*leftx; - zTarget += SurfaceWidth*leftx; - leftZValue += leftZStep*leftx; - rightZValue += rightZStep*leftx; - - leftR += leftStepR*leftx; - leftG += leftStepG*leftx; - leftB += leftStepB*leftx; - rightR += rightStepR*leftx; - rightG += rightStepG*leftx; - rightB += rightStepB*leftx; - } - - - // the main loop. Go through every span and draw it. - - while (span < spanEnd) - { - leftx = (s32)(leftxf); - rightx = (s32)(rightxf + 0.5f); - - // perform some clipping - - if (leftx>=ViewPortRect.UpperLeftCorner.X && - leftx<=ViewPortRect.LowerRightCorner.X) - { - if (leftZValue > *(zTarget + leftx)) - { - *(zTarget + leftx) = leftZValue; - *(targetSurface + leftx) = video::RGB16(leftR>>8, leftG>>8, leftB>>8); - } - } - - - if (rightx>=ViewPortRect.UpperLeftCorner.X && - rightx<=ViewPortRect.LowerRightCorner.X) - { - if (rightZValue > *(zTarget + rightx)) - { - *(zTarget + rightx) = rightZValue; - *(targetSurface + rightx) = video::RGB16(rightR, rightG, rightB); - } - - } - - leftxf += leftdeltaxf; - rightxf += rightdeltaxf; - ++span; - targetSurface += SurfaceWidth; - zTarget += SurfaceWidth; - leftZValue += leftZStep; - rightZValue += rightZStep; - - leftR += leftStepR; - leftG += leftStepG; - leftB += leftStepB; - rightR += rightStepR; - rightG += rightStepG; - rightB += rightStepB; - } - - if (triangleHalf>0) // break, we've gout only two halves - break; - - - // setup variables for second half of the triangle. - - if (longest < 0.0f) - { - tmpDiv = 1.0f / (v3->Pos.Y - v2->Pos.Y); - - rightdeltaxf = (v3->Pos.X - v2->Pos.X) * tmpDiv; - rightxf = (f32)v2->Pos.X; - - rightZValue = v2->ZValue; - rightZStep = (s32)((v3->ZValue - v2->ZValue) * tmpDiv); - - rightR = video::getRed(v2->Color)<<11; - rightG = video::getGreen(v2->Color)<<11; - rightB = video::getBlue(v2->Color)<<11; - rightStepR = (s32)(((s32)(video::getRed(v3->Color)<<11) - rightR) * tmpDiv); - rightStepG = (s32)(((s32)(video::getGreen(v3->Color)<<11) - rightG) * tmpDiv); - rightStepB = (s32)(((s32)(video::getBlue(v3->Color)<<11) - rightB) * tmpDiv); - } - else - { - tmpDiv = 1.0f / (v3->Pos.Y - v2->Pos.Y); - - leftdeltaxf = (v3->Pos.X - v2->Pos.X) * tmpDiv; - leftxf = (f32)v2->Pos.X; - - leftZValue = v2->ZValue; - leftZStep = (s32)((v3->ZValue - v2->ZValue) * tmpDiv); - - leftR = video::getRed(v2->Color)<<11; - leftG = video::getGreen(v2->Color)<<11; - leftB = video::getBlue(v2->Color)<<11; - leftStepR = (s32)(((s32)(video::getRed(v3->Color)<<11) - leftR) * tmpDiv); - leftStepG = (s32)(((s32)(video::getGreen(v3->Color)<<11) - leftG) * tmpDiv); - leftStepB = (s32)(((s32)(video::getBlue(v3->Color)<<11) - leftB) * tmpDiv); - } - - - spanEnd = v3->Pos.Y; - } - - } - - ZBuffer->unlock(); - } - -}; - -} // end namespace video -} // end namespace irr - -#endif // _IRR_COMPILE_WITH_SOFTWARE_ - -namespace irr -{ -namespace video -{ - - -//! creates a flat triangle renderer -ITriangleRenderer* createTriangleRendererGouraudWire(IZBuffer* zbuffer) -{ - #ifdef _IRR_COMPILE_WITH_SOFTWARE_ - return new CTRGouraudWire(zbuffer); - #else - return 0; - #endif // _IRR_COMPILE_WITH_SOFTWARE_ -} - -} // end namespace video -} // end namespace irr - - diff --git a/source/Irrlicht/CTRNormalMap.cpp b/source/Irrlicht/CTRNormalMap.cpp deleted file mode 100644 index 5b16d083..00000000 --- a/source/Irrlicht/CTRNormalMap.cpp +++ /dev/null @@ -1,925 +0,0 @@ -// Copyright (C) 2002-2012 Nikolaus Gebhardt / Thomas Alten -// This file is part of the "Irrlicht Engine". -// For conditions of distribution and use, see copyright notice in irrlicht.h - -#include "IrrCompileConfig.h" -#include "IBurningShader.h" - -#ifdef _IRR_COMPILE_WITH_BURNINGSVIDEO_ - -// compile flag for this file -#undef USE_ZBUFFER -#undef IPOL_Z -#undef CMP_Z -#undef WRITE_Z - -#undef IPOL_W -#undef CMP_W -#undef WRITE_W - -#undef SUBTEXEL -#undef INVERSE_W - -#undef IPOL_C0 -#undef IPOL_C1 -#undef IPOL_T0 -#undef IPOL_T1 -#undef IPOL_T2 -#undef IPOL_L0 - -// define render case -#define SUBTEXEL -#define INVERSE_W - -#define USE_ZBUFFER -#define IPOL_W -#define CMP_W -#define WRITE_W - -#define IPOL_C0 -#define IPOL_C1 -#define IPOL_T0 -#define IPOL_T1 -#define IPOL_L0 - -// apply global override -#ifndef SOFTWARE_DRIVER_2_PERSPECTIVE_CORRECT - #undef INVERSE_W -#endif - -#ifndef SOFTWARE_DRIVER_2_SUBTEXEL - #undef SUBTEXEL -#endif - -#if BURNING_MATERIAL_MAX_COLORS < 1 - #undef IPOL_C0 -#endif - -#if BURNING_MATERIAL_MAX_COLORS < 2 - #undef IPOL_C1 -#endif - -#if BURNING_MATERIAL_MAX_LIGHT_TANGENT < 1 - #undef IPOL_L0 -#endif - -#if !defined ( SOFTWARE_DRIVER_2_USE_WBUFFER ) && defined ( USE_ZBUFFER ) - #ifndef SOFTWARE_DRIVER_2_PERSPECTIVE_CORRECT - #undef IPOL_W - #endif - #define IPOL_Z - - #ifdef CMP_W - #undef CMP_W - #define CMP_Z - #endif - - #ifdef WRITE_W - #undef WRITE_W - #define WRITE_Z - #endif - -#endif - - -namespace irr -{ - -namespace video -{ - - -class CTRNormalMap : public IBurningShader -{ -public: - - //! constructor - CTRNormalMap(CBurningVideoDriver* driver); - - //! draws an indexed triangle list - virtual void drawTriangle(const s4DVertex* burning_restrict a, const s4DVertex* burning_restrict b, const s4DVertex* burning_restrict c) _IRR_OVERRIDE_; - virtual void OnSetMaterial(const SBurningShaderMaterial& material) _IRR_OVERRIDE_; - -private: - void fragmentShader(); - -}; - -//! constructor -CTRNormalMap::CTRNormalMap(CBurningVideoDriver* driver) -: IBurningShader(driver) -{ - #ifdef _DEBUG - setDebugName("CTRNormalMap"); - #endif -} - - -void CTRNormalMap::OnSetMaterial(const SBurningShaderMaterial& material) -{ -} - -/*! -*/ -void CTRNormalMap::fragmentShader() -{ - tVideoSample *dst; - -#ifdef USE_ZBUFFER - fp24 *z; -#endif - - s32 xStart; - s32 xEnd; - s32 dx; - - -#ifdef SUBTEXEL - f32 subPixel; -#endif - -#ifdef IPOL_Z - f32 slopeZ; -#endif -#ifdef IPOL_W - fp24 slopeW; -#endif -#ifdef IPOL_C0 - sVec4 slopeC[BURNING_MATERIAL_MAX_COLORS]; -#endif -#ifdef IPOL_T0 - sVec2 slopeT[BURNING_MATERIAL_MAX_TEXTURES]; -#endif -#ifdef IPOL_L0 - sVec3Pack_unpack slopeL[BURNING_MATERIAL_MAX_LIGHT_TANGENT]; -#endif - - // apply top-left fill-convention, left - xStart = fill_convention_left( line.x[0] ); - xEnd = fill_convention_right( line.x[1] ); - - dx = xEnd - xStart; - - if ( dx < 0 ) - return; - - // slopes - const f32 invDeltaX = fill_step_x( line.x[1] - line.x[0] ); - -#ifdef IPOL_Z - slopeZ = (line.z[1] - line.z[0]) * invDeltaX; -#endif -#ifdef IPOL_W - slopeW = (line.w[1] - line.w[0]) * invDeltaX; -#endif -#ifdef IPOL_C0 - slopeC[0] = (line.c[0][1] - line.c[0][0]) * invDeltaX; -#endif -#ifdef IPOL_C1 - slopeC[1] = (line.c[1][1] - line.c[1][0]) * invDeltaX; -#endif -#ifdef IPOL_T0 - slopeT[0] = (line.t[0][1] - line.t[0][0]) * invDeltaX; -#endif -#ifdef IPOL_T1 - slopeT[1] = (line.t[1][1] - line.t[1][0]) * invDeltaX; -#endif -#ifdef IPOL_T2 - slopeT[2] = (line.t[2][1] - line.t[2][0]) * invDeltaX; -#endif -#ifdef IPOL_L0 - slopeL[0] = (line.l[0][1] - line.l[0][0]) * invDeltaX; -#endif - -#ifdef SUBTEXEL - subPixel = ( (f32) xStart ) - line.x[0]; -#ifdef IPOL_Z - line.z[0] += slopeZ * subPixel; -#endif -#ifdef IPOL_W - line.w[0] += slopeW * subPixel; -#endif -#ifdef IPOL_C0 - line.c[0][0] += slopeC[0] * subPixel; -#endif -#ifdef IPOL_C1 - line.c[1][0] += slopeC[1] * subPixel; -#endif -#ifdef IPOL_T0 - line.t[0][0] += slopeT[0] * subPixel; -#endif -#ifdef IPOL_T1 - line.t[1][0] += slopeT[1] * subPixel; -#endif -#ifdef IPOL_T2 - line.t[2][0] += slopeT[2] * subPixel; -#endif -#ifdef IPOL_L0 - line.l[0][0] += slopeL[0] * subPixel; -#endif -#endif - - SOFTWARE_DRIVER_2_CLIPCHECK; - dst = (tVideoSample*)RenderTarget->getData() + ( line.y * RenderTarget->getDimension().Width ) + xStart; - -#ifdef USE_ZBUFFER - z = (fp24*) DepthBuffer->lock() + ( line.y * RenderTarget->getDimension().Width ) + xStart; -#endif - - - f32 inversew = FIX_POINT_F32_MUL; - - tFixPoint tx0, ty0; - -#ifdef IPOL_T1 - tFixPoint tx1, ty1; -#endif - - tFixPoint r0, g0, b0; - tFixPoint r1, g1, b1; - tFixPoint r2, g2, b2; - -#ifdef IPOL_L0 - tFixPoint lx, ly, lz; -#endif - tFixPoint ndotl = FIX_POINT_ONE; - - -#ifdef IPOL_C0 - tFixPoint a3,r3, g3, b3; -#endif - -#ifdef IPOL_C1 - tFixPoint aFog = FIX_POINT_ONE; -#endif - - - for ( s32 i = 0; i <= dx; i += SOFTWARE_DRIVER_2_STEP_X) - { -#ifdef CMP_Z - if ( line.z[0] < z[i] ) -#endif -#ifdef CMP_W - if ( line.w[0] >= z[i] ) -#endif - { -#ifdef INVERSE_W - inversew = fix_inverse32 ( line.w[0] ); -#endif - -#ifdef IPOL_C0 - //vertex alpha blend ( and omit depthwrite ,hacky..) - a3 = tofix(line.c[0][0].x, inversew); - if (a3 + 2 >= FIX_POINT_ONE) - { -#ifdef WRITE_Z - z[i] = line.z[0]; -#endif -#ifdef WRITE_W - z[i] = line.w[0]; -#endif - } -#endif - -#ifdef IPOL_C1 - //complete inside fog - if (TL_Flag & TL_FOG) - { - aFog = tofix(line.c[1][0].a, inversew); - if (aFog <= 0) - { - dst[i] = fog_color_sample; - continue; - } - } -#endif - - tx0 = tofix ( line.t[0][0].x,inversew); - ty0 = tofix ( line.t[0][0].y,inversew); - tx1 = tofix ( line.t[1][0].x,inversew); - ty1 = tofix ( line.t[1][0].y,inversew); - - // diffuse map - getSample_texture ( r0, g0, b0, &IT[0], tx0, ty0 ); - - // normal map ( same texcoord0 but different mipmapping) - getSample_texture ( r1, g1, b1, &IT[1], tx1, ty1 ); - - r1 = ( r1 - FIX_POINT_HALF_COLOR) >> (COLOR_MAX_LOG2-1); - g1 = ( g1 - FIX_POINT_HALF_COLOR) >> (COLOR_MAX_LOG2-1); - b1 = ( b1 - FIX_POINT_HALF_COLOR) >> (COLOR_MAX_LOG2-1); - -#ifdef IPOL_L0 - lx = tofix ( line.l[0][0].x, inversew ); - ly = tofix ( line.l[0][0].y, inversew ); - lz = tofix ( line.l[0][0].z, inversew ); - - // DOT 3 Normal Map light in tangent space - //max(dot(LightVector, Normal), 0.0); - ndotl = clampfix_mincolor( (imulFix_simple(r1,lx) + imulFix_simple(g1,ly) + imulFix_simple(b1,lz) ) ); -#endif - -#ifdef IPOL_C0 - - //LightColor[0] - r3 = tofix(line.c[0][0].y, inversew); - g3 = tofix(line.c[0][0].z, inversew); - b3 = tofix(line.c[0][0].w, inversew); - - // Lambert * LightColor[0] * Diffuse Texture; - r2 = imulFix (imulFix_simple( r3, ndotl ), r0 ); - g2 = imulFix (imulFix_simple( g3, ndotl ), g0 ); - b2 = imulFix (imulFix_simple( b3, ndotl ), b0 ); - - //vertex alpha blend ( and omit depthwrite ,hacky..) - if (a3 + 2 < FIX_POINT_ONE) - { - color_to_fix(r1, g1, b1, dst[i]); - r2 = r1 + imulFix(a3, r2 - r1); - g2 = g1 + imulFix(a3, g2 - g1); - b2 = b1 + imulFix(a3, b2 - b1); - } - -#ifdef IPOL_C1 - //mix with distance - if (aFog < FIX_POINT_ONE) - { - r2 = fog_color[1] + imulFix(aFog, r2 - fog_color[1]); - g2 = fog_color[2] + imulFix(aFog, g2 - fog_color[2]); - b2 = fog_color[3] + imulFix(aFog, b2 - fog_color[3]); - } -#endif - dst[i] = fix_to_sample(r2, g2, b2); - - -#else - r2 = imulFix_tex4 ( r0, r1 ); - g2 = imulFix_tex4 ( g0, g1 ); - b2 = imulFix_tex4 ( b0, b1 ); - dst[i] = fix_to_sample(r2, g2, b2); -#endif - - } - -#ifdef IPOL_Z - line.z[0] += slopeZ; -#endif -#ifdef IPOL_W - line.w[0] += slopeW; -#endif -#ifdef IPOL_C0 - line.c[0][0] += slopeC[0]; -#endif -#ifdef IPOL_C1 - line.c[1][0] += slopeC[1]; -#endif -#ifdef IPOL_T0 - line.t[0][0] += slopeT[0]; -#endif -#ifdef IPOL_T1 - line.t[1][0] += slopeT[1]; -#endif -#ifdef IPOL_T2 - line.t[2][0] += slopeT[2]; -#endif -#ifdef IPOL_L0 - line.l[0][0] += slopeL[0]; -#endif - } - -} - -void CTRNormalMap::drawTriangle(const s4DVertex* burning_restrict a, const s4DVertex* burning_restrict b, const s4DVertex* burning_restrict c) -{ - // sort on height, y - if ( F32_A_GREATER_B ( a->Pos.y , b->Pos.y ) ) swapVertexPointer(&a, &b); - if ( F32_A_GREATER_B ( b->Pos.y , c->Pos.y ) ) swapVertexPointer(&b, &c); - if ( F32_A_GREATER_B ( a->Pos.y , b->Pos.y ) ) swapVertexPointer(&a, &b); - - const f32 ca = c->Pos.y - a->Pos.y; - const f32 ba = b->Pos.y - a->Pos.y; - const f32 cb = c->Pos.y - b->Pos.y; - // calculate delta y of the edges - scan.invDeltaY[0] = fill_step_y( ca ); - scan.invDeltaY[1] = fill_step_y( ba ); - scan.invDeltaY[2] = fill_step_y( cb ); - - if ( F32_LOWER_EQUAL_0 ( scan.invDeltaY[0] ) ) - return; - - // find if the major edge is left or right aligned - f32 temp[4]; - - temp[0] = a->Pos.x - c->Pos.x; - temp[1] = -ca; - temp[2] = b->Pos.x - a->Pos.x; - temp[3] = ba; - - scan.left = ( temp[0] * temp[3] - temp[1] * temp[2] ) > 0.f ? 0 : 1; - scan.right = 1 - scan.left; - - // calculate slopes for the major edge - scan.slopeX[0] = (c->Pos.x - a->Pos.x) * scan.invDeltaY[0]; - scan.x[0] = a->Pos.x; - -#ifdef IPOL_Z - scan.slopeZ[0] = (c->Pos.z - a->Pos.z) * scan.invDeltaY[0]; - scan.z[0] = a->Pos.z; -#endif - -#ifdef IPOL_W - scan.slopeW[0] = (c->Pos.w - a->Pos.w) * scan.invDeltaY[0]; - scan.w[0] = a->Pos.w; -#endif - -#ifdef IPOL_C0 - scan.slopeC[0][0] = (c->Color[0] - a->Color[0]) * scan.invDeltaY[0]; - scan.c[0][0] = a->Color[0]; -#endif - -#ifdef IPOL_C1 - scan.slopeC[1][0] = (c->Color[1] - a->Color[1]) * scan.invDeltaY[0]; - scan.c[1][0] = a->Color[1]; -#endif - -#ifdef IPOL_T0 - scan.slopeT[0][0] = (c->Tex[0] - a->Tex[0]) * scan.invDeltaY[0]; - scan.t[0][0] = a->Tex[0]; -#endif - -#ifdef IPOL_T1 - scan.slopeT[1][0] = (c->Tex[1] - a->Tex[1]) * scan.invDeltaY[0]; - scan.t[1][0] = a->Tex[1]; -#endif - -#ifdef IPOL_T2 - scan.slopeT[2][0] = (c->Tex[2] - a->Tex[2]) * scan.invDeltaY[0]; - scan.t[2][0] = a->Tex[2]; -#endif - -#ifdef IPOL_L0 - scan.slopeL[0][0] = (c->LightTangent[0] - a->LightTangent[0]) * scan.invDeltaY[0]; - scan.l[0][0] = a->LightTangent[0]; -#endif - - // top left fill convention y run - s32 yStart; - s32 yEnd; - -#ifdef SUBTEXEL - f32 subPixel; -#endif - - - // rasterize upper sub-triangle - if ( F32_GREATER_0 ( scan.invDeltaY[1] ) ) - { - // calculate slopes for top edge - scan.slopeX[1] = (b->Pos.x - a->Pos.x) * scan.invDeltaY[1]; - scan.x[1] = a->Pos.x; - -#ifdef IPOL_Z - scan.slopeZ[1] = (b->Pos.z - a->Pos.z) * scan.invDeltaY[1]; - scan.z[1] = a->Pos.z; -#endif - -#ifdef IPOL_W - scan.slopeW[1] = (b->Pos.w - a->Pos.w) * scan.invDeltaY[1]; - scan.w[1] = a->Pos.w; -#endif - -#ifdef IPOL_C0 - scan.slopeC[0][1] = (b->Color[0] - a->Color[0]) * scan.invDeltaY[1]; - scan.c[0][1] = a->Color[0]; -#endif - -#ifdef IPOL_C1 - scan.slopeC[1][1] = (b->Color[1] - a->Color[1]) * scan.invDeltaY[1]; - scan.c[1][1] = a->Color[1]; -#endif - -#ifdef IPOL_T0 - scan.slopeT[0][1] = (b->Tex[0] - a->Tex[0]) * scan.invDeltaY[1]; - scan.t[0][1] = a->Tex[0]; -#endif - -#ifdef IPOL_T1 - scan.slopeT[1][1] = (b->Tex[1] - a->Tex[1]) * scan.invDeltaY[1]; - scan.t[1][1] = a->Tex[1]; -#endif - -#ifdef IPOL_T2 - scan.slopeT[2][1] = (b->Tex[2] - a->Tex[2]) * scan.invDeltaY[1]; - scan.t[2][1] = a->Tex[2]; -#endif - -#ifdef IPOL_L0 - scan.slopeL[0][1] = (b->LightTangent[0] - a->LightTangent[0]) * scan.invDeltaY[1]; - scan.l[0][1] = a->LightTangent[0]; -#endif - - // apply top-left fill convention, top part - yStart = fill_convention_left( a->Pos.y ); - yEnd = fill_convention_right( b->Pos.y ); - -#ifdef SUBTEXEL - subPixel = ( (f32) yStart ) - a->Pos.y; - - // correct to pixel center - scan.x[0] += scan.slopeX[0] * subPixel; - scan.x[1] += scan.slopeX[1] * subPixel; - -#ifdef IPOL_Z - scan.z[0] += scan.slopeZ[0] * subPixel; - scan.z[1] += scan.slopeZ[1] * subPixel; -#endif - -#ifdef IPOL_W - scan.w[0] += scan.slopeW[0] * subPixel; - scan.w[1] += scan.slopeW[1] * subPixel; -#endif - -#ifdef IPOL_C0 - scan.c[0][0] += scan.slopeC[0][0] * subPixel; - scan.c[0][1] += scan.slopeC[0][1] * subPixel; -#endif - -#ifdef IPOL_C1 - scan.c[1][0] += scan.slopeC[1][0] * subPixel; - scan.c[1][1] += scan.slopeC[1][1] * subPixel; -#endif - -#ifdef IPOL_T0 - scan.t[0][0] += scan.slopeT[0][0] * subPixel; - scan.t[0][1] += scan.slopeT[0][1] * subPixel; -#endif - -#ifdef IPOL_T1 - scan.t[1][0] += scan.slopeT[1][0] * subPixel; - scan.t[1][1] += scan.slopeT[1][1] * subPixel; -#endif - -#ifdef IPOL_T2 - scan.t[2][0] += scan.slopeT[2][0] * subPixel; - scan.t[2][1] += scan.slopeT[2][1] * subPixel; -#endif - -#ifdef IPOL_L0 - scan.l[0][0] += scan.slopeL[0][0] * subPixel; - scan.l[0][1] += scan.slopeL[0][1] * subPixel; -#endif - -#endif - - // rasterize the edge scanlines - for( line.y = yStart; line.y <= yEnd; line.y += SOFTWARE_DRIVER_2_STEP_Y) - { - line.x[scan.left] = scan.x[0]; - line.x[scan.right] = scan.x[1]; - -#ifdef IPOL_Z - line.z[scan.left] = scan.z[0]; - line.z[scan.right] = scan.z[1]; -#endif - -#ifdef IPOL_W - line.w[scan.left] = scan.w[0]; - line.w[scan.right] = scan.w[1]; -#endif - -#ifdef IPOL_C0 - line.c[0][scan.left] = scan.c[0][0]; - line.c[0][scan.right] = scan.c[0][1]; -#endif - -#ifdef IPOL_C1 - line.c[1][scan.left] = scan.c[1][0]; - line.c[1][scan.right] = scan.c[1][1]; -#endif - -#ifdef IPOL_T0 - line.t[0][scan.left] = scan.t[0][0]; - line.t[0][scan.right] = scan.t[0][1]; -#endif - -#ifdef IPOL_T1 - line.t[1][scan.left] = scan.t[1][0]; - line.t[1][scan.right] = scan.t[1][1]; -#endif - -#ifdef IPOL_T2 - line.t[2][scan.left] = scan.t[2][0]; - line.t[2][scan.right] = scan.t[2][1]; -#endif - -#ifdef IPOL_L0 - line.l[0][scan.left] = scan.l[0][0]; - line.l[0][scan.right] = scan.l[0][1]; -#endif - - // render a scanline - interlace_scanline fragmentShader (); - - scan.x[0] += scan.slopeX[0]; - scan.x[1] += scan.slopeX[1]; - -#ifdef IPOL_Z - scan.z[0] += scan.slopeZ[0]; - scan.z[1] += scan.slopeZ[1]; -#endif - -#ifdef IPOL_W - scan.w[0] += scan.slopeW[0]; - scan.w[1] += scan.slopeW[1]; -#endif - -#ifdef IPOL_C0 - scan.c[0][0] += scan.slopeC[0][0]; - scan.c[0][1] += scan.slopeC[0][1]; -#endif - -#ifdef IPOL_C1 - scan.c[1][0] += scan.slopeC[1][0]; - scan.c[1][1] += scan.slopeC[1][1]; -#endif - -#ifdef IPOL_T0 - scan.t[0][0] += scan.slopeT[0][0]; - scan.t[0][1] += scan.slopeT[0][1]; -#endif - -#ifdef IPOL_T1 - scan.t[1][0] += scan.slopeT[1][0]; - scan.t[1][1] += scan.slopeT[1][1]; -#endif - -#ifdef IPOL_T2 - scan.t[2][0] += scan.slopeT[2][0]; - scan.t[2][1] += scan.slopeT[2][1]; -#endif - -#ifdef IPOL_L0 - scan.l[0][0] += scan.slopeL[0][0]; - scan.l[0][1] += scan.slopeL[0][1]; -#endif - - } - } - - // rasterize lower sub-triangle - if ( F32_GREATER_0 ( scan.invDeltaY[2] ) ) - { - // advance to middle point - if ( F32_GREATER_0 ( scan.invDeltaY[1] ) ) - { - temp[0] = b->Pos.y - a->Pos.y; // dy - - scan.x[0] = a->Pos.x + scan.slopeX[0] * temp[0]; -#ifdef IPOL_Z - scan.z[0] = a->Pos.z + scan.slopeZ[0] * temp[0]; -#endif -#ifdef IPOL_W - scan.w[0] = a->Pos.w + scan.slopeW[0] * temp[0]; -#endif -#ifdef IPOL_C0 - scan.c[0][0] = a->Color[0] + scan.slopeC[0][0] * temp[0]; -#endif -#ifdef IPOL_C1 - scan.c[1][0] = a->Color[1] + scan.slopeC[1][0] * temp[0]; -#endif -#ifdef IPOL_T0 - scan.t[0][0] = a->Tex[0] + scan.slopeT[0][0] * temp[0]; -#endif -#ifdef IPOL_T1 - scan.t[1][0] = a->Tex[1] + scan.slopeT[1][0] * temp[0]; -#endif -#ifdef IPOL_T2 - scan.t[2][0] = a->Tex[2] + scan.slopeT[2][0] * temp[0]; -#endif -#ifdef IPOL_L0 - scan.l[0][0] = sVec3Pack_unpack(a->LightTangent[0]) + scan.slopeL[0][0] * temp[0]; -#endif - - } - - // calculate slopes for bottom edge - scan.slopeX[1] = (c->Pos.x - b->Pos.x) * scan.invDeltaY[2]; - scan.x[1] = b->Pos.x; - -#ifdef IPOL_Z - scan.slopeZ[1] = (c->Pos.z - b->Pos.z) * scan.invDeltaY[2]; - scan.z[1] = b->Pos.z; -#endif - -#ifdef IPOL_W - scan.slopeW[1] = (c->Pos.w - b->Pos.w) * scan.invDeltaY[2]; - scan.w[1] = b->Pos.w; -#endif - -#ifdef IPOL_C0 - scan.slopeC[0][1] = (c->Color[0] - b->Color[0]) * scan.invDeltaY[2]; - scan.c[0][1] = b->Color[0]; -#endif - -#ifdef IPOL_C1 - scan.slopeC[1][1] = (c->Color[1] - b->Color[1]) * scan.invDeltaY[2]; - scan.c[1][1] = b->Color[1]; -#endif - -#ifdef IPOL_T0 - scan.slopeT[0][1] = (c->Tex[0] - b->Tex[0]) * scan.invDeltaY[2]; - scan.t[0][1] = b->Tex[0]; -#endif - -#ifdef IPOL_T1 - scan.slopeT[1][1] = (c->Tex[1] - b->Tex[1]) * scan.invDeltaY[2]; - scan.t[1][1] = b->Tex[1]; -#endif - -#ifdef IPOL_T2 - scan.slopeT[2][1] = (c->Tex[2] - b->Tex[2]) * scan.invDeltaY[2]; - scan.t[2][1] = b->Tex[2]; -#endif - -#ifdef IPOL_L0 - scan.slopeL[0][1] = (c->LightTangent[0] - b->LightTangent[0]) * scan.invDeltaY[2]; - scan.l[0][1] = b->LightTangent[0]; -#endif - - // apply top-left fill convention, top part - yStart = fill_convention_left( b->Pos.y ); - yEnd = fill_convention_right( c->Pos.y ); - -#ifdef SUBTEXEL - subPixel = ( (f32) yStart ) - b->Pos.y; - - // correct to pixel center - scan.x[0] += scan.slopeX[0] * subPixel; - scan.x[1] += scan.slopeX[1] * subPixel; - -#ifdef IPOL_Z - scan.z[0] += scan.slopeZ[0] * subPixel; - scan.z[1] += scan.slopeZ[1] * subPixel; -#endif - -#ifdef IPOL_W - scan.w[0] += scan.slopeW[0] * subPixel; - scan.w[1] += scan.slopeW[1] * subPixel; -#endif - -#ifdef IPOL_C0 - scan.c[0][0] += scan.slopeC[0][0] * subPixel; - scan.c[0][1] += scan.slopeC[0][1] * subPixel; -#endif - -#ifdef IPOL_C1 - scan.c[1][0] += scan.slopeC[1][0] * subPixel; - scan.c[1][1] += scan.slopeC[1][1] * subPixel; -#endif - -#ifdef IPOL_T0 - scan.t[0][0] += scan.slopeT[0][0] * subPixel; - scan.t[0][1] += scan.slopeT[0][1] * subPixel; -#endif - -#ifdef IPOL_T1 - scan.t[1][0] += scan.slopeT[1][0] * subPixel; - scan.t[1][1] += scan.slopeT[1][1] * subPixel; -#endif - -#ifdef IPOL_T2 - scan.t[2][0] += scan.slopeT[2][0] * subPixel; - scan.t[2][1] += scan.slopeT[2][1] * subPixel; -#endif - -#ifdef IPOL_L0 - scan.l[0][0] += scan.slopeL[0][0] * subPixel; - scan.l[0][1] += scan.slopeL[0][1] * subPixel; -#endif - -#endif - - // rasterize the edge scanlines - for( line.y = yStart; line.y <= yEnd; line.y += SOFTWARE_DRIVER_2_STEP_Y) - { - line.x[scan.left] = scan.x[0]; - line.x[scan.right] = scan.x[1]; - -#ifdef IPOL_Z - line.z[scan.left] = scan.z[0]; - line.z[scan.right] = scan.z[1]; -#endif - -#ifdef IPOL_W - line.w[scan.left] = scan.w[0]; - line.w[scan.right] = scan.w[1]; -#endif - -#ifdef IPOL_C0 - line.c[0][scan.left] = scan.c[0][0]; - line.c[0][scan.right] = scan.c[0][1]; -#endif - -#ifdef IPOL_C1 - line.c[1][scan.left] = scan.c[1][0]; - line.c[1][scan.right] = scan.c[1][1]; -#endif - -#ifdef IPOL_T0 - line.t[0][scan.left] = scan.t[0][0]; - line.t[0][scan.right] = scan.t[0][1]; -#endif - -#ifdef IPOL_T1 - line.t[1][scan.left] = scan.t[1][0]; - line.t[1][scan.right] = scan.t[1][1]; -#endif - -#ifdef IPOL_T2 - line.t[2][scan.left] = scan.t[2][0]; - line.t[2][scan.right] = scan.t[2][1]; -#endif - -#ifdef IPOL_L0 - line.l[0][scan.left] = scan.l[0][0]; - line.l[0][scan.right] = scan.l[0][1]; -#endif - - // render a scanline - interlace_scanline fragmentShader(); - - scan.x[0] += scan.slopeX[0]; - scan.x[1] += scan.slopeX[1]; - -#ifdef IPOL_Z - scan.z[0] += scan.slopeZ[0]; - scan.z[1] += scan.slopeZ[1]; -#endif - -#ifdef IPOL_W - scan.w[0] += scan.slopeW[0]; - scan.w[1] += scan.slopeW[1]; -#endif - -#ifdef IPOL_C0 - scan.c[0][0] += scan.slopeC[0][0]; - scan.c[0][1] += scan.slopeC[0][1]; -#endif - -#ifdef IPOL_C1 - scan.c[1][0] += scan.slopeC[1][0]; - scan.c[1][1] += scan.slopeC[1][1]; -#endif - -#ifdef IPOL_T0 - scan.t[0][0] += scan.slopeT[0][0]; - scan.t[0][1] += scan.slopeT[0][1]; -#endif - -#ifdef IPOL_T1 - scan.t[1][0] += scan.slopeT[1][0]; - scan.t[1][1] += scan.slopeT[1][1]; -#endif -#ifdef IPOL_T2 - scan.t[2][0] += scan.slopeT[2][0]; - scan.t[2][1] += scan.slopeT[2][1]; -#endif - -#ifdef IPOL_L0 - scan.l[0][0] += scan.slopeL[0][0]; - scan.l[0][1] += scan.slopeL[0][1]; -#endif - - } - } - -} - - -} // end namespace video -} // end namespace irr - -#endif // _IRR_COMPILE_WITH_BURNINGSVIDEO_ - -namespace irr -{ -namespace video -{ - - -//! creates a triangle renderer -IBurningShader* createTRNormalMap(CBurningVideoDriver* driver) -{ - #ifdef _IRR_COMPILE_WITH_BURNINGSVIDEO_ - return new CTRNormalMap(driver); - #else - return 0; - #endif // _IRR_COMPILE_WITH_BURNINGSVIDEO_ -} - - -} // end namespace video -} // end namespace irr - - - diff --git a/source/Irrlicht/CTRStencilShadow.cpp b/source/Irrlicht/CTRStencilShadow.cpp deleted file mode 100644 index 81e64d63..00000000 --- a/source/Irrlicht/CTRStencilShadow.cpp +++ /dev/null @@ -1,705 +0,0 @@ -// Copyright (C) 2002-2012 Nikolaus Gebhardt / Thomas Alten -// This file is part of the "Irrlicht Engine". -// For conditions of distribution and use, see copyright notice in irrlicht.h - -#include "IrrCompileConfig.h" -#include "IBurningShader.h" - -#ifdef _IRR_COMPILE_WITH_BURNINGSVIDEO_ - -// compile flag for this file -#undef USE_ZBUFFER -#undef USE_SBUFFER -#undef IPOL_Z -#undef CMP_Z -#undef WRITE_Z - -#undef IPOL_W -#undef CMP_W -#undef WRITE_W - -#undef SUBTEXEL -#undef INVERSE_W - -#undef IPOL_C0 -#undef IPOL_T0 -#undef IPOL_T1 -#undef IPOL_T2 -#undef IPOL_L0 - -// define render case -#define SUBTEXEL -//#define INVERSE_W - -#define USE_ZBUFFER -#define USE_SBUFFER -#define IPOL_W -#define CMP_W -//#define WRITE_W - - -// apply global override -#ifndef SOFTWARE_DRIVER_2_PERSPECTIVE_CORRECT - #undef INVERSE_W -#endif - -#ifndef SOFTWARE_DRIVER_2_SUBTEXEL - #undef SUBTEXEL -#endif - -#if BURNING_MATERIAL_MAX_COLORS < 1 - #undef IPOL_C0 -#endif - -#if !defined ( SOFTWARE_DRIVER_2_USE_WBUFFER ) && defined ( USE_ZBUFFER ) - #ifndef SOFTWARE_DRIVER_2_PERSPECTIVE_CORRECT - #undef IPOL_W - #endif - #define IPOL_Z - - #ifdef CMP_W - #undef CMP_W - #define CMP_Z - #endif - - #ifdef WRITE_W - #undef WRITE_W - #define WRITE_Z - #endif - -#endif - - -namespace irr -{ - -namespace video -{ - -class CTRStencilShadow : public IBurningShader -{ -public: - - //! constructor - CTRStencilShadow(CBurningVideoDriver* driver); - - //! draws an indexed triangle list - virtual void drawTriangle(const s4DVertex* burning_restrict a, const s4DVertex* burning_restrict b, const s4DVertex* burning_restrict c) _IRR_OVERRIDE_; - -private: - void fragmentShader(); - -}; - -//! constructor -CTRStencilShadow::CTRStencilShadow(CBurningVideoDriver* driver) -: IBurningShader(driver) -{ - #ifdef _DEBUG - setDebugName("CTRStencilShadow"); - #endif -} - - -/*! -*/ -void CTRStencilShadow::fragmentShader() -{ -#ifdef USE_ZBUFFER - fp24 *z; -#endif - -#ifdef USE_SBUFFER - tStencilSample *stencil; -#endif - - s32 xStart; - s32 xEnd; - s32 dx; - -#ifdef SUBTEXEL - f32 subPixel; -#endif - -#ifdef IPOL_Z - f32 slopeZ; -#endif -#ifdef IPOL_W - fp24 slopeW; -#endif - - // apply top-left fill-convention, left - xStart = fill_convention_left( line.x[0] ); - xEnd = fill_convention_right( line.x[1] ); - - dx = xEnd - xStart; - if ( dx < 0 ) - return; - - SOFTWARE_DRIVER_2_CLIPCHECK; - - // slopes - const f32 invDeltaX = fill_step_x( line.x[1] - line.x[0] ); - -#ifdef IPOL_Z - slopeZ = (line.z[1] - line.z[0]) * invDeltaX; -#endif -#ifdef IPOL_W - slopeW = (line.w[1] - line.w[0]) * invDeltaX; -#endif - -#ifdef SUBTEXEL - subPixel = ( (f32) xStart ) - line.x[0]; -#ifdef IPOL_Z - line.z[0] += slopeZ * subPixel; -#endif -#ifdef IPOL_W - line.w[0] += slopeW * subPixel; -#endif -#endif - SOFTWARE_DRIVER_2_CLIPCHECK; - //dst = (tVideoSample*)RenderTarget->getData() + ( line.y * RenderTarget->getDimension().Width ) + xStart; - -#ifdef USE_ZBUFFER - z = (fp24*) DepthBuffer->lock() + ( line.y * RenderTarget->getDimension().Width ) + xStart; -#endif - -#ifdef USE_SBUFFER - stencil = (tStencilSample*) Stencil->lock() + ( line.y * RenderTarget->getDimension().Width ) + xStart; -#endif - - -#ifdef INVERSE_W - f32 inversew = FIX_POINT_F32_MUL; -#endif - - s32 i; - for (i = 0; i <= dx; i += SOFTWARE_DRIVER_2_STEP_X) - { -#ifdef CMP_Z - if (line.z[0] < z[i]) -#endif -#ifdef CMP_W - if (line.w[0] > z[i]) -#endif - { - // zpass - switch (stencilOp[2]) - { - case StencilOp_INCR: stencil[i] += 1; break; - case StencilOp_DECR: stencil[i] -= 1; break;// core::s32_max(0, stencil[i] - 1); break; - default: - case StencilOp_KEEP: break; - } - } - else - { - // zfail - switch (stencilOp[1]) - { - case StencilOp_INCR: stencil[i] += 1; break; - case StencilOp_DECR: stencil[i] -= 1; break;// core::s32_max(0, stencil[i] - 1); break; - default: - case StencilOp_KEEP: break; - } - } - -#ifdef IPOL_Z - line.z[0] += slopeZ; -#endif -#ifdef IPOL_W - line.w[0] += slopeW; -#endif - } - -} - - -void CTRStencilShadow::drawTriangle(const s4DVertex* burning_restrict a, const s4DVertex* burning_restrict b, const s4DVertex* burning_restrict c) -{ - // sort on height, y - if ( F32_A_GREATER_B ( a->Pos.y , b->Pos.y ) ) swapVertexPointer(&a, &b); - if ( F32_A_GREATER_B ( b->Pos.y , c->Pos.y ) ) swapVertexPointer(&b, &c); - if ( F32_A_GREATER_B ( a->Pos.y , b->Pos.y ) ) swapVertexPointer(&a, &b); - - const f32 ca = c->Pos.y - a->Pos.y; - const f32 ba = b->Pos.y - a->Pos.y; - const f32 cb = c->Pos.y - b->Pos.y; - // calculate delta y of the edges - scan.invDeltaY[0] = fill_step_y( ca ); - scan.invDeltaY[1] = fill_step_y( ba ); - scan.invDeltaY[2] = fill_step_y( cb ); - - if ( F32_LOWER_EQUAL_0 ( scan.invDeltaY[0] ) ) - return; - - // find if the major edge is left or right aligned - f32 temp[4]; - - temp[0] = a->Pos.x - c->Pos.x; - temp[1] = -ca; - temp[2] = b->Pos.x - a->Pos.x; - temp[3] = ba; - - scan.left = ( temp[0] * temp[3] - temp[1] * temp[2] ) > 0.f ? 0 : 1; - scan.right = 1 - scan.left; - - // calculate slopes for the major edge - scan.slopeX[0] = (c->Pos.x - a->Pos.x) * scan.invDeltaY[0]; - scan.x[0] = a->Pos.x; - -#ifdef IPOL_Z - scan.slopeZ[0] = (c->Pos.z - a->Pos.z) * scan.invDeltaY[0]; - scan.z[0] = a->Pos.z; -#endif - -#ifdef IPOL_W - scan.slopeW[0] = (c->Pos.w - a->Pos.w) * scan.invDeltaY[0]; - scan.w[0] = a->Pos.w; -#endif - -#ifdef IPOL_C0 - scan.slopeC[0][0] = (c->Color[0] - a->Color[0]) * scan.invDeltaY[0]; - scan.c[0][0] = a->Color[0]; -#endif - -#ifdef IPOL_T0 - scan.slopeT[0][0] = (c->Tex[0] - a->Tex[0]) * scan.invDeltaY[0]; - scan.t[0][0] = a->Tex[0]; -#endif - -#ifdef IPOL_T1 - scan.slopeT[1][0] = (c->Tex[1] - a->Tex[1]) * scan.invDeltaY[0]; - scan.t[1][0] = a->Tex[1]; -#endif - -#ifdef IPOL_T2 - scan.slopeT[2][0] = (c->Tex[2] - a->Tex[2]) * scan.invDeltaY[0]; - scan.t[2][0] = a->Tex[2]; -#endif - -#ifdef IPOL_L0 - scan.slopeL[0][0] = (c->LightTangent[0] - a->LightTangent[0]) * scan.invDeltaY[0]; - scan.l[0][0] = a->LightTangent[0]; -#endif - - // top left fill convention y run - s32 yStart; - s32 yEnd; - -#ifdef SUBTEXEL - f32 subPixel; -#endif - - // rasterize upper sub-triangle - if ( F32_GREATER_0 ( scan.invDeltaY[1] ) ) - { - // calculate slopes for top edge - scan.slopeX[1] = (b->Pos.x - a->Pos.x) * scan.invDeltaY[1]; - scan.x[1] = a->Pos.x; - -#ifdef IPOL_Z - scan.slopeZ[1] = (b->Pos.z - a->Pos.z) * scan.invDeltaY[1]; - scan.z[1] = a->Pos.z; -#endif - -#ifdef IPOL_W - scan.slopeW[1] = (b->Pos.w - a->Pos.w) * scan.invDeltaY[1]; - scan.w[1] = a->Pos.w; -#endif - -#ifdef IPOL_C0 - scan.slopeC[0][1] = (b->Color[0] - a->Color[0]) * scan.invDeltaY[1]; - scan.c[0][1] = a->Color[0]; -#endif - -#ifdef IPOL_T0 - scan.slopeT[0][1] = (b->Tex[0] - a->Tex[0]) * scan.invDeltaY[1]; - scan.t[0][1] = a->Tex[0]; -#endif - -#ifdef IPOL_T1 - scan.slopeT[1][1] = (b->Tex[1] - a->Tex[1]) * scan.invDeltaY[1]; - scan.t[1][1] = a->Tex[1]; -#endif - -#ifdef IPOL_T2 - scan.slopeT[2][1] = (b->Tex[2] - a->Tex[2]) * scan.invDeltaY[1]; - scan.t[2][1] = a->Tex[2]; -#endif - -#ifdef IPOL_L0 - scan.slopeL[0][1] = (b->LightTangent[0] - a->LightTangent[0]) * scan.invDeltaY[1]; - scan.l[0][1] = a->LightTangent[0]; -#endif - - // apply top-left fill convention, top part - yStart = fill_convention_left( a->Pos.y ); - yEnd = fill_convention_right( b->Pos.y ); - -#ifdef SUBTEXEL - subPixel = ( (f32) yStart ) - a->Pos.y; - - // correct to pixel center - scan.x[0] += scan.slopeX[0] * subPixel; - scan.x[1] += scan.slopeX[1] * subPixel; - -#ifdef IPOL_Z - scan.z[0] += scan.slopeZ[0] * subPixel; - scan.z[1] += scan.slopeZ[1] * subPixel; -#endif - -#ifdef IPOL_W - scan.w[0] += scan.slopeW[0] * subPixel; - scan.w[1] += scan.slopeW[1] * subPixel; -#endif - -#ifdef IPOL_C0 - scan.c[0][0] += scan.slopeC[0][0] * subPixel; - scan.c[0][1] += scan.slopeC[0][1] * subPixel; -#endif - -#ifdef IPOL_T0 - scan.t[0][0] += scan.slopeT[0][0] * subPixel; - scan.t[0][1] += scan.slopeT[0][1] * subPixel; -#endif - -#ifdef IPOL_T1 - scan.t[1][0] += scan.slopeT[1][0] * subPixel; - scan.t[1][1] += scan.slopeT[1][1] * subPixel; -#endif - -#ifdef IPOL_T2 - scan.t[2][0] += scan.slopeT[2][0] * subPixel; - scan.t[2][1] += scan.slopeT[2][1] * subPixel; -#endif - -#ifdef IPOL_L0 - scan.l[0][0] += scan.slopeL[0][0] * subPixel; - scan.l[0][1] += scan.slopeL[0][1] * subPixel; -#endif - -#endif - - // rasterize the edge scanlines - for( line.y = yStart; line.y <= yEnd; line.y += SOFTWARE_DRIVER_2_STEP_Y) - { - line.x[scan.left] = scan.x[0]; - line.x[scan.right] = scan.x[1]; - -#ifdef IPOL_Z - line.z[scan.left] = scan.z[0]; - line.z[scan.right] = scan.z[1]; -#endif - -#ifdef IPOL_W - line.w[scan.left] = scan.w[0]; - line.w[scan.right] = scan.w[1]; -#endif - -#ifdef IPOL_C0 - line.c[0][scan.left] = scan.c[0][0]; - line.c[0][scan.right] = scan.c[0][1]; -#endif - -#ifdef IPOL_T0 - line.t[0][scan.left] = scan.t[0][0]; - line.t[0][scan.right] = scan.t[0][1]; -#endif - -#ifdef IPOL_T1 - line.t[1][scan.left] = scan.t[1][0]; - line.t[1][scan.right] = scan.t[1][1]; -#endif - -#ifdef IPOL_T2 - line.t[2][scan.left] = scan.t[2][0]; - line.t[2][scan.right] = scan.t[2][1]; -#endif - -#ifdef IPOL_L0 - line.l[0][scan.left] = scan.l[0][0]; - line.l[0][scan.right] = scan.l[0][1]; -#endif - - // render a scanline - interlace_scanline fragmentShader (); - - scan.x[0] += scan.slopeX[0]; - scan.x[1] += scan.slopeX[1]; - -#ifdef IPOL_Z - scan.z[0] += scan.slopeZ[0]; - scan.z[1] += scan.slopeZ[1]; -#endif - -#ifdef IPOL_W - scan.w[0] += scan.slopeW[0]; - scan.w[1] += scan.slopeW[1]; -#endif - -#ifdef IPOL_C0 - scan.c[0][0] += scan.slopeC[0][0]; - scan.c[0][1] += scan.slopeC[0][1]; -#endif - -#ifdef IPOL_T0 - scan.t[0][0] += scan.slopeT[0][0]; - scan.t[0][1] += scan.slopeT[0][1]; -#endif - -#ifdef IPOL_T1 - scan.t[1][0] += scan.slopeT[1][0]; - scan.t[1][1] += scan.slopeT[1][1]; -#endif - -#ifdef IPOL_T2 - scan.t[2][0] += scan.slopeT[2][0]; - scan.t[2][1] += scan.slopeT[2][1]; -#endif - -#ifdef IPOL_L0 - scan.l[0][0] += scan.slopeL[0][0]; - scan.l[0][1] += scan.slopeL[0][1]; -#endif - - } - } - - // rasterize lower sub-triangle - //if ( (f32) 0.0 != scan.invDeltaY[2] ) - if ( F32_GREATER_0 ( scan.invDeltaY[2] ) ) - { - // advance to middle point - //if( (f32) 0.0 != scan.invDeltaY[1] ) - if ( F32_GREATER_0 ( scan.invDeltaY[1] ) ) - { - temp[0] = b->Pos.y - a->Pos.y; // dy - - scan.x[0] = a->Pos.x + scan.slopeX[0] * temp[0]; -#ifdef IPOL_Z - scan.z[0] = a->Pos.z + scan.slopeZ[0] * temp[0]; -#endif -#ifdef IPOL_W - scan.w[0] = a->Pos.w + scan.slopeW[0] * temp[0]; -#endif -#ifdef IPOL_C0 - scan.c[0][0] = a->Color[0] + scan.slopeC[0][0] * temp[0]; -#endif -#ifdef IPOL_T0 - scan.t[0][0] = a->Tex[0] + scan.slopeT[0][0] * temp[0]; -#endif -#ifdef IPOL_T1 - scan.t[1][0] = a->Tex[1] + scan.slopeT[1][0] * temp[0]; -#endif -#ifdef IPOL_T2 - scan.t[2][0] = a->Tex[2] + scan.slopeT[2][0] * temp[0]; -#endif -#ifdef IPOL_L0 - scan.l[0][0] = a->LightTangent[0] + scan.slopeL[0][0] * temp[0]; -#endif - - } - - // calculate slopes for bottom edge - scan.slopeX[1] = (c->Pos.x - b->Pos.x) * scan.invDeltaY[2]; - scan.x[1] = b->Pos.x; - -#ifdef IPOL_Z - scan.slopeZ[1] = (c->Pos.z - b->Pos.z) * scan.invDeltaY[2]; - scan.z[1] = b->Pos.z; -#endif - -#ifdef IPOL_W - scan.slopeW[1] = (c->Pos.w - b->Pos.w) * scan.invDeltaY[2]; - scan.w[1] = b->Pos.w; -#endif - -#ifdef IPOL_C0 - scan.slopeC[0][1] = (c->Color[0] - b->Color[0]) * scan.invDeltaY[2]; - scan.c[0][1] = b->Color[0]; -#endif - -#ifdef IPOL_T0 - scan.slopeT[0][1] = (c->Tex[0] - b->Tex[0]) * scan.invDeltaY[2]; - scan.t[0][1] = b->Tex[0]; -#endif - -#ifdef IPOL_T1 - scan.slopeT[1][1] = (c->Tex[1] - b->Tex[1]) * scan.invDeltaY[2]; - scan.t[1][1] = b->Tex[1]; -#endif - -#ifdef IPOL_T2 - scan.slopeT[2][1] = (c->Tex[2] - b->Tex[2]) * scan.invDeltaY[2]; - scan.t[2][1] = b->Tex[2]; -#endif - -#ifdef IPOL_L0 - scan.slopeL[0][1] = (c->LightTangent[0] - b->LightTangent[0]) * scan.invDeltaY[2]; - scan.l[0][1] = b->LightTangent[0]; -#endif - - // apply top-left fill convention, top part - yStart = fill_convention_left( b->Pos.y ); - yEnd = fill_convention_right( c->Pos.y ); - -#ifdef SUBTEXEL - subPixel = ( (f32) yStart ) - b->Pos.y; - - // correct to pixel center - scan.x[0] += scan.slopeX[0] * subPixel; - scan.x[1] += scan.slopeX[1] * subPixel; - -#ifdef IPOL_Z - scan.z[0] += scan.slopeZ[0] * subPixel; - scan.z[1] += scan.slopeZ[1] * subPixel; -#endif - -#ifdef IPOL_W - scan.w[0] += scan.slopeW[0] * subPixel; - scan.w[1] += scan.slopeW[1] * subPixel; -#endif - -#ifdef IPOL_C0 - scan.c[0][0] += scan.slopeC[0][0] * subPixel; - scan.c[0][1] += scan.slopeC[0][1] * subPixel; -#endif - -#ifdef IPOL_T0 - scan.t[0][0] += scan.slopeT[0][0] * subPixel; - scan.t[0][1] += scan.slopeT[0][1] * subPixel; -#endif - -#ifdef IPOL_T1 - scan.t[1][0] += scan.slopeT[1][0] * subPixel; - scan.t[1][1] += scan.slopeT[1][1] * subPixel; -#endif - -#ifdef IPOL_T2 - scan.t[2][0] += scan.slopeT[2][0] * subPixel; - scan.t[2][1] += scan.slopeT[2][1] * subPixel; -#endif - -#ifdef IPOL_L0 - scan.l[0][0] += scan.slopeL[0][0] * subPixel; - scan.l[0][1] += scan.slopeL[0][1] * subPixel; -#endif - -#endif - - // rasterize the edge scanlines - for( line.y = yStart; line.y <= yEnd; line.y += SOFTWARE_DRIVER_2_STEP_Y) - { - line.x[scan.left] = scan.x[0]; - line.x[scan.right] = scan.x[1]; - -#ifdef IPOL_Z - line.z[scan.left] = scan.z[0]; - line.z[scan.right] = scan.z[1]; -#endif - -#ifdef IPOL_W - line.w[scan.left] = scan.w[0]; - line.w[scan.right] = scan.w[1]; -#endif - -#ifdef IPOL_C0 - line.c[0][scan.left] = scan.c[0][0]; - line.c[0][scan.right] = scan.c[0][1]; -#endif - -#ifdef IPOL_T0 - line.t[0][scan.left] = scan.t[0][0]; - line.t[0][scan.right] = scan.t[0][1]; -#endif - -#ifdef IPOL_T1 - line.t[1][scan.left] = scan.t[1][0]; - line.t[1][scan.right] = scan.t[1][1]; -#endif - -#ifdef IPOL_T2 - line.t[2][scan.left] = scan.t[2][0]; - line.t[2][scan.right] = scan.t[2][1]; -#endif - -#ifdef IPOL_L0 - line.l[0][scan.left] = scan.l[0][0]; - line.l[0][scan.right] = scan.l[0][1]; -#endif - - // render a scanline - interlace_scanline fragmentShader (); - - scan.x[0] += scan.slopeX[0]; - scan.x[1] += scan.slopeX[1]; - -#ifdef IPOL_Z - scan.z[0] += scan.slopeZ[0]; - scan.z[1] += scan.slopeZ[1]; -#endif - -#ifdef IPOL_W - scan.w[0] += scan.slopeW[0]; - scan.w[1] += scan.slopeW[1]; -#endif - -#ifdef IPOL_C0 - scan.c[0][0] += scan.slopeC[0][0]; - scan.c[0][1] += scan.slopeC[0][1]; -#endif - -#ifdef IPOL_T0 - scan.t[0][0] += scan.slopeT[0][0]; - scan.t[0][1] += scan.slopeT[0][1]; -#endif - -#ifdef IPOL_T1 - scan.t[1][0] += scan.slopeT[1][0]; - scan.t[1][1] += scan.slopeT[1][1]; -#endif -#ifdef IPOL_T2 - scan.t[2][0] += scan.slopeT[2][0]; - scan.t[2][1] += scan.slopeT[2][1]; -#endif - -#ifdef IPOL_L0 - scan.l[0][0] += scan.slopeL[0][0]; - scan.l[0][1] += scan.slopeL[0][1]; -#endif - - } - } - -} - - -} // end namespace video -} // end namespace irr - -#endif // _IRR_COMPILE_WITH_BURNINGSVIDEO_ - -namespace irr -{ -namespace video -{ - - -//! creates a triangle renderer -IBurningShader* createTRStencilShadow(CBurningVideoDriver* driver) -{ - //ETR_STENCIL_SHADOW - #ifdef _IRR_COMPILE_WITH_BURNINGSVIDEO_ - return new CTRStencilShadow(driver); - #else - return 0; - #endif // _IRR_COMPILE_WITH_BURNINGSVIDEO_ -} - - -} // end namespace video -} // end namespace irr - - - diff --git a/source/Irrlicht/CTRTextureBlend.cpp b/source/Irrlicht/CTRTextureBlend.cpp deleted file mode 100644 index 8d22291c..00000000 --- a/source/Irrlicht/CTRTextureBlend.cpp +++ /dev/null @@ -1,2567 +0,0 @@ -// Copyright (C) 2002-2012 Nikolaus Gebhardt / Thomas Alten -// This file is part of the "Irrlicht Engine". -// For conditions of distribution and use, see copyright notice in irrlicht.h - -#include "IrrCompileConfig.h" -#include "IBurningShader.h" - -#ifdef _IRR_COMPILE_WITH_BURNINGSVIDEO_ - -// compile flag for this file -#undef USE_ZBUFFER -#undef IPOL_Z -#undef CMP_Z -#undef WRITE_Z - -#undef IPOL_W -#undef CMP_W -#undef WRITE_W - -#undef SUBTEXEL -#undef INVERSE_W - -#undef IPOL_C0 -#undef IPOL_T0 -#undef IPOL_T1 - -// define render case -#define SUBTEXEL -#define INVERSE_W - -#define USE_ZBUFFER -#define IPOL_W -#define CMP_W -#define WRITE_W - -#define IPOL_C0 -#define IPOL_T0 -//#define IPOL_T1 - -// apply global override -#ifndef SOFTWARE_DRIVER_2_PERSPECTIVE_CORRECT - #undef INVERSE_W -#endif - -#ifndef SOFTWARE_DRIVER_2_SUBTEXEL - #undef SUBTEXEL -#endif - -#if BURNING_MATERIAL_MAX_COLORS < 1 - #undef IPOL_C0 -#endif - -#if !defined ( SOFTWARE_DRIVER_2_USE_WBUFFER ) && defined ( USE_ZBUFFER ) - #ifndef SOFTWARE_DRIVER_2_PERSPECTIVE_CORRECT - #undef IPOL_W - #endif - #define IPOL_Z - - #ifdef CMP_W - #undef CMP_W - #define CMP_Z - #endif - - #ifdef WRITE_W - #undef WRITE_W - #define WRITE_Z - #endif - -#endif - - - -namespace irr -{ - -namespace video -{ - - class CTRTextureBlend : public IBurningShader - { - public: - - //! constructor - CTRTextureBlend(CBurningVideoDriver* driver); - - //! draws an indexed triangle list - virtual void drawTriangle(const s4DVertex* burning_restrict a, const s4DVertex* burning_restrict b, const s4DVertex* burning_restrict c) _IRR_OVERRIDE_; - virtual void OnSetMaterial(const SBurningShaderMaterial& material) _IRR_OVERRIDE_; - -private: - // fragment shader - typedef void (CTRTextureBlend::*tFragmentShader) (); - void fragment_dst_color_zero (); - void fragment_dst_color_one (); - void fragment_dst_color_src_alpha (); - void fragment_dst_color_one_minus_dst_alpha (); - void fragment_zero_one_minus_scr_color (); - void fragment_src_color_src_alpha (); - void fragment_one_one_minus_src_alpha (); - void fragment_one_minus_dst_alpha_one(); - void fragment_src_alpha_one(); - void fragment_src_alpha_one_minus_src_alpha(); - - tFragmentShader fragmentShader; - - E_COMPARISON_FUNC depth_func; -}; - -//! constructor -CTRTextureBlend::CTRTextureBlend(CBurningVideoDriver* driver) -: IBurningShader(driver) -{ - #ifdef _DEBUG - setDebugName("CTRTextureBlend"); - #endif - - depth_func = ECFN_LESSEQUAL; - fragmentShader = &CTRTextureBlend::fragment_dst_color_zero; -} - -/*! -*/ -void CTRTextureBlend::OnSetMaterial(const SBurningShaderMaterial& material) -{ - int showname = 0; - - depth_func = (E_COMPARISON_FUNC)material.org.ZBuffer; - AlphaRef = 0; // tofix(material.org.MaterialTypeParam, FIXPOINT_COLOR_MAX); - - E_BLEND_FACTOR srcFact,dstFact; - E_MODULATE_FUNC modulate; - u32 alphaSrc; - unpack_textureBlendFunc ( srcFact, dstFact, modulate, alphaSrc, material.org.MaterialTypeParam); - - fragmentShader = 0; - - if ( srcFact == EBF_DST_COLOR && dstFact == EBF_ZERO ) - { - fragmentShader = &CTRTextureBlend::fragment_dst_color_zero; - } - else if ( srcFact == EBF_DST_COLOR && dstFact == EBF_ONE ) - { - fragmentShader = &CTRTextureBlend::fragment_dst_color_one; - } - else if ( srcFact == EBF_DST_COLOR && dstFact == EBF_SRC_ALPHA) - { - fragmentShader = &CTRTextureBlend::fragment_dst_color_src_alpha; - } - else if ( srcFact == EBF_DST_COLOR && dstFact == EBF_ONE_MINUS_DST_ALPHA) - { - fragmentShader = &CTRTextureBlend::fragment_dst_color_one_minus_dst_alpha; - } - else if ( srcFact == EBF_ZERO && dstFact == EBF_ONE_MINUS_SRC_COLOR ) - { - fragmentShader = &CTRTextureBlend::fragment_zero_one_minus_scr_color; - } - else if ( srcFact == EBF_ONE && dstFact == EBF_ONE_MINUS_SRC_ALPHA) - { - fragmentShader = &CTRTextureBlend::fragment_one_one_minus_src_alpha; - } - else if ( srcFact == EBF_ONE_MINUS_DST_ALPHA && dstFact == EBF_ONE ) - { - fragmentShader = &CTRTextureBlend::fragment_one_minus_dst_alpha_one; - } - else if ( srcFact == EBF_SRC_ALPHA && dstFact == EBF_ONE ) - { - fragmentShader = &CTRTextureBlend::fragment_src_alpha_one; - } - else if (srcFact == EBF_SRC_ALPHA && dstFact == EBF_ONE_MINUS_SRC_ALPHA) - { - fragmentShader = &CTRTextureBlend::fragment_src_alpha_one_minus_src_alpha; - } - else if ( srcFact == EBF_SRC_COLOR && dstFact == EBF_SRC_ALPHA ) - { - fragmentShader = &CTRTextureBlend::fragment_src_color_src_alpha; - } - else - { - showname = 1; - fragmentShader = &CTRTextureBlend::fragment_dst_color_zero; - } - - static const c8 *n[] = - { - "gl_zero", - "gl_one", - "gl_dst_color", - "gl_one_minus_dst_color", - "gl_src_color", - "gl_one_minus_src_color", - "gl_src_alpha", - "gl_one_minus_src_alpha", - "gl_dst_alpha", - "gl_one_minus_dst_alpha", - "gl_src_alpha_saturate" - }; - - static E_BLEND_FACTOR lsrcFact = EBF_ZERO; - static E_BLEND_FACTOR ldstFact = EBF_ZERO; - - if ( showname && ( lsrcFact != srcFact || ldstFact != dstFact ) ) - { - char buf[128]; - snprintf_irr ( buf, 128, "missing shader: %s %s",n[srcFact], n[dstFact] ); - os::Printer::log( buf, ELL_WARNING); - - lsrcFact = srcFact; - ldstFact = dstFact; - } - -} - - -/*! -*/ -void CTRTextureBlend::fragment_dst_color_src_alpha () -{ - tVideoSample *dst; - -#ifdef USE_ZBUFFER - fp24 *z; -#endif - - s32 xStart; - s32 xEnd; - s32 dx; - - -#ifdef SUBTEXEL - f32 subPixel; -#endif - -#ifdef IPOL_Z - f32 slopeZ; -#endif -#ifdef IPOL_W - fp24 slopeW; -#endif -#ifdef IPOL_C0 - sVec4 slopeC[BURNING_MATERIAL_MAX_COLORS]; -#endif -#ifdef IPOL_T0 - sVec2 slopeT[BURNING_MATERIAL_MAX_TEXTURES]; -#endif - - // apply top-left fill-convention, left - xStart = fill_convention_left( line.x[0] ); - xEnd = fill_convention_right( line.x[1] ); - - dx = xEnd - xStart; - - if ( dx < 0 ) - return; - - // slopes - const f32 invDeltaX = fill_step_x( line.x[1] - line.x[0] ); - -#ifdef IPOL_Z - slopeZ = (line.z[1] - line.z[0]) * invDeltaX; -#endif -#ifdef IPOL_W - slopeW = (line.w[1] - line.w[0]) * invDeltaX; -#endif -#ifdef IPOL_C0 - slopeC[0] = (line.c[0][1] - line.c[0][0]) * invDeltaX; -#endif -#ifdef IPOL_T0 - slopeT[0] = (line.t[0][1] - line.t[0][0]) * invDeltaX; -#endif -#ifdef IPOL_T1 - slopeT[1] = (line.t[1][1] - line.t[1][0]) * invDeltaX; -#endif - -#ifdef SUBTEXEL - subPixel = ( (f32) xStart ) - line.x[0]; -#ifdef IPOL_Z - line.z[0] += slopeZ * subPixel; -#endif -#ifdef IPOL_W - line.w[0] += slopeW * subPixel; -#endif -#ifdef IPOL_C0 - line.c[0][0] += slopeC[0] * subPixel; -#endif -#ifdef IPOL_T0 - line.t[0][0] += slopeT[0] * subPixel; -#endif -#ifdef IPOL_T1 - line.t[1][0] += slopeT[1] * subPixel; -#endif -#endif - - SOFTWARE_DRIVER_2_CLIPCHECK; - dst = (tVideoSample*)RenderTarget->getData() + ( line.y * RenderTarget->getDimension().Width ) + xStart; - -#ifdef USE_ZBUFFER - z = (fp24*) DepthBuffer->lock() + ( line.y * RenderTarget->getDimension().Width ) + xStart; -#endif - - - f32 iw = FIX_POINT_F32_MUL; - - tFixPoint a0, r0, g0, b0; - tFixPoint r1, g1, b1; - - s32 i; - - switch (depth_func) - { - default: - case ECFN_LESSEQUAL: - for ( i = 0; i <= dx; i += SOFTWARE_DRIVER_2_STEP_X) - { -#ifdef CMP_W - if ( line.w[0] >= z[i] ) -#endif - - { - -#ifdef WRITE_W - z[i] = line.w[0]; -#endif - -#ifdef INVERSE_W - iw = fix_inverse32 ( line.w[0] ); -#endif - - getSample_texture ( a0,r0,g0,b0, - &IT[0], - tofix(line.t[0][0].x, iw), - tofix(line.t[0][0].y, iw) - ); - - color_to_fix ( r1, g1, b1, dst[i] ); - - dst[i] = fix_to_sample( clampfix_maxcolor ( imulFix_tex2 ( r0, r1 ) ), - clampfix_maxcolor ( imulFix_tex2 ( g0, g1 ) ), - clampfix_maxcolor ( imulFix_tex2 ( b0, b1 ) ) - ); - } - -#ifdef IPOL_W - line.w[0] += slopeW; -#endif -#ifdef IPOL_T0 - line.t[0][0] += slopeT[0]; -#endif -#ifdef IPOL_C0 - line.c[0][0] += slopeC[0]; -#endif - } - break; - - case 2: - for ( i = 0; i <= dx; i += SOFTWARE_DRIVER_2_STEP_X) - { -#ifdef CMP_W - if ( line.w[0] == z[i] ) -#endif - - { - -#ifdef WRITE_W - z[i] = line.w[0]; -#endif - -#ifdef INVERSE_W - iw = fix_inverse32 ( line.w[0] ); -#endif - - getSample_texture ( a0,r0,g0,b0, - &IT[0], - tofix ( line.t[0][0].x,iw), - tofix ( line.t[0][0].y,iw) - ); - - color_to_fix ( r1, g1, b1, dst[i] ); - - dst[i] = fix_to_sample( clampfix_maxcolor ( imulFix_tex2 ( r0, r1 ) ), - clampfix_maxcolor ( imulFix_tex2 ( g0, g1 ) ), - clampfix_maxcolor ( imulFix_tex2 ( b0, b1 ) ) - ); - - } - -#ifdef IPOL_W - line.w[0] += slopeW; -#endif -#ifdef IPOL_T0 - line.t[0][0] += slopeT[0]; -#endif -#ifdef IPOL_C0 - line.c[0][0] += slopeC[0]; -#endif - }break; - } // zcompare - -} - -/*! -*/ -void CTRTextureBlend::fragment_src_color_src_alpha () -{ - tVideoSample *dst; - -#ifdef USE_ZBUFFER - fp24 *z; -#endif - - s32 xStart; - s32 xEnd; - s32 dx; - - -#ifdef SUBTEXEL - f32 subPixel; -#endif - -#ifdef IPOL_Z - f32 slopeZ; -#endif -#ifdef IPOL_W - fp24 slopeW; -#endif -#ifdef IPOL_C0 - sVec4 slopeC[BURNING_MATERIAL_MAX_COLORS]; -#endif -#ifdef IPOL_T0 - sVec2 slopeT[BURNING_MATERIAL_MAX_TEXTURES]; -#endif - - // apply top-left fill-convention, left - xStart = fill_convention_left( line.x[0] ); - xEnd = fill_convention_right( line.x[1] ); - - dx = xEnd - xStart; - if ( dx < 0 ) - return; - - // slopes - const f32 invDeltaX = fill_step_x( line.x[1] - line.x[0] ); - -#ifdef IPOL_Z - slopeZ = (line.z[1] - line.z[0]) * invDeltaX; -#endif -#ifdef IPOL_W - slopeW = (line.w[1] - line.w[0]) * invDeltaX; -#endif -#ifdef IPOL_C0 - slopeC[0] = (line.c[0][1] - line.c[0][0]) * invDeltaX; -#endif -#ifdef IPOL_T0 - slopeT[0] = (line.t[0][1] - line.t[0][0]) * invDeltaX; -#endif -#ifdef IPOL_T1 - slopeT[1] = (line.t[1][1] - line.t[1][0]) * invDeltaX; -#endif - -#ifdef SUBTEXEL - subPixel = ( (f32) xStart ) - line.x[0]; -#ifdef IPOL_Z - line.z[0] += slopeZ * subPixel; -#endif -#ifdef IPOL_W - line.w[0] += slopeW * subPixel; -#endif -#ifdef IPOL_C0 - line.c[0][0] += slopeC[0] * subPixel; -#endif -#ifdef IPOL_T0 - line.t[0][0] += slopeT[0] * subPixel; -#endif -#ifdef IPOL_T1 - line.t[1][0] += slopeT[1] * subPixel; -#endif -#endif - - SOFTWARE_DRIVER_2_CLIPCHECK; - dst = (tVideoSample*)RenderTarget->getData() + ( line.y * RenderTarget->getDimension().Width ) + xStart; - -#ifdef USE_ZBUFFER - z = (fp24*) DepthBuffer->lock() + ( line.y * RenderTarget->getDimension().Width ) + xStart; -#endif - - - f32 iw = FIX_POINT_F32_MUL; - - tFixPoint a0, r0, g0, b0; - tFixPoint r1, g1, b1; - -#ifdef IPOL_C0 - tFixPoint a2,r2, g2, b2; -#endif - - s32 i; - - switch (depth_func) - { - default: - case ECFN_LESSEQUAL: - for ( i = 0; i <= dx; i += SOFTWARE_DRIVER_2_STEP_X) - { -#ifdef CMP_W - if ( line.w[0] >= z[i] ) -#endif - - { - //solves example 08. todo: depth_write. -#ifdef WRITE_W - //z[i] = line.w[0]; -#endif - -#ifdef INVERSE_W - iw = fix_inverse32 ( line.w[0] ); -#endif - - getSample_texture ( a0, r0, g0, b0, &IT[0], tofix ( line.t[0][0].x,iw), tofix ( line.t[0][0].y,iw) ); - -#ifdef IPOL_C0 - vec4_to_fix(a2,r2, g2, b2, line.c[0][0], iw); - //a0 = imulFix(a0, a2); why is vertex color enabled and not vertex_alpha? - r0 = imulFix_simple(r0, r2); - g0 = imulFix_simple(g0, g2); - b0 = imulFix_simple(b0, b2); -#endif - - color_to_fix ( r1, g1, b1, dst[i] ); - dst[i] = fix_to_sample( clampfix_maxcolor ( imulFix_tex1( r0, r0 ) + imulFix_tex1( r1, a0 ) ), - clampfix_maxcolor ( imulFix_tex1( g0, g0 ) + imulFix_tex1( g1, a0 ) ), - clampfix_maxcolor ( imulFix_tex1( b0, b0 ) + imulFix_tex1( b1, a0 ) ) - ); - - } - -#ifdef IPOL_W - line.w[0] += slopeW; -#endif -#ifdef IPOL_T0 - line.t[0][0] += slopeT[0]; -#endif -#ifdef IPOL_C0 - line.c[0][0] += slopeC[0]; -#endif - } - break; - - case 2: - for ( i = 0; i <= dx; i += SOFTWARE_DRIVER_2_STEP_X) - { -#ifdef CMP_W - if ( line.w[0] == z[i] ) -#endif - - { - -#ifdef WRITE_W - z[i] = line.w[0]; -#endif - -#ifdef INVERSE_W - iw = fix_inverse32 ( line.w[0] ); -#endif - - getSample_texture ( a0,r0,g0,b0, - &IT[0], - tofix ( line.t[0][0].x,iw), - tofix ( line.t[0][0].y,iw) - ); - - color_to_fix ( r1, g1, b1, dst[i] ); - - dst[i] = fix_to_sample( clampfix_maxcolor ( imulFix_tex2 ( r0, r1 ) ), - clampfix_maxcolor ( imulFix_tex2 ( g0, g1 ) ), - clampfix_maxcolor ( imulFix_tex2 ( b0, b1 ) ) - ); - - } - -#ifdef IPOL_W - line.w[0] += slopeW; -#endif -#ifdef IPOL_T0 - line.t[0][0] += slopeT[0]; -#endif -#ifdef IPOL_C0 - line.c[0][0] += slopeC[0]; -#endif - }break; - - } // zcompare - -} - -/*! -*/ -void CTRTextureBlend::fragment_one_one_minus_src_alpha() -{ - tVideoSample *dst; - -#ifdef USE_ZBUFFER - fp24 *z; -#endif - - s32 xStart; - s32 xEnd; - s32 dx; - - -#ifdef SUBTEXEL - f32 subPixel; -#endif - -#ifdef IPOL_Z - f32 slopeZ; -#endif -#ifdef IPOL_W - fp24 slopeW; -#endif -#ifdef IPOL_C0 - sVec4 slopeC[BURNING_MATERIAL_MAX_COLORS]; -#endif -#ifdef IPOL_T0 - sVec2 slopeT[BURNING_MATERIAL_MAX_TEXTURES]; -#endif - - // apply top-left fill-convention, left - xStart = fill_convention_left( line.x[0] ); - xEnd = fill_convention_right( line.x[1] ); - - dx = xEnd - xStart; - - if ( dx < 0 ) - return; - - // slopes - const f32 invDeltaX = fill_step_x( line.x[1] - line.x[0] ); - -#ifdef IPOL_Z - slopeZ = (line.z[1] - line.z[0]) * invDeltaX; -#endif -#ifdef IPOL_W - slopeW = (line.w[1] - line.w[0]) * invDeltaX; -#endif -#ifdef IPOL_C0 - slopeC[0] = (line.c[0][1] - line.c[0][0]) * invDeltaX; -#endif -#ifdef IPOL_T0 - slopeT[0] = (line.t[0][1] - line.t[0][0]) * invDeltaX; -#endif -#ifdef IPOL_T1 - slopeT[1] = (line.t[1][1] - line.t[1][0]) * invDeltaX; -#endif - -#ifdef SUBTEXEL - subPixel = ( (f32) xStart ) - line.x[0]; -#ifdef IPOL_Z - line.z[0] += slopeZ * subPixel; -#endif -#ifdef IPOL_W - line.w[0] += slopeW * subPixel; -#endif -#ifdef IPOL_C0 - line.c[0][0] += slopeC[0] * subPixel; -#endif -#ifdef IPOL_T0 - line.t[0][0] += slopeT[0] * subPixel; -#endif -#ifdef IPOL_T1 - line.t[1][0] += slopeT[1] * subPixel; -#endif -#endif - - SOFTWARE_DRIVER_2_CLIPCHECK; - dst = (tVideoSample*)RenderTarget->getData() + ( line.y * RenderTarget->getDimension().Width ) + xStart; - -#ifdef USE_ZBUFFER - z = (fp24*) DepthBuffer->lock() + ( line.y * RenderTarget->getDimension().Width ) + xStart; -#endif - - - f32 iw = FIX_POINT_F32_MUL; - - tFixPoint a0,r0, g0, b0; - tFixPoint r1, g1, b1; -#ifdef IPOL_C0 - tFixPoint r2, g2, b2; -#endif - s32 i; - - switch (depth_func) - { - default: - case ECFN_LESSEQUAL: - for ( i = 0; i <= dx; i += SOFTWARE_DRIVER_2_STEP_X) - { -#ifdef CMP_W - if ( line.w[0] >= z[i] ) -#endif - - { - -#ifdef WRITE_W - z[i] = line.w[0]; -#endif - -#ifdef INVERSE_W - iw = fix_inverse32 ( line.w[0] ); -#endif - - getSample_texture ( a0, r0, g0, b0, IT + 0, tofix ( line.t[0][0].x,iw),tofix ( line.t[0][0].y,iw) ); - a0 = FIX_POINT_ONE - a0; - - color_to_fix1 ( r1, g1, b1, dst[i] ); -#ifdef IPOL_C0 - vec4_to_fix( r2, g2, b2, line.c[0][0],iw ); - - dst[i] = fix_to_sample( imulFix ( r0 + imulFix_simple( r1, a0 ), r2 ), - imulFix ( g0 + imulFix_simple( g1, a0 ), g2 ), - imulFix ( b0 + imulFix_simple( b1, a0 ), b2 ) - ); -#else - dst[i] = fix_to_sample( r0 + imulFix_simple( r1, a0 ), - g0 + imulFix_simple( g1, a0 ), - b0 + imulFix_simple( b1, a0 ) - ); - -#endif - - } - -#ifdef IPOL_W - line.w[0] += slopeW; -#endif -#ifdef IPOL_T0 - line.t[0][0] += slopeT[0]; -#endif -#ifdef IPOL_C0 - line.c[0][0] += slopeC[0]; -#endif - } - break; - - case 2: - for ( i = 0; i <= dx; i += SOFTWARE_DRIVER_2_STEP_X) - { -#ifdef CMP_W - if ( line.w[0] == z[i] ) -#endif - - { - -#ifdef WRITE_W - z[i] = line.w[0]; -#endif - -#ifdef INVERSE_W - iw = fix_inverse32 ( line.w[0] ); -#endif - getSample_texture ( a0, r0, g0, b0, IT + 0, tofix ( line.t[0][0].x,iw),tofix ( line.t[0][0].y,iw) ); - a0 = FIX_POINT_ONE - a0; - - color_to_fix1 ( r1, g1, b1, dst[i] ); -#ifdef IPOL_C0 - vec4_to_fix( r2, g2, b2, line.c[0][0],iw ); - - dst[i] = fix_to_sample( imulFix ( r0 + imulFix_simple( r1, a0 ), r2 ), - imulFix ( g0 + imulFix_simple( g1, a0 ), g2 ), - imulFix ( b0 + imulFix_simple( b1, a0 ), b2 ) - ); -#else - dst[i] = fix_to_sample( r0 + imulFix_simple( r1, a0 ), - g0 + imulFix_simple( g1, a0 ), - b0 + imulFix_simple( b1, a0 ) - ); - -#endif - - } - -#ifdef IPOL_W - line.w[0] += slopeW; -#endif -#ifdef IPOL_T0 - line.t[0][0] += slopeT[0]; -#endif -#ifdef IPOL_C0 - line.c[0][0] += slopeC[0]; -#endif - }break; - - } // zcompare - -} - -/*! -*/ -void CTRTextureBlend::fragment_one_minus_dst_alpha_one () -{ - tVideoSample *dst; - -#ifdef USE_ZBUFFER - fp24 *z; -#endif - - s32 xStart; - s32 xEnd; - s32 dx; - - -#ifdef SUBTEXEL - f32 subPixel; -#endif - -#ifdef IPOL_Z - f32 slopeZ; -#endif -#ifdef IPOL_W - fp24 slopeW; -#endif -#ifdef IPOL_C0 - sVec4 slopeC[BURNING_MATERIAL_MAX_COLORS]; -#endif -#ifdef IPOL_T0 - sVec2 slopeT[BURNING_MATERIAL_MAX_TEXTURES]; -#endif - - // apply top-left fill-convention, left - xStart = fill_convention_left( line.x[0] ); - xEnd = fill_convention_right( line.x[1] ); - - dx = xEnd - xStart; - - if ( dx < 0 ) - return; - - // slopes - const f32 invDeltaX = fill_step_x( line.x[1] - line.x[0] ); - -#ifdef IPOL_Z - slopeZ = (line.z[1] - line.z[0]) * invDeltaX; -#endif -#ifdef IPOL_W - slopeW = (line.w[1] - line.w[0]) * invDeltaX; -#endif -#ifdef IPOL_C0 - slopeC[0] = (line.c[0][1] - line.c[0][0]) * invDeltaX; -#endif -#ifdef IPOL_T0 - slopeT[0] = (line.t[0][1] - line.t[0][0]) * invDeltaX; -#endif -#ifdef IPOL_T1 - slopeT[1] = (line.t[1][1] - line.t[1][0]) * invDeltaX; -#endif - -#ifdef SUBTEXEL - subPixel = ( (f32) xStart ) - line.x[0]; -#ifdef IPOL_Z - line.z[0] += slopeZ * subPixel; -#endif -#ifdef IPOL_W - line.w[0] += slopeW * subPixel; -#endif -#ifdef IPOL_C0 - line.c[0][0] += slopeC[0] * subPixel; -#endif -#ifdef IPOL_T0 - line.t[0][0] += slopeT[0] * subPixel; -#endif -#ifdef IPOL_T1 - line.t[1][0] += slopeT[1] * subPixel; -#endif -#endif - - SOFTWARE_DRIVER_2_CLIPCHECK; - dst = (tVideoSample*)RenderTarget->getData() + ( line.y * RenderTarget->getDimension().Width ) + xStart; - -#ifdef USE_ZBUFFER - z = (fp24*) DepthBuffer->lock() + ( line.y * RenderTarget->getDimension().Width ) + xStart; -#endif - - - f32 iw = FIX_POINT_F32_MUL; - - tFixPoint r0, g0, b0; - tFixPoint a1, r1, g1, b1; -#ifdef IPOL_C0 - tFixPoint r2, g2, b2; -#endif - s32 i; - - switch (depth_func) - { - default: - case ECFN_LESSEQUAL: - for ( i = 0; i <= dx; i += SOFTWARE_DRIVER_2_STEP_X) - { -#ifdef CMP_W - if ( line.w[0] >= z[i] ) -#endif - - { - -#ifdef WRITE_W - z[i] = line.w[0]; -#endif - -#ifdef INVERSE_W - iw = fix_inverse32 ( line.w[0] ); -#endif - - getSample_texture ( r0, g0, b0, IT + 0, tofix ( line.t[0][0].x,iw),tofix ( line.t[0][0].y,iw) ); - color_to_fix1 ( a1, r1, g1, b1, dst[i] ); -#ifdef IPOL_C0 - vec4_to_fix( r2, g2, b2, line.c[0][0],iw ); - - a1 = FIX_POINT_ONE - a1; - dst[i] = fix_to_sample( imulFix (imulFix_simple( r0, a1 ) + r1, r2 ), - imulFix (imulFix_simple( g0, a1 ) + g1, g2 ), - imulFix (imulFix_simple( b0, a1 ) + b1, b2 ) - ); -#else - dst[i] = fix_to_sample(imulFix_simple( r0, a1) + r0, - imulFix_simple( g0, a1) + g0, - imulFix_simple( b0, a1) + b0 - ); - -#endif - - } - -#ifdef IPOL_W - line.w[0] += slopeW; -#endif -#ifdef IPOL_T0 - line.t[0][0] += slopeT[0]; -#endif -#ifdef IPOL_C0 - line.c[0][0] += slopeC[0]; -#endif - } - break; - - case 2: - for ( i = 0; i <= dx; i += SOFTWARE_DRIVER_2_STEP_X) - { -#ifdef CMP_W - if ( line.w[0] == z[i] ) -#endif - - { - -#ifdef WRITE_W - z[i] = line.w[0]; -#endif - -#ifdef INVERSE_W - iw = fix_inverse32 ( line.w[0] ); -#endif - getSample_texture ( r0, g0, b0, IT + 0, tofix ( line.t[0][0].x,iw),tofix ( line.t[0][0].y,iw) ); - color_to_fix1 ( a1, r1, g1, b1, dst[i] ); - -#ifdef IPOL_C0 - vec4_to_fix( r2, g2, b2, line.c[0][0],iw ); - - a1 = FIX_POINT_ONE - a1; - dst[i] = fix_to_sample( imulFix (imulFix_simple( r0, a1 ) + r1, r2 ), - imulFix (imulFix_simple( g0, a1 ) + g1, g2 ), - imulFix (imulFix_simple( b0, a1 ) + b1, b2 ) - ); -#else - dst[i] = fix_to_sample(imulFix_simple( r0, a1) + r0, - imulFix_simple( g0, a1) + g0, - imulFix_simple( b0, a1) + b0 - ); - -#endif - - } - -#ifdef IPOL_W - line.w[0] += slopeW; -#endif -#ifdef IPOL_T0 - line.t[0][0] += slopeT[0]; -#endif -#ifdef IPOL_C0 - line.c[0][0] += slopeC[0]; -#endif - }break; - - } // zcompare - -} - -/*! -*/ -void CTRTextureBlend::fragment_src_alpha_one () -{ - tVideoSample *dst; - -#ifdef USE_ZBUFFER - fp24 *z; -#endif - - s32 xStart; - s32 xEnd; - s32 dx; - - -#ifdef SUBTEXEL - f32 subPixel; -#endif - -#ifdef IPOL_Z - f32 slopeZ; -#endif -#ifdef IPOL_W - fp24 slopeW; -#endif -#ifdef IPOL_C0 - sVec4 slopeC[BURNING_MATERIAL_MAX_COLORS]; -#endif -#ifdef IPOL_T0 - sVec2 slopeT[BURNING_MATERIAL_MAX_TEXTURES]; -#endif - - // apply top-left fill-convention, left - xStart = fill_convention_left( line.x[0] ); - xEnd = fill_convention_right( line.x[1] ); - - dx = xEnd - xStart; - - if ( dx < 0 ) - return; - - // slopes - const f32 invDeltaX = fill_step_x( line.x[1] - line.x[0] ); - -#ifdef IPOL_Z - slopeZ = (line.z[1] - line.z[0]) * invDeltaX; -#endif -#ifdef IPOL_W - slopeW = (line.w[1] - line.w[0]) * invDeltaX; -#endif -#ifdef IPOL_C0 - slopeC[0] = (line.c[0][1] - line.c[0][0]) * invDeltaX; -#endif -#ifdef IPOL_T0 - slopeT[0] = (line.t[0][1] - line.t[0][0]) * invDeltaX; -#endif -#ifdef IPOL_T1 - slopeT[1] = (line.t[1][1] - line.t[1][0]) * invDeltaX; -#endif - -#ifdef SUBTEXEL - subPixel = ( (f32) xStart ) - line.x[0]; -#ifdef IPOL_Z - line.z[0] += slopeZ * subPixel; -#endif -#ifdef IPOL_W - line.w[0] += slopeW * subPixel; -#endif -#ifdef IPOL_C0 - line.c[0][0] += slopeC[0] * subPixel; -#endif -#ifdef IPOL_T0 - line.t[0][0] += slopeT[0] * subPixel; -#endif -#ifdef IPOL_T1 - line.t[1][0] += slopeT[1] * subPixel; -#endif -#endif - - SOFTWARE_DRIVER_2_CLIPCHECK; - dst = (tVideoSample*)RenderTarget->getData() + ( line.y * RenderTarget->getDimension().Width ) + xStart; - -#ifdef USE_ZBUFFER - z = (fp24*) DepthBuffer->lock() + ( line.y * RenderTarget->getDimension().Width ) + xStart; -#endif - - - f32 iw = FIX_POINT_F32_MUL; - - tFixPoint a0, r0, g0, b0; - tFixPoint r1, g1, b1; -#ifdef IPOL_C0 - tFixPoint r2, g2, b2; -#endif - s32 i; - - switch (depth_func) - { - default: - case ECFN_LESSEQUAL: - for ( i = 0; i <= dx; i += SOFTWARE_DRIVER_2_STEP_X) - { -#ifdef CMP_W - if ( line.w[0] >= z[i] ) -#endif - - { - - -#ifdef INVERSE_W - iw = fix_inverse32 ( line.w[0] ); -#endif - - getSample_texture ( a0, r0, g0, b0, IT + 0, tofix ( line.t[0][0].x,iw),tofix ( line.t[0][0].y,iw) ); - if ( a0 > 0 ) - { - fix_color_norm(a0); - - color_to_fix ( r1, g1, b1, dst[i] ); - -#ifdef IPOL_C0 - vec4_to_fix( r2, g2, b2, line.c[0][0],iw ); - - dst[i] = fix4_to_sample( a0, - clampfix_maxcolor (imulFix_simple(r0,a0) + r1), - clampfix_maxcolor (imulFix_simple(g0,a0) + g1), - clampfix_maxcolor (imulFix_simple(b0,a0) + b1) - ); - -/* - fix_color_norm(a0); - dst[i] = fix4_to_sample ( a0, - imulFix ( imulFix_simple ( r0, a0 ) + r1, r2 ), - imulFix ( imulFix_simple ( g0, a0 ) + g1, g2 ), - imulFix ( imulFix_simple ( b0, a0 ) + b1, b2 ) - ); -*/ -#else - dst[i] = fix4_to_sample( a0, - clampfix_maxcolor (imulFix_simple(r0,a0 ) + r1 ), - clampfix_maxcolor (imulFix_simple(g0,a0 ) + g1 ), - clampfix_maxcolor (imulFix_simple(b0,a0 ) + b1 ) - ); - -#endif - -#ifdef WRITE_W - //z[i] = line.w[0]; -#endif - } - - } - -#ifdef IPOL_W - line.w[0] += slopeW; -#endif -#ifdef IPOL_T0 - line.t[0][0] += slopeT[0]; -#endif -#ifdef IPOL_C0 - line.c[0][0] += slopeC[0]; -#endif - } - break; - - case 2: - for ( i = 0; i <= dx; i += SOFTWARE_DRIVER_2_STEP_X) - { -#ifdef CMP_W - if ( line.w[0] == z[i] ) -#endif - { - -#ifdef INVERSE_W - iw = fix_inverse32 ( line.w[0] ); -#endif - - getSample_texture ( a0, r0, g0, b0, IT + 0, tofix ( line.t[0][0].x,iw),tofix ( line.t[0][0].y,iw) ); - if ( a0 > 0 ) - { - fix_color_norm(a0); - - color_to_fix ( r1, g1, b1, dst[i] ); - -#ifdef IPOL_C0 - vec4_to_fix( r2, g2, b2, line.c[0][0],iw ); - - dst[i] = fix4_to_sample( a0, - clampfix_maxcolor ( imulFix (imulFix_simple(r0,a0 ) + r1, r2 ) ), - clampfix_maxcolor ( imulFix (imulFix_simple(g0,a0 ) + g1, g2 ) ), - clampfix_maxcolor ( imulFix (imulFix_simple(b0,a0 ) + b1, b2 ) ) - ); - -/* - fix_color_norm(a0); - dst[i] = fix4_to_sample ( a0, - imulFix ( imulFix_simple ( r0, a0 ) + r1, r2 ), - imulFix ( imulFix_simple ( g0, a0 ) + g1, g2 ), - imulFix ( imulFix_simple ( b0, a0 ) + b1, b2 ) - ); -*/ -#else - dst[i] = fix4_to_sample( a0, - clampfix_maxcolor (imulFix_simple(r0,a0 ) + r1 ), - clampfix_maxcolor (imulFix_simple(g0,a0 ) + g1 ), - clampfix_maxcolor (imulFix_simple(b0,a0 ) + b1 ) - ); - -#endif - -#ifdef WRITE_W - z[i] = line.w[0]; -#endif - } - } -#ifdef IPOL_W - line.w[0] += slopeW; -#endif -#ifdef IPOL_T0 - line.t[0][0] += slopeT[0]; -#endif -#ifdef IPOL_C0 - line.c[0][0] += slopeC[0]; -#endif - }break; - - } // zcompare - -} - - -/*! -*/ -void CTRTextureBlend::fragment_src_alpha_one_minus_src_alpha() -{ - tVideoSample *dst; - -#ifdef USE_ZBUFFER - fp24 *z; -#endif - - s32 xStart; - s32 xEnd; - s32 dx; - - -#ifdef SUBTEXEL - f32 subPixel; -#endif - -#ifdef IPOL_Z - f32 slopeZ; -#endif -#ifdef IPOL_W - fp24 slopeW; -#endif -#ifdef IPOL_C0 - sVec4 slopeC[BURNING_MATERIAL_MAX_COLORS]; -#endif -#ifdef IPOL_T0 - sVec2 slopeT[BURNING_MATERIAL_MAX_TEXTURES]; -#endif - - // apply top-left fill-convention, left - xStart = fill_convention_left(line.x[0]); - xEnd = fill_convention_right(line.x[1]); - - dx = xEnd - xStart; - if (dx < 0) - return; - - // slopes - const f32 invDeltaX = fill_step_x(line.x[1] - line.x[0]); - -#ifdef IPOL_Z - slopeZ = (line.z[1] - line.z[0]) * invDeltaX; -#endif -#ifdef IPOL_W - slopeW = (line.w[1] - line.w[0]) * invDeltaX; -#endif -#ifdef IPOL_C0 - slopeC[0] = (line.c[0][1] - line.c[0][0]) * invDeltaX; -#endif -#ifdef IPOL_T0 - slopeT[0] = (line.t[0][1] - line.t[0][0]) * invDeltaX; -#endif -#ifdef IPOL_T1 - slopeT[1] = (line.t[1][1] - line.t[1][0]) * invDeltaX; -#endif - -#ifdef SUBTEXEL - subPixel = ((f32)xStart) - line.x[0]; -#ifdef IPOL_Z - line.z[0] += slopeZ * subPixel; -#endif -#ifdef IPOL_W - line.w[0] += slopeW * subPixel; -#endif -#ifdef IPOL_C0 - line.c[0][0] += slopeC[0] * subPixel; -#endif -#ifdef IPOL_T0 - line.t[0][0] += slopeT[0] * subPixel; -#endif -#ifdef IPOL_T1 - line.t[1][0] += slopeT[1] * subPixel; -#endif -#endif - - SOFTWARE_DRIVER_2_CLIPCHECK; - dst = (tVideoSample*)RenderTarget->getData() + (line.y * RenderTarget->getDimension().Width) + xStart; - -#ifdef USE_ZBUFFER - z = (fp24*)DepthBuffer->lock() + (line.y * RenderTarget->getDimension().Width) + xStart; -#endif - - - f32 iw = FIX_POINT_F32_MUL; - - tFixPoint a0, r0, g0, b0; - tFixPoint r1, g1, b1; - tFixPoint a2, r2, g2, b2; - - s32 i; - - switch (depth_func) - { - default: - case ECFN_LESSEQUAL: - for (i = 0; i <= dx; i += SOFTWARE_DRIVER_2_STEP_X) - { -#ifdef CMP_W - if (line.w[0] >= z[i]) -#endif - - { -#ifdef WRITE_W - //z[i] = line.w[0]; -#endif - -#ifdef INVERSE_W - iw = fix_inverse32(line.w[0]); -#endif - - getSample_texture(a0, r0, g0, b0, &IT[0], tofix(line.t[0][0].x, iw), tofix(line.t[0][0].y, iw)); - if (a0 > AlphaRef) - { -#ifdef IPOL_C0 - vec4_to_fix(a2, r2, g2, b2, line.c[0][0], iw); - //a0 = imulFix(a0, a2); why is vertex color enabled and not vertex_alpha? - r0 = imulFix_simple(r0, r2); - g0 = imulFix_simple(g0, g2); - b0 = imulFix_simple(b0, b2); -#endif - - color_to_fix(r1, g1, b1, dst[i]); - - fix_color_norm(a0); - - r2 = r1 + imulFix(a0, r0 - r1); - g2 = g1 + imulFix(a0, g0 - g1); - b2 = b1 + imulFix(a0, b0 - b1); - dst[i] = fix4_to_sample(a0, r2, g2, b2); - } - - } - -#ifdef IPOL_W - line.w[0] += slopeW; -#endif -#ifdef IPOL_T0 - line.t[0][0] += slopeT[0]; -#endif -#ifdef IPOL_C0 - line.c[0][0] += slopeC[0]; -#endif - } - break; - - } // zcompare - -} - - -/*! -*/ -void CTRTextureBlend::fragment_dst_color_one_minus_dst_alpha () -{ - tVideoSample *dst; - -#ifdef USE_ZBUFFER - fp24 *z; -#endif - - s32 xStart; - s32 xEnd; - s32 dx; - - -#ifdef SUBTEXEL - f32 subPixel; -#endif - -#ifdef IPOL_Z - f32 slopeZ; -#endif -#ifdef IPOL_W - fp24 slopeW; -#endif -#ifdef IPOL_C0 - sVec4 slopeC[BURNING_MATERIAL_MAX_COLORS]; -#endif -#ifdef IPOL_T0 - sVec2 slopeT[BURNING_MATERIAL_MAX_TEXTURES]; -#endif - - // apply top-left fill-convention, left - xStart = fill_convention_left( line.x[0] ); - xEnd = fill_convention_right( line.x[1] ); - - dx = xEnd - xStart; - - if ( dx < 0 ) - return; - - // slopes - const f32 invDeltaX = fill_step_x( line.x[1] - line.x[0] ); - -#ifdef IPOL_Z - slopeZ = (line.z[1] - line.z[0]) * invDeltaX; -#endif -#ifdef IPOL_W - slopeW = (line.w[1] - line.w[0]) * invDeltaX; -#endif -#ifdef IPOL_C0 - slopeC[0] = (line.c[0][1] - line.c[0][0]) * invDeltaX; -#endif -#ifdef IPOL_T0 - slopeT[0] = (line.t[0][1] - line.t[0][0]) * invDeltaX; -#endif -#ifdef IPOL_T1 - slopeT[1] = (line.t[1][1] - line.t[1][0]) * invDeltaX; -#endif - -#ifdef SUBTEXEL - subPixel = ( (f32) xStart ) - line.x[0]; -#ifdef IPOL_Z - line.z[0] += slopeZ * subPixel; -#endif -#ifdef IPOL_W - line.w[0] += slopeW * subPixel; -#endif -#ifdef IPOL_C0 - line.c[0][0] += slopeC[0] * subPixel; -#endif -#ifdef IPOL_T0 - line.t[0][0] += slopeT[0] * subPixel; -#endif -#ifdef IPOL_T1 - line.t[1][0] += slopeT[1] * subPixel; -#endif -#endif - - SOFTWARE_DRIVER_2_CLIPCHECK; - dst = (tVideoSample*)RenderTarget->getData() + ( line.y * RenderTarget->getDimension().Width ) + xStart; - -#ifdef USE_ZBUFFER - z = (fp24*) DepthBuffer->lock() + ( line.y * RenderTarget->getDimension().Width ) + xStart; -#endif - - - f32 iw = FIX_POINT_F32_MUL; - - tFixPoint r0, g0, b0; - tFixPoint a1, r1, g1, b1; -#ifdef IPOL_C0 - tFixPoint r2, g2, b2; -#endif - s32 i; - - switch (depth_func) - { - default: - case ECFN_LESSEQUAL: - for ( i = 0; i <= dx; i += SOFTWARE_DRIVER_2_STEP_X) - { -#ifdef CMP_W - if ( line.w[0] >= z[i] ) -#endif - - { - -#ifdef WRITE_W - z[i] = line.w[0]; -#endif - -#ifdef INVERSE_W - iw = fix_inverse32 ( line.w[0] ); -#endif - - getSample_texture ( r0, g0, b0, IT + 0, tofix ( line.t[0][0].x,iw),tofix ( line.t[0][0].y,iw) ); - color_to_fix1 ( a1, r1, g1, b1, dst[i] ); -#ifdef IPOL_C0 - vec4_to_fix( r2, g2, b2, line.c[0][0],iw ); - - a1 = FIX_POINT_ONE - a1; - dst[i] = fix_to_sample( imulFix ( imulFix ( r1, r0 + a1 ), r2 ), - imulFix ( imulFix ( g1, g0 + a1 ), g2 ), - imulFix ( imulFix ( b1, b0 + a1 ), b2 ) - ); -#else - dst[i] = fix_to_sample( imulFix ( r1, r0 + a1 ), - imulFix ( g1, g0 + a1 ), - imulFix ( b1, b0 + a1 ) - ); - -#endif - - } - -#ifdef IPOL_W - line.w[0] += slopeW; -#endif -#ifdef IPOL_T0 - line.t[0][0] += slopeT[0]; -#endif -#ifdef IPOL_C0 - line.c[0][0] += slopeC[0]; -#endif - } - break; - - case 2: - for ( i = 0; i <= dx; i += SOFTWARE_DRIVER_2_STEP_X) - { -#ifdef CMP_W - if ( line.w[0] == z[i] ) -#endif - - { - -#ifdef WRITE_W - z[i] = line.w[0]; -#endif - -#ifdef INVERSE_W - iw = fix_inverse32 ( line.w[0] ); -#endif - getSample_texture ( r0, g0, b0, IT + 0, tofix ( line.t[0][0].x,iw),tofix ( line.t[0][0].y,iw) ); - color_to_fix1 ( a1, r1, g1, b1, dst[i] ); - -#ifdef IPOL_C0 - vec4_to_fix( r2, g2, b2, line.c[0][0],iw ); - - a1 = FIX_POINT_ONE - a1; - dst[i] = fix_to_sample( imulFix ( imulFix ( r1, r0 + a1 ), r2 ), - imulFix ( imulFix ( g1, g0 + a1 ), g2 ), - imulFix ( imulFix ( b1, b0 + a1 ), b2 ) - ); -#else - dst[i] = fix_to_sample( imulFix ( r1, r0 + a1 ), - imulFix ( g1, g0 + a1 ), - imulFix ( b1, b0 + a1 ) - ); - -#endif - - } - -#ifdef IPOL_W - line.w[0] += slopeW; -#endif -#ifdef IPOL_T0 - line.t[0][0] += slopeT[0]; -#endif -#ifdef IPOL_C0 - line.c[0][0] += slopeC[0]; -#endif - }break; - } // zcompare - -} - -/*! -*/ -void CTRTextureBlend::fragment_dst_color_zero () -{ - tVideoSample *dst; - -#ifdef USE_ZBUFFER - fp24 *z; -#endif - - s32 xStart; - s32 xEnd; - s32 dx; - - -#ifdef SUBTEXEL - f32 subPixel; -#endif - -#ifdef IPOL_Z - f32 slopeZ; -#endif -#ifdef IPOL_W - fp24 slopeW; -#endif -#ifdef IPOL_C0 - sVec4 slopeC[BURNING_MATERIAL_MAX_COLORS]; -#endif -#ifdef IPOL_T0 - sVec2 slopeT[BURNING_MATERIAL_MAX_TEXTURES]; -#endif - - // apply top-left fill-convention, left - xStart = fill_convention_left( line.x[0] ); - xEnd = fill_convention_right( line.x[1] ); - - dx = xEnd - xStart; - - if ( dx < 0 ) - return; - - // slopes - const f32 invDeltaX = fill_step_x( line.x[1] - line.x[0] ); - -#ifdef IPOL_Z - slopeZ = (line.z[1] - line.z[0]) * invDeltaX; -#endif -#ifdef IPOL_W - slopeW = (line.w[1] - line.w[0]) * invDeltaX; -#endif -#ifdef IPOL_C0 - slopeC[0] = (line.c[0][1] - line.c[0][0]) * invDeltaX; -#endif -#ifdef IPOL_T0 - slopeT[0] = (line.t[0][1] - line.t[0][0]) * invDeltaX; -#endif -#ifdef IPOL_T1 - slopeT[1] = (line.t[1][1] - line.t[1][0]) * invDeltaX; -#endif - -#ifdef SUBTEXEL - subPixel = ( (f32) xStart ) - line.x[0]; -#ifdef IPOL_Z - line.z[0] += slopeZ * subPixel; -#endif -#ifdef IPOL_W - line.w[0] += slopeW * subPixel; -#endif -#ifdef IPOL_C0 - line.c[0][0] += slopeC[0] * subPixel; -#endif -#ifdef IPOL_T0 - line.t[0][0] += slopeT[0] * subPixel; -#endif -#ifdef IPOL_T1 - line.t[1][0] += slopeT[1] * subPixel; -#endif -#endif - - SOFTWARE_DRIVER_2_CLIPCHECK; - dst = (tVideoSample*)RenderTarget->getData() + ( line.y * RenderTarget->getDimension().Width ) + xStart; - -#ifdef USE_ZBUFFER - z = (fp24*) DepthBuffer->lock() + ( line.y * RenderTarget->getDimension().Width ) + xStart; -#endif - - - f32 iw = FIX_POINT_F32_MUL; - - tFixPoint r0, g0, b0; - tFixPoint r1, g1, b1; -#ifdef IPOL_C0 - tFixPoint r2, g2, b2; -#endif - s32 i; - - switch (depth_func) - { - default: - case ECFN_LESSEQUAL: - for ( i = 0; i <= dx; i += SOFTWARE_DRIVER_2_STEP_X) - { -#ifdef CMP_W - if ( line.w[0] >= z[i] ) -#endif - - { - -#ifdef WRITE_W - z[i] = line.w[0]; -#endif - -#ifdef INVERSE_W - iw = fix_inverse32 ( line.w[0] ); -#endif - - getSample_texture ( r0, g0, b0, IT + 0, tofix ( line.t[0][0].x,iw),tofix ( line.t[0][0].y,iw) ); - color_to_fix1 ( r1, g1, b1, dst[i] ); - -#ifdef IPOL_C0 - vec4_to_fix( r2, g2, b2, line.c[0][0],iw ); - - dst[i] = fix_to_sample( imulFix (imulFix_simple( r0, r1 ), r2 ), - imulFix (imulFix_simple( g0, g1 ), g2 ), - imulFix (imulFix_simple( b0, b1 ), b2 ) ); -#else - dst[i] = fix_to_sample(imulFix_simple( r0, r1 ), - imulFix_simple( g0, g1 ), - imulFix_simple( b0, b1 ) - ); - -#endif - - } - -#ifdef IPOL_W - line.w[0] += slopeW; -#endif -#ifdef IPOL_T0 - line.t[0][0] += slopeT[0]; -#endif -#ifdef IPOL_C0 - line.c[0][0] += slopeC[0]; -#endif - } - break; - - case 2: - for ( i = 0; i <= dx; i += SOFTWARE_DRIVER_2_STEP_X) - { -#ifdef CMP_W - if ( line.w[0] == z[i] ) -#endif - - { - -#ifdef WRITE_W - z[i] = line.w[0]; -#endif - -#ifdef INVERSE_W - iw = fix_inverse32 ( line.w[0] ); -#endif - getSample_texture ( r0, g0, b0, IT + 0, tofix ( line.t[0][0].x,iw),tofix ( line.t[0][0].y,iw) ); - color_to_fix1 ( r1, g1, b1, dst[i] ); - -#ifdef IPOL_C0 - vec4_to_fix( r2, g2, b2, line.c[0][0],iw ); - - dst[i] = fix_to_sample( imulFix (imulFix_simple( r0, r1 ), r2 ), - imulFix (imulFix_simple( g0, g1 ), g2 ), - imulFix (imulFix_simple( b0, b1 ), b2 ) - ); -#else - dst[i] = fix_to_sample(imulFix_simple( r0, r1 ), - imulFix_simple( g0, g1 ), - imulFix_simple( b0, b1 ) - ); - -#endif - - } - -#ifdef IPOL_W - line.w[0] += slopeW; -#endif -#ifdef IPOL_T0 - line.t[0][0] += slopeT[0]; -#endif -#ifdef IPOL_C0 - line.c[0][0] += slopeC[0]; -#endif - }break; - } // zcompare - -} - -/*! -*/ -void CTRTextureBlend::fragment_dst_color_one () -{ - tVideoSample *dst; - -#ifdef USE_ZBUFFER - fp24 *z; -#endif - - s32 xStart; - s32 xEnd; - s32 dx; - - -#ifdef SUBTEXEL - f32 subPixel; -#endif - -#ifdef IPOL_Z - f32 slopeZ; -#endif -#ifdef IPOL_W - fp24 slopeW; -#endif -#ifdef IPOL_C0 - sVec4 slopeC[BURNING_MATERIAL_MAX_COLORS]; -#endif -#ifdef IPOL_T0 - sVec2 slopeT[BURNING_MATERIAL_MAX_TEXTURES]; -#endif - - // apply top-left fill-convention, left - xStart = fill_convention_left( line.x[0] ); - xEnd = fill_convention_right( line.x[1] ); - - dx = xEnd - xStart; - - if ( dx < 0 ) - return; - - // slopes - const f32 invDeltaX = fill_step_x( line.x[1] - line.x[0] ); - -#ifdef IPOL_Z - slopeZ = (line.z[1] - line.z[0]) * invDeltaX; -#endif -#ifdef IPOL_W - slopeW = (line.w[1] - line.w[0]) * invDeltaX; -#endif -#ifdef IPOL_C0 - slopeC[0] = (line.c[0][1] - line.c[0][0]) * invDeltaX; -#endif -#ifdef IPOL_T0 - slopeT[0] = (line.t[0][1] - line.t[0][0]) * invDeltaX; -#endif -#ifdef IPOL_T1 - slopeT[1] = (line.t[1][1] - line.t[1][0]) * invDeltaX; -#endif - -#ifdef SUBTEXEL - subPixel = ( (f32) xStart ) - line.x[0]; -#ifdef IPOL_Z - line.z[0] += slopeZ * subPixel; -#endif -#ifdef IPOL_W - line.w[0] += slopeW * subPixel; -#endif -#ifdef IPOL_C0 - line.c[0][0] += slopeC[0] * subPixel; -#endif -#ifdef IPOL_T0 - line.t[0][0] += slopeT[0] * subPixel; -#endif -#ifdef IPOL_T1 - line.t[1][0] += slopeT[1] * subPixel; -#endif -#endif - - SOFTWARE_DRIVER_2_CLIPCHECK; - dst = (tVideoSample*)RenderTarget->getData() + ( line.y * RenderTarget->getDimension().Width ) + xStart; - -#ifdef USE_ZBUFFER - z = (fp24*) DepthBuffer->lock() + ( line.y * RenderTarget->getDimension().Width ) + xStart; -#endif - - - f32 iw = FIX_POINT_F32_MUL; - - tFixPoint r0, g0, b0; - tFixPoint r1, g1, b1; -#ifdef IPOL_C0 - tFixPoint r2, g2, b2; -#endif - s32 i; - - switch (depth_func) - { - default: - case ECFN_LESSEQUAL: - for ( i = 0; i <= dx; i += SOFTWARE_DRIVER_2_STEP_X) - { -#ifdef CMP_W - if ( line.w[0] >= z[i] ) -#endif - - { - -#ifdef WRITE_W - z[i] = line.w[0]; -#endif - -#ifdef INVERSE_W - iw = fix_inverse32 ( line.w[0] ); -#endif - - getSample_texture ( r0, g0, b0, IT + 0, tofix ( line.t[0][0].x,iw),tofix ( line.t[0][0].y,iw) ); - color_to_fix ( r1, g1, b1, dst[i] ); -#ifdef IPOL_C0 - vec4_to_fix( r2, g2, b2, line.c[0][0],iw ); - - dst[i] = fix_to_sample( clampfix_maxcolor ( imulFix_tex1 ( r0, r1 ) + r1 ), - clampfix_maxcolor ( imulFix_tex1 ( g0, g1 ) + g1 ), - clampfix_maxcolor ( imulFix_tex1 ( b0, b1 ) + b1 ) - ); - -#else - dst[i] = fix_to_sample( clampfix_maxcolor ( imulFix_tex1 ( r0, r1 ) + r1 ), - clampfix_maxcolor ( imulFix_tex1 ( g0, g1 ) + g1 ), - clampfix_maxcolor ( imulFix_tex1 ( b0, b1 ) + b1 ) - ); - -#endif - - } - -#ifdef IPOL_W - line.w[0] += slopeW; -#endif -#ifdef IPOL_T0 - line.t[0][0] += slopeT[0]; -#endif -#ifdef IPOL_C0 - line.c[0][0] += slopeC[0]; -#endif - } - break; - - case 2: - for ( i = 0; i <= dx; i += SOFTWARE_DRIVER_2_STEP_X) - { -#ifdef CMP_W - if ( line.w[0] == z[i] ) -#endif - - { - -#ifdef WRITE_W - z[i] = line.w[0]; -#endif - -#ifdef INVERSE_W - iw = fix_inverse32 ( line.w[0] ); -#endif - getSample_texture ( r0, g0, b0, IT + 0, tofix ( line.t[0][0].x,iw),tofix ( line.t[0][0].y,iw) ); - color_to_fix ( r1, g1, b1, dst[i] ); - -#ifdef IPOL_C0 - vec4_to_fix( r2, g2, b2, line.c[0][0],iw ); - - dst[i] = fix_to_sample( clampfix_maxcolor ( imulFix_tex1 ( r0, r1 ) + r1 ), - clampfix_maxcolor ( imulFix_tex1 ( g0, g1 ) + g1 ), - clampfix_maxcolor ( imulFix_tex1 ( b0, b1 ) + b1 ) - ); - -#else - dst[i] = fix_to_sample( clampfix_maxcolor ( imulFix_tex1 ( r0, r1 ) + r1 ), - clampfix_maxcolor ( imulFix_tex1 ( g0, g1 ) + g1 ), - clampfix_maxcolor ( imulFix_tex1 ( b0, b1 ) + b1 ) - ); - -#endif - - - } - -#ifdef IPOL_W - line.w[0] += slopeW; -#endif -#ifdef IPOL_T0 - line.t[0][0] += slopeT[0]; -#endif -#ifdef IPOL_C0 - line.c[0][0] += slopeC[0]; -#endif - }break; - } // zcompare - -} - -/*! -*/ -void CTRTextureBlend::fragment_zero_one_minus_scr_color () -{ - tVideoSample *dst; - -#ifdef USE_ZBUFFER - fp24 *z; -#endif - - s32 xStart; - s32 xEnd; - s32 dx; - - -#ifdef SUBTEXEL - f32 subPixel; -#endif - -#ifdef IPOL_Z - f32 slopeZ; -#endif -#ifdef IPOL_W - fp24 slopeW; -#endif -#ifdef IPOL_C0 - sVec4 slopeC[BURNING_MATERIAL_MAX_COLORS]; -#endif -#ifdef IPOL_T0 - sVec2 slopeT[BURNING_MATERIAL_MAX_TEXTURES]; -#endif - - // apply top-left fill-convention, left - xStart = fill_convention_left( line.x[0] ); - xEnd = fill_convention_right( line.x[1] ); - - dx = xEnd - xStart; - - if ( dx < 0 ) - return; - - // slopes - const f32 invDeltaX = fill_step_x( line.x[1] - line.x[0] ); - -#ifdef IPOL_Z - slopeZ = (line.z[1] - line.z[0]) * invDeltaX; -#endif -#ifdef IPOL_W - slopeW = (line.w[1] - line.w[0]) * invDeltaX; -#endif -#ifdef IPOL_C0 - slopeC[0] = (line.c[0][1] - line.c[0][0]) * invDeltaX; -#endif -#ifdef IPOL_T0 - slopeT[0] = (line.t[0][1] - line.t[0][0]) * invDeltaX; -#endif -#ifdef IPOL_T1 - slopeT[1] = (line.t[1][1] - line.t[1][0]) * invDeltaX; -#endif - -#ifdef SUBTEXEL - subPixel = ( (f32) xStart ) - line.x[0]; -#ifdef IPOL_Z - line.z[0] += slopeZ * subPixel; -#endif -#ifdef IPOL_W - line.w[0] += slopeW * subPixel; -#endif -#ifdef IPOL_C0 - line.c[0][0] += slopeC[0] * subPixel; -#endif -#ifdef IPOL_T0 - line.t[0][0] += slopeT[0] * subPixel; -#endif -#ifdef IPOL_T1 - line.t[1][0] += slopeT[1] * subPixel; -#endif -#endif - - SOFTWARE_DRIVER_2_CLIPCHECK; - dst = (tVideoSample*)RenderTarget->getData() + ( line.y * RenderTarget->getDimension().Width ) + xStart; - -#ifdef USE_ZBUFFER - z = (fp24*) DepthBuffer->lock() + ( line.y * RenderTarget->getDimension().Width ) + xStart; -#endif - - - f32 iw = FIX_POINT_F32_MUL; - - tFixPoint r0, g0, b0; - tFixPoint r1, g1, b1; -#ifdef IPOL_C0 - tFixPoint r2, g2, b2; -#endif - s32 i; - - switch (depth_func) - { - default: - case ECFN_LESSEQUAL: - for ( i = 0; i <= dx; i += SOFTWARE_DRIVER_2_STEP_X) - { -#ifdef CMP_W - if ( line.w[0] >= z[i] ) -#endif - - { - -#ifdef WRITE_W - z[i] = line.w[0]; -#endif - -#ifdef INVERSE_W - iw = fix_inverse32 ( line.w[0] ); -#endif - - getSample_texture ( r0, g0, b0, IT + 0, tofix ( line.t[0][0].x,iw),tofix ( line.t[0][0].y,iw) ); - color_to_fix1 ( r1, g1, b1, dst[i] ); -#ifdef IPOL_C0 - vec4_to_fix( r2, g2, b2, line.c[0][0],iw ); - - dst[i] = fix_to_sample(imulFix( FIX_POINT_ONE - r0, r1 ), - imulFix( FIX_POINT_ONE - g0, g1 ), - imulFix( FIX_POINT_ONE - b0, b1 ) - ); - -#else - dst[i] = fix_to_sample(imulFix( FIX_POINT_ONE - r0, r1 ), - imulFix( FIX_POINT_ONE - g0, g1 ), - imulFix( FIX_POINT_ONE - b0, b1 ) - ); - -#endif - - } - -#ifdef IPOL_W - line.w[0] += slopeW; -#endif -#ifdef IPOL_T0 - line.t[0][0] += slopeT[0]; -#endif -#ifdef IPOL_C0 - line.c[0][0] += slopeC[0]; -#endif - } - break; - - case 2: - for ( i = 0; i <= dx; i += SOFTWARE_DRIVER_2_STEP_X) - { -#ifdef CMP_W - if ( line.w[0] == z[i] ) -#endif - - { - -#ifdef WRITE_W - z[i] = line.w[0]; -#endif - -#ifdef INVERSE_W - iw = fix_inverse32 ( line.w[0] ); -#endif - getSample_texture ( r0, g0, b0, IT + 0, tofix ( line.t[0][0].x,iw),tofix ( line.t[0][0].y,iw) ); - color_to_fix1 ( r1, g1, b1, dst[i] ); -#ifdef IPOL_C0 - vec4_to_fix( r2, g2, b2, line.c[0][0],iw ); - - dst[i] = fix_to_sample(imulFix( FIX_POINT_ONE - r0, r1 ), - imulFix( FIX_POINT_ONE - g0, g1 ), - imulFix( FIX_POINT_ONE - b0, b1 ) - ); - -#else - dst[i] = fix_to_sample(imulFix( FIX_POINT_ONE - r0, r1 ), - imulFix( FIX_POINT_ONE - g0, g1 ), - imulFix( FIX_POINT_ONE - b0, b1 ) - ); - -#endif - - } - -#ifdef IPOL_W - line.w[0] += slopeW; -#endif -#ifdef IPOL_T0 - line.t[0][0] += slopeT[0]; -#endif -#ifdef IPOL_C0 - line.c[0][0] += slopeC[0]; -#endif - }break; - } // zcompare - -} - - - -void CTRTextureBlend::drawTriangle(const s4DVertex* burning_restrict a, const s4DVertex* burning_restrict b, const s4DVertex* burning_restrict c) -{ - if ( 0 == fragmentShader ) - return; - - // sort on height, y - if ( F32_A_GREATER_B ( a->Pos.y , b->Pos.y ) ) swapVertexPointer(&a, &b); - if ( F32_A_GREATER_B ( b->Pos.y , c->Pos.y ) ) swapVertexPointer(&b, &c); - if ( F32_A_GREATER_B ( a->Pos.y , b->Pos.y ) ) swapVertexPointer(&a, &b); - - const f32 ca = c->Pos.y - a->Pos.y; - const f32 ba = b->Pos.y - a->Pos.y; - const f32 cb = c->Pos.y - b->Pos.y; - // calculate delta y of the edges - scan.invDeltaY[0] = fill_step_y( ca ); - scan.invDeltaY[1] = fill_step_y( ba ); - scan.invDeltaY[2] = fill_step_y( cb ); - - if ( F32_LOWER_EQUAL_0 ( scan.invDeltaY[0] ) ) - return; - - // find if the major edge is left or right aligned - f32 temp[4]; - - temp[0] = a->Pos.x - c->Pos.x; - temp[1] = -ca; - temp[2] = b->Pos.x - a->Pos.x; - temp[3] = ba; - - scan.left = ( temp[0] * temp[3] - temp[1] * temp[2] ) > 0.f ? 0 : 1; - scan.right = 1 - scan.left; - - // calculate slopes for the major edge - scan.slopeX[0] = (c->Pos.x - a->Pos.x) * scan.invDeltaY[0]; - scan.x[0] = a->Pos.x; - -#ifdef IPOL_Z - scan.slopeZ[0] = (c->Pos.z - a->Pos.z) * scan.invDeltaY[0]; - scan.z[0] = a->Pos.z; -#endif - -#ifdef IPOL_W - scan.slopeW[0] = (c->Pos.w - a->Pos.w) * scan.invDeltaY[0]; - scan.w[0] = a->Pos.w; -#endif - -#ifdef IPOL_C0 - scan.slopeC[0][0] = (c->Color[0] - a->Color[0]) * scan.invDeltaY[0]; - scan.c[0][0] = a->Color[0]; -#endif - -#ifdef IPOL_T0 - scan.slopeT[0][0] = (c->Tex[0] - a->Tex[0]) * scan.invDeltaY[0]; - scan.t[0][0] = a->Tex[0]; -#endif - -#ifdef IPOL_T1 - scan.slopeT[1][0] = (c->Tex[1] - a->Tex[1]) * scan.invDeltaY[0]; - scan.t[1][0] = a->Tex[1]; -#endif - - // top left fill convention y run - s32 yStart; - s32 yEnd; - -#ifdef SUBTEXEL - f32 subPixel; -#endif - - // rasterize upper sub-triangle - if ( (f32) 0.0 != scan.invDeltaY[1] ) - { - // calculate slopes for top edge - scan.slopeX[1] = (b->Pos.x - a->Pos.x) * scan.invDeltaY[1]; - scan.x[1] = a->Pos.x; - -#ifdef IPOL_Z - scan.slopeZ[1] = (b->Pos.z - a->Pos.z) * scan.invDeltaY[1]; - scan.z[1] = a->Pos.z; -#endif - -#ifdef IPOL_W - scan.slopeW[1] = (b->Pos.w - a->Pos.w) * scan.invDeltaY[1]; - scan.w[1] = a->Pos.w; -#endif - -#ifdef IPOL_C0 - scan.slopeC[0][1] = (b->Color[0] - a->Color[0]) * scan.invDeltaY[1]; - scan.c[0][1] = a->Color[0]; -#endif - -#ifdef IPOL_T0 - scan.slopeT[0][1] = (b->Tex[0] - a->Tex[0]) * scan.invDeltaY[1]; - scan.t[0][1] = a->Tex[0]; -#endif - -#ifdef IPOL_T1 - scan.slopeT[1][1] = (b->Tex[1] - a->Tex[1]) * scan.invDeltaY[1]; - scan.t[1][1] = a->Tex[1]; -#endif - - // apply top-left fill convention, top part - yStart = fill_convention_left( a->Pos.y ); - yEnd = fill_convention_right( b->Pos.y ); - -#ifdef SUBTEXEL - subPixel = ( (f32) yStart ) - a->Pos.y; - - // correct to pixel center - scan.x[0] += scan.slopeX[0] * subPixel; - scan.x[1] += scan.slopeX[1] * subPixel; - -#ifdef IPOL_Z - scan.z[0] += scan.slopeZ[0] * subPixel; - scan.z[1] += scan.slopeZ[1] * subPixel; -#endif - -#ifdef IPOL_W - scan.w[0] += scan.slopeW[0] * subPixel; - scan.w[1] += scan.slopeW[1] * subPixel; -#endif - -#ifdef IPOL_C0 - scan.c[0][0] += scan.slopeC[0][0] * subPixel; - scan.c[0][1] += scan.slopeC[0][1] * subPixel; -#endif - -#ifdef IPOL_T0 - scan.t[0][0] += scan.slopeT[0][0] * subPixel; - scan.t[0][1] += scan.slopeT[0][1] * subPixel; -#endif - -#ifdef IPOL_T1 - scan.t[1][0] += scan.slopeT[1][0] * subPixel; - scan.t[1][1] += scan.slopeT[1][1] * subPixel; -#endif - -#endif - - // rasterize the edge scanlines - for( line.y = yStart; line.y <= yEnd; line.y += SOFTWARE_DRIVER_2_STEP_Y) - { - line.x[scan.left] = scan.x[0]; - line.x[scan.right] = scan.x[1]; - -#ifdef IPOL_Z - line.z[scan.left] = scan.z[0]; - line.z[scan.right] = scan.z[1]; -#endif - -#ifdef IPOL_W - line.w[scan.left] = scan.w[0]; - line.w[scan.right] = scan.w[1]; -#endif - -#ifdef IPOL_C0 - line.c[0][scan.left] = scan.c[0][0]; - line.c[0][scan.right] = scan.c[0][1]; -#endif - -#ifdef IPOL_T0 - line.t[0][scan.left] = scan.t[0][0]; - line.t[0][scan.right] = scan.t[0][1]; -#endif - -#ifdef IPOL_T1 - line.t[1][scan.left] = scan.t[1][0]; - line.t[1][scan.right] = scan.t[1][1]; -#endif - - // render a scanline - interlace_scanline (this->*fragmentShader) (); - - scan.x[0] += scan.slopeX[0]; - scan.x[1] += scan.slopeX[1]; - -#ifdef IPOL_Z - scan.z[0] += scan.slopeZ[0]; - scan.z[1] += scan.slopeZ[1]; -#endif - -#ifdef IPOL_W - scan.w[0] += scan.slopeW[0]; - scan.w[1] += scan.slopeW[1]; -#endif - -#ifdef IPOL_C0 - scan.c[0][0] += scan.slopeC[0][0]; - scan.c[0][1] += scan.slopeC[0][1]; -#endif - -#ifdef IPOL_T0 - scan.t[0][0] += scan.slopeT[0][0]; - scan.t[0][1] += scan.slopeT[0][1]; -#endif - -#ifdef IPOL_T1 - scan.t[1][0] += scan.slopeT[1][0]; - scan.t[1][1] += scan.slopeT[1][1]; -#endif - - } - } - - // rasterize lower sub-triangle - if ( (f32) 0.0 != scan.invDeltaY[2] ) - { - // advance to middle point - if( (f32) 0.0 != scan.invDeltaY[1] ) - { - temp[0] = b->Pos.y - a->Pos.y; // dy - - scan.x[0] = a->Pos.x + scan.slopeX[0] * temp[0]; -#ifdef IPOL_Z - scan.z[0] = a->Pos.z + scan.slopeZ[0] * temp[0]; -#endif -#ifdef IPOL_W - scan.w[0] = a->Pos.w + scan.slopeW[0] * temp[0]; -#endif -#ifdef IPOL_C0 - scan.c[0][0] = a->Color[0] + scan.slopeC[0][0] * temp[0]; -#endif -#ifdef IPOL_T0 - scan.t[0][0] = a->Tex[0] + scan.slopeT[0][0] * temp[0]; -#endif -#ifdef IPOL_T1 - scan.t[1][0] = a->Tex[1] + scan.slopeT[1][0] * temp[0]; -#endif - - } - - // calculate slopes for bottom edge - scan.slopeX[1] = (c->Pos.x - b->Pos.x) * scan.invDeltaY[2]; - scan.x[1] = b->Pos.x; - -#ifdef IPOL_Z - scan.slopeZ[1] = (c->Pos.z - b->Pos.z) * scan.invDeltaY[2]; - scan.z[1] = b->Pos.z; -#endif - -#ifdef IPOL_W - scan.slopeW[1] = (c->Pos.w - b->Pos.w) * scan.invDeltaY[2]; - scan.w[1] = b->Pos.w; -#endif - -#ifdef IPOL_C0 - scan.slopeC[0][1] = (c->Color[0] - b->Color[0]) * scan.invDeltaY[2]; - scan.c[0][1] = b->Color[0]; -#endif - -#ifdef IPOL_T0 - scan.slopeT[0][1] = (c->Tex[0] - b->Tex[0]) * scan.invDeltaY[2]; - scan.t[0][1] = b->Tex[0]; -#endif - -#ifdef IPOL_T1 - scan.slopeT[1][1] = (c->Tex[1] - b->Tex[1]) * scan.invDeltaY[2]; - scan.t[1][1] = b->Tex[1]; -#endif - - // apply top-left fill convention, top part - yStart = fill_convention_left( b->Pos.y ); - yEnd = fill_convention_right( c->Pos.y ); - -#ifdef SUBTEXEL - subPixel = ( (f32) yStart ) - b->Pos.y; - - // correct to pixel center - scan.x[0] += scan.slopeX[0] * subPixel; - scan.x[1] += scan.slopeX[1] * subPixel; - -#ifdef IPOL_Z - scan.z[0] += scan.slopeZ[0] * subPixel; - scan.z[1] += scan.slopeZ[1] * subPixel; -#endif - -#ifdef IPOL_W - scan.w[0] += scan.slopeW[0] * subPixel; - scan.w[1] += scan.slopeW[1] * subPixel; -#endif - -#ifdef IPOL_C0 - scan.c[0][0] += scan.slopeC[0][0] * subPixel; - scan.c[0][1] += scan.slopeC[0][1] * subPixel; -#endif - -#ifdef IPOL_T0 - scan.t[0][0] += scan.slopeT[0][0] * subPixel; - scan.t[0][1] += scan.slopeT[0][1] * subPixel; -#endif - -#ifdef IPOL_T1 - scan.t[1][0] += scan.slopeT[1][0] * subPixel; - scan.t[1][1] += scan.slopeT[1][1] * subPixel; -#endif - -#endif - - // rasterize the edge scanlines - for( line.y = yStart; line.y <= yEnd; line.y += SOFTWARE_DRIVER_2_STEP_Y) - { - line.x[scan.left] = scan.x[0]; - line.x[scan.right] = scan.x[1]; - -#ifdef IPOL_Z - line.z[scan.left] = scan.z[0]; - line.z[scan.right] = scan.z[1]; -#endif - -#ifdef IPOL_W - line.w[scan.left] = scan.w[0]; - line.w[scan.right] = scan.w[1]; -#endif - -#ifdef IPOL_C0 - line.c[0][scan.left] = scan.c[0][0]; - line.c[0][scan.right] = scan.c[0][1]; -#endif - -#ifdef IPOL_T0 - line.t[0][scan.left] = scan.t[0][0]; - line.t[0][scan.right] = scan.t[0][1]; -#endif - -#ifdef IPOL_T1 - line.t[1][scan.left] = scan.t[1][0]; - line.t[1][scan.right] = scan.t[1][1]; -#endif - - // render a scanline - interlace_scanline (this->*fragmentShader) (); - - scan.x[0] += scan.slopeX[0]; - scan.x[1] += scan.slopeX[1]; - -#ifdef IPOL_Z - scan.z[0] += scan.slopeZ[0]; - scan.z[1] += scan.slopeZ[1]; -#endif - -#ifdef IPOL_W - scan.w[0] += scan.slopeW[0]; - scan.w[1] += scan.slopeW[1]; -#endif - -#ifdef IPOL_C0 - scan.c[0][0] += scan.slopeC[0][0]; - scan.c[0][1] += scan.slopeC[0][1]; -#endif - -#ifdef IPOL_T0 - scan.t[0][0] += scan.slopeT[0][0]; - scan.t[0][1] += scan.slopeT[0][1]; -#endif - -#ifdef IPOL_T1 - scan.t[1][0] += scan.slopeT[1][0]; - scan.t[1][1] += scan.slopeT[1][1]; -#endif - - } - } - -} - - - -} // end namespace video -} // end namespace irr - -#endif // _IRR_COMPILE_WITH_BURNINGSVIDEO_ - -namespace irr -{ -namespace video -{ - -//! creates a flat triangle renderer -IBurningShader* createTRTextureBlend(CBurningVideoDriver* driver) -{ - // EMT_ONETEXTURE_BLEND - #ifdef _IRR_COMPILE_WITH_BURNINGSVIDEO_ - return new CTRTextureBlend(driver); - #else - return 0; - #endif // _IRR_COMPILE_WITH_BURNINGSVIDEO_ -} - - -} // end namespace video -} // end namespace irr - - diff --git a/source/Irrlicht/CTRTextureDetailMap2.cpp b/source/Irrlicht/CTRTextureDetailMap2.cpp deleted file mode 100644 index 78896647..00000000 --- a/source/Irrlicht/CTRTextureDetailMap2.cpp +++ /dev/null @@ -1,652 +0,0 @@ -// Copyright (C) 2002-2012 Nikolaus Gebhardt / Thomas Alten -// This file is part of the "Irrlicht Engine". -// For conditions of distribution and use, see copyright notice in irrlicht.h - -#include "IrrCompileConfig.h" -#include "IBurningShader.h" - -#ifdef _IRR_COMPILE_WITH_BURNINGSVIDEO_ - -// compile flag for this file -#undef USE_ZBUFFER -#undef IPOL_Z -#undef CMP_Z -#undef WRITE_Z - -#undef IPOL_W -#undef CMP_W -#undef WRITE_W - -#undef SUBTEXEL -#undef INVERSE_W - -#undef IPOL_C0 -#undef IPOL_T0 -#undef IPOL_T1 - -// define render case -#define SUBTEXEL -#define INVERSE_W - -#define USE_ZBUFFER -#define IPOL_W -#define CMP_W -#define WRITE_W - -#define IPOL_C0 -#define IPOL_T0 -#define IPOL_T1 - -// apply global override -#ifndef SOFTWARE_DRIVER_2_PERSPECTIVE_CORRECT - #undef INVERSE_W -#endif - -#ifndef SOFTWARE_DRIVER_2_SUBTEXEL - #undef SUBTEXEL -#endif - -#if BURNING_MATERIAL_MAX_COLORS < 1 - #undef IPOL_C0 -#endif - - -#if !defined ( SOFTWARE_DRIVER_2_USE_WBUFFER ) && defined ( USE_ZBUFFER ) - #ifndef SOFTWARE_DRIVER_2_PERSPECTIVE_CORRECT - #undef IPOL_W - #endif - #define IPOL_Z - - #ifdef CMP_W - #undef CMP_W - #define CMP_Z - #endif - - #ifdef WRITE_W - #undef WRITE_W - #define WRITE_Z - #endif - -#endif - - -namespace irr -{ - -namespace video -{ - -class CTRTextureDetailMap2 : public IBurningShader -{ -public: - - //! constructor - CTRTextureDetailMap2(CBurningVideoDriver* driver); - - //! draws an indexed triangle list - virtual void drawTriangle(const s4DVertex* burning_restrict a, const s4DVertex* burning_restrict b, const s4DVertex* burning_restrict c) _IRR_OVERRIDE_; - virtual bool canWireFrame () { return true; } - -protected: - virtual void fragmentShader(); - -}; - -//! constructor -CTRTextureDetailMap2::CTRTextureDetailMap2(CBurningVideoDriver* driver) -: IBurningShader(driver) -{ - #ifdef _DEBUG - setDebugName("CTRTextureDetailMap2"); - #endif -} - - - -/*! -*/ -void CTRTextureDetailMap2::fragmentShader() -{ - tVideoSample *dst; - -#ifdef USE_ZBUFFER - fp24 *z; -#endif - - s32 xStart; - s32 xEnd; - s32 dx; - - -#ifdef SUBTEXEL - f32 subPixel; -#endif - -#ifdef IPOL_Z - f32 slopeZ; -#endif -#ifdef IPOL_W - fp24 slopeW; -#endif -#ifdef IPOL_C0 - sVec4 slopeC; -#endif -#ifdef IPOL_T0 - sVec2 slopeT[BURNING_MATERIAL_MAX_TEXTURES]; -#endif - - // apply top-left fill-convention, left - xStart = fill_convention_left( line.x[0] ); - xEnd = fill_convention_right( line.x[1] ); - - dx = xEnd - xStart; - if ( dx < 0 ) - return; - - // slopes - const f32 invDeltaX = fill_step_x( line.x[1] - line.x[0] ); - -#ifdef IPOL_Z - slopeZ = (line.z[1] - line.z[0]) * invDeltaX; -#endif -#ifdef IPOL_W - slopeW = (line.w[1] - line.w[0]) * invDeltaX; -#endif -#ifdef IPOL_C0 - slopeC = (line.c[0][1] - line.c[0][0]) * invDeltaX; -#endif -#ifdef IPOL_T0 - slopeT[0] = (line.t[0][1] - line.t[0][0]) * invDeltaX; -#endif -#ifdef IPOL_T1 - slopeT[1] = (line.t[1][1] - line.t[1][0]) * invDeltaX; -#endif - -#ifdef SUBTEXEL - subPixel = ( (f32) xStart ) - line.x[0]; -#ifdef IPOL_Z - line.z[0] += slopeZ * subPixel; -#endif -#ifdef IPOL_W - line.w[0] += slopeW * subPixel; -#endif -#ifdef IPOL_C0 - line.c[0][0] += slopeC * subPixel; -#endif -#ifdef IPOL_T0 - line.t[0][0] += slopeT[0] * subPixel; -#endif -#ifdef IPOL_T1 - line.t[1][0] += slopeT[1] * subPixel; -#endif -#endif - - SOFTWARE_DRIVER_2_CLIPCHECK; - dst = (tVideoSample*)RenderTarget->getData() + ( line.y * RenderTarget->getDimension().Width ) + xStart; - -#ifdef USE_ZBUFFER - z = (fp24*) DepthBuffer->lock() + ( line.y * RenderTarget->getDimension().Width ) + xStart; -#endif - - - f32 inversew = FIX_POINT_F32_MUL; - - tFixPoint tx0, tx1; - tFixPoint ty0, ty1; - - tFixPoint r0, g0, b0; - tFixPoint r1, g1, b1; - tFixPoint r2, g2, b2; - - - for ( s32 i = 0; i <= dx; i += SOFTWARE_DRIVER_2_STEP_X) - { - if ( (0 == EdgeTestPass) & (i > line.x_edgetest)) break; - -#ifdef CMP_Z - if ( line.z[0] < z[i] ) -#endif -#ifdef CMP_W - if ( line.w[0] >= z[i] ) -#endif - - { -#ifdef INVERSE_W - inversew = fix_inverse32 ( line.w[0] ); -#endif - tx0 = tofix ( line.t[0][0].x,inversew); - ty0 = tofix ( line.t[0][0].y,inversew); - tx1 = tofix ( line.t[1][0].x,inversew); - ty1 = tofix ( line.t[1][0].y,inversew); - - getSample_texture ( r0, g0, b0, &IT[0], tx0,ty0 ); - getSample_texture ( r1, g1, b1, &IT[1], tx1,ty1 ); - - // add signed - - r2 = clampfix_mincolor ( clampfix_maxcolor ( r0 + r1 - FIX_POINT_HALF_COLOR ) ); - g2 = clampfix_mincolor ( clampfix_maxcolor ( g0 + g1 - FIX_POINT_HALF_COLOR ) ); - b2 = clampfix_mincolor ( clampfix_maxcolor ( b0 + b1 - FIX_POINT_HALF_COLOR ) ); - - dst[i] = fix_to_sample( r2, g2, b2 ); - -#ifdef WRITE_Z - z[i] = line.z[0]; -#endif -#ifdef WRITE_W - z[i] = line.w[0]; -#endif - - } - -#ifdef IPOL_Z - line.z[0] += slopeZ; -#endif -#ifdef IPOL_W - line.w[0] += slopeW; -#endif -#ifdef IPOL_C0 - line.c[0][0] += slopeC; -#endif -#ifdef IPOL_T0 - line.t[0][0] += slopeT[0]; -#endif -#ifdef IPOL_T1 - line.t[1][0] += slopeT[1]; -#endif - } - -} - -void CTRTextureDetailMap2::drawTriangle(const s4DVertex* burning_restrict a, const s4DVertex* burning_restrict b, const s4DVertex* burning_restrict c) -{ - // sort on height, y - if ( F32_A_GREATER_B ( a->Pos.y , b->Pos.y ) ) swapVertexPointer(&a, &b); - if ( F32_A_GREATER_B ( b->Pos.y , c->Pos.y ) ) swapVertexPointer(&b, &c); - if ( F32_A_GREATER_B ( a->Pos.y , b->Pos.y ) ) swapVertexPointer(&a, &b); - - const f32 ca = c->Pos.y - a->Pos.y; - const f32 ba = b->Pos.y - a->Pos.y; - const f32 cb = c->Pos.y - b->Pos.y; - // calculate delta y of the edges - scan.invDeltaY[0] = reciprocal_edge( ca ); - scan.invDeltaY[1] = reciprocal_edge( ba ); - scan.invDeltaY[2] = reciprocal_edge( cb ); - - if ( F32_LOWER_EQUAL_0 ( scan.invDeltaY[0] ) ) - return; - - // find if the major edge is left or right aligned - f32 temp[4]; - - temp[0] = a->Pos.x - c->Pos.x; - temp[1] = -ca; - temp[2] = b->Pos.x - a->Pos.x; - temp[3] = ba; - - scan.left = ( temp[0] * temp[3] - temp[1] * temp[2] ) > 0.f ? 0 : 1; - scan.right = 1 - scan.left; - - // calculate slopes for the major edge - scan.slopeX[0] = (c->Pos.x - a->Pos.x) * scan.invDeltaY[0]; - scan.x[0] = a->Pos.x; - -#ifdef IPOL_Z - scan.slopeZ[0] = (c->Pos.z - a->Pos.z) * scan.invDeltaY[0]; - scan.z[0] = a->Pos.z; -#endif - -#ifdef IPOL_W - scan.slopeW[0] = (c->Pos.w - a->Pos.w) * scan.invDeltaY[0]; - scan.w[0] = a->Pos.w; -#endif - -#ifdef IPOL_C0 - scan.slopeC[0][0] = (c->Color[0] - a->Color[0]) * scan.invDeltaY[0]; - scan.c[0][0] = a->Color[0]; -#endif - -#ifdef IPOL_T0 - scan.slopeT[0][0] = (c->Tex[0] - a->Tex[0]) * scan.invDeltaY[0]; - scan.t[0][0] = a->Tex[0]; -#endif - -#ifdef IPOL_T1 - scan.slopeT[1][0] = (c->Tex[1] - a->Tex[1]) * scan.invDeltaY[0]; - scan.t[1][0] = a->Tex[1]; -#endif - - // top left fill convention y run - s32 yStart; - s32 yEnd; - -#ifdef SUBTEXEL - f32 subPixel; -#endif - - // rasterize upper sub-triangle - if (F32_GREATER_0(scan.invDeltaY[1]) ) - { - // calculate slopes for top edge - scan.slopeX[1] = (b->Pos.x - a->Pos.x) * scan.invDeltaY[1]; - scan.x[1] = a->Pos.x; - -#ifdef IPOL_Z - scan.slopeZ[1] = (b->Pos.z - a->Pos.z) * scan.invDeltaY[1]; - scan.z[1] = a->Pos.z; -#endif - -#ifdef IPOL_W - scan.slopeW[1] = (b->Pos.w - a->Pos.w) * scan.invDeltaY[1]; - scan.w[1] = a->Pos.w; -#endif - -#ifdef IPOL_C0 - scan.slopeC[0][1] = (b->Color[0] - a->Color[0]) * scan.invDeltaY[1]; - scan.c[0][1] = a->Color[0]; -#endif - -#ifdef IPOL_T0 - scan.slopeT[0][1] = (b->Tex[0] - a->Tex[0]) * scan.invDeltaY[1]; - scan.t[0][1] = a->Tex[0]; -#endif - -#ifdef IPOL_T1 - scan.slopeT[1][1] = (b->Tex[1] - a->Tex[1]) * scan.invDeltaY[1]; - scan.t[1][1] = a->Tex[1]; -#endif - - // apply top-left fill convention, top part - yStart = fill_convention_left( a->Pos.y ); - yEnd = fill_convention_right( b->Pos.y ); - -#ifdef SUBTEXEL - subPixel = ( (f32) yStart ) - a->Pos.y; - - // correct to pixel center - scan.x[0] += scan.slopeX[0] * subPixel; - scan.x[1] += scan.slopeX[1] * subPixel; - -#ifdef IPOL_Z - scan.z[0] += scan.slopeZ[0] * subPixel; - scan.z[1] += scan.slopeZ[1] * subPixel; -#endif - -#ifdef IPOL_W - scan.w[0] += scan.slopeW[0] * subPixel; - scan.w[1] += scan.slopeW[1] * subPixel; -#endif - -#ifdef IPOL_C0 - scan.c[0][0] += scan.slopeC[0][0] * subPixel; - scan.c[0][1] += scan.slopeC[0][1] * subPixel; -#endif - -#ifdef IPOL_T0 - scan.t[0][0] += scan.slopeT[0][0] * subPixel; - scan.t[0][1] += scan.slopeT[0][1] * subPixel; -#endif - -#ifdef IPOL_T1 - scan.t[1][0] += scan.slopeT[1][0] * subPixel; - scan.t[1][1] += scan.slopeT[1][1] * subPixel; -#endif - -#endif - line.x_edgetest = fill_convention_edge(scan.slopeX[scan.left]); - - // rasterize the edge scanlines - for( line.y = yStart; line.y <= yEnd; line.y += SOFTWARE_DRIVER_2_STEP_Y) - { - line.x[scan.left] = scan.x[0]; - line.x[scan.right] = scan.x[1]; - -#ifdef IPOL_Z - line.z[scan.left] = scan.z[0]; - line.z[scan.right] = scan.z[1]; -#endif - -#ifdef IPOL_W - line.w[scan.left] = scan.w[0]; - line.w[scan.right] = scan.w[1]; -#endif - -#ifdef IPOL_C0 - line.c[0][scan.left] = scan.c[0][0]; - line.c[0][scan.right] = scan.c[0][1]; -#endif - -#ifdef IPOL_T0 - line.t[0][scan.left] = scan.t[0][0]; - line.t[0][scan.right] = scan.t[0][1]; -#endif - -#ifdef IPOL_T1 - line.t[1][scan.left] = scan.t[1][0]; - line.t[1][scan.right] = scan.t[1][1]; -#endif - - // render a scanline - interlace_scanline fragmentShader(); - if (EdgeTestPass & edge_test_first_line) break; - - scan.x[0] += scan.slopeX[0]; - scan.x[1] += scan.slopeX[1]; - -#ifdef IPOL_Z - scan.z[0] += scan.slopeZ[0]; - scan.z[1] += scan.slopeZ[1]; -#endif - -#ifdef IPOL_W - scan.w[0] += scan.slopeW[0]; - scan.w[1] += scan.slopeW[1]; -#endif - -#ifdef IPOL_C0 - scan.c[0][0] += scan.slopeC[0][0]; - scan.c[0][1] += scan.slopeC[0][1]; -#endif - -#ifdef IPOL_T0 - scan.t[0][0] += scan.slopeT[0][0]; - scan.t[0][1] += scan.slopeT[0][1]; -#endif - -#ifdef IPOL_T1 - scan.t[1][0] += scan.slopeT[1][0]; - scan.t[1][1] += scan.slopeT[1][1]; -#endif - - } - } - - // rasterize lower sub-triangle - if (F32_GREATER_0(scan.invDeltaY[2]) ) - { - // advance to middle point - if(F32_GREATER_0(scan.invDeltaY[1]) ) - { - temp[0] = b->Pos.y - a->Pos.y; // dy - - scan.x[0] = a->Pos.x + scan.slopeX[0] * temp[0]; -#ifdef IPOL_Z - scan.z[0] = a->Pos.z + scan.slopeZ[0] * temp[0]; -#endif -#ifdef IPOL_W - scan.w[0] = a->Pos.w + scan.slopeW[0] * temp[0]; -#endif -#ifdef IPOL_C0 - scan.c[0][0] = a->Color[0] + scan.slopeC[0][0] * temp[0]; -#endif -#ifdef IPOL_T0 - scan.t[0][0] = a->Tex[0] + scan.slopeT[0][0] * temp[0]; -#endif -#ifdef IPOL_T1 - scan.t[1][0] = a->Tex[1] + scan.slopeT[1][0] * temp[0]; -#endif - - } - - // calculate slopes for bottom edge - scan.slopeX[1] = (c->Pos.x - b->Pos.x) * scan.invDeltaY[2]; - scan.x[1] = b->Pos.x; - -#ifdef IPOL_Z - scan.slopeZ[1] = (c->Pos.z - b->Pos.z) * scan.invDeltaY[2]; - scan.z[1] = b->Pos.z; -#endif - -#ifdef IPOL_W - scan.slopeW[1] = (c->Pos.w - b->Pos.w) * scan.invDeltaY[2]; - scan.w[1] = b->Pos.w; -#endif - -#ifdef IPOL_C0 - scan.slopeC[0][1] = (c->Color[0] - b->Color[0]) * scan.invDeltaY[2]; - scan.c[0][1] = b->Color[0]; -#endif - -#ifdef IPOL_T0 - scan.slopeT[0][1] = (c->Tex[0] - b->Tex[0]) * scan.invDeltaY[2]; - scan.t[0][1] = b->Tex[0]; -#endif - -#ifdef IPOL_T1 - scan.slopeT[1][1] = (c->Tex[1] - b->Tex[1]) * scan.invDeltaY[2]; - scan.t[1][1] = b->Tex[1]; -#endif - - // apply top-left fill convention, top part - yStart = fill_convention_left( b->Pos.y ); - yEnd = fill_convention_right( c->Pos.y ); - -#ifdef SUBTEXEL - subPixel = ( (f32) yStart ) - b->Pos.y; - - // correct to pixel center - scan.x[0] += scan.slopeX[0] * subPixel; - scan.x[1] += scan.slopeX[1] * subPixel; - -#ifdef IPOL_Z - scan.z[0] += scan.slopeZ[0] * subPixel; - scan.z[1] += scan.slopeZ[1] * subPixel; -#endif - -#ifdef IPOL_W - scan.w[0] += scan.slopeW[0] * subPixel; - scan.w[1] += scan.slopeW[1] * subPixel; -#endif - -#ifdef IPOL_C0 - scan.c[0][0] += scan.slopeC[0][0] * subPixel; - scan.c[0][1] += scan.slopeC[0][1] * subPixel; -#endif - -#ifdef IPOL_T0 - scan.t[0][0] += scan.slopeT[0][0] * subPixel; - scan.t[0][1] += scan.slopeT[0][1] * subPixel; -#endif - -#ifdef IPOL_T1 - scan.t[1][0] += scan.slopeT[1][0] * subPixel; - scan.t[1][1] += scan.slopeT[1][1] * subPixel; -#endif - -#endif - - line.x_edgetest = fill_convention_edge(scan.slopeX[scan.left]); - - // rasterize the edge scanlines - for( line.y = yStart; line.y <= yEnd; line.y += SOFTWARE_DRIVER_2_STEP_Y) - { - line.x[scan.left] = scan.x[0]; - line.x[scan.right] = scan.x[1]; - -#ifdef IPOL_Z - line.z[scan.left] = scan.z[0]; - line.z[scan.right] = scan.z[1]; -#endif - -#ifdef IPOL_W - line.w[scan.left] = scan.w[0]; - line.w[scan.right] = scan.w[1]; -#endif - -#ifdef IPOL_C0 - line.c[0][scan.left] = scan.c[0][0]; - line.c[0][scan.right] = scan.c[0][1]; -#endif - -#ifdef IPOL_T0 - line.t[0][scan.left] = scan.t[0][0]; - line.t[0][scan.right] = scan.t[0][1]; -#endif - -#ifdef IPOL_T1 - line.t[1][scan.left] = scan.t[1][0]; - line.t[1][scan.right] = scan.t[1][1]; -#endif - - // render a scanline - interlace_scanline fragmentShader(); - if (EdgeTestPass & edge_test_first_line) break; - - scan.x[0] += scan.slopeX[0]; - scan.x[1] += scan.slopeX[1]; - -#ifdef IPOL_Z - scan.z[0] += scan.slopeZ[0]; - scan.z[1] += scan.slopeZ[1]; -#endif - -#ifdef IPOL_W - scan.w[0] += scan.slopeW[0]; - scan.w[1] += scan.slopeW[1]; -#endif - -#ifdef IPOL_C0 - scan.c[0][0] += scan.slopeC[0][0]; - scan.c[0][1] += scan.slopeC[0][1]; -#endif - -#ifdef IPOL_T0 - scan.t[0][0] += scan.slopeT[0][0]; - scan.t[0][1] += scan.slopeT[0][1]; -#endif - -#ifdef IPOL_T1 - scan.t[1][0] += scan.slopeT[1][0]; - scan.t[1][1] += scan.slopeT[1][1]; -#endif - - } - } - -} - -} // end namespace video -} // end namespace irr - -#endif // _IRR_COMPILE_WITH_BURNINGSVIDEO_ - -namespace irr -{ -namespace video -{ - -//! creates a flat triangle renderer -IBurningShader* createTriangleRendererTextureDetailMap2(CBurningVideoDriver* driver) -{ - #ifdef _IRR_COMPILE_WITH_BURNINGSVIDEO_ - return new CTRTextureDetailMap2(driver); - #else - return 0; - #endif // _IRR_COMPILE_WITH_BURNINGSVIDEO_ -} - - -} // end namespace video -} // end namespace irr - - diff --git a/source/Irrlicht/CTRTextureFlat.cpp b/source/Irrlicht/CTRTextureFlat.cpp deleted file mode 100644 index 9ef5ade0..00000000 --- a/source/Irrlicht/CTRTextureFlat.cpp +++ /dev/null @@ -1,336 +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" -#include "CTRTextureGouraud.h" - -#ifdef _IRR_COMPILE_WITH_SOFTWARE_ - -namespace irr -{ -namespace video -{ - -class CTRTextureFlat : public CTRTextureGouraud -{ -public: - - CTRTextureFlat(IZBuffer* zbuffer) - : CTRTextureGouraud(zbuffer) - { - #ifdef _DEBUG - setDebugName("CTRTextureFlat"); - #endif - } - - //! draws an indexed triangle list - virtual void drawIndexedTriangleList(S2DVertex* vertices, s32 vertexCount, const u16* indexList, s32 triangleCount) _IRR_OVERRIDE_ - { - const S2DVertex *v1, *v2, *v3; - - f32 tmpDiv; // temporary division factor - f32 longest; // saves the longest span - s32 height; // saves height of triangle - u16* targetSurface; // target pointer where to plot pixels - s32 spanEnd; // saves end of spans - f32 leftdeltaxf; // amount of pixels to increase on left side of triangle - f32 rightdeltaxf; // amount of pixels to increase on right side of triangle - s32 leftx, rightx; // position where we are - f32 leftxf, rightxf; // same as above, but as f32 values - s32 span; // current span - u16 *hSpanBegin, *hSpanEnd; // pointer used when plotting pixels - s32 leftTx, rightTx, leftTy, rightTy; // texture interpolating values - s32 leftTxStep, rightTxStep, leftTyStep, rightTyStep; // texture interpolating values - s32 spanTx, spanTy, spanTxStep, spanTyStep; // values of Texturecoords when drawing a span - core::rect<s32> TriangleRect; - - s32 leftZValue, rightZValue; - s32 leftZStep, rightZStep; - s32 spanZValue, spanZStep; // ZValues when drawing a span - TZBufferType* zTarget, *spanZTarget; // target of ZBuffer; - - lockedSurface = (u16*)RenderTarget->getData(); - lockedZBuffer = ZBuffer->lock(); - lockedTexture = (u16*)Texture->getData(); - - for (s32 i=0; i<triangleCount; ++i) - { - v1 = &vertices[*indexList]; - ++indexList; - v2 = &vertices[*indexList]; - ++indexList; - v3 = &vertices[*indexList]; - ++indexList; - - // back face culling - - if (BackFaceCullingEnabled) - { - s32 z = ((v3->Pos.X - v1->Pos.X) * (v3->Pos.Y - v2->Pos.Y)) - - ((v3->Pos.Y - v1->Pos.Y) * (v3->Pos.X - v2->Pos.X)); - - if (z < 0) - continue; - } - - //near plane clipping - - if (v1->ZValue<0 && v2->ZValue<0 && v3->ZValue<0) - continue; - - // sort for width for inscreen clipping - - if (v1->Pos.X > v2->Pos.X) swapVertices(&v1, &v2); - if (v1->Pos.X > v3->Pos.X) swapVertices(&v1, &v3); - if (v2->Pos.X > v3->Pos.X) swapVertices(&v2, &v3); - - if ((v1->Pos.X - v3->Pos.X) == 0) - continue; - - TriangleRect.UpperLeftCorner.X = v1->Pos.X; - TriangleRect.LowerRightCorner.X = v3->Pos.X; - - // sort for height for faster drawing. - - if (v1->Pos.Y > v2->Pos.Y) swapVertices(&v1, &v2); - if (v1->Pos.Y > v3->Pos.Y) swapVertices(&v1, &v3); - if (v2->Pos.Y > v3->Pos.Y) swapVertices(&v2, &v3); - - TriangleRect.UpperLeftCorner.Y = v1->Pos.Y; - TriangleRect.LowerRightCorner.Y = v3->Pos.Y; - - if (!TriangleRect.isRectCollided(ViewPortRect)) - continue; - - // calculate height of triangle - height = v3->Pos.Y - v1->Pos.Y; - if (!height) - continue; - - // calculate longest span - - longest = (v2->Pos.Y - v1->Pos.Y) / (f32)height * (v3->Pos.X - v1->Pos.X) + (v1->Pos.X - v2->Pos.X); - - spanEnd = v2->Pos.Y; - span = v1->Pos.Y; - leftxf = (f32)v1->Pos.X; - rightxf = (f32)v1->Pos.X; - - leftZValue = v1->ZValue; - rightZValue = v1->ZValue; - - leftTx = rightTx = v1->TCoords.X; - leftTy = rightTy = v1->TCoords.Y; - - targetSurface = lockedSurface + span * SurfaceWidth; - zTarget = lockedZBuffer + span * SurfaceWidth; - - if (longest < 0.0f) - { - tmpDiv = 1.0f / (f32)(v2->Pos.Y - v1->Pos.Y); - rightdeltaxf = (v2->Pos.X - v1->Pos.X) * tmpDiv; - rightZStep = (s32)((v2->ZValue - v1->ZValue) * tmpDiv); - rightTxStep = (s32)((v2->TCoords.X - rightTx) * tmpDiv); - rightTyStep = (s32)((v2->TCoords.Y - rightTy) * tmpDiv); - - tmpDiv = 1.0f / (f32)height; - leftdeltaxf = (v3->Pos.X - v1->Pos.X) * tmpDiv; - leftZStep = (s32)((v3->ZValue - v1->ZValue) * tmpDiv); - leftTxStep = (s32)((v3->TCoords.X - leftTx) * tmpDiv); - leftTyStep = (s32)((v3->TCoords.Y - leftTy) * tmpDiv); - } - else - { - tmpDiv = 1.0f / (f32)height; - rightdeltaxf = (v3->Pos.X - v1->Pos.X) * tmpDiv; - rightZStep = (s32)((v3->ZValue - v1->ZValue) * tmpDiv); - rightTxStep = (s32)((v3->TCoords.X - rightTx) * tmpDiv); - rightTyStep = (s32)((v3->TCoords.Y - rightTy) * tmpDiv); - - tmpDiv = 1.0f / (f32)(v2->Pos.Y - v1->Pos.Y); - leftdeltaxf = (v2->Pos.X - v1->Pos.X) * tmpDiv; - leftZStep = (s32)((v2->ZValue - v1->ZValue) * tmpDiv); - leftTxStep = (s32)((v2->TCoords.X - leftTx) * tmpDiv); - leftTyStep = (s32)((v2->TCoords.Y - leftTy) * tmpDiv); - } - - - // do it twice, once for the first half of the triangle, - // end then for the second half. - - for (s32 triangleHalf=0; triangleHalf<2; ++triangleHalf) - { - if (spanEnd > ViewPortRect.LowerRightCorner.Y) - spanEnd = ViewPortRect.LowerRightCorner.Y; - - // if the span <0, than we can skip these spans, - // and proceed to the next spans which are really on the screen. - if (span < ViewPortRect.UpperLeftCorner.Y) - { - // we'll use leftx as temp variable - if (spanEnd < ViewPortRect.UpperLeftCorner.Y) - { - leftx = spanEnd - span; - span = spanEnd; - } - else - { - leftx = ViewPortRect.UpperLeftCorner.Y - span; - span = ViewPortRect.UpperLeftCorner.Y; - } - - leftxf += leftdeltaxf*leftx; - rightxf += rightdeltaxf*leftx; - targetSurface += SurfaceWidth*leftx; - zTarget += SurfaceWidth*leftx; - leftZValue += leftZStep*leftx; - rightZValue += rightZStep*leftx; - - leftTx += leftTxStep*leftx; - leftTy += leftTyStep*leftx; - rightTx += rightTxStep*leftx; - rightTy += rightTyStep*leftx; - } - - - // the main loop. Go through every span and draw it. - - while (span < spanEnd) - { - leftx = (s32)(leftxf); - rightx = (s32)(rightxf + 0.5f); - - // perform some clipping - - // TODO: clipping is not correct when leftx is clipped. - - if (leftx<ViewPortRect.UpperLeftCorner.X) - leftx = ViewPortRect.UpperLeftCorner.X; - else - if (leftx>ViewPortRect.LowerRightCorner.X) - leftx = ViewPortRect.LowerRightCorner.X; - - if (rightx<ViewPortRect.UpperLeftCorner.X) - rightx = ViewPortRect.UpperLeftCorner.X; - else - if (rightx>ViewPortRect.LowerRightCorner.X) - rightx = ViewPortRect.LowerRightCorner.X; - - // draw the span - - if (rightx - leftx != 0) - { - tmpDiv = 1.0f / (rightx - leftx); - spanZValue = leftZValue; - spanZStep = (s32)((rightZValue - leftZValue) * tmpDiv); - - hSpanBegin = targetSurface + leftx; - spanZTarget = zTarget + leftx; - hSpanEnd = targetSurface + rightx; - - spanTx = leftTx; - spanTy = leftTy; - spanTxStep = (s32)((rightTx - leftTx) * tmpDiv); - spanTyStep = (s32)((rightTy - leftTy) * tmpDiv); - - while (hSpanBegin < hSpanEnd) - { - if (spanZValue > *spanZTarget) - { - *spanZTarget = spanZValue; - *hSpanBegin = lockedTexture[((spanTy>>8)&textureYMask) * lockedTextureWidth + ((spanTx>>8)&textureXMask)]; - } - - spanTx += spanTxStep; - spanTy += spanTyStep; - - spanZValue += spanZStep; - ++hSpanBegin; - ++spanZTarget; - } - } - - leftxf += leftdeltaxf; - rightxf += rightdeltaxf; - ++span; - targetSurface += SurfaceWidth; - zTarget += SurfaceWidth; - leftZValue += leftZStep; - rightZValue += rightZStep; - - leftTx += leftTxStep; - leftTy += leftTyStep; - rightTx += rightTxStep; - rightTy += rightTyStep; - } - - if (triangleHalf>0) // break, we've gout only two halves - break; - - - // setup variables for second half of the triangle. - - if (longest < 0.0f) - { - tmpDiv = 1.0f / (v3->Pos.Y - v2->Pos.Y); - - rightdeltaxf = (v3->Pos.X - v2->Pos.X) * tmpDiv; - rightxf = (f32)v2->Pos.X; - - rightZValue = v2->ZValue; - rightZStep = (s32)((v3->ZValue - v2->ZValue) * tmpDiv); - - rightTx = v2->TCoords.X; - rightTy = v2->TCoords.Y; - rightTxStep = (s32)((v3->TCoords.X - rightTx) * tmpDiv); - rightTyStep = (s32)((v3->TCoords.Y - rightTy) * tmpDiv); - } - else - { - tmpDiv = 1.0f / (v3->Pos.Y - v2->Pos.Y); - - leftdeltaxf = (v3->Pos.X - v2->Pos.X) * tmpDiv; - leftxf = (f32)v2->Pos.X; - - leftZValue = v2->ZValue; - leftZStep = (s32)((v3->ZValue - v2->ZValue) * tmpDiv); - - leftTx = v2->TCoords.X; - leftTy = v2->TCoords.Y; - leftTxStep = (s32)((v3->TCoords.X - leftTx) * tmpDiv); - leftTyStep = (s32)((v3->TCoords.Y - leftTy) * tmpDiv); - } - - - spanEnd = v3->Pos.Y; - } - - } - - ZBuffer->unlock(); - } -}; - -} // end namespace video -} // end namespace irr - -#endif // _IRR_COMPILE_WITH_SOFTWARE_ - -namespace irr -{ -namespace video -{ - -//! creates a flat triangle renderer -ITriangleRenderer* createTriangleRendererTextureFlat(IZBuffer* zbuffer) -{ - #ifdef _IRR_COMPILE_WITH_SOFTWARE_ - return new CTRTextureFlat(zbuffer); - #else - return 0; - #endif // _IRR_COMPILE_WITH_SOFTWARE_ -} - -} // end namespace video -} // end namespace irr diff --git a/source/Irrlicht/CTRTextureFlatWire.cpp b/source/Irrlicht/CTRTextureFlatWire.cpp deleted file mode 100644 index 2147edd0..00000000 --- a/source/Irrlicht/CTRTextureFlatWire.cpp +++ /dev/null @@ -1,310 +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" -#include "CTRTextureGouraud.h" - -#ifdef _IRR_COMPILE_WITH_SOFTWARE_ - -namespace irr -{ -namespace video -{ - -class CTRTextureFlatWire : public CTRTextureGouraud -{ -public: - - CTRTextureFlatWire(IZBuffer* zbuffer) - : CTRTextureGouraud(zbuffer) - { - #ifdef _DEBUG - setDebugName("CTRTextureFlatWire"); - #endif - } - - //! draws an indexed triangle list - virtual void drawIndexedTriangleList(S2DVertex* vertices, s32 vertexCount, const u16* indexList, s32 triangleCount) _IRR_OVERRIDE_ - { - const S2DVertex *v1, *v2, *v3; - - f32 tmpDiv; // temporary division factor - f32 longest; // saves the longest span - s32 height; // saves height of triangle - u16* targetSurface; // target pointer where to plot pixels - s32 spanEnd; // saves end of spans - f32 leftdeltaxf; // amount of pixels to increase on left side of triangle - f32 rightdeltaxf; // amount of pixels to increase on right side of triangle - s32 leftx, rightx; // position where we are - f32 leftxf, rightxf; // same as above, but as f32 values - s32 span; // current span - s32 leftTx, rightTx, leftTy, rightTy; // texture interpolating values - s32 leftTxStep, rightTxStep, leftTyStep, rightTyStep; // texture interpolating values - core::rect<s32> TriangleRect; - - s32 leftZValue, rightZValue; - s32 leftZStep, rightZStep; - TZBufferType* zTarget; // target of ZBuffer; - - lockedSurface = (u16*)RenderTarget->getData(); - lockedZBuffer = ZBuffer->lock(); - lockedTexture = (u16*)Texture->getData(); - - for (s32 i=0; i<triangleCount; ++i) - { - v1 = &vertices[*indexList]; - ++indexList; - v2 = &vertices[*indexList]; - ++indexList; - v3 = &vertices[*indexList]; - ++indexList; - - // back face culling - - if (BackFaceCullingEnabled) - { - s32 z = ((v3->Pos.X - v1->Pos.X) * (v3->Pos.Y - v2->Pos.Y)) - - ((v3->Pos.Y - v1->Pos.Y) * (v3->Pos.X - v2->Pos.X)); - - if (z < 0) - continue; - } - - //near plane clipping - - if (v1->ZValue<0 && v2->ZValue<0 && v3->ZValue<0) - continue; - - // sort for width for inscreen clipping - - if (v1->Pos.X > v2->Pos.X) swapVertices(&v1, &v2); - if (v1->Pos.X > v3->Pos.X) swapVertices(&v1, &v3); - if (v2->Pos.X > v3->Pos.X) swapVertices(&v2, &v3); - - if ((v1->Pos.X - v3->Pos.X) == 0) - continue; - - TriangleRect.UpperLeftCorner.X = v1->Pos.X; - TriangleRect.LowerRightCorner.X = v3->Pos.X; - - // sort for height for faster drawing. - - if (v1->Pos.Y > v2->Pos.Y) swapVertices(&v1, &v2); - if (v1->Pos.Y > v3->Pos.Y) swapVertices(&v1, &v3); - if (v2->Pos.Y > v3->Pos.Y) swapVertices(&v2, &v3); - - TriangleRect.UpperLeftCorner.Y = v1->Pos.Y; - TriangleRect.LowerRightCorner.Y = v3->Pos.Y; - - if (!TriangleRect.isRectCollided(ViewPortRect)) - continue; - - // calculate height of triangle - height = v3->Pos.Y - v1->Pos.Y; - if (!height) - continue; - - // calculate longest span - - longest = (v2->Pos.Y - v1->Pos.Y) / (f32)height * (v3->Pos.X - v1->Pos.X) + (v1->Pos.X - v2->Pos.X); - - spanEnd = v2->Pos.Y; - span = v1->Pos.Y; - leftxf = (f32)v1->Pos.X; - rightxf = (f32)v1->Pos.X; - - leftZValue = v1->ZValue; - rightZValue = v1->ZValue; - - leftTx = rightTx = v1->TCoords.X; - leftTy = rightTy = v1->TCoords.Y; - - targetSurface = lockedSurface + span * SurfaceWidth; - zTarget = lockedZBuffer + span * SurfaceWidth; - - if (longest < 0.0f) - { - tmpDiv = 1.0f / (f32)(v2->Pos.Y - v1->Pos.Y); - rightdeltaxf = (v2->Pos.X - v1->Pos.X) * tmpDiv; - rightZStep = (s32)((v2->ZValue - v1->ZValue) * tmpDiv); - rightTxStep = (s32)((v2->TCoords.X - rightTx) * tmpDiv); - rightTyStep = (s32)((v2->TCoords.Y - rightTy) * tmpDiv); - - tmpDiv = 1.0f / (f32)height; - leftdeltaxf = (v3->Pos.X - v1->Pos.X) * tmpDiv; - leftZStep = (s32)((v3->ZValue - v1->ZValue) * tmpDiv); - leftTxStep = (s32)((v3->TCoords.X - leftTx) * tmpDiv); - leftTyStep = (s32)((v3->TCoords.Y - leftTy) * tmpDiv); - } - else - { - tmpDiv = 1.0f / (f32)height; - rightdeltaxf = (v3->Pos.X - v1->Pos.X) * tmpDiv; - rightZStep = (s32)((v3->ZValue - v1->ZValue) * tmpDiv); - rightTxStep = (s32)((v3->TCoords.X - rightTx) * tmpDiv); - rightTyStep = (s32)((v3->TCoords.Y - rightTy) * tmpDiv); - - tmpDiv = 1.0f / (f32)(v2->Pos.Y - v1->Pos.Y); - leftdeltaxf = (v2->Pos.X - v1->Pos.X) * tmpDiv; - leftZStep = (s32)((v2->ZValue - v1->ZValue) * tmpDiv); - leftTxStep = (s32)((v2->TCoords.X - leftTx) * tmpDiv); - leftTyStep = (s32)((v2->TCoords.Y - leftTy) * tmpDiv); - } - - - // do it twice, once for the first half of the triangle, - // end then for the second half. - - for (s32 triangleHalf=0; triangleHalf<2; ++triangleHalf) - { - if (spanEnd > ViewPortRect.LowerRightCorner.Y) - spanEnd = ViewPortRect.LowerRightCorner.Y; - - // if the span <0, than we can skip these spans, - // and proceed to the next spans which are really on the screen. - if (span < ViewPortRect.UpperLeftCorner.Y) - { - // we'll use leftx as temp variable - if (spanEnd < ViewPortRect.UpperLeftCorner.Y) - { - leftx = spanEnd - span; - span = spanEnd; - } - else - { - leftx = ViewPortRect.UpperLeftCorner.Y - span; - span = ViewPortRect.UpperLeftCorner.Y; - } - - leftxf += leftdeltaxf*leftx; - rightxf += rightdeltaxf*leftx; - targetSurface += SurfaceWidth*leftx; - zTarget += SurfaceWidth*leftx; - leftZValue += leftZStep*leftx; - rightZValue += rightZStep*leftx; - - leftTx += leftTxStep*leftx; - leftTy += leftTyStep*leftx; - rightTx += rightTxStep*leftx; - rightTy += rightTyStep*leftx; - } - - - // the main loop. Go through every span and draw it. - - while (span < spanEnd) - { - leftx = (s32)(leftxf); - rightx = (s32)(rightxf + 0.5f); - - // perform some clipping - - if (leftx>=ViewPortRect.UpperLeftCorner.X && - leftx<=ViewPortRect.LowerRightCorner.X) - { - if (leftZValue > *(zTarget + leftx)) - { - *(zTarget + leftx) = leftZValue; - *(targetSurface + leftx) = lockedTexture[((leftTy>>8)&textureYMask) * lockedTextureWidth + ((rightTx>>8)&textureXMask)]; - } - } - - - if (rightx>=ViewPortRect.UpperLeftCorner.X && - rightx<=ViewPortRect.LowerRightCorner.X) - { - if (rightZValue > *(zTarget + rightx)) - { - *(zTarget + rightx) = rightZValue; - *(targetSurface + rightx) = lockedTexture[((rightTy>>8)&textureYMask) * lockedTextureWidth + ((rightTx>>8)&textureXMask)]; - } - - } - - - leftxf += leftdeltaxf; - rightxf += rightdeltaxf; - ++span; - targetSurface += SurfaceWidth; - zTarget += SurfaceWidth; - leftZValue += leftZStep; - rightZValue += rightZStep; - - leftTx += leftTxStep; - leftTy += leftTyStep; - rightTx += rightTxStep; - rightTy += rightTyStep; - } - - if (triangleHalf>0) // break, we've gout only two halves - break; - - - // setup variables for second half of the triangle. - - if (longest < 0.0f) - { - tmpDiv = 1.0f / (v3->Pos.Y - v2->Pos.Y); - - rightdeltaxf = (v3->Pos.X - v2->Pos.X) * tmpDiv; - rightxf = (f32)v2->Pos.X; - - rightZValue = v2->ZValue; - rightZStep = (s32)((v3->ZValue - v2->ZValue) * tmpDiv); - - rightTx = v2->TCoords.X; - rightTy = v2->TCoords.Y; - rightTxStep = (s32)((v3->TCoords.X - rightTx) * tmpDiv); - rightTyStep = (s32)((v3->TCoords.Y - rightTy) * tmpDiv); - } - else - { - tmpDiv = 1.0f / (v3->Pos.Y - v2->Pos.Y); - - leftdeltaxf = (v3->Pos.X - v2->Pos.X) * tmpDiv; - leftxf = (f32)v2->Pos.X; - - leftZValue = v2->ZValue; - leftZStep = (s32)((v3->ZValue - v2->ZValue) * tmpDiv); - - leftTx = v2->TCoords.X; - leftTy = v2->TCoords.Y; - leftTxStep = (s32)((v3->TCoords.X - leftTx) * tmpDiv); - leftTyStep = (s32)((v3->TCoords.Y - leftTy) * tmpDiv); - } - - - spanEnd = v3->Pos.Y; - } - - } - - ZBuffer->unlock(); - } -}; - -} // end namespace video -} // end namespace irr - -#endif // _IRR_COMPILE_WITH_SOFTWARE_ - -namespace irr -{ -namespace video -{ - -//! creates a flat triangle renderer -ITriangleRenderer* createTriangleRendererTextureFlatWire(IZBuffer* zbuffer) -{ - #ifdef _IRR_COMPILE_WITH_SOFTWARE_ - return new CTRTextureFlatWire(zbuffer); - #else - return 0; - #endif // _IRR_COMPILE_WITH_SOFTWARE_ -} - -} // end namespace video -} // end namespace irr - - diff --git a/source/Irrlicht/CTRTextureGouraud.cpp b/source/Irrlicht/CTRTextureGouraud.cpp deleted file mode 100644 index 74641a37..00000000 --- a/source/Irrlicht/CTRTextureGouraud.cpp +++ /dev/null @@ -1,466 +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 "CTRTextureGouraud.h" - -#ifdef _IRR_COMPILE_WITH_SOFTWARE_ - -namespace irr -{ -namespace video -{ - -//! constructor -CTRTextureGouraud::CTRTextureGouraud(IZBuffer* zbuffer) - : RenderTarget(0), ZBuffer(zbuffer), SurfaceWidth(0), SurfaceHeight(0), - BackFaceCullingEnabled(true), lockedZBuffer(0), - lockedSurface(0), lockedTexture(0), lockedTextureWidth(0), - textureXMask(0), textureYMask(0), Texture(0) -{ - #ifdef _DEBUG - setDebugName("CTRTextureGouraud"); - #endif - - if (ZBuffer) - zbuffer->grab(); -} - - - -//! destructor -CTRTextureGouraud::~CTRTextureGouraud() -{ - if (RenderTarget) - RenderTarget->drop(); - - if (ZBuffer) - ZBuffer->drop(); - - if (Texture) - Texture->drop(); -} - - - -//! sets the Texture -void CTRTextureGouraud::setTexture(video::IImage* texture) -{ - if (Texture) - Texture->drop(); - - Texture = texture; - - if (Texture) - { - Texture->grab(); - lockedTextureWidth = Texture->getDimension().Width; - - textureXMask = lockedTextureWidth-1; - textureYMask = Texture->getDimension().Height-1; - } -} - - - - -//! en or disables the backface culling -void CTRTextureGouraud::setBackfaceCulling(bool enabled) -{ - BackFaceCullingEnabled = enabled; -} - - - -//! sets a render target -void CTRTextureGouraud::setRenderTarget(video::IImage* surface, const core::rect<s32>& viewPort) -{ - if (RenderTarget) - RenderTarget->drop(); - - RenderTarget = surface; - - if (RenderTarget) - { - SurfaceWidth = RenderTarget->getDimension().Width; - SurfaceHeight = RenderTarget->getDimension().Height; - RenderTarget->grab(); - ViewPortRect = viewPort; - } -} - - - -//! draws an indexed triangle list -void CTRTextureGouraud::drawIndexedTriangleList(S2DVertex* vertices, s32 vertexCount, const u16* indexList, s32 triangleCount) -{ - const S2DVertex *v1, *v2, *v3; - - f32 tmpDiv; // temporary division factor - f32 longest; // saves the longest span - s32 height; // saves height of triangle - u16* targetSurface; // target pointer where to plot pixels - s32 spanEnd; // saves end of spans - f32 leftdeltaxf; // amount of pixels to increase on left side of triangle - f32 rightdeltaxf; // amount of pixels to increase on right side of triangle - s32 leftx, rightx; // position where we are - f32 leftxf, rightxf; // same as above, but as f32 values - s32 span; // current span - u16 *hSpanBegin, *hSpanEnd; // pointer used when plotting pixels - s32 leftR, leftG, leftB, rightR, rightG, rightB; // color values - s32 leftStepR, leftStepG, leftStepB, - rightStepR, rightStepG, rightStepB; // color steps - s32 spanR, spanG, spanB, spanStepR, spanStepG, spanStepB; // color interpolating values while drawing a span. - s32 leftTx, rightTx, leftTy, rightTy; // texture interpolating values - s32 leftTxStep, rightTxStep, leftTyStep, rightTyStep; // texture interpolating values - s32 spanTx, spanTy, spanTxStep, spanTyStep; // values of Texturecoords when drawing a span - core::rect<s32> TriangleRect; - - s32 leftZValue, rightZValue; - s32 leftZStep, rightZStep; - s32 spanZValue, spanZStep; // ZValues when drawing a span - TZBufferType* zTarget, *spanZTarget; // target of ZBuffer; - - lockedSurface = (u16*)RenderTarget->getData(); - lockedZBuffer = ZBuffer->lock(); - lockedTexture = (u16*)Texture->getData(); - - for (s32 i=0; i<triangleCount; ++i) - { - v1 = &vertices[*indexList]; - ++indexList; - v2 = &vertices[*indexList]; - ++indexList; - v3 = &vertices[*indexList]; - ++indexList; - - // back face culling - - if (BackFaceCullingEnabled) - { - s32 z = ((v3->Pos.X - v1->Pos.X) * (v3->Pos.Y - v2->Pos.Y)) - - ((v3->Pos.Y - v1->Pos.Y) * (v3->Pos.X - v2->Pos.X)); - - if (z < 0) - continue; - } - - //near plane clipping - - if (v1->ZValue<0 && v2->ZValue<0 && v3->ZValue<0) - continue; - - // sort for width for inscreen clipping - - if (v1->Pos.X > v2->Pos.X) swapVertices(&v1, &v2); - if (v1->Pos.X > v3->Pos.X) swapVertices(&v1, &v3); - if (v2->Pos.X > v3->Pos.X) swapVertices(&v2, &v3); - - if ((v1->Pos.X - v3->Pos.X) == 0) - continue; - - TriangleRect.UpperLeftCorner.X = v1->Pos.X; - TriangleRect.LowerRightCorner.X = v3->Pos.X; - - // sort for height for faster drawing. - - if (v1->Pos.Y > v2->Pos.Y) swapVertices(&v1, &v2); - if (v1->Pos.Y > v3->Pos.Y) swapVertices(&v1, &v3); - if (v2->Pos.Y > v3->Pos.Y) swapVertices(&v2, &v3); - - TriangleRect.UpperLeftCorner.Y = v1->Pos.Y; - TriangleRect.LowerRightCorner.Y = v3->Pos.Y; - - if (!TriangleRect.isRectCollided(ViewPortRect)) - continue; - - // calculate height of triangle - height = v3->Pos.Y - v1->Pos.Y; - if (!height) - continue; - - // calculate longest span - - longest = (v2->Pos.Y - v1->Pos.Y) / (f32)height * (v3->Pos.X - v1->Pos.X) + (v1->Pos.X - v2->Pos.X); - - spanEnd = v2->Pos.Y; - span = v1->Pos.Y; - leftxf = (f32)v1->Pos.X; - rightxf = (f32)v1->Pos.X; - - leftZValue = v1->ZValue; - rightZValue = v1->ZValue; - - leftR = rightR = video::getRed(v1->Color)<<8; - leftG = rightG = video::getGreen(v1->Color)<<8; - leftB = rightB = video::getBlue(v1->Color)<<8; - leftTx = rightTx = v1->TCoords.X; - leftTy = rightTy = v1->TCoords.Y; - - targetSurface = lockedSurface + span * SurfaceWidth; - zTarget = lockedZBuffer + span * SurfaceWidth; - - if (longest < 0.0f) - { - tmpDiv = 1.0f / (f32)(v2->Pos.Y - v1->Pos.Y); - rightdeltaxf = (v2->Pos.X - v1->Pos.X) * tmpDiv; - rightZStep = (s32)((v2->ZValue - v1->ZValue) * tmpDiv); - rightStepR = (s32)(((s32)(video::getRed(v2->Color)<<8) - rightR) * tmpDiv); - rightStepG = (s32)(((s32)(video::getGreen(v2->Color)<<8) - rightG) * tmpDiv); - rightStepB = (s32)(((s32)(video::getBlue(v2->Color)<<8) - rightB) * tmpDiv); - rightTxStep = (s32)((v2->TCoords.X - rightTx) * tmpDiv); - rightTyStep = (s32)((v2->TCoords.Y - rightTy) * tmpDiv); - - tmpDiv = 1.0f / (f32)height; - leftdeltaxf = (v3->Pos.X - v1->Pos.X) * tmpDiv; - leftZStep = (s32)((v3->ZValue - v1->ZValue) * tmpDiv); - leftStepR = (s32)(((s32)(video::getRed(v3->Color)<<8) - leftR) * tmpDiv); - leftStepG = (s32)(((s32)(video::getGreen(v3->Color)<<8) - leftG) * tmpDiv); - leftStepB = (s32)(((s32)(video::getBlue(v3->Color)<<8) - leftB) * tmpDiv); - leftTxStep = (s32)((v3->TCoords.X - leftTx) * tmpDiv); - leftTyStep = (s32)((v3->TCoords.Y - leftTy) * tmpDiv); - } - else - { - tmpDiv = 1.0f / (f32)height; - rightdeltaxf = (v3->Pos.X - v1->Pos.X) * tmpDiv; - rightZStep = (s32)((v3->ZValue - v1->ZValue) * tmpDiv); - rightStepR = (s32)(((s32)(video::getRed(v3->Color)<<8) - rightR) * tmpDiv); - rightStepG = (s32)(((s32)(video::getGreen(v3->Color)<<8) - rightG) * tmpDiv); - rightStepB = (s32)(((s32)(video::getBlue(v3->Color)<<8) - rightB) * tmpDiv); - rightTxStep = (s32)((v3->TCoords.X - rightTx) * tmpDiv); - rightTyStep = (s32)((v3->TCoords.Y - rightTy) * tmpDiv); - - tmpDiv = 1.0f / (f32)(v2->Pos.Y - v1->Pos.Y); - leftdeltaxf = (v2->Pos.X - v1->Pos.X) * tmpDiv; - leftZStep = (s32)((v2->ZValue - v1->ZValue) * tmpDiv); - leftStepR = (s32)(((s32)(video::getRed(v2->Color)<<8) - leftR) * tmpDiv); - leftStepG = (s32)(((s32)(video::getGreen(v2->Color)<<8) - leftG) * tmpDiv); - leftStepB = (s32)(((s32)(video::getBlue(v2->Color)<<8) - leftB) * tmpDiv); - leftTxStep = (s32)((v2->TCoords.X - leftTx) * tmpDiv); - leftTyStep = (s32)((v2->TCoords.Y - leftTy) * tmpDiv); - } - - - // do it twice, once for the first half of the triangle, - // end then for the second half. - - for (s32 triangleHalf=0; triangleHalf<2; ++triangleHalf) - { - if (spanEnd > ViewPortRect.LowerRightCorner.Y) - spanEnd = ViewPortRect.LowerRightCorner.Y; - - // if the span <0, than we can skip these spans, - // and proceed to the next spans which are really on the screen. - if (span < ViewPortRect.UpperLeftCorner.Y) - { - // we'll use leftx as temp variable - if (spanEnd < ViewPortRect.UpperLeftCorner.Y) - { - leftx = spanEnd - span; - span = spanEnd; - } - else - { - leftx = ViewPortRect.UpperLeftCorner.Y - span; - span = ViewPortRect.UpperLeftCorner.Y; - } - - leftxf += leftdeltaxf*leftx; - rightxf += rightdeltaxf*leftx; - targetSurface += SurfaceWidth*leftx; - zTarget += SurfaceWidth*leftx; - leftZValue += leftZStep*leftx; - rightZValue += rightZStep*leftx; - - leftR += leftStepR*leftx; - leftG += leftStepG*leftx; - leftB += leftStepB*leftx; - rightR += rightStepR*leftx; - rightG += rightStepG*leftx; - rightB += rightStepB*leftx; - - leftTx += leftTxStep*leftx; - leftTy += leftTyStep*leftx; - rightTx += rightTxStep*leftx; - rightTy += rightTyStep*leftx; - } - - - // the main loop. Go through every span and draw it. - - while (span < spanEnd) - { - leftx = (s32)(leftxf); - rightx = (s32)(rightxf + 0.5f); - - // perform some clipping - // thanks to a correction by hybrid - // calculations delayed to correctly propagate to textures etc. - s32 tDiffLeft=0, tDiffRight=0; - if (leftx<ViewPortRect.UpperLeftCorner.X) - tDiffLeft=ViewPortRect.UpperLeftCorner.X-leftx; - else - if (leftx>ViewPortRect.LowerRightCorner.X) - tDiffLeft=ViewPortRect.LowerRightCorner.X-leftx; - - if (rightx<ViewPortRect.UpperLeftCorner.X) - tDiffRight=ViewPortRect.UpperLeftCorner.X-rightx; - else - if (rightx>ViewPortRect.LowerRightCorner.X) - tDiffRight=ViewPortRect.LowerRightCorner.X-rightx; - - // draw the span - if (rightx + tDiffRight - leftx - tDiffLeft) - { - tmpDiv = 1.0f / (f32)(rightx - leftx); - spanZStep = (s32)((rightZValue - leftZValue) * tmpDiv); - spanZValue = leftZValue+tDiffLeft*spanZStep; - - spanStepR = (s32)((rightR - leftR) * tmpDiv); - spanR = leftR+tDiffLeft*spanStepR; - spanStepG = (s32)((rightG - leftG) * tmpDiv); - spanG = leftG+tDiffLeft*spanStepG; - spanStepB = (s32)((rightB - leftB) * tmpDiv); - spanB = leftB+tDiffLeft*spanStepB; - - spanTxStep = (s32)((rightTx - leftTx) * tmpDiv); - spanTx = leftTx + tDiffLeft*spanTxStep; - spanTyStep = (s32)((rightTy - leftTy) * tmpDiv); - spanTy = leftTy+tDiffLeft*spanTyStep; - - hSpanBegin = targetSurface + leftx+tDiffLeft; - spanZTarget = zTarget + leftx+tDiffLeft; - hSpanEnd = targetSurface + rightx+tDiffRight; - - while (hSpanBegin < hSpanEnd) - { - if (spanZValue > *spanZTarget) - { - *spanZTarget = spanZValue; - u16 color = lockedTexture[((spanTy>>8)&textureYMask) * lockedTextureWidth + ((spanTx>>8)&textureXMask)]; - *hSpanBegin = video::RGB16(video::getRed(color) * (spanR>>8) >>2, - video::getGreen(color) * (spanG>>8) >>2, - video::getBlue(color) * (spanB>>8) >>2); - } - - spanR += spanStepR; - spanG += spanStepG; - spanB += spanStepB; - - spanTx += spanTxStep; - spanTy += spanTyStep; - - spanZValue += spanZStep; - ++hSpanBegin; - ++spanZTarget; - } - } - - leftxf += leftdeltaxf; - rightxf += rightdeltaxf; - ++span; - targetSurface += SurfaceWidth; - zTarget += SurfaceWidth; - leftZValue += leftZStep; - rightZValue += rightZStep; - - leftR += leftStepR; - leftG += leftStepG; - leftB += leftStepB; - rightR += rightStepR; - rightG += rightStepG; - rightB += rightStepB; - - leftTx += leftTxStep; - leftTy += leftTyStep; - rightTx += rightTxStep; - rightTy += rightTyStep; - } - - if (triangleHalf>0) // break, we've gout only two halves - break; - - - // setup variables for second half of the triangle. - - if (longest < 0.0f) - { - tmpDiv = 1.0f / (v3->Pos.Y - v2->Pos.Y); - - rightdeltaxf = (v3->Pos.X - v2->Pos.X) * tmpDiv; - rightxf = (f32)v2->Pos.X; - - rightZValue = v2->ZValue; - rightZStep = (s32)((v3->ZValue - v2->ZValue) * tmpDiv); - - rightR = video::getRed(v2->Color)<<8; - rightG = video::getGreen(v2->Color)<<8; - rightB = video::getBlue(v2->Color)<<8; - rightStepR = (s32)(((s32)(video::getRed(v3->Color)<<8) - rightR) * tmpDiv); - rightStepG = (s32)(((s32)(video::getGreen(v3->Color)<<8) - rightG) * tmpDiv); - rightStepB = (s32)(((s32)(video::getBlue(v3->Color)<<8) - rightB) * tmpDiv); - - rightTx = v2->TCoords.X; - rightTy = v2->TCoords.Y; - rightTxStep = (s32)((v3->TCoords.X - rightTx) * tmpDiv); - rightTyStep = (s32)((v3->TCoords.Y - rightTy) * tmpDiv); - } - else - { - tmpDiv = 1.0f / (v3->Pos.Y - v2->Pos.Y); - - leftdeltaxf = (v3->Pos.X - v2->Pos.X) * tmpDiv; - leftxf = (f32)v2->Pos.X; - - leftZValue = v2->ZValue; - leftZStep = (s32)((v3->ZValue - v2->ZValue) * tmpDiv); - - leftR = video::getRed(v2->Color)<<8; - leftG = video::getGreen(v2->Color)<<8; - leftB = video::getBlue(v2->Color)<<8; - leftStepR = (s32)(((s32)(video::getRed(v3->Color)<<8) - leftR) * tmpDiv); - leftStepG = (s32)(((s32)(video::getGreen(v3->Color)<<8) - leftG) * tmpDiv); - leftStepB = (s32)(((s32)(video::getBlue(v3->Color)<<8) - leftB) * tmpDiv); - - leftTx = v2->TCoords.X; - leftTy = v2->TCoords.Y; - leftTxStep = (s32)((v3->TCoords.X - leftTx) * tmpDiv); - leftTyStep = (s32)((v3->TCoords.Y - leftTy) * tmpDiv); - } - - - spanEnd = v3->Pos.Y; - } - - } - - ZBuffer->unlock(); -} - - -} // end namespace video -} // end namespace irr - -#endif // _IRR_COMPILE_WITH_SOFTWARE_ - -namespace irr -{ -namespace video -{ - -//! creates a flat triangle renderer -ITriangleRenderer* createTriangleRendererTextureGouraud(IZBuffer* zbuffer) -{ - #ifdef _IRR_COMPILE_WITH_SOFTWARE_ - return new CTRTextureGouraud(zbuffer); - #else - return 0; - #endif // _IRR_COMPILE_WITH_SOFTWARE_ -} - - -} // end namespace video -} // end namespace irr - - diff --git a/source/Irrlicht/CTRTextureGouraud.h b/source/Irrlicht/CTRTextureGouraud.h deleted file mode 100644 index 02cc6033..00000000 --- a/source/Irrlicht/CTRTextureGouraud.h +++ /dev/null @@ -1,85 +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_TRIANGLE_RENDERER_TEXTURE_GOURAUD_H_INCLUDED__ -#define __C_TRIANGLE_RENDERER_TEXTURE_GOURAUD_H_INCLUDED__ - -#include "IrrCompileConfig.h" - -#ifndef _IRR_COMPILE_WITH_SOFTWARE_ -// forward declarations for create methods -namespace irr -{ -namespace video -{ - class ITriangleRenderer; - class IZBuffer; -} // end namespace video -} // end namespace irr - -#else - -#include "ITriangleRenderer.h" -#include "IImage.h" - -namespace irr -{ -namespace video -{ - //! CTRTextureGouraud class - class CTRTextureGouraud : public ITriangleRenderer - { - public: - - //! constructor - CTRTextureGouraud(IZBuffer* zbuffer); - - //! destructor - virtual ~CTRTextureGouraud(); - - //! sets a render target - virtual void setRenderTarget(video::IImage* surface, const core::rect<s32>& viewPort) _IRR_OVERRIDE_; - - //! draws an indexed triangle list - virtual void drawIndexedTriangleList(S2DVertex* vertices, s32 vertexCount, const u16* indexList, s32 triangleCount) _IRR_OVERRIDE_; - - //! en or disables the backface culling - virtual void setBackfaceCulling(bool enabled = true) _IRR_OVERRIDE_; - - //! sets the Texture - virtual void setTexture(video::IImage* texture) _IRR_OVERRIDE_; - - protected: - - //! vertauscht zwei vertizen - inline void swapVertices(const S2DVertex** v1, const S2DVertex** v2) - { - const S2DVertex* b = *v1; - *v1 = *v2; - *v2 = b; - } - - video::IImage* RenderTarget; - core::rect<s32> ViewPortRect; - - IZBuffer* ZBuffer; - - s32 SurfaceWidth; - s32 SurfaceHeight; - bool BackFaceCullingEnabled; - TZBufferType* lockedZBuffer; - u16* lockedSurface; - u16* lockedTexture; - s32 lockedTextureWidth; - s32 textureXMask, textureYMask; - video::IImage* Texture; - }; - -} // end namespace video -} // end namespace irr - -#endif - -#endif - diff --git a/source/Irrlicht/CTRTextureGouraud2.cpp b/source/Irrlicht/CTRTextureGouraud2.cpp deleted file mode 100644 index 1cd7bd18..00000000 --- a/source/Irrlicht/CTRTextureGouraud2.cpp +++ /dev/null @@ -1,912 +0,0 @@ -// Copyright (C) 2002-2012 Nikolaus Gebhardt / Thomas Alten -// This file is part of the "Irrlicht Engine". -// For conditions of distribution and use, see copyright notice in irrlicht.h - -#include "IrrCompileConfig.h" -#include "IBurningShader.h" - -#ifdef _IRR_COMPILE_WITH_BURNINGSVIDEO_ - -// compile flag for this file -#undef USE_ZBUFFER -#undef IPOL_Z -#undef CMP_Z -#undef WRITE_Z - -#undef IPOL_W -#undef CMP_W -#undef WRITE_W - -#undef SUBTEXEL -#undef INVERSE_W - -#undef IPOL_C0 -#undef IPOL_C1 -#undef IPOL_C2 -#undef IPOL_T0 -#undef IPOL_T1 -#undef IPOL_L0 - -// define render case -#define SUBTEXEL -#define INVERSE_W - -#define USE_ZBUFFER -#define IPOL_W -#define CMP_W -#define WRITE_W - -#define IPOL_C0 -#define IPOL_C1 -//#define IPOL_C2 -#define IPOL_T0 -//#define IPOL_T1 -//#define IPOL_L0 - -// apply global override -#ifndef SOFTWARE_DRIVER_2_PERSPECTIVE_CORRECT - #undef INVERSE_W -#endif - -#ifndef SOFTWARE_DRIVER_2_SUBTEXEL - #undef SUBTEXEL -#endif - -#if BURNING_MATERIAL_MAX_COLORS < 1 - #undef IPOL_C0 -#endif - -#if BURNING_MATERIAL_MAX_COLORS < 2 - #undef IPOL_C1 -#endif - -#if BURNING_MATERIAL_MAX_COLORS < 3 -#undef IPOL_C2 -#endif - -#if BURNING_MATERIAL_MAX_LIGHT_TANGENT < 1 - #undef IPOL_L0 -#endif - - -#if !defined ( SOFTWARE_DRIVER_2_USE_WBUFFER ) && defined ( USE_ZBUFFER ) - #ifndef SOFTWARE_DRIVER_2_PERSPECTIVE_CORRECT - #undef IPOL_W - #endif - #define IPOL_Z - - #ifdef CMP_W - #undef CMP_W - #define CMP_Z - #endif - - #ifdef WRITE_W - #undef WRITE_W - #define WRITE_Z - #endif - -#endif - - -namespace irr -{ - -namespace video -{ - -class CTRTextureGouraud2 : public IBurningShader -{ -public: - - //! constructor - CTRTextureGouraud2(CBurningVideoDriver* driver); - - //! draws an indexed triangle list - virtual void drawTriangle(const s4DVertex* burning_restrict a, const s4DVertex* burning_restrict b, const s4DVertex* burning_restrict c) _IRR_OVERRIDE_; - virtual bool canWireFrame () { return true; } - - -private: - void fragmentShader (); -}; - -//! constructor -CTRTextureGouraud2::CTRTextureGouraud2(CBurningVideoDriver* driver) -: IBurningShader(driver) -{ - #ifdef _DEBUG - setDebugName("CTRTextureGouraud2"); - #endif -} - - - -/*! -*/ -void CTRTextureGouraud2::fragmentShader () -{ - tVideoSample *dst; - -#ifdef USE_ZBUFFER - fp24 *z; -#endif - - s32 xStart; - s32 xEnd; - s32 dx; - - -#ifdef SUBTEXEL - f32 subPixel; -#endif - -#ifdef IPOL_Z - f32 slopeZ; -#endif -#ifdef IPOL_W - fp24 slopeW; -#endif -#ifdef IPOL_C0 - sVec4 slopeC[BURNING_MATERIAL_MAX_COLORS]; -#endif -#ifdef IPOL_T0 - sVec2 slopeT[BURNING_MATERIAL_MAX_TEXTURES]; -#endif - -#ifdef IPOL_L0 - sVec3Pack_unpack slopeL[BURNING_MATERIAL_MAX_LIGHT_TANGENT]; -#endif - - // apply top-left fill-convention, left - xStart = fill_convention_left( line.x[0] ); - xEnd = fill_convention_right( line.x[1] ); - - dx = xEnd - xStart; - - if ( dx < 0 ) - return; - - // slopes - const f32 invDeltaX = fill_step_x( line.x[1] - line.x[0] ); - -#ifdef IPOL_Z - slopeZ = (line.z[1] - line.z[0]) * invDeltaX; -#endif -#ifdef IPOL_W - slopeW = (line.w[1] - line.w[0]) * invDeltaX; -#endif -#ifdef IPOL_C0 - slopeC[0] = (line.c[0][1] - line.c[0][0]) * invDeltaX; -#endif -#ifdef IPOL_C1 - slopeC[1] = (line.c[1][1] - line.c[1][0]) * invDeltaX; -#endif -#ifdef IPOL_C2 - slopeC[2] = (line.c[2][1] - line.c[2][0]) * invDeltaX; -#endif -#ifdef IPOL_T0 - slopeT[0] = (line.t[0][1] - line.t[0][0]) * invDeltaX; -#endif -#ifdef IPOL_T1 - slopeT[1] = (line.t[1][1] - line.t[1][0]) * invDeltaX; -#endif -#ifdef IPOL_L0 - slopeL[0] = (line.l[0][1] - line.l[0][0]) * invDeltaX; -#endif - - -#ifdef SUBTEXEL - subPixel = ( (f32) xStart ) - line.x[0]; -#ifdef IPOL_Z - line.z[0] += slopeZ * subPixel; -#endif -#ifdef IPOL_W - line.w[0] += slopeW * subPixel; -#endif -#ifdef IPOL_C0 - line.c[0][0] += slopeC[0] * subPixel; -#endif -#ifdef IPOL_C1 - line.c[1][0] += slopeC[1] * subPixel; -#endif -#ifdef IPOL_C2 - line.c[2][0] += slopeC[2] * subPixel; -#endif -#ifdef IPOL_T0 - line.t[0][0] += slopeT[0] * subPixel; -#endif -#ifdef IPOL_T1 - line.t[1][0] += slopeT[1] * subPixel; -#endif -#ifdef IPOL_L0 - line.l[0][0] += slopeL[0] * subPixel; -#endif -#endif - - SOFTWARE_DRIVER_2_CLIPCHECK; - dst = (tVideoSample*)RenderTarget->getData() + ( line.y * RenderTarget->getDimension().Width ) + xStart; - -#ifdef USE_ZBUFFER - z = (fp24*) DepthBuffer->lock() + ( line.y * RenderTarget->getDimension().Width ) + xStart; -#endif - - - f32 inversew = FIX_POINT_F32_MUL; - - tFixPoint tx0; - tFixPoint ty0; - -#ifdef IPOL_C0 - tFixPoint r0, g0, b0; - tFixPoint r1, g1, b1; -#endif - -#ifdef IPOL_C1 - tFixPoint aFog = FIX_POINT_ONE; -#endif - - -#ifdef IPOL_C2 - tFixPoint r3, g3, b3; -#endif - -#if defined(BURNINGVIDEO_RENDERER_FAST) && COLOR_MAX==0xff - u32 dIndex = ( line.y & 3 ) << 2; -#endif - - for ( s32 i = 0; i <= dx; i += SOFTWARE_DRIVER_2_STEP_X) - { - //if test active only first pixel - if ((0 == EdgeTestPass) & (i > line.x_edgetest)) break; - -#ifdef CMP_Z - if ( line.z[0] < z[i] ) -#endif -#ifdef CMP_W - if ( line.w[0] >= z[i] ) -#endif - { -#ifdef WRITE_Z - z[i] = line.z[0]; -#endif -#ifdef WRITE_W - z[i] = line.w[0]; -#endif - -#ifdef INVERSE_W - inversew = fix_inverse32 ( line.w[0] ); -#endif - -#ifdef IPOL_C1 - //complete inside fog - if (TL_Flag & TL_FOG) - { - aFog = tofix(line.c[1][0].a, inversew); - if (aFog <= 0) - { - dst[i] = fog_color_sample; - continue; - } - } -#endif - tx0 = tofix ( line.t[0][0].x, inversew); - ty0 = tofix ( line.t[0][0].y, inversew); - - -#ifdef IPOL_C0 - - getSample_texture(r0, g0, b0, &IT[0], tx0, ty0); - vec4_to_fix(r1, g1, b1, line.c[0][0], inversew); - - r0 = imulFix_simple(r0, r1); - g0 = imulFix_simple(g0, g1); - b0 = imulFix_simple(b0, b1); - -#ifdef IPOL_C1 - - //specular highlight - if (TL_Flag & TL_SPECULAR) - { - vec4_to_fix(r1, g1, b1, line.c[1][0], inversew*COLOR_MAX); - r0 = clampfix_maxcolor(r1 + r0); - g0 = clampfix_maxcolor(g1 + g0); - b0 = clampfix_maxcolor(b1 + b0); - } - //mix with distance - if (aFog < FIX_POINT_ONE) - { - r0 = fog_color[1] + imulFix(aFog, r0 - fog_color[1]); - g0 = fog_color[2] + imulFix(aFog, g0 - fog_color[2]); - b0 = fog_color[3] + imulFix(aFog, b0 - fog_color[3]); - } - dst[i] = fix_to_sample(r0, g0, b0); - -#else - dst[i] = fix_to_sample( - imulFix_simple(r0, r1), - imulFix_simple(g0, g1), - imulFix_simple(b0, b1) - ); -#endif - -#else - -#if defined(BURNINGVIDEO_RENDERER_FAST) && COLOR_MAX==0xff - const tFixPointu d = dithermask [ dIndex | ( i ) & 3 ]; - dst[i] = getTexel_plain ( &IT[0], d + tx0, d + ty0 ); -#else - getSample_texture ( r0, g0, b0, &IT[0], tx0,ty0 ); - dst[i] = fix_to_sample( r0, g0, b0 ); -#endif - -#endif - - } - -#ifdef IPOL_Z - line.z[0] += slopeZ; -#endif -#ifdef IPOL_W - line.w[0] += slopeW; -#endif -#ifdef IPOL_C0 - line.c[0][0] += slopeC[0]; -#endif -#ifdef IPOL_C1 - line.c[1][0] += slopeC[1]; -#endif -#ifdef IPOL_C2 - line.c[2][0] += slopeC[2]; -#endif -#ifdef IPOL_T0 - line.t[0][0] += slopeT[0]; -#endif -#ifdef IPOL_T1 - line.t[1][0] += slopeT[1]; -#endif -#ifdef IPOL_L0 - line.l[0][0] += slopeL[0]; -#endif - } - -} - -void CTRTextureGouraud2::drawTriangle(const s4DVertex* burning_restrict a, const s4DVertex* burning_restrict b, const s4DVertex* burning_restrict c) -{ - // sort on height, y - if ( F32_A_GREATER_B ( a->Pos.y , b->Pos.y ) ) swapVertexPointer(&a, &b); - if ( F32_A_GREATER_B ( b->Pos.y , c->Pos.y ) ) swapVertexPointer(&b, &c); - if ( F32_A_GREATER_B ( a->Pos.y , b->Pos.y ) ) swapVertexPointer(&a, &b); - - const f32 ca = c->Pos.y - a->Pos.y; - const f32 ba = b->Pos.y - a->Pos.y; - const f32 cb = c->Pos.y - b->Pos.y; - // calculate delta y of the edges - scan.invDeltaY[0] = fill_step_y( ca ); - scan.invDeltaY[1] = fill_step_y( ba ); - scan.invDeltaY[2] = fill_step_y( cb ); - - if ( F32_LOWER_EQUAL_0 ( scan.invDeltaY[0] ) ) - return; - - // find if the major edge is left or right aligned - f32 temp[4]; - - temp[0] = a->Pos.x - c->Pos.x; - temp[1] = -ca; - temp[2] = b->Pos.x - a->Pos.x; - temp[3] = ba; - - scan.left = ( temp[0] * temp[3] - temp[1] * temp[2] ) > 0.f ? 0 : 1; - scan.right = 1 - scan.left; - - // calculate slopes for the major edge - scan.slopeX[0] = (c->Pos.x - a->Pos.x) * scan.invDeltaY[0]; - scan.x[0] = a->Pos.x; - -#ifdef IPOL_Z - scan.slopeZ[0] = (c->Pos.z - a->Pos.z) * scan.invDeltaY[0]; - scan.z[0] = a->Pos.z; -#endif - -#ifdef IPOL_W - scan.slopeW[0] = (c->Pos.w - a->Pos.w) * scan.invDeltaY[0]; - scan.w[0] = a->Pos.w; -#endif - -#ifdef IPOL_C0 - scan.slopeC[0][0] = (c->Color[0] - a->Color[0]) * scan.invDeltaY[0]; - scan.c[0][0] = a->Color[0]; -#endif - -#ifdef IPOL_C1 - scan.slopeC[1][0] = (c->Color[1] - a->Color[1]) * scan.invDeltaY[0]; - scan.c[1][0] = a->Color[1]; -#endif - -#ifdef IPOL_C2 - scan.slopeC[2][0] = (c->Color[2] - a->Color[2]) * scan.invDeltaY[0]; - scan.c[2][0] = a->Color[2]; -#endif - -#ifdef IPOL_T0 - scan.slopeT[0][0] = (c->Tex[0] - a->Tex[0]) * scan.invDeltaY[0]; - scan.t[0][0] = a->Tex[0]; -#endif - -#ifdef IPOL_T1 - scan.slopeT[1][0] = (c->Tex[1] - a->Tex[1]) * scan.invDeltaY[0]; - scan.t[1][0] = a->Tex[1]; -#endif - -#ifdef IPOL_L0 - scan.slopeL[0][0] = (c->LightTangent[0] - a->LightTangent[0]) * scan.invDeltaY[0]; - scan.l[0][0] = a->LightTangent[0]; -#endif - - // top left fill convention y run - s32 yStart; - s32 yEnd; - -#ifdef SUBTEXEL - f32 subPixel; -#endif - - // rasterize upper sub-triangle - if ( F32_GREATER_0(scan.invDeltaY[1]) ) - { - // calculate slopes for top edge - scan.slopeX[1] = (b->Pos.x - a->Pos.x) * scan.invDeltaY[1]; - scan.x[1] = a->Pos.x; - -#ifdef IPOL_Z - scan.slopeZ[1] = (b->Pos.z - a->Pos.z) * scan.invDeltaY[1]; - scan.z[1] = a->Pos.z; -#endif - -#ifdef IPOL_W - scan.slopeW[1] = (b->Pos.w - a->Pos.w) * scan.invDeltaY[1]; - scan.w[1] = a->Pos.w; -#endif - -#ifdef IPOL_C0 - scan.slopeC[0][1] = (b->Color[0] - a->Color[0]) * scan.invDeltaY[1]; - scan.c[0][1] = a->Color[0]; -#endif - -#ifdef IPOL_C1 - scan.slopeC[1][1] = (b->Color[1] - a->Color[1]) * scan.invDeltaY[1]; - scan.c[1][1] = a->Color[1]; -#endif - -#ifdef IPOL_C2 - scan.slopeC[2][1] = (b->Color[2] - a->Color[2]) * scan.invDeltaY[1]; - scan.c[2][1] = a->Color[2]; -#endif - -#ifdef IPOL_T0 - scan.slopeT[0][1] = (b->Tex[0] - a->Tex[0]) * scan.invDeltaY[1]; - scan.t[0][1] = a->Tex[0]; -#endif - -#ifdef IPOL_T1 - scan.slopeT[1][1] = (b->Tex[1] - a->Tex[1]) * scan.invDeltaY[1]; - scan.t[1][1] = a->Tex[1]; -#endif - -#ifdef IPOL_L0 - scan.slopeL[0][1] = (b->LightTangent[0] - a->LightTangent[0]) * scan.invDeltaY[1]; - scan.l[0][1] = a->LightTangent[0]; -#endif - - // apply top-left fill convention, top part - yStart = fill_convention_left( a->Pos.y ); - yEnd = fill_convention_right( b->Pos.y ); - -#ifdef SUBTEXEL - subPixel = ( (f32) yStart ) - a->Pos.y; - - // correct to pixel center - scan.x[0] += scan.slopeX[0] * subPixel; - scan.x[1] += scan.slopeX[1] * subPixel; - -#ifdef IPOL_Z - scan.z[0] += scan.slopeZ[0] * subPixel; - scan.z[1] += scan.slopeZ[1] * subPixel; -#endif - -#ifdef IPOL_W - scan.w[0] += scan.slopeW[0] * subPixel; - scan.w[1] += scan.slopeW[1] * subPixel; -#endif - -#ifdef IPOL_C0 - scan.c[0][0] += scan.slopeC[0][0] * subPixel; - scan.c[0][1] += scan.slopeC[0][1] * subPixel; -#endif - -#ifdef IPOL_C1 - scan.c[1][0] += scan.slopeC[1][0] * subPixel; - scan.c[1][1] += scan.slopeC[1][1] * subPixel; -#endif - -#ifdef IPOL_C2 - scan.c[2][0] += scan.slopeC[2][0] * subPixel; - scan.c[2][1] += scan.slopeC[2][1] * subPixel; -#endif - -#ifdef IPOL_T0 - scan.t[0][0] += scan.slopeT[0][0] * subPixel; - scan.t[0][1] += scan.slopeT[0][1] * subPixel; -#endif - -#ifdef IPOL_T1 - scan.t[1][0] += scan.slopeT[1][0] * subPixel; - scan.t[1][1] += scan.slopeT[1][1] * subPixel; -#endif - -#ifdef IPOL_L0 - scan.l[0][0] += scan.slopeL[0][0] * subPixel; - scan.l[0][1] += scan.slopeL[0][1] * subPixel; -#endif - -#endif - line.x_edgetest = fill_convention_edge(scan.slopeX[scan.left]); - - // rasterize the edge scanlines - for( line.y = yStart; line.y <= yEnd; line.y += SOFTWARE_DRIVER_2_STEP_Y) - { - line.x[scan.left] = scan.x[0]; - line.x[scan.right] = scan.x[1]; - -#ifdef IPOL_Z - line.z[scan.left] = scan.z[0]; - line.z[scan.right] = scan.z[1]; -#endif - -#ifdef IPOL_W - line.w[scan.left] = scan.w[0]; - line.w[scan.right] = scan.w[1]; -#endif - -#ifdef IPOL_C0 - line.c[0][scan.left] = scan.c[0][0]; - line.c[0][scan.right] = scan.c[0][1]; -#endif - -#ifdef IPOL_C1 - line.c[1][scan.left] = scan.c[1][0]; - line.c[1][scan.right] = scan.c[1][1]; -#endif - -#ifdef IPOL_C2 - line.c[2][scan.left] = scan.c[2][0]; - line.c[2][scan.right] = scan.c[2][1]; -#endif - -#ifdef IPOL_T0 - line.t[0][scan.left] = scan.t[0][0]; - line.t[0][scan.right] = scan.t[0][1]; -#endif - -#ifdef IPOL_T1 - line.t[1][scan.left] = scan.t[1][0]; - line.t[1][scan.right] = scan.t[1][1]; -#endif - -#ifdef IPOL_L0 - line.l[0][scan.left] = scan.l[0][0]; - line.l[0][scan.right] = scan.l[0][1]; -#endif - - // render a scanline - interlace_scanline fragmentShader (); - if ( EdgeTestPass & edge_test_first_line ) break; - - - scan.x[0] += scan.slopeX[0]; - scan.x[1] += scan.slopeX[1]; - -#ifdef IPOL_Z - scan.z[0] += scan.slopeZ[0]; - scan.z[1] += scan.slopeZ[1]; -#endif - -#ifdef IPOL_W - scan.w[0] += scan.slopeW[0]; - scan.w[1] += scan.slopeW[1]; -#endif - -#ifdef IPOL_C0 - scan.c[0][0] += scan.slopeC[0][0]; - scan.c[0][1] += scan.slopeC[0][1]; -#endif - -#ifdef IPOL_C1 - scan.c[1][0] += scan.slopeC[1][0]; - scan.c[1][1] += scan.slopeC[1][1]; -#endif - -#ifdef IPOL_C2 - scan.c[2][0] += scan.slopeC[2][0]; - scan.c[2][1] += scan.slopeC[2][1]; -#endif - -#ifdef IPOL_T0 - scan.t[0][0] += scan.slopeT[0][0]; - scan.t[0][1] += scan.slopeT[0][1]; -#endif - -#ifdef IPOL_T1 - scan.t[1][0] += scan.slopeT[1][0]; - scan.t[1][1] += scan.slopeT[1][1]; -#endif - -#ifdef IPOL_L0 - scan.l[0][0] += scan.slopeL[0][0]; - scan.l[0][1] += scan.slopeL[0][1]; -#endif - - } - } - - // rasterize lower sub-triangle - if (F32_GREATER_0(scan.invDeltaY[2]) ) - { - // advance to middle point - if(F32_GREATER_0(scan.invDeltaY[1]) ) - { - temp[0] = b->Pos.y - a->Pos.y; // dy - - scan.x[0] = a->Pos.x + scan.slopeX[0] * temp[0]; -#ifdef IPOL_Z - scan.z[0] = a->Pos.z + scan.slopeZ[0] * temp[0]; -#endif -#ifdef IPOL_W - scan.w[0] = a->Pos.w + scan.slopeW[0] * temp[0]; -#endif -#ifdef IPOL_C0 - scan.c[0][0] = a->Color[0] + scan.slopeC[0][0] * temp[0]; -#endif -#ifdef IPOL_C1 - scan.c[1][0] = a->Color[1] + scan.slopeC[1][0] * temp[0]; -#endif -#ifdef IPOL_C2 - scan.c[2][0] = a->Color[2] + scan.slopeC[2][0] * temp[0]; -#endif -#ifdef IPOL_T0 - scan.t[0][0] = a->Tex[0] + scan.slopeT[0][0] * temp[0]; -#endif -#ifdef IPOL_T1 - scan.t[1][0] = a->Tex[1] + scan.slopeT[1][0] * temp[0]; -#endif - -#ifdef IPOL_L0 - scan.l[0][0] = sVec3Pack_unpack(a->LightTangent[0]) + scan.slopeL[0][0] * temp[0]; -#endif - } - - // calculate slopes for bottom edge - scan.slopeX[1] = (c->Pos.x - b->Pos.x) * scan.invDeltaY[2]; - scan.x[1] = b->Pos.x; - -#ifdef IPOL_Z - scan.slopeZ[1] = (c->Pos.z - b->Pos.z) * scan.invDeltaY[2]; - scan.z[1] = b->Pos.z; -#endif - -#ifdef IPOL_W - scan.slopeW[1] = (c->Pos.w - b->Pos.w) * scan.invDeltaY[2]; - scan.w[1] = b->Pos.w; -#endif - -#ifdef IPOL_C0 - scan.slopeC[0][1] = (c->Color[0] - b->Color[0]) * scan.invDeltaY[2]; - scan.c[0][1] = b->Color[0]; -#endif - -#ifdef IPOL_C1 - scan.slopeC[1][1] = (c->Color[1] - b->Color[1]) * scan.invDeltaY[2]; - scan.c[1][1] = b->Color[1]; -#endif - -#ifdef IPOL_C2 - scan.slopeC[2][1] = (c->Color[2] - b->Color[2]) * scan.invDeltaY[2]; - scan.c[2][1] = b->Color[2]; -#endif - -#ifdef IPOL_T0 - scan.slopeT[0][1] = (c->Tex[0] - b->Tex[0]) * scan.invDeltaY[2]; - scan.t[0][1] = b->Tex[0]; -#endif - -#ifdef IPOL_T1 - scan.slopeT[1][1] = (c->Tex[1] - b->Tex[1]) * scan.invDeltaY[2]; - scan.t[1][1] = b->Tex[1]; -#endif - -#ifdef IPOL_L0 - scan.slopeL[0][1] = (c->LightTangent[0] - b->LightTangent[0]) * scan.invDeltaY[2]; - scan.l[0][1] = b->LightTangent[0]; -#endif - - // apply top-left fill convention, top part - yStart = fill_convention_left( b->Pos.y ); - yEnd = fill_convention_right( c->Pos.y ); - -#ifdef SUBTEXEL - subPixel = ( (f32) yStart ) - b->Pos.y; - - // correct to pixel center - scan.x[0] += scan.slopeX[0] * subPixel; - scan.x[1] += scan.slopeX[1] * subPixel; - -#ifdef IPOL_Z - scan.z[0] += scan.slopeZ[0] * subPixel; - scan.z[1] += scan.slopeZ[1] * subPixel; -#endif - -#ifdef IPOL_W - scan.w[0] += scan.slopeW[0] * subPixel; - scan.w[1] += scan.slopeW[1] * subPixel; -#endif - -#ifdef IPOL_C0 - scan.c[0][0] += scan.slopeC[0][0] * subPixel; - scan.c[0][1] += scan.slopeC[0][1] * subPixel; -#endif - -#ifdef IPOL_C1 - scan.c[1][0] += scan.slopeC[1][0] * subPixel; - scan.c[1][1] += scan.slopeC[1][1] * subPixel; -#endif - -#ifdef IPOL_C2 - scan.c[2][0] += scan.slopeC[2][0] * subPixel; - scan.c[2][1] += scan.slopeC[2][1] * subPixel; -#endif - -#ifdef IPOL_T0 - scan.t[0][0] += scan.slopeT[0][0] * subPixel; - scan.t[0][1] += scan.slopeT[0][1] * subPixel; -#endif - -#ifdef IPOL_T1 - scan.t[1][0] += scan.slopeT[1][0] * subPixel; - scan.t[1][1] += scan.slopeT[1][1] * subPixel; -#endif - -#ifdef IPOL_L0 - scan.l[0][0] += scan.slopeL[0][0] * subPixel; - scan.l[0][1] += scan.slopeL[0][1] * subPixel; -#endif - -#endif - line.x_edgetest = fill_convention_edge(scan.slopeX[scan.left]); - - // rasterize the edge scanlines - for( line.y = yStart; line.y <= yEnd; line.y += SOFTWARE_DRIVER_2_STEP_Y) - { - line.x[scan.left] = scan.x[0]; - line.x[scan.right] = scan.x[1]; - -#ifdef IPOL_Z - line.z[scan.left] = scan.z[0]; - line.z[scan.right] = scan.z[1]; -#endif - -#ifdef IPOL_W - line.w[scan.left] = scan.w[0]; - line.w[scan.right] = scan.w[1]; -#endif - -#ifdef IPOL_C0 - line.c[0][scan.left] = scan.c[0][0]; - line.c[0][scan.right] = scan.c[0][1]; -#endif - -#ifdef IPOL_C1 - line.c[1][scan.left] = scan.c[1][0]; - line.c[1][scan.right] = scan.c[1][1]; -#endif - -#ifdef IPOL_C2 - line.c[2][scan.left] = scan.c[2][0]; - line.c[2][scan.right] = scan.c[2][1]; -#endif - -#ifdef IPOL_T0 - line.t[0][scan.left] = scan.t[0][0]; - line.t[0][scan.right] = scan.t[0][1]; -#endif - -#ifdef IPOL_T1 - line.t[1][scan.left] = scan.t[1][0]; - line.t[1][scan.right] = scan.t[1][1]; -#endif - -#ifdef IPOL_L0 - line.l[0][scan.left] = scan.l[0][0]; - line.l[0][scan.right] = scan.l[0][1]; -#endif - - // render a scanline - interlace_scanline fragmentShader (); - if ( EdgeTestPass & edge_test_first_line ) break; - - - scan.x[0] += scan.slopeX[0]; - scan.x[1] += scan.slopeX[1]; - -#ifdef IPOL_Z - scan.z[0] += scan.slopeZ[0]; - scan.z[1] += scan.slopeZ[1]; -#endif - -#ifdef IPOL_W - scan.w[0] += scan.slopeW[0]; - scan.w[1] += scan.slopeW[1]; -#endif - -#ifdef IPOL_C0 - scan.c[0][0] += scan.slopeC[0][0]; - scan.c[0][1] += scan.slopeC[0][1]; -#endif - -#ifdef IPOL_C1 - scan.c[1][0] += scan.slopeC[1][0]; - scan.c[1][1] += scan.slopeC[1][1]; -#endif - -#ifdef IPOL_C2 - scan.c[2][0] += scan.slopeC[2][0]; - scan.c[2][1] += scan.slopeC[2][1]; -#endif - -#ifdef IPOL_T0 - scan.t[0][0] += scan.slopeT[0][0]; - scan.t[0][1] += scan.slopeT[0][1]; -#endif - -#ifdef IPOL_T1 - scan.t[1][0] += scan.slopeT[1][0]; - scan.t[1][1] += scan.slopeT[1][1]; -#endif - -#ifdef IPOL_L0 - scan.l[0][0] += scan.slopeL[0][0]; - scan.l[0][1] += scan.slopeL[0][1]; -#endif - - } - } - -} - -} // end namespace video -} // end namespace irr - -#endif // _IRR_COMPILE_WITH_BURNINGSVIDEO_ - -namespace irr -{ -namespace video -{ - -//! creates a flat triangle renderer -IBurningShader* createTriangleRendererTextureGouraud2(CBurningVideoDriver* driver) -{ - // ETR_TEXTURE_GOURAUD - #ifdef _IRR_COMPILE_WITH_BURNINGSVIDEO_ - return new CTRTextureGouraud2(driver); - #else - return 0; - #endif // _IRR_COMPILE_WITH_BURNINGSVIDEO_ -} - - -} // end namespace video -} // end namespace irr - - - diff --git a/source/Irrlicht/CTRTextureGouraudAdd.cpp b/source/Irrlicht/CTRTextureGouraudAdd.cpp deleted file mode 100644 index 853bef27..00000000 --- a/source/Irrlicht/CTRTextureGouraudAdd.cpp +++ /dev/null @@ -1,417 +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" -#include "CTRTextureGouraud.h" - -#ifdef _IRR_COMPILE_WITH_SOFTWARE_ - -namespace irr -{ -namespace video -{ - -class CTRTextureGouraudAdd : public CTRTextureGouraud -{ -public: - - //! constructor - CTRTextureGouraudAdd(IZBuffer* zbuffer); - - //! draws an indexed triangle list - virtual void drawIndexedTriangleList(S2DVertex* vertices, s32 vertexCount, const u16* indexList, s32 triangleCount) _IRR_OVERRIDE_; - -protected: - -}; - -//! constructor -CTRTextureGouraudAdd::CTRTextureGouraudAdd(IZBuffer* zbuffer) -: CTRTextureGouraud(zbuffer) -{ - #ifdef _DEBUG - setDebugName("CTRTextureGouraudAdd"); - #endif -} - - -//! draws an indexed triangle list -void CTRTextureGouraudAdd::drawIndexedTriangleList(S2DVertex* vertices, s32 vertexCount, const u16* indexList, s32 triangleCount) -{ - const S2DVertex *v1, *v2, *v3; - - u16 color; - f32 tmpDiv; // temporary division factor - f32 longest; // saves the longest span - s32 height; // saves height of triangle - u16* targetSurface; // target pointer where to plot pixels - s32 spanEnd; // saves end of spans - f32 leftdeltaxf; // amount of pixels to increase on left side of triangle - f32 rightdeltaxf; // amount of pixels to increase on right side of triangle - s32 leftx, rightx; // position where we are - f32 leftxf, rightxf; // same as above, but as f32 values - s32 span; // current span - u16 *hSpanBegin, *hSpanEnd; // pointer used when plotting pixels - s32 leftR, leftG, leftB, rightR, rightG, rightB; // color values - s32 leftStepR, leftStepG, leftStepB, - rightStepR, rightStepG, rightStepB; // color steps - s32 spanR, spanG, spanB, spanStepR, spanStepG, spanStepB; // color interpolating values while drawing a span. - s32 leftTx, rightTx, leftTy, rightTy; // texture interpolating values - s32 leftTxStep, rightTxStep, leftTyStep, rightTyStep; // texture interpolating values - s32 spanTx, spanTy, spanTxStep, spanTyStep; // values of Texturecoords when drawing a span - core::rect<s32> TriangleRect; - - s32 leftZValue, rightZValue; - s32 leftZStep, rightZStep; - s32 spanZValue, spanZStep; // ZValues when drawing a span - TZBufferType* zTarget, *spanZTarget; // target of ZBuffer; - - lockedSurface = (u16*)RenderTarget->getData(); - lockedZBuffer = ZBuffer->lock(); - lockedTexture = (u16*)Texture->getData(); - - for (s32 i=0; i<triangleCount; ++i) - { - v1 = &vertices[*indexList]; - ++indexList; - v2 = &vertices[*indexList]; - ++indexList; - v3 = &vertices[*indexList]; - ++indexList; - - // back face culling - - if (BackFaceCullingEnabled) - { - s32 z = ((v3->Pos.X - v1->Pos.X) * (v3->Pos.Y - v2->Pos.Y)) - - ((v3->Pos.Y - v1->Pos.Y) * (v3->Pos.X - v2->Pos.X)); - - if (z < 0) - continue; - } - - //near plane clipping - - if (v1->ZValue<0 && v2->ZValue<0 && v3->ZValue<0) - continue; - - // sort for width for inscreen clipping - - if (v1->Pos.X > v2->Pos.X) swapVertices(&v1, &v2); - if (v1->Pos.X > v3->Pos.X) swapVertices(&v1, &v3); - if (v2->Pos.X > v3->Pos.X) swapVertices(&v2, &v3); - - if ((v1->Pos.X - v3->Pos.X) == 0) - continue; - - TriangleRect.UpperLeftCorner.X = v1->Pos.X; - TriangleRect.LowerRightCorner.X = v3->Pos.X; - - // sort for height for faster drawing. - - if (v1->Pos.Y > v2->Pos.Y) swapVertices(&v1, &v2); - if (v1->Pos.Y > v3->Pos.Y) swapVertices(&v1, &v3); - if (v2->Pos.Y > v3->Pos.Y) swapVertices(&v2, &v3); - - TriangleRect.UpperLeftCorner.Y = v1->Pos.Y; - TriangleRect.LowerRightCorner.Y = v3->Pos.Y; - - if (!TriangleRect.isRectCollided(ViewPortRect)) - continue; - - // calculate height of triangle - height = v3->Pos.Y - v1->Pos.Y; - if (!height) - continue; - - // calculate longest span - - longest = (v2->Pos.Y - v1->Pos.Y) / (f32)height * (v3->Pos.X - v1->Pos.X) + (v1->Pos.X - v2->Pos.X); - - spanEnd = v2->Pos.Y; - span = v1->Pos.Y; - leftxf = (f32)v1->Pos.X; - rightxf = (f32)v1->Pos.X; - - leftZValue = v1->ZValue; - rightZValue = v1->ZValue; - - leftR = rightR = video::getRed(v1->Color)<<8; - leftG = rightG = video::getGreen(v1->Color)<<8; - leftB = rightB = video::getBlue(v1->Color)<<8; - leftTx = rightTx = v1->TCoords.X; - leftTy = rightTy = v1->TCoords.Y; - - targetSurface = lockedSurface + span * SurfaceWidth; - zTarget = lockedZBuffer + span * SurfaceWidth; - - if (longest < 0.0f) - { - tmpDiv = 1.0f / (f32)(v2->Pos.Y - v1->Pos.Y); - rightdeltaxf = (v2->Pos.X - v1->Pos.X) * tmpDiv; - rightZStep = (s32)((v2->ZValue - v1->ZValue) * tmpDiv); - rightStepR = (s32)(((s32)(video::getRed(v2->Color)<<8) - rightR) * tmpDiv); - rightStepG = (s32)(((s32)(video::getGreen(v2->Color)<<8) - rightG) * tmpDiv); - rightStepB = (s32)(((s32)(video::getBlue(v2->Color)<<8) - rightB) * tmpDiv); - rightTxStep = (s32)((v2->TCoords.X - rightTx) * tmpDiv); - rightTyStep = (s32)((v2->TCoords.Y - rightTy) * tmpDiv); - - tmpDiv = 1.0f / (f32)height; - leftdeltaxf = (v3->Pos.X - v1->Pos.X) * tmpDiv; - leftZStep = (s32)((v3->ZValue - v1->ZValue) * tmpDiv); - leftStepR = (s32)(((s32)(video::getRed(v3->Color)<<8) - leftR) * tmpDiv); - leftStepG = (s32)(((s32)(video::getGreen(v3->Color)<<8) - leftG) * tmpDiv); - leftStepB = (s32)(((s32)(video::getBlue(v3->Color)<<8) - leftB) * tmpDiv); - leftTxStep = (s32)((v3->TCoords.X - leftTx) * tmpDiv); - leftTyStep = (s32)((v3->TCoords.Y - leftTy) * tmpDiv); - } - else - { - tmpDiv = 1.0f / (f32)height; - rightdeltaxf = (v3->Pos.X - v1->Pos.X) * tmpDiv; - rightZStep = (s32)((v3->ZValue - v1->ZValue) * tmpDiv); - rightStepR = (s32)(((s32)(video::getRed(v3->Color)<<8) - rightR) * tmpDiv); - rightStepG = (s32)(((s32)(video::getGreen(v3->Color)<<8) - rightG) * tmpDiv); - rightStepB = (s32)(((s32)(video::getBlue(v3->Color)<<8) - rightB) * tmpDiv); - rightTxStep = (s32)((v3->TCoords.X - rightTx) * tmpDiv); - rightTyStep = (s32)((v3->TCoords.Y - rightTy) * tmpDiv); - - tmpDiv = 1.0f / (f32)(v2->Pos.Y - v1->Pos.Y); - leftdeltaxf = (v2->Pos.X - v1->Pos.X) * tmpDiv; - leftZStep = (s32)((v2->ZValue - v1->ZValue) * tmpDiv); - leftStepR = (s32)(((s32)(video::getRed(v2->Color)<<8) - leftR) * tmpDiv); - leftStepG = (s32)(((s32)(video::getGreen(v2->Color)<<8) - leftG) * tmpDiv); - leftStepB = (s32)(((s32)(video::getBlue(v2->Color)<<8) - leftB) * tmpDiv); - leftTxStep = (s32)((v2->TCoords.X - leftTx) * tmpDiv); - leftTyStep = (s32)((v2->TCoords.Y - leftTy) * tmpDiv); - } - - - // do it twice, once for the first half of the triangle, - // end then for the second half. - - for (s32 triangleHalf=0; triangleHalf<2; ++triangleHalf) - { - if (spanEnd > ViewPortRect.LowerRightCorner.Y) - spanEnd = ViewPortRect.LowerRightCorner.Y; - - // if the span <0, than we can skip these spans, - // and proceed to the next spans which are really on the screen. - if (span < ViewPortRect.UpperLeftCorner.Y) - { - // we'll use leftx as temp variable - if (spanEnd < ViewPortRect.UpperLeftCorner.Y) - { - leftx = spanEnd - span; - span = spanEnd; - } - else - { - leftx = ViewPortRect.UpperLeftCorner.Y - span; - span = ViewPortRect.UpperLeftCorner.Y; - } - - leftxf += leftdeltaxf*leftx; - rightxf += rightdeltaxf*leftx; - targetSurface += SurfaceWidth*leftx; - zTarget += SurfaceWidth*leftx; - leftZValue += leftZStep*leftx; - rightZValue += rightZStep*leftx; - - leftR += leftStepR*leftx; - leftG += leftStepG*leftx; - leftB += leftStepB*leftx; - rightR += rightStepR*leftx; - rightG += rightStepG*leftx; - rightB += rightStepB*leftx; - - leftTx += leftTxStep*leftx; - leftTy += leftTyStep*leftx; - rightTx += rightTxStep*leftx; - rightTy += rightTyStep*leftx; - } - - - // the main loop. Go through every span and draw it. - - while (span < spanEnd) - { - leftx = (s32)(leftxf); - rightx = (s32)(rightxf + 0.5f); - - // perform some clipping - // thanks to a correction by hybrid - // calculations delayed to correctly propagate to textures etc. - s32 tDiffLeft=0, tDiffRight=0; - if (leftx<ViewPortRect.UpperLeftCorner.X) - tDiffLeft=ViewPortRect.UpperLeftCorner.X-leftx; - else - if (leftx>ViewPortRect.LowerRightCorner.X) - tDiffLeft=ViewPortRect.LowerRightCorner.X-leftx; - - if (rightx<ViewPortRect.UpperLeftCorner.X) - tDiffRight=ViewPortRect.UpperLeftCorner.X-rightx; - else - if (rightx>ViewPortRect.LowerRightCorner.X) - tDiffRight=ViewPortRect.LowerRightCorner.X-rightx; - - // draw the span - if (rightx + tDiffRight - leftx - tDiffLeft) - { - tmpDiv = 1.0f / (f32)(rightx - leftx); - spanZStep = (s32)((rightZValue - leftZValue) * tmpDiv); - spanZValue = leftZValue+tDiffLeft*spanZStep; - - spanStepR = (s32)((rightR - leftR) * tmpDiv); - spanR = leftR+tDiffLeft*spanStepR; - spanStepG = (s32)((rightG - leftG) * tmpDiv); - spanG = leftG+tDiffLeft*spanStepG; - spanStepB = (s32)((rightB - leftB) * tmpDiv); - spanB = leftB+tDiffLeft*spanStepB; - - spanTxStep = (s32)((rightTx - leftTx) * tmpDiv); - spanTx = leftTx + tDiffLeft*spanTxStep; - spanTyStep = (s32)((rightTy - leftTy) * tmpDiv); - spanTy = leftTy+tDiffLeft*spanTyStep; - - hSpanBegin = targetSurface + leftx+tDiffLeft; - spanZTarget = zTarget + leftx+tDiffLeft; - hSpanEnd = targetSurface + rightx+tDiffRight; - - while (hSpanBegin < hSpanEnd) - { - if (spanZValue > *spanZTarget) - { - //*spanZTarget = spanZValue; - color = lockedTexture[((spanTy>>8)&textureYMask) * lockedTextureWidth + ((spanTx>>8)&textureXMask)]; - - s32 basis = *hSpanBegin; - s32 r = (video::getRed(basis)<<3) + (video::getRed(color)<<3); - if (r > 255) r = 255; - s32 g = (video::getGreen(basis)<<3) + (video::getGreen(color)<<3); - if (g > 255) g = 255; - s32 b = (video::getBlue(basis)<<3) + (video::getBlue(color)<<3); - if (b > 255) b = 255; - - *hSpanBegin = video::RGB16(r, g, b); - } - - spanR += spanStepR; - spanG += spanStepG; - spanB += spanStepB; - - spanTx += spanTxStep; - spanTy += spanTyStep; - - spanZValue += spanZStep; - ++hSpanBegin; - ++spanZTarget; - } - } - - leftxf += leftdeltaxf; - rightxf += rightdeltaxf; - ++span; - targetSurface += SurfaceWidth; - zTarget += SurfaceWidth; - leftZValue += leftZStep; - rightZValue += rightZStep; - - leftR += leftStepR; - leftG += leftStepG; - leftB += leftStepB; - rightR += rightStepR; - rightG += rightStepG; - rightB += rightStepB; - - leftTx += leftTxStep; - leftTy += leftTyStep; - rightTx += rightTxStep; - rightTy += rightTyStep; - } - - if (triangleHalf>0) // break, we've gout only two halves - break; - - - // setup variables for second half of the triangle. - - if (longest < 0.0f) - { - tmpDiv = 1.0f / (v3->Pos.Y - v2->Pos.Y); - - rightdeltaxf = (v3->Pos.X - v2->Pos.X) * tmpDiv; - rightxf = (f32)v2->Pos.X; - - rightZValue = v2->ZValue; - rightZStep = (s32)((v3->ZValue - v2->ZValue) * tmpDiv); - - rightR = video::getRed(v2->Color)<<8; - rightG = video::getGreen(v2->Color)<<8; - rightB = video::getBlue(v2->Color)<<8; - rightStepR = (s32)(((s32)(video::getRed(v3->Color)<<8) - rightR) * tmpDiv); - rightStepG = (s32)(((s32)(video::getGreen(v3->Color)<<8) - rightG) * tmpDiv); - rightStepB = (s32)(((s32)(video::getBlue(v3->Color)<<8) - rightB) * tmpDiv); - - rightTx = v2->TCoords.X; - rightTy = v2->TCoords.Y; - rightTxStep = (s32)((v3->TCoords.X - rightTx) * tmpDiv); - rightTyStep = (s32)((v3->TCoords.Y - rightTy) * tmpDiv); - } - else - { - tmpDiv = 1.0f / (v3->Pos.Y - v2->Pos.Y); - - leftdeltaxf = (v3->Pos.X - v2->Pos.X) * tmpDiv; - leftxf = (f32)v2->Pos.X; - - leftZValue = v2->ZValue; - leftZStep = (s32)((v3->ZValue - v2->ZValue) * tmpDiv); - - leftR = video::getRed(v2->Color)<<8; - leftG = video::getGreen(v2->Color)<<8; - leftB = video::getBlue(v2->Color)<<8; - leftStepR = (s32)(((s32)(video::getRed(v3->Color)<<8) - leftR) * tmpDiv); - leftStepG = (s32)(((s32)(video::getGreen(v3->Color)<<8) - leftG) * tmpDiv); - leftStepB = (s32)(((s32)(video::getBlue(v3->Color)<<8) - leftB) * tmpDiv); - - leftTx = v2->TCoords.X; - leftTy = v2->TCoords.Y; - leftTxStep = (s32)((v3->TCoords.X - leftTx) * tmpDiv); - leftTyStep = (s32)((v3->TCoords.Y - leftTy) * tmpDiv); - } - - - spanEnd = v3->Pos.Y; - } - - } - - ZBuffer->unlock(); -} - -} // end namespace video -} // end namespace irr - -#endif // _IRR_COMPILE_WITH_SOFTWARE_ - -namespace irr -{ -namespace video -{ - -ITriangleRenderer* createTriangleRendererTextureGouraudAdd(IZBuffer* zbuffer) -{ - #ifdef _IRR_COMPILE_WITH_SOFTWARE_ - return new CTRTextureGouraudAdd(zbuffer); - #else - return 0; - #endif // _IRR_COMPILE_WITH_SOFTWARE_ -} - -} // end namespace video -} // end namespace irr - - - diff --git a/source/Irrlicht/CTRTextureGouraudAdd2.cpp b/source/Irrlicht/CTRTextureGouraudAdd2.cpp deleted file mode 100644 index 340cef59..00000000 --- a/source/Irrlicht/CTRTextureGouraudAdd2.cpp +++ /dev/null @@ -1,660 +0,0 @@ -// Copyright (C) 2002-2012 Nikolaus Gebhardt / Thomas Alten -// This file is part of the "Irrlicht Engine". -// For conditions of distribution and use, see copyright notice in irrlicht.h - -#include "IrrCompileConfig.h" -#include "IBurningShader.h" - -#ifdef _IRR_COMPILE_WITH_BURNINGSVIDEO_ - -// compile flag for this file -#undef USE_ZBUFFER -#undef IPOL_Z -#undef CMP_Z -#undef WRITE_Z - -#undef IPOL_W -#undef CMP_W -#undef WRITE_W - -#undef SUBTEXEL -#undef INVERSE_W - -#undef IPOL_C0 -#undef IPOL_T0 -#undef IPOL_T1 - -// define render case -#define SUBTEXEL -#define INVERSE_W - -#define USE_ZBUFFER -#define IPOL_W -#define CMP_W -#define WRITE_W - -//#define IPOL_C0 -#define IPOL_T0 -//#define IPOL_T1 - -// apply global override -#ifndef SOFTWARE_DRIVER_2_PERSPECTIVE_CORRECT - #undef INVERSE_W -#endif - -#ifndef SOFTWARE_DRIVER_2_SUBTEXEL - #undef SUBTEXEL -#endif - -#if BURNING_MATERIAL_MAX_COLORS < 1 - #undef IPOL_C0 -#endif - -#if !defined ( SOFTWARE_DRIVER_2_USE_WBUFFER ) && defined ( USE_ZBUFFER ) - #ifndef SOFTWARE_DRIVER_2_PERSPECTIVE_CORRECT - #undef IPOL_W - #endif - #define IPOL_Z - - #ifdef CMP_W - #undef CMP_W - #define CMP_Z - #endif - - #ifdef WRITE_W - #undef WRITE_W - #define WRITE_Z - #endif - -#endif - - - -namespace irr -{ - -namespace video -{ - -class CTRTextureGouraudAdd2 : public IBurningShader -{ -public: - - //! constructor - CTRTextureGouraudAdd2(CBurningVideoDriver* driver); - - //! draws an indexed triangle list - virtual void drawTriangle(const s4DVertex* burning_restrict a, const s4DVertex* burning_restrict b, const s4DVertex* burning_restrict c) _IRR_OVERRIDE_; - - -private: - void fragmentShader(); -}; - -//! constructor -CTRTextureGouraudAdd2::CTRTextureGouraudAdd2(CBurningVideoDriver* driver) -: IBurningShader(driver) -{ - #ifdef _DEBUG - setDebugName("CTRTextureGouraudAdd2"); - #endif -} - - - -/*! -*/ -void CTRTextureGouraudAdd2::fragmentShader() -{ - tVideoSample *dst; - -#ifdef USE_ZBUFFER - fp24 *z; -#endif - - s32 xStart; - s32 xEnd; - s32 dx; - - -#ifdef SUBTEXEL - f32 subPixel; -#endif - -#ifdef IPOL_Z - f32 slopeZ; -#endif -#ifdef IPOL_W - fp24 slopeW; -#endif -#ifdef IPOL_C0 - sVec4 slopeC; -#endif -#ifdef IPOL_T0 - sVec2 slopeT[BURNING_MATERIAL_MAX_TEXTURES]; -#endif - - // apply top-left fill-convention, left - xStart = fill_convention_left( line.x[0] ); - xEnd = fill_convention_right( line.x[1] ); - - dx = xEnd - xStart; - - if ( dx < 0 ) - return; - - // slopes - const f32 invDeltaX = fill_step_x( line.x[1] - line.x[0] ); - -#ifdef IPOL_Z - slopeZ = (line.z[1] - line.z[0]) * invDeltaX; -#endif -#ifdef IPOL_W - slopeW = (line.w[1] - line.w[0]) * invDeltaX; -#endif -#ifdef IPOL_C0 - slopeC = (line.c[1] - line.c[0]) * invDeltaX; -#endif -#ifdef IPOL_T0 - slopeT[0] = (line.t[0][1] - line.t[0][0]) * invDeltaX; -#endif -#ifdef IPOL_T1 - slopeT[1] = (line.t[1][1] - line.t[1][0]) * invDeltaX; -#endif - -#ifdef SUBTEXEL - subPixel = ( (f32) xStart ) - line.x[0]; -#ifdef IPOL_Z - line.z[0] += slopeZ * subPixel; -#endif -#ifdef IPOL_W - line.w[0] += slopeW * subPixel; -#endif -#ifdef IPOL_C0 - line.c[0] += slopeC * subPixel; -#endif -#ifdef IPOL_T0 - line.t[0][0] += slopeT[0] * subPixel; -#endif -#ifdef IPOL_T1 - line.t[1][0] += slopeT[1] * subPixel; -#endif -#endif - - SOFTWARE_DRIVER_2_CLIPCHECK; - dst = (tVideoSample*)RenderTarget->getData() + ( line.y * RenderTarget->getDimension().Width ) + xStart; - -#ifdef USE_ZBUFFER - z = (fp24*) DepthBuffer->lock() + ( line.y * RenderTarget->getDimension().Width ) + xStart; -#endif - - - f32 inversew = FIX_POINT_F32_MUL; - - -#if defined(BURNINGVIDEO_RENDERER_FAST) && COLOR_MAX==0xff - u32 dIndex = ( line.y & 3 ) << 2; -#else - tFixPoint tx0; - tFixPoint ty0; - - tFixPoint r0, g0, b0; - tFixPoint r1, g1, b1; -#endif - - - for ( s32 i = 0; i <= dx; i += SOFTWARE_DRIVER_2_STEP_X) - { -#ifdef CMP_Z - if ( line.z[0] < z[i] ) -#endif -#ifdef CMP_W - if ( line.w[0] >= z[i] ) -#endif - - { - -#ifdef INVERSE_W - inversew = fix_inverse32(line.w[0]); -#endif - -#if defined(BURNINGVIDEO_RENDERER_FAST) && COLOR_MAX==0xff - - const tFixPointu d = dithermask [ dIndex | ( i ) & 3 ]; - - dst[i] = PixelAdd32 ( - dst[i], - getTexel_plain ( &IT[0], d + tofix ( line.t[0][0].x,inversew), - d + tofix ( line.t[0][0].y,inversew) ) - ); -#else - - tx0 = tofix ( line.t[0][0].x,inversew); - ty0 = tofix ( line.t[0][0].y,inversew); - getSample_texture ( r0, g0, b0, &IT[0], tx0,ty0 ); - - color_to_fix ( r1, g1, b1, dst[i] ); - - dst[i] = fix_to_sample( clampfix_maxcolor ( r1 + r0 ), - clampfix_maxcolor ( g1 + g0 ), - clampfix_maxcolor ( b1 + b0 ) - ); -#endif - -#ifdef WRITE_Z - z[i] = line.z[0]; -#endif -#ifdef WRITE_W - z[i] = line.w[0]; -#endif - - } - -#ifdef IPOL_Z - line.z[0] += slopeZ; -#endif -#ifdef IPOL_W - line.w[0] += slopeW; -#endif -#ifdef IPOL_C0 - line.c[0] += slopeC; -#endif -#ifdef IPOL_T0 - line.t[0][0] += slopeT[0]; -#endif -#ifdef IPOL_T1 - line.t[1][0] += slopeT[1]; -#endif - } - -} - -void CTRTextureGouraudAdd2::drawTriangle(const s4DVertex* burning_restrict a, const s4DVertex* burning_restrict b, const s4DVertex* burning_restrict c) -{ - // sort on height, y - if ( F32_A_GREATER_B ( a->Pos.y , b->Pos.y ) ) swapVertexPointer(&a, &b); - if ( F32_A_GREATER_B ( b->Pos.y , c->Pos.y ) ) swapVertexPointer(&b, &c); - if ( F32_A_GREATER_B ( a->Pos.y , b->Pos.y ) ) swapVertexPointer(&a, &b); - - const f32 ca = c->Pos.y - a->Pos.y; - const f32 ba = b->Pos.y - a->Pos.y; - const f32 cb = c->Pos.y - b->Pos.y; - // calculate delta y of the edges - scan.invDeltaY[0] = fill_step_y( ca ); - scan.invDeltaY[1] = fill_step_y( ba ); - scan.invDeltaY[2] = fill_step_y( cb ); - - // find if the major edge is left or right aligned - f32 temp[4]; - - temp[0] = a->Pos.x - c->Pos.x; - temp[1] = -ca; - temp[2] = b->Pos.x - a->Pos.x; - temp[3] = ba; - - scan.left = ( temp[0] * temp[3] - temp[1] * temp[2] ) > 0.f ? 0 : 1; - scan.right = 1 - scan.left; - - // calculate slopes for the major edge - scan.slopeX[0] = (c->Pos.x - a->Pos.x) * scan.invDeltaY[0]; - scan.x[0] = a->Pos.x; - -#ifdef IPOL_Z - scan.slopeZ[0] = (c->Pos.z - a->Pos.z) * scan.invDeltaY[0]; - scan.z[0] = a->Pos.z; -#endif - -#ifdef IPOL_W - scan.slopeW[0] = (c->Pos.w - a->Pos.w) * scan.invDeltaY[0]; - scan.w[0] = a->Pos.w; -#endif - -#ifdef IPOL_C0 - scan.slopeC[0] = (c->Color[0] - a->Color[0]) * scan.invDeltaY[0]; - scan.c[0] = a->Color[0]; -#endif - -#ifdef IPOL_T0 - scan.slopeT[0][0] = (c->Tex[0] - a->Tex[0]) * scan.invDeltaY[0]; - scan.t[0][0] = a->Tex[0]; -#endif - -#ifdef IPOL_T1 - scan.slopeT[1][0] = (c->Tex[1] - a->Tex[1]) * scan.invDeltaY[0]; - scan.t[1][0] = a->Tex[1]; -#endif - - // top left fill convention y run - s32 yStart; - s32 yEnd; - -#ifdef SUBTEXEL - f32 subPixel; -#endif - - // rasterize upper sub-triangle - if ( F32_GREATER_0 ( scan.invDeltaY[1] ) ) - { - // calculate slopes for top edge - scan.slopeX[1] = (b->Pos.x - a->Pos.x) * scan.invDeltaY[1]; - scan.x[1] = a->Pos.x; - -#ifdef IPOL_Z - scan.slopeZ[1] = (b->Pos.z - a->Pos.z) * scan.invDeltaY[1]; - scan.z[1] = a->Pos.z; -#endif - -#ifdef IPOL_W - scan.slopeW[1] = (b->Pos.w - a->Pos.w) * scan.invDeltaY[1]; - scan.w[1] = a->Pos.w; -#endif - -#ifdef IPOL_C0 - scan.slopeC[1] = (b->Color[0] - a->Color[0]) * scan.invDeltaY[1]; - scan.c[1] = a->Color[0]; -#endif - -#ifdef IPOL_T0 - scan.slopeT[0][1] = (b->Tex[0] - a->Tex[0]) * scan.invDeltaY[1]; - scan.t[0][1] = a->Tex[0]; -#endif - -#ifdef IPOL_T1 - scan.slopeT[1][1] = (b->Tex[1] - a->Tex[1]) * scan.invDeltaY[1]; - scan.t[1][1] = a->Tex[1]; -#endif - - // apply top-left fill convention, top part - yStart = fill_convention_left( a->Pos.y ); - yEnd = fill_convention_right( b->Pos.y ); - -#ifdef SUBTEXEL - subPixel = ( (f32) yStart ) - a->Pos.y; - - // correct to pixel center - scan.x[0] += scan.slopeX[0] * subPixel; - scan.x[1] += scan.slopeX[1] * subPixel; - -#ifdef IPOL_Z - scan.z[0] += scan.slopeZ[0] * subPixel; - scan.z[1] += scan.slopeZ[1] * subPixel; -#endif - -#ifdef IPOL_W - scan.w[0] += scan.slopeW[0] * subPixel; - scan.w[1] += scan.slopeW[1] * subPixel; -#endif - -#ifdef IPOL_C0 - scan.c[0] += scan.slopeC[0] * subPixel; - scan.c[1] += scan.slopeC[1] * subPixel; -#endif - -#ifdef IPOL_T0 - scan.t[0][0] += scan.slopeT[0][0] * subPixel; - scan.t[0][1] += scan.slopeT[0][1] * subPixel; -#endif - -#ifdef IPOL_T1 - scan.t[1][0] += scan.slopeT[1][0] * subPixel; - scan.t[1][1] += scan.slopeT[1][1] * subPixel; -#endif - -#endif - - // rasterize the edge scanlines - for( line.y = yStart; line.y <= yEnd; line.y += SOFTWARE_DRIVER_2_STEP_Y) - { - line.x[scan.left] = scan.x[0]; - line.x[scan.right] = scan.x[1]; - -#ifdef IPOL_Z - line.z[scan.left] = scan.z[0]; - line.z[scan.right] = scan.z[1]; -#endif - -#ifdef IPOL_W - line.w[scan.left] = scan.w[0]; - line.w[scan.right] = scan.w[1]; -#endif - -#ifdef IPOL_C0 - line.c[scan.left] = scan.c[0]; - line.c[scan.right] = scan.c[1]; -#endif - -#ifdef IPOL_T0 - line.t[0][scan.left] = scan.t[0][0]; - line.t[0][scan.right] = scan.t[0][1]; -#endif - -#ifdef IPOL_T1 - line.t[1][scan.left] = scan.t[1][0]; - line.t[1][scan.right] = scan.t[1][1]; -#endif - - // render a scanline - interlace_scanline fragmentShader(); - - scan.x[0] += scan.slopeX[0]; - scan.x[1] += scan.slopeX[1]; - -#ifdef IPOL_Z - scan.z[0] += scan.slopeZ[0]; - scan.z[1] += scan.slopeZ[1]; -#endif - -#ifdef IPOL_W - scan.w[0] += scan.slopeW[0]; - scan.w[1] += scan.slopeW[1]; -#endif - -#ifdef IPOL_C0 - scan.c[0] += scan.slopeC[0]; - scan.c[1] += scan.slopeC[1]; -#endif - -#ifdef IPOL_T0 - scan.t[0][0] += scan.slopeT[0][0]; - scan.t[0][1] += scan.slopeT[0][1]; -#endif - -#ifdef IPOL_T1 - scan.t[1][0] += scan.slopeT[1][0]; - scan.t[1][1] += scan.slopeT[1][1]; -#endif - - } - } - - // rasterize lower sub-triangle - if ( (f32) 0.0 != scan.invDeltaY[2] ) - { - // advance to middle point - if( (f32) 0.0 != scan.invDeltaY[1] ) - { - temp[0] = b->Pos.y - a->Pos.y; // dy - - scan.x[0] = a->Pos.x + scan.slopeX[0] * temp[0]; -#ifdef IPOL_Z - scan.z[0] = a->Pos.z + scan.slopeZ[0] * temp[0]; -#endif -#ifdef IPOL_W - scan.w[0] = a->Pos.w + scan.slopeW[0] * temp[0]; -#endif -#ifdef IPOL_C0 - scan.c[0] = a->Color[0] + scan.slopeC[0] * temp[0]; -#endif -#ifdef IPOL_T0 - scan.t[0][0] = a->Tex[0] + scan.slopeT[0][0] * temp[0]; -#endif -#ifdef IPOL_T1 - scan.t[1][0] = a->Tex[1] + scan.slopeT[1][0] * temp[0]; -#endif - - } - - // calculate slopes for bottom edge - scan.slopeX[1] = (c->Pos.x - b->Pos.x) * scan.invDeltaY[2]; - scan.x[1] = b->Pos.x; - -#ifdef IPOL_Z - scan.slopeZ[1] = (c->Pos.z - b->Pos.z) * scan.invDeltaY[2]; - scan.z[1] = b->Pos.z; -#endif - -#ifdef IPOL_W - scan.slopeW[1] = (c->Pos.w - b->Pos.w) * scan.invDeltaY[2]; - scan.w[1] = b->Pos.w; -#endif - -#ifdef IPOL_C0 - scan.slopeC[1] = (c->Color[0] - b->Color[0]) * scan.invDeltaY[2]; - scan.c[1] = b->Color[0]; -#endif - -#ifdef IPOL_T0 - scan.slopeT[0][1] = (c->Tex[0] - b->Tex[0]) * scan.invDeltaY[2]; - scan.t[0][1] = b->Tex[0]; -#endif - -#ifdef IPOL_T1 - scan.slopeT[1][1] = (c->Tex[1] - b->Tex[1]) * scan.invDeltaY[2]; - scan.t[1][1] = b->Tex[1]; -#endif - - // apply top-left fill convention, top part - yStart = fill_convention_left( b->Pos.y ); - yEnd = fill_convention_right( c->Pos.y ); - -#ifdef SUBTEXEL - - subPixel = ( (f32) yStart ) - b->Pos.y; - - // correct to pixel center - scan.x[0] += scan.slopeX[0] * subPixel; - scan.x[1] += scan.slopeX[1] * subPixel; - -#ifdef IPOL_Z - scan.z[0] += scan.slopeZ[0] * subPixel; - scan.z[1] += scan.slopeZ[1] * subPixel; -#endif - -#ifdef IPOL_W - scan.w[0] += scan.slopeW[0] * subPixel; - scan.w[1] += scan.slopeW[1] * subPixel; -#endif - -#ifdef IPOL_C0 - scan.c[0] += scan.slopeC[0] * subPixel; - scan.c[1] += scan.slopeC[1] * subPixel; -#endif - -#ifdef IPOL_T0 - scan.t[0][0] += scan.slopeT[0][0] * subPixel; - scan.t[0][1] += scan.slopeT[0][1] * subPixel; -#endif - -#ifdef IPOL_T1 - scan.t[1][0] += scan.slopeT[1][0] * subPixel; - scan.t[1][1] += scan.slopeT[1][1] * subPixel; -#endif - -#endif - - // rasterize the edge scanlines - for( line.y = yStart; line.y <= yEnd; line.y += SOFTWARE_DRIVER_2_STEP_Y) - { - line.x[scan.left] = scan.x[0]; - line.x[scan.right] = scan.x[1]; - -#ifdef IPOL_Z - line.z[scan.left] = scan.z[0]; - line.z[scan.right] = scan.z[1]; -#endif - -#ifdef IPOL_W - line.w[scan.left] = scan.w[0]; - line.w[scan.right] = scan.w[1]; -#endif - -#ifdef IPOL_C0 - line.c[scan.left] = scan.c[0]; - line.c[scan.right] = scan.c[1]; -#endif - -#ifdef IPOL_T0 - line.t[0][scan.left] = scan.t[0][0]; - line.t[0][scan.right] = scan.t[0][1]; -#endif - -#ifdef IPOL_T1 - line.t[1][scan.left] = scan.t[1][0]; - line.t[1][scan.right] = scan.t[1][1]; -#endif - - // render a scanline - interlace_scanline fragmentShader(); - - scan.x[0] += scan.slopeX[0]; - scan.x[1] += scan.slopeX[1]; - -#ifdef IPOL_Z - scan.z[0] += scan.slopeZ[0]; - scan.z[1] += scan.slopeZ[1]; -#endif - -#ifdef IPOL_W - scan.w[0] += scan.slopeW[0]; - scan.w[1] += scan.slopeW[1]; -#endif - -#ifdef IPOL_C0 - scan.c[0] += scan.slopeC[0]; - scan.c[1] += scan.slopeC[1]; -#endif - -#ifdef IPOL_T0 - scan.t[0][0] += scan.slopeT[0][0]; - scan.t[0][1] += scan.slopeT[0][1]; -#endif - -#ifdef IPOL_T1 - scan.t[1][0] += scan.slopeT[1][0]; - scan.t[1][1] += scan.slopeT[1][1]; -#endif - - } - } - -} - - -} // end namespace video -} // end namespace irr - -#endif // _IRR_COMPILE_WITH_BURNINGSVIDEO_ - -namespace irr -{ -namespace video -{ - -//! creates a flat triangle renderer -IBurningShader* createTRTextureGouraudAdd2(CBurningVideoDriver* driver) -{ - //ETR_TEXTURE_GOURAUD_ADD - - #ifdef _IRR_COMPILE_WITH_BURNINGSVIDEO_ - return new CTRTextureGouraudAdd2(driver); - #else - return 0; - #endif // _IRR_COMPILE_WITH_BURNINGSVIDEO_ -} - - -} // end namespace video -} // end namespace irr - - - diff --git a/source/Irrlicht/CTRTextureGouraudAddNoZ2.cpp b/source/Irrlicht/CTRTextureGouraudAddNoZ2.cpp deleted file mode 100644 index 0a880deb..00000000 --- a/source/Irrlicht/CTRTextureGouraudAddNoZ2.cpp +++ /dev/null @@ -1,667 +0,0 @@ -// Copyright (C) 2002-2012 Nikolaus Gebhardt / Thomas Alten -// This file is part of the "Irrlicht Engine". -// For conditions of distribution and use, see copyright notice in irrlicht.h - -#include "IrrCompileConfig.h" -#include "IBurningShader.h" - -#ifdef _IRR_COMPILE_WITH_BURNINGSVIDEO_ - -// compile flag for this file -#undef USE_ZBUFFER -#undef IPOL_Z -#undef CMP_Z -#undef WRITE_Z - -#undef IPOL_W -#undef CMP_W -#undef WRITE_W - -#undef SUBTEXEL -#undef INVERSE_W - -#undef IPOL_C0 -#undef IPOL_T0 -#undef IPOL_T1 - -// define render case -#define SUBTEXEL -#define INVERSE_W - -#define USE_ZBUFFER -#define IPOL_W -#define CMP_W -//#define WRITE_W - -#define IPOL_C0 -#define IPOL_T0 -//#define IPOL_T1 - -// apply global override -#ifndef SOFTWARE_DRIVER_2_PERSPECTIVE_CORRECT -#undef INVERSE_W -#endif - -#ifndef SOFTWARE_DRIVER_2_SUBTEXEL -#undef SUBTEXEL -#endif - -#if BURNING_MATERIAL_MAX_COLORS < 1 -#undef IPOL_C0 -#endif - -#if !defined ( SOFTWARE_DRIVER_2_USE_WBUFFER ) && defined ( USE_ZBUFFER ) -#ifndef SOFTWARE_DRIVER_2_PERSPECTIVE_CORRECT -#undef IPOL_W -#endif -#define IPOL_Z - -#ifdef CMP_W -#undef CMP_W -#define CMP_Z -#endif - -#ifdef WRITE_W -#undef WRITE_W -#define WRITE_Z -#endif - -#endif - - -namespace irr -{ - -namespace video -{ - -class CTRTextureGouraudAddNoZ2 : public IBurningShader -{ -public: - - //! constructor - CTRTextureGouraudAddNoZ2(CBurningVideoDriver* driver); - - //! draws an indexed triangle list - virtual void drawTriangle(const s4DVertex* burning_restrict a, const s4DVertex* burning_restrict b, const s4DVertex* burning_restrict c) _IRR_OVERRIDE_; - - -private: - void fragmentShader(); - -}; - -//! constructor -CTRTextureGouraudAddNoZ2::CTRTextureGouraudAddNoZ2(CBurningVideoDriver* driver) -: IBurningShader(driver) -{ - #ifdef _DEBUG - setDebugName("CTRTextureGouraudAddNoZ2"); - #endif -} - - - -/*! -*/ -void CTRTextureGouraudAddNoZ2::fragmentShader() -{ - tVideoSample *dst; - -#ifdef USE_ZBUFFER - fp24 *z; -#endif - - s32 xStart; - s32 xEnd; - s32 dx; - - -#ifdef SUBTEXEL - f32 subPixel; -#endif - -#ifdef IPOL_Z - f32 slopeZ; -#endif -#ifdef IPOL_W - fp24 slopeW; -#endif -#ifdef IPOL_C0 - sVec4 slopeC; -#endif -#ifdef IPOL_T0 - sVec2 slopeT[BURNING_MATERIAL_MAX_TEXTURES]; -#endif - - // apply top-left fill-convention, left - xStart = fill_convention_left( line.x[0] ); - xEnd = fill_convention_right( line.x[1] ); - - dx = xEnd - xStart; - if ( dx < 0 ) - return; - - // slopes - const f32 invDeltaX = fill_step_x( line.x[1] - line.x[0] ); - -#ifdef IPOL_Z - slopeZ = (line.z[1] - line.z[0]) * invDeltaX; -#endif -#ifdef IPOL_W - slopeW = (line.w[1] - line.w[0]) * invDeltaX; -#endif -#ifdef IPOL_C0 - slopeC = (line.c[0][1] - line.c[0][0]) * invDeltaX; -#endif -#ifdef IPOL_T0 - slopeT[0] = (line.t[0][1] - line.t[0][0]) * invDeltaX; -#endif -#ifdef IPOL_T1 - slopeT[1] = (line.t[1][1] - line.t[1][0]) * invDeltaX; -#endif - -#ifdef SUBTEXEL - subPixel = ( (f32) xStart ) - line.x[0]; -#ifdef IPOL_Z - line.z[0] += slopeZ * subPixel; -#endif -#ifdef IPOL_W - line.w[0] += slopeW * subPixel; -#endif -#ifdef IPOL_C0 - line.c[0][0] += slopeC * subPixel; -#endif -#ifdef IPOL_T0 - line.t[0][0] += slopeT[0] * subPixel; -#endif -#ifdef IPOL_T1 - line.t[1][0] += slopeT[1] * subPixel; -#endif -#endif - - SOFTWARE_DRIVER_2_CLIPCHECK; - dst = (tVideoSample*)RenderTarget->getData() + ( line.y * RenderTarget->getDimension().Width ) + xStart; - -#ifdef USE_ZBUFFER - z = (fp24*) DepthBuffer->lock() + ( line.y * RenderTarget->getDimension().Width ) + xStart; -#endif - - - f32 inversew = FIX_POINT_F32_MUL; - - tFixPoint tx0; - tFixPoint ty0; - - tFixPoint r0, g0, b0; - tFixPoint r1, g1, b1; - -#ifdef IPOL_C0 - tFixPoint r2, g2, b2; -#endif - - for ( s32 i = 0; i <= dx; i += SOFTWARE_DRIVER_2_STEP_X) - { -#ifdef CMP_Z - if ( line.z[0] < z[i] ) -#endif -#ifdef CMP_W - if ( line.w[0] >= z[i] ) -#endif - { -#ifdef INVERSE_W - inversew = fix_inverse32 ( line.w[0] ); -#endif - tx0 = tofix ( line.t[0][0].x,inversew); - ty0 = tofix ( line.t[0][0].y,inversew); - - getSample_texture(r0, g0, b0, &IT[0], tx0, ty0); - -#ifdef IPOL_C0 - vec4_to_fix(r2, g2, b2, line.c[0][0], inversew); - r0 = imulFix(r2, r0); - g0 = imulFix(g2, g0); - b0 = imulFix(b2, b0); -#endif - - //glBlendFunc(GL_ONE, GL_ONE_MINUS_SRC_COLOR); - if (r0 | g0 | b0) - { - color_to_fix(r1, g1, b1, dst[i]); - r1 = imulFix_tex1(r1, FIXPOINT_COLOR_MAX - r0); - g1 = imulFix_tex1(g1, FIXPOINT_COLOR_MAX - g0); - b1 = imulFix_tex1(b1, FIXPOINT_COLOR_MAX - b0); - dst[i] = fix_to_sample(r0+r1, g0+g1, b0+b1); - } - -#ifdef WRITE_Z - z[i] = line.z[0]; -#endif -#ifdef WRITE_W - z[i] = line.w[0]; -#endif - } - -#ifdef IPOL_Z - line.z[0] += slopeZ; -#endif -#ifdef IPOL_W - line.w[0] += slopeW; -#endif -#ifdef IPOL_C0 - line.c[0][0] += slopeC; -#endif -#ifdef IPOL_T0 - line.t[0][0] += slopeT[0]; -#endif -#ifdef IPOL_T1 - line.t[1][0] += slopeT[1]; -#endif - } - -} - -void CTRTextureGouraudAddNoZ2::drawTriangle(const s4DVertex* burning_restrict a, const s4DVertex* burning_restrict b, const s4DVertex* burning_restrict c) -{ - //billboard discard - //if (a->Color[0].r <= 0.f) return; - - // sort on height, y - if ( F32_A_GREATER_B ( a->Pos.y , b->Pos.y ) ) swapVertexPointer(&a, &b); - if ( F32_A_GREATER_B ( b->Pos.y , c->Pos.y ) ) swapVertexPointer(&b, &c); - if ( F32_A_GREATER_B ( a->Pos.y , b->Pos.y ) ) swapVertexPointer(&a, &b); - - const f32 ca = c->Pos.y - a->Pos.y; - const f32 ba = b->Pos.y - a->Pos.y; - const f32 cb = c->Pos.y - b->Pos.y; - // calculate delta y of the edges - scan.invDeltaY[0] = fill_step_y( ca ); - scan.invDeltaY[1] = fill_step_y( ba ); - scan.invDeltaY[2] = fill_step_y( cb ); - - if ( F32_LOWER_EQUAL_0 ( scan.invDeltaY[0] ) ) - return; - - // find if the major edge is left or right aligned - f32 temp[4]; - - temp[0] = a->Pos.x - c->Pos.x; - temp[1] = -ca; - temp[2] = b->Pos.x - a->Pos.x; - temp[3] = ba; - - scan.left = ( temp[0] * temp[3] - temp[1] * temp[2] ) > 0.f ? 0 : 1; - scan.right = 1 - scan.left; - - // calculate slopes for the major edge - scan.slopeX[0] = (c->Pos.x - a->Pos.x) * scan.invDeltaY[0]; - scan.x[0] = a->Pos.x; - -#ifdef IPOL_Z - scan.slopeZ[0] = (c->Pos.z - a->Pos.z) * scan.invDeltaY[0]; - scan.z[0] = a->Pos.z; -#endif - -#ifdef IPOL_W - scan.slopeW[0] = (c->Pos.w - a->Pos.w) * scan.invDeltaY[0]; - scan.w[0] = a->Pos.w; -#endif - -#ifdef IPOL_C0 - scan.slopeC[0][0] = (c->Color[0] - a->Color[0]) * scan.invDeltaY[0]; - scan.c[0][0] = a->Color[0]; -#endif - -#ifdef IPOL_T0 - scan.slopeT[0][0] = (c->Tex[0] - a->Tex[0]) * scan.invDeltaY[0]; - scan.t[0][0] = a->Tex[0]; -#endif - -#ifdef IPOL_T1 - scan.slopeT[1][0] = (c->Tex[1] - a->Tex[1]) * scan.invDeltaY[0]; - scan.t[1][0] = a->Tex[1]; -#endif - - // top left fill convention y run - s32 yStart; - s32 yEnd; - -#ifdef SUBTEXEL - f32 subPixel; -#endif - - // rasterize upper sub-triangle - if (F32_GREATER_0(scan.invDeltaY[1]) ) - { - // calculate slopes for top edge - scan.slopeX[1] = (b->Pos.x - a->Pos.x) * scan.invDeltaY[1]; - scan.x[1] = a->Pos.x; - -#ifdef IPOL_Z - scan.slopeZ[1] = (b->Pos.z - a->Pos.z) * scan.invDeltaY[1]; - scan.z[1] = a->Pos.z; -#endif - -#ifdef IPOL_W - scan.slopeW[1] = (b->Pos.w - a->Pos.w) * scan.invDeltaY[1]; - scan.w[1] = a->Pos.w; -#endif - -#ifdef IPOL_C0 - scan.slopeC[0][1] = (b->Color[0] - a->Color[0]) * scan.invDeltaY[1]; - scan.c[0][1] = a->Color[0]; -#endif - -#ifdef IPOL_T0 - scan.slopeT[0][1] = (b->Tex[0] - a->Tex[0]) * scan.invDeltaY[1]; - scan.t[0][1] = a->Tex[0]; -#endif - -#ifdef IPOL_T1 - scan.slopeT[1][1] = (b->Tex[1] - a->Tex[1]) * scan.invDeltaY[1]; - scan.t[1][1] = a->Tex[1]; -#endif - - // apply top-left fill convention, top part - yStart = fill_convention_left( a->Pos.y ); - yEnd = fill_convention_right( b->Pos.y ); - -#ifdef SUBTEXEL - subPixel = ( (f32) yStart ) - a->Pos.y; - - // correct to pixel center - scan.x[0] += scan.slopeX[0] * subPixel; - scan.x[1] += scan.slopeX[1] * subPixel; - -#ifdef IPOL_Z - scan.z[0] += scan.slopeZ[0] * subPixel; - scan.z[1] += scan.slopeZ[1] * subPixel; -#endif - -#ifdef IPOL_W - scan.w[0] += scan.slopeW[0] * subPixel; - scan.w[1] += scan.slopeW[1] * subPixel; -#endif - -#ifdef IPOL_C0 - scan.c[0][0] += scan.slopeC[0][0] * subPixel; - scan.c[0][1] += scan.slopeC[0][1] * subPixel; -#endif - -#ifdef IPOL_T0 - scan.t[0][0] += scan.slopeT[0][0] * subPixel; - scan.t[0][1] += scan.slopeT[0][1] * subPixel; -#endif - -#ifdef IPOL_T1 - scan.t[1][0] += scan.slopeT[1][0] * subPixel; - scan.t[1][1] += scan.slopeT[1][1] * subPixel; -#endif - -#endif - - // rasterize the edge scanlines - for( line.y = yStart; line.y <= yEnd; line.y += SOFTWARE_DRIVER_2_STEP_Y) - { - line.x[scan.left] = scan.x[0]; - line.x[scan.right] = scan.x[1]; - -#ifdef IPOL_Z - line.z[scan.left] = scan.z[0]; - line.z[scan.right] = scan.z[1]; -#endif - -#ifdef IPOL_W - line.w[scan.left] = scan.w[0]; - line.w[scan.right] = scan.w[1]; -#endif - -#ifdef IPOL_C0 - line.c[0][scan.left] = scan.c[0][0]; - line.c[0][scan.right] = scan.c[0][1]; -#endif - -#ifdef IPOL_T0 - line.t[0][scan.left] = scan.t[0][0]; - line.t[0][scan.right] = scan.t[0][1]; -#endif - -#ifdef IPOL_T1 - line.t[1][scan.left] = scan.t[1][0]; - line.t[1][scan.right] = scan.t[1][1]; -#endif - - // render a scanline - interlace_scanline fragmentShader(); - - scan.x[0] += scan.slopeX[0]; - scan.x[1] += scan.slopeX[1]; - -#ifdef IPOL_Z - scan.z[0] += scan.slopeZ[0]; - scan.z[1] += scan.slopeZ[1]; -#endif - -#ifdef IPOL_W - scan.w[0] += scan.slopeW[0]; - scan.w[1] += scan.slopeW[1]; -#endif - -#ifdef IPOL_C0 - scan.c[0][0] += scan.slopeC[0][0]; - scan.c[0][1] += scan.slopeC[0][1]; -#endif - -#ifdef IPOL_T0 - scan.t[0][0] += scan.slopeT[0][0]; - scan.t[0][1] += scan.slopeT[0][1]; -#endif - -#ifdef IPOL_T1 - scan.t[1][0] += scan.slopeT[1][0]; - scan.t[1][1] += scan.slopeT[1][1]; -#endif - - } - } - - // rasterize lower sub-triangle - if (F32_GREATER_0(scan.invDeltaY[2]) ) - { - // advance to middle point - if(F32_GREATER_0(scan.invDeltaY[1]) ) - { - temp[0] = b->Pos.y - a->Pos.y; // dy - - scan.x[0] = a->Pos.x + scan.slopeX[0] * temp[0]; -#ifdef IPOL_Z - scan.z[0] = a->Pos.z + scan.slopeZ[0] * temp[0]; -#endif -#ifdef IPOL_W - scan.w[0] = a->Pos.w + scan.slopeW[0] * temp[0]; -#endif -#ifdef IPOL_C0 - scan.c[0][0] = a->Color[0] + scan.slopeC[0][0] * temp[0]; -#endif -#ifdef IPOL_T0 - scan.t[0][0] = a->Tex[0] + scan.slopeT[0][0] * temp[0]; -#endif -#ifdef IPOL_T1 - scan.t[1][0] = a->Tex[1] + scan.slopeT[1][0] * temp[0]; -#endif - - } - - // calculate slopes for bottom edge - scan.slopeX[1] = (c->Pos.x - b->Pos.x) * scan.invDeltaY[2]; - scan.x[1] = b->Pos.x; - -#ifdef IPOL_Z - scan.slopeZ[1] = (c->Pos.z - b->Pos.z) * scan.invDeltaY[2]; - scan.z[1] = b->Pos.z; -#endif - -#ifdef IPOL_W - scan.slopeW[1] = (c->Pos.w - b->Pos.w) * scan.invDeltaY[2]; - scan.w[1] = b->Pos.w; -#endif - -#ifdef IPOL_C0 - scan.slopeC[0][1] = (c->Color[0] - b->Color[0]) * scan.invDeltaY[2]; - scan.c[0][1] = b->Color[0]; -#endif - -#ifdef IPOL_T0 - scan.slopeT[0][1] = (c->Tex[0] - b->Tex[0]) * scan.invDeltaY[2]; - scan.t[0][1] = b->Tex[0]; -#endif - -#ifdef IPOL_T1 - scan.slopeT[1][1] = (c->Tex[1] - b->Tex[1]) * scan.invDeltaY[2]; - scan.t[1][1] = b->Tex[1]; -#endif - - // apply top-left fill convention, top part - yStart = fill_convention_left( b->Pos.y ); - yEnd = fill_convention_right( c->Pos.y ); - -#ifdef SUBTEXEL - subPixel = ( (f32) yStart ) - b->Pos.y; - - // correct to pixel center - scan.x[0] += scan.slopeX[0] * subPixel; - scan.x[1] += scan.slopeX[1] * subPixel; - -#ifdef IPOL_Z - scan.z[0] += scan.slopeZ[0] * subPixel; - scan.z[1] += scan.slopeZ[1] * subPixel; -#endif - -#ifdef IPOL_W - scan.w[0] += scan.slopeW[0] * subPixel; - scan.w[1] += scan.slopeW[1] * subPixel; -#endif - -#ifdef IPOL_C0 - scan.c[0][0] += scan.slopeC[0][0] * subPixel; - scan.c[0][1] += scan.slopeC[0][1] * subPixel; -#endif - -#ifdef IPOL_T0 - scan.t[0][0] += scan.slopeT[0][0] * subPixel; - scan.t[0][1] += scan.slopeT[0][1] * subPixel; -#endif - -#ifdef IPOL_T1 - scan.t[1][0] += scan.slopeT[1][0] * subPixel; - scan.t[1][1] += scan.slopeT[1][1] * subPixel; -#endif - -#endif - - // rasterize the edge scanlines - for( line.y = yStart; line.y <= yEnd; line.y += SOFTWARE_DRIVER_2_STEP_Y) - { - line.x[scan.left] = scan.x[0]; - line.x[scan.right] = scan.x[1]; - -#ifdef IPOL_Z - line.z[scan.left] = scan.z[0]; - line.z[scan.right] = scan.z[1]; -#endif - -#ifdef IPOL_W - line.w[scan.left] = scan.w[0]; - line.w[scan.right] = scan.w[1]; -#endif - -#ifdef IPOL_C0 - line.c[0][scan.left] = scan.c[0][0]; - line.c[0][scan.right] = scan.c[0][1]; -#endif - -#ifdef IPOL_T0 - line.t[0][scan.left] = scan.t[0][0]; - line.t[0][scan.right] = scan.t[0][1]; -#endif - -#ifdef IPOL_T1 - line.t[1][scan.left] = scan.t[1][0]; - line.t[1][scan.right] = scan.t[1][1]; -#endif - - // render a scanline - interlace_scanline fragmentShader(); - - scan.x[0] += scan.slopeX[0]; - scan.x[1] += scan.slopeX[1]; - -#ifdef IPOL_Z - scan.z[0] += scan.slopeZ[0]; - scan.z[1] += scan.slopeZ[1]; -#endif - -#ifdef IPOL_W - scan.w[0] += scan.slopeW[0]; - scan.w[1] += scan.slopeW[1]; -#endif - -#ifdef IPOL_C0 - scan.c[0][0] += scan.slopeC[0][0]; - scan.c[0][1] += scan.slopeC[0][1]; -#endif - -#ifdef IPOL_T0 - scan.t[0][0] += scan.slopeT[0][0]; - scan.t[0][1] += scan.slopeT[0][1]; -#endif - -#ifdef IPOL_T1 - scan.t[1][0] += scan.slopeT[1][0]; - scan.t[1][1] += scan.slopeT[1][1]; -#endif - - } - } - -} - -} // end namespace video -} // end namespace irr - -#endif // _IRR_COMPILE_WITH_BURNINGSVIDEO_ - -namespace irr -{ -namespace video -{ - -//! creates a flat triangle renderer -IBurningShader* createTRTextureGouraudAddNoZ2(CBurningVideoDriver* driver) -{ - /* - ETR_TEXTURE_GOURAUD_ADD_NO_Z - - Irrlicht: - Material.MaterialType = EMT_TRANSPARENT_ADD_COLOR; - Material.ZBuffer = ECFN_DISABLED; - -> need Material.ZWriteEnable off - - OpenGL - glDisable(GL_DEPTH_TEST); - glDepthMask(GL_FALSE); - glBlendFunc(GL_ONE, GL_ONE_MINUS_SRC_COLOR); - */ - - #ifdef _IRR_COMPILE_WITH_BURNINGSVIDEO_ - return new CTRTextureGouraudAddNoZ2(driver); - #else - return 0; - #endif // _IRR_COMPILE_WITH_BURNINGSVIDEO_ -} - - -} // end namespace video -} // end namespace irr - - diff --git a/source/Irrlicht/CTRTextureGouraudAlpha.cpp b/source/Irrlicht/CTRTextureGouraudAlpha.cpp deleted file mode 100644 index 995251bf..00000000 --- a/source/Irrlicht/CTRTextureGouraudAlpha.cpp +++ /dev/null @@ -1,718 +0,0 @@ -// Copyright (C) 2002-2012 Nikolaus Gebhardt / Thomas Alten -// This file is part of the "Irrlicht Engine". -// For conditions of distribution and use, see copyright notice in irrlicht.h - -#include "IrrCompileConfig.h" -#include "IBurningShader.h" - -#ifdef _IRR_COMPILE_WITH_BURNINGSVIDEO_ - -// compile flag for this file -#undef USE_ZBUFFER -#undef IPOL_Z -#undef CMP_Z -#undef WRITE_Z - -#undef IPOL_W -#undef CMP_W -#undef WRITE_W - -#undef SUBTEXEL -#undef INVERSE_W - -#undef IPOL_C0 -#undef IPOL_T0 -#undef IPOL_T1 - -// define render case -#define SUBTEXEL -#define INVERSE_W - -#define USE_ZBUFFER -#define IPOL_W -#define CMP_W -#define WRITE_W - -#define IPOL_C0 -#define IPOL_T0 -//#define IPOL_T1 - -// apply global override -#ifndef SOFTWARE_DRIVER_2_PERSPECTIVE_CORRECT - #undef INVERSE_W -#endif - -#ifndef SOFTWARE_DRIVER_2_SUBTEXEL - #undef SUBTEXEL -#endif - -#if BURNING_MATERIAL_MAX_COLORS < 1 - #undef IPOL_C0 -#endif - -#if !defined ( SOFTWARE_DRIVER_2_USE_WBUFFER ) && defined ( USE_ZBUFFER ) - #ifndef SOFTWARE_DRIVER_2_PERSPECTIVE_CORRECT - #undef IPOL_W - #endif - #define IPOL_Z - - #ifdef CMP_W - #undef CMP_W - #define CMP_Z - #endif - - #ifdef WRITE_W - #undef WRITE_W - #define WRITE_Z - #endif - -#endif - - - -namespace irr -{ - -namespace video -{ - -class CTRTextureGouraudAlpha2 : public IBurningShader -{ -public: - - //! constructor - CTRTextureGouraudAlpha2(CBurningVideoDriver* driver); - - //! draws an indexed triangle list - virtual void drawTriangle(const s4DVertex* burning_restrict a, const s4DVertex* burning_restrict b, const s4DVertex* burning_restrict c) _IRR_OVERRIDE_; - virtual void OnSetMaterial(const SBurningShaderMaterial& material) _IRR_OVERRIDE_; - -private: - void fragmentShader(); - -}; - -//! constructor -CTRTextureGouraudAlpha2::CTRTextureGouraudAlpha2(CBurningVideoDriver* driver) -: IBurningShader(driver) -{ - #ifdef _DEBUG - setDebugName("CTRTextureGouraudAlpha2"); - #endif -} - - -/*! -*/ -void CTRTextureGouraudAlpha2::OnSetMaterial(const SBurningShaderMaterial& material) -{ -#if defined(BURNINGVIDEO_RENDERER_FAST) && COLOR_MAX==0xff - AlphaRef = core::floor32(material.org.MaterialTypeParam * 256.f); -#else - AlphaRef = tofix(material.org.MaterialTypeParam, FIXPOINT_COLOR_MAX); -#endif -} - -/*! -*/ -void CTRTextureGouraudAlpha2::fragmentShader() -{ - tVideoSample *dst; - -#ifdef USE_ZBUFFER - fp24 *z; -#endif - - s32 xStart; - s32 xEnd; - s32 dx; - - -#ifdef SUBTEXEL - f32 subPixel; -#endif - -#ifdef IPOL_Z - f32 slopeZ; -#endif -#ifdef IPOL_W - fp24 slopeW; -#endif -#ifdef IPOL_C0 - sVec4 slopeC[BURNING_MATERIAL_MAX_COLORS]; -#endif -#ifdef IPOL_T0 - sVec2 slopeT[BURNING_MATERIAL_MAX_TEXTURES]; -#endif - - // apply top-left fill-convention, left - xStart = fill_convention_left( line.x[0] ); - xEnd = fill_convention_right( line.x[1] ); - - dx = xEnd - xStart; - - if ( dx < 0 ) - return; - - // slopes - const f32 invDeltaX = fill_step_x( line.x[1] - line.x[0] ); - -#ifdef IPOL_Z - slopeZ = (line.z[1] - line.z[0]) * invDeltaX; -#endif -#ifdef IPOL_W - slopeW = (line.w[1] - line.w[0]) * invDeltaX; -#endif -#ifdef IPOL_C0 - slopeC[0] = (line.c[0][1] - line.c[0][0]) * invDeltaX; -#endif -#ifdef IPOL_T0 - slopeT[0] = (line.t[0][1] - line.t[0][0]) * invDeltaX; -#endif -#ifdef IPOL_T1 - slopeT[1] = (line.t[1][1] - line.t[1][0]) * invDeltaX; -#endif - -#ifdef SUBTEXEL - subPixel = ( (f32) xStart ) - line.x[0]; -#ifdef IPOL_Z - line.z[0] += slopeZ * subPixel; -#endif -#ifdef IPOL_W - line.w[0] += slopeW * subPixel; -#endif -#ifdef IPOL_C0 - line.c[0][0] += slopeC[0] * subPixel; -#endif -#ifdef IPOL_T0 - line.t[0][0] += slopeT[0] * subPixel; -#endif -#ifdef IPOL_T1 - line.t[1][0] += slopeT[1] * subPixel; -#endif -#endif - - SOFTWARE_DRIVER_2_CLIPCHECK; - dst = (tVideoSample*)RenderTarget->getData() + ( line.y * RenderTarget->getDimension().Width ) + xStart; - -#ifdef USE_ZBUFFER - z = (fp24*) DepthBuffer->lock() + ( line.y * RenderTarget->getDimension().Width ) + xStart; -#endif - - - f32 inversew = FIX_POINT_F32_MUL; - -#if defined(BURNINGVIDEO_RENDERER_FAST) && COLOR_MAX==0xff - u32 dIndex = (line.y & 3) << 2; -#else - tFixPoint a0, r0, g0, b0; - -#ifdef IPOL_C0 - tFixPoint r1, g1, b1; - tFixPoint r2, g2, b2; -#endif -#endif - - for ( s32 i = 0; i <= dx; i += SOFTWARE_DRIVER_2_STEP_X) - { -#ifdef CMP_Z - if ( line.z[0] < z[i] ) -#endif -#ifdef CMP_W - if ( line.w[0] >= z[i] ) -#endif - - { - -#if defined(BURNINGVIDEO_RENDERER_FAST) && COLOR_MAX==0xff - - const tFixPointu d = dithermask [ dIndex | ( i ) & 3 ]; - -#ifdef INVERSE_W - inversew = fix_inverse32 ( line.w[0] ); -#endif - - u32 argb = getTexel_plain ( &IT[0], d + tofix ( line.t[0][0].x,inversew), - d + tofix ( line.t[0][0].y,inversew) - ); - - const tFixPoint alpha = ( argb >> 24 ); - if ( alpha > AlphaRef ) - { -#ifdef WRITE_Z - z[i] = line.z[0]; -#endif -#ifdef WRITE_W - z[i] = line.w[0]; -#endif - - dst[i] = PixelBlend32 ( dst[i], argb, alpha ); - } - - -#else - -#ifdef INVERSE_W - inversew = fix_inverse32 ( line.w[0] ); -#endif - getSample_texture ( a0,r0,g0,b0, - &IT[0], - tofix ( line.t[0][0].x,inversew), - tofix ( line.t[0][0].y,inversew) - ); - - if ( a0 > AlphaRef ) - { -#ifdef WRITE_Z - z[i] = line.z[0]; -#endif -#ifdef WRITE_W - z[i] = line.w[0]; -#endif - -#ifdef IPOL_C0 - - vec4_to_fix( r2, g2, b2, line.c[0][0], inversew ); - - r0 = imulFix_simple( r0, r2 ); - g0 = imulFix_simple( g0, g2 ); - b0 = imulFix_simple( b0, b2 ); - - color_to_fix ( r1, g1, b1, dst[i] ); - - fix_color_norm(a0); - - r2 = r1 + imulFix ( a0, r0 - r1 ); - g2 = g1 + imulFix ( a0, g0 - g1 ); - b2 = b1 + imulFix ( a0, b0 - b1 ); - dst[i] = fix4_to_sample( a0, r2, g2, b2 ); - -/* - getSample_color ( r2, g2, b2, line.c[0][0], inversew * COLOR_MAX ); - color_to_fix ( r1, g1, b1, dst[i] ); - - r2 = r0 + imulFix ( a0, r1 - r0 ); - g2 = g0 + imulFix ( a0, g1 - g0 ); - b2 = b0 + imulFix ( a0, b1 - b0 ); - dst[i] = fix_to_sample ( r2, g2, b2 ); -*/ -#else - dst[i] = PixelBlend32 ( dst[i], - fix_to_sample( r0,g0, b0 ), - fixPointu_to_u32 ( a0 ) - ); -#endif - } -#endif - - } - -#ifdef IPOL_Z - line.z[0] += slopeZ; -#endif -#ifdef IPOL_W - line.w[0] += slopeW; -#endif -#ifdef IPOL_C0 - line.c[0][0] += slopeC[0]; -#endif -#ifdef IPOL_T0 - line.t[0][0] += slopeT[0]; -#endif -#ifdef IPOL_T1 - line.t[1][0] += slopeT[1]; -#endif - } - -} - -void CTRTextureGouraudAlpha2::drawTriangle(const s4DVertex* burning_restrict a, const s4DVertex* burning_restrict b, const s4DVertex* burning_restrict c) -{ - // sort on height, y - if ( F32_A_GREATER_B ( a->Pos.y , b->Pos.y ) ) swapVertexPointer(&a, &b); - if ( F32_A_GREATER_B ( b->Pos.y , c->Pos.y ) ) swapVertexPointer(&b, &c); - if ( F32_A_GREATER_B ( a->Pos.y , b->Pos.y ) ) swapVertexPointer(&a, &b); - - const f32 ca = c->Pos.y - a->Pos.y; - const f32 ba = b->Pos.y - a->Pos.y; - const f32 cb = c->Pos.y - b->Pos.y; - // calculate delta y of the edges - scan.invDeltaY[0] = fill_step_y( ca ); - scan.invDeltaY[1] = fill_step_y( ba ); - scan.invDeltaY[2] = fill_step_y( cb ); - - if ( F32_LOWER_EQUAL_0 ( scan.invDeltaY[0] ) ) - return; - - // find if the major edge is left or right aligned - f32 temp[4]; - - temp[0] = a->Pos.x - c->Pos.x; - temp[1] = -ca; - temp[2] = b->Pos.x - a->Pos.x; - temp[3] = ba; - - scan.left = ( temp[0] * temp[3] - temp[1] * temp[2] ) > 0.f ? 0 : 1; - scan.right = 1 - scan.left; - - // calculate slopes for the major edge - scan.slopeX[0] = (c->Pos.x - a->Pos.x) * scan.invDeltaY[0]; - scan.x[0] = a->Pos.x; - -#ifdef IPOL_Z - scan.slopeZ[0] = (c->Pos.z - a->Pos.z) * scan.invDeltaY[0]; - scan.z[0] = a->Pos.z; -#endif - -#ifdef IPOL_W - scan.slopeW[0] = (c->Pos.w - a->Pos.w) * scan.invDeltaY[0]; - scan.w[0] = a->Pos.w; -#endif - -#ifdef IPOL_C0 - scan.slopeC[0][0] = (c->Color[0] - a->Color[0]) * scan.invDeltaY[0]; - scan.c[0][0] = a->Color[0]; -#endif - -#ifdef IPOL_T0 - scan.slopeT[0][0] = (c->Tex[0] - a->Tex[0]) * scan.invDeltaY[0]; - scan.t[0][0] = a->Tex[0]; -#endif - -#ifdef IPOL_T1 - scan.slopeT[1][0] = (c->Tex[1] - a->Tex[1]) * scan.invDeltaY[0]; - scan.t[1][0] = a->Tex[1]; -#endif - - // top left fill convention y run - s32 yStart; - s32 yEnd; - -#ifdef SUBTEXEL - f32 subPixel; -#endif - - // rasterize upper sub-triangle - if ( (f32) 0.0 != scan.invDeltaY[1] ) - { - // calculate slopes for top edge - scan.slopeX[1] = (b->Pos.x - a->Pos.x) * scan.invDeltaY[1]; - scan.x[1] = a->Pos.x; - -#ifdef IPOL_Z - scan.slopeZ[1] = (b->Pos.z - a->Pos.z) * scan.invDeltaY[1]; - scan.z[1] = a->Pos.z; -#endif - -#ifdef IPOL_W - scan.slopeW[1] = (b->Pos.w - a->Pos.w) * scan.invDeltaY[1]; - scan.w[1] = a->Pos.w; -#endif - -#ifdef IPOL_C0 - scan.slopeC[0][1] = (b->Color[0] - a->Color[0]) * scan.invDeltaY[1]; - scan.c[0][1] = a->Color[0]; -#endif - -#ifdef IPOL_T0 - scan.slopeT[0][1] = (b->Tex[0] - a->Tex[0]) * scan.invDeltaY[1]; - scan.t[0][1] = a->Tex[0]; -#endif - -#ifdef IPOL_T1 - scan.slopeT[1][1] = (b->Tex[1] - a->Tex[1]) * scan.invDeltaY[1]; - scan.t[1][1] = a->Tex[1]; -#endif - - // apply top-left fill convention, top part - yStart = fill_convention_left( a->Pos.y ); - yEnd = fill_convention_right( b->Pos.y ); - -#ifdef SUBTEXEL - subPixel = ( (f32) yStart ) - a->Pos.y; - - // correct to pixel center - scan.x[0] += scan.slopeX[0] * subPixel; - scan.x[1] += scan.slopeX[1] * subPixel; - -#ifdef IPOL_Z - scan.z[0] += scan.slopeZ[0] * subPixel; - scan.z[1] += scan.slopeZ[1] * subPixel; -#endif - -#ifdef IPOL_W - scan.w[0] += scan.slopeW[0] * subPixel; - scan.w[1] += scan.slopeW[1] * subPixel; -#endif - -#ifdef IPOL_C0 - scan.c[0][0] += scan.slopeC[0][0] * subPixel; - scan.c[0][1] += scan.slopeC[0][1] * subPixel; -#endif - -#ifdef IPOL_T0 - scan.t[0][0] += scan.slopeT[0][0] * subPixel; - scan.t[0][1] += scan.slopeT[0][1] * subPixel; -#endif - -#ifdef IPOL_T1 - scan.t[1][0] += scan.slopeT[1][0] * subPixel; - scan.t[1][1] += scan.slopeT[1][1] * subPixel; -#endif - -#endif - - // rasterize the edge scanlines - for( line.y = yStart; line.y <= yEnd; line.y += SOFTWARE_DRIVER_2_STEP_Y) - { - line.x[scan.left] = scan.x[0]; - line.x[scan.right] = scan.x[1]; - -#ifdef IPOL_Z - line.z[scan.left] = scan.z[0]; - line.z[scan.right] = scan.z[1]; -#endif - -#ifdef IPOL_W - line.w[scan.left] = scan.w[0]; - line.w[scan.right] = scan.w[1]; -#endif - -#ifdef IPOL_C0 - line.c[0][scan.left] = scan.c[0][0]; - line.c[0][scan.right] = scan.c[0][1]; -#endif - -#ifdef IPOL_T0 - line.t[0][scan.left] = scan.t[0][0]; - line.t[0][scan.right] = scan.t[0][1]; -#endif - -#ifdef IPOL_T1 - line.t[1][scan.left] = scan.t[1][0]; - line.t[1][scan.right] = scan.t[1][1]; -#endif - - // render a scanline - interlace_scanline fragmentShader(); - - scan.x[0] += scan.slopeX[0]; - scan.x[1] += scan.slopeX[1]; - -#ifdef IPOL_Z - scan.z[0] += scan.slopeZ[0]; - scan.z[1] += scan.slopeZ[1]; -#endif - -#ifdef IPOL_W - scan.w[0] += scan.slopeW[0]; - scan.w[1] += scan.slopeW[1]; -#endif - -#ifdef IPOL_C0 - scan.c[0][0] += scan.slopeC[0][0]; - scan.c[0][1] += scan.slopeC[0][1]; -#endif - -#ifdef IPOL_T0 - scan.t[0][0] += scan.slopeT[0][0]; - scan.t[0][1] += scan.slopeT[0][1]; -#endif - -#ifdef IPOL_T1 - scan.t[1][0] += scan.slopeT[1][0]; - scan.t[1][1] += scan.slopeT[1][1]; -#endif - - } - } - - // rasterize lower sub-triangle - if ( (f32) 0.0 != scan.invDeltaY[2] ) - { - // advance to middle point - if( (f32) 0.0 != scan.invDeltaY[1] ) - { - temp[0] = b->Pos.y - a->Pos.y; // dy - - scan.x[0] = a->Pos.x + scan.slopeX[0] * temp[0]; -#ifdef IPOL_Z - scan.z[0] = a->Pos.z + scan.slopeZ[0] * temp[0]; -#endif -#ifdef IPOL_W - scan.w[0] = a->Pos.w + scan.slopeW[0] * temp[0]; -#endif -#ifdef IPOL_C0 - scan.c[0][0] = a->Color[0] + scan.slopeC[0][0] * temp[0]; -#endif -#ifdef IPOL_T0 - scan.t[0][0] = a->Tex[0] + scan.slopeT[0][0] * temp[0]; -#endif -#ifdef IPOL_T1 - scan.t[1][0] = a->Tex[1] + scan.slopeT[1][0] * temp[0]; -#endif - - } - - // calculate slopes for bottom edge - scan.slopeX[1] = (c->Pos.x - b->Pos.x) * scan.invDeltaY[2]; - scan.x[1] = b->Pos.x; - -#ifdef IPOL_Z - scan.slopeZ[1] = (c->Pos.z - b->Pos.z) * scan.invDeltaY[2]; - scan.z[1] = b->Pos.z; -#endif - -#ifdef IPOL_W - scan.slopeW[1] = (c->Pos.w - b->Pos.w) * scan.invDeltaY[2]; - scan.w[1] = b->Pos.w; -#endif - -#ifdef IPOL_C0 - scan.slopeC[0][1] = (c->Color[0] - b->Color[0]) * scan.invDeltaY[2]; - scan.c[0][1] = b->Color[0]; -#endif - -#ifdef IPOL_T0 - scan.slopeT[0][1] = (c->Tex[0] - b->Tex[0]) * scan.invDeltaY[2]; - scan.t[0][1] = b->Tex[0]; -#endif - -#ifdef IPOL_T1 - scan.slopeT[1][1] = (c->Tex[1] - b->Tex[1]) * scan.invDeltaY[2]; - scan.t[1][1] = b->Tex[1]; -#endif - - // apply top-left fill convention, top part - yStart = fill_convention_left( b->Pos.y ); - yEnd = fill_convention_right( c->Pos.y ); - -#ifdef SUBTEXEL - subPixel = ( (f32) yStart ) - b->Pos.y; - - // correct to pixel center - scan.x[0] += scan.slopeX[0] * subPixel; - scan.x[1] += scan.slopeX[1] * subPixel; - -#ifdef IPOL_Z - scan.z[0] += scan.slopeZ[0] * subPixel; - scan.z[1] += scan.slopeZ[1] * subPixel; -#endif - -#ifdef IPOL_W - scan.w[0] += scan.slopeW[0] * subPixel; - scan.w[1] += scan.slopeW[1] * subPixel; -#endif - -#ifdef IPOL_C0 - scan.c[0][0] += scan.slopeC[0][0] * subPixel; - scan.c[0][1] += scan.slopeC[0][1] * subPixel; -#endif - -#ifdef IPOL_T0 - scan.t[0][0] += scan.slopeT[0][0] * subPixel; - scan.t[0][1] += scan.slopeT[0][1] * subPixel; -#endif - -#ifdef IPOL_T1 - scan.t[1][0] += scan.slopeT[1][0] * subPixel; - scan.t[1][1] += scan.slopeT[1][1] * subPixel; -#endif - -#endif - - // rasterize the edge scanlines - for( line.y = yStart; line.y <= yEnd; line.y += SOFTWARE_DRIVER_2_STEP_Y) - { - line.x[scan.left] = scan.x[0]; - line.x[scan.right] = scan.x[1]; - -#ifdef IPOL_Z - line.z[scan.left] = scan.z[0]; - line.z[scan.right] = scan.z[1]; -#endif - -#ifdef IPOL_W - line.w[scan.left] = scan.w[0]; - line.w[scan.right] = scan.w[1]; -#endif - -#ifdef IPOL_C0 - line.c[0][scan.left] = scan.c[0][0]; - line.c[0][scan.right] = scan.c[0][1]; -#endif - -#ifdef IPOL_T0 - line.t[0][scan.left] = scan.t[0][0]; - line.t[0][scan.right] = scan.t[0][1]; -#endif - -#ifdef IPOL_T1 - line.t[1][scan.left] = scan.t[1][0]; - line.t[1][scan.right] = scan.t[1][1]; -#endif - - // render a scanline - interlace_scanline fragmentShader(); - - scan.x[0] += scan.slopeX[0]; - scan.x[1] += scan.slopeX[1]; - -#ifdef IPOL_Z - scan.z[0] += scan.slopeZ[0]; - scan.z[1] += scan.slopeZ[1]; -#endif - -#ifdef IPOL_W - scan.w[0] += scan.slopeW[0]; - scan.w[1] += scan.slopeW[1]; -#endif - -#ifdef IPOL_C0 - scan.c[0][0] += scan.slopeC[0][0]; - scan.c[0][1] += scan.slopeC[0][1]; -#endif - -#ifdef IPOL_T0 - scan.t[0][0] += scan.slopeT[0][0]; - scan.t[0][1] += scan.slopeT[0][1]; -#endif - -#ifdef IPOL_T1 - scan.t[1][0] += scan.slopeT[1][0]; - scan.t[1][1] += scan.slopeT[1][1]; -#endif - - } - } - -} - - -} // end namespace video -} // end namespace irr - -#endif // _IRR_COMPILE_WITH_BURNINGSVIDEO_ - -namespace irr -{ -namespace video -{ - - -//! creates a flat triangle renderer -IBurningShader* createTRTextureGouraudAlpha(CBurningVideoDriver* driver) -{ - //ETR_TEXTURE_GOURAUD_ALPHA - #ifdef _IRR_COMPILE_WITH_BURNINGSVIDEO_ - return new CTRTextureGouraudAlpha2(driver); - #else - return 0; - #endif // _IRR_COMPILE_WITH_BURNINGSVIDEO_ -} - - -} // end namespace video -} // end namespace irr - - diff --git a/source/Irrlicht/CTRTextureGouraudAlphaNoZ.cpp b/source/Irrlicht/CTRTextureGouraudAlphaNoZ.cpp deleted file mode 100644 index 2d7b9165..00000000 --- a/source/Irrlicht/CTRTextureGouraudAlphaNoZ.cpp +++ /dev/null @@ -1,1249 +0,0 @@ -// Copyright (C) 2002-2012 Nikolaus Gebhardt / Thomas Alten -// This file is part of the "Irrlicht Engine". -// For conditions of distribution and use, see copyright notice in irrlicht.h - -#include "IrrCompileConfig.h" -#include "IBurningShader.h" - -#ifdef _IRR_COMPILE_WITH_BURNINGSVIDEO_ - -// compile flag for this file -#undef USE_ZBUFFER -#undef IPOL_Z -#undef CMP_Z -#undef WRITE_Z - -#undef IPOL_W -#undef CMP_W -#undef WRITE_W - -#undef SUBTEXEL -#undef INVERSE_W - -#undef IPOL_C0 -#undef IPOL_C1 -#undef IPOL_T0 -#undef IPOL_T1 - -// define render case -#define SUBTEXEL -#define INVERSE_W - -#define USE_ZBUFFER -#define IPOL_W -#define CMP_W -//#define WRITE_W - -#define IPOL_C0 -//#define IPOL_C1 -#define IPOL_T0 -//#define IPOL_T1 - -// apply global override -#ifndef SOFTWARE_DRIVER_2_PERSPECTIVE_CORRECT - #undef INVERSE_W -#endif - -#ifndef SOFTWARE_DRIVER_2_SUBTEXEL - #undef SUBTEXEL -#endif - -#if BURNING_MATERIAL_MAX_COLORS < 1 - #undef IPOL_C0 -#endif - -#if BURNING_MATERIAL_MAX_COLORS < 2 - #undef IPOL_C1 -#endif - -#if !defined ( SOFTWARE_DRIVER_2_USE_WBUFFER ) && defined ( USE_ZBUFFER ) - #ifndef SOFTWARE_DRIVER_2_PERSPECTIVE_CORRECT - #undef IPOL_W - #endif - #define IPOL_Z - - #ifdef CMP_W - #undef CMP_W - #define CMP_Z - #endif - - #ifdef WRITE_W - #undef WRITE_W - #define WRITE_Z - #endif - -#endif - - - -namespace irr -{ - -namespace video -{ - -class CTRTextureGouraudAlphaNoZ : public IBurningShader -{ -public: - - //! constructor - CTRTextureGouraudAlphaNoZ(CBurningVideoDriver* driver); - - //! draws an indexed triangle list - virtual void drawTriangle(const s4DVertex* burning_restrict a, const s4DVertex* burning_restrict b, const s4DVertex* burning_restrict c) _IRR_OVERRIDE_; - virtual void OnSetMaterial(const SBurningShaderMaterial& material) _IRR_OVERRIDE_; - -private: - - // fragment shader - typedef void (CTRTextureGouraudAlphaNoZ::*tFragmentShader) (); - void fragment_linear(); - void fragment_linear_test(); - void fragment_point_noz(); - - tFragmentShader fragmentShader; - - -}; - -//! constructor -CTRTextureGouraudAlphaNoZ::CTRTextureGouraudAlphaNoZ(CBurningVideoDriver* driver) -: IBurningShader(driver) -{ - #ifdef _DEBUG - setDebugName("CTRTextureGouraudAlphaNoZ"); - #endif - - fragmentShader = &CTRTextureGouraudAlphaNoZ::fragment_linear; -} - - -/*! -*/ -void CTRTextureGouraudAlphaNoZ::OnSetMaterial(const SBurningShaderMaterial& material) -{ -#if defined(BURNINGVIDEO_RENDERER_FAST) && COLOR_MAX==0xff - AlphaRef = core::floor32(material.org.MaterialTypeParam * 256.f); -#else - AlphaRef = tofix(material.org.MaterialTypeParam, FIXPOINT_COLOR_MAX); -#endif - - //check triangle on w = 1.f instead.. -#ifdef SOFTWARE_DRIVER_2_BILINEAR - if (material.Fallback_MaterialType == EMT_TRANSPARENT_ALPHA_CHANNEL_REF) - fragmentShader = &CTRTextureGouraudAlphaNoZ::fragment_linear_test; - else - if ( material.org.TextureLayer[0].BilinearFilter ) - fragmentShader = &CTRTextureGouraudAlphaNoZ::fragment_linear; - else - -#endif - fragmentShader = &CTRTextureGouraudAlphaNoZ::fragment_point_noz; - -} - -/*! -*/ -void CTRTextureGouraudAlphaNoZ::fragment_linear() -{ - tVideoSample *dst; - -#ifdef USE_ZBUFFER - fp24 *z; -#endif - - s32 xStart; - s32 xEnd; - s32 dx; - - -#ifdef SUBTEXEL - f32 subPixel; -#endif - -#ifdef IPOL_Z - f32 slopeZ; -#endif -#ifdef IPOL_W - fp24 slopeW; -#endif -#ifdef IPOL_C0 - sVec4 slopeC[BURNING_MATERIAL_MAX_COLORS]; -#endif -#ifdef IPOL_T0 - sVec2 slopeT[BURNING_MATERIAL_MAX_TEXTURES]; -#endif - - // apply top-left fill-convention, left - xStart = fill_convention_left( line.x[0] ); - xEnd = fill_convention_right( line.x[1] ); - - dx = xEnd - xStart; - - if ( dx < 0 ) - return; - - // slopes - const f32 invDeltaX = fill_step_x( line.x[1] - line.x[0] ); - -#ifdef IPOL_Z - slopeZ = (line.z[1] - line.z[0]) * invDeltaX; -#endif -#ifdef IPOL_W - slopeW = (line.w[1] - line.w[0]) * invDeltaX; -#endif -#ifdef IPOL_C0 - slopeC[0] = (line.c[0][1] - line.c[0][0]) * invDeltaX; -#endif -#ifdef IPOL_C1 - slopeC[1] = (line.c[1][1] - line.c[1][0]) * invDeltaX; -#endif -#ifdef IPOL_T0 - slopeT[0] = (line.t[0][1] - line.t[0][0]) * invDeltaX; -#endif -#ifdef IPOL_T1 - slopeT[1] = (line.t[1][1] - line.t[1][0]) * invDeltaX; -#endif - -#ifdef SUBTEXEL - subPixel = ( (f32) xStart ) - line.x[0]; -#ifdef IPOL_Z - line.z[0] += slopeZ * subPixel; -#endif -#ifdef IPOL_W - line.w[0] += slopeW * subPixel; -#endif -#ifdef IPOL_C0 - line.c[0][0] += slopeC[0] * subPixel; -#endif -#ifdef IPOL_C1 - line.c[1][0] += slopeC[1] * subPixel; -#endif -#ifdef IPOL_T0 - line.t[0][0] += slopeT[0] * subPixel; -#endif -#ifdef IPOL_T1 - line.t[1][0] += slopeT[1] * subPixel; -#endif -#endif - - SOFTWARE_DRIVER_2_CLIPCHECK; - dst = (tVideoSample*)RenderTarget->getData() + ( line.y * RenderTarget->getDimension().Width ) + xStart; - -#ifdef USE_ZBUFFER - z = (fp24*) DepthBuffer->lock() + ( line.y * RenderTarget->getDimension().Width ) + xStart; -#endif - - - f32 inversew = FIX_POINT_F32_MUL; - -#if defined(BURNINGVIDEO_RENDERER_FAST) && COLOR_MAX==0xff - u32 dIndex = ( line.y & 3 ) << 2; - -#else - tFixPoint a0; - tFixPoint r0, g0, b0; -#endif - -#ifdef IPOL_C0 - tFixPoint r1, g1, b1; - tFixPoint a2,r2, g2, b2; -#endif - -#ifdef IPOL_C1 - tFixPoint a3,r3, g3, b3; -#endif - - for ( s32 i = 0; i <= dx; i += SOFTWARE_DRIVER_2_STEP_X) - { -#ifdef CMP_Z - if ( line.z[0] < z[i] ) -#endif -#ifdef CMP_W - if ( line.w[0] >= z[i] ) -#endif - scissor_test_x - { - -#if defined(BURNINGVIDEO_RENDERER_FAST) && COLOR_MAX==0xff - - const tFixPointu d = dithermask [ dIndex | ( i ) & 3 ]; - -#ifdef INVERSE_W - inversew = fix_inverse32 ( line.w[0] ); -#endif - u32 argb = getTexel_plain ( &IT[0], d + tofix ( line.t[0][0].x,inversew), - d + tofix ( line.t[0][0].y,inversew) - ); - - const tFixPoint alpha = ( argb >> 24 ); - if ( alpha > AlphaRef ) - { -#ifdef WRITE_Z - z[i] = line.z[0]; -#endif -#ifdef WRITE_W - z[i] = line.w[0]; -#endif - - dst[i] = PixelBlend32 ( dst[i], argb, alpha ); - } - - -#else - -#ifdef INVERSE_W - inversew = fix_inverse32 ( line.w[0] ); -#endif - getSample_texture ( a0, r0, g0, b0, - &IT[0], - tofix ( line.t[0][0].x,inversew), - tofix ( line.t[0][0].y,inversew) - ); - - if ( a0 > AlphaRef ) - { -#ifdef WRITE_Z - z[i] = line.z[0]; -#endif -#ifdef WRITE_W - z[i] = line.w[0]; -#endif - -#ifdef IPOL_C0 - - vec4_to_fix( a2,r2, g2, b2, line.c[0][0], inversew ); - - //a0 = imulFix(a0, a2); //2D uses vertexalpha*texelalpha - r0 = imulFix_simple( r0, r2 ); - g0 = imulFix_simple( g0, g2 ); - b0 = imulFix_simple( b0, b2 ); - - color_to_fix ( r1, g1, b1, dst[i] ); - - fix_color_norm(a0); - - r2 = r1 + imulFix ( a0, r0 - r1 ); - g2 = g1 + imulFix ( a0, g0 - g1 ); - b2 = b1 + imulFix ( a0, b0 - b1 ); - dst[i] = fix4_to_sample( a0, r2, g2, b2 ); - -#else - dst[i] = PixelBlend32 ( dst[i], - fix_to_sample( r0,g0, b0 ), - fixPointu_to_u32 ( a0 ) - ); -#endif - - } -#endif - - } - -#ifdef IPOL_Z - line.z[0] += slopeZ; -#endif -#ifdef IPOL_W - line.w[0] += slopeW; -#endif -#ifdef IPOL_C0 - line.c[0][0] += slopeC[0]; -#endif -#ifdef IPOL_C1 - line.c[1][0] += slopeC[1]; -#endif -#ifdef IPOL_T0 - line.t[0][0] += slopeT[0]; -#endif -#ifdef IPOL_T1 - line.t[1][0] += slopeT[1]; -#endif - } - -} - -/*! -*/ -void CTRTextureGouraudAlphaNoZ::fragment_linear_test() -{ - tVideoSample *dst; - -#ifdef USE_ZBUFFER - fp24 *z; -#endif - - s32 xStart; - s32 xEnd; - s32 dx; - - -#ifdef SUBTEXEL - f32 subPixel; -#endif - -#ifdef IPOL_Z - f32 slopeZ; -#endif -#ifdef IPOL_W - fp24 slopeW; -#endif -#ifdef IPOL_C0 - sVec4 slopeC[BURNING_MATERIAL_MAX_COLORS]; -#endif -#ifdef IPOL_T0 - sVec2 slopeT[BURNING_MATERIAL_MAX_TEXTURES]; -#endif - - // apply top-left fill-convention, left - xStart = fill_convention_left(line.x[0]); - xEnd = fill_convention_right(line.x[1]); - - dx = xEnd - xStart; - - if (dx < 0) - return; - - // slopes - const f32 invDeltaX = fill_step_x(line.x[1] - line.x[0]); - -#ifdef IPOL_Z - slopeZ = (line.z[1] - line.z[0]) * invDeltaX; -#endif -#ifdef IPOL_W - slopeW = (line.w[1] - line.w[0]) * invDeltaX; -#endif -#ifdef IPOL_C0 - slopeC[0] = (line.c[0][1] - line.c[0][0]) * invDeltaX; -#endif -#ifdef IPOL_C1 - slopeC[1] = (line.c[1][1] - line.c[1][0]) * invDeltaX; -#endif -#ifdef IPOL_T0 - slopeT[0] = (line.t[0][1] - line.t[0][0]) * invDeltaX; -#endif -#ifdef IPOL_T1 - slopeT[1] = (line.t[1][1] - line.t[1][0]) * invDeltaX; -#endif - -#ifdef SUBTEXEL - subPixel = ((f32)xStart) - line.x[0]; -#ifdef IPOL_Z - line.z[0] += slopeZ * subPixel; -#endif -#ifdef IPOL_W - line.w[0] += slopeW * subPixel; -#endif -#ifdef IPOL_C0 - line.c[0][0] += slopeC[0] * subPixel; -#endif -#ifdef IPOL_C1 - line.c[1][0] += slopeC[1] * subPixel; -#endif -#ifdef IPOL_T0 - line.t[0][0] += slopeT[0] * subPixel; -#endif -#ifdef IPOL_T1 - line.t[1][0] += slopeT[1] * subPixel; -#endif -#endif - - SOFTWARE_DRIVER_2_CLIPCHECK; - dst = (tVideoSample*)RenderTarget->getData() + (line.y * RenderTarget->getDimension().Width) + xStart; - -#ifdef USE_ZBUFFER - z = (fp24*)DepthBuffer->lock() + (line.y * RenderTarget->getDimension().Width) + xStart; -#endif - - - f32 inversew = FIX_POINT_F32_MUL; - -#if defined(BURNINGVIDEO_RENDERER_FAST) && COLOR_MAX==0xff - u32 dIndex = (line.y & 3) << 2; - -#else - tFixPoint a0; - tFixPoint r0, g0, b0; -#endif - -#ifdef IPOL_C0 - tFixPoint r1, g1, b1; - tFixPoint a2, r2, g2, b2; -#endif - -#ifdef IPOL_C1 - tFixPoint a3, r3, g3, b3; -#endif - - for (s32 i = 0; i <= dx; i += SOFTWARE_DRIVER_2_STEP_X) - { -#ifdef CMP_Z - if (line.z[0] < z[i]) -#endif -#ifdef CMP_W - if (line.w[0] >= z[i]) -#endif - scissor_test_x - { - -#if defined(BURNINGVIDEO_RENDERER_FAST) && COLOR_MAX==0xff - - const tFixPointu d = dithermask[dIndex | (i) & 3]; - -#ifdef INVERSE_W - inversew = fix_inverse32(line.w[0]); -#endif - u32 argb = getTexel_plain(&IT[0], d + tofix(line.t[0][0].x, inversew), - d + tofix(line.t[0][0].y, inversew) - ); - - const tFixPoint alpha = (argb >> 24); - if (alpha > AlphaRef) - { -#ifdef WRITE_Z - z[i] = line.z[0]; -#endif -#ifdef WRITE_W - z[i] = line.w[0]; -#endif - - dst[i] = PixelBlend32(dst[i], argb, alpha); - } - - -#else - -#ifdef INVERSE_W - inversew = fix_inverse32(line.w[0]); -#endif - getSample_texture(a0, r0, g0, b0, - &IT[0], - tofix(line.t[0][0].x, inversew), - tofix(line.t[0][0].y, inversew) - ); - - if (a0 > AlphaRef) - { -#ifdef WRITE_Z - z[i] = line.z[0]; -#endif -#ifdef WRITE_W - z[i] = line.w[0]; -#endif - -#ifdef IPOL_C0 - - vec4_to_fix(a2, r2, g2, b2, line.c[0][0], inversew); - - a0 = imulFix(a0, a2); //2D uses vertexalpha*texelalpha - r0 = imulFix(r0, r2); - g0 = imulFix(g0, g2); - b0 = imulFix(b0, b2); - - color_to_fix(r1, g1, b1, dst[i]); - - fix_color_norm(a0); - - r2 = r1 + imulFix(a0, r0 - r1); - g2 = g1 + imulFix(a0, g0 - g1); - b2 = b1 + imulFix(a0, b0 - b1); - dst[i] = fix4_to_sample(a0, r2, g2, b2); - -#else - dst[i] = PixelBlend32(dst[i], - fix_to_sample(r0, g0, b0), - fixPointu_to_u32(a0) - ); -#endif - - } -#endif - - } - -#ifdef IPOL_Z - line.z[0] += slopeZ; -#endif -#ifdef IPOL_W - line.w[0] += slopeW; -#endif -#ifdef IPOL_C0 - line.c[0][0] += slopeC[0]; -#endif -#ifdef IPOL_C1 - line.c[1][0] += slopeC[1]; -#endif -#ifdef IPOL_T0 - line.t[0][0] += slopeT[0]; -#endif -#ifdef IPOL_T1 - line.t[1][0] += slopeT[1]; -#endif - } - -} - - -/*! -*/ -void CTRTextureGouraudAlphaNoZ::fragment_point_noz() -{ - tVideoSample *dst; - -#ifdef USE_ZBUFFER - //fp24 *z; -#endif - - s32 xStart; - s32 xEnd; - s32 dx; - - -#ifdef SUBTEXEL - f32 subPixel; -#endif - -#ifdef IPOL_Z - f32 slopeZ; -#endif -#ifdef IPOL_W - fp24 slopeW; -#endif -#ifdef IPOL_C0 - sVec4 slopeC[BURNING_MATERIAL_MAX_COLORS]; -#endif -#ifdef IPOL_T0 - sVec2 slopeT[BURNING_MATERIAL_MAX_TEXTURES]; -#endif - - // apply top-left fill-convention, left - xStart = fill_convention_left(line.x[0]); - xEnd = fill_convention_right(line.x[1]); - - dx = xEnd - xStart; - - if (dx < 0) - return; - - // slopes - const f32 invDeltaX = fill_step_x(line.x[1] - line.x[0]); - -#ifdef IPOL_Z - slopeZ = (line.z[1] - line.z[0]) * invDeltaX; -#endif -#ifdef IPOL_W - slopeW = (line.w[1] - line.w[0]) * invDeltaX; -#endif -#ifdef IPOL_C0 - slopeC[0] = (line.c[0][1] - line.c[0][0]) * invDeltaX; -#endif -#ifdef IPOL_C1 - slopeC[1] = (line.c[1][1] - line.c[1][0]) * invDeltaX; -#endif -#ifdef IPOL_T0 - slopeT[0] = (line.t[0][1] - line.t[0][0]) * invDeltaX; -#endif -#ifdef IPOL_T1 - slopeT[1] = (line.t[1][1] - line.t[1][0]) * invDeltaX; -#endif - -#ifdef SUBTEXEL - subPixel = ((f32)xStart) - line.x[0]; -#ifdef IPOL_Z - line.z[0] += slopeZ * subPixel; -#endif -#ifdef IPOL_W - line.w[0] += slopeW * subPixel; -#endif -#ifdef IPOL_C0 - line.c[0][0] += slopeC[0] * subPixel; -#endif -#ifdef IPOL_C1 - line.c[1][0] += slopeC[1] * subPixel; -#endif -#ifdef IPOL_T0 - line.t[0][0] += slopeT[0] * subPixel; -#endif -#ifdef IPOL_T1 - line.t[1][0] += slopeT[1] * subPixel; -#endif -#endif - - SOFTWARE_DRIVER_2_CLIPCHECK; - dst = (tVideoSample*)RenderTarget->getData() + (line.y * RenderTarget->getDimension().Width) + xStart; - -#ifdef USE_ZBUFFER - //z = (fp24*)DepthBuffer->lock() + (line.y * RenderTarget->getDimension().Width) + xStart; -#endif - - - f32 inversew = FIX_POINT_F32_MUL; - -#if defined(BURNINGVIDEO_RENDERER_FAST) && COLOR_MAX==0xff - u32 dIndex = (line.y & 3) << 2; - -#else - tFixPoint a0; - tFixPoint r0, g0, b0; -#endif - -#ifdef IPOL_C0 - tFixPoint r1, g1, b1; - tFixPoint a2,r2, g2, b2; -#endif - -#ifdef IPOL_C1 - tFixPoint a3, r3, g3, b3; -#endif - for (s32 i = 0; i <= dx; i += SOFTWARE_DRIVER_2_STEP_X) - { -#ifdef CMP_Z - //if (line.z[0] < z[i]) -#endif -#ifdef CMP_W -// if (line.w[0] >= z[i]) -#endif - scissor_test_x - { - -#if defined(BURNINGVIDEO_RENDERER_FAST) && COLOR_MAX==0xff - - const tFixPointu d = dithermask[dIndex | (i) & 3]; - -#ifdef INVERSE_W - inversew = fix_inverse32(line.w[0]); -#endif - u32 argb = getTexel_plain(&IT[0], d + tofix(line.t[0][0].x, inversew), - d + tofix(line.t[0][0].y, inversew) - ); - - const tFixPoint alpha = (argb >> 24); - if (alpha > AlphaRef) - { -#ifdef WRITE_Z - z[i] = line.z[0]; -#endif -#ifdef WRITE_W - z[i] = line.w[0]; -#endif - - dst[i] = PixelBlend32(dst[i], argb, alpha); - } - - -#else - -#ifdef INVERSE_W - //inversew = fix_inverse32(line.w[0]); -#endif - getTexel_fix(a0, r0, g0, b0, - &IT[0], - tofix(line.t[0][0].x, inversew), - tofix(line.t[0][0].y, inversew) - ); - - if (a0 > AlphaRef) - { -#ifdef WRITE_Z - z[i] = line.z[0]; -#endif -#ifdef WRITE_W - //z[i] = line.w[0]; -#endif - -#ifdef IPOL_C0 - - vec4_to_fix(a2,r2, g2, b2, line.c[0][0], inversew); - - a0 = imulFix(a0, a2); //2D uses vertexalpha*texelalpha - r0 = imulFix(r0, r2); - g0 = imulFix(g0, g2); - b0 = imulFix(b0, b2); - - color_to_fix(r1, g1, b1, dst[i]); - - fix_color_norm(a0); - - r2 = r1 + imulFix(a0, r0 - r1); - g2 = g1 + imulFix(a0, g0 - g1); - b2 = b1 + imulFix(a0, b0 - b1); - dst[i] = fix4_to_sample(a0, r2, g2, b2); - -#else - dst[i] = PixelBlend32(dst[i], - fix_to_sample(r0, g0, b0), - fixPointu_to_u32(a0) - ); -#endif - - } -#endif - - } - -#ifdef IPOL_Z - line.z[0] += slopeZ; -#endif -#ifdef IPOL_W - //line.w[0] += slopeW; -#endif -#ifdef IPOL_C0 - line.c[0][0] += slopeC[0]; -#endif -#ifdef IPOL_C1 - line.c[1][0] += slopeC[1]; -#endif -#ifdef IPOL_T0 - line.t[0][0] += slopeT[0]; -#endif -#ifdef IPOL_T1 - line.t[1][0] += slopeT[1]; -#endif - } - -} - -void CTRTextureGouraudAlphaNoZ::drawTriangle(const s4DVertex* burning_restrict a, const s4DVertex* burning_restrict b, const s4DVertex* burning_restrict c) -{ - // sort on height, y - if ( F32_A_GREATER_B ( a->Pos.y , b->Pos.y ) ) swapVertexPointer(&a, &b); - if ( F32_A_GREATER_B ( b->Pos.y , c->Pos.y ) ) swapVertexPointer(&b, &c); - if ( F32_A_GREATER_B ( a->Pos.y , b->Pos.y ) ) swapVertexPointer(&a, &b); - - const f32 ca = c->Pos.y - a->Pos.y; - const f32 ba = b->Pos.y - a->Pos.y; - const f32 cb = c->Pos.y - b->Pos.y; - // calculate delta y of the edges - scan.invDeltaY[0] = fill_step_y( ca ); - scan.invDeltaY[1] = fill_step_y( ba ); - scan.invDeltaY[2] = fill_step_y( cb ); - - if ( F32_LOWER_EQUAL_0 ( scan.invDeltaY[0] ) ) - return; - - // find if the major edge is left or right aligned - f32 temp[4]; - - temp[0] = a->Pos.x - c->Pos.x; - temp[1] = -ca; - temp[2] = b->Pos.x - a->Pos.x; - temp[3] = ba; - - scan.left = ( temp[0] * temp[3] - temp[1] * temp[2] ) > 0.f ? 0 : 1; - scan.right = 1 - scan.left; - - // calculate slopes for the major edge - scan.slopeX[0] = (c->Pos.x - a->Pos.x) * scan.invDeltaY[0]; - scan.x[0] = a->Pos.x; - -#ifdef IPOL_Z - scan.slopeZ[0] = (c->Pos.z - a->Pos.z) * scan.invDeltaY[0]; - scan.z[0] = a->Pos.z; -#endif - -#ifdef IPOL_W - scan.slopeW[0] = (c->Pos.w - a->Pos.w) * scan.invDeltaY[0]; - scan.w[0] = a->Pos.w; -#endif - -#ifdef IPOL_C0 - scan.slopeC[0][0] = (c->Color[0] - a->Color[0]) * scan.invDeltaY[0]; - scan.c[0][0] = a->Color[0]; -#endif - -#ifdef IPOL_C1 - scan.slopeC[1][0] = (c->Color[1] - a->Color[1]) * scan.invDeltaY[0]; - scan.c[1][0] = a->Color[1]; -#endif - -#ifdef IPOL_T0 - scan.slopeT[0][0] = (c->Tex[0] - a->Tex[0]) * scan.invDeltaY[0]; - scan.t[0][0] = a->Tex[0]; -#endif - -#ifdef IPOL_T1 - scan.slopeT[1][0] = (c->Tex[1] - a->Tex[1]) * scan.invDeltaY[0]; - scan.t[1][0] = a->Tex[1]; -#endif - - // top left fill convention y run - s32 yStart; - s32 yEnd; - -#ifdef SUBTEXEL - f32 subPixel; -#endif - - // rasterize upper sub-triangle - if ( (f32) 0.0 != scan.invDeltaY[1] ) - { - // calculate slopes for top edge - scan.slopeX[1] = (b->Pos.x - a->Pos.x) * scan.invDeltaY[1]; - scan.x[1] = a->Pos.x; - -#ifdef IPOL_Z - scan.slopeZ[1] = (b->Pos.z - a->Pos.z) * scan.invDeltaY[1]; - scan.z[1] = a->Pos.z; -#endif - -#ifdef IPOL_W - scan.slopeW[1] = (b->Pos.w - a->Pos.w) * scan.invDeltaY[1]; - scan.w[1] = a->Pos.w; -#endif - -#ifdef IPOL_C0 - scan.slopeC[0][1] = (b->Color[0] - a->Color[0]) * scan.invDeltaY[1]; - scan.c[0][1] = a->Color[0]; -#endif - -#ifdef IPOL_C1 - scan.slopeC[1][1] = (b->Color[1] - a->Color[1]) * scan.invDeltaY[1]; - scan.c[1][1] = a->Color[1]; -#endif - -#ifdef IPOL_T0 - scan.slopeT[0][1] = (b->Tex[0] - a->Tex[0]) * scan.invDeltaY[1]; - scan.t[0][1] = a->Tex[0]; -#endif - -#ifdef IPOL_T1 - scan.slopeT[1][1] = (b->Tex[1] - a->Tex[1]) * scan.invDeltaY[1]; - scan.t[1][1] = a->Tex[1]; -#endif - - // apply top-left fill convention, top part - yStart = fill_convention_left( a->Pos.y ); - yEnd = fill_convention_right( b->Pos.y ); - -#ifdef SUBTEXEL - subPixel = ( (f32) yStart ) - a->Pos.y; - - // correct to pixel center - scan.x[0] += scan.slopeX[0] * subPixel; - scan.x[1] += scan.slopeX[1] * subPixel; - -#ifdef IPOL_Z - scan.z[0] += scan.slopeZ[0] * subPixel; - scan.z[1] += scan.slopeZ[1] * subPixel; -#endif - -#ifdef IPOL_W - scan.w[0] += scan.slopeW[0] * subPixel; - scan.w[1] += scan.slopeW[1] * subPixel; -#endif - -#ifdef IPOL_C0 - scan.c[0][0] += scan.slopeC[0][0] * subPixel; - scan.c[0][1] += scan.slopeC[0][1] * subPixel; -#endif - -#ifdef IPOL_C1 - scan.c[1][0] += scan.slopeC[1][0] * subPixel; - scan.c[1][1] += scan.slopeC[1][1] * subPixel; -#endif - -#ifdef IPOL_T0 - scan.t[0][0] += scan.slopeT[0][0] * subPixel; - scan.t[0][1] += scan.slopeT[0][1] * subPixel; -#endif - -#ifdef IPOL_T1 - scan.t[1][0] += scan.slopeT[1][0] * subPixel; - scan.t[1][1] += scan.slopeT[1][1] * subPixel; -#endif - -#endif - - // rasterize the edge scanlines - for( line.y = yStart; line.y <= yEnd; line.y += SOFTWARE_DRIVER_2_STEP_Y) - { - line.x[scan.left] = scan.x[0]; - line.x[scan.right] = scan.x[1]; - -#ifdef IPOL_Z - line.z[scan.left] = scan.z[0]; - line.z[scan.right] = scan.z[1]; -#endif - -#ifdef IPOL_W - line.w[scan.left] = scan.w[0]; - line.w[scan.right] = scan.w[1]; -#endif - -#ifdef IPOL_C0 - line.c[0][scan.left] = scan.c[0][0]; - line.c[0][scan.right] = scan.c[0][1]; -#endif - -#ifdef IPOL_C1 - line.c[1][scan.left] = scan.c[1][0]; - line.c[1][scan.right] = scan.c[1][1]; -#endif - -#ifdef IPOL_T0 - line.t[0][scan.left] = scan.t[0][0]; - line.t[0][scan.right] = scan.t[0][1]; -#endif - -#ifdef IPOL_T1 - line.t[1][scan.left] = scan.t[1][0]; - line.t[1][scan.right] = scan.t[1][1]; -#endif - - // render a scanline - interlace_scanline - scissor_test_y - (this->*fragmentShader) (); - - scan.x[0] += scan.slopeX[0]; - scan.x[1] += scan.slopeX[1]; - -#ifdef IPOL_Z - scan.z[0] += scan.slopeZ[0]; - scan.z[1] += scan.slopeZ[1]; -#endif - -#ifdef IPOL_W - scan.w[0] += scan.slopeW[0]; - scan.w[1] += scan.slopeW[1]; -#endif - -#ifdef IPOL_C0 - scan.c[0][0] += scan.slopeC[0][0]; - scan.c[0][1] += scan.slopeC[0][1]; -#endif - -#ifdef IPOL_C1 - scan.c[1][0] += scan.slopeC[1][0]; - scan.c[1][1] += scan.slopeC[1][1]; -#endif - -#ifdef IPOL_T0 - scan.t[0][0] += scan.slopeT[0][0]; - scan.t[0][1] += scan.slopeT[0][1]; -#endif - -#ifdef IPOL_T1 - scan.t[1][0] += scan.slopeT[1][0]; - scan.t[1][1] += scan.slopeT[1][1]; -#endif - - } - } - - // rasterize lower sub-triangle - if ( (f32) 0.0 != scan.invDeltaY[2] ) - { - // advance to middle point - if( (f32) 0.0 != scan.invDeltaY[1] ) - { - temp[0] = b->Pos.y - a->Pos.y; // dy - - scan.x[0] = a->Pos.x + scan.slopeX[0] * temp[0]; -#ifdef IPOL_Z - scan.z[0] = a->Pos.z + scan.slopeZ[0] * temp[0]; -#endif -#ifdef IPOL_W - scan.w[0] = a->Pos.w + scan.slopeW[0] * temp[0]; -#endif -#ifdef IPOL_C0 - scan.c[0][0] = a->Color[0] + scan.slopeC[0][0] * temp[0]; -#endif -#ifdef IPOL_C1 - scan.c[1][0] = a->Color[1] + scan.slopeC[1][0] * temp[0]; -#endif - -#ifdef IPOL_T0 - scan.t[0][0] = a->Tex[0] + scan.slopeT[0][0] * temp[0]; -#endif -#ifdef IPOL_T1 - scan.t[1][0] = a->Tex[1] + scan.slopeT[1][0] * temp[0]; -#endif - - } - - // calculate slopes for bottom edge - scan.slopeX[1] = (c->Pos.x - b->Pos.x) * scan.invDeltaY[2]; - scan.x[1] = b->Pos.x; - -#ifdef IPOL_Z - scan.slopeZ[1] = (c->Pos.z - b->Pos.z) * scan.invDeltaY[2]; - scan.z[1] = b->Pos.z; -#endif - -#ifdef IPOL_W - scan.slopeW[1] = (c->Pos.w - b->Pos.w) * scan.invDeltaY[2]; - scan.w[1] = b->Pos.w; -#endif - -#ifdef IPOL_C0 - scan.slopeC[0][1] = (c->Color[0] - b->Color[0]) * scan.invDeltaY[2]; - scan.c[0][1] = b->Color[0]; -#endif - -#ifdef IPOL_C1 - scan.slopeC[1][1] = (c->Color[1] - b->Color[1]) * scan.invDeltaY[2]; - scan.c[1][1] = b->Color[1]; -#endif - -#ifdef IPOL_T0 - scan.slopeT[0][1] = (c->Tex[0] - b->Tex[0]) * scan.invDeltaY[2]; - scan.t[0][1] = b->Tex[0]; -#endif - -#ifdef IPOL_T1 - scan.slopeT[1][1] = (c->Tex[1] - b->Tex[1]) * scan.invDeltaY[2]; - scan.t[1][1] = b->Tex[1]; -#endif - - // apply top-left fill convention, top part - yStart = fill_convention_left( b->Pos.y ); - yEnd = fill_convention_right( c->Pos.y ); - -#ifdef SUBTEXEL - subPixel = ( (f32) yStart ) - b->Pos.y; - - // correct to pixel center - scan.x[0] += scan.slopeX[0] * subPixel; - scan.x[1] += scan.slopeX[1] * subPixel; - -#ifdef IPOL_Z - scan.z[0] += scan.slopeZ[0] * subPixel; - scan.z[1] += scan.slopeZ[1] * subPixel; -#endif - -#ifdef IPOL_W - scan.w[0] += scan.slopeW[0] * subPixel; - scan.w[1] += scan.slopeW[1] * subPixel; -#endif - -#ifdef IPOL_C0 - scan.c[0][0] += scan.slopeC[0][0] * subPixel; - scan.c[0][1] += scan.slopeC[0][1] * subPixel; -#endif - -#ifdef IPOL_C1 - scan.c[1][0] += scan.slopeC[1][0] * subPixel; - scan.c[1][1] += scan.slopeC[1][1] * subPixel; -#endif - -#ifdef IPOL_T0 - scan.t[0][0] += scan.slopeT[0][0] * subPixel; - scan.t[0][1] += scan.slopeT[0][1] * subPixel; -#endif - -#ifdef IPOL_T1 - scan.t[1][0] += scan.slopeT[1][0] * subPixel; - scan.t[1][1] += scan.slopeT[1][1] * subPixel; -#endif - -#endif - - // rasterize the edge scanlines - for( line.y = yStart; line.y <= yEnd; line.y += SOFTWARE_DRIVER_2_STEP_Y) - { - line.x[scan.left] = scan.x[0]; - line.x[scan.right] = scan.x[1]; - -#ifdef IPOL_Z - line.z[scan.left] = scan.z[0]; - line.z[scan.right] = scan.z[1]; -#endif - -#ifdef IPOL_W - line.w[scan.left] = scan.w[0]; - line.w[scan.right] = scan.w[1]; -#endif - -#ifdef IPOL_C0 - line.c[0][scan.left] = scan.c[0][0]; - line.c[0][scan.right] = scan.c[0][1]; -#endif - -#ifdef IPOL_C1 - line.c[1][scan.left] = scan.c[1][0]; - line.c[1][scan.right] = scan.c[1][1]; -#endif - -#ifdef IPOL_T0 - line.t[0][scan.left] = scan.t[0][0]; - line.t[0][scan.right] = scan.t[0][1]; -#endif - -#ifdef IPOL_T1 - line.t[1][scan.left] = scan.t[1][0]; - line.t[1][scan.right] = scan.t[1][1]; -#endif - - // render a scanline - interlace_scanline - scissor_test_y - (this->*fragmentShader) (); - - scan.x[0] += scan.slopeX[0]; - scan.x[1] += scan.slopeX[1]; - -#ifdef IPOL_Z - scan.z[0] += scan.slopeZ[0]; - scan.z[1] += scan.slopeZ[1]; -#endif - -#ifdef IPOL_W - scan.w[0] += scan.slopeW[0]; - scan.w[1] += scan.slopeW[1]; -#endif - -#ifdef IPOL_C0 - scan.c[0][0] += scan.slopeC[0][0]; - scan.c[0][1] += scan.slopeC[0][1]; -#endif - -#ifdef IPOL_C1 - scan.c[1][0] += scan.slopeC[1][0]; - scan.c[1][1] += scan.slopeC[1][1]; -#endif - -#ifdef IPOL_T0 - scan.t[0][0] += scan.slopeT[0][0]; - scan.t[0][1] += scan.slopeT[0][1]; -#endif - -#ifdef IPOL_T1 - scan.t[1][0] += scan.slopeT[1][0]; - scan.t[1][1] += scan.slopeT[1][1]; -#endif - - } - } - - -} - - -} // end namespace video -} // end namespace irr - -#endif // _IRR_COMPILE_WITH_BURNINGSVIDEO_ - -namespace irr -{ -namespace video -{ - - -//! creates a flat triangle renderer -IBurningShader* createTRTextureGouraudAlphaNoZ(CBurningVideoDriver* driver) -{ - // ETR_TEXTURE_GOURAUD_ALPHA_NOZ - #ifdef _IRR_COMPILE_WITH_BURNINGSVIDEO_ - return new CTRTextureGouraudAlphaNoZ(driver); - #else - return 0; - #endif // _IRR_COMPILE_WITH_BURNINGSVIDEO_ -} - - - -} // end namespace video -} // end namespace irr - - diff --git a/source/Irrlicht/CTRTextureGouraudNoZ.cpp b/source/Irrlicht/CTRTextureGouraudNoZ.cpp deleted file mode 100644 index f6cd1456..00000000 --- a/source/Irrlicht/CTRTextureGouraudNoZ.cpp +++ /dev/null @@ -1,364 +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" -#include "CTRTextureGouraud.h" -#include "SColor.h" - -#ifdef _IRR_COMPILE_WITH_SOFTWARE_ - -namespace irr -{ -namespace video -{ - -class CTRTextureGouraudNoZ : public CTRTextureGouraud -{ -public: - - CTRTextureGouraudNoZ() - : CTRTextureGouraud(0) - { - #ifdef _DEBUG - setDebugName("CTRGouraudWireNoZ"); - #endif - } - - //! draws an indexed triangle list - virtual void drawIndexedTriangleList(S2DVertex* vertices, s32 vertexCount, const u16* indexList, s32 triangleCount) _IRR_OVERRIDE_ - { - const S2DVertex *v1, *v2, *v3; - - u16 color; - f32 tmpDiv; // temporary division factor - f32 longest; // saves the longest span - s32 height; // saves height of triangle - u16* targetSurface; // target pointer where to plot pixels - s32 spanEnd; // saves end of spans - f32 leftdeltaxf; // amount of pixels to increase on left side of triangle - f32 rightdeltaxf; // amount of pixels to increase on right side of triangle - s32 leftx, rightx; // position where we are - f32 leftxf, rightxf; // same as above, but as f32 values - s32 span; // current span - u16 *hSpanBegin, *hSpanEnd; // pointer used when plotting pixels - s32 leftR, leftG, leftB, rightR, rightG, rightB; // color values - s32 leftStepR, leftStepG, leftStepB, - rightStepR, rightStepG, rightStepB; // color steps - s32 spanR, spanG, spanB, spanStepR, spanStepG, spanStepB; // color interpolating values while drawing a span. - s32 leftTx, rightTx, leftTy, rightTy; // texture interpolating values - s32 leftTxStep, rightTxStep, leftTyStep, rightTyStep; // texture interpolating values - s32 spanTx, spanTy, spanTxStep, spanTyStep; // values of Texturecoords when drawing a span - core::rect<s32> TriangleRect; - - lockedSurface = (u16*)RenderTarget->getData(); - lockedTexture = (u16*)Texture->getData(); - - for (s32 i=0; i<triangleCount; ++i) - { - v1 = &vertices[*indexList]; - ++indexList; - v2 = &vertices[*indexList]; - ++indexList; - v3 = &vertices[*indexList]; - ++indexList; - - // back face culling - - if (BackFaceCullingEnabled) - { - s32 z = ((v3->Pos.X - v1->Pos.X) * (v3->Pos.Y - v2->Pos.Y)) - - ((v3->Pos.Y - v1->Pos.Y) * (v3->Pos.X - v2->Pos.X)); - - if (z < 0) - continue; - } - - //near plane clipping - - if (v1->ZValue<0 && v2->ZValue<0 && v3->ZValue<0) - continue; - - // sort for width for inscreen clipping - - if (v1->Pos.X > v2->Pos.X) swapVertices(&v1, &v2); - if (v1->Pos.X > v3->Pos.X) swapVertices(&v1, &v3); - if (v2->Pos.X > v3->Pos.X) swapVertices(&v2, &v3); - - if ((v1->Pos.X - v3->Pos.X) == 0) - continue; - - TriangleRect.UpperLeftCorner.X = v1->Pos.X; - TriangleRect.LowerRightCorner.X = v3->Pos.X; - - // sort for height for faster drawing. - - if (v1->Pos.Y > v2->Pos.Y) swapVertices(&v1, &v2); - if (v1->Pos.Y > v3->Pos.Y) swapVertices(&v1, &v3); - if (v2->Pos.Y > v3->Pos.Y) swapVertices(&v2, &v3); - - TriangleRect.UpperLeftCorner.Y = v1->Pos.Y; - TriangleRect.LowerRightCorner.Y = v3->Pos.Y; - - if (!TriangleRect.isRectCollided(ViewPortRect)) - continue; - - // calculate height of triangle - height = v3->Pos.Y - v1->Pos.Y; - if (!height) - continue; - - // calculate longest span - - longest = (v2->Pos.Y - v1->Pos.Y) / (f32)height * (v3->Pos.X - v1->Pos.X) + (v1->Pos.X - v2->Pos.X); - - spanEnd = v2->Pos.Y; - span = v1->Pos.Y; - leftxf = (f32)v1->Pos.X; - rightxf = (f32)v1->Pos.X; - - leftR = rightR = video::getRed(v1->Color)<<8; - leftG = rightG = video::getGreen(v1->Color)<<8; - leftB = rightB = video::getBlue(v1->Color)<<8; - leftTx = rightTx = v1->TCoords.X; - leftTy = rightTy = v1->TCoords.Y; - - targetSurface = lockedSurface + span * SurfaceWidth; - - if (longest < 0.0f) - { - tmpDiv = 1.0f / (f32)(v2->Pos.Y - v1->Pos.Y); - rightdeltaxf = (v2->Pos.X - v1->Pos.X) * tmpDiv; - rightStepR = (s32)(((s32)(video::getRed(v2->Color)<<8) - rightR) * tmpDiv); - rightStepG = (s32)(((s32)(video::getGreen(v2->Color)<<8) - rightG) * tmpDiv); - rightStepB = (s32)(((s32)(video::getBlue(v2->Color)<<8) - rightB) * tmpDiv); - rightTxStep = (s32)((v2->TCoords.X - rightTx) * tmpDiv); - rightTyStep = (s32)((v2->TCoords.Y - rightTy) * tmpDiv); - - tmpDiv = 1.0f / (f32)height; - leftdeltaxf = (v3->Pos.X - v1->Pos.X) * tmpDiv; - leftStepR = (s32)(((s32)(video::getRed(v3->Color)<<8) - leftR) * tmpDiv); - leftStepG = (s32)(((s32)(video::getGreen(v3->Color)<<8) - leftG) * tmpDiv); - leftStepB = (s32)(((s32)(video::getBlue(v3->Color)<<8) - leftB) * tmpDiv); - leftTxStep = (s32)((v3->TCoords.X - leftTx) * tmpDiv); - leftTyStep = (s32)((v3->TCoords.Y - leftTy) * tmpDiv); - } - else - { - tmpDiv = 1.0f / (f32)height; - rightdeltaxf = (v3->Pos.X - v1->Pos.X) * tmpDiv; - rightStepR = (s32)(((s32)(video::getRed(v3->Color)<<8) - rightR) * tmpDiv); - rightStepG = (s32)(((s32)(video::getGreen(v3->Color)<<8) - rightG) * tmpDiv); - rightStepB = (s32)(((s32)(video::getBlue(v3->Color)<<8) - rightB) * tmpDiv); - rightTxStep = (s32)((v3->TCoords.X - rightTx) * tmpDiv); - rightTyStep = (s32)((v3->TCoords.Y - rightTy) * tmpDiv); - - tmpDiv = 1.0f / (f32)(v2->Pos.Y - v1->Pos.Y); - leftdeltaxf = (v2->Pos.X - v1->Pos.X) * tmpDiv; - leftStepR = (s32)(((s32)(video::getRed(v2->Color)<<8) - leftR) * tmpDiv); - leftStepG = (s32)(((s32)(video::getGreen(v2->Color)<<8) - leftG) * tmpDiv); - leftStepB = (s32)(((s32)(video::getBlue(v2->Color)<<8) - leftB) * tmpDiv); - leftTxStep = (s32)((v2->TCoords.X - leftTx) * tmpDiv); - leftTyStep = (s32)((v2->TCoords.Y - leftTy) * tmpDiv); - } - - - // do it twice, once for the first half of the triangle, - // end then for the second half. - - for (s32 triangleHalf=0; triangleHalf<2; ++triangleHalf) - { - if (spanEnd > ViewPortRect.LowerRightCorner.Y) - spanEnd = ViewPortRect.LowerRightCorner.Y; - - // if the span <0, than we can skip these spans, - // and proceed to the next spans which are really on the screen. - if (span < ViewPortRect.UpperLeftCorner.Y) - { - // we'll use leftx as temp variable - if (spanEnd < ViewPortRect.UpperLeftCorner.Y) - { - leftx = spanEnd - span; - span = spanEnd; - } - else - { - leftx = ViewPortRect.UpperLeftCorner.Y - span; - span = ViewPortRect.UpperLeftCorner.Y; - } - - leftxf += leftdeltaxf*leftx; - rightxf += rightdeltaxf*leftx; - targetSurface += SurfaceWidth*leftx; - - leftR += leftStepR*leftx; - leftG += leftStepG*leftx; - leftB += leftStepB*leftx; - rightR += rightStepR*leftx; - rightG += rightStepG*leftx; - rightB += rightStepB*leftx; - - leftTx += leftTxStep*leftx; - leftTy += leftTyStep*leftx; - rightTx += rightTxStep*leftx; - rightTy += rightTyStep*leftx; - } - - - // the main loop. Go through every span and draw it. - - while (span < spanEnd) - { - leftx = (s32)(leftxf); - rightx = (s32)(rightxf + 0.5f); - - // perform some clipping - // thanks to a correction by hybrid - // calculations delayed to correctly propagate to textures etc. - s32 tDiffLeft=0, tDiffRight=0; - if (leftx<ViewPortRect.UpperLeftCorner.X) - tDiffLeft=ViewPortRect.UpperLeftCorner.X-leftx; - else - if (leftx>ViewPortRect.LowerRightCorner.X) - tDiffLeft=ViewPortRect.LowerRightCorner.X-leftx; - - if (rightx<ViewPortRect.UpperLeftCorner.X) - tDiffRight=ViewPortRect.UpperLeftCorner.X-rightx; - else - if (rightx>ViewPortRect.LowerRightCorner.X) - tDiffRight=ViewPortRect.LowerRightCorner.X-rightx; - - // draw the span - if (rightx + tDiffRight - leftx - tDiffLeft) - { - tmpDiv = 1.0f / (f32)(rightx - leftx); - - spanStepR = (s32)((rightR - leftR) * tmpDiv); - spanR = leftR+tDiffLeft*spanStepR; - spanStepG = (s32)((rightG - leftG) * tmpDiv); - spanG = leftG+tDiffLeft*spanStepG; - spanStepB = (s32)((rightB - leftB) * tmpDiv); - spanB = leftB+tDiffLeft*spanStepB; - - spanTxStep = (s32)((rightTx - leftTx) * tmpDiv); - spanTx = leftTx + tDiffLeft*spanTxStep; - spanTyStep = (s32)((rightTy - leftTy) * tmpDiv); - spanTy = leftTy+tDiffLeft*spanTyStep; - - hSpanBegin = targetSurface + leftx+tDiffLeft; - hSpanEnd = targetSurface + rightx+tDiffRight; - - while (hSpanBegin < hSpanEnd) - { - color = lockedTexture[((spanTy>>8)&textureYMask) * lockedTextureWidth + ((spanTx>>8)&textureXMask)]; - *hSpanBegin = video::RGB16(video::getRed(color) * (spanR>>8) >>2, - video::getGreen(color) * (spanG>>8) >>2, - video::getBlue(color) * (spanB>>8) >>2); - - spanR += spanStepR; - spanG += spanStepG; - spanB += spanStepB; - - spanTx += spanTxStep; - spanTy += spanTyStep; - - ++hSpanBegin; - } - } - - leftxf += leftdeltaxf; - rightxf += rightdeltaxf; - ++span; - targetSurface += SurfaceWidth; - - leftR += leftStepR; - leftG += leftStepG; - leftB += leftStepB; - rightR += rightStepR; - rightG += rightStepG; - rightB += rightStepB; - - leftTx += leftTxStep; - leftTy += leftTyStep; - rightTx += rightTxStep; - rightTy += rightTyStep; - } - - if (triangleHalf>0) // break, we've gout only two halves - break; - - - // setup variables for second half of the triangle. - - if (longest < 0.0f) - { - tmpDiv = 1.0f / (v3->Pos.Y - v2->Pos.Y); - - rightdeltaxf = (v3->Pos.X - v2->Pos.X) * tmpDiv; - rightxf = (f32)v2->Pos.X; - - rightR = video::getRed(v2->Color)<<8; - rightG = video::getGreen(v2->Color)<<8; - rightB = video::getBlue(v2->Color)<<8; - rightStepR = (s32)(((s32)(video::getRed(v3->Color)<<8) - rightR) * tmpDiv); - rightStepG = (s32)(((s32)(video::getGreen(v3->Color)<<8) - rightG) * tmpDiv); - rightStepB = (s32)(((s32)(video::getBlue(v3->Color)<<8) - rightB) * tmpDiv); - - rightTx = v2->TCoords.X; - rightTy = v2->TCoords.Y; - rightTxStep = (s32)((v3->TCoords.X - rightTx) * tmpDiv); - rightTyStep = (s32)((v3->TCoords.Y - rightTy) * tmpDiv); - } - else - { - tmpDiv = 1.0f / (v3->Pos.Y - v2->Pos.Y); - - leftdeltaxf = (v3->Pos.X - v2->Pos.X) * tmpDiv; - leftxf = (f32)v2->Pos.X; - - leftR = video::getRed(v2->Color)<<8; - leftG = video::getGreen(v2->Color)<<8; - leftB = video::getBlue(v2->Color)<<8; - leftStepR = (s32)(((s32)(video::getRed(v3->Color)<<8) - leftR) * tmpDiv); - leftStepG = (s32)(((s32)(video::getGreen(v3->Color)<<8) - leftG) * tmpDiv); - leftStepB = (s32)(((s32)(video::getBlue(v3->Color)<<8) - leftB) * tmpDiv); - - leftTx = v2->TCoords.X; - leftTy = v2->TCoords.Y; - leftTxStep = (s32)((v3->TCoords.X - leftTx) * tmpDiv); - leftTyStep = (s32)((v3->TCoords.Y - leftTy) * tmpDiv); - } - - - spanEnd = v3->Pos.Y; - } - - } - } - -}; - -} // end namespace video -} // end namespace irr - -#endif // _IRR_COMPILE_WITH_SOFTWARE_ - -namespace irr -{ -namespace video -{ - -//! creates a flat triangle renderer -ITriangleRenderer* createTriangleRendererTextureGouraudNoZ() -{ - #ifdef _IRR_COMPILE_WITH_SOFTWARE_ - return new CTRTextureGouraudNoZ(); - #else - return 0; - #endif // _IRR_COMPILE_WITH_SOFTWARE_ -} - -} // end namespace video -} // end namespace irr - - diff --git a/source/Irrlicht/CTRTextureGouraudNoZ2.cpp b/source/Irrlicht/CTRTextureGouraudNoZ2.cpp deleted file mode 100644 index b287e47b..00000000 --- a/source/Irrlicht/CTRTextureGouraudNoZ2.cpp +++ /dev/null @@ -1,811 +0,0 @@ -// Copyright (C) 2002-2012 Nikolaus Gebhardt / Thomas Alten -// This file is part of the "Irrlicht Engine". -// For conditions of distribution and use, see copyright notice in irrlicht.h - -#include "IrrCompileConfig.h" -#include "IBurningShader.h" - -#ifdef _IRR_COMPILE_WITH_BURNINGSVIDEO_ - -// compile flag for this file -#undef USE_ZBUFFER -#undef IPOL_Z -#undef CMP_Z -#undef WRITE_Z - -#undef IPOL_W -#undef CMP_W -#undef WRITE_W - -#undef SUBTEXEL -#undef INVERSE_W - -#undef IPOL_C0 -#undef IPOL_T0 -#undef IPOL_T1 - -// define render case -#ifdef BURNINGVIDEO_RENDERER_FAST - #define SUBTEXEL - #define INVERSE_W -#else - #define SUBTEXEL - #define INVERSE_W -#endif - -//#define USE_ZBUFFER -#define IPOL_W -//#define CMP_W -//#define WRITE_W - -//#define IPOL_C0 -#define IPOL_T0 -//#define IPOL_T1 - -#if BURNING_MATERIAL_MAX_COLORS < 1 - #undef IPOL_C0 -#endif - -// apply global override -#ifndef SOFTWARE_DRIVER_2_PERSPECTIVE_CORRECT - #undef INVERSE_W - #ifndef SOFTWARE_DRIVER_2_PERSPECTIVE_CORRECT - #undef IPOL_W - #endif -#endif - -#ifndef SOFTWARE_DRIVER_2_SUBTEXEL - #undef SUBTEXEL -#endif - -#if !defined ( SOFTWARE_DRIVER_2_USE_WBUFFER ) && defined ( USE_ZBUFFER ) - #define IPOL_Z - - #ifdef CMP_W - #undef CMP_W - #define CMP_Z - #endif - - #ifdef WRITE_W - #undef WRITE_W - #define WRITE_Z - #endif - -#endif - - -namespace irr -{ - -namespace video -{ - -class CTRTextureGouraudNoZ2 : public IBurningShader -{ -public: - - //! constructor - CTRTextureGouraudNoZ2(CBurningVideoDriver* driver); - - //! draws an indexed triangle list - virtual void drawTriangle(const s4DVertex* burning_restrict a, const s4DVertex* burning_restrict b, const s4DVertex* burning_restrict c) _IRR_OVERRIDE_; - virtual void OnSetMaterial(const SBurningShaderMaterial& material) _IRR_OVERRIDE_; - -private: - - // fragment shader - typedef void (CTRTextureGouraudNoZ2::* tFragmentShader) (); - void fragment_bilinear(); - void fragment_no_filter(); - - tFragmentShader fragmentShader; -}; - -//! constructor -CTRTextureGouraudNoZ2::CTRTextureGouraudNoZ2(CBurningVideoDriver* driver) -: IBurningShader(driver) -{ - #ifdef _DEBUG - setDebugName("CTRTextureGouraudNoZ2"); - #endif - - fragmentShader = &CTRTextureGouraudNoZ2::fragment_bilinear; -} - -/*! -*/ -void CTRTextureGouraudNoZ2::OnSetMaterial(const SBurningShaderMaterial& material) -{ - - if (material.org.TextureLayer[0].BilinearFilter || - material.org.TextureLayer[0].TrilinearFilter || - material.org.TextureLayer[0].AnisotropicFilter - ) - { - fragmentShader = &CTRTextureGouraudNoZ2::fragment_bilinear; - } - else - { - fragmentShader = &CTRTextureGouraudNoZ2::fragment_no_filter; - } - -} - -/*! -*/ -void CTRTextureGouraudNoZ2::fragment_bilinear() -{ - tVideoSample *dst; - -#ifdef USE_ZBUFFER - fp24 *z; -#endif - - s32 xStart; - s32 xEnd; - s32 dx; - - -#ifdef SUBTEXEL - f32 subPixel; -#endif - -#ifdef IPOL_Z - f32 slopeZ; -#endif -#ifdef IPOL_W - fp24 slopeW; -#endif -#ifdef IPOL_C0 - sVec4 slopeC; -#endif -#ifdef IPOL_T0 - sVec2 slopeT[BURNING_MATERIAL_MAX_TEXTURES]; -#endif - - // apply top-left fill-convention, left - xStart = fill_convention_left( line.x[0] ); - xEnd = fill_convention_right( line.x[1] ); - - dx = xEnd - xStart; - - if ( dx < 0 ) - return; - - // slopes - const f32 invDeltaX = fill_step_x( line.x[1] - line.x[0] ); - -#ifdef IPOL_Z - slopeZ = (line.z[1] - line.z[0]) * invDeltaX; -#endif -#ifdef IPOL_W - slopeW = (line.w[1] - line.w[0]) * invDeltaX; -#endif -#ifdef IPOL_C0 - slopeC = (line.c[1] - line.c[0]) * invDeltaX; -#endif -#ifdef IPOL_T0 - slopeT[0] = (line.t[0][1] - line.t[0][0]) * invDeltaX; -#endif -#ifdef IPOL_T1 - slopeT[1] = (line.t[1][1] - line.t[1][0]) * invDeltaX; -#endif - -#ifdef SUBTEXEL - subPixel = ((f32) xStart) - line.x[0]; -#ifdef IPOL_Z - line.z[0] += slopeZ * subPixel; -#endif -#ifdef IPOL_W - line.w[0] += slopeW * subPixel; -#endif -#ifdef IPOL_C0 - line.c[0] += slopeC * subPixel; -#endif -#ifdef IPOL_T0 - line.t[0][0] += slopeT[0] * subPixel; -#endif -#ifdef IPOL_T1 - line.t[1][0] += slopeT[1] * subPixel; -#endif -#endif - - SOFTWARE_DRIVER_2_CLIPCHECK; - dst = (tVideoSample*)RenderTarget->getData() + ( line.y * RenderTarget->getDimension().Width ) + xStart; - -#ifdef USE_ZBUFFER - z = (fp24*) DepthBuffer->lock() + ( line.y * RenderTarget->getDimension().Width ) + xStart; -#endif - - - f32 inversew = FIX_POINT_F32_MUL; - - tFixPoint tx0; - tFixPoint ty0; - tFixPoint r0, g0, b0; - - for ( s32 i = 0; i <= dx; i += SOFTWARE_DRIVER_2_STEP_X) - { -#ifdef CMP_Z - if ( line.z[0] < z[i] ) -#endif -#ifdef CMP_W - if ( line.w[0] >= z[i] ) -#endif - scissor_test_x - { -#ifdef INVERSE_W - inversew = fix_inverse32 ( line.w[0] ); -#endif - tx0 = tofix ( line.t[0][0].x,inversew); - ty0 = tofix ( line.t[0][0].y,inversew); - //skybox - //dst[i] = getTexel_plain ( &IT[0], tx0, ty0 ); - - getSample_texture ( r0, g0, b0, IT+0, tx0, ty0 ); - dst[i] = fix_to_sample( r0, g0, b0 ); - -#ifdef WRITE_Z - z[i] = line.z[0]; -#endif -#ifdef WRITE_W - z[i] = line.w[0]; -#endif - } - -#ifdef IPOL_Z - line.z[0] += slopeZ; -#endif -#ifdef IPOL_W - line.w[0] += slopeW; -#endif -#ifdef IPOL_C0 - line.c[0] += slopeC; -#endif -#ifdef IPOL_T0 - line.t[0][0] += slopeT[0]; -#endif -#ifdef IPOL_T1 - line.t[1][0] += slopeT[1]; -#endif - } - -} - -/*! -*/ -void CTRTextureGouraudNoZ2::fragment_no_filter() -{ - tVideoSample* dst; - -#ifdef USE_ZBUFFER - fp24* z; -#endif - - s32 xStart; - s32 xEnd; - s32 dx; - - -#ifdef SUBTEXEL - f32 subPixel; -#endif - -#ifdef IPOL_Z - f32 slopeZ; -#endif -#ifdef IPOL_W - fp24 slopeW; -#endif -#ifdef IPOL_C0 - sVec4 slopeC; -#endif -#ifdef IPOL_T0 - sVec2 slopeT[BURNING_MATERIAL_MAX_TEXTURES]; -#endif - - // apply top-left fill-convention, left - xStart = fill_convention_left(line.x[0]); - xEnd = fill_convention_right(line.x[1]); - - dx = xEnd - xStart; - if (dx < 0) - return; - - // slopes - const f32 invDeltaX = fill_step_x(line.x[1] - line.x[0]); - -#ifdef IPOL_Z - slopeZ = (line.z[1] - line.z[0]) * invDeltaX; -#endif -#ifdef IPOL_W - slopeW = (line.w[1] - line.w[0]) * invDeltaX; -#endif -#ifdef IPOL_C0 - slopeC = (line.c[1] - line.c[0]) * invDeltaX; -#endif -#ifdef IPOL_T0 - slopeT[0] = (line.t[0][1] - line.t[0][0]) * invDeltaX; -#endif -#ifdef IPOL_T1 - slopeT[1] = (line.t[1][1] - line.t[1][0]) * invDeltaX; -#endif - -#ifdef SUBTEXEL - subPixel = ((f32)xStart) - line.x[0]; -#ifdef IPOL_Z - line.z[0] += slopeZ * subPixel; -#endif -#ifdef IPOL_W - line.w[0] += slopeW * subPixel; -#endif -#ifdef IPOL_C0 - line.c[0] += slopeC * subPixel; -#endif -#ifdef IPOL_T0 - line.t[0][0] += slopeT[0] * subPixel; -#endif -#ifdef IPOL_T1 - line.t[1][0] += slopeT[1] * subPixel; -#endif -#endif - - SOFTWARE_DRIVER_2_CLIPCHECK; - dst = (tVideoSample*)RenderTarget->getData() + (line.y * RenderTarget->getDimension().Width) + xStart; - -#ifdef USE_ZBUFFER - z = (fp24*)DepthBuffer->lock() + (line.y * RenderTarget->getDimension().Width) + xStart; -#endif - - - f32 inversew = FIX_POINT_F32_MUL; - - tFixPoint tx0; - tFixPoint ty0; - //tFixPoint r0, g0, b0; - - for (s32 i = 0; i <= dx; i += SOFTWARE_DRIVER_2_STEP_X) - { -#ifdef CMP_Z - if (line.z[0] < z[i]) -#endif -#ifdef CMP_W - if (line.w[0] >= z[i]) -#endif - //scissor_test_x - { - #ifdef INVERSE_W - inversew = fix_inverse32(line.w[0]); - #endif - tx0 = tofix(line.t[0][0].x,inversew); - ty0 = tofix(line.t[0][0].y,inversew); - //skybox - dst[i] = getTexel_plain(&IT[0], tx0, ty0); - - //getSample_texture ( r0, g0, b0, IT+0, tx0, ty0 ); - //dst[i] = fix_to_sample( r0, g0, b0 ); - - #ifdef WRITE_Z - z[i] = line.z[0]; - #endif - #ifdef WRITE_W - z[i] = line.w[0]; - #endif - } - -#ifdef IPOL_Z - line.z[0] += slopeZ; -#endif -#ifdef IPOL_W - line.w[0] += slopeW; -#endif -#ifdef IPOL_C0 - line.c[0] += slopeC; -#endif -#ifdef IPOL_T0 - line.t[0][0] += slopeT[0]; -#endif -#ifdef IPOL_T1 - line.t[1][0] += slopeT[1]; -#endif - } - -} - -void CTRTextureGouraudNoZ2::drawTriangle(const s4DVertex* burning_restrict a, const s4DVertex* burning_restrict b, const s4DVertex* burning_restrict c) -{ - // sort on height, y - if ( F32_A_GREATER_B ( a->Pos.y , b->Pos.y ) ) swapVertexPointer(&a, &b); - if ( F32_A_GREATER_B ( b->Pos.y , c->Pos.y ) ) swapVertexPointer(&b, &c); - if ( F32_A_GREATER_B ( a->Pos.y , b->Pos.y ) ) swapVertexPointer(&a, &b); - - const f32 ca = c->Pos.y - a->Pos.y; - const f32 ba = b->Pos.y - a->Pos.y; - const f32 cb = c->Pos.y - b->Pos.y; - - // calculate delta y of the edges - scan.invDeltaY[0] = fill_step_y( ca ); - scan.invDeltaY[1] = fill_step_y( ba ); - scan.invDeltaY[2] = fill_step_y( cb ); - - if ( F32_LOWER_EQUAL_0 ( scan.invDeltaY[0] ) ) - return; - - // find if the major edge is left or right aligned - f32 temp[4]; - - temp[0] = a->Pos.x - c->Pos.x; - temp[1] = -ca; - temp[2] = b->Pos.x - a->Pos.x; - temp[3] = ba; - - scan.left = ( temp[0] * temp[3] - temp[1] * temp[2] ) > 0.f ? 0 : 1; - scan.right = 1 - scan.left; - - // calculate slopes for the major edge - scan.slopeX[0] = (c->Pos.x - a->Pos.x) * scan.invDeltaY[0]; - scan.x[0] = a->Pos.x; - -#ifdef IPOL_Z - scan.slopeZ[0] = (c->Pos.z - a->Pos.z) * scan.invDeltaY[0]; - scan.z[0] = a->Pos.z; -#endif - -#ifdef IPOL_W - scan.slopeW[0] = (c->Pos.w - a->Pos.w) * scan.invDeltaY[0]; - scan.w[0] = a->Pos.w; -#endif - -#ifdef IPOL_C0 - scan.slopeC[0] = (c->Color[0] - a->Color[0]) * scan.invDeltaY[0]; - scan.c[0] = a->Color[0]; -#endif - -#ifdef IPOL_T0 - scan.slopeT[0][0] = (c->Tex[0] - a->Tex[0]) * scan.invDeltaY[0]; - scan.t[0][0] = a->Tex[0]; -#endif - -#ifdef IPOL_T1 - scan.slopeT[1][0] = (c->Tex[1] - a->Tex[1]) * scan.invDeltaY[0]; - scan.t[1][0] = a->Tex[1]; -#endif - - // top left fill convention y run - s32 yStart; - s32 yEnd; - -#ifdef SUBTEXEL - f32 subPixel; -#endif - - // rasterize upper sub-triangle - if (F32_GREATER_0(scan.invDeltaY[1]) ) - { - // calculate slopes for top edge - scan.slopeX[1] = (b->Pos.x - a->Pos.x) * scan.invDeltaY[1]; - scan.x[1] = a->Pos.x; - -#ifdef IPOL_Z - scan.slopeZ[1] = (b->Pos.z - a->Pos.z) * scan.invDeltaY[1]; - scan.z[1] = a->Pos.z; -#endif - -#ifdef IPOL_W - scan.slopeW[1] = (b->Pos.w - a->Pos.w) * scan.invDeltaY[1]; - scan.w[1] = a->Pos.w; -#endif - -#ifdef IPOL_C0 - scan.slopeC[1] = (b->Color[0] - a->Color[0]) * scan.invDeltaY[1]; - scan.c[1] = a->Color[0]; -#endif - -#ifdef IPOL_T0 - scan.slopeT[0][1] = (b->Tex[0] - a->Tex[0]) * scan.invDeltaY[1]; - scan.t[0][1] = a->Tex[0]; -#endif - -#ifdef IPOL_T1 - scan.slopeT[1][1] = (b->Tex[1] - a->Tex[1]) * scan.invDeltaY[1]; - scan.t[1][1] = a->Tex[1]; -#endif - - // apply top-left fill convention, top part - yStart = fill_convention_left( a->Pos.y ); - yEnd = fill_convention_right( b->Pos.y ); - -#ifdef SUBTEXEL - subPixel = ( (f32) yStart ) - a->Pos.y; - - // correct to pixel center - scan.x[0] += scan.slopeX[0] * subPixel; - scan.x[1] += scan.slopeX[1] * subPixel; - -#ifdef IPOL_Z - scan.z[0] += scan.slopeZ[0] * subPixel; - scan.z[1] += scan.slopeZ[1] * subPixel; -#endif - -#ifdef IPOL_W - scan.w[0] += scan.slopeW[0] * subPixel; - scan.w[1] += scan.slopeW[1] * subPixel; -#endif - -#ifdef IPOL_C0 - scan.c[0] += scan.slopeC[0] * subPixel; - scan.c[1] += scan.slopeC[1] * subPixel; -#endif - -#ifdef IPOL_T0 - scan.t[0][0] += scan.slopeT[0][0] * subPixel; - scan.t[0][1] += scan.slopeT[0][1] * subPixel; -#endif - -#ifdef IPOL_T1 - scan.t[1][0] += scan.slopeT[1][0] * subPixel; - scan.t[1][1] += scan.slopeT[1][1] * subPixel; -#endif - -#endif - - // rasterize the edge scanlines - for( line.y = yStart; line.y <= yEnd; line.y += SOFTWARE_DRIVER_2_STEP_Y) - { - line.x[scan.left] = scan.x[0]; - line.x[scan.right] = scan.x[1]; - -#ifdef IPOL_Z - line.z[scan.left] = scan.z[0]; - line.z[scan.right] = scan.z[1]; -#endif - -#ifdef IPOL_W - line.w[scan.left] = scan.w[0]; - line.w[scan.right] = scan.w[1]; -#endif - -#ifdef IPOL_C0 - line.c[scan.left] = scan.c[0]; - line.c[scan.right] = scan.c[1]; -#endif - -#ifdef IPOL_T0 - line.t[0][scan.left] = scan.t[0][0]; - line.t[0][scan.right] = scan.t[0][1]; -#endif - -#ifdef IPOL_T1 - line.t[1][scan.left] = scan.t[1][0]; - line.t[1][scan.right] = scan.t[1][1]; -#endif - - - // render a scanline - interlace_scanline - scissor_test_y - (this->*fragmentShader) (); - - scan.x[0] += scan.slopeX[0]; - scan.x[1] += scan.slopeX[1]; - -#ifdef IPOL_Z - scan.z[0] += scan.slopeZ[0]; - scan.z[1] += scan.slopeZ[1]; -#endif - -#ifdef IPOL_W - scan.w[0] += scan.slopeW[0]; - scan.w[1] += scan.slopeW[1]; -#endif - -#ifdef IPOL_C0 - scan.c[0] += scan.slopeC[0]; - scan.c[1] += scan.slopeC[1]; -#endif - -#ifdef IPOL_T0 - scan.t[0][0] += scan.slopeT[0][0]; - scan.t[0][1] += scan.slopeT[0][1]; -#endif - -#ifdef IPOL_T1 - scan.t[1][0] += scan.slopeT[1][0]; - scan.t[1][1] += scan.slopeT[1][1]; -#endif - - } - } - - // rasterize lower sub-triangle - if (F32_GREATER_0(scan.invDeltaY[2]) ) - { - // advance to middle point - if(F32_GREATER_0(scan.invDeltaY[1]) ) - { - temp[0] = b->Pos.y - a->Pos.y; // dy - - scan.x[0] = a->Pos.x + scan.slopeX[0] * temp[0]; -#ifdef IPOL_Z - scan.z[0] = a->Pos.z + scan.slopeZ[0] * temp[0]; -#endif -#ifdef IPOL_W - scan.w[0] = a->Pos.w + scan.slopeW[0] * temp[0]; -#endif -#ifdef IPOL_C0 - scan.c[0] = a->Color[0] + scan.slopeC[0] * temp[0]; -#endif -#ifdef IPOL_T0 - scan.t[0][0] = a->Tex[0] + scan.slopeT[0][0] * temp[0]; -#endif -#ifdef IPOL_T1 - scan.t[1][0] = a->Tex[1] + scan.slopeT[1][0] * temp[0]; -#endif - - } - - // calculate slopes for bottom edge - scan.slopeX[1] = (c->Pos.x - b->Pos.x) * scan.invDeltaY[2]; - scan.x[1] = b->Pos.x; - -#ifdef IPOL_Z - scan.slopeZ[1] = (c->Pos.z - b->Pos.z) * scan.invDeltaY[2]; - scan.z[1] = b->Pos.z; -#endif - -#ifdef IPOL_W - scan.slopeW[1] = (c->Pos.w - b->Pos.w) * scan.invDeltaY[2]; - scan.w[1] = b->Pos.w; -#endif - -#ifdef IPOL_C0 - scan.slopeC[1] = (c->Color[0] - b->Color[0]) * scan.invDeltaY[2]; - scan.c[1] = b->Color[0]; -#endif - -#ifdef IPOL_T0 - scan.slopeT[0][1] = (c->Tex[0] - b->Tex[0]) * scan.invDeltaY[2]; - scan.t[0][1] = b->Tex[0]; -#endif - -#ifdef IPOL_T1 - scan.slopeT[1][1] = (c->Tex[1] - b->Tex[1]) * scan.invDeltaY[2]; - scan.t[1][1] = b->Tex[1]; -#endif - - // apply top-left fill convention, top part - yStart = fill_convention_left( b->Pos.y ); - yEnd = fill_convention_right( c->Pos.y ); - -#ifdef SUBTEXEL - - subPixel = ( (f32) yStart ) - b->Pos.y; - - // correct to pixel center - scan.x[0] += scan.slopeX[0] * subPixel; - scan.x[1] += scan.slopeX[1] * subPixel; - -#ifdef IPOL_Z - scan.z[0] += scan.slopeZ[0] * subPixel; - scan.z[1] += scan.slopeZ[1] * subPixel; -#endif - -#ifdef IPOL_W - scan.w[0] += scan.slopeW[0] * subPixel; - scan.w[1] += scan.slopeW[1] * subPixel; -#endif - -#ifdef IPOL_C0 - scan.c[0] += scan.slopeC[0] * subPixel; - scan.c[1] += scan.slopeC[1] * subPixel; -#endif - -#ifdef IPOL_T0 - scan.t[0][0] += scan.slopeT[0][0] * subPixel; - scan.t[0][1] += scan.slopeT[0][1] * subPixel; -#endif - -#ifdef IPOL_T1 - scan.t[1][0] += scan.slopeT[1][0] * subPixel; - scan.t[1][1] += scan.slopeT[1][1] * subPixel; -#endif - -#endif - - // rasterize the edge scanlines - for( line.y = yStart; line.y <= yEnd; line.y += SOFTWARE_DRIVER_2_STEP_Y) - { - line.x[scan.left] = scan.x[0]; - line.x[scan.right] = scan.x[1]; - -#ifdef IPOL_Z - line.z[scan.left] = scan.z[0]; - line.z[scan.right] = scan.z[1]; -#endif - -#ifdef IPOL_W - line.w[scan.left] = scan.w[0]; - line.w[scan.right] = scan.w[1]; -#endif - -#ifdef IPOL_C0 - line.c[scan.left] = scan.c[0]; - line.c[scan.right] = scan.c[1]; -#endif - -#ifdef IPOL_T0 - line.t[0][scan.left] = scan.t[0][0]; - line.t[0][scan.right] = scan.t[0][1]; -#endif - -#ifdef IPOL_T1 - line.t[1][scan.left] = scan.t[1][0]; - line.t[1][scan.right] = scan.t[1][1]; -#endif - - // render a scanline - interlace_scanline - scissor_test_y - (this->*fragmentShader) (); - - scan.x[0] += scan.slopeX[0]; - scan.x[1] += scan.slopeX[1]; - -#ifdef IPOL_Z - scan.z[0] += scan.slopeZ[0]; - scan.z[1] += scan.slopeZ[1]; -#endif - -#ifdef IPOL_W - scan.w[0] += scan.slopeW[0]; - scan.w[1] += scan.slopeW[1]; -#endif - -#ifdef IPOL_C0 - scan.c[0] += scan.slopeC[0]; - scan.c[1] += scan.slopeC[1]; -#endif - -#ifdef IPOL_T0 - scan.t[0][0] += scan.slopeT[0][0]; - scan.t[0][1] += scan.slopeT[0][1]; -#endif - -#ifdef IPOL_T1 - scan.t[1][0] += scan.slopeT[1][0]; - scan.t[1][1] += scan.slopeT[1][1]; -#endif - - } - } - -} - - -} // end namespace video -} // end namespace irr - -#endif // _IRR_COMPILE_WITH_BURNINGSVIDEO_ - -namespace irr -{ -namespace video -{ - -//! creates a flat triangle renderer -IBurningShader* createTRTextureGouraudNoZ2(CBurningVideoDriver* driver) -{ - // ETR_TEXTURE_GOURAUD_NOZ - #ifdef _IRR_COMPILE_WITH_BURNINGSVIDEO_ - return new CTRTextureGouraudNoZ2( driver ); - #else - return 0; - #endif // _IRR_COMPILE_WITH_BURNINGSVIDEO_ -} - - -} // end namespace video -} // end namespace irr - - - diff --git a/source/Irrlicht/CTRTextureGouraudVertexAlpha2.cpp b/source/Irrlicht/CTRTextureGouraudVertexAlpha2.cpp deleted file mode 100644 index b9ff381e..00000000 --- a/source/Irrlicht/CTRTextureGouraudVertexAlpha2.cpp +++ /dev/null @@ -1,762 +0,0 @@ -// Copyright (C) 2002-2012 Nikolaus Gebhardt / Thomas Alten -// This file is part of the "Irrlicht Engine". -// For conditions of distribution and use, see copyright notice in irrlicht.h - -#include "IrrCompileConfig.h" -#include "IBurningShader.h" - -#ifdef _IRR_COMPILE_WITH_BURNINGSVIDEO_ - -// compile flag for this file -#undef USE_ZBUFFER -#undef IPOL_Z -#undef CMP_Z -#undef WRITE_Z - -#undef IPOL_W -#undef CMP_W -#undef WRITE_W - -#undef SUBTEXEL -#undef INVERSE_W - -#undef IPOL_C0 -#undef IPOL_C1 -#undef IPOL_T0 -#undef IPOL_T1 - -// define render case -#define SUBTEXEL -#define INVERSE_W - -#define USE_ZBUFFER -#define IPOL_W -#define CMP_W -//#define WRITE_W - -#define IPOL_C0 -#define IPOL_C1 -#define IPOL_T0 -//#define IPOL_T1 - -// apply global override -#ifndef SOFTWARE_DRIVER_2_PERSPECTIVE_CORRECT - #undef INVERSE_W -#endif - -#ifndef SOFTWARE_DRIVER_2_SUBTEXEL - #undef SUBTEXEL -#endif - -#if BURNING_MATERIAL_MAX_COLORS < 1 - #undef IPOL_C0 -#endif - -#if BURNING_MATERIAL_MAX_COLORS < 2 - #undef IPOL_C1 -#endif - - -#if !defined ( SOFTWARE_DRIVER_2_USE_WBUFFER ) && defined ( USE_ZBUFFER ) - #ifndef SOFTWARE_DRIVER_2_PERSPECTIVE_CORRECT - #undef IPOL_W - #endif - #define IPOL_Z - - #ifdef CMP_W - #undef CMP_W - #define CMP_Z - #endif - - #ifdef WRITE_W - #undef WRITE_W - #define WRITE_Z - #endif - -#endif - -namespace irr -{ - -namespace video -{ - -class CTRTextureVertexAlpha2 : public IBurningShader -{ -public: - - //! constructor - CTRTextureVertexAlpha2(CBurningVideoDriver* driver); - - //! draws an indexed triangle list - virtual void drawTriangle(const s4DVertex* burning_restrict a, const s4DVertex* burning_restrict b, const s4DVertex* burning_restrict c) _IRR_OVERRIDE_; - - -private: - void fragmentShader(); - -}; - -//! constructor -CTRTextureVertexAlpha2::CTRTextureVertexAlpha2(CBurningVideoDriver* driver) -: IBurningShader(driver) -{ - #ifdef _DEBUG - setDebugName("CTRTextureVertexAlpha2"); - #endif -} - - - -/*! -*/ -void CTRTextureVertexAlpha2::fragmentShader( ) -{ - tVideoSample *dst; - -#ifdef USE_ZBUFFER - fp24 *z; -#endif - - s32 xStart; - s32 xEnd; - s32 dx; - - -#ifdef SUBTEXEL - f32 subPixel; -#endif - -#ifdef IPOL_Z - f32 slopeZ; -#endif -#ifdef IPOL_W - fp24 slopeW; -#endif -#ifdef IPOL_C0 - sVec4 slopeC[BURNING_MATERIAL_MAX_COLORS]; -#endif -#ifdef IPOL_T0 - sVec2 slopeT[BURNING_MATERIAL_MAX_TEXTURES]; -#endif - - // apply top-left fill-convention, left - xStart = fill_convention_left( line.x[0] ); - xEnd = fill_convention_right( line.x[1] ); - - dx = xEnd - xStart; - - if ( dx < 0 ) - return; - - // slopes - const f32 invDeltaX = fill_step_x( line.x[1] - line.x[0] ); - -#ifdef IPOL_Z - slopeZ = (line.z[1] - line.z[0]) * invDeltaX; -#endif -#ifdef IPOL_W - slopeW = (line.w[1] - line.w[0]) * invDeltaX; -#endif -#ifdef IPOL_C0 - slopeC[0] = (line.c[0][1] - line.c[0][0]) * invDeltaX; -#endif -#ifdef IPOL_C1 - slopeC[1] = (line.c[1][1] - line.c[1][0]) * invDeltaX; -#endif -#ifdef IPOL_T0 - slopeT[0] = (line.t[0][1] - line.t[0][0]) * invDeltaX; -#endif -#ifdef IPOL_T1 - slopeT[1] = (line.t[1][1] - line.t[1][0]) * invDeltaX; -#endif - -#ifdef SUBTEXEL - subPixel = ( (f32) xStart ) - line.x[0]; -#ifdef IPOL_Z - line.z[0] += slopeZ * subPixel; -#endif -#ifdef IPOL_W - line.w[0] += slopeW * subPixel; -#endif -#ifdef IPOL_C0 - line.c[0][0] += slopeC[0] * subPixel; -#endif -#ifdef IPOL_C1 - line.c[1][0] += slopeC[1] * subPixel; -#endif - -#ifdef IPOL_T0 - line.t[0][0] += slopeT[0] * subPixel; -#endif -#ifdef IPOL_T1 - line.t[1][0] += slopeT[1] * subPixel; -#endif -#endif - - SOFTWARE_DRIVER_2_CLIPCHECK; - dst = (tVideoSample*)RenderTarget->getData() + ( line.y * RenderTarget->getDimension().Width ) + xStart; - -#ifdef USE_ZBUFFER - z = (fp24*) DepthBuffer->lock() + ( line.y * RenderTarget->getDimension().Width ) + xStart; -#endif - - - f32 inversew = FIX_POINT_F32_MUL; - - tFixPoint tx0; - tFixPoint ty0; - - tFixPoint r0, g0, b0; - tFixPoint r1, g1, b1; - -#ifdef IPOL_C0 - tFixPoint a2,r2, g2, b2; -#endif - -#ifdef IPOL_C1 - tFixPoint aFog = FIX_POINT_ONE; -#endif - - - for ( s32 i = 0; i <= dx; i += SOFTWARE_DRIVER_2_STEP_X) - { -#ifdef CMP_Z - if ( line.z[0] < z[i] ) -#endif -#ifdef CMP_W - if ( line.w[0] >= z[i] ) -#endif - - { -#ifdef WRITE_Z - z[i] = line.z[0]; -#endif -#ifdef WRITE_W - z[i] = line.w[0]; -#endif - -#ifdef INVERSE_W - inversew = fix_inverse32 ( line.w[0] ); -#endif -#ifdef IPOL_C1 - //complete inside fog - if (TL_Flag & TL_FOG) - { - aFog = tofix(line.c[1][0].a, inversew); - if (aFog <= 0) - { - dst[i] = fog_color_sample; - continue; - } - } -#endif - tx0 = tofix ( line.t[0][0].x,inversew); - ty0 = tofix ( line.t[0][0].y,inversew); - - getSample_texture ( r0, g0, b0, &IT[0], tx0, ty0 ); - color_to_fix ( r1, g1, b1, dst[i] ); - -#ifdef IPOL_C0 - vec4_to_fix(a2,r2, g2, b2, line.c[0][0], inversew); - - r0 = imulFix_simple(r0, r2); - g0 = imulFix_simple(g0, g2); - b0 = imulFix_simple(b0, b2); - -#ifdef IPOL_C1 - //specular highlight - if (TL_Flag & TL_SPECULAR) - { - vec4_to_fix(r2, g2, b2, line.c[1][0], inversew*COLOR_MAX); - r0 = clampfix_maxcolor(r2 + r0); - g0 = clampfix_maxcolor(g2 + g0); - b0 = clampfix_maxcolor(b2 + b0); - } -#endif - //blend background - r0 = r1 + imulFix(a2, r0 - r1); - g0 = g1 + imulFix(a2, g0 - g1); - b0 = b1 + imulFix(a2, b0 - b1); - -#ifdef IPOL_C1 - //mix with distance - if (aFog < FIX_POINT_ONE) //TL_Flag & TL_FOG) - { - r0 = fog_color[1] + imulFix(aFog, r0 - fog_color[1]); - g0 = fog_color[2] + imulFix(aFog, g0 - fog_color[2]); - b0 = fog_color[3] + imulFix(aFog, b0 - fog_color[3]); - } -#endif - -#else - r0 = clampfix_maxcolor ( r1 + r0 ); - g0 = clampfix_maxcolor ( g1 + g0 ); - b0 = clampfix_maxcolor ( b1 + b0 ); -#endif - - dst[i] = fix_to_sample( r0, g0, b0 ); - - } - -#ifdef IPOL_Z - line.z[0] += slopeZ; -#endif -#ifdef IPOL_W - line.w[0] += slopeW; -#endif -#ifdef IPOL_C0 - line.c[0][0] += slopeC[0]; -#endif -#ifdef IPOL_C1 - line.c[1][0] += slopeC[1]; -#endif -#ifdef IPOL_T0 - line.t[0][0] += slopeT[0]; -#endif -#ifdef IPOL_T1 - line.t[1][0] += slopeT[1]; -#endif - } - -} - -void CTRTextureVertexAlpha2::drawTriangle(const s4DVertex* burning_restrict a, const s4DVertex* burning_restrict b, const s4DVertex* burning_restrict c) -{ - // sort on height, y - if ( F32_A_GREATER_B ( a->Pos.y , b->Pos.y ) ) swapVertexPointer(&a, &b); - if ( F32_A_GREATER_B ( b->Pos.y , c->Pos.y ) ) swapVertexPointer(&b, &c); - if ( F32_A_GREATER_B ( a->Pos.y , b->Pos.y ) ) swapVertexPointer(&a, &b); - - const f32 ca = c->Pos.y - a->Pos.y; - const f32 ba = b->Pos.y - a->Pos.y; - const f32 cb = c->Pos.y - b->Pos.y; - // calculate delta y of the edges - scan.invDeltaY[0] = fill_step_y( ca ); - scan.invDeltaY[1] = fill_step_y( ba ); - scan.invDeltaY[2] = fill_step_y( cb ); - - if ( F32_LOWER_EQUAL_0 ( scan.invDeltaY[0] ) ) - return; - - // find if the major edge is left or right aligned - f32 temp[4]; - - temp[0] = a->Pos.x - c->Pos.x; - temp[1] = -ca; - temp[2] = b->Pos.x - a->Pos.x; - temp[3] = ba; - - scan.left = ( temp[0] * temp[3] - temp[1] * temp[2] ) > 0.f ? 0 : 1; - scan.right = 1 - scan.left; - - // calculate slopes for the major edge - scan.slopeX[0] = (c->Pos.x - a->Pos.x) * scan.invDeltaY[0]; - scan.x[0] = a->Pos.x; - -#ifdef IPOL_Z - scan.slopeZ[0] = (c->Pos.z - a->Pos.z) * scan.invDeltaY[0]; - scan.z[0] = a->Pos.z; -#endif - -#ifdef IPOL_W - scan.slopeW[0] = (c->Pos.w - a->Pos.w) * scan.invDeltaY[0]; - scan.w[0] = a->Pos.w; -#endif - -#ifdef IPOL_C0 - scan.slopeC[0][0] = (c->Color[0] - a->Color[0]) * scan.invDeltaY[0]; - scan.c[0][0] = a->Color[0]; -#endif - -#ifdef IPOL_C1 - scan.slopeC[1][0] = (c->Color[1] - a->Color[1]) * scan.invDeltaY[0]; - scan.c[1][0] = a->Color[1]; -#endif - -#ifdef IPOL_T0 - scan.slopeT[0][0] = (c->Tex[0] - a->Tex[0]) * scan.invDeltaY[0]; - scan.t[0][0] = a->Tex[0]; -#endif - -#ifdef IPOL_T1 - scan.slopeT[1][0] = (c->Tex[1] - a->Tex[1]) * scan.invDeltaY[0]; - scan.t[1][0] = a->Tex[1]; -#endif - - // top left fill convention y run - s32 yStart; - s32 yEnd; - -#ifdef SUBTEXEL - f32 subPixel; -#endif - - // rasterize upper sub-triangle - if ( (f32) 0.0 != scan.invDeltaY[1] ) - { - // calculate slopes for top edge - scan.slopeX[1] = (b->Pos.x - a->Pos.x) * scan.invDeltaY[1]; - scan.x[1] = a->Pos.x; - -#ifdef IPOL_Z - scan.slopeZ[1] = (b->Pos.z - a->Pos.z) * scan.invDeltaY[1]; - scan.z[1] = a->Pos.z; -#endif - -#ifdef IPOL_W - scan.slopeW[1] = (b->Pos.w - a->Pos.w) * scan.invDeltaY[1]; - scan.w[1] = a->Pos.w; -#endif - -#ifdef IPOL_C0 - scan.slopeC[0][1] = (b->Color[0] - a->Color[0]) * scan.invDeltaY[1]; - scan.c[0][1] = a->Color[0]; -#endif - -#ifdef IPOL_C1 - scan.slopeC[1][1] = (b->Color[1] - a->Color[1]) * scan.invDeltaY[1]; - scan.c[1][1] = a->Color[1]; -#endif - -#ifdef IPOL_T0 - scan.slopeT[0][1] = (b->Tex[0] - a->Tex[0]) * scan.invDeltaY[1]; - scan.t[0][1] = a->Tex[0]; -#endif - -#ifdef IPOL_T1 - scan.slopeT[1][1] = (b->Tex[1] - a->Tex[1]) * scan.invDeltaY[1]; - scan.t[1][1] = a->Tex[1]; -#endif - - // apply top-left fill convention, top part - yStart = fill_convention_left( a->Pos.y ); - yEnd = fill_convention_right( b->Pos.y ); - -#ifdef SUBTEXEL - subPixel = ( (f32) yStart ) - a->Pos.y; - - // correct to pixel center - scan.x[0] += scan.slopeX[0] * subPixel; - scan.x[1] += scan.slopeX[1] * subPixel; - -#ifdef IPOL_Z - scan.z[0] += scan.slopeZ[0] * subPixel; - scan.z[1] += scan.slopeZ[1] * subPixel; -#endif - -#ifdef IPOL_W - scan.w[0] += scan.slopeW[0] * subPixel; - scan.w[1] += scan.slopeW[1] * subPixel; -#endif - -#ifdef IPOL_C0 - scan.c[0][0] += scan.slopeC[0][0] * subPixel; - scan.c[0][1] += scan.slopeC[0][1] * subPixel; -#endif - -#ifdef IPOL_C1 - scan.c[1][0] += scan.slopeC[1][0] * subPixel; - scan.c[1][1] += scan.slopeC[1][1] * subPixel; -#endif - -#ifdef IPOL_T0 - scan.t[0][0] += scan.slopeT[0][0] * subPixel; - scan.t[0][1] += scan.slopeT[0][1] * subPixel; -#endif - -#ifdef IPOL_T1 - scan.t[1][0] += scan.slopeT[1][0] * subPixel; - scan.t[1][1] += scan.slopeT[1][1] * subPixel; -#endif - -#endif - - // rasterize the edge scanlines - for( line.y = yStart; line.y <= yEnd; line.y += SOFTWARE_DRIVER_2_STEP_Y) - { - line.x[scan.left] = scan.x[0]; - line.x[scan.right] = scan.x[1]; - -#ifdef IPOL_Z - line.z[scan.left] = scan.z[0]; - line.z[scan.right] = scan.z[1]; -#endif - -#ifdef IPOL_W - line.w[scan.left] = scan.w[0]; - line.w[scan.right] = scan.w[1]; -#endif - -#ifdef IPOL_C0 - line.c[0][scan.left] = scan.c[0][0]; - line.c[0][scan.right] = scan.c[0][1]; -#endif - -#ifdef IPOL_C1 - line.c[1][scan.left] = scan.c[1][0]; - line.c[1][scan.right] = scan.c[1][1]; -#endif - -#ifdef IPOL_T0 - line.t[0][scan.left] = scan.t[0][0]; - line.t[0][scan.right] = scan.t[0][1]; -#endif - -#ifdef IPOL_T1 - line.t[1][scan.left] = scan.t[1][0]; - line.t[1][scan.right] = scan.t[1][1]; -#endif - - // render a scanline - interlace_scanline fragmentShader(); - - scan.x[0] += scan.slopeX[0]; - scan.x[1] += scan.slopeX[1]; - -#ifdef IPOL_Z - scan.z[0] += scan.slopeZ[0]; - scan.z[1] += scan.slopeZ[1]; -#endif - -#ifdef IPOL_W - scan.w[0] += scan.slopeW[0]; - scan.w[1] += scan.slopeW[1]; -#endif - -#ifdef IPOL_C0 - scan.c[0][0] += scan.slopeC[0][0]; - scan.c[0][1] += scan.slopeC[0][1]; -#endif - -#ifdef IPOL_C1 - scan.c[1][0] += scan.slopeC[1][0]; - scan.c[1][1] += scan.slopeC[1][1]; -#endif - -#ifdef IPOL_T0 - scan.t[0][0] += scan.slopeT[0][0]; - scan.t[0][1] += scan.slopeT[0][1]; -#endif - -#ifdef IPOL_T1 - scan.t[1][0] += scan.slopeT[1][0]; - scan.t[1][1] += scan.slopeT[1][1]; -#endif - - } - } - - // rasterize lower sub-triangle - if ( (f32) 0.0 != scan.invDeltaY[2] ) - { - // advance to middle point - if( (f32) 0.0 != scan.invDeltaY[1] ) - { - temp[0] = b->Pos.y - a->Pos.y; // dy - - scan.x[0] = a->Pos.x + scan.slopeX[0] * temp[0]; -#ifdef IPOL_Z - scan.z[0] = a->Pos.z + scan.slopeZ[0] * temp[0]; -#endif -#ifdef IPOL_W - scan.w[0] = a->Pos.w + scan.slopeW[0] * temp[0]; -#endif -#ifdef IPOL_C0 - scan.c[0][0] = a->Color[0] + scan.slopeC[0][0] * temp[0]; -#endif -#ifdef IPOL_C1 - scan.c[1][0] = a->Color[1] + scan.slopeC[1][0] * temp[0]; -#endif -#ifdef IPOL_T0 - scan.t[0][0] = a->Tex[0] + scan.slopeT[0][0] * temp[0]; -#endif -#ifdef IPOL_T1 - scan.t[1][0] = a->Tex[1] + scan.slopeT[1][0] * temp[0]; -#endif - - } - - // calculate slopes for bottom edge - scan.slopeX[1] = (c->Pos.x - b->Pos.x) * scan.invDeltaY[2]; - scan.x[1] = b->Pos.x; - -#ifdef IPOL_Z - scan.slopeZ[1] = (c->Pos.z - b->Pos.z) * scan.invDeltaY[2]; - scan.z[1] = b->Pos.z; -#endif - -#ifdef IPOL_W - scan.slopeW[1] = (c->Pos.w - b->Pos.w) * scan.invDeltaY[2]; - scan.w[1] = b->Pos.w; -#endif - -#ifdef IPOL_C0 - scan.slopeC[0][1] = (c->Color[0] - b->Color[0]) * scan.invDeltaY[2]; - scan.c[0][1] = b->Color[0]; -#endif - -#ifdef IPOL_C1 - scan.slopeC[1][1] = (c->Color[1] - b->Color[1]) * scan.invDeltaY[2]; - scan.c[1][1] = b->Color[1]; -#endif - -#ifdef IPOL_T0 - scan.slopeT[0][1] = (c->Tex[0] - b->Tex[0]) * scan.invDeltaY[2]; - scan.t[0][1] = b->Tex[0]; -#endif - -#ifdef IPOL_T1 - scan.slopeT[1][1] = (c->Tex[1] - b->Tex[1]) * scan.invDeltaY[2]; - scan.t[1][1] = b->Tex[1]; -#endif - - // apply top-left fill convention, top part - yStart = fill_convention_left( b->Pos.y ); - yEnd = fill_convention_right( c->Pos.y ); - -#ifdef SUBTEXEL - - subPixel = ( (f32) yStart ) - b->Pos.y; - - // correct to pixel center - scan.x[0] += scan.slopeX[0] * subPixel; - scan.x[1] += scan.slopeX[1] * subPixel; - -#ifdef IPOL_Z - scan.z[0] += scan.slopeZ[0] * subPixel; - scan.z[1] += scan.slopeZ[1] * subPixel; -#endif - -#ifdef IPOL_W - scan.w[0] += scan.slopeW[0] * subPixel; - scan.w[1] += scan.slopeW[1] * subPixel; -#endif - -#ifdef IPOL_C0 - scan.c[0][0] += scan.slopeC[0][0] * subPixel; - scan.c[0][1] += scan.slopeC[0][1] * subPixel; -#endif - -#ifdef IPOL_C1 - scan.c[1][0] += scan.slopeC[1][0] * subPixel; - scan.c[1][1] += scan.slopeC[1][1] * subPixel; -#endif - -#ifdef IPOL_T0 - scan.t[0][0] += scan.slopeT[0][0] * subPixel; - scan.t[0][1] += scan.slopeT[0][1] * subPixel; -#endif - -#ifdef IPOL_T1 - scan.t[1][0] += scan.slopeT[1][0] * subPixel; - scan.t[1][1] += scan.slopeT[1][1] * subPixel; -#endif - -#endif - - // rasterize the edge scanlines - for( line.y = yStart; line.y <= yEnd; line.y += SOFTWARE_DRIVER_2_STEP_Y) - { - line.x[scan.left] = scan.x[0]; - line.x[scan.right] = scan.x[1]; - -#ifdef IPOL_Z - line.z[scan.left] = scan.z[0]; - line.z[scan.right] = scan.z[1]; -#endif - -#ifdef IPOL_W - line.w[scan.left] = scan.w[0]; - line.w[scan.right] = scan.w[1]; -#endif - -#ifdef IPOL_C0 - line.c[0][scan.left] = scan.c[0][0]; - line.c[0][scan.right] = scan.c[0][1]; -#endif - -#ifdef IPOL_C1 - line.c[1][scan.left] = scan.c[1][0]; - line.c[1][scan.right] = scan.c[1][1]; -#endif - -#ifdef IPOL_T0 - line.t[0][scan.left] = scan.t[0][0]; - line.t[0][scan.right] = scan.t[0][1]; -#endif - -#ifdef IPOL_T1 - line.t[1][scan.left] = scan.t[1][0]; - line.t[1][scan.right] = scan.t[1][1]; -#endif - - // render a scanline - interlace_scanline fragmentShader(); - - scan.x[0] += scan.slopeX[0]; - scan.x[1] += scan.slopeX[1]; - -#ifdef IPOL_Z - scan.z[0] += scan.slopeZ[0]; - scan.z[1] += scan.slopeZ[1]; -#endif - -#ifdef IPOL_W - scan.w[0] += scan.slopeW[0]; - scan.w[1] += scan.slopeW[1]; -#endif - -#ifdef IPOL_C0 - scan.c[0][0] += scan.slopeC[0][0]; - scan.c[0][1] += scan.slopeC[0][1]; -#endif - -#ifdef IPOL_C1 - scan.c[1][0] += scan.slopeC[1][0]; - scan.c[1][1] += scan.slopeC[1][1]; -#endif - -#ifdef IPOL_T0 - scan.t[0][0] += scan.slopeT[0][0]; - scan.t[0][1] += scan.slopeT[0][1]; -#endif - -#ifdef IPOL_T1 - scan.t[1][0] += scan.slopeT[1][0]; - scan.t[1][1] += scan.slopeT[1][1]; -#endif - - } - } - -} - - -} // end namespace video -} // end namespace irr - -#endif // _IRR_COMPILE_WITH_BURNINGSVIDEO_ - -namespace irr -{ -namespace video -{ - -//! creates a flat triangle renderer -IBurningShader* createTriangleRendererTextureVertexAlpha2(CBurningVideoDriver* driver) -{ - /* ETR_TEXTURE_GOURAUD_VERTEX_ALPHA */ - #ifdef _IRR_COMPILE_WITH_BURNINGSVIDEO_ - return new CTRTextureVertexAlpha2(driver); - #else - return 0; - #endif // _IRR_COMPILE_WITH_BURNINGSVIDEO_ -} - - -} // end namespace video -} // end namespace irr - - - diff --git a/source/Irrlicht/CTRTextureGouraudWire.cpp b/source/Irrlicht/CTRTextureGouraudWire.cpp deleted file mode 100644 index 369b91ac..00000000 --- a/source/Irrlicht/CTRTextureGouraudWire.cpp +++ /dev/null @@ -1,362 +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" -#include "CTRTextureGouraud.h" - -#ifdef _IRR_COMPILE_WITH_SOFTWARE_ - -namespace irr -{ -namespace video -{ - -class CTRTextureGouraudWire : public CTRTextureGouraud -{ -public: - - CTRTextureGouraudWire(IZBuffer* zbuffer) - : CTRTextureGouraud(zbuffer) - { - #ifdef _DEBUG - setDebugName("CTRGouraudWire"); - #endif - } - - //! draws an indexed triangle list - virtual void drawIndexedTriangleList(S2DVertex* vertices, s32 vertexCount, const u16* indexList, s32 triangleCount) _IRR_OVERRIDE_ - { - const S2DVertex *v1, *v2, *v3; - - u16 color; - f32 tmpDiv; // temporary division factor - f32 longest; // saves the longest span - s32 height; // saves height of triangle - u16* targetSurface; // target pointer where to plot pixels - s32 spanEnd; // saves end of spans - f32 leftdeltaxf; // amount of pixels to increase on left side of triangle - f32 rightdeltaxf; // amount of pixels to increase on right side of triangle - s32 leftx, rightx; // position where we are - f32 leftxf, rightxf; // same as above, but as f32 values - s32 span; // current span - s32 leftR, leftG, leftB, rightR, rightG, rightB; // color values - s32 leftStepR, leftStepG, leftStepB, - rightStepR, rightStepG, rightStepB; // color steps - s32 leftTx, rightTx, leftTy, rightTy; // texture interpolating values - s32 leftTxStep, rightTxStep, leftTyStep, rightTyStep; // texture interpolating values - core::rect<s32> TriangleRect; - - s32 leftZValue, rightZValue; - s32 leftZStep, rightZStep; - TZBufferType* zTarget;//, *spanZTarget; // target of ZBuffer; - - lockedSurface = (u16*)RenderTarget->getData(); - lockedZBuffer = ZBuffer->lock(); - lockedTexture = (u16*)Texture->getData(); - - for (s32 i=0; i<triangleCount; ++i) - { - v1 = &vertices[*indexList]; - ++indexList; - v2 = &vertices[*indexList]; - ++indexList; - v3 = &vertices[*indexList]; - ++indexList; - - // back face culling - - if (BackFaceCullingEnabled) - { - s32 z = ((v3->Pos.X - v1->Pos.X) * (v3->Pos.Y - v2->Pos.Y)) - - ((v3->Pos.Y - v1->Pos.Y) * (v3->Pos.X - v2->Pos.X)); - - if (z < 0) - continue; - } - - //near plane clipping - - if (v1->ZValue<0 && v2->ZValue<0 && v3->ZValue<0) - continue; - - // sort for width for inscreen clipping - - if (v1->Pos.X > v2->Pos.X) swapVertices(&v1, &v2); - if (v1->Pos.X > v3->Pos.X) swapVertices(&v1, &v3); - if (v2->Pos.X > v3->Pos.X) swapVertices(&v2, &v3); - - if ((v1->Pos.X - v3->Pos.X) == 0) - continue; - - TriangleRect.UpperLeftCorner.X = v1->Pos.X; - TriangleRect.LowerRightCorner.X = v3->Pos.X; - - // sort for height for faster drawing. - - if (v1->Pos.Y > v2->Pos.Y) swapVertices(&v1, &v2); - if (v1->Pos.Y > v3->Pos.Y) swapVertices(&v1, &v3); - if (v2->Pos.Y > v3->Pos.Y) swapVertices(&v2, &v3); - - TriangleRect.UpperLeftCorner.Y = v1->Pos.Y; - TriangleRect.LowerRightCorner.Y = v3->Pos.Y; - - if (!TriangleRect.isRectCollided(ViewPortRect)) - continue; - - // calculate height of triangle - height = v3->Pos.Y - v1->Pos.Y; - if (!height) - continue; - - // calculate longest span - - longest = (v2->Pos.Y - v1->Pos.Y) / (f32)height * (v3->Pos.X - v1->Pos.X) + (v1->Pos.X - v2->Pos.X); - - spanEnd = v2->Pos.Y; - span = v1->Pos.Y; - leftxf = (f32)v1->Pos.X; - rightxf = (f32)v1->Pos.X; - - leftZValue = v1->ZValue; - rightZValue = v1->ZValue; - - leftR = rightR = video::getRed(v1->Color)<<8; - leftG = rightG = video::getGreen(v1->Color)<<8; - leftB = rightB = video::getBlue(v1->Color)<<8; - leftTx = rightTx = v1->TCoords.X; - leftTy = rightTy = v1->TCoords.Y; - - targetSurface = lockedSurface + span * SurfaceWidth; - zTarget = lockedZBuffer + span * SurfaceWidth; - - if (longest < 0.0f) - { - tmpDiv = 1.0f / (f32)(v2->Pos.Y - v1->Pos.Y); - rightdeltaxf = (v2->Pos.X - v1->Pos.X) * tmpDiv; - rightZStep = (s32)((v2->ZValue - v1->ZValue) * tmpDiv); - rightStepR = (s32)(((s32)(video::getRed(v2->Color)<<8) - rightR) * tmpDiv); - rightStepG = (s32)(((s32)(video::getGreen(v2->Color)<<8) - rightG) * tmpDiv); - rightStepB = (s32)(((s32)(video::getBlue(v2->Color)<<8) - rightB) * tmpDiv); - rightTxStep = (s32)((v2->TCoords.X - rightTx) * tmpDiv); - rightTyStep = (s32)((v2->TCoords.Y - rightTy) * tmpDiv); - - tmpDiv = 1.0f / (f32)height; - leftdeltaxf = (v3->Pos.X - v1->Pos.X) * tmpDiv; - leftZStep = (s32)((v3->ZValue - v1->ZValue) * tmpDiv); - leftStepR = (s32)(((s32)(video::getRed(v3->Color)<<8) - leftR) * tmpDiv); - leftStepG = (s32)(((s32)(video::getGreen(v3->Color)<<8) - leftG) * tmpDiv); - leftStepB = (s32)(((s32)(video::getBlue(v3->Color)<<8) - leftB) * tmpDiv); - leftTxStep = (s32)((v3->TCoords.X - leftTx) * tmpDiv); - leftTyStep = (s32)((v3->TCoords.Y - leftTy) * tmpDiv); - } - else - { - tmpDiv = 1.0f / (f32)height; - rightdeltaxf = (v3->Pos.X - v1->Pos.X) * tmpDiv; - rightZStep = (s32)((v3->ZValue - v1->ZValue) * tmpDiv); - rightStepR = (s32)(((s32)(video::getRed(v3->Color)<<8) - rightR) * tmpDiv); - rightStepG = (s32)(((s32)(video::getGreen(v3->Color)<<8) - rightG) * tmpDiv); - rightStepB = (s32)(((s32)(video::getBlue(v3->Color)<<8) - rightB) * tmpDiv); - rightTxStep = (s32)((v3->TCoords.X - rightTx) * tmpDiv); - rightTyStep = (s32)((v3->TCoords.Y - rightTy) * tmpDiv); - - tmpDiv = 1.0f / (f32)(v2->Pos.Y - v1->Pos.Y); - leftdeltaxf = (v2->Pos.X - v1->Pos.X) * tmpDiv; - leftZStep = (s32)((v2->ZValue - v1->ZValue) * tmpDiv); - leftStepR = (s32)(((s32)(video::getRed(v2->Color)<<8) - leftR) * tmpDiv); - leftStepG = (s32)(((s32)(video::getGreen(v2->Color)<<8) - leftG) * tmpDiv); - leftStepB = (s32)(((s32)(video::getBlue(v2->Color)<<8) - leftB) * tmpDiv); - leftTxStep = (s32)((v2->TCoords.X - leftTx) * tmpDiv); - leftTyStep = (s32)((v2->TCoords.Y - leftTy) * tmpDiv); - } - - - // do it twice, once for the first half of the triangle, - // end then for the second half. - - for (s32 triangleHalf=0; triangleHalf<2; ++triangleHalf) - { - if (spanEnd > ViewPortRect.LowerRightCorner.Y) - spanEnd = ViewPortRect.LowerRightCorner.Y; - - // if the span <0, than we can skip these spans, - // and proceed to the next spans which are really on the screen. - if (span < ViewPortRect.UpperLeftCorner.Y) - { - // we'll use leftx as temp variable - if (spanEnd < ViewPortRect.UpperLeftCorner.Y) - { - leftx = spanEnd - span; - span = spanEnd; - } - else - { - leftx = ViewPortRect.UpperLeftCorner.Y - span; - span = ViewPortRect.UpperLeftCorner.Y; - } - - leftxf += leftdeltaxf*leftx; - rightxf += rightdeltaxf*leftx; - targetSurface += SurfaceWidth*leftx; - zTarget += SurfaceWidth*leftx; - leftZValue += leftZStep*leftx; - rightZValue += rightZStep*leftx; - - leftR += leftStepR*leftx; - leftG += leftStepG*leftx; - leftB += leftStepB*leftx; - rightR += rightStepR*leftx; - rightG += rightStepG*leftx; - rightB += rightStepB*leftx; - - leftTx += leftTxStep*leftx; - leftTy += leftTyStep*leftx; - rightTx += rightTxStep*leftx; - rightTy += rightTyStep*leftx; - } - - - // the main loop. Go through every span and draw it. - - while (span < spanEnd) - { - leftx = (s32)(leftxf); - rightx = (s32)(rightxf + 0.5f); - - // perform some clipping - - if (leftx>=ViewPortRect.UpperLeftCorner.X && - leftx<=ViewPortRect.LowerRightCorner.X) - { - if (leftZValue > *(zTarget + leftx)) - { - *(zTarget + leftx) = leftZValue; - color = lockedTexture[((leftTy>>8)&textureYMask) * lockedTextureWidth + ((leftTx>>8)&textureXMask)]; - *(targetSurface + leftx) = video::RGB16(video::getRed(color) * (leftR>>8) >>2, - video::getGreen(color) * (leftG>>8) >>2, - video::getBlue(color) * (leftR>>8) >>2); - } - } - - - if (rightx>=ViewPortRect.UpperLeftCorner.X && - rightx<=ViewPortRect.LowerRightCorner.X) - { - if (rightZValue > *(zTarget + rightx)) - { - *(zTarget + rightx) = rightZValue; - color = lockedTexture[((rightTy>>8)&textureYMask) * lockedTextureWidth + ((rightTx>>8)&textureXMask)]; - *(targetSurface + rightx) = video::RGB16(video::getRed(color) * (rightR>>8) >>2, - video::getGreen(color) * (rightG>>8) >>2, - video::getBlue(color) * (rightR>>8) >>2); - } - - } - - leftxf += leftdeltaxf; - rightxf += rightdeltaxf; - ++span; - targetSurface += SurfaceWidth; - zTarget += SurfaceWidth; - leftZValue += leftZStep; - rightZValue += rightZStep; - - leftR += leftStepR; - leftG += leftStepG; - leftB += leftStepB; - rightR += rightStepR; - rightG += rightStepG; - rightB += rightStepB; - - leftTx += leftTxStep; - leftTy += leftTyStep; - rightTx += rightTxStep; - rightTy += rightTyStep; - } - - if (triangleHalf>0) // break, we've gout only two halves - break; - - - // setup variables for second half of the triangle. - - if (longest < 0.0f) - { - tmpDiv = 1.0f / (v3->Pos.Y - v2->Pos.Y); - - rightdeltaxf = (v3->Pos.X - v2->Pos.X) * tmpDiv; - rightxf = (f32)v2->Pos.X; - - rightZValue = v2->ZValue; - rightZStep = (s32)((v3->ZValue - v2->ZValue) * tmpDiv); - - rightR = video::getRed(v2->Color)<<8; - rightG = video::getGreen(v2->Color)<<8; - rightB = video::getBlue(v2->Color)<<8; - rightStepR = (s32)(((s32)(video::getRed(v3->Color)<<8) - rightR) * tmpDiv); - rightStepG = (s32)(((s32)(video::getGreen(v3->Color)<<8) - rightG) * tmpDiv); - rightStepB = (s32)(((s32)(video::getBlue(v3->Color)<<8) - rightB) * tmpDiv); - - rightTx = v2->TCoords.X; - rightTy = v2->TCoords.Y; - rightTxStep = (s32)((v3->TCoords.X - rightTx) * tmpDiv); - rightTyStep = (s32)((v3->TCoords.Y - rightTy) * tmpDiv); - } - else - { - tmpDiv = 1.0f / (v3->Pos.Y - v2->Pos.Y); - - leftdeltaxf = (v3->Pos.X - v2->Pos.X) * tmpDiv; - leftxf = (f32)v2->Pos.X; - - leftZValue = v2->ZValue; - leftZStep = (s32)((v3->ZValue - v2->ZValue) * tmpDiv); - - leftR = video::getRed(v2->Color)<<8; - leftG = video::getGreen(v2->Color)<<8; - leftB = video::getBlue(v2->Color)<<8; - leftStepR = (s32)(((s32)(video::getRed(v3->Color)<<8) - leftR) * tmpDiv); - leftStepG = (s32)(((s32)(video::getGreen(v3->Color)<<8) - leftG) * tmpDiv); - leftStepB = (s32)(((s32)(video::getBlue(v3->Color)<<8) - leftB) * tmpDiv); - - leftTx = v2->TCoords.X; - leftTy = v2->TCoords.Y; - leftTxStep = (s32)((v3->TCoords.X - leftTx) * tmpDiv); - leftTyStep = (s32)((v3->TCoords.Y - leftTy) * tmpDiv); - } - - - spanEnd = v3->Pos.Y; - } - - } - - ZBuffer->unlock(); - } -}; - - -} // end namespace video -} // end namespace irr - -#endif // _IRR_COMPILE_WITH_SOFTWARE_ - -namespace irr -{ -namespace video -{ - -//! creates a flat triangle renderer -ITriangleRenderer* createTriangleRendererTextureGouraudWire(IZBuffer* zbuffer) -{ - #ifdef _IRR_COMPILE_WITH_SOFTWARE_ - return new CTRTextureGouraudWire(zbuffer); - #else - return 0; - #endif // _IRR_COMPILE_WITH_SOFTWARE_ -} - -} // end namespace video -} // end namespace irr - diff --git a/source/Irrlicht/CTRTextureLightMap2_Add.cpp b/source/Irrlicht/CTRTextureLightMap2_Add.cpp deleted file mode 100644 index 61497d3b..00000000 --- a/source/Irrlicht/CTRTextureLightMap2_Add.cpp +++ /dev/null @@ -1,657 +0,0 @@ -// Copyright (C) 2002-2012 Nikolaus Gebhardt / Thomas Alten -// This file is part of the "Irrlicht Engine". -// For conditions of distribution and use, see copyright notice in irrlicht.h - -#include "IrrCompileConfig.h" -#include "IBurningShader.h" - -#ifdef _IRR_COMPILE_WITH_BURNINGSVIDEO_ - -// compile flag for this file -#undef USE_ZBUFFER -#undef IPOL_Z -#undef CMP_Z -#undef WRITE_Z - -#undef IPOL_W -#undef CMP_W -#undef WRITE_W - -#undef SUBTEXEL -#undef INVERSE_W - -#undef IPOL_C0 -#undef IPOL_T0 -#undef IPOL_T1 - -// define render case -#define SUBTEXEL -#define INVERSE_W - -#define USE_ZBUFFER -#define IPOL_W -#define CMP_W -#define WRITE_W - -//#define IPOL_C0 -#define IPOL_T0 -#define IPOL_T1 - -// apply global override -#ifndef SOFTWARE_DRIVER_2_PERSPECTIVE_CORRECT - #undef INVERSE_W -#endif - -#ifndef SOFTWARE_DRIVER_2_SUBTEXEL - #undef SUBTEXEL -#endif - -#if BURNING_MATERIAL_MAX_COLORS < 1 - #undef IPOL_C0 -#endif - -#if !defined ( SOFTWARE_DRIVER_2_USE_WBUFFER ) && defined ( USE_ZBUFFER ) - #ifndef SOFTWARE_DRIVER_2_PERSPECTIVE_CORRECT - #undef IPOL_W - #endif - #define IPOL_Z - - #ifdef CMP_W - #undef CMP_W - #define CMP_Z - #endif - - #ifdef WRITE_W - #undef WRITE_W - #define WRITE_Z - #endif - -#endif - -namespace irr -{ - -namespace video -{ - -class CTRTextureLightMap2_Add : public IBurningShader -{ -public: - - //! constructor - CTRTextureLightMap2_Add(CBurningVideoDriver* driver); - - //! draws an indexed triangle list - virtual void drawTriangle(const s4DVertex* burning_restrict a, const s4DVertex* burning_restrict b, const s4DVertex* burning_restrict c) _IRR_OVERRIDE_; - - -private: - void fragmentShader(); - -}; - -//! constructor -CTRTextureLightMap2_Add::CTRTextureLightMap2_Add(CBurningVideoDriver* driver) -: IBurningShader(driver) -{ - #ifdef _DEBUG - setDebugName("CTRTextureLightMap2_Add"); - #endif -} - - - -/*! -*/ -REALINLINE void CTRTextureLightMap2_Add::fragmentShader() -{ - tVideoSample *dst; - -#ifdef USE_ZBUFFER - fp24 *z; -#endif - - s32 xStart; - s32 xEnd; - s32 dx; - - -#ifdef SUBTEXEL - f32 subPixel; -#endif - -#ifdef IPOL_Z - f32 slopeZ; -#endif -#ifdef IPOL_W - fp24 slopeW; -#endif -#ifdef IPOL_C0 - sVec4 slopeC; -#endif -#ifdef IPOL_T0 - sVec2 slopeT[BURNING_MATERIAL_MAX_TEXTURES]; -#endif - - // apply top-left fill-convention, left - xStart = fill_convention_left( line.x[0] ); - xEnd = fill_convention_right( line.x[1] ); - - dx = xEnd - xStart; - - if ( dx < 0 ) - return; - - // slopes - const f32 invDeltaX = fill_step_x( line.x[1] - line.x[0] ); - -#ifdef IPOL_Z - slopeZ = (line.z[1] - line.z[0]) * invDeltaX; -#endif -#ifdef IPOL_W - slopeW = (line.w[1] - line.w[0]) * invDeltaX; -#endif -#ifdef IPOL_C0 - slopeC = (line.c[1] - line.c[0]) * invDeltaX; -#endif -#ifdef IPOL_T0 - slopeT[0] = (line.t[0][1] - line.t[0][0]) * invDeltaX; -#endif -#ifdef IPOL_T1 - slopeT[1] = (line.t[1][1] - line.t[1][0]) * invDeltaX; -#endif - -#ifdef SUBTEXEL - subPixel = ( (f32) xStart ) - line.x[0]; -#ifdef IPOL_Z - line.z[0] += slopeZ * subPixel; -#endif -#ifdef IPOL_W - line.w[0] += slopeW * subPixel; -#endif -#ifdef IPOL_C0 - line.c[0] += slopeC * subPixel; -#endif -#ifdef IPOL_T0 - line.t[0][0] += slopeT[0] * subPixel; -#endif -#ifdef IPOL_T1 - line.t[1][0] += slopeT[1] * subPixel; -#endif -#endif - - SOFTWARE_DRIVER_2_CLIPCHECK; - dst = (tVideoSample*)RenderTarget->getData() + ( line.y * RenderTarget->getDimension().Width ) + xStart; - -#ifdef USE_ZBUFFER - z = (fp24*) DepthBuffer->lock() + ( line.y * RenderTarget->getDimension().Width ) + xStart; -#endif - - - f32 inversew = FIX_POINT_F32_MUL; - -#if defined(BURNINGVIDEO_RENDERER_FAST) && COLOR_MAX==0xff - u32 dIndex = ( line.y & 3 ) << 2; -#else - // - tFixPoint r0, g0, b0; - tFixPoint r1, g1, b1; -#endif - - - for ( s32 i = 0; i <= dx; i += SOFTWARE_DRIVER_2_STEP_X) - { -#ifdef CMP_Z - if ( line.z[0] < z[i] ) -#endif -#ifdef CMP_W - if ( line.w[0] >= z[i] ) -#endif - { - -#ifdef WRITE_Z - z[i] = line.z[0]; -#endif -#ifdef WRITE_W - z[i] = line.w[0]; -#endif - -#ifdef INVERSE_W - inversew = fix_inverse32(line.w[0]); -#endif - -#if defined(BURNINGVIDEO_RENDERER_FAST) && COLOR_MAX==0xff - - const tFixPointu d = dithermask [ dIndex | ( i ) & 3 ]; - - dst[i] = PixelAdd32 ( - getTexel_plain ( &IT[0], d + tofix ( line.t[0][0].x,inversew), - d + tofix ( line.t[0][0].y,inversew) ), - getTexel_plain ( &IT[1], d + tofix ( line.t[1][0].x,inversew), - d + tofix ( line.t[1][0].y,inversew) ) - ); - -#else - - getSample_texture ( r0, g0, b0, &IT[0], tofix ( line.t[0][0].x,inversew), tofix ( line.t[0][0].y,inversew) ); - getSample_texture ( r1, g1, b1, &IT[1], tofix ( line.t[1][0].x,inversew), tofix ( line.t[1][0].y,inversew) ); - - dst[i] = fix_to_sample( clampfix_maxcolor ( r0 + r1 ), - clampfix_maxcolor ( g0 + g1 ), - clampfix_maxcolor ( b0 + b1 ) - ); -#endif - - } - -#ifdef IPOL_Z - line.z[0] += slopeZ; -#endif -#ifdef IPOL_W - line.w[0] += slopeW; -#endif -#ifdef IPOL_C0 - line.c[0] += slopeC; -#endif -#ifdef IPOL_T0 - line.t[0][0] += slopeT[0]; -#endif -#ifdef IPOL_T1 - line.t[1][0] += slopeT[1]; -#endif - } - -} - -void CTRTextureLightMap2_Add::drawTriangle(const s4DVertex* burning_restrict a, const s4DVertex* burning_restrict b, const s4DVertex* burning_restrict c) -{ - // sort on height, y - if ( F32_A_GREATER_B ( a->Pos.y , b->Pos.y ) ) swapVertexPointer(&a, &b); - if ( F32_A_GREATER_B ( b->Pos.y , c->Pos.y ) ) swapVertexPointer(&b, &c); - if ( F32_A_GREATER_B ( a->Pos.y , b->Pos.y ) ) swapVertexPointer(&a, &b); - - const f32 ca = c->Pos.y - a->Pos.y; - const f32 ba = b->Pos.y - a->Pos.y; - const f32 cb = c->Pos.y - b->Pos.y; - // calculate delta y of the edges - scan.invDeltaY[0] = fill_step_y( ca ); - scan.invDeltaY[1] = fill_step_y( ba ); - scan.invDeltaY[2] = fill_step_y( cb ); - - if ( F32_LOWER_EQUAL_0 ( scan.invDeltaY[0] ) ) - return; - - // find if the major edge is left or right aligned - f32 temp[4]; - - temp[0] = a->Pos.x - c->Pos.x; - temp[1] = -ca; - temp[2] = b->Pos.x - a->Pos.x; - temp[3] = ba; - - scan.left = ( temp[0] * temp[3] - temp[1] * temp[2] ) > 0.f ? 0 : 1; - scan.right = 1 - scan.left; - - // calculate slopes for the major edge - scan.slopeX[0] = (c->Pos.x - a->Pos.x) * scan.invDeltaY[0]; - scan.x[0] = a->Pos.x; - -#ifdef IPOL_Z - scan.slopeZ[0] = (c->Pos.z - a->Pos.z) * scan.invDeltaY[0]; - scan.z[0] = a->Pos.z; -#endif - -#ifdef IPOL_W - scan.slopeW[0] = (c->Pos.w - a->Pos.w) * scan.invDeltaY[0]; - scan.w[0] = a->Pos.w; -#endif - -#ifdef IPOL_C0 - scan.slopeC[0] = (c->Color[0] - a->Color[0]) * scan.invDeltaY[0]; - scan.c[0] = a->Color[0]; -#endif - -#ifdef IPOL_T0 - scan.slopeT[0][0] = (c->Tex[0] - a->Tex[0]) * scan.invDeltaY[0]; - scan.t[0][0] = a->Tex[0]; -#endif - -#ifdef IPOL_T1 - scan.slopeT[1][0] = (c->Tex[1] - a->Tex[1]) * scan.invDeltaY[0]; - scan.t[1][0] = a->Tex[1]; -#endif - - // top left fill convention y run - s32 yStart; - s32 yEnd; - -#ifdef SUBTEXEL - f32 subPixel; -#endif - - // rasterize upper sub-triangle - if ( (f32) 0.0 != scan.invDeltaY[1] ) - { - // calculate slopes for top edge - scan.slopeX[1] = (b->Pos.x - a->Pos.x) * scan.invDeltaY[1]; - scan.x[1] = a->Pos.x; - -#ifdef IPOL_Z - scan.slopeZ[1] = (b->Pos.z - a->Pos.z) * scan.invDeltaY[1]; - scan.z[1] = a->Pos.z; -#endif - -#ifdef IPOL_W - scan.slopeW[1] = (b->Pos.w - a->Pos.w) * scan.invDeltaY[1]; - scan.w[1] = a->Pos.w; -#endif - -#ifdef IPOL_C0 - scan.slopeC[1] = (b->Color[0] - a->Color[0]) * scan.invDeltaY[1]; - scan.c[1] = a->Color[0]; -#endif - -#ifdef IPOL_T0 - scan.slopeT[0][1] = (b->Tex[0] - a->Tex[0]) * scan.invDeltaY[1]; - scan.t[0][1] = a->Tex[0]; -#endif - -#ifdef IPOL_T1 - scan.slopeT[1][1] = (b->Tex[1] - a->Tex[1]) * scan.invDeltaY[1]; - scan.t[1][1] = a->Tex[1]; -#endif - - // apply top-left fill convention, top part - yStart = fill_convention_left( a->Pos.y ); - yEnd = fill_convention_right( b->Pos.y ); - -#ifdef SUBTEXEL - subPixel = ( (f32) yStart ) - a->Pos.y; - - // correct to pixel center - scan.x[0] += scan.slopeX[0] * subPixel; - scan.x[1] += scan.slopeX[1] * subPixel; - -#ifdef IPOL_Z - scan.z[0] += scan.slopeZ[0] * subPixel; - scan.z[1] += scan.slopeZ[1] * subPixel; -#endif - -#ifdef IPOL_W - scan.w[0] += scan.slopeW[0] * subPixel; - scan.w[1] += scan.slopeW[1] * subPixel; -#endif - -#ifdef IPOL_C0 - scan.c[0] += scan.slopeC[0] * subPixel; - scan.c[1] += scan.slopeC[1] * subPixel; -#endif - -#ifdef IPOL_T0 - scan.t[0][0] += scan.slopeT[0][0] * subPixel; - scan.t[0][1] += scan.slopeT[0][1] * subPixel; -#endif - -#ifdef IPOL_T1 - scan.t[1][0] += scan.slopeT[1][0] * subPixel; - scan.t[1][1] += scan.slopeT[1][1] * subPixel; -#endif - -#endif - - // rasterize the edge scanlines - for( line.y = yStart; line.y <= yEnd; line.y += SOFTWARE_DRIVER_2_STEP_Y) - { - line.x[scan.left] = scan.x[0]; - line.x[scan.right] = scan.x[1]; - -#ifdef IPOL_Z - line.z[scan.left] = scan.z[0]; - line.z[scan.right] = scan.z[1]; -#endif - -#ifdef IPOL_W - line.w[scan.left] = scan.w[0]; - line.w[scan.right] = scan.w[1]; -#endif - -#ifdef IPOL_C0 - line.c[scan.left] = scan.c[0]; - line.c[scan.right] = scan.c[1]; -#endif - -#ifdef IPOL_T0 - line.t[0][scan.left] = scan.t[0][0]; - line.t[0][scan.right] = scan.t[0][1]; -#endif - -#ifdef IPOL_T1 - line.t[1][scan.left] = scan.t[1][0]; - line.t[1][scan.right] = scan.t[1][1]; -#endif - - // render a scanline - interlace_scanline fragmentShader(); - - scan.x[0] += scan.slopeX[0]; - scan.x[1] += scan.slopeX[1]; - -#ifdef IPOL_Z - scan.z[0] += scan.slopeZ[0]; - scan.z[1] += scan.slopeZ[1]; -#endif - -#ifdef IPOL_W - scan.w[0] += scan.slopeW[0]; - scan.w[1] += scan.slopeW[1]; -#endif - -#ifdef IPOL_C0 - scan.c[0] += scan.slopeC[0]; - scan.c[1] += scan.slopeC[1]; -#endif - -#ifdef IPOL_T0 - scan.t[0][0] += scan.slopeT[0][0]; - scan.t[0][1] += scan.slopeT[0][1]; -#endif - -#ifdef IPOL_T1 - scan.t[1][0] += scan.slopeT[1][0]; - scan.t[1][1] += scan.slopeT[1][1]; -#endif - - } - } - - // rasterize lower sub-triangle - if ( (f32) 0.0 != scan.invDeltaY[2] ) - { - // advance to middle point - if( (f32) 0.0 != scan.invDeltaY[1] ) - { - temp[0] = b->Pos.y - a->Pos.y; // dy - - scan.x[0] = a->Pos.x + scan.slopeX[0] * temp[0]; -#ifdef IPOL_Z - scan.z[0] = a->Pos.z + scan.slopeZ[0] * temp[0]; -#endif -#ifdef IPOL_W - scan.w[0] = a->Pos.w + scan.slopeW[0] * temp[0]; -#endif -#ifdef IPOL_C0 - scan.c[0] = a->Color[0] + scan.slopeC[0] * temp[0]; -#endif -#ifdef IPOL_T0 - scan.t[0][0] = a->Tex[0] + scan.slopeT[0][0] * temp[0]; -#endif -#ifdef IPOL_T1 - scan.t[1][0] = a->Tex[1] + scan.slopeT[1][0] * temp[0]; -#endif - - } - - // calculate slopes for bottom edge - scan.slopeX[1] = (c->Pos.x - b->Pos.x) * scan.invDeltaY[2]; - scan.x[1] = b->Pos.x; - -#ifdef IPOL_Z - scan.slopeZ[1] = (c->Pos.z - b->Pos.z) * scan.invDeltaY[2]; - scan.z[1] = b->Pos.z; -#endif - -#ifdef IPOL_W - scan.slopeW[1] = (c->Pos.w - b->Pos.w) * scan.invDeltaY[2]; - scan.w[1] = b->Pos.w; -#endif - -#ifdef IPOL_C0 - scan.slopeC[1] = (c->Color[0] - b->Color[0]) * scan.invDeltaY[2]; - scan.c[1] = b->Color[0]; -#endif - -#ifdef IPOL_T0 - scan.slopeT[0][1] = (c->Tex[0] - b->Tex[0]) * scan.invDeltaY[2]; - scan.t[0][1] = b->Tex[0]; -#endif - -#ifdef IPOL_T1 - scan.slopeT[1][1] = (c->Tex[1] - b->Tex[1]) * scan.invDeltaY[2]; - scan.t[1][1] = b->Tex[1]; -#endif - - // apply top-left fill convention, top part - yStart = fill_convention_left( b->Pos.y ); - yEnd = fill_convention_right( c->Pos.y ); - -#ifdef SUBTEXEL - - subPixel = ( (f32) yStart ) - b->Pos.y; - - // correct to pixel center - scan.x[0] += scan.slopeX[0] * subPixel; - scan.x[1] += scan.slopeX[1] * subPixel; - -#ifdef IPOL_Z - scan.z[0] += scan.slopeZ[0] * subPixel; - scan.z[1] += scan.slopeZ[1] * subPixel; -#endif - -#ifdef IPOL_W - scan.w[0] += scan.slopeW[0] * subPixel; - scan.w[1] += scan.slopeW[1] * subPixel; -#endif - -#ifdef IPOL_C0 - scan.c[0] += scan.slopeC[0] * subPixel; - scan.c[1] += scan.slopeC[1] * subPixel; -#endif - -#ifdef IPOL_T0 - scan.t[0][0] += scan.slopeT[0][0] * subPixel; - scan.t[0][1] += scan.slopeT[0][1] * subPixel; -#endif - -#ifdef IPOL_T1 - scan.t[1][0] += scan.slopeT[1][0] * subPixel; - scan.t[1][1] += scan.slopeT[1][1] * subPixel; -#endif - -#endif - - // rasterize the edge scanlines - for( line.y = yStart; line.y <= yEnd; line.y += SOFTWARE_DRIVER_2_STEP_Y) - { - line.x[scan.left] = scan.x[0]; - line.x[scan.right] = scan.x[1]; - -#ifdef IPOL_Z - line.z[scan.left] = scan.z[0]; - line.z[scan.right] = scan.z[1]; -#endif - -#ifdef IPOL_W - line.w[scan.left] = scan.w[0]; - line.w[scan.right] = scan.w[1]; -#endif - -#ifdef IPOL_C0 - line.c[scan.left] = scan.c[0]; - line.c[scan.right] = scan.c[1]; -#endif - -#ifdef IPOL_T0 - line.t[0][scan.left] = scan.t[0][0]; - line.t[0][scan.right] = scan.t[0][1]; -#endif - -#ifdef IPOL_T1 - line.t[1][scan.left] = scan.t[1][0]; - line.t[1][scan.right] = scan.t[1][1]; -#endif - - // render a scanline - interlace_scanline fragmentShader(); - - scan.x[0] += scan.slopeX[0]; - scan.x[1] += scan.slopeX[1]; - -#ifdef IPOL_Z - scan.z[0] += scan.slopeZ[0]; - scan.z[1] += scan.slopeZ[1]; -#endif - -#ifdef IPOL_W - scan.w[0] += scan.slopeW[0]; - scan.w[1] += scan.slopeW[1]; -#endif - -#ifdef IPOL_C0 - scan.c[0] += scan.slopeC[0]; - scan.c[1] += scan.slopeC[1]; -#endif - -#ifdef IPOL_T0 - scan.t[0][0] += scan.slopeT[0][0]; - scan.t[0][1] += scan.slopeT[0][1]; -#endif - -#ifdef IPOL_T1 - scan.t[1][0] += scan.slopeT[1][0]; - scan.t[1][1] += scan.slopeT[1][1]; -#endif - - } - } - - -} - - -} // end namespace video -} // end namespace irr - -#endif // _IRR_COMPILE_WITH_BURNINGSVIDEO_ - -namespace irr -{ -namespace video -{ - -//! creates a flat triangle renderer -IBurningShader* createTriangleRendererTextureLightMap2_Add(CBurningVideoDriver* driver) -{ - /* ETR_TEXTURE_GOURAUD_LIGHTMAP_ADD */ - #ifdef _IRR_COMPILE_WITH_BURNINGSVIDEO_ - return new CTRTextureLightMap2_Add(driver); - #else - return 0; - #endif // _IRR_COMPILE_WITH_BURNINGSVIDEO_ -} - - -} // end namespace video -} // end namespace irr - - - diff --git a/source/Irrlicht/CTRTextureLightMap2_M1.cpp b/source/Irrlicht/CTRTextureLightMap2_M1.cpp deleted file mode 100644 index b8d0893f..00000000 --- a/source/Irrlicht/CTRTextureLightMap2_M1.cpp +++ /dev/null @@ -1,640 +0,0 @@ -// Copyright (C) 2002-2012 Nikolaus Gebhardt / Thomas Alten -// This file is part of the "Irrlicht Engine". -// For conditions of distribution and use, see copyright notice in irrlicht.h - -#include "IrrCompileConfig.h" -#include "IBurningShader.h" - -#ifdef _IRR_COMPILE_WITH_BURNINGSVIDEO_ - -// compile flag for this file -#undef USE_ZBUFFER -#undef IPOL_Z -#undef CMP_Z -#undef WRITE_Z - -#undef IPOL_W -#undef CMP_W -#undef WRITE_W - -#undef SUBTEXEL -#undef INVERSE_W - -#undef IPOL_C0 -#undef IPOL_T0 -#undef IPOL_T1 - -// define render case -#define SUBTEXEL -#define INVERSE_W - -#define USE_ZBUFFER -#define IPOL_W -#define CMP_W -#define WRITE_W - -//#define IPOL_C0 -#define IPOL_T0 -#define IPOL_T1 - -// apply global override -#ifndef SOFTWARE_DRIVER_2_PERSPECTIVE_CORRECT - #undef INVERSE_W -#endif - -#ifndef SOFTWARE_DRIVER_2_SUBTEXEL - #undef SUBTEXEL -#endif - -#if BURNING_MATERIAL_MAX_COLORS < 1 - #undef IPOL_C0 -#endif - -#if !defined ( SOFTWARE_DRIVER_2_USE_WBUFFER ) && defined ( USE_ZBUFFER ) - #ifndef SOFTWARE_DRIVER_2_PERSPECTIVE_CORRECT - #undef IPOL_W - #endif - #define IPOL_Z - - #ifdef CMP_W - #undef CMP_W - #define CMP_Z - #endif - - #ifdef WRITE_W - #undef WRITE_W - #define WRITE_Z - #endif - -#endif - -namespace irr -{ - -namespace video -{ - -class CTRTextureLightMap2_M1 : public IBurningShader -{ -public: - - //! constructor - CTRTextureLightMap2_M1(CBurningVideoDriver* driver); - - //! draws an indexed triangle list - virtual void drawTriangle(const s4DVertex* burning_restrict a, const s4DVertex* burning_restrict b, const s4DVertex* burning_restrict c) _IRR_OVERRIDE_; - - -private: - void scanline_bilinear2 (); - -}; - -//! constructor -CTRTextureLightMap2_M1::CTRTextureLightMap2_M1(CBurningVideoDriver* driver) -: IBurningShader(driver) -{ - #ifdef _DEBUG - setDebugName("CTRTextureLightMap2_M1"); - #endif -} - -/*! -*/ -REALINLINE void CTRTextureLightMap2_M1::scanline_bilinear2 () -{ - tVideoSample *dst; - fp24 *z; - - s32 xStart; - s32 xEnd; - s32 dx; - s32 i; - - - // apply top-left fill-convention, left - xStart = fill_convention_left( line.x[0] ); - xEnd = fill_convention_right( line.x[1] ); - - dx = xEnd - xStart; - if ( dx < 0 ) - return; - - // slopes - const f32 invDeltaX = fill_step_x( line.x[1] - line.x[0] ); - - // search z-buffer for first not occulled pixel - z = (fp24*) DepthBuffer->lock() + ( line.y * RenderTarget->getDimension().Width ) + xStart; - - // subTexel - const f32 subPixel = ( (f32) xStart ) - line.x[0]; - -#ifdef IPOL_W - const f32 b = (line.w[1] - line.w[0]) * invDeltaX; - f32 a = line.w[0] + ( b * subPixel ); - - i = 0; - - while ( a <= z[i] ) - { - a += b; - - i += 1; - if ( i > dx ) - return; - } - - // lazy setup rest of scanline - - line.w[0] = a; - line.w[1] = b; -#else - const f32 b = (line.z[1] - line.z[0]) * invDeltaX; - f32 a = line.z[0] + ( b * subPixel ); - - i = 0; - - while ( a > z[i] ) - { - a += b; - - i += 1; - if ( i > dx ) - return; - } - - // lazy setup rest of scanline - - line.z[0] = a; - line.z[1] = b; -#endif - SOFTWARE_DRIVER_2_CLIPCHECK; - dst = (tVideoSample*)RenderTarget->getData() + ( line.y * RenderTarget->getDimension().Width ) + xStart; - - a = (f32) i + subPixel; - - line.t[0][1] = (line.t[0][1] - line.t[0][0]) * invDeltaX; - line.t[1][1] = (line.t[1][1] - line.t[1][0]) * invDeltaX; - - line.t[0][0] += line.t[0][1] * a; - line.t[1][0] += line.t[1][1] * a; - - -#ifdef BURNINGVIDEO_RENDERER_FAST - u32 dIndex = ( line.y & 3 ) << 2; - - tFixPoint r0, g0, b0; - tFixPoint r1, g1, b1; - -#else - // - tFixPoint r0, g0, b0; - tFixPoint r1, g1, b1; -#endif - - - for ( ;i <= dx; i += SOFTWARE_DRIVER_2_STEP_X) - { -#ifdef IPOL_W - if ( line.w[0] >= z[i] ) - { - z[i] = line.w[0]; -#else - if ( line.z[0] < z[i] ) - { - z[i] = line.z[0]; -#endif - -#ifdef SOFTWARE_DRIVER_2_PERSPECTIVE_CORRECT - f32 inversew = fix_inverse32 ( line.w[0] ); -#else - f32 inversew = FIX_POINT_F32_MUL; -#endif - - - -#ifdef BURNINGVIDEO_RENDERER_FAST - - const tFixPointu d = dithermask [ dIndex | ( i ) & 3 ]; - - getSample_texture ( r0, g0, b0, &IT[0], d + tofix ( line.t[0][0].x,inversew), d + tofix ( line.t[0][0].y,inversew) ); - getSample_texture ( r1, g1, b1, &IT[1], d + tofix ( line.t[1][0].x,inversew), d + tofix ( line.t[1][0].y,inversew) ); -#else - getSample_texture ( r0, g0, b0, &IT[0], tofix ( line.t[0][0].x,inversew), tofix ( line.t[0][0].y,inversew) ); - getSample_texture ( r1, g1, b1, &IT[1], tofix ( line.t[1][0].x,inversew), tofix ( line.t[1][0].y,inversew) ); - -#endif - - dst[i] = fix_to_sample( imulFix_tex1 ( r0, r1 ), - imulFix_tex1 ( g0, g1 ), - imulFix_tex1 ( b0, b1 ) - ); - } - -#ifdef IPOL_W - line.w[0] += line.w[1]; -#else - line.z[0] += line.z[1]; -#endif - line.t[0][0] += line.t[0][1]; - line.t[1][0] += line.t[1][1]; - } - -} - - -void CTRTextureLightMap2_M1::drawTriangle(const s4DVertex* burning_restrict a, const s4DVertex* burning_restrict b, const s4DVertex* burning_restrict c) -{ - - // sort on height, y - if ( F32_A_GREATER_B ( a->Pos.y , b->Pos.y ) ) swapVertexPointer(&a, &b); - if ( F32_A_GREATER_B ( b->Pos.y , c->Pos.y ) ) swapVertexPointer(&b, &c); - if ( F32_A_GREATER_B ( a->Pos.y , b->Pos.y ) ) swapVertexPointer(&a, &b); - - const f32 ca = c->Pos.y - a->Pos.y; - const f32 ba = b->Pos.y - a->Pos.y; - const f32 cb = c->Pos.y - b->Pos.y; - // calculate delta y of the edges - scan.invDeltaY[0] = fill_step_y( ca ); - scan.invDeltaY[1] = fill_step_y( ba ); - scan.invDeltaY[2] = fill_step_y( cb ); - - if ( F32_LOWER_EQUAL_0 ( scan.invDeltaY[0] ) ) - return; - - // find if the major edge is left or right aligned - f32 temp[4]; - - temp[0] = a->Pos.x - c->Pos.x; - temp[1] = -ca; - temp[2] = b->Pos.x - a->Pos.x; - temp[3] = ba; - - scan.left = ( temp[0] * temp[3] - temp[1] * temp[2] ) > 0.f ? 0 : 1; - scan.right = 1 - scan.left; - - // calculate slopes for the major edge - scan.slopeX[0] = (c->Pos.x - a->Pos.x) * scan.invDeltaY[0]; - scan.x[0] = a->Pos.x; - -#ifdef IPOL_Z - scan.slopeZ[0] = (c->Pos.z - a->Pos.z) * scan.invDeltaY[0]; - scan.z[0] = a->Pos.z; -#endif - -#ifdef IPOL_W - scan.slopeW[0] = (c->Pos.w - a->Pos.w) * scan.invDeltaY[0]; - scan.w[0] = a->Pos.w; -#endif - -#ifdef IPOL_C0 - scan.slopeC[0] = (c->Color[0] - a->Color[0]) * scan.invDeltaY[0]; - scan.c[0] = a->Color[0]; -#endif - -#ifdef IPOL_T0 - scan.slopeT[0][0] = (c->Tex[0] - a->Tex[0]) * scan.invDeltaY[0]; - scan.t[0][0] = a->Tex[0]; -#endif - -#ifdef IPOL_T1 - scan.slopeT[1][0] = (c->Tex[1] - a->Tex[1]) * scan.invDeltaY[0]; - scan.t[1][0] = a->Tex[1]; -#endif - - // top left fill convention y run - s32 yStart; - s32 yEnd; - -#ifdef SUBTEXEL - f32 subPixel; -#endif - - // rasterize upper sub-triangle - if ( F32_GREATER_0 ( scan.invDeltaY[1] ) ) - { - // calculate slopes for top edge - scan.slopeX[1] = (b->Pos.x - a->Pos.x) * scan.invDeltaY[1]; - scan.x[1] = a->Pos.x; - -#ifdef IPOL_Z - scan.slopeZ[1] = (b->Pos.z - a->Pos.z) * scan.invDeltaY[1]; - scan.z[1] = a->Pos.z; -#endif - -#ifdef IPOL_W - scan.slopeW[1] = (b->Pos.w - a->Pos.w) * scan.invDeltaY[1]; - scan.w[1] = a->Pos.w; -#endif - -#ifdef IPOL_C0 - scan.slopeC[1] = (b->Color[0] - a->Color[0]) * scan.invDeltaY[1]; - scan.c[1] = a->Color[0]; -#endif - -#ifdef IPOL_T0 - scan.slopeT[0][1] = (b->Tex[0] - a->Tex[0]) * scan.invDeltaY[1]; - scan.t[0][1] = a->Tex[0]; -#endif - -#ifdef IPOL_T1 - scan.slopeT[1][1] = (b->Tex[1] - a->Tex[1]) * scan.invDeltaY[1]; - scan.t[1][1] = a->Tex[1]; -#endif - - // apply top-left fill convention, top part - yStart = fill_convention_left( a->Pos.y ); - yEnd = fill_convention_right( b->Pos.y ); - -#ifdef SUBTEXEL - subPixel = ( (f32) yStart ) - a->Pos.y; - - // correct to pixel center - scan.x[0] += scan.slopeX[0] * subPixel; - scan.x[1] += scan.slopeX[1] * subPixel; - -#ifdef IPOL_Z - scan.z[0] += scan.slopeZ[0] * subPixel; - scan.z[1] += scan.slopeZ[1] * subPixel; -#endif - -#ifdef IPOL_W - scan.w[0] += scan.slopeW[0] * subPixel; - scan.w[1] += scan.slopeW[1] * subPixel; -#endif - -#ifdef IPOL_C0 - scan.c[0] += scan.slopeC[0] * subPixel; - scan.c[1] += scan.slopeC[1] * subPixel; -#endif - -#ifdef IPOL_T0 - scan.t[0][0] += scan.slopeT[0][0] * subPixel; - scan.t[0][1] += scan.slopeT[0][1] * subPixel; -#endif - -#ifdef IPOL_T1 - scan.t[1][0] += scan.slopeT[1][0] * subPixel; - scan.t[1][1] += scan.slopeT[1][1] * subPixel; -#endif - -#endif - - // rasterize the edge scanlines - for( line.y = yStart; line.y <= yEnd; line.y += SOFTWARE_DRIVER_2_STEP_Y) - { - line.x[scan.left] = scan.x[0]; - line.x[scan.right] = scan.x[1]; - -#ifdef IPOL_Z - line.z[scan.left] = scan.z[0]; - line.z[scan.right] = scan.z[1]; -#endif - -#ifdef IPOL_W - line.w[scan.left] = scan.w[0]; - line.w[scan.right] = scan.w[1]; -#endif - -#ifdef IPOL_C0 - line.c[scan.left] = scan.c[0]; - line.c[scan.right] = scan.c[1]; -#endif - -#ifdef IPOL_T0 - line.t[0][scan.left] = scan.t[0][0]; - line.t[0][scan.right] = scan.t[0][1]; -#endif - -#ifdef IPOL_T1 - line.t[1][scan.left] = scan.t[1][0]; - line.t[1][scan.right] = scan.t[1][1]; -#endif - - // render a scanline - scanline_bilinear2 (); - - scan.x[0] += scan.slopeX[0]; - scan.x[1] += scan.slopeX[1]; - -#ifdef IPOL_Z - scan.z[0] += scan.slopeZ[0]; - scan.z[1] += scan.slopeZ[1]; -#endif - -#ifdef IPOL_W - scan.w[0] += scan.slopeW[0]; - scan.w[1] += scan.slopeW[1]; -#endif - -#ifdef IPOL_C0 - scan.c[0] += scan.slopeC[0]; - scan.c[1] += scan.slopeC[1]; -#endif - -#ifdef IPOL_T0 - scan.t[0][0] += scan.slopeT[0][0]; - scan.t[0][1] += scan.slopeT[0][1]; -#endif - -#ifdef IPOL_T1 - scan.t[1][0] += scan.slopeT[1][0]; - scan.t[1][1] += scan.slopeT[1][1]; -#endif - - } - } - - // rasterize lower sub-triangle - //if ( (f32) 0.0 != scan.invDeltaY[2] ) - if ( F32_GREATER_0 ( scan.invDeltaY[2] ) ) - { - // advance to middle point - if ( F32_GREATER_0 ( scan.invDeltaY[1] ) ) - { - temp[0] = b->Pos.y - a->Pos.y; // dy - - scan.x[0] = a->Pos.x + scan.slopeX[0] * temp[0]; -#ifdef IPOL_Z - scan.z[0] = a->Pos.z + scan.slopeZ[0] * temp[0]; -#endif -#ifdef IPOL_W - scan.w[0] = a->Pos.w + scan.slopeW[0] * temp[0]; -#endif -#ifdef IPOL_C0 - scan.c[0] = a->Color[0] + scan.slopeC[0] * temp[0]; -#endif -#ifdef IPOL_T0 - scan.t[0][0] = a->Tex[0] + scan.slopeT[0][0] * temp[0]; -#endif -#ifdef IPOL_T1 - scan.t[1][0] = a->Tex[1] + scan.slopeT[1][0] * temp[0]; -#endif - - } - - // calculate slopes for bottom edge - scan.slopeX[1] = (c->Pos.x - b->Pos.x) * scan.invDeltaY[2]; - scan.x[1] = b->Pos.x; - -#ifdef IPOL_Z - scan.slopeZ[1] = (c->Pos.z - b->Pos.z) * scan.invDeltaY[2]; - scan.z[1] = b->Pos.z; -#endif - -#ifdef IPOL_W - scan.slopeW[1] = (c->Pos.w - b->Pos.w) * scan.invDeltaY[2]; - scan.w[1] = b->Pos.w; -#endif - -#ifdef IPOL_C0 - scan.slopeC[1] = (c->Color[0] - b->Color[0]) * scan.invDeltaY[2]; - scan.c[1] = b->Color[0]; -#endif - -#ifdef IPOL_T0 - scan.slopeT[0][1] = (c->Tex[0] - b->Tex[0]) * scan.invDeltaY[2]; - scan.t[0][1] = b->Tex[0]; -#endif - -#ifdef IPOL_T1 - scan.slopeT[1][1] = (c->Tex[1] - b->Tex[1]) * scan.invDeltaY[2]; - scan.t[1][1] = b->Tex[1]; -#endif - - // apply top-left fill convention, top part - yStart = fill_convention_left( b->Pos.y ); - yEnd = fill_convention_right( c->Pos.y ); - -#ifdef SUBTEXEL - - subPixel = ( (f32) yStart ) - b->Pos.y; - - // correct to pixel center - scan.x[0] += scan.slopeX[0] * subPixel; - scan.x[1] += scan.slopeX[1] * subPixel; - -#ifdef IPOL_Z - scan.z[0] += scan.slopeZ[0] * subPixel; - scan.z[1] += scan.slopeZ[1] * subPixel; -#endif - -#ifdef IPOL_W - scan.w[0] += scan.slopeW[0] * subPixel; - scan.w[1] += scan.slopeW[1] * subPixel; -#endif - -#ifdef IPOL_C0 - scan.c[0] += scan.slopeC[0] * subPixel; - scan.c[1] += scan.slopeC[1] * subPixel; -#endif - -#ifdef IPOL_T0 - scan.t[0][0] += scan.slopeT[0][0] * subPixel; - scan.t[0][1] += scan.slopeT[0][1] * subPixel; -#endif - -#ifdef IPOL_T1 - scan.t[1][0] += scan.slopeT[1][0] * subPixel; - scan.t[1][1] += scan.slopeT[1][1] * subPixel; -#endif - -#endif - - // rasterize the edge scanlines - for( line.y = yStart; line.y <= yEnd; line.y += SOFTWARE_DRIVER_2_STEP_Y) - { - line.x[scan.left] = scan.x[0]; - line.x[scan.right] = scan.x[1]; - -#ifdef IPOL_Z - line.z[scan.left] = scan.z[0]; - line.z[scan.right] = scan.z[1]; -#endif - -#ifdef IPOL_W - line.w[scan.left] = scan.w[0]; - line.w[scan.right] = scan.w[1]; -#endif - -#ifdef IPOL_C0 - line.c[scan.left] = scan.c[0]; - line.c[scan.right] = scan.c[1]; -#endif - -#ifdef IPOL_T0 - line.t[0][scan.left] = scan.t[0][0]; - line.t[0][scan.right] = scan.t[0][1]; -#endif - -#ifdef IPOL_T1 - line.t[1][scan.left] = scan.t[1][0]; - line.t[1][scan.right] = scan.t[1][1]; -#endif - - // render a scanline - scanline_bilinear2 (); - - scan.x[0] += scan.slopeX[0]; - scan.x[1] += scan.slopeX[1]; - -#ifdef IPOL_Z - scan.z[0] += scan.slopeZ[0]; - scan.z[1] += scan.slopeZ[1]; -#endif - -#ifdef IPOL_W - scan.w[0] += scan.slopeW[0]; - scan.w[1] += scan.slopeW[1]; -#endif - -#ifdef IPOL_C0 - scan.c[0] += scan.slopeC[0]; - scan.c[1] += scan.slopeC[1]; -#endif - -#ifdef IPOL_T0 - scan.t[0][0] += scan.slopeT[0][0]; - scan.t[0][1] += scan.slopeT[0][1]; -#endif - -#ifdef IPOL_T1 - scan.t[1][0] += scan.slopeT[1][0]; - scan.t[1][1] += scan.slopeT[1][1]; -#endif - - } - } - -} - - -} // end namespace video -} // end namespace irr - -#endif // _IRR_COMPILE_WITH_BURNINGSVIDEO_ - -namespace irr -{ -namespace video -{ - - - -//! creates a flat triangle renderer -IBurningShader* createTriangleRendererTextureLightMap2_M1(CBurningVideoDriver* driver) -{ - //ETR_TEXTURE_GOURAUD_LIGHTMAP_M1 - #ifdef _IRR_COMPILE_WITH_BURNINGSVIDEO_ - return new CTRTextureLightMap2_M1(driver); - #else - return 0; - #endif // _IRR_COMPILE_WITH_BURNINGSVIDEO_ -} - - -} // end namespace video -} // end namespace irr - - - diff --git a/source/Irrlicht/CTRTextureLightMap2_M2.cpp b/source/Irrlicht/CTRTextureLightMap2_M2.cpp deleted file mode 100644 index 19d051f3..00000000 --- a/source/Irrlicht/CTRTextureLightMap2_M2.cpp +++ /dev/null @@ -1,638 +0,0 @@ -// Copyright (C) 2002-2012 Nikolaus Gebhardt / Thomas Alten -// This file is part of the "Irrlicht Engine". -// For conditions of distribution and use, see copyright notice in irrlicht.h - -#include "IrrCompileConfig.h" -#include "IBurningShader.h" - -#ifdef _IRR_COMPILE_WITH_BURNINGSVIDEO_ - -// compile flag for this file -#undef USE_ZBUFFER -#undef IPOL_Z -#undef CMP_Z -#undef WRITE_Z - -#undef IPOL_W -#undef CMP_W -#undef WRITE_W - -#undef SUBTEXEL -#undef INVERSE_W - -#undef IPOL_C0 -#undef IPOL_T0 -#undef IPOL_T1 - -// define render case -#define SUBTEXEL -#define INVERSE_W - -#define USE_ZBUFFER -#define IPOL_W -#define CMP_W -#define WRITE_W - -//#define IPOL_C0 -#define IPOL_T0 -#define IPOL_T1 - -// apply global override -#ifndef SOFTWARE_DRIVER_2_PERSPECTIVE_CORRECT - #undef INVERSE_W -#endif - -#ifndef SOFTWARE_DRIVER_2_SUBTEXEL - #undef SUBTEXEL -#endif - -#if BURNING_MATERIAL_MAX_COLORS < 1 - #undef IPOL_C0 -#endif - -#if !defined ( SOFTWARE_DRIVER_2_USE_WBUFFER ) && defined ( USE_ZBUFFER ) - #ifndef SOFTWARE_DRIVER_2_PERSPECTIVE_CORRECT - #undef IPOL_W - #endif - #define IPOL_Z - - #ifdef CMP_W - #undef CMP_W - #define CMP_Z - #endif - - #ifdef WRITE_W - #undef WRITE_W - #define WRITE_Z - #endif - -#endif - -namespace irr -{ - -namespace video -{ - -class CTRTextureLightMap2_M2 : public IBurningShader -{ -public: - - //! constructor - CTRTextureLightMap2_M2(CBurningVideoDriver* driver); - - //! draws an indexed triangle list - virtual void drawTriangle(const s4DVertex* burning_restrict a, const s4DVertex* burning_restrict b, const s4DVertex* burning_restrict c) _IRR_OVERRIDE_; - - -private: - void scanline_bilinear2 (); - -}; - -//! constructor -CTRTextureLightMap2_M2::CTRTextureLightMap2_M2(CBurningVideoDriver* driver) -: IBurningShader(driver) -{ - #ifdef _DEBUG - setDebugName("CTRTextureLightMap2_M2"); - #endif -} - -/*! -*/ -REALINLINE void CTRTextureLightMap2_M2::scanline_bilinear2 () -{ - tVideoSample *dst; - fp24 *z; - - s32 xStart; - s32 xEnd; - s32 dx; - s32 i; - - - // apply top-left fill-convention, left - xStart = fill_convention_left( line.x[0] ); - xEnd = fill_convention_right( line.x[1] ); - - dx = xEnd - xStart; - if ( dx < 0 ) - return; - - // slopes - const f32 invDeltaX = fill_step_x( line.x[1] - line.x[0] ); - - // search z-buffer for first not occulled pixel - z = (fp24*) DepthBuffer->lock() + ( line.y * RenderTarget->getDimension().Width ) + xStart; - - // subTexel - const f32 subPixel = ( (f32) xStart ) - line.x[0]; - -#ifdef IPOL_W - const f32 b = (line.w[1] - line.w[0]) * invDeltaX; - f32 a = line.w[0] + ( b * subPixel ); - - i = 0; - - while ( a <= z[i] ) - { - a += b; - - i += 1; - if ( i > dx ) - return; - } - - // lazy setup rest of scanline - - line.w[0] = a; - line.w[1] = b; -#else - const f32 b = (line.z[1] - line.z[0]) * invDeltaX; - f32 a = line.z[0] + ( b * subPixel ); - - i = 0; - - while ( a > z[i] ) - { - a += b; - - i += 1; - if ( i > dx ) - return; - } - - // lazy setup rest of scanline - - line.z[0] = a; - line.z[1] = b; -#endif - SOFTWARE_DRIVER_2_CLIPCHECK; - dst = (tVideoSample*)RenderTarget->getData() + ( line.y * RenderTarget->getDimension().Width ) + xStart; - - a = (f32) i + subPixel; - - line.t[0][1] = (line.t[0][1] - line.t[0][0]) * invDeltaX; - line.t[1][1] = (line.t[1][1] - line.t[1][0]) * invDeltaX; - - line.t[0][0] += line.t[0][1] * a; - line.t[1][0] += line.t[1][1] * a; - - -#ifdef BURNINGVIDEO_RENDERER_FAST - u32 dIndex = ( line.y & 3 ) << 2; - - tFixPoint r0, g0, b0; - tFixPoint r1, g1, b1; - -#else - // - tFixPoint r0, g0, b0; - tFixPoint r1, g1, b1; -#endif - - - for ( ;i <= dx; i++ ) - { -#ifdef IPOL_W - if ( line.w[0] >= z[i] ) - { - z[i] = line.w[0]; -#else - if ( line.z[0] < z[i] ) - { - z[i] = line.z[0]; -#endif - -#ifdef SOFTWARE_DRIVER_2_PERSPECTIVE_CORRECT - f32 inversew = fix_inverse32 ( line.w[0] ); -#else - f32 inversew = FIX_POINT_F32_MUL; -#endif - - - -#ifdef BURNINGVIDEO_RENDERER_FAST - - const tFixPointu d = dithermask [ dIndex | ( i ) & 3 ]; - - getSample_texture ( r0, g0, b0, &IT[0], d + tofix ( line.t[0][0].x,inversew), d + tofix ( line.t[0][0].y,inversew) ); - getSample_texture ( r1, g1, b1, &IT[1], d + tofix ( line.t[1][0].x,inversew), d + tofix ( line.t[1][0].y,inversew) ); -#else - getSample_texture ( r0, g0, b0, &IT[0], tofix ( line.t[0][0].x,inversew), tofix ( line.t[0][0].y,inversew) ); - getSample_texture ( r1, g1, b1, &IT[1], tofix ( line.t[1][0].x,inversew), tofix ( line.t[1][0].y,inversew) ); - -#endif - - dst[i] = fix_to_sample( clampfix_maxcolor ( imulFix_tex2 ( r0, r1 ) ), - clampfix_maxcolor ( imulFix_tex2 ( g0, g1 ) ), - clampfix_maxcolor ( imulFix_tex2 ( b0, b1 ) ) - ); - } - -#ifdef IPOL_W - line.w[0] += line.w[1]; -#else - line.z[0] += line.z[1]; -#endif - line.t[0][0] += line.t[0][1]; - line.t[1][0] += line.t[1][1]; - } - -} - - -void CTRTextureLightMap2_M2::drawTriangle(const s4DVertex* burning_restrict a, const s4DVertex* burning_restrict b, const s4DVertex* burning_restrict c) -{ - // sort on height, y - if ( F32_A_GREATER_B ( a->Pos.y , b->Pos.y ) ) swapVertexPointer(&a, &b); - if ( F32_A_GREATER_B ( b->Pos.y , c->Pos.y ) ) swapVertexPointer(&b, &c); - if ( F32_A_GREATER_B ( a->Pos.y , b->Pos.y ) ) swapVertexPointer(&a, &b); - - const f32 ca = c->Pos.y - a->Pos.y; - const f32 ba = b->Pos.y - a->Pos.y; - const f32 cb = c->Pos.y - b->Pos.y; - // calculate delta y of the edges - scan.invDeltaY[0] = fill_step_y( ca ); - scan.invDeltaY[1] = fill_step_y( ba ); - scan.invDeltaY[2] = fill_step_y( cb ); - - if ( F32_LOWER_EQUAL_0 ( scan.invDeltaY[0] ) ) - return; - - // find if the major edge is left or right aligned - f32 temp[4]; - - temp[0] = a->Pos.x - c->Pos.x; - temp[1] = -ca; - temp[2] = b->Pos.x - a->Pos.x; - temp[3] = ba; - - scan.left = ( temp[0] * temp[3] - temp[1] * temp[2] ) > 0.f ? 0 : 1; - scan.right = 1 - scan.left; - - // calculate slopes for the major edge - scan.slopeX[0] = (c->Pos.x - a->Pos.x) * scan.invDeltaY[0]; - scan.x[0] = a->Pos.x; - -#ifdef IPOL_Z - scan.slopeZ[0] = (c->Pos.z - a->Pos.z) * scan.invDeltaY[0]; - scan.z[0] = a->Pos.z; -#endif - -#ifdef IPOL_W - scan.slopeW[0] = (c->Pos.w - a->Pos.w) * scan.invDeltaY[0]; - scan.w[0] = a->Pos.w; -#endif - -#ifdef IPOL_C0 - scan.slopeC[0] = (c->Color[0] - a->Color[0]) * scan.invDeltaY[0]; - scan.c[0] = a->Color[0]; -#endif - -#ifdef IPOL_T0 - scan.slopeT[0][0] = (c->Tex[0] - a->Tex[0]) * scan.invDeltaY[0]; - scan.t[0][0] = a->Tex[0]; -#endif - -#ifdef IPOL_T1 - scan.slopeT[1][0] = (c->Tex[1] - a->Tex[1]) * scan.invDeltaY[0]; - scan.t[1][0] = a->Tex[1]; -#endif - - // top left fill convention y run - s32 yStart; - s32 yEnd; - -#ifdef SUBTEXEL - f32 subPixel; -#endif - - // rasterize upper sub-triangle - if ( F32_GREATER_0 ( scan.invDeltaY[1] ) ) - { - // calculate slopes for top edge - scan.slopeX[1] = (b->Pos.x - a->Pos.x) * scan.invDeltaY[1]; - scan.x[1] = a->Pos.x; - -#ifdef IPOL_Z - scan.slopeZ[1] = (b->Pos.z - a->Pos.z) * scan.invDeltaY[1]; - scan.z[1] = a->Pos.z; -#endif - -#ifdef IPOL_W - scan.slopeW[1] = (b->Pos.w - a->Pos.w) * scan.invDeltaY[1]; - scan.w[1] = a->Pos.w; -#endif - -#ifdef IPOL_C0 - scan.slopeC[1] = (b->Color[0] - a->Color[0]) * scan.invDeltaY[1]; - scan.c[1] = a->Color[0]; -#endif - -#ifdef IPOL_T0 - scan.slopeT[0][1] = (b->Tex[0] - a->Tex[0]) * scan.invDeltaY[1]; - scan.t[0][1] = a->Tex[0]; -#endif - -#ifdef IPOL_T1 - scan.slopeT[1][1] = (b->Tex[1] - a->Tex[1]) * scan.invDeltaY[1]; - scan.t[1][1] = a->Tex[1]; -#endif - - // apply top-left fill convention, top part - yStart = fill_convention_left( a->Pos.y ); - yEnd = fill_convention_right( b->Pos.y ); - -#ifdef SUBTEXEL - subPixel = ( (f32) yStart ) - a->Pos.y; - - // correct to pixel center - scan.x[0] += scan.slopeX[0] * subPixel; - scan.x[1] += scan.slopeX[1] * subPixel; - -#ifdef IPOL_Z - scan.z[0] += scan.slopeZ[0] * subPixel; - scan.z[1] += scan.slopeZ[1] * subPixel; -#endif - -#ifdef IPOL_W - scan.w[0] += scan.slopeW[0] * subPixel; - scan.w[1] += scan.slopeW[1] * subPixel; -#endif - -#ifdef IPOL_C0 - scan.c[0] += scan.slopeC[0] * subPixel; - scan.c[1] += scan.slopeC[1] * subPixel; -#endif - -#ifdef IPOL_T0 - scan.t[0][0] += scan.slopeT[0][0] * subPixel; - scan.t[0][1] += scan.slopeT[0][1] * subPixel; -#endif - -#ifdef IPOL_T1 - scan.t[1][0] += scan.slopeT[1][0] * subPixel; - scan.t[1][1] += scan.slopeT[1][1] * subPixel; -#endif - -#endif - - // rasterize the edge scanlines - for( line.y = yStart; line.y <= yEnd; line.y += SOFTWARE_DRIVER_2_STEP_Y) - { - line.x[scan.left] = scan.x[0]; - line.x[scan.right] = scan.x[1]; - -#ifdef IPOL_Z - line.z[scan.left] = scan.z[0]; - line.z[scan.right] = scan.z[1]; -#endif - -#ifdef IPOL_W - line.w[scan.left] = scan.w[0]; - line.w[scan.right] = scan.w[1]; -#endif - -#ifdef IPOL_C0 - line.c[scan.left] = scan.c[0]; - line.c[scan.right] = scan.c[1]; -#endif - -#ifdef IPOL_T0 - line.t[0][scan.left] = scan.t[0][0]; - line.t[0][scan.right] = scan.t[0][1]; -#endif - -#ifdef IPOL_T1 - line.t[1][scan.left] = scan.t[1][0]; - line.t[1][scan.right] = scan.t[1][1]; -#endif - - // render a scanline - interlace_scanline scanline_bilinear2 (); - - scan.x[0] += scan.slopeX[0]; - scan.x[1] += scan.slopeX[1]; - -#ifdef IPOL_Z - scan.z[0] += scan.slopeZ[0]; - scan.z[1] += scan.slopeZ[1]; -#endif - -#ifdef IPOL_W - scan.w[0] += scan.slopeW[0]; - scan.w[1] += scan.slopeW[1]; -#endif - -#ifdef IPOL_C0 - scan.c[0] += scan.slopeC[0]; - scan.c[1] += scan.slopeC[1]; -#endif - -#ifdef IPOL_T0 - scan.t[0][0] += scan.slopeT[0][0]; - scan.t[0][1] += scan.slopeT[0][1]; -#endif - -#ifdef IPOL_T1 - scan.t[1][0] += scan.slopeT[1][0]; - scan.t[1][1] += scan.slopeT[1][1]; -#endif - - } - } - - // rasterize lower sub-triangle - //if ( (f32) 0.0 != scan.invDeltaY[2] ) - if ( F32_GREATER_0 ( scan.invDeltaY[2] ) ) - { - // advance to middle point - if ( F32_GREATER_0 ( scan.invDeltaY[1] ) ) - { - temp[0] = b->Pos.y - a->Pos.y; // dy - - scan.x[0] = a->Pos.x + scan.slopeX[0] * temp[0]; -#ifdef IPOL_Z - scan.z[0] = a->Pos.z + scan.slopeZ[0] * temp[0]; -#endif -#ifdef IPOL_W - scan.w[0] = a->Pos.w + scan.slopeW[0] * temp[0]; -#endif -#ifdef IPOL_C0 - scan.c[0] = a->Color[0] + scan.slopeC[0] * temp[0]; -#endif -#ifdef IPOL_T0 - scan.t[0][0] = a->Tex[0] + scan.slopeT[0][0] * temp[0]; -#endif -#ifdef IPOL_T1 - scan.t[1][0] = a->Tex[1] + scan.slopeT[1][0] * temp[0]; -#endif - - } - - // calculate slopes for bottom edge - scan.slopeX[1] = (c->Pos.x - b->Pos.x) * scan.invDeltaY[2]; - scan.x[1] = b->Pos.x; - -#ifdef IPOL_Z - scan.slopeZ[1] = (c->Pos.z - b->Pos.z) * scan.invDeltaY[2]; - scan.z[1] = b->Pos.z; -#endif - -#ifdef IPOL_W - scan.slopeW[1] = (c->Pos.w - b->Pos.w) * scan.invDeltaY[2]; - scan.w[1] = b->Pos.w; -#endif - -#ifdef IPOL_C0 - scan.slopeC[1] = (c->Color[0] - b->Color[0]) * scan.invDeltaY[2]; - scan.c[1] = b->Color[0]; -#endif - -#ifdef IPOL_T0 - scan.slopeT[0][1] = (c->Tex[0] - b->Tex[0]) * scan.invDeltaY[2]; - scan.t[0][1] = b->Tex[0]; -#endif - -#ifdef IPOL_T1 - scan.slopeT[1][1] = (c->Tex[1] - b->Tex[1]) * scan.invDeltaY[2]; - scan.t[1][1] = b->Tex[1]; -#endif - - // apply top-left fill convention, top part - yStart = fill_convention_left( b->Pos.y ); - yEnd = fill_convention_right( c->Pos.y ); - -#ifdef SUBTEXEL - - subPixel = ( (f32) yStart ) - b->Pos.y; - - // correct to pixel center - scan.x[0] += scan.slopeX[0] * subPixel; - scan.x[1] += scan.slopeX[1] * subPixel; - -#ifdef IPOL_Z - scan.z[0] += scan.slopeZ[0] * subPixel; - scan.z[1] += scan.slopeZ[1] * subPixel; -#endif - -#ifdef IPOL_W - scan.w[0] += scan.slopeW[0] * subPixel; - scan.w[1] += scan.slopeW[1] * subPixel; -#endif - -#ifdef IPOL_C0 - scan.c[0] += scan.slopeC[0] * subPixel; - scan.c[1] += scan.slopeC[1] * subPixel; -#endif - -#ifdef IPOL_T0 - scan.t[0][0] += scan.slopeT[0][0] * subPixel; - scan.t[0][1] += scan.slopeT[0][1] * subPixel; -#endif - -#ifdef IPOL_T1 - scan.t[1][0] += scan.slopeT[1][0] * subPixel; - scan.t[1][1] += scan.slopeT[1][1] * subPixel; -#endif - -#endif - - // rasterize the edge scanlines - for( line.y = yStart; line.y <= yEnd; line.y += SOFTWARE_DRIVER_2_STEP_Y) - { - line.x[scan.left] = scan.x[0]; - line.x[scan.right] = scan.x[1]; - -#ifdef IPOL_Z - line.z[scan.left] = scan.z[0]; - line.z[scan.right] = scan.z[1]; -#endif - -#ifdef IPOL_W - line.w[scan.left] = scan.w[0]; - line.w[scan.right] = scan.w[1]; -#endif - -#ifdef IPOL_C0 - line.c[scan.left] = scan.c[0]; - line.c[scan.right] = scan.c[1]; -#endif - -#ifdef IPOL_T0 - line.t[0][scan.left] = scan.t[0][0]; - line.t[0][scan.right] = scan.t[0][1]; -#endif - -#ifdef IPOL_T1 - line.t[1][scan.left] = scan.t[1][0]; - line.t[1][scan.right] = scan.t[1][1]; -#endif - - // render a scanline - interlace_scanline scanline_bilinear2 (); - - scan.x[0] += scan.slopeX[0]; - scan.x[1] += scan.slopeX[1]; - -#ifdef IPOL_Z - scan.z[0] += scan.slopeZ[0]; - scan.z[1] += scan.slopeZ[1]; -#endif - -#ifdef IPOL_W - scan.w[0] += scan.slopeW[0]; - scan.w[1] += scan.slopeW[1]; -#endif - -#ifdef IPOL_C0 - scan.c[0] += scan.slopeC[0]; - scan.c[1] += scan.slopeC[1]; -#endif - -#ifdef IPOL_T0 - scan.t[0][0] += scan.slopeT[0][0]; - scan.t[0][1] += scan.slopeT[0][1]; -#endif - -#ifdef IPOL_T1 - scan.t[1][0] += scan.slopeT[1][0]; - scan.t[1][1] += scan.slopeT[1][1]; -#endif - - } - } - -} - - -} // end namespace video -} // end namespace irr - -#endif // _IRR_COMPILE_WITH_BURNINGSVIDEO_ - -namespace irr -{ -namespace video -{ - - - -//! creates a flat triangle renderer -IBurningShader* createTriangleRendererTextureLightMap2_M2(CBurningVideoDriver* driver) -{ - #ifdef _IRR_COMPILE_WITH_BURNINGSVIDEO_ - return new CTRTextureLightMap2_M2(driver); - #else - return 0; - #endif // _IRR_COMPILE_WITH_BURNINGSVIDEO_ -} - - -} // end namespace video -} // end namespace irr - - - diff --git a/source/Irrlicht/CTRTextureLightMap2_M4.cpp b/source/Irrlicht/CTRTextureLightMap2_M4.cpp deleted file mode 100644 index a78b1e3e..00000000 --- a/source/Irrlicht/CTRTextureLightMap2_M4.cpp +++ /dev/null @@ -1,1154 +0,0 @@ -// Copyright (C) 2002-2012 Nikolaus Gebhardt / Thomas Alten -// This file is part of the "Irrlicht Engine". -// For conditions of distribution and use, see copyright notice in irrlicht.h - -#include "IrrCompileConfig.h" -#include "IBurningShader.h" - -#ifdef _IRR_COMPILE_WITH_BURNINGSVIDEO_ - -// compile flag for this file -#undef USE_ZBUFFER -#undef IPOL_Z -#undef CMP_Z -#undef WRITE_Z - -#undef IPOL_W -#undef CMP_W -#undef WRITE_W - -#undef SUBTEXEL -#undef INVERSE_W - -#undef IPOL_C0 -#undef IPOL_T0 -#undef IPOL_T1 - -// define render case -#define SUBTEXEL -#define INVERSE_W - -#define USE_ZBUFFER -#define IPOL_W -#define CMP_W -#define WRITE_W - -//#define IPOL_C0 -#define IPOL_T0 -#define IPOL_T1 - -// apply global override -#ifndef SOFTWARE_DRIVER_2_PERSPECTIVE_CORRECT - #undef INVERSE_W -#endif - -#ifndef SOFTWARE_DRIVER_2_SUBTEXEL - #undef SUBTEXEL -#endif - -#if BURNING_MATERIAL_MAX_COLORS < 1 - #undef IPOL_C0 -#endif - -#if !defined ( SOFTWARE_DRIVER_2_USE_WBUFFER ) && defined ( USE_ZBUFFER ) - #ifndef SOFTWARE_DRIVER_2_PERSPECTIVE_CORRECT - #undef IPOL_W - #endif - #define IPOL_Z - - #ifdef CMP_W - #undef CMP_W - #define CMP_Z - #endif - - #ifdef WRITE_W - #undef WRITE_W - #define WRITE_Z - #endif - -#endif - -namespace irr -{ - -namespace video -{ - -class CTRTextureLightMap2_M4 : public IBurningShader -{ -public: - - //! constructor - CTRTextureLightMap2_M4(CBurningVideoDriver* driver); - - //! draws an indexed triangle list - virtual void drawTriangle(const s4DVertex* burning_restrict a, const s4DVertex* burning_restrict b, const s4DVertex* burning_restrict c) _IRR_OVERRIDE_; - - -private: - -#if defined(SOFTWARE_DRIVER_2_SCANLINE_MAG_MIN) - void drawTriangle_Min ( const s4DVertex* burning_restrict a,const s4DVertex* burning_restrict b,const s4DVertex* burning_restrict c ); - void drawTriangle_Mag ( const s4DVertex* burning_restrict a,const s4DVertex* burning_restrict b,const s4DVertex* burning_restrict c ); - void scanline_bilinear2_mag (); - void scanline_bilinear2_min (); -#else - #define scanline_bilinear2_mag fragmentShader -#endif - - void fragmentShader(); - -}; - -//! constructor -CTRTextureLightMap2_M4::CTRTextureLightMap2_M4(CBurningVideoDriver* driver) -: IBurningShader(driver) -{ - #ifdef _DEBUG - setDebugName("CTRTextureLightMap2_M4"); - #endif -} - -/*! -*/ -void CTRTextureLightMap2_M4::scanline_bilinear2_mag () -{ - tVideoSample *dst; - fp24 *z; - - // apply top-left fill-convention, left - const s32 xStart = fill_convention_left(line.x[0]); - const s32 xEnd = fill_convention_right(line.x[1]); - s32 dx; - s32 i; - - - dx = xEnd - xStart; - if ( dx < 0 ) - return; - - SOFTWARE_DRIVER_2_CLIPCHECK; - - // slopes - const f32 invDeltaX = fill_step_x( line.x[1] - line.x[0] ); - - // search z-buffer for first not occulled pixel - i = ( line.y * RenderTarget->getDimension().Width ) + xStart; - z = (fp24*) DepthBuffer->lock() + i; - dst = (tVideoSample*)RenderTarget->getData() + i; - - // subTexel - const f32 subPixel = ( (f32) xStart ) - line.x[0]; - -#ifdef IPOL_W - const fp24 b = (line.w[1] - line.w[0]) * invDeltaX; - fp24 a = line.w[0] + ( b * subPixel ); - - i = 0; - - while ( a < z[i] ) - { - a += b; - - i += 1; - if ( i > dx ) - return; - } - - // lazy setup rest of scanline - - line.w[0] = a; - line.w[1] = b; -#else - const f32 b = (line.z[1] - line.z[0]) * invDeltaX; - f32 a = line.z[0] + ( b * subPixel ); - - i = 0; - - while ( a > z[i] ) - { - a += b; - - i += 1; - if ( i > dx ) - return; - } - - // lazy setup rest of scanline - - line.z[0] = a; - line.z[1] = b; -#endif - - a = (f32) i + subPixel; - - line.t[0][1] = (line.t[0][1] - line.t[0][0]) * invDeltaX; - line.t[1][1] = (line.t[1][1] - line.t[1][0]) * invDeltaX; - - line.t[0][0] += line.t[0][1] * a; - line.t[1][0] += line.t[1][1] * a; - - -#ifdef BURNINGVIDEO_RENDERER_FAST - u32 dIndex = ( line.y & 3 ) << 2; - - tFixPoint r0, g0, b0; - tFixPoint r1, g1, b1; - -#else - // - tFixPoint r0, g0, b0; - tFixPoint r1, g1, b1; -#endif - - - for ( ;i <= dx; i += SOFTWARE_DRIVER_2_STEP_X) - { -#ifdef IPOL_W - if ( line.w[0] >= z[i] ) - { - z[i] = line.w[0]; -#else - if ( line.z[0] < z[i] ) - { - z[i] = line.z[0]; -#endif - -#ifdef SOFTWARE_DRIVER_2_PERSPECTIVE_CORRECT - f32 inversew = fix_inverse32 ( line.w[0] ); -#else - f32 inversew = FIX_POINT_F32_MUL; -#endif - - - -#ifdef BURNINGVIDEO_RENDERER_FAST - - const tFixPointu d = dithermask [ dIndex | ( i ) & 3 ]; - - getSample_texture ( r0, g0, b0, &IT[0], d + tofix ( line.t[0][0].x,inversew), d + tofix ( line.t[0][0].y,inversew) ); - getSample_texture ( r1, g1, b1, &IT[1], d + tofix ( line.t[1][0].x,inversew), d + tofix ( line.t[1][0].y,inversew) ); -#else - getSample_texture ( r0, g0, b0, &IT[0], tofix ( line.t[0][0].x,inversew), tofix ( line.t[0][0].y,inversew) ); - getSample_texture ( r1, g1, b1, &IT[1], tofix ( line.t[1][0].x,inversew), tofix ( line.t[1][0].y,inversew) ); - -#endif - dst[i] = fix_to_sample(imulFix_tex4(r0, r1), imulFix_tex4(g0, g1), imulFix_tex4(b0, b1)); - } - -#ifdef IPOL_W - line.w[0] += line.w[1]; -#else - line.z[0] += line.z[1]; -#endif - line.t[0][0] += line.t[0][1]; - line.t[1][0] += line.t[1][1]; - } - -} - - -#if defined (SOFTWARE_DRIVER_2_SCANLINE_MAG_MIN) -void CTRTextureLightMap2_M4::scanline_bilinear2_min () -{ - tVideoSample *dst; - fp24 *z; - - s32 xStart; - s32 xEnd; - s32 dx; - s32 i; - - - // apply top-left fill-convention, left - xStart = fill_convention_left(line.x[0]); - xEnd = fill_convention_right(line.x[1]); - - dx = xEnd - xStart; - if ( dx < 0 ) - return; - - SOFTWARE_DRIVER_2_CLIPCHECK; - - // slopes - const f32 invDeltaX = fill_step_x( line.x[1] - line.x[0] ); - - // search z-buffer for first not occulled pixel - z = (fp24*) DepthBuffer->lock() + ( line.y * RenderTarget->getDimension().Width ) + xStart; - - // subTexel - const f32 subPixel = ( (f32) xStart ) - line.x[0]; - -#ifdef IPOL_W - const f32 b = (line.w[1] - line.w[0]) * invDeltaX; - f32 a = line.w[0] + ( b * subPixel ); - - i = 0; - - while ( a <= z[i] ) - { - a += b; - - i += 1; - if ( i > dx ) - return; - } - - // lazy setup rest of scanline - - line.w[0] = a; - line.w[1] = b; -#else - const f32 b = (line.z[1] - line.z[0]) * invDeltaX; - f32 a = line.z[0] + ( b * subPixel ); - - i = 0; - - while ( a > z[i] ) - { - a += b; - - i += 1; - if ( i > dx ) - return; - } - - // lazy setup rest of scanline - - line.z[0] = a; - line.z[1] = b; -#endif - - dst = (tVideoSample*)RenderTarget->getData() + ( line.y * RenderTarget->getDimension().Width ) + xStart; - - a = (f32) i + subPixel; - - line.t[0][1] = (line.t[0][1] - line.t[0][0]) * invDeltaX; - line.t[1][1] = (line.t[1][1] - line.t[1][0]) * invDeltaX; - - line.t[0][0] += line.t[0][1] * a; - line.t[1][0] += line.t[1][1] * a; - - - tFixPoint r0, g0, b0; - tFixPoint r1, g1, b1; - - - for ( ;i <= dx; i += SOFTWARE_DRIVER_2_STEP_X) - { -#ifdef IPOL_W - if ( line.w[0] >= z[i] ) - { - z[i] = line.w[0]; -#else - if ( line.z[0] < z[i] ) - { - z[i] = line.z[0]; -#endif - -#ifdef SOFTWARE_DRIVER_2_PERSPECTIVE_CORRECT - f32 inversew = fix_inverse32 ( line.w[0] ); -#else - f32 inversew = FIX_POINT_F32_MUL; -#endif - - - getTexel_fix ( r0, g0, b0, &IT[0], tofix ( line.t[0][0].x,inversew), tofix ( line.t[0][0].y,inversew) ); - getTexel_fix ( r1, g1, b1, &IT[1], tofix ( line.t[1][0].x,inversew), tofix ( line.t[1][0].y,inversew) ); - - dst[i] = fix_to_sample(imulFix_tex4(r0, r1), imulFix_tex4(g0, g1), imulFix_tex4(b0, b1)); - } - -#ifdef IPOL_W - line.w[0] += line.w[1]; -#else - line.z[0] += line.z[1]; -#endif - line.t[0][0] += line.t[0][1]; - line.t[1][0] += line.t[1][1]; - } - -} - -void CTRTextureLightMap2_M4::drawTriangle(const s4DVertex* burning_restrict a, const s4DVertex* burning_restrict b, const s4DVertex* burning_restrict c) -{ - if (IT[0].lodFactor < 4) - { - drawTriangle_Mag(a, b, c); - } - else - { - drawTriangle_Min(a, b, c); - } -} - -void CTRTextureLightMap2_M4::drawTriangle_Min ( const s4DVertex* burning_restrict a,const s4DVertex* burning_restrict b,const s4DVertex* burning_restrict c ) -{ - // sort on height, y - if ( F32_A_GREATER_B ( a->Pos.y , b->Pos.y ) ) swapVertexPointer(&a, &b); - if ( F32_A_GREATER_B ( b->Pos.y , c->Pos.y ) ) swapVertexPointer(&b, &c); - if ( F32_A_GREATER_B ( a->Pos.y , b->Pos.y ) ) swapVertexPointer(&a, &b); - - const f32 ca = c->Pos.y - a->Pos.y; - const f32 ba = b->Pos.y - a->Pos.y; - const f32 cb = c->Pos.y - b->Pos.y; - // calculate delta y of the edges - scan.invDeltaY[0] = fill_step_y( ca ); - scan.invDeltaY[1] = fill_step_y( ba ); - scan.invDeltaY[2] = fill_step_y( cb ); - - if ( F32_LOWER_EQUAL_0 ( scan.invDeltaY[0] ) ) - return; - - // find if the major edge is left or right aligned - f32 temp[4]; - - temp[0] = a->Pos.x - c->Pos.x; - temp[1] = -ca; - temp[2] = b->Pos.x - a->Pos.x; - temp[3] = ba; - - scan.left = ( temp[0] * temp[3] - temp[1] * temp[2] ) > 0.f ? 0 : 1; - scan.right = 1 - scan.left; - - // calculate slopes for the major edge - scan.slopeX[0] = (c->Pos.x - a->Pos.x) * scan.invDeltaY[0]; - scan.x[0] = a->Pos.x; - -#ifdef IPOL_Z - scan.slopeZ[0] = (c->Pos.z - a->Pos.z) * scan.invDeltaY[0]; - scan.z[0] = a->Pos.z; -#endif - -#ifdef IPOL_W - scan.slopeW[0] = (c->Pos.w - a->Pos.w) * scan.invDeltaY[0]; - scan.w[0] = a->Pos.w; -#endif - -#ifdef IPOL_C0 - scan.slopeC[0] = (c->Color[0] - a->Color[0]) * scan.invDeltaY[0]; - scan.c[0] = a->Color[0]; -#endif - -#ifdef IPOL_T0 - scan.slopeT[0][0] = (c->Tex[0] - a->Tex[0]) * scan.invDeltaY[0]; - scan.t[0][0] = a->Tex[0]; -#endif - -#ifdef IPOL_T1 - scan.slopeT[1][0] = (c->Tex[1] - a->Tex[1]) * scan.invDeltaY[0]; - scan.t[1][0] = a->Tex[1]; -#endif - - // top left fill convention y run - s32 yStart; - s32 yEnd; - -#ifdef SUBTEXEL - f32 subPixel; -#endif - - // rasterize upper sub-triangle - if ( F32_GREATER_0 ( scan.invDeltaY[1] ) ) - { - // calculate slopes for top edge - scan.slopeX[1] = (b->Pos.x - a->Pos.x) * scan.invDeltaY[1]; - scan.x[1] = a->Pos.x; - -#ifdef IPOL_Z - scan.slopeZ[1] = (b->Pos.z - a->Pos.z) * scan.invDeltaY[1]; - scan.z[1] = a->Pos.z; -#endif - -#ifdef IPOL_W - scan.slopeW[1] = (b->Pos.w - a->Pos.w) * scan.invDeltaY[1]; - scan.w[1] = a->Pos.w; -#endif - -#ifdef IPOL_C0 - scan.slopeC[1] = (b->Color[0] - a->Color[0]) * scan.invDeltaY[1]; - scan.c[1] = a->Color[0]; -#endif - -#ifdef IPOL_T0 - scan.slopeT[0][1] = (b->Tex[0] - a->Tex[0]) * scan.invDeltaY[1]; - scan.t[0][1] = a->Tex[0]; -#endif - -#ifdef IPOL_T1 - scan.slopeT[1][1] = (b->Tex[1] - a->Tex[1]) * scan.invDeltaY[1]; - scan.t[1][1] = a->Tex[1]; -#endif - - // apply top-left fill convention, top part - yStart = fill_convention_left( a->Pos.y ); - yEnd = fill_convention_right( b->Pos.y ); - -#ifdef SUBTEXEL - subPixel = ( (f32) yStart ) - a->Pos.y; - - // correct to pixel center - scan.x[0] += scan.slopeX[0] * subPixel; - scan.x[1] += scan.slopeX[1] * subPixel; - -#ifdef IPOL_Z - scan.z[0] += scan.slopeZ[0] * subPixel; - scan.z[1] += scan.slopeZ[1] * subPixel; -#endif - -#ifdef IPOL_W - scan.w[0] += scan.slopeW[0] * subPixel; - scan.w[1] += scan.slopeW[1] * subPixel; -#endif - -#ifdef IPOL_C0 - scan.c[0] += scan.slopeC[0] * subPixel; - scan.c[1] += scan.slopeC[1] * subPixel; -#endif - -#ifdef IPOL_T0 - scan.t[0][0] += scan.slopeT[0][0] * subPixel; - scan.t[0][1] += scan.slopeT[0][1] * subPixel; -#endif - -#ifdef IPOL_T1 - scan.t[1][0] += scan.slopeT[1][0] * subPixel; - scan.t[1][1] += scan.slopeT[1][1] * subPixel; -#endif - -#endif - - // rasterize the edge scanlines - for( line.y = yStart; line.y <= yEnd; line.y += SOFTWARE_DRIVER_2_STEP_Y) - { - line.x[scan.left] = scan.x[0]; - line.x[scan.right] = scan.x[1]; - -#ifdef IPOL_Z - line.z[scan.left] = scan.z[0]; - line.z[scan.right] = scan.z[1]; -#endif - -#ifdef IPOL_W - line.w[scan.left] = scan.w[0]; - line.w[scan.right] = scan.w[1]; -#endif - -#ifdef IPOL_C0 - line.c[scan.left] = scan.c[0]; - line.c[scan.right] = scan.c[1]; -#endif - -#ifdef IPOL_T0 - line.t[0][scan.left] = scan.t[0][0]; - line.t[0][scan.right] = scan.t[0][1]; -#endif - -#ifdef IPOL_T1 - line.t[1][scan.left] = scan.t[1][0]; - line.t[1][scan.right] = scan.t[1][1]; -#endif - - // render a scanline - interlace_scanline scanline_bilinear2_min (); - - scan.x[0] += scan.slopeX[0]; - scan.x[1] += scan.slopeX[1]; - -#ifdef IPOL_Z - scan.z[0] += scan.slopeZ[0]; - scan.z[1] += scan.slopeZ[1]; -#endif - -#ifdef IPOL_W - scan.w[0] += scan.slopeW[0]; - scan.w[1] += scan.slopeW[1]; -#endif - -#ifdef IPOL_C0 - scan.c[0] += scan.slopeC[0]; - scan.c[1] += scan.slopeC[1]; -#endif - -#ifdef IPOL_T0 - scan.t[0][0] += scan.slopeT[0][0]; - scan.t[0][1] += scan.slopeT[0][1]; -#endif - -#ifdef IPOL_T1 - scan.t[1][0] += scan.slopeT[1][0]; - scan.t[1][1] += scan.slopeT[1][1]; -#endif - - } - } - - // rasterize lower sub-triangle - //if ( (f32) 0.0 != scan.invDeltaY[2] ) - if ( F32_GREATER_0 ( scan.invDeltaY[2] ) ) - { - // advance to middle point - if ( F32_GREATER_0 ( scan.invDeltaY[1] ) ) - { - temp[0] = b->Pos.y - a->Pos.y; // dy - - scan.x[0] = a->Pos.x + scan.slopeX[0] * temp[0]; -#ifdef IPOL_Z - scan.z[0] = a->Pos.z + scan.slopeZ[0] * temp[0]; -#endif -#ifdef IPOL_W - scan.w[0] = a->Pos.w + scan.slopeW[0] * temp[0]; -#endif -#ifdef IPOL_C0 - scan.c[0] = a->Color[0] + scan.slopeC[0] * temp[0]; -#endif -#ifdef IPOL_T0 - scan.t[0][0] = a->Tex[0] + scan.slopeT[0][0] * temp[0]; -#endif -#ifdef IPOL_T1 - scan.t[1][0] = a->Tex[1] + scan.slopeT[1][0] * temp[0]; -#endif - - } - - // calculate slopes for bottom edge - scan.slopeX[1] = (c->Pos.x - b->Pos.x) * scan.invDeltaY[2]; - scan.x[1] = b->Pos.x; - -#ifdef IPOL_Z - scan.slopeZ[1] = (c->Pos.z - b->Pos.z) * scan.invDeltaY[2]; - scan.z[1] = b->Pos.z; -#endif - -#ifdef IPOL_W - scan.slopeW[1] = (c->Pos.w - b->Pos.w) * scan.invDeltaY[2]; - scan.w[1] = b->Pos.w; -#endif - -#ifdef IPOL_C0 - scan.slopeC[1] = (c->Color[0] - b->Color[0]) * scan.invDeltaY[2]; - scan.c[1] = b->Color[0]; -#endif - -#ifdef IPOL_T0 - scan.slopeT[0][1] = (c->Tex[0] - b->Tex[0]) * scan.invDeltaY[2]; - scan.t[0][1] = b->Tex[0]; -#endif - -#ifdef IPOL_T1 - scan.slopeT[1][1] = (c->Tex[1] - b->Tex[1]) * scan.invDeltaY[2]; - scan.t[1][1] = b->Tex[1]; -#endif - - // apply top-left fill convention, top part - yStart = fill_convention_left( b->Pos.y ); - yEnd = fill_convention_right( c->Pos.y ); - -#ifdef SUBTEXEL - - subPixel = ( (f32) yStart ) - b->Pos.y; - - // correct to pixel center - scan.x[0] += scan.slopeX[0] * subPixel; - scan.x[1] += scan.slopeX[1] * subPixel; - -#ifdef IPOL_Z - scan.z[0] += scan.slopeZ[0] * subPixel; - scan.z[1] += scan.slopeZ[1] * subPixel; -#endif - -#ifdef IPOL_W - scan.w[0] += scan.slopeW[0] * subPixel; - scan.w[1] += scan.slopeW[1] * subPixel; -#endif - -#ifdef IPOL_C0 - scan.c[0] += scan.slopeC[0] * subPixel; - scan.c[1] += scan.slopeC[1] * subPixel; -#endif - -#ifdef IPOL_T0 - scan.t[0][0] += scan.slopeT[0][0] * subPixel; - scan.t[0][1] += scan.slopeT[0][1] * subPixel; -#endif - -#ifdef IPOL_T1 - scan.t[1][0] += scan.slopeT[1][0] * subPixel; - scan.t[1][1] += scan.slopeT[1][1] * subPixel; -#endif - -#endif - - // rasterize the edge scanlines - for( line.y = yStart; line.y <= yEnd; line.y += SOFTWARE_DRIVER_2_STEP_Y) - { - line.x[scan.left] = scan.x[0]; - line.x[scan.right] = scan.x[1]; - -#ifdef IPOL_Z - line.z[scan.left] = scan.z[0]; - line.z[scan.right] = scan.z[1]; -#endif - -#ifdef IPOL_W - line.w[scan.left] = scan.w[0]; - line.w[scan.right] = scan.w[1]; -#endif - -#ifdef IPOL_C0 - line.c[scan.left] = scan.c[0]; - line.c[scan.right] = scan.c[1]; -#endif - -#ifdef IPOL_T0 - line.t[0][scan.left] = scan.t[0][0]; - line.t[0][scan.right] = scan.t[0][1]; -#endif - -#ifdef IPOL_T1 - line.t[1][scan.left] = scan.t[1][0]; - line.t[1][scan.right] = scan.t[1][1]; -#endif - - // render a scanline - interlace_scanline scanline_bilinear2_min (); - - scan.x[0] += scan.slopeX[0]; - scan.x[1] += scan.slopeX[1]; - -#ifdef IPOL_Z - scan.z[0] += scan.slopeZ[0]; - scan.z[1] += scan.slopeZ[1]; -#endif - -#ifdef IPOL_W - scan.w[0] += scan.slopeW[0]; - scan.w[1] += scan.slopeW[1]; -#endif - -#ifdef IPOL_C0 - scan.c[0] += scan.slopeC[0]; - scan.c[1] += scan.slopeC[1]; -#endif - -#ifdef IPOL_T0 - scan.t[0][0] += scan.slopeT[0][0]; - scan.t[0][1] += scan.slopeT[0][1]; -#endif - -#ifdef IPOL_T1 - scan.t[1][0] += scan.slopeT[1][0]; - scan.t[1][1] += scan.slopeT[1][1]; -#endif - - } - } - -} - -void CTRTextureLightMap2_M4::drawTriangle_Mag ( const s4DVertex* burning_restrict a,const s4DVertex* burning_restrict b,const s4DVertex* burning_restrict c ) - -#else //#if defined (SOFTWARE_DRIVER_2_SCANLINE_MAG_MIN) - -void CTRTextureLightMap2_M4::drawTriangle(const s4DVertex* burning_restrict a, const s4DVertex* burning_restrict b, const s4DVertex* burning_restrict c) - -#endif - -{ - - // sort on height, y - if ( F32_A_GREATER_B ( a->Pos.y , b->Pos.y ) ) swapVertexPointer(&a, &b); - if ( F32_A_GREATER_B ( b->Pos.y , c->Pos.y ) ) swapVertexPointer(&b, &c); - if ( F32_A_GREATER_B ( a->Pos.y , b->Pos.y ) ) swapVertexPointer(&a, &b); - - const f32 ca = c->Pos.y - a->Pos.y; - const f32 ba = b->Pos.y - a->Pos.y; - const f32 cb = c->Pos.y - b->Pos.y; - - if ( F32_LOWER_EQUAL_0 ( ca ) ) - return; - - // calculate delta y of the edges - scan.invDeltaY[0] = fill_step_y( ca ); - scan.invDeltaY[1] = fill_step_y( ba ); - scan.invDeltaY[2] = fill_step_y( cb ); - - //if ( F32_LOWER_EQUAL_0 ( scan.invDeltaY[0] ) ) - // return; - - // find if the major edge is left or right aligned - f32 temp[4]; - - temp[0] = a->Pos.x - c->Pos.x; - temp[1] = -ca; - temp[2] = b->Pos.x - a->Pos.x; - temp[3] = ba; - - scan.left = ( temp[0] * temp[3] - temp[1] * temp[2] ) > 0.f ? 0 : 1; - scan.right = 1 - scan.left; - - // calculate slopes for the major edge - scan.slopeX[0] = (c->Pos.x - a->Pos.x) * scan.invDeltaY[0]; - scan.x[0] = a->Pos.x; - -#ifdef IPOL_Z - scan.slopeZ[0] = (c->Pos.z - a->Pos.z) * scan.invDeltaY[0]; - scan.z[0] = a->Pos.z; -#endif - -#ifdef IPOL_W - scan.slopeW[0] = (c->Pos.w - a->Pos.w) * scan.invDeltaY[0]; - scan.w[0] = a->Pos.w; -#endif - -#ifdef IPOL_C0 - scan.slopeC[0] = (c->Color[0] - a->Color[0]) * scan.invDeltaY[0]; - scan.c[0] = a->Color[0]; -#endif - -#ifdef IPOL_T0 - scan.slopeT[0][0] = (c->Tex[0] - a->Tex[0]) * scan.invDeltaY[0]; - scan.t[0][0] = a->Tex[0]; -#endif - -#ifdef IPOL_T1 - scan.slopeT[1][0] = (c->Tex[1] - a->Tex[1]) * scan.invDeltaY[0]; - scan.t[1][0] = a->Tex[1]; -#endif - - // top left fill convention y run - s32 yStart; - s32 yEnd; - -#ifdef SUBTEXEL - f32 subPixel; -#endif - - - // rasterize upper sub-triangle - if ( F32_GREATER_0 ( scan.invDeltaY[1] ) ) - { - // calculate slopes for top edge - scan.slopeX[1] = (b->Pos.x - a->Pos.x) * scan.invDeltaY[1]; - scan.x[1] = a->Pos.x; - -#ifdef IPOL_Z - scan.slopeZ[1] = (b->Pos.z - a->Pos.z) * scan.invDeltaY[1]; - scan.z[1] = a->Pos.z; -#endif - -#ifdef IPOL_W - scan.slopeW[1] = (b->Pos.w - a->Pos.w) * scan.invDeltaY[1]; - scan.w[1] = a->Pos.w; -#endif - -#ifdef IPOL_C0 - scan.slopeC[1] = (b->Color[0] - a->Color[0]) * scan.invDeltaY[1]; - scan.c[1] = a->Color[0]; -#endif - -#ifdef IPOL_T0 - scan.slopeT[0][1] = (b->Tex[0] - a->Tex[0]) * scan.invDeltaY[1]; - scan.t[0][1] = a->Tex[0]; -#endif - -#ifdef IPOL_T1 - scan.slopeT[1][1] = (b->Tex[1] - a->Tex[1]) * scan.invDeltaY[1]; - scan.t[1][1] = a->Tex[1]; -#endif - - // apply top-left fill convention, top part - yStart = fill_convention_left( a->Pos.y ); - yEnd = fill_convention_right( b->Pos.y ); - -#ifdef SUBTEXEL - subPixel = ( (f32) yStart ) - a->Pos.y; - - // correct to pixel center - scan.x[0] += scan.slopeX[0] * subPixel; - scan.x[1] += scan.slopeX[1] * subPixel; - -#ifdef IPOL_Z - scan.z[0] += scan.slopeZ[0] * subPixel; - scan.z[1] += scan.slopeZ[1] * subPixel; -#endif - -#ifdef IPOL_W - scan.w[0] += scan.slopeW[0] * subPixel; - scan.w[1] += scan.slopeW[1] * subPixel; -#endif - -#ifdef IPOL_C0 - scan.c[0] += scan.slopeC[0] * subPixel; - scan.c[1] += scan.slopeC[1] * subPixel; -#endif - -#ifdef IPOL_T0 - scan.t[0][0] += scan.slopeT[0][0] * subPixel; - scan.t[0][1] += scan.slopeT[0][1] * subPixel; -#endif - -#ifdef IPOL_T1 - scan.t[1][0] += scan.slopeT[1][0] * subPixel; - scan.t[1][1] += scan.slopeT[1][1] * subPixel; -#endif - -#endif - - // rasterize the edge scanlines - for( line.y = yStart; line.y <= yEnd; line.y += SOFTWARE_DRIVER_2_STEP_Y) - { - line.x[scan.left] = scan.x[0]; - line.x[scan.right] = scan.x[1]; - -#ifdef IPOL_Z - line.z[scan.left] = scan.z[0]; - line.z[scan.right] = scan.z[1]; -#endif - -#ifdef IPOL_W - line.w[scan.left] = scan.w[0]; - line.w[scan.right] = scan.w[1]; -#endif - -#ifdef IPOL_C0 - line.c[scan.left] = scan.c[0]; - line.c[scan.right] = scan.c[1]; -#endif - -#ifdef IPOL_T0 - line.t[0][scan.left] = scan.t[0][0]; - line.t[0][scan.right] = scan.t[0][1]; -#endif - -#ifdef IPOL_T1 - line.t[1][scan.left] = scan.t[1][0]; - line.t[1][scan.right] = scan.t[1][1]; -#endif - - // render a scanline - interlace_scanline scanline_bilinear2_mag (); - - scan.x[0] += scan.slopeX[0]; - scan.x[1] += scan.slopeX[1]; - -#ifdef IPOL_Z - scan.z[0] += scan.slopeZ[0]; - scan.z[1] += scan.slopeZ[1]; -#endif - -#ifdef IPOL_W - scan.w[0] += scan.slopeW[0]; - scan.w[1] += scan.slopeW[1]; -#endif - -#ifdef IPOL_C0 - scan.c[0] += scan.slopeC[0]; - scan.c[1] += scan.slopeC[1]; -#endif - -#ifdef IPOL_T0 - scan.t[0][0] += scan.slopeT[0][0]; - scan.t[0][1] += scan.slopeT[0][1]; -#endif - -#ifdef IPOL_T1 - scan.t[1][0] += scan.slopeT[1][0]; - scan.t[1][1] += scan.slopeT[1][1]; -#endif - - } - } - - // rasterize lower sub-triangle - //if ( (f32) 0.0 != scan.invDeltaY[2] ) - if ( F32_GREATER_0 ( scan.invDeltaY[2] ) ) - { - // advance to middle point - if ( F32_GREATER_0 ( scan.invDeltaY[1] ) ) - { - temp[0] = b->Pos.y - a->Pos.y; // dy - - scan.x[0] = a->Pos.x + scan.slopeX[0] * temp[0]; -#ifdef IPOL_Z - scan.z[0] = a->Pos.z + scan.slopeZ[0] * temp[0]; -#endif -#ifdef IPOL_W - scan.w[0] = a->Pos.w + scan.slopeW[0] * temp[0]; -#endif -#ifdef IPOL_C0 - scan.c[0] = a->Color[0] + scan.slopeC[0] * temp[0]; -#endif -#ifdef IPOL_T0 - scan.t[0][0] = a->Tex[0] + scan.slopeT[0][0] * temp[0]; -#endif -#ifdef IPOL_T1 - scan.t[1][0] = a->Tex[1] + scan.slopeT[1][0] * temp[0]; -#endif - - } - - // calculate slopes for bottom edge - scan.slopeX[1] = (c->Pos.x - b->Pos.x) * scan.invDeltaY[2]; - scan.x[1] = b->Pos.x; - -#ifdef IPOL_Z - scan.slopeZ[1] = (c->Pos.z - b->Pos.z) * scan.invDeltaY[2]; - scan.z[1] = b->Pos.z; -#endif - -#ifdef IPOL_W - scan.slopeW[1] = (c->Pos.w - b->Pos.w) * scan.invDeltaY[2]; - scan.w[1] = b->Pos.w; -#endif - -#ifdef IPOL_C0 - scan.slopeC[1] = (c->Color[0] - b->Color[0]) * scan.invDeltaY[2]; - scan.c[1] = b->Color[0]; -#endif - -#ifdef IPOL_T0 - scan.slopeT[0][1] = (c->Tex[0] - b->Tex[0]) * scan.invDeltaY[2]; - scan.t[0][1] = b->Tex[0]; -#endif - -#ifdef IPOL_T1 - scan.slopeT[1][1] = (c->Tex[1] - b->Tex[1]) * scan.invDeltaY[2]; - scan.t[1][1] = b->Tex[1]; -#endif - - // apply top-left fill convention, top part - yStart = fill_convention_left( b->Pos.y ); - yEnd = fill_convention_right( c->Pos.y ); - -#ifdef SUBTEXEL - - subPixel = ( (f32) yStart ) - b->Pos.y; - - // correct to pixel center - scan.x[0] += scan.slopeX[0] * subPixel; - scan.x[1] += scan.slopeX[1] * subPixel; - -#ifdef IPOL_Z - scan.z[0] += scan.slopeZ[0] * subPixel; - scan.z[1] += scan.slopeZ[1] * subPixel; -#endif - -#ifdef IPOL_W - scan.w[0] += scan.slopeW[0] * subPixel; - scan.w[1] += scan.slopeW[1] * subPixel; -#endif - -#ifdef IPOL_C0 - scan.c[0] += scan.slopeC[0] * subPixel; - scan.c[1] += scan.slopeC[1] * subPixel; -#endif - -#ifdef IPOL_T0 - scan.t[0][0] += scan.slopeT[0][0] * subPixel; - scan.t[0][1] += scan.slopeT[0][1] * subPixel; -#endif - -#ifdef IPOL_T1 - scan.t[1][0] += scan.slopeT[1][0] * subPixel; - scan.t[1][1] += scan.slopeT[1][1] * subPixel; -#endif - -#endif - - // rasterize the edge scanlines - for( line.y = yStart; line.y <= yEnd; line.y += SOFTWARE_DRIVER_2_STEP_Y) - { - line.x[scan.left] = scan.x[0]; - line.x[scan.right] = scan.x[1]; - -#ifdef IPOL_Z - line.z[scan.left] = scan.z[0]; - line.z[scan.right] = scan.z[1]; -#endif - -#ifdef IPOL_W - line.w[scan.left] = scan.w[0]; - line.w[scan.right] = scan.w[1]; -#endif - -#ifdef IPOL_C0 - line.c[scan.left] = scan.c[0]; - line.c[scan.right] = scan.c[1]; -#endif - -#ifdef IPOL_T0 - line.t[0][scan.left] = scan.t[0][0]; - line.t[0][scan.right] = scan.t[0][1]; -#endif - -#ifdef IPOL_T1 - line.t[1][scan.left] = scan.t[1][0]; - line.t[1][scan.right] = scan.t[1][1]; -#endif - - // render a scanline - interlace_scanline scanline_bilinear2_mag (); - - scan.x[0] += scan.slopeX[0]; - scan.x[1] += scan.slopeX[1]; - -#ifdef IPOL_Z - scan.z[0] += scan.slopeZ[0]; - scan.z[1] += scan.slopeZ[1]; -#endif - -#ifdef IPOL_W - scan.w[0] += scan.slopeW[0]; - scan.w[1] += scan.slopeW[1]; -#endif - -#ifdef IPOL_C0 - scan.c[0] += scan.slopeC[0]; - scan.c[1] += scan.slopeC[1]; -#endif - -#ifdef IPOL_T0 - scan.t[0][0] += scan.slopeT[0][0]; - scan.t[0][1] += scan.slopeT[0][1]; -#endif - -#ifdef IPOL_T1 - scan.t[1][0] += scan.slopeT[1][0]; - scan.t[1][1] += scan.slopeT[1][1]; -#endif - - } - } - -} - -#undef scanline_bilinear2_mag - -} // end namespace video -} // end namespace irr - -#endif // _IRR_COMPILE_WITH_BURNINGSVIDEO_ - -namespace irr -{ -namespace video -{ - - -//! creates a flat triangle renderer -IBurningShader* createTriangleRendererTextureLightMap2_M4(CBurningVideoDriver* driver) -{ - #ifdef _IRR_COMPILE_WITH_BURNINGSVIDEO_ - return new CTRTextureLightMap2_M4(driver); - #else - return 0; - #endif // _IRR_COMPILE_WITH_BURNINGSVIDEO_ -} - - -} // end namespace video -} // end namespace irr - - - diff --git a/source/Irrlicht/CTRTextureLightMapGouraud2_M4.cpp b/source/Irrlicht/CTRTextureLightMapGouraud2_M4.cpp deleted file mode 100644 index 08f5285d..00000000 --- a/source/Irrlicht/CTRTextureLightMapGouraud2_M4.cpp +++ /dev/null @@ -1,669 +0,0 @@ -// Copyright (C) 2002-2012 Nikolaus Gebhardt / Thomas Alten -// This file is part of the "Irrlicht Engine". -// For conditions of distribution and use, see copyright notice in irrlicht.h - -#include "IrrCompileConfig.h" -#include "IBurningShader.h" - -#ifdef _IRR_COMPILE_WITH_BURNINGSVIDEO_ - -// compile flag for this file -#undef USE_ZBUFFER -#undef IPOL_Z -#undef CMP_Z -#undef WRITE_Z - -#undef IPOL_W -#undef CMP_W -#undef WRITE_W - -#undef SUBTEXEL -#undef INVERSE_W - -#undef IPOL_C0 -#undef IPOL_T0 -#undef IPOL_T1 - -// define render case -#define SUBTEXEL -#define INVERSE_W - -#define USE_ZBUFFER -#define IPOL_W -#define CMP_W -#define WRITE_W - -#define IPOL_C0 -#define IPOL_T0 -#define IPOL_T1 - -// apply global override -#ifndef SOFTWARE_DRIVER_2_PERSPECTIVE_CORRECT - #undef INVERSE_W -#endif - -#ifndef SOFTWARE_DRIVER_2_SUBTEXEL - #undef SUBTEXEL -#endif - -#if BURNING_MATERIAL_MAX_COLORS < 1 - #undef IPOL_C0 -#endif - -#if !defined ( SOFTWARE_DRIVER_2_USE_WBUFFER ) && defined ( USE_ZBUFFER ) - #ifndef SOFTWARE_DRIVER_2_PERSPECTIVE_CORRECT - #undef IPOL_W - #endif - #define IPOL_Z - - #ifdef CMP_W - #undef CMP_W - #define CMP_Z - #endif - - #ifdef WRITE_W - #undef WRITE_W - #define WRITE_Z - #endif - -#endif - -namespace irr -{ - -namespace video -{ - -class CTRGTextureLightMap2_M4 : public IBurningShader -{ -public: - - //! constructor - CTRGTextureLightMap2_M4(CBurningVideoDriver* driver); - - //! draws an indexed triangle list - virtual void drawTriangle(const s4DVertex* burning_restrict a, const s4DVertex* burning_restrict b, const s4DVertex* burning_restrict c) _IRR_OVERRIDE_; - - -private: - void fragmentShader(); - -}; - -//! constructor -CTRGTextureLightMap2_M4::CTRGTextureLightMap2_M4(CBurningVideoDriver* driver) -: IBurningShader(driver) -{ - #ifdef _DEBUG - setDebugName("CTRGTextureLightMap2_M4"); - #endif -} - - - -/*! -*/ -void CTRGTextureLightMap2_M4::fragmentShader() -{ - tVideoSample *dst; - -#ifdef USE_ZBUFFER - fp24 *z; -#endif - - s32 xStart; - s32 xEnd; - s32 dx; - - -#ifdef SUBTEXEL - f32 subPixel; -#endif - -#ifdef IPOL_Z - f32 slopeZ; -#endif -#ifdef IPOL_W - fp24 slopeW; -#endif -#ifdef IPOL_C0 - sVec4 slopeC; -#endif -#ifdef IPOL_T0 - sVec2 slopeT[BURNING_MATERIAL_MAX_TEXTURES]; -#endif - - // apply top-left fill-convention, left - xStart = fill_convention_left( line.x[0] ); - xEnd = fill_convention_right( line.x[1] ); - - dx = xEnd - xStart; - - if ( dx < 0 ) - return; - - // slopes - const f32 invDeltaX = fill_step_x( line.x[1] - line.x[0] ); - -#ifdef IPOL_Z - slopeZ = (line.z[1] - line.z[0]) * invDeltaX; -#endif -#ifdef IPOL_W - slopeW = (line.w[1] - line.w[0]) * invDeltaX; -#endif -#ifdef IPOL_C0 - slopeC = (line.c[0][1] - line.c[0][0]) * invDeltaX; -#endif -#ifdef IPOL_T0 - slopeT[0] = (line.t[0][1] - line.t[0][0]) * invDeltaX; -#endif -#ifdef IPOL_T1 - slopeT[1] = (line.t[1][1] - line.t[1][0]) * invDeltaX; -#endif - -#ifdef SUBTEXEL - subPixel = ( (f32) xStart ) - line.x[0]; -#ifdef IPOL_Z - line.z[0] += slopeZ * subPixel; -#endif -#ifdef IPOL_W - line.w[0] += slopeW * subPixel; -#endif -#ifdef IPOL_C0 - line.c[0][0] += slopeC * subPixel; -#endif -#ifdef IPOL_T0 - line.t[0][0] += slopeT[0] * subPixel; -#endif -#ifdef IPOL_T1 - line.t[1][0] += slopeT[1] * subPixel; -#endif -#endif - - SOFTWARE_DRIVER_2_CLIPCHECK; - dst = (tVideoSample*)RenderTarget->getData() + ( line.y * RenderTarget->getDimension().Width ) + xStart; - -#ifdef USE_ZBUFFER - z = (fp24*) DepthBuffer->lock() + ( line.y * RenderTarget->getDimension().Width ) + xStart; -#endif - - - f32 inversew = FIX_POINT_F32_MUL; - - tFixPoint tx0, tx1; - tFixPoint ty0, ty1; - - tFixPoint r0, g0, b0; - tFixPoint r1, g1, b1; - tFixPoint r2, g2, b2; - -#ifdef IPOL_C0 - tFixPoint r3, g3, b3; -#endif - - for ( s32 i = 0; i <= dx; i += SOFTWARE_DRIVER_2_STEP_X ) - { -#ifdef CMP_Z - if ( line.z[0] < z[i] ) -#endif -#ifdef CMP_W - if ( line.w[0] >= z[i] ) -#endif - { -#ifdef INVERSE_W - inversew = fix_inverse32 ( line.w[0] ); -#endif - tx0 = tofix ( line.t[0][0].x,inversew); - ty0 = tofix ( line.t[0][0].y,inversew); - tx1 = tofix ( line.t[1][0].x,inversew); - ty1 = tofix ( line.t[1][0].y,inversew); - -#ifdef IPOL_C0 - r3 = tofix ( line.c[0][0].y ,inversew ); - g3 = tofix ( line.c[0][0].z ,inversew ); - b3 = tofix ( line.c[0][0].w ,inversew ); -#endif - - getSample_texture ( r0, g0, b0, &IT[0], tx0, ty0 ); - getSample_texture ( r1, g1, b1, &IT[1], tx1, ty1 ); - -#ifdef IPOL_C0 - r2 = imulFix_simple( r0, r3 ); - g2 = imulFix_simple( g0, g3 ); - b2 = imulFix_simple( b0, b3 ); - - r2 = imulFix_tex4 ( r2, r1 ); - g2 = imulFix_tex4 ( g2, g1 ); - b2 = imulFix_tex4 ( b2, b1 ); - -#else - r2 = imulFix_tex4 ( r0, r1 ); - g2 = imulFix_tex4 ( g0, g1 ); - b2 = imulFix_tex4 ( b0, b1 ); -#endif - - - dst[i] = fix_to_sample( r2, g2, b2 ); - -#ifdef WRITE_Z - z[i] = line.z[0]; -#endif -#ifdef WRITE_W - z[i] = line.w[0]; -#endif - } - -#ifdef IPOL_Z - line.z[0] += slopeZ; -#endif -#ifdef IPOL_W - line.w[0] += slopeW; -#endif -#ifdef IPOL_C0 - line.c[0][0] += slopeC; -#endif -#ifdef IPOL_T0 - line.t[0][0] += slopeT[0]; -#endif -#ifdef IPOL_T1 - line.t[1][0] += slopeT[1]; -#endif - } - -} - -void CTRGTextureLightMap2_M4::drawTriangle(const s4DVertex* burning_restrict a, const s4DVertex* burning_restrict b, const s4DVertex* burning_restrict c) -{ - // sort on height, y - if ( F32_A_GREATER_B ( a->Pos.y , b->Pos.y ) ) swapVertexPointer(&a, &b); - if ( F32_A_GREATER_B ( b->Pos.y , c->Pos.y ) ) swapVertexPointer(&b, &c); - if ( F32_A_GREATER_B ( a->Pos.y , b->Pos.y ) ) swapVertexPointer(&a, &b); - - const f32 ca = c->Pos.y - a->Pos.y; - const f32 ba = b->Pos.y - a->Pos.y; - const f32 cb = c->Pos.y - b->Pos.y; - // calculate delta y of the edges - scan.invDeltaY[0] = fill_step_y( ca ); - scan.invDeltaY[1] = fill_step_y( ba ); - scan.invDeltaY[2] = fill_step_y( cb ); - - if ( F32_LOWER_0 ( scan.invDeltaY[0] ) ) - return; - - // find if the major edge is left or right aligned - f32 temp[4]; - - temp[0] = a->Pos.x - c->Pos.x; - temp[1] = -ca; - temp[2] = b->Pos.x - a->Pos.x; - temp[3] = ba; - - scan.left = ( temp[0] * temp[3] - temp[1] * temp[2] ) > 0.f ? 0 : 1; - scan.right = 1 - scan.left; - - // calculate slopes for the major edge - scan.slopeX[0] = (c->Pos.x - a->Pos.x) * scan.invDeltaY[0]; - scan.x[0] = a->Pos.x; - -#ifdef IPOL_Z - scan.slopeZ[0] = (c->Pos.z - a->Pos.z) * scan.invDeltaY[0]; - scan.z[0] = a->Pos.z; -#endif - -#ifdef IPOL_W - scan.slopeW[0] = (c->Pos.w - a->Pos.w) * scan.invDeltaY[0]; - scan.w[0] = a->Pos.w; -#endif - -#ifdef IPOL_C0 - scan.slopeC[0][0] = (c->Color[0] - a->Color[0]) * scan.invDeltaY[0]; - scan.c[0][0] = a->Color[0]; -#endif - -#ifdef IPOL_T0 - scan.slopeT[0][0] = (c->Tex[0] - a->Tex[0]) * scan.invDeltaY[0]; - scan.t[0][0] = a->Tex[0]; -#endif - -#ifdef IPOL_T1 - scan.slopeT[1][0] = (c->Tex[1] - a->Tex[1]) * scan.invDeltaY[0]; - scan.t[1][0] = a->Tex[1]; -#endif - - // top left fill convention y run - s32 yStart; - s32 yEnd; - -#ifdef SUBTEXEL - f32 subPixel; -#endif - - - // rasterize upper sub-triangle - //if ( (f32) 0.0 != scan.invDeltaY[1] ) - if ( F32_GREATER_0 ( scan.invDeltaY[1] ) ) - { - // calculate slopes for top edge - scan.slopeX[1] = (b->Pos.x - a->Pos.x) * scan.invDeltaY[1]; - scan.x[1] = a->Pos.x; - -#ifdef IPOL_Z - scan.slopeZ[1] = (b->Pos.z - a->Pos.z) * scan.invDeltaY[1]; - scan.z[1] = a->Pos.z; -#endif - -#ifdef IPOL_W - scan.slopeW[1] = (b->Pos.w - a->Pos.w) * scan.invDeltaY[1]; - scan.w[1] = a->Pos.w; -#endif - -#ifdef IPOL_C0 - scan.slopeC[0][1] = (b->Color[0] - a->Color[0]) * scan.invDeltaY[1]; - scan.c[0][1] = a->Color[0]; -#endif - -#ifdef IPOL_T0 - scan.slopeT[0][1] = (b->Tex[0] - a->Tex[0]) * scan.invDeltaY[1]; - scan.t[0][1] = a->Tex[0]; -#endif - -#ifdef IPOL_T1 - scan.slopeT[1][1] = (b->Tex[1] - a->Tex[1]) * scan.invDeltaY[1]; - scan.t[1][1] = a->Tex[1]; -#endif - - // apply top-left fill convention, top part - yStart = fill_convention_left( a->Pos.y ); - yEnd = fill_convention_right( b->Pos.y ); - -#ifdef SUBTEXEL - subPixel = ( (f32) yStart ) - a->Pos.y; - - // correct to pixel center - scan.x[0] += scan.slopeX[0] * subPixel; - scan.x[1] += scan.slopeX[1] * subPixel; - -#ifdef IPOL_Z - scan.z[0] += scan.slopeZ[0] * subPixel; - scan.z[1] += scan.slopeZ[1] * subPixel; -#endif - -#ifdef IPOL_W - scan.w[0] += scan.slopeW[0] * subPixel; - scan.w[1] += scan.slopeW[1] * subPixel; -#endif - -#ifdef IPOL_C0 - scan.c[0][0] += scan.slopeC[0][0] * subPixel; - scan.c[0][1] += scan.slopeC[0][1] * subPixel; -#endif - -#ifdef IPOL_T0 - scan.t[0][0] += scan.slopeT[0][0] * subPixel; - scan.t[0][1] += scan.slopeT[0][1] * subPixel; -#endif - -#ifdef IPOL_T1 - scan.t[1][0] += scan.slopeT[1][0] * subPixel; - scan.t[1][1] += scan.slopeT[1][1] * subPixel; -#endif - -#endif - - // rasterize the edge scanlines - for( line.y = yStart; line.y <= yEnd; line.y += SOFTWARE_DRIVER_2_STEP_Y) - { - line.x[scan.left] = scan.x[0]; - line.x[scan.right] = scan.x[1]; - -#ifdef IPOL_Z - line.z[scan.left] = scan.z[0]; - line.z[scan.right] = scan.z[1]; -#endif - -#ifdef IPOL_W - line.w[scan.left] = scan.w[0]; - line.w[scan.right] = scan.w[1]; -#endif - -#ifdef IPOL_C0 - line.c[0][scan.left] = scan.c[0][0]; - line.c[0][scan.right] = scan.c[0][1]; -#endif - -#ifdef IPOL_T0 - line.t[0][scan.left] = scan.t[0][0]; - line.t[0][scan.right] = scan.t[0][1]; -#endif - -#ifdef IPOL_T1 - line.t[1][scan.left] = scan.t[1][0]; - line.t[1][scan.right] = scan.t[1][1]; -#endif - - // render a scanline - interlace_scanline fragmentShader(); - - scan.x[0] += scan.slopeX[0]; - scan.x[1] += scan.slopeX[1]; - -#ifdef IPOL_Z - scan.z[0] += scan.slopeZ[0]; - scan.z[1] += scan.slopeZ[1]; -#endif - -#ifdef IPOL_W - scan.w[0] += scan.slopeW[0]; - scan.w[1] += scan.slopeW[1]; -#endif - -#ifdef IPOL_C0 - scan.c[0][0] += scan.slopeC[0][0]; - scan.c[0][1] += scan.slopeC[0][1]; -#endif - -#ifdef IPOL_T0 - scan.t[0][0] += scan.slopeT[0][0]; - scan.t[0][1] += scan.slopeT[0][1]; -#endif - -#ifdef IPOL_T1 - scan.t[1][0] += scan.slopeT[1][0]; - scan.t[1][1] += scan.slopeT[1][1]; -#endif - - } - } - - // rasterize lower sub-triangle - //if ( (f32) 0.0 != scan.invDeltaY[2] ) - if ( F32_GREATER_0 ( scan.invDeltaY[2] ) ) - { - // advance to middle point - //if( (f32) 0.0 != scan.invDeltaY[1] ) - if ( F32_GREATER_0 ( scan.invDeltaY[1] ) ) - { - temp[0] = b->Pos.y - a->Pos.y; // dy - - scan.x[0] = a->Pos.x + scan.slopeX[0] * temp[0]; -#ifdef IPOL_Z - scan.z[0] = a->Pos.z + scan.slopeZ[0] * temp[0]; -#endif -#ifdef IPOL_W - scan.w[0] = a->Pos.w + scan.slopeW[0] * temp[0]; -#endif -#ifdef IPOL_C0 - scan.c[0][0] = a->Color[0] + scan.slopeC[0][0] * temp[0]; -#endif -#ifdef IPOL_T0 - scan.t[0][0] = a->Tex[0] + scan.slopeT[0][0] * temp[0]; -#endif -#ifdef IPOL_T1 - scan.t[1][0] = a->Tex[1] + scan.slopeT[1][0] * temp[0]; -#endif - - } - - // calculate slopes for bottom edge - scan.slopeX[1] = (c->Pos.x - b->Pos.x) * scan.invDeltaY[2]; - scan.x[1] = b->Pos.x; - -#ifdef IPOL_Z - scan.slopeZ[1] = (c->Pos.z - b->Pos.z) * scan.invDeltaY[2]; - scan.z[1] = b->Pos.z; -#endif - -#ifdef IPOL_W - scan.slopeW[1] = (c->Pos.w - b->Pos.w) * scan.invDeltaY[2]; - scan.w[1] = b->Pos.w; -#endif - -#ifdef IPOL_C0 - scan.slopeC[0][1] = (c->Color[0] - b->Color[0]) * scan.invDeltaY[2]; - scan.c[0][1] = b->Color[0]; -#endif - -#ifdef IPOL_T0 - scan.slopeT[0][1] = (c->Tex[0] - b->Tex[0]) * scan.invDeltaY[2]; - scan.t[0][1] = b->Tex[0]; -#endif - -#ifdef IPOL_T1 - scan.slopeT[1][1] = (c->Tex[1] - b->Tex[1]) * scan.invDeltaY[2]; - scan.t[1][1] = b->Tex[1]; -#endif - - // apply top-left fill convention, top part - yStart = fill_convention_left( b->Pos.y ); - yEnd = fill_convention_right( c->Pos.y ); - -#ifdef SUBTEXEL - - subPixel = ( (f32) yStart ) - b->Pos.y; - - // correct to pixel center - scan.x[0] += scan.slopeX[0] * subPixel; - scan.x[1] += scan.slopeX[1] * subPixel; - -#ifdef IPOL_Z - scan.z[0] += scan.slopeZ[0] * subPixel; - scan.z[1] += scan.slopeZ[1] * subPixel; -#endif - -#ifdef IPOL_W - scan.w[0] += scan.slopeW[0] * subPixel; - scan.w[1] += scan.slopeW[1] * subPixel; -#endif - -#ifdef IPOL_C0 - scan.c[0][0] += scan.slopeC[0][0] * subPixel; - scan.c[0][1] += scan.slopeC[0][1] * subPixel; -#endif - -#ifdef IPOL_T0 - scan.t[0][0] += scan.slopeT[0][0] * subPixel; - scan.t[0][1] += scan.slopeT[0][1] * subPixel; -#endif - -#ifdef IPOL_T1 - scan.t[1][0] += scan.slopeT[1][0] * subPixel; - scan.t[1][1] += scan.slopeT[1][1] * subPixel; -#endif - -#endif - - // rasterize the edge scanlines - for( line.y = yStart; line.y <= yEnd; line.y += SOFTWARE_DRIVER_2_STEP_Y) - { - line.x[scan.left] = scan.x[0]; - line.x[scan.right] = scan.x[1]; - -#ifdef IPOL_Z - line.z[scan.left] = scan.z[0]; - line.z[scan.right] = scan.z[1]; -#endif - -#ifdef IPOL_W - line.w[scan.left] = scan.w[0]; - line.w[scan.right] = scan.w[1]; -#endif - -#ifdef IPOL_C0 - line.c[0][scan.left] = scan.c[0][0]; - line.c[0][scan.right] = scan.c[0][1]; -#endif - -#ifdef IPOL_T0 - line.t[0][scan.left] = scan.t[0][0]; - line.t[0][scan.right] = scan.t[0][1]; -#endif - -#ifdef IPOL_T1 - line.t[1][scan.left] = scan.t[1][0]; - line.t[1][scan.right] = scan.t[1][1]; -#endif - - // render a scanline - interlace_scanline fragmentShader(); - - scan.x[0] += scan.slopeX[0]; - scan.x[1] += scan.slopeX[1]; - -#ifdef IPOL_Z - scan.z[0] += scan.slopeZ[0]; - scan.z[1] += scan.slopeZ[1]; -#endif - -#ifdef IPOL_W - scan.w[0] += scan.slopeW[0]; - scan.w[1] += scan.slopeW[1]; -#endif - -#ifdef IPOL_C0 - scan.c[0][0] += scan.slopeC[0][0]; - scan.c[0][1] += scan.slopeC[0][1]; -#endif - -#ifdef IPOL_T0 - scan.t[0][0] += scan.slopeT[0][0]; - scan.t[0][1] += scan.slopeT[0][1]; -#endif - -#ifdef IPOL_T1 - scan.t[1][0] += scan.slopeT[1][0]; - scan.t[1][1] += scan.slopeT[1][1]; -#endif - - } - } - -} - - -} // end namespace video -} // end namespace irr - -#endif // _IRR_COMPILE_WITH_BURNINGSVIDEO_ - -namespace irr -{ -namespace video -{ - - -//! creates a flat triangle renderer -IBurningShader* createTriangleRendererGTextureLightMap2_M4(CBurningVideoDriver* driver) -{ - #ifdef _IRR_COMPILE_WITH_BURNINGSVIDEO_ - return new CTRGTextureLightMap2_M4(driver); - #else - return 0; - #endif // _IRR_COMPILE_WITH_BURNINGSVIDEO_ -} - - -} // end namespace video -} // end namespace irr - - - diff --git a/source/Irrlicht/CTRTextureWire2.cpp b/source/Irrlicht/CTRTextureWire2.cpp deleted file mode 100644 index af81c4a4..00000000 --- a/source/Irrlicht/CTRTextureWire2.cpp +++ /dev/null @@ -1,346 +0,0 @@ -// Copyright (C) 2002-2012 Nikolaus Gebhardt / Thomas Alten -// This file is part of the "Irrlicht Engine". -// For conditions of distribution and use, see copyright notice in irrlicht.h - -#include "IrrCompileConfig.h" -#include "IBurningShader.h" - -#ifdef _IRR_COMPILE_WITH_BURNINGSVIDEO_ - -// compile flag for this file -#undef USE_ZBUFFER -#undef IPOL_Z -#undef CMP_Z -#undef WRITE_Z - -#undef IPOL_W -#undef CMP_W -#undef WRITE_W - -#undef SUBTEXEL -#undef INVERSE_W - -#undef IPOL_C0 -#undef IPOL_T0 -#undef IPOL_T1 - -// define render case -#define SUBTEXEL -#define INVERSE_W - -//#define USE_ZBUFFER -#define IPOL_W -//#define CMP_W -//#define WRITE_W - - -#define IPOL_C0 -//#define IPOL_T0 -//#define IPOL_T1 - -// apply global override -#ifndef SOFTWARE_DRIVER_2_PERSPECTIVE_CORRECT - #undef INVERSE_W -#endif - -#ifndef SOFTWARE_DRIVER_2_SUBTEXEL - #undef SUBTEXEL -#endif - -#if BURNING_MATERIAL_MAX_COLORS < 1 - #undef IPOL_C0 -#endif - -#if !defined ( SOFTWARE_DRIVER_2_USE_WBUFFER ) && defined ( USE_ZBUFFER ) - #ifndef SOFTWARE_DRIVER_2_PERSPECTIVE_CORRECT - #undef IPOL_W - #endif - #define IPOL_Z - - #ifdef CMP_W - #undef CMP_W - #define CMP_Z - #endif - - #ifdef WRITE_W - #undef WRITE_W - #define WRITE_Z - #endif - -#endif - - -namespace irr -{ - -namespace video -{ - -class CTRTextureWire2 : public IBurningShader -{ -public: - - //! constructor - CTRTextureWire2(CBurningVideoDriver* driver); - - //! draws an indexed triangle list - virtual void drawTriangle(const s4DVertex* burning_restrict a, const s4DVertex* burning_restrict b, const s4DVertex* burning_restrict c) _IRR_OVERRIDE_; - virtual void drawLine ( const s4DVertex *a,const s4DVertex *b) _IRR_OVERRIDE_; - virtual void drawPoint( const s4DVertex *a) _IRR_OVERRIDE_; - virtual bool canWireFrame () _IRR_OVERRIDE_ { return true; } - virtual bool canPointCloud() _IRR_OVERRIDE_ { return true; } - -protected: - virtual void fragmentShader(); - - void renderAlphaLine ( const s4DVertex *a,const s4DVertex *b ) const; - void renderLine ( const s4DVertex *a,const s4DVertex *b, int renderZero = 0 ) const; - -}; - -//! constructor -CTRTextureWire2::CTRTextureWire2(CBurningVideoDriver* driver) -: IBurningShader(driver) -{ - #ifdef _DEBUG - setDebugName("CTRTextureWire2"); - #endif -} - - - -/*! - 2d line -*/ -void CTRTextureWire2::renderLine ( const s4DVertex *a,const s4DVertex *b, int renderZero) const -{ - int pitch0 = RenderTarget->getDimension().Width << SOFTWARE_DRIVER_2_RENDERTARGET_GRANULARITY; -#ifdef USE_ZBUFFER - int pitch1 = RenderTarget->getDimension().Width << 2; -#endif - - //todo:! - int aposx = fill_convention_none(a->Pos.x); - int aposy = fill_convention_none(a->Pos.y); - int bposx = fill_convention_none(b->Pos.x); - int bposy = fill_convention_none(b->Pos.y); - - int dx = bposx - aposx; - int dy = bposy - aposy; - - int c; - int m; - int d = 0; - int run; - - tVideoSample *dst; -#ifdef USE_ZBUFFER - fp24 *z; -#endif - - int xInc0 = 1 << SOFTWARE_DRIVER_2_RENDERTARGET_GRANULARITY; - int yInc0 = pitch0; - -#ifdef USE_ZBUFFER - int xInc1 = 4; - int yInc1 = pitch1; -#endif - - if ( dx < 0 ) - { - xInc0 = - ( 1 << SOFTWARE_DRIVER_2_RENDERTARGET_GRANULARITY); -#ifdef USE_ZBUFFER - xInc1 = -4; -#endif - dx = -dx; - } - - if ( dy > dx ) - { - //swap - s32 t; - t = dx;dx=dy;dy=t; - t = xInc0;xInc0=yInc0;yInc0=t; -#ifdef USE_ZBUFFER - t = xInc1;xInc1=yInc1;yInc1=t; -#endif - } - - if (0 == dx) - { - if (!renderZero) return; - dx = 1; - } - - SOFTWARE_DRIVER_2_CLIPCHECK_WIRE; - dst = (tVideoSample*) ( (u8*) RenderTarget->getData() + ( aposy * pitch0 ) + (aposx* (1<< SOFTWARE_DRIVER_2_RENDERTARGET_GRANULARITY) ) ); -#ifdef USE_ZBUFFER - z = (fp24*) ( (u8*) (fp24*) DepthBuffer->lock() + ( aposy * pitch1 ) + (aposx << 2 ) ); -#endif - - c = dx << 1; - m = dy << 1; - - // slopes - const f32 invDeltaX = fill_step_x( (f32)dx ); - -#ifdef IPOL_Z - f32 slopeZ = (b->Pos.z - a->Pos.z) * invDeltaX; - f32 dataZ = a->Pos.z; -#endif - -#ifdef IPOL_W - fp24 slopeW = (b->Pos.w - a->Pos.w) * invDeltaX; - fp24 dataW = a->Pos.w; -#endif - - f32 inversew = FIX_POINT_F32_MUL; - - tVideoSample color; -#if BURNING_MATERIAL_MAX_COLORS > 0 - tFixPoint r0, g0, b0; -#ifdef IPOL_C0 - sVec4 slopeC; - sVec4 C; - slopeC = (b->Color[0] - a->Color[0]) * invDeltaX; - C = a->Color[0]; -#endif - -#ifdef INVERSE_W - inversew = fix_inverse32_color(dataW); -#endif - - vec4_to_fix( r0, g0, b0, a->Color[0], inversew); - color = fix_to_sample( r0, g0, b0 ); - -#else - color = (tVideoSample) 0xFFFFFFFF; -#endif - - - run = dx; - while ( run ) - { -#ifdef CMP_Z - if ( *z >= dataZ ) -#endif -#ifdef CMP_W - if ( dataW >= *z ) -#endif - { -#ifdef WRITE_Z - *z = dataZ; -#endif -#ifdef WRITE_W - *z = dataW; -#endif - -#ifdef IPOL_C0 -#ifdef INVERSE_W - inversew = fix_inverse32_color(dataW); -#endif - vec4_to_fix(r0, g0, b0, C,inversew); - color = fix_to_sample( r0, g0, b0 ); -#endif - *dst = color; - - } - - dst = (tVideoSample*) ( (u8*) dst + xInc0 ); // x += xInc -#ifdef CMP_Z - z = (fp24*) ( (u8*) z + xInc1 ); -#endif -#ifdef CMP_W - z = (fp24*) ( (u8*) z + xInc1 ); -#endif - - d += m; - if ( d > dx ) - { - dst = (tVideoSample*) ( (u8*) dst + yInc0 ); // y += yInc -#ifdef CMP_Z - z = (fp24*) ( (u8*) z + yInc1 ); -#endif -#ifdef CMP_W - z = (fp24*) ( (u8*) z + yInc1 ); -#endif - - d -= c; - } - run -= 1; -#ifdef IPOL_Z - dataZ += slopeZ; -#endif -#ifdef IPOL_W - dataW += slopeW; -#endif -#ifdef IPOL_C0 - C += slopeC; -#endif - - - } - -} - -void CTRTextureWire2::fragmentShader() -{ -} - -void CTRTextureWire2::drawTriangle(const s4DVertex* burning_restrict a, const s4DVertex* burning_restrict b, const s4DVertex* burning_restrict c) -{ - // sort on height, y - if ( F32_A_GREATER_B ( a->Pos.y , b->Pos.y ) ) swapVertexPointer(&a, &b); - if ( F32_A_GREATER_B ( b->Pos.y , c->Pos.y ) ) swapVertexPointer(&b, &c); - if ( F32_A_GREATER_B ( a->Pos.y , b->Pos.y ) ) swapVertexPointer(&a, &b); - - renderLine ( a, b ); - renderLine ( b, c ); - renderLine ( a, c ); - -} - - -void CTRTextureWire2::drawLine ( const s4DVertex *a,const s4DVertex *b) -{ - // query access to TexMaps - - // sort on height, y - if (F32_A_GREATER_B(a->Pos.y,b->Pos.y )) swapVertexPointer(&a, &b); - - renderLine ( a, b ); -} - -void CTRTextureWire2::drawPoint(const s4DVertex *a) -{ - if ( (a->flag & VERTEX4D_CLIPMASK ) == VERTEX4D_INSIDE ) renderLine(a, a,1); -} - - -} // end namespace video -} // end namespace irr - -#endif // _IRR_COMPILE_WITH_BURNINGSVIDEO_ - -namespace irr -{ -namespace video -{ - - -//! creates a flat triangle renderer -IBurningShader* createTriangleRendererTextureGouraudWire2(CBurningVideoDriver* driver) -{ - //ETR_TEXTURE_GOURAUD_WIRE - #ifdef _IRR_COMPILE_WITH_BURNINGSVIDEO_ - return new CTRTextureWire2(driver); - #else - return 0; - #endif // _IRR_COMPILE_WITH_BURNINGSVIDEO_ -} - - -} // end namespace video -} // end namespace irr - - diff --git a/source/Irrlicht/CTR_transparent_reflection_2_layer.cpp b/source/Irrlicht/CTR_transparent_reflection_2_layer.cpp deleted file mode 100644 index eccb6787..00000000 --- a/source/Irrlicht/CTR_transparent_reflection_2_layer.cpp +++ /dev/null @@ -1,731 +0,0 @@ -// Copyright (C) 2002-2012 Nikolaus Gebhardt / Thomas Alten -// This file is part of the "Irrlicht Engine". -// For conditions of distribution and use, see copyright notice in irrlicht.h - -#include "IrrCompileConfig.h" -#include "IBurningShader.h" - -#ifdef _IRR_COMPILE_WITH_BURNINGSVIDEO_ - -// compile flag for this file -#undef USE_ZBUFFER -#undef IPOL_Z -#undef CMP_Z -#undef WRITE_Z - -#undef IPOL_W -#undef CMP_W -#undef WRITE_W - -#undef SUBTEXEL -#undef INVERSE_W - -#undef IPOL_C0 -#undef IPOL_T0 -#undef IPOL_T1 - -// define render case -#define SUBTEXEL -#define INVERSE_W - -#define USE_ZBUFFER -#define IPOL_W -#define CMP_W -#define WRITE_W - -#define IPOL_C0 -#define IPOL_T0 -#define IPOL_T1 - -// apply global override -#ifndef SOFTWARE_DRIVER_2_PERSPECTIVE_CORRECT - #undef INVERSE_W -#endif - -#ifndef SOFTWARE_DRIVER_2_SUBTEXEL - #undef SUBTEXEL -#endif - -#if BURNING_MATERIAL_MAX_COLORS < 1 - #undef IPOL_C0 -#endif - -#if !defined ( SOFTWARE_DRIVER_2_USE_WBUFFER ) && defined ( USE_ZBUFFER ) - #ifndef SOFTWARE_DRIVER_2_PERSPECTIVE_CORRECT - #undef IPOL_W - #endif - #define IPOL_Z - - #ifdef CMP_W - #undef CMP_W - #define CMP_Z - #endif - - #ifdef WRITE_W - #undef WRITE_W - #define WRITE_Z - #endif - -#endif - -namespace irr -{ - -namespace video -{ - -class CTR_transparent_reflection_2_layer : public IBurningShader -{ -public: - - //! constructor - CTR_transparent_reflection_2_layer(CBurningVideoDriver* driver); - - //! draws an indexed triangle list - virtual void drawTriangle(const s4DVertex* burning_restrict a, const s4DVertex* burning_restrict b, const s4DVertex* burning_restrict c) _IRR_OVERRIDE_; - virtual void OnSetMaterial(const SBurningShaderMaterial& material) _IRR_OVERRIDE_; - -private: - void fragmentShader(); - - E_MATERIAL_TYPE MaterialType; - -}; - -//! constructor -CTR_transparent_reflection_2_layer::CTR_transparent_reflection_2_layer(CBurningVideoDriver* driver) -: IBurningShader(driver) -{ - #ifdef _DEBUG - setDebugName("CTR_transparent_reflection_2_layer"); - #endif -} - -void CTR_transparent_reflection_2_layer::OnSetMaterial(const SBurningShaderMaterial& material) -{ - MaterialType = material.org.MaterialType; - -} - -/*! -*/ -void CTR_transparent_reflection_2_layer::fragmentShader() -{ - tVideoSample *dst; - -#ifdef USE_ZBUFFER - fp24 *z; -#endif - - s32 xStart; - s32 xEnd; - s32 dx; - - -#ifdef SUBTEXEL - f32 subPixel; -#endif - -#ifdef IPOL_Z - f32 slopeZ; -#endif -#ifdef IPOL_W - fp24 slopeW; -#endif -#ifdef IPOL_C0 - sVec4 slopeC; -#endif -#ifdef IPOL_T0 - sVec2 slopeT[BURNING_MATERIAL_MAX_TEXTURES]; -#endif - - // apply top-left fill-convention, left - xStart = fill_convention_left( line.x[0] ); - xEnd = fill_convention_right( line.x[1] ); - - dx = xEnd - xStart; - - if ( dx < 0 ) - return; - - // slopes - const f32 invDeltaX = fill_step_x( line.x[1] - line.x[0] ); - -#ifdef IPOL_Z - slopeZ = (line.z[1] - line.z[0]) * invDeltaX; -#endif -#ifdef IPOL_W - slopeW = (line.w[1] - line.w[0]) * invDeltaX; -#endif -#ifdef IPOL_C0 - slopeC = (line.c[0][1] - line.c[0][0]) * invDeltaX; -#endif -#ifdef IPOL_T0 - slopeT[0] = (line.t[0][1] - line.t[0][0]) * invDeltaX; -#endif -#ifdef IPOL_T1 - slopeT[1] = (line.t[1][1] - line.t[1][0]) * invDeltaX; -#endif - -#ifdef SUBTEXEL - subPixel = ( (f32) xStart ) - line.x[0]; -#ifdef IPOL_Z - line.z[0] += slopeZ * subPixel; -#endif -#ifdef IPOL_W - line.w[0] += slopeW * subPixel; -#endif -#ifdef IPOL_C0 - line.c[0][0] += slopeC * subPixel; -#endif -#ifdef IPOL_T0 - line.t[0][0] += slopeT[0] * subPixel; -#endif -#ifdef IPOL_T1 - line.t[1][0] += slopeT[1] * subPixel; -#endif -#endif - - SOFTWARE_DRIVER_2_CLIPCHECK; - dst = (tVideoSample*)RenderTarget->getData() + ( line.y * RenderTarget->getDimension().Width ) + xStart; - -#ifdef USE_ZBUFFER - z = (fp24*) DepthBuffer->lock() + ( line.y * RenderTarget->getDimension().Width ) + xStart; -#endif - - - f32 inversew = FIX_POINT_F32_MUL; - - tFixPoint r0, g0, b0; - tFixPoint r1, g1, b1; - -#ifdef IPOL_C0 - tFixPoint a1; -#endif - - switch(MaterialType) { - default: - case EMT_REFLECTION_2_LAYER: - for (s32 i = 0; i <= dx; i += SOFTWARE_DRIVER_2_STEP_X) - { -#ifdef CMP_Z - if (line.z[0] < z[i]) -#endif -#ifdef CMP_W - if (line.w[0] >= z[i]) -#endif - { - -#ifdef INVERSE_W - inversew = fix_inverse32(line.w[0]); -#endif - - getSample_texture(r0, g0, b0, &IT[0], tofix(line.t[0][0].x, inversew), tofix(line.t[0][0].y, inversew)); - getSample_texture(r1, g1, b1, &IT[1], tofix(line.t[1][0].x, inversew), tofix(line.t[1][0].y, inversew)); - - r0 = imulFix_tex1(r0, r1); - g0 = imulFix_tex1(g0, g1); - b0 = imulFix_tex1(b0, b1); - -#ifdef IPOL_C0 - vec4_to_fix(r1, g1, b1, line.c[0][0], inversew); - r0 = imulFix_simple(r1, r0); - g0 = imulFix_simple(g1, g0); - b0 = imulFix_simple(b1, b0); -#endif - - dst[i] = fix_to_sample(r0, g0, b0); - -#ifdef WRITE_Z - z[i] = line.z[0]; -#endif -#ifdef WRITE_W - z[i] = line.w[0]; -#endif - } - -#ifdef IPOL_Z - line.z[0] += slopeZ; -#endif -#ifdef IPOL_W - line.w[0] += slopeW; -#endif -#ifdef IPOL_C0 - line.c[0][0] += slopeC; -#endif -#ifdef IPOL_T0 - line.t[0][0] += slopeT[0]; -#endif -#ifdef IPOL_T1 - line.t[1][0] += slopeT[1]; -#endif - } - break; - - case EMT_TRANSPARENT_REFLECTION_2_LAYER: - for (s32 i = 0; i <= dx; i += SOFTWARE_DRIVER_2_STEP_X) - { -#ifdef CMP_Z - if (line.z[0] < z[i]) -#endif -#ifdef CMP_W - if (line.w[0] >= z[i]) -#endif - { - -#ifdef INVERSE_W - inversew = fix_inverse32(line.w[0]); -#endif - - getSample_texture(r0, g0, b0, &IT[0], tofix(line.t[0][0].x, inversew), tofix(line.t[0][0].y, inversew)); - getSample_texture(r1, g1, b1, &IT[1], tofix(line.t[1][0].x, inversew), tofix(line.t[1][0].y, inversew)); - - r0 = imulFix_tex1(r0, r1); - g0 = imulFix_tex1(g0, g1); - b0 = imulFix_tex1(b0, b1); - -#ifdef IPOL_C0 - vec4_to_fix(a1, r1, g1, b1, line.c[0][0], inversew); - r0 = imulFix_simple(r1, r0); - g0 = imulFix_simple(g1, g0); - b0 = imulFix_simple(b1, b0); - - //vertex alpha blend EMT_TRANSPARENT_REFLECTION_2_LAYER - if (a1 + 2 < FIX_POINT_ONE) - { - color_to_fix(r1, g1, b1, dst[i]); - r0 = r1 + imulFix(a1, r0 - r1); - g0 = g1 + imulFix(a1, g0 - g1); - b0 = b1 + imulFix(a1, b0 - b1); - } -#endif - - dst[i] = fix_to_sample(r0, g0, b0); - -#ifdef WRITE_Z - //z[i] = line.z[0]; -#endif -#ifdef WRITE_W - //z[i] = line.w[0]; -#endif - } - -#ifdef IPOL_Z - line.z[0] += slopeZ; -#endif -#ifdef IPOL_W - line.w[0] += slopeW; -#endif -#ifdef IPOL_C0 - line.c[0][0] += slopeC; -#endif -#ifdef IPOL_T0 - line.t[0][0] += slopeT[0]; -#endif -#ifdef IPOL_T1 - line.t[1][0] += slopeT[1]; -#endif - } - break; - - } - - -} - -void CTR_transparent_reflection_2_layer::drawTriangle ( const s4DVertex* burning_restrict a,const s4DVertex* burning_restrict b,const s4DVertex* burning_restrict c ) -{ - // sort on height, y - if ( F32_A_GREATER_B ( a->Pos.y , b->Pos.y ) ) swapVertexPointer(&a, &b); - if ( F32_A_GREATER_B ( b->Pos.y , c->Pos.y ) ) swapVertexPointer(&b, &c); - if ( F32_A_GREATER_B ( a->Pos.y , b->Pos.y ) ) swapVertexPointer(&a, &b); - - const f32 ca = c->Pos.y - a->Pos.y; - const f32 ba = b->Pos.y - a->Pos.y; - const f32 cb = c->Pos.y - b->Pos.y; - // calculate delta y of the edges - scan.invDeltaY[0] = fill_step_y( ca ); - scan.invDeltaY[1] = fill_step_y( ba ); - scan.invDeltaY[2] = fill_step_y( cb ); - - if ( F32_LOWER_EQUAL_0 ( scan.invDeltaY[0] ) ) - return; - - // find if the major edge is left or right aligned - f32 temp[4]; - - temp[0] = a->Pos.x - c->Pos.x; - temp[1] = -ca; - temp[2] = b->Pos.x - a->Pos.x; - temp[3] = ba; - - scan.left = ( temp[0] * temp[3] - temp[1] * temp[2] ) > 0.f ? 0 : 1; - scan.right = 1 - scan.left; - - // calculate slopes for the major edge - scan.slopeX[0] = (c->Pos.x - a->Pos.x) * scan.invDeltaY[0]; - scan.x[0] = a->Pos.x; - -#ifdef IPOL_Z - scan.slopeZ[0] = (c->Pos.z - a->Pos.z) * scan.invDeltaY[0]; - scan.z[0] = a->Pos.z; -#endif - -#ifdef IPOL_W - scan.slopeW[0] = (c->Pos.w - a->Pos.w) * scan.invDeltaY[0]; - scan.w[0] = a->Pos.w; -#endif - -#ifdef IPOL_C0 - scan.slopeC[0][0] = (c->Color[0] - a->Color[0]) * scan.invDeltaY[0]; - scan.c[0][0] = a->Color[0]; -#endif - -#ifdef IPOL_T0 - scan.slopeT[0][0] = (c->Tex[0] - a->Tex[0]) * scan.invDeltaY[0]; - scan.t[0][0] = a->Tex[0]; -#endif - -#ifdef IPOL_T1 - scan.slopeT[1][0] = (c->Tex[1] - a->Tex[1]) * scan.invDeltaY[0]; - scan.t[1][0] = a->Tex[1]; -#endif - - // top left fill convention y run - s32 yStart; - s32 yEnd; - -#ifdef SUBTEXEL - f32 subPixel; -#endif - - // rasterize upper sub-triangle - if ( F32_GREATER_0(scan.invDeltaY[1]) ) - { - // calculate slopes for top edge - scan.slopeX[1] = (b->Pos.x - a->Pos.x) * scan.invDeltaY[1]; - scan.x[1] = a->Pos.x; - -#ifdef IPOL_Z - scan.slopeZ[1] = (b->Pos.z - a->Pos.z) * scan.invDeltaY[1]; - scan.z[1] = a->Pos.z; -#endif - -#ifdef IPOL_W - scan.slopeW[1] = (b->Pos.w - a->Pos.w) * scan.invDeltaY[1]; - scan.w[1] = a->Pos.w; -#endif - -#ifdef IPOL_C0 - scan.slopeC[0][1] = (b->Color[0] - a->Color[0]) * scan.invDeltaY[1]; - scan.c[0][1] = a->Color[0]; -#endif - -#ifdef IPOL_T0 - scan.slopeT[0][1] = (b->Tex[0] - a->Tex[0]) * scan.invDeltaY[1]; - scan.t[0][1] = a->Tex[0]; -#endif - -#ifdef IPOL_T1 - scan.slopeT[1][1] = (b->Tex[1] - a->Tex[1]) * scan.invDeltaY[1]; - scan.t[1][1] = a->Tex[1]; -#endif - - // apply top-left fill convention, top part - yStart = fill_convention_left( a->Pos.y ); - yEnd = fill_convention_right( b->Pos.y ); - -#ifdef SUBTEXEL - subPixel = ( (f32) yStart ) - a->Pos.y; - - // correct to pixel center - scan.x[0] += scan.slopeX[0] * subPixel; - scan.x[1] += scan.slopeX[1] * subPixel; - -#ifdef IPOL_Z - scan.z[0] += scan.slopeZ[0] * subPixel; - scan.z[1] += scan.slopeZ[1] * subPixel; -#endif - -#ifdef IPOL_W - scan.w[0] += scan.slopeW[0] * subPixel; - scan.w[1] += scan.slopeW[1] * subPixel; -#endif - -#ifdef IPOL_C0 - scan.c[0][0] += scan.slopeC[0][0] * subPixel; - scan.c[0][1] += scan.slopeC[0][1] * subPixel; -#endif - -#ifdef IPOL_T0 - scan.t[0][0] += scan.slopeT[0][0] * subPixel; - scan.t[0][1] += scan.slopeT[0][1] * subPixel; -#endif - -#ifdef IPOL_T1 - scan.t[1][0] += scan.slopeT[1][0] * subPixel; - scan.t[1][1] += scan.slopeT[1][1] * subPixel; -#endif - -#endif - - // rasterize the edge scanlines - for( line.y = yStart; line.y <= yEnd; line.y += SOFTWARE_DRIVER_2_STEP_Y) - { - line.x[scan.left] = scan.x[0]; - line.x[scan.right] = scan.x[1]; - -#ifdef IPOL_Z - line.z[scan.left] = scan.z[0]; - line.z[scan.right] = scan.z[1]; -#endif - -#ifdef IPOL_W - line.w[scan.left] = scan.w[0]; - line.w[scan.right] = scan.w[1]; -#endif - -#ifdef IPOL_C0 - line.c[0][scan.left] = scan.c[0][0]; - line.c[0][scan.right] = scan.c[0][1]; -#endif - -#ifdef IPOL_T0 - line.t[0][scan.left] = scan.t[0][0]; - line.t[0][scan.right] = scan.t[0][1]; -#endif - -#ifdef IPOL_T1 - line.t[1][scan.left] = scan.t[1][0]; - line.t[1][scan.right] = scan.t[1][1]; -#endif - - // render a scanline - interlace_scanline - fragmentShader(); - - scan.x[0] += scan.slopeX[0]; - scan.x[1] += scan.slopeX[1]; - -#ifdef IPOL_Z - scan.z[0] += scan.slopeZ[0]; - scan.z[1] += scan.slopeZ[1]; -#endif - -#ifdef IPOL_W - scan.w[0] += scan.slopeW[0]; - scan.w[1] += scan.slopeW[1]; -#endif - -#ifdef IPOL_C0 - scan.c[0][0] += scan.slopeC[0][0]; - scan.c[0][1] += scan.slopeC[0][1]; -#endif - -#ifdef IPOL_T0 - scan.t[0][0] += scan.slopeT[0][0]; - scan.t[0][1] += scan.slopeT[0][1]; -#endif - -#ifdef IPOL_T1 - scan.t[1][0] += scan.slopeT[1][0]; - scan.t[1][1] += scan.slopeT[1][1]; -#endif - - } - } - - // rasterize lower sub-triangle - if ( F32_GREATER_0(scan.invDeltaY[2]) ) - { - // advance to middle point - if( F32_GREATER_0(scan.invDeltaY[1]) ) - { - temp[0] = b->Pos.y - a->Pos.y; // dy - - scan.x[0] = a->Pos.x + scan.slopeX[0] * temp[0]; -#ifdef IPOL_Z - scan.z[0] = a->Pos.z + scan.slopeZ[0] * temp[0]; -#endif -#ifdef IPOL_W - scan.w[0] = a->Pos.w + scan.slopeW[0] * temp[0]; -#endif -#ifdef IPOL_C0 - scan.c[0][0] = a->Color[0] + scan.slopeC[0][0] * temp[0]; -#endif -#ifdef IPOL_T0 - scan.t[0][0] = a->Tex[0] + scan.slopeT[0][0] * temp[0]; -#endif -#ifdef IPOL_T1 - scan.t[1][0] = a->Tex[1] + scan.slopeT[1][0] * temp[0]; -#endif - - } - - // calculate slopes for bottom edge - scan.slopeX[1] = (c->Pos.x - b->Pos.x) * scan.invDeltaY[2]; - scan.x[1] = b->Pos.x; - -#ifdef IPOL_Z - scan.slopeZ[1] = (c->Pos.z - b->Pos.z) * scan.invDeltaY[2]; - scan.z[1] = b->Pos.z; -#endif - -#ifdef IPOL_W - scan.slopeW[1] = (c->Pos.w - b->Pos.w) * scan.invDeltaY[2]; - scan.w[1] = b->Pos.w; -#endif - -#ifdef IPOL_C0 - scan.slopeC[0][1] = (c->Color[0] - b->Color[0]) * scan.invDeltaY[2]; - scan.c[0][1] = b->Color[0]; -#endif - -#ifdef IPOL_T0 - scan.slopeT[0][1] = (c->Tex[0] - b->Tex[0]) * scan.invDeltaY[2]; - scan.t[0][1] = b->Tex[0]; -#endif - -#ifdef IPOL_T1 - scan.slopeT[1][1] = (c->Tex[1] - b->Tex[1]) * scan.invDeltaY[2]; - scan.t[1][1] = b->Tex[1]; -#endif - - // apply top-left fill convention, top part - yStart = fill_convention_left( b->Pos.y ); - yEnd = fill_convention_right( c->Pos.y ); - -#ifdef SUBTEXEL - - subPixel = ( (f32) yStart ) - b->Pos.y; - - // correct to pixel center - scan.x[0] += scan.slopeX[0] * subPixel; - scan.x[1] += scan.slopeX[1] * subPixel; - -#ifdef IPOL_Z - scan.z[0] += scan.slopeZ[0] * subPixel; - scan.z[1] += scan.slopeZ[1] * subPixel; -#endif - -#ifdef IPOL_W - scan.w[0] += scan.slopeW[0] * subPixel; - scan.w[1] += scan.slopeW[1] * subPixel; -#endif - -#ifdef IPOL_C0 - scan.c[0][0] += scan.slopeC[0][0] * subPixel; - scan.c[0][1] += scan.slopeC[0][1] * subPixel; -#endif - -#ifdef IPOL_T0 - scan.t[0][0] += scan.slopeT[0][0] * subPixel; - scan.t[0][1] += scan.slopeT[0][1] * subPixel; -#endif - -#ifdef IPOL_T1 - scan.t[1][0] += scan.slopeT[1][0] * subPixel; - scan.t[1][1] += scan.slopeT[1][1] * subPixel; -#endif - -#endif - - // rasterize the edge scanlines - for( line.y = yStart; line.y <= yEnd; line.y += SOFTWARE_DRIVER_2_STEP_Y) - { - line.x[scan.left] = scan.x[0]; - line.x[scan.right] = scan.x[1]; - -#ifdef IPOL_Z - line.z[scan.left] = scan.z[0]; - line.z[scan.right] = scan.z[1]; -#endif - -#ifdef IPOL_W - line.w[scan.left] = scan.w[0]; - line.w[scan.right] = scan.w[1]; -#endif - -#ifdef IPOL_C0 - line.c[0][scan.left] = scan.c[0][0]; - line.c[0][scan.right] = scan.c[0][1]; -#endif - -#ifdef IPOL_T0 - line.t[0][scan.left] = scan.t[0][0]; - line.t[0][scan.right] = scan.t[0][1]; -#endif - -#ifdef IPOL_T1 - line.t[1][scan.left] = scan.t[1][0]; - line.t[1][scan.right] = scan.t[1][1]; -#endif - - // render a scanline - interlace_scanline - fragmentShader(); - - scan.x[0] += scan.slopeX[0]; - scan.x[1] += scan.slopeX[1]; - -#ifdef IPOL_Z - scan.z[0] += scan.slopeZ[0]; - scan.z[1] += scan.slopeZ[1]; -#endif - -#ifdef IPOL_W - scan.w[0] += scan.slopeW[0]; - scan.w[1] += scan.slopeW[1]; -#endif - -#ifdef IPOL_C0 - scan.c[0][0] += scan.slopeC[0][0]; - scan.c[0][1] += scan.slopeC[0][1]; -#endif - -#ifdef IPOL_T0 - scan.t[0][0] += scan.slopeT[0][0]; - scan.t[0][1] += scan.slopeT[0][1]; -#endif - -#ifdef IPOL_T1 - scan.t[1][0] += scan.slopeT[1][0]; - scan.t[1][1] += scan.slopeT[1][1]; -#endif - - } - } - -} - - -} // end namespace video -} // end namespace irr - -#endif // _IRR_COMPILE_WITH_BURNINGSVIDEO_ - -namespace irr -{ -namespace video -{ - -//! creates a flat triangle renderer -IBurningShader* createTriangleRendererTexture_transparent_reflection_2_layer(CBurningVideoDriver* driver) -{ - /* - ETR_TRANSPARENT_REFLECTION_2_LAYER - Irrlicht EMT_REFLECTION_2_LAYER,EMT_TRANSPARENT_REFLECTION_2_LAYER - */ - #ifdef _IRR_COMPILE_WITH_BURNINGSVIDEO_ - return new CTR_transparent_reflection_2_layer(driver); - #else - return 0; - #endif // _IRR_COMPILE_WITH_BURNINGSVIDEO_ -} - - -} // end namespace video -} // end namespace irr - - - diff --git a/source/Irrlicht/CTarReader.cpp b/source/Irrlicht/CTarReader.cpp deleted file mode 100644 index 6fd5ea7f..00000000 --- a/source/Irrlicht/CTarReader.cpp +++ /dev/null @@ -1,256 +0,0 @@ -// Copyright (C) 2009-2012 Gaz Davidson -// This file is part of the "Irrlicht Engine". -// For conditions of distribution and use, see copyright notice in irrlicht.h - -#include "CTarReader.h" - -#ifdef __IRR_COMPILE_WITH_TAR_ARCHIVE_LOADER_ - -#include "CFileList.h" -#include "CLimitReadFile.h" -#include "os.h" -#include "coreutil.h" -#include "errno.h" - -namespace irr -{ -namespace io -{ - -//! Constructor -CArchiveLoaderTAR::CArchiveLoaderTAR(io::IFileSystem* fs) -: FileSystem(fs) -{ - #ifdef _DEBUG - setDebugName("CArchiveLoaderTAR"); - #endif -} - - -//! returns true if the file maybe is able to be loaded by this class -bool CArchiveLoaderTAR::isALoadableFileFormat(const io::path& filename) const -{ - return core::hasFileExtension(filename, "tar"); -} - -//! Check to see if the loader can create archives of this type. -bool CArchiveLoaderTAR::isALoadableFileFormat(E_FILE_ARCHIVE_TYPE fileType) const -{ - return fileType == EFAT_TAR; -} - -//! Creates an archive from the filename -/** \param file File handle to check. -\return Pointer to newly created archive, or 0 upon error. */ -IFileArchive* CArchiveLoaderTAR::createArchive(const io::path& filename, bool ignoreCase, bool ignorePaths) const -{ - IFileArchive *archive = 0; - io::IReadFile* file = FileSystem->createAndOpenFile(filename); - - if (file) - { - archive = createArchive(file, ignoreCase, ignorePaths); - file->drop(); - } - - return archive; -} - - -//! creates/loads an archive from the file. -//! \return Pointer to the created archive. Returns 0 if loading failed. -IFileArchive* CArchiveLoaderTAR::createArchive(io::IReadFile* file, bool ignoreCase, bool ignorePaths) const -{ - IFileArchive *archive = 0; - if (file) - { - file->seek(0); - archive = new CTarReader(file, ignoreCase, ignorePaths); - } - return archive; -} - -//! Check if the file might be loaded by this class -/** Check might look into the file. -\param file File handle to check. -\return True if file seems to be loadable. */ -bool CArchiveLoaderTAR::isALoadableFileFormat(io::IReadFile* file) const -{ - // TAR files consist of blocks of 512 bytes - // if it isn't a multiple of 512 then it's not a TAR file. - if (file->getSize() % 512) - return false; - - file->seek(0); - - // read header of first file - STarHeader fHead; - file->read(&fHead, sizeof(STarHeader)); - - u32 checksum = 0; - sscanf(fHead.Checksum, "%o", &checksum); - - // verify checksum - - // some old TAR writers assume that chars are signed, others assume unsigned - // USTAR archives have a longer header, old TAR archives end after linkname - - u32 checksum1=0; - s32 checksum2=0; - - // remember to blank the checksum field! - memset(fHead.Checksum, ' ', 8); - - // old header - for (u8* p = (u8*)(&fHead); p < (u8*)(&fHead.Magic[0]); ++p) - { - checksum1 += *p; - checksum2 += c8(*p); - } - - if (!strncmp(fHead.Magic, "ustar", 5)) - { - for (u8* p = (u8*)(&fHead.Magic[0]); p < (u8*)(&fHead) + sizeof(fHead); ++p) - { - checksum1 += *p; - checksum2 += c8(*p); - } - } - return checksum1 == checksum || checksum2 == (s32)checksum; -} - -/* - TAR Archive -*/ -CTarReader::CTarReader(IReadFile* file, bool ignoreCase, bool ignorePaths) - : CFileList((file ? file->getFileName() : io::path("")), ignoreCase, ignorePaths), File(file) -{ - #ifdef _DEBUG - setDebugName("CTarReader"); - #endif - - if (File) - { - File->grab(); - - // fill the file list - populateFileList(); - - sort(); - } -} - - -CTarReader::~CTarReader() -{ - if (File) - File->drop(); -} - - -const IFileList* CTarReader::getFileList() const -{ - return this; -} - - -u32 CTarReader::populateFileList() -{ - STarHeader fHead; - Files.clear(); - - u32 pos = 0; - while ( s32(pos + sizeof(STarHeader)) < File->getSize()) - { - // seek to next file header - File->seek(pos); - - // read the header - File->read(&fHead, sizeof(fHead)); - - // only add standard files for now - if (fHead.Link == ETLI_REGULAR_FILE || ETLI_REGULAR_FILE_OLD) - { - io::path fullPath = ""; - fullPath.reserve(255); - - // USTAR archives have a filename prefix - // may not be null terminated, copy carefully! - if (!strncmp(fHead.Magic, "ustar", 5)) - { - c8* np = fHead.FileNamePrefix; - while(*np && (np - fHead.FileNamePrefix) < 155) - fullPath.append(*np); - np++; - } - - // append the file name - c8* np = fHead.FileName; - while(*np && (np - fHead.FileName) < 100) - { - fullPath.append(*np); - np++; - } - - // get size - core::stringc sSize = ""; - sSize.reserve(12); - np = fHead.Size; - while(*np && (np - fHead.Size) < 12) - { - sSize.append(*np); - np++; - } - - u32 size = strtoul(sSize.c_str(), NULL, 8); - - if (errno == ERANGE) - os::Printer::log("File too large", fullPath, ELL_WARNING); - - // save start position - u32 offset = pos + 512; - - // move to next file header block - pos = offset + (size / 512) * 512 + ((size % 512) ? 512 : 0); - - // add file to list - addItem(fullPath, offset, size, false ); - } - else - { - // todo: ETLI_DIRECTORY, ETLI_LINK_TO_ARCHIVED_FILE - - // move to next block - pos += 512; - } - - } - - return Files.size(); -} - -//! opens a file by file name -IReadFile* CTarReader::createAndOpenFile(const io::path& filename) -{ - const s32 index = findFile(filename, false); - - if (index != -1) - return createAndOpenFile(index); - - return 0; -} - -//! opens a file by index -IReadFile* CTarReader::createAndOpenFile(u32 index) -{ - if (index >= Files.size() ) - return 0; - - const SFileListEntry &entry = Files[index]; - return createLimitReadFile( entry.FullName, File, entry.Offset, entry.Size ); -} - -} // end namespace io -} // end namespace irr - -#endif // __IRR_COMPILE_WITH_TAR_ARCHIVE_LOADER_ diff --git a/source/Irrlicht/CTarReader.h b/source/Irrlicht/CTarReader.h deleted file mode 100644 index 3759f5b1..00000000 --- a/source/Irrlicht/CTarReader.h +++ /dev/null @@ -1,136 +0,0 @@ -// Copyright (C) 2009-2012 Gaz Davidson -// This file is part of the "Irrlicht Engine". -// For conditions of distribution and use, see copyright notice in irrlicht.h - -#ifndef __C_TAR_READER_H_INCLUDED__ -#define __C_TAR_READER_H_INCLUDED__ - -#include "IrrCompileConfig.h" - -#ifdef __IRR_COMPILE_WITH_TAR_ARCHIVE_LOADER_ - -#include "IReferenceCounted.h" -#include "IReadFile.h" -#include "irrArray.h" -#include "irrString.h" -#include "IFileSystem.h" -#include "CFileList.h" - -namespace irr -{ -namespace io -{ - - enum E_TAR_LINK_INDICATOR - { - ETLI_REGULAR_FILE_OLD = 0 , - ETLI_REGULAR_FILE = '0', - ETLI_LINK_TO_ARCHIVED_FILE = '1', // Hard link - ETLI_SYMBOLIC_LINK = '2', - ETLI_CHAR_SPECIAL_DEVICE = '3', - ETLI_BLOCK_SPECIAL_DEVICE = '4', - ETLI_DIRECTORY = '5', - ETLI_FIFO_SPECIAL_FILE = '6', - ETLI_CONTIGUOUS_FILE = '7' - }; - -// byte-align structures -#include "irrpack.h" - - struct STarHeader - { - c8 FileName[100]; - c8 FileMode[8]; - c8 UserID[8]; - c8 GroupID[8]; - c8 Size[12]; - c8 ModifiedTime[12]; - c8 Checksum[8]; - c8 Link; - c8 LinkName[100]; - c8 Magic[6]; - c8 USTARVersion[2]; - c8 UserName[32]; - c8 GroupName[32]; - c8 DeviceMajor[8]; - c8 DeviceMinor[8]; - c8 FileNamePrefix[155]; - } PACK_STRUCT; - -// Default alignment -#include "irrunpack.h" - - //! Archiveloader capable of loading ZIP Archives - class CArchiveLoaderTAR : public IArchiveLoader - { - public: - - //! Constructor - CArchiveLoaderTAR(io::IFileSystem* fs); - - //! returns true if the file maybe is able to be loaded by this class - //! based on the file extension (e.g. ".tar") - virtual bool isALoadableFileFormat(const io::path& filename) const _IRR_OVERRIDE_; - - //! Check if the file might be loaded by this class - /** Check might look into the file. - \param file File handle to check. - \return True if file seems to be loadable. */ - virtual bool isALoadableFileFormat(io::IReadFile* file) const _IRR_OVERRIDE_; - - //! Check to see if the loader can create archives of this type. - /** Check based on the archive type. - \param fileType The archive type to check. - \return True if the archile loader supports this type, false if not */ - virtual bool isALoadableFileFormat(E_FILE_ARCHIVE_TYPE fileType) const _IRR_OVERRIDE_; - - //! Creates an archive from the filename - /** \param file File handle to check. - \return Pointer to newly created archive, or 0 upon error. */ - virtual IFileArchive* createArchive(const io::path& filename, bool ignoreCase, bool ignorePaths) const _IRR_OVERRIDE_; - - //! creates/loads an archive from the file. - //! \return Pointer to the created archive. Returns 0 if loading failed. - virtual io::IFileArchive* createArchive(io::IReadFile* file, bool ignoreCase, bool ignorePaths) const _IRR_OVERRIDE_; - - private: - io::IFileSystem* FileSystem; - }; - - - - class CTarReader : public virtual IFileArchive, virtual CFileList - { - public: - - CTarReader(IReadFile* file, bool ignoreCase, bool ignorePaths); - - virtual ~CTarReader(); - - //! opens a file by file name - virtual IReadFile* createAndOpenFile(const io::path& filename) _IRR_OVERRIDE_; - - //! opens a file by index - virtual IReadFile* createAndOpenFile(u32 index) _IRR_OVERRIDE_; - - //! returns the list of files - virtual const IFileList* getFileList() const _IRR_OVERRIDE_; - - //! get the class Type - virtual E_FILE_ARCHIVE_TYPE getType() const _IRR_OVERRIDE_ { return EFAT_TAR; } - - //! return the name (id) of the file Archive - virtual const io::path& getArchiveName() const _IRR_OVERRIDE_ {return Path;} - - private: - - u32 populateFileList(); - - IReadFile* File; - }; - -} // end namespace io -} // end namespace irr - -#endif // __IRR_COMPILE_WITH_TAR_ARCHIVE_LOADER_ -#endif // __C_TAR_READER_H_INCLUDED__ diff --git a/source/Irrlicht/CTerrainSceneNode.cpp b/source/Irrlicht/CTerrainSceneNode.cpp deleted file mode 100644 index 395a45da..00000000 --- a/source/Irrlicht/CTerrainSceneNode.cpp +++ /dev/null @@ -1,1518 +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 - -// The code for the TerrainSceneNode is based on the GeoMipMapSceneNode -// developed by Spintz. He made it available for Irrlicht and allowed it to be -// distributed under this licence. I only modified some parts. A lot of thanks -// go to him. - -#include "IrrCompileConfig.h" - -#ifdef _IRR_COMPILE_WITH_TERRAIN_SCENENODE_ - -#include "CTerrainSceneNode.h" -#include "CTerrainTriangleSelector.h" -#include "IVideoDriver.h" -#include "ISceneManager.h" -#include "ICameraSceneNode.h" -#include "SViewFrustum.h" -#include "irrMath.h" -#include "os.h" -#include "IGUIFont.h" -#include "IFileSystem.h" -#include "IReadFile.h" -#include "ITextSceneNode.h" -#include "IAnimatedMesh.h" -#include "SMesh.h" -#include "CDynamicMeshBuffer.h" - -namespace irr -{ -namespace scene -{ - - //! constructor - CTerrainSceneNode::CTerrainSceneNode(ISceneNode* parent, ISceneManager* mgr, - io::IFileSystem* fs, s32 id, s32 maxLOD, E_TERRAIN_PATCH_SIZE patchSize, - const core::vector3df& position, - const core::vector3df& rotation, - const core::vector3df& scale) - : ITerrainSceneNode(parent, mgr, id, position, rotation, scale), - TerrainData(patchSize, maxLOD, position, rotation, scale), RenderBuffer(0), - VerticesToRender(0), IndicesToRender(0), DynamicSelectorUpdate(false), - OverrideDistanceThreshold(false), UseDefaultRotationPivot(true), ForceRecalculation(true), - FixedBorderLOD(-1), - CameraMovementDelta(10.0f), CameraRotationDelta(1.0f),CameraFOVDelta(0.1f), - TCoordScale1(1.0f), TCoordScale2(1.0f), SmoothFactor(0), FileSystem(fs) - { - #ifdef _DEBUG - setDebugName("CTerrainSceneNode"); - #endif - - Mesh = new SMesh(); - RenderBuffer = new CDynamicMeshBuffer(video::EVT_2TCOORDS, video::EIT_16BIT); - RenderBuffer->setHardwareMappingHint(scene::EHM_STATIC, scene::EBT_VERTEX); - RenderBuffer->setHardwareMappingHint(scene::EHM_DYNAMIC, scene::EBT_INDEX); - - if (FileSystem) - FileSystem->grab(); - - setAutomaticCulling(scene::EAC_OFF); - } - - - //! destructor - CTerrainSceneNode::~CTerrainSceneNode() - { - delete [] TerrainData.Patches; - - if (FileSystem) - FileSystem->drop(); - - if (Mesh) - Mesh->drop(); - - if (RenderBuffer) - RenderBuffer->drop(); - } - - - //! Initializes the terrain data. Loads the vertices from the heightMapFile - bool CTerrainSceneNode::loadHeightMap(io::IReadFile* file, video::SColor vertexColor, - s32 smoothFactor) - { - if (!file) - return false; - - Mesh->MeshBuffers.clear(); - const u32 startTime = os::Timer::getRealTime(); - video::IImage* heightMap = SceneManager->getVideoDriver()->createImageFromFile(file); - - if (!heightMap) - { - os::Printer::log("Unable to load heightmap."); - return false; - } - - HeightmapFile = file->getFileName(); - SmoothFactor = smoothFactor; - - // Get the dimension of the heightmap data - TerrainData.Size = heightMap->getDimension().Width; - - switch (TerrainData.PatchSize) - { - case ETPS_9: - if (TerrainData.MaxLOD > 3) - { - TerrainData.MaxLOD = 3; - } - break; - case ETPS_17: - if (TerrainData.MaxLOD > 4) - { - TerrainData.MaxLOD = 4; - } - break; - case ETPS_33: - if (TerrainData.MaxLOD > 5) - { - TerrainData.MaxLOD = 5; - } - break; - case ETPS_65: - if (TerrainData.MaxLOD > 6) - { - TerrainData.MaxLOD = 6; - } - break; - case ETPS_129: - if (TerrainData.MaxLOD > 7) - { - TerrainData.MaxLOD = 7; - } - break; - } - - // --- Generate vertex data from heightmap ---- - // resize the vertex array for the mesh buffer one time (makes loading faster) - scene::CDynamicMeshBuffer *mb=0; - - const u32 numVertices = TerrainData.Size * TerrainData.Size; - if (numVertices <= 65536) - { - //small enough for 16bit buffers - mb=new scene::CDynamicMeshBuffer(video::EVT_2TCOORDS, video::EIT_16BIT); - RenderBuffer->getIndexBuffer().setType(video::EIT_16BIT); - } - else - { - //we need 32bit buffers - mb=new scene::CDynamicMeshBuffer(video::EVT_2TCOORDS, video::EIT_32BIT); - RenderBuffer->getIndexBuffer().setType(video::EIT_32BIT); - } - - mb->getVertexBuffer().set_used(numVertices); - - // Read the heightmap to get the vertex data - // Apply positions changes, scaling changes - const f32 tdSize = 1.0f/(f32)(TerrainData.Size-1); - s32 index = 0; - float fx=0.f; - float fx2=0.f; - for (s32 x = 0; x < TerrainData.Size; ++x) - { - float fz=0.f; - float fz2=0.f; - for (s32 z = 0; z < TerrainData.Size; ++z) - { - video::S3DVertex2TCoords& vertex= static_cast<video::S3DVertex2TCoords*>(mb->getVertexBuffer().pointer())[index++]; - vertex.Normal.set(0.0f, 1.0f, 0.0f); - vertex.Color = vertexColor; - vertex.Pos.X = fx; - vertex.Pos.Y = (f32) heightMap->getPixel(TerrainData.Size-x-1,z).getLightness(); - vertex.Pos.Z = fz; - - vertex.TCoords.X = vertex.TCoords2.X = 1.f-fx2; - vertex.TCoords.Y = vertex.TCoords2.Y = fz2; - - ++fz; - fz2 += tdSize; - } - ++fx; - fx2 += tdSize; - } - - // drop heightMap, no longer needed - heightMap->drop(); - - smoothTerrain(mb, smoothFactor); - - // calculate smooth normals for the vertices - calculateNormals(mb); - - // add the MeshBuffer to the mesh - Mesh->addMeshBuffer(mb); - - // We copy the data to the renderBuffer, after the normals have been calculated. - RenderBuffer->getVertexBuffer().set_used(numVertices); - - for (u32 i = 0; i < numVertices; ++i) - { - RenderBuffer->getVertexBuffer()[i] = mb->getVertexBuffer()[i]; - RenderBuffer->getVertexBuffer()[i].Pos *= TerrainData.Scale; - RenderBuffer->getVertexBuffer()[i].Pos += TerrainData.Position; - } - - // We no longer need the mb - mb->drop(); - - // calculate all the necessary data for the patches and the terrain - calculateDistanceThresholds(); - createPatches(); - calculatePatchData(); - - // set the default rotation pivot point to the terrain nodes center - TerrainData.RotationPivot = TerrainData.Center; - - // Rotate the vertices of the terrain by the rotation - // specified. Must be done after calculating the terrain data, - // so we know what the current center of the terrain is. - setRotation(TerrainData.Rotation); - - // Pre-allocate memory for indices - - RenderBuffer->getIndexBuffer().set_used( - TerrainData.PatchCount * TerrainData.PatchCount * - TerrainData.CalcPatchSize * TerrainData.CalcPatchSize * 6); - - RenderBuffer->setDirty(); - - const u32 endTime = os::Timer::getRealTime(); - - c8 tmp[255]; - snprintf_irr(tmp, 255, "Generated terrain data (%dx%d) in %.4f seconds", - TerrainData.Size, TerrainData.Size, (endTime - startTime) / 1000.0f ); - os::Printer::log(tmp); - - return true; - } - - - //! Initializes the terrain data. Loads the vertices from the heightMapFile - bool CTerrainSceneNode::loadHeightMapRAW(io::IReadFile* file, - s32 bitsPerPixel, bool signedData, bool floatVals, - s32 width, video::SColor vertexColor, s32 smoothFactor) - { - if (!file) - return false; - if (floatVals && bitsPerPixel != 32) - return false; - - // start reading - const u32 startTime = os::Timer::getTime(); - - Mesh->MeshBuffers.clear(); - - const size_t bytesPerPixel = (size_t)bitsPerPixel / 8; - - // Get the dimension of the heightmap data - const long filesize = file->getSize(); - if (!width) - TerrainData.Size = core::floor32(sqrtf((f32)(filesize / bytesPerPixel))); - else - { - if ((filesize-file->getPos())/bytesPerPixel>(size_t)(width*width)) - { - os::Printer::log("Error reading heightmap RAW file", "File is too small."); - return false; - } - TerrainData.Size = width; - } - - switch (TerrainData.PatchSize) - { - case ETPS_9: - if (TerrainData.MaxLOD > 3) - { - TerrainData.MaxLOD = 3; - } - break; - case ETPS_17: - if (TerrainData.MaxLOD > 4) - { - TerrainData.MaxLOD = 4; - } - break; - case ETPS_33: - if (TerrainData.MaxLOD > 5) - { - TerrainData.MaxLOD = 5; - } - break; - case ETPS_65: - if (TerrainData.MaxLOD > 6) - { - TerrainData.MaxLOD = 6; - } - break; - case ETPS_129: - if (TerrainData.MaxLOD > 7) - { - TerrainData.MaxLOD = 7; - } - break; - } - - // --- Generate vertex data from heightmap ---- - // resize the vertex array for the mesh buffer one time (makes loading faster) - scene::CDynamicMeshBuffer *mb=0; - const u32 numVertices = TerrainData.Size * TerrainData.Size; - if (numVertices <= 65536) - { - //small enough for 16bit buffers - mb=new scene::CDynamicMeshBuffer(video::EVT_2TCOORDS, video::EIT_16BIT); - RenderBuffer->getIndexBuffer().setType(video::EIT_16BIT); - } - else - { - //we need 32bit buffers - mb=new scene::CDynamicMeshBuffer(video::EVT_2TCOORDS, video::EIT_32BIT); - RenderBuffer->getIndexBuffer().setType(video::EIT_32BIT); - } - - mb->getVertexBuffer().reallocate(numVertices); - - video::S3DVertex2TCoords vertex; - vertex.Normal.set(0.0f, 1.0f, 0.0f); - vertex.Color = vertexColor; - - // Read the heightmap to get the vertex data - // Apply positions changes, scaling changes - const f32 tdSize = 1.0f/(f32)(TerrainData.Size-1); - float fx=0.f; - float fx2=0.f; - for (s32 x = 0; x < TerrainData.Size; ++x) - { - float fz=0.f; - float fz2=0.f; - for (s32 z = 0; z < TerrainData.Size; ++z) - { - bool failure=false; - vertex.Pos.X = fx; - if (floatVals) - { - if (file->read(&vertex.Pos.Y, bytesPerPixel) != bytesPerPixel) - failure=true; - } - else if (signedData) - { - switch (bytesPerPixel) - { - case 1: - { - s8 val; - if (file->read(&val, bytesPerPixel) != bytesPerPixel) - failure=true; - vertex.Pos.Y=val; - } - break; - case 2: - { - s16 val; - if (file->read(&val, bytesPerPixel) != bytesPerPixel) - failure=true; - vertex.Pos.Y=val/256.f; - } - break; - case 4: - { - s32 val; - if (file->read(&val, bytesPerPixel) != bytesPerPixel) - failure=true; - vertex.Pos.Y=val/16777216.f; - } - break; - } - } - else - { - switch (bytesPerPixel) - { - case 1: - { - u8 val; - if (file->read(&val, bytesPerPixel) != bytesPerPixel) - failure=true; - vertex.Pos.Y=val; - } - break; - case 2: - { - u16 val; - if (file->read(&val, bytesPerPixel) != bytesPerPixel) - failure=true; - vertex.Pos.Y=val/256.f; - } - break; - case 4: - { - u32 val; - if (file->read(&val, bytesPerPixel) != bytesPerPixel) - failure=true; - vertex.Pos.Y=val/16777216.f; - } - break; - } - } - if (failure) - { - os::Printer::log("Error reading heightmap RAW file."); - mb->drop(); - return false; - } - vertex.Pos.Z = fz; - - vertex.TCoords.X = vertex.TCoords2.X = 1.f-fx2; - vertex.TCoords.Y = vertex.TCoords2.Y = fz2; - - mb->getVertexBuffer().push_back(vertex); - ++fz; - fz2 += tdSize; - } - ++fx; - fx2 += tdSize; - } - - smoothTerrain(mb, smoothFactor); - - // calculate smooth normals for the vertices - calculateNormals(mb); - - // add the MeshBuffer to the mesh - Mesh->addMeshBuffer(mb); - const u32 vertexCount = mb->getVertexCount(); - - // We copy the data to the renderBuffer, after the normals have been calculated. - RenderBuffer->getVertexBuffer().set_used(vertexCount); - - for (u32 i = 0; i < vertexCount; i++) - { - RenderBuffer->getVertexBuffer()[i] = mb->getVertexBuffer()[i]; - RenderBuffer->getVertexBuffer()[i].Pos *= TerrainData.Scale; - RenderBuffer->getVertexBuffer()[i].Pos += TerrainData.Position; - } - - // We no longer need the mb - mb->drop(); - - // calculate all the necessary data for the patches and the terrain - calculateDistanceThresholds(); - createPatches(); - calculatePatchData(); - - // set the default rotation pivot point to the terrain nodes center - TerrainData.RotationPivot = TerrainData.Center; - - // Rotate the vertices of the terrain by the rotation specified. Must be done - // after calculating the terrain data, so we know what the current center of the - // terrain is. - setRotation(TerrainData.Rotation); - - // Pre-allocate memory for indices - RenderBuffer->getIndexBuffer().set_used( - TerrainData.PatchCount*TerrainData.PatchCount* - TerrainData.CalcPatchSize*TerrainData.CalcPatchSize*6); - - const u32 endTime = os::Timer::getTime(); - - c8 tmp[255]; - snprintf_irr(tmp, 255, "Generated terrain data (%dx%d) in %.4f seconds", - TerrainData.Size, TerrainData.Size, (endTime - startTime) / 1000.0f); - os::Printer::log(tmp); - - return true; - } - - - //! Returns the mesh - IMesh* CTerrainSceneNode::getMesh() { return Mesh; } - - - //! Returns the material based on the zero based index i. - video::SMaterial& CTerrainSceneNode::getMaterial(u32 i) - { - return Mesh->getMeshBuffer(i)->getMaterial(); - } - - - //! Returns amount of materials used by this scene node ( always 1 ) - u32 CTerrainSceneNode::getMaterialCount() const - { - return Mesh->getMeshBufferCount(); - } - - - //! Sets the scale of the scene node. - //! \param scale: New scale of the node - void CTerrainSceneNode::setScale(const core::vector3df& scale) - { - TerrainData.Scale = scale; - applyTransformation(); - calculateNormals(RenderBuffer); - ForceRecalculation = true; - } - - - //! Sets the rotation of the node. This only modifies - //! the relative rotation of the node. - //! \param rotation: New rotation of the node in degrees. - void CTerrainSceneNode::setRotation(const core::vector3df& rotation) - { - TerrainData.Rotation = rotation; - applyTransformation(); - ForceRecalculation = true; - } - - - //! Sets the pivot point for rotation of this node. This is useful for the TiledTerrainManager to - //! rotate all terrain tiles around a global world point. - //! NOTE: The default for the RotationPivot will be the center of the individual tile. - void CTerrainSceneNode::setRotationPivot(const core::vector3df& pivot) - { - UseDefaultRotationPivot = false; - TerrainData.RotationPivot = pivot; - } - - - //! Sets the position of the node. - //! \param newpos: New postition of the scene node. - void CTerrainSceneNode::setPosition(const core::vector3df& newpos) - { - TerrainData.Position = newpos; - applyTransformation(); - ForceRecalculation = true; - } - - - //! Apply transformation changes(scale, position, rotation) - void CTerrainSceneNode::applyTransformation() - { - if (!Mesh->getMeshBufferCount()) - return; - - core::matrix4 rotMatrix; - rotMatrix.setRotationDegrees(TerrainData.Rotation); - - const s32 vtxCount = Mesh->getMeshBuffer(0)->getVertexCount(); - for (s32 i = 0; i < vtxCount; ++i) - { - RenderBuffer->getVertexBuffer()[i].Pos = Mesh->getMeshBuffer(0)->getPosition(i) * TerrainData.Scale + TerrainData.Position; - - RenderBuffer->getVertexBuffer()[i].Pos -= TerrainData.RotationPivot; - rotMatrix.inverseRotateVect(RenderBuffer->getVertexBuffer()[i].Pos); - RenderBuffer->getVertexBuffer()[i].Pos += TerrainData.RotationPivot; - } - - calculateDistanceThresholds(true); - calculatePatchData(); - - RenderBuffer->setDirty(EBT_VERTEX); - } - - - //! Updates the scene nodes indices if the camera has moved or rotated by a certain - //! threshold, which can be changed using the SetCameraMovementDeltaThreshold and - //! SetCameraRotationDeltaThreshold functions. This also determines if a given patch - //! for the scene node is within the view frustum and if it's not the indices are not - //! generated for that patch. - void CTerrainSceneNode::OnRegisterSceneNode() - { - if (!IsVisible || !SceneManager->getActiveCamera()) - return; - - SceneManager->registerNodeForRendering(this); - - preRenderCalculationsIfNeeded(); - - // Do Not call ISceneNode::OnRegisterSceneNode(), this node should have no children (luke: is this comment still true, as ISceneNode::OnRegisterSceneNode() is called?) - - ISceneNode::OnRegisterSceneNode(); - ForceRecalculation = false; - } - - void CTerrainSceneNode::preRenderCalculationsIfNeeded() - { - scene::ICameraSceneNode * camera = SceneManager->getActiveCamera(); - if (!camera) - return; - - // Determine the camera rotation, based on the camera direction. - const core::vector3df cameraPosition = camera->getAbsolutePosition(); - const core::vector3df cameraRotation = core::line3d<f32>(cameraPosition, camera->getTarget()).getVector().getHorizontalAngle(); - core::vector3df cameraUp = camera->getUpVector(); - cameraUp.normalize(); - const f32 CameraFOV = SceneManager->getActiveCamera()->getFOV(); - - // Only check on the Camera's Y Rotation - if (!ForceRecalculation) - { - if ((fabsf(cameraRotation.X - OldCameraRotation.X) < CameraRotationDelta) && - (fabsf(cameraRotation.Y - OldCameraRotation.Y) < CameraRotationDelta)) - { - if ((fabs(cameraPosition.X - OldCameraPosition.X) < CameraMovementDelta) && - (fabs(cameraPosition.Y - OldCameraPosition.Y) < CameraMovementDelta) && - (fabs(cameraPosition.Z - OldCameraPosition.Z) < CameraMovementDelta)) - { - if (fabs(CameraFOV-OldCameraFOV) < CameraFOVDelta && - cameraUp.dotProduct(OldCameraUp) > (1.f - (cos(core::DEGTORAD * CameraRotationDelta)))) - { - return; - } - } - } - } - - //we need to redo calculations... - - OldCameraPosition = cameraPosition; - OldCameraRotation = cameraRotation; - OldCameraUp = cameraUp; - OldCameraFOV = CameraFOV; - - preRenderLODCalculations(); - preRenderIndicesCalculations(); - } - - void CTerrainSceneNode::preRenderLODCalculations() - { - scene::ICameraSceneNode * camera = SceneManager->getActiveCamera(); - - if (!camera) - return; - - const core::vector3df cameraPosition = camera->getAbsolutePosition(); - - const SViewFrustum* frustum = camera->getViewFrustum(); - - // Determine each patches LOD based on distance from camera (and whether or not they are in - // the view frustum). - const s32 count = TerrainData.PatchCount * TerrainData.PatchCount; - for (s32 j = 0; j < count; ++j) - { - if (frustum->getBoundingBox().intersectsWithBox(TerrainData.Patches[j].BoundingBox)) - { - const f32 distance = cameraPosition.getDistanceFromSQ(TerrainData.Patches[j].Center); - - if ( FixedBorderLOD >= 0 ) - { - TerrainData.Patches[j].CurrentLOD = FixedBorderLOD; - if (j < TerrainData.PatchCount - || j >= (count - TerrainData.PatchCount) - || (j % TerrainData.PatchCount) == 0 - || (j % TerrainData.PatchCount) == TerrainData.PatchCount-1) - continue; - } - - TerrainData.Patches[j].CurrentLOD = 0; - - for (s32 i = TerrainData.MaxLOD - 1; i>0; --i) - { - if (distance >= TerrainData.LODDistanceThreshold[i]) - { - TerrainData.Patches[j].CurrentLOD = i; - break; - } - } - } - else - { - TerrainData.Patches[j].CurrentLOD = -1; - } - } - } - - - void CTerrainSceneNode::preRenderIndicesCalculations() - { - scene::IIndexBuffer& indexBuffer = RenderBuffer->getIndexBuffer(); - IndicesToRender = 0; - indexBuffer.set_used(0); - - s32 index = 0; - // Then generate the indices for all patches that are visible. - for (s32 i = 0; i < TerrainData.PatchCount; ++i) - { - for (s32 j = 0; j < TerrainData.PatchCount; ++j) - { - if (TerrainData.Patches[index].CurrentLOD >= 0) - { - s32 x = 0; - s32 z = 0; - - // calculate the step we take this patch, based on the patches current LOD - const s32 step = 1 << TerrainData.Patches[index].CurrentLOD; - - // Loop through patch and generate indices - while (z < TerrainData.CalcPatchSize) - { - const s32 index11 = getIndex(j, i, index, x, z); - const s32 index21 = getIndex(j, i, index, x + step, z); - const s32 index12 = getIndex(j, i, index, x, z + step); - const s32 index22 = getIndex(j, i, index, x + step, z + step); - - indexBuffer.push_back(index12); - indexBuffer.push_back(index11); - indexBuffer.push_back(index22); - indexBuffer.push_back(index22); - indexBuffer.push_back(index11); - indexBuffer.push_back(index21); - IndicesToRender+=6; - - // increment index position horizontally - x += step; - - // we've hit an edge - if (x >= TerrainData.CalcPatchSize) - { - x = 0; - z += step; - } - } - } - ++index; - } - } - - RenderBuffer->setDirty(EBT_INDEX); - - if (DynamicSelectorUpdate && TriangleSelector) - { - CTerrainTriangleSelector* selector = (CTerrainTriangleSelector*)TriangleSelector; - selector->setTriangleData(this, -1); - } - } - - - //! Render the scene node - void CTerrainSceneNode::render() - { - if (!IsVisible || !SceneManager->getActiveCamera()) - return; - - if (!Mesh->getMeshBufferCount()) - return; - - video::IVideoDriver* driver = SceneManager->getVideoDriver(); - - driver->setTransform (video::ETS_WORLD, core::IdentityMatrix); - driver->setMaterial(Mesh->getMeshBuffer(0)->getMaterial()); - - RenderBuffer->getIndexBuffer().set_used(IndicesToRender); - - // For use with geomorphing - driver->drawMeshBuffer(RenderBuffer); - - RenderBuffer->getIndexBuffer().set_used(RenderBuffer->getIndexBuffer().allocated_size()); - - // for debug purposes only: - if (DebugDataVisible) - { - video::SMaterial m; - m.Lighting = false; - driver->setMaterial(m); - if (DebugDataVisible & scene::EDS_BBOX) - driver->draw3DBox(TerrainData.BoundingBox, video::SColor(255,255,255,255)); - - const s32 count = TerrainData.PatchCount * TerrainData.PatchCount; - s32 visible = 0; - if (DebugDataVisible & scene::EDS_BBOX_BUFFERS) - { - for (s32 j = 0; j < count; ++j) - { - driver->draw3DBox(TerrainData.Patches[j].BoundingBox, video::SColor(255,255,0,0)); - visible += (TerrainData.Patches[j].CurrentLOD >= 0); - } - } - - if (DebugDataVisible & scene::EDS_NORMALS) - { - // draw normals - const f32 debugNormalLength = SceneManager->getParameters()->getAttributeAsFloat(DEBUG_NORMAL_LENGTH); - const video::SColor debugNormalColor = SceneManager->getParameters()->getAttributeAsColor(DEBUG_NORMAL_COLOR); - driver->drawMeshBufferNormals(RenderBuffer, debugNormalLength, debugNormalColor); - } - - driver->setTransform(video::ETS_WORLD, AbsoluteTransformation); - - static u32 lastTime = 0; - - const u32 now = os::Timer::getRealTime(); - if (now - lastTime > 1000) - { - char buf[64]; - snprintf_irr(buf, 64, "Count: %d, Visible: %d", count, visible); - os::Printer::log(buf); - - lastTime = now; - } - } - } - - - //! Return the bounding box of the entire terrain. - const core::aabbox3d<f32>& CTerrainSceneNode::getBoundingBox() const - { - return TerrainData.BoundingBox; - } - - - //! Return the bounding box of a patch - const core::aabbox3d<f32>& CTerrainSceneNode::getBoundingBox(s32 patchX, s32 patchZ) const - { - return TerrainData.Patches[patchX * TerrainData.PatchCount + patchZ].BoundingBox; - } - - - //! Gets the meshbuffer data based on a specified Level of Detail. - //! \param mb: A reference to an SMeshBuffer object - //! \param LOD: The Level Of Detail you want the indices from. - void CTerrainSceneNode::getMeshBufferForLOD(IDynamicMeshBuffer& mb, s32 LOD ) const - { - if (!Mesh->getMeshBufferCount()) - return; - - LOD = core::clamp(LOD, 0, TerrainData.MaxLOD - 1); - - const u32 numVertices = Mesh->getMeshBuffer(0)->getVertexCount(); - mb.getVertexBuffer().reallocate(numVertices); - video::S3DVertex2TCoords* vertices = (video::S3DVertex2TCoords*)Mesh->getMeshBuffer(0)->getVertices(); - - for (u32 n=0; n<numVertices; ++n) - mb.getVertexBuffer().push_back(vertices[n]); - - mb.getIndexBuffer().setType(RenderBuffer->getIndexBuffer().getType()); - - // calculate the step we take for all patches, since LOD is the same - const s32 step = 1 << LOD; - - // Generate the indices for all patches at the specified LOD - s32 index = 0; - for (s32 i=0; i<TerrainData.PatchCount; ++i) - { - for (s32 j=0; j<TerrainData.PatchCount; ++j) - { - s32 x = 0; - s32 z = 0; - - // Loop through patch and generate indices - while (z < TerrainData.CalcPatchSize) - { - const s32 index11 = getIndex(j, i, index, x, z); - const s32 index21 = getIndex(j, i, index, x + step, z); - const s32 index12 = getIndex(j, i, index, x, z + step); - const s32 index22 = getIndex(j, i, index, x + step, z + step); - - mb.getIndexBuffer().push_back(index12); - mb.getIndexBuffer().push_back(index11); - mb.getIndexBuffer().push_back(index22); - mb.getIndexBuffer().push_back(index22); - mb.getIndexBuffer().push_back(index11); - mb.getIndexBuffer().push_back(index21); - - // increment index position horizontally - x += step; - - if (x >= TerrainData.CalcPatchSize) // we've hit an edge - { - x = 0; - z += step; - } - } - ++index; - } - } - } - - - //! Gets the indices for a specified patch at a specified Level of Detail. - //! \param mb: A reference to an array of u32 indices. - //! \param patchX: Patch x coordinate. - //! \param patchZ: Patch z coordinate. - //! \param LOD: The level of detail to get for that patch. If -1, then get - //! the CurrentLOD. If the CurrentLOD is set to -1, meaning it's not shown, - //! then it will retrieve the triangles at the highest LOD (0). - //! \return: Number if indices put into the buffer. - s32 CTerrainSceneNode::getIndicesForPatch(core::array<u32>& indices, s32 patchX, s32 patchZ, s32 LOD) - { - if (patchX < 0 || patchX > TerrainData.PatchCount-1 || - patchZ < 0 || patchZ > TerrainData.PatchCount-1) - return -1; - - if (LOD < -1 || LOD > TerrainData.MaxLOD - 1) - return -1; - - core::array<s32> cLODs; - bool setLODs = false; - - // If LOD of -1 was passed in, use the CurrentLOD of the patch specified - if (LOD == -1) - { - LOD = TerrainData.Patches[patchX * TerrainData.PatchCount + patchZ].CurrentLOD; - } - else - { - getCurrentLODOfPatches(cLODs); - setCurrentLODOfPatches(LOD); - setLODs = true; - } - - if (LOD < 0) - return -2; // Patch not visible, don't generate indices. - - // calculate the step we take for this LOD - const s32 step = 1 << LOD; - - // Generate the indices for the specified patch at the specified LOD - const s32 index = patchX * TerrainData.PatchCount + patchZ; - - s32 x = 0; - s32 z = 0; - - indices.set_used(TerrainData.PatchSize * TerrainData.PatchSize * 6); - - // Loop through patch and generate indices - s32 rv=0; - while (z<TerrainData.CalcPatchSize) - { - const s32 index11 = getIndex(patchZ, patchX, index, x, z); - const s32 index21 = getIndex(patchZ, patchX, index, x + step, z); - const s32 index12 = getIndex(patchZ, patchX, index, x, z + step); - const s32 index22 = getIndex(patchZ, patchX, index, x + step, z + step); - - indices[rv++] = index12; - indices[rv++] = index11; - indices[rv++] = index22; - indices[rv++] = index22; - indices[rv++] = index11; - indices[rv++] = index21; - - // increment index position horizontally - x += step; - - if (x >= TerrainData.CalcPatchSize) // we've hit an edge - { - x = 0; - z += step; - } - } - - if (setLODs) - setCurrentLODOfPatches(cLODs); - - return rv; - } - - - //! Populates an array with the CurrentLOD of each patch. - //! \param LODs: A reference to a core::array<s32> to hold the values - //! \return Returns the number of elements in the array - s32 CTerrainSceneNode::getCurrentLODOfPatches(core::array<s32>& LODs) const - { - s32 numLODs; - LODs.clear(); - - const s32 count = TerrainData.PatchCount * TerrainData.PatchCount; - for (numLODs = 0; numLODs < count; numLODs++) - LODs.push_back(TerrainData.Patches[numLODs].CurrentLOD); - - return LODs.size(); - } - - - //! Manually sets the LOD of a patch - //! \param patchX: Patch x coordinate. - //! \param patchZ: Patch z coordinate. - //! \param LOD: The level of detail to set the patch to. - void CTerrainSceneNode::setLODOfPatch(s32 patchX, s32 patchZ, s32 LOD) - { - TerrainData.Patches[patchX * TerrainData.PatchCount + patchZ].CurrentLOD = LOD; - } - - - //! Override the default generation of distance thresholds for determining the LOD a patch - //! is rendered at. - bool CTerrainSceneNode::overrideLODDistance(s32 LOD, f64 newDistance) - { - OverrideDistanceThreshold = true; - - if (LOD < 0 || LOD > TerrainData.MaxLOD - 1) - return false; - - TerrainData.LODDistanceThreshold[LOD] = newDistance * newDistance; - - return true; - } - - - //! Creates a planar texture mapping on the terrain - //! \param resolution: resolution of the planar mapping. This is the value - //! specifying the relation between world space and texture coordinate space. - void CTerrainSceneNode::scaleTexture(f32 resolution, f32 resolution2) - { - TCoordScale1 = resolution; - TCoordScale2 = resolution2; - - const f32 resBySize = resolution / (f32)(TerrainData.Size-1); - const f32 res2BySize = resolution2 / (f32)(TerrainData.Size-1); - u32 index = 0; - f32 xval = 0.f; - f32 x2val = 0.f; - for (s32 x=0; x<TerrainData.Size; ++x) - { - f32 zval=0.f; - f32 z2val=0.f; - for (s32 z=0; z<TerrainData.Size; ++z) - { - RenderBuffer->getVertexBuffer()[index].TCoords.X = 1.f-xval; - RenderBuffer->getVertexBuffer()[index].TCoords.Y = zval; - - if (RenderBuffer->getVertexType()==video::EVT_2TCOORDS) - { - if (resolution2 == 0) - { - ((video::S3DVertex2TCoords&)RenderBuffer->getVertexBuffer()[index]).TCoords2 = RenderBuffer->getVertexBuffer()[index].TCoords; - } - else - { - ((video::S3DVertex2TCoords&)RenderBuffer->getVertexBuffer()[index]).TCoords2.X = 1.f-x2val; - ((video::S3DVertex2TCoords&)RenderBuffer->getVertexBuffer()[index]).TCoords2.Y = z2val; - } - } - - ++index; - zval += resBySize; - z2val += res2BySize; - } - xval += resBySize; - x2val += res2BySize; - } - - RenderBuffer->setDirty(EBT_VERTEX); - } - - - //! used to get the indices when generating index data for patches at varying levels of detail. - u32 CTerrainSceneNode::getIndex(const s32 PatchX, const s32 PatchZ, - const s32 PatchIndex, u32 vX, u32 vZ) const - { - // top border - if (vZ == 0) - { - if (TerrainData.Patches[PatchIndex].Top && - TerrainData.Patches[PatchIndex].CurrentLOD < TerrainData.Patches[PatchIndex].Top->CurrentLOD && - (vX % (1 << TerrainData.Patches[PatchIndex].Top->CurrentLOD)) != 0 ) - { - vX -= vX % (1 << TerrainData.Patches[PatchIndex].Top->CurrentLOD); - } - } - else - if (vZ == (u32)TerrainData.CalcPatchSize) // bottom border - { - if (TerrainData.Patches[PatchIndex].Bottom && - TerrainData.Patches[PatchIndex].CurrentLOD < TerrainData.Patches[PatchIndex].Bottom->CurrentLOD && - (vX % (1 << TerrainData.Patches[PatchIndex].Bottom->CurrentLOD)) != 0) - { - vX -= vX % (1 << TerrainData.Patches[PatchIndex].Bottom->CurrentLOD); - } - } - - // left border - if (vX == 0) - { - if (TerrainData.Patches[PatchIndex].Left && - TerrainData.Patches[PatchIndex].CurrentLOD < TerrainData.Patches[PatchIndex].Left->CurrentLOD && - (vZ % (1 << TerrainData.Patches[PatchIndex].Left->CurrentLOD)) != 0) - { - vZ -= vZ % (1 << TerrainData.Patches[PatchIndex].Left->CurrentLOD); - } - } - else - if (vX == (u32)TerrainData.CalcPatchSize) // right border - { - if (TerrainData.Patches[PatchIndex].Right && - TerrainData.Patches[PatchIndex].CurrentLOD < TerrainData.Patches[PatchIndex].Right->CurrentLOD && - (vZ % (1 << TerrainData.Patches[PatchIndex].Right->CurrentLOD)) != 0) - { - vZ -= vZ % (1 << TerrainData.Patches[PatchIndex].Right->CurrentLOD); - } - } - - if (vZ >= (u32)TerrainData.PatchSize) - vZ = TerrainData.CalcPatchSize; - - if (vX >= (u32)TerrainData.PatchSize) - vX = TerrainData.CalcPatchSize; - - return (vZ + ((TerrainData.CalcPatchSize) * PatchZ)) * TerrainData.Size + - (vX + ((TerrainData.CalcPatchSize) * PatchX)); - } - - - //! smooth the terrain - void CTerrainSceneNode::smoothTerrain(IDynamicMeshBuffer* mb, s32 smoothFactor) - { - for (s32 run = 0; run < smoothFactor; ++run) - { - s32 yd = TerrainData.Size; - for (s32 y = 1; y < TerrainData.Size - 1; ++y) - { - for (s32 x = 1; x < TerrainData.Size - 1; ++x) - { - mb->getVertexBuffer()[x + yd].Pos.Y = - (mb->getVertexBuffer()[x-1 + yd].Pos.Y + //left - mb->getVertexBuffer()[x+1 + yd].Pos.Y + //right - mb->getVertexBuffer()[x + yd - TerrainData.Size].Pos.Y + //above - mb->getVertexBuffer()[x + yd + TerrainData.Size].Pos.Y) * 0.25f; //below - } - yd += TerrainData.Size; - } - } - } - - - //! calculate smooth normals - void CTerrainSceneNode::calculateNormals(IDynamicMeshBuffer* mb) - { - s32 count; - core::vector3df a, b, c, t; - - for (s32 x=0; x<TerrainData.Size; ++x) - { - for (s32 z=0; z<TerrainData.Size; ++z) - { - count = 0; - core::vector3df normal; - - // top left - if (x>0 && z>0) - { - a = mb->getVertexBuffer()[(x-1)*TerrainData.Size+z-1].Pos; - b = mb->getVertexBuffer()[(x-1)*TerrainData.Size+z].Pos; - c = mb->getVertexBuffer()[x*TerrainData.Size+z].Pos; - b -= a; - c -= a; - t = b.crossProduct(c); - t.normalize(); - normal += t; - - a = mb->getVertexBuffer()[(x-1)*TerrainData.Size+z-1].Pos; - b = mb->getVertexBuffer()[x*TerrainData.Size+z-1].Pos; - c = mb->getVertexBuffer()[x*TerrainData.Size+z].Pos; - b -= a; - c -= a; - t = b.crossProduct(c); - t.normalize(); - normal += t; - - count += 2; - } - - // top right - if (x>0 && z<TerrainData.Size-1) - { - a = mb->getVertexBuffer()[(x-1)*TerrainData.Size+z].Pos; - b = mb->getVertexBuffer()[(x-1)*TerrainData.Size+z+1].Pos; - c = mb->getVertexBuffer()[x*TerrainData.Size+z+1].Pos; - b -= a; - c -= a; - t = b.crossProduct(c); - t.normalize(); - normal += t; - - a = mb->getVertexBuffer()[(x-1)*TerrainData.Size+z].Pos; - b = mb->getVertexBuffer()[x*TerrainData.Size+z+1].Pos; - c = mb->getVertexBuffer()[x*TerrainData.Size+z].Pos; - b -= a; - c -= a; - t = b.crossProduct(c); - t.normalize(); - normal += t; - - count += 2; - } - - // bottom right - if (x<TerrainData.Size-1 && z<TerrainData.Size-1) - { - a = mb->getVertexBuffer()[x*TerrainData.Size+z+1].Pos; - b = mb->getVertexBuffer()[x*TerrainData.Size+z].Pos; - c = mb->getVertexBuffer()[(x+1)*TerrainData.Size+z+1].Pos; - b -= a; - c -= a; - t = b.crossProduct(c); - t.normalize(); - normal += t; - - a = mb->getVertexBuffer()[x*TerrainData.Size+z+1].Pos; - b = mb->getVertexBuffer()[(x+1)*TerrainData.Size+z+1].Pos; - c = mb->getVertexBuffer()[(x+1)*TerrainData.Size+z].Pos; - b -= a; - c -= a; - t = b.crossProduct(c); - t.normalize(); - normal += t; - - count += 2; - } - - // bottom left - if (x<TerrainData.Size-1 && z>0) - { - a = mb->getVertexBuffer()[x*TerrainData.Size+z-1].Pos; - b = mb->getVertexBuffer()[x*TerrainData.Size+z].Pos; - c = mb->getVertexBuffer()[(x+1)*TerrainData.Size+z].Pos; - b -= a; - c -= a; - t = b.crossProduct(c); - t.normalize(); - normal += t; - - a = mb->getVertexBuffer()[x*TerrainData.Size+z-1].Pos; - b = mb->getVertexBuffer()[(x+1)*TerrainData.Size+z].Pos; - c = mb->getVertexBuffer()[(x+1)*TerrainData.Size+z-1].Pos; - b -= a; - c -= a; - t = b.crossProduct(c); - t.normalize(); - normal += t; - - count += 2; - } - - if (count != 0) - { - normal.normalize(); - } - else - { - normal.set(0.0f, 1.0f, 0.0f); - } - - mb->getVertexBuffer()[x * TerrainData.Size + z].Normal = normal; - } - } - } - - - //! create patches, stuff that needs to be done only once for patches goes here. - void CTerrainSceneNode::createPatches() - { - TerrainData.PatchCount = (TerrainData.Size - 1) / (TerrainData.CalcPatchSize); - - if (TerrainData.Patches) - delete [] TerrainData.Patches; - - TerrainData.Patches = new SPatch[TerrainData.PatchCount * TerrainData.PatchCount]; - } - - - //! used to calculate the internal STerrainData structure both at creation and after scaling/position calls. - void CTerrainSceneNode::calculatePatchData() - { - // Reset the Terrains Bounding Box for re-calculation - TerrainData.BoundingBox.reset(RenderBuffer->getPosition(0)); - - for (s32 x = 0; x < TerrainData.PatchCount; ++x) - { - for (s32 z = 0; z < TerrainData.PatchCount; ++z) - { - const s32 index = x * TerrainData.PatchCount + z; - SPatch& patch = TerrainData.Patches[index]; - patch.CurrentLOD = 0; - - const s32 xstart = x*TerrainData.CalcPatchSize; - const s32 xend = xstart+TerrainData.CalcPatchSize; - const s32 zstart = z*TerrainData.CalcPatchSize; - const s32 zend = zstart+TerrainData.CalcPatchSize; - // For each patch, calculate the bounding box (mins and maxes) - patch.BoundingBox.reset(RenderBuffer->getPosition(xstart*TerrainData.Size + zstart)); - - for (s32 xx = xstart; xx <= xend; ++xx) - for (s32 zz = zstart; zz <= zend; ++zz) - patch.BoundingBox.addInternalPoint(RenderBuffer->getVertexBuffer()[xx * TerrainData.Size + zz].Pos); - - // Reconfigure the bounding box of the terrain as a whole - TerrainData.BoundingBox.addInternalBox(patch.BoundingBox); - - // get center of Patch - patch.Center = patch.BoundingBox.getCenter(); - - // Assign Neighbours - // Top - if (x > 0) - patch.Top = &TerrainData.Patches[(x-1) * TerrainData.PatchCount + z]; - else - patch.Top = 0; - - // Bottom - if (x < TerrainData.PatchCount - 1) - patch.Bottom = &TerrainData.Patches[(x+1) * TerrainData.PatchCount + z]; - else - patch.Bottom = 0; - - // Left - if (z > 0) - patch.Left = &TerrainData.Patches[x * TerrainData.PatchCount + z - 1]; - else - patch.Left = 0; - - // Right - if (z < TerrainData.PatchCount - 1) - patch.Right = &TerrainData.Patches[x * TerrainData.PatchCount + z + 1]; - else - patch.Right = 0; - } - } - - // get center of Terrain - TerrainData.Center = TerrainData.BoundingBox.getCenter(); - - // if the default rotation pivot is still being used, update it. - if (UseDefaultRotationPivot) - { - TerrainData.RotationPivot = TerrainData.Center; - } - } - - - //! used to calculate or recalculate the distance thresholds - void CTerrainSceneNode::calculateDistanceThresholds(bool scalechanged) - { - // Only update the LODDistanceThreshold if it's not manually changed - if (!OverrideDistanceThreshold) - { - TerrainData.LODDistanceThreshold.set_used(0); - // Determine new distance threshold for determining what LOD to draw patches at - TerrainData.LODDistanceThreshold.reallocate(TerrainData.MaxLOD); - - const f64 size = TerrainData.PatchSize * TerrainData.PatchSize * - TerrainData.Scale.X * TerrainData.Scale.Z; - for (s32 i=0; i<TerrainData.MaxLOD; ++i) - { - TerrainData.LODDistanceThreshold.push_back(size * ((i+1+ i / 2) * (i+1+ i / 2))); - } - } - } - - - void CTerrainSceneNode::setCurrentLODOfPatches(s32 lod) - { - const s32 count = TerrainData.PatchCount * TerrainData.PatchCount; - for (s32 i=0; i< count; ++i) - TerrainData.Patches[i].CurrentLOD = lod; - } - - - void CTerrainSceneNode::setCurrentLODOfPatches(const core::array<s32>& lodarray) - { - const s32 count = TerrainData.PatchCount * TerrainData.PatchCount; - for (s32 i=0; i<count; ++i) - TerrainData.Patches[i].CurrentLOD = lodarray[i]; - } - - - //! Gets the height - f32 CTerrainSceneNode::getHeight(f32 x, f32 z) const - { - if (!Mesh->getMeshBufferCount()) - return 0; - - core::matrix4 rotMatrix; - rotMatrix.setRotationDegrees(TerrainData.Rotation); - core::vector3df pos(x, 0.0f, z); - rotMatrix.rotateVect(pos); - pos -= TerrainData.Position; - pos /= TerrainData.Scale; - - s32 X(core::floor32(pos.X)); - s32 Z(core::floor32(pos.Z)); - - f32 height = -FLT_MAX; - if (X >= 0 && X < TerrainData.Size-1 && - Z >= 0 && Z < TerrainData.Size-1) - { - const video::S3DVertex2TCoords* Vertices = (const video::S3DVertex2TCoords*)Mesh->getMeshBuffer(0)->getVertices(); - const core::vector3df& a = Vertices[X * TerrainData.Size + Z].Pos; - const core::vector3df& b = Vertices[(X + 1) * TerrainData.Size + Z].Pos; - const core::vector3df& c = Vertices[X * TerrainData.Size + (Z + 1)].Pos; - const core::vector3df& d = Vertices[(X + 1) * TerrainData.Size + (Z + 1)].Pos; - - // offset from integer position - const f32 dx = pos.X - X; - const f32 dz = pos.Z - Z; - - if (dx > dz) - height = a.Y + (d.Y - b.Y)*dz + (b.Y - a.Y)*dx; - else - height = a.Y + (d.Y - c.Y)*dx + (c.Y - a.Y)*dz; - - height *= TerrainData.Scale.Y; - height += TerrainData.Position.Y; - } - - return height; - } - - - //! Writes attributes of the scene node. - void CTerrainSceneNode::serializeAttributes(io::IAttributes* out, - io::SAttributeReadWriteOptions* options) const - { - ISceneNode::serializeAttributes(out, options); - - out->addString("Heightmap", HeightmapFile.c_str()); - out->addFloat("TextureScale1", TCoordScale1); - out->addFloat("TextureScale2", TCoordScale2); - out->addInt("SmoothFactor", SmoothFactor); - } - - - //! Reads attributes of the scene node. - void CTerrainSceneNode::deserializeAttributes(io::IAttributes* in, - io::SAttributeReadWriteOptions* options) - { - io::path newHeightmap = in->getAttributeAsString("Heightmap"); - f32 tcoordScale1 = in->getAttributeAsFloat("TextureScale1"); - f32 tcoordScale2 = in->getAttributeAsFloat("TextureScale2"); - s32 smoothFactor = in->getAttributeAsInt("SmoothFactor"); - - // set possible new heightmap - - if (newHeightmap.size() != 0 && newHeightmap != HeightmapFile) - { - io::IReadFile* file = FileSystem->createAndOpenFile(newHeightmap.c_str()); - if (file) - { - loadHeightMap(file, video::SColor(255,255,255,255), smoothFactor); - file->drop(); - } - else - os::Printer::log("could not open heightmap", newHeightmap.c_str()); - } - - // set possible new scale - - if (core::equals(tcoordScale1, 0.f)) - tcoordScale1 = 1.0f; - - if (core::equals(tcoordScale2, 0.f)) - tcoordScale2 = 1.0f; - - if (!core::equals(tcoordScale1, TCoordScale1) || - !core::equals(tcoordScale2, TCoordScale2)) - { - scaleTexture(tcoordScale1, tcoordScale2); - } - - ISceneNode::deserializeAttributes(in, options); - } - - - //! Creates a clone of this scene node and its children. - ISceneNode* CTerrainSceneNode::clone(ISceneNode* newParent, ISceneManager* newManager) - { - if (!newParent) - newParent = Parent; - if (!newManager) - newManager = SceneManager; - - CTerrainSceneNode* nb = new CTerrainSceneNode( - newParent, newManager, FileSystem, ID, - 4, ETPS_17, getPosition(), getRotation(), getScale()); - - nb->cloneMembers(this, newManager); - - // instead of cloning the data structures, recreate the terrain. - // (temporary solution) - - // load file - - io::IReadFile* file = FileSystem->createAndOpenFile(HeightmapFile.c_str()); - if (file) - { - nb->loadHeightMap(file, video::SColor(255,255,255,255), 0); - file->drop(); - } - - // scale textures - - nb->scaleTexture(TCoordScale1, TCoordScale2); - - // copy materials - - for (unsigned int m = 0; m<Mesh->getMeshBufferCount(); ++m) - { - if (nb->Mesh->getMeshBufferCount()>m && - nb->Mesh->getMeshBuffer(m) && - Mesh->getMeshBuffer(m)) - { - nb->Mesh->getMeshBuffer(m)->getMaterial() = - Mesh->getMeshBuffer(m)->getMaterial(); - } - } - - nb->RenderBuffer->getMaterial() = RenderBuffer->getMaterial(); - - // finish - - if ( newParent ) - nb->drop(); - return nb; - } - -} // end namespace scene -} // end namespace irr - -#endif // _IRR_COMPILE_WITH_TERRAIN_SCENENODE_ diff --git a/source/Irrlicht/CTerrainSceneNode.h b/source/Irrlicht/CTerrainSceneNode.h deleted file mode 100644 index 3e22d69a..00000000 --- a/source/Irrlicht/CTerrainSceneNode.h +++ /dev/null @@ -1,336 +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 - -// The code for the TerrainSceneNode is based on the GeoMipMapSceneNode -// developed by Spintz. He made it available for Irrlicht and allowed it to be -// distributed under this licence. I only modified some parts. A lot of thanks go to him. - -#ifndef __C_TERRAIN_SCENE_NODE_H__ -#define __C_TERRAIN_SCENE_NODE_H__ - -#include "ITerrainSceneNode.h" -#include "IDynamicMeshBuffer.h" -#include "path.h" - -namespace irr -{ -namespace io -{ - class IFileSystem; - class IReadFile; -} -namespace scene -{ - struct SMesh; - class ITextSceneNode; - - //! A scene node for displaying terrain using the geo mip map algorithm. - class CTerrainSceneNode : public ITerrainSceneNode - { - public: - - //! constructor - //! \param parent: The node which this node is a child of. Making this node a child of another node, or - //! making it a parent of another node is yet untested and most likely does not work properly. - //! \param mgr: Pointer to the scene manager. - //! \param id: The id of the node - //! \param maxLOD: The maximum LOD ( Level of Detail ) for the node. - //! \param patchSize: An E_GEOMIPMAP_PATCH_SIZE enumeration defining the size of each patch of the terrain. - //! \param position: The absolute position of this node. - //! \param rotation: The absolute rotation of this node. ( NOT YET IMPLEMENTED ) - //! \param scale: The scale factor for the terrain. If you're using a heightmap of size 128x128 and would like - //! your terrain to be 12800x12800 in game units, then use a scale factor of ( core::vector ( 100.0f, 100.0f, 100.0f ). - //! If you use a Y scaling factor of 0.0f, then your terrain will be flat. - CTerrainSceneNode(ISceneNode* parent, ISceneManager* mgr, io::IFileSystem* fs, s32 id, - s32 maxLOD = 4, E_TERRAIN_PATCH_SIZE patchSize = ETPS_17, - const core::vector3df& position = core::vector3df(0.0f, 0.0f, 0.0f), - const core::vector3df& rotation = core::vector3df(0.0f, 0.0f, 0.0f), - const core::vector3df& scale = core::vector3df(1.0f, 1.0f, 1.0f)); - - virtual ~CTerrainSceneNode(); - - //! Initializes the terrain data. Loads the vertices from the heightMapFile. - virtual bool loadHeightMap(io::IReadFile* file, - video::SColor vertexColor = video::SColor ( 255, 255, 255, 255 ), s32 smoothFactor = 0 ) _IRR_OVERRIDE_; - - //! Initializes the terrain data. Loads the vertices from the heightMapFile. - virtual bool loadHeightMapRAW(io::IReadFile* file, s32 bitsPerPixel = 16, - bool signedData=true, bool floatVals=false, s32 width=0, - video::SColor vertexColor = video::SColor ( 255, 255, 255, 255 ), s32 smoothFactor = 0 ) _IRR_OVERRIDE_; - - //! Returns the material based on the zero based index i. This scene node only uses - //! 1 material. - //! \param i: Zero based index i. UNUSED, left in for virtual purposes. - //! \return Returns the single material this scene node uses. - virtual video::SMaterial& getMaterial(u32 i) _IRR_OVERRIDE_; - - //! Returns amount of materials used by this scene node ( always 1 ) - //! \return Returns current count of materials used by this scene node ( always 1 ) - virtual u32 getMaterialCount() const _IRR_OVERRIDE_; - - //! Gets the last scaling factor applied to the scene node. This value only represents the - //! last scaling factor presented to the node. For instance, if you make create the node - //! with a scale factor of ( 1.0f, 1.0f, 1.0f ) then call setScale ( 50.0f, 5.0f, 50.0f ), - //! then make another call to setScale with the values ( 2.0f, 2.0f, 2.0f ), this will return - //! core::vector3df ( 2.0f, 2.0f, 2.0f ), although the total scaling of the scene node is - //! core::vector3df ( 100.0f, 10.0f, 100.0f ). - //! \return Returns the last scaling factor passed to the scene node. - virtual const core::vector3df& getScale() const _IRR_OVERRIDE_ - { - return TerrainData.Scale; - } - - //! Scales the scene nodes vertices by the vector specified. - //! \param scale: Scaling factor to apply to the node. - virtual void setScale(const core::vector3df& scale) _IRR_OVERRIDE_; - - //! Gets the last rotation factor applied to the scene node. - //! \return Returns the last rotation factor applied to the scene node. - virtual const core::vector3df& getRotation() const _IRR_OVERRIDE_ - { - return TerrainData.Rotation; - } - - //! Rotates the node. This only modifies the relative rotation of the node. - //! \param rotation: New rotation of the node in degrees. - virtual void setRotation(const core::vector3df& rotation) _IRR_OVERRIDE_; - - //! Sets the pivot point for rotation of this node. - //! NOTE: The default for the RotationPivot will be the center of the individual tile. - virtual void setRotationPivot( const core::vector3df& pivot ); - - //! Gets the last positioning vector applied to the scene node. - //! \return Returns the last position vector applied to the scene node. - virtual const core::vector3df& getPosition() const _IRR_OVERRIDE_ - { - return TerrainData.Position; - } - - //! Moves the scene nodes vertices by the vector specified. - //! \param newpos: Vector specifying how much to move each vertex of the scene node. - virtual void setPosition(const core::vector3df& newpos) _IRR_OVERRIDE_; - - //! Updates the scene nodes indices if the camera has moved or rotated by a certain - //! threshold, which can be changed using the SetCameraMovementDeltaThreshold and - //! SetCameraRotationDeltaThreshold functions. This also determines if a given patch - //! for the scene node is within the view frustum and if it's not the indices are not - //! generated for that patch. - virtual void OnRegisterSceneNode() _IRR_OVERRIDE_; - - //! Render the scene node - virtual void render() _IRR_OVERRIDE_; - - //! Return the bounding box of the entire terrain. - virtual const core::aabbox3d<f32>& getBoundingBox() const _IRR_OVERRIDE_; - - //! Return the bounding box of a patch - virtual const core::aabbox3d<f32>& getBoundingBox(s32 patchX, s32 patchZ) const _IRR_OVERRIDE_; - - //! Return the number of indices currently used to draw the scene node. - virtual u32 getIndexCount() const _IRR_OVERRIDE_ { return IndicesToRender; } - - //! Returns the mesh - virtual IMesh* getMesh() _IRR_OVERRIDE_; - - //! Returns a pointer to the buffer used by the terrain (most users will not need this) - virtual IMeshBuffer* getRenderBuffer() _IRR_OVERRIDE_ { return RenderBuffer; } - - //! Gets the meshbuffer data based on a specified Level of Detail. - //! \param mb: A reference to an IDynamicMeshBuffer object - //! \param LOD: The Level Of Detail you want the indices from. - virtual void getMeshBufferForLOD(IDynamicMeshBuffer& mb, s32 LOD=0) const _IRR_OVERRIDE_; - - //! Gets the indices for a specified patch at a specified Level of Detail. - //! \param indices: A reference to an array of u32 indices. - //! \param patchX: Patch x coordinate. - //! \param patchZ: Patch z coordinate. - //! \param LOD: The level of detail to get for that patch. If -1, then get - //! the CurrentLOD. If the CurrentLOD is set to -1, meaning it's not shown, - //! then it will retrieve the triangles at the highest LOD (0). - //! \return: Number of indices put into the buffer. - virtual s32 getIndicesForPatch(core::array<u32>& indices, - s32 patchX, s32 patchZ, s32 LOD=0) _IRR_OVERRIDE_; - - //! Populates an array with the CurrentLOD of each patch. - //! \param LODs: A reference to a core::array<s32> to hold the values - //! \return Returns the number of elements in the array - virtual s32 getCurrentLODOfPatches(core::array<s32>& LODs) const _IRR_OVERRIDE_; - - //! Manually sets the LOD of a patch - //! \param patchX: Patch x coordinate. - //! \param patchZ: Patch z coordinate. - //! \param LOD: The level of detail to set the patch to. - virtual void setLODOfPatch(s32 patchX, s32 patchZ, s32 LOD=0) _IRR_OVERRIDE_; - - //! Returns center of terrain. - virtual const core::vector3df& getTerrainCenter() const _IRR_OVERRIDE_ - { - return TerrainData.Center; - } - - //! Returns center of terrain. - virtual f32 getHeight( f32 x, f32 y ) const _IRR_OVERRIDE_; - - //! Sets the movement camera threshold which is used to determine when to recalculate - //! indices for the scene node. The default value is 10.0f. - virtual void setCameraMovementDelta(f32 delta) _IRR_OVERRIDE_ - { - CameraMovementDelta = delta; - } - - //! Sets the rotation camera threshold which is used to determine when to recalculate - //! indices for the scene node. The default value is 1.0f. - virtual void setCameraRotationDelta(f32 delta) _IRR_OVERRIDE_ - { - CameraRotationDelta = delta; - } - - //! Sets whether or not the node should dynamically update it its associated selector when - //! the geomipmap data changes. - //! param bVal: Boolean value representing whether or not to update selector dynamically. - //! NOTE: Temporarily disabled while working out issues with DynamicSelectorUpdate - virtual void setDynamicSelectorUpdate(bool bVal ) _IRR_OVERRIDE_ { DynamicSelectorUpdate = false; } - - //! Override the default generation of distance thresholds for determining the LOD a patch - //! is rendered at. If any LOD is overridden, then the scene node will no longer apply - //! scaling factors to these values. If you override these distances and then apply - //! a scale to the scene node, it is your responsibility to update the new distances to - //! work best with your new terrain size. - virtual bool overrideLODDistance( s32 LOD, f64 newDistance ) _IRR_OVERRIDE_; - - //! Scales the two textures - virtual void scaleTexture(f32 scale = 1.0f, f32 scale2 = 0.0f) _IRR_OVERRIDE_; - - //! Force node to use a fixed LOD level at the borders of the terrain. - virtual void setFixedBorderLOD(irr::s32 borderLOD) _IRR_OVERRIDE_ - { - FixedBorderLOD = borderLOD; - } - - //! Returns type of the scene node - virtual ESCENE_NODE_TYPE getType() const _IRR_OVERRIDE_ {return ESNT_TERRAIN;} - - //! Writes attributes of the scene node. - virtual void serializeAttributes(io::IAttributes* out, - io::SAttributeReadWriteOptions* options=0) const _IRR_OVERRIDE_; - - //! Reads attributes of the scene node. - virtual void deserializeAttributes(io::IAttributes* in, - io::SAttributeReadWriteOptions* options=0) _IRR_OVERRIDE_; - - //! Creates a clone of this scene node and its children. - virtual ISceneNode* clone(ISceneNode* newParent, - ISceneManager* newManager) _IRR_OVERRIDE_; - - private: - friend class CTerrainTriangleSelector; - - struct SPatch - { - SPatch() - : Top(0), Bottom(0), Right(0), Left(0), CurrentLOD(-1) - { - } - - SPatch* Top; - SPatch* Bottom; - SPatch* Right; - SPatch* Left; - s32 CurrentLOD; - core::aabbox3df BoundingBox; - core::vector3df Center; - }; - - struct STerrainData - { - STerrainData(s32 patchSize, s32 maxLOD, const core::vector3df& position, const core::vector3df& rotation, const core::vector3df& scale) - : Patches(0), Size(0), Position(position), Rotation(rotation), - Scale(scale), PatchSize(patchSize), CalcPatchSize(patchSize-1), - PatchCount(0), MaxLOD(maxLOD) - { - } - - SPatch* Patches; - s32 Size; - core::vector3df Position; - core::vector3df Rotation; - core::vector3df RotationPivot; - core::vector3df Scale; - core::vector3df Center; - s32 PatchSize; - s32 CalcPatchSize; - s32 PatchCount; - s32 MaxLOD; - core::aabbox3df BoundingBox; - core::array<f64> LODDistanceThreshold; - }; - - void preRenderCalculationsIfNeeded(); - void preRenderLODCalculations(); - void preRenderIndicesCalculations(); - - //! get indices when generating index data for patches at varying levels of detail. - u32 getIndex(const s32 PatchX, const s32 PatchZ, const s32 PatchIndex, u32 vX, u32 vZ) const; - - //! smooth the terrain - void smoothTerrain(IDynamicMeshBuffer* mb, s32 smoothFactor); - - //! calculate smooth normals - void calculateNormals(IDynamicMeshBuffer* mb); - - //! create patches, stuff that needs to only be done once for patches goes here. - void createPatches(); - - //! calculate the internal STerrainData structure - void calculatePatchData(); - - //! calculate or recalculate the distance thresholds - void calculateDistanceThresholds(bool scalechanged = false); - - //! sets the CurrentLOD of all patches to the specified LOD - void setCurrentLODOfPatches(s32 i); - - //! sets the CurrentLOD of TerrainData patches to the LODs specified in the array - void setCurrentLODOfPatches(const core::array<s32>& lodarray); - - //! Apply transformation changes( scale, position, rotation ) - void applyTransformation(); - - STerrainData TerrainData; - SMesh* Mesh; - - IDynamicMeshBuffer *RenderBuffer; - - u32 VerticesToRender; - u32 IndicesToRender; - - bool DynamicSelectorUpdate; - bool OverrideDistanceThreshold; - bool UseDefaultRotationPivot; - bool ForceRecalculation; - s32 FixedBorderLOD; - - core::vector3df OldCameraPosition; - core::vector3df OldCameraRotation; - core::vector3df OldCameraUp; - f32 OldCameraFOV; - f32 CameraMovementDelta; - f32 CameraRotationDelta; - f32 CameraFOVDelta; - - // needed for (de)serialization - f32 TCoordScale1; - f32 TCoordScale2; - s32 SmoothFactor; - io::path HeightmapFile; - io::IFileSystem* FileSystem; - }; - - -} // end namespace scene -} // end namespace irr - -#endif // __C_TERRAIN_SCENE_NODE_H__ - - diff --git a/source/Irrlicht/CTerrainTriangleSelector.cpp b/source/Irrlicht/CTerrainTriangleSelector.cpp deleted file mode 100644 index db544d40..00000000 --- a/source/Irrlicht/CTerrainTriangleSelector.cpp +++ /dev/null @@ -1,271 +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_TERRAIN_SCENENODE_ - -#include "CTerrainTriangleSelector.h" -#include "CTerrainSceneNode.h" -#include "os.h" - -namespace irr -{ -namespace scene -{ - - -//! constructor -CTerrainTriangleSelector::CTerrainTriangleSelector ( ITerrainSceneNode* node, s32 LOD ) - : SceneNode(node) -{ - #ifdef _DEBUG - setDebugName ("CTerrainTriangleSelector"); - #endif - - setTriangleData(node, LOD); -} - - -//! destructor -CTerrainTriangleSelector::~CTerrainTriangleSelector() -{ - TrianglePatches.TrianglePatchArray.clear(); -} - - -//! Clears and sets triangle data -void CTerrainTriangleSelector::setTriangleData(ITerrainSceneNode* node, s32 LOD) -{ - // Get pointer to the GeoMipMaps vertices - const video::S3DVertex2TCoords* vertices = static_cast<const video::S3DVertex2TCoords*>(node->getRenderBuffer()->getVertices()); - - // Clear current data - const s32 count = (static_cast<CTerrainSceneNode*>(node))->TerrainData.PatchCount; - TrianglePatches.TotalTriangles = 0; - TrianglePatches.NumPatches = count*count; - - TrianglePatches.TrianglePatchArray.reallocate(TrianglePatches.NumPatches); - for (s32 o=0; o<TrianglePatches.NumPatches; ++o) - TrianglePatches.TrianglePatchArray.push_back(SGeoMipMapTrianglePatch()); - - core::triangle3df tri; - core::array<u32> indices; - s32 tIndex = 0; - for(s32 x = 0; x < count; ++x ) - { - for(s32 z = 0; z < count; ++z ) - { - TrianglePatches.TrianglePatchArray[tIndex].NumTriangles = 0; - TrianglePatches.TrianglePatchArray[tIndex].Box = node->getBoundingBox( x, z ); - u32 indexCount = node->getIndicesForPatch( indices, x, z, LOD ); - - TrianglePatches.TrianglePatchArray[tIndex].Triangles.reallocate(indexCount/3); - for(u32 i = 0; i < indexCount; i += 3 ) - { - tri.pointA = vertices[indices[i+0]].Pos; - tri.pointB = vertices[indices[i+1]].Pos; - tri.pointC = vertices[indices[i+2]].Pos; - TrianglePatches.TrianglePatchArray[tIndex].Triangles.push_back(tri); - ++TrianglePatches.TrianglePatchArray[tIndex].NumTriangles; - } - - TrianglePatches.TotalTriangles += TrianglePatches.TrianglePatchArray[tIndex].NumTriangles; - ++tIndex; - } - } -} - - -//! Gets all triangles. -void CTerrainTriangleSelector::getTriangles(core::triangle3df* triangles, - s32 arraySize, s32& outTriangleCount, - const core::matrix4* transform, bool useNodeTransform, - irr::core::array<SCollisionTriangleRange>* outTriangleInfo) const -{ - s32 count = TrianglePatches.TotalTriangles; - - if (count > arraySize) - count = arraySize; - - core::matrix4 mat; - - if (transform) - mat = (*transform); - - s32 tIndex = 0; - - for (s32 i=0; i<TrianglePatches.NumPatches; ++i) - { - if (tIndex + TrianglePatches.TrianglePatchArray[i].NumTriangles <= count) - for (s32 j=0; j<TrianglePatches.TrianglePatchArray[i].NumTriangles; ++j) - { - triangles[tIndex] = TrianglePatches.TrianglePatchArray[i].Triangles[j]; - - mat.transformVect(triangles[tIndex].pointA); - mat.transformVect(triangles[tIndex].pointB); - mat.transformVect(triangles[tIndex].pointC); - - ++tIndex; - } - } - - if ( outTriangleInfo ) - { - SCollisionTriangleRange triRange; - triRange.RangeSize = tIndex; - triRange.Selector = const_cast<CTerrainTriangleSelector*>(this); - triRange.SceneNode = SceneNode; - outTriangleInfo->push_back(triRange); - } - - outTriangleCount = tIndex; -} - - -//! Gets all triangles which lie within a specific bounding box. -void CTerrainTriangleSelector::getTriangles(core::triangle3df* triangles, - s32 arraySize, s32& outTriangleCount, - const core::aabbox3d<f32>& box, - const core::matrix4* transform, bool useNodeTransform, - irr::core::array<SCollisionTriangleRange>* outTriangleInfo) const -{ - s32 count = TrianglePatches.TotalTriangles; - - if (count > arraySize) - count = arraySize; - - core::matrix4 mat; - - if (transform) - mat = (*transform); - - s32 tIndex = 0; - - for (s32 i=0; i<TrianglePatches.NumPatches; ++i) - { - if (tIndex + TrianglePatches.TrianglePatchArray[i].NumTriangles <= count && - TrianglePatches.TrianglePatchArray[i].Box.intersectsWithBox(box)) - for (s32 j=0; j<TrianglePatches.TrianglePatchArray[i].NumTriangles; ++j) - { - triangles[tIndex] = TrianglePatches.TrianglePatchArray[i].Triangles[j]; - - mat.transformVect(triangles[tIndex].pointA); - mat.transformVect(triangles[tIndex].pointB); - mat.transformVect(triangles[tIndex].pointC); - - ++tIndex; - } - } - - if ( outTriangleInfo ) - { - SCollisionTriangleRange triRange; - triRange.RangeSize = tIndex; - triRange.Selector = const_cast<CTerrainTriangleSelector*>(this); - triRange.SceneNode = SceneNode; - outTriangleInfo->push_back(triRange); - } - - outTriangleCount = tIndex; -} - - -//! Gets all triangles which have or may have contact with a 3d line. -void CTerrainTriangleSelector::getTriangles(core::triangle3df* triangles, - s32 arraySize, s32& outTriangleCount, const core::line3d<f32>& line, - const core::matrix4* transform, bool useNodeTransform, - irr::core::array<SCollisionTriangleRange>* outTriangleInfo) const -{ - const s32 count = core::min_((s32)TrianglePatches.TotalTriangles, arraySize); - - core::matrix4 mat; - - if (transform) - mat = (*transform); - - s32 tIndex = 0; - - for (s32 i=0; i<TrianglePatches.NumPatches; ++i) - { - if (tIndex + TrianglePatches.TrianglePatchArray[i].NumTriangles <= count - && TrianglePatches.TrianglePatchArray[i].Box.intersectsWithLine(line)) - { - for (s32 j=0; j<TrianglePatches.TrianglePatchArray[i].NumTriangles; ++j) - { - triangles[tIndex] = TrianglePatches.TrianglePatchArray[i].Triangles[j]; - - mat.transformVect(triangles[tIndex].pointA); - mat.transformVect(triangles[tIndex].pointB); - mat.transformVect(triangles[tIndex].pointC); - - ++tIndex; - } - } - } - - if ( outTriangleInfo ) - { - SCollisionTriangleRange triRange; - triRange.RangeSize = tIndex; - triRange.Selector = const_cast<CTerrainTriangleSelector*>(this); - triRange.SceneNode = SceneNode; - outTriangleInfo->push_back(triRange); - } - - outTriangleCount = tIndex; -} - - -//! Returns amount of all available triangles in this selector -s32 CTerrainTriangleSelector::getTriangleCount() const -{ - return TrianglePatches.TotalTriangles; -} - - -ISceneNode* CTerrainTriangleSelector::getSceneNodeForTriangle( - u32 triangleIndex) const -{ - return SceneNode; -} - - -/* Get the number of TriangleSelectors that are part of this one. -Only useful for MetaTriangleSelector others return 1 -*/ -u32 CTerrainTriangleSelector::getSelectorCount() const -{ - return 1; -} - - -/* Get the TriangleSelector based on index based on getSelectorCount. -Only useful for MetaTriangleSelector others return 'this' or 0 -*/ -ITriangleSelector* CTerrainTriangleSelector::getSelector(u32 index) -{ - if (index) - return 0; - else - return this; -} - - -/* Get the TriangleSelector based on index based on getSelectorCount. -Only useful for MetaTriangleSelector others return 'this' or 0 -*/ -const ITriangleSelector* CTerrainTriangleSelector::getSelector(u32 index) const -{ - if (index) - return 0; - else - return this; -} - - -} // end namespace scene -} // end namespace irr - -#endif // _IRR_COMPILE_WITH_TERRAIN_SCENENODE_ diff --git a/source/Irrlicht/CTerrainTriangleSelector.h b/source/Irrlicht/CTerrainTriangleSelector.h deleted file mode 100644 index eee29772..00000000 --- a/source/Irrlicht/CTerrainTriangleSelector.h +++ /dev/null @@ -1,103 +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 - -// The code for the TerrainTriangleSelector is based on the GeoMipMapSelector -// developed by Spintz. He made it available for Irrlicht and allowed it to be -// distributed under this licence. I only modified some parts. A lot of thanks go to him. - -#ifndef __C_TERRAIN_TRIANGLE_SELECTOR_H__ -#define __C_TERRAIN_TRIANGLE_SELECTOR_H__ - -#include "ITriangleSelector.h" -#include "irrArray.h" - -namespace irr -{ -namespace scene -{ - -class ITerrainSceneNode; - -//! Triangle Selector for the TerrainSceneNode -/** The code for the TerrainTriangleSelector is based on the GeoMipMapSelector -developed by Spintz. He made it available for Irrlicht and allowed it to be -distributed under this license. I only modified some parts. A lot of thanks go -to him. -*/ -class CTerrainTriangleSelector : public ITriangleSelector -{ -public: - - //! Constructs a selector based on an ITerrainSceneNode - CTerrainTriangleSelector(ITerrainSceneNode* node, s32 LOD); - - //! Destructor - virtual ~CTerrainTriangleSelector(); - - //! Clears and sets triangle data - virtual void setTriangleData(ITerrainSceneNode* node, s32 LOD); - - //! Gets all triangles. - void getTriangles(core::triangle3df* triangles, s32 arraySize, s32& outTriangleCount, - const core::matrix4* transform, bool useNodeTransform, - irr::core::array<SCollisionTriangleRange>* outTriangleInfo) const _IRR_OVERRIDE_; - - //! Gets all triangles which lie within a specific bounding box. - void getTriangles(core::triangle3df* triangles, s32 arraySize, s32& outTriangleCount, - const core::aabbox3d<f32>& box, const core::matrix4* transform, bool useNodeTransform, - irr::core::array<SCollisionTriangleRange>* outTriangleInfo) const _IRR_OVERRIDE_; - - //! Gets all triangles which have or may have contact with a 3d line. - virtual void getTriangles(core::triangle3df* triangles, s32 arraySize, - s32& outTriangleCount, const core::line3d<f32>& line, - const core::matrix4* transform, bool useNodeTransform, - irr::core::array<SCollisionTriangleRange>* outTriangleInfo) const _IRR_OVERRIDE_; - - //! Returns amount of all available triangles in this selector - virtual s32 getTriangleCount() const _IRR_OVERRIDE_; - - //! Return the scene node associated with a given triangle. - virtual ISceneNode* getSceneNodeForTriangle(u32 triangleIndex) const _IRR_OVERRIDE_; - - // Get the number of TriangleSelectors that are part of this one - virtual u32 getSelectorCount() const _IRR_OVERRIDE_; - - // Get the TriangleSelector based on index based on getSelectorCount - virtual ITriangleSelector* getSelector(u32 index) _IRR_OVERRIDE_; - - // Get the TriangleSelector based on index based on getSelectorCount - virtual const ITriangleSelector* getSelector(u32 index) const _IRR_OVERRIDE_; - -private: - - friend class CTerrainSceneNode; - - struct SGeoMipMapTrianglePatch - { - core::array<core::triangle3df> Triangles; - s32 NumTriangles; - core::aabbox3df Box; - }; - - struct SGeoMipMapTrianglePatches - { - SGeoMipMapTrianglePatches() : - NumPatches(0), TotalTriangles(0) - { - } - - core::array<SGeoMipMapTrianglePatch> TrianglePatchArray; - s32 NumPatches; - u32 TotalTriangles; - }; - - ITerrainSceneNode* SceneNode; - SGeoMipMapTrianglePatches TrianglePatches; -}; - -} // end namespace scene -} // end namespace irr - - -#endif // __C_TERRAIN_TRIANGLE_SELECTOR_H__ diff --git a/source/Irrlicht/CTextSceneNode.cpp b/source/Irrlicht/CTextSceneNode.cpp deleted file mode 100644 index 131c9184..00000000 --- a/source/Irrlicht/CTextSceneNode.cpp +++ /dev/null @@ -1,521 +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 "CTextSceneNode.h" -#include "ISceneManager.h" -#include "IVideoDriver.h" -#include "ICameraSceneNode.h" -#include "IGUISpriteBank.h" -#include "SMeshBuffer.h" -#include "os.h" - - -namespace irr -{ -namespace scene -{ - - -//! constructor -CTextSceneNode::CTextSceneNode(ISceneNode* parent, ISceneManager* mgr, s32 id, - gui::IGUIFont* font, scene::ISceneCollisionManager* coll, - const core::vector3df& position, const wchar_t* text, - video::SColor color) - : ITextSceneNode(parent, mgr, id, position), Text(text), Color(color), - Font(font), Coll(coll) - -{ - #ifdef _DEBUG - setDebugName("CTextSceneNode"); - #endif - - if (Font) - Font->grab(); - - setAutomaticCulling(scene::EAC_OFF); -} - -//! destructor -CTextSceneNode::~CTextSceneNode() -{ - if (Font) - Font->drop(); -} - -void CTextSceneNode::OnRegisterSceneNode() -{ - if (IsVisible) - SceneManager->registerNodeForRendering(this, ESNRP_TRANSPARENT); - - ISceneNode::OnRegisterSceneNode(); -} - -//! renders the node. -void CTextSceneNode::render() -{ - if (!Font || !Coll) - return; - - core::position2d<s32> pos = Coll->getScreenCoordinatesFrom3DPosition(getAbsolutePosition(), - SceneManager->getActiveCamera()); - - core::rect<s32> r(pos, core::dimension2d<s32>(1,1)); - Font->draw(Text, r, Color, true, true); -} - - -//! returns the axis aligned bounding box of this node -const core::aabbox3d<f32>& CTextSceneNode::getBoundingBox() const -{ - return Box; -} - -//! sets the text string -void CTextSceneNode::setText(const wchar_t* text) -{ - Text = text; -} - -//! get the text string -const wchar_t* CTextSceneNode::getText() const -{ - return Text.c_str(); -} - -//! sets the color of the text -void CTextSceneNode::setTextColor(video::SColor color) -{ - Color = color; -} - -//! get the color of the text -video::SColor CTextSceneNode::getTextColor() const -{ - return Color; -} - -void CTextSceneNode::setFont(gui::IGUIFont* font) -{ - if ( font != Font ) - { - if ( font ) - font->grab(); - if ( Font ) - Font->drop(); - Font = font; - } -} - -//! Get the font used to draw the text -gui::IGUIFont* CTextSceneNode::getFont() const -{ - return Font; -} - - -//!--------------------------------- CBillboardTextSceneNode ---------------------------------------------- - - -//! constructor -CBillboardTextSceneNode::CBillboardTextSceneNode(ISceneNode* parent, ISceneManager* mgr, s32 id, - gui::IGUIFont* font,const wchar_t* text, - const core::vector3df& position, const core::dimension2d<f32>& size, - video::SColor colorTop,video::SColor shade_bottom ) -: IBillboardTextSceneNode(parent, mgr, id, position), - Font(0), ColorTop(colorTop), ColorBottom(shade_bottom), Mesh(0) -{ - #ifdef _DEBUG - setDebugName("CBillboardTextSceneNode"); - #endif - - Material.MaterialType = video::EMT_TRANSPARENT_ALPHA_CHANNEL; - Material.MaterialTypeParam = 1.f / 255.f; - Material.BackfaceCulling = false; - Material.Lighting = false; - Material.ZBuffer = video::ECFN_LESSEQUAL; - Material.ZWriteEnable = video::EZW_OFF; - - if (font) - { - // doesn't support other font types - if (font->getType() == gui::EGFT_BITMAP) - { - Font = (gui::IGUIFontBitmap*)font; - Font->grab(); - - // mesh with one buffer per texture - Mesh = new SMesh(); - for (u32 i=0; i<Font->getSpriteBank()->getTextureCount(); ++i) - { - SMeshBuffer *mb = new SMeshBuffer(); - mb->Material = Material; - mb->Material.setTexture(0, Font->getSpriteBank()->getTexture(i)); - Mesh->addMeshBuffer(mb); - mb->drop(); - } - } - else - { - os::Printer::log("Sorry, CBillboardTextSceneNode does not support this font type", ELL_INFORMATION); - } - } - - setText(text); - setSize(size); - - setAutomaticCulling ( scene::EAC_BOX ); -} - - - -CBillboardTextSceneNode::~CBillboardTextSceneNode() -{ - if (Font) - Font->drop(); - - if (Mesh) - Mesh->drop(); - -} - - -//! sets the text string -void CBillboardTextSceneNode::setText(const wchar_t* text) -{ - if ( !Mesh ) - return; - - Text = text; - - Symbol.clear(); - - // clear mesh - for (u32 j=0; j < Mesh->getMeshBufferCount(); ++j) - { - ((SMeshBuffer*)Mesh->getMeshBuffer(j))->Indices.clear(); - ((SMeshBuffer*)Mesh->getMeshBuffer(j))->Vertices.clear(); - } - - if (!Font) - return; - - const core::array< core::rect<s32> > &sourceRects = Font->getSpriteBank()->getPositions(); - const core::array< gui::SGUISprite > &sprites = Font->getSpriteBank()->getSprites(); - - f32 dim[2]; - f32 tex[4]; - - u32 i; - for ( i = 0; i != Text.size (); ++i ) - { - SSymbolInfo info; - - u32 spriteno = Font->getSpriteNoFromChar( &text[i] ); - u32 rectno = sprites[spriteno].Frames[0].rectNumber; - u32 texno = sprites[spriteno].Frames[0].textureNumber; - - dim[0] = core::reciprocal ( (f32) Font->getSpriteBank()->getTexture(texno)->getSize().Width ); - dim[1] = core::reciprocal ( (f32) Font->getSpriteBank()->getTexture(texno)->getSize().Height ); - - const core::rect<s32>& s = sourceRects[rectno]; - - // add space for letter to buffer - SMeshBuffer* buf = (SMeshBuffer*)Mesh->getMeshBuffer(texno); - u32 firstInd = buf->Indices.size(); - u32 firstVert = buf->Vertices.size(); - buf->Indices.set_used(firstInd + 6); - buf->Vertices.set_used(firstVert + 4); - - tex[0] = (s.LowerRightCorner.X * dim[0]) + 0.5f*dim[0]; // half pixel - tex[1] = (s.LowerRightCorner.Y * dim[1]) + 0.5f*dim[1]; - tex[2] = (s.UpperLeftCorner.Y * dim[1]) - 0.5f*dim[1]; - tex[3] = (s.UpperLeftCorner.X * dim[0]) - 0.5f*dim[0]; - - buf->Vertices[firstVert+0].TCoords.set(tex[0], tex[1]); - buf->Vertices[firstVert+1].TCoords.set(tex[0], tex[2]); - buf->Vertices[firstVert+2].TCoords.set(tex[3], tex[2]); - buf->Vertices[firstVert+3].TCoords.set(tex[3], tex[1]); - - buf->Vertices[firstVert+0].Color = ColorBottom; - buf->Vertices[firstVert+3].Color = ColorBottom; - buf->Vertices[firstVert+1].Color = ColorTop; - buf->Vertices[firstVert+2].Color = ColorTop; - - buf->Indices[firstInd+0] = (u16)firstVert+0; - buf->Indices[firstInd+1] = (u16)firstVert+2; - buf->Indices[firstInd+2] = (u16)firstVert+1; - buf->Indices[firstInd+3] = (u16)firstVert+0; - buf->Indices[firstInd+4] = (u16)firstVert+3; - buf->Indices[firstInd+5] = (u16)firstVert+2; - - wchar_t *tp = 0; - if (i>0) - tp = &Text[i-1]; - - info.Width = (f32)s.getWidth(); - info.bufNo = texno; - info.Kerning = (f32)Font->getKerningWidth(&Text[i], tp); - info.firstInd = firstInd; - info.firstVert = firstVert; - - Symbol.push_back(info); - } -} - -//! get the text string -const wchar_t* CBillboardTextSceneNode::getText() const -{ - return Text.c_str(); -} - -//! pre render event -void CBillboardTextSceneNode::OnAnimate(u32 timeMs) -{ - ISceneNode::OnAnimate(timeMs); - - if (!IsVisible || !Font || !Mesh) - return; - - ICameraSceneNode* camera = SceneManager->getActiveCamera(); - if (!camera) - return; - - // TODO: Risky - if camera is later in the scene-graph then it's not yet updated here - // CBillBoardSceneNode does it different, but maybe real solution would be to enforce cameras to update earlier? - // Maybe we can also unify the code by using a common base-class or having updateMesh functionality in an animator instead. - updateMesh(camera); - - // mesh uses vertices with absolute coordinates so to get a bbox for culling we have to get back to local ones. - BBox = Mesh->getBoundingBox(); - core::matrix4 mat( getAbsoluteTransformation(), core::matrix4::EM4CONST_INVERSE ); - mat.transformBoxEx(BBox); -} - -const core::aabbox3d<f32>& CBillboardTextSceneNode::getTransformedBillboardBoundingBox(const irr::scene::ICameraSceneNode* camera) -{ - updateMesh(camera); - return Mesh->getBoundingBox(); -} - -void CBillboardTextSceneNode::updateMesh(const irr::scene::ICameraSceneNode* camera) -{ - // get text width - f32 textLength = 0.f; - u32 i; - for(i=0; i!=Symbol.size(); ++i) - { - SSymbolInfo &info = Symbol[i]; - textLength += info.Kerning + info.Width; - } - if (textLength<0.0f) - textLength=1.0f; - - //const core::matrix4 &m = camera->getViewFrustum()->Matrices[ video::ETS_VIEW ]; - - // make billboard look to camera - core::vector3df pos = getAbsolutePosition(); - - core::vector3df campos = camera->getAbsolutePosition(); - core::vector3df target = camera->getTarget(); - core::vector3df up = camera->getUpVector(); - core::vector3df view = target - campos; - view.normalize(); - - core::vector3df horizontal = up.crossProduct(view); - if ( horizontal.getLength() == 0 ) - { - horizontal.set(up.Y,up.X,up.Z); - } - - horizontal.normalize(); - core::vector3df space = horizontal; - - horizontal *= 0.5f * Size.Width; - - core::vector3df vertical = horizontal.crossProduct(view); - vertical.normalize(); - vertical *= 0.5f * Size.Height; - - view *= -1.0f; - - // center text - pos += space * (Size.Width * -0.5f); - - for ( i = 0; i!= Symbol.size(); ++i ) - { - SSymbolInfo &info = Symbol[i]; - f32 infw = info.Width / textLength; - f32 infk = info.Kerning / textLength; - f32 w = (Size.Width * infw * 0.5f); - pos += space * w; - - SMeshBuffer* buf = (SMeshBuffer*)Mesh->getMeshBuffer(info.bufNo); - - buf->Vertices[info.firstVert+0].Normal = view; - buf->Vertices[info.firstVert+1].Normal = view; - buf->Vertices[info.firstVert+2].Normal = view; - buf->Vertices[info.firstVert+3].Normal = view; - - buf->Vertices[info.firstVert+0].Pos = pos + (space * w) + vertical; - buf->Vertices[info.firstVert+1].Pos = pos + (space * w) - vertical; - buf->Vertices[info.firstVert+2].Pos = pos - (space * w) - vertical; - buf->Vertices[info.firstVert+3].Pos = pos - (space * w) + vertical; - - pos += space * (Size.Width*infk + w); - } - - // make bounding box - for (i=0; i< Mesh->getMeshBufferCount() ; ++i) - Mesh->getMeshBuffer(i)->recalculateBoundingBox(); - Mesh->recalculateBoundingBox(); -} - -void CBillboardTextSceneNode::OnRegisterSceneNode() -{ - if (IsVisible && Font && Mesh) - { - SceneManager->registerNodeForRendering(this, ESNRP_TRANSPARENT); - ISceneNode::OnRegisterSceneNode(); - } -} - - -//! render -void CBillboardTextSceneNode::render() -{ - if ( !Mesh ) - return; - - video::IVideoDriver* driver = SceneManager->getVideoDriver(); - - // draw - core::matrix4 mat; - driver->setTransform(video::ETS_WORLD, mat); - - for (u32 i = 0; i < Mesh->getMeshBufferCount(); ++i) - { - driver->setMaterial(Mesh->getMeshBuffer(i)->getMaterial()); - driver->drawMeshBuffer(Mesh->getMeshBuffer(i)); - } - - if ( DebugDataVisible & scene::EDS_BBOX ) - { - driver->setTransform(video::ETS_WORLD, AbsoluteTransformation); - video::SMaterial m; - m.Lighting = false; - driver->setMaterial(m); - driver->draw3DBox(BBox, video::SColor(0,208,195,152)); - } -} - - -//! returns the axis aligned bounding box of this node -const core::aabbox3d<f32>& CBillboardTextSceneNode::getBoundingBox() const -{ - return BBox; -} - - -//! sets the size of the billboard -void CBillboardTextSceneNode::setSize(const core::dimension2d<f32>& size) -{ - Size = size; - - if (Size.Width == 0.0f) - Size.Width = 1.0f; - - if (Size.Height == 0.0f ) - Size.Height = 1.0f; - - //f32 avg = (size.Width + size.Height)/6; - //BBox.MinEdge.set(-avg,-avg,-avg); - //BBox.MaxEdge.set(avg,avg,avg); -} - - -video::SMaterial& CBillboardTextSceneNode::getMaterial(u32 i) -{ - if (Mesh && Mesh->getMeshBufferCount() > i ) - return Mesh->getMeshBuffer(i)->getMaterial(); - else - return Material; -} - - -//! returns amount of materials used by this scene node. -u32 CBillboardTextSceneNode::getMaterialCount() const -{ - if (Mesh) - return Mesh->getMeshBufferCount(); - else - return 0; -} - - -//! gets the size of the billboard -const core::dimension2d<f32>& CBillboardTextSceneNode::getSize() const -{ - return Size; -} - -//! Get the font used to draw the text -gui::IGUIFont* CBillboardTextSceneNode::getFont() const -{ - return Font; -} - -//! Set the color of all vertices of the billboard -//! \param overallColor: the color to set -void CBillboardTextSceneNode::setColor(const video::SColor & overallColor) -{ - if ( !Mesh ) - return; - - for ( u32 i = 0; i != Text.size (); ++i ) - { - const SSymbolInfo &info = Symbol[i]; - SMeshBuffer* buf = (SMeshBuffer*)Mesh->getMeshBuffer(info.bufNo); - buf->Vertices[info.firstVert+0].Color = overallColor; - buf->Vertices[info.firstVert+1].Color = overallColor; - buf->Vertices[info.firstVert+2].Color = overallColor; - buf->Vertices[info.firstVert+3].Color = overallColor; - } -} - - -//! Set the color of the top and bottom vertices of the billboard -//! \param topColor: the color to set the top vertices -//! \param bottomColor: the color to set the bottom vertices -void CBillboardTextSceneNode::setColor(const video::SColor & topColor, const video::SColor & bottomColor) -{ - if ( !Mesh ) - return; - - ColorBottom = bottomColor; - ColorTop = topColor; - for ( u32 i = 0; i != Text.size (); ++i ) - { - const SSymbolInfo &info = Symbol[i]; - SMeshBuffer* buf = (SMeshBuffer*)Mesh->getMeshBuffer(info.bufNo); - buf->Vertices[info.firstVert+0].Color = ColorBottom; - buf->Vertices[info.firstVert+3].Color = ColorBottom; - buf->Vertices[info.firstVert+1].Color = ColorTop; - buf->Vertices[info.firstVert+2].Color = ColorTop; - } -} - - -//! Gets the color of the top and bottom vertices of the billboard -//! \param topColor: stores the color of the top vertices -//! \param bottomColor: stores the color of the bottom vertices -void CBillboardTextSceneNode::getColor(video::SColor & topColor, video::SColor & bottomColor) const -{ - topColor = ColorTop; - bottomColor = ColorBottom; -} - - -} // end namespace scene -} // end namespace irr - diff --git a/source/Irrlicht/CTextSceneNode.h b/source/Irrlicht/CTextSceneNode.h deleted file mode 100644 index 5b849110..00000000 --- a/source/Irrlicht/CTextSceneNode.h +++ /dev/null @@ -1,180 +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_TEXT_SCENE_NODE_H_INCLUDED__ -#define __C_TEXT_SCENE_NODE_H_INCLUDED__ - -#include "ITextSceneNode.h" -#include "IBillboardTextSceneNode.h" -#include "IGUIFont.h" -#include "IGUIFontBitmap.h" -#include "ISceneCollisionManager.h" -#include "SMesh.h" - -namespace irr -{ -namespace scene -{ - - class ICameraSceneNode; - - class CTextSceneNode : public ITextSceneNode - { - public: - - //! constructor - CTextSceneNode(ISceneNode* parent, ISceneManager* mgr, s32 id, - gui::IGUIFont* font, scene::ISceneCollisionManager* coll, - const core::vector3df& position = core::vector3df(0,0,0), const wchar_t* text=0, - video::SColor color=video::SColor(100,0,0,0)); - - //! destructor - virtual ~CTextSceneNode(); - - virtual void OnRegisterSceneNode() _IRR_OVERRIDE_; - - //! renders the node. - virtual void render() _IRR_OVERRIDE_; - - //! returns the axis aligned bounding box of this node - virtual const core::aabbox3d<f32>& getBoundingBox() const _IRR_OVERRIDE_; - - //! sets the text string - virtual void setText(const wchar_t* text) _IRR_OVERRIDE_; - - //! get the text string - virtual const wchar_t* getText() const _IRR_OVERRIDE_; - - //! sets the color of the text - virtual void setTextColor(video::SColor color) _IRR_OVERRIDE_; - - //! get the color of the text - virtual video::SColor getTextColor() const _IRR_OVERRIDE_; - - //! set the font used to draw the text - virtual void setFont(gui::IGUIFont* font) _IRR_OVERRIDE_; - - //! Get the font used to draw the text - virtual gui::IGUIFont* getFont() const _IRR_OVERRIDE_; - - //! Returns type of the scene node - virtual ESCENE_NODE_TYPE getType() const _IRR_OVERRIDE_ { return ESNT_TEXT; } - - private: - - core::stringw Text; - video::SColor Color; - gui::IGUIFont* Font; - scene::ISceneCollisionManager* Coll; - core::aabbox3d<f32> Box; - }; - - class CBillboardTextSceneNode : public IBillboardTextSceneNode - { - public: - - CBillboardTextSceneNode(ISceneNode* parent, ISceneManager* mgr, s32 id, - gui::IGUIFont* font,const wchar_t* text, - const core::vector3df& position, const core::dimension2d<f32>& size, - video::SColor colorTop, video::SColor shade_bottom); - - //! destructor - virtual ~CBillboardTextSceneNode(); - - //! sets the vertex positions etc - virtual void OnAnimate(u32 timeMs) _IRR_OVERRIDE_; - - //! registers the node into the transparent pass - virtual void OnRegisterSceneNode() _IRR_OVERRIDE_; - - //! renders the node. - virtual void render() _IRR_OVERRIDE_; - - //! returns the axis aligned bounding box of this node - virtual const core::aabbox3d<f32>& getBoundingBox() const _IRR_OVERRIDE_; - - //! sets the text string - virtual void setText(const wchar_t* text) _IRR_OVERRIDE_; - - //! get the text string - virtual const wchar_t* getText() const _IRR_OVERRIDE_; - - //! Get the font used to draw the text - virtual gui::IGUIFont* getFont() const _IRR_OVERRIDE_; - - //! sets the size of the billboard - virtual void setSize(const core::dimension2d<f32>& size) _IRR_OVERRIDE_; - - //! gets the size of the billboard - virtual const core::dimension2d<f32>& getSize() const _IRR_OVERRIDE_; - - virtual video::SMaterial& getMaterial(u32 i) _IRR_OVERRIDE_; - - //! returns amount of materials used by this scene node. - virtual u32 getMaterialCount() const _IRR_OVERRIDE_; - - //! Returns type of the scene node - virtual ESCENE_NODE_TYPE getType() const _IRR_OVERRIDE_ { return ESNT_BILLBOARD_TEXT; } - - //! Set the color of all vertices of the billboard - //! \param overallColor: the color to set - virtual void setColor(const video::SColor & overallColor) _IRR_OVERRIDE_; - - //! Set the color of the top and bottom vertices of the billboard - //! \param topColor: the color to set the top vertices - //! \param bottomColor: the color to set the bottom vertices - virtual void setColor(const video::SColor & topColor, const video::SColor & bottomColor) _IRR_OVERRIDE_; - - //! Gets the color of the top and bottom vertices of the billboard - //! \param topColor: stores the color of the top vertices - //! \param bottomColor: stores the color of the bottom vertices - virtual void getColor(video::SColor & topColor, video::SColor & bottomColor) const _IRR_OVERRIDE_; - - virtual void setSize(f32 height, f32 bottomEdgeWidth, f32 topEdgeWidth) _IRR_OVERRIDE_ - { - setSize(core::dimension2df(bottomEdgeWidth, height)); - } - - virtual void getSize(f32& height, f32& bottomEdgeWidth, f32& topEdgeWidth) const _IRR_OVERRIDE_ - { - height = Size.Height; - bottomEdgeWidth = Size.Width; - topEdgeWidth = Size.Width; - } - - virtual const core::aabbox3d<f32>& getTransformedBillboardBoundingBox(const irr::scene::ICameraSceneNode* camera) _IRR_OVERRIDE_; - - protected: - void updateMesh(const irr::scene::ICameraSceneNode* camera); - - private: - - core::stringw Text; - gui::IGUIFontBitmap* Font; - - core::dimension2d<f32> Size; - core::aabbox3d<f32> BBox; - video::SMaterial Material; - - video::SColor ColorTop; - video::SColor ColorBottom; - struct SSymbolInfo - { - u32 bufNo; - f32 Width; - f32 Kerning; - u32 firstInd; - u32 firstVert; - }; - - core::array < SSymbolInfo > Symbol; - - SMesh *Mesh; - }; - -} // end namespace scene -} // end namespace irr - -#endif - diff --git a/source/Irrlicht/CTriangleBBSelector.cpp b/source/Irrlicht/CTriangleBBSelector.cpp deleted file mode 100644 index b30f04e1..00000000 --- a/source/Irrlicht/CTriangleBBSelector.cpp +++ /dev/null @@ -1,89 +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 "CTriangleBBSelector.h" -#include "ISceneNode.h" - -namespace irr -{ -namespace scene -{ - -//! constructor -CTriangleBBSelector::CTriangleBBSelector(ISceneNode* node) -: CTriangleSelector(node) -{ - #ifdef _DEBUG - setDebugName("CTriangleBBSelector"); - #endif - - Triangles.set_used(12); // a box has 12 triangles. -} - -//! Gets all triangles. -void CTriangleBBSelector::getTriangles(core::triangle3df* triangles, - s32 arraySize, s32& outTriangleCount, - const core::matrix4* transform, bool useNodeTransform, - irr::core::array<SCollisionTriangleRange>* outTriangleInfo) const -{ - fillTriangles(); - - // call parent - CTriangleSelector::getTriangles(triangles, arraySize, outTriangleCount, transform, useNodeTransform, outTriangleInfo); -} - -void CTriangleBBSelector::getTriangles(core::triangle3df* triangles, - s32 arraySize, s32& outTriangleCount, - const core::aabbox3d<f32>& box, - const core::matrix4* transform, bool useNodeTransform, - irr::core::array<SCollisionTriangleRange>* outTriangleInfo) const -{ - fillTriangles(); - return CTriangleSelector::getTriangles(triangles, arraySize, outTriangleCount, box, transform, useNodeTransform, outTriangleInfo); -} - -void CTriangleBBSelector::getTriangles(core::triangle3df* triangles, - s32 arraySize, s32& outTriangleCount, - const core::line3d<f32>& line, - const core::matrix4* transform, bool useNodeTransform, - irr::core::array<SCollisionTriangleRange>* outTriangleInfo) const -{ - fillTriangles(); - return CTriangleSelector::getTriangles(triangles, arraySize, outTriangleCount, line, transform, useNodeTransform, outTriangleInfo); -} - -void CTriangleBBSelector::fillTriangles() const -{ - if (SceneNode) - { - // construct triangles - const core::aabbox3d<f32>& box = SceneNode->getBoundingBox(); - BoundingBox = box; - core::vector3df edges[8]; - box.getEdges(edges); - - // yeah, not really const... Triangles are mutable - Triangles[0].set( edges[3], edges[0], edges[2]); - Triangles[1].set( edges[3], edges[1], edges[0]); - - Triangles[2].set( edges[3], edges[2], edges[7]); - Triangles[3].set( edges[7], edges[2], edges[6]); - - Triangles[4].set( edges[7], edges[6], edges[4]); - Triangles[5].set( edges[5], edges[7], edges[4]); - - Triangles[6].set( edges[5], edges[4], edges[0]); - Triangles[7].set( edges[5], edges[0], edges[1]); - - Triangles[8].set( edges[1], edges[3], edges[7]); - Triangles[9].set( edges[1], edges[7], edges[5]); - - Triangles[10].set(edges[0], edges[6], edges[2]); - Triangles[11].set(edges[0], edges[4], edges[6]); - } -} - - -} // end namespace scene -} // end namespace irr diff --git a/source/Irrlicht/CTriangleBBSelector.h b/source/Irrlicht/CTriangleBBSelector.h deleted file mode 100644 index b4444a33..00000000 --- a/source/Irrlicht/CTriangleBBSelector.h +++ /dev/null @@ -1,49 +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_TRIANGLE_BB_SELECTOR_H_INCLUDED__ -#define __C_TRIANGLE_BB_SELECTOR_H_INCLUDED__ - -#include "CTriangleSelector.h" - -namespace irr -{ -namespace scene -{ - -//! Stupid triangle selector without optimization -class CTriangleBBSelector : public CTriangleSelector -{ -public: - - //! Constructs a selector based on a mesh - CTriangleBBSelector(ISceneNode* node); - - //! Gets all triangles. - virtual void getTriangles(core::triangle3df* triangles, s32 arraySize, s32& outTriangleCount, - const core::matrix4* transform, bool useNodeTransform, - irr::core::array<SCollisionTriangleRange>* outTriangleInfo) const _IRR_OVERRIDE_; - - //! Gets all triangles which lie within a specific bounding box. - virtual void getTriangles(core::triangle3df* triangles, s32 arraySize, s32& outTriangleCount, - const core::aabbox3d<f32>& box, const core::matrix4* transform, bool useNodeTransform, - irr::core::array<SCollisionTriangleRange>* outTriangleInfo) const _IRR_OVERRIDE_; - - //! Gets all triangles which have or may have contact with a 3d line. - virtual void getTriangles(core::triangle3df* triangles, s32 arraySize, - s32& outTriangleCount, const core::line3d<f32>& line, - const core::matrix4* transform, bool useNodeTransform, - irr::core::array<SCollisionTriangleRange>* outTriangleInfo) const _IRR_OVERRIDE_; - -protected: - void fillTriangles() const; - -}; - -} // end namespace scene -} // end namespace irr - - -#endif - diff --git a/source/Irrlicht/CTriangleSelector.cpp b/source/Irrlicht/CTriangleSelector.cpp deleted file mode 100644 index 531c62d6..00000000 --- a/source/Irrlicht/CTriangleSelector.cpp +++ /dev/null @@ -1,508 +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 "CTriangleSelector.h" -#include "ISceneNode.h" -#include "IMeshBuffer.h" -#include "IAnimatedMeshSceneNode.h" -#include "SSkinMeshBuffer.h" - -namespace irr -{ -namespace scene -{ - -//! constructor -CTriangleSelector::CTriangleSelector(ISceneNode* node) -: SceneNode(node), MeshBuffer(0), MaterialIndex(0), AnimatedNode(0), LastMeshFrame(0) -{ - #ifdef _DEBUG - setDebugName("CTriangleSelector"); - #endif - - BoundingBox.reset(0.f, 0.f, 0.f); -} - - -//! constructor -CTriangleSelector::CTriangleSelector(const core::aabbox3d<f32>& box, ISceneNode* node) -: SceneNode(node), MeshBuffer(0), MaterialIndex(0), AnimatedNode(0), LastMeshFrame(0) -{ - #ifdef _DEBUG - setDebugName("CTriangleSelector"); - #endif - - BoundingBox=box; - // TODO -} - - -//! constructor -CTriangleSelector::CTriangleSelector(const IMesh* mesh, ISceneNode* node, bool separateMeshbuffers) -: SceneNode(node), MeshBuffer(0), MaterialIndex(0), AnimatedNode(0), LastMeshFrame(0) -{ - #ifdef _DEBUG - setDebugName("CTriangleSelector"); - #endif - - createFromMesh(mesh, separateMeshbuffers); -} - -CTriangleSelector::CTriangleSelector(const IMeshBuffer* meshBuffer, irr::u32 materialIndex, ISceneNode* node) - : SceneNode(node), MeshBuffer(meshBuffer), MaterialIndex(materialIndex), AnimatedNode(0), LastMeshFrame(0) -{ - #ifdef _DEBUG - setDebugName("CTriangleSelector"); - #endif - - createFromMeshBuffer(meshBuffer); -} - -CTriangleSelector::CTriangleSelector(IAnimatedMeshSceneNode* node, bool separateMeshbuffers) -: SceneNode(node), AnimatedNode(node), LastMeshFrame(0) -{ - #ifdef _DEBUG - setDebugName("CTriangleSelector"); - #endif - - if (!AnimatedNode) - return; - - IAnimatedMesh* animatedMesh = AnimatedNode->getMesh(); - if (!animatedMesh) - return; - - LastMeshFrame = (u32)AnimatedNode->getFrameNr(); - IMesh* mesh = animatedMesh->getMesh(LastMeshFrame); - - if (mesh) - createFromMesh(mesh, separateMeshbuffers); -} - - -void CTriangleSelector::createFromMesh(const IMesh* mesh, bool createBufferRanges) -{ - BufferRanges.clear(); - Triangles.clear(); - - const u32 cnt = mesh->getMeshBufferCount(); - u32 totalFaceCount = 0; - for (u32 j=0; j<cnt; ++j) - { - SCollisionTriangleRange range; - range.MeshBuffer = mesh->getMeshBuffer(j); - range.MaterialIndex = j; - range.RangeSize = range.MeshBuffer->getIndexCount() / 3; - - if ( createBufferRanges ) - { - range.RangeStart = totalFaceCount; - - BufferRanges.push_back(range); - } - - totalFaceCount += range.RangeSize; - } - Triangles.set_used(totalFaceCount); - - updateFromMesh(mesh); -} - -void CTriangleSelector::createFromMeshBuffer(const IMeshBuffer* meshBuffer) -{ - BufferRanges.clear(); - Triangles.clear(); - - if ( meshBuffer ) - { - Triangles.set_used(meshBuffer->getIndexCount() / 3); - } - - updateFromMeshBuffer(meshBuffer); -} - -template <typename TIndex> -static void updateTriangles(u32& triangleCount, core::array<core::triangle3df>& triangles, u32 idxCnt, const TIndex* indices, const u8* vertices, u32 vertexPitch, const core::matrix4* bufferTransform) -{ - if ( bufferTransform ) - { - for (u32 index = 2; index < idxCnt; index += 3) - { - core::triangle3df& tri = triangles[triangleCount++]; - bufferTransform->transformVect( tri.pointA, (*reinterpret_cast<const video::S3DVertex*>(&vertices[indices[index - 2]*vertexPitch])).Pos ); - bufferTransform->transformVect( tri.pointB, (*reinterpret_cast<const video::S3DVertex*>(&vertices[indices[index - 1]*vertexPitch])).Pos ); - bufferTransform->transformVect( tri.pointC, (*reinterpret_cast<const video::S3DVertex*>(&vertices[indices[index - 0]*vertexPitch])).Pos ); - } - } - else - { - for (u32 index = 2; index < idxCnt; index += 3) - { - core::triangle3df& tri = triangles[triangleCount++]; - tri.pointA = (*reinterpret_cast<const video::S3DVertex*>(&vertices[indices[index - 2]*vertexPitch])).Pos; - tri.pointB = (*reinterpret_cast<const video::S3DVertex*>(&vertices[indices[index - 1]*vertexPitch])).Pos; - tri.pointC = (*reinterpret_cast<const video::S3DVertex*>(&vertices[indices[index - 0]*vertexPitch])).Pos; - } - } -} - -void CTriangleSelector::updateFromMesh(const IMesh* mesh) const -{ - if (!mesh) - return; - - bool skinnnedMesh = mesh->getMeshType() == EAMT_SKINNED; - u32 meshBuffers = mesh->getMeshBufferCount(); - u32 triangleCount = 0; - - for (u32 i = 0; i < meshBuffers; ++i) - { - IMeshBuffer* buf = mesh->getMeshBuffer(i); - u32 idxCnt = buf->getIndexCount(); - u32 vertexPitch = getVertexPitchFromType(buf->getVertexType()); - u8* vertices = (u8*)buf->getVertices(); - - const core::matrix4* bufferTransform = 0; - if ( skinnnedMesh ) - { - bufferTransform = &(((scene::SSkinMeshBuffer*)buf)->Transformation); - if ( bufferTransform->isIdentity() ) - bufferTransform = 0; - } - - switch ( buf->getIndexType() ) - { - case video::EIT_16BIT: - { - const u16* indices = buf->getIndices(); - updateTriangles(triangleCount, Triangles, idxCnt, indices, vertices, vertexPitch, bufferTransform); - } - break; - case video::EIT_32BIT: - { - const u32* indices = (u32*)buf->getIndices(); - updateTriangles(triangleCount, Triangles, idxCnt, indices, vertices, vertexPitch, bufferTransform); - } - break; - } - } - - // Update bounding box - updateBoundingBox(); -} - -void CTriangleSelector::updateFromMeshBuffer(const IMeshBuffer* meshBuffer) const -{ - if ( !meshBuffer ) - return; - - u32 idxCnt = meshBuffer->getIndexCount(); - u32 vertexPitch = getVertexPitchFromType(meshBuffer->getVertexType()); - u8* vertices = (u8*)meshBuffer->getVertices(); - u32 triangleCount = 0; - switch ( meshBuffer->getIndexType() ) - { - case video::EIT_16BIT: - { - const u16* indices = meshBuffer->getIndices(); - updateTriangles(triangleCount, Triangles, idxCnt, indices, vertices, vertexPitch, 0); - } - break; - case video::EIT_32BIT: - { - const u32* indices = (u32*)meshBuffer->getIndices(); - updateTriangles(triangleCount, Triangles, idxCnt, indices, vertices, vertexPitch, 0); - } - break; - } -} - -void CTriangleSelector::updateBoundingBox() const -{ - if ( !Triangles.empty() ) - { - BoundingBox.reset( Triangles[0].pointA ); - for (u32 i=0; i < Triangles.size(); ++i) - { - const core::triangle3df& tri = Triangles[i]; - BoundingBox.addInternalPoint(tri.pointA); - BoundingBox.addInternalPoint(tri.pointB); - BoundingBox.addInternalPoint(tri.pointC); - } - } - else - { - BoundingBox.reset(0.f, 0.f, 0.f); - } -} - -void CTriangleSelector::update(void) const -{ - if (!AnimatedNode) - return; //< harmless no-op - - const u32 currentFrame = (u32)AnimatedNode->getFrameNr(); - if (currentFrame == LastMeshFrame) - return; //< Nothing to do - - LastMeshFrame = currentFrame; - IAnimatedMesh * animatedMesh = AnimatedNode->getMesh(); - - if (animatedMesh) - { - IMesh * mesh = animatedMesh->getMesh(LastMeshFrame); - - if (mesh) - updateFromMesh(mesh); - } -} - - -//! Gets all triangles. -void CTriangleSelector::getTriangles(core::triangle3df* triangles, - s32 arraySize, s32& outTriangleCount, - const core::matrix4* transform, bool useNodeTransform, - irr::core::array<SCollisionTriangleRange>* outTriangleInfo) const -{ - // Update my triangles if necessary - update(); - - u32 cnt = Triangles.size(); - if (cnt > (u32)arraySize) - cnt = (u32)arraySize; - - core::matrix4 mat; - if (transform) - mat = *transform; - if (SceneNode&&useNodeTransform) - mat *= SceneNode->getAbsoluteTransformation(); - - for (u32 i=0; i<cnt; ++i) - { - mat.transformVect( triangles[i].pointA, Triangles[i].pointA ); - mat.transformVect( triangles[i].pointB, Triangles[i].pointB ); - mat.transformVect( triangles[i].pointC, Triangles[i].pointC ); - } - - if ( outTriangleInfo ) - { - if ( BufferRanges.empty() ) - { - SCollisionTriangleRange triRange; - - triRange.RangeStart = 0; - triRange.RangeSize = cnt; - triRange.Selector = const_cast<CTriangleSelector*>(this); - triRange.SceneNode = SceneNode; - triRange.MeshBuffer = MeshBuffer; - triRange.MaterialIndex = MaterialIndex; - outTriangleInfo->push_back(triRange); - } - else - { - irr::u32 rangeIndex = 0; - for (u32 i=0; i<cnt; ) - { - while ( i >= (BufferRanges[rangeIndex].RangeStart + BufferRanges[rangeIndex].RangeSize) ) - ++rangeIndex; - - SCollisionTriangleRange triRange; - - triRange.MaterialIndex = BufferRanges[rangeIndex].MaterialIndex; - triRange.MeshBuffer = BufferRanges[rangeIndex].MeshBuffer; - triRange.RangeStart = BufferRanges[rangeIndex].RangeStart; - triRange.RangeSize = core::min_( cnt-BufferRanges[rangeIndex].RangeStart, BufferRanges[rangeIndex].RangeSize); - triRange.Selector = const_cast<CTriangleSelector*>(this); - triRange.SceneNode = SceneNode; - outTriangleInfo->push_back(triRange); - - i += triRange.RangeSize; - } - } - } - - outTriangleCount = cnt; -} - - -//! Gets all triangles which lie within a specific bounding box. -void CTriangleSelector::getTriangles(core::triangle3df* triangles, - s32 arraySize, s32& outTriangleCount, - const core::aabbox3d<f32>& box, - const core::matrix4* transform, bool useNodeTransform, - irr::core::array<SCollisionTriangleRange>* outTriangleInfo) const -{ - // Update my triangles if necessary - update(); - - core::matrix4 mat(core::matrix4::EM4CONST_NOTHING); - core::aabbox3df tBox(box); - - if (SceneNode && useNodeTransform) - { - if ( SceneNode->getAbsoluteTransformation().getInverse(mat) ) - mat.transformBoxEx(tBox); - else - { - // TODO: else is not yet handled optimally. - // If a node has an axis scaled to 0 we return all triangles without any check - return getTriangles(triangles, arraySize, outTriangleCount, - transform, useNodeTransform, outTriangleInfo ); - } - } - if (transform) - mat = *transform; - else - mat.makeIdentity(); - if (SceneNode && useNodeTransform) - mat *= SceneNode->getAbsoluteTransformation(); - - outTriangleCount = 0; - - if (!tBox.intersectsWithBox(BoundingBox)) - return; - - s32 triangleCount = 0; - const u32 cnt = Triangles.size(); - - if ( outTriangleInfo && !BufferRanges.empty() ) - { - irr::u32 activeRange = 0; - SCollisionTriangleRange triRange; - triRange.Selector = const_cast<CTriangleSelector*>(this); - triRange.SceneNode = SceneNode; - triRange.RangeStart = triangleCount; - triRange.MeshBuffer = BufferRanges[activeRange].MeshBuffer; - triRange.MaterialIndex = BufferRanges[activeRange].MaterialIndex; - - for (u32 i=0; i<cnt; ++i) - { - // This isn't an accurate test, but it's fast, and the - // API contract doesn't guarantee complete accuracy. - if (Triangles[i].isTotalOutsideBox(tBox)) - continue; - - if ( i >= BufferRanges[activeRange].RangeStart + BufferRanges[activeRange].RangeSize ) - { - triRange.RangeSize = triangleCount-triRange.RangeStart; - if ( triRange.RangeSize > 0 ) - outTriangleInfo->push_back(triRange); - - ++activeRange; - triRange.RangeStart = triangleCount; - triRange.MeshBuffer = BufferRanges[activeRange].MeshBuffer; - triRange.MaterialIndex = BufferRanges[activeRange].MaterialIndex; - } - - triangles[triangleCount] = Triangles[i]; - mat.transformVect(triangles[triangleCount].pointA); - mat.transformVect(triangles[triangleCount].pointB); - mat.transformVect(triangles[triangleCount].pointC); - - ++triangleCount; - - if (triangleCount == arraySize) - break; - } - triRange.RangeSize = triangleCount-triRange.RangeStart; - if ( triRange.RangeSize > 0 ) - outTriangleInfo->push_back(triRange); - } - else - { - for (u32 i=0; i<cnt; ++i) - { - // This isn't an accurate test, but it's fast, and the - // API contract doesn't guarantee complete accuracy. - if (Triangles[i].isTotalOutsideBox(tBox)) - continue; - - triangles[triangleCount] = Triangles[i]; - mat.transformVect(triangles[triangleCount].pointA); - mat.transformVect(triangles[triangleCount].pointB); - mat.transformVect(triangles[triangleCount].pointC); - - ++triangleCount; - - if (triangleCount == arraySize) - break; - } - - if ( outTriangleInfo ) - { - SCollisionTriangleRange triRange; - triRange.RangeSize = triangleCount; - triRange.Selector = const_cast<CTriangleSelector*>(this); - triRange.SceneNode = SceneNode; - triRange.MeshBuffer = MeshBuffer; - triRange.MaterialIndex = MaterialIndex; - outTriangleInfo->push_back(triRange); - } - } - - outTriangleCount = triangleCount; -} - - -//! Gets all triangles which have or may have contact with a 3d line. -void CTriangleSelector::getTriangles(core::triangle3df* triangles, - s32 arraySize, s32& outTriangleCount, - const core::line3d<f32>& line, - const core::matrix4* transform, bool useNodeTransform, - irr::core::array<SCollisionTriangleRange>* outTriangleInfo) const -{ - // Update my triangles if necessary - update(); - - core::aabbox3d<f32> box(line.start); - box.addInternalPoint(line.end); - - // TODO: Could be optimized for line a little bit more. - getTriangles(triangles, arraySize, outTriangleCount, - box, transform, useNodeTransform, outTriangleInfo); -} - - -//! Returns amount of all available triangles in this selector -s32 CTriangleSelector::getTriangleCount() const -{ - return Triangles.size(); -} - - -/* Get the number of TriangleSelectors that are part of this one. -Only useful for MetaTriangleSelector others return 1 -*/ -u32 CTriangleSelector::getSelectorCount() const -{ - return 1; -} - - -/* Get the TriangleSelector based on index based on getSelectorCount. -Only useful for MetaTriangleSelector others return 'this' or 0 -*/ -ITriangleSelector* CTriangleSelector::getSelector(u32 index) -{ - if (index) - return 0; - else - return this; -} - - -/* Get the TriangleSelector based on index based on getSelectorCount. -Only useful for MetaTriangleSelector others return 'this' or 0 -*/ -const ITriangleSelector* CTriangleSelector::getSelector(u32 index) const -{ - if (index) - return 0; - else - return this; -} - - -} // end namespace scene -} // end namespace irr diff --git a/source/Irrlicht/CTriangleSelector.h b/source/Irrlicht/CTriangleSelector.h deleted file mode 100644 index 01acacff..00000000 --- a/source/Irrlicht/CTriangleSelector.h +++ /dev/null @@ -1,109 +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_TRIANGLE_SELECTOR_H_INCLUDED__ -#define __C_TRIANGLE_SELECTOR_H_INCLUDED__ - -#include "ITriangleSelector.h" -#include "IMesh.h" -#include "irrArray.h" -#include "aabbox3d.h" - -namespace irr -{ -namespace scene -{ - -class ISceneNode; -class IAnimatedMeshSceneNode; - -//! Stupid triangle selector without optimization -class CTriangleSelector : public ITriangleSelector -{ -public: - - //! Constructs a selector based on a mesh - CTriangleSelector(ISceneNode* node); - - //! Constructs a selector based on a mesh - CTriangleSelector(const IMesh* mesh, ISceneNode* node, bool separateMeshbuffers); - - //! Constructs a selector based on a meshbuffer - CTriangleSelector(const IMeshBuffer* meshBuffer, irr::u32 materialIndex, ISceneNode* node); - - //! Constructs a selector based on an animated mesh scene node - //!\param node An animated mesh scene node, which must have a valid mesh - CTriangleSelector(IAnimatedMeshSceneNode* node, bool separateMeshbuffers); - - //! Constructs a selector based on a bounding box - CTriangleSelector(const core::aabbox3d<f32>& box, ISceneNode* node); - - //! Gets all triangles. - virtual void getTriangles(core::triangle3df* triangles, s32 arraySize, s32& outTriangleCount, - const core::matrix4* transform, bool useNodeTransform, - irr::core::array<SCollisionTriangleRange>* outTriangleInfo) const _IRR_OVERRIDE_; - - //! Gets all triangles which lie within a specific bounding box. - virtual void getTriangles(core::triangle3df* triangles, s32 arraySize, s32& outTriangleCount, - const core::aabbox3d<f32>& box, const core::matrix4* transform, bool useNodeTransform, - irr::core::array<SCollisionTriangleRange>* outTriangleInfo) const _IRR_OVERRIDE_; - - //! Gets all triangles which have or may have contact with a 3d line. - virtual void getTriangles(core::triangle3df* triangles, s32 arraySize, - s32& outTriangleCount, const core::line3d<f32>& line, - const core::matrix4* transform, bool useNodeTransform, - irr::core::array<SCollisionTriangleRange>* outTriangleInfo) const _IRR_OVERRIDE_; - - //! Returns amount of all available triangles in this selector - virtual s32 getTriangleCount() const _IRR_OVERRIDE_; - - //! Return the scene node associated with a given triangle. - virtual ISceneNode* getSceneNodeForTriangle(u32 triangleIndex) const _IRR_OVERRIDE_ { return SceneNode; } - - // Get the number of TriangleSelectors that are part of this one - virtual u32 getSelectorCount() const _IRR_OVERRIDE_; - - // Get the TriangleSelector based on index based on getSelectorCount - virtual ITriangleSelector* getSelector(u32 index) _IRR_OVERRIDE_; - - // Get the TriangleSelector based on index based on getSelectorCount - virtual const ITriangleSelector* getSelector(u32 index) const _IRR_OVERRIDE_; - -protected: - //! Create from a mesh - virtual void createFromMesh(const IMesh* mesh, bool createBufferRanges); - - //! Create from a meshbuffer - virtual void createFromMeshBuffer(const IMeshBuffer* meshBuffer); - - //! Update when the mesh has changed - virtual void updateFromMesh(const IMesh* mesh) const; - - //! Update when the meshbuffer has changed - virtual void updateFromMeshBuffer(const IMeshBuffer* meshBuffer) const; - - //! Update bounding box from triangles - void updateBoundingBox() const; - - //! Update the triangle selector, which will only have an effect if it - //! was built from an animated mesh and that mesh's frame has changed - //! since the last time it was updated. - virtual void update(void) const; - - irr::core::array<SCollisionTriangleRange> BufferRanges; - - ISceneNode* SceneNode; - mutable core::array<core::triangle3df> Triangles; // (mutable for CTriangleBBSelector) - mutable core::aabbox3df BoundingBox; // Allows for trivial rejection - - const IMeshBuffer* MeshBuffer; // non-zero when the selector is for a single meshbuffer - irr::u32 MaterialIndex; // Only set when MeshBuffer is non-zero - IAnimatedMeshSceneNode* AnimatedNode; - mutable u32 LastMeshFrame; -}; - -} // end namespace scene -} // end namespace irr - -#endif diff --git a/source/Irrlicht/CVolumeLightSceneNode.cpp b/source/Irrlicht/CVolumeLightSceneNode.cpp deleted file mode 100644 index 720c3607..00000000 --- a/source/Irrlicht/CVolumeLightSceneNode.cpp +++ /dev/null @@ -1,196 +0,0 @@ -// Copyright (C) 2007-2012 Dean Wadsworth -// This file is part of the "Irrlicht Engine". -// For conditions of distribution and use, see copyright notice in irrlicht.h - -#include "CVolumeLightSceneNode.h" -#include "IVideoDriver.h" -#include "ISceneManager.h" -#include "S3DVertex.h" -#include "os.h" - -namespace irr -{ -namespace scene -{ - -//! constructor -CVolumeLightSceneNode::CVolumeLightSceneNode(ISceneNode* parent, ISceneManager* mgr, - s32 id, const u32 subdivU, const u32 subdivV, - const video::SColor foot, - const video::SColor tail, - const core::vector3df& position, - const core::vector3df& rotation, const core::vector3df& scale) - : IVolumeLightSceneNode(parent, mgr, id, position, rotation, scale), - Mesh(0), LPDistance(8.0f), - SubdivideU(subdivU), SubdivideV(subdivV), - FootColor(foot), TailColor(tail), - LightDimensions(core::vector3df(1.0f, 1.2f, 1.0f)) -{ - #ifdef _DEBUG - setDebugName("CVolumeLightSceneNode"); - #endif - - constructLight(); -} - - -CVolumeLightSceneNode::~CVolumeLightSceneNode() -{ - if (Mesh) - Mesh->drop(); -} - - -void CVolumeLightSceneNode::constructLight() -{ - if (Mesh) - Mesh->drop(); - Mesh = SceneManager->getGeometryCreator()->createVolumeLightMesh(SubdivideU, SubdivideV, FootColor, TailColor, LPDistance, LightDimensions); -} - - -//! renders the node. -void CVolumeLightSceneNode::render() -{ - if (!Mesh) - return; - - video::IVideoDriver* driver = SceneManager->getVideoDriver(); - driver->setTransform(video::ETS_WORLD, AbsoluteTransformation); - - driver->setMaterial(Mesh->getMeshBuffer(0)->getMaterial()); - driver->drawMeshBuffer(Mesh->getMeshBuffer(0)); -} - - -//! returns the axis aligned bounding box of this node -const core::aabbox3d<f32>& CVolumeLightSceneNode::getBoundingBox() const -{ - return Mesh->getBoundingBox(); -} - - -void CVolumeLightSceneNode::OnRegisterSceneNode() -{ - if (IsVisible) - { - SceneManager->registerNodeForRendering(this, ESNRP_TRANSPARENT); - } - ISceneNode::OnRegisterSceneNode(); -} - - -video::SMaterial& CVolumeLightSceneNode::getMaterial(u32 i) -{ - return Mesh->getMeshBuffer(i)->getMaterial(); -} - - -u32 CVolumeLightSceneNode::getMaterialCount() const -{ - return 1; -} - - -void CVolumeLightSceneNode::setSubDivideU (const u32 inU) -{ - if (inU != SubdivideU) - { - SubdivideU = inU; - constructLight(); - } -} - - -void CVolumeLightSceneNode::setSubDivideV (const u32 inV) -{ - if (inV != SubdivideV) - { - SubdivideV = inV; - constructLight(); - } -} - - -void CVolumeLightSceneNode::setFootColor(const video::SColor inColor) -{ - if (inColor != FootColor) - { - FootColor = inColor; - constructLight(); - } -} - - -void CVolumeLightSceneNode::setTailColor(const video::SColor inColor) -{ - if (inColor != TailColor) - { - TailColor = inColor; - constructLight(); - } -} - - -//! Writes attributes of the scene node. -void CVolumeLightSceneNode::serializeAttributes(io::IAttributes* out, io::SAttributeReadWriteOptions* options) const -{ - ISceneNode::serializeAttributes(out, options); - - out->addFloat("lpDistance", LPDistance); - out->addInt("subDivideU", SubdivideU); - out->addInt("subDivideV", SubdivideV); - - out->addColor("footColor", FootColor); - out->addColor("tailColor", TailColor); - - out->addVector3d("lightDimension", LightDimensions); -} - - -//! Reads attributes of the scene node. -void CVolumeLightSceneNode::deserializeAttributes(io::IAttributes* in, io::SAttributeReadWriteOptions* options) -{ - LPDistance = in->getAttributeAsFloat("lpDistance"); - LPDistance = core::max_(LPDistance, 8.0f); - - SubdivideU = in->getAttributeAsInt("subDivideU"); - SubdivideU = core::max_(SubdivideU, 1u); - - SubdivideV = in->getAttributeAsInt("subDivideV"); - SubdivideV = core::max_(SubdivideV, 1u); - - FootColor = in->getAttributeAsColor("footColor"); - TailColor = in->getAttributeAsColor("tailColor"); - - LightDimensions = in->getAttributeAsVector3d("lightDimension"); - - constructLight(); - - ISceneNode::deserializeAttributes(in, options); -} - - -//! Creates a clone of this scene node and its children. -ISceneNode* CVolumeLightSceneNode::clone(ISceneNode* newParent, ISceneManager* newManager) -{ - if (!newParent) - newParent = Parent; - if (!newManager) - newManager = SceneManager; - - CVolumeLightSceneNode* nb = new CVolumeLightSceneNode(newParent, - newManager, ID, SubdivideU, SubdivideV, FootColor, TailColor, RelativeTranslation); - - nb->cloneMembers(this, newManager); - nb->getMaterial(0) = Mesh->getMeshBuffer(0)->getMaterial(); - - if ( newParent ) - nb->drop(); - return nb; -} - - -} // end namespace scene -} // end namespace irr - diff --git a/source/Irrlicht/CVolumeLightSceneNode.h b/source/Irrlicht/CVolumeLightSceneNode.h deleted file mode 100644 index 13c0335a..00000000 --- a/source/Irrlicht/CVolumeLightSceneNode.h +++ /dev/null @@ -1,95 +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 -// -// created by Dean Wadsworth aka Varmint Dec 31 2007 - -#ifndef __VOLUME_LIGHT_SCENE_NODE_H_INCLUDED__ -#define __VOLUME_LIGHT_SCENE_NODE_H_INCLUDED__ - -#include "IVolumeLightSceneNode.h" -#include "IMesh.h" - -namespace irr -{ -namespace scene -{ - class CVolumeLightSceneNode : public IVolumeLightSceneNode - { - public: - - //! constructor - CVolumeLightSceneNode(ISceneNode* parent, ISceneManager* mgr, s32 id, - const u32 subdivU = 32, const u32 subdivV = 32, - const video::SColor foot = video::SColor(51, 0, 230, 180), - const video::SColor tail = video::SColor(0, 0, 0, 0), - const core::vector3df& position = core::vector3df(0,0,0), - const core::vector3df& rotation = core::vector3df(0,0,0), - const core::vector3df& scale = core::vector3df(1.0f, 1.0f, 1.0f)); - - virtual ~CVolumeLightSceneNode(); - - virtual void OnRegisterSceneNode() _IRR_OVERRIDE_; - - //! renders the node. - virtual void render() _IRR_OVERRIDE_; - - //! returns the axis aligned bounding box of this node - virtual const core::aabbox3d<f32>& getBoundingBox() const _IRR_OVERRIDE_; - - //! returns the material based on the zero based index i. - virtual video::SMaterial& getMaterial(u32 i) _IRR_OVERRIDE_; - - //! returns amount of materials used by this scene node. - virtual u32 getMaterialCount() const _IRR_OVERRIDE_; - - //! Returns type of the scene node - virtual ESCENE_NODE_TYPE getType() const _IRR_OVERRIDE_ { return ESNT_VOLUME_LIGHT; } - - //! Writes attributes of the scene node. - virtual void serializeAttributes(io::IAttributes* out, io::SAttributeReadWriteOptions* options=0) const _IRR_OVERRIDE_; - - //! Reads attributes of the scene node. - virtual void deserializeAttributes(io::IAttributes* in, io::SAttributeReadWriteOptions* options=0) _IRR_OVERRIDE_; - - //! Creates a clone of this scene node and its children. - virtual ISceneNode* clone(ISceneNode* newParent=0, ISceneManager* newManager=0) _IRR_OVERRIDE_; - - virtual void setSubDivideU(const u32 inU) _IRR_OVERRIDE_; - virtual void setSubDivideV(const u32 inV) _IRR_OVERRIDE_; - - virtual u32 getSubDivideU() const _IRR_OVERRIDE_ { return SubdivideU; } - virtual u32 getSubDivideV() const _IRR_OVERRIDE_ { return SubdivideV; } - - virtual void setFootColor(const video::SColor inColor) _IRR_OVERRIDE_; - virtual void setTailColor(const video::SColor inColor) _IRR_OVERRIDE_; - - virtual video::SColor getFootColor() const _IRR_OVERRIDE_ { return FootColor; } - virtual video::SColor getTailColor() const _IRR_OVERRIDE_ { return TailColor; } - - private: - void constructLight(); - - IMesh* Mesh; - - f32 LPDistance; // Distance to hypothetical lightsource point -- affects fov angle - - u32 SubdivideU; // Number of subdivisions in U and V space. - u32 SubdivideV; // Controls the number of "slices" in the volume. - // NOTE : Total number of polygons = 2 + ((SubdivideU + 1) + (SubdivideV + 1)) * 2 - // Each slice being a quad plus the rectangular plane at the bottom. - - video::SColor FootColor; // Color at the source - video::SColor TailColor; // Color at the end. - - // LightDimensions.Y Distance of shooting -- Length of beams - // LightDimensions.X and LightDimensions.Z determine the - // size/dimension of the plane - core::vector3df LightDimensions; - }; - -} // end namespace scene -} // end namespace irr - -#endif - diff --git a/source/Irrlicht/CWADReader.cpp b/source/Irrlicht/CWADReader.cpp deleted file mode 100644 index 0d7b8f9e..00000000 --- a/source/Irrlicht/CWADReader.cpp +++ /dev/null @@ -1,263 +0,0 @@ -// Copyright (C) 2002-2012 Thomas Alten -// This file is part of the "Irrlicht Engine". -// For conditions of distribution and use, see copyright notice in irrlicht.h -// Code contributed by skreamz - -#include "IrrCompileConfig.h" - -#ifdef __IRR_COMPILE_WITH_WAD_ARCHIVE_LOADER_ - -#include "CWADReader.h" -#include "os.h" -#include "coreutil.h" - -namespace irr -{ -namespace io -{ - -//! Constructor -CArchiveLoaderWAD::CArchiveLoaderWAD( io::IFileSystem* fs) -: FileSystem(fs) -{ - #ifdef _DEBUG - setDebugName("CArchiveLoaderWAD"); - #endif -} - - -//! returns true if the file maybe is able to be loaded by this class -bool CArchiveLoaderWAD::isALoadableFileFormat(const io::path& filename) const -{ - return core::hasFileExtension ( filename, "wad" ); -} - - -//! Creates an archive from the filename -/** \param file File handle to check. -\return Pointer to newly created archive, or 0 upon error. */ -IFileArchive* CArchiveLoaderWAD::createArchive(const io::path& filename, bool ignoreCase, bool ignorePaths) const -{ - IFileArchive *archive = 0; - io::IReadFile* file = FileSystem->createAndOpenFile(filename); - - if (file) - { - archive = createArchive ( file, ignoreCase, ignorePaths ); - file->drop (); - } - - return archive; -} - -//! creates/loads an archive from the file. -//! \return Pointer to the created archive. Returns 0 if loading failed. -IFileArchive* CArchiveLoaderWAD::createArchive(io::IReadFile* file, bool ignoreCase, bool ignorePaths) const -{ - IFileArchive *archive = 0; - if ( file ) - { - file->seek ( 0 ); - archive = new CWADReader(file, ignoreCase, ignorePaths); - } - return archive; -} - - -//! Check if the file might be loaded by this class -/** Check might look into the file. -\param file File handle to check. -\return True if file seems to be loadable. */ -bool CArchiveLoaderWAD::isALoadableFileFormat(io::IReadFile* file) const -{ - SWADFileHeader header; - memset(&header, 0, sizeof(header)); - - file->read( &header.tag, 4 ); - - return !strncmp ( header.tag, "WAD2", 4 ) || !strncmp ( header.tag, "WAD3", 4 ); -} - -//! Check to see if the loader can create archives of this type. -bool CArchiveLoaderWAD::isALoadableFileFormat(E_FILE_ARCHIVE_TYPE fileType) const -{ - return fileType == EFAT_WAD; -} - -void createDir ( const c8 *full ); - - -/*! - WAD Reader -*/ -CWADReader::CWADReader(IReadFile* file, bool ignoreCase, bool ignorePaths) -: CFileList((file ? file->getFileName() : io::path("")), ignoreCase, ignorePaths), File(file) -{ - #ifdef _DEBUG - setDebugName("CWADReader"); - #endif - - if (File) - { - File->grab(); - - Base = File->getFileName(); - Base.replace ( '\\', '/' ); - - // scan local headers - scanLocalHeader(); - - sort(); - } - -#if 0 - for ( u32 i = 0; i < FileList.size(); ++i ) - { - SWADFileEntry &e = FileList[i]; - char buf[128]; - snprintf_irr ( buf, 128, "c:\\h2\\%s", e.wadFileName.c_str() ); - - createDir ( buf ); - FILE * f = fopen ( buf, "wb" ); - if ( 0 == f ) - continue; - - u8 * mem = new u8 [ e.header.disksize ]; - File->seek ( e.header.filepos ); - File->read ( mem, e.header.disksize ); - fwrite ( mem, e.header.disksize, 1, f ); - delete [] mem; - fclose ( f ); - } -#endif - -} - - -CWADReader::~CWADReader() -{ - if (File) - File->drop(); -} - - -//! return the id of the file Archive -const io::path& CWADReader::getArchiveName () const -{ - return Base; -} - -const IFileList* CWADReader::getFileList() const -{ - return this; -} - - -//! scans for a local header, returns false if there is no more local file header. -bool CWADReader::scanLocalHeader() -{ - SWADFileEntryOriginal entry; - SWADFileEntry save; - - memset(&Header, 0, sizeof(SWADFileHeader)); - File->read(&Header, sizeof(SWADFileHeader)); - - if ( 0 == strncmp ( Header.tag, "WAD2", 4 ) ) - WadType = WAD_FORMAT_QUAKE2; - else - if ( 0 == strncmp ( Header.tag, "WAD3", 4 ) ) - WadType = WAD_FORMAT_HALFLIFE; - else - WadType = WAD_FORMAT_UNKNOWN; - - if ( WadType == WAD_FORMAT_UNKNOWN ) - return false; - -#ifdef __BIG_ENDIAN__ - Header.numlumps = os::Byteswap::byteswap(Header.numlumps); - Header.infotableofs = os::Byteswap::byteswap(Header.infotableofs); -#endif - - File->seek ( Header.infotableofs ); - - c8 buf[16]; - for ( u32 i = 0; i < Header.numlumps; ++i ) - { - // read entry - File->read(&entry, sizeof ( SWADFileEntryOriginal )); - entry.name[ sizeof ( entry.name ) - 1 ] = 0; - - save.header = entry; - save.wadFileName = "/"; - save.wadFileName += entry.name; - - if ( WadType == WAD_FORMAT_HALFLIFE ) - { - // don't know about the types! i'm guessing - switch ( entry.type ) - { - case WAD_TYP_MIPTEX_HALFLIFE: - save.wadFileName += ".wal2"; - break; - default: - snprintf_irr ( buf, 16, ".%02d", entry.type ); - save.wadFileName += buf; - break; - } - } - else - if ( WadType == WAD_FORMAT_QUAKE2 ) - { - switch ( entry.type ) - { - case WAD_TYP_MIPTEX: save.wadFileName += ".miptex"; break; - case WAD_TYP_SOUND: save.wadFileName += ".sound"; break; - case WAD_TYP_PALETTE: save.wadFileName += ".palette"; break; - case WAD_TYP_QTEX: save.wadFileName += ".qtex"; break; - case WAD_TYP_QPIC: save.wadFileName += ".qpic"; break; - case WAD_TYP_FONT: save.wadFileName += ".font"; break; - default: - snprintf_irr ( buf, 16, ".%02d", entry.type ); - save.wadFileName += buf; - break; - } - } - - // add file to list - addItem(save.wadFileName,save.header.filepos, save.header.disksize, false ); - //FileInfo.push_back(save); - } - return true; -} - - -//! opens a file by file name -IReadFile* CWADReader::createAndOpenFile(const io::path& filename) -{ - s32 index = findFile(filename, false); - - if (index != -1) - return createAndOpenFile(index); - - return 0; -} - - -//! opens a file by index -IReadFile* CWADReader::createAndOpenFile(u32 index) -{ - if (index >= Files.size() ) - return 0; - - const SFileListEntry &entry = Files[index]; - return createLimitReadFile( entry.FullName, File, entry.Offset, entry.Size ); -} - - - -} // end namespace io -} // end namespace irr - - -#endif // __IRR_COMPILE_WITH_WAD_ARCHIVE_LOADER_ - diff --git a/source/Irrlicht/CWADReader.h b/source/Irrlicht/CWADReader.h deleted file mode 100644 index fe2acd1f..00000000 --- a/source/Irrlicht/CWADReader.h +++ /dev/null @@ -1,176 +0,0 @@ -// Copyright (C) 2002-2012 Thomas Alten -// This file is part of the "Irrlicht Engine". -// For conditions of distribution and use, see copyright notice in irrlicht.h - -#ifndef __C_WAD_READER_H_INCLUDED__ -#define __C_WAD_READER_H_INCLUDED__ - -#include "IrrCompileConfig.h" -#ifdef __IRR_COMPILE_WITH_WAD_ARCHIVE_LOADER_ - -#include "IReferenceCounted.h" -#include "IReadFile.h" -#include "irrArray.h" -#include "irrString.h" -#include "IFileSystem.h" -#include "CFileList.h" - - -namespace irr -{ -namespace io -{ - - enum eWADFileTypes - { - WAD_FORMAT_UNKNOWN = 0, - WAD_FORMAT_QUAKE2 = 1, - WAD_FORMAT_HALFLIFE = 2, - - WAD_CMP_NONE = 0, - WAD_CMP_LZSS = 1, - - WAD_TYP_NONE = 0, - WAD_TYP_LABEL = 1, - - WAD_TYP_LUMPY = 64, // 64 + grab command number - WAD_TYP_PALETTE = 64, - WAD_TYP_QTEX = 65, - WAD_TYP_QPIC = 66, - WAD_TYP_SOUND = 67, - WAD_TYP_MIPTEX = 68, - WAD_TYP_MIPTEX_HALFLIFE = 67, - WAD_TYP_FONT = 70, - }; - -// byte-align structures -#include "irrpack.h" - - struct SWADFileHeader - { - c8 tag[4]; // type of WAD format WAD2 = quake2, WAD3 = halflife - u32 numlumps; - u32 infotableofs; - } PACK_STRUCT; - - struct SWADFileEntryOriginal - { - u32 filepos; - u32 disksize; - u32 size; // uncompressed - u8 type; - u8 compression; - u8 pad[2]; - u8 name[16]; // must be null terminated - } PACK_STRUCT; - -// Default alignment -#include "irrunpack.h" - - struct SWADFileEntry - { - io::path simpleFileName; - bool operator < (const SWADFileEntry& other) const - { - return simpleFileName < other.simpleFileName; - } - - io::path wadFileName; - SWADFileEntryOriginal header; - }; - - //! Archiveloader capable of loading WAD Archives - class CArchiveLoaderWAD : public IArchiveLoader - { - public: - - //! Constructor - CArchiveLoaderWAD(io::IFileSystem* fs); - - //! returns true if the file maybe is able to be loaded by this class - //! based on the file extension (e.g. ".zip") - virtual bool isALoadableFileFormat(const io::path& filename) const _IRR_OVERRIDE_; - - //! Check if the file might be loaded by this class - /** Check might look into the file. - \param file File handle to check. - \return True if file seems to be loadable. */ - virtual bool isALoadableFileFormat(io::IReadFile* file) const _IRR_OVERRIDE_; - - //! Check to see if the loader can create archives of this type. - /** Check based on the archive type. - \param fileType The archive type to check. - \return True if the archile loader supports this type, false if not */ - virtual bool isALoadableFileFormat(E_FILE_ARCHIVE_TYPE fileType) const _IRR_OVERRIDE_; - - //! Creates an archive from the filename - /** \param file File handle to check. - \return Pointer to newly created archive, or 0 upon error. */ - virtual IFileArchive* createArchive(const io::path& filename, bool ignoreCase, bool ignorePaths) const _IRR_OVERRIDE_; - - //! creates/loads an archive from the file. - //! \return Pointer to the created archive. Returns 0 if loading failed. - virtual io::IFileArchive* createArchive(io::IReadFile* file, bool ignoreCase, bool ignorePaths) const _IRR_OVERRIDE_; - - private: - io::IFileSystem* FileSystem; - }; - - - //! reads from WAD - class CWADReader : public IFileArchive, virtual CFileList - { - public: - - CWADReader(IReadFile* file, bool ignoreCase, bool ignorePaths); - virtual ~CWADReader(); - - // file archive methods - - //! return the id of the file Archive - virtual const io::path& getArchiveName() const _IRR_OVERRIDE_; - - //! opens a file by file name - virtual IReadFile* createAndOpenFile(const io::path& filename) _IRR_OVERRIDE_; - - //! opens a file by index - virtual IReadFile* createAndOpenFile(u32 index) _IRR_OVERRIDE_; - - //! returns the list of files - virtual const IFileList* getFileList() const _IRR_OVERRIDE_; - - //! get the class Type - virtual E_FILE_ARCHIVE_TYPE getType() const _IRR_OVERRIDE_ { return EFAT_WAD; } - - - private: - - io::path Type; - - //! scans for a local header, returns false if there is no more local file header. - bool scanLocalHeader(); - - //! splits filename from zip file into useful filenames and paths - void extractFilename(SWADFileEntry* entry); - - io::path Base; - io::path MountPoint; - - IReadFile* File; - - eWADFileTypes WadType; - SWADFileHeader Header; - - //core::array<SWADFileEntry> FileInfo; - - io::IFileSystem* FileSystem; - }; - -} // end namespace io -} // end namespace irr - -#endif - - -#endif // #ifdef __IRR_COMPILE_WITH_WAD_ARCHIVE_LOADER_ - diff --git a/source/Irrlicht/CWaterSurfaceSceneNode.cpp b/source/Irrlicht/CWaterSurfaceSceneNode.cpp deleted file mode 100644 index 0aee1012..00000000 --- a/source/Irrlicht/CWaterSurfaceSceneNode.cpp +++ /dev/null @@ -1,140 +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_WATER_SURFACE_SCENENODE_ -#include "CWaterSurfaceSceneNode.h" -#include "ISceneManager.h" -#include "IMeshManipulator.h" -#include "IMeshCache.h" -#include "S3DVertex.h" -#include "SMesh.h" -#include "os.h" - -namespace irr -{ -namespace scene -{ - -//! constructor -CWaterSurfaceSceneNode::CWaterSurfaceSceneNode(f32 waveHeight, f32 waveSpeed, f32 waveLength, - IMesh* mesh, ISceneNode* parent, ISceneManager* mgr, s32 id, - const core::vector3df& position, const core::vector3df& rotation, - const core::vector3df& scale) - : CMeshSceneNode(mesh, parent, mgr, id, position, rotation, scale), - WaveLength(waveLength), WaveSpeed(waveSpeed), WaveHeight(waveHeight), - OriginalMesh(0) -{ - #ifdef _DEBUG - setDebugName("CWaterSurfaceSceneNode"); - #endif - - setMesh(mesh); -} - - -//! destructor -CWaterSurfaceSceneNode::~CWaterSurfaceSceneNode() -{ - // Mesh is dropped in CMeshSceneNode destructor - if (OriginalMesh) - OriginalMesh->drop(); -} - - -//! frame -void CWaterSurfaceSceneNode::OnRegisterSceneNode() -{ - CMeshSceneNode::OnRegisterSceneNode(); -} - - -void CWaterSurfaceSceneNode::OnAnimate(u32 timeMs) -{ - if (Mesh && IsVisible) - { - const u32 meshBufferCount = Mesh->getMeshBufferCount(); - const f32 time = timeMs / WaveSpeed; - - for (u32 b=0; b<meshBufferCount; ++b) - { - const u32 vtxCnt = Mesh->getMeshBuffer(b)->getVertexCount(); - - for (u32 i=0; i<vtxCnt; ++i) - Mesh->getMeshBuffer(b)->getPosition(i).Y = addWave( - OriginalMesh->getMeshBuffer(b)->getPosition(i), - time); - }// end for all mesh buffers - Mesh->setDirty(scene::EBT_VERTEX); - - SceneManager->getMeshManipulator()->recalculateNormals(Mesh); - } - CMeshSceneNode::OnAnimate(timeMs); -} - - -void CWaterSurfaceSceneNode::setMesh(IMesh* mesh) -{ - CMeshSceneNode::setMesh(mesh); - if (!mesh) - return; - if (OriginalMesh) - OriginalMesh->drop(); - IMesh* clone = SceneManager->getMeshManipulator()->createMeshCopy(mesh); - OriginalMesh = mesh; - Mesh = clone; - Mesh->setHardwareMappingHint(scene::EHM_STATIC, scene::EBT_INDEX); -// Mesh->setHardwareMappingHint(scene::EHM_STREAM, scene::EBT_VERTEX); -} - - -//! Writes attributes of the scene node. -void CWaterSurfaceSceneNode::serializeAttributes(io::IAttributes* out, io::SAttributeReadWriteOptions* options) const -{ - out->addFloat("WaveLength", WaveLength); - out->addFloat("WaveSpeed", WaveSpeed); - out->addFloat("WaveHeight", WaveHeight); - - CMeshSceneNode::serializeAttributes(out, options); - // serialize original mesh - out->setAttribute("Mesh", SceneManager->getMeshCache()->getMeshName(OriginalMesh).getPath().c_str()); -} - - -//! Reads attributes of the scene node. -void CWaterSurfaceSceneNode::deserializeAttributes(io::IAttributes* in, io::SAttributeReadWriteOptions* options) -{ - WaveLength = in->getAttributeAsFloat("WaveLength"); - WaveSpeed = in->getAttributeAsFloat("WaveSpeed"); - WaveHeight = in->getAttributeAsFloat("WaveHeight"); - - if (Mesh) - { - Mesh->drop(); - Mesh = OriginalMesh; - OriginalMesh = 0; - } - // deserialize original mesh - CMeshSceneNode::deserializeAttributes(in, options); - - if (Mesh) - { - IMesh* clone = SceneManager->getMeshManipulator()->createMeshCopy(Mesh); - OriginalMesh = Mesh; - Mesh = clone; - } -} - - -f32 CWaterSurfaceSceneNode::addWave(const core::vector3df &source, f32 time) const -{ - return source.Y + - (sinf(((source.X/WaveLength) + time)) * WaveHeight) + - (cosf(((source.Z/WaveLength) + time)) * WaveHeight); -} - -} // end namespace scene -} // end namespace irr - -#endif // _IRR_COMPILE_WITH_WATER_SURFACE_SCENENODE_ diff --git a/source/Irrlicht/CWaterSurfaceSceneNode.h b/source/Irrlicht/CWaterSurfaceSceneNode.h deleted file mode 100644 index 7a588cd2..00000000 --- a/source/Irrlicht/CWaterSurfaceSceneNode.h +++ /dev/null @@ -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 __C_WATER_SURFACE_SCENE_NODE_H_INCLUDED__ -#define __C_WATER_SURFACE_SCENE_NODE_H_INCLUDED__ - -#include "CMeshSceneNode.h" - -namespace irr -{ -namespace scene -{ - - class CWaterSurfaceSceneNode : public CMeshSceneNode - { - public: - - //! constructor - CWaterSurfaceSceneNode(f32 waveHeight, f32 waveSpeed, f32 waveLength, - IMesh* mesh, ISceneNode* parent, ISceneManager* mgr, s32 id, - const core::vector3df& position = core::vector3df(0,0,0), - const core::vector3df& rotation = core::vector3df(0,0,0), - const core::vector3df& scale = core::vector3df(1.0f, 1.0f, 1.0f)); - - //! destructor - virtual ~CWaterSurfaceSceneNode(); - - //! frame registration - virtual void OnRegisterSceneNode() _IRR_OVERRIDE_; - - //! animated update - virtual void OnAnimate(u32 timeMs) _IRR_OVERRIDE_; - - //! Update mesh - virtual void setMesh(IMesh* mesh) _IRR_OVERRIDE_; - - //! Returns type of the scene node - virtual ESCENE_NODE_TYPE getType() const _IRR_OVERRIDE_ { return ESNT_WATER_SURFACE; } - - //! Writes attributes of the scene node. - virtual void serializeAttributes(io::IAttributes* out, io::SAttributeReadWriteOptions* options) const _IRR_OVERRIDE_; - - //! Reads attributes of the scene node. - virtual void deserializeAttributes(io::IAttributes* in, io::SAttributeReadWriteOptions* options) _IRR_OVERRIDE_; - - private: - - inline f32 addWave(const core::vector3df &source, f32 time) const; - - f32 WaveLength; - f32 WaveSpeed; - f32 WaveHeight; - IMesh* OriginalMesh; - }; - -} // end namespace scene -} // end namespace irr - -#endif - diff --git a/source/Irrlicht/CXMeshFileLoader.cpp b/source/Irrlicht/CXMeshFileLoader.cpp index bb25d6f2..547a5129 100644 --- a/source/Irrlicht/CXMeshFileLoader.cpp +++ b/source/Irrlicht/CXMeshFileLoader.cpp @@ -7,7 +7,6 @@ #ifdef _IRR_COMPILE_WITH_X_LOADER_ #include "CXMeshFileLoader.h" -#include "CMeshTextureLoader.h" #include "os.h" #include "fast_atof.h" @@ -36,8 +35,6 @@ CXMeshFileLoader::CXMeshFileLoader(scene::ISceneManager* smgr, io::IFileSystem* #ifdef _DEBUG setDebugName("CXMeshFileLoader"); #endif - - TextureLoader = new CMeshTextureLoader( FileSystem, SceneManager->getVideoDriver() ); } @@ -58,9 +55,6 @@ IAnimatedMesh* CXMeshFileLoader::createMesh(io::IReadFile* file) if (!file) return 0; - if ( getMeshTextureLoader() ) - getMeshTextureLoader()->setMeshFile(file); - #ifdef _XREADER_DEBUG u32 time = os::Timer::getRealTime(); #endif @@ -525,14 +519,6 @@ bool CXMeshFileLoader::parseDataObject() return parseDataObjectAnimationTicksPerSecond(); } else - if (objectName == "Material") - { - // template materials now available thanks to joeWright - TemplateMaterials.push_back(SXTemplateMaterial()); - TemplateMaterials.getLast().Name = getNextToken(); - return parseDataObjectMaterial(TemplateMaterials.getLast().Material); - } - else if (objectName == "}") { os::Printer::log("} found in dataObject", ELL_WARNING); @@ -1475,13 +1461,6 @@ bool CXMeshFileLoader::parseDataObjectMeshMaterialList(SXMesh &mesh) getNextToken(); // skip } } else - if (objectName == "Material") - { - mesh.Materials.push_back(video::SMaterial()); - if (!parseDataObjectMaterial(mesh.Materials.getLast())) - return false; - } - else if (objectName == ";") { // ignore @@ -1497,87 +1476,6 @@ bool CXMeshFileLoader::parseDataObjectMeshMaterialList(SXMesh &mesh) } -bool CXMeshFileLoader::parseDataObjectMaterial(video::SMaterial& material) -{ -#ifdef _XREADER_DEBUG - os::Printer::log("CXFileReader: Reading mesh material", ELL_DEBUG); -#endif - - if (!readHeadOfDataObject()) - { - os::Printer::log("No opening brace in Mesh Material found in .x file", ELL_WARNING); - os::Printer::log("Line", core::stringc(Line).c_str(), ELL_WARNING); - return false; - } - - // read RGBA - readRGBA(material.DiffuseColor); checkForOneFollowingSemicolons(); - - // read power - material.Shininess = readFloat(); - - // read specular - readRGB(material.SpecularColor); checkForOneFollowingSemicolons(); - - // read emissive - readRGB(material.EmissiveColor); checkForOneFollowingSemicolons(); - - // read other data objects - int textureLayer=0; - while(true) - { - core::stringc objectName = getNextToken(); - - if (objectName.size() == 0) - { - os::Printer::log("Unexpected ending found in Mesh Material in .x file.", ELL_WARNING); - os::Printer::log("Line", core::stringc(Line).c_str(), ELL_WARNING); - return false; - } - else - if (objectName == "}") - { - break; // material finished - } - else - if (objectName.equals_ignore_case("TextureFilename")) - { - // some exporters write "TextureFileName" instead. - core::stringc TextureFileName; - if (!parseDataObjectTextureFilename(TextureFileName)) - return false; - - material.setTexture( textureLayer, getMeshTextureLoader() ? getMeshTextureLoader()->getTexture(TextureFileName) : NULL ); - - ++textureLayer; - if (textureLayer==2) - material.MaterialType=video::EMT_LIGHTMAP; - } - else - if (objectName.equals_ignore_case("NormalmapFilename")) - { - // some exporters write "NormalmapFileName" instead. - core::stringc TextureFileName; - if (!parseDataObjectTextureFilename(TextureFileName)) - return false; - - material.setTexture( 1, getMeshTextureLoader() ? getMeshTextureLoader()->getTexture(TextureFileName) : NULL ); - - if (textureLayer==1) - ++textureLayer; - } - else - { - os::Printer::log("Unknown data object in material in .x file", objectName.c_str(), ELL_WARNING); - if (!parseUnknownDataObject()) - return false; - } - } - - return true; -} - - bool CXMeshFileLoader::parseDataObjectAnimationSet() { #ifdef _XREADER_DEBUG diff --git a/source/Irrlicht/CXMeshFileLoader.h b/source/Irrlicht/CXMeshFileLoader.h index a4806d7b..41fab00d 100644 --- a/source/Irrlicht/CXMeshFileLoader.h +++ b/source/Irrlicht/CXMeshFileLoader.h @@ -114,8 +114,6 @@ private: bool parseDataObjectMeshMaterialList(SXMesh &mesh); - bool parseDataObjectMaterial(video::SMaterial& material); - bool parseDataObjectAnimationSet(); bool parseDataObjectAnimationTicksPerSecond(); diff --git a/source/Irrlicht/IBurningShader.cpp b/source/Irrlicht/IBurningShader.cpp deleted file mode 100644 index b72cd9ac..00000000 --- a/source/Irrlicht/IBurningShader.cpp +++ /dev/null @@ -1,418 +0,0 @@ -// Copyright (C) 2002-2012 Nikolaus Gebhardt / Thomas Alten -// 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_BURNINGSVIDEO_ - -#include "SoftwareDriver2_compile_config.h" -#include "IBurningShader.h" -#include "CSoftwareDriver2.h" -#include "IShaderConstantSetCallBack.h" - -namespace irr -{ -namespace video -{ - -const tFixPointu IBurningShader::dithermask[] = -{ - 0x00,0x80,0x20,0xa0, - 0xc0,0x40,0xe0,0x60, - 0x30,0xb0,0x10,0x90, - 0xf0,0x70,0xd0,0x50 -}; - -void IBurningShader::constructor_IBurningShader(CBurningVideoDriver* driver) -{ -#ifdef _DEBUG - setDebugName("IBurningShader"); -#endif - -#if defined(ENV64BIT) - if (((unsigned long long)&scan & 15) || ((unsigned long long)&line & 15)) - { - os::Printer::log("BurningVideo Shader not 16 byte aligned", ELL_ERROR); - _IRR_DEBUG_BREAK_IF(1); - } -#endif - - Interlaced.enable = 0; - Interlaced.bypass = 1; - Interlaced.nr = 0; - - EdgeTestPass = edge_test_pass; - EdgeTestPass_stack = edge_test_pass; - - for (u32 i = 0; i < BURNING_MATERIAL_MAX_TEXTURES; ++i) - { - IT[i].Texture = 0; - } - - Driver = driver; - CallBack = 0; - - RenderTarget = 0; - ColorMask = COLOR_BRIGHT_WHITE; - DepthBuffer = (CDepthBuffer*)driver->getDepthBuffer(); - if (DepthBuffer) - DepthBuffer->grab(); - - Stencil = (CStencilBuffer*)driver->getStencilBuffer(); - if (Stencil) - Stencil->grab(); - - stencilOp[0] = StencilOp_KEEP; - stencilOp[1] = StencilOp_KEEP; - stencilOp[2] = StencilOp_KEEP; - AlphaRef = 0; - RenderPass_ShaderIsTransparent = 0; - PrimitiveColor = COLOR_BRIGHT_WHITE; - TL_Flag = 0; -} - -IBurningShader::IBurningShader(CBurningVideoDriver* driver) -{ - constructor_IBurningShader(driver); -} - -//! Constructor -IBurningShader::IBurningShader( - CBurningVideoDriver* driver, - s32& outMaterialTypeNr, - const c8* vertexShaderProgram, - const c8* vertexShaderEntryPointName, - E_VERTEX_SHADER_TYPE vsCompileTarget, - const c8* pixelShaderProgram, - const c8* pixelShaderEntryPointName, - E_PIXEL_SHADER_TYPE psCompileTarget, - const c8* geometryShaderProgram, - const c8* geometryShaderEntryPointName, - E_GEOMETRY_SHADER_TYPE gsCompileTarget, - scene::E_PRIMITIVE_TYPE inType, - scene::E_PRIMITIVE_TYPE outType, - u32 verticesOut, - IShaderConstantSetCallBack* callback, - E_MATERIAL_TYPE baseMaterial, - s32 userData) -{ - constructor_IBurningShader(driver); - BaseMaterial = baseMaterial; - UserData = userData; - CallBack = callback; - if (CallBack) - CallBack->grab(); - - // register myself as new material - outMaterialTypeNr = Driver->addMaterialRenderer(this); -} - - -//! destructor -IBurningShader::~IBurningShader() -{ - if (RenderTarget) - RenderTarget->drop(); - - if (DepthBuffer) - DepthBuffer->drop(); - - if (Stencil) - Stencil->drop(); - - for (u32 i = 0; i != BURNING_MATERIAL_MAX_TEXTURES; ++i) - { - if (IT[i].Texture) - IT[i].Texture->drop(); - } - - if (CallBack) - CallBack->drop(); - -} - -//! sets a render target -void IBurningShader::setRenderTarget(video::IImage* surface, const core::rect<s32>& viewPort, const interlaced_control interlaced) -{ - Interlaced = interlaced; - - if (RenderTarget) - RenderTarget->drop(); - - RenderTarget = (video::CImage*) surface; - - if (RenderTarget) - { - RenderTarget->grab(); - - //(fp24*) DepthBuffer->lock() = DepthBuffer->lock(); - } -} - - -//! sets the Texture -void IBurningShader::setTextureParam(const size_t stage, video::CSoftwareTexture2* texture, s32 lodFactor) -{ - sInternalTexture* it = &IT[stage]; - - if (it->Texture) - it->Texture->drop(); - - it->Texture = texture; - - if (it->Texture) - { - it->Texture->grab(); - - // select mignify and magnify - it->lodFactor = lodFactor; - - //only mipmap chain (means positive lodFactor) - u32 existing_level = it->Texture->getMipmapLevel(lodFactor); -#if !defined(PATCH_SUPERTUX_8_0_1_with_1_9_0) - it->data = (tVideoSample*)it->Texture->lock(ETLM_READ_ONLY, existing_level, 0); -#else - it->data = (tVideoSample*)it->Texture->lock(ETLM_READ_ONLY, existing_level); -#endif - - // prepare for optimal fixpoint - it->pitchlog2 = s32_log2_s32(it->Texture->getPitch()); - - const core::dimension2d<u32>& dim = it->Texture->getSize(); - it->textureXMask = s32_to_fixPoint(dim.Width - 1) & FIX_POINT_UNSIGNED_MASK; - it->textureYMask = s32_to_fixPoint(dim.Height - 1) & FIX_POINT_UNSIGNED_MASK; - } -} - -//emulate a line with degenerate triangle and special shader mode (not perfect...) -void IBurningShader::drawLine(const s4DVertex* a, const s4DVertex* b) -{ - sVec2 d; - d.x = b->Pos.x - a->Pos.x; d.x *= d.x; - d.y = b->Pos.y - a->Pos.y; d.y *= d.y; - //if ( d.x * d.y < 0.001f ) return; - - if (a->Pos.x > b->Pos.x) swapVertexPointer(&a, &b); - - s4DVertex c = *a; - - const f32 w = (f32)RenderTarget->getDimension().Width - 1; - const f32 h = (f32)RenderTarget->getDimension().Height - 1; - - if (d.x < 2.f) { c.Pos.x = b->Pos.x + 1.f + d.y; if (c.Pos.x > w) c.Pos.x = w; } - else c.Pos.x = b->Pos.x; - if (d.y < 2.f) { c.Pos.y = b->Pos.y + 1.f; if (c.Pos.y > h) c.Pos.y = h; EdgeTestPass |= edge_test_first_line; } - - drawTriangle(a, b, &c); - EdgeTestPass &= ~edge_test_first_line; - -} - -void IBurningShader::drawPoint(const s4DVertex* a) -{ -} - -void IBurningShader::drawWireFrameTriangle(const s4DVertex* a, const s4DVertex* b, const s4DVertex* c) -{ - if (EdgeTestPass & edge_test_pass) drawTriangle(a, b, c); - else if (EdgeTestPass & edge_test_point) - { - drawPoint(a); - drawPoint(b); - drawPoint(c); - } - else - { - drawLine(a, b); - drawLine(b, c); - drawLine(a, c); - } -} - - -void IBurningShader::OnSetMaterial(const SMaterial& material, const SMaterial& lastMaterial, - bool resetAllRenderstates, IMaterialRendererServices* services) -{ - if (Driver) - Driver->setFallback_Material(BaseMaterial); - services->setBasicRenderStates(material, lastMaterial, resetAllRenderstates); - if (CallBack) - CallBack->OnSetMaterial(material); - -} - -void IBurningShader::OnUnsetMaterial() -{ -} - -bool IBurningShader::OnRender(IMaterialRendererServices* service, E_VERTEX_TYPE vtxtype) -{ - // call callback to set shader constants - if (CallBack) - CallBack->OnSetConstants(this, UserData); - return true; -} - - -//! Returns if the material is transparent. -bool IBurningShader::isTransparent() const -{ - return RenderPass_ShaderIsTransparent != 0; -} - -//! Access the callback provided by the users when creating shader materials -IShaderConstantSetCallBack* IBurningShader::getShaderConstantSetCallBack() const -{ - return CallBack; -} - -// implementations for the render services -void IBurningShader::setBasicRenderStates(const SMaterial& material, const SMaterial& lastMaterial, bool resetAllRenderstates) -{ - // forward - Driver->setBasicRenderStates(material, lastMaterial, resetAllRenderstates); -} - -s32 IBurningShader::getShaderConstantID(EBurningUniformFlags flags, const c8* name) -{ - if (!name || !name[0]) - return -1; - - BurningUniform add; - tiny_strcpy(add.name, name); - add.type = flags; - - s32 index = UniformInfo.linear_search(add); - if (index < 0) - { - UniformInfo.push_back(add); - index = UniformInfo.size() - 1; - } - - return index; -} - -const char* tiny_itoa(s32 value, int base) -{ - static char b[32]; - int p = 31; - - //int sign = 0; - //if (value < 0) { sign = 1; value = -value; } - - b[p] = '\0'; - do { - b[--p] = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"[value % base]; - value /= base; - } while (value && p > 0); - - //if (sign && p > 0) { b[--p] = '-'; } - - return b + p; -} - -bool IBurningShader::setShaderConstantID(EBurningUniformFlags flags, s32 index, const void* data, size_t u32_count) -{ - if ((u32)index >= UniformInfo.size()) - return false; -#if 0 - BurningUniform add; - while ((u32)index >= UniformInfo.size()) - { - tiny_strcpy(add.name, tiny_itoa(UniformInfo.size(), 10)); - add.type = flags; - UniformInfo.push_back(add); - } -#endif - - BurningUniform& use = UniformInfo[index]; - use.type = flags; - - const u32* s = (u32*)data; - u32* d = (u32*)use.data; - - if (!s) u32_count = 0; - if (u32_count > array_size(use.data)) u32_count = array_size(use.data); - for (size_t i = 0; i < u32_count; ++i) - { - d[i] = s[i]; - } - - return true; -} - - -s32 IBurningShader::getVertexShaderConstantID(const c8* name) -{ - return getShaderConstantID(BL_VERTEX_PROGRAM, name); -} - -s32 IBurningShader::getPixelShaderConstantID(const c8* name) -{ - return getShaderConstantID(BL_FRAGMENT_PROGRAM, name); -} - -void IBurningShader::setVertexShaderConstant(const f32* data, s32 startRegister, s32 constantAmount) -{ - c8 name[BL_ACTIVE_UNIFORM_MAX_LENGTH]; - tiny_strcpy(name, tiny_itoa(startRegister, 10)); - - setShaderConstantID(BL_VERTEX_FLOAT, getShaderConstantID(BL_VERTEX_PROGRAM, name), data, constantAmount); -} - -void IBurningShader::setPixelShaderConstant(const f32* data, s32 startRegister, s32 constantAmount) -{ - c8 name[BL_ACTIVE_UNIFORM_MAX_LENGTH]; - tiny_strcpy(name, tiny_itoa(startRegister, 10)); - - setShaderConstantID(BL_FRAGMENT_FLOAT, getShaderConstantID(BL_FRAGMENT_PROGRAM, name), data, constantAmount); -} - -bool IBurningShader::setVertexShaderConstant(s32 index, const f32* floats, int count) -{ - return setShaderConstantID(BL_VERTEX_FLOAT, index, floats, count); -} - -bool IBurningShader::setVertexShaderConstant(s32 index, const s32* ints, int count) -{ - return setShaderConstantID(BL_VERTEX_INT, index, ints, count); -} - -bool IBurningShader::setVertexShaderConstant(s32 index, const u32* ints, int count) -{ - return setShaderConstantID(BL_VERTEX_UINT, index, ints, count); -} - -bool IBurningShader::setPixelShaderConstant(s32 index, const f32* floats, int count) -{ - return setShaderConstantID(BL_FRAGMENT_FLOAT, index, floats, count); -} - -bool IBurningShader::setPixelShaderConstant(s32 index, const s32* ints, int count) -{ - return setShaderConstantID(BL_FRAGMENT_INT, index, ints, count); -} - -bool IBurningShader::setPixelShaderConstant(s32 index, const u32* ints, int count) -{ - return setShaderConstantID(BL_FRAGMENT_UINT, index, ints, count); -} - -void IBurningShader::setStencilOp(eBurningStencilOp sfail, eBurningStencilOp dpfail, eBurningStencilOp dppass) -{ - stencilOp[0] = sfail; - stencilOp[1] = dpfail; - stencilOp[2] = dppass; -} - - -IVideoDriver* IBurningShader::getVideoDriver() -{ - return Driver; -} - - -} // end namespace video -} // end namespace irr - -#endif // _IRR_COMPILE_WITH_BURNINGSVIDEO_ diff --git a/source/Irrlicht/IBurningShader.h b/source/Irrlicht/IBurningShader.h deleted file mode 100644 index 748a9a40..00000000 --- a/source/Irrlicht/IBurningShader.h +++ /dev/null @@ -1,443 +0,0 @@ -// Copyright (C) 2002-2012 Nikolaus Gebhardt / Thomas Alten -// This file is part of the "Irrlicht Engine". -// For conditions of distribution and use, see copyright notice in irrlicht.h - -#ifndef __I_BURNING_SHADER_H_INCLUDED__ -#define __I_BURNING_SHADER_H_INCLUDED__ - -#include "SoftwareDriver2_compile_config.h" -#include "IReferenceCounted.h" -#include "irrMath.h" -#include "irrMathFastCompat.h" -#include "IImage.h" -#include "S2DVertex.h" -#include "rect.h" -#include "CDepthBuffer.h" -#include "S4DVertex.h" -#include "irrArray.h" -#include "SLight.h" -#include "SMaterial.h" -#include "os.h" -#include "IMaterialRenderer.h" -#include "IMaterialRendererServices.h" -#include "IGPUProgrammingServices.h" - -namespace irr -{ - -namespace video -{ - - struct SBurningShaderLight - { - //SLight org; - - sVec4 pos; //light position input - sVec4 pos4; //light position Model*View (Identity*View) - - E_LIGHT_TYPE Type; - f32 linearAttenuation; - f32 constantAttenuation; - f32 quadraticAttenuation; - - sVec4 spotDirection; - sVec4 spotDirection4; - f32 spotCosCutoff; - f32 spotCosInnerCutoff; - f32 spotExponent; - bool LightIsOn; - - sVec3Color AmbientColor; - sVec3Color DiffuseColor; - sVec3Color SpecularColor; - }; - - enum eTransformLightFlags - { - //ENABLED = 0x01, - TL_SCISSOR = 0x02, - TL_LIGHT = 0x04, - TL_SPECULAR = 0x08, - TL_FOG = 0x10, - TL_NORMALIZE_NORMALS = 0x20, - TL_TEXTURE_TRANSFORM = 0x40, - TL_LIGHT_LOCAL_VIEWER = 0x80, - TL_LIGHT0_IS_NORMAL_MAP = 0x100 //sVec4 Light Vector is used as normal or specular - }; - - struct SBurningShaderEyeSpace - { - SBurningShaderEyeSpace() {} - virtual ~SBurningShaderEyeSpace() {} - void reset () - { - Light.set_used ( 0 ); - Global_AmbientLight.set ( 0.f ); - - TL_Flag = TL_LIGHT_LOCAL_VIEWER; - } - void resetFog() - { - fog_scale = 0.f; - //cam_distance = 0.f; - } - - core::array<SBurningShaderLight> Light; - sVec3Color Global_AmbientLight; - - //sVec4 cam_eye_pos; //Camera Position in eye Space (0,0,-1) - //sVec4 cam_world_pos; //Camera Position in world Space - //sVec4 vertex4; //eye coordinate position of vertex - sVec4 normal; //transformed normal - sVec4 vertex; //eye coordinate position of vertex projected - - //derivative of vertex - //f32 cam_distance; // vertex.length(); - sVec4 cam_dir; //vertex.normalize(); - - f32 fog_scale; // 1 / (fog.end-fog.start) - - size_t TL_Flag; // eTransformLightFlags - }; - - enum eBurningCullFlag - { - CULL_FRONT = 1, - CULL_BACK = 2, - CULL_INVISIBLE = 4, //primitive smaller than a pixel (AreaMinDrawSize) - CULL_FRONT_AND_BACK = 8, - }; - - enum eBurningStencilOp - { - StencilOp_KEEP = 0x1E00, - StencilOp_INCR = 0x1E02, - StencilOp_DECR = 0x1E03 - }; - - struct SBurningShaderMaterial - { - SMaterial org; - SMaterial lastMaterial; - bool resetRenderStates; - - E_MATERIAL_TYPE Fallback_MaterialType; - - SMaterial mat2D; - //SMaterial save3D; - - size_t CullFlag; //eCullFlag - u32 depth_write; - u32 depth_test; - - sVec3Color AmbientColor; - sVec3Color DiffuseColor; - sVec3Color SpecularColor; - sVec3Color EmissiveColor; - - }; - - enum EBurningFFShader - { - ETR_FLAT = 0, - ETR_FLAT_WIRE, - ETR_GOURAUD, - ETR_GOURAUD_WIRE, - ETR_TEXTURE_FLAT, - ETR_TEXTURE_FLAT_WIRE, - ETR_TEXTURE_GOURAUD, - ETR_TEXTURE_GOURAUD_WIRE, - ETR_TEXTURE_GOURAUD_NOZ, - ETR_TEXTURE_GOURAUD_ADD, - ETR_TEXTURE_GOURAUD_ADD_NO_Z, - - ETR_TEXTURE_GOURAUD_VERTEX_ALPHA, - - ETR_TEXTURE_GOURAUD_LIGHTMAP_M1, - ETR_TEXTURE_GOURAUD_LIGHTMAP_M2, - ETR_TEXTURE_GOURAUD_LIGHTMAP_M4, - ETR_TEXTURE_LIGHTMAP_M4, - - ETR_TEXTURE_GOURAUD_DETAIL_MAP, - ETR_TEXTURE_GOURAUD_LIGHTMAP_ADD, - - ETR_GOURAUD_NOZ, - //ETR_GOURAUD_ALPHA, - ETR_GOURAUD_ALPHA_NOZ, - - ETR_TEXTURE_GOURAUD_ALPHA, - ETR_TEXTURE_GOURAUD_ALPHA_NOZ, - ETR_TEXTURE_GOURAUD_ALPHA_NOZ_NOPERSPECTIVE_CORRECT, - - ETR_NORMAL_MAP_SOLID, - ETR_STENCIL_SHADOW, - - ETR_TEXTURE_BLEND, - ETR_TRANSPARENT_REFLECTION_2_LAYER, - - ETR_COLOR, - - //ETR_REFERENCE, - ETR_INVALID, - - ETR2_COUNT - }; - - typedef enum - { - BL_VERTEX_PROGRAM = 1, - BL_FRAGMENT_PROGRAM = 2, - BL_TYPE_FLOAT = 4, - BL_TYPE_INT = 8, - BL_TYPE_UINT = 16, - - BL_VERTEX_FLOAT = (BL_VERTEX_PROGRAM | BL_TYPE_FLOAT), - BL_VERTEX_INT = (BL_VERTEX_PROGRAM | BL_TYPE_INT), - BL_VERTEX_UINT = (BL_VERTEX_PROGRAM | BL_TYPE_UINT), - BL_FRAGMENT_FLOAT = (BL_FRAGMENT_PROGRAM | BL_TYPE_FLOAT), - BL_FRAGMENT_INT = (BL_FRAGMENT_PROGRAM | BL_TYPE_INT), - BL_FRAGMENT_UINT = (BL_FRAGMENT_PROGRAM | BL_TYPE_UINT), - - BL_ACTIVE_UNIFORM_MAX_LENGTH = 28 - } EBurningUniformFlags; - - struct BurningUniform - { - c8 name[BL_ACTIVE_UNIFORM_MAX_LENGTH]; - u32 type; //EBurningUniformFlags - //int location; // UniformLocation is index - f32 data[16]; // simple LocalParameter - - bool operator==(const BurningUniform& other) const - { - return tiny_istoken(name, other.name); - } - - }; - - class CBurningVideoDriver; - class IBurningShader : public IMaterialRenderer, public IMaterialRendererServices - { - public: - //! Constructor - IBurningShader(CBurningVideoDriver* driver); - - //! Constructor - IBurningShader( - CBurningVideoDriver* driver, - s32& outMaterialTypeNr, - const c8* vertexShaderProgram = 0, - const c8* vertexShaderEntryPointName = 0, - E_VERTEX_SHADER_TYPE vsCompileTarget = video::EVST_VS_1_1, - const c8* pixelShaderProgram = 0, - const c8* pixelShaderEntryPointName = 0, - E_PIXEL_SHADER_TYPE psCompileTarget = video::EPST_PS_1_1, - const c8* geometryShaderProgram = 0, - const c8* geometryShaderEntryPointName = "main", - E_GEOMETRY_SHADER_TYPE gsCompileTarget = EGST_GS_4_0, - scene::E_PRIMITIVE_TYPE inType = scene::EPT_TRIANGLES, - scene::E_PRIMITIVE_TYPE outType = scene::EPT_TRIANGLE_STRIP, - u32 verticesOut = 0, - IShaderConstantSetCallBack* callback = 0, - E_MATERIAL_TYPE baseMaterial = EMT_SOLID, - s32 userData = 0); - - //! destructor - virtual ~IBurningShader(); - - //! sets a render target - virtual void setRenderTarget(video::IImage* surface, const core::rect<s32>& viewPort, const interlaced_control interlaced); - - //! sets the Texture - virtual void setTextureParam( const size_t stage, video::CSoftwareTexture2* texture, s32 lodFactor); - virtual void drawTriangle(const s4DVertex* burning_restrict a, const s4DVertex* burning_restrict b, const s4DVertex* burning_restrict c) {}; - virtual void drawLine ( const s4DVertex *a,const s4DVertex *b); - virtual void drawPoint(const s4DVertex *a); - - void drawWireFrameTriangle ( const s4DVertex *a,const s4DVertex *b,const s4DVertex *c ); - - virtual void OnSetMaterial( const SBurningShaderMaterial& material ) {}; - - void pushEdgeTest(const int wireFrame,const int point,int save) - { - if ( save ) EdgeTestPass_stack = EdgeTestPass; - EdgeTestPass = point ? edge_test_point : wireFrame ? edge_test_left : edge_test_pass; - } - void popEdgeTest() { EdgeTestPass = EdgeTestPass_stack; } - virtual bool canWireFrame () { return false; } - virtual bool canPointCloud() { return false; } - - void setStencilOp(eBurningStencilOp sfail, eBurningStencilOp dpfail, eBurningStencilOp dppass); - - //IMaterialRenderer - - virtual void OnSetMaterial(const SMaterial& material, const SMaterial& lastMaterial, - bool resetAllRenderstates, IMaterialRendererServices* services) _IRR_OVERRIDE_; - - virtual bool OnRender(IMaterialRendererServices* service, E_VERTEX_TYPE vtxtype) _IRR_OVERRIDE_; - - virtual void OnUnsetMaterial() _IRR_OVERRIDE_; - - //! Returns if the material is transparent. - virtual bool isTransparent() const _IRR_OVERRIDE_; - - //! Access the callback provided by the users when creating shader materials - virtual IShaderConstantSetCallBack* getShaderConstantSetCallBack() const _IRR_OVERRIDE_; - - // implementations for the render services - virtual void setBasicRenderStates(const SMaterial& material, const SMaterial& lastMaterial, bool resetAllRenderstates) _IRR_OVERRIDE_; - virtual s32 getVertexShaderConstantID(const c8* name) _IRR_OVERRIDE_; - virtual s32 getPixelShaderConstantID(const c8* name) _IRR_OVERRIDE_; - virtual void setVertexShaderConstant(const f32* data, s32 startRegister, s32 constantAmount = 1) _IRR_OVERRIDE_; - virtual void setPixelShaderConstant(const f32* data, s32 startRegister, s32 constantAmount = 1) _IRR_OVERRIDE_; - virtual bool setVertexShaderConstant(s32 index, const f32* floats, int count) _IRR_OVERRIDE_; - virtual bool setVertexShaderConstant(s32 index, const s32* ints, int count) _IRR_OVERRIDE_; - virtual bool setVertexShaderConstant(s32 index, const u32* ints, int count) _IRR_OVERRIDE_; - virtual bool setPixelShaderConstant(s32 index, const f32* floats, int count) _IRR_OVERRIDE_; - virtual bool setPixelShaderConstant(s32 index, const s32* ints, int count) _IRR_OVERRIDE_; - virtual bool setPixelShaderConstant(s32 index, const u32* ints, int count) _IRR_OVERRIDE_; - virtual IVideoDriver* getVideoDriver() _IRR_OVERRIDE_; - -#if defined(PATCH_SUPERTUX_8_0_1_with_1_9_0) - virtual bool setVertexShaderConstant(const c8* name, const f32* floats, int count) - { - return setVertexShaderConstant(getVertexShaderConstantID(name), floats, count); - } - virtual bool setVertexShaderConstant(const c8* name, const bool* bools, int count) - { - return setVertexShaderConstant(getVertexShaderConstantID(name), (const s32*)bools, count); - } - virtual bool setVertexShaderConstant(const c8* name, const s32* ints, int count) - { - return setVertexShaderConstant(getVertexShaderConstantID(name), ints, count); - } - - virtual bool setPixelShaderConstant(const c8* name, const f32* floats, int count) - { - return setPixelShaderConstant(getPixelShaderConstantID(name), floats, count); - } - virtual bool setPixelShaderConstant(const c8* name, const bool* bools, int count) - { - return setPixelShaderConstant(getPixelShaderConstantID(name), (const s32*)bools, count); - } - virtual bool setPixelShaderConstant(const c8* name, const s32* ints, int count) - { - return setPixelShaderConstant(getPixelShaderConstantID(name), ints, count); - } -#endif - - //used if no color interpolation is defined - void setPrimitiveColor(const video::SColor& color) - { - PrimitiveColor = color_to_sample(color); - } - void setTLFlag(size_t in /*eTransformLightFlags*/) - { - TL_Flag = in; - } - void setFog(SColor color_fog) - { - fog_color_sample = color_to_sample(color_fog); - color_to_fix(fog_color, fog_color_sample); - } - void setScissor(const AbsRectangle& scissor) - { - Scissor = scissor; - } - - protected: - - void constructor_IBurningShader(CBurningVideoDriver* driver); - - CBurningVideoDriver *Driver; - IShaderConstantSetCallBack* CallBack; - E_MATERIAL_TYPE BaseMaterial; - s32 UserData; - - core::array<BurningUniform> UniformInfo; - s32 getShaderConstantID(EBurningUniformFlags program, const c8* name); - bool setShaderConstantID(EBurningUniformFlags flags, s32 index, const void* data, size_t u32_count); - - video::CImage* RenderTarget; - CDepthBuffer* DepthBuffer; - CStencilBuffer* Stencil; - tVideoSample ColorMask; - - sInternalTexture IT[ BURNING_MATERIAL_MAX_TEXTURES ]; - - static const tFixPointu dithermask[ 4 * 4]; - - //draw degenerate triangle as line (left edge) drawTriangle -> holes,drawLine dda/bresenham - size_t EdgeTestPass; //edge_test_flag - size_t EdgeTestPass_stack; - interlaced_control Interlaced; // passed from driver - - eBurningStencilOp stencilOp[4]; - tFixPoint AlphaRef; - int RenderPass_ShaderIsTransparent; - - sScanConvertData ALIGN(16) scan; - sScanLineData line; - tVideoSample PrimitiveColor; //used if no color interpolation is defined - - size_t /*eTransformLightFlags*/ TL_Flag; - tFixPoint fog_color[4]; - tVideoSample fog_color_sample; - - AbsRectangle Scissor; - - inline tVideoSample color_to_sample(const video::SColor& color) const - { - //RenderTarget->getColorFormat() -#if SOFTWARE_DRIVER_2_RENDERTARGET_COLOR_FORMAT == ECF_A8R8G8B8 - return color.color; -#else - return color.toA1R5G5B5(); -#endif - } - - }; - - - IBurningShader* createTriangleRendererTextureGouraud2(CBurningVideoDriver* driver); - IBurningShader* createTriangleRendererTextureLightMap2_M1(CBurningVideoDriver* driver); - IBurningShader* createTriangleRendererTextureLightMap2_M2(CBurningVideoDriver* driver); - IBurningShader* createTriangleRendererTextureLightMap2_M4(CBurningVideoDriver* driver); - IBurningShader* createTriangleRendererGTextureLightMap2_M4(CBurningVideoDriver* driver); - IBurningShader* createTriangleRendererTextureLightMap2_Add(CBurningVideoDriver* driver); - IBurningShader* createTriangleRendererTextureDetailMap2(CBurningVideoDriver* driver); - IBurningShader* createTriangleRendererTextureVertexAlpha2(CBurningVideoDriver* driver); - - - IBurningShader* createTriangleRendererTextureGouraudWire2(CBurningVideoDriver* driver); - IBurningShader* createTriangleRendererGouraud2(CBurningVideoDriver* driver); - IBurningShader* createTriangleRendererGouraudNoZ2(CBurningVideoDriver* driver); - IBurningShader* createTriangleRendererGouraudAlpha2(CBurningVideoDriver* driver); - IBurningShader* createTRGouraudAlphaNoZ2(CBurningVideoDriver* driver); - IBurningShader* createTriangleRendererGouraudWire2(CBurningVideoDriver* driver); - IBurningShader* createTriangleRendererTextureFlat2(CBurningVideoDriver* driver); - IBurningShader* createTriangleRendererTextureFlatWire2(CBurningVideoDriver* driver); - IBurningShader* createTRFlat2(CBurningVideoDriver* driver); - IBurningShader* createTRFlatWire2(CBurningVideoDriver* driver); - IBurningShader* createTRTextureGouraudNoZ2(CBurningVideoDriver* driver); - IBurningShader* createTRTextureGouraudAdd2(CBurningVideoDriver* driver); - IBurningShader* createTRTextureGouraudAddNoZ2(CBurningVideoDriver* driver); - - IBurningShader* createTRTextureGouraudAlpha(CBurningVideoDriver* driver); - IBurningShader* createTRTextureGouraudAlphaNoZ(CBurningVideoDriver* driver); - IBurningShader* createTRTextureBlend(CBurningVideoDriver* driver); - IBurningShader* createTRTextureInverseAlphaBlend(CBurningVideoDriver* driver); - - IBurningShader* createTRNormalMap(CBurningVideoDriver* driver); - IBurningShader* createTRStencilShadow(CBurningVideoDriver* driver); - - IBurningShader* createTriangleRendererReference(CBurningVideoDriver* driver); - IBurningShader* createTriangleRendererTexture_transparent_reflection_2_layer(CBurningVideoDriver* driver); - - IBurningShader* create_burning_shader_color(CBurningVideoDriver* driver); - -} // end namespace video -} // end namespace irr - -#endif - diff --git a/source/Irrlicht/IDepthBuffer.h b/source/Irrlicht/IDepthBuffer.h deleted file mode 100644 index 996926c8..00000000 --- a/source/Irrlicht/IDepthBuffer.h +++ /dev/null @@ -1,82 +0,0 @@ -// Copyright (C) 2002-2012 Nikolaus Gebhardt / Thomas Alten -// This file is part of the "Irrlicht Engine". -// For conditions of distribution and use, see copyright notice in irrlicht.h - -#ifndef __I_Z2_BUFFER_H_INCLUDED__ -#define __I_Z2_BUFFER_H_INCLUDED__ - -#include "IReferenceCounted.h" -#include "dimension2d.h" -#include "S4DVertex.h" - -namespace irr -{ -namespace video -{ - class IDepthBuffer : public virtual IReferenceCounted - { - public: - - //! destructor - virtual ~IDepthBuffer() {}; - - //! clears the zbuffer - virtual void clear(f32 value, const interlaced_control interlaced) = 0; - - //! sets the new size of the zbuffer - virtual void setSize(const core::dimension2d<u32>& size) = 0; - - //! returns the size of the zbuffer - virtual const core::dimension2d<u32>& getSize() const = 0; - - //! locks the zbuffer - virtual void* lock() = 0; - - //! unlocks the zbuffer - virtual void unlock() = 0; - - //! returns pitch of depthbuffer (in bytes) - virtual u32 getPitch() const = 0; - - }; - - - //! creates a ZBuffer - IDepthBuffer* createDepthBuffer(const core::dimension2d<u32>& size); - - class IStencilBuffer : public virtual IReferenceCounted - { - public: - - //! destructor - virtual ~IStencilBuffer() {}; - - //! clears the stencil buffer - virtual void clear(u32 value, const interlaced_control interlaced) = 0; - - //! sets the new size of the zbuffer - virtual void setSize(const core::dimension2d<u32>& size) = 0; - - //! returns the size of the stencil buffer - virtual const core::dimension2d<u32>& getSize() const = 0; - - //! locks the stencil buffer - virtual void* lock() = 0; - - //! unlocks the stencil buffer - virtual void unlock() = 0; - - //! returns pitch of stencil buffer (in bytes) - virtual u32 getPitch() const = 0; - - }; - - - //! creates a Stencil Buffer - IStencilBuffer* createStencilBuffer(const core::dimension2d<u32>& size, u32 bit); - -} // end namespace video -} // end namespace irr - -#endif - diff --git a/source/Irrlicht/ISceneNodeAnimatorFinishing.h b/source/Irrlicht/ISceneNodeAnimatorFinishing.h deleted file mode 100644 index a6425621..00000000 --- a/source/Irrlicht/ISceneNodeAnimatorFinishing.h +++ /dev/null @@ -1,36 +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_SCENE_NODE_ANIMATOR_FINISHING_H_INCLUDED__ -#define __I_SCENE_NODE_ANIMATOR_FINISHING_H_INCLUDED__ - -#include "ISceneNode.h" - -namespace irr -{ -namespace scene -{ - //! This is an abstract base class for animators that have a discrete end time. - class ISceneNodeAnimatorFinishing : public ISceneNodeAnimator - { - public: - - //! constructor - ISceneNodeAnimatorFinishing(u32 finishTime) - : FinishTime(finishTime), HasFinished(false) { } - - virtual bool hasFinished(void) const _IRR_OVERRIDE_ { return HasFinished; } - - protected: - - u32 FinishTime; - bool HasFinished; - }; - - -} // end namespace scene -} // end namespace irr - -#endif - diff --git a/source/Irrlicht/Octree.h b/source/Irrlicht/Octree.h deleted file mode 100644 index e9c092b8..00000000 --- a/source/Irrlicht/Octree.h +++ /dev/null @@ -1,389 +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_OCTREE_H_INCLUDED__ -#define __C_OCTREE_H_INCLUDED__ - -#include "SViewFrustum.h" -#include "S3DVertex.h" -#include "aabbox3d.h" -#include "irrArray.h" -#include "CMeshBuffer.h" - -/** - Flags for Octree -*/ -//! bypass full invisible/visible test -#define OCTREE_PARENTTEST - -namespace irr -{ - -//! template octree. -/** T must be a vertex type which has a member -called .Pos, which is a core::vertex3df position. */ -template <class T> -class Octree -{ -public: - - // TODO: Using reference counted class on the stack. - // Reason is likely that it really costs speed here otherwise. - // But doing so prevents using VBO's with octrees. - // Also it's just a bad idea, for example this is the reason - // we can't make the copy-constructor private for IReferenceCounted. - // So would be nice to figure out how to put this on heap (and check - // if it's maybe cheap enough) or maybe stop using CMeshBuffer here. - struct SMeshChunk : public scene::CMeshBuffer<T> - { - SMeshChunk () - : scene::CMeshBuffer<T>(), MaterialId(0) - { - scene::CMeshBuffer<T>::grab(); - } - - virtual ~SMeshChunk () - { - //removeAllHardwareBuffers - } - - s32 MaterialId; - }; - - struct SIndexChunk - { - core::array<u16> Indices; - s32 MaterialId; - }; - - struct SIndexData - { - u16* Indices; - s32 CurrentSize; - s32 MaxSize; - }; - - - //! Constructor - Octree(const core::array<SMeshChunk>& meshes, s32 minimalPolysPerNode=128) : - IndexData(0), IndexDataCount(meshes.size()), NodeCount(0) - { - IndexData = new SIndexData[IndexDataCount]; - - // construct array of all indices - - core::array<SIndexChunk>* indexChunks = new core::array<SIndexChunk>; - indexChunks->reallocate(meshes.size()); - for (u32 i=0; i!=meshes.size(); ++i) - { - IndexData[i].CurrentSize = 0; - IndexData[i].MaxSize = meshes[i].Indices.size(); - IndexData[i].Indices = new u16[IndexData[i].MaxSize]; - - indexChunks->push_back(SIndexChunk()); - SIndexChunk& tic = indexChunks->getLast(); - - tic.MaterialId = meshes[i].MaterialId; - tic.Indices = meshes[i].Indices; - } - - // create tree - Root = new OctreeNode(NodeCount, 0, meshes, indexChunks, minimalPolysPerNode); - } - - //! returns all ids of polygons partially or fully enclosed - //! by this bounding box. - void calculatePolys(const core::aabbox3d<f32>& box) - { - for (u32 i=0; i!=IndexDataCount; ++i) - IndexData[i].CurrentSize = 0; - - Root->getPolys(box, IndexData, 0); - } - - //! returns all ids of polygons partially or fully enclosed - //! by a view frustum. - void calculatePolys(const scene::SViewFrustum& frustum) - { - for (u32 i=0; i!=IndexDataCount; ++i) - IndexData[i].CurrentSize = 0; - - Root->getPolys(frustum, IndexData, 0); - } - - const SIndexData* getIndexData() const - { - return IndexData; - } - - u32 getIndexDataCount() const - { - return IndexDataCount; - } - - u32 getNodeCount() const - { - return NodeCount; - } - - //! for debug purposes only, collects the bounding boxes of the tree - void getBoundingBoxes(const core::aabbox3d<f32>& box, - core::array< const core::aabbox3d<f32>* >&outBoxes) const - { - Root->getBoundingBoxes(box, outBoxes); - } - - //! destructor - ~Octree() - { - for (u32 i=0; i<IndexDataCount; ++i) - delete [] IndexData[i].Indices; - - delete [] IndexData; - delete Root; - } - -private: - // private inner class - class OctreeNode - { - public: - - // constructor - OctreeNode(u32& nodeCount, u32 currentdepth, - const core::array<SMeshChunk>& allmeshdata, - core::array<SIndexChunk>* indices, - s32 minimalPolysPerNode) : IndexData(0), - Depth(currentdepth+1) - { - ++nodeCount; - - u32 i; // new ISO for scoping problem with different compilers - - for (i=0; i!=8; ++i) - Children[i] = 0; - - if (indices->empty()) - { - delete indices; - return; - } - - bool found = false; - - // find first point for bounding box - - for (i=0; i<indices->size(); ++i) - { - if (!(*indices)[i].Indices.empty()) - { - Box.reset(allmeshdata[i].Vertices[(*indices)[i].Indices[0]].Pos); - found = true; - break; - } - } - - if (!found) - { - delete indices; - return; - } - - s32 totalPrimitives = 0; - - // now lets calculate our bounding box - for (i=0; i<indices->size(); ++i) - { - totalPrimitives += (*indices)[i].Indices.size(); - for (u32 j=0; j<(*indices)[i].Indices.size(); ++j) - Box.addInternalPoint(allmeshdata[i].Vertices[(*indices)[i].Indices[j]].Pos); - } - - core::vector3df middle = Box.getCenter(); - core::vector3df edges[8]; - Box.getEdges(edges); - - // calculate all children - core::aabbox3d<f32> box; - core::array<u16> keepIndices; - - if (totalPrimitives > minimalPolysPerNode && !Box.isEmpty()) - for (u32 ch=0; ch!=8; ++ch) - { - box.reset(middle); - box.addInternalPoint(edges[ch]); - - // create indices for child - bool added = false; - core::array<SIndexChunk>* cindexChunks = new core::array<SIndexChunk>; - cindexChunks->reallocate(allmeshdata.size()); - for (i=0; i<allmeshdata.size(); ++i) - { - cindexChunks->push_back(SIndexChunk()); - SIndexChunk& tic = cindexChunks->getLast(); - tic.MaterialId = allmeshdata[i].MaterialId; - - for (u32 t=0; t<(*indices)[i].Indices.size(); t+=3) - { - if (box.isPointInside(allmeshdata[i].Vertices[(*indices)[i].Indices[t]].Pos) && - box.isPointInside(allmeshdata[i].Vertices[(*indices)[i].Indices[t+1]].Pos) && - box.isPointInside(allmeshdata[i].Vertices[(*indices)[i].Indices[t+2]].Pos)) - { - tic.Indices.push_back((*indices)[i].Indices[t]); - tic.Indices.push_back((*indices)[i].Indices[t+1]); - tic.Indices.push_back((*indices)[i].Indices[t+2]); - - added = true; - } - else - { - keepIndices.push_back((*indices)[i].Indices[t]); - keepIndices.push_back((*indices)[i].Indices[t+1]); - keepIndices.push_back((*indices)[i].Indices[t+2]); - } - } - - (*indices)[i].Indices.set_used(keepIndices.size()); - memcpy( (*indices)[i].Indices.pointer(), keepIndices.pointer(), keepIndices.size()*sizeof(u16)); - keepIndices.set_used(0); - } - - if (added) - Children[ch] = new OctreeNode(nodeCount, Depth, - allmeshdata, cindexChunks, minimalPolysPerNode); - else - delete cindexChunks; - - } // end for all possible children - - IndexData = indices; - } - - // destructor - ~OctreeNode() - { - delete IndexData; - - for (u32 i=0; i<8; ++i) - delete Children[i]; - } - - // returns all ids of polygons partially or full enclosed - // by this bounding box. - void getPolys(const core::aabbox3d<f32>& box, SIndexData* idxdata, u32 parentTest ) const - { -#if defined (OCTREE_PARENTTEST ) - // if not full inside - if ( parentTest != 2 ) - { - // partially inside ? - if (!Box.intersectsWithBox(box)) - return; - - // fully inside ? - parentTest = Box.isFullInside(box)?2:1; - } -#else - if (Box.intersectsWithBox(box)) -#endif - { - const u32 cnt = IndexData->size(); - u32 i; // new ISO for scoping problem in some compilers - - for (i=0; i<cnt; ++i) - { - const s32 idxcnt = (*IndexData)[i].Indices.size(); - - if (idxcnt) - { - memcpy(&idxdata[i].Indices[idxdata[i].CurrentSize], - &(*IndexData)[i].Indices[0], idxcnt * sizeof(s16)); - idxdata[i].CurrentSize += idxcnt; - } - } - - for (i=0; i!=8; ++i) - if (Children[i]) - Children[i]->getPolys(box, idxdata,parentTest); - } - } - - // returns all ids of polygons partially or full enclosed - // by the view frustum. - void getPolys(const scene::SViewFrustum& frustum, SIndexData* idxdata,u32 parentTest) const - { - u32 i; // new ISO for scoping problem in some compilers - - // if parent is fully inside, no further check for the children is needed -#if defined (OCTREE_PARENTTEST ) - if ( parentTest != 2 ) -#endif - { -#if defined (OCTREE_PARENTTEST ) - parentTest = 2; -#endif - for (i=0; i!=scene::SViewFrustum::VF_PLANE_COUNT; ++i) - { - core::EIntersectionRelation3D r = Box.classifyPlaneRelation(frustum.planes[i]); - if ( r == core::ISREL3D_FRONT ) - return; -#if defined (OCTREE_PARENTTEST ) - if ( r == core::ISREL3D_CLIPPED ) - parentTest = 1; // must still check children -#endif - } - } - - - const u32 cnt = IndexData->size(); - - for (i=0; i!=cnt; ++i) - { - s32 idxcnt = (*IndexData)[i].Indices.size(); - - if (idxcnt) - { - memcpy(&idxdata[i].Indices[idxdata[i].CurrentSize], - &(*IndexData)[i].Indices[0], idxcnt * sizeof(s16)); - idxdata[i].CurrentSize += idxcnt; - } - } - - for (i=0; i!=8; ++i) - if (Children[i]) - Children[i]->getPolys(frustum, idxdata,parentTest); - } - - //! for debug purposes only, collects the bounding boxes of the node - void getBoundingBoxes(const core::aabbox3d<f32>& box, - core::array< const core::aabbox3d<f32>* >&outBoxes) const - { - if (Box.intersectsWithBox(box)) - { - outBoxes.push_back(&Box); - - for (u32 i=0; i!=8; ++i) - if (Children[i]) - Children[i]->getBoundingBoxes(box, outBoxes); - } - } - - private: - - core::aabbox3df Box; - core::array<SIndexChunk>* IndexData; - OctreeNode* Children[8]; - u32 Depth; - }; - - OctreeNode* Root; - SIndexData* IndexData; - u32 IndexDataCount; - u32 NodeCount; -}; - -} // end namespace - -#endif - diff --git a/source/Irrlicht/SoftwareDriver2_compile_config.h b/source/Irrlicht/SoftwareDriver2_compile_config.h index f76bfe7e..497bf970 100644 --- a/source/Irrlicht/SoftwareDriver2_compile_config.h +++ b/source/Irrlicht/SoftwareDriver2_compile_config.h @@ -10,31 +10,6 @@ // Generic Render Flags for burning's video rasterizer // defined now in irrlicht compile config -#if 1 && defined(PATCH_SUPERTUX_8_0_1_with_1_9_0) -#undef BURNINGVIDEO_RENDERER_BEAUTIFUL - -#define SOFTWARE_DRIVER_2_PERSPECTIVE_CORRECT -#define SOFTWARE_DRIVER_2_SUBTEXEL -#define SOFTWARE_DRIVER_2_BILINEAR -#define SOFTWARE_DRIVER_2_LIGHTING -#define SOFTWARE_DRIVER_2_USE_VERTEX_COLOR -//#define SOFTWARE_DRIVER_2_USE_SEPARATE_SPECULAR_COLOR -#define SOFTWARE_DRIVER_2_USE_WBUFFER -#define SOFTWARE_DRIVER_2_32BIT -#define SOFTWARE_DRIVER_2_TEXTURE_COLOR_FORMAT ECF_A8R8G8B8 -#define SOFTWARE_DRIVER_2_RENDERTARGET_COLOR_FORMAT ECF_A8R8G8B8 -#define SOFTWARE_DRIVER_2_TEXTURE_MAXSIZE 256 -#define SOFTWARE_DRIVER_2_TEXTURE_TRANSFORM -#define SOFTWARE_DRIVER_2_MIPMAPPING_MAX 8 -#define SOFTWARE_DRIVER_2_MIPMAPPING_MIN_SIZE 1 -#define SOFTWARE_DRIVER_2_SCANLINE_MAG_MIN -#define SOFTWARE_DRIVER_2_CLIPPING -#define SOFTWARE_DRIVER_2_2D_AS_3D -#define SOFTWARE_DRIVER_2_INTERLACED - -#endif - -#ifdef BURNINGVIDEO_RENDERER_BEAUTIFUL #define SOFTWARE_DRIVER_2_PERSPECTIVE_CORRECT #define SOFTWARE_DRIVER_2_SUBTEXEL #define SOFTWARE_DRIVER_2_BILINEAR @@ -53,69 +28,6 @@ #define SOFTWARE_DRIVER_2_CLIPPING #define SOFTWARE_DRIVER_2_2D_AS_3D #define SOFTWARE_DRIVER_2_INTERLACED -#endif - -//! Set Flags for Windows Mobile -#ifdef BURNINGVIDEO_RENDERER_CE -#define SOFTWARE_DRIVER_2_PERSPECTIVE_CORRECT -#define SOFTWARE_DRIVER_2_SUBTEXEL -//#define SOFTWARE_DRIVER_2_BILINEAR -//#define SOFTWARE_DRIVER_2_LIGHTING -#define SOFTWARE_DRIVER_2_USE_VERTEX_COLOR -#define SOFTWARE_DRIVER_2_USE_WBUFFER -#define SOFTWARE_DRIVER_2_16BIT -#define SOFTWARE_DRIVER_2_TEXTURE_COLOR_FORMAT ECF_A1R5G5B5 -#define SOFTWARE_DRIVER_2_RENDERTARGET_COLOR_FORMAT ECF_A1R5G5B5 -#define SOFTWARE_DRIVER_2_TEXTURE_MAXSIZE 64 -//#define SOFTWARE_DRIVER_2_TEXTURE_TRANSFORM -#define SOFTWARE_DRIVER_2_MIPMAPPING_MAX 4 -#define SOFTWARE_DRIVER_2_MIPMAPPING_MIN_SIZE 8 -#define SOFTWARE_DRIVER_2_SCANLINE_MAG_MIN -//#define SOFTWARE_DRIVER_2_CLIPPING -#define SOFTWARE_DRIVER_2_2D_AS_2D -#endif - -#ifdef BURNINGVIDEO_RENDERER_FAST -#define SOFTWARE_DRIVER_2_PERSPECTIVE_CORRECT -#define SOFTWARE_DRIVER_2_SUBTEXEL -//#define SOFTWARE_DRIVER_2_BILINEAR -//#define SOFTWARE_DRIVER_2_LIGHTING -#define SOFTWARE_DRIVER_2_USE_VERTEX_COLOR -#define SOFTWARE_DRIVER_2_USE_WBUFFER -#define SOFTWARE_DRIVER_2_16BIT -#define SOFTWARE_DRIVER_2_TEXTURE_MAXSIZE 256 -#define SOFTWARE_DRIVER_2_TEXTURE_COLOR_FORMAT ECF_A1R5G5B5 -#define SOFTWARE_DRIVER_2_RENDERTARGET_COLOR_FORMAT ECF_A1R5G5B5 -#define SOFTWARE_DRIVER_2_MIPMAPPING_MAX 4 -#define SOFTWARE_DRIVER_2_MIPMAPPING_MIN_SIZE 8 -#define SOFTWARE_DRIVER_2_SCANLINE_MAG_MIN -#define SOFTWARE_DRIVER_2_CLIPPING -#define SOFTWARE_DRIVER_2_2D_AS_2D -#define SOFTWARE_DRIVER_2_INTERLACED -#endif - -#ifdef BURNINGVIDEO_RENDERER_ULTRA_FAST -#define BURNINGVIDEO_RENDERER_FAST - -//#define SOFTWARE_DRIVER_2_PERSPECTIVE_CORRECT -//#define SOFTWARE_DRIVER_2_SUBTEXEL -//#define SOFTWARE_DRIVER_2_BILINEAR -//#define SOFTWARE_DRIVER_2_LIGHTING -#define SOFTWARE_DRIVER_2_USE_VERTEX_COLOR -//#define SOFTWARE_DRIVER_2_USE_WBUFFER -#define SOFTWARE_DRIVER_2_16BIT -#define SOFTWARE_DRIVER_2_TEXTURE_MAXSIZE 128 -#define SOFTWARE_DRIVER_2_TEXTURE_COLOR_FORMAT ECF_A1R5G5B5 -#define SOFTWARE_DRIVER_2_RENDERTARGET_COLOR_FORMAT ECF_A1R5G5B5 -//#define SOFTWARE_DRIVER_2_TEXTURE_TRANSFORM -#define SOFTWARE_DRIVER_2_MIPMAPPING_MAX 1 -#define SOFTWARE_DRIVER_2_MIPMAPPING_MIN_SIZE 1 -#define SOFTWARE_DRIVER_2_SCANLINE_MAG_MIN -//#define SOFTWARE_DRIVER_2_CLIPPING -#define SOFTWARE_DRIVER_2_2D_AS_2D -#define SOFTWARE_DRIVER_2_INTERLACED -#endif - #ifndef REALINLINE #ifdef _MSC_VER diff --git a/source/Irrlicht/burning_shader_color.cpp b/source/Irrlicht/burning_shader_color.cpp deleted file mode 100644 index 3af52abc..00000000 --- a/source/Irrlicht/burning_shader_color.cpp +++ /dev/null @@ -1,95 +0,0 @@ -// Copyright (C) 2002-2012 Nikolaus Gebhardt / Thomas Alten -// This file is part of the "Irrlicht Engine". -// For conditions of distribution and use, see copyright notice in irrlicht.h - -#include "IrrCompileConfig.h" -#include "IBurningShader.h" - -#ifdef _IRR_COMPILE_WITH_BURNINGSVIDEO_ - -namespace irr -{ - -namespace video -{ - -#define burning_shader_class burning_shader_color -#define burning_shader_frag "burning_shader_color_fraq.h" -#include "burning_shader_compile_fragment_default.h" - - -/*! -*/ -void burning_shader_class::OnSetMaterial(const SBurningShaderMaterial& material) -{ - switch (material.org.MaterialType) - { - case EMT_TRANSPARENT_ADD_COLOR: - case EMT_NORMAL_MAP_TRANSPARENT_ADD_COLOR: - case EMT_PARALLAX_MAP_TRANSPARENT_ADD_COLOR: - //glBlendFunc(GL_ONE, GL_ONE_MINUS_SRC_COLOR); - - case EMT_TRANSPARENT_ALPHA_CHANNEL: - //glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); - - case EMT_TRANSPARENT_ALPHA_CHANNEL_REF: - //? glBlendFunc(GL_ONE,GL_ZERO) or glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); - - case EMT_TRANSPARENT_REFLECTION_2_LAYER: - - case EMT_TRANSPARENT_VERTEX_ALPHA: - case EMT_NORMAL_MAP_TRANSPARENT_VERTEX_ALPHA: - case EMT_PARALLAX_MAP_TRANSPARENT_VERTEX_ALPHA: - RenderPass_ShaderIsTransparent = 1; - AlphaRef = tofix(material.org.MaterialTypeParam, FIXPOINT_COLOR_MAX); - break; - default: - RenderPass_ShaderIsTransparent = 0; - AlphaRef = 0; - break; - } - - if (0 == RenderPass_ShaderIsTransparent) - { - if (material.org.ZBuffer == ECFN_LESSEQUAL) - { - if (material.depth_write) fragmentShader = &burning_shader_class::fragment_depth_less_equal_depth_write_blend_one_zero; - else fragmentShader = &burning_shader_class::fragment_depth_less_equal_no_depth_write_blend_one_zero; - } - else /*if (material.org.ZBuffer == ECFN_DISABLED)*/ - { - //check triangle on w = 1.f instead.. -#ifdef SOFTWARE_DRIVER_2_BILINEAR - if (material.org.TextureLayer[0].BilinearFilter) fragmentShader = &burning_shader_class::fragment_nodepth_perspective_blend_one_zero; - else -#endif - fragmentShader = &burning_shader_class::fragment_nodepth_noperspective_blend_one_zero; - } - } - else - { - if (material.org.ZBuffer == ECFN_LESSEQUAL) - { - if (material.depth_write) fragmentShader = &burning_shader_class::fragment_depth_less_equal_depth_write_blend_src_alpha_one_minus_src_alpha; - else fragmentShader = &burning_shader_class::fragment_depth_less_equal_no_depth_write_blend_src_alpha_one_minus_src_alpha; - } - else /*if (material.org.ZBuffer == ECFN_DISABLED)*/ - { - //check triangle on w = 1.f instead.. -#ifdef SOFTWARE_DRIVER_2_BILINEAR - if (material.org.TextureLayer[0].BilinearFilter) fragmentShader = &burning_shader_class::fragment_nodepth_perspective_blend_src_alpha_one_minus_src_alpha; - else -#endif - fragmentShader = &burning_shader_class::fragment_nodepth_noperspective_blend_src_alpha_one_minus_src_alpha; - } - } - -} - - - -} // end namespace video -} // end namespace irr - -#endif // _IRR_COMPILE_WITH_BURNINGSVIDEO_ - diff --git a/source/Irrlicht/burning_shader_color_fraq.h b/source/Irrlicht/burning_shader_color_fraq.h deleted file mode 100644 index f9efae2d..00000000 --- a/source/Irrlicht/burning_shader_color_fraq.h +++ /dev/null @@ -1,24 +0,0 @@ -// pixelshader -#ifdef IPOL_C0 - -#ifdef IPOL_A0 -vec4_to_fix(a0, r0, g0, b0, line.c[0][0], inversew); -if (a0 > AlphaRef) -{ - color_to_fix(r1, g1, b1, dst[i]); - - fix_color_norm(a0); - r0 = r1 + imulFix(a0, r0 - r1); - g0 = g1 + imulFix(a0, g0 - g1); - b0 = b1 + imulFix(a0, b0 - b1); - dst[i] = fix_to_sample(r0, g0, b0); -} -#else -vec4_to_fix(r0, g0, b0, line.c[0][0], inversew); -dst[i] = fix_to_sample(r0, g0, b0); -#endif - -#else -dst[i] = PrimitiveColor; -#endif - diff --git a/source/Irrlicht/burning_shader_compile_fragment_default.h b/source/Irrlicht/burning_shader_compile_fragment_default.h deleted file mode 100644 index ab5bb7c7..00000000 --- a/source/Irrlicht/burning_shader_compile_fragment_default.h +++ /dev/null @@ -1,164 +0,0 @@ - - -class burning_shader_class : public IBurningShader -{ -public: - - //! constructor - burning_shader_class(CBurningVideoDriver* driver); - - //! draws an indexed triangle list - virtual void drawTriangle(const s4DVertex* burning_restrict a, const s4DVertex* burning_restrict b, const s4DVertex* burning_restrict c) _IRR_OVERRIDE_; - virtual bool canWireFrame() { return true; } - - virtual void OnSetMaterial(const SBurningShaderMaterial& material) _IRR_OVERRIDE_; - -private: - - // fragment shader - typedef void (burning_shader_class::*tFragmentShader) (); - void fragment_depth_less_equal_depth_write_blend_one_zero(); - void fragment_depth_less_equal_no_depth_write_blend_one_zero(); - void fragment_nodepth_perspective_blend_one_zero(); - void fragment_nodepth_noperspective_blend_one_zero(); // 2D Gradient - - void fragment_depth_less_equal_depth_write_blend_src_alpha_one_minus_src_alpha(); - void fragment_depth_less_equal_no_depth_write_blend_src_alpha_one_minus_src_alpha(); - void fragment_nodepth_perspective_blend_src_alpha_one_minus_src_alpha(); - void fragment_nodepth_noperspective_blend_src_alpha_one_minus_src_alpha(); - - - tFragmentShader fragmentShader; - -}; - - -//! constructor -burning_shader_class::burning_shader_class(CBurningVideoDriver* driver) - : IBurningShader(driver) -{ -#ifdef _DEBUG - setDebugName(burning_stringify(burning_shader_class) ); -#endif - - fragmentShader = &burning_shader_class::fragment_depth_less_equal_depth_write_blend_one_zero; - -} - - -IBurningShader* burning_create(burning_shader_class)(CBurningVideoDriver* driver) -{ - return new burning_shader_class(driver); -} - - - -// compile flag for this triangle -#include "burning_shader_compile_start.h" -#define SUBTEXEL -#define IPOL_W -#define IPOL_C0 -#define USE_ZBUFFER -#define CMP_W -#include "burning_shader_compile_triangle.h" - -// compile flag for this scanline fragment -#include "burning_shader_compile_start.h" -#define burning_shader_fragment fragment_nodepth_noperspective_blend_one_zero -#define SUBTEXEL -#define IPOL_C0 -#define INVERSE_W_RANGE FIX_POINT_F32_MUL*COLOR_MAX -#include "burning_shader_compile_fragment_start.h" -#include burning_shader_frag -#include "burning_shader_compile_fragment_end.h" - -#include "burning_shader_compile_start.h" -#define burning_shader_fragment fragment_nodepth_perspective_blend_one_zero -#define SUBTEXEL -#define INVERSE_W -#define IPOL_W -#define IPOL_C0 -#define INVERSE_W_RANGE FIX_POINT_F32_MUL*COLOR_MAX -#include "burning_shader_compile_fragment_start.h" -#include burning_shader_frag -#include "burning_shader_compile_fragment_end.h" - -#include "burning_shader_compile_start.h" -#define burning_shader_fragment fragment_depth_less_equal_no_depth_write_blend_one_zero -#define SUBTEXEL -#define INVERSE_W -#define IPOL_W -#define IPOL_C0 -#define USE_ZBUFFER -#define CMP_W -#define INVERSE_W_RANGE FIX_POINT_F32_MUL*COLOR_MAX -#include "burning_shader_compile_fragment_start.h" -#include burning_shader_frag -#include "burning_shader_compile_fragment_end.h" - -#include "burning_shader_compile_start.h" -#define burning_shader_fragment fragment_depth_less_equal_depth_write_blend_one_zero -#define SUBTEXEL -#define INVERSE_W -#define IPOL_W -#define IPOL_C0 -#define USE_ZBUFFER -#define CMP_W -#define WRITE_W -#define INVERSE_W_RANGE FIX_POINT_F32_MUL*COLOR_MAX -#include "burning_shader_compile_fragment_start.h" -#include burning_shader_frag -#include "burning_shader_compile_fragment_end.h" - - -// compile flag for this scanline fragment -#include "burning_shader_compile_start.h" -#define burning_shader_fragment fragment_nodepth_noperspective_blend_src_alpha_one_minus_src_alpha -#define SUBTEXEL -#define IPOL_C0 -#define IPOL_A0 -#define INVERSE_W_RANGE FIX_POINT_F32_MUL*COLOR_MAX -#include "burning_shader_compile_fragment_start.h" -#include burning_shader_frag -#include "burning_shader_compile_fragment_end.h" - -#include "burning_shader_compile_start.h" -#define burning_shader_fragment fragment_nodepth_perspective_blend_src_alpha_one_minus_src_alpha -#define SUBTEXEL -#define INVERSE_W -#define IPOL_W -#define IPOL_C0 -#define IPOL_A0 -#define INVERSE_W_RANGE FIX_POINT_F32_MUL*COLOR_MAX -#include "burning_shader_compile_fragment_start.h" -#include burning_shader_frag -#include "burning_shader_compile_fragment_end.h" - -#include "burning_shader_compile_start.h" -#define burning_shader_fragment fragment_depth_less_equal_no_depth_write_blend_src_alpha_one_minus_src_alpha -#define SUBTEXEL -#define INVERSE_W -#define IPOL_W -#define IPOL_C0 -#define IPOL_A0 -#define USE_ZBUFFER -#define CMP_W -#define INVERSE_W_RANGE FIX_POINT_F32_MUL*COLOR_MAX -#include "burning_shader_compile_fragment_start.h" -#include burning_shader_frag -#include "burning_shader_compile_fragment_end.h" - -#include "burning_shader_compile_start.h" -#define burning_shader_fragment fragment_depth_less_equal_depth_write_blend_src_alpha_one_minus_src_alpha -#define SUBTEXEL -#define INVERSE_W -#define IPOL_W -#define IPOL_C0 -#define IPOL_A0 -#define USE_ZBUFFER -#define CMP_W -#define WRITE_W -#define INVERSE_W_RANGE FIX_POINT_F32_MUL*COLOR_MAX -#include "burning_shader_compile_fragment_start.h" -#include burning_shader_frag -#include "burning_shader_compile_fragment_end.h" diff --git a/source/Irrlicht/burning_shader_compile_fragment_end.h b/source/Irrlicht/burning_shader_compile_fragment_end.h deleted file mode 100644 index 8e4719e7..00000000 --- a/source/Irrlicht/burning_shader_compile_fragment_end.h +++ /dev/null @@ -1,20 +0,0 @@ - } - -#ifdef IPOL_Z - line.z[0] += slopeZ; -#endif -#ifdef IPOL_W - line.w[0] += slopeW; -#endif -#ifdef IPOL_C0 - line.c[0][0] += slopeC; -#endif -#ifdef IPOL_T0 - line.t[0][0] += slopeT[0]; -#endif -#ifdef IPOL_T1 - line.t[1][0] += slopeT[1]; -#endif - } - -} diff --git a/source/Irrlicht/burning_shader_compile_fragment_start.h b/source/Irrlicht/burning_shader_compile_fragment_start.h deleted file mode 100644 index 15306449..00000000 --- a/source/Irrlicht/burning_shader_compile_fragment_start.h +++ /dev/null @@ -1,119 +0,0 @@ -#include "burning_shader_compile_verify.h" - -/*! -*/ -void burning_shader_class::burning_shader_fragment() -{ - tVideoSample *dst; - -#ifdef USE_ZBUFFER - fp24 *z; -#endif - - s32 xStart; - s32 xEnd; - s32 dx; - -#ifdef SUBTEXEL - f32 subPixel; -#endif - -#ifdef IPOL_Z - f32 slopeZ; -#endif -#ifdef IPOL_W - fp24 slopeW; -#endif -#ifdef IPOL_C0 - sVec4 slopeC; -#endif -#ifdef IPOL_T0 - sVec2 slopeT[BURNING_MATERIAL_MAX_TEXTURES]; -#endif - - // apply top-left fill-convention, left - xStart = fill_convention_left(line.x[0]); - xEnd = fill_convention_right(line.x[1]); - - dx = xEnd - xStart; - if (dx < 0) - return; - - // slopes - const f32 invDeltaX = fill_step_x(line.x[1] - line.x[0]); - -#ifdef IPOL_Z - slopeZ = (line.z[1] - line.z[0]) * invDeltaX; -#endif -#ifdef IPOL_W - slopeW = (line.w[1] - line.w[0]) * invDeltaX; -#endif -#ifdef IPOL_C0 - slopeC = (line.c[0][1] - line.c[0][0]) * invDeltaX; -#endif -#ifdef IPOL_T0 - slopeT[0] = (line.t[0][1] - line.t[0][0]) * invDeltaX; -#endif -#ifdef IPOL_T1 - slopeT[1] = (line.t[1][1] - line.t[1][0]) * invDeltaX; -#endif - -#ifdef SUBTEXEL - subPixel = ((f32)xStart) - line.x[0]; -#ifdef IPOL_Z - line.z[0] += slopeZ * subPixel; -#endif -#ifdef IPOL_W - line.w[0] += slopeW * subPixel; -#endif -#ifdef IPOL_C0 - line.c[0][0] += slopeC * subPixel; -#endif -#ifdef IPOL_T0 - line.t[0][0] += slopeT[0] * subPixel; -#endif -#ifdef IPOL_T1 - line.t[1][0] += slopeT[1] * subPixel; -#endif -#endif - - SOFTWARE_DRIVER_2_CLIPCHECK; - dst = (tVideoSample*)RenderTarget->getData() + (line.y * RenderTarget->getDimension().Width) + xStart; - -#ifdef USE_ZBUFFER - z = (fp24*)DepthBuffer->lock() + (line.y * RenderTarget->getDimension().Width) + xStart; -#endif - - - f32 inversew = INVERSE_W_RANGE; - -#ifdef IPOL_C0 - tFixPoint r0, g0, b0; -#endif - -#ifdef IPOL_A0 - tFixPoint a0; - tFixPoint r1, g1, b1; -#endif - - for (s32 i = 0; i <= dx; i+= SOFTWARE_DRIVER_2_STEP_X) - { - if ((0 == EdgeTestPass) & (i > line.x_edgetest)) break; - -#ifdef CMP_Z - if (line.z[0] < z[i]) -#endif -#ifdef CMP_W - if (line.w[0] >= z[i]) -#endif - { -#ifdef WRITE_Z - z[i] = line.z[0]; -#endif -#ifdef WRITE_W - z[i] = line.w[0]; -#endif - /* Pixel Shader here */ -#ifdef INVERSE_W - inversew = (INVERSE_W_RANGE) / line.w[0]; /* fix_inverse32(line.w[0]);*/ -#endif diff --git a/source/Irrlicht/burning_shader_compile_start.h b/source/Irrlicht/burning_shader_compile_start.h deleted file mode 100644 index 0d8a5f77..00000000 --- a/source/Irrlicht/burning_shader_compile_start.h +++ /dev/null @@ -1,24 +0,0 @@ -// undef compile flag for this file -#undef USE_ZBUFFER -#undef IPOL_Z -#undef CMP_Z -#undef WRITE_Z - -#undef IPOL_W -#undef CMP_W -#undef WRITE_W - -#undef SUBTEXEL -#undef INVERSE_W - -#undef IPOL_C0 -#undef IPOL_A0 -#undef IPOL_T0 -#undef IPOL_T1 -#undef IPOL_T2 -#undef IPOL_L0 - -#undef burning_shader_fragment -#undef ipol_test - -#undef INVERSE_W_RANGE diff --git a/source/Irrlicht/burning_shader_compile_triangle.h b/source/Irrlicht/burning_shader_compile_triangle.h deleted file mode 100644 index 5594b989..00000000 --- a/source/Irrlicht/burning_shader_compile_triangle.h +++ /dev/null @@ -1,373 +0,0 @@ -#include "burning_shader_compile_verify.h" - - -void burning_shader_class::drawTriangle(const s4DVertex* burning_restrict a, const s4DVertex* burning_restrict b, const s4DVertex* burning_restrict c) -{ - // sort on height, y - if (a->Pos.y > b->Pos.y) swapVertexPointer(&a, &b); - if (a->Pos.y > c->Pos.y) swapVertexPointer(&a, &c); - if (b->Pos.y > c->Pos.y) swapVertexPointer(&b, &c); - - const f32 ca = c->Pos.y - a->Pos.y; - const f32 ba = b->Pos.y - a->Pos.y; - const f32 cb = c->Pos.y - b->Pos.y; - - // calculate delta y of the edges - scan.invDeltaY[0] = reciprocal_edge(ca); - scan.invDeltaY[1] = reciprocal_edge(ba); - scan.invDeltaY[2] = reciprocal_edge(cb); - - if (F32_LOWER_EQUAL_0(scan.invDeltaY[0])) - return; - - // find if the major edge is left or right aligned - f32 temp[4]; - - temp[0] = a->Pos.x - c->Pos.x; - temp[1] = -ca; - temp[2] = b->Pos.x - a->Pos.x; - temp[3] = ba; - - scan.left = (temp[0] * temp[3] - temp[1] * temp[2]) > 0.f ? 0 : 1; - scan.right = 1 - scan.left; - - // calculate slopes for the major edge - scan.slopeX[0] = (c->Pos.x - a->Pos.x) * scan.invDeltaY[0]; - scan.x[0] = a->Pos.x; - -#ifdef IPOL_Z - scan.slopeZ[0] = (c->Pos.z - a->Pos.z) * scan.invDeltaY[0]; - scan.z[0] = a->Pos.z; -#endif - -#ifdef IPOL_W - scan.slopeW[0] = (c->Pos.w - a->Pos.w) * scan.invDeltaY[0]; - scan.w[0] = a->Pos.w; -#endif - -#ifdef IPOL_C0 - scan.slopeC[0][0] = (c->Color[0] - a->Color[0]) * scan.invDeltaY[0]; - scan.c[0][0] = a->Color[0]; -#endif - -#ifdef IPOL_T0 - scan.slopeT[0][0] = (c->Tex[0] - a->Tex[0]) * scan.invDeltaY[0]; - scan.t[0][0] = a->Tex[0]; -#endif - -#ifdef IPOL_T1 - scan.slopeT[1][0] = (c->Tex[1] - a->Tex[1]) * scan.invDeltaY[0]; - scan.t[1][0] = a->Tex[1]; -#endif - - // top left fill convention y run - s32 yStart; - s32 yEnd; - -#ifdef SUBTEXEL - f32 subPixel; -#endif - - - // rasterize upper sub-triangle - if (F32_GREATER_0(scan.invDeltaY[1])) - { - // calculate slopes for top edge - scan.slopeX[1] = (b->Pos.x - a->Pos.x) * scan.invDeltaY[1]; - scan.x[1] = a->Pos.x; - -#ifdef IPOL_Z - scan.slopeZ[1] = (b->Pos.z - a->Pos.z) * scan.invDeltaY[1]; - scan.z[1] = a->Pos.z; -#endif - -#ifdef IPOL_W - scan.slopeW[1] = (b->Pos.w - a->Pos.w) * scan.invDeltaY[1]; - scan.w[1] = a->Pos.w; -#endif - -#ifdef IPOL_C0 - scan.slopeC[0][1] = (b->Color[0] - a->Color[0]) * scan.invDeltaY[1]; - scan.c[0][1] = a->Color[0]; -#endif - -#ifdef IPOL_T0 - scan.slopeT[0][1] = (b->Tex[0] - a->Tex[0]) * scan.invDeltaY[1]; - scan.t[0][1] = a->Tex[0]; -#endif - -#ifdef IPOL_T1 - scan.slopeT[1][1] = (b->Tex[1] - a->Tex[1]) * scan.invDeltaY[1]; - scan.t[1][1] = a->Tex[1]; -#endif - - // apply top-left fill convention, top part - yStart = fill_convention_left(a->Pos.y); - yEnd = fill_convention_right(b->Pos.y); - -#ifdef SUBTEXEL - subPixel = ((f32)yStart) - a->Pos.y; - - // correct to pixel center - scan.x[0] += scan.slopeX[0] * subPixel; - scan.x[1] += scan.slopeX[1] * subPixel; - -#ifdef IPOL_Z - scan.z[0] += scan.slopeZ[0] * subPixel; - scan.z[1] += scan.slopeZ[1] * subPixel; -#endif - -#ifdef IPOL_W - scan.w[0] += scan.slopeW[0] * subPixel; - scan.w[1] += scan.slopeW[1] * subPixel; -#endif - -#ifdef IPOL_C0 - scan.c[0][0] += scan.slopeC[0][0] * subPixel; - scan.c[0][1] += scan.slopeC[0][1] * subPixel; -#endif - -#ifdef IPOL_T0 - scan.t[0][0] += scan.slopeT[0][0] * subPixel; - scan.t[0][1] += scan.slopeT[0][1] * subPixel; -#endif - -#ifdef IPOL_T1 - scan.t[1][0] += scan.slopeT[1][0] * subPixel; - scan.t[1][1] += scan.slopeT[1][1] * subPixel; -#endif - -#endif - - line.x_edgetest = fill_convention_edge(scan.slopeX[scan.left]); - - // rasterize the edge scanlines - for (line.y = yStart; line.y <= yEnd; line.y += SOFTWARE_DRIVER_2_STEP_Y) - { - line.x[scan.left] = scan.x[0]; - line.x[scan.right] = scan.x[1]; - -#ifdef IPOL_Z - line.z[scan.left] = scan.z[0]; - line.z[scan.right] = scan.z[1]; -#endif - -#ifdef IPOL_W - line.w[scan.left] = scan.w[0]; - line.w[scan.right] = scan.w[1]; -#endif - -#ifdef IPOL_C0 - line.c[0][scan.left] = scan.c[0][0]; - line.c[0][scan.right] = scan.c[0][1]; -#endif - -#ifdef IPOL_T0 - line.t[0][scan.left] = scan.t[0][0]; - line.t[0][scan.right] = scan.t[0][1]; -#endif - -#ifdef IPOL_T1 - line.t[1][scan.left] = scan.t[1][0]; - line.t[1][scan.right] = scan.t[1][1]; -#endif - - // render a scanline - interlace_scanline - (this->*fragmentShader) (); - if (EdgeTestPass & edge_test_first_line) break; - - scan.x[0] += scan.slopeX[0]; - scan.x[1] += scan.slopeX[1]; - -#ifdef IPOL_Z - scan.z[0] += scan.slopeZ[0]; - scan.z[1] += scan.slopeZ[1]; -#endif - -#ifdef IPOL_W - scan.w[0] += scan.slopeW[0]; - scan.w[1] += scan.slopeW[1]; -#endif - -#ifdef IPOL_C0 - scan.c[0][0] += scan.slopeC[0][0]; - scan.c[0][1] += scan.slopeC[0][1]; -#endif - -#ifdef IPOL_T0 - scan.t[0][0] += scan.slopeT[0][0]; - scan.t[0][1] += scan.slopeT[0][1]; -#endif - -#ifdef IPOL_T1 - scan.t[1][0] += scan.slopeT[1][0]; - scan.t[1][1] += scan.slopeT[1][1]; -#endif - } - } - - // rasterize lower sub-triangle - if (F32_GREATER_0(scan.invDeltaY[2])) - { - // advance to middle point - if (F32_GREATER_0(scan.invDeltaY[1])) - { - temp[0] = b->Pos.y - a->Pos.y; // dy - - scan.x[0] = a->Pos.x + scan.slopeX[0] * temp[0]; -#ifdef IPOL_Z - scan.z[0] = a->Pos.z + scan.slopeZ[0] * temp[0]; -#endif -#ifdef IPOL_W - scan.w[0] = a->Pos.w + scan.slopeW[0] * temp[0]; -#endif -#ifdef IPOL_C0 - scan.c[0][0] = a->Color[0] + scan.slopeC[0][0] * temp[0]; -#endif -#ifdef IPOL_T0 - scan.t[0][0] = a->Tex[0] + scan.slopeT[0][0] * temp[0]; -#endif -#ifdef IPOL_T1 - scan.t[1][0] = a->Tex[1] + scan.slopeT[1][0] * temp[0]; -#endif - - } - - // calculate slopes for bottom edge - scan.slopeX[1] = (c->Pos.x - b->Pos.x) * scan.invDeltaY[2]; - scan.x[1] = b->Pos.x; - -#ifdef IPOL_Z - scan.slopeZ[1] = (c->Pos.z - b->Pos.z) * scan.invDeltaY[2]; - scan.z[1] = b->Pos.z; -#endif - -#ifdef IPOL_W - scan.slopeW[1] = (c->Pos.w - b->Pos.w) * scan.invDeltaY[2]; - scan.w[1] = b->Pos.w; -#endif - -#ifdef IPOL_C0 - scan.slopeC[0][1] = (c->Color[0] - b->Color[0]) * scan.invDeltaY[2]; - scan.c[0][1] = b->Color[0]; -#endif - -#ifdef IPOL_T0 - scan.slopeT[0][1] = (c->Tex[0] - b->Tex[0]) * scan.invDeltaY[2]; - scan.t[0][1] = b->Tex[0]; -#endif - -#ifdef IPOL_T1 - scan.slopeT[1][1] = (c->Tex[1] - b->Tex[1]) * scan.invDeltaY[2]; - scan.t[1][1] = b->Tex[1]; -#endif - - // apply top-left fill convention, top part - yStart = fill_convention_left(b->Pos.y); - yEnd = fill_convention_right(c->Pos.y); - -#ifdef SUBTEXEL - subPixel = ((f32)yStart) - b->Pos.y; - - // correct to pixel center - scan.x[0] += scan.slopeX[0] * subPixel; - scan.x[1] += scan.slopeX[1] * subPixel; - -#ifdef IPOL_Z - scan.z[0] += scan.slopeZ[0] * subPixel; - scan.z[1] += scan.slopeZ[1] * subPixel; -#endif - -#ifdef IPOL_W - scan.w[0] += scan.slopeW[0] * subPixel; - scan.w[1] += scan.slopeW[1] * subPixel; -#endif - -#ifdef IPOL_C0 - scan.c[0][0] += scan.slopeC[0][0] * subPixel; - scan.c[0][1] += scan.slopeC[0][1] * subPixel; -#endif - -#ifdef IPOL_T0 - scan.t[0][0] += scan.slopeT[0][0] * subPixel; - scan.t[0][1] += scan.slopeT[0][1] * subPixel; -#endif - -#ifdef IPOL_T1 - scan.t[1][0] += scan.slopeT[1][0] * subPixel; - scan.t[1][1] += scan.slopeT[1][1] * subPixel; -#endif - -#endif - - line.x_edgetest = fill_convention_edge(scan.slopeX[scan.left]); - - // rasterize the edge scanlines - for (line.y = yStart; line.y <= yEnd; line.y += SOFTWARE_DRIVER_2_STEP_Y) - { - line.x[scan.left] = scan.x[0]; - line.x[scan.right] = scan.x[1]; - -#ifdef IPOL_Z - line.z[scan.left] = scan.z[0]; - line.z[scan.right] = scan.z[1]; -#endif - -#ifdef IPOL_W - line.w[scan.left] = scan.w[0]; - line.w[scan.right] = scan.w[1]; -#endif - -#ifdef IPOL_C0 - line.c[0][scan.left] = scan.c[0][0]; - line.c[0][scan.right] = scan.c[0][1]; -#endif - -#ifdef IPOL_T0 - line.t[0][scan.left] = scan.t[0][0]; - line.t[0][scan.right] = scan.t[0][1]; -#endif - -#ifdef IPOL_T1 - line.t[1][scan.left] = scan.t[1][0]; - line.t[1][scan.right] = scan.t[1][1]; -#endif - - // render a scanline - interlace_scanline - (this->*fragmentShader) (); - if (EdgeTestPass & edge_test_first_line) break; - - scan.x[0] += scan.slopeX[0]; - scan.x[1] += scan.slopeX[1]; - -#ifdef IPOL_Z - scan.z[0] += scan.slopeZ[0]; - scan.z[1] += scan.slopeZ[1]; -#endif - -#ifdef IPOL_W - scan.w[0] += scan.slopeW[0]; - scan.w[1] += scan.slopeW[1]; -#endif - -#ifdef IPOL_C0 - scan.c[0][0] += scan.slopeC[0][0]; - scan.c[0][1] += scan.slopeC[0][1]; -#endif - -#ifdef IPOL_T0 - scan.t[0][0] += scan.slopeT[0][0]; - scan.t[0][1] += scan.slopeT[0][1]; -#endif - -#ifdef IPOL_T1 - scan.t[1][0] += scan.slopeT[1][0]; - scan.t[1][1] += scan.slopeT[1][1]; -#endif - - } - } - -} diff --git a/source/Irrlicht/burning_shader_compile_verify.h b/source/Irrlicht/burning_shader_compile_verify.h deleted file mode 100644 index c31c5754..00000000 --- a/source/Irrlicht/burning_shader_compile_verify.h +++ /dev/null @@ -1,43 +0,0 @@ -// apply global override -#ifndef SOFTWARE_DRIVER_2_PERSPECTIVE_CORRECT -#undef INVERSE_W -#endif - -#ifndef SOFTWARE_DRIVER_2_SUBTEXEL -#undef SUBTEXEL -#endif - -#if BURNING_MATERIAL_MAX_COLORS < 1 -#undef IPOL_C0 -#undef IPOL_A0 -#endif - -#if BURNING_MATERIAL_MAX_LIGHT_TANGENT < 1 -#undef IPOL_L0 -#endif - - -// 1/x * FIX_POINT -#if !defined(INVERSE_W_RANGE) - #define INVERSE_W_RANGE FIX_POINT_F32_MUL -#endif - -#if defined ( SOFTWARE_DRIVER_2_USE_WBUFFER ) || defined ( SOFTWARE_DRIVER_2_PERSPECTIVE_CORRECT ) -#else - -#ifdef IPOL_W - #undef IPOL_W - #define IPOL_Z -#endif - -#ifdef CMP_W - #undef CMP_W - #define CMP_Z -#endif - -#ifdef WRITE_W - #undef WRITE_W - #define WRITE_Z -#endif - -#endif diff --git a/source/Irrlicht/dmfsupport.h b/source/Irrlicht/dmfsupport.h deleted file mode 100644 index 721f7037..00000000 --- a/source/Irrlicht/dmfsupport.h +++ /dev/null @@ -1,732 +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 -// -// This file was originally written by Salvatore Russo. -// I (Nikolaus Gebhardt) did some minor modifications changes to it and integrated -// it into Irrlicht: -// - removed STL dependency -// - removed log file and replaced it with irrlicht logging -// - adapted code formatting a bit to Irrlicht style -// - removed memory leaks -// Thanks a lot to Salvatore for his work on this and that he gave me -// his permission to add it into Irrlicht. - -// This support library has been made by Salvatore Russo and is released under GNU public license for general uses. -// For uses in Irrlicht core and only for Irrlicht related uses I release this library under zlib license. - -#ifndef __DMF_SUPPORT_H_INCLUDED__ -#define __DMF_SUPPORT_H_INCLUDED__ - -#include "irrString.h" -#include "fast_atof.h" - -namespace irr -{ -namespace scene -{ -namespace -{ - -/** A structure representing some DeleD infos. -This structure contains data about DeleD level file like: version, ambient color, number of objects etc...*/ -struct dmfHeader -{ - //main file header - core::stringc dmfName; //!<Scene name - f32 dmfVersion; //!<File version - video::SColor dmfAmbient; //!<Ambient color - f32 dmfShadow; //!<Shadow intensity - u32 numObjects; //!<Number of objects in this scene - u32 numMaterials; //!<Number of materials in this scene - u32 numVertices; //!<Total number of vertices faces*(vertices for each face) - u32 numFaces; //!<Total number of faces - u32 numLights; //!<Number of dynamic lights in this scene - u32 numWatVertices; //!<Total number of vertices of water plains watfaces*(vertices for each face) - u32 numWatFaces; //!<Total number of faces for water plains.Note that each water plane is a rectangle with one face only. -}; - - -/** A structure representing a DeleD material. -This structure contains texture names, an ID and some flags.*/ -struct dmfMaterial -{ - u32 materialID;//!<This material unique ID. - u32 textureLayers;//!<First texture Flag (0=Normal, 1=Color). - u32 textureFlag;//!<First texture Flag (0=Normal, 1=Color). - u32 lightmapFlag;//!<Lightmap Flag (0=Normal, others not considered). - u32 textureBlend;//!<Texture Blend mode used to support alpha maps (4=Alpha map, others not implemented yet). - core::stringc pathName;//!<Name of path defined in path element. - core::stringc textureName;//!<Name of first texture (only file name, no path). - core::stringc lightmapName;//!<Name of lightmap (only file name, no path). - u32 lightmapBlend;//!<Blend mode used to support alpha maps (not implemented yet). -}; - - -/** A structure representing a single face. -This structure contains first vertice index, number of vertices and the material used.*/ -struct dmfFace -{ - u32 firstVert;//!<First vertex index. - u32 numVerts;//!<Number of vertices for this face. - u32 materialID;//!<Material used for this face. -}; - - -/** A structure representing a single vertice. -This structure contains vertice position coordinates and texture an lightmap UV.*/ -struct dmfVert -{ - core::vector3df pos;//!<Position of vertex - core::vector2df tc;//!<Texture UV coords - core::vector2df lc;//!<Lightmap UV coords -}; - - -/** A structure representing a single dynamic light. -This structure contains light position coordinates, diffuse color, specular color and maximum radius of light.*/ -struct dmfLight -{ - core::vector3df pos;//!<Position of this light. - video::SColorf diffuseColor;//!<Diffuse color. - video::SColorf specularColor;//!<Specular color. - f32 radius;//!<Maximum radius of light. -}; - -/** A structure representing a single water plane. -This structure contains light position coordinates, diffuse color, specular color and maximum radius of light.*/ -struct dmfWaterPlane -{ - u32 waterID;//!<ID of specified water plane. - u32 numFaces;//!<number of faces that make this plain.Owing to the fact that this is a rectangle you'll have 1 every time. - u32 firstFace;//!<first face of this plain. - core::dimension2d<u32> tileNum;//!<number of tiles of this water plain. - f32 waveHeight;//!<height of waves. - f32 waveSpeed;//!<waves speed. - f32 waveLength;//!<waves length. -}; - - -/** A function to convert a hexstring to a int. -This function converts an hex string (i.e. FF) to its int value (i.e. 255). -\return An int representing the hex input value.*/ -int axtoi(const char *hexStg) -{ - unsigned int intValue = 0; // integer value of hex string - sscanf(hexStg, "%x", &intValue); - return (intValue); -} - -typedef core::array<core::stringc> StringList; - -//Loads a stringlist from a file -//note that each String added to StringList -//is separated by a \\n character and it's present -//at the end of line. -/** Loads a StringList from a file. -This function loads a StringList from a file where each string is divided by a \\n char.*/ -void LoadFromFile(io::IReadFile* file, StringList& strlist) -{ - const long sz = file->getSize(); - char* buf = new char[sz+1]; - file->read(buf, sz); - buf[sz] = 0; - char* p = buf; - char* start = p; - - while(*p) - { - if (*p == '\n') - { - core::stringc str(start, (u32)(p - start - 1)); - str.trim(); - strlist.push_back(str); - start = p+1; - } - - ++p; - } - - if (p - start > 1) - { - core::stringc str(start, (u32)(p - start - 1)); - str.trim(); - strlist.push_back(str); - } - - delete [] buf; -}; - -//This function subdivides a string in a list of strings -/** This function subdivides strings divided by divider in a list of strings. -\return A StringList made of all strings divided by divider.*/ -StringList SubdivideString(const core::stringc& str, const core::stringc& divider) -{ - StringList strings; //returned StringList - strings.clear(); //clear returned stringlist - - int c=0; - int l=str.size(); - - //process entire string - while(c<l) - { - core::stringc resultstr; - resultstr = ""; - //read characters until divider is encountered - while((str[c]!=divider[0]) && c<l) - { - resultstr += str[c]; - ++c; - } - - //Remove spaces \t and \n from string in my implementation... - //pay attention or change it in dll.h if you don't want to remove - //a particular char. - resultstr.trim();//trims string resultstr - strings.push_back(resultstr);//add trimmed string - ++c; - } - - return strings; -} - - -//Get DeleD information and convert in dmfHeader -/**This function extract a dmfHeader from a DMF file. -You must give in input a StringList representing a DMF file loaded with LoadFromFile. -\return true if function succeed or false on fail.*/ -bool GetDMFHeader(const StringList& RawFile, dmfHeader& header) -{ - StringList temp; - RawFile[0].split(temp, ";"); //file info -// StringList temp=SubdivideString(RawFile[0],";"); //file info - - if ( temp[0] != "DeleD Map File" ) - return false; //not a deled file - - temp.clear(); - temp = SubdivideString(RawFile[1]," ");//get version - StringList temp1=SubdivideString(temp[1],";"); - - header.dmfVersion = (float)atof(temp1[0].c_str());//save version - if (header.dmfVersion < 0.91) - return false;//not correct version - - temp.clear(); - temp = SubdivideString(RawFile[2],";");//get name,ambient color and shadow opacity - header.dmfName=temp[0];//save name - - //set ambient color - header.dmfAmbient.set(axtoi(temp[1].c_str())); - - //set Shadow intensity - header.dmfShadow = (float)atof(temp[2].c_str()); - - //set current position - int offs=3; - - //set Materials Number - header.numMaterials=atoi(RawFile[offs].c_str()); - offs+=header.numMaterials; - ++offs; - - //set Object Number - header.numObjects=atoi(RawFile[offs].c_str()); - - //retrieve face and vertices number - header.numVertices=0; - header.numFaces=0; - header.numWatFaces=0; - header.numWatVertices=0; - offs++; - - s32 fac; - int i; - - for(i=0; i < (int)header.numObjects; i++) - { - StringList wat=SubdivideString(RawFile[offs],";"); - StringList wat1=SubdivideString(wat[0],"_"); - - ++offs; - offs += atoi(RawFile[offs].c_str()); - ++offs; - - fac=atoi(RawFile[offs].c_str()); - - if(!(wat1[0]=="water" && wat[2]=="0")) - header.numFaces = header.numFaces + fac; - else - header.numWatFaces = header.numWatFaces + fac; - - offs++; - - for(int j=0; j<fac; j++) - { - if(!(wat1[0] == "water" && wat[2] == "0")) - header.numVertices=header.numVertices + atoi(RawFile[offs+j].c_str()); - else - header.numWatVertices=header.numWatVertices + atoi(RawFile[offs + j].c_str()); - } - - offs = offs + fac; - } - - //retrieve number of dynamic lights - header.numLights=0; - temp.clear(); - temp1.clear(); - s32 lit = atoi(RawFile[offs].c_str()); - - for (i=0; i<lit; i++) - { - offs++; - temp=SubdivideString(RawFile[offs],";"); - - if(atoi(temp[0].c_str())==1) - { - temp1=SubdivideString(temp[18],"_"); - - if(temp1[0]=="dynamic") - header.numLights++; - } - temp.clear(); - temp1.clear(); - } - - return true; //everything is OK so loading is correct -} - - -/**This function extract an array of dmfMaterial from a DMF file. -You must give in input a StringList representing a DMF file loaded with LoadFromFile. -\param RawFile StringList representing a DMF file. -\param materials Materials returned. -\param num_material Number of materials contained in DMF file. -\param use_material_dirs Here you can choose to use default DeleD structure for material dirs. -\return true if function succeed or false on fail.*/ -bool GetDMFMaterials(const StringList& RawFile, - core::array<dmfMaterial>& materials, - int num_material) -{ - // offset for already handled lines - const int offs=4; - - StringList temp; - StringList temp1; - - // The number of materials is predetermined - materials.reallocate(num_material); - for(int i=0; i<num_material; ++i) - { - materials.push_back(dmfMaterial()); - // get all tokens - temp=SubdivideString(RawFile[offs+i],";"); - // should be equal to first token - materials[i].materialID = i; - // The path used for the texture - materials[i].pathName = temp[2]; - materials[i].pathName.replace('\\','/'); - materials[i].pathName += "/"; - // temp[3] is reserved, temp[4] is the number of texture layers - materials[i].textureLayers = core::strtoul10(temp[4].c_str()); - // Three values are separated by commas - temp1=SubdivideString(temp[5],","); - - materials[i].textureFlag = atoi(temp1[0].c_str()); - materials[i].textureName=temp1[1]; - materials[i].textureName.replace('\\','/'); - materials[i].textureBlend = atoi(temp1[2].c_str()); - if(temp.size()>=9) - { - temp1=SubdivideString(temp[temp.size() - 1],","); - materials[i].lightmapFlag=atoi(temp1[0].c_str()); - materials[i].lightmapName=temp1[1]; - materials[i].lightmapName.replace('\\','/'); - materials[i].lightmapBlend = atoi(temp1[2].c_str()); - } - else - { - materials[i].lightmapFlag=1; - materials[i].lightmapName=""; - } - } - return true; -} - - -/**This function extract an array of dmfMaterial from a DMF file considering 1st an 2nd layer for water plains. -You must give in input a StringList representing a DMF file loaded with LoadFromFile. -\return true if function succeed or false on fail.*/ -bool GetDMFWaterMaterials(const StringList& RawFile /**<StringList representing a DMF file.*/, - core::array<dmfMaterial>& materials/**<Materials returned.*/, - int num_material/**<Number of materials contained in DMF file.*/ - ) -{ - int offs=4; - StringList temp; - StringList temp1; - StringList temp2; - //Checking if this is a DeleD map File of version >= 0.91 - temp=SubdivideString(RawFile[0],";");//file info - - if ( temp[0] != "DeleD Map File" ) - return false;//not a deled file - - temp.clear(); - temp=SubdivideString(RawFile[1]," ");//get version - temp1=SubdivideString(temp[1],";"); - - if (atof(temp1[0].c_str()) < 0.91) - return false;//not correct version - - //end checking - temp.clear(); - temp1.clear(); - - for(int i=0;i<num_material;i++) - { - temp = SubdivideString(RawFile[offs+i],";"); - materials[i].materialID=i; - - temp1 = SubdivideString(temp[5],","); - materials[i].textureFlag=atoi(temp1[0].c_str()); - temp2 = SubdivideString(temp1[1],"\\"); - - materials[i].textureName=temp2.getLast(); - temp1.clear(); - temp2.clear(); - int a=temp.size(); - if(a==7) - { - temp1=SubdivideString(temp[6],","); - materials[i].lightmapFlag=atoi(temp1[0].c_str()); - temp2=SubdivideString(temp1[1],"\\"); - materials[i].lightmapName=temp2.getLast(); - } - else - { - materials[i].lightmapFlag=1; - materials[i].lightmapName="FFFFFFFF"; - } - temp1.clear(); - temp2.clear(); - } - return true; -} - - -/**This function extract an array of dmfVert and dmfFace from a DMF file. -You must give in input a StringList representing a DMF file loaded with LoadFromFile and two arrays long enough. -Please use GetDMFHeader() before this function to know number of vertices and faces. -\return true if function succeed or false on fail.*/ -bool GetDMFVerticesFaces(const StringList& RawFile/**<StringList representing a DMF file.*/, - dmfVert vertices[]/**<Vertices returned*/, - dmfFace faces[]/**Faces returned*/ - ) -{ - StringList temp,temp1; - - // skip materials - s32 offs = 4 + atoi(RawFile[3].c_str()); - - const s32 objs = atoi(RawFile[offs].c_str()); - offs++; -#ifdef _IRR_DMF_DEBUG_ - os::Printer::log("Reading objects", core::stringc(objs).c_str()); -#endif - - s32 vert_cnt=0, face_cnt=0; - for (int i=0; i<objs; ++i) - { - StringList wat=SubdivideString(RawFile[offs],";"); - StringList wat1=SubdivideString(wat[0],"_"); -#ifdef _IRR_DMF_DEBUG_ - os::Printer::log("Reading object", wat[0].c_str()); -#endif - - offs++; - // load vertices - core::array<core::vector3df> pos; - const u32 posCount = core::strtoul10(RawFile[offs].c_str()); - ++offs; - pos.reallocate(posCount); - for (u32 i=0; i<posCount; ++i) - { - temp1=SubdivideString(RawFile[offs].c_str(),";"); - pos.push_back(core::vector3df(core::fast_atof(temp1[0].c_str()), - core::fast_atof(temp1[1].c_str()), - -core::fast_atof(temp1[2].c_str()))); - ++offs; - } - - const u32 numFaces=core::strtoul10(RawFile[offs].c_str()); - offs++; - if(!(wat1[0]=="water" && wat[2]=="0")) - { - for(u32 j=0; j<numFaces; ++j) - { - temp=SubdivideString(RawFile[offs+j],";"); - - //first value is vertices number for this face - const u32 vert=core::strtoul10(temp[0].c_str()); - faces[face_cnt].numVerts=vert; - //second is material ID - faces[face_cnt].materialID=core::strtoul10(temp[1].c_str()); - //vertices are ordined - faces[face_cnt].firstVert=vert_cnt; - - //now we'll create vertices structure - for(u32 k=0; k<vert; ++k) - { - //copy position - vertices[vert_cnt].pos.set(pos[core::strtoul10(temp[2+k].c_str())]); - //get uv coords for tex and light if any - vertices[vert_cnt].tc.set(core::fast_atof(temp[2+vert+(2*k)].c_str()), - core::fast_atof(temp[2+vert+(2*k)+1].c_str())); - const u32 tmp_sz=temp.size(); - vertices[vert_cnt].lc.set(core::fast_atof(temp[tmp_sz-(2*vert)+(2*k)].c_str()), - core::fast_atof(temp[tmp_sz-(2*vert)+(2*k)+1].c_str())); - vert_cnt++; - } - - face_cnt++; - } - } - - offs+=numFaces; - } - - return true; -} - - -/**This function extract an array of dmfLights from a DMF file. -You must give in input a StringList representing a DMF file loaded with -LoadFromFile and one array long enough. Please use GetDMFHeader() before this -function to know number of dynamic lights. -\return true if function succeed or false on fail.*/ -bool GetDMFLights(const StringList& RawFile/**<StringList representing a DMF file.*/, - dmfLight lights[]/**<Lights returned.*/ - ) -{ - int offs=3; - StringList temp,temp1; - - //Checking if this is a DeleD map File of version >= 0.91 - temp=SubdivideString(RawFile[0],";");//file info - - if ( temp[0] != "DeleD Map File" ) - return false;//not a deled file - - temp.clear(); - temp=SubdivideString(RawFile[1]," ");//get version - temp1=SubdivideString(temp[1],";"); - - if (atof(temp1[0].c_str()) < 0.91) - return false;//not correct version - - //end checking - - temp.clear(); - temp1.clear(); - offs=offs + atoi(RawFile[offs].c_str()); - offs++; - s32 objs = atoi(RawFile[offs].c_str()); - s32 lit=0; - s32 d_lit=0; - offs++; - - //let's get position of lights in file - int i; - for(i=0;i<objs;i++) - { - offs++; - - offs = offs + atoi(RawFile[offs].c_str()); - offs++; - - offs = offs + atoi(RawFile[offs].c_str()); - offs++; - } - - //let's find dynamic lights - lit = atoi(RawFile[offs].c_str()); - - for(i=0;i<lit;i++) - { - offs++; - temp=SubdivideString(RawFile[offs],";"); - if(atoi(temp[0].c_str())==1) - { - temp1=SubdivideString(temp[18],"_"); - if(temp1[0]=="dynamic") - { - lights[d_lit].radius = (float)atof(temp[4].c_str()); - lights[d_lit].pos.set((float)atof(temp[5].c_str()), - (float)atof(temp[6].c_str()), - (float)-atof(temp[7].c_str())); - - lights[d_lit].diffuseColor = video::SColorf( - video::SColor(255, atoi(temp[10].c_str()), atoi(temp[11].c_str()), - atoi(temp[12].c_str()))); - - lights[d_lit].specularColor = video::SColorf( - video::SColor(255, atoi(temp[13].c_str()), atoi(temp[14].c_str()), - atoi(temp[15].c_str()))); - - d_lit++; - } - } - temp.clear(); - temp1.clear(); - } - - return true; -} - - -/**This function extracts an array of dmfWaterPlane,dmfVert and dmfFace from a DMF file. -You must give in input a StringList representing a DMF file loaded with LoadFromFile and three arrays long enough. -Please use GetDMFHeader() before this function to know number of water plains and water faces as well as water vertices. -\return true if function succeed or false on fail.*/ -bool GetDMFWaterPlanes(const StringList& RawFile/**<StringList representing a DMF file.*/, - dmfWaterPlane wat_planes[]/**<Water planes returned.*/, - dmfVert vertices[]/**<Vertices returned*/, - dmfFace faces[]/**Faces returned*/ - ) -{ - int offs=3; - int offs1=0; - StringList temp,temp1; - - //Checking if this is a DeleD map File of version >= 0.91 - temp=SubdivideString(RawFile[0],";");//file info - - if ( temp[0] != "DeleD Map File" ) - return false;//not a deled file - - temp.clear(); - temp=SubdivideString(RawFile[1]," ");//get version - temp1=SubdivideString(temp[1],";"); - - if (atof(temp1[0].c_str()) < 0.91) - return false;//not correct version - - //end checking - - temp.clear(); - temp1.clear(); - offs=offs+atoi(RawFile[offs].c_str()); - offs++; - s32 objs=atoi(RawFile[offs].c_str()); - s32 fac=0,vert=0,tmp_sz=0,vert_cnt=0,face_cnt=0,wat_id=0; - core::dimension2d<u32> tilenum(40,40); - f32 waveheight=3.0f; - f32 wavespeed=300.0f; - f32 wavelength=80.0f; - offs++; - - for(int i=0;i<objs;i++) - { - StringList wat=SubdivideString(RawFile[offs],";"); - StringList wat1=SubdivideString(wat[0],"_"); - offs++; - offs1=offs; - offs=offs+atoi(RawFile[offs].c_str()); - offs++; - offs1++; - fac=atoi(RawFile[offs].c_str()); - offs++; - - if(wat1[0]=="water" && wat[2]=="0") - { - StringList userinfo=SubdivideString(wat[7],","); - - int j; - - for (j=0; j<(int)userinfo.size(); j++) - { - switch(j) - { - case 0: - if(atoi(userinfo[0].c_str())) - tilenum.Width = atoi(userinfo[0].c_str()); - break; - case 1: - if(atoi(userinfo[1].c_str())) - tilenum.Height = atoi(userinfo[1].c_str()); - break; - case 2: - if(atof(userinfo[2].c_str())) - waveheight = (float)atof(userinfo[2].c_str()); - break; - case 3: - if(atof(userinfo[3].c_str())) - wavespeed = (float)atof(userinfo[3].c_str()); - break; - case 4: - if(atof(userinfo[4].c_str())) - wavelength = (float)atof(userinfo[4].c_str()); - break; - } - } - - wat_planes[wat_id].waterID=wat_id; - wat_planes[wat_id].numFaces=fac; - wat_planes[wat_id].firstFace=face_cnt; - wat_planes[wat_id].tileNum=tilenum; - wat_planes[wat_id].waveHeight=waveheight; - wat_planes[wat_id].waveSpeed=wavespeed; - wat_planes[wat_id].waveLength=wavelength; - - for(j=0;j<fac;j++) - { - temp=SubdivideString(RawFile[offs+j],";"); - - //first value is vertices number for this face - faces[face_cnt].numVerts=atoi(temp[0].c_str()); - vert=faces[face_cnt].numVerts; - //second is material ID - faces[face_cnt].materialID=atoi(temp[1].c_str()); - //vertices are ordined - faces[face_cnt].firstVert=vert_cnt; - - //now we'll create vertices structure - for(int k=0;k<vert;k++) - { - //get vertex position - temp1=SubdivideString(RawFile[offs1+atoi(temp[2+k].c_str())], ";"); - - //copy x,y,z values - vertices[vert_cnt].pos.set((float)atof(temp1[0].c_str()), - (float)atof(temp1[1].c_str()), - (float)-atof(temp1[2].c_str())); - - //get uv coords for tex and light if any - vertices[vert_cnt].tc.set((float)atof(temp[2+vert+(2*k)].c_str()), - (float)atof(temp[2+vert+(2*k)+1].c_str())); - tmp_sz=temp.size(); - - vertices[vert_cnt].lc.set((float)atof(temp[tmp_sz-(2*vert)+(2*k)].c_str()), - (float)atof(temp[tmp_sz-(2*vert)+(2*k)+1].c_str())); - ++vert_cnt; - temp1.clear(); - } - ++face_cnt; - temp.clear(); - } - } - offs=offs+fac; - } - - return true; -} - -} // end namespace -} // end namespace scene -} // end namespace irr - -#endif /* __DMF_SUPPORT_H__ */ - diff --git a/tests/2dmaterial.cpp b/tests/2dmaterial.cpp deleted file mode 100644 index 96eec8e6..00000000 --- a/tests/2dmaterial.cpp +++ /dev/null @@ -1,912 +0,0 @@ -#include "testUtils.h" -#include <map> -using namespace irr; - -namespace -{ -// don't use this code! It lacks many checks and is for testing -// purposes only!!! -// based on code and media from SuperTuxKart -class ScalableFont : public gui::IGUIFontBitmap -{ - float m_scale; - struct TextureInfo - { - irr::core::stringc m_file_name; - bool m_has_alpha; - float m_scale; - - TextureInfo() - { - m_has_alpha = false; - m_scale = 1.0f; - } - }; - - std::map<int /* texture file ID */, TextureInfo> m_texture_files; - - void lazyLoadTexture(int texID) - { - const bool mipmap = Driver->getTextureCreationFlag(video::ETCF_CREATE_MIP_MAPS); - Driver->setTextureCreationFlag(video::ETCF_CREATE_MIP_MAPS, true); - // load texture - SpriteBank->setTexture(texID, Driver->getTexture( m_texture_files[texID].m_file_name )); - // set previous mip-map+filter state - Driver->setTextureCreationFlag(video::ETCF_CREATE_MIP_MAPS, mipmap); - - // couldn't load texture, abort. - if (!SpriteBank->getTexture(texID)) - { - return; - } - else - { - // colorkey texture rather than alpha channel? - if (! m_texture_files[texID].m_has_alpha) - { - Driver->makeColorKeyTexture(SpriteBank->getTexture(texID), core::position2di(0,0)); - } - } - } - void doReadXmlFile(io::IXMLReader* xml) - { - while (xml->read()) - { - if (io::EXN_ELEMENT == xml->getNodeType()) - { - if (core::stringw(L"include") == xml->getNodeName()) - { - core::stringc filename = xml->getAttributeValue(L"file"); - io::IXMLReader* included = Environment->getFileSystem()->createXMLReader(filename.c_str()); - if (included != NULL) - { - doReadXmlFile(included); - included->drop(); - } - } - else if (core::stringw(L"Texture") == xml->getNodeName()) - { - // add a texture - core::stringc filename = xml->getAttributeValue(L"filename"); - core::stringc fn = filename; - u32 i = (u32)xml->getAttributeValueAsInt(L"index"); - - float scale=1.0f; - if (xml->getAttributeValue(L"scale")) - scale = xml->getAttributeValueAsFloat(L"scale"); - //std::cout << "scale = " << scale << std::endl; - - core::stringw alpha = xml->getAttributeValue(L"hasAlpha"); - - //std::cout << "---- Adding font texture " << fn.c_str() << "; alpha=" << alpha.c_str() << std::endl; - - - // make sure the sprite bank has enough textures in it - while (i+1 > SpriteBank->getTextureCount()) - { - SpriteBank->addTexture(NULL); - } - - TextureInfo info; - info.m_file_name = fn; - info.m_has_alpha = (alpha == core::stringw("true")); - info.m_scale = scale; - - m_texture_files[i] = info; - } - else if (core::stringw(L"c") == xml->getNodeName()) - { - // adding a character to this font - SFontArea a; - gui::SGUISpriteFrame f; - gui::SGUISprite s; - core::rect<s32> rectangle; - - a.underhang = xml->getAttributeValueAsInt(L"u"); - a.overhang = xml->getAttributeValueAsInt(L"o"); - a.spriteno = SpriteBank->getSprites().size(); - s32 texno = xml->getAttributeValueAsInt(L"i"); - - // parse rectangle - core::stringc rectstr = xml->getAttributeValue(L"r"); - wchar_t ch = xml->getAttributeValue(L"c")[0]; - - const c8 *c = rectstr.c_str(); - s32 val; - val = 0; - while (*c >= '0' && *c <= '9') - { - val *= 10; - val += *c - '0'; - c++; - } - rectangle.UpperLeftCorner.X = val; - while (*c == L' ' || *c == L',') c++; - - val = 0; - while (*c >= '0' && *c <= '9') - { - val *= 10; - val += *c - '0'; - c++; - } - rectangle.UpperLeftCorner.Y = val; - while (*c == L' ' || *c == L',') c++; - - val = 0; - while (*c >= '0' && *c <= '9') - { - val *= 10; - val += *c - '0'; - c++; - } - rectangle.LowerRightCorner.X = val; - while (*c == L' ' || *c == L',') c++; - - val = 0; - while (*c >= '0' && *c <= '9') - { - val *= 10; - val += *c - '0'; - c++; - } - rectangle.LowerRightCorner.Y = val; - - CharacterMap[ch] = Areas.size(); - - // make frame - f.rectNumber = SpriteBank->getPositions().size(); - f.textureNumber = texno; - - // add frame to sprite - s.Frames.push_back(f); - s.frameTime = 0; - - // add rectangle to sprite bank - SpriteBank->getPositions().push_back(rectangle); - a.width = rectangle.getWidth(); - - // add sprite to sprite bank - SpriteBank->getSprites().push_back(s); - - // add character to font - Areas.push_back(a); - } - } - } - } - -public: - - bool m_black_border; - - ScalableFont* m_fallback_font; - float m_fallback_font_scale; - int m_fallback_kerning_width; - - //! constructor - ScalableFont(gui::IGUIEnvironment *env, const io::path& filename) - : Driver(0), SpriteBank(0), Environment(env), WrongCharacter(0), - MaxHeight(0), GlobalKerningWidth(0), GlobalKerningHeight(0) - { - #ifdef _DEBUG - setDebugName("ScalableFont"); - #endif - - m_fallback_font = NULL; - m_fallback_kerning_width = 0; - m_fallback_font_scale = 1.0f; - m_scale = 0.37f; - m_black_border = false; - - if (Environment) - { - // don't grab environment, to avoid circular references - Driver = Environment->getVideoDriver(); - - SpriteBank = Environment->addEmptySpriteBank(filename); - if (SpriteBank) - SpriteBank->grab(); - } - - if (Driver) - Driver->grab(); - - setInvisibleCharacters ( L" " ); - - io::IXMLReader* reader = env->getFileSystem()->createXMLReader(filename.c_str()); - if (reader) - { - load( reader ); - reader->drop(); - } - assert_log(Areas.size() > 0); - } - - //! destructor - virtual ~ScalableFont() - { - if (Driver) - Driver->drop(); - if (SpriteBank) - SpriteBank->drop(); - } - - //! loads a font from an XML file - bool load(io::IXMLReader* xml) - { - if (!SpriteBank) - return false; - - doReadXmlFile(xml); - - // set bad character - WrongCharacter = getAreaIDFromCharacter(L' ', NULL); - - setMaxHeight(); - - for(wchar_t c='0'; c<='9'; c++) - { - SFontArea a = getAreaFromCharacter(c, NULL); - if (a.overhang > m_max_digit_area.overhang ) m_max_digit_area.overhang = a.overhang; - if (a.underhang > m_max_digit_area.underhang) m_max_digit_area.underhang = a.underhang; - if (a.width > m_max_digit_area.width) m_max_digit_area.width = a.width; - } - m_max_digit_area.overhang = 0; - m_max_digit_area.underhang=0; - return true; - } - //! draws an text and clips it to the specified rectangle if wanted - virtual void draw(const core::stringw& text, const core::rect<s32>& position, - video::SColor color, bool hcenter=false, - bool vcenter=false, const core::rect<s32>* clip=0) - { - if (!Driver) return; - - core::position2d<s32> offset = position.UpperLeftCorner; - core::dimension2d<s32> text_dimension; - - // When we use the "tab" hack, disable right-alignment, it messes up everything -// bool has_tab = (text.findFirst(L'\t') != -1); - // ---- collect character locations - const unsigned int text_size = text.size(); - core::array<s32> indices(text_size); - core::array<core::position2di> offsets(text_size); - core::array<bool> fallback; - fallback.set_used(text_size); - - for (u32 i = 0; i<text_size; i++) - { - wchar_t c = text[i]; - - //hack: one tab character is supported, it moves the cursor to the middle of the area - if (c == L'\t') - { - offset.X = position.UpperLeftCorner.X + position.getWidth()/2; - continue; - } - - if (c == L'\r' || // Windows breaks - c == L'\n') // Unix breaks - { - if (c==L'\r' && text[i+1]==L'\n') - c = text[++i]; - offset.Y += (int)(MaxHeight*m_scale); - offset.X = position.UpperLeftCorner.X; - if (hcenter) - offset.X += (position.getWidth() - text_dimension.Width) >> 1; - continue; - } // if lineBreak - - bool use_fallback_font = false; - const SFontArea &area = getAreaFromCharacter(c, &use_fallback_font); - fallback[i] = use_fallback_font; - offset.X += area.underhang; - offsets.push_back(offset); - // Invisible character. add something to the array anyway so that - // indices from the various arrays remain in sync - indices.push_back((Invisible.findFirst(c) < 0) ? (int)area.spriteno - : -1); - offset.X += getCharWidth(area, fallback[i]); - } // for i<text_size - - // ---- do the actual rendering - const int indiceAmount = indices.size(); - core::array< gui::SGUISprite >& sprites = SpriteBank->getSprites(); - core::array< core::rect<s32> >& positions = SpriteBank->getPositions(); - core::array< gui::SGUISprite >* fallback_sprites; - core::array< core::rect<s32> >* fallback_positions; - if (m_fallback_font!=NULL) - { - fallback_sprites = &m_fallback_font->SpriteBank->getSprites(); - fallback_positions = &m_fallback_font->SpriteBank->getPositions(); - } - else - { - fallback_sprites = NULL; - fallback_positions = NULL; - } - - video::IVideoDriver* driver = Environment->getVideoDriver(); - const int spriteAmount = sprites.size(); - for (int n=0; n<indiceAmount; n++) - { - const int spriteID = indices[n]; - if (!fallback[n] && (spriteID < 0 || spriteID >= spriteAmount)) - continue; - if (indices[n] == -1) - continue; - - //assert_log(sprites[spriteID].Frames.size() > 0); - - const int texID = (fallback[n] ? - (*fallback_sprites)[spriteID].Frames[0].textureNumber : - sprites[spriteID].Frames[0].textureNumber); - - core::rect<s32> source = (fallback[n] ? - (*fallback_positions)[(*fallback_sprites)[spriteID].Frames[0].rectNumber] : - positions[sprites[spriteID].Frames[0].rectNumber]); - - const TextureInfo& info = (fallback[n] ? - (*(m_fallback_font->m_texture_files.find(texID))).second : - (*(m_texture_files.find(texID))).second); - float char_scale = info.m_scale; - - core::dimension2d<s32> size = source.getSize(); - - float scale = (fallback[n] ? m_scale*m_fallback_font_scale : m_scale); - size.Width = (int)(size.Width * scale * char_scale); - size.Height = (int)(size.Height * scale * char_scale); - - // align vertically if character is smaller - int y_shift = (size.Height < MaxHeight*m_scale ? (int)((MaxHeight*m_scale - size.Height)/2.0f) : 0); - - core::rect<s32> dest(offsets[n] + core::position2di(0, y_shift), size); - - video::SColor colors[] = {color, color, color, color}; - - video::ITexture* texture = (fallback[n] ? - m_fallback_font->SpriteBank->getTexture(texID) : - SpriteBank->getTexture(texID) ); - - if (texture == NULL) - { - // perform lazy loading - - if (fallback[n]) - { - m_fallback_font->lazyLoadTexture(texID); - texture = m_fallback_font->SpriteBank->getTexture(texID); - } - else - { - lazyLoadTexture(texID); - texture = SpriteBank->getTexture(texID); - } - - if (texture == NULL) - { - continue; // no such character - } - } - - if (m_black_border) - { - // draw black border - video::SColor black(color.getAlpha(),0,0,0); - video::SColor black_colors[] = {black, black, black, black}; - - for (int x_delta=-2; x_delta<=2; x_delta++) - { - for (int y_delta=-2; y_delta<=2; y_delta++) - { - if (x_delta == 0 || y_delta == 0) continue; - driver->draw2DImage(texture, - dest + core::position2d<s32>(x_delta, y_delta), - source, - clip, - black_colors, true); - } - } - } - - if (fallback[n]) - { - // draw text over - static video::SColor orange(color.getAlpha(), 255, 100, 0); - static video::SColor yellow(color.getAlpha(), 255, 220, 15); - video::SColor title_colors[] = {yellow, orange, orange, yellow}; - driver->draw2DImage(texture, - dest, - source, - clip, - title_colors, true); - } - else - { - driver->draw2DImage(texture, - dest, - source, - clip, - colors, true); - - } - } - } - - //! returns the dimension of a text - virtual core::dimension2d<u32> getDimension(const wchar_t* text) const - { - assert_log(Areas.size() > 0); - - core::dimension2d<u32> dim(0, 0); - core::dimension2d<u32> thisLine(0, (int)(MaxHeight*m_scale)); - - for (const wchar_t* p = text; *p; ++p) - { - if (*p == L'\r' || // Windows breaks - *p == L'\n') // Unix breaks - { - if (*p==L'\r' && p[1] == L'\n') // Windows breaks - ++p; - dim.Height += thisLine.Height; - if (dim.Width < thisLine.Width) - dim.Width = thisLine.Width; - thisLine.Width = 0; - continue; - } - - bool fallback = false; - const SFontArea &area = getAreaFromCharacter(*p, &fallback); - - thisLine.Width += area.underhang; - - thisLine.Width += getCharWidth(area, fallback); - } - - dim.Height += thisLine.Height; - if (dim.Width < thisLine.Width) dim.Width = thisLine.Width; - - // std::cout << "ScalableFont::getDimension returns : " << dim.Width << ", " << dim.Height << " --> "; - - dim.Width = (int)(dim.Width + 0.9f); // round up - dim.Height = (int)(dim.Height + 0.9f); - - //std::cout << dim.Width << ", " << dim.Height << std::endl; - - return dim; - } - //! Calculates the index of the character in the text which is on a specific position. - virtual s32 getCharacterFromPos(const wchar_t* text, s32 pixel_x) const - { - s32 x = 0; - s32 idx = 0; - - while (text[idx]) - { - const SFontArea& a = Areas[getAreaIDFromCharacter(text[idx], NULL)]; - - x += a.width + a.overhang + a.underhang + GlobalKerningWidth; - - if (x >= pixel_x) - return idx; - - ++idx; - } - - return -1; - } - //! Returns the type of this font - virtual gui::EGUI_FONT_TYPE getType() const { return gui::EGFT_BITMAP; } - - //! set an Pixel Offset on Drawing ( scale position on width ) - virtual void setKerningWidth (s32 kerning) - { - GlobalKerningWidth = kerning; - } - virtual void setKerningHeight (s32 kerning) - { - GlobalKerningHeight = kerning; - } - //! set an Pixel Offset on Drawing ( scale position on width ) - virtual s32 getKerningWidth(const wchar_t* thisLetter=0, const wchar_t* previousLetter=0) const - { - s32 ret = GlobalKerningWidth; - - if (thisLetter) - { - ret += Areas[getAreaIDFromCharacter(*thisLetter, NULL)].overhang; - - if (previousLetter) - { - ret += Areas[getAreaIDFromCharacter(*previousLetter, NULL)].underhang; - } - } - - return ret; - } - virtual s32 getKerningHeight() const - { - return GlobalKerningHeight; - } - - //! gets the sprite bank - virtual gui::IGUISpriteBank* getSpriteBank() const - { - return SpriteBank; - } - - //! returns the sprite number from a given character - virtual u32 getSpriteNoFromChar(const wchar_t *c) const - { - return Areas[getAreaIDFromCharacter(*c, NULL)].spriteno; - } - - virtual void setInvisibleCharacters( const wchar_t *s ) - { - Invisible = s; - } - -private: - - struct SFontArea - { - SFontArea() : underhang(0), overhang(0), width(0), spriteno(0) {} - s32 underhang; - s32 overhang; - s32 width; - u32 spriteno; - }; - - int getCharWidth(const SFontArea& area, const bool fallback) const - { - core::array< gui::SGUISprite >& sprites = SpriteBank->getSprites(); - core::array< gui::SGUISprite >* fallback_sprites = (m_fallback_font != NULL ? - &m_fallback_font->SpriteBank->getSprites() : - NULL); - - const int texID = (fallback ? - (*fallback_sprites)[area.spriteno].Frames[0].textureNumber : - sprites[area.spriteno].Frames[0].textureNumber); - - const TextureInfo& info = (fallback ? - (*(m_fallback_font->m_texture_files.find(texID))).second : - (*(m_texture_files.find(texID))).second); - const float char_scale = info.m_scale; - - //std::cout << "area.spriteno=" << area.spriteno << ", char_scale=" << char_scale << std::endl; - - if (fallback) - return (int)(((area.width + area.overhang)*m_fallback_font_scale + m_fallback_kerning_width) * m_scale * char_scale); - else - return (int)((area.width + area.overhang + GlobalKerningWidth) * m_scale * char_scale); - } - s32 getAreaIDFromCharacter(const wchar_t c, bool* fallback_font) const - { - std::map<wchar_t, s32>::const_iterator n = CharacterMap.find(c); - if (n != CharacterMap.end()) - { - if (fallback_font != NULL) - *fallback_font = false; - return (*n).second; - } - else if (m_fallback_font != NULL && fallback_font != NULL) - { - *fallback_font = true; - return m_fallback_font->getAreaIDFromCharacter(c, NULL); - } - else - { - // std::cout << "The font does not have this character : <" << (int)c << ">" << std::endl; - if (fallback_font != NULL) - *fallback_font = false; - return WrongCharacter; - } - } - const SFontArea &getAreaFromCharacter(const wchar_t c, bool* fallback_font) const - { - const int area_id = getAreaIDFromCharacter(c, fallback_font); - const bool use_fallback_font = (fallback_font && *fallback_font); - - // Note: fallback_font can be NULL - return ( use_fallback_font ? m_fallback_font->Areas[area_id] : Areas[area_id]); - } // getAreaFromCharacter - void setMaxHeight() - { - // FIXME: should consider per-texture scaling - MaxHeight = 0; - s32 t; - - core::array< core::rect<s32> >& p = SpriteBank->getPositions(); - - for (u32 i=0; i<p.size(); ++i) - { - t = p[i].getHeight(); - if (t>MaxHeight) - MaxHeight = t; - } - } - core::array<SFontArea> Areas; - /** The maximum values of all digits, used in monospace_digits. */ - mutable SFontArea m_max_digit_area; - std::map<wchar_t, s32> CharacterMap; - video::IVideoDriver* Driver; - gui::IGUISpriteBank* SpriteBank; - gui::IGUIEnvironment* Environment; - u32 WrongCharacter; - s32 MaxHeight; - s32 GlobalKerningWidth, GlobalKerningHeight; - - core::stringw Invisible; -}; -} - -// The actual bug that was behind this issue was the combination of -// 2d rendering and mipmaps. The issue was reproduced using the special -// draw2dimage version, hence the name. -static bool draw2DImage4c(video::E_DRIVER_TYPE type) -{ - IrrlichtDevice *device = createDevice(type, core::dimension2d<u32>(240, 120)); - - if (!device) - return true; // could not create selected driver. - - video::IVideoDriver* driver = device->getVideoDriver(); - - if (!driver->queryFeature(video::EVDF_BILINEAR_FILTER)) - { - device->closeDevice(); - device->run(); - device->drop(); - return true; - } - - stabilizeScreenBackground(driver); - - logTestString("Testing driver %ls\n", driver->getName()); - - driver->setTextureCreationFlag(video::ETCF_CREATE_MIP_MAPS,true); - driver->setTextureCreationFlag(video::ETCF_OPTIMIZED_FOR_QUALITY,true); - - video::ITexture* images = driver->getTexture("../media/2ddemo.png"); - driver->makeColorKeyTexture(images, core::position2d<s32>(0,0)); - - core::rect<s32> imp1(349,15,385,78); - core::rect<s32> imp2(387,15,423,78); - - // font cannot handle loading from sub-dirs - io::path cwd = device->getFileSystem()->getWorkingDirectory(); - device->getFileSystem()->changeWorkingDirectoryTo("media"); - - ScalableFont* font = new ScalableFont(device->getGUIEnvironment(), "title_font.xml"); - font->m_fallback_font_scale = 4.0f; - font->m_fallback_kerning_width = 15; - font->setKerningWidth(-18); - font->m_black_border = true; - - /* - Prepare a nicely filtering 2d render mode for special cases. - */ - driver->getMaterial2D().UseMipMaps = true; - driver->getMaterial2D().TextureLayer[0].BilinearFilter = true; - - { - driver->beginScene(video::ECBF_COLOR | video::ECBF_DEPTH, video::SColor(255,120,102,136)); - - driver->enableMaterial2D(); - - // draw fire & dragons background world - driver->draw2DImage(images, core::position2di(), - core::rect<s32>(0,0,342,224), 0, - video::SColor(255,255,255,255), true); - - // draw flying imp - driver->draw2DImage(images, core::position2d<s32>(114,75), - imp1, 0, video::SColor(255,255,255,255), true); - - // draw second flying imp - driver->draw2DImage(images, core::position2d<s32>(220,55), - imp2, 0, video::SColor(255,255,255,255), true); - - driver->draw2DImage(images, core::rect<s32>(10,10,108,48), - core::rect<s32>(354,87,442,118)); - - video::SColor colors[] = {0xff00ffff, 0xff00ffff, 0xffffff00, 0xffffff00}; - driver->draw2DImage(images, core::recti(10,50,108,88), - core::recti(354,87,442,118), 0, colors, true); - - font->draw( L"WXYZsSdDrRjJbB", core::rect<s32>(30,20,300,300), - video::SColor(255,255,255,255) ); - - driver->enableMaterial2D(false); - - driver->draw2DImage(images, core::recti(10,90,108,128), - core::recti(354,87,442,118), 0, colors, true); - - font->draw( L"WXYZsSdDrRjJbB", core::rect<s32>(30,60,300,400), - video::SColor(255,255,255,255) ); - - driver->endScene(); - } - font->drop(); - device->getFileSystem()->changeWorkingDirectoryTo(cwd); - - // don't go under 99% as the difference is not very large - bool result = takeScreenshotAndCompareAgainstReference(driver, "-draw2DImage4cFilter.png"); - - device->closeDevice(); - device->run(); - device->drop(); - return result; -} - -// This test renders a 3d scene and a gui on top of it. The GUI is -// filtered via 2dmaterial (blurred). -// TODO: Works only for OpenGL right now -static bool addBlend2d(video::E_DRIVER_TYPE type) -{ - SIrrlichtCreationParameters params; - params.AntiAlias = 0; - params.Bits = 32; - params.WindowSize = core::dimension2d<u32>(160, 120); - params.DriverType = type; - - IrrlichtDevice *device = createDeviceEx(params); - - if (!device) - return true; // in case the driver type does not exist - - video::IVideoDriver* driver = device->getVideoDriver(); - scene::ISceneManager* smgr = device->getSceneManager(); - - if (!driver->queryFeature(video::EVDF_BILINEAR_FILTER)) - { - device->closeDevice(); - device->run(); - device->drop(); - return true; - } - - logTestString("Testing driver %ls\n", driver->getName()); - - scene::IAnimatedMesh* mesh = smgr->getMesh("../media/sydney.md2"); - if (!mesh) - { - device->closeDevice(); - device->run(); - device->drop(); - return false; - } - - stabilizeScreenBackground(driver); - - scene::IAnimatedMeshSceneNode* node = smgr->addAnimatedMeshSceneNode( mesh ); - - if (node) - { - node->setMaterialFlag(video::EMF_LIGHTING, false); - node->setMD2Animation(scene::EMAT_STAND); - node->setMaterialTexture( 0, driver->getTexture("../media/sydney.bmp") ); - } - - smgr->addCameraSceneNode(0, core::vector3df(0,30,-40), core::vector3df(0,5,0)); - - gui::IGUIEnvironment* env = device->getGUIEnvironment(); - { - // create the toolbox window - gui::IGUIWindow* wnd = env->addWindow(core::rect<s32>(0,0,800,480), - false, L"Toolset", 0, 100); - - // create tab control and tabs - gui::IGUITabControl* tab = env->addTabControl( - core::rect<s32>(2,20,800-602,480-7), wnd, true, true); - - gui::IGUITab* t1 = tab->addTab(L"Config"); - - // add some edit boxes and a button to tab one - env->addImage(driver->getTexture("../media/tools.png"), core::vector2d<s32>(10,20), true, t1); - env->addStaticText(L"X:", core::rect<s32>(22,48,40,66), false, false, t1); - env->addEditBox(L"1.0", core::rect<s32>(40,46,130,66), true, t1, 201); - - // quick scale buttons - env->addButton(core::rect<s32>(65,20,95,40), t1, 102, L"* 10"); - env->addButton(core::rect<s32>(100,20,130,40), t1, 103, L"* 0.1"); - } - - video::SMaterial& material2D = driver->getMaterial2D(); - for (unsigned int n=0; n<video::MATERIAL_MAX_TEXTURES; n++) - { - material2D.TextureLayer[n].BilinearFilter = true; - material2D.TextureLayer[n].TextureWrapU = video::ETC_CLAMP_TO_EDGE; - material2D.TextureLayer[n].TextureWrapV = video::ETC_CLAMP_TO_EDGE; - } - material2D.AntiAliasing=video::EAAM_FULL_BASIC; - - driver->beginScene(video::ECBF_COLOR | video::ECBF_DEPTH, video::SColor(255,100,101,140)); - smgr->drawAll(); - driver->enableMaterial2D(); - env->drawAll(); - driver->enableMaterial2D(false); - driver->endScene(); - - bool result = takeScreenshotAndCompareAgainstReference(driver, "-addBlend2D.png", 98.2f); - - device->closeDevice(); - device->run(); - device->drop(); - return result; -} - -// This test renders 4 times the same image. Two via IGUIImage, two via draw2DImage -// 3 of the 4 images are filtered via 2dmaterial and bilinear filter, only the one -// at the bottom left is not. -static bool moreFilterTests(video::E_DRIVER_TYPE type) -{ - IrrlichtDevice* device = irr::createDevice(type, core::dimension2du(160,120)); - if (!device) - return true; - - video::IVideoDriver* driver = device->getVideoDriver(); - gui::IGUIEnvironment* gui = device->getGUIEnvironment(); - - if (!driver->queryFeature(video::EVDF_BILINEAR_FILTER)) - { - device->closeDevice(); - device->run(); - device->drop(); - return true; - } - - stabilizeScreenBackground(driver); - - logTestString("Testing driver %ls\n", driver->getName()); - - driver->setTextureCreationFlag(video::ETCF_CREATE_MIP_MAPS, false); - video::ITexture* tex = driver->getTexture("../media/irrlichtlogo.jpg"); - gui::IGUIImage* image = gui->addImage(core::recti(0,0,64,64)); - image->setScaleImage(true); - image->setImage(tex); - image->setUseAlphaChannel(true); - driver->getMaterial2D().TextureLayer[0].BilinearFilter=true; - driver->getMaterial2D().TextureLayer[0].TrilinearFilter=true; - - { - driver->beginScene(video::ECBF_COLOR | video::ECBF_DEPTH, irr::video::SColor(255,255,255,255)); - - // all three logos should be with filtering - driver->enableMaterial2D(); - - driver->getMaterial2D().setTexture(0, 0); - driver->draw2DImage(tex, irr::core::rect<irr::s32>(64, 64, 128, 128), irr::core::rect<irr::s32>(0, 0, 88, 31)); - - driver->getMaterial2D().setTexture(0, tex); - driver->draw2DImage(tex, irr::core::rect<irr::s32>(64, 0, 128, 64), irr::core::rect<irr::s32>(0, 0, 88, 31)); - - gui->drawAll(); - - // the next gui image should be without filter - driver->enableMaterial2D(false); - image->setRelativePosition(core::recti(0,64,64,128)); - gui->drawAll(); - - driver->endScene(); - } - - bool result = takeScreenshotAndCompareAgainstReference(driver, "-2dmatFilter.png"); - - device->closeDevice(); - device->run(); - device->drop(); - return result; -} - -bool twodmaterial() -{ - bool result = true; - TestWithAllDrivers(addBlend2d); - TestWithAllDrivers(moreFilterTests); -#ifdef _IRR_COMPILE_WITH_XML_ - TestWithAllDrivers(draw2DImage4c); -#endif - return result; -} diff --git a/tests/Makefile b/tests/Makefile deleted file mode 100644 index 83b4b26b..00000000 --- a/tests/Makefile +++ /dev/null @@ -1,53 +0,0 @@ -# Irrlicht Engine Regression Tests Makefile -Target = tests -Sources = $(wildcard *.cpp) - -CPPFLAGS = -I../include -I/usr/X11R6/include -pipe -CXXFLAGS += -Wall -ansi -pedantic -fno-exceptions -ifndef NDEBUG -CXXFLAGS += -O0 -g -D_DEBUG -else -CXXFLAGS += -fexpensive-optimizations -O3 -endif - -ifeq ($(HOSTTYPE), x86_64) -LIBSELECT=64 -endif - -all: all_linux - -# target specific settings -all_linux: SYSTEM=Linux -all_linux: LDFLAGS = -L/usr/X11R6/lib$(LIBSELECT) -L../lib/$(SYSTEM) -lIrrlicht -lGL -lXxf86vm -lXext -lX11 -lXcursor - -all_win32 clean_win32: SYSTEM=Win32-gcc -all_win32: LDFLAGS = -L../lib/$(SYSTEM) -lIrrlicht -lopengl32 -lm - -all_win32 clean_win32: SUF=.exe -# name of the binary - only valid for targets which set SYSTEM -DESTPATH = ../bin/$(SYSTEM)/$(Target)$(SUF) - -OBJ = $(Sources:.cpp=.o) - -all_linux all_win32: $(OBJ) - $(warning Building...) - $(CXX) $(CPPFLAGS) $(CXXFLAGS) $^ -o $(DESTPATH) $(LDFLAGS) - @$(RM) tests # otherwise it's easy to forget to copy it and run the old binary - -clean: clean_linux clean_win32 - $(warning Cleaning...) - @$(RM) $(OBJ) - -clean_linux clean_win32: - @$(RM) $(DESTPATH) - -.PHONY: all all_win32 clean clean_linux clean_win32 - -# Create dependency files for automatic recompilation -%.d:%.cpp - $(CXX) $(CPPFLAGS) -MM -MF $@ $< - -ifneq ($(MAKECMDGOALS),clean) --include $(OBJ:.o=.d) -endif - diff --git a/tests/anti-aliasing.cpp b/tests/anti-aliasing.cpp deleted file mode 100644 index 62446c5f..00000000 --- a/tests/anti-aliasing.cpp +++ /dev/null @@ -1,74 +0,0 @@ -#include "testUtils.h" - -using namespace irr; - -static bool testLineRendering(video::E_DRIVER_TYPE type) -{ - SIrrlichtCreationParameters params; - params.AntiAlias = 2; - params.Bits = 16; - params.WindowSize = core::dimension2d<u32>(160, 120); - params.DriverType = type; - - IrrlichtDevice *device = createDeviceEx(params); - - if (!device) - return true; // in case the driver type does not exist - - video::IVideoDriver* driver = device->getVideoDriver(); - // if no AntiAliasing supported, skip this test - if (driver->getDriverAttributes().getAttributeAsInt("AntiAlias")<2) - { - device->closeDevice(); - device->run(); - device->drop(); - return true; - } - - logTestString("Testing driver %ls\n", driver->getName()); - - scene::ISceneManager* smgr = device->getSceneManager(); - - scene::IAnimatedMesh* mesh = smgr->getMesh("./media/sydney.md2"); - if (!mesh) - { - device->closeDevice(); - device->run(); - device->drop(); - return false; - } - - stabilizeScreenBackground(driver); - - scene::IAnimatedMeshSceneNode* node = smgr->addAnimatedMeshSceneNode( mesh ); - - if (node) - { - node->setMaterialFlag(video::EMF_LIGHTING, false); - node->setMD2Animation(scene::EMAT_STAND); - node->setMaterialTexture( 0, driver->getTexture("./media/sydney.bmp") ); - } - - smgr->addCameraSceneNode(0, core::vector3df(0,30,-40), core::vector3df(0,5,0)); - - device->getTimer()->setTime(0); // scene has animations and current scene seems to be saved at that time - driver->beginScene(video::ECBF_COLOR | video::ECBF_DEPTH, video::SColor(255,100,101,140)); - smgr->drawAll(); - driver->draw3DBox(node->getBoundingBox(), video::SColor(0,255,0,0)); - driver->draw2DLine(core::position2di(10,10), core::position2di(100,100), video::SColor(255,0,0,0)); - driver->endScene(); - - bool result = takeScreenshotAndCompareAgainstReference(driver, "-lineAntiAliasing.png", 99.4f ); - - device->closeDevice(); - device->run(); - device->drop(); - return result; -} - -bool antiAliasing() -{ - bool result = true; - TestWithAllHWDrivers(testLineRendering); - return result; -} diff --git a/tests/archiveReader.cpp b/tests/archiveReader.cpp deleted file mode 100644 index 5674f6c9..00000000 --- a/tests/archiveReader.cpp +++ /dev/null @@ -1,469 +0,0 @@ -#include "testUtils.h" - -using namespace irr; -using namespace core; -using namespace io; - -namespace -{ - -bool testArchive(IFileSystem* fs, const io::path& archiveName) -{ - // make sure there is no archive mounted - if ( fs->getFileArchiveCount() ) - { - logTestString("Already mounted archives found\n"); - return false; - } - - if ( !fs->addFileArchive(archiveName, /*bool ignoreCase=*/true, /*bool ignorePaths=*/false) ) - { - logTestString("Mounting archive failed\n"); - return false; - } - - // make sure there is an archive mounted - if ( !fs->getFileArchiveCount() ) - { - logTestString("Mounted archive not in list\n"); - return false; - } - - // mount again - if ( !fs->addFileArchive(archiveName, /*bool ignoreCase=*/true, /*bool ignorePaths=*/false) ) - { - logTestString("Mounting a second time failed\n"); - fs->removeFileArchive(fs->getFileArchiveCount()-1); - return false; - } - - // make sure there is exactly one archive mounted - if ( fs->getFileArchiveCount() != 1 ) - { - logTestString("Duplicate mount not recognized\n"); - while (fs->getFileArchiveCount()) - fs->removeFileArchive(fs->getFileArchiveCount()-1); - return false; - } - if (fs->getFileArchive(0)->getType()==io::EFAT_FOLDER) - { - // mount again with different path end symbol (either with slash or without) - core::stringc newArchiveName=archiveName; - if (archiveName.lastChar()=='/') - newArchiveName.erase(newArchiveName.size()-1); - else - newArchiveName.append('/'); - if ( !fs->addFileArchive(newArchiveName, /*bool ignoreCase=*/true, /*bool ignorePaths=*/false) ) - { - logTestString("Mounting a second time with different name failed\n"); - fs->removeFileArchive(fs->getFileArchiveCount()-1); - return false; - } - - // make sure there is exactly one archive mounted - if ( fs->getFileArchiveCount() != 1 ) - { - logTestString("Duplicate mount with different filename not recognized\n"); - while (fs->getFileArchiveCount()) - fs->removeFileArchive(fs->getFileArchiveCount()-1); - return false; - } - } - -#if 0 - // log what we got - io::IFileArchive* archive = fs->getFileArchive(fs->getFileArchiveCount()-1); - const io::IFileList* fileList = archive->getFileList(); - for ( u32 f=0; f < fileList->getFileCount(); ++f) - { - logTestString("File name: %s\n", fileList->getFileName(f).c_str()); - logTestString("Full path: %s\n", fileList->getFullFileName(f).c_str()); - logTestString("ID: %d\n", fileList->getID(f)); - } -#endif - - io::path filename("mypath/mypath/myfile.txt"); - if (!fs->existFile(filename)) - { - logTestString("existFile with deep path failed\n"); - while (fs->getFileArchiveCount()) - fs->removeFileArchive(fs->getFileArchiveCount()-1); - return false; - } - - const char* names[] = {"test/test.txt", "mypath/myfile.txt", "mypath/mypath/myfile.txt"}; - const char* basenames[] = {"test.txt", "myfile.txt", "myfile.txt"}; - const char* content[] = {"Hello world!", "1est\n", "2est"}; - - for (u32 i=0; i<3; ++i) - { - if (!fs->existFile(names[i])) - { - logTestString("existFile failed\n"); - while (fs->getFileArchiveCount()) - fs->removeFileArchive(fs->getFileArchiveCount()-1); - return false; - } - - IReadFile* readFile = fs->createAndOpenFile(names[i]); - if (!readFile) - { - logTestString("createAndOpenFile failed\n"); - while (fs->getFileArchiveCount()) - fs->removeFileArchive(fs->getFileArchiveCount()-1); - return false; - } - - if (fs->getFileBasename(readFile->getFileName()) != basenames[i]) - { - logTestString("Wrong filename, file list seems to be corrupt\n"); - while (fs->getFileArchiveCount()) - fs->removeFileArchive(fs->getFileArchiveCount()-1); - readFile->drop(); - return false; - } - char tmp[13] = {'\0'}; - readFile->read(tmp, 12); - if (strcmp(tmp, content[i])) - { - logTestString("Read bad data from archive: %s\n", tmp); - while (fs->getFileArchiveCount()) - fs->removeFileArchive(fs->getFileArchiveCount()-1); - readFile->drop(); - return false; - } - readFile->drop(); - } - - if (!fs->removeFileArchive(fs->getFileArchiveCount()-1)) - { - logTestString("Couldn't remove archive.\n"); - return false; - } - - // make sure there is no archive mounted - if ( fs->getFileArchiveCount() ) - return false; - - return true; -} - -bool testEncryptedZip(IFileSystem* fs) -{ - // make sure there is no archive mounted - if ( fs->getFileArchiveCount() ) - { - logTestString("Already mounted archives found\n"); - return false; - } - - const char* archiveName = "media/enc.zip"; - if ( !fs->addFileArchive(archiveName, /*bool ignoreCase=*/true, /*bool ignorePaths=*/false) ) - { - logTestString("Mounting archive failed\n"); - return false; - } - - // make sure there is an archive mounted - if ( !fs->getFileArchiveCount() ) - { - logTestString("Mounted archive not in list\n"); - return false; - } - - // mount again - if ( !fs->addFileArchive(archiveName, /*bool ignoreCase=*/true, /*bool ignorePaths=*/false) ) - { - logTestString("Mounting a second time failed\n"); - fs->removeFileArchive(fs->getFileArchiveCount()-1); - return false; - } - - // make sure there is exactly one archive mounted - if ( fs->getFileArchiveCount() != 1 ) - { - logTestString("Duplicate mount not recognized\n"); - while (fs->getFileArchiveCount()) - fs->removeFileArchive(fs->getFileArchiveCount()-1); - return false; - } - - // log what we got - io::IFileArchive* archive = fs->getFileArchive(fs->getFileArchiveCount()-1); - io::path filename("doc"); - const io::IFileList* fileList = archive->getFileList(); - for ( u32 f=0; f < fileList->getFileCount(); ++f) - { - logTestString("%s name: %s\n", fileList->isDirectory(f)?"Directory":"File", fileList->getFileName(f).c_str()); - logTestString("Full path: %s\n", fileList->getFullFileName(f).c_str()); - } - if (fileList->findFile(filename) != -1) - { - logTestString("findFile wrongly succeeded on directory\n"); - fs->removeFileArchive(fs->getFileArchiveCount()-1); - return false; - } - if (fileList->findFile(filename, true)==-1) - { - logTestString("findFile failed on directory\n"); - fs->removeFileArchive(fs->getFileArchiveCount()-1); - return false; - } - - filename="doc/readme.txt"; - if (fileList->findFile(filename)==-1) - { - logTestString("findFile failed\n"); - fs->removeFileArchive(fs->getFileArchiveCount()-1); - return false; - } - if (fileList->findFile(filename, true) != -1) - { - logTestString("findFile wrongly succeeded on non-directory\n"); - fs->removeFileArchive(fs->getFileArchiveCount()-1); - return false; - } - - if (!fs->existFile(filename)) - { - logTestString("existFile failed\n"); - fs->removeFileArchive(fs->getFileArchiveCount()-1); - return false; - } - - filename="doc"; - if (fs->existFile(filename)) - { - logTestString("existFile succeeded wrongly on directory\n"); - fs->removeFileArchive(fs->getFileArchiveCount()-1); - return false; - } - - filename="doc/readme.txt"; - IReadFile* readFile = fs->createAndOpenFile(filename); - if ( readFile ) - { - logTestString("createAndOpenFile succeeded, even though no password was set.\n"); - readFile->drop(); - fs->removeFileArchive(fs->getFileArchiveCount()-1); - return false; - } - - archive->Password="33445"; - readFile = fs->createAndOpenFile(filename); -#ifdef _IRR_COMPILE_WITH_ZIP_ENCRYPTION_ - if ( !readFile ) - { - logTestString("createAndOpenFile failed\n"); - fs->removeFileArchive(fs->getFileArchiveCount()-1); - return false; - } - - char tmp[13] = {'\0'}; - readFile->read(tmp, 12); - readFile->drop(); - if (strncmp(tmp, "Linux Users:", 12)) - { - logTestString("Read bad data from archive: %s\n", tmp); - return false; - } -#endif - - if (!fs->removeFileArchive(fs->getFileArchiveCount()-1)) - { - logTestString("Couldn't remove archive.\n"); - return false; - } - - // make sure there is no archive mounted - if ( fs->getFileArchiveCount() ) - return false; - - return true; -} - -bool testSpecialZip(IFileSystem* fs, const char* archiveName, const char* filename, const void* content) -{ - // make sure there is no archive mounted - if ( fs->getFileArchiveCount() ) - { - logTestString("Already mounted archives found\n"); - return false; - } - - if ( !fs->addFileArchive(archiveName, /*bool ignoreCase=*/true, /*bool ignorePaths=*/false) ) - { - logTestString("Mounting archive failed\n"); - return false; - } - - // make sure there is an archive mounted - if ( !fs->getFileArchiveCount() ) - { - logTestString("Mounted archive not in list\n"); - return false; - } - - // log what we got - io::IFileArchive* archive = fs->getFileArchive(fs->getFileArchiveCount()-1); - const io::IFileList* fileList = archive->getFileList(); - for ( u32 f=0; f < fileList->getFileCount(); ++f) - { - logTestString("%s name: %s\n", fileList->isDirectory(f)?"Directory":"File", fileList->getFileName(f).c_str()); - logTestString("Full path: %s\n", fileList->getFullFileName(f).c_str()); - } - - if (!fs->existFile(filename)) - { - logTestString("existFile failed\n"); - fs->removeFileArchive(fs->getFileArchiveCount()-1); - return false; - } - - IReadFile* readFile = fs->createAndOpenFile(filename); - if ( !readFile ) - { - logTestString("createAndOpenFile failed\n"); - fs->removeFileArchive(fs->getFileArchiveCount()-1); - return false; - } - - char tmp[6] = {'\0'}; - readFile->read(tmp, 5); - if (memcmp(tmp, content, 5)) - { - logTestString("Read bad data from archive: %s\n", tmp); - readFile->drop(); - fs->removeFileArchive(fs->getFileArchiveCount()-1); - return false; - } - - readFile->drop(); - - if (!fs->removeFileArchive(fs->getFileArchiveCount()-1)) - { - logTestString("Couldn't remove archive.\n"); - return false; - } - - // make sure there is no archive mounted - if ( fs->getFileArchiveCount() ) - return false; - - return true; -} - -static bool testMountFile(IFileSystem* fs) -{ - bool result = true; -#if 1 - fs->changeWorkingDirectoryTo("empty"); - // log what we got - const io::IFileList* fileList = fs->createFileList(); - for ( u32 f=0; f < fileList->getFileCount(); ++f) - { - logTestString("File name: %s\n", fileList->getFileName(f).c_str()); - logTestString("Full path: %s\n", fileList->getFullFileName(f).c_str()); - logTestString("ID: %d\n", fileList->getID(f)); - } - fileList->drop(); - fs->changeWorkingDirectoryTo(".."); -#endif - if (!fs->addFileArchive("empty"), false) - result = false; - const IFileList* list = fs->getFileArchive(0)->getFileList(); -#if 1 - // log what we got - io::IFileArchive* archive = fs->getFileArchive(fs->getFileArchiveCount()-1); - fileList = archive->getFileList(); - for ( u32 f=0; f < fileList->getFileCount(); ++f) - { - logTestString("File name: %s\n", fileList->getFileName(f).c_str()); - logTestString("Full path: %s\n", fileList->getFullFileName(f).c_str()); - logTestString("ID: %d\n", fileList->getID(f)); - } -#endif - - if (list->getFileName(0) != "burnings video 0.39b.png") - result = false; - return result; -} - -bool testAddRemove(IFileSystem* fs, const io::path& archiveName) -{ - // make sure there is no archive mounted - if ( fs->getFileArchiveCount() ) - { - logTestString("Already mounted archives found\n"); - return false; - } - - if ( !fs->addFileArchive(archiveName, /*bool ignoreCase=*/true, /*bool ignorePaths=*/false) ) - { - logTestString("Mounting archive failed\n"); - return false; - } - - // make sure there is an archive mounted - if ( !fs->getFileArchiveCount() ) - { - logTestString("Mounted archive not in list\n"); - return false; - } - - if (!fs->removeFileArchive(archiveName)) - { - logTestString("Couldn't remove archive.\n"); - return false; - } - - // make sure there is no archive mounted - if ( fs->getFileArchiveCount() ) - return false; - - return true; -} -} - - -bool archiveReader() -{ - IrrlichtDevice * device = irr::createDevice(video::EDT_NULL, dimension2d<u32>(1, 1)); - assert_log(device); - if(!device) - return false; - - io::IFileSystem * fs = device->getFileSystem (); - if ( !fs ) - return false; - - bool ret = true; - logTestString("Testing mount file.\n"); - ret &= testArchive(fs, "media/file_with_path"); - logTestString("Testing mount file.\n"); - ret &= testArchive(fs, "media/file_with_path/"); - logTestString("Testing zip files.\n"); - ret &= testArchive(fs, "media/file_with_path.zip"); - logTestString("Testing pak files.\n"); - ret &= testArchive(fs, "media/sample_pakfile.pak"); - logTestString("Testing npk files.\n"); - ret &= testArchive(fs, "media/file_with_path.npk"); - logTestString("Testing encrypted zip files.\n"); - ret &= testEncryptedZip(fs); - logTestString("Testing special zip files.\n"); - ret &= testSpecialZip(fs, "media/Monty.zip", "monty/license.txt", "Monty"); - logTestString("Testing special zip files lzma.\n"); - const u8 buf[] = {0xff, 0xfe, 0x3c, 0x00, 0x3f}; - ret &= testSpecialZip(fs, "media/lzmadata.zip", "tahoma10_.xml", buf); -// logTestString("Testing complex mount file.\n"); -// ret &= testMountFile(fs); - logTestString("Testing add/remove with filenames.\n"); - ret &= testAddRemove(fs, "media/file_with_path.zip"); - - device->closeDevice(); - device->run(); - device->drop(); - - return ret; -} - diff --git a/tests/b3dAnimation.cpp b/tests/b3dAnimation.cpp deleted file mode 100644 index c0dbf3b5..00000000 --- a/tests/b3dAnimation.cpp +++ /dev/null @@ -1,87 +0,0 @@ -// Copyright (C) 2008-2012 Colin MacDonald -// No rights reserved: this software is in the public domain. - -#include "testUtils.h" - -using namespace irr; - -// Tests B3D animations. -bool b3dAnimation(void) -{ - // Use EDT_BURNINGSVIDEO since it is not dependent on (e.g.) OpenGL driver versions. - IrrlichtDevice *device = createDevice(video::EDT_BURNINGSVIDEO, core::dimension2d<u32>(160, 120), 32); - assert_log(device); - if (!device) - return false; - - video::IVideoDriver* driver = device->getVideoDriver(); - scene::ISceneManager * smgr = device->getSceneManager(); - - scene::ISkinnedMesh* mesh = (scene::ISkinnedMesh*)smgr->getMesh("../media/ninja.b3d"); - assert_log(mesh); - - bool result = false; - if (!mesh) - return false; - - scene::IAnimatedMeshSceneNode* node1 = smgr->addAnimatedMeshSceneNode(mesh); - assert_log(node1); - - /** Verify that two skinned animated mesh scene nodes can use different frames of the skinned mesh */ - if(node1) - { - node1->setPosition(core::vector3df(-3, -3, 10)); - node1->setMaterialFlag(video::EMF_LIGHTING, false); - node1->setAnimationSpeed(0.f); - node1->setCurrentFrame(10.f); - node1->setDebugDataVisible(irr::scene::EDS_BBOX_BUFFERS); - } - - scene::IAnimatedMeshSceneNode* node2 = smgr->addAnimatedMeshSceneNode(mesh); - assert_log(node2); - if(node2) - { - node2->setPosition(core::vector3df(3, -3, 10)); - node2->setMaterialFlag(video::EMF_LIGHTING, false); - node2->setAnimationSpeed(0.f); - node2->setCurrentFrame(62.f); - node2->setDebugDataVisible(scene::EDS_BBOX_BUFFERS); - } - - (void)smgr->addCameraSceneNode(); - - // Just jump to the last frame since that's all we're interested in. - device->run(); - driver->beginScene(video::ECBF_COLOR | video::ECBF_DEPTH, video::SColor(255, 60, 60, 60)); - smgr->drawAll(); - driver->endScene(); - - result = takeScreenshotAndCompareAgainstReference(driver, "-b3dAnimation.png"); - if (node2) - node2->remove(); - - /** Now test if bones are correctly positioned. */ - node1->setDebugDataVisible(scene::EDS_SKELETON); - node1->setPosition(core::vector3df(1,-5,8)); - node1->setRotation(core::vector3df(0,180,0)); - node1->updateAbsolutePosition(); - for (u32 i=0; i<node1->getJointCount(); ++i) - { - smgr->addCubeSceneNode(1.f,0,-1,node1->getJointNode(i)->getAbsolutePosition()); -// smgr->addCubeSceneNode(1.f,node1->getJointNode(i)); - } - - // Simple render call - device->run(); - driver->beginScene(video::ECBF_COLOR | video::ECBF_DEPTH, video::SColor(255, 60, 60, 60)); - smgr->drawAll(); - driver->endScene(); - - result &= takeScreenshotAndCompareAgainstReference(driver, "-b3dJointPosition.png"); - - device->closeDevice(); - device->run(); - device->drop(); - - return result; -} diff --git a/tests/billboards.cpp b/tests/billboards.cpp deleted file mode 100644 index 2b1499b1..00000000 --- a/tests/billboards.cpp +++ /dev/null @@ -1,156 +0,0 @@ -// Copyright (C) 2008-2012 Colin MacDonald -// No rights reserved: this software is in the public domain. - -#include "testUtils.h" - -using namespace irr; - -namespace -{ -// Test billboard sizing -bool billboardSize(void) -{ - // Use EDT_BURNINGSVIDEO since it is not dependent on (e.g.) OpenGL driver versions. - IrrlichtDevice *device = createDevice(video::EDT_BURNINGSVIDEO, core::dimension2d<u32>(160, 120), 32); - assert_log(device); - if (!device) - return false; - - video::IVideoDriver* driver = device->getVideoDriver(); - scene::ISceneManager * smgr = device->getSceneManager(); - - smgr->addCameraSceneNode(); - scene::IBillboardSceneNode* bill = smgr->addBillboardSceneNode(); - bill->setPosition(core::vector3df(0,0,50)); - bill = smgr->addBillboardSceneNode(); - bill->setPosition(core::vector3df(-30,0,50)); - bill->getMaterial(0).Lighting=false; - bill = smgr->addBillboardSceneNode(); - bill->setPosition(core::vector3df(30,0,50)); - bill->getMaterial(0).Lighting=false; - bill->getMaterial(0).Wireframe=true; - bill = smgr->addBillboardSceneNode(); - bill->setPosition(core::vector3df(30,0,50)); - bill->setSize(2,2,2); - - bill = smgr->addBillboardSceneNode(); - bill->setSize(10,20,2); - bill->setPosition(core::vector3df(0,30,50)); - bill = smgr->addBillboardSceneNode(); - bill->setSize(10,2,20); - bill->setPosition(core::vector3df(-30,30,50)); - bill->getMaterial(0).Lighting=false; - bill = smgr->addBillboardSceneNode(); - bill->setSize(10,2,20); - bill->setPosition(core::vector3df(30,30,50)); - bill->getMaterial(0).Lighting=false; - bill->getMaterial(0).Wireframe=true; - bill = smgr->addBillboardSceneNode(); - bill->setPosition(core::vector3df(30,30,50)); - bill->setSize(2,2,2); - - video::ITexture* tex = driver->getTexture("../media/fireball.bmp"); - bill = smgr->addBillboardSceneNode(); - bill->getMaterial(0).Lighting=false; - bill->getMaterial(0).TextureLayer[0].AnisotropicFilter=true; - bill->getMaterial(0).setTexture(0, tex); - bill->setSize(10,20,2); - bill->setPosition(core::vector3df(0,-30,50)); - bill = smgr->addBillboardSceneNode(); - bill->setSize(10,2,20); - bill->setPosition(core::vector3df(-30,-30,50)); - bill->getMaterial(0).TextureLayer[0].AnisotropicFilter=true; - bill->getMaterial(0).setTexture(0, tex); - bill->getMaterial(0).Lighting=false; - bill = smgr->addBillboardSceneNode(); - bill->setSize(10,2,20); - bill->setPosition(core::vector3df(30,-30,50)); - bill->getMaterial(0).TextureLayer[0].AnisotropicFilter=true; - bill->getMaterial(0).setTexture(0, tex); - bill->getMaterial(0).Lighting=false; - bill->getMaterial(0).Wireframe=true; - bill = smgr->addBillboardSceneNode(); - bill->setPosition(core::vector3df(30,-30,50)); - bill->setSize(2,2,2); - - bill = smgr->addBillboardSceneNode(); - bill->getMaterial(0).Lighting=false; - bill->getMaterial(0).setTexture(0, tex); - bill->setSize(10,20,14); - bill->setPosition(core::vector3df(0,-15,50)); - bill = smgr->addBillboardSceneNode(); - bill->setSize(10,14,20); - bill->setPosition(core::vector3df(-30,-15,50)); - bill->getMaterial(0).setTexture(0, tex); - bill->getMaterial(0).Lighting=false; - bill = smgr->addBillboardSceneNode(); - bill->setSize(10,14,20); - bill->setPosition(core::vector3df(30,-15,50)); - bill->getMaterial(0).setTexture(0, tex); - bill->getMaterial(0).Lighting=false; - bill->getMaterial(0).Wireframe=true; - bill = smgr->addBillboardSceneNode(); - bill->setPosition(core::vector3df(30,-15,50)); - bill->setSize(2,2,2); - - bool result = false; - - device->run(); - driver->beginScene(video::ECBF_COLOR | video::ECBF_DEPTH, video::SColor(255, 60, 60, 60)); - smgr->drawAll(); - driver->endScene(); - - result = takeScreenshotAndCompareAgainstReference(driver, "-billboard.png"); - - device->closeDevice(); - device->run(); - device->drop(); - - return result; -} - -// Test billboard orientation -// Should generate a properly readable (i.e. not mirrored or flipped) -// font file display. -bool billboardOrientation(void) -{ - // Use EDT_BURNINGSVIDEO since it is not dependent on (e.g.) OpenGL driver versions. - IrrlichtDevice *device = createDevice(video::EDT_BURNINGSVIDEO, core::dimension2d<u32>(160, 120), 32); - assert_log(device); - if (!device) - return false; - - video::IVideoDriver* driver = device->getVideoDriver(); - scene::ISceneManager * smgr = device->getSceneManager(); - - smgr->addCameraSceneNode(); - scene::IBillboardSceneNode* bill = smgr->addBillboardSceneNode(0, core::dimension2df(40,40)); - bill->setPosition(core::vector3df(0,-15,10)); - bill->getMaterial(0).Lighting=false; - bill->getMaterial(0).setTexture(0, driver->getTexture("../media/fontcourier.bmp")); - - bool result = false; - - device->run(); - driver->beginScene(video::ECBF_COLOR | video::ECBF_DEPTH, video::SColor(255, 60, 60, 60)); - smgr->drawAll(); - driver->endScene(); - - result = takeScreenshotAndCompareAgainstReference(driver, "-billboardOrientation.png"); - - device->closeDevice(); - device->run(); - device->drop(); - - return result; -} - -} // end anonymous namespace - -// Test billboards -bool billboards(void) -{ - bool result = billboardSize(); - result &= billboardOrientation(); - return result; -} diff --git a/tests/burningsVideo.cpp b/tests/burningsVideo.cpp deleted file mode 100644 index 665a4865..00000000 --- a/tests/burningsVideo.cpp +++ /dev/null @@ -1,40 +0,0 @@ -// Copyright (C) 2008-2012 Colin MacDonald -// No rights reserved: this software is in the public domain. - -#include "testUtils.h" - -using namespace irr; -using namespace scene; -using namespace video; - -/** Tests the Burning Video driver */ -bool burningsVideo(void) -{ - IrrlichtDevice *device = createDevice(video::EDT_BURNINGSVIDEO, - core::dimension2du(160,120), 32); - if (!device) - return false; - - IVideoDriver* driver = device->getVideoDriver(); - ISceneManager* smgr = device->getSceneManager(); - - smgr->addCubeSceneNode(10.f, 0, -1, core::vector3df(0.f, 0.f, 20.f)); - smgr->addCameraSceneNode(); - // Test that ambient lighting works when there are no other lights in the scene - smgr->setAmbientLight(video::SColorf(.7f, .1f, .1f, 1.f)); - - bool result = false; - device->run(); - if (driver->beginScene(video::ECBF_COLOR | video::ECBF_DEPTH, video::SColor(0, 80, 80, 80))) - { - smgr->drawAll(); - driver->endScene(); - result = takeScreenshotAndCompareAgainstReference(driver, "-ambient-lighting.png", 100); - } - - device->closeDevice(); - device->run(); - device->drop(); - - return result; -} diff --git a/tests/collisionResponseAnimator.cpp b/tests/collisionResponseAnimator.cpp deleted file mode 100644 index e852a1b0..00000000 --- a/tests/collisionResponseAnimator.cpp +++ /dev/null @@ -1,198 +0,0 @@ -// Copyright (C) 2008-2012 Colin MacDonald -// No rights reserved: this software is in the public domain. - -#include "testUtils.h" - -using namespace irr; -using namespace core; -using namespace scene; -using namespace video; - -static bool expectedCollisionCallbackPositions = true; - -class CMyCollisionCallback : public ICollisionCallback -{ -public: - bool onCollision(const ISceneNodeAnimatorCollisionResponse& animator) - { - const vector3df & collisionPoint = animator.getCollisionPoint(); - - logTestString("Collision callback at %f %f %f\n", - collisionPoint.X, collisionPoint.Y, collisionPoint.Z); - - if(collisionPoint != ExpectedCollisionPoint) - { - logTestString("*** Error: collision point, expected %f %f %f\n", - ExpectedCollisionPoint.X, ExpectedCollisionPoint.Y, ExpectedCollisionPoint.Z); - expectedCollisionCallbackPositions = false; - assert_log(false); - } - - const vector3df & nodePosition = animator.getCollisionResultPosition(); - if(nodePosition != ExpectedNodePosition) - { - logTestString("*** Error: result position, expected %f %f %f\n", - ExpectedNodePosition.X, ExpectedNodePosition.Y, ExpectedNodePosition.Z); - expectedCollisionCallbackPositions = false; - assert_log(false); - } - - if(animator.getTargetNode() != ExpectedTarget) - { - logTestString("*** Error: wrong node\n"); - expectedCollisionCallbackPositions = false; - assert_log(false); - } - - return ConsumeNextCollision; - } - - void setNextExpectedCollision(ISceneNode* target, - const vector3df& expectedPoint, - const vector3df& expectedPosition, - bool consume) - { - ExpectedTarget = target; - ExpectedCollisionPoint = expectedPoint; - ExpectedNodePosition = expectedPosition; - ConsumeNextCollision = consume; - } - -private: - - ISceneNode * ExpectedTarget; - vector3df ExpectedCollisionPoint; - vector3df ExpectedNodePosition; - bool ConsumeNextCollision; - -}; - -/** Test that collision response animator will reset itself when removed from a - scene node, so that the scene node can then be moved without the animator - jumping it back again. */ -bool collisionResponseAnimator(void) -{ - IrrlichtDevice * device = irr::createDevice(video::EDT_NULL); - assert_log(device); - if(!device) - return false; - - ISceneManager * smgr = device->getSceneManager(); - - // Create 2 nodes to the left of a "wall" - ISceneNode * testNode1 = smgr->addEmptySceneNode(); - ISceneNode * testNode2 = smgr->addEmptySceneNode(); - testNode1->setPosition(vector3df(-50, 0,0)); - testNode2->setPosition(vector3df(-50, 0,0)); - - // Create a "wall" node, and collision response animators for each test node. - IMeshSceneNode * wallNode = smgr->addCubeSceneNode(10.f); - - ITriangleSelector * wallSelector = smgr->createTriangleSelectorFromBoundingBox(wallNode); - ISceneNodeAnimatorCollisionResponse * collisionAnimator1 = - smgr->createCollisionResponseAnimator(wallSelector, - testNode1, - vector3df(10,10,10), - vector3df(0, 0, 0)); - testNode1->addAnimator(collisionAnimator1); - - CMyCollisionCallback collisionCallback; - collisionAnimator1->setCollisionCallback(&collisionCallback); - - collisionAnimator1->drop(); - collisionAnimator1 = 0; - - ISceneNodeAnimatorCollisionResponse * collisionAnimator2 = - smgr->createCollisionResponseAnimator(wallSelector, - testNode2, - vector3df(10,10,10), - vector3df(0, 0, 0)); - testNode2->addAnimator(collisionAnimator2); - collisionAnimator2->setCollisionCallback(&collisionCallback); - - wallSelector->drop(); - // Don't drop() collisionAnimator2 since we're going to use it. - - // Get the system in a good state - device->run(); - smgr->drawAll(); - - // Try to move both nodes to the right of the wall. - // This one should be stopped by its animator. - testNode1->setPosition(vector3df(50, 0,0)); - collisionCallback.setNextExpectedCollision(testNode1, - vector3df(-5.005f, 0, 0), - vector3df(-15.005f, 0, 0), - false); - - // Whereas this one, by forcing the animator to update its target node, should be - // able to pass through the wall. (In <=1.6 it was stopped by the wall even if - // the animator was removed and later re-added); - testNode2->setPosition(vector3df(50, 0,0)); - collisionAnimator2->setTargetNode(testNode2); - collisionAnimator2->drop(); // We're done using this now. - - device->run(); - smgr->drawAll(); - - bool result = true; - - if(testNode1->getAbsolutePosition().X > -15.f) - { - logTestString("collisionResponseAnimator test node 1 wasn't stopped from moving.\n"); - assert_log(false); - result = false; - } - - if(testNode2->getAbsolutePosition().X < 50.f) - { - logTestString("collisionResponseAnimator test node 2 was stopped from moving.\n"); - assert_log(false); - result = false; - } - - // Now try to move the second node back through the wall again. Now it should be - // stopped by the wall. - testNode2->setPosition(vector3df(-50, 0, 0)); - - // We'll consume this collision, so the node will actually move all the way through. - collisionCallback.setNextExpectedCollision(testNode2, - vector3df(5.005f, 0, 0), - vector3df(15.005f, 0, 0), - true); - - device->run(); - smgr->drawAll(); - - if(testNode2->getAbsolutePosition().X != -50.f) - { - logTestString("collisionResponseAnimator test node 2 was stopped from moving.\n"); - assert_log(false); - result = false; - } - - // Now we'll try to move it back to the right and allow it to be stopped. - collisionCallback.setNextExpectedCollision(testNode2, - vector3df(-5.005f, 0, 0), - vector3df(-15.005f, 0, 0), - false); - testNode2->setPosition(vector3df(50, 0, 0)); - - device->run(); - smgr->drawAll(); - - if(testNode2->getAbsolutePosition().X > -15.f) - { - logTestString("collisionResponseAnimator test node 2 moved too far.\n"); - assert_log(false); - result = false; - } - - device->closeDevice(); - device->run(); - device->drop(); - - result &= expectedCollisionCallbackPositions; - return result; -} - diff --git a/tests/color.cpp b/tests/color.cpp deleted file mode 100644 index c31e4273..00000000 --- a/tests/color.cpp +++ /dev/null @@ -1,21 +0,0 @@ -#include "testUtils.h" - -using namespace irr; -using namespace video; - -bool rounding() -{ - SColorf colf(0.003922f, 0.007843f, 0.011765f); // test-values by virion which once failed - SColor col = colf.toSColor(); - return col.getRed() == 1 && col.getGreen() == 2 && col.getBlue() == 3; -} - -//! Test SColor and SColorf -bool color(void) -{ - bool ok = true; - - ok &= rounding(); - - return ok; -} diff --git a/tests/coreutil.cpp b/tests/coreutil.cpp deleted file mode 100644 index 672cce0a..00000000 --- a/tests/coreutil.cpp +++ /dev/null @@ -1,59 +0,0 @@ -#include "testUtils.h" - -using namespace irr; -using namespace core; - -bool testMergeFilename() -{ - // path mergeFilename(const path& path, const path& filename, const path& extension = ""); - if ( mergeFilename(_IRR_TEXT(""), _IRR_TEXT(""), _IRR_TEXT("") ) != io::path(_IRR_TEXT("")) ) - return false; - if ( mergeFilename(_IRR_TEXT("folder"), _IRR_TEXT(""), _IRR_TEXT("") ) != io::path(_IRR_TEXT("folder/")) ) - return false; - if ( mergeFilename(_IRR_TEXT("folder/"), _IRR_TEXT(""), _IRR_TEXT("") ) != io::path(_IRR_TEXT("folder/")) ) - return false; - if ( mergeFilename(_IRR_TEXT("folder"), _IRR_TEXT("file"), _IRR_TEXT("") ) != io::path(_IRR_TEXT("folder/file")) ) - return false; - if ( mergeFilename(_IRR_TEXT("folder/"), _IRR_TEXT("file"), _IRR_TEXT("") ) != io::path(_IRR_TEXT("folder/file")) ) - return false; - if ( mergeFilename(_IRR_TEXT("folder\\"), _IRR_TEXT("file"), _IRR_TEXT("") ) != io::path(_IRR_TEXT("folder\\file")) ) - return false; - if ( mergeFilename(_IRR_TEXT(""), _IRR_TEXT("file"), _IRR_TEXT("") ) != io::path(_IRR_TEXT("file")) ) - return false; - if ( mergeFilename(_IRR_TEXT("."), _IRR_TEXT("file"), _IRR_TEXT("") ) != io::path(_IRR_TEXT("./file")) ) - return false; - if ( mergeFilename(_IRR_TEXT("folder"), _IRR_TEXT(""), _IRR_TEXT(".bmp") ) != io::path(_IRR_TEXT("folder/.bmp")) ) - return false; - if ( mergeFilename(_IRR_TEXT("folder/"), _IRR_TEXT(""), _IRR_TEXT(".bmp") ) != io::path(_IRR_TEXT("folder/.bmp")) ) - return false; - if ( mergeFilename(_IRR_TEXT("folder"), _IRR_TEXT(""), _IRR_TEXT("bmp") ) != io::path(_IRR_TEXT("folder/.bmp")) ) - return false; - if ( mergeFilename(_IRR_TEXT("."), _IRR_TEXT(""), _IRR_TEXT("bmp") ) != io::path(_IRR_TEXT("./.bmp")) ) - return false; - if ( mergeFilename(_IRR_TEXT("folder"), _IRR_TEXT("file"), _IRR_TEXT("bmp") ) != io::path(_IRR_TEXT("folder/file.bmp")) ) - return false; - if ( mergeFilename(_IRR_TEXT("folder/"), _IRR_TEXT("file"), _IRR_TEXT("bmp") ) != io::path(_IRR_TEXT("folder/file.bmp")) ) - return false; - if ( mergeFilename(_IRR_TEXT("folder/"), _IRR_TEXT("file"), _IRR_TEXT(".bmp") ) != io::path(_IRR_TEXT("folder/file.bmp")) ) - return false; - if ( mergeFilename(_IRR_TEXT("folder"), _IRR_TEXT("file.bmp"), _IRR_TEXT("") ) != io::path(_IRR_TEXT("folder/file.bmp")) ) - return false; - if ( mergeFilename(_IRR_TEXT(""), _IRR_TEXT("file"), _IRR_TEXT("bmp") ) != io::path(_IRR_TEXT("file.bmp")) ) - return false; - if ( mergeFilename(_IRR_TEXT(""), _IRR_TEXT("file"), _IRR_TEXT(".bmp") ) != io::path(_IRR_TEXT("file.bmp")) ) - return false; - if ( mergeFilename(_IRR_TEXT("c:"), _IRR_TEXT("file"), _IRR_TEXT(".bmp") ) != io::path(_IRR_TEXT("c:/file.bmp")) ) // TODO: is this actually correct on windows? - return false; - - return true; -} - -// Test the functionality of the Irrlicht timer -bool testCoreutil(void) -{ - bool ok = true; - - ok &= testMergeFilename(); - - return ok; -} diff --git a/tests/createImage.cpp b/tests/createImage.cpp deleted file mode 100644 index 91a20e56..00000000 --- a/tests/createImage.cpp +++ /dev/null @@ -1,94 +0,0 @@ -#include "testUtils.h" - -using namespace irr; - -namespace -{ -bool testImageCreation() -{ - // create device - - IrrlichtDevice *device = createDevice(video::EDT_SOFTWARE, core::dimension2d<u32>(160,120)); - - if (device == 0) - return true; // could not create selected driver. - - bool result = true; - video::IVideoDriver* driver = device->getVideoDriver(); - video::ITexture* tex=driver->getTexture("../media/water.jpg"); - video::ITexture* tex1=0; - video::ITexture* tex2=0; - if (!tex) - result=false; - else - { - video::IImage* img1=driver->createImage(tex, core::vector2di(0,0), core::dimension2du(32,32)); - if (!img1) - result=false; - else - { - tex1=driver->addTexture("new1", img1); - img1->drop(); - img1=0; - } - video::IImage* img2=driver->createImage(tex, core::vector2di(0,0), tex->getSize()); - if (!img2) - result=false; - else - { - tex2=driver->addTexture("new2", img2); - img2->drop(); - img2 = 0; - } - } - - driver->beginScene(video::ECBF_COLOR | video::ECBF_DEPTH, video::SColor(255,255,0,255));//Backbuffer background is pink - - driver->draw2DImage(tex, core::position2d<s32>(0,0), core::recti(0,0,32,32)); - driver->draw2DImage(tex1, core::position2d<s32>(32,0)); - driver->draw2DImage(tex2, core::position2d<s32>(64,0), core::recti(0,0,32,32)); - - driver->endScene(); - - result = takeScreenshotAndCompareAgainstReference(driver, "-createImage.png"); - - device->closeDevice(); - device->run(); - device->drop(); - - return result; -} - -bool testImageFormats() -{ - IrrlichtDevice *device = createDevice(video::EDT_BURNINGSVIDEO, core::dimension2d<u32>(256,128)); - - if (device == 0) - return true; // could not create selected driver. - - video::IVideoDriver* driver = device->getVideoDriver(); - video::ITexture* tex=driver->getTexture("../media/water.jpg"); - video::ITexture* tex1=driver->getTexture("media/grey.tga"); - driver->beginScene(video::ECBF_COLOR | video::ECBF_DEPTH, video::SColor(255,0,0,0)); - - driver->draw2DImage(tex, core::position2d<s32>(0,0), core::recti(0,0,64,64)); - driver->draw2DImage(tex1, core::position2d<s32>(0,64), core::recti(0,0,64,64)); - driver->endScene(); - - bool result = takeScreenshotAndCompareAgainstReference(driver, "-testImageFormats.png", 99.5f); - - device->closeDevice(); - device->run(); - device->drop(); - - return result; -} -} - -bool createImage() -{ - bool result = testImageCreation(); - result &= testImageFormats(); - return result; -} - diff --git a/tests/cursorSetVisible.cpp b/tests/cursorSetVisible.cpp deleted file mode 100644 index bf08cdf5..00000000 --- a/tests/cursorSetVisible.cpp +++ /dev/null @@ -1,70 +0,0 @@ -// Copyright (C) 2008-2012 Colin MacDonald -// No rights reserved: this software is in the public domain. - -#include "testUtils.h" - -using namespace irr; -using namespace core; - -struct TrapMouseMoves : IEventReceiver -{ - int MouseMovesReceived; - - TrapMouseMoves() : MouseMovesReceived(0) { } - - virtual bool OnEvent(const SEvent & event) - { - if(event.EventType == EET_MOUSE_INPUT_EVENT - && event.MouseInput.Event == EMIE_MOUSE_MOVED) - MouseMovesReceived++; - - return false; - } -}; - -/** This test verifies that setting the cursor visibility - only generates a mouse message when it actually changes */ -bool cursorSetVisible(void) -{ - IrrlichtDevice * device = createDevice(video::EDT_SOFTWARE, dimension2d<u32>(1, 1)); - TrapMouseMoves moveTrapper; - device->setEventReceiver(&moveTrapper); - - device->run(); - - gui::ICursorControl * cursor = device->getCursorControl(); - - // Move the cursor inside the Irrlicht window so that we get messages for it. - cursor->setPosition(0, 0); - device->run(); // Receive any messages - - cursor->setVisible(false); // Should generate a mouse move - device->run(); // Receive any messages - - cursor->setVisible(false); // Should not generate a mouse move - device->run(); // Receive any messages - - cursor->setVisible(true); // Should generate a mouse move - device->run(); // Receive any messages - - cursor->setVisible(true); // Should not generate a mouse move - device->run(); // Receive any messages - - - // We should get at most 3 messages: one for the setPosition(), and one for - // each actual change of visibility. - bool result = (moveTrapper.MouseMovesReceived <= 3); - - device->closeDevice(); - device->run(); - device->drop(); - - if(!result) - { - logTestString("ERROR: cursorSetVisible received %d events.\n", moveTrapper.MouseMovesReceived); - assert_log(false); - } - - return result; -} - diff --git a/tests/disambiguateTextures.cpp b/tests/disambiguateTextures.cpp deleted file mode 100644 index e53275f1..00000000 --- a/tests/disambiguateTextures.cpp +++ /dev/null @@ -1,84 +0,0 @@ -// Copyright (C) 2008-2012 Colin MacDonald -// No rights reserved: this software is in the public domain. - -#include "testUtils.h" - -using namespace irr; -using namespace core; -using namespace scene; -using namespace video; -using namespace io; -using namespace gui; - -/** This tests verifies that textures opened from different places in the filesystem - can be distinguished, even if they have the same filename. */ -bool disambiguateTextures(void) -{ - IrrlichtDevice *device = - createDevice( video::EDT_NULL, dimension2d<u32>(640, 480)); - - if (!device) - { - logTestString("Unable to create EDT_NULL device\n"); - return false; - } - - // Expects an empty tmp/tmp directory under this app's wd and - // a media directory under this apps' directory with tools.png in it. - stringc wd = device->getFileSystem()->getWorkingDirectory(); - - if(-1 == wd.find("/tests") && -1 == wd.find("\\tests")) - { - logTestString("The tests must be run from the /tests directory, regardless of where\n"\ - "the test executable was built.\n"); - device->drop(); - return false; - } - - IVideoDriver * driver = device->getVideoDriver(); - - ITexture * tex1 = driver->getTexture("../media/tools.png"); - assert_log(tex1); - if(!tex1) - logTestString("Unable to open ../media/tools.png\n"); - - ITexture * tex2 = driver->getTexture("../media/tools.png"); - assert_log(tex2); - if(!tex2) - logTestString("Unable to open ../media/tools.png\n"); - - IReadFile * readFile = device->getFileSystem()->createAndOpenFile("../media/tools.png"); - assert_log(readFile); - if(!readFile) - logTestString("Unable to open ../media/tools.png\n"); - - ITexture * tex3 = driver->getTexture(readFile); - assert_log(tex3); - if(!readFile) - logTestString("Unable to create texture from ../media/tools.png\n"); - - readFile->drop(); - - // All 3 of the above textures should be identical. - assert_log(tex1 == tex2); - assert_log(tex1 == tex3); - - stringc newWd = wd + "/empty/empty"; - bool changed = device->getFileSystem()->changeWorkingDirectoryTo(newWd.c_str()); - assert_log(changed); - ITexture * tex4 = driver->getTexture("../../media/tools.png"); - assert_log(tex4); - if(!tex4) - logTestString("Unable to open ../../media/tools.png\n"); - assert_log(tex1 != tex4); - - // The working directory must be restored for the other tests to work. - changed &= device->getFileSystem()->changeWorkingDirectoryTo(wd.c_str()); - - device->closeDevice(); - device->run(); - device->drop(); - - return (changed && tex1 == tex2 && tex1 == tex3 && tex1 != tex4) ? true : false; -} - diff --git a/tests/draw2DImage.cpp b/tests/draw2DImage.cpp deleted file mode 100644 index 1d80c041..00000000 --- a/tests/draw2DImage.cpp +++ /dev/null @@ -1,196 +0,0 @@ -#include "testUtils.h" - -using namespace irr; - -namespace -{ - -bool testWithRenderTarget(video::E_DRIVER_TYPE driverType) -{ - // create device - - IrrlichtDevice *device = createDevice(driverType, core::dimension2d<u32>(160,120)); - - if (device == 0) - return true; // could not create selected driver. - - video::IVideoDriver* driver = device->getVideoDriver(); - - if (!driver->queryFeature(video::EVDF_RENDER_TO_TARGET)) - { - device->closeDevice(); - device->run(); - device->drop(); - return true; - } - - stabilizeScreenBackground(driver); - - logTestString("Testing driver %ls\n", driver->getName()); - - video::ITexture* renderTargetTex = driver->addRenderTargetTexture(core::dimension2d<u32>(64, 64), "BASEMAP"); - video::ITexture* renderTargetDepth = driver->addRenderTargetTexture(core::dimension2d<u32>(64, 64), "rtd", video::ECF_D16); - - video::IRenderTarget* renderTarget = driver->addRenderTarget(); - renderTarget->setTexture(renderTargetTex, renderTargetDepth); - - video::ITexture* tex=driver->getTexture("../media/water.jpg"); - - driver->beginScene(video::ECBF_COLOR | video::ECBF_DEPTH, video::SColor(255,255,0,255));//Backbuffer background is pink - - //draw the 256x256 water image on the rendertarget: - - - driver->setRenderTargetEx(renderTarget,video::ECBF_COLOR|video::ECBF_DEPTH,video::SColor(255,0,0,255));//Rendertarget background is blue - driver->draw2DImage(tex, core::position2d<s32>(0,0), core::recti(0,0,32,32)); - driver->setRenderTargetEx(0, 0); - - //draw the rendertarget on screen: - //this should normally draw a 64x64 image containing a 32x32 image in the top left corner - driver->draw2DImage(renderTargetTex, core::position2d<s32>(0,0)); - driver->endScene(); - - bool result = takeScreenshotAndCompareAgainstReference(driver, "-draw2DImageRTT.png"); - - device->closeDevice(); - device->run(); - device->drop(); - - return result; -} - -// Test various special destination rectangles -bool testRectangles(video::E_DRIVER_TYPE driverType) -{ - // create device - IrrlichtDevice *device = createDevice(driverType, core::dimension2d<u32>(160,120)); - - if (device == 0) - return true; // could not create selected driver. - - video::IVideoDriver* driver = device->getVideoDriver(); - - stabilizeScreenBackground(driver); - - logTestString("Testing driver %ls\n", driver->getName()); - - video::ITexture *tex=driver->getTexture("../media/fireball.bmp"); - - driver->beginScene(video::ECBF_COLOR | video::ECBF_DEPTH, video::SColor(255,255,0,255));//Backbuffer background is pink - - // draw normal, will be overdrwan in error case - driver->draw2DImage(tex, core::recti(68,32,132,96), core::recti(0,0,64,64)); - //draw the image larger - driver->draw2DImage(tex, core::recti(0,0,64,64), core::recti(0,0,32,32)); - //draw the image flipped horizontally - driver->draw2DImage(tex, core::recti(132,0,68,64), core::recti(0,0,64,64)); - //draw the image smaller - driver->draw2DImage(tex, core::recti(0,64,32,96), core::recti(0,0,64,64)); - //draw the image much smaller - driver->draw2DImage(tex, core::recti(36,64,44,72), core::recti(0,0,64,64)); - //draw the image flipped horizontally - driver->draw2DImage(tex, core::recti(68,64,132,0), core::recti(0,0,64,64)); - driver->endScene(); - - bool result = takeScreenshotAndCompareAgainstReference(driver, "-draw2DImageRect.png"); - - device->closeDevice(); - device->run(); - device->drop(); - - return result; -} - -// draws a complex (interlaced, paletted, alpha) png image -bool testWithPNG(video::E_DRIVER_TYPE driverType) -{ - // create device - - IrrlichtDevice *device = createDevice(driverType, core::dimension2d<u32>(160,120)); - - if (device == 0) - return true; // could not create selected driver. - - video::IVideoDriver* driver = device->getVideoDriver(); - - stabilizeScreenBackground(driver); - - logTestString("Testing driver %ls\n", driver->getName()); - - video::ITexture *tex=driver->getTexture("media/RedbrushAlpha-0.25.png"); - - driver->beginScene(video::ECBF_COLOR | video::ECBF_DEPTH, video::SColor(255,40,40,255));//Backbuffer background is blue - driver->draw2DImage(tex, core::recti(0,0,160,120), core::recti(0,0,256,256), 0, 0, true); - driver->endScene(); - - bool result = takeScreenshotAndCompareAgainstReference(driver, "-draw2DImagePNG.png", 98.f); - - device->closeDevice(); - device->run(); - device->drop(); - - return result; -} - -// draws an image and checks if the written example equals the original image -bool testExactPlacement(video::E_DRIVER_TYPE driverType) -{ - // create device - - IrrlichtDevice *device = createDevice(driverType, core::dimension2d<u32>(160,120), 32); - - if (device == 0) - return true; // could not create selected driver. - - video::IVideoDriver* driver = device->getVideoDriver(); - - if (driver->getColorFormat() != video::ECF_A8R8G8B8 || !driver->queryFeature(video::EVDF_RENDER_TO_TARGET)) - { - device->closeDevice(); - device->run(); - device->drop(); - return true; - } - - stabilizeScreenBackground(driver); - - logTestString("Testing driver %ls\n", driver->getName()); - - video::ITexture* renderTargetTex = driver->addRenderTargetTexture(core::dimension2d<u32>(32, 32), "rt1"); - video::ITexture* renderTargetDepth = driver->addRenderTargetTexture(core::dimension2d<u32>(32, 32), "rtd", video::ECF_D16); - - video::IRenderTarget* renderTarget = driver->addRenderTarget(); - renderTarget->setTexture(renderTargetTex, renderTargetDepth); - - video::ITexture* tex=driver->getTexture("../media/fireball.bmp"); - - driver->beginScene(video::ECBF_COLOR | video::ECBF_DEPTH, video::SColor(255,40,40,255));//Backbuffer background is blue - driver->setRenderTargetEx(renderTarget, 0, video::ECBF_COLOR | video::ECBF_DEPTH); - driver->draw2DImage(tex, core::recti(0,0,32,32), core::recti(0,0,64,64)); - driver->setRenderTargetEx(0, 0, 0); - driver->endScene(); - - video::IImage* img = driver->createImage(renderTargetTex, core::vector2di(), renderTargetTex->getSize()); - driver->writeImageToFile(img, "results/fireball.png"); - img->drop(); - bool result = fuzzyCompareImages(driver, "media/fireball.png", "results/fireball.png")>98.25f; - - device->closeDevice(); - device->run(); - device->drop(); - - return result; -} - -} - -bool draw2DImage() -{ - bool result = true; - TestWithAllDrivers(testWithRenderTarget); - TestWithAllHWDrivers(testWithPNG); - // TODO D3D driver moves image 1 pixel top-left in case of down scaling - TestWithAllDrivers(testExactPlacement); - TestWithAllDrivers(testRectangles); - return result; -} diff --git a/tests/drawPixel.cpp b/tests/drawPixel.cpp deleted file mode 100644 index 38a6baf6..00000000 --- a/tests/drawPixel.cpp +++ /dev/null @@ -1,191 +0,0 @@ -// Copyright (C) 2008-2012 Colin MacDonald -// No rights reserved: this software is in the public domain. - -#include "testUtils.h" - -using namespace irr; -using namespace core; -using namespace scene; -using namespace video; -using namespace io; -using namespace gui; - -//! Tests IVideoDriver::drawPixel(). -/** Expect to see two diagonal lines overlaying a wall texture cube. - One line should run from green at the top left to red at the bottom right. - The other should run from cyan 100% transparent at the bottom left to - cyan 100% opaque at the top right. */ -static bool lineRender(E_DRIVER_TYPE driverType) -{ - IrrlichtDevice *device = createDevice( driverType, dimension2d<u32>(160, 120), 32); - if (!device) - return true; // Treat a failure to create a driver as benign; this saves a lot of #ifdefs - - IVideoDriver* driver = device->getVideoDriver(); - ISceneManager * smgr = device->getSceneManager(); - - stabilizeScreenBackground(driver); - - logTestString("Testing driver %ls\n", driver->getName()); - - // Draw a cube background so that we can check that the pixels' alpha is working. - ISceneNode * cube = smgr->addCubeSceneNode(50.f, 0, -1, vector3df(0, 0, 60)); - cube->setMaterialTexture(0, driver->getTexture("../media/wall.bmp")); - cube->setMaterialFlag(video::EMF_LIGHTING, false); - (void)smgr->addCameraSceneNode(); - - driver->beginScene(video::ECBF_COLOR | video::ECBF_DEPTH, SColor(255,100,101,140)); - smgr->drawAll(); - - // Test for benign handling of offscreen pixel values as well as onscreen ones. - for(s32 x = -10; x < 170; ++x) - { - s32 y = 120 * x / 160; - driver->drawPixel((u32)x, (u32)y, SColor(255, 255 * x / 640, 255 * (640 - x) / 640, 0)); - y = 120 - y; - driver->drawPixel((u32)x, (u32)y, SColor(255 * x / 640, 0, 255, 255)); - } - - driver->endScene(); - - bool result = takeScreenshotAndCompareAgainstReference(driver, "-drawPixel.png", 98.81f); - - device->closeDevice(); - device->run(); - device->drop(); - - return result; -} - -// this test draws alternating white and black borders with -// increasing thickness. Intended use of this test is to ensure -// the corect pixel alignment within the render window. -static bool pixelAccuracy(E_DRIVER_TYPE driverType) -{ - IrrlichtDevice *device = createDevice( driverType, dimension2d<u32>(160, 120), 32); - if (!device) - return true; // Treat a failure to create a driver as benign; this saves a lot of #ifdefs - - IVideoDriver* driver = device->getVideoDriver(); - - stabilizeScreenBackground(driver); - - logTestString("Testing driver %ls\n", driver->getName()); - - device->getSceneManager()->addCameraSceneNode(); - - driver->beginScene(video::ECBF_COLOR | video::ECBF_DEPTH, SColor(255,100,101,140)); - u32 start=0; - for (u32 count=1; count<10; ++count) - { - for (u32 j=0; j<count; ++j) - { - for (u32 x=0; x<100-start; ++x) - { - driver->drawPixel(start+x, start, (count%2==1)?0xffffffff:0xff000000); - } - ++start; - } - } - start=0; - for (u32 count=1; count<10; ++count) - { - for (u32 j=0; j<count; ++j) - { - for (u32 x=0; x<100-start; ++x) - { - driver->drawPixel(start, start+x, (count%2==1)?0xffffffff:0xff000000); - } - ++start; - } - } - for (u32 x=0; x<100; ++x) - { - driver->drawPixel(x, x, 0xffff0000); - } - driver->endScene(); - - bool result = takeScreenshotAndCompareAgainstReference(driver, "-pixelAccuracy.png"); - - device->closeDevice(); - device->run(); - device->drop(); - - return result; -} - -// this test draws lines of different lengths and compares -// them with pixel placement -// grey pixels denote start and end of the white drawn lines -// black pixels only make those grey points better visible -// yellow and magenta lines should start and end next toa black pixel, -// yellow one right to the last black pixel down, magenta below the last -// black pixel to the right -// white lines are always double drawn, lines back and forth. -static bool drawLine(E_DRIVER_TYPE driverType) -{ - IrrlichtDevice *device = createDevice( driverType, dimension2d<u32>(160, 120), 32); - if (!device) - return true; // Treat a failure to create a driver as benign; this saves a lot of #ifdefs - - IVideoDriver* driver = device->getVideoDriver(); - - stabilizeScreenBackground(driver); - - logTestString("Testing driver %ls\n", driver->getName()); - - device->getSceneManager()->addCameraSceneNode(); - - driver->beginScene(video::ECBF_COLOR | video::ECBF_DEPTH, SColor(255,100,101,140)); - // horizontal lines - for (u32 i=0; i<20; ++i) - { - driver->draw2DLine(core::vector2di(10,10+3*i), core::vector2di(10+2*i,10+3*i)); - // mark start point - driver->drawPixel(9,10+3*i+1, video::SColor(0xff000000)); - driver->drawPixel(10,10+3*i+1, video::SColor(0xff888888)); - driver->drawPixel(11,10+3*i+1, video::SColor(0xff000000)); - // mark end point - driver->drawPixel(9+2*i,10+3*i+1, video::SColor(0xff000000)); - driver->drawPixel(10+2*i,10+3*i+1, video::SColor(0xff888888)); - driver->drawPixel(11+2*i,10+3*i+1, video::SColor(0xff000000)); - driver->draw2DLine(core::vector2di(10+2*i,10+3*i+2), core::vector2di(10,10+3*i+2)); - } - // vertical lines - for (u32 i=0; i<20; ++i) - { - driver->draw2DLine(core::vector2di(11+3*i,10), core::vector2di(11+3*i,10+2*i)); - // mark start point - driver->drawPixel(11+3*i+1,9, video::SColor(0xff000000)); - driver->drawPixel(11+3*i+1,10, video::SColor(0xff888888)); - driver->drawPixel(11+3*i+1,11, video::SColor(0xff000000)); - // mark end point - driver->drawPixel(11+3*i+1,9+2*i, video::SColor(0xff000000)); - driver->drawPixel(11+3*i+1,10+2*i, video::SColor(0xff888888)); - driver->drawPixel(11+3*i+1,11+2*i, video::SColor(0xff000000)); - driver->draw2DLine(core::vector2di(11+3*i+2,10+2*i), core::vector2di(11+3*i+2, 10)); - } - // diagonal lines - driver->draw2DLine(core::vector2di(14,14),core::vector2di(50,68), video::SColor(0xffffff00)); - driver->draw2DLine(core::vector2di(15,14),core::vector2di(69,50), video::SColor(0xffff00ff)); - driver->endScene(); - - bool result = takeScreenshotAndCompareAgainstReference(driver, "-drawLine.png"); - - device->closeDevice(); - device->run(); - device->drop(); - - return result; -} - -bool drawPixel(void) -{ - bool result = true; - - TestWithAllDrivers(lineRender); - TestWithAllDrivers(pixelAccuracy); - TestWithAllDrivers(drawLine); - - return result; -} diff --git a/tests/drawRectOutline.cpp b/tests/drawRectOutline.cpp deleted file mode 100644 index 6995e155..00000000 --- a/tests/drawRectOutline.cpp +++ /dev/null @@ -1,54 +0,0 @@ -#include "testUtils.h" - -using namespace irr; - -namespace -{ - -bool testWithDriver(video::E_DRIVER_TYPE driverType) -{ - IrrlichtDevice *device = - createDevice(driverType, core::dimension2du(160, 120)); - if (!device) - return true; - - video::IVideoDriver* driver = device->getVideoDriver(); - - stabilizeScreenBackground(driver); - - logTestString("Testing driver %ls\n", driver->getName()); - - driver->beginScene(video::ECBF_COLOR | video::ECBF_DEPTH, video::SColor(255,100,101,140)); - - core::recti r; - r.UpperLeftCorner = core::position2di(1,1); - r.LowerRightCorner = core::position2di(100,100); - driver->draw2DRectangleOutline( r ); - - r += core::position2di( 10 , 10 ); - driver->draw2DRectangleOutline( r , video::SColor(128, 255, 128, 128) ); - - driver->getMaterial2D().Thickness=12.f; - driver->enableMaterial2D(); - r += core::position2di( 10 , 10 ); - driver->draw2DRectangleOutline( r , video::SColor(128, 255, 128, 128) ); - - driver->endScene(); - - bool result = takeScreenshotAndCompareAgainstReference(driver, "-drawRectOutline.png", 98.5f ); - - device->closeDevice(); - device->run(); - device->drop(); - - return result ; -} -} - -bool drawRectOutline(void) -{ - // TODO: Only OpenGL supports thick lines - bool result = true; - TestWithAllDrivers(testWithDriver); - return result; -} diff --git a/tests/drawVertexPrimitive.cpp b/tests/drawVertexPrimitive.cpp deleted file mode 100644 index 825e6134..00000000 --- a/tests/drawVertexPrimitive.cpp +++ /dev/null @@ -1,104 +0,0 @@ -#include "testUtils.h" - -using namespace irr; - -namespace -{ - -// this test renders random point clouds using different primitives on top -// tests the primitives type support in general and can hint to differences -// between the drivers -bool testWithDriver(video::E_DRIVER_TYPE driverType) -{ - IrrlichtDevice *device = - createDevice(driverType, core::dimension2du(160, 120)); - if (!device) - return true; - - scene::ISceneManager* smgr = device->getSceneManager(); - video::IVideoDriver* driver = device->getVideoDriver(); - - stabilizeScreenBackground(driver); - - logTestString("Testing driver %ls\n", driver->getName()); - - smgr->addCameraSceneNode(0, core::vector3df(128,128,-100), core::vector3df(128,128,128)); - - scene::SMeshBuffer Buffer; - - Buffer.Material.Wireframe = false; - Buffer.Material.Lighting = false; - Buffer.Material.FogEnable = false; - Buffer.Material.BackfaceCulling = false; - Buffer.Material.MaterialType = video::EMT_TRANSPARENT_VERTEX_ALPHA; - - device->getRandomizer()->reset(); - const u32 points=256; - Buffer.Vertices.reallocate(points); - for (u32 i=0; i<points; ++i) - { - f32 x = (f32)(1+device->getRandomizer()->rand()%points); - f32 y = (f32)(1+device->getRandomizer()->rand()%points); - f32 z = (f32)(1+device->getRandomizer()->rand()%points); - video::SColor color(255, device->getRandomizer()->rand()%255, device->getRandomizer()->rand()%255, device->getRandomizer()->rand()%255); - Buffer.Vertices.push_back( video::S3DVertex(x,y,z,0,1,0,color,0,0) ); - } - Buffer.recalculateBoundingBox(); - for (u32 i=0; i<Buffer.Vertices.size(); ++i) - { - Buffer.Indices.push_back(i); - } - - bool result = true; - for (u32 Type=scene::EPT_POINTS; Type <= scene::EPT_POINT_SPRITES; ++Type) - { - driver->beginScene(video::ECBF_COLOR | video::ECBF_DEPTH, video::SColor(255,100,101,140)); - smgr->drawAll(); - u32 primCount = 0; - switch (Type) - { - case scene::EPT_POINTS: primCount = Buffer.Indices.size(); break; - case scene::EPT_LINE_STRIP: primCount = Buffer.Indices.size()-1; break; - case scene::EPT_LINE_LOOP: primCount = Buffer.Indices.size()-1; break; - case scene::EPT_LINES: primCount = Buffer.Indices.size()/2; break; - case scene::EPT_TRIANGLE_STRIP: primCount = Buffer.Indices.size()-2; break; - case scene::EPT_TRIANGLE_FAN: primCount = Buffer.Indices.size()-2; break; - case scene::EPT_TRIANGLES: primCount = Buffer.Indices.size()/3; break; - case scene::EPT_QUAD_STRIP: primCount = (Buffer.Indices.size()-2)/4; break; - case scene::EPT_QUADS: primCount = Buffer.Indices.size()/4; break; - case scene::EPT_POLYGON: primCount = Buffer.Indices.size()-1; break; - case scene::EPT_POINT_SPRITES: primCount = Buffer.Indices.size(); break; - default: break; - } - - // TODO: mode is buggy, but required for skybox. So driver supports it, but would core dump here. - if (driverType==video::EDT_BURNINGSVIDEO && Type==scene::EPT_TRIANGLE_FAN) - continue; - driver->setMaterial(Buffer.Material); - driver->setTransform(video::ETS_WORLD, core::IdentityMatrix); - driver->drawVertexPrimitiveList(Buffer.getVertices(), - Buffer.getVertexCount(), Buffer.getIndices(), primCount, - video::EVT_STANDARD, (scene::E_PRIMITIVE_TYPE)Type, - video::EIT_16BIT); - driver->endScene(); - core::stringc name = "-drawVPL_"; - // we use character enumeration as we have more than 9 types - name.append(Type-scene::EPT_POINTS+'a'); - name.append(".png"); - result &= takeScreenshotAndCompareAgainstReference(driver, name.c_str(), 99.5f); - } - - device->closeDevice(); - device->run(); - device->drop(); - - return result ; -} -} - -bool drawVertexPrimitive(void) -{ - bool result = true; - TestWithAllDrivers(testWithDriver); - return result; -} diff --git a/tests/empty/empty/Direct3D 9.0.png b/tests/empty/empty/Direct3D 9.0.png deleted file mode 100644 index 66f160a8..00000000 Binary files a/tests/empty/empty/Direct3D 9.0.png and /dev/null differ diff --git a/tests/empty/empty/Irrlicht Software Device 1.0.png b/tests/empty/empty/Irrlicht Software Device 1.0.png deleted file mode 100644 index b5389f1d..00000000 Binary files a/tests/empty/empty/Irrlicht Software Device 1.0.png and /dev/null differ diff --git a/tests/empty/empty/OpenGL 2.1.2.png b/tests/empty/empty/OpenGL 2.1.2.png deleted file mode 100644 index a88e0476..00000000 Binary files a/tests/empty/empty/OpenGL 2.1.2.png and /dev/null differ diff --git a/tests/empty/empty/burnings video 0.39b.png b/tests/empty/empty/burnings video 0.39b.png deleted file mode 100644 index de345676..00000000 Binary files a/tests/empty/empty/burnings video 0.39b.png and /dev/null differ diff --git a/tests/enumerateImageManipulators.cpp b/tests/enumerateImageManipulators.cpp deleted file mode 100644 index 556ba4cd..00000000 --- a/tests/enumerateImageManipulators.cpp +++ /dev/null @@ -1,133 +0,0 @@ -// Copyright (C) 2008-2012 Colin MacDonald -// No rights reserved: this software is in the public domain. - -#include "testUtils.h" - -using namespace irr; -using namespace scene; -using namespace video; - -bool enumerateImageManipulators(void) -{ - IrrlichtDevice *device = createDevice(video::EDT_NULL); - if (!device) - return false; - - IVideoDriver* driver = device->getVideoDriver(); - - const char* filenames[] = - { - "foo.bmp", - "foo.jpg", - "foo.pcx", - "foo.png", - "foo.ppm", - "foo.psd", - "foo.tga", - // the following have no writers - "foo.wal", - "foo.pgm", - "foo.pbm", - "foo.rgb", - "foo.rgba", - "foo.sgi", - "foo.int", - "foo.inta", - "foo.bw" - }; - // how many formats have loaders? - const u32 writersUntil = 7; - - const u32 numberOfFilenames = sizeof(filenames) / sizeof(filenames[0]); - bool loaderForFilename[numberOfFilenames] = { false }; // and the rest get 0 == false - bool writerForFilename[numberOfFilenames] = { false }; // and the rest get 0 == false - - bool result = true; - - u32 i; - const u32 loaders = driver->getImageLoaderCount(); - for (i = 0; i < loaders; ++i) - { - IImageLoader * loader = driver->getImageLoader(i); - - if(!loader) - { - logTestString("Failed to get image loader %d\n", i); - assert_log(false); - result = false; - } - - for(u32 filename = 0; filename < numberOfFilenames; ++filename) - { - if(loader->isALoadableFileExtension(filenames[filename])) - { - loaderForFilename[filename] = true; - } - } - } - - IImageLoader * loader = driver->getImageLoader(i); - assert_log(loader == 0); - if(loader) - { - logTestString("Got a loader when none was expected (%d)\n", i); - result = false; - } - - for(u32 filename = 0; filename < numberOfFilenames; ++filename) - { - if(!loaderForFilename[filename]) - { - logTestString("File type '%s' doesn't have a loader\n", filenames[filename]); - assert_log(false); - result = false; - } - } - - const u32 writers = driver->getImageWriterCount(); - for (i = 0; i < writers; ++i) - { - IImageWriter * writer = driver->getImageWriter(i); - - if(!writer) - { - logTestString("Failed to get image writer %d\n", i); - assert_log(false); - result = false; - } - - for(u32 filename = 0; filename < numberOfFilenames; ++filename) - { - if(writer->isAWriteableFileExtension(filenames[filename])) - { - writerForFilename[filename] = true; - break; - } - } - } - - IImageWriter * writer = driver->getImageWriter(i); - assert_log(writer == 0); - if(writer) - { - logTestString("Got a writer when none was expected (%d)\n", i); - result = false; - } - - for(u32 filename = 0; filename < numberOfFilenames; ++filename) - { - // There's no writer for the .WAL file type. - if(!writerForFilename[filename] && (filename<writersUntil)) - { - logTestString("File type '%s' doesn't have a writer\n", filenames[filename]); - assert_log(false); - result = false; - } - } - - device->closeDevice(); - device->run(); - device->drop(); - - return result; -} diff --git a/tests/exports.cpp b/tests/exports.cpp deleted file mode 100644 index 7bbc2eee..00000000 --- a/tests/exports.cpp +++ /dev/null @@ -1,17 +0,0 @@ -// Copyright (C) 2008-2012 Colin MacDonald -// No rights reserved: this software is in the public domain. - -#include "testUtils.h" - -//! Tests that symbols exported from Irrlicht can be used by the user app. -bool exports(void) -{ - logTestString("Checking whether IdentityMatrix is exported.\n"); - irr::core::matrix4 identity = irr::core::IdentityMatrix; - (void)identity; // Satisfy the compiler that it's used. - - irr::video::SMaterial id = irr::video::IdentityMaterial; - (void)id; // Satisfy the compiler that it's used. - // If it built, we're done. - return true; -} diff --git a/tests/fast_atof.cpp b/tests/fast_atof.cpp deleted file mode 100644 index 46ecb573..00000000 --- a/tests/fast_atof.cpp +++ /dev/null @@ -1,290 +0,0 @@ -// Copyright (C) 2008-2012 Colin MacDonald -// No rights reserved: this software is in the public domain. - -#include "testUtils.h" - -using namespace irr; -using namespace core; - -//! This was an older Irrlicht implementation, tested against for reference. -static inline u32 old_strtol10(const char* in, const char** out=0) -{ - u32 value = 0; - - while ( ( *in >= '0') && ( *in <= '9' )) - { - value = ( value * 10 ) + ( *in - '0' ); - ++in; - } - if (out) - *out = in; - return value; -} - -//! This was an older Irrlicht implementation, tested against for reference. -static inline const char* old_fast_atof_move( const char* c, float& out) -{ - bool inv = false; - const char *t; - float f; - - if (*c=='-') - { - ++c; - inv = true; - } - - //f = (float)strtol(c, &t, 10); - f = (float) old_strtol10 ( c, &c ); - - if (*c == '.') - { - ++c; - - //float pl = (float)strtol(c, &t, 10); - float pl = (float) old_strtol10 ( c, &t ); - pl *= fast_atof_table[t-c]; - - f += pl; - - c = t; - - if (*c == 'e') - { - ++c; - //float exp = (float)strtol(c, &t, 10); - bool einv = (*c=='-'); - if (einv) - ++c; - - float exp = (float)old_strtol10(c, &c); - if (einv) - exp *= -1.0f; - - f *= (float)pow(10.0f, exp); - } - } - - if (inv) - f *= -1.0f; - - out = f; - return c; -} - -//! This was an older Irrlicht implementation, tested against for reference. -static inline float old_fast_atof(const char* c) -{ - float ret; - old_fast_atof_move(c, ret); - return ret; -} - - -static bool testCalculation_atof(const char * valueString) -{ - const f32 newFastValue = fast_atof(valueString); - const f32 oldFastValue = old_fast_atof(valueString); - const f32 atofValue = (f32)atof(valueString); - - logTestString("\n String '%s'\n New fast %.40f\n Old fast %.40f\n atof %.40f\n", - valueString, newFastValue, oldFastValue, atofValue); - - const f32 diffNew = fabs(newFastValue - atofValue) ; - const f32 diffOld = fabs(oldFastValue - atofValue) ; - bool accurate = diffNew <= diffOld || equalsByUlp(diffNew, diffOld, 1); - - if(!accurate) - logTestString("*** ERROR - less accurate than old method ***\n\n"); - - return accurate; -} - -static bool testCalculation_strtol(const char * valueString) -{ - const s32 newFastValue = strtol10(valueString); - const s32 oldFastValue = old_strtol10(valueString); - const s32 strtolValue = (s32)clamp(strtol(valueString, 0, 10), (long int)INT_MIN, (long int)INT_MAX); - - logTestString("\n String '%s'\n New fast %d\n Old fast %d\n strtol %d\n", - valueString, newFastValue, oldFastValue, strtolValue); - - bool accurate = (newFastValue == strtolValue) || (oldFastValue != strtolValue); - - if (!accurate) - logTestString("*** ERROR - wrong calculation in new method ***\n\n"); - - return accurate; -} - -//! Test both the accuracy and speed of Irrlicht's fast_atof() implementation. -bool test_fast_atof(void) -{ - bool accurate = true; - - accurate &= testCalculation_atof("340282346638528859811704183484516925440.000000"); - accurate &= testCalculation_atof("3.402823466e+38F"); - accurate &= testCalculation_atof("3402823466e+29F"); - accurate &= testCalculation_atof("-340282346638528859811704183484516925440.000000"); - accurate &= testCalculation_atof("-3.402823466e+38F"); - accurate &= testCalculation_atof("-3402823466e+29F"); - accurate &= testCalculation_atof("34028234663852885981170418348451692544.000000"); - accurate &= testCalculation_atof("3.402823466e+37F"); - accurate &= testCalculation_atof("3402823466e+28F"); - accurate &= testCalculation_atof("-34028234663852885981170418348451692544.000000"); - accurate &= testCalculation_atof("-3.402823466e+37F"); - accurate &= testCalculation_atof("-3402823466e+28F"); - accurate &= testCalculation_atof(".00234567"); - accurate &= testCalculation_atof("-.00234567"); - accurate &= testCalculation_atof("0.00234567"); - accurate &= testCalculation_atof("-0.00234567"); - accurate &= testCalculation_atof("1.175494351e-38F"); - accurate &= testCalculation_atof("1175494351e-47F"); - accurate &= testCalculation_atof("1.175494351e-37F"); - accurate &= testCalculation_atof("1.175494351e-36F"); - accurate &= testCalculation_atof("-1.175494351e-36F"); - accurate &= testCalculation_atof("123456.789"); - accurate &= testCalculation_atof("-123456.789"); - accurate &= testCalculation_atof("0000123456.789"); - accurate &= testCalculation_atof("-0000123456.789"); - accurate &= testCalculation_atof("-0.0690462109446526"); - accurate &= testCalculation_atof("0.11999999731779099"); // more numbers past dot than in lookup table - accurate &= testCalculation_atof("0.119999997317790999"); - - if (!accurate) - { - logTestString("Calculation is not accurate, so the speed is irrelevant\n"); - return false; - } - -#ifndef _DEBUG // it's only faster in release - IrrlichtDevice* device = createDevice(video::EDT_NULL); - if (!device) - return false; - ITimer* timer = device->getTimer(); - - const int ITERATIONS = 100000; - int i; - - f32 value; - u32 then = timer->getRealTime(); - for(i = 0; i < ITERATIONS; ++i) - value = (f32)atof("-340282346638528859811704183484516925440.000000"); - - const u32 atofTime = timer->getRealTime() - then; - - then += atofTime; - for(i = 0; i < ITERATIONS; ++i) - value = fast_atof("-340282346638528859811704183484516925440.000000"); - const u32 fastAtofTime = timer->getRealTime() - then; - - then += fastAtofTime; - for(i = 0; i < ITERATIONS; ++i) - value = old_fast_atof("-340282346638528859811704183484516925440.000000"); - const u32 oldFastAtofTime = timer->getRealTime() - then; - - logTestString("Speed test\n atof time = %d\n fast_atof Time = %d\nold fast_atof time = %d\n", - atofTime, fastAtofTime, oldFastAtofTime); - - device->closeDevice(); - device->run(); - device->drop(); - - if(fastAtofTime > (1.2f*atofTime)) - { - logTestString("The fast method is slower than atof()\n"); - return false; - } -#endif // #ifndef _DEBUG - - return true; -} - -//! Test both the accuracy and speed of Irrlicht's strtol10() implementation. -bool test_strtol(void) -{ - bool accurate = true; - - accurate &= testCalculation_strtol("340282346638528859811704183484516925440"); - accurate &= testCalculation_strtol("3402823466"); - accurate &= testCalculation_strtol("3402823466e+29F"); - accurate &= testCalculation_strtol("-340282346638528859811704183484516925440"); - accurate &= testCalculation_strtol("-3402823466"); - accurate &= testCalculation_strtol("-3402823466e+29F"); - accurate &= testCalculation_strtol("402823466385288598117"); - accurate &= testCalculation_strtol("402823466"); - accurate &= testCalculation_strtol("402823466e+28F"); - accurate &= testCalculation_strtol("402823466385288598117"); - accurate &= testCalculation_strtol("-402823466"); - accurate &= testCalculation_strtol("-402823466e+28F"); - accurate &= testCalculation_strtol(".00234567"); - accurate &= testCalculation_strtol("-234567"); - accurate &= testCalculation_strtol("234567"); - accurate &= testCalculation_strtol("-234567"); - accurate &= testCalculation_strtol("1175494351"); - accurate &= testCalculation_strtol("11754943512"); - accurate &= testCalculation_strtol("11754943513"); - accurate &= testCalculation_strtol("11754943514"); - accurate &= testCalculation_strtol("-1175494351"); - accurate &= testCalculation_strtol("123456789"); - accurate &= testCalculation_strtol("-123456789"); - accurate &= testCalculation_strtol("123456.789"); - accurate &= testCalculation_strtol("-123456.789"); - accurate &= testCalculation_strtol("-109446526"); - - if(!accurate) - { - logTestString("Calculation is not accurate, so the speed is irrelevant\n"); - return false; - } - -#ifndef _DEBUG // it's only faster in release - IrrlichtDevice* device = createDevice(video::EDT_NULL); - if (!device) - return false; - ITimer* timer = device->getTimer(); - - const int ITERATIONS = 1000000; - int i; - - s32 value; - u32 then = timer->getRealTime(); - for(i = 0; i < ITERATIONS; ++i) - value = strtol("-3402823466", 0, 10); - - const u32 strtolTime = timer->getRealTime() - then; - - then += strtolTime; - for(i = 0; i < ITERATIONS; ++i) - value = strtol10("-3402823466"); - const u32 strtol10Time = timer->getRealTime() - then; - - then += strtol10Time; - for(i = 0; i < ITERATIONS; ++i) - value = old_strtol10("-3402823466"); - const u32 oldstrtol10Time = timer->getRealTime() - then; - - logTestString("Speed test\n strtol time = %d\n strtol10 time = %d\nold strtol10 time = %d\n", - strtolTime, strtol10Time, oldstrtol10Time); - - device->closeDevice(); - device->run(); - device->drop(); - - if (strtol10Time > (1.2f*strtolTime)) - { - logTestString("The fast method is slower than strtol()\n"); - return false; - } -#endif // #ifndef _DEBUG - - return true; -} - -bool fast_atof(void) -{ - bool ok = true; - ok &= test_fast_atof() ; - ok &= test_strtol(); - return ok; -} diff --git a/tests/filesystem.cpp b/tests/filesystem.cpp deleted file mode 100644 index fed70d1c..00000000 --- a/tests/filesystem.cpp +++ /dev/null @@ -1,183 +0,0 @@ -#include "testUtils.h" - -using namespace irr; -using namespace core; -using namespace io; - -static bool testgetAbsoluteFilename(io::IFileSystem* fs) -{ - bool result=true; - io::path apath = fs->getAbsolutePath("media"); - io::path cwd = fs->getWorkingDirectory(); - if (apath!=(cwd+"/media")) - { - logTestString("getAbsolutePath failed on existing dir %s\n", apath.c_str()); - result = false; - } - - apath = fs->getAbsolutePath("../media/"); - core::deletePathFromPath(cwd, 1); - if (apath!=(cwd+"media/")) - { - logTestString("getAbsolutePath failed on dir with postfix / %s\n", apath.c_str()); - result = false; - } - - apath = fs->getAbsolutePath ("../nothere.txt"); // file does not exist - if (apath!=(cwd+"nothere.txt")) - { - logTestString("getAbsolutePath failed on non-existing file %s\n", apath.c_str()); - result = false; - } - - return result; -} - -static bool testFlattenFilename(io::IFileSystem* fs) -{ - bool result=true; - io::path tmpString="../tmp"; - io::path refString="../tmp/"; - fs->flattenFilename(tmpString); - if (tmpString != refString) - { - logTestString("flattening destroys path.\n%s!=%s\n", tmpString.c_str(),refString.c_str()); - result = false; - } - - tmpString="tmp/tmp/../"; - refString="tmp/"; - fs->flattenFilename(tmpString); - if (tmpString != refString) - { - logTestString("flattening destroys path.\n%s!=%s\n", tmpString.c_str(),refString.c_str()); - result = false; - } - - tmpString="tmp/tmp/.."; - fs->flattenFilename(tmpString); - if (tmpString != refString) - { - logTestString("flattening destroys path.\n%s!=%s\n", tmpString.c_str(),refString.c_str()); - result = false; - } - - tmpString="tmp/next/../third"; - refString="tmp/third/"; - fs->flattenFilename(tmpString); - if (tmpString != refString) - { - logTestString("flattening destroys path.\n%s!=%s\n", tmpString.c_str(),refString.c_str()); - result = false; - } - - tmpString="this/tmp/next/../../my/fourth"; - refString="this/my/fourth/"; - fs->flattenFilename(tmpString); - if (tmpString != refString) - { - logTestString("flattening destroys path.\n%s!=%s\n", tmpString.c_str(),refString.c_str()); - result = false; - } - - tmpString="this/is/../../../a/fifth/test/"; - refString="../a/fifth/test/"; - fs->flattenFilename(tmpString); - if (tmpString != refString) - { - logTestString("flattening destroys path.\n%s!=%s\n", tmpString.c_str(),refString.c_str()); - result = false; - } - - tmpString="this/../is/../../a/sixth/test/"; - refString="../a/sixth/test/"; - fs->flattenFilename(tmpString); - if (tmpString != refString) - { - logTestString("flattening destroys path.\n%s!=%s\n", tmpString.c_str(),refString.c_str()); - result = false; - } - - return result; -} - -static bool testgetRelativeFilename(io::IFileSystem* fs) -{ - bool result=true; - io::path apath = fs->getAbsolutePath("media"); - io::path cwd = fs->getWorkingDirectory(); - if (fs->getRelativeFilename(apath, cwd) != "media") - { - logTestString("getRelativePath failed on %s\n", apath.c_str()); - result = false; - } - - apath = fs->getAbsolutePath("../media/"); - if (fs->getRelativeFilename(apath, cwd) != "../media/") - { - logTestString("getRelativePath failed on %s\n", apath.c_str()); - result = false; - } - - return result; -} - -bool filesystem(void) -{ - IrrlichtDevice * device = irr::createDevice(video::EDT_NULL, dimension2d<u32>(1, 1)); - assert_log(device); - if(!device) - return false; - - io::IFileSystem * fs = device->getFileSystem (); - if ( !fs ) - return false; - - bool result = true; - - io::path workingDir = device->getFileSystem()->getWorkingDirectory(); - - io::path empty; - if ( fs->existFile(empty) ) - { - logTestString("Empty filename should not exist.\n"); - result = false; - } - - io::path newWd = workingDir + "/media"; - bool changed = device->getFileSystem()->changeWorkingDirectoryTo(newWd); - assert_log(changed); - - if ( fs->existFile(empty) ) - { - logTestString("Empty filename should not exist even in another workingdirectory.\n"); - result = false; - } - - // The working directory must be restored for the other tests to work. - changed = device->getFileSystem()->changeWorkingDirectoryTo(workingDir.c_str()); - assert_log(changed); - - // adding a folder archive which just should not really change anything - device->getFileSystem()->addFileArchive( "./" ); - - if ( fs->existFile(empty) ) - { - logTestString("Empty filename should not exist in folder file archive.\n"); - result = false; - } - - // remove it again to not affect other tests - device->getFileSystem()->removeFileArchive( device->getFileSystem()->getFileArchiveCount() ); - - result &= testFlattenFilename(fs); - result &= testgetAbsoluteFilename(fs); - result &= testgetRelativeFilename(fs); - - device->closeDevice(); - device->run(); - device->drop(); - - return result; -} - diff --git a/tests/flyCircleAnimator.cpp b/tests/flyCircleAnimator.cpp deleted file mode 100644 index b976d313..00000000 --- a/tests/flyCircleAnimator.cpp +++ /dev/null @@ -1,60 +0,0 @@ -// Copyright (C) 2008-2012 Colin MacDonald -// No rights reserved: this software is in the public domain. - -#include "testUtils.h" - -using namespace irr; -using namespace core; -using namespace scene; -using namespace video; - -/** Tests the offset capability of the fly circle animator */ -bool flyCircleAnimator(void) -{ - IrrlichtDevice *device = createDevice(video::EDT_BURNINGSVIDEO, - core::dimension2du(160,120), 32); - if (!device) - return false; - - IVideoDriver* driver = device->getVideoDriver(); - ISceneManager* smgr = device->getSceneManager(); - - const f32 offsetDegrees[] = { 0.f, 45.f, 135.f, 270.f }; - - for(u32 i = 0; i < sizeof(offsetDegrees) / sizeof(offsetDegrees[0]); ++i) - { - IBillboardSceneNode * node = smgr->addBillboardSceneNode(); - // Have the animator rotate around the Z axis plane, rather than the default Y axis - ISceneNodeAnimator * animator = smgr->createFlyCircleAnimator( - vector3df(0, 0, 0), 30.f, 0.001f, - vector3df(0, 0, 1), (offsetDegrees[i] / 360.f)); - if(!node || !animator) - return false; - - node->setMaterialType(video::EMT_TRANSPARENT_ADD_COLOR ); - node->setMaterialTexture(0, driver->getTexture("../media/particle.bmp")); - node->setMaterialFlag(video::EMF_LIGHTING, false); - - node->addAnimator(animator); - animator->drop(); - } - - (void)smgr->addCameraSceneNode(0, vector3df(0, 0, -50), vector3df(0, 0, 0)); - - bool result = false; - - // Don't do device->run() since I need the time to remain at 0. - if (driver->beginScene(video::ECBF_COLOR | video::ECBF_DEPTH, video::SColor(0, 80, 80, 80))) - { - smgr->drawAll(); - driver->endScene(); - result = takeScreenshotAndCompareAgainstReference(driver, "-flyCircleAnimator.png"); - } - - device->closeDevice(); - device->run(); - device->drop(); - - return result; -} - diff --git a/tests/guiDisabledMenu.cpp b/tests/guiDisabledMenu.cpp deleted file mode 100644 index 9ca2466f..00000000 --- a/tests/guiDisabledMenu.cpp +++ /dev/null @@ -1,58 +0,0 @@ -// Copyright (C) 2008-2012 Colin MacDonald -// No rights reserved: this software is in the public domain. - -#include "testUtils.h" - -using namespace irr; -using namespace core; -using namespace gui; - -// Tests that disabled GUI menu items don't cause their submenu to appear when hovered over. -/** - http://irrlicht.sourceforge.net/phpBB2/viewtopic.php?p=178436#178436 - */ - -bool guiDisabledMenu(void) -{ - IrrlichtDevice *device = createDevice( video::EDT_BURNINGSVIDEO, - dimension2d<u32>(160, 40), 32); - assert_log(device); - if (!device) - return false; - - video::IVideoDriver* driver = device->getVideoDriver(); - gui::IGUIEnvironment* env = device->getGUIEnvironment(); - - gui::IGUIContextMenu* menu = env->addMenu(); - menu->addItem(L"Menu", -1, true, true); - gui::IGUIContextMenu* subMenu = menu->getSubMenu(0); - subMenu->addItem(L"Submenu 1", -1, false, true); - gui::IGUIContextMenu* subSubMenu = subMenu->getSubMenu(0); - subSubMenu->addItem(L"Final item"); - - SEvent event; - event.EventType = EET_MOUSE_INPUT_EVENT; - event.MouseInput.Event = EMIE_LMOUSE_PRESSED_DOWN; - event.MouseInput.X = menu->getAbsolutePosition().UpperLeftCorner.X + 1; - event.MouseInput.Y = menu->getAbsolutePosition().UpperLeftCorner.Y + 1; - (void)menu->OnEvent(event); - - // Hovering over the disabled submenu shouldn't cause the "Final item" to appear. - event.MouseInput.Event = EMIE_MOUSE_MOVED; - event.MouseInput.X = subMenu->getAbsolutePosition().UpperLeftCorner.X + 40; - event.MouseInput.Y = subMenu->getAbsolutePosition().UpperLeftCorner.Y + 10; - (void)menu->OnEvent(event); - - device->run(); - driver->beginScene(video::ECBF_COLOR | video::ECBF_DEPTH, video::SColor(150,50,50,50)); - env->drawAll(); - driver->endScene(); - - bool result = takeScreenshotAndCompareAgainstReference(driver, "-guiDisabledMenu.png", 98.77f); - device->closeDevice(); - device->run(); - device->drop(); - - return result; -} - diff --git a/tests/ioScene.cpp b/tests/ioScene.cpp deleted file mode 100644 index f36f33b1..00000000 --- a/tests/ioScene.cpp +++ /dev/null @@ -1,132 +0,0 @@ -// Copyright (C) 2008-2012 Colin MacDonald -// No rights reserved: this software is in the public domain. - -#include "testUtils.h" - -using namespace irr; -using namespace core; -using namespace scene; -using namespace video; -using namespace io; -using namespace gui; - -// Tests save scene. -static bool saveScene(void) -{ - IrrlichtDevice *device = createDevice( EDT_NULL, dimension2d<u32>(160, 120), 32); - assert_log(device); - if (!device) - return false; - - ISceneManager * smgr = device->getSceneManager(); - - ISkinnedMesh* mesh = (ISkinnedMesh*)smgr->getMesh("../media/ninja.b3d"); - if (!mesh) - return false; - - IAnimatedMeshSceneNode* node1 = smgr->addAnimatedMeshSceneNode(mesh); - if (node1) - { - node1->setPosition(vector3df(-3, -3, 10)); - node1->setMaterialFlag(EMF_LIGHTING, false); - node1->setAnimationSpeed(0.f); - node1->setCurrentFrame(10.f); - node1->setDebugDataVisible(irr::scene::EDS_BBOX_BUFFERS); - } - - ISkinnedMesh* mesh2 = (ISkinnedMesh*)smgr->getMesh(device->getFileSystem()->getAbsolutePath("../media/dwarf.x")); - if (!mesh2) - return false; - - IAnimatedMeshSceneNode* node2 = smgr->addAnimatedMeshSceneNode(mesh2); - if (node2) - { - node2->setPosition(vector3df(33, -93, 120)); - node2->setMaterialFlag(EMF_LIGHTING, false); - node2->setAnimationSpeed(10.f); - node2->setCurrentFrame(2.f); - } - - IAnimatedMeshSceneNode* node3 = smgr->addAnimatedMeshSceneNode(mesh2, node2); - if (node3) - { - node3->setPosition(vector3df(-88, -300, 150)); - node3->setMaterialFlag(EMF_LIGHTING, false); - node3->setAnimationSpeed(0.f); - node3->setCurrentFrame(12.f); - } - - smgr->addCameraSceneNode(); - - logTestString("Test scene.irr"); - smgr->saveScene("results/scene.irr"); - bool result = xmlCompareFiles(device->getFileSystem(), "results/scene.irr", "media/scene.irr"); - - logTestString("Test scene2.irr"); - smgr->saveScene("results/scene2.irr", 0, node3); - result &= xmlCompareFiles(device->getFileSystem(), "results/scene2.irr", "media/scene2.irr"); - - device->closeDevice(); - device->run(); - device->drop(); - - return result; -} - -static bool loadScene(void) -{ - IrrlichtDevice *device = createDevice(video::EDT_BURNINGSVIDEO, - core::dimension2du(160,120), 32); - if (!device) - return false; - - IVideoDriver* driver = device->getVideoDriver(); - ISceneManager* smgr = device->getSceneManager(); - // load scene from example, with correct relative path - device->getFileSystem()->changeWorkingDirectoryTo("results"); - smgr->loadScene("../../media/example.irr"); - smgr->addCameraSceneNode(0, core::vector3df(0,0,-50)); - device->getFileSystem()->changeWorkingDirectoryTo(".."); - - bool result = false; - device->run(); - device->getTimer()->setTime(666); // scene has animations and current scene seems to be saved at that time ... really - best result with just that number :-) - if (driver->beginScene(video::ECBF_COLOR | video::ECBF_DEPTH, video::SColor(0, 80, 80, 80))) - { - smgr->drawAll(); - driver->endScene(); - // we need to be very sloppy, because the animators will produce a different - // start depending on the actual loading time. 97% seems to be safe, as removing - // an object produces values around 95% - result = takeScreenshotAndCompareAgainstReference(driver, "-loadScene.png", 97.4f); - if (!result) - logTestString("Rendering the loaded scene failed.\n"); - } - - ISceneNode* node = smgr->getSceneNodeFromId(128); - if (!node) - result=false; - else if (result) // only check if scene was correctly loaded - { - result &= (node->getChildren().size()==0); - if (!result) - logTestString("Node has an illegal child node.\n"); - device->getSceneManager()->loadScene("results/scene2.irr", 0, node); - result &= (node->getChildren().size()!=0); - if (!result) - logTestString("Loading second scene as child failed.\n"); - } - - device->closeDevice(); - device->run(); - device->drop(); - - return result; -} - -bool ioScene(void) -{ - bool result = saveScene(); - result &= loadScene(); - return result; -} diff --git a/tests/irrArray.cpp b/tests/irrArray.cpp deleted file mode 100644 index 12d46b32..00000000 --- a/tests/irrArray.cpp +++ /dev/null @@ -1,184 +0,0 @@ -// Copyright (C) 2008-2012 Colin MacDonald -// No rights reserved: this software is in the public domain. - -#include "testUtils.h" -#include <irrlicht.h> - -using namespace irr; -using namespace core; - -core::map<int, int> countReferences; - -struct SDummy -{ - SDummy(int a) : x(a) - { - countReferences.insert(x,1); - } - - SDummy() : x(0) - { - countReferences.insert(x,1); - } - - SDummy(const SDummy& other) - { - x = other.x; - countReferences[x] = countReferences[x] + 1; - } - - ~SDummy() - { - countReferences[x] = countReferences[x] - 1; - } - - int x; -}; - -static bool testErase() -{ - { - core::array<SDummy> aaa; - aaa.push_back(SDummy(0)); - aaa.push_back(SDummy(1)); - aaa.push_back(SDummy(2)); - aaa.push_back(SDummy(3)); - aaa.push_back(SDummy(4)); - aaa.push_back(SDummy(5)); - - aaa.erase(0,2); - } - - for ( core::map<int,int>::Iterator it = countReferences.getIterator(); !it.atEnd(); it++ ) - { - if ( it->getValue() != 0 ) - { - logTestString("testErase: wrong count for %d, it's: %d\n", it->getKey(), it->getValue()); - return false; - } - } - return true; -} - - -struct VarArray -{ - core::array < int, core::irrAllocatorFast<int> > MyArray; -}; - -static bool testSelfAssignment() -{ - core::array<int> myArray; - myArray.push_back(1); - myArray = myArray; - return myArray.size() == 1; -} - -// this will (did once) crash when wrong due to deallocating memory twice, so no return value -static void crashTestFastAlloc() -{ - core::array < VarArray, core::irrAllocatorFast<VarArray> > ArrayArray; - ArrayArray.setAllocStrategy(core::ALLOC_STRATEGY_SAFE); // force more re-allocations - VarArray var; - var.MyArray.setAllocStrategy(core::ALLOC_STRATEGY_SAFE); // force more re-allocations - var.MyArray.push_back( 0 ); - - for ( int i=0; i< 100; ++i ) - { - ArrayArray.push_back(var); - ArrayArray.push_back(var); - } -} - -static bool testSwap() -{ - bool result = true; - - core::array<int> array1, array2, copy1, copy2; - for ( int i=0; i<99; ++i ) - { - array1.push_back(i); - if ( i < 10 ) // we want also different container sizes - array2.push_back(99-i); - } - copy1 = array1; - copy2 = array2; - array1.swap(array2); - - result &= (array1 == copy2); - result &= (array2 == copy1); - - assert_log( result ); - - return result; -} - -// add numbers to the array going down from size to 1 -static void addInvNumbers(irr::core::array<int>& arr, irr::u32 size) -{ - for ( irr::u32 i=0; i<size; ++i ) - { - arr.push_back(size-i); - } -} - -// Ensure numbers are sorted in ascending order -static bool validateSortedAscending(const irr::core::array<int>& arr) -{ - for ( irr::u32 i=1; i< arr.size(); ++ i) - { - if ( arr[i-1] > arr[i] ) - return false; - } - - return true; -} - -static bool testSort() -{ - irr::core::array<int> arr; - for ( irr::u32 i=0; i<1000; ++i ) - { - arr.clear(); - addInvNumbers(arr, i); - arr.sort(); - if ( !validateSortedAscending(arr) ) - { - return false; - } - } - - for ( irr::u32 i=0; i<1000; ++i ) - { - arr.clear(); - addInvNumbers(arr, i); - addInvNumbers(arr, i); - arr.sort(); - if ( !validateSortedAscending(arr) ) - { - return false; - } - } - - return true; -} - -// Test the functionality of core::array -bool testIrrArray(void) -{ - bool allExpected = true; - - logTestString("crashTestFastAlloc\n"); - crashTestFastAlloc(); - allExpected &= testSelfAssignment(); - allExpected &= testSwap(); - allExpected &= testErase(); - allExpected &= testSort(); - - if(allExpected) - logTestString("\nAll tests passed\n"); - else - logTestString("\nFAIL!\n"); - - return allExpected; -} diff --git a/tests/irrCoreEquals.cpp b/tests/irrCoreEquals.cpp deleted file mode 100644 index 45c176ac..00000000 --- a/tests/irrCoreEquals.cpp +++ /dev/null @@ -1,132 +0,0 @@ -// Copyright (C) 2008-2012 Colin MacDonald and Christian Stehno -// No rights reserved: this software is in the public domain. - -#include "testUtils.h" - -bool irrCoreEquals(void) -{ - // float tests - if(!irr::core::equals(99.f, 99.f)) - { - logTestString("irr::core::equals(f32, f32 (, default)) failed.\n"); - return false; - } - - if(!irr::core::equals(99.f, 98.f, 1.f)) - { - logTestString("irr::core::equals(f32, f32, f32) failed.\n"); - return false; - } - - // double tests - if(!irr::core::equals(99.0, 99.0)) - { - logTestString("irr::core::equals(f64, f64 (,default)) failed.\n"); - return false; - } - - if(!irr::core::equals(99.0, 98.0, 1.0)) - { - logTestString("irr::core::equals(f64, f64, f64) failed.\n"); - return false; - } - - // int tests - if(!irr::core::equals(99, 99)) - { - logTestString("irr::core::equals(s32, s32 (,default)) failed.\n"); - return false; - } - - if(!irr::core::equals(99, 98, 1)) - { - logTestString("irr::core::equals(s32, s32, s32) failed.\n"); - return false; - } - - if(irr::core::equals(99, 98, 0)) - { - logTestString("irr::core::equals(s32, s32, 0) failed.\n"); - return false; - } - - if(!irr::core::equals(-99, -99)) - { - logTestString("irr::core::equals(s32, s32 (,default)) failed.\n"); - return false; - } - - if(!irr::core::equals(-99, -98, 1)) - { - logTestString("irr::core::equals(s32, s32, s32) failed.\n"); - return false; - } - - if(irr::core::equals(-99, -98, 0)) - { - logTestString("irr::core::equals(s32, s32, 0) failed.\n"); - return false; - } - - // iszero is a specialized equals method - // float tests - if(!irr::core::iszero(.0f)) - { - logTestString("irr::core::iszero(f32 (,default)) failed.\n"); - return false; - } - - if(irr::core::iszero(-1.0f)) - { - logTestString("irr::core::iszero(f32 (,default)) failed.\n"); - return false; - } - - if(!irr::core::iszero(1.0f, 1.0f)) - { - logTestString("irr::core::iszero(f32, f32) failed.\n"); - return false; - } - - // double tests - if(!irr::core::iszero(0.0)) - { - logTestString("irr::core::iszero(f64 (,default)) failed.\n"); - return false; - } - - if(irr::core::iszero(-1.0)) - { - logTestString("irr::core::iszero(f64 (,default)) failed.\n"); - return false; - } - - if(!irr::core::iszero(-2.0, 2.0)) - { - logTestString("irr::core::iszero(f64, f64) failed.\n"); - return false; - } - - // int tests - if(!irr::core::iszero(0)) - { - logTestString("irr::core::iszero(s32 (,default)) failed.\n"); - return false; - } - - if(irr::core::iszero(-1)) - { - logTestString("irr::core::iszero(s32 (,default)) failed.\n"); - return false; - } - - if(!irr::core::iszero(1, 1)) - { - logTestString("irr::core::iszero(s32, s32) failed.\n"); - return false; - } - - - return true; -} - diff --git a/tests/irrList.cpp b/tests/irrList.cpp deleted file mode 100644 index de1ec913..00000000 --- a/tests/irrList.cpp +++ /dev/null @@ -1,76 +0,0 @@ -#include "testUtils.h" -#include <irrlicht.h> - -using namespace irr; -using namespace core; - -// list has no operator== currently so we have to check manually -// TODO: Add an operator== to core::list and the kick this function out -template <typename T> -static bool compareLists(const core::list<T> & a, const core::list<T> & b) -{ - if ( a.size() != b.size() ) - return false; - // can't test allocator because we have no access to it here - typename core::list<T>::ConstIterator iterA = a.begin(); - typename core::list<T>::ConstIterator iterB = b.begin(); - for ( ; iterA != a.end(); ++iterA, ++iterB ) - { - if ( (*iterA) != (*iterB) ) - return false; - } - return true; -} - -// Make sure that we can get a const iterator from a non-const list -template <typename T> -static void constIteratorCompileTest(core::list<T> & a) -{ - typename core::list<T>::ConstIterator iterA = a.begin(); - while (iterA != a.end() ) - { - ++iterA; - } -} - -static bool testSwap() -{ - bool result = true; - - core::list<int> list1, list2, copy1, copy2; - for ( int i=0; i<99; ++i ) - { - list1.push_back(i); - if ( i < 10 ) // we want also different container sizes i < 50 ) - list2.push_back(99-i); - } - copy1 = list1; - copy2 = list2; - list1.swap(list2); - - - result &= compareLists<int>(list1, copy2); - result &= compareLists<int>(list2, copy1); - - assert_log( result ); - - return result; -} - -// Test the functionality of core::list -bool testIrrList(void) -{ - bool success = true; - - core::list<int> compileThisList; - constIteratorCompileTest(compileThisList); - - success &= testSwap(); - - if(success) - logTestString("\nAll tests passed\n"); - else - logTestString("\nFAIL!\n"); - - return success; -} diff --git a/tests/irrMap.cpp b/tests/irrMap.cpp deleted file mode 100644 index 7ce85dfb..00000000 --- a/tests/irrMap.cpp +++ /dev/null @@ -1,64 +0,0 @@ -#include "testUtils.h" -#include <irrlicht.h> - -using namespace irr; -using namespace core; - -// map has no operator== currently so we have to check manually -// TODO: Add an operator== to core::map and the kick this function out -template <class KeyType, class ValueType> -static bool compareMaps(core::map<KeyType,ValueType> & a, core::map<KeyType,ValueType> & b) -{ - if ( a.size() != b.size() ) - return false; - // can't test allocator because we have no access to it here - typename core::map<KeyType, ValueType>::Iterator iterA = a.getIterator(); - typename core::map<KeyType, ValueType>::Iterator iterB = b.getIterator(); - for ( ; !iterA.atEnd(); iterA++, iterB++ ) // TODO: only iter++, no ++iter in irr::map - { - if ( iterA->getValue() != iterB->getValue() ) - return false; - } - return true; -} - - -static bool testSwap() -{ - bool result = true; - - core::map<int, int> map1, map2, copy1, copy2; - for ( int i=0; i<99; ++i ) - { - map1[i] = i; - copy1[i] = i; // TODO: whatever the reason - irr::map does not want operator= so we have to assign to identical values - if ( i < 10 ) // we want also different container sizes - { - map2[i] = 99-i; - copy2[i] = 99-i; // TODO: whatever the reason - irr::map does not want operator= so we have to assign to identical values - } - } - map1.swap(map2); - - result &= compareMaps(map1, copy2); - result &= compareMaps(map2, copy1); - - assert_log( result ); - - return result; -} - -// Test the functionality of core::list -bool testIrrMap(void) -{ - bool success = true; - - success &= testSwap(); - - if(success) - logTestString("\nAll tests passed\n"); - else - logTestString("\nFAIL!\n"); - - return success; -} diff --git a/tests/irrString.cpp b/tests/irrString.cpp deleted file mode 100644 index a5298ff6..00000000 --- a/tests/irrString.cpp +++ /dev/null @@ -1,415 +0,0 @@ -// Copyright (C) 2008-2012 Colin MacDonald -// No rights reserved: this software is in the public domain. - -#include "testUtils.h" -#include <irrlicht.h> - -using namespace irr; -using namespace core; - -static bool testSelfAssignment() -{ - core::stringw myString(L"foo"); - myString = myString; - return myString == core::stringw(L"foo"); -} - -static bool testSplit() -{ - logTestString("Test stringw::split()\n"); - core::stringw teststring(L"[b]this [/b] is a [color=0xff000000]test[/color]."); - core::list<core::stringw> parts1; - teststring.split<core::list<core::stringw> >(parts1, L"["); - core::array<core::stringw> parts2; - teststring.split<core::array<core::stringw> >(parts2, L"[", 1, false, true); - return (parts1.size()==4) && (parts2.size()==9); -} - -static bool testFastAlloc() -{ - core::string<wchar_t, core::irrAllocatorFast<wchar_t> > FastString(L"abc"); - core::string<wchar_t, core::irrAllocatorFast<wchar_t> > FastStringLong(L"longer"); - - FastString = L"test"; - - // cause a reallocation - FastString = FastStringLong; - - // this test should either not compile or crash when the allocaters are messed up - return true; -} - -static bool testReplace() -{ - // test string getting longer - core::stringw str = L"no"; - str.replace(L"no", L"yes"); - if ( str != L"yes" ) - return false; - str = L"nonono"; - str.replace(L"no", L"yes"); - if ( str != L"yesyesyes" ) - return false; - str = L"nomaybenomaybeno"; - str.replace(L"no", L"yes"); - if ( str != L"yesmaybeyesmaybeyes" ) - return false; - - // test string staying same length - str = L"one"; - str.replace(L"one", L"two"); - if ( str != L"two" ) - return false; - str = L"oneone"; - str.replace(L"one", L"two"); - if ( str != L"twotwo" ) - return false; - - // test string getting shorter - str = L"yes"; - str.replace(L"yes", L"no"); - if ( str != L"no" ) - return false; - - str = L"yesyes"; - str.replace(L"yes", L"no"); - if ( str != L"nono" ) - return false; - - // remove string-parts completely - str = L"killme"; - str.replace(L"killme", L""); - if ( str != L"" ) - return false; - - str = L"killmenow"; - str.replace(L"killme", L""); - if ( str != L"now" ) - return false; - - str = L"nowkillme"; - str.replace(L"killme", L""); - if ( str != L"now" ) - return false; - - // remove nothing - str = L"keepme"; - str.replace(L"", L"whatever"); - if ( str != L"keepme" ) - return false; - - str = L"keepme"; - str.replace(L"", L""); - if ( str != L"keepme" ) - return false; - - return true; -} - - -bool testAppendStringc() -{ - core::stringc str; - // Test with character - if (str != "") - return false; - str += 'W'; - if (str != "W") - return false; - str += 'i'; - if (str != "Wi") - return false; - str=""; - if (str != "") - return false; - - // Test with C-style string - str += "Another Test"; - if (str != "Another Test") - return false; - str=""; - str += 'A'; - str += "nother Test"; - if (str != "Another Test") - return false; - str=""; - - // Test with int - str += 10; - if (str != "10") - return false; - str += 0; - if (str != "100") - return false; - str=""; - str += "-32"; - if (str != "-32") - return false; - str=""; - - // Test with unsigned int - str += 21u; - if (str != "21") - return false; - str += 0u; - if (str != "210") - return false; - str=""; - - // Test with long int - str += 456l; - if (str != "456") - return false; - str += 0l; - if (str != "4560") - return false; - str=""; - str += -456l; - if (str != "-456") - return false; - str=""; - - // Test with unsigned long - str += 994ul; - if (str != "994") - return false; - str += 0ul; - if (str != "9940") - return false; - str=""; - return true; -} - -bool testInsert() -{ - core::stringc str; - - str.insert(0, "something", 4); - if (str != "some") - return false; - - str.insert(4, "thing", 5); - if (str != "something") - return false; - - str.insert(0, "is ", 3); - if (str != "is something") - return false; - - str.insert(3, "there ", 6); - if (str != "is there something") - return false; - - return true; -} - -bool testLowerUpper() -{ - irr::core::array <irr::core::stringc> stringsOrig, targetLower, targetUpper; - stringsOrig.push_back("abc"); - targetLower.push_back("abc"); - targetUpper.push_back("ABC"); - stringsOrig.push_back("ABC"); - targetLower.push_back("abc"); - targetUpper.push_back("ABC"); - stringsOrig.push_back("Abc"); - targetLower.push_back("abc"); - targetUpper.push_back("ABC"); - stringsOrig.push_back("aBBc"); - targetLower.push_back("abbc"); - targetUpper.push_back("ABBC"); - stringsOrig.push_back("abC"); - targetLower.push_back("abc"); - targetUpper.push_back("ABC"); - stringsOrig.push_back(""); - targetLower.push_back(""); - targetUpper.push_back(""); - /* TODO: those are not supported so far - stringsOrig.push_back("ßäöü"); - targetLower.push_back("ßäöü"); - targetUpper.push_back("ßÄÖÜ"); - stringsOrig.push_back("ßÄÖÜ"); - targetLower.push_back("ßäöü"); - targetUpper.push_back("ßÄÖÜ"); - */ - - for ( irr::u32 i=0; i<stringsOrig.size(); ++i ) - { - irr::core::stringc c = stringsOrig[i]; - c.make_lower(); - if ( c != targetLower[i] ) - { - logTestString("make_lower for stringc failed in test %d %s\n", i, stringsOrig[i].c_str()); - return false; - } - - c = stringsOrig[i]; - c.make_upper(); - if ( c != targetUpper[i] ) - { - logTestString("make_upper for stringc failed in test %d %s %s\n", i, stringsOrig[i].c_str(), c.c_str()); - return false; - } - - irr::core::stringw w = irr::core::stringw(stringsOrig[i]); - c.make_lower(); - if ( c != irr::core::stringw(targetLower[i]) ) - { - logTestString("make_lower for stringw failed in test %d %s\n", i, stringsOrig[i].c_str()); - return false; - } - - c = irr::core::stringw(stringsOrig[i]); - c.make_upper(); - if ( c != irr::core::stringw(targetUpper[i]) ) - { - logTestString("make_upper for stringw failed in test %d %s\n", i, stringsOrig[i].c_str()); - return false; - } - } - - return true; -} - -bool testFindFunctions() -{ - irr::core::stringc dot("."); - irr::s32 p = dot.findFirst(0); - if ( p >= 0 ) - return false; - - irr::core::stringc empty(""); - p = empty.findLastCharNotInList("x",1); - if ( p >= 0 ) - return false; - - irr::core::stringc lastX("max"); - p = lastX.findLastCharNotInList("x",1); - if ( p != 1 ) - return false; - p = lastX.findLastCharNotInList("y",1); - if ( p != 2 ) - return false; - - p = empty.findLast('x'); - if ( p >= 0 ) - return false; - - p = dot.findLast('.'); - if ( p != 0 ) - return false; - - p = empty.findLastChar("ab", 2); - if ( p >= 0 ) - return false; - - p = dot.findLastChar("-.", 2); - if ( p != 0 ) - return false; - - return true; -} - -bool testErase() -{ - if ( stringc(1.f).eraseTrailingFloatZeros() != stringc("1") ) - return false; - - if ( stringc("0.100000").eraseTrailingFloatZeros() != stringc("0.1") ) - return false; - - if ( stringc("10.000000").eraseTrailingFloatZeros() != stringc("10") ) - return false; - - if ( stringc("foo 3.140000").eraseTrailingFloatZeros() != stringc("foo 3.14") ) - return false; - - if ( stringc("no_num.000").eraseTrailingFloatZeros() != stringc("no_num.000") ) - return false; - - if ( stringc("1.").eraseTrailingFloatZeros() != stringc("1.") ) - return false; - - return true; -} - -// Test the functionality of irrString -/** Validation is done with assert_log() against expected results. */ -bool testIrrString(void) -{ - bool allExpected = true; - - logTestString("Test stringc\n"); - { - // Check empty string - core::stringc empty; - assert_log(empty.size()==0); - assert_log(empty[0]==0); - assert_log(empty.c_str()!=0); - assert_log(*(empty.c_str())==0); - // Assign content - empty = "Test"; - assert_log(empty.size()==4); - assert_log(empty[0]=='T'); - assert_log(empty[3]=='t'); - assert_log(*(empty.c_str())=='T'); - //Assign empty string, should be same as in the beginning - empty = ""; - assert_log(empty.size()==0); - assert_log(empty[0]==0); - assert_log(*(empty.c_str())==0); - } - logTestString("Test stringw\n"); - { - core::stringw empty; - assert_log(empty.size()==0); - assert_log(empty[0]==0); - assert_log(empty.c_str()!=0); - assert_log(*(empty.c_str())==0); - empty = L"Test"; - assert_log(empty.size()==4); - assert_log(empty[0]==L'T'); - assert_log(empty[3]=='t'); - assert_log(*(empty.c_str())==L'T'); - empty = L""; - assert_log(empty.size()==0); - assert_log(empty[0]==0); - assert_log(*(empty.c_str())==0); - assert_log(allExpected &= testSplit()); - } - allExpected &= testAppendStringc(); - - allExpected &= testInsert(); - - logTestString("Test io::path\n"); - { - // Only test that this type exists, it's one from above - io::path myPath; - myPath = "Some text"; // Only to avoid wrong optimizations - } - - logTestString("Test self assignment\n"); - allExpected &= testSelfAssignment(); - - logTestString("test fast alloc\n"); - allExpected &= testFastAlloc(); - - logTestString("test replace\n"); - allExpected &= testReplace(); - - logTestString("test make_lower and make_uppers\n"); - allExpected &= testLowerUpper(); - - logTestString("test find functions\n"); - allExpected &= testFindFunctions(); - - logTestString("test erase functions\n"); - allExpected &= testErase(); - - if(allExpected) - logTestString("\nAll tests passed\n"); - else - logTestString("\nFAIL!\n"); - - return allExpected; -} diff --git a/tests/lightMaps.cpp b/tests/lightMaps.cpp deleted file mode 100644 index 2e9273f2..00000000 --- a/tests/lightMaps.cpp +++ /dev/null @@ -1,73 +0,0 @@ -// Copyright (C) 2008-2012 Christian Stehno, Colin MacDonald -// No rights reserved: this software is in the public domain. - -#include "testUtils.h" - -using namespace irr; -using namespace core; -using namespace scene; -using namespace video; -using namespace io; -using namespace gui; - -//! Tests lightmaps under all drivers that support them -static bool runTestWithDriver(E_DRIVER_TYPE driverType) -{ - IrrlichtDevice *device = createDevice( driverType, dimension2d<u32>(160, 120), 32); - if (!device) - return true; // Treat a failure to create a driver as benign; this saves a lot of #ifdefs - - IVideoDriver* driver = device->getVideoDriver(); - ISceneManager * smgr = device->getSceneManager(); - - logTestString("Testing driver %ls\n", driver->getName()); - if (driver->getDriverAttributes().getAttributeAsInt("MaxTextures")<2) - { - device->closeDevice(); - device->run(); - device->drop(); - return true; - } - - stabilizeScreenBackground(driver); - - bool result = true; - bool added = device->getFileSystem()->addFileArchive("../media/map-20kdm2.pk3"); - assert_log(added); - - if(added) - { - ISceneNode * node = smgr->addOctreeSceneNode(smgr->getMesh("20kdm2.bsp")->getMesh(0), 0, -1, 1024); - assert_log(node); - - if (node) - { - node->setMaterialFlag(EMF_LIGHTING, false); - node->setPosition(core::vector3df(-1300,-820,-1249)); - node->setScale(core::vector3df(1, 5, 1)); - - (void)smgr->addCameraSceneNode(0, core::vector3df(0,0,0), core::vector3df(40,100,30)); - - driver->beginScene(video::ECBF_COLOR | video::ECBF_DEPTH, video::SColor(255,255,255,0)); - smgr->drawAll(); - driver->endScene(); - - result = takeScreenshotAndCompareAgainstReference(driver, "-lightmaps.png", 96); - } - } - - device->closeDevice(); - device->run(); - device->drop(); - - return result; -} - - -bool lightMaps(void) -{ - bool result = true; - TestWithAllDrivers(runTestWithDriver); - return result; -} - diff --git a/tests/lights.cpp b/tests/lights.cpp deleted file mode 100644 index cdc2af5a..00000000 --- a/tests/lights.cpp +++ /dev/null @@ -1,70 +0,0 @@ -// Copyright (C) 2008-2012 Christian Stehno, Colin MacDonald -// No rights reserved: this software is in the public domain. - -#include "testUtils.h" - -using namespace irr; - -static bool testLightTypes(video::E_DRIVER_TYPE driverType) -{ - IrrlichtDevice *device = createDevice (driverType, core::dimension2d<u32>(256,128)); - if (!device) - return true; // No error if device does not exist - - video::IVideoDriver* driver = device->getVideoDriver(); - scene::ISceneManager* smgr = device->getSceneManager(); - if (!driver->getDriverAttributes().getAttributeAsInt("MaxLights")) - { - device->closeDevice(); - device->run(); - device->drop(); - return true; - } - - stabilizeScreenBackground(driver); - - logTestString("Testing driver %ls\n", driver->getName()); - -// smgr->setAmbientLight(video::SColorf(0.3f,0.3f,0.3f)); - scene::ICameraSceneNode* cam = smgr->addCameraSceneNode(); - cam->setPosition(core::vector3df(0,200,0)); - cam->setTarget(core::vector3df()); - smgr->addAnimatedMeshSceneNode(device->getSceneManager()->addHillPlaneMesh("plane", core::dimension2df(4,4), core::dimension2du(128,128))); - scene::ILightSceneNode* light1 = smgr->addLightSceneNode(0, core::vector3df(-100,30,-100)); - light1->setLightType(video::ELT_POINT); - light1->setRadius(100.f); - light1->getLightData().DiffuseColor.set(0,1,1); -// smgr->addCubeSceneNode(10, light1)->setMaterialFlag(video::EMF_LIGHTING, false); - scene::ILightSceneNode* light2 = smgr->addLightSceneNode(0, core::vector3df(100,30,100)); - light2->setRotation(core::vector3df(90,0,0)); - light2->setLightType(video::ELT_SPOT); - light2->setRadius(100.f); - light2->getLightData().DiffuseColor.set(1,0,0); - light2->getLightData().InnerCone=10.f; - light2->getLightData().OuterCone=30.f; -// smgr->addCubeSceneNode(10, light2)->setMaterialFlag(video::EMF_LIGHTING, false); - scene::ILightSceneNode* light3 = smgr->addLightSceneNode(); - light3->setRotation(core::vector3df(15,0,0)); - light3->setLightType(video::ELT_DIRECTIONAL); - light1->getLightData().DiffuseColor.set(0,1,0); - - driver->beginScene(video::ECBF_COLOR | video::ECBF_DEPTH, video::SColor(0)); - smgr->drawAll(); - driver->endScene(); - - const bool result = takeScreenshotAndCompareAgainstReference(driver, "-lightType.png", 99.91f); - - device->closeDevice(); - device->run(); - device->drop(); - - return result; -} - -bool lights(void) -{ - bool result = true; - // no lights in sw renderer - TestWithAllDrivers(testLightTypes); - return result; -} diff --git a/tests/line2d.cpp b/tests/line2d.cpp deleted file mode 100644 index eda2d543..00000000 --- a/tests/line2d.cpp +++ /dev/null @@ -1,79 +0,0 @@ -// Copyright (C) 2017 Dario Oliveri -// No rights reserved: this software is in the public domain. - -#include "testUtils.h" - -#include <iostream> - -using namespace irr; -using namespace irr::core; - -#define EXPECT( condition, value, name) if( condition != value) \ - { std::cout<< name << ": test failed"<< std::endl; return false;} - -//! Tests the basic functionality of the software device. -bool line2DTest(void) -{ - { - line2d< f32> a(0, 0, 0, 1); - line2d< f32> b(2, 0, 2, 1); - line2d< f32> c(2, 0, 2, 1 + 0.00001f); - - EXPECT( a.nearlyParallel( b), true, "parallel Lines are parallel"); - EXPECT( a.nearlyParallel( c, (f32)32), true, "nearly parallel lines are parallel"); - } - - { - line2d< f32> a( 0, 0, 0, 1); - line2d< f32> b( 0, 2, 2, 1); - EXPECT( a.nearlyParallel( b, 1), false, "orthogonal lines are NOT parallel"); - } - - { - line2d< f32> a( 0, 0, 100, 100); - line2d< f32> b( 100, 0, 0, 100); - - EXPECT( a.nearlyParallel( b, 1), false, "orthogonal lines are NOT parallel 2"); - - vector2df t = a.fastLinesIntersection( b); - vector2df u = vector2df( 50.0f, 50.0f); - - EXPECT( t.equals( u, roundingError<f32>() ), true, "fast intersection in known point"); - - EXPECT( a .intersectAsSegments(b), true, "intersect as Segments"); - - EXPECT( a.incidentSegments(b), true, "incidentSegments"); - - vector2df out; - EXPECT( a.lineIntersectSegment( b, out), true, "lineIntersectSegment"); - EXPECT( t.equals( out), true, "line intersect segment in known point"); - - EXPECT( a.isPointBetweenStartAndEnd( out), true, "point isBetween StartEnd of first line"); - EXPECT( b.isPointBetweenStartAndEnd( out), true, "point isBetween StartEnd of second line"); - - EXPECT( a.isPointOnLine( out), true, "is point on first line"); - EXPECT( b.isPointOnLine( out), true, "is point on second line"); - - EXPECT( out.isBetweenPoints( a.start, a.end), true, "test point is on segment with first line"); - EXPECT( out.isBetweenPoints( b.start, b.end), true, "test point is on segment with first line"); - } - - { - vector2df a( 0, 0); - vector2df b( 10, 0); - vector2df c( 0, 10); - vector2df d( 0, 40); - - EXPECT( a.areClockwise( c, b), true, "test if points are clockwise"); - EXPECT( a.areClockwise( b, c), false, "test if points are NOT clockwise"); - EXPECT( a.areCounterClockwise( b, c), true, "test if points are counter clockwise"); - EXPECT( a.areCounterClockwise( c, b), false, "test if points are NOT counter clockwise"); - - EXPECT( a.checkOrientation( c, b), 1, "test if orientation is clockwise"); - EXPECT( a.checkOrientation( b, c), 2, "test if orientation is anticlockwise"); - EXPECT( a.checkOrientation( c, d), 0, "test if orientation is colinear"); - EXPECT( a.checkOrientation( d, c), 0, "test if orientation is colinear 2"); - } - - return true; -} diff --git a/tests/loadTextures.cpp b/tests/loadTextures.cpp deleted file mode 100644 index 4080607a..00000000 --- a/tests/loadTextures.cpp +++ /dev/null @@ -1,97 +0,0 @@ -// Copyright (C) 2008-2012 Colin MacDonald -// No rights reserved: this software is in the public domain. - -#include "testUtils.h" - -using namespace irr; -using namespace core; -using namespace scene; -using namespace video; -using namespace io; -using namespace gui; - -/** This tests verifies that textures opened from different places in the - filesystem don't create duplicated textures. */ -bool loadFromFileFolder(void) -{ - IrrlichtDevice *device = - createDevice( video::EDT_NULL, dimension2du(160, 120)); - - if (!device) - { - logTestString("Unable to create EDT_NULL device\n"); - return false; - } - - IVideoDriver * driver = device->getVideoDriver(); - - u32 numTexs = driver->getTextureCount(); - - ITexture * tex1 = driver->getTexture("../media/tools.png"); - assert_log(tex1); - if(!tex1) - logTestString("Unable to open ../media/tools.png\n"); - if (driver->getTextureCount()!=numTexs+1) - { - logTestString("No additional texture in the texture cache %s:%d\n", __FILE__, __LINE__); - return false; - } - - IReadFile * readFile = device->getFileSystem()->createAndOpenFile("../media/tools.png"); - assert_log(readFile); - if(!readFile) - logTestString("Unable to open ../media/tools.png\n"); - if (driver->getTextureCount()!=numTexs+1) - { - logTestString("Additional texture in the texture cache %s:%d\n", __FILE__, __LINE__); - return false; - } - - ITexture * tex2 = driver->getTexture(readFile); - assert_log(tex2); - if(!readFile) - logTestString("Unable to create texture from ../media/tools.png\n"); - if (driver->getTextureCount()!=numTexs+1) - { - logTestString("Additional texture in the texture cache %s:%d\n", __FILE__, __LINE__); - return false; - } - - readFile->drop(); - - // adding a folder archive - device->getFileSystem()->addFileArchive( "../media/" ); - - ITexture * tex3 = driver->getTexture("tools.png"); - assert_log(tex3); - if(!tex3) - logTestString("Unable to open tools.png\n"); - if (driver->getTextureCount()!=numTexs+1) - { - logTestString("Additional texture in the texture cache %s:%d\n", __FILE__, __LINE__); - return false; - } - - ITexture * tex4 = driver->getTexture("tools.png"); - assert_log(tex4); - if(!tex4) - logTestString("Unable to open tools.png\n"); - if (driver->getTextureCount()!=numTexs+1) - { - logTestString("Additional texture in the texture cache %s:%d\n", __FILE__, __LINE__); - return false; - } - - device->closeDevice(); - device->run(); - device->drop(); - return ((tex1 == tex2) && (tex1 == tex3) && (tex1 == tex4)); -} - -bool loadTextures() -{ - bool result = true; - result &= loadFromFileFolder(); - return result; -} - diff --git a/tests/main.cpp b/tests/main.cpp deleted file mode 100644 index 6becc7c3..00000000 --- a/tests/main.cpp +++ /dev/null @@ -1,260 +0,0 @@ -// Copyright (C) 2008-2012 Colin MacDonald and Christian Stehno -// No rights reserved: this software is in the public domain. - -// This is the entry point for the Irrlicht test suite. - -// This is an MSVC pragma to link against the Irrlicht library. -// Other builds must link against it in the project files. -#if defined(_MSC_VER) -#pragma comment(lib, "Irrlicht.lib") -#define _CRT_SECURE_NO_WARNINGS 1 -#endif // _MSC_VER - -#include "testUtils.h" -#include <stdio.h> -#include <time.h> -#include <vector> - -struct STestDefinition -{ - //! The test entry point function - bool(*testSignature)(void); - - //! A descriptive name for the test - const char * testName; -}; - -//! This is the main entry point for the Irrlicht test suite. -/** \return The number of test that failed, i.e. 0 is success. */ -int main(int argumentCount, char * arguments[]) -{ - if(argumentCount > 3) - { - logTestString("\nUsage: %s [testNumber] [testCount]\n"); - return 9999; - } - - #define TEST(x)\ - {\ - extern bool x(void);\ - STestDefinition newTest;\ - newTest.testSignature = x;\ - newTest.testName = #x;\ - tests.push_back(newTest);\ - } - - // Use an STL vector so that we don't rely on Irrlicht. - std::vector<STestDefinition> tests; - -#if 0 - // To interactively debug a test, move it (temporarily) in here and enable the define to only run this test - // Otherwise debugging is slightly tricky as each test runs in it's own process. - TEST(ioScene); -#else - - TEST(disambiguateTextures); // Normally you should run this first, since it validates the working directory. - // Now the simple tests without device - TEST(testIrrArray); - TEST(testIrrMap); - TEST(testIrrList); - TEST(exports); - TEST(irrCoreEquals); - TEST(testIrrString); - TEST(testLine2d); - TEST(matrixOps); - TEST(testDimension2d); - TEST(testVector2d); - TEST(testVector3d); - TEST(testQuaternion); - TEST(testS3DVertex); - TEST(testaabbox3d); - TEST(color); - TEST(testTriangle3d); - TEST(vectorPositionDimension2d); - // file system checks (with null driver) - TEST(filesystem); - TEST(archiveReader); - TEST(testXML); - TEST(serializeAttributes); - // null driver - TEST(fast_atof); - TEST(loadTextures); - TEST(collisionResponseAnimator); - TEST(enumerateImageManipulators); - TEST(removeCustomAnimator); - TEST(sceneCollisionManager); - TEST(sceneNodeAnimator); - TEST(meshLoaders); - TEST(testTimer); - TEST(testCoreutil); - // software drivers only - TEST(softwareDevice); - TEST(b3dAnimation); - TEST(burningsVideo); - TEST(billboards); - TEST(createImage); - TEST(cursorSetVisible); - TEST(flyCircleAnimator); - TEST(guiDisabledMenu); - TEST(makeColorKeyTexture); - TEST(md2Animation); - TEST(meshTransform); - TEST(skinnedMesh); - TEST(testGeometryCreator); - TEST(writeImageToFile); - TEST(ioScene); - // all driver checks - TEST(videoDriver); - TEST(screenshot); - TEST(drawPixel); - TEST(drawRectOutline); - TEST(drawVertexPrimitive); - TEST(material); - TEST(renderTargetTexture); - TEST(textureFeatures); - TEST(textureRenderStates); - TEST(transparentMaterials); - TEST(userclipplane); - TEST(antiAliasing); - TEST(draw2DImage); - TEST(lights); - TEST(twodmaterial); - TEST(viewPort); - TEST(mrt); - TEST(projectionMatrix); - // large scenes/long rendering - TEST(orthoCam); - TEST(stencilShadow); - // q3 maps are slow - TEST(planeMatrix); - TEST(terrainSceneNode); - TEST(lightMaps); - TEST(triangleSelector); - TEST(line2DTest); -#endif - - unsigned int numberOfTests = tests.size(); - unsigned int testToRun = 0; - unsigned int fails = 0; - - bool firstRun=true; - const bool spawn=false; - // args: [testNumber] [testCount] - if(argumentCount > 1) - { - if (!strcmp(arguments[1],"--list")) - { - for (unsigned int i=0; i<tests.size(); ++i) - { - logTestString("%3d: %s\n", i, tests[i].testName); - } - logTestString("\n"); - return 0; - } - - int tmp = atoi(arguments[1]); - firstRun = (tmp>=0); - testToRun=abs(tmp); - if (!firstRun) - testToRun -= 1; - - if(argumentCount > 2) - { - numberOfTests = testToRun + abs(atoi(arguments[2])); - if (numberOfTests>=tests.size()) - numberOfTests=tests.size(); - } - } - - if(testToRun >= numberOfTests) - { - logTestString("\nError: invalid test %d (maximum %d)\n", - testToRun, numberOfTests-testToRun); - return 9999; - } - - const unsigned int testCount = numberOfTests-testToRun; - const bool logFileOpened = openTestLog(firstRun); - assert(logFileOpened); - - if (firstRun) - { - if (numberOfTests) - { - for (unsigned int i=testToRun; i<numberOfTests; ++i) - { - logTestString("\nStarting test %d, '%s'\n", - i, tests[i].testName); - if (spawn) - { - closeTestLog(); - char runNextTest[256]; - (void)sprintf(runNextTest, "\"%s\" -%d 1", arguments[0], i+1); - // Spawn the next test in a new process. - if (system(runNextTest)) - { - (void)openTestLog(false); - logTestString("\n******** Test failure ********\n"\ - "Test %d '%s' failed\n"\ - "******** Test failure ********\n", - i, tests[i].testName); - ++fails; - } - else - (void)openTestLog(false); - } - else - { - if (!tests[i].testSignature()) - { - logTestString("\n******** Test failure ********\n"\ - "Test %d '%s' failed\n"\ - "******** Test failure ********\n", - i, tests[i].testName); - ++fails; - } - } - } - } - const int passed = testCount - fails; - - logTestString("\nTests finished. %d test%s of %d passed.\n\n", - passed, 1 == passed ? "" : "s", testCount); - - if(0 == fails && testCount==tests.size()) - { - time_t rawtime; - struct tm * timeinfo; - (void)time(&rawtime); - timeinfo = gmtime(&rawtime); - (void)printf("\nTest suite pass at GMT %s\n", asctime(timeinfo)); - FILE * testsLastPassedAtFile = fopen("tests-last-passed-at.txt", "w"); - if(testsLastPassedAtFile) - { - (void)fprintf(testsLastPassedAtFile, "Tests finished. %d test%s of %d passed.\n", - passed, 1 == passed ? "" : "s", numberOfTests); -#ifdef _DEBUG - (void)fprintf(testsLastPassedAtFile, "Compiled as DEBUG\n"); -#else - (void)fprintf(testsLastPassedAtFile, "Compiled as RELEASE\n"); -#endif - (void)fprintf(testsLastPassedAtFile, "Test suite pass at GMT %s\n", asctime(timeinfo)); - (void)fclose(testsLastPassedAtFile); - } - } - closeTestLog(); -#ifdef _IRR_WINDOWS_ - (void)system("tests.log"); -#else - (void)system("$PAGER tests.log"); -#endif - return fails; - } - else - { - const bool res = tests[testToRun].testSignature(); - closeTestLog(); - return res?0:1; - } -} - diff --git a/tests/makeColorKeyTexture.cpp b/tests/makeColorKeyTexture.cpp deleted file mode 100644 index 288a4268..00000000 --- a/tests/makeColorKeyTexture.cpp +++ /dev/null @@ -1,74 +0,0 @@ -// Copyright (C) 2008-2012 Colin MacDonald -// No rights reserved: this software is in the public domain. - -#include "testUtils.h" - -using namespace irr; -using namespace core; -using namespace scene; -using namespace video; - -/** Test the behaviour of makeColorKeyTexture() using both 16 bit (software) - and 32 bit (Burning) textures, with the new behaviour and the legacy - behaviour. */ -static bool doTestWith(E_DRIVER_TYPE driverType, - bool zeroTexels) -{ - IrrlichtDevice *device = createDevice( driverType, - dimension2d<u32>(160, 120), 32); - if (!device) - return false; - - IVideoDriver* driver = device->getVideoDriver(); - ISceneManager * smgr = device->getSceneManager(); - - // Draw a cube background so that we can check that the keying is working. - ISceneNode * cube = smgr->addCubeSceneNode(50.f, 0, -1, vector3df(0, 0, 60)); - cube->setMaterialTexture(0, driver->getTexture("../media/wall.bmp")); - cube->setMaterialFlag(video::EMF_LIGHTING, false); - - ITexture * Texture = device->getVideoDriver()->getTexture("../media/portal2.bmp"); - - device->getVideoDriver()->makeColorKeyTexture(Texture, - position2d<s32>(64,64), - zeroTexels); - device->getVideoDriver()->makeColorKeyTexture(Texture, - position2d<s32>(64,64), - zeroTexels); - (void)smgr->addCameraSceneNode(); - - driver->beginScene(video::ECBF_COLOR | video::ECBF_DEPTH, SColor(255,100,101,140)); - smgr->drawAll(); - - driver->draw2DImage(Texture, - position2di(40, 40), - rect<s32>(0, 0, Texture->getSize().Width, Texture->getSize().Height), - 0, - SColor(255,255,255,255), - true); - driver->endScene(); - - char screenshotName[256]; - (void)snprintf_irr(screenshotName, 256, "-makeColorKeyTexture-%s.png", - zeroTexels? "old" : "new"); - - bool result = takeScreenshotAndCompareAgainstReference(driver, screenshotName); - - device->closeDevice(); - device->run(); - device->drop(); - - return result; -} - -bool makeColorKeyTexture(void) -{ - bool result = true; - - result &= doTestWith(EDT_BURNINGSVIDEO, false); - result &= doTestWith(EDT_SOFTWARE, false); - result &= doTestWith(EDT_BURNINGSVIDEO, true); - result &= doTestWith(EDT_SOFTWARE, true); - - return result; -} diff --git a/tests/material.cpp b/tests/material.cpp deleted file mode 100644 index 2a6dc1ae..00000000 --- a/tests/material.cpp +++ /dev/null @@ -1,79 +0,0 @@ -#include "testUtils.h" - -using namespace irr; - -static bool polygonOffset(video::E_DRIVER_TYPE type) -{ - IrrlichtDevice* device = createDevice(type, core::dimension2d<u32>(160, 120)); - - if (device == 0) - return true; - - video::IVideoDriver* driver = device->getVideoDriver(); - if (!driver->queryFeature(video::EVDF_POLYGON_OFFSET)) - { - device->closeDevice(); - device->run(); - device->drop(); - return true; - } - - stabilizeScreenBackground(driver); - - scene::ISceneManager* smgr = device->getSceneManager(); - - // create first plane - scene::ISceneNode* plane = smgr->addMeshSceneNode(smgr->addHillPlaneMesh( - "plane", core::dimension2df(10,10), core::dimension2du(2,2)), 0, -1, - core::vector3df(0,0,20), core::vector3df(270,0,0)); - - if (plane) - { - plane->setMaterialTexture(0, driver->getTexture("../media/t351sml.jpg")); - plane->setMaterialFlag(video::EMF_LIGHTING, false); - plane->setMaterialFlag(video::EMF_BACK_FACE_CULLING, true); - } - - // create second plane exactly on top of the first one - scene::ISceneNode* plane2 = smgr->addMeshSceneNode(smgr->addHillPlaneMesh( - "plane2", core::dimension2df(5,5), core::dimension2du(2,2)), 0, -1, - core::vector3df(0,0,20), core::vector3df(270,0,0)); - plane2->setMaterialFlag(video::EMF_BACK_FACE_CULLING, false); - - smgr->addCameraSceneNode(); - - // test back plane to back - plane->getMaterial(0).PolygonOffsetSlopeScale = 1.f; - plane->getMaterial(0).PolygonOffsetDepthBias = 1.f; - if ( type == video::EDT_DIRECT3D9 ) - plane->getMaterial(0).PolygonOffsetDepthBias *= 2.f*4.8e-7f; - - driver->beginScene(video::ECBF_COLOR | video::ECBF_DEPTH, video::SColor(255,113,113,133)); - smgr->drawAll(); - driver->endScene(); - bool result = takeScreenshotAndCompareAgainstReference(driver, "-polygonBack.png"); - - //reset back plane - plane->getMaterial(0).PolygonOffsetDepthBias=0; - // test front plane to front - plane2->getMaterial(0).PolygonOffsetSlopeScale=-1.f; - plane2->getMaterial(0).PolygonOffsetDepthBias=-1.f; - if ( type == video::EDT_DIRECT3D9 ) - plane2->getMaterial(0).PolygonOffsetDepthBias *= 2.f*4.8e-7f; - driver->beginScene(video::ECBF_COLOR | video::ECBF_DEPTH, video::SColor(255,113,113,133)); - smgr->drawAll(); - driver->endScene(); - result &= takeScreenshotAndCompareAgainstReference(driver, "-polygonFront.png"); - - device->closeDevice(); - device->run(); - device->drop(); - return result; -} - -bool material() -{ - bool result = true; - TestWithAllDrivers(polygonOffset); - return result; -} diff --git a/tests/matrixOps.cpp b/tests/matrixOps.cpp deleted file mode 100644 index 63a0877c..00000000 --- a/tests/matrixOps.cpp +++ /dev/null @@ -1,465 +0,0 @@ -// Copyright (C) 2008-2012 Colin MacDonald -// No rights reserved: this software is in the public domain. - -#include "testUtils.h" - -using namespace irr; -using namespace core; -using namespace scene; -using namespace video; -using namespace io; -using namespace gui; - -namespace -{ - -// Basic tests for identity matrix -bool identity(void) -{ - bool result = true; - matrix4 m; - // Check default init - result &= (m==core::IdentityMatrix); - result &= (core::IdentityMatrix==m); - assert_log(result); - // Since the last test can be made with isDefinitelyIdentityMatrix we set it to false here - m.setDefinitelyIdentityMatrix(false); - result &= (m==core::IdentityMatrix); - result &= (core::IdentityMatrix==m); - assert_log(result); - // also equals should see this - result &= m.equals(core::IdentityMatrix); - result &= core::IdentityMatrix.equals(m); - assert_log(result); - // Check inequality - m[12]=5.f; - result &= (m!=core::IdentityMatrix); - result &= (core::IdentityMatrix!=m); - result &= !m.equals(core::IdentityMatrix); - result &= !core::IdentityMatrix.equals(m); - assert_log(result); - - // Test multiplication - result &= (m==(core::IdentityMatrix*m)); - result &= m.equals(core::IdentityMatrix*m); - result &= (m==(m*core::IdentityMatrix)); - result &= m.equals(m*core::IdentityMatrix); - assert_log(result); - - return result; -} - -// Test rotations -bool transformations(void) -{ - bool result = true; - matrix4 m, s; - m.setRotationDegrees(core::vector3df(30,40,50)); - s.setScale(core::vector3df(2,3,4)); - m *= s; - m.setTranslation(core::vector3df(5,6,7)); - result &= (core::vector3df(5,6,7).equals(m.getTranslation())); - assert_log(result); - result &= (core::vector3df(2,3,4).equals(m.getScale())); - assert_log(result); - core::vector3df newRotation = m.getRotationDegrees(); - result &= (core::vector3df(30,40,50).equals(newRotation, 0.000004f)); - assert_log(result); - m.setRotationDegrees(vector3df(90.0001f, 270.85f, 180.0f)); - s.setRotationDegrees(vector3df(0,0, 0.860866f)); - m *= s; - newRotation = m.getRotationDegrees(); - result &= (core::vector3df(0,270,270).equals(newRotation, 0.0001f)); - assert_log(result); - m.setRotationDegrees(vector3df(270.0f, 89.8264f, 0.000100879f)); - s.setRotationDegrees(vector3df(0,0, 0.189398f)); - m *= s; - newRotation = m.getRotationDegrees(); - result &= (core::vector3df(0,90,90).equals(newRotation, 0.0001f)); - assert_log(result); - m.setRotationDegrees(vector3df(270.0f, 89.0602f, 359.999f)); - s.setRotationDegrees(vector3df(0,0, 0.949104f)); - m *= s; - newRotation = m.getRotationDegrees(); - result &= (core::vector3df(0,90,89.999f).equals(newRotation)); - assert_log(result); - - return result; -} - -// Test rotations -bool rotations(void) -{ - bool result = true; - matrix4 rot1,rot2,rot3,rot4,rot5; - core::vector3df vec1(1,2,3),vec12(1,2,3); - core::vector3df vec2(-5,0,0),vec22(-5,0,0); - core::vector3df vec3(20,0,-20), vec32(20,0,-20); - // Make sure the matrix multiplication and rotation application give same results - rot1.setRotationDegrees(core::vector3df(90,0,0)); - rot2.setRotationDegrees(core::vector3df(0,90,0)); - rot3.setRotationDegrees(core::vector3df(0,0,90)); - rot4.setRotationDegrees(core::vector3df(90,90,90)); - rot5 = rot3*rot2*rot1; - result &= (rot4.equals(rot5, ROUNDING_ERROR_f32)); - assert_log(result); - rot4.transformVect(vec1);rot5.transformVect(vec12); - rot4.transformVect(vec2);rot5.transformVect(vec22); - rot4.transformVect(vec3);rot5.transformVect(vec32); - result &= (vec1.equals(vec12)); - result &= (vec2.equals(vec22)); - result &= (vec3.equals(vec32)); - assert_log(result); - - vec1.set(1,2,3);vec12.set(1,2,3); - vec2.set(-5,0,0);vec22.set(-5,0,0); - vec3.set(20,0,-20);vec32.set(20,0,-20); - rot1.setRotationDegrees(core::vector3df(45,0,0)); - rot2.setRotationDegrees(core::vector3df(0,45,0)); - rot3.setRotationDegrees(core::vector3df(0,0,45)); - rot4.setRotationDegrees(core::vector3df(45,45,45)); - rot5 = rot3*rot2*rot1; - result &= (rot4.equals(rot5, ROUNDING_ERROR_f32)); - assert_log(result); - rot4.transformVect(vec1);rot5.transformVect(vec12); - rot4.transformVect(vec2);rot5.transformVect(vec22); - rot4.transformVect(vec3);rot5.transformVect(vec32); - result &= (vec1.equals(vec12)); - result &= (vec2.equals(vec22)); - result &= (vec3.equals(vec32, 2*ROUNDING_ERROR_f32)); - assert_log(result); - - vec1.set(1,2,3);vec12.set(1,2,3); - vec2.set(-5,0,0);vec22.set(-5,0,0); - vec3.set(20,0,-20);vec32.set(20,0,-20); - rot1.setRotationDegrees(core::vector3df(-60,0,0)); - rot2.setRotationDegrees(core::vector3df(0,-60,0)); - rot3.setRotationDegrees(core::vector3df(0,0,-60)); - rot4.setRotationDegrees(core::vector3df(-60,-60,-60)); - rot5 = rot3*rot2*rot1; - result &= (rot4.equals(rot5, ROUNDING_ERROR_f32)); - assert_log(result); - rot4.transformVect(vec1);rot5.transformVect(vec12); - rot4.transformVect(vec2);rot5.transformVect(vec22); - rot4.transformVect(vec3);rot5.transformVect(vec32); - result &= (vec1.equals(vec12)); - result &= (vec2.equals(vec22)); - // this one needs higher tolerance due to rounding issues - result &= (vec3.equals(vec32, 0.000002f)); - assert_log(result); - - vec1.set(1,2,3);vec12.set(1,2,3); - vec2.set(-5,0,0);vec22.set(-5,0,0); - vec3.set(20,0,-20);vec32.set(20,0,-20); - rot1.setRotationDegrees(core::vector3df(113,0,0)); - rot2.setRotationDegrees(core::vector3df(0,-27,0)); - rot3.setRotationDegrees(core::vector3df(0,0,193)); - rot4.setRotationDegrees(core::vector3df(113,-27,193)); - rot5 = rot3*rot2*rot1; - result &= (rot4.equals(rot5, ROUNDING_ERROR_f32)); - assert_log(result); - rot4.transformVect(vec1);rot5.transformVect(vec12); - rot4.transformVect(vec2);rot5.transformVect(vec22); - rot4.transformVect(vec3);rot5.transformVect(vec32); - // these ones need higher tolerance due to rounding issues - result &= (vec1.equals(vec12, 0.000002f)); - assert_log(result); - result &= (vec2.equals(vec22)); - assert_log(result); - result &= (vec3.equals(vec32, 0.000002f)); - assert_log(result); - - rot1.setRotationDegrees(core::vector3df(0,0,34)); - rot2.setRotationDegrees(core::vector3df(0,43,0)); - vec1=(rot2*rot1).getRotationDegrees(); - result &= (vec1.equals(core::vector3df(27.5400505f, 34.4302292f, 42.6845398f), 0.000002f)); - assert_log(result); - - // corner cases - rot1.setRotationDegrees(irr::core::vector3df(180.0f, 0.f, 0.f)); - vec1=rot1.getRotationDegrees(); - result &= (vec1.equals(core::vector3df(180.0f, 0.f, 0.f), 0.000002f)); - assert_log(result); - rot1.setRotationDegrees(irr::core::vector3df(0.f, 180.0f, 0.f)); - vec1=rot1.getRotationDegrees(); - result &= (vec1.equals(core::vector3df(180.0f, 360, 180.0f), 0.000002f)); - assert_log(result); - rot1.setRotationDegrees(irr::core::vector3df(0.f, 0.f, 180.0f)); - vec1=rot1.getRotationDegrees(); - result &= (vec1.equals(core::vector3df(0.f, 0.f, 180.0f), 0.000002f)); - assert_log(result); - - rot1.makeIdentity(); - rot1.setRotationDegrees(core::vector3df(270.f,0,0)); - rot2.makeIdentity(); - rot2.setRotationDegrees(core::vector3df(-90.f,0,0)); - vec1=(rot1*rot2).getRotationDegrees(); - result &= (vec1.equals(core::vector3df(180.f, 0.f, 0.0f))); - assert_log(result); - - return result; -} - -// Test isOrthogonal -bool isOrthogonal(void) -{ - matrix4 rotationMatrix; - if (!rotationMatrix.isOrthogonal()) - { - logTestString("irr::core::matrix4::isOrthogonal() failed with Identity.\n"); - return false; - } - - rotationMatrix.setRotationDegrees(vector3df(90, 0, 0)); - if (!rotationMatrix.isOrthogonal()) - { - logTestString("irr::core::matrix4::isOrthogonal() failed with rotation.\n"); - return false; - } - - matrix4 translationMatrix; - translationMatrix.setTranslation(vector3df(0, 3, 0)); - if (translationMatrix.isOrthogonal()) - { - logTestString("irr::core::matrix4::isOrthogonal() failed with translation.\n"); - return false; - } - - matrix4 scaleMatrix; - scaleMatrix.setScale(vector3df(1, 2, 3)); - if (!scaleMatrix.isOrthogonal()) - { - logTestString("irr::core::matrix4::isOrthogonal() failed with scale.\n"); - return false; - } - - return true; -} - -bool checkMatrixRotation(irr::core::matrix4& m, const vector3df& vector, const vector3df& expectedResult) -{ - vector3df v(vector); - m.rotateVect(v); - if ( expectedResult.equals(v) ) - return true; - logTestString("checkMatrixRotation failed for vector %f %f %f. Expected %f %f %f, got %f %f %f \n" - , vector.X, vector.Y, vector.Z, expectedResult.X, expectedResult.Y, expectedResult.Z, v.X, v.Y, v.Z); - logTestString("matrix: "); - for ( int i=0; i<16; ++i ) - logTestString("%.2f ", m[i]); - logTestString("\n"); - - return false; -} - -bool setRotationAxis() -{ - matrix4 m; - vector3df v; - - // y up, x right, z depth (as usual) - - // y rotated around x-axis - if ( !checkMatrixRotation( m.setRotationAxisRadians(90.f*DEGTORAD, vector3df(1,0,0)), vector3df(0,1,0), vector3df(0, 0, 1)) ) - { - logTestString("%s:%d", __FILE__, __LINE__); - return false; - } - if ( !checkMatrixRotation( m.setRotationAxisRadians(180.f*DEGTORAD, vector3df(1,0,0)), vector3df(0,1,0), vector3df(0, -1, 0)) ) - { - logTestString("%s:%d", __FILE__, __LINE__); - return false; - } - - // y rotated around negative x-axis - m.makeIdentity(); - if ( !checkMatrixRotation( m.setRotationAxisRadians(90.f*DEGTORAD, vector3df(-1,0,0)), vector3df(0,1,0), vector3df(0, 0, -1)) ) - { - logTestString("%s:%d", __FILE__, __LINE__); - return false; - } - - // x rotated around x-axis - if ( !checkMatrixRotation( m.setRotationAxisRadians(90.f*DEGTORAD, vector3df(1,0,0)), vector3df(1,0,0), vector3df(1, 0, 0)) ) - { - logTestString("%s:%d", __FILE__, __LINE__); - return false; - } - - // x rotated around y-axis - if ( !checkMatrixRotation( m.setRotationAxisRadians(90.f*DEGTORAD, vector3df(0,1,0)), vector3df(1,0,0), vector3df(0, 0, -1)) ) - { - logTestString("%s:%d", __FILE__, __LINE__); - return false; - } - if ( !checkMatrixRotation( m.setRotationAxisRadians(180.f*DEGTORAD, vector3df(0,1,0)), vector3df(1,0,0), vector3df(-1, 0, 0)) ) - { - logTestString("%s:%d", __FILE__, __LINE__); - return false; - } - - // x rotated around negative y-axis - if ( !checkMatrixRotation( m.setRotationAxisRadians(90.f*DEGTORAD, vector3df(0,-1,0)), vector3df(1,0,0), vector3df(0, 0, 1)) ) - { - logTestString("%s:%d", __FILE__, __LINE__); - return false; - } - - // y rotated around y-axis - if ( !checkMatrixRotation( m.setRotationAxisRadians(90.f*DEGTORAD, vector3df(0,1,0)), vector3df(0,1,0), vector3df(0, 1, 0)) ) - { - logTestString("%s:%d", __FILE__, __LINE__); - return false; - } - - // x rotated around z-axis - if ( !checkMatrixRotation( m.setRotationAxisRadians(90.f*DEGTORAD, vector3df(0,0,1)), vector3df(1,0,0), vector3df(0, 1, 0)) ) - { - logTestString("%s:%d", __FILE__, __LINE__); - return false; - } - if ( !checkMatrixRotation( m.setRotationAxisRadians(180.f*DEGTORAD, vector3df(0,0,1)), vector3df(1,0,0), vector3df(-1, 0, 0)) ) - { - logTestString("%s:%d", __FILE__, __LINE__); - return false; - } - - // x rotated around negative z-axis - if ( !checkMatrixRotation( m.setRotationAxisRadians(90.f*DEGTORAD, vector3df(0,0,-1)), vector3df(1,0,0), vector3df(0, -1, 0)) ) - { - logTestString("%s:%d", __FILE__, __LINE__); - return false; - } - - // y rotated around z-axis - if ( !checkMatrixRotation( m.setRotationAxisRadians(90.f*DEGTORAD, vector3df(0,0,1)), vector3df(0,1,0), vector3df(-1, 0, 0)) ) - { - logTestString("%s:%d", __FILE__, __LINE__); - return false; - } - if ( !checkMatrixRotation( m.setRotationAxisRadians(180.f*DEGTORAD, vector3df(0,0,1)), vector3df(0,1,0), vector3df(0, -1, 0)) ) - { - logTestString("%s:%d", __FILE__, __LINE__); - return false; - } - - // z rotated around z-axis - if ( !checkMatrixRotation( m.setRotationAxisRadians(90.f*DEGTORAD, vector3df(0,0,1)), vector3df(0,0,1), vector3df(0, 0, 1)) ) - { - logTestString("%s:%d", __FILE__, __LINE__); - return false; - } - - - return true; -} - -// just calling each function once to find compile problems -void calltest() -{ - matrix4 mat; - matrix4 mat2(mat); - f32& f1 = mat(0,0); - const f32& f2 = mat(0,0); - f32& f3 = mat[0]; - const f32& f4 = mat[0]; - mat = mat; - mat = 1.f; - const f32 * pf1 = mat.pointer(); - f32 * pf2 = mat.pointer(); - bool b = mat == mat2; - b = mat != mat2; - mat = mat + mat2; - mat += mat2; - mat = mat - mat2; - mat -= mat2; - mat.setbyproduct(mat, mat2); - mat.setbyproduct_nocheck(mat, mat2); - mat = mat * mat2; - mat *= mat2; - mat = mat * 10.f; - mat *= 10.f; - mat.makeIdentity(); - b = mat.isIdentity(); - b = mat.isOrthogonal(); - b = mat.isIdentity_integer_base (); - mat.setTranslation(vector3df(1.f, 1.f, 1.f) ); - vector3df v1 = mat.getTranslation(); - mat.setInverseTranslation(vector3df(1.f, 1.f, 1.f) ); - mat.setRotationRadians(vector3df(1.f, 1.f, 1.f) ); - mat.setRotationDegrees(vector3df(1.f, 1.f, 1.f) ); - vector3df v2 = mat.getRotationDegrees(); - mat.setInverseRotationRadians(vector3df(1.f, 1.f, 1.f) ); - mat.setInverseRotationDegrees(vector3df(1.f, 1.f, 1.f) ); - mat.setRotationAxisRadians(1.f, vector3df(1.f, 1.f, 1.f) ); - mat.setScale(vector3df(1.f, 1.f, 1.f) ); - mat.setScale(1.f); - vector3df v3 = mat.getScale(); - mat.inverseTranslateVect(v1); - mat.inverseRotateVect(v1); - mat.rotateVect(v1); - mat.rotateVect(v1, v2); - f32 fv3[3]; - mat.rotateVect(fv3, v1); - mat.transformVect(v1); - mat.transformVect(v1, v1); - f32 fv4[4]; - mat.transformVect(fv4, v1); - mat.transformVec3(fv3, fv3); - mat.translateVect(v1); - plane3df p1; - mat.transformPlane(p1); - mat.transformPlane(p1, p1); - aabbox3df bb1; - mat.transformBox(bb1); - mat.transformBoxEx(bb1); - mat.multiplyWith1x4Matrix(fv4); - mat.makeInverse(); - b = mat.getInversePrimitive(mat2); - b = mat.getInverse(mat2); - mat.buildProjectionMatrixPerspectiveFovRH(1.f, 1.f, 1.f, 1000.f); - mat.buildProjectionMatrixPerspectiveFovLH(1.f, 1.f, 1.f, 1000.f); - mat.buildProjectionMatrixPerspectiveFovInfinityLH(1.f, 1.f, 1.f); - mat.buildProjectionMatrixPerspectiveRH(100.f, 100.f, 1.f, 1000.f); - mat.buildProjectionMatrixPerspectiveLH(10000.f, 10000.f, 1.f, 1000.f); - mat.buildProjectionMatrixOrthoLH(10000.f, 10000.f, 1.f, 1000.f); - mat.buildProjectionMatrixOrthoRH(10000.f, 10000.f, 1.f, 1000.f); - mat.buildCameraLookAtMatrixLH(vector3df(1.f, 1.f, 1.f), vector3df(0.f, 0.f, 0.f), vector3df(0.f, 1.f, 0.f) ); - mat.buildCameraLookAtMatrixRH(vector3df(1.f, 1.f, 1.f), vector3df(0.f, 0.f, 0.f), vector3df(0.f, 1.f, 0.f) ); - mat.buildShadowMatrix(vector3df(1.f, 1.f, 1.f), p1); - core::rect<s32> a1(0,0,100,100); - mat.buildNDCToDCMatrix(a1, 1.f); - mat.interpolate(mat2, 1.f); - mat = mat.getTransposed(); - mat.getTransposed(mat2); - mat.buildRotateFromTo(vector3df(1.f, 1.f, 1.f), vector3df(1.f, 1.f, 1.f)); - mat.setRotationCenter(vector3df(1.f, 1.f, 1.f), vector3df(1.f, 1.f, 1.f)); - mat.buildAxisAlignedBillboard(vector3df(1.f, 1.f, 1.f), vector3df(1.f, 1.f, 1.f), vector3df(1.f, 1.f, 1.f), vector3df(1.f, 1.f, 1.f), vector3df(1.f, 1.f, 1.f)); - mat.buildTextureTransform( 1.f,vector2df(1.f, 1.f), vector2df(1.f, 1.f), vector2df(1.f, 1.f)); - mat.setTextureRotationCenter( 1.f ); - mat.setTextureTranslate( 1.f, 1.f ); - mat.setTextureTranslateTransposed(1.f, 1.f); - mat.setTextureScale( 1.f, 1.f ); - mat.setTextureScaleCenter( 1.f, 1.f ); - f32 fv16[16]; - mat.setM(fv16); - mat.setDefinitelyIdentityMatrix(false); - b = mat.getDefinitelyIdentityMatrix(); - b = mat.equals(mat2); - f1 = f1+f2+f3+f4+*pf1+*pf2; // getting rid of unused variable warnings. -} - -} - -bool matrixOps(void) -{ - bool result = true; - calltest(); - result &= identity(); - result &= rotations(); - result &= isOrthogonal(); - result &= transformations(); - result &= setRotationAxis(); - return result; -} - diff --git a/tests/md2Animation.cpp b/tests/md2Animation.cpp deleted file mode 100644 index 29013743..00000000 --- a/tests/md2Animation.cpp +++ /dev/null @@ -1,128 +0,0 @@ -// Copyright (C) 2008-2012 Colin MacDonald -// No rights reserved: this software is in the public domain. - -#include "testUtils.h" - -using namespace irr; -using namespace core; - -namespace -{ -// Tests MD2 animations. -/** At the moment, this just verifies that the last frame of the animation produces the expected bitmap. */ -bool testLastFrame() -{ - // Use EDT_BURNINGSVIDEO since it is not dependent on (e.g.) OpenGL driver versions. - IrrlichtDevice *device = createDevice(video::EDT_BURNINGSVIDEO, dimension2d<u32>(160, 120), 32); - if (!device) - return false; - - video::IVideoDriver* driver = device->getVideoDriver(); - scene::ISceneManager * smgr = device->getSceneManager(); - - scene::IAnimatedMesh* mesh = smgr->getMesh("./media/sydney.md2"); - - bool result = (mesh != 0); - if (mesh) - { - scene::IAnimatedMeshSceneNode* node = smgr->addAnimatedMeshSceneNode(mesh); - - if (node) - { - node->setPosition(vector3df(20, 0, 30)); - node->setMaterialFlag(video::EMF_LIGHTING, false); - node->setMaterialTexture(0, driver->getTexture("./media/sydney.bmp")); - node->setLoopMode(false); - - (void)smgr->addCameraSceneNode(); - - // Just jump to the last frame since that's all we're interested in. - node->setMD2Animation(scene::EMAT_DEATH_FALLBACK); - node->setCurrentFrame((f32)(node->getEndFrame())); - node->setAnimationSpeed(0); - device->run(); - driver->beginScene(video::ECBF_COLOR | video::ECBF_DEPTH, video::SColor(255, 255, 255, 0)); - smgr->drawAll(); - driver->endScene(); - if (mesh->getBoundingBox() != mesh->getMesh(node->getEndFrame())->getBoundingBox()) - { - logTestString("bbox of md2 mesh not updated.\n"); - result = false; - } - //TODO: Does not yet work, not sure if this is correct or not -#if 0 - if (node->getBoundingBox() != mesh->getMesh(node->getFrameNr())->getBoundingBox()) - { - logTestString("bbox of md2 scene node not updated.\n"); - result = false; - } -#endif - if (node->getTransformedBoundingBox() == core::aabbox3df()) - { - logTestString("md2 node returns empty bbox.\n"); - result = false; - } - } - } - - result &= takeScreenshotAndCompareAgainstReference(driver, "-md2Animation.png"); - device->closeDevice(); - device->run(); - device->drop(); - - return result; -} - -// Tests MD2 normals. -bool testNormals() -{ - // Use EDT_BURNINGSVIDEO since it is not dependent on (e.g.) OpenGL driver versions. - IrrlichtDevice *device = createDevice(video::EDT_BURNINGSVIDEO, dimension2d<u32>(160, 120), 32); - if (!device) - return false; - - video::IVideoDriver* driver = device->getVideoDriver(); - scene::ISceneManager * smgr = device->getSceneManager(); - - scene::IAnimatedMesh* mesh = smgr->getMesh("./media/sydney.md2"); - - bool result = (mesh != 0); - if (mesh) - { - scene::IAnimatedMeshSceneNode* node = smgr->addAnimatedMeshSceneNode(mesh); - if (node) - { - node->setPosition(vector3df(20, 0, 30)); - node->setMaterialFlag(video::EMF_LIGHTING, false); - node->setDebugDataVisible(scene::EDS_NORMALS); - node->setMaterialTexture(0, driver->getTexture("./media/sydney.bmp")); - node->setLoopMode(false); - - (void)smgr->addCameraSceneNode(); - - node->setMD2Animation(scene::EMAT_STAND); - node->setAnimationSpeed(0); - device->run(); - driver->beginScene(video::ECBF_COLOR | video::ECBF_DEPTH, video::SColor(255, 255, 255, 0)); - smgr->drawAll(); - driver->endScene(); - } - } - - result &= takeScreenshotAndCompareAgainstReference(driver, "-md2Normals.png"); - device->closeDevice(); - device->run(); - device->drop(); - - return result; -} - -} - -// test md2 features -bool md2Animation(void) -{ - bool result = testLastFrame(); - result &= testNormals(); - return result; -} diff --git a/tests/media/Burning's Video-2dmatFilter.png b/tests/media/Burning's Video-2dmatFilter.png deleted file mode 100644 index 09891c8e..00000000 Binary files a/tests/media/Burning's Video-2dmatFilter.png and /dev/null differ diff --git a/tests/media/Burning's Video-addBlend2D.png b/tests/media/Burning's Video-addBlend2D.png deleted file mode 100644 index 2122aa35..00000000 Binary files a/tests/media/Burning's Video-addBlend2D.png and /dev/null differ diff --git a/tests/media/Burning's Video-ambient-lighting.png b/tests/media/Burning's Video-ambient-lighting.png deleted file mode 100644 index 242d8d75..00000000 Binary files a/tests/media/Burning's Video-ambient-lighting.png and /dev/null differ diff --git a/tests/media/Burning's Video-b3dAnimation.png b/tests/media/Burning's Video-b3dAnimation.png deleted file mode 100644 index d16e689a..00000000 Binary files a/tests/media/Burning's Video-b3dAnimation.png and /dev/null differ diff --git a/tests/media/Burning's Video-b3dJointPosition.png b/tests/media/Burning's Video-b3dJointPosition.png deleted file mode 100644 index b669f8f8..00000000 Binary files a/tests/media/Burning's Video-b3dJointPosition.png and /dev/null differ diff --git a/tests/media/Burning's Video-billboard.png b/tests/media/Burning's Video-billboard.png deleted file mode 100644 index 59f36c1d..00000000 Binary files a/tests/media/Burning's Video-billboard.png and /dev/null differ diff --git a/tests/media/Burning's Video-billboardOrientation.png b/tests/media/Burning's Video-billboardOrientation.png deleted file mode 100644 index 2805aed8..00000000 Binary files a/tests/media/Burning's Video-billboardOrientation.png and /dev/null differ diff --git a/tests/media/Burning's Video-draw2DImage4cFilter.png b/tests/media/Burning's Video-draw2DImage4cFilter.png deleted file mode 100644 index b0629d89..00000000 Binary files a/tests/media/Burning's Video-draw2DImage4cFilter.png and /dev/null differ diff --git a/tests/media/Burning's Video-draw2DImageRTT.png b/tests/media/Burning's Video-draw2DImageRTT.png deleted file mode 100644 index dde350ff..00000000 Binary files a/tests/media/Burning's Video-draw2DImageRTT.png and /dev/null differ diff --git a/tests/media/Burning's Video-draw2DImageRect.png b/tests/media/Burning's Video-draw2DImageRect.png deleted file mode 100644 index 652e784a..00000000 Binary files a/tests/media/Burning's Video-draw2DImageRect.png and /dev/null differ diff --git a/tests/media/Burning's Video-drawLine.png b/tests/media/Burning's Video-drawLine.png deleted file mode 100644 index b3b2ea41..00000000 Binary files a/tests/media/Burning's Video-drawLine.png and /dev/null differ diff --git a/tests/media/Burning's Video-drawPixel.png b/tests/media/Burning's Video-drawPixel.png deleted file mode 100644 index acded3e4..00000000 Binary files a/tests/media/Burning's Video-drawPixel.png and /dev/null differ diff --git a/tests/media/Burning's Video-drawRectOutline.png b/tests/media/Burning's Video-drawRectOutline.png deleted file mode 100644 index ab97c508..00000000 Binary files a/tests/media/Burning's Video-drawRectOutline.png and /dev/null differ diff --git a/tests/media/Burning's Video-drawVPL_a.png b/tests/media/Burning's Video-drawVPL_a.png deleted file mode 100644 index a5666b7c..00000000 Binary files a/tests/media/Burning's Video-drawVPL_a.png and /dev/null differ diff --git a/tests/media/Burning's Video-drawVPL_b.png b/tests/media/Burning's Video-drawVPL_b.png deleted file mode 100644 index a5666b7c..00000000 Binary files a/tests/media/Burning's Video-drawVPL_b.png and /dev/null differ diff --git a/tests/media/Burning's Video-drawVPL_c.png b/tests/media/Burning's Video-drawVPL_c.png deleted file mode 100644 index a5666b7c..00000000 Binary files a/tests/media/Burning's Video-drawVPL_c.png and /dev/null differ diff --git a/tests/media/Burning's Video-drawVPL_d.png b/tests/media/Burning's Video-drawVPL_d.png deleted file mode 100644 index a5666b7c..00000000 Binary files a/tests/media/Burning's Video-drawVPL_d.png and /dev/null differ diff --git a/tests/media/Burning's Video-drawVPL_e.png b/tests/media/Burning's Video-drawVPL_e.png deleted file mode 100644 index bc839920..00000000 Binary files a/tests/media/Burning's Video-drawVPL_e.png and /dev/null differ diff --git a/tests/media/Burning's Video-drawVPL_f.png b/tests/media/Burning's Video-drawVPL_f.png deleted file mode 100644 index a5666b7c..00000000 Binary files a/tests/media/Burning's Video-drawVPL_f.png and /dev/null differ diff --git a/tests/media/Burning's Video-drawVPL_g.png b/tests/media/Burning's Video-drawVPL_g.png deleted file mode 100644 index 438941d1..00000000 Binary files a/tests/media/Burning's Video-drawVPL_g.png and /dev/null differ diff --git a/tests/media/Burning's Video-drawVPL_h.png b/tests/media/Burning's Video-drawVPL_h.png deleted file mode 100644 index 8ed44557..00000000 Binary files a/tests/media/Burning's Video-drawVPL_h.png and /dev/null differ diff --git a/tests/media/Burning's Video-drawVPL_i.png b/tests/media/Burning's Video-drawVPL_i.png deleted file mode 100644 index e344631b..00000000 Binary files a/tests/media/Burning's Video-drawVPL_i.png and /dev/null differ diff --git a/tests/media/Burning's Video-drawVPL_j.png b/tests/media/Burning's Video-drawVPL_j.png deleted file mode 100644 index a5666b7c..00000000 Binary files a/tests/media/Burning's Video-drawVPL_j.png and /dev/null differ diff --git a/tests/media/Burning's Video-drawVPL_k.png b/tests/media/Burning's Video-drawVPL_k.png deleted file mode 100644 index a5666b7c..00000000 Binary files a/tests/media/Burning's Video-drawVPL_k.png and /dev/null differ diff --git a/tests/media/Burning's Video-flyCircleAnimator.png b/tests/media/Burning's Video-flyCircleAnimator.png deleted file mode 100644 index 218af2a7..00000000 Binary files a/tests/media/Burning's Video-flyCircleAnimator.png and /dev/null differ diff --git a/tests/media/Burning's Video-guiDisabledMenu.png b/tests/media/Burning's Video-guiDisabledMenu.png deleted file mode 100644 index b25bb937..00000000 Binary files a/tests/media/Burning's Video-guiDisabledMenu.png and /dev/null differ diff --git a/tests/media/Burning's Video-lightType.png b/tests/media/Burning's Video-lightType.png deleted file mode 100644 index 446cc6dd..00000000 Binary files a/tests/media/Burning's Video-lightType.png and /dev/null differ diff --git a/tests/media/Burning's Video-lightmaps.png b/tests/media/Burning's Video-lightmaps.png deleted file mode 100644 index f53a7e36..00000000 Binary files a/tests/media/Burning's Video-lightmaps.png and /dev/null differ diff --git a/tests/media/Burning's Video-loadScene.png b/tests/media/Burning's Video-loadScene.png deleted file mode 100644 index 00e08b11..00000000 Binary files a/tests/media/Burning's Video-loadScene.png and /dev/null differ diff --git a/tests/media/Burning's Video-makeColorKeyTexture-new.png b/tests/media/Burning's Video-makeColorKeyTexture-new.png deleted file mode 100644 index a49dfbfa..00000000 Binary files a/tests/media/Burning's Video-makeColorKeyTexture-new.png and /dev/null differ diff --git a/tests/media/Burning's Video-makeColorKeyTexture-old.png b/tests/media/Burning's Video-makeColorKeyTexture-old.png deleted file mode 100644 index d584cd41..00000000 Binary files a/tests/media/Burning's Video-makeColorKeyTexture-old.png and /dev/null differ diff --git a/tests/media/Burning's Video-md2Animation.png b/tests/media/Burning's Video-md2Animation.png deleted file mode 100644 index b9c5be6c..00000000 Binary files a/tests/media/Burning's Video-md2Animation.png and /dev/null differ diff --git a/tests/media/Burning's Video-md2Normals.png b/tests/media/Burning's Video-md2Normals.png deleted file mode 100644 index 302b9b3d..00000000 Binary files a/tests/media/Burning's Video-md2Normals.png and /dev/null differ diff --git a/tests/media/Burning's Video-meshTransform.png b/tests/media/Burning's Video-meshTransform.png deleted file mode 100644 index e8abb00a..00000000 Binary files a/tests/media/Burning's Video-meshTransform.png and /dev/null differ diff --git a/tests/media/Burning's Video-multiTexture.png b/tests/media/Burning's Video-multiTexture.png deleted file mode 100644 index e02176b0..00000000 Binary files a/tests/media/Burning's Video-multiTexture.png and /dev/null differ diff --git a/tests/media/Burning's Video-orthoCam.png b/tests/media/Burning's Video-orthoCam.png deleted file mode 100644 index 099f9b71..00000000 Binary files a/tests/media/Burning's Video-orthoCam.png and /dev/null differ diff --git a/tests/media/Burning's Video-pixelAccuracy.png b/tests/media/Burning's Video-pixelAccuracy.png deleted file mode 100644 index 24190ef8..00000000 Binary files a/tests/media/Burning's Video-pixelAccuracy.png and /dev/null differ diff --git a/tests/media/Burning's Video-planeMatrix-scaledClip.png b/tests/media/Burning's Video-planeMatrix-scaledClip.png deleted file mode 100644 index 36d6cb9d..00000000 Binary files a/tests/media/Burning's Video-planeMatrix-scaledClip.png and /dev/null differ diff --git a/tests/media/Burning's Video-projMat.png b/tests/media/Burning's Video-projMat.png deleted file mode 100644 index c1ff258a..00000000 Binary files a/tests/media/Burning's Video-projMat.png and /dev/null differ diff --git a/tests/media/Burning's Video-renderMipmap.png b/tests/media/Burning's Video-renderMipmap.png deleted file mode 100644 index 74b8e7f1..00000000 Binary files a/tests/media/Burning's Video-renderMipmap.png and /dev/null differ diff --git a/tests/media/Burning's Video-rttAndAntiAlias.png b/tests/media/Burning's Video-rttAndAntiAlias.png deleted file mode 100644 index 37d65bd3..00000000 Binary files a/tests/media/Burning's Video-rttAndAntiAlias.png and /dev/null differ diff --git a/tests/media/Burning's Video-rttAndText.png b/tests/media/Burning's Video-rttAndText.png deleted file mode 100644 index cf7eaf18..00000000 Binary files a/tests/media/Burning's Video-rttAndText.png and /dev/null differ diff --git a/tests/media/Burning's Video-rttWith2DImage.png b/tests/media/Burning's Video-rttWith2DImage.png deleted file mode 100644 index 6fedf81d..00000000 Binary files a/tests/media/Burning's Video-rttWith2DImage.png and /dev/null differ diff --git a/tests/media/Burning's Video-stencilSelfShadow.png b/tests/media/Burning's Video-stencilSelfShadow.png deleted file mode 100644 index 2bd6eecf..00000000 Binary files a/tests/media/Burning's Video-stencilSelfShadow.png and /dev/null differ diff --git a/tests/media/Burning's Video-stencilShadow.png b/tests/media/Burning's Video-stencilShadow.png deleted file mode 100644 index 0186a74a..00000000 Binary files a/tests/media/Burning's Video-stencilShadow.png and /dev/null differ diff --git a/tests/media/Burning's Video-terrainGap.png b/tests/media/Burning's Video-terrainGap.png deleted file mode 100644 index 66480ba5..00000000 Binary files a/tests/media/Burning's Video-terrainGap.png and /dev/null differ diff --git a/tests/media/Burning's Video-terrainSceneNode-1.png b/tests/media/Burning's Video-terrainSceneNode-1.png deleted file mode 100644 index d105e824..00000000 Binary files a/tests/media/Burning's Video-terrainSceneNode-1.png and /dev/null differ diff --git a/tests/media/Burning's Video-terrainSceneNode-2.png b/tests/media/Burning's Video-terrainSceneNode-2.png deleted file mode 100644 index 63facea4..00000000 Binary files a/tests/media/Burning's Video-terrainSceneNode-2.png and /dev/null differ diff --git a/tests/media/Burning's Video-testGeometryCreator.png b/tests/media/Burning's Video-testGeometryCreator.png deleted file mode 100644 index b4aeab60..00000000 Binary files a/tests/media/Burning's Video-testGeometryCreator.png and /dev/null differ diff --git a/tests/media/Burning's Video-testImageFormats.png b/tests/media/Burning's Video-testImageFormats.png deleted file mode 100644 index 7efc85a1..00000000 Binary files a/tests/media/Burning's Video-testImageFormats.png and /dev/null differ diff --git a/tests/media/Burning's Video-testTerrainMesh.png b/tests/media/Burning's Video-testTerrainMesh.png deleted file mode 100644 index 98a7c0d2..00000000 Binary files a/tests/media/Burning's Video-testTerrainMesh.png and /dev/null differ diff --git a/tests/media/Burning's Video-textureMatrix.png b/tests/media/Burning's Video-textureMatrix.png deleted file mode 100644 index 26afc9e7..00000000 Binary files a/tests/media/Burning's Video-textureMatrix.png and /dev/null differ diff --git a/tests/media/Burning's Video-textureMatrix2.png b/tests/media/Burning's Video-textureMatrix2.png deleted file mode 100644 index f1875230..00000000 Binary files a/tests/media/Burning's Video-textureMatrix2.png and /dev/null differ diff --git a/tests/media/Burning's Video-textureMatrixInMixedScenes.png b/tests/media/Burning's Video-textureMatrixInMixedScenes.png deleted file mode 100644 index e5cdeb2c..00000000 Binary files a/tests/media/Burning's Video-textureMatrixInMixedScenes.png and /dev/null differ diff --git a/tests/media/Burning's Video-textureRenderStates.png b/tests/media/Burning's Video-textureRenderStates.png deleted file mode 100644 index a2db0d1c..00000000 Binary files a/tests/media/Burning's Video-textureRenderStates.png and /dev/null differ diff --git a/tests/media/Burning's Video-transparentAddColor.png b/tests/media/Burning's Video-transparentAddColor.png deleted file mode 100644 index 59374484..00000000 Binary files a/tests/media/Burning's Video-transparentAddColor.png and /dev/null differ diff --git a/tests/media/Burning's Video-transparentAlphaChannel.png b/tests/media/Burning's Video-transparentAlphaChannel.png deleted file mode 100644 index 358455d3..00000000 Binary files a/tests/media/Burning's Video-transparentAlphaChannel.png and /dev/null differ diff --git a/tests/media/Burning's Video-transparentAlphaChannelRef.png b/tests/media/Burning's Video-transparentAlphaChannelRef.png deleted file mode 100644 index 21844ab2..00000000 Binary files a/tests/media/Burning's Video-transparentAlphaChannelRef.png and /dev/null differ diff --git a/tests/media/Burning's Video-transparentReflection2Layer.png b/tests/media/Burning's Video-transparentReflection2Layer.png deleted file mode 100644 index 926d189a..00000000 Binary files a/tests/media/Burning's Video-transparentReflection2Layer.png and /dev/null differ diff --git a/tests/media/Burning's Video-transparentVertexAlpha.png b/tests/media/Burning's Video-transparentVertexAlpha.png deleted file mode 100644 index aef6dbd7..00000000 Binary files a/tests/media/Burning's Video-transparentVertexAlpha.png and /dev/null differ diff --git a/tests/media/Burning's Video-transparentVertexAlphaChannelMore.png b/tests/media/Burning's Video-transparentVertexAlphaChannelMore.png deleted file mode 100644 index 666b8145..00000000 Binary files a/tests/media/Burning's Video-transparentVertexAlphaChannelMore.png and /dev/null differ diff --git a/tests/media/Burning's Video-viewPortText.png b/tests/media/Burning's Video-viewPortText.png deleted file mode 100644 index 56e30650..00000000 Binary files a/tests/media/Burning's Video-viewPortText.png and /dev/null differ diff --git a/tests/media/Burning's Video-writeImageToFile.png b/tests/media/Burning's Video-writeImageToFile.png deleted file mode 100644 index acded3e4..00000000 Binary files a/tests/media/Burning's Video-writeImageToFile.png and /dev/null differ diff --git a/tests/media/Direct3D 9.0-2dmatFilter.png b/tests/media/Direct3D 9.0-2dmatFilter.png deleted file mode 100644 index c4e366cf..00000000 Binary files a/tests/media/Direct3D 9.0-2dmatFilter.png and /dev/null differ diff --git a/tests/media/Direct3D 9.0-addBlend2D.png b/tests/media/Direct3D 9.0-addBlend2D.png deleted file mode 100644 index 2c9bba58..00000000 Binary files a/tests/media/Direct3D 9.0-addBlend2D.png and /dev/null differ diff --git a/tests/media/Direct3D 9.0-draw2DImage4cFilter.png b/tests/media/Direct3D 9.0-draw2DImage4cFilter.png deleted file mode 100644 index 2b64f445..00000000 Binary files a/tests/media/Direct3D 9.0-draw2DImage4cFilter.png and /dev/null differ diff --git a/tests/media/Direct3D 9.0-draw2DImagePNG.png b/tests/media/Direct3D 9.0-draw2DImagePNG.png deleted file mode 100644 index 49a4e2ee..00000000 Binary files a/tests/media/Direct3D 9.0-draw2DImagePNG.png and /dev/null differ diff --git a/tests/media/Direct3D 9.0-draw2DImageRTT.png b/tests/media/Direct3D 9.0-draw2DImageRTT.png deleted file mode 100644 index dde350ff..00000000 Binary files a/tests/media/Direct3D 9.0-draw2DImageRTT.png and /dev/null differ diff --git a/tests/media/Direct3D 9.0-draw2DImageRect.png b/tests/media/Direct3D 9.0-draw2DImageRect.png deleted file mode 100644 index c89b00b8..00000000 Binary files a/tests/media/Direct3D 9.0-draw2DImageRect.png and /dev/null differ diff --git a/tests/media/Direct3D 9.0-drawLine.png b/tests/media/Direct3D 9.0-drawLine.png deleted file mode 100644 index b3b2ea41..00000000 Binary files a/tests/media/Direct3D 9.0-drawLine.png and /dev/null differ diff --git a/tests/media/Direct3D 9.0-drawPixel.png b/tests/media/Direct3D 9.0-drawPixel.png deleted file mode 100644 index 55668eff..00000000 Binary files a/tests/media/Direct3D 9.0-drawPixel.png and /dev/null differ diff --git a/tests/media/Direct3D 9.0-drawRectOutline.png b/tests/media/Direct3D 9.0-drawRectOutline.png deleted file mode 100644 index b53eeacf..00000000 Binary files a/tests/media/Direct3D 9.0-drawRectOutline.png and /dev/null differ diff --git a/tests/media/Direct3D 9.0-drawVPL_a.png b/tests/media/Direct3D 9.0-drawVPL_a.png deleted file mode 100644 index c6e8a6c6..00000000 Binary files a/tests/media/Direct3D 9.0-drawVPL_a.png and /dev/null differ diff --git a/tests/media/Direct3D 9.0-drawVPL_b.png b/tests/media/Direct3D 9.0-drawVPL_b.png deleted file mode 100644 index 7ee9b7b3..00000000 Binary files a/tests/media/Direct3D 9.0-drawVPL_b.png and /dev/null differ diff --git a/tests/media/Direct3D 9.0-drawVPL_c.png b/tests/media/Direct3D 9.0-drawVPL_c.png deleted file mode 100644 index 6920275d..00000000 Binary files a/tests/media/Direct3D 9.0-drawVPL_c.png and /dev/null differ diff --git a/tests/media/Direct3D 9.0-drawVPL_d.png b/tests/media/Direct3D 9.0-drawVPL_d.png deleted file mode 100644 index 9e36fa0c..00000000 Binary files a/tests/media/Direct3D 9.0-drawVPL_d.png and /dev/null differ diff --git a/tests/media/Direct3D 9.0-drawVPL_e.png b/tests/media/Direct3D 9.0-drawVPL_e.png deleted file mode 100644 index d88c7fad..00000000 Binary files a/tests/media/Direct3D 9.0-drawVPL_e.png and /dev/null differ diff --git a/tests/media/Direct3D 9.0-drawVPL_f.png b/tests/media/Direct3D 9.0-drawVPL_f.png deleted file mode 100644 index 7172eeae..00000000 Binary files a/tests/media/Direct3D 9.0-drawVPL_f.png and /dev/null differ diff --git a/tests/media/Direct3D 9.0-drawVPL_g.png b/tests/media/Direct3D 9.0-drawVPL_g.png deleted file mode 100644 index 107000de..00000000 Binary files a/tests/media/Direct3D 9.0-drawVPL_g.png and /dev/null differ diff --git a/tests/media/Direct3D 9.0-drawVPL_h.png b/tests/media/Direct3D 9.0-drawVPL_h.png deleted file mode 100644 index a5666b7c..00000000 Binary files a/tests/media/Direct3D 9.0-drawVPL_h.png and /dev/null differ diff --git a/tests/media/Direct3D 9.0-drawVPL_i.png b/tests/media/Direct3D 9.0-drawVPL_i.png deleted file mode 100644 index a5666b7c..00000000 Binary files a/tests/media/Direct3D 9.0-drawVPL_i.png and /dev/null differ diff --git a/tests/media/Direct3D 9.0-drawVPL_j.png b/tests/media/Direct3D 9.0-drawVPL_j.png deleted file mode 100644 index a5666b7c..00000000 Binary files a/tests/media/Direct3D 9.0-drawVPL_j.png and /dev/null differ diff --git a/tests/media/Direct3D 9.0-drawVPL_k.png b/tests/media/Direct3D 9.0-drawVPL_k.png deleted file mode 100644 index c6e8a6c6..00000000 Binary files a/tests/media/Direct3D 9.0-drawVPL_k.png and /dev/null differ diff --git a/tests/media/Direct3D 9.0-lightType.png b/tests/media/Direct3D 9.0-lightType.png deleted file mode 100644 index a349a5b5..00000000 Binary files a/tests/media/Direct3D 9.0-lightType.png and /dev/null differ diff --git a/tests/media/Direct3D 9.0-lightmaps.png b/tests/media/Direct3D 9.0-lightmaps.png deleted file mode 100644 index f53a7e36..00000000 Binary files a/tests/media/Direct3D 9.0-lightmaps.png and /dev/null differ diff --git a/tests/media/Direct3D 9.0-lineAntiAliasing.png b/tests/media/Direct3D 9.0-lineAntiAliasing.png deleted file mode 100644 index 7d93bcea..00000000 Binary files a/tests/media/Direct3D 9.0-lineAntiAliasing.png and /dev/null differ diff --git a/tests/media/Direct3D 9.0-mrt.png b/tests/media/Direct3D 9.0-mrt.png deleted file mode 100644 index c3b6598c..00000000 Binary files a/tests/media/Direct3D 9.0-mrt.png and /dev/null differ diff --git a/tests/media/Direct3D 9.0-mrt2.png b/tests/media/Direct3D 9.0-mrt2.png deleted file mode 100644 index 88f4e209..00000000 Binary files a/tests/media/Direct3D 9.0-mrt2.png and /dev/null differ diff --git a/tests/media/Direct3D 9.0-multiTexture.png b/tests/media/Direct3D 9.0-multiTexture.png deleted file mode 100644 index 4b891f95..00000000 Binary files a/tests/media/Direct3D 9.0-multiTexture.png and /dev/null differ diff --git a/tests/media/Direct3D 9.0-orthoCam.png b/tests/media/Direct3D 9.0-orthoCam.png deleted file mode 100644 index 54d4118f..00000000 Binary files a/tests/media/Direct3D 9.0-orthoCam.png and /dev/null differ diff --git a/tests/media/Direct3D 9.0-orthoStencil.png b/tests/media/Direct3D 9.0-orthoStencil.png deleted file mode 100644 index 4e7afb8a..00000000 Binary files a/tests/media/Direct3D 9.0-orthoStencil.png and /dev/null differ diff --git a/tests/media/Direct3D 9.0-pixelAccuracy.png b/tests/media/Direct3D 9.0-pixelAccuracy.png deleted file mode 100644 index 24190ef8..00000000 Binary files a/tests/media/Direct3D 9.0-pixelAccuracy.png and /dev/null differ diff --git a/tests/media/Direct3D 9.0-polygonBack.png b/tests/media/Direct3D 9.0-polygonBack.png deleted file mode 100644 index 76fb2e2d..00000000 Binary files a/tests/media/Direct3D 9.0-polygonBack.png and /dev/null differ diff --git a/tests/media/Direct3D 9.0-polygonFront.png b/tests/media/Direct3D 9.0-polygonFront.png deleted file mode 100644 index 76fb2e2d..00000000 Binary files a/tests/media/Direct3D 9.0-polygonFront.png and /dev/null differ diff --git a/tests/media/Direct3D 9.0-projMat.png b/tests/media/Direct3D 9.0-projMat.png deleted file mode 100644 index 06022a79..00000000 Binary files a/tests/media/Direct3D 9.0-projMat.png and /dev/null differ diff --git a/tests/media/Direct3D 9.0-renderMipmap.png b/tests/media/Direct3D 9.0-renderMipmap.png deleted file mode 100644 index 86e4fda6..00000000 Binary files a/tests/media/Direct3D 9.0-renderMipmap.png and /dev/null differ diff --git a/tests/media/Direct3D 9.0-rttAndAntiAlias.png b/tests/media/Direct3D 9.0-rttAndAntiAlias.png deleted file mode 100644 index bb482c22..00000000 Binary files a/tests/media/Direct3D 9.0-rttAndAntiAlias.png and /dev/null differ diff --git a/tests/media/Direct3D 9.0-rttAndText.png b/tests/media/Direct3D 9.0-rttAndText.png deleted file mode 100644 index f162da7b..00000000 Binary files a/tests/media/Direct3D 9.0-rttAndText.png and /dev/null differ diff --git a/tests/media/Direct3D 9.0-rttWith2DImage.png b/tests/media/Direct3D 9.0-rttWith2DImage.png deleted file mode 100644 index bc179e80..00000000 Binary files a/tests/media/Direct3D 9.0-rttWith2DImage.png and /dev/null differ diff --git a/tests/media/Direct3D 9.0-stencilSelfShadow.png b/tests/media/Direct3D 9.0-stencilSelfShadow.png deleted file mode 100644 index 4c271de7..00000000 Binary files a/tests/media/Direct3D 9.0-stencilSelfShadow.png and /dev/null differ diff --git a/tests/media/Direct3D 9.0-stencilShadow.png b/tests/media/Direct3D 9.0-stencilShadow.png deleted file mode 100644 index 724d5d3b..00000000 Binary files a/tests/media/Direct3D 9.0-stencilShadow.png and /dev/null differ diff --git a/tests/media/Direct3D 9.0-textureMatrix.png b/tests/media/Direct3D 9.0-textureMatrix.png deleted file mode 100644 index d561bbd9..00000000 Binary files a/tests/media/Direct3D 9.0-textureMatrix.png and /dev/null differ diff --git a/tests/media/Direct3D 9.0-textureMatrix2.png b/tests/media/Direct3D 9.0-textureMatrix2.png deleted file mode 100644 index 30aabf05..00000000 Binary files a/tests/media/Direct3D 9.0-textureMatrix2.png and /dev/null differ diff --git a/tests/media/Direct3D 9.0-textureMatrixInMixedScenes.png b/tests/media/Direct3D 9.0-textureMatrixInMixedScenes.png deleted file mode 100644 index 187d3b8e..00000000 Binary files a/tests/media/Direct3D 9.0-textureMatrixInMixedScenes.png and /dev/null differ diff --git a/tests/media/Direct3D 9.0-textureRenderStates.png b/tests/media/Direct3D 9.0-textureRenderStates.png deleted file mode 100644 index 98282fa1..00000000 Binary files a/tests/media/Direct3D 9.0-textureRenderStates.png and /dev/null differ diff --git a/tests/media/Direct3D 9.0-transparentAddColor.png b/tests/media/Direct3D 9.0-transparentAddColor.png deleted file mode 100644 index cb741c49..00000000 Binary files a/tests/media/Direct3D 9.0-transparentAddColor.png and /dev/null differ diff --git a/tests/media/Direct3D 9.0-transparentAlphaChannel.png b/tests/media/Direct3D 9.0-transparentAlphaChannel.png deleted file mode 100644 index be28cc56..00000000 Binary files a/tests/media/Direct3D 9.0-transparentAlphaChannel.png and /dev/null differ diff --git a/tests/media/Direct3D 9.0-transparentAlphaChannelRef.png b/tests/media/Direct3D 9.0-transparentAlphaChannelRef.png deleted file mode 100644 index 4f40301f..00000000 Binary files a/tests/media/Direct3D 9.0-transparentAlphaChannelRef.png and /dev/null differ diff --git a/tests/media/Direct3D 9.0-transparentReflection2Layer.png b/tests/media/Direct3D 9.0-transparentReflection2Layer.png deleted file mode 100644 index 12baed71..00000000 Binary files a/tests/media/Direct3D 9.0-transparentReflection2Layer.png and /dev/null differ diff --git a/tests/media/Direct3D 9.0-transparentVertexAlpha.png b/tests/media/Direct3D 9.0-transparentVertexAlpha.png deleted file mode 100644 index 88e03583..00000000 Binary files a/tests/media/Direct3D 9.0-transparentVertexAlpha.png and /dev/null differ diff --git a/tests/media/Direct3D 9.0-transparentVertexAlphaChannelMore.png b/tests/media/Direct3D 9.0-transparentVertexAlphaChannelMore.png deleted file mode 100644 index ceb2a810..00000000 Binary files a/tests/media/Direct3D 9.0-transparentVertexAlphaChannelMore.png and /dev/null differ diff --git a/tests/media/Direct3D 9.0-ucpsphere.png b/tests/media/Direct3D 9.0-ucpsphere.png deleted file mode 100644 index 103987a9..00000000 Binary files a/tests/media/Direct3D 9.0-ucpsphere.png and /dev/null differ diff --git a/tests/media/Direct3D 9.0-viewPortText.png b/tests/media/Direct3D 9.0-viewPortText.png deleted file mode 100644 index c1cd9247..00000000 Binary files a/tests/media/Direct3D 9.0-viewPortText.png and /dev/null differ diff --git a/tests/media/Irrlicht Software Driver 1.0-createImage.png b/tests/media/Irrlicht Software Driver 1.0-createImage.png deleted file mode 100644 index 0ccc2bc4..00000000 Binary files a/tests/media/Irrlicht Software Driver 1.0-createImage.png and /dev/null differ diff --git a/tests/media/Irrlicht Software Driver 1.0-draw2DImageRTT.png b/tests/media/Irrlicht Software Driver 1.0-draw2DImageRTT.png deleted file mode 100644 index 58a6e761..00000000 Binary files a/tests/media/Irrlicht Software Driver 1.0-draw2DImageRTT.png and /dev/null differ diff --git a/tests/media/Irrlicht Software Driver 1.0-draw2DImageRect.png b/tests/media/Irrlicht Software Driver 1.0-draw2DImageRect.png deleted file mode 100644 index 7b9fab1f..00000000 Binary files a/tests/media/Irrlicht Software Driver 1.0-draw2DImageRect.png and /dev/null differ diff --git a/tests/media/Irrlicht Software Driver 1.0-drawLine.png b/tests/media/Irrlicht Software Driver 1.0-drawLine.png deleted file mode 100644 index 8bcb70f3..00000000 Binary files a/tests/media/Irrlicht Software Driver 1.0-drawLine.png and /dev/null differ diff --git a/tests/media/Irrlicht Software Driver 1.0-drawPixel.png b/tests/media/Irrlicht Software Driver 1.0-drawPixel.png deleted file mode 100644 index 9002faf8..00000000 Binary files a/tests/media/Irrlicht Software Driver 1.0-drawPixel.png and /dev/null differ diff --git a/tests/media/Irrlicht Software Driver 1.0-drawRectOutline.png b/tests/media/Irrlicht Software Driver 1.0-drawRectOutline.png deleted file mode 100644 index 452d1642..00000000 Binary files a/tests/media/Irrlicht Software Driver 1.0-drawRectOutline.png and /dev/null differ diff --git a/tests/media/Irrlicht Software Driver 1.0-drawVPL_a.png b/tests/media/Irrlicht Software Driver 1.0-drawVPL_a.png deleted file mode 100644 index a41c6c5d..00000000 Binary files a/tests/media/Irrlicht Software Driver 1.0-drawVPL_a.png and /dev/null differ diff --git a/tests/media/Irrlicht Software Driver 1.0-drawVPL_b.png b/tests/media/Irrlicht Software Driver 1.0-drawVPL_b.png deleted file mode 100644 index cb2655fc..00000000 Binary files a/tests/media/Irrlicht Software Driver 1.0-drawVPL_b.png and /dev/null differ diff --git a/tests/media/Irrlicht Software Driver 1.0-drawVPL_c.png b/tests/media/Irrlicht Software Driver 1.0-drawVPL_c.png deleted file mode 100644 index 2e831ace..00000000 Binary files a/tests/media/Irrlicht Software Driver 1.0-drawVPL_c.png and /dev/null differ diff --git a/tests/media/Irrlicht Software Driver 1.0-drawVPL_d.png b/tests/media/Irrlicht Software Driver 1.0-drawVPL_d.png deleted file mode 100644 index 38157810..00000000 Binary files a/tests/media/Irrlicht Software Driver 1.0-drawVPL_d.png and /dev/null differ diff --git a/tests/media/Irrlicht Software Driver 1.0-drawVPL_e.png b/tests/media/Irrlicht Software Driver 1.0-drawVPL_e.png deleted file mode 100644 index a41c6c5d..00000000 Binary files a/tests/media/Irrlicht Software Driver 1.0-drawVPL_e.png and /dev/null differ diff --git a/tests/media/Irrlicht Software Driver 1.0-drawVPL_f.png b/tests/media/Irrlicht Software Driver 1.0-drawVPL_f.png deleted file mode 100644 index 5e019a6f..00000000 Binary files a/tests/media/Irrlicht Software Driver 1.0-drawVPL_f.png and /dev/null differ diff --git a/tests/media/Irrlicht Software Driver 1.0-drawVPL_g.png b/tests/media/Irrlicht Software Driver 1.0-drawVPL_g.png deleted file mode 100644 index 9e488d7f..00000000 Binary files a/tests/media/Irrlicht Software Driver 1.0-drawVPL_g.png and /dev/null differ diff --git a/tests/media/Irrlicht Software Driver 1.0-drawVPL_h.png b/tests/media/Irrlicht Software Driver 1.0-drawVPL_h.png deleted file mode 100644 index a41c6c5d..00000000 Binary files a/tests/media/Irrlicht Software Driver 1.0-drawVPL_h.png and /dev/null differ diff --git a/tests/media/Irrlicht Software Driver 1.0-drawVPL_i.png b/tests/media/Irrlicht Software Driver 1.0-drawVPL_i.png deleted file mode 100644 index a41c6c5d..00000000 Binary files a/tests/media/Irrlicht Software Driver 1.0-drawVPL_i.png and /dev/null differ diff --git a/tests/media/Irrlicht Software Driver 1.0-drawVPL_j.png b/tests/media/Irrlicht Software Driver 1.0-drawVPL_j.png deleted file mode 100644 index a41c6c5d..00000000 Binary files a/tests/media/Irrlicht Software Driver 1.0-drawVPL_j.png and /dev/null differ diff --git a/tests/media/Irrlicht Software Driver 1.0-drawVPL_k.png b/tests/media/Irrlicht Software Driver 1.0-drawVPL_k.png deleted file mode 100644 index a41c6c5d..00000000 Binary files a/tests/media/Irrlicht Software Driver 1.0-drawVPL_k.png and /dev/null differ diff --git a/tests/media/Irrlicht Software Driver 1.0-makeColorKeyTexture-new.png b/tests/media/Irrlicht Software Driver 1.0-makeColorKeyTexture-new.png deleted file mode 100644 index 20cc84e0..00000000 Binary files a/tests/media/Irrlicht Software Driver 1.0-makeColorKeyTexture-new.png and /dev/null differ diff --git a/tests/media/Irrlicht Software Driver 1.0-makeColorKeyTexture-old.png b/tests/media/Irrlicht Software Driver 1.0-makeColorKeyTexture-old.png deleted file mode 100644 index 87dc6624..00000000 Binary files a/tests/media/Irrlicht Software Driver 1.0-makeColorKeyTexture-old.png and /dev/null differ diff --git a/tests/media/Irrlicht Software Driver 1.0-multiTexture.png b/tests/media/Irrlicht Software Driver 1.0-multiTexture.png deleted file mode 100644 index 8b4f3527..00000000 Binary files a/tests/media/Irrlicht Software Driver 1.0-multiTexture.png and /dev/null differ diff --git a/tests/media/Irrlicht Software Driver 1.0-pixelAccuracy.png b/tests/media/Irrlicht Software Driver 1.0-pixelAccuracy.png deleted file mode 100644 index 70a441df..00000000 Binary files a/tests/media/Irrlicht Software Driver 1.0-pixelAccuracy.png and /dev/null differ diff --git a/tests/media/Irrlicht Software Driver 1.0-projMat.png b/tests/media/Irrlicht Software Driver 1.0-projMat.png deleted file mode 100644 index 4cb549d8..00000000 Binary files a/tests/media/Irrlicht Software Driver 1.0-projMat.png and /dev/null differ diff --git a/tests/media/Irrlicht Software Driver 1.0-rttAndText.png b/tests/media/Irrlicht Software Driver 1.0-rttAndText.png deleted file mode 100644 index 6c165904..00000000 Binary files a/tests/media/Irrlicht Software Driver 1.0-rttAndText.png and /dev/null differ diff --git a/tests/media/Irrlicht Software Driver 1.0-rttWith2DImage.png b/tests/media/Irrlicht Software Driver 1.0-rttWith2DImage.png deleted file mode 100644 index 98cdd8e5..00000000 Binary files a/tests/media/Irrlicht Software Driver 1.0-rttWith2DImage.png and /dev/null differ diff --git a/tests/media/Irrlicht Software Driver 1.0-softwareDevice-rotatedClip.png b/tests/media/Irrlicht Software Driver 1.0-softwareDevice-rotatedClip.png deleted file mode 100644 index 9f753599..00000000 Binary files a/tests/media/Irrlicht Software Driver 1.0-softwareDevice-rotatedClip.png and /dev/null differ diff --git a/tests/media/Irrlicht Software Driver 1.0-textureRenderStates.png b/tests/media/Irrlicht Software Driver 1.0-textureRenderStates.png deleted file mode 100644 index 81853f21..00000000 Binary files a/tests/media/Irrlicht Software Driver 1.0-textureRenderStates.png and /dev/null differ diff --git a/tests/media/Irrlicht Software Driver 1.0-viewPortText.png b/tests/media/Irrlicht Software Driver 1.0-viewPortText.png deleted file mode 100644 index 0c2234eb..00000000 Binary files a/tests/media/Irrlicht Software Driver 1.0-viewPortText.png and /dev/null differ diff --git a/tests/media/Monty.zip b/tests/media/Monty.zip deleted file mode 100644 index 956c33c9..00000000 Binary files a/tests/media/Monty.zip and /dev/null differ diff --git a/tests/media/OpenGL-2dmatFilter.png b/tests/media/OpenGL-2dmatFilter.png deleted file mode 100644 index 75b59df6..00000000 Binary files a/tests/media/OpenGL-2dmatFilter.png and /dev/null differ diff --git a/tests/media/OpenGL-addBlend2D.png b/tests/media/OpenGL-addBlend2D.png deleted file mode 100644 index 09fd9bad..00000000 Binary files a/tests/media/OpenGL-addBlend2D.png and /dev/null differ diff --git a/tests/media/OpenGL-draw2DImage4cFilter.png b/tests/media/OpenGL-draw2DImage4cFilter.png deleted file mode 100644 index 57ef58a8..00000000 Binary files a/tests/media/OpenGL-draw2DImage4cFilter.png and /dev/null differ diff --git a/tests/media/OpenGL-draw2DImagePNG.png b/tests/media/OpenGL-draw2DImagePNG.png deleted file mode 100644 index 4bec6930..00000000 Binary files a/tests/media/OpenGL-draw2DImagePNG.png and /dev/null differ diff --git a/tests/media/OpenGL-draw2DImageRTT.png b/tests/media/OpenGL-draw2DImageRTT.png deleted file mode 100644 index dde350ff..00000000 Binary files a/tests/media/OpenGL-draw2DImageRTT.png and /dev/null differ diff --git a/tests/media/OpenGL-draw2DImageRect.png b/tests/media/OpenGL-draw2DImageRect.png deleted file mode 100644 index c89b00b8..00000000 Binary files a/tests/media/OpenGL-draw2DImageRect.png and /dev/null differ diff --git a/tests/media/OpenGL-drawLine.png b/tests/media/OpenGL-drawLine.png deleted file mode 100644 index b3b2ea41..00000000 Binary files a/tests/media/OpenGL-drawLine.png and /dev/null differ diff --git a/tests/media/OpenGL-drawPixel.png b/tests/media/OpenGL-drawPixel.png deleted file mode 100644 index 2f9f5811..00000000 Binary files a/tests/media/OpenGL-drawPixel.png and /dev/null differ diff --git a/tests/media/OpenGL-drawRectOutline.png b/tests/media/OpenGL-drawRectOutline.png deleted file mode 100644 index 6032237a..00000000 Binary files a/tests/media/OpenGL-drawRectOutline.png and /dev/null differ diff --git a/tests/media/OpenGL-drawVPL_a.png b/tests/media/OpenGL-drawVPL_a.png deleted file mode 100644 index f2bb71f0..00000000 Binary files a/tests/media/OpenGL-drawVPL_a.png and /dev/null differ diff --git a/tests/media/OpenGL-drawVPL_b.png b/tests/media/OpenGL-drawVPL_b.png deleted file mode 100644 index 3f7eca4c..00000000 Binary files a/tests/media/OpenGL-drawVPL_b.png and /dev/null differ diff --git a/tests/media/OpenGL-drawVPL_c.png b/tests/media/OpenGL-drawVPL_c.png deleted file mode 100644 index 5d52e953..00000000 Binary files a/tests/media/OpenGL-drawVPL_c.png and /dev/null differ diff --git a/tests/media/OpenGL-drawVPL_d.png b/tests/media/OpenGL-drawVPL_d.png deleted file mode 100644 index 144ba9be..00000000 Binary files a/tests/media/OpenGL-drawVPL_d.png and /dev/null differ diff --git a/tests/media/OpenGL-drawVPL_e.png b/tests/media/OpenGL-drawVPL_e.png deleted file mode 100644 index a6ab41ff..00000000 Binary files a/tests/media/OpenGL-drawVPL_e.png and /dev/null differ diff --git a/tests/media/OpenGL-drawVPL_f.png b/tests/media/OpenGL-drawVPL_f.png deleted file mode 100644 index 373748de..00000000 Binary files a/tests/media/OpenGL-drawVPL_f.png and /dev/null differ diff --git a/tests/media/OpenGL-drawVPL_g.png b/tests/media/OpenGL-drawVPL_g.png deleted file mode 100644 index 473384c6..00000000 Binary files a/tests/media/OpenGL-drawVPL_g.png and /dev/null differ diff --git a/tests/media/OpenGL-drawVPL_h.png b/tests/media/OpenGL-drawVPL_h.png deleted file mode 100644 index 2e82269f..00000000 Binary files a/tests/media/OpenGL-drawVPL_h.png and /dev/null differ diff --git a/tests/media/OpenGL-drawVPL_i.png b/tests/media/OpenGL-drawVPL_i.png deleted file mode 100644 index 3fc59ec0..00000000 Binary files a/tests/media/OpenGL-drawVPL_i.png and /dev/null differ diff --git a/tests/media/OpenGL-drawVPL_j.png b/tests/media/OpenGL-drawVPL_j.png deleted file mode 100644 index f6becb6c..00000000 Binary files a/tests/media/OpenGL-drawVPL_j.png and /dev/null differ diff --git a/tests/media/OpenGL-drawVPL_k.png b/tests/media/OpenGL-drawVPL_k.png deleted file mode 100644 index f2bb71f0..00000000 Binary files a/tests/media/OpenGL-drawVPL_k.png and /dev/null differ diff --git a/tests/media/OpenGL-lightType.png b/tests/media/OpenGL-lightType.png deleted file mode 100644 index 46af20bb..00000000 Binary files a/tests/media/OpenGL-lightType.png and /dev/null differ diff --git a/tests/media/OpenGL-lightmaps.png b/tests/media/OpenGL-lightmaps.png deleted file mode 100644 index f53a7e36..00000000 Binary files a/tests/media/OpenGL-lightmaps.png and /dev/null differ diff --git a/tests/media/OpenGL-lineAntiAliasing.png b/tests/media/OpenGL-lineAntiAliasing.png deleted file mode 100644 index 75456881..00000000 Binary files a/tests/media/OpenGL-lineAntiAliasing.png and /dev/null differ diff --git a/tests/media/OpenGL-mrt.png b/tests/media/OpenGL-mrt.png deleted file mode 100644 index c3b6598c..00000000 Binary files a/tests/media/OpenGL-mrt.png and /dev/null differ diff --git a/tests/media/OpenGL-mrt2.png b/tests/media/OpenGL-mrt2.png deleted file mode 100644 index 88f4e209..00000000 Binary files a/tests/media/OpenGL-mrt2.png and /dev/null differ diff --git a/tests/media/OpenGL-multiTexture.png b/tests/media/OpenGL-multiTexture.png deleted file mode 100644 index 5eb8ae92..00000000 Binary files a/tests/media/OpenGL-multiTexture.png and /dev/null differ diff --git a/tests/media/OpenGL-octree_select1.png b/tests/media/OpenGL-octree_select1.png deleted file mode 100644 index 8129b455..00000000 Binary files a/tests/media/OpenGL-octree_select1.png and /dev/null differ diff --git a/tests/media/OpenGL-octree_select2.png b/tests/media/OpenGL-octree_select2.png deleted file mode 100644 index 2fb50ef5..00000000 Binary files a/tests/media/OpenGL-octree_select2.png and /dev/null differ diff --git a/tests/media/OpenGL-orthoCam.png b/tests/media/OpenGL-orthoCam.png deleted file mode 100644 index fa7b8b04..00000000 Binary files a/tests/media/OpenGL-orthoCam.png and /dev/null differ diff --git a/tests/media/OpenGL-orthoStencil.png b/tests/media/OpenGL-orthoStencil.png deleted file mode 100644 index 913905cb..00000000 Binary files a/tests/media/OpenGL-orthoStencil.png and /dev/null differ diff --git a/tests/media/OpenGL-pixelAccuracy.png b/tests/media/OpenGL-pixelAccuracy.png deleted file mode 100644 index 24190ef8..00000000 Binary files a/tests/media/OpenGL-pixelAccuracy.png and /dev/null differ diff --git a/tests/media/OpenGL-polygonBack.png b/tests/media/OpenGL-polygonBack.png deleted file mode 100644 index b6d57707..00000000 Binary files a/tests/media/OpenGL-polygonBack.png and /dev/null differ diff --git a/tests/media/OpenGL-polygonFront.png b/tests/media/OpenGL-polygonFront.png deleted file mode 100644 index 2d3da542..00000000 Binary files a/tests/media/OpenGL-polygonFront.png and /dev/null differ diff --git a/tests/media/OpenGL-projMat.png b/tests/media/OpenGL-projMat.png deleted file mode 100644 index b3970372..00000000 Binary files a/tests/media/OpenGL-projMat.png and /dev/null differ diff --git a/tests/media/OpenGL-renderMipmap.png b/tests/media/OpenGL-renderMipmap.png deleted file mode 100644 index 699bbf47..00000000 Binary files a/tests/media/OpenGL-renderMipmap.png and /dev/null differ diff --git a/tests/media/OpenGL-rttAndAntiAlias.png b/tests/media/OpenGL-rttAndAntiAlias.png deleted file mode 100644 index 947362fc..00000000 Binary files a/tests/media/OpenGL-rttAndAntiAlias.png and /dev/null differ diff --git a/tests/media/OpenGL-rttAndText.png b/tests/media/OpenGL-rttAndText.png deleted file mode 100644 index ca6b8198..00000000 Binary files a/tests/media/OpenGL-rttAndText.png and /dev/null differ diff --git a/tests/media/OpenGL-rttWith2DImage.png b/tests/media/OpenGL-rttWith2DImage.png deleted file mode 100644 index bc179e80..00000000 Binary files a/tests/media/OpenGL-rttWith2DImage.png and /dev/null differ diff --git a/tests/media/OpenGL-stencilSelfShadow.png b/tests/media/OpenGL-stencilSelfShadow.png deleted file mode 100644 index d5a9abf3..00000000 Binary files a/tests/media/OpenGL-stencilSelfShadow.png and /dev/null differ diff --git a/tests/media/OpenGL-stencilShadow.png b/tests/media/OpenGL-stencilShadow.png deleted file mode 100644 index 8f1534ad..00000000 Binary files a/tests/media/OpenGL-stencilShadow.png and /dev/null differ diff --git a/tests/media/OpenGL-textureMatrix.png b/tests/media/OpenGL-textureMatrix.png deleted file mode 100644 index 4cd34dc7..00000000 Binary files a/tests/media/OpenGL-textureMatrix.png and /dev/null differ diff --git a/tests/media/OpenGL-textureMatrix2.png b/tests/media/OpenGL-textureMatrix2.png deleted file mode 100644 index 5faaad75..00000000 Binary files a/tests/media/OpenGL-textureMatrix2.png and /dev/null differ diff --git a/tests/media/OpenGL-textureMatrixInMixedScenes.png b/tests/media/OpenGL-textureMatrixInMixedScenes.png deleted file mode 100644 index 9e52511e..00000000 Binary files a/tests/media/OpenGL-textureMatrixInMixedScenes.png and /dev/null differ diff --git a/tests/media/OpenGL-texturePointer.png b/tests/media/OpenGL-texturePointer.png deleted file mode 100644 index 4fbbbf71..00000000 Binary files a/tests/media/OpenGL-texturePointer.png and /dev/null differ diff --git a/tests/media/OpenGL-textureRenderStates.png b/tests/media/OpenGL-textureRenderStates.png deleted file mode 100644 index 98282fa1..00000000 Binary files a/tests/media/OpenGL-textureRenderStates.png and /dev/null differ diff --git a/tests/media/OpenGL-transparentAddColor.png b/tests/media/OpenGL-transparentAddColor.png deleted file mode 100644 index f590388f..00000000 Binary files a/tests/media/OpenGL-transparentAddColor.png and /dev/null differ diff --git a/tests/media/OpenGL-transparentAlphaChannel.png b/tests/media/OpenGL-transparentAlphaChannel.png deleted file mode 100644 index a99ad2c1..00000000 Binary files a/tests/media/OpenGL-transparentAlphaChannel.png and /dev/null differ diff --git a/tests/media/OpenGL-transparentAlphaChannelRef.png b/tests/media/OpenGL-transparentAlphaChannelRef.png deleted file mode 100644 index 3091a66c..00000000 Binary files a/tests/media/OpenGL-transparentAlphaChannelRef.png and /dev/null differ diff --git a/tests/media/OpenGL-transparentReflection2Layer.png b/tests/media/OpenGL-transparentReflection2Layer.png deleted file mode 100644 index ed1b45d3..00000000 Binary files a/tests/media/OpenGL-transparentReflection2Layer.png and /dev/null differ diff --git a/tests/media/OpenGL-transparentVertexAlpha.png b/tests/media/OpenGL-transparentVertexAlpha.png deleted file mode 100644 index 71d71df2..00000000 Binary files a/tests/media/OpenGL-transparentVertexAlpha.png and /dev/null differ diff --git a/tests/media/OpenGL-transparentVertexAlphaChannelMore.png b/tests/media/OpenGL-transparentVertexAlphaChannelMore.png deleted file mode 100644 index a2dae695..00000000 Binary files a/tests/media/OpenGL-transparentVertexAlphaChannelMore.png and /dev/null differ diff --git a/tests/media/OpenGL-tri_select1.png b/tests/media/OpenGL-tri_select1.png deleted file mode 100644 index 7f0f772f..00000000 Binary files a/tests/media/OpenGL-tri_select1.png and /dev/null differ diff --git a/tests/media/OpenGL-tri_select2.png b/tests/media/OpenGL-tri_select2.png deleted file mode 100644 index 6abed251..00000000 Binary files a/tests/media/OpenGL-tri_select2.png and /dev/null differ diff --git a/tests/media/OpenGL-tri_select3.png b/tests/media/OpenGL-tri_select3.png deleted file mode 100644 index 27c5d0b3..00000000 Binary files a/tests/media/OpenGL-tri_select3.png and /dev/null differ diff --git a/tests/media/OpenGL-ucpsphere.png b/tests/media/OpenGL-ucpsphere.png deleted file mode 100644 index 89cbd00f..00000000 Binary files a/tests/media/OpenGL-ucpsphere.png and /dev/null differ diff --git a/tests/media/OpenGL-viewPortText.png b/tests/media/OpenGL-viewPortText.png deleted file mode 100644 index adacf93c..00000000 Binary files a/tests/media/OpenGL-viewPortText.png and /dev/null differ diff --git a/tests/media/RedbrushAlpha-0.25.png b/tests/media/RedbrushAlpha-0.25.png deleted file mode 100644 index e17d5be9..00000000 Binary files a/tests/media/RedbrushAlpha-0.25.png and /dev/null differ diff --git a/tests/media/attributes.xml b/tests/media/attributes.xml deleted file mode 100644 index b2c73f25..00000000 --- a/tests/media/attributes.xml +++ /dev/null @@ -1,4 +0,0 @@ -<?xml version="1.0"?> -<root> - <element_position id1="152722522" id2="3" x="301" y="118" /> -</root> diff --git a/tests/media/cdata.xml b/tests/media/cdata.xml deleted file mode 100644 index dfcfa0c7..00000000 --- a/tests/media/cdata.xml +++ /dev/null @@ -1,14 +0,0 @@ -<?xml version="1.0"?> -<root> - <text><![CDATA[simple]]></text> - <text><![CDATA[]]></text> - <text><![CDATA[] ]> ]]></text> - <text><![CDATA[] -]> ]]></text> - <text><![CDATA[ -Newlines - and tabs - gogogo]]></text> - <text><![CDATA[&&#@#$%*()@#$%*()#$%*(]]></text> - <text><![CDATA[& & && &&& &a &ü &ä &ö &&#]]></text> -</root> diff --git a/tests/media/enc.zip b/tests/media/enc.zip deleted file mode 100755 index db5bcc71..00000000 Binary files a/tests/media/enc.zip and /dev/null differ diff --git a/tests/media/file_with_path.npk b/tests/media/file_with_path.npk deleted file mode 100644 index cda73db7..00000000 Binary files a/tests/media/file_with_path.npk and /dev/null differ diff --git a/tests/media/file_with_path.zip b/tests/media/file_with_path.zip deleted file mode 100644 index 8d301e62..00000000 Binary files a/tests/media/file_with_path.zip and /dev/null differ diff --git a/tests/media/file_with_path/mypath/myfile.txt b/tests/media/file_with_path/mypath/myfile.txt deleted file mode 100644 index 19fe4276..00000000 --- a/tests/media/file_with_path/mypath/myfile.txt +++ /dev/null @@ -1 +0,0 @@ -1est diff --git a/tests/media/file_with_path/mypath/mypath/myfile.txt b/tests/media/file_with_path/mypath/mypath/myfile.txt deleted file mode 100644 index 75845e16..00000000 --- a/tests/media/file_with_path/mypath/mypath/myfile.txt +++ /dev/null @@ -1 +0,0 @@ -2est \ No newline at end of file diff --git a/tests/media/file_with_path/test/test.txt b/tests/media/file_with_path/test/test.txt deleted file mode 100644 index cd087558..00000000 --- a/tests/media/file_with_path/test/test.txt +++ /dev/null @@ -1 +0,0 @@ -Hello world! diff --git a/tests/media/fireball.png b/tests/media/fireball.png deleted file mode 100644 index 7f41b3f6..00000000 Binary files a/tests/media/fireball.png and /dev/null differ diff --git a/tests/media/grey.tga b/tests/media/grey.tga deleted file mode 100644 index 5186a61a..00000000 Binary files a/tests/media/grey.tga and /dev/null differ diff --git a/tests/media/licenses.txt b/tests/media/licenses.txt deleted file mode 100644 index b8c06bcf..00000000 --- a/tests/media/licenses.txt +++ /dev/null @@ -1,7 +0,0 @@ -All assets of this test suite, except where noted below, are tkane from the main Irrlicht repository and are copyright/licensed as stated there. The source code is copyright by the authors, except where stated differently inside the files. - -title_font.xml and its png files are taken from SuperTuxKart. They are in the public domain. - -The image RedbrushAlpha-0.25.png is Copyright 1999 Pieter S. van der Meulen. This image, including the alpha channel, may be used, edited and reproduced freely. - Taken from http://www.libpng.org/pub/png/png-RedbrushAlpha.html - diff --git a/tests/media/lzmadata.zip b/tests/media/lzmadata.zip deleted file mode 100644 index 3c257b1e..00000000 Binary files a/tests/media/lzmadata.zip and /dev/null differ diff --git a/tests/media/sample_pakfile.pak b/tests/media/sample_pakfile.pak deleted file mode 100644 index aa90ccad..00000000 Binary files a/tests/media/sample_pakfile.pak and /dev/null differ diff --git a/tests/media/scene.irr b/tests/media/scene.irr deleted file mode 100644 index 244913b2..00000000 Binary files a/tests/media/scene.irr and /dev/null differ diff --git a/tests/media/scene2.irr b/tests/media/scene2.irr deleted file mode 100644 index 49ff185e..00000000 Binary files a/tests/media/scene2.irr and /dev/null differ diff --git a/tests/media/sydney.bmp b/tests/media/sydney.bmp deleted file mode 100644 index 2f14a5a0..00000000 Binary files a/tests/media/sydney.bmp and /dev/null differ diff --git a/tests/media/sydney.md2 b/tests/media/sydney.md2 deleted file mode 100644 index 7d3521dd..00000000 Binary files a/tests/media/sydney.md2 and /dev/null differ diff --git a/tests/media/ter1.png b/tests/media/ter1.png deleted file mode 100644 index 0675b275..00000000 Binary files a/tests/media/ter1.png and /dev/null differ diff --git a/tests/media/test.xml b/tests/media/test.xml deleted file mode 100644 index d311c1aa..00000000 --- a/tests/media/test.xml +++ /dev/null @@ -1,5 +0,0 @@ -<?xml version="1.0"?> -<a> - <b/> - <c/> -</a> diff --git a/tests/media/title_font.png b/tests/media/title_font.png deleted file mode 100644 index f075aa2f..00000000 Binary files a/tests/media/title_font.png and /dev/null differ diff --git a/tests/media/title_font.xml b/tests/media/title_font.xml deleted file mode 100644 index 32a6b0da..00000000 Binary files a/tests/media/title_font.xml and /dev/null differ diff --git a/tests/media/title_font_2.png b/tests/media/title_font_2.png deleted file mode 100644 index 2f4b0fb0..00000000 Binary files a/tests/media/title_font_2.png and /dev/null differ diff --git a/tests/media/tools.png b/tests/media/tools.png deleted file mode 100644 index b7e86c93..00000000 Binary files a/tests/media/tools.png and /dev/null differ diff --git a/tests/meshLoaders.cpp b/tests/meshLoaders.cpp deleted file mode 100644 index 2a828c3d..00000000 --- a/tests/meshLoaders.cpp +++ /dev/null @@ -1,37 +0,0 @@ -// Copyright (C) 2008-2012 Colin MacDonald -// No rights reserved: this software is in the public domain. - -#include "testUtils.h" - -using namespace irr; - -// Tests mesh loading features and the mesh cache. -/** This won't test render results. Currently, not all mesh loaders are tested. */ -bool meshLoaders(void) -{ - IrrlichtDevice *device = createDevice(video::EDT_NULL, core::dimension2d<u32>(160, 120), 32); - assert_log(device); - if (!device) - return false; - - scene::ISceneManager * smgr = device->getSceneManager(); - scene::IAnimatedMesh* mesh = smgr->getMesh("../media/ninja.b3d"); - assert_log(mesh); - - bool result = (mesh != 0); - - if (mesh) - { - if (mesh != smgr->getMesh("../media/ninja.b3d")) - { - logTestString("Loading from same file results in different meshes!"); - result=false; - } - } - - device->closeDevice(); - device->run(); - device->drop(); - - return result; -} diff --git a/tests/meshTransform.cpp b/tests/meshTransform.cpp deleted file mode 100644 index e57bcb0b..00000000 --- a/tests/meshTransform.cpp +++ /dev/null @@ -1,88 +0,0 @@ -// Copyright (C) 2009-2012 Christian Stehno -// No rights reserved: this software is in the public domain. - -#include "testUtils.h" - -using namespace irr; -using namespace core; -using namespace scene; -using namespace video; -using namespace io; -using namespace gui; - -// Tests mesh transformations via mesh manipulator. -bool meshTransform(void) -{ - // Use EDT_BURNINGSVIDEO since it is not dependent on (e.g.) OpenGL driver versions. - IrrlichtDevice *device = createDevice(EDT_BURNINGSVIDEO, dimension2d<u32>(160, 120), 32); - assert_log(device); - if (!device) - return false; - - IVideoDriver* driver = device->getVideoDriver(); - ISceneManager * smgr = device->getSceneManager(); - - IMeshSceneNode* node1 = smgr->addCubeSceneNode(50); - IAnimatedMesh* amesh = smgr->getMesh("../media/sydney.md2"); - IAnimatedMesh* smesh = smgr->getMesh("../media/ninja.b3d"); - assert_log(node1 && amesh && smesh); - - bool result = false; - if (!node1 || !amesh || !smesh) - return false; - -// node1->setPosition(core::vector3df(-60,0,150)); - node1->setDebugDataVisible(scene::EDS_BBOX_ALL); - - IMeshSceneNode* node2 = smgr->addMeshSceneNode(amesh->getMesh(10)); - assert_log(node2); - - if (!node2) - return false; - -// node2->setPosition(core::vector3df(30,10,150)); - node2->setDebugDataVisible(scene::EDS_BBOX_ALL); - node2->setMaterialFlag(EMF_LIGHTING, false); - - IMeshSceneNode* node3 = smgr->addMeshSceneNode(smesh->getMesh(10)); - assert_log(node3); - - if (!node3) - return false; - -// node3->setPosition(core::vector3df(10,0,0)); - node3->setDebugDataVisible(scene::EDS_BBOX_ALL); - node3->setMaterialFlag(EMF_LIGHTING, false); - - smgr->addCameraSceneNode()->setPosition(core::vector3df(0,0,-20)); - - // Just jump to the last frame since that's all we're interested in. - device->run(); - driver->beginScene(video::ECBF_COLOR | video::ECBF_DEPTH, SColor(255, 60, 60, 60)); - smgr->drawAll(); - driver->endScene(); - - core::matrix4 mat; - mat.setTranslation(core::vector3df(-60,0,150)); - driver->getMeshManipulator()->transform(node1->getMesh(), mat); - - mat.setTranslation(core::vector3df(30,10,150)); - driver->getMeshManipulator()->transform(node2->getMesh(), mat); - - mat.setTranslation(core::vector3df(10,0,0)); - driver->getMeshManipulator()->transform(node3->getMesh(), mat); - - // Just jump to the last frame since that's all we're interested in. - device->run(); - driver->beginScene(video::ECBF_COLOR | video::ECBF_DEPTH, SColor(255, 60, 60, 60)); - smgr->drawAll(); - driver->endScene(); - - result = takeScreenshotAndCompareAgainstReference(driver, "-meshTransform.png"); - - device->closeDevice(); - device->run(); - device->drop(); - - return result; -} diff --git a/tests/mrt.cpp b/tests/mrt.cpp deleted file mode 100644 index 84c8c4d3..00000000 --- a/tests/mrt.cpp +++ /dev/null @@ -1,138 +0,0 @@ -// Copyright (C) 2008-2012 Christian Stehno, Colin MacDonald -// No rights reserved: this software is in the public domain. - -#include "testUtils.h" - -using namespace irr; - -//! Tests rendering MRTs -static bool testWithDriver(video::E_DRIVER_TYPE driverType) -{ - IrrlichtDevice *device = createDevice (driverType, core::dimension2d < u32 > (220, 80)); - if (!device) - return true; // No error if device does not exist - - video::IVideoDriver* driver = device->getVideoDriver(); - // We need at least GLSL 1.10 or HLSL 1.1 -// if (driver->getDriverAttributes().getAttributeAsInt("ShaderLanguageVersion")<=100) -// return true; - - stabilizeScreenBackground(driver); - - logTestString("Testing driver %ls\n", driver->getName()); - - // write white to first render-texture, green to second, blue to third - const char* const psHLSL = - "struct PS_INPUT\n"\ - "{\n"\ - " float4 Position : POSITION0;\n"\ - "};\n"\ - "struct PS_OUTPUT\n"\ - "{\n "\ - " float4 Color : COLOR0;\n"\ - " float4 Normal : COLOR1;\n"\ - " float4 Depth : COLOR2;\n"\ - "};\n"\ - "PS_OUTPUT pixelMain( PS_INPUT Input )\n"\ - "{\n"\ - " PS_OUTPUT Output;\n"\ - " Output.Color = float4(1.0,1.0,1.0,1.0);\n"\ - " Output.Normal = float4(0.0,1.0,0.0,1.0);\n"\ - " Output.Depth = float4(0.0,0.0,1.0,1.0);\n"\ - " return Output;\n"\ - "}"; - - const char* const psGLSL = - "void main(void)\n"\ - "{\n"\ - " gl_FragData[0] = vec4(1.0,1.0,1.0,1.0);\n"\ - " gl_FragData[1] = vec4(0.0,1.0,0.0,1.0);\n"\ - " gl_FragData[2] = vec4(0.0,0.0,1.0,1.0);\n"\ - "}"; - - // variable - video::IRenderTarget* renderTarget = 0; - core::array<video::ITexture*> renderTargetTex; - video::ITexture* renderTargetDepth = 0; - - const core::dimension2du texsize(64,64); - bool result=true; - s32 newMaterialType = -1; - - if (device->getVideoDriver()->getDriverAttributes().getAttributeAsInt("MaxMultipleRenderTargets") > 2) - { - renderTargetTex.set_used(3); - renderTargetTex[0] = driver->addRenderTargetTexture(texsize, "rta", video::ECF_A8R8G8B8); - renderTargetTex[1] = driver->addRenderTargetTexture(texsize, "rtb", video::ECF_A8R8G8B8); - renderTargetTex[2] = driver->addRenderTargetTexture(texsize, "rtc", video::ECF_A8R8G8B8); - - renderTargetDepth = driver->addRenderTargetTexture(texsize, "rtd", video::ECF_D16); - - renderTarget = driver->addRenderTarget(); - renderTarget->setTexture(renderTargetTex, renderTargetDepth); - - video::IGPUProgrammingServices* gpu = driver->getGPUProgrammingServices(); - - if (gpu) - { - newMaterialType = gpu->addHighLevelShaderMaterial( - 0, "vertexMain", video::EVST_VS_1_1, - driverType==video::EDT_DIRECT3D9?psHLSL:psGLSL, "pixelMain", video::EPST_PS_1_1); - } - } - - // shader creation succeeded - if (newMaterialType!=-1) - { - scene::ISceneNode* node = device->getSceneManager()->addCubeSceneNode(); - node->setMaterialType((video::E_MATERIAL_TYPE)newMaterialType); - device->getSceneManager()->addCameraSceneNode(0, core::vector3df(0,0,-10)); - - driver->beginScene(video::ECBF_COLOR, video::SColor(255, 0, 0, 0)); - // render - driver->setRenderTargetEx(renderTarget, video::ECBF_COLOR | video::ECBF_DEPTH, video::SColor(255,0,0,0)); - device->getSceneManager()->drawAll(); - driver->setRenderTargetEx(0, 0, video::SColor(255, 0, 0, 0)); - - // draw debug rt - driver->draw2DImage(renderTargetTex[0], core::position2d<s32>(0,0)); - driver->draw2DImage(renderTargetTex[1], core::position2d<s32>(64,0)); - driver->draw2DImage(renderTargetTex[2], core::position2d<s32>(128,0)); - - driver->endScene(); - - result = takeScreenshotAndCompareAgainstReference(driver, "-mrt.png"); - - driver->beginScene(video::ECBF_COLOR, video::SColor(255, 0, 0, 0)); - // render - device->getSceneManager()->getActiveCamera()->setPosition(core::vector3df(0,0,-15)); - driver->setRenderTargetEx(renderTarget, video::ECBF_COLOR | video::ECBF_DEPTH, video::SColor(255,0,0,0)); - device->getSceneManager()->drawAll(); - driver->setRenderTargetEx(0, 0, video::SColor(255,0,0,0)); - - // draw debug rt - driver->draw2DImage(renderTargetTex[0], core::position2d<s32>(0,0)); - driver->draw2DImage(renderTargetTex[1], core::position2d<s32>(64,0)); - driver->draw2DImage(renderTargetTex[2], core::position2d<s32>(128,0)); - - driver->endScene(); - - result &= takeScreenshotAndCompareAgainstReference(driver, "-mrt2.png"); - } - - device->closeDevice(); - device->run(); - device->drop(); - - return result; -} - - -bool mrt(void) -{ - bool result = true; - - TestWithAllHWDrivers(testWithDriver); - - return result; -} diff --git a/tests/orthoCam.cpp b/tests/orthoCam.cpp deleted file mode 100644 index deb08bcd..00000000 --- a/tests/orthoCam.cpp +++ /dev/null @@ -1,105 +0,0 @@ -// Copyright (C) 2008-2012 Christian Stehno, Colin MacDonald -// No rights reserved: this software is in the public domain. - -#include "testUtils.h" - -using namespace irr; - -static bool testOrthoCam(video::E_DRIVER_TYPE driverType) -{ - IrrlichtDevice *device = createDevice (driverType, core::dimension2d<u32>(160,120)); - if (!device) - return true; // No error if device does not exist - - stabilizeScreenBackground(device->getVideoDriver()); - - scene::ICameraSceneNode* cam = device->getSceneManager()->addCameraSceneNode(); - cam->setPosition(core::vector3df(500,200,-500)); - cam->setTarget(core::vector3df()); - cam->setProjectionMatrix(core::matrix4().buildProjectionMatrixOrthoLH(240,180,0.9f,2000.f,driverType != video::EDT_OPENGL), true); - - device->getSceneManager()->addAnimatedMeshSceneNode(device->getSceneManager()->addHillPlaneMesh("plane", core::dimension2df(32,32), core::dimension2du(16,16)));//->setMaterialFlag(video::EMF_WIREFRAME, true); - device->getSceneManager()->addCubeSceneNode(20.f)->setPosition(core::vector3df(50,20,50)); - device->getSceneManager()->addCubeSceneNode(20.f)->setPosition(core::vector3df(50,20,-50)); - device->getSceneManager()->addCubeSceneNode(20.f)->setPosition(core::vector3df(50,50,0)); - - device->getSceneManager()->addCubeSceneNode(20.f)->setPosition(core::vector3df(-50,10,0)); - device->getSceneManager()->addCubeSceneNode(20.f)->setPosition(core::vector3df(100,10,-100)); - device->getSceneManager()->addCubeSceneNode(20.f)->setPosition(core::vector3df(150,10,0)); - - scene::IAnimatedMeshSceneNode* node = device->getSceneManager()->addAnimatedMeshSceneNode(device->getSceneManager()->getMesh("../media/ninja.b3d"), 0, -1, core::vector3df(-50,2,-50), core::vector3df(),core::vector3df(5,5,5)); - node->setMaterialFlag(video::EMF_NORMALIZE_NORMALS, true); - node->setAnimationSpeed(0.f); - - scene::ILightSceneNode* light = device->getSceneManager()->addLightSceneNode(0, core::vector3df(0,100,0)); - light->setLightType(video::ELT_POINT); - light->setRadius(500.f); - light->getLightData().DiffuseColor.set(0,1,1); - - device->getVideoDriver()->beginScene(video::ECBF_COLOR | video::ECBF_DEPTH, video::SColor(0,0,0,0)); - device->getSceneManager()->drawAll(); - device->getVideoDriver()->endScene(); - - const bool result = takeScreenshotAndCompareAgainstReference(device->getVideoDriver(), "-orthoCam.png", 99.91f); - - device->closeDevice(); - device->run(); - device->drop(); - - return result; -} - -static bool testOrthoStencil(video::E_DRIVER_TYPE driverType) -{ - IrrlichtDevice *device = createDevice (driverType, core::dimension2d<u32>(160,120), 16, false, true); - if (!device) - return true; // No error if device does not exist - - stabilizeScreenBackground(device->getVideoDriver()); - - scene::ICameraSceneNode* cam = device->getSceneManager()->addCameraSceneNode(); - cam->setPosition(core::vector3df(300,250,-300)); - cam->setTarget(core::vector3df(0,20,0)); - cam->setProjectionMatrix(core::matrix4().buildProjectionMatrixOrthoLH(120,90,0.9f,5000.f,driverType != video::EDT_OPENGL), true); - - device->getSceneManager()->addAnimatedMeshSceneNode(device->getSceneManager()->addHillPlaneMesh("plane", core::dimension2df(32,32), core::dimension2du(16,16)));//->setMaterialFlag(video::EMF_WIREFRAME, true); - - scene::IAnimatedMeshSceneNode* node = device->getSceneManager()->addAnimatedMeshSceneNode(device->getSceneManager()->getMesh("../media/ninja.b3d"), 0, -1, core::vector3df(0,2,0), core::vector3df(),core::vector3df(5,5,5)); - node->setMaterialFlag(video::EMF_NORMALIZE_NORMALS, true); - node->addShadowVolumeSceneNode(); - node->setAnimationSpeed(0.f); - - scene::ILightSceneNode* light = device->getSceneManager()->addLightSceneNode(0, core::vector3df(100,150,100)); - light->setLightType(video::ELT_POINT); - light->setRadius(500.f); - light->getLightData().DiffuseColor.set(0,1,1); - - device->getVideoDriver()->beginScene(video::ECBF_ALL, video::SColor(0,0,0,0)); - device->getSceneManager()->drawAll(); - device->getVideoDriver()->endScene(); - - const bool result = takeScreenshotAndCompareAgainstReference(device->getVideoDriver(), "-orthoStencil.png", 99.91f); - - device->closeDevice(); - device->run(); - device->drop(); - - return result; -} - -bool orthoCam(void) -{ - bool passed = true; - - passed &= testOrthoCam(video::EDT_OPENGL); - // no lights in sw renderer -// passed &= testOrthoCam(video::EDT_SOFTWARE); - passed &= testOrthoCam(video::EDT_BURNINGSVIDEO); - passed &= testOrthoCam(video::EDT_DIRECT3D9); - - // TODO: not sure if burnings could work? Currently it doesn't. - passed &= testOrthoStencil(video::EDT_OPENGL); - passed &= testOrthoStencil(video::EDT_DIRECT3D9); - - return passed; -} diff --git a/tests/planeMatrix.cpp b/tests/planeMatrix.cpp deleted file mode 100644 index 30d46264..00000000 --- a/tests/planeMatrix.cpp +++ /dev/null @@ -1,244 +0,0 @@ -// Copyright (C) 2008-2012 Colin MacDonald -// No rights reserved: this software is in the public domain. - -#include "testUtils.h" - -using namespace irr; -using namespace core; -using namespace scene; -using namespace video; -using namespace io; -using namespace gui; - -// There's all sorts of minor and inevitable FP accuracy errors here, so use a sloppy comparison. -static bool sloppyComparePlanes(const plane3df plane1, const plane3df plane2) -{ - return(equals(plane1.D, plane2.D, 0.001f) && - equals(plane1.Normal.X, plane2.Normal.X, 0.001f) && - equals(plane1.Normal.Y, plane2.Normal.Y, 0.001f) && - equals(plane1.Normal.Z, plane2.Normal.Z, 0.001f)); -} - -static bool transformPlane(const vector3df & point, const vector3df & normal, - const matrix4 & matrix, const plane3df & expected) -{ - plane3df plane(point, vector3df(normal).normalize()); - - logTestString("\n Pre N:(%.3ff,%.3ff,%.3ff), D:%.3ff\n", - plane.Normal.X, plane.Normal.Y, plane.Normal.Z, plane.D); - - matrix.transformPlane(plane); - - logTestString(" Post N:(%.3ff,%.3ff,%.3ff), D:%.3ff\n", - plane.Normal.X, plane.Normal.Y, plane.Normal.Z, plane.D); - - logTestString("Expected N:(%.3ff,%.3ff,%.3ff), D:%.3ff\n", - expected.Normal.X, expected.Normal.Y, expected.Normal.Z, expected.D); - - if(!plane.Normal.equals(vector3df(plane.Normal).normalize())) - { - logTestString("Plane normal no longer normalized after transformation\n"); - assert_log(false); - return false; - } - - if(!sloppyComparePlanes(plane, expected)) - { - logTestString("Unexpected result\n"); - assert_log(false); - return false; - } - - return true; -} - - -static bool drawScaledOctree(void) -{ - bool result = false; - IrrlichtDevice *device = createDevice(video::EDT_BURNINGSVIDEO, dimension2d<u32>(160, 120), 32); - if (!device) - return false; - - video::IVideoDriver* driver = device->getVideoDriver(); - ISceneManager * smgr = device->getSceneManager(); - - bool added = device->getFileSystem()->addFileArchive("../media/map-20kdm2.pk3"); - assert_log(added); - - if(added) - { - ISceneNode * node = smgr->addOctreeSceneNode(smgr->getMesh("20kdm2.bsp")->getMesh(0), 0, -1, 1024); - assert_log(node); - - if (node) - { - node->setMaterialFlag(EMF_LIGHTING, false); - node->setPosition(core::vector3df(-1300,-820,-1249)); - node->setScale(core::vector3df(1, 5, 1)); - - (void)smgr->addCameraSceneNode(0, core::vector3df(0,0,0), core::vector3df(40,100,30)); - - driver->beginScene(video::ECBF_COLOR | video::ECBF_DEPTH, video::SColor(255,255,255,0)); - smgr->drawAll(); - driver->endScene(); - - result = takeScreenshotAndCompareAgainstReference(driver, "-planeMatrix-scaledClip.png"); - } - } - - device->closeDevice(); - device->run(); - device->drop(); - - return result; -} - - -// Test the ability to transform a plane with a matrix. -bool planeMatrix(void) -{ - matrix4 rotationMatrix; - rotationMatrix.setRotationDegrees(vector3df(90, 0, 0)); - - matrix4 translationMatrix; - translationMatrix.setTranslation(vector3df(0, 3, 0)); - - matrix4 scaleMatrix; - scaleMatrix.setScale(vector3df(1, 2, 3)); - - bool success = true; - - matrix4 matrix = rotationMatrix; - logTestString("\nRotation matrix\n%02.02f %02.02f %02.02f %02.02f" - "\n%02.02f %02.02f %02.02f %02.02f" - "\n%02.02f %02.02f %02.02f %02.02f" - "\n%02.02f %02.02f %02.02f %02.02f\n", - matrix[0], matrix[1], matrix[2], matrix[3], - matrix[4], matrix[5], matrix[6], matrix[7], - matrix[8], matrix[9], matrix[10], matrix[11], - matrix[12], matrix[13], matrix[14], matrix[15]); - success &= transformPlane(vector3df(0, 0, 0), vector3df(-1, -1, 0), matrix, plane3df(vector3df(-.707f, 0.f, -.707f), 0.f)); - success &= transformPlane(vector3df(0, 0, 0), vector3df(1, 1, 0), matrix, plane3df(vector3df(.707f, 0.f, .707f), 0.f)); - success &= transformPlane(vector3df(0, 0, 0), vector3df(-1, 1, 0), matrix, plane3df(vector3df(-.707f, 0.f, .707f), 0.f)); - success &= transformPlane(vector3df(0, 0, 0), vector3df(1, -1, 0), matrix, plane3df(vector3df(.707f, 0.f, -.707f), 0.f)); - success &= transformPlane(vector3df(0, 1, 0), vector3df(-1, -1, 0), matrix, plane3df(vector3df(-.707f, 0.f, -.707f), .707f)); - success &= transformPlane(vector3df(0, 1, 0), vector3df(1, 1, 0), matrix, plane3df(vector3df(.707f, 0.f, .707f), -.707f)); - success &= transformPlane(vector3df(0, 1, 0), vector3df(-1, 1, 0), matrix, plane3df(vector3df(-.707f, 0.f, .707f), -.707f)); - success &= transformPlane(vector3df(0, 1, 0), vector3df(1, -1, 0), matrix, plane3df(vector3df(.707f, 0.f, -.707f), .707f)); - - - matrix = translationMatrix; - logTestString("\nTranslation matrix\n%02.02f %02.02f %02.02f %02.02f" - "\n%02.02f %02.02f %02.02f %02.02f" - "\n%02.02f %02.02f %02.02f %02.02f" - "\n%02.02f %02.02f %02.02f %02.02f\n", - matrix[0], matrix[1], matrix[2], matrix[3], - matrix[4], matrix[5], matrix[6], matrix[7], - matrix[8], matrix[9], matrix[10], matrix[11], - matrix[12], matrix[13], matrix[14], matrix[15]); - success &= transformPlane(vector3df(0, 0, 0), vector3df(-1, -1, 0), matrix, plane3df(vector3df(-0.707f,-0.707f,0.000f), 2.121f)); - success &= transformPlane(vector3df(0, 0, 0), vector3df(1, 1, 0), matrix, plane3df(vector3df(0.707f,0.707f,0.000f), -2.121f)); - success &= transformPlane(vector3df(0, 0, 0), vector3df(-1, 1, 0), matrix, plane3df(vector3df(-0.707f,0.707f,0.000f), -2.121f)); - success &= transformPlane(vector3df(0, 0, 0), vector3df(1, -1, 0), matrix, plane3df(vector3df(0.707f,-0.707f,0.000f), 2.121f)); - success &= transformPlane(vector3df(0, 1, 0), vector3df(-1, -1, 0), matrix, plane3df(vector3df(-0.707f,-0.707f,0.000f), 2.828f)); - success &= transformPlane(vector3df(0, 1, 0), vector3df(1, 1, 0), matrix, plane3df(vector3df(0.707f,0.707f,0.000f), -2.828f)); - success &= transformPlane(vector3df(0, 1, 0), vector3df(-1, 1, 0), matrix, plane3df(vector3df(-0.707f,0.707f,0.000f), -2.828f)); - success &= transformPlane(vector3df(0, 1, 0), vector3df(1, -1, 0), matrix, plane3df(vector3df(0.707f,-0.707f,0.000f), 2.828f)); - - - matrix = scaleMatrix; - logTestString("\nScale matrix\n%02.02f %02.02f %02.02f %02.02f" - "\n%02.02f %02.02f %02.02f %02.02f" - "\n%02.02f %02.02f %02.02f %02.02f" - "\n%02.02f %02.02f %02.02f %02.02f\n", - matrix[0], matrix[1], matrix[2], matrix[3], - matrix[4], matrix[5], matrix[6], matrix[7], - matrix[8], matrix[9], matrix[10], matrix[11], - matrix[12], matrix[13], matrix[14], matrix[15]); - success &= transformPlane(vector3df(0, 0, 0), vector3df(-1, -1, 0), matrix, plane3df(vector3df(-0.707f,-0.354f,0.000f).normalize(), -0.000f)); - success &= transformPlane(vector3df(0, 0, 0), vector3df(1, 1, 0), matrix, plane3df(vector3df(0.707f,0.354f,0.000f).normalize(), -0.000f)); - success &= transformPlane(vector3df(0, 0, 0), vector3df(-1, 1, 0), matrix, plane3df(vector3df(-0.707f,0.354f,0.000f).normalize(), -0.000f)); - success &= transformPlane(vector3df(0, 0, 0), vector3df(1, -1, 0), matrix, plane3df(vector3df(0.707f,-0.354f,0.000f).normalize(), -0.000f)); - success &= transformPlane(vector3df(0, 1, 0), vector3df(-1, -1, 0), matrix, plane3df(vector3df(-0.707f,-0.354f,0.000f).normalize(), 0.894f)); - success &= transformPlane(vector3df(0, 1, 0), vector3df(1, 1, 0), matrix, plane3df(vector3df(0.707f,0.354f,0.000f).normalize(), -0.894f)); - success &= transformPlane(vector3df(0, 1, 0), vector3df(-1, 1, 0), matrix, plane3df(vector3df(-0.707f,0.354f,0.000f).normalize(), -0.894f)); - success &= transformPlane(vector3df(0, 1, 0), vector3df(1, -1, 0), matrix, plane3df(vector3df(0.707f,-0.354f,0.000f).normalize(), 0.894f)); - - matrix = rotationMatrix * translationMatrix; - logTestString("\nRotation * translation matrix\n%02.02f %02.02f %02.02f %02.02f" - "\n%02.02f %02.02f %02.02f %02.02f" - "\n%02.02f %02.02f %02.02f %02.02f" - "\n%02.02f %02.02f %02.02f %02.02f\n", - matrix[0], matrix[1], matrix[2], matrix[3], - matrix[4], matrix[5], matrix[6], matrix[7], - matrix[8], matrix[9], matrix[10], matrix[11], - matrix[12], matrix[13], matrix[14], matrix[15]); - success &= transformPlane(vector3df(0, 0, 0), vector3df(-1, -1, 0), matrix, plane3df(vector3df(-0.707f,0.000f,-0.707f).normalize(), 2.121f)); - success &= transformPlane(vector3df(0, 0, 0), vector3df(1, 1, 0), matrix, plane3df(vector3df(0.707f,-0.000f,0.707f).normalize(), -2.121f)); - success &= transformPlane(vector3df(0, 0, 0), vector3df(-1, 1, 0), matrix, plane3df(vector3df(-0.707f,-0.000f,0.707f).normalize(), -2.121f)); - success &= transformPlane(vector3df(0, 0, 0), vector3df(1, -1, 0), matrix, plane3df(vector3df(0.707f,0.000f,-0.707f).normalize(), 2.121f)); - success &= transformPlane(vector3df(0, 1, 0), vector3df(-1, -1, 0), matrix, plane3df(vector3df(-0.707f,0.000f,-0.707f).normalize(), 2.828f)); - success &= transformPlane(vector3df(0, 1, 0), vector3df(1, 1, 0), matrix, plane3df(vector3df(0.707f,-0.000f,0.707f).normalize(), -2.828f)); - success &= transformPlane(vector3df(0, 1, 0), vector3df(-1, 1, 0), matrix, plane3df(vector3df(-0.707f,-0.000f,0.707f).normalize(), -2.828f)); - success &= transformPlane(vector3df(0, 1, 0), vector3df(1, -1, 0), matrix, plane3df(vector3df(0.707f,0.000f,-0.707f).normalize(), 2.828f)); - - matrix = rotationMatrix * scaleMatrix; - logTestString("\nRotation * scale matrix\n%02.02f %02.02f %02.02f %02.02f" - "\n%02.02f %02.02f %02.02f %02.02f" - "\n%02.02f %02.02f %02.02f %02.02f" - "\n%02.02f %02.02f %02.02f %02.02f\n", - matrix[0], matrix[1], matrix[2], matrix[3], - matrix[4], matrix[5], matrix[6], matrix[7], - matrix[8], matrix[9], matrix[10], matrix[11], - matrix[12], matrix[13], matrix[14], matrix[15]); - success &= transformPlane(vector3df(0, 0, 0), vector3df(-1, -1, 0), matrix, plane3df(vector3df(-0.707f,0.000f,-0.354f).normalize(), -0.000f)); - success &= transformPlane(vector3df(0, 0, 0), vector3df(1, 1, 0), matrix, plane3df(vector3df(0.707f,-0.000f,0.354f).normalize(), -0.000f)); - success &= transformPlane(vector3df(0, 0, 0), vector3df(-1, 1, 0), matrix, plane3df(vector3df(-0.707f,-0.000f,0.354f).normalize(), -0.000f)); - success &= transformPlane(vector3df(0, 0, 0), vector3df(1, -1, 0), matrix, plane3df(vector3df(0.707f,0.000f,-0.354f).normalize(), -0.000f)); - success &= transformPlane(vector3df(0, 1, 0), vector3df(-1, -1, 0), matrix, plane3df(vector3df(-0.707f,0.000f,-0.354f).normalize(), 0.894f)); - success &= transformPlane(vector3df(0, 1, 0), vector3df(1, 1, 0), matrix, plane3df(vector3df(0.707f,-0.000f,0.354f).normalize(), -0.894f)); - success &= transformPlane(vector3df(0, 1, 0), vector3df(-1, 1, 0), matrix, plane3df(vector3df(-0.707f,-0.000f,0.354f).normalize(), -0.894f)); - success &= transformPlane(vector3df(0, 1, 0), vector3df(1, -1, 0), matrix, plane3df(vector3df(0.707f,0.000f,-0.354f).normalize(), 0.894f)); - - matrix = translationMatrix * scaleMatrix; - logTestString("\nTranslation * scale matrix\n%02.02f %02.02f %02.02f %02.02f" - "\n%02.02f %02.02f %02.02f %02.02f" - "\n%02.02f %02.02f %02.02f %02.02f" - "\n%02.02f %02.02f %02.02f %02.02f\n", - matrix[0], matrix[1], matrix[2], matrix[3], - matrix[4], matrix[5], matrix[6], matrix[7], - matrix[8], matrix[9], matrix[10], matrix[11], - matrix[12], matrix[13], matrix[14], matrix[15]); - success &= transformPlane(vector3df(0, 0, 0), vector3df(-1, -1, 0), matrix, plane3df(vector3df(-0.707f,-0.354f,0.000f).normalize(), 1.3416f)); - success &= transformPlane(vector3df(0, 0, 0), vector3df(1, 1, 0), matrix, plane3df(vector3df(0.707f,0.354f,0.000f).normalize(), -1.3416f)); - success &= transformPlane(vector3df(0, 0, 0), vector3df(-1, 1, 0), matrix, plane3df(vector3df(-0.707f,0.354f,0.000f).normalize(), -1.3416f)); - success &= transformPlane(vector3df(0, 0, 0), vector3df(1, -1, 0), matrix, plane3df(vector3df(0.707f,-0.354f,0.000f).normalize(), 1.3416f)); - success &= transformPlane(vector3df(0, 1, 0), vector3df(-1, -1, 0), matrix, plane3df(vector3df(-0.707f,-0.354f,0.000f).normalize(), 2.236f)); - success &= transformPlane(vector3df(0, 1, 0), vector3df(1, 1, 0), matrix, plane3df(vector3df(0.707f,0.354f,0.000f).normalize(), -2.236f)); - success &= transformPlane(vector3df(0, 1, 0), vector3df(-1, 1, 0), matrix, plane3df(vector3df(-0.707f,0.354f,0.000f).normalize(), -2.236f)); - success &= transformPlane(vector3df(0, 1, 0), vector3df(1, -1, 0), matrix, plane3df(vector3df(0.707f,-0.354f,0.000f).normalize(), 2.236f)); - - matrix = rotationMatrix * translationMatrix * scaleMatrix; - logTestString("\nRotation * translation * scale matrix\n%02.02f %02.02f %02.02f %02.02f" - "\n%02.02f %02.02f %02.02f %02.02f" - "\n%02.02f %02.02f %02.02f %02.02f" - "\n%02.02f %02.02f %02.02f %02.02f\n", - matrix[0], matrix[1], matrix[2], matrix[3], - matrix[4], matrix[5], matrix[6], matrix[7], - matrix[8], matrix[9], matrix[10], matrix[11], - matrix[12], matrix[13], matrix[14], matrix[15]); - success &= transformPlane(vector3df(0, 0, 0), vector3df(-1, -1, 0), matrix, plane3df(vector3df(-0.707f,0.000f,-0.354f).normalize(), 1.3416f)); - success &= transformPlane(vector3df(0, 0, 0), vector3df(1, 1, 0), matrix, plane3df(vector3df(0.707f,-0.000f,0.354f).normalize(), -1.3416f)); - success &= transformPlane(vector3df(0, 0, 0), vector3df(-1, 1, 0), matrix, plane3df(vector3df(-0.707f,-0.000f,0.354f).normalize(), -1.3416f)); - success &= transformPlane(vector3df(0, 0, 0), vector3df(1, -1, 0), matrix, plane3df(vector3df(0.707f,0.000f,-0.354f).normalize(), 1.3416f)); - success &= transformPlane(vector3df(0, 1, 0), vector3df(-1, -1, 0), matrix, plane3df(vector3df(-0.707f,0.000f,-0.354f).normalize(), 2.236f)); - success &= transformPlane(vector3df(0, 1, 0), vector3df(1, 1, 0), matrix, plane3df(vector3df(0.707f,-0.000f,0.354f).normalize(), -2.236f)); - success &= transformPlane(vector3df(0, 1, 0), vector3df(-1, 1, 0), matrix, plane3df(vector3df(-0.707f,-0.000f,0.354f).normalize(), -2.236f)); - success &= transformPlane(vector3df(0, 1, 0), vector3df(1, -1, 0), matrix, plane3df(vector3df(0.707f,0.000f,-0.354f).normalize(), 2.236f)); - - success &= drawScaledOctree(); - - return success; -} - diff --git a/tests/projectionMatrix.cpp b/tests/projectionMatrix.cpp deleted file mode 100644 index 439d8e82..00000000 --- a/tests/projectionMatrix.cpp +++ /dev/null @@ -1,86 +0,0 @@ -// Copyright (C) 2008-2012 Christian Stehno, Colin MacDonald -// No rights reserved: this software is in the public domain. - -#include "testUtils.h" - -using namespace irr; -using namespace core; -using namespace scene; -using namespace video; -using namespace io; -using namespace gui; - -//! Tests projection matrices -static bool runTestWithDriver(E_DRIVER_TYPE driverType) -{ - IrrlichtDevice *device = createDevice( driverType, dimension2d<u32>(160, 120), 32); - if (!device) - return true; // Treat a failure to create a driver as benign; this saves a lot of #ifdefs - - IVideoDriver* driver = device->getVideoDriver(); - - stabilizeScreenBackground(driver); - - logTestString("Testing driver %ls\n", driver->getName()); - - bool result = true; - - driver->beginScene(video::ECBF_COLOR, SColor(255,0,0,0)); - - SMaterial mat; - mat.MaterialType = EMT_SOLID; - mat.Lighting = false; - mat.ZBuffer = false; - mat.ZWriteEnable = video::EZW_OFF; - mat.Thickness = 1; - - driver->setMaterial(mat); - - core::dimension2d<f32> dims(driver->getCurrentRenderTargetSize()); - //apply custom projection, no offset - core::matrix4 pmtx = matrix4().buildProjectionMatrixOrthoLH(dims.Width, dims.Height, 0, 100); - driver->setTransform(ETS_PROJECTION, pmtx); - driver->setTransform(ETS_VIEW, matrix4()); - driver->setTransform(ETS_WORLD, matrix4()); - - //the red cross appears at center - for (u32 i=0; i<10; ++i) - { - driver->draw3DLine(vector3df(0.f+i,-50.f,1.f), vector3df(0.f+i,50.f,1.f), SColor(255,255,0,0)); - driver->draw3DLine(vector3df(-50.f,0.f+i,1.f), vector3df(50.f,0.f+i,1.f), SColor(255,255,0,0)); - } - - //apply custom projection, offset to right-top - pmtx.setTranslation(vector3df(0.7f, 0.7f, 0.f)); - driver->setTransform(ETS_PROJECTION, pmtx); - driver->setTransform(ETS_VIEW, matrix4()); - driver->setTransform(ETS_WORLD, matrix4()); - - //The green cross must be in right-top corner. But for OpenGL driver it is in left-top corner - for (u32 i=0; i<10; ++i) - { - driver->draw3DLine(vector3df(0.f+i,-50,1), vector3df(0.f+i,50,1), SColor(255,0,255,0)); - driver->draw3DLine(vector3df(-50,0.f+i,1), vector3df(50,0.f+i,1), SColor(255,0,255,0)); - } - - driver->endScene(); - - result = takeScreenshotAndCompareAgainstReference(driver, "-projMat.png", 98.71f); - - device->closeDevice(); - device->run(); - device->drop(); - - return result; -} - - -bool projectionMatrix(void) -{ - bool result = true; - - // TODO: Seems that software driver does not handle this projection matrix - TestWithAllDrivers(runTestWithDriver); - - return result; -} diff --git a/tests/removeCustomAnimator.cpp b/tests/removeCustomAnimator.cpp deleted file mode 100644 index 9a69e00b..00000000 --- a/tests/removeCustomAnimator.cpp +++ /dev/null @@ -1,52 +0,0 @@ -// Copyright (C) 2008-2012 Colin MacDonald -// No rights reserved: this software is in the public domain. - -#include "testUtils.h" - -using namespace irr; -using namespace core; -using namespace scene; - -class CustomAnimator : public ISceneNodeAnimator -{ - void animateNode(ISceneNode* node, u32 timeMs) - { - // Check that I can remove myself from my node durings its animateNode() loop. - node->removeAnimator(this); - } - - ISceneNodeAnimator* createClone(ISceneNode* node, ISceneManager* newManager=0) { return 0 ; } -}; - - -/** Test that a custom animator can remove itself cleanly from an ISceneNode during its - * own animateNode() loop. - * http://irrlicht.sourceforge.net/phpBB2/viewtopic.php?t=32271 */ -bool removeCustomAnimator(void) -{ - IrrlichtDevice * device = irr::createDevice(video::EDT_NULL, dimension2du(160, 120)); - assert_log(device); - if(!device) - return false; - - ISceneManager * smgr = device->getSceneManager(); - - ISceneNode * node = smgr->addEmptySceneNode(); - CustomAnimator * instantlyElapsing1 = new CustomAnimator(); - CustomAnimator * instantlyElapsing2 = new CustomAnimator(); - node->addAnimator(instantlyElapsing1); - node->addAnimator(instantlyElapsing2); - - // This should result in both custom animators being removed and - // deleted cleanly, without a crash. - node->OnAnimate(0); - - device->closeDevice(); - device->run(); - device->drop(); - - // If we didn't crash, then the test passed. - return true; -} - - diff --git a/tests/renderTargetTexture.cpp b/tests/renderTargetTexture.cpp deleted file mode 100644 index 24d15d0d..00000000 --- a/tests/renderTargetTexture.cpp +++ /dev/null @@ -1,604 +0,0 @@ -// Copyright (C) 2008-2012 Christian Stehno, Colin MacDonald -// No rights reserved: this software is in the public domain. - -#include "testUtils.h" - -using namespace irr; - -//! Tests rendering RTTs with draw2DImage -/** This test is very special in its setup, problematic situation was found by stefbuet. */ -static bool testWith2DImage(video::E_DRIVER_TYPE driverType) -{ - IrrlichtDevice *device = createDevice(driverType, core::dimension2d<u32> (256, 128)); - if (!device) - return true; // No error if device does not exist - - video::IVideoDriver *driver = device->getVideoDriver (); - scene::ISceneManager *smgr = device->getSceneManager (); - - if (!driver->queryFeature(video::EVDF_RENDER_TO_TARGET)) - { - device->closeDevice(); - device->run(); - device->drop(); - return true; - } - - stabilizeScreenBackground(driver); - - logTestString("Testing driver %ls\n", driver->getName()); - - video::ITexture *image = driver->getTexture ("../media/irrlichtlogo2.png"); - video::ITexture *RTT_texture = driver->addRenderTargetTexture (core::dimension2d < u32 > (256, 128)); - - smgr->addCameraSceneNode (0, core::vector3df (100, 100, 100), - core::vector3df (0, 0, 0)); - - /*to reproduce the bug : - -draw the image : it's normal - -apply an RTT texture to a model - -remove the model - -draw the image again : it's flipped - */ - - video::SColor colors[4]={0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff}; - //draw the image : - driver->beginScene(video::ECBF_COLOR | video::ECBF_DEPTH, video::SColor (255, 200, 200, 200)); - driver->draw2DImage (image, - core::rect < s32 > - (64 - image->getSize ().Width / 2, - 64 - image->getSize ().Height / 2, - 64 + image->getSize ().Width / 2, - 64 + image->getSize ().Height / 2), - core::rect < s32 > (0, 0, image->getSize ().Width, - image->getSize ().Height), 0, colors, - true); - driver->endScene (); - - //then create a model and apply to it the RTT Texture - //rendering the model is important, if not rendered 1 time, bug won't appear. - //after the render, we remove the node : important, if not done, bug won't appear too. - scene::IMesh *modelMesh = smgr->getMesh ("../media/earth.x"); - scene::ISceneNode *modelNode = smgr->addMeshSceneNode(modelMesh); - modelNode->setMaterialTexture (0, RTT_texture); - - driver->beginScene(video::ECBF_COLOR | video::ECBF_DEPTH, video::SColor (255, 200, 200, 200)); - smgr->drawAll(); - driver->endScene(); - - modelNode->remove(); - - //then we render the image normaly - //it's now fliped... - for (u32 i=0; i<10; ++i) - { - driver->beginScene(video::ECBF_COLOR | video::ECBF_DEPTH, video::SColor (255, 200, 200, 200)); - - //draw img - driver->draw2DImage (image, - core::rect < s32 > - (64 - image->getSize ().Width / 2, - 64 - image->getSize ().Height / 2, - 64 + image->getSize ().Width / 2, - 64 + image->getSize ().Height / 2), - core::rect < s32 > (0, 0, image->getSize ().Width, - image->getSize ().Height), 0, - colors, true); - - //call this is important : - //if not called, the bug won't appear - smgr->drawAll(); - - driver->endScene(); - } - - bool result = takeScreenshotAndCompareAgainstReference(driver, "-rttWith2DImage.png", 99.9f); - - device->closeDevice(); - device->run(); - device->drop(); - - return result; -} - - -bool rttAndZBuffer(video::E_DRIVER_TYPE driverType) -{ - SIrrlichtCreationParameters cp; - cp.WindowSize.set(160,120); - cp.Bits = 32; - cp.AntiAlias = 4; - cp.DriverType = driverType; - - IrrlichtDevice* nullDevice = createDevice(video::EDT_NULL); - cp.WindowSize = nullDevice->getVideoModeList()->getDesktopResolution(); - nullDevice->closeDevice(); - nullDevice->run(); - nullDevice->drop(); - - cp.WindowSize -= core::dimension2d<u32>(100, 100); - - IrrlichtDevice* device = createDeviceEx(cp); - if (!device) - return true; - - video::IVideoDriver* vd = device->getVideoDriver(); - scene::ISceneManager* sm = device->getSceneManager(); - - if (!vd->queryFeature(video::EVDF_RENDER_TO_TARGET)) - { - device->closeDevice(); - device->run(); - device->drop(); - return true; - } - - stabilizeScreenBackground(vd); - - logTestString("Testing driver %ls\n", vd->getName()); - - video::ITexture* renderTargetTex = vd->addRenderTargetTexture(cp.WindowSize, "rt", video::ECF_A32B32G32R32F); - video::ITexture* renderTargetDepth = vd->addRenderTargetTexture(cp.WindowSize, "rtd", video::ECF_D16); - - video::IRenderTarget* renderTarget = vd->addRenderTarget(); - renderTarget->setTexture(renderTargetTex, renderTargetDepth); - - video::S3DVertex vertices[4]; - vertices[0].Pos.Z = vertices[1].Pos.Z = vertices[2].Pos.Z = vertices[3].Pos.Z = 1.0f; - vertices[0].Pos.Y = vertices[1].Pos.Y = 1.0f; - vertices[2].Pos.Y = vertices[3].Pos.Y = -1.0f; - vertices[0].Pos.X = vertices[3].Pos.X = -1.0f; - vertices[1].Pos.X = vertices[2].Pos.X = 1.0f; - vertices[0].TCoords.Y = vertices[1].TCoords.Y = 0.0f; - vertices[2].TCoords.Y = vertices[3].TCoords.Y = 1.0f; - vertices[0].TCoords.X = vertices[3].TCoords.X = 1.0f; - vertices[1].TCoords.X = vertices[2].TCoords.X = 0.0f; - - u16 indices[6] = {0, 1, 3, 1, 2, 3}; - - video::SMaterial rtMat; - rtMat.BackfaceCulling = false; - rtMat.Lighting = false; - rtMat.TextureLayer[0].TextureWrapU = - rtMat.TextureLayer[0].TextureWrapV = video::ETC_CLAMP_TO_EDGE; - - sm->addLightSceneNode(NULL, core::vector3df(0, 50, 0), - video::SColorf(1, 1, 1), 100); - - sm->addCameraSceneNode(NULL, core::vector3df(0, 10, 0)); - - const scene::IGeometryCreator* geom = sm->getGeometryCreator(); - scene::IMeshManipulator* manip = sm->getMeshManipulator(); - scene::IMesh* mesh; - scene::ISceneNode* node; - - mesh = geom->createCubeMesh(core::vector3df(10, 10, 10)); - manip->setVertexColors(mesh, video::SColor(255, 0, 0, 255)); - node = sm->addMeshSceneNode(mesh, NULL, -1, core::vector3df(0, 0, 30)); - node->getMaterial(0).EmissiveColor = video::SColor(255, 0, 0, 30); - mesh->drop(); - - mesh = geom->createSphereMesh(5.0f, 32, 32); - node = sm->addMeshSceneNode(mesh, NULL, -1, core::vector3df(0, 0, 50)); - node->getMaterial(0).EmissiveColor = video::SColor(255, 30, 30, 30); - mesh->drop(); - - mesh = geom->createConeMesh(5.0f, 10.0f, 32, video::SColor(255, 255, 0, 0), video::SColor(255, 255, 0, 0)); - node = sm->addMeshSceneNode(mesh, NULL, -1, core::vector3df(0, 0, 70)); - node->getMaterial(0).EmissiveColor = video::SColor(255, 30, 0, 0); - mesh->drop(); - - { - vd->beginScene(video::ECBF_COLOR | video::ECBF_DEPTH, video::SColor(255, 0, 0, 0)); - vd->setRenderTargetEx(renderTarget, video::ECBF_COLOR | video::ECBF_DEPTH); - sm->drawAll(); - vd->setRenderTargetEx(0, 0, 0); - vd->setTransform(video::ETS_WORLD, core::IdentityMatrix); - vd->setTransform(video::ETS_VIEW, core::IdentityMatrix); - vd->setTransform(video::ETS_PROJECTION, core::IdentityMatrix); - rtMat.setTexture(0, renderTargetTex); - vd->setMaterial(rtMat); - vd->drawIndexedTriangleList(vertices, 4, indices, 2); - vd->endScene(); - } - bool result = takeScreenshotAndCompareAgainstReference(vd, "-rttAndZBuffer.png"); - - device->closeDevice(); - device->run(); - device->drop(); - - return result; -} - - -// result should be two times the same blind text on the left side, and -// the fireball image (with a very small text inside) in the middle of the screen -// drivers that don't support image scaling will show a pink background instead -bool rttAndText(video::E_DRIVER_TYPE driverType) -{ - IrrlichtDevice* device = createDevice(driverType, core::dimension2d<u32>(160, 120)); - if (!device) - return true; - - video::IVideoDriver* driver = device->getVideoDriver(); - gui::IGUIEnvironment* guienv = device->getGUIEnvironment(); - - if (!driver->queryFeature(video::EVDF_RENDER_TO_TARGET)) - { - device->closeDevice(); - device->run(); - device->drop(); - return true; - } - logTestString("Testing driver %ls\n", driver->getName()); - - //RTT - video::ITexture* renderTargetTex = driver->addRenderTargetTexture(core::dimension2d<u32>(256, 256), "rt"); - video::ITexture* renderTargetDepth = driver->addRenderTargetTexture(core::dimension2d<u32>(256, 256), "rtd", video::ECF_D16); - - video::IRenderTarget* renderTarget = driver->addRenderTarget(); - renderTarget->setTexture(renderTargetTex, renderTargetDepth); - - stabilizeScreenBackground(driver); - - driver->beginScene(0, video::SColor(255,255, 255, 255)); - driver->setRenderTargetEx(renderTarget, video::ECBF_COLOR | video::ECBF_DEPTH, video::SColor(255,255,0,255)); - driver->draw2DImage(driver->getTexture("../media/fireball.bmp"), core::recti(0, 0, renderTargetTex->getSize().Width, renderTargetTex->getSize().Height), core::recti(0, 0, 64, 64)); - guienv->getBuiltInFont()->draw(L"OMGGG =!", core::rect<s32>(120, 100, 256, 256), video::SColor(255, 0, 0, 255)); - driver->setRenderTargetEx(0, 0, 0); - driver->endScene(); - - scene::ISceneManager* smgr = device->getSceneManager(); - - scene::ISceneNode* cube = smgr->addCubeSceneNode(20); - cube->setMaterialFlag(video::EMF_LIGHTING, false); - cube->setMaterialTexture(0, renderTargetTex); // set material of cube to render target - - smgr->addCameraSceneNode(0, core::vector3df(0, 0, -30)); - - // create a long text to produce much difference in failing result pictures - gui::IGUIStaticText* text = guienv->addStaticText(L"asdddddddoamgmoasmgom\nfoaomsodommogdd\nddddddddd", core::rect<s32>(10, 20, 100, 160)); - - driver->beginScene(video::ECBF_COLOR | video::ECBF_DEPTH, video::SColor(255,255, 255, 255)); - cube->setVisible(false); - smgr->drawAll(); - guienv->drawAll(); - - cube->setVisible(true); - smgr->drawAll(); - video::SMaterial mat(cube->getMaterial(0)); - driver->setMaterial(mat); - text->setRelativePosition(core::position2di(10,30)); - guienv->drawAll(); - - driver->endScene(); - - bool result = takeScreenshotAndCompareAgainstReference(driver, "-rttAndText.png"); - - device->closeDevice(); - device->run(); - device->drop(); - - return result; -} - -static void Render(IrrlichtDevice* device, video::IRenderTarget* rt, core::vector3df& pos1, - core::vector3df& pos2, scene::IAnimatedMesh* sphereMesh, core::vector3df& pos3, core::vector3df& pos4) -{ - video::IVideoDriver* driver = device->getVideoDriver(); - driver->setRenderTargetEx(rt, video::ECBF_COLOR | video::ECBF_DEPTH); - device->getSceneManager()->drawAll(); - - video::SMaterial mat; - mat.ColorMaterial=video::ECM_NONE; - mat.AmbientColor.set(255, 80, 80, 80); - mat.DiffuseColor.set(255, 120, 30, 210); - mat.SpecularColor.set(255,80,80,80); - mat.Shininess = 8.f; - - core::matrix4 m; - m.setTranslation(pos1); - driver->setTransform(video::ETS_WORLD, m); - driver->setMaterial(mat); - driver->drawMeshBuffer(sphereMesh->getMeshBuffer(0)); - - m.setTranslation(pos2); - mat.Shininess=0.f; - driver->setTransform(video::ETS_WORLD, m); - driver->setMaterial(mat); - driver->drawMeshBuffer(sphereMesh->getMeshBuffer(0)); - - m.setTranslation(pos3); - mat.Shininess=8.f; - driver->setTransform(video::ETS_WORLD, m); - driver->setMaterial(mat); - driver->drawMeshBuffer(sphereMesh->getMeshBuffer(0)); - - m.setTranslation(pos4); - mat.Shininess=0.f; - driver->setTransform(video::ETS_WORLD, m); - driver->setMaterial(mat); - driver->drawMeshBuffer(sphereMesh->getMeshBuffer(0)); -} - -bool rttAndAntiAliasing(video::E_DRIVER_TYPE driverType) -{ - SIrrlichtCreationParameters cp; - cp.DriverType = driverType; - cp.WindowSize = core::dimension2di(160, 120); - cp.AntiAlias = 2; - cp.Vsync = true; - - IrrlichtDevice* device = createDeviceEx(cp); - if (!device) - return true; - - video::IVideoDriver* driver = device->getVideoDriver(); - if ((driver->getDriverAttributes().getAttributeAsInt("AntiAlias")<2) || - (!driver->queryFeature(video::EVDF_RENDER_TO_TARGET))) - { - device->closeDevice(); - device->run(); - device->drop(); - return true; - } - - stabilizeScreenBackground(driver); - - logTestString("Testing driver %ls\n", driver->getName()); - - // sphere mesh - scene::IAnimatedMesh* sphereMesh = device->getSceneManager()->addSphereMesh("atom", 1, 32, 32); - - // cam - scene::ICameraSceneNode* cam = device->getSceneManager()->addCameraSceneNode(NULL, core::vector3df(0, 1, -5), core::vector3df(0, 0, 0)); - cam->setNearValue(0.01f); - cam->setFarValue(100.f); - cam->updateAbsolutePosition(); - device->getSceneManager()->setActiveCamera(cam); - device->getSceneManager()->addLightSceneNode(0, core::vector3df(10,10,10)); - device->getSceneManager()->setAmbientLight(video::SColorf(0.3f,0.3f,0.3f)); - - float radius = 3.f; - core::vector3df pos1(-radius,0,0); - core::vector3df pos2(radius,0,0); - core::vector3df pos3(0,0,radius); - core::vector3df pos4(0,0,-radius); - core::matrix4 m; - - gui::IGUIStaticText* st = device->getGUIEnvironment()->addStaticText(L"", core::recti(0,0,200,20), false, false); - st->setOverrideColor(video::SColor(255,255,255,0)); - - core::dimension2du dim_txt = core::dimension2du(160/2, 120/2); - - video::ITexture* renderTargetTex1 = driver->addRenderTargetTexture(dim_txt, "rt1", device->getColorFormat()); - video::ITexture* renderTargetTex2 = driver->addRenderTargetTexture(dim_txt, "rt2", device->getColorFormat()); - video::ITexture* renderTargetTex3 = driver->addRenderTargetTexture(dim_txt, "rt3", video::ECF_A8R8G8B8); - video::ITexture* renderTargetTex4 = driver->addRenderTargetTexture(dim_txt, "rt4", device->getColorFormat()); - video::ITexture* renderTargetDepth = driver->addRenderTargetTexture(dim_txt, "rtd", video::ECF_D16); - - video::IRenderTarget* renderTarget1 = driver->addRenderTarget(); - renderTarget1->setTexture(renderTargetTex1, renderTargetDepth); - - video::IRenderTarget* renderTarget2 = driver->addRenderTarget(); - renderTarget2->setTexture(renderTargetTex2, renderTargetDepth); - - video::IRenderTarget* renderTarget3 = driver->addRenderTarget(); - renderTarget3->setTexture(renderTargetTex3, renderTargetDepth); - - video::IRenderTarget* renderTarget4 = driver->addRenderTarget(); - renderTarget4->setTexture(renderTargetTex4, renderTargetDepth); - - device->getSceneManager()->setActiveCamera(cam); - device->getVideoDriver()->beginScene(video::ECBF_COLOR | video::ECBF_DEPTH, video::SColor(255,0,0,0)); -#if 1 - st->setText(L"Texture Rendering"); - Render(device, renderTarget1, pos1, pos2, sphereMesh, pos3, pos4); - - Render(device, renderTarget2, pos1, pos2, sphereMesh, pos3, pos4); - Render(device, renderTarget3, pos1, pos2, sphereMesh, pos3, pos4); - Render(device, renderTarget4, pos1, pos2, sphereMesh, pos3, pos4); - - device->getVideoDriver()->setRenderTargetEx(0, video::ECBF_COLOR | video::ECBF_DEPTH); - device->getVideoDriver()->draw2DImage(renderTargetTex1, core::position2di(0, 0)); - device->getVideoDriver()->draw2DImage(renderTargetTex2, core::position2di(80, 0)); - device->getVideoDriver()->draw2DImage(renderTargetTex3, core::position2di(0, 60)); - device->getVideoDriver()->draw2DImage(renderTargetTex4, core::position2di(80, 60)); -#else - ITexture* rt0 = NULL; - Render(device, rt0, pos1, pos2, sphereMesh, pos3, pos4); -#endif - st->draw(); - device->getVideoDriver()->endScene(); - - bool result = takeScreenshotAndCompareAgainstReference(driver, "-rttAndAntiAlias.png", 98.25f); - - device->closeDevice(); - device->run(); - device->drop(); - - return result; -} - -bool rttFormats(video::E_DRIVER_TYPE driverType) -{ - SIrrlichtCreationParameters cp; - cp.DriverType = driverType; - cp.WindowSize = core::dimension2di(160, 120); - - IrrlichtDevice* device = createDeviceEx(cp); - if (!device) - return true; - - video::IVideoDriver* driver = device->getVideoDriver(); - - logTestString("Testing driver %ls\n", driver->getName()); - - video::ITexture* tex = 0; - - { - tex = device->getVideoDriver()->addRenderTargetTexture(core::dimension2du(256,256), "rt", video::ECF_A1R5G5B5); - if (tex) - { - if (tex->getColorFormat() != video::ECF_A1R5G5B5) - logTestString("Format changed: ECF_A1R5G5B5 to %x\n", tex->getColorFormat()); - else - logTestString("Format supported: ECF_A1R5G5B5\n"); - driver->removeTexture(tex); - tex=0; - } - else - logTestString("Format unsupported: ECF_A1R5G5B5\n"); - } - { - tex = device->getVideoDriver()->addRenderTargetTexture(core::dimension2du(256,256), "rt", video::ECF_R5G6B5); - if (tex) - { - if (tex->getColorFormat() != video::ECF_R5G6B5) - logTestString("Format changed: ECF_R5G6B5 to %x\n", tex->getColorFormat()); - else - logTestString("Format supported: ECF_R5G6B5\n"); - driver->removeTexture(tex); - tex=0; - } - else - logTestString("Format unsupported: ECF_R5G6B5\n"); - } - { - tex = device->getVideoDriver()->addRenderTargetTexture(core::dimension2du(256,256), "rt", video::ECF_R8G8B8); - if (tex) - { - if (tex->getColorFormat() != video::ECF_R8G8B8) - logTestString("Format changed: ECF_R8G8B8 to %x\n", tex->getColorFormat()); - else - logTestString("Format supported: ECF_R8G8B8\n"); - driver->removeTexture(tex); - tex=0; - } - else - logTestString("Format unsupported: ECF_R8G8B8\n"); - } - { - tex = device->getVideoDriver()->addRenderTargetTexture(core::dimension2du(256,256), "rt", video::ECF_A8R8G8B8); - if (tex) - { - if (tex->getColorFormat() != video::ECF_A8R8G8B8) - logTestString("Format changed: ECF_A8R8G8B8 to %x\n", tex->getColorFormat()); - else - logTestString("Format supported: ECF_A8R8G8B8\n"); - driver->removeTexture(tex); - tex=0; - } - else - logTestString("Format unsupported: ECF_A8R8G8B8\n"); - } - { - tex = device->getVideoDriver()->addRenderTargetTexture(core::dimension2du(256,256), "rt", video::ECF_R16F); - if (tex) - { - if (tex->getColorFormat() != video::ECF_R16F) - logTestString("Format changed: ECF_R16F to %x\n", tex->getColorFormat()); - else - logTestString("Format supported: ECF_R16F\n"); - driver->removeTexture(tex); - tex=0; - } - else - logTestString("Format unsupported: ECF_R16F\n"); - } - { - tex = device->getVideoDriver()->addRenderTargetTexture(core::dimension2du(256,256), "rt", video::ECF_G16R16F); - if (tex) - { - if (tex->getColorFormat() != video::ECF_G16R16F) - logTestString("Format changed: ECF_G16R16F to %x\n", tex->getColorFormat()); - else - logTestString("Format supported: ECF_G16R16F\n"); - driver->removeTexture(tex); - tex=0; - } - else - logTestString("Format unsupported: ECF_G16R16F\n"); - } - { - tex = device->getVideoDriver()->addRenderTargetTexture(core::dimension2du(256,256), "rt", video::ECF_A16B16G16R16F); - if (tex) - { - if (tex->getColorFormat() != video::ECF_A16B16G16R16F) - logTestString("Format changed: ECF_A16B16G16R16F to %x\n", tex->getColorFormat()); - else - logTestString("Format supported: ECF_A16B16G16R16F\n"); - driver->removeTexture(tex); - tex=0; - } - else - logTestString("Format unsupported: ECF_A16B16G16R16F\n"); - } - { - tex = device->getVideoDriver()->addRenderTargetTexture(core::dimension2du(256,256), "rt", video::ECF_R32F); - if (tex) - { - if (tex->getColorFormat() != video::ECF_R32F) - logTestString("Format changed: ECF_R32F to %x\n", tex->getColorFormat()); - else - logTestString("Format supported: ECF_R32F\n"); - driver->removeTexture(tex); - tex=0; - } - else - logTestString("Format unsupported: ECF_R32F\n"); - } - { - tex = device->getVideoDriver()->addRenderTargetTexture(core::dimension2du(256,256), "rt", video::ECF_G32R32F); - if (tex) - { - if (tex->getColorFormat() != video::ECF_G32R32F) - logTestString("Format changed: ECF_G32R32F to %x\n", tex->getColorFormat()); - else - logTestString("Format supported: ECF_G32R32F\n"); - driver->removeTexture(tex); - tex=0; - } - else - logTestString("Format unsupported: ECF_G32R32F\n"); - } - { - tex = device->getVideoDriver()->addRenderTargetTexture(core::dimension2du(256,256), "rt", video::ECF_A32B32G32R32F); - if (tex) - { - if (tex->getColorFormat() != video::ECF_A32B32G32R32F) - logTestString("Format changed: ECF_A32B32G32R32F to %x\n", tex->getColorFormat()); - else - logTestString("Format supported: ECF_A32B32G32R32F\n"); - driver->removeTexture(tex); - tex=0; - } - else - logTestString("Format unsupported: ECF_A32B32G32R32F\n"); - } - - device->closeDevice(); - device->run(); - device->drop(); - - return true; -} - -bool renderTargetTexture(void) -{ - bool result = true; - - TestWithAllDrivers(testWith2DImage); - -#if 0 - TestWithAllDrivers(rttAndZBuffer); -#endif - - TestWithAllDrivers(rttAndAntiAliasing); - TestWithAllDrivers(rttAndText); - - logTestString("Test RTT format support\n"); - TestWithAllHWDrivers(rttFormats); - - return result; -} diff --git a/tests/sceneCollisionManager.cpp b/tests/sceneCollisionManager.cpp deleted file mode 100644 index 93bccf00..00000000 --- a/tests/sceneCollisionManager.cpp +++ /dev/null @@ -1,471 +0,0 @@ -// Copyright (C) 2008-2012 Colin MacDonald -// No rights reserved: this software is in the public domain. - -#include "testUtils.h" - -using namespace irr; -using namespace core; -using namespace scene; -using namespace video; - -static bool testGetCollisionResultPosition(IrrlichtDevice * device, - ISceneManager * smgr, - ISceneCollisionManager * collMgr) -{ - IMeshSceneNode * cubeNode = smgr->addCubeSceneNode(10.f); - ITriangleSelector * cubeSelector = smgr->createTriangleSelectorFromBoundingBox(cubeNode); - - triangle3df triOut; - vector3df hitPosition; - bool falling; - ISceneNode* hitNode; - - vector3df resultPosition = - collMgr->getCollisionResultPosition(cubeSelector, - vector3df(0, 50, 0), - vector3df(10, 20, 10), - vector3df(0, -100, 0), - triOut, - hitPosition, - falling, - hitNode); - - bool result = true; - - if(hitNode != cubeNode) - { - logTestString("Unexpected collision node\n"); - result = false; - } - - if(!equals(resultPosition.Y, 25.f, 0.01f)) - { - logTestString("Unexpected collision response position\n"); - result = false; - } - - if(!equals(hitPosition.Y, 5.f, 0.01f)) - { - logTestString("Unexpected collision position\n"); - result = false; - } - - resultPosition = - collMgr->getCollisionResultPosition(cubeSelector, - vector3df(-20, 0, 0), - vector3df(10, 20, 10), - vector3df(100, 0, 0), - triOut, - hitPosition, - falling, - hitNode); - - if(hitNode != cubeNode) - { - logTestString("Unexpected collision node\n"); - result = false; - } - - if(!equals(resultPosition.X, -15.f, 0.01f)) - { - logTestString("Unexpected collision response position\n"); - result = false; - } - - if(!equals(hitPosition.X, -5.f, 0.01f)) - { - logTestString("Unexpected collision position\n"); - result = false; - } - - assert_log(result); - - cubeSelector->drop(); - smgr->clear(); - - return result; -} - - -// Test that getCollisionPoint() actually uses the closest point, not the closest triangle. -static bool getCollisionPoint_ignoreTriangleVertices(IrrlichtDevice * device, - ISceneManager * smgr, - ISceneCollisionManager * collMgr) -{ - // Create a cube with a Z face at 5, but corners close to 0 - ISceneNode * farSmallCube = smgr->addCubeSceneNode(10, 0, -1, vector3df(0, 0, 10)); - - // Create a cube with a Z face at 0, but corners far from 0 - ISceneNode * nearBigCube = smgr->addCubeSceneNode(100, 0, -1, vector3df(0, 0, 50)); - - IMetaTriangleSelector * meta = smgr->createMetaTriangleSelector(); - - ITriangleSelector * selector = smgr->createTriangleSelectorFromBoundingBox(farSmallCube); - meta->addTriangleSelector(selector); - selector->drop(); - - // We should expect a hit on this cube - selector = smgr->createTriangleSelectorFromBoundingBox(nearBigCube); - meta->addTriangleSelector(selector); - selector->drop(); - - line3df ray(0, 0, -5, 0, 0, 100); - vector3df hitPosition; - triangle3df hitTriangle; - ISceneNode* hitNode; - - bool collision = collMgr->getCollisionPoint(ray, meta, hitPosition, hitTriangle, hitNode); - - meta->drop(); - - if(hitNode != nearBigCube) - { - logTestString("getCollisionPoint_ignoreTriangleVertices: hit the wrong node.\n"); - return false; - } - - if(!collision) - { - logTestString("getCollisionPoint_ignoreTriangleVertices: didn't get a hit.\n"); - return false; - } - - if(hitPosition != vector3df(0, 0, 0)) - { - logTestString("getCollisionPoint_ignoreTriangleVertices: unexpected hit position %f %f %f.\n", - hitPosition.X, hitPosition.Y, hitPosition.Z ); - return false; - } - - smgr->clear(); - - return true; -} - - -static bool testGetSceneNodeFromScreenCoordinatesBB(IrrlichtDevice * device, - ISceneManager * smgr, - ISceneCollisionManager * collMgr) -{ - // Create 3 nodes. The nearest node actually contains the camera. - IMeshSceneNode * cubeNode1 = smgr->addCubeSceneNode(10.f, 0, -1, vector3df(0, 0, 4)); - IMeshSceneNode * cubeNode2 = smgr->addCubeSceneNode(10.f, 0, -1, vector3df(0, 0, 30)); - cubeNode2->setRotation(vector3df(90.f, 90.f, 90.f)); // Just check that rotation doesn't stop us hitting it. - IMeshSceneNode * cubeNode3 = smgr->addCubeSceneNode(10.f, 0, -1, vector3df(0, 0, 40)); - cubeNode3->setRotation(vector3df(180.f, 180.f, 180.f)); // Just check that rotation doesn't stop us hitting it. - - smgr->addCameraSceneNode(); - device->run(); - smgr->drawAll(); // Get the camera in a good state - - ISceneNode * hitNode = collMgr->getSceneNodeFromScreenCoordinatesBB(position2d<s32>(80, 60)); - - // Expect the first node to be hit, since we're starting the check from inside it. - bool result = true; - if(hitNode != cubeNode1) - { - logTestString("Unexpected node hit. Expected cubeNode1.\n"); - result = false; - } - - // Now make cubeNode1 invisible and check that cubeNode2 is hit. - cubeNode1->setVisible(false); - hitNode = collMgr->getSceneNodeFromScreenCoordinatesBB(position2d<s32>(80, 60)); - if(hitNode != cubeNode2) - { - logTestString("Unexpected node hit. Expected cubeNode2.\n"); - result = false; - } - - // Make cubeNode1 the parent of cubeNode2. - cubeNode2->setParent(cubeNode1); - - // Check visibility. - bool visible = cubeNode2->isVisible(); - if(!visible) - { - logTestString("cubeNode2 should think that it (in isolation) is visible.\n"); - result = false; - } - - visible = cubeNode2->isTrulyVisible(); - if(visible) - { - logTestString("cubeNode2 should know that it (recursively) is invisible.\n"); - result = false; - } - - // cubeNode2 should now be an invalid target as well, and so the final cube node should be hit. - hitNode = collMgr->getSceneNodeFromScreenCoordinatesBB(position2d<s32>(80, 60)); - if(hitNode != cubeNode3) - { - logTestString("Unexpected node hit. Expected cubeNode3.\n"); - result = false; - } - - - // Now verify bitmasking - - // Test the 01010101010101010101010101010101 bitmask (0x55555555) - cubeNode1->setVisible(true); - cubeNode1->setID(0xAAAAAAAA); - hitNode = collMgr->getSceneNodeFromScreenCoordinatesBB(position2d<s32>(80, 60), 0x55555555); - if(hitNode != cubeNode2) - { - logTestString("Unexpected node hit. Expected cubeNode2.\n"); - result = false; - } - assert_log(result); - - smgr->clear(); - - return result; -} - - -static bool getScaledPickedNodeBB(IrrlichtDevice * device, - ISceneManager * smgr, - ISceneCollisionManager * collMgr) -{ - ISceneNode* farTarget = smgr->addCubeSceneNode(1.f); - farTarget->setScale(vector3df(100.f, 100.f, 10.f)); - farTarget->setPosition(vector3df(0.f, 0.f, 500.f)); - farTarget->updateAbsolutePosition(); - - // Create a node that's slightly further away than the closest node, - // but thinner. Its furthest corner is closer, but the collision - // position is further, so it should not be selected. - ISceneNode* middleTarget = smgr->addCubeSceneNode(10.f); - middleTarget->setPosition(vector3df(0.f, 0.f, 101.f)); - middleTarget->setScale(vector3df(1.f, 1.f, 0.5f)); - middleTarget->updateAbsolutePosition(); - - ISceneNode* nearTarget = smgr->addCubeSceneNode(10.f); - nearTarget->setPosition(vector3df(0.f, 0.f, 100.f)); - nearTarget->updateAbsolutePosition(); - // We'll rotate this node 90 degrees to show that we can hit its side. - nearTarget->setRotation(vector3df(0.f, 90.f, 0.f)); - - line3df ray(0.f, 0.f, 0.f, 0.f, 0.f, 500.f); - - const ISceneNode * const hit = collMgr->getSceneNodeFromRayBB(ray); - - bool result = (hit == nearTarget); - - if(hit == 0) - logTestString("getSceneNodeFromRayBB() didn't hit anything.\n"); - else if(hit == farTarget) - logTestString("getSceneNodeFromRayBB() hit the far (scaled) target.\n"); - else if(hit == middleTarget) - logTestString("getSceneNodeFromRayBB() hit the middle (scaled) target.\n"); - - assert_log(result); - - smgr->clear(); - - return result; -} - - -// box intersection according to Kay et al., code from gamedev.net -static bool IntersectBox(const core::vector3df& origin, const core::vector3df& dir, const core::aabbox3df& box) -{ - core::vector3df minDist = (box.MinEdge - origin)/dir; - core::vector3df maxDist = (box.MaxEdge - origin)/dir; - - core::vector3df realMin(core::min_(minDist.X, maxDist.X),core::min_(minDist.Y, maxDist.Y),core::min_(minDist.Z, maxDist.Z)); - core::vector3df realMax(core::max_(minDist.X, maxDist.X),core::max_(minDist.Y, maxDist.Y),core::max_(minDist.Z, maxDist.Z)); - - f32 minmax = core::min_(realMax.X, realMax.Y, realMax.Z); - // nearest distance to intersection - f32 maxmin = core::max_(realMin.X, realMin.Y, realMin.Z); - - return (maxmin >=0 && minmax >= maxmin); -} - -static bool checkBBoxIntersection(IrrlichtDevice * device, - ISceneManager * smgr) -{ - video::IVideoDriver* driver = device->getVideoDriver(); - - // add camera - scene::ICameraSceneNode* camera = smgr->addCameraSceneNode(); - camera->setPosition(core::vector3df(30, 30, 30)); - camera->setTarget(core::vector3df(8.f, 8.f, 8.f)); - camera->setID(0); - - // add a cube to pick - scene::ISceneNode* cube = smgr->addCubeSceneNode(30, 0, -1, core::vector3df(0,0,0),core::vector3df(30,40,50)); - - bool result=true; - for (u32 round=0; round<2; ++round) - { - driver->beginScene(video::ECBF_COLOR | video::ECBF_DEPTH, video::SColor(100, 50, 50, 100)); - smgr->drawAll(); - driver->endScene(); - - core::matrix4 invMat = cube->getAbsoluteTransformation(); - invMat.makeInverse(); - - s32 hits=0; - u32 start = device->getTimer()->getRealTime(); - for (u32 i=10; i<150; ++i) - { - for (u32 j=10; j<110; ++j) - { - const core::position2di pos(i, j); - - // get the line used for picking - core::line3df ray = smgr->getSceneCollisionManager()->getRayFromScreenCoordinates(pos, camera); - - invMat.transformVect(ray.start); - invMat.transformVect(ray.end); - - hits += (cube->getBoundingBox().intersectsWithLine(ray)?1:0); - } - } - u32 duration = device->getTimer()->getRealTime()-start; - logTestString("bbox intersection checks %d hits (of 14000).\n", hits); - hits = -hits; - - start = device->getTimer()->getRealTime(); - for (u32 i=10; i<150; ++i) - { - for (u32 j=10; j<110; ++j) - { - const core::position2di pos(i, j); - - // get the line used for picking - core::line3df ray = smgr->getSceneCollisionManager()->getRayFromScreenCoordinates(pos, camera); - - invMat.transformVect(ray.start); - invMat.transformVect(ray.end); - - hits += (IntersectBox(ray.start, (ray.end-ray.start).normalize(), cube->getBoundingBox())?1:0); - } - } - u32 duration2 = device->getTimer()->getRealTime()-start; - logTestString("bbox intersection resulted in %d misses at a speed of %d (old) compared to %d (new).\n", abs(hits), duration, duration2); - if (duration>(duration2*1.2f)) - logTestString("Consider replacement of bbox intersection test.\n"); - - result &= (hits==0); - assert_log(result); - // second round without any hits, so check opposite direction - camera->setTarget(core::vector3df(80.f, 80.f, 80.f)); - } - - ISceneNode* node = smgr->addSphereSceneNode(5.f, 16, 0, -1, core::vector3df(0, 0, 1), core::vector3df(), core::vector3df(0.3f, 0.3f, 0.3f)); - cube->remove(); - cube = smgr->addCubeSceneNode(10.f, 0, -1, core::vector3df(0, 6.5f, 1), core::vector3df(), core::vector3df(10, 0.1f, 1.f)); - camera->setPosition(core::vector3df(0, 0, 10)); - camera->setTarget(core::vector3df()); - - u32 count=0; - for (u32 i=0; i<30; ++i) - { - driver->beginScene(video::ECBF_COLOR | video::ECBF_DEPTH, video::SColor(100, 50, 50, 100)); - smgr->drawAll(); - driver->endScene(); - - count += node->getTransformedBoundingBox().intersectsWithBox(cube->getTransformedBoundingBox())?1:0; - node->setPosition(node->getPosition()+core::vector3df(.5f,.5f,0)); - if (i==8 && count != 0) - result=false; - if (i==17 && count != 9) - result=false; - } - if (count != 9) - result=false; - - smgr->clear(); - - return result; -} - - -static bool compareGetSceneNodeFromRayBBWithBBIntersectsWithLine(IrrlichtDevice * device, - ISceneManager * smgr, - ISceneCollisionManager * collMgr) -{ - video::IVideoDriver* driver = device->getVideoDriver(); - - // add camera - scene::ICameraSceneNode* camera = smgr->addCameraSceneNodeFPS(); - camera->setPosition(core::vector3df(30, 30, 30)); - camera->setTarget(core::vector3df(-8.f, 8.f, -8.f)); - camera->setID(0); - - // add a dynamic light (this causes weirdness) - smgr->addLightSceneNode(0, core::vector3df(4, 4, 4), video::SColorf(.2f, .3f, .2f)); - - // add a cube to pick - scene::ISceneNode* cube = smgr->addCubeSceneNode(15); - - driver->beginScene(video::ECBF_COLOR | video::ECBF_DEPTH, video::SColor(100, 50, 50, 100)); - smgr->drawAll(); - driver->endScene(); - - core::matrix4 invMat = cube->getAbsoluteTransformation(); - invMat.makeInverse(); - - bool result = true; - for (u32 i=76; i<82; ++i) - { - for (u32 j=56; j<64; ++j) - { - const core::position2di pos(i, j); - - // get the line used for picking - core::line3df ray = smgr->getSceneCollisionManager()->getRayFromScreenCoordinates(pos, camera); - - // find a selected node - scene::ISceneNode* pick = smgr->getSceneCollisionManager()->getSceneNodeFromRayBB(ray, 1); - - invMat.transformVect(ray.start); - invMat.transformVect(ray.end); - - const int a_hit = (pick == cube); - const int b_hit = cube->getBoundingBox().intersectsWithLine(ray); - result = (a_hit==b_hit); - } - } - - assert_log(result); - - smgr->clear(); - - return result; -} - - -/** Test functionality of the sceneCollisionManager */ -bool sceneCollisionManager(void) -{ - IrrlichtDevice * device = irr::createDevice(video::EDT_NULL, dimension2d<u32>(160, 120)); - assert_log(device); - if(!device) - return false; - - ISceneManager * smgr = device->getSceneManager(); - ISceneCollisionManager * collMgr = smgr->getSceneCollisionManager(); - - bool result = testGetCollisionResultPosition(device, smgr, collMgr); - - smgr->clear(); - - result &= testGetSceneNodeFromScreenCoordinatesBB(device, smgr, collMgr); - - result &= getScaledPickedNodeBB(device, smgr, collMgr); - - result &= getCollisionPoint_ignoreTriangleVertices(device, smgr, collMgr); - - result &= checkBBoxIntersection(device, smgr); - - result &= compareGetSceneNodeFromRayBBWithBBIntersectsWithLine(device, smgr, collMgr); - - device->closeDevice(); - device->run(); - device->drop(); - return result; -} diff --git a/tests/sceneNodeAnimator.cpp b/tests/sceneNodeAnimator.cpp deleted file mode 100644 index 1016f4e4..00000000 --- a/tests/sceneNodeAnimator.cpp +++ /dev/null @@ -1,117 +0,0 @@ -// Copyright (C) 2008-2012 Colin MacDonald -// No rights reserved: this software is in the public domain. - -#include "testUtils.h" - -using namespace irr; -using namespace core; -using namespace scene; - -/** Test functionality of the ISceneNodeAnimator implementations. */ -bool sceneNodeAnimator(void) -{ - IrrlichtDevice * device = irr::createDevice(video::EDT_NULL, dimension2d<u32>(160, 120)); - assert_log(device); - if(!device) - return false; - - ISceneManager * smgr = device->getSceneManager(); - - // Test the hasFinished() method. - ISceneNodeAnimatorCollisionResponse* collisionResponseAnimator - = smgr->createCollisionResponseAnimator(0, 0); - - ISceneNodeAnimator* deleteAnimator = smgr->createDeleteAnimator(1); - - ISceneNodeAnimator* flyCircleAnimator = smgr->createFlyCircleAnimator(); - - ISceneNodeAnimator* flyStraightAnimator - = smgr->createFlyStraightAnimator(vector3df(0, 0, 0), vector3df(0, 0, 0), 1, false); - - ISceneNodeAnimator* flyStraightAnimatorLooping - = smgr->createFlyStraightAnimator(vector3df(0, 0, 0), vector3df(0, 0, 0), 1, true); - - ISceneNodeAnimator* rotationAnimator = smgr->createRotationAnimator(vector3df(0, 0, 0)); - - array<vector3df> points; - points.push_back(vector3df(0, 0, 0)); - points.push_back(vector3df(0, 0, 0)); - ISceneNodeAnimator* followSplineAnimator = smgr->createFollowSplineAnimator(0, points, 1000.f); - - array<video::ITexture*> textures; - textures.push_back(0); - textures.push_back(0); - - ISceneNodeAnimator* textureAnimator = smgr->createTextureAnimator(textures, 1, false); - ISceneNodeAnimator* textureAnimatorLooping = smgr->createTextureAnimator(textures, 1, true); - - bool result = true; - - ISceneNode * deletedNode = smgr->addEmptySceneNode(); - deletedNode->addAnimator(deleteAnimator); - - ISceneNode * testNode = smgr->addEmptySceneNode(); - testNode->addAnimator(collisionResponseAnimator); - testNode->addAnimator(deleteAnimator); - testNode->addAnimator(flyCircleAnimator); - testNode->addAnimator(flyStraightAnimator); - testNode->addAnimator(flyStraightAnimatorLooping); - testNode->addAnimator(rotationAnimator); - testNode->addAnimator(followSplineAnimator); - testNode->addAnimator(textureAnimator); - testNode->addAnimator(textureAnimatorLooping); - - result &= !collisionResponseAnimator->hasFinished(); - result &= !deleteAnimator->hasFinished(); - result &= !flyCircleAnimator->hasFinished(); - result &= !flyStraightAnimator->hasFinished(); - result &= !flyStraightAnimatorLooping->hasFinished(); - result &= !rotationAnimator->hasFinished(); - result &= !followSplineAnimator->hasFinished(); - result &= !textureAnimator->hasFinished(); - result &= !textureAnimatorLooping->hasFinished(); - - device->run(); - device->sleep(10); - device->run(); - smgr->drawAll(); - - // These animators don't have an endpoint. - result &= !collisionResponseAnimator->hasFinished(); - result &= !flyCircleAnimator->hasFinished(); - result &= !rotationAnimator->hasFinished(); - result &= !followSplineAnimator->hasFinished(); - - // These animators are looping and so can't finish. - result &= !flyStraightAnimatorLooping->hasFinished(); - result &= !textureAnimatorLooping->hasFinished(); - - // These have an endpoint and have reached it. - result &= deleteAnimator->hasFinished(); - result &= flyStraightAnimator->hasFinished(); - result &= textureAnimator->hasFinished(); - - collisionResponseAnimator->drop(); - deleteAnimator->drop(); - flyCircleAnimator->drop(); - flyStraightAnimator->drop(); - flyStraightAnimatorLooping->drop(); - rotationAnimator->drop(); - followSplineAnimator->drop(); - textureAnimator->drop(); - textureAnimatorLooping->drop(); - - device->closeDevice(); - device->run(); - device->drop(); - - if(!result) - { - logTestString("One or more animators has a bad hasFinished() state\n."); - assert_log(false); - } - - return result; -} - - diff --git a/tests/screenshot.cpp b/tests/screenshot.cpp deleted file mode 100644 index 51f31489..00000000 --- a/tests/screenshot.cpp +++ /dev/null @@ -1,83 +0,0 @@ -// Copyright (C) 2008-2012 Colin MacDonald -// No rights reserved: this software is in the public domain. - -#include "testUtils.h" - -using namespace irr; - - - -// Tests screenshots features -bool testShots(video::E_DRIVER_TYPE type) -{ - IrrlichtDevice *device = createDevice(type, core::dimension2d<u32>(160, 120), 32); - if (!device) - return true; - - video::IVideoDriver* driver = device->getVideoDriver(); - scene::ISceneManager * smgr = device->getSceneManager(); - - logTestString("Testing driver %ls\n", driver->getName()); - - scene::IAnimatedMesh* mesh = smgr->getMesh("../media/sydney.md2"); - scene::IAnimatedMeshSceneNode* node; - - if (!mesh) - return false; - node = smgr->addAnimatedMeshSceneNode(mesh); - if (!node) - return false; - - stabilizeScreenBackground(driver); - - node->setPosition(core::vector3df(20, 0, 30)); - node->setMaterialFlag(video::EMF_LIGHTING, false); - node->setMaterialTexture(0, driver->getTexture("../media/sydney.bmp")); - node->setLoopMode(false); - - smgr->addCameraSceneNode(); - - node->setMD2Animation(scene::EMAT_DEATH_FALLBACK); - node->setCurrentFrame((f32)(node->getEndFrame())); - node->setAnimationSpeed(0); - - device->run(); - driver->beginScene(video::ECBF_COLOR | video::ECBF_DEPTH, video::SColor(255, 255, 255, 0)); - smgr->drawAll(); - driver->endScene(); - - for (s32 i=0; i<video::ECF_UNKNOWN; ++i) - { - video::IImage* img = driver->createScreenShot((video::ECOLOR_FORMAT)i); - logTestString("Color Format %d %ssupported\n", i, (img && img->getColorFormat() == i)?"":"un"); - -#if 0 // Enable for a quick check while testing. - // If someone adds comparison images please use another scene without animation - // and maybe a texture using the full color spectrum. - if ( img ) - { - irr::core::stringc screenshotFilename = "results/"; - screenshotFilename += shortDriverName(driver); - screenshotFilename += "screenshot"; - screenshotFilename += core::stringc(i); - screenshotFilename += ".png"; - driver->writeImageToFile(img, screenshotFilename.c_str()); - } -#endif - - if (img) - img->drop(); - } - device->closeDevice(); - device->run(); - device->drop(); - - return true; -} - -bool screenshot() -{ - bool result = true; - TestWithAllHWDrivers(testShots); - return result; -} diff --git a/tests/serializeAttributes.cpp b/tests/serializeAttributes.cpp deleted file mode 100644 index 220666ac..00000000 --- a/tests/serializeAttributes.cpp +++ /dev/null @@ -1,378 +0,0 @@ -#include "testUtils.h" - -using namespace irr; -using namespace core; -using namespace io; - -#define COMPARE(a, b) if ( (a) != (b) ) { logTestString("Not identical %s in %s:%d\n", #a, __FILE__, __LINE__ ); return false; } - -const u32 BINARY_BLOCK_SIZE = 10; - -enum EMockEnum -{ - EME_NONE, - EME_ONE, - EME_COUNT -}; - -const c8* const MockEnumNames[EME_COUNT+1] = -{ - "none", - "one", - 0, -}; - -class SerializableMock : public virtual io::IAttributeExchangingObject -{ -public: - SerializableMock(bool comparePointers=true) : ComparePointers(comparePointers) - { - } - - virtual void serializeAttributes(io::IAttributes* out, io::SAttributeReadWriteOptions* options) const - { - out->addInt("ValInt", ValInt); - out->addFloat("ValFloat", ValFloat); - out->addString("ValString", ValString.c_str()); - out->addString("ValStringW", ValStringW.c_str()); - out->addBinary("ValBinary", (void*)ValBinary, BINARY_BLOCK_SIZE); - out->addArray("ValStringWArray", ValStringWArray); - out->addBool("ValBool", ValBool); - out->addEnum("ValEnum", ValEnum, MockEnumNames); - out->addColor("ValColor", ValColor); - out->addColorf("ValColorf", ValColorf); - out->addVector3d("ValVector3df", ValVector3df); - out->addVector2d("ValVector2df", ValVector2df); - out->addDimension2d("ValDimension2du", ValDimension2du); - out->addPosition2d("ValPosition2di", ValPosition2di); - out->addRect("ValRect", ValRect); - out->addMatrix("ValMatrix", ValMatrix); - out->addQuaternion("ValQuaternion", ValQuaternion); - out->addBox3d("ValAabbox3df", ValAabbox3df); - out->addPlane3d("ValPlane3df", ValPlane3df); - out->addTriangle3d("ValTriangle3df", ValTriangle3df); - out->addLine2d("ValLine2df", ValLine2df); - out->addLine3d("ValLine3df", ValLine3df); - out->addTexture("ValTexture", ValTexture ); - out->addUserPointer("ValPointer", ValPointer); - } - - virtual void deserializeAttributes(io::IAttributes* in, io::SAttributeReadWriteOptions* options) - { - ValInt = in->getAttributeAsInt("ValInt"); - ValFloat = in->getAttributeAsFloat("ValFloat"); - ValString = in->getAttributeAsString("ValString"); - ValStringW = in->getAttributeAsStringW("ValStringW"); - in->getAttributeAsBinaryData("ValBinary", ValBinary, BINARY_BLOCK_SIZE); - ValStringWArray = in->getAttributeAsArray("ValStringWArray"); - ValBool = in->getAttributeAsBool("ValBool"); - ValEnum = (EMockEnum)in->getAttributeAsEnumeration("ValEnum", MockEnumNames); - ValColor = in->getAttributeAsColor("ValColor"); - ValColorf = in->getAttributeAsColorf("ValColorf"); - ValVector3df = in->getAttributeAsVector3d("ValVector3df"); - ValVector2df = in->getAttributeAsVector2d("ValVector2df"); - ValDimension2du = in->getAttributeAsDimension2d("ValDimension2du"); - ValPosition2di = in->getAttributeAsPosition2d("ValPosition2di"); - ValRect = in->getAttributeAsRect("ValRect"); - ValMatrix = in->getAttributeAsMatrix("ValMatrix"); - ValQuaternion = in->getAttributeAsQuaternion("ValQuaternion"); - ValAabbox3df = in->getAttributeAsBox3d("ValAabbox3df"); - ValPlane3df = in->getAttributeAsPlane3d("ValPlane3df"); - ValTriangle3df = in->getAttributeAsTriangle3d("ValTriangle3df"); - ValLine2df = in->getAttributeAsLine2d("ValLine2df"); - ValLine3df = in->getAttributeAsLine3d("ValLine3df"); - ValTexture = in->getAttributeAsTexture("ValTexture"); - ValPointer = in->getAttributeAsUserPointer("ValPointer"); - } - - bool operator==(const SerializableMock& other) - { - COMPARE(ValInt, other.ValInt); - COMPARE(ValFloat, other.ValFloat); - COMPARE(ValString, other.ValString); - COMPARE(ValStringW, other.ValStringW); - if ( memcmp( ValBinary, other.ValBinary, BINARY_BLOCK_SIZE) != 0 ) - { - logTestString("Not identical %s in %s:%d", "ValBinary", __FILE__, __LINE__ ); - return false; - } - COMPARE(ValStringWArray, other.ValStringWArray); - COMPARE(ValBool, other.ValBool); - COMPARE(ValEnum, other.ValEnum); - COMPARE(ValColor, other.ValColor); - if ( ValColorf.r != other.ValColorf.r || ValColorf.g != other.ValColorf.g || ValColorf.b != other.ValColorf.b || ValColorf.a != other.ValColorf.a ) - { - logTestString("Not identical %s in %s:%d", "ValColorf", __FILE__, __LINE__ ); - return false; - } - COMPARE(ValVector3df, other.ValVector3df); - COMPARE(ValVector2df, other.ValVector2df); - COMPARE(ValDimension2du, other.ValDimension2du); - COMPARE(ValPosition2di, other.ValPosition2di); - COMPARE(ValRect, other.ValRect); - COMPARE(ValMatrix, other.ValMatrix); - COMPARE(ValQuaternion, other.ValQuaternion); - COMPARE(ValAabbox3df, other.ValAabbox3df); - COMPARE(ValPlane3df, other.ValPlane3df); - COMPARE(ValTriangle3df, other.ValTriangle3df); - COMPARE(ValLine2df, other.ValLine2df); - COMPARE(ValLine3df, other.ValLine3df); -// ValTexture; // TODO - if ( ComparePointers ) - COMPARE(ValPointer, other.ValPointer); - return true; - } - - void reset() - { - ValInt = 0; - ValFloat = 0.f; - ValString = ""; - ValStringW = L""; - memset(ValBinary, 0, BINARY_BLOCK_SIZE); - ValStringWArray.clear(); - ValBool = false; - ValEnum = EME_NONE; - ValColor.set(0,0,0,0); - ValColorf.set(0.f, 0.f, 0.f, 0.f); - ValVector3df.set(0.f, 0.f, 0.f); - ValVector2df.set(0.f, 0.f); - ValDimension2du.set(0, 0); - ValPosition2di.set(0,0); - ValRect = core::rect<s32>(0,0,0,0); - ValMatrix.makeIdentity(); - ValQuaternion.set(0,0,0,0); - ValAabbox3df.reset(0,0,0); - ValPlane3df.setPlane(vector3df(0.f,0.f,0.f), 0.f); - ValTriangle3df.set( vector3df(0.f,0.f,0.f), vector3df(0.f,0.f,0.f), vector3df(0.f,0.f,0.f) ); - ValLine2df.setLine(0.f, 0.f, 0.f, 0.f); - ValLine3df.setLine(0.f, 0.f, 0.f, 0.f, 0.f, 0.f); - ValTexture = NULL; - ValPointer = 0; - } - - void set() - { - ValInt = 152722522; - ValFloat = 1.f; - ValString = "one"; - ValStringW = L"ONE"; - memset(ValBinary, 0xff, BINARY_BLOCK_SIZE); - ValStringWArray.push_back( stringw("ONE") ); - ValStringWArray.push_back( stringw("TWO") ); - ValStringWArray.push_back( stringw("THREE") ); - ValBool = true; - ValEnum = EME_ONE; - ValColor.set(1,2,3,4); - ValColorf.set(1.f, 2.f, 3.f, 4.f); - ValVector3df.set(1.f, 2.f, 3.f); - ValVector2df.set(1.f, 2.f); - ValDimension2du.set(1, 2); - ValPosition2di.set(1,2); - ValRect = core::rect<s32>(1,2,3,4); - ValMatrix = 99.9f; - ValQuaternion.set(1,2,3,4); - ValAabbox3df.reset(1,2,3); - ValPlane3df.setPlane(vector3df(1.f,2.f,3.f), 4.f); - ValTriangle3df.set( vector3df(1.f,2.f,3.f), vector3df(4.f,5.f,6.f), vector3df(7.f,8.f,9.f) ); - ValLine2df.setLine(1.f, 2.f, 3.f, 4.f); - ValLine3df.setLine(1.f, 2.f, 3.f, 4.f, 5.f, 6.f); - ValTexture = NULL; // TODO - ValPointer = (void*)0xffffff; - } - - s32 ValInt; - f32 ValFloat; - core::stringc ValString; - core::stringw ValStringW; - char ValBinary[BINARY_BLOCK_SIZE]; - core::array<core::stringw> ValStringWArray; - bool ValBool; - EMockEnum ValEnum; - video::SColor ValColor; - video::SColorf ValColorf; - core::vector3df ValVector3df; - core::vector2df ValVector2df; - core::dimension2du ValDimension2du; - core::position2di ValPosition2di; - core::rect<s32> ValRect; - core::matrix4 ValMatrix; - core::quaternion ValQuaternion; - core::aabbox3df ValAabbox3df; - core::plane3df ValPlane3df; - core::triangle3df ValTriangle3df; - core::line2df ValLine2df; - core::line3df ValLine3df; - video::ITexture* ValTexture; - void* ValPointer; - - bool ComparePointers; -}; - -// Serialization in memory -bool MemorySerialization(io::IFileSystem * fs ) -{ - SerializableMock origMock, copyMock; - origMock.set(); - copyMock.reset(); - - io::IAttributes* attr = fs->createEmptyAttributes(); - origMock.serializeAttributes(attr, 0); - copyMock.deserializeAttributes(attr, 0); - attr->drop(); - - return origMock == copyMock; -} - -// Serialization to/from an xml-file -bool XmlSerialization(io::IFileSystem * fs, video::IVideoDriver * driver ) -{ - const io::path XML_FILENAME("results/attributeSerialization.xml"); - SerializableMock origMock(false), copyMock; - origMock.set(); - copyMock.reset(); - - // write to xml - io::IWriteFile* fileWrite = fs->createAndWriteFile(XML_FILENAME); - if (!fileWrite) - { - logTestString("Could not create xml in %s:%d\n", __FILE__, __LINE__ ); - return false; - } - io::IXMLWriter* writer = fs->createXMLWriter(fileWrite); - if (!writer) - { - logTestString("Could not create xml-writer in %s:%d\n", __FILE__, __LINE__ ); - return false; - } - writer->writeXMLHeader(); - writer->writeLineBreak(); - io::IAttributes* attrToXml = fs->createEmptyAttributes(); - origMock.serializeAttributes(attrToXml, 0); - attrToXml->write(writer); - attrToXml->drop(); - writer->writeLineBreak(); - writer->drop(); - fileWrite->drop(); - - // read from xml - io::IReadFile* fileRead = fs->createAndOpenFile(XML_FILENAME); - if (!fileRead) - { - logTestString("Could not open xml-file in %s:%d\n", __FILE__, __LINE__ ); - return false; - } - io::IXMLReader* reader = fs->createXMLReader(fileRead); - if (!reader) - { - logTestString("createXMLReader failed in %s:%d\n", __FILE__, __LINE__ ); - return false; - } - while(reader->read()) - { - switch (reader->getNodeType()) - { - case EXN_ELEMENT: - { - // read attributes - io::IAttributes* attr = fs->createEmptyAttributes(driver); - if ( attr->read(reader, true) ) - { - copyMock.deserializeAttributes(attr, 0); - } - else - { - logTestString("attr->read failed in %s:%d\n", __FILE__, __LINE__ ); - } - attr->drop(); - } - break; - default: - break; - } - } - reader->drop(); - fileRead->drop(); - - return origMock == copyMock; -} - -// All attributes can also be read/written in string format -bool stringSerialization(io::IFileSystem * fs) -{ - SerializableMock mock; - mock.set(); - - io::IAttributes* attr = fs->createEmptyAttributes(); - mock.serializeAttributes(attr, 0); - - for ( s32 i=0; i< (s32)attr->getAttributeCount(); ++i ) - { - core::stringw value(attr->getAttributeAsString(i)); - attr->setAttribute(i, value.c_str() ); - core::stringw value2(attr->getAttributeAsString(i)); - - if ( value != value2 ) - { - logTestString("old-string: %s new-string: %s for %d.%s in %s:%d\n" - , core::stringc(value).c_str(), core::stringc(value2).c_str(), i, attr->getAttributeName(i), __FILE__, __LINE__ ); - return false; - } - else - { - // TODO: We can't catch yet if getAttributeAsString and setAttribute both change nothing - // Except if string returned is empty - which would be fine in some cases (0 pointers or if string was empty originally) - // But right now at least stringw arrays don't do stringSerialization which is a bug - //if ( value.empty() ) - //return false; - } - - } - - attr->drop(); - - return true; -} - -bool serializeAttributes() -{ - bool result = true; - - IrrlichtDevice * device = irr::createDevice(video::EDT_NULL, dimension2d<u32>(1, 1)); - assert(device); - if(!device) - { - logTestString("device creation failed in %s:%d\n", __FILE__, __LINE__ ); - return false; - } - - io::IFileSystem * fs = device->getFileSystem (); - if ( !fs ) - { - return false; - } - - result &= MemorySerialization(fs); - if ( !result ) - { - logTestString("MemorySerialization failed in %s:%d\n", __FILE__, __LINE__ ); - } - - result &= XmlSerialization(fs, device->getVideoDriver()); - if ( !result ) - { - logTestString("XmlSerialization failed in %s:%d\n", __FILE__, __LINE__ ); - } - - result &= stringSerialization(fs); - if ( !result ) - { - logTestString("stringSerialization failed in %s:%d\n", __FILE__, __LINE__ ); - } - - device->closeDevice(); - device->run(); - device->drop(); - - return result; -} diff --git a/tests/skinnedMesh.cpp b/tests/skinnedMesh.cpp deleted file mode 100644 index 68bb6186..00000000 --- a/tests/skinnedMesh.cpp +++ /dev/null @@ -1,75 +0,0 @@ -// Copyright (C) 2008-2012 Colin MacDonald -// No rights reserved: this software is in the public domain. - -#include "testUtils.h" - -using namespace irr; - -// Tests skinned meshes. -bool skinnedMesh(void) -{ - // Use EDT_BURNINGSVIDEO since it is not dependent on (e.g.) OpenGL driver versions. - IrrlichtDevice *device = createDevice(video::EDT_BURNINGSVIDEO, core::dimension2d<u32>(160, 120), 32); - if (!device) - return false; - - scene::ISceneManager * smgr = device->getSceneManager(); - - logTestString("Testing setMesh()\n"); - - scene::ISkinnedMesh* mesh = (scene::ISkinnedMesh*)smgr->getMesh("../media/ninja.b3d"); - if (!mesh) - { - logTestString("Could not load ninja.\n"); - return false; - } - - scene::IAnimatedMeshSceneNode* node = smgr->addAnimatedMeshSceneNode(mesh); - if (!node) - { - logTestString("Could not add ninja node.\n"); - return false; - } - - // test if certain joint is found - bool result = (node->getJointNode("Joint1") != 0); - if (!result) - logTestString("Could not find joint in ninja.\n"); - - mesh = (scene::ISkinnedMesh*)smgr->getMesh("../media/dwarf.x"); - if (!mesh) - { - logTestString("Could not load dwarf.\n"); - return false; - } - node->setMesh(mesh); - - // make sure old joint is non-existant anymore - logTestString("Ignore error message in log, this is intended.\n"); - result &= (node->getJointNode("Joint1")==0); - if (!result) - logTestString("Found non-existing joint in dwarf.\n"); - - // and check that a new joint can be found - // we use a late one, in order to see also inconsistencies in the joint cache - result &= (node->getJointNode("hit") != 0); - if (!result) - logTestString("Could not find joint in dwarf.\n"); - - node = smgr->addAnimatedMeshSceneNode(mesh); - if (!node) - { - logTestString("Could not add dwarf node.\n"); - return false; - } - // check that a joint can really be found - result &= (node->getJointNode("hit") != 0); - if (!result) - logTestString("Could not find joint in dwarf.\n"); - - device->closeDevice(); - device->run(); - device->drop(); - - return result; -} diff --git a/tests/softwareDevice.cpp b/tests/softwareDevice.cpp deleted file mode 100644 index e9bace12..00000000 --- a/tests/softwareDevice.cpp +++ /dev/null @@ -1,56 +0,0 @@ -// Copyright (C) 2008-2012 Colin MacDonald -// No rights reserved: this software is in the public domain. - -#include "testUtils.h" - -using namespace irr; -using namespace core; -using namespace scene; - -//! Tests the basic functionality of the software device. -bool softwareDevice(void) -{ - IrrlichtDevice *device = createDevice(video::EDT_SOFTWARE, dimension2d<u32>(160, 120), 32); - if (!device) - return false; - - video::IVideoDriver* driver = device->getVideoDriver(); - ISceneManager * smgr = device->getSceneManager(); - - // Test a particular rotation that highlighted a clipping issue from matrix::transformPlane() - video::S3DVertex vertices[3]; - vertices[0] = video::S3DVertex(10,0,-10, 1,0,0, - video::SColor(255,255,0,255), 1, 1); - vertices[1] = video::S3DVertex(0,20,0, 0,1,1, - video::SColor(255,255,255,0), 1, 0); - vertices[2] = video::S3DVertex(-10,0,-10, 0,0,1, - video::SColor(255,0,255,0), 0, 0); - - video::SMaterial material; - material.Lighting = false; - material.Wireframe = false; - const u16 indices[] = { 1,0,2, }; - - matrix4 transform(matrix4::EM4CONST_IDENTITY); - vector3df rotations(290, 0, 290); // <-- This rotation used to clip the triangle incorrectly - transform.setRotationDegrees(rotations); - - (void)smgr->addCameraSceneNode(0, core::vector3df(0,0,-40), core::vector3df(0,0,0)); - - driver->beginScene(video::ECBF_COLOR | video::ECBF_DEPTH, video::SColor(255,255,255,0)); - smgr->drawAll(); - - driver->setMaterial(material); - - driver->setTransform(video::ETS_WORLD, transform); - driver->drawIndexedTriangleList(&vertices[0], 3, &indices[0], 1); - driver->endScene(); - - bool result = takeScreenshotAndCompareAgainstReference(driver, "-softwareDevice-rotatedClip.png"); - - device->closeDevice(); - device->run(); - device->drop(); - - return result; -} diff --git a/tests/stencilshadow.cpp b/tests/stencilshadow.cpp deleted file mode 100644 index 4e7f3e3f..00000000 --- a/tests/stencilshadow.cpp +++ /dev/null @@ -1,108 +0,0 @@ -// Copyright (C) 2008-2012 Christian Stehno, Colin MacDonald -// No rights reserved: this software is in the public domain. - -#include "testUtils.h" - -using namespace irr; - -// -static bool stencilShadow(video::E_DRIVER_TYPE driverType) -{ - IrrlichtDevice *device = createDevice (driverType, core::dimension2d<u32>(160,120), 16, false, true); - if (!device) - return true; // No error if device does not exist - - stabilizeScreenBackground(device->getVideoDriver()); - - scene::ICameraSceneNode* cam = device->getSceneManager()->addCameraSceneNodeFPS(); - cam->setPosition(core::vector3df(-15,60,40)); - cam->setTarget(core::vector3df(+25,-5,-25)); - - device->getSceneManager()->setAmbientLight(video::SColorf(.5f,.5f,.5f)); - device->getSceneManager()->setShadowColor( video::SColor(255, 50, 0, 50)); - device->getSceneManager()->addCubeSceneNode(100, 0, -1, core::vector3df(0,50,0), core::vector3df(), core::vector3df(-1,-1,-1)); - - scene::IAnimatedMeshSceneNode* node = device->getSceneManager()->addAnimatedMeshSceneNode(device->getSceneManager()->getMesh("../media/ninja.b3d"), 0, -1, core::vector3df(), core::vector3df(0.f, 230.f, 0.f),core::vector3df(5,5,5)); - node->setMaterialFlag(video::EMF_NORMALIZE_NORMALS, true); - node->addShadowVolumeSceneNode(0, -1, true, 200.f); - node->setAnimationSpeed(0.f); - - scene::IMeshSceneNode* cube2 = device->getSceneManager()->addCubeSceneNode(10, 0, -1, core::vector3df(40,0,0), core::vector3df(), core::vector3df(1,1,2.5f)); - cube2->getMaterial(0).DiffuseColor = video::SColor(220, 0, 100, 100); - cube2->addShadowVolumeSceneNode(0, -1, false, 200.f); - - scene::ILightSceneNode* light = device->getSceneManager()->addLightSceneNode(0, core::vector3df(-40,10,20)); - light->setLightType(video::ELT_POINT); - light->setRadius(500.f); - light->getLightData().DiffuseColor.set(1,1,1); - - device->getVideoDriver()->beginScene(video::ECBF_ALL, video::SColor(0,0,0,0)); - device->getSceneManager()->drawAll(); - device->getVideoDriver()->endScene(); - - bool result = takeScreenshotAndCompareAgainstReference(device->getVideoDriver(), "-stencilShadow.png", 99.91f); - - device->closeDevice(); - device->run(); - device->drop(); - - return result; -} - -// test self-shadowing -static bool selfShadowing(video::E_DRIVER_TYPE driverType) -{ - IrrlichtDevice *device = createDevice (driverType, core::dimension2d<u32>(160,120), 16, false, true); - if (!device) - return true; // No error if device does not exist - - stabilizeScreenBackground(device->getVideoDriver()); - - device->getSceneManager()->setAmbientLight(video::SColorf(.5f,.5f,.5f)); - device->getSceneManager()->setShadowColor( video::SColor(220, 50, 0, 0)); - - scene::IAnimatedMeshSceneNode* node = device->getSceneManager()->addAnimatedMeshSceneNode(device->getSceneManager()->getMesh("../media/dwarf.x")); - node->setMaterialFlag(video::EMF_NORMALIZE_NORMALS, true); - node->addShadowVolumeSceneNode(); - node->setAnimationSpeed(0.f); - - scene::ICameraSceneNode* cam = device->getSceneManager()->addCameraSceneNodeFPS(); - cam->setPosition(core::vector3df(0,55,-30)); - cam->setTarget(core::vector3df(60,45,150)); - - scene::ILightSceneNode* light = device->getSceneManager()->addLightSceneNode(0, core::vector3df(100,100,-20)); - light->setLightType(video::ELT_POINT); - light->setRadius(500.f); - light->getLightData().DiffuseColor.set(0,1,1); - - device->getVideoDriver()->beginScene(video::ECBF_ALL, video::SColor(0,0,0,0)); - device->getSceneManager()->drawAll(); - device->getVideoDriver()->endScene(); - - bool result = takeScreenshotAndCompareAgainstReference(device->getVideoDriver(), "-stencilSelfShadow.png", 99.41f); - - device->closeDevice(); - device->run(); - device->drop(); - - return result; -} - -bool stencilShadow(void) -{ - bool passed = true; - - passed &= stencilShadow(video::EDT_OPENGL); - passed &= stencilShadow(video::EDT_DIRECT3D9); - // no shadows in software renderer -// passed &= stencilShadow(video::EDT_SOFTWARE); - passed &= stencilShadow(video::EDT_BURNINGSVIDEO); // Note: cube has wrong color, if that gets ever changed just update the test-image. - - passed &= selfShadowing(video::EDT_OPENGL); - passed &= selfShadowing(video::EDT_DIRECT3D9); - // no shadows in software renderer -// passed &= selfShadowing(video::EDT_SOFTWARE); - passed &= selfShadowing(video::EDT_BURNINGSVIDEO); - - return passed; -} diff --git a/tests/terrainSceneNode.cpp b/tests/terrainSceneNode.cpp deleted file mode 100644 index 7c336618..00000000 --- a/tests/terrainSceneNode.cpp +++ /dev/null @@ -1,128 +0,0 @@ - -#include "testUtils.h" - -using namespace irr; -using namespace core; - -namespace -{ - -// test camera changes with terrain scene node recalculation -bool terrainRecalc(void) -{ - IrrlichtDevice *device = - createDevice(video::EDT_BURNINGSVIDEO, dimension2du(160, 120), 32); - - if (!device) - return true; - - video::IVideoDriver* driver = device->getVideoDriver(); - scene::ISceneManager* smgr = device->getSceneManager(); - - scene::ITerrainSceneNode* terrain = smgr->addTerrainSceneNode( - "../media/terrain-heightmap.bmp"); - terrain->setScale(core::vector3df(40.f, .1f, 40.f)); - - terrain->setMaterialFlag(video::EMF_LIGHTING, false); - terrain->setMaterialTexture(0, driver->getTexture("../media/terrain-texture.jpg")); - terrain->setDebugDataVisible(scene::EDS_FULL); - - scene::ICameraSceneNode* camera = smgr->addCameraSceneNode(); - - const core::vector3df center(terrain->getBoundingBox().getCenter()); - camera->setTarget(center); - - // yes, Y is intentionally being set to X here - const core::vector3df above (center.X, center.X, center.Z); - camera->setPosition (above); - camera->setUpVector(vector3df(1.f, 0.f, 0.f)); - camera->setFarValue(above.Y); - - device->run(); - smgr->drawAll(); - - - // This shouldn't cause a recalc - camera->setUpVector(vector3df(1.f, 0.f, .01f).normalize()); - device->run(); - driver->beginScene(video::ECBF_COLOR | video::ECBF_DEPTH, video::SColor(255,100,101,140)); - smgr->drawAll(); - driver->endScene(); - - // Note that this has to be a slightly fuzzier than usual compare to satisfy multiple OpenGL environments - bool result = takeScreenshotAndCompareAgainstReference(driver, "-terrainSceneNode-1.png", 97.98f); - if(!result) - { - logTestString("Small camera up rotation caused bad recalc.\n"); - } - - // This is big enough to cause a recalc - camera->setUpVector(vector3df(1.f, 0.f, .1f).normalize()); - device->run(); - driver->beginScene(video::ECBF_COLOR | video::ECBF_DEPTH, video::SColor(255,100,101,140)); - smgr->drawAll(); - driver->endScene(); - - result &= takeScreenshotAndCompareAgainstReference(driver, "-terrainSceneNode-2.png", 98.38f); - if(!result) - { - logTestString("Large camera up rotation caused bad recalc.\n"); - } - - device->closeDevice(); - device->run(); - device->drop(); - return result; -} - -bool terrainGaps() -{ - IrrlichtDevice* device = createDevice(video::EDT_BURNINGSVIDEO, dimension2d<u32>(160, 120)); - if (!device) - return true; - - video::IVideoDriver * irrVideo = device->getVideoDriver(); - scene::ISceneManager* irrScene = device->getSceneManager(); - - // Add camera - scene::ICameraSceneNode* camera = irrScene->addCameraSceneNode(); - camera->setPosition(vector3df(20000, 500, 12800)); - camera->setTarget(vector3df(16800, 0, 12800)); - camera->setFarValue(42000.0f); - - // Add terrain scene node - for (u32 i = 0; i < 2; i++) - { - const char* name="media/ter1.png"; - scene::ITerrainSceneNode* terrain = irrScene->addTerrainSceneNode( - name, 0, -1, - vector3df((f32)(256*50), 0.f, (f32)(i*256*50)),// position 12800(==imgsize*scale) - vector3df(0.f, 0.f, 0.f), // rotation - vector3df(50.f, 15.0f, 50.f) // scale 50 15 50 - ); - - terrain->setMaterialFlag(video::EMF_LIGHTING, false); - terrain->setMaterialFlag(video::EMF_WIREFRAME, !terrain->getMaterial(0).Wireframe); - } - - irrVideo->beginScene(video::ECBF_COLOR | video::ECBF_DEPTH, video::SColor(0,150,150,150)); - irrScene->drawAll(); - irrVideo->endScene(); - - bool result = takeScreenshotAndCompareAgainstReference(irrVideo, "-terrainGap.png"); - - device->closeDevice(); - device->run(); - device->drop(); - return result; -} - -} - -bool terrainSceneNode() -{ - bool result = terrainRecalc(); - result &= terrainGaps(); - return result; -} - diff --git a/tests/testDimension2d.cpp b/tests/testDimension2d.cpp deleted file mode 100644 index 801c2cfe..00000000 --- a/tests/testDimension2d.cpp +++ /dev/null @@ -1,36 +0,0 @@ -// Copyright (C) 2008-2012 Colin MacDonald -// No rights reserved: this software is in the public domain. - -#include "testUtils.h" - -using namespace irr; -using namespace core; - -/** Some very basic testing of dimension2df: - operator+= - operator!= (and thus implicitly operator==) */ -bool testDimension2d(void) -{ - dimension2df dimension(100.f, 100.f); - const dimension2df addDimension(200.f, -200.f); - - (void)(dimension += addDimension); - - if(dimension != dimension2df(300.f, -100.f)) - { - logTestString("dimension2df != produced unexpected result.\n"); - assert_log(false); - return false; - } - - (void)(dimension -= addDimension); - if(dimension != dimension2df(100.f, 100.f)) - { - logTestString("dimension2df -= produced unexpected result.\n"); - assert_log(false); - return false; - } - - return true; -} - diff --git a/tests/testGeometryCreator.cpp b/tests/testGeometryCreator.cpp deleted file mode 100644 index cbf48ddb..00000000 --- a/tests/testGeometryCreator.cpp +++ /dev/null @@ -1,127 +0,0 @@ -// Copyright (C) 2008-2012 Colin MacDonald -// No rights reserved: this software is in the public domain. - -#include "testUtils.h" - -using namespace irr; -using namespace core; -using namespace scene; -using namespace video; - -/** Tests that the geometry creator does what it says it does. */ -bool testGeometryCreator(void) -{ - IrrlichtDevice *device = createDevice(video::EDT_BURNINGSVIDEO, - core::dimension2du(160,120), 32); - if (!device) - return false; - - IVideoDriver* driver = device->getVideoDriver(); - ISceneManager* smgr = device->getSceneManager(); - (void)smgr->addCameraSceneNode(0, vector3df(0, 0, -50)); - - const IGeometryCreator * geom = smgr->getGeometryCreator(); - - ITexture * wall = driver->getTexture("../media/wall.bmp"); - - SMaterial material; - material.Lighting = false; - material.TextureLayer[0].Texture = wall; - - irr::scene::IMesh * meshHill = geom->createHillPlaneMesh(dimension2df(10, 5), dimension2du(5, 5), - &material, 10, dimension2df(2, 2), dimension2df(3, 3) ); - IMeshSceneNode * node = smgr->addMeshSceneNode(meshHill, 0, -1, - vector3df(0, 10, 0), vector3df(-60, 0, 0)); - meshHill->drop(); - - irr::scene::IMesh * meshArrow = geom->createArrowMesh(4, 8, 10, 6, 3, 6, - SColor(255, 255, 0, 0), SColor(255, 0, 255, 0)); - node = smgr->addMeshSceneNode(meshArrow, 0, -1, vector3df(-10, -20, 0)); - node->setMaterialFlag(video::EMF_LIGHTING, false); - meshArrow->drop(); - - irr::scene::IMesh * meshCone = geom->createConeMesh(5.f, 10.f, 16); - node = smgr->addMeshSceneNode(meshCone, 0, -1, vector3df(-35, -20, 0)); - node->setMaterialFlag(video::EMF_LIGHTING, false); - node->setMaterialTexture(0, wall); - meshCone->drop(); - - irr::scene::IMesh * meshCube = geom->createCubeMesh(); - node = smgr->addMeshSceneNode(meshCube, 0, -1, vector3df(-20, -20, 0)); - node->setMaterialFlag(video::EMF_LIGHTING, false); - node->setMaterialTexture(0, wall); - meshCube->drop(); - - irr::scene::IMesh * meshCylinder = geom->createCylinderMesh(3, 10, 16); - node = smgr->addMeshSceneNode(meshCylinder, 0, -1, vector3df(0, -20, 10), core::vector3df(45,0,0)); - node->setMaterialFlag(video::EMF_LIGHTING, false); - node->setMaterialTexture(0, wall); - meshCylinder->drop(); - - irr::scene::IMesh * meshSphere = geom->createSphereMesh(); - node = smgr->addMeshSceneNode(meshSphere, 0, -1, vector3df(10, -15, 0)); - node->setMaterialFlag(video::EMF_LIGHTING, false); - node->setMaterialTexture(0, wall); - meshSphere->drop(); - - irr::scene::IMesh * meshVolumeLight = geom->createVolumeLightMesh(); - node = smgr->addMeshSceneNode(meshVolumeLight, 0, -1, vector3df(20, -20, -10)); - node->setMaterialFlag(video::EMF_LIGHTING, false); - node->setMaterialTexture(0, wall); - node->setScale(core::vector3df(4.f,4.f,4.f)); - meshVolumeLight->drop(); - - bool result = false; - device->run(); - if (driver->beginScene(video::ECBF_COLOR | video::ECBF_DEPTH, video::SColor(0, 80, 80, 80))) - { - smgr->drawAll(); - driver->endScene(); - result = takeScreenshotAndCompareAgainstReference(driver, "-testGeometryCreator.png", 99.994f); - } - - smgr->clear(); - - driver->setTextureCreationFlag(video::ETCF_ALWAYS_32_BIT, true); - - // add camera - scene::ICameraSceneNode* camera = smgr->addCameraSceneNodeFPS(0,100.0f,2.0f); - camera->setPosition(core::vector3df(2000.0f,5000.f,0.0f)); - camera->setTarget(core::vector3df(0.0f,0.0f,0.0f)); - camera->setFarValue(20000.0f); - device->getCursorControl()->setVisible(false); // disable mouse cursor - - video::IImage* colorMapImage = driver->createImageFromFile("../media/terrain-texture.jpg"); - video::IImage* heightMapImage = driver->createImageFromFile("../media/terrain-heightmap.bmp"); - - scene::IAnimatedMesh* terrain = smgr->addTerrainMesh("TerrainMeshName", - colorMapImage, heightMapImage, - core::dimension2d<f32>(40, 40), // size of a pixel - 8*40); // maximum height - colorMapImage->drop(); - colorMapImage = 0; - heightMapImage->drop(); - heightMapImage = 0; - - scene::IAnimatedMeshSceneNode* anode = smgr->addAnimatedMeshSceneNode(terrain); - if (anode) - { - anode->setMaterialFlag(video::EMF_LIGHTING, false); - anode->setPosition(core::vector3df(-5000,0,-5000)); - } - - driver->beginScene(video::ECBF_COLOR | video::ECBF_DEPTH, video::SColor(0)); - smgr->drawAll(); - driver->endScene(); - - // This screenshot shows some mipmap problems, but this seems to be - // no fault of the mesh - result &= takeScreenshotAndCompareAgainstReference(driver, "-testTerrainMesh.png", 99.989f); - - device->closeDevice(); - device->run(); - device->drop(); - - return result; -} - diff --git a/tests/testLine2d.cpp b/tests/testLine2d.cpp deleted file mode 100644 index f8fe1f39..00000000 --- a/tests/testLine2d.cpp +++ /dev/null @@ -1,301 +0,0 @@ -// Copyright (C) 2008-2012 Colin MacDonald -// No rights reserved: this software is in the public domain. - -#include "testUtils.h" - -using namespace irr; -using namespace core; - -static bool testLines(line2df const & line1, - line2df const & line2, - bool expectedHit, - const vector2df & expectedIntersection) -{ - bool gotExpectedResult = true; - - logTestString("\nLine 1 = %.1f %.1f to %.1f %.1f \n", - line1.start.X, line1.start.Y, - line1.end.X, line1.end.Y); - logTestString("Line 2 = %.1f %.1f to %.1f %.1f\n", - line2.start.X, line2.start.Y, - line2.end.X, line2.end.Y); - - vector2df intersection; - logTestString("line1 with line2 = "); - if(line1.intersectWith(line2, intersection)) - { - logTestString("hit at %.1f %.1f - ", - intersection.X, intersection.Y); - - if(!line1.isPointOnLine(intersection) || !line2.isPointOnLine(intersection)) - { - logTestString("ERROR! point is not on both lines - "); - gotExpectedResult = false; - } - - if(expectedHit) - { - if(intersection == expectedIntersection) - { - logTestString("expected\n"); - } - else - { - logTestString("unexpected intersection (expected %.1f %.1f)\n", - expectedIntersection.X, expectedIntersection.Y); - gotExpectedResult = false; - } - } - else - { - logTestString("UNEXPECTED\n"); - gotExpectedResult = false; - } - } - else - { - logTestString("miss - "); - if(!expectedHit) - { - logTestString("expected\n"); - } - else - { - logTestString("UNEXPECTED\n"); - gotExpectedResult = false; - } - } - - logTestString("line2 with line1 = "); - if(line2.intersectWith(line1, intersection)) - { - logTestString("hit at %.1f %.1f - ", - intersection.X, intersection.Y); - if(!line1.isPointOnLine(intersection) || !line2.isPointOnLine(intersection)) - { - logTestString("ERROR! point is not on both lines - "); - gotExpectedResult = false; - } - - if(expectedHit) - { - if(intersection == expectedIntersection) - { - logTestString("expected\n"); - } - else - { - logTestString("unexpected intersection (expected %.1f %.1f)\n", - expectedIntersection.X, expectedIntersection.Y); - gotExpectedResult = false; - } - } - else - { - logTestString("UNEXPECTED\n"); - gotExpectedResult = false; - } - } - else - { - logTestString("miss - "); - if(!expectedHit) - { - logTestString("expected\n"); - } - else - { - logTestString("UNEXPECTED\n"); - gotExpectedResult = false; - } - } - - return gotExpectedResult; -} - -// Test the functionality of line2d>T>::intersectWith(). -/** Validation is done with assert_log() against expected results. */ -bool line2dIntersectWith(void) -{ - bool allExpected = true; - - // Crossing lines, horizontal and vertical - allExpected &= testLines(line2df(vector2df(1,1),vector2df(1,3)), - line2df(vector2df(0,2),vector2df(2,2)), - true, vector2df(1,2)); - assert_log(allExpected); - - // Crossing lines, both diagonal - allExpected &= testLines(line2df(vector2df(0,0),vector2df(2,2)), - line2df(vector2df(0,2),vector2df(2,0)), - true, vector2df(1,1)); - assert_log(allExpected); - - // Non-crossing lines, horizontal and vertical - allExpected &= testLines(line2df(vector2df(1,1),vector2df(1,3)), - line2df(vector2df(0,4),vector2df(2,4)), - false, vector2df()); - assert_log(allExpected); - - // Non-crossing lines, both diagonal - allExpected &= testLines(line2df(vector2df(0,0),vector2df(2,2)), - line2df(vector2df(3,4),vector2df(4,3)), - false, vector2df()); - assert_log(allExpected); - - // Meeting at a common point - allExpected &= testLines(line2df(vector2df(0,0),vector2df(1,0)), - line2df(vector2df(1,0),vector2df(2,0)), - true, vector2df(1,0)); - assert_log(allExpected); - allExpected &= testLines(line2df(vector2df(0,0),vector2df(1,0)), - line2df(vector2df(1,0),vector2df(0,1)), - true, vector2df(1,0)); - assert_log(allExpected); - allExpected &= testLines(line2df(vector2df(0,0),vector2df(1,0)), - line2df(vector2df(1,0),vector2df(0,-1)), - true, vector2df(1,0)); - assert_log(allExpected); - allExpected &= testLines(line2df(vector2df(0,0),vector2df(0,1)), - line2df(vector2df(0,1),vector2df(1,1)), - true, vector2df(0,1)); - assert_log(allExpected); - allExpected &= testLines(line2df(vector2df(0,0),vector2df(0,1)), - line2df(vector2df(0,1),vector2df(1,-1)), - true, vector2df(0,1)); - assert_log(allExpected); - allExpected &= testLines(line2df(vector2df(0,0),vector2df(0,1)), - line2df(vector2df(0,1),vector2df(0,2)), - true, vector2df(0,1)); - assert_log(allExpected); - allExpected &= testLines(line2df(vector2df(0,0),vector2df(1,0)), - line2df(vector2df(1,0),vector2df(2,0)), - true, vector2df(1,0)); - assert_log(allExpected); - allExpected &= testLines(line2df(vector2df(0,0),vector2df(1,1)), - line2df(vector2df(1,1),vector2df(0,2)), - true, vector2df(1,1)); - assert_log(allExpected); - allExpected &= testLines(line2df(vector2df(0,0),vector2df(1,1)), - line2df(vector2df(1,1),vector2df(2,0)), - true, vector2df(1,1)); - assert_log(allExpected); - allExpected &= testLines(line2df(vector2df(0,0),vector2df(1,1)), - line2df(vector2df(1,1),vector2df(2,2)), - true, vector2df(1,1)); - assert_log(allExpected); - - - // Parallel lines, no intersection - allExpected &= testLines(line2df(vector2df(0,0),vector2df(1,0)), - line2df(vector2df(0,1),vector2df(1,1)), - false, vector2df()); - assert_log(allExpected); - allExpected &= testLines(line2df(vector2df(0,0),vector2df(0,1)), - line2df(vector2df(1,0),vector2df(1,1)), - false, vector2df()); - assert_log(allExpected); - - // Non parallel lines, no intersection - allExpected &= testLines(line2df(vector2df(0,0),vector2df(1,0)), - line2df(vector2df(0,1),vector2df(0,2)), - false, vector2df()); - assert_log(allExpected); - allExpected &= testLines(line2df(vector2df(0,0),vector2df(0,1)), - line2df(vector2df(1,0),vector2df(2,0)), - false, vector2df()); - assert_log(allExpected); - - // Coincident (and thus parallel) lines - allExpected &= testLines(line2df(vector2df(0,0),vector2df(1,0)), - line2df(vector2df(0,0),vector2df(1,0)), - true, vector2df(0,0)); - assert_log(allExpected); - allExpected &= testLines(line2df(vector2df(2,0),vector2df(0,2)), - line2df(vector2df(2,0),vector2df(0,2)), - true, vector2df(2,0)); - assert_log(allExpected); - - // Two segments of the same unlimited line, but no intersection - allExpected &= testLines(line2df(vector2df(0,0),vector2df(1,1)), - line2df(vector2df(2,2),vector2df(3,3)), - false, vector2df()); - assert_log(allExpected); - allExpected &= testLines(line2df(vector2df(0,0),vector2df(1,0)), - line2df(vector2df(2,0),vector2df(3,0)), - false, vector2df()); - assert_log(allExpected); - allExpected &= testLines(line2df(vector2df(0,0),vector2df(0,1)), - line2df(vector2df(0,2),vector2df(0,3)), - false, vector2df()); - assert_log(allExpected); - - // Overlapping parallel lines - allExpected &= testLines(line2df(vector2df(1,0),vector2df(2,0)), - line2df(vector2df(0,0),vector2df(3,0)), - true, vector2df(1.5f, 0)); - assert_log(allExpected); - allExpected &= testLines(line2df(vector2df(0,1),vector2df(0,2)), - line2df(vector2df(0,0),vector2df(0,3)), - true, vector2df(0, 1.5f)); - assert_log(allExpected); - allExpected &= testLines(line2df(vector2df(1,0),vector2df(2,0)), - line2df(vector2df(0,0),vector2df(3,0)), - true, vector2df(1.5f, 0)); - assert_log(allExpected); - allExpected &= testLines(line2df(vector2df(0,1),vector2df(0,2)), - line2df(vector2df(0,0),vector2df(0,3)), - true, vector2df(0, 1.5f)); - assert_log(allExpected); - allExpected &= testLines(line2df(vector2df(1,1),vector2df(2,2)), - line2df(vector2df(0,0),vector2df(3,3)), - true, vector2df(1.5f, 1.5f)); - assert_log(allExpected); - allExpected &= testLines(line2df(vector2df(1,2),vector2df(2,1)), - line2df(vector2df(0,3),vector2df(3,0)), - true, vector2df(1.5f, 1.5f)); - assert_log(allExpected); - allExpected &= testLines(line2df(vector2df(0,0),vector2df(10,8)), - line2df(vector2df(2.5f,2.0f),vector2df(5.0f,4.0f)), - true, vector2df(3.75f, 3.0f)); - assert_log(allExpected); - allExpected &= testLines(line2df(vector2df(0,0),vector2df(2000,1000)), - line2df(vector2df(2,1),vector2df(2.2f,1.4f)), - true, vector2df(2.0f, 1.0f)); - assert_log(allExpected); - - if(!allExpected) - logTestString("\nline2dIntersectWith failed\n"); - - return allExpected; -} - -bool getClosestPoint(void) -{ - // testcase that fails when integers are handled like floats - irr::core::line2di line(-283, -372, 374, 289); - irr::core::vector2di p1 = line.getClosestPoint( irr::core::vector2di(290,372) ); - irr::core::vector2di p2 = line.getClosestPoint( irr::core::vector2di(135,372) ); - if( p1 == p2 ) - { - logTestString("getClosestPoint failed\n"); - return false; - } - - return true; -} - -bool testLine2d(void) -{ - bool allExpected = true; - - allExpected &= line2dIntersectWith(); - allExpected &= getClosestPoint(); - - if(allExpected) - logTestString("\nAll tests passed\n"); - else - logTestString("\nFAIL!\n"); - - return allExpected; -} diff --git a/tests/testQuaternion.cpp b/tests/testQuaternion.cpp deleted file mode 100644 index b54f0c88..00000000 --- a/tests/testQuaternion.cpp +++ /dev/null @@ -1,329 +0,0 @@ -// Copyright (C) 2008-2012 Colin MacDonald -// No rights reserved: this software is in the public domain. - -#include "testUtils.h" - -using namespace irr; - -namespace -{ -inline bool compareQ(const core::vector3df& v, const core::vector3df& turn=core::vector3df(0,0,1)) -{ - core::quaternion q(v*core::DEGTORAD); - core::vector3df v2; - - const core::vector3df v3=v.rotationToDirection(turn); - if (!v3.equals(q*turn, 0.002f)) - { - logTestString("Inequality before quat.toEuler(): %f,%f,%f\n", v.X,v.Y,v.Z); - return false; - } - - q.toEuler(v2); - v2*=core::RADTODEG; - v2=v2.rotationToDirection(turn); - - // this yields pretty far values sometimes, so don't be too picky - if (!v3.equals(v2, 0.0035f)) - { - logTestString("Inequality: %f,%f,%f != %f,%f,%f\n", v.X,v.Y,v.Z, v2.X,v2.Y,v2.Z); - return false; - } - return true; -} - -const core::vector3df vals[] = { - core::vector3df(0.f, 0.f, 0.f), - core::vector3df(0.f, 0.f, 24.04f), - core::vector3df(0.f, 0.f, 71.f), - core::vector3df(0.f, 0.f, 71.19f), - core::vector3df(0.f, 0.f, 80.f), - core::vector3df(0.f, 0.f, 103.99f), - core::vector3df(0.f, 0.f, 261.73f), - core::vector3df(0.f, 0.f, 276.f), - core::vector3df(0.f, 0.f, 286.29f), - core::vector3df(0.f, 0.f, 295.f), - core::vector3df(0.f, 0.f, 318.3f), - core::vector3df(360.f, 75.55f, 155.89f), - core::vector3df(0.f, 90.f, 159.51f), - core::vector3df(0.f, 90.f, 249.48f), - core::vector3df(0.f, 90.f, 269.91f), - core::vector3df(0.f, 90.f, 270.f), - core::vector3df(0.f, 284.45f, 155.89f), - core::vector3df(0.01f, 0.42f, 90.38f), - core::vector3df(0.04f, 359.99f, 9.5f), - core::vector3df(0.34f, 89.58f, 360.f), - core::vector3df(0.58f, 4.36f, 334.36f), - core::vector3df(3.23f, 359.65f, 10.17f), - core::vector3df(3.23f, 359.65f, 10.21f), - core::vector3df(4.85f, 359.3f, 94.33f), - core::vector3df(8.90f, 6.63f, 9.27f), - core::vector3df(11.64f, 311.52f, 345.35f), - core::vector3df(12.1f, 4.72f, 11.24f), - core::vector3df(14.63f, 48.72f, 31.79f), - core::vector3df(76.68f, 1.11f, 18.65f), - core::vector3df(90.f, 0.f, 0.f), - core::vector3df(90.01f, 270.49f, 360.f), - core::vector3df(90.95f, 0.f, 0.f), - core::vector3df(173.58f, 348.13f, 132.25f), - core::vector3df(115.52f, 89.04f, 205.51f), - core::vector3df(179.3f, 359.18f, 0.58f), - core::vector3df(180.09f, 270.06f, 0.f), - core::vector3df(180.41f, 359.94f, 179.69f), - core::vector3df(180.92f, 10.79f, 144.53f), - core::vector3df(181.95f, 270.03f, 0.f), - core::vector3df(269.05f, 0.f, 0.f), - core::vector3df(269.99f, 270.49f, 360.f), - core::vector3df(283.32f, 358.89f, 18.65f), - core::vector3df(347.9f, 355.28f, 11.24f), - core::vector3df(351.1f, 353.37f, 9.27f), - core::vector3df(355.82f, 345.96f, 273.26f), - core::vector3df(358.24f, 358.07f, 342.82f), - core::vector3df(359.78f, 357.69f, 7.52f), - core::vector3df(359.96f, 0.01f, 9.5f), - core::vector3df(-57.197479f,-90.f,0.f), - core::vector3df(-57.187481f,-90.f,0.f) -}; - -bool testQuatEulerMatrix() -{ - // Test fromAngleAxis - core::vector3df v4; - core::quaternion q1; - f32 angle = 60.f; - q1.fromAngleAxis(angle*core::DEGTORAD, core::vector3df(1, 0, 0)); - q1.toEuler(v4); - bool result = v4.equals(core::vector3df(angle*core::DEGTORAD,0,0)); - - // Test maxtrix constructor - core::vector3df v5; - core::matrix4 mx4; - mx4.setRotationDegrees(core::vector3df(angle,0,0)); - core::quaternion q2(mx4); - q2.toEuler(v5); - result &= q1.equals(q2); - result &= v4.equals(v5); - - // Test matrix conversion via getMatrix - core::matrix4 mat; - mat.setRotationDegrees(core::vector3df(angle,0,0)); - core::vector3df v6 = mat.getRotationDegrees()*core::DEGTORAD; - // make sure comparison matrix is correct - result &= v4.equals(v6); - - core::matrix4 mat2 = q1.getMatrix(); - result &= mat.equals(mat2, 0.0005f); - - // test for proper handedness - angle=90; - q1.fromAngleAxis(angle*core::DEGTORAD, core::vector3df(0,0,1)); - // check we have the correct quat - result &= q1.equals(core::quaternion(0,0,sqrtf(2)/2,sqrtf(2)/2)); - q1.toEuler(v4); - // and the correct rotation vector - result &= v4.equals(core::vector3df(0,0,90*core::DEGTORAD)); - mat.setRotationRadians(v4); - mat2=q1.getMatrix(); - // check matrix - result &= mat.equals(mat2, 0.0005f); - // and to be absolutely sure, check rotation results - v5.set(1,0,0); - mat.transformVect(v5); - v6.set(1,0,0); - mat2.transformVect(v6); - result &= v5.equals(v6); - - return result; -} - -bool testEulerConversion() -{ - bool result = true; - for (u32 i=0; i<sizeof(vals)/sizeof(vals[0]); ++i) - { - // make sure the rotations work with different turn vectors - result &= compareQ(vals[i]) && compareQ(vals[i], core::vector3df(1,2,3)) && - compareQ(vals[i], core::vector3df(0,1,0)); - } - result &= testQuatEulerMatrix(); - return result; -} - -bool testRotationFromTo() -{ - bool result = true; - core::quaternion q; - - q.rotationFromTo(core::vector3df(1.f,0.f,0.f), core::vector3df(1.f,0.f,0.f)); - if (q != core::quaternion()) - { - logTestString("Quaternion rotationFromTo method did not yield identity.\n"); - result = false; - } - - core::vector3df from(1.f,0.f,0.f); - q.rotationFromTo(from, core::vector3df(-1.f,0.f,0.f)); - from=q*from; - if (from != core::vector3df(-1.f,0.f,0.f)) - { - logTestString("Quaternion rotationFromTo method did not yield x flip.\n"); - result = false; - } - - from.set(1.f,2.f,3.f); - q.rotationFromTo(from, core::vector3df(-1.f,-2.f,-3.f)); - from=q*from; - if (from != core::vector3df(-1.f,-2.f,-3.f)) - { - logTestString("Quaternion rotationFromTo method did not yield x flip for non-axis.\n"); - result = false; - } - - from.set(1.f,0.f,0.f); - q.rotationFromTo(from, core::vector3df(0.f,1.f,0.f)); - from=q*from; - if (from != core::vector3df(0.f,1.f,0.f)) - { - logTestString("Quaternion rotationFromTo method did not yield 90 degree rotation.\n"); - result = false; - } - - for (u32 i=1; i<sizeof(vals)/sizeof(vals[0])-1; ++i) - { - from.set(vals[i]).normalize(); - core::vector3df to(vals[i+1]); - to.normalize(); - q.rotationFromTo(from, to); - from = q*from; - result &= (from.equals(to, 0.00012f)); - } - - return result; -} - -bool testInterpolation() -{ - bool result=true; - core::quaternion q(1.f,2.f,3.f,4.f); - q.normalize(); - core::quaternion q2; - q2.lerp(q,q,0); - if (q != q2) - { - logTestString("Quaternion lerp with same quaternion did not yield same quaternion back (with t==0).\n"); - result = false; - } - q2.lerp(q,q,0.5f); - if (q != q2) - { - logTestString("Quaternion lerp with same quaternion did not yield same quaternion back (with t==0.5).\n"); - result = false; - } - q2.lerp(q,q,1); - if (q != q2) - { - logTestString("Quaternion lerp with same quaternion did not yield same quaternion back (with t==1).\n"); - result = false; - } - q2.lerp(q,q,0.2345f); - if (q != q2) - { - logTestString("Quaternion lerp with same quaternion did not yield same quaternion back (with t==0.2345).\n"); - result = false; - } - q2.slerp(q,q,0); - if (q != q2) - { - logTestString("Quaternion slerp with same quaternion did not yield same quaternion back (with t==0).\n"); - result = false; - } - q2.slerp(q,q,0.5f); - if (q != q2) - { - logTestString("Quaternion slerp with same quaternion did not yield same quaternion back (with t==0.5).\n"); - result = false; - } - q2.slerp(q,q,1); - if (q != q2) - { - logTestString("Quaternion slerp with same quaternion did not yield same quaternion back (with t==1).\n"); - result = false; - } - q2.slerp(q,q,0.2345f); - if (q != q2) - { - logTestString("Quaternion slerp with same quaternion did not yield same quaternion back (with t==0.2345).\n"); - result = false; - } - core::quaternion q3(core::vector3df(45,135,85)*core::DEGTORAD); - q.set(core::vector3df(35,125,75)*core::DEGTORAD); - q2.slerp(q,q3,0); - if (q != q2) - { - logTestString("Quaternion slerp with different quaternions did not yield first quaternion back (with t==0).\n"); - result = false; - } - q2.slerp(q,q3,1); - if (q3 != q2) - { - logTestString("Quaternion slerp with different quaternions did not yield second quaternion back (with t==1).\n"); - result = false; - } - q2.slerp(q,q3,0.5); - if (!q2.equals(core::quaternion(-0.437f,0.742f,0.017f,0.506f),0.001f)) - { - logTestString("Quaternion slerp with different quaternions did not yield correct result (with t==0.5).\n"); - result = false; - } - q2.slerp(q,q3,0.2345f); - if (!q2.equals(core::quaternion(-0.4202f,0.7499f,0.03814f,0.5093f),0.0007f)) - { - logTestString("Quaternion slerp with different quaternions did not yield correct result (with t==0.2345).\n"); - result = false; - } - return result; -} -} - -bool testQuaternion(void) -{ - bool result = true; - - core::quaternion q1; - if ((q1.W != 1.f)||(q1.X != 0.f)||(q1.Y != 0.f)||(q1.Z != 0.f)) - { - logTestString("Default constructor did not create proper quaternion.\n"); - result = false; - } - - core::quaternion q2(1.f,2.f,3.f,4.f); - if ((q2.W != 4.f)||(q2.X != 1.f)||(q2.Y != 2.f)||(q2.Z != 3.f)) - { - logTestString("Element constructor did not create proper quaternion.\n"); - result = false; - } - - q2.set(4.f,3.f,2.f,1.f); - if ((q2.W != 1.f)||(q2.X != 4.f)||(q2.Y != 3.f)||(q2.Z != 2.f)) - { - logTestString("Quaternion set method not working(1).\n"); - result = false; - } - q2.set(0.f,0.f,0.f,1.f); - if ((q2.W != 1.f)||(q2.X != 0.f)||(q2.Y != 0.f)||(q2.Z != 0.f)) - { - logTestString("Quaternion set method not working(2).\n"); - result = false; - } - if (q1 != q2) - { - logTestString("Quaternion equals method not working.\n"); - result = false; - } - - result &= testRotationFromTo(); - result &= testInterpolation(); - result &= testEulerConversion(); - - return result; -} diff --git a/tests/testS3DVertex.cpp b/tests/testS3DVertex.cpp deleted file mode 100644 index b8da3456..00000000 --- a/tests/testS3DVertex.cpp +++ /dev/null @@ -1,47 +0,0 @@ -#include "testUtils.h" -#include "irrlicht.h" - -using namespace irr; -using namespace core; -using namespace video; - -// S3DVertex has operators which are used sometimes in sorting for example on loading meshes -bool testSorting() -{ - // Some test-values which did fail in the past. - // See http://irrlicht.sourceforge.net/phpBB2/viewtopic.php?t=33391&highlight= - core::map<video::S3DVertex, int> testmap; - video::S3DVertex v; - v.Pos = core::vector3df(1.000000f, -1.000000f, 1.000000f); - v.Normal = core::vector3df(0.577350f, -0.577350f, 0.577350f); - v.Color = SColor(255,204,204,204); - v.TCoords = core::vector2d<f32>(0.f, 0.f); - testmap.insert(v, 0); - - v.Pos = core::vector3df(-1.000000f, -1.000000f, 1.000000f); - v.Normal = core::vector3df(-0.577350f, -0.577350f, 0.577350f); - v.Color = SColor(255,204,204,204); - v.TCoords = core::vector2d<f32>(0.f, 0.f); - testmap.insert(v, 1); - - v.Pos = core::vector3df(1.000000f, 1.000000f, 1.000000f); - v.Normal = core::vector3df(0.577350f, 0.577350f, 0.577350f); - v.Color = SColor(255,204,204,204); - v.TCoords = core::vector2d<f32>(0.f, 0.f); - testmap.insert(v, 2); - - v.Pos = core::vector3df(1.000000f, -1.000000f, 1.000000f); - v.Normal = core::vector3df(0.577350f, -0.577350f, 0.577350f); - v.Color = SColor(255,204,204,204); - v.TCoords = core::vector2d<f32>(0.f, 0.f); - - core::map<video::S3DVertex, int>::Node* n = testmap.find(v); // look for the vertex just inserted - return n ? true : false; -} - -bool testS3DVertex(void) -{ - bool result = true; - result &= testSorting(); - return result; -} diff --git a/tests/testUtils.cpp b/tests/testUtils.cpp deleted file mode 100644 index fe5a043a..00000000 --- a/tests/testUtils.cpp +++ /dev/null @@ -1,523 +0,0 @@ -// Copyright (C) 2008-2012 Colin MacDonald -// No rights reserved: this software is in the public domain. - -#include "testUtils.h" -#include <memory.h> -#include <stdio.h> -#include <assert.h> -#include <stdarg.h> - -#if defined(_MSC_VER) || defined(_IRR_WINDOWS_API_) -#define _CRT_SECURE_NO_WARNINGS 1 -#include <windows.h> // For OutputDebugString() -#endif // _MSC_VER || _IRR_WINDOWS_API_ - -#ifdef _MSC_VER -#pragma warning( disable: 4996) -#endif - -using namespace irr; - -bool binaryCompareFiles(const char * fileName1, const char * fileName2) -{ - assert(fileName1); - assert(fileName2); - if (!fileName1 || !fileName2) - return false; - - FILE * file1 = fopen(fileName1, "rb"); - if (!file1) - { - logTestString("binaryCompareFiles: File '%s' cannot be opened\n", fileName1); - assert(file1); - return false; - } - - FILE * file2 = fopen(fileName2, "rb"); - if (!file2) - { - logTestString("binaryCompareFiles: File '%s' cannot be opened\n", fileName2); - (void)fclose(file1); - assert(file2); - return false; - } - - - (void)fseek(file1, 0, SEEK_END); - (void)fseek(file2, 0, SEEK_END); - const size_t file1Size = ftell(file1); - const size_t file2Size = ftell(file2); - if (file1Size != file2Size) - { - logTestString("binaryCompareFiles: Files are different sizes: %d vs %d\n", - file1Size, file2Size); - (void)fclose(file1); - (void)fclose(file2); - return false; - } - - (void)fseek(file1, 0, SEEK_SET); - (void)fseek(file2, 0, SEEK_SET); - - char file1Buffer[8196]; - char file2Buffer[8196]; - - while (!feof(file1)) - { - if (feof(file2) - ||(fread(file1Buffer, sizeof(file1Buffer), 1, file1) != - fread(file2Buffer, sizeof(file2Buffer), 1, file2))) - { - logTestString("binaryCompareFiles: Error during file reading\n"); - break; - } - - if (memcmp(file1Buffer, file2Buffer, sizeof(file1Buffer))) - { - logTestString("binaryCompareFiles: files are different\n"); - break; - } - } - - bool filesAreIdentical = feof(file1) && feof(file2); - (void)fclose(file1); - (void)fclose(file2); - - return filesAreIdentical; -} - -bool xmlCompareFiles(irr::io::IFileSystem * fs, const char * fileName1, const char * fileName2) -{ - if (!fileName1 || !fileName2) - return false; - - io::IXMLReaderUTF8* reader1 = fs->createXMLReaderUTF8(fileName1); - if (!reader1) - { - logTestString("xmlCompareFiles: Could not create a XML reader for '%s'\n", fileName1); - return false; - } - io::IXMLReaderUTF8* reader2 = fs->createXMLReaderUTF8(fileName2); - if (!reader2) - { - logTestString("xmlCompareFiles: Could not create a XML reader for '%s'\n", fileName2); - reader1->drop(); - return false; - } - - bool different = false; - bool read1 = reader1->read(); - bool read2 = reader2->read(); - if ( !read1 && !read2 ) - { - logTestString("xmlCompareFiles: Both files have no nodes: '%s' %s - is this ok?\n", fileName1, fileName2); - reader1->drop(); - reader2->drop(); - return true; - } - - while (read1 && read2) - { - io::EXML_NODE type1 = reader1->getNodeType(); - io::EXML_NODE type2 = reader2->getNodeType(); - if ( type1 != type2 ) - { - const c8* name1 = reader1->getNodeName(); - const c8* name2 = reader2->getNodeName(); - logTestString("xmlCompareFiles: file '%s' has different nodes than %s in nodes \"%s\" and \"%s\"\n" - , fileName1, fileName2, name1 ? name1 : "NULL", name2 ? name2 : "NULL"); - different = true; - break; - } - - if ( reader1->isEmptyElement() != reader2->isEmptyElement() ) - { - logTestString("xmlCompareFiles: file '%s' has different empty elements than %s\n", fileName1, fileName2); - different = true; - break; - } - - switch ( type1 ) - { - case io::EXN_NONE: - case io::EXN_ELEMENT_END: - break; - - case io::EXN_ELEMENT: - { - core::stringc name1(reader1->getNodeName()); - core::stringc name2(reader2->getNodeName()); - if ( name1 != name2 ) - { - logTestString("xmlCompareFiles: %s has node %s where %s has node %s\n" - , fileName1, name1.c_str(), fileName2, name2.c_str() ); - different = true; - break; - } - - unsigned int numAttributes1 = reader1->getAttributeCount(); - unsigned int numAttributes2 = reader2->getAttributeCount(); - if ( numAttributes1 != numAttributes2 ) - { - logTestString("xmlCompareFiles: %s node %s has %d attributes where %s node %s has %d attributes\n" - , fileName1, name1.c_str(), numAttributes1 - , fileName2, name2.c_str(), numAttributes2); - different = true; - break; - } - - for ( unsigned int i=0; i < numAttributes1; ++i ) - { - core::stringc attribName1(reader1->getAttributeName(int(i))); - core::stringc attribName2(reader2->getAttributeName(int(i))); - - if ( attribName1 != attribName2 ) - { - logTestString("xmlCompareFiles: %s node %s has attribute-name \"%s\" where %s node %s has name \"%s\"\n" - , fileName1, name1.c_str(), attribName1.c_str() - , fileName2, name2.c_str(), attribName2.c_str()); - different = true; - break; - } - - core::stringc attribVal1(reader1->getAttributeValue(int(i))); - core::stringc attribVal2(reader2->getAttributeValue(int(i))); - if ( attribName1 != attribName2 ) - { - logTestString("xmlCompareFiles: %s node %s has attribute-value \"%s\" where %s node %s has value \"%s\"\n" - , fileName1, name1.c_str(), attribVal1.c_str() - , fileName2, name2.c_str(), attribVal2.c_str()); - different = true; - break; - } - } - - break; - } - - case io::EXN_TEXT: - case io::EXN_UNKNOWN: - case io::EXN_COMMENT: - case io::EXN_CDATA: - { - core::stringc nodeData1( reader1->getNodeData() ); - core::stringc nodeData2( reader1->getNodeData() ); - - // removeChars('\r') needed because irrXML doesn't do that (as it probably should) - nodeData1.removeChars(core::stringc('\r')); - nodeData2.removeChars(core::stringc('\r')); - - if ( nodeData1 != nodeData2 ) - { - logTestString("xmlCompareFiles: %s has data \"%s\" where %s has data \"%s\"\n" - , fileName1, nodeData1.c_str() - , fileName2, nodeData2.c_str()); - different = true; - } - break; - } - } - - if ( different ) - break; - - read1 = reader1->read(); - read2 = reader2->read(); - } - - if ( !different && !read1 && !read2 ) - { - reader1->drop(); - reader2->drop(); - return true; - } - - if ( !different && read1 ) - { - logTestString("xmlCompareFiles: file '%s' has more nodes than %s\n", fileName1, fileName2); - } - if ( !different && read2 ) - { - logTestString("xmlCompareFiles: file '%s' has more nodes than %s\n", fileName2, fileName1); - } - - reader1->drop(); - reader2->drop(); - - return false; -} - - -//! Compare two images, returning the degree to which they match. -/** \param image1 The first image to compare. - \param image2 The second image to compare. - \return The match, from 0.f to 100.f */ -static float fuzzyCompareImages(irr::video::IImage * image1, - irr::video::IImage * image2) -{ - assert(image1); - assert(image2); - if (!image1 || !image2) - return 0.f; - - if (image1->getDimension() != image2->getDimension()) - { - logTestString("fuzzyCompareImages: images are different sizes\n"); - return 0.f; - } - - video::ECOLOR_FORMAT format1 = image1->getColorFormat(); - if (video::ECF_A8R8G8B8 != format1 && video::ECF_R8G8B8 != format1) - { - logTestString("fuzzyCompareImages: image 1 must be ECF_AR8G8B8 or ECF_R8G8B8\n"); - return 0.f; - } - - video::ECOLOR_FORMAT format2 = image2->getColorFormat(); - if (video::ECF_A8R8G8B8 != format2 && video::ECF_R8G8B8 != format2) - { - logTestString("fuzzyCompareImages: image 2 must be ECF_AR8G8B8 or ECF_R8G8B8\n"); - return 0.f; - } - - u8 * image1Data = (u8*)image1->getData(); - u8 * image2Data = (u8*)image2->getData(); - - const u32 pixels = (image1->getPitch() * image1->getDimension().Height) / 4; - u32 mismatchedColours = 0; - for (u32 pixel = 0; pixel < pixels; ++pixel) - { - if (video::ECF_A8R8G8B8 == format1) - image1Data++; - - const u8 r1 = *(image1Data++); - const u8 g1 = *(image1Data++); - const u8 b1 = *(image1Data++); - - if (video::ECF_A8R8G8B8 == format2) - image2Data++; - - const u8 r2 = *(image2Data++); - const u8 g2 = *(image2Data++); - const u8 b2 = *(image2Data++); - - mismatchedColours += abs(r1 - r2) + abs(g1 - g2) + abs(b1 - b2); - } - - const u32 totalColours = pixels * 255*3; - return 100.f * (totalColours - mismatchedColours) / totalColours; -} - - -//! Compare two images, returning the degree to which they match. -/** \param image1 The first image to compare. - \param image2 The second image to compare. - \return The match, from 0.f to 100.f */ -float fuzzyCompareImages(irr::video::IVideoDriver * driver, - const char * fileName1, const char * fileName2) -{ - assert(fileName1); - assert(fileName2); - irr::video::IImage * img1 = driver->createImageFromFile(fileName1); - if (!img1) - return 0; - irr::video::IImage * img2 = driver->createImageFromFile(fileName2); - const float result = fuzzyCompareImages(img1, img2); - logTestString("Image match: %f%%\n", result); - img1->drop(); - if (img2) - img2->drop(); - return result; -} - -void stabilizeScreenBackground(irr::video::IVideoDriver * driver, - irr::video::SColor color) -{ - for(int i = 0; i < 10000; ++i) - { - driver->beginScene(video::ECBF_COLOR | video::ECBF_DEPTH, color); - driver->endScene(); - - irr::video::IImage * screenshot = driver->createScreenShot(); - if (!screenshot) - return; - - const video::ECOLOR_FORMAT format = screenshot->getColorFormat(); - if (format != video::ECF_R8G8B8) - { - irr::video::IImage * fixedScreenshot = driver->createImage(video::ECF_R8G8B8, screenshot->getDimension()); - screenshot->copyTo(fixedScreenshot); - screenshot->drop(); - - if (!fixedScreenshot) - return; - - screenshot = fixedScreenshot; - } - - u8 * image1Data = (u8*)screenshot->getData(); - - const u32 pixels = (screenshot->getPitch() * screenshot->getDimension().Height) / 4; - bool status = true; - for(u32 pixel = 0; pixel < pixels; ++pixel) - { - const u8 r = *(image1Data++); - const u8 g = *(image1Data++); - const u8 b = *(image1Data++); - - if (r != color.getRed() || g != color.getGreen() || b != color.getBlue()) - { - status = false; - break; - } - } - - if (status) - { - screenshot->drop(); - return; - } - screenshot->drop(); - } - - logTestString("stabilizeScreenBackground failed\n"); -} - -irr::core::stringc shortDriverName(irr::video::IVideoDriver * driver) -{ - irr::core::stringc driverName = driver->getName(); - - // For OpenGL and Burning, chop the version number out. Other drivers have more stable version numbers. - // TA: Sorry Rogerborg. burnings video also has the version number inside;-) - // maybe you sould take the getDriverType Info for this - if (driverName.find("OpenGL") > -1) - driverName = "OpenGL"; - else if (driverName.find("Burning's Video") > -1) - driverName = "Burning's Video"; - - return driverName; -} - -bool takeScreenshotAndCompareAgainstReference(irr::video::IVideoDriver * driver, - const char * fileName, - irr::f32 requiredMatch) -{ - irr::video::IImage * screenshot = driver->createScreenShot(); - if (!screenshot) - { - logTestString("Failed to take screenshot\n"); - assert(false); - return false; - } - - const video::ECOLOR_FORMAT format = screenshot->getColorFormat(); - if (format != video::ECF_R8G8B8) - { - irr::video::IImage * fixedScreenshot = driver->createImage(video::ECF_R8G8B8, screenshot->getDimension()); - screenshot->copyTo(fixedScreenshot); - screenshot->drop(); - - if (!fixedScreenshot) - { - logTestString("Failed to convert screenshot to ECF_A8R8G8B8\n"); - assert(false); - return false; - } - - screenshot = fixedScreenshot; - } - - irr::core::stringc driverName = shortDriverName(driver); - - irr::core::stringc referenceFilename = "media/"; - referenceFilename += driverName; - referenceFilename += fileName; - irr::video::IImage * reference = driver->createImageFromFile(referenceFilename.c_str()); - if (!reference) - { - logTestString("\n*** Failed to load reference image '%s'\n*** Creating from screenshot - please check this image.\n\n", - referenceFilename.c_str()); - (void)driver->writeImageToFile(screenshot, referenceFilename.c_str()); - screenshot->drop(); - return false; - } - - const float match = fuzzyCompareImages(screenshot, reference); - logTestString("Image match: %f%%\n", match); - - if (match < requiredMatch) - { - irr::core::stringc mismatchFilename = "results/"; - mismatchFilename += driverName; - mismatchFilename += fileName; - logTestString("Writing mismatched image to '%s'\n", mismatchFilename.c_str()); - (void)driver->writeImageToFile(screenshot, mismatchFilename.c_str()); - } - - - screenshot->drop(); - reference->drop(); - - return (match >= requiredMatch); -} - -static FILE * logFile = 0; - -bool openTestLog(bool startNewLog, const char * filename) -{ - closeTestLog(); - - if (startNewLog) - logFile = fopen(filename, "w"); - else - logFile = fopen(filename, "a"); - - assert(logFile); - if (!logFile) - logTestString("\nWARNING: unable to open the test log file %s\n", filename); - - return (logFile != 0); -} - -void closeTestLog(void) -{ - if (logFile) - { - (void)fclose(logFile); - logFile = 0; - } -} - - -void logTestString(const char * format, ...) -{ - char logString[1024]; - - va_list arguments; - va_start(arguments, format); - vsprintf(logString, format, arguments); - va_end(arguments); - -#if defined(_IRR_WINDOWS_API_) -#if defined (_WIN32_WCE ) - core::stringw tmp(logString); - tmp += L"\n"; - OutputDebugStringW(tmp.c_str()); -#else - OutputDebugStringA(logString); - OutputDebugStringA("\n"); -#endif -#endif - - (void)printf(logString); - if (logFile) - { - (void)fprintf(logFile, logString); - (void)fflush(logFile); - } - -#if defined(TESTING_ON_WINDOWS) - OutputDebugStringA(logString); -#endif // #if defined(TESTING_ON_WINDOWS) -} - diff --git a/tests/testUtils.h b/tests/testUtils.h deleted file mode 100644 index f1d7b6ea..00000000 --- a/tests/testUtils.h +++ /dev/null @@ -1,110 +0,0 @@ - -#ifndef _TEST_UTILS_H_ -#define _TEST_UTILS_H_ 1 - -#include "irrlicht.h" -#include <assert.h> - -// Small hack. Some newer X11 systems can't handle switching drivers too fast (causing BadWindow errors in X_ChangeWindowAttributes). -// Could be they don't like when Windows with different Visuals are created very quickly (it always happened after creating a new Window with different Visual to previous one). -// timeMs value set by try&error -#ifdef _IRR_POSIX_API_ - #include <time.h> - #define SLOW_SWITCH \ - do { \ - struct timespec ts; \ - const int timeMs = 250; \ - ts.tv_sec = (time_t) (timeMs / 1000); \ - ts.tv_nsec = (long) (timeMs % 1000) * 1000000; \ - nanosleep(&ts, NULL);\ - } while (false) -#else - #define SLOW_SWITCH -#endif - -#define TestWithAllDrivers(X) \ - logTestString("Running test " #X "\n"); \ - for (u32 i=1; i<video::EDT_COUNT; ++i) \ - if (video::E_DRIVER_TYPE(i) != video::DEPRECATED_EDT_DIRECT3D8_NO_LONGER_EXISTS && irr::IrrlichtDevice::isDriverSupported((irr::video::E_DRIVER_TYPE)i)) \ - {\ - SLOW_SWITCH; \ - result &= X(video::E_DRIVER_TYPE(i));\ - } - -#define TestWithAllHWDrivers(X) \ - SLOW_SWITCH; \ - logTestString("Running test " #X "\n"); \ - for (u32 i=video::EDT_DIRECT3D9; i<video::EDT_COUNT; ++i) \ - if (irr::IrrlichtDevice::isDriverSupported((irr::video::E_DRIVER_TYPE)i)) \ - {\ - SLOW_SWITCH; \ - result &= X(video::E_DRIVER_TYPE(i));\ - } - -// replacement for assert which does log the lines instead -#define assert_log(X) \ -do { \ - if ( !(X) ) \ - { \ - logTestString("ASSERT in %s:%d: %s\n", __FILE__, __LINE__, #X); \ - } \ -} while (false) - -//! Compare two files -/** \param fileName1 The first file for comparison. - \param fileName2 The second file for comparison. - \return true if the files are identical, false on any error or difference. */ -extern bool binaryCompareFiles(const char * fileName1, const char * fileName2); - -//! Compare two xml-files (which can have different types of text-encoding) -/** \param fs Filesystem which should be used. - \param fileName1 The first file for comparison. - \param fileName2 The second file for comparison. - \return true if the files are identical, false on any error or difference. */ -extern bool xmlCompareFiles(irr::io::IFileSystem * fs, const char * fileName1, const char * fileName2); - -//! Compare two images, returning the degree to which they match. -/** \param driver The Irrlicht video driver. - \param fileName1 The first image to compare. - \param fileName2 The second image to compare. - \return The match, from 0.f to 100.f */ -extern float fuzzyCompareImages(irr::video::IVideoDriver * driver, - const char * fileName1, const char * fileName2); - -//! Take a screenshot and compare it against a reference screenshot in the tests/media subdirectory -/** \param driver The Irrlicht video driver. - \param fileName The unique filename suffix that will be appended to the name of the video driver. - \param requiredMatch The degree to which the screenshot needs to match the reference image - in order to be considered a match. - \return true if the screenshot was taken and is identical to the reference image of the same name - in the tests/media directory, false on any error or difference. */ -extern bool takeScreenshotAndCompareAgainstReference(irr::video::IVideoDriver * driver, - const char * fileName, - irr::f32 requiredMatch = 99.f); - -//! Stabilize the screen background eg. eliminate problems like an aero transparency effects etc. -/** \param driver The Irrlicht video driver. - \return true if required color is the same as a window background color. */ -extern void stabilizeScreenBackground(irr::video::IVideoDriver * driver, - irr::video::SColor color = irr::video::SColor(255, 255, 255, 255)); - - -//! Opens a test log file, deleting any existing contents. -/** \param startNewLog true to create a new log file, false to append to an - existing one. - \param filename The filename to open - \return true if the test log file was opened, false on error. */ -extern bool openTestLog(bool startNewLog, const char * filename = "tests.log"); - -//! Close the test log file opened with openTestLog() -extern void closeTestLog(); - -//! Log a string to the console and the test log file created by openTestLog(). -/** \param format The format string - \... optional parameters */ -extern void logTestString(const char * format, ...); - -//! Return a drivername for the driver which is useable in filenames -extern irr::core::stringc shortDriverName(irr::video::IVideoDriver * driver); - -#endif // _TEST_UTILS_H_ diff --git a/tests/testVector2d.cpp b/tests/testVector2d.cpp deleted file mode 100644 index b06edc76..00000000 --- a/tests/testVector2d.cpp +++ /dev/null @@ -1,221 +0,0 @@ -// Copyright (C) 2008-2012 Colin MacDonald -// No rights reserved: this software is in the public domain. - -#include "testUtils.h" - -using namespace irr; -using namespace core; - -template<class T> -static bool compareVectors(const core::vector2d<T> & compare, - const core::vector2d<T> & with) -{ - if (!compare.equals(with)) - { - logTestString("\nERROR: vector2d %.16f, %.16f != vector2d %.16f, %.16f\n", - (f64)compare.X, (f64)compare.Y, (f64)with.X, (f64)with.Y); - assert_log(compare == with); - return false; - } - - return true; -} - -template <class T> -static bool doTests() -{ - #define COMPARE_VECTORS(compare, with)\ - if(!compareVectors(compare, with)) return false; - - vector2d<T> vec(5, 5); - vector2d<T> otherVec(10, 20); - if(!equals(vec.getDistanceFrom(otherVec), (T)15.8113883)) - { - logTestString("vector2d::getDistanceFrom() failed\n"); - assert_log(0); - return false; - } - - otherVec = vector2d<T>(1,2); - otherVec[0] = vec[0]; - otherVec[1] = vec[1]; - if(!vec.equals(otherVec)) - { - logTestString("vector2d::operator[] failed\n"); - assert_log(0); - return false; - } - - vec.rotateBy(45); // Test implicit (0, 0) center - COMPARE_VECTORS(vec, vector2d<T>(0, (T)7.0710678118654755)); - - vec.normalize(); - COMPARE_VECTORS(vec, vector2d<T>(0, (T)1.0000000461060017)); - - vec.set(10, 10); - vector2d<T> center(5, 5); - vec.rotateBy(-5, center); - // -5 means rotate clockwise slightly, so expect the X to increase - // slightly and the Y to decrease slightly. - COMPARE_VECTORS(vec, vector2d<T>((T)10.416752204197017, (T)9.5451947767204359)); - - vec.set(5, 5); - vec.normalize(); - COMPARE_VECTORS(vec, vector2d<T>((T)0.7071068137884140, (T)0.7071068137884140)); - - vec.set(5, 5); - otherVec.set(10, 20); - - logTestString("vector2d interpolation\n"); - vector2d<T> interpolated; - (void)interpolated.interpolate(vec, otherVec, 0.f); - COMPARE_VECTORS(interpolated, otherVec); // 0.f means all the second vector - - (void)interpolated.interpolate(vec, otherVec, 0.25f); - COMPARE_VECTORS(interpolated, vector2d<T>((T)8.75, (T)16.25)); - - (void)interpolated.interpolate(vec, otherVec, 0.75f); - COMPARE_VECTORS(interpolated, vector2d<T>((T)6.25, (T)8.75)); - - (void)interpolated.interpolate(vec, otherVec, 1.f); - COMPARE_VECTORS(interpolated, vec); // 1.f means all the first vector - - - interpolated = vec.getInterpolated(otherVec, 0.f); - COMPARE_VECTORS(interpolated, otherVec); // 0.f means all the second vector - - interpolated = vec.getInterpolated(otherVec, 0.25f); - COMPARE_VECTORS(interpolated, vector2d<T>((T)8.75, (T)16.25)); - - interpolated = vec.getInterpolated(otherVec, 0.75f); - COMPARE_VECTORS(interpolated, vector2d<T>((T)6.25, (T)8.75)); - - interpolated = vec.getInterpolated(otherVec, 1.f); - COMPARE_VECTORS(interpolated, vec); // 1.f means all the first vector - - - logTestString("vector2d quadratic interpolation\n"); - vector2d<T> thirdVec(20, 10); - interpolated = vec.getInterpolated_quadratic(otherVec, thirdVec, 0.f); - COMPARE_VECTORS(interpolated, vec); // 0.f means all the 1st vector - - interpolated = vec.getInterpolated_quadratic(otherVec, thirdVec, 0.25f); - COMPARE_VECTORS(interpolated, vector2d<T>((T)7.8125, (T)10.9375)); - - interpolated = vec.getInterpolated_quadratic(otherVec, thirdVec, 0.5f); - COMPARE_VECTORS(interpolated, vector2d<T>((T)11.25, (T)13.75)); - - interpolated = vec.getInterpolated_quadratic(otherVec, thirdVec, 0.75f); - COMPARE_VECTORS(interpolated, vector2d<T>((T)15.3125, (T)13.4375)); - - interpolated = vec.getInterpolated_quadratic(otherVec, thirdVec, 1.f); - COMPARE_VECTORS(interpolated, thirdVec); // 1.f means all the 3rd vector - - // check if getAngle returns values matching those of the double precision version - logTestString("vector2d getAngle\n"); - for (s32 i=0; i<200; ++i) - { - core::vector2d<T> tmp((T)-1, (T)(-100+i)); - core::vector2d<f64> ref(-1, -100+i); - if (!equals(tmp.getAngle(),ref.getAngle(), 0.0003)) - { - logTestString("\nERROR: angle %.16f != angle %.16f\n", - tmp.getAngle(), ref.getAngle()); - return false; - } - f32 val = atan2f((float)tmp.Y, (float)tmp.X)*core::RADTODEG; - if (val<=0) - val=-val; - else - val=360-val; - if (!equals((f32)tmp.getAngle(),val, 0.5f)) - { - logTestString("\nERROR: angle %.16f != atan2 %.16f\n vector %.16f, %.16f\n", - tmp.getAngle(), val, tmp.X, tmp.Y); - return false; - } - tmp = core::vector2d<T>((T)1, (T)(-100+i)); - ref = core::vector2d<f64>(1, -100+i); - if (!equals(tmp.getAngle(),ref.getAngle(), 0.0003)) - { - logTestString("\nERROR: angle %.16f != angle %.16f\n", - tmp.getAngle(), ref.getAngle()); - return false; - } - val = atan2f((f32)tmp.Y, (f32)tmp.X)*core::RADTODEG; - if (val<=0) - val=-val; - else - val=360-val; - if (!equals((f32)tmp.getAngle(),val, 0.5f)) - { - logTestString("\nERROR: angle %.16f != atan2 %.16f\n vector %.16f, %.16f\n", - tmp.getAngle(), val, tmp.X, tmp.Y); - return false; - } - } - core::vector2d<T> tmp(0, -100); - core::vector2d<f64> ref(0, -100); - if (!equals(tmp.getAngle(),ref.getAngle())) - { - logTestString("\nERROR: angle %.16f != angle %.16f\n", - tmp.getAngle(), ref.getAngle()); - return false; - } - tmp = core::vector2d<T>(0, 100); - ref = core::vector2d<f64>(0, 100); - if (!equals(tmp.getAngle(),ref.getAngle())) - { - logTestString("\nERROR: angle %.16f != angle %.16f\n", - tmp.getAngle(), ref.getAngle()); - return false; - } - tmp = core::vector2d<T>(static_cast<T>(-1.53080559e-16), static_cast<T>(2.49999523)); - ref = core::vector2d<f64>(-1.53080559e-16, 2.49999523); - if (!equals(tmp.getAngle(),ref.getAngle())) - { - logTestString("\nERROR: angle %.16f != angle %.16f\n", - tmp.getAngle(), ref.getAngle()); - return false; - } - - core::vector2d<T> zeroZero(0, 0); - core::vector2d<T> oneOne(1, 1); - // Check if comparing (0.0, 0.0) with (1.0, 1.0) returns false. - if(zeroZero == oneOne) - { - logTestString("\nERROR: vector2d %.16f, %.16f == vector2d %.16f, %.16f\n", - (f64)zeroZero.X, (f64)zeroZero.Y, (f64)oneOne.X, (f64)oneOne.Y); - return false; - } - - return true; -} - -/** Test the functionality of vector2d<T>, particularly methods that - involve calculations done using different precision than <T>. - Note that all reference vector2d<T>s are creating using double precision - values cast to (T), as we need to test <f64>. */ -bool testVector2d(void) -{ - bool f32Success = doTests<f32>(); - if(f32Success) - logTestString("vector2df tests passed\n\n"); - else - logTestString("\n*** vector2df tests failed ***\n\n"); - - bool f64Success = doTests<f64>(); - if(f64Success) - logTestString("vector2d<f64> tests passed\n\n"); - else - logTestString("\n*** vector2d<f64> tests failed ***\n\n"); - - bool s32Success = doTests<s32>(); - if(s32Success) - logTestString("vector2di tests passed\n\n"); - else - logTestString("\n*** vector2di tests failed ***\n\n"); - - return f32Success && f64Success && s32Success; -} - diff --git a/tests/testVector3d.cpp b/tests/testVector3d.cpp deleted file mode 100644 index a94d0303..00000000 --- a/tests/testVector3d.cpp +++ /dev/null @@ -1,312 +0,0 @@ -// Copyright (C) 2008-2012 Colin MacDonald -// No rights reserved: this software is in the public domain. - -#include "testUtils.h" - -using namespace irr; -using namespace core; - -#define EQUAL_VECTORS(compare, with)\ - if(!equalVectors(cmp_equal<core::vector3d<T> >(compare), with)) {assert(false); return false;} - -#define LESS_VECTORS(compare, with)\ - if(!equalVectors(cmp_less<core::vector3d<T> >(compare), with)) return false; - -#define LESS_EQUAL_VECTORS(compare, with)\ - if(!equalVectors(cmp_less_equal<core::vector3d<T> >(compare), with)) return false; - -#define MORE_VECTORS(compare, with)\ - if(!equalVectors(cmp_more<core::vector3d<T> >(compare), with)) return false; - -#define MORE_EQUAL_VECTORS(compare, with)\ - if(!equalVectors(cmp_more_equal<core::vector3d<T> >(compare), with)) return false; - -// check if the vector contains a NAN (a==b is guaranteed to return false in this case) -template<class T> -static bool is_nan(const core::vector3d<T> &vec ) -{ - return ( !(vec.X == vec.X) - || !(vec.Y == vec.Y) - || !(vec.Z == vec.Z) ); -} - -template<class T> -struct cmp_less -{ - cmp_less(const T& a) : val(a) {} - bool operator()(const T& other) const - { - return val<other; - } - const char* getName() const {return "<";} - const T val; -}; - -template<class T> -struct cmp_less_equal -{ - cmp_less_equal(const T& a) : val(a) {} - bool operator()(const T& other) const - { - return val<=other; - } - const char* getName() const {return "<=";} - const T val; -}; - -template<class T> -struct cmp_more -{ - cmp_more(const T& a) : val(a) {} - bool operator()(const T& other) const - { - return val>other; - } - const char* getName() const {return ">";} - const T val; -}; - -template<class T> -struct cmp_more_equal -{ - cmp_more_equal(const T& a) : val(a) {} - bool operator()(const T& other) const - { - return val>=other; - } - const char* getName() const {return ">=";} - const T val; -}; - -template<class T> -struct cmp_equal -{ - cmp_equal(const T& a) : val(a) {} - bool operator()(const T& other) const - { - return val.equals(other); - } - const char* getName() const {return "==";} - const T val; -}; - -template<class S, class T> -static bool equalVectors(const S& compare, - const core::vector3d<T> & with) -{ - if (!compare(with)) - { - logTestString("\nERROR: vector3d %.16f, %.16f, %.16f %s vector3d %.16f, %.16f, %.16f\n", - (f64)compare.val.X, (f64)compare.val.Y, (f64)compare.val.Z, compare.getName(), - (f64)with.X, (f64)with.Y, (f64)with.Z); - assert_log(compare(with)); - return false; - } - - return true; -} - -template <class T> -static bool checkInterpolation() -{ - core::vector3d<T> vec(5, 5, 0); - core::vector3d<T> otherVec(10, 20, 40); - - vector3d<T> interpolated; - (void)interpolated.interpolate(vec, otherVec, 0.f); - EQUAL_VECTORS(interpolated, otherVec); // 0.f means all the second vector - - (void)interpolated.interpolate(vec, otherVec, 0.25f); - EQUAL_VECTORS(interpolated, vector3d<T>((T)8.75, (T)16.25, 30)); - - (void)interpolated.interpolate(vec, otherVec, 0.75f); - EQUAL_VECTORS(interpolated, vector3d<T>((T)6.25, (T)8.75, 10)); - - (void)interpolated.interpolate(vec, otherVec, 1.f); - EQUAL_VECTORS(interpolated, vec); // 1.f means all the first vector - - - interpolated = vec.getInterpolated(otherVec, 0.f); - EQUAL_VECTORS(interpolated, otherVec); // 0.f means all the second vector - - interpolated = vec.getInterpolated(otherVec, 0.25f); - EQUAL_VECTORS(interpolated, vector3d<T>((T)8.75, (T)16.25, 30)); - - interpolated = vec.getInterpolated(otherVec, 0.75f); - EQUAL_VECTORS(interpolated, vector3d<T>((T)6.25, (T)8.75, 10)); - - interpolated = vec.getInterpolated(otherVec, 1.f); - EQUAL_VECTORS(interpolated, vec); // 1.f means all the first vector - - - vector3d<T> thirdVec(20, 10, -30); - interpolated = vec.getInterpolated_quadratic(otherVec, thirdVec, 0.f); - EQUAL_VECTORS(interpolated, vec); // 0.f means all the 1st vector - - interpolated = vec.getInterpolated_quadratic(otherVec, thirdVec, 0.25f); - EQUAL_VECTORS(interpolated, vector3d<T>((T)7.8125, (T)10.9375, (T)13.125)); - - interpolated = vec.getInterpolated_quadratic(otherVec, thirdVec, 0.5f); - EQUAL_VECTORS(interpolated, vector3d<T>((T)11.25, (T)13.75, (T)12.5)); - - interpolated = vec.getInterpolated_quadratic(otherVec, thirdVec, 0.75f); - EQUAL_VECTORS(interpolated, vector3d<T>((T)15.3125, (T)13.4375, (T)-1.875)); - - interpolated = vec.getInterpolated_quadratic(otherVec, thirdVec, 1.f); - EQUAL_VECTORS(interpolated, thirdVec); // 1.f means all the 3rd vector - return true; -} - -template <class T> -static bool checkAngleCalculations() -{ - core::vector3d<T> vec(5, 5, 0); - EQUAL_VECTORS(vec.getHorizontalAngle(), vector3d<T>(315, (T)90.0, 0)); - EQUAL_VECTORS(vec.getSphericalCoordinateAngles(), vector3d<T>((T)45.0, 0, 0)); - return true; -} - -template <class T> -static bool checkRotations() -{ - core::vector3d<T> vec(5, 5, 0); - vector3d<T> center(0, 0, 0); - - vec.rotateXYBy(45, center); - EQUAL_VECTORS(vec, vector3d<T>(0, (T)7.0710678118654755, 0)); - - vec.normalize(); - // TODO: This breaks under Linux/gcc due to FP differences, but is no bug - if (((T)0.5f)>0.f) - EQUAL_VECTORS(vec, vector3d<T>(0, (T)1.0, 0)); - - vec.set(10, 10, 10); - center.set(5, 5, 10); - vec.rotateXYBy(-5, center); - // -5 means rotate clockwise slightly, so expect the X to increase - // slightly and the Y to decrease slightly. - EQUAL_VECTORS(vec, vector3d<T>((T)10.416752204197017, (T)9.5451947767204359, 10)); - - vec.set(10, 10, 10); - center.set(5, 10, 5); - vec.rotateXZBy(-5, center); - EQUAL_VECTORS(vec, vector3d<T>((T)10.416752204197017, 10, (T)9.5451947767204359)); - - vec.set(10, 10, 10); - center.set(10, 5, 5); - vec.rotateYZBy(-5, center); - EQUAL_VECTORS(vec, vector3d<T>(10, (T)10.416752204197017, (T)9.5451947767204359)); - - vec.set(5, 5, 0); - vec.normalize(); - EQUAL_VECTORS(vec, vector3d<T>((T)0.70710681378841400, (T)0.70710681378841400, 0)); - return true; -} - -template <class T> -static bool doTests() -{ - vector3d<T> vec(-5, 5, 0); - vector3d<T> otherVec((T)-5.1, 5, 0); - - if(!vec.equals(otherVec, (T)0.1)) - { - logTestString("vector3d::equals failed\n"); - assert_log(0); - return false; - } - - otherVec = vector3d<T>(1,2,3); - otherVec[0] = vec[0]; - otherVec[1] = vec[1]; - otherVec[2] = vec[2]; - if(!vec.equals(otherVec)) - { - logTestString("vector3d::operator[] failed\n"); - assert_log(0); - return false; - } - - vec.set(5, 5, 0); - otherVec.set(10, 20, 0); - if(!equals(vec.getDistanceFrom(otherVec), (T)15.8113883)) - { - logTestString("vector3d::getDistanceFrom() failed\n"); - assert_log(0); - return false; - } - - if (!checkRotations<T>()) - return false; - - if (!checkInterpolation<T>()) - return false; - - if (!checkAngleCalculations<T>()) - return false; - - vec.set(0,0,0); - vec.setLength(99); - if ( is_nan(vec) ) - return false; - - core::vector3d<T> zeroZero(0, 0, 0); - core::vector3d<T> oneOne(1, 1, 1); - // Check if comparing (0.0, 0.0, 0.0) with (1.0, 1.0, 1.0) returns false. - if(zeroZero == oneOne) - { - logTestString("\nERROR: vector3d %.16f, %.16f, %.16f == vector3d %.16f, %.16f, %.16f\n", - (f64)zeroZero.X, (f64)zeroZero.Y, (f64)zeroZero.Z, - (f64)oneOne.X, (f64)oneOne.Y, (f64)oneOne.Z); - return false; - } - - vec.set(5, 5, 0); - - otherVec.set(10, 20, 40); - LESS_VECTORS(vec, otherVec); - LESS_EQUAL_VECTORS(vec, otherVec); - MORE_VECTORS(otherVec, vec); - MORE_EQUAL_VECTORS(otherVec, vec); - - vec.set(-1,-1,1); - otherVec.set(1,-1,1); - LESS_VECTORS(vec, otherVec); - LESS_EQUAL_VECTORS(vec, otherVec); - MORE_VECTORS(otherVec, vec); - MORE_EQUAL_VECTORS(otherVec, vec); - - LESS_EQUAL_VECTORS(vec, vec); - MORE_EQUAL_VECTORS(vec, vec); - - return true; -} - - -/** Test the functionality of vector3d<T>, particularly methods that - involve calculations done using different precision than <T>. - Note that all reference vector3d<T>s are creating using double precision - values cast to (T), as we need to test <f64>. */ -bool testVector3d(void) -{ - const bool f32Success = doTests<f32>(); - if (f32Success) - logTestString("vector3df tests passed\n\n"); - else - logTestString("\n*** vector3df tests failed ***\n\n"); - - const bool f64Success = doTests<f64>(); - if (f64Success) - logTestString("vector3d<f64> tests passed\n\n"); - else - logTestString("\n*** vector3d<f64> tests failed ***\n\n"); - - const bool s32Success = doTests<s32>(); - if (s32Success) - logTestString("vector3di tests passed\n\n"); - else - logTestString("\n*** vector3di tests failed ***\n\n"); - - return f32Success && f64Success && s32Success; -} - diff --git a/tests/testXML.cpp b/tests/testXML.cpp deleted file mode 100644 index 29a210d4..00000000 --- a/tests/testXML.cpp +++ /dev/null @@ -1,169 +0,0 @@ -// Copyright (C) 2009-2012 Christian Stehno -// No rights reserved: this software is in the public domain. - -#include "testUtils.h" - -using namespace irr; -using namespace core; - -bool simple_xml( irr::io::IFileSystem * fs ) -{ - io::IXMLReaderUTF8* reader = fs->createXMLReaderUTF8("media/test.xml"); - if (!reader) - { - logTestString("Could not create XML reader.\n"); - return false; - } - - const core::stringc expected[] = { - "a", "b", "c" - }; - - bool retVal = true; - u32 i=0; - while(reader->read()) - { - if (reader->getNodeType() == io::EXN_ELEMENT) - { - if (expected[i++] != reader->getNodeName()) - { - logTestString("Did not find expected string in XML element name.\n"); - retVal = false; - break; - } - } - } - - reader->drop(); - return retVal; -} - -// CDATA should return everything between "![CDATA[" and "]]>" as it's in the file -bool cdata( irr::io::IFileSystem * fs ) -{ - io::IXMLReaderUTF8* reader = fs->createXMLReaderUTF8("media/cdata.xml"); - if (!reader) - { - logTestString("Could not create XML reader.\n"); - return false; - } - - const core::stringc textNode("text"); - core::array< core::stringc > compareStrings; - compareStrings.push_back("simple"); - compareStrings.push_back(""); - compareStrings.push_back("] ]> "); - compareStrings.push_back("]\n]> "); - compareStrings.push_back("\nNewlines\n\tand tabs\n\t\tgogogo"); - compareStrings.push_back("&&#@#$%*()@#$%*()#$%*("); - compareStrings.push_back("& & && &&& &a &ü &ä &ö &&#"); - - bool result = true; - size_t count = 0; - while(reader->read()) - { - if (reader->getNodeType() == io::EXN_ELEMENT) - { - if ( core::stringc(reader->getNodeName()) == textNode ) - { - while(reader->read()) - { - if (reader->getNodeType() == io::EXN_CDATA) - { - core::stringc data = reader->getNodeData(); - core::stringc name = reader->getNodeName(); - if ( count == compareStrings.size() ) - { - logTestString("too many cdata elements for reading in %s:%d\n", __FILE__, __LINE__); - } - else if ( count < compareStrings.size() ) - { - core::stringc cmpString(compareStrings[count]); - - // some (unused) variables to ease debugging - // const c8* dataRaw = data.c_str(); - // const c8* cmpRaw = cmpString.c_str(); - if ( cmpString != data ) - { - result = false; - logTestString("cdata read failed for string %d in %s:%d\n", count, __FILE__, __LINE__); - } - } - ++count; - } - if ( reader->getNodeType() == io::EXN_ELEMENT_END ) - { - break; - } - } - } - } - } - - reader->drop(); - return result; -} - -bool attributeValues(irr::io::IFileSystem * fs) -{ - io::IXMLReaderUTF8* reader = fs->createXMLReaderUTF8("media/attributes.xml"); - if (!reader) - { - logTestString("Could not create XML reader.\n"); - return false; - } - - bool result = true; - bool hasNode = false; - while (reader->read()) - { - if (io::EXN_ELEMENT == reader->getNodeType() ) - { - if ( core::stringc(reader->getNodeName()) == core::stringc("element_position") ) - { - hasNode = true; - int id1 = reader->getAttributeValueAsInt("id1"); - if ( id1 != 152722522 ) - { - logTestString("id1 is %d in %s:%d\n", id1, __FILE__, __LINE__); - result = false; - } - int id2 = reader->getAttributeValueAsInt("id2"); - result &= id2 == 3; - int x = reader->getAttributeValueAsInt("x"); - result &= x == 301; - int y = reader->getAttributeValueAsInt("y"); - result &= y == 118; - } - } - } - - if ( !hasNode ) - { - logTestString("missing node in xml in %s:%d\n", __FILE__, __LINE__); - return false; - } - - reader->drop(); - return result; -} - -/** Tests for XML handling */ -bool testXML(void) -{ - IrrlichtDevice *device = createDevice(video::EDT_NULL, dimension2du(400, 200)); - - bool result = true; - - logTestString("Test simple XML reader features.\n"); - result &= simple_xml(device->getFileSystem()); - logTestString("Test XML reader CDATA support.\n"); - result &= cdata(device->getFileSystem()); - logTestString("Test XML reader attribute support.\n"); - result &= attributeValues(device->getFileSystem()); - - device->closeDevice(); - device->run(); - device->drop(); - return result; -} diff --git a/tests/testaabbox.cpp b/tests/testaabbox.cpp deleted file mode 100644 index 01c0815d..00000000 --- a/tests/testaabbox.cpp +++ /dev/null @@ -1,405 +0,0 @@ -// Copyright (C) 2008-2012 Colin MacDonald -// No rights reserved: this software is in the public domain. - -#include "testUtils.h" - -using namespace irr; -using namespace core; - -// These tests are also only called for f32 and f64, due to conversion problems -// in the respective methods. -template<class T> -static bool checkCollisions() -{ - aabbox3d<T> one(0,0,0,4,4,4); - aabbox3d<T> two(2,2,2,4,4,4); - - if (two.getInterpolated(one, 1) != two) - { - logTestString("aabbox3d<T> interpolation wrong on 1\n"); - return false; - } - if (two.getInterpolated(one, 0) != one) - { - logTestString("aabbox3d<T> interpolation wrong on 0\n"); - return false; - } - aabbox3d<T> three(two.getInterpolated(one, 0.5f)); - if (two == one) - { - logTestString("aabbox3d<T> interpolation wrong on 0.5 (right)\n"); - return false; - } - if (two == three) - { - logTestString("aabbox3d<T> interpolation wrong on 0.5 (left)\n"); - return false; - } - three.reset(aabbox3d<T>(2,2,2,5,5,5)); - if (!two.isFullInside(one)) - { - logTestString("small aabbox3d<T> is not fully inside\n"); - return false; - } - if (three.isFullInside(one)) - { - logTestString("large aabbox3d<T> is fully inside\n"); - return false; - } - - if (!two.intersectsWithBox(one)) - { - logTestString("small aabbox3d<T> does not intersect\n"); - return false; - } - if (!three.intersectsWithBox(one)) - { - logTestString("large aabbox3d<T> does not intersect\n"); - return false; - } - - core::line3d<T> line(-2,-2,-2,2,2,2); - if (!one.intersectsWithLine(line)) - { - logTestString("aabbox3d<T> does not intersect with line(1)\n"); - return false; - } - line.end.set(2,2,10); - if (!one.intersectsWithLine(line)) - { - logTestString("aabbox3d<T> does not intersect with line(2)\n"); - return false; - } - line.end.set(0,2,10); - if (one.intersectsWithLine(line)) - { - logTestString("aabbox3d<T> does intersect with line(3)\n"); - return false; - } - return true; -} - -template<class T> -static bool checkPoints() -{ - aabbox3d<T> one(-1,-2,-3,2,2,2); - - if (!one.isPointInside(core::vector3d<T>(-1,-2,-3))) - { - logTestString("isPointInside failed with min vertex\n"); - return false; - } - if (!one.isPointInside(core::vector3d<T>(-1,2,-3))) - { - logTestString("isPointInside failed with other min vertex\n"); - return false; - } - if (!one.isPointInside(core::vector3d<T>(2,-2,2))) - { - logTestString("isPointInside failed with other max vertex\n"); - return false; - } - if (!one.isPointInside(core::vector3d<T>(2,2,2))) - { - logTestString("isPointInside failed with max vertex\n"); - return false; - } - if (!one.isPointInside(core::vector3d<T>(0,0,0))) - { - logTestString("isPointInside failed with origin\n"); - return false; - } - if (!one.isPointInside(core::vector3d<T>((T)1.2,-1,1))) - { - logTestString("isPointInside failed with random point inside\n"); - return false; - } - if (one.isPointInside(core::vector3d<T>(-2,-2,-3))) - { - logTestString("isPointInside failed near min vertex\n"); - return false; - } - if (one.isPointInside(core::vector3d<T>(2,3,2))) - { - logTestString("isPointInside failed near max vertex\n"); - return false; - } - if (one.isPointInside(core::vector3d<T>(3,0,0))) - { - logTestString("isPointInside failed near origin\n"); - return false; - } - if (one.isPointInside(core::vector3d<T>((T)10.2,-1,1))) - { - logTestString("isPointInside failed with random point outside\n"); - return false; - } - if (one.isPointTotalInside(core::vector3d<T>(-1,-2,-3))) - { - logTestString("isPointTotalInside failed with min vertex\n"); - return false; - } - if (one.isPointTotalInside(core::vector3d<T>(-1,2,-3))) - { - logTestString("isPointTotalInside failed with other min vertex\n"); - return false; - } - if (one.isPointTotalInside(core::vector3d<T>(2,-2,2))) - { - logTestString("isPointTotalInside failed with other max vertex\n"); - return false; - } - if (one.isPointTotalInside(core::vector3d<T>(2,2,2))) - { - logTestString("isPointTotalInside failed with max vertex\n"); - return false; - } - if (!one.isPointTotalInside(core::vector3d<T>(0,0,0))) - { - logTestString("isPointTotalInside failed with origin\n"); - return false; - } - if (!one.isPointTotalInside(core::vector3d<T>((T)1.2,-1,1))) - { - logTestString("isPointTotalInside failed with random point inside\n"); - return false; - } - if (one.isPointTotalInside(core::vector3d<T>((T)10.2,-1,1))) - { - logTestString("isPointTotalInside failed with random point outside\n"); - return false; - } - - core::plane3d<T> plane(core::vector3d<T>(0,0,-1), -10); - if (one.classifyPlaneRelation(plane) != core::ISREL3D_BACK) - { - logTestString("box not behind\n"); - return false; - } - plane.D=0; - if (one.classifyPlaneRelation(plane) != core::ISREL3D_CLIPPED) - { - logTestString("box not clipped\n"); - return false; - } - plane.D=10; - if (one.classifyPlaneRelation(plane) != core::ISREL3D_FRONT) - { - logTestString("box not in front\n"); - return false; - } - return true; -} - -template <class T> -static bool doTests() -{ - aabbox3d<T> empty; - aabbox3d<T> one(-1,-1,-1,1,1,1); - if (empty != one) - { - logTestString("default aabbox3d<T> wrong, or comparison failed\n"); - return false; - } - if (empty.getCenter() != core::vector3d<T>(0,0,0)) - { - logTestString("default aabbox3d<T> has wrong Center\n"); - return false; - } - if (empty.getExtent() != core::vector3d<T>(2,2,2)) - { - logTestString("default aabbox3d<T> has wrong Extent\n"); - return false; - } - if (!core::equals(empty.getRadius(), (T)sqrt(3.0))) - { - logTestString("default aabbox3d<T> has wrong radius\n"); - return false; - } - if (empty.isEmpty()) - { - logTestString("default aabbox3d<T> is empty\n"); - return false; - } - if (empty.getVolume() != 8) - { - logTestString("default aabbox3d<T> has wrong volume\n"); - return false; - } - if (empty.getArea() != 24) - { - logTestString("default aabbox3d<T> has wrong area\n"); - return false; - } - aabbox3d<T> two(core::vector3d<T>(-1,-1,-1),core::vector3d<T>(2,2,2)); - if (empty == two) - { - logTestString("empty aabbox3d<T> too large, or comparison failed\n"); - return false; - } - if (two.getCenter() != core::vector3d<T>((T)0.5,(T)0.5,(T)0.5)) - { - logTestString("extended aabbox3d<T> has wrong Center\n"); - return false; - } - if (two.getExtent() != core::vector3d<T>(3,3,3)) - { - logTestString("extended aabbox3d<T> has wrong Extent\n"); - return false; - } - if (!core::equals(two.getRadius(), (T)sqrt(27./4.))) - { - logTestString("extended aabbox3d<T> has wrong radius\n"); - return false; - } - if (two.isEmpty()) - { - logTestString("extended aabbox3d<T> is empty\n"); - return false; - } - if (two.getVolume() != 27) - { - logTestString("extended aabbox3d<T> has wrong volume\n"); - return false; - } - if (two.getArea() != 54) - { - logTestString("extended aabbox3d<T> has wrong area\n"); - return false; - } - one.reset(1,1,1); - if (one==empty) - { - logTestString("reset failed, or comparison failed\n"); - return false; - } - if (one.getCenter() != core::vector3d<T>(1,1,1)) - { - logTestString("singular aabbox3d<T> has wrong Center\n"); - return false; - } - if (one.getExtent() != core::vector3d<T>(0,0,0)) - { - logTestString("singular aabbox3d<T> has Extent\n"); - return false; - } - if (one.getRadius() != 0) - { - logTestString("singular aabbox3d<T> has radius\n"); - return false; - } - if (!one.isEmpty()) - { - logTestString("empty aabbox3d<T> is not empty\n"); - return false; - } - if (one.getVolume() != 0) - { - logTestString("empty aabbox3d<T> has wrong volume\n"); - return false; - } - if (one.getArea() != 0) - { - logTestString("empty aabbox3d<T> has wrong area\n"); - return false; - } - one.addInternalPoint(core::vector3d<T>(-1,-1,-1)); - if (one!=empty) - { - logTestString("addInternalPoint failed, creating default bbox\n"); - return false; - } - one.reset(1,1,1); - one.reset(empty); - if (one!=empty) - { - logTestString("reset with bbox failed, creating default bbox\n"); - return false; - } - one.addInternalPoint(core::vector3d<T>(2,2,2)); - if (one != two) - { - logTestString("addInternalPoint for aabbox3d<T> failed.\n"); - return false; - } - one.addInternalBox(empty); - if (one != two) - { - logTestString("addInternalBox with smaller box failed.\n"); - return false; - } - one.addInternalBox(two); - if (one != two) - { - logTestString("addInternalBox with same box failed.\n"); - return false; - } - one.addInternalPoint(-1,-2,-3); - two.addInternalPoint(-1,-2,-3); - empty.addInternalBox(one); - if (empty != two) - { - logTestString("addInternalBox with larger box failed\n"); - return false; - } - if (one.getCenter() != core::vector3d<T>((T)0.5,0,(T)-0.5)) - { - logTestString("large aabbox3d<T> has wrong Center\n"); - return false; - } - if (one.getExtent() != core::vector3d<T>(3,4,5)) - { - logTestString("large aabbox3d<T> has wrong Extent\n"); - return false; - } - if (!core::equals(one.getRadius(), (T)sqrt(50./4.))) - { - logTestString("large aabbox3d<T> has wrong radius\n"); - return false; - } - if (one.isEmpty()) - { - logTestString("large aabbox3d<T> is empty\n"); - return false; - } - if (one.getVolume() != 60) - { - logTestString("large aabbox3d<T> has wrong volume\n"); - return false; - } - if (one.getArea() != 94) - { - logTestString("large aabbox3d<T> has wrong area\n"); - return false; - } - if (!checkPoints<T>()) - return false; - return true; -} - - -/** Test the functionality of aabbox3d<T>. */ -bool testaabbox3d(void) -{ - bool f32Success = doTests<f32>(); - f32Success &= checkCollisions<f32>(); - if(f32Success) - logTestString("aabbox3d<f32> tests passed\n\n"); - else - logTestString("\n*** aabbox3d<f32> tests failed ***\n\n"); - - bool f64Success = doTests<f64>(); - f64Success &= checkCollisions<f64>(); - if(f64Success) - logTestString("aabbox3d<f64> tests passed\n\n"); - else - logTestString("\n*** aabbox3d<f64> tests failed ***\n\n"); - - bool s32Success = doTests<s32>(); - if(s32Success) - logTestString("aabbox3d<s32> tests passed\n\n"); - else - logTestString("\n*** aabbox3d<s32> tests failed ***\n\n"); - - return f32Success && f64Success && s32Success; -} diff --git a/tests/tests-last-passed-at.txt b/tests/tests-last-passed-at.txt deleted file mode 100644 index 09ce1bdc..00000000 --- a/tests/tests-last-passed-at.txt +++ /dev/null @@ -1,4 +0,0 @@ -Tests finished. 72 tests of 72 passed. -Compiled as DEBUG -Test suite pass at GMT Thu Feb 11 14:00:00 2021 - diff --git a/tests/tests-readme.txt b/tests/tests-readme.txt deleted file mode 100644 index c40b8171..00000000 --- a/tests/tests-readme.txt +++ /dev/null @@ -1,227 +0,0 @@ - -Welcome to the Irrlicht test suite. -=================================== -This is composed of a series of tests which exercise basic Irrlicht -functionality. These are not strictly unit tests, since there is no stub -framework that isolates each method under test. They do however test small -units of functionality and should help to isolate problems and spot -regressions. - -You are encouraged to run the tests whenever you make any significant code -change, and to add tests for any new or modified area of code. - -The overall test application will return a count of the number of tests that -failed, i.e. 0 is success. It will also log to tests/tests.log file, and on -success will update the tests/tests-last-passed-at.txt file (which gets -committed with code changes as a very basic verification that we're not -regressing). - - -Working directory -================= -Since the tests rely on the presence of /media and /empty/empty subdirectories, -the working directory must be the /tests directory, not /bin/$PLATFORM. This -means that you cannot run /bin/$PLATFORM/texts.exe from there. You can however -cd to /tests and run ../bin/$PLATFORM/tests.exe - - -Adding a new test -================= -To add a new test, e.g. "myNewTest": - -1) Create tests/myNewTest.cpp. At a minimum, this must contain a function with - the signature bool fnName(void), where fnName is the same as the filename - (without the .cpp suffix). - - This function must return true if the tests passes, or false if it fails. In - this example, the function should be: - - bool myNewTest(void) - { - ... - } - -2) Add myNewTest.cpp to the build targets in tests.cbp, tests_vc8.vcproj and - tests_vc9.vcproj. These are all text files that can be edited manually by - hand; just copy, paste and modify an existing source file entry. - -3) In tests/main.cpp, find the list of TEST() macro calls, and add a call to - your new test, using the TEST macro, e.g.: - - TEST(myNewTest); - -4) Run your test, and verify any images that it produces (see "Screenshots"). - -5) Remember to svn add tests/newNewTest.cpp and any new tests/media/ files. - -Your test will be run independently in its own indepedent process. It is -responsible for creating any required resources or Irrlicht interfaces, and for -cleaning up after itself and restoring the working directory to /tests. You do -not have to link against Irrlicht.lib; the whole application is already linked -to it. - - -Logging -======= -Please use logTestString() to log any interesting output or fails from your -test. This is declared in tests/testUtils.h. Its output goes to -tests/tests.log - - -Screenshots -=========== -testUtils.h/.cpp provides a function to create a screenshot and compare it with -a reference image. This is useful for validating new or changed functionality, -and for catching regressions. - -Call the unambiguously named takeScreenshotAndCompareAgainstReference() -function to do this. It needs an IVideoDriver (which it will use to create the -first part of the filename) and a unique filename including an image format -suffix, e.g. "-myNewTest.png". You should use .png as a suffix unless you have -a very specific need to use another format. Please avoid using .jpg as image -compression can introduce artifacts and false fails. - -Optionally, you can specify the amount of match that is required between the -produced screenshot and the reference image. While the images should match -exactly, we have found that OpenGL implementations can vary significantly -across test machines, often around 99% match (of total colour values across all -pixels). You may have to go as low as 98% for some images, but please try to -err on the side of strictness until we can determine that your test image needs -to be fuzzier on other peoples' machines. - -If takeScreenshotAndCompareAgainstReference() can't find an existing reference -image, it will create one from the screenshot. In effect, this means that you -have to run your test once (expecting it to fail) in order to produce the -initial reference images. The new images are created in tests/results with -filename: - -driverName-filename.suffix - -e.g. OpenGL-myNewTest.png (note that the OpenGL driver elides the actual OpenGL -version number from the filename, as this tends to differ between machines and -installations). - -You should check these new images carefully to ensure that they show exactly -what you expect. Please do not just assume that they do, as validating bad -behaviour is worse than not validating it at all! - -If the images do appear exactly as you expect, move them to the tests/media -directory, and re-run the tests. They should now pass. Remember to svn add -any new media files! - - -What to do when the tests fail -============================== -DON'T PANIC! - -This is a Good Thing. Failing tests challenge our assumptions and help us to -make Irrlicht more robust. - -First, check your working directory. The tests need to be run from the tests/ -directory, not a /bin subdirectory. You can do this using the working -directory in your debugger, or on the command line by running the tests -executable (wherever it is build) from the tests/ directory. - -If you need to debug a test, first move it temporarily to the start of the list -of TEST() macros. This is because each test runs in its own process, so only -the first test will have the debugger attached. - -If the fail is due to a bitmap difference, carefully compare the bitmaps, and -the amount of failure. The OpenGL device does tend to produce differences. You -should not just automatically make a test fuzzier, but if you can rule out any -real issue in the code, it can be valid to accept OpenGL image matches as low -as 98%. Other devices should not require this amount of fuzziness! - -If you can't figure out the reason for the failure (or better yet, if you can, -and think the tests and/or Irrlicht need updated), then please do raise the -issue in the bug forum: - -http://irrlicht.sourceforge.net/phpBB2/viewforum.php?f=7 - -We do want to hear about fails, and will thank you for finding them. - -Running specific tests -====================== -The app takes two parameters. First is the test to start with (starting at 0 -anddefaulting to 0), the second is the number of tests to run (beginning with -the one given as first parameter). If the second parameter is not given, all -existing tests are run (again starting with the first parameter). So, starting -the test suite without a parameter will really run all tests. Another special -parameter is '--list', which outputs a list of all existing tests and their -respective number. - -For debugging purposes it can make sense to run a test without spawning a -separate process for each test case. This can be switched off by a boolean flag -in main.cpp ('spawn=false'). - -Currently implemented tests -=========================== -000. disambiguateTextures -001. testIrrArray -002. testIrrMap -003. testIrrList -004. exports -005. irrCoreEquals -006. testIrrString -007. testLine2d -008. matrixOps -009. testDimension2d -010. testVector2d -011. testVector3d -012. testQuaternion -013. testS3DVertex -014. testaabbox3d -015. color -016. testTriangle3d -017. vectorPositionDimension2d -018. filesystem -019. archiveReader -020. testXML -021. serializeAttributes -022. fast_atof -023. loadTextures -024. collisionResponseAnimator -025. enumerateImageManipulators -026. removeCustomAnimator -027. sceneCollisionManager -028. sceneNodeAnimator -029. meshLoaders -030. testTimer -031. softwareDevice -032. b3dAnimation -033. burningsVideo -034. billboards -035. createImage -036. cursorSetVisible -037. flyCircleAnimator -038. guiDisabledMenu -039. makeColorKeyTexture -040. md2Animation -041. meshTransform -042. skinnedMesh -043. testGeometryCreator -044. writeImageToFile -045. ioScene -046. videoDriver -047. screenshot -048. drawPixel -049. drawRectOutline -050. drawVertexPrimitive -051. material -052. renderTargetTexture -053. textureFeatures -054. textureRenderStates -055. transparentMaterials -056. userclipplane -057. antiAliasing -058. draw2DImage -059. lights -060. twodmaterial -061. viewPort -062. mrt -063. projectionMatrix -064. planeMatrix -065. terrainSceneNode -066. lightMaps -067. triangleSelector - diff --git a/tests/tests.cbp b/tests/tests.cbp deleted file mode 100644 index f5d2dd10..00000000 --- a/tests/tests.cbp +++ /dev/null @@ -1,159 +0,0 @@ -<?xml version="1.0" encoding="UTF-8" standalone="yes" ?> -<CodeBlocks_project_file> - <FileVersion major="1" minor="6" /> - <Project> - <Option title="tests" /> - <Option pch_mode="2" /> - <Option compiler="gcc" /> - <Build> - <Target title="Win32 Debug"> - <Option output="../bin/gcc/tests" prefix_auto="1" extension_auto="1" /> - <Option object_output="./Debug/" /> - <Option type="1" /> - <Option compiler="gcc" /> - <Compiler> - <Add option="-g" /> - </Compiler> - <Linker> - <Add directory="../lib/Win32-gcc/" /> - </Linker> - </Target> - <Target title="Win32 Release"> - <Option output="../bin/gcc/tests" prefix_auto="1" extension_auto="1" /> - <Option object_output="./Release/" /> - <Option type="1" /> - <Option compiler="gcc" /> - <Compiler> - <Add option="-O3" /> - </Compiler> - <Linker> - <Add option="-s" /> - </Linker> - </Target> - <Target title="Linux Debug"> - <Option platforms="Unix;" /> - <Option output="../bin/gcc/tests" prefix_auto="1" extension_auto="1" /> - <Option object_output="./Debug/" /> - <Option type="1" /> - <Option compiler="gcc" /> - <Compiler> - <Add option="-g" /> - <Add option="-fno-exceptions" /> - <Add option="-D_IRR_STATIC_LIB_" /> - <Add option="-D_DEBUG" /> - </Compiler> - <Linker> - <Add library="Xxf86vm" /> - <Add library="GL" /> - <Add library="X11" /> - <Add directory="../lib/Linux/" /> - </Linker> - </Target> - <Target title="Linux Release"> - <Option platforms="Unix;" /> - <Option output="../bin/gcc/tests" prefix_auto="1" extension_auto="1" /> - <Option object_output="./Release/" /> - <Option type="1" /> - <Option compiler="gcc" /> - <Compiler> - <Add option="-O3" /> - <Add option="-fno-exceptions" /> - <Add option="-D_IRR_STATIC_LIB_" /> - </Compiler> - <Linker> - <Add library="Xxf86vm" /> - <Add library="GL" /> - <Add library="X11" /> - <Add directory="../lib/Linux/" /> - </Linker> - </Target> - </Build> - <Compiler> - <Add option="-Wall" /> - <Add option="-fexceptions" /> - <Add directory="../include" /> - </Compiler> - <Linker> - <Add library="Irrlicht" /> - <Add directory="../lib/gcc" /> - </Linker> - <Unit filename="2dmaterial.cpp" /> - <Unit filename="anti-aliasing.cpp" /> - <Unit filename="archiveReader.cpp" /> - <Unit filename="b3dAnimation.cpp" /> - <Unit filename="billboards.cpp" /> - <Unit filename="burningsVideo.cpp" /> - <Unit filename="collisionResponseAnimator.cpp" /> - <Unit filename="color.cpp" /> - <Unit filename="coreutil.cpp" /> - <Unit filename="createImage.cpp" /> - <Unit filename="cursorSetVisible.cpp" /> - <Unit filename="disambiguateTextures.cpp" /> - <Unit filename="draw2DImage.cpp" /> - <Unit filename="drawPixel.cpp" /> - <Unit filename="drawRectOutline.cpp" /> - <Unit filename="drawVertexPrimitive.cpp" /> - <Unit filename="enumerateImageManipulators.cpp" /> - <Unit filename="exports.cpp" /> - <Unit filename="fast_atof.cpp" /> - <Unit filename="filesystem.cpp" /> - <Unit filename="flyCircleAnimator.cpp" /> - <Unit filename="guiDisabledMenu.cpp" /> - <Unit filename="ioScene.cpp" /> - <Unit filename="irrArray.cpp" /> - <Unit filename="irrCoreEquals.cpp" /> - <Unit filename="irrList.cpp" /> - <Unit filename="irrMap.cpp" /> - <Unit filename="irrString.cpp" /> - <Unit filename="lightMaps.cpp" /> - <Unit filename="lights.cpp" /> - <Unit filename="line2d.cpp" /> - <Unit filename="loadTextures.cpp" /> - <Unit filename="main.cpp" /> - <Unit filename="makeColorKeyTexture.cpp" /> - <Unit filename="material.cpp" /> - <Unit filename="matrixOps.cpp" /> - <Unit filename="md2Animation.cpp" /> - <Unit filename="meshLoaders.cpp" /> - <Unit filename="meshTransform.cpp" /> - <Unit filename="mrt.cpp" /> - <Unit filename="planeMatrix.cpp" /> - <Unit filename="projectionMatrix.cpp" /> - <Unit filename="removeCustomAnimator.cpp" /> - <Unit filename="renderTargetTexture.cpp" /> - <Unit filename="sceneCollisionManager.cpp" /> - <Unit filename="sceneNodeAnimator.cpp" /> - <Unit filename="screenshot.cpp" /> - <Unit filename="serializeAttributes.cpp" /> - <Unit filename="skinnedMesh.cpp" /> - <Unit filename="softwareDevice.cpp" /> - <Unit filename="terrainSceneNode.cpp" /> - <Unit filename="testDimension2d.cpp" /> - <Unit filename="testGeometryCreator.cpp" /> - <Unit filename="testLine2d.cpp" /> - <Unit filename="testQuaternion.cpp" /> - <Unit filename="testS3DVertex.cpp" /> - <Unit filename="testUtils.cpp" /> - <Unit filename="testUtils.h" /> - <Unit filename="testVector2d.cpp" /> - <Unit filename="testVector3d.cpp" /> - <Unit filename="testXML.cpp" /> - <Unit filename="testaabbox.cpp" /> - <Unit filename="textureFeatures.cpp" /> - <Unit filename="textureRenderStates.cpp" /> - <Unit filename="timer.cpp" /> - <Unit filename="transparentMaterials.cpp" /> - <Unit filename="triangle3d.cpp" /> - <Unit filename="triangleSelector.cpp" /> - <Unit filename="userClipPlane.cpp" /> - <Unit filename="vectorPositionDimension2d.cpp" /> - <Unit filename="videoDriver.cpp" /> - <Unit filename="viewPort.cpp" /> - <Unit filename="writeImageToFile.cpp" /> - <Extensions> - <code_completion /> - <debugger /> - <envvars /> - </Extensions> - </Project> -</CodeBlocks_project_file> diff --git a/tests/tests.workspace b/tests/tests.workspace deleted file mode 100644 index 069224f8..00000000 --- a/tests/tests.workspace +++ /dev/null @@ -1,7 +0,0 @@ -<?xml version="1.0" encoding="UTF-8" standalone="yes" ?> -<CodeBlocks_workspace_file> - <Workspace title="tests"> - <Project filename="..\source\Irrlicht\Irrlicht-gcc.cbp" active="1" /> - <Project filename="tests.cbp" /> - </Workspace> -</CodeBlocks_workspace_file> diff --git a/tests/tests_vc10.sln b/tests/tests_vc10.sln deleted file mode 100644 index d94b7c13..00000000 --- a/tests/tests_vc10.sln +++ /dev/null @@ -1,76 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 11.00 -# Visual Studio 2010 -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "tests", "tests_vc10.vcxproj", "{2A1DE18B-F678-4A94-A996-E848E20B2983}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Irrlicht", "..\source\Irrlicht\Irrlicht10.0.vcxproj", "{E08E042A-6C45-411B-92BE-3CC31331019F}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Win32 = Debug|Win32 - Debug|x64 = Debug|x64 - Release - Fast FPU|Win32 = Release - Fast FPU|Win32 - Release - Fast FPU|x64 = Release - Fast FPU|x64 - Release|Win32 = Release|Win32 - Release|x64 = Release|x64 - Static lib - Debug|Win32 = Static lib - Debug|Win32 - Static lib - Debug|x64 = Static lib - Debug|x64 - Static lib - Release - Fast FPU|Win32 = Static lib - Release - Fast FPU|Win32 - Static lib - Release - Fast FPU|x64 = Static lib - Release - Fast FPU|x64 - Static lib - Release|Win32 = Static lib - Release|Win32 - Static lib - Release|x64 = Static lib - Release|x64 - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {2A1DE18B-F678-4A94-A996-E848E20B2983}.Debug|Win32.ActiveCfg = Debug|Win32 - {2A1DE18B-F678-4A94-A996-E848E20B2983}.Debug|Win32.Build.0 = Debug|Win32 - {2A1DE18B-F678-4A94-A996-E848E20B2983}.Debug|x64.ActiveCfg = Debug|x64 - {2A1DE18B-F678-4A94-A996-E848E20B2983}.Debug|x64.Build.0 = Debug|x64 - {2A1DE18B-F678-4A94-A996-E848E20B2983}.Release - Fast FPU|Win32.ActiveCfg = Release|Win32 - {2A1DE18B-F678-4A94-A996-E848E20B2983}.Release - Fast FPU|Win32.Build.0 = Release|Win32 - {2A1DE18B-F678-4A94-A996-E848E20B2983}.Release - Fast FPU|x64.ActiveCfg = Release|x64 - {2A1DE18B-F678-4A94-A996-E848E20B2983}.Release - Fast FPU|x64.Build.0 = Release|x64 - {2A1DE18B-F678-4A94-A996-E848E20B2983}.Release|Win32.ActiveCfg = Release|Win32 - {2A1DE18B-F678-4A94-A996-E848E20B2983}.Release|Win32.Build.0 = Release|Win32 - {2A1DE18B-F678-4A94-A996-E848E20B2983}.Release|x64.ActiveCfg = Release|x64 - {2A1DE18B-F678-4A94-A996-E848E20B2983}.Release|x64.Build.0 = Release|x64 - {2A1DE18B-F678-4A94-A996-E848E20B2983}.Static lib - Debug|Win32.ActiveCfg = Debug|Win32 - {2A1DE18B-F678-4A94-A996-E848E20B2983}.Static lib - Debug|Win32.Build.0 = Debug|Win32 - {2A1DE18B-F678-4A94-A996-E848E20B2983}.Static lib - Debug|x64.ActiveCfg = Debug|x64 - {2A1DE18B-F678-4A94-A996-E848E20B2983}.Static lib - Debug|x64.Build.0 = Debug|x64 - {2A1DE18B-F678-4A94-A996-E848E20B2983}.Static lib - Release - Fast FPU|Win32.ActiveCfg = Release|Win32 - {2A1DE18B-F678-4A94-A996-E848E20B2983}.Static lib - Release - Fast FPU|Win32.Build.0 = Release|Win32 - {2A1DE18B-F678-4A94-A996-E848E20B2983}.Static lib - Release - Fast FPU|x64.ActiveCfg = Release|x64 - {2A1DE18B-F678-4A94-A996-E848E20B2983}.Static lib - Release - Fast FPU|x64.Build.0 = Release|x64 - {2A1DE18B-F678-4A94-A996-E848E20B2983}.Static lib - Release|Win32.ActiveCfg = Release|Win32 - {2A1DE18B-F678-4A94-A996-E848E20B2983}.Static lib - Release|Win32.Build.0 = Release|Win32 - {2A1DE18B-F678-4A94-A996-E848E20B2983}.Static lib - Release|x64.ActiveCfg = Release|x64 - {2A1DE18B-F678-4A94-A996-E848E20B2983}.Static lib - Release|x64.Build.0 = Release|x64 - {E08E042A-6C45-411B-92BE-3CC31331019F}.Debug|Win32.ActiveCfg = Debug|Win32 - {E08E042A-6C45-411B-92BE-3CC31331019F}.Debug|Win32.Build.0 = Debug|Win32 - {E08E042A-6C45-411B-92BE-3CC31331019F}.Debug|x64.ActiveCfg = Debug|x64 - {E08E042A-6C45-411B-92BE-3CC31331019F}.Debug|x64.Build.0 = Debug|x64 - {E08E042A-6C45-411B-92BE-3CC31331019F}.Release - Fast FPU|Win32.ActiveCfg = Release - Fast FPU|Win32 - {E08E042A-6C45-411B-92BE-3CC31331019F}.Release - Fast FPU|Win32.Build.0 = Release - Fast FPU|Win32 - {E08E042A-6C45-411B-92BE-3CC31331019F}.Release - Fast FPU|x64.ActiveCfg = Release - Fast FPU|x64 - {E08E042A-6C45-411B-92BE-3CC31331019F}.Release - Fast FPU|x64.Build.0 = Release - Fast FPU|x64 - {E08E042A-6C45-411B-92BE-3CC31331019F}.Release|Win32.ActiveCfg = Release|Win32 - {E08E042A-6C45-411B-92BE-3CC31331019F}.Release|Win32.Build.0 = Release|Win32 - {E08E042A-6C45-411B-92BE-3CC31331019F}.Release|x64.ActiveCfg = Release|x64 - {E08E042A-6C45-411B-92BE-3CC31331019F}.Release|x64.Build.0 = Release|x64 - {E08E042A-6C45-411B-92BE-3CC31331019F}.Static lib - Debug|Win32.ActiveCfg = Static lib - Debug|Win32 - {E08E042A-6C45-411B-92BE-3CC31331019F}.Static lib - Debug|Win32.Build.0 = Static lib - Debug|Win32 - {E08E042A-6C45-411B-92BE-3CC31331019F}.Static lib - Debug|x64.ActiveCfg = Static lib - Debug|x64 - {E08E042A-6C45-411B-92BE-3CC31331019F}.Static lib - Debug|x64.Build.0 = Static lib - Debug|x64 - {E08E042A-6C45-411B-92BE-3CC31331019F}.Static lib - Release - Fast FPU|Win32.ActiveCfg = Static lib - Release - Fast FPU|Win32 - {E08E042A-6C45-411B-92BE-3CC31331019F}.Static lib - Release - Fast FPU|Win32.Build.0 = Static lib - Release - Fast FPU|Win32 - {E08E042A-6C45-411B-92BE-3CC31331019F}.Static lib - Release - Fast FPU|x64.ActiveCfg = Static lib - Release - Fast FPU|x64 - {E08E042A-6C45-411B-92BE-3CC31331019F}.Static lib - Release - Fast FPU|x64.Build.0 = Static lib - Release - Fast FPU|x64 - {E08E042A-6C45-411B-92BE-3CC31331019F}.Static lib - Release|Win32.ActiveCfg = Static lib - Release|Win32 - {E08E042A-6C45-411B-92BE-3CC31331019F}.Static lib - Release|Win32.Build.0 = Static lib - Release|Win32 - {E08E042A-6C45-411B-92BE-3CC31331019F}.Static lib - Release|x64.ActiveCfg = Static lib - Release|x64 - {E08E042A-6C45-411B-92BE-3CC31331019F}.Static lib - Release|x64.Build.0 = Static lib - Release|x64 - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/tests/tests_vc10.vcxproj b/tests/tests_vc10.vcxproj deleted file mode 100644 index 8e225799..00000000 --- a/tests/tests_vc10.vcxproj +++ /dev/null @@ -1,239 +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>tests</ProjectName> - <ProjectGuid>{2A1DE18B-F678-4A94-A996-E848E20B2983}</ProjectGuid> - <RootNamespace>tests</RootNamespace> - </PropertyGroup> - <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" /> - <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration"> - <ConfigurationType>Application</ConfigurationType> - <CharacterSet>MultiByte</CharacterSet> - <WholeProgramOptimization>true</WholeProgramOptimization> - <PlatformToolset>Windows7.1SDK</PlatformToolset> - </PropertyGroup> - <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration"> - <ConfigurationType>Application</ConfigurationType> - <CharacterSet>MultiByte</CharacterSet> - <WholeProgramOptimization>true</WholeProgramOptimization> - <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" /> - </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" /> - </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" /> - </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" /> - </ImportGroup> - <PropertyGroup Label="UserMacros" /> - <PropertyGroup> - <_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion> - <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'" /> - <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">..\bin\Win32-VisualStudio\</OutDir> - <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">..\bin\Win64-VisualStudio\</OutDir> - </PropertyGroup> - <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> - <ClCompile> - <Optimization>Disabled</Optimization> - <AdditionalIncludeDirectories>..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> - <MinimalRebuild>true</MinimalRebuild> - <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks> - <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary> - <WarningLevel>Level3</WarningLevel> - </ClCompile> - <Link> - <AdditionalDependencies>..\lib\Win32-visualstudio\Irrlicht.lib;%(AdditionalDependencies)</AdditionalDependencies> - <GenerateDebugInformation>true</GenerateDebugInformation> - <DataExecutionPrevention> - </DataExecutionPrevention> - </Link> - </ItemDefinitionGroup> - <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'"> - <ClCompile> - <Optimization>Disabled</Optimization> - <AdditionalIncludeDirectories>..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> - <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks> - <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary> - <WarningLevel>Level3</WarningLevel> - </ClCompile> - <Link> - <AdditionalDependencies>..\lib\Win64-visualstudio\Irrlicht.lib;%(AdditionalDependencies)</AdditionalDependencies> - <GenerateDebugInformation>true</GenerateDebugInformation> - <DataExecutionPrevention> - </DataExecutionPrevention> - </Link> - </ItemDefinitionGroup> - <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> - <ClCompile> - <Optimization>MaxSpeed</Optimization> - <IntrinsicFunctions>true</IntrinsicFunctions> - <AdditionalIncludeDirectories>..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> - <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary> - <FunctionLevelLinking>true</FunctionLevelLinking> - <WarningLevel>Level3</WarningLevel> - </ClCompile> - <Link> - <AdditionalDependencies>..\lib\Win32-visualstudio\Irrlicht.lib;%(AdditionalDependencies)</AdditionalDependencies> - <GenerateDebugInformation>false</GenerateDebugInformation> - <OptimizeReferences>true</OptimizeReferences> - <EnableCOMDATFolding>true</EnableCOMDATFolding> - <DataExecutionPrevention> - </DataExecutionPrevention> - </Link> - </ItemDefinitionGroup> - <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'"> - <ClCompile> - <Optimization>MaxSpeed</Optimization> - <IntrinsicFunctions>true</IntrinsicFunctions> - <AdditionalIncludeDirectories>..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> - <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary> - <FunctionLevelLinking>true</FunctionLevelLinking> - <WarningLevel>Level3</WarningLevel> - </ClCompile> - <Link> - <AdditionalDependencies>..\lib\Win64-visualstudio\Irrlicht.lib;%(AdditionalDependencies)</AdditionalDependencies> - <GenerateDebugInformation>false</GenerateDebugInformation> - <OptimizeReferences>true</OptimizeReferences> - <EnableCOMDATFolding>true</EnableCOMDATFolding> - <DataExecutionPrevention> - </DataExecutionPrevention> - </Link> - </ItemDefinitionGroup> - <ItemGroup> - <ClCompile Include="2dmaterial.cpp" /> - <ClCompile Include="anti-aliasing.cpp" /> - <ClCompile Include="archiveReader.cpp" /> - <ClCompile Include="b3dAnimation.cpp" /> - <ClCompile Include="billboards.cpp" /> - <ClCompile Include="burningsVideo.cpp" /> - <ClCompile Include="collisionResponseAnimator.cpp" /> - <ClCompile Include="color.cpp" /> - <ClCompile Include="coreutil.cpp" /> - <ClCompile Include="createImage.cpp" /> - <ClCompile Include="cursorSetVisible.cpp" /> - <ClCompile Include="disambiguateTextures.cpp" /> - <ClCompile Include="draw2DImage.cpp" /> - <ClCompile Include="drawPixel.cpp" /> - <ClCompile Include="drawRectOutline.cpp" /> - <ClCompile Include="drawVertexPrimitive.cpp" /> - <ClCompile Include="enumerateImageManipulators.cpp" /> - <ClCompile Include="exports.cpp" /> - <ClCompile Include="fast_atof.cpp" /> - <ClCompile Include="filesystem.cpp" /> - <ClCompile Include="flyCircleAnimator.cpp" /> - <ClCompile Include="guiDisabledMenu.cpp" /> - <ClCompile Include="ioScene.cpp" /> - <ClCompile Include="irrArray.cpp" /> - <ClCompile Include="irrCoreEquals.cpp" /> - <ClCompile Include="irrList.cpp" /> - <ClCompile Include="irrMap.cpp" /> - <ClCompile Include="irrString.cpp" /> - <ClCompile Include="lightMaps.cpp" /> - <ClCompile Include="lights.cpp" /> - <ClCompile Include="line2d.cpp" /> - <ClCompile Include="loadTextures.cpp" /> - <ClCompile Include="main.cpp" /> - <ClCompile Include="makeColorKeyTexture.cpp" /> - <ClCompile Include="material.cpp" /> - <ClCompile Include="matrixOps.cpp" /> - <ClCompile Include="md2Animation.cpp" /> - <ClCompile Include="meshLoaders.cpp" /> - <ClCompile Include="meshTransform.cpp" /> - <ClCompile Include="mrt.cpp" /> - <ClCompile Include="orthoCam.cpp" /> - <ClCompile Include="planeMatrix.cpp" /> - <ClCompile Include="projectionMatrix.cpp" /> - <ClCompile Include="removeCustomAnimator.cpp" /> - <ClCompile Include="renderTargetTexture.cpp" /> - <ClCompile Include="sceneCollisionManager.cpp" /> - <ClCompile Include="sceneNodeAnimator.cpp" /> - <ClCompile Include="screenshot.cpp" /> - <ClCompile Include="serializeAttributes.cpp" /> - <ClCompile Include="skinnedMesh.cpp" /> - <ClCompile Include="softwareDevice.cpp" /> - <ClCompile Include="stencilshadow.cpp" /> - <ClCompile Include="terrainSceneNode.cpp" /> - <ClCompile Include="testaabbox.cpp" /> - <ClCompile Include="testDimension2d.cpp" /> - <ClCompile Include="testGeometryCreator.cpp" /> - <ClCompile Include="testLine2d.cpp" /> - <ClCompile Include="testQuaternion.cpp" /> - <ClCompile Include="testS3DVertex.cpp" /> - <ClCompile Include="testUtils.cpp" /> - <ClCompile Include="testVector2d.cpp" /> - <ClCompile Include="testVector3d.cpp" /> - <ClCompile Include="testXML.cpp" /> - <ClCompile Include="textureFeatures.cpp" /> - <ClCompile Include="textureRenderStates.cpp" /> - <ClCompile Include="timer.cpp" /> - <ClCompile Include="transparentMaterials.cpp" /> - <ClCompile Include="triangle3d.cpp" /> - <ClCompile Include="triangleSelector.cpp" /> - <ClCompile Include="userClipPlane.cpp" /> - <ClCompile Include="vectorPositionDimension2d.cpp" /> - <ClCompile Include="videoDriver.cpp" /> - <ClCompile Include="viewPort.cpp" /> - <ClCompile Include="writeImageToFile.cpp" /> - </ItemGroup> - <ItemGroup> - <ClInclude Include="testUtils.h" /> - </ItemGroup> - <ItemGroup> - <ProjectReference Include="..\source\Irrlicht\Irrlicht10.0.vcxproj"> - <Project>{e08e042a-6c45-411b-92be-3cc31331019f}</Project> - <ReferenceOutputAssembly>false</ReferenceOutputAssembly> - </ProjectReference> - </ItemGroup> - <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" /> - <ImportGroup Label="ExtensionTargets"> - </ImportGroup> -</Project> diff --git a/tests/tests_vc11.sln b/tests/tests_vc11.sln deleted file mode 100644 index 85e0fa4e..00000000 --- a/tests/tests_vc11.sln +++ /dev/null @@ -1,76 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 11.00 -# Visual Studio 2012 -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "tests", "tests_vc11.vcxproj", "{2A1DE18B-F678-4A94-A996-E848E20B2983}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Irrlicht", "..\source\Irrlicht\Irrlicht11.0.vcxproj", "{E08E042A-6C45-411B-92BE-3CC31331019F}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Win32 = Debug|Win32 - Debug|x64 = Debug|x64 - Release - Fast FPU|Win32 = Release - Fast FPU|Win32 - Release - Fast FPU|x64 = Release - Fast FPU|x64 - Release|Win32 = Release|Win32 - Release|x64 = Release|x64 - Static lib - Debug|Win32 = Static lib - Debug|Win32 - Static lib - Debug|x64 = Static lib - Debug|x64 - Static lib - Release - Fast FPU|Win32 = Static lib - Release - Fast FPU|Win32 - Static lib - Release - Fast FPU|x64 = Static lib - Release - Fast FPU|x64 - Static lib - Release|Win32 = Static lib - Release|Win32 - Static lib - Release|x64 = Static lib - Release|x64 - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {2A1DE18B-F678-4A94-A996-E848E20B2983}.Debug|Win32.ActiveCfg = Debug|Win32 - {2A1DE18B-F678-4A94-A996-E848E20B2983}.Debug|Win32.Build.0 = Debug|Win32 - {2A1DE18B-F678-4A94-A996-E848E20B2983}.Debug|x64.ActiveCfg = Debug|x64 - {2A1DE18B-F678-4A94-A996-E848E20B2983}.Debug|x64.Build.0 = Debug|x64 - {2A1DE18B-F678-4A94-A996-E848E20B2983}.Release - Fast FPU|Win32.ActiveCfg = Release|Win32 - {2A1DE18B-F678-4A94-A996-E848E20B2983}.Release - Fast FPU|Win32.Build.0 = Release|Win32 - {2A1DE18B-F678-4A94-A996-E848E20B2983}.Release - Fast FPU|x64.ActiveCfg = Release|x64 - {2A1DE18B-F678-4A94-A996-E848E20B2983}.Release - Fast FPU|x64.Build.0 = Release|x64 - {2A1DE18B-F678-4A94-A996-E848E20B2983}.Release|Win32.ActiveCfg = Release|Win32 - {2A1DE18B-F678-4A94-A996-E848E20B2983}.Release|Win32.Build.0 = Release|Win32 - {2A1DE18B-F678-4A94-A996-E848E20B2983}.Release|x64.ActiveCfg = Release|x64 - {2A1DE18B-F678-4A94-A996-E848E20B2983}.Release|x64.Build.0 = Release|x64 - {2A1DE18B-F678-4A94-A996-E848E20B2983}.Static lib - Debug|Win32.ActiveCfg = Debug|Win32 - {2A1DE18B-F678-4A94-A996-E848E20B2983}.Static lib - Debug|Win32.Build.0 = Debug|Win32 - {2A1DE18B-F678-4A94-A996-E848E20B2983}.Static lib - Debug|x64.ActiveCfg = Debug|x64 - {2A1DE18B-F678-4A94-A996-E848E20B2983}.Static lib - Debug|x64.Build.0 = Debug|x64 - {2A1DE18B-F678-4A94-A996-E848E20B2983}.Static lib - Release - Fast FPU|Win32.ActiveCfg = Release|Win32 - {2A1DE18B-F678-4A94-A996-E848E20B2983}.Static lib - Release - Fast FPU|Win32.Build.0 = Release|Win32 - {2A1DE18B-F678-4A94-A996-E848E20B2983}.Static lib - Release - Fast FPU|x64.ActiveCfg = Release|x64 - {2A1DE18B-F678-4A94-A996-E848E20B2983}.Static lib - Release - Fast FPU|x64.Build.0 = Release|x64 - {2A1DE18B-F678-4A94-A996-E848E20B2983}.Static lib - Release|Win32.ActiveCfg = Release|Win32 - {2A1DE18B-F678-4A94-A996-E848E20B2983}.Static lib - Release|Win32.Build.0 = Release|Win32 - {2A1DE18B-F678-4A94-A996-E848E20B2983}.Static lib - Release|x64.ActiveCfg = Release|x64 - {2A1DE18B-F678-4A94-A996-E848E20B2983}.Static lib - Release|x64.Build.0 = Release|x64 - {E08E042A-6C45-411B-92BE-3CC31331019F}.Debug|Win32.ActiveCfg = Debug|Win32 - {E08E042A-6C45-411B-92BE-3CC31331019F}.Debug|Win32.Build.0 = Debug|Win32 - {E08E042A-6C45-411B-92BE-3CC31331019F}.Debug|x64.ActiveCfg = Debug|x64 - {E08E042A-6C45-411B-92BE-3CC31331019F}.Debug|x64.Build.0 = Debug|x64 - {E08E042A-6C45-411B-92BE-3CC31331019F}.Release - Fast FPU|Win32.ActiveCfg = Release - Fast FPU|Win32 - {E08E042A-6C45-411B-92BE-3CC31331019F}.Release - Fast FPU|Win32.Build.0 = Release - Fast FPU|Win32 - {E08E042A-6C45-411B-92BE-3CC31331019F}.Release - Fast FPU|x64.ActiveCfg = Release - Fast FPU|x64 - {E08E042A-6C45-411B-92BE-3CC31331019F}.Release - Fast FPU|x64.Build.0 = Release - Fast FPU|x64 - {E08E042A-6C45-411B-92BE-3CC31331019F}.Release|Win32.ActiveCfg = Release|Win32 - {E08E042A-6C45-411B-92BE-3CC31331019F}.Release|Win32.Build.0 = Release|Win32 - {E08E042A-6C45-411B-92BE-3CC31331019F}.Release|x64.ActiveCfg = Release|x64 - {E08E042A-6C45-411B-92BE-3CC31331019F}.Release|x64.Build.0 = Release|x64 - {E08E042A-6C45-411B-92BE-3CC31331019F}.Static lib - Debug|Win32.ActiveCfg = Static lib - Debug|Win32 - {E08E042A-6C45-411B-92BE-3CC31331019F}.Static lib - Debug|Win32.Build.0 = Static lib - Debug|Win32 - {E08E042A-6C45-411B-92BE-3CC31331019F}.Static lib - Debug|x64.ActiveCfg = Static lib - Debug|x64 - {E08E042A-6C45-411B-92BE-3CC31331019F}.Static lib - Debug|x64.Build.0 = Static lib - Debug|x64 - {E08E042A-6C45-411B-92BE-3CC31331019F}.Static lib - Release - Fast FPU|Win32.ActiveCfg = Static lib - Release - Fast FPU|Win32 - {E08E042A-6C45-411B-92BE-3CC31331019F}.Static lib - Release - Fast FPU|Win32.Build.0 = Static lib - Release - Fast FPU|Win32 - {E08E042A-6C45-411B-92BE-3CC31331019F}.Static lib - Release - Fast FPU|x64.ActiveCfg = Static lib - Release - Fast FPU|x64 - {E08E042A-6C45-411B-92BE-3CC31331019F}.Static lib - Release - Fast FPU|x64.Build.0 = Static lib - Release - Fast FPU|x64 - {E08E042A-6C45-411B-92BE-3CC31331019F}.Static lib - Release|Win32.ActiveCfg = Static lib - Release|Win32 - {E08E042A-6C45-411B-92BE-3CC31331019F}.Static lib - Release|Win32.Build.0 = Static lib - Release|Win32 - {E08E042A-6C45-411B-92BE-3CC31331019F}.Static lib - Release|x64.ActiveCfg = Static lib - Release|x64 - {E08E042A-6C45-411B-92BE-3CC31331019F}.Static lib - Release|x64.Build.0 = Static lib - Release|x64 - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/tests/tests_vc11.vcxproj b/tests/tests_vc11.vcxproj deleted file mode 100644 index ec454632..00000000 --- a/tests/tests_vc11.vcxproj +++ /dev/null @@ -1,239 +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>tests</ProjectName> - <ProjectGuid>{2A1DE18B-F678-4A94-A996-E848E20B2983}</ProjectGuid> - <RootNamespace>tests</RootNamespace> - </PropertyGroup> - <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" /> - <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration"> - <ConfigurationType>Application</ConfigurationType> - <CharacterSet>MultiByte</CharacterSet> - <WholeProgramOptimization>true</WholeProgramOptimization> - <PlatformToolset>Windows7.1SDK</PlatformToolset> - </PropertyGroup> - <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration"> - <ConfigurationType>Application</ConfigurationType> - <CharacterSet>MultiByte</CharacterSet> - <WholeProgramOptimization>true</WholeProgramOptimization> - <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" /> - </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" /> - </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" /> - </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" /> - </ImportGroup> - <PropertyGroup Label="UserMacros" /> - <PropertyGroup> - <_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion> - <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'" /> - <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">..\bin\Win32-VisualStudio\</OutDir> - <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">..\bin\Win64-VisualStudio\</OutDir> - </PropertyGroup> - <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> - <ClCompile> - <Optimization>Disabled</Optimization> - <AdditionalIncludeDirectories>..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> - <MinimalRebuild>true</MinimalRebuild> - <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks> - <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary> - <WarningLevel>Level3</WarningLevel> - </ClCompile> - <Link> - <AdditionalDependencies>..\lib\Win32-visualstudio\Irrlicht.lib;%(AdditionalDependencies)</AdditionalDependencies> - <GenerateDebugInformation>true</GenerateDebugInformation> - <DataExecutionPrevention> - </DataExecutionPrevention> - </Link> - </ItemDefinitionGroup> - <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'"> - <ClCompile> - <Optimization>Disabled</Optimization> - <AdditionalIncludeDirectories>..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> - <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks> - <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary> - <WarningLevel>Level3</WarningLevel> - </ClCompile> - <Link> - <AdditionalDependencies>..\lib\Win64-visualstudio\Irrlicht.lib;%(AdditionalDependencies)</AdditionalDependencies> - <GenerateDebugInformation>true</GenerateDebugInformation> - <DataExecutionPrevention> - </DataExecutionPrevention> - </Link> - </ItemDefinitionGroup> - <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> - <ClCompile> - <Optimization>MaxSpeed</Optimization> - <IntrinsicFunctions>true</IntrinsicFunctions> - <AdditionalIncludeDirectories>..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> - <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary> - <FunctionLevelLinking>true</FunctionLevelLinking> - <WarningLevel>Level3</WarningLevel> - </ClCompile> - <Link> - <AdditionalDependencies>..\lib\Win32-visualstudio\Irrlicht.lib;%(AdditionalDependencies)</AdditionalDependencies> - <GenerateDebugInformation>false</GenerateDebugInformation> - <OptimizeReferences>true</OptimizeReferences> - <EnableCOMDATFolding>true</EnableCOMDATFolding> - <DataExecutionPrevention> - </DataExecutionPrevention> - </Link> - </ItemDefinitionGroup> - <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'"> - <ClCompile> - <Optimization>MaxSpeed</Optimization> - <IntrinsicFunctions>true</IntrinsicFunctions> - <AdditionalIncludeDirectories>..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> - <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary> - <FunctionLevelLinking>true</FunctionLevelLinking> - <WarningLevel>Level3</WarningLevel> - </ClCompile> - <Link> - <AdditionalDependencies>..\lib\Win64-visualstudio\Irrlicht.lib;%(AdditionalDependencies)</AdditionalDependencies> - <GenerateDebugInformation>false</GenerateDebugInformation> - <OptimizeReferences>true</OptimizeReferences> - <EnableCOMDATFolding>true</EnableCOMDATFolding> - <DataExecutionPrevention> - </DataExecutionPrevention> - </Link> - </ItemDefinitionGroup> - <ItemGroup> - <ClCompile Include="2dmaterial.cpp" /> - <ClCompile Include="anti-aliasing.cpp" /> - <ClCompile Include="archiveReader.cpp" /> - <ClCompile Include="b3dAnimation.cpp" /> - <ClCompile Include="billboards.cpp" /> - <ClCompile Include="burningsVideo.cpp" /> - <ClCompile Include="collisionResponseAnimator.cpp" /> - <ClCompile Include="color.cpp" /> - <ClCompile Include="coreutil.cpp" /> - <ClCompile Include="createImage.cpp" /> - <ClCompile Include="cursorSetVisible.cpp" /> - <ClCompile Include="disambiguateTextures.cpp" /> - <ClCompile Include="draw2DImage.cpp" /> - <ClCompile Include="drawPixel.cpp" /> - <ClCompile Include="drawRectOutline.cpp" /> - <ClCompile Include="drawVertexPrimitive.cpp" /> - <ClCompile Include="enumerateImageManipulators.cpp" /> - <ClCompile Include="exports.cpp" /> - <ClCompile Include="fast_atof.cpp" /> - <ClCompile Include="filesystem.cpp" /> - <ClCompile Include="flyCircleAnimator.cpp" /> - <ClCompile Include="guiDisabledMenu.cpp" /> - <ClCompile Include="ioScene.cpp" /> - <ClCompile Include="irrArray.cpp" /> - <ClCompile Include="irrCoreEquals.cpp" /> - <ClCompile Include="irrList.cpp" /> - <ClCompile Include="irrMap.cpp" /> - <ClCompile Include="irrString.cpp" /> - <ClCompile Include="lightMaps.cpp" /> - <ClCompile Include="lights.cpp" /> - <ClCompile Include="line2d.cpp" /> - <ClCompile Include="loadTextures.cpp" /> - <ClCompile Include="main.cpp" /> - <ClCompile Include="makeColorKeyTexture.cpp" /> - <ClCompile Include="material.cpp" /> - <ClCompile Include="matrixOps.cpp" /> - <ClCompile Include="md2Animation.cpp" /> - <ClCompile Include="meshLoaders.cpp" /> - <ClCompile Include="meshTransform.cpp" /> - <ClCompile Include="mrt.cpp" /> - <ClCompile Include="orthoCam.cpp" /> - <ClCompile Include="planeMatrix.cpp" /> - <ClCompile Include="projectionMatrix.cpp" /> - <ClCompile Include="removeCustomAnimator.cpp" /> - <ClCompile Include="renderTargetTexture.cpp" /> - <ClCompile Include="sceneCollisionManager.cpp" /> - <ClCompile Include="sceneNodeAnimator.cpp" /> - <ClCompile Include="screenshot.cpp" /> - <ClCompile Include="serializeAttributes.cpp" /> - <ClCompile Include="skinnedMesh.cpp" /> - <ClCompile Include="softwareDevice.cpp" /> - <ClCompile Include="stencilshadow.cpp" /> - <ClCompile Include="terrainSceneNode.cpp" /> - <ClCompile Include="testaabbox.cpp" /> - <ClCompile Include="testDimension2d.cpp" /> - <ClCompile Include="testGeometryCreator.cpp" /> - <ClCompile Include="testLine2d.cpp" /> - <ClCompile Include="testQuaternion.cpp" /> - <ClCompile Include="testS3DVertex.cpp" /> - <ClCompile Include="testUtils.cpp" /> - <ClCompile Include="testVector2d.cpp" /> - <ClCompile Include="testVector3d.cpp" /> - <ClCompile Include="testXML.cpp" /> - <ClCompile Include="textureFeatures.cpp" /> - <ClCompile Include="textureRenderStates.cpp" /> - <ClCompile Include="timer.cpp" /> - <ClCompile Include="transparentMaterials.cpp" /> - <ClCompile Include="triangle3d.cpp" /> - <ClCompile Include="triangleSelector.cpp" /> - <ClCompile Include="userClipPlane.cpp" /> - <ClCompile Include="vectorPositionDimension2d.cpp" /> - <ClCompile Include="videoDriver.cpp" /> - <ClCompile Include="viewPort.cpp" /> - <ClCompile Include="writeImageToFile.cpp" /> - </ItemGroup> - <ItemGroup> - <ClInclude Include="testUtils.h" /> - </ItemGroup> - <ItemGroup> - <ProjectReference Include="..\source\Irrlicht\Irrlicht11.0.vcxproj"> - <Project>{e08e042a-6c45-411b-92be-3cc31331019f}</Project> - <ReferenceOutputAssembly>false</ReferenceOutputAssembly> - </ProjectReference> - </ItemGroup> - <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" /> - <ImportGroup Label="ExtensionTargets"> - </ImportGroup> -</Project> \ No newline at end of file diff --git a/tests/tests_vc12.sln b/tests/tests_vc12.sln deleted file mode 100644 index 098c24ea..00000000 --- a/tests/tests_vc12.sln +++ /dev/null @@ -1,88 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio Express 2013 for Windows Desktop -VisualStudioVersion = 12.0.30501.0 -MinimumVisualStudioVersion = 10.0.40219.1 -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Irrlicht", "..\source\Irrlicht\Irrlicht12.0.vcxproj", "{E08E042A-6C45-411B-92BE-3CC31331019F}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "tests", "tests_vc12.vcxproj", "{2A1DE18B-F678-4A94-A996-E848E20B2983}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Win32 = Debug|Win32 - Debug|x64 = Debug|x64 - Release - Fast FPU|Win32 = Release - Fast FPU|Win32 - Release - Fast FPU|x64 = Release - Fast FPU|x64 - Release|Win32 = Release|Win32 - Release|x64 = Release|x64 - SDL-Debug|Win32 = SDL-Debug|Win32 - SDL-Debug|x64 = SDL-Debug|x64 - Static lib - Debug|Win32 = Static lib - Debug|Win32 - Static lib - Debug|x64 = Static lib - Debug|x64 - Static lib - Release - Fast FPU|Win32 = Static lib - Release - Fast FPU|Win32 - Static lib - Release - Fast FPU|x64 = Static lib - Release - Fast FPU|x64 - Static lib - Release|Win32 = Static lib - Release|Win32 - Static lib - Release|x64 = Static lib - Release|x64 - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {E08E042A-6C45-411B-92BE-3CC31331019F}.Debug|Win32.ActiveCfg = Debug|Win32 - {E08E042A-6C45-411B-92BE-3CC31331019F}.Debug|Win32.Build.0 = Debug|Win32 - {E08E042A-6C45-411B-92BE-3CC31331019F}.Debug|x64.ActiveCfg = Debug|x64 - {E08E042A-6C45-411B-92BE-3CC31331019F}.Debug|x64.Build.0 = Debug|x64 - {E08E042A-6C45-411B-92BE-3CC31331019F}.Release - Fast FPU|Win32.ActiveCfg = Release - Fast FPU|Win32 - {E08E042A-6C45-411B-92BE-3CC31331019F}.Release - Fast FPU|Win32.Build.0 = Release - Fast FPU|Win32 - {E08E042A-6C45-411B-92BE-3CC31331019F}.Release - Fast FPU|x64.ActiveCfg = Release - Fast FPU|x64 - {E08E042A-6C45-411B-92BE-3CC31331019F}.Release - Fast FPU|x64.Build.0 = Release - Fast FPU|x64 - {E08E042A-6C45-411B-92BE-3CC31331019F}.Release|Win32.ActiveCfg = Release|Win32 - {E08E042A-6C45-411B-92BE-3CC31331019F}.Release|Win32.Build.0 = Release|Win32 - {E08E042A-6C45-411B-92BE-3CC31331019F}.Release|x64.ActiveCfg = Release|x64 - {E08E042A-6C45-411B-92BE-3CC31331019F}.Release|x64.Build.0 = Release|x64 - {E08E042A-6C45-411B-92BE-3CC31331019F}.SDL-Debug|Win32.ActiveCfg = SDL-Debug|Win32 - {E08E042A-6C45-411B-92BE-3CC31331019F}.SDL-Debug|Win32.Build.0 = SDL-Debug|Win32 - {E08E042A-6C45-411B-92BE-3CC31331019F}.SDL-Debug|x64.ActiveCfg = SDL-Debug|x64 - {E08E042A-6C45-411B-92BE-3CC31331019F}.SDL-Debug|x64.Build.0 = SDL-Debug|x64 - {E08E042A-6C45-411B-92BE-3CC31331019F}.Static lib - Debug|Win32.ActiveCfg = Static lib - Debug|Win32 - {E08E042A-6C45-411B-92BE-3CC31331019F}.Static lib - Debug|Win32.Build.0 = Static lib - Debug|Win32 - {E08E042A-6C45-411B-92BE-3CC31331019F}.Static lib - Debug|x64.ActiveCfg = Static lib - Debug|x64 - {E08E042A-6C45-411B-92BE-3CC31331019F}.Static lib - Debug|x64.Build.0 = Static lib - Debug|x64 - {E08E042A-6C45-411B-92BE-3CC31331019F}.Static lib - Release - Fast FPU|Win32.ActiveCfg = Static lib - Release - Fast FPU|Win32 - {E08E042A-6C45-411B-92BE-3CC31331019F}.Static lib - Release - Fast FPU|Win32.Build.0 = Static lib - Release - Fast FPU|Win32 - {E08E042A-6C45-411B-92BE-3CC31331019F}.Static lib - Release - Fast FPU|x64.ActiveCfg = Static lib - Release - Fast FPU|x64 - {E08E042A-6C45-411B-92BE-3CC31331019F}.Static lib - Release - Fast FPU|x64.Build.0 = Static lib - Release - Fast FPU|x64 - {E08E042A-6C45-411B-92BE-3CC31331019F}.Static lib - Release|Win32.ActiveCfg = Static lib - Release|Win32 - {E08E042A-6C45-411B-92BE-3CC31331019F}.Static lib - Release|Win32.Build.0 = Static lib - Release|Win32 - {E08E042A-6C45-411B-92BE-3CC31331019F}.Static lib - Release|x64.ActiveCfg = Static lib - Release|x64 - {E08E042A-6C45-411B-92BE-3CC31331019F}.Static lib - Release|x64.Build.0 = Static lib - Release|x64 - {2A1DE18B-F678-4A94-A996-E848E20B2983}.Debug|Win32.ActiveCfg = Debug|Win32 - {2A1DE18B-F678-4A94-A996-E848E20B2983}.Debug|Win32.Build.0 = Debug|Win32 - {2A1DE18B-F678-4A94-A996-E848E20B2983}.Debug|x64.ActiveCfg = Debug|x64 - {2A1DE18B-F678-4A94-A996-E848E20B2983}.Debug|x64.Build.0 = Debug|x64 - {2A1DE18B-F678-4A94-A996-E848E20B2983}.Release - Fast FPU|Win32.ActiveCfg = Release|Win32 - {2A1DE18B-F678-4A94-A996-E848E20B2983}.Release - Fast FPU|Win32.Build.0 = Release|Win32 - {2A1DE18B-F678-4A94-A996-E848E20B2983}.Release - Fast FPU|x64.ActiveCfg = Release|x64 - {2A1DE18B-F678-4A94-A996-E848E20B2983}.Release - Fast FPU|x64.Build.0 = Release|x64 - {2A1DE18B-F678-4A94-A996-E848E20B2983}.Release|Win32.ActiveCfg = Release|Win32 - {2A1DE18B-F678-4A94-A996-E848E20B2983}.Release|Win32.Build.0 = Release|Win32 - {2A1DE18B-F678-4A94-A996-E848E20B2983}.Release|x64.ActiveCfg = Release|x64 - {2A1DE18B-F678-4A94-A996-E848E20B2983}.Release|x64.Build.0 = Release|x64 - {2A1DE18B-F678-4A94-A996-E848E20B2983}.SDL-Debug|Win32.ActiveCfg = Debug|Win32 - {2A1DE18B-F678-4A94-A996-E848E20B2983}.SDL-Debug|Win32.Build.0 = Debug|Win32 - {2A1DE18B-F678-4A94-A996-E848E20B2983}.SDL-Debug|x64.ActiveCfg = Debug|x64 - {2A1DE18B-F678-4A94-A996-E848E20B2983}.SDL-Debug|x64.Build.0 = Debug|x64 - {2A1DE18B-F678-4A94-A996-E848E20B2983}.Static lib - Debug|Win32.ActiveCfg = Debug|Win32 - {2A1DE18B-F678-4A94-A996-E848E20B2983}.Static lib - Debug|Win32.Build.0 = Debug|Win32 - {2A1DE18B-F678-4A94-A996-E848E20B2983}.Static lib - Debug|x64.ActiveCfg = Debug|x64 - {2A1DE18B-F678-4A94-A996-E848E20B2983}.Static lib - Debug|x64.Build.0 = Debug|x64 - {2A1DE18B-F678-4A94-A996-E848E20B2983}.Static lib - Release - Fast FPU|Win32.ActiveCfg = Release|Win32 - {2A1DE18B-F678-4A94-A996-E848E20B2983}.Static lib - Release - Fast FPU|Win32.Build.0 = Release|Win32 - {2A1DE18B-F678-4A94-A996-E848E20B2983}.Static lib - Release - Fast FPU|x64.ActiveCfg = Release|x64 - {2A1DE18B-F678-4A94-A996-E848E20B2983}.Static lib - Release - Fast FPU|x64.Build.0 = Release|x64 - {2A1DE18B-F678-4A94-A996-E848E20B2983}.Static lib - Release|Win32.ActiveCfg = Release|Win32 - {2A1DE18B-F678-4A94-A996-E848E20B2983}.Static lib - Release|Win32.Build.0 = Release|Win32 - {2A1DE18B-F678-4A94-A996-E848E20B2983}.Static lib - Release|x64.ActiveCfg = Release|x64 - {2A1DE18B-F678-4A94-A996-E848E20B2983}.Static lib - Release|x64.Build.0 = Release|x64 - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/tests/tests_vc12.vcxproj b/tests/tests_vc12.vcxproj deleted file mode 100644 index 91a313c7..00000000 --- a/tests/tests_vc12.vcxproj +++ /dev/null @@ -1,239 +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>tests</ProjectName> - <ProjectGuid>{2A1DE18B-F678-4A94-A996-E848E20B2983}</ProjectGuid> - <RootNamespace>tests</RootNamespace> - </PropertyGroup> - <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" /> - <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration"> - <ConfigurationType>Application</ConfigurationType> - <CharacterSet>MultiByte</CharacterSet> - <WholeProgramOptimization>true</WholeProgramOptimization> - <PlatformToolset>Windows7.1SDK</PlatformToolset> - </PropertyGroup> - <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration"> - <ConfigurationType>Application</ConfigurationType> - <CharacterSet>MultiByte</CharacterSet> - <WholeProgramOptimization>true</WholeProgramOptimization> - <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" /> - </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" /> - </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" /> - </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" /> - </ImportGroup> - <PropertyGroup Label="UserMacros" /> - <PropertyGroup> - <_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion> - <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'" /> - <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">..\bin\Win32-VisualStudio\</OutDir> - <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">..\bin\Win64-VisualStudio\</OutDir> - </PropertyGroup> - <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> - <ClCompile> - <Optimization>Disabled</Optimization> - <AdditionalIncludeDirectories>..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> - <MinimalRebuild>true</MinimalRebuild> - <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks> - <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary> - <WarningLevel>Level3</WarningLevel> - </ClCompile> - <Link> - <AdditionalDependencies>..\lib\Win32-visualstudio\Irrlicht.lib;%(AdditionalDependencies)</AdditionalDependencies> - <GenerateDebugInformation>true</GenerateDebugInformation> - <DataExecutionPrevention> - </DataExecutionPrevention> - </Link> - </ItemDefinitionGroup> - <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'"> - <ClCompile> - <Optimization>Disabled</Optimization> - <AdditionalIncludeDirectories>..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> - <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks> - <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary> - <WarningLevel>Level3</WarningLevel> - </ClCompile> - <Link> - <AdditionalDependencies>..\lib\Win64-visualstudio\Irrlicht.lib;%(AdditionalDependencies)</AdditionalDependencies> - <GenerateDebugInformation>true</GenerateDebugInformation> - <DataExecutionPrevention> - </DataExecutionPrevention> - </Link> - </ItemDefinitionGroup> - <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> - <ClCompile> - <Optimization>MaxSpeed</Optimization> - <IntrinsicFunctions>true</IntrinsicFunctions> - <AdditionalIncludeDirectories>..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> - <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary> - <FunctionLevelLinking>true</FunctionLevelLinking> - <WarningLevel>Level3</WarningLevel> - </ClCompile> - <Link> - <AdditionalDependencies>..\lib\Win32-visualstudio\Irrlicht.lib;%(AdditionalDependencies)</AdditionalDependencies> - <GenerateDebugInformation>false</GenerateDebugInformation> - <OptimizeReferences>true</OptimizeReferences> - <EnableCOMDATFolding>true</EnableCOMDATFolding> - <DataExecutionPrevention> - </DataExecutionPrevention> - </Link> - </ItemDefinitionGroup> - <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'"> - <ClCompile> - <Optimization>MaxSpeed</Optimization> - <IntrinsicFunctions>true</IntrinsicFunctions> - <AdditionalIncludeDirectories>..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> - <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary> - <FunctionLevelLinking>true</FunctionLevelLinking> - <WarningLevel>Level3</WarningLevel> - </ClCompile> - <Link> - <AdditionalDependencies>..\lib\Win64-visualstudio\Irrlicht.lib;%(AdditionalDependencies)</AdditionalDependencies> - <GenerateDebugInformation>false</GenerateDebugInformation> - <OptimizeReferences>true</OptimizeReferences> - <EnableCOMDATFolding>true</EnableCOMDATFolding> - <DataExecutionPrevention> - </DataExecutionPrevention> - </Link> - </ItemDefinitionGroup> - <ItemGroup> - <ClCompile Include="2dmaterial.cpp" /> - <ClCompile Include="anti-aliasing.cpp" /> - <ClCompile Include="archiveReader.cpp" /> - <ClCompile Include="b3dAnimation.cpp" /> - <ClCompile Include="billboards.cpp" /> - <ClCompile Include="burningsVideo.cpp" /> - <ClCompile Include="collisionResponseAnimator.cpp" /> - <ClCompile Include="color.cpp" /> - <ClCompile Include="coreutil.cpp" /> - <ClCompile Include="createImage.cpp" /> - <ClCompile Include="cursorSetVisible.cpp" /> - <ClCompile Include="disambiguateTextures.cpp" /> - <ClCompile Include="draw2DImage.cpp" /> - <ClCompile Include="drawPixel.cpp" /> - <ClCompile Include="drawRectOutline.cpp" /> - <ClCompile Include="drawVertexPrimitive.cpp" /> - <ClCompile Include="enumerateImageManipulators.cpp" /> - <ClCompile Include="exports.cpp" /> - <ClCompile Include="fast_atof.cpp" /> - <ClCompile Include="filesystem.cpp" /> - <ClCompile Include="flyCircleAnimator.cpp" /> - <ClCompile Include="guiDisabledMenu.cpp" /> - <ClCompile Include="ioScene.cpp" /> - <ClCompile Include="irrArray.cpp" /> - <ClCompile Include="irrCoreEquals.cpp" /> - <ClCompile Include="irrList.cpp" /> - <ClCompile Include="irrMap.cpp" /> - <ClCompile Include="irrString.cpp" /> - <ClCompile Include="lightMaps.cpp" /> - <ClCompile Include="lights.cpp" /> - <ClCompile Include="line2d.cpp" /> - <ClCompile Include="loadTextures.cpp" /> - <ClCompile Include="main.cpp" /> - <ClCompile Include="makeColorKeyTexture.cpp" /> - <ClCompile Include="material.cpp" /> - <ClCompile Include="matrixOps.cpp" /> - <ClCompile Include="md2Animation.cpp" /> - <ClCompile Include="meshLoaders.cpp" /> - <ClCompile Include="meshTransform.cpp" /> - <ClCompile Include="mrt.cpp" /> - <ClCompile Include="orthoCam.cpp" /> - <ClCompile Include="planeMatrix.cpp" /> - <ClCompile Include="projectionMatrix.cpp" /> - <ClCompile Include="removeCustomAnimator.cpp" /> - <ClCompile Include="renderTargetTexture.cpp" /> - <ClCompile Include="sceneCollisionManager.cpp" /> - <ClCompile Include="sceneNodeAnimator.cpp" /> - <ClCompile Include="screenshot.cpp" /> - <ClCompile Include="serializeAttributes.cpp" /> - <ClCompile Include="skinnedMesh.cpp" /> - <ClCompile Include="softwareDevice.cpp" /> - <ClCompile Include="stencilshadow.cpp" /> - <ClCompile Include="terrainSceneNode.cpp" /> - <ClCompile Include="testaabbox.cpp" /> - <ClCompile Include="testDimension2d.cpp" /> - <ClCompile Include="testGeometryCreator.cpp" /> - <ClCompile Include="testLine2d.cpp" /> - <ClCompile Include="testQuaternion.cpp" /> - <ClCompile Include="testS3DVertex.cpp" /> - <ClCompile Include="testUtils.cpp" /> - <ClCompile Include="testVector2d.cpp" /> - <ClCompile Include="testVector3d.cpp" /> - <ClCompile Include="testXML.cpp" /> - <ClCompile Include="textureFeatures.cpp" /> - <ClCompile Include="textureRenderStates.cpp" /> - <ClCompile Include="timer.cpp" /> - <ClCompile Include="transparentMaterials.cpp" /> - <ClCompile Include="triangle3d.cpp" /> - <ClCompile Include="triangleSelector.cpp" /> - <ClCompile Include="userClipPlane.cpp" /> - <ClCompile Include="vectorPositionDimension2d.cpp" /> - <ClCompile Include="videoDriver.cpp" /> - <ClCompile Include="viewPort.cpp" /> - <ClCompile Include="writeImageToFile.cpp" /> - </ItemGroup> - <ItemGroup> - <ClInclude Include="testUtils.h" /> - </ItemGroup> - <ItemGroup> - <ProjectReference Include="..\source\Irrlicht\Irrlicht11.0.vcxproj"> - <Project>{e08e042a-6c45-411b-92be-3cc31331019f}</Project> - <ReferenceOutputAssembly>false</ReferenceOutputAssembly> - </ProjectReference> - </ItemGroup> - <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" /> - <ImportGroup Label="ExtensionTargets"> - </ImportGroup> -</Project> \ No newline at end of file diff --git a/tests/tests_vc14.sln b/tests/tests_vc14.sln deleted file mode 100644 index ce31f9c4..00000000 --- a/tests/tests_vc14.sln +++ /dev/null @@ -1,88 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 14.00 -# Visual Studio 14 -VisualStudioVersion = 14.0.23107.0 -MinimumVisualStudioVersion = 10.0.40219.1 -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Irrlicht", "..\source\Irrlicht\Irrlicht14.0.vcxproj", "{E08E042A-6C45-411B-92BE-3CC31331019F}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "tests", "tests_vc14.vcxproj", "{2A1DE18B-F678-4A94-A996-E848E20B2983}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Win32 = Debug|Win32 - Debug|x64 = Debug|x64 - Release - Fast FPU|Win32 = Release - Fast FPU|Win32 - Release - Fast FPU|x64 = Release - Fast FPU|x64 - Release|Win32 = Release|Win32 - Release|x64 = Release|x64 - SDL-Debug|Win32 = SDL-Debug|Win32 - SDL-Debug|x64 = SDL-Debug|x64 - Static lib - Debug|Win32 = Static lib - Debug|Win32 - Static lib - Debug|x64 = Static lib - Debug|x64 - Static lib - Release - Fast FPU|Win32 = Static lib - Release - Fast FPU|Win32 - Static lib - Release - Fast FPU|x64 = Static lib - Release - Fast FPU|x64 - Static lib - Release|Win32 = Static lib - Release|Win32 - Static lib - Release|x64 = Static lib - Release|x64 - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {E08E042A-6C45-411B-92BE-3CC31331019F}.Debug|Win32.ActiveCfg = Debug|Win32 - {E08E042A-6C45-411B-92BE-3CC31331019F}.Debug|Win32.Build.0 = Debug|Win32 - {E08E042A-6C45-411B-92BE-3CC31331019F}.Debug|x64.ActiveCfg = Debug|x64 - {E08E042A-6C45-411B-92BE-3CC31331019F}.Debug|x64.Build.0 = Debug|x64 - {E08E042A-6C45-411B-92BE-3CC31331019F}.Release - Fast FPU|Win32.ActiveCfg = Release - Fast FPU|Win32 - {E08E042A-6C45-411B-92BE-3CC31331019F}.Release - Fast FPU|Win32.Build.0 = Release - Fast FPU|Win32 - {E08E042A-6C45-411B-92BE-3CC31331019F}.Release - Fast FPU|x64.ActiveCfg = Release - Fast FPU|x64 - {E08E042A-6C45-411B-92BE-3CC31331019F}.Release - Fast FPU|x64.Build.0 = Release - Fast FPU|x64 - {E08E042A-6C45-411B-92BE-3CC31331019F}.Release|Win32.ActiveCfg = Release|Win32 - {E08E042A-6C45-411B-92BE-3CC31331019F}.Release|Win32.Build.0 = Release|Win32 - {E08E042A-6C45-411B-92BE-3CC31331019F}.Release|x64.ActiveCfg = Release|x64 - {E08E042A-6C45-411B-92BE-3CC31331019F}.Release|x64.Build.0 = Release|x64 - {E08E042A-6C45-411B-92BE-3CC31331019F}.SDL-Debug|Win32.ActiveCfg = SDL-Debug|Win32 - {E08E042A-6C45-411B-92BE-3CC31331019F}.SDL-Debug|Win32.Build.0 = SDL-Debug|Win32 - {E08E042A-6C45-411B-92BE-3CC31331019F}.SDL-Debug|x64.ActiveCfg = SDL-Debug|x64 - {E08E042A-6C45-411B-92BE-3CC31331019F}.SDL-Debug|x64.Build.0 = SDL-Debug|x64 - {E08E042A-6C45-411B-92BE-3CC31331019F}.Static lib - Debug|Win32.ActiveCfg = Static lib - Debug|Win32 - {E08E042A-6C45-411B-92BE-3CC31331019F}.Static lib - Debug|Win32.Build.0 = Static lib - Debug|Win32 - {E08E042A-6C45-411B-92BE-3CC31331019F}.Static lib - Debug|x64.ActiveCfg = Static lib - Debug|x64 - {E08E042A-6C45-411B-92BE-3CC31331019F}.Static lib - Debug|x64.Build.0 = Static lib - Debug|x64 - {E08E042A-6C45-411B-92BE-3CC31331019F}.Static lib - Release - Fast FPU|Win32.ActiveCfg = Static lib - Release - Fast FPU|Win32 - {E08E042A-6C45-411B-92BE-3CC31331019F}.Static lib - Release - Fast FPU|Win32.Build.0 = Static lib - Release - Fast FPU|Win32 - {E08E042A-6C45-411B-92BE-3CC31331019F}.Static lib - Release - Fast FPU|x64.ActiveCfg = Static lib - Release - Fast FPU|x64 - {E08E042A-6C45-411B-92BE-3CC31331019F}.Static lib - Release - Fast FPU|x64.Build.0 = Static lib - Release - Fast FPU|x64 - {E08E042A-6C45-411B-92BE-3CC31331019F}.Static lib - Release|Win32.ActiveCfg = Static lib - Release|Win32 - {E08E042A-6C45-411B-92BE-3CC31331019F}.Static lib - Release|Win32.Build.0 = Static lib - Release|Win32 - {E08E042A-6C45-411B-92BE-3CC31331019F}.Static lib - Release|x64.ActiveCfg = Static lib - Release|x64 - {E08E042A-6C45-411B-92BE-3CC31331019F}.Static lib - Release|x64.Build.0 = Static lib - Release|x64 - {2A1DE18B-F678-4A94-A996-E848E20B2983}.Debug|Win32.ActiveCfg = Debug|Win32 - {2A1DE18B-F678-4A94-A996-E848E20B2983}.Debug|Win32.Build.0 = Debug|Win32 - {2A1DE18B-F678-4A94-A996-E848E20B2983}.Debug|x64.ActiveCfg = Debug|x64 - {2A1DE18B-F678-4A94-A996-E848E20B2983}.Debug|x64.Build.0 = Debug|x64 - {2A1DE18B-F678-4A94-A996-E848E20B2983}.Release - Fast FPU|Win32.ActiveCfg = Release|Win32 - {2A1DE18B-F678-4A94-A996-E848E20B2983}.Release - Fast FPU|Win32.Build.0 = Release|Win32 - {2A1DE18B-F678-4A94-A996-E848E20B2983}.Release - Fast FPU|x64.ActiveCfg = Release|x64 - {2A1DE18B-F678-4A94-A996-E848E20B2983}.Release - Fast FPU|x64.Build.0 = Release|x64 - {2A1DE18B-F678-4A94-A996-E848E20B2983}.Release|Win32.ActiveCfg = Release|Win32 - {2A1DE18B-F678-4A94-A996-E848E20B2983}.Release|Win32.Build.0 = Release|Win32 - {2A1DE18B-F678-4A94-A996-E848E20B2983}.Release|x64.ActiveCfg = Release|x64 - {2A1DE18B-F678-4A94-A996-E848E20B2983}.Release|x64.Build.0 = Release|x64 - {2A1DE18B-F678-4A94-A996-E848E20B2983}.SDL-Debug|Win32.ActiveCfg = Debug|Win32 - {2A1DE18B-F678-4A94-A996-E848E20B2983}.SDL-Debug|Win32.Build.0 = Debug|Win32 - {2A1DE18B-F678-4A94-A996-E848E20B2983}.SDL-Debug|x64.ActiveCfg = Debug|x64 - {2A1DE18B-F678-4A94-A996-E848E20B2983}.SDL-Debug|x64.Build.0 = Debug|x64 - {2A1DE18B-F678-4A94-A996-E848E20B2983}.Static lib - Debug|Win32.ActiveCfg = Debug|Win32 - {2A1DE18B-F678-4A94-A996-E848E20B2983}.Static lib - Debug|Win32.Build.0 = Debug|Win32 - {2A1DE18B-F678-4A94-A996-E848E20B2983}.Static lib - Debug|x64.ActiveCfg = Debug|x64 - {2A1DE18B-F678-4A94-A996-E848E20B2983}.Static lib - Debug|x64.Build.0 = Debug|x64 - {2A1DE18B-F678-4A94-A996-E848E20B2983}.Static lib - Release - Fast FPU|Win32.ActiveCfg = Release|Win32 - {2A1DE18B-F678-4A94-A996-E848E20B2983}.Static lib - Release - Fast FPU|Win32.Build.0 = Release|Win32 - {2A1DE18B-F678-4A94-A996-E848E20B2983}.Static lib - Release - Fast FPU|x64.ActiveCfg = Release|x64 - {2A1DE18B-F678-4A94-A996-E848E20B2983}.Static lib - Release - Fast FPU|x64.Build.0 = Release|x64 - {2A1DE18B-F678-4A94-A996-E848E20B2983}.Static lib - Release|Win32.ActiveCfg = Release|Win32 - {2A1DE18B-F678-4A94-A996-E848E20B2983}.Static lib - Release|Win32.Build.0 = Release|Win32 - {2A1DE18B-F678-4A94-A996-E848E20B2983}.Static lib - Release|x64.ActiveCfg = Release|x64 - {2A1DE18B-F678-4A94-A996-E848E20B2983}.Static lib - Release|x64.Build.0 = Release|x64 - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/tests/tests_vc14.vcxproj b/tests/tests_vc14.vcxproj deleted file mode 100644 index 07229875..00000000 --- a/tests/tests_vc14.vcxproj +++ /dev/null @@ -1,239 +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>tests</ProjectName> - <ProjectGuid>{2A1DE18B-F678-4A94-A996-E848E20B2983}</ProjectGuid> - <RootNamespace>tests</RootNamespace> - </PropertyGroup> - <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" /> - <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration"> - <ConfigurationType>Application</ConfigurationType> - <CharacterSet>MultiByte</CharacterSet> - <WholeProgramOptimization>true</WholeProgramOptimization> - <PlatformToolset>v140</PlatformToolset> - </PropertyGroup> - <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration"> - <ConfigurationType>Application</ConfigurationType> - <CharacterSet>MultiByte</CharacterSet> - <WholeProgramOptimization>true</WholeProgramOptimization> - <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" /> - </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" /> - </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" /> - </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" /> - </ImportGroup> - <PropertyGroup Label="UserMacros" /> - <PropertyGroup> - <_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion> - <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'" /> - <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">..\bin\Win32-VisualStudio\</OutDir> - <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">..\bin\Win64-VisualStudio\</OutDir> - </PropertyGroup> - <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> - <ClCompile> - <Optimization>Disabled</Optimization> - <AdditionalIncludeDirectories>..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> - <MinimalRebuild>true</MinimalRebuild> - <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks> - <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary> - <WarningLevel>Level3</WarningLevel> - </ClCompile> - <Link> - <AdditionalDependencies>..\lib\Win32-visualstudio\Irrlicht.lib;%(AdditionalDependencies)</AdditionalDependencies> - <GenerateDebugInformation>true</GenerateDebugInformation> - <DataExecutionPrevention> - </DataExecutionPrevention> - </Link> - </ItemDefinitionGroup> - <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'"> - <ClCompile> - <Optimization>Disabled</Optimization> - <AdditionalIncludeDirectories>..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> - <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks> - <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary> - <WarningLevel>Level3</WarningLevel> - </ClCompile> - <Link> - <AdditionalDependencies>..\lib\Win64-visualstudio\Irrlicht.lib;%(AdditionalDependencies)</AdditionalDependencies> - <GenerateDebugInformation>true</GenerateDebugInformation> - <DataExecutionPrevention> - </DataExecutionPrevention> - </Link> - </ItemDefinitionGroup> - <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> - <ClCompile> - <Optimization>MaxSpeed</Optimization> - <IntrinsicFunctions>true</IntrinsicFunctions> - <AdditionalIncludeDirectories>..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> - <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary> - <FunctionLevelLinking>true</FunctionLevelLinking> - <WarningLevel>Level3</WarningLevel> - </ClCompile> - <Link> - <AdditionalDependencies>..\lib\Win32-visualstudio\Irrlicht.lib;%(AdditionalDependencies)</AdditionalDependencies> - <GenerateDebugInformation>false</GenerateDebugInformation> - <OptimizeReferences>true</OptimizeReferences> - <EnableCOMDATFolding>true</EnableCOMDATFolding> - <DataExecutionPrevention> - </DataExecutionPrevention> - </Link> - </ItemDefinitionGroup> - <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'"> - <ClCompile> - <Optimization>MaxSpeed</Optimization> - <IntrinsicFunctions>true</IntrinsicFunctions> - <AdditionalIncludeDirectories>..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> - <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary> - <FunctionLevelLinking>true</FunctionLevelLinking> - <WarningLevel>Level3</WarningLevel> - </ClCompile> - <Link> - <AdditionalDependencies>..\lib\Win64-visualstudio\Irrlicht.lib;%(AdditionalDependencies)</AdditionalDependencies> - <GenerateDebugInformation>false</GenerateDebugInformation> - <OptimizeReferences>true</OptimizeReferences> - <EnableCOMDATFolding>true</EnableCOMDATFolding> - <DataExecutionPrevention> - </DataExecutionPrevention> - </Link> - </ItemDefinitionGroup> - <ItemGroup> - <ClCompile Include="2dmaterial.cpp" /> - <ClCompile Include="anti-aliasing.cpp" /> - <ClCompile Include="archiveReader.cpp" /> - <ClCompile Include="b3dAnimation.cpp" /> - <ClCompile Include="billboards.cpp" /> - <ClCompile Include="burningsVideo.cpp" /> - <ClCompile Include="collisionResponseAnimator.cpp" /> - <ClCompile Include="color.cpp" /> - <ClCompile Include="coreutil.cpp" /> - <ClCompile Include="createImage.cpp" /> - <ClCompile Include="cursorSetVisible.cpp" /> - <ClCompile Include="disambiguateTextures.cpp" /> - <ClCompile Include="draw2DImage.cpp" /> - <ClCompile Include="drawPixel.cpp" /> - <ClCompile Include="drawRectOutline.cpp" /> - <ClCompile Include="drawVertexPrimitive.cpp" /> - <ClCompile Include="enumerateImageManipulators.cpp" /> - <ClCompile Include="exports.cpp" /> - <ClCompile Include="fast_atof.cpp" /> - <ClCompile Include="filesystem.cpp" /> - <ClCompile Include="flyCircleAnimator.cpp" /> - <ClCompile Include="guiDisabledMenu.cpp" /> - <ClCompile Include="ioScene.cpp" /> - <ClCompile Include="irrArray.cpp" /> - <ClCompile Include="irrCoreEquals.cpp" /> - <ClCompile Include="irrList.cpp" /> - <ClCompile Include="irrMap.cpp" /> - <ClCompile Include="irrString.cpp" /> - <ClCompile Include="lightMaps.cpp" /> - <ClCompile Include="lights.cpp" /> - <ClCompile Include="line2d.cpp" /> - <ClCompile Include="loadTextures.cpp" /> - <ClCompile Include="main.cpp" /> - <ClCompile Include="makeColorKeyTexture.cpp" /> - <ClCompile Include="material.cpp" /> - <ClCompile Include="matrixOps.cpp" /> - <ClCompile Include="md2Animation.cpp" /> - <ClCompile Include="meshLoaders.cpp" /> - <ClCompile Include="meshTransform.cpp" /> - <ClCompile Include="mrt.cpp" /> - <ClCompile Include="orthoCam.cpp" /> - <ClCompile Include="planeMatrix.cpp" /> - <ClCompile Include="projectionMatrix.cpp" /> - <ClCompile Include="removeCustomAnimator.cpp" /> - <ClCompile Include="renderTargetTexture.cpp" /> - <ClCompile Include="sceneCollisionManager.cpp" /> - <ClCompile Include="sceneNodeAnimator.cpp" /> - <ClCompile Include="screenshot.cpp" /> - <ClCompile Include="serializeAttributes.cpp" /> - <ClCompile Include="skinnedMesh.cpp" /> - <ClCompile Include="softwareDevice.cpp" /> - <ClCompile Include="stencilshadow.cpp" /> - <ClCompile Include="terrainSceneNode.cpp" /> - <ClCompile Include="testaabbox.cpp" /> - <ClCompile Include="testDimension2d.cpp" /> - <ClCompile Include="testGeometryCreator.cpp" /> - <ClCompile Include="testLine2d.cpp" /> - <ClCompile Include="testQuaternion.cpp" /> - <ClCompile Include="testS3DVertex.cpp" /> - <ClCompile Include="testUtils.cpp" /> - <ClCompile Include="testVector2d.cpp" /> - <ClCompile Include="testVector3d.cpp" /> - <ClCompile Include="testXML.cpp" /> - <ClCompile Include="textureFeatures.cpp" /> - <ClCompile Include="textureRenderStates.cpp" /> - <ClCompile Include="timer.cpp" /> - <ClCompile Include="transparentMaterials.cpp" /> - <ClCompile Include="triangle3d.cpp" /> - <ClCompile Include="triangleSelector.cpp" /> - <ClCompile Include="userClipPlane.cpp" /> - <ClCompile Include="vectorPositionDimension2d.cpp" /> - <ClCompile Include="videoDriver.cpp" /> - <ClCompile Include="viewPort.cpp" /> - <ClCompile Include="writeImageToFile.cpp" /> - </ItemGroup> - <ItemGroup> - <ClInclude Include="testUtils.h" /> - </ItemGroup> - <ItemGroup> - <ProjectReference Include="..\source\Irrlicht\Irrlicht11.0.vcxproj"> - <Project>{e08e042a-6c45-411b-92be-3cc31331019f}</Project> - <ReferenceOutputAssembly>false</ReferenceOutputAssembly> - </ProjectReference> - </ItemGroup> - <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" /> - <ImportGroup Label="ExtensionTargets"> - </ImportGroup> -</Project> \ No newline at end of file diff --git a/tests/textureFeatures.cpp b/tests/textureFeatures.cpp deleted file mode 100644 index 9ce787df..00000000 --- a/tests/textureFeatures.cpp +++ /dev/null @@ -1,454 +0,0 @@ -// Copyright (C) 2008-2012 Christian Stehno, Colin MacDonald -// No rights reserved: this software is in the public domain. - -#include "testUtils.h" - -using namespace irr; -using namespace core; - -namespace -{ -//! check miplevels by visual test -bool renderMipLevels(video::E_DRIVER_TYPE driverType) -{ - IrrlichtDevice *device = createDevice( driverType, dimension2d<u32>(160, 120), 32); - if (!device) - return true; // Treat a failure to create a driver as benign; this saves a lot of #ifdefs - - video::IVideoDriver* driver = device->getVideoDriver(); - scene::ISceneManager * smgr = device->getSceneManager(); - if (!driver->queryFeature(video::EVDF_MIP_MAP)) - { - device->closeDevice(); - device->run(); - device->drop(); - return true; - } - - // Can't pass manual data with hardware mip maps (at least on d3d, not sure about older GL) - driver->setTextureCreationFlag(video::ETCF_AUTO_GENERATE_MIP_MAPS, false); - - stabilizeScreenBackground(driver); - - logTestString("Testing driver %ls\n", driver->getName()); - - scene::ISceneNode* n = smgr->addCubeSceneNode(); - scene::ISceneNode* n2 = smgr->addCubeSceneNode(10, 0, -1, vector3df(20,0,30), vector3df(0,45,0)); - - // we use a main texture with blue on top and red below - // and mipmap with pink on top and cyan below - if (n && n2) - { - // create the texture and miplevels with distinct colors - u32 texData[16*16]; - for (u32 i=0; i<16*16; ++i) - texData[i]=(i<8*16?0xff0000ff:0xffff0000); - video::IImage* image = driver->createImageFromData(video::ECF_A8R8G8B8, dimension2du(16,16), texData, false); - u32 mipdata[8*16]; - u32 index=0; - for (u32 j=8; j>0; j/=2) - { - for (u32 i=0; i<j; ++i) - { - u32 val=(i<j/2?0xffff00ff:0xff00ffff); - for (u32 k=0; k<j; ++k) - mipdata[index++]=val; - } - } - - image->setMipMapsData(mipdata, false, true); - video::ITexture* tex = driver->addTexture("miptest", image); - if (!tex) - // is probably an error in the mipdata handling - return false; - else - { - n->setMaterialFlag(video::EMF_LIGHTING, false); - n->setMaterialTexture(0, tex); - n2->setMaterialFlag(video::EMF_LIGHTING, false); - n2->setMaterialTexture(0, tex); - } - image->drop(); - } - - (void)smgr->addCameraSceneNode(0, vector3df(10,0,-30)); - - driver->beginScene(video::ECBF_COLOR | video::ECBF_DEPTH, video::SColor(255,100,101,140)); - smgr->drawAll(); - driver->endScene(); - - bool result = takeScreenshotAndCompareAgainstReference(driver, "-renderMipmap.png", 99.5); - - if (!result) - logTestString("mipmap render failed.\n", driver->getName()); - else - logTestString("Passed\n"); - - device->closeDevice(); - device->run(); - device->drop(); - - return result; -} - -//! Tests locking miplevels -bool lockAllMipLevels(video::E_DRIVER_TYPE driverType) -{ - IrrlichtDevice *device = createDevice( driverType, dimension2d<u32>(160, 120), 32); - if (!device) - return true; // Treat a failure to create a driver as benign; this saves a lot of #ifdefs - - video::IVideoDriver* driver = device->getVideoDriver(); - scene::ISceneManager * smgr = device->getSceneManager(); - - if (!driver->queryFeature(video::EVDF_MIP_MAP)) - { - device->closeDevice(); - device->run(); - device->drop(); - return true; - } - - // Can't lock surfaces for hardware mip-maps - driver->setTextureCreationFlag(video::ETCF_AUTO_GENERATE_MIP_MAPS, false); - - stabilizeScreenBackground(driver); - - logTestString("Testing driver %ls\n", driver->getName()); - - scene::ISceneNode* n = smgr->addCubeSceneNode(); - - if (n) - { - // create the texture and miplevels with distinct colors - u32 texData[16*16]; - for (u32 i=0; i<16*16; ++i) - texData[i]=0xff0000ff-i; - video::IImage* image = driver->createImageFromData(video::ECF_A8R8G8B8, core::dimension2du(16,16), texData, false); - u32 mipdata[8*16]; - u32 index=0; - for (u32 j=8; j>0; j/=2) - { - u32 val=(j==8?0x00ff00ff:(j==4?0x0000ffff:(j==2?0xc2c200ff:0x001212ff))); - for (u32 i=0; i<j; ++i) - { - for (u32 k=0; k<j; ++k) - mipdata[index++]=val-i; - } - } - - video::ITexture* tex = driver->addTexture("miptest", image, mipdata); - if (!tex) - // is probably an error in the mipdata handling - return false; - else - n->setMaterialTexture(0, tex); - image->drop(); - } - - smgr->addCameraSceneNode(); - - driver->beginScene(true, true, video::SColor(255,100,101,140)); - smgr->drawAll(); - driver->endScene(); - - video::ITexture* tex = driver->findTexture("miptest"); - video::SColor* bits = (video::SColor*)tex->lock(video::ETLM_READ_ONLY, 0); - bool result = bits && (bits[0].color==0xff0000ff); - tex->unlock(); - bits = (video::SColor*)tex->lock(video::ETLM_READ_ONLY, 1); - result &= bits && (bits[0].color==0x00ff00ff); - tex->unlock(); - bits = (video::SColor*)tex->lock(video::ETLM_READ_ONLY, 2); - result &= bits && (bits[0].color==0x0000ffff); - tex->unlock(); - bits = (video::SColor*)tex->lock(video::ETLM_READ_ONLY, 3); - result &= bits && (bits[0].color==0xc2c200ff); - tex->unlock(); - bits = (video::SColor*)tex->lock(video::ETLM_READ_ONLY, 4); - result &= bits && (bits[0].color==0x001212ff); - tex->unlock(); - - if (!result) - logTestString("mipmap lock after init with driver %ls failed.\n", driver->getName()); - - // test with updating a lower level, and reading upper and lower - bits = (video::SColor*)tex->lock(video::ETLM_READ_WRITE, 3); - if ( bits ) - { - bits[0]=0xff00ff00; - bits[1]=0xff00ff00; - } - tex->unlock(); - bits = (video::SColor*)tex->lock(video::ETLM_READ_WRITE, 4); - result &= bits && (bits[0].color==0x001212ff); - tex->unlock(); - bits = (video::SColor*)tex->lock(video::ETLM_READ_ONLY, 3); - result &= bits && ((bits[0].color==0xff00ff00)&&(bits[2].color==0xc2c200fe)); - tex->unlock(); - - if (!result) - logTestString("mipmap lock after mipmap write with driver %ls failed.\n", driver->getName()); - - // now test locking level 0 - bits = (video::SColor*)tex->lock(video::ETLM_READ_WRITE, 0); - if ( bits ) - { - bits[0]=0xff00ff00; - bits[1]=0xff00ff00; - } - tex->unlock(); - bits = (video::SColor*)tex->lock(video::ETLM_READ_WRITE, 4); - result &= bits && (bits[0].color==0x001212ff); - tex->unlock(); - bits = (video::SColor*)tex->lock(video::ETLM_READ_ONLY, 0); - result &= bits && ((bits[0].color==0xff00ff00)&&(bits[2].color==0xff0000fd)); - tex->unlock(); - - if (!result) - logTestString("mipmap lock at level 0 after mipmap write with driver %ls failed.\n", driver->getName()); - else - logTestString("Passed\n"); - - device->closeDevice(); - device->run(); - device->drop(); - - return result; -} - - -//! Tests locking miplevels after texture was created with auto mipmap update -bool lockWithAutoMipmap(video::E_DRIVER_TYPE driverType) -{ - IrrlichtDevice *device = createDevice( driverType, dimension2d<u32>(160, 120), 32); - if (!device) - return true; // Treat a failure to create a driver as benign; this saves a lot of #ifdefs - - video::IVideoDriver* driver = device->getVideoDriver(); - scene::ISceneManager * smgr = device->getSceneManager(); - - if (!driver->queryFeature(video::EVDF_MIP_MAP)) - { - device->closeDevice(); - device->run(); - device->drop(); - return true; - } - - // Can't lock surfaces for hardware mip-maps (sadly... so also can't test if it works like this) - driver->setTextureCreationFlag(video::ETCF_AUTO_GENERATE_MIP_MAPS, false); - - stabilizeScreenBackground(driver); - - logTestString("Testing driver %ls\n", driver->getName()); - - scene::ISceneNode* n = smgr->addCubeSceneNode(); - - if (n) - { - // create the texture - u32 texData[16*16]; - for (u32 i=0; i<16*16; ++i) - texData[i]=0xff0000ff-i; - video::IImage* image = driver->createImageFromData(video::ECF_A8R8G8B8, core::dimension2du(16,16), texData, false); - - video::ITexture* tex = driver->addTexture("miptest", image); - if (!tex) - return false; - else - n->setMaterialTexture(0, tex); - image->drop(); - } - (void)smgr->addCameraSceneNode(); - - driver->beginScene(true, true, video::SColor(255,100,101,140)); - smgr->drawAll(); - driver->endScene(); - - video::ITexture* tex = driver->findTexture("miptest"); - video::SColor* bits = (video::SColor*)tex->lock(video::ETLM_READ_ONLY, 0); - bool result = bits && (bits[0].color==0xff0000ff); - tex->unlock(); - if (!result) - logTestString("mipmap lock after init with driver %ls failed.\n", driver->getName()); - - // test with updating a lower level, and reading upper and lower - bits = (video::SColor*)tex->lock(video::ETLM_READ_WRITE, 3); - if ( bits ) - { - bits[0]=0xff00ff00; - bits[1]=0xff00ff00; - } - tex->unlock(); - // lock another texture just to invalidate caches in the driver - bits = (video::SColor*)tex->lock(video::ETLM_READ_WRITE, 4); - tex->unlock(); - bits = (video::SColor*)tex->lock(video::ETLM_READ_ONLY, 3); - result &= bits && ((bits[0].color==0xff00ff00)&&(bits[2].color!=0xff00ff00)); - tex->unlock(); - - if (!result) - logTestString("mipmap lock after mipmap write with driver %ls failed.\n", driver->getName()); - - // now test locking level 0 - bits = (video::SColor*)tex->lock(video::ETLM_READ_WRITE, 0); - if ( bits ) - { - bits[0]=0x00ff00ff; - bits[1]=0x00ff00ff; - } - tex->unlock(); - bits = (video::SColor*)tex->lock(video::ETLM_READ_ONLY, 3); - result &= bits && ((bits[0].color==0xff00ff00)&&(bits[2].color!=0xff00ff00)); - tex->unlock(); - - if (!result) - logTestString("mipmap lock at level 0 after mipmap write with driver %ls failed.\n", driver->getName()); - else - logTestString("Passed\n"); - - device->closeDevice(); - device->run(); - device->drop(); - - return result; -} - -//! Tests locking -bool lockCubemapTexture(video::E_DRIVER_TYPE driverType) -{ - IrrlichtDevice *device = createDevice( driverType, dimension2d<u32>(160, 120), 32); - if (!device) - return true; // Treat a failure to create a driver as benign; this saves a lot of #ifdefs - - video::IVideoDriver* driver = device->getVideoDriver(); - scene::ISceneManager * smgr = device->getSceneManager(); - - if (!driver->queryFeature(video::EVDF_MIP_MAP)) - { - device->closeDevice(); - device->run(); - device->drop(); - return true; - } - - bool testCubemap = driver->queryFeature(video::EVDF_TEXTURE_CUBEMAP); - - stabilizeScreenBackground(driver); - - logTestString("Testing driver %ls\n", driver->getName()); - - scene::ISceneNode* n = smgr->addCubeSceneNode(); - scene::ISceneNode* n2 = smgr->addCubeSceneNode(10, 0, -1, vector3df(20, 0, 30), vector3df(0, 45, 0)); - - if (n && n2) - { - u32 texData[16*16]; - - for (u32 i=0; i<16*16; ++i) - texData[i]=0xff0000ff-i; - - // texture 2d - - video::IImage* image = driver->createImageFromData(video::ECF_A8R8G8B8, dimension2du(16,16), texData, false); - - video::ITexture* tex = driver->addTexture("tex2d", image); - - if (!tex) - return false; - else - n->setMaterialTexture(0, tex); - - // cubemap - - if (testCubemap) - { - video::ITexture* texCube = driver->addTextureCubemap("texcube", image, image, image, image, image, image); - - if (!texCube) - testCubemap = false; - else - n2->setMaterialTexture(0, texCube); - } - - image->drop(); - } - - smgr->addCameraSceneNode(0, vector3df(10, 0, -30)); - - driver->beginScene(video::ECBF_COLOR | video::ECBF_DEPTH, video::SColor(255,100,101,140)); - smgr->drawAll(); - driver->endScene(); - - video::ITexture* tex = driver->findTexture("tex2d"); - - video::SColor* bits = (video::SColor*)tex->lock(video::ETLM_READ_WRITE); - bits[0]=0xff00ff00; - bits[1]=0xff00ff00; - tex->unlock(); - - bits = (video::SColor*)tex->lock(video::ETLM_READ_ONLY, 0); - bool result = ((bits[0].color==0xff00ff00)&&(bits[2].color==0xff0000fd)); - tex->unlock(); - - if (!result) - logTestString("texture 2d lock with driver %ls failed.\n", driver->getName()); - else - logTestString("Passed\n"); - - if (testCubemap) - { - tex = driver->findTexture("texcube"); - - for (u32 i = 0; i < 6; ++i) - { - bits = (video::SColor*)tex->lock(video::ETLM_READ_WRITE, 0, i); - if ( !bits) - { - result = false; - break; - } - bits[0] = 0xff00ff00; - bits[1] = 0xff00ff00; - tex->unlock(); - } - - for (u32 i = 0; i < 6; ++i) - { - bits = (video::SColor*)tex->lock(video::ETLM_READ_ONLY, 0, i); - if ( !bits) - { - result = false; - break; - } - result &= ((bits[0].color == 0xff00ff00) && (bits[2].color == 0xff0000fd)); - tex->unlock(); - } - - if (!result) - logTestString("texture cubemap lock with driver %ls failed.\n", driver->getName()); - else - logTestString("Passed\n"); - } - - device->closeDevice(); - device->run(); - device->drop(); - - return result; -} - -} - -bool textureFeatures(void) -{ - bool result = true; - - TestWithAllDrivers(renderMipLevels); - TestWithAllDrivers(lockAllMipLevels); - TestWithAllDrivers(lockWithAutoMipmap); - TestWithAllDrivers(lockCubemapTexture); - - return result; -} diff --git a/tests/textureRenderStates.cpp b/tests/textureRenderStates.cpp deleted file mode 100644 index b0d965b2..00000000 --- a/tests/textureRenderStates.cpp +++ /dev/null @@ -1,362 +0,0 @@ -// Copyright (C) 2008-2012 Christian Stehno, Colin MacDonald -// No rights reserved: this software is in the public domain. - -#include "testUtils.h" - -using namespace irr; -using namespace core; - -static bool manyTextures(video::E_DRIVER_TYPE driverType) -{ - IrrlichtDevice *device = createDevice(driverType, dimension2d<u32>(160, 120), 32); - if (!device) - return true; // Treat a failure to create a driver as benign; this saves a lot of #ifdefs - - video::IVideoDriver* driver = device->getVideoDriver(); - scene::ISceneManager * smgr = device->getSceneManager(); - - stabilizeScreenBackground(driver); - - logTestString("Testing driver %ls\n", driver->getName()); - - (void)smgr->addCameraSceneNode(); - - scene::SMeshBufferLightMap* mesh = new scene::SMeshBufferLightMap; - - mesh->Vertices.reallocate(4); - mesh->Indices.reallocate(6); - - mesh->Vertices.push_back(video::S3DVertex2TCoords(-50,50,80,irr::video::SColor(255,100,100,100),0,1,0,1)); - mesh->Vertices.push_back(video::S3DVertex2TCoords(50,50,80,irr::video::SColor(255,100,100,100),1,1,1,1)); - mesh->Vertices.push_back(video::S3DVertex2TCoords(50,-50,80,irr::video::SColor(255,100,100,100),1,0,1,0)); - mesh->Vertices.push_back(video::S3DVertex2TCoords(-50,-50,80,irr::video::SColor(255,100,100,100),0,0,0,0)); - - mesh->Indices.push_back(0); - mesh->Indices.push_back(1); - mesh->Indices.push_back(2); - mesh->Indices.push_back(2); - mesh->Indices.push_back(3); - mesh->Indices.push_back(0); - - video::SMaterial& mat = mesh->getMaterial(); - mat.Lighting = false; - mat.setTexture(0,driver->getTexture("../media/fire.bmp")); - mat.setTexture(1,driver->getTexture("../media/fire.bmp")); - mat.setTexture(2,driver->getTexture("../media/fire.bmp")); - mat.setTexture(3,driver->getTexture("../media/fire.bmp")); - - mesh->setDirty(); - - driver->beginScene(video::ECBF_COLOR | video::ECBF_DEPTH, video::SColor(255,100,101,140)); - // set camera - smgr->drawAll(); - // draw meshbuffer - driver->setMaterial(mat); - driver->drawMeshBuffer(mesh); - driver->endScene(); - mesh->drop(); - - bool result = takeScreenshotAndCompareAgainstReference(driver, "-multiTexture.png", 99.31f); - - device->closeDevice(); - device->run(); - device->drop(); - - return result; -} - -//! Tests interleaved loading and rendering of textures -/** The test loads a texture, renders it using draw2dimage, loads another - texture and renders the first one again. Due to the texture cache this - can lead to rendering of the second texture in second place. */ -static bool renderAndLoad(video::E_DRIVER_TYPE driverType) -{ - IrrlichtDevice *device = createDevice( driverType, dimension2d<u32>(160, 120), 32); - if (!device) - return true; // Treat a failure to create a driver as benign; this saves a lot of #ifdefs - - video::IVideoDriver* driver = device->getVideoDriver(); - scene::ISceneManager * smgr = device->getSceneManager(); - - stabilizeScreenBackground(driver); - - logTestString("Testing driver %ls\n", driver->getName()); - - video::ITexture* tex1 = driver->getTexture("../media/wall.bmp"); - - (void)smgr->addCameraSceneNode(); - - driver->beginScene(video::ECBF_COLOR | video::ECBF_DEPTH, video::SColor(255,100,101,140)); - driver->draw2DImage(tex1, position2di(0,0)); - driver->endScene(); - - driver->getTexture("../media/tools.png"); - - driver->beginScene(video::ECBF_COLOR | video::ECBF_DEPTH, video::SColor(255,100,101,140)); - driver->draw2DImage(tex1, position2di(0,0)); - driver->endScene(); - - bool result = takeScreenshotAndCompareAgainstReference(driver, "-textureRenderStates.png", 99.85f); - - device->closeDevice(); - device->run(); - device->drop(); - - return result; -} - - -// This test would cause a crash if it does not work -// in 1.5.1 and 1.6 an illegal access in the OpenGL driver caused this -static bool renderAndRemove(video::E_DRIVER_TYPE driverType) -{ - IrrlichtDevice *device = createDevice( driverType, dimension2d<u32>(160, 120), 32); - if (!device) - return true; // Treat a failure to create a driver as benign; this saves a lot of #ifdefs - - video::IVideoDriver* driver = device->getVideoDriver(); - scene::ISceneManager * smgr = device->getSceneManager(); - - stabilizeScreenBackground(driver); - - logTestString("Testing driver %ls\n", driver->getName()); - - driver->beginScene(video::ECBF_COLOR | video::ECBF_DEPTH, video::SColor(255, 0, 255, 0)); - smgr->drawAll(); - driver->endScene(); - - smgr->addCameraSceneNode(); - video::ITexture* texture = driver->getTexture ("media/tools.png"); - scene::ISceneNode * img = smgr->addCubeSceneNode(); - img->setMaterialTexture(0, texture); - - driver->beginScene(video::ECBF_COLOR | video::ECBF_DEPTH, video::SColor (255, 0, 255, 0)); - smgr->drawAll(); - driver->endScene(); - - smgr->clear(); // Remove anything that used the texture - driver->removeTexture(texture); - - driver->beginScene(video::ECBF_COLOR | video::ECBF_DEPTH, video::SColor(255,100,101,140)); - smgr->drawAll(); - driver->endScene(); - - smgr->addCameraSceneNode(); - texture = driver->getTexture("media/tools.png"); - img = smgr->addCubeSceneNode(); - img->setMaterialTexture(0, texture); - - driver->beginScene(video::ECBF_COLOR | video::ECBF_DEPTH, irr::video::SColor (255, 0, 255, 0)); - smgr->drawAll(); - driver->endScene(); - - device->closeDevice(); - device->run(); - device->drop(); - - return true; -} - - -static bool testTextureMatrixInMixedScenes(video::E_DRIVER_TYPE driverType) -{ - irr::IrrlichtDevice* device = createDevice(driverType, dimension2du(160,120)); - if (!device) - return true; - - video::IVideoDriver* driver = device->getVideoDriver(); - scene::ISceneManager* sceneManager = device->getSceneManager(); - gui::IGUIEnvironment* gui = device->getGUIEnvironment(); - - if (!driver->queryFeature(video::EVDF_TEXTURE_MATRIX)) - { - device->closeDevice(); - device->run(); - device->drop(); - return true; - } - - stabilizeScreenBackground(driver); - - logTestString("Testing driver %ls\n", driver->getName()); - - scene::ICameraSceneNode* camera = sceneManager->addCameraSceneNode(); - camera->setPosition(vector3df(0,10,0)); - - gui::IGUIStaticText* stext = gui->addStaticText(L" ABCDEFGHIJKLMNOPQRSTUVWXYZ 0123456789 ", - rect<s32>(5,100,150,125),false,false,0,false); - stext->setBackgroundColor(video::SColor(255,128,0,0)); - stext->setOverrideColor(video::SColor(255,255,255,255)); - - gui->addEditBox(L"Test edit box", rect<s32>(5,50,150,75)); - - gui->addCheckBox(true, rect<s32>(5, 20, 150, 45),0,-1,L"Test CheckBox"); - - video::SMaterial mat; - mat.MaterialType = video::EMT_SOLID; - mat.setFlag(video::EMF_LIGHTING, false); - // problem doesn't occur if the scale defaults: (1.f,1.f). - mat.getTextureMatrix(0).setTextureScale(2.0,2.0); - - scene::IAnimatedMesh* pmesh = sceneManager->addHillPlaneMesh("testMesh",dimension2d<f32>(50,50),dimension2d<u32>(6,6),&mat); - sceneManager->addAnimatedMeshSceneNode(pmesh); - - driver->beginScene(video::ECBF_COLOR | video::ECBF_DEPTH, video::SColor(255,100,101,140)); - sceneManager->drawAll(); - gui->drawAll(); - driver->endScene(); - - bool result = takeScreenshotAndCompareAgainstReference(driver, "-textureMatrixInMixedScenes.png", 99.33f); - - device->closeDevice(); - device->run(); - device->drop(); - - return result; -} - -// animated texture matrix test. -static bool textureMatrix(video::E_DRIVER_TYPE driverType) -{ - irr::IrrlichtDevice* device = createDevice(driverType, dimension2du(160,120)); - if (!device) - return true; - - video::IVideoDriver* driver = device->getVideoDriver(); - scene::ISceneManager* sceneManager = device->getSceneManager(); - - if (!driver->queryFeature(video::EVDF_TEXTURE_MATRIX)) - { - device->closeDevice(); - device->run(); - device->drop(); - return true; - } - - stabilizeScreenBackground(driver); - - logTestString("Testing driver %ls\n", driver->getName()); - - scene::ICameraSceneNode* camera = sceneManager->addCameraSceneNode(); - camera->setPosition(vector3df(0,0,-10)); - - // set up plane mesh to face the camera - scene::IMesh* mesh = sceneManager->getGeometryCreator()->createPlaneMesh(dimension2df(150,150), core::dimension2du(1,1),0,core::dimension2df(1,1)); - scene::IMeshSceneNode* node = sceneManager->addMeshSceneNode(mesh, 0, -1, vector3df(0, 0, 150), vector3df(-90, 0, 0)); - if (mesh) - mesh->drop(); - - // set the hillplane material texture & save a reference - // to the texture matrix. - video::SMaterial& material = node->getMaterial(0); - video::ITexture* tex = driver->getTexture("../media/water.jpg"); - - material.setTexture(0,tex); - material.setFlag(video::EMF_LIGHTING,false); - matrix4& textureMatrix = material.TextureLayer[0].getTextureMatrix(); - - const vector2df rcenter, scale(1.f, 1.f); - vector2df trans; - - trans.X += 0.0005f; - textureMatrix.buildTextureTransform(0.f, rcenter, trans, scale); - - driver->beginScene(video::ECBF_COLOR | video::ECBF_DEPTH, video::SColor(255,100,101,140)); - sceneManager->drawAll(); - driver->endScene(); - - bool result = takeScreenshotAndCompareAgainstReference(driver, "-textureMatrix.png"); - - trans.X += 0.45f; - textureMatrix.buildTextureTransform(0.f, rcenter, trans, scale); - - driver->beginScene(video::ECBF_COLOR | video::ECBF_DEPTH, video::SColor(255,100,101,140)); - sceneManager->drawAll(); - driver->endScene(); - - result &= takeScreenshotAndCompareAgainstReference(driver, "-textureMatrix2.png"); - - device->closeDevice(); - device->run(); - device->drop(); - - return result; -} - -bool danglingTexturePointer() -{ -// A demo of the OpenGL "white texture" bug in Irrlicht -// Author: Matt Giuca -// (Vaguely based on the Irrlicht 2D graphics tutorial) - -// I have found that in some situations, when using the OpenGL driver, some -// textures appear white. -// This is caused by deleting a texture while it is active (the last texture -// read or written to), and then loading a new texture at the same memory -// location. The new texture will not be loaded properly. - -// This demo triggers the bug (though there is some probability that it won't -// be triggered; just run it again until it shows a white square instead of -// the Irrlicht logo). - - // This is only a problem in the OpenGL driver - irr::IrrlichtDevice* device = irr::createDevice(irr::video::EDT_OPENGL, - irr::core::dimension2d<irr::u32>(160, 120)); - if (!device) - return true; - - irr::video::IVideoDriver* driver = device->getVideoDriver(); - - stabilizeScreenBackground(driver); - - // Load a texture from a file - // This binds and uploads to OpenGL texture #2. - irr::video::ITexture* logo2 = driver->getTexture("../media/irrlichtlogo2.png"); - // Remove the texture from the driver (delete it from hardware) - // This leaves CurrentTexture pointing at logo2 - driver->removeTexture(logo2); - // Load another texture from a file - // There is a good probability that logo3 will be allocated the same - // memory address as logo2. If that happens, - // COpenGLDriver::setActiveTexture will not bother to call glBindTextures - // (thinking that logo3 is the same texture as logo2). - // Therefore, the logo3 texture will be uploaded to texture #0, not #2. - irr::video::ITexture* logo3 = driver->getTexture("../media/irrlichtlogo3.png"); - - device->run(); - { - driver->beginScene(video::ECBF_COLOR | video::ECBF_DEPTH, irr::video::SColor(255,100,101,140)); - - // This is required to trigger the white appearance (this unbinds the - // texture, forcing draw2DImage to rebind the logo3 texture (#2)). - driver->setMaterial(irr::video::SMaterial()); - - // Since logo3 was uploaded to #0, not #2, this will bind texture #2, - // which has never been written to. OpenGL considers an empty texture - // to be white. - driver->draw2DImage(logo3, irr::core::position2d<irr::s32>(20, 20)); - - driver->endScene(); - } - - const bool result = takeScreenshotAndCompareAgainstReference(driver, "-texturePointer.png"); - - device->closeDevice(); - device->run(); - device->drop(); - - return result; -} - -bool textureRenderStates(void) -{ - bool result = true; - TestWithAllDrivers(renderAndLoad); - TestWithAllDrivers(renderAndRemove); - TestWithAllDrivers(testTextureMatrixInMixedScenes); - TestWithAllDrivers(manyTextures); - TestWithAllDrivers(textureMatrix); - result &= danglingTexturePointer(); - - return result; -} diff --git a/tests/timer.cpp b/tests/timer.cpp deleted file mode 100644 index 935c2ef5..00000000 --- a/tests/timer.cpp +++ /dev/null @@ -1,66 +0,0 @@ -#include "testUtils.h" - -using namespace irr; -using namespace core; - -// Test the functionality of the Irrlicht timer -bool testTimer(void) -{ - bool success = true; - - IrrlichtDevice* device = createDevice(video::EDT_NULL); - if (!device) - return false; - - logTestString("Testing virtual timer.\n"); - - ITimer* timer = device->getTimer(); - - // must be running at start - success &= !timer->isStopped(); - - // starting more often should not stop the timer - timer->start(); - success &= !timer->isStopped(); - - // one stop should not stop the timer because it's started twice now - timer->stop(); - success &= !timer->isStopped(); - - // another stop should really stop it - timer->stop(); - success &= timer->isStopped(); - - // third stop - timer should still be stopped - timer->stop(); - success &= timer->isStopped(); - - // should not start yet - timer->start(); - success &= timer->isStopped(); - - // start again - timer->start(); - success &= !timer->isStopped(); - - logTestString("Testing virtual timer done. %s\n", success?"Success":"Failure"); - - logTestString("Testing real timer.\n"); - const u32 startVirtual = timer->getTime(); - const u32 startReal = timer->getRealTime(); - device->sleep(2); - if (startReal != timer->getRealTime()) - logTestString("Warning: Real timer did not progress. Maybe the time slices are too coarse to see.\n"); - if (startVirtual != timer->getTime()) - logTestString("Warning: Virtual timer did not progress. Maybe the time slices are too coarse to see.\n"); - - irr::ITimer::RealTimeDate date = timer->getRealTimeAndDate(); - logTestString("Real time and date. %d.%d.%d at %d:%d:%d\n", date.Day, date.Month, date.Year, date.Hour, date.Minute, date.Second); - logTestString("This is day %d of the year and weekday %d. The current time zone has daylight saving %s\n", date.Yearday, date.Weekday, date.IsDST?"enabled":"disabled"); - - device->closeDevice(); - device->run(); - device->drop(); - - return success; -} diff --git a/tests/transparentMaterials.cpp b/tests/transparentMaterials.cpp deleted file mode 100644 index e411b674..00000000 --- a/tests/transparentMaterials.cpp +++ /dev/null @@ -1,371 +0,0 @@ -// Copyright (C) 2008-2012 Christian Stehno, Colin MacDonald -// No rights reserved: this software is in the public domain. - -#include "testUtils.h" - -using namespace irr; -using namespace core; -using namespace scene; -using namespace video; - - -//! Check that EMT_TRANSPARENT_ALPHA_CHANNEL_REF works as expected -bool testTransparentAlphaChannelRef(video::E_DRIVER_TYPE driverType) -{ - IrrlichtDevice* device = createDevice(driverType, core::dimension2d<u32>(160, 120), 32); - if (!device) - return true; - - video::IVideoDriver* driver = device->getVideoDriver(); - scene::ISceneManager* smgr = device->getSceneManager(); - - if (driver->getColorFormat() != video::ECF_A8R8G8B8) - { - device->closeDevice(); - device->run(); - device->drop(); - return true; - } - - stabilizeScreenBackground(driver); - - logTestString("Testing driver %ls\n", driver->getName()); - - driver->setTextureCreationFlag(video::ETCF_ALWAYS_32_BIT, true); - - ISceneNode * backCube = smgr->addCubeSceneNode(); - backCube->setPosition(vector3df(0, 0, 10)); - backCube->setScale(vector3df(5, 5, 1)); - backCube->setMaterialTexture(0, driver->getTexture("../media/wall.bmp")); - backCube->setMaterialType(video::EMT_SOLID); - backCube->setMaterialFlag(video::EMF_LIGHTING, false); - - ISceneNode * frontCube = smgr->addCubeSceneNode(); - frontCube->setMaterialTexture(0, driver->getTexture("../media/help.png")); - frontCube->setMaterialType(video::EMT_TRANSPARENT_ALPHA_CHANNEL_REF); - frontCube->setMaterialFlag(video::EMF_LIGHTING, false); - - (void)smgr->addCameraSceneNode(0, vector3df(0, 0, -15)); - - driver->beginScene(video::ECBF_COLOR | video::ECBF_DEPTH, video::SColor(255,113,113,133)); - smgr->drawAll(); - driver->endScene(); - - bool result = takeScreenshotAndCompareAgainstReference(driver, "-transparentAlphaChannelRef.png", 99.18f); - - device->closeDevice(); - device->run(); - device->drop(); - - return result; -} - - -//! Check that EMT_TRANSPARENT_ALPHA_CHANNEL works as expected -bool testTransparentAlphaChannel(video::E_DRIVER_TYPE driverType) -{ - IrrlichtDevice* device = createDevice(driverType, core::dimension2d<u32>(160, 120), 32); - if (!device) - return true; - - video::IVideoDriver* driver = device->getVideoDriver(); - scene::ISceneManager* smgr = device->getSceneManager(); - - if (driver->getColorFormat() != video::ECF_A8R8G8B8) - { - device->closeDevice(); - device->run(); - device->drop(); - return true; - } - - stabilizeScreenBackground(driver); - - logTestString("Testing driver %ls\n", driver->getName()); - - driver->setTextureCreationFlag(video::ETCF_ALWAYS_32_BIT, true); - - ISceneNode * backCube = smgr->addCubeSceneNode(); - backCube->setPosition(vector3df(0, 0, 10)); - backCube->setScale(vector3df(5, 5, 1)); - backCube->setMaterialTexture(0, driver->getTexture("../media/wall.bmp")); - backCube->setMaterialType(video::EMT_SOLID); - backCube->setMaterialFlag(video::EMF_LIGHTING, false); - - ISceneNode * frontCube = smgr->addCubeSceneNode(); - frontCube->setMaterialTexture(0, driver->getTexture("../media/help.png")); - frontCube->setMaterialType(video::EMT_TRANSPARENT_ALPHA_CHANNEL); - frontCube->setMaterialFlag(video::EMF_LIGHTING, false); - - (void)smgr->addCameraSceneNode(0, vector3df(0, 0, -15)); - - driver->beginScene(video::ECBF_COLOR | video::ECBF_DEPTH, video::SColor(255,113,113,133)); - smgr->drawAll(); - driver->endScene(); - - bool result = takeScreenshotAndCompareAgainstReference(driver, "-transparentAlphaChannel.png"); - - device->closeDevice(); - device->run(); - device->drop(); - - return result; -} - - -//! Check that EMT_TRANSPARENT_VERTEX_ALPHA works as expected -bool testTransparentVertexAlpha(video::E_DRIVER_TYPE driverType) -{ - IrrlichtDevice* device = createDevice(driverType, core::dimension2d<u32>(160, 120), 32); - if (!device) - return true; - - video::IVideoDriver* driver = device->getVideoDriver(); - scene::ISceneManager* smgr = device->getSceneManager(); - - if (driver->getColorFormat() != video::ECF_A8R8G8B8) - { - device->closeDevice(); - device->run(); - device->drop(); - return true; - } - - stabilizeScreenBackground(driver); - - logTestString("Testing driver %ls\n", driver->getName()); - - driver->setTextureCreationFlag(video::ETCF_ALWAYS_32_BIT, true); - - ISceneNode * backCube = smgr->addCubeSceneNode(); - backCube->setPosition(vector3df(0, 0, 10)); - backCube->setScale(vector3df(5, 5, 1)); - backCube->setMaterialTexture(0, driver->getTexture("../media/wall.bmp")); - // vertex color has alpha 255, hence solid - backCube->setMaterialType(video::EMT_TRANSPARENT_VERTEX_ALPHA); - backCube->setMaterialFlag(video::EMF_LIGHTING, false); - - IMeshSceneNode * frontCube = smgr->addCubeSceneNode(10,0,-1,core::vector3df(-10,0,0)); - frontCube->setMaterialTexture(0, driver->getTexture("../media/help.png")); - frontCube->setMaterialType(video::EMT_TRANSPARENT_VERTEX_ALPHA); - frontCube->setMaterialFlag(video::EMF_LIGHTING, false); - driver->getMeshManipulator()->setVertexColorAlpha(frontCube->getMesh(), 128); - frontCube = smgr->addCubeSceneNode(10,0,-1,core::vector3df(10,0,0)); - frontCube->setMaterialTexture(0, driver->getTexture("../media/help.png")); - frontCube->setMaterialType(video::EMT_TRANSPARENT_VERTEX_ALPHA); - frontCube->setMaterialFlag(video::EMF_LIGHTING, false); - driver->getMeshManipulator()->setVertexColorAlpha(frontCube->getMesh(), 45); - - (void)smgr->addCameraSceneNode(0, vector3df(0, 0, -15)); - - driver->beginScene(video::ECBF_COLOR | video::ECBF_DEPTH, video::SColor(255,113,113,133)); - smgr->drawAll(); - driver->endScene(); - - bool result = takeScreenshotAndCompareAgainstReference(driver, "-transparentVertexAlpha.png", 98.76f); - - device->closeDevice(); - device->run(); - device->drop(); - - return result; -} - - -//! Check that EMT_TRANSPARENT_REFLECTION_2_LAYER works as expected -bool testTransparentReflection2Layer(video::E_DRIVER_TYPE driverType) -{ - IrrlichtDevice* device = createDevice(driverType, core::dimension2d<u32>(160, 120), 32); - if (!device) - return true; - - video::IVideoDriver* driver = device->getVideoDriver(); - scene::ISceneManager* smgr = device->getSceneManager(); - - if (driver->getColorFormat() != video::ECF_A8R8G8B8) - { - device->closeDevice(); - device->run(); - device->drop(); - return true; - } - - stabilizeScreenBackground(driver); - - logTestString("Testing driver %ls\n", driver->getName()); - - driver->setTextureCreationFlag(video::ETCF_ALWAYS_32_BIT, true); - - ISceneNode * backCube = smgr->addCubeSceneNode(); - backCube->setPosition(vector3df(0, 0, 10)); - backCube->setScale(vector3df(5, 5, 1)); - backCube->setMaterialTexture(0, driver->getTexture("../media/wall.bmp")); - backCube->setMaterialTexture(1, driver->getTexture("../media/water.jpg")); - // vertex color has alpha 255, hence solid - backCube->setMaterialType(video::EMT_TRANSPARENT_REFLECTION_2_LAYER); - backCube->setMaterialFlag(video::EMF_LIGHTING, false); - - IMeshSceneNode * frontCube = smgr->addCubeSceneNode(10,0,-1,core::vector3df(-10,0,0)); - frontCube->setMaterialTexture(0, driver->getTexture("../media/help.png")); - frontCube->setMaterialTexture(1, driver->getTexture("../media/water.jpg")); - frontCube->setMaterialType(video::EMT_TRANSPARENT_REFLECTION_2_LAYER); - frontCube->setMaterialFlag(video::EMF_LIGHTING, false); - driver->getMeshManipulator()->setVertexColorAlpha(frontCube->getMesh(), 128); - frontCube = smgr->addCubeSceneNode(10,0,-1,core::vector3df(10,0,0)); - frontCube->setMaterialTexture(0, driver->getTexture("../media/help.png")); - frontCube->setMaterialTexture(1, driver->getTexture("../media/water.jpg")); - frontCube->setMaterialType(video::EMT_TRANSPARENT_REFLECTION_2_LAYER); - frontCube->setMaterialFlag(video::EMF_LIGHTING, false); - driver->getMeshManipulator()->setVertexColorAlpha(frontCube->getMesh(), 45); - - (void)smgr->addCameraSceneNode(0, vector3df(0, 0, -15)); - - driver->beginScene(video::ECBF_COLOR | video::ECBF_DEPTH, video::SColor(255,113,113,133)); - smgr->drawAll(); - driver->endScene(); - - bool result = takeScreenshotAndCompareAgainstReference(driver, "-transparentReflection2Layer.png"); - - device->closeDevice(); - device->run(); - device->drop(); - - return result; -} - - -//! Check that EMT_TRANSPARENT_ADD_COLOR works as expected -bool testTransparentAddColor(video::E_DRIVER_TYPE driverType) -{ - IrrlichtDevice* device = createDevice(driverType, core::dimension2d<u32>(160, 120), 32); - if (!device) - return true; - - video::IVideoDriver* driver = device->getVideoDriver(); - scene::ISceneManager* smgr = device->getSceneManager(); - - if (driver->getColorFormat() != video::ECF_A8R8G8B8) - { - device->closeDevice(); - device->run(); - device->drop(); - return true; - } - - stabilizeScreenBackground(driver); - - logTestString("Testing driver %ls\n", driver->getName()); - - driver->setTextureCreationFlag(video::ETCF_ALWAYS_32_BIT, true); - - ISceneNode * backCube = smgr->addCubeSceneNode(); - backCube->setPosition(vector3df(0, 0, 10)); - backCube->setScale(vector3df(5, 5, 1)); - backCube->setMaterialTexture(0, driver->getTexture("../media/wall.bmp")); - backCube->setMaterialType(video::EMT_SOLID); - backCube->setMaterialFlag(video::EMF_LIGHTING, false); - - IMeshSceneNode * frontCube = smgr->addCubeSceneNode(); - frontCube->setMaterialTexture(0, driver->getTexture("../media/help.png")); - frontCube->setMaterialType(video::EMT_TRANSPARENT_ADD_COLOR); - frontCube->setMaterialFlag(video::EMF_LIGHTING, false); - - (void)smgr->addCameraSceneNode(0, vector3df(0, 0, -15)); - - driver->beginScene(video::ECBF_COLOR | video::ECBF_DEPTH, video::SColor(255,113,113,133)); - smgr->drawAll(); - driver->endScene(); - - bool result = takeScreenshotAndCompareAgainstReference(driver, "-transparentAddColor.png"); - - device->closeDevice(); - device->run(); - device->drop(); - - return result; -} - - -bool testTransparentVertexAlphaMore(E_DRIVER_TYPE driverType) -{ - IrrlichtDevice *device = createDevice(driverType, dimension2d<u32>(160, 120)); - if (!device) - return true; - - IVideoDriver* driver = device->getVideoDriver(); - ISceneManager* smgr = device->getSceneManager(); - - if (driver->getColorFormat() != video::ECF_A8R8G8B8) - { - device->closeDevice(); - device->run(); - device->drop(); - return true; - } - - stabilizeScreenBackground(driver); - - logTestString("Testing driver %ls\n", driver->getName()); - - IAnimatedMesh* mesh = smgr->getMesh("../media/sydney.md2"); - IAnimatedMeshSceneNode* node = smgr->addAnimatedMeshSceneNode( mesh ); - IMeshSceneNode* cube = smgr->addCubeSceneNode(10.0f,0,-1,vector3df(-5,3,-15)); - - if (node) - { - node->setMaterialFlag(EMF_LIGHTING, false); - node->setFrameLoop(0, 310); - node->setMaterialTexture( 0, driver->getTexture("../media/sydney.bmp") ); - } - if (cube) - { - cube->getMaterial(0).MaterialType = EMT_TRANSPARENT_VERTEX_ALPHA; - cube->setMaterialTexture(0, driver->getTexture("../media/wall.bmp")); - cube->setMaterialFlag(EMF_LIGHTING, false); - smgr->getMeshManipulator()->setVertexColorAlpha(cube->getMesh(),128); - } - // second cube without texture - cube = smgr->addCubeSceneNode(10.0f,0,-1,vector3df(5,3,-15)); - if (cube) - { - cube->getMaterial(0).MaterialType = EMT_TRANSPARENT_VERTEX_ALPHA; - cube->setMaterialFlag(EMF_LIGHTING, false); - smgr->getMeshManipulator()->setVertexColorAlpha(cube->getMesh(),128); - } - - smgr->addCameraSceneNode(0, vector3df(0,30,-40), vector3df(0,5,0)); - - driver->beginScene(video::ECBF_COLOR | video::ECBF_DEPTH, SColor(0,200,200,200)); - smgr->drawAll(); - driver->endScene(); - - bool result = takeScreenshotAndCompareAgainstReference(driver, "-transparentVertexAlphaChannelMore.png", 99.18f); - - device->closeDevice(); - device->run(); - device->drop(); - - return result; -} - - -bool transparentMaterials(void) -{ - bool result = true; - TestWithAllDrivers(testTransparentAlphaChannel); - // FIXME Rogerborg 8-January-2010. Burning's video currently produces unexpected results, - // blending using the full alpha value instead of using a boolean mask. This test is being - // added now anyway to help verify the fix when it's done; it should just require an - // update of the reference image. - TestWithAllDrivers(testTransparentAlphaChannelRef); - // This type seems to be broken as well for Burning's video. - TestWithAllDrivers(testTransparentVertexAlpha); - TestWithAllDrivers(testTransparentAddColor); - // TODO: this simply does not work in OpenGL due to the sphere map - // at least it creates different results, and also varies across drivers - TestWithAllDrivers(testTransparentReflection2Layer); - // This type seems to be broken as well for Burning's video. - TestWithAllDrivers(testTransparentVertexAlphaMore); - - return result; -} diff --git a/tests/triangle3d.cpp b/tests/triangle3d.cpp deleted file mode 100644 index 7da3148a..00000000 --- a/tests/triangle3d.cpp +++ /dev/null @@ -1,281 +0,0 @@ -// Copyright (C) 2008-2012 Colin MacDonald -// No rights reserved: this software is in the public domain. - -#include "testUtils.h" -#include <irrlicht.h> - -using namespace irr; -using namespace core; - -template<class T> -static bool testGetIntersectionWithLine(core::triangle3d<T>& triangle, const core::line3d<T>& ray) -{ - bool allExpected=true; - const vector3d<T> linevect = ray.getVector().normalize(); - vector3d<T> intersection; - // When we just raise Y parallel to the ray then either all should fail or all succeed (the latter in our case). - for (u32 i=0; i<100; ++i) - { - if (!triangle.getIntersectionOfPlaneWithLine(ray.start, linevect, intersection)) - { - allExpected=false; - logTestString("triangle3d plane test %d failed\n", i); - } - //logTestString("intersection: %f %f %f\n", intersection.X, intersection.Y, intersection.Z); - if (!triangle.isPointInsideFast(intersection)) - { - allExpected=false; - logTestString("triangle3d fast point test %d failed\n", i); - } - if (!triangle.isPointInside(intersection)) - { - allExpected=false; - logTestString("triangle3d point test %d failed\n", i); - } - - if (!triangle.getIntersectionWithLine(ray.start, linevect, intersection)) - { - allExpected=false; - logTestString("triangle3d tri test %d failed\n", i); - } - - triangle.pointB.Y += 1; - } - return allExpected; -} - -// modifying the same triangle in diverse ways get some more test-cases automatically -template<class T> -static bool stageModifications(int stage, triangle3d<T>& triangle) -{ - switch ( stage ) - { - case 0: - return true; - case 1: - swap(triangle.pointB, triangle.pointC); - return true; - case 2: - swap(triangle.pointA, triangle.pointC); - return true; - case 3: - triangle.pointA.Z += 1000; - triangle.pointB.Z += 1000; - triangle.pointC.Z += 1000; - return true; - case 4: - swap(triangle.pointA.Y, triangle.pointA.Z); - swap(triangle.pointB.Y, triangle.pointB.Z); - swap(triangle.pointC.Y, triangle.pointC.Z); - return true; - } - return false; -} - -template<class T> -static void stageModifications(int stage, vector3d<T>& point) -{ - switch ( stage ) - { - case 3: - point.Z += 1000; - break; - case 4: - swap(point.Y, point.Z); - break; - } -} - -template<class T> -static bool isPointInside(triangle3d<T> triangleOrig, bool testIsInside, bool testIsInsideFast) -{ - bool allExpected=true; - - array< vector3d<T> > pointsInside; - pointsInside.push_back( vector3d<T>(0,0,0) ); - pointsInside.push_back( (triangleOrig.pointA + triangleOrig.pointB + triangleOrig.pointC) / 3 ); - pointsInside.push_back( (triangleOrig.pointA + triangleOrig.pointB)/2 + vector3d<T>(0,1,0) ); - pointsInside.push_back( (triangleOrig.pointA + triangleOrig.pointC)/2 + vector3d<T>(1,0,0) ); - pointsInside.push_back( (triangleOrig.pointB + triangleOrig.pointC)/2 - vector3d<T>(1,0,0) ); - - for (u32 stage=0; ; ++stage) - { - triangle3d<T> triangle = triangleOrig; - if ( !stageModifications(stage, triangle) ) - break; - - for ( u32 i=0; i < pointsInside.size(); ++i ) - { - vector3d<T> point = pointsInside[i]; - stageModifications(stage, point); - - if ( testIsInside ) - { - allExpected &= triangle.isPointInside( point ); - if ( !allExpected ) - { - logTestString("triangle3d::isPointInside pointsInside test failed in stage %d point %d\n", stage, i); - return false; - } - } - - if ( testIsInsideFast ) - { - allExpected &= triangle.isPointInsideFast( point ); - if ( !allExpected ) - { - logTestString("triangle3d::isPointInsideFast pointsInside test failed in stage %d point %d\n", stage, i); - return false; - } - } - } - } - - array< vector3d<T> > pointsOutside; - pointsOutside.push_back( triangleOrig.pointA - vector3d<T>(1,0,0) ); - pointsOutside.push_back( triangleOrig.pointA - vector3d<T>(0,1,0) ); - pointsOutside.push_back( triangleOrig.pointB + vector3d<T>(1,0,0) ); - pointsOutside.push_back( triangleOrig.pointB - vector3d<T>(0,1,0) ); - pointsOutside.push_back( triangleOrig.pointC - vector3d<T>(1,0,0) ); - pointsOutside.push_back( triangleOrig.pointC + vector3d<T>(1,0,0) ); - pointsOutside.push_back( triangleOrig.pointC + vector3d<T>(0,1,0) ); - pointsOutside.push_back( (triangleOrig.pointA + triangleOrig.pointB)/2 - vector3d<T>(0,1,0) ); - pointsOutside.push_back( (triangleOrig.pointA + triangleOrig.pointC)/2 - vector3d<T>(1,0,0) ); - pointsOutside.push_back( (triangleOrig.pointB + triangleOrig.pointC)/2 + vector3d<T>(1,0,0) ); - - for (u32 stage=0; ; ++stage) - { - triangle3d<T> triangle = triangleOrig; - if ( !stageModifications(stage, triangle) ) - break; - - for ( u32 i=0; i < pointsOutside.size(); ++i ) - { - vector3d<T> point = pointsOutside[i]; - stageModifications(stage, point); - - if ( testIsInside ) - { - allExpected &= !triangle.isPointInside( point ); - if ( !allExpected ) - { - logTestString("triangle3d::isPointInside pointsOutside test failed in stage %d point %d\n", stage, i); - return false; - } - } - - if ( testIsInsideFast ) - { - allExpected &= !triangle.isPointInsideFast( point ); - if ( !allExpected ) - { - logTestString("triangle3d::isPointInsideFast pointsOutside test failed in stage %d point %d\n", stage, i); - return false; - } - } - } - } - - array< vector3d<T> > pointsBorder; - pointsBorder.push_back( triangleOrig.pointA ); - pointsBorder.push_back( triangleOrig.pointB ); - pointsBorder.push_back( triangleOrig.pointC ); - pointsBorder.push_back( (triangleOrig.pointA + triangleOrig.pointB)/2 ); - pointsBorder.push_back( (triangleOrig.pointA + triangleOrig.pointC)/2 ); - pointsBorder.push_back( (triangleOrig.pointB + triangleOrig.pointC)/2 ); - - for (u32 stage=0; ; ++stage) - { - triangle3d<T> triangle = triangleOrig; - if ( !stageModifications(stage, triangle) ) - break; - - for ( u32 i=0; i < pointsBorder.size(); ++i ) - { - vector3d<T> point = pointsBorder[i]; - stageModifications(stage, point); - - if ( testIsInside ) - { - allExpected &= triangle.isPointInside( point ); - if ( !allExpected ) - { - logTestString("triangle3d::isPointInside pointsBorder test failed in stage %d point %d\n", stage, i); - return false; - } - } - - if ( testIsInsideFast ) - { - allExpected &= triangle.isPointInsideFast( point ); - if ( !allExpected ) - { - logTestString("triangle3d::isPointInsideFast pointsBorder test failed in stage %d point %d\n", stage, i); - return false; - } - } - } - } - - return allExpected; -} - -// Test the functionality of triangle3d<T> -bool testTriangle3d(void) -{ - bool allExpected = true; - - logTestString("Test getIntersectionWithLine with f32\n"); - { - triangle3df triangle( - vector3df(11300.f, 129.411758f, 200.f), - vector3df(11200.f, 94.117645f, 300.f), - vector3df(11300.f, 129.411758f, 300.f)); - line3df ray; - ray.start = vector3df(11250.f, 329.f, 250.f); - ray.end = vector3df(11250.f, -1000.f, 250.f); - allExpected &= testGetIntersectionWithLine(triangle, ray); - } - logTestString("Test getIntersectionWithLine with f64\n"); - { - triangle3d<f64> triangle( - vector3d<f64>(11300., 129.411758, 200.), - vector3d<f64>(11200., 94.117645, 300.), - vector3d<f64>(11300., 129.411758, 300.)); - line3d<f64> ray; - ray.start = vector3d<f64>(11250., 329., 250.); - ray.end = vector3d<f64>(11250., -1000., 250.); - allExpected &= testGetIntersectionWithLine(triangle, ray); - } - - bool testEigen = triangle3di(vector3di(250, 0, 0), vector3di(0, 0, 500), vector3di(500, 0, 500)).isPointInside(vector3di(300,0,300)); - if ( !testEigen ) // test from Eigen from here: http://irrlicht.sourceforge.net/forum/viewtopic.php?f=7&t=44372&p=254331#p254331 - logTestString("Test isPointInside fails with integers\n"); - allExpected &= testEigen; - - logTestString("Test isPointInside with f32\n"); - { - triangle3d<f32> t(vector3d<f32>(-1000,-1000,0), vector3d<f32>(1000,-1000,0), vector3d<f32>(0,1000,0)); - allExpected &= isPointInside(t, true, true); - } - - logTestString("Test isPointInside with f64\n"); - { - triangle3d<f64> t(vector3d<f64>(-1000,-1000,0), vector3d<f64>(1000,-1000,0), vector3d<f64>(0,1000,0)); - allExpected &= isPointInside(t, true, true); - } - - logTestString("Test isPointInside with s32\n"); - { - triangle3d<s32> t(vector3d<s32>(-1000,-1000,0), vector3d<s32>(1000,-1000,0), vector3d<s32>(0,1000,0)); - allExpected &= isPointInside(t, false, true); - } - - if(allExpected) - logTestString("\nAll tests passed\n"); - else - logTestString("\nFAIL!\n"); - - return allExpected; -} - diff --git a/tests/triangleSelector.cpp b/tests/triangleSelector.cpp deleted file mode 100644 index 36dfcf25..00000000 --- a/tests/triangleSelector.cpp +++ /dev/null @@ -1,300 +0,0 @@ -// Copyright (C) 2008-2012 Christian Stehno, Colin MacDonald -// No rights reserved: this software is in the public domain. - -#include "testUtils.h" - -using namespace irr; - -namespace{ - -class MyEventReceiver : public IEventReceiver -{ -public: - // This is the one method that we have to implement - virtual bool OnEvent(const SEvent& event) - { - // Remember whether each key is down or up - if (event.EventType == EET_KEY_INPUT_EVENT) - KeyIsDown[event.KeyInput.Key] = event.KeyInput.PressedDown; - - return false; - } - - // This is used to check whether a key is being held down - virtual bool IsKeyDown(EKEY_CODE keyCode) const - { - return KeyIsDown[keyCode]; - } - - MyEventReceiver() - { - for (u32 i=0; i<KEY_KEY_CODES_COUNT; ++i) - KeyIsDown[i] = false; - } - -private: - // We use this array to store the current state of each key - bool KeyIsDown[KEY_KEY_CODES_COUNT]; -}; - -//! Tests using octree selector -bool octree() -{ - IrrlichtDevice *device = createDevice (video::EDT_OPENGL, core::dimension2d < u32 > (160, 120)); - if (!device) - return true; // No error if device does not exist - - video::IVideoDriver* driver = device->getVideoDriver(); - scene::ISceneManager* smgr = device->getSceneManager(); - - stabilizeScreenBackground(driver); - - scene::IMetaTriangleSelector * meta = smgr->createMetaTriangleSelector(); - - device->getFileSystem()->addFileArchive("../media/map-20kdm2.pk3"); - scene::IAnimatedMesh* q3levelmesh = smgr->getMesh("20kdm2.bsp"); - if (q3levelmesh) - { - scene::ISceneNode* q3node = smgr->addOctreeSceneNode(q3levelmesh->getMesh(0)); - - q3node->setPosition(core::vector3df(-1350,-130,-1400)); - - scene::ITriangleSelector * selector = - smgr->createOctreeTriangleSelector(q3levelmesh->getMesh(0), q3node, 128); - meta->addTriangleSelector(selector); - selector->drop(); - } - - scene::ICameraSceneNode* camera = smgr->addCameraSceneNode(); - camera->setPosition(core::vector3df(-100,50,-150)); - camera->updateAbsolutePosition(); - camera->setTarget(camera->getAbsolutePosition() + core::vector3df(0, 0, 20)); - - device->getCursorControl()->setVisible(false); - - enum - { - MAX_TRIANGLES = 4096, // Large to test getting all the triangles - BOX_SIZE1 = 300, - BOX_SIZE2 = 50 - }; - - core::triangle3df triangles[MAX_TRIANGLES]; - core::vector3df boxPosition(camera->getAbsolutePosition()); - - video::SMaterial unlit; - unlit.Lighting = false; - unlit.Thickness = 3.f; - unlit.PolygonOffsetSlopeScale= -1.f; - unlit.PolygonOffsetDepthBias = -1.f; - - bool result = true; - { - camera->setPosition(core::vector3df(-620,-20,550)); - driver->beginScene(video::ECBF_COLOR | video::ECBF_DEPTH, video::SColor(0)); - smgr->drawAll(); - - core::aabbox3df box(boxPosition.X - BOX_SIZE1, boxPosition.Y - BOX_SIZE1, boxPosition.Z - BOX_SIZE1, - boxPosition.X + BOX_SIZE1, boxPosition.Y + BOX_SIZE1, boxPosition.Z + BOX_SIZE1); - - driver->setTransform(video::ETS_WORLD, core::matrix4()); - driver->setMaterial(unlit); - driver->draw3DBox(box, video::SColor(255, 0, 255, 0)); - - if(meta) - { - s32 found; - meta->getTriangles(triangles, MAX_TRIANGLES, found, box); - - while(--found >= 0) - driver->draw3DTriangle(triangles[found], video::SColor(255, 255, 0, 0)); - } - - driver->endScene(); - result &= takeScreenshotAndCompareAgainstReference(driver, "-octree_select1.png"); - } - { - camera->setPosition(core::vector3df(120,40,50)); - driver->beginScene(video::ECBF_COLOR | video::ECBF_DEPTH, video::SColor(0)); - smgr->drawAll(); - - core::aabbox3df box(boxPosition.X - BOX_SIZE2, boxPosition.Y - BOX_SIZE2, boxPosition.Z - BOX_SIZE2, - boxPosition.X + BOX_SIZE2, boxPosition.Y + BOX_SIZE2, boxPosition.Z + BOX_SIZE2); - - driver->setTransform(video::ETS_WORLD, core::matrix4()); - driver->setMaterial(unlit); - driver->draw3DBox(box, video::SColor(255, 0, 255, 0)); - - if(meta) - { - s32 found; - meta->getTriangles(triangles, MAX_TRIANGLES, found, box); - - while(--found >= 0) - driver->draw3DTriangle(triangles[found], video::SColor(255, 255, 0, 0)); - } - - driver->endScene(); - result &= takeScreenshotAndCompareAgainstReference(driver, "-octree_select2.png"); - } - - meta->drop(); - - device->closeDevice(); - device->run(); - device->drop(); - - return result; -} - -//! Tests using triangle selector -bool triangle() -{ - IrrlichtDevice *device = createDevice (video::EDT_OPENGL, core::dimension2d < u32 > (160, 120)); - if (!device) - return true; // No error if device does not exist - - MyEventReceiver receiver; - device->setEventReceiver(&receiver); - - video::IVideoDriver* driver = device->getVideoDriver(); - scene::ISceneManager* smgr = device->getSceneManager(); - - stabilizeScreenBackground(driver); - - scene::IMetaTriangleSelector * meta = smgr->createMetaTriangleSelector(); - - scene::IAnimatedMesh * mesh = smgr->getMesh("../media/sydney.md2"); - scene::IAnimatedMeshSceneNode * sydney = smgr->addAnimatedMeshSceneNode( mesh ); - if (sydney) - { - sydney->setPosition(core::vector3df(15, -10, 15)); - sydney->setMaterialFlag(video::EMF_LIGHTING, false); - sydney->setMD2Animation ( scene::EMAT_STAND ); - sydney->setAnimationSpeed(0.f); - sydney->setMaterialTexture( 0, driver->getTexture("../media/sydney.bmp") ); - - scene::ITriangleSelector * selector = - smgr->createTriangleSelector(sydney->getMesh()->getMesh(0), sydney); - meta->addTriangleSelector(selector); - selector->drop(); - } - - scene::ICameraSceneNode* camera = - smgr->addCameraSceneNodeFPS(); - camera->setPosition(core::vector3df(70,0,-30)); - camera->updateAbsolutePosition(); - camera->setTarget(camera->getAbsolutePosition() + core::vector3df(-20, 0, 20)); - - device->getCursorControl()->setVisible(false); - - enum - { - MAX_TRIANGLES = 5000, // Large to test getting all the triangles - BOX_SIZE = 30 - }; - - core::triangle3df triangles[MAX_TRIANGLES]; - core::vector3df boxPosition(0,0,0); - - video::SMaterial unlit; - unlit.Lighting = false; - unlit.Thickness = 3.f; - unlit.PolygonOffsetSlopeScale= -1.f; - unlit.PolygonOffsetDepthBias = -1.f; - - bool result = true; - { - driver->beginScene(video::ECBF_COLOR | video::ECBF_DEPTH, video::SColor(0xff00ffff)); - smgr->drawAll(); - - core::aabbox3df box(boxPosition.X - BOX_SIZE, boxPosition.Y - BOX_SIZE, boxPosition.Z - BOX_SIZE, - boxPosition.X + BOX_SIZE, boxPosition.Y + BOX_SIZE, boxPosition.Z + BOX_SIZE); - - driver->setTransform(video::ETS_WORLD, core::matrix4()); - driver->setMaterial(unlit); - driver->draw3DBox(box, video::SColor(255, 0, 255, 0)); - - if(meta) - { - s32 found; - meta->getTriangles(triangles, MAX_TRIANGLES, found, box); - - while(--found >= 0) - driver->draw3DTriangle(triangles[found], video::SColor(255, 255, 0, 0)); - } - - driver->endScene(); - result &= takeScreenshotAndCompareAgainstReference(driver, "-tri_select1.png"); - } - { - boxPosition.Z -= 10.f; - driver->beginScene(video::ECBF_COLOR | video::ECBF_DEPTH, video::SColor(0xff00ffff)); - smgr->drawAll(); - - core::aabbox3df box(boxPosition.X - BOX_SIZE, boxPosition.Y - BOX_SIZE, boxPosition.Z - BOX_SIZE, - boxPosition.X + BOX_SIZE, boxPosition.Y + BOX_SIZE, boxPosition.Z + BOX_SIZE); - - driver->setTransform(video::ETS_WORLD, core::matrix4()); - driver->setMaterial(unlit); - driver->draw3DBox(box, video::SColor(255, 0, 255, 0)); - - if(meta) - { - s32 found; - meta->getTriangles(triangles, MAX_TRIANGLES, found, box); - - while(--found >= 0) - driver->draw3DTriangle(triangles[found], video::SColor(255, 255, 0, 0)); - } - - driver->endScene(); - result &= takeScreenshotAndCompareAgainstReference(driver, "-tri_select2.png"); - } - { - boxPosition.Z -= 20.f; - driver->beginScene(video::ECBF_COLOR | video::ECBF_DEPTH, video::SColor(0xff00ffff)); - smgr->drawAll(); - - core::aabbox3df box(boxPosition.X - BOX_SIZE, boxPosition.Y - BOX_SIZE, boxPosition.Z - BOX_SIZE, - boxPosition.X + BOX_SIZE, boxPosition.Y + BOX_SIZE, boxPosition.Z + BOX_SIZE); - - driver->setTransform(video::ETS_WORLD, core::matrix4()); - driver->setMaterial(unlit); - driver->draw3DBox(box, video::SColor(255, 0, 255, 0)); - - if(meta) - { - s32 found; - meta->getTriangles(triangles, MAX_TRIANGLES, found, box); - - while(--found >= 0) - driver->draw3DTriangle(triangles[found], video::SColor(255, 255, 0, 0)); - } - - driver->endScene(); - result &= takeScreenshotAndCompareAgainstReference(driver, "-tri_select3.png"); - } - - meta->drop(); - - device->closeDevice(); - device->run(); - device->drop(); - - return result; -} -} - -// Tests need not be accurate, as we just need to include at least -// the triangles that match the criteria. But we try to be as close -// as possible of course, to reduce the collision checks done afterwards -bool triangleSelector(void) -{ - bool result = true; - - result &= octree(); - result &= triangle(); - - return result; -} diff --git a/tests/userClipPlane.cpp b/tests/userClipPlane.cpp deleted file mode 100644 index ab87cfeb..00000000 --- a/tests/userClipPlane.cpp +++ /dev/null @@ -1,69 +0,0 @@ -#include "testUtils.h" - -using namespace irr; - -static bool withSphere(video::E_DRIVER_TYPE type) -{ - IrrlichtDevice* device = createDevice(type, core::dimension2d<u32>(160, 120)); - - if (device == 0) - return true; - - video::IVideoDriver* driver = device->getVideoDriver(); - scene::ISceneManager* smgr = device->getSceneManager(); - - stabilizeScreenBackground(driver); - - driver->setClipPlane(0, core::plane3df(core::vector3df(0,18,0), core::vector3df(0,-1,0)), true); - smgr->addLightSceneNode(0, core::vector3df(30,30,50)); - // create first sphere - scene::ISceneNode* sphere = smgr->addMeshSceneNode(smgr->addSphereMesh("sphere", 10, 64, 64)); - - if (sphere) - { - sphere->setPosition(core::vector3df(0,10,0)); - sphere->setMaterialFlag(video::EMF_BACK_FACE_CULLING, false); - } - - sphere = smgr->addMeshSceneNode(smgr->addHillPlaneMesh("mesh", core::dimension2df(10,10), core::dimension2du(10,10))); - sphere->setPosition(core::vector3df(0,10,0)); - - smgr->addCameraSceneNode(0, core::vector3df(-25,30,20), core::vector3df()); - - driver->setClipPlane(1, core::plane3df(core::vector3df(0,2,0), core::vector3df(0,1,0)), true); - driver->setClipPlane(2, core::plane3df(core::vector3df(8,0,0), core::vector3df(-1,0,0))); - - device->run(); -// while(device->run()) - { - driver->beginScene(video::ECBF_COLOR | video::ECBF_DEPTH, video::SColor(255,113,113,133)); - driver->setClipPlane(3, core::plane3df(core::vector3df(-8,0,0), core::vector3df(1,0,0)), true); - driver->setClipPlane(4, core::plane3df(core::vector3df(0,0,8), core::vector3df(0,0,-1))); - driver->setClipPlane(5, core::plane3df(core::vector3df(0,0,-8), core::vector3df(0,0,1))); - driver->enableClipPlane(2, true); - driver->enableClipPlane(4, true); - driver->enableClipPlane(5, true); - smgr->drawAll(); - driver->enableClipPlane(1, false); - driver->enableClipPlane(2, false); - driver->enableClipPlane(4, false); - driver->enableClipPlane(5, false); - driver->setTransform(video::ETS_WORLD, core::IdentityMatrix); - driver->setMaterial(video::IdentityMaterial); - driver->draw3DLine(core::vector3df(), core::vector3df(0,0,50)); - driver->endScene(); - } - bool result = takeScreenshotAndCompareAgainstReference(driver, "-ucpsphere.png"); - - device->closeDevice(); - device->run(); - device->drop(); - return result; -} - -bool userclipplane() -{ - bool result = true; - TestWithAllHWDrivers(withSphere); - return result; -} diff --git a/tests/vectorPositionDimension2d.cpp b/tests/vectorPositionDimension2d.cpp deleted file mode 100644 index 5a02fb5d..00000000 --- a/tests/vectorPositionDimension2d.cpp +++ /dev/null @@ -1,93 +0,0 @@ -// Copyright (C) 2008-2012 Colin MacDonald -// No rights reserved: this software is in the public domain. - -/** This test verifies that position2d and vector2d are interchangeable, - and that they can convert from dimension2d */ - -#include "testUtils.h" - -using namespace irr; -using namespace core; - - -template <class DIMENSION, class VECTOR, class POSITION, class T> -static bool doTest(void) -{ - bool result = true; - - DIMENSION dimension((T)99.9, (T)99.9); - VECTOR vector(dimension); - POSITION position(vector); - DIMENSION dimension2(vector); - - result &= (vector == position); - result &= (vector == dimension); // The conversion should be explicit. - result &= (dimension2 == position); - result &= (position == POSITION((T)99.9, (T)99.9)); - assert_log(result); - - dimension = (T)2 * position; - result &= (dimension == VECTOR(2 * (T)99.9, 2 * (T)99.9)); - assert_log(result); - - dimension /= (T)2; - result &= (dimension == POSITION((T)99.9, (T)99.9)); - assert_log(result); - - dimension += vector; - result &= (dimension == VECTOR(2 * (T)99.9, 2 * (T)99.9)); - assert_log(result); - - dimension -= position; - result &= (dimension == POSITION((T)99.9, (T)99.9)); - assert_log(result); - - position = dimension; - result &= (position == VECTOR((T)99.9, (T)99.9)); - assert_log(result); - - vector += position; - result &= (vector == POSITION(2 * (T)99.9, 2 * (T)99.9)); - assert_log(result); - - vector -= position; - result &= (vector == dimension); - assert_log(result); - - position *= (T)3.5; - result &= (position == VECTOR((T)3.5 * (T)99.9, (T)3.5 * (T)99.9)); - assert_log(result); - - vector += dimension; - result &= (vector == VECTOR(2 * (T)99.9, 2 * (T)99.9)); - assert_log(result); - - return result; -} - -bool vectorPositionDimension2d(void) -{ - bool result = true; - - logTestString("vector,position,dimension test with s32\n\n"); - result &= doTest<dimension2di, vector2di, position2di, s32>(); - if (result) - logTestString("tests passed\n\n"); - else - logTestString("\ntests failed\n\n"); - logTestString("vector,position,dimension test with f32\n\n"); - result &= doTest<dimension2df, vector2df, position2df, f32>(); - if (result) - logTestString("tests passed\n\n"); - else - logTestString("\ntests failed\n\n"); - logTestString("vector,position,dimension test with f64\n\n"); - result &= doTest<dimension2d<f64>, vector2d<f64>, position2d<f64>, f64>(); - if (result) - logTestString("tests passed\n\n"); - else - logTestString("\ntests failed\n\n"); - - return result; -} - diff --git a/tests/videoDriver.cpp b/tests/videoDriver.cpp deleted file mode 100644 index 3635ebe8..00000000 --- a/tests/videoDriver.cpp +++ /dev/null @@ -1,44 +0,0 @@ -// Copyright (C) 2008-2012 Colin MacDonald, Christian Stehno -// No rights reserved: this software is in the public domain. - -#include "testUtils.h" - -using namespace irr; -using namespace core; - -/** Test various things in video drivers. */ -bool testVideoDriver(video::E_DRIVER_TYPE driverType) -{ - IrrlichtDevice *device = - createDevice(driverType, dimension2d<u32>(160, 120)); - - if (!device) - return true; - - video::IVideoDriver* driver = device->getVideoDriver(); - logTestString("Testing driver %ls\n", driver->getName()); - logTestString("MaxTextures: %d\n", driver->getDriverAttributes().getAttributeAsInt("MaxTextures")); - logTestString("MaxSupportedTextures: %d\n", driver->getDriverAttributes().getAttributeAsInt("MaxSupportedTextures")); - logTestString("MaxLights: %d\n", driver->getDriverAttributes().getAttributeAsInt("MaxLights")); - logTestString("MaxAnisotropy: %d\n", driver->getDriverAttributes().getAttributeAsInt("MaxAnisotropy")); - logTestString("MaxUserClipPlanes: %d\n", driver->getDriverAttributes().getAttributeAsInt("MaxUserClipPlanes")); - logTestString("MaxAuxBuffers: %d\n", driver->getDriverAttributes().getAttributeAsInt("MaxAuxBuffers")); - logTestString("MaxMultipleRenderTargets: %d\n", driver->getDriverAttributes().getAttributeAsInt("MaxMultipleRenderTargets")); - logTestString("MaxIndices: %d\n", driver->getDriverAttributes().getAttributeAsInt("MaxIndices")); - logTestString("MaxTextureSize: %d\n", driver->getDriverAttributes().getAttributeAsInt("MaxTextureSize")); - logTestString("MaxGeometryVerticesOut: %d\n", driver->getDriverAttributes().getAttributeAsInt("MaxGeometryVerticesOut")); - logTestString("Version: %d\n", driver->getDriverAttributes().getAttributeAsInt("Version")); - logTestString("ShaderLanguageVersion: %d\n\n", driver->getDriverAttributes().getAttributeAsInt("ShaderLanguageVersion")); - - device->closeDevice(); - device->run(); - device->drop(); - return true; -} - -bool videoDriver() -{ - bool result = true; - TestWithAllDrivers(testVideoDriver); - return result; -} diff --git a/tests/viewPort.cpp b/tests/viewPort.cpp deleted file mode 100644 index 9afd9e27..00000000 --- a/tests/viewPort.cpp +++ /dev/null @@ -1,79 +0,0 @@ -// Copyright (C) 2008-2012 Colin MacDonald -// No rights reserved: this software is in the public domain. - -#include "testUtils.h" - -using namespace irr; -using namespace core; -using namespace scene; -using namespace video; -using namespace io; -using namespace gui; - -//! Tests view ports and text rendering. -/** The result should be as follows: We have three times the same image, a billboard with a cube and the text in front. -They are replicated three times, one centered in the screen without viewport, one in the upper left (qurter screen) and -one on the right (half screen). The latter is stretched due to the changed aspect ratio. -The two viewport scenes get the texture drawn over the center as well, using draw2dimage. This should mark the proper -image position with the top left corner of the texture. -Finally, each scene has a checkbox drawn at the left side, vertically centered. This will show whether GUI elements adhere -to viewports as well. */ -static bool viewPortText(E_DRIVER_TYPE driverType) -{ - IrrlichtDevice *device = createDevice( driverType, dimension2d<u32>(160, 120), 32); - if (!device) - return true; // Treat a failure to create a driver as benign; this saves a lot of #ifdefs - - IVideoDriver* driver = device->getVideoDriver(); - ISceneManager * smgr = device->getSceneManager(); - IGUIEnvironment* env = smgr->getGUIEnvironment(); - - stabilizeScreenBackground(driver); - - env->addCheckBox(true, core::recti(10,60,28,82)); - - logTestString("Testing driver %ls\n", driver->getName()); - - IBillboardSceneNode * bnode = smgr->addBillboardSceneNode(0,dimension2d<f32>(32,32),core::vector3df(0,0,10)); - bnode->setMaterialFlag(video::EMF_LIGHTING, false); - bnode->setMaterialType(video::EMT_TRANSPARENT_ADD_COLOR); - bnode->setMaterialTexture(0, driver->getTexture("../media/fire.bmp")); - - smgr->addTextSceneNode(device->getGUIEnvironment()->getBuiltInFont(), L"TEST", video::SColor(255,255,255,255), 0); - smgr->addCubeSceneNode(); - smgr->addCameraSceneNode(0, vector3df(0,30,-40), vector3df(0,5,0)); - - driver->beginScene(video::ECBF_COLOR | video::ECBF_DEPTH, SColor(255,100,101,140)); - smgr->drawAll(); - env->drawAll(); - driver->setViewPort(rect<s32>(0,0,160/2,120/2)); - smgr->drawAll(); - env->drawAll(); - driver->draw2DImage(driver->getTexture("../media/fire.bmp"), core::vector2di(160/2,120/2)); - driver->setViewPort(rect<s32>(160/2,0,160,120)); - smgr->drawAll(); - env->drawAll(); - driver->draw2DImage(driver->getTexture("../media/fire.bmp"), core::vector2di(160/2,120/2)); - driver->endScene(); - - bool result = takeScreenshotAndCompareAgainstReference(driver, "-viewPortText.png", 98.71f); - - device->closeDevice(); - device->run(); - device->drop(); - - return result; -} - - -bool viewPort(void) -{ - bool result = true; - - // TODO: software driver and burnings don't use view port for - // 2d rendering, so result is pretty wrong. - TestWithAllDrivers(viewPortText); - - return result; -} - diff --git a/tests/writeImageToFile.cpp b/tests/writeImageToFile.cpp deleted file mode 100644 index 4614befe..00000000 --- a/tests/writeImageToFile.cpp +++ /dev/null @@ -1,137 +0,0 @@ -// Copyright (C) 2009-2012 Colin MacDonald -// No rights reserved: this software is in the public domain. - -#if defined(_MSC_VER) -#define _CRT_SECURE_NO_WARNINGS 1 -#endif // _MSC_VER - -#include "testUtils.h" - -using namespace irr; -using namespace core; -using namespace scene; -using namespace video; -using namespace io; -using namespace gui; - -//! Tests IVideoDriver::writeImageToFile() using IWriteFile -bool writeImageToFile(void) -{ - IrrlichtDevice *device = createDevice( EDT_BURNINGSVIDEO, dimension2d<u32>(160, 120), 32); - if (!device) - return true; // Treat a failure to create a driver as benign; this saves a lot of #ifdefs - - IVideoDriver* driver = device->getVideoDriver(); - ISceneManager * smgr = device->getSceneManager(); - - // Draw a cube background so that we can check that the pixels' alpha is working. - ISceneNode * cube = smgr->addCubeSceneNode(50.f, 0, -1, vector3df(0, 0, 60)); - cube->setMaterialTexture(0, driver->getTexture("../media/wall.bmp")); - cube->setMaterialFlag(video::EMF_LIGHTING, false); - (void)smgr->addCameraSceneNode(); - - driver->beginScene(video::ECBF_COLOR | video::ECBF_DEPTH, SColor(255,100,101,140)); - smgr->drawAll(); - - // Test for benign handling of offscreen pixel values as well as onscreen ones. - for(s32 x = -10; x < 170; ++x) - { - s32 y = 120 * x / 160; - driver->drawPixel((u32)x, (u32)y, SColor(255, 255 * x / 640, 255 * (640 - x) / 640, 0)); - y = 120 - y; - driver->drawPixel((u32)x, (u32)y, SColor(255 * x / 640, 0, 255, 255)); - } - - driver->endScene(); - - bool result = false; - IWriteFile * writtenFile = 0; - IWriteFile * memoryFile = 0; - const char * writtenFilename = 0; - const u32 BUFFER_SIZE = 160 * 120 * 4; - c8 * buffer = 0; - const char * referenceFilename = 0; - video::ECOLOR_FORMAT format; - - irr::video::IImage * screenshot = driver->createScreenShot(video::ECF_R8G8B8); - if (!screenshot) - { - logTestString("Failed to take screenshot\n"); - assert_log(false); - goto cleanup; - } - - format = screenshot->getColorFormat(); - if (format != video::ECF_R8G8B8) - { - irr::video::IImage * fixedScreenshot = driver->createImage(video::ECF_R8G8B8, screenshot->getDimension()); - screenshot->copyTo(fixedScreenshot); - screenshot->drop(); - screenshot = 0; - - if (!fixedScreenshot) - { - logTestString("Failed to convert screenshot to ECF_A8R8G8B8\n"); - assert_log(false); - goto cleanup; - } - - screenshot = fixedScreenshot; - } - - buffer = new c8[BUFFER_SIZE]; - writtenFilename = "results/Burning's Video-writeImageToFile.png"; - memoryFile = device->getFileSystem()->createMemoryWriteFile(buffer, BUFFER_SIZE, writtenFilename, false); - if (!driver->writeImageToFile(screenshot, memoryFile)) - { - logTestString("Failed to write png to memory file\n"); - assert_log(false); - goto cleanup; - } - - writtenFile = device->getFileSystem()->createAndWriteFile(memoryFile->getFileName()); - if (!writtenFile) - { - logTestString("Can't open %s for writing.\n", writtenFilename); - assert_log(false); - goto cleanup; - } - - if ((size_t)memoryFile->getPos() != writtenFile->write(buffer, (size_t)memoryFile->getPos())) - { - logTestString("Error while writing to %s.\n", writtenFilename); - assert_log(false); - goto cleanup; - } - - writtenFile->drop(); - writtenFile = 0; - - referenceFilename = "media/Burning's Video-drawPixel.png"; - - if ( fuzzyCompareImages(driver,writtenFilename, referenceFilename) < 99.9) - { - logTestString("File written from memory is not the same as the reference file. %s:%d\n" , __FILE__, __LINE__); -// assert_log(false); - goto cleanup; - } - - result = true; - -cleanup: - if ( screenshot ) - screenshot->drop(); - - if(writtenFile) - writtenFile->drop(); - - if(memoryFile) - memoryFile->drop(); - - delete [] buffer; - - device->drop(); - - return result; -} -