surface htexmap
param	string	texname		""
param	point	maporigin		0 0 0
local	string	$_str_2 	"current"
param	float	scales		1
param	float	scalet		1
local	string	$_str_0 	""
local	string	$_str_1 	"shader"
local	color	ctx	0 0 0
local	float	theta	0
local	float	phi	0
local	point	xaxis	0 0 0
local	point	yaxis	0 0 0
local	point	zaxis	0 0 0
local	point	PP	0 0 0
local	point	NN	0 0 0
local	point	Projxz	0 0 0
local	point	V	0 0 0
local	normal	Nf	0 0 0
initcode 1
	pushiv	0 0 0 
	pushs	$_str_2 
	pushs	$_str_1 
	transform2s
	popv	maporigin 
initcode 3
	return
code
	pushif	0 
	popf	theta 
	pushif	0 
	popf	phi 
	pushiv	1 0 0 
	pushs	$_str_2 
	pushs	$_str_1 
	transform2s
	popv	xaxis 
	pushiv	0 1 0 
	pushs	$_str_2 
	pushs	$_str_1 
	transform2s
	popv	yaxis 
	pushiv	0 0 1 
	pushs	$_str_2 
	pushs	$_str_1 
	transform2s
	popv	zaxis 
	pushv	N 
	negv
	normalize
	pushs	$_str_1 
	transforms
	popv	Nf 
	pushv	P 
	pushs	$_str_1 
	transforms
	popv	PP 
	pushs	$_str_0 
	pushs	texname 
	seq
	ifz	0
	pushif	1 
	cset	ctx 
	jump	1
label 0
	pushif	2 
	pushif	1 
	pushv	Nf 
	zcomp
	subff
	divff
	pushif	2 
	pushif	1 
	pushv	Nf 
	xcomp
	subff
	divff
	pushif	-1 
	pushs	texname 
	pushif	2 
	pushif	2 
	ctexture
	popc	ctx 
label 1
	return_area
	cpCC	Os Oi 
	pushiv	0.2 0.2 0.2 
	addC	ctx 
	mulC	Os 
	popc	Ci 
	return