This is a read only copy without any forum functionality of the old Modcraft forum.
If there is anything that you would like to have removed, message me on Discord via Kaev#5208.
Big thanks to Alastor for making this copy!

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Topics - Neglected

Pages: [1]
1
Development and Presentation / [QUESTION] Parsing ADTs..
« on: November 11, 2011, 07:34:39 pm »
Hey there guys :)

Right now I'm working on a small project where I parse ADTs and WDTs and then display them in an OpenGL window. Nothing too special, just to test mah skeeeelz as it were.

Anyway, I've run into a roadblock parsing ADT files. The issue being that, while I can read every chunk header absolutely fine, and all the data from a WDT file just fine, any data in the ADT seems to be out of whack. See below for more on what I mean..

Code: [Select]
MHDR: flags=0
MHDR: OffsetInfo=0
MHDR: OffsetTex=0
MHDR: OffsetModel=0
MHDR: OffsetModelId=0
MHDR: OffsetMapObj=0
MHDR: OffsetMapObjId=0
MHDR: OffsetDoodadDef=4251
MHDR: OffsetObjDef=4243
MHDR: pad1=4235
MHDR: pad2=4227
MHDR: unk1=4219
MHDR: unk2=4211
MHDR: unk3=4168
MHDR: unk4=64
MHDR: unk5=-1097516758
MCIN: entry0={flags=1740, aSyncId=450019, MCNK_Offset=0, size=0}
MCIN: entry1={flags=1740, aSyncId=448271, MCNK_Offset=0, size=0}
...
MCIN: entry251={flags=1740, aSyncId=11271, MCNK_Offset=0, size=0}
MCIN: entry252={flags=1740, aSyncId=9523, MCNK_Offset=0, size=0}
MCIN: entry253={flags=1740, aSyncId=7775, MCNK_Offset=0, size=0}
MCIN: entry254={flags=1740, aSyncId=6027, MCNK_Offset=0, size=0}
MCIN: entry255={flags=1740, aSyncId=4279, MCNK_Offset=0, size=0}
MTEX: texture_path_34=
MCNK: flags=0
MCNK: indexX=1296257861
MCNK: indexY=0
MCNK: nLayers=1296253260
MCNK: nDoodadRefs=0
MCNK: ofsHeightMap=0

The above is an excerpt from the log that I write to every time  I parse a file. I parse a file by creating a new instance of my Chunk class (which automatically reads the Chunk header in the current input stream and automatically reverses the data so it's in BIG_ENDIAN rather than LITTLE_ENDIAN. I'm following the Wiki TO THE LETTER on the info about ADT and it jut seems that the numbers are parsing incredibly wrong. Take MCNK.nLayres, which is 1296253260, for example. It just doesn't seem right.

Any ideas on where I am going wrong?

My thoughts are that the wiki lists the ADT format in Little Endian.

EDIT: And posted in the wrong forum. Sorry, I googled and found another support post in this forum and thought "OHAI I'LL POST HERE". :c

Pages: [1]