Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: Too many sprites?  (Read 8450 times)

0 Members and 1 Guest are viewing this topic.

Nexus

  • SFML Team
  • Hero Member
  • *****
  • Posts: 6286
  • Thor Developer
    • View Profile
    • Bromeon
Re: Too many sprites?
« Reply #15 on: March 31, 2012, 05:57:13 pm »
Wasn't error-proneness one of the reasons to avoid raw arrays? So why replace them with something that's only slightly less so?
It's not slightly less, it's far less. Computing indexes is easy. Implementing memory management, an STL interface and value semantics isn't. And one can still encapsulate the computation of indexes to make it trivial.

But anyway, we're comparing different things. For two-dimensional automatic arrays, the equivalent is a nested std::array, not std::vector.

I'd rather use boost::multi_array or something similar instead of a vector with manually recalculated indices.
boost::multi_array is buggy, on MSVC++ 2010 some operations don't even compile.

By the way, why did you change your name? :)
Zloxx II: action platformer
Thor Library: particle systems, animations, dot products, ...
SFML Game Development:

Silvah

  • Guest
Re: Too many sprites?
« Reply #16 on: April 01, 2012, 10:27:39 pm »
Computing indexes is easy. Implementing memory management, an STL interface and value semantics isn't.
Yet the latter is easier for me, because I never can get the former right. I just don't remember what is multiplied by what.

boost::multi_array is buggy, on MSVC++ 2010 some operations don't even compile.
Then fix it (you'll make the world a better place! :P), or use different library - I explicitly said "or something similar", didn't I?

By the way, why did you change your name? :)
Since I'm playing the devil's advocate here quite often, I changed it to something that better reflects the reality ;)

Vovosunt

  • Jr. Member
  • **
  • Posts: 53
    • View Profile
Re: Too many sprites?
« Reply #17 on: April 02, 2012, 05:52:57 pm »
Unless you actually have 10500 DIFFERENT sprites I wouldn't do that.
You should make a tiles array/map only with the tiles that are different, then draw those tiles by moving and then rendering, not by actually making lots of sprites.

I have 7500 tiles and I'm only using 24 sprites  :P

 

anything