- BurningVideo: 0.50

- 10 year anniversary update
  - Lighting model reworked. moved to eyespace like openGL. [Specular Highlights, Fog, Sphere/Reflection Map] 
  - increased internal s4DVertex to support 4 Textures and 4 Colors [switchable]
  - Textures are handled as sRGB during Mipmap Generation. More accurate, less visual disruption
  - 2D is drawn as 3D like hardware drivers. [switchable]. enables viewport scaling, material2D
  - Texture Spatial Resolution Limiting working. [lower memory consumption,SOFTWARE_DRIVER_2_TEXTURE_MAXSIZE]
  - SuperTuxKart 8.0.1 playable


git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@6086 dfc29bdd-3216-0410-991c-e03cc46cb475
This commit is contained in:
engineer_apple
2020-02-22 20:48:12 +00:00
parent 9c837aa41b
commit 86dd0cde26
57 changed files with 10240 additions and 3736 deletions

View File

@ -7,6 +7,7 @@
#include "CColorConverter.h"
#include "CBlit.h"
#include "os.h"
#include "SoftwareDriver2_helper.h"
namespace irr
{
@ -25,7 +26,7 @@ CImage::CImage(ECOLOR_FORMAT format, const core::dimension2d<u32>& size, void* d
{
const u32 dataSize = getDataSizeFromFormat(Format, Size.Width, Size.Height);
Data = new u8[dataSize];
Data = new u8[align_next(dataSize,16)];
memcpy(Data, data, dataSize);
DeleteMemory = true;
}
@ -35,7 +36,7 @@ CImage::CImage(ECOLOR_FORMAT format, const core::dimension2d<u32>& size, void* d
//! Constructor of empty image
CImage::CImage(ECOLOR_FORMAT format, const core::dimension2d<u32>& size) : IImage(format, size, true)
{
Data = new u8[getDataSizeFromFormat(Format, Size.Width, Size.Height)];
Data = new u8[align_next(getDataSizeFromFormat(Format, Size.Width, Size.Height),16)];
DeleteMemory = true;
}
@ -82,10 +83,8 @@ void CImage::setPixel(u32 x, u32 y, const SColor &color, bool blend)
os::Printer::log("IImage::setPixel unknown format.", ELL_WARNING);
return;
#ifndef _DEBUG
default:
break;
#endif
}
}
@ -118,10 +117,8 @@ SColor CImage::getPixel(u32 x, u32 y) const
os::Printer::log("IImage::getPixel unknown format.", ELL_WARNING);
break;
#ifndef _DEBUG
default:
break;
#endif
}
return SColor(0);
@ -137,9 +134,9 @@ void CImage::copyTo(IImage* target, const core::position2d<s32>& pos)
return;
}
if ( !Blit(BLITTER_TEXTURE, target, 0, &pos, this, 0, 0)
if (!Blit(BLITTER_TEXTURE, target, 0, &pos, this, 0, 0)
&& target && pos.X == 0 && pos.Y == 0 &&
CColorConverter::canConvertFormat(Format, target->getColorFormat()) )
CColorConverter::canConvertFormat(Format, target->getColorFormat()))
{
// No fast blitting, but copyToScaling uses other color conversions and might work
irr::core::dimension2du dim(target->getDimension());
@ -170,16 +167,9 @@ void CImage::copyToWithAlpha(IImage* target, const core::position2d<s32>& pos, c
return;
}
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);
}
eBlitter op = combineAlpha ? BLITTER_TEXTURE_COMBINE_ALPHA :
color.color == 0xFFFFFFFF ? BLITTER_TEXTURE_ALPHA_BLEND : BLITTER_TEXTURE_ALPHA_COLOR_BLEND;
Blit(op,target, clipRect, &pos, this, &sourceRect, color.color);
}
@ -390,5 +380,6 @@ inline SColor CImage::getPixelBox( s32 x, s32 y, s32 fx, s32 fy, s32 bias ) cons
}
} // end namespace video
} // end namespace irr