Jump to content

  • Log In with Google      Sign In   
  • Create Account

Interested in a FREE copy of HTML5 game maker Construct 2?

We'll be giving away three Personal Edition licences in next Tuesday's GDNet Direct email newsletter!

Sign up from the right-hand sidebar on our homepage and read Tuesday's newsletter for details!


We're also offering banner ads on our site from just $5! 1. Details HERE. 2. GDNet+ Subscriptions HERE. 3. Ad upload HERE.


#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