home *** CD-ROM | disk | FTP | other *** search
/ Collection of Hack-Phreak Scene Programs / cleanhpvac.zip / cleanhpvac / WD_SRC.ZIP / SOURCE / LASTWOLF.HPP < prev    next >
C/C++ Source or Header  |  1995-01-12  |  3KB  |  135 lines

  1. // Forward declarations.
  2. class CLine;
  3. class CPoint;
  4. class CLineArray;
  5. class CPointArray;
  6.  
  7.  
  8. typedef unsigned long UDWORD;
  9. typedef long    DWORD;
  10. typedef unsigned short  UWORD;
  11. typedef short   WORD;
  12. typedef unsigned char   UBYTE;
  13. typedef char    BYTE;
  14.  
  15. typedef WORD    Index;
  16. typedef UWORD    TextureID;
  17.  
  18. typedef DWORD    Fixed;
  19. typedef    WORD    Angle;
  20.  
  21. typedef BYTE    BOOL;
  22.  
  23.  
  24. // Main structures used throughout.
  25. //////////////////////////////////////////
  26.  
  27. typedef struct
  28. {
  29.     WORD xPos, yPos;
  30.     Fixed xVelocity, yVelocity;
  31.     
  32.     Angle facingAngle;
  33. } Player;
  34.  
  35.  
  36. typedef struct
  37. {
  38.     CLine *pRootLine;
  39.     
  40.     CLineArray *pLines;
  41.     CPointArray *pPoints;
  42.  
  43.     // The palette used in this level.
  44.     BYTE palette[768];
  45.  
  46.     // The texture for the parallaxing sky for this level.  (256x128 wall texture.)
  47.     TextureID idCurSky;
  48.     TextureID idSky1, idSky2, idSky3;
  49. } Level;
  50.  
  51.  
  52.  
  53.  
  54.  
  55. #define BAD_INDEX       32767
  56. #define BAD_TEXTURE_ID  65534
  57.  
  58. #define TRUE    1
  59. #define FALSE   0
  60.  
  61. // Angles in the angle system.
  62. //////////////////////////////////////////
  63. #define ANGLE_RES    1024
  64.  
  65. // These are just the values in the ANGLE_RES system.
  66. #define CIRCLE    1024
  67. #define PI        512
  68. #define HALF_PI    256
  69.  
  70. // The actual program won't use this much..  Just macros
  71. // to get an angle.
  72. //////////////////////////////////////////
  73. #define ANGLE_MASK    1023
  74.  
  75. // This is what you add to an angle if you want the cosine.
  76. //////////////////////////////////////////
  77. #define SIN_TO_COS_ADDER    256
  78.  
  79.  
  80. #define RADIAN_PI    3.141592654F
  81. #define RADIAN_HALFPI    1.570796327F
  82. #define RADIAN_TO_ANGLE(x)    ( (Angle)(((float)ANGLE_RES*(float)(x)) / (2.0F * PI)) )
  83.  
  84.  
  85.  
  86. // Fixed-point macros.
  87. //////////////////////////////////////////
  88. #define FIXED_SHIFT ((DWORD)15)
  89. #define FIXED_ONE    (((DWORD)1)<<((DWORD)FIXED_SHIFT))
  90. #define FIXED_HALF    (((DWORD)1)<<((DWORD)(FIXED_SHIFT-1)))
  91. #define FIX(x)    ( (DWORD)((DWORD)(x) << ((DWORD)FIXED_SHIFT)) )
  92. #define UNFIX(x)    ( (x) >> FIXED_SHIFT )
  93. #define W_UNFIX(x)    ( (WORD)((x) >> FIXED_SHIFT) )
  94. #define R_UNFIX(x)    ( (((x)%FIXED_ONE)>(FIXED_HALF)) ? (((x)>>FIXED_SHIFT)+1) : ((x)>>FIXED_SHIFT) )
  95.  
  96.  
  97. #define DIFF(x,y)   ( (x)>(y) ? (x)-(y) : (y)-(x) )
  98. #define ABS(x)  ( (x)<0 ? -(x) : (x) )
  99. #define SQR(x)    ( (x)*(x) )
  100.  
  101.  
  102.  
  103. // Standard C include files.
  104. //////////////////////////////////////////
  105. #include <stdio.h>
  106. #include <stdlib.h>
  107. #include <string.h>
  108. #include <math.h>
  109. #include <assert.h>
  110. #include <new.h>
  111.  
  112.  
  113. // Include files for my sources.
  114. //////////////////////////////////////////
  115. #include "..\System\Dynarray.hpp"
  116.  
  117. #include "..\Source\CLine.hpp"
  118. #include "..\Source\Globals.hpp"
  119. #include "..\Source\Bsp.hpp"
  120. #include "..\Source\Draw.hpp"
  121. #include "..\Source\Arrays.hpp"
  122. #include "..\Source\Texture.hpp"
  123.  
  124. #include "..\System\System.hpp"
  125. #include "..\Bsp_Gen\Bsp_Gen.hpp"
  126.  
  127. #include "..\Source\Doom_Tex.hpp"
  128.  
  129.  
  130.  
  131.  
  132.  
  133.  
  134.  
  135.