Merging r6364 through r6379 from trunk to ogl-es branch
git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/branches/ogl-es@6380 dfc29bdd-3216-0410-991c-e03cc46cb475
This commit is contained in:
@@ -10,7 +10,7 @@
|
||||
// Generic Render Flags for burning's video rasterizer
|
||||
// defined now in irrlicht compile config
|
||||
|
||||
#if 1 && defined(PATCH_SUPERTUX_8_0_1_with_1_9_0)
|
||||
#if defined(PATCH_SUPERTUX_8_0_1_with_1_9_0)
|
||||
#undef BURNINGVIDEO_RENDERER_BEAUTIFUL
|
||||
|
||||
#define SOFTWARE_DRIVER_2_PERSPECTIVE_CORRECT
|
||||
@@ -18,19 +18,19 @@
|
||||
#define SOFTWARE_DRIVER_2_BILINEAR
|
||||
#define SOFTWARE_DRIVER_2_LIGHTING
|
||||
#define SOFTWARE_DRIVER_2_USE_VERTEX_COLOR
|
||||
//#define SOFTWARE_DRIVER_2_USE_SEPARATE_SPECULAR_COLOR
|
||||
#define SOFTWARE_DRIVER_2_USE_SEPARATE_SPECULAR_COLOR
|
||||
#define SOFTWARE_DRIVER_2_USE_WBUFFER
|
||||
#define SOFTWARE_DRIVER_2_32BIT
|
||||
#define SOFTWARE_DRIVER_2_TEXTURE_COLOR_FORMAT ECF_A8R8G8B8
|
||||
#define SOFTWARE_DRIVER_2_RENDERTARGET_COLOR_FORMAT ECF_A8R8G8B8
|
||||
#define SOFTWARE_DRIVER_2_TEXTURE_MAXSIZE 256
|
||||
#define SOFTWARE_DRIVER_2_TEXTURE_MAXSIZE 0x100000
|
||||
#define SOFTWARE_DRIVER_2_TEXTURE_TRANSFORM
|
||||
#define SOFTWARE_DRIVER_2_MIPMAPPING_MAX 8
|
||||
#define SOFTWARE_DRIVER_2_MIPMAPPING_MAX 16
|
||||
#define SOFTWARE_DRIVER_2_MIPMAPPING_MIN_SIZE 1
|
||||
#define SOFTWARE_DRIVER_2_SCANLINE_MAG_MIN
|
||||
#define SOFTWARE_DRIVER_2_CLIPPING
|
||||
#define SOFTWARE_DRIVER_2_2D_AS_3D
|
||||
#define SOFTWARE_DRIVER_2_INTERLACED
|
||||
#define SOFTWARE_DRIVER_2_RENDERTARGET_SCALE
|
||||
|
||||
#endif
|
||||
|
||||
@@ -49,10 +49,10 @@
|
||||
#define SOFTWARE_DRIVER_2_TEXTURE_TRANSFORM
|
||||
#define SOFTWARE_DRIVER_2_MIPMAPPING_MAX 16
|
||||
#define SOFTWARE_DRIVER_2_MIPMAPPING_MIN_SIZE 1
|
||||
#define SOFTWARE_DRIVER_2_SCANLINE_MAG_MIN
|
||||
#define SOFTWARE_DRIVER_2_CLIPPING
|
||||
#define SOFTWARE_DRIVER_2_2D_AS_3D
|
||||
#define SOFTWARE_DRIVER_2_INTERLACED
|
||||
#define SOFTWARE_DRIVER_2_RENDERTARGET_SCALE
|
||||
#endif
|
||||
|
||||
//! Set Flags for Windows Mobile
|
||||
@@ -70,7 +70,6 @@
|
||||
//#define SOFTWARE_DRIVER_2_TEXTURE_TRANSFORM
|
||||
#define SOFTWARE_DRIVER_2_MIPMAPPING_MAX 4
|
||||
#define SOFTWARE_DRIVER_2_MIPMAPPING_MIN_SIZE 8
|
||||
#define SOFTWARE_DRIVER_2_SCANLINE_MAG_MIN
|
||||
//#define SOFTWARE_DRIVER_2_CLIPPING
|
||||
#define SOFTWARE_DRIVER_2_2D_AS_2D
|
||||
#endif
|
||||
@@ -88,7 +87,6 @@
|
||||
#define SOFTWARE_DRIVER_2_RENDERTARGET_COLOR_FORMAT ECF_A1R5G5B5
|
||||
#define SOFTWARE_DRIVER_2_MIPMAPPING_MAX 4
|
||||
#define SOFTWARE_DRIVER_2_MIPMAPPING_MIN_SIZE 8
|
||||
#define SOFTWARE_DRIVER_2_SCANLINE_MAG_MIN
|
||||
#define SOFTWARE_DRIVER_2_CLIPPING
|
||||
#define SOFTWARE_DRIVER_2_2D_AS_2D
|
||||
#define SOFTWARE_DRIVER_2_INTERLACED
|
||||
@@ -104,13 +102,12 @@
|
||||
#define SOFTWARE_DRIVER_2_USE_VERTEX_COLOR
|
||||
//#define SOFTWARE_DRIVER_2_USE_WBUFFER
|
||||
#define SOFTWARE_DRIVER_2_16BIT
|
||||
#define SOFTWARE_DRIVER_2_TEXTURE_MAXSIZE 128
|
||||
#define SOFTWARE_DRIVER_2_TEXTURE_MAXSIZE 256
|
||||
#define SOFTWARE_DRIVER_2_TEXTURE_COLOR_FORMAT ECF_A1R5G5B5
|
||||
#define SOFTWARE_DRIVER_2_RENDERTARGET_COLOR_FORMAT ECF_A1R5G5B5
|
||||
//#define SOFTWARE_DRIVER_2_TEXTURE_TRANSFORM
|
||||
#define SOFTWARE_DRIVER_2_MIPMAPPING_MAX 1
|
||||
#define SOFTWARE_DRIVER_2_MIPMAPPING_MIN_SIZE 1
|
||||
#define SOFTWARE_DRIVER_2_SCANLINE_MAG_MIN
|
||||
//#define SOFTWARE_DRIVER_2_CLIPPING
|
||||
#define SOFTWARE_DRIVER_2_2D_AS_2D
|
||||
#define SOFTWARE_DRIVER_2_INTERLACED
|
||||
@@ -126,6 +123,7 @@
|
||||
#endif
|
||||
|
||||
#define reciprocal_zero(x) ((x) != 0.f ? 1.f / (x):0.f)
|
||||
#define reciprocal_zero_pos_underflow(x) ((x) != 0.f ? 1.f / (x):0.f)
|
||||
#define reciprocal_one(x) ((x) != 0.f ? 1.f / (x):1.f)
|
||||
|
||||
//Control Scanline output
|
||||
@@ -138,44 +136,72 @@ static inline float fill_step_x(float x) { return x != 0.f ? (float)SOFTWARE_DRI
|
||||
|
||||
#define interlace_control_bit 1
|
||||
#define interlace_control_mask ((1<<interlace_control_bit)-1)
|
||||
struct interlaced_control
|
||||
union interlaced_control
|
||||
{
|
||||
unsigned enable : 1;
|
||||
unsigned bypass : 1;
|
||||
unsigned nr : interlace_control_bit;
|
||||
struct {
|
||||
unsigned enable : 1;
|
||||
unsigned bypass : 1;
|
||||
unsigned nr : interlace_control_bit;
|
||||
|
||||
unsigned target_scalex : 2; // 0 means 1
|
||||
unsigned target_scaley : 2;
|
||||
|
||||
unsigned tex_scalex : 2; // 0 means 1
|
||||
unsigned tex_scaley : 2;
|
||||
};
|
||||
unsigned raw;
|
||||
};
|
||||
struct interlace_scanline_data { unsigned int y; };
|
||||
|
||||
static inline interlaced_control interlace_disabled()
|
||||
static inline interlaced_control interlaced_disabled()
|
||||
{
|
||||
interlaced_control v;
|
||||
v.raw = 0;
|
||||
v.bypass = 1;
|
||||
/*
|
||||
v.enable = 0;
|
||||
v.bypass = 1;
|
||||
v.nr = 0;
|
||||
v.target_scalex = 0;
|
||||
v.target_scaley = 0;
|
||||
v.tex_scalex = 0;
|
||||
v.tex_scaley = 0;
|
||||
*/
|
||||
return v;
|
||||
}
|
||||
#if defined(SOFTWARE_DRIVER_2_INTERLACED)
|
||||
#define interlace_scanline if ( Interlaced.bypass | ((line.y & interlace_control_mask) == Interlaced.nr) )
|
||||
#define interlace_scanline_enabled if ( (line.y & interlace_control_mask) == Interlaced.nr )
|
||||
//#define interlace_scanline if ( Interlaced.disabled | (((line.y >> (interlace_control_bit-1) ) & 1) == (Interlaced.nr & 1)) )
|
||||
//#define interlace_scanline
|
||||
#define interlace_scanline_active ((line.y & interlace_control_mask) == Interlaced.nr)
|
||||
#define if_interlace_scanline_active if (interlace_scanline_active)
|
||||
#define if_interlace_scanline if ( Interlaced.bypass || interlace_scanline_active )
|
||||
#else
|
||||
#define interlace_scanline
|
||||
#define interlace_scanline_enabled
|
||||
#define if_interlace_scanline_active
|
||||
#define if_interlace_scanline
|
||||
#endif
|
||||
|
||||
#define scissor_test_y if ((~TL_Flag & TL_SCISSOR) || ((line.y >= Scissor.y0) & (line.y <= Scissor.y1)))
|
||||
#define scissor_test_x if ((~TL_Flag & TL_SCISSOR) || ((i+xStart >= Scissor.x0) & (i+xStart <= Scissor.x1)))
|
||||
#define if_scissor_test_y if ((~TL_Flag & TL_SCISSOR) || ((line.y >= Scissor.y0) & (line.y <= Scissor.y1)))
|
||||
#define if_scissor_test_x if ((~TL_Flag & TL_SCISSOR) || ((i+xStart >= Scissor.x0) & (i+xStart <= Scissor.x1)))
|
||||
|
||||
// https://inst.eecs.berkeley.edu/~cs184/sp04/as/as2/assgn-02_faqs.html
|
||||
//#define fill_convention_top_left(x) (s32) ceilf(x)
|
||||
//#define fill_convention_right(x) (s32) floorf(x)
|
||||
//#define fill_convention_right(x) (((s32) ceilf(x))-1)
|
||||
|
||||
// http://www.chrishecker.com/images/9/97/Gdmtex2.pdf
|
||||
#define fill_convention_top(y) (s32) ceilf(y)
|
||||
#define fill_convention_down(y) (((s32) ceilf(y))-1)
|
||||
#define fill_convention_left(x) (s32) ceilf(x)
|
||||
#define fill_convention_right(x) ((s32) ceilf(x))-1
|
||||
#define fill_convention_right(x) (((s32) ceilf(x))-1)
|
||||
|
||||
|
||||
#define fill_convention_none(x) (s32) (x)
|
||||
#define fill_convention_edge(x) (s32) floorf(fabsf(x)+0.f)
|
||||
//#define fill_convention_left(x) 65536 - int(65536.0f - x)
|
||||
#define fill_convention_edge(x) (s32) floorf(fabsf(x))
|
||||
|
||||
//fixpoint
|
||||
//#define fill_convention_top_left(x) 65536 - int(65536.0f - x)
|
||||
//#define fill_convention_right(x) 65535 - int(65536.0f - x)
|
||||
|
||||
|
||||
//Check coordinates are in render target/window space
|
||||
//Check that coordinates are in render target/window space
|
||||
//#define SOFTWARE_DRIVER_2_DO_CLIPCHECK
|
||||
#if defined (SOFTWARE_DRIVER_2_DO_CLIPCHECK) && defined(_WIN32)
|
||||
#define SOFTWARE_DRIVER_2_CLIPCHECK if( xStart < 0 || xStart + dx >= (s32)RenderTarget->getDimension().Width || line.y < 0 || line.y >= (s32) RenderTarget->getDimension().Height ) __debugbreak()
|
||||
@@ -241,6 +267,7 @@ typedef float ipoltype;
|
||||
#endif
|
||||
|
||||
#define ipol_lower_equal_0(n) ((n) <= (ipoltype)0.0)
|
||||
#define ipol_lower_0(n) ((n) < (ipoltype)0.0)
|
||||
#define ipol_greater_0(n) ((n) > (ipoltype)0.0)
|
||||
|
||||
#if (_MSC_VER > 1700 )
|
||||
@@ -249,33 +276,34 @@ typedef float ipoltype;
|
||||
#define burning_restrict
|
||||
#endif
|
||||
|
||||
/*
|
||||
if (condition) state |= mask; else state &= ~mask;
|
||||
*/
|
||||
static inline void burning_setbit(size_t& state, int condition, size_t mask)
|
||||
{
|
||||
if (condition) state |= mask;
|
||||
else state &= ~mask;
|
||||
}
|
||||
#if 0 && defined(_MSC_VER) && (_MSC_VER > 1500) && !defined(_DEBUG)
|
||||
#pragma auto_inline(on)
|
||||
#pragma inline_depth(255)
|
||||
#pragma inline_recursion(on)
|
||||
#endif
|
||||
|
||||
/*
|
||||
if (condition) state |= m; else state &= ~m;
|
||||
*/
|
||||
REALINLINE void burning_setbit32(unsigned int& state, int condition, const unsigned int mask)
|
||||
{
|
||||
// 0, or any positive to mask
|
||||
//s32 conmask = -condition >> 31;
|
||||
state ^= ((-condition >> 31) ^ state) & mask;
|
||||
}
|
||||
|
||||
#define burning_stringify(s) #s
|
||||
#define burning_create_indirect(s) create_##s
|
||||
#define burning_create(s) burning_create_indirect(s)
|
||||
|
||||
// don't want intend on namespaces (autoformat)
|
||||
#define burning_namespace_start namespace irr { namespace video {
|
||||
#define burning_namespace_end } /* end namespace video*/ } /* end namespace irr */
|
||||
|
||||
#if defined(PATCH_SUPERTUX_8_0_1_with_1_9_0)
|
||||
|
||||
#if defined(_MSC_VER) && _MSC_VER > 1310 && !defined (_WIN32_WCE)
|
||||
#define snprintf_irr sprintf_s
|
||||
#define EVDF_DEPTH_CLAMP 43
|
||||
#elif defined(__APPLE__)
|
||||
#define snprintf_irr snprintf
|
||||
#elif !defined(__CYGWIN__)
|
||||
#define swprintf_irr _snwprintf
|
||||
#define snprintf_irr _snprintf
|
||||
#endif
|
||||
|
||||
|
||||
//#define EVDF_DEPTH_CLAMP (video::E_VIDEO_DRIVER_FEATURE) 43
|
||||
#define E_CUBE_SURFACE int
|
||||
#define ECFN_DISABLED 0
|
||||
|
||||
|
Reference in New Issue
Block a user