Game Development Community

VC6 Project Settings and Vaporizing Vectors

by David Wyand · in Torque Game Engine Advanced · 09/29/2004 (7:40 am) · 5 replies

Greetings!

While working with the TSE head as of last Friday, I ran into some weirdness with the VC6 project file. Specifically the preprocessor definitions for the debug build.

Here's what was originally in there:

TORQUE_DEBUG DEBUG_GUARD

which translates into the following switch:

/D "TORQUE_DEBUG DEBUG_GUARD"

This meant that the TORQUE_DEBUG definition actually wasn't being defined (I had a function that relied on it that was failing). Here's what I feel should be in there:

TORQUE_DEBUG,DEBUG_GUARD

With the comma, we have a better looking switch:

/D "TORQUE_DEBUG" /D "DEBUG_GUARD"

And all is well. Uh, almost... Now with my shiny new debug definition, I've actually received a couple of compile time fatal errors.

The first is with interior/interior.cpp within the Interior::Interior() constructor. The compiler is complaining about:

VECTOR_SET_ASSOCIATION(mSubObjects);

saying that mSubObjects is not a member of the Interior class. And you know what? I can't find it in the header either. So, I've commeted it out.

The second compile error is with interior/interiorRes.cpp within the InteriorResource::InteriorResource() constructor. The compiler is complaining about:

VECTOR_SET_ASSOCIATION(mPaths);

and again it looks to no longer be a part of the InteriorResource class. So, I've commented it out too.

Now all is well with the Universe.

- LightWave Dave

About the author

A long time Associate of the GarageGames' community and author of the Torque 3D Game Development Cookbook. Buy it today from Packt Publishing!


#1
09/29/2004 (10:56 am)
Say Dave, are you going to let the rest of us fix something?


LOL, Nice work man
#2
09/29/2004 (11:00 am)
So I take it mirrors will no longer be subobjects? And doors will no longer be pathed interiors? Hmm...
#3
12/22/2004 (9:03 am)
I ran into this bug just now myself. A little suggestion.... how about changing the define for VECTOR_SET_ASSOCIATION in tVector.h so that missing vectors are caught with DEBUG_GUARD on or when it's off:

/// Use the following macro to bind a vector to a particular line
///  of the owning class for memory tracking purposes
#ifdef DEBUG_GUARD
#define VECTOR_SET_ASSOCIATION(x) x.setFileAssociation(__FILE__, __LINE__)
#else
// Added x.size() below so that compiler complains on missing 
// vectors, but will optimize the code out.
#define VECTOR_SET_ASSOCIATION(x) x.size()
#endif

I haven't tested this yet, but it should keep these little bugs from creeping into future releases.
#4
12/22/2004 (4:15 pm)
Somebody else recently posted about the TORQUE_DEBUG, DEBUG_GUARD settings and it's been checked in for a few days. Same with the VECTOR_SET_ASSOCIATION fixes.
#5
12/22/2004 (4:24 pm)
Ok... just a little defensive programming. =)