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 >
Text File  |  1996-07-06  |  7KB  |  292 lines

  1. VERSION 4.00
  2. Begin VB.Form frmMain 
  3.    BorderStyle     =   4  'Fixed ToolWindow
  4.    Caption         =   "Quake Brush Generator"
  5.    ClientHeight    =   2685
  6.    ClientLeft      =   9090
  7.    ClientTop       =   8085
  8.    ClientWidth     =   5955
  9.    Height          =   3090
  10.    Left            =   9030
  11.    LinkTopic       =   "Form1"
  12.    MaxButton       =   0   'False
  13.    MinButton       =   0   'False
  14.    ScaleHeight     =   2685
  15.    ScaleWidth      =   5955
  16.    ShowInTaskbar   =   0   'False
  17.    Top             =   7740
  18.    Width           =   6075
  19.    Begin VB.CommandButton btnAbout 
  20.       Caption         =   "About"
  21.       Height          =   315
  22.       Left            =   5160
  23.       TabIndex        =   13
  24.       TabStop         =   0   'False
  25.       Top             =   360
  26.       Width           =   735
  27.    End
  28.    Begin VB.CommandButton btnCopy 
  29.       Caption         =   "Copy"
  30.       Height          =   315
  31.       Left            =   4200
  32.       TabIndex        =   10
  33.       Top             =   360
  34.       Width           =   975
  35.    End
  36.    Begin VB.TextBox txtBrush 
  37.       Enabled         =   0   'False
  38.       Height          =   1935
  39.       Left            =   60
  40.       MultiLine       =   -1  'True
  41.       ScrollBars      =   1  'Horizontal
  42.       TabIndex        =   12
  43.       TabStop         =   0   'False
  44.       Top             =   720
  45.       Width           =   5835
  46.    End
  47.    Begin VB.TextBox txtTex 
  48.       Height          =   285
  49.       Left            =   2880
  50.       TabIndex        =   8
  51.       Top             =   60
  52.       Width           =   1215
  53.    End
  54.    Begin VB.CommandButton btnGenerate 
  55.       Caption         =   "Create Brush"
  56.       Height          =   315
  57.       Left            =   4200
  58.       TabIndex        =   9
  59.       Top             =   60
  60.       Width           =   1695
  61.    End
  62.    Begin VB.TextBox txtZ2 
  63.       Height          =   285
  64.       Left            =   1800
  65.       TabIndex        =   5
  66.       Top             =   360
  67.       Width           =   615
  68.    End
  69.    Begin VB.TextBox txtY2 
  70.       Height          =   285
  71.       Left            =   1080
  72.       TabIndex        =   4
  73.       Top             =   360
  74.       Width           =   615
  75.    End
  76.    Begin VB.TextBox txtX2 
  77.       Height          =   285
  78.       Left            =   360
  79.       TabIndex        =   3
  80.       Top             =   360
  81.       Width           =   615
  82.    End
  83.    Begin VB.TextBox txtZ1 
  84.       Height          =   285
  85.       Left            =   1800
  86.       TabIndex        =   2
  87.       Top             =   60
  88.       Width           =   615
  89.    End
  90.    Begin VB.TextBox txtY1 
  91.       Height          =   285
  92.       Left            =   1080
  93.       TabIndex        =   1
  94.       Top             =   60
  95.       Width           =   615
  96.    End
  97.    Begin VB.TextBox txtX1 
  98.       Height          =   285
  99.       Left            =   360
  100.       TabIndex        =   0
  101.       Top             =   60
  102.       Width           =   615
  103.    End
  104.    Begin VB.Label Label3 
  105.       BackStyle       =   0  'Transparent
  106.       Caption         =   "tex:"
  107.       Height          =   255
  108.       Left            =   2520
  109.       TabIndex        =   11
  110.       Top             =   60
  111.       Width           =   375
  112.    End
  113.    Begin VB.Label Label2 
  114.       BackStyle       =   0  'Transparent
  115.       Caption         =   "pt2:"
  116.       Height          =   255
  117.       Left            =   60
  118.       TabIndex        =   7
  119.       Top             =   420
  120.       Width           =   375
  121.    End
  122.    Begin VB.Label Label1 
  123.       BackStyle       =   0  'Transparent
  124.       Caption         =   "pt1:"
  125.       Height          =   255
  126.       Left            =   60
  127.       TabIndex        =   6
  128.       Top             =   60
  129.       Width           =   375
  130.    End
  131. End
  132. Attribute VB_Name = "frmMain"
  133. Attribute VB_Creatable = False
  134. Attribute VB_Exposed = False
  135. Option Explicit
  136.  
  137. Dim sBrush As String
  138.  
  139. 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
  140.  
  141. 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
  142.  
  143. End Function
  144.  
  145.  
  146. Private Sub btnAbout_Click()
  147. MsgBox "Copyright 1996 Nicholas Dwarkanath (Niklata).  All rights reserved.", 0, "About Quake Brush Generator"
  148. End Sub
  149.  
  150. Private Sub btnCopy_Click()
  151.  
  152. Clipboard.Clear
  153. Clipboard.SetText sBrush
  154.  
  155. End Sub
  156.  
  157.  
  158. Private Sub btnFunc_Click()
  159.  
  160. Dim sBuff(6) As String
  161.  
  162. Dim x As Integer
  163. Dim y As Integer
  164. Dim z As Integer
  165. Dim x1 As Integer
  166. Dim y1 As Integer
  167. Dim z1 As Integer
  168.  
  169. x = txtX1.Text
  170. y = txtY1.Text
  171. z = txtZ1.Text
  172. x1 = txtX2.Text
  173. y1 = txtY2.Text
  174. z1 = txtZ2.Text
  175.  
  176. txtX1.Text = x
  177. txtY1.Text = y
  178. txtZ1.Text = z
  179. txtX2.Text = x1
  180. txtY2.Text = y1
  181. txtZ2.Text = z
  182. btnGenerate_Click
  183. btnCopy_Click
  184. sBuff(0) = Clipboard.GetText
  185.  
  186. txtX2.Text = x
  187. txtY2.Text = y1
  188. txtZ2.Text = z1
  189. btnGenerate_Click
  190. btnCopy_Click
  191. sBuff(1) = Clipboard.GetText
  192.  
  193. txtX2.Text = x1
  194. txtY2.Text = y
  195. txtZ2.Text = z1
  196. btnGenerate_Click
  197. btnCopy_Click
  198. sBuff(2) = Clipboard.GetText
  199.  
  200. txtX1.Text = x1
  201. txtY1.Text = y1
  202. txtZ1.Text = z1
  203. txtX2.Text = x
  204. txtY2.Text = y
  205. txtZ2.Text = z1
  206. btnGenerate_Click
  207. btnCopy_Click
  208. sBuff(3) = Clipboard.GetText
  209.  
  210. txtX2.Text = x1
  211. txtY2.Text = y
  212. txtZ2.Text = z
  213. btnGenerate_Click
  214. btnCopy_Click
  215. sBuff(4) = Clipboard.GetText
  216.  
  217. txtX2.Text = x
  218. txtY2.Text = y1
  219. txtZ2.Text = z
  220. btnGenerate_Click
  221. btnCopy_Click
  222. sBuff(5) = Clipboard.GetText
  223.  
  224. sBuff(6) = sBuff(0) & sBuff(1) & sBuff(2) & sBuff(3) & sBuff(4) & sBuff(5)
  225.  
  226. Clipboard.SetText sBuff(6)
  227.  
  228. End Sub
  229.  
  230. Private Sub btnGenerate_Click()
  231.  
  232. If txtX1.Text <> "" And txtX2.Text <> "" And txtY1.Text <> "" And txtY2.Text <> "" And txtZ1.Text <> "" And txtZ2.Text <> "" And txtTex <> "" Then
  233.  
  234. txtBrush.Text = ""
  235.  
  236. txtBrush.Text = " {" & vbCrLf
  237.  
  238. txtBrush.Text = txtBrush.Text & BuildBrush(txtX1.Text, 0, 0, 0, 1, 0, 0, 0, 1, txtTex.Text)
  239. txtBrush.Text = txtBrush.Text & BuildBrush(txtX2.Text, 0, 0, 0, 0, 1, 0, 1, 0, txtTex.Text)
  240. txtBrush.Text = txtBrush.Text & BuildBrush(0, txtY1.Text, 0, 0, 0, 1, 1, 0, 0, txtTex.Text)
  241. txtBrush.Text = txtBrush.Text & BuildBrush(0, txtY2.Text, 0, 1, 0, 0, 0, 0, 1, txtTex.Text)
  242. txtBrush.Text = txtBrush.Text & BuildBrush(0, 0, txtZ1.Text, 1, 0, 0, 0, 1, 0, txtTex.Text)
  243. txtBrush.Text = txtBrush.Text & BuildBrush(0, 0, txtZ2.Text, 0, 1, 0, 1, 0, 0, txtTex.Text)
  244.  
  245. txtBrush.Text = txtBrush.Text & " }" & vbCrLf
  246.  
  247.  
  248. sBrush = txtBrush.Text
  249.  
  250. End If
  251.  
  252. End Sub
  253.  
  254.  
  255.  
  256. Private Sub txtX1_GotFocus()
  257. txtX1.SelStart = 0
  258. txtX1.SelLength = Len(txtX1.Text)
  259. End Sub
  260.  
  261.  
  262. Private Sub txtX2_GotFocus()
  263. txtX2.SelStart = 0
  264. txtX2.SelLength = Len(txtX2.Text)
  265. End Sub
  266.  
  267.  
  268. Private Sub txtY1_GotFocus()
  269. txtY1.SelStart = 0
  270. txtY1.SelLength = Len(txtY1.Text)
  271. End Sub
  272.  
  273.  
  274. Private Sub txtY2_GotFocus()
  275. txtY2.SelStart = 0
  276. txtY2.SelLength = Len(txtY2.Text)
  277. End Sub
  278.  
  279.  
  280. Private Sub txtZ1_GotFocus()
  281. txtZ1.SelStart = 0
  282. txtZ1.SelLength = Len(txtZ1.Text)
  283. End Sub
  284.  
  285.  
  286. Private Sub txtZ2_GotFocus()
  287. txtZ2.SelStart = 0
  288. txtZ2.SelLength = Len(txtZ2.Text)
  289. End Sub
  290.  
  291.  
  292.