View Single Post
  #83  
Old 5th September 2007, 12:16 PM
cooliscool's Avatar
cooliscool cooliscool is offline
Dingpot
 
Join Date: Aug 2007
Location: SC, USA
Total Awards: 2
You're Appreciated! INFECTED - B1K1 
Next version will, yep. Projected release for it is within a week or two, depending on how dynamic my schedule is within that time. Along with it I'll release the source code (C# + OpenGL), for people to peek at.

Another small yet notable addition: given the ucode's incredible reliance on per-vertex diffuse colors to deliver colors and shading, they'll be editable (right click vertex, color dialog pops up, select color, done). Green Banjo should be interesting!

For the fun of it, this should give a little bit of insight as to how Banjo's models work (assuming my variable names make sense to anyone but me.. also, this is after the parser does its work):

Code:
        private void BuildList(int game, int mode)
        {
            int r = 0;
            int b = -1;
            if (game == 0)
            {
                for (int c = 0; c < polyind.Count; c++)
                {
                    if (r + 1 <= changeoff.Count)
                    {                
                       if (((int)changeoff[r]) == c)
                        {
                            b++;
                            r++;
                        }
                    }

                    int curoff = (int)curbase[b];
                    int curvert = (int)polyind[c];
                    Int16 p1 = (Int16)vert_x[curoff + curvert];
                    Int16 p2 = (Int16)vert_y[curoff + curvert];
                    Int16 p3 = (Int16)vert_z[curoff + curvert];
                    int R = (int)vert_r[curoff + curvert];
                    int G = (int)vert_g[curoff + curvert];
                    int B = (int)vert_b[curoff + curvert];
                    int A = (int)vert_a[curoff + curvert];

                    if ((int)curbase[b] + (int)polyind[c] > vert_x.Count)
                    {
                        break;
                    }
                    if (mode == 0)
                    {
                        Gl.glColor4ub((byte)R, (byte)G, (byte)B, (byte)A);
                    }
                    else if (mode == 1)
                    {
                        Gl.glColor3i(0, 0, 0);
                    }
                    else if (mode == 2)
                    {
                        Gl.glColor3ub(123, 233, 9);
                    }
                    Gl.glVertex3i(p1, p2, p3);
                }
            }
        }

Last edited by cooliscool; 5th September 2007 at 12:38 PM.
Reply With Quote