View previous topic :: View next topic |
Author |
Message |
Xildjian
Joined: 08 Jan 2005 Posts: 100
|
Posted: Fri Jan 28, 2005 17:34 Post subject: |
|
|
I've tried that as well, instead of using a variable defined as a UINT8 I defined it as a UINT32. I went back to a UINT8 after reading again the gff format from bioware. If what I read is correct and the least significat byte is written first in that 32 bit word then rewritting that first byte should be ok. And, that should be exaclty where the file pointer is pointing after doing the freads. If the file is really opened in binary I should just be changing the bits.
Just an FYI: My log keeps telling me that "Wings" is label index 54 and it also happends to be field 54 if you start counting from 0. _________________ Member Shadow of Iniquity development team |
|
Back to top |
|
|
dragonsong
Joined: 08 Jan 2005 Posts: 19 Location: Salinas, CA
|
Posted: Fri Jan 28, 2005 23:26 Post subject: |
|
|
Hmm, I see, that should work. I'm used to the engine building the file from scratch, where you can't take advantage of that.
Otherwise the code looks fine, to me - but I'm no C programmer. I'll give it a compile and a whirl when I get the chance, though. Unless someone else has a bright idea. _________________ - dragonsong |
|
Back to top |
|
|
Xildjian
Joined: 08 Jan 2005 Posts: 100
|
Posted: Sat Jan 29, 2005 17:28 Post subject: |
|
|
WooHoo! Looks like I won this battle!
It seems the issue was doing the fflush before doing the fwrite operation. This appears to reposition the file pointer. So the fix was to do fgetpos to save off the current file pointer position and then do fsetpos to reset it after the fflush.
So far seems to be working great!
Thanks again for the help! _________________ Member Shadow of Iniquity development team |
|
Back to top |
|
|
|