Commit 1663df62 authored by mercury233's avatar mercury233

Merge branch '1.8.5'

parents 533b45fc 03650c85
This diff is collapsed.
...@@ -78,7 +78,7 @@ public: ...@@ -78,7 +78,7 @@ public:
OnSetConstants(). In this way it is easily possible to use the same OnSetConstants(). In this way it is easily possible to use the same
callback method for multiple materials and distinguish between them callback method for multiple materials and distinguish between them
during the call. during the call.
\param shaderLang a type of shading language used in current shader. \param shadingLang a type of shading language used in current shader.
\return Number of the material type which can be set in \return Number of the material type which can be set in
SMaterial::MaterialType to use the renderer. -1 is returned if an error SMaterial::MaterialType to use the renderer. -1 is returned if an error
occured, e.g. if a shader program could not be compiled or a compile occured, e.g. if a shader program could not be compiled or a compile
...@@ -205,7 +205,7 @@ public: ...@@ -205,7 +205,7 @@ public:
OnSetConstants(). In this way it is easily possible to use the same OnSetConstants(). In this way it is easily possible to use the same
callback method for multiple materials and distinguish between them callback method for multiple materials and distinguish between them
during the call. during the call.
\param shaderLang a type of shading language used in current shader. \param shadingLang a type of shading language used in current shader.
\return Number of the material type which can be set in \return Number of the material type which can be set in
SMaterial::MaterialType to use the renderer. -1 is returned if an error SMaterial::MaterialType to use the renderer. -1 is returned if an error
occured, e.g. if a shader program could not be compiled or a compile occured, e.g. if a shader program could not be compiled or a compile
...@@ -330,7 +330,7 @@ public: ...@@ -330,7 +330,7 @@ public:
OnSetConstants(). In this way it is easily possible to use the same OnSetConstants(). In this way it is easily possible to use the same
callback method for multiple materials and distinguish between them callback method for multiple materials and distinguish between them
during the call. during the call.
\param shaderLang a type of shading language used in current shader. \param shadingLang a type of shading language used in current shader.
\return Number of the material type which can be set in \return Number of the material type which can be set in
SMaterial::MaterialType to use the renderer. -1 is returned if an SMaterial::MaterialType to use the renderer. -1 is returned if an
error occured, e.g. if a shader program could not be compiled or a error occured, e.g. if a shader program could not be compiled or a
......
...@@ -85,8 +85,8 @@ namespace gui ...@@ -85,8 +85,8 @@ namespace gui
//! Sets text justification mode //! Sets text justification mode
/** \param horizontal: EGUIA_UPPERLEFT for left justified (default), /** \param horizontal: EGUIA_UPPERLEFT for left justified (default),
EGUIA_LOWEERRIGHT for right justified, or EGUIA_CENTER for centered text. EGUIA_LOWEERRIGHT for right justified, or EGUIA_CENTER for centered text.
\param vertical: EGUIA_UPPERLEFT to align with top edge, \param vertical: EGUIA_UPPERLEFT to align with top edge (default),
EGUIA_LOWEERRIGHT for bottom edge, or EGUIA_CENTER for centered text (default). */ EGUIA_LOWEERRIGHT for bottom edge, or EGUIA_CENTER for centered text. */
virtual void setTextAlignment(EGUI_ALIGNMENT horizontal, EGUI_ALIGNMENT vertical) = 0; virtual void setTextAlignment(EGUI_ALIGNMENT horizontal, EGUI_ALIGNMENT vertical) = 0;
//! Enables or disables word wrap for using the static text as multiline text control. //! Enables or disables word wrap for using the static text as multiline text control.
......
...@@ -38,10 +38,10 @@ public: ...@@ -38,10 +38,10 @@ public:
virtual bool getProcessorSpeedMHz(u32* MHz) const = 0; virtual bool getProcessorSpeedMHz(u32* MHz) const = 0;
//! Get the total and available system RAM //! Get the total and available system RAM
/** \param Total: will contain the total system memory /** \param totalBytes: will contain the total system memory in bytes
\param Avail: will contain the available memory \param availableBytes: will contain the available memory in bytes
\return True if successful, false if not */ \return True if successful, false if not */
virtual bool getSystemMemory(u32* Total, u32* Avail) const = 0; virtual bool getSystemMemory(u32* totalBytes, u32* availableBytes) const = 0;
}; };
......
...@@ -437,7 +437,9 @@ namespace video ...@@ -437,7 +437,9 @@ namespace video
\param format The color format of the render target. Floating point formats are supported. \param format The color format of the render target. Floating point formats are supported.
\return Pointer to the created texture or 0 if the texture \return Pointer to the created texture or 0 if the texture
could not be created. This pointer should not be dropped. See could not be created. This pointer should not be dropped. See
IReferenceCounted::drop() for more information. */ IReferenceCounted::drop() for more information.
You may want to remove it from driver texture cache with removeTexture if you no longer need it.
*/
virtual ITexture* addRenderTargetTexture(const core::dimension2d<u32>& size, virtual ITexture* addRenderTargetTexture(const core::dimension2d<u32>& size,
const io::path& name = "rt", const ECOLOR_FORMAT format = ECF_UNKNOWN) =0; const io::path& name = "rt", const ECOLOR_FORMAT format = ECF_UNKNOWN) =0;
...@@ -515,7 +517,7 @@ namespace video ...@@ -515,7 +517,7 @@ namespace video
example in picture edit programs. To avoid this problem, you example in picture edit programs. To avoid this problem, you
could use the makeColorKeyTexture method, which takes the could use the makeColorKeyTexture method, which takes the
position of a pixel instead a color value. position of a pixel instead a color value.
\param zeroTexels \deprecated If set to true, then any texels that match \param zeroTexels (deprecated) If set to true, then any texels that match
the color key will have their color, as well as their alpha, set to zero the color key will have their color, as well as their alpha, set to zero
(i.e. black). This behavior matches the legacy (buggy) behavior prior (i.e. black). This behavior matches the legacy (buggy) behavior prior
to release 1.5 and is provided for backwards compatibility only. to release 1.5 and is provided for backwards compatibility only.
...@@ -532,7 +534,7 @@ namespace video ...@@ -532,7 +534,7 @@ namespace video
\param colorKeyPixelPos Position of a pixel with the color key \param colorKeyPixelPos Position of a pixel with the color key
color. Every texel with this color will become fully transparent as color. Every texel with this color will become fully transparent as
described above. described above.
\param zeroTexels \deprecated If set to true, then any texels that match \param zeroTexels (deprecated) If set to true, then any texels that match
the color key will have their color, as well as their alpha, set to zero the color key will have their color, as well as their alpha, set to zero
(i.e. black). This behavior matches the legacy (buggy) behavior prior (i.e. black). This behavior matches the legacy (buggy) behavior prior
to release 1.5 and is provided for backwards compatibility only. to release 1.5 and is provided for backwards compatibility only.
...@@ -1412,14 +1414,14 @@ namespace video ...@@ -1412,14 +1414,14 @@ namespace video
virtual SOverrideMaterial& getOverrideMaterial() =0; virtual SOverrideMaterial& getOverrideMaterial() =0;
//! Get the 2d override material for altering its values //! Get the 2d override material for altering its values
/** The 2d override materual allows to alter certain render /** The 2d override material allows to alter certain render
states of the 2d methods. Not all members of SMaterial are states of the 2d methods. Not all members of SMaterial are
honored, especially not MaterialType and Textures. Moreover, honored, especially not MaterialType and Textures. Moreover,
the zbuffer is always ignored, and lighting is always off. All the zbuffer is always ignored, and lighting is always off. All
other flags can be changed, though some might have to effect other flags can be changed, though some might have to effect
in most cases. in most cases.
Please note that you have to enable/disable this effect with Please note that you have to enable/disable this effect with
enableInitMaterial2D(). This effect is costly, as it increases enableMaterial2D(). This effect is costly, as it increases
the number of state changes considerably. Always reset the the number of state changes considerably. Always reset the
values when done. values when done.
\return Material reference which should be altered to reflect \return Material reference which should be altered to reflect
......
...@@ -8,11 +8,11 @@ ...@@ -8,11 +8,11 @@
//! Irrlicht SDK Version //! Irrlicht SDK Version
#define IRRLICHT_VERSION_MAJOR 1 #define IRRLICHT_VERSION_MAJOR 1
#define IRRLICHT_VERSION_MINOR 8 #define IRRLICHT_VERSION_MINOR 8
#define IRRLICHT_VERSION_REVISION 4 #define IRRLICHT_VERSION_REVISION 5
// This flag will be defined only in SVN, the official release code will have // This flag will be defined only in SVN, the official release code will have
// it undefined // it undefined
//#define IRRLICHT_VERSION_SVN -alpha //#define IRRLICHT_VERSION_SVN -alpha
#define IRRLICHT_SDK_VERSION "1.8.4" #define IRRLICHT_SDK_VERSION "1.8.5"
#include <stdio.h> // TODO: Although included elsewhere this is required at least for mingw #include <stdio.h> // TODO: Although included elsewhere this is required at least for mingw
...@@ -238,7 +238,7 @@ for Windows based systems. You also have to set #define UNICODE for this to comp ...@@ -238,7 +238,7 @@ for Windows based systems. You also have to set #define UNICODE for this to comp
#undef _IRR_WCHAR_FILESYSTEM #undef _IRR_WCHAR_FILESYSTEM
#endif #endif
//! Define _IRR_COMPILE_WITH_JPEGLIB_ to enable compiling the engine using libjpeg. //! Define _IRR_COMPILE_WITH_LIBJPEG_ to enable compiling the engine using libjpeg.
/** This enables the engine to read jpeg images. If you comment this out, /** This enables the engine to read jpeg images. If you comment this out,
the engine will no longer read .jpeg images. */ the engine will no longer read .jpeg images. */
#define _IRR_COMPILE_WITH_LIBJPEG_ #define _IRR_COMPILE_WITH_LIBJPEG_
......
...@@ -170,7 +170,7 @@ namespace irr ...@@ -170,7 +170,7 @@ namespace irr
\return True if window is active. */ \return True if window is active. */
virtual bool isWindowActive() const = 0; virtual bool isWindowActive() const = 0;
//! Checks if the Irrlicht window has focus //! Checks if the Irrlicht window has the input focus
/** \return True if window has focus. */ /** \return True if window has focus. */
virtual bool isWindowFocused() const = 0; virtual bool isWindowFocused() const = 0;
......
...@@ -162,9 +162,10 @@ namespace irr ...@@ -162,9 +162,10 @@ namespace irr
KEY_PLAY = 0xFA, // Play key KEY_PLAY = 0xFA, // Play key
KEY_ZOOM = 0xFB, // Zoom key KEY_ZOOM = 0xFB, // Zoom key
KEY_PA1 = 0xFD, // PA1 key KEY_PA1 = 0xFD, // PA1 key
KEY_OEM_CLEAR = 0xFE, // Clear key KEY_OEM_CLEAR = 0xFE, // Clear key
KEY_NONE = 0xFF, // usually no key mapping, but some laptops use it for fn key
KEY_KEY_CODES_COUNT = 0xFF // this is not a key, but the amount of keycodes there are. KEY_KEY_CODES_COUNT = 0x100 // this is not a key, but the amount of keycodes there are.
}; };
} // end namespace irr } // end namespace irr
......
...@@ -90,6 +90,7 @@ struct S3DVertex ...@@ -90,6 +90,7 @@ struct S3DVertex
return EVT_STANDARD; return EVT_STANDARD;
} }
//\param d d=0 returns other, d=1 returns this, values between interpolate.
S3DVertex getInterpolated(const S3DVertex& other, f32 d) S3DVertex getInterpolated(const S3DVertex& other, f32 d)
{ {
d = core::clamp(d, 0.0f, 1.0f); d = core::clamp(d, 0.0f, 1.0f);
...@@ -168,6 +169,7 @@ struct S3DVertex2TCoords : public S3DVertex ...@@ -168,6 +169,7 @@ struct S3DVertex2TCoords : public S3DVertex
return EVT_2TCOORDS; return EVT_2TCOORDS;
} }
//\param d d=0 returns other, d=1 returns this, values between interpolate.
S3DVertex2TCoords getInterpolated(const S3DVertex2TCoords& other, f32 d) S3DVertex2TCoords getInterpolated(const S3DVertex2TCoords& other, f32 d)
{ {
d = core::clamp(d, 0.0f, 1.0f); d = core::clamp(d, 0.0f, 1.0f);
......
...@@ -335,7 +335,7 @@ namespace video ...@@ -335,7 +335,7 @@ namespace video
//! Interpolates the color with a f32 value to another color //! Interpolates the color with a f32 value to another color
/** \param other: Other color /** \param other: Other color
\param d: value between 0.0f and 1.0f \param d: value between 0.0f and 1.0f. d=0 returns other, d=1 returns this, values between interpolate.
\return Interpolated color. */ \return Interpolated color. */
SColor getInterpolated(const SColor &other, f32 d) const SColor getInterpolated(const SColor &other, f32 d) const
{ {
......
...@@ -349,13 +349,13 @@ namespace scene ...@@ -349,13 +349,13 @@ namespace scene
if (planes[i].classifyPointRelation(line.start) == core::ISREL3D_FRONT) if (planes[i].classifyPointRelation(line.start) == core::ISREL3D_FRONT)
{ {
line.start = line.start.getInterpolated(line.end, line.start = line.start.getInterpolated(line.end,
planes[i].getKnownIntersectionWithLine(line.start, line.end)); 1.f-planes[i].getKnownIntersectionWithLine(line.start, line.end));
wasClipped = true; wasClipped = true;
} }
if (planes[i].classifyPointRelation(line.end) == core::ISREL3D_FRONT) if (planes[i].classifyPointRelation(line.end) == core::ISREL3D_FRONT)
{ {
line.end = line.start.getInterpolated(line.end, line.end = line.start.getInterpolated(line.end,
planes[i].getKnownIntersectionWithLine(line.start, line.end)); 1.f-planes[i].getKnownIntersectionWithLine(line.start, line.end));
wasClipped = true; wasClipped = true;
} }
} }
......
...@@ -191,7 +191,7 @@ namespace core ...@@ -191,7 +191,7 @@ namespace core
//! Get the interpolated dimension //! Get the interpolated dimension
/** \param other Other dimension to interpolate with. /** \param other Other dimension to interpolate with.
\param d Value between 0.0f and 1.0f. \param d Value between 0.0f and 1.0f. d=0 returns other, d=1 returns this, values between interpolate.
\return Interpolated dimension. */ \return Interpolated dimension. */
dimension2d<T> getInterpolated(const dimension2d<T>& other, f32 d) const dimension2d<T> getInterpolated(const dimension2d<T>& other, f32 d) const
{ {
......
...@@ -17,7 +17,8 @@ namespace core ...@@ -17,7 +17,8 @@ namespace core
// used there has to be rewritten first. // used there has to be rewritten first.
IRRLICHT_API extern irr::core::stringc LOCALE_DECIMAL_POINTS; IRRLICHT_API extern irr::core::stringc LOCALE_DECIMAL_POINTS;
// we write [17] here instead of [] to work around a swig bug #define IRR_ATOF_TABLE_SIZE 17
// we write [IRR_ATOF_TABLE_SIZE] here instead of [] to work around a swig bug
const float fast_atof_table[17] = { const float fast_atof_table[17] = {
0.f, 0.f,
0.1f, 0.1f,
...@@ -323,8 +324,16 @@ inline const char* fast_atof_move(const char* in, f32& result) ...@@ -323,8 +324,16 @@ inline const char* fast_atof_move(const char* in, f32& result)
if ( LOCALE_DECIMAL_POINTS.findFirst(*in) >= 0 ) if ( LOCALE_DECIMAL_POINTS.findFirst(*in) >= 0 )
{ {
const char* afterDecimal = ++in; const char* afterDecimal = ++in;
const f32 decimal = strtof10(in, &afterDecimal); f32 decimal = strtof10(in, &afterDecimal);
value += decimal * fast_atof_table[afterDecimal - in]; size_t numDecimals = afterDecimal - in;
if (numDecimals < IRR_ATOF_TABLE_SIZE)
{
value += decimal * fast_atof_table[numDecimals];
}
else
{
value += decimal * (f32)pow(10.f, -(float)numDecimals);
}
in = afterDecimal; in = afterDecimal;
} }
...@@ -334,7 +343,8 @@ inline const char* fast_atof_move(const char* in, f32& result) ...@@ -334,7 +343,8 @@ inline const char* fast_atof_move(const char* in, f32& result)
// Assume that the exponent is a whole number. // Assume that the exponent is a whole number.
// strtol10() will deal with both + and - signs, // strtol10() will deal with both + and - signs,
// but calculate as f32 to prevent overflow at FLT_MAX // but calculate as f32 to prevent overflow at FLT_MAX
value *= powf(10.f, (f32)strtol10(in, &in)); // Using pow with float cast instead of powf as otherwise accuracy decreases.
value *= (f32)pow(10.f, (f32)strtol10(in, &in));
} }
result = negative?-value:value; result = negative?-value:value;
......
...@@ -211,7 +211,8 @@ class line2d ...@@ -211,7 +211,8 @@ class line2d
} }
//! Get the closest point on this line to a point //! Get the closest point on this line to a point
/** \param checkOnlySegments: Default (true) is to return a point on the line-segment (between begin and end) of the line. /** \param point: Starting search at this point
\param checkOnlySegments: Default (true) is to return a point on the line-segment (between begin and end) of the line.
When set to false the function will check for the first the closest point on the the line even when outside the segment. */ When set to false the function will check for the first the closest point on the the line even when outside the segment. */
vector2d<T> getClosestPoint(const vector2d<T>& point, bool checkOnlySegments=true) const vector2d<T> getClosestPoint(const vector2d<T>& point, bool checkOnlySegments=true) const
{ {
......
...@@ -109,6 +109,9 @@ CFileSystem::~CFileSystem() ...@@ -109,6 +109,9 @@ CFileSystem::~CFileSystem()
//! opens a file for read access //! opens a file for read access
IReadFile* CFileSystem::createAndOpenFile(const io::path& filename) IReadFile* CFileSystem::createAndOpenFile(const io::path& filename)
{ {
if ( filename.empty() )
return 0;
IReadFile* file = 0; IReadFile* file = 0;
u32 i; u32 i;
...@@ -611,6 +614,8 @@ bool CFileSystem::changeWorkingDirectoryTo(const io::path& newDirectory) ...@@ -611,6 +614,8 @@ bool CFileSystem::changeWorkingDirectoryTo(const io::path& newDirectory)
io::path CFileSystem::getAbsolutePath(const io::path& filename) const io::path CFileSystem::getAbsolutePath(const io::path& filename) const
{ {
if ( filename.empty() )
return filename;
#if defined(_IRR_WINDOWS_CE_PLATFORM_) #if defined(_IRR_WINDOWS_CE_PLATFORM_)
return filename; return filename;
#elif defined(_IRR_WINDOWS_API_) #elif defined(_IRR_WINDOWS_API_)
......
...@@ -289,22 +289,25 @@ bool CGUIContextMenu::OnEvent(const SEvent& event) ...@@ -289,22 +289,25 @@ bool CGUIContextMenu::OnEvent(const SEvent& event)
{ {
// set event parent of submenus // set event parent of submenus
IGUIElement * p = EventParent ? EventParent : Parent; IGUIElement * p = EventParent ? EventParent : Parent;
setEventParent(p); if ( p ) // can be 0 when element got removed already
SEvent event;
event.EventType = EET_GUI_EVENT;
event.GUIEvent.Caller = this;
event.GUIEvent.Element = 0;
event.GUIEvent.EventType = EGET_ELEMENT_CLOSED;
if ( !p->OnEvent(event) )
{ {
if ( CloseHandling & ECMC_HIDE ) setEventParent(p);
SEvent event;
event.EventType = EET_GUI_EVENT;
event.GUIEvent.Caller = this;
event.GUIEvent.Element = 0;
event.GUIEvent.EventType = EGET_ELEMENT_CLOSED;
if ( !p->OnEvent(event) )
{ {
setVisible(false); if ( CloseHandling & ECMC_HIDE )
} {
if ( CloseHandling & ECMC_REMOVE ) setVisible(false);
{ }
remove(); if ( CloseHandling & ECMC_REMOVE )
{
remove();
}
} }
} }
......
...@@ -142,12 +142,9 @@ void CGUITab::deserializeAttributes(io::IAttributes* in, io::SAttributeReadWrite ...@@ -142,12 +142,9 @@ void CGUITab::deserializeAttributes(io::IAttributes* in, io::SAttributeReadWrite
setNumber(in->getAttributeAsInt("TabNumber")); setNumber(in->getAttributeAsInt("TabNumber"));
setDrawBackground(in->getAttributeAsBool("DrawBackground")); setDrawBackground(in->getAttributeAsBool("DrawBackground"));
setBackgroundColor(in->getAttributeAsColor("BackColor")); setBackgroundColor(in->getAttributeAsColor("BackColor"));
bool override = in->getAttributeAsBool("OverrideTextColorEnabled"); if ( in->existsAttribute("OverrideTextColorEnabled") )
OverrideTextColorEnabled = in->getAttributeAsBool("OverrideTextColorEnabled");
setTextColor(in->getAttributeAsColor("TextColor")); setTextColor(in->getAttributeAsColor("TextColor"));
if ( !override )
{
OverrideTextColorEnabled = false;
}
if (Parent && Parent->getType() == EGUIET_TAB_CONTROL) if (Parent && Parent->getType() == EGUIET_TAB_CONTROL)
{ {
......
...@@ -125,14 +125,11 @@ bool CImageLoaderJPG::isALoadableFileFormat(io::IReadFile* file) const ...@@ -125,14 +125,11 @@ bool CImageLoaderJPG::isALoadableFileFormat(io::IReadFile* file) const
return false; return false;
#else #else
if (!file) if (!(file && file->seek(0)))
return false; return false;
unsigned char header[3];
s32 jfif = 0; int headerLen = file->read(header, sizeof(header));
file->seek(6); return headerLen >= 3 && !memcmp(header, "\xFF\xD8\xFF", 3);
file->read(&jfif, sizeof(s32));
return (jfif == 0x4a464946 || jfif == 0x4649464a);
#endif #endif
} }
......
...@@ -57,7 +57,7 @@ CIrrDeviceSDL::CIrrDeviceSDL(const SIrrlichtCreationParameters& param) ...@@ -57,7 +57,7 @@ CIrrDeviceSDL::CIrrDeviceSDL(const SIrrlichtCreationParameters& param)
Screen((SDL_Surface*)param.WindowId), SDL_Flags(SDL_ANYFORMAT), Screen((SDL_Surface*)param.WindowId), SDL_Flags(SDL_ANYFORMAT),
MouseX(0), MouseY(0), MouseButtonStates(0), MouseX(0), MouseY(0), MouseButtonStates(0),
Width(param.WindowSize.Width), Height(param.WindowSize.Height), Width(param.WindowSize.Width), Height(param.WindowSize.Height),
Resizable(false), WindowHasFocus(false), WindowMinimized(false) Resizable(false), WindowMinimized(false)
{ {
#ifdef _DEBUG #ifdef _DEBUG
setDebugName("CIrrDeviceSDL"); setDebugName("CIrrDeviceSDL");
...@@ -220,12 +220,7 @@ void CIrrDeviceSDL::createDriver() ...@@ -220,12 +220,7 @@ void CIrrDeviceSDL::createDriver()
{ {
case video::EDT_DIRECT3D8: case video::EDT_DIRECT3D8:
#ifdef _IRR_COMPILE_WITH_DIRECT3D_8_ #ifdef _IRR_COMPILE_WITH_DIRECT3D_8_
os::Printer::log("SDL device does not support DIRECT38 driver. Try another one.", ELL_ERROR);
VideoDriver = video::createDirectX8Driver(CreationParams, FileSystem, HWnd);
if (!VideoDriver)
{
os::Printer::log("Could not create DIRECT3D8 Driver.", ELL_ERROR);
}
#else #else
os::Printer::log("DIRECT3D8 Driver was not compiled into this dll. Try another one.", ELL_ERROR); os::Printer::log("DIRECT3D8 Driver was not compiled into this dll. Try another one.", ELL_ERROR);
#endif // _IRR_COMPILE_WITH_DIRECT3D_8_ #endif // _IRR_COMPILE_WITH_DIRECT3D_8_
...@@ -234,12 +229,7 @@ void CIrrDeviceSDL::createDriver() ...@@ -234,12 +229,7 @@ void CIrrDeviceSDL::createDriver()
case video::EDT_DIRECT3D9: case video::EDT_DIRECT3D9:
#ifdef _IRR_COMPILE_WITH_DIRECT3D_9_ #ifdef _IRR_COMPILE_WITH_DIRECT3D_9_
os::Printer::log("SDL device does not support DIRECT3D9 driver. Try another one.", ELL_ERROR);
VideoDriver = video::createDirectX9Driver(CreationParams, FileSystem, HWnd);
if (!VideoDriver)
{
os::Printer::log("Could not create DIRECT3D9 Driver.", ELL_ERROR);
}
#else #else
os::Printer::log("DIRECT3D9 Driver was not compiled into this dll. Try another one.", ELL_ERROR); os::Printer::log("DIRECT3D9 Driver was not compiled into this dll. Try another one.", ELL_ERROR);
#endif // _IRR_COMPILE_WITH_DIRECT3D_9_ #endif // _IRR_COMPILE_WITH_DIRECT3D_9_
...@@ -423,10 +413,6 @@ bool CIrrDeviceSDL::run() ...@@ -423,10 +413,6 @@ bool CIrrDeviceSDL::run()
break; break;
case SDL_ACTIVEEVENT: case SDL_ACTIVEEVENT:
if ((SDL_event.active.state == SDL_APPMOUSEFOCUS) ||
(SDL_event.active.state == SDL_APPINPUTFOCUS))
WindowHasFocus = (SDL_event.active.gain==1);
else
if (SDL_event.active.state == SDL_APPACTIVE) if (SDL_event.active.state == SDL_APPACTIVE)
WindowMinimized = (SDL_event.active.gain!=1); WindowMinimized = (SDL_event.active.gain!=1);
break; break;
...@@ -708,15 +694,34 @@ video::IVideoModeList* CIrrDeviceSDL::getVideoModeList() ...@@ -708,15 +694,34 @@ video::IVideoModeList* CIrrDeviceSDL::getVideoModeList()
{ {
// enumerate video modes. // enumerate video modes.
const SDL_VideoInfo *vi = SDL_GetVideoInfo(); const SDL_VideoInfo *vi = SDL_GetVideoInfo();
SDL_Rect **modes = SDL_ListModes(vi->vfmt, SDL_Flags);
if (modes != 0) SDL_PixelFormat pixelFormat = *(vi->vfmt);
core::array<Uint8> checkBitsPerPixel;
checkBitsPerPixel.push_back(8);
checkBitsPerPixel.push_back(16);
checkBitsPerPixel.push_back(24);
checkBitsPerPixel.push_back(32);
if ( pixelFormat.BitsPerPixel > 32 )
checkBitsPerPixel.push_back(pixelFormat.BitsPerPixel);
for ( u32 i=0; i<checkBitsPerPixel.size(); ++i)
{ {
if (modes == (SDL_Rect **)-1) pixelFormat.BitsPerPixel = checkBitsPerPixel[i];
os::Printer::log("All modes available.\n"); SDL_Rect **modes = SDL_ListModes(&pixelFormat, SDL_Flags|SDL_FULLSCREEN);
else if (modes != 0)
{ {
for (u32 i=0; modes[i]; ++i) if (modes == (SDL_Rect **)-1)
VideoModeList->addMode(core::dimension2d<u32>(modes[i]->w, modes[i]->h), vi->vfmt->BitsPerPixel); {
core::stringc strLog("All modes available for bit-depth ");
strLog += core::stringc(pixelFormat.BitsPerPixel);
os::Printer::log(strLog.c_str());
}
else
{
for (u32 i=0; modes[i]; ++i)
VideoModeList->addMode(core::dimension2d<u32>(modes[i]->w, modes[i]->h), vi->vfmt->BitsPerPixel);
}
} }
} }
} }
...@@ -725,17 +730,105 @@ video::IVideoModeList* CIrrDeviceSDL::getVideoModeList() ...@@ -725,17 +730,105 @@ video::IVideoModeList* CIrrDeviceSDL::getVideoModeList()
} }
#if defined(_IRR_COMPILE_WITH_OPENGL_) && defined(_IRR_WINDOWS_)
#define IRR_SHARE_GL_RESOURCE_ON_RESIZE
// Code from http://www.bytehazard.com/articles/sdlres.html (with some changes) to share GL resources used in SDL on Win32 while switching GL context
static HGLRC startShareGLResources()
{
// get window handle from SDL
SDL_SysWMinfo info;
SDL_VERSION(&info.version);
if (SDL_GetWMInfo(&info) == -1)
{
return 0;
}
// get device context handle
HDC tempDC = GetDC( info.window );
// create temporary context
HGLRC tempRC = wglCreateContext( tempDC );
if (tempRC == NULL)
{
ReleaseDC(info.window, tempDC);
return 0;
}
// share resources to temporary context
SetLastError(0);
if (!wglShareLists(info.hglrc, tempRC))
{
ReleaseDC(info.window, tempDC);
return 0;
}
return tempRC;
}
static bool endShareGLResources(HGLRC tempRC)
{
SDL_SysWMinfo info;
SDL_VERSION(&info.version);
if (SDL_GetWMInfo(&info) == -1)
{
return false;
}
// share resources to new SDL-created context
if (!wglShareLists(tempRC, info.hglrc))
{
return false;
}
// we no longer need our temporary context
if (!wglDeleteContext(tempRC))
{
return false;
}
return true;
}
#endif
//! Sets if the window should be resizable in windowed mode. //! Sets if the window should be resizable in windowed mode.
void CIrrDeviceSDL::setResizable(bool resize) void CIrrDeviceSDL::setResizable(bool resize)
{ {
if (resize != Resizable) if (resize != Resizable)
{ {
#ifdef IRR_SHARE_GL_RESOURCE_ON_RESIZE
// Workaround: On Windows SDL loses the OpenGL context when the SDL_Flags changes.
// So we create a temporary OpenGL context to share the GL resources.
// It doesn't seem to happen on other platforms.
const bool shareGLresources = (SDL_Flags & SDL_OPENGL) != 0;
HGLRC shareRC = 0;
if ( shareGLresources )
{
shareRC = startShareGLResources();
if ( shareRC == 0 )
{
os::Printer::log("Can't change resizable without losing GL context.");
return;
}
}
#endif
if (resize) if (resize)
SDL_Flags |= SDL_RESIZABLE; SDL_Flags |= SDL_RESIZABLE;
else else
SDL_Flags &= ~SDL_RESIZABLE; SDL_Flags &= ~SDL_RESIZABLE;
Screen = SDL_SetVideoMode( 0, 0, 0, SDL_Flags ); Screen = SDL_SetVideoMode( 0, 0, 0, SDL_Flags );
Resizable = resize; Resizable = resize;
#ifdef IRR_SHARE_GL_RESOURCE_ON_RESIZE
if ( shareRC != 0 )
{
endShareGLResources(shareRC);
}
#endif
} }
} }
...@@ -764,14 +857,15 @@ void CIrrDeviceSDL::restoreWindow() ...@@ -764,14 +857,15 @@ void CIrrDeviceSDL::restoreWindow()
//! returns if window is active. if not, nothing need to be drawn //! returns if window is active. if not, nothing need to be drawn
bool CIrrDeviceSDL::isWindowActive() const bool CIrrDeviceSDL::isWindowActive() const
{ {
return (WindowHasFocus && !WindowMinimized); const Uint8 appState = SDL_GetAppState();
return (appState&SDL_APPACTIVE && appState&SDL_APPINPUTFOCUS) ? true : false;
} }
//! returns if window has focus. //! returns if window has focus.
bool CIrrDeviceSDL::isWindowFocused() const bool CIrrDeviceSDL::isWindowFocused() const
{ {
return WindowHasFocus; return (SDL_GetAppState()&SDL_APPINPUTFOCUS) ? true : false;
} }
......
...@@ -204,7 +204,7 @@ namespace irr ...@@ -204,7 +204,7 @@ namespace irr
u32 Width, Height; u32 Width, Height;
bool Resizable; bool Resizable;
bool WindowHasFocus; bool WindowHasFocusDeprecated; // TODO: variable only kept to avoid breaking binary compatibility in 1.8. Will be removed in 1.9
bool WindowMinimized; bool WindowMinimized;
struct SKeyMap struct SKeyMap
......
...@@ -368,6 +368,9 @@ void pollJoysticks() ...@@ -368,6 +368,9 @@ void pollJoysticks()
bool activateJoysticks(core::array<SJoystickInfo> & joystickInfo) bool activateJoysticks(core::array<SJoystickInfo> & joystickInfo)
{ {
#if defined _IRR_COMPILE_WITH_JOYSTICK_EVENTS_ #if defined _IRR_COMPILE_WITH_JOYSTICK_EVENTS_
joystickInfo.clear();
ActiveJoysticks.clear();
#ifdef _IRR_COMPILE_WITH_DIRECTINPUT_JOYSTICK_ #ifdef _IRR_COMPILE_WITH_DIRECTINPUT_JOYSTICK_
if (!DirectInputDevice || (DirectInputDevice->EnumDevices(DI8DEVCLASS_GAMECTRL, SJoystickWin32Control::EnumJoysticks, this, DIEDFL_ATTACHEDONLY ))) if (!DirectInputDevice || (DirectInputDevice->EnumDevices(DI8DEVCLASS_GAMECTRL, SJoystickWin32Control::EnumJoysticks, this, DIEDFL_ATTACHEDONLY )))
{ {
...@@ -388,9 +391,6 @@ bool activateJoysticks(core::array<SJoystickInfo> & joystickInfo) ...@@ -388,9 +391,6 @@ bool activateJoysticks(core::array<SJoystickInfo> & joystickInfo)
} }
return true; return true;
#else #else
joystickInfo.clear();
ActiveJoysticks.clear();
const u32 numberOfJoysticks = ::joyGetNumDevs(); const u32 numberOfJoysticks = ::joyGetNumDevs();
JOYINFOEX info; JOYINFOEX info;
info.dwSize = sizeof(info); info.dwSize = sizeof(info);
...@@ -1929,6 +1929,26 @@ void CIrrDeviceWin32::ReportLastWinApiError() ...@@ -1929,6 +1929,26 @@ void CIrrDeviceWin32::ReportLastWinApiError()
} }
} }
// Same function Windows offers in VersionHelpers.h, but we can't use that as it's not available in older sdk's (minimum is SDK 8.1)
bool CIrrDeviceWin32::isWindowsVistaOrGreater()
{
#if (_WIN32_WINNT >= 0x0500)
OSVERSIONINFOEX osvi;
ZeroMemory(&osvi, sizeof(OSVERSIONINFOEX));
osvi.dwOSVersionInfoSize = sizeof(OSVERSIONINFOEX);
osvi.dwMajorVersion = 6; // Windows Vista
if ( !GetVersionEx((OSVERSIONINFO*)&osvi) )
{
return false;
}
return VerifyVersionInfo(&osvi, VER_MAJORVERSION, VerSetConditionMask(0, VER_MAJORVERSION, VER_GREATER_EQUAL));
#else
return false;
#endif
}
// Convert an Irrlicht texture to a Windows cursor // Convert an Irrlicht texture to a Windows cursor
// Based on http://www.codeguru.com/cpp/w-p/win32/cursors/article.php/c4529/ // Based on http://www.codeguru.com/cpp/w-p/win32/cursors/article.php/c4529/
HCURSOR CIrrDeviceWin32::TextureToCursor(HWND hwnd, irr::video::ITexture * tex, const core::rect<s32>& sourceRect, const core::position2d<s32> &hotspot) HCURSOR CIrrDeviceWin32::TextureToCursor(HWND hwnd, irr::video::ITexture * tex, const core::rect<s32>& sourceRect, const core::position2d<s32> &hotspot)
......
...@@ -111,13 +111,16 @@ namespace irr ...@@ -111,13 +111,16 @@ namespace irr
return CIrrDeviceStub::checkSuccessiveClicks(mouseX, mouseY, inputEvent ); return CIrrDeviceStub::checkSuccessiveClicks(mouseX, mouseY, inputEvent );
} }
//! switchs to fullscreen //! Switch to fullscreen
bool switchToFullScreen(bool reset=false); bool switchToFullScreen(bool reset=false);
//! Check for and show last Windows API error to help internal debugging. //! Check for and show last Windows API error to help internal debugging.
//! Does call GetLastError and on errors formats the errortext and displays it in a messagebox. //! Does call GetLastError and on errors formats the error text and displays it in a messagebox.
static void ReportLastWinApiError(); static void ReportLastWinApiError();
//! Same function Windows offers in VersionHelpers.h, but we can't use that as it's not available before SDK 8.1
static bool isWindowsVistaOrGreater();
// convert an Irrlicht texture to a windows cursor // convert an Irrlicht texture to a windows cursor
HCURSOR TextureToCursor(HWND hwnd, irr::video::ITexture * tex, const core::rect<s32>& sourceRect, const core::position2d<s32> &hotspot); HCURSOR TextureToCursor(HWND hwnd, irr::video::ITexture * tex, const core::rect<s32>& sourceRect, const core::position2d<s32> &hotspot);
...@@ -274,23 +277,29 @@ namespace irr ...@@ -274,23 +277,29 @@ namespace irr
/** Used to notify the cursor that the window resizable settings changed. */ /** Used to notify the cursor that the window resizable settings changed. */
void updateBorderSize(bool fullscreen, bool resizable) void updateBorderSize(bool fullscreen, bool resizable)
{ {
if (!fullscreen) if (!fullscreen)
{ {
if (resizable) s32 paddingBorder = 0;
{ #if defined (SM_CXPADDEDBORDER)
BorderX = GetSystemMetrics(SM_CXSIZEFRAME); if (CIrrDeviceWin32::isWindowsVistaOrGreater())
BorderY = GetSystemMetrics(SM_CYCAPTION) + GetSystemMetrics(SM_CYSIZEFRAME); paddingBorder = GetSystemMetrics(SM_CXPADDEDBORDER);
} #endif
else
{ if (resizable)
BorderX = GetSystemMetrics(SM_CXDLGFRAME); {
BorderY = GetSystemMetrics(SM_CYCAPTION) + GetSystemMetrics(SM_CYDLGFRAME); BorderX = GetSystemMetrics(SM_CXSIZEFRAME) + paddingBorder;
} BorderY = GetSystemMetrics(SM_CYCAPTION) + GetSystemMetrics(SM_CYSIZEFRAME) + paddingBorder;
} }
else else
{ {
BorderX = BorderY = 0; BorderX = GetSystemMetrics(SM_CXDLGFRAME) + paddingBorder;
} BorderY = GetSystemMetrics(SM_CYCAPTION) + GetSystemMetrics(SM_CYDLGFRAME) + paddingBorder;
}
}
else
{
BorderX = BorderY = 0;
}
} }
......
...@@ -912,7 +912,7 @@ const wchar_t* CNullDriver::getName() const ...@@ -912,7 +912,7 @@ const wchar_t* CNullDriver::getName() const
//! Draws a shadow volume into the stencil buffer. To draw a stencil shadow, do //! Draws a shadow volume into the stencil buffer. To draw a stencil shadow, do
//! this: Frist, draw all geometry. Then use this method, to draw the shadow //! this: First, draw all geometry. Then use this method, to draw the shadow
//! volume. Then, use IVideoDriver::drawStencilShadow() to visualize the shadow. //! volume. Then, use IVideoDriver::drawStencilShadow() to visualize the shadow.
void CNullDriver::drawStencilShadowVolume(const core::array<core::vector3df>& triangles, bool zfail, u32 debugDataVisible) void CNullDriver::drawStencilShadowVolume(const core::array<core::vector3df>& triangles, bool zfail, u32 debugDataVisible)
{ {
......
...@@ -282,7 +282,7 @@ namespace video ...@@ -282,7 +282,7 @@ namespace video
virtual void addExternalImageWriter(IImageWriter* writer); virtual void addExternalImageWriter(IImageWriter* writer);
//! Draws a shadow volume into the stencil buffer. To draw a stencil shadow, do //! Draws a shadow volume into the stencil buffer. To draw a stencil shadow, do
//! this: Frist, draw all geometry. Then use this method, to draw the shadow //! this: First, draw all geometry. Then use this method, to draw the shadow
//! volume. Then, use IVideoDriver::drawStencilShadow() to visualize the shadow. //! volume. Then, use IVideoDriver::drawStencilShadow() to visualize the shadow.
virtual void drawStencilShadowVolume(const core::array<core::vector3df>& triangles, bool zfail=true, u32 debugDataVisible=0); virtual void drawStencilShadowVolume(const core::array<core::vector3df>& triangles, bool zfail=true, u32 debugDataVisible=0);
......
...@@ -13,9 +13,11 @@ ...@@ -13,9 +13,11 @@
#include <unistd.h> #include <unistd.h>
#ifndef _IRR_SOLARIS_PLATFORM_ #ifndef _IRR_SOLARIS_PLATFORM_
#include <sys/types.h> #include <sys/types.h>
#ifdef _IRR_OSX_PLATFORM_
#include <sys/sysctl.h> #include <sys/sysctl.h>
#endif #endif
#endif #endif
#endif
#if defined(_IRR_COMPILE_WITH_X11_DEVICE_) #if defined(_IRR_COMPILE_WITH_X11_DEVICE_)
#include "CIrrDeviceLinux.h" #include "CIrrDeviceLinux.h"
...@@ -169,19 +171,32 @@ bool COSOperator::getProcessorSpeedMHz(u32* MHz) const ...@@ -169,19 +171,32 @@ bool COSOperator::getProcessorSpeedMHz(u32* MHz) const
bool COSOperator::getSystemMemory(u32* Total, u32* Avail) const bool COSOperator::getSystemMemory(u32* Total, u32* Avail) const
{ {
#if defined(_IRR_WINDOWS_API_) && !defined (_IRR_XBOX_PLATFORM_) #if defined(_IRR_WINDOWS_API_) && !defined (_IRR_XBOX_PLATFORM_)
#if (_WIN32_WINNT >= 0x0500)
MEMORYSTATUSEX MemoryStatusEx;
MemoryStatusEx.dwLength = sizeof(MEMORYSTATUSEX);
// cannot fail
GlobalMemoryStatusEx(&MemoryStatusEx);
if (Total)
*Total = (u32)(MemoryStatusEx.ullTotalPhys>>10);
if (Avail)
*Avail = (u32)(MemoryStatusEx.ullAvailPhys>>10);
return true;
#else
MEMORYSTATUS MemoryStatus; MEMORYSTATUS MemoryStatus;
MemoryStatus.dwLength = sizeof(MEMORYSTATUS); MemoryStatus.dwLength = sizeof(MEMORYSTATUS);
// cannot fail // cannot fail
GlobalMemoryStatus(&MemoryStatus); GlobalMemoryStatus(&MemoryStatus);
if (Total) if (Total)
*Total = (u32)(MemoryStatus.dwTotalPhys>>10); *Total = (u32)(MemoryStatus.dwTotalPhys>>10);
if (Avail) if (Avail)
*Avail = (u32)(MemoryStatus.dwAvailPhys>>10); *Avail = (u32)(MemoryStatus.dwAvailPhys>>10);
return true;
_IRR_IMPLEMENT_MANAGED_MARSHALLING_BUGFIX; #endif
return true;
#elif defined(_IRR_POSIX_API_) && !defined(__FreeBSD__) #elif defined(_IRR_POSIX_API_) && !defined(__FreeBSD__)
#if defined(_SC_PHYS_PAGES) && defined(_SC_AVPHYS_PAGES) #if defined(_SC_PHYS_PAGES) && defined(_SC_AVPHYS_PAGES)
...@@ -198,7 +213,7 @@ bool COSOperator::getSystemMemory(u32* Total, u32* Avail) const ...@@ -198,7 +213,7 @@ bool COSOperator::getSystemMemory(u32* Total, u32* Avail) const
*Avail = (u32)((ps*(long long)ap)>>10); *Avail = (u32)((ps*(long long)ap)>>10);
return true; return true;
#else #else
// TODO: implement for non-availablity of symbols/features // TODO: implement for non-availability of symbols/features
return false; return false;
#endif #endif
#else #else
......
...@@ -495,8 +495,8 @@ CIrrDeviceMacOSX::CIrrDeviceMacOSX(const SIrrlichtCreationParameters& param) ...@@ -495,8 +495,8 @@ CIrrDeviceMacOSX::CIrrDeviceMacOSX(const SIrrlichtCreationParameters& param)
if(!CreationParams.WindowId) //load menus if standalone application if(!CreationParams.WindowId) //load menus if standalone application
{ {
[[NSAutoreleasePool alloc] init]; [[NSAutoreleasePool alloc] init];
[NSApplication sharedApplication]; [[NSApplication sharedApplication] activateIgnoringOtherApps:YES];
[NSApp setDelegate:(id<NSFileManagerDelegate>)[[[AppDelegate alloc] initWithDevice:this] autorelease]]; [NSApp setDelegate:(id<NSApplicationDelegate>)[[[AppDelegate alloc] initWithDevice:this] autorelease]];
[NSBundle loadNibNamed:@"MainMenu" owner:[NSApp delegate]]; [NSBundle loadNibNamed:@"MainMenu" owner:[NSApp delegate]];
[NSApp finishLaunching]; [NSApp finishLaunching];
} }
...@@ -1259,7 +1259,12 @@ void CIrrDeviceMacOSX::postMouseEvent(void *event,irr::SEvent &ievent) ...@@ -1259,7 +1259,12 @@ void CIrrDeviceMacOSX::postMouseEvent(void *event,irr::SEvent &ievent)
} }
if (post) if (post)
{
ievent.MouseInput.Shift = ([(NSEvent *)event modifierFlags] & NSShiftKeyMask) != 0;
ievent.MouseInput.Control = ([(NSEvent *)event modifierFlags] & NSControlKeyMask) != 0;
postEventFromUser(ievent); postEventFromUser(ievent);
}
[NSApp sendEvent:(NSEvent *)event]; [NSApp sendEvent:(NSEvent *)event];
} }
......
VERSION_MAJOR = 1 VERSION_MAJOR = 1
VERSION_MINOR = 8 VERSION_MINOR = 8
VERSION_RELEASE = 4 VERSION_RELEASE = 5
# Irrlicht Engine 1.8.4 # Irrlicht Engine 1.8.5
# Makefile for Linux # Makefile for Linux
# #
# To use, just run: # To use, just run:
...@@ -27,6 +27,8 @@ VERSION_RELEASE = 4 ...@@ -27,6 +27,8 @@ VERSION_RELEASE = 4
# #
# make win32 # make win32
# #
# Or as MinGW by default has CC set to cc - but has no compiler by that name - you might have to do:
# make CC=gcc win32
#List of object files, separated based on engine architecture #List of object files, separated based on engine architecture
IRRMESHLOADER = CBSPMeshFileLoader.o CMD2MeshFileLoader.o CMD3MeshFileLoader.o CMS3DMeshFileLoader.o CB3DMeshFileLoader.o C3DSMeshFileLoader.o COgreMeshFileLoader.o COBJMeshFileLoader.o CColladaFileLoader.o CCSMLoader.o CDMFLoader.o CLMTSMeshFileLoader.o CMY3DMeshFileLoader.o COCTLoader.o CXMeshFileLoader.o CIrrMeshFileLoader.o CSTLMeshFileLoader.o CLWOMeshFileLoader.o CPLYMeshFileLoader.o CSMFMeshFileLoader.o IRRMESHLOADER = CBSPMeshFileLoader.o CMD2MeshFileLoader.o CMD3MeshFileLoader.o CMS3DMeshFileLoader.o CB3DMeshFileLoader.o C3DSMeshFileLoader.o COgreMeshFileLoader.o COBJMeshFileLoader.o CColladaFileLoader.o CCSMLoader.o CDMFLoader.o CLMTSMeshFileLoader.o CMY3DMeshFileLoader.o COCTLoader.o CXMeshFileLoader.o CIrrMeshFileLoader.o CSTLMeshFileLoader.o CLWOMeshFileLoader.o CPLYMeshFileLoader.o CSMFMeshFileLoader.o
......
...@@ -109,7 +109,7 @@ aes_rval aes_encrypt(const void *in_blk, void *out_blk, const aes_encrypt_ctx cx ...@@ -109,7 +109,7 @@ aes_rval aes_encrypt(const void *in_blk, void *out_blk, const aes_encrypt_ctx cx
aes_32t nr = (kp[45] ^ kp[52] ^ kp[53] ? kp[52] : 14); aes_32t nr = (kp[45] ^ kp[52] ^ kp[53] ? kp[52] : 14);
#ifdef AES_ERR_CHK #ifdef AES_ERR_CHK
if( (nr != 10 || !(kp[0] | kp[3] | kp[4])) if( (nr != 10 || !(kp[0] | kp[3] | kp[4]))
&& (nr != 12 || !(kp[0] | kp[5] | kp[6])) && (nr != 12 || !(kp[0] | kp[5] | kp[6]))
&& (nr != 14 || !(kp[0] | kp[7] | kp[8])) ) && (nr != 14 || !(kp[0] | kp[7] | kp[8])) )
return aes_error; return aes_error;
...@@ -125,10 +125,12 @@ aes_rval aes_encrypt(const void *in_blk, void *out_blk, const aes_encrypt_ctx cx ...@@ -125,10 +125,12 @@ aes_rval aes_encrypt(const void *in_blk, void *out_blk, const aes_encrypt_ctx cx
round(fwd_rnd, b1, b0, kp + 1 * N_COLS); round(fwd_rnd, b1, b0, kp + 1 * N_COLS);
round(fwd_rnd, b0, b1, kp + 2 * N_COLS); round(fwd_rnd, b0, b1, kp + 2 * N_COLS);
kp += 2 * N_COLS; kp += 2 * N_COLS;
/* Falls through. */
case 12: case 12:
round(fwd_rnd, b1, b0, kp + 1 * N_COLS); round(fwd_rnd, b1, b0, kp + 1 * N_COLS);
round(fwd_rnd, b0, b1, kp + 2 * N_COLS); round(fwd_rnd, b0, b1, kp + 2 * N_COLS);
kp += 2 * N_COLS; kp += 2 * N_COLS;
/* Falls through. */
case 10: case 10:
round(fwd_rnd, b1, b0, kp + 1 * N_COLS); round(fwd_rnd, b1, b0, kp + 1 * N_COLS);
round(fwd_rnd, b0, b1, kp + 2 * N_COLS); round(fwd_rnd, b0, b1, kp + 2 * N_COLS);
...@@ -233,7 +235,7 @@ aes_rval aes_decrypt(const void *in_blk, void *out_blk, const aes_decrypt_ctx cx ...@@ -233,7 +235,7 @@ aes_rval aes_decrypt(const void *in_blk, void *out_blk, const aes_decrypt_ctx cx
const aes_32t *kp = cx->ks + nr * N_COLS; const aes_32t *kp = cx->ks + nr * N_COLS;
#ifdef AES_ERR_CHK #ifdef AES_ERR_CHK
if( (nr != 10 || !(cx->ks[0] | cx->ks[3] | cx->ks[4])) if( (nr != 10 || !(cx->ks[0] | cx->ks[3] | cx->ks[4]))
&& (nr != 12 || !(cx->ks[0] | cx->ks[5] | cx->ks[6])) && (nr != 12 || !(cx->ks[0] | cx->ks[5] | cx->ks[6]))
&& (nr != 14 || !(cx->ks[0] | cx->ks[7] | cx->ks[8])) ) && (nr != 14 || !(cx->ks[0] | cx->ks[7] | cx->ks[8])) )
return aes_error; return aes_error;
...@@ -249,10 +251,12 @@ aes_rval aes_decrypt(const void *in_blk, void *out_blk, const aes_decrypt_ctx cx ...@@ -249,10 +251,12 @@ aes_rval aes_decrypt(const void *in_blk, void *out_blk, const aes_decrypt_ctx cx
round(inv_rnd, b1, b0, kp - 1 * N_COLS); round(inv_rnd, b1, b0, kp - 1 * N_COLS);
round(inv_rnd, b0, b1, kp - 2 * N_COLS); round(inv_rnd, b0, b1, kp - 2 * N_COLS);
kp -= 2 * N_COLS; kp -= 2 * N_COLS;
/* Falls through. */
case 12: case 12:
round(inv_rnd, b1, b0, kp - 1 * N_COLS); round(inv_rnd, b1, b0, kp - 1 * N_COLS);
round(inv_rnd, b0, b1, kp - 2 * N_COLS); round(inv_rnd, b0, b1, kp - 2 * N_COLS);
kp -= 2 * N_COLS; kp -= 2 * N_COLS;
/* Falls through. */
case 10: case 10:
round(inv_rnd, b1, b0, kp - 1 * N_COLS); round(inv_rnd, b1, b0, kp - 1 * N_COLS);
round(inv_rnd, b0, b1, kp - 2 * N_COLS); round(inv_rnd, b0, b1, kp - 2 * N_COLS);
......
This diff is collapsed.
Libpng 1.6.23 - June 9, 2016 libpng 1.6.37 - April 14, 2019
==============================
This is a public release of libpng, intended for use in production codes. This is a public release of libpng, intended for use in production code.
Files available for download:
Source files with LF line endings (for Unix/Linux) and with a Files available for download
"configure" script ----------------------------
libpng-1.6.23.tar.xz (LZMA-compressed, recommended) Source files with LF line endings (for Unix/Linux):
libpng-1.6.23.tar.gz
Source files with CRLF line endings (for Windows), without the * libpng-1.6.37.tar.xz (LZMA-compressed, recommended)
"configure" script * libpng-1.6.37.tar.gz
lpng1623.7z (LZMA-compressed, recommended) Source files with CRLF line endings (for Windows):
lpng1623.zip
* lp1637.7z (LZMA-compressed, recommended)
* lp1637.zip
Other information: Other information:
libpng-1.6.23-README.txt * README.md
libpng-1.6.23-LICENSE.txt * LICENSE.md
libpng-1.6.23-*.asc (armored detached GPG signatures) * AUTHORS.md
* TRADEMARK.md
Changes since the last public release (1.6.22):
Stop a potential memory leak in png_set_tRNS() (Bug report by Ted Ying). Changes since the previous public release (version 1.6.36)
Fixed the progressive reader to handle empty first IDAT chunk properly ----------------------------------------------------------
(patch by Timothy Nikkel). This bug was introduced in libpng-1.6.0 and
only affected the libpng16 branch.
Added tests in pngvalid.c to check zero-length IDAT chunks in various
positions. Fixed the sequential reader to handle these more robustly
(John Bowler).
Corrected progressive read input buffer in pngvalid.c. The previous version
the code invariably passed just one byte at a time to libpng. The intent
was to pass a random number of bytes in the range 0..511.
Moved sse2 prototype from pngpriv.h to contrib/intel/intel_sse.patch.
Added missing ")" in pngerror.c (Matt Sarrett).
Fixed undefined behavior in png_push_save_buffer(). Do not call
memcpy() with a null source, even if count is zero (Leon Scroggins III).
Fixed bad link to RFC2083 in png.5 (Nikola Forro).
(subscription required; visit
https://lists.sourceforge.net/lists/listinfo/png-mng-implement
to subscribe)
or to glennrp at users.sourceforge.net
Glenn R-P * Fixed a use-after-free vulnerability (CVE-2019-7317) in png_image_free.
* Fixed a memory leak in the ARM NEON implementation of png_do_expand_palette.
* Fixed a memory leak in pngtest.c.
* Fixed two vulnerabilities (CVE-2018-14048, CVE-2018-14550) in
contrib/pngminus; refactor.
* Changed the license of contrib/pngminus to MIT; refresh makefile and docs.
(Contributed by Willem van Schaik)
* Fixed a typo in the libpng license v2.
(Contributed by Miguel Ojeda)
* Added makefiles for AddressSanitizer-enabled builds.
* Cleaned up various makefiles.
Send comments/corrections/commendations to png-mng-implement at lists.sf.net.
Subscription is required; visit
https://lists.sourceforge.net/lists/listinfo/png-mng-implement
to subscribe.
PNG REFERENCE LIBRARY AUTHORS
=============================
This is the list of PNG Reference Library ("libpng") Contributing
Authors, for copyright and licensing purposes.
* Andreas Dilger
* Cosmin Truta
* Dave Martindale
* Eric S. Raymond
* Gilles Vollant
* Glenn Randers-Pehrson
* Greg Roelofs
* Guy Eric Schalnat
* James Yu
* John Bowler
* Kevin Bracey
* Magnus Holmgren
* Mandar Sahastrabuddhe
* Mans Rullgard
* Matt Sarett
* Mike Klein
* Paul Schmidt
* Sam Bushell
* Samuel Williams
* Simon-Pierre Cadieux
* Tim Wegner
* Tom Lane
* Tom Tanner
* Vadim Barkov
* Willem van Schaik
* Zhijie Liang
* Arm Holdings
- Richard Townsend
* Google Inc.
- Matt Sarett
- Mike Klein
The build projects, the build scripts, the test scripts, and other
files in the "projects", "scripts" and "tests" directories, have other
copyright owners, but are released under the libpng license.
Some files in the "contrib" directory, and some tools-generated files
that are distributed with libpng, have other copyright owners, and are
released under other open source licenses.
This diff is collapsed.
This diff is collapsed.
COPYRIGHT NOTICE, DISCLAIMER, and LICENSE
=========================================
This copy of the libpng notices is provided for your convenience. In case of PNG Reference Library License version 2
any discrepancy between this copy and the notices in the file png.h that is ---------------------------------------
included in the libpng distribution, the latter shall prevail.
COPYRIGHT NOTICE, DISCLAIMER, and LICENSE: * Copyright (c) 1995-2019 The PNG Reference Library Authors.
* Copyright (c) 2018-2019 Cosmin Truta.
* Copyright (c) 2000-2002, 2004, 2006-2018 Glenn Randers-Pehrson.
* Copyright (c) 1996-1997 Andreas Dilger.
* Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc.
If you modify libpng you may insert additional notices immediately following The software is supplied "as is", without warranty of any kind,
this sentence. express or implied, including, without limitation, the warranties
of merchantability, fitness for a particular purpose, title, and
non-infringement. In no event shall the Copyright owners, or
anyone distributing the software, be liable for any damages or
other liability, whether in contract, tort or otherwise, arising
from, out of, or in connection with the software, or the use or
other dealings in the software, even if advised of the possibility
of such damage.
This code is released under the libpng license. Permission is hereby granted to use, copy, modify, and distribute
this software, or portions hereof, for any purpose, without fee,
subject to the following restrictions:
libpng versions 1.0.7, July 1, 2000 through 1.6.23, June 9, 2016 are 1. The origin of this software must not be misrepresented; you
Copyright (c) 2000-2002, 2004, 2006-2016 Glenn Randers-Pehrson, are must not claim that you wrote the original software. If you
use this software in a product, an acknowledgment in the product
documentation would be appreciated, but is not required.
2. Altered source versions must be plainly marked as such, and must
not be misrepresented as being the original software.
3. This Copyright notice may not be removed or altered from any
source or altered source distribution.
PNG Reference Library License version 1 (for libpng 0.5 through 1.6.35)
-----------------------------------------------------------------------
libpng versions 1.0.7, July 1, 2000, through 1.6.35, July 15, 2018 are
Copyright (c) 2000-2002, 2004, 2006-2018 Glenn Randers-Pehrson, are
derived from libpng-1.0.6, and are distributed according to the same derived from libpng-1.0.6, and are distributed according to the same
disclaimer and license as libpng-1.0.6 with the following individuals disclaimer and license as libpng-1.0.6 with the following individuals
added to the list of Contributing Authors: added to the list of Contributing Authors:
Simon-Pierre Cadieux Simon-Pierre Cadieux
Eric S. Raymond Eric S. Raymond
Mans Rullgard Mans Rullgard
Cosmin Truta Cosmin Truta
Gilles Vollant Gilles Vollant
James Yu James Yu
Mandar Sahastrabuddhe
Google Inc.
Vadim Barkov
and with the following additions to the disclaimer: and with the following additions to the disclaimer:
There is no warranty against interference with your enjoyment of the There is no warranty against interference with your enjoyment of
library or against infringement. There is no warranty that our the library or against infringement. There is no warranty that our
efforts or the library will fulfill any of your particular purposes efforts or the library will fulfill any of your particular purposes
or needs. This library is provided with all faults, and the entire or needs. This library is provided with all faults, and the entire
risk of satisfactory quality, performance, accuracy, and effort is with risk of satisfactory quality, performance, accuracy, and effort is
the user. with the user.
Some files in the "contrib" directory and some configure-generated Some files in the "contrib" directory and some configure-generated
files that are distributed with libpng have other copyright owners and files that are distributed with libpng have other copyright owners, and
are released under other open source licenses. are released under other open source licenses.
libpng versions 0.97, January 1998, through 1.0.6, March 20, 2000, are libpng versions 0.97, January 1998, through 1.0.6, March 20, 2000, are
Copyright (c) 1998-2000 Glenn Randers-Pehrson, are derived from Copyright (c) 1998-2000 Glenn Randers-Pehrson, are derived from
libpng-0.96, and are distributed according to the same disclaimer and libpng-0.96, and are distributed according to the same disclaimer and
license as libpng-0.96, with the following individuals added to the list license as libpng-0.96, with the following individuals added to the
of Contributing Authors: list of Contributing Authors:
Tom Lane Tom Lane
Glenn Randers-Pehrson Glenn Randers-Pehrson
Willem van Schaik Willem van Schaik
libpng versions 0.89, June 1996, through 0.96, May 1997, are libpng versions 0.89, June 1996, through 0.96, May 1997, are
Copyright (c) 1996-1997 Andreas Dilger, are derived from libpng-0.88, Copyright (c) 1996-1997 Andreas Dilger, are derived from libpng-0.88,
...@@ -52,14 +84,14 @@ and are distributed according to the same disclaimer and license as ...@@ -52,14 +84,14 @@ and are distributed according to the same disclaimer and license as
libpng-0.88, with the following individuals added to the list of libpng-0.88, with the following individuals added to the list of
Contributing Authors: Contributing Authors:
John Bowler John Bowler
Kevin Bracey Kevin Bracey
Sam Bushell Sam Bushell
Magnus Holmgren Magnus Holmgren
Greg Roelofs Greg Roelofs
Tom Tanner Tom Tanner
Some files in the "scripts" directory have other copyright owners Some files in the "scripts" directory have other copyright owners,
but are released under this license. but are released under this license.
libpng versions 0.5, May 1995, through 0.88, January 1996, are libpng versions 0.5, May 1995, through 0.88, January 1996, are
...@@ -68,63 +100,35 @@ Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc. ...@@ -68,63 +100,35 @@ Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc.
For the purposes of this copyright and license, "Contributing Authors" For the purposes of this copyright and license, "Contributing Authors"
is defined as the following set of individuals: is defined as the following set of individuals:
Andreas Dilger Andreas Dilger
Dave Martindale Dave Martindale
Guy Eric Schalnat Guy Eric Schalnat
Paul Schmidt Paul Schmidt
Tim Wegner Tim Wegner
The PNG Reference Library is supplied "AS IS". The Contributing Authors The PNG Reference Library is supplied "AS IS". The Contributing
and Group 42, Inc. disclaim all warranties, expressed or implied, Authors and Group 42, Inc. disclaim all warranties, expressed or
including, without limitation, the warranties of merchantability and of implied, including, without limitation, the warranties of
fitness for any purpose. The Contributing Authors and Group 42, Inc. merchantability and of fitness for any purpose. The Contributing
assume no liability for direct, indirect, incidental, special, exemplary, Authors and Group 42, Inc. assume no liability for direct, indirect,
or consequential damages, which may result from the use of the PNG incidental, special, exemplary, or consequential damages, which may
Reference Library, even if advised of the possibility of such damage. result from the use of the PNG Reference Library, even if advised of
the possibility of such damage.
Permission is hereby granted to use, copy, modify, and distribute this Permission is hereby granted to use, copy, modify, and distribute this
source code, or portions hereof, for any purpose, without fee, subject source code, or portions hereof, for any purpose, without fee, subject
to the following restrictions: to the following restrictions:
1. The origin of this source code must not be misrepresented. 1. The origin of this source code must not be misrepresented.
2. Altered versions must be plainly marked as such and must not
be misrepresented as being the original source.
3. This Copyright notice may not be removed or altered from any
source or altered source distribution.
The Contributing Authors and Group 42, Inc. specifically permit, without
fee, and encourage the use of this source code as a component to
supporting the PNG file format in commercial products. If you use this
source code in a product, acknowledgment is not required but would be
appreciated.
END OF COPYRIGHT NOTICE, DISCLAIMER, and LICENSE.
TRADEMARK:
The name "libpng" has not been registered by the Copyright owner
as a trademark in any jurisdiction. However, because libpng has
been distributed and maintained world-wide, continually since 1995,
the Copyright owner claims "common-law trademark protection" in any
jurisdiction where common-law trademark is recognized.
OSI CERTIFICATION:
Libpng is OSI Certified Open Source Software. OSI Certified Open Source is
a certification mark of the Open Source Initiative. OSI has not addressed
the additional disclaimers inserted at version 1.0.7.
EXPORT CONTROL: 2. Altered versions must be plainly marked as such and must not
be misrepresented as being the original source.
The Copyright owner believes that the Export Control Classification 3. This Copyright notice may not be removed or altered from any
Number (ECCN) for libpng is EAR99, which means not subject to export source or altered source distribution.
controls or International Traffic in Arms Regulations (ITAR) because
it is open source, publicly available software, that does not contain
any encryption software. See the EAR, paragraphs 734.3(b)(3) and
734.7(b).
Glenn Randers-Pehrson The Contributing Authors and Group 42, Inc. specifically permit,
glennrp at users.sourceforge.net without fee, and encourage the use of this source code as a component
June 9, 2016 to supporting the PNG file format in commercial products. If you use
this source code in a product, acknowledgment is not required but would
be appreciated.
This diff is collapsed.
/*
TODO - list of things to do for libpng: TODO - list of things to do for libpng:
Final bug fixes. * Fix all defects (duh!)
Better C++ wrapper/full C++ implementation? * Better C++ wrapper / full C++ implementation (?)
Fix problem with C++ and EXTERN "C". * Fix the problems with C++ and 'extern "C"'.
cHRM transformation. * cHRM transformation.
Remove setjmp/longjmp usage in favor of returning error codes. * Palette creation.
Palette creation. * "grayscale->palette" transformation and "palette->grayscale" detection.
Add "grayscale->palette" transformation and "palette->grayscale" detection. * Improved dithering.
Improved dithering. * Multi-lingual error and warning message support.
Multi-lingual error and warning message support. * Complete sRGB transformation. (Currently it simply uses gamma=0.45455.)
Complete sRGB transformation (presently it simply uses gamma=0.45455). * Man pages for function calls.
Make profile checking optional via a png_set_something() call. * Better documentation.
Man pages for function calls. * Better filter selection
Better documentation. (e.g., counting huffman bits/precompression; filter inertia; filter costs).
Better filter selection * Histogram creation.
(counting huffman bits/precompression? filter inertia? filter costs?). * Text conversion between different code pages (e.g., Latin-1 -> Mac).
Histogram creation. * Avoid building gamma tables whenever possible.
Text conversion between different code pages (Latin-1 -> Mac and DOS). * Greater precision in changing to linear gamma for compositing against
Avoid building gamma tables whenever possible. background, and in doing rgb-to-gray transformations.
Use greater precision when changing to linear gamma for compositing against * Investigate pre-incremented loop counters and other loop constructions.
background and doing rgb-to-gray transformation. * Interpolated method of handling interlacing.
Investigate pre-incremented loop counters and other loop constructions. * More validations for libpng transformations.
Add interpolated method of handling interlacing.
Switch to the simpler zlib (zlib/libpng) license if legally possible.
Extend pngvalid.c to validate more of the libpng transformations.
*/
TRADEMARK
=========
The name "libpng" has not been registered by the Copyright owners
as a trademark in any jurisdiction. However, because libpng has
been distributed and maintained world-wide, continually since 1995,
the Copyright owners claim "common-law trademark protection" in any
jurisdiction where common-law trademark is recognized.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
source/Irrlicht/libpng/pngtest.png

8.49 KB | W: | H:

source/Irrlicht/libpng/pngtest.png

8.55 KB | W: | H:

source/Irrlicht/libpng/pngtest.png
source/Irrlicht/libpng/pngtest.png
source/Irrlicht/libpng/pngtest.png
source/Irrlicht/libpng/pngtest.png
  • 2-up
  • Swipe
  • Onion skin
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment