Game Development Community

-> 1.8.1 migration info collection

by Konrad Kiss · in Torque Game Engine Advanced · 02/13/2009 (9:11 am) · 17 replies

I'm starting this thread so we can share migration info.

Official migration guide: TGEA 1.8 Gotchas




#1
02/13/2009 (9:17 am)
TGEA 1.7.1 -> TGEA 1.8.1

Some files and/or contents were moved:
core/stream.h -> core/stream/stream.h
core/bitStream.h -> core/stream/bitStream.h
core/fileStream.h -> core/stream/fileStream.h
core/memStream.h -> core/stream/memStream.h
core/tVector.h -> core/util/tVector.h
gfx/gBitmap.h -> gfx/bitmap/gBitmap.h
gfx/bitmapPng.h -> gfx/bitmap/loaders/bitmapPng.h (along with other loaders)
materials/material.h -> materials/materialDefinition.h
materials/customMaterial.h -> materials/customMaterialDefinition.h
materials/materialPropertyMap.h -> materials/materialManager.h
math/mPoint.h -> math/mPoint.h, math/mPoint2.h, math/mPoint3.h, math/mPoint4.h
util/fourcc.h -> core/util/fourcc.h
util/safeDelete.h -> core/util/safeDelete.h
renderInstance/renderInstMgr.h -> renderInstance/renderPassManager.h

In MaterialList, mMaterialNames is now protected
MaterialList->mMaterialNames -> MaterialList->getMaterialNameList()
MaterialList->mMaterialNames[x] -> MaterialList->getMaterialName(x)

ResourceManager has changed. To load a resource:
ResourceManager->load() -> ResourceManager::get().load()

GFXTexHandle creator has a new desc parameter for debugging, so for materials:
GFXTexHandle tex(texPath, &GFXDefaultStaticDiffuseProfile);
->
GFXTexHandle tex = GFXTexHandle(texPath, &GFXDefaultStaticDiffuseProfile, 
              avar("%s() - NA (line %d)", __FUNCTION__, __LINE__));

Creating a new material instance is now a bit different:
MatInstance * matInst  = new MatInstance(*newMat); 
-> 
BaseMatInstance *matInst = newMat->createMatInstance();

Hope this helps someone. If you find something useful, please post it here, so we all can port resources faster. Thanks.

#2
02/14/2009 (8:23 am)
TGEA 1.7.1 -> TGEA 1.8.1

File open modes were changed, ie. to write:
FileStream::Write -> Torque::FS::File::Write

readPNG, writePNG, and the rest of the read/write bitmap functions have changed...
bmp.writePNG(fStream);
->
bmp.writeBitmap("png", fStream, U32_MAX);
#3
02/14/2009 (10:17 am)
TGEA 1.7.1 -> TGEA 1.8.1

Referencing ResourceManager has changed, for example:

ResourceManager->openFileForWrite() 
-> 
gResourceManager->openFileForWrite()
#4
02/14/2009 (4:03 pm)
Bitmap controls and vehicles tge 1.5.1 --> Tgea 1.7.1 works in 1.8.1 as well.

gui/guiControl.h is now gui/controls/guiBitmapCtrl.h
and you'll need gfx/primBuilder.h depending on what you are making.

game/gameConnection.h is in T3D/gameConnection.h

game/vehicles/vehicle.h is in T3D/vehicles/vehicle.h

TextureHandle mTextureHandle; is now GFXTexHandle  mTextureObject;

mTextureHandle is now mTextureObject

GameConnection::getServerConnection(); is now GameConnection::getConnectionToServer();

dglSetClipRect(updateRect); is now GFX->setClipRect(updateRect);

dglClearBitmapModulation(); is now GFX->getDrawUtil()->clearBitmapModulation();

dglDrawBitmapStretchSR(mTextureHandle, destRect, stretchRect); is now
     GFX->getDrawUtil()->drawBitmapStretchSR(mTextureObject, destRect, stretchRect);

I found these while porting the digital speedometer hud over.

Edit: added engine type
#5
02/15/2009 (1:32 am)
@Mike - I think Konrad intended this to be migration info for porting from TGEA 1.7.1 to TGEA 1.8.1 not for details from a TGE port, although a seperate thread for them would probably be useful.

Also think you have a typo with:

gui/guiControl.h is now gui/controls/guiBitmapCtrl.h
#6
02/15/2009 (7:28 am)
oops. If he'd like, I can delete my post and move it elsewhere.
No typo. the controls folder is actually named controls.
#7
02/15/2009 (8:26 am)
I's ok with me, it's in a good place.. I've renamed the thread instead.
#8
02/15/2009 (8:53 am)
In that case, the right thing to do would be to indicate the origin engine version that you are talking about on each post.
#9
02/15/2009 (9:23 am)
Thanks Konrad. This thread is a great resource.
Novack, I added the engine types to my first post.
#10
02/15/2009 (10:25 am)
@Novack: Right, I edited my posts.
#11
02/16/2009 (1:43 am)
TGEA 1.7.1 -> TGEA 1.8.1

ShapeBaseData has member variable name changes
shape -> mShape
Note: ShapeBaseImageData still has its shape member variable name unchanged.

Box3F bounding coordinate name changes
mObjBox.min -> mObjBox.minExtents
mObjBox.max -> mObjBox.maxExtents

nameDictionary is now private in simSet.h

mGroup is now private in simGroup.h, use getGroup()
#12
03/28/2009 (7:52 am)
tge 1.5.x --> tgea 1.8.x
dgl/dgl.h is now gfx/gfxDrawUtil.h
#13
03/29/2009 (5:04 am)
tge -> tgea 1.7.x

glDisable(GL_LIGHTING);                = GFX->setLightingEnable(false);
glDisable(GL_DEPTH_TEST);              = GFX->setZWriteEnable(false);
glPushMatrix();                        = GFX->pushWorldMatrix();
dglMultMatrix(&getRenderTransform());  = GFX->multWorld(getRenderTransform());
glColor3f(1, 0, 0);                    = PrimBuild::color3f(1, 0, 0);
glLineWidth(2.f);                      = PrimBuild::begin(GFXLineList, 2);
glBegin(GL_POINTS);                    = GFX->setVertexBuffer( mDots );/PrimBuild::begin( GFXPointList, mDots->mNumVerts);
glVertex3fv                            = PrimBuild::vertex3fv
glEnable(GL_LIGHTING);                 = GFX->setLightingEnable(true);
glEnable(GL_DEPTH_TEST);               = GFX->setZWriteEnable(true);
glMatrixMode(GL_PROJECTION);           = MatrixF projection = GFX->getProjectionMatrix();
dglGetViewport(&viewport);             = MatrixF view = GFX->getViewMatrix();
dglMultMatrix(&getTransform());        = GFX->multWorld(getTransform());
glTexCoord2f                           = PrimBuild::texCoord2f

does anyone know what the TGEA of "glNormal3fv" is??
#14
03/29/2009 (7:42 am)
@deepscratch:
PrimBuilder doesn't use a vertex type with normals, hence no current support for dynamic normals. If you want to add it change PrimBuilder to use GFXVertexPCNT instead of GFXVertexPCT and add a normal3f that pokes in your normal into the vertex structure.
#15
04/03/2009 (12:43 pm)
Hate to ask for TGEA 1.8.1 porting help but anyone want to give a go at: http://www.garagegames.com/community/blogs/view/16655 ?
Having some trouble with the gl calls.
It's really small and super useful for model designers.
#16
04/03/2009 (2:06 pm)
@BrokeAss Games,
just using the list I posted here, I came up with this, not tested(I'm not near my compiling pc right now, but might work, dunno. BTW, this'll be for 1.7.1, so check what 1.8.1 wants....

if (smRenderBones) {
	GFX->setLightingEnable(false);
	GFX->setZWriteEnable(false);
	PrimBuild::begin(GFXLineList, 2);
	PrimBuild::begin( GFXPointList, 6.f);
	for (U32 i=0;i<mShape->nodes.size();i++)
		renderBone(i);
	PrimBuild::begin( GFXPointList, .1f);
	PrimBuild::begin(GFXLineList, 1);
	GFX->setZWriteEnable(true);
	GFX->setLightingEnable(true);
   }


void TSShapeInstance::renderBone(U32 idx)
{
	Point3F pos;
	pos = mNodeTransforms[idx].getPosition();
	
	// Draw point
        GFX->setVertexBuffer( mDots );
	PrimBuild::begin( GFXPointList, mDots->mNumVerts);
	PrimBuild::color3f(1, 0, 0); // red for the dots
	PrimBuild::vertex3f(pos.x, pos.y, pos.z)
	PrimBuild::End();
	
	// And now the line to the parent
	if (mShape->nodes[idx].parentIndex != -1) {
		PrimBuild::begin(GFXLineList);
		PrimBuild::color3f(0.0,1.0,0.0); // green for the lines
		PrimBuild::vertex3f(pos.x, pos.y, pos.z);
		pos = mNodeTransforms[mShape->nodes[idx].parentIndex].getPosition();
		PrimBuild::vertex3f(pos.x, pos.y, pos.z);
		PrimBuild::End();
	}
}
#17
04/03/2009 (3:58 pm)
@deepscratch
Thanks!
Replied here to keep this thread clean.