From 8c8a0de00864ca43f4df42469484f6414c8b8487 Mon Sep 17 00:00:00 2001 From: Hans de Goede Date: Jul 23 2007 20:09:04 +0000 Subject: initial alienblaster import --- diff --git a/.cvsignore b/.cvsignore index e69de29..8cd0872 100644 --- a/.cvsignore +++ b/.cvsignore @@ -0,0 +1 @@ +alienblaster-1.1.0.tgz diff --git a/alienblaster-1.1.0-64bit.patch b/alienblaster-1.1.0-64bit.patch new file mode 100644 index 0000000..d088a45 --- /dev/null +++ b/alienblaster-1.1.0-64bit.patch @@ -0,0 +1,33 @@ +diff -up alienblaster/src/options.cc~ alienblaster/src/options.cc +--- alienblaster/src/options.cc~ 2007-07-22 21:13:29.000000000 +0200 ++++ alienblaster/src/options.cc 2007-07-22 21:13:29.000000000 +0200 +@@ -48,7 +48,7 @@ Options::Options(const string lFilename) + string newLine; + getline( inputFile, newLine ); + // search delimiter +- unsigned int pos = newLine.find("="); ++ string::size_type pos = newLine.find("="); + // comment line or no delimiter found + if (( newLine[0] != '#' ) && ( pos != string::npos )) { + string key = newLine.substr(0,pos); +diff -up alienblaster/src/font.cc~ alienblaster/src/font.cc +--- alienblaster/src/font.cc~ 2007-07-22 21:14:44.000000000 +0200 ++++ alienblaster/src/font.cc 2007-07-22 21:14:44.000000000 +0200 +@@ -84,7 +84,7 @@ void Font::drawInt(SDL_Surface *screen, + destR.w = charWidth; + destR.h = charHeight; + +- unsigned int charsetpos = charset.find( (char)((val % 10) + '0') ); ++ string::size_type charsetpos = charset.find( (char)((val % 10) + '0') ); + if (charsetpos != string::npos ) { + srcR.x = charsetpos * charWidth; + } else { +@@ -127,7 +127,7 @@ void Font::drawStr(SDL_Surface *screen, + SDL_Rect srcR; + + int x = 0; +- unsigned int charsetpos; ++ string::size_type charsetpos; + for(unsigned int i=0; i < text.size(); ++i) { + x = 0; + charsetpos = charset.find(text[i]); diff --git a/alienblaster-1.1.0-fullscreen.patch b/alienblaster-1.1.0-fullscreen.patch new file mode 100644 index 0000000..925b661 --- /dev/null +++ b/alienblaster-1.1.0-fullscreen.patch @@ -0,0 +1,41 @@ +diff -up alienblaster/src/video.h~ alienblaster/src/video.h +--- alienblaster/src/video.h~ 2007-07-22 21:34:45.000000000 +0200 ++++ alienblaster/src/video.h 2007-07-22 21:34:45.000000000 +0200 +@@ -36,8 +36,6 @@ public: + ~Video(); + SDL_Surface *init(); + +- bool fullscreen; +- + void clearScreen(); + void toggleFullscreen(); + }; +diff -up alienblaster/src/video.cc~ alienblaster/src/video.cc +--- alienblaster/src/video.cc~ 2007-07-22 21:33:10.000000000 +0200 ++++ alienblaster/src/video.cc 2007-07-22 21:34:35.000000000 +0200 +@@ -38,12 +38,11 @@ SDL_Surface *Video::init(){ + // -------------------------------------------------- + // SDL initialisation + // ----------------------------------------------------- +- fullscreen = false; + if (SDL_InitSubSystem(SDL_INIT_VIDEO) < 0) { + printf("Couldn't initialize SDL video subsystem: %s\n", SDL_GetError()); + exit(1); + } +- screen = SDL_SetVideoMode( SCREEN_WIDTH, SCREEN_HEIGHT, BIT_DEPTH, SDL_DOUBLEBUF /* | SDL_FULLSCREEN */ ); ++ screen = SDL_SetVideoMode( SCREEN_WIDTH, SCREEN_HEIGHT, BIT_DEPTH, SDL_DOUBLEBUF | SDL_FULLSCREEN ); + if (!screen) { + printf("Couldn't set %dx%d, %dbit video mode: %s\n", SCREEN_WIDTH, SCREEN_HEIGHT, BIT_DEPTH, SDL_GetError()); + exit(2); +@@ -68,10 +67,5 @@ void Video::clearScreen() { + } + + void Video::toggleFullscreen() { +- if ( fullscreen ) { +- screen = SDL_SetVideoMode( SCREEN_WIDTH, SCREEN_HEIGHT, BIT_DEPTH, SDL_DOUBLEBUF ); +- } else { +- screen = SDL_SetVideoMode( SCREEN_WIDTH, SCREEN_HEIGHT, BIT_DEPTH, SDL_DOUBLEBUF | SDL_FULLSCREEN ); +- } +- fullscreen = !fullscreen; ++ SDL_WM_ToggleFullScreen(screen); + } diff --git a/alienblaster-16x16.png b/alienblaster-16x16.png new file mode 100644 index 0000000..a015cab Binary files /dev/null and b/alienblaster-16x16.png differ diff --git a/alienblaster-32x32.png b/alienblaster-32x32.png new file mode 100644 index 0000000..737009f Binary files /dev/null and b/alienblaster-32x32.png differ diff --git a/alienblaster-48x48.png b/alienblaster-48x48.png new file mode 100644 index 0000000..c11900d Binary files /dev/null and b/alienblaster-48x48.png differ diff --git a/alienblaster.desktop b/alienblaster.desktop new file mode 100644 index 0000000..934b99c --- /dev/null +++ b/alienblaster.desktop @@ -0,0 +1,10 @@ +[Desktop Entry] +Encoding=UTF-8 +Name=Alien Blaster +Comment=Action-loaded 2D arcade shooter game +Exec=alienblaster +Icon=alienblaster.png +Terminal=false +StartupNotify=false +Type=Application +Categories=Game;ActionGame; diff --git a/alienblaster.sh b/alienblaster.sh new file mode 100644 index 0000000..4fafa21 --- /dev/null +++ b/alienblaster.sh @@ -0,0 +1,12 @@ +#!/bin/bash +set -e + +if [ ! -d ~/.alienblaster ]; then + mkdir -p ~/.alienblaster + ln -s /usr/share/alienblaster/images ~/.alienblaster/images + ln -s /usr/share/alienblaster/sound ~/.alienblaster/sound + cp -r /usr/share/alienblaster/cfg ~/.alienblaster +fi + +cd ~/.alienblaster +exec alienblaster.bin "$@" diff --git a/alienblaster.spec b/alienblaster.spec new file mode 100644 index 0000000..588d25a --- /dev/null +++ b/alienblaster.spec @@ -0,0 +1,89 @@ +Name: alienblaster +Version: 1.1.0 +Release: 1%{?dist} +Summary: Action-loaded 2D arcade shooter game +Group: Amusements/Games +License: GPL +URL: http://www.schwardtnet.de/alienblaster/ +Source0: http://www.informatik.uni-bremen.de/~schwardt/%{name}/%{name}-%{version}.tgz +Source1: %{name}.sh +Source2: %{name}.desktop +Source3: %{name}-16x16.png +Source4: %{name}-32x32.png +Source5: %{name}-48x48.png +Patch0: alienblaster-1.1.0-64bit.patch +Patch1: alienblaster-1.1.0-fullscreen.patch +BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) +BuildRequires: SDL_mixer-devel desktop-file-utils +Requires: hicolor-icon-theme + +%description +Alien Blaster is an action-loaded 2D arcade shooter game. Your mission in the +game is simple: stop the invasion of the aliens by blasting them. +Simultaneous two-player mode is available. + + +%prep +%setup -q -n %{name} +%patch0 -p1 -z .64bit +%patch1 -p1 -z .fs + + +%build +make %{?_smp_mflags} OPTIMIZATION="$RPM_OPT_FLAGS" + + +%install +rm -rf $RPM_BUILD_ROOT +# no make install, DIY +mkdir -p $RPM_BUILD_ROOT%{_bindir} +mkdir -p $RPM_BUILD_ROOT%{_datadir}/%{name} +install -p -m 755 %{SOURCE1} $RPM_BUILD_ROOT%{_bindir}/%{name} +install -p -m 755 alienBlaster $RPM_BUILD_ROOT%{_bindir}/%{name}.bin +cp -a images sound cfg $RPM_BUILD_ROOT%{_datadir}/%{name} + +# below is the desktop file and icon stuff. +mkdir -p $RPM_BUILD_ROOT%{_datadir}/applications +desktop-file-install --vendor fedora \ + --dir $RPM_BUILD_ROOT%{_datadir}/applications \ + %{SOURCE2} +mkdir -p $RPM_BUILD_ROOT%{_datadir}/icons/hicolor/16x16/apps +mkdir -p $RPM_BUILD_ROOT%{_datadir}/icons/hicolor/32x32/apps +mkdir -p $RPM_BUILD_ROOT%{_datadir}/icons/hicolor/48x48/apps +install -p -m 644 %{SOURCE3} \ + $RPM_BUILD_ROOT%{_datadir}/icons/hicolor/16x16/apps/%{name}.png +install -p -m 644 %{SOURCE4} \ + $RPM_BUILD_ROOT%{_datadir}/icons/hicolor/32x32/apps/%{name}.png +install -p -m 644 %{SOURCE5} \ + $RPM_BUILD_ROOT%{_datadir}/icons/hicolor/48x48/apps/%{name}.png + + +%clean +rm -rf $RPM_BUILD_ROOT + + +%post +touch --no-create %{_datadir}/icons/hicolor || : +if [ -x %{_bindir}/gtk-update-icon-cache ]; then + %{_bindir}/gtk-update-icon-cache --quiet %{_datadir}/icons/hicolor || : +fi + +%postun +touch --no-create %{_datadir}/icons/hicolor || : +if [ -x %{_bindir}/gtk-update-icon-cache ]; then + %{_bindir}/gtk-update-icon-cache --quiet %{_datadir}/icons/hicolor || : +fi + + +%files +%defattr(-,root,root,-) +%doc LICENSE CHANGELOG AUTHORS +%{_bindir}/%{name}* +%{_datadir}/%{name} +%{_datadir}/applications/fedora-%{name}.desktop +%{_datadir}/icons/hicolor/*/apps/%{name}.png + + +%changelog +* Sun Jul 22 2007 Hans de Goede 1.1.0-1 +- Initial Fedora Extras package diff --git a/sources b/sources index e69de29..d03aad4 100644 --- a/sources +++ b/sources @@ -0,0 +1 @@ +27412a868f7d4ae0949036aeb29a6691 alienblaster-1.1.0.tgz