Advertisement
Guest User

Untitled

a guest
Feb 6th, 2016
58
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.87 KB | None | 0 0
  1. class Object {
  2. private:
  3. vec2 pos, source0, source1, dest0, dest1;
  4. float ang;
  5. map<string, float> data_float;
  6. map<string, int> data_int;
  7. map<string, string> data_string;
  8. texture tex;
  9. public:
  10. Object();
  11. Object(vec2 position);
  12. void Draw();
  13. void Update();
  14. };
  15.  
  16.  
  17. Object *activeObjects[MAX_OBJECTS];
  18.  
  19. void objectAdd(Object *object) {
  20. int _i = 0;
  21. while (_i < MAX_OBJECTS && activeObjects[_i] != NULL)
  22. _i++;
  23. if (_i < MAX_OBJECTS)
  24. activeObjects[_i] = object;
  25. }
  26.  
  27. class Object {
  28. private:
  29. vec2 pos, source0, source1, dest0, dest1;
  30. float ang;
  31. map<string, float> data_float;
  32. map<string, int> data_int;
  33. map<string, string> data_string;
  34. texture tex;
  35. public:
  36. Object() {
  37. objectAdd(this);
  38. }
  39. Object(vec2 position) {
  40. pos = position;
  41. }
  42. void Draw() {
  43. drawTexture2(tex, source0, source1, dest0, dest1, pos, ang);
  44. }
  45. void Update() {
  46. }
  47. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement