Commit Graph

7 Commits

Author SHA1 Message Date
cutealien b3e228ef43 Make more internals for CVertexBuffer and CIndexBuffer public
I don't see the point of giving access to Indices and Vertices if they are of a class type which is private.
Now it's at least possible (with a few casts) to access the freaking array having the data which is often all we want.


git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@6585 dfc29bdd-3216-0410-991c-e03cc46cb475
2024-01-24 11:44:49 +00:00
cutealien 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()

On a side-note - same setType bug still in CVertexBuffer, but a bit harder to fix there. So will be an new patch.

git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@6357 dfc29bdd-3216-0410-991c-e03cc46cb475
2022-04-22 16:28:29 +00:00
cutealien a2bb74096d IVertexBuffer and IIndexBuffer reallocate functions now pass through canShrink parameter to array
git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@6341 dfc29bdd-3216-0410-991c-e03cc46cb475
2022-04-19 15:43:39 +00:00
cutealien 49616fd438 CIndexBuffer no longer re-allocates stuff when type doesn't change
git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@6338 dfc29bdd-3216-0410-991c-e03cc46cb475
2022-04-19 12:18:15 +00:00
cutealien 0c6385cb92 Replace public header guards to avoid using indentifiers reserved by c++
Usually something like __IRR_SOME_GUARD_INCLUDED__ replaced by IRR_SOME_GUARD_INCLUDED.
Removing underscores at the end wasn't necessary, but more symmetric (probably the reason they got added there as well).
While this touches every header it shouldn't affect users (I hope).

Also a few whitespace changes to unify whitespace usage a bit.
And a bunch of spelling fixes in comments.

git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@6252 dfc29bdd-3216-0410-991c-e03cc46cb475
2021-08-27 15:03:34 +00:00
cutealien ffd7b63af0 API BREAKER: Replacing defines in irrTypes.h which are conflicting with c++ reserved identifier rules.
C++ has undefined behavior for identifiers starting with __ or with _ followed by an uppercase letter.
We still have many more (in IrrCompileConfig.h and in all header-guards), will likely replace those later as well.
As a workaround for users which might use irrlicht defines in their code, I've added the header irrLegacyDefines.h
Including that allows to continue using old defines for a while - or make it easier to have code which compiles 
with old and new Irrlicht library versions.


git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@6251 dfc29bdd-3216-0410-991c-e03cc46cb475
2021-08-27 12:55:10 +00:00
cutealien 8310a3fbad Avoid warning and make local variable lower-case.
git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@6000 dfc29bdd-3216-0410-991c-e03cc46cb475
2019-12-12 16:32:41 +00:00