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

  1. /*===========================================================================*\
  2. |
  3. |  File:        cgchdll.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.     (C) Copyright 1995-1996 Microsoft Corp.  All rights reserved.
  17.  
  18.     You have a royalty-free right to use, modify, reproduce and 
  19.     distribute the Sample Files (and/or any modified version) in 
  20.     any way you find useful, provided that you agree that 
  21.     Microsoft has no warranty obligations or liability for any 
  22.     Sample Application Files which are modified. 
  23.  
  24.     we do not recomend you base your game on IKlowns, start with one of
  25.     the other simpler sample apps in the GDK
  26.  
  27.  **************************************************************************/
  28.  
  29. #ifndef CGCHDLL_H
  30. #define CGCHDLL_H
  31. // version number in CGameVersionIdent structure returned by Ident()
  32. #define RELEASE1_0  0x00010000
  33. #define GAMEID      0x6b455749  // 'Game'
  34.  
  35. struct CGameVersionIdent {
  36.     long    version;
  37.     long    id; // must be == GAMEID
  38. };
  39.  
  40. // ordinal numbers in DLL:
  41. #define EXPORTED_IDENT  1   
  42. #define EXPORTED_INFO   2
  43.  
  44. #define ACTION_COMPLETED    0
  45. #define ACTION_KILLME       -1
  46.  
  47. class CGameCharacter;
  48. class CGameLevel;
  49. typedef int (*pActionFunction)(CGameCharacter *mythis, CGameLevel *mylevel);
  50. typedef int (*pCollideFunction)(CGameCharacter *mythis, CGameCharacter * otherthis, CGameLevel *mylevel);
  51.  
  52. struct CGameCharSoundInfo {
  53.     char *  Sound;
  54.     char *  SoundEnd;
  55.     int Rate;
  56.     int Loop;
  57. };
  58.  
  59. struct CGameCharSequenceInfo {
  60.     char    * SequenceFile;
  61.     char    * SequenceName;
  62.     int     Rate;
  63.     CGameCharSoundInfo Sound;
  64. };
  65.  
  66. struct CGameCharInfo {
  67.     char    *name ;
  68.     int     NumSequences;
  69.     CGameCharSequenceInfo * Sequences;
  70.  
  71.     pActionFunction Create;
  72.     pActionFunction Action;
  73.     pActionFunction Destroy;
  74.     pActionFunction RemoteAction;
  75.     pCollideFunction Collide;
  76. };
  77.  
  78. struct CGameInfo {
  79.     int numcharacters;
  80.     CGameCharInfo **characters;
  81. };
  82.  
  83. // functions exported by each character DLL
  84. // exported as EXPORTED_IDENT:
  85. #if defined(__BORLANDC__) || defined(__WATCOMC__)
  86. extern "C" void CALLBACK Ident (CGameVersionIdent *);
  87.  
  88. // exported as EXPORTED_INFO:
  89. extern "C" void CALLBACK Info (CGameInfo *);
  90. #else
  91. void CALLBACK Ident (CGameVersionIdent *);
  92.  
  93. // exported as EXPORTED_INFO:
  94. void CALLBACK Info (CGameInfo *);
  95. #endif
  96. #endif
  97.