incbin models

BlitzMax Forums/MiniB3D Module/incbin models

*(Posted 2012) [#1]
I know you can incbin textures and loads them with as normal but it doesnt seem to work with textures the LoadMesh( "incbin::MyMesh.b3d" ) just fails and gives a box where the mesh should be.

Anyone have any ideas on this one as its a shame its not something that is put into minib3d, IIRC I requested it years ago and Si said it would be in there but never put it in.


kfprimm(Posted 2012) [#2]
Take a look here: https://github.com/si-design/minib3d/blob/master/sidesign.mod/minib3d.mod/inc/TModel.bmx

Change line 9 to,
file=LittleEndianStream(OpenStream(f_name$))


And after line 307 add,
If tex[tex_no] = Null
  tex[tex_no]=TTexture.LoadTexture:TTexture("incbin::"+te_file$,te_flags,tex[tex_no])
End If


This is just a quick fix I came up with in five minutes, totally untested, but should steer you in the right direction.


*(Posted 2012) [#3]
Thanks kfprimm will have a look