SFML community forums

General => General discussions => Topic started by: FRex on May 22, 2013, 05:52:35 pm

Title: Small correction to src/Graphics/Image.cpp
Post by: FRex on May 22, 2013, 05:52:35 pm
Starting at line 236:
Quote
void Image::setPixel(unsigned int x, unsigned int y, const Color& color)
{
    Uint8* pixel = &m_pixels[(x + y * m_size.x) * 4];
    *pixel++ = color.r;
    *pixel++ = color.g;
    *pixel++ = color.b;
    *pixel++ = color.a;
}
The operator marked in red serves no purpose in this function.
Sorry.. ;D
Title: Re: Small correction to src/Graphics/Image.cpp
Post by: Laurent on May 22, 2013, 06:14:52 pm
Yeah... and the compiler is certainly smart enough to generate no code for it ;)
Title: Re: Small correction to src/Graphics/Image.cpp
Post by: FRex on May 22, 2013, 06:23:51 pm
Yeah, but since you accepted the trimming-whitespaces-from-empty-lines patch I guessed why not troll about that too.. :P
Title: Re: Small correction to src/Graphics/Image.cpp
Post by: Laurent on May 22, 2013, 06:46:01 pm
Sure, let's troll about that ;)
Title: Re: Small correction to src/Graphics/Image.cpp
Post by: FRex on May 23, 2013, 03:25:34 am
Only thing I'm curious about: was that copy paste programming ;D?
Title: Re: Small correction to src/Graphics/Image.cpp
Post by: Laurent on May 23, 2013, 08:04:00 am
No, I think it was intentional. It's more beautiful this way ;)
Title: Re: Small correction to src/Graphics/Image.cpp
Post by: FRex on May 23, 2013, 08:52:11 am
Hehe ;) Cool. Feel free to lock this thread now. :P