Compare commits

...

5 Commits

Author SHA1 Message Date
cutealien 97472da9c2 Add (commented-out) linker flag for SDL to Makefile.
Just as minor hint to users when trying to link with SDL.

git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@5862 dfc29bdd-3216-0410-991c-e03cc46cb475
2019-09-03 20:23:57 +00:00
cutealien 0096ba7c7d Fix compilation with SDL device enabled and Windows device disabled.
Thanks @kas1e for reporting (http://irrlicht.sourceforge.net/forum/viewtopic.php?f=7&t=52083&p=304892#p304892)
Also did change some indention for readability.


git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@5861 dfc29bdd-3216-0410-991c-e03cc46cb475
2019-08-30 15:16:17 +00:00
cutealien ea7efdde45 Fix comment.
git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@5860 dfc29bdd-3216-0410-991c-e03cc46cb475
2019-08-29 22:31:48 +00:00
cutealien 3c31fb4730 Allow to override MaterialType in SOverrideMaterial.
git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@5859 dfc29bdd-3216-0410-991c-e03cc46cb475
2019-08-26 14:42:44 +00:00
cutealien 40d14b7c5c Cleanup: Remove some no longer needed const-casts
git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@5858 dfc29bdd-3216-0410-991c-e03cc46cb475
2019-08-21 18:20:29 +00:00
5 changed files with 53 additions and 17 deletions

View File

@ -69,7 +69,7 @@ enum E_TEXTURE_CREATION_FLAG
/** Enabling this makes calls to ITexture::lock a lot faster, but costs main memory.
Currently only used in combination with OpenGL drivers.
NOTE: Disabling this does not yet work correctly with alpha-textures.
So the default is off for now (but might change with Irrlicht 1.9 if we get the alpha-troubles fixed).
So the default is on for now (but might change with Irrlicht 1.9 if we get the alpha-troubles fixed).
*/
ETCF_ALLOW_MEMORY_COPY = 0x00000080,

View File

@ -175,19 +175,23 @@ define out. */
//! Define required options for OpenGL drivers.
#if defined(_IRR_COMPILE_WITH_OPENGL_)
#if defined(_IRR_COMPILE_WITH_WINDOWS_DEVICE_)
#define _IRR_OPENGL_USE_EXTPOINTER_
#define _IRR_COMPILE_WITH_WGL_MANAGER_
#elif defined(_IRR_COMPILE_WITH_X11_DEVICE_)
#define _IRR_OPENGL_USE_EXTPOINTER_
#define _IRR_COMPILE_WITH_GLX_MANAGER_
#elif defined(_IRR_COMPILE_WITH_OSX_DEVICE_)
#define _IRR_COMPILE_WITH_NSOGL_MANAGER_
#elif defined(_IRR_SOLARIS_PLATFORM_)
#define _IRR_COMPILE_WITH_GLX_MANAGER_
#endif
#if defined(_IRR_COMPILE_WITH_WINDOWS_DEVICE_)
#define _IRR_OPENGL_USE_EXTPOINTER_
#define _IRR_COMPILE_WITH_WGL_MANAGER_
#elif defined(_IRR_COMPILE_WITH_X11_DEVICE_)
#define _IRR_OPENGL_USE_EXTPOINTER_
#define _IRR_COMPILE_WITH_GLX_MANAGER_
#elif defined(_IRR_COMPILE_WITH_OSX_DEVICE_)
#define _IRR_COMPILE_WITH_NSOGL_MANAGER_
#elif defined(_IRR_SOLARIS_PLATFORM_)
#define _IRR_COMPILE_WITH_GLX_MANAGER_
#elif defined(_IRR_COMPILE_WITH_SDL_DEVICE_)
#define _IRR_OPENGL_USE_EXTPOINTER_
#endif
#endif
//! Define _IRR_COMPILE_WITH_SOFTWARE_ to compile the Irrlicht engine with software driver
/** If you do not need the software driver, or want to use Burning's Video instead,
comment this define out */

View File

@ -39,15 +39,40 @@ namespace video
true if the Override material is enabled in the current pass. */
bool Enabled;
struct SMaterialTypeReplacement
{
SMaterialTypeReplacement(s32 original, u32 replacement) : Original(original), Replacement(replacement) {}
SMaterialTypeReplacement(u32 replacement) : Original(-1), Replacement(replacement) {}
//! SMaterial.MaterialType to replace.
//! -1 for all types or a specific value to only replace that one (which is either one of E_MATERIAL_TYPE or a shader material id)
s32 Original;
//! MaterialType to used to override Original (either one of E_MATERIAL_TYPE or a shader material id)
u32 Replacement;
};
//! To overwrite SMaterial::MaterialType
core::array<SMaterialTypeReplacement> MaterialTypes;
//! Default constructor
SOverrideMaterial() : EnableFlags(0), EnablePasses(0), Enabled(false)
{
for ( u32 i=0; i<MATERIAL_MAX_TEXTURES; ++i)
}
//! disable overrides and reset all flags
void reset()
{
EnableFlags = 0;
EnablePasses = 0;
Enabled = false;
for (u32 i = 0; i < MATERIAL_MAX_TEXTURES; ++i)
{
EnableLayerFlags[i] = true;
EnableLayerFlags[i] = true; // doesn't do anything unless EnableFlags is set, just saying by default all texture layers are affected by flags
EnableTextures[i] = false;
EnableLayers[i] = false;
}
MaterialTypes.clear();
}
//! Apply the enabled overrides
@ -55,6 +80,12 @@ namespace video
{
if (Enabled)
{
for (u32 i = 0; i < MaterialTypes.size(); ++i)
{
const SMaterialTypeReplacement& mtr = MaterialTypes[i];
if (mtr.Original < 0 || (s32)mtr.Original == material.MaterialType)
material.MaterialType = (E_MATERIAL_TYPE)mtr.Replacement;
}
for (u32 f=0; f<32; ++f)
{
const u32 num=(1<<f);

View File

@ -1491,7 +1491,7 @@ void CD3D9Driver::draw2DImage(const video::ITexture* texture,
s16 indices[6] = {0,1,2,0,2,3};
setActiveTexture(0, const_cast<video::ITexture*>(texture));
setActiveTexture(0, texture);
setRenderStates2DMode(useColor[0].getAlpha()<255 || useColor[1].getAlpha()<255 ||
useColor[2].getAlpha()<255 || useColor[3].getAlpha()<255,
@ -1528,7 +1528,7 @@ void CD3D9Driver::draw2DImageBatch(const video::ITexture* texture,
if (!texture)
return;
if (!setActiveTexture(0, const_cast<video::ITexture*>(texture)))
if (!setActiveTexture(0, texture))
return;
setRenderStates2DMode(color.getAlpha()<255, true, useAlphaChannelOfTexture);
@ -1678,7 +1678,7 @@ void CD3D9Driver::draw2DImage(const video::ITexture* texture,
if (!sourceRect.isValid())
return;
if (!setActiveTexture(0, const_cast<video::ITexture*>(texture)))
if (!setActiveTexture(0, texture))
return;
core::position2d<s32> targetPos = pos;

View File

@ -108,6 +108,7 @@ sharedlib_osx: LDFLAGS += -L/usr/X11R6/lib$(LIBSELECT) -lGL -lXxf86vm
IRRLICHT_DLL := ../../bin/Win32-gcc/Irrlicht.dll
sharedlib_win32 staticlib_win32: SYSTEM = Win32-gcc
sharedlib_win32: LDFLAGS += -lgdi32 -lopengl32 -ld3dx9d -lwinmm -Wl,--add-stdcall-alias
#sharedlib_win32: LDFLAGS += -lSDL
#choose either -DIRR_COMPILE_WITH_DX9_DEV_PACK or -DNO_IRR_COMPILE_WITH_DIRECT3D_9_ depending if you need dx9
#sharedlib_win32 staticlib_win32: CPPFLAGS += -DIRR_COMPILE_WITH_DX9_DEV_PACK
sharedlib_win32 staticlib_win32: CPPFLAGS += -DNO_IRR_COMPILE_WITH_DIRECTINPUT_JOYSTICK_ -DNO_IRR_COMPILE_WITH_DIRECT3D_9_