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

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