Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

99 lines
2.3 KiB

  1. #ifndef __MAZE_H__
  2. #define __MAZE_H__
  3. #include "maze_std.h"
  4. #define MAZE_GRID 12
  5. #define MAZE_CELLS (MAZE_GRID*MAZE_GRID)
  6. #define MAZE_ARRAY (MAZE_GRID+1)
  7. #define MAZE_ARRAY_CELLS (MAZE_ARRAY*MAZE_ARRAY)
  8. #define N_MAZE_PTS MAZE_ARRAY_CELLS
  9. #define N_MAZE_WALLS (2*MAZE_ARRAY_CELLS)
  10. #define MAZE_WALL_LEFT 0x0004
  11. #define MAZE_WALL_RIGHT 0x0008
  12. #define MAZE_WALL_UP 0x0010
  13. #define MAZE_WALL_DOWN 0x0020
  14. #define MAZE_CONTENTS 0x0040
  15. // Partial flags must be shifted versions of the standard flags
  16. #define MAZE_WALL_LEFT_PARTIAL 0x0080
  17. #define MAZE_WALL_RIGHT_PARTIAL 0x0100
  18. #define MAZE_WALL_UP_PARTIAL 0x0200
  19. #define MAZE_WALL_DOWN_PARTIAL 0x0400
  20. #define MAZE_PARTIAL_SHIFT 5
  21. #define WIDX_LEFT 0
  22. #define WIDX_RIGHT 1
  23. #define WIDX_UP 2
  24. #define WIDX_DOWN 3
  25. #define MAZE_CELL_SIZE 1
  26. #define MAZE_SIZE (MAZE_GRID*MAZE_CELL_SIZE)
  27. #define FMAZE_CELL_SIZE FxVal(MAZE_CELL_SIZE)
  28. #define FMAZE_SIZE FxVal(MAZE_SIZE)
  29. #define MfxToCell(mfx) FxInt(mfx)
  30. #define CellToMfx(cl) FxVal(cl)
  31. struct _Cell;
  32. #define DRAW_POLYGON 0
  33. #define DRAW_SPECIAL 1
  34. #define SPECIAL_ARG_ICOSAHEDRON 0
  35. #define SPECIAL_ARG_OCTAHEDRON 1
  36. #define SPECIAL_ARG_DODECAHEDRON 2
  37. #define SPECIAL_ARG_TETRAHEDRON 3
  38. #define SPECIAL_ARG_COUNT 4
  39. typedef struct _Object
  40. {
  41. FxPt2 p;
  42. FxValue z;
  43. FaAngle ang;
  44. FxValue w, h;
  45. int col;
  46. int draw_style;
  47. int draw_arg;
  48. TEX_ENV *pTexEnv; // ptr to texture environment
  49. int user1, user2, user3;
  50. struct _Object *next;
  51. struct _Cell *cell;
  52. } Object;
  53. typedef unsigned short WallFlags;
  54. typedef struct _Cell
  55. {
  56. WallFlags can_see;
  57. WallFlags unseen;
  58. Object *contents;
  59. struct _Wall *walls[4];
  60. } Cell;
  61. extern Cell maze_cells[MAZE_GRID][MAZE_GRID];
  62. extern float maze_height;
  63. extern double view_rot;
  64. extern int maze_walls_list;
  65. extern int gTexEnvMode;
  66. #define MAX_GOALS 10
  67. #define MAX_SPECIALS (MAX_GOALS-1)
  68. #define GOAL_END 0
  69. #define GOAL_SPECIALS 1
  70. BOOL InitMaze(IntPt2 *start_cell, struct _MazeGoal *goals, int *ngoals);
  71. void PlaceObject(Object *obj, FxValue x, FxValue y);
  72. void RemoveObject(Object *obj);
  73. void MoveObject(Object *obj, FxValue x, FxValue y);
  74. void DrawMaze(MazeView *vw);
  75. void DrawMazeWalls(void);
  76. void DrawTopView(MazeView *vw);
  77. #endif