mirror of
https://github.com/minetest/irrlicht.git
synced 2024-12-25 15:42:25 +01:00
Merging r6196 through r6248 from trunk to ogl-es branch
git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/branches/ogl-es@6249 dfc29bdd-3216-0410-991c-e03cc46cb475
This commit is contained in:
parent
c26ff3476f
commit
9690c1b3e3
23
changes.txt
23
changes.txt
@ -9,6 +9,26 @@ Changes in ogl-es (not yet released - will be merged with trunk at some point)
|
||||
|
||||
--------------------------
|
||||
Changes in 1.9 (not yet released)
|
||||
- Add equals and set_data functions to core::array for easier working with blocks of data.
|
||||
- SIrrlichtCreationParameters::IgnoreInput set to false works again on X11.
|
||||
Thanks @ Victor Gaydov for report + patch + very good test cases! (bug #401)
|
||||
This had been broken since Irrlicht 1.6
|
||||
- Add steer parameter to CSceneNodeAnimatorFollowSpline which allows rotating node toward direction of movement.
|
||||
Thanks @ Bate for the patch (patch #175)
|
||||
- Add a workaround for XWarpPointer bug that causes mouse to jump when users have set a Coordinate Transformation Matrix for their mouse on X11.
|
||||
This was mentioned in bug #450 by vikaig.
|
||||
The fix needs compiling with _IRR_LINUX_X11_XINPUT2_ enabled (so far disabled by default)
|
||||
- Add IGeometryCreator::createTorusMesh to create donuts.
|
||||
- Don't try loading broken image files twice with same loader anymore.
|
||||
- Make CImageLoaderJPG thread safe. Thanks @ Edoardo Lolletti for report and patch (patch #324)
|
||||
- Add ETCF_SUPPORT_VERTEXT_TEXTURE flag which can be used to enable vertex texture sampling support in Direct3D 9.
|
||||
Note that this was enabled for a long time in 1.9 svn, but is now disabled by default.
|
||||
- CGUIListBox now serializes the state of "Selected". Feature wish by chronologicaldot (http://irrlicht.sourceforge.net/forum/viewtopic.php?f=2&t=52719)
|
||||
- Bugfix: Changing focus with tab-keys now also work when elements are inside a modal screen.
|
||||
- COBJMeshFileLoader using a bit more exact color conversion for 0-1 to 0-255 range (same now as SColorf::toSColor uses).
|
||||
- Speedup for COBJMeshWriter
|
||||
- Add blinkMode parameter to IGUIEnvironment::addModalScreen, so blinking can be suppressed
|
||||
- Speedup: Avoid string copy in CXMLReaderImpl::getAttributeByName
|
||||
- Fix bug in rect::clipAgainst that had caused rects completely outside to the left-top of the rect to be clipped against ending up with both corners outside.
|
||||
It still worked for UI in most cases as the resulting rectangle still had an area of 0.
|
||||
- Add getAlign functions to IGUIElement
|
||||
@ -84,7 +104,7 @@ Changes in 1.9 (not yet released)
|
||||
- Drivers can now try to create textures from images in more exotic color formats (like floating point formats). It depends on the driver how much that works (so far mainly OpenGL can handle it somewhat).
|
||||
- Fix OpenGL to no longer switch colors red and blue in 24-bit RGB format. But warnings added to documentation to avoid 24-bit textures as they are generally just trouble.
|
||||
- No longer try to convert ECF_R5G6B5 to ECF_A1R5G5B5 on OpenGL (just made texture-loading seem to fail).
|
||||
- Add flag SIrrlichtCreationParameters.WindowResizable. Mainly to work around troubles with SDL+OpenGL on some platforms where resizing later can be tricky/impossible.
|
||||
- Add parameter SIrrlichtCreationParameters.WindowResizable. Mainly to work around troubles with SDL+OpenGL on some platforms where resizing later can be tricky/impossible.
|
||||
- Add operator[] to vector2d and vector3d
|
||||
- Bugfix: IrrlichtDevice::isWindowMinimized no longer returns true when it's maximized on Windows.
|
||||
- Ignore degenerated faces in obj file loader when they would generate triangles where 2 vertices use identical indices.
|
||||
@ -318,6 +338,7 @@ Changes in 1.9 (not yet released)
|
||||
|
||||
--------------------------
|
||||
Changes in 1.8.5
|
||||
- Update script to generate tutorial.html's in example folders. Add missing ones. Update existing ones. Thanks @Guillian J for noticing those were outdated.
|
||||
- Update libpng to 1.6.37 (from 1.6.23)
|
||||
- Fix CIrrDeviceSDL::getVideoModeList which didn't return video modes before. Thx @kas1e for report and patch.
|
||||
- CIrrDeviceMacOSX now sets the SEvent.MouseInput Shift and Control values on mouse events like the other devices. Thanks @ Zero King for patch (#321)
|
||||
|
@ -1,12 +1,12 @@
|
||||
Checklist for Irrlicht developers for doing releases.
|
||||
Checklist for Irrlicht developers doing releases.
|
||||
|
||||
Note: Generally the more platforms, compilers, settings you can test the better. Ask for help for platforms which you don't own.
|
||||
|
||||
- PRE-BUILD TESTS:
|
||||
- - Run tests in the tests folder
|
||||
- - Compile and run all examples for testing (preferably on all platforms,
|
||||
compilers, settings ... until you are certain enough stuff works sufficiently).
|
||||
Ask for help for platforms which you don't own.
|
||||
- - Compile the tools on all platforms you have. Note that some tools are in the buildall-examples VS project files on Windows, but on Linux
|
||||
command line you have to compile them individually.
|
||||
- - Compile and run examples.
|
||||
- - Compile and run the tools. Note that some tools are in the buildall-examples VS project files on Windows,
|
||||
but on Linux command line you have to compile them individually.
|
||||
|
||||
- VERSION UPDATES:
|
||||
- - check IRRLICHT_SDK_VERSION (in IrrCompileConfig.h)
|
||||
@ -15,13 +15,16 @@ command line you have to compile them individually.
|
||||
- - Add new release information (date+version-number) in changes.txt
|
||||
- - go through folders if other .txt files still make sense (things change and updating those files tends to be forgotten)
|
||||
|
||||
- DOCUMENTATION UPDATES:
|
||||
- - run makedocumentation.sh in scripts\doc\irrlicht
|
||||
- - run maketutorial.sh in scripts\doc\irrlicht (commit changed tutorial.html's)
|
||||
|
||||
- BUILDING THE RELEASE
|
||||
(TBD - should we still release dll's? Newer and older VS builds are no longer compatible anyway)
|
||||
- - run a clean build for buildAllExamples in the examples folder with the
|
||||
target compiler for 32-bit and for release (preferably oldest supported VS
|
||||
compiler, otherwise oldest you have still installed)
|
||||
target compiler for 32-bit and for release (old VS compiler - so far VS2010)
|
||||
- - when possible compile the dll for MinGW on Windows (in release and with -s for smaller size)
|
||||
- - when possible compile the dll for 64 bit (again with Visual Studio and release)
|
||||
- - run makedocumentation in scripts\doc\irrlicht
|
||||
- - create a target directory, like irrlicht-1.8.1 for example
|
||||
- - svn export to the target directory
|
||||
- - copy the subfolders of doctemp into the doc folder of the target directory
|
||||
|
@ -5,6 +5,8 @@
|
||||
#ifndef __E_GUI_ALIGNMENT_H_INCLUDED__
|
||||
#define __E_GUI_ALIGNMENT_H_INCLUDED__
|
||||
|
||||
#include "irrTypes.h"
|
||||
|
||||
namespace irr
|
||||
{
|
||||
namespace gui
|
||||
@ -35,4 +37,3 @@ const c8* const GUIAlignmentNames[] =
|
||||
} // namespace irr
|
||||
|
||||
#endif // __E_GUI_ALIGNMENT_H_INCLUDED__
|
||||
|
||||
|
@ -258,10 +258,14 @@ public:
|
||||
Note that it usually works badly to pass the modal screen already as parent when creating
|
||||
a new element. It's better to add that new element later to the modal screen with addChild.
|
||||
\param parent Parent gui element of the modal.
|
||||
\param blinkMode Bitset of when to blink (can be combined)
|
||||
0 = never
|
||||
1 = focus changes
|
||||
2 = Left mouse button pressed down
|
||||
\return Pointer to the created modal. Returns 0 if an error occurred.
|
||||
This pointer should not be dropped. See IReferenceCounted::drop() for
|
||||
more information. */
|
||||
virtual IGUIElement* addModalScreen(IGUIElement* parent) = 0;
|
||||
virtual IGUIElement* addModalScreen(IGUIElement* parent, int blinkMode = 3) = 0;
|
||||
|
||||
//! Adds a message box.
|
||||
/** \param caption Text to be displayed the title of the message box.
|
||||
|
@ -7,7 +7,7 @@
|
||||
|
||||
#include "IReferenceCounted.h"
|
||||
#include "irrArray.h"
|
||||
|
||||
#include "EHardwareBufferFlags.h"
|
||||
#include "SVertexIndex.h"
|
||||
|
||||
namespace irr
|
||||
|
@ -39,7 +39,7 @@ namespace video
|
||||
//! Returns an array of previously set textures.
|
||||
const core::array<ITexture*>& getTexture() const
|
||||
{
|
||||
return Texture;
|
||||
return Textures;
|
||||
}
|
||||
|
||||
//! Returns a of previously set depth / depth-stencil texture.
|
||||
@ -48,34 +48,49 @@ namespace video
|
||||
return DepthStencil;
|
||||
}
|
||||
|
||||
//! Returns an array of active surface for cube textures
|
||||
const core::array<E_CUBE_SURFACE>& getCubeSurfaces() const
|
||||
{
|
||||
return CubeSurfaces;
|
||||
}
|
||||
|
||||
//! Set multiple textures.
|
||||
/** Set multiple textures for the render target.
|
||||
\param texture Array of texture objects. These textures are used for a color outputs.
|
||||
\param depthStencil Depth or packed depth-stencil texture. This texture is used as depth
|
||||
or depth-stencil buffer.
|
||||
or depth-stencil buffer. You can pass getDepthStencil() if you don't want to change it.
|
||||
\param cubeSurfaces When rendering to cube textures, set the surface to be used for each texture. Can be empty otherwise.
|
||||
*/
|
||||
virtual void setTexture(const core::array<ITexture*>& texture, ITexture* depthStencil, const core::array<E_CUBE_SURFACE>& cubeSurfaces = core::array<E_CUBE_SURFACE>()) = 0;
|
||||
void setTexture(const core::array<ITexture*>& texture, ITexture* depthStencil, const core::array<E_CUBE_SURFACE>& cubeSurfaces = core::array<E_CUBE_SURFACE>())
|
||||
{
|
||||
setTextures(texture.const_pointer(), texture.size(), depthStencil, cubeSurfaces.const_pointer(), cubeSurfaces.size());
|
||||
}
|
||||
|
||||
//! Set one texture.
|
||||
//! Sets one texture + depthStencil
|
||||
//! You can pass getDepthStencil() for depthStencil if you don't want to change that one
|
||||
void setTexture(ITexture* texture, ITexture* depthStencil)
|
||||
{
|
||||
core::array<ITexture*> textureArray(1);
|
||||
textureArray.push_back(texture);
|
||||
|
||||
setTexture(textureArray, depthStencil);
|
||||
if ( texture )
|
||||
{
|
||||
setTextures(&texture, 1, depthStencil);
|
||||
}
|
||||
else
|
||||
{
|
||||
setTextures(0, 0, depthStencil);
|
||||
}
|
||||
}
|
||||
|
||||
//! Set one cube surface texture.
|
||||
void setTexture(ITexture* texture, ITexture* depthStencil, E_CUBE_SURFACE cubeSurface)
|
||||
{
|
||||
core::array<ITexture*> textureArray(1);
|
||||
textureArray.push_back(texture);
|
||||
|
||||
core::array<E_CUBE_SURFACE> cubeSurfaces(1);
|
||||
cubeSurfaces.push_back(cubeSurface);
|
||||
|
||||
setTexture(textureArray, depthStencil, cubeSurfaces);
|
||||
if ( texture )
|
||||
{
|
||||
setTextures(&texture, 1, depthStencil, &cubeSurface, 1);
|
||||
}
|
||||
else
|
||||
{
|
||||
setTextures(0, 0, depthStencil, &cubeSurface, 1);
|
||||
}
|
||||
}
|
||||
|
||||
//! Get driver type of render target.
|
||||
@ -86,8 +101,12 @@ namespace video
|
||||
|
||||
protected:
|
||||
|
||||
//! Set multiple textures.
|
||||
// NOTE: working with pointers instead of arrays to avoid unnecessary memory allocations for the single textures case
|
||||
virtual void setTextures(ITexture* const * textures, u32 numTextures, ITexture* depthStencil, const E_CUBE_SURFACE* cubeSurfaces=0, u32 numCubeSurfaces=0) = 0;
|
||||
|
||||
//! Textures assigned to render target.
|
||||
core::array<ITexture*> Texture;
|
||||
core::array<ITexture*> Textures;
|
||||
|
||||
//! Depth or packed depth-stencil texture assigned to render target.
|
||||
ITexture* DepthStencil;
|
||||
|
@ -97,6 +97,14 @@ enum E_TEXTURE_CREATION_FLAG
|
||||
*/
|
||||
ETCF_AUTO_GENERATE_MIP_MAPS = 0x00000100,
|
||||
|
||||
//! Enable support for vertex shader texture sampling on some drivers
|
||||
/** Default is false.
|
||||
This adds a small costs to all texture switches.
|
||||
Currently only affects D3D9.
|
||||
On OpenGL vertex shaders use the same texture unit as pixel shaders, so support there only depends on GL version and not on this flag
|
||||
*/
|
||||
ETCF_SUPPORT_VERTEXT_TEXTURE = 0x00000200,
|
||||
|
||||
/** This flag is never used, it only forces the compiler to compile
|
||||
these enumeration values to 32 bit. */
|
||||
ETCF_FORCE_32_BIT_DO_NOT_USE = 0x7fffffff
|
||||
|
@ -7,6 +7,7 @@
|
||||
|
||||
#include "IReferenceCounted.h"
|
||||
#include "irrArray.h"
|
||||
#include "EHardwareBufferFlags.h"
|
||||
#include "S3DVertex.h"
|
||||
|
||||
namespace irr
|
||||
|
@ -483,7 +483,7 @@ namespace video
|
||||
example in picture edit programs. To avoid this problem, you
|
||||
could use the makeColorKeyTexture method, which takes the
|
||||
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
|
||||
(i.e. black). This behavior matches the legacy (buggy) behavior prior
|
||||
to release 1.5 and is provided for backwards compatibility only.
|
||||
@ -500,7 +500,7 @@ namespace video
|
||||
\param colorKeyPixelPos Position of a pixel with the color key
|
||||
color. Every texel with this color will become fully transparent as
|
||||
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
|
||||
(i.e. black). This behavior matches the legacy (buggy) behavior prior
|
||||
to release 1.5 and is provided for backwards compatibility only.
|
||||
|
@ -340,7 +340,7 @@ for Windows based systems. You also have to set #define UNICODE for this to comp
|
||||
#undef _IRR_WCHAR_FILESYSTEM
|
||||
#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,
|
||||
the engine will no longer read .jpeg images. */
|
||||
#define _IRR_COMPILE_WITH_LIBJPEG_
|
||||
|
@ -30,7 +30,7 @@ namespace irr
|
||||
Bits(32),
|
||||
ZBufferBits(24),
|
||||
Fullscreen(false),
|
||||
WindowResizable(false),
|
||||
WindowResizable(2),
|
||||
Stencilbuffer(true),
|
||||
Vsync(false),
|
||||
AntiAlias(0),
|
||||
@ -131,8 +131,9 @@ namespace irr
|
||||
|
||||
//! Should a non-fullscreen window be resizable.
|
||||
/** Might not be supported by all devices. Ignored when Fullscreen is true.
|
||||
Default: false */
|
||||
bool WindowResizable;
|
||||
Values: 0 = not resizable, 1 = resizable, 2 = system decides default itself
|
||||
Default: 2*/
|
||||
u8 WindowResizable;
|
||||
|
||||
//! Specifies if the stencil buffer should be enabled.
|
||||
/** Set this to true, if you want the engine be able to draw
|
||||
|
@ -6,6 +6,7 @@
|
||||
#define __S_LIGHT_H_INCLUDED__
|
||||
|
||||
#include "SColor.h"
|
||||
#include "vector3d.h"
|
||||
|
||||
namespace irr
|
||||
{
|
||||
@ -98,4 +99,3 @@ struct SLight
|
||||
} // end namespace irr
|
||||
|
||||
#endif
|
||||
|
||||
|
@ -5,6 +5,7 @@
|
||||
#ifndef __S_VERTEX_MANIPULATOR_H_INCLUDED__
|
||||
#define __S_VERTEX_MANIPULATOR_H_INCLUDED__
|
||||
|
||||
#include "matrix4.h"
|
||||
#include "S3DVertex.h"
|
||||
#include "SColor.h"
|
||||
|
||||
|
@ -5,6 +5,8 @@
|
||||
#ifndef __I_SCENE_PARAMETERS_H_INCLUDED__
|
||||
#define __I_SCENE_PARAMETERS_H_INCLUDED__
|
||||
|
||||
#include "irrTypes.h"
|
||||
|
||||
/*! \file SceneParameters.h
|
||||
\brief Header file containing all scene parameters for modifying mesh loading etc.
|
||||
|
||||
|
@ -13,6 +13,13 @@ namespace irr
|
||||
namespace core
|
||||
{
|
||||
//! Selection of characters which count as decimal point in fast_atof
|
||||
//! By default Irrlicht considers "." as the decimal point in numbers.
|
||||
//! But sometimes you might run into situations where floats were written in
|
||||
//! a local format with another decimal point like ",".
|
||||
//! Best solution is usually to fix those cases by converting the input.
|
||||
//! But if you don't have that choice you can set this to ".,".
|
||||
//! WARNING: This is not thread-safe, so don't change while there's a chance
|
||||
//! of another thread using fast_atof functions at the same time.
|
||||
// TODO: This should probably also be used in irr::core::string, but
|
||||
// the float-to-string code used there has to be rewritten first.
|
||||
IRRLICHT_API extern irr::core::stringc LOCALE_DECIMAL_POINTS;
|
||||
|
@ -231,6 +231,40 @@ public:
|
||||
free_when_destroyed=_free_when_destroyed;
|
||||
}
|
||||
|
||||
//! Set (copy) data from given memory block
|
||||
/** \param newData data to set, must have newSize elements
|
||||
\param newSize Amount of elements in newData
|
||||
\param canShrink When true we reallocate the array even it can shrink.
|
||||
May reduce memory usage, but call is more whenever size changes.
|
||||
\param newDataIsSorted Info if you pass sorted/unsorted data
|
||||
*/
|
||||
void set_data(const T* newData, u32 newSize, bool newDataIsSorted=false, bool canShrink=false)
|
||||
{
|
||||
reallocate(newSize, canShrink);
|
||||
set_used(newSize);
|
||||
for ( u32 i=0; i<newSize; ++i)
|
||||
{
|
||||
data[i] = newData[i];
|
||||
}
|
||||
is_sorted = newDataIsSorted;
|
||||
}
|
||||
|
||||
//! Compare if given data block is identical to the data in our array
|
||||
/** Like operator ==, but without the need to create the array
|
||||
\param otherData Address to data against which we compare, must contain size elements
|
||||
\param size Amount of elements in otherData */
|
||||
bool equals(const T* otherData, u32 size) const
|
||||
{
|
||||
if (used != size)
|
||||
return false;
|
||||
|
||||
for (u32 i=0; i<size; ++i)
|
||||
if (data[i] != otherData[i])
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
|
||||
//! Sets if the array should delete the memory it uses upon destruction.
|
||||
/** Also clear and set_pointer will only delete the (original) memory
|
||||
@ -258,7 +292,6 @@ public:
|
||||
used = usedNow;
|
||||
}
|
||||
|
||||
|
||||
//! Assignment operator
|
||||
const array<T, TAlloc>& operator=(const array<T, TAlloc>& other)
|
||||
{
|
||||
@ -290,13 +323,7 @@ public:
|
||||
//! Equality operator
|
||||
bool operator == (const array<T, TAlloc>& other) const
|
||||
{
|
||||
if (used != other.used)
|
||||
return false;
|
||||
|
||||
for (u32 i=0; i<other.used; ++i)
|
||||
if (data[i] != other[i])
|
||||
return false;
|
||||
return true;
|
||||
return equals(other.const_pointer(), other.size());
|
||||
}
|
||||
|
||||
|
||||
|
@ -2,7 +2,8 @@
|
||||
// This file is part of the "Irrlicht Engine".
|
||||
// For conditions of distribution and use, see copyright notice in irrlicht.h
|
||||
|
||||
#ifndef __LEAK_HUNTER_INCLUDEED__
|
||||
#ifndef __LEAK_HUNTER_INCLUDED__
|
||||
#define __LEAK_HUNTER_INCLUDED__
|
||||
|
||||
#include "IrrCompileConfig.h"
|
||||
|
||||
|
@ -295,7 +295,8 @@ class line2d
|
||||
}
|
||||
|
||||
//! 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. */
|
||||
vector2d<T> getClosestPoint(const vector2d<T>& point, bool checkOnlySegments=true) const
|
||||
{
|
||||
|
@ -13,7 +13,9 @@ namespace io
|
||||
{
|
||||
|
||||
//! Type used for all file system related strings.
|
||||
/** This type will transparently handle different file system encodings. */
|
||||
/** This type will transparently handle different file system encodings.
|
||||
NOTE: For historical reasons the tool-functions using io::path are all in coreutil.h
|
||||
*/
|
||||
typedef core::string<fschar_t> path;
|
||||
|
||||
//! Used in places where we identify objects by a filename, but don't actually work with the real filename
|
||||
|
@ -1482,7 +1482,9 @@ INCLUDE_FILE_PATTERNS =
|
||||
# undefined via #undef or recursively expanded use the := operator
|
||||
# instead of the = operator.
|
||||
|
||||
PREDEFINED =
|
||||
PREDEFINED = _IRR_COMPILE_WITH_PROFILING_
|
||||
PREDEFINED += _IRR_COMPILE_WITH_LEAK_HUNTER_
|
||||
PREDEFINED += _IRR_COMPILE_WITH_SDL_DEVICE_
|
||||
|
||||
# If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then
|
||||
# this tag can be used to specify a list of macro names that should be expanded.
|
||||
|
2442
scripts/doc/irrlicht/doxygen_tutorial.cfg
Normal file
2442
scripts/doc/irrlicht/doxygen_tutorial.cfg
Normal file
File diff suppressed because it is too large
Load Diff
@ -1,3 +1,5 @@
|
||||
mkdir -p ../../../doctemp/html
|
||||
|
||||
rm tut.txt || true;
|
||||
|
||||
mkdir ../../../doctemp
|
||||
@ -8,4 +10,11 @@ for i in ../../../examples/[012]*/main.cpp; do
|
||||
sed -f tutorials.sed $i >>tut.txt;
|
||||
done
|
||||
|
||||
# Enable for latex docs
|
||||
#doxygen doxygen-pdf.cfg
|
||||
|
||||
# Enable for html docs
|
||||
doxygen doxygen.cfg
|
||||
|
||||
#cp doxygen.css ../../../doctemp/html
|
||||
cp irrlicht.png logobig.png ../../../doctemp/html
|
||||
|
@ -1,5 +1,7 @@
|
||||
1,+18 d
|
||||
s/src="/src="images\/tutorials\//
|
||||
s/href="/href="docu\//g
|
||||
s/\(.*\) <hr.*$/\1/
|
||||
/<addr/,$ d
|
||||
# run on single_tut.txt which is created in maketutorial.sh (or .bat)
|
||||
|
||||
# replace image links as we don't copy the images into example folders but keep them below media folder
|
||||
# most images should be in media
|
||||
s/img src="/img src="..\/..\/media\//g
|
||||
# ???shots.jpg files are in media/example_screenshots another subfolder (earlier replacement already moved them to ../../media/)
|
||||
s/img src="..\/..\/media\/\([0-9]\{3\}shot\)/img src="..\/..\/media\/example_screenshots\/\1/
|
||||
|
@ -1,4 +1,4 @@
|
||||
type tut_head.html >%2
|
||||
..\sed.exe -f maketut.sed %1 >>%2
|
||||
type tut_end.html >>%2
|
||||
|
||||
REM OUTDATED - don't use this anymore. For now only maketutorial.sh works, this one still has to be updated.
|
||||
REM type tut_head.html >%2
|
||||
REM ..\sed.exe -f maketut.sed %1 >>%2
|
||||
REM type tut_end.html >>%2
|
||||
|
@ -1,4 +1,34 @@
|
||||
cat tut_head.html >$2
|
||||
sed -f maketut.sed $1 >>$2
|
||||
cat tut_end.html >>$2
|
||||
# Create the tutorial.html files in each example folder
|
||||
|
||||
# for every folder below examples
|
||||
for i in ../../../examples/[0123]*; do
|
||||
#for i in ../../../examples/01.*; do # if you want to run/update a single example use this loop
|
||||
echo NOW doing $i
|
||||
|
||||
if ! [ -f "$i/main.cpp" ]; then
|
||||
continue
|
||||
fi
|
||||
|
||||
# uses the main.cpp files to create some file to use as doxygen input
|
||||
sed -f tutorials.sed $i/main.cpp >single_tut.txt
|
||||
# echo tutorials.sed has run
|
||||
|
||||
# create the html file
|
||||
doxygen doxygen_tutorial.cfg
|
||||
# echo doxygen has run
|
||||
|
||||
# Fix the image links
|
||||
sed -f maketut.sed html/example???.html >tutorial.html
|
||||
# echo maketut.sed has run
|
||||
|
||||
#move to example folder
|
||||
mv tutorial.html $i/tutorial.html
|
||||
# echo copied
|
||||
|
||||
#cleanup
|
||||
rm -r html
|
||||
# echo cleaned
|
||||
done
|
||||
|
||||
#cleanup
|
||||
rm single_tut.txt
|
||||
|
@ -1,14 +1,5 @@
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<p> </p></td>
|
||||
</tr>
|
||||
</table>
|
||||
<div align="right"><br />
|
||||
<a href="http://validator.w3.org/check?uri=referer" target="_blank"><img src="images/general/valid-xhtml10.png" alt="Valid XHTML 1.0!" width="88" height="31" border="0" /></a>
|
||||
<a href="http://jigsaw.w3.org/css-validator/" target="_blank"><img src="images/general/vcss.gif" alt="Valid CSS!" width="88" height="31" border="0" /></a></div>
|
||||
</div>
|
||||
<p class="copyrighttext"><br />
|
||||
Irrlicht Engine and Irrlicht Engine webpage © 2003-2010 by Nikolaus Gebhardt</p>
|
||||
<!-- HTML footer for doxygen 1.8.13-->
|
||||
<!-- start footer part -->
|
||||
<p> </p>
|
||||
</body>
|
||||
</html>
|
||||
|
@ -1,52 +1,228 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<html>
|
||||
<head>
|
||||
<title>Irrlicht Engine - A free open source 3d engine</title>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
||||
<link rel="shortcut icon" type="image/x-icon" href="favicon.ico" />
|
||||
<link rel="stylesheet" href="doxygen.css" type="text/css" />
|
||||
<link rel="stylesheet" href="style.css" type="text/css" />
|
||||
<!-- (c) 2005-2010 by N.Gebhardt -->
|
||||
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
|
||||
<meta name="generator" content="Doxygen $doxygenversion"/>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1"/>
|
||||
<!--BEGIN PROJECT_NAME--><title>$projectname: $title</title><!--END PROJECT_NAME-->
|
||||
<!--BEGIN !PROJECT_NAME--><title>$title</title><!--END !PROJECT_NAME-->
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
|
||||
<!-- Wanted to avoid copying .css to each folder, so copied default .css from doxyen in here, kicked out most stuff we don't need for examples and modified some a little bit.
|
||||
Target was having a single html in each example folder which is created from the main.cpp files and needs no files besides some images below media folder.
|
||||
Feel free to improve :)
|
||||
-->
|
||||
<style>
|
||||
body, table, div, p, dl {
|
||||
font: 400 14px/22px;
|
||||
}
|
||||
|
||||
body {
|
||||
background-color: #F0F0F0;
|
||||
color: black;
|
||||
margin-left: 5%;
|
||||
margin-right: 5%;
|
||||
}
|
||||
|
||||
p.reference, p.definition {
|
||||
font: 400 14px/22px;
|
||||
}
|
||||
|
||||
.title {
|
||||
font: 400 14px/28px;
|
||||
font-size: 150%;
|
||||
font-weight: bold;
|
||||
margin: 10px 2px;
|
||||
}
|
||||
|
||||
h1, h2, h3, h4, h5, h6 {
|
||||
-webkit-transition: text-shadow 0.5s linear;
|
||||
-moz-transition: text-shadow 0.5s linear;
|
||||
-ms-transition: text-shadow 0.5s linear;
|
||||
-o-transition: text-shadow 0.5s linear;
|
||||
transition: text-shadow 0.5s linear;
|
||||
margin-right: 15px;
|
||||
}
|
||||
|
||||
caption {
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
h3.version {
|
||||
font-size: 90%;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
a {
|
||||
color: #3D578C;
|
||||
font-weight: normal;
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
.contents a:visited {
|
||||
color: #4665A2;
|
||||
}
|
||||
|
||||
a:hover {
|
||||
text-decoration: underline;
|
||||
}
|
||||
|
||||
a.el {
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
a.code, a.code:visited, a.line, a.line:visited {
|
||||
color: #4665A2;
|
||||
}
|
||||
|
||||
a.codeRef, a.codeRef:visited, a.lineRef, a.lineRef:visited {
|
||||
color: #4665A2;
|
||||
}
|
||||
|
||||
pre.fragment {
|
||||
border: 1px solid #C4CFE5;
|
||||
background-color: #FBFCFD;
|
||||
padding: 4px 6px;
|
||||
margin: 4px 8px 4px 2px;
|
||||
overflow: auto;
|
||||
word-wrap: break-word;
|
||||
font-size: 9pt;
|
||||
line-height: 125%;
|
||||
font-family: monospace, fixed;
|
||||
font-size: 105%;
|
||||
}
|
||||
|
||||
div.fragment {
|
||||
padding: 0px;
|
||||
margin: 4px 8px 4px 2px;
|
||||
background-color: #FBFCFD;
|
||||
border: 1px solid #C4CFE5;
|
||||
}
|
||||
|
||||
div.line {
|
||||
font-family: monospace, fixed;
|
||||
font-size: 13px;
|
||||
min-height: 13px;
|
||||
line-height: 1.0;
|
||||
text-wrap: unrestricted;
|
||||
white-space: -moz-pre-wrap; /* Moz */
|
||||
white-space: -pre-wrap; /* Opera 4-6 */
|
||||
white-space: -o-pre-wrap; /* Opera 7 */
|
||||
white-space: pre-wrap; /* CSS3 */
|
||||
word-wrap: break-word; /* IE 5.5+ */
|
||||
text-indent: -53px;
|
||||
padding-left: 53px;
|
||||
padding-bottom: 0px;
|
||||
margin: 0px;
|
||||
-webkit-transition-property: background-color, box-shadow;
|
||||
-webkit-transition-duration: 0.5s;
|
||||
-moz-transition-property: background-color, box-shadow;
|
||||
-moz-transition-duration: 0.5s;
|
||||
-ms-transition-property: background-color, box-shadow;
|
||||
-ms-transition-duration: 0.5s;
|
||||
-o-transition-property: background-color, box-shadow;
|
||||
-o-transition-duration: 0.5s;
|
||||
transition-property: background-color, box-shadow;
|
||||
transition-duration: 0.5s;
|
||||
}
|
||||
|
||||
div.contents {
|
||||
margin-top: 10px;
|
||||
margin-left: 12px;
|
||||
margin-right: 8px;
|
||||
}
|
||||
|
||||
div.center {
|
||||
text-align: center;
|
||||
margin-top: 0px;
|
||||
margin-bottom: 0px;
|
||||
padding: 0px;
|
||||
}
|
||||
|
||||
div.center img {
|
||||
border: 0px;
|
||||
}
|
||||
|
||||
span.keyword {
|
||||
color: #008000
|
||||
}
|
||||
|
||||
span.keywordtype {
|
||||
color: #604020
|
||||
}
|
||||
|
||||
span.keywordflow {
|
||||
color: #e08000
|
||||
}
|
||||
|
||||
span.comment {
|
||||
color: #800000
|
||||
}
|
||||
|
||||
span.preprocessor {
|
||||
color: #806020
|
||||
}
|
||||
|
||||
span.stringliteral {
|
||||
color: #002080
|
||||
}
|
||||
|
||||
span.charliteral {
|
||||
color: #008080
|
||||
}
|
||||
|
||||
blockquote {
|
||||
background-color: #F7F8FB;
|
||||
border-left: 2px solid #9CAFD4;
|
||||
margin: 0 24px 0 4px;
|
||||
padding: 0 12px 0 16px;
|
||||
}
|
||||
|
||||
hr {
|
||||
height: 0px;
|
||||
border: none;
|
||||
border-top: 1px solid #4A6AAA;
|
||||
}
|
||||
|
||||
address {
|
||||
font-style: normal;
|
||||
color: #2A3D61;
|
||||
}
|
||||
|
||||
div.header {
|
||||
background-image:url('nav_h.png');
|
||||
background-repeat:repeat-x;
|
||||
background-color: #F9FAFC;
|
||||
margin: 0px;
|
||||
border-bottom: 1px solid #C4CFE5;
|
||||
}
|
||||
|
||||
div.headertitle {
|
||||
padding: 5px 5px 5px 10px;
|
||||
}
|
||||
|
||||
.image {
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.caption {
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
div.zoom {
|
||||
border: 1px solid #90A5CE;
|
||||
}
|
||||
|
||||
tr.heading h2 {
|
||||
margin-top: 12px;
|
||||
margin-bottom: 4px;
|
||||
}
|
||||
</style>
|
||||
|
||||
</head>
|
||||
<body>
|
||||
<div align="center"><br/>
|
||||
<table cellspacing="0" class="main" >
|
||||
<tr>
|
||||
<td colspan="2" class="logobar" ><img alt="Irrlicht Engine logo" src="images/general/irrlichtlogo.gif" width="233" height="60" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="2" class="linkbar" ><a href="index.html">Home</a> | <a href="phpBB2/index.php">Forum</a>
|
||||
| <a href="docu/index.html" target="_blank">API</a> | <a href="http://www.google.com/custom?domains=irrlicht.sourceforge.net&sitesearch=irrlicht.sourceforge.net" target="_blank">Search</a></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="sidebar"> <div class="sidebarentry">
|
||||
<p class="sideBarTitle">Engine</p>
|
||||
<a href="index.html">News</a> <a href="features.html">Features</a> <a href="screenshots.html">Screenshots</a>
|
||||
<a href="downloads.html">Downloads</a>
|
||||
<a href="development.html">Development</a>
|
||||
<a href="toolset.html">Toolset</a>
|
||||
</div>
|
||||
<div class="sidebarentry">
|
||||
<p class="sideBarTitle">Documentation</p>
|
||||
<a href="faq.html">FAQ</a> <a href="docu/index.html" target="_blank">API</a>
|
||||
<a href="docu.net/index.html" target="_blank">API.NET</a> <a href="tutorials.html">Tutorials</a>
|
||||
<a href="license.html">License</a> <a href="newsarchive.html">News-Archive</a>
|
||||
<a href="http://www.irrlicht3d.org/wiki" target="_blank">Wiki</a> </div>
|
||||
<div class="sidebarentry">
|
||||
<p class="sideBarTitle">Sourceforge</p>
|
||||
<a href="http://sourceforge.net/projects/irrlicht/">Project Page</a>
|
||||
<a href="phpBB2/index.php">Forums</a>
|
||||
<a href="shirts.html">Shirts</a> </div>
|
||||
<div class="sidebarentry">
|
||||
<p class="sideBarTitle">Contact</p>
|
||||
<a href="links.html">Links</a> <a href="author.html">Author</a> <a href="impressum.html">Impressum</a> </div>
|
||||
<p><a href="http://irrlicht.sourceforge.net"><br />
|
||||
<img alt="Irrlicht Engine logo button" src="images/general/irrlicht.png" width="88" height="31" border="0" /></a></p>
|
||||
<p><a href="http://sourceforge.net"> <img src="http://sourceforge.net/sflogo.php?group_id=74339&type=1" width="88" height="31" border="0" alt="SourceForge.net Logo" /></a></p>
|
||||
<p> <a href="http://opensource.org/" target="_blank"><img alt="OSI Certified logo" src="images/general/osi-certified-72x60-t.png" width="72" height="60" border="0" /></a>
|
||||
</p>
|
||||
<p> </p></td>
|
||||
<td class="mainframe" > <table class="newsbox" >
|
||||
<tr>
|
||||
<td class="newscontent">
|
||||
|
||||
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
|
||||
|
||||
<!--END TITLEAREA-->
|
||||
<!-- end header part -->
|
||||
|
@ -282,7 +282,7 @@ void CGLXManager::terminate()
|
||||
{
|
||||
if (libHandle)
|
||||
dlclose(libHandle);
|
||||
memset(&CurrentContext, 0, sizeof(CurrentContext));
|
||||
memset((void*)&CurrentContext, 0, sizeof(CurrentContext));
|
||||
}
|
||||
|
||||
bool CGLXManager::generateSurface()
|
||||
|
@ -637,8 +637,8 @@ bool CGUIEnvironment::postEventFromUser(const SEvent& event)
|
||||
|
||||
// For keys we handle the event before changing focus to give elements the chance for catching the TAB
|
||||
// Send focus changing event
|
||||
// CAREFUL when changing - there's an identical check in CGUIModalScreen::OnEvent
|
||||
if (FocusFlags & EFF_SET_ON_TAB &&
|
||||
event.EventType == EET_KEY_INPUT_EVENT &&
|
||||
event.KeyInput.PressedDown &&
|
||||
event.KeyInput.Key == KEY_TAB)
|
||||
{
|
||||
@ -894,11 +894,12 @@ IGUIWindow* CGUIEnvironment::addWindow(const core::rect<s32>& rectangle, bool mo
|
||||
|
||||
|
||||
//! adds a modal screen. The returned pointer must not be dropped.
|
||||
IGUIElement* CGUIEnvironment::addModalScreen(IGUIElement* parent)
|
||||
IGUIElement* CGUIEnvironment::addModalScreen(IGUIElement* parent, int blinkMode)
|
||||
{
|
||||
parent = parent ? parent : this;
|
||||
|
||||
IGUIElement *win = new CGUIModalScreen(this, parent, -1);
|
||||
CGUIModalScreen *win = new CGUIModalScreen(this, parent, -1);
|
||||
win->setBlinkMode(blinkMode);
|
||||
win->drop();
|
||||
|
||||
return win;
|
||||
|
@ -97,7 +97,7 @@ public:
|
||||
const wchar_t* text=0, IGUIElement* parent=0, s32 id=-1) _IRR_OVERRIDE_;
|
||||
|
||||
//! adds a modal screen. The returned pointer must not be dropped.
|
||||
virtual IGUIElement* addModalScreen(IGUIElement* parent) _IRR_OVERRIDE_;
|
||||
virtual IGUIElement* addModalScreen(IGUIElement* parent, int blinkMode) _IRR_OVERRIDE_;
|
||||
|
||||
//! Adds a message box.
|
||||
virtual IGUIWindow* addMessageBox(const wchar_t* caption, const wchar_t* text=0,
|
||||
|
@ -720,6 +720,7 @@ void CGUIListBox::serializeAttributes(io::IAttributes* out, io::SAttributeReadWr
|
||||
}
|
||||
}
|
||||
}
|
||||
out->addInt("Selected", Selected);
|
||||
}
|
||||
|
||||
|
||||
@ -759,6 +760,8 @@ void CGUIListBox::deserializeAttributes(io::IAttributes* in, io::SAttributeReadW
|
||||
}
|
||||
}
|
||||
}
|
||||
Selected = in->getAttributeAsInt("Selected", Selected);
|
||||
recalculateScrollPos();
|
||||
}
|
||||
|
||||
|
||||
|
@ -18,6 +18,7 @@ namespace gui
|
||||
//! constructor
|
||||
CGUIModalScreen::CGUIModalScreen(IGUIEnvironment* environment, IGUIElement* parent, s32 id)
|
||||
: IGUIElement(EGUIET_MODAL_SCREEN, environment, parent, id, core::recti(0, 0, parent->getAbsolutePosition().getWidth(), parent->getAbsolutePosition().getHeight()) ),
|
||||
BlinkMode(3),
|
||||
MouseDownTime(0)
|
||||
{
|
||||
#ifdef _DEBUG
|
||||
@ -90,7 +91,8 @@ bool CGUIModalScreen::OnEvent(const SEvent& event)
|
||||
{
|
||||
Environment->removeFocus(0); // can't setFocus otherwise at it still has focus here
|
||||
Environment->setFocus(event.GUIEvent.Element);
|
||||
MouseDownTime = os::Timer::getTime();
|
||||
if ( BlinkMode&1 )
|
||||
MouseDownTime = os::Timer::getTime();
|
||||
return true;
|
||||
}
|
||||
if ( !canTakeFocus(event.GUIEvent.Caller))
|
||||
@ -112,7 +114,7 @@ bool CGUIModalScreen::OnEvent(const SEvent& event)
|
||||
else
|
||||
Environment->setFocus(this);
|
||||
}
|
||||
else
|
||||
else if ( BlinkMode&1 )
|
||||
{
|
||||
MouseDownTime = os::Timer::getTime();
|
||||
}
|
||||
@ -130,10 +132,24 @@ bool CGUIModalScreen::OnEvent(const SEvent& event)
|
||||
}
|
||||
break;
|
||||
case EET_MOUSE_INPUT_EVENT:
|
||||
if (event.MouseInput.Event == EMIE_LMOUSE_PRESSED_DOWN)
|
||||
if (event.MouseInput.Event == EMIE_LMOUSE_PRESSED_DOWN && (BlinkMode & 2))
|
||||
{
|
||||
MouseDownTime = os::Timer::getTime();
|
||||
}
|
||||
break;
|
||||
case EET_KEY_INPUT_EVENT:
|
||||
// CAREFUL when changing - there's an identical check in CGUIEnvironment::postEventFromUser
|
||||
if (Environment->getFocusBehavior() & EFF_SET_ON_TAB &&
|
||||
event.KeyInput.PressedDown &&
|
||||
event.KeyInput.Key == KEY_TAB)
|
||||
{
|
||||
IGUIElement* next = Environment->getNextElement(event.KeyInput.Shift, event.KeyInput.Control);
|
||||
if ( next && isMyChild(next) )
|
||||
{
|
||||
// Pass on the TAB-key, otherwise focus-tabbing inside modal screens breaks
|
||||
return false;
|
||||
}
|
||||
}
|
||||
default:
|
||||
break;
|
||||
}
|
||||
@ -153,7 +169,7 @@ void CGUIModalScreen::draw()
|
||||
return;
|
||||
|
||||
u32 now = os::Timer::getTime();
|
||||
if (now - MouseDownTime < 300 && (now / 70)%2)
|
||||
if (BlinkMode && now - MouseDownTime < 300 && (now / 70)%2)
|
||||
{
|
||||
core::list<IGUIElement*>::Iterator it = Children.begin();
|
||||
core::rect<s32> r;
|
||||
@ -219,12 +235,16 @@ void CGUIModalScreen::updateAbsolutePosition()
|
||||
void CGUIModalScreen::serializeAttributes(io::IAttributes* out, io::SAttributeReadWriteOptions* options=0) const
|
||||
{
|
||||
IGUIElement::serializeAttributes(out,options);
|
||||
|
||||
out->addInt("BlinkMode", BlinkMode );
|
||||
}
|
||||
|
||||
//! Reads attributes of the element
|
||||
void CGUIModalScreen::deserializeAttributes(io::IAttributes* in, io::SAttributeReadWriteOptions* options=0)
|
||||
{
|
||||
IGUIElement::deserializeAttributes(in, options);
|
||||
|
||||
BlinkMode = in->getAttributeAsInt("BlinkMode", BlinkMode);
|
||||
}
|
||||
|
||||
|
||||
|
@ -52,11 +52,27 @@ namespace gui
|
||||
//! Reads attributes of the element
|
||||
virtual void deserializeAttributes(io::IAttributes* in, io::SAttributeReadWriteOptions* options) _IRR_OVERRIDE_;
|
||||
|
||||
//! Set when to blink.
|
||||
//! Bitset of following values (can be combined)
|
||||
//! 0 = never
|
||||
//! 1 = focus changes
|
||||
//! 2 = Left mouse button pressed down
|
||||
void setBlinkMode(u32 blink)
|
||||
{
|
||||
BlinkMode = blink;
|
||||
}
|
||||
|
||||
u32 getBlinkMode() const
|
||||
{
|
||||
return BlinkMode;
|
||||
}
|
||||
|
||||
protected:
|
||||
virtual bool canTakeFocus(IGUIElement* target) const;
|
||||
|
||||
private:
|
||||
|
||||
u32 BlinkMode;
|
||||
u32 MouseDownTime;
|
||||
};
|
||||
|
||||
|
@ -16,11 +16,6 @@ namespace irr
|
||||
namespace video
|
||||
{
|
||||
|
||||
#ifdef _IRR_COMPILE_WITH_LIBJPEG_
|
||||
// Static members
|
||||
io::path CImageLoaderJPG::Filename;
|
||||
#endif
|
||||
|
||||
//! constructor
|
||||
CImageLoaderJPG::CImageLoaderJPG()
|
||||
{
|
||||
@ -56,6 +51,9 @@ bool CImageLoaderJPG::isALoadableFileExtension(const io::path& filename) const
|
||||
|
||||
// for longjmp, to return to caller on a fatal error
|
||||
jmp_buf setjmp_buffer;
|
||||
|
||||
// for having access to the filename when printing the error messages
|
||||
core::stringc* filename;
|
||||
};
|
||||
|
||||
void CImageLoaderJPG::init_source (j_decompress_ptr cinfo)
|
||||
@ -113,7 +111,9 @@ void CImageLoaderJPG::output_message(j_common_ptr cinfo)
|
||||
c8 temp1[JMSG_LENGTH_MAX];
|
||||
(*cinfo->err->format_message)(cinfo, temp1);
|
||||
core::stringc errMsg("JPEG FATAL ERROR in ");
|
||||
errMsg += core::stringc(Filename);
|
||||
|
||||
irr_jpeg_error_mgr* myerr = (irr_jpeg_error_mgr*)cinfo->err;
|
||||
errMsg += *myerr->filename;
|
||||
os::Printer::log(errMsg.c_str(),temp1, ELL_ERROR);
|
||||
}
|
||||
#endif // _IRR_COMPILE_WITH_LIBJPEG_
|
||||
@ -144,7 +144,7 @@ IImage* CImageLoaderJPG::loadImage(io::IReadFile* file) const
|
||||
if (!file)
|
||||
return 0;
|
||||
|
||||
Filename = file->getFileName();
|
||||
core::stringc filename = file->getFileName();
|
||||
|
||||
u8 **rowPtr=0;
|
||||
u8* input = new u8[file->getSize()];
|
||||
@ -162,6 +162,7 @@ IImage* CImageLoaderJPG::loadImage(io::IReadFile* file) const
|
||||
cinfo.err = jpeg_std_error(&jerr.pub);
|
||||
cinfo.err->error_exit = error_exit;
|
||||
cinfo.err->output_message = output_message;
|
||||
jerr.filename = &filename;
|
||||
|
||||
// compatibility fudge:
|
||||
// we need to use setjmp/longjmp for error handling as gcc-linux
|
||||
|
@ -96,9 +96,6 @@ private:
|
||||
data has been read. Often a no-op. */
|
||||
static void term_source (j_decompress_ptr cinfo);
|
||||
|
||||
// Copy filename to have it around for error-messages
|
||||
static io::path Filename;
|
||||
|
||||
#endif // _IRR_COMPILE_WITH_LIBJPEG_
|
||||
};
|
||||
|
||||
|
@ -93,7 +93,7 @@ namespace irr
|
||||
//! Get the device type
|
||||
virtual E_DEVICE_TYPE getType() const _IRR_OVERRIDE_
|
||||
{
|
||||
return EIDT_CONSOLE;
|
||||
return EIDT_CONSOLE;
|
||||
}
|
||||
|
||||
void addPostPresentText(s16 X, s16 Y, const wchar_t *text);
|
||||
|
@ -150,7 +150,8 @@ CIrrDeviceLinux::CIrrDeviceLinux(const SIrrlichtCreationParameters& param)
|
||||
// create the window, only if we do not use the null device
|
||||
if (!createWindow())
|
||||
return;
|
||||
setResizable(param.WindowResizable);
|
||||
if (param.WindowResizable < 2 )
|
||||
setResizable(param.WindowResizable == 1 ? true : false);
|
||||
#ifdef _IRR_COMPILE_WITH_X11_
|
||||
createInputContext();
|
||||
#endif
|
||||
@ -438,12 +439,25 @@ bool CIrrDeviceLinux::createWindow()
|
||||
XWindow = (Window)CreationParams.WindowId;
|
||||
if (!CreationParams.IgnoreInput)
|
||||
{
|
||||
XCreateWindow(XDisplay,
|
||||
// Note: This might be further improved by using a InputOnly window instead of InputOutput.
|
||||
// I think then it should be possible to render into the given parent window instead of
|
||||
// creating a child-window.
|
||||
// That could also be a third option for IgnoreInput in the CreationParams.
|
||||
// But we need another window variable then and have to split input/output in
|
||||
// the rest of the device code.
|
||||
// Also... this does possibly leak.
|
||||
Window child_window = XCreateWindow(XDisplay,
|
||||
XWindow,
|
||||
0, 0, Width, Height, 0, VisualInfo->depth,
|
||||
InputOutput, VisualInfo->visual,
|
||||
CWBorderPixel | CWColormap | CWEventMask,
|
||||
&WndAttributes);
|
||||
|
||||
// do not forget to map new window
|
||||
XMapWindow(XDisplay, child_window);
|
||||
|
||||
// overwrite device window id
|
||||
XWindow = child_window;
|
||||
}
|
||||
XWindowAttributes wa;
|
||||
XGetWindowAttributes(XDisplay, XWindow, &wa);
|
||||
@ -2076,6 +2090,9 @@ CIrrDeviceLinux::CCursorControl::CCursorControl(CIrrDeviceLinux* dev, bool null)
|
||||
: Device(dev)
|
||||
#ifdef _IRR_COMPILE_WITH_X11_
|
||||
, PlatformBehavior(gui::ECPB_NONE), LastQuery(0)
|
||||
#ifdef _IRR_LINUX_X11_XINPUT2_
|
||||
, DeviceId(0)
|
||||
#endif
|
||||
#endif
|
||||
, IsVisible(true), Null(null), UseReferenceRect(false)
|
||||
, ActiveIcon(gui::ECI_NORMAL), ActiveIconStartTime(0)
|
||||
@ -2083,6 +2100,10 @@ CIrrDeviceLinux::CCursorControl::CCursorControl(CIrrDeviceLinux* dev, bool null)
|
||||
#ifdef _IRR_COMPILE_WITH_X11_
|
||||
if (!Null)
|
||||
{
|
||||
#ifdef _IRR_LINUX_X11_XINPUT2_
|
||||
XIGetClientPointer(Device->XDisplay, Device->XWindow, &DeviceId);
|
||||
#endif
|
||||
|
||||
XGCValues values;
|
||||
unsigned long valuemask = 0;
|
||||
|
||||
|
@ -28,6 +28,10 @@
|
||||
#endif
|
||||
#include <X11/keysym.h>
|
||||
|
||||
#ifdef _IRR_LINUX_X11_XINPUT2_
|
||||
#include <X11/extensions/XInput2.h>
|
||||
#endif
|
||||
|
||||
#else
|
||||
#define KeySym s32
|
||||
#endif
|
||||
@ -117,7 +121,7 @@ namespace irr
|
||||
//! Get the device type
|
||||
virtual E_DEVICE_TYPE getType() const _IRR_OVERRIDE_
|
||||
{
|
||||
return EIDT_X11;
|
||||
return EIDT_X11;
|
||||
}
|
||||
|
||||
#ifdef _IRR_COMPILE_WITH_X11_
|
||||
@ -211,22 +215,54 @@ namespace irr
|
||||
{
|
||||
if (UseReferenceRect)
|
||||
{
|
||||
XWarpPointer(Device->XDisplay,
|
||||
None,
|
||||
Device->XWindow, 0, 0,
|
||||
Device->Width,
|
||||
Device->Height,
|
||||
ReferenceRect.UpperLeftCorner.X + x,
|
||||
ReferenceRect.UpperLeftCorner.Y + y);
|
||||
|
||||
// NOTE: XIWarpPointer works when X11 has set a coordinate transformation matrix for the mouse unlike XWarpPointer
|
||||
// which runs into a bug mentioned here: https://gitlab.freedesktop.org/xorg/xserver/-/issues/600
|
||||
// So also workaround for Irrlicht bug #450
|
||||
#ifdef _IRR_LINUX_X11_XINPUT2_
|
||||
if ( DeviceId != 0)
|
||||
{
|
||||
XIWarpPointer(Device->XDisplay,
|
||||
DeviceId,
|
||||
None,
|
||||
Device->XWindow, 0, 0,
|
||||
Device->Width,
|
||||
Device->Height,
|
||||
ReferenceRect.UpperLeftCorner.X + x,
|
||||
ReferenceRect.UpperLeftCorner.Y + y);
|
||||
}
|
||||
else
|
||||
#endif
|
||||
{
|
||||
XWarpPointer(Device->XDisplay,
|
||||
None,
|
||||
Device->XWindow, 0, 0,
|
||||
Device->Width,
|
||||
Device->Height,
|
||||
ReferenceRect.UpperLeftCorner.X + x,
|
||||
ReferenceRect.UpperLeftCorner.Y + y);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
XWarpPointer(Device->XDisplay,
|
||||
None,
|
||||
Device->XWindow, 0, 0,
|
||||
Device->Width,
|
||||
Device->Height, x, y);
|
||||
#ifdef _IRR_LINUX_X11_XINPUT2_
|
||||
if ( DeviceId != 0)
|
||||
{
|
||||
XIWarpPointer(Device->XDisplay,
|
||||
DeviceId,
|
||||
None,
|
||||
Device->XWindow, 0, 0,
|
||||
Device->Width,
|
||||
Device->Height, x, y);
|
||||
}
|
||||
else
|
||||
#endif
|
||||
{
|
||||
XWarpPointer(Device->XDisplay,
|
||||
None,
|
||||
Device->XWindow, 0, 0,
|
||||
Device->Width,
|
||||
Device->Height, x, y);
|
||||
}
|
||||
}
|
||||
XFlush(Device->XDisplay);
|
||||
}
|
||||
@ -340,6 +376,10 @@ namespace irr
|
||||
u32 LastQuery;
|
||||
Cursor InvisCursor;
|
||||
|
||||
#ifdef _IRR_LINUX_X11_XINPUT2_
|
||||
int DeviceId;
|
||||
#endif
|
||||
|
||||
struct CursorFrameX11
|
||||
{
|
||||
CursorFrameX11() : IconHW(0) {}
|
||||
|
@ -187,7 +187,7 @@ CIrrDeviceSDL::CIrrDeviceSDL(const SIrrlichtCreationParameters& param)
|
||||
Screen((SDL_Surface*)param.WindowId), SDL_Flags(SDL_ANYFORMAT),
|
||||
MouseX(0), MouseY(0), MouseXRel(0), MouseYRel(0), MouseButtonStates(0),
|
||||
Width(param.WindowSize.Width), Height(param.WindowSize.Height),
|
||||
Resizable(param.WindowResizable), WindowMinimized(false)
|
||||
Resizable(param.WindowResizable == 1 ? true : false), WindowMinimized(false)
|
||||
{
|
||||
#ifdef _DEBUG
|
||||
setDebugName("CIrrDeviceSDL");
|
||||
|
@ -100,7 +100,7 @@ namespace irr
|
||||
//! Get the device type
|
||||
virtual E_DEVICE_TYPE getType() const _IRR_OVERRIDE_
|
||||
{
|
||||
return EIDT_SDL;
|
||||
return EIDT_SDL;
|
||||
}
|
||||
|
||||
//! Implementation of the linux cursor control
|
||||
|
@ -840,7 +840,7 @@ CIrrDeviceWin32::CIrrDeviceWin32(const SIrrlichtCreationParameters& params)
|
||||
clientSize.right = CreationParams.WindowSize.Width;
|
||||
clientSize.bottom = CreationParams.WindowSize.Height;
|
||||
|
||||
DWORD style = getWindowStyle(CreationParams.Fullscreen, CreationParams.WindowResizable);
|
||||
DWORD style = getWindowStyle(CreationParams.Fullscreen, CreationParams.WindowResizable > 0 ? true : false);
|
||||
AdjustWindowRect(&clientSize, style, FALSE);
|
||||
|
||||
const s32 realWidth = clientSize.right - clientSize.left;
|
||||
|
@ -103,7 +103,7 @@ namespace irr
|
||||
//! Get the device type
|
||||
virtual E_DEVICE_TYPE getType() const _IRR_OVERRIDE_
|
||||
{
|
||||
return EIDT_WIN32;
|
||||
return EIDT_WIN32;
|
||||
}
|
||||
|
||||
//! Compares to the last call of this function to return double and triple clicks.
|
||||
|
@ -31,22 +31,22 @@ namespace video
|
||||
~CNSOGLManager();
|
||||
|
||||
// Initialize
|
||||
bool initialize(const SIrrlichtCreationParameters& params, const SExposedVideoData& data);
|
||||
bool initialize(const SIrrlichtCreationParameters& params, const SExposedVideoData& data) _IRR_OVERRIDE_;
|
||||
|
||||
// Terminate
|
||||
void terminate();
|
||||
void terminate() _IRR_OVERRIDE_;
|
||||
|
||||
// Create surface.
|
||||
bool generateSurface();
|
||||
bool generateSurface() _IRR_OVERRIDE_;
|
||||
|
||||
// Destroy surface.
|
||||
void destroySurface();
|
||||
void destroySurface() _IRR_OVERRIDE_;
|
||||
|
||||
// Create context.
|
||||
bool generateContext();
|
||||
bool generateContext() _IRR_OVERRIDE_;
|
||||
|
||||
// Destroy EGL context.
|
||||
void destroyContext();
|
||||
void destroyContext() _IRR_OVERRIDE_;
|
||||
|
||||
//! Get current context
|
||||
const SExposedVideoData& getContext() const;
|
||||
@ -58,7 +58,7 @@ namespace video
|
||||
virtual void* getProcAddress(const std::string &procName) _IRR_OVERRIDE_;
|
||||
|
||||
// Swap buffers.
|
||||
bool swapBuffers();
|
||||
bool swapBuffers() _IRR_OVERRIDE_;
|
||||
|
||||
private:
|
||||
SIrrlichtCreationParameters Params;
|
||||
|
@ -190,7 +190,7 @@ CNullDriver::CNullDriver(io::IFileSystem* io, const core::dimension2d<u32>& scre
|
||||
|
||||
|
||||
// set ExposedData to 0
|
||||
memset(&ExposedData, 0, sizeof(ExposedData));
|
||||
memset((void*)&ExposedData, 0, sizeof(ExposedData));
|
||||
for (u32 i=0; i<video::EVDF_COUNT; ++i)
|
||||
FeatureEnabled[i]=true;
|
||||
|
||||
@ -869,8 +869,8 @@ void CNullDriver::draw2DImage(const video::ITexture* texture, const core::positi
|
||||
|
||||
draw2DImage(texture,destPos, core::rect<s32>(core::position2d<s32>(0,0),
|
||||
core::dimension2di(texture->getOriginalSize())),
|
||||
0,
|
||||
SColor(255,255,255,255),
|
||||
0,
|
||||
SColor(255,255,255,255),
|
||||
useAlphaChannelOfTexture
|
||||
);
|
||||
}
|
||||
@ -1605,7 +1605,9 @@ core::array<IImage*> CNullDriver::createImagesFromFile(io::IReadFile* file, E_TE
|
||||
{
|
||||
// dito
|
||||
file->seek(0);
|
||||
if (SurfaceLoader[i]->isALoadableFileFormat(file))
|
||||
if (SurfaceLoader[i]->isALoadableFileFormat(file)
|
||||
&& !SurfaceLoader[i]->isALoadableFileExtension(file->getFileName()) // extension was tried above already
|
||||
)
|
||||
{
|
||||
file->seek(0);
|
||||
imageArray = SurfaceLoader[i]->loadImages(file, type);
|
||||
@ -2765,9 +2767,9 @@ bool CNullDriver::needsTransparentRenderPass(const irr::video::SMaterial& materi
|
||||
// zwrite disabled and getWriteZBuffer calls this function.
|
||||
|
||||
video::IMaterialRenderer* rnd = getMaterialRenderer(material.MaterialType);
|
||||
// TODO: I suspect IMaterialRenderer::isTransparent also often could use SMaterial as parameter
|
||||
// TODO: I suspect IMaterialRenderer::isTransparent also often could use SMaterial as parameter
|
||||
// We could for example then get rid of IsTransparent function in SMaterial and move that to the software material renderer.
|
||||
if (rnd && rnd->isTransparent())
|
||||
if (rnd && rnd->isTransparent())
|
||||
return true;
|
||||
|
||||
return false;
|
||||
|
@ -358,11 +358,11 @@ const c8* COBJMeshFileLoader::readColor(const c8* bufPtr, video::SColor& color,
|
||||
c8 colStr[COLOR_BUFFER_LENGTH];
|
||||
|
||||
bufPtr = goAndCopyNextWord(colStr, bufPtr, COLOR_BUFFER_LENGTH, bufEnd);
|
||||
color.setRed((s32)(core::fast_atof(colStr) * 255.0f));
|
||||
color.setRed((u32)core::round32(core::fast_atof(colStr)*255.f));
|
||||
bufPtr = goAndCopyNextWord(colStr, bufPtr, COLOR_BUFFER_LENGTH, bufEnd);
|
||||
color.setGreen((s32)(core::fast_atof(colStr) * 255.0f));
|
||||
color.setGreen((u32)core::round32(core::fast_atof(colStr)*255.f));
|
||||
bufPtr = goAndCopyNextWord(colStr, bufPtr, COLOR_BUFFER_LENGTH, bufEnd);
|
||||
color.setBlue((s32)(core::fast_atof(colStr) * 255.0f));
|
||||
color.setBlue((u32)core::round32(core::fast_atof(colStr)*255.f));
|
||||
return bufPtr;
|
||||
}
|
||||
|
||||
|
@ -37,10 +37,10 @@ public:
|
||||
if (ColorAttachment > 0)
|
||||
Driver->irrGlGenFramebuffers(1, &BufferID);
|
||||
|
||||
AssignedTexture.set_used(static_cast<u32>(ColorAttachment));
|
||||
AssignedTextures.set_used(static_cast<u32>(ColorAttachment));
|
||||
|
||||
for (u32 i = 0; i < AssignedTexture.size(); ++i)
|
||||
AssignedTexture[i] = GL_NONE;
|
||||
for (u32 i = 0; i < AssignedTextures.size(); ++i)
|
||||
AssignedTextures[i] = GL_NONE;
|
||||
}
|
||||
|
||||
virtual ~COpenGLCoreRenderTarget()
|
||||
@ -48,28 +48,28 @@ public:
|
||||
if (ColorAttachment > 0 && BufferID != 0)
|
||||
Driver->irrGlDeleteFramebuffers(1, &BufferID);
|
||||
|
||||
for (u32 i = 0; i < Texture.size(); ++i)
|
||||
for (u32 i = 0; i < Textures.size(); ++i)
|
||||
{
|
||||
if (Texture[i])
|
||||
Texture[i]->drop();
|
||||
if (Textures[i])
|
||||
Textures[i]->drop();
|
||||
}
|
||||
|
||||
if (DepthStencil)
|
||||
DepthStencil->drop();
|
||||
}
|
||||
|
||||
virtual void setTexture(const core::array<ITexture*>& textures, ITexture* depthStencil, const core::array<E_CUBE_SURFACE>& cubeSurfaces) _IRR_OVERRIDE_
|
||||
virtual void setTextures(ITexture* const * textures, u32 numTextures, ITexture* depthStencil, const E_CUBE_SURFACE* cubeSurfaces, u32 numCubeSurfaces) _IRR_OVERRIDE_
|
||||
{
|
||||
bool needSizeUpdate = false;
|
||||
|
||||
// Set color attachments.
|
||||
if ((Texture != textures) || (CubeSurfaces != cubeSurfaces))
|
||||
if (!Textures.equals(textures, numTextures) || !CubeSurfaces.equals(cubeSurfaces, numCubeSurfaces))
|
||||
{
|
||||
needSizeUpdate = true;
|
||||
|
||||
core::array<ITexture*> prevTextures(Texture);
|
||||
core::array<ITexture*> prevTextures(Textures);
|
||||
|
||||
if (textures.size() > static_cast<u32>(ColorAttachment))
|
||||
if (numTextures > static_cast<u32>(ColorAttachment))
|
||||
{
|
||||
core::stringc message = "This GPU supports up to ";
|
||||
message += static_cast<u32>(ColorAttachment);
|
||||
@ -78,9 +78,9 @@ public:
|
||||
os::Printer::log(message.c_str(), ELL_WARNING);
|
||||
}
|
||||
|
||||
Texture.set_used(core::min_(textures.size(), static_cast<u32>(ColorAttachment)));
|
||||
Textures.set_used(core::min_(numTextures, static_cast<u32>(ColorAttachment)));
|
||||
|
||||
for (u32 i = 0; i < Texture.size(); ++i)
|
||||
for (u32 i = 0; i < Textures.size(); ++i)
|
||||
{
|
||||
TOpenGLTexture* currentTexture = (textures[i] && textures[i]->getDriverType() == DriverType) ? static_cast<TOpenGLTexture*>(textures[i]) : 0;
|
||||
|
||||
@ -93,12 +93,12 @@ public:
|
||||
|
||||
if (textureID != 0)
|
||||
{
|
||||
Texture[i] = textures[i];
|
||||
Texture[i]->grab();
|
||||
Textures[i] = textures[i];
|
||||
Textures[i]->grab();
|
||||
}
|
||||
else
|
||||
{
|
||||
Texture[i] = 0;
|
||||
Textures[i] = 0;
|
||||
}
|
||||
}
|
||||
|
||||
@ -111,9 +111,9 @@ public:
|
||||
RequestTextureUpdate = true;
|
||||
}
|
||||
|
||||
if (CubeSurfaces != cubeSurfaces)
|
||||
if (!CubeSurfaces.equals(cubeSurfaces, numCubeSurfaces))
|
||||
{
|
||||
CubeSurfaces = cubeSurfaces;
|
||||
CubeSurfaces.set_data(cubeSurfaces, numCubeSurfaces);
|
||||
RequestTextureUpdate = true;
|
||||
}
|
||||
|
||||
@ -183,26 +183,26 @@ public:
|
||||
{
|
||||
// Set new color textures.
|
||||
|
||||
const u32 textureSize = core::min_(Texture.size(), AssignedTexture.size());
|
||||
const u32 textureSize = core::min_(Textures.size(), AssignedTextures.size());
|
||||
|
||||
for (u32 i = 0; i < textureSize; ++i)
|
||||
{
|
||||
TOpenGLTexture* currentTexture = static_cast<TOpenGLTexture*>(Texture[i]);
|
||||
TOpenGLTexture* currentTexture = static_cast<TOpenGLTexture*>(Textures[i]);
|
||||
GLuint textureID = currentTexture ? currentTexture->getOpenGLTextureName() : 0;
|
||||
|
||||
if (textureID != 0)
|
||||
{
|
||||
AssignedTexture[i] = GL_COLOR_ATTACHMENT0 + i;
|
||||
AssignedTextures[i] = GL_COLOR_ATTACHMENT0 + i;
|
||||
GLenum textarget = currentTexture->getType() == ETT_2D ? GL_TEXTURE_2D : GL_TEXTURE_CUBE_MAP_POSITIVE_X + (int)CubeSurfaces[i];
|
||||
Driver->irrGlFramebufferTexture2D(GL_FRAMEBUFFER, AssignedTexture[i], textarget, textureID, 0);
|
||||
Driver->irrGlFramebufferTexture2D(GL_FRAMEBUFFER, AssignedTextures[i], textarget, textureID, 0);
|
||||
#ifdef _DEBUG
|
||||
Driver->testGLError(__LINE__);
|
||||
#endif
|
||||
}
|
||||
else if (AssignedTexture[i] != GL_NONE)
|
||||
else if (AssignedTextures[i] != GL_NONE)
|
||||
{
|
||||
AssignedTexture[i] = GL_NONE;
|
||||
Driver->irrGlFramebufferTexture2D(GL_FRAMEBUFFER, AssignedTexture[i], GL_TEXTURE_2D, 0, 0);
|
||||
AssignedTextures[i] = GL_NONE;
|
||||
Driver->irrGlFramebufferTexture2D(GL_FRAMEBUFFER, AssignedTextures[i], GL_TEXTURE_2D, 0, 0);
|
||||
|
||||
os::Printer::log("Error: Could not set render target.", ELL_ERROR);
|
||||
}
|
||||
@ -210,12 +210,12 @@ public:
|
||||
|
||||
// Reset other render target channels.
|
||||
|
||||
for (u32 i = textureSize; i < AssignedTexture.size(); ++i)
|
||||
for (u32 i = textureSize; i < AssignedTextures.size(); ++i)
|
||||
{
|
||||
if (AssignedTexture[i] != GL_NONE)
|
||||
if (AssignedTextures[i] != GL_NONE)
|
||||
{
|
||||
Driver->irrGlFramebufferTexture2D(GL_FRAMEBUFFER, AssignedTexture[i], GL_TEXTURE_2D, 0, 0);
|
||||
AssignedTexture[i] = GL_NONE;
|
||||
Driver->irrGlFramebufferTexture2D(GL_FRAMEBUFFER, AssignedTextures[i], GL_TEXTURE_2D, 0, 0);
|
||||
AssignedTextures[i] = GL_NONE;
|
||||
}
|
||||
}
|
||||
|
||||
@ -285,7 +285,7 @@ public:
|
||||
|
||||
if (ColorAttachment > 0 && BufferID != 0)
|
||||
{
|
||||
const u32 textureSize = Texture.size();
|
||||
const u32 textureSize = Textures.size();
|
||||
|
||||
if (textureSize == 0)
|
||||
Driver->irrGlDrawBuffer(GL_NONE);
|
||||
@ -293,9 +293,9 @@ public:
|
||||
Driver->irrGlDrawBuffer(GL_COLOR_ATTACHMENT0);
|
||||
else
|
||||
{
|
||||
const u32 bufferCount = core::min_(MultipleRenderTarget, core::min_(textureSize, AssignedTexture.size()));
|
||||
const u32 bufferCount = core::min_(MultipleRenderTarget, core::min_(textureSize, AssignedTextures.size()));
|
||||
|
||||
Driver->irrGlDrawBuffers(bufferCount, AssignedTexture.pointer());
|
||||
Driver->irrGlDrawBuffers(bufferCount, AssignedTextures.pointer());
|
||||
}
|
||||
|
||||
#ifdef _DEBUG
|
||||
@ -322,10 +322,10 @@ public:
|
||||
|
||||
ITexture* getTexture() const
|
||||
{
|
||||
for (u32 i = 0; i < Texture.size(); ++i)
|
||||
for (u32 i = 0; i < Textures.size(); ++i)
|
||||
{
|
||||
if (Texture[i])
|
||||
return Texture[i];
|
||||
if (Textures[i])
|
||||
return Textures[i];
|
||||
}
|
||||
|
||||
return 0;
|
||||
@ -372,7 +372,7 @@ protected:
|
||||
return false;
|
||||
}
|
||||
|
||||
core::array<GLenum> AssignedTexture;
|
||||
core::array<GLenum> AssignedTextures;
|
||||
bool AssignedDepth;
|
||||
bool AssignedStencil;
|
||||
|
||||
|
@ -22,7 +22,7 @@ COpenGLExtensionHandler::COpenGLExtensionHandler() :
|
||||
MaxAnisotropy(1), MaxUserClipPlanes(0), MaxAuxBuffers(0), MaxIndices(65535),
|
||||
MaxTextureSize(1), MaxGeometryVerticesOut(0),
|
||||
MaxTextureLODBias(0.f), Version(0), ShaderLanguageVersion(0),
|
||||
OcclusionQuerySupport(false)
|
||||
OcclusionQuerySupport(false), IsAtiRadeonX(false)
|
||||
#ifdef _IRR_OPENGL_USE_EXTPOINTER_
|
||||
,pGlActiveTexture(0)
|
||||
,pGlActiveTextureARB(0), pGlClientActiveTextureARB(0),
|
||||
@ -387,6 +387,12 @@ void COpenGLExtensionHandler::initExtensions(bool stencilBuffer)
|
||||
TextureCompressionExtension = FeatureAvailable[IRR_ARB_texture_compression];
|
||||
StencilBuffer=stencilBuffer;
|
||||
|
||||
const char* renderer = (const char*)glGetString(GL_RENDERER);
|
||||
if ( renderer )
|
||||
{
|
||||
IsAtiRadeonX = (strncmp(renderer, "ATI RADEON X", 12) == 0) || (strncmp(renderer, "ATI MOBILITY RADEON X", 21) == 0);
|
||||
}
|
||||
|
||||
#ifdef _IRR_OPENGL_USE_EXTPOINTER_
|
||||
#ifdef _IRR_WINDOWS_API_
|
||||
#define IRR_OGL_LOAD_EXTENSION(x) wglGetProcAddress(reinterpret_cast<const char*>(x))
|
||||
@ -827,7 +833,7 @@ bool COpenGLExtensionHandler::queryFeature(E_VIDEO_DRIVER_FEATURE feature) const
|
||||
case EVDF_MIP_MAP:
|
||||
return true;
|
||||
case EVDF_MIP_MAP_AUTO_UPDATE:
|
||||
return FeatureAvailable[IRR_SGIS_generate_mipmap] || FeatureAvailable[IRR_EXT_framebuffer_object] || FeatureAvailable[IRR_ARB_framebuffer_object];
|
||||
return !IsAtiRadeonX && (FeatureAvailable[IRR_SGIS_generate_mipmap] || FeatureAvailable[IRR_EXT_framebuffer_object] || FeatureAvailable[IRR_ARB_framebuffer_object]);
|
||||
case EVDF_STENCIL_BUFFER:
|
||||
return StencilBuffer;
|
||||
case EVDF_VERTEX_SHADER_1_1:
|
||||
|
@ -1052,6 +1052,9 @@ class COpenGLExtensionHandler
|
||||
|
||||
bool OcclusionQuerySupport;
|
||||
|
||||
// Info needed for workarounds.
|
||||
bool IsAtiRadeonX;
|
||||
|
||||
//! Workaround until direct state access with framebuffers is stable enough in drivers
|
||||
// https://devtalk.nvidia.com/default/topic/1030494/opengl/bug-amp-amp-spec-violation-checknamedframebufferstatus-returns-gl_framebuffer_incomplete_dimensions_ext-under-gl-4-5-core/
|
||||
// https://stackoverflow.com/questions/51304706/problems-with-attaching-textures-of-different-sizes-to-fbo
|
||||
|
@ -277,7 +277,7 @@ void CSoftwareTexture2::regenerateMipMapLevels(void* data)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
#if 0
|
||||
//visualize mipmap
|
||||
for (i = 1; i < 0 && i < array_size(MipMap); ++i)
|
||||
{
|
||||
@ -327,7 +327,7 @@ void CSoftwareTexture2::regenerateMipMapLevels(void* data)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
calcDerivative();
|
||||
}
|
||||
|
||||
@ -385,30 +385,30 @@ CSoftwareRenderTarget2::CSoftwareRenderTarget2(CBurningVideoDriver* driver) : Dr
|
||||
{
|
||||
DriverType = EDT_BURNINGSVIDEO;
|
||||
|
||||
Texture.set_used(1);
|
||||
Texture[0] = 0;
|
||||
Textures.set_used(1);
|
||||
Textures[0] = 0;
|
||||
}
|
||||
|
||||
CSoftwareRenderTarget2::~CSoftwareRenderTarget2()
|
||||
{
|
||||
if (Texture[0])
|
||||
Texture[0]->drop();
|
||||
if (Textures[0])
|
||||
Textures[0]->drop();
|
||||
}
|
||||
|
||||
void CSoftwareRenderTarget2::setTexture(const core::array<ITexture*>& texture, ITexture* depthStencil, const core::array<E_CUBE_SURFACE>& cubeSurfaces)
|
||||
void CSoftwareRenderTarget2::setTextures(ITexture* const * textures, u32 numTextures, ITexture* depthStencil, const E_CUBE_SURFACE* cubeSurfaces, u32 numCubeSurfaces)
|
||||
{
|
||||
if (Texture != texture)
|
||||
if (!Textures.equals(textures, numTextures))
|
||||
{
|
||||
ITexture* prevTexture = Texture[0];
|
||||
ITexture* prevTexture = Textures[0];
|
||||
|
||||
bool textureDetected = false;
|
||||
|
||||
for (u32 i = 0; i < texture.size(); ++i)
|
||||
for (u32 i = 0; i < numTextures; ++i)
|
||||
{
|
||||
if (texture[i] && texture[i]->getDriverType() == EDT_BURNINGSVIDEO)
|
||||
if (textures[i] && textures[i]->getDriverType() == EDT_BURNINGSVIDEO)
|
||||
{
|
||||
Texture[0] = texture[i];
|
||||
Texture[0]->grab();
|
||||
Textures[0] = textures[i];
|
||||
Textures[0]->grab();
|
||||
textureDetected = true;
|
||||
|
||||
break;
|
||||
@ -419,7 +419,7 @@ void CSoftwareRenderTarget2::setTexture(const core::array<ITexture*>& texture, I
|
||||
prevTexture->drop();
|
||||
|
||||
if (!textureDetected)
|
||||
Texture[0] = 0;
|
||||
Textures[0] = 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -166,7 +166,7 @@ public:
|
||||
CSoftwareRenderTarget2(CBurningVideoDriver* driver);
|
||||
virtual ~CSoftwareRenderTarget2();
|
||||
|
||||
virtual void setTexture(const core::array<ITexture*>& texture, ITexture* depthStencil, const core::array<E_CUBE_SURFACE>& cubeSurfaces) _IRR_OVERRIDE_;
|
||||
virtual void setTextures(ITexture* const * textures, u32 numTextures, ITexture* depthStencil, const E_CUBE_SURFACE* cubeSurfaces, u32 numCubeSurfaces) _IRR_OVERRIDE_;
|
||||
|
||||
#if defined(PATCH_SUPERTUX_8_0_1_with_1_9_0)
|
||||
E_DRIVER_TYPE DriverType;
|
||||
|
@ -25,6 +25,7 @@ namespace irr
|
||||
EPID_SM_RENDER_SHADOWS,
|
||||
EPID_SM_RENDER_TRANSPARENT,
|
||||
EPID_SM_RENDER_EFFECT,
|
||||
EPID_SM_RENDER_GUI_NODES,
|
||||
EPID_SM_REGISTER,
|
||||
|
||||
//! octrees
|
||||
|
@ -164,7 +164,7 @@ typedef union {
|
||||
unsigned int u;
|
||||
struct { unsigned int frac:23; unsigned exp:8; unsigned int sign:1; } fields;
|
||||
struct { unsigned int frac_exp:31; } abs;
|
||||
} ieee754 PACK_STRUCT;
|
||||
} PACK_STRUCT ieee754;
|
||||
|
||||
// Default alignment
|
||||
#include "irrunpack.h"
|
||||
|
@ -14,7 +14,6 @@
|
||||
#include "IGUIFont.h"
|
||||
#include "IGUIStaticText.h"
|
||||
#include "IAttributes.h"
|
||||
#include "CGUIEditWorkspace.h"
|
||||
|
||||
namespace irr
|
||||
{
|
||||
|
@ -6,7 +6,6 @@
|
||||
#include "IAttributes.h"
|
||||
#include "IGUIFont.h"
|
||||
#include "IGUIScrollBar.h"
|
||||
#include "CGUIEditWorkspace.h"
|
||||
#include "CGUIAttribute.h"
|
||||
#include "CGUIStringAttribute.h"
|
||||
|
||||
|
@ -598,9 +598,14 @@ bool CGUIEditWorkspace::OnEvent(const SEvent &e)
|
||||
}
|
||||
// load a gui file
|
||||
case EGET_FILE_SELECTED:
|
||||
{
|
||||
dialog = (IGUIFileOpenDialog*)e.GUIEvent.Caller;
|
||||
Environment->loadGUI(core::stringc(dialog->getFileName()).c_str());
|
||||
core::stringc guiFilename(core::stringc(dialog->getFileName()).c_str());
|
||||
clearParentElements();
|
||||
Environment->loadGUI(guiFilename, Parent);
|
||||
EditorWindow->updateTree();
|
||||
break;
|
||||
}
|
||||
|
||||
case EGET_MENU_ITEM_SELECTED:
|
||||
{
|
||||
@ -614,18 +619,7 @@ bool CGUIEditWorkspace::OnEvent(const SEvent &e)
|
||||
|
||||
//! file commands
|
||||
case EGUIEDMC_FILE_NEW:
|
||||
// clear all elements belonging to our parent
|
||||
setSelectedElement(0);
|
||||
MouseOverElement = 0;
|
||||
el = Parent;
|
||||
grab();
|
||||
// remove all children
|
||||
while(Children.end() != el->getChildren().begin())
|
||||
el->removeChild(*(el->getChildren().begin()));
|
||||
// attach to parent again
|
||||
el->addChild(this);
|
||||
drop();
|
||||
|
||||
clearParentElements();
|
||||
break;
|
||||
case EGUIEDMC_FILE_LOAD:
|
||||
Environment->addFileOpenDialog(L"Please select a GUI file to open", false, this);
|
||||
@ -843,10 +837,31 @@ void CGUIEditWorkspace::removeChild(IGUIElement* child)
|
||||
{
|
||||
IGUIElement::removeChild(child);
|
||||
|
||||
// TODO: Can anyone find out why the workspace removes itself when it has no more children
|
||||
// and document it here?
|
||||
if (Children.empty())
|
||||
remove();
|
||||
}
|
||||
|
||||
void CGUIEditWorkspace::clearParentElements()
|
||||
{
|
||||
setSelectedElement(0);
|
||||
MouseOverElement = 0;
|
||||
|
||||
IGUIElement * el = Parent;
|
||||
grab();
|
||||
|
||||
if ( el->isMyChild(Environment->getFocus()) )
|
||||
Environment->setFocus(0);
|
||||
|
||||
while (!el->getChildren().empty())
|
||||
{
|
||||
el->removeChild(*(el->getChildren().begin()));
|
||||
}
|
||||
|
||||
el->addChild(this);
|
||||
drop();
|
||||
}
|
||||
|
||||
void CGUIEditWorkspace::updateAbsolutePosition()
|
||||
{
|
||||
|
@ -46,6 +46,9 @@ namespace gui
|
||||
//! Removes a child.
|
||||
virtual void removeChild(IGUIElement* child);
|
||||
|
||||
//! Remove all gui elements from parent except this one
|
||||
virtual void clearParentElements();
|
||||
|
||||
//! draws the element and its children
|
||||
virtual void draw();
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user