[46] | 1 | Public Type LWOPolygon
|
---|
| 2 | NumVe As Integer
|
---|
| 3 | P1 As Integer
|
---|
| 4 | P2 As Integer
|
---|
| 5 | P3 As Integer
|
---|
| 6 | Surfa As Integer
|
---|
| 7 | End Type
|
---|
| 8 |
|
---|
| 9 | Public Type PolDef
|
---|
| 10 | P1 As Integer
|
---|
| 11 | P2 As Integer
|
---|
| 12 | P3 As Integer
|
---|
| 13 | End Type
|
---|
| 14 |
|
---|
| 15 | 'Texture Coordinate Entry
|
---|
| 16 | Public Type TXCAentry
|
---|
| 17 | X As Single
|
---|
| 18 | Y As Single
|
---|
| 19 | End Type
|
---|
| 20 |
|
---|
| 21 | 'Texture Coordinate Lists
|
---|
| 22 | Public Type TXCA 'Length
|
---|
| 23 | ID As Long '4
|
---|
| 24 | Version As Long '8
|
---|
| 25 | Filler(1 To 5) As Long '28
|
---|
| 26 | NumEntries As Long '32
|
---|
| 27 | End Type
|
---|
| 28 |
|
---|
| 29 | 'Level Data Reference List
|
---|
| 30 | Public Type ONLV 'Length
|
---|
| 31 | ID As Long '4
|
---|
| 32 | Version As Long '8
|
---|
| 33 | LevelName As String * 64 '72
|
---|
| 34 | AKEVid As Long '76
|
---|
| 35 | OBOAid As Long '80
|
---|
| 36 | ONMAid As Long '84
|
---|
| 37 | ONFAid As Long '88
|
---|
| 38 | ONTAid As Long '92
|
---|
| 39 | ONSKid As Long '96
|
---|
| 40 | Unkn As Long '100
|
---|
| 41 | AISAid As Long '104
|
---|
| 42 | AITRid As Long '108
|
---|
| 43 | ONSAid As Long '112
|
---|
| 44 | OBDCid As Long '116
|
---|
| 45 | ONOAid As Long '120
|
---|
| 46 | Fill(1 To 161) As Long '764
|
---|
| 47 | CRSAid As Long '768
|
---|
| 48 | End Type
|
---|
| 49 |
|
---|
| 50 | Public Type AGQG
|
---|
| 51 | ID As Long
|
---|
| 52 | unk(1 To 24) As Byte
|
---|
| 53 | NumEntries As Long
|
---|
| 54 | End Type
|
---|
| 55 |
|
---|
| 56 | Public Type AGQGEntry
|
---|
| 57 | VertIndex(1 To 4) As Long
|
---|
| 58 | VertUVIndex(1 To 4) As Long
|
---|
| 59 | LData_1(1 To 4) As Byte
|
---|
| 60 | LData_2(1 To 4) As Byte
|
---|
| 61 | LData_3(1 To 4) As Byte
|
---|
| 62 | LData_4(1 To 4) As Byte
|
---|
| 63 | unk(1 To 2) As Long
|
---|
| 64 | End Type
|
---|
| 65 |
|
---|
| 66 | Public Type AGQREntry
|
---|
| 67 | TexIndex As Integer
|
---|
| 68 | unk As Integer
|
---|
| 69 | End Type
|
---|
| 70 |
|
---|
| 71 | Public Type TXMA
|
---|
| 72 | ID As Long
|
---|
| 73 | shit(1 To 24) As Byte
|
---|
| 74 | NumEntries As Long
|
---|
| 75 | End Type
|
---|
| 76 |
|
---|
| 77 | Public Type TXMAEntry
|
---|
| 78 | TXMP_ID As Long
|
---|
| 79 | End Type
|
---|
| 80 |
|
---|
| 81 |
|
---|
| 82 |
|
---|
| 83 |
|
---|
| 84 |
|
---|
| 85 | Public Sub CExportONLV(Optional FileName As String)
|
---|
| 86 | Form1.StatusBar1.SimpleText = "Status: Extracting LEVEL....."
|
---|
| 87 | Dim ID4 As Long
|
---|
| 88 | Dim I As Long
|
---|
| 89 | Dim L As Long
|
---|
| 90 | Dim LwoP() As LWOPolygon
|
---|
| 91 | Dim OniPol2() As PolDef
|
---|
| 92 | Dim NP As Long
|
---|
| 93 | Dim numb As Long
|
---|
| 94 |
|
---|
| 95 | Dim TXMA1 As TXMA
|
---|
| 96 | Dim AGQR1 As TXMA
|
---|
| 97 | Dim TXCA1 As TXCA
|
---|
| 98 | Dim TXCA_E() As TXCAentry
|
---|
| 99 | Dim TXMA_E() As TXMAEntry
|
---|
| 100 | Dim AGQR_E() As AGQREntry
|
---|
| 101 | Dim TexNames() As String
|
---|
| 102 |
|
---|
| 103 | If FileName = "" Then
|
---|
| 104 | Form1.CD.DialogTitle = "Unpack resource..."
|
---|
| 105 | Form1.CD.FileName = OniEntry(Curr).szTagName
|
---|
| 106 | Form1.CD.Filter = "LightWave (*.lwo)|*.lwo"
|
---|
| 107 | Form1.CD.Flags = &H2 + &H4
|
---|
| 108 | Form1.CD.ShowSave
|
---|
| 109 | FileName = Form1.CD.FileName
|
---|
| 110 | If FileName = "" Then Exit Sub
|
---|
| 111 | End If
|
---|
| 112 |
|
---|
| 113 | DoEvents
|
---|
| 114 |
|
---|
| 115 | Open DatFile For Binary As #1
|
---|
| 116 | Get 1, OniEntry(Curr).rDataPosition, ONLV
|
---|
| 117 | For I = 0 To UBound(OniEntry) - 1
|
---|
| 118 | Get 1, OniEntry(I).rDataPosition, ID4
|
---|
| 119 | If ID4 = ONLV.AKEVid Then
|
---|
| 120 | Get 1, OniEntry(I).rDataPosition, AKEV
|
---|
| 121 | Exit For
|
---|
| 122 | End If
|
---|
| 123 | Next I
|
---|
| 124 |
|
---|
| 125 | 'Find ID of PNTA
|
---|
| 126 | For I = 0 To UBound(OniEntry) - 1
|
---|
| 127 | Get 1, OniEntry(I).rDataPosition, ID4
|
---|
| 128 | If ID4 = AKEV.PNTAid Then
|
---|
| 129 | Get 1, OniEntry(I).rDataPosition, PNTA
|
---|
| 130 | ReDim PNTAentry(PNTA.NumEntries - 1)
|
---|
| 131 | Get 1, , PNTAentry
|
---|
| 132 | Exit For
|
---|
| 133 | End If
|
---|
| 134 | Next I
|
---|
| 135 |
|
---|
| 136 | For I = 0 To UBound(OniEntry) - 1
|
---|
| 137 | Get 1, OniEntry(I).rDataPosition, ID4
|
---|
| 138 | If ID4 = AKEV.AGQGid Then
|
---|
| 139 | Get 1, OniEntry(I).rDataPosition, AGQG
|
---|
| 140 | ReDim AGQGEntry(AGQG.NumEntries - 1)
|
---|
| 141 | Get 1, , AGQGEntry
|
---|
| 142 | Exit For
|
---|
| 143 | End If
|
---|
| 144 | Next I
|
---|
| 145 |
|
---|
| 146 | 'TXCA
|
---|
| 147 | For I = 0 To UBound(OniEntry) - 1
|
---|
| 148 | Get 1, OniEntry(I).rDataPosition, ID4
|
---|
| 149 | If ID4 = AKEV.TXCAid Then
|
---|
| 150 | Get 1, OniEntry(I).rDataPosition, TXCA1
|
---|
| 151 | ReDim TXCA_E(TXCA1.NumEntries - 1)
|
---|
| 152 | Get 1, , TXCA_E
|
---|
| 153 | ReDim Preserve TXCA_E(PNTA.NumEntries - 1)
|
---|
| 154 | Exit For
|
---|
| 155 | End If
|
---|
| 156 | Next I
|
---|
| 157 |
|
---|
| 158 | 'TXMA
|
---|
| 159 | For I = 0 To UBound(OniEntry) - 1
|
---|
| 160 | Get 1, OniEntry(I).rDataPosition, ID4
|
---|
| 161 | If ID4 = AKEV.TXMAid Then
|
---|
| 162 | Get 1, OniEntry(I).rDataPosition, TXMA1
|
---|
| 163 | ReDim TXMA_E(TXMA1.NumEntries - 1)
|
---|
| 164 | Get 1, , TXMA_E
|
---|
| 165 | Exit For
|
---|
| 166 | End If
|
---|
| 167 | Next I
|
---|
| 168 |
|
---|
| 169 | 'AGQR
|
---|
| 170 | For I = 0 To UBound(OniEntry) - 1
|
---|
| 171 | Get 1, OniEntry(I).rDataPosition, ID4
|
---|
| 172 | If ID4 = AKEV.AGQRid Then
|
---|
| 173 | Get 1, OniEntry(I).rDataPosition, AGQR1
|
---|
| 174 | ReDim AGQR_E(AGQR1.NumEntries - 1)
|
---|
| 175 | Get 1, , AGQR_E
|
---|
| 176 | Exit For
|
---|
| 177 | End If
|
---|
| 178 | Next I
|
---|
| 179 |
|
---|
| 180 | ReDim TexNames(TXMA1.NumEntries - 1)
|
---|
| 181 |
|
---|
| 182 | For I = 0 To TXMA1.NumEntries - 1
|
---|
| 183 | For L = 0 To UBound(OniEntry) - 1
|
---|
| 184 | Get 1, OniEntry(L).rDataPosition, ID4
|
---|
| 185 | If ID4 = TXMA_E(I).TXMP_ID Then
|
---|
| 186 | TexNames(I) = OniEntry(L).szTagName + Ext
|
---|
| 187 | Exit For
|
---|
| 188 | End If
|
---|
| 189 | Next L
|
---|
| 190 | Next I
|
---|
| 191 |
|
---|
| 192 | Close
|
---|
| 193 | 'Ok
|
---|
| 194 | ' so we have: 3D points, Texture coordinates and list of polygons,
|
---|
| 195 | ' end reading, now convert data
|
---|
| 196 | I = 0
|
---|
| 197 | Open App.Path + "\lwo.tmp" For Binary As #11
|
---|
| 198 | Form1.StatusBar1.SimpleText = "Status: Extracting LEVEL [Reading Polygons...]"
|
---|
| 199 | Seek 11, 1
|
---|
| 200 |
|
---|
| 201 | 'reading polygons.......
|
---|
| 202 |
|
---|
| 203 | NP = AGQG.NumEntries * 2
|
---|
| 204 | For I = 0 To AGQG.NumEntries - 1
|
---|
| 205 | Select Case GetPureFile(TexNames(AGQR_E(I).TexIndex))
|
---|
| 206 | Case "BLUEGRID02", "_DOOR_FRAME", "", "COLLISION"
|
---|
| 207 | NP = NP - 2
|
---|
| 208 | Case Else
|
---|
| 209 | Select Case Mid$(GetPureFile(TexNames(AGQR_E(I).TexIndex)), 1, 5)
|
---|
| 210 | Case "_DOOR"
|
---|
| 211 | NP = NP - 2
|
---|
| 212 | Case Else
|
---|
| 213 | Put 11, , TestSwapInt(AGQGEntry(I).VertIndex(1))
|
---|
| 214 | Put 11, , TestSwapInt(AGQGEntry(I).VertIndex(2))
|
---|
| 215 | Put 11, , TestSwapInt(AGQGEntry(I).VertIndex(3))
|
---|
| 216 | Put 11, , TestSwapInt(AGQGEntry(I).VertIndex(3))
|
---|
| 217 | Put 11, , TestSwapInt(AGQGEntry(I).VertIndex(4))
|
---|
| 218 | Put 11, , TestSwapInt(AGQGEntry(I).VertIndex(1))
|
---|
| 219 | End Select
|
---|
| 220 | End Select
|
---|
| 221 | Next I
|
---|
| 222 |
|
---|
| 223 |
|
---|
| 224 |
|
---|
| 225 | ReDim OniPol2(NP - 1)
|
---|
| 226 | ReDim LwoP(NP - 1)
|
---|
| 227 | Get 11, 1, OniPol2
|
---|
| 228 |
|
---|
| 229 | For I = 0 To NP - 1
|
---|
| 230 | LwoP(I).NumVe = ISItoMSI(3)
|
---|
| 231 | LwoP(I).P1 = OniPol2(I).P1
|
---|
| 232 | LwoP(I).P2 = OniPol2(I).P2
|
---|
| 233 | LwoP(I).P3 = OniPol2(I).P3
|
---|
| 234 | LwoP(I).Surfa = ISItoMSI(1)
|
---|
| 235 | Next I
|
---|
| 236 |
|
---|
| 237 | I = Empty
|
---|
| 238 |
|
---|
| 239 | Close
|
---|
| 240 |
|
---|
| 241 | On Error Resume Next
|
---|
| 242 | Kill App.Path + "\*.tmp"
|
---|
| 243 | On Error GoTo 0
|
---|
| 244 |
|
---|
| 245 | Form1.StatusBar1.SimpleText = "Status: Extracting LEVEL [Writing...]"
|
---|
| 246 | Form1.ProgressBar1.Max = PNTA.NumEntries
|
---|
| 247 | Form1.ProgressBar1.Value = 0
|
---|
| 248 | If LevelType = 5 Or LevelType = 10 Then
|
---|
| 249 | FileName = GetPureFile(FileName) + ".raw"
|
---|
| 250 | End If
|
---|
| 251 |
|
---|
| 252 | For I = 0 To PNTA.NumEntries - 1
|
---|
| 253 | If PNTAentry(I).X > 2000000.1 Then PNTAentry(I).X = 0
|
---|
| 254 | If PNTAentry(I).Y > 2000000.1 Then PNTAentry(I).Y = 0
|
---|
| 255 | If PNTAentry(I).Z > 2000000.1 Then PNTAentry(I).Z = 0
|
---|
| 256 | If PNTAentry(I).X < -2000000.1 Then PNTAentry(I).X = 0
|
---|
| 257 | If PNTAentry(I).Y < -2000000.1 Then PNTAentry(I).Y = 0
|
---|
| 258 | If PNTAentry(I).Z < -2000000.1 Then PNTAentry(I).Z = 0
|
---|
| 259 | Next I
|
---|
| 260 |
|
---|
| 261 | Select Case LevelType
|
---|
| 262 | Case 1
|
---|
| 263 |
|
---|
| 264 | Open FileName For Binary As #1
|
---|
| 265 | Put 1, , "FORM"
|
---|
| 266 | Put 1, , ISLtoMSL(12 + (PNTA.NumEntries * 12) + 8 + 6 + 8 + (NP * 10))
|
---|
| 267 | Put 1, , "LWOBPNTS"
|
---|
| 268 | Put 1, , ISLtoMSL(PNTA.NumEntries * 12)
|
---|
| 269 | For I = 0 To PNTA.NumEntries - 1
|
---|
| 270 | Put 1, , SwapFloat(PNTAentry(I).X)
|
---|
| 271 | Put 1, , SwapFloat(PNTAentry(I).Y)
|
---|
| 272 | Put 1, , SwapFloat(PNTAentry(I).Z)
|
---|
| 273 | Form1.ProgressBar1.Value = I
|
---|
| 274 | Next I
|
---|
| 275 | Put 1, , "SRFS"
|
---|
| 276 | Put 1, , ISLtoMSL(6)
|
---|
| 277 | Put 1, , "Level"
|
---|
| 278 | Put 1, , CByte(0)
|
---|
| 279 | Put 1, , "POLS"
|
---|
| 280 | Put 1, , ISLtoMSL(NP * 10)
|
---|
| 281 | Put 1, , LwoP
|
---|
| 282 | Close
|
---|
| 283 | Case 6
|
---|
| 284 |
|
---|
| 285 | ' Convert Oni level to RAW 3D Binary
|
---|
| 286 | Open GetPureFile(FileName) + ".rwb" For Binary As #1
|
---|
| 287 | For I = 0 To AGQG.NumEntries - 1
|
---|
| 288 | Put 1, , PNTAentry(AGQGEntry(I).VertIndex(1)).X
|
---|
| 289 | Put 1, , PNTAentry(AGQGEntry(I).VertIndex(1)).Y
|
---|
| 290 | Put 1, , PNTAentry(AGQGEntry(I).VertIndex(1)).Z
|
---|
| 291 | Put 1, , PNTAentry(AGQGEntry(I).VertIndex(2)).X
|
---|
| 292 | Put 1, , PNTAentry(AGQGEntry(I).VertIndex(2)).Y
|
---|
| 293 | Put 1, , PNTAentry(AGQGEntry(I).VertIndex(2)).Z
|
---|
| 294 | Put 1, , PNTAentry(AGQGEntry(I).VertIndex(3)).X
|
---|
| 295 | Put 1, , PNTAentry(AGQGEntry(I).VertIndex(3)).Y
|
---|
| 296 | Put 1, , PNTAentry(AGQGEntry(I).VertIndex(3)).Z
|
---|
| 297 | Put 1, , PNTAentry(AGQGEntry(I).VertIndex(3)).X
|
---|
| 298 | Put 1, , PNTAentry(AGQGEntry(I).VertIndex(3)).Y
|
---|
| 299 | Put 1, , PNTAentry(AGQGEntry(I).VertIndex(3)).Z
|
---|
| 300 | Put 1, , PNTAentry(AGQGEntry(I).VertIndex(4)).X
|
---|
| 301 | Put 1, , PNTAentry(AGQGEntry(I).VertIndex(4)).Y
|
---|
| 302 | Put 1, , PNTAentry(AGQGEntry(I).VertIndex(4)).Z
|
---|
| 303 | Put 1, , PNTAentry(AGQGEntry(I).VertIndex(1)).X
|
---|
| 304 | Put 1, , PNTAentry(AGQGEntry(I).VertIndex(1)).Y
|
---|
| 305 | Put 1, , PNTAentry(AGQGEntry(I).VertIndex(1)).Z
|
---|
| 306 | Next I
|
---|
| 307 |
|
---|
| 308 | Close
|
---|
| 309 | Case 7
|
---|
| 310 |
|
---|
| 311 | ' B3D
|
---|
| 312 | Open GetPureFile(FileName) + ".b3d" For Binary As #1
|
---|
| 313 | Put 1, , "Big3DbyOleg"
|
---|
| 314 | Put 1, , CLng(1067030938)
|
---|
| 315 | Put 1, , "POINTS "
|
---|
| 316 | Put 1, , CLng(PNTA.NumEntries)
|
---|
| 317 | For I = 0 To PNTA.NumEntries - 1
|
---|
| 318 | Put 1, , PNTAentry(I).X
|
---|
| 319 | Put 1, , PNTAentry(I).Y
|
---|
| 320 | Put 1, , PNTAentry(I).Z
|
---|
| 321 | Next I
|
---|
| 322 |
|
---|
| 323 | Put 1, , "POLYGONS"
|
---|
| 324 | Put 1, , CLng(NP * 2)
|
---|
| 325 | For I = 0 To AGQG.NumEntries - 1
|
---|
| 326 | Select Case GetPureFile(TexNames(AGQR_E(I).TexIndex))
|
---|
| 327 | Case "BLUEGRID02", "_DOOR_FRAME", "", "COLLISION"
|
---|
| 328 | 'nothing
|
---|
| 329 | Case Else
|
---|
| 330 | Select Case Mid$(GetPureFile(TexNames(AGQR_E(I).TexIndex)), 1, 5)
|
---|
| 331 | Case "_DOOR"
|
---|
| 332 | 'nothing
|
---|
| 333 | Case Else
|
---|
| 334 | Put 1, , CLng(3)
|
---|
| 335 | Put 1, , AGQGEntry(I).VertIndex(1)
|
---|
| 336 | Put 1, , AGQGEntry(I).VertIndex(2)
|
---|
| 337 | Put 1, , AGQGEntry(I).VertIndex(3)
|
---|
| 338 | Put 1, , CLng(0)
|
---|
| 339 | Put 1, , CLng(3)
|
---|
| 340 | Put 1, , AGQGEntry(I).VertIndex(3)
|
---|
| 341 | Put 1, , AGQGEntry(I).VertIndex(4)
|
---|
| 342 | Put 1, , AGQGEntry(I).VertIndex(1)
|
---|
| 343 | Put 1, , CLng(0)
|
---|
| 344 | End Select
|
---|
| 345 | End Select
|
---|
| 346 | Next I
|
---|
| 347 | Put 1, , CLng(0)
|
---|
| 348 | Close
|
---|
| 349 |
|
---|
| 350 | Case 8
|
---|
| 351 |
|
---|
| 352 | 'Delete shit from the Oni level
|
---|
| 353 | numb = AGQG.NumEntries
|
---|
| 354 | ReDim Preserve PNTAentry(PNTA.NumEntries + 3)
|
---|
| 355 | PNTAentry(PNTA.NumEntries + 0).X = -9
|
---|
| 356 | PNTAentry(PNTA.NumEntries + 0).Y = 0
|
---|
| 357 | PNTAentry(PNTA.NumEntries + 0).Z = -3
|
---|
| 358 | PNTAentry(PNTA.NumEntries + 1).X = -9
|
---|
| 359 | PNTAentry(PNTA.NumEntries + 1).Y = 0
|
---|
| 360 | PNTAentry(PNTA.NumEntries + 1).Z = 8
|
---|
| 361 | PNTAentry(PNTA.NumEntries + 2).X = 11
|
---|
| 362 | PNTAentry(PNTA.NumEntries + 2).Y = 0
|
---|
| 363 | PNTAentry(PNTA.NumEntries + 2).Z = -3
|
---|
| 364 | PNTAentry(PNTA.NumEntries + 3).X = 11
|
---|
| 365 | PNTAentry(PNTA.NumEntries + 3).Y = 0
|
---|
| 366 | PNTAentry(PNTA.NumEntries + 3).Z = 8
|
---|
| 367 |
|
---|
| 368 | If Form1.mnuDelGarbage.Checked = True Then
|
---|
| 369 | For I = 0 To AGQG.NumEntries - 1
|
---|
| 370 | Select Case Mid$(GetPureFile(TexNames(AGQR_E(I).TexIndex)), 1, 5)
|
---|
| 371 | Case "_DOOR"
|
---|
| 372 | AGQGEntry(I).VertIndex(1) = PNTA.NumEntries + 0
|
---|
| 373 | AGQGEntry(I).VertIndex(2) = PNTA.NumEntries + 1
|
---|
| 374 | AGQGEntry(I).VertIndex(3) = PNTA.NumEntries + 2
|
---|
| 375 | AGQGEntry(I).VertIndex(4) = PNTA.NumEntries + 3
|
---|
| 376 | 'numb = numb - 1
|
---|
| 377 | End Select
|
---|
| 378 | Next I
|
---|
| 379 | End If
|
---|
| 380 |
|
---|
| 381 | For I = 0 To AGQG.NumEntries - 1
|
---|
| 382 | Select Case GetPureFile(TexNames(AGQR_E(I).TexIndex))
|
---|
| 383 | Case "BLUEGRID02", "_DOOR_FRAME", "", "COLLISION"
|
---|
| 384 | AGQGEntry(I).VertIndex(1) = PNTA.NumEntries + 0
|
---|
| 385 | AGQGEntry(I).VertIndex(2) = PNTA.NumEntries + 1
|
---|
| 386 | AGQGEntry(I).VertIndex(3) = PNTA.NumEntries + 2
|
---|
| 387 | AGQGEntry(I).VertIndex(4) = PNTA.NumEntries + 3
|
---|
| 388 | numb = numb - 1
|
---|
| 389 | End Select
|
---|
| 390 | Next I
|
---|
| 391 |
|
---|
| 392 | 'B3D + materials
|
---|
| 393 | Open GetPureFile(FileName) + ".b3d" For Binary As #1
|
---|
| 394 | Put 1, , "Big3DbyOleg"
|
---|
| 395 | Put 1, , CLng(1067030938)
|
---|
| 396 | Put 1, , "POINTS "
|
---|
| 397 | Put 1, , CLng(numb * 4)
|
---|
| 398 |
|
---|
| 399 | For I = 0 To AGQG.NumEntries - 1
|
---|
| 400 | ' Begin polygon
|
---|
| 401 | Select Case GetPureFile(TexNames(AGQR_E(I).TexIndex))
|
---|
| 402 | Case "BLUEGRID02", "_DOOR_FRAME", "", "COLLISION"
|
---|
| 403 | 'nothing
|
---|
| 404 | Case Else
|
---|
| 405 | Put 1, , PNTAentry(AGQGEntry(I).VertIndex(1)).X
|
---|
| 406 | Put 1, , PNTAentry(AGQGEntry(I).VertIndex(1)).Y
|
---|
| 407 | Put 1, , PNTAentry(AGQGEntry(I).VertIndex(1)).Z
|
---|
| 408 |
|
---|
| 409 | Put 1, , PNTAentry(AGQGEntry(I).VertIndex(2)).X
|
---|
| 410 | Put 1, , PNTAentry(AGQGEntry(I).VertIndex(2)).Y
|
---|
| 411 | Put 1, , PNTAentry(AGQGEntry(I).VertIndex(2)).Z
|
---|
| 412 |
|
---|
| 413 | Put 1, , PNTAentry(AGQGEntry(I).VertIndex(3)).X
|
---|
| 414 | Put 1, , PNTAentry(AGQGEntry(I).VertIndex(3)).Y
|
---|
| 415 | Put 1, , PNTAentry(AGQGEntry(I).VertIndex(3)).Z
|
---|
| 416 |
|
---|
| 417 | Put 1, , PNTAentry(AGQGEntry(I).VertIndex(4)).X
|
---|
| 418 | Put 1, , PNTAentry(AGQGEntry(I).VertIndex(4)).Y
|
---|
| 419 | Put 1, , PNTAentry(AGQGEntry(I).VertIndex(4)).Z
|
---|
| 420 | End Select
|
---|
| 421 | ' end polygon
|
---|
| 422 | Next I
|
---|
| 423 |
|
---|
| 424 | Put 1, , "POLYGONS"
|
---|
| 425 | Put 1, , CLng(numb * 2)
|
---|
| 426 | L = 0
|
---|
| 427 | ID4 = 0
|
---|
| 428 | For I = 0 To AGQG.NumEntries - 1
|
---|
| 429 | Select Case GetPureFile(TexNames(AGQR_E(I).TexIndex))
|
---|
| 430 | Case "BLUEGRID02", "_DOOR_FRAME", "", "COLLISION"
|
---|
| 431 | 'nothing
|
---|
| 432 | Case Else
|
---|
| 433 | Put 1, , CLng(3)
|
---|
| 434 | Put 1, , CLng(L)
|
---|
| 435 | Put 1, , CLng(L + 1)
|
---|
| 436 | Put 1, , CLng(L + 2)
|
---|
| 437 | Put 1, , CLng(ID4)
|
---|
| 438 | Put 1, , CLng(3)
|
---|
| 439 | Put 1, , CLng(L + 2)
|
---|
| 440 | Put 1, , CLng(L + 3)
|
---|
| 441 | Put 1, , CLng(L)
|
---|
| 442 | Put 1, , CLng(ID4)
|
---|
| 443 | ID4 = ID4 + 1
|
---|
| 444 | L = L + 4
|
---|
| 445 | End Select
|
---|
| 446 | Next I
|
---|
| 447 |
|
---|
| 448 | Put 1, , CLng(1)
|
---|
| 449 | Put 1, , "TEX_UV "
|
---|
| 450 | Put 1, , CLng(numb * 4)
|
---|
| 451 | L = 0
|
---|
| 452 |
|
---|
| 453 | For I = 0 To AGQG.NumEntries - 1
|
---|
| 454 | Select Case GetPureFile(TexNames(AGQR_E(I).TexIndex))
|
---|
| 455 | Case "BLUEGRID02", "_DOOR_FRAME", "", "COLLISION"
|
---|
| 456 | 'nothing
|
---|
| 457 | Case Else
|
---|
| 458 | Put 1, , CLng(L)
|
---|
| 459 | L = L + 1
|
---|
| 460 | Put 1, , TXCA_E(AGQGEntry(I).VertUVIndex(1)).X
|
---|
| 461 | Put 1, , TXCA_E(AGQGEntry(I).VertUVIndex(1)).Y
|
---|
| 462 | Put 1, , CLng(L)
|
---|
| 463 | L = L + 1
|
---|
| 464 | Put 1, , TXCA_E(AGQGEntry(I).VertUVIndex(2)).X
|
---|
| 465 | Put 1, , TXCA_E(AGQGEntry(I).VertUVIndex(2)).Y
|
---|
| 466 | Put 1, , CLng(L)
|
---|
| 467 | L = L + 1
|
---|
| 468 | Put 1, , TXCA_E(AGQGEntry(I).VertUVIndex(3)).X
|
---|
| 469 | Put 1, , TXCA_E(AGQGEntry(I).VertUVIndex(3)).Y
|
---|
| 470 | Put 1, , CLng(L)
|
---|
| 471 | L = L + 1
|
---|
| 472 | Put 1, , TXCA_E(AGQGEntry(I).VertUVIndex(4)).X
|
---|
| 473 | Put 1, , TXCA_E(AGQGEntry(I).VertUVIndex(4)).Y
|
---|
| 474 | End Select
|
---|
| 475 | 'Put 1, , CSng((-TXCA_E(I).Y) + 1)
|
---|
| 476 | Next I
|
---|
| 477 |
|
---|
| 478 | L = 0
|
---|
| 479 | Put 1, , "MATERIAL"
|
---|
| 480 | Put 1, , CLng(numb)
|
---|
| 481 | For I = 0 To AGQG.NumEntries - 1
|
---|
| 482 | Select Case GetPureFile(TexNames(AGQR_E(I).TexIndex))
|
---|
| 483 | Case "BLUEGRID02", "_DOOR_FRAME", "", "COLLISION"
|
---|
| 484 | 'nothing
|
---|
| 485 | Case Else
|
---|
| 486 | Put 1, , CLng(1)
|
---|
| 487 | Put 1, , CLng(L)
|
---|
| 488 | Put 1, , CLng(Len(TexNames(AGQR_E(I).TexIndex)))
|
---|
| 489 | Put 1, , TexNames(AGQR_E(I).TexIndex)
|
---|
| 490 | L = L + 1
|
---|
| 491 | End Select
|
---|
| 492 | Next I
|
---|
| 493 | Close
|
---|
| 494 |
|
---|
| 495 | Open GetPureFile(FileName) + ".tlist" For Binary As #4
|
---|
| 496 | For I = 0 To AGQR1.NumEntries - 1
|
---|
| 497 | Select Case GetPureFile(TexNames(AGQR_E(I).TexIndex))
|
---|
| 498 | Case "BLUEGRID02", "_DOOR_FRAME", "", "COLLISION"
|
---|
| 499 | 'nothing
|
---|
| 500 | Case Else
|
---|
| 501 | Put 4, , AGQR_E(I).TexIndex
|
---|
| 502 | End Select
|
---|
| 503 | Next I
|
---|
| 504 | Close
|
---|
| 505 |
|
---|
| 506 | Open GetPureFile(FileName) + ".txt" For Output As #4
|
---|
| 507 | Print #4, CStr(TXMA1.NumEntries)
|
---|
| 508 | For I = 0 To TXMA1.NumEntries - 1
|
---|
| 509 | Print #4, CStr(GetPureFile(TexNames(I)))
|
---|
| 510 | Next I
|
---|
| 511 | Close
|
---|
| 512 |
|
---|
| 513 | If Form1.mnuB3DLight.Checked = True Then
|
---|
| 514 | Open GetPureFile(FileName) + ".ltcs" For Binary As #4
|
---|
| 515 | For I = 0 To AGQR1.NumEntries - 1
|
---|
| 516 | Select Case GetPureFile(TexNames(AGQR_E(I).TexIndex))
|
---|
| 517 | Case "BLUEGRID02", "_DOOR_FRAME", "", "COLLISION"
|
---|
| 518 | 'nothing
|
---|
| 519 | Case Else
|
---|
| 520 | Put 4, , AGQGEntry(I).LData_1
|
---|
| 521 | Put 4, , AGQGEntry(I).LData_2
|
---|
| 522 | Put 4, , AGQGEntry(I).LData_3
|
---|
| 523 | Put 4, , AGQGEntry(I).LData_4
|
---|
| 524 | End Select
|
---|
| 525 | Next I
|
---|
| 526 | Close
|
---|
| 527 | End If
|
---|
| 528 | End Select
|
---|
| 529 |
|
---|
| 530 | Form1.ProgressBar1.Value = 0
|
---|
| 531 | Form1.ProgressBar1.Max = UBound(OniEntry)
|
---|
| 532 |
|
---|
| 533 | Form1.StatusBar1.SimpleText = "OK"
|
---|
| 534 | 'Dispose
|
---|
| 535 | I = Empty
|
---|
| 536 | NP = Empty
|
---|
| 537 | Erase LwoP
|
---|
| 538 | Erase PNTAentry
|
---|
| 539 | Erase OniPol2
|
---|
| 540 | Erase AGQGEntry
|
---|
| 541 | Erase AGQR_E
|
---|
| 542 | Erase TXMA_E
|
---|
| 543 | Erase TXCA_E
|
---|
| 544 | Erase TexNames
|
---|
| 545 | End Sub
|
---|