; Saber

; Constants -------------------------
[Constants]
global persist $costume = 0
global persist $gardi = 0
global persist $bunny = 0
global persist $texc = 0
global $active

[KeySwapCostume]
key = ]
back = [
condition = $active == 1
type = cycle
$costume = 0,1,2,3,4,5

[KeyGardi]
key = VK_UP
condition = $active == 1
type = cycle
$gardi = 0,1

[KeyBunny]
key = VK_LEFT
condition = $active == 1
type = cycle
$bunny = 0,1

[KeySwaptexc]
key = VK_DOWN
condition = $active == 1
type = cycle
$texc = 0,1,2

[Present]
post $active = 0

; Overrides -------------------------



[TextureOverrideSaberBodyBlend]
hash = b253cea3
$active = 1
handling = skip
vb2 = ResourceSaberBodyBlend
if DRAW_TYPE == 1
	vb0 = ResourceSaberBodyPosition
	draw = 87218,0
endif
if DRAW_TYPE == 8
	Resource\SRMI\PositionBuffer = ref ResourceSaberBodyPositionCS
	Resource\SRMI\BlendBuffer = ref ResourceSaberBodyBlendCS
	$\SRMI\vertex_count = 87218
endif

[TextureOverrideSaberBodyTexcoord]
hash = b8a256f4
vb1 = ResourceSaberBodyTexcoord

[TextureOverrideSaberBodyVertexLimitRaise]
hash = 90edbf77
override_vertex_count = 87218
override_byte_stride = 92
uav_byte_stride = 4

[TextureOverrideSaberBodyIB]
hash = baf67415
handling = skip

[TextureOverrideSaberBodyA]
hash = baf67415
match_first_index = 0
ib = ResourceSaberBodyAIB
; SaberBodyA-vb0=9ccfdcd1.txt.001 (209)
drawindexed = 774, 0, 0
; SaberBodyA
	; vanila0_0 (4488)
if $costume == 0
	drawindexed = 12969, 274911, 0

else if $costume == 1
	; dress0 (3770)
	drawindexed = 20439, 37398, 0
	if $gardi == 1
	; gardi (2590)
	drawindexed = 12312, 262599, 0
	endif
else if $costume == 2
	; dress1 (8831)
	drawindexed = 45210, 57837, 0
	if $gardi == 1
	; gardi (2590)
	drawindexed = 12312, 262599, 0
	endif
else if $costume == 3
	; dress2 (19968)
	drawindexed = 111192, 103047, 0
	if $gardi == 1
	; gardi (2590)
	drawindexed = 12312, 262599, 0
	endif
else if $costume == 4
	; dress3 (8980)
	drawindexed = 48360, 214239, 0
	if $gardi == 1
	; gardi (2590)
	drawindexed = 12312, 262599, 0
	endif
else if $costume == 5
	; bunny (6067)
	drawindexed = 23040, 774, 0
	; bunny.001 (2740)
	if $bunny == 0
	drawindexed = 13584, 23814, 0
	endif
endif


[TextureOverrideSaberBodyADiffuse]
hash = 733dd241
if $texc == 0
	this = ResourceSaberBodyADiffuse
	if $costume == 5 && $bunny == 0
		this = ResourceSaberBodyADiffuse1
	else if $costume == 5 && $bunny == 1
		this = ResourceSaberBodyADiffuse3	
	endif
else if $texc == 1
	this = ResourceSaberBodyADiffuse1
	if $costume == 5 && $bunny == 0
		this = ResourceSaberBodyADiffuse1
	else if $costume == 5 && $bunny == 1
		this = ResourceSaberBodyADiffuse3	
	endif
else if $texc == 2
	this = ResourceSaberBodyADiffuse2
	if $costume == 5 && $bunny == 0
		this = ResourceSaberBodyADiffuse2
	else if $costume == 5 && $bunny == 1
		this = ResourceSaberBodyADiffuse3	
	endif
endif

[TextureOverrideSaberBodyALightMap]
hash = 51811a92
this = ResourceSaberBodyALightMap

[TextureOverrideSaberBodyB]
hash = baf67415
match_first_index = 11712
ib = ResourceSaberBodyBIB
; SaberBodyB-vb0=9ccfdcd1.txt.055 (4834)
drawindexed = 17538, 0, 0
; SaberBodyB
if $costume == 0
	; vanila0_1 (5677)
	drawindexed = 22734, 121458, 0
else if $costume == 1
	; main (10383)
	drawindexed = 56358, 17538, 0
else if $costume == 2
	; main (10383)
	drawindexed = 56358, 17538, 0
else if $costume == 3
	; main (10383)
	drawindexed = 56358, 17538, 0
else if $costume == 4
	; main (10383)
	drawindexed = 56358, 17538, 0
else if $costume == 5
	; main.002 (8681)
	drawindexed = 47562, 73896, 0.
endif

[TextureOverrideSaberBodyBStockingMap]
hash = 2a6f20a8
this = ResourceSaberBodyBStockingMap


; CommandList -----------------------

; Resources -------------------------

[ResourceSaberBodyPosition]
type = Buffer
stride = 40
filename = SaberBodyPosition.buf

[ResourceSaberBodyBlend]
type = Buffer
stride = 32
filename = SaberBodyBlend.buf

[ResourceSaberBodyTexcoord]
type = Buffer
stride = 20
filename = SaberBodyTexcoord.buf

[ResourceSaberBodyAIB]
type = Buffer
format = DXGI_FORMAT_R32_UINT
filename = SaberBodyA.ib

[ResourceSaberBodyBIB]
type = Buffer
format = DXGI_FORMAT_R32_UINT
filename = SaberBodyB.ib


[ResourceSaberBodyADiffuse]
filename = SaberBodyADiffuse.dds

[ResourceSaberBodyADiffuse1]
filename = SaberBodyADiffuse1.dds

[ResourceSaberBodyADiffuse2]
filename = SaberBodyADiffuse2.dds

[ResourceSaberBodyADiffuse3]
filename = SaberBodyADiffuse3.dds

[ResourceSaberBodyALightMap]
filename = SaberBodyALightMap2.dds

[ResourceSaberBodyBStockingMap]
filename = SaberBodyBStockingMap.dds




; .ini generated by XXMI (XX-Model-Importer)
; If you have any issues or find any bugs, please open a ticket at https://github.com/leotorrez/XXMI-Tools/issues
; -------------------- Auto-generated CS resources --------------------

[ResourceSaberBodyDrawCS]
type = RWStructuredBuffer
array = 87218
data = R32_FLOAT 1 2 3 4 5 6 7 8 9 10

[ResourceSaberBodyPositionCS]
type = StructuredBuffer
stride = 40
filename = SaberBodyPosition.buf

[ResourceSaberBodyBlendCS]
type = StructuredBuffer
stride = 32
filename = SaberBodyBlend.buf

