Commit Graph

344 Commits

Author SHA1 Message Date
cutealien
9025fcc377 Add IMeshBuffer::getColor functions
Lazy access function - same as for all other members of S3DVertex (getPosition/getNormal/getTCoords).
Not sure why color was missing, maybe got added later?
Would probably be better to have a getS3DVertex function instead which would cover them all, but it's only some slow (but nice) helper function anyway.

git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@6415 dfc29bdd-3216-0410-991c-e03cc46cb475
2022-08-19 12:33:56 +00:00
cutealien
7d2dbdd0c8 Unify & improve log messages
Lots of places where coders did not realize our Printer::log with hint adds a ": " string between message and hint
Which caused uglier messages in a few places (added documentation for that, maybe helps?)
Some added info in a few places
Some whitespace unification
Some spelling unification


git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@6414 dfc29bdd-3216-0410-991c-e03cc46cb475
2022-06-30 16:23:48 +00:00
engineer_apple
30834665ff Example 27.PostProcessing turn off depth buffer again
BurningVideo Shader emulation pp_opengl.frag/vert frag_BFT_385_0xa0194718
 - currently only implemented with depth-buffer disabled inside CTRTextureGouraudNoZ2
 - special case of not power of 2 RTT TextureSampler without mipmap and no bilinear filter


git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@6413 dfc29bdd-3216-0410-991c-e03cc46cb475
2022-06-25 07:24:55 +00:00
cutealien
17c7a1bd6e CGUIContextMenu no longer marks EMIE_MOUSE_MOVED as handled
This got in the way of allowing to move a camera with right-mouse-button while having a context menu.
Hard to tell which way is "more" correct as this break of behavior probably can also mess up some situations.
There also would be 3rd option of only catching the event when highlighting happens.
Anyway - usually if this should be caught it should be caught for all ui elements and people will check focused or hovered.

git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@6412 dfc29bdd-3216-0410-991c-e03cc46cb475
2022-06-23 13:25:55 +00:00
cutealien
f2896fae5a Fix some comments in example 28
git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@6411 dfc29bdd-3216-0410-991c-e03cc46cb475
2022-06-21 18:50:45 +00:00
cutealien
2dc5d89967 Make example 27 run with burnings again.
Sorry, last change removed a bit too much.

git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@6410 dfc29bdd-3216-0410-991c-e03cc46cb475
2022-06-21 18:28:13 +00:00
cutealien
501185e9cc Fix checkDataSizeLimit test in png loader.
I thought BitDepth was per pixel back then, but it's per channel. So limit could be broken.

git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@6409 dfc29bdd-3216-0410-991c-e03cc46cb475
2022-06-21 18:19:00 +00:00
cutealien
338af5c0ea Simplify example 27 slightly.
Also use tab instead of spaces (as usual in Irrlicht)


git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@6408 dfc29bdd-3216-0410-991c-e03cc46cb475
2022-06-20 19:57:35 +00:00
cutealien
d70d96031b Show number polygons in example 26
Just useful to understand what's going on.
Also removing the _CRT_SECURE_NO_WARNINGS as I don't get warnings my VS versions and other examples don't do that (so maybe that was fixed otherwise?)

git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@6407 dfc29bdd-3216-0410-991c-e03cc46cb475
2022-06-16 14:26:53 +00:00
cutealien
8dbeba57cd Fix camera render when it wasn't animated. Tiny improvement for fps camera animator. Add documentation.
Cameras can render even when they are not in the scenemanager or onAnimate didn't get called for example because they are their parent are invisible.
So let's be safe and add another call to updateAbsolutePosition(). Some cost, but usually we don't have that many rendering cameras, so shouldn't matter (if it ever matters I suppose we could override OnAnimate and add a flag if it _was_ animated since last render call. Maybe that's even useful in general for SceneNodes?).
Similar CSceneNodeAnimatorCameraFPS was using getAbsolutePosition which was only updated after animators, so it was one frame behind.
And documented ICameraSceneNode functions a bit. Especially updateMatrices is a bit of a confusing name unfortunately.

git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@6406 dfc29bdd-3216-0410-991c-e03cc46cb475
2022-06-16 13:59:58 +00:00
cutealien
94e84b1686 Prevent crash when creating CCameraSceneNode while rendertarget has height 0
git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@6405 dfc29bdd-3216-0410-991c-e03cc46cb475
2022-05-30 20:13:28 +00:00
cutealien
4450b532c2 Amendment to [r6389] Change all CColorConverter functions to work with u32 instead of s32 for sizes
Missed it as that part is only use by OGL_ES branch.


git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@6403 dfc29bdd-3216-0410-991c-e03cc46cb475
2022-05-15 15:51:55 +00:00
cutealien
5d27ca38a7 Minor const changes.
Also kicked out "Use constexpr for constants" warning in VS analyser ruleset (we haven't switched to c++11 yet)

git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@6402 dfc29bdd-3216-0410-991c-e03cc46cb475
2022-05-15 13:43:32 +00:00
cutealien
f9e5ef76bd IVideoDriver::getOcclusionQueryResult works now with const node pointer.
git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@6401 dfc29bdd-3216-0410-991c-e03cc46cb475
2022-05-15 11:51:42 +00:00
cutealien
ea0f2555ed type in changes.txt
git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@6400 dfc29bdd-3216-0410-991c-e03cc46cb475
2022-05-14 18:54:21 +00:00
cutealien
06415994ce Partly revert previous commit. Works only for linear search functions, binary_search changes were wrong.
Sorry, didn't think it through. Seemed to work at first, but works only if sort() ended up creating the same sorting as is used then for search.
While often the case, this is obviously not guaranteed. And can't do sort per type easily (this works with flags which remember if sorting had been done).


git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@6399 dfc29bdd-3216-0410-991c-e03cc46cb475
2022-05-14 18:53:28 +00:00
cutealien
0f7eb1f6e1 core::array search functions can now work with other template types.
Previously search functions only worked when called with the same type as the array elements had.
Which forced users sometimes to create dummy objects to be able to search for elements by another type.
linear_search and linear_reverse_search now work with any type for which <T>::operator== is implemented.
Similar binary_search now works when <T>::operator< is implemented in both directions (T < E and E < T).
Note: It might be possible to further improve binary_search so only one operator< is needed (I think STL managed that somehow).
So if someone likes a challenge - have a go at it! :-)

git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@6398 dfc29bdd-3216-0410-991c-e03cc46cb475
2022-05-14 18:27:35 +00:00
cutealien
ca4bbcb71f Fix compiling on MinGW (broke in [r6394])
git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@6397 dfc29bdd-3216-0410-991c-e03cc46cb475
2022-05-14 15:10:22 +00:00
cutealien
66dcb86e5f Make SCollisionHit::TriangleSelector and SCollisionTriangleRange::Selector both const.
Avoids lots of const casts and there shouldn't be a good reason to have those non-const.

git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@6396 dfc29bdd-3216-0410-991c-e03cc46cb475
2022-05-14 14:29:56 +00:00
cutealien
bd7e357f77 Add checks for valid skin pointer in CGUIMenu
Found with VS analyser

git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@6395 dfc29bdd-3216-0410-991c-e03cc46cb475
2022-05-14 14:03:30 +00:00
cutealien
3eee408cac Avoid potential call to GetProcAddress with 0 for HMODULE
Found by VS code analyser

git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@6394 dfc29bdd-3216-0410-991c-e03cc46cb475
2022-05-13 15:03:27 +00:00
cutealien
c0f5b839a0 Avoid potential number overflows.
Found by VS code analyser

git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@6393 dfc29bdd-3216-0410-991c-e03cc46cb475
2022-05-13 14:56:22 +00:00
cutealien
d90d1ae93b Make some local variables in public headers const
Shutting up code analyser.

git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@6392 dfc29bdd-3216-0410-991c-e03cc46cb475
2022-05-13 14:42:13 +00:00
cutealien
cc9edcb973 CIrrMeshFileLoader::readMeshBuffer avoid accessing pointer before it's not 0 check.
git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@6391 dfc29bdd-3216-0410-991c-e03cc46cb475
2022-05-13 14:20:41 +00:00
cutealien
dd7020c27b Cleanup: Adding break
Just safer in case we add more cases. Also shuts up code analyser.

git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@6390 dfc29bdd-3216-0410-991c-e03cc46cb475
2022-05-13 12:31:00 +00:00
cutealien
10f0e39e46 Change all CColorConverter functions to work with u32 instead of s32 for sizes.
Nothing good could come out of putting negative values into any of those functions.
And they are used a lot in image loaders which often can be tricked into passing large enough values to make those functions be called with negative numbers.


git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@6389 dfc29bdd-3216-0410-991c-e03cc46cb475
2022-05-08 15:40:38 +00:00
engineer_apple
f64732cd7e CBillboardTextSceneNode null-pointer check on missing Texture
git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@6388 dfc29bdd-3216-0410-991c-e03cc46cb475
2022-05-08 14:43:24 +00:00
cutealien
cfde879801 Add checks for sane image sizes in some image loaders (bmp, jpg, tga, png)
Thanks @sfan5 for the original patch (got modified a bit): dbd39120e7
Forum: https://irrlicht.sourceforge.io/forum/viewtopic.php?f=2&t=52819&p=306518
Those are the common formats, but rest of image loaders should also call this some day.

git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@6387 dfc29bdd-3216-0410-991c-e03cc46cb475
2022-05-08 14:42:59 +00:00
cutealien
72b1522083 Add IImage::checkDataSizeLimit and make IImage getDataSizeFromFormat return size_t
It's to allow image loader to check for sane limits for image sizes.
Idea came from this patch from sfan5 for Minetest: dbd39120e7
Thought solution is a bit different. 
Image loader checks not yet added (will come soon).
Also note that limit is to s32. While u32 might work mostly it will run into some troubles with color converter for now (which maybe could be changes). Also 2GB ought to be enough for anybody, right?

git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@6386 dfc29bdd-3216-0410-991c-e03cc46cb475
2022-05-06 19:47:38 +00:00
cutealien
76d013d9d6 Fix crash with large jpg files.
Based somewhat on a patch in Minetest from sfan5 594de99153
There might be more problems which may be the reason they checked for other values in Minetest, but don't have more info for now and so far this works.
Forum: https://irrlicht.sourceforge.io/forum/viewtopic.php?f=2&t=52819&p=306518

git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@6385 dfc29bdd-3216-0410-991c-e03cc46cb475
2022-05-06 16:00:26 +00:00
cutealien
156463da4f Simplify/unify IGUIListBox interface.
Only needs one addItem function when using default parameters for icon.
Add default parameters for setIcon, insertIcon so they can be used easier with pure text.


git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@6384 dfc29bdd-3216-0410-991c-e03cc46cb475
2022-05-05 15:19:35 +00:00
cutealien
7b6115bcf1 Update VS and c::b project files for burningvideo 0.54
git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@6381 dfc29bdd-3216-0410-991c-e03cc46cb475
2022-05-05 13:07:45 +00:00
engineer_apple
83851413a6 clang warnings (OnSetMaterial multiple inheritance IMaterialRendererServices,IShaderConstantSetCallBack)
git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@6378 dfc29bdd-3216-0410-991c-e03cc46cb475
2022-05-04 10:29:41 +00:00
engineer_apple
f0efd5857d undo remove warnings
git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@6377 dfc29bdd-3216-0410-991c-e03cc46cb475
2022-05-03 23:00:00 +00:00
engineer_apple
cf12a37521 vs2019 projectfiles
git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@6376 dfc29bdd-3216-0410-991c-e03cc46cb475
2022-05-03 21:26:24 +00:00
engineer_apple
7e3c645451 vs2019 projectfiles
git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@6375 dfc29bdd-3216-0410-991c-e03cc46cb475
2022-05-03 21:01:14 +00:00
engineer_apple
8cab15b8db vs2019 projectfiles
git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@6374 dfc29bdd-3216-0410-991c-e03cc46cb475
2022-05-03 20:57:39 +00:00
engineer_apple
62db29bfd4 remove warnings
git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@6373 dfc29bdd-3216-0410-991c-e03cc46cb475
2022-05-03 20:49:27 +00:00
engineer_apple
5bd1c1d68b vs2019 projectfiles
git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@6372 dfc29bdd-3216-0410-991c-e03cc46cb475
2022-05-03 20:48:57 +00:00
engineer_apple
21e2569e5b burningvideo 0.54
removed CTRGouraudAlpha2.cpp
added CTRParallaxMap.cpp

git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@6371 dfc29bdd-3216-0410-991c-e03cc46cb475
2022-05-03 20:47:32 +00:00
cutealien
9db39e8534 Separate GLX window from X11 window.
Thanks @numberZero and sfan5 for patches:
c4503eaf17
57ff34b1ed
Forum: https://irrlicht.sourceforge.io/forum/viewtopic.php?p=306549#p306549


git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@6370 dfc29bdd-3216-0410-991c-e03cc46cb475
2022-05-02 16:17:03 +00:00
cutealien
296824e8b6 COSOperator::getSystemMemory now returns some value on OSX. Also it's kb not bytes.
Before the value was checked, but not put into the return variables.
Header update to show that information in kb not bytes (on all systems, was just documented wrong)
Some cleanup of code.


git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@6369 dfc29bdd-3216-0410-991c-e03cc46cb475
2022-05-02 15:19:37 +00:00
engineer_apple
d19d6939d4 GUIText
a) SpriteBank. error check on non existing textureNumber. Seen in broken Fonts. unified getFrameNr
b) CBillboardTextSceneNode. use getOriginalSize

git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@6368 dfc29bdd-3216-0410-991c-e03cc46cb475
2022-05-01 09:50:32 +00:00
engineer_apple
61bc7d3a22 MacOS SoftwareDriver Window and warnings
Xcode 12.4 MacOS 10.15.7

git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@6367 dfc29bdd-3216-0410-991c-e03cc46cb475
2022-05-01 02:43:12 +00:00
engineer_apple
3285a0147a a) debug Camera Matrices. enable with _IRR_COMPILE_WITH_90_DEGREE_CAMERA.
- allow ICameraSceneNode to accept any values and correct in buildCameraLookAtMatrixLH with normalize_camera_direction.
 if disabled defaults to the current v1.9 normalize
b) add initial Rotation to MayaCamera Constructor default 0,0
c) switchToMayaCamera in Examples. Clones FPSCamera default disabled


git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@6366 dfc29bdd-3216-0410-991c-e03cc46cb475
2022-05-01 01:11:45 +00:00
engineer_apple
e08e37fc0f burning v0.53 g++ warning remove
git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@6365 dfc29bdd-3216-0410-991c-e03cc46cb475
2022-05-01 00:59:58 +00:00
engineer_apple
4fe6a16165 burning v0.53
git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@6364 dfc29bdd-3216-0410-991c-e03cc46cb475
2022-04-30 22:57:17 +00:00
cutealien
2d5673a1d4 Switch SMaterial to default copy constructor and assignment operator
It's not 100% identical to what we had as I only copied up to MATERIAL_MAX_TEXTURES_USED before, but I think that was rather premature optimiziation.
(the cost for the extra textures is really in other places, don't think the copy here ever matters).
Was a bit based on Mintest patch, but they messed it up: 4931b34625
(because they didn't notice the difference between MATERIAL_MAX_TEXTURES_USED and MATERIAL_MAX_TEXTURES).

git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@6363 dfc29bdd-3216-0410-991c-e03cc46cb475
2022-04-26 19:22:45 +00:00
cutealien
77d5df9b1b Remove virtual destructor for IShader
I had somewhat rashly removed operator = in [r6280]
But since c++11 implicit defined copy assignment operator is deprecated when a user-declared destructor exists.
Still... alternative would be adding copy assignment operator but neither that nor the virtual destructor seem to be needed.
So rather removind destructor which seems to add an unnecessary virtual function table for it (seems to be just used like a POD throughout the code)

git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@6362 dfc29bdd-3216-0410-991c-e03cc46cb475
2022-04-26 18:40:44 +00:00
cutealien
af5a6802fe Remove virtual destructors ~SMD3QuaternionTag and ~SMD3QuaternionTagList
See no reason for them. And would have to put back operator= and copy constructor otherwise (realized creating those is now deprecated when having a destructor defined).

git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@6361 dfc29bdd-3216-0410-991c-e03cc46cb475
2022-04-26 18:19:30 +00:00