home *** CD-ROM | disk | FTP | other *** search
/ NEXT Generation 27 / NEXT27.iso / pc / demos / emperor / dx3.exe / SDK / SAMPLES / IKLOWNS / CGACTION.H < prev    next >
C/C++ Source or Header  |  1996-08-28  |  2KB  |  73 lines

  1. /*===========================================================================*\
  2. |
  3. |  File:        cgaction.h
  4. |
  5. |  Description: 
  6. |       
  7. |-----------------------------------------------------------------------------
  8. |
  9. |  Copyright (C) 1995-1996 Microsoft Corporation.  All Rights Reserved.
  10. |
  11. |  Written by Moss Bay Engineering, Inc. under contract to Microsoft Corporation
  12. |
  13. \*===========================================================================*/
  14.  
  15. /**************************************************************************
  16.  
  17.     (C) Copyright 1995-1996 Microsoft Corp.  All rights reserved.
  18.  
  19.     You have a royalty-free right to use, modify, reproduce and 
  20.     distribute the Sample Files (and/or any modified version) in 
  21.     any way you find useful, provided that you agree that 
  22.     Microsoft has no warranty obligations or liability for any 
  23.     Sample Application Files which are modified. 
  24.  
  25.     we do not recomend you base your game on IKlowns, start with one of
  26.     the other simpler sample apps in the GDK
  27.  
  28.  **************************************************************************/
  29.  
  30. #ifndef CGACTION_H
  31. #define CGACTION_H
  32.  
  33. #include "cgsprite.h"
  34. #include "cgsound.h"
  35. #include "cgchdll.h"
  36.  
  37. class CGameScreen;
  38.  
  39. class CGameAction
  40. {
  41. public:
  42.     CGameAction(char* pFileName, char* pActionName, DWORD objID=0);
  43.     CGameAction(char* pFileName, CGameCharSequenceInfo *pSequence, DWORD objID=0);
  44.     virtual ~CGameAction();
  45.  
  46.     virtual BOOL Activate();
  47.     virtual BOOL DeActivate();
  48.     virtual BOOL Update(int x); // change to next sprite in sequence
  49.     virtual void Render(CGameScreen* pScreen, int x, int y, BOOL revX, BOOL revY, LPRECT pDirty);
  50.  
  51.     virtual int GetCurWidth()
  52.     {
  53.         return(mpSequence->GetCurWidth());
  54.     }
  55.     virtual int GetCurHeight()
  56.     {
  57.         return(mpSequence->GetCurHeight());
  58.     }
  59.     virtual int NextSprite(int time, BOOL wrap = TRUE)
  60.     {   
  61.         return(mpSequence->NextSprite(time, wrap));
  62.     }
  63.  
  64. protected:
  65.     CGameSpriteSequence* mpSequence;
  66.     CSoundEffect    *pSoundEffect;
  67.     CSoundEffect    *pEndSoundEffect;
  68.     BOOL        fSoundOnlyWhenVisable;
  69.     int     defaultVolume;
  70. };
  71.  
  72. #endif // CGACTION_H
  73.