; SummerBelle

; Constants -------------------------

[Constants]
global $active = 0
global $creditinfo = 0
global persist $bod = 0
global persist $top = 0
global persist $jack = 0
global persist $short = 0
global persist $hat = 0
global persist $bra = 0
global persist $thong = 0

[KeySwapBody]
condition = $active == 1
key = ctrl shift no_alt VK_UP
type = cycle
$bod = 0,1

[KeySwap]
condition = $active == 1
key = ctrl no_shift no_alt VK_UP
type = cycle
$top = 0,1

[KeySwap0]
condition = $active == 1
Key = no_ctrl no_shift alt VK_UP
type = cycle
$jack = 0,1,2

[KeySwap1]
condition = $active == 1
Key = ctrl no_shift no_alt VK_DOWN
type = cycle
$short = 0,1

[KeySwap2]
condition = $active == 1
Key = ctrl no_shift no_alt VK_RIGHT
type = cycle
$hat = 0,1

[KeySwap3]
condition = $active == 1
Key = no_ctrl shift no_alt VK_UP
type = cycle
$bra = 0,1

[KeySwap4]
condition = $active == 1
Key = no_ctrl shift no_alt VK_DOWN
type = cycle
$thong = 0,1

[Present]
post $active = 0
run = CommandListCreditInfo

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

[TextureOverrideSummerBelleHairBlend]
hash = 4bb8fccc
handling = skip
vb2 = ResourceSummerBelleHairBlend
if DRAW_TYPE == 1
	vb0 = ResourceSummerBelleHairPosition
	draw = 4557, 0

	$active = 1
endif

[TextureOverrideSummerBelleHairTexcoord]
hash = b536d9e6
vb1 = ResourceSummerBelleHairTexcoord

[TextureOverrideSummerBelleHairVertexLimitRaise]
hash = 898f40fc
override_vertex_count = 4557
override_byte_stride = 40

[TextureOverrideSummerBelleHairIB]
hash = a7683988
handling = skip

[TextureOverrideSummerBelleHairA]
hash = a7683988
match_first_index = 0
run = CommandListSkinTexture
ib = ResourceSummerBelleHairAIB
Resource\ZZMI\Diffuse = ref ResourceSummerBelleBodyADiffuse
Resource\ZZMI\NormalMap = ref ResourceSummerBelleBodyANormalMap
Resource\ZZMI\LightMap = ref ResourceSummerBelleBodyALightMap
Resource\ZZMI\MaterialMap = ref ResourceSummerBelleBodyAMaterialMap
run = CommandList\ZZMI\SetTextures
; FullHair (4066)
drawindexed = 16557, 0, 0
; Hat (491)
if $hat == 0
	drawindexed = 1794, 16557, 0
endif


[ResourceBodySO0]
stride = 40
[TextureOverrideSummerBelleBodyBlend]
hash = b36f6834
handling = skip
vb2 = ResourceSummerBelleBodyBlend
if DRAW_TYPE == 1
	vb0 = ResourceSummerBelleBodyPosition
	draw = 70677, 0
	ResourceBodySO0 = ref so0
	$active = 1
endif

[TextureOverrideSummerBelleBodyTexcoord]
hash = 91cdde70
vb1 = ResourceSummerBelleBodyTexcoord

[TextureOverrideSummerBelleBodyVertexLimitRaise]
hash = 051d5424
override_vertex_count = 70677
override_byte_stride = 40

[TextureOverrideSummerBelleTopBlend]
hash = 0a00d846
handling = skip
vb2 = ResourceSummerBelleTopBlend
if DRAW_TYPE == 1
	vb0 = ResourceSummerBelleTopPosition
	draw = 13266, 0

	$active = 1
endif

[TextureOverrideSummerBelleTopTexcoord]
hash = 325b4a1c
vb1 = ResourceSummerBelleTopTexcoord

[TextureOverrideSummerBelleTopVertexLimitRaise]
hash = a1de68c0
override_vertex_count = 13266
override_byte_stride = 40

[TextureOverrideSummerBelleBodyIB]
hash = 619c5c94
handling = skip

[TextureOverrideSummerBelleBodyA]
hash = 619c5c94
match_first_index = 0
run = CommandListSkinTexture
ib = ResourceSummerBelleBodyAIB
Resource\ZZMI\Diffuse = ref ResourceSummerBelleBodyADiffuse
Resource\ZZMI\NormalMap = ref ResourceSummerBelleBodyANormalMap
Resource\ZZMI\LightMap = ref ResourceSummerBelleBodyALightMap
Resource\ZZMI\MaterialMap = ref ResourceSummerBelleBodyAMaterialMap
run = CommandList\ZZMI\SetTextures
; Base (24204)
drawindexed = 42438, 0, 0
; JacketSleeves (Opaque)
if $jack == 1
	drawindexed = 9864, 271098, 0
endif
; ; JacketSleeves (1812)
; if $jack == 0
; 	drawindexed = 9864, 144840, 0
; endif
if $bod == 0
	; Boobs (3252)
	if $bra == 1
		drawindexed = 18912, 42438, 0
	endif
	; Bottom (10813)
	drawindexed = 54672, 80262, 0
	; bra (2856)
	if $bra == 0
		drawindexed = 31962, 189606, 0
	endif
	; JacketOp (1770)
	if $jack == 1
		drawindexed = 8784, 253530, 0
	endif
	; P (1934)
	if $thong == 1 && $short == 1
		drawindexed = 10560, 280962, 0
	endif
	; Shorts (3986)
	if $short == 0
		drawindexed = 18072, 302082, 0
	endif
	; Thong (1694)
	if $thong == 0
		drawindexed = 9018, 338226, 0
	endif
else if $bod == 1
	; Boobs (3252)
	if $bra == 1
		drawindexed = 18912, 61350, 0
	endif
	; Bottom (10813)
	drawindexed = 54672, 134934, 0
	; bra (2856)
	if $bra == 0
		drawindexed = 31962, 221568, 0
	endif
	; JacketOp (1770)
	if $jack == 1
		drawindexed = 8784, 262314, 0
	endif
	; P (1934)
	if $thong == 1 && $short == 1
		drawindexed = 10560, 291522, 0
	endif
	; Shorts (3986)
	if $short == 0
		drawindexed = 18072, 320154, 0
	endif
	; Thong (1694)
	if $thong == 0
		drawindexed = 9018, 347244, 0
	endif
endif
; PLEASE BE AWARE:
; Copying CB values is unpredictable
; I believe that, in the case of transparent parts,
; the usage should be safe and without major glitches
; this is due to the order of the render pipeline.
; We are using an opaque part, with a transparent shader,
; which will always be executed after the opaque part.
; We are also borrowing from the body, which should be stable.
; This could still break if multiple copies of the character are rendered
; Which is unlikely for Belle in her Summer outfit.
; - SinsOfSeven
ResourceCaputreCB0 = copy vs-cb0 unless_null
ResourceCaputreCB1 = copy vs-cb1 unless_null
[TextureOverrideSummerBelleBodyB]
hash = 619c5c94
match_first_index = 45060
run = CommandListSkinTexture
ib = ResourceSummerBelleBodyBIB
Resource\ZZMI\Diffuse = ref ResourceSummerBelleBodyADiffuse
Resource\ZZMI\NormalMap = ref ResourceSummerBelleBodyANormalMap
Resource\ZZMI\LightMap = ref ResourceSummerBelleBodyALightMap
Resource\ZZMI\MaterialMap = ref ResourceSummerBelleBodyAMaterialMap
run = CommandList\ZZMI\SetTextures
; BodyB (68)
if $bod == 0
	if $top == 0
		drawindexed = 264, 0, 0
	endif
else if $bod == 1
	if $top == 0
		drawindexed = 264, 264, 0
	endif
endif

[TextureOverrideSummerBelleBodyC]
hash = 619c5c94
match_first_index = 45324
run = CommandListSkinTexture
ib = ResourceSummerBelleBodyCIB
; BodyC (566)
drawindexed = 1608, 0, 0

[TextureOverrideSummerBelleBodyD]
hash = 619c5c94
match_first_index = 46932
run = CommandListSkinTexture
ib = ResourceSummerBelleBodyDIB
; BodyD (389)
drawindexed = 36, 0, 0

[ResourceCaputreCB0]
[ResourceCaputreCB1]
[TextureOverrideSummerBelleTopIB]
hash = 69148073
handling = skip

[TextureOverrideSummerBelleTopA]
hash = 69148073
match_first_index = 0
run = CommandListSkinTexture
ib = ResourceSummerBelleTopAIB
Resource\ZZMI\Diffuse = ref ResourceSummerBelleBodyADiffuse
Resource\ZZMI\NormalMap = ref ResourceSummerBelleBodyANormalMap
Resource\ZZMI\LightMap = ref ResourceSummerBelleBodyALightMap
Resource\ZZMI\MaterialMap = ref ResourceSummerBelleBodyAMaterialMap
run = CommandList\ZZMI\SetTextures
; Jacket (1770)
if $bod == 0
	if $jack == 0
		drawindexed = 8784, 0, 0
	endif
	; TopMain (2206)
	if $top == 0
		drawindexed = 11868, 17568, 0
	endif
	; TopSleeves (2657)
	if $top == 0 && $jack == 2
		drawindexed = 12960, 41304, 0
	endif
else if $bod == 1
	if $jack == 0
		drawindexed = 8784, 8784, 0
	endif
	; TopMain (2206)
	if $top == 0
		drawindexed = 11868, 29436, 0
	endif
	; TopSleeves (2657)
	if $top == 0 && $jack == 2
		drawindexed = 12960, 54264, 0
	endif
endif

; JacketSleeves (1812)
if $jack == 0
	; Read [TextureOverrideSummerBelleBodyA]
	ResourceTemp0 = ref vs-cb0
	ResourceTemp1 = ref vs-cb1
	ib = ResourceSummerBelleBodyAIB
	vb0 = ResourceBodySO0
	vb3 = ResourceBodySO0
	vb1 = ResourceSummerBelleBodyTexcoord
	vb2 = ResourceSummerBelleBodyBlend
	vs-cb0 = ref ResourceCaputreCB0
	vs-cb1 = ref ResourceCaputreCB1
	drawindexed = 9864, 271098, 0
	vs-cb0 = ref ResourceTemp0
	vs-cb1 = ref ResourceTemp1
endif


[ResourceTemp0]
[ResourceTemp1]

[TextureOverrideSummerBelleFace]
hash = 9a9780a7
run = CommandListSkinTexture
Resource\ZZMI\Diffuse = ref ResourceSummerBelleFace
run = CommandList\ZZMI\SetTextures
match_priority=1



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

[CommandListCreditInfo]
if $creditinfo == 0 && $active > 0
	pre Resource\ShaderFixes\help.ini\Notification = ResourceCreditInfo
	pre run = CustomShader\ShaderFixes\help.ini\FormatText
	pre $\ShaderFixes\help.ini\notification_timeout = time + 7.0
	$creditinfo = 1
endif

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

[ResourceSummerBelleHairPosition]
type = Buffer
stride = 40
filename = SummerBelleHairPosition.buf

[ResourceSummerBelleHairBlend]
type = Buffer
stride = 32
filename = SummerBelleHairBlend.buf

[ResourceSummerBelleHairTexcoord]
type = Buffer
stride = 20
filename = SummerBelleHairTexcoord.buf

[ResourceSummerBelleHairAIB]
type = Buffer
format = DXGI_FORMAT_R32_UINT
filename = SummerBelleHairA.ib

[ResourceSummerBelleBodyPosition]
type = Buffer
stride = 40
filename = SummerBelleBodyPosition.buf

[ResourceSummerBelleBodyBlend]
type = Buffer
stride = 32
filename = SummerBelleBodyBlend.buf

[ResourceSummerBelleBodyTexcoord]
type = Buffer
stride = 20
filename = SummerBelleBodyTexcoord.buf

[ResourceSummerBelleBodyAIB]
type = Buffer
format = DXGI_FORMAT_R32_UINT
filename = SummerBelleBodyA.ib

[ResourceSummerBelleBodyBIB]
type = Buffer
format = DXGI_FORMAT_R32_UINT
filename = SummerBelleBodyB.ib

[ResourceSummerBelleBodyCIB]
type = Buffer
format = DXGI_FORMAT_R32_UINT
filename = SummerBelleBodyC.ib

[ResourceSummerBelleBodyDIB]
type = Buffer
format = DXGI_FORMAT_R32_UINT
filename = SummerBelleBodyD.ib

[ResourceSummerBelleTopPosition]
type = Buffer
stride = 40
filename = SummerBelleTopPosition.buf

[ResourceSummerBelleTopBlend]
type = Buffer
stride = 32
filename = SummerBelleTopBlend.buf

[ResourceSummerBelleTopTexcoord]
type = Buffer
stride = 20
filename = SummerBelleTopTexcoord.buf

[ResourceSummerBelleTopAIB]
type = Buffer
format = DXGI_FORMAT_R32_UINT
filename = SummerBelleTopA.ib

[ResourceSummerBelleHatPosition]
type = Buffer
stride = 40
filename = SummerBelleHatPosition.buf

[ResourceSummerBelleHatBlend]
type = Buffer
stride = 32
filename = SummerBelleHatBlend.buf

[ResourceSummerBelleHatTexcoord]
type = Buffer
stride = 20
filename = SummerBelleHatTexcoord.buf

[ResourceSummerBelleHatAIB]
type = Buffer
format = DXGI_FORMAT_R32_UINT
filename = SummerBelleHatA.ib

[ResourceSummerBelleFace]
filename = Face.dds

[ResourceSummerBelleBodyADiffuse]
filename = Diffuse.dds

[ResourceSummerBelleBodyANormalMap]
filename = Normal.dds

[ResourceSummerBelleBodyALightMap]
filename = LightMap.dds

[ResourceSummerBelleBodyAMaterialMap]
filename = Material.dds

[ResourceCreditInfo]
type = Buffer
data = "Created by Hazeker"

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