Why do this? loadfile.c(625): fractinf_len = FRACTAL_INFO_SIZE + (FRACTAL_INFO_SIZE+254)/255; Its almost like the intention is to round up to the next multiple of 255, but that would be this: 255*((FRACTAL_INFO_SIZE + 254)/255) What's the purpose of this line? I'm not getting it. -- "The Direct3D Graphics Pipeline" -- DirectX 9 draft available for download <http://www.xmission.com/~legalize/book/download/index.html> Legalize Adulthood! <http://blogs.xmission.com/legalize/>
On Mon, 2007-02-05 at 21:16 -0700, Richard wrote:
Why do this?
loadfile.c(625): fractinf_len = FRACTAL_INFO_SIZE + (FRACTAL_INFO_SIZE+254)/255;
Its almost like the intention is to round up to the next multiple of 255, but that would be this: 255*((FRACTAL_INFO_SIZE + 254)/255)
What's the purpose of this line? I'm not getting it.
I don't understand how you reached the conclusion that it would be 255*((FRACTAL_INFO_SIZE + 254)/255). Try using FRACTAL_INFO_SIZE = 1. The original line results in a value of 2, and your formula results in 255. Since the current value of FRACTAL_INFO_SIZE is 504 as defined in fractint.h, we appear to be getting fractinf_len = 506. I have no clue why we do this. Jonathan
Jonathan wrote:
Since the current value of FRACTAL_INFO_SIZE is 504 as defined in fractint.h, we appear to be getting fractinf_len = 506. I have no clue why we do this.
This is very old code - one of the first things that happened when Bert and I started working together was to save fractal info in the GIF, first after the terminator, then later in a GIF extension block. We'll probably not be able to reconstruct the exact reason, but my recollection is that the seek-from-the-bottom logic was most robust with a little extra length. I believe if the calculation gives a larger result nothing bad happens, but that needs to be checked. Tim
In article <45C8CA0E.7456.5F23C6@twegner.swbell.net>, "Tim Wegner" <twegner@swbell.net> writes:
We'll probably not be able to reconstruct the exact reason, but my recollection is that the seek-from-the-bottom logic was most robust with a little extra length. I believe if the calculation gives a larger result nothing bad happens, but that needs to be checked.
Yeah, I notice that the first seek-from-end attempt never works and it always goes through a loop until its offset is far enough back to find the fractal chunk. Is there any particular reason you don't scan from the front? "Its too slow on floppy disks"? -- "The Direct3D Graphics Pipeline" -- DirectX 9 draft available for download <http://www.xmission.com/~legalize/book/download/index.html> Legalize Adulthood! <http://blogs.xmission.com/legalize/>
Curious Rich asked:
Is there any particular reason you don't scan from the front?
Easy, there's a gazilion terabyte GIF image above the fractal info, so it's easier to seek from the bottom :-) This is one of those things that we looked at, fooled with, suddenly it worked OK and never gave any trouble since, so it stayed that way. Keep in mind that one the the first things we'll do once we stop the literal-port-to-windows phase is change how data is stored, so unless the logic is causing a problem my suggestion would be to leave it. Tim
In article <45C8DA6F.5492.BC57D@twegner.swbell.net>, "Tim Wegner" <twegner@swbell.net> writes:
Keep in mind that one the the first things we'll do once we stop the literal-port-to-windows phase is change how data is stored, so unless the logic is causing a problem my suggestion would be to leave it.
Now that I've dealt with the structure alignment, it seems to be OK. -- "The Direct3D Graphics Pipeline" -- DirectX 9 draft available for download <http://www.xmission.com/~legalize/book/download/index.html> Legalize Adulthood! <http://blogs.xmission.com/legalize/>
In article <1170807968.3893.8.camel@linux.site>, Jonathan Osuch <osuchj@avalon.net> writes:
On Mon, 2007-02-05 at 21:16 -0700, Richard wrote:
Why do this?
loadfile.c(625): fractinf_len = FRACTAL_INFO_SIZE + (FRACTAL_INFO_SIZE+254)/255;
Its almost like the intention is to round up to the next multiple of 255, but that would be this: 255*((FRACTAL_INFO_SIZE + 254)/255)
What's the purpose of this line? I'm not getting it.
I don't understand how you reached the conclusion that it would be 255*((FRACTAL_INFO_SIZE + 254)/255).
No conclusion, just stabs in the dark until I hear something squeal. As I say, I don't get the purpose of that code. -- "The Direct3D Graphics Pipeline" -- DirectX 9 draft available for download <http://www.xmission.com/~legalize/book/download/index.html> Legalize Adulthood! <http://blogs.xmission.com/legalize/>
participants (3)
-
Jonathan Osuch -
Richard -
Tim Wegner