Merged revisions 2622:2663 from branch 1.6. SMaterial bug, MS3D patch, LWO fix. Better Shift recognition under 2in32. D3D depth buffer MSAA problems fixed. string<c16> changed to io::path. Fix 2dimagebatch, add better mtl file finder. Fix some OpenGL extension checks. Fixed x86-64 warnings. Export symbols in gcc4. Scolling in GUITab fixed. Fixed PixelBlend16 and SW driver. FPS cam stuttering fixed. OSX project additions. New scene parameter to ignore obj's mtl files.

git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@2664 dfc29bdd-3216-0410-991c-e03cc46cb475
master
hybrid 2009-08-24 09:12:27 +00:00
parent 2f9c3864e7
commit 157cd67caf
241 changed files with 1561 additions and 1232 deletions

View File

@ -1,4 +1,8 @@
Changes in 1.6 (??.??.2009)
- Change debug data to draw using lines instead of arrows, which is much faster. Patch by pc0de
- Fix a bug with FPS camera animator causing stutters. Patch by FuzzYspo0N
- Fix scrolling controls in CGUITabControl

View File

@ -35,6 +35,7 @@ core::stringw Caption;
scene::ISceneNode* Model = 0;
scene::ISceneNode* SkyBox = 0;
bool Octree=false;
bool useLight=false;
scene::ICameraSceneNode* Camera[2] = {0, 0};
@ -186,7 +187,8 @@ void loadModel(const c8* fn)
animModel->setAnimationSpeed(30);
Model = animModel;
}
Model->setMaterialFlag(video::EMF_LIGHTING, false);
Model->setMaterialFlag(video::EMF_LIGHTING, useLight);
Model->setMaterialFlag(video::EMF_NORMALIZE_NORMALS, useLight);
// Model->setMaterialFlag(video::EMF_BACK_FACE_CULLING, false);
Model->setDebugDataVisible(scene::EDS_OFF);
@ -306,6 +308,15 @@ public:
if (Device)
Device->minimizeWindow();
}
else if (event.KeyInput.Key == irr::KEY_KEY_L)
{
useLight=!useLight;
if (Model)
{
Model->setMaterialFlag(video::EMF_LIGHTING, useLight);
Model->setMaterialFlag(video::EMF_NORMALIZE_NORMALS, useLight);
}
}
}
if (event.EventType == EET_GUI_EVENT)
@ -597,8 +608,8 @@ int main(int argc, char* argv[])
driver->setTextureCreationFlag(video::ETCF_ALWAYS_32_BIT, true);
smgr->addLightSceneNode();
smgr->addLightSceneNode(0, core::vector3df(50,-50,GUI_ID_OPEN_MODEL),
video::SColorf(1.0f,1.0f,1.0f),2000)->setPosition(core::vector3df(200,200,200));
smgr->addLightSceneNode(0, core::vector3df(200,200,200),
video::SColorf(1.0f,1.0f,1.0f),2000);
// add our media directory as "search path"
Device->getFileSystem()->addFolderFileArchive("../../media/");

View File

@ -66,14 +66,14 @@ public:
// set clip matrix
core::matrix4 worldViewProj;
worldViewProj = driver->getTransform(video::ETS_PROJECTION);
worldViewProj = driver->getTransform(video::ETS_PROJECTION);
worldViewProj *= driver->getTransform(video::ETS_VIEW);
worldViewProj *= driver->getTransform(video::ETS_WORLD);
if (UseHighLevelShaders)
services->setVertexShaderConstant("mWorldViewProj", worldViewProj.pointer(), 16);
else
services->setVertexShaderConstant(worldViewProj.pointer(), 4, 4);
services->setVertexShaderConstant(worldViewProj.pointer(), 4, 4);
// set camera position
@ -96,7 +96,7 @@ public:
services->setVertexShaderConstant(reinterpret_cast<f32*>(&col), 9, 1);
// set transposed world matrix
core::matrix4 world = driver->getTransform(video::ETS_WORLD);
world = world.getTransposed();
@ -135,7 +135,7 @@ int main()
case 'e': driverType = video::EDT_BURNINGSVIDEO;break;
case 'f': driverType = video::EDT_NULL; break;
default: return 1;
}
}
// ask the user if we should use high level shaders for this example
if (driverType == video::EDT_DIRECT3D9 ||
@ -170,9 +170,9 @@ int main()
the shaders directly as strings into the cpp source file, and use later
addShaderMaterial() instead of addShaderMaterialFromFiles().
*/
core::string<c16> vsFileName; // filename for the vertex shader
core::string<c16> psFileName; // filename for the pixel shader
io::path vsFileName; // filename for the vertex shader
io::path psFileName; // filename for the pixel shader
switch(driverType)
{
@ -227,7 +227,7 @@ int main()
"because of missing driver/hardware support.");
psFileName = "";
}
if (!driver->queryFeature(video::EVDF_VERTEX_SHADER_1_1) &&
!driver->queryFeature(video::EVDF_ARB_VERTEX_PROGRAM_1))
{
@ -413,7 +413,7 @@ int main()
}
device->drop();
return 0;
}

View File

@ -28,10 +28,10 @@ Copyright 2006-2009 Burningwater, Thomas Alten
*/
struct GameData
{
GameData ( const string<c16> &startupDir);
GameData ( const path &startupDir);
void setDefault ();
s32 save ( const string<c16> &filename );
s32 load ( const string<c16> &filename );
s32 save ( const path &filename );
s32 load ( const path &filename );
s32 debugState;
s32 gravityState;
@ -43,9 +43,9 @@ struct GameData
s32 retVal;
s32 sound;
string<c16> StartupDir;
path StartupDir;
stringw CurrentMapName;
array < string<c16> > CurrentArchiveList;
array<path> CurrentArchiveList;
vector3df PlayerPosition;
vector3df PlayerRotation;
@ -60,7 +60,7 @@ struct GameData
/*!
*/
GameData::GameData ( const string<c16> &startupDir)
GameData::GameData ( const path &startupDir)
{
retVal = 0;
createExDevice = 0;
@ -127,14 +127,14 @@ void GameData::setDefault ()
/*!
Load the current game State from a typical quake3 cfg file
*/
s32 GameData::load ( const string<c16> &filename )
s32 GameData::load ( const path &filename )
{
if ( 0 == Device )
if (!Device)
return 0;
//! the quake3 mesh loader can also handle *.shader and *.cfg file
IQ3LevelMesh* mesh = (IQ3LevelMesh*) Device->getSceneManager()->getMesh ( filename );
if ( 0 == mesh )
if (!mesh)
return 0;
tQ3EntityList &entityList = mesh->getEntityList ();
@ -174,10 +174,10 @@ s32 GameData::load ( const string<c16> &filename )
/*!
Store the current game State in a quake3 configuration file
*/
s32 GameData::save ( const string<c16> &filename )
s32 GameData::save ( const path &filename )
{
return 0;
if ( 0 == Device )
if (!Device)
return 0;
c8 buf[128];
@ -200,7 +200,7 @@ s32 GameData::save ( const string<c16> &filename )
}
IWriteFile *file = fs->createAndWriteFile ( filename );
if ( 0 == file )
if (!file)
return 0;
snprintf ( buf, 128, "playerposition %.f %.f %.f\nplayerrotation %.f %.f %.f\n",
@ -500,7 +500,7 @@ public:
void Animate();
void Render();
void AddArchive ( const core::string<c16>& archiveName );
void AddArchive ( const path& archiveName );
void LoadMap ( const stringw& mapName, s32 collision );
void CreatePlayers();
void AddSky( u32 dome, const c8 *texture );
@ -833,7 +833,7 @@ void CQuake3EventHandler::CreateGUI()
/*!
Add an Archive to the FileSystems und updates the GUI
*/
void CQuake3EventHandler::AddArchive ( const core::string<c16>& archiveName )
void CQuake3EventHandler::AddArchive ( const path& archiveName )
{
IFileSystem *fs = Game->Device->getFileSystem();
u32 i;
@ -928,16 +928,16 @@ void CQuake3EventHandler::AddArchive ( const core::string<c16>& archiveName )
if ( s.find ( ".bsp" ) >= 0 )
{
// get level screenshot. reformat texture to 128x128
string<c16> c ( s );
path c ( s );
deletePathFromFilename ( c );
cutFilenameExtension ( c, c );
c = string<c16> ( "levelshots/" ) + c;
c = path ( "levelshots/" ) + c;
dimension2du dim ( 128, 128 );
IVideoDriver * driver = Game->Device->getVideoDriver();
IImage* image = 0;
ITexture *tex = 0;
string<c16> filename;
path filename;
filename = c + ".jpg";
if ( fs->existFile ( filename ) )
@ -1547,7 +1547,7 @@ bool CQuake3EventHandler::OnEvent(const SEvent& eve)
pos.X, pos.Y, pos.Z,
rot.X, rot.Y, rot.Z
);
core::string<c16> filename ( buf );
path filename ( buf );
filename.replace ( '/', '_' );
printf ( "screenshot : %s\n", filename.c_str() );
Game->Device->getVideoDriver()->writeImageToFile(image, filename, 100 );
@ -2082,7 +2082,7 @@ void runGame ( GameData *game )
*/
int IRRCALLCONV main(int argc, char* argv[])
{
core::string<c16> prgname(argv[0]);
path prgname(argv[0]);
GameData game ( deletePathFromPath ( prgname, 1 ) );
// dynamically load irrlicht

View File

@ -0,0 +1,24 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>English</string>
<key>CFBundleExecutable</key>
<string>${EXECUTABLE_NAME}</string>
<key>CFBundleIdentifier</key>
<string>com.irrlicht.${EXECUTABLE_NAME}</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleSignature</key>
<string>IRRL</string>
<key>CFBundleVersion</key>
<string>1.0</string>
<key>NSMainNibFile</key>
<string>MainMenu</string>
<key>NSPrincipalClass</key>
<string>NSApplication</string>
</dict>
</plist>

View File

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<CodeBlocks_workspace_file>
<Workspace title="Build all examples">
<Project filename="01.HelloWorld/HelloWorld.cbp" active="1" />
<Project filename="01.HelloWorld/HelloWorld.cbp" />
<Project filename="02.Quake3Map/Quake3Map.cbp" />
<Project filename="03.CustomSceneNode/CustomSceneNode.cbp" />
<Project filename="04.Movement/Movement.cbp" />
@ -20,7 +20,7 @@
<Project filename="18.SplitScreen/SplitScreen.cbp" />
<Project filename="19.MouseAndJoystick/MouseAndJoystick.cbp" />
<Project filename="20.ManagedLights/ManagedLights.cbp" />
<Project filename="21.Quake3Explorer/Quake3Explorer.cbp" />
<Project filename="21.Quake3Explorer/Quake3Explorer.cbp" active="1" />
<Project filename="Demo/demo.cbp" />
<Project filename="../tools/GUIEditor/GUIEditor_gcc.cbp" />
<Project filename="../tools/MeshConverter/MeshConverter.cbp" />

View File

@ -53,7 +53,7 @@ public:
\param filename The file to open
\return Returns A pointer to the created file on success,
or 0 on failure. */
virtual IReadFile* createAndOpenFile(const core::string<c16>& filename) =0;
virtual IReadFile* createAndOpenFile(const path& filename) =0;
//! Opens a file based on its position.
/** Creates and returns
@ -82,7 +82,7 @@ public:
/** Check based on the file extension (e.g. ".zip")
\param fileName Name of file to check.
\return True if file seems to be loadable. */
virtual bool isALoadableFileFormat(const core::string<c16>& filename) const =0;
virtual bool isALoadableFileFormat(const path& filename) const =0;
//! Check if the file might be loaded by this class
/** This check may look into the file.
@ -99,7 +99,7 @@ public:
//! Creates an archive from the filename
/** \param file File handle to check.
\return Pointer to newly created archive, or 0 upon error. */
virtual IFileArchive* createArchive(const core::string<c16>& filename, bool ignoreCase, bool ignorePaths) const =0;
virtual IFileArchive* createArchive(const path& filename, bool ignoreCase, bool ignorePaths) const =0;
//! Creates an archive from the file
/** \param file File handle to check.

View File

@ -6,7 +6,7 @@
#define __I_FILE_LIST_H_INCLUDED__
#include "IReferenceCounted.h"
#include "irrString.h"
#include "path.h"
namespace irr
{
@ -28,13 +28,13 @@ public:
\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. */
virtual const core::string<c16>& getFileName(u32 index) const = 0;
virtual const io::path& getFileName(u32 index) const = 0;
//! 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. */
virtual const core::string<c16>& getFullFileName(u32 index) const = 0;
virtual const io::path& getFullFileName(u32 index) const = 0;
//! Returns the size of a file in the file list, based on an index.
/** \param index is the zero based index of the file which should be returned.
@ -54,10 +54,10 @@ public:
\param isFolder True if you are searching for a file, false if you want a dir.
\return Returns the index of the file in the file list, or -1 if
no matching name name was found. */
virtual s32 findFile(const core::string<c16>& filename, bool isFolder=false) const = 0;
virtual s32 findFile(const io::path& filename, bool isFolder=false) const = 0;
//! Returns the base path of the file list
virtual const core::string<c16>& getPath() const = 0;
virtual const io::path& getPath() const = 0;
};
} // end namespace irr

View File

@ -38,7 +38,7 @@ public:
\return Returns a pointer to the created file interface.
The returned pointer should be dropped when no longer needed.
See IReferenceCounted::drop() for more information. */
virtual IReadFile* createAndOpenFile(const core::string<c16>& filename) =0;
virtual IReadFile* createAndOpenFile(const path& filename) =0;
//! Creates an IReadFile interface for accessing memory like a file.
/** This allows you to use a pointer to memory where an IReadFile is requested.
@ -51,7 +51,7 @@ public:
The returned pointer should be dropped when no longer needed.
See IReferenceCounted::drop() for more information.
*/
virtual IReadFile* createMemoryReadFile(void* memory, s32 len, const core::string<c16>& fileName, bool deleteMemoryWhenDropped=false) =0;
virtual IReadFile* createMemoryReadFile(void* memory, s32 len, const path& fileName, bool deleteMemoryWhenDropped=false) =0;
//! Creates an IReadFile interface for accessing files inside files.
/** This is useful e.g. for archives.
@ -63,7 +63,7 @@ public:
The returned pointer should be dropped when no longer needed.
See IReferenceCounted::drop() for more information.
*/
virtual IReadFile* createLimitReadFile(const core::string<c16>& fileName,
virtual IReadFile* createLimitReadFile(const path& fileName,
IReadFile* alreadyOpenedFile, long pos, long areaSize) =0;
//! Creates an IWriteFile interface for accessing memory like a file.
@ -78,7 +78,7 @@ public:
The returned pointer should be dropped when no longer needed.
See IReferenceCounted::drop() for more information.
*/
virtual IWriteFile* createMemoryWriteFile(void* memory, s32 len, const core::string<c16>& fileName, bool deleteMemoryWhenDropped=false) =0;
virtual IWriteFile* createMemoryWriteFile(void* memory, s32 len, const path& fileName, bool deleteMemoryWhenDropped=false) =0;
//! Opens a file for write access.
@ -89,7 +89,7 @@ public:
file could not created or opened for writing.
The returned pointer should be dropped when no longer needed.
See IReferenceCounted::drop() for more information. */
virtual IWriteFile* createAndWriteFile(const core::string<c16>& filename, bool append=false) =0;
virtual IWriteFile* createAndWriteFile(const path& filename, bool append=false) =0;
//! Adds an archive to the file system.
/** After calling this, the Irrlicht Engine will also search and open files directly from this archive.
@ -102,15 +102,15 @@ public:
writing all letters in the right case.
\param ignorePaths: If set to true, files in the added archive can be accessed
without its complete path.
\param archiveType: If no specific E_FILE_ARCHIVE_TYPE is selected then the type of archive will depend on
\param archiveType: If no specific E_FILE_ARCHIVE_TYPE is selected then the type of archive will depend on
the extension of the file name. If you use a different extension then you can use this parameter to force
a specific type of archive.
\return Returns true if the archive was added successfully, false if not. */
virtual bool addFileArchive(const core::string<c16>& filename, bool ignoreCase=true, bool ignorePaths=true,
virtual bool addFileArchive(const path& filename, bool ignoreCase=true, bool ignorePaths=true,
E_FILE_ARCHIVE_TYPE archiveType=EFAT_UNKNOWN) =0;
//! Adds an external archive loader to the engine.
/** Use this function to add support for new archive types to the engine, for example propiatrary or
/** Use this function to add support for new archive types to the engine, for example propiatrary or
encyrpted file storage. */
virtual void addArchiveLoader(IArchiveLoader* loader) =0;
@ -119,20 +119,20 @@ public:
//! 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.
been loaded and are now cached, for example textures and meshes.
\param index: The index of the archive to remove
\return Returns true on success, false on failure */
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.
been loaded and are now cached, for example textures and meshes.
\param index: The index of the archive to remove
\return Returns true on success, false on failure */
virtual bool removeFileArchive(const core::string<c16>& filename) =0;
virtual bool removeFileArchive(const path& filename) =0;
//! Changes the search order of attached archives.
/**
/**
\param sourceIndex: The index of the archive to change
\param relative: The relative change in position, archives with a lower index are searched first */
virtual bool moveFileArchive(u32 sourceIndex, s32 relative) =0;
@ -141,7 +141,7 @@ public:
virtual IFileArchive* getFileArchive(u32 index) =0;
//! Adds a zip archive to the file system. Deprecated! This function is provided for compatibility
/** with older versions of Irrlicht and may be removed in future versions, you should use
/** with older versions of Irrlicht and may be removed in future versions, you should use
addFileArchive instead.
After calling this, the Irrlicht Engine will search and open files directly from this archive too.
This is useful for hiding data from the end user, speeding up file access and making it possible to
@ -158,9 +158,9 @@ public:
}
//! Adds an unzipped archive (or basedirectory with subdirectories..) to the file system.
/** Deprecated! This function is provided for compatibility with older versions of Irrlicht
and may be removed in future versions, you should use addFileArchive instead.
Useful for handling data which will be in a zip file
/** Deprecated! This function is provided for compatibility with older versions of Irrlicht
and may be removed in future versions, you should use addFileArchive instead.
Useful for handling data which will be in a zip file
\param filename: Filename of the unzipped zip archive base directory to add to the file system.
\param ignoreCase: If set to true, files in the archive can be accessed without
writing all letters in the right case.
@ -173,7 +173,7 @@ public:
}
//! Adds a pak archive to the file system.
/** Deprecated! This function is provided for compatibility with older versions of Irrlicht
/** Deprecated! This function is provided for compatibility with older versions of Irrlicht
and may be removed in future versions, you should use addFileArchive instead.
After calling this, the Irrlicht Engine will search and open files directly from this archive too.
This is useful for hiding data from the end user, speeding up file access and making it possible to
@ -191,34 +191,34 @@ public:
//! Get the current working directory.
/** \return Current working directory as a string. */
virtual const core::string<c16>& getWorkingDirectory() =0;
virtual const path& getWorkingDirectory() =0;
//! Changes the current working directory.
/** \param newDirectory: A string specifying the new working directory.
The string is operating system dependent. Under Windows it has
the form "<drive>:\<directory>\<sudirectory>\<..>". An example would be: "C:\Windows\"
\return True if successful, otherwise false. */
virtual bool changeWorkingDirectoryTo(const core::string<c16>& newDirectory) =0;
virtual bool changeWorkingDirectoryTo(const path& newDirectory) =0;
//! Converts a relative path to an absolute (unique) path, resolving symbolic links if required
/** \param filename Possibly relative file or directory name to query.
\result Absolute filename which points to the same file. */
virtual core::string<c16> getAbsolutePath(const core::string<c16>& filename) const =0;
virtual path getAbsolutePath(const path& filename) const =0;
//! Returns the directory a file is located in.
/** \param filename: The file to get the directory from.
\return String containing the directory of the file. */
virtual core::string<c16> getFileDir(const core::string<c16>& filename) const =0;
virtual path getFileDir(const path& filename) const =0;
//! Returns the base part of a filename, i.e. the name without the directory part.
/** If no directory is prefixed, the full name is returned.
\param filename: The file to get the basename from
\param keepExtension True if filename with extension is returned otherwise everything
after the final '.' is removed as well. */
virtual core::string<c16> getFileBasename(const core::string<c16>& filename, bool keepExtension=true) const =0;
virtual path getFileBasename(const path& filename, bool keepExtension=true) const =0;
//! flatten a path and file name for example: "/you/me/../." becomes "/you"
virtual core::string<c16>& flattenFilename(core::string<c16>& directory, const core::string<c16>& root="/") const =0;
virtual path& flattenFilename(path& directory, const path& root="/") const =0;
//! Creates a list of files and directories in the current working directory and returns it.
/** \return a Pointer to the created IFileList is returned. After the list has been used
@ -232,7 +232,7 @@ public:
//! Determines if a file exists and could be opened.
/** \param filename is the string identifying the file which should be tested for existence.
\return Returns true if file exists, and false if it does not exist or an error occured. */
virtual bool existFile(const core::string<c16>& filename) const =0;
virtual bool existFile(const path& filename) const =0;
//! Creates a XML Reader from a file which returns all parsed strings as wide characters (wchar_t*).
/** Use createXMLReaderUTF8() if you prefer char* instead of wchar_t*. See IIrrXMLReader for
@ -241,7 +241,7 @@ public:
IXMLReader is returned. After use, the reader
has to be deleted using its IXMLReader::drop() method.
See IReferenceCounted::drop() for more information. */
virtual IXMLReader* createXMLReader(const core::string<c16>& filename) =0;
virtual IXMLReader* createXMLReader(const path& filename) =0;
//! Creates a XML Reader from a file which returns all parsed strings as wide characters (wchar_t*).
/** Use createXMLReaderUTF8() if you prefer char* instead of wchar_t*. See IIrrXMLReader for
@ -259,7 +259,7 @@ public:
IXMLReader is returned. After use, the reader
has to be deleted using its IXMLReaderUTF8::drop() method.
See IReferenceCounted::drop() for more information. */
virtual IXMLReaderUTF8* createXMLReaderUTF8(const core::string<c16>& filename) =0;
virtual IXMLReaderUTF8* createXMLReaderUTF8(const path& filename) =0;
//! Creates a XML Reader from a file which returns all parsed strings as ASCII/UTF-8 characters (char*).
/** Use createXMLReader() if you prefer wchar_t* instead of char*. See IIrrXMLReader for
@ -275,7 +275,7 @@ public:
IXMLWriter is returned. After use, the reader
has to be deleted using its IXMLWriter::drop() method.
See IReferenceCounted::drop() for more information. */
virtual IXMLWriter* createXMLWriter(const core::string<c16>& filename) =0;
virtual IXMLWriter* createXMLWriter(const path& filename) =0;
//! Creates a XML Writer from a file.
/** \return 0, if file could not be opened, otherwise a pointer to the created

View File

@ -7,6 +7,7 @@
#include "IReferenceCounted.h"
#include "SMaterial.h"
#include "path.h"
namespace irr
{
@ -156,10 +157,10 @@ public:
then printed to the error log and can be catched with a custom event
receiver. */
virtual s32 addHighLevelShaderMaterialFromFiles(
const core::string<c16>& vertexShaderProgramFileName,
const io::path& vertexShaderProgramFileName,
const c8* vertexShaderEntryPointName = "main",
E_VERTEX_SHADER_TYPE vsCompileTarget = EVST_VS_1_1,
const core::string<c16>& pixelShaderProgramFileName = "",
const io::path& pixelShaderProgramFileName = "",
const c8* pixelShaderEntryPointName = "main",
E_PIXEL_SHADER_TYPE psCompileTarget = EPST_PS_1_1,
IShaderConstantSetCallBack* callback = 0,
@ -293,8 +294,8 @@ public:
error occured. -1 is returned for example if a vertex or pixel shader
program could not be compiled, the error strings are then printed out
into the error log, and can be catched with a custom event receiver. */
virtual s32 addShaderMaterialFromFiles(const core::string<c16>& vertexShaderProgramFileName,
const core::string<c16>& pixelShaderProgramFileName,
virtual s32 addShaderMaterialFromFiles(const io::path& vertexShaderProgramFileName,
const io::path& pixelShaderProgramFileName,
IShaderConstantSetCallBack* callback = 0,
E_MATERIAL_TYPE baseMaterial = video::EMT_SOLID,
s32 userData = 0) = 0;

View File

@ -11,6 +11,7 @@
#include "EMessageBoxFlags.h"
#include "IEventReceiver.h"
#include "IXMLReader.h"
#include "path.h"
namespace irr
{
@ -162,7 +163,7 @@ public:
\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. */
virtual IGUIFont* getFont(const core::string<c16>& filename) = 0;
virtual IGUIFont* getFont(const io::path& filename) = 0;
//! Returns the default built-in font.
/** \return Pointer to the default built-in font.
@ -175,18 +176,18 @@ public:
\param filename Filename of the sprite bank's origin.
\return Pointer to the sprite bank. Returns 0 if it could not be loaded.
This pointer should not be dropped. See IReferenceCounted::drop() for more information. */
virtual IGUISpriteBank* getSpriteBank(const core::string<c16>& filename) = 0;
virtual IGUISpriteBank* getSpriteBank(const io::path& filename) = 0;
//! Adds an empty sprite bank to the manager
/** \param name Name of the new sprite bank.
\return Pointer to the sprite bank.
This pointer should not be dropped. See IReferenceCounted::drop() for more information. */
virtual IGUISpriteBank* addEmptySpriteBank(const core::string<c16>& name) = 0;
virtual IGUISpriteBank* addEmptySpriteBank(const io::path& name) = 0;
//! Returns the root gui element.
/** This is the first gui element, the (direct or indirect) parent of all
other gui elements. It is a valid IGUIElement, with dimensions the same
size as the screen. You should not need to use this method directly, unless
/** This is the first gui element, the (direct or indirect) parent of all
other gui elements. It is a valid IGUIElement, with dimensions the same
size as the screen. You should not need to use this method directly, unless
you wish to reparent GUI elements to the top level.
\return Pointer to the root element of the GUI. The returned pointer
should not be dropped. See IReferenceCounted::drop() for more
@ -535,7 +536,7 @@ public:
/** \param filename Name of the file.
\param start The GUIElement to start with. Root if 0.
\return True if saving succeeded, else false. */
virtual bool saveGUI(const core::string<c16>& filename, IGUIElement* start=0) = 0;
virtual bool saveGUI(const io::path& filename, IGUIElement* start=0) = 0;
//! Saves the current gui into a file.
/** \param file The file to write to.
@ -547,7 +548,7 @@ public:
/** \param filename Name of the file.
\param parent Parent for the loaded GUI, root if 0.
\return True if loading succeeded, else false. */
virtual bool loadGUI(const c16* filename, IGUIElement* parent=0) = 0;
virtual bool loadGUI(const io::path& filename, IGUIElement* parent=0) = 0;
//! Loads the gui. Note that the current gui is not cleared before.
/** \param file The file to load from.

View File

@ -6,6 +6,7 @@
#define __I_GUI_FILE_OPEN_DIALOG_H_INCLUDED__
#include "IGUIElement.h"
#include "path.h"
namespace irr
{
@ -25,8 +26,7 @@ namespace gui
virtual const wchar_t* getFileName() const = 0;
//! Returns the directory of the selected file. Returns NULL, if no directory was selected.
virtual const core::string<c16>& getDirectoryName() = 0;
virtual const io::path& getDirectoryName() = 0;
};

View File

@ -7,7 +7,7 @@
#include "IReferenceCounted.h"
#include "IImage.h"
#include "irrString.h"
#include "path.h"
namespace irr
{
@ -31,7 +31,7 @@ public:
/** Check is based on the file extension (e.g. ".tga")
\param fileName Name of file to check.
\return True if file seems to be loadable. */
virtual bool isALoadableFileExtension(const core::string<c16>& filename) const = 0;
virtual bool isALoadableFileExtension(const io::path& filename) const = 0;
//! Check if the file might be loaded by this class
/** Check might look into the file.

View File

@ -28,7 +28,7 @@ public:
//! Check if this writer can write a file with the given extension
/** \param fileName Name of the file to check.
\return True if file extension specifies a writable type. */
virtual bool isAWriteableFileExtension(const core::string<c16>& filename) const = 0;
virtual bool isAWriteableFileExtension(const io::path& filename) const = 0;
//! Write image to file
/** \param file File handle to write to.

View File

@ -6,7 +6,7 @@
#define __I_MESH_CACHE_H_INCLUDED__
#include "IReferenceCounted.h"
#include "irrString.h"
#include "path.h"
namespace irr
{
@ -47,7 +47,7 @@ namespace scene
set by this method.
\param mesh Pointer to a mesh which will now be referenced by
this name. */
virtual void addMesh(const core::string<c16>& filename, IAnimatedMesh* mesh) = 0;
virtual void addMesh(const io::path& filename, IAnimatedMesh* mesh) = 0;
//! Removes a mesh from the cache.
/** After loading a mesh with getMesh(), the mesh can be
@ -93,25 +93,25 @@ namespace scene
//! Returns a mesh based on its filename.
/** \param filename Name of the mesh.
\return Pointer to the mesh or 0 if there is none with this number. */
virtual IAnimatedMesh* getMeshByFilename(const core::string<c16>& filename) = 0;
virtual IAnimatedMesh* getMeshByFilename(const io::path& filename) = 0;
//! Get the filename of a loaded mesh, based on its index.
/** \param index: Index of the mesh, number between 0 and getMeshCount()-1.
\return String with name if mesh was found and has a name, else
0. */
virtual const c16* getMeshFilename(u32 index) const = 0;
virtual const io::path& getMeshFilename(u32 index) const = 0;
//! Get the filename of a loaded mesh, if there is any.
/** \param mesh Pointer to mesh to query.
\return String with name if mesh was found and has a name, else
0. */
virtual const c16* getMeshFilename(const IAnimatedMesh* const mesh) const = 0;
virtual const io::path& getMeshFilename(const IAnimatedMesh* const mesh) const = 0;
//! Get the filename of a loaded mesh, if there is any.
/** \param mesh Pointer to mesh to query.
\return String with name if mesh was found and has a name, else
0. */
virtual const c16* getMeshFilename(const IMesh* const mesh) const = 0;
virtual const io::path& getMeshFilename(const IMesh* const mesh) const = 0;
//! Renames a loaded mesh.
/** Note that renaming meshes might change the ordering of the
@ -120,7 +120,7 @@ namespace scene
\param index The index of the mesh in the cache.
\param filename New name for the mesh.
\return True if mesh was renamed. */
virtual bool setMeshFilename(u32 index, const c16* filename) = 0;
virtual bool setMeshFilename(u32 index, const io::path& filename) = 0;
//! Renames a loaded mesh.
/** Note that renaming meshes might change the ordering of the
@ -129,7 +129,7 @@ namespace scene
\param mesh Mesh to be renamed.
\param filename New name for the mesh.
\return True if mesh was renamed. */
virtual bool setMeshFilename(const IAnimatedMesh* const mesh, const c16* filename) = 0;
virtual bool setMeshFilename(const IAnimatedMesh* const mesh, const io::path& filename) = 0;
//! Renames a loaded mesh.
/** Note that renaming meshes might change the ordering of the
@ -138,12 +138,12 @@ namespace scene
\param mesh Mesh to be renamed.
\param filename New name for the mesh.
\return True if mesh was renamed. */
virtual bool setMeshFilename(const IMesh* const mesh, const c16* filename) = 0;
virtual bool setMeshFilename(const IMesh* const mesh, const io::path& filename) = 0;
//! Check if a mesh was already loaded.
/** \param filename Name of the mesh.
\return True if the mesh has been loaded, else false. */
virtual bool isMeshLoaded(const core::string<c16>& filename) = 0;
virtual bool isMeshLoaded(const io::path& filename) = 0;
//! Clears the whole mesh cache, removing all meshes.
/** All meshes will be reloaded completely when using ISceneManager::getMesh()

View File

@ -6,7 +6,7 @@
#define __I_MESH_LOADER_H_INCLUDED__
#include "IReferenceCounted.h"
#include "irrString.h"
#include "path.h"
namespace irr
{
@ -35,7 +35,7 @@ public:
only.
\param fileName Name of the file to test.
\return True if the file might be loaded by this class. */
virtual bool isALoadableFileExtension(const core::string<c16>& filename) const = 0;
virtual bool isALoadableFileExtension(const io::path& filename) const = 0;
//! Creates/loads an animated mesh from the file.
/** \param file File handler to load the file from.

View File

@ -41,15 +41,15 @@ namespace io
//! Get name of file.
/** \return File name as zero terminated character string. */
virtual const core::string<c16>& getFileName() const = 0;
virtual const io::path& getFileName() const = 0;
};
//! Internal function, please do not use.
IReadFile* createReadFile(const core::string<c16>& fileName);
IReadFile* createReadFile(const io::path& fileName);
//! Internal function, please do not use.
IReadFile* createLimitReadFile(const core::string<c16>& fileName, IReadFile* alreadyOpenedFile, long pos, long areaSize);
IReadFile* createLimitReadFile(const io::path& fileName, IReadFile* alreadyOpenedFile, long pos, long areaSize);
//! Internal function, please do not use.
IReadFile* createMemoryReadFile(void* memory, long size, const core::string<c16>& fileName, bool deleteMemoryWhenDropped);
IReadFile* createMemoryReadFile(void* memory, long size, const io::path& fileName, bool deleteMemoryWhenDropped);
} // end namespace io
} // end namespace irr

View File

@ -8,6 +8,7 @@
#include "IReferenceCounted.h"
#include "irrArray.h"
#include "irrString.h"
#include "path.h"
#include "vector3d.h"
#include "dimension2d.h"
#include "SColor.h"
@ -342,7 +343,7 @@ namespace scene
* \return Null if failed, otherwise pointer to the mesh.
* This pointer should not be dropped. See IReferenceCounted::drop() for more information.
**/
virtual IAnimatedMesh* getMesh(const core::string<c16>& filename) = 0;
virtual IAnimatedMesh* getMesh(const io::path& filename) = 0;
//! Get pointer to an animateable mesh. Loads the file if not loaded already.
/** Works just as getMesh(const char* filename). If you want to
@ -777,7 +778,7 @@ namespace scene
not be dropped. See IReferenceCounted::drop() for more
information. */
virtual ITerrainSceneNode* addTerrainSceneNode(
const core::string<c16>& heightMapFileName,
const io::path& heightMapFileName,
ISceneNode* parent=0, s32 id=-1,
const core::vector3df& position = core::vector3df(0.0f,0.0f,0.0f),
const core::vector3df& rotation = core::vector3df(0.0f,0.0f,0.0f),
@ -901,7 +902,7 @@ namespace scene
specified some invalid parameters or that a mesh with that name already
exists. If successful, a pointer to the mesh is returned.
This pointer should not be dropped. See IReferenceCounted::drop() for more information. */
virtual IAnimatedMesh* addHillPlaneMesh(const core::string<c16>& name,
virtual IAnimatedMesh* addHillPlaneMesh(const io::path& name,
const core::dimension2d<f32>& tileSize, const core::dimension2d<u32>& tileCount,
video::SMaterial* material = 0, f32 hillHeight = 0.0f,
const core::dimension2d<f32>& countHills = core::dimension2d<f32>(0.0f, 0.0f),
@ -930,7 +931,7 @@ namespace scene
specified some invalid parameters, that a mesh with that name already
exists, or that a texture could not be found. If successful, a pointer to the mesh is returned.
This pointer should not be dropped. See IReferenceCounted::drop() for more information. */
virtual IAnimatedMesh* addTerrainMesh(const core::string<c16>& meshname,
virtual IAnimatedMesh* addTerrainMesh(const io::path& meshname,
video::IImage* texture, video::IImage* heightmap,
const core::dimension2d<f32>& stretchSize = core::dimension2d<f32>(10.0f,10.0f),
f32 maxHeight=200.0f,
@ -948,7 +949,7 @@ namespace scene
\param width1 Diameter of the cone's base, should be not smaller than the cylinder's diameter
\return Pointer to the arrow mesh if successful, otherwise 0.
This pointer should not be dropped. See IReferenceCounted::drop() for more information. */
virtual IAnimatedMesh* addArrowMesh(const core::string<c16>& name,
virtual IAnimatedMesh* addArrowMesh(const io::path& name,
video::SColor vtxColor0=0xFFFFFFFF,
video::SColor vtxColor1=0xFFFFFFFF,
u32 tesselationCylinder=4, u32 tesselationCone=8,
@ -962,7 +963,7 @@ namespace scene
\param polyCountY Number of quads used for the vertical tiling
\return Pointer to the sphere mesh if successful, otherwise 0.
This pointer should not be dropped. See IReferenceCounted::drop() for more information. */
virtual IAnimatedMesh* addSphereMesh(const core::string<c16>& name,
virtual IAnimatedMesh* addSphereMesh(const io::path& name,
f32 radius=5.f, u32 polyCountX = 16,
u32 polyCountY = 16) = 0;
@ -971,7 +972,7 @@ namespace scene
\return Pointer to the volume light mesh if successful, otherwise 0.
This pointer should not be dropped. See IReferenceCounted::drop() for more information.
*/
virtual IAnimatedMesh* addVolumeLightMesh(const core::string<c16>& name,
virtual IAnimatedMesh* addVolumeLightMesh(const io::path& name,
const u32 SubdivideU = 32, const u32 SubdivideV = 32,
const video::SColor FootColor = video::SColor(51, 0, 230, 180),
const video::SColor TailColor = video::SColor(0, 0, 0, 0)) = 0;
@ -1394,7 +1395,7 @@ namespace scene
file, implement the ISceneUserDataSerializer interface and provide it as parameter here.
Otherwise, simply specify 0 as this parameter.
\return True if successful. */
virtual bool saveScene(const core::string<c16>& filename, ISceneUserDataSerializer* userDataSerializer=0) = 0;
virtual bool saveScene(const io::path& filename, ISceneUserDataSerializer* userDataSerializer=0) = 0;
//! Saves the current scene into a file.
/** Scene nodes with the option isDebugObject set to true are not being saved.
@ -1419,7 +1420,7 @@ namespace scene
as parameter here. Otherwise, simply specify 0 as this
parameter.
\return True if successful. */
virtual bool loadScene(const core::string<c16>& filename, ISceneUserDataSerializer* userDataSerializer=0) = 0;
virtual bool loadScene(const io::path& filename, ISceneUserDataSerializer* userDataSerializer=0) = 0;
//! Loads a scene. Note that the current scene is not cleared before.
/** The scene is usually load from an .irr file, an xml based format. .irr files can

View File

@ -42,9 +42,9 @@ namespace scene
const core::vector3df& rotation = core::vector3df(0,0,0),
const core::vector3df& scale = core::vector3df(1.0f, 1.0f, 1.0f))
: RelativeTranslation(position), RelativeRotation(rotation), RelativeScale(scale),
Parent(0), ID(id), SceneManager(mgr), TriangleSelector(0),
AutomaticCullingState(EAC_BOX), IsVisible(true),
DebugDataVisible(EDS_OFF), IsDebugObject(false)
Parent(0), SceneManager(mgr), TriangleSelector(0), ID(id),
AutomaticCullingState(EAC_BOX), DebugDataVisible(EDS_OFF),
IsVisible(true), IsDebugObject(false)
{
if (parent)
parent->addChild(this);
@ -797,24 +797,24 @@ namespace scene
//! List of all animator nodes
core::list<ISceneNodeAnimator*> Animators;
//! ID of the node.
s32 ID;
//! Pointer to the scene manager
ISceneManager* SceneManager;
//! Pointer to the triangle selector
ITriangleSelector* TriangleSelector;
//! ID of the node.
s32 ID;
//! Automatic culling state
E_CULLING_TYPE AutomaticCullingState;
//! Is the node visible?
bool IsVisible;
//! Flag if debug data should be drawn, such as Bounding Boxes.
s32 DebugDataVisible;
//! Is the node visible?
bool IsVisible;
//! Is debug object?
bool IsDebugObject;
};

View File

@ -9,7 +9,7 @@
#include "IImage.h"
#include "dimension2d.h"
#include "EDriverTypes.h"
#include "irrString.h"
#include "path.h"
#include "matrix4.h"
namespace irr
@ -102,7 +102,7 @@ class ITexture : public virtual IReferenceCounted
public:
//! constructor
ITexture(const core::string<c16>& name) : Name(name)
ITexture(const io::path& name) : Name(name)
{
Name.make_lower();
}
@ -161,7 +161,7 @@ public:
virtual bool hasMipMaps() const { return false; }
//! Returns if the texture has an alpha channel
virtual bool hasAlpha() const {
virtual bool hasAlpha() const {
return getColorFormat () == video::ECF_A8R8G8B8 || getColorFormat () == video::ECF_A1R5G5B5;
}
@ -174,11 +174,11 @@ public:
virtual bool isRenderTarget() const { return false; }
//! Get name of texture (in most cases this is the filename)
const core::string<c16>& getName() const { return Name; }
const io::path& getName() const { return Name; }
protected:
core::string<c16> Name;
io::path Name;
};

View File

@ -292,7 +292,7 @@ namespace video
\return Pointer to the texture, or 0 if the texture
could not be loaded. This pointer should not be dropped. See
IReferenceCounted::drop() for more information. */
virtual ITexture* getTexture(const core::string<c16>& filename) = 0;
virtual ITexture* getTexture(const io::path& filename) = 0;
//! Get access to a named texture.
/** Loads the texture from disk if it is not
@ -322,7 +322,7 @@ namespace video
//! Renames a texture
/** \param texture Pointer to the texture to rename.
\param newName New name for the texture. This should be a unique name. */
virtual void renameTexture(ITexture* texture, const core::string<c16>& newName) = 0;
virtual void renameTexture(ITexture* texture, const io::path& newName) = 0;
//! Creates an empty texture of specified size.
/** \param size: Size of the texture.
@ -335,7 +335,7 @@ namespace video
should not be dropped. See IReferenceCounted::drop() for more
information. */
virtual ITexture* addTexture(const core::dimension2d<u32>& size,
const core::string<c16>& name, ECOLOR_FORMAT format = ECF_A8R8G8B8) = 0;
const io::path& name, ECOLOR_FORMAT format = ECF_A8R8G8B8) = 0;
//! Creates a texture from an IImage.
/** \param name A name for the texture. Later calls of
@ -344,7 +344,7 @@ namespace video
\return Pointer to the newly created texture. This pointer
should not be dropped. See IReferenceCounted::drop() for more
information. */
virtual ITexture* addTexture(const core::string<c16>& name, IImage* image) = 0;
virtual ITexture* addTexture(const io::path& name, IImage* image) = 0;
//! Adds a new render target texture to the texture cache.
/** \param size Size of the texture, in pixels. Width and
@ -357,7 +357,7 @@ namespace video
could not be created. This pointer should not be dropped. See
IReferenceCounted::drop() for more information. */
virtual ITexture* addRenderTargetTexture(const core::dimension2d<u32>& size,
const core::string<c16>& name = "rt", const ECOLOR_FORMAT format = ECF_UNKNOWN) =0;
const io::path& name = "rt", const ECOLOR_FORMAT format = ECF_UNKNOWN) =0;
//! Removes a texture from the texture cache and deletes it.
/** This method can free a lot of memory!
@ -996,7 +996,7 @@ namespace video
\return The created image.
If you no longer need the image, you should call IImage::drop().
See IReferenceCounted::drop() for more information. */
virtual IImage* createImageFromFile(const core::string<c16>& filename) = 0;
virtual IImage* createImageFromFile(const io::path& filename) = 0;
//! Creates a software image from a file.
/** No hardware texture will be created for this image. This
@ -1016,7 +1016,7 @@ namespace video
\param param Control parameter for the backend (e.g. compression
level).
\return True on successful write. */
virtual bool writeImageToFile(IImage* image, const core::string<c16>& filename, u32 param = 0) = 0;
virtual bool writeImageToFile(IImage* image, const io::path& filename, u32 param = 0) = 0;
//! Writes the provided image to a file.
/** Requires that there is a suitable image writer registered
@ -1206,7 +1206,7 @@ namespace video
if it is not currently loaded.
\param filename Name of the texture.
\return Pointer to loaded texture, or 0 if not found. */
virtual video::ITexture* findTexture(const core::string<c16>& filename) = 0;
virtual video::ITexture* findTexture(const io::path& filename) = 0;
//! Set or unset a clipping plane.
/** There are at least 6 clipping planes available for the user

View File

@ -6,7 +6,7 @@
#define __I_WRITE_FILE_H_INCLUDED__
#include "IReferenceCounted.h"
#include "irrString.h"
#include "path.h"
namespace irr
{
@ -37,11 +37,11 @@ namespace io
//! Get name of file.
/** \return File name as zero terminated character string. */
virtual const core::string<c16>& getFileName() const = 0;
virtual const path& getFileName() const = 0;
};
//! Internal function, please do not use.
IWriteFile* createWriteFile(const core::string<c16>& fileName, bool append);
IWriteFile* createWriteFile(const io::path& fileName, bool append);
} // end namespace io
} // end namespace irr

View File

@ -389,9 +389,17 @@ precision will be lower but speed higher. currently X86 only
#define IRRCALLCONV __cdecl
#endif // STDCALL_SUPPORTED
#else // _IRR_WINDOWS_API_
// Force symbol export in shared libraries built with gcc.
#if (__GNUC__ >= 4) && !defined(_IRR_STATIC_LIB_) && defined(IRRLICHT_EXPORTS)
#define IRRLICHT_API __attribute__ ((visibility("default")))
#else
#define IRRLICHT_API
#endif
#define IRRCALLCONV
#endif // _IRR_WINDOWS_API_
// We need to disable DIRECT3D9 support for Visual Studio 6.0 because

View File

@ -99,7 +99,8 @@ namespace video
/** alpha source can be an OR'ed combination of E_ALPHA_SOURCE values. */
inline f32 pack_texureBlendFunc ( const E_BLEND_FACTOR srcFact, const E_BLEND_FACTOR dstFact, const E_MODULATE_FUNC modulate=EMFN_MODULATE_1X, const u32 alphaSource=EAS_TEXTURE )
{
return (f32)((alphaSource << 24) | (modulate << 16) | (srcFact << 8) | dstFact);
const u32 tmp = (alphaSource << 24) | (modulate << 16) | (srcFact << 8) | dstFact;
return *((f32*)&tmp);
}
//! EMT_ONETEXTURE_BLEND: unpack srcFact & dstFact and Modulo to MaterialTypeParam
@ -107,7 +108,7 @@ namespace video
inline void unpack_texureBlendFunc ( E_BLEND_FACTOR &srcFact, E_BLEND_FACTOR &dstFact,
E_MODULATE_FUNC &modulo, u32& alphaSource, const f32 param )
{
const u32 state = (u32)param;
const u32 state = *((u32*)&param);
alphaSource = (state & 0xFF000000) >> 24;
modulo = E_MODULATE_FUNC( ( state & 0x00FF0000 ) >> 16 );
srcFact = E_BLEND_FACTOR ( ( state & 0x0000FF00 ) >> 8 );

View File

@ -120,6 +120,15 @@ namespace scene
const c8* const OBJ_LOADER_IGNORE_GROUPS = "OBJ_IgnoreGroups";
//! Flag to avoid loading material .mtl file for .obj files
/** Use it like this:
\code
SceneManager->getParameters()->setAttribute(scene::OBJ_LOADER_IGNORE_MATERIAL_FILES, true);
\endcode
**/
const c8* const OBJ_LOADER_IGNORE_MATERIAL_FILES = "OBJ_IgnoreMaterialFiles";
//! Flag to ignore the b3d file's mipmapping flag
/** Instead Irrlicht's texture creation flag is used. Use it like this:
\code
@ -134,6 +143,23 @@ namespace scene
deleting scene nodes for example */
const c8* const IRR_SCENE_MANAGER_IS_EDITOR = "IRR_Editor";
//! Name of the parameter for setting the length of debug normals.
/** Use it like this:
\code
SceneManager->getParameters()->setAttribute(scene::DEBUG_NORMAL_LENGTH, 1.5f);
\endcode
**/
const c8* const DEBUG_NORMAL_LENGTH = "DEBUG_Normal_Length";
//! Name of the parameter for setting the color of debug normals.
/** Use it like this:
\code
SceneManager->getParameters()->setAttributeAsColor(scene::DEBUG_NORMAL_COLOR, video::SColor(255, 255, 255, 255));
\endcode
**/
const c8* const DEBUG_NORMAL_COLOR = "DEBUG_Normal_Color";
} // end namespace scene
} // end namespace irr

View File

@ -6,6 +6,7 @@
#define __IRR_CORE_UTIL_H_INCLUDED__
#include "irrString.h"
#include "path.h"
namespace irr
{
@ -19,11 +20,10 @@ namespace core
// ----------- some basic quite often used string functions -----------------
//! search if a filename has a proper extension
inline s32 isFileExtension ( const core::string<c16>& filename,
const core::string<c16>& ext0,
const core::string<c16>& ext1,
const core::string<c16>& ext2
)
inline s32 isFileExtension ( const io::path& filename,
const io::path& ext0,
const io::path& ext1,
const io::path& ext2)
{
s32 extPos = filename.findLast ( '.' );
if ( extPos < 0 )
@ -37,11 +37,10 @@ inline s32 isFileExtension ( const core::string<c16>& filename,
}
//! search if a filename has a proper extension
inline bool hasFileExtension ( const core::string<c16>& filename,
const core::string<c16>& ext0,
const core::string<c16>& ext1 = "",
const core::string<c16>& ext2 = ""
)
inline bool hasFileExtension ( const io::path& filename,
const io::path& ext0,
const io::path& ext1 = "",
const io::path& ext2 = "")
{
return isFileExtension ( filename, ext0, ext1, ext2 ) > 0;
}
@ -112,7 +111,7 @@ inline core::stringc& deletePathFromFilename(core::stringc& filename)
}
//! trim paths
inline core::string<c16>& deletePathFromPath(core::string<c16>& filename, s32 pathCount)
inline io::path& deletePathFromPath(io::path& filename, s32 pathCount)
{
// delete path from filename
s32 i = filename.size();
@ -136,15 +135,9 @@ inline core::string<c16>& deletePathFromPath(core::string<c16>& filename, s32 pa
return filename;
}
//! gets the last char of a string or null
inline c16 lastChar( const core::string<c16>& s)
{
return s.size() ? s [ s.size() - 1 ] : 0;
}
//! looks if file is in the same directory of path. returns offset of directory.
//! 0 means in same directory. 1 means file is direct child of path
inline s32 isInSameDirectory ( const core::string<c16>& path, const core::string<c16>& file )
inline s32 isInSameDirectory ( const io::path& path, const io::path& file )
{
s32 subA = 0;
s32 subB = 0;

View File

@ -23,8 +23,8 @@ so you can assign Unicode to string<c8> and ASCII/Latin-1 to string<wchar_t>
(and the other way round) if you want to.
However, note that the conversation between both is not done using any encoding.
This means that c8 strings are treated as ASCII/Latin-1, not UTF-8, and
are simply expanded to the equivalent wchar_t, while Unicode/wchar_t
This means that c8 strings are treated as ASCII/Latin-1, not UTF-8, and
are simply expanded to the equivalent wchar_t, while Unicode/wchar_t
characters are truncated to 8-bit ASCII/Latin-1 characters, discarding all
other information in the wchar_t.
*/
@ -444,7 +444,7 @@ public:
{
if ( (u32) sourcePos > used )
return false;
u32 i;
for( i=0; array[sourcePos + i] && other[i]; ++i)
if (locale_lower( array[sourcePos + i]) != locale_lower(other[i]))
@ -887,7 +887,7 @@ public:
//! Trims the string.
/** Removes the specified characters (by default, Latin-1 whitespace)
/** Removes the specified characters (by default, Latin-1 whitespace)
from the begining and the end of the string. */
string<T>& trim(const string<T> & whitespace = " \t\n\r")
{
@ -941,6 +941,12 @@ public:
}
}
//! gets the last char of a string or null
inline T lastChar() const
{
return used > 1 ? array[used-2] : 0;
}
private:
//! Reallocate the array, make it bigger or smaller

View File

@ -125,10 +125,10 @@ namespace irr
//! Should the wide character version of the FileSystem be used
#if defined(_IRR_WCHAR_FILESYSTEM)
//! 16 bit character variable. Used for unicode Filesystem and unicode strings
typedef wchar_t c16;
typedef wchar_t fschar_t;
#else
//! 8 bit character variable. Used for ansi Filesystem and non-unicode strings
typedef char c16;
typedef char fschar_t;
#endif
} // end namespace irr

View File

@ -125,6 +125,7 @@
#include "irrMath.h"
#include "irrString.h"
#include "irrTypes.h"
#include "path.h"
#include "irrXML.h"
#include "ISceneCollisionManager.h"
#include "ISceneManager.h"

20
include/path.h Normal file
View File

@ -0,0 +1,20 @@
// Copyright (C) 2002-2009 Nikolaus Gebhardt
// This file is part of the "Irrlicht Engine" and the "irrXML" project.
// For conditions of distribution and use, see copyright notice in irrlicht.h
#ifndef __IRR_PATH_H_INCLUDED__
#define __IRR_PATH_H_INCLUDED__
#include "irrString.h"
namespace irr
{
namespace io
{
typedef core::string<fschar_t> path;
} // io
} // irr
#endif // __IRR_PATH_H_INCLUDED__

View File

@ -1,5 +1,5 @@
==========================================================================
The Irrlicht Engine SDK version 1.5
The Irrlicht Engine SDK version 1.6
==========================================================================
Welcome the Irrlicht Engine SDK.
@ -179,7 +179,9 @@ The Irrlicht Engine SDK version 1.5
Gareth Davidson (bitplane) Developer/ Forum admin
Thomas Alten (burningwater) Wrote the burningsvideo software rasterizer
Luke P. Hoschke (luke) Wrote the b3d loader, the new animation system, VBOs and other things
Colin MacDonald (rogerborg)
Colin MacDonald (rogerborg) All hands person
Michael Zeilfelder (cutealien) GUI and patch expert
Ahmed Hilali (blindside) The shader and advanced effects man
Dean Wadsworth (varmint) OSX port maintainer and game developer
Alvaro F. Celis (afecelis) Lots of work in the community, for example video tutorials about Irrlicht, forum admin
John Goewert (Saigumi) Wrote some tutorials for the Irrlicht Engine and doing admin stuff

View File

@ -11,7 +11,7 @@
# norootforbuild
Name: libIrrlicht1
Version: 1.4.2
Version: 1.6.0
Release: 0.pm.1
Summary: The Irrlicht Engine SDK
License: see readme.txt

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1 @@
<pkgref spec="1.12" uuid="2386F932-20DF-4969-AC74-D8E599723083"><config><identifier>org.irrlichtengine.irrlichtEngineV151.irrlicht.pkg</identifier><version>1</version><description></description><post-install type="none"/><requireAuthorization/><installFrom includeRoot="true">/Library/Frameworks/Irrlicht.framework</installFrom><installTo>/Library/Frameworks</installTo><flags><followSymbolicLinks/></flags><packageStore type="internal"></packageStore><mod>parent</mod><mod>requireAuthorization</mod><mod>extraFiles</mod><mod>version</mod><mod>installTo</mod><mod>identifier</mod></config><contents><file-list>01irrlicht-contents.xml</file-list><component id="org.irrlichtengine.Irrlicht" path="/Library/Frameworks/Irrlicht.framework" version="1.6"><component id="org.irrlichtengine.Irrlicht" path="/Library/Frameworks/Irrlicht.framework/Versions/1.5" version="1.6"/></component><filter>/CVS$</filter><filter>/\.svn$</filter><filter>/\.cvsignore$</filter><filter>/\.cvspass$</filter><filter>/\.DS_Store$</filter></contents><extra-files/></pkgref>

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1 @@
<pkgref spec="1.12" uuid="39601D70-59FA-4C66-9AFF-A8523FAD4C7D"><config><identifier>com.irrlicht.irrlichtEngineV151.html.pkg</identifier><version>1</version><description></description><post-install type="none"/><installFrom relative="true">../../../doctemp/html</installFrom><installTo mod="true">/private/tmp/Irrlicht1.5.1-install/doc/</installTo><flags><followSymbolicLinks/></flags><packageStore type="internal"></packageStore><mod>parent</mod><mod>scripts.postinstall.path</mod><mod>requireAuthorization</mod><mod>installTo.isAbsoluteType</mod><mod>scripts.postinstall.isRelativeType</mod><mod>installFrom.isRelativeType</mod><mod>installTo.path</mod><mod>version</mod><mod>installTo</mod></config><contents><file-list>02html-contents.xml</file-list><filter>/CVS$</filter><filter>/\.svn$</filter><filter>/\.cvsignore$</filter><filter>/\.cvspass$</filter><filter>/\.DS_Store$</filter></contents></pkgref>

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1 @@
<pkgref spec="1.12" uuid="C29A053C-0445-485A-8194-7261BB730C44"><config><identifier>com.irrlicht.irrlichtEngineV151.media.pkg</identifier><version>1</version><description/><post-install type="none"/><requireAuthorization/><installFrom>/Users/gazdavidson/svn/irr1.5/media</installFrom><installTo mod="true">/private/tmp/Irrlicht1.5.1-install/media/</installTo><flags><followSymbolicLinks/></flags><packageStore type="internal"/><mod>parent</mod><mod>installTo.path</mod><mod>installTo</mod></config><contents><file-list>03media-contents.xml</file-list><filter>/CVS$</filter><filter>/\.svn$</filter><filter>/\.cvsignore$</filter><filter>/\.cvspass$</filter><filter>/\.DS_Store$</filter></contents></pkgref>

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1 @@
<pkgref spec="1.12" uuid="90910AF1-E4E6-4A7B-BE2C-D5651EB803FD"><config><identifier>com.irrlicht.irrlichtEngineV151.tools.pkg</identifier><version>1</version><description/><post-install type="none"/><requireAuthorization/><installFrom>/Users/gazdavidson/svn/irr1.5/tools</installFrom><installTo mod="true">/private/tmp/Irrlicht1.5.1-install/tools/</installTo><flags><followSymbolicLinks/></flags><packageStore type="internal"/><mod>parent</mod><mod>installTo.path</mod><mod>installTo</mod></config><contents><file-list>05tools-contents.xml</file-list><filter>/CVS$</filter><filter>/\.svn$</filter><filter>/\.cvsignore$</filter><filter>/\.cvspass$</filter><filter>/\.DS_Store$</filter></contents></pkgref>

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1 @@
<pkg-contents spec="1.12"><f n="changes.txt" o="gazdavidson" g="staff" p="33188" pt="/Users/gazdavidson/svn/irr1.5/changes.txt" m="false" t="file"/></pkg-contents>

View File

@ -0,0 +1 @@
<pkgref spec="1.12" uuid="6023EA57-F1C6-45DA-B563-D72F5E02D7EA"><config><identifier>com.irrlicht.irrlichtEngineV151.changes.pkg</identifier><version>1</version><description/><post-install type="none"/><requireAuthorization/><installFrom>/Users/gazdavidson/svn/irr1.5/changes.txt</installFrom><installTo mod="true">/private/tmp/Irrlicht1.5.1-install/</installTo><flags><followSymbolicLinks/></flags><packageStore type="internal"/><mod>parent</mod><mod>installTo.path</mod><mod>installTo</mod></config><contents><file-list>07changes-contents.xml</file-list><filter>/CVS$</filter><filter>/\.svn$</filter><filter>/\.cvsignore$</filter><filter>/\.cvspass$</filter><filter>/\.DS_Store$</filter></contents></pkgref>

View File

@ -0,0 +1 @@
<pkg-contents spec="1.12"><f n="readme.txt" o="gazdavidson" g="staff" p="33188" pt="/Users/gazdavidson/svn/irr1.5/readme.txt" m="false" t="file"/></pkg-contents>

View File

@ -0,0 +1 @@
<pkgref spec="1.12" uuid="C1B685D8-ECDF-4CE4-A672-82B0F1C0EC80"><config><identifier>com.irrlicht.irrlichtEngineV151.readme.pkg</identifier><version>1</version><description/><post-install type="none"/><requireAuthorization/><installFrom>/Users/gazdavidson/svn/irr1.5/readme.txt</installFrom><installTo mod="true">/private/tmp/Irrlicht1.5.1-install/</installTo><flags><followSymbolicLinks/></flags><packageStore type="internal"/><mod>parent</mod><mod>scripts.postinstall.path</mod><mod>scripts.postupgrade.isRelativeType</mod><mod>scripts.postupgrade.path</mod><mod>installTo.path</mod><mod>installTo</mod></config><scripts><postinstall relative="true" mod="true">moveAll.sh</postinstall><postupgrade relative="true" mod="true">moveAll.sh</postupgrade></scripts><contents><file-list>08readme-contents.xml</file-list><filter>/CVS$</filter><filter>/\.svn$</filter><filter>/\.cvsignore$</filter><filter>/\.cvspass$</filter><filter>/\.DS_Store$</filter></contents></pkgref>

View File

@ -0,0 +1,47 @@
<pkmkdoc spec="1.12"><properties><title>Irrlicht Engine v1.5.1</title><build>/Users/gazdavidson/Desktop/installer/Irrlicht v1.5.1.mpkg</build><organization>com.irrlicht</organization><userSees ui="easy"/><min-target os="2"/><domain system="true"/></properties><distribution><versions min-spec="1.000000"/><scripts></scripts></distribution><contents><choice title="Irrlicht.framework" id="installframework" description="This is required, unless you want to build from source." starts_selected="true" starts_enabled="true" starts_hidden="false"><pkgref id="org.irrlichtengine.irrlichtEngineV151.irrlicht.pkg"/></choice><choice title="Documentation" id="installdocs" description="This will install the documentation" starts_selected="true" starts_enabled="true" starts_hidden="false"><pkgref id="com.irrlicht.irrlichtEngineV151.html.pkg"/></choice><choice title="Example media" id="installmedia" description="The media for the examples, without this the examples will not run." starts_selected="true" starts_enabled="true" starts_hidden="false"><pkgref id="com.irrlicht.irrlichtEngineV151.media.pkg"/></choice><choice title="Examples" id="installexamples" description="The examples, which you'll need if you want to get started." starts_selected="true" starts_enabled="true" starts_hidden="false"><pkgref id="com.irrlicht.irrlichtEngineV151.examples.pkg"/></choice><choice title="Tools" id="installtools" description="Some useful tools; GUI editor, mesh converter and bitmap font generator" starts_selected="true" starts_enabled="true" starts_hidden="false"><pkgref id="com.irrlicht.irrlichtEngineV151.tools.pkg"/></choice><choice title="Source code" id="installsource" description="The complete source code to the Irrlicht Engine, this allows you to make changes to the core and make your own custom versions of Irrlicht." starts_selected="true" starts_enabled="true" starts_hidden="false"><pkgref id="com.irrlicht.irrlichtEngineV151.source.pkg"/></choice><choice title="changes" id="installchangelog" starts_selected="true" starts_enabled="true" starts_hidden="true"><pkgref id="com.irrlicht.irrlichtEngineV151.changes.pkg"/></choice><choice title="readme" id="installreadme" starts_selected="true" starts_enabled="true" starts_hidden="true"><pkgref id="com.irrlicht.irrlichtEngineV151.readme.pkg"/></choice></contents><resources bg-scale="none" bg-align="topleft"><locale lang="en"><resource mime-type="text/rtf" kind="embedded" type="license"><![CDATA[{\rtf1\ansi\ansicpg1252\cocoartf949\cocoasubrtf430
{\fonttbl\f0\fnil\fcharset0 Verdana;}
{\colortbl;\red255\green255\blue255;}
{\*\listtable{\list\listtemplateid1\listhybrid{\listlevel\levelnfc0\levelnfcn0\leveljc2\leveljcn2\levelfollow0\levelstartat1\levelspace360\levelindent0{\*\levelmarker \{decimal\}.}{\leveltext\leveltemplateid0\'02\'05.;}{\levelnumbers\'01;}}{\listname ;}\listid1}}
{\*\listoverridetable{\listoverride\listid1\listoverridecount0\ls1}}
\deftab720
\pard\pardeftab720\sl320\sa220\ql\qnatural
\f0\fs22 \cf0 The Irrlicht Engine License\
Copyright \'a9 2002-2009 Nikolaus Gebhardt\
This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages arising from the use of this software.\
Permission is granted to anyone to use this software for any purpose, including commercial applications, and to alter it and redistribute it freely, subject to the following restrictions:\
\pard\tx220\tx720\pardeftab720\li720\fi-720\sl320\ql\qnatural
\ls1\ilvl0\cf0 {\listtext 1. }The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.\
{\listtext 2. }Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.\
{\listtext 3. }This notice may not be removed or altered from any source distribution.}]]></resource><resource mime-type="text/rtf" kind="embedded" type="readme"><![CDATA[{\rtf1\ansi\ansicpg1252\cocoartf949\cocoasubrtf430
{\fonttbl\f0\fnil\fcharset0 LucidaGrande;}
{\colortbl;\red255\green255\blue255;}
\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\ql\qnatural\pardirnatural
\f0\fs26 \cf0 The Irrlicht Engine is a cross platform, high performance 3D scene graph API for C++ programmers.\
\
This package contains:\
\
* The library runtime. This installs to /Library/Frameworks/Irrlicht.framework and allows you to create and run Irrlicht 3D applications.\
\
* The examples and project files, which will allow you to get started developing Irrlicht applications.\
\
* The documentation, which is also available online at http://irrlicht.sourceforge.net/\
\
* The source to the engine, so that you can modify the engine itself.}]]></resource></locale><locale lang="fr"><resource mime-type="text/rtf" kind="embedded" type="readme"><![CDATA[{\rtf1\ansi\ansicpg1252\cocoartf949\cocoasubrtf430
{\fonttbl\f0\fnil\fcharset0 LucidaGrande;}
{\colortbl;\red255\green255\blue255;}
\deftab720
\pard\pardeftab720\ql\qnatural
\f0\fs24 \cf0 Le moteur Irrlicht est une API de rendu 3D tr\'e8s performante pour les programmeurs C++.\
\
Ce paquet contient:\
\
* La biblioth\'e8que de runtime. Ceci s'installe vers /Library/Frameworks/Irrlicht.framework et vous permet de cr\'e9er et de lancer des applications Irrlicht, notamment en 3d.\
\
* Les exemples et les projets, qui vous permettront de commencer \'e0 d\'e9velopper des applications Irrlicht.\
\
* La documentation, qui est aussi disponible sur http://irrlicht.sourceforge.net/\
\
* Les sources du moteur, afin que vous puissiez modifier le moteur vous-m\'eame.}]]></resource></locale></resources><flags/><extra-files/><item type="file">01irrlicht.xml</item><item type="file">02html.xml</item><item type="file">03media.xml</item><item type="file">04examples.xml</item><item type="file">05tools.xml</item><item type="file">06source.xml</item><item type="file">07changes.xml</item><item type="file">08readme.xml</item><mod>properties.userDomain</mod><mod>properties.systemDomain</mod><mod>properties.anywhereDomain</mod><mod>properties.customizeOption</mod><mod>extraFiles</mod><mod>properties.title</mod></pkmkdoc>

View File

@ -0,0 +1,6 @@
#!/bin/sh
mkdir -p $HOME/Irrlicht1.6.0/
chmod a+rw $HOME/Irrlicht1.6.0
find /private/tmp/Irrlicht1.6.0-install -exec chmod a+rw {} \;
cp -rfp /private/tmp/Irrlicht1.6.0-install/ $HOME/Irrlicht1.6.0/
rm -Rf /private/tmp/Irrlicht1.6.0-install

View File

@ -0,0 +1,28 @@
This is the source package for the Irrlicht framework installer.
Build steps are as follows-
1) Remove the framework so you don't accidentally package more than one version, if you use the GUI to do this empty the trash so XCode doesn't build to the trash! It's best to run this command from the console:
rm -Rf /Library/Frameworks/Irrlicht.framework
2) Build the library and the binaries.
* Navigate to source/Irrlicht/MacOSX and open the XCode project
* Choose release mode and build Irrlicht.framework
** For the moment it's not worth installing the sample binaries, they can't be launched due to console input
3) Build the documentation
* Open the console and navigate to scripts/doc/irrlicht
* Make sure you have doxygen installed. If you have Aptitude for OSX then type:
sudo apt-get install doxygen
* Now run the makedocumentation bash script:
./makedocumentation.sh
4) Now double click the package file and build it.

View File

@ -40,7 +40,7 @@ enum e3DSChunk
C3DS_EDIT_OBJECT = 0x4000,
// sub chunks of C3DS_EDIT_MATERIAL
C3DS_MATNAME = 0xA000,
C3DS_MATNAME = 0xA000,
C3DS_MATAMBIENT = 0xA010,
C3DS_MATDIFFUSE = 0xA020,
C3DS_MATSPECULAR = 0xA030,
@ -153,7 +153,7 @@ C3DSMeshFileLoader::~C3DSMeshFileLoader()
//! returns true if the file maybe is able to be loaded by this class
//! based on the file extension (e.g. ".bsp")
bool C3DSMeshFileLoader::isALoadableFileExtension(const core::string<c16>& filename) const
bool C3DSMeshFileLoader::isALoadableFileExtension(const io::path& filename) const
{
return core::hasFileExtension ( filename, "3ds" );
}
@ -302,7 +302,7 @@ bool C3DSMeshFileLoader::readColorChunk(io::IReadFile* file, ChunkData* chunk,
{
// read 8 bit data
file->read(c, sizeof(c));
out.set(255, c[0], c[1], c[2]);
out.set(255, c[0], c[1], c[2]);
data.read += sizeof(c);
}
break;
@ -316,7 +316,7 @@ bool C3DSMeshFileLoader::readColorChunk(io::IReadFile* file, ChunkData* chunk,
cf[1] = os::Byteswap::byteswap(cf[1]);
cf[2] = os::Byteswap::byteswap(cf[2]);
#endif
out.set(255, (s32)(cf[0]*255.0f), (s32)(cf[1]*255.0f), (s32)(cf[2]*255.0f));
out.set(255, (s32)(cf[0]*255.0f), (s32)(cf[1]*255.0f), (s32)(cf[2]*255.0f));
data.read += sizeof(cf);
}
break;
@ -914,7 +914,7 @@ bool C3DSMeshFileLoader::readObjectChunk(io::IReadFile* file, ChunkData* parent)
readObjectChunk(file, &data);
break;
case C3DS_TRIVERT:
case C3DS_TRIVERT:
readVertices(file, data);
break;
@ -936,12 +936,12 @@ bool C3DSMeshFileLoader::readObjectChunk(io::IReadFile* file, ChunkData* parent)
}
break;
case C3DS_TRIFACE:
case C3DS_TRIFACE:
readIndices(file, data);
readObjectChunk(file, &data); // read smooth and material groups
break;
case C3DS_TRIFACEMAT:
case C3DS_TRIFACEMAT:
readMaterialGroup(file, data);
break;
@ -1066,7 +1066,7 @@ void C3DSMeshFileLoader::composeObject(io::IReadFile* file, const core::stringc&
{
u32 vtxCount = mb->Vertices.size();
if (vtxCount>maxPrimitives)
{
{
IMeshBuffer* tmp = mb;
mb = new SMeshBuffer();
Mesh->addMeshBuffer(mb);
@ -1146,7 +1146,7 @@ void C3DSMeshFileLoader::loadMaterials(io::IReadFile* file)
{
const core::stringc fname = FileSystem->getFileDir(modelFilename) + "/" + FileSystem->getFileBasename(Materials[i].Filename[0]);
if (FileSystem->existFile(fname))
texture = SceneManager->getVideoDriver()->getTexture(fname);
texture = SceneManager->getVideoDriver()->getTexture(fname);
}
if (!texture)
os::Printer::log("Could not load a texture for entry in 3ds file",
@ -1164,7 +1164,7 @@ void C3DSMeshFileLoader::loadMaterials(io::IReadFile* file)
{
const core::stringc fname = FileSystem->getFileDir(modelFilename) + "/" + FileSystem->getFileBasename(Materials[i].Filename[2]);
if (FileSystem->existFile(fname))
texture = SceneManager->getVideoDriver()->getTexture(fname);
texture = SceneManager->getVideoDriver()->getTexture(fname);
}
if (!texture)
{
@ -1187,7 +1187,7 @@ void C3DSMeshFileLoader::loadMaterials(io::IReadFile* file)
{
const core::stringc fname = FileSystem->getFileDir(modelFilename) + "/" + FileSystem->getFileBasename(Materials[i].Filename[3]);
if (FileSystem->existFile(fname))
texture = SceneManager->getVideoDriver()->getTexture(fname);
texture = SceneManager->getVideoDriver()->getTexture(fname);
}
if (!texture)
@ -1212,7 +1212,7 @@ void C3DSMeshFileLoader::loadMaterials(io::IReadFile* file)
{
const core::stringc fname = FileSystem->getFileDir(modelFilename) + "/" + FileSystem->getFileBasename(Materials[i].Filename[4]);
if (FileSystem->existFile(fname))
texture = SceneManager->getVideoDriver()->getTexture(fname);
texture = SceneManager->getVideoDriver()->getTexture(fname);
}
if (!texture)
os::Printer::log("Could not load a texture for entry in 3ds file",

View File

@ -30,7 +30,7 @@ public:
//! returns true if the file maybe is able to be loaded by this class
//! based on the file extension (e.g. ".cob")
virtual bool isALoadableFileExtension(const core::string<c16>& filename) const;
virtual bool isALoadableFileExtension(const io::path& filename) const;
//! creates/loads an animated mesh from the file.
//! \return Pointer to the created mesh. Returns 0 if loading failed.
@ -41,7 +41,7 @@ public:
private:
// byte-align structures
#if defined(_MSC_VER) || defined(__BORLANDC__) || defined (__BCPLUSPLUS__)
#if defined(_MSC_VER) || defined(__BORLANDC__) || defined (__BCPLUSPLUS__)
# pragma pack( push, packing )
# pragma pack( 1 )
# define PACK_STRUCT
@ -58,7 +58,7 @@ private:
} PACK_STRUCT;
// Default alignment
#if defined(_MSC_VER) || defined(__BORLANDC__) || defined (__BCPLUSPLUS__)
#if defined(_MSC_VER) || defined(__BORLANDC__) || defined (__BCPLUSPLUS__)
# pragma pack( pop, packing )
#endif
@ -105,13 +105,13 @@ private:
*this = o;
}
~SMaterialGroup()
{
~SMaterialGroup()
{
clear();
}
void clear()
{
void clear()
{
delete [] faces;
faces = 0;
faceCount = 0;

View File

@ -72,7 +72,6 @@ CAnimatedMeshMD3::CAnimatedMeshMD3()
Mesh = new SMD3Mesh();
setInterpolationShift ( 0, 0 );
}
@ -181,10 +180,10 @@ IMesh* CAnimatedMeshMD3::getMesh(s32 frame, s32 detailLevel, s32 startFrameLoop,
(SMeshBufferLightMap*) MeshIPol.getMeshBuffer(i)
);
}
MeshIPol.recalculateBoundingBox ();
MeshIPol.recalculateBoundingBox();
// build current tags
buildTagArray ( frameA, frameB, iPol );
buildTagArray( frameA, frameB, iPol );
Current = candidate;
return &MeshIPol;

View File

@ -45,9 +45,6 @@ namespace scene
virtual const core::aabbox3d<f32>& getBoundingBox() const;
virtual E_ANIMATED_MESH_TYPE getMeshType() const;
//link?
//! returns amount of mesh buffers.
virtual u32 getMeshBufferCount() const
{
@ -136,4 +133,3 @@ namespace scene
} // end namespace irr
#endif

View File

@ -54,7 +54,7 @@ CAnimatedMeshSceneNode::CAnimatedMeshSceneNode(IAnimatedMesh* mesh,
//! destructor
CAnimatedMeshSceneNode::~CAnimatedMeshSceneNode()
{
if ( MD3Special )
if (MD3Special)
MD3Special->drop ();
if (Mesh)
@ -244,11 +244,11 @@ void CAnimatedMeshSceneNode::OnAnimate(u32 timeMs)
{
buildFrameNr(timeMs-LastTimeMs);
if ( Mesh )
if (Mesh)
{
scene::IMesh * mesh = getMeshForCurrentFrame( true );
if ( mesh )
if (mesh)
Box = mesh->getBoundingBox();
}
LastTimeMs = timeMs;
@ -297,7 +297,7 @@ void CAnimatedMeshSceneNode::render()
if (DebugDataVisible && PassCount==1)
{
// overwrite half transparency
if ( DebugDataVisible & scene::EDS_HALF_TRANSPARENCY )
if (DebugDataVisible & scene::EDS_HALF_TRANSPARENCY)
{
for (u32 i=0; i<m->getMeshBufferCount(); ++i)
@ -318,7 +318,7 @@ void CAnimatedMeshSceneNode::render()
}
// render original meshes
if ( renderMeshes )
if (renderMeshes)
{
for (u32 i=0; i<m->getMeshBufferCount(); ++i)
{
@ -351,49 +351,29 @@ void CAnimatedMeshSceneNode::render()
debug_mat.Lighting = false;
driver->setMaterial(debug_mat);
// show normals
if ( DebugDataVisible & scene::EDS_NORMALS )
if (DebugDataVisible & scene::EDS_NORMALS)
{
IAnimatedMesh * arrow = SceneManager->addArrowMesh (
"__debugnormal", 0xFFECEC00,
0xFF999900, 4, 8, 1.f, 0.6f, 0.05f,
0.3f);
if ( 0 == arrow )
{
arrow = SceneManager->getMesh ( "__debugnormal" );
}
const IMesh *mesh = arrow->getMesh ( 0 );
// find a good scaling factor
core::matrix4 m2;
core::vector3df normalizedNormal;
const f32 DebugNormalLength = SceneManager->getParameters()->getAttributeAsFloat(DEBUG_NORMAL_LENGTH);
const video::SColor DebugNormalColor = SceneManager->getParameters()->getAttributeAsColor(DEBUG_NORMAL_COLOR);
// draw normals
for (u32 g=0; g<m->getMeshBufferCount(); ++g)
for (u32 g=0; g < m->getMeshBufferCount(); ++g)
{
const scene::IMeshBuffer* mb = m->getMeshBuffer(g);
const u32 vSize = video::getVertexPitchFromType(mb->getVertexType());
const video::S3DVertex* v = ( const video::S3DVertex*)mb->getVertices();
for ( u32 i=0; i != mb->getVertexCount(); ++i )
const bool normalize = mb->getMaterial().NormalizeNormals;
for (u32 i=0; i != mb->getVertexCount(); ++i)
{
// Align to v->normal
core::quaternion quatRot( v->Normal.Z, 0.f, -v->Normal.X, 1 + v->Normal.Y );
quatRot.normalize();
quatRot.getMatrix ( m2, v->Pos );
normalizedNormal = v->Normal;
if (normalize)
normalizedNormal.normalize();
if (Mesh->getMeshType() == EAMT_SKINNED)
{
m2 = (AbsoluteTransformation * ((SSkinMeshBuffer*)mb)->Transformation) * m2;
}
else
{
m2 = AbsoluteTransformation * m2;
}
driver->draw3DLine(v->Pos, v->Pos + (normalizedNormal * DebugNormalLength), DebugNormalColor);
driver->setTransform(video::ETS_WORLD, m2 );
for ( u32 a = 0; a != mesh->getMeshBufferCount(); ++a )
driver->drawMeshBuffer ( mesh->getMeshBuffer ( a ) );
v = (const video::S3DVertex*) ( (u8*) v + vSize );
v = (const video::S3DVertex*) ( (u8*) v+vSize );
}
}
driver->setTransform(video::ETS_WORLD, AbsoluteTransformation);
@ -403,11 +383,11 @@ void CAnimatedMeshSceneNode::render()
debug_mat.Lighting = false;
driver->setMaterial(debug_mat);
if ( DebugDataVisible & scene::EDS_BBOX )
if (DebugDataVisible & scene::EDS_BBOX)
driver->draw3DBox(Box, video::SColor(255,255,255,255));
// show bounding box
if ( DebugDataVisible & scene::EDS_BBOX_BUFFERS )
if (DebugDataVisible & scene::EDS_BBOX_BUFFERS)
{
for (u32 g=0; g< m->getMeshBufferCount(); ++g)
@ -422,7 +402,7 @@ void CAnimatedMeshSceneNode::render()
}
// show skeleton
if ( DebugDataVisible & scene::EDS_SKELETON )
if (DebugDataVisible & scene::EDS_SKELETON)
{
if (Mesh->getMeshType() == EAMT_SKINNED)
{
@ -442,7 +422,7 @@ void CAnimatedMeshSceneNode::render()
}
// show tag for quake3 models
if (Mesh->getMeshType() == EAMT_MD3 )
if (Mesh->getMeshType() == EAMT_MD3)
{
IAnimatedMesh * arrow =
SceneManager->addArrowMesh (
@ -450,7 +430,7 @@ void CAnimatedMeshSceneNode::render()
0xFF0000FF, 0xFF000088,
4, 8, 5.f, 4.f, 0.5f,
1.f);
if ( 0 == arrow )
if (!arrow)
{
arrow = SceneManager->getMesh ( "__tag_show" );
}
@ -461,7 +441,7 @@ void CAnimatedMeshSceneNode::render()
SMD3QuaternionTagList *taglist = ((IAnimatedMeshMD3*)Mesh)->getTagList(
(s32)getFrameNr(), 255,
getStartFrame(), getEndFrame());
if ( taglist )
if (taglist)
{
for ( u32 ts = 0; ts != taglist->size(); ++ts )
{
@ -477,7 +457,7 @@ void CAnimatedMeshSceneNode::render()
}
// show mesh
if ( DebugDataVisible & scene::EDS_MESH_WIRE_OVERLAY )
if (DebugDataVisible & scene::EDS_MESH_WIRE_OVERLAY)
{
debug_mat.Lighting = false;
debug_mat.Wireframe = true;
@ -517,7 +497,7 @@ s32 CAnimatedMeshSceneNode::getEndFrame() const
bool CAnimatedMeshSceneNode::setFrameLoop(s32 begin, s32 end)
{
const s32 maxFrameCount = Mesh->getFrameCount() - 1;
if ( end < begin )
if (end < begin)
{
StartFrame = core::s32_clamp(end, 0, maxFrameCount);
EndFrame = core::s32_clamp(begin, StartFrame, maxFrameCount);
@ -557,7 +537,7 @@ const core::aabbox3d<f32>& CAnimatedMeshSceneNode::getBoundingBox() const
//! to directly modify the material of a scene node.
video::SMaterial& CAnimatedMeshSceneNode::getMaterial(u32 i)
{
if ( i >= Materials.size() )
if (i >= Materials.size())
return ISceneNode::getMaterial(i);
return Materials[i];
@ -783,7 +763,7 @@ void CAnimatedMeshSceneNode::serializeAttributes(io::IAttributes* out, io::SAttr
{
IAnimatedMeshSceneNode::serializeAttributes(out, options);
out->addString("Mesh", SceneManager->getMeshCache()->getMeshFilename(Mesh));
out->addString("Mesh", SceneManager->getMeshCache()->getMeshFilename(Mesh).c_str());
out->addBool("Looping", Looping);
out->addBool("ReadOnlyMaterials", ReadOnlyMaterials);
out->addFloat("FramesPerSecond", FramesPerSecond);
@ -797,8 +777,8 @@ void CAnimatedMeshSceneNode::deserializeAttributes(io::IAttributes* in, io::SAtt
{
IAnimatedMeshSceneNode::deserializeAttributes(in, options);
core::string<c16> oldMeshStr = SceneManager->getMeshCache()->getMeshFilename(Mesh);
core::string<c16> newMeshStr = in->getAttributeAsString("Mesh");
io::path oldMeshStr = SceneManager->getMeshCache()->getMeshFilename(Mesh);
io::path newMeshStr = in->getAttributeAsString("Mesh");
Looping = in->getAttributeAsBool("Looping");
ReadOnlyMaterials = in->getAttributeAsBool("ReadOnlyMaterials");
@ -870,25 +850,25 @@ void CAnimatedMeshSceneNode::updateAbsolutePosition()
{
IAnimatedMeshSceneNode::updateAbsolutePosition();
if ( 0 == Mesh || Mesh->getMeshType() != EAMT_MD3 )
if (!Mesh || Mesh->getMeshType() != EAMT_MD3)
return;
SMD3QuaternionTagList *taglist;
taglist = ( (IAnimatedMeshMD3*) Mesh )->getTagList ( (s32)getFrameNr(),255,getStartFrame (),getEndFrame () );
if ( taglist )
if (taglist)
{
if ( 0 == MD3Special )
if (!MD3Special)
{
MD3Special = new SMD3Special ();
MD3Special = new SMD3Special();
}
SMD3QuaternionTag parent ( MD3Special->Tagname );
if ( Parent && Parent->getType () == ESNT_ANIMATED_MESH)
if (Parent && Parent->getType() == ESNT_ANIMATED_MESH)
{
const SMD3QuaternionTag * p = ((IAnimatedMeshSceneNode*) Parent)->getMD3TagTransformation
( MD3Special->Tagname );
if ( p )
if (p)
parent = *p;
}

View File

@ -1194,7 +1194,6 @@ public:
return EAT_COLORF;
}
virtual const wchar_t* getTypeString() const
{
return L"colorf";
@ -1208,7 +1207,9 @@ class CColorAttribute : public CNumbersAttribute
{
public:
CColorAttribute(const char* name, video::SColorf value) : CNumbersAttribute(name, value) {}
CColorAttribute(const char* name, const video::SColorf& value) : CNumbersAttribute(name, value) {}
CColorAttribute(const char* name, const video::SColor& value) : CNumbersAttribute(name, value) {}
virtual s32 getInt()
{
@ -1245,8 +1246,12 @@ public:
virtual void setString(const char* text)
{
u32 c;
sscanf(text, "%08x", &c);
setColor(c);
if (sscanf(text, "%08x", &c)!=1)
{
CNumbersAttribute::setString(text);
}
else
setColor(c);
}
virtual E_ATTRIBUTE_TYPE getType() const

View File

@ -37,7 +37,7 @@ CB3DMeshFileLoader::CB3DMeshFileLoader(scene::ISceneManager* smgr)
//! returns true if the file maybe is able to be loaded by this class
//! based on the file extension (e.g. ".bsp")
bool CB3DMeshFileLoader::isALoadableFileExtension(const core::string<c16>& filename) const
bool CB3DMeshFileLoader::isALoadableFileExtension(const io::path& filename) const
{
return core::hasFileExtension ( filename, "b3d" );
}

View File

@ -32,7 +32,7 @@ public:
//! returns true if the file maybe is able to be loaded by this class
//! based on the file extension (e.g. ".bsp")
virtual bool isALoadableFileExtension(const core::string<c16>& filename) const;
virtual bool isALoadableFileExtension(const io::path& filename) const;
//! creates/loads an animated mesh from the file.
//! \return Pointer to the created mesh. Returns 0 if loading failed.

View File

@ -38,7 +38,7 @@ CBSPMeshFileLoader::~CBSPMeshFileLoader()
//! returns true if the file maybe is able to be loaded by this class
//! based on the file extension (e.g. ".bsp")
bool CBSPMeshFileLoader::isALoadableFileExtension(const core::string<c16>& filename) const
bool CBSPMeshFileLoader::isALoadableFileExtension(const io::path& filename) const
{
return core::hasFileExtension ( filename, "bsp", "shader", "cfg" );
}

View File

@ -29,7 +29,7 @@ public:
//! returns true if the file maybe is able to be loaded by this class
//! based on the file extension (e.g. ".bsp")
virtual bool isALoadableFileExtension(const core::string<c16>& filename) const;
virtual bool isALoadableFileExtension(const io::path& filename) const;
//! creates/loads an animated mesh from the file.
//! \return Pointer to the created mesh. Returns 0 if loading failed.

View File

@ -368,7 +368,7 @@ namespace scene
//! returns true if the file maybe is able to be loaded by this class
//! based on the file extension (e.g. ".bsp")
bool CCSMLoader::isALoadableFileExtension(const core::string<c16>& filename) const
bool CCSMLoader::isALoadableFileExtension(const io::path& filename) const
{
return core::hasFileExtension ( filename, "csm" );
}
@ -407,7 +407,7 @@ namespace scene
scene::IMesh* CCSMLoader::createIrrlichtMesh(const CSMFile* csmFile,
const core::stringc& textureRoot, const core::string<c16>& lmprefix)
const core::stringc& textureRoot, const io::path& lmprefix)
{
scene::SMesh *pMesh = new scene::SMesh();
video::IVideoDriver* driver = SceneManager->getVideoDriver();
@ -416,9 +416,9 @@ namespace scene
{
const LightMap* lmap = csmFile->getLightMapAt(l);
core::string<c16> lmapName = lmprefix;
io::path lmapName = lmprefix;
lmapName += "LMAP_";
lmapName += core::string<c16>(l+1);
lmapName += io::path(l+1);
os::Printer::log("CCSMLoader loading light map", lmapName.c_str());
video::IImage* lmapImg = driver->createImageFromData(
@ -462,9 +462,9 @@ namespace scene
}
//material
core::string<c16> lmapName = lmprefix;
io::path lmapName = lmprefix;
lmapName += "LMAP_";
lmapName += core::string<c16>(surface->getLightMapId());
lmapName += io::path(surface->getLightMapId());
scene::SMeshBufferLightMap *buffer = new scene::SMeshBufferLightMap();
buffer->Material.setTexture(0, texture);

View File

@ -3,9 +3,9 @@
// For conditions of distribution and use, see copyright notice in irrlicht.h
//
// This Loader has been originally written by Saurav Mohapatra. I (Nikolaus Gebhardt)
// modified some minor things and integrated it into Irrlicht 0.9. Thanks a lot
// modified some minor things and integrated it into Irrlicht 0.9. Thanks a lot
// to Saurav Mohapatra for his work on this and that he gave me his permission to
// add it into Irrlicht.
// add it into Irrlicht.
// I did some changes to Saurav Mohapatra's loader, so I'm writing this down here:
// - Replaced all dependencies to STL and stdio with irr:: methods/constructs.
// - Moved everything into namespace irr::scene
@ -20,7 +20,7 @@
//
// The original readme of this file looks like this:
//
// This component provides a loader for the Cartography shop 4.x .csm maps for Irrlicht Engine.
// This component provides a loader for the Cartography shop 4.x .csm maps for Irrlicht Engine.
// This is a part of the M_TRIX Project.
// This is licensed under the ZLib/LibPNG license
// The IrrCSM library is written by Saurav Mohapatra.
@ -59,7 +59,7 @@ namespace scene
//! returns true if the file maybe is able to be loaded by this class
//! based on the file extension (e.g. ".bsp")
virtual bool isALoadableFileExtension(const core::string<c16>& filename) const;
virtual bool isALoadableFileExtension(const io::path& filename) const;
//! creates/loads an animated mesh from the file.
virtual IAnimatedMesh* createMesh(io::IReadFile* file);
@ -69,14 +69,14 @@ namespace scene
scene::IMesh* createCSMMesh(io::IReadFile* file);
scene::IMesh* createIrrlichtMesh(const CSMFile* csmFile,
const core::stringc& textureRoot, const core::string<c16>& lmprefix);
const core::stringc& textureRoot, const io::path& lmprefix);
io::IFileSystem* FileSystem;
scene::ISceneManager* SceneManager;
};
} // end namespace
} // end namespace
} // end namespace
#endif

View File

@ -329,7 +329,7 @@ CColladaFileLoader::~CColladaFileLoader()
//! Returns true if the file maybe is able to be loaded by this class.
/** This decision should be based only on the file extension (e.g. ".cob") */
bool CColladaFileLoader::isALoadableFileExtension(const core::string<c16>& filename) const
bool CColladaFileLoader::isALoadableFileExtension(const io::path& filename) const
{
return core::hasFileExtension ( filename, "xml", "dae" );
}
@ -1805,7 +1805,7 @@ void CColladaFileLoader::readGeometry(io::IXMLReaderUTF8* reader)
amesh->recalculateBoundingBox();
// create virtual file name
core::string<c16> filename = CurrentlyLoadingMesh;
io::path filename = CurrentlyLoadingMesh;
filename += '#';
filename += id;

View File

@ -184,7 +184,7 @@ public:
//! returns true if the file maybe is able to be loaded by this class
//! based on the file extension (e.g. ".cob")
virtual bool isALoadableFileExtension(const core::string<c16>& filename) const;
virtual bool isALoadableFileExtension(const io::path& filename) const;
//! creates/loads an animated mesh from the file.
//! \return Pointer to the created mesh. Returns 0 if loading failed.
@ -341,7 +341,7 @@ private:
core::stringc CurrentlyLoadingMesh;
scene::IAnimatedMesh* FirstLoadedMesh;
core::string<c16> FirstLoadedMeshName;
io::path FirstLoadedMeshName;
s32 LoadedMeshCount;
u32 Version;
bool FlipAxis;

View File

@ -674,7 +674,7 @@ void CD3D8Driver::setMaterial(const SMaterial& material)
//! returns a device dependent texture from a software surface (IImage)
video::ITexture* CD3D8Driver::createDeviceDependentTexture(IImage* surface,const core::string<c16>& name)
video::ITexture* CD3D8Driver::createDeviceDependentTexture(IImage* surface,const io::path& name)
{
return new CD3D8Texture(surface, this, TextureCreationFlags, name);
}
@ -793,7 +793,7 @@ bool CD3D8Driver::setRenderTarget(video::ITexture* texture,
//! Creates a render target texture.
ITexture* CD3D8Driver::addRenderTargetTexture(const core::dimension2d<u32>& size,
const core::string<c16>& name,
const io::path& name,
const ECOLOR_FORMAT format)
{
ITexture* tex = new CD3D8Texture(this, size, name);

View File

@ -196,7 +196,7 @@ namespace video
//! Creates a render target texture.
virtual ITexture* addRenderTargetTexture(const core::dimension2d<u32>& size,
const core::string<c16>& name, const ECOLOR_FORMAT format = ECF_UNKNOWN);
const io::path& name, const ECOLOR_FORMAT format = ECF_UNKNOWN);
//! Clears the ZBuffer.
virtual void clearZBuffer();
@ -254,7 +254,7 @@ namespace video
//! returns a device dependent texture from a software surface (IImage)
//! THIS METHOD HAS TO BE OVERRIDDEN BY DERIVED DRIVERS WITH OWN TEXTURES
virtual video::ITexture* createDeviceDependentTexture(IImage* surface, const core::string<c16>& name);
virtual video::ITexture* createDeviceDependentTexture(IImage* surface, const io::path& name);
// returns the current size of the screen or rendertarget
virtual const core::dimension2d<u32>& getCurrentRenderTargetSize() const;

View File

@ -183,7 +183,7 @@ bool CD3D8ShaderMaterialRenderer::createPixelShader(const c8* pxsh)
#ifdef _IRR_D3D_NO_SHADER_DEBUGGING
// compile shader without debug info
D3DXAssembleShader(pxsh, strlen(pxsh), 0, 0, &code, &errors);
D3DXAssembleShader(pxsh, (UINT)strlen(pxsh), 0, 0, &code, &errors);
#else
@ -246,7 +246,7 @@ bool CD3D8ShaderMaterialRenderer::createVertexShader(const char* vtxsh, E_VERTEX
#ifdef _IRR_D3D_NO_SHADER_DEBUGGING
// compile shader without debug info
D3DXAssembleShader(vtxsh, strlen(vtxsh), 0, 0, &code, &errors);
D3DXAssembleShader(vtxsh, (UINT)strlen(vtxsh), 0, 0, &code, &errors);
#else

View File

@ -31,7 +31,7 @@ namespace video
{
//! rendertarget constructor
CD3D8Texture::CD3D8Texture(CD3D8Driver* driver, const core::dimension2d<u32>& size, const core::string<c16>& name)
CD3D8Texture::CD3D8Texture(CD3D8Driver* driver, const core::dimension2d<u32>& size, const io::path& name)
: ITexture(name), Texture(0), RTTSurface(0), Driver(driver),
TextureSize(size), ImageSize(size), Pitch(0),
HasMipMaps(false), IsRenderTarget(true)
@ -50,7 +50,7 @@ CD3D8Texture::CD3D8Texture(CD3D8Driver* driver, const core::dimension2d<u32>& si
//! constructor
CD3D8Texture::CD3D8Texture(IImage* image, CD3D8Driver* driver,
u32 flags, const core::string<c16>& name)
u32 flags, const io::path& name)
: ITexture(name), Texture(0), RTTSurface(0), Driver(driver),
TextureSize(0,0), ImageSize(0,0), Pitch(0),
HasMipMaps(false), IsRenderTarget(false)

View File

@ -29,10 +29,10 @@ public:
//! constructor
CD3D8Texture(IImage* image, CD3D8Driver* driver,
u32 flags, const core::string<c16>& name);
u32 flags, const io::path& name);
//! rendertarget constructor
CD3D8Texture(CD3D8Driver* driver, const core::dimension2d<u32>& size, const core::string<c16>& name);
CD3D8Texture(CD3D8Driver* driver, const core::dimension2d<u32>& size, const io::path& name);
//! destructor
virtual ~CD3D8Texture();

View File

@ -435,7 +435,7 @@ bool CD3D9Driver::initDriver(const core::dimension2d<u32>& screenSize,
AlphaToCoverageSupport = (pID3D->CheckDeviceFormat(D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL,
D3DFMT_X8R8G8B8, 0,D3DRTYPE_SURFACE,
(D3DFORMAT)MAKEFOURCC('A','2','M','1')) == S_OK);
#endif
#endif
// set the renderstates
setRenderStates3DMode();
@ -714,7 +714,7 @@ void CD3D9Driver::setMaterial(const SMaterial& material)
//! returns a device dependent texture from a software surface (IImage)
video::ITexture* CD3D9Driver::createDeviceDependentTexture(IImage* surface,const core::string<c16>& name)
video::ITexture* CD3D9Driver::createDeviceDependentTexture(IImage* surface,const io::path& name)
{
return new CD3D9Texture(surface, this, TextureCreationFlags, name);
}
@ -1469,19 +1469,23 @@ void CD3D9Driver::draw2DImageBatch(const video::ITexture* texture,
0.0f, 0.0f, 0.0f, color,
tcoords.UpperLeftCorner.X, tcoords.LowerRightCorner.Y));
indices.push_back(0+i*4);
indices.push_back(1+i*4);
indices.push_back(2+i*4);
const u32 curPos = vtx.size()-4;
indices.push_back(0+curPos);
indices.push_back(1+curPos);
indices.push_back(2+curPos);
indices.push_back(0+i*4);
indices.push_back(2+i*4);
indices.push_back(3+i*4);
indices.push_back(0+curPos);
indices.push_back(2+curPos);
indices.push_back(3+curPos);
}
setVertexShader(EVT_STANDARD);
if (vtx.size())
{
setVertexShader(EVT_STANDARD);
pID3DDevice->DrawIndexedPrimitiveUP(D3DPT_TRIANGLELIST, 0, vtx.size(), indices.size() / 3, indices.pointer(),
D3DFMT_INDEX16,vtx.pointer(), sizeof(S3DVertex));
pID3DDevice->DrawIndexedPrimitiveUP(D3DPT_TRIANGLELIST, 0, vtx.size(), indices.size() / 3, indices.pointer(),
D3DFMT_INDEX16,vtx.pointer(), sizeof(S3DVertex));
}
}
@ -1939,7 +1943,7 @@ void CD3D9Driver::setBasicRenderStates(const SMaterial& material, const SMateria
if (queryFeature(EVDF_COLOR_MASK) &&
(resetAllRenderstates || lastmaterial.ColorMask != material.ColorMask))
{
const DWORD flag =
const DWORD flag =
((material.ColorMask & ECP_RED)?D3DCOLORWRITEENABLE_RED:0) |
((material.ColorMask & ECP_GREEN)?D3DCOLORWRITEENABLE_GREEN:0) |
((material.ColorMask & ECP_BLUE)?D3DCOLORWRITEENABLE_BLUE:0) |
@ -1965,7 +1969,7 @@ void CD3D9Driver::setBasicRenderStates(const SMaterial& material, const SMateria
else if (VendorID==0x1002)
pID3DDevice->SetRenderState(D3DRS_POINTSIZE, MAKEFOURCC('A','2','M','0'));
}
// enable antialiasing
if (AntiAliasing)
{
@ -2572,23 +2576,6 @@ bool CD3D9Driver::reset()
HRESULT hr = pID3DDevice->Reset(&present);
// restore screen depthbuffer
pID3DDevice->GetDepthStencilSurface(&(DepthBuffers[0]->Surface));
D3DSURFACE_DESC desc;
DepthBuffers[0]->Surface->GetDesc(&desc);
// restore other depth buffers
for (i=1; i<DepthBuffers.size(); ++i)
{
pID3DDevice->CreateDepthStencilSurface(DepthBuffers[i]->Size.Width,
DepthBuffers[i]->Size.Height,
desc.Format,
desc.MultiSampleType,
desc.MultiSampleQuality,
TRUE,
&(DepthBuffers[i]->Surface),
NULL);
}
// restore RTTs
for (i=0; i<Textures.size(); ++i)
{
@ -2596,6 +2583,37 @@ bool CD3D9Driver::reset()
((CD3D9Texture*)(Textures[i].Surface))->createRenderTarget();
}
// restore screen depthbuffer
pID3DDevice->GetDepthStencilSurface(&(DepthBuffers[0]->Surface));
D3DSURFACE_DESC desc;
// restore other depth buffers
// dpeth format is taken from main depth buffer
DepthBuffers[0]->Surface->GetDesc(&desc);
// multisampling is taken from rendertarget
D3DSURFACE_DESC desc2;
for (i=1; i<DepthBuffers.size(); ++i)
{
for (u32 j=0; j<Textures.size(); ++j)
{
// all textures sharing this depth buffer must have the same setting
// so take first one
if (((CD3D9Texture*)(Textures[j].Surface))->DepthSurface==DepthBuffers[i])
{
((CD3D9Texture*)(Textures[j].Surface))->Texture->GetLevelDesc(0,&desc2);
break;
}
}
pID3DDevice->CreateDepthStencilSurface(DepthBuffers[i]->Size.Width,
DepthBuffers[i]->Size.Height,
desc.Format,
desc2.MultiSampleType,
desc2.MultiSampleQuality,
TRUE,
&(DepthBuffers[i]->Surface),
NULL);
}
if (FAILED(hr))
{
if (hr == D3DERR_DEVICELOST)
@ -2782,7 +2800,7 @@ IVideoDriver* CD3D9Driver::getVideoDriver()
//! Creates a render target texture.
ITexture* CD3D9Driver::addRenderTargetTexture(const core::dimension2d<u32>& size,
const core::string<c16>& name,
const io::path& name,
const ECOLOR_FORMAT format)
{
ITexture* tex = new CD3D9Texture(this, size, name, format);
@ -3040,12 +3058,15 @@ void CD3D9Driver::checkDepthBuffer(ITexture* tex)
{
D3DSURFACE_DESC desc;
DepthBuffers[0]->Surface->GetDesc(&desc);
// the multisampling needs to match the RTT
D3DSURFACE_DESC desc2;
((CD3D9Texture*)tex)->Texture->GetLevelDesc(0,&desc2);
DepthBuffers.push_back(new SDepthSurface());
HRESULT hr=pID3DDevice->CreateDepthStencilSurface(optSize.Width,
optSize.Height,
desc.Format,
desc.MultiSampleType,
desc.MultiSampleQuality,
desc2.MultiSampleType,
desc2.MultiSampleQuality,
TRUE,
&(DepthBuffers.getLast()->Surface),
NULL);

View File

@ -245,7 +245,7 @@ namespace video
//! Creates a render target texture.
virtual ITexture* addRenderTargetTexture(const core::dimension2d<u32>& size,
const core::string<c16>& name, const ECOLOR_FORMAT format = ECF_UNKNOWN);
const io::path& name, const ECOLOR_FORMAT format = ECF_UNKNOWN);
//! Clears the ZBuffer.
virtual void clearZBuffer();
@ -318,7 +318,7 @@ namespace video
//! returns a device dependent texture from a software surface (IImage)
//! THIS METHOD HAS TO BE OVERRIDDEN BY DERIVED DRIVERS WITH OWN TEXTURES
virtual video::ITexture* createDeviceDependentTexture(IImage* surface, const core::string<c16>& name);
virtual video::ITexture* createDeviceDependentTexture(IImage* surface, const io::path& name);
//! returns the current size of the screen or rendertarget
virtual const core::dimension2d<u32>& getCurrentRenderTargetSize() const;

View File

@ -177,7 +177,7 @@ bool CD3D9ShaderMaterialRenderer::createPixelShader(const c8* pxsh)
#ifdef _IRR_D3D_NO_SHADER_DEBUGGING
// compile shader without debug info
stubD3DXAssembleShader(pxsh, strlen(pxsh), 0, 0, 0, &code, &errors);
stubD3DXAssembleShader(pxsh, (UINT)strlen(pxsh), 0, 0, 0, &code, &errors);
#else
// compile shader and emitt some debug informations to
@ -236,7 +236,7 @@ bool CD3D9ShaderMaterialRenderer::createVertexShader(const char* vtxsh)
#ifdef _IRR_D3D_NO_SHADER_DEBUGGING
// compile shader without debug info
stubD3DXAssembleShader(vtxsh, strlen(vtxsh), 0, 0, 0, &code, &errors);
stubD3DXAssembleShader(vtxsh, (UINT)strlen(vtxsh), 0, 0, 0, &code, &errors);
#else

View File

@ -31,7 +31,7 @@ namespace video
//! rendertarget constructor
CD3D9Texture::CD3D9Texture(CD3D9Driver* driver, const core::dimension2d<u32>& size,
const core::string<c16>& name, const ECOLOR_FORMAT format)
const io::path& name, const ECOLOR_FORMAT format)
: ITexture(name), Texture(0), RTTSurface(0), Driver(driver), DepthSurface(0),
TextureSize(size), ImageSize(size), Pitch(0), ColorFormat(ECF_UNKNOWN),
HasMipMaps(false), HardwareMipMaps(false), IsRenderTarget(true)
@ -50,7 +50,7 @@ CD3D9Texture::CD3D9Texture(CD3D9Driver* driver, const core::dimension2d<u32>& si
//! constructor
CD3D9Texture::CD3D9Texture(IImage* image, CD3D9Driver* driver,
u32 flags, const core::string<c16>& name)
u32 flags, const io::path& name)
: ITexture(name), Texture(0), RTTSurface(0), Driver(driver), DepthSurface(0),
TextureSize(0,0), ImageSize(0,0), Pitch(0), ColorFormat(ECF_UNKNOWN),
HasMipMaps(false), HardwareMipMaps(false), IsRenderTarget(false)

View File

@ -29,10 +29,10 @@ public:
//! constructor
CD3D9Texture(IImage* image, CD3D9Driver* driver,
u32 flags, const core::string<c16>& name);
u32 flags, const io::path& name);
//! rendertarget constructor
CD3D9Texture(CD3D9Driver* driver, const core::dimension2d<u32>& size, const core::string<c16>& name,
CD3D9Texture(CD3D9Driver* driver, const core::dimension2d<u32>& size, const io::path& name,
const ECOLOR_FORMAT format = ECF_UNKNOWN);
//! destructor

View File

@ -414,7 +414,7 @@ IAnimatedMesh* CDMFLoader::createMesh(io::IReadFile* file)
/** \brief Tell us if this file is able to be loaded by this class
based on the file extension (e.g. ".bsp")
\return true if file is loadable.*/
bool CDMFLoader::isALoadableFileExtension(const core::string<c16>& filename) const
bool CDMFLoader::isALoadableFileExtension(const io::path& filename) const
{
return core::hasFileExtension ( filename, "dmf" );
}

View File

@ -1,28 +1,28 @@
// Copyright (C) 2002-2009 Nikolaus Gebhardt
// This file is part of the "Irrlicht Engine".
// For conditions of distribution and use, see copyright notice in irrlicht.h
//
//
// This file was originally written by Salvatore Russo.
// I (Nikolaus Gebhardt) did some minor modifications changes to it and integrated
// I (Nikolaus Gebhardt) did some minor modifications changes to it and integrated
// it into Irrlicht:
// - removed STL dependency
// - removed log file and replaced it with irrlicht logging
// - adapted code formatting a bit to Irrlicht style
// - removed memory leaks
// Thanks a lot to Salvatore for his work on this and that he gave me
// his permission to add it into Irrlicht.
// his permission to add it into Irrlicht.
/*
CDMFLoader by Salvatore Russo
Version 1.3
This loader is used to load DMF files in Irrlicht.
Look at the documentation for a sample application.
Parts of this code are from Murphy McCauley COCTLoader just like
GetFaceNormal() or indexes creation routines and a routine to add faces. So
please refer to COCTLoader.h to know more about rights granted.
You can use this software as you wish but you must not remove these notes about license nor
credits to others for parts of this code.
*/
@ -52,14 +52,14 @@ namespace scene
//! returns true if the file maybe is able to be loaded by this class
//! based on the file extension (e.g. ".cob")
virtual bool isALoadableFileExtension(const core::string<c16>& filename) const;
virtual bool isALoadableFileExtension(const io::path& filename) const;
/** creates/loads an animated mesh from the file.
\return Pointer to the created mesh. Returns 0 if loading failed.
If you no longer need the mesh, you should call IAnimatedMesh::drop().
See IReferenceCounted::drop() for more information.*/
virtual IAnimatedMesh* createMesh(io::IReadFile* file);
/** loads dynamic lights present in this scene.
Note that loaded lights from DeleD must have the suffix \b dynamic_ and must be \b pointlight.
Irrlicht correctly loads specular color, diffuse color , position and distance of object affected by light.

View File

@ -70,7 +70,7 @@ ISceneNode* CDefaultSceneNodeFactory::addSceneNode(ESCENE_NODE_TYPE type, IScene
case ESNT_WATER_SURFACE:
return Manager->addWaterSurfaceSceneNode(0, 2.0f, 300.0f, 10.0f, parent);
case ESNT_TERRAIN:
return Manager->addTerrainSceneNode((const c16*)0, parent, -1,
return Manager->addTerrainSceneNode("", parent, -1,
core::vector3df(0.0f,0.0f,0.0f),
core::vector3df(0.0f,0.0f,0.0f),
core::vector3df(1.0f,1.0f,1.0f),
@ -81,11 +81,11 @@ ISceneNode* CDefaultSceneNodeFactory::addSceneNode(ESCENE_NODE_TYPE type, IScene
case ESNT_SKY_DOME:
return Manager->addSkyDomeSceneNode(0, 16, 8, 0.9f, 2.0f, 1000.0f, parent);
case ESNT_SHADOW_VOLUME:
return 0;
return 0;
case ESNT_OCT_TREE:
return Manager->addOctTreeSceneNode((IMesh*)0, parent, -1, 128, true);
case ESNT_MESH:
return Manager->addMeshSceneNode(0, parent, -1, core::vector3df(),
return Manager->addMeshSceneNode(0, parent, -1, core::vector3df(),
core::vector3df(), core::vector3df(1,1,1), true);
case ESNT_LIGHT:
return Manager->addLightSceneNode(parent);
@ -138,7 +138,7 @@ ESCENE_NODE_TYPE CDefaultSceneNodeFactory::getCreateableSceneNodeType(u32 idx) c
}
//! returns type name of a createable scene node type
//! returns type name of a createable scene node type
const c8* CDefaultSceneNodeFactory::getCreateableSceneNodeTypeName(u32 idx) const
{
if (idx<SupportedSceneNodeTypes.size())
@ -148,7 +148,7 @@ const c8* CDefaultSceneNodeFactory::getCreateableSceneNodeTypeName(u32 idx) cons
}
//! returns type name of a createable scene node type
//! returns type name of a createable scene node type
const c8* CDefaultSceneNodeFactory::getCreateableSceneNodeTypeName(ESCENE_NODE_TYPE type) const
{
for (u32 i=0; i<SupportedSceneNodeTypes.size(); ++i)

View File

@ -29,7 +29,6 @@ const core::aabbox3d<f32>& CDummyTransformationSceneNode::getBoundingBox() const
}
//! Returns a reference to the current relative transformation matrix.
//! This is the matrix, this scene node uses instead of scale, translation
//! and rotation.
@ -48,4 +47,3 @@ core::matrix4 CDummyTransformationSceneNode::getRelativeTransformation() const
} // end namespace scene
} // end namespace irr

View File

@ -49,8 +49,10 @@ const core::aabbox3d<f32>& CEmptySceneNode::getBoundingBox() const
//! Creates a clone of this scene node and its children.
ISceneNode* CEmptySceneNode::clone(ISceneNode* newParent, ISceneManager* newManager)
{
if (!newParent) newParent = Parent;
if (!newManager) newManager = SceneManager;
if (!newParent)
newParent = Parent;
if (!newManager)
newManager = SceneManager;
CEmptySceneNode* nb = new CEmptySceneNode(newParent,
newManager, ID);

View File

@ -14,9 +14,9 @@ namespace irr
namespace io
{
static const core::string<c16> emptyFileListEntry;
static const io::path emptyFileListEntry;
CFileList::CFileList(const core::string<c16>& path, bool ignoreCase, bool ignorePaths)
CFileList::CFileList(const io::path& path, bool ignoreCase, bool ignorePaths)
: IgnorePaths(ignorePaths), IgnoreCase(ignoreCase), Path(path)
{
#ifdef _DEBUG
@ -41,7 +41,7 @@ void CFileList::sort()
Files.sort();
}
const core::string<c16>& CFileList::getFileName(u32 index) const
const io::path& CFileList::getFileName(u32 index) const
{
if (index >= Files.size())
return emptyFileListEntry;
@ -51,7 +51,7 @@ const core::string<c16>& CFileList::getFileName(u32 index) const
//! Gets the full name of a file in the list, path included, based on an index.
const core::string<c16>& CFileList::getFullFileName(u32 index) const
const io::path& CFileList::getFullFileName(u32 index) const
{
if (index >= Files.size())
return emptyFileListEntry;
@ -60,7 +60,7 @@ const core::string<c16>& CFileList::getFullFileName(u32 index) const
}
//! adds a file or folder
u32 CFileList::addItem(const core::string<c16>& fullPath, u32 size, bool isDirectory, u32 id)
u32 CFileList::addItem(const io::path& fullPath, u32 size, bool isDirectory, u32 id)
{
SFileListEntry entry;
entry.Size = size;
@ -70,7 +70,7 @@ u32 CFileList::addItem(const core::string<c16>& fullPath, u32 size, bool isDirec
entry.IsDirectory = isDirectory;
// remove trailing slash
if (core::lastChar(entry.Name) == '/')
if (entry.Name.lastChar() == '/')
{
entry.IsDirectory = true;
entry.Name[entry.Name.size()-1] = 0;
@ -112,7 +112,7 @@ u32 CFileList::getFileSize(u32 index) const
//! Searches for a file or folder within the list, returns the index
s32 CFileList::findFile(const core::string<c16>& filename, bool isDirectory = false) const
s32 CFileList::findFile(const io::path& filename, bool isDirectory = false) const
{
SFileListEntry entry;
entry.FullName = filename;
@ -122,7 +122,7 @@ s32 CFileList::findFile(const core::string<c16>& filename, bool isDirectory = fa
entry.FullName.replace('\\', '/');
// remove trailing slash
if (core::lastChar(entry.Name) == '/')
if (entry.Name.lastChar() == '/')
{
entry.IsDirectory = true;
entry.Name[ entry.Name.size()-1] = 0;
@ -139,7 +139,7 @@ s32 CFileList::findFile(const core::string<c16>& filename, bool isDirectory = fa
}
//! Returns the base path of the file list
const core::string<c16>& CFileList::getPath() const
const io::path& CFileList::getPath() const
{
return Path;
}

View File

@ -21,12 +21,12 @@ struct SFileListEntry
//! The name of the file
/** If this is a file or folder in the virtual filesystem and the archive
was created with the ignoreCase flag then the file name will be lower case. */
core::string<c16> Name;
io::path Name;
//! The name of the file including the path
/** If this is a file or folder in the virtual filesystem and the archive was
created with the ignoreDirs flag then it will be the same as Name. */
core::string<c16> FullName;
io::path FullName;
//! The size of the file in bytes
u32 Size;
@ -68,7 +68,7 @@ public:
//! Constructor
/** \param path The path of this file archive */
CFileList(const core::string<c16>& path, bool ignoreCase, bool ignorePaths);
CFileList(const io::path& path, bool ignoreCase, bool ignorePaths);
//! Destructor
virtual ~CFileList();
@ -78,7 +78,7 @@ public:
\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 core::string<c16>& fullPath, u32 size, bool isDirectory, u32 id=0);
virtual u32 addItem(const io::path& fullPath, u32 size, bool isDirectory, u32 id=0);
//! Sorts the file list
void sort();
@ -89,10 +89,10 @@ public:
virtual u32 getFileCount() const;
//! Gets the name of a file in the list, based on an index.
virtual const core::string<c16>& getFileName(u32 index) const;
virtual const io::path& getFileName(u32 index) const;
//! Gets the full name of a file in the list, path included, based on an index.
virtual const core::string<c16>& getFullFileName(u32 index) const;
virtual const io::path& getFullFileName(u32 index) const;
//! Returns true if the file is a directory
virtual bool isDirectory(u32 index) const;
@ -101,10 +101,10 @@ public:
virtual u32 getFileSize(u32 index) const;
//! Searches for a file or folder within the list, returns the index
virtual s32 findFile(const core::string<c16>& filename, bool isFolder) const;
virtual s32 findFile(const io::path& filename, bool isFolder) const;
//! Returns the base path of the file list
virtual const core::string<c16>& getPath() const;
virtual const io::path& getPath() const;
protected:
@ -115,7 +115,7 @@ protected:
bool IgnoreCase;
//! Path to the file list
core::string<c16> Path;
io::path Path;
//! List of files
core::array<SFileListEntry> Files;

View File

@ -91,7 +91,7 @@ CFileSystem::~CFileSystem()
//! opens a file for read access
IReadFile* CFileSystem::createAndOpenFile(const core::string<c16>& filename)
IReadFile* CFileSystem::createAndOpenFile(const io::path& filename)
{
IReadFile* file = 0;
u32 i;
@ -111,7 +111,7 @@ IReadFile* CFileSystem::createAndOpenFile(const core::string<c16>& filename)
//! Creates an IReadFile interface for treating memory like a file.
IReadFile* CFileSystem::createMemoryReadFile(void* memory, s32 len,
const core::string<c16>& fileName, bool deleteMemoryWhenDropped)
const io::path& fileName, bool deleteMemoryWhenDropped)
{
if (!memory)
return 0;
@ -121,7 +121,7 @@ IReadFile* CFileSystem::createMemoryReadFile(void* memory, s32 len,
//! Creates an IReadFile interface for reading files inside files
IReadFile* CFileSystem::createLimitReadFile(const core::string<c16>& fileName,
IReadFile* CFileSystem::createLimitReadFile(const io::path& fileName,
IReadFile* alreadyOpenedFile, long pos, long areaSize)
{
if (!alreadyOpenedFile)
@ -133,7 +133,7 @@ IReadFile* CFileSystem::createLimitReadFile(const core::string<c16>& fileName,
//! Creates an IReadFile interface for treating memory like a file.
IWriteFile* CFileSystem::createMemoryWriteFile(void* memory, s32 len,
const core::string<c16>& fileName, bool deleteMemoryWhenDropped)
const io::path& fileName, bool deleteMemoryWhenDropped)
{
if (!memory)
return 0;
@ -143,7 +143,7 @@ IWriteFile* CFileSystem::createMemoryWriteFile(void* memory, s32 len,
//! Opens a file for write access.
IWriteFile* CFileSystem::createAndWriteFile(const core::string<c16>& filename, bool append)
IWriteFile* CFileSystem::createAndWriteFile(const io::path& filename, bool append)
{
return createWriteFile(filename, append);
}
@ -184,7 +184,7 @@ bool CFileSystem::moveFileArchive(u32 sourceIndex, s32 relative)
//! Adds an archive to the file system.
bool CFileSystem::addFileArchive(const core::string<c16>& filename, bool ignoreCase,
bool CFileSystem::addFileArchive(const io::path& filename, bool ignoreCase,
bool ignorePaths, E_FILE_ARCHIVE_TYPE archiveType)
{
IFileArchive* archive = 0;
@ -304,7 +304,7 @@ bool CFileSystem::removeFileArchive(u32 index)
//! removes an archive from the file system.
bool CFileSystem::removeFileArchive(const core::string<c16>& filename)
bool CFileSystem::removeFileArchive(const io::path& filename)
{
for (u32 i=0; i < FileArchives.size(); ++i)
{
@ -330,7 +330,7 @@ IFileArchive* CFileSystem::getFileArchive(u32 index)
//! Returns the string of the current working directory
const core::string<c16>& CFileSystem::getWorkingDirectory()
const io::path& CFileSystem::getWorkingDirectory()
{
EFileSystemType type = FileSystemType;
@ -345,7 +345,7 @@ const core::string<c16>& CFileSystem::getWorkingDirectory()
#elif defined(_IRR_WINDOWS_API_)
#if defined(_IRR_WCHAR_FILESYSTEM )
wchar_t tmp[_MAX_PATH];
_wgetcwd(tmp, FILE_SYSTEM_MAX_PATH);
_wgetcwd(tmp, _MAX_PATH);
#else
c8 tmp[_MAX_PATH];
_getcwd(tmp, _MAX_PATH);
@ -398,7 +398,7 @@ const core::string<c16>& CFileSystem::getWorkingDirectory()
//! Changes the current Working Directory to the given string.
bool CFileSystem::changeWorkingDirectoryTo(const core::string<c16>& newDirectory)
bool CFileSystem::changeWorkingDirectoryTo(const io::path& newDirectory)
{
bool success=false;
@ -429,9 +429,9 @@ bool CFileSystem::changeWorkingDirectoryTo(const core::string<c16>& newDirectory
}
core::string<c16> CFileSystem::getAbsolutePath(const core::string<c16>& filename) const
io::path CFileSystem::getAbsolutePath(const io::path& filename) const
{
c16 *p=0;
fschar_t *p=0;
#if defined(_IRR_WINDOWS_CE_PLATFORM_)
return filename;
@ -461,19 +461,19 @@ core::string<c16> CFileSystem::getAbsolutePath(const core::string<c16>& filename
return filename;
}
else
return core::string<c16>(fpath);
return io::path(fpath);
}
#endif
return core::string<c16>(p);
return io::path(p);
}
//! returns the directory part of a filename, i.e. all until the first
//! slash or backslash, excluding it. If no directory path is prefixed, a '.'
//! is returned.
core::string<c16> CFileSystem::getFileDir(const core::string<c16>& filename) const
io::path CFileSystem::getFileDir(const io::path& filename) const
{
// find last forward or backslash
s32 lastSlash = filename.findLast('/');
@ -489,7 +489,7 @@ core::string<c16> CFileSystem::getFileDir(const core::string<c16>& filename) con
//! returns the base part of a filename, i.e. all except for the directory
//! part. If no directory path is prefixed, the full name is returned.
core::string<c16> CFileSystem::getFileBasename(const core::string<c16>& filename, bool keepExtension) const
io::path CFileSystem::getFileBasename(const io::path& filename, bool keepExtension) const
{
// find last forward or backslash
s32 lastSlash = filename.findLast('/');
@ -519,14 +519,14 @@ core::string<c16> CFileSystem::getFileBasename(const core::string<c16>& filename
//! flaten a path and file name for example: "/you/me/../." becomes "/you"
core::string<c16>& CFileSystem::flattenFilename(core::string<c16>& directory, const core::string<c16>& root) const
io::path& CFileSystem::flattenFilename(io::path& directory, const io::path& root) const
{
directory.replace('\\', '/');
if (lastChar(directory) != '/')
if (directory.lastChar() != '/')
directory.append('/');
core::string<c16> dir;
core::string<c16> subdir;
io::path dir;
io::path subdir;
s32 lastpos = 0;
s32 pos = 0;
@ -568,15 +568,15 @@ EFileSystemType CFileSystem::setFileListSystem(EFileSystemType listType)
IFileList* CFileSystem::createFileList()
{
CFileList* r = 0;
core::string<c16> Path = getWorkingDirectory();
io::path Path = getWorkingDirectory();
Path.replace('\\', '/');
if (lastChar(Path) != '/')
if (Path.lastChar() != '/')
Path.append('/');
//! Construct from native filesystem
if (FileSystemType == FILESYSTEM_NATIVE)
{
core::string<c16> fullPath;
io::path fullPath;
// --------------------------------------------
//! Windows version
#ifdef _IRR_WINDOWS_API_
@ -676,7 +676,7 @@ IFileList* CFileSystem::createFileList()
{
if (core::isInSameDirectory(Path, merge->getFullFileName(j)) == 0)
{
core::string<c16> fullPath = merge->getFullFileName(j);
io::path fullPath = merge->getFullFileName(j);
r->addItem(fullPath, merge->getFileSize(j), merge->isDirectory(j), 0);
}
}
@ -690,7 +690,7 @@ IFileList* CFileSystem::createFileList()
}
//! determines if a file exists and would be able to be opened.
bool CFileSystem::existFile(const core::string<c16>& filename) const
bool CFileSystem::existFile(const io::path& filename) const
{
for (u32 i=0; i < FileArchives.size(); ++i)
if (FileArchives[i]->getFileList()->findFile(filename)!=-1)
@ -708,7 +708,7 @@ bool CFileSystem::existFile(const core::string<c16>& filename) const
//! Creates a XML Reader from a file.
IXMLReader* CFileSystem::createXMLReader(const core::string<c16>& filename)
IXMLReader* CFileSystem::createXMLReader(const io::path& filename)
{
IReadFile* file = createAndOpenFile(filename);
if (!file)
@ -731,7 +731,7 @@ IXMLReader* CFileSystem::createXMLReader(IReadFile* file)
//! Creates a XML Reader from a file.
IXMLReaderUTF8* CFileSystem::createXMLReaderUTF8(const core::string<c16>& filename)
IXMLReaderUTF8* CFileSystem::createXMLReaderUTF8(const io::path& filename)
{
IReadFile* file = createAndOpenFile(filename);
if (!file)
@ -754,7 +754,7 @@ IXMLReaderUTF8* CFileSystem::createXMLReaderUTF8(IReadFile* file)
//! Creates a XML Writer from a file.
IXMLWriter* CFileSystem::createXMLWriter(const core::string<c16>& filename)
IXMLWriter* CFileSystem::createXMLWriter(const io::path& filename)
{
IWriteFile* file = createAndWriteFile(filename);
IXMLWriter* writer = createXMLWriter(file);

View File

@ -31,22 +31,22 @@ public:
virtual ~CFileSystem();
//! opens a file for read access
virtual IReadFile* createAndOpenFile(const core::string<c16>& filename);
virtual IReadFile* createAndOpenFile(const io::path& filename);
//! Creates an IReadFile interface for accessing memory like a file.
virtual IReadFile* createMemoryReadFile(void* memory, s32 len, const core::string<c16>& fileName, bool deleteMemoryWhenDropped = false);
virtual IReadFile* createMemoryReadFile(void* memory, s32 len, const io::path& fileName, bool deleteMemoryWhenDropped = false);
//! Creates an IReadFile interface for accessing files inside files
virtual IReadFile* createLimitReadFile(const core::string<c16>& fileName, IReadFile* alreadyOpenedFile, long pos, long areaSize);
virtual IReadFile* createLimitReadFile(const io::path& fileName, IReadFile* alreadyOpenedFile, long pos, long areaSize);
//! Creates an IWriteFile interface for accessing memory like a file.
virtual IWriteFile* createMemoryWriteFile(void* memory, s32 len, const core::string<c16>& fileName, bool deleteMemoryWhenDropped=false);
virtual IWriteFile* createMemoryWriteFile(void* memory, s32 len, const io::path& fileName, bool deleteMemoryWhenDropped=false);
//! Opens a file for write access.
virtual IWriteFile* createAndWriteFile(const core::string<c16>& filename, bool append=false);
virtual IWriteFile* createAndWriteFile(const io::path& filename, bool append=false);
//! Adds an archive to the file system.
virtual bool addFileArchive(const core::string<c16>& filename, bool ignoreCase = true,
virtual bool addFileArchive(const io::path& filename, bool ignoreCase = true,
bool ignorePaths = true, E_FILE_ARCHIVE_TYPE archiveType = EFAT_UNKNOWN);
//! move the hirarchy of the filesystem. moves sourceIndex relative up or down
@ -65,30 +65,30 @@ public:
virtual bool removeFileArchive(u32 index);
//! removes an archive from the file system.
virtual bool removeFileArchive(const core::string<c16>& filename);
virtual bool removeFileArchive(const io::path& filename);
//! Returns the string of the current working directory
virtual const core::string<c16>& getWorkingDirectory();
virtual const io::path& getWorkingDirectory();
//! Changes the current Working Directory to the string given.
//! The string is operating system dependent. Under Windows it will look
//! like this: "drive:\directory\sudirectory\"
virtual bool changeWorkingDirectoryTo(const core::string<c16>& newDirectory);
virtual bool changeWorkingDirectoryTo(const io::path& newDirectory);
//! Converts a relative path to an absolute (unique) path, resolving symbolic links
virtual core::string<c16> getAbsolutePath(const core::string<c16>& filename) const;
virtual io::path getAbsolutePath(const io::path& filename) const;
//! Returns the directory a file is located in.
/** \param filename: The file to get the directory from */
virtual core::string<c16> getFileDir(const core::string<c16>& filename) const;
virtual io::path getFileDir(const io::path& filename) const;
//! Returns the base part of a filename, i.e. the name without the directory
//! part. If no directory is prefixed, the full name is returned.
/** \param filename: The file to get the basename from */
virtual core::string<c16> getFileBasename(const core::string<c16>& filename, bool keepExtension=true) const;
virtual io::path getFileBasename(const io::path& filename, bool keepExtension=true) const;
//! flatten a path and file name for example: "/you/me/../." becomes "/you"
virtual core::string<c16>& flattenFilename( core::string<c16>& directory, const core::string<c16>& root = "/" ) const;
virtual io::path& flattenFilename( io::path& directory, const io::path& root = "/" ) const;
virtual EFileSystemType setFileListSystem(EFileSystemType listType);
@ -97,22 +97,22 @@ public:
virtual IFileList* createFileList();
//! determines if a file exists and would be able to be opened.
virtual bool existFile(const core::string<c16>& filename) const;
virtual bool existFile(const io::path& filename) const;
//! Creates a XML Reader from a file.
virtual IXMLReader* createXMLReader(const core::string<c16>& filename);
virtual IXMLReader* createXMLReader(const io::path& filename);
//! Creates a XML Reader from a file.
virtual IXMLReader* createXMLReader(IReadFile* file);
//! Creates a XML Reader from a file.
virtual IXMLReaderUTF8* createXMLReaderUTF8(const core::string<c16>& filename);
virtual IXMLReaderUTF8* createXMLReaderUTF8(const io::path& filename);
//! Creates a XML Reader from a file.
virtual IXMLReaderUTF8* createXMLReaderUTF8(IReadFile* file);
//! Creates a XML Writer from a file.
virtual IXMLWriter* createXMLWriter(const core::string<c16>& filename);
virtual IXMLWriter* createXMLWriter(const io::path& filename);
//! Creates a XML Writer from a file.
virtual IXMLWriter* createXMLWriter(IWriteFile* file);
@ -125,7 +125,7 @@ private:
//! Currently used FileSystemType
EFileSystemType FileSystemType;
//! WorkingDirectory for Native and Virtual filesystems
core::string<c16> WorkingDirectory [2];
io::path WorkingDirectory [2];
//! currently attached ArchiveLoaders
core::array<IArchiveLoader*> ArchiveLoader;
//! currently attached Archives

View File

@ -158,7 +158,7 @@ CGUIEnvironment::~CGUIEnvironment()
void CGUIEnvironment::loadBuiltInFont()
{
core::string<c16> filename = "#DefaultFont";
io::path filename = "#DefaultFont";
io::IReadFile* file = io::createMemoryReadFile(BuiltInFontData, BuiltInFontDataSize, filename, false);
@ -660,7 +660,7 @@ IGUIElement* CGUIEnvironment::addGUIElement(const c8* elementName, IGUIElement*
//! Saves the current gui into a file.
//! \param filename: Name of the file .
bool CGUIEnvironment::saveGUI(const core::string<c16>& filename, IGUIElement* start)
bool CGUIEnvironment::saveGUI(const io::path& filename, IGUIElement* start)
{
io::IWriteFile* file = FileSystem->createAndWriteFile(filename);
if (!file)
@ -702,7 +702,7 @@ bool CGUIEnvironment::saveGUI(io::IWriteFile* file, IGUIElement* start)
//! Loads the gui. Note that the current gui is not cleared before.
//! \param filename: Name of the file.
bool CGUIEnvironment::loadGUI(const c16* filename, IGUIElement* parent)
bool CGUIEnvironment::loadGUI(const io::path& filename, IGUIElement* parent)
{
io::IReadFile* read = FileSystem->createAndOpenFile(filename);
if (!read)
@ -1117,7 +1117,7 @@ IGUIListBox* CGUIEnvironment::addListBox(const core::rect<s32>& rectangle,
}
//! adds a tree view
IGUITreeView* CGUIEnvironment::addTreeView(const core::rect<s32>& rectangle,
IGUITreeView* CGUIEnvironment::addTreeView(const core::rect<s32>& rectangle,
IGUIElement* parent, s32 id,
bool drawBackground,
bool scrollBarVertical, bool scrollBarHorizontal)
@ -1305,7 +1305,7 @@ IGUIComboBox* CGUIEnvironment::addComboBox(const core::rect<s32>& rectangle,
//! returns the font
IGUIFont* CGUIEnvironment::getFont(const core::string<c16>& filename)
IGUIFont* CGUIEnvironment::getFont(const io::path& filename)
{
// search existing font
@ -1362,7 +1362,7 @@ IGUIFont* CGUIEnvironment::getFont(const core::string<c16>& filename)
CGUIFont* font = new CGUIFont(this, filename);
ifont = (IGUIFont*)font;
// change working directory, for loading textures
core::string<c16> workingDir = FileSystem->getWorkingDirectory();
io::path workingDir = FileSystem->getWorkingDirectory();
FileSystem->changeWorkingDirectoryTo(FileSystem->getFileDir(f.Filename));
// load the font
@ -1409,7 +1409,7 @@ IGUIFont* CGUIEnvironment::getFont(const core::string<c16>& filename)
}
IGUISpriteBank* CGUIEnvironment::getSpriteBank(const core::string<c16>& filename)
IGUISpriteBank* CGUIEnvironment::getSpriteBank(const io::path& filename)
{
// search for the file name
@ -1435,7 +1435,7 @@ IGUISpriteBank* CGUIEnvironment::getSpriteBank(const core::string<c16>& filename
}
IGUISpriteBank* CGUIEnvironment::addEmptySpriteBank(const core::string<c16>& name)
IGUISpriteBank* CGUIEnvironment::addEmptySpriteBank(const io::path& name)
{
// no duplicate names allowed
@ -1466,7 +1466,7 @@ IGUIFont* CGUIEnvironment::getBuiltInFont() const
}
//! Creates the image list from the given texture.
IGUIImageList* CGUIEnvironment::createImageList( video::ITexture* texture,
IGUIImageList* CGUIEnvironment::createImageList( video::ITexture* texture,
core::dimension2d<s32> imageSize, bool useAlphaChannel )
{
CGUIImageList* imageList = new CGUIImageList( Driver );
@ -1479,7 +1479,7 @@ IGUIImageList* CGUIEnvironment::createImageList( video::ITexture* texture,
return imageList;
}
//! Returns the root gui element.
//! Returns the root gui element.
IGUIElement* CGUIEnvironment::getRootGUIElement()
{
return this;

View File

@ -75,14 +75,14 @@ public:
core::dimension2d<s32> imageSize, bool useAlphaChannel );
//! returns the font
virtual IGUIFont* getFont(const core::string<c16>& filename);
virtual IGUIFont* getFont(const io::path& filename);
//! returns the sprite bank
virtual IGUISpriteBank* getSpriteBank(const core::string<c16>& filename);
virtual IGUISpriteBank* getSpriteBank(const io::path& filename);
//! returns the sprite bank
virtual IGUISpriteBank* addEmptySpriteBank(const core::string<c16>& name);
virtual IGUISpriteBank* addEmptySpriteBank(const io::path& name);
//! adds an button. The returned pointer must not be dropped.
virtual IGUIButton* addButton(const core::rect<s32>& rectangle, IGUIElement* parent=0, s32 id=-1, const wchar_t* text=0,const wchar_t* tooltiptext = 0);
@ -214,7 +214,7 @@ public:
/** \param filename: Name of the file.
\param start: The element to start saving from.
if not specified, the root element will be used */
virtual bool saveGUI( const core::string<c16>& filename, IGUIElement* start=0);
virtual bool saveGUI( const io::path& filename, IGUIElement* start=0);
//! Saves the current gui into a file.
/** \param file: The file to save the GUI to.
@ -226,7 +226,7 @@ public:
/** \param filename: Name of the file.
\param parent: The parent of all loaded GUI elements,
if not specified, the root element will be used */
virtual bool loadGUI(const c16* filename, IGUIElement* parent=0);
virtual bool loadGUI(const io::path& filename, IGUIElement* parent=0);
//! Loads the gui. Note that the current gui is not cleared before.
/** \param file: IReadFile to load the GUI from
@ -256,7 +256,7 @@ private:
struct SFont
{
core::string<c16> Filename;
io::path Filename;
IGUIFont* Font;
bool operator < (const SFont& other) const

View File

@ -135,7 +135,7 @@ const wchar_t* CGUIFileOpenDialog::getFileName() const
}
//! Returns the directory of the selected file. Returns NULL, if no directory was selected.
const core::string<c16>& CGUIFileOpenDialog::getDirectoryName()
const io::path& CGUIFileOpenDialog::getDirectoryName()
{
FileSystem->flattenFilename ( FileDirectory );
return FileDirectory;
@ -221,7 +221,7 @@ bool CGUIFileOpenDialog::OnEvent(const SEvent& event)
case EGET_EDITBOX_ENTER:
if (event.GUIEvent.Caller == FileNameText)
{
core::string<c16> dir( FileNameText->getText () );
io::path dir( FileNameText->getText () );
if ( FileSystem->changeWorkingDirectoryTo( dir ) )
{
fillListBox();

View File

@ -33,7 +33,7 @@ namespace gui
virtual const wchar_t* getFileName() const;
//! Returns the directory of the selected file. Returns NULL, if no directory was selected.
virtual const core::string<c16>& getDirectoryName();
virtual const io::path& getDirectoryName();
//! called if an event happened.
virtual bool OnEvent(const SEvent& event);
@ -54,7 +54,7 @@ namespace gui
core::position2d<s32> DragStart;
core::stringw FileName;
core::string<c16> FileDirectory;
io::path FileDirectory;
IGUIButton* CloseButton;
IGUIButton* OKButton;

View File

@ -19,7 +19,7 @@ namespace gui
{
//! constructor
CGUIFont::CGUIFont(IGUIEnvironment *env, const core::string<c16>& filename)
CGUIFont::CGUIFont(IGUIEnvironment *env, const io::path& filename)
: Driver(0), SpriteBank(0), Environment(env), WrongCharacter(0),
MaxHeight(0), GlobalKerningWidth(0), GlobalKerningHeight(0)
{
@ -218,7 +218,7 @@ bool CGUIFont::load(io::IReadFile* file)
//! loads a font file, native file needed, for texture parsing
bool CGUIFont::load(const core::string<c16>& filename)
bool CGUIFont::load(const io::path& filename)
{
if (!Driver)
return false;
@ -229,7 +229,7 @@ bool CGUIFont::load(const core::string<c16>& filename)
//! load & prepare font from ITexture
bool CGUIFont::loadTexture(video::IImage* image, const core::string<c16>& name)
bool CGUIFont::loadTexture(video::IImage* image, const io::path& name)
{
if (!image)
return false;

View File

@ -34,13 +34,13 @@ class CGUIFont : public IGUIFontBitmap
public:
//! constructor
CGUIFont(IGUIEnvironment* env, const core::string<c16>& filename);
CGUIFont(IGUIEnvironment* env, const io::path& filename);
//! destructor
virtual ~CGUIFont();
//! loads a font from a texture file
bool load(const core::string<c16>& filename);
bool load(const io::path& filename);
//! loads a font from a texture file
bool load(io::IReadFile* file);
@ -90,7 +90,7 @@ private:
};
//! load & prepare font from ITexture
bool loadTexture(video::IImage * image, const core::string<c16>& name);
bool loadTexture(video::IImage * image, const io::path& name);
void readPositions(video::IImage* texture, s32& lowerRightPositions);

View File

@ -30,7 +30,7 @@ CImageLoaderBMP::CImageLoaderBMP()
//! returns true if the file maybe is able to be loaded by this class
//! based on the file extension (e.g. ".tga")
bool CImageLoaderBMP::isALoadableFileExtension(const core::string<c16>& filename) const
bool CImageLoaderBMP::isALoadableFileExtension(const io::path& filename) const
{
return core::hasFileExtension ( filename, "bmp" );
}

View File

@ -19,7 +19,7 @@ namespace video
// byte-align structures
#if defined(_MSC_VER) || defined(__BORLANDC__) || defined (__BCPLUSPLUS__)
#if defined(_MSC_VER) || defined(__BORLANDC__) || defined (__BCPLUSPLUS__)
# pragma pack( push, packing )
# pragma pack( 1 )
# define PACK_STRUCT
@ -66,7 +66,7 @@ namespace video
// Default alignment
#if defined(_MSC_VER) || defined(__BORLANDC__) || defined (__BCPLUSPLUS__)
#if defined(_MSC_VER) || defined(__BORLANDC__) || defined (__BCPLUSPLUS__)
# pragma pack( pop, packing )
#endif
@ -88,7 +88,7 @@ public:
//! returns true if the file maybe is able to be loaded by this class
//! based on the file extension (e.g. ".tga")
virtual bool isALoadableFileExtension(const core::string<c16>& filename) const;
virtual bool isALoadableFileExtension(const io::path& filename) const;
//! returns true if the file maybe is able to be loaded by this class
virtual bool isALoadableFileFormat(io::IReadFile* file) const;

View File

@ -35,7 +35,7 @@ CImageLoaderJPG::~CImageLoaderJPG()
//! returns true if the file maybe is able to be loaded by this class
//! based on the file extension (e.g. ".tga")
bool CImageLoaderJPG::isALoadableFileExtension(const core::string<c16>& filename) const
bool CImageLoaderJPG::isALoadableFileExtension(const io::path& filename) const
{
return core::hasFileExtension ( filename, "jpg", "jpeg" );
}

View File

@ -43,7 +43,7 @@ public:
//! returns true if the file maybe is able to be loaded by this class
//! based on the file extension (e.g. ".tga")
virtual bool isALoadableFileExtension(const core::string<c16>& filename) const;
virtual bool isALoadableFileExtension(const io::path& filename) const;
//! returns true if the file maybe is able to be loaded by this class
virtual bool isALoadableFileFormat(io::IReadFile* file) const;

View File

@ -31,7 +31,7 @@ CImageLoaderPCX::CImageLoaderPCX()
//! returns true if the file maybe is able to be loaded by this class
//! based on the file extension (e.g. ".tga")
bool CImageLoaderPCX::isALoadableFileExtension(const core::string<c16>& filename) const
bool CImageLoaderPCX::isALoadableFileExtension(const io::path& filename) const
{
return core::hasFileExtension ( filename, "pcx" );
}

View File

@ -17,7 +17,7 @@ namespace video
#if defined(_IRR_COMPILE_WITH_PCX_LOADER_) || defined(_IRR_COMPILE_WITH_PCX_WRITER_)
// byte-align structures
#if defined(_MSC_VER) || defined(__BORLANDC__) || defined (__BCPLUSPLUS__)
#if defined(_MSC_VER) || defined(__BORLANDC__) || defined (__BCPLUSPLUS__)
# pragma pack( push, packing )
# pragma pack( 1 )
# define PACK_STRUCT
@ -51,7 +51,7 @@ namespace video
// Default alignment
#if defined(_MSC_VER) || defined(__BORLANDC__) || defined (__BCPLUSPLUS__)
#if defined(_MSC_VER) || defined(__BORLANDC__) || defined (__BCPLUSPLUS__)
# pragma pack( pop, packing )
#endif
@ -75,7 +75,7 @@ public:
//! returns true if the file maybe is able to be loaded by this class
//! based on the file extension (e.g. ".tga")
virtual bool isALoadableFileExtension(const core::string<c16>& filename) const;
virtual bool isALoadableFileExtension(const io::path& filename) const;
//! returns true if the file maybe is able to be loaded by this class
virtual bool isALoadableFileFormat(io::IReadFile* file) const;

View File

@ -38,7 +38,7 @@ void PNGAPI user_read_data_fcn(png_structp png_ptr, png_bytep data, png_size_t l
// changed by zola {
io::IReadFile* file=(io::IReadFile*)png_ptr->io_ptr;
check=(png_size_t) file->read((void*)data,length);
check=(png_size_t) file->read((void*)data,(u32)length);
// }
if (check != length)
@ -49,7 +49,7 @@ void PNGAPI user_read_data_fcn(png_structp png_ptr, png_bytep data, png_size_t l
//! returns true if the file maybe is able to be loaded by this class
//! based on the file extension (e.g. ".tga")
bool CImageLoaderPng::isALoadableFileExtension(const core::string<c16>& filename) const
bool CImageLoaderPng::isALoadableFileExtension(const io::path& filename) const
{
#ifdef _IRR_COMPILE_WITH_LIBPNG_
return core::hasFileExtension ( filename, "png" );

View File

@ -27,7 +27,7 @@ public:
//! returns true if the file maybe is able to be loaded by this class
//! based on the file extension (e.g. ".png")
virtual bool isALoadableFileExtension(const core::string<c16>& filename) const;
virtual bool isALoadableFileExtension(const io::path& filename) const;
//! returns true if the file maybe is able to be loaded by this class
virtual bool isALoadableFileFormat(io::IReadFile* file) const;

View File

@ -30,7 +30,7 @@ CImageLoaderPPM::CImageLoaderPPM()
//! returns true if the file maybe is able to be loaded by this class
//! based on the file extension (e.g. ".tga")
bool CImageLoaderPPM::isALoadableFileExtension(const core::string<c16>& filename) const
bool CImageLoaderPPM::isALoadableFileExtension(const io::path& filename) const
{
return core::hasFileExtension ( filename, "ppm", "pgm", "pbm" );
}

View File

@ -31,7 +31,7 @@ public:
//! returns true if the file maybe is able to be loaded by this class
//! based on the file extension (e.g. ".tga")
virtual bool isALoadableFileExtension(const core::string<c16>& filename) const;
virtual bool isALoadableFileExtension(const io::path& filename) const;
//! returns true if the file maybe is able to be loaded by this class
virtual bool isALoadableFileFormat(io::IReadFile* file) const;

Some files were not shown because too many files have changed in this diff Show More