25개 이상의 토픽을 선택하실 수 없습니다. Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

64 lines
1.1 KiB

  1. //
  2. // Deus Hax (working title)
  3. // Copyright (c) 2010 Sam Hocevar <sam@hocevar.net>
  4. //
  5. //
  6. // The Asset class
  7. // ---------------
  8. // Assets are objects that can be ticked by the game loop and/or the render
  9. // loop. Assets are implemented as one or several linked lists. See the
  10. // Ticker class for the ticking logic and the linked list implementation.
  11. //
  12. #if !defined __DH_ASSET_H__
  13. #define __DH_ASSET_H__
  14. #include <stdint.h>
  15. class Asset
  16. {
  17. friend class Ticker;
  18. friend class TickerData;
  19. public:
  20. virtual void Ref();
  21. virtual int Unref();
  22. protected:
  23. typedef enum
  24. {
  25. GROUP_BEFORE = 0,
  26. GROUP_DEFAULT,
  27. GROUP_AFTER,
  28. GROUP_COUNT
  29. }
  30. Group;
  31. Asset();
  32. virtual ~Asset();
  33. virtual Group GetGroup();
  34. virtual void TickGame(float delta_time);
  35. virtual void TickRender(float delta_time);
  36. Asset *next;
  37. int ref, destroy;
  38. #if !FINAL_RELEASE
  39. enum
  40. {
  41. STATE_IDLE = 0,
  42. STATE_PRETICK_GAME,
  43. STATE_POSTTICK_GAME,
  44. STATE_PRETICK_RENDER,
  45. STATE_POSTTICK_RENDER,
  46. }
  47. state;
  48. #endif
  49. };
  50. #endif // __DH_ASSET_H__