View Single Post
Old 04-20-2007, 07:10 PM   #21
tk102
Well past expiration date
 
tk102's Avatar
 
Join Date: Jan 2004
Posts: 5,767
Current Game: FTL
Forum Veteran Helpful! Notable contributor 
Quote:
Another question ... What exactly is it writing? file->pixels is an array, but it doesn't supply any array index in that function call... Does the file->pixels+pitch*(ysz-i-1) add pitch*(ysz-i-1) to the memory pointer of the pixels array and then write the four bytes found in that location? Why do this instead of using an array index?
Yes that is exactly what it is doing, byte by byte. I believe this syntax was used because in the tpc.cpp file, you can see file->pixels+pitch*(ysz-i-1) is used to assign the values byte-by-byte. I think eiz just used copy/paste of the code as a mnuemonic so he could easily recognize what exactly he looping on.

Last edited by tk102; 04-21-2007 at 12:18 PM.
tk102 is offline   you may: quote & reply,