home *** CD-ROM | disk | FTP | other *** search
/ Stars of Shareware: Programmierung / SOURCE.mdf / programm / msdos / asm / 3dvect25 / vars2.inc < prev    next >
Encoding:
Text File  |  1993-09-04  |  9.0 KB  |  269 lines

  1. ; main variable tables
  2.  
  3.            align 4
  4.  
  5. x1         dw ?                     ; points for line draw
  6. y1         dw ?
  7. x2         dw ?
  8. y2         dw ?
  9. rise       dw ?                     ; counter for draw loop
  10. showing    dw 0                     ; how many visible sides (total)
  11. pointindex dw 0                     ; indexer to points, xs[],ys[],zs[]
  12. lindex     dw ?                     ; last indexer to points,
  13. offsides   dd offset sides          ; guess...gets inc'd when object plotted
  14. numsides   dw ?                     ; number of sides total, gets trashed
  15. numpoints  dw ?                     ; number of points, gets trashed
  16. whichside  dw ?                     ; which side am i doing now
  17. firstbyte  dw ymax-ymin dup(1000)   ; table of start and end x points
  18.            dw 1000                  ; end flag, permanent
  19. lastbyte   dw ymax-ymin dup(-1000)
  20. oney       dw 1000                  ; y start for one polygon draw
  21. colq       db ?                     ; colour of this side
  22.            align 4
  23. xupdate    dw xmax,xmin-1           ; x,y update for clearing entire picture
  24. yupdate    dw ymax,ymin-1
  25. lxupdate   dw xmax,xmin-1           ; last x,y update
  26. lyupdate   dw ymax,ymin-1
  27. xad        dd ?
  28. yad        dd ?
  29. zad        dd ?
  30. vxcos      dd ?
  31. vxsin      dd ?
  32. vycos      dd ?
  33. vysin      dd ?
  34. vzcos      dd ?
  35. vzsin      dd ?
  36. steel      db ?                     ; steel flag, -1 = don't use
  37. steelc     db ?                     ; base colour for steel, taken from colq
  38. dsq        dw ?                     ; for checkfront routine
  39. esq        dw ?
  40.  
  41. traces_past dw 1                    ; contains frame speed (irq driven)
  42. frame_number dd 0                   ; number of frames total,eg 23400 = 13 mins
  43.  
  44. xp         dw maxpoints dup (?)     ; points breakdown, after rotated, 3d,
  45. yp         dw maxpoints dup (?)     ; x,y points after 3d, are actual location.
  46. zp         dw maxpoints dup (?)     ; z useless, only good during sort of sides
  47. sides      dw maxsurfaces*maxpolys dup (?) ; visible sides only here (clockwize)
  48. order      dw maxsurfaces dup (?)   ; what order to draw surfaces in.
  49. zeds       dw maxsurfaces dup (?)
  50. surfcolors dw maxsurfaces dup (?)   ; colours for those sides, high and low
  51. commands   dw maxsurfaces dup (?)   ; commands for those sides
  52.  
  53. ; variables for multiple object routine, you modify these!
  54. ;
  55. ; userotate object commands
  56. ;
  57. ; 0  = all rotations supported - full object
  58. ;
  59. ; 1  = camera rotations only - no compound, new loadpoints
  60. ;
  61. ;      object is same as when userotate=0 but will not allow any object specific
  62. ;      rotations.  this is used to speed up rendering of objects that are
  63. ;      stationary or objects that will always be pointing in the same direction.
  64. ;      make1obj routine then assumes angles = 0x, 0y, 0z
  65. ;
  66. ; 32 = bitmap - no compound, no loadpoints, no sort and no drawvect
  67. ;
  68. ;      if object is bitmap, then:
  69. ;
  70. ;      whatshape - indexer to which bitmap in bitbase list
  71. ;      xs,ys,zs  - point to bitmap location in space
  72. ;      vxs       - bitmap scaling (how big is bitmap).  note: bitmap is already
  73. ;                  scaled based on distance so you don't have to change this
  74. ;                  as the bitmap gets farther away.
  75. ;
  76. ; 64 = point - no compound, no loadpoints, no sort and no drawvect
  77. ;
  78. ;      used for bullets.  could be used for stars but if you do want to make
  79. ;      stars, make a specialized bitmap routine.  making stars as objects would
  80. ;      be too slow.  right now, bullets all have same colour, see constant in
  81. ;      equ.inc.
  82. ;
  83. ;      xs,ys,zs  - point to bullet location in space
  84.  
  85.            align 4
  86. xs         dd maxobjects+1 dup (?)  ; locations of objects
  87. ys         dd maxobjects+1 dup (?)
  88. zs         dd maxobjects+1 dup (?)
  89. xadds      dd maxobjects+1 dup (?)  ; linear velocities of objects
  90. yadds      dd maxobjects+1 dup (?)
  91. zadds      dd maxobjects+1 dup (?)
  92. vxs        dw maxobjects+1 dup (?)  ; angles of objects
  93. vys        dw maxobjects+1 dup (?)
  94. vzs        dw maxobjects+1 dup (?)
  95. vxadds     dw maxobjects+1 dup (?)  ; anglular velocities
  96. vyadds     dw maxobjects+1 dup (?)
  97. vzadds     dw maxobjects+1 dup (?)
  98. lcount     dw maxobjects+1 dup (0)  ; linear counter
  99. acount     dw maxobjects+1 dup (0)  ; angular counter
  100. whatshape  dw maxobjects dup (?)    ; shapes of objects or bitmaps (0,1,2...)
  101. userotate  db maxobjects dup (?)    ; rotation type,0 = full,1 = camera
  102.            align 4
  103. onoff      db maxobjects dup (0)    ; is object on/off
  104.  
  105. ; flags to disable/enable routines: disable = -1, enable >=0
  106.  
  107. use_clear  dw yes                 ; flag to use clear_fill routine, default=use
  108. wfollow    dw no                  ; what object are we following, -1 = none
  109. wherelook  dw no                  ; what object do we force camera to look at
  110.  
  111. oldspeed   dw ?                   ; how fast to move, temp counter
  112.  
  113. ; camera variables = last object in object list
  114.  
  115. eyex       equ d [xs+cameraobject*4] ; camera location
  116. eyey       equ d [ys+cameraobject*4]
  117. eyez       equ d [zs+cameraobject*4]
  118. eyeax      equ w [vxs+cameraobject*2] ; angles for camera
  119. eyeay      equ w [vys+cameraobject*2]
  120. eyeaz      equ w [vzs+cameraobject*2]
  121. eyexadds   equ d [xadds+cameraobject*4] ; eye location velocity
  122. eyeyadds   equ d [yadds+cameraobject*4]
  123. eyezadds   equ d [zadds+cameraobject*4]
  124. eyevxadds  equ w [vxadds+cameraobject*2] ; eye angular velocities
  125. eyevyadds  equ w [vyadds+cameraobject*2]
  126. eyevzadds  equ w [vzadds+cameraobject*2]
  127. eyelcount  equ w [lcount+cameraobject*2] ; eye linear count (how many times to move)
  128. eyeacount  equ w [acount+cameraobject*2] ; eye angular count
  129.  
  130.            align 4
  131.  
  132. ecosx      dd ?              ; multipliers of eyeax and eyeaz
  133. esinx      dd ?              ; reset at begining of each new frame
  134. ecosy      dd ?
  135. esiny      dd ?
  136. ecosz      dd ?
  137. esinz      dd ?
  138.  
  139. vcosx      dd ?              ; temp storage for object matrix calculation
  140. vsinx      dd ?              ; can be used if needed during draw
  141. vcosy      dd ?
  142. vsiny      dd ?
  143. vcosz      dd ?
  144. vsinz      dd ?
  145.  
  146. vmatrix    dd 9 dup (?)      ; 3x3 rotation matrix for object (includes eye)
  147. ematrix    dd 9 dup (?)      ; 3x3 rotation matrix for eye
  148.  
  149. ; clipping variables in memory locations, pre-calculated!
  150. ; xactual and yactual basically don't change but clipping can to allow
  151. ; windows (rear view mirror, view airplanes menu, auxilary views, rear gunner)
  152. ;
  153. ; when flipping between windows, also flip wfollow, wherelook
  154. ; oldspeed, lxupdate, lyupdate, camera variables/angles/speeds (obviously).
  155.  
  156. cliplt      dw xcenter+xmin     ; xcenter+xmin
  157. cliprt      dw xcenter+xmax-1   ; xcenter+xmax-1
  158. cliptp      dw ycenter+ymin     ; ycenter+ymin
  159. clipbt      dw ycenter+ymax-1   ; ycenter+ymax-1
  160.  
  161. xcent       dw xcenter
  162. ycent       dw ycenter
  163. ycents1     dw ycenter-1
  164. ycentp1     dw ycenter+1
  165.  
  166. xmaxxcent   dw xmax+xcenter
  167.  
  168. ymaxycent   dw ymax+ycenter
  169.  
  170. xmins       dw xmin
  171. xmins1      dw xmin-1
  172. xmaxs       dw xmax
  173. xmaxs1      dw xmax-1
  174.  
  175. ymins       dw ymin
  176. ymins1      dw ymin-1
  177. ymaxs       dw ymax
  178.  
  179. xmit        dd xmin-tolerance   ; tolerance is max object size/ratio
  180. xmat        dd xmax+tolerance
  181. ymit        dd ymin-tolerance
  182. ymat        dd ymax+tolerance
  183.  
  184. ; variables for icon scale routine
  185.  
  186. bitmap        dd ?
  187. destwidth     dw ?
  188. destheight    dw ?
  189. destx         dw ?
  190. desty         dw ?
  191.  
  192. sourcewidth   dw ?              ; workspace for icon scale routine
  193. sourceheight  dw ?
  194. decisionx     dw ?
  195. decisiony     dw ?
  196. clippedwidth  dw ?
  197. clippedheight dw ?
  198.  
  199. background dw 0                 ; background colour, must be in high and low!
  200.  
  201.            public xs
  202.            public ys
  203.            public zs
  204.            public xadds
  205.            public yadds
  206.            public zadds
  207.            public vxs
  208.            public vys
  209.            public vzs
  210.            public vxadds
  211.            public vyadds
  212.            public vzadds
  213.            public lcount
  214.            public acount
  215.            public whatshape
  216.            public userotate
  217.  
  218.            public eyex
  219.            public eyey
  220.            public eyez
  221.            public eyeax
  222.            public eyeay
  223.            public eyeaz
  224.            public eyexadds
  225.            public eyeyadds
  226.            public eyezadds
  227.            public eyevxadds
  228.            public eyevyadds
  229.            public eyevzadds
  230.            public eyelcount
  231.            public eyeacount
  232.  
  233.            public onoff
  234.  
  235.            public vmatrix
  236.            public ematrix
  237.  
  238.            public background
  239.  
  240.            public bitmap
  241.            public destwidth
  242.            public destheight
  243.            public destx
  244.            public desty
  245.  
  246.            public use_clear
  247.            public wfollow
  248.            public wherelook
  249.  
  250.            public x1
  251.            public y1
  252.            public x2
  253.            public y2
  254.            public colq
  255.            public steel
  256.  
  257.            public lxupdate
  258.            public lyupdate
  259.            public xupdate
  260.            public yupdate
  261.            public oney
  262.            public firstbyte
  263.            public lastbyte
  264.            public showing
  265.  
  266.            public traces_past
  267.            public frame_number
  268.  
  269.