Asset Compiler

Blitz3D Forums/Blitz3D Programming/Asset Compiler

The forum is locked. These are the original blitzbasic.com forums, kept so they can still be read. No new topics, replies or edits can be made here. To join in, head over to the Blitz3D+ forums.

B3d files are binary, but open one up in Notepad, and you can see that all of the textures it uses are still just normal text. As for code to read and write b3d files, look in the Specs and Utils link up above, and there's some sample code for reading b3d files. If all you want to do though is extract file names from the b3d file, then you could try something like this:

Type B3dTexture
	Field FileName$
End Type

Function GetB3dTextures(B3dFile)
	While Not Eof(B3dFile)
		Byte=ReadByte(B3dFile)
		If Byte > 32
			NewName$=NewName$+Chr(Byte)	
		Else
			If NewName$ <> ""
				Tex.B3dTexture=New B3dTexture
				Tex\FileName$=Trim(NewName$)
			EndIf
		EndIf
	Wend
	For Tex.B3dTexture=Each B3dTexture
		If Len(Tex\FileName$)=1
			Delete Tex
		Else
			If Instr(Tex\FileName$,".")=False
				Delete Tex
			EndIf
		EndIf
	Next
End Function


The 'B3dFile' parameter should be an open file handle (using OpenFile() or ReadFile()). Once it's done, you should have a list of all the files in the B3d file. Just loop through the B3dTexture type to read all of them. Hope that's what you're looking for.