Advertisement
Guest User

Untitled

a guest
Sep 30th, 2016
326
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
BlitzMax 14.59 KB | None | 0 0
  1. SuperStrict
  2. Framework sidesign.minib3d 'https://github.com/si-design/minib3d
  3. Import brl.Stream
  4. Import brl.linkedlist
  5. Import brl.standardio
  6.  
  7. 'Data sizes
  8. Const B_BYTE:Int = 1
  9. Const B_SHORT:Int = 2
  10. Const B_INT:Int = 4
  11. Const B_FLOAT:Int = 4
  12.  
  13. Graphics3D(DesktopWidth() * 0.7, DesktopHeight() * 0.7, 0, 2)
  14.  
  15. Local camera:TCamera = CreateCamera()
  16. MoveEntity(camera, 0, 0, -10)
  17.  
  18. AmbientLight(255, 255, 255)
  19.  
  20. Local myBSP:TQBSP = TQBSP.LoadFile("DM1.BSP")
  21.  
  22. 'Debug make a mesh
  23. Local mesh:TMesh = CreateMesh()
  24. Local surf:TSurface[8]
  25.  
  26. Local face:TQFace
  27. Local ledge:TQLedge
  28. Local edge:TQEdge
  29. Local vert:TQVertex
  30. Local fNr:Int
  31. Local vNr:Int
  32. Local surfNr:Int
  33. Local vertCount:Int
  34. Local newVertCount:Int
  35.  
  36. For Local model:TQModel = EachIn myBSP.Models 'Go through models
  37.     For fNr = model.Face_ID Until model.Face_ID + model.Face_Num 'Go through faces
  38.         'Debug progress
  39.         'If fNr Mod 100 <= 0 Then Print "Generating: " + fNr + "/" + model.Face_Num
  40.         face = myBSP.Faces[fNr] 'Get current face
  41.        
  42.         'Move to next surface if we're using too many vertices
  43.         If surf[surfNr] And surf[surfNr].CountVertices() > (10000 * 3) - 1 Then surfNr:+1
  44.        
  45.         'If we don't have a surface to work with, create one
  46.         If Not surf[surfNr] Then surf[surfNr] = CreateSurface(mesh, Null)
  47.        
  48.         'Get verts
  49.         newVertCount = 0
  50.         For vNr = face.Ledge_ID Until face.Ledge_ID + face.Ledge_Num 'Go through edges
  51.             ledge = myBSP.Ledges[vNr] 'Get ledge
  52.             edge = myBSP.Edges[Abs(ledge.edge)] 'Get edge via ledge
  53.            
  54.             If ledge.edge < 0 Then
  55.                 vert = myBSP.Vertices[edge.Vertex0]
  56.             Else
  57.                 vert = myBSP.Vertices[edge.Vertex1]
  58.             EndIf
  59.            
  60.             AddVertex(surf[surfNr], vert.X * 0.1, vert.Y * 0.1, vert.Z * 0.1)
  61.             vertCount:+1
  62.             newVertCount:+1
  63.         Next
  64.        
  65.         'Make Tris
  66.         For Local i:Int = vertCount - newVertCount Until vertCount
  67.             AddTriangle(surf[surfNr], i, i + 1, i + 2)
  68.         Next
  69.        
  70.     Next
  71. Next
  72.  
  73. 'Main loop
  74. While Not AppTerminate() And Not KeyDown(KEY_ESCAPE)
  75.     'Cls()
  76.     If KeyHit(KEY_O) Then Wireframe(False)
  77.     If KeyHit(KEY_P) Then Wireframe(True)
  78.    
  79.     If KeyDown(KEY_LEFT) Then TurnEntity(camera, 0, 2, 0)
  80.     If KeyDown(KEY_RIGHT) Then TurnEntity(camera, 0, -2, 0)
  81.     If KeyDown(KEY_UP) Then TurnEntity(camera, -2, 0, 0)
  82.     If KeyDown(KEY_DOWN) Then TurnEntity(camera, 2, 0, 0)
  83.    
  84.     If KeyDown(KEY_W) Then MoveEntity(camera, 0, 0, 1.5)
  85.     If KeyDown(KEY_S) Then MoveEntity(camera, 0, 0, -1.5)
  86.     If KeyDown(KEY_A) Then MoveEntity(camera, -1.5, 0, 0)
  87.     If KeyDown(KEY_D) Then MoveEntity(camera, 1.5, 0, 0)
  88.    
  89.     If KeyDown(KEY_SPACE) Then MoveEntity(camera, 0, 1, 0)
  90.     If KeyDown(KEY_LCONTROL) Then MoveEntity(camera, 0, -1, 0)
  91.    
  92.     RenderWorld()
  93.     Flip(1)
  94. Wend
  95. End
  96.  
  97. Type TQBSP
  98.     Field File:String
  99.     Field Stream:TStream
  100.    
  101.     Field Header:TQHeader
  102.    
  103.     Field PLANES:TList = CreateList()
  104.     Field Vertices:TQVertex[]
  105.     Field Nodes:TList = CreateList()
  106.     Field TexInfo:TList = CreateList()
  107.     Field Faces:TQFace[]
  108.     Field ClipNodes:TList = CreateList()
  109.     Field Leaves:TList = CreateList()
  110.     Field Edges:TQEdge[]
  111.     Field Ledges:TQLedge[]
  112.     Field Models:TQModel[]
  113.    
  114.     Function LoadFile:TQBSP(url:String)
  115.         Local nB:TQBSP = New TQBSP
  116.         nB.File = url
  117.        
  118.         If nB.Process() Then
  119.             Return nB
  120.         Else
  121.             nB.StreamError("Map ~q" + nB.file + "~q NOT loaded")
  122.             Return Null
  123.         EndIf
  124.     EndFunction
  125.    
  126.     Method StreamError(MSG:String)
  127.         If Stream Then CloseStream(Stream)
  128.         DebugLog "Read error: " + MSG
  129.     EndMethod
  130.    
  131.     Method Process:Int()
  132.         Stream = OpenStream(File)
  133.         If Not Stream Then
  134.             StreamError("Unable to read file ~q" + file + "~q")
  135.             Return False
  136.         EndIf
  137.        
  138.         Local num:Int 'For counting stuff
  139.         Local i:Int 'For loops
  140.        
  141.         'Read header
  142.         Self.Header = TQHeader.Read(Stream)
  143.        
  144.         'Read planes
  145.         'num = Self.Header.PLANES.Count(TQPlane.Size())
  146.         'DebugLog "Planes: " + num
  147.         'Self.Header.PLANES.JumpTo(Stream)
  148.         'For i = 0 Until num
  149.         '   ListAddLast(Self.PLANES, TQPlane.Read(Stream))
  150.         'Next
  151.        
  152.         'Read vertices
  153.         num = Self.Header.Vertices.Count(TQVertex.Size())
  154.         DebugLog "Vertices: " + num
  155.         Self.Vertices = New TQVertex[num]
  156.         Self.Header.Vertices.JumpTo(Stream)
  157.         For i = 0 Until num
  158.             'ListAddLast(Self.Vertices, TQVertex.Read(Stream))
  159.             Self.Vertices[i] = TQVertex.Read(Stream)
  160.         Next
  161.        
  162.         'Read nodes
  163.         'num = Self.Header.Nodes.Count(TQNode.Size())
  164.         'DebugLog "Nodes: " + num
  165.         'Self.Header.Nodes.JumpTo(Stream)
  166.         'For i = 0 Until num
  167.         '   ListAddLast(Self.Nodes, TQNode.Read(Stream))
  168.         'Next
  169.        
  170.         'Read texture info
  171.         'num = Self.Header.TexInfo.Count(TQSurface.Size())
  172.         'DebugLog "TexInfos: " + num
  173.         'Self.Header.TexInfo.JumpTo(Stream)
  174.         'For i = 0 Until num
  175.         '   ListAddLast(Self.TexInfo, TQSurface.Read(Stream))
  176.         'Next
  177.        
  178.         'Read faces
  179.         num = Self.Header.Faces.Count(TQFace.Size())
  180.         DebugLog "Faces: " + num
  181.         Self.Faces = New TQFace[num]
  182.         Self.Header.Faces.JumpTo(Stream)
  183.         For i = 0 Until num
  184.             'ListAddLast(Self.Faces, TQFace.Read(Stream))
  185.             Self.Faces[i] = TQFace.Read(Stream)
  186.         Next
  187.        
  188.         'Read clipnodes
  189.         'num = Self.Header.ClipNodes.Count(TQClipNode.Size())
  190.         'DebugLog "ClipNodes: " + num
  191.         'Self.Header.ClipNodes.JumpTo(Stream)
  192.         'For i = 0 Until num
  193.         '   ListAddLast(Self.ClipNodes, TQClipNode.Read(Stream))
  194.         'Next
  195.        
  196.         'Read leaves
  197.         'num = Self.Header.Leaves.Count(TQDLeaf.Size())
  198.         'DebugLog "Leaves: " + num
  199.         'Self.Header.Leaves.JumpTo(Stream)
  200.         'For i = 0 Until num
  201.         '   ListAddLast(Self.Leaves, TQDLeaf.Read(Stream))
  202.         'Next
  203.        
  204.         'Read edges
  205.         num = Self.Header.Edges.Count(TQEdge.Size())
  206.         DebugLog "Edges: " + num
  207.         Self.Edges = New TQEdge[num]
  208.         Self.Header.Edges.JumpTo(Stream)
  209.         For i = 0 Until num
  210.             'ListAddLast(Self.Edges, TQEdge.Read(Stream))
  211.             Self.Edges[i] = TQEdge.Read(Stream)
  212.         Next
  213.        
  214.         'Read ledges
  215.         num = Self.Header.Ledges.Count(TQLedge.Size())
  216.         DebugLog "Ledges: " + num
  217.         Self.Ledges = New TQLedge[num]
  218.         Self.Header.Ledges.JumpTo(Stream)
  219.         For i = 0 Until num
  220.             'ListAddLast(Self.Ledges, TQLedge.Read(Stream))
  221.             Self.Ledges[i] = TQLedge.Read(Stream)
  222.         Next
  223.        
  224.         'Read models
  225.         num = Self.Header.Models.Count(TQModel.Size())
  226.         DebugLog "Models: " + num
  227.         Self.Models = New TQModel[num]
  228.         Self.Header.Models.JumpTo(Stream)
  229.         For i = 0 Until num
  230.             'ListAddLast(Self.Models, TQModel.Read(Stream))
  231.             Self.Models[i] = TQModel.Read(Stream)
  232.         Next
  233.        
  234.         CloseStream(Stream)
  235.         Return True
  236.     EndMethod
  237. EndType
  238.  
  239. 'http://www.gamers.org/dEngine/quake/spec/quake-spec34/qkspec_4.htm
  240. 'char 8bit = negative byte
  241. 'u_char 8bit = byte
  242. 'short 16bit = negative short
  243. 'u_short 16bit = short
  244. 'long 32bit = int
  245. 'u_long 32bit = longer int
  246. 'float 32bit = float
  247. 'scalar_t 32bit = float
  248.  
  249. Type TQHeader
  250.     Field Version:Int
  251.     Field Entities:TQEntry
  252.     Field PLANES:TQEntry
  253.     Field MipTex:TQEntry
  254.     Field Vertices:TQEntry
  255.     Field VisiList:TQEntry
  256.     Field Nodes:TQEntry
  257.     Field TexInfo:TQEntry
  258.     Field Faces:TQEntry
  259.     Field LightMaps:TQEntry
  260.     Field ClipNodes:TQEntry
  261.     Field Leaves:TQEntry
  262.     Field LFace:TQEntry
  263.     Field Edges:TQEntry
  264.     Field Ledges:TQEntry
  265.     Field Models:TQEntry
  266.    
  267.     Function Read:TQHeader(Stream:TStream)
  268.         Local nH:TQHeader = New TQHeader
  269.        
  270.         nH.Version = ReadInt(Stream)
  271.         If nH.Version = "29" Then
  272.             DebugLog "Correct BSP version (" + nH.Version + ")"
  273.         Else
  274.             DebugLog "Warning: Wrong BSP version (" + nH.Version + ")"
  275.         EndIf
  276.        
  277.         nH.Entities = TQEntry.Read(Stream)
  278.         nH.PLANES = TQEntry.Read(Stream)
  279.        
  280.         nH.MipTex = TQEntry.Read(Stream)
  281.         nH.Vertices = TQEntry.Read(Stream)
  282.        
  283.         nH.VisiList = TQEntry.Read(Stream)
  284.         nH.Nodes = TQEntry.Read(Stream)
  285.        
  286.         nH.TexInfo = TQEntry.Read(Stream)
  287.        
  288.         nH.Faces = TQEntry.Read(Stream)
  289.        
  290.         nH.LightMaps = TQEntry.Read(Stream)
  291.         nH.ClipNodes = TQEntry.Read(Stream)
  292.        
  293.         nH.Leaves = TQEntry.Read(Stream)
  294.        
  295.         nH.LFace = TQEntry.Read(Stream)
  296.         nH.Edges = TQEntry.Read(Stream)
  297.        
  298.         nH.Ledges = TQEntry.Read(Stream)
  299.         nH.Models = TQEntry.Read(Stream)
  300.        
  301.         Return nH
  302.     EndFunction
  303. EndType
  304.  
  305. Type TQModel
  306.     Field Bound:TQBoundBox
  307.     Field Origin:TQVec3
  308.     Field Node_ID0:Int
  309.     Field Node_ID1:Int
  310.     Field Node_ID2:Int
  311.     Field Node_ID3:Int
  312.     Field NumLeafs:Int
  313.     Field Face_ID:Int
  314.     Field Face_Num:Int
  315.    
  316.     Function Read:TQModel(Stream:TStream)
  317.         Local nM:TQModel = New TQModel
  318.         nM.Bound = TQBoundBox.Read(Stream)
  319.         nM.Origin = TQVec3.Read(Stream)
  320.         nM.Node_ID0 = ReadInt(Stream)
  321.         nM.Node_ID1 = ReadInt(Stream)
  322.         nM.Node_ID2 = ReadInt(Stream)
  323.         nM.Node_ID3 = ReadInt(Stream)
  324.         nM.NumLeafs = ReadInt(Stream)
  325.         nM.Face_ID = ReadInt(Stream)
  326.         nM.Face_Num = ReadInt(Stream)
  327.         Return nM
  328.     EndFunction
  329.    
  330.     Function Size:Int()
  331.         Return (B_INT * 7) + TQBoundBox.Size() + TQVec3.Size()
  332.     EndFunction
  333. EndType
  334.  
  335. Type TQVertex
  336.     Field X:Float
  337.     Field Y:Float
  338.     Field Z:Float
  339.    
  340.     Function Read:TQVertex(Stream:TStream)
  341.         Local nV:TQVertex = New TQVertex
  342.         nV.Z = ReadFloat(Stream)
  343.         nV.X = ReadFloat(Stream)
  344.         nV.Y = ReadFloat(Stream)
  345.        
  346.         Return nV
  347.     EndFunction
  348.    
  349.     Function Size:Int()
  350.         Return B_FLOAT * 3
  351.     EndFunction
  352. EndType
  353.  
  354. Type TQSurface
  355.     Field VectorS:TQVec3
  356.     Field DistS:Float
  357.     Field VectorT:TQVec3
  358.     Field DistT:Float
  359.     Field Texture_ID:Int
  360.    
  361.     Field Animated:Int
  362.    
  363.     Function Read:TQSurface(Stream:TStream)
  364.         Local nS:TQSurface = New TQSurface
  365.         nS.VectorS = TQVec3.Read(Stream)
  366.         nS.DistS = ReadFloat(Stream)
  367.         nS.VectorT = TQVec3.Read(Stream)
  368.         nS.DistT = ReadFloat(Stream)
  369.         nS.Texture_ID = ReadInt(Stream)
  370.         nS.Animated = ReadInt(Stream)
  371.         Return nS
  372.     EndFunction
  373.    
  374.     Function Size:Int()
  375.         Return (B_FLOAT * 2) + (B_INT * 2) + (TQVec3.Size() * 2)
  376.     EndFunction
  377. EndType
  378.  
  379. Type TQEdge
  380.     Field Vertex0:Short
  381.     Field Vertex1:Short
  382.    
  383.     Function Read:TQEdge(Stream:TStream)
  384.         Local nE:TQEdge = New TQEdge
  385.         nE.Vertex0 = ReadShort(Stream)
  386.         nE.Vertex1 = ReadShort(Stream)
  387.         Return nE
  388.     EndFunction
  389.    
  390.     Function Size:Int()
  391.         Return B_SHORT * 2
  392.     EndFunction
  393. EndType
  394.  
  395. Type TQLedge
  396.     Field Edge:Int
  397.    
  398.     Function Read:TQLedge(Stream:TStream)
  399.         Local nL:TQLedge = New TQLedge
  400.         nL.Edge = ReadInt(Stream)
  401.         Return nL
  402.     EndFunction
  403.    
  404.     Function Size:Int()
  405.         Return B_INT
  406.     EndFunction
  407. EndType
  408.  
  409. Type TQFace
  410.     Field Plane_ID:Short
  411.    
  412.     Field Side:Short
  413.     Field Ledge_ID:Int
  414.    
  415.     Field Ledge_Num:Short
  416.     Field TexInfo_ID:Short
  417.    
  418.     Field TypeLight:Byte
  419.     Field BaseLight:Byte
  420.     Field Light:Byte[2]
  421.     Field LightMap:Int
  422.    
  423.     Function Read:TQFace(Stream:TStream)
  424.         Local nF:TQFace = New TQFace
  425.         nF.Plane_ID = ReadShort(Stream)
  426.         nF.Side = ReadShort(Stream)
  427.         nF.Ledge_ID = ReadInt(Stream)
  428.         nF.Ledge_Num = ReadShort(Stream)
  429.         nF.TexInfo_ID = ReadShort(Stream)
  430.         nF.TypeLight = ReadByte(Stream)
  431.         nF.BaseLight = ReadByte(Stream)
  432.         nF.Light[0] = ReadByte(Stream)
  433.         nF.Light[1] = ReadByte(Stream)
  434.         nF.LightMap = ReadInt(Stream)
  435.         Return nF
  436.     EndFunction
  437.    
  438.     Function Size:Int()
  439.         Return (B_SHORT * 4) + (B_INT * 2) + (B_BYTE * 4)
  440.     EndFunction
  441. EndType
  442.  
  443. Type TQMipHeader
  444.     Field NumTex:Int
  445.     Field Offset:Int[]
  446.    
  447.     Function Read:TQMipHeader(Stream:TStream)
  448.         Local nM:TQMipHeader = New TQMipHeader
  449.         nM.NumTex = ReadInt(Stream)
  450.        
  451.         'Should I even read this?
  452.         nM.Offset = New Int[nM.NumTex]
  453.         For Local i:Int = 0 Until nM.NumTex
  454.             nM.Offset[i] = ReadInt(Stream)
  455.         Next
  456.         Return nM
  457.     EndFunction
  458. EndType
  459.  
  460. Type TQMipTex
  461.     Field Name:String
  462.     Field width:Int
  463.     Field Height:Int
  464.     Field Offset1:Int
  465.     Field Offset2:Int
  466.     Field Offset4:Int
  467.     Field Offset8:Int
  468.    
  469.     Function Read:TQMipTex(Stream:TStream)
  470.         Local nM:TQMipTex = New TQMipTex
  471.         For Local i:Int = 0 Until 16
  472.             nM.Name:+Chr(ReadByte(Stream))
  473.         Next
  474.         nM.width = ReadInt(Stream)
  475.         nM.Height = ReadInt(Stream)
  476.         nM.Offset1 = ReadInt(Stream)
  477.         nM.Offset2 = ReadInt(Stream)
  478.         nM.Offset4 = ReadInt(Stream)
  479.         nM.Offset8 = ReadInt(Stream)
  480.         Return nM
  481.     EndFunction
  482.    
  483.     Function Size:Int()
  484.         Return (B_BYTE * 16) + (B_INT * 6)
  485.     EndFunction
  486. EndType
  487.  
  488. Type TQEntry
  489.     Field Offset:Int
  490.     Field Size:Int
  491.    
  492.     Function Read:TQEntry(Stream:TStream)
  493.         Local nE:TQEntry = New TQEntry
  494.         nE.Offset = ReadInt(Stream)
  495.         nE.Size = ReadInt(Stream)
  496.         Return nE
  497.     EndFunction
  498.    
  499.     Method Count:Int(typeSize:Int)
  500.         Return Size / typeSize
  501.     EndMethod
  502.    
  503.     Method JumpTo(Stream:TStream)
  504.         Stream.Seek(Self.Offset)
  505.     EndMethod
  506. EndType
  507.  
  508. Type TQNode
  509.     Field Plane_ID:Int
  510.    
  511.     Field Front:Short
  512.    
  513.     Field Back:Short
  514.    
  515.     Field Box:TQBBoxShort
  516.     Field Face_ID:Short
  517.     Field Face_Num:Short
  518.    
  519.     Function Read:TQNode(Stream:TStream)
  520.         Local nN:TQNode = New TQNode
  521.         nN.Plane_ID = ReadInt(Stream)
  522.         nN.Front = ReadShort(Stream)
  523.         nN.Back = ReadShort(Stream)
  524.         nN.Box = TQBBoxShort.Read(Stream)
  525.         nN.Face_ID = ReadShort(Stream)
  526.         nN.Face_Num = ReadShort(Stream)
  527.         Return nN
  528.     EndFunction
  529. EndType
  530.  
  531. Type TQDLeaf
  532.     Field Typ:Int
  533.     Field VisList:Int
  534.    
  535.     Field Bound:TQBBoxShort
  536.     Field LFace_ID:Short
  537.    
  538.     Field LFace_Num:Short
  539.     Field SndWater:Byte
  540.     Field SndSky:Byte
  541.     Field SndSlime:Byte
  542.     Field SndLava:Byte
  543.    
  544.     Function Read:TQDLeaf(Stream:TStream)
  545.         Local nD:TQDLeaf = New TQDLeaf
  546.         nD.Typ = ReadInt(Stream)
  547.         nD.VisList = ReadInt(Stream)
  548.        
  549.         nD.Bound = TQBBoxShort.Read(Stream)
  550.         nD.LFace_ID = ReadShort(Stream)
  551.        
  552.         nD.LFace_Num = ReadShort(Stream)
  553.         nD.SndWater = ReadByte(Stream)
  554.         nD.SndSky = ReadByte(Stream)
  555.         nD.SndSlime = ReadByte(Stream)
  556.         nD.SndLava = ReadByte(Stream)
  557.         Return nD
  558.     EndFunction
  559. EndType
  560.  
  561. Type TQPlane
  562.     Field Normal:TQVec3
  563.    
  564.     Field Dist:Float
  565.    
  566.     Field Typ:Int
  567.    
  568.     Function Read:TQPlane(Stream:TStream)
  569.         Local nP:TQPlane = New TQPlane
  570.         nP.Normal = TQVec3.Read(Stream)
  571.         nP.Dist = ReadFloat(Stream)
  572.         nP.Typ = ReadInt(Stream)
  573.         Return nP
  574.     EndFunction
  575. EndType
  576.  
  577. Type TQClipNode
  578.     Field PlaneNum:Int
  579.     Field Front:Short
  580.    
  581.     Field Back:Short
  582.    
  583.     Function Read:TQClipNode(Stream:TStream)
  584.         Local nC:TQClipNode = New TQClipNode
  585.         nC.PlaneNum = ReadInt(Stream)
  586.         nC.Front = ReadShort(Stream)
  587.         nC.Back = ReadShort(Stream)
  588.         Return nC
  589.     EndFunction
  590. EndType
  591.  
  592. 'Basic types
  593. Type TQVec3
  594.     Field X:Float
  595.     Field Y:Float
  596.     Field Z:Float
  597.    
  598.     Function Read:TQVec3(Stream:TStream)
  599.         Local nV:TQVec3 = New TQVec3
  600.         nV.X = ReadFloat(Stream)
  601.         nV.Y = ReadFloat(Stream)
  602.         nV.Z = ReadFloat(Stream)
  603.         Return nV
  604.     EndFunction
  605.    
  606.     Function Size:Int()
  607.         Return B_FLOAT * 3
  608.     EndFunction
  609. EndType
  610.  
  611. Type TQBoundBox
  612.     Field Minimum:TQVec3
  613.     Field Maximum:TQVec3
  614.    
  615.     Function Read:TQBoundBox(Stream:TStream)
  616.         Local nB:TQBoundBox = New TQBoundBox
  617.         nB.Minimum = TQVec3.Read(Stream)
  618.         nB.Maximum = TQVec3.Read(Stream)
  619.         Return nB
  620.     EndFunction
  621.    
  622.     Function Size:Int()
  623.             Return TQVec3.Size() * 2
  624.     EndFunction
  625. EndType
  626.  
  627. Type TQBBoxShort
  628.     Field Minimum:Short
  629.     Field Maximum:Short
  630.    
  631.     Function Read:TQBBoxShort(Stream:TStream)
  632.         Local nB:TQBBoxShort = New TQBBoxShort
  633.         nB.Minimum = ReadShort(Stream)
  634.         nB.Maximum = ReadShort(Stream)
  635.         Return nB
  636.     EndFunction
  637.    
  638.     Function Size:Int()
  639.         Return B_SHORT * 2
  640.     EndFunction
  641. EndType
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement