Commit Graph

  • 24594ce226
    Add missing overrides to fix compiler warnings ndren 2022-04-30 15:53:53 +01:00
  • ba0396e93d
    Replace HWBufferMap with a list and back pointers (#99) paradust7 2022-04-29 03:04:22 -07:00
  • c9b66c8c58 Sort out two -Wdeprecated-copy warnings sfan5 2022-04-28 21:16:10 +02:00
  • 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). cutealien 2022-04-26 19:22:45 +00:00
  • 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) cutealien 2022-04-26 18:40:44 +00:00
  • 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). cutealien 2022-04-26 18:19:30 +00:00
  • 2fa3b0d1ee Fix CVertexBuffer::setType when switching no empty vertex arrays. IVertexBuffer interface changes. Previously vertex buffer did some invalid casts to references which could cause it to copy whatever was in memory into the vertex-arrays. Generally it worked up to S3DVertex - but switch from another type to S3DVertex2TCoords or S3DVertexTangents caused it to be filled with whatever was in memory behind it. Setter functions in IVertexBuffer have now overloads for all known vertex types. Also adding const version of IVertexBuffer::getData. And some warnings in comments about using the array functions (if even we mess it up...) Also de-deprecate IIndexBuffer::pointer() again. I don't like having 2 functions for same stuff, but in the end it doesn't really hurt keeping it around. cutealien 2022-04-25 16:19:20 +00:00
  • f77ae3aaf5 S3DVertex initialize color always. It's derived classes now both accept const S3DVertex& constructor. color intitialization has some cost, but we initialized all other values already (vectors are always set to 0). Don't think it's a good idea to have one value around which is random. S3DVertex2TCoords(S3DVertex& o) to S3DVertex2TCoords(const S3DVertex& o) simply because it makes more sense S3DVertexTangents(const S3DVertex& o) added because I'll need it later (and no idea why only S3DVertex2TCoords got one of those before). cutealien 2022-04-25 14:24:43 +00:00
  • 532675ffa4 Fix string deserialization in CGUITable. Use now getAttributeAsStringW instead of getAttributeAsString. Thanks @chronologicaldot for report and patch: https://irrlicht.sourceforge.io/forum/viewtopic.php?f=7&t=52821 cutealien 2022-04-25 09:48:26 +00:00
  • 92564435f4 Fix bad cast in CIndexBuffer. Modify IIndexBuffer interface for cleanup and safety. CIndexBuffer::setType could end up casting a temporary u16 variable to u32& (reference!). Probably never noticed as this tended to mostly works (guess next byte on stack often 0?). To prevent this from happening again I modifed IIndexBuffer::push_back to work with copies instead of references. While breaking the interface anyway I also deprecated pointer() which is just identical to getData() anyway. I get the idea of staying similar to core::array interface, but it's just confusing (and not same due to lack of types anyway). Also added a const version for getData() cutealien 2022-04-22 16:28:29 +00:00
  • 8a9e82fed9 Bit cleanup of IDynamicMeshBuffer. No point in repeating pure virtual functions (maybe wasn't meant to be derived from IMeshBuffer at first?) cutealien 2022-04-22 14:22:41 +00:00
  • 5163d74e3f Remove trivial copy constructors and assignment operators Thanks @sfan5 for patch for Mintest: 4931b34625 Forum: https://irrlicht.sourceforge.io/forum/viewtopic.php?f=2&t=52819 Note - patch is not applied exaclty yet. SMaterial and matrix4 still missing (might be applied later). Also patch was based on older Irrlicht and we removed a few already earlier this year (around r6280). cutealien 2022-04-21 22:24:14 +00:00
  • df17e52a05 CXMeshFileLoader: initialize normals (and other S3DVertex values ) to 0 when loading Thanks @sfan5 for patch in Minetest: 0500a7798b Changed it slightly as more value were not initialized than just normals. Forum: https://irrlicht.sourceforge.io/forum/viewtopic.php?f=2&t=52819&p=306518#p306518 cutealien 2022-04-21 21:11:48 +00:00
  • 8fcc572845 CB3DMeshFileLoader: abort if offsets point outside of file Thanks @sfan5 for patch in Mintest: 195759100f Forum: https://irrlicht.sourceforge.io/forum/viewtopic.php?f=2&t=52819&p=306518 cutealien 2022-04-21 20:50:15 +00:00
  • 0317f678fb Fix bounds checking in CMemoryWriteFile::seek Thanks @sfan5 for patch: a3d848ff8b Note I also modified the bounds checks for CMemoryReadFile once more to unify it with how Minetest fixed it. Due to some strange coincidence I had run into that bug yesterday for CMemoryReadFile and fixed it without realizing a fix was also part of a bunch of patches I had gotten 3 days earlier in the forum: https://irrlicht.sourceforge.io/forum/viewtopic.php?f=2&t=52819&p=306518#p306518 cutealien 2022-04-21 20:39:31 +00:00
  • a48b3a8d00 Fix not properly resizing on macOS due to incorrect window size Thanks @torleif, Jordach and sfan5 for patch in Minetest: fa7a5dbdef Forum: https://irrlicht.sourceforge.io/forum/viewtopic.php?f=2&t=52819&p=306518#p306518 Note: Not tested by me, as usual with OSX patches I just apply it as it seems to make sense. cutealien 2022-04-21 20:21:56 +00:00
  • 4d8d638ce2 Avoid warning cutealien 2022-04-20 22:16:33 +00:00
  • 439667b369 Speed up stl format loading, especially with text format. Loading whole file now in memory (unless it's already a memory file). And avoiding lots of memory allocations otherwise by buffering token string in class object. Was a bit unusable before for large files (several minute loading times now down to a second)- cutealien 2022-04-20 22:09:03 +00:00
  • 9504b3da21 Prevent CMemoryFile to seek to a point before the start. cutealien 2022-04-20 21:57:25 +00:00
  • 3f2f98d7bd stl mesh writer can now write 32 bit meshbuffers. cutealien 2022-04-20 18:31:03 +00:00
  • 28e092673f b3d writer can now write 32-bit meshbuffers. Still can't read it though - reader needs SSkinMeshBuffer which only supports 16 bit so far (changes in loader are just spelling fixes in comments) cutealien 2022-04-20 17:56:40 +00:00
  • 8cd7e46506 Add non-const version of IVertexBuffer::operator[] Yeah, setValue is not enough and if getLast() works then this should work as well (when users are very careful...) cutealien 2022-04-20 11:03:23 +00:00
  • 57bcc52ca1 Add IVertexBuffer::setValue. Add comments. Same as in IIndexBuffer. Needed as replacement for non const operator[] which can't be done for this interface (as type is dynamic). cutealien 2022-04-20 10:38:26 +00:00
  • dd36699ad2 Set default for MeshLoader IndexTypeHint to EITH_OPTIMAL. Did some tests and the overhead speed cost on loading and rendering where both not really measurable even in a pretty huge scene. While some Irrlicht parts might still have a problem with 32-bit meshes (octree for example, also some meshmanipulator functions), it's probably still less of a problem than having broken meshes and just a nicer default. Also the troubling parts in Irrlicht can be improved over time. cutealien 2022-04-19 21:44:50 +00:00
  • 3ce2f0c0dd stl meshloader can now load 32 bit buffers (with corresponding hint) Thanks @Foaly for the patch (https://irrlicht.sourceforge.io/forum/viewtopic.php?f=9&t=51441) Applied with some minor changes. Also mesh-type in that loader now set to EAMT_STATIC (was EAMT_OBJ before, probably some copy-pasting going on). cutealien 2022-04-19 21:32:11 +00:00
  • a2bb74096d IVertexBuffer and IIndexBuffer reallocate functions now pass through canShrink parameter to array cutealien 2022-04-19 15:43:39 +00:00
  • 24f2a1e9ab Rename IMeshLoader::setPreferredIndexType to setIndexTypeHint and give it a new enum. Giving the loader it's own enum allowed me to add more options. EITH_OPTIMAL which reduces buffers back to 16-bit if they don't need 32-bit. Using that in obj loader. Also 32-bit meshes with EMT_PARALLAX_MAP_SOLID material should now work in obj loader (untested as I got no test-case) cutealien 2022-04-19 13:10:16 +00:00
  • d484711f2e CVertexBuffer no longer re-allocates stuff when type doesn't change cutealien 2022-04-19 12:21:44 +00:00
  • 49616fd438 CIndexBuffer no longer re-allocates stuff when type doesn't change cutealien 2022-04-19 12:18:15 +00:00
  • 2d63fdba3d Merging r6288 through r6336 from trunk to ogl-es branch cutealien 2022-04-15 18:51:09 +00:00
  • fc1e2c3b91 Rename some internal/unused draw2DImage function in COpenGLDriver to draw2DImageQuad to avoid warnings. Also added a bit documentation about what it's purpose seems to be (hope I got it right...). cutealien 2022-04-15 18:36:56 +00:00
  • c5b349ddb0 Add IMeshBufffer::clone for buffer copies, use it in CMeshManipulator::createMeshCopy CMeshManipulator::createMeshCopy creates new meshes which have copies of the actual meshbuffers instead of copying everything into SMeshBuffers (which didn't support 32 bit or any of the other special features). cutealien 2022-04-14 16:54:06 +00:00
  • 8447d3f531 obj writer can now write 32 bit buffers cutealien 2022-04-14 14:39:31 +00:00
  • c58afe8038 IMeshLoader can now set hints to prefer 16/32 bit buffers. Obj loader can now load 32 bit buffers. - IMeshLoader::setPreferredIndexType and getPreferredIndexType allow setting hints for the loaders if users prefer 16 or 32 bit meshbuffers. Loaders are free to ignore those hints (all but .obj will do that for now). - obj meshloader loads now 32-bit buffers when setPreferredIndexType is set to EIT_32BIT. NOTE: It's 16 bit meshes use now also an IDynamicMeshbuffer instead of an SMeshBuffer. That will break the code of people who accessed meshbuffer before by casting to SMeshBuffer* And might even be somewhat slower (lot's of virtual functions...), but shouldn't really matter and can maybe be a bit improved. Sorry about that, I considered keeping SMeshBuffer for 16-bit (still considering it), but it would add some overhead in code and I don't think it's worth that. If there are any complains I'll maybe consider it again. cutealien 2022-04-14 14:03:39 +00:00
  • 456bf86e66 Add missing IRR_OVERRIDE in some functions. cutealien 2022-04-12 21:58:35 +00:00
  • f9c85f380d Adding comments. cutealien 2022-04-12 16:04:56 +00:00
  • 71e9798d2a Add IMeshBuffer::getType Allows to find out which class a meshbuffer has. I used the same kind of style as ISceneNode::getType. So using four CC codes and virtual functions (instead of type variable). cutealien 2022-04-11 14:36:49 +00:00
  • 64fc9113fc Split CNullDriver::checkImage into 2 functions to avoid some memory allocations in addTexture Avoid creating dummy arrays when we work with non array images. Just a minor speed improvement. cutealien 2022-04-06 20:20:36 +00:00
  • 2ddd6f5355 typo engineer_apple 2022-04-04 16:37:55 +00:00
  • 3dc5f8fd9f Replace more getSize() with getOriginalSize() calls in tests. Textures involved had all power of two sizes anyway, so no real difference in this case, just a bit cleaner. cutealien 2022-03-30 21:52:26 +00:00
  • 3aac180dc7 Print out colorformat when screenshot test fails cutealien 2022-03-30 16:54:46 +00:00
  • 5785b73d47 Add documentation that sourceRect of draw2dImage is based on the OriginalSize cutealien 2022-03-30 10:49:13 +00:00
  • 8e2e2886a9 for using correct subimage tex-coordinates in the gui texture->getOriginalSize has to be used engineer_apple 2022-03-30 08:11:58 +00:00
  • ddb2028231 Add another screenshot test Drawing the screenshot itself before taking final result to see if the problem is in the render or the screenshot Note: Test-images for software-drivers show some other problems there which this test wasn't about. cutealien 2022-03-29 20:24:24 +00:00
  • aa839d45a1 Stop linking to libs which the tests Makefile does not seem to need Tests seem to work fine without -Xext and -Xcursor so kicking those out for now. cutealien 2022-03-28 22:11:26 +00:00
  • 044fe29f3d Slow down switching drivers in orthoCam test. Add 2 missing test-files to c::b project file. cutealien 2022-03-28 19:52:00 +00:00
  • 71d952acfc Add version 130 requirement to cubeMapReflection.frag Thanks @juozas for reporting the bug: https://irrlicht.sourceforge.io/forum/viewtopic.php?f=7&t=13869&start=390 cutealien 2022-03-27 19:27:19 +00:00
  • da77810fb5 Comment fixes in example 25 cutealien 2022-03-25 18:25:33 +00:00
  • f0c890d3ff Minor improvements and cleanup for example 24.CursorControl - ESC now also makes cursor visible again (probably first key users press in panic usually) - Bunch of spelling fixes - Let all words in UI elements start with upper-case cutealien 2022-03-25 17:54:28 +00:00
  • 60538c3646 Fix comment. (Did I have a stroke when I was typing the old one?) cutealien 2022-03-24 22:24:13 +00:00
  • f013a95a0e Improve UI behavior in resizing in example 22.MaterialViewer Also a bit better defaults for sizes and positions of nodes&camera cutealien 2022-03-24 21:32:12 +00:00
  • 3f13323e60 Allow switching between cube/sphere in example 22.MaterialViewer cutealien 2022-03-24 21:14:37 +00:00
  • 669ad7860a Add new cube mesh type ECMT_1BUF_24VTX_NP. CubeSceneNodes can now use different cube mesh types. 1 Meshbuffer with 24 vertices, so each side has it's own vertices. Normals perpendicular to the cube-sides. CubeSceneNode accepts now a ECUBE_MESH_TYPE CubeSceneNode::clone now also clones rotation and scale (not sure why it didn't do that before - hope there was no reason, but can't think of any). ISceneManager::addCubeSceneNode accepts now a ECUBE_MESH_TYPE and passes it through. Example 22.MaterialViewer using new cube type. Also a few more beauty fixes there. cutealien 2022-03-22 22:08:33 +00:00
  • f61b8614ab Cleanup example 22.MaterialViewer Using default light values which work a bit better with cube. But really needs another cube-type (which Irrlicht has not yet, needs single material with 24 vertices) as a cube with vertex normals which average connected sides is horrible with vertex-lighting (the problem is that the light get's behind the plane formed by the vertex-normal this way which is super confusing). Will probably add another cube-type soon. cutealien 2022-03-20 19:09:40 +00:00
  • 73247f4a21 Make UI in example 22.MaterialViewer a bit nicer. Less black on grey text. Prevent controlling light and ui-elements same time. Bit more compact code in a few places. cutealien 2022-03-19 16:07:38 +00:00
  • 8254c0848c Minor cleanup and comment fixes in example 21 Mostly spelling stuff. Only real code change is that Irrlicht has by now a function to fill images, so no more extra code for that needed. cutealien 2022-03-17 20:12:40 +00:00
  • 3035e27e67 Remove unused variable in example 19 Added that one accidentally in my last commit (leftover from a failed experiment) cutealien 2022-03-17 19:16:28 +00:00
  • 713018cae1 Minor update for example 19.MouseAndJoystick. Don't move the mouse anymore when the mouse hasn't moved. This was sometimes confusing because events are only caught inside the window (at least on Windows), which lead to the node moving seemingly randomly when the mouse was outside. Also added a few more comments to mention CursorControl as an alternative. cutealien 2022-03-16 20:59:43 +00:00
  • e50adc3066 Add tiny UI to SplitScreen example and some minor cleanup. Just to show that GUI can be used print usable keys on screen. Also ESC can be used now to quit. cutealien 2022-03-15 19:31:04 +00:00
  • d31b7aa261 Minor comment changes in example 16 cutealien 2022-03-14 17:59:47 +00:00
  • 530ddbf32f line2d::intersectWith now using f64 instead of f32 internally Avoid losing precision when working with line2d<f64> cutealien 2022-03-14 15:11:05 +00:00
  • 709cbe9df6 Avoid some more warnings when working with CMatrix4<f64> cutealien 2022-03-10 12:51:10 +00:00
  • c5fd5bc4cd Avoid warnings when working with CMatrix4<f64> cutealien 2022-03-10 12:24:03 +00:00
  • 8b1d0db8e2 AutomatedTest: improve and run under macOS CI too sfan5 2022-03-09 22:43:35 +01:00
  • e469c54f76 Fix COSOperator::getSystemMemory sfan5 2022-03-09 22:39:25 +01:00
  • c20d3d08b6 Cleanup code & documentation of Example 14 a bit. Note: Turns out we never got rendering into 2 OpenGL Windows same time working. Not going to look into this for now as it's not a new bug (never seems to have worked). If anyone has more information (like maybe it's not possible?) be nice and tell us in the forum. cutealien 2022-03-09 18:26:23 +00:00
  • 3ad07543be Add IGUIImage::flip to allow flipping/mirroring images. cutealien 2022-03-08 18:44:23 +00:00
  • df908ef4ea Get rid of various old compiler and platform checks sfan5 2022-02-26 11:38:43 +01:00
  • 01586f584a Delete more old files sfan5 2022-02-26 11:23:23 +01:00
  • 95af6d7c08 Get rid of all sprintf calls sfan5 2022-02-26 11:18:19 +01:00
  • 00dd274510 Fix uninitialized variable in previous commit sfan5 2022-02-26 12:09:18 +01:00
  • d59bcdbd07 Create OpenGL context using CreateContextAttribsARB sfan5 2022-02-20 23:18:17 +01:00
  • 09b8837ef9 Fix SDL2 include paths sfan5 2022-02-14 18:26:59 +01:00
  • 3da5987f4b IVideoDriver::setMaterialRendererName now using u32 for index like other similar functions Other functions like getMaterialRendererName got switched to u32 in the past. I can see no reason why this one was left out, so changing it to be same as the rest. cutealien 2022-02-09 19:28:45 +00:00
  • 4fb1c55ec5 IBillboardSceneNode got functions to access meshbuffers. So uv-coordinates can now be modified directly (previously only possible via texture matrix). cutealien 2022-02-08 21:00:12 +00:00
  • 7fb36849c7 vector3d scalar operator/ and operator/= no longer multiply by the inverse but use the expected division. That was a bad case of premature optimization. Multiplication is indeed faster, but when working with floats this can introduce some rather unexpected inaccuracies. Like x/x suddenly no longer being 1.0 (something guaranteed by division). If someone really needs this back, then please add some new function which makes it clear we don't just have a typical division here. cutealien 2022-02-03 14:47:41 +00:00
  • 8c0ee7d9ab Avoid some warnings from static code analysis. cutealien 2022-01-22 15:54:43 +00:00
  • 684293f527 Prefer static_cast to reinterpret_cast where possible. Just safer. Could probably do in a lot more places... another time. cutealien 2022-01-08 18:22:20 +00:00
  • 1b8be72ccb de-deprecate clearZBuffer Lets just keep this one around. Easy to use, downward compatible and generally works as expected. cutealien 2021-10-13 10:12:04 +00:00
  • 19b003a840 IBillboardSceneNode got functions to access meshbuffers. So uv-coordinates can now be modified directly (previously only possible via texture matrix). cutealien 2022-02-08 21:00:12 +00:00
  • d3132e0731 Update MinGW CI setup to match MT's sfan5 2022-02-04 21:08:37 +01:00
  • e5f69157db Bump revision sfan5 2022-02-03 21:50:14 +01:00
  • 57f518737d vector3d scalar operator/ and operator/= no longer multiply by the inverse but use the expected division. That was a bad case of premature optimization. Multiplication is indeed faster, but when working with floats this can introduce some rather unexpected inaccuracies. Like x/x suddenly no longer being 1.0 (something guaranteed by division). If someone really needs this back, then please add some new function which makes it clear we don't just have a typical division here. cutealien 2022-02-03 14:47:41 +00:00
  • fa2a7dc236 Gracefully handle lack of bundle on macOS sfan5 2022-01-31 20:48:00 +01:00
  • 7d1dc8b2d5 Get rid of ancient workaround sfan5 2022-01-22 21:00:54 +01:00
  • 42c0b17435 Relax test a bit. Minor example cleanup. Invisible difference, probably some mip-mapping pixel. Getting rid of some unnecessary global in example 14 cutealien 2022-01-22 16:42:12 +00:00
  • 0fb6891267 Avoid some warnings from static code analysis. cutealien 2022-01-22 15:54:43 +00:00
  • 53db262bd2
    Update CIrrDeviceSDL to support SDL2 (#85) 1.9.0mt4 Emmanuel Hansen 2022-01-16 11:16:15 +00:00
  • 195759100f CB3DMeshFileLoader: abort if offsets point outside of file sfan5 2022-01-15 16:05:01 +01:00
  • 62cf8296b1 Bugfix: XML reader no longer drops last character in strings after certain character replacments Due an off-by-one error it went wrong where there a special character replacement for the second-last character going on. So something like "&lt;X" became "<" instead of "<X". cutealien 2022-01-11 14:45:08 +00:00
  • 31f5da289f Remove CPPFLAG -I/usr/X11R6/include in all example Makefiles None uses X11 directly, this is only needed in the Library itself. Also this was even added on all platforms while many don't even have X11. Thanks @Isomorphix noticing something off about that once (a long time ago...): https://irrlicht.sourceforge.io/forum/viewtopic.php?f=1&t=49033 cutealien 2022-01-09 15:50:41 +00:00
  • 1dbab53e5a Prefer static_cast to reinterpret_cast where possible. Just safer. Could probably do in a lot more places... another time. cutealien 2022-01-08 18:22:20 +00:00
  • cfb27d9a74 Add some error checking in COSOperator::copyToClipboard GlobalAlloc and GlobalLock can return NULL cutealien 2022-01-08 17:36:20 +00:00
  • 9e27a6d4bf Avoid allocating more than 16k on stack in OCT loader. Also avoid potential heap overwrites in there. Sadly I have no examples for OCT files and it doesn't seem like a very common format as I couldn't even find any examples online. So just assuming my changes work. cutealien 2022-01-08 17:30:06 +00:00
  • 98aed6ba67 utf8ToWchar and wcharToUtf8 work with sizeof checks instead of defines now to call correct conversion Tiny speed hit, but old solution caused warnings. And it was not very safe by assuming all non _WIN32 platforms would use 32 bit sizes for wchar_t. cutealien 2022-01-08 15:19:46 +00:00
  • c2ff824550 Define out unused functions in dmf loader to avoid warnings. I don't know enough about DeleD from Delgine to fix this. But keeping the functions defined out as long as they don't get in the way. Also I'm a bit suspicious about the license... for use in Irrlicht core only under zlib license? That's not really zlib license then :-( cutealien 2022-01-07 17:24:38 +00:00
  • ed693fddca Avoid some warnings. gcc does not like mixing enums and numbers cutealien 2022-01-07 16:47:56 +00:00
  • 67469c8899 Merging r6275 through r6286 from trunk to ogl-es branch - Fixing warnings - Updating bzip2 and zlib libraries cutealien 2022-01-07 16:30:25 +00:00
  • 3e7a4666d5 Merging r6283 through r6284 from branch releases/1.8 to trunk - Updating to zlib 1.2.11 cutealien 2022-01-07 16:23:03 +00:00
  • 30b78dab9b Merging r6274 through r6281 from branch releases/1.8 to trunk. - Updates bzip2 to 1.0.8 (which sadly didn't reduce the amount of compile warnings, but let's hope it still improves something) cutealien 2022-01-07 15:45:58 +00:00