[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.

[fixed] there is a error in class of dimension2d

Postby idisc » Thu Dec 25, 2008 7:01 am

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]
idisc
 
Posts: 5
Joined: Wed Dec 10, 2008 7:38 am

Postby rogerborg » Sun Dec 28, 2008 9:12 pm

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
User avatar
rogerborg
Admin
 
Posts: 3590
Joined: Mon Oct 09, 2006 9:36 am
Location: Scotland - gonnae no slag aff mah Engleesh

Postby DtD » Mon Dec 29, 2008 12:30 am

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

~DtD
User avatar
DtD
 
Posts: 264
Joined: Mon Aug 11, 2008 7:05 am
Location: Kansas

Postby vitek » Mon Dec 29, 2008 2:19 am

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
User avatar
vitek
Bug Slayer
 
Posts: 3919
Joined: Mon Jan 16, 2006 10:52 am
Location: Corvallis, OR

Postby DtD » Mon Dec 29, 2008 2:36 am

Ah, ok so not too terribly old.

~DtD
User avatar
DtD
 
Posts: 264
Joined: Mon Aug 11, 2008 7:05 am
Location: Kansas

Postby BlindSide » Mon Dec 29, 2008 5:47 am

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
BlindSide
Admin
 
Posts: 2797
Joined: Thu Dec 08, 2005 9:09 am
Location: NZ!

Postby Ion Dune » Mon Dec 29, 2008 7:09 am

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.
Ion Dune
 
Posts: 453
Joined: Mon Nov 12, 2007 8:29 pm
Location: California, USA

Postby twilight17 » Mon Dec 29, 2008 7:12 am

Agree
Post this userbar I made on other websites to show your support for Irrlicht!
Image
http://img147.imageshack.us/img147/1261 ... wernq4.png
User avatar
twilight17
 
Posts: 362
Joined: Sun Dec 16, 2007 9:25 pm

Postby Dorth » Mon Dec 29, 2008 7:24 am

Hear hear!
Dorth
 
Posts: 931
Joined: Sat May 26, 2007 11:03 pm

Postby rogerborg » Mon Dec 29, 2008 4:17 pm

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
User avatar
rogerborg
Admin
 
Posts: 3590
Joined: Mon Oct 09, 2006 9:36 am
Location: Scotland - gonnae no slag aff mah Engleesh


Return to Bug reports

Who is online

Users browsing this forum: No registered users and 0 guests