###############################################################################
#
# setup.txt
# original menu scene for XR7: EarthStrike developed by Drake Analytics, Inc.
# www.xandis.com
#
# This is the data for the setup scene of the game:
#	Put up a back image; play some music; and generate/manage the GUI.
#	The GUI is the most complicated of the entire game. There are two
#	sliders to control volume settings, 2 sets of radio buttons for selecting
#	the input device and the number of players; and a check box to allow the
#	cheat key or not. Also, there is a CANCEL and an OK button.
#
#	The GUI spec is defined in setup-gui.txt.
#
# Note that setup is a unique scene and the application can override the
# defaults with internal information.
#
###############################################################################
def lighting MainAmbientLight
	color = 255 255 255 255
end

def bounds MainBounds
	min = -10.0 -10.0 -10.0
	max = 10.0 10.0 100.0
end

def projection NormalProjection
	nearplane	= 1.0
	farplane	= 100.0
	fov		= 0.7850
	aspect		= 1.0
end

def camera NormalCamera
	lookat	= 0.0 0.0 0.0
	pos	= 0.0 0.0 -10.0
	up	= 0.0 1.0 0.0
end

################## RENDER STATES ######################
#
def renderstate ModelRenderState
	id		= 1
	zenable		= t		# update the z-buffer or not
	specularenable	= f		
	fogenable	= f		# rendering with fog or not
	alphaenable	= f		# alpha blending or not
	lightenable	= t		# lighting or not (requires normals if on)
	fillmode	= SOLID		# SOLID | POINT | WIRE  (probably only SOLID works)
	shading		= GOURAUD	# GOURAUD | FLAT
	lighting	= 255 255 255	# R G B
	alphasrc	= SRCCOL
	alphadest	= DESTCOL
	blendop		= ADD
	cull		= CCW
	clipping	= y
end

def renderstate ParticleRenderState
	id		= 2
	zenable		= f
	specularenable	= f
	fogenable	= f
	alphaenable	= t
	lightenable	= f
	fillmode	= SOLID
	shading		= GOURAUD
	lighting	= 255 255 255
	alphasrc	= SRCALPHA
	alphadest	= INVDESTALPHA
	blendop		= ADD
	cull		= NONE
	clipping	= y
end

def renderstate SpriteRenderState
	id		= 3
	zenable		= f
	specularenable	= f
	fogenable	= f
	alphaenable	= t
	lightenable	= f
	fillmode	= SOLID
	shading		= GOURAUD
	lighting	= 255 255 255
	alphasrc	= SRCALPHA
	alphadest	= DESTALPHA
	blendop		= ADD
	cull		= NONE
	clipping	= y
end



###################### SPRITES #####################
#
def sprite GUIMouse
	source		= sprites\menu-mouse.dds
	transformed	= y
	maxonscreen	= 1
	size		= 1.0
	renderstate	= SpriteRenderState
end

def sprite GUIOKBtn1
	source		= sprites\setup-okbtn-1.dds
	transformed 	= y
	maxonscreen 	= 1
	size		= 1.0
	renderstate	= SpriteRenderState
end

def sprite GUIOKBtn2
	source		= sprites\setup-okbtn-2.dds
	transformed 	= y
	maxonscreen 	= 1
	size		= 1.0
	renderstate	= SpriteRenderState
end

def sprite GUIOKBtn3
	source		= sprites\setup-okbtn-3.dds
	transformed 	= y
	maxonscreen 	= 1
	size		= 1.0
	renderstate	= SpriteRenderState
end

def sprite GUIOKBtn4
	source		= sprites\setup-okbtn-4.dds
	transformed 	= y
	maxonscreen 	= 1
	size		= 1.0
	renderstate	= SpriteRenderState
end

def sprite GUICancelBtn1
	source		= sprites\setup-cancel-1.dds
	transformed 	= y
	maxonscreen 	= 1
	size		= 1.0
	renderstate	= SpriteRenderState
end

def sprite GUICancelBtn2
	source		= sprites\setup-cancel-2.dds
	transformed 	= y
	maxonscreen 	= 1
	size		= 1.0
	renderstate	= SpriteRenderState
end

def sprite GUICancelBtn3
	source		= sprites\setup-cancel-3.dds
	transformed 	= y
	maxonscreen 	= 1
	size		= 1.0
	renderstate	= SpriteRenderState
end

def sprite GUICancelBtn4
	source		= sprites\setup-cancel-4.dds
	transformed 	= y
	maxonscreen 	= 1
	size		= 1.0
	renderstate	= SpriteRenderState
end

def sprite GUISliderBtn1
	source		= sprites\setup-slider-1.dds
	transformed	= y
	maxonscreen	= 2
	size		= 1.0
	renderstate	= SpriteRenderState
end

def sprite GUISliderBtn2
	source		= sprites\setup-slider-2.dds
	transformed	= y
	maxonscreen	= 2
	size		= 1.0
	renderstate	= SpriteRenderState
end

def sprite GUIRadioBtn1
	source		= sprites\setup-radiobtn-1.dds
	transformed	= y
	maxonscreen	= 2
	size		= 1.0
	renderstate	= SpriteRenderState
end

def sprite GUIRadioBtn2
	source		= sprites\setup-radiobtn-2.dds
	transformed	= y
	maxonscreen	= 2
	size		= 1.0
	renderstate	= SpriteRenderState
end

def sprite GUIRadioBtn3
	source		= sprites\setup-radiobtn-3.dds
	transformed	= y
	maxonscreen	= 2
	size		= 1.0
	renderstate	= SpriteRenderState
end

def sprite GUIRadioBtn4
	source		= sprites\setup-radiobtn-4.dds
	transformed	= y
	maxonscreen	= 2
	size		= 1.0
	renderstate	= SpriteRenderState
end

def sprite GUIRadioBtn5
	source		= sprites\setup-radiobtn-5.dds
	transformed	= y
	maxonscreen	= 2
	size		= 1.0
	renderstate	= SpriteRenderState
end

def sprite GUIRadioBtn6
	source		= sprites\setup-radiobtn-6.dds
	transformed	= y
	maxonscreen	= 2
	size		= 1.0
	renderstate	= SpriteRenderState
end

def sprite GUICheckBtn1
	source		= sprites\setup-checkbtn-1.dds
	transformed	= y
	maxonscreen	= 1
	size		= 1.0
	renderstate	= SpriteRenderState
end

def sprite GUICheckBtn2
	source		= sprites\setup-checkbtn-2.dds
	transformed	= y
	maxonscreen	= 1
	size		= 1.0
	renderstate	= SpriteRenderState
end

def sprite GUICheckBtn3
	source		= sprites\setup-checkbtn-3.dds
	transformed	= y
	maxonscreen	= 1
	size		= 1.0
	renderstate	= SpriteRenderState
end

def sprite GUICheckBtn4
	source		= sprites\setup-checkbtn-4.dds
	transformed	= y
	maxonscreen	= 1
	size		= 1.0
	renderstate	= SpriteRenderState
end

def sprite GUICheckBtn5
	source		= sprites\setup-checkbtn-5.dds
	transformed	= y
	maxonscreen	= 1
	size		= 1.0
	renderstate	= SpriteRenderState
end

def sprite GUICheckBtn6
	source		= sprites\setup-checkbtn-6.dds
	transformed	= y
	maxonscreen	= 1
	size		= 1.0
	renderstate	= SpriteRenderState
end

def sprite BackImage1
	source		= sprites\setup-bkgrnd-1.bmp
	transformed	= y
	maxonscreen	= 1
	size		= 1.0
	renderstate	= SpriteRenderState
end

def sprite BackImage2
	source		= sprites\setup-bkgrnd-2.bmp
	transformed	= y
	maxonscreen	= 1
	size		= 1.0
	renderstate	= SpriteRenderState
end

def sprite BackImage3
	source		= sprites\setup-bkgrnd-3.bmp
	transformed	= y
	maxonscreen	= 1
	size		= 1.0
	renderstate	= SpriteRenderState
end

def sprite BackImage4
	source		= sprites\setup-bkgrnd-4.bmp
	transformed	= y
	maxonscreen	= 1
	size		= 1.0
	renderstate	= SpriteRenderState
end

def sprite BackImage5
	source		= sprites\setup-bkgrnd-5.bmp
	transformed	= y
	maxonscreen	= 1
	size		= 1.0
	renderstate	= SpriteRenderState
end

def sprite BackImage6
	source		= sprites\setup-bkgrnd-6.bmp
	transformed	= y
	maxonscreen	= 1
	size		= 1.0
	renderstate	= SpriteRenderState
end

###################### BACK IMAGE #####################
#
def backimage BackImage
	numimages	= 6
	image1		= BackImage1
	image2		= BackImage2
	image3		= BackImage3
	image4		= BackImage4
	image5		= BackImage5
	image6		= BackImage6
	pos1		= 15.5	42.5	0.0
	pos2		= 271.5	42.5	0.0
	pos3		= 527.5	42.5	0.0
	pos4		= 15.5	298.5	0.0
	pos5		= 271.5	298.5	0.0
	pos6		= 527.5	298.5	0.0
end

###################### GUI #####################
#
# GUI = Graphical User Interface
#
# A GUI may consist of buttons, sliders and an
# edit line. That's it; nothing complicated but
# just enough for 80s style arcade games. The
# real definition occurs in the source file.
#
def gui SetupGUI
	source = levels\setup-gui.txt
end

################# MUSIC AND WAVES #################
#
def music SetupMusic
	source	= audio\music\ALEX-woman1se.mid
	repeats = 1000
end


########################### SCENE ############################
#
# The 'setup' scene is a special-case scene since it represents
# a fixed pre-game element. As such, the scene runs forever and
# GUI processing for the menu selections is handled by the actual
# application (the game code).
#
# Handling of selected options is done by the application code.
#
def scene main
	playmusic	= SetupMusic
	setcamera	= NormalCamera
	setprojection	= NormalProjection
	setambientlight	= MainAmbientLight
	setbackcolor	= 0 0 0			# R G B
	setrenderstate	= ModelRenderState  	# start off with any old render state
	setbounds	= MainBounds
	setbackimage	= BackImage
	setgui		= SetupGUI
	waitframes	= 1000000		# wait a few hours
	eos				
end

### END OF SCENE
