VBGamer |
|
Optimisation The Gilb (0 replies, 0 views) (2000-Jun-15) Hey, anybody remember the olde way of accessing surface memory by using copymemory to shift the data a pointer points at, into the beginning of an array defined by the programmer?...
Well, I was talking to a hacker friend of mine the other day, and he seemed to believe that should you shift all the data into a single dimension array, altering the contents would be faster...
Personally, I think that writing some simple ASM routines would be easier... Simply pass the surface pointer (The only thing I dont like about the VB DX wrapper is that I have a funny feeling that all Microshit do is exactly what we used to do with the memory moving etc... Which would slow down the routine) to the ASM routine, load it into a register, get an xy position, offset from the surface pointer by x + (y * (surfacewidth + pitch)), then move the new colour into the array. Easy peasy! |