Loading an X-file another way

Started by
5 comments, last by Denias75 22 years, 9 months ago
Hi folks! This is just another question about loading x-files. But THIS one MIGHT be different. You see: I have an archive file, much like the WAD or MPQ ones, and I have several x-files in it. Now, DX8 wants to load the x-file by a given path/filename thingy, the only thing I could provide is a pointer to the x-file. Now, does this mean that my archive file is destined to dumped into the trash can? Or does DX8 provide another function which needs a pointer to the x-file''s data in RAM, so I can load the file via the archive file''s functions, providing that pointer? Or do you have other ideas? Thanks! Alex
Advertisement
Small models can be loaded in memory first, then loaded into an ID3DXMesh object via IDirectXFile (load from memory) and D3DXLoadMeshFromXof.

Jim


Jim Adams
home.att.net/~rpgbook
Programming Role-Playing Games with DirectX 8
Thanks for the quick reply, Jim!
I guess that loading bigger meshes, like buildings etc, would require to write my own X-file reading functions, does it?
Yes, you can actually write an easy file loader. In fact, GameDev.net is in the works of posting one of my articles that shows how to parse an .X file. All you have to do is pack every mesh you have into an .X file and parse them out for the ones you need, it''s really easy!

Jim


Jim Adams
home.att.net/~rpgbook
Programming Role-Playing Games with DirectX 8
You really are going to publish an article about this problem? Will you marry me?
Heya,

Yeah, make your own loader! And even better, if you do, don''t bother .x files anymore and choose an other fileformat. The one your modelling program creates in the first place!

Since you can manage a filemanager, you should also be able tackling a fileformat!

Gr,
BoRReL
Yeah, I''ve also been thinking about creating my own file format, but I''m just too lazy
I would have to consider everything, starting from the vertex'' to animation and textures...
I mean, I want to finish this thing in THIS life!

This topic is closed to new replies.

Advertisement