Jump to content

  • Log In with Google      Sign In   
  • Create Account


Member Since 17 Jul 2002
Online Last Active Today, 04:01 PM

Posts I've Made

In Topic: Xml Parser, C++

Today, 03:04 PM

The documentation includes a number of examples for traversing a loaded document. I'd recommend starting there.

In Topic: Compiling My Sdl C++ In Mac

25 July 2016 - 05:03 PM


If your code was written carefully and designed to be platform-agnostic, it should port over fairly easily. If not... you might be in for as much as a complete rewrite of large chunks.

Without seeing your code it's impossible to say for sure.

In Topic: Generate Unique Ids

22 July 2016 - 01:56 PM

Just allocate IDs one at a time starting at 0 (or 1). You have 4 billion+ IDs to play with in a 32-bit unsigned integer.

As for tracking sub-IDs, why not just keep a std::map<unsigned, std::set<unsigned>> that holds the sub-IDs allocated to each "parent" ID? Then you can traverse that set and nuke/free the IDs as needed.

In Topic: Pathfinding - How To Move Player Along Path

22 July 2016 - 01:49 PM

Just grasping at straws here since I didn't dig too deep into your code, but the physics update function looks... wonky.

maxSpeed should be compared to the magnitude of the velocity vector, not the components of the vector, for one thing. But something smells off in that code overall. Try simplifying it by removing acceleration and drag, and just applying a velocity vector to the current position vector every tick. That might reveal something.

In Topic: I'm Getting An Index Out Of Bounds When Trying To Add Buttons Pragmatically.

20 July 2016 - 01:01 PM

Walk through your code with the debugger and watch the values of num in particular. I think you'll find it surprising and enlightening.