Game Development Community

STL related vector compilation problem

by Valens · in Torque Game Engine · 08/20/2002 (2:10 am) · 2 replies

Sorry if this seems to be the wrong group, but I have this problem while compiling the ms2dtsExporter workspace. The problem is related specifically to the STL's Vector::Assign(). According to most documentation, I've read through, this function takes in 2 parameters, whereby in the source I downloaded from garage games, Vector::Assign() is being called a lot of times with only 1 parameter. VS.Net seems to have a problem with that. It just will not compile. Specfically, the files which are concerned are DTSMesh.cpp and DTSShape.cpp

Any help on this will be greatly appreciated.
Thanks.

Abdool.

#1
08/20/2002 (7:06 am)
In the previous version of VS (6.0) the macro/define for assign() automagicly added in the proper class name.

In VS.NET they either moved away from it or forgot about it ;) so you have two choices

1) in each .assing() add in the corresponding class name
IE

nodeTranslations.assign(numNodeTranslations) ;
nodeRotations.assign(numNodeRotations) ;

would become

nodeTranslations.assign(numNodeTranslations, Point()) ;
nodeRotations.assign(numNodeRotations, Quaternion()) ;

why? well if you goto the definition of nodeTranslations you will notice that it is a vector of class Point3F's.
The same applies for nodeRotations etc..

The other option is to (have not tested this one yet for backwards compatability)

replace .assign() with .resize()

IE:
nodeScalesUniform.assign (numNodeScalesUniform);

with

nodeScalesUniform.resize (numNodeScalesUniform);

I have used the first option with no issues of yet, my home PC is using VS.NET on winXP and my work laptop is running VS 6.0 on Win2K

Regards,

Ron
#2
08/20/2002 (6:37 pm)
Thanks dude.

It seems to be compiling fine now. Can't wait to get into some actual dev !

regards,
Abdool.