home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Ultra Collection Level Ad…e, Duke, Warcraft 2, C&C
/
ULTRA_Collection_Level_AddOn_-_Quake_Duke.iso
/
qutility
/
prg5.zip
/
QBRGEN.FRM
< prev
next >
Wrap
Text File
|
1996-07-06
|
7KB
|
292 lines
VERSION 4.00
Begin VB.Form frmMain
BorderStyle = 4 'Fixed ToolWindow
Caption = "Quake Brush Generator"
ClientHeight = 2685
ClientLeft = 9090
ClientTop = 8085
ClientWidth = 5955
Height = 3090
Left = 9030
LinkTopic = "Form1"
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 2685
ScaleWidth = 5955
ShowInTaskbar = 0 'False
Top = 7740
Width = 6075
Begin VB.CommandButton btnAbout
Caption = "About"
Height = 315
Left = 5160
TabIndex = 13
TabStop = 0 'False
Top = 360
Width = 735
End
Begin VB.CommandButton btnCopy
Caption = "Copy"
Height = 315
Left = 4200
TabIndex = 10
Top = 360
Width = 975
End
Begin VB.TextBox txtBrush
Enabled = 0 'False
Height = 1935
Left = 60
MultiLine = -1 'True
ScrollBars = 1 'Horizontal
TabIndex = 12
TabStop = 0 'False
Top = 720
Width = 5835
End
Begin VB.TextBox txtTex
Height = 285
Left = 2880
TabIndex = 8
Top = 60
Width = 1215
End
Begin VB.CommandButton btnGenerate
Caption = "Create Brush"
Height = 315
Left = 4200
TabIndex = 9
Top = 60
Width = 1695
End
Begin VB.TextBox txtZ2
Height = 285
Left = 1800
TabIndex = 5
Top = 360
Width = 615
End
Begin VB.TextBox txtY2
Height = 285
Left = 1080
TabIndex = 4
Top = 360
Width = 615
End
Begin VB.TextBox txtX2
Height = 285
Left = 360
TabIndex = 3
Top = 360
Width = 615
End
Begin VB.TextBox txtZ1
Height = 285
Left = 1800
TabIndex = 2
Top = 60
Width = 615
End
Begin VB.TextBox txtY1
Height = 285
Left = 1080
TabIndex = 1
Top = 60
Width = 615
End
Begin VB.TextBox txtX1
Height = 285
Left = 360
TabIndex = 0
Top = 60
Width = 615
End
Begin VB.Label Label3
BackStyle = 0 'Transparent
Caption = "tex:"
Height = 255
Left = 2520
TabIndex = 11
Top = 60
Width = 375
End
Begin VB.Label Label2
BackStyle = 0 'Transparent
Caption = "pt2:"
Height = 255
Left = 60
TabIndex = 7
Top = 420
Width = 375
End
Begin VB.Label Label1
BackStyle = 0 'Transparent
Caption = "pt1:"
Height = 255
Left = 60
TabIndex = 6
Top = 60
Width = 375
End
End
Attribute VB_Name = "frmMain"
Attribute VB_Creatable = False
Attribute VB_Exposed = False
Option Explicit
Dim sBrush As String
Private Function BuildBrush(x As Long, y As Long, z As Long, x1 As Long, y1 As Long, z1 As Long, x2 As Long, y2 As Long, z2 As Long, tex As String) As String
BuildBrush = " ( " & x & " " & y & " " & z & " ) ( " & (x + x1) & " " & (y + y1) & " " & (z + z1) & " ) ( " & (x + x2) & " " & (y + y2) & " " & (z + z2) & " ) " & tex & " 0 0 0 1.0 1.0" & vbCrLf
End Function
Private Sub btnAbout_Click()
MsgBox "Copyright 1996 Nicholas Dwarkanath (Niklata). All rights reserved.", 0, "About Quake Brush Generator"
End Sub
Private Sub btnCopy_Click()
Clipboard.Clear
Clipboard.SetText sBrush
End Sub
Private Sub btnFunc_Click()
Dim sBuff(6) As String
Dim x As Integer
Dim y As Integer
Dim z As Integer
Dim x1 As Integer
Dim y1 As Integer
Dim z1 As Integer
x = txtX1.Text
y = txtY1.Text
z = txtZ1.Text
x1 = txtX2.Text
y1 = txtY2.Text
z1 = txtZ2.Text
txtX1.Text = x
txtY1.Text = y
txtZ1.Text = z
txtX2.Text = x1
txtY2.Text = y1
txtZ2.Text = z
btnGenerate_Click
btnCopy_Click
sBuff(0) = Clipboard.GetText
txtX2.Text = x
txtY2.Text = y1
txtZ2.Text = z1
btnGenerate_Click
btnCopy_Click
sBuff(1) = Clipboard.GetText
txtX2.Text = x1
txtY2.Text = y
txtZ2.Text = z1
btnGenerate_Click
btnCopy_Click
sBuff(2) = Clipboard.GetText
txtX1.Text = x1
txtY1.Text = y1
txtZ1.Text = z1
txtX2.Text = x
txtY2.Text = y
txtZ2.Text = z1
btnGenerate_Click
btnCopy_Click
sBuff(3) = Clipboard.GetText
txtX2.Text = x1
txtY2.Text = y
txtZ2.Text = z
btnGenerate_Click
btnCopy_Click
sBuff(4) = Clipboard.GetText
txtX2.Text = x
txtY2.Text = y1
txtZ2.Text = z
btnGenerate_Click
btnCopy_Click
sBuff(5) = Clipboard.GetText
sBuff(6) = sBuff(0) & sBuff(1) & sBuff(2) & sBuff(3) & sBuff(4) & sBuff(5)
Clipboard.SetText sBuff(6)
End Sub
Private Sub btnGenerate_Click()
If txtX1.Text <> "" And txtX2.Text <> "" And txtY1.Text <> "" And txtY2.Text <> "" And txtZ1.Text <> "" And txtZ2.Text <> "" And txtTex <> "" Then
txtBrush.Text = ""
txtBrush.Text = " {" & vbCrLf
txtBrush.Text = txtBrush.Text & BuildBrush(txtX1.Text, 0, 0, 0, 1, 0, 0, 0, 1, txtTex.Text)
txtBrush.Text = txtBrush.Text & BuildBrush(txtX2.Text, 0, 0, 0, 0, 1, 0, 1, 0, txtTex.Text)
txtBrush.Text = txtBrush.Text & BuildBrush(0, txtY1.Text, 0, 0, 0, 1, 1, 0, 0, txtTex.Text)
txtBrush.Text = txtBrush.Text & BuildBrush(0, txtY2.Text, 0, 1, 0, 0, 0, 0, 1, txtTex.Text)
txtBrush.Text = txtBrush.Text & BuildBrush(0, 0, txtZ1.Text, 1, 0, 0, 0, 1, 0, txtTex.Text)
txtBrush.Text = txtBrush.Text & BuildBrush(0, 0, txtZ2.Text, 0, 1, 0, 1, 0, 0, txtTex.Text)
txtBrush.Text = txtBrush.Text & " }" & vbCrLf
sBrush = txtBrush.Text
End If
End Sub
Private Sub txtX1_GotFocus()
txtX1.SelStart = 0
txtX1.SelLength = Len(txtX1.Text)
End Sub
Private Sub txtX2_GotFocus()
txtX2.SelStart = 0
txtX2.SelLength = Len(txtX2.Text)
End Sub
Private Sub txtY1_GotFocus()
txtY1.SelStart = 0
txtY1.SelLength = Len(txtY1.Text)
End Sub
Private Sub txtY2_GotFocus()
txtY2.SelStart = 0
txtY2.SelLength = Len(txtY2.Text)
End Sub
Private Sub txtZ1_GotFocus()
txtZ1.SelStart = 0
txtZ1.SelLength = Len(txtZ1.Text)
End Sub
Private Sub txtZ2_GotFocus()
txtZ2.SelStart = 0
txtZ2.SelLength = Len(txtZ2.Text)
End Sub