SpriteBatch.cpp 1004 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. /**
  2. * Copyright (c) 2011 Nokia Corporation.
  3. *
  4. * CAUTION: This class is in very early experimental state.
  5. *
  6. */
  7. #include "SpriteBatch.h"
  8. void SpriteBatch::draw( int texture, float x, float y, float w, float h, float angle )
  9. {
  10. SpriteDrawInfo sdi;
  11. sdi.textureHandle = texture;
  12. sdi.setTargetPos( x, y );
  13. sdi.setScale( w, h );
  14. sdi.angle = angle;
  15. draw( &sdi );
  16. }
  17. void SpriteBatch::draw( int texture, float x, float y, float w, float h, float *col )
  18. {
  19. SpriteDrawInfo sdi;
  20. sdi.textureHandle = texture;
  21. sdi.setTargetPos( x, y );
  22. sdi.setScale( w, h );
  23. if (col)
  24. sdi.setColor( col );
  25. draw( &sdi );
  26. }
  27. void SpriteBatch::draw( int texture, float x, float y, float w, float h, float *col, float angle )
  28. {
  29. SpriteDrawInfo sdi;
  30. sdi.textureHandle = texture;
  31. sdi.angle = angle;
  32. sdi.setTargetPos( x, y );
  33. sdi.setScale( w, h );
  34. if (col)
  35. sdi.setColor( col );
  36. draw( &sdi );
  37. }