About Store Forum Documentation Contact



Post Reply 
WorldManager not calling drawPrepare
Author Message
Rubeus Offline
Member

Post: #1
WorldManager not calling drawPrepare
I am trying to refactor my code from manual updating/drawing to using the Esenthel world manager. My object is derived from Game.Obj, it's created dynamically by world.create and goes into the derived objects create function to assigns mesh and phys and all that. WorldManager calls update on my object every frame.

But my mesh gets changed to null somewhere along the way and WorldManager doesn't call drawPrepare. At all. Herein lies the problem.

I did create a draw Prepare function, copied pretty much exact from the static game obj code.

The camera is within 80 units of 0, 0, 0 and viewrange/activerange are both set at 200. If I do pos.draw() on my objects matrix, I can see the square where my object is supposed to be. So I know it's not an outside of active range problem. The object's Object Class is set to draw as mesh. Game.ObjMemx container.elms returns 1, so there is an object in there...

Almost all my code is taken directly from the tutorials. I must be screwing something up somewhere, because when I put my directly in a tutorial, it works.

I've checked and disabled any extra memory allocations in my code in case I was accidentally overwriting something, but got nowhere with that. My game doesn't have a world, per se, so I'm not calling world.new, but adding a tutorial world in draws the world, but not my object.

Does anyone have any idea what could be causing this? Surely if my object is being updates, world manager should at least TRY to call drawPrepare, right? I am completely baffled, but I'm sure it's something relatively simple.
05-26-2013 04:07 PM
Find all posts by this user Quote this message in a reply
Rubeus Offline
Member

Post: #2
RE: WorldManager not calling drawPrepare
It *was* simple. Apparently, without the save() or load() functions defined, one encounters those types of shenanigans. -_- The trick, apparently, is to call World.Update before creating any objects, or it saves, then loads every object.

This might be something worth putting in the comments of those functions for those of us making a game that won't have a save feature and therefore don't think saving and loading functions are worth the time to define. :(
(This post was last modified: 05-31-2013 02:24 PM by Rubeus.)
05-26-2013 10:44 PM
Find all posts by this user Quote this message in a reply
Post Reply