If anyone has (or can make) a DBP version of the .dbo loader, I would appreciate it if you could send it to me. I can't make heads nor tails out of the c++ one and am looking into doing some animation editing work.
[edit] Didn't mean to try and steal the tread just figured an example in DBP code may help Hamish as well. It doesn't even have to actually do anything just show the data orders like this .csm example.
open to read 1, "test.csm"
`version
read long 1, version
if version <> 4 and version <> 5
print "Map version not supported! Only V4.0 and V4.1 Supported."
wait key
end
endif
`groups
read long 1, groups
`if groups > 0
for i = 1 to groups
`flags
read long 1, groups_flags
`group
read long 1, groups_group
`properties
read string 1, groups_prop$
`red
read long 1, groups_red
`green
read long 1, groups_green
`blue
read long 1, groups_blue
next i
`endif
if version = 5
`Vis groups
read long 1, Vis_groups
for i = 1 to Vis_groups
`shown
read long 1, Vis_groups_shown
`red
read long 1, Vis_groups_red
`green
read long 1, Vis_groups_green
`blue
read long 1, Vis_groups_blue
next i
endif
`lightmaps
read long 1, lightmaps
for i = 1 to lightmaps
`width
read long 1, lightmaps_width
`height
read long 1, lightmaps_height
for j = 1 to lightmaps_width
for k = 1 to lightmaps_height
`rgba
read long 1, lightmaps_rgba
next k
next j
next i
`Meshes
read long 1, meshes
for i = 1 to meshes
`flags
read long 1, meshes_flags
`group
read long 1, meshes_group
`properties
read string 1, meshes_prop$
`red
read long 1, meshes_red
`green
read long 1, meshes_green
`blue
read long 1, meshes_blue
`x
read float 1, meshes_x#
`y
read float 1, meshes_y#
`z
read float 1, meshes_z#
if version = 5
`VisGroupID
read long 1, meshes_VisGroupID
endif
`surfaces
read long 1, meshes_surfaces
for j = 1 to meshes_surfaces
`flags
read long 1, meshes_surfaces_flags
`texturename
read string 1, meshes_surfaces_textname$
`lightmap
read long 1, meshes_surfaces_lightmap
`U offset
read float 1, meshes_surfaces_uOffset#
`V offset
read float 1, meshes_surfaces_vOffset#
`U scale
read float 1, meshes_surfaces_uScale#
`V scale
read float 1, meshes_surfaces_vScale#
`rotation
read float 1, meshes_surfaces_rotation#
`verts
read long 1, meshes_surfaces_verts
`triangles
read long 1, meshes_surfaces_tris
`lines
read long 1, meshes_surfaces_lines
`get verts
for k = 1 to meshes_surfaces_verts
`x
read float 1, meshes_surfaces_verts_x#
`y
read float 1, meshes_surfaces_verts_y#
`z
read float 1, meshes_surfaces_verts_z#
`nx
read float 1, meshes_surfaces_verts_nx#
`ny
read float 1, meshes_surfaces_verts_ny#
`nz
read float 1, meshes_surfaces_verts_nz#
`r
read long 1, meshes_surfaces_verts_red
`g
read long 1, meshes_surfaces_verts_green
`b
read long 1, meshes_surfaces_verts_blu
`u_text_coords
read float 1, meshes_surfaces_verts_u_text_coords#
`v_text_coords
read float 1, meshes_surfaces_verts_v_text_coords#
`w_text_coords
read float 1, meshes_surfaces_verts_w_text_coords#
`u_lightmap_coords
read float 1, meshes_surfaces_verts_u_lightmap_coords#
`v_lightmap_coords
read float 1, meshes_surfaces_verts_v_lightmap_coords#
`w_lightmap_coords
read float 1, meshes_surfaces_verts_w_lightmap_coords#
next k
`get tris
for l = 1 to meshes_surfaces_tris
`a
read long 1, meshes_surfaces_tris_a
`b
read long 1, meshes_surfaces_tris_b
`c
read long 1, meshes_surfaces_tris_c
next l
`get lines
for m = 1 to meshes_surfaces_lines
`a
read long 1, meshes_surfaces_lines_a
`b
read long 1, meshes_surfaces_lines_b
next m
next j
next i
`entities
read long 1, entities
for i = 1 to entities
`flags
read long 1, entities_flags
`groups
read long 1, entities_groups
`properties
read string 1, entities_props$
`x position
read float 1, entities_x#
`y position
read float 1, entities_y#
`z position
read float 1, entities_z#
next i
`camera position x
read float 1, cam_pos_x#
`camera position y
read float 1, cam_pos_y#
`camera position z
read float 1, cam_pos_z#
`camera pitch
read float 1, cam_pitch#
`camera yaw
read float 1, cam_yaw#
close file 1