Prev: International Journal of Electronics, Information and Systems (IJEIS) Call for Paper
Next: D2007: Typecasting 32 bit integer/longword to 32 bit single floating point not possible ?!? (GPU floating point format questions)
From: Skybuck Flying on 3 Jan 2010 16:55 Ok, I think it's time I show you people the correct code... however I have no time to port the Delphi code to Free Basic... Also the correct Delphi code (in full) is not yet released. However it is possible for anybody out there that is interested in a fix to fix yourself by following the following instructions: The bug is in procedure TBattlefield.Resize( ParaHeight : Tinteger; ParaWidth : Tinteger ); Find these two lines below: // now delete the old warriors mWarrior := nil; // now assign the new warriors to mWarrior mWarrior := vNewWarrior; Then add this new code below it: // *** new code ***: // generate new warriors in case the array size grew. for vY := 0 to ParaHeight-1 do begin for vX := 0 to ParaWidth-1 do begin if (vX >= vMinimumWidth) or (vY >= vMinimumHeight) then begin // the copy operator (let) will take care of proper/correct copieing :) mWarrior[ vY * ParaWidth + vX].Generate( mSimulatorSettings^ ); end; end; end; // update the mHeight and mWidth with the new ParaHeight and new ParaWidth mHeight := ParaHeight; mWidth := ParaWidth; This solves the potential resize bug ! ;) Port the code to free basic and you all done ! ;) Bye, For now Skybuck ;) :) |