Merge revisions r5570 through r5596 from trunk to ogl-es

git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/branches/ogl-es@5597 dfc29bdd-3216-0410-991c-e03cc46cb475
master
cutealien 2017-12-31 20:48:18 +00:00
parent 68480aacc7
commit e3d6a907ff
41 changed files with 4344 additions and 183 deletions

View File

@ -9,9 +9,12 @@ Changes in ogl-es (not yet released - will be merged with trunk at some point)
--------------------------
Changes in 1.9 (not yet released)
- Fix bug #440 where OpenGL driver enabled second texture for single-texture materials when setMaterial was called twice. Thx@ "number Zero" for bugreport and test-case.
- Irrlicht icon now loaded with LR_DEFAULTSIZE to better support larger icon requests. Thx@ luthyr for report and bugfix.
- Cursor on X11 behaves now like on Win32 and doesn't try to clip positions to the window
- IImage::copyToWithAlpha has a new parameter to allow combining alpha value instead of replacing them. This uses new blitters called BLITTER_TEXTURE_COMBINE_ALPHA. Thx @chronologicaldot for providing this patch and @burningreggae for his feedback.
- Add _IRR_COMPILE_WITH_PARTICLES_ to control compilation of particle system
- Add IGUIImage::setDrawBackground to allow disabling background drawing even when no texture is set.
- Add gui event EGET_ELEMENT_REMOVED.
- Fix: IGUIContextMenu now raises sub-menu when they would otherwise be displayed below bottom-border of root gui element.
- Prevent initializing/quitting SDL several times when using more than one Irrlicht device.
- Reduce log-messages for "loaded texture" and "loaded mesh" from ELL_INFORMATION to ELL_DEBUG.

View File

@ -94,7 +94,7 @@ int main()
object for doing anything with the engine. createDevice() has the
following parameters:
- deviceType: Type of the device. This can currently be the Null-device,
- driverType: Type of the video driver. This can currently be the Null-device,
one of the two software renderers, D3D9, or OpenGL. In this
example we use EDT_BURNINGSVIDEO, but to try out, you might want to
change it to EDT_SOFTWARE, EDT_NULL, EDT_DIRECT3D9, or EDT_OPENGL.

View File

@ -330,11 +330,6 @@ namespace irr
//! may be removed by Irrlicht 1.9
EGET_TREEVIEW_NODE_COLLAPS = EGET_TREEVIEW_NODE_COLLAPSE,
//! Information that an element got removed from the gui-graph.
/** NOTE: This event is not passed on to all element parents, but only the
gui environment (and user receiver). */
EGET_ELEMENT_REMOVED,
//! No real event. Just for convenience to get number of events
EGET_COUNT
};

View File

@ -54,7 +54,6 @@ public:
core::list<IGUIElement*>::Iterator it = Children.begin();
for (; it != Children.end(); ++it)
{
(*it)->sendRemoveEvent();
(*it)->Parent = 0;
(*it)->drop();
}
@ -290,7 +289,6 @@ public:
for (; it != Children.end(); ++it)
if ((*it) == child)
{
(*it)->sendRemoveEvent();
(*it)->Parent = 0;
(*it)->drop();
Children.erase(it);
@ -965,21 +963,6 @@ protected:
}
}
// Inform gui-environment that an element got removed from the gui-graph
void sendRemoveEvent()
{
if ( Environment )
{
SEvent removeEvent;
removeEvent.EventType = EET_GUI_EVENT;
removeEvent.GUIEvent.Caller = this;
removeEvent.GUIEvent.Element = 0;
removeEvent.GUIEvent.EventType = EGET_ELEMENT_REMOVED;
Environment->postEventFromUser(removeEvent);
}
}
protected:
//! List of all children of this element

View File

@ -17,16 +17,6 @@ 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.
@ -279,9 +269,12 @@ public:
virtual void copyTo(IImage* target, const core::position2d<s32>& pos, const core::rect<s32>& sourceRect, const core::rect<s32>* clipRect=0) =0;
//! copies this surface into another, using the alpha mask and cliprect and a color to add with
/** \param combineAlpha - When true then combine alpha channels. When false replace target image alpha with source image alpha.
*/
virtual void copyToWithAlpha(IImage* target, const core::position2d<s32>& pos,
const core::rect<s32>& sourceRect, const SColor &color,
const core::rect<s32>* clipRect = 0) =0;
const core::rect<s32>* clipRect = 0,
bool combineAlpha=false) =0;
//! copies this surface into another, scaling it to fit, applying a box filter
virtual void copyToScalingBoxFilter(IImage* target, s32 bias = 0, bool blend = false) = 0;

View File

@ -7,6 +7,7 @@
#include "IReferenceCounted.h"
#include "IImage.h"
#include "ITexture.h"
#include "path.h"
#include "irrArray.h"

View File

@ -105,6 +105,16 @@ enum E_TEXTURE_SOURCE
ETS_FROM_FILE
};
//! Enumeration describing the type of ITexture.
enum E_TEXTURE_TYPE
{
//! 2D texture.
ETT_2D,
//! Cubemap texture.
ETT_CUBEMAP
};
//! Interface of a Video Driver dependent Texture.
/** An ITexture is created by an IVideoDriver by using IVideoDriver::addTexture
or IVideoDriver::getTexture. After that, the texture may only be used by this

View File

@ -872,6 +872,10 @@ precision will be lower but speed higher. currently X86 only
#endif
#endif
#ifndef __has_feature
#define __has_feature(x) 0 // Compatibility with non-clang compilers.
#endif
#ifdef _DEBUG
//! A few attributes are written in CSceneManager when _IRR_SCENEMANAGER_DEBUG is enabled
// NOTE: Those attributes were used always until 1.8.0 and became a global define for 1.8.1

View File

@ -130,7 +130,7 @@ namespace video
};
//! Names for ECOLOR_FORMAT types
const c8* const ColorFormatNames[ECF_UNKNOWN+1] =
const c8* const ColorFormatNames[ECF_UNKNOWN+2] =
{
"A1R5G5B5",
"R5G6B5",
@ -163,6 +163,7 @@ namespace video
"D16",
"D32",
"D24S8",
"UNKNOWN",
0
};

View File

@ -210,7 +210,7 @@ virtual void somefunc() _IRR_OVERRIDE_;
#define _IRR_OVERRIDE_ override
#elif (_MSC_VER >= 1600 ) /* supported since MSVC 2010 */
#define _IRR_OVERRIDE_ override
#elif (__clang_major__ >= 3)
#elif (__clang_major__ >= 3 && __has_feature(cxx_override_control))
#define _IRR_OVERRIDE_ override
#else
#define _IRR_OVERRIDE_

View File

@ -311,7 +311,7 @@ namespace irr
//! Creates an Irrlicht device. The Irrlicht device is the root object for using the engine.
/** If you need more parameters to be passed to the creation of the Irrlicht Engine device,
use the createDeviceEx() function.
\param deviceType: Type of the device. This can currently be video::EDT_NULL,
\param driverType: Type of the video driver to use. This can currently be video::EDT_NULL,
video::EDT_SOFTWARE, video::EDT_BURNINGSVIDEO, video::EDT_DIRECT3D9 and video::EDT_OPENGL.
\param windowSize: Size of the window or the video mode in fullscreen mode.
\param bits: Bits per pixel in fullscreen mode. Ignored if windowed mode.
@ -327,7 +327,7 @@ namespace irr
device could not be created.
*/
extern "C" IRRLICHT_API IrrlichtDevice* IRRCALLCONV createDevice(
video::E_DRIVER_TYPE deviceType = video::EDT_SOFTWARE,
video::E_DRIVER_TYPE driverType = video::EDT_SOFTWARE,
// parentheses are necessary for some compilers
const core::dimension2d<u32>& windowSize = (core::dimension2d<u32>(640,480)),
u32 bits = 32,
@ -338,7 +338,7 @@ namespace irr
//! typedef for Function Pointer
typedef IrrlichtDevice* (IRRCALLCONV *funcptr_createDevice )(
video::E_DRIVER_TYPE deviceType,
video::E_DRIVER_TYPE driverType,
const core::dimension2d<u32>& windowSize,
u32 bits,
bool fullscreen,

View File

@ -1371,66 +1371,66 @@ namespace core
#endif
const CMatrix4<T> &m = *this;
f32 d = (m(0, 0) * m(1, 1) - m(0, 1) * m(1, 0)) * (m(2, 2) * m(3, 3) - m(2, 3) * m(3, 2)) -
(m(0, 0) * m(1, 2) - m(0, 2) * m(1, 0)) * (m(2, 1) * m(3, 3) - m(2, 3) * m(3, 1)) +
(m(0, 0) * m(1, 3) - m(0, 3) * m(1, 0)) * (m(2, 1) * m(3, 2) - m(2, 2) * m(3, 1)) +
(m(0, 1) * m(1, 2) - m(0, 2) * m(1, 1)) * (m(2, 0) * m(3, 3) - m(2, 3) * m(3, 0)) -
(m(0, 1) * m(1, 3) - m(0, 3) * m(1, 1)) * (m(2, 0) * m(3, 2) - m(2, 2) * m(3, 0)) +
(m(0, 2) * m(1, 3) - m(0, 3) * m(1, 2)) * (m(2, 0) * m(3, 1) - m(2, 1) * m(3, 0));
f32 d = (m[0] * m[5] - m[1] * m[4]) * (m[10] * m[15] - m[11] * m[14]) -
(m[0] * m[6] - m[2] * m[4]) * (m[9] * m[15] - m[11] * m[13]) +
(m[0] * m[7] - m[3] * m[4]) * (m[9] * m[14] - m[10] * m[13]) +
(m[1] * m[6] - m[2] * m[5]) * (m[8] * m[15] - m[11] * m[12]) -
(m[1] * m[7] - m[3] * m[5]) * (m[8] * m[14] - m[10] * m[12]) +
(m[2] * m[7] - m[3] * m[6]) * (m[8] * m[13] - m[9] * m[12]);
if( core::iszero ( d, FLT_MIN ) )
return false;
d = core::reciprocal ( d );
out(0, 0) = d * (m(1, 1) * (m(2, 2) * m(3, 3) - m(2, 3) * m(3, 2)) +
m(1, 2) * (m(2, 3) * m(3, 1) - m(2, 1) * m(3, 3)) +
m(1, 3) * (m(2, 1) * m(3, 2) - m(2, 2) * m(3, 1)));
out(0, 1) = d * (m(2, 1) * (m(0, 2) * m(3, 3) - m(0, 3) * m(3, 2)) +
m(2, 2) * (m(0, 3) * m(3, 1) - m(0, 1) * m(3, 3)) +
m(2, 3) * (m(0, 1) * m(3, 2) - m(0, 2) * m(3, 1)));
out(0, 2) = d * (m(3, 1) * (m(0, 2) * m(1, 3) - m(0, 3) * m(1, 2)) +
m(3, 2) * (m(0, 3) * m(1, 1) - m(0, 1) * m(1, 3)) +
m(3, 3) * (m(0, 1) * m(1, 2) - m(0, 2) * m(1, 1)));
out(0, 3) = d * (m(0, 1) * (m(1, 3) * m(2, 2) - m(1, 2) * m(2, 3)) +
m(0, 2) * (m(1, 1) * m(2, 3) - m(1, 3) * m(2, 1)) +
m(0, 3) * (m(1, 2) * m(2, 1) - m(1, 1) * m(2, 2)));
out(1, 0) = d * (m(1, 2) * (m(2, 0) * m(3, 3) - m(2, 3) * m(3, 0)) +
m(1, 3) * (m(2, 2) * m(3, 0) - m(2, 0) * m(3, 2)) +
m(1, 0) * (m(2, 3) * m(3, 2) - m(2, 2) * m(3, 3)));
out(1, 1) = d * (m(2, 2) * (m(0, 0) * m(3, 3) - m(0, 3) * m(3, 0)) +
m(2, 3) * (m(0, 2) * m(3, 0) - m(0, 0) * m(3, 2)) +
m(2, 0) * (m(0, 3) * m(3, 2) - m(0, 2) * m(3, 3)));
out(1, 2) = d * (m(3, 2) * (m(0, 0) * m(1, 3) - m(0, 3) * m(1, 0)) +
m(3, 3) * (m(0, 2) * m(1, 0) - m(0, 0) * m(1, 2)) +
m(3, 0) * (m(0, 3) * m(1, 2) - m(0, 2) * m(1, 3)));
out(1, 3) = d * (m(0, 2) * (m(1, 3) * m(2, 0) - m(1, 0) * m(2, 3)) +
m(0, 3) * (m(1, 0) * m(2, 2) - m(1, 2) * m(2, 0)) +
m(0, 0) * (m(1, 2) * m(2, 3) - m(1, 3) * m(2, 2)));
out(2, 0) = d * (m(1, 3) * (m(2, 0) * m(3, 1) - m(2, 1) * m(3, 0)) +
m(1, 0) * (m(2, 1) * m(3, 3) - m(2, 3) * m(3, 1)) +
m(1, 1) * (m(2, 3) * m(3, 0) - m(2, 0) * m(3, 3)));
out(2, 1) = d * (m(2, 3) * (m(0, 0) * m(3, 1) - m(0, 1) * m(3, 0)) +
m(2, 0) * (m(0, 1) * m(3, 3) - m(0, 3) * m(3, 1)) +
m(2, 1) * (m(0, 3) * m(3, 0) - m(0, 0) * m(3, 3)));
out(2, 2) = d * (m(3, 3) * (m(0, 0) * m(1, 1) - m(0, 1) * m(1, 0)) +
m(3, 0) * (m(0, 1) * m(1, 3) - m(0, 3) * m(1, 1)) +
m(3, 1) * (m(0, 3) * m(1, 0) - m(0, 0) * m(1, 3)));
out(2, 3) = d * (m(0, 3) * (m(1, 1) * m(2, 0) - m(1, 0) * m(2, 1)) +
m(0, 0) * (m(1, 3) * m(2, 1) - m(1, 1) * m(2, 3)) +
m(0, 1) * (m(1, 0) * m(2, 3) - m(1, 3) * m(2, 0)));
out(3, 0) = d * (m(1, 0) * (m(2, 2) * m(3, 1) - m(2, 1) * m(3, 2)) +
m(1, 1) * (m(2, 0) * m(3, 2) - m(2, 2) * m(3, 0)) +
m(1, 2) * (m(2, 1) * m(3, 0) - m(2, 0) * m(3, 1)));
out(3, 1) = d * (m(2, 0) * (m(0, 2) * m(3, 1) - m(0, 1) * m(3, 2)) +
m(2, 1) * (m(0, 0) * m(3, 2) - m(0, 2) * m(3, 0)) +
m(2, 2) * (m(0, 1) * m(3, 0) - m(0, 0) * m(3, 1)));
out(3, 2) = d * (m(3, 0) * (m(0, 2) * m(1, 1) - m(0, 1) * m(1, 2)) +
m(3, 1) * (m(0, 0) * m(1, 2) - m(0, 2) * m(1, 0)) +
m(3, 2) * (m(0, 1) * m(1, 0) - m(0, 0) * m(1, 1)));
out(3, 3) = d * (m(0, 0) * (m(1, 1) * m(2, 2) - m(1, 2) * m(2, 1)) +
m(0, 1) * (m(1, 2) * m(2, 0) - m(1, 0) * m(2, 2)) +
m(0, 2) * (m(1, 0) * m(2, 1) - m(1, 1) * m(2, 0)));
out[0] = d * (m[5] * (m[10] * m[15] - m[11] * m[14]) +
m[6] * (m[11] * m[13] - m[9] * m[15]) +
m[7] * (m[9] * m[14] - m[10] * m[13]));
out[1] = d * (m[9] * (m[2] * m[15] - m[3] * m[14]) +
m[10] * (m[3] * m[13] - m[1] * m[15]) +
m[11] * (m[1] * m[14] - m[2] * m[13]));
out[2] = d * (m[13] * (m[2] * m[7] - m[3] * m[6]) +
m[14] * (m[3] * m[5] - m[1] * m[7]) +
m[15] * (m[1] * m[6] - m[2] * m[5]));
out[3] = d * (m[1] * (m[7] * m[10] - m[6] * m[11]) +
m[2] * (m[5] * m[11] - m[7] * m[9]) +
m[3] * (m[6] * m[9] - m[5] * m[10]));
out[4] = d * (m[6] * (m[8] * m[15] - m[11] * m[12]) +
m[7] * (m[10] * m[12] - m[8] * m[14]) +
m[4] * (m[11] * m[14] - m[10] * m[15]));
out[5] = d * (m[10] * (m[0] * m[15] - m[3] * m[12]) +
m[11] * (m[2] * m[12] - m[0] * m[14]) +
m[8] * (m[3] * m[14] - m[2] * m[15]));
out[6] = d * (m[14] * (m[0] * m[7] - m[3] * m[4]) +
m[15] * (m[2] * m[4] - m[0] * m[6]) +
m[12] * (m[3] * m[6] - m[2] * m[7]));
out[7] = d * (m[2] * (m[7] * m[8] - m[4] * m[11]) +
m[3] * (m[4] * m[10] - m[6] * m[8]) +
m[0] * (m[6] * m[11] - m[7] * m[10]));
out[8] = d * (m[7] * (m[8] * m[13] - m[9] * m[12]) +
m[4] * (m[9] * m[15] - m[11] * m[13]) +
m[5] * (m[11] * m[12] - m[8] * m[15]));
out[9] = d * (m[11] * (m[0] * m[13] - m[1] * m[12]) +
m[8] * (m[1] * m[15] - m[3] * m[13]) +
m[9] * (m[3] * m[12] - m[0] * m[15]));
out[10] = d * (m[15] * (m[0] * m[5] - m[1] * m[4]) +
m[12] * (m[1] * m[7] - m[3] * m[5]) +
m[13] * (m[3] * m[4] - m[0] * m[7]));
out[11] = d * (m[3] * (m[5] * m[8] - m[4] * m[9]) +
m[0] * (m[7] * m[9] - m[5] * m[11]) +
m[1] * (m[4] * m[11] - m[7] * m[8]));
out[12] = d * (m[4] * (m[10] * m[13] - m[9] * m[14]) +
m[5] * (m[8] * m[14] - m[10] * m[12]) +
m[6] * (m[9] * m[12] - m[8] * m[13]));
out[13] = d * (m[8] * (m[2] * m[13] - m[1] * m[14]) +
m[9] * (m[0] * m[14] - m[2] * m[12]) +
m[10] * (m[1] * m[12] - m[0] * m[13]));
out[14] = d * (m[12] * (m[2] * m[5] - m[1] * m[6]) +
m[13] * (m[0] * m[6] - m[2] * m[4]) +
m[14] * (m[1] * m[4] - m[0] * m[5]));
out[15] = d * (m[0] * (m[5] * m[10] - m[6] * m[9]) +
m[1] * (m[6] * m[8] - m[4] * m[10]) +
m[2] * (m[4] * m[9] - m[5] * m[8]));
#if defined ( USE_MATRIX_TEST )
out.definitelyIdentityMatrix = definitelyIdentityMatrix;

View File

@ -23,24 +23,24 @@ namespace scene
void AngleQuaternion(const core::vector3df& angles, vec4_hl quaternion)
{
f32 angle;
f32 sr, sp, sy, cr, cp, cy;
double angle;
double sr, sp, sy, cr, cp, cy;
// FIXME: rescale the inputs to 1/2 angle
angle = angles.Z * 0.5f;
angle = angles.Z * 0.5;
sy = sin(angle);
cy = cos(angle);
angle = angles.Y * 0.5f;
angle = angles.Y * 0.5;
sp = sin(angle);
cp = cos(angle);
angle = angles.X * 0.5f;
angle = angles.X * 0.5;
sr = sin(angle);
cr = cos(angle);
quaternion[0] = sr*cp*cy-cr*sp*sy; // X
quaternion[1] = cr*sp*cy+sr*cp*sy; // Y
quaternion[2] = cr*cp*sy-sr*sp*cy; // Z
quaternion[3] = cr*cp*cy+sr*sp*sy; // W
quaternion[0] = (irr::f32)(sr*cp*cy-cr*sp*sy); // X
quaternion[1] = (irr::f32)(cr*sp*cy+sr*cp*sy); // Y
quaternion[2] = (irr::f32)(cr*cp*sy-sr*sp*cy); // Z
quaternion[3] = (irr::f32)(cr*cp*cy+sr*sp*sy); // W
}
void QuaternionMatrix( const vec4_hl quaternion, f32 (*matrix)[4] )

View File

@ -13,7 +13,7 @@ namespace io
{
/*
basic types
Basic types, check documentation in IAttribute.h to see how they generally work.
*/
// Attribute implemented for boolean values
@ -1142,19 +1142,6 @@ public:
}
}
//! is it a number list?
virtual bool isNumberList()
{
return true;
}
//! is it a float list?
virtual bool isFloat()
{
return IsFloat;
}
virtual E_ATTRIBUTE_TYPE getType() const _IRR_OVERRIDE_
{
if (IsFloat)

View File

@ -981,6 +981,166 @@ static void executeBlit_ColorAlpha_32_to_32( const SBlitJob * job )
}
}
/*!
Combine alpha channels (increases alpha / reduces transparency)
*/
static void executeBlit_TextureCombineColor_16_to_16( const SBlitJob * job )
{
const u32 w = job->width * 2;
const u32 h = job->height * 2;
u8* src = (u8*) job->src;
u8* dst = (u8*) job->dst;
const u16 jobColor = video::A8R8G8B8toA1R5G5B5( job->argb );
/*
Stretch not supported.
*/
for ( u32 dy = 0; dy != h; dy+=2 )
{
for ( u32 dx = 0; dx != w; dx+=2 )
{
const u16 src_x = src[dx] << 8 | src[dx+1];
const u16 dst_x = dst[dx] << 8 | dst[dx+1];
dst[dx] = PixelCombine16( dst_x, PixelMul16_2( src_x, jobColor ) );
}
src = (src) + job->srcPitch;
dst = (dst) + job->dstPitch;
}
}
/*!
Combine alpha channels (increases alpha / reduces transparency)
*/
static void executeBlit_TextureCombineColor_16_to_24( const SBlitJob * job )
{
const u32 w = job->width;
const u32 h = job->height;
const u16 *src = static_cast<const u16*>(job->src);
u8 *dst = static_cast<u8*>(job->dst);
const u16 jobColor = video::A8R8G8B8toA1R5G5B5( job->argb );
if (job->stretch)
{
const float wscale = 1.f/job->x_stretch;
const float hscale = 1.f/job->y_stretch;
for ( u32 dy = 0; dy < h; ++dy )
{
const u32 src_y = (u32)(dy*hscale);
src = (u16*) ( (u8*) (job->src) + job->srcPitch*src_y );
for ( u32 dx = 0; dx < w; ++dx )
{
const u32 src_x = (u32)(dx*wscale);
u32 color = PixelMul16_2( video::A1R5G5B5toA8R8G8B8(src[src_x]), jobColor);
u8 * writeTo = &dst[dx * 3];
if ( video::getAlpha(src[src_x]) > 0 ) // only overlay if source has visible alpha (alpha == 1)
{
*writeTo++ = (color >> 16)& 0xFF;
*writeTo++ = (color >> 8) & 0xFF;
*writeTo++ = color & 0xFF;
}
}
dst += job->dstPitch;
}
}
else
{
for ( u32 dy = 0; dy != h; ++dy )
{
for ( u32 dx = 0; dx != w; ++dx )
{
u32 color = PixelMul16_2( video::A1R5G5B5toA8R8G8B8(src[dx]), jobColor);
u8 * writeTo = &dst[dx * 3];
if ( video::getAlpha(src[dx]) > 0 ) // only overlay if source has visible alpha (alpha == 1)
{
*writeTo++ = (color >> 16)& 0xFF;
*writeTo++ = (color >> 8) & 0xFF;
*writeTo++ = color & 0xFF;
}
}
src = (u16*) ( (u8*) (src) + job->srcPitch );
dst += job->dstPitch;
}
}
}
/*!
Combine alpha channels (increases alpha / reduces transparency)
Destination alpha is treated as full 255
*/
static void executeBlit_TextureCombineColor_32_to_24( const SBlitJob * job )
{
const u32 w = job->width;
const u32 h = job->height;
const u32 *src = static_cast<const u32*>(job->src);
u8 *dst = static_cast<u8*>(job->dst);
if (job->stretch)
{
const float wscale = 1.f/job->x_stretch;
const float hscale = 1.f/job->y_stretch;
for ( u32 dy = 0; dy < h; ++dy )
{
const u32 src_y = (u32)(dy*hscale);
src = (u32*) ( (u8*) (job->src) + job->srcPitch*src_y);
for ( u32 dx = 0; dx < w; ++dx )
{
const u32 src_x = src[(u32)(dx*wscale)];
u8* writeTo = &dst[dx * 3];
const u32 dst_x = 0xFF000000 | writeTo[0] << 16 | writeTo[1] << 8 | writeTo[2];
const u32 combo = PixelCombine32( dst_x, PixelMul32_2( src_x, job->argb ) );
*writeTo++ = (combo >> 16) & 0xFF;
*writeTo++ = (combo >> 8) & 0xFF;
*writeTo++ = combo & 0xFF;
}
dst += job->dstPitch;
}
}
else
{
for ( u32 dy = 0; dy != h; ++dy )
{
for ( u32 dx = 0; dx != w; ++dx )
{
u8* writeTo = &dst[dx * 3];
const u32 dst_x = 0xFF000000 | writeTo[0] << 16 | writeTo[1] << 8 | writeTo[2];
const u32 combo = PixelCombine32( dst_x, PixelMul32_2( src[dx], job->argb ) );
*writeTo++ = (combo >> 16) & 0xFF;
*writeTo++ = (combo >> 8) & 0xFF;
*writeTo++ = combo & 0xFF;
}
src = (u32*) ( (u8*) (src) + job->srcPitch );
dst += job->dstPitch;
}
}
}
/*!
Combine alpha channels (increases alpha / reduces transparency)
*/
static void executeBlit_TextureCombineColor_32_to_32( const SBlitJob * job )
{
u32 *src = (u32*) job->src;
u32 *dst = (u32*) job->dst;
for ( s32 dy = 0; dy != job->height; ++dy )
{
for ( s32 dx = 0; dx != job->width; ++dx )
{
dst[dx] = PixelCombine32( dst[dx], PixelMul32_2( src[dx], job->argb ) );
}
src = (u32*) ( (u8*) (src) + job->srcPitch );
dst = (u32*) ( (u8*) (dst) + job->dstPitch );
}
}
// Blitter Operation
enum eBlitter
{
@ -989,7 +1149,8 @@ enum eBlitter
BLITTER_COLOR_ALPHA,
BLITTER_TEXTURE,
BLITTER_TEXTURE_ALPHA_BLEND,
BLITTER_TEXTURE_ALPHA_COLOR_BLEND
BLITTER_TEXTURE_ALPHA_COLOR_BLEND,
BLITTER_TEXTURE_COMBINE_ALPHA,
};
typedef void (*tExecuteBlit) ( const SBlitJob * job );
@ -1022,6 +1183,14 @@ static const blitterTable blitTable[] =
{ BLITTER_COLOR, video::ECF_A8R8G8B8, -1, executeBlit_Color_32_to_32 },
{ BLITTER_COLOR_ALPHA, video::ECF_A1R5G5B5, -1, executeBlit_ColorAlpha_16_to_16 },
{ BLITTER_COLOR_ALPHA, video::ECF_A8R8G8B8, -1, executeBlit_ColorAlpha_32_to_32 },
{ BLITTER_TEXTURE_COMBINE_ALPHA, video::ECF_A8R8G8B8, video::ECF_A8R8G8B8, executeBlit_TextureCombineColor_32_to_32 },
{ BLITTER_TEXTURE_COMBINE_ALPHA, video::ECF_A8R8G8B8, video::ECF_R8G8B8, executeBlit_TextureCopy_24_to_32 },
{ BLITTER_TEXTURE_COMBINE_ALPHA, video::ECF_R8G8B8, video::ECF_A8R8G8B8, executeBlit_TextureCombineColor_32_to_24 },
{ BLITTER_TEXTURE_COMBINE_ALPHA, video::ECF_R8G8B8, video::ECF_R8G8B8, executeBlit_TextureCopy_x_to_x },
{ BLITTER_TEXTURE_COMBINE_ALPHA, video::ECF_A1R5G5B5, video::ECF_R8G8B8, executeBlit_TextureCopy_24_to_16 },
{ BLITTER_TEXTURE_COMBINE_ALPHA, video::ECF_A1R5G5B5, video::ECF_A1R5G5B5, executeBlit_TextureCombineColor_16_to_16 },
{ BLITTER_TEXTURE_COMBINE_ALPHA, video::ECF_A1R5G5B5, video::ECF_R8G8B8, executeBlit_TextureCopy_24_to_16 },
{ BLITTER_TEXTURE_COMBINE_ALPHA, video::ECF_R8G8B8, video::ECF_A1R5G5B5, executeBlit_TextureCombineColor_16_to_24 },
{ BLITTER_INVALID, -1, -1, 0 }
};

View File

@ -165,7 +165,7 @@ void CColorConverter::convert8BitTo32Bit(const u8* in, u8* out, s32 width, s32 h
out += lineWidth * height;
u32 x;
register u32 c;
u32 c;
for (u32 y=0; y < (u32) height; ++y)
{
if (flip)

View File

@ -69,7 +69,6 @@ namespace video
XVisualInfo* VisualInfo;
void* glxFBConfig; // GLXFBConfig
XID GlxWin; // GLXWindow
ECOLOR_FORMAT ColorFormat;
};
}
}

View File

@ -289,7 +289,6 @@ void CGUIButton::draw()
core::position2di pos(buttonCenter);
if ( Pressed )
{
IGUISkin* skin = Environment->getSkin();
pos.X += skin->getSize(EGDS_BUTTON_PRESSED_SPRITE_OFFSET_X);
pos.Y += skin->getSize(EGDS_BUTTON_PRESSED_SPRITE_OFFSET_Y);
}

View File

@ -564,17 +564,6 @@ bool CGUIEnvironment::postEventFromUser(const SEvent& event)
switch(event.EventType)
{
case EET_GUI_EVENT:
if ( event.EventType == EET_GUI_EVENT
&& event.GUIEvent.EventType == EGET_ELEMENT_REMOVED )
{
// TODO: In theory we could also check Focus, Hovered and ToolTip.Element here.
// But not trivial (aka - test *a lot* when you try to change, especially GUI editor).
// Focus might still be the easiest to get working (and most important, it was one of the reasons I added EGET_ELEMENT_REMOVED ...)
if ( UserReceiver )
UserReceiver->OnEvent(event);
}
else
{
// hey, why is the user sending gui events..?
}

View File

@ -69,7 +69,7 @@ CGUIFileOpenDialog::CGUIFileOpenDialog(const wchar_t* title,
color = skin->getColor(EGDC_WINDOW_SYMBOL);
}
const s32 buttonw = skin->getSize(EGDS_WINDOW_BUTTON_WIDTH);
const s32 buttonw = skin ? skin->getSize(EGDS_WINDOW_BUTTON_WIDTH) : 2;
const s32 posx = RelativeRect.getWidth() - buttonw - 4;
CloseButton = Environment->addButton(core::rect<s32>(posx, 3, posx + buttonw, 3 + buttonw), this, -1,
@ -437,7 +437,7 @@ void CGUIFileOpenDialog::sendSelectedEvent( EGUI_EVENT_TYPE type)
}
//! sends the event that the file choose process has been canceld
//! sends the event that the file choose process has been cancelled
void CGUIFileOpenDialog::sendCancelEvent()
{
SEvent event;

View File

@ -235,18 +235,18 @@ void CGUITabControl::refreshSprites()
if (skin)
{
color = skin->getColor(isEnabled() ? EGDC_WINDOW_SYMBOL : EGDC_GRAY_WINDOW_SYMBOL);
}
if (UpButton)
{
UpButton->setSprite(EGBS_BUTTON_UP, skin->getIcon(EGDI_CURSOR_LEFT), color);
UpButton->setSprite(EGBS_BUTTON_DOWN, skin->getIcon(EGDI_CURSOR_LEFT), color);
}
if (UpButton)
{
UpButton->setSprite(EGBS_BUTTON_UP, skin->getIcon(EGDI_CURSOR_LEFT), color);
UpButton->setSprite(EGBS_BUTTON_DOWN, skin->getIcon(EGDI_CURSOR_LEFT), color);
}
if (DownButton)
{
DownButton->setSprite(EGBS_BUTTON_UP, skin->getIcon(EGDI_CURSOR_RIGHT), color);
DownButton->setSprite(EGBS_BUTTON_DOWN, skin->getIcon(EGDI_CURSOR_RIGHT), color);
if (DownButton)
{
DownButton->setSprite(EGBS_BUTTON_UP, skin->getIcon(EGDI_CURSOR_RIGHT), color);
DownButton->setSprite(EGBS_BUTTON_DOWN, skin->getIcon(EGDI_CURSOR_RIGHT), color);
}
}
}

View File

@ -145,7 +145,7 @@ void CImage::copyTo(IImage* target, const core::position2d<s32>& pos, const core
//! copies this surface into another, using the alpha mask, a cliprect and a color to add with
void CImage::copyToWithAlpha(IImage* target, const core::position2d<s32>& pos, const core::rect<s32>& sourceRect, const SColor &color, const core::rect<s32>* clipRect)
void CImage::copyToWithAlpha(IImage* target, const core::position2d<s32>& pos, const core::rect<s32>& sourceRect, const SColor &color, const core::rect<s32>* clipRect, bool combineAlpha)
{
if (IImage::isCompressedFormat(Format))
{
@ -153,9 +153,16 @@ void CImage::copyToWithAlpha(IImage* target, const core::position2d<s32>& pos, c
return;
}
// color blend only necessary on not full spectrum aka. color.color != 0xFFFFFFFF
Blit(color.color == 0xFFFFFFFF ? BLITTER_TEXTURE_ALPHA_BLEND: BLITTER_TEXTURE_ALPHA_COLOR_BLEND,
target, clipRect, &pos, this, &sourceRect, color.color);
if ( combineAlpha )
{
Blit(BLITTER_TEXTURE_COMBINE_ALPHA, target, clipRect, &pos, this, &sourceRect, color.color);
}
else
{
// color blend only necessary on not full spectrum aka. color.color != 0xFFFFFFFF
Blit(color.color == 0xFFFFFFFF ? BLITTER_TEXTURE_ALPHA_BLEND: BLITTER_TEXTURE_ALPHA_COLOR_BLEND,
target, clipRect, &pos, this, &sourceRect, color.color);
}
}

View File

@ -50,7 +50,7 @@ public:
//! copies this surface into another, using the alpha mask, an cliprect and a color to add with
virtual void copyToWithAlpha(IImage* target, const core::position2d<s32>& pos,
const core::rect<s32>& sourceRect, const SColor &color,
const core::rect<s32>* clipRect = 0) _IRR_OVERRIDE_;
const core::rect<s32>* clipRect = 0, bool combineAlpha=false) _IRR_OVERRIDE_;
//! copies this surface into another, scaling it to fit, applying a box filter
virtual void copyToScalingBoxFilter(IImage* target, s32 bias = 0, bool blend = false) _IRR_OVERRIDE_;

View File

@ -1028,7 +1028,7 @@ bool CIrrDeviceLinux::run()
{
char buf[8];
wchar_t wbuf[2];
} tmp = {0};
} tmp = {{0}};
XLookupString(&event.xkey, tmp.buf, sizeof(tmp.buf), &mp.X11Key, NULL);
irrevent.KeyInput.Char = tmp.wbuf[0];
}

View File

@ -329,15 +329,6 @@ namespace irr
&tmp, &tmp,
&itmp1, &itmp2,
&CursorPos.X, &CursorPos.Y, &maskreturn);
if (CursorPos.X < 0)
CursorPos.X = 0;
if (CursorPos.X > (s32) Device->Width)
CursorPos.X = Device->Width;
if (CursorPos.Y < 0)
CursorPos.Y = 0;
if (CursorPos.Y > (s32) Device->Height)
CursorPos.Y = Device->Height;
#endif
}

View File

@ -1045,7 +1045,7 @@ CIrrDeviceWin32::CIrrDeviceWin32(const SIrrlichtCreationParameters& params)
wcex.hIconSm = 0;
// if there is an icon, load it
wcex.hIcon = (HICON)LoadImage(hInstance, __TEXT("irrlicht.ico"), IMAGE_ICON, 0,0, LR_LOADFROMFILE);
wcex.hIcon = (HICON)LoadImage(hInstance, __TEXT("irrlicht.ico"), IMAGE_ICON, 0,0, LR_LOADFROMFILE | LR_DEFAULTSIZE);
RegisterClassEx(&wcex);

View File

@ -1393,7 +1393,7 @@ bool CNullDriver::checkPrimitiveCount(u32 prmCount) const
if (prmCount > m)
{
char tmp[1024];
sprintf(tmp,"Could not draw triangles, too many primitives(%u), maxium is %u.", prmCount, m);
sprintf(tmp,"Could not draw triangles, too many primitives(%u), maximum is %u.", prmCount, m);
os::Printer::log(tmp, ELL_ERROR);
return false;
}

View File

@ -170,12 +170,12 @@ class COpenGLCoreCacheHandler
public:
COpenGLCoreCacheHandler(TOpenGLDriver* driver) :
Driver(driver),
Driver(driver),
#if defined(_MSC_VER)
#pragma warning(push)
#pragma warning(disable: 4355) // Warning: "'this' : used in base member initializer list. ". It's OK, we don't use the reference in STextureCache constructor.
#endif
TextureCache(STextureCache(*this, driver->getDriverType(), driver->getFeature().TextureUnit)),
TextureCache(STextureCache(*this, driver->getDriverType(), driver->getFeature().TextureUnit)),
#if defined(_MSC_VER)
#pragma warning(pop)
#endif
@ -569,6 +569,21 @@ public:
}
}
//! Compare material to current cache and update it when there are differences
// Some material renderers do change the cache beyond the original material settings
// This correct the material to represent the current cache state again.
void correctCacheMaterial(irr::video::SMaterial& material)
{
// Fix textures which got removed
for ( u32 i=0; i < MATERIAL_MAX_TEXTURES; ++i )
{
if ( material.TextureLayer[i].Texture && !TextureCache[i] )
{
material.TextureLayer[i].Texture = 0;
}
}
}
protected:
TOpenGLDriver* Driver;
@ -585,7 +600,7 @@ protected:
bool BlendEquationInvalid;
bool BlendFuncInvalid;
bool BlendInvalid;
u8* ColorMask;
bool ColorMaskInvalid;

View File

@ -2114,6 +2114,7 @@ void COpenGLDriver::setRenderStates3DMode()
Material, LastMaterial, ResetRenderStates, this);
LastMaterial = Material;
CacheHandler->correctCacheMaterial(LastMaterial);
ResetRenderStates = false;
}
@ -2907,6 +2908,7 @@ void COpenGLDriver::setRenderStates2DMode(bool alpha, bool texture, bool alphaCh
setBasicRenderStates(currentMaterial, LastMaterial, resetAllRenderStates);
LastMaterial = currentMaterial;
CacheHandler->correctCacheMaterial(LastMaterial);
// no alphaChannel without texture
alphaChannel &= texture;

View File

@ -59,7 +59,7 @@ CSoftwareDriver::CSoftwareDriver(const core::dimension2d<u32>& windowSize, bool
// select render target
setRenderTarget(BackBuffer);
setRenderTargetImage(BackBuffer);
// select the right renderer
@ -269,11 +269,11 @@ bool CSoftwareDriver::setRenderTargetEx(IRenderTarget* target, u16 clearFlag, SC
if (RenderTargetTexture)
{
RenderTargetTexture->grab();
setRenderTarget(((CSoftwareTexture*)RenderTargetTexture)->getTexture());
setRenderTargetImage(((CSoftwareTexture*)RenderTargetTexture)->getTexture());
}
else
{
setRenderTarget(BackBuffer);
setRenderTargetImage(BackBuffer);
}
clearBuffers(clearFlag, clearColor, clearDepth, clearStencil);
@ -283,7 +283,7 @@ bool CSoftwareDriver::setRenderTargetEx(IRenderTarget* target, u16 clearFlag, SC
//! sets a render target
void CSoftwareDriver::setRenderTarget(video::CImage* image)
void CSoftwareDriver::setRenderTargetImage(video::CImage* image)
{
if (RenderTargetSurface)
RenderTargetSurface->drop();
@ -771,7 +771,7 @@ void CSoftwareDriver::OnResize(const core::dimension2d<u32>& size)
BackBuffer = new CImage(ECF_A1R5G5B5, realSize);
if (resetRT)
setRenderTarget(BackBuffer);
setRenderTargetImage(BackBuffer);
}
}

View File

@ -120,7 +120,7 @@ namespace video
protected:
//! sets a render target
void setRenderTarget(video::CImage* image);
void setRenderTargetImage(video::CImage* image);
//! sets the current Texture
bool setActiveTexture(u32 stage, video::ITexture* texture);

View File

@ -128,7 +128,7 @@ CBurningVideoDriver::CBurningVideoDriver(const irr::SIrrlichtCreationParameters&
umr->drop ();
// select render target
setRenderTarget(BackBuffer);
setRenderTargetImage(BackBuffer);
//reset Lightspace
LightSpace.reset ();
@ -426,11 +426,11 @@ bool CBurningVideoDriver::setRenderTargetEx(IRenderTarget* target, u16 clearFlag
if (RenderTargetTexture)
{
RenderTargetTexture->grab();
setRenderTarget(((CSoftwareTexture2*)RenderTargetTexture)->getTexture());
setRenderTargetImage(((CSoftwareTexture2*)RenderTargetTexture)->getTexture());
}
else
{
setRenderTarget(BackBuffer);
setRenderTargetImage(BackBuffer);
}
clearBuffers(clearFlag, clearColor, clearDepth, clearStencil);
@ -440,7 +440,7 @@ bool CBurningVideoDriver::setRenderTargetEx(IRenderTarget* target, u16 clearFlag
//! sets a render target
void CBurningVideoDriver::setRenderTarget(video::CImage* image)
void CBurningVideoDriver::setRenderTargetImage(video::CImage* image)
{
if (RenderTargetSurface)
RenderTargetSurface->drop();
@ -2000,7 +2000,7 @@ void CBurningVideoDriver::OnResize(const core::dimension2d<u32>& size)
BackBuffer = new CImage(BURNINGSHADER_COLOR_FORMAT, realSize);
if (resetRT)
setRenderTarget(BackBuffer);
setRenderTargetImage(BackBuffer);
}
}

View File

@ -170,7 +170,7 @@ namespace video
protected:
//! sets a render target
void setRenderTarget(video::CImage* image);
void setRenderTargetImage(video::CImage* image);
//! sets the current Texture
//bool setTexture(u32 stage, video::ITexture* texture);

View File

@ -31,6 +31,15 @@ namespace irr
namespace io
{
// All derived attribute types implement at least getter/setter for their own type (like CBoolAttribute will have setBool/getBool).
// Simple types will also implement getStringW and setString, but don't expect it to work for all types.
// String serialization makes no sense for some attribute-types (like stringw arrays or pointers), but is still useful for many types.
// (Note: I do _not_ know yet why the default string serialization is asymmetric with char* in set and wchar_t* in get).
// Additionally many attribute types will implement conversion functions like CBoolAttribute has p.E. getInt/setInt().
// The reason for conversion functions is likely to make reading old formats easier which have changed in the meantime. For example
// an old xml can contain a bool attribute which is an int in a newer format. You can still call getInt() even thought the attribute has the wrong type.
// And please do _not_ confuse these attributes here with the ones used in the xml-reader (aka SAttribute which is just a key-value pair).
class IAttribute : public virtual IReferenceCounted
{
public:

View File

@ -4,7 +4,7 @@
#include "IrrCompileConfig.h"
static const char* const copyright = "Irrlicht Engine (c) 2002-2012 Nikolaus Gebhardt";
static const char* const copyright = "Irrlicht Engine (c) 2002-2017 Nikolaus Gebhardt"; // put string in binary
#ifdef _IRR_WINDOWS_
#include <windows.h>
@ -54,6 +54,8 @@ namespace irr
u32 bits, bool fullscreen,
bool stencilbuffer, bool vsync, IEventReceiver* res)
{
(void)copyright; // prevent unused variable warning
SIrrlichtCreationParameters p;
p.DriverType = driverType;
p.WindowSize = windowSize;

View File

@ -0,0 +1,61 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 15
VisualStudioVersion = 15.0.27004.2008
MinimumVisualStudioVersion = 10.0.40219.1
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Irrlicht", "Irrlicht15.0.vcxproj", "{DD5C43CB-34A8-409B-9010-5A5A52787552}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Win32 = Debug|Win32
Debug|x64 = Debug|x64
Release - Fast FPU|Win32 = Release - Fast FPU|Win32
Release - Fast FPU|x64 = Release - Fast FPU|x64
Release|Win32 = Release|Win32
Release|x64 = Release|x64
SDL-Debug|Win32 = SDL-Debug|Win32
SDL-Debug|x64 = SDL-Debug|x64
Static lib - Debug|Win32 = Static lib - Debug|Win32
Static lib - Debug|x64 = Static lib - Debug|x64
Static lib - Release - Fast FPU|Win32 = Static lib - Release - Fast FPU|Win32
Static lib - Release - Fast FPU|x64 = Static lib - Release - Fast FPU|x64
Static lib - Release|Win32 = Static lib - Release|Win32
Static lib - Release|x64 = Static lib - Release|x64
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{DD5C43CB-34A8-409B-9010-5A5A52787552}.Debug|Win32.ActiveCfg = Debug|Win32
{DD5C43CB-34A8-409B-9010-5A5A52787552}.Debug|Win32.Build.0 = Debug|Win32
{DD5C43CB-34A8-409B-9010-5A5A52787552}.Debug|x64.ActiveCfg = Debug|x64
{DD5C43CB-34A8-409B-9010-5A5A52787552}.Debug|x64.Build.0 = Debug|x64
{DD5C43CB-34A8-409B-9010-5A5A52787552}.Release - Fast FPU|Win32.ActiveCfg = Release - Fast FPU|Win32
{DD5C43CB-34A8-409B-9010-5A5A52787552}.Release - Fast FPU|Win32.Build.0 = Release - Fast FPU|Win32
{DD5C43CB-34A8-409B-9010-5A5A52787552}.Release - Fast FPU|x64.ActiveCfg = Release - Fast FPU|x64
{DD5C43CB-34A8-409B-9010-5A5A52787552}.Release - Fast FPU|x64.Build.0 = Release - Fast FPU|x64
{DD5C43CB-34A8-409B-9010-5A5A52787552}.Release|Win32.ActiveCfg = Release|Win32
{DD5C43CB-34A8-409B-9010-5A5A52787552}.Release|Win32.Build.0 = Release|Win32
{DD5C43CB-34A8-409B-9010-5A5A52787552}.Release|x64.ActiveCfg = Release|x64
{DD5C43CB-34A8-409B-9010-5A5A52787552}.Release|x64.Build.0 = Release|x64
{DD5C43CB-34A8-409B-9010-5A5A52787552}.SDL-Debug|Win32.ActiveCfg = SDL-Debug|Win32
{DD5C43CB-34A8-409B-9010-5A5A52787552}.SDL-Debug|Win32.Build.0 = SDL-Debug|Win32
{DD5C43CB-34A8-409B-9010-5A5A52787552}.SDL-Debug|x64.ActiveCfg = SDL-Debug|x64
{DD5C43CB-34A8-409B-9010-5A5A52787552}.SDL-Debug|x64.Build.0 = SDL-Debug|x64
{DD5C43CB-34A8-409B-9010-5A5A52787552}.Static lib - Debug|Win32.ActiveCfg = Static lib - Debug|Win32
{DD5C43CB-34A8-409B-9010-5A5A52787552}.Static lib - Debug|Win32.Build.0 = Static lib - Debug|Win32
{DD5C43CB-34A8-409B-9010-5A5A52787552}.Static lib - Debug|x64.ActiveCfg = Static lib - Debug|x64
{DD5C43CB-34A8-409B-9010-5A5A52787552}.Static lib - Debug|x64.Build.0 = Static lib - Debug|x64
{DD5C43CB-34A8-409B-9010-5A5A52787552}.Static lib - Release - Fast FPU|Win32.ActiveCfg = Static lib - Release - Fast FPU|Win32
{DD5C43CB-34A8-409B-9010-5A5A52787552}.Static lib - Release - Fast FPU|Win32.Build.0 = Static lib - Release - Fast FPU|Win32
{DD5C43CB-34A8-409B-9010-5A5A52787552}.Static lib - Release - Fast FPU|x64.ActiveCfg = Static lib - Release - Fast FPU|x64
{DD5C43CB-34A8-409B-9010-5A5A52787552}.Static lib - Release - Fast FPU|x64.Build.0 = Static lib - Release - Fast FPU|x64
{DD5C43CB-34A8-409B-9010-5A5A52787552}.Static lib - Release|Win32.ActiveCfg = Static lib - Release|Win32
{DD5C43CB-34A8-409B-9010-5A5A52787552}.Static lib - Release|Win32.Build.0 = Static lib - Release|Win32
{DD5C43CB-34A8-409B-9010-5A5A52787552}.Static lib - Release|x64.ActiveCfg = Static lib - Release|x64
{DD5C43CB-34A8-409B-9010-5A5A52787552}.Static lib - Release|x64.Build.0 = Static lib - Release|x64
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {DF9BEF31-A6F9-42FD-9573-28F994828B0B}
EndGlobalSection
EndGlobal

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -342,7 +342,7 @@ inline u32 PixelBlend16_simd ( const u32 c2, const u32 c1 )
#endif
/*!
Pixel = dest * ( 1 - SourceAlpha ) + source * SourceAlpha
Pixel = dest * ( 1 - SourceAlpha ) + source * SourceAlpha (OpenGL blending)
*/
inline u32 PixelBlend32 ( const u32 c2, const u32 c1 )
{
@ -351,7 +351,6 @@ inline u32 PixelBlend32 ( const u32 c2, const u32 c1 )
if ( 0 == alpha )
return c2;
if ( 0xFF000000 == alpha )
{
return c1;
@ -386,6 +385,71 @@ inline u32 PixelBlend32 ( const u32 c2, const u32 c1 )
return (c1 & 0xFF000000) | rb | xg;
}
/*!
Pixel =>
color = sourceAlpha > 0 ? source, else dest
alpha = max(destAlpha, sourceAlpha)
*/
inline u16 PixelCombine16 ( const u16 c2, const u16 c1 )
{
if ( video::getAlpha(c1) > 0 )
return c1;
else
return c2;
}
/*!
Pixel =>
color = dest * ( 1 - SourceAlpha ) + source * SourceAlpha,
alpha = destAlpha * ( 1 - SourceAlpha ) + sourceAlpha
where "1" means "full scale" (255)
*/
inline u32 PixelCombine32 ( const u32 c2, const u32 c1 )
{
// alpha test
u32 alpha = c1 & 0xFF000000;
if ( 0 == alpha )
return c2;
if ( 0xFF000000 == alpha )
{
return c1;
}
alpha >>= 24;
// add highbit alpha, if ( alpha > 127 ) alpha += 1;
// stretches [0;255] to [0;256] to avoid division by 255. use division 256 == shr 8
alpha += ( alpha >> 7);
u32 srcRB = c1 & 0x00FF00FF;
u32 srcXG = c1 & 0x0000FF00;
u32 dstRB = c2 & 0x00FF00FF;
u32 dstXG = c2 & 0x0000FF00;
u32 rb = srcRB - dstRB;
u32 xg = srcXG - dstXG;
rb *= alpha;
xg *= alpha;
rb >>= 8;
xg >>= 8;
rb += dstRB;
xg += dstXG;
rb &= 0x00FF00FF;
xg &= 0x0000FF00;
u32 sa = c1 >> 24;
u32 da = c2 >> 24;
u32 blendAlpha_fix8 = (sa*256 + da*(256-alpha))>>8;
return blendAlpha_fix8 << 24 | rb | xg;
}
// ------------------ Fix Point ----------------------------------

View File

@ -318,6 +318,15 @@ bool stringSerialization(io::IFileSystem * fs)
, core::stringc(value).c_str(), core::stringc(value2).c_str(), i, attr->getAttributeName(i), __FILE__, __LINE__ );
return false;
}
else
{
// TODO: We can't catch yet if getAttributeAsString and setAttribute both change nothing
// Except if string returned is empty - which would be fine in some cases (0 pointers or if string was empty originally)
// But right now at least stringw arrays don't do stringSerialization which is a bug
//if ( value.empty() )
//return false;
}
}
attr->drop();

View File

@ -1,4 +1,4 @@
Tests finished. 61 tests of 61 passed.
Compiled as DEBUG
Test suite pass at GMT Mon Jan 17 10:25:55 2011
Tests finished. 1 test of 1 passed.
Compiled as DEBUG
Test suite pass at GMT Tue Nov 7 00:42:08 2017