   Rotation & Zomming not possible with master sprite sheets! (SDL)
  I'm finishing up a lot of my graphics code for a game engine I'm working on, but I've hit a snag. A couple weeks ago, I decided that while it might hit performance a bit, I would like to incorporate dynamic rotation & zooming of sprites in my engine, but not having gotten as far as I am now, I put those features on the shelf for a later date.The problem I'm having now is this. Each Sprite object contains ONLY coordinate information which the graphics engine uses to find the right points on a master sprite sheet. The sprites, themselves, do not contain their own SDL_Surfaces. I did this so that ALL the graphics code can be handled in a dedicated Graphics class and not dispersed thoughout the program. Now I'm realizing that the rotation libraries for SDL rotate SDL_Surfaces individually and if I tried to rotate the only surface I'm using (the one master sprite sheet), all the coordinate information in each individual sprite object becomes useless. Seems kind of obvious now huh?I liked the separation that I had outlined before, between graphics and sprites, but am I right in assuming that in order to do rotation with a library like SDL_gfx, I'm going to HAVE to have individual SDL_surfaces for each sprite?If that is true, I could probably use pointers in the Sprite objects to many surfaces all stored in the graphics engine. Before I rewrote a big chunk of my engine, I thought I ought to look for other opinions and ideas on this approach.[EDIT]: A friend of mine suggested I use a "temporary rotation surface". Basically, if I create a temp surface, rotate that and THEN send THAT to the main graphics buffer, my current design will still work. I haven't had enough time to mess with SDL_gfx yet so I'm not sure if that'll work or not. Does that seem plausible?[Edited by - Nate Hale on June 13, 2009 4:10:47 AM]
Quote:Original post by Nate HaleA friend of mine suggested I use a "temporary rotation surface". Basically, if I create a temp surface, rotate that and THEN send THAT to the main graphics buffer, my current design will still work. I haven't had enough time to mess with SDL_gfx yet so I'm not sure if that'll work or not. Does that seem plausible?It does. I was going to say that.   ;  Brilliant!   