diff -Nru gweled-1.0~alpha/.gitignore gweled-1.0~beta1/.gitignore --- gweled-1.0~alpha/.gitignore 2023-11-09 19:35:11.000000000 +0000 +++ gweled-1.0~beta1/.gitignore 2024-03-29 15:32:30.000000000 +0000 @@ -1,28 +1,7 @@ -Makefile -Makefile.in -aclocal.m4 -autom4te.cache/ -config.h -config.h.in -config.log -config.status -configure -depcomp -install-sh -missing -stamp-h1 -data/Makefile -data/Makefile.in -data/gweled.desktop -po/*.gmo +build +.flatpak-builder + po/.intltool-merge-cache -po/Makefile -po/Makefile.in -po/POTFILES -po/stamp-it -src/.deps/ -src/Makefile -src/Makefile.in -src/gweled -src/*.o + *~ + diff -Nru gweled-1.0~alpha/NEWS gweled-1.0~beta1/NEWS --- gweled-1.0~alpha/NEWS 2023-11-09 19:35:11.000000000 +0000 +++ gweled-1.0~beta1/NEWS 2024-03-29 15:32:30.000000000 +0000 @@ -1,7 +1,27 @@ -1.0 +1.0-beta1 ====== - Released: tbd + Released: 2024-03-29 + + Features: + * Fixed 0 points on a intersect of two perpendicular lines (fixes lp#926449) + * Restored board filling animation on new game + * Removed level bonuses on endless game mode + * Improved gem animations and better timing of subsequent gem destroy + * Renamed icon and appdata to org.gweled.gweled + * Avoids spawning 3 or more gems of the same type in a row + * Started Flatpak support + * Updated Italian, Spanish and Norwegian Bokmal translations + * Other small improvements... + + Known bugs: + * No custom messages if your score is not in the first 10 ones + + +1.0-alpha1 +====== + + Released: 2023-11-09 Features: * Ported to Gtk3 diff -Nru gweled-1.0~alpha/data/gweled.desktop.in gweled-1.0~beta1/data/gweled.desktop.in --- gweled-1.0~alpha/data/gweled.desktop.in 2023-11-09 19:35:11.000000000 +0000 +++ gweled-1.0~beta1/data/gweled.desktop.in 1970-01-01 00:00:00.000000000 +0000 @@ -1,11 +0,0 @@ -[Desktop Entry] -Name=Gweled -Comment=Play a puzzle game similar to "Diamond Mine" -Exec=gweled -# TRANSLATORS: Do NOT translate or transliterate this text! -# This is an icon file name -Icon=gweled -Terminal=false -Type=Application -Categories=GNOME;GTK;Game;LogicGame; -StartupNotify=true diff -Nru gweled-1.0~alpha/data/icons/scalable/gweled.svg gweled-1.0~beta1/data/icons/scalable/gweled.svg --- gweled-1.0~alpha/data/icons/scalable/gweled.svg 2023-11-09 19:35:11.000000000 +0000 +++ gweled-1.0~beta1/data/icons/scalable/gweled.svg 1970-01-01 00:00:00.000000000 +0000 @@ -1,127 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff -Nru gweled-1.0~alpha/data/icons/scalable/org.gweled.gweled.svg gweled-1.0~beta1/data/icons/scalable/org.gweled.gweled.svg --- gweled-1.0~alpha/data/icons/scalable/org.gweled.gweled.svg 1970-01-01 00:00:00.000000000 +0000 +++ gweled-1.0~beta1/data/icons/scalable/org.gweled.gweled.svg 2024-03-29 15:32:30.000000000 +0000 @@ -0,0 +1,127 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -Nru gweled-1.0~alpha/data/meson.build gweled-1.0~beta1/data/meson.build --- gweled-1.0~alpha/data/meson.build 2023-11-09 19:35:11.000000000 +0000 +++ gweled-1.0~beta1/data/meson.build 2024-03-29 15:32:30.000000000 +0000 @@ -1,4 +1,4 @@ -install_data (join_paths ('icons', 'scalable', meson.project_name() + '.svg'), +install_data (join_paths ('icons', 'scalable', application_id + '.svg'), install_dir: join_paths (data_dir, 'icons', 'hicolor', 'scalable', 'apps')) @@ -9,8 +9,8 @@ # Desktop files desktop_file = i18n.merge_file( type: 'desktop', - input: meson.project_name() + '.desktop.in', - output: meson.project_name() + '.desktop', + input: application_id + '.desktop.in', + output: application_id + '.desktop', po_dir: po_dir, install: true, install_dir: join_paths(data_dir, 'applications') diff -Nru gweled-1.0~alpha/data/org.gweled.gweled.appdata.xml.in gweled-1.0~beta1/data/org.gweled.gweled.appdata.xml.in --- gweled-1.0~alpha/data/org.gweled.gweled.appdata.xml.in 2023-11-09 19:35:11.000000000 +0000 +++ gweled-1.0~beta1/data/org.gweled.gweled.appdata.xml.in 2024-03-29 15:32:30.000000000 +0000 @@ -1,26 +1,38 @@ - gweled.desktop - gweled.desktop - CC0-1.0 - GPL-2.0+ and GFDL-1.3 + org.gweled.gweled Gweled Bejeweled like real time strategic puzzle game

Gweled is a GTK+ version of a popular PalmOS/Windows/Java game called "Bejeweled", originally written by Sebastien Delestaing. The aim of the game is to make alignment of 3 or more gems, both vertically or horizontally by swapping adjacent gems. The game ends when there are no possible moves left.

- https://bugs.launchpad.net/gweled + org.gweled.gweled.desktop + CC0-1.0 + GPL-2.0+ and GFDL-1.3 + https://gweled.org/ - - dnax88@gmail.com + https://bugs.launchpad.net/gweled + https://translations.launchpad.net/gweled + https://liberapay.com/Gweled/donate + + dnax88@gmail.com + Daniele Napolitano + + + pointing + touch + - https://gweled.org/images/screen1.png + + https://gweled.org/images/screen1.png + gweled - + GNOME +
diff -Nru gweled-1.0~alpha/data/org.gweled.gweled.desktop.in gweled-1.0~beta1/data/org.gweled.gweled.desktop.in --- gweled-1.0~alpha/data/org.gweled.gweled.desktop.in 1970-01-01 00:00:00.000000000 +0000 +++ gweled-1.0~beta1/data/org.gweled.gweled.desktop.in 2024-03-29 15:32:30.000000000 +0000 @@ -0,0 +1,11 @@ +[Desktop Entry] +Name=Gweled +Comment=Play a puzzle game similar to "Diamond Mine" +Exec=gweled +# TRANSLATORS: Do NOT translate or transliterate this text! +# This is an icon file name +Icon=org.gweled.gweled +Terminal=false +Type=Application +Categories=GNOME;GTK;Game;LogicGame; +StartupNotify=true diff -Nru gweled-1.0~alpha/debian/changelog gweled-1.0~beta1/debian/changelog --- gweled-1.0~alpha/debian/changelog 2024-04-01 05:53:06.000000000 +0000 +++ gweled-1.0~beta1/debian/changelog 2024-03-31 17:12:20.000000000 +0000 @@ -1,14 +1,8 @@ -gweled (1.0~alpha-2build2) noble; urgency=medium +gweled (1.0~beta1-1) unstable; urgency=medium - * No-change rebuild for CVE-2024-3094 + * New upstream beta release. - -- William Grant Mon, 01 Apr 2024 16:53:06 +1100 - -gweled (1.0~alpha-2build1) noble; urgency=medium - - * No-change rebuild against libglib2.0-0t64 - - -- Steve Langasek Fri, 08 Mar 2024 04:59:25 +0000 + -- Stephen Kitt Sun, 31 Mar 2024 19:12:20 +0200 gweled (1.0~alpha-2) unstable; urgency=medium diff -Nru gweled-1.0~alpha/debian/control gweled-1.0~beta1/debian/control --- gweled-1.0~alpha/debian/control 2024-03-08 04:59:25.000000000 +0000 +++ gweled-1.0~beta1/debian/control 2023-12-02 17:18:48.000000000 +0000 @@ -1,6 +1,5 @@ Source: gweled -Maintainer: Ubuntu Developers -XSBC-Original-Maintainer: Debian Games Team +Maintainer: Debian Games Team Uploaders: Stephen Kitt Section: games Priority: optional diff -Nru gweled-1.0~alpha/debian/copyright gweled-1.0~beta1/debian/copyright --- gweled-1.0~alpha/debian/copyright 2024-01-07 18:25:16.000000000 +0000 +++ gweled-1.0~beta1/debian/copyright 2024-03-31 17:12:20.000000000 +0000 @@ -4,12 +4,12 @@ Files: * Copyright: 2003-2005 Sebastien Delestaing - 2010, 2021, 2023 Daniele Napolitano + 2010-2024 Daniele Napolitano License: GPL-2+ Files: debian/* Copyright: 2004-2006, 2010, 2011, 2013 Ondřej Surý - 2016, 2018, 2019, 2021, 2023 Stephen Kitt + 2016, 2018-2019, 2021, 2023-2024 Stephen Kitt License: GPL-2+ License: GPL-2+ diff -Nru gweled-1.0~alpha/dist/flatpak/org.gweled.gweled.json gweled-1.0~beta1/dist/flatpak/org.gweled.gweled.json --- gweled-1.0~alpha/dist/flatpak/org.gweled.gweled.json 1970-01-01 00:00:00.000000000 +0000 +++ gweled-1.0~beta1/dist/flatpak/org.gweled.gweled.json 2024-03-29 15:32:30.000000000 +0000 @@ -0,0 +1,110 @@ +{ + "app-id" : "org.gweled.gweled", + "branch" : "unstable", + "runtime" : "org.gnome.Platform", + "runtime-version" : "44", + "sdk" : "org.gnome.Sdk", + "command" : "gweled", + "finish-args" : [ + "--device=dri", + "--socket=fallback-x11", + "--socket=wayland" + ], + "cleanup": [ + "/include", + "/lib/pkgconfig", + "/man", + "/share/doc", + "/share/gtk-doc", + "/share/man", + "/share/pkgconfig", + "*.la", + "*.a" + ], + "modules" : [ + { + "name" : "gweled", + "buildsystem" : "meson", + "sources" : [ + { + "type" : "git", + "url" : "https://git.launchpad.net/gweled" + } + ], + "modules":[ + { + "name":"libcanberra", + "sources":[ + { + "type":"archive", + "url":"http://0pointer.de/lennart/projects/libcanberra/libcanberra-0.30.tar.xz", + "sha256": "c2b671e67e0c288a69fc33dc1b6f1b534d07882c2aceed37004bf48c601afa72" + } + ] + }, + { + "name":"gsound", + "buildsystem":"meson", + "sources":[ + { + "type":"archive", + "url":"https://download.gnome.org/sources/gsound/1.0/gsound-1.0.3.tar.xz", + "sha256": "ca2d039e1ebd148647017a7f548862350bc9af01986d39f10cfdc8e95f07881a" + } + ] + }, + { + "name":"libgnome-games-support", + "buildsystem":"meson", + "sources":[ + { + "type":"archive", + "url":"https://download.gnome.org/sources/libgnome-games-support/1.8/libgnome-games-support-1.8.2.tar.xz", + "sha256": "28434604a7b038731ac0231731388ff104f565bb2330cc24e78cda04cfd3ef7d" + } + ] + }, + { + "name": "cogl", + "config-opts": [ + "--disable-cogl-gst", + "--enable-xlib-egl-platform", + "--enable-wayland-egl-platform" + ], + "sources": [ + { + "type": "archive", + "url": "https://download.gnome.org/sources/cogl/1.22/cogl-1.22.8.tar.xz", + "sha256": "a805b2b019184710ff53d0496f9f0ce6dcca420c141a0f4f6fcc02131581d759" + } + ] + }, + { + "name": "clutter", + "config-opts": [ + "--enable-egl-backend", + "--enable-wayland-backend" + ], + "sources": [ + { + "type": "archive", + "url": "https://download.gnome.org/sources/clutter/1.26/clutter-1.26.4.tar.xz", + "sha256": "8b48fac159843f556d0a6be3dbfc6b083fc6d9c58a20a49a6b4919ab4263c4e6" + } + ] + }, + { + "name": "clutter-gtk", + "buildsystem":"meson", + "sources": [ + { + "type": "archive", + "url": "https://download.gnome.org/sources/clutter-gtk/1.8/clutter-gtk-1.8.4.tar.xz", + "sha256": "521493ec038973c77edcb8bc5eac23eed41645117894aaee7300b2487cb42b06" + } + ] + } + ] + } + ] +} diff -Nru gweled-1.0~alpha/meson.build gweled-1.0~beta1/meson.build --- gweled-1.0~alpha/meson.build 2023-11-09 19:35:11.000000000 +0000 +++ gweled-1.0~beta1/meson.build 2024-03-29 15:32:30.000000000 +0000 @@ -1,5 +1,5 @@ project('gweled', 'c', - version: '1.0-alpha', + version: '1.0-beta1', meson_version: '>= 0.59.0', license: 'GPL-2.0-or-later', ) diff -Nru gweled-1.0~alpha/po/POTFILES.in gweled-1.0~beta1/po/POTFILES.in --- gweled-1.0~alpha/po/POTFILES.in 2023-11-09 19:35:11.000000000 +0000 +++ gweled-1.0~beta1/po/POTFILES.in 2024-03-29 15:32:30.000000000 +0000 @@ -5,5 +5,5 @@ src/gweled-scores.c src/gweled.ui src/gweled-headermenu.ui -data/gweled.desktop.in -data/gweled.appdata.xml.in +data/org.gweled.gweled.desktop.in +data/org.gweled.gweled.appdata.xml.in diff -Nru gweled-1.0~alpha/po/es.po gweled-1.0~beta1/po/es.po --- gweled-1.0~alpha/po/es.po 2023-11-09 19:35:11.000000000 +0000 +++ gweled-1.0~beta1/po/es.po 2024-03-29 15:32:30.000000000 +0000 @@ -7,216 +7,169 @@ msgstr "" "Project-Id-Version: gweled\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-01-28 20:00+0100\n" -"PO-Revision-Date: 2011-11-17 20:47+0000\n" -"Last-Translator: Juan Gacitua \n" +"POT-Creation-Date: 2024-01-19 12:47+0100\n" +"PO-Revision-Date: 2024-02-04 00:58+0000\n" +"Last-Translator: bufalo_1973 \n" "Language-Team: Spanish \n" -"Language: es\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2012-01-22 05:37+0000\n" -"X-Generator: Launchpad (build 14700)\n" - -#: src/main.c:280 -msgid "Game over!" -msgstr "¡Fin de la partida!" - -#: src/main.c:282 -msgid "Great work, but unfortunately your score did not make the top ten." -msgstr "" -"¡Buen trabajo! Desafortunadamente su puntuación no alcanzó los 10 mejores " -"puestos." - -#: src/main.c:284 -msgid "_New Game" -msgstr "_Nueva partida" - -#: src/main.c:296 -msgid "Gweled Scores" -msgstr "Puntuaciones Gweled" - -#: src/main.c:299 -msgid "Game type:" -msgstr "Tipo de partida:" +"X-Launchpad-Export-Date: 2024-02-21 11:44+0000\n" +"X-Generator: Launchpad (build 9643586c585856148a18782148972ae9c1179d06)\n" +"Language: es\n" -#: src/main.c:306 -msgid "Congratulations!" -msgstr "¡Felicidades!" - -#: src/main.c:307 -msgid "Your score is the best!" -msgstr "Su puntuación es la mejor" - -#: src/main.c:308 -msgid "Your score has made the top ten." -msgstr "Su puntuación ha alcanzado los 10 mejores." +#: src/gweled-gui.c:58 src/gweled.ui:153 +msgid "Normal" +msgstr "Normal" -#: src/main.c:396 -msgid "Get as many points as you can. The game ends if you run out of moves." +#: src/gweled-gui.c:62 src/gweled.ui:211 +msgid "Timed" msgstr "" -"Consiga todos los puntos que pueda. El juego termina si usted se queda sin " -"movimientos." -#: src/main.c:398 -msgid "Get as many points as you can. The game ends if you run out of time." +#: src/gweled-gui.c:66 src/gweled.ui:269 +msgid "Endless" msgstr "" -"Consiga todos los puntos que pueda. El juego termina si usted se queda sin " -"tiempo." -#: src/main.c:400 -msgid "The game never ends, but your score will not be saved." -msgstr "El juego nunca termina, pero su puntaje no será guardado." - -#: src/main.c:452 -msgid "There is a game saved, do you want restore it?" -msgstr "Hay un juego guardado, ¿quiere restaurarlo?" - -#: src/callbacks.c:73 -msgid "Do you really want to abort this game?" -msgstr "¿Realmente quieres finalizar el juego?" - -#: src/callbacks.c:138 -msgid "Do you want to save the current game?" -msgstr "¿Quiere guardar la partida actual?" - -#: src/callbacks.c:173 +#: src/gweled-gui.c:108 msgid "translator-credits" msgstr "" "Launchpad Contributions:\n" +" Albert Parera https://launchpad.net/~aparera\n" " Alejandro Moreno Calvo https://launchpad.net/~almorca\n" " Antonio Caro https://launchpad.net/~antonio-gon\n" " DiegoJ https://launchpad.net/~diegojromerolopez\n" -" Juan Gacitua https://launchpad.net/~jotafrisco" +" Jonay https://launchpad.net/~jonay-santana\n" +" Juan Gacitua https://launchpad.net/~jotafrisco\n" +" Miguel de Dios https://launchpad.net/~tres-14159\n" +" bufalo_1973 https://launchpad.net/~bufalo1973" -#: src/callbacks.c:178 +#: src/gweled-gui.c:113 msgid "A puzzle game with gems" msgstr "Un juego de puzles con gemas" -#: src/board_engine.c:505 +#: src/gweled-gui.c:140 +msgid "Do you really want to abort this game?" +msgstr "¿Realmente quiere finalizar el juego?" + +#: src/gweled-gui.c:225 +msgid "Do you want to save the current game?" +msgstr "¿Quiere guardar la partida actual?" + +#: src/gweled-gui.c:420 +msgid "There is a game saved, do you want restore it?" +msgstr "Hay un juego guardado, ¿quiere restaurarlo?" + +#: src/board_engine.c:552 msgid "_Resume" msgstr "_Continuar" -#: src/board_engine.c:508 +#: src/board_engine.c:554 src/board_engine.c:557 msgid "Paused" msgstr "Pausado" -#: src/board_engine.c:518 data/gweled.ui:44 +#: src/board_engine.c:563 src/gweled.ui:385 msgid "_Pause" msgstr "_Pausar" -#: src/board_engine.c:827 src/board_engine.c:897 src/board_engine.c:999 +#: src/board_engine.c:636 +msgid "Time's up!" +msgstr "" + +#. Game over +#: src/board_engine.c:790 src/board_engine.c:800 +msgid "No moves left!" +msgstr "" + +#: src/board_engine.c:829 src/board_engine.c:898 src/board_engine.c:967 #, c-format msgid "Level %d" msgstr "Nivel %d" -#: src/games-scores-dialog.c:118 src/games-scores-dialog.c:545 -msgid "Score" -msgstr "Puntuación" - -#: src/games-scores-dialog.c:437 -msgid "New Game" -msgstr "Nuevo juego" - -#: src/games-scores-dialog.c:537 -msgid "Name" -msgstr "Nombre" - -#: data/gweled.ui:24 -msgid "_Game" -msgstr "_Juego" - -#: data/gweled.ui:43 -msgid "Pauses the game for you can return to it later" -msgstr "Detiene el juego para que pueda volver más tarde" - -#: data/gweled.ui:58 -msgid "_Scores" -msgstr "_Puntuación" - -#: data/gweled.ui:85 -msgid "_Settings" -msgstr "_Opciones" - -#: data/gweled.ui:106 -msgid "_Help" -msgstr "_Ayuda" - -#: data/gweled.ui:175 -msgid "Welcome to Gweled!" -msgstr "¡Bienvendio a Gweled!" +#: src/board_engine.c:831 +#, c-format +msgid "Bonus x%d" +msgstr "" -#: data/gweled.ui:219 +#: src/gweled-scores.c:39 +msgctxt "game type" msgid "Normal" -msgstr "Normal" +msgstr "" -#: data/gweled.ui:270 +#: src/gweled-scores.c:40 +msgctxt "game type" msgid "Timed" -msgstr "Cronometrado" +msgstr "" -#: data/gweled.ui:322 -msgid "Endless" -msgstr "Sin fin" +#. Translators: label displayed on the scores dialog, preceding a difficulty. +#: src/gweled-scores.c:106 +msgid "Game type:" +msgstr "Tipo de partida:" -#: data/gweled.ui:382 +#: src/gweled.ui:57 msgid "Score:" -msgstr "Puntuación:" +msgstr "" -#: data/gweled.ui:415 -msgid "Preferences" -msgstr "Preferencias" +#: src/gweled.ui:110 +msgid "Welcome to Gweled!" +msgstr "" -#: data/gweled.ui:439 -msgid "Board size" -msgstr "Tamaño del mapa" +#: src/gweled.ui:169 +msgid "Get as many points as you can. The game ends if you run out of moves." +msgstr "" +"Consiga todos los puntos que pueda. El juego termina si usted se queda sin " +"movimientos." -#: data/gweled.ui:456 -msgid "Small" -msgstr "Pequeño" +#: src/gweled.ui:227 +msgid "Get as many points as you can. The game ends if you run out of time." +msgstr "" +"Consiga todos los puntos que pueda. El juego termina si usted se queda sin " +"tiempo." -#: data/gweled.ui:477 -msgid "Medium" -msgstr "Mediano" +#: src/gweled.ui:285 +msgid "The game never ends, but your score will not be saved." +msgstr "El juego nunca termina, pero su puntuación no se guardará." -#: data/gweled.ui:499 -msgid "Large" -msgstr "Grande" +#: src/gweled.ui:356 +msgid "_New Game" +msgstr "_Nueva partida" -#: data/gweled.ui:525 -msgid "Sound" -msgstr "Sonido" +#: src/gweled.ui:368 +msgid "Menu" +msgstr "" -#: data/gweled.ui:542 -msgid "Play sound effects" -msgstr "Reproducir efectos de sonido" +#: src/gweled.ui:389 +msgid "Pauses the game for you can return to it later" +msgstr "" -#: data/gweled.ui:573 -msgid "Miscellaneous" -msgstr "Varios" +#: src/gweled-headermenu.ui:22 +msgid "_Sound effects" +msgstr "" + +#: src/gweled-headermenu.ui:26 +msgid "_Hints" +msgstr "" + +#: src/gweled-headermenu.ui:32 +msgid "_Scores" +msgstr "" -#: data/gweled.ui:590 -msgid "Disable hints" -msgstr "Desactivar los consejos" +#: src/gweled-headermenu.ui:36 +msgid "_About" +msgstr "" -#: data/gweled.desktop.in:3 data/gweled.appdata.xml.in:8 +#: data/org.gweled.gweled.desktop.in:3 data/org.gweled.gweled.appdata.xml.in:5 msgid "Gweled" -msgstr "Gweled" +msgstr "" -#: data/gweled.desktop.in:4 +#: data/org.gweled.gweled.desktop.in:4 msgid "Play a puzzle game similar to \"Diamond Mine\"" -msgstr "Juegue a un juego de rompecabezas similar a «Diamond Mine»" - -#. TRANSLATORS: Do NOT translate or transliterate this text! -#. This is an icon file name -#: data/gweled.desktop.in:8 -msgid "gweled" msgstr "" -#: data/gweled.appdata.xml.in:9 +#: data/org.gweled.gweled.appdata.xml.in:6 msgid "Bejeweled like real time strategic puzzle game" msgstr "" -#: data/gweled.appdata.xml.in:11 +#: data/org.gweled.gweled.appdata.xml.in:8 msgid "" "Gweled is a GTK+ version of a popular PalmOS/Windows/Java game called " "\"Bejeweled\", originally written by Sebastien Delestaing. The aim of the " @@ -224,3 +177,4 @@ "by swapping adjacent gems. The game ends when there are no possible moves " "left." msgstr "" + diff -Nru gweled-1.0~alpha/po/it.po gweled-1.0~beta1/po/it.po --- gweled-1.0~alpha/po/it.po 2023-11-09 19:35:11.000000000 +0000 +++ gweled-1.0~beta1/po/it.po 2024-03-29 15:32:30.000000000 +0000 @@ -7,214 +7,165 @@ msgstr "" "Project-Id-Version: gweled\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-01-28 20:00+0100\n" -"PO-Revision-Date: 2021-01-31 00:00+0000\n" +"POT-Creation-Date: 2024-02-28 12:47+0100\n" +"PO-Revision-Date: 2024-02-28 12:21+0000\n" "Last-Translator: Daniele Napolitano \n" "Language-Team: Italian \n" -"Language: it\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2021-01-30 06:24+0000\n" -"X-Generator: Launchpad (build e00fb96b2e64b75333d0178ec15cb78e5aadb64d)\n" - -#: src/main.c:280 -msgid "Game over!" -msgstr "Partita terminata!" - -#: src/main.c:282 -msgid "Great work, but unfortunately your score did not make the top ten." -msgstr "" -"Ottimo lavoro, ma sfortunatamente il tuo punteggio non rientra nei primi 10." - -#: src/main.c:284 -msgid "_New Game" -msgstr "_Nuovo gioco" - -#: src/main.c:296 -msgid "Gweled Scores" -msgstr "Punteggi di Gweled" - -#: src/main.c:299 -msgid "Game type:" -msgstr "Tipo di gioco:" - -#: src/main.c:306 -msgid "Congratulations!" -msgstr "Congratulazioni!" - -#: src/main.c:307 -msgid "Your score is the best!" -msgstr "Il tuo punteggio è il migliore!" - -#: src/main.c:308 -msgid "Your score has made the top ten." -msgstr "Il tuo punteggio rientra nei primi 10." - -#: src/main.c:396 -msgid "Get as many points as you can. The game ends if you run out of moves." -msgstr "" -"Cerca di fare più punti possibile. Il gioco termina appena non puoi compiere " -"più mosse." - -#: src/main.c:398 -msgid "Get as many points as you can. The game ends if you run out of time." -msgstr "" -"Cerca di fare più punti possibili. Il gioco termina allo scadere del tempo." - -#: src/main.c:400 -msgid "The game never ends, but your score will not be saved." -msgstr "Il gioco non finisce mai, ma il tuo punteggio non viene salvato." +"X-Launchpad-Export-Date: 2024-02-21 11:44+0000\n" +"X-Generator: Launchpad (build 9643586c585856148a18782148972ae9c1179d06)\n" +"Language: it\n" -#: src/main.c:452 -msgid "There is a game saved, do you want restore it?" -msgstr "È presente una partita salvata, vuoi riprenderla?" +#: src/gweled-gui.c:58 src/gweled.ui:153 +msgid "Normal" +msgstr "Normale" -#: src/callbacks.c:73 -msgid "Do you really want to abort this game?" -msgstr "Sei sicuro di voler abbandonare il gioco?" +#: src/gweled-gui.c:62 src/gweled.ui:211 +msgid "Timed" +msgstr "A tempo" -#: src/callbacks.c:138 -msgid "Do you want to save the current game?" -msgstr "Salvare la partita corrente?" +#: src/gweled-gui.c:66 src/gweled.ui:269 +msgid "Endless" +msgstr "Senza fine" -#: src/callbacks.c:173 +#: src/gweled-gui.c:108 msgid "translator-credits" msgstr "" "Daniele Napolitano \n" "\n" "Launchpad Contributions:\n" +" Daniele Napolitano https://launchpad.net/~dnax88\n" " Nicola Corti https://launchpad.net/~corti-nico\n" " max caligaris https://launchpad.net/~dragonfire9000x" -#: src/callbacks.c:178 +#: src/gweled-gui.c:113 msgid "A puzzle game with gems" msgstr "Un rompicapo con gemme" -#: src/board_engine.c:505 +#: src/gweled-gui.c:140 +msgid "Do you really want to abort this game?" +msgstr "Sei sicuro di voler abbandonare il gioco?" + +#: src/gweled-gui.c:225 +msgid "Do you want to save the current game?" +msgstr "Salvare la partita corrente?" + +#: src/gweled-gui.c:420 +msgid "There is a game saved, do you want restore it?" +msgstr "È presente una partita salvata, vuoi riprenderla?" + +#: src/board_engine.c:552 msgid "_Resume" msgstr "_Riprendi" -#: src/board_engine.c:508 +#: src/board_engine.c:554 src/board_engine.c:557 msgid "Paused" msgstr "In pausa" -#: src/board_engine.c:518 data/gweled.ui:44 +#: src/board_engine.c:563 src/gweled.ui:385 msgid "_Pause" msgstr "_Pausa" -#: src/board_engine.c:827 src/board_engine.c:897 src/board_engine.c:999 +#: src/board_engine.c:636 +msgid "Time's up!" +msgstr "Tempo scaduto!" + +#. Game over +#: src/board_engine.c:790 src/board_engine.c:800 +msgid "No moves left!" +msgstr "Nessuna mossa rimasta!" + +#: src/board_engine.c:829 src/board_engine.c:898 src/board_engine.c:967 #, c-format msgid "Level %d" msgstr "Livello %d" -#: src/games-scores-dialog.c:118 src/games-scores-dialog.c:545 -msgid "Score" -msgstr "Punteggio" - -#: src/games-scores-dialog.c:437 -msgid "New Game" -msgstr "Nuovo gioco" - -#: src/games-scores-dialog.c:537 -msgid "Name" -msgstr "Nome" - -#: data/gweled.ui:24 -msgid "_Game" -msgstr "_Gioco" - -#: data/gweled.ui:43 -msgid "Pauses the game for you can return to it later" -msgstr "Mette in pausa il gioco per potervi tornare in seguito" - -#: data/gweled.ui:58 -msgid "_Scores" -msgstr "_Punteggi" - -#: data/gweled.ui:85 -msgid "_Settings" -msgstr "_Impostazioni" - -#: data/gweled.ui:106 -msgid "_Help" -msgstr "_Aiuto" - -#: data/gweled.ui:175 -msgid "Welcome to Gweled!" -msgstr "Benvenuto in Gweled!" +#: src/board_engine.c:831 +#, c-format +msgid "Bonus x%d" +msgstr "Bonus x%d" -#: data/gweled.ui:219 +#: src/gweled-scores.c:39 +msgctxt "game type" msgid "Normal" msgstr "Normale" -#: data/gweled.ui:270 +#: src/gweled-scores.c:40 +msgctxt "game type" msgid "Timed" msgstr "A tempo" -#: data/gweled.ui:322 -msgid "Endless" -msgstr "Senza fine" +#. Translators: label displayed on the scores dialog, preceding a difficulty. +#: src/gweled-scores.c:106 +msgid "Game type:" +msgstr "Tipo di gioco:" -#: data/gweled.ui:382 +#: src/gweled.ui:57 msgid "Score:" msgstr "Punteggio:" -#: data/gweled.ui:415 -msgid "Preferences" -msgstr "Preferenze" - -#: data/gweled.ui:439 -msgid "Board size" -msgstr "Dimensione" - -#: data/gweled.ui:456 -msgid "Small" -msgstr "Piccolo" - -#: data/gweled.ui:477 -msgid "Medium" -msgstr "Medio" - -#: data/gweled.ui:499 -msgid "Large" -msgstr "Grande" - -#: data/gweled.ui:525 -msgid "Sound" -msgstr "Suono" - -#: data/gweled.ui:542 -msgid "Play sound effects" -msgstr "Riproduci effetti sonori" - -#: data/gweled.ui:573 -msgid "Miscellaneous" -msgstr "Varie" - -#: data/gweled.ui:590 -msgid "Disable hints" -msgstr "Disabilita i suggerimenti" +#: src/gweled.ui:110 +msgid "Welcome to Gweled!" +msgstr "Benvenuto in Gweled!" + +#: src/gweled.ui:169 +msgid "Get as many points as you can. The game ends if you run out of moves." +msgstr "" +"Cerca di fare più punti possibile. Il gioco termina appena non puoi compiere " +"più mosse." + +#: src/gweled.ui:227 +msgid "Get as many points as you can. The game ends if you run out of time." +msgstr "" +"Cerca di fare più punti possibili. Il gioco termina allo scadere del tempo." + +#: src/gweled.ui:285 +msgid "The game never ends, but your score will not be saved." +msgstr "Il gioco non finisce mai, ma il tuo punteggio non viene salvato." + +#: src/gweled.ui:356 +msgid "_New Game" +msgstr "_Nuovo gioco" + +#: src/gweled.ui:368 +msgid "Menu" +msgstr "Menu" + +#: src/gweled.ui:389 +msgid "Pauses the game for you can return to it later" +msgstr "Mette in pausa il gioco per potervi tornare in seguito" + +#: src/gweled-headermenu.ui:22 +msgid "_Sound effects" +msgstr "_Effetti sonori" + +#: src/gweled-headermenu.ui:26 +msgid "_Hints" +msgstr "_Suggerimenti" -#: data/gweled.desktop.in:3 data/gweled.appdata.xml.in:8 +#: src/gweled-headermenu.ui:32 +msgid "_Scores" +msgstr "_Punteggi" + +#: src/gweled-headermenu.ui:36 +msgid "_About Gweled" +msgstr "_Informazioni su Gweled" + +#: data/org.gweled.gweled.desktop.in:3 data/org.gweled.gweled.appdata.xml.in:5 msgid "Gweled" msgstr "Gweled" -#: data/gweled.desktop.in:4 +#: data/org.gweled.gweled.desktop.in:4 msgid "Play a puzzle game similar to \"Diamond Mine\"" -msgstr "Gioca ad un rompicapo simile a \"Diamond Mine\"" - -#. TRANSLATORS: Do NOT translate or transliterate this text! -#. This is an icon file name -#: data/gweled.desktop.in:8 -msgid "gweled" -msgstr "gweled" +msgstr "Gioca a un rompicapo simile a «Diamond Mine»" -#: data/gweled.appdata.xml.in:9 +#: data/org.gweled.gweled.appdata.xml.in:6 msgid "Bejeweled like real time strategic puzzle game" msgstr "Un gioco di puzzle strategico in tempo reale simile a Bejeweled" -#: data/gweled.appdata.xml.in:11 +#: data/org.gweled.gweled.appdata.xml.in:8 msgid "" "Gweled is a GTK+ version of a popular PalmOS/Windows/Java game called " "\"Bejeweled\", originally written by Sebastien Delestaing. The aim of the " @@ -225,5 +176,5 @@ "Gweled è una versione GTK di un popolare gioco per PalmOS /Windows/Java " "chiamato \"Bejeweled\", originariamente scritto da Sebastien Delestaing. Lo " "scopo del gioco è allineare 3 o più gemme, sia verticalmente che " -"orizzontalmente scambiando gemme adiacenti. Il gioco finisce quando non ci " -"ono più mosse possibili." +"orizzontalmente scambiando gemme adiacenti. Il gioco finisce quando non ci " +"sono più mosse possibili." diff -Nru gweled-1.0~alpha/po/meson.build gweled-1.0~beta1/po/meson.build --- gweled-1.0~alpha/po/meson.build 2023-11-09 19:35:11.000000000 +0000 +++ gweled-1.0~beta1/po/meson.build 2024-03-29 15:32:30.000000000 +0000 @@ -1,5 +1 @@ -i18n.gettext(meson.project_name(), - preset: 'glib', - data_dirs: data_dir, -) - +i18n.gettext(meson.project_name(), preset: 'glib') diff -Nru gweled-1.0~alpha/po/nb.po gweled-1.0~beta1/po/nb.po --- gweled-1.0~alpha/po/nb.po 2023-11-09 19:35:11.000000000 +0000 +++ gweled-1.0~beta1/po/nb.po 2024-03-29 15:32:30.000000000 +0000 @@ -7,210 +7,161 @@ msgstr "" "Project-Id-Version: gweled\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-01-28 20:00+0100\n" -"PO-Revision-Date: 2012-12-27 09:19+0000\n" +"POT-Creation-Date: 2024-01-19 12:47+0100\n" +"PO-Revision-Date: 2024-01-20 14:46+0000\n" "Last-Translator: Hans Joachim Desserud \n" "Language-Team: Norwegian Bokmal \n" -"Language: nb\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2012-12-28 05:16+0000\n" -"X-Generator: Launchpad (build 16378)\n" - -#: src/main.c:280 -msgid "Game over!" -msgstr "Spillet er slutt!" - -#: src/main.c:282 -msgid "Great work, but unfortunately your score did not make the top ten." -msgstr "" -"Godt gjort, men dessverre nådde ikke poengsummen din opp blant de ti beste." - -#: src/main.c:284 -msgid "_New Game" -msgstr "_Nytt spill" +"X-Launchpad-Export-Date: 2024-02-21 11:44+0000\n" +"X-Generator: Launchpad (build 9643586c585856148a18782148972ae9c1179d06)\n" +"Language: nb\n" -#: src/main.c:296 -msgid "Gweled Scores" -msgstr "Gweled resultater" +#: src/gweled-gui.c:58 src/gweled.ui:153 +msgid "Normal" +msgstr "Normal" -#: src/main.c:299 -msgid "Game type:" -msgstr "Spilltype:" +#: src/gweled-gui.c:62 src/gweled.ui:211 +msgid "Timed" +msgstr "På tid" -#: src/main.c:306 -msgid "Congratulations!" -msgstr "Gratulerer!" - -#: src/main.c:307 -msgid "Your score is the best!" -msgstr "Din poengsum er den beste!" - -#: src/main.c:308 -msgid "Your score has made the top ten." -msgstr "Din poengsum er blant de ti beste." +#: src/gweled-gui.c:66 src/gweled.ui:269 +msgid "Endless" +msgstr "Endeløs" -#: src/main.c:396 -msgid "Get as many points as you can. The game ends if you run out of moves." +#: src/gweled-gui.c:108 +msgid "translator-credits" msgstr "" -"Oppnå så mange poeng som mulig. Spillet er slutt når du slipper opp for " -"muligheter til å flytte." - -#: src/main.c:398 -msgid "Get as many points as you can. The game ends if you run out of time." -msgstr "Oppnå så mange poeng som mulig. Spillet er slutt når tiden er ute." - -#: src/main.c:400 -msgid "The game never ends, but your score will not be saved." -msgstr "Spillet slutter aldri, men poengsummen vil ikke bli lagret." +"Launchpad Contributions:\n" +" Daniele Napolitano https://launchpad.net/~dnax88\n" +" Hans Joachim Desserud https://launchpad.net/~hjd" -#: src/main.c:452 -msgid "There is a game saved, do you want restore it?" -msgstr "Det er et lagret spill, vil du gjenoppta det?" +#: src/gweled-gui.c:113 +msgid "A puzzle game with gems" +msgstr "Puslespill med edelstener" -#: src/callbacks.c:73 +#: src/gweled-gui.c:140 msgid "Do you really want to abort this game?" -msgstr "Vil du virkelig avbryte spillet?" +msgstr "Er du sikker på at du vil avbryte dette spillet?" -#: src/callbacks.c:138 +#: src/gweled-gui.c:225 msgid "Do you want to save the current game?" msgstr "Vil du lagre gjeldende spill?" -#: src/callbacks.c:173 -msgid "translator-credits" -msgstr "" -"Launchpad Contributions:\n" -" Hans Joachim Desserud https://launchpad.net/~hjd" - -#: src/callbacks.c:178 -msgid "A puzzle game with gems" -msgstr "Puslespill med juveler" +#: src/gweled-gui.c:420 +msgid "There is a game saved, do you want restore it?" +msgstr "Det finnes et lagret spill, vil du fortsette på det?" -#: src/board_engine.c:505 +#: src/board_engine.c:552 msgid "_Resume" msgstr "_Fortsett" -#: src/board_engine.c:508 +#: src/board_engine.c:554 src/board_engine.c:557 msgid "Paused" msgstr "Pauset" -#: src/board_engine.c:518 data/gweled.ui:44 +#: src/board_engine.c:563 src/gweled.ui:385 msgid "_Pause" msgstr "_Pause" -#: src/board_engine.c:827 src/board_engine.c:897 src/board_engine.c:999 +#: src/board_engine.c:636 +msgid "Time's up!" +msgstr "Tiden er ute!" + +#. Game over +#: src/board_engine.c:790 src/board_engine.c:800 +msgid "No moves left!" +msgstr "Ingen flere trekk!" + +#: src/board_engine.c:829 src/board_engine.c:898 src/board_engine.c:967 #, c-format msgid "Level %d" msgstr "Nivå %d" -#: src/games-scores-dialog.c:118 src/games-scores-dialog.c:545 -msgid "Score" -msgstr "Poeng" - -#: src/games-scores-dialog.c:437 -msgid "New Game" -msgstr "Nytt spill" - -#: src/games-scores-dialog.c:537 -msgid "Name" -msgstr "Navn" - -#: data/gweled.ui:24 -msgid "_Game" -msgstr "_Spill" - -#: data/gweled.ui:43 -msgid "Pauses the game for you can return to it later" -msgstr "Pauser spillet så du kan komme tilbake til det senere." - -#: data/gweled.ui:58 -msgid "_Scores" -msgstr "_Poeng" - -#: data/gweled.ui:85 -msgid "_Settings" -msgstr "_Innstillinger" - -#: data/gweled.ui:106 -msgid "_Help" -msgstr "_Hjelp" - -#: data/gweled.ui:175 -msgid "Welcome to Gweled!" -msgstr "Velkommen til Gweled!" +#: src/board_engine.c:831 +#, c-format +msgid "Bonus x%d" +msgstr "Bonus x%d" -#: data/gweled.ui:219 +#: src/gweled-scores.c:39 +msgctxt "game type" msgid "Normal" msgstr "Normal" -#: data/gweled.ui:270 +#: src/gweled-scores.c:40 +msgctxt "game type" msgid "Timed" -msgstr "Med tidsbegrensning" +msgstr "På tid" -#: data/gweled.ui:322 -msgid "Endless" -msgstr "Uendelig" +#. Translators: label displayed on the scores dialog, preceding a difficulty. +#: src/gweled-scores.c:106 +msgid "Game type:" +msgstr "Spilltype:" -#: data/gweled.ui:382 +#: src/gweled.ui:57 msgid "Score:" msgstr "Poeng:" -#: data/gweled.ui:415 -msgid "Preferences" -msgstr "Brukervalg" - -#: data/gweled.ui:439 -msgid "Board size" -msgstr "Brettstrørrelse" - -#: data/gweled.ui:456 -msgid "Small" -msgstr "Lite" - -#: data/gweled.ui:477 -msgid "Medium" -msgstr "Middels" - -#: data/gweled.ui:499 -msgid "Large" -msgstr "Stort" - -#: data/gweled.ui:525 -msgid "Sound" -msgstr "Lyd" - -#: data/gweled.ui:542 -msgid "Play sound effects" -msgstr "Spill lydeffekter" +#: src/gweled.ui:110 +msgid "Welcome to Gweled!" +msgstr "Velkommen til Gweled!" -#: data/gweled.ui:573 -msgid "Miscellaneous" +#: src/gweled.ui:169 +msgid "Get as many points as you can. The game ends if you run out of moves." msgstr "" +"Oppnå så mange poeng som mulig. Spillet er slutt når du slipper opp for " +"muligheter til å flytte." -#: data/gweled.ui:590 -msgid "Disable hints" -msgstr "" +#: src/gweled.ui:227 +msgid "Get as many points as you can. The game ends if you run out of time." +msgstr "Oppnå så mange poeng som mulig. Spillet er slutt når tiden er ute." + +#: src/gweled.ui:285 +msgid "The game never ends, but your score will not be saved." +msgstr "Spillet tar aldri slutt, men poengsummen lagres ikke." + +#: src/gweled.ui:356 +msgid "_New Game" +msgstr "_Nytt spill" + +#: src/gweled.ui:368 +msgid "Menu" +msgstr "Meny" + +#: src/gweled.ui:389 +msgid "Pauses the game for you can return to it later" +msgstr "Pauser spillet så du kan fortsette senere" + +#: src/gweled-headermenu.ui:22 +msgid "_Sound effects" +msgstr "_Lydeffekter" + +#: src/gweled-headermenu.ui:26 +msgid "_Hints" +msgstr "_Hint" -#: data/gweled.desktop.in:3 data/gweled.appdata.xml.in:8 +#: src/gweled-headermenu.ui:32 +msgid "_Scores" +msgstr "_Poeng" + +#: src/gweled-headermenu.ui:36 +msgid "_About" +msgstr "_Om" + +#: data/org.gweled.gweled.desktop.in:3 data/org.gweled.gweled.appdata.xml.in:5 msgid "Gweled" msgstr "Gweled" -#: data/gweled.desktop.in:4 +#: data/org.gweled.gweled.desktop.in:4 msgid "Play a puzzle game similar to \"Diamond Mine\"" -msgstr "Spill et puslespill likt spillet \"Diamond Mine\"" - -#. TRANSLATORS: Do NOT translate or transliterate this text! -#. This is an icon file name -#: data/gweled.desktop.in:8 -msgid "gweled" msgstr "" -#: data/gweled.appdata.xml.in:9 +#: data/org.gweled.gweled.appdata.xml.in:6 msgid "Bejeweled like real time strategic puzzle game" -msgstr "" +msgstr "Strategisk puslespill som Bejeweled" -#: data/gweled.appdata.xml.in:11 +#: data/org.gweled.gweled.appdata.xml.in:8 msgid "" "Gweled is a GTK+ version of a popular PalmOS/Windows/Java game called " "\"Bejeweled\", originally written by Sebastien Delestaing. The aim of the " @@ -218,3 +169,8 @@ "by swapping adjacent gems. The game ends when there are no possible moves " "left." msgstr "" +"Gweled er en GTK+ versjon av det populære PalmOS/Windows/Java-spillet " +"\"Bejeweled\", opprinnelig laget av Sebastien Delestaing. Målet med spillet " +"er å få tre eller flere edelstener på rad, enten horisontalt eller vertikalt " +"ved å bytte om på edelstener ved siden av hverandre. Spillet er over når du " +"ikke har flere trekk igjen." diff -Nru gweled-1.0~alpha/src/board_engine.c gweled-1.0~beta1/src/board_engine.c --- gweled-1.0~alpha/src/board_engine.c 2023-11-09 19:35:11.000000000 +0000 +++ gweled-1.0~beta1/src/board_engine.c 2024-03-29 15:32:30.000000000 +0000 @@ -43,19 +43,25 @@ void gweled_remove_gems_and_update_score (void); -enum { +typedef enum e_game_state { _IDLE, _FIRST_GEM_CLICKED, _SECOND_GEM_CLICKED, _ILLEGAL_MOVE, _MARK_ALIGNED_GEMS, _BOARD_REFILLING -}; +} T_GameState; + +typedef enum e_alignment_dir +{ + T_ALIGN_HORIZONTAL, + T_ALIGN_VERTICAL +} T_AlignmentDir; typedef struct s_alignment { gint x; gint y; - gint direction; + T_AlignmentDir direction; gint length; } T_Alignment; @@ -89,9 +95,7 @@ T_SGEObject *g_gem_objects[BOARD_WIDTH][BOARD_HEIGHT]; unsigned char gpc_bit_n[8] = { 0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80 }; -static T_SGEObject *g_hint_object = NULL; - -static gint gi_state = _IDLE; +static T_GameState gi_state = _IDLE; static GList *g_alignment_list; @@ -105,7 +109,7 @@ extern guint board_engine_id; extern GweledPrefs prefs; -gchar +gint get_new_tile (void) { int i; @@ -234,10 +238,13 @@ gpc_game_board[x1][y1] = gpc_game_board[x2][y2]; gpc_game_board[x2][y2] = i; } + void gweled_refill_board (void) { gint i, j, k; + gint last_tile = -1; + gint same_tile_count = 1; g_debug("gweled_refill_board():"); for (i = 0; i < BOARD_WIDTH; i++) @@ -252,6 +259,23 @@ g_gem_objects[i][k - 1]; } gpc_game_board[i][0] = get_new_tile (); + + // Keeps count of gems of the same type in a row + if (last_tile == gpc_game_board[i][0]) + same_tile_count++; + else + same_tile_count = 1; + + // If we have at least 3 gems in a row, let's change it. + if (same_tile_count >= 3) { + g_debug("##### 3 gems in a row!!\n"); + do { + gpc_game_board[i][0] = get_new_tile (); + } while (last_tile == gpc_game_board[i][0]); + } + + last_tile = gpc_game_board[i][0]; + gi_nb_of_tiles[gpc_game_board[i][0]]++; // make sure the new tile appears outside of the screen (1st row is special-cased) @@ -280,7 +304,7 @@ alignment = (T_Alignment *) alignment_pointer; // delete alignment - if (alignment->direction == 1) // horizontal + if (alignment->direction == T_ALIGN_HORIZONTAL) // horizontal { xhotspot = (alignment->x * prefs.tile_size + alignment->length * prefs.tile_size / 2); yhotspot = (alignment->y * prefs.tile_size + prefs.tile_size / 2); @@ -307,24 +331,25 @@ i_total_score = 10 * g_rand_int_range (g_random_generator, 1, 2); } else { - i_total_score = 10 * (gi_bonus_multiply >> 1) * (gi_gems_removed - 2) + gi_score_per_move; + i_total_score = 10 * (gi_bonus_multiply >> 1) * (alignment->length - 2) + gi_score_per_move; if(g_do_not_score == TRUE) gi_score_per_move = i_total_score; } if (g_do_not_score == FALSE) { - gi_total_gems_removed += gi_gems_removed; - //g_print("Score: %d Gems removed: %d\n", i_total_score, gi_gems_removed); - gi_score += i_total_score; - //display score - buffer = g_strdup_printf ("%d", i_total_score); - - xpos = xhotspot - prefs.tile_size; - ypos = yhotspot - (prefs.tile_size / 2); - object = gweled_draw_score_message (buffer, TEXT_LAYER, xpos, ypos); - sge_object_zoomin (object, 500, CLUTTER_EASE_OUT_BOUNCE); - sge_object_fly_away (object); + gi_total_gems_removed += gi_gems_removed; + + g_debug("Score: %d Gems removed: %d [tot:%d] %i:%i, dir %i, length:%i\n", i_total_score, gi_gems_removed, gi_score_per_move, alignment->x, alignment->y, alignment->direction, alignment->length); - g_free (buffer); + gi_score += i_total_score; + + // display score + buffer = g_strdup_printf ("%d", i_total_score); + xpos = xhotspot - prefs.tile_size; + ypos = yhotspot - (prefs.tile_size / 2); + object = gweled_draw_score_message (buffer, TEXT_LAYER, xpos, ypos); + sge_object_zoomin (object, 500, CLUTTER_EASE_OUT_BOUNCE); + sge_object_fly_away (object); + g_free (buffer); } } @@ -342,12 +367,18 @@ alignment = (T_Alignment *) object; - if (alignment->direction == 1) // horizontal - for (i = alignment->x; i < alignment->x + alignment->length; i++) - sge_object_zoomout (g_gem_objects[i][alignment->y]); + if (alignment->direction == T_ALIGN_HORIZONTAL) // horizontal + for (i = alignment->x; i < alignment->x + alignment->length; i++) { + sge_gem_destroy (g_gem_objects[i][alignment->y]); + g_gem_objects[i][alignment->y] = NULL; + } + else - for (i = alignment->y; i < alignment->y + alignment->length; i++) - sge_object_zoomout (g_gem_objects[alignment->x][i]); + for (i = alignment->y; i < alignment->y + alignment->length; i++) { + sge_gem_destroy (g_gem_objects[alignment->x][i]); + g_gem_objects[alignment->x][i] = NULL; + } + } void @@ -379,7 +410,7 @@ alignment = (T_Alignment *) g_malloc (sizeof (T_Alignment)); alignment->x = g_rand_int_range (g_random_generator, 0, 7); alignment->y = g_rand_int_range (g_random_generator, 0, 7); - alignment->direction = 1; + alignment->direction = T_ALIGN_HORIZONTAL; alignment->length = 1; g_alignment_list = g_list_append (g_alignment_list, (gpointer) alignment); } @@ -425,7 +456,7 @@ alignment = (T_Alignment *)g_malloc (sizeof (T_Alignment)); alignment->x = start_x; alignment->y = start_y; - alignment->direction = 2; + alignment->direction = T_ALIGN_VERTICAL; alignment->length = i_nb_aligned; g_alignment_list = g_list_append(g_alignment_list, (gpointer) alignment); } @@ -437,14 +468,14 @@ alignment = (T_Alignment *)g_malloc (sizeof (T_Alignment)); alignment->x = start_x; alignment->y = start_y; - alignment->direction = 2; + alignment->direction = T_ALIGN_VERTICAL; alignment->length = i_nb_aligned; g_alignment_list = g_list_append (g_alignment_list, (gpointer) alignment); } i_nb_aligned = 0; } - // make a list of horizontal alignments + // make a list of horizontal alignments i_nb_aligned = 0; for (j = 0; j < BOARD_HEIGHT; j++) { @@ -462,7 +493,7 @@ alignment = (T_Alignment *)g_malloc (sizeof (T_Alignment)); alignment->x = start_x; alignment->y = start_y; - alignment->direction = 1; + alignment->direction = T_ALIGN_HORIZONTAL; alignment->length = i_nb_aligned; g_alignment_list = g_list_append (g_alignment_list, (gpointer) alignment); } @@ -474,7 +505,7 @@ alignment = (T_Alignment *) g_malloc (sizeof (T_Alignment)); alignment->x = start_x; alignment->y = start_y; - alignment->direction = 1; + alignment->direction = T_ALIGN_HORIZONTAL; alignment->length = i_nb_aligned; g_alignment_list = g_list_append (g_alignment_list, (gpointer) alignment); } @@ -484,6 +515,52 @@ return (g_list_length (g_alignment_list) != 0); } + +void +gweled_fill_new_board () +{ + gint i, j; + + memset (gi_nb_of_tiles, 0, 7 * sizeof (int)); + + for (i = 0; i < BOARD_WIDTH; i++) + for (j = 0; j < BOARD_HEIGHT; j++) + { + gpc_game_board[i][j] = get_new_tile (); + gi_nb_of_tiles[gpc_game_board[i][j]]++; + g_gem_objects[i][j] = + sge_create_object (i, + (j - BOARD_HEIGHT), + GEMS_LAYER, + gi_gems_pixbuf[gpc_game_board[i][j]]); + } + + g_do_not_score = TRUE; + + while(gweled_check_for_alignments ()) { + gweled_remove_gems_and_update_score (); + gweled_refill_board(); + }; + g_do_not_score = FALSE; + + //test pattern for a known bug +/* + gpc_game_board[0][7] = 0; + gpc_game_board[1][7] = 0; + gpc_game_board[2][7] = 1; + gpc_game_board[3][7] = 0; + gpc_game_board[4][7] = 1; + gpc_game_board[5][7] = 1; +*/ + + + for (i = 0; i < BOARD_WIDTH; i++) + for (j = 0; j < BOARD_HEIGHT; j++) + g_gem_objects[i][j] = sge_create_object (i, (j - BOARD_HEIGHT), GEMS_LAYER, + gi_gems_pixbuf[gpc_game_board[i][j]]); + +} + void board_set_pause(gboolean value) { @@ -493,17 +570,13 @@ if(value == TRUE) { gtk_button_set_label(GTK_BUTTON(gweled_ui->g_pause_game_btn), _("_Resume")); - gweled_draw_game_message(_("Paused"), -1); + gweled_draw_game_message(_("Paused"), 0); last_text = g_strdup(gtk_progress_bar_get_text(GTK_PROGRESS_BAR(gweled_ui->g_progress_bar))); gtk_progress_bar_set_text(GTK_PROGRESS_BAR(gweled_ui->g_progress_bar), _("Paused")); sge_set_layer_visibility(GEMS_LAYER, FALSE); sge_set_layer_visibility(EFFECTS_LAYER, FALSE); gweled_set_hints_active(FALSE); - if(sge_object_exists(g_hint_object)) { - sge_destroy_object (g_hint_object, NULL); - g_hint_object = NULL; - } } else { gtk_button_set_label(GTK_BUTTON(gweled_ui->g_pause_game_btn), _("_Pause")); @@ -548,6 +621,13 @@ } gboolean +gweled_game_over_callback (gpointer data) +{ + gweled_hiscores_show_and_add(gi_score, prefs.game_mode); + return FALSE; +} + +gboolean board_engine_loop (gpointer data) { static gint x1, y1, x2, y2, time_slice = 0; @@ -572,7 +652,7 @@ gi_total_gems_removed -= g_steps_for_timer; if (gi_total_gems_removed <= gi_previous_bonus_at) { - gweled_draw_game_message (_("Time's up!"), -1); + gweled_draw_game_message (_("Time's up!"), 0); sge_set_layer_opacity(GEMS_LAYER, 128); // Removes any gem that is still activated @@ -586,7 +666,7 @@ gi_state = _IDLE; if (gi_score > 0) - gweled_hiscores_show_and_add(gi_score, TIMED_MODE); + g_timeout_add_seconds (1, gweled_game_over_callback, NULL); } else gtk_progress_bar_set_fraction ((GtkProgressBar *) @@ -599,11 +679,6 @@ if(hint_timeout && gi_gem_clicked) { gweled_set_hints_active(FALSE); - if(g_hint_object && sge_object_exists(g_hint_object)) { - sge_destroy_object (g_hint_object, NULL); - g_hint_object = NULL; - } else - g_hint_object = NULL; } switch (gi_state) { @@ -633,11 +708,6 @@ if (((x1 == x2) && (fabs (y1 - y2) == 1)) || ((y1 == y2) && (fabs (x1 - x2) == 1))) { // If the player clicks an adjacent gem, try to swap - if (cursor[1]) - sge_destroy_object (cursor[1], NULL); - cursor[1] = sge_create_object (x2, - y2, - EFFECTS_LAYER, gi_cursor_pixbuf); sge_object_blink_stop(g_gem_objects[x1][y1]); // swap gems sge_object_move_to (g_gem_objects[x1][y1], @@ -650,18 +720,11 @@ sge_object_move_to (cursor[0], x2, y2); - sge_object_move_to (cursor[1], - x1, - y1); sound_effect_play (SWAP_EVENT); gi_state = _SECOND_GEM_CLICKED; } else if((x1 == x2) && (y1 == y2)) { - if (cursor[1]) { - sge_destroy_object (cursor[1], NULL); - cursor[1] = NULL; - } // If the player clicks the selected gem, deselect it if(cursor[0]) { sge_destroy_object(cursor[0], NULL); @@ -671,10 +734,6 @@ gi_state = _IDLE; gi_gem_clicked = 0; } else { - if (cursor[1]) { - sge_destroy_object (cursor[1], NULL); - cursor[1] = NULL; - } // If the player clicks anywhere else, make that the first selection sge_object_blink_stop(g_gem_objects[x1][y1]); sge_object_blink_start(g_gem_objects[x2][y2]); @@ -689,11 +748,6 @@ }else if(gi_gem_dragged) { //printf("gem dragged\n"); - if (cursor[1]) - sge_destroy_object (cursor[1], NULL); - cursor[1] = sge_create_object (gi_x_drag, - gi_y_drag, - EFFECTS_LAYER, gi_cursor_pixbuf); } break; @@ -709,9 +763,6 @@ x1, y1); // re-swap cursors - sge_object_move_to (cursor[1], - x2, - y2); sge_object_move_to (cursor[0], x1, y1); @@ -723,9 +774,7 @@ } // fadeout cursors if (cursor[0]) - sge_object_fadeout (cursor[0], 0); - if (cursor[1]) - sge_object_fadeout (cursor[1], 0); + sge_object_fadeout (cursor[0], 0, 200); cursor[0] = NULL; cursor[1] = NULL; } @@ -748,44 +797,26 @@ gtk_progress_bar_set_fraction (GTK_PROGRESS_BAR(gweled_ui->g_progress_bar), (float) (gi_total_gems_removed - gi_previous_bonus_at) / (float) (gi_next_bonus_at - gi_previous_bonus_at)); else gtk_progress_bar_set_fraction (GTK_PROGRESS_BAR(gweled_ui->g_progress_bar), 1.0); - - gi_state = _BOARD_REFILLING; } + + gi_state = _BOARD_REFILLING; gweled_refill_board (); gweled_gems_fall_into_place (FALSE); } else { if (gweled_check_for_moves_left (NULL, NULL) == FALSE) { - if ((gi_level == 1) || (prefs.game_mode == ENDLESS_MODE) || (prefs.game_mode == TIMED_MODE)) { - gint i, j; + if (prefs.game_mode == ENDLESS_MODE || prefs.game_mode == TIMED_MODE) { gweled_draw_game_message (_("No moves left!"), 2); - memset (gi_nb_of_tiles, 0, 7 * sizeof (int)); - for (i = 0; i < BOARD_WIDTH; i++) - for (j = 0; j < BOARD_HEIGHT; j++) { - sge_destroy_object (g_gem_objects[i][j], NULL); - gpc_game_board[i][j] = get_new_tile(); - gi_nb_of_tiles[gpc_game_board[i][j]]++; - } - g_do_not_score = TRUE; - while(gweled_check_for_alignments ()) { - gweled_remove_gems_and_update_score (); - gweled_refill_board(); - }; - g_do_not_score = FALSE; - for (i = 0; i < BOARD_WIDTH; i++) - for (j = 0; j < BOARD_HEIGHT; j++) { - g_gem_objects[i][j] = sge_create_object ( - i, - (j - BOARD_HEIGHT), - GEMS_LAYER, gi_gems_pixbuf[gpc_game_board[i][j]]); - } + sge_destroy_all_objects_on_level(GEMS_LAYER); + gweled_fill_new_board(); + gweled_gems_fall_into_place (FALSE); gi_state = _MARK_ALIGNED_GEMS; } else { // Game over - gweled_draw_game_message (_("No moves left!"), -1); + gweled_draw_game_message (_("No moves left!"), 0); sge_set_layer_opacity(GEMS_LAYER, 128); gtk_widget_hide(gweled_ui->g_pause_game_btn); gi_game_running = FALSE; @@ -793,7 +824,7 @@ gi_state = _IDLE; if (gi_score > 0) - gweled_hiscores_show_and_add(gi_score, NORMAL_MODE); + g_timeout_add_seconds (1, gweled_game_over_callback, NULL); } } else { g_do_not_score = FALSE; @@ -804,7 +835,7 @@ case _BOARD_REFILLING: if (!sge_objects_are_moving_on_layer (GEMS_LAYER)) { - if (gi_total_gems_removed >= gi_next_bonus_at) { + if (gi_total_gems_removed >= gi_next_bonus_at && prefs.game_mode != ENDLESS_MODE) { gi_previous_bonus_at = gi_next_bonus_at; gi_next_bonus_at *= 2; @@ -860,11 +891,10 @@ board_engine_id = g_timeout_add (50, board_engine_loop, NULL); } + void gweled_start_new_game (void) { - gint i, j; - gi_game_paused = 0; gi_score = 0; gi_current_score = 0; @@ -897,42 +927,7 @@ gweled_set_current_score (0); - memset (gi_nb_of_tiles, 0, 7 * sizeof (int)); - - for (i = 0; i < BOARD_WIDTH; i++) - for (j = 0; j < BOARD_HEIGHT; j++) - { - gpc_game_board[i][j] = get_new_tile (); - gi_nb_of_tiles[gpc_game_board[i][j]]++; - g_gem_objects[i][j] = - sge_create_object (i, - (j - BOARD_HEIGHT), - GEMS_LAYER, - gi_gems_pixbuf[gpc_game_board[i][j]]); - } - - g_do_not_score = TRUE; - while(gweled_check_for_alignments ()) { - gweled_remove_gems_and_update_score (); - gweled_refill_board(); - }; - g_do_not_score = FALSE; - - //test pattern for a known bug -/* - gpc_game_board[0][7] = 0; - gpc_game_board[1][7] = 0; - gpc_game_board[2][7] = 1; - gpc_game_board[3][7] = 0; - gpc_game_board[4][7] = 1; - gpc_game_board[5][7] = 1; -*/ - - - for (i = 0; i < BOARD_WIDTH; i++) - for (j = 0; j < BOARD_HEIGHT; j++) - g_gem_objects[i][j] = sge_create_object (i, (j - BOARD_HEIGHT), GEMS_LAYER, - gi_gems_pixbuf[gpc_game_board[i][j]]); + gweled_fill_new_board(); gweled_gems_fall_into_place (TRUE); @@ -940,6 +935,7 @@ gi_state = _MARK_ALIGNED_GEMS; } + GweledGameState* gweled_get_current_game(void) { diff -Nru gweled-1.0~alpha/src/graphic_engine.c gweled-1.0~beta1/src/graphic_engine.c --- gweled-1.0~alpha/src/graphic_engine.c 2023-11-09 19:35:11.000000000 +0000 +++ gweled-1.0~beta1/src/graphic_engine.c 2024-03-29 15:32:30.000000000 +0000 @@ -32,20 +32,17 @@ #include "sge_utils.h" #include "board_engine.h" +#include "gweled-gui.h" #include "graphic_engine.h" extern gchar gpc_game_board[BOARD_WIDTH][BOARD_HEIGHT]; extern GRand *g_random_generator; extern GdkPixbuf *g_gems_pixbuf[7]; -extern GtkWidget *g_main_window; -extern GtkWidget *g_main_game_stack; -extern GtkWidget *g_clutter; -extern GtkWidget *g_welcome_box; +extern GuiContext *gweled_ui; extern T_SGEObject *g_gem_objects[BOARD_WIDTH][BOARD_HEIGHT]; -extern ClutterActor *g_stage; extern ClutterActor *g_actor_layers[5]; extern GweledPrefs prefs; @@ -55,6 +52,8 @@ gint gi_gems_pixbuf[7] = {-1, -1, -1, -1, -1, -1, -1}; gint gi_cursor_pixbuf = -1; +gboolean ready_to_fall = FALSE; + void gweled_load_pixmaps (gint size) { @@ -141,30 +140,58 @@ sge_object_zoomin (object, 500, CLUTTER_EASE_OUT_BACK); - if (lifetime != -1) - sge_object_fadeout(object, lifetime); + if (lifetime > 0) + sge_object_fadeout(object, lifetime, 500); } //const gchar* gems[] = {"\e[1;37;40mWH", "\e[1;36;40mBL", "\e[0;33;40mAR", "\e[1;35;40mVI", "\e[1;31;40mRO", "\e[1;33;40mYE", "\e[1;32;40mGR"}; +gboolean +gweled_gems_ready_to_fall_check (gpointer data) +{ + if (sge_objects_are_moving_on_layer (GEMS_LAYER)) + g_timeout_add (10, gweled_gems_ready_to_fall_check, data); + else + gweled_gems_fall_into_place (GPOINTER_TO_INT(data)); + + return FALSE; +} + void -gweled_gems_fall_into_place (gboolean with_delay) +gweled_gems_fall_into_place (gboolean new_board_animation) { gint i, j; - g_print("gweled_gems_fall_into_place() delay:%d\n", with_delay); - + gint delay_incr = 0; + gint max_height = 0; - for (j = 0; j < BOARD_HEIGHT; j++) { - for (i = 0; i < BOARD_WIDTH; i++) { + // Avoid gems falling if there are something moving/animating. + if (sge_objects_are_moving_on_layer (GEMS_LAYER)) { + g_timeout_add (10, gweled_gems_ready_to_fall_check, GINT_TO_POINTER(new_board_animation)); + return; + } - if (with_delay) - sge_object_fall_to_with_delay (g_gem_objects[i][j], - j, (i * 100) + ((BOARD_HEIGHT - j) * 50)); + for (i = BOARD_WIDTH - 1; i >= 0; i--) { + delay_incr = 0; + for (j = BOARD_HEIGHT - 1; j >= 0; j--) { + + if (g_gem_objects[i][j]->y == j) continue; + + if (max_height < j) + max_height = j; + + if (new_board_animation) + sge_object_fall_to_with_effect (g_gem_objects[i][j], j, + (i * 100) + ((BOARD_HEIGHT - j) * 50)); else - sge_object_fall_to (g_gem_objects[i][j], j); + sge_object_fall_to (g_gem_objects[i][j], j, + // delay incremental + delay_incr * 25, + // trying to have the same speed regardless the destination + 100 + 20 * max_height); + + delay_incr++; } - //g_print("\n\e[0m"); } } diff -Nru gweled-1.0~alpha/src/graphic_engine.h gweled-1.0~beta1/src/graphic_engine.h --- gweled-1.0~alpha/src/graphic_engine.h 2023-11-09 19:35:11.000000000 +0000 +++ gweled-1.0~beta1/src/graphic_engine.h 2024-03-29 15:32:30.000000000 +0000 @@ -34,7 +34,7 @@ gweled_draw_score_message (gchar *in_message, T_SGELayer layer, gint msg_x, gint msg_y); void -gweled_gems_fall_into_place (gboolean with_delay); +gweled_gems_fall_into_place (gboolean new_board_animation); void gweled_draw_board (gint size); diff -Nru gweled-1.0~alpha/src/gweled-gui.c gweled-1.0~beta1/src/gweled-gui.c --- gweled-1.0~alpha/src/gweled-gui.c 2023-11-09 19:35:11.000000000 +0000 +++ gweled-1.0~beta1/src/gweled-gui.c 2024-03-29 15:32:30.000000000 +0000 @@ -111,11 +111,11 @@ "authors", authors, "translator-credits", strcmp("translator-credits", translator_credits) ? translator_credits : NULL, "comments", _("A puzzle game with gems"), - "copyright", "Copyright © 2003-2005 Sebastien Delestaing\nCopyright © 2010-2021 Daniele Napolitano", + "copyright", "Copyright © 2003-2005 Sebastien Delestaing\nCopyright © 2010-2024 Daniele Napolitano", "version", VERSION, "license-type", GTK_LICENSE_GPL_2_0, "website", "https://gweled.org", - "logo-icon-name", PACKAGE_NAME, + "logo-icon-name", APPLICATION_ID, NULL); } @@ -152,8 +152,6 @@ gweled_stop_game (); - sge_pause_timeline(); - welcome_screen_visibility (TRUE); } @@ -176,7 +174,6 @@ gboolean board_start (gpointer data) { - sge_start_timeline(); gweled_start_new_game (); respawn_board_engine_loop(); return FALSE; @@ -211,7 +208,7 @@ } -void +gboolean gweled_ui_destroy(GtkWidget *window, gpointer user_data) { GtkWidget *dialog; @@ -238,9 +235,11 @@ g_rand_free (g_random_generator); - gtk_widget_destroy(gweled_ui->main_window); + sge_destroy (); + gtk_widget_destroy (window); + gtk_main_quit(); - gtk_main_quit (); + return FALSE; } diff -Nru gweled-1.0~alpha/src/gweled-headermenu.ui gweled-1.0~beta1/src/gweled-headermenu.ui --- gweled-1.0~alpha/src/gweled-headermenu.ui 2023-11-09 19:35:11.000000000 +0000 +++ gweled-1.0~beta1/src/gweled-headermenu.ui 2024-03-29 15:32:30.000000000 +0000 @@ -33,7 +33,7 @@ app.scores - _About + _About Gweled app.about diff -Nru gweled-1.0~alpha/src/gweled-scores.c gweled-1.0~beta1/src/gweled-scores.c --- gweled-1.0~alpha/src/gweled-scores.c 2023-11-09 19:35:11.000000000 +0000 +++ gweled-1.0~beta1/src/gweled-scores.c 2024-03-29 15:32:30.000000000 +0000 @@ -101,12 +101,13 @@ void gweled_init_scores(GtkWindow *parent_window) { - high_scores = games_scores_context_new("gweled", + high_scores = games_scores_context_new_with_icon_name("gweled", /* Translators: label displayed on the scores dialog, preceding a difficulty. */ _("Game type:"), GTK_WINDOW (parent_window), get_scores_category_from_key, - NULL, GAMES_SCORES_STYLE_POINTS_GREATER_IS_BETTER); + NULL, GAMES_SCORES_STYLE_POINTS_GREATER_IS_BETTER, + APPLICATION_ID); } diff -Nru gweled-1.0~alpha/src/gweled.ui gweled-1.0~beta1/src/gweled.ui --- gweled-1.0~alpha/src/gweled.ui 2023-11-09 19:35:11.000000000 +0000 +++ gweled-1.0~beta1/src/gweled.ui 2024-03-29 15:32:30.000000000 +0000 @@ -5,7 +5,7 @@ False Gweled - gweled + org.gweled.gweled True @@ -95,7 +95,7 @@ True False 48 - gweled + org.gweled.gweled False @@ -388,6 +388,7 @@ True Pauses the game for you can return to it later True + end diff -Nru gweled-1.0~alpha/src/main.c gweled-1.0~beta1/src/main.c --- gweled-1.0~alpha/src/main.c 2023-11-09 19:35:11.000000000 +0000 +++ gweled-1.0~beta1/src/main.c 2024-03-29 15:32:30.000000000 +0000 @@ -74,13 +74,13 @@ gboolean is_present_saved_game() { gchar *filename; + gboolean test; + filename = g_strconcat(g_get_user_config_dir(), G_DIR_SEPARATOR_S SAVED_GAME_FILENAME, NULL); - if (g_file_test(filename, G_FILE_TEST_EXISTS | G_FILE_TEST_IS_REGULAR)){ - g_free(filename); - return TRUE; - } + test = g_file_test(filename, G_FILE_TEST_EXISTS | G_FILE_TEST_IS_REGULAR); - return FALSE; + g_free(filename); + return test; } void @@ -133,6 +133,7 @@ if (g_file_test(filename, G_FILE_TEST_EXISTS | G_FILE_TEST_IS_REGULAR)){ unlink(filename); } + g_free(filename); } static void @@ -156,7 +157,6 @@ gtk_main(); } - int main (int argc, char **argv) { GtkApplication *app; @@ -189,11 +189,9 @@ g_set_application_name("Gweled"); status = g_application_run (G_APPLICATION (app), argc, argv); - g_object_unref (app); - //sge_destroy (); - if(board_engine_id) - g_source_remove (board_engine_id); + g_object_run_dispose (G_OBJECT (app)); + g_clear_object (&app); return status; } diff -Nru gweled-1.0~alpha/src/sge_core.c gweled-1.0~beta1/src/sge_core.c --- gweled-1.0~alpha/src/sge_core.c 2023-11-09 19:35:11.000000000 +0000 +++ gweled-1.0~beta1/src/sge_core.c 2024-03-29 15:32:30.000000000 +0000 @@ -56,15 +56,10 @@ extern GweledPrefs prefs; -static gint gi_dragging = 0; - ClutterActor *g_gameboard = NULL; ClutterActor *g_actor_layers[5] = {NULL, NULL, NULL, NULL, NULL}; -ClutterTimeline *timeline; - - GdkPixbuf * sge_get_pixbuf(gint index) { return g_pixbufs[index]; @@ -117,8 +112,14 @@ clutter_actor_destroy (SGE_OBJECT(object)->actor); SGE_OBJECT(object)->actor = NULL; } + + if (SGE_OBJECT(object)->effect_handler_id) { + g_source_remove(SGE_OBJECT(object)->effect_handler_id); + } + g_object_list = g_list_remove (g_object_list, object); g_free(object); + object = NULL; } void @@ -150,6 +151,7 @@ gboolean is_finished, gpointer object) { + SGE_OBJECT(object)->animating = FALSE; sge_destroy_object (SGE_OBJECT(object), NULL); } @@ -161,6 +163,14 @@ sge_destroy_object (SGE_OBJECT(user_data), NULL); } +void +sge_finished_animation (ClutterActor *actor, + gpointer object) { + + SGE_OBJECT(object)->animating = FALSE; + g_signal_handler_disconnect (actor, SGE_OBJECT(object)->animating_handler_id); +} + // animations/effects // used for gems swapping @@ -170,34 +180,41 @@ object->x = dest_x; object->y = dest_y; - sge_object_reset_effects (object); + object->animating = TRUE; clutter_actor_save_easing_state (object->actor); clutter_actor_set_easing_mode(object->actor, CLUTTER_EASE_IN_OUT_CUBIC); clutter_actor_set_easing_duration (object->actor, 200); clutter_actor_set_position (object->actor, dest_x * prefs.tile_size, dest_y * prefs.tile_size); clutter_actor_restore_easing_state (object->actor); + + object->animating_handler_id = g_signal_connect (object->actor, "transitions-completed", + G_CALLBACK (sge_finished_animation), + object); } void -sge_object_fall_to (T_SGEObject * object, gint y_pos) +sge_object_fall_to (T_SGEObject * object, gint y_pos, gint delay, gint speed) { - if (object->y == y_pos) return; + object->animating = TRUE; clutter_actor_save_easing_state (object->actor); - clutter_actor_set_easing_mode(object->actor, CLUTTER_EASE_OUT_ELASTIC); - clutter_actor_set_easing_duration (object->actor, 500); - clutter_actor_set_easing_delay (object->actor, (BOARD_HEIGHT - object->y) * 10); + clutter_actor_set_easing_mode(object->actor, CLUTTER_EASE_OUT_CUBIC); + clutter_actor_set_easing_duration (object->actor, speed); + clutter_actor_set_easing_delay (object->actor, delay); clutter_actor_set_position (object->actor, object->x * prefs.tile_size, y_pos * prefs.tile_size); clutter_actor_restore_easing_state (object->actor); object->y = y_pos; + object->animating_handler_id = g_signal_connect (object->actor, "transitions-completed", + G_CALLBACK (sge_finished_animation), + object); } // Used only for the game start animation void -sge_object_fall_to_with_delay (T_SGEObject * object, gint y_pos, gint delay) +sge_object_fall_to_with_effect (T_SGEObject * object, gint y_pos, gint delay) { object->y = y_pos; @@ -214,9 +231,7 @@ gboolean sge_object_is_moving (T_SGEObject * object) { - gfloat cx, cy; - clutter_actor_get_position(object->actor, &cx, &cy); - return ((object->x * prefs.tile_size != cx) || (object->y * prefs.tile_size != cy)); + return object->animating; } gboolean @@ -224,14 +239,17 @@ { gint i; T_SGEObject *object; + gboolean moving = FALSE; for (i = 0; i < g_list_length (g_object_list); i++) { object = SGE_OBJECT (g_list_nth_data (g_object_list, i)); - if (object->layer == layer) - if (sge_object_is_moving (object)) - return TRUE; + if (object->layer == layer && sge_object_is_moving (object)) { + moving = TRUE; + break; + } } - return FALSE; + + return moving; } void sge_set_layer_visibility (T_SGELayer layer, gboolean visibility) @@ -250,19 +268,48 @@ // fadeout the object and then destroy it -void sge_object_fadeout (T_SGEObject *object, guint delay_secs) +void sge_object_fadeout (T_SGEObject *object, guint delay_secs, guint duration) { clutter_actor_save_easing_state (object->actor); clutter_actor_set_easing_mode(object->actor, CLUTTER_LINEAR); - clutter_actor_set_easing_duration (object->actor, 200); + clutter_actor_set_easing_duration (object->actor, duration); clutter_actor_set_easing_delay(object->actor, delay_secs * 1000); clutter_actor_set_opacity (object->actor, 0); - clutter_actor_restore_easing_state (object->actor); + + ClutterTransition *transition = clutter_actor_get_transition (object->actor, "opacity"); + g_signal_connect (transition, "stopped", + G_CALLBACK (sge_destroy_on_specific_transition_ended), + object); - g_signal_connect (object->actor, "transition-stopped", - G_CALLBACK (sge_destroy_on_transition_ended), + clutter_actor_restore_easing_state (object->actor); +} + +void +sge_zoomout_on_transition_ended (ClutterActor *actor, + char *name, + gboolean is_finished, + gpointer object) { + + sge_object_zoomout (SGE_OBJECT(object)); +} + +// Destroy the gem with some effects +void sge_gem_destroy (T_SGEObject *object) +{ + if (object == NULL) return; + + object->animating = TRUE; + + + clutter_actor_save_easing_state (object->actor); + clutter_actor_set_easing_mode (object->actor, CLUTTER_EASE_OUT_CUBIC); + clutter_actor_set_easing_duration (object->actor, 80); + clutter_actor_set_scale (object->actor, 1.2, 1.2); + clutter_actor_restore_easing_state (object->actor); + + object->animating_handler_id = g_signal_connect (object->actor, "transition-stopped", + G_CALLBACK (sge_zoomout_on_transition_ended), object); - } // zoomout the object and then destroy it @@ -270,10 +317,12 @@ { clutter_actor_save_easing_state (object->actor); clutter_actor_set_easing_mode (object->actor, CLUTTER_LINEAR); - clutter_actor_set_easing_duration (object->actor, 200); - clutter_actor_set_scale (object->actor, 0, 0); + clutter_actor_set_easing_duration (object->actor, 150); + clutter_actor_set_scale (object->actor, 0, 0); clutter_actor_restore_easing_state (object->actor); + g_signal_handler_disconnect (object->actor, object->animating_handler_id); + g_signal_connect (object->actor, "transition-stopped", G_CALLBACK (sge_destroy_on_transition_ended), object); @@ -327,45 +376,11 @@ clutter_actor_save_easing_state (object->actor); clutter_actor_set_easing_mode (object->actor, CLUTTER_LINEAR); - clutter_actor_set_easing_duration(object->actor, 100); + clutter_actor_set_easing_duration(object->actor, 0); clutter_actor_set_opacity(object->actor, 255); clutter_actor_set_position (object->actor, object->x * prefs.tile_size, object->y * prefs.tile_size); - clutter_actor_set_size (object->actor, prefs.tile_size, prefs.tile_size); + clutter_actor_set_scale (object->actor, 1, 1); clutter_actor_restore_easing_state (object->actor); - - clutter_timeline_pause(timeline); -} - -void sge_object_blink_start (T_SGEObject *object) -{ - object->blink = TRUE; - object->animation_status = TRUE; - clutter_timeline_start(timeline); -} - -void sge_object_blink_stop (T_SGEObject *object) -{ - object->blink = FALSE; - sge_object_reset_effects(object); -} - -gboolean -sge_object_stop_bounce (gpointer data) -{ - T_SGEObject *object = SGE_OBJECT(data); - - object->bounce = FALSE; - sge_object_reset_effects(object); - - return FALSE; -} - -void sge_object_bounce (T_SGEObject *object) -{ - object->bounce = TRUE; - object->animation_status = TRUE; - clutter_timeline_start(timeline); - g_timeout_add_seconds (2, sge_object_stop_bounce, object); } gboolean @@ -378,16 +393,16 @@ } static gboolean -on_board_clicked (ClutterActor *stage, - ClutterEvent *event, - gpointer dummy G_GNUC_UNUSED) +board_input_event (ClutterActor *stage, + ClutterEvent *event, + gpointer dummy G_GNUC_UNUSED) { gfloat x, y; static gint x_press = -1; - static gint y_press = -1; - static gint x_release = -1; - static gint y_release = -1; - g_print("Board clicked\n"); + static gint y_press = -1; + static gint x_release = -1; + static gint y_release = -1; + static gboolean gi_dragging = FALSE; // resume game on click if (is_game_running() && board_get_pause() == TRUE ) { @@ -401,27 +416,40 @@ return FALSE; // only handle left button - if (clutter_event_get_button (event) != CLUTTER_BUTTON_PRIMARY) + if (event->type == CLUTTER_BUTTON_PRESS && clutter_event_get_button (event) != CLUTTER_BUTTON_PRIMARY) return FALSE; // Can't use the actor position due to possible gems transformations. clutter_event_get_coords (event, &x, &y); + + g_debug("Board input! %i:%i [%.2lfx%.2lf] event_type:%i\n", gi_x_click, gi_y_click, x, y, event->type); - respawn_board_engine_loop(); - - switch (clutter_event_type (event)) { + switch (event->type) { case CLUTTER_BUTTON_PRESS: + case CLUTTER_TOUCH_BEGIN: gi_x_click = x_press = round(x) / prefs.tile_size; gi_y_click = y_press = round(y) / prefs.tile_size; gi_gem_clicked = -1; - gi_dragging = -1; sound_effect_play (CLICK_EVENT); + + if (event->type == CLUTTER_TOUCH_BEGIN) { + gi_dragging = TRUE; + } + + respawn_board_engine_loop(); + break; case CLUTTER_BUTTON_RELEASE: - gi_dragging = 0; + case CLUTTER_TOUCH_END: + case CLUTTER_TOUCH_UPDATE: + + if (event->type == CLUTTER_TOUCH_UPDATE && gi_dragging == FALSE) { + break; + } + gi_gem_dragged = 0; x_release = round(x) / prefs.tile_size; @@ -431,15 +459,17 @@ gi_x_click = x_release; gi_y_click = y_release; gi_gem_clicked = -1; + gi_dragging = FALSE; } + + respawn_board_engine_loop(); + break; default: break; } - g_print("Clicked! %i:%i [%.2lfx%.2lf] btn:%i event_type:%i\n", gi_x_click, gi_y_click, x, y, clutter_event_get_button (event), clutter_event_type (event)); - return CLUTTER_EVENT_STOP; } @@ -489,61 +519,104 @@ } +gboolean +sge_object_effects_cb (gpointer data) +{ + T_SGEObject *object = SGE_OBJECT(data); + if (object->effect == NONE) { + object->effect_status = TRUE; + sge_object_reset_effects (object); + return FALSE; + } -/* Timeline handler */ -static void -sge_clutter_frame_cb (ClutterTimeline *timeline, - gint msecs, - gpointer data) -{ - gint i; - guint progress = clutter_timeline_get_progress (timeline) * 360.0f; - T_SGEObject *object; + clutter_actor_save_easing_state (object->actor); - if (progress < 360) - return; + if (object->effect == BLINK) { - for (i = 0; i < g_list_length (g_object_list); i++) { - object = SGE_OBJECT (g_list_nth_data (g_object_list, i)); - if (object->blink) { - clutter_actor_save_easing_state (object->actor); - clutter_actor_set_easing_mode(object->actor, CLUTTER_LINEAR); - clutter_actor_set_easing_duration (object->actor, 100); - if (object->animation_status) { - clutter_actor_set_opacity (object->actor, 155); - object->animation_status = FALSE; - } - else { - clutter_actor_set_opacity (object->actor, 255); - object->animation_status = TRUE; - } - clutter_actor_restore_easing_state (object->actor); + clutter_actor_set_easing_mode(object->actor, CLUTTER_LINEAR); + clutter_actor_set_easing_duration (object->actor, 200); + if (object->effect_status) { + clutter_actor_set_opacity (object->actor, 155); + object->effect_status = FALSE; + } + else { + clutter_actor_set_opacity (object->actor, 255); + object->effect_status = TRUE; } - if (object->bounce) { - clutter_actor_save_easing_state (object->actor); + object->effect_handler_id = g_timeout_add (200, sge_object_effects_cb, object); + } + + if (object->effect == BOUNCE) { clutter_actor_set_easing_mode(object->actor, CLUTTER_EASE_IN_OUT_QUAD); - if (object->animation_status) { - clutter_actor_set_easing_duration (object->actor, 500); + if (object->effect_status) { + clutter_actor_set_easing_duration (object->actor, 350); clutter_actor_set_position (object->actor, - object->x * prefs.tile_size - (prefs.tile_size * 0.05), - object->y * prefs.tile_size + (prefs.tile_size * 0.2)); - clutter_actor_set_size (object->actor, prefs.tile_size * 1.1, prefs.tile_size * 0.9); + object->x * prefs.tile_size, + object->y * prefs.tile_size + (prefs.tile_size * 0.07)); + clutter_actor_set_scale (object->actor, 1.1, 0.9); + + object->effect_status = FALSE; - object->animation_status = FALSE; + object->effect_handler_id = g_timeout_add (350, sge_object_effects_cb, object); } else { - clutter_actor_set_easing_duration (object->actor, 250); + clutter_actor_set_easing_duration (object->actor, 150); clutter_actor_set_position (object->actor, object->x * prefs.tile_size, object->y * prefs.tile_size); - clutter_actor_set_size (object->actor, prefs.tile_size, prefs.tile_size); + clutter_actor_set_scale (object->actor, 1, 1); - object->animation_status = TRUE; + object->effect_status = TRUE; + + object->effect_handler_id = g_timeout_add (150, sge_object_effects_cb, object); } - clutter_actor_restore_easing_state (object->actor); - } - } + } + + clutter_actor_restore_easing_state (object->actor); + + return FALSE; +} + +static void +sge_object_start_effect (T_SGEObject *object, T_SGEEffect effect) +{ + // Sets the effect + object->effect = effect; + // Reset the effect repetition status + object->effect_status = TRUE; + sge_object_effects_cb(object); +} + +static void +sge_object_stop_effect (T_SGEObject *object) { + object->effect = NONE; + g_source_remove(object->effect_handler_id); + object->effect_handler_id = 0; + sge_object_reset_effects (object); +} + +void sge_object_blink_start (T_SGEObject *object) +{ + sge_object_start_effect (object, BLINK); +} + +void sge_object_blink_stop (T_SGEObject *object) +{ + sge_object_stop_effect (object); +} +gboolean +sge_object_stop_bounce_cb (gpointer data) +{ + T_SGEObject *object = SGE_OBJECT(data); + sge_object_stop_effect (object); + return FALSE; +} + +void sge_object_bounce (T_SGEObject *object) +{ + sge_object_start_effect (object, BOUNCE); + g_timeout_add_seconds (2, sge_object_stop_bounce_cb, object); } //objects creation/destruction @@ -564,9 +637,10 @@ object->y_delay = 0; - object->blink = FALSE; - object->bounce = FALSE; - object->animation_status = FALSE; + object->animating = FALSE; + + object->effect = NONE; + object->effect_handler_id = 0; object->layer = layer; @@ -581,7 +655,6 @@ gtk_clutter_texture_set_from_pixbuf (GTK_CLUTTER_TEXTURE (object->actor), GDK_PIXBUF(g_pixbufs[pixbuf_id]), &error); - clutter_actor_set_name(object->actor, g_strdup_printf ("pixbuf #%d", pixbuf_id)); clutter_actor_set_size (CLUTTER_ACTOR(object->actor), object->width, object->height); @@ -675,11 +748,11 @@ object->y = y; object->pixbuf_id = 0; + object->animating = FALSE; + object->y_delay = 0; - object->blink = FALSE; - object->bounce = FALSE; - object->animation_status = FALSE; + object->effect_handler_id = 0; object->layer = layer; @@ -731,11 +804,11 @@ object->y = 0; object->pixbuf_id = 0; + object->animating = FALSE; + object->y_delay = 0; - object->blink = FALSE; - object->bounce = FALSE; - object->animation_status = FALSE; + object->effect_handler_id = 0; object->layer = layer; @@ -776,19 +849,15 @@ { int i; + sge_destroy_all_objects(); + + clutter_actor_destroy_all_children (g_gameboard); + clutter_actor_destroy (g_gameboard); + for (i = 0; i < gi_nb_pixbufs; i++) g_object_unref (g_pixbufs[i]); g_free (g_pixbufs); -} - -void -sge_pause_timeline() { - clutter_timeline_pause (timeline); -} -void -sge_start_timeline() { - clutter_timeline_start (timeline); } // creation/destruction @@ -811,17 +880,19 @@ clutter_actor_set_reactive (g_gameboard, TRUE); g_signal_connect (g_gameboard, "button-press-event", - G_CALLBACK (on_board_clicked), + G_CALLBACK (board_input_event), NULL); g_signal_connect (g_gameboard, "button-release-event", - G_CALLBACK (on_board_clicked), + G_CALLBACK (board_input_event), + NULL); + g_signal_connect (g_gameboard, "touch-event", + G_CALLBACK (board_input_event), NULL); // Layers create. for (i = 0; i < 5; i++) { g_actor_layers[i] = clutter_actor_new(); - clutter_actor_set_name(g_actor_layers[i], g_strdup_printf ("Level %d\n", i)); clutter_actor_set_easing_mode(g_actor_layers[i], CLUTTER_LINEAR); clutter_actor_set_easing_duration (g_actor_layers[i], 200); clutter_actor_set_position(g_actor_layers[i], 0, 0); @@ -835,11 +906,4 @@ clutter_actor_show (g_actor_layers[i]); } - - /* Create a timeline to manage animation */ - timeline = clutter_timeline_new (CLUTTER_TIMELINE_DURATION); - clutter_timeline_set_repeat_count (timeline, -1); - - /* fire a callback for frame change */ - g_signal_connect (timeline, "new-frame", G_CALLBACK (sge_clutter_frame_cb), NULL); } diff -Nru gweled-1.0~alpha/src/sge_core.h gweled-1.0~beta1/src/sge_core.h --- gweled-1.0~alpha/src/sge_core.h 2023-11-09 19:35:11.000000000 +0000 +++ gweled-1.0~beta1/src/sge_core.h 2024-03-29 15:32:30.000000000 +0000 @@ -32,6 +32,13 @@ TEXT_LAYER } T_SGELayer; +typedef enum e_sge_effect +{ + NONE, + BLINK, + BOUNCE, +} T_SGEEffect; + typedef uint32_t T_SGEColor; typedef struct s_sge_text_data @@ -58,9 +65,13 @@ gint height; T_SGELayer layer; - gboolean blink; - gboolean bounce; - gboolean animation_status; + gboolean animating; + gulong animating_handler_id; + + T_SGEEffect effect; + guint effect_handler_id; + gboolean effect_status; + gint pixbuf_id; T_SGETextData *text_data; @@ -89,8 +100,8 @@ void sge_destroy_all_objects(void); void sge_object_move_to(T_SGEObject *object, gint dest_x, gint dest_y); -void sge_object_fall_to(T_SGEObject *object, gint dest_y); -void sge_object_fall_to_with_delay (T_SGEObject * object, gint y_pos, gint delay); +void sge_object_fall_to (T_SGEObject * object, gint y_pos, gint delay, gint speed); +void sge_object_fall_to_with_effect (T_SGEObject * object, gint y_pos, gint delay); gboolean sge_object_is_moving(T_SGEObject *object); gboolean sge_objects_are_moving_on_layer(T_SGELayer layer); @@ -98,8 +109,9 @@ void sge_set_layer_visibility (T_SGELayer layer, gboolean visibility); void sge_set_layer_opacity (T_SGELayer layer, guint8 opacity); -void sge_object_fadeout (T_SGEObject *object, guint delay_secs); +void sge_object_fadeout (T_SGEObject *object, guint delay_secs, guint duration); void sge_object_zoomout (T_SGEObject *object); +void sge_gem_destroy (T_SGEObject *object); void sge_object_fly_away (T_SGEObject *object); @@ -122,10 +134,4 @@ T_SGEObject * sge_create_score_text_object (gint x, gint y, T_SGELayer layer, T_SGETextData *text_data); -void -sge_start_timeline(); - -void -sge_pause_timeline(); - #endif