RENDER.H 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160
  1. /*
  2. THE COMPUTER CODE CONTAINED HEREIN IS THE SOLE PROPERTY OF PARALLAX
  3. SOFTWARE CORPORATION ("PARALLAX"). PARALLAX, IN DISTRIBUTING THE CODE TO
  4. END-USERS, AND SUBJECT TO ALL OF THE TERMS AND CONDITIONS HEREIN, GRANTS A
  5. ROYALTY-FREE, PERPETUAL LICENSE TO SUCH END-USERS FOR USE BY SUCH END-USERS
  6. IN USING, DISPLAYING, AND CREATING DERIVATIVE WORKS THEREOF, SO LONG AS
  7. SUCH USE, DISPLAY OR CREATION IS FOR NON-COMMERCIAL, ROYALTY OR REVENUE
  8. FREE PURPOSES. IN NO EVENT SHALL THE END-USER USE THE COMPUTER CODE
  9. CONTAINED HEREIN FOR REVENUE-BEARING PURPOSES. THE END-USER UNDERSTANDS
  10. AND AGREES TO THE TERMS HEREIN AND ACCEPTS THE SAME BY USE OF THIS FILE.
  11. COPYRIGHT 1993-1998 PARALLAX SOFTWARE CORPORATION. ALL RIGHTS RESERVED.
  12. */
  13. /*
  14. * $Source: f:/miner/source/main/rcs/render.h $
  15. * $Revision: 2.0 $
  16. * $Author: john $
  17. * $Date: 1995/02/27 11:33:00 $
  18. *
  19. * Header for rendering-based functions
  20. *
  21. * $Log: render.h $
  22. * Revision 2.0 1995/02/27 11:33:00 john
  23. * New version 2.0, which has no anonymous unions, builds with
  24. * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
  25. *
  26. * Revision 1.17 1994/11/30 12:33:33 mike
  27. * prototype Clear_window.
  28. *
  29. * Revision 1.16 1994/11/02 16:19:52 matt
  30. * Increased size of extra object buffer
  31. *
  32. * Revision 1.15 1994/07/25 00:02:49 matt
  33. * Various changes to accomodate new 3d, which no longer takes point numbers
  34. * as parms, and now only takes pointers to points.
  35. *
  36. * Revision 1.14 1994/07/24 14:37:42 matt
  37. * Added angles for player head
  38. *
  39. * Revision 1.13 1994/06/24 17:01:34 john
  40. * Add VFX support; Took Game Sequencing, like EndGame and stuff and
  41. * took it out of game.c and into gameseq.c
  42. *
  43. * Revision 1.12 1994/06/16 10:55:57 matt
  44. * Made a bunch of test code dependent on #defines
  45. *
  46. * Revision 1.11 1994/06/01 00:01:36 matt
  47. * Added mine destruction flashing effect
  48. *
  49. * Revision 1.10 1994/05/22 18:47:36 mike
  50. * make Render_list a globally accessible variable.
  51. *
  52. * Revision 1.9 1994/05/22 15:29:32 mike
  53. * Separation of lighting from render.c to lighting.c.
  54. *
  55. * Revision 1.8 1994/05/14 17:59:39 matt
  56. * Added extern.
  57. *
  58. * Revision 1.7 1994/05/14 17:15:17 matt
  59. * Got rid of externs in source (non-header) files
  60. *
  61. * Revision 1.6 1994/02/17 11:32:41 matt
  62. * Changes in object system
  63. *
  64. * Revision 1.5 1994/01/21 17:31:48 matt
  65. * Moved code from render_frame() to caller, making code cleaner
  66. *
  67. * Revision 1.4 1994/01/06 09:46:12 john
  68. * Added removable walls... all code that checked for
  69. * children to see if a wall was a doorway, i changed
  70. * to yuan's wall_is_doorway function that is in wall.c...
  71. * doesn't work yet.
  72. *
  73. * Revision 1.3 1994/01/05 11:25:47 john
  74. * Changed Player_zoom to Render_zoom
  75. *
  76. * Revision 1.2 1994/01/05 10:53:43 john
  77. * New object code by John.
  78. *
  79. * Revision 1.1 1993/11/04 14:01:43 matt
  80. * Initial revision
  81. *
  82. *
  83. */
  84. #ifndef _RENDER_H
  85. #define _RENDER_H
  86. #include "3d.h"
  87. #include "object.h"
  88. #define MAX_RENDER_SEGS 500
  89. #define OBJS_PER_SEG 5
  90. #define N_EXTRA_OBJ_LISTS 50
  91. extern int Clear_window; // 1 = Clear whole background window, 2 = clear view portals into rest of world, 0 = no clear
  92. void render_frame(fix eye_offset); //draws the world into the current canvas
  93. //cycle the flashing light for when mine destroyed
  94. flash_frame();
  95. int find_seg_side_face(short x,short y,int *seg,int *side,int *face,int *poly);
  96. //these functions change different rendering parameters
  97. //all return the new value of the parameter
  98. //how may levels deep to render
  99. int inc_render_depth(void);
  100. int dec_render_depth(void);
  101. int reset_render_depth(void);
  102. //how many levels deep to render in perspective
  103. int inc_perspective_depth(void);
  104. int dec_perspective_depth(void);
  105. int reset_perspective_depth(void);
  106. //misc toggles
  107. int toggle_outline_mode(void);
  108. int toggle_show_only_curside(void);
  109. // When any render function needs to know what's looking at it, it should access
  110. // Render_viewer_object members.
  111. extern fix Render_zoom; //the player's zoom factor
  112. //This is used internally to render_frame(), but is included here so AI
  113. //can use it for its own purposes.
  114. extern char visited[MAX_SEGMENTS];
  115. extern int N_render_segs;
  116. extern short Render_list[MAX_RENDER_SEGS];
  117. #ifdef EDITOR
  118. extern int Render_only_bottom;
  119. #endif
  120. //Set the following to turn on player head turning
  121. extern int Use_player_head_angles;
  122. //If the above flag is set, these angles specify the orientation of the head
  123. extern vms_angvec Player_head_angles;
  124. //
  125. // Routines for conditionally rotating & projecting points
  126. //
  127. //This must be called at the start of the frame if rotate_list() will be used
  128. void render_start_frame(void);
  129. //Given a lit of point numbers, rotate any that haven't been rotated this frame
  130. g3s_codes rotate_list(int nv,short *pointnumlist);
  131. //Given a lit of point numbers, project any that haven't been projected
  132. void project_list(int nv,short *pointnumlist);
  133. #endif