asm_draw.h 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152
  1. /*
  2. Copyright (C) 1996-1997 Id Software, Inc.
  3. This program is free software; you can redistribute it and/or
  4. modify it under the terms of the GNU General Public License
  5. as published by the Free Software Foundation; either version 2
  6. of the License, or (at your option) any later version.
  7. This program is distributed in the hope that it will be useful,
  8. but WITHOUT ANY WARRANTY; without even the implied warranty of
  9. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  10. See the GNU General Public License for more details.
  11. You should have received a copy of the GNU General Public License
  12. along with this program; if not, write to the Free Software
  13. Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
  14. */
  15. //
  16. // asm_draw.h
  17. //
  18. // Include file for asm drawing routines.
  19. //
  20. //
  21. // !!! note that this file must match the corresponding C structures at all
  22. // times !!!
  23. //
  24. // !!! if this is changed, it must be changed in r_local.h too !!!
  25. #define NEAR_CLIP 0.01
  26. // !!! if this is changed, it must be changed in r_local.h too !!!
  27. #define CYCLE 128
  28. // espan_t structure
  29. // !!! if this is changed, it must be changed in r_shared.h too !!!
  30. #define espan_t_u 0
  31. #define espan_t_v 4
  32. #define espan_t_count 8
  33. #define espan_t_pnext 12
  34. #define espan_t_size 16
  35. // sspan_t structure
  36. // !!! if this is changed, it must be changed in d_local.h too !!!
  37. #define sspan_t_u 0
  38. #define sspan_t_v 4
  39. #define sspan_t_count 8
  40. #define sspan_t_size 12
  41. // spanpackage_t structure
  42. // !!! if this is changed, it must be changed in d_polyset.c too !!!
  43. #define spanpackage_t_pdest 0
  44. #define spanpackage_t_pz 4
  45. #define spanpackage_t_count 8
  46. #define spanpackage_t_ptex 12
  47. #define spanpackage_t_sfrac 16
  48. #define spanpackage_t_tfrac 20
  49. #define spanpackage_t_light 24
  50. #define spanpackage_t_zi 28
  51. #define spanpackage_t_size 32
  52. // edge_t structure
  53. // !!! if this is changed, it must be changed in r_shared.h too !!!
  54. #define et_u 0
  55. #define et_u_step 4
  56. #define et_prev 8
  57. #define et_next 12
  58. #define et_surfs 16
  59. #define et_nextremove 20
  60. #define et_nearzi 24
  61. #define et_owner 28
  62. #define et_size 32
  63. // surf_t structure
  64. // !!! if this is changed, it must be changed in r_shared.h too !!!
  65. #define SURF_T_SHIFT 6
  66. #define st_next 0
  67. #define st_prev 4
  68. #define st_spans 8
  69. #define st_key 12
  70. #define st_last_u 16
  71. #define st_spanstate 20
  72. #define st_flags 24
  73. #define st_data 28
  74. #define st_entity 32
  75. #define st_nearzi 36
  76. #define st_insubmodel 40
  77. #define st_d_ziorigin 44
  78. #define st_d_zistepu 48
  79. #define st_d_zistepv 52
  80. #define st_pad 56
  81. #define st_size 64
  82. // clipplane_t structure
  83. // !!! if this is changed, it must be changed in r_local.h too !!!
  84. #define cp_normal 0
  85. #define cp_dist 12
  86. #define cp_next 16
  87. #define cp_leftedge 20
  88. #define cp_rightedge 21
  89. #define cp_reserved 22
  90. #define cp_size 24
  91. // medge_t structure
  92. // !!! if this is changed, it must be changed in model.h too !!!
  93. #define me_v 0
  94. #define me_cachededgeoffset 4
  95. #define me_size 8
  96. // mvertex_t structure
  97. // !!! if this is changed, it must be changed in model.h too !!!
  98. #define mv_position 0
  99. #define mv_size 12
  100. // refdef_t structure
  101. // !!! if this is changed, it must be changed in render.h too !!!
  102. #define rd_vrect 0
  103. #define rd_aliasvrect 20
  104. #define rd_vrectright 40
  105. #define rd_vrectbottom 44
  106. #define rd_aliasvrectright 48
  107. #define rd_aliasvrectbottom 52
  108. #define rd_vrectrightedge 56
  109. #define rd_fvrectx 60
  110. #define rd_fvrecty 64
  111. #define rd_fvrectx_adj 68
  112. #define rd_fvrecty_adj 72
  113. #define rd_vrect_x_adj_shift20 76
  114. #define rd_vrectright_adj_shift20 80
  115. #define rd_fvrectright_adj 84
  116. #define rd_fvrectbottom_adj 88
  117. #define rd_fvrectright 92
  118. #define rd_fvrectbottom 96
  119. #define rd_horizontalFieldOfView 100
  120. #define rd_xOrigin 104
  121. #define rd_yOrigin 108
  122. #define rd_vieworg 112
  123. #define rd_viewangles 124
  124. #define rd_ambientlight 136
  125. #define rd_size 140
  126. // mtriangle_t structure
  127. // !!! if this is changed, it must be changed in model.h too !!!
  128. #define mtri_facesfront 0
  129. #define mtri_vertindex 4
  130. #define mtri_size 16 // !!! if this changes, array indexing in !!!
  131. // !!! d_polysa.s must be changed to match !!!
  132. #define mtri_shift 4