[fixed] there is a error in class of dimension2d

You discovered a bug in the engine, and you are sure that it is not a problem of your code? Just post it in here. Please read the bug posting guidelines first.
Post Reply
idisc
Posts: 5
Joined: Wed Dec 10, 2008 7:38 am

[fixed] there is a error in class of dimension2d

Post by idisc »

in irrlicht 1.5 i found a error in class of dimension2d

Code: Select all

//! Add two dimensions
dimension2d<T>& operator+=(const dimension2d<T>& other)
{
	Width *= other.Width;
	Height *= other.Height;
	return *this;
}
it should be :

Code: Select all

//! Add two dimensions
dimension2d<T>& operator+=(const dimension2d<T>& other)
{
	Width += other.Width;
	Height += other.Height;
	return *this;
}
[/quote]
rogerborg
Admin
Posts: 3590
Joined: Mon Oct 09, 2006 9:36 am
Location: Scotland - gonnae no slag aff mah Engleesh
Contact:

Post by rogerborg »

Oops. OK, I guess that one's a no brainer. Thanks for the report!

Should be fixed on the trunk in SVN 1984. Also, operator -= was missing, and operator== was using == rather than core::equals(). That's prompted the observation that a lot of the core classes use direct == checks, which is possibly a Bad Thing.
Please upload candidate patches to the tracker.
Need help now? IRC to #irrlicht on irc.freenode.net
How To Ask Questions The Smart Way
DtD
Posts: 264
Joined: Mon Aug 11, 2008 7:05 am
Location: Kansas
Contact:

Post by DtD »

Wow...lol how long has that been there I wonder...

~DtD
vitek
Bug Slayer
Posts: 3919
Joined: Mon Jan 16, 2006 10:52 am
Location: Corvallis, OR

Post by vitek »

Since revision 1753, which was committed on Nov 14, 2008. So just over a six weeks.

That said, it would be really nice if committers would fully document the changes they make in the changelog (the message that is provided when committing changes) so that people can tell what changes were made without having to look through every change and compare diffs.

Travis
DtD
Posts: 264
Joined: Mon Aug 11, 2008 7:05 am
Location: Kansas
Contact:

Post by DtD »

Ah, ok so not too terribly old.

~DtD
BlindSide
Admin
Posts: 2821
Joined: Thu Dec 08, 2005 9:09 am
Location: NZ!

Post by BlindSide »

This wouldn't happen if you just scrap dimension2d and position2d and stick with vector2d. You can say what you want about abstract programming principles but the costs for maintaining these classes and the lack of interchangeability (Anyone else tired of doing position2di(dimension.Width, dimension.Height)?) far outweigh the benefits.

On a related note some explicit casts would be handy. :P
ShadowMapping for Irrlicht!: Get it here
Need help? Come on the IRC!: #irrlicht on irc://irc.freenode.net
Ion Dune
Posts: 453
Joined: Mon Nov 12, 2007 8:29 pm
Location: California, USA
Contact:

Post by Ion Dune »

BlindSide wrote:This wouldn't happen if you just scrap dimension2d and position2d and stick with vector2d. You can say what you want about abstract programming principles but the costs for maintaining these classes and the lack of interchangeability (Anyone else tired of doing position2di(dimension.Width, dimension.Height)?) far outweigh the benefits.

On a related note some explicit casts would be handy. :P
@&#*ing ditto.
twilight17
Posts: 362
Joined: Sun Dec 16, 2007 9:25 pm

Post by twilight17 »

Agree
Post this userbar I made on other websites to show your support for Irrlicht!
Image
http://img147.imageshack.us/img147/1261 ... wernq4.png
Dorth
Posts: 931
Joined: Sat May 26, 2007 11:03 pm

Post by Dorth »

Hear hear!
rogerborg
Admin
Posts: 3590
Joined: Mon Oct 09, 2006 9:36 am
Location: Scotland - gonnae no slag aff mah Engleesh
Contact:

Post by rogerborg »

Let's try a pragmatic compromise (i.e. everyone will be unhappy, but it's already a fait accompli).

In SVN 2000 (yay me!) on the trunk, position2d is now a typedef/#define of vector2d. position2d is very tentatively marked as deprecated. You can continue to use it, but you'd be as well using a vector2d, since that's what it is.

I don't think that we can or should get rid of dimension2d since it would stuff up apps that rely on Width / Height rather than X / Y. However, I have added more implicit conversions between dimension2d and vector2d.

You can probably do some real damage with these, by accidentally passing the wrong types around without realising it. Knock yourself out, and please let us know if this is going too far, or not far enough.
Please upload candidate patches to the tracker.
Need help now? IRC to #irrlicht on irc.freenode.net
How To Ask Questions The Smart Way
Post Reply