Jump to content
  • Advertisement
Sign in to follow this  
  • entries
    195
  • comments
    198
  • views
    104383

When will I ever learn

Sign in to follow this  
SiCrane

97 views

I really should know by now not to add new arguments to a function with default parameters when refactoring my code. I'm just glad I'm paranoid with my asserts. That one would have been a pain to debug if the assert hadn't caught it.

Basically I took dodecahellspawn and began seperating game logic from any SDL dependencies, one of which was SDL_GetTicks(). So for a stopgap, I added an extra parameter to functions that used SDL_GetTicks() that was the current tick count. This unfortunately included a couple of functions that took default arguments. The bugger was that when called at the very beginning of program execution, it would have a tick count of 0, so the call stack looked reasonable at first. Sure, it took me only five minutes to figure out since I am paranoid with my asserts, but that's five minutes I could have saved if I had remembered my lessons from last time.

Hopefully now that I've taken the time to write about it, it will have sunken in for next time. I doubt it, but I can still hope.
Sign in to follow this  


0 Comments


Recommended Comments

There are no comments to display.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Advertisement
×

Important Information

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

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!