Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Arrays of sprites and pp256
#11
As I wrote recently, that depends on whether the resulting number of multiplying width by height is odd or even.

If it is odd, say for example "7", you have 7\2 = 3, but with 3 integers you can only store 6 bytes. You need an extra integer.

The correct expression would be:

Code:
Dimmension% = CEIL(( Width% * Height%) / 2) + 1

But the CEIL (round up) command doesn't exist in QB, so the golden rule is add 1 if w*h is even or 2 if w*h is odd.

Anyhow, if you use sprites with sizes that are powers of two, the result is always even.

I've said this tons of times: use sizes that are powers of two: the calculations are faster.
SCUMM (the band) on Myspace!
ComputerEmuzone Games Studio
underBASIC, homegrown musicians
[img]http://www.ojodepez-fanzine.net/almacen/yoghourtslover.png[/i
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)