POV-Ray : Newsgroups : povray.off-topic : New NearInfinity demo up : Re: New NearInfinity demo up Server Time
6 Sep 2024 15:19:30 EDT (-0400)
  Re: New NearInfinity demo up  
From: stbenge
Date: 12 Dec 2008 16:38:25
Message: <4942d9d1$1@news.povray.org>
stbenge wrote:
> it should run at 60 FPS regardless on your monitor's refresh rate.

Actually, it should run at whatever your monitor's refresh rate is and 
it should do it smoothly with VSYNC, without affecting the game logic.

I just caught a few bugs and uploaded a new version (with a green 
landscape). For some reason, I had forgotten to free a texture, which 
isn't good! There is now a delete for every new, and all textures and 
entities are freed up like they should be.

There is an issue that's bugging me though. Can anyone tell me why I get 
a warning when I try to delete an array of sprite objects like so:

delete [] tile;

The compiler does not complain when I delete them like this:

v=0;
for(y=0;y<8;y++){
  for(x=0;x<8;x++){
   delete tile[int(v)];
   v++;
  }
}

I don't know why. I initialized the array like this:

hgeSprite *tile[8*8]

and filled it like this:

v=0;
for(y=0;y<8;y++){
  for(x=0;x<8;x++){
   tile[int(v)]=new hgeSprite(tiles,x*132+1,y*132+1,128,128);
   v++;
  }
}

v is a float, by the way. I'm not calling int() for no reason. Should I 
have structured my "new" differently?

Sam


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.