getdata() and setdata() = bad!

I didn’t realize just how slow getdata() and setdata() are until last night, where I have both in a tight nested loop, needless to say, framerate goes out the window! And it’s worse on 360 supposedly… so time to reorganize my ChunkManager class. I guess I’ll have to pre-populate an array of “chunks” for each sprite when they are created.

Advertisements

2 Responses to “getdata() and setdata() = bad!”

  1. Shawn Hargreaves blog is a mustread for XNA (if you’ve not been there already). He has a great on on stalls & setdata

    http://blogs.msdn.com/shawnhar/archive/2008/04/15/stalls-part-two-beware-of-setdata.aspx

    Nice site by the way. I got here off your xna forum sig.

    • cannibalcat Says:

      Yeah man, thank you. I ended up reworking the entire thing recently… runs like a charm! Shawn’s blog is great… the man is incredible… ever since the Allegro days I’ve loved his work.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: