
--
-- Copyright (C) 2024  <fastrgv@gmail.com>
--
-- This program is free software: you can redistribute it and/or modify
-- it under the terms of the GNU General Public License as published by
-- the Free Software Foundation, either version 3 of the License, or
-- (at your option) any later version.
--
-- This program is distributed in the hope that it will be useful,
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-- GNU General Public License for more details.
--
-- You may read the full text of the GNU General Public License
-- at <http://www.gnu.org/licenses/>.
--



separate (avent)


procedure setup_scene3 is 
--   scene #2 (NOW, between M7, L8)

	--yr,yc, xr, zr: float;
	hwdoor : constant float := 0.8; --halfWidth
	hhdoor : constant float := 0.9; --halfHeight
	iymaze : constant float := -iymax+hhdoor;

begin


	--walls

	-- (ZP/ZM doors placed in center; no floor; narrow)

	-- omit ZM,ZP,YP; also make extra wide...
	-- ...wide to hide offset contents of M7, L8
	droomobj.setrect3( mdo3,
		0.0, -iymax/2.0, 0.0,           --xc,yc,zc
		--ixmax,iymax/2.0,izmax/3.0,      --xr,yr,zr
		--ixmax/4.0,iymax,izmax/8.0);     --sx,sy,sz (texture scale)

		ixmax,iymax/2.0,izmax+7.0,      --xr,yr,zr
		ixmax/4.0,iymax,izmax/2.0);     --sx,sy,sz (texture scale)


	--filler slab YP only
	rectobj.setrect2( 
		cfloorzm,
		 ixmax,-iymax,-izmax/3.0,
		 ixmax,-iymax,-izmax-7.0,
		-ixmax,-iymax,-izmax-7.0,
		-ixmax,-iymax,-izmax/3.0);

	rectobj.setrect2( 
		cfloorzp,
		-ixmax,-iymax, izmax/3.0,
		-ixmax,-iymax, izmax+7.0,
		 ixmax,-iymax, izmax+7.0,
		 ixmax,-iymax, izmax/3.0);


	--2 corner pillars on Lab8---------------------------
	cylobj.setcyl( pillar15,
		ixmax-0.55, -iymax/2.0, izmax+7.0,
		iymax/1.0, 0.55,
		j1,j2,j3,j4,j5,j6);

	cylobj.setcyl( pillar16,
		ixmax-0.55, -iymax/2.0, -izmax-7.0,
		iymax/1.0, 0.55,
		j1,j2,j3,j4,j5,j6);

----------------------------------------- 2pillars M7:
	cylobj.setcyl( pillar17, --no longer drawn
		-ixmax, -iymax/2.0, -izmax-7.0,
		iymax/1.0, 0.55,
		j1,j2,j3,j4,j5,j6);

	cylobj.setcyl( pillar18, --no longer drawn
		-ixmax, -iymax/2.0, izmax+7.0,
		iymax/1.0, 0.55,
		j1,j2,j3,j4,j5,j6);


	--2 pillar caps Lab8: ----------------------------
	rectobj.setrect(cap1, 
		ixmax-0.55, iymax/2.0, izmax+7.0,
		0.6, 0.2, 0.6,
		j1,j2,j3,j4,j5,j6);

	rectobj.setrect(cap2, 
		ixmax-0.55, iymax/2.0, -izmax-7.0,
		0.6, 0.2, 0.6,
		j1,j2,j3,j4,j5,j6);

--------------------------------------caps M7:

	--reusing cap3 for facade @ -ixmax
	pictobj.setrect(facade, 2,
		-ixmax+0.01, -iymax/2.0, 0.0,
		0.0, iymax/2.0, izmax+7.0, 7.0,2.0 ); --su=7, sv=2


--	rectobj.setrect(cap3, 
--		-ixmax, iymax/2.0, -izmax-7.0,
--		0.6, 0.2, 0.6,
--		j1,j2,j3,j4,j5,j6);

--	rectobj.setrect(cap4, 
--		-ixmax, iymax/2.0, izmax+7.0,
--		0.6, 0.2, 0.6,
--		j1,j2,j3,j4,j5,j6);

---------------------------------------------

	--greek-key pattern on L8:
	pictobj.setrect(greek, 1,
		ixmax-0.05, -0.33, 0.0,
		0.0, 0.3, izmax+7.0,
		15.0); --su=15

	--minoan horns on L8:
	pictobj.setrect(horns, 1,
		ixmax-0.05, 1.2, 0.0,
		0.0, 1.2, 2.0,
		1.0);





	--path across
	rectobj.setrect2( cfloors, -- abs(z) < 0.32:
		+ixmax, -iymax, -0.4*hwdoor,     --UL sw
		-ixmax, -iymax, -0.4*hwdoor,     --LL se
		-ixmax, -iymax, +0.4*hwdoor,     --LR ne
		+ixmax, -iymax, +0.4*hwdoor);    --UR nw




------- the pungee sticks: --------------------------------------------------
	punobj.setpun(pun3a, 
		ixmax-0.5, -4.6*iymax, -0.3, 0.4*iymax, 0.04, 0.4, ixmax-2.0, -0.3 );

	punobj.setpun(pun3b, 
		ixmax-0.5, -4.6*iymax, -2.1, 0.4*iymax, 0.04, 0.4, ixmax-2.0, -2.1 );

	punobj.setpun(pun3c, 
		ixmax-0.5, -4.6*iymax, +1.5, 0.4*iymax, 0.04, 0.4, ixmax-2.0, +1.5 );


	punobj.setpun(pun3d, 
		ixmax-1.5, -4.5*iymax,  0.3, 0.4*iymax, 0.04, 0.4, ixmax-3.0,  0.3 );

	punobj.setpun(pun3e, 
		ixmax-1.5, -4.5*iymax, -1.5, 0.4*iymax, 0.04, 0.4, ixmax-3.0, -1.5 );

	punobj.setpun(pun3f, 
		ixmax-1.5, -4.5*iymax, +2.1, 0.4*iymax, 0.04, 0.4, ixmax-3.0, +2.1 );

-------------------------- now need a skull near them -------------------------








	--Back floor projecting west&down:
	rectobj.setrect2( 
		cfloorb,
		+ixmax, -5.0*iymax, -izmax/3.0, --sw
		-ixmax, -iymax, -izmax/3.0, --se
		-ixmax, -iymax, +izmax/3.0, --ne
		+ixmax, -5.0*iymax, +izmax/3.0);--nw



	--Front floor = vertical west wall
	rectobj.setrect2( 
		cfloorf,
		+ixmax,-5.0*iymax,-izmax/3.0,  --nw LL
		+ixmax,-5.0*iymax,+izmax/3.0, --ne LR
		+ixmax, -iymax,   +izmax/3.0, --UR
		+ixmax, -iymax,   -izmax/3.0);  --UL


	--Left (south:ZM) wall
	rectobj.setrect2( 
		cfloorl,
		-ixmax,-5.0*iymax,-izmax/3.0,  --nw LL
		+ixmax,-5.0*iymax,-izmax/3.0, --ne LR
		+ixmax, -iymax,   -izmax/3.0, --UR
		-ixmax, -iymax,   -izmax/3.0);  --UL


	--Right (north:ZP) wall
	rectobj.setrect2( 
		cfloorr,
		+ixmax,-5.0*iymax,+izmax/3.0,  --nw LL
		-ixmax,-5.0*iymax,+izmax/3.0, --ne LR
		-ixmax, -iymax,   +izmax/3.0, --UR
		+ixmax, -iymax,   +izmax/3.0);  --UL






-- labyrinth sign:
	pictobj.setrect( lh3, 1,
		10.0-eps, iymaze+hhdoor+0.2, 0.0,
		0.0, 0.15, hwdoor,
		j1,j2,j3,j4,j5,j6);


----------------------------doors begin -----------------------
	--exit door to L8
	pictobj.setrect( g3, 1,
		10.0-eps, iymaze, 0.0,
		0.0, hhdoor, hwdoor,
		j1,j2,j3,j4,j5,j6);

xdc3(1):= 10.0;
zdc3(1):= 0.0;



	--door to M7
	pictobj.setrect( h3, 2,
		-10.0+eps, iymaze, 0.0,
		0.0, hhdoor, hwdoor*0.5,
		j1,j2,j3,j4,j5,j6);

xdc3(13):= -10.0;
zdc3(13):= 0.0;
--Attention: #13 is the magic number for half-width door
--...see texobjShine.fs...

----------------------------doors end --------------------------

	--exit sign to m7
	pictobj.setrect( eh3, 2,
		-10.0+eps, iymaze+hhdoor+0.1, 0.0,
		0.0, 0.1, hwdoor*0.5,
		j1,j2,j3,j4,j5,j6);







end setup_scene3;



