logo logo

 Back to main page

The NWNX Community Forum

 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
 
bic parsing/editting in C
Goto page Previous  1, 2
 
Post new topic   Reply to topic    nwnx.org Forum Index -> Scripts and Modules
View previous topic :: View next topic  
Author Message
Xildjian



Joined: 08 Jan 2005
Posts: 100

PostPosted: Fri Jan 28, 2005 17:34    Post subject: Reply with quote

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
View user's profile Send private message
dragonsong



Joined: 08 Jan 2005
Posts: 19
Location: Salinas, CA

PostPosted: Fri Jan 28, 2005 23:26    Post subject: Reply with quote

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. Smile

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. Wink
_________________
- dragonsong
Back to top
View user's profile Send private message Visit poster's website
Xildjian



Joined: 08 Jan 2005
Posts: 100

PostPosted: Sat Jan 29, 2005 17:28    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    nwnx.org Forum Index -> Scripts and Modules All times are GMT + 2 Hours
Goto page Previous  1, 2
Page 2 of 2

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group