Game Development Community

ALPHA 1.1: t2dAnimatedSprite.cc

by Scott Coursey · in Torque Game Builder · 11/24/2005 (7:27 pm) · 5 replies

I'm building on a Mac (PBook; 10.4.3; 2 GB RAM; GCC 4.0). I've gotten through the normal TGE compile glitches (xcode project, errors in event.h). Now, I'm building the t2dAnimatedSprite.cc.

Here are the errors:

../engine/T2D/t2dAnimatedSprite.cc:365:1: error: pasting "loadStream_4" and "," does not give a valid preprocessing token
../engine/T2D/t2dAnimatedSprite.cc:365:1: error: pasting "saveStream_4" and "}" does not give a valid preprocessing token

The code in question:

REGISTER_SERIALISE_START( t2dAnimatedSprite )
    REGISTER_SERIALISE_VERSION( t2dAnimatedSprite, 4, false )
REGISTER_SERIALISE_END()

Does anyone have any clues?

#1
11/24/2005 (8:55 pm)
Yes, look in engine/T2D/t2dSerialise.h. It's a problem due to the wrong use of the ## preprocessor operator.
I'm about done with a Linux compile HOWTO, and more likely than not mac folk will run into the same problems as linux.
#2
11/24/2005 (8:56 pm)
Any ETA? And will you notify me when it's done?

Thanks.
#3
11/24/2005 (9:05 pm)
If I can get around these effin link errors, in a few hours.. Here's the fix for your immediate issue:
///-----------------------------------------------------------------------------
/// Serialise Entry Registration.
///-----------------------------------------------------------------------------
#define REGISTER_SERIALISE_START( className )                                                                   \
    static className::tSerialiseEntry serialEntryTable_##className[] = {

//#define REGISTER_SERIALISE_VERSION( className, version, deprecated )                                            \
//    { version, deprecated, className::loadStream_##version##, className::saveStream_##version## },
#define REGISTER_SERIALISE_VERSION( className, version, deprecated )                                            \
    { version, deprecated, className::loadStream_##version, className::saveStream_##version },

#define REGISTER_SERIALISE_END() };
#4
11/24/2005 (10:50 pm)
Thanks! I'll post an update on how I got mine to work.
#5
11/25/2005 (4:28 am)
@David: Thanks; removed those extra ##s

- Melv.