home *** CD-ROM | disk | FTP | other *** search
/ Amiga ACS 1998 #6 / amigaacscoverdisc1998-061998.iso / games / descent / source / main / render.h < prev    next >
C/C++ Source or Header  |  1998-06-08  |  5KB  |  160 lines

  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.  
  85. #ifndef _RENDER_H
  86. #define _RENDER_H
  87.  
  88. #include "3d.h"
  89.  
  90. #include "object.h"
  91.  
  92. #define MAX_RENDER_SEGS        500
  93. #define OBJS_PER_SEG         5
  94. #define N_EXTRA_OBJ_LISTS    50
  95.  
  96. extern int    Clear_window;            //    1 = Clear whole background window, 2 = clear view portals into rest of world, 0 = no clear
  97.  
  98. void render_frame(fix eye_offset);        //draws the world into the current canvas
  99.  
  100. //cycle the flashing light for when mine destroyed
  101. flash_frame();
  102.  
  103. int find_seg_side_face(short x,short y,int *seg,int *side,int *face,int *poly);
  104.  
  105. //these functions change different rendering parameters
  106. //all return the new value of the parameter
  107.  
  108. //how may levels deep to render
  109. int inc_render_depth(void);
  110. int dec_render_depth(void);
  111. int reset_render_depth(void);
  112.  
  113. //how many levels deep to render in perspective
  114. int inc_perspective_depth(void);
  115. int dec_perspective_depth(void);
  116. int reset_perspective_depth(void);
  117.  
  118. //misc toggles
  119. int toggle_outline_mode(void);
  120. int toggle_show_only_curside(void);
  121.  
  122. // When any render function needs to know what's looking at it, it should access
  123. // Render_viewer_object members.
  124. extern fix Render_zoom;        //the player's zoom factor
  125.  
  126. //This is used internally to render_frame(), but is included here so AI
  127. //can use it for its own purposes.
  128. extern char visited[MAX_SEGMENTS];
  129.  
  130. extern int N_render_segs;
  131. extern short Render_list[MAX_RENDER_SEGS];
  132.  
  133. #ifdef EDITOR
  134. extern int Render_only_bottom;
  135. #endif
  136.  
  137.  
  138. //Set the following to turn on player head turning
  139. extern int Use_player_head_angles;
  140.  
  141. //If the above flag is set, these angles specify the orientation of the head
  142. extern vms_angvec Player_head_angles;
  143.  
  144. //
  145. //    Routines for conditionally rotating & projecting points
  146. //
  147.  
  148. //This must be called at the start of the frame if rotate_list() will be used
  149. void render_start_frame(void);
  150.  
  151. //Given a lit of point numbers, rotate any that haven't been rotated this frame
  152. g3s_codes rotate_list(int nv,short *pointnumlist);
  153.  
  154. //Given a lit of point numbers, project any that haven't been projected
  155. void project_list(int nv,short *pointnumlist);
  156.  
  157.  
  158. #endif
  159.  
  160.