- Merged rev 5258-5275 from trunk.

git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/branches/ogl-es@5286 dfc29bdd-3216-0410-991c-e03cc46cb475
master
nadro 2016-03-17 22:17:43 +00:00
parent 9773157768
commit b371f08d4a
49 changed files with 499 additions and 338 deletions

View File

@ -8,6 +8,7 @@ Changes in ogl-es (not yet released - will be merged with trunk at some point)
--------------------------
Changes in 1.9 (not yet released)
- Fix: CTriangleSelector no longer ignores meshbuffer transformations from skinned meshes (thx @AlexAzazel for report and test-model).
- Randomizer now returns range 0..randMax as documented and no longer 1..randMax as it did before. randMax got reduced by 1.
Note: You will generally get different numbers than before! If you need the exact old calculations, please check the corresponding sources in Irrlicht 1.8 in os.cpp/.h
- Resetting Randomizer with 0 or no longer breaks it (will be set to 1). Same for other numbers for which it wasn't defined.

View File

@ -209,7 +209,6 @@
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks";
LIBRARY_SEARCH_PATHS = (
"$(SRCROOT)/../../lib/OSX",
"/Users/patryk/Programowanie/irrlicht-ogles/lib/OSX",
);
MACOSX_DEPLOYMENT_TARGET = 10.7;
MTL_ENABLE_DEBUG_INFO = YES;
@ -256,7 +255,6 @@
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks";
LIBRARY_SEARCH_PATHS = (
"$(SRCROOT)/../../lib/OSX",
"/Users/patryk/Programowanie/irrlicht-ogles/lib/OSX",
);
MACOSX_DEPLOYMENT_TARGET = 10.7;
MTL_ENABLE_DEBUG_INFO = NO;

View File

@ -209,7 +209,6 @@
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks";
LIBRARY_SEARCH_PATHS = (
"$(SRCROOT)/../../lib/OSX",
"/Users/patryk/Programowanie/irrlicht-ogles/lib/OSX",
);
MACOSX_DEPLOYMENT_TARGET = 10.7;
MTL_ENABLE_DEBUG_INFO = YES;
@ -257,7 +256,6 @@
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks";
LIBRARY_SEARCH_PATHS = (
"$(SRCROOT)/../../lib/OSX",
"/Users/patryk/Programowanie/irrlicht-ogles/lib/OSX",
);
MACOSX_DEPLOYMENT_TARGET = 10.7;
MTL_ENABLE_DEBUG_INFO = NO;

View File

@ -209,7 +209,6 @@
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks";
LIBRARY_SEARCH_PATHS = (
"$(SRCROOT)/../../lib/OSX",
"/Users/patryk/Programowanie/irrlicht-ogles/lib/OSX",
);
MACOSX_DEPLOYMENT_TARGET = 10.7;
MTL_ENABLE_DEBUG_INFO = YES;
@ -256,7 +255,6 @@
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks";
LIBRARY_SEARCH_PATHS = (
"$(SRCROOT)/../../lib/OSX",
"/Users/patryk/Programowanie/irrlicht-ogles/lib/OSX",
);
MACOSX_DEPLOYMENT_TARGET = 10.7;
MTL_ENABLE_DEBUG_INFO = NO;

View File

@ -209,7 +209,6 @@
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks";
LIBRARY_SEARCH_PATHS = (
"$(SRCROOT)/../../lib/OSX",
"/Users/patryk/Programowanie/irrlicht-ogles/lib/OSX",
);
MACOSX_DEPLOYMENT_TARGET = 10.7;
MTL_ENABLE_DEBUG_INFO = YES;
@ -256,7 +255,6 @@
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks";
LIBRARY_SEARCH_PATHS = (
"$(SRCROOT)/../../lib/OSX",
"/Users/patryk/Programowanie/irrlicht-ogles/lib/OSX",
);
MACOSX_DEPLOYMENT_TARGET = 10.7;
MTL_ENABLE_DEBUG_INFO = NO;

View File

@ -209,7 +209,6 @@
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks";
LIBRARY_SEARCH_PATHS = (
"$(SRCROOT)/../../lib/OSX",
"/Users/patryk/Programowanie/irrlicht-ogles/lib/OSX",
);
MACOSX_DEPLOYMENT_TARGET = 10.7;
MTL_ENABLE_DEBUG_INFO = YES;
@ -256,7 +255,6 @@
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks";
LIBRARY_SEARCH_PATHS = (
"$(SRCROOT)/../../lib/OSX",
"/Users/patryk/Programowanie/irrlicht-ogles/lib/OSX",
);
MACOSX_DEPLOYMENT_TARGET = 10.7;
MTL_ENABLE_DEBUG_INFO = NO;

View File

@ -209,7 +209,6 @@
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks";
LIBRARY_SEARCH_PATHS = (
"$(SRCROOT)/../../lib/OSX",
"/Users/patryk/Programowanie/irrlicht-ogles/lib/OSX",
);
MACOSX_DEPLOYMENT_TARGET = 10.7;
MTL_ENABLE_DEBUG_INFO = YES;
@ -256,7 +255,6 @@
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks";
LIBRARY_SEARCH_PATHS = (
"$(SRCROOT)/../../lib/OSX",
"/Users/patryk/Programowanie/irrlicht-ogles/lib/OSX",
);
MACOSX_DEPLOYMENT_TARGET = 10.7;
MTL_ENABLE_DEBUG_INFO = NO;

View File

@ -209,7 +209,6 @@
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks";
LIBRARY_SEARCH_PATHS = (
"$(SRCROOT)/../../lib/OSX",
"/Users/patryk/Programowanie/irrlicht-ogles/lib/OSX",
);
MACOSX_DEPLOYMENT_TARGET = 10.7;
MTL_ENABLE_DEBUG_INFO = YES;
@ -256,7 +255,6 @@
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks";
LIBRARY_SEARCH_PATHS = (
"$(SRCROOT)/../../lib/OSX",
"/Users/patryk/Programowanie/irrlicht-ogles/lib/OSX",
);
MACOSX_DEPLOYMENT_TARGET = 10.7;
MTL_ENABLE_DEBUG_INFO = NO;

View File

@ -209,7 +209,6 @@
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks";
LIBRARY_SEARCH_PATHS = (
"$(SRCROOT)/../../lib/OSX",
"/Users/patryk/Programowanie/irrlicht-ogles/lib/OSX",
);
MACOSX_DEPLOYMENT_TARGET = 10.7;
MTL_ENABLE_DEBUG_INFO = YES;
@ -256,7 +255,6 @@
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks";
LIBRARY_SEARCH_PATHS = (
"$(SRCROOT)/../../lib/OSX",
"/Users/patryk/Programowanie/irrlicht-ogles/lib/OSX",
);
MACOSX_DEPLOYMENT_TARGET = 10.7;
MTL_ENABLE_DEBUG_INFO = NO;

View File

@ -209,7 +209,6 @@
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks";
LIBRARY_SEARCH_PATHS = (
"$(SRCROOT)/../../lib/OSX",
"/Users/patryk/Programowanie/irrlicht-ogles/lib/OSX",
);
MACOSX_DEPLOYMENT_TARGET = 10.7;
MTL_ENABLE_DEBUG_INFO = YES;
@ -256,7 +255,6 @@
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks";
LIBRARY_SEARCH_PATHS = (
"$(SRCROOT)/../../lib/OSX",
"/Users/patryk/Programowanie/irrlicht-ogles/lib/OSX",
);
MACOSX_DEPLOYMENT_TARGET = 10.7;
MTL_ENABLE_DEBUG_INFO = NO;

View File

@ -209,7 +209,6 @@
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks";
LIBRARY_SEARCH_PATHS = (
"$(SRCROOT)/../../lib/OSX",
"/Users/patryk/Programowanie/irrlicht-ogles/lib/OSX",
);
MACOSX_DEPLOYMENT_TARGET = 10.7;
MTL_ENABLE_DEBUG_INFO = YES;
@ -256,7 +255,6 @@
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks";
LIBRARY_SEARCH_PATHS = (
"$(SRCROOT)/../../lib/OSX",
"/Users/patryk/Programowanie/irrlicht-ogles/lib/OSX",
);
MACOSX_DEPLOYMENT_TARGET = 10.7;
MTL_ENABLE_DEBUG_INFO = NO;

View File

@ -209,7 +209,6 @@
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks";
LIBRARY_SEARCH_PATHS = (
"$(SRCROOT)/../../lib/OSX",
"/Users/patryk/Programowanie/irrlicht-ogles/lib/OSX",
);
MACOSX_DEPLOYMENT_TARGET = 10.7;
MTL_ENABLE_DEBUG_INFO = YES;
@ -256,7 +255,6 @@
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks";
LIBRARY_SEARCH_PATHS = (
"$(SRCROOT)/../../lib/OSX",
"/Users/patryk/Programowanie/irrlicht-ogles/lib/OSX",
);
MACOSX_DEPLOYMENT_TARGET = 10.7;
MTL_ENABLE_DEBUG_INFO = NO;

View File

@ -209,7 +209,6 @@
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks";
LIBRARY_SEARCH_PATHS = (
"$(SRCROOT)/../../lib/OSX",
"/Users/patryk/Programowanie/irrlicht-ogles/lib/OSX",
);
MACOSX_DEPLOYMENT_TARGET = 10.7;
MTL_ENABLE_DEBUG_INFO = YES;
@ -256,7 +255,6 @@
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks";
LIBRARY_SEARCH_PATHS = (
"$(SRCROOT)/../../lib/OSX",
"/Users/patryk/Programowanie/irrlicht-ogles/lib/OSX",
);
MACOSX_DEPLOYMENT_TARGET = 10.7;
MTL_ENABLE_DEBUG_INFO = NO;

View File

@ -209,7 +209,6 @@
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks";
LIBRARY_SEARCH_PATHS = (
"$(SRCROOT)/../../lib/OSX",
"/Users/patryk/Programowanie/irrlicht-ogles/lib/OSX",
);
MACOSX_DEPLOYMENT_TARGET = 10.7;
MTL_ENABLE_DEBUG_INFO = YES;
@ -256,7 +255,6 @@
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks";
LIBRARY_SEARCH_PATHS = (
"$(SRCROOT)/../../lib/OSX",
"/Users/patryk/Programowanie/irrlicht-ogles/lib/OSX",
);
MACOSX_DEPLOYMENT_TARGET = 10.7;
MTL_ENABLE_DEBUG_INFO = NO;

View File

@ -209,7 +209,6 @@
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks";
LIBRARY_SEARCH_PATHS = (
"$(SRCROOT)/../../lib/OSX",
"/Users/patryk/Programowanie/irrlicht-ogles/lib/OSX",
);
MACOSX_DEPLOYMENT_TARGET = 10.7;
MTL_ENABLE_DEBUG_INFO = YES;
@ -256,7 +255,6 @@
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks";
LIBRARY_SEARCH_PATHS = (
"$(SRCROOT)/../../lib/OSX",
"/Users/patryk/Programowanie/irrlicht-ogles/lib/OSX",
);
MACOSX_DEPLOYMENT_TARGET = 10.7;
MTL_ENABLE_DEBUG_INFO = NO;

View File

@ -209,7 +209,6 @@
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks";
LIBRARY_SEARCH_PATHS = (
"$(SRCROOT)/../../lib/OSX",
"/Users/patryk/Programowanie/irrlicht-ogles/lib/OSX",
);
MACOSX_DEPLOYMENT_TARGET = 10.7;
MTL_ENABLE_DEBUG_INFO = YES;
@ -256,7 +255,6 @@
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks";
LIBRARY_SEARCH_PATHS = (
"$(SRCROOT)/../../lib/OSX",
"/Users/patryk/Programowanie/irrlicht-ogles/lib/OSX",
);
MACOSX_DEPLOYMENT_TARGET = 10.7;
MTL_ENABLE_DEBUG_INFO = NO;

View File

@ -209,7 +209,6 @@
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks";
LIBRARY_SEARCH_PATHS = (
"$(SRCROOT)/../../lib/OSX",
"/Users/patryk/Programowanie/irrlicht-ogles/lib/OSX",
);
MACOSX_DEPLOYMENT_TARGET = 10.7;
MTL_ENABLE_DEBUG_INFO = YES;
@ -256,7 +255,6 @@
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks";
LIBRARY_SEARCH_PATHS = (
"$(SRCROOT)/../../lib/OSX",
"/Users/patryk/Programowanie/irrlicht-ogles/lib/OSX",
);
MACOSX_DEPLOYMENT_TARGET = 10.7;
MTL_ENABLE_DEBUG_INFO = NO;

View File

@ -209,7 +209,6 @@
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks";
LIBRARY_SEARCH_PATHS = (
"$(SRCROOT)/../../lib/OSX",
"/Users/patryk/Programowanie/irrlicht-ogles/lib/OSX",
);
MACOSX_DEPLOYMENT_TARGET = 10.7;
MTL_ENABLE_DEBUG_INFO = YES;
@ -256,7 +255,6 @@
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks";
LIBRARY_SEARCH_PATHS = (
"$(SRCROOT)/../../lib/OSX",
"/Users/patryk/Programowanie/irrlicht-ogles/lib/OSX",
);
MACOSX_DEPLOYMENT_TARGET = 10.7;
MTL_ENABLE_DEBUG_INFO = NO;

View File

@ -209,7 +209,6 @@
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks";
LIBRARY_SEARCH_PATHS = (
"$(SRCROOT)/../../lib/OSX",
"/Users/patryk/Programowanie/irrlicht-ogles/lib/OSX",
);
MACOSX_DEPLOYMENT_TARGET = 10.7;
MTL_ENABLE_DEBUG_INFO = YES;
@ -256,7 +255,6 @@
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks";
LIBRARY_SEARCH_PATHS = (
"$(SRCROOT)/../../lib/OSX",
"/Users/patryk/Programowanie/irrlicht-ogles/lib/OSX",
);
MACOSX_DEPLOYMENT_TARGET = 10.7;
MTL_ENABLE_DEBUG_INFO = NO;

View File

@ -221,7 +221,6 @@
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks";
LIBRARY_SEARCH_PATHS = (
"$(SRCROOT)/../../lib/OSX",
"/Users/patryk/Programowanie/irrlicht-ogles/lib/OSX",
);
MACOSX_DEPLOYMENT_TARGET = 10.7;
MTL_ENABLE_DEBUG_INFO = YES;
@ -268,7 +267,6 @@
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks";
LIBRARY_SEARCH_PATHS = (
"$(SRCROOT)/../../lib/OSX",
"/Users/patryk/Programowanie/irrlicht-ogles/lib/OSX",
);
MACOSX_DEPLOYMENT_TARGET = 10.7;
MTL_ENABLE_DEBUG_INFO = NO;

View File

@ -209,7 +209,6 @@
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks";
LIBRARY_SEARCH_PATHS = (
"$(SRCROOT)/../../lib/OSX",
"/Users/patryk/Programowanie/irrlicht-ogles/lib/OSX",
);
MACOSX_DEPLOYMENT_TARGET = 10.7;
MTL_ENABLE_DEBUG_INFO = YES;
@ -256,7 +255,6 @@
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks";
LIBRARY_SEARCH_PATHS = (
"$(SRCROOT)/../../lib/OSX",
"/Users/patryk/Programowanie/irrlicht-ogles/lib/OSX",
);
MACOSX_DEPLOYMENT_TARGET = 10.7;
MTL_ENABLE_DEBUG_INFO = NO;

View File

@ -209,7 +209,6 @@
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks";
LIBRARY_SEARCH_PATHS = (
"$(SRCROOT)/../../lib/OSX",
"/Users/patryk/Programowanie/irrlicht-ogles/lib/OSX",
);
MACOSX_DEPLOYMENT_TARGET = 10.7;
MTL_ENABLE_DEBUG_INFO = YES;
@ -256,7 +255,6 @@
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks";
LIBRARY_SEARCH_PATHS = (
"$(SRCROOT)/../../lib/OSX",
"/Users/patryk/Programowanie/irrlicht-ogles/lib/OSX",
);
MACOSX_DEPLOYMENT_TARGET = 10.7;
MTL_ENABLE_DEBUG_INFO = NO;

View File

@ -209,7 +209,6 @@
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks";
LIBRARY_SEARCH_PATHS = (
"$(SRCROOT)/../../lib/OSX",
"/Users/patryk/Programowanie/irrlicht-ogles/lib/OSX",
);
MACOSX_DEPLOYMENT_TARGET = 10.7;
MTL_ENABLE_DEBUG_INFO = YES;
@ -256,7 +255,6 @@
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks";
LIBRARY_SEARCH_PATHS = (
"$(SRCROOT)/../../lib/OSX",
"/Users/patryk/Programowanie/irrlicht-ogles/lib/OSX",
);
MACOSX_DEPLOYMENT_TARGET = 10.7;
MTL_ENABLE_DEBUG_INFO = NO;

View File

@ -209,7 +209,6 @@
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks";
LIBRARY_SEARCH_PATHS = (
"$(SRCROOT)/../../lib/OSX",
"/Users/patryk/Programowanie/irrlicht-ogles/lib/OSX",
);
MACOSX_DEPLOYMENT_TARGET = 10.7;
MTL_ENABLE_DEBUG_INFO = YES;
@ -256,7 +255,6 @@
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks";
LIBRARY_SEARCH_PATHS = (
"$(SRCROOT)/../../lib/OSX",
"/Users/patryk/Programowanie/irrlicht-ogles/lib/OSX",
);
MACOSX_DEPLOYMENT_TARGET = 10.7;
MTL_ENABLE_DEBUG_INFO = NO;

View File

@ -209,7 +209,6 @@
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks";
LIBRARY_SEARCH_PATHS = (
"$(SRCROOT)/../../lib/OSX",
"/Users/patryk/Programowanie/irrlicht-ogles/lib/OSX",
);
MACOSX_DEPLOYMENT_TARGET = 10.7;
MTL_ENABLE_DEBUG_INFO = YES;
@ -256,7 +255,6 @@
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks";
LIBRARY_SEARCH_PATHS = (
"$(SRCROOT)/../../lib/OSX",
"/Users/patryk/Programowanie/irrlicht-ogles/lib/OSX",
);
MACOSX_DEPLOYMENT_TARGET = 10.7;
MTL_ENABLE_DEBUG_INFO = NO;

View File

@ -209,7 +209,6 @@
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks";
LIBRARY_SEARCH_PATHS = (
"$(SRCROOT)/../../lib/OSX",
"/Users/patryk/Programowanie/irrlicht-ogles/lib/OSX",
);
MACOSX_DEPLOYMENT_TARGET = 10.7;
MTL_ENABLE_DEBUG_INFO = YES;
@ -256,7 +255,6 @@
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks";
LIBRARY_SEARCH_PATHS = (
"$(SRCROOT)/../../lib/OSX",
"/Users/patryk/Programowanie/irrlicht-ogles/lib/OSX",
);
MACOSX_DEPLOYMENT_TARGET = 10.7;
MTL_ENABLE_DEBUG_INFO = NO;

View File

@ -221,7 +221,6 @@
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks";
LIBRARY_SEARCH_PATHS = (
"$(SRCROOT)/../../lib/OSX",
"/Users/patryk/Programowanie/irrlicht-ogles/lib/OSX",
);
MACOSX_DEPLOYMENT_TARGET = 10.7;
MTL_ENABLE_DEBUG_INFO = YES;
@ -268,7 +267,6 @@
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks";
LIBRARY_SEARCH_PATHS = (
"$(SRCROOT)/../../lib/OSX",
"/Users/patryk/Programowanie/irrlicht-ogles/lib/OSX",
);
MACOSX_DEPLOYMENT_TARGET = 10.7;
MTL_ENABLE_DEBUG_INFO = NO;

View File

@ -104,6 +104,8 @@ namespace scene
video::SMaterial Material;
core::aabbox3d<f32> BoundingBox;
private:
CDynamicMeshBuffer(const CDynamicMeshBuffer&); // = delete in c++11, prevent copying
IVertexBuffer *VertexBuffer;
IIndexBuffer *IndexBuffer;
};

View File

@ -9,6 +9,7 @@
#include "position2d.h"
#include "rect.h"
#include "SColor.h"
#include "irrAllocator.h"
#include <string.h>
namespace irr
@ -16,6 +17,16 @@ namespace irr
namespace video
{
//! Enumeration describing the type of ITexture.
enum E_TEXTURE_TYPE
{
//! 2D texture.
ETT_2D,
//! Cubemap texture.
ETT_CUBEMAP
};
//! Interface for software image data.
/** Image loaders create these images from files. IVideoDrivers convert
these images into their (hardware) textures.
@ -26,8 +37,7 @@ public:
//! constructor
IImage(ECOLOR_FORMAT format, const core::dimension2d<u32>& size, bool deleteMemory) :
Format(format), Size(size), Data(0), MipMapsData(0), BytesPerPixel(0), Pitch(0),
DeleteMemory(deleteMemory), DeleteMipMapsMemory(false)
Format(format), Size(size), Data(0), MipMapsData(0), BytesPerPixel(0), Pitch(0), DeleteMemory(deleteMemory), DeleteMipMapsMemory(false)
{
BytesPerPixel = getBitsPerPixelFromFormat(Format) / 8;
Pitch = BytesPerPixel * Size.Width;
@ -40,7 +50,7 @@ public:
delete[] Data;
if (DeleteMipMapsMemory)
delete[] MipMapsData;
Allocator.deallocate(MipMapsData);
}
//! Returns the color format
@ -203,37 +213,49 @@ public:
destruction. */
void setMipMapsData(void* data, bool ownForeignMemory, bool deleteMemory)
{
if (DeleteMipMapsMemory && data != MipMapsData)
delete[] MipMapsData;
if (data)
if (data != MipMapsData)
{
if (ownForeignMemory)
if (DeleteMipMapsMemory)
{
DeleteMipMapsMemory = deleteMemory;
MipMapsData = static_cast<u8*>(data);
Allocator.deallocate(MipMapsData);
DeleteMipMapsMemory = false;
}
if (data)
{
if (ownForeignMemory)
{
MipMapsData = static_cast<u8*>(data);
DeleteMipMapsMemory = deleteMemory;
}
else
{
u32 dataSize = 0;
u32 width = Size.Width;
u32 height = Size.Height;
do
{
if (width > 1)
width >>= 1;
if (height > 1)
height >>= 1;
dataSize += getDataSizeFromFormat(Format, width, height);
} while (width != 1 || height != 1);
MipMapsData = Allocator.allocate(dataSize);
memcpy(MipMapsData, data, dataSize);
DeleteMipMapsMemory = true;
}
}
else
{
u32 dataSize = 0;
u32 width = Size.Width;
u32 height = Size.Height;
do
{
if (width > 1)
width >>= 1;
if (height > 1)
height >>= 1;
dataSize += getDataSizeFromFormat(Format, width, height);
}
while (width != 1 || height != 1);
DeleteMipMapsMemory = true;
MipMapsData = new u8[dataSize];
memcpy(MipMapsData, data, dataSize);
MipMapsData = 0;
}
}
}
@ -476,6 +498,8 @@ protected:
bool DeleteMemory;
bool DeleteMipMapsMemory;
core::irrAllocator<u8> Allocator;
};
} // end namespace video

View File

@ -8,6 +8,7 @@
#include "IReferenceCounted.h"
#include "IImage.h"
#include "path.h"
#include "irrArray.h"
namespace irr
{
@ -43,6 +44,17 @@ public:
/** \param file File handle to check.
\return Pointer to newly created image, or 0 upon error. */
virtual IImage* loadImage(io::IReadFile* file) const = 0;
//! Creates a multiple surfaces from the file eg. whole cube map.
/** \param file File handle to check.
\param type Pointer to E_TEXTURE_TYPE where a recommended type of the texture will be stored.
\return Array of pointers to newly created images. */
virtual core::array<IImage*> loadImages(io::IReadFile* file, E_TEXTURE_TYPE* type) const
{
core::array<IImage*> image;
return image;
}
};

View File

@ -92,16 +92,6 @@ enum E_TEXTURE_LOCK_MODE
ETLM_WRITE_ONLY
};
//! Enumeration describing the type of ITexture.
enum E_TEXTURE_TYPE
{
//! 2D texture.
ETT_2D,
//! Cubemap texture.
ETT_CUBEMAP
};
//! Where did the last IVideoDriver::getTexture call find this texture
enum E_TEXTURE_SOURCE
{

View File

@ -1184,6 +1184,28 @@ namespace video
\return The current texture creation flag enabled mode. */
virtual bool getTextureCreationFlag(E_TEXTURE_CREATION_FLAG flag) const =0;
//! Creates a software images from a file.
/** No hardware texture will be created for those images. This
method is useful for example if you want to read a heightmap
for a terrain renderer.
\param filename Name of the file from which the images are created.
\param type Pointer to E_TEXTURE_TYPE where a recommended type of the texture will be stored.
\return The array of created images.
If you no longer need those images, you should call IImage::drop() on each of them.
See IReferenceCounted::drop() for more information. */
virtual core::array<IImage*> createImagesFromFile(const io::path& filename, E_TEXTURE_TYPE* type = 0) = 0;
//! Creates a software images from a file.
/** No hardware texture will be created for those images. This
method is useful for example if you want to read a heightmap
for a terrain renderer.
\param file File from which the image is created.
\param type Pointer to E_TEXTURE_TYPE where a recommended type of the texture will be stored.
\return The array of created images.
If you no longer need those images, you should call IImage::drop() on each of them.
See IReferenceCounted::drop() for more information. */
virtual core::array<IImage*> createImagesFromFile(io::IReadFile* file, E_TEXTURE_TYPE* type = 0) = 0;
//! Creates a software image from a file.
/** No hardware texture will be created for this image. This
method is useful for example if you want to read a heightmap
@ -1193,7 +1215,15 @@ 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 io::path& filename) = 0;
IImage* createImageFromFile(const io::path& filename)
{
core::array<IImage*> imageArray = createImagesFromFile(filename);
for (u32 i = 1; i < imageArray.size(); ++i)
imageArray[i]->drop();
return (imageArray.size() > 0) ? imageArray[0] : 0;
}
//! Creates a software image from a file.
/** No hardware texture will be created for this image. This
@ -1203,7 +1233,15 @@ 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(io::IReadFile* file) =0;
IImage* createImageFromFile(io::IReadFile* file)
{
core::array<IImage*> imageArray = createImagesFromFile(file);
for (u32 i = 1; i < imageArray.size(); ++i)
imageArray[i]->drop();
return (imageArray.size() > 0) ? imageArray[0] : 0;
}
//! Writes the provided image to a file.
/** Requires that there is a suitable image writer registered

View File

@ -364,7 +364,13 @@ void CAnimatedMeshSceneNode::render()
// draw normals
for (u32 g=0; g < count; ++g)
{
driver->drawMeshBufferNormals(m->getMeshBuffer(g), debugNormalLength, debugNormalColor);
scene::IMeshBuffer* mb = m->getMeshBuffer(g);
if (RenderFromIdentity)
driver->setTransform(video::ETS_WORLD, core::IdentityMatrix );
else if (Mesh->getMeshType() == EAMT_SKINNED)
driver->setTransform(video::ETS_WORLD, AbsoluteTransformation * ((SSkinMeshBuffer*)mb)->Transformation);
driver->drawMeshBufferNormals(mb, debugNormalLength, debugNormalColor);
}
}

View File

@ -3376,6 +3376,16 @@ D3DFORMAT CD3D9Driver::getD3DFormatFromColorFormat(ECOLOR_FORMAT format) const
return D3DFMT_R8G8B8;
case ECF_A8R8G8B8:
return D3DFMT_A8R8G8B8;
case ECF_DXT1:
return D3DFMT_DXT1;
case ECF_DXT2:
return D3DFMT_DXT2;
case ECF_DXT3:
return D3DFMT_DXT3;
case ECF_DXT4:
return D3DFMT_DXT4;
case ECF_DXT5:
return D3DFMT_DXT5;
case ECF_R16F:
return D3DFMT_R16F;
case ECF_G16R16F:

View File

@ -38,8 +38,12 @@ CD3D9Texture::CD3D9Texture(const io::path& name, const core::array<IImage*>& ima
core::array<IImage*> tmpImage = image;
bool releaseImageData = false;
if (OriginalSize != Size || OriginalColorFormat != ColorFormat)
{
releaseImageData = true;
for (u32 i = 0; i < image.size(); ++i)
{
tmpImage[i] = Driver->createImage(ColorFormat, Size);
@ -102,6 +106,12 @@ CD3D9Texture::CD3D9Texture(const io::path& name, const core::array<IImage*>& ima
{
os::Printer::log("Could not create DIRECT3D9 Texture.", ELL_WARNING);
}
if (releaseImageData)
{
for (u32 i = 0; i < tmpImage.size(); ++i)
tmpImage[i]->drop();
}
}
CD3D9Texture::CD3D9Texture(CD3D9Driver* driver, const core::dimension2d<u32>& size, const io::path& name, const ECOLOR_FORMAT format)
@ -264,8 +274,8 @@ void CD3D9Texture::regenerateMipMapLevels(void* data, u32 layer)
if (data)
{
u32 width = Size.Width >> layer;
u32 height = Size.Height >> layer;
u32 width = Size.Width;
u32 height = Size.Height;
u8* tmpData = static_cast<u8*>(data);
u32 dataSize = 0;
u32 level = 0;

View File

@ -15,44 +15,28 @@ namespace video
//! Constructor from raw data
CImage::CImage(ECOLOR_FORMAT format, const core::dimension2d<u32>& size, void* data,
bool ownForeignMemory, bool deleteMemory)
: IImage(format, size, deleteMemory)
bool ownForeignMemory, bool deleteMemory) : IImage(format, size, deleteMemory)
{
if (ownForeignMemory)
{
Data = (u8*)0xbadf00d;
initData();
Data = (u8*)data;
}
else
{
Data = 0;
initData();
memcpy(Data, data, getDataSizeFromFormat(Format, Size.Width, Size.Height));
const u32 dataSize = getDataSizeFromFormat(Format, Size.Width, Size.Height);
Data = new u8[dataSize];
memcpy(Data, data, dataSize);
DeleteMemory = true;
}
}
//! Constructor of empty image
CImage::CImage(ECOLOR_FORMAT format, const core::dimension2d<u32>& size)
: IImage(format, size, true)
CImage::CImage(ECOLOR_FORMAT format, const core::dimension2d<u32>& size) : IImage(format, size, true)
{
initData();
}
//! assumes format and size has been set and creates the rest
void CImage::initData()
{
#ifdef _DEBUG
setDebugName("CImage");
#endif
if (!Data)
{
DeleteMemory = true;
Data = new u8[getDataSizeFromFormat(Format, Size.Width, Size.Height)];
}
Data = new u8[getDataSizeFromFormat(Format, Size.Width, Size.Height)];
DeleteMemory = true;
}

View File

@ -59,10 +59,6 @@ public:
virtual void fill(const SColor &color) _IRR_OVERRIDE_;
private:
//! assumes format and size has been set and creates the rest
void initData();
inline SColor getPixelBox ( s32 x, s32 y, s32 fx, s32 fy, s32 bias ) const;
};

View File

@ -1,4 +1,4 @@
// Copyright (C) 2013-2015 Patryk Nadrowski
// Copyright (C) 2013-2016 Patryk Nadrowski
// This file is part of the "Irrlicht Engine".
// For conditions of distribution and use, see copyright notice in irrlicht.h
@ -13,19 +13,14 @@
namespace irr
{
namespace video
{
//! returns true if the file maybe is able to be loaded by this class
//! based on the file extension (e.g. ".tga")
bool CImageLoaderPVR::isALoadableFileExtension(const io::path& filename) const
{
return core::hasFileExtension(filename, "pvr");
}
//! returns true if the file maybe is able to be loaded by this class
bool CImageLoaderPVR::isALoadableFileFormat(io::IReadFile* file) const
{
if (!file)
@ -37,7 +32,6 @@ bool CImageLoaderPVR::isALoadableFileFormat(io::IReadFile* file) const
/*if (header.Version == 0x03525650) // TO-DO - fix endiannes
{
printf("Bad endian2\n");
fourCC[0] = os::Byteswap::byteswap(fourCC[0]);
fourCC[1] = os::Byteswap::byteswap(fourCC[1]);
fourCC[2] = os::Byteswap::byteswap(fourCC[2]);
@ -47,15 +41,35 @@ bool CImageLoaderPVR::isALoadableFileFormat(io::IReadFile* file) const
return (fourCC[0] == 'P' && fourCC[1] == 'V' && fourCC[2] == 'R');
}
//! creates a surface from the file
IImage* CImageLoaderPVR::loadImage(io::IReadFile* file) const
{
core::array<IImage*> imageArray = loadImages(file, 0);
const u32 imageCount = imageArray.size();
for (u32 i = 1; i < imageCount; ++i)
{
if (imageArray[i])
imageArray[i]->drop();
}
if (imageCount > 1)
imageArray.erase(1, imageCount - 1);
return (imageCount > 1) ? imageArray[0] : 0;
}
core::array<IImage*> CImageLoaderPVR::loadImages(io::IReadFile* file, E_TEXTURE_TYPE* type) const
{
// TO-DO -> use 'move' feature from C++11 standard.
SPVRHeader header;
IImage* image = 0;
core::array<IImage*> imageArray;
core::array<u8*> mipMapsDataArray;
ECOLOR_FORMAT format = ECF_UNKNOWN;
u32 dataSize = 0;
u32 mipMapsDataSize = 0;
file->seek(0);
file->read(&header, sizeof(SPVRHeader));
@ -87,108 +101,166 @@ IImage* CImageLoaderPVR::loadImage(io::IReadFile* file) const
file->seek(helperDataSize, true);
}
if (header.PixelFormat & 0xFFFFFFFF00000000) // Uncompressed texture formats
if (header.PixelFormat & 0xFFFFFFFF00000000)
{
// TO-DO add support for uncompressed images.
switch (header.PixelFormat)
{
case 0x505050162677261:
format = ECF_A1R5G5B5;
break;
case 0x5060500626772:
format = ECF_R5G6B5;
break;
case 0x8080800626772:
format = ECF_R8G8B8;
break;
case 0x808080861726762:
format = ECF_A8R8G8B8;
break;
default:
break;
}
}
else // Compressed texture formats
{
switch(header.PixelFormat)
switch (header.PixelFormat)
{
case 0: // PVRTC 2bpp RGB
format = ECF_PVRTC_RGB2;
break;
case 1: // PVRTC 2bpp RGBA
format = ECF_PVRTC_ARGB2;
break;
case 2: // PVRTC 4bpp RGB
format = ECF_PVRTC_RGB4;
break;
case 3: // PVRTC 4bpp RGBA
format = ECF_PVRTC_ARGB4;
break;
case 4: // PVRTC-II 2bpp
format = ECF_PVRTC2_ARGB2;
break;
case 5: // PVRTC-II 4bpp
format = ECF_PVRTC2_ARGB4;
break;
case 6: // ETC1
format = ECF_ETC1;
break;
case 7: // DXT1 / BC1
format = ECF_DXT1;
break;
case 8: // DXT2
case 9: // DXT3 / BC2
format = ECF_DXT3;
break;
case 10: // DXT4
case 11: // DXT5 / BC3
format = ECF_DXT5;
break;
case 22: // ETC2 RGB
format = ECF_ETC2_RGB;
break;
case 23: // ETC2 RGBA
format = ECF_ETC2_ARGB;
break;
default:
format = ECF_UNKNOWN;
break;
}
if (format != ECF_UNKNOWN)
{
// 3D textures, texture arrays, cube maps textures aren't currently supported
if (header.Depth < 2 && header.NumSurfaces < 2 && header.NumFaces < 2)
{
dataSize = IImage::getDataSizeFromFormat(format, header.Width, header.Height);
u8* data = new u8[dataSize];
file->read(data, dataSize);
image = new CImage(format, core::dimension2d<u32>(header.Width, header.Height), data, true, true);
if (header.MipMapCount > 1)
{
u32 tmpWidth = header.Width;
u32 tmpHeight = header.Height;
do
{
if (tmpWidth > 1)
tmpWidth >>= 1;
if (tmpHeight > 1)
tmpHeight >>= 1;
mipMapsDataSize += IImage::getDataSizeFromFormat(format, tmpWidth, tmpHeight);
}
while (tmpWidth != 1 || tmpHeight != 1);
u8* mipMapsData = new u8[mipMapsDataSize];
file->read(mipMapsData, mipMapsDataSize);
image->setMipMapsData(mipMapsData, true, true);
}
}
case 0: // PVRTC 2bpp RGB
format = ECF_PVRTC_RGB2;
break;
case 1: // PVRTC 2bpp RGBA
format = ECF_PVRTC_ARGB2;
break;
case 2: // PVRTC 4bpp RGB
format = ECF_PVRTC_RGB4;
break;
case 3: // PVRTC 4bpp RGBA
format = ECF_PVRTC_ARGB4;
break;
case 4: // PVRTC-II 2bpp
format = ECF_PVRTC2_ARGB2;
break;
case 5: // PVRTC-II 4bpp
format = ECF_PVRTC2_ARGB4;
break;
case 6: // ETC1
format = ECF_ETC1;
break;
case 7: // DXT1 / BC1
format = ECF_DXT1;
break;
case 8: // DXT2
case 9: // DXT3 / BC2
format = ECF_DXT3;
break;
case 10: // DXT4
case 11: // DXT5 / BC3
format = ECF_DXT5;
break;
case 22: // ETC2 RGB
format = ECF_ETC2_RGB;
break;
case 23: // ETC2 RGBA
format = ECF_ETC2_ARGB;
break;
default:
format = ECF_UNKNOWN;
break;
}
}
return image;
if (format != ECF_UNKNOWN)
{
imageArray.set_used(1);
E_TEXTURE_TYPE tmpType = ETT_2D;
// check for texture type
if (header.NumFaces == 6) // cube map
{
imageArray.set_used(6);
tmpType = ETT_CUBEMAP;
}
else if (header.Depth > 1) // 3d texture
{
// TO-DO
}
else if (header.NumSurfaces > 1) // texture array
{
// To-DO
}
if (type)
*type = tmpType;
// prepare mipmaps data
dataSize = 0;
for (u32 i = 1; i < header.MipMapCount; ++i)
{
u32 tmpWidth = header.Width >> i;
u32 tmpHeight = header.Height >> i;
dataSize += IImage::getDataSizeFromFormat(format, tmpWidth, tmpHeight);
}
if (header.MipMapCount > 1)
{
mipMapsDataArray.set_used(imageArray.size());
for (u32 j = 0; j < mipMapsDataArray.size(); ++j)
mipMapsDataArray[j] = new u8[dataSize];
}
// read texture
dataSize = 0;
long offset = 0;
for (u32 i = 0; i < header.MipMapCount; ++i)
{
if (i == 0)
{
for (u32 j = 0; j < imageArray.size(); ++j)
{
dataSize = IImage::getDataSizeFromFormat(format, header.Width, header.Height);
u8* data = new u8[dataSize];
file->read(data, dataSize);
imageArray[j] = new CImage(format, core::dimension2d<u32>(header.Width, header.Height), data, true, true);
}
}
else
{
u32 tmpWidth = header.Width >> i;
u32 tmpHeight = header.Height >> i;
dataSize = IImage::getDataSizeFromFormat(format, tmpWidth, tmpHeight);
for (u32 j = 0; j < imageArray.size(); ++j)
file->read(mipMapsDataArray[j] + offset, dataSize);
offset += dataSize;
}
}
// assign mipmaps data
for (u32 i = 0; i < mipMapsDataArray.size(); ++i)
imageArray[i]->setMipMapsData(mipMapsDataArray[i], true, true);
}
return imageArray;
}
//! creates a loader which is able to load pvr images
IImageLoader* createImageLoaderPVR()
{
return new CImageLoaderPVR();
}
} // end namespace video
} // end namespace irr
}
}
#endif

View File

@ -1,4 +1,4 @@
// Copyright (C) 2013-2015 Patryk Nadrowski
// Copyright (C) 2013-2016 Patryk Nadrowski
// This file is part of the "Irrlicht Engine".
// For conditions of distribution and use, see copyright notice in irrlicht.h
@ -16,10 +16,8 @@ namespace irr
namespace video
{
// byte-align structures
#include "irrpack.h"
/* structures */
struct SPVRHeader
{
u32 Version;
@ -36,29 +34,22 @@ struct SPVRHeader
u32 MetDataSize;
} PACK_STRUCT;
// Default alignment
#include "irrunpack.h"
/*!
Surface Loader for PVR images
*/
class CImageLoaderPVR : public IImageLoader
{
public:
//! returns true if the file maybe is able to be loaded by this class
//! based on the file extension (e.g. ".tga")
virtual bool isALoadableFileExtension(const io::path& filename) const;
//! returns true if the file maybe is able to be loaded by this class
virtual bool isALoadableFileFormat(io::IReadFile* file) const;
//! creates a surface from the file
virtual IImage* loadImage(io::IReadFile* file) const;
virtual core::array<IImage*> loadImages(io::IReadFile* file, E_TEXTURE_TYPE* type) const;
};
} // end namespace video
} // end namespace irr
}
}
#endif // compiled with PVR loader
#endif
#endif

View File

@ -494,7 +494,7 @@ ITexture* CNullDriver::addTextureCubemap(const io::path& name, IImage* imagePosX
ITexture* t = 0;
core::array<IImage*> imageArray(1);
core::array<IImage*> imageArray(6);
imageArray.push_back(imagePosX);
imageArray.push_back(imageNegX);
imageArray.push_back(imagePosY);
@ -615,23 +615,37 @@ ITexture* CNullDriver::getTexture(io::IReadFile* file)
video::ITexture* CNullDriver::loadTextureFromFile(io::IReadFile* file, const io::path& hashName )
{
ITexture* texture = 0;
IImage* image = createImageFromFile(file);
if (image)
E_TEXTURE_TYPE type = ETT_2D;
core::array<IImage*> imageArray = createImagesFromFile(file, &type);
if (checkImage(imageArray))
{
core::array<IImage*> imageArray(1);
imageArray.push_back(image);
if (checkImage(imageArray))
switch (type)
{
texture = createDeviceDependentTexture(hashName.size() ? hashName : file->getFileName(), image);
case ETT_2D:
texture = createDeviceDependentTexture(hashName.size() ? hashName : file->getFileName(), imageArray[0]);
break;
case ETT_CUBEMAP:
if (imageArray.size() >= 6 && imageArray[0] && imageArray[1] && imageArray[2] && imageArray[3] && imageArray[4] && imageArray[5])
{
texture = createDeviceDependentTextureCubemap(hashName.size() ? hashName : file->getFileName(), imageArray);
}
break;
default:
_IRR_DEBUG_BREAK_IF(true);
break;
}
if (texture)
os::Printer::log("Loaded texture", file->getFileName());
}
image->drop();
for (u32 i = 0; i < imageArray.size(); ++i)
{
if (imageArray[i])
imageArray[i]->drop();
}
return texture;
@ -1489,66 +1503,87 @@ bool CNullDriver::getTextureCreationFlag(E_TEXTURE_CREATION_FLAG flag) const
return (TextureCreationFlags & flag)!=0;
}
//! Creates a software image from a file.
IImage* CNullDriver::createImageFromFile(const io::path& filename)
core::array<IImage*> CNullDriver::createImagesFromFile(const io::path& filename, E_TEXTURE_TYPE* type)
{
if (!filename.size())
return 0;
// TO-DO -> use 'move' feature from C++11 standard.
IImage* image = 0;
io::IReadFile* file = FileSystem->createAndOpenFile(filename);
core::array<IImage*> imageArray;
if (filename.size() > 0)
{
io::IReadFile* file = FileSystem->createAndOpenFile(filename);
if (file)
{
imageArray = createImagesFromFile(file, type);
file->drop();
}
else
os::Printer::log("Could not open file of image", filename, ELL_WARNING);
}
return imageArray;
}
core::array<IImage*> CNullDriver::createImagesFromFile(io::IReadFile* file, E_TEXTURE_TYPE* type)
{
// TO-DO -> use 'move' feature from C++11 standard.
core::array<IImage*> imageArray;
if (file)
{
image = createImageFromFile(file);
file->drop();
}
else
os::Printer::log("Could not open file of image", filename, ELL_WARNING);
s32 i;
return image;
}
//! Creates a software image from a file.
IImage* CNullDriver::createImageFromFile(io::IReadFile* file)
{
if (!file)
return 0;
IImage* image = 0;
s32 i;
// try to load file based on file extension
for (i=SurfaceLoader.size()-1; i>=0; --i)
{
if (SurfaceLoader[i]->isALoadableFileExtension(file->getFileName()))
// try to load file based on file extension
for (i = SurfaceLoader.size() - 1; i >= 0; --i)
{
// reset file position which might have changed due to previous loadImage calls
if (SurfaceLoader[i]->isALoadableFileExtension(file->getFileName()))
{
// reset file position which might have changed due to previous loadImage calls
file->seek(0);
imageArray = SurfaceLoader[i]->loadImages(file, type);
if (imageArray.size() == 0)
{
file->seek(0);
IImage* image = SurfaceLoader[i]->loadImage(file);
if (image)
imageArray.push_back(image);
}
if (imageArray.size() > 0)
return imageArray;
}
}
// try to load file based on what is in it
for (i = SurfaceLoader.size() - 1; i >= 0; --i)
{
// dito
file->seek(0);
image = SurfaceLoader[i]->loadImage(file);
if (image)
return image;
if (SurfaceLoader[i]->isALoadableFileFormat(file))
{
file->seek(0);
imageArray = SurfaceLoader[i]->loadImages(file, type);
if (imageArray.size() == 0)
{
file->seek(0);
IImage* image = SurfaceLoader[i]->loadImage(file);
if (image)
imageArray.push_back(image);
}
if (imageArray.size() > 0)
return imageArray;
}
}
}
// try to load file based on what is in it
for (i=SurfaceLoader.size()-1; i>=0; --i)
{
// dito
file->seek(0);
if (SurfaceLoader[i]->isALoadableFileFormat(file))
{
file->seek(0);
image = SurfaceLoader[i]->loadImage(file);
if (image)
return image;
}
}
return 0; // failed to load
return imageArray;
}

View File

@ -344,11 +344,9 @@ namespace video
//! Returns if a texture creation flag is enabled or disabled.
virtual bool getTextureCreationFlag(E_TEXTURE_CREATION_FLAG flag) const _IRR_OVERRIDE_;
//! Creates a software image from a file.
virtual IImage* createImageFromFile(const io::path& filename) _IRR_OVERRIDE_;
virtual core::array<IImage*> createImagesFromFile(const io::path& filename, E_TEXTURE_TYPE* type = 0) _IRR_OVERRIDE_;
//! Creates a software image from a file.
virtual IImage* createImageFromFile(io::IReadFile* file) _IRR_OVERRIDE_;
virtual core::array<IImage*> createImagesFromFile(io::IReadFile* file, E_TEXTURE_TYPE* type = 0) _IRR_OVERRIDE_;
//! Creates a software image from a byte array.
/** \param useForeignMemory: If true, the image will use the data pointer
@ -361,7 +359,6 @@ namespace video
//! Creates an empty software image.
virtual IImage* createImage(ECOLOR_FORMAT format, const core::dimension2d<u32>& size) _IRR_OVERRIDE_;
//! Creates a software image from another image.
virtual IImage* createImage(ECOLOR_FORMAT format, IImage *imageToCopy) _IRR_OVERRIDE_;

View File

@ -83,12 +83,12 @@ class COpenGLCoreCacheHandler
{
glBindTexture(prevTextureType, 0);
#if defined(IRR_OPENGL_VERSION) && IRR_OPENGL_VERSION < 20
#if (defined(IRR_OPENGL_VERSION) && IRR_OPENGL_VERSION < 20) || (defined(IRR_OPENGL_ES_VERSION) && IRR_OPENGL_ES_VERSION < 20)
glDisable(prevTextureType);
glEnable(curTextureType);
#endif
}
#if defined(IRR_OPENGL_VERSION) && IRR_OPENGL_VERSION < 20
#if (defined(IRR_OPENGL_VERSION) && IRR_OPENGL_VERSION < 20) || (defined(IRR_OPENGL_ES_VERSION) && IRR_OPENGL_ES_VERSION < 20)
else if (!prevTexture)
glEnable(curTextureType);
#endif
@ -109,7 +109,7 @@ class COpenGLCoreCacheHandler
glBindTexture(prevTextureType, 0);
#if defined(IRR_OPENGL_VERSION) && IRR_OPENGL_VERSION < 20
#if (defined(IRR_OPENGL_VERSION) && IRR_OPENGL_VERSION < 20) || (defined(IRR_OPENGL_ES_VERSION) && IRR_OPENGL_ES_VERSION < 20)
glDisable(prevTextureType);
#endif
}
@ -222,7 +222,7 @@ public:
Driver->irrGlActiveTexture(ActiveTexture);
#if defined(IRR_OPENGL_VERSION) && IRR_OPENGL_VERSION < 20
#if (defined(IRR_OPENGL_VERSION) && IRR_OPENGL_VERSION < 20) || (defined(IRR_OPENGL_ES_VERSION) && IRR_OPENGL_ES_VERSION < 20)
glDisable(GL_TEXTURE_2D);
#endif

View File

@ -101,7 +101,7 @@ public:
glHint(GL_GENERATE_MIPMAP_HINT, GL_DONT_CARE);
}
#if defined(IRR_OPENGL_VERSION) && IRR_OPENGL_VERSION < 20
#if (defined(IRR_OPENGL_VERSION) && IRR_OPENGL_VERSION < 20) || (defined(IRR_OPENGL_ES_VERSION) && IRR_OPENGL_ES_VERSION < 20)
if (HasMipMaps)
glTexParameteri(TextureType, GL_GENERATE_MIPMAP, (AutoGenerateMipMaps) ? GL_TRUE : GL_FALSE);
#endif
@ -194,12 +194,10 @@ public:
virtual void* lock(E_TEXTURE_LOCK_MODE mode = ETLM_READ_WRITE, u32 mipmapLevel = 0) _IRR_OVERRIDE_
{
// TO-DO - this method will be improved.
if (LockImage)
return LockImage->getData();
if (IImage::isCompressedFormat(ColorFormat) || IsRenderTarget || mipmapLevel > 0) // TO-DO
if (IImage::isCompressedFormat(ColorFormat) || IImage::isRenderTargetOnlyFormat(ColorFormat))
return 0;
LockReadOnly |= (mode == ETLM_READ_ONLY);
@ -217,6 +215,32 @@ public:
if (LockImage && mode != ETLM_WRITE_ONLY)
{
IImage* tmpImage = Driver->createImage(ECF_A8R8G8B8, lockImageSize);
#if 0 // This method doesn't work properly in some cases
glGetTexImage(GL_TEXTURE_2D, mipmapLevel, GL_RGBA, GL_UNSIGNED_BYTE, tmpImage->getData());
if (IsRenderTarget)
{
const s32 pitch = tmpImage->getPitch();
u8* srcA = static_cast<u8*>(tmpImage->getData());
u8* srcB = srcA + (tmpImage->getDimension().Height - 1) * pitch;
u8* tmpBuffer = new u8[pitch];
for (u32 i = 0; i < tmpImage->getDimension().Height; i += 2)
{
memcpy(tmpBuffer, srcA, pitch);
memcpy(srcA, srcB, pitch);
memcpy(srcB, tmpBuffer, pitch);
srcA += pitch;
srcB -= pitch;
}
delete[] tmpBuffer;
}
#else
COpenGLCoreTexture* tmpTexture = new COpenGLCoreTexture("OGL_CORE_LOCK_TEXTURE", lockImageSize, ColorFormat, Driver);
GLuint tmpFBO = 0;
@ -237,8 +261,6 @@ public:
Driver->draw2DImage(this, true);
IImage* tmpImage = Driver->createImage(ECF_A8R8G8B8, lockImageSize);
glReadPixels(0, 0, lockImageSize.Width, lockImageSize.Height, GL_RGBA, GL_UNSIGNED_BYTE, tmpImage->getData());
Driver->getCacheHandler()->setFBO(prevFBO);
@ -246,7 +268,7 @@ public:
Driver->irrGlDeleteFramebuffers(1, &tmpFBO);
delete tmpTexture;
#endif
void* src = tmpImage->getData();
void* dest = LockImage->getData();
@ -319,8 +341,8 @@ public:
if (data)
{
u32 width = Size.Width >> layer;
u32 height = Size.Height >> layer;
u32 width = Size.Width;
u32 height = Size.Height;
u8* tmpData = static_cast<u8*>(data);
u32 dataSize = 0;
u32 level = 0;
@ -344,7 +366,7 @@ public:
}
else
{
#if defined(IRR_OPENGL_VERSION) && IRR_OPENGL_VERSION >= 20
#if (defined(IRR_OPENGL_VERSION) && IRR_OPENGL_VERSION >= 20) || (defined(IRR_OPENGL_ES_VERSION) && IRR_OPENGL_ES_VERSION >= 20)
Driver->irrGlGenerateMipmap(TextureType);
#endif
}

View File

@ -2688,8 +2688,6 @@ void COpenGLDriver::setTextureRenderStates(const SMaterial& material, bool reset
if (!tmpTexture)
continue;
GLenum tmpTextureType = tmpTexture->getOpenGLTextureType();
CacheHandler->setActiveTexture(GL_TEXTURE0 + i);
@ -2712,6 +2710,8 @@ void COpenGLDriver::setTextureRenderStates(const SMaterial& material, bool reset
}
}
const GLenum tmpType = tmpTexture->getOpenGLTextureType();
COpenGLTexture::SStatesCache& statesCache = tmpTexture->getStatesCache();
if (resetAllRenderstates)
@ -2725,10 +2725,10 @@ void COpenGLDriver::setTextureRenderStates(const SMaterial& material, bool reset
if (material.TextureLayer[i].LODBias)
{
const float tmp = core::clamp(material.TextureLayer[i].LODBias * 0.125f, -MaxTextureLODBias, MaxTextureLODBias);
glTexParameterf(tmpTextureType, GL_TEXTURE_LOD_BIAS, tmp);
glTexParameterf(tmpType, GL_TEXTURE_LOD_BIAS, tmp);
}
else
glTexParameterf(tmpTextureType, GL_TEXTURE_LOD_BIAS, 0.f);
glTexParameterf(tmpType, GL_TEXTURE_LOD_BIAS, 0.f);
statesCache.LODBias = material.TextureLayer[i].LODBias;
}
@ -2759,7 +2759,7 @@ void COpenGLDriver::setTextureRenderStates(const SMaterial& material, bool reset
if (!statesCache.IsCached || material.TextureLayer[i].BilinearFilter != statesCache.BilinearFilter ||
material.TextureLayer[i].TrilinearFilter != statesCache.TrilinearFilter)
{
glTexParameteri(tmpTextureType, GL_TEXTURE_MAG_FILTER,
glTexParameteri(tmpType, GL_TEXTURE_MAG_FILTER,
(material.TextureLayer[i].BilinearFilter || material.TextureLayer[i].TrilinearFilter) ? GL_LINEAR : GL_NEAREST);
statesCache.BilinearFilter = material.TextureLayer[i].BilinearFilter;
@ -2771,7 +2771,7 @@ void COpenGLDriver::setTextureRenderStates(const SMaterial& material, bool reset
if (!statesCache.IsCached || material.TextureLayer[i].BilinearFilter != statesCache.BilinearFilter ||
material.TextureLayer[i].TrilinearFilter != statesCache.TrilinearFilter || !statesCache.MipMapStatus)
{
glTexParameteri(tmpTextureType, GL_TEXTURE_MIN_FILTER,
glTexParameteri(tmpType, GL_TEXTURE_MIN_FILTER,
material.TextureLayer[i].TrilinearFilter ? GL_LINEAR_MIPMAP_LINEAR :
material.TextureLayer[i].BilinearFilter ? GL_LINEAR_MIPMAP_NEAREST :
GL_NEAREST_MIPMAP_NEAREST);
@ -2786,7 +2786,7 @@ void COpenGLDriver::setTextureRenderStates(const SMaterial& material, bool reset
if (!statesCache.IsCached || material.TextureLayer[i].BilinearFilter != statesCache.BilinearFilter ||
material.TextureLayer[i].TrilinearFilter != statesCache.TrilinearFilter || statesCache.MipMapStatus)
{
glTexParameteri(tmpTextureType, GL_TEXTURE_MIN_FILTER,
glTexParameteri(tmpType, GL_TEXTURE_MIN_FILTER,
(material.TextureLayer[i].BilinearFilter || material.TextureLayer[i].TrilinearFilter) ? GL_LINEAR : GL_NEAREST);
statesCache.BilinearFilter = material.TextureLayer[i].BilinearFilter;
@ -2799,7 +2799,7 @@ void COpenGLDriver::setTextureRenderStates(const SMaterial& material, bool reset
if (FeatureAvailable[IRR_EXT_texture_filter_anisotropic] &&
(!statesCache.IsCached || material.TextureLayer[i].AnisotropicFilter != statesCache.AnisotropicFilter))
{
glTexParameteri(tmpTextureType, GL_TEXTURE_MAX_ANISOTROPY_EXT,
glTexParameteri(tmpType, GL_TEXTURE_MAX_ANISOTROPY_EXT,
material.TextureLayer[i].AnisotropicFilter>1 ? core::min_(MaxAnisotropy, material.TextureLayer[i].AnisotropicFilter) : 1);
statesCache.AnisotropicFilter = material.TextureLayer[i].AnisotropicFilter;
@ -2808,19 +2808,19 @@ void COpenGLDriver::setTextureRenderStates(const SMaterial& material, bool reset
if (!statesCache.IsCached || material.TextureLayer[i].TextureWrapU != statesCache.WrapU)
{
glTexParameteri(tmpTextureType, GL_TEXTURE_WRAP_S, getTextureWrapMode(material.TextureLayer[i].TextureWrapU));
glTexParameteri(tmpType, GL_TEXTURE_WRAP_S, getTextureWrapMode(material.TextureLayer[i].TextureWrapU));
statesCache.WrapU = material.TextureLayer[i].TextureWrapU;
}
if (!statesCache.IsCached || material.TextureLayer[i].TextureWrapV != statesCache.WrapV)
{
glTexParameteri(tmpTextureType, GL_TEXTURE_WRAP_T, getTextureWrapMode(material.TextureLayer[i].TextureWrapV));
glTexParameteri(tmpType, GL_TEXTURE_WRAP_T, getTextureWrapMode(material.TextureLayer[i].TextureWrapV));
statesCache.WrapV = material.TextureLayer[i].TextureWrapV;
}
if (!statesCache.IsCached || material.TextureLayer[i].TextureWrapW != statesCache.WrapW)
{
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_R, getTextureWrapMode(material.TextureLayer[i].TextureWrapW));
glTexParameteri(tmpType, GL_TEXTURE_WRAP_R, getTextureWrapMode(material.TextureLayer[i].TextureWrapW));
statesCache.WrapW = material.TextureLayer[i].TextureWrapW;
}

View File

@ -82,7 +82,8 @@ bool CSceneNodeAnimatorCameraFPS::OnEvent(const SEvent& evt)
case EET_MOUSE_INPUT_EVENT:
if (evt.MouseInput.Event == EMIE_MOUSE_MOVED)
{
CursorPos = CursorControl->getRelativePosition();
if ( CursorControl )
CursorPos = CursorControl->getRelativePosition();
return true;
}
break;

View File

@ -80,7 +80,10 @@ bool CSceneNodeAnimatorCameraMaya::OnEvent(const SEvent& event)
MouseKeys[2] = event.MouseInput.isRightPressed();
MouseKeys[1] = event.MouseInput.isMiddlePressed();
MousePos = CursorControl->getRelativePosition();
if ( CursorControl )
{
MousePos = CursorControl->getRelativePosition();
}
break;
case EMIE_MOUSE_WHEEL:
case EMIE_LMOUSE_DOUBLE_CLICK:

View File

@ -6,6 +6,7 @@
#include "ISceneNode.h"
#include "IMeshBuffer.h"
#include "IAnimatedMeshSceneNode.h"
#include "SSkinMeshBuffer.h"
namespace irr
{
@ -89,6 +90,7 @@ void CTriangleSelector::updateFromMesh(const IMesh* mesh) const
if (!mesh)
return;
bool skinnnedMesh = mesh->getMeshType() == EAMT_SKINNED;
u32 meshBuffers = mesh->getMeshBufferCount();
u32 triangleCount = 0;
@ -99,15 +101,32 @@ void CTriangleSelector::updateFromMesh(const IMesh* mesh) const
u32 idxCnt = buf->getIndexCount();
const u16* indices = buf->getIndices();
for (u32 index = 0; index < idxCnt; index += 3)
if ( skinnnedMesh )
{
core::triangle3df& tri = Triangles[triangleCount++];
tri.pointA = buf->getPosition(indices[index + 0]);
tri.pointB = buf->getPosition(indices[index + 1]);
tri.pointC = buf->getPosition(indices[index + 2]);
BoundingBox.addInternalPoint(tri.pointA);
BoundingBox.addInternalPoint(tri.pointB);
BoundingBox.addInternalPoint(tri.pointC);
const core::matrix4& bufferTransform = ((scene::SSkinMeshBuffer*)buf)->Transformation;
for (u32 index = 0; index < idxCnt; index += 3)
{
core::triangle3df& tri = Triangles[triangleCount++];
bufferTransform.transformVect(tri.pointA, buf->getPosition(indices[index + 0]));
bufferTransform.transformVect(tri.pointB, buf->getPosition(indices[index + 1]));
bufferTransform.transformVect(tri.pointC, buf->getPosition(indices[index + 2]));
BoundingBox.addInternalPoint(tri.pointA);
BoundingBox.addInternalPoint(tri.pointB);
BoundingBox.addInternalPoint(tri.pointC);
}
}
else
{
for (u32 index = 0; index < idxCnt; index += 3)
{
core::triangle3df& tri = Triangles[triangleCount++];
tri.pointA = buf->getPosition(indices[index + 0]);
tri.pointB = buf->getPosition(indices[index + 1]);
tri.pointC = buf->getPosition(indices[index + 2]);
BoundingBox.addInternalPoint(tri.pointA);
BoundingBox.addInternalPoint(tri.pointB);
BoundingBox.addInternalPoint(tri.pointC);
}
}
}
}

Binary file not shown.

Binary file not shown.