#!/bin/bash -e

source /usr/share/common-install-function-ddebs/common-install-function

domain=primary-by-qaz

APP_FULLNAME="Primary"
APP_COPYRIGHT="Qaz"
APP_DESC="demo by Qaz released in 2010"

APP_EXE="qaz-primary-linux"

function run()
{
	cd /usr/lib/x86_64-linux-gnu/${domain} || exit 1
	LD_LIBRARY_PATH=/usr/lib/x86_64-linux-gnu/sdl12-compat/ ./${APP_EXE} -w 1280 -h 720 "$@"
}

function usage()
{
	NSH_std_usage
	echo "    --fullscreen			start the demo in fullscreen"
}

if [ "$#" -gt "1" ]; then
	usage
	exit 1
elif [ "$#" -lt "1" ]; then
	run
else
	case "$1" in
	--help)
		usage
		;;
	--fullscreen)
		run -f
		;;
	*)
		usage
		exit 1
		;;
	esac
fi

exit 0
