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

  1. /*==========================================================================
  2.  *
  3.  *  Copyright (C) 1995-1996 Microsoft Corporation. All Rights Reserved.
  4.  *  Copyright (C) 1994-1995 ATI Technologies Inc. All Rights Reserved.
  5.  *
  6.  *  File:       foxbear.h
  7.  *  Content:    main include file
  8.  *
  9.  ***************************************************************************/
  10. #ifndef __FOXBEAR_INCLUDED__
  11. #define __FOXBEAR_INCLUDED__
  12.  
  13. #define WIN32_LEAN_AND_MEAN
  14. #include <windows.h>
  15. #include <windowsx.h> 
  16. #include <mmsystem.h>
  17. #include <ddraw.h>
  18. #include <dsound.h>
  19. #include "gfx.h"
  20. #include "fbsound.h"
  21. #include "gameproc.h"
  22. #include "fastfile.h"
  23. #include "dsutil.h"
  24.  
  25. int getint(char**p, int def);
  26.  
  27. #define QUOTE(x) #x
  28. #define QQUOTE(y) QUOTE(y)
  29. #define REMIND(str) __FILE__ "(" QQUOTE(__LINE__) "):" str
  30.  
  31. /*
  32.  * keyboard commands
  33.  */
  34. enum
  35. {
  36.     KEY_STOP = 1,
  37.     KEY_DOWN,
  38.     KEY_LEFT,
  39.     KEY_RIGHT,
  40.     KEY_UP,
  41.     KEY_JUMP,
  42.     KEY_THROW
  43. };
  44.  
  45. /*
  46.  * global data
  47.  */
  48. extern LPDIRECTDRAW             lpDD;
  49. extern LPDIRECTDRAWSURFACE      lpFrontBuffer;
  50. extern LPDIRECTDRAWSURFACE      lpBackBuffer;
  51. extern LPDIRECTDRAWSURFACE      lpStretchBuffer;
  52. extern LPDIRECTDRAWCLIPPER      lpClipper;
  53. extern DWORD                    lastKey;
  54. extern BOOL                     bModeX;         // we are in a modex mode
  55. extern BOOL                     bColorFill;     // device supports color fill
  56. extern BOOL                     bTransDest;     // we should use dest color key
  57. extern BOOL                     bColorFill;     // device supports color fill
  58. extern int                      nBufferCount;   // buffer count
  59. extern int                      CmdLineBufferCount;   // buffer count
  60. extern BOOL                     bStretch;       // stretch
  61. extern BOOL                     bFullscreen;    // run in fullscreen mode
  62. extern BOOL                     bStress;        // just keep running
  63. extern BOOL                     bUseEmulation;  // dont use HW use SW
  64. extern RECT                     GameRect;       // game is here
  65. extern SIZE                     GameSize;       // game is this size
  66. extern SIZE                     GameMode;       // display mode size
  67. extern UINT                     GameBPP;        // the bpp we want
  68. extern DWORD                    dwColorKey;     // the color key
  69. extern HWND                     hWndMain;       // the foxbear window
  70. extern RECT                     rcWindow;       // where the FoxBear window is.
  71. extern BOOL                     bIsActive;      // we are the active app.
  72. extern BOOL                     bPaused;        //
  73. extern BOOL                                             bWantSound;     // Set the default action in DSEnable
  74.  
  75. /*
  76.  * list of display modes
  77.  */
  78. struct {int w, h, bpp;} ModeList[100];
  79. int NumModes;
  80.  
  81. /*
  82.  * map a point that assumes 640x480 to the current game size.
  83.  */
  84. #define MapDX(x) (((x) * GameSize.cx) / C_SCREEN_W)
  85. #define MapDY(y) (((y) * GameSize.cy) / C_SCREEN_H)
  86. #define MapX(x)  (GameRect.left + MapDX(x))
  87. #define MapY(y)  (GameRect.top  + MapDY(y))
  88. #define MapRX(x) ((GameSize.cx == C_SCREEN_W) ? x : MapDX(x)+1)
  89. #define MapRY(y) ((GameSize.cy == C_SCREEN_H) ? y : MapDY(y)+1)
  90.  
  91. void PauseGame(void);
  92. void UnPauseGame(void);
  93.  
  94.  
  95. /*
  96.  * fn prototypes
  97.  */
  98. /* ddraw.c */
  99. extern BOOL DDEnable( void );
  100. extern BOOL DDDisable( BOOL );
  101. extern LPDIRECTDRAWSURFACE DDCreateSurface( DWORD width, DWORD height, BOOL sysmem, BOOL trans );
  102. extern BOOL DDCreateFlippingSurface( void );
  103. extern BOOL DDClear( void );
  104. extern DWORD DDColorMatch(IDirectDrawSurface *pdds, COLORREF rgb);
  105. extern void Splash( void );
  106.  
  107. extern LPVOID CMemAlloc( UINT cnt, UINT isize );
  108. extern LPVOID MemAlloc( UINT size );
  109. extern void   MemFree( LPVOID ptr );
  110.  
  111. #ifdef DEBUG
  112. extern void __cdecl Msg( LPSTR fmt, ... );
  113. #else
  114. #define Msg ; / ## /
  115. #endif
  116.  
  117. LPDIRECTDRAWPALETTE ReadPalFile( char *fname );
  118.  
  119. #endif
  120.