Array question
BlitzMax Forums/BlitzMax Beginners Area/Array question
| ||
Hi, I have an array Global A_MyArray:Byte[ 1024*1024 ] The array is cleared every frame. I'm sure it is quicker to write an int 4 times less than byte. How do I access the array with ints I'm sure you have to use Int Ptr but can't get it to work? Jim |
| ||
Local jim:int ptr = Int Ptr( Byte Ptr( A_MyArray ) ) jim[] = int values Is this right? |
| ||
Just a quick question. (I guess if you make an int array straight after you can just minus array index, but Im not sure) Why is it cleared every frame? That is, is it cleared then written to? In which case dont clear new plan, Get the pointer to start, then int poke 4096 times |
| ||
For large arrays its probably faster to just call MemClear (or memset for C diehards). |
| ||
thanks |