diff --git a/ballbuster-1.0-better-fullscreen-handling.patch b/ballbuster-1.0-better-fullscreen-handling.patch new file mode 100644 index 0000000..3bbe5bd --- /dev/null +++ b/ballbuster-1.0-better-fullscreen-handling.patch @@ -0,0 +1,117 @@ +diff -up ballbuster-1.0/main.cpp.orig ballbuster-1.0/main.cpp +--- ballbuster-1.0/main.cpp.orig 2016-02-15 15:15:20.781925176 +0100 ++++ ballbuster-1.0/main.cpp 2016-02-15 15:15:33.738986682 +0100 +@@ -61,7 +60,11 @@ testy::testy() + catchbluestart = catchredstart = CL_System::get_time(); + fireball = blaster = stageover = transitionout = died = dying = false; + deathstart= 0; +- fullscreen= true; ++ fullscreen= false; ++ fullscreen_width = -1; ++ fullscreen_height = -1; ++ windowed_width = 800; ++ windowed_height = 600; + + transitionspeed= 0; + transdelay= 100; transstart= 0; +@@ -109,6 +112,29 @@ int testy::main(int argc, char **argv) + // try { + // initialization, looks like they need to be nested + unsigned int timer = CL_System::get_time(); ++ int width; ++ int height; ++ ++ for (int i = 1; i < argc; i++) { ++ if (strcmp(argv[i], "-windowsize") == 0 && ++i < argc && ++ sscanf(argv[i], "%dx%d", &windowed_width, ++ &windowed_height) == 2) ++ ; ++ else if (strcmp(argv[i], "-fullscreensize") == 0 && ++i < argc ++ && sscanf(argv[i], "%dx%d", &fullscreen_width, ++ &fullscreen_height) == 2) ++ ; ++ else if (strcmp(argv[i], "-fullscreen") == 0) ++ fullscreen = true; ++#ifdef _DEBUG ++ else if (strcmp(argv[i], "-debug") == 0) ++ debugger = true; ++#endif ++ else { ++ printf("Usage: ballbuster [-windowsize XXXxYYY] [-fullscreensize XXXxYYY] [-fullscreen]\n"); ++ return 1; ++ } ++ } + + srand(timer); + +@@ -119,17 +145,27 @@ int testy::main(int argc, char **argv) + CL_SetupVorbis::init(); + CL_SoundOutput output(44100); + +- bool fulls = true; +- +-#ifdef _DEBUG +- if (argc > 1) +- if (strcmp(argv[1], "-debug") == 0) debugger = true; +-#endif + if (debugger) +- fulls = false; ++ fullscreen = false; ++ ++ if (fullscreen_height == -1) { ++ std::vector &modes = ++ CL_DisplayMode::get_display_modes(); ++ if (modes.size() > 0) { ++ CL_Size size = modes[0].get_resolution(); ++ fullscreen_width = size.width; ++ fullscreen_height = size.height; ++ } else { ++ fullscreen_width = 800; ++ fullscreen_height = 600; ++ } ++ } + + // now it gets fun, set up the display mode +- CL_DisplayWindow mywindow("Ball: Buster", 800, 600, fulls, false); ++ width = fullscreen ? fullscreen_width : windowed_width; ++ height = fullscreen ? fullscreen_height : windowed_height; ++ CL_DisplayWindow mywindow("Ball: Buster", width, height, fullscreen, false); ++ CL_Display::set_scale(width / 800.0, height / 600.0); + + displayFormat = &mywindow.get_buffer(0); + +@@ -1146,14 +1182,14 @@ void testy::mouseRelease(const CL_InputE + } + if(mousex > 100-20 && mousex < 500 && mousey > 190 && mousey < 220) { + if(fullscreen) { ++ CL_Display::set_size(windowed_width, windowed_height); + CL_Display::set_windowed(); fullscreen= false; +- CL_Display::set_size(800, 600); +- return; +- } +- if(!fullscreen) { +- CL_Display::set_fullscreen(800, 600, 32); fullscreen= true; +- return; ++ } else { ++ CL_Display::set_fullscreen(fullscreen_width, fullscreen_height, 32); fullscreen= true; + } ++ CL_Display::set_scale(CL_Display::get_width() / 800.0, ++ CL_Display::get_height() / 600.0); ++ return; + } + if(mousex > 100-20 && mousex < 500 && mousey > 220 && mousey < 250) { + bgscroll= bgscroll ? false : true; +diff -up ballbuster-1.0/main.h~ ballbuster-1.0/main.h +--- ballbuster-1.0/main.h~ 2016-02-15 15:40:30.000000000 +0100 ++++ ballbuster-1.0/main.h 2016-02-15 15:41:34.336494247 +0100 +@@ -222,6 +222,10 @@ private: + char brush; + string editormode; + bool fullscreen; ++ int fullscreen_width; ++ int fullscreen_height; ++ int windowed_width; ++ int windowed_height; + + string runEditor(); + void loadEditor(); diff --git a/ballbuster-1.0-gcc6.patch b/ballbuster-1.0-gcc6.patch new file mode 100644 index 0000000..fc5d9de --- /dev/null +++ b/ballbuster-1.0-gcc6.patch @@ -0,0 +1,12 @@ +diff -up ballbuster-1.0/CImage.cpp~ ballbuster-1.0/CImage.cpp +--- ballbuster-1.0/CImage.cpp~ 2016-02-14 19:32:23.000000000 +0100 ++++ ballbuster-1.0/CImage.cpp 2016-02-14 19:45:32.415484199 +0100 +@@ -34,7 +34,7 @@ void CImage::load() + this->topborder= new CL_Surface(DATADIR "imgs/topborder.png"); + this->bgtile= new CL_Surface(DATADIR "imgs/bg1.jpg"); + +- CL_ResourceManager spritesSrc(DATADIR "imgs/sprites.scr", false); ++ CL_ResourceManager spritesSrc(DATADIR "imgs/sprites.scr", NULL); + + this->ball = new CL_Sprite("ball", &spritesSrc); + this->fireball= new CL_Sprite("fireball", &spritesSrc); diff --git a/ballbuster.appdata.xml b/ballbuster.appdata.xml new file mode 100644 index 0000000..db2a8b8 --- /dev/null +++ b/ballbuster.appdata.xml @@ -0,0 +1,30 @@ + + + ballbuster.desktop + CC0-1.0 + GPL-2.0+ + Ball: Buster + Move the paddle to bounce the ball and break all the bricks + +

+ Game inspired by one of the great classics. The purpose of the game is + to remove all the bricks on the screen, by hitting them with a ball. + You can control the ball by bouncing it back at the bricks with a paddle + which you control with your mouse. +

+

The game features:

+
    +
  • A built in level editor
  • +
  • 20 powerups
  • +
  • Particle effects
  • +
  • Alpha effects
  • +
  • Rotating and zooming
  • +
+
+ https://admin.fedoraproject.org/pkgdb/package/rpms/ballbuster/ + + https://fedorapeople.org/~jwrdegoede/screenshots/ballbuster-play.png + https://fedorapeople.org/~jwrdegoede/screenshots/ballbuster-title.png + + jwrdegoede_at_fedoraproject.org +
diff --git a/ballbuster.desktop b/ballbuster.desktop index 116dda1..edd9aea 100644 --- a/ballbuster.desktop +++ b/ballbuster.desktop @@ -1,5 +1,4 @@ [Desktop Entry] -Encoding=UTF-8 Name=Ball: Buster Comment=Move the paddle to bounce the ball and break all the bricks Exec=ballbuster-wrapper @@ -8,3 +7,4 @@ Terminal=false StartupNotify=false Type=Application Categories=Game;ArcadeGame;BlocksGame; +Keywords=game;blocks;bricks;buster; diff --git a/ballbuster.png b/ballbuster.png new file mode 100644 index 0000000..78b2bfe Binary files /dev/null and b/ballbuster.png differ diff --git a/ballbuster.spec b/ballbuster.spec index 1fe1922..5bb4d0d 100644 --- a/ballbuster.spec +++ b/ballbuster.spec @@ -1,15 +1,19 @@ Name: ballbuster Version: 1.0 -Release: 22%{?dist} +Release: 23%{?dist} Summary: Move the paddle to bounce the ball and break all the bricks Group: Amusements/Games License: GPLv2+ URL: http://www.patrickavella.com/ballbuster.shtml Source0: http://www.patrickavella.com/BallBusterX.zip Source1: %{name}.desktop +Source2: %{name}.png +Source3: %{name}.appdata.xml Patch0: ballbuster-unix.patch.gz Patch1: ballbuster-1.0-gcc43.patch -BuildRequires: ClanLib1-devel desktop-file-utils ImageMagick +Patch2: ballbuster-1.0-gcc6.patch +Patch3: ballbuster-1.0-better-fullscreen-handling.patch +BuildRequires: ClanLib1-devel desktop-file-utils libappstream-glib Requires: hicolor-icon-theme opengl-games-utils %description @@ -19,48 +23,67 @@ control the ball by bouncing it back at the bricks with a paddle which you control with your mouse. The game features: A built in level editor, 20 power ups and special effects (particle, alpha, rotating, and zooming). + %prep %setup -q -c %patch0 -p1 -z .unix %patch1 -p1 -z .gcc43 +%patch2 -p1 +%patch3 -p1 sed -i 's/\r//g' COPYING credits.txt ExtremeUpdates.txt manual.html html/* + %build make %{?_smp_mflags} PREFIX=%{_prefix} \ CFLAGS="$RPM_OPT_FLAGS `pkg-config --cflags clanCore-1.0` -fpermissive" -convert -transparent black icon1.ico %{name}.png + %install make install PREFIX=$RPM_BUILD_ROOT%{_prefix} ln -s opengl-game-wrapper.sh $RPM_BUILD_ROOT%{_bindir}/%{name}-wrapper - # below is the desktop file and icon stuff. mkdir -p $RPM_BUILD_ROOT%{_datadir}/applications desktop-file-install --dir $RPM_BUILD_ROOT%{_datadir}/applications %{SOURCE1} -mkdir -p $RPM_BUILD_ROOT%{_datadir}/icons/hicolor/32x32/apps -install -p -m 644 %{name}.png \ - $RPM_BUILD_ROOT%{_datadir}/icons/hicolor/32x32/apps +mkdir -p $RPM_BUILD_ROOT%{_datadir}/icons/hicolor/128x128/apps +install -p -m 644 %{SOURCE2} \ + $RPM_BUILD_ROOT%{_datadir}/icons/hicolor/128x128/apps +mkdir -p $RPM_BUILD_ROOT%{_datadir}/appdata +install -p -m 644 %{SOURCE3} $RPM_BUILD_ROOT%{_datadir}/appdata +appstream-util validate-relax --nonet \ + $RPM_BUILD_ROOT%{_datadir}/appdata/%{name}.appdata.xml + %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 +touch --no-create %{_datadir}/icons/hicolor &>/dev/null || : %postun -touch --no-create %{_datadir}/icons/hicolor || : -if [ -x %{_bindir}/gtk-update-icon-cache ]; then - %{_bindir}/gtk-update-icon-cache --quiet %{_datadir}/icons/hicolor || : +if [ $1 -eq 0 ] ; then + touch --no-create %{_datadir}/icons/hicolor &>/dev/null + gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || : fi +%posttrans +gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || : + + %files -%doc COPYING credits.txt ExtremeUpdates.txt manual.html html +%doc credits.txt ExtremeUpdates.txt manual.html html +%license COPYING %{_bindir}/%{name}* %{_datadir}/%{name} +%{_datadir}/appdata/%{name}.appdata.xml %{_datadir}/applications/%{name}.desktop -%{_datadir}/icons/hicolor/32x32/apps/%{name}.png +%{_datadir}/icons/hicolor/128x128/apps/%{name}.png + %changelog +* Sun Feb 14 2016 Hans de Goede - 1.0-23 +- Fix building with gcc6 (rhbz#1307339) +- Start windowed by default (use -fullscreen to start fullscreen) +- Improve fullscreen handling (scale to native monitor res) +- Higher res icon +- Add appdata + * Wed Feb 03 2016 Fedora Release Engineering - 1.0-22 - Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild