Game Development Community

[BUG] Torque 2D for the iPhone 1.3.1 remove datablocks

by AltiMario · in iTorque 2D · 04/30/2010 (8:57 am) · 0 replies

I manually delete Datablock into loadLevel but since I've installed 1.3.1 the game crashes during manual unload or game exit by pressing home button.

I found a bug in the engine 1.3.1 but I wish someone could confirm that I am doing the right thing:

into t2dImageMapDatablock.cc

void t2dImageMapDatablock::destroyResources( void )
{
    // Unload Textures.
    unloadTextures();

    // Clear Frame Packing.
    mVecFrameIn.clear();
    mVecFrameOut.clear();
    mVecFrameOverflow.clear();

    // Clear Texture Pages.
    mVecTexturePage.clear();

    // Clear Existing Partitions.
    // [neo, 5/17/2007 - #3126]
    cFramePartition::clearPartitions();

    // Clear Linked Datablocks.
    mVecLinkedDatablocks.clear();

    // Reset Source Bitmap Dimensions.
    mSrcBitmapWidth = mSrcBitmapHeight = 0;

    //destroy the bitmap too just in case!
    //unloadSrcBitmap(); <---------------IF I REMOVE THIS LINE THE MANUALLY UNLOAD WORK FINE FOR ME

    // mIterations Iteration Count.
    mIterations = 0;
    // Reset Wasted Space.
    mTotalWastedSpace = 0;
    // Reset Total Space.
    mTotalSpace = 0;
    // Reset Total Frames.
    mTotalFrames = 0;
}