Hi, is anyone know a component (free) which allow to load files in memory and use them after.
I need to load .3ds object in memory for multiple uses and avoid a lot of i/o on hd
Thank you !
Hi, is anyone know a component (free) which allow to load files in memory and use them after.
I need to load .3ds object in memory for multiple uses and avoid a lot of i/o on hd
Thank you !
More exactly TMemoryStream:
[code=Pascal]
FS:= TFileStream.Create(FileName, fmOpenRead);
Stream:= TMemoryStream.Create;
Stream.Size:= FS.Size;
Stream.CopyFrom(FS, FS.Size);
FS.Free;
// loaded into memory
Stream.Position:=0;
Stream.Read(value, sizeof(Integer));
...
Stream.Free;
[/code]
Amnoxx
Oh, and this code appears to be an approximate replacement for return(random() & 0x01);
Phoenix Wiki
http://www.phoenixlib.net/
Phoenix Forum
http://www.pascalgamedevelopment.com/viewforum.php?f=71
You can use glmodel: http://www.noeska.com/dogl/glModel.aspx
it can even load .3ds from memorystreams :-) Even when loading a .3ds from file a stream is used and when modifying the mesh it is only changed in memory.
Only the saving of a .3ds file is a work in progres. But you can save to milkshape ascii and obj even when the file is loaded as an .3ds .
http://3das.noeska.com - create adventure games without programming
First, thank you for all your answers
About TStreams it's because i never used them But it seems cool since if i remember i can load 3ds file from a stream (i use GLScene with a custom 3ds loader from Dave Gravel), so i'll test that !
for glmodel i don't know how to use it with GLScene
Anyway thank you it will save loading time ! (beside to reduce the objects polygons too )
yeehaa the custom loader support tstream too, let's the party started !
Thank you again
(useless post sorry i had a problem but i found the solution)
edit: wow i saved 14 mb of memory by put the xml file containing user's interface texts in memory ! w/o speak of less disk access and a gain in speed
Bookmarks