My coding style is too sloppy as to reveal it to the (sometimes very harsh) criticism of the public.r3d wrote:Is your software open source or are you willing to share it?
So sry: no.
The above crash course is containing 90% of the info you need, imho.If not, can you more or less sum up the the format?
The format itself being relative simple:
Be informed that it doesn't start from file offset 0x0.
The beginning of the data and addr of face count is determined by a pattern search.
(to clearify this due to r3d's hint. Thx for it.)
Code: Select all
face count DWORD
vertex count DWORD
unknown DWORD (01 000000?)
start of tex coords block
tex 2 floats
tri faces, indices f1, f2, 00, f3 unsigned ints // 00 00 to be skipped
gap of 24 bytes
vertices 3 floats
normals 3 floats
The main job is to find the offsets of the different blocks (texture coords, face indices, vertices).
Often pattern search is very helpful. I used "paint name" for the 1st button (in the 1st version)
and 01000000.
You'll experience many findings for the 01000000 pattern in ud6_c_f3_001.dff
so the trick is - as always - to determine the right ones.
Here's an example how to get them:
Code: Select all
for (l=1;l<=lastSM;l++) {
//if (cnt==18) // Achtung! Wird VOR Ausgabe incr.
// l=l; // debug point
offs= dwSM_offsaddr[l] ; if (offs<offs2) goto _next ;
if ( (*(pFBuf+offs+8)==0)&&(*(pFBuf+offs+9)==0)) goto _next ;
if ( (*(pFBuf+offs+6)==0)&&(*(pFBuf+offs+7)==0)&&(*(pFBuf+offs+8)==0)) goto _next ;
if ( (*(pFBuf+offs-4)==0)&&(*(pFBuf+offs-3)==0)) { // dort face index 2, imma 00 00
cnt++ ; fprintf( stream, "g submesh_%d_3\n", cnt) ;
offs -= 6 ; // algo=1 statt 3
FindStringInBuf_DragonBall_onl(offs, dwFileSize, nValue, 1, lastFaceNo) ; // &offs in fct def.
offs2= offs ;
}
_next: ;
}