asm_draw.h 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122
  1. //
  2. // asm_draw.h
  3. //
  4. // Include file for asm drawing routines.
  5. //
  6. //
  7. // !!! note that this file must match the corresponding C structures at all
  8. // times !!!
  9. //
  10. // !!! if this is changed, it must be changed in r_local.h too !!!
  11. #define NEAR_CLIP 0.01
  12. // !!! if this is changed, it must be changed in r_local.h too !!!
  13. #define CYCLE 128
  14. // espan_t structure
  15. // !!! if this is changed, it must be changed in r_shared.h too !!!
  16. #define espan_t_u 0
  17. #define espan_t_v 4
  18. #define espan_t_count 8
  19. #define espan_t_pnext 12
  20. #define espan_t_size 16
  21. // sspan_t structure
  22. // !!! if this is changed, it must be changed in d_local.h too !!!
  23. #define sspan_t_u 0
  24. #define sspan_t_v 4
  25. #define sspan_t_count 8
  26. #define sspan_t_pnext 12
  27. #define sspan_t_size 16
  28. // edge_t structure
  29. // !!! if this is changed, it must be changed in r_shared.h too !!!
  30. #define et_u 0
  31. #define et_u_step 4
  32. #define et_prev 8
  33. #define et_next 12
  34. #define et_surfs 16
  35. #define et_nextremove 20
  36. #define et_nearzi 24
  37. #define et_owner 28
  38. #define et_size 32
  39. // surf_t structure
  40. // !!! if this is changed, it must be changed in r_shared.h too !!!
  41. #define SURF_T_SHIFT 6
  42. #define st_next 0
  43. #define st_prev 4
  44. #define st_spans 8
  45. #define st_key 12
  46. #define st_last_u 16
  47. #define st_spanstate 20
  48. #define st_flags 24
  49. #define st_data 28
  50. #define st_entity 32
  51. #define st_nearzi 36
  52. #define st_insubmodel 40
  53. #define st_d_ziorigin 44
  54. #define st_d_zistepu 48
  55. #define st_d_zistepv 52
  56. #define st_pad 56
  57. #define st_size 64
  58. // clipplane_t structure
  59. // !!! if this is changed, it must be changed in r_local.h too !!!
  60. #define cp_normal 0
  61. #define cp_dist 12
  62. #define cp_next 16
  63. #define cp_leftedge 20
  64. #define cp_rightedge 21
  65. #define cp_reserved 22
  66. #define cp_size 24
  67. // medge_t structure
  68. // !!! if this is changed, it must be changed in model.h too !!!
  69. #define me_v 0
  70. #define me_cachededgeoffset 4
  71. #define me_size 8
  72. // mvertex_t structure
  73. // !!! if this is changed, it must be changed in model.h too !!!
  74. #define mv_position 0
  75. #define mv_size 12
  76. // refdef_t structure
  77. // !!! if this is changed, it must be changed in render.h too !!!
  78. #define rd_vrect 0
  79. #define rd_aliasvrect 20
  80. #define rd_vrectright 40
  81. #define rd_vrectbottom 44
  82. #define rd_aliasvrectright 48
  83. #define rd_aliasvrectbottom 52
  84. #define rd_vrectrightedge 56
  85. #define rd_fvrectx 60
  86. #define rd_fvrecty 64
  87. #define rd_fvrectx_adj 68
  88. #define rd_fvrecty_adj 72
  89. #define rd_vrect_x_adj_shift20 76
  90. #define rd_vrectright_adj_shift20 80
  91. #define rd_fvrectright_adj 84
  92. #define rd_fvrectbottom_adj 88
  93. #define rd_fvrectright 92
  94. #define rd_fvrectbottom 96
  95. #define rd_horizontalFieldOfView 100
  96. #define rd_xOrigin 104
  97. #define rd_yOrigin 108
  98. #define rd_vieworg 112
  99. #define rd_viewangles 124
  100. #define rd_ambientlight 136
  101. #define rd_size 140
  102. // mtriangle_t structure
  103. // !!! if this is changed, it must be changed in model.h too !!!
  104. #define mtri_facesfront 0
  105. #define mtri_vertindex 4
  106. #define mtri_size 16 // !!! if this changes, array indexing in !!!
  107. // !!! d_polysa.s must be changed to match !!!
  108. #define mtri_shift 4