home *** CD-ROM | disk | FTP | other *** search
/ PC Format (South-Africa) 2001 June / PCFJune.iso / Xenon / XenonSource.exe / xenon / source / retroengine.cpp < prev    next >
Encoding:
C/C++ Source or Header  |  2000-07-19  |  1.3 KB  |  60 lines

  1. //-------------------------------------------------------------
  2. //
  3. // Class:    CRetroEngine
  4. //
  5. // Author:    John M Phillips
  6. //
  7. // Started:    06/05/00
  8. //
  9. // Base:    CEngine
  10. //
  11. // Derived:    None
  12. //
  13. //-------------------------------------------------------------
  14.  
  15. #include "game.h"
  16.  
  17. //-------------------------------------------------------------
  18.  
  19. CRetroEngine::CRetroEngine()
  20. {
  21.     m_direction = RETRO_NW;
  22. }
  23.  
  24. //-------------------------------------------------------------
  25.  
  26. CRetroEngine::~CRetroEngine()
  27. {
  28. }
  29.  
  30. //-------------------------------------------------------------
  31.  
  32. bool CRetroEngine::draw()
  33. {
  34.     if (getOwner() &&
  35.         getOwner()->getActorInfo().m_type == ACTOR_TYPE_SHIP &&
  36.         ((CShip *) getOwner())->isCloaked())
  37.         return true;
  38.  
  39.     if (m_thrust > 0) {
  40.         switch (m_direction) {
  41.             case RETRO_NW:    animate(ANIMATE_LOOP,0,2);    break;
  42.             case RETRO_NE:    animate(ANIMATE_LOOP,2,2);    break;
  43.             case RETRO_SW:    animate(ANIMATE_LOOP,4,2);    break;
  44.             case RETRO_SE:    animate(ANIMATE_LOOP,6,2);    break;
  45.             }
  46.         CActor::draw();
  47.         }
  48.  
  49.     return true;
  50. }
  51.  
  52. //-------------------------------------------------------------
  53.  
  54. void CRetroEngine::setDirection(RetroDirection direction)
  55. {
  56.     m_direction = direction;
  57. }
  58.  
  59. //-------------------------------------------------------------
  60.