Game Development Community

Fixing the tools in TSE - M4

by David Dougher · in Torque Game Engine · 09/08/2006 (1:40 pm) · 1 replies

Well I'm sure that there are other ways to deal with the errors in the TSE tools but here is how I fixed them. For anybody who is expecting rocket science - maybe next time. Mostly introducing "int" in the right place. I would find the difference and make the change - cut and paste will lose you a couple of useful comments I trimmed to keep these to individual lines.


To get the dtsSDK to compile ...

In DTSShape.cpp - line 587

Change this

void Shape::setSmallestSize(int pixels)
{
if (pixels < 1) pixels = 1 ;
smallestSize = pixels ;
for (int i = 0 ; i < detailLevels.size() ; i++)
{ ...

to this

void Shape::setSmallestSize(int pixels)
{
if (pixels < 1) pixels = 1 ;
smallestSize = pixels ;
int i;
for (i = 0 ; i < detailLevels.size() ; i++)
{ ...

To get the max3 exporters to work

Goto maxsdk31
Patchobj.h - line 297

Change this...
CoreExport PatchObjectInit(); // Constructor helper

To this
CoreExport int PatchObjectInit(); // Constructor helper

Next, in Maxsdk31 goto
Shape.h - starting at line 326

Change these...

CoreExport BindKnot(BOOL isEnd, int segIndex, int splineSegID, int splinePointID);
CoreExport UnbindKnot(int splineID, BOOL isEnd); //unbind a knot
CoreExport UpdateBindList(); //when topology changes this needs to be called
CoreExport HideSelectedSegs(); // hide selected segs
CoreExport HideSelectedVerts(); // hide segs attached to selected verts
CoreExport HideSelectedSplines(); // hide segs attached to selected splines
CoreExport UnhideSegs(); //unhide all segs

CoreExport UnselectHiddenVerts();
CoreExport UnselectHiddenSegs();
CoreExport UnselectHiddenSplines();

To these...

CoreExport int BindKnot(BOOL isEnd, int segIndex, int splineSegID, int splinePointID);
CoreExport int UnbindKnot(int splineID, BOOL isEnd); //unbind a knot
CoreExport int UpdateBindList(); //when topology changes this needs to be called
CoreExport int HideSelectedSegs(); // hide selected segs
CoreExport int HideSelectedVerts(); // hide segs attached to selected verts
CoreExport int HideSelectedSplines(); // hide segs attached to selected splines
CoreExport int UnhideSegs(); //unhide all segs

CoreExport int UnselectHiddenVerts();
CoreExport int UnselectHiddenSegs();
CoreExport int UnselectHiddenSplines();

Finally, in maxsdk31 goto
Stdmat.h - line 307
And change these...

//watje pops up a bitmap loader dlg
virtual BitmapLoadDlg(){ return 0; }
//watje forces the bitmap to reload and view to be redrawn
virtual ReloadBitmapAndUpdate(){ return 0; }

to this...
//watje pops up a bitmap loader dlg
virtual int BitmapLoadDlg(){ return 0; }
//watje forces the bitmap to reload and view to be redrawn
virtual int ReloadBitmapAndUpdate(){ return 0; }


To get the Max 4 exporter to work
In maxsdk40 goto
Imtl.h - line 1401 and change this...

Color GetUserIllumOutput( TCHAR* name, int n ){
for( int i = 0; i < nUserIllumOut; ++i ){
DbgAssert( userIllumNames );

To this...
Color GetUserIllumOutput( TCHAR* name, int n ){
int i;
for( i = 0; i < nUserIllumOut; ++i ){
DbgAssert( userIllumNames );

Skip down to line 1414 and change

finalAttenuation = diffIllumIntens = 0.0f;
for( int i=0; i < nUserIllumOut; ++i )
userIllumOut[i] = finalC;

To this...

finalAttenuation = diffIllumIntens = 0.0f;
int i;
for( i=0; i < nUserIllumOut; ++i )
userIllumOut[i] = finalC;


That's the code changes.

About the author

Owner - Pariah Games, Adjunct Professor - Bristol Community College, Mentor - Game Design - Met School Newport, Mentor - Game Design - Met School Providence


#1
09/08/2006 (1:41 pm)
And here's the rest...

Now for both of the Max exporters you must remember to add the ogg and vorbis libraries and imm32.lib to the list of libraries used to compile.

Lastly you might encounter an error that the system can't compile because it can't find afxres.h That file is located in the Platform Libraries but it is usually tucked away under /mfc so do a search for it, find its location and add the subdirectory it is in to the list of includes for the compile.

That should take care of all the major issues I've encountered. You'll still get warnings but in my case I got 27 out of 27 compiled.

Best of luck.