Guest User

Untitled

a guest
Feb 28th, 2018
114
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.             ; We need to tear apart the name to get the textures to use
  2.             splitter1 = Instr(Name$, "GRASS_") + 6
  3.             Splitter2 = Instr(Name$, "_", splitter1) + 1
  4.             Splitter3 = Instr(Name$, ".", Splitter2) + 1
  5.             gpGrassMeshName$ = Mid$(Name$, splitter1, (splitter2 - splitter1) - 1)
  6.             meshFileType$ = Right$(Lower$(gpGrassMeshName$), 1)
  7.             gpGrassMeshName$ = Left$(gpGrassMeshName$, Len(gpGrassMeshName$) - 1)
  8.             ; meshTypes : 3 = .3ds; x = .x ; b = .b3d
  9.             If meshFileType$ = "3"
  10.                 gpGrassMeshName$ = gpGrassMeshName$ + ".3ds"
  11.             ElseIf meshFileType$ = "x"
  12.                 gpGrassMeshName$ = gpGrassMeshName$ + ".x"
  13.             ElseIf meshFileType$ = "b"
  14.                 gpGrassMeshName$ = gpGrassMeshName$ + ".b3d"
  15.             EndIf
  16.            
  17.             gpGrassTextureName$ = Mid$(Name$, Splitter2, (splitter3 - splitter2) - 1)
  18.             texFileType$ = Right$(Lower$(gpGrassTextureName$), 1)
  19.             gpGrassTextureName$ = Left$(gpGrassTextureName$, Len(gpGrassTextureName$) - 1)
  20.             ; texTypes : j = .jpg; b = .bmp; p = .png; d = .dds; t = .tga
  21.             If texFileType$ = "j"
  22.                 gpGrassTextureName$ = gpGrassTextureName$ + ".jpg"
  23.             ElseIf texFileType$ = "b"
  24.                 gpGrassTextureName$ = gpGrassTextureName$ + ".bmp"
  25.             ElseIf texFileType$ = "p"
  26.                 gpGrassTextureName$ = gpGrassTextureName$ + ".png"
  27.             ElseIf texFileType$ = "d"
  28.                 gpGrassTextureName$ = gpGrassTextureName$ + ".dds"
  29.             ElseIf texFileType$ = "t"
  30.                 gpGrassTextureName$ = gpGrassTextureName$ + ".tga"
  31.             EndIf
Add Comment
Please, Sign In to add comment