Game Development Community

Max2dtsExporterPro read .cfg's parameter bug

by Steven Zhou · in Torque Game Engine · 11/10/2007 (9:19 pm) · 0 replies

I've been working with the exporter code for a while now.I found that there are some bool parameter didn't work when I export.
for example "AllowUnusedMeshes","SequenceExport" ,etc...,

The problem is buffer overflow.

bool mEnableSequences;
...
mBoolParams.push_back((U32*)&mEnableSequences);
...
mBoolParams[i] = (U32)newVal;


Line 51,appConfig.h of dtsSDKPlus Project
Origin :

bool mEnableSequences;
bool mExportOptimized;
bool mAllowUnusedMeshes;
bool mAllowCollapseTransform;
bool mNoMipMap;
bool mNoMipMapTranslucent;
bool mZapBorder;
bool mIgnoreSmoothingGroupDuringCollapse;
bool mIgnoreSmoothingGroupOnSkinMesh;

Modified Code:

U32 mEnableSequences;
U32 mExportOptimized;
U32 mAllowUnusedMeshes;
U32 mAllowCollapseTransform;
U32 mNoMipMap;
U32 mNoMipMapTranslucent;
U32 mZapBorder;
U32 mIgnoreSmoothingGroupDuringCollapse;
U32 mIgnoreSmoothingGroupOnSkinMesh;