Results 1 to 3 of 3

Thread: ClanLib 1.0 very wrong?

  1. #1

    Default ClanLib 1.0 very wrong?

    Look at that code:

    CL_Vector color = CL_Vector(0.0f, 0.0f, 1.0f, 0.0f);
    CL_Vector color_vertexes = CL_Vector(0.0f, 0.0f, 0.5f, 0.2f);

    Printf("At Magnetique: Before: color_vertexes %f %f %f %f input %f %f %f %f", color_vertexes.x, color_vertexes.y, color_vertexes.z, color_vertexes.w, color.x, color.y, color.z, color.w);

    color_vertexes+=color;

    Printf("At Magnetique: After: color_vertexes %f %f %f %f", color_vertexes.x, color_vertexes.y, color_vertexes.z, color_vertexes.w);


    And now the output:

    At Magnetique: Before: color_vertexes 0.0 0.0 0.5 0.2 input 0.0 0.0 1.0 0.0
    At Magnetique: After: color_vertexes 0.0 0.0 1.5 1.2



    Someone know what is going on?

  2. #2
    ClanLib Developer
    Join Date
    May 2007
    Posts
    1,824

    Default

    A serious bug!

    Code:
    void CL_Vector::operator += (const CL_Vector& v)
    {
    	x += v.x;
    	y += v.y;
    	z += v.z;
    	w += v.z;
    }
    (Can someone fix this in ClanLib 1.0 svn)

    It is correct in ClanLib 2.2
    Code:
    void operator += (const CL_Vec4<Type>& vector) { x+= vector.x; y+= vector.y; z+= vector.z; w+= vector.w; }

  3. #3
    Administrator Seth's Avatar
    Join Date
    Jul 2002
    Location
    Japan
    Posts
    5,345

    Default

    I comitted fix to V1.X.. btw, a minus operator also had the bug:


    CL_Vector CL_Vector:: operator - (const CL_Vector& v) const
    {
    return CL_Vector(x - v.x,
    y - v.y,
    z - v.z,
    w - v.z); //
    }
    Seth A. Robinson
    Robinson Technologies

Similar Threads

  1. What's wrong?
    By TSO in forum Novashell Game Creation System
    Replies: 1
    Last Post: 08-31-2010, 01:43 AM
  2. Linux/nvidia: ClanLib detects wrong OpenGL version
    By grebneke in forum Official ClanLib SDK Forums
    Replies: 2
    Last Post: 02-15-2010, 10:28 PM
  3. Wrong lib name in application.h(clanlib 0.9)
    By Lifeengines in forum Official ClanLib SDK Forums
    Replies: 1
    Last Post: 06-24-2008, 06:51 AM
  4. is there something wrong with my game?
    By daftchick in forum Funeral Quest
    Replies: 2
    Last Post: 01-08-2008, 10:55 AM
  5. I was wrong about dofile. (maybe)
    By Ian in forum Novashell Game Creation System
    Replies: 1
    Last Post: 02-14-2007, 12:24 AM

Bookmarks

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •