; BelleSummer

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

[Constants]
global $active = 0
global $creditinfo = 0
global persist $top = 0
global persist $bottom = 0
global persist $glove = 0
global persist $shoes = 0
global persist $neck = 0
global persist $hat = 0
global persist $pubic = 0

[KeyTop]
condition = $active == 1
key = VK_UP
type = cycle
$top = 0,1,2,3,4

[KeyBottom]
condition = $active == 1
key = VK_DOWN
type = cycle
$bottom = 0,1,2

[KeyGlove]
condition = $active == 1
key = VK_RIGHT
type = cycle
$glove = 0,1,2,3

[KeyShoes]
condition = $active == 1
key = VK_LEFT
type = cycle
$shoes = 0,1

[KeyNeck]
condition = $active == 1
key = VK_END
type = cycle
$neck = 0,1

[KeyHat]
condition = $active == 1
key = VK_PGDN
type = cycle
$hat = 0,1

[KeyPubic]
condition = $active == 1
key = VK_HOME
type = cycle
$pubic = 0,1

[Present]
post $active = 0
run = CommandListCreditInfo

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

[TextureOverrideBelleSummerBodyBlend]
hash = 4f3ddd5c
handling = skip
vb2 = ResourceBelleSummerBodyBlend
if DRAW_TYPE == 1
	vb0 = ResourceBelleSummerBodyPosition
	draw = 65572, 0

	$active = 1
endif

[TextureOverrideBelleSummerBodyTexcoord]
hash = f5e62ded
vb1 = ResourceBelleSummerBodyTexcoord

[TextureOverrideBelleSummerBodyVertexLimitRaise]
hash = 2ceb44ef
override_vertex_count = 65572
override_byte_stride = 40

[TextureOverrideBelleSummerTShirtBlend]
hash = 0139f7e8
handling = skip
vb2 = ResourceBelleSummerTShirtBlend
if DRAW_TYPE == 1
	vb0 = ResourceBelleSummerTShirtPosition
	draw = 1297, 0

	$active = 1
endif

[TextureOverrideBelleSummerTShirtTexcoord]
hash = 881514bf
vb1 = ResourceBelleSummerTShirtTexcoord

[TextureOverrideBelleSummerTShirtVertexLimitRaise]
hash = a1de68c0
override_vertex_count = 1297
override_byte_stride = 40

[TextureOverrideBelleSummerHatBlend]
hash = b7061769
handling = skip
vb2 = ResourceBelleSummerHatBlend
if DRAW_TYPE == 1
	vb0 = ResourceBelleSummerHatPosition
	draw = 470, 0

	$active = 1
endif

[TextureOverrideBelleSummerHatTexcoord]
hash = a8b3bbab
vb1 = ResourceBelleSummerHatTexcoord

[TextureOverrideBelleSummerHatVertexLimitRaise]
hash = bd2cf1bc
override_vertex_count = 470
override_byte_stride = 40

[TextureOverrideBelleSummerBodyIB]
hash = 43ed3c22
handling = skip

[TextureOverrideBelleSummerBodyA]
hash = 43ed3c22
match_first_index = 0
ib = ResourceBelleSummerBodyAIB
if $pubic == 0 
	Resource\ZZMI\Diffuse = ref ResourceBelleSummerBodyADiffuse
else if $pubic == 1
	Resource\ZZMI\Diffuse = ref ResourceBelleSummerBodyADiffusePubic
endif
Resource\ZZMI\NormalMap = ref ResourceBelleSummerBodyANormalMap
Resource\ZZMI\LightMap = ref ResourceBelleSummerBodyALightMap
Resource\ZZMI\MaterialMap = ref ResourceBelleSummerBodyAMaterialMap
run = CommandList\ZZMI\SetTextures
; BodyA (42823)
drawindexed = 238677, 0, 0

if $bottom == 1
	; BodyABottom1 (1324)
	drawindexed = 4548, 238677, 0
else if $bottom == 2
	; BodyABottom2 (1400)
	drawindexed = 5232, 243225, 0
endif

if $glove == 1 || $glove == 2
	; BodyAGlove1 (330)
	drawindexed = 906, 248457, 0
endif

if $top == 0 || $top == 3
	; BodyANipple (1920)
	drawindexed = 10656, 249363, 0
else if $top == 1 || $top == 2
	; BodyATop1 (1024)
	drawindexed = 3708, 328878, 0
else if $top == 4
	; BodyATop3 (1633)
	drawindexed = 5772, 332586, 0
endif

if $shoes == 0
	; BodyAShoes0 (9981)
	drawindexed = 52269, 260019, 0
else if $shoes == 1 
	; BodyAShoes1 (4114)
	drawindexed = 16590, 312288, 0
endif

[TextureOverrideBelleSummerBodyB]
hash = 43ed3c22
match_first_index = 46212
ib = ResourceBelleSummerBodyBIB
run = CommandList\ZZMI\SetTextures

if $top == 2 || $top == 3
	; BodyBTop2 (68)
	drawindexed = 264, 0, 0
endif

[TextureOverrideBelleSummerBodyC]
hash = 43ed3c22
match_first_index = 46476
ib = ResourceBelleSummerBodyCIB
run = CommandList\ZZMI\SetTextures

if $glove == 1 || $glove == 3
	; BodyCGlove2 (342)
	drawindexed = 936, 0, 0
endif

if $neck == 1
	; BodyCNeck (224)
	drawindexed = 672, 936, 0
endif

[TextureOverrideBelleSummerBodyD]
hash = 43ed3c22
match_first_index = 48084
ib = ResourceBelleSummerBodyDIB
run = CommandList\ZZMI\SetTextures
; BodyD (389)
drawindexed = 972, 0, 0

[TextureOverrideBelleSummerTShirtIB]
hash = 69148073
handling = skip

[TextureOverrideBelleSummerTShirtA]
hash = 69148073
match_first_index = 0
ib = ResourceBelleSummerTShirtAIB
if $pubic == 0 
	Resource\ZZMI\Diffuse = ref ResourceBelleSummerBodyADiffuse
else if $pubic == 1
	Resource\ZZMI\Diffuse = ref ResourceBelleSummerBodyADiffusePubic
endif
Resource\ZZMI\NormalMap = ref ResourceBelleSummerBodyANormalMap
Resource\ZZMI\LightMap = ref ResourceBelleSummerBodyALightMap
Resource\ZZMI\MaterialMap = ref ResourceBelleSummerBodyAMaterialMap
run = CommandList\ZZMI\SetTextures

if $top == 2 || $top == 3
	; TShirtATop2 (1297)
	drawindexed = 5838, 0, 0
endif

[TextureOverrideBelleSummerHatIB]
hash = 93f38bdd
handling = skip

[TextureOverrideBelleSummerHatA]
hash = 93f38bdd
match_first_index = 0
ib = ResourceBelleSummerHatAIB
run = CommandList\ZZMI\SetTextures

if $hat == 1
	; HatA (470)
	drawindexed = 1794, 0, 0
endif

; 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 + 5.0
	$creditinfo = 1
endif

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

[ResourceBelleSummerBodyPosition]
type = Buffer
stride = 40
filename = BelleSummerBodyPosition.buf

[ResourceBelleSummerBodyBlend]
type = Buffer
stride = 32
filename = BelleSummerBodyBlend.buf

[ResourceBelleSummerBodyTexcoord]
type = Buffer
stride = 20
filename = BelleSummerBodyTexcoord.buf

[ResourceBelleSummerBodyAIB]
type = Buffer
format = DXGI_FORMAT_R32_UINT
filename = BelleSummerBodyA.ib

[ResourceBelleSummerBodyBIB]
type = Buffer
format = DXGI_FORMAT_R32_UINT
filename = BelleSummerBodyB.ib

[ResourceBelleSummerBodyCIB]
type = Buffer
format = DXGI_FORMAT_R32_UINT
filename = BelleSummerBodyC.ib

[ResourceBelleSummerBodyDIB]
type = Buffer
format = DXGI_FORMAT_R32_UINT
filename = BelleSummerBodyD.ib

[ResourceBelleSummerTShirtPosition]
type = Buffer
stride = 40
filename = BelleSummerTShirtPosition.buf

[ResourceBelleSummerTShirtBlend]
type = Buffer
stride = 32
filename = BelleSummerTShirtBlend.buf

[ResourceBelleSummerTShirtTexcoord]
type = Buffer
stride = 20
filename = BelleSummerTShirtTexcoord.buf

[ResourceBelleSummerTShirtAIB]
type = Buffer
format = DXGI_FORMAT_R32_UINT
filename = BelleSummerTShirtA.ib

[ResourceBelleSummerHatPosition]
type = Buffer
stride = 40
filename = BelleSummerHatPosition.buf

[ResourceBelleSummerHatBlend]
type = Buffer
stride = 32
filename = BelleSummerHatBlend.buf

[ResourceBelleSummerHatTexcoord]
type = Buffer
stride = 20
filename = BelleSummerHatTexcoord.buf

[ResourceBelleSummerHatAIB]
type = Buffer
format = DXGI_FORMAT_R32_UINT
filename = BelleSummerHatA.ib

[ResourceBelleSummerBodyADiffuse]
filename = BelleSummerBodyADiffuse.dds

[ResourceBelleSummerBodyADiffusePubic]
filename = BelleSummerBodyADiffusePubic.dds

[ResourceBelleSummerBodyANormalMap]
filename = BelleSummerBodyANormalMap.jpg

[ResourceBelleSummerBodyALightMap]
filename = BelleSummerBodyALightMap.dds

[ResourceBelleSummerBodyAMaterialMap]
filename = BelleSummerBodyAMaterialMap.dds

[ResourceCreditInfo]
type = Buffer
data = "Created by patreon.com/c/AndyCarty"

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

; Remapping Belle 2.2 by Mugen
