Game Development Community

Torque Oddities

by James Urquhart · in Torque Game Engine · 09/17/2003 (6:25 am) · 3 replies

Firstly, i am having this problem :

void TSDecalMesh::assemble(bool, Stream *s)
{
   S32 sz; s->read(&sz);
   // vector size() function returns an S32

   primitives.setSize(sz);
(doing this at start of the function)

But the compiler returns the error :

ts/tsDecal.cc: In member function 'void TSDecalMesh::assemble(bool, Stream*)':
ts/tsDecal.cc:170: no matching function for call to '
   ToolVector<TSDrawPrimitive>::setSize(U32&)'

I just don't get why that isn't working. After all, S32 and U32 are just really int's. And even if i change sz to be a U32, it still doesn't compile =(

And if your wondering, im using gcc on redhat 9 :
Reading specs from /usr/lib/gcc-lib/i386-redhat-linux/3.2.2/specs
Configured with: ../configure --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --enable-shared --enable-threads=posix --disable-checking --with-system-zlib --enable-__cxa_atexit --host=i386-redhat-linux
Thread model: posix
gcc version 3.2.2 20030222 (Red Hat Linux 3.2.2-5)

Theres also something odd i noticed about Torque Vectors.

The size function()
S32 size() const;

The reserve() and resize() functions:
void reserve(U32);
bool  resize(U32);

Just look at the amazing consistency there.

Thanks for any help.

#1
09/17/2003 (9:40 am)
I'm checking into this.
#2
09/17/2003 (11:03 am)
Ok, it looks like you can safely run things with all U32's (as they ought to be). I'll ping the GG guys about fixing this.
#3
09/18/2003 (4:44 pm)
ToolVector<>s don't have a setSize function. You're probably getting Vector<>s and ToolVector<>s confused. I know if you use VC7 and type in "someToolVector." it'll list setSize as one of the member functions, but if you look at the ToolVector definition, setSize() doesn't exist.