Jump to content

  • Log In with Google      Sign In   
  • Create Account

#ActualKhatharr

Posted 04 December 2012 - 04:36 PM

It took quite a while to sort out what you're doing there.

I think if you just bite the bullet and refactor this your bug will go away. Also, it may help to use a naming convention that marks m_members, and g_globals or somesuch to help with clarity, but in this case what helped me the most in sorting it out was adding some vertical spacing to separate sections of code that were doing different jobs. That's always a slight suggestion that another function could make things more clear, even if it's only called in one place. Some of the variable and function names are unclear. I find it helps to name things as if I were describing them to another person.

I'll keep looking at this and see if I can spot a problem.

Edit - I think this may be it:
[source lang="cpp"] if( PeekMessage( &msg, NULL, 0, 0, PM_REMOVE ) ) { TranslateMessage( &msg ); DispatchMessage( &msg ); } else { //no processing is done if there's a message![/source]

I'll keep looking.

Edit - nvm, I think it's your 'lerp' handling. One sec while I bust out the maths.

No, I don't think that's it.

Say, why don't you rehash this real quick and make the star a class instead of using C-style OOP. Try to clean it up a little. It's really hard to walk through right now.

#5Khatharr

Posted 04 December 2012 - 04:26 PM

It took quite a while to sort out what you're doing there.

I think if you just bite the bullet and refactor this your bug will go away. Also, it may help to use a naming convention that marks m_members, and g_globals or somesuch to help with clarity, but in this case what helped me the most in sorting it out was adding some vertical spacing to separate sections of code that were doing different jobs. That's always a slight suggestion that another function could make things more clear, even if it's only called in one place. Some of the variable and function names are unclear. I find it helps to name things as if I were describing them to another person.

I'll keep looking at this and see if I can spot a problem.

Edit - I think this may be it:
[source lang="cpp"] if( PeekMessage( &msg, NULL, 0, 0, PM_REMOVE ) ) { TranslateMessage( &msg ); DispatchMessage( &msg ); } else { //no processing is done if there's a message![/source]

I'll keep looking.

Edit - nvm, I think it's your 'lerp' handling. One sec while I bust out the maths.

#4Khatharr

Posted 04 December 2012 - 04:23 PM

It took quite a while to sort out what you're doing there.

I think if you just bite the bullet and refactor this your bug will go away. Also, it may help to use a naming convention that marks m_members, and g_globals or somesuch to help with clarity, but in this case what helped me the most in sorting it out was adding some vertical spacing to separate sections of code that were doing different jobs. That's always a slight suggestion that another function could make things more clear, even if it's only called in one place. Some of the variable and function names are unclear. I find it helps to name things as if I were describing them to another person.

I'll keep looking at this and see if I can spot a problem.

Edit - I think this may be it:
[source lang="cpp"] if( PeekMessage( &msg, NULL, 0, 0, PM_REMOVE ) ) { TranslateMessage( &msg ); DispatchMessage( &msg ); } else { //no processing is done if there's a message![/source]

I'll keep looking.

#3Khatharr

Posted 04 December 2012 - 04:22 PM

It took quite a while to sort out what you're doing there.

I think if you just bite the bullet and refactor this your bug will go away. Also, it may help to use a naming convention that marks m_members, and g_globals or somesuch to help with clarity, but in this case what helped me the most in sorting it out was adding some vertical spacing to separate sections of code that were doing different jobs. That's always a slight suggestion that another function could make things more clear, even if it's only called in one place. Some of the variable and function names are unclear. I find it helps to name things as if I were describing them to another person.

I'll keep looking at this and see if I can spot a problem.

Edit - I think this may be it:
[source lang="cpp"] if( PeekMessage( &msg, NULL, 0, 0, PM_REMOVE ) ) { TranslateMessage( &msg ); DispatchMessage( &msg ); } else {[/source]

#2Khatharr

Posted 04 December 2012 - 04:14 PM

It took quite a while to sort out what you're doing there.

I think if you just bite the bullet and refactor this your bug will go away. Also, it may help to use a naming convention that marks m_members, and g_globals or somesuch to help with clarity, but in this case what helped me the most in sorting it out was adding some vertical spacing to separate sections of code that were doing different jobs. That's always a slight suggestion that another function could make things more clear, even if it's only called in one place. Some of the variable and function names are unclear. I find it helps to name things as if I were describing them to another person.

I'll keep looking at this and see if I can spot a problem.

#1Khatharr

Posted 04 December 2012 - 04:02 PM

It took quite a while to sort out what you're doing there.

I think if you just bite the bullet and refactor this your bug will go away. Also, it may help to use a naming convention that marks m_members, and g_globals or somesuch to help with clarity, but in this case what helped me the most in sorting it out was adding some vertical spacing to separate sections of code that were doing different jobs. That's always a slight suggestion that another function could make things more clear.

PARTNERS