Sunday, February 18, 2007

building the reel strip

building the reel strip.

some thing about video slot machine.
there are two things that would have to decided do you have game that can be resized on the fly?
that is operator can enter into configuration console and switch
from 640x480 to 800x600 or 1024x768?
that would be the ideal.

but for this demo probably not.
everything should be set to 800x600.

things to do start using sprites for everything.

move sprite classes into main prog.

start putting anything related to positions into positions.h



cache + vector (vertical/horizontal) = sprite/image

cache.cellsize(x,y)

check when adding the cells that these apre part of compile value

create build_strip
sprite.buildstrip(vector,horiztal/vetical,alpha)

build the strip. if the strip is has the same nature as before use
this dont recreate because this strip gets built over and over

fix spline code.



check to see if images have the correct depth and size properties
but make algorith simple that is if your system ask for 128 pixel
images do so but make this explicit


class wrapped around sdl_surface

Monday, February 12, 2007

xorg configuration for make-live cd

first startx looks like this :
#!/bin/sh

# $XFree86: xc/programs/xinit/startx.cpp,v 3.16tsi Exp $

userclientrc=$HOME/.xinitrc
sysclientrc=/etc/X11/xinit/xinitrc


userserverrc=$HOME/.xserverrc
sysserverrc=/etc/X11/xinit/xserverrc
defaultclient=xterm # this is what is launching xterm
defaultserver=/usr/bin/X
defaultclientargs=""
defaultserverargs=""
clientargs=""
serverargs=""

if [ -f $userclientrc ]; then
defaultclientargs=$userclientrc
elif [ -f $sysclientrc ]; then
defaultclientargs=$sysclientrc

fi
if [ -f $userserverrc ]; then
defaultserverargs=$userserverrc
elif [ -f $sysserverrc ]; then
defaultserverargs=$sysserverrc
fi

whoseargs="client"
while [ x"$1" != x ]; do
case "$1" in
# '' required to prevent cpp from treating "/*" as a C comment.
/''*|\./''*)
if [ "$whoseargs" = "client" ]; then
if [ x"$clientargs" = x ]; then
client="$1"
else
clientargs="$clientargs $1"
fi
else
if [ x"$serverargs" = x ]; then
server="$1"
else
serverargs="$serverargs $1"
fi
fi
;;
--)
whoseargs="server"
;;
*)
if [ "$whoseargs" = "client" ]; then
clientargs="$clientargs $1"
else
# display must be the FIRST server argument
if [ x"$serverargs" = x ] && \
expr "$1" : ':[0-9][0-9]*$' > /dev/null 2>&1; then
display="$1"
else
serverargs="$serverargs $1"
fi
fi
;;
esac
shift
done

# process client arguments
if [ x"$client" = x ]; then
# if no client arguments either, use rc file instead
if [ x"$clientargs" = x ]; then
client="$defaultclientargs"
else
client=$defaultclient
fi
fi

# process server arguments
if [ x"$server" = x ]; then
# if no server arguments or display either, use rc file instead
if [ x"$serverargs" = x -a x"$display" = x ]; then
server="$defaultserverargs"
else
server=$defaultserver
fi
fi

if [ x"$XAUTHORITY" = x ]; then
XAUTHORITY=$HOME/.Xauthority
export XAUTHORITY
fi

removelist=


# set up default Xauth info for this machine

# check for GNU hostname
if hostname --version > /dev/null 2>&1; then
if [ -z "`hostname --version 2>&1 | grep GNU`" ]; then
hostname=`hostname -f`
fi
fi

if [ -z "$hostname" ]; then
hostname=`hostname`
fi

authdisplay=${display:-:0}
mcookie=`/usr/bin/mcookie`
dummy=0

# create a file with auth information for the server. ':0' is a dummy.
xserverauthfile=$HOME/.serverauth.$$
xauth -q -f $xserverauthfile << EOF
add :$dummy . $mcookie
EOF
serverargs=${serverargs}" -auth "${xserverauthfile}

# now add the same credentials to the client authority file
# if '$displayname' already exists don't overwrite it as another
# server man need it. Add them to the '$xserverauthfile' instead.
for displayname in $authdisplay $hostname$authdisplay; do
authcookie=`xauth list "$displayname" \
| sed -n "s/.*$displayname[[:space:]*].*[[:space:]*]//p"` 2>/dev/null;
if [ "z${authcookie}" = "z" ] ; then
xauth -q << EOF
add $displayname . $mcookie
EOF
removelist="$displayname $removelist"
else
dummy=$(($dummy+1));
xauth -q -f $xserverauthfile << EOF
add :$dummy . $authcookie
EOF
fi
done
xinit $client $clientargs -- $server $display $serverargs

if [ x"$removelist" != x ]; then
xauth remove $removelist
fi
if [ x"$xserverauthfile" != x ]; then
rm -f $xserverauthfile
fi

if command -v deallocvt > /dev/null 2>&1; then
deallocvt
fi

Thursday, February 08, 2007

make-live live cd project

the project is located at http://wiki.debian.org/DebianLive
first the project is the best of what is out there and produces
the smallest image all the other seem to want to into the direction
of knoppix. that is produce a application heavy cd. i dont need this.

First if you dont install apt-cacher your builds will take forever.
edit the file /etc/default/apt-cacher
change the entry AUTOSTART=0 to AUTOSTART=1
then start the server by
/etc/init.d/apt-cacher start
when that is done do the folllowin
edit the /etc/make-live.conf file:
LIVE_MIRROR="http://localhost:3142/ftp.debian.org"

things in the chroot that need to edit
/etc/apt/sources.list seems to have the settings for apt-cacher
this needs to be removed if you need to mod the chroot

making the bootsplash rle file
you will net the netpbm software package and ppmtolss16
and the gimp.
note, that ppmtolss16 is installed with the debian syslinux package.

1. create a new splash.png file using gimp 640x320 resolution and save it
as splash-isolinux.png

2. Click menu: image > mode > indexed > maximum number of colors > set to 16 > ok

3. Click menu: file > save as > file type > PNG image > save (splash-isolinux.png)

In a console:

4. convert it to "pnm" by using "pngtopnm"
   % pngtopnm splash.png > splash.pnm

5. convert it to "rle" by using "ppmtolss16"
% ppmtolss16 <>splash-isolinux.rle


see the document http://www.geexbox.org/wiki/index.php/How_to_create_a_theme
for decent explanation of this.




goals for this project:
1) brand the bootup screen for a specific splash rle file.
2) simplify the boot up options.
3) make sure that if xorg dies or the program crash xorg is restarted and will restart
the game application or game launcher application.
4) be able to add a deb package of the gaming software to the system, possible without
a complete rebuild of the underlying cdrom image.
5) slim down every thing.
6) the xorg resolution is way to high i needs to be set at 800x600
--------------------------------------------------------------------------------------
1) part of 1 is done with splash.rle file mentioned above.
2) this means altering the file isolinux.cfg this file is included in the --template
option of the make-live prog.
3) the file casper-login script does this:
USERNAME=casper
[ -f /etc/casper.conf ] && . /etc/casper.conf
exec su -l -c /usr/bin/startx $USERNAME
#exec /bin/login -f $USERNAME
4) this means know how to build deb packages. this is big one and i dont get know
how to do this. a possible way to start would be to take a small deb prog and modify
to my uses.
5) slimming means a couple of things. first running a script inside the chroot. this is
a good thing as you are going to be removing files and the worst that might happen is the
chroot will get trashed and not the outer system. the slimming script
will be included with directory designated with the --include-chroot and be run with --hook
option
6) xorg resolution is is probably last reall big task slimming down i will attack piecmeal

make-live has a nice option --