Well we are using Assembly (bare bone to actualy set memory) so it is actualy faster to [set/read] then the memblock commands...
EXPORTC int get_map_tile(int x, int y, int z)
{
int retval;
__asm {
mov ebx, [x]
cmp ebx, [mapx]
jge noway
mov eax, [y]
cmp eax, [mapy]
jge noway
imul eax, [mapystride]
add ebx, eax
mov eax, [z]
cmp eax, [mapz]
jge noway
imul eax, [mapzstride]
add ebx, eax
add ebx, [pMap]
xor eax, eax
mov al, [ebx] // only a byte
mov [retval], eax
jmp fin
noway: xor eax, eax
fin:
}
return retval;
}
wich is faster then this (original dbc code)
function readtile(x,y,z)
if x<1 then exitfunction 0
if y<1 then exitfunction 0
if z<1 then exitfunction 0
if x>1000 then exitfunction 0
if y>200 then exitfunction 0
if z>1000 then exitfunction 0
pos=((x*1000)-1000)+z+((y*1000000)-1000000)
if get memblock size(1)=<pos then exitfunction 0
value=memblock byte(1,pos)
endfunction value
But we are still using a memblock yes! its just being set quicker then dbp can as far as i know......
I havent seen how tgc sets its memory so i wouldnt beable to compair assembly code....if thats what they used.
If tgc's code is quicker.....processing that chunk i have posted above is not faster then calling to the dll extension to do the job. not even close!
The other best thing we have is actualy the lz4 high speed compression. It turns your 190meg save file into just over 3 mega bytes and can load and save in under 2 seconds. I could never get that file size and speed out of darkbasic.....theres no way! So dlls can speedup your processes greatly.
Here is a current screen shot up to date (ignore my little green alien....hes not finished and i was using him for testing)