Hey all,
I was sick and decided to waste my time by writing a MineCraft engine thingy. Everyone that I've seen making something like this has avoided memblocks, or was told to avoid memblocks, so I decided to ignore that valuable bit of advice and make mine with memblocks

Anyway enough with the rambling. It works, the Project folder is attached. The only problem now is that it's REALLY SLOW. It takes 5 seconds to make 256 blocks, and that SUCKS.
I've tracked the slowness down to this bit of code here:
function MC_DeleteSpace(chunk,pos,shift,ox,oy,oz)
rem local variables
local t as dword
local x as dword
local y as dword
local z as dword
rem loop through each byte and shift
if Chunk(chunk).FreeData > pos
for t=pos to Chunk(chunk).FreeData step 4
write memblock dword chunk+1,t,memblock dword(chunk+1,t+shift)
next t
rem shifting data means pointers also need to be shifted
for x=0 to 15
for y=0 to 127
for z=0 to 15
if Block(chunk,x,y,z).DataPointerLeft>=pos+shift then dec Block(chunk,x,y,z).DataPointerLeft,shift
if Block(chunk,x,y,z).DataPointerRight>=pos+shift then dec Block(chunk,x,y,z).DataPointerRight,shift
if Block(chunk,x,y,z).DataPointerTop>=pos+shift then dec Block(chunk,x,y,z).DataPointerTop,shift
if Block(chunk,x,y,z).DataPointerBottom>=pos+shift then dec Block(chunk,x,y,z).DataPointerBottom,shift
if Block(chunk,x,y,z).DataPointerFront>=pos+shift then dec Block(chunk,x,y,z).DataPointerFront,shift
if Block(chunk,x,y,z).DataPointerBack>=pos+shift then dec Block(chunk,x,y,z).DataPointerBack,shift
next z
next y
next x
endif
endfunction
specifically looking at this bit, this bit is REALLY slow:
rem shifting data means pointers also need to be shifted
for x=0 to 15
for y=0 to 127
for z=0 to 15
if Block(chunk,x,y,z).DataPointerLeft>=pos+shift then dec Block(chunk,x,y,z).DataPointerLeft,shift
if Block(chunk,x,y,z).DataPointerRight>=pos+shift then dec Block(chunk,x,y,z).DataPointerRight,shift
if Block(chunk,x,y,z).DataPointerTop>=pos+shift then dec Block(chunk,x,y,z).DataPointerTop,shift
if Block(chunk,x,y,z).DataPointerBottom>=pos+shift then dec Block(chunk,x,y,z).DataPointerBottom,shift
if Block(chunk,x,y,z).DataPointerFront>=pos+shift then dec Block(chunk,x,y,z).DataPointerFront,shift
if Block(chunk,x,y,z).DataPointerBack>=pos+shift then dec Block(chunk,x,y,z).DataPointerBack,shift
next z
next y
next x
It deletes all data from
pos to
pos+
shift by shifting the data coming after that section down to fill the gap. Any way to optimize this?
Thanks,
TheComet