Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

An array question

Status
Not open for further replies.

kristof

Programmer
Jun 2, 2000
234
BE
Hi all,

I'm coding an application in which i'd like to have the following:

3 arrays [50, 50] of string, each containing strings of 3 chars (eg: 'abc')

1 array [300] of TImage, which will contain preloaded jpg's of 120x120 pixels. Which will, ofcourse, not be shown directly but will be called like this:
Code:
someActiveImg.Picture := imgArr[i].Picture;

1 array [100] of OwnClass, where each class contains about 20 properties and a few methods.

Now, the question is, i'm using a Pentium III 800 (or something close to that, not too sure :cool: ) and it seems to be running ok, but i'm not sure if it will stay that way when the application has gained in size.

And, perhaps more important, will it run on an average PC that is slower than mine? At least, without losing speed and quality.

Hope im making a bit sense here? :)

Gtz,

Kristof
 
Hello Kristof
If you are worried about memory, is there any reson why you can't load the JPEGS from file when required?.

The size of the class array will depend on what the properies are.
You can use sizeof(X) to get the amount of memory a variable or array uses.

Generally modern Machines have loads of memory, I suppose in all cases you have to consider if you want to try to meet all requirements, or to assume users havea a modern computer.
Which is why you see 'Minimum requirements' on most applictions these days I suppose.

Steve
 
Hi steve,

Thanks for your response.

Do you mean that I shouldn't worry about it?

Well, im not using the .loadfromfile() because it will take too long.

The application i'm writing is a game (just a personnal project, no commercial intent :) ) , and ofcourse, this means that there are quite a lot images, (as mentioned above) and loading them at runtime will make the game slow down too much, creating a flicker on the screen. Thus, I want to avoid this by loading all images i need before the user can actually start playing, reducing loading times later on.

I'm pondering about a system that will allow me to reduce the amount of images that are stored in memory at the same time, but ofcourse, if loading that much images isn't a problem, there's no need to bother right? Btw, how many images can I hold safely, considering a modern day machine?

Tnx,

Kristof

PS: Since the game will be limited to only a few people, I don't really need to bother about requirements, but still I think its better to do it anyhow. (Always wanna get closer to perfection ... LOL)
 
Kristof, if you are using 120x120 jpgs then I can't see them being much more than 10k each, so storing 50 of these in memory should not be a problem, minimum spec at the moment for a new PC is 128Mb, so you could hold hundreds of images without difficulty.
I found that lots of images only became a problem when you had music in memory at the same time, and that was back in the days of Delphi 1 :) so you should be OK, as long as you are not trying to do 3D.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top