Jump to content
  • Advertisement


This topic is now archived and is closed to further replies.



This topic is 6625 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Sorry to bother you guys again..... but my Edge function (the one that fills the edgebuffer) doesnt work, and I cant see whats wrong with it. Please help, thanks in advance here it is:

void Edge(int leftedge[],int rightedge[],ePixel v1,ePixel v2)
        float deltax,deltay;
        float slope;
        float x;
        int y;
        ePixel temp;

        if(v1.y > v2.y) {temp = v1;v1=v2;v2=temp;}

        deltax = v2.x - v1.x;
        deltay = v2.y - v1.y;
        slope = deltax / deltay;

        x = v1.x;

        for(y = v1.y;y < v2.y;y++)
                if(x <  leftedge[y]) 
                     leftedge[y] = (int)x;
                if(x > rightedge[y]) 
                     rightedge[y] = (int)x;
                x += slope;


Share this post

Link to post
Share on other sites
The problem is that ppl do not like debugging someone else''s code.

I always suggest this tip because I learned it in a simple QBASIC class in college around 2 years back.

1) Define what you are going to do..
2) Write down the logic for what you want the computer to do
3) Break that down even further
4) Analyze logic by playing computer and writing down variables and the outcome on a piece of paper.
5 a) if error then grab an eraser and go back to step 2
5 b) if works jump to YOURLOGICLOOP until all variable limits are valid for the function you are writing
5 c) if error go to step 2 until eraser is gone or brain melts through ears
6) Start translating logic into actual code
7) Have a soda and relax

Share this post

Link to post
Share on other sites
Maybe I''m missing something, but what exactly is this functions supposed to do? Maybe THEN I can help...

A man with no head is still a man.
A head with no man is plain freaky.

Share this post

Link to post
Share on other sites

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!