Current News Archived News Search News Discussion Forum Old Forum Install Programs More Downloads... Troubleshooting Source Code Format Specs. Misc. Information Non-SF Stuff Links Small banner for links to this site: |
diff --git a/MpqStuff.bas b/MpqStuff.bas
--- a/MpqStuff.bas
+++ b/MpqStuff.bas
ElseIf LCase(fExt) = ".mpq" Then
cType = CInt(GetReg(AppKey + "Compression\.mpq", "-2"))
dwFlags = dwFlags And (-1& Xor MAFA_ENCRYPT)
+ElseIf LCase(fExt) = ".scm" Then
+ cType = CInt(GetReg(AppKey + "Compression\.scm", "-2"))
+ dwFlags = dwFlags And (-1& Xor MAFA_ENCRYPT)
+ElseIf LCase(fExt) = ".scx" Then
+ cType = CInt(GetReg(AppKey + "Compression\.scx", "-2"))
+ dwFlags = dwFlags And (-1& Xor MAFA_ENCRYPT)
ElseIf LCase(fExt) = ".w3m" Then
cType = CInt(GetReg(AppKey + "Compression\.w3m", "-2"))
dwFlags = dwFlags And (-1& Xor MAFA_ENCRYPT)
+ElseIf LCase(fExt) = ".w3x" Then
+ cType = CInt(GetReg(AppKey + "Compression\.w3x", "-2"))
+ dwFlags = dwFlags And (-1& Xor MAFA_ENCRYPT)
ElseIf LCase(fExt) = ".wav" Then
cType = CInt(GetReg(AppKey + "Compression\.wav", "0"))
Else
MpqAddFileToArchiveEx hMPQ, File, MpqPath, dwFlags Or MAFA_COMPRESS, MAFA_COMPRESS_STANDARD, 0
Case -3
MpqAddFileToArchiveEx hMPQ, File, MpqPath, dwFlags Or MAFA_COMPRESS, MAFA_COMPRESS_DEFLATE, DefaultCompressLevel
+Case -4
+MpqAddFileToArchiveEx hMPQ, File, MpqPath, dwFlags Or MAFA_COMPRESS, MAFA_COMPRESS_BZIP2, 0
Case 0, 1, 2
MpqAddWaveToArchive hMPQ, File, MpqPath, dwFlags Or MAFA_COMPRESS, cType
Case Else
-MpqAddFileToArchiveEx hMPQ, File, MpqPath, dwFlags Or MAFA_COMPRESS, DefaultCompress, DefaultCompressLevel
+If DefaultCompress = MAFA_COMPRESS_DEFLATE Then
+ MpqAddFileToArchiveEx hMPQ, File, MpqPath, dwFlags Or MAFA_COMPRESS, DefaultCompress, DefaultCompressLevel
+Else
+ MpqAddFileToArchiveEx hMPQ, File, MpqPath, dwFlags Or MAFA_COMPRESS, DefaultCompress, 0
+End If
End Select
End Sub
Sub mAddAutoFromBuffer(hMPQ As Long, ByRef buffer As Byte, BufSize As Long, MpqPath As String)
MpqAddFileFromBufferEx hMPQ, buffer, BufSize, MpqPath, dwFlags Or MAFA_COMPRESS, MAFA_COMPRESS_STANDARD, 0
Case -3
MpqAddFileFromBufferEx hMPQ, buffer, BufSize, MpqPath, dwFlags Or MAFA_COMPRESS, MAFA_COMPRESS_DEFLATE, DefaultCompressLevel
+Case -4
+MpqAddFileFromBufferEx hMPQ, buffer, BufSize, MpqPath, dwFlags Or MAFA_COMPRESS, MAFA_COMPRESS_BZIP2, 0
Case 0, 1, 2
MpqAddWaveFromBuffer hMPQ, buffer, BufSize, MpqPath, dwFlags Or MAFA_COMPRESS, cType
Case Else
-MpqAddFileFromBufferEx hMPQ, buffer, BufSize, MpqPath, dwFlags Or MAFA_COMPRESS, DefaultCompress, DefaultCompressLevel
+If DefaultCompress = MAFA_COMPRESS_DEFLATE Then
+ MpqAddFileFromBufferEx hMPQ, buffer, BufSize, MpqPath, dwFlags Or MAFA_COMPRESS, DefaultCompress, DefaultCompressLevel
+Else
+ MpqAddFileFromBufferEx hMPQ, buffer, BufSize, MpqPath, dwFlags Or MAFA_COMPRESS, DefaultCompress, 0
+End If
End Select
End Sub
ElseIf cType = -1 Then
mAddAutoFile hMPQ, FullPath(CurPath, fLine), Param(3) + fLine
ElseIf cType = 1 Then
- MpqAddFileToArchiveEx hMPQ, FullPath(CurPath, fLine), Param(3) + fLine, dwFlags, DefaultCompress, DefaultCompressLevel
+ If DefaultCompress = MAFA_COMPRESS_DEFLATE Then
+ MpqAddFileToArchiveEx hMPQ, FullPath(CurPath, fLine), Param(3) + fLine, dwFlags, DefaultCompress, DefaultCompressLevel
+ Else
+ MpqAddFileToArchiveEx hMPQ, FullPath(CurPath, fLine), Param(3) + fLine, dwFlags, DefaultCompress, 0
+ End If
Else
MpqAddFileToArchiveEx hMPQ, FullPath(CurPath, fLine), Param(3) + fLine, dwFlags, 0, 0
End If
ElseIf cType = -1 Then
mAddAutoFile hMPQ, FullPath(CurPath, fLine), Param(3)
ElseIf cType = 1 Then
- MpqAddFileToArchiveEx hMPQ, FullPath(CurPath, fLine), Param(3), dwFlags, DefaultCompress, DefaultCompressLevel
+ If DefaultCompress = MAFA_COMPRESS_DEFLATE Then
+ MpqAddFileToArchiveEx hMPQ, FullPath(CurPath, fLine), Param(3), dwFlags, DefaultCompress, DefaultCompressLevel
+ Else
+ MpqAddFileToArchiveEx hMPQ, FullPath(CurPath, fLine), Param(3), dwFlags, DefaultCompress, 0
+ End If
Else
MpqAddFileToArchiveEx hMPQ, FullPath(CurPath, fLine), Param(3), dwFlags, 0, 0
End If
diff --git a/Options.frm b/Options.frm
--- a/Options.frm
+++ b/Options.frm
BorderStyle = 3 'Fixed Dialog
Caption = "Options"
ClientHeight = 4695
- ClientLeft = 1575
- ClientTop = 1815
+ ClientLeft = 1665
+ ClientTop = 2085
ClientWidth = 5415
Height = 5100
Icon = "Options.frx":0000
KeyPreview = -1 'True
- Left = 1515
+ Left = 1605
LinkTopic = "Form1"
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 4695
ScaleWidth = 5415
ShowInTaskbar = 0 'False
- Top = 1470
+ Top = 1740
Width = 5535
Begin VB.CommandButton Command2
Caption = "&Cancel"
Height = 315
ItemData = "Options.frx":0245
Left = 1200
- List = "Options.frx":024F
+ List = "Options.frx":0252
Style = 2 'Dropdown List
TabIndex = 33
Top = 3120
End
Begin VB.ListBox List1
Height = 1815
- ItemData = "Options.frx":0266
+ ItemData = "Options.frx":0270
Left = 0
- List = "Options.frx":0268
+ List = "Options.frx":0272
Sorted = -1 'True
TabIndex = 27
Top = 720
Begin VB.ComboBox Combo1
Enabled = 0 'False
Height = 315
- ItemData = "Options.frx":026A
+ ItemData = "Options.frx":0274
Left = 1800
- List = "Options.frx":027A
+ List = "Options.frx":0287
Style = 2 'Dropdown List
TabIndex = 29
Top = 720
If Combo1.ListIndex < 2 Then
NewExtComp(xNum) = Combo1.ListIndex - 2
Else
- NewExtComp(xNum) = -3
+ If Combo1.ListIndex = 2 Then
+ NewExtComp(xNum) = -3
+ Else
+ NewExtComp(xNum) = -4
+ End If
End If
End If
End Sub
Case 1
DefaultCompressID = -3
DefaultCompress = MAFA_COMPRESS_DEFLATE
+Case 2
+DefaultCompressID = -4
+DefaultCompress = MAFA_COMPRESS_BZIP2
End Select
DefaultCompressLevel = Combo3.ListIndex - 1
SetReg AppKey + "DefaultCompress", DefaultCompressID, REG_DWORD
Select Case DCompType
Case -3
Combo2.ListIndex = 1
+Case -4
+Combo2.ListIndex = 2
Case Else
Combo2.ListIndex = 0
End Select
Combo3.ListIndex = GetReg(AppKey + "DefaultZlibLevel", Z_DEFAULT_COMPRESSION) + 1
-ExtList = GetReg(AppKey + "Compression\List", ".bik.smk.mp3.mpq.w3m.wav")
+ExtList = GetReg(AppKey + "Compression\List", ".bik.smk.mp3.mpq.scm.scx.w3m.w3x.wav")
If InStr(1, ExtList, ".") > 0 And Len(ExtList) > 1 Then
Do
ReDim Preserve NewExtNames(UBound(NewExtNames) + 1) As String
NewExtComp(UBound(NewExtComp)) = CInt(GetReg(AppKey + "Compression\.mp3", "-2"))
ElseIf LCase(NewExtNames(UBound(NewExtNames))) = ".mpq" Then
NewExtComp(UBound(NewExtComp)) = CInt(GetReg(AppKey + "Compression\.mpq", "-2"))
+ ElseIf LCase(NewExtNames(UBound(NewExtNames))) = ".scm" Then
+ NewExtComp(UBound(NewExtComp)) = CInt(GetReg(AppKey + "Compression\.scm", "-2"))
+ ElseIf LCase(NewExtNames(UBound(NewExtNames))) = ".scx" Then
+ NewExtComp(UBound(NewExtComp)) = CInt(GetReg(AppKey + "Compression\.scx", "-2"))
ElseIf LCase(NewExtNames(UBound(NewExtNames))) = ".w3m" Then
NewExtComp(UBound(NewExtComp)) = CInt(GetReg(AppKey + "Compression\.w3m", "-2"))
+ ElseIf LCase(NewExtNames(UBound(NewExtNames))) = ".w3x" Then
+ NewExtComp(UBound(NewExtComp)) = CInt(GetReg(AppKey + "Compression\.w3x", "-2"))
ElseIf LCase(NewExtNames(UBound(NewExtNames))) = ".wav" Then
NewExtComp(UBound(NewExtComp)) = CInt(GetReg(AppKey + "Compression\.wav", "0"))
Else
Case -3
AudioC(0).Value = True
Combo1.ListIndex = 2
+ Case -4
+ AudioC(0).Value = True
+ Combo1.ListIndex = 4
Case 0, 1, 2
OldExtComp = NewExtComp(xNum)
Combo1.ListIndex = 3
diff --git a/Options.frx b/Options.frx
diff --git a/listing.frm b/listing.frm
--- a/listing.frm
+++ b/listing.frm
Width = 6690
_ExtentX = 11800
_ExtentY = 609
- ButtonWidth = 1535
+ ButtonWidth = 1561
ButtonHeight = 556
Wrappable = 0 'False
Appearance = 1
End
Begin VB.Menu mnuMAdd
Caption = "&Add..."
- Shortcut = ^A
+ Shortcut = ^{INSERT}
End
Begin VB.Menu mnuMAddFolder
Caption = "Add &Folder..."
Caption = "&Deflate"
Shortcut = {F9}
End
+ Begin VB.Menu mnuMCBzip2
+ Caption = "&Bzip2"
+ Shortcut = ^{F11}
+ End
Begin VB.Menu mnuMCAudio
Caption = "&Audio"
Begin VB.Menu mnuMCALowest
MpqAddFileFromBufferEx hMPQ, buffer(0), fLen, Files(nFile), dwFlags Or MAFA_COMPRESS, MAFA_COMPRESS_STANDARD, 0
ElseIf mnuMCDeflate.Checked Then
MpqAddFileFromBufferEx hMPQ, buffer(0), fLen, Files(nFile), dwFlags Or MAFA_COMPRESS, MAFA_COMPRESS_DEFLATE, DefaultCompressLevel
+ ElseIf mnuMCBzip2.Checked Then
+ MpqAddFileFromBufferEx hMPQ, buffer(0), fLen, Files(nFile), dwFlags Or MAFA_COMPRESS, MAFA_COMPRESS_BZIP2, 0
ElseIf mnuMCAMedium.Checked Then
MpqAddWaveFromBuffer hMPQ, buffer(0), fLen, Files(nFile), dwFlags Or MAFA_COMPRESS, 0
ElseIf mnuMCAHighest.Checked Then
ElseIf cType = -1 Then
mAddAutoFile hMPQ, FullPath(CurPath, fLine), Param(3) + fLine
ElseIf cType = 1 Then
- MpqAddFileToArchiveEx hMPQ, FullPath(CurPath, fLine), Param(3) + fLine, dwFlags, DefaultCompress, DefaultCompressLevel
+ If DefaultCompress = MAFA_COMPRESS_DEFLATE Then
+ MpqAddFileToArchiveEx hMPQ, FullPath(CurPath, fLine), Param(3) + fLine, dwFlags, DefaultCompress, DefaultCompressLevel
+ Else
+ MpqAddFileToArchiveEx hMPQ, FullPath(CurPath, fLine), Param(3) + fLine, dwFlags, DefaultCompress, 0
+ End If
Else
MpqAddFileToArchiveEx hMPQ, FullPath(CurPath, fLine), Param(3) + fLine, dwFlags, 0, 0
End If
ElseIf cType = -1 Then
mAddAutoFile hMPQ, FullPath(CurPath, fLine), Param(3)
ElseIf cType = 1 Then
- MpqAddFileToArchiveEx hMPQ, FullPath(CurPath, fLine), Param(3), dwFlags, DefaultCompress, DefaultCompressLevel
+ If DefaultCompress = MAFA_COMPRESS_DEFLATE Then
+ MpqAddFileToArchiveEx hMPQ, FullPath(CurPath, fLine), Param(3), dwFlags, DefaultCompress, DefaultCompressLevel
+ Else
+ MpqAddFileToArchiveEx hMPQ, FullPath(CurPath, fLine), Param(3), dwFlags, DefaultCompress, 0
+ End If
Else
MpqAddFileToArchiveEx hMPQ, FullPath(CurPath, fLine), Param(3), dwFlags, 0, 0
End If
If KeyAscii = 13 Then List_DblClick
End Sub
Private Sub List_KeyUp(KeyCode As Integer, Shift As Integer)
+Dim fNum As Long, fSelect As Long
If KeyCode = vbKeyDelete Then
mnuMDelete_Click
+ElseIf (Shift And vbCtrlMask) And KeyCode = vbKeyA Then
+ fSelect = List.SelectedItem.Index
+ For fNum = 1 To List.ListItems.Count
+ List.ListItems.Item(fNum).Selected = True
+ Next fNum
+ List.ListItems.Item(fSelect).Selected = True
ElseIf KeyCode = 93 Or ((Shift And vbShiftMask) And KeyCode = vbKeyF10) Then
On Error GoTo NotSelected
List.SelectedItem.Tag = List.SelectedItem.Tag
MpqAddFileToArchiveEx hMPQ, Files(bNum), ShortFiles(bNum), dwFlags Or MAFA_COMPRESS, MAFA_COMPRESS_STANDARD, 0
ElseIf mnuMCDeflate.Checked Then
MpqAddFileToArchiveEx hMPQ, Files(bNum), ShortFiles(bNum), dwFlags Or MAFA_COMPRESS, MAFA_COMPRESS_DEFLATE, DefaultCompressLevel
+ ElseIf mnuMCBzip2.Checked Then
+ MpqAddFileToArchiveEx hMPQ, Files(bNum), ShortFiles(bNum), dwFlags Or MAFA_COMPRESS, MAFA_COMPRESS_BZIP2, 0
ElseIf mnuMCAMedium.Checked Then
MpqAddWaveToArchive hMPQ, Files(bNum), ShortFiles(bNum), dwFlags Or MAFA_COMPRESS, 0
ElseIf mnuMCAHighest.Checked Then
MpqAddFileToArchiveEx hMPQ, Files(bNum), ShortFiles(bNum), dwFlags Or MAFA_COMPRESS, MAFA_COMPRESS_STANDARD, 0
ElseIf mnuMCDeflate.Checked Then
MpqAddFileToArchiveEx hMPQ, Files(bNum), ShortFiles(bNum), dwFlags Or MAFA_COMPRESS, MAFA_COMPRESS_DEFLATE, DefaultCompressLevel
+ ElseIf mnuMCBzip2.Checked Then
+ MpqAddFileToArchiveEx hMPQ, Files(bNum), ShortFiles(bNum), dwFlags Or MAFA_COMPRESS, MAFA_COMPRESS_BZIP2, 0
ElseIf mnuMCAMedium.Checked Then
MpqAddWaveToArchive hMPQ, Files(bNum), ShortFiles(bNum), dwFlags Or MAFA_COMPRESS, 0
ElseIf mnuMCAHighest.Checked Then
MpqAddFileToArchiveEx hMPQ, Files(bNum), ShortFiles(bNum), dwFlags Or MAFA_COMPRESS, MAFA_COMPRESS_STANDARD, 0
ElseIf mnuMCDeflate.Checked Then
MpqAddFileToArchiveEx hMPQ, Files(bNum), ShortFiles(bNum), dwFlags Or MAFA_COMPRESS, MAFA_COMPRESS_DEFLATE, DefaultCompressLevel
+ ElseIf mnuMCBzip2.Checked Then
+ MpqAddFileToArchiveEx hMPQ, Files(bNum), ShortFiles(bNum), dwFlags Or MAFA_COMPRESS, MAFA_COMPRESS_BZIP2, 0
ElseIf mnuMCAMedium.Checked Then
MpqAddWaveToArchive hMPQ, Files(bNum), ShortFiles(bNum), dwFlags Or MAFA_COMPRESS, 0
ElseIf mnuMCAHighest.Checked Then
mnuMCNone.Checked = False
mnuMCStandard.Checked = False
mnuMCDeflate.Checked = False
+mnuMCBzip2.Checked = False
mnuMCALowest.Checked = False
mnuMCAMedium.Checked = False
mnuMCAHighest.Checked = True
mnuMCNone.Checked = False
mnuMCStandard.Checked = False
mnuMCDeflate.Checked = False
+mnuMCBzip2.Checked = False
mnuMCALowest.Checked = True
mnuMCAMedium.Checked = False
mnuMCAHighest.Checked = False
mnuMCNone.Checked = False
mnuMCStandard.Checked = False
mnuMCDeflate.Checked = False
+mnuMCBzip2.Checked = False
mnuMCALowest.Checked = False
mnuMCAMedium.Checked = True
mnuMCAHighest.Checked = False
mnuMCNone.Checked = False
mnuMCStandard.Checked = False
mnuMCDeflate.Checked = False
+mnuMCBzip2.Checked = False
mnuMCALowest.Checked = False
mnuMCAMedium.Checked = False
mnuMCAHighest.Checked = False
mnuMCAuto.Checked = True
End Sub
+Private Sub mnuMCBzip2_Click()
+mnuMCNone.Checked = False
+mnuMCStandard.Checked = False
+mnuMCDeflate.Checked = False
+mnuMCBzip2.Checked = True
+mnuMCALowest.Checked = False
+mnuMCAMedium.Checked = False
+mnuMCAHighest.Checked = False
+mnuMCAuto.Checked = False
+End Sub
+
Private Sub mnuMCDeflate_Click()
mnuMCNone.Checked = False
mnuMCStandard.Checked = False
mnuMCDeflate.Checked = True
+mnuMCBzip2.Checked = False
mnuMCALowest.Checked = False
mnuMCAMedium.Checked = False
mnuMCAHighest.Checked = False
mnuMCNone.Checked = True
mnuMCStandard.Checked = False
mnuMCDeflate.Checked = False
+mnuMCBzip2.Checked = False
mnuMCALowest.Checked = False
mnuMCAMedium.Checked = False
mnuMCAHighest.Checked = False
mnuMCNone.Checked = False
mnuMCStandard.Checked = True
mnuMCDeflate.Checked = False
+mnuMCBzip2.Checked = False
mnuMCALowest.Checked = False
mnuMCAMedium.Checked = False
mnuMCAHighest.Checked = False
MpqAddFileToArchiveEx hMPQ, FullPath(Path, OpenFiles(fNum)), OpenFiles(fNum), dwFlags Or MAFA_COMPRESS, MAFA_COMPRESS_STANDARD, 0
ElseIf mnuMCDeflate.Checked Then
MpqAddFileToArchiveEx hMPQ, FullPath(Path, OpenFiles(fNum)), OpenFiles(fNum), dwFlags Or MAFA_COMPRESS, MAFA_COMPRESS_DEFLATE, DefaultCompressLevel
+ ElseIf mnuMCBzip2.Checked Then
+ MpqAddFileToArchiveEx hMPQ, FullPath(Path, OpenFiles(fNum)), OpenFiles(fNum), dwFlags Or MAFA_COMPRESS, MAFA_COMPRESS_BZIP2, 0
ElseIf mnuMCAMedium.Checked Then
MpqAddWaveToArchive hMPQ, FullPath(Path, OpenFiles(fNum)), OpenFiles(fNum), dwFlags Or MAFA_COMPRESS, 0
ElseIf mnuMCAHighest.Checked Then
|