Game Discussion > General Discussion & Download

Game startup time

<< < (4/4)

delta224:
As long as I've played this with girl packs, yes it did.
 
[Code talk]
 
 Why it was loading all the images into memory was because when you call open on a fstream object or pass it a file name for the constructor, the file is loaded into memory if it exist so that it can be worked on in memory.  Since working with memory is faster than working with the hard drive, it makes since to just load the data into memory if it exist, and work with the data in memory instead of having to constantly read and write data to and from the disk.
 
[/Code talk]
 
Sorry, it is just a pet peeve of mine that sometimes coders don't think about the side effects of what they are writing in terms of the code itself and the preformance of the code.

DocClox:
Should only buffer the first 1k? 4K? I don't know what the default buffer size is for fstream these days. Although that's still a lot more expensive than just stat()ing the file and storing the file size and path. 

I've been looking at the image loading code in cGirls, getting in a knot over all those linked lists. Maybe I'll have a go at the loading code as well. I#m halfway there already

delta224:
Eh, it still needs to load part of it.  Don't worry about the loading code too much.  It should use the file list class now.  I should have commented out the old code for future looking at, though.

DocClox:
Good enough for me :)

Navigation

[0] Message Index

[*] Previous page

Go to full version