Merged from 1.6 branch, revisions 2684:2747. Windows serialization fix. Memleak in STL and LWO loader fixed. CursorControl under Windows fixed. CE compilation fixed. Example 21 for Linux fixed. IFileSystem and IFileList additions. Toolbar::addButton fixed. Device::run fixed. Anti-Aliasing on debug rendering disabled. Documenation updated.
git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@2748 dfc29bdd-3216-0410-991c-e03cc46cb475master
parent
2917a98867
commit
275874afb1
25
changes.txt
25
changes.txt
|
@ -1,4 +1,8 @@
|
|||
Changes in 1.6 (??.??.2009)
|
||||
Changes in 1.6 (23.09.2009)
|
||||
|
||||
- Added IFileSystem::createEmptyFileList, exposed IFileList::sort, addItem and added getID
|
||||
|
||||
- Fix MAKE_IRR_ID so it can be used from outside the irr namespace (Micha's patch)
|
||||
|
||||
- Renamed some methods in ISkinnedMesh to match the official Irrlicht naming scheme according to createXXX()
|
||||
|
||||
|
@ -645,10 +649,27 @@ Changes in 1.6 (??.??.2009)
|
|||
- Add a hitPosition out parameter to ISceneCollisionManager::getCollisionResultPosition() - this is a (small) API breaking change.
|
||||
|
||||
-------------------------------------
|
||||
Changes in version 1.5.1 (??.?? 2009)
|
||||
Changes in version 1.5.2 (??.??.2009)
|
||||
|
||||
- Fix terrain smoothing, bug found by loverlinfish
|
||||
|
||||
- SOLARIS recognition removed. Please specify the platform define manually. This allows for compilation under sparc/Linux and sparc/Solaris
|
||||
|
||||
- Some uninitialized variables fixed
|
||||
|
||||
- FreeBSD joystick support added (for Debian package)
|
||||
|
||||
- Fix cursor problems found by buffer and by rvl2 as described in http://irrlicht.sourceforge.net/phpBB2/viewtopic.php?t=34823&highlight=
|
||||
|
||||
- OSX/XCode updates
|
||||
|
||||
- MS3D loader bug fixed
|
||||
|
||||
- Float parse bug fixed
|
||||
|
||||
-------------------------------------
|
||||
Changes in version 1.5.1 (05.08.2009)
|
||||
|
||||
- Make sure a missing font does not corrupt the skin.
|
||||
|
||||
- Fix getAngle in vector2d as suggested by xray. This has only a minor impact on s32 vectors.
|
||||
|
|
|
@ -176,7 +176,7 @@ int main()
|
|||
*/
|
||||
anms->setMaterialFlag(video::EMF_LIGHTING, false);
|
||||
|
||||
anms->setFrameLoop(0, 14);
|
||||
anms->setFrameLoop(0, 13);
|
||||
anms->setAnimationSpeed(15);
|
||||
// anms->setMD2Animation(scene::EMAT_RUN);
|
||||
|
||||
|
|
|
@ -1,227 +1,160 @@
|
|||
<?xml version="1.0" encoding="Windows-1252"?>
|
||||
<VisualStudioProject
|
||||
ProjectType="Visual C++"
|
||||
Version="8.00"
|
||||
Version="7.10"
|
||||
Name="20.ManagedLights"
|
||||
ProjectGUID="{1AB9413E-4F53-42A3-8CB2-CB4BE22336D0}"
|
||||
>
|
||||
SccProjectName=""
|
||||
SccLocalPath="">
|
||||
<Platforms>
|
||||
<Platform
|
||||
Name="Win32"
|
||||
/>
|
||||
Name="Win32"/>
|
||||
</Platforms>
|
||||
<ToolFiles>
|
||||
</ToolFiles>
|
||||
<Configurations>
|
||||
<Configuration
|
||||
Name="Debug|Win32"
|
||||
OutputDirectory=".\Debug"
|
||||
IntermediateDirectory=".\Debug"
|
||||
ConfigurationType="1"
|
||||
InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
|
||||
UseOfMFC="0"
|
||||
ATLMinimizesCRunTimeLibraryUsage="false"
|
||||
CharacterSet="2"
|
||||
>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"
|
||||
TypeLibraryName=".\Debug/ManagedLights.tlb"
|
||||
HeaderFileName=""
|
||||
/>
|
||||
ATLMinimizesCRunTimeLibraryUsage="FALSE"
|
||||
CharacterSet="2">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
AdditionalIncludeDirectories="..\..\include"
|
||||
PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
|
||||
BasicRuntimeChecks="3"
|
||||
RuntimeLibrary="1"
|
||||
UsePrecompiledHeader="0"
|
||||
RuntimeLibrary="5"
|
||||
UsePrecompiledHeader="2"
|
||||
PrecompiledHeaderFile=".\Debug/ManagedLights.pch"
|
||||
AssemblerListingLocation=".\Debug/"
|
||||
ObjectFile=".\Debug/"
|
||||
ProgramDataBaseFileName=".\Debug/"
|
||||
WarningLevel="3"
|
||||
SuppressStartupBanner="true"
|
||||
SuppressStartupBanner="TRUE"
|
||||
DebugInformationFormat="4"
|
||||
CompileAs="0"
|
||||
/>
|
||||
CompileAs="0"/>
|
||||
<Tool
|
||||
Name="VCManagedResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
PreprocessorDefinitions="_DEBUG"
|
||||
Culture="3079"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"
|
||||
/>
|
||||
Name="VCCustomBuildTool"/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
OutputFile="..\..\bin\Win32-VisualStudio\20.ManagedLights.exe"
|
||||
LinkIncremental="0"
|
||||
SuppressStartupBanner="true"
|
||||
SuppressStartupBanner="TRUE"
|
||||
AdditionalLibraryDirectories="..\..\lib\Win32-visualstudio"
|
||||
GenerateDebugInformation="true"
|
||||
GenerateDebugInformation="TRUE"
|
||||
ProgramDatabaseFile=".\Debug/ManagedLights.pdb"
|
||||
SubSystem="1"
|
||||
TargetMachine="1"
|
||||
/>
|
||||
TargetMachine="1"/>
|
||||
<Tool
|
||||
Name="VCALinkTool"
|
||||
/>
|
||||
Name="VCMIDLTool"
|
||||
TypeLibraryName=".\Debug/ManagedLights.tlb"
|
||||
HeaderFileName=""/>
|
||||
<Tool
|
||||
Name="VCManifestTool"
|
||||
/>
|
||||
Name="VCPostBuildEventTool"/>
|
||||
<Tool
|
||||
Name="VCXDCMakeTool"
|
||||
/>
|
||||
Name="VCPreBuildEventTool"/>
|
||||
<Tool
|
||||
Name="VCBscMakeTool"
|
||||
/>
|
||||
Name="VCPreLinkEventTool"/>
|
||||
<Tool
|
||||
Name="VCFxCopTool"
|
||||
/>
|
||||
Name="VCResourceCompilerTool"
|
||||
PreprocessorDefinitions="_DEBUG"
|
||||
Culture="3079"/>
|
||||
<Tool
|
||||
Name="VCAppVerifierTool"
|
||||
/>
|
||||
Name="VCWebServiceProxyGeneratorTool"/>
|
||||
<Tool
|
||||
Name="VCWebDeploymentTool"
|
||||
/>
|
||||
Name="VCXMLDataGeneratorTool"/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"
|
||||
/>
|
||||
Name="VCWebDeploymentTool"/>
|
||||
<Tool
|
||||
Name="VCManagedWrapperGeneratorTool"/>
|
||||
<Tool
|
||||
Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
|
||||
</Configuration>
|
||||
<Configuration
|
||||
Name="Release|Win32"
|
||||
OutputDirectory=".\Release"
|
||||
IntermediateDirectory=".\Release"
|
||||
ConfigurationType="1"
|
||||
InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
|
||||
UseOfMFC="0"
|
||||
ATLMinimizesCRunTimeLibraryUsage="false"
|
||||
CharacterSet="2"
|
||||
>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"
|
||||
TypeLibraryName=".\Release/ManagedLights.tlb"
|
||||
HeaderFileName=""
|
||||
/>
|
||||
ATLMinimizesCRunTimeLibraryUsage="FALSE"
|
||||
CharacterSet="2">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="2"
|
||||
InlineFunctionExpansion="1"
|
||||
AdditionalIncludeDirectories="..\..\include"
|
||||
PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
|
||||
StringPooling="true"
|
||||
RuntimeLibrary="0"
|
||||
EnableFunctionLevelLinking="true"
|
||||
UsePrecompiledHeader="0"
|
||||
StringPooling="TRUE"
|
||||
RuntimeLibrary="4"
|
||||
EnableFunctionLevelLinking="TRUE"
|
||||
UsePrecompiledHeader="2"
|
||||
PrecompiledHeaderFile=".\Release/ManagedLights.pch"
|
||||
AssemblerListingLocation=".\Release/"
|
||||
ObjectFile=".\Release/"
|
||||
ProgramDataBaseFileName=".\Release/"
|
||||
WarningLevel="3"
|
||||
SuppressStartupBanner="true"
|
||||
CompileAs="0"
|
||||
/>
|
||||
SuppressStartupBanner="TRUE"
|
||||
CompileAs="0"/>
|
||||
<Tool
|
||||
Name="VCManagedResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
PreprocessorDefinitions="NDEBUG"
|
||||
Culture="3079"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"
|
||||
/>
|
||||
Name="VCCustomBuildTool"/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
OutputFile="..\..\bin\Win32-VisualStudio\20.ManagedLights.exe"
|
||||
LinkIncremental="0"
|
||||
SuppressStartupBanner="true"
|
||||
SuppressStartupBanner="TRUE"
|
||||
AdditionalLibraryDirectories="..\..\lib\Win32-visualstudio"
|
||||
ProgramDatabaseFile=".\Release/ManagedLights.pdb"
|
||||
SubSystem="1"
|
||||
TargetMachine="1"
|
||||
/>
|
||||
TargetMachine="1"/>
|
||||
<Tool
|
||||
Name="VCALinkTool"
|
||||
/>
|
||||
Name="VCMIDLTool"
|
||||
TypeLibraryName=".\Release/ManagedLights.tlb"
|
||||
HeaderFileName=""/>
|
||||
<Tool
|
||||
Name="VCManifestTool"
|
||||
/>
|
||||
Name="VCPostBuildEventTool"/>
|
||||
<Tool
|
||||
Name="VCXDCMakeTool"
|
||||
/>
|
||||
Name="VCPreBuildEventTool"/>
|
||||
<Tool
|
||||
Name="VCBscMakeTool"
|
||||
/>
|
||||
Name="VCPreLinkEventTool"/>
|
||||
<Tool
|
||||
Name="VCFxCopTool"
|
||||
/>
|
||||
Name="VCResourceCompilerTool"
|
||||
PreprocessorDefinitions="NDEBUG"
|
||||
Culture="3079"/>
|
||||
<Tool
|
||||
Name="VCAppVerifierTool"
|
||||
/>
|
||||
Name="VCWebServiceProxyGeneratorTool"/>
|
||||
<Tool
|
||||
Name="VCWebDeploymentTool"
|
||||
/>
|
||||
Name="VCXMLDataGeneratorTool"/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"
|
||||
/>
|
||||
Name="VCWebDeploymentTool"/>
|
||||
<Tool
|
||||
Name="VCManagedWrapperGeneratorTool"/>
|
||||
<Tool
|
||||
Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
|
||||
</Configuration>
|
||||
</Configurations>
|
||||
<References>
|
||||
</References>
|
||||
<Files>
|
||||
<File
|
||||
RelativePath="main.cpp"
|
||||
>
|
||||
RelativePath="main.cpp">
|
||||
<FileConfiguration
|
||||
Name="Debug|Win32"
|
||||
>
|
||||
Name="Debug|Win32">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
AdditionalIncludeDirectories=""
|
||||
PreprocessorDefinitions=""
|
||||
BasicRuntimeChecks="3"
|
||||
/>
|
||||
BasicRuntimeChecks="3"/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Release|Win32"
|
||||
>
|
||||
Name="Release|Win32">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="2"
|
||||
AdditionalIncludeDirectories=""
|
||||
PreprocessorDefinitions=""
|
||||
/>
|
||||
PreprocessorDefinitions=""/>
|
||||
</FileConfiguration>
|
||||
</File>
|
||||
</Files>
|
||||
|
|
|
@ -126,6 +126,15 @@
|
|||
<File
|
||||
RelativePath=".\main.cpp">
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\q3factory.cpp">
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\q3factory.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\sound.cpp">
|
||||
</File>
|
||||
</Files>
|
||||
<Globals>
|
||||
</Globals>
|
||||
|
|
|
@ -92,7 +92,7 @@ void GameData::setDefault ()
|
|||
deviceParam.WindowSize.Height = 600;
|
||||
deviceParam.Fullscreen = false;
|
||||
deviceParam.Bits = 32;
|
||||
deviceParam.ZBufferBits = 32;
|
||||
deviceParam.ZBufferBits = 16;
|
||||
deviceParam.Vsync = false;
|
||||
deviceParam.AntiAlias = false;
|
||||
|
||||
|
@ -281,6 +281,8 @@ void Q3Player::create ( IrrlichtDevice *device, IQ3LevelMesh* mesh, ISceneNode *
|
|||
setTimeFire ( Anim + 0, 200, FIRED );
|
||||
setTimeFire ( Anim + 1, 5000 );
|
||||
|
||||
if (!device)
|
||||
return;
|
||||
// load FPS weapon to Camera
|
||||
Device = device;
|
||||
Mesh = mesh;
|
||||
|
@ -377,6 +379,8 @@ void Q3Player::create ( IrrlichtDevice *device, IQ3LevelMesh* mesh, ISceneNode *
|
|||
*/
|
||||
void Q3Player::respawn ()
|
||||
{
|
||||
if (!Device)
|
||||
return;
|
||||
ICameraSceneNode* camera = Device->getSceneManager()->getActiveCamera();
|
||||
|
||||
Device->getLogger()->log( "respawn" );
|
||||
|
@ -395,6 +399,8 @@ void Q3Player::respawn ()
|
|||
*/
|
||||
void Q3Player::setpos ( const vector3df &pos, const vector3df &rotation )
|
||||
{
|
||||
if (!Device)
|
||||
return;
|
||||
Device->getLogger()->log( "setpos" );
|
||||
|
||||
ICameraSceneNode* camera = Device->getSceneManager()->getActiveCamera();
|
||||
|
@ -1229,12 +1235,15 @@ void CQuake3EventHandler::AddSky( u32 dome, const c8 *texture)
|
|||
snprintf ( 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 ( buf, 64, "%s_%s.jpg", texture, p[i] );
|
||||
SkyNode->getMaterial(i).setTexture ( 0, driver->getTexture ( buf ) );
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
if ( 1 == dome )
|
||||
{
|
||||
|
@ -1264,6 +1273,7 @@ void CQuake3EventHandler::AddSky( u32 dome, const c8 *texture)
|
|||
);
|
||||
}
|
||||
|
||||
if (SkyNode)
|
||||
SkyNode->setName("Skydome");
|
||||
//SkyNode->getMaterial(0).ZBuffer = video::EMDF_DEPTH_LESS_EQUAL;
|
||||
|
||||
|
@ -1969,7 +1979,7 @@ void CQuake3EventHandler::Animate()
|
|||
|
||||
IAttributes * attr = smgr->getParameters();
|
||||
swprintf ( msg, 128,
|
||||
L"Q3 %s [%s], FPS:%03d Tri:%.03fm Cull %d/%d nodes (%d,%d,%d)",
|
||||
L"Q3 %s [%ls], FPS:%03d Tri:%.03fm Cull %d/%d nodes (%d,%d,%d)",
|
||||
Game->CurrentMapName.c_str(),
|
||||
driver->getName(),
|
||||
driver->getFPS (),
|
||||
|
|
|
@ -78,15 +78,15 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "19.MouseAndJoystick", "19.M
|
|||
ProjectSection(ProjectDependencies) = postProject
|
||||
EndProjectSection
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "20.ManagedLights", "20.ManagedLights\ManagedLights_vc7.vcproj", "{16007FE2-142B-47F8-93E1-519BA3F39E71}"
|
||||
ProjectSection(ProjectDependencies) = postProject
|
||||
EndProjectSection
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "21.Quake3Explorer", "21.Quake3Explorer\Quake3Explorer_vc7.vcproj", "{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}") = "20.ManagedLights", "20.ManagedLights\ManagedLights.vcproj", "{1AB9413E-4F53-42A3-8CB2-CB4BE22336D0}"
|
||||
ProjectSection(ProjectDependencies) = postProject
|
||||
EndProjectSection
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfiguration) = preSolution
|
||||
Debug = Debug
|
||||
|
@ -167,14 +167,14 @@ Global
|
|||
{EB3B38EA-5CE7-4983-845B-880661E69D09}.Release.Build.0 = Release|Win32
|
||||
{1AB9413E-4F53-42A3-8CB2-CB4BE22336D0}.Debug.ActiveCfg = Debug|Win32
|
||||
{1AB9413E-4F53-42A3-8CB2-CB4BE22336D0}.Release.ActiveCfg = Release|Win32
|
||||
{16007FE2-142B-47F8-93E1-519BA3F39E71}.Debug.ActiveCfg = Debug|Win32
|
||||
{16007FE2-142B-47F8-93E1-519BA3F39E71}.Debug.Build.0 = Debug|Win32
|
||||
{16007FE2-142B-47F8-93E1-519BA3F39E71}.Release.ActiveCfg = Release|Win32
|
||||
{16007FE2-142B-47F8-93E1-519BA3F39E71}.Release.Build.0 = Release|Win32
|
||||
{CDC4AAA9-72E1-4FFA-A04D-7EF59D8B97CD}.Debug.ActiveCfg = Debug|Win32
|
||||
{CDC4AAA9-72E1-4FFA-A04D-7EF59D8B97CD}.Debug.Build.0 = Debug|Win32
|
||||
{CDC4AAA9-72E1-4FFA-A04D-7EF59D8B97CD}.Release.ActiveCfg = Release|Win32
|
||||
{CDC4AAA9-72E1-4FFA-A04D-7EF59D8B97CD}.Release.Build.0 = Release|Win32
|
||||
{1AB9413E-4F53-42A3-8CB2-CB4BE22336D0}.Debug.ActiveCfg = Debug|Win32
|
||||
{1AB9413E-4F53-42A3-8CB2-CB4BE22336D0}.Debug.Build.0 = Debug|Win32
|
||||
{1AB9413E-4F53-42A3-8CB2-CB4BE22336D0}.Release.ActiveCfg = Release|Win32
|
||||
{1AB9413E-4F53-42A3-8CB2-CB4BE22336D0}.Release.Build.0 = Release|Win32
|
||||
EndGlobalSection
|
||||
GlobalSection(ExtensibilityGlobals) = postSolution
|
||||
EndGlobalSection
|
||||
|
|
|
@ -55,7 +55,7 @@ public:
|
|||
or 0 on failure. */
|
||||
virtual IReadFile* createAndOpenFile(const path& filename) =0;
|
||||
|
||||
//! Opens a file based on its position.
|
||||
//! Opens a file based on its position in the file list.
|
||||
/** Creates and returns
|
||||
\param index The zero based index of the file.
|
||||
\return Returns a pointer to the created file on success, or 0 on failure. */
|
||||
|
@ -80,7 +80,7 @@ class IArchiveLoader : public virtual IReferenceCounted
|
|||
public:
|
||||
//! Check if the file might be loaded by this class
|
||||
/** Check based on the file extension (e.g. ".zip")
|
||||
\param fileName Name of file to check.
|
||||
\param filename Name of file to check.
|
||||
\return True if file seems to be loadable. */
|
||||
virtual bool isALoadableFileFormat(const path& filename) const =0;
|
||||
|
||||
|
@ -97,12 +97,16 @@ public:
|
|||
virtual bool isALoadableFileFormat(E_FILE_ARCHIVE_TYPE fileType) const =0;
|
||||
|
||||
//! Creates an archive from the filename
|
||||
/** \param file File handle to check.
|
||||
/** \param filename File to use.
|
||||
\param ignoreCase Searching is performed without regarding the case
|
||||
\param ignorePaths Files are searched for without checking for the directories
|
||||
\return Pointer to newly created archive, or 0 upon error. */
|
||||
virtual IFileArchive* createArchive(const path& filename, bool ignoreCase, bool ignorePaths) const =0;
|
||||
|
||||
//! Creates an archive from the file
|
||||
/** \param file File handle to check.
|
||||
/** \param file File handle to use.
|
||||
\param ignoreCase Searching is performed without regarding the case
|
||||
\param ignorePaths Files are searched for without checking for the directories
|
||||
\return Pointer to newly created archive, or 0 upon error. */
|
||||
virtual IFileArchive* createArchive(io::IReadFile* file, bool ignoreCase, bool ignorePaths) const =0;
|
||||
};
|
||||
|
|
|
@ -33,7 +33,7 @@ public:
|
|||
//! Gets the full name of a file in the list including the path, based on an index.
|
||||
/** \param index is the zero based index of the file which name should
|
||||
be returned. The index must be less than the amount getFileCount() returns.
|
||||
\return File name of the file. Returns 0, if an error occured. */
|
||||
\return File name of the file. Returns 0 if an error occured. */
|
||||
virtual const io::path& getFullFileName(u32 index) const = 0;
|
||||
|
||||
//! Returns the size of a file in the file list, based on an index.
|
||||
|
@ -42,6 +42,15 @@ public:
|
|||
\return The size of the file in bytes. */
|
||||
virtual u32 getFileSize(u32 index) const = 0;
|
||||
|
||||
//! Returns the ID of a file in the file list, based on an index.
|
||||
/** This optional ID can be used to link the file list entry to information held
|
||||
elsewhere. For example this could be an index in an IFileArchive, linking the entry
|
||||
to its data offset, uncompressed size and CRC.
|
||||
\param index is the zero based index of the file which should be returned.
|
||||
The index must be less than the amount getFileCount() returns.
|
||||
\return The ID of the file. */
|
||||
virtual u32 getID(u32 index) const = 0;
|
||||
|
||||
//! Check if the file is a directory
|
||||
/** \param index The zero based index which will be checked. The index
|
||||
must be less than the amount getFileCount() returns.
|
||||
|
@ -58,6 +67,16 @@ public:
|
|||
|
||||
//! Returns the base path of the file list
|
||||
virtual const io::path& getPath() const = 0;
|
||||
|
||||
//! Add as a file or folder to the list
|
||||
/** \param fullPath The file name including path, from the root of the file list.
|
||||
\param isDirectory True if this is a directory rather than a file.
|
||||
\param size The size of the file in bytes.
|
||||
\param id The ID of the file in the archive which owns it */
|
||||
virtual u32 addItem(const io::path& fullPath, u32 size, bool isDirectory, u32 id=0) = 0;
|
||||
|
||||
//! Sorts the file list. You should call this after adding any items to the file list
|
||||
virtual void sort() = 0;
|
||||
};
|
||||
|
||||
} // end namespace irr
|
||||
|
|
|
@ -125,9 +125,10 @@ public:
|
|||
virtual bool removeFileArchive(u32 index) =0;
|
||||
|
||||
//! Removes an archive from the file system.
|
||||
/** This will close the archive and free any file handles, but will not close resources which have already
|
||||
been loaded and are now cached, for example textures and meshes.
|
||||
\param index: The index of the archive to remove
|
||||
/** This will close the archive and free any file handles, but will not
|
||||
close resources which have already been loaded and are now cached, for
|
||||
example textures and meshes.
|
||||
\param filename The archive of the given name will be removed
|
||||
\return Returns true on success, false on failure */
|
||||
virtual bool removeFileArchive(const path& filename) =0;
|
||||
|
||||
|
@ -226,6 +227,12 @@ public:
|
|||
See IReferenceCounted::drop() for more information. */
|
||||
virtual IFileList* createFileList() =0;
|
||||
|
||||
//! Creates an empty filelist
|
||||
/** \return a Pointer to the created IFileList is returned. After the list has been used
|
||||
it has to be deleted using its IFileList::drop() method.
|
||||
See IReferenceCounted::drop() for more information. */
|
||||
virtual IFileList* createEmptyFileList(const io::path& path, bool ignoreCase, bool ignorePaths) =0;
|
||||
|
||||
//! Set the active type of file system.
|
||||
virtual EFileSystemType setFileListSystem(EFileSystemType listType) =0;
|
||||
|
||||
|
|
|
@ -149,8 +149,9 @@ public:
|
|||
|
||||
|
||||
//! Creates the image list from the given texture.
|
||||
/** Loads the font if it was not loaded before.
|
||||
\param filename Filename of the Font.
|
||||
/** \param texture Texture to split into images
|
||||
\param imageSize Dimension of each image
|
||||
\param useAlphaChannel Flag whether alpha channel of the texture should be honored.
|
||||
\return Pointer to the font. Returns 0 if the font could not be loaded.
|
||||
This pointer should not be dropped. See IReferenceCounted::drop() for
|
||||
more information. */
|
||||
|
@ -314,6 +315,8 @@ public:
|
|||
\param parent Parent gui element of the list box.
|
||||
\param id Id to identify the gui element.
|
||||
\param drawBackground Flag whether the background should be drawn.
|
||||
\param scrollBarVertical Flag whether a vertical scrollbar should be used
|
||||
\param scrollBarHorizontal Flag whether a horizontal scrollbar should be used
|
||||
\return Pointer to the created list box. Returns 0 if an error occured.
|
||||
This pointer should not be dropped. See IReferenceCounted::drop() for
|
||||
more information. */
|
||||
|
@ -396,6 +399,7 @@ public:
|
|||
/** An edit box with up and down buttons
|
||||
\param text Text to be displayed. Can be altered after creation by setText().
|
||||
\param rectangle Rectangle specifying the borders of the spin box.
|
||||
\param border Set to true if the spin box should have a 3d border.
|
||||
\param parent Parent item of the element, e.g. a window.
|
||||
Set it to 0 to place the spin box directly in the environment.
|
||||
\param id The ID of the element.
|
||||
|
|
|
@ -92,7 +92,7 @@ public:
|
|||
//! Define which characters should not be drawn by the font.
|
||||
/** For example " " would not draw any space which is usually blank in
|
||||
most fonts.
|
||||
\param invisible: string of symbols, which are not send down to the videodriver
|
||||
\param s String of symbols which are not send down to the videodriver
|
||||
*/
|
||||
virtual void setInvisibleCharacters( const wchar_t *s ) = 0;
|
||||
};
|
||||
|
|
|
@ -192,7 +192,7 @@ namespace gui
|
|||
"MessageBoxMaxTextWidth",
|
||||
"MessageBoxMinTextHeight",
|
||||
"MessageBoxMaxTextHeight",
|
||||
0,
|
||||
0
|
||||
};
|
||||
|
||||
|
||||
|
@ -230,7 +230,7 @@ namespace gui
|
|||
"WindowButtonMaximize",
|
||||
"WindowButtonMinimize",
|
||||
"WindowButtonRestore",
|
||||
0,
|
||||
0
|
||||
};
|
||||
|
||||
//! Customizable symbols for GUI
|
||||
|
|
|
@ -30,7 +30,7 @@ namespace gui
|
|||
virtual IGUITreeView* getOwner() const = 0;
|
||||
|
||||
//! Returns the parent node of this node.
|
||||
//! For the root node this will return 0.
|
||||
/** For the root node this will return 0. */
|
||||
virtual IGUITreeViewNode* getParent() const = 0;
|
||||
|
||||
//! returns the text of the node
|
||||
|
@ -79,14 +79,14 @@ namespace gui
|
|||
virtual bool hasChilds() const = 0;
|
||||
|
||||
//! Adds a new node behind the last child node.
|
||||
//! \param text text of the new node
|
||||
//! \param icon icon text of the new node
|
||||
//! \param imageIndex index of the image for the new node (-1 = none)
|
||||
//! \param selectedImageIndex index of the selected image for the new node (-1 = same as imageIndex)
|
||||
//! \param data user data (void*) of the new node
|
||||
//! \param data2 user data2 (IReferenceCounted*) of the new node
|
||||
//! \return
|
||||
//! returns the new node
|
||||
/** \param text text of the new node
|
||||
\param icon icon text of the new node
|
||||
\param imageIndex index of the image for the new node (-1 = none)
|
||||
\param selectedImageIndex index of the selected image for the new node (-1 = same as imageIndex)
|
||||
\param data user data (void*) of the new node
|
||||
\param data2 user data2 (IReferenceCounted*) of the new node
|
||||
\return The new node
|
||||
*/
|
||||
virtual IGUITreeViewNode* addChildBack(
|
||||
const wchar_t* text,
|
||||
const wchar_t* icon = 0,
|
||||
|
@ -96,14 +96,14 @@ namespace gui
|
|||
IReferenceCounted* data2 = 0 ) = 0;
|
||||
|
||||
//! Adds a new node before the first child node.
|
||||
//! \param text text of the new node
|
||||
//! \param icon icon text of the new node
|
||||
//! \param imageIndex index of the image for the new node (-1 = none)
|
||||
//! \param selectedImageIndex index of the selected image for the new node (-1 = same as imageIndex)
|
||||
//! \param data user data (void*) of the new node
|
||||
//! \param data2 user data2 (IReferenceCounted*) of the new node
|
||||
//! \return
|
||||
//! returns the new node
|
||||
/** \param text text of the new node
|
||||
\param icon icon text of the new node
|
||||
\param imageIndex index of the image for the new node (-1 = none)
|
||||
\param selectedImageIndex index of the selected image for the new node (-1 = same as imageIndex)
|
||||
\param data user data (void*) of the new node
|
||||
\param data2 user data2 (IReferenceCounted*) of the new node
|
||||
\return The new node
|
||||
*/
|
||||
virtual IGUITreeViewNode* addChildFront(
|
||||
const wchar_t* text,
|
||||
const wchar_t* icon = 0,
|
||||
|
@ -113,15 +113,16 @@ namespace gui
|
|||
IReferenceCounted* data2 = 0 ) = 0;
|
||||
|
||||
//! Adds a new node behind the other node.
|
||||
//! The other node has also te be a child node from this node.
|
||||
//! \param text text of the new node
|
||||
//! \param icon icon text of the new node
|
||||
//! \param imageIndex index of the image for the new node (-1 = none)
|
||||
//! \param selectedImageIndex index of the selected image for the new node (-1 = same as imageIndex)
|
||||
//! \param data user data (void*) of the new node
|
||||
//! \param data2 user data2 (IReferenceCounted*) of the new node
|
||||
//! \return
|
||||
//! returns the new node or 0 if other is no child node from this
|
||||
/** The other node has also te be a child node from this node.
|
||||
\param other Node to insert after
|
||||
\param text text of the new node
|
||||
\param icon icon text of the new node
|
||||
\param imageIndex index of the image for the new node (-1 = none)
|
||||
\param selectedImageIndex index of the selected image for the new node (-1 = same as imageIndex)
|
||||
\param data user data (void*) of the new node
|
||||
\param data2 user data2 (IReferenceCounted*) of the new node
|
||||
\return The new node or 0 if other is no child node from this
|
||||
*/
|
||||
virtual IGUITreeViewNode* insertChildAfter(
|
||||
IGUITreeViewNode* other,
|
||||
const wchar_t* text,
|
||||
|
@ -132,15 +133,16 @@ namespace gui
|
|||
IReferenceCounted* data2 = 0 ) = 0;
|
||||
|
||||
//! Adds a new node before the other node.
|
||||
//! The other node has also te be a child node from this node.
|
||||
//! \param text text of the new node
|
||||
//! \param icon icon text of the new node
|
||||
//! \param imageIndex index of the image for the new node (-1 = none)
|
||||
//! \param selectedImageIndex index of the selected image for the new node (-1 = same as imageIndex)
|
||||
//! \param data user data (void*) of the new node
|
||||
//! \param data2 user data2 (IReferenceCounted*) of the new node
|
||||
//! \return
|
||||
//! returns the new node or 0 if other is no child node from this
|
||||
/** The other node has also te be a child node from this node.
|
||||
\param other Node to insert before
|
||||
\param text text of the new node
|
||||
\param icon icon text of the new node
|
||||
\param imageIndex index of the image for the new node (-1 = none)
|
||||
\param selectedImageIndex index of the selected image for the new node (-1 = same as imageIndex)
|
||||
\param data user data (void*) of the new node
|
||||
\param data2 user data2 (IReferenceCounted*) of the new node
|
||||
\return The new node or 0 if other is no child node from this
|
||||
*/
|
||||
virtual IGUITreeViewNode* insertChildBefore(
|
||||
IGUITreeViewNode* other,
|
||||
const wchar_t* text,
|
||||
|
@ -151,46 +153,40 @@ namespace gui
|
|||
IReferenceCounted* data2 = 0 ) = 0;
|
||||
|
||||
//! Return the first child node from this node.
|
||||
//! \return
|
||||
//! Returns the first child node or 0 if this node has no childs.
|
||||
/** \return The first child node or 0 if this node has no childs. */
|
||||
virtual IGUITreeViewNode* getFirstChild() const = 0;
|
||||
|
||||
//! Return the last child node from this node.
|
||||
//! \return
|
||||
//! Returns the last child node or 0 if this node has no childs.
|
||||
/** \return The last child node or 0 if this node has no childs. */
|
||||
virtual IGUITreeViewNode* getLastChild() const = 0;
|
||||
|
||||
//! Returns the preverse sibling node from this node.
|
||||
//! \return
|
||||
//! Returns the preverse sibling node from this node or 0 if this is
|
||||
//! the first node from the parent node.
|
||||
//! Returns the previous sibling node from this node.
|
||||
/** \return The previous sibling node from this node or 0 if this is
|
||||
the first node from the parent node.
|
||||
*/
|
||||
virtual IGUITreeViewNode* getPrevSibling() const = 0;
|
||||
|
||||
//! Returns the next sibling node from this node.
|
||||
//! \return
|
||||
//! Returns the next sibling node from this node or 0 if this is
|
||||
//! the last node from the parent node.
|
||||
/** \return The next sibling node from this node or 0 if this is
|
||||
the last node from the parent node.
|
||||
*/
|
||||
virtual IGUITreeViewNode* getNextSibling() const = 0;
|
||||
|
||||
//! Returns the next visible (expanded, may be out of scrolling) node from this node.
|
||||
//! \return
|
||||
//! Returns the next visible node from this node or 0 if this is
|
||||
//! the last visible node.
|
||||
/** \return The next visible node from this node or 0 if this is
|
||||
the last visible node. */
|
||||
virtual IGUITreeViewNode* getNextVisible() const = 0;
|
||||
|
||||
//! Deletes a child node.
|
||||
// \return
|
||||
//! Returns true if the node was found as a child and is deleted.
|
||||
/** \return Returns true if the node was found as a child and is deleted. */
|
||||
virtual bool deleteChild( IGUITreeViewNode* child ) = 0;
|
||||
|
||||
//! Moves a child node one position up.
|
||||
//! \return
|
||||
//! Returns true if the node was found as achild node and was not already the first child.
|
||||
/** \return True if the node was found as achild node and was not already the first child. */
|
||||
virtual bool moveChildUp( IGUITreeViewNode* child ) = 0;
|
||||
|
||||
//! Moves a child node one position down.
|
||||
//! \return
|
||||
//! Returns true if the node was found as achild node and was not already the last child.
|
||||
/** \return True if the node was found as achild node and was not already the last child. */
|
||||
virtual bool moveChildDown( IGUITreeViewNode* child ) = 0;
|
||||
|
||||
//! Returns true if the node is expanded (childs are visible).
|
||||
|
@ -209,7 +205,7 @@ namespace gui
|
|||
virtual bool isRoot() const = 0;
|
||||
|
||||
//! Returns the level of this node.
|
||||
//! The root node has level 0. Direct childs of the root has level 1 ...
|
||||
/** The root node has level 0. Direct childs of the root has level 1 ... */
|
||||
virtual s32 getLevel() const = 0;
|
||||
|
||||
//! Returns true if this node is visible (all parents are expanded).
|
||||
|
@ -218,9 +214,10 @@ namespace gui
|
|||
|
||||
|
||||
//! Default tree view GUI element.
|
||||
//! Displays a windows like tree buttons to expand/collaps the child nodes of an node
|
||||
//! and optional tree lines.
|
||||
//! Each node consits of an text, an icon text and a void pointer for user data.
|
||||
/** Displays a windows like tree buttons to expand/collaps the child nodes of an node
|
||||
and optional tree lines.
|
||||
Each node consits of an text, an icon text and a void pointer for user data.
|
||||
*/
|
||||
class IGUITreeView : public IGUIElement
|
||||
{
|
||||
public:
|
||||
|
@ -242,17 +239,20 @@ namespace gui
|
|||
virtual bool getLinesVisible() const = 0;
|
||||
|
||||
//! sets if the tree lines are visible
|
||||
//! \param visible true for visible, false for invisible
|
||||
/** \param visible true for visible, false for invisible */
|
||||
virtual void setLinesVisible( bool visible ) = 0;
|
||||
|
||||
//! Sets the font which should be used as icon font. This font is set to the Irrlicht engine
|
||||
//! built-in-font by default. Icons can be displayed in front of every list item.
|
||||
//! An icon is a string, displayed with the icon font. When using the build-in-font of the
|
||||
//! Irrlicht engine as icon font, the icon strings defined in GUIIcons.h can be used.
|
||||
//! Sets the font which should be used as icon font.
|
||||
/** This font is set to the Irrlicht engine built-in-font by
|
||||
default. Icons can be displayed in front of every list item.
|
||||
An icon is a string, displayed with the icon font. When using
|
||||
the build-in-font of the Irrlicht engine as icon font, the icon
|
||||
strings defined in GUIIcons.h can be used.
|
||||
*/
|
||||
virtual void setIconFont( IGUIFont* font ) = 0;
|
||||
|
||||
//! Sets the image list which should be used for the image and selected image of every node.
|
||||
//! The default is 0 (no images).
|
||||
/** The default is 0 (no images). */
|
||||
virtual void setImageList( IGUIImageList* imageList ) = 0;
|
||||
|
||||
//! Returns the image list which is used for the nodes.
|
||||
|
@ -265,7 +265,7 @@ namespace gui
|
|||
virtual bool getImageLeftOfIcon() const = 0;
|
||||
|
||||
//! Returns the node which is associated to the last event.
|
||||
//! This pointer is only valid inside the OnEvent call!
|
||||
/** This pointer is only valid inside the OnEvent call! */
|
||||
virtual IGUITreeViewNode* getLastEventNode() const = 0;
|
||||
};
|
||||
|
||||
|
|
|
@ -29,7 +29,7 @@ public:
|
|||
|
||||
//! Check if the file might be loaded by this class
|
||||
/** Check is based on the file extension (e.g. ".tga")
|
||||
\param fileName Name of file to check.
|
||||
\param filename Name of file to check.
|
||||
\return True if file seems to be loadable. */
|
||||
virtual bool isALoadableFileExtension(const io::path& filename) const = 0;
|
||||
|
||||
|
|
|
@ -26,7 +26,7 @@ class IImageWriter : public IReferenceCounted
|
|||
{
|
||||
public:
|
||||
//! Check if this writer can write a file with the given extension
|
||||
/** \param fileName Name of the file to check.
|
||||
/** \param filename Name of the file to check.
|
||||
\return True if file extension specifies a writable type. */
|
||||
virtual bool isAWriteableFileExtension(const io::path& filename) const = 0;
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
// Written by Colin MacDonald - all rights assigned to Nikolaus Gebhardt
|
||||
// Copyright (C) 2008 Nikolaus Gebhardt
|
||||
// Copyright (C) 2008-2009 Nikolaus Gebhardt
|
||||
// This file is part of the "Irrlicht Engine".
|
||||
// For conditions of distribution and use, see copyright notice in irrlicht.h
|
||||
|
||||
|
@ -15,43 +15,45 @@ 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.
|
||||
//! 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[in] smgr: the Scene Manager
|
||||
//! \param[inout] lightLight: the Scene Manager's light list, which the light manager may
|
||||
//! modify. This reference will remain valid until OnPostRender().
|
||||
/** 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<ILightSceneNode*> & lightList) = 0;
|
||||
|
||||
//! Called after the last scene node is rendered.
|
||||
//! After this call returns, the lightList passed to OnPreRender() becomes invalid.
|
||||
/** After this call returns, the lightList passed to OnPreRender() becomes invalid. */
|
||||
virtual void OnPostRender(void) = 0;
|
||||
|
||||
//! Called before a render pass begins
|
||||
//! \param[in] renderPass: the render pass that's about to begin
|
||||
/** \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
|
||||
/** \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
|
||||
/** \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
|
||||
/** \param[in] node: the scene node that has just been rendered */
|
||||
virtual void OnNodePostRender(ISceneNode* node) = 0;
|
||||
};
|
||||
} // end namespace scene
|
||||
|
|
|
@ -33,7 +33,7 @@ public:
|
|||
//! Returns true if the file might be loaded by this class.
|
||||
/** This decision should be based on the file extension (e.g. ".cob")
|
||||
only.
|
||||
\param fileName Name of the file to test.
|
||||
\param filename Name of the file to test.
|
||||
\return True if the file might be loaded by this class. */
|
||||
virtual bool isALoadableFileExtension(const io::path& filename) const = 0;
|
||||
|
||||
|
|
|
@ -128,7 +128,7 @@ namespace scene
|
|||
|
||||
//! Creates a planar texture mapping on the meshbuffer
|
||||
/** This method is currently implemented towards the LWO planar mapping. A more general biasing might be required.
|
||||
\param meshbuffer Buffer on which the operation is performed.
|
||||
\param buffer Buffer on which the operation is performed.
|
||||
\param resolutionS Resolution of the planar mapping in horizontal direction. This is the ratio between object space and texture space.
|
||||
\param resolutionT Resolution of the planar mapping in vertical direction. This is the ratio between object space and texture space.
|
||||
\param axis The axis along which the texture is projected. The allowed values are 0 (X), 1(Y), and 2(Z).
|
||||
|
|
|
@ -58,6 +58,7 @@ namespace scene
|
|||
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 ellipoid collided (if any)
|
||||
|
|
|
@ -398,13 +398,12 @@ namespace scene
|
|||
const core::vector3df& rotation = core::vector3df(0,0,0),
|
||||
const core::vector3df& scale = core::vector3df(1.0f, 1.0f, 1.0f)) = 0;
|
||||
|
||||
//! Adds a test scene node for test purposes to the scene.
|
||||
/** It is a simple cube of (1,1,1) size.
|
||||
\param size: Size of the cube.
|
||||
\param parent: Parent of the scene node. Can be NULL if no parent.
|
||||
//! 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 position: Position of the space relative to its parent
|
||||
where the scene node will be placed.
|
||||
\param rotation: Initital rotation of the scene node.
|
||||
\param scale: Initial scale of the scene node.
|
||||
\return Pointer to the created test scene node. This
|
||||
|
@ -415,14 +414,14 @@ namespace scene
|
|||
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 for test purposes to the scene.
|
||||
/** It is a simple sphere.
|
||||
\param radius: Radius of the sphere.
|
||||
\param polyCount: Polycount of the sphere.
|
||||
\param parent: Parent of the scene node. Can be NULL if no parent.
|
||||
//! Adds a sphere scene node of the given radius and detail
|
||||
/** \param radius: Radius of the sphere.
|
||||
\param polyCount: Polycount of the sphere, i.e. subdivision in
|
||||
horizontal and vertical direction.
|
||||
\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 position: Position of the space relative to its parent
|
||||
where the scene node will be placed.
|
||||
\param rotation: Initital rotation of the scene node.
|
||||
\param scale: Initial scale of the scene node.
|
||||
\return Pointer to the created test scene node. This
|
||||
|
@ -701,6 +700,7 @@ namespace scene
|
|||
\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.
|
||||
|
@ -1107,6 +1107,8 @@ namespace scene
|
|||
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().
|
||||
|
@ -1208,10 +1210,11 @@ namespace scene
|
|||
virtual ITriangleSelector* createTriangleSelector(IMesh* mesh, 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.
|
||||
//! 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
|
||||
/** 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 node The animated mesh scene node from which to build the selector
|
||||
*/
|
||||
virtual ITriangleSelector* createTriangleSelector(IAnimatedMeshSceneNode* node) = 0;
|
||||
|
||||
|
||||
|
|
|
@ -412,7 +412,7 @@ namespace video
|
|||
\param colorKeyPixelPos Position of a pixel with the color key
|
||||
color. Every texel with this color will become fully transparent as
|
||||
described above.
|
||||
\param \deprecated zeroTexels If set to true, then any texels that match
|
||||
\deprecated \param zeroTexels If set to true, then any texels that match
|
||||
the color key will have their color, as well as their alpha, set to zero
|
||||
(i.e. black). This behaviour matches the legacy (buggy) behaviour prior
|
||||
to release 1.5 and is provided for backwards compatibility only.*/
|
||||
|
@ -631,13 +631,13 @@ namespace video
|
|||
|
||||
//! Draws a 3d line.
|
||||
/** For some implementations, this method simply calls
|
||||
drawIndexedTriangles for some triangles.
|
||||
drawVertexPrimitiveList for some triangles.
|
||||
Note that the line is drawn using the current transformation
|
||||
matrix and material. So if you need to draw the 3D line
|
||||
independently of the current transformation, use
|
||||
\code
|
||||
driver->setMaterial(unlitMaterial);
|
||||
driver->setTransform(video::ETS_WORLD, core::matrix4());
|
||||
driver->setMaterial(someMaterial);
|
||||
driver->setTransform(video::ETS_WORLD, core::IdentityMatrix);
|
||||
\endcode
|
||||
for some properly set up material before drawing the line.
|
||||
Some drivers support line thickness set in the material.
|
||||
|
@ -648,15 +648,15 @@ namespace video
|
|||
const core::vector3df& end, SColor color = SColor(255,255,255,255)) =0;
|
||||
|
||||
//! Draws a 3d triangle.
|
||||
/** This method calls drawIndexedTriangles for some triangles.
|
||||
/** This method calls drawVertexPrimitiveList for some triangles.
|
||||
This method works with all drivers because it simply calls
|
||||
drawIndexedTriangleList but it is hence not very fast.
|
||||
drawVertexPrimitiveList, but it is hence not very fast.
|
||||
Note that the triangle is drawn using the current
|
||||
transformation matrix and material. So if you need to draw it
|
||||
independently of the current transformation, use
|
||||
\code
|
||||
driver->setMaterial(unlitMaterial);
|
||||
driver->setTransform(video::ETS_WORLD, core::matrix4());
|
||||
driver->setMaterial(someMaterial);
|
||||
driver->setTransform(video::ETS_WORLD, core::IdentityMatrix);
|
||||
\endcode
|
||||
for some properly set up material before drawing the triangle.
|
||||
\param triangle The triangle to draw.
|
||||
|
@ -670,8 +670,8 @@ namespace video
|
|||
matrix and material. So if you need to draw it independently of
|
||||
the current transformation, use
|
||||
\code
|
||||
driver->setMaterial(unlitMaterial);
|
||||
driver->setTransform(video::ETS_WORLD, core::matrix4());
|
||||
driver->setMaterial(someMaterial);
|
||||
driver->setTransform(video::ETS_WORLD, core::IdentityMatrix);
|
||||
\endcode
|
||||
for some properly set up material before drawing the box.
|
||||
\param box The axis aligned box to draw
|
||||
|
@ -894,8 +894,7 @@ namespace video
|
|||
/** These are global values attached to each 3d object rendered,
|
||||
which has the fog flag enabled in its material.
|
||||
\param color Color of the fog
|
||||
\param linearFog Set this to true for linear fog, otherwise
|
||||
exponential fog is applied.
|
||||
\param fogType Type of fog used
|
||||
\param start Only used in linear fog mode (linearFog=true).
|
||||
Specifies where fog starts.
|
||||
\param end Only used in linear fog mode (linearFog=true).
|
||||
|
@ -995,7 +994,7 @@ namespace video
|
|||
|
||||
//! Returns the maximum amount of primitives
|
||||
/** (mostly vertices) which the device is able to render with
|
||||
one drawIndexedTriangleList call.
|
||||
one drawVertexPrimitiveList call.
|
||||
\return Maximum amount of primitives. */
|
||||
virtual u32 getMaximalPrimitiveCount() const =0;
|
||||
|
||||
|
|
|
@ -11,8 +11,8 @@
|
|||
#define IRRLICHT_VERSION_REVISION 0
|
||||
// This flag will be defined only in SVN, the official release code will have
|
||||
// it undefined
|
||||
#define IRRLICHT_VERSION_SVN
|
||||
#define IRRLICHT_SDK_VERSION "1.6-SVN"
|
||||
//#define IRRLICHT_VERSION_SVN
|
||||
#define IRRLICHT_SDK_VERSION "1.6"
|
||||
|
||||
#include <stdio.h> // TODO: Although included elsewhere this is required at least for mingw
|
||||
|
||||
|
@ -85,10 +85,7 @@
|
|||
#endif
|
||||
|
||||
#if !defined(_IRR_WINDOWS_API_) && !defined(_IRR_OSX_PLATFORM_)
|
||||
#if defined(__sparc__) || defined(__sun__)
|
||||
#define __BIG_ENDIAN__
|
||||
#define _IRR_SOLARIS_PLATFORM_
|
||||
#else
|
||||
#ifndef _IRR_SOLARIS_PLATFORM_
|
||||
#define _IRR_LINUX_PLATFORM_
|
||||
#endif
|
||||
#define _IRR_POSIX_API_
|
||||
|
@ -119,7 +116,7 @@ headers, e.g. Summer 2004. This is a Microsoft issue, not an Irrlicht one.
|
|||
#if defined(_IRR_WINDOWS_API_) && (!defined(__GNUC__) || defined(IRR_COMPILE_WITH_DX9_DEV_PACK))
|
||||
|
||||
//! Only define _IRR_COMPILE_WITH_DIRECT3D_8_ if you have an appropriate DXSDK, e.g. Summer 2004
|
||||
//#define _IRR_COMPILE_WITH_DIRECT3D_8_
|
||||
#define _IRR_COMPILE_WITH_DIRECT3D_8_
|
||||
#define _IRR_COMPILE_WITH_DIRECT3D_9_
|
||||
|
||||
#endif
|
||||
|
@ -475,6 +472,10 @@ precision will be lower but speed higher. currently X86 only
|
|||
#undef _IRR_WCHAR_FILESYSTEM
|
||||
#endif
|
||||
|
||||
#if defined(__sparc__) || defined(__sun__)
|
||||
#define __BIG_ENDIAN__
|
||||
#endif
|
||||
|
||||
#if defined(_IRR_SOLARIS_PLATFORM_)
|
||||
#undef _IRR_COMPILE_WITH_JOYSTICK_EVENTS_
|
||||
#endif
|
||||
|
|
|
@ -85,7 +85,7 @@ namespace scene
|
|||
const core::matrix4& getTransform( video::E_TRANSFORMATION_STATE state) const;
|
||||
|
||||
//! clips a line to the view frustum.
|
||||
//! \Return: Returns true if the line was clipped, false if not
|
||||
/** \return True if the line was clipped, false if not */
|
||||
bool clipLine(core::line3d<f32>& line) const;
|
||||
|
||||
//! the position of the camera
|
||||
|
|
|
@ -96,7 +96,7 @@ public:
|
|||
//! set a new allocation strategy
|
||||
/** if the maximum size of the array is unknown, you can define how big the
|
||||
allocation should happen.
|
||||
\param element: newStratgey to applay to this array. */
|
||||
\param newStrategy New strategy to apply to this array. */
|
||||
void setAllocStrategy ( eAllocStrategy newStrategy = ALLOC_STRATEGY_DOUBLE )
|
||||
{
|
||||
strategy = newStrategy;
|
||||
|
|
|
@ -450,7 +450,6 @@ namespace core
|
|||
// calculate: 1 / x
|
||||
REALINLINE f32 reciprocal( const f32 f )
|
||||
{
|
||||
_IRR_DEBUG_BREAK_IF(f==0.f); //divide by zero
|
||||
#if defined (IRRLICHT_FAST_MATH)
|
||||
|
||||
// SSE Newton-Raphson reciprocal estimate, accurate to 23 significant
|
||||
|
@ -484,7 +483,6 @@ namespace core
|
|||
// calculate: 1 / x
|
||||
REALINLINE f64 reciprocal ( const f64 f )
|
||||
{
|
||||
_IRR_DEBUG_BREAK_IF(f==0.); //divide by zero
|
||||
return 1.0 / f;
|
||||
}
|
||||
|
||||
|
@ -492,7 +490,6 @@ namespace core
|
|||
// calculate: 1 / x, low precision allowed
|
||||
REALINLINE f32 reciprocal_approxim ( const f32 f )
|
||||
{
|
||||
_IRR_DEBUG_BREAK_IF(f==0.f); //divide by zero
|
||||
#if defined( IRRLICHT_FAST_MATH)
|
||||
|
||||
// SSE Newton-Raphson reciprocal estimate, accurate to 23 significant
|
||||
|
|
|
@ -211,8 +211,8 @@ Compiler version defines: VC6.0 : 1200, VC7.0 : 1300, VC7.1 : 1310, VC8.0 : 1400
|
|||
/** some compilers can create those by directly writing the
|
||||
code like 'code', but some generate warnings so we use this macro here */
|
||||
#define MAKE_IRR_ID(c0, c1, c2, c3) \
|
||||
((u32)(u8)(c0) | ((u32)(u8)(c1) << 8) | \
|
||||
((u32)(u8)(c2) << 16) | ((u32)(u8)(c3) << 24 ))
|
||||
((irr::u32)(irr::u8)(c0) | ((irr::u32)(irr::u8)(c1) << 8) | \
|
||||
((irr::u32)(irr::u8)(c2) << 16) | ((irr::u32)(irr::u8)(c3) << 24 ))
|
||||
|
||||
#endif // __IRR_TYPES_H_INCLUDED__
|
||||
|
||||
|
|
|
@ -184,7 +184,7 @@
|
|||
#include "vector2d.h"
|
||||
#include "vector3d.h"
|
||||
|
||||
/*! \mainpage Irrlicht Engine 1.5 API documentation
|
||||
/*! \mainpage Irrlicht Engine 1.6 API documentation
|
||||
*
|
||||
* <div align="center"><img src="logobig.png" ></div>
|
||||
*
|
||||
|
|
|
@ -310,9 +310,9 @@ namespace core
|
|||
*/
|
||||
CMatrix4<T>& buildRotateFromTo(const core::vector3df& from, const core::vector3df& to);
|
||||
|
||||
//! Builds a combined matrix which translate to a center before rotation and translate afterwards
|
||||
/** \param from: vector to rotate from
|
||||
\param to: vector to rotate to
|
||||
//! Builds a combined matrix which translates to a center before rotation and translates from origin afterwards
|
||||
/** \param center Position to rotate around
|
||||
\param translate Translation applied after the rotation
|
||||
*/
|
||||
void setRotationCenter(const core::vector3df& center, const core::vector3df& translate);
|
||||
|
||||
|
@ -1922,9 +1922,6 @@ namespace core
|
|||
|
||||
|
||||
//! Builds a combined matrix which translate to a center before rotation and translate afterwards
|
||||
/** \param from: vector to rotate from
|
||||
\param to: vector to rotate to
|
||||
*/
|
||||
template <class T>
|
||||
inline void CMatrix4<T>::setRotationCenter(const core::vector3df& center, const core::vector3df& translation)
|
||||
{
|
||||
|
|
|
@ -14,6 +14,7 @@ namespace irr
|
|||
{
|
||||
namespace core
|
||||
{
|
||||
|
||||
// Use typedefs where possible as they are more explicit...
|
||||
|
||||
//! \deprecated position2d is now a synonym for vector2d, but vector2d should be used directly.
|
||||
|
@ -28,3 +29,4 @@ typedef vector2d<s32> position2di;
|
|||
#define position2d vector2d
|
||||
|
||||
#endif // __IRR_POSITION_H_INCLUDED__
|
||||
|
||||
|
|
|
@ -83,7 +83,7 @@ class quaternion
|
|||
matrix4 getMatrix() const;
|
||||
|
||||
//! Creates a matrix from this quaternion
|
||||
void getMatrix( matrix4 &dest, const vector3df &translation ) const;
|
||||
void getMatrix( matrix4 &dest, const core::vector3df &translation ) const;
|
||||
|
||||
/*!
|
||||
Creates a matrix from this quaternion
|
||||
|
@ -102,7 +102,7 @@ class quaternion
|
|||
lookat *= m3;
|
||||
|
||||
*/
|
||||
void getMatrixCenter( matrix4 &dest, const vector3df ¢er, const vector3df &translation ) const;
|
||||
void getMatrixCenter( matrix4 &dest, const core::vector3df ¢er, const core::vector3df &translation ) const;
|
||||
|
||||
//! Creates a matrix from this quaternion
|
||||
inline void getMatrix_transposed( matrix4 &dest ) const;
|
||||
|
@ -341,8 +341,7 @@ inline void quaternion::getMatrix( matrix4 &dest, const core::vector3df ¢er
|
|||
*/
|
||||
inline void quaternion::getMatrixCenter(matrix4 &dest,
|
||||
const core::vector3df ¢er,
|
||||
const core::vector3df &translation
|
||||
) const
|
||||
const core::vector3df &translation) const
|
||||
{
|
||||
f32 * m = dest.pointer();
|
||||
|
||||
|
|
|
@ -126,7 +126,6 @@ namespace scene
|
|||
virtual void calculateBoundingBox();
|
||||
|
||||
u32 FrameCount;
|
||||
s32 TriangleCount;
|
||||
|
||||
private:
|
||||
|
||||
|
|
|
@ -349,6 +349,7 @@ void CAnimatedMeshSceneNode::render()
|
|||
{
|
||||
video::SMaterial debug_mat;
|
||||
debug_mat.Lighting = false;
|
||||
debug_mat.AntiAliasing=0;
|
||||
driver->setMaterial(debug_mat);
|
||||
// show normals
|
||||
if (DebugDataVisible & scene::EDS_NORMALS)
|
||||
|
|
|
@ -401,10 +401,10 @@ public:
|
|||
if (material.MaterialType == EMT_LIGHTMAP_ADD)
|
||||
pID3DDevice->SetTextureStageState(1, D3DTSS_COLOROP, D3DTOP_ADD);
|
||||
else
|
||||
if (material.MaterialType == EMT_LIGHTMAP_M4)
|
||||
if (material.MaterialType == EMT_LIGHTMAP_M4 || material.MaterialType == EMT_LIGHTMAP_LIGHTING_M4)
|
||||
pID3DDevice->SetTextureStageState(1, D3DTSS_COLOROP, D3DTOP_MODULATE4X);
|
||||
else
|
||||
if (material.MaterialType == EMT_LIGHTMAP_M2)
|
||||
if (material.MaterialType == EMT_LIGHTMAP_M2 || material.MaterialType == EMT_LIGHTMAP_LIGHTING_M2)
|
||||
pID3DDevice->SetTextureStageState(1, D3DTSS_COLOROP, D3DTOP_MODULATE2X);
|
||||
else
|
||||
pID3DDevice->SetTextureStageState(1, D3DTSS_COLOROP, D3DTOP_MODULATE);
|
||||
|
|
|
@ -431,10 +431,10 @@ public:
|
|||
if (material.MaterialType == EMT_LIGHTMAP_ADD)
|
||||
pID3DDevice->SetTextureStageState(1, D3DTSS_COLOROP, D3DTOP_ADD);
|
||||
else
|
||||
if (material.MaterialType == EMT_LIGHTMAP_M4)
|
||||
if (material.MaterialType == EMT_LIGHTMAP_M4 || material.MaterialType == EMT_LIGHTMAP_LIGHTING_M4)
|
||||
pID3DDevice->SetTextureStageState(1, D3DTSS_COLOROP, D3DTOP_MODULATE4X);
|
||||
else
|
||||
if (material.MaterialType == EMT_LIGHTMAP_M2)
|
||||
if (material.MaterialType == EMT_LIGHTMAP_M2 || material.MaterialType == EMT_LIGHTMAP_LIGHTING_M2)
|
||||
pID3DDevice->SetTextureStageState(1, D3DTSS_COLOROP, D3DTOP_MODULATE2X);
|
||||
else
|
||||
pID3DDevice->SetTextureStageState(1, D3DTSS_COLOROP, D3DTOP_MODULATE);
|
||||
|
|
|
@ -94,6 +94,12 @@ u32 CFileList::addItem(const io::path& fullPath, u32 size, bool isDirectory, u32
|
|||
return Files.size() - 1;
|
||||
}
|
||||
|
||||
//! Returns the ID of a file in the file list, based on an index.
|
||||
u32 CFileList::getID(u32 index) const
|
||||
{
|
||||
return index < Files.size() ? Files[index].ID : 0;
|
||||
}
|
||||
|
||||
bool CFileList::isDirectory(u32 index) const
|
||||
{
|
||||
bool ret = false;
|
||||
|
@ -107,7 +113,7 @@ bool CFileList::isDirectory(u32 index) const
|
|||
//! Returns the size of a file
|
||||
u32 CFileList::getFileSize(u32 index) const
|
||||
{
|
||||
return index < Files.size() ? Files[index].IsDirectory : 0;
|
||||
return index < Files.size() ? Files[index].Size : 0;
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -80,10 +80,8 @@ public:
|
|||
\param id The ID of the file in the archive which owns it */
|
||||
virtual u32 addItem(const io::path& fullPath, u32 size, bool isDirectory, u32 id=0);
|
||||
|
||||
//! Sorts the file list
|
||||
void sort();
|
||||
|
||||
// IFileList methods
|
||||
//! Sorts the file list. You should call this after adding any items to the file list
|
||||
virtual void sort();
|
||||
|
||||
//! Returns the amount of files in the filelist.
|
||||
virtual u32 getFileCount() const;
|
||||
|
@ -94,6 +92,9 @@ public:
|
|||
//! Gets the full name of a file in the list, path included, based on an index.
|
||||
virtual const io::path& getFullFileName(u32 index) const;
|
||||
|
||||
//! Returns the ID of a file in the file list, based on an index.
|
||||
virtual u32 getID(u32 index) const;
|
||||
|
||||
//! Returns true if the file is a directory
|
||||
virtual bool isDirectory(u32 index) const;
|
||||
|
||||
|
|
|
@ -24,8 +24,8 @@
|
|||
#if defined (_IRR_WINDOWS_API_)
|
||||
#if !defined ( _WIN32_WCE )
|
||||
#include <direct.h> // for _chdir
|
||||
#endif
|
||||
#include <io.h> // for _access
|
||||
#endif
|
||||
#else
|
||||
#if (defined(_IRR_POSIX_API_) || defined(_IRR_OSX_PLATFORM_))
|
||||
#include <stdio.h>
|
||||
|
@ -438,7 +438,7 @@ io::path CFileSystem::getAbsolutePath(const io::path& filename) const
|
|||
#elif defined(_IRR_WINDOWS_API_)
|
||||
|
||||
#if defined(_IRR_WCHAR_FILESYSTEM )
|
||||
c16 fpath[_MAX_PATH];
|
||||
wchar_t fpath[_MAX_PATH];
|
||||
p = _wfullpath(fpath, filename.c_str(), _MAX_PATH);
|
||||
#else
|
||||
c8 fpath[_MAX_PATH];
|
||||
|
@ -689,6 +689,13 @@ IFileList* CFileSystem::createFileList()
|
|||
return r;
|
||||
}
|
||||
|
||||
//! Creates an empty filelist
|
||||
IFileList* CFileSystem::createEmptyFileList(const io::path& path, bool ignoreCase, bool ignorePaths)
|
||||
{
|
||||
return new CFileList(path, ignoreCase, ignorePaths);
|
||||
}
|
||||
|
||||
|
||||
//! determines if a file exists and would be able to be opened.
|
||||
bool CFileSystem::existFile(const io::path& filename) const
|
||||
{
|
||||
|
@ -696,14 +703,31 @@ bool CFileSystem::existFile(const io::path& filename) const
|
|||
if (FileArchives[i]->getFileList()->findFile(filename)!=-1)
|
||||
return true;
|
||||
|
||||
#if defined(_IRR_WINDOWS_CE_PLATFORM_)
|
||||
#if defined(_IRR_WCHAR_FILESYSTEM)
|
||||
HANDLE hFile = CreateFileW(filename.c_str(), GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, 0, NULL);
|
||||
#else
|
||||
HANDLE hFile = CreateFileA(filename.c_str(), GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, 0, NULL);
|
||||
#endif
|
||||
if (hFile == INVALID_HANDLE_VALUE)
|
||||
return false;
|
||||
else
|
||||
{
|
||||
CloseHandle(hFile);
|
||||
return true;
|
||||
}
|
||||
#else
|
||||
_IRR_IMPLEMENT_MANAGED_MARSHALLING_BUGFIX;
|
||||
#if defined(_MSC_VER)
|
||||
#if defined(_IRR_WCHAR_FILESYSTEM)
|
||||
return (_waccess(filename.c_str(), 0) != -1);
|
||||
#elif defined(_MSC_VER)
|
||||
#else
|
||||
return (_access(filename.c_str(), 0) != -1);
|
||||
#endif
|
||||
#else
|
||||
return (access(filename.c_str(), F_OK) != -1);
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -96,6 +96,9 @@ public:
|
|||
//! and returns it.
|
||||
virtual IFileList* createFileList();
|
||||
|
||||
//! Creates an empty filelist
|
||||
virtual IFileList* createEmptyFileList(const io::path& path, bool ignoreCase, bool ignorePaths);
|
||||
|
||||
//! determines if a file exists and would be able to be opened.
|
||||
virtual bool existFile(const io::path& filename) const;
|
||||
|
||||
|
|
|
@ -131,6 +131,8 @@ CGUIColorSelectDialog::CGUIColorSelectDialog(const wchar_t* title, IGUIEnvironme
|
|||
}
|
||||
|
||||
SBatteryItem item;
|
||||
item.Incoming=0.f;
|
||||
item.Outgoing=0.f;
|
||||
|
||||
r.UpperLeftCorner.X = Template[i].x + 15;
|
||||
r.UpperLeftCorner.Y = Template[i].y;
|
||||
|
|
|
@ -327,7 +327,9 @@ void CGUIFileOpenDialog::fillListBox()
|
|||
FileList = FileSystem->createFileList();
|
||||
core::stringw s;
|
||||
|
||||
#if !defined(_IRR_WINDOWS_CE_PLATFORM_)
|
||||
setlocale(LC_ALL,"");
|
||||
#endif
|
||||
|
||||
if (FileList)
|
||||
{
|
||||
|
@ -339,7 +341,7 @@ void CGUIFileOpenDialog::fillListBox()
|
|||
int len = mbstowcs(ws,cs,strlen(cs));
|
||||
ws[len] = 0;
|
||||
s = ws;
|
||||
delete ws;
|
||||
delete [] ws;
|
||||
#else
|
||||
s = FileList->getFileName(i).c_str();
|
||||
#endif
|
||||
|
|
|
@ -121,7 +121,7 @@ IGUIButton* CGUIToolBar::addButton(s32 id, const wchar_t* text,const wchar_t* to
|
|||
{
|
||||
ButtonX += 3;
|
||||
|
||||
core::rect<s32> rectangle(ButtonX,2,0,0);
|
||||
core::rect<s32> rectangle(ButtonX,2,ButtonX+1,3);
|
||||
if ( img )
|
||||
{
|
||||
const core::dimension2du &size = img->getOriginalSize();
|
||||
|
@ -129,6 +129,20 @@ IGUIButton* CGUIToolBar::addButton(s32 id, const wchar_t* text,const wchar_t* to
|
|||
rectangle.LowerRightCorner.Y = rectangle.UpperLeftCorner.Y + size.Height + 6;
|
||||
}
|
||||
|
||||
if ( text )
|
||||
{
|
||||
IGUISkin* skin = Environment->getSkin();
|
||||
IGUIFont * font = skin->getFont(EGDF_BUTTON);
|
||||
if ( font )
|
||||
{
|
||||
core::dimension2d<u32> dim = font->getDimension(text);
|
||||
if ( (s32)dim.Width > rectangle.getWidth() )
|
||||
rectangle.LowerRightCorner.X = rectangle.UpperLeftCorner.X + dim.Width + 8;
|
||||
if ( (s32)dim.Height > rectangle.getHeight() )
|
||||
rectangle.LowerRightCorner.Y = rectangle.UpperLeftCorner.Y + dim.Height + 6;
|
||||
}
|
||||
}
|
||||
|
||||
ButtonX += rectangle.getWidth();
|
||||
|
||||
IGUIButton* button = new CGUIButton(Environment, this, id, rectangle);
|
||||
|
|
|
@ -38,7 +38,7 @@ BOOL WINAPI ConsoleHandler(DWORD CEvent)
|
|||
DeviceToClose->closeDevice();
|
||||
return TRUE;
|
||||
}
|
||||
#else
|
||||
#elif defined(_IRR_POSIX_API_)
|
||||
// sigterm handler
|
||||
#include <signal.h>
|
||||
|
||||
|
@ -64,7 +64,7 @@ const u16 ASCIIArtCharsCount = 32;
|
|||
|
||||
//! constructor
|
||||
CIrrDeviceConsole::CIrrDeviceConsole(const SIrrlichtCreationParameters& params)
|
||||
: CIrrDeviceStub(params), IsDeviceRunning(true), IsWindowFocused(true), ConsoleFont(0), OutFile(stdout)
|
||||
: CIrrDeviceStub(params), IsWindowFocused(true), ConsoleFont(0), OutFile(stdout)
|
||||
{
|
||||
DeviceToClose = this;
|
||||
|
||||
|
@ -94,7 +94,7 @@ CIrrDeviceConsole::CIrrDeviceConsole(const SIrrlichtCreationParameters& params)
|
|||
// catch windows close/break signals
|
||||
SetConsoleCtrlHandler((PHANDLER_ROUTINE)ConsoleHandler, TRUE);
|
||||
|
||||
#else
|
||||
#elif defined(_IRR_POSIX_API_)
|
||||
// catch other signals
|
||||
signal(SIGABRT, &sighandler);
|
||||
signal(SIGTERM, &sighandler);
|
||||
|
@ -305,7 +305,7 @@ bool CIrrDeviceConsole::run()
|
|||
// todo: keyboard input from terminal in raw mode
|
||||
#endif
|
||||
|
||||
return IsDeviceRunning;
|
||||
return !Close;
|
||||
}
|
||||
|
||||
//! Cause the device to temporarily pause execution and let other processes to run
|
||||
|
@ -413,7 +413,7 @@ bool CIrrDeviceConsole::present(video::IImage* surface, void* windowId, core::re
|
|||
void CIrrDeviceConsole::closeDevice()
|
||||
{
|
||||
// return false next time we run()
|
||||
IsDeviceRunning = false;
|
||||
Close = true;
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -223,8 +223,7 @@ namespace irr
|
|||
core::stringc Text;
|
||||
};
|
||||
|
||||
bool IsDeviceRunning,
|
||||
IsWindowFocused;
|
||||
bool IsWindowFocused;
|
||||
|
||||
core::array<core::stringc> OutputBuffer;
|
||||
gui::IGUIFont *ConsoleFont;
|
||||
|
@ -328,3 +327,4 @@ namespace gui
|
|||
|
||||
#endif // _IRR_COMPILE_WITH_CONSOLE_DEVICE_
|
||||
#endif // __C_IRR_DEVICE_CONSOLE_H_INCLUDED__
|
||||
|
||||
|
|
|
@ -25,6 +25,10 @@
|
|||
#include <fcntl.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#ifdef __FREE_BSD_
|
||||
#include <sys/joystick.h>
|
||||
#else
|
||||
|
||||
// linux/joystick.h includes linux/input.h, which #defines values for various KEY_FOO keys.
|
||||
// These override the irr::KEY_FOO equivalents, which stops key handling from working.
|
||||
// As a workaround, defining _INPUT_H stops linux/input.h from being included; it
|
||||
|
@ -33,6 +37,8 @@
|
|||
#include <sys/ioctl.h> // Would normally be included in linux/input.h
|
||||
#include <linux/joystick.h>
|
||||
#undef _INPUT_H
|
||||
#endif
|
||||
|
||||
#endif // _IRR_COMPILE_WITH_JOYSTICK_EVENTS_
|
||||
|
||||
namespace irr
|
||||
|
@ -68,7 +74,7 @@ CIrrDeviceLinux::CIrrDeviceLinux(const SIrrlichtCreationParameters& param)
|
|||
#endif
|
||||
#endif
|
||||
Width(param.WindowSize.Width), Height(param.WindowSize.Height),
|
||||
Close(false), WindowHasFocus(false), WindowMinimized(false),
|
||||
WindowHasFocus(false), WindowMinimized(false),
|
||||
UseXVidMode(false), UseXRandR(false), UseGLXWindow(false),
|
||||
ExternalWindow(false), AutorepeatSupport(0)
|
||||
{
|
||||
|
@ -1540,15 +1546,26 @@ bool CIrrDeviceLinux::activateJoysticks(core::array<SJoystickInfo> & joystickInf
|
|||
devName = "/dev/input/js";
|
||||
devName += joystick;
|
||||
info.fd = open(devName.c_str(), O_RDONLY);
|
||||
if(-1 == info.fd)
|
||||
{
|
||||
// and BSD here
|
||||
devName = "/dev/joy";
|
||||
devName += joystick;
|
||||
info.fd = open(devName.c_str(), O_RDONLY);
|
||||
}
|
||||
}
|
||||
|
||||
if(-1 == info.fd)
|
||||
continue;
|
||||
|
||||
#ifdef __FREE_BSD_
|
||||
info.axes=2;
|
||||
info.buttons=2;
|
||||
#else
|
||||
ioctl( info.fd, JSIOCGAXES, &(info.axes) );
|
||||
ioctl( info.fd, JSIOCGBUTTONS, &(info.buttons) );
|
||||
|
||||
fcntl( info.fd, F_SETFL, O_NONBLOCK );
|
||||
#endif
|
||||
|
||||
(void)memset(&info.persistentData, 0, sizeof(info.persistentData));
|
||||
info.persistentData.EventType = irr::EET_JOYSTICK_INPUT_EVENT;
|
||||
|
@ -1565,9 +1582,11 @@ bool CIrrDeviceLinux::activateJoysticks(core::array<SJoystickInfo> & joystickInf
|
|||
returnInfo.Axes = info.axes;
|
||||
returnInfo.Buttons = info.buttons;
|
||||
|
||||
#ifndef __FREE_BSD_
|
||||
char name[80];
|
||||
ioctl( info.fd, JSIOCGNAME(80), name);
|
||||
returnInfo.Name = name;
|
||||
#endif
|
||||
|
||||
joystickInfo.push_back(returnInfo);
|
||||
}
|
||||
|
@ -1594,11 +1613,19 @@ void CIrrDeviceLinux::pollJoysticks()
|
|||
if(0 == ActiveJoysticks.size())
|
||||
return;
|
||||
|
||||
u32 joystick;
|
||||
for(joystick = 0; joystick < ActiveJoysticks.size(); ++joystick)
|
||||
u32 j;
|
||||
for(j= 0; j< ActiveJoysticks.size(); ++j)
|
||||
{
|
||||
JoystickInfo & info = ActiveJoysticks[joystick];
|
||||
JoystickInfo & info = ActiveJoysticks[j];
|
||||
|
||||
#ifdef __FREE_BSD_
|
||||
struct joystick js;
|
||||
if( read( info.fd, &js, JS_RETURN ) == JS_RETURN )
|
||||
{
|
||||
info.persistentData.JoystickEvent.ButtonStates = js.buttons; /* should be a two-bit field */
|
||||
info.persistentData.JoystickEvent.Axis[0] = js.x; /* X axis */
|
||||
info.persistentData.JoystickEvent.Axis[1] = js.y; /* Y axis */
|
||||
#else
|
||||
struct js_event event;
|
||||
while(sizeof(event) == read(info.fd, &event, sizeof(event)))
|
||||
{
|
||||
|
@ -1619,6 +1646,7 @@ void CIrrDeviceLinux::pollJoysticks()
|
|||
break;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
// Send an irrlicht joystick event once per ::run() even if no new data were received.
|
||||
(void)postEventFromUser(info.persistentData);
|
||||
|
|
|
@ -354,7 +354,6 @@ namespace irr
|
|||
#endif
|
||||
#endif
|
||||
u32 Width, Height;
|
||||
bool Close;
|
||||
bool WindowHasFocus;
|
||||
bool WindowMinimized;
|
||||
bool UseXVidMode;
|
||||
|
|
|
@ -59,8 +59,7 @@ CIrrDeviceSDL::CIrrDeviceSDL(const SIrrlichtCreationParameters& param)
|
|||
Screen((SDL_Surface*)param.WindowId), SDL_Flags(SDL_ANYFORMAT),
|
||||
MouseX(0), MouseY(0), MouseButtonStates(0),
|
||||
Width(param.WindowSize.Width), Height(param.WindowSize.Height),
|
||||
Close(0), Resizable(false),
|
||||
WindowHasFocus(false), WindowMinimized(false)
|
||||
Resizable(false), WindowHasFocus(false), WindowMinimized(false)
|
||||
{
|
||||
#ifdef _DEBUG
|
||||
setDebugName("CIrrDeviceSDL");
|
||||
|
@ -75,7 +74,7 @@ CIrrDeviceSDL::CIrrDeviceSDL(const SIrrlichtCreationParameters& param)
|
|||
SDL_INIT_NOPARACHUTE ) < 0)
|
||||
{
|
||||
os::Printer::log( "Unable to initialize SDL!", SDL_GetError());
|
||||
Close = 1;
|
||||
Close = true;
|
||||
}
|
||||
|
||||
#if defined(_IRR_WINDOWS_)
|
||||
|
|
|
@ -203,7 +203,6 @@ namespace irr
|
|||
|
||||
u32 Width, Height;
|
||||
|
||||
bool Close;
|
||||
bool Resizable;
|
||||
bool WindowHasFocus;
|
||||
bool WindowMinimized;
|
||||
|
|
|
@ -19,7 +19,8 @@ namespace irr
|
|||
CIrrDeviceStub::CIrrDeviceStub(const SIrrlichtCreationParameters& params)
|
||||
: IrrlichtDevice(), VideoDriver(0), GUIEnvironment(0), SceneManager(0),
|
||||
Timer(0), CursorControl(0), UserReceiver(params.EventReceiver), Logger(0), Operator(0),
|
||||
FileSystem(0), InputReceivingSceneManager(0), CreationParams(params)
|
||||
FileSystem(0), InputReceivingSceneManager(0), CreationParams(params),
|
||||
Close(false)
|
||||
{
|
||||
Timer = new CTimer();
|
||||
if (os::Printer::Logger)
|
||||
|
|
|
@ -147,8 +147,6 @@ namespace irr
|
|||
IOSOperator* Operator;
|
||||
io::IFileSystem* FileSystem;
|
||||
scene::ISceneManager* InputReceivingSceneManager;
|
||||
video::CVideoModeList VideoModeList;
|
||||
SIrrlichtCreationParameters CreationParams;
|
||||
|
||||
struct SMouseMultiClicks
|
||||
{
|
||||
|
@ -162,6 +160,9 @@ namespace irr
|
|||
core::position2di LastClick;
|
||||
};
|
||||
SMouseMultiClicks MouseMultiClicks;
|
||||
video::CVideoModeList VideoModeList;
|
||||
SIrrlichtCreationParameters CreationParams;
|
||||
bool Close;
|
||||
};
|
||||
|
||||
} // end namespace irr
|
||||
|
|
|
@ -515,8 +515,6 @@ bool CIrrDeviceWin32::run()
|
|||
|
||||
MSG msg;
|
||||
|
||||
bool quit = false;
|
||||
|
||||
while (PeekMessage(&msg, NULL, 0, 0, PM_REMOVE))
|
||||
{
|
||||
TranslateMessage(&msg);
|
||||
|
@ -527,17 +525,17 @@ bool CIrrDeviceWin32::run()
|
|||
DispatchMessage(&msg);
|
||||
|
||||
if (msg.message == WM_QUIT)
|
||||
quit = true;
|
||||
Close = true;
|
||||
}
|
||||
|
||||
if (!quit)
|
||||
if (!Close)
|
||||
resizeIfNecessary();
|
||||
|
||||
if(!quit)
|
||||
if(!Close)
|
||||
pollJoysticks();
|
||||
|
||||
_IRR_IMPLEMENT_MANAGED_MARSHALLING_BUGFIX;
|
||||
return !quit;
|
||||
return !Close;
|
||||
}
|
||||
|
||||
|
||||
|
@ -675,6 +673,7 @@ void CIrrDeviceWin32::closeDevice()
|
|||
PostQuitMessage(0);
|
||||
PeekMessage(&msg, NULL, WM_QUIT, WM_QUIT, PM_REMOVE);
|
||||
DestroyWindow(HWnd);
|
||||
Close=true;
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -107,8 +107,9 @@ namespace irr
|
|||
public:
|
||||
|
||||
CCursorControl(const core::dimension2d<u32>& wsize, HWND hwnd, bool fullscreen)
|
||||
: WindowSize(wsize), InvWindowSize(0.0f, 0.0f), IsVisible(true),
|
||||
HWnd(hwnd), BorderX(0), BorderY(0), UseReferenceRect(false)
|
||||
: WindowSize(wsize), InvWindowSize(0.0f, 0.0f),
|
||||
HWnd(hwnd), BorderX(0), BorderY(0),
|
||||
UseReferenceRect(false), IsVisible(true)
|
||||
{
|
||||
if (WindowSize.Width!=0)
|
||||
InvWindowSize.Width = 1.0f / WindowSize.Width;
|
||||
|
@ -172,9 +173,9 @@ namespace irr
|
|||
virtual void setPosition(f32 x, f32 y)
|
||||
{
|
||||
if (!UseReferenceRect)
|
||||
setPosition((s32)(x*WindowSize.Width), (s32)(y*WindowSize.Height));
|
||||
setPosition(core::round32(x*WindowSize.Width), core::round32(y*WindowSize.Height));
|
||||
else
|
||||
setPosition((s32)(x*ReferenceRect.getWidth()), (s32)(y*ReferenceRect.getHeight()));
|
||||
setPosition(core::round32(x*ReferenceRect.getWidth()), core::round32(y*ReferenceRect.getHeight()));
|
||||
}
|
||||
|
||||
//! Sets the new position of the cursor.
|
||||
|
@ -247,6 +248,7 @@ namespace irr
|
|||
/** Used to notify the cursor that the window was resized. */
|
||||
virtual void OnResize(const core::dimension2d<u32>& size)
|
||||
{
|
||||
WindowSize = size;
|
||||
if (size.Width!=0)
|
||||
InvWindowSize.Width = 1.0f / size.Width;
|
||||
else
|
||||
|
@ -297,12 +299,12 @@ namespace irr
|
|||
core::position2d<s32> CursorPos;
|
||||
core::dimension2d<u32> WindowSize;
|
||||
core::dimension2d<f32> InvWindowSize;
|
||||
bool IsVisible;
|
||||
HWND HWnd;
|
||||
|
||||
s32 BorderX, BorderY;
|
||||
bool UseReferenceRect;
|
||||
core::rect<s32> ReferenceRect;
|
||||
bool UseReferenceRect;
|
||||
bool IsVisible;
|
||||
};
|
||||
|
||||
//! returns the win32 cursor control
|
||||
|
|
|
@ -552,8 +552,6 @@ bool CIrrDeviceWinCE::run()
|
|||
|
||||
MSG msg;
|
||||
|
||||
bool quit = false;
|
||||
|
||||
while (PeekMessage(&msg, NULL, 0, 0, PM_REMOVE))
|
||||
{
|
||||
TranslateMessage(&msg);
|
||||
|
@ -564,14 +562,14 @@ bool CIrrDeviceWinCE::run()
|
|||
DispatchMessage(&msg);
|
||||
|
||||
if (msg.message == WM_QUIT)
|
||||
quit = true;
|
||||
Close = true;
|
||||
}
|
||||
|
||||
if (!quit)
|
||||
if (!Close)
|
||||
resizeIfNecessary();
|
||||
|
||||
_IRR_IMPLEMENT_MANAGED_MARSHALLING_BUGFIX;
|
||||
return !quit;
|
||||
return !Close;
|
||||
}
|
||||
|
||||
|
||||
|
@ -713,6 +711,7 @@ void CIrrDeviceWinCE::closeDevice()
|
|||
PostQuitMessage(0);
|
||||
PeekMessage(&msg, NULL, WM_QUIT, WM_QUIT, PM_REMOVE);
|
||||
DestroyWindow(HWnd);
|
||||
Close=true;
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -90,8 +90,9 @@ namespace irr
|
|||
public:
|
||||
|
||||
CCursorControl(const core::dimension2d<u32>& wsize, HWND hwnd, bool fullscreen)
|
||||
: WindowSize(wsize), InvWindowSize(0.0f, 0.0f), IsVisible(true),
|
||||
HWnd(hwnd), BorderX(0), BorderY(0), UseReferenceRect(false)
|
||||
: WindowSize(wsize), InvWindowSize(0.0f, 0.0f),
|
||||
HWnd(hwnd), BorderX(0), BorderY(0),
|
||||
UseReferenceRect(false), IsVisible(true)
|
||||
{
|
||||
if (WindowSize.Width!=0)
|
||||
InvWindowSize.Width = 1.0f / WindowSize.Width;
|
||||
|
@ -129,9 +130,9 @@ namespace irr
|
|||
virtual void setPosition(f32 x, f32 y)
|
||||
{
|
||||
if (!UseReferenceRect)
|
||||
setPosition((s32)(x*WindowSize.Width), (s32)(y*WindowSize.Height));
|
||||
setPosition(core::round32(x*WindowSize.Width), core::round32(y*WindowSize.Height));
|
||||
else
|
||||
setPosition((s32)(x*ReferenceRect.getWidth()), (s32)(y*ReferenceRect.getHeight()));
|
||||
setPosition(core::round32(x*ReferenceRect.getWidth()), core::round32(y*ReferenceRect.getHeight()));
|
||||
}
|
||||
|
||||
//! Sets the new position of the cursor.
|
||||
|
@ -205,6 +206,7 @@ namespace irr
|
|||
/** Used to notify the cursor that the window was resized. */
|
||||
virtual void OnResize(const core::dimension2d<u32>& size)
|
||||
{
|
||||
WindowSize = size;
|
||||
if (size.Width!=0)
|
||||
InvWindowSize.Width = 1.0f / size.Width;
|
||||
else
|
||||
|
@ -255,12 +257,12 @@ namespace irr
|
|||
core::position2d<s32> CursorPos;
|
||||
core::dimension2d<s32> WindowSize;
|
||||
core::dimension2d<f32> InvWindowSize;
|
||||
bool IsVisible;
|
||||
HWND HWnd;
|
||||
|
||||
s32 BorderX, BorderY;
|
||||
bool UseReferenceRect;
|
||||
core::rect<s32> ReferenceRect;
|
||||
bool UseReferenceRect;
|
||||
bool IsVisible;
|
||||
};
|
||||
|
||||
|
||||
|
|
|
@ -217,6 +217,7 @@ IAnimatedMesh* CLWOMeshFileLoader::createMesh(io::IReadFile* file)
|
|||
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)
|
||||
{
|
||||
|
@ -267,7 +268,11 @@ IAnimatedMesh* CLWOMeshFileLoader::createMesh(io::IReadFile* file)
|
|||
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();
|
||||
|
@ -343,17 +348,17 @@ IAnimatedMesh* CLWOMeshFileLoader::createMesh(io::IReadFile* file)
|
|||
}
|
||||
}
|
||||
// get the resolution for this axis
|
||||
f32 resolutionS = 1.f/Materials[i]->Texture[0].Size.Z;
|
||||
f32 resolutionT = 1.f/Materials[i]->Texture[0].Size.Y;
|
||||
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 = 1.f/Materials[i]->Texture[0].Size.X;
|
||||
resolutionT = 1.f/Materials[i]->Texture[0].Size.Z;
|
||||
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 = 1.f/Materials[i]->Texture[0].Size.X;
|
||||
resolutionT = 1.f/Materials[i]->Texture[0].Size.Y;
|
||||
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);
|
||||
|
@ -362,17 +367,19 @@ IAnimatedMesh* CLWOMeshFileLoader::createMesh(io::IReadFile* file)
|
|||
// add bump maps
|
||||
if (Materials[i]->Meshbuffer->Material.MaterialType==video::EMT_NORMAL_MAP_SOLID)
|
||||
{
|
||||
SMesh tmpmesh;
|
||||
tmpmesh.addMeshBuffer(Materials[i]->Meshbuffer);
|
||||
SceneManager->getMeshManipulator()->createMeshWithTangents(&tmpmesh, true, true);
|
||||
Mesh->addMeshBuffer(tmpmesh.getMeshBuffer(0));
|
||||
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);
|
||||
}
|
||||
Mesh->getMeshBuffer(Mesh->getMeshBufferCount()-1)->drop();
|
||||
Materials[i]->Meshbuffer->drop();
|
||||
// clear the material array elements
|
||||
delete Materials[i];
|
||||
}
|
||||
|
@ -607,6 +614,7 @@ void CLWOMeshFileLoader::readObj1(u32 size)
|
|||
u16 numVerts, vertIndex;
|
||||
s16 material;
|
||||
video::S3DVertex vertex;
|
||||
vertex.Color=0xffffffff;
|
||||
|
||||
while (size!=0)
|
||||
{
|
||||
|
|
|
@ -178,6 +178,7 @@ void CMeshSceneNode::render()
|
|||
{
|
||||
video::SMaterial m;
|
||||
m.Lighting = false;
|
||||
m.AntiAliasing=0;
|
||||
driver->setMaterial(m);
|
||||
|
||||
if (DebugDataVisible & scene::EDS_BBOX)
|
||||
|
|
|
@ -34,7 +34,7 @@ CPLYMeshFileLoader::~CPLYMeshFileLoader()
|
|||
// (we do, but this could be disabled to increase the speed of loading hundreds of meshes)
|
||||
if (Buffer)
|
||||
{
|
||||
delete Buffer;
|
||||
delete [] Buffer;
|
||||
Buffer = 0;
|
||||
}
|
||||
|
||||
|
@ -270,7 +270,7 @@ IAnimatedMesh* CPLYMeshFileLoader::createMesh(io::IReadFile* file)
|
|||
|
||||
|
||||
// free the buffer
|
||||
delete Buffer;
|
||||
delete [] Buffer;
|
||||
Buffer = 0;
|
||||
File->drop();
|
||||
File = 0;
|
||||
|
@ -557,7 +557,7 @@ c8* CPLYMeshFileLoader::getNextLine()
|
|||
|
||||
// begin at the start of the next line
|
||||
c8* pos = StartPointer;
|
||||
while (*pos && pos < EndPointer && *pos != '\r' && *pos != '\n')
|
||||
while (pos < EndPointer && *pos && *pos != '\r' && *pos != '\n')
|
||||
++pos;
|
||||
|
||||
if ( pos < EndPointer && ( *(pos+1) == '\r' || *(pos+1) == '\n') )
|
||||
|
|
|
@ -43,7 +43,9 @@ IAnimatedMesh* CSTLMeshFileLoader::createMesh(io::IReadFile* file)
|
|||
const u32 WORD_BUFFER_LENGTH = 512;
|
||||
|
||||
SMesh* mesh = new SMesh();
|
||||
mesh->addMeshBuffer( new SMeshBuffer() );
|
||||
SMeshBuffer* meshBuffer = new SMeshBuffer();
|
||||
mesh->addMeshBuffer(meshBuffer);
|
||||
meshBuffer->drop();
|
||||
|
||||
core::vector3df vertex[3];
|
||||
core::vector3df normal;
|
||||
|
|
|
@ -2525,7 +2525,11 @@ const video::SColorf& CSceneManager::getAmbientLight() const
|
|||
//! Get a skinned mesh, which is not available as header-only code
|
||||
ISkinnedMesh* CSceneManager::createSkinnedMesh()
|
||||
{
|
||||
#ifdef _IRR_COMPILE_WITH_SKINNED_MESH_SUPPORT_
|
||||
return new CSkinnedMesh();
|
||||
#else
|
||||
return 0;
|
||||
#endif
|
||||
}
|
||||
|
||||
//! Returns a mesh writer implementation if available
|
||||
|
|
|
@ -2155,3 +2155,4 @@ IVideoDriver* createSoftwareDriver2(const core::dimension2d<u32>& windowSize, bo
|
|||
|
||||
} // end namespace video
|
||||
} // end namespace irr
|
||||
|
||||
|
|
|
@ -265,9 +265,9 @@ void CTRGouraud2::drawTriangle ( const s4DVertex *a,const s4DVertex *b,const s4D
|
|||
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] = (ca != 0.f)?core::reciprocal ( ca ):0.f;
|
||||
scan.invDeltaY[1] = (ba != 0.f)?core::reciprocal ( ba ):0.f;
|
||||
scan.invDeltaY[2] = (cb != 0.f)?core::reciprocal ( cb ):0.f;
|
||||
scan.invDeltaY[0] = core::reciprocal( ca );
|
||||
scan.invDeltaY[1] = core::reciprocal( ba );
|
||||
scan.invDeltaY[2] = core::reciprocal( cb );
|
||||
|
||||
if ( F32_LOWER_EQUAL_0 ( scan.invDeltaY[0] ) )
|
||||
return;
|
||||
|
|
|
@ -276,9 +276,9 @@ void CTRGouraudAlpha2::drawTriangle ( const s4DVertex *a,const s4DVertex *b,cons
|
|||
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] = (ca != 0.f)?core::reciprocal ( ca ):0.f;
|
||||
scan.invDeltaY[1] = (ba != 0.f)?core::reciprocal ( ba ):0.f;
|
||||
scan.invDeltaY[2] = (cb != 0.f)?core::reciprocal ( cb ):0.f;
|
||||
scan.invDeltaY[0] = core::reciprocal( ca );
|
||||
scan.invDeltaY[1] = core::reciprocal( ba );
|
||||
scan.invDeltaY[2] = core::reciprocal( cb );
|
||||
|
||||
if ( F32_LOWER_EQUAL_0 ( scan.invDeltaY[0] ) )
|
||||
return;
|
||||
|
|
|
@ -278,9 +278,9 @@ void CTRGouraudAlphaNoZ2::drawTriangle ( const s4DVertex *a,const s4DVertex *b,c
|
|||
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] = (ca != 0.f)?core::reciprocal ( ca ):0.f;
|
||||
scan.invDeltaY[1] = (ba != 0.f)?core::reciprocal ( ba ):0.f;
|
||||
scan.invDeltaY[2] = (cb != 0.f)?core::reciprocal ( cb ):0.f;
|
||||
scan.invDeltaY[0] = core::reciprocal( ca );
|
||||
scan.invDeltaY[1] = core::reciprocal( ba );
|
||||
scan.invDeltaY[2] = core::reciprocal( cb );
|
||||
|
||||
if ( F32_LOWER_EQUAL_0 ( scan.invDeltaY[0] ) )
|
||||
return;
|
||||
|
|
|
@ -2004,9 +2004,9 @@ void CTRTextureBlend::drawTriangle ( const s4DVertex *a,const s4DVertex *b,const
|
|||
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] = (ca != 0.f)?core::reciprocal ( ca ):0.f;
|
||||
scan.invDeltaY[1] = (ba != 0.f)?core::reciprocal ( ba ):0.f;
|
||||
scan.invDeltaY[2] = (cb != 0.f)?core::reciprocal ( cb ):0.f;
|
||||
scan.invDeltaY[0] = core::reciprocal( ca );
|
||||
scan.invDeltaY[1] = core::reciprocal( ba );
|
||||
scan.invDeltaY[2] = core::reciprocal( cb );
|
||||
|
||||
if ( F32_LOWER_EQUAL_0 ( scan.invDeltaY[0] ) )
|
||||
return;
|
||||
|
|
|
@ -282,9 +282,9 @@ void CTRTextureDetailMap2::drawTriangle ( const s4DVertex *a,const s4DVertex *b,
|
|||
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] = (ca != 0.f)?core::reciprocal ( ca ):0.f;
|
||||
scan.invDeltaY[1] = (ba != 0.f)?core::reciprocal ( ba ):0.f;
|
||||
scan.invDeltaY[2] = (cb != 0.f)?core::reciprocal ( cb ):0.f;
|
||||
scan.invDeltaY[0] = core::reciprocal( ca );
|
||||
scan.invDeltaY[1] = core::reciprocal( ba );
|
||||
scan.invDeltaY[2] = core::reciprocal( cb );
|
||||
|
||||
if ( F32_LOWER_EQUAL_0 ( scan.invDeltaY[0] ) )
|
||||
return;
|
||||
|
|
|
@ -294,9 +294,9 @@ void CTRTextureGouraud2::drawTriangle ( const s4DVertex *a,const s4DVertex *b,co
|
|||
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] = (ca != 0.f)?core::reciprocal ( ca ):0.f;
|
||||
scan.invDeltaY[1] = (ba != 0.f)?core::reciprocal ( ba ):0.f;
|
||||
scan.invDeltaY[2] = (cb != 0.f)?core::reciprocal ( cb ):0.f;
|
||||
scan.invDeltaY[0] = core::reciprocal( ca );
|
||||
scan.invDeltaY[1] = core::reciprocal( ba );
|
||||
scan.invDeltaY[2] = core::reciprocal( cb );
|
||||
|
||||
if ( F32_LOWER_EQUAL_0 ( scan.invDeltaY[0] ) )
|
||||
return;
|
||||
|
|
|
@ -302,9 +302,9 @@ void CTRTextureGouraudAdd2::drawTriangle ( const s4DVertex *a,const s4DVertex *b
|
|||
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] = (ca != 0.f)?core::reciprocal ( ca ):0.f;
|
||||
scan.invDeltaY[1] = (ba != 0.f)?core::reciprocal ( ba ):0.f;
|
||||
scan.invDeltaY[2] = (cb != 0.f)?core::reciprocal ( cb ):0.f;
|
||||
scan.invDeltaY[0] = core::reciprocal( ca );
|
||||
scan.invDeltaY[1] = core::reciprocal( ba );
|
||||
scan.invDeltaY[2] = core::reciprocal( cb );
|
||||
|
||||
// find if the major edge is left or right aligned
|
||||
f32 temp[4];
|
||||
|
|
|
@ -270,9 +270,9 @@ void CTRTextureGouraudAddNoZ2::drawTriangle ( const s4DVertex *a,const s4DVertex
|
|||
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] = (ca != 0.f)?core::reciprocal ( ca ):0.f;
|
||||
scan.invDeltaY[1] = (ba != 0.f)?core::reciprocal ( ba ):0.f;
|
||||
scan.invDeltaY[2] = (cb != 0.f)?core::reciprocal ( cb ):0.f;
|
||||
scan.invDeltaY[0] = core::reciprocal( ca );
|
||||
scan.invDeltaY[1] = core::reciprocal( ba );
|
||||
scan.invDeltaY[2] = core::reciprocal( cb );
|
||||
|
||||
if ( F32_LOWER_EQUAL_0 ( scan.invDeltaY[0] ) )
|
||||
return;
|
||||
|
|
|
@ -363,9 +363,9 @@ void CTRTextureGouraudAlpha2::drawTriangle ( const s4DVertex *a,const s4DVertex
|
|||
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] = (ca != 0.f)?core::reciprocal ( ca ):0.f;
|
||||
scan.invDeltaY[1] = (ba != 0.f)?core::reciprocal ( ba ):0.f;
|
||||
scan.invDeltaY[2] = (cb != 0.f)?core::reciprocal ( cb ):0.f;
|
||||
scan.invDeltaY[0] = core::reciprocal( ca );
|
||||
scan.invDeltaY[1] = core::reciprocal( ba );
|
||||
scan.invDeltaY[2] = core::reciprocal( cb );
|
||||
|
||||
if ( F32_LOWER_EQUAL_0 ( scan.invDeltaY[0] ) )
|
||||
return;
|
||||
|
|
|
@ -363,9 +363,9 @@ void CTRTextureGouraudAlphaNoZ::drawTriangle ( const s4DVertex *a,const s4DVerte
|
|||
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] = (ca != 0.f)?core::reciprocal ( ca ):0.f;
|
||||
scan.invDeltaY[1] = (ba != 0.f)?core::reciprocal ( ba ):0.f;
|
||||
scan.invDeltaY[2] = (cb != 0.f)?core::reciprocal ( cb ):0.f;
|
||||
scan.invDeltaY[0] = core::reciprocal( ca );
|
||||
scan.invDeltaY[1] = core::reciprocal( ba );
|
||||
scan.invDeltaY[2] = core::reciprocal( cb );
|
||||
|
||||
if ( F32_LOWER_EQUAL_0 ( scan.invDeltaY[0] ) )
|
||||
return;
|
||||
|
|
|
@ -266,9 +266,9 @@ void CTRTextureGouraudNoZ2::drawTriangle ( const s4DVertex *a,const s4DVertex *b
|
|||
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] = (ca != 0.f)?core::reciprocal ( ca ):0.f;
|
||||
scan.invDeltaY[1] = (ba != 0.f)?core::reciprocal ( ba ):0.f;
|
||||
scan.invDeltaY[2] = (cb != 0.f)?core::reciprocal ( cb ):0.f;
|
||||
scan.invDeltaY[0] = core::reciprocal( ca );
|
||||
scan.invDeltaY[1] = core::reciprocal( ba );
|
||||
scan.invDeltaY[2] = core::reciprocal( cb );
|
||||
|
||||
if ( F32_LOWER_EQUAL_0 ( scan.invDeltaY[0] ) )
|
||||
return;
|
||||
|
|
|
@ -309,9 +309,9 @@ void CTRTextureVertexAlpha2::drawTriangle ( const s4DVertex *a,const s4DVertex *
|
|||
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] = (ca != 0.f)?core::reciprocal ( ca ):0.f;
|
||||
scan.invDeltaY[1] = (ba != 0.f)?core::reciprocal ( ba ):0.f;
|
||||
scan.invDeltaY[2] = (cb != 0.f)?core::reciprocal ( cb ):0.f;
|
||||
scan.invDeltaY[0] = core::reciprocal( ca );
|
||||
scan.invDeltaY[1] = core::reciprocal( ba );
|
||||
scan.invDeltaY[2] = core::reciprocal( cb );
|
||||
|
||||
if ( F32_LOWER_EQUAL_0 ( scan.invDeltaY[0] ) )
|
||||
return;
|
||||
|
|
|
@ -290,9 +290,9 @@ void CTRTextureLightMap2_Add::drawTriangle ( const s4DVertex *a,const s4DVertex
|
|||
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] = (ca != 0.f)?core::reciprocal ( ca ):0.f;
|
||||
scan.invDeltaY[1] = (ba != 0.f)?core::reciprocal ( ba ):0.f;
|
||||
scan.invDeltaY[2] = (cb != 0.f)?core::reciprocal ( cb ):0.f;
|
||||
scan.invDeltaY[0] = core::reciprocal( ca );
|
||||
scan.invDeltaY[1] = core::reciprocal( ba );
|
||||
scan.invDeltaY[2] = core::reciprocal( cb );
|
||||
|
||||
if ( F32_LOWER_EQUAL_0 ( scan.invDeltaY[0] ) )
|
||||
return;
|
||||
|
|
|
@ -260,9 +260,9 @@ void CTRTextureLightMap2_M1::drawTriangle ( const s4DVertex *a,const s4DVertex *
|
|||
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] = (ca != 0.f)?core::reciprocal ( ca ):0.f;
|
||||
scan.invDeltaY[1] = (ba != 0.f)?core::reciprocal ( ba ):0.f;
|
||||
scan.invDeltaY[2] = (cb != 0.f)?core::reciprocal ( cb ):0.f;
|
||||
scan.invDeltaY[0] = core::reciprocal( ca );
|
||||
scan.invDeltaY[1] = core::reciprocal( ba );
|
||||
scan.invDeltaY[2] = core::reciprocal( cb );
|
||||
|
||||
if ( F32_LOWER_EQUAL_0 ( scan.invDeltaY[0] ) )
|
||||
return;
|
||||
|
|
|
@ -260,9 +260,9 @@ void CTRTextureLightMap2_M2::drawTriangle ( const s4DVertex *a,const s4DVertex *
|
|||
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] = (ca != 0.f)?core::reciprocal ( ca ):0.f;
|
||||
scan.invDeltaY[1] = (ba != 0.f)?core::reciprocal ( ba ):0.f;
|
||||
scan.invDeltaY[2] = (cb != 0.f)?core::reciprocal ( cb ):0.f;
|
||||
scan.invDeltaY[0] = core::reciprocal( ca );
|
||||
scan.invDeltaY[1] = core::reciprocal( ba );
|
||||
scan.invDeltaY[2] = core::reciprocal( cb );
|
||||
|
||||
if ( F32_LOWER_EQUAL_0 ( scan.invDeltaY[0] ) )
|
||||
return;
|
||||
|
|
|
@ -588,14 +588,13 @@ void CTRTextureLightMap2_M4::drawTriangle_Min ( const s4DVertex *a,const s4DVert
|
|||
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] = (ca != 0.f)?core::reciprocal ( ca ):0.f;
|
||||
scan.invDeltaY[1] = (ba != 0.f)?core::reciprocal ( ba ):0.f;
|
||||
scan.invDeltaY[2] = (cb != 0.f)?core::reciprocal ( cb ):0.f;
|
||||
scan.invDeltaY[0] = core::reciprocal( ca );
|
||||
scan.invDeltaY[1] = core::reciprocal( ba );
|
||||
scan.invDeltaY[2] = core::reciprocal( cb );
|
||||
|
||||
if ( F32_LOWER_EQUAL_0 ( scan.invDeltaY[0] ) )
|
||||
return;
|
||||
|
||||
|
||||
// find if the major edge is left or right aligned
|
||||
f32 temp[4];
|
||||
|
||||
|
@ -962,9 +961,9 @@ void CTRTextureLightMap2_M4::drawTriangle ( const s4DVertex *a,const s4DVertex *
|
|||
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] = (ca != 0.f)?core::reciprocal ( ca ):0.f;
|
||||
scan.invDeltaY[1] = (ba != 0.f)?core::reciprocal ( ba ):0.f;
|
||||
scan.invDeltaY[2] = (cb != 0.f)?core::reciprocal ( cb ):0.f;
|
||||
scan.invDeltaY[0] = core::reciprocal( ca );
|
||||
scan.invDeltaY[1] = core::reciprocal( ba );
|
||||
scan.invDeltaY[2] = core::reciprocal( cb );
|
||||
|
||||
if ( F32_LOWER_EQUAL_0 ( scan.invDeltaY[0] ) )
|
||||
return;
|
||||
|
|
|
@ -304,9 +304,9 @@ void CTRGTextureLightMap2_M4::drawTriangle ( const s4DVertex *a,const s4DVertex
|
|||
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] = (ca != 0.f)?core::reciprocal ( ca ):0.f;
|
||||
scan.invDeltaY[1] = (ba != 0.f)?core::reciprocal ( ba ):0.f;
|
||||
scan.invDeltaY[2] = (cb != 0.f)?core::reciprocal ( cb ):0.f;
|
||||
scan.invDeltaY[0] = core::reciprocal( ca );
|
||||
scan.invDeltaY[1] = core::reciprocal( ba );
|
||||
scan.invDeltaY[2] = core::reciprocal( cb );
|
||||
|
||||
if ( F32_LOWER_0 ( scan.invDeltaY[0] ) )
|
||||
return;
|
||||
|
|
|
@ -10,7 +10,9 @@
|
|||
#include "CLimitReadFile.h"
|
||||
#include "os.h"
|
||||
#include "coreutil.h"
|
||||
#if !defined(_IRR_WINDOWS_CE_PLATFORM_)
|
||||
#include "errno.h"
|
||||
#endif
|
||||
|
||||
namespace irr
|
||||
{
|
||||
|
@ -202,8 +204,10 @@ u32 CTarReader::populateFileList()
|
|||
}
|
||||
|
||||
u32 size = strtoul(sSize.c_str(), NULL, 8);
|
||||
#if !defined(_IRR_WINDOWS_CE_PLATFORM_)
|
||||
if (errno == ERANGE)
|
||||
os::Printer::log("File too large", fullPath, ELL_WARNING);
|
||||
#endif
|
||||
|
||||
// save start position
|
||||
u32 offset = pos + 512;
|
||||
|
|
|
@ -1101,10 +1101,10 @@ namespace scene
|
|||
for (s32 x = 1; x < TerrainData.Size - 1; ++x)
|
||||
{
|
||||
mb->getVertexBuffer()[x + yd].Pos.Y =
|
||||
(mb->getVertexBuffer()[x-1 + yd].Pos.Y +
|
||||
mb->getVertexBuffer()[x+1 + yd].Pos.Y +
|
||||
mb->getVertexBuffer()[x + yd - TerrainData.Size].Pos.Y +
|
||||
mb->getVertexBuffer()[x + yd - TerrainData.Size].Pos.Y) * 0.25f;
|
||||
(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;
|
||||
}
|
||||
|
|
|
@ -1667,12 +1667,6 @@
|
|||
<File
|
||||
RelativePath="CEmptySceneNode.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\CLensFlareSceneNode.cpp">
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\CLensFlareSceneNode.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\CLightSceneNode.cpp">
|
||||
</File>
|
||||
|
@ -1972,30 +1966,30 @@
|
|||
<File
|
||||
RelativePath=".\CMemoryFile.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\CPakReader.cpp">
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\CPakReader.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\CTarReader.cpp">
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\CTarReader.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\CMountPointReader.cpp">
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\CMountPointReader.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\CPakReader.cpp">
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\CPakReader.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\CReadFile.cpp">
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\CReadFile.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\CTarReader.cpp">
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\CTarReader.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="CWriteFile.cpp">
|
||||
</File>
|
||||
|
|
|
@ -52,7 +52,7 @@ LINKOBJ = $(IRRMESHOBJ) $(IRROBJ) $(IRRPARTICLEOBJ) $(IRRANIMOBJ) \
|
|||
#Compiler flags
|
||||
CXXINCS = -I../../include -Izlib -Ijpeglib -Ilibpng
|
||||
CPPFLAGS = $(CXXINCS) -DIRRLICHT_EXPORTS=1
|
||||
CXXFLAGS = -Wall -pipe -fno-exceptions -fno-rtti -fstrict-aliasing
|
||||
CXXFLAGS += -Wall -pipe -fno-exceptions -fno-rtti -fstrict-aliasing
|
||||
ifndef NDEBUG
|
||||
CXXFLAGS += -g -D_DEBUG
|
||||
else
|
||||
|
@ -63,8 +63,8 @@ CXXFLAGS += -pg
|
|||
endif
|
||||
CFLAGS := -fexpensive-optimizations -O3 -DPNG_THREAD_UNSAFE_OK -DPNG_NO_MMX_CODE -DPNG_NO_MNG_FEATURES
|
||||
|
||||
sharedlib sharedlib_osx: CXXFLAGS += -fpic
|
||||
sharedlib sharedlib_osx: CFLAGS += -fpic
|
||||
sharedlib sharedlib_osx: CXXFLAGS += -fPIC
|
||||
sharedlib sharedlib_osx: CFLAGS += -fPIC
|
||||
|
||||
#multilib handling
|
||||
ifeq ($(HOSTTYPE), x86_64)
|
||||
|
@ -74,11 +74,10 @@ endif
|
|||
#Linux specific options
|
||||
staticlib sharedlib install: SYSTEM = Linux
|
||||
STATIC_LIB = libIrrlicht.a
|
||||
IRRLICHT_DLL := ../../bin/Win32-gcc/Irrlicht.dll
|
||||
LIB_PATH = ../../lib/$(SYSTEM)
|
||||
INSTALL_DIR = /usr/local/lib
|
||||
sharedlib install: SHARED_LIB = libIrrlicht.so
|
||||
staticlib sharedlib: LDFLAGS = --no-export-all-symbols --add-stdcall-alias
|
||||
staticlib sharedlib: LDFLAGS += --no-export-all-symbols --add-stdcall-alias
|
||||
sharedlib: LDFLAGS += -L/usr/X11R6/lib$(LIBSELECT) -lGL -lXxf86vm
|
||||
staticlib sharedlib: CXXINCS += -I/usr/X11R6/include
|
||||
|
||||
|
@ -87,12 +86,13 @@ staticlib_osx sharedlib_osx install_osx: SYSTEM = MacOSX
|
|||
staticlib_osx sharedlib_osx: IRROTHEROBJ += MacOSX/CIrrDeviceMacOSX.o MacOSX/OSXClipboard.o MacOSX/AppDelegate.o
|
||||
staticlib_osx sharedlib_osx: CXXINCS += -IMacOSX -I/usr/X11R6/include
|
||||
sharedlib_osx install_osx: SHARED_LIB = libIrrlicht.dylib
|
||||
staticlib_osx sharedlib_osx: LDFLAGS = --no-export-all-symbols --add-stdcall-alias
|
||||
staticlib_osx sharedlib_osx: LDFLAGS += --no-export-all-symbols --add-stdcall-alias
|
||||
sharedlib_osx: LDFLAGS += -L/usr/X11R6/lib$(LIBSELECT) -lGL -lXxf86vm
|
||||
|
||||
#Windows specific options
|
||||
IRRLICHT_DLL := ../../bin/Win32-gcc/Irrlicht.dll
|
||||
sharedlib_win32 staticlib_win32: SYSTEM = Win32-gcc
|
||||
sharedlib_win32: LDFLAGS = -lgdi32 -lopengl32 -ld3dx9d -lwinmm
|
||||
sharedlib_win32: LDFLAGS += -lgdi32 -lopengl32 -ld3dx9d -lwinmm
|
||||
sharedlib_win32 staticlib_win32: CPPFLAGS += -DIRR_COMPILE_WITH_DX9_DEV_PACK -D__GNUWIN32__ -D_WIN32 -DWIN32 -D_WINDOWS -D_MBCS -D_USRDLL
|
||||
staticlib_win32: CPPFLAGS += -D_IRR_STATIC_LIB_
|
||||
|
||||
|
@ -102,7 +102,7 @@ all linux: staticlib
|
|||
|
||||
# Builds Irrlicht as shared lib (libIrrlicht.so.versionNumber) and copies it into /lib/Linux
|
||||
sharedlib: $(LINKOBJ)
|
||||
$(CXX) $(CPPFLAGS) $(CXXFLAGS) -shared -Wl,-soname,$(SHARED_LIB).$(VERSION_MAJOR).$(VERSION_MINOR) -fPIC -o $(SHARED_LIB).$(VERSION) $^ $(LDFLAGS)
|
||||
$(CXX) $(CPPFLAGS) $(CXXFLAGS) -shared -Wl,-soname,$(SHARED_LIB).$(VERSION_MAJOR).$(VERSION_MINOR) -o $(SHARED_LIB).$(VERSION) $^ $(LDFLAGS)
|
||||
cp $(SHARED_LIB).$(VERSION) $(LIB_PATH)
|
||||
|
||||
# Builds Irrlicht as static lib (libIrrlicht.a)
|
||||
|
@ -124,25 +124,17 @@ staticlib_win32: $(STATIC_LIB)
|
|||
|
||||
# Builds Irrlicht as shared lib (libIrrlicht.so.versionNumber) and copies it into /lib/MacOSX
|
||||
sharedlib_osx: $(LINKOBJ)
|
||||
$(CXX) $(CPPFLAGS) $(CXXFLAGS) -dynamiclib -Wl,-install_name,$(SHARED_LIB).$(VERSION_MAJOR).$(VERSION_MINOR) -fPIC -o $(SHARED_LIB).$(VERSION) $^ $(LDFLAGS)
|
||||
$(CXX) $(CPPFLAGS) $(CXXFLAGS) -dynamiclib -Wl,-install_name,$(SHARED_LIB).$(VERSION_MAJOR).$(VERSION_MINOR) -o $(SHARED_LIB).$(VERSION) $^ $(LDFLAGS)
|
||||
cp $(SHARED_LIB).$(VERSION) $(LIB_PATH)
|
||||
|
||||
# Installs Irrlicht if it was created as shared lib
|
||||
install:
|
||||
install install_osx:
|
||||
$(RM) -r $(INSTALL_DIR)/../include/irrlicht
|
||||
mkdir -p $(INSTALL_DIR)/../include/irrlicht
|
||||
cp ../../include/*.h $(INSTALL_DIR)/../include/irrlicht/
|
||||
cp $(LIB_PATH)/$(SHARED_LIB).$(VERSION) $(INSTALL_DIR)
|
||||
cd $(INSTALL_DIR) && ln -s -f libIrrlicht.so.$(VERSION) $(SHARED_LIB)
|
||||
ldconfig -n $(INSTALL_DIR)
|
||||
|
||||
install_osx:
|
||||
$(RM) -r $(INSTALL_DIR)/../include/irrlicht
|
||||
mkdir -p $(INSTALL_DIR)/../include/irrlicht
|
||||
cp ../../include/*.h $(INSTALL_DIR)/../include/irrlicht
|
||||
cp $(LIB_PATH)/$(SHARED_LIB).$(VERSION) $(INSTALL_DIR)
|
||||
cd $(INSTALL_DIR) && ln -s libIrrlicht.dylib.$(VERSION) $(SHARED_LIB)
|
||||
ldconfig -n $(INSTALL_DIR)
|
||||
cd $(INSTALL_DIR) && ln -s -f $(SHARED_LIB).$(VERSION) $(SHARED_LIB)
|
||||
# ldconfig -n $(INSTALL_DIR)
|
||||
|
||||
TAGS:
|
||||
ctags *.cpp ../../include/*.h *.h
|
||||
|
|
|
@ -931,7 +931,7 @@ inline s32 intervall_intersect_test( const sIntervall& a, const sIntervall& b)
|
|||
}
|
||||
|
||||
|
||||
} // namespace
|
||||
} // end namespace irr
|
||||
|
||||
#endif
|
||||
|
||||
|
|
|
@ -93,6 +93,7 @@ int main(int argumentCount, char * arguments[])
|
|||
TEST(testGeometryCreator);
|
||||
TEST(makeColorKeyTexture);
|
||||
TEST(lightMaps);
|
||||
TEST(testXML);
|
||||
|
||||
const unsigned int numberOfTests = tests.size();
|
||||
|
||||
|
|
|
@ -0,0 +1,5 @@
|
|||
<?xml version="1.0"?>
|
||||
<a>
|
||||
<b/>
|
||||
<c/>
|
||||
</a>
|
|
@ -45,7 +45,7 @@ bool terrainSceneNode(void)
|
|||
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", 98.24f);
|
||||
bool result = takeScreenshotAndCompareAgainstReference(driver, "-terrainSceneNode-1.png", 98.22f);
|
||||
if(!result)
|
||||
{
|
||||
logTestString("Small camera up rotation caused bad recalc.\n");
|
||||
|
@ -60,7 +60,7 @@ bool terrainSceneNode(void)
|
|||
smgr->drawAll();
|
||||
driver->endScene();
|
||||
|
||||
result &= takeScreenshotAndCompareAgainstReference(driver, "-terrainSceneNode-2.png", 98.84f);
|
||||
result &= takeScreenshotAndCompareAgainstReference(driver, "-terrainSceneNode-2.png", 98.83f);
|
||||
if(!result)
|
||||
{
|
||||
logTestString("Large camera up rotation caused bad recalc.\n");
|
||||
|
|
|
@ -142,7 +142,7 @@ static float fuzzyCompareImages(irr::video::IImage * image1,
|
|||
image1->unlock();
|
||||
image2->unlock();
|
||||
|
||||
const u32 totalColours = pixels * 775;
|
||||
const u32 totalColours = pixels * 255*3;
|
||||
return 100.f * (totalColours - mismatchedColours) / totalColours;
|
||||
}
|
||||
|
||||
|
@ -206,7 +206,7 @@ bool takeScreenshotAndCompareAgainstReference(irr::video::IVideoDriver * driver,
|
|||
irr::core::stringc mismatchFilename = "results/";
|
||||
mismatchFilename += driverName;
|
||||
mismatchFilename += fileName;
|
||||
logTestString("Writing mismatched image to '%s\n", mismatchFilename.c_str());
|
||||
logTestString("Writing mismatched image to '%s'\n", mismatchFilename.c_str());
|
||||
(void)driver->writeImageToFile(screenshot, mismatchFilename.c_str());
|
||||
}
|
||||
|
||||
|
@ -265,3 +265,4 @@ void logTestString(const char * format, ...)
|
|||
OutputDebugStringA(logString);
|
||||
#endif // #if defined(TESTING_ON_WINDOWS)
|
||||
}
|
||||
|
||||
|
|
|
@ -0,0 +1,43 @@
|
|||
// Copyright (C) 2009 Christian Stehno
|
||||
// No rights reserved: this software is in the public domain.
|
||||
|
||||
#include "testUtils.h"
|
||||
|
||||
using namespace irr;
|
||||
using namespace core;
|
||||
|
||||
/** Tests for XML handling */
|
||||
bool testXML(void)
|
||||
{
|
||||
IrrlichtDevice *device = createDevice(video::EDT_NULL, dimension2du(400, 200));
|
||||
|
||||
io::IXMLReaderUTF8* reader = device->getFileSystem()->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;
|
||||
}
|
||||
|
|
@ -1,2 +1,2 @@
|
|||
Test suite pass at GMT Fri Oct 23 12:34:07 2009
|
||||
Test suite pass at GMT Fri Oct 23 17:47:51 2009
|
||||
|
||||
|
|
|
@ -74,8 +74,6 @@ int main()
|
|||
now we add the GUI Editor Workspace
|
||||
*/
|
||||
|
||||
env->loadGUI("guiTest.xml");
|
||||
|
||||
env->addGUIElement("GUIEditor");
|
||||
|
||||
while(device->run())
|
||||
|
|
Loading…
Reference in New Issue