Correct Loading Display
Ceagon Xylas

Okay, here's something I still haven't mastered in gaming which is pretty important: Loading screen percentages.
Lets say I have

class npc{
public:
  int x,y,type;
  float velX,velY;
}npc[40000];

Should have to load 560,000bytes to the memory... Which may take a long while on older computers. Well, what should I do to display how far along the loading is?

Birdeeoh

Actually, the code segment you posted shouldn't take a noticable about of time to "run" on any age machine that has enough memory... all you're doing is declaring/allocating space in memory. Even if it's initialized to zero, it won't take too long to execute...

If you're refering to some routine you have that actually performs calculations and loads data into that memory location for disk, or something, then you'll have to give a little more of an example... ;)

Ceagon Xylas

Hmm... Alright =]
So then, if I were, say loading alot of bitmaps... just use

BITMAP *frame1,frame2,frame3,frame4;
int percent;

void update_screen(); //draw int precent to the screen

void load() {
  frame1=load_pcx("",NULL);
  percent+=25; update_screen();
  frame2=load_pcx("",NULL);
  percent+=25; update_screen();
  frame3=load_pcx("",NULL);
  percent+=25; update_screen();
  frame4=load_pcx("",NULL);
  percent+=25; update_screen();
}

Right?

Kitty Cat

As long as they were of mostly similar size, and take about the same amount of time to load. If there's something more annoying than a loading screen, it's a loading screen who's load bar jumps wildly (eg. takes 30 seconds to load 30%, then 10 seconds to load up to 70, then 45 seconds to load the rest). Best to use a looping animation if you can't gaurantee proper percentage timing.

Thread #566761. Printed from Allegro.cc