diff --git a/Makefile b/Makefile index 37a907b6d..0651cb05c 100644 --- a/Makefile +++ b/Makefile @@ -4,7 +4,7 @@ # Various contributors (see AUTHORS.txt) # http://www.tuxpaint.org/ -# June 14, 2002 - August 14, 2021 +# June 14, 2002 - September 6, 2021 # The version number, for release: @@ -285,6 +285,7 @@ CURSOR_SHAPES:=LARGE SDL_LIBS:=$(shell $(PKG_CONFIG) $(SDL_PCNAME) --libs) SDL_LIBS+=$(call linktest,SDL_image,-lSDL_image,$(SDL_LIBS)) SDL_LIBS+=$(call linktest,SDL_ttf,-lSDL_ttf,$(SDL_LIBS)) +SDL_LIBS+=$(call linktest,SDL_gfx,-lSDL_gfx,$(SDL_LIBS)) SDL_LIBS+=$(call linktest,zlib,-lz,) SDL_LIBS+=$(call linktest,libpng,$(PNG),) @@ -965,6 +966,7 @@ install-dlls: cp $(MINGW_DIR)/bin/libpng12.dll $(BIN_PREFIX); \ cp $(MINGW_DIR)/bin/SDL.dll $(BIN_PREFIX); \ cp $(MINGW_DIR)/bin/SDL_image.dll $(BIN_PREFIX); \ + cp $(MINGW_DIR)/bin/SDL_gfx.dll $(BIN_PREFIX); \ cp $(MINGW_DIR)/bin/SDL_mixer.dll $(BIN_PREFIX); \ cp $(MINGW_DIR)/bin/SDL_ttf.dll $(BIN_PREFIX); \ cp $(MINGW_DIR)/bin/libfreetype-6.dll $(BIN_PREFIX); \ @@ -1352,6 +1354,7 @@ obj: MAGIC_SDL_CPPFLAGS:=$(shell $(PKG_CONFIG) $(SDL_PCNAME) --cflags) +# FIXME: Expose SDL_rotozoom to Magic API? -bjk 2021.09.06 windows_MAGIC_SDL_LIBS:=-L/usr/local/lib $(LIBMINGW) $(shell $(PKG_CONFIG) $(SDL_PCNAME) --libs) -lSDL_image -lSDL_ttf $(SDL_MIXER_LIB) macos_MAGIC_SDL_LIBS:=-L/usr/local/lib $(shell $(PKG_CONFIG) $(SDL_PCNAME) --libs) -lSDL_image -lSDL_ttf $(SDL_MIXER_LIB) ios_MAGIC_SDL_LIBS:=$(shell $(PKG_CONFIG) $(SDL_PCNAME) --libs) -lSDL_image -lSDL_ttf $(SDL_MIXER_LIB) diff --git a/data/brushes/arrow.dat b/data/brushes/arrow.dat new file mode 100644 index 000000000..fa3c03552 --- /dev/null +++ b/data/brushes/arrow.dat @@ -0,0 +1,2 @@ +rotate +spacing=60 diff --git a/data/brushes/arrow.png b/data/brushes/arrow.png new file mode 100644 index 000000000..93f75aaa0 Binary files /dev/null and b/data/brushes/arrow.png differ diff --git a/data/brushes/arrow_compass_points.dat b/data/brushes/arrow_compass_points.dat deleted file mode 100644 index b203f3288..000000000 --- a/data/brushes/arrow_compass_points.dat +++ /dev/null @@ -1,2 +0,0 @@ -directional -spacing=80 diff --git a/data/brushes/arrow_compass_points.png b/data/brushes/arrow_compass_points.png deleted file mode 100644 index 69a9e0c80..000000000 Binary files a/data/brushes/arrow_compass_points.png and /dev/null differ diff --git a/docs/CHANGES.txt b/docs/CHANGES.txt index 4c8b2289b..82572e8af 100644 --- a/docs/CHANGES.txt +++ b/docs/CHANGES.txt @@ -33,6 +33,23 @@ $Id$ * Other Improvements: ------------------- + * WIP Rotational brushes now supported. Unlike "directional" + brushes, in which a 3x3 grid representing the 8 cardinal + directions (45 degree steps) is used, only a single brush image + is required, and Tux Paint will rotate it between 0 and 360 degrees, + depending on the direction the mouse is going. The brush's ".dat" + file should contain a line consisting of the word "rotate". + * FIXME: WIP -- Doesn't handle animated brushes correctly! + * Note: This adds a dependency on "SDL_gfx" library + (Homepage: https://www.ferzkopp.net/wordpress/2016/01/02/sdl_gfx-sdl2_gfx/ + SourceForge project page: https://sourceforge.net/projects/sdlgfx/) + as this feature use it's "rotozoom" functionality. + (Closes https://sourceforge.net/p/tuxpaint/feature-requests/122/) + + * Replaced the "arrow_compass_points" brush with a single + arrow which can rotate at any angle, using the new + "rotational" brush feature. + * Small icons appear on brush selection buttons denoting when the brush is animated and/or directional. (Closes https://sourceforge.net/p/tuxpaint/bugs/183/) diff --git a/docs/en/EXTENDING.txt b/docs/en/EXTENDING.txt index 3ac8075d2..b24d64c5c 100644 --- a/docs/en/EXTENDING.txt +++ b/docs/en/EXTENDING.txt @@ -5,7 +5,7 @@ Copyright © 2002-2021 by various contributors; see AUTHORS. http://www.tuxpaint.org/ - May 31, 2021 + September 6, 2021 ---------------------------------------------------------------------- @@ -212,17 +212,26 @@ Brushes Add a line containing the word "directional" to the brush's data file. - Animated Directional Brushes + Rotating Brushes - You may mix both animated and directional features into one brush. - Use both options ("frames=N" and "directional"), in separate lines - in the brush's ".dat" file. + As of Tux Paint version 0.9.27, you may now create rotating brushes. + As the brush is used, it is rotated 360 degrees, depending on the + direction the brush is going. - Lay the brush out so that each 3x3 set of directional shapes are - laid out across a wide PNG image. For example, if the brush is 30x30 - and there are 5 frames, it would be 450x90. (The leftmost 150x90 - pixels of the image represent the 9 direction shapes for the first - frame, for example.) + Add a line containing the word "rotate" to the brush's data file. + + Animated Directional or Rotating Brushes + + You may mix both animated and either directional or rotating + features into one brush. Use both options desired ("frames=N" and + "directional" or "rotate"), in separate lines in the brush's ".dat" + file. + + For directional brushes, lay the brush out so that each 3x3 set of + directional shapes are laid out across a wide PNG image. For + example, if the brush is 30x30 and there are 5 frames, it would be + 450x90. (The leftmost 150x90 pixels of the image represent the 9 + direction shapes for the first frame, for example.) Place the brush image PNGs (and any data text files) in the "brushes" directory. diff --git a/docs/en/INSTALL.txt b/docs/en/INSTALL.txt index 9c1009fb9..1a7a74043 100644 --- a/docs/en/INSTALL.txt +++ b/docs/en/INSTALL.txt @@ -37,9 +37,10 @@ Requirements Lesser General Public License (LGPL). Along with libSDL, Tux Paint depends on a number of other SDL 'helper' - libraries: SDL_Image (for graphics files), SDL_TTF and (optionally) - SDL_Pango (for True Type Font support) and, optionally, SDL_Mixer (for - sound effects). + libraries: SDL_Image (for graphics files), SDL_gfx (for some graphical + functions, like rotation), SDL_TTF and (optionally) SDL_Pango (for + True Type Font support) and, optionally, SDL_Mixer (for sound + effects). Linux/Unix Users: @@ -49,6 +50,9 @@ Requirements * libSDL: http://www.libsdl.org/ * SDL_Image: http://www.libsdl.org/projects/SDL_image/ + * SDL_gfx: + https://www.ferzkopp.net/wordpress/2016/01/02/sdl_gfx-sdl2_gfx/ + (https://sourceforge.net/projects/sdlgfx/) * SDL_TTF: http://www.libsdl.org/projects/SDL_ttf/ * SDL_Pango: http://sourceforge.net/projects/sdlpango/ (optional) * SDL_Mixer: http://www.libsdl.org/projects/SDL_mixer/ (optional) diff --git a/docs/en/html/EXTENDING.html b/docs/en/html/EXTENDING.html index 9870aabe5..05a8da31d 100644 --- a/docs/en/html/EXTENDING.html +++ b/docs/en/html/EXTENDING.html @@ -26,7 +26,7 @@
- May 31, 2021
+ September 6, 2021+ +- You may mix both animated and directional features into one brush. Use both options ("
+ As of Tux Paint version 0.9.27, you may now create rotating brushes. As the brush is used, it is rotated 360 degrees, depending on the direction the brush is going.frames=N" and "directional"), in separate lines in the brush's ".dat" file.- Lay the brush out so that each 3x3 set of directional shapes are laid out across a wide PNG image. For example, if the brush is 30x30 and there are 5 frames, it would be 450x90. (The leftmost 150x90 pixels of the image represent the 9 direction shapes for the first frame, for example.)
+ Add a line containing the word "rotate" to the brush's data file. +
+diff --git a/docs/en/html/INSTALL.html b/docs/en/html/INSTALL.html index 80ecae469..a23df8649 100644 --- a/docs/en/html/INSTALL.html +++ b/docs/en/html/INSTALL.html @@ -107,7 +107,7 @@ Tux Paint requires the Simple DirectMedia Layer Library (libSDL), an Open Source multimedia programming library available under the GNU Lesser General Public License (LGPL).+ You may mix both animated and either directional or rotating features into one brush. Use both options desired ("
+ +frames=N" and "directional" or "rotate"), in separate lines in the brush's ".dat" file.+ For directional brushes, lay the brush out so that each 3x3 set of directional shapes are laid out across a wide PNG image. For example, if the brush is 30x30 and there are 5 frames, it would be 450x90. (The leftmost 150x90 pixels of the image represent the 9 direction shapes for the first frame, for example.)
- Along with libSDL, Tux Paint depends on a number of other SDL 'helper' libraries: SDL_Image (for graphics files), SDL_TTF and (optionally) SDL_Pango (for True Type Font support) and, optionally, SDL_Mixer (for sound effects).
+ Along with libSDL, Tux Paint depends on a number of other SDL 'helper' libraries: SDL_Image (for graphics files), SDL_gfx (for some graphical functions, like rotation), SDL_TTF and (optionally) SDL_Pango (for True Type Font support) and, optionally, SDL_Mixer (for sound effects).@@ -116,6 +116,7 @@diff --git a/docs/es_ES.UTF-8/html/INSTALL.html b/docs/es_ES.UTF-8/html/INSTALL.html index 2b2364943..41542e46d 100644 --- a/docs/es_ES.UTF-8/html/INSTALL.html +++ b/docs/es_ES.UTF-8/html/INSTALL.html @@ -107,7 +107,7 @@ Tux Paint requires the Simple DirectMedia Layer Library (libSDL), an Open Source multimedia programming library available under the GNU Lesser General Public License (LGPL).
- libSDL: http://www.libsdl.org/
- SDL_Image: http://www.libsdl.org/projects/SDL_image/
+- SDL_gfx: https://www.ferzkopp.net/wordpress/2016/01/02/sdl_gfx-sdl2_gfx/ (https://sourceforge.net/projects/sdlgfx/)
- SDL_TTF: http://www.libsdl.org/projects/SDL_ttf/
- SDL_Pango: http://sourceforge.net/projects/sdlpango/ (optional)
- SDL_Mixer: http://www.libsdl.org/projects/SDL_mixer/ (optional)
diff --git a/docs/es_ES.UTF-8/EXTENDING.txt b/docs/es_ES.UTF-8/EXTENDING.txt index a5168c503..5ac7c7817 100644 --- a/docs/es_ES.UTF-8/EXTENDING.txt +++ b/docs/es_ES.UTF-8/EXTENDING.txt @@ -5,7 +5,7 @@ Copyright © 2002-2021 by various contributors; see AUTHORS. http://www.tuxpaint.org/ - mayo 31, 2021 + septiembre 6, 2021 ---------------------------------------------------------------------- @@ -212,17 +212,26 @@ Brushes Add a line containing the word "directional" to the brush's data file. - Animated Directional Brushes + Rotating Brushes - You may mix both animated and directional features into one brush. - Use both options ("frames=N" and "directional"), in separate lines - in the brush's ".dat" file. + As of Tux Paint version 0.9.27, you may now create rotating brushes. + As the brush is used, it is rotated 360 degrees, depending on the + direction the brush is going. - Lay the brush out so that each 3x3 set of directional shapes are - laid out across a wide PNG image. For example, if the brush is 30x30 - and there are 5 frames, it would be 450x90. (The leftmost 150x90 - pixels of the image represent the 9 direction shapes for the first - frame, for example.) + Add a line containing the word "rotate" to the brush's data file. + + Animated Directional or Rotating Brushes + + You may mix both animated and either directional or rotating + features into one brush. Use both options desired ("frames=N" and + "directional" or "rotate"), in separate lines in the brush's ".dat" + file. + + For directional brushes, lay the brush out so that each 3x3 set of + directional shapes are laid out across a wide PNG image. For + example, if the brush is 30x30 and there are 5 frames, it would be + 450x90. (The leftmost 150x90 pixels of the image represent the 9 + direction shapes for the first frame, for example.) Place the brush image PNGs (and any data text files) in the "brushes" directory. diff --git a/docs/es_ES.UTF-8/INSTALL.txt b/docs/es_ES.UTF-8/INSTALL.txt index 91c81f301..e65bc8c9a 100644 --- a/docs/es_ES.UTF-8/INSTALL.txt +++ b/docs/es_ES.UTF-8/INSTALL.txt @@ -37,9 +37,10 @@ Requirements Lesser General Public License (LGPL). Along with libSDL, Tux Paint depends on a number of other SDL 'helper' - libraries: SDL_Image (for graphics files), SDL_TTF and (optionally) - SDL_Pango (for True Type Font support) and, optionally, SDL_Mixer (for - sound effects). + libraries: SDL_Image (for graphics files), SDL_gfx (for some graphical + functions, like rotation), SDL_TTF and (optionally) SDL_Pango (for + True Type Font support) and, optionally, SDL_Mixer (for sound + effects). Linux/Unix Users: @@ -49,6 +50,9 @@ Requirements * libSDL: http://www.libsdl.org/ * SDL_Image: http://www.libsdl.org/projects/SDL_image/ + * SDL_gfx: + https://www.ferzkopp.net/wordpress/2016/01/02/sdl_gfx-sdl2_gfx/ + (https://sourceforge.net/projects/sdlgfx/) * SDL_TTF: http://www.libsdl.org/projects/SDL_ttf/ * SDL_Pango: http://sourceforge.net/projects/sdlpango/ (optional) * SDL_Mixer: http://www.libsdl.org/projects/SDL_mixer/ (optional) diff --git a/docs/es_ES.UTF-8/html/EXTENDING.html b/docs/es_ES.UTF-8/html/EXTENDING.html index 2533fd4be..2ffe8ffcc 100644 --- a/docs/es_ES.UTF-8/html/EXTENDING.html +++ b/docs/es_ES.UTF-8/html/EXTENDING.html @@ -26,7 +26,7 @@- mayo 31, 2021
+ septiembre 6, 2021
- Animated Directional Brushes
+ Rotating Brushes+ +- You may mix both animated and directional features into one brush. Use both options ("
+ As of Tux Paint version 0.9.27, you may now create rotating brushes. As the brush is used, it is rotated 360 degrees, depending on the direction the brush is going.frames=N" and "directional"), in separate lines in the brush's ".dat" file.- Lay the brush out so that each 3x3 set of directional shapes are laid out across a wide PNG image. For example, if the brush is 30x30 and there are 5 frames, it would be 450x90. (The leftmost 150x90 pixels of the image represent the 9 direction shapes for the first frame, for example.)
+ Add a line containing the word "rotate" to the brush's data file. ++ Animated Directional or Rotating Brushes
+ +++ You may mix both animated and either directional or rotating features into one brush. Use both options desired ("
+ +frames=N" and "directional" or "rotate"), in separate lines in the brush's ".dat" file.+ For directional brushes, lay the brush out so that each 3x3 set of directional shapes are laid out across a wide PNG image. For example, if the brush is 30x30 and there are 5 frames, it would be 450x90. (The leftmost 150x90 pixels of the image represent the 9 direction shapes for the first frame, for example.)
- Along with libSDL, Tux Paint depends on a number of other SDL 'helper' libraries: SDL_Image (for graphics files), SDL_TTF and (optionally) SDL_Pango (for True Type Font support) and, optionally, SDL_Mixer (for sound effects).
+ Along with libSDL, Tux Paint depends on a number of other SDL 'helper' libraries: SDL_Image (for graphics files), SDL_gfx (for some graphical functions, like rotation), SDL_TTF and (optionally) SDL_Pango (for True Type Font support) and, optionally, SDL_Mixer (for sound effects).@@ -116,6 +116,7 @@diff --git a/docs/fr_FR.UTF-8/html/INSTALL.html b/docs/fr_FR.UTF-8/html/INSTALL.html index e0126021d..b355a7a79 100644 --- a/docs/fr_FR.UTF-8/html/INSTALL.html +++ b/docs/fr_FR.UTF-8/html/INSTALL.html @@ -107,7 +107,7 @@ Tux Paint nécessite la bibliothèque de couches DirectMedia simple (libSDL), une bibliothèque de programmation multimédia Open Source disponible sous la Licence publique générale limitée GNU (LGPL).
- libSDL: http://www.libsdl.org/
- SDL_Image: http://www.libsdl.org/projects/SDL_image/
+- SDL_gfx: https://www.ferzkopp.net/wordpress/2016/01/02/sdl_gfx-sdl2_gfx/ (https://sourceforge.net/projects/sdlgfx/)
- SDL_TTF: http://www.libsdl.org/projects/SDL_ttf/
- SDL_Pango: http://sourceforge.net/projects/sdlpango/ (optional)
- SDL_Mixer: http://www.libsdl.org/projects/SDL_mixer/ (optional)
diff --git a/docs/fr_FR.UTF-8/EXTENDING.txt b/docs/fr_FR.UTF-8/EXTENDING.txt index b842624f2..964bbac74 100644 --- a/docs/fr_FR.UTF-8/EXTENDING.txt +++ b/docs/fr_FR.UTF-8/EXTENDING.txt @@ -5,7 +5,7 @@ Copyright &copie; 2002-2021 par divers contributeurs; voir AUTHORS. http://www.tuxpaint.org/ - mai 31, 2021 + septembre 6, 2021 ---------------------------------------------------------------------- @@ -230,17 +230,27 @@ Pinceaux Ajoute une ligne contenant le mot "directional" au fichier de données brosse. - Pinceaux animés orientables + Rotating Brushes - Vous pouvez mélanger animation et orientation dans un même pinceau. - Utilisez les deux options ("frames=N" et "directional") en deux - lignes séparées dans le fichier ".dat" qui concerne le pinceau. + As of Tux Paint version 0.9.27, you may now create rotating brushes. + As the brush is used, it is rotated 360 degrees, depending on the + direction the brush is going. - Disposez le pinceau de manière à ce que chaque ensemble 3x3 de - formes orientables soit disposé sur une grande image PNG. Par - exemple, si le pinceau mesure 30x30 et qu'il y a 5 cadres, ce sera - 450x90. (Les 150x90 pixels les plus à gauche de l'image représentent - les 9 formes de direction pour la première image, par exemple). + Ajoute une ligne contenant le mot "rotate" au fichier de données + brosse. + + Animated Directional or Rotating Brushes + + You may mix both animated and either directional or rotating + features into one brush. Use both options desired ("frames=N" and + "directional" or "rotate"), in separate lines in the brush's ".dat" + file. + + For directional brushes, lay the brush out so that each 3x3 set of + directional shapes are laid out across a wide PNG image. For + example, if the brush is 30x30 and there are 5 frames, it would be + 450x90. (The leftmost 150x90 pixels of the image represent the 9 + direction shapes for the first frame, for example.) Placez les PNG de l'image du pinceau (et tous les fichiers texte de données) dans le répertoire "brushes". diff --git a/docs/fr_FR.UTF-8/INSTALL.txt b/docs/fr_FR.UTF-8/INSTALL.txt index 7245bb5e6..607843c95 100644 --- a/docs/fr_FR.UTF-8/INSTALL.txt +++ b/docs/fr_FR.UTF-8/INSTALL.txt @@ -36,10 +36,11 @@ Exigences (libSDL), une bibliothèque de programmation multimédia Open Source disponible sous la Licence publique générale limitée GNU (LGPL). - Avec libSDL, Tux Paint dépend d'un certain nombre d'autres - bibliothèques SDL : SDL_Image (pour les fichiers graphiques), SDL_TTF - et (en option) SDL_Pango (pour la prise en charge des polices True - Type) et, éventuellement, SDL_Mixer (pour les effets sonores). + Along with libSDL, Tux Paint depends on a number of other SDL 'helper' + libraries: SDL_Image (for graphics files), SDL_gfx (for some graphical + functions, like rotation), SDL_TTF and (optionally) SDL_Pango (for + True Type Font support) and, optionally, SDL_Mixer (for sound + effects). Utilisateurs de Linux/Unix : @@ -49,6 +50,9 @@ Exigences * libSDL: http://www.libsdl.org/ * SDL_Image: http://www.libsdl.org/projects/SDL_image/ + * SDL_gfx: + https://www.ferzkopp.net/wordpress/2016/01/02/sdl_gfx-sdl2_gfx/ + (https://sourceforge.net/projects/sdlgfx/) * SDL_TTF: http://www.libsdl.org/projects/SDL_ttf/ * SDL_Pango: http://sourceforge.net/projects/sdlpango/ (optionnel) * SDL_Mixer: http://www.libsdl.org/projects/SDL_mixer/ (optionnel) diff --git a/docs/fr_FR.UTF-8/html/EXTENDING.html b/docs/fr_FR.UTF-8/html/EXTENDING.html index 5a08a324f..64cbb6085 100644 --- a/docs/fr_FR.UTF-8/html/EXTENDING.html +++ b/docs/fr_FR.UTF-8/html/EXTENDING.html @@ -26,7 +26,7 @@- mai 31, 2021
+ septembre 6, 2021
- Pinceaux animés orientables
+ Rotating Brushes+ +- Vous pouvez mélanger animation et orientation dans un même pinceau. Utilisez les deux options ("
+ As of Tux Paint version 0.9.27, you may now create rotating brushes. As the brush is used, it is rotated 360 degrees, depending on the direction the brush is going.frames=N" et "directional") en deux lignes séparées dans le fichier ".dat" qui concerne le pinceau.- Disposez le pinceau de manière à ce que chaque ensemble 3x3 de formes orientables soit disposé sur une grande image PNG. Par exemple, si le pinceau mesure 30x30 et qu'il y a 5 cadres, ce sera 450x90. (Les 150x90 pixels les plus à gauche de l'image représentent les 9 formes de direction pour la première image, par exemple).
+ Ajoute une ligne contenant le mot "rotate" au fichier de données brosse. ++ Animated Directional or Rotating Brushes
+ +++ You may mix both animated and either directional or rotating features into one brush. Use both options desired ("
+ +frames=N" and "directional" or "rotate"), in separate lines in the brush's ".dat" file.+ For directional brushes, lay the brush out so that each 3x3 set of directional shapes are laid out across a wide PNG image. For example, if the brush is 30x30 and there are 5 frames, it would be 450x90. (The leftmost 150x90 pixels of the image represent the 9 direction shapes for the first frame, for example.)
- Avec libSDL, Tux Paint dépend d'un certain nombre d'autres bibliothèques SDL : SDL_Image (pour les fichiers graphiques), SDL_TTF et (en option) SDL_Pango (pour la prise en charge des polices True Type) et, éventuellement, SDL_Mixer (pour les effets sonores).
+ Along with libSDL, Tux Paint depends on a number of other SDL 'helper' libraries: SDL_Image (for graphics files), SDL_gfx (for some graphical functions, like rotation), SDL_TTF and (optionally) SDL_Pango (for True Type Font support) and, optionally, SDL_Mixer (for sound effects).@@ -116,6 +116,7 @@diff --git a/docs/gl_ES.UTF-8/html/INSTALL.html b/docs/gl_ES.UTF-8/html/INSTALL.html index 2884936af..9e9ab5e1f 100644 --- a/docs/gl_ES.UTF-8/html/INSTALL.html +++ b/docs/gl_ES.UTF-8/html/INSTALL.html @@ -107,7 +107,7 @@ Tux Paint require a «Simple DirectMedia Layer Library (libSDL)», unha biblioteca de programación multimedia de código aberto dispoñíbel baixo a licenza pública GNU Lesser General Public License (LGPL).
- libSDL: http://www.libsdl.org/
- SDL_Image: http://www.libsdl.org/projects/SDL_image/
+- SDL_gfx: https://www.ferzkopp.net/wordpress/2016/01/02/sdl_gfx-sdl2_gfx/ (https://sourceforge.net/projects/sdlgfx/)
- SDL_TTF: http://www.libsdl.org/projects/SDL_ttf/
- SDL_Pango: http://sourceforge.net/projects/sdlpango/ (optionnel)
- SDL_Mixer: http://www.libsdl.org/projects/SDL_mixer/ (optionnel)
diff --git a/docs/gl_ES.UTF-8/EXTENDING.txt b/docs/gl_ES.UTF-8/EXTENDING.txt index ecfd8fbb1..6ccb974c6 100644 --- a/docs/gl_ES.UTF-8/EXTENDING.txt +++ b/docs/gl_ES.UTF-8/EXTENDING.txt @@ -5,7 +5,7 @@ Copyright © 2002-2021 por varios colaboradores; vexa AUTHORS (AUTORES). http://www.tuxpaint.org/ - 31 de Maio de 2021 + 6 de Setembro de 2021 ---------------------------------------------------------------------- @@ -221,17 +221,27 @@ Pinceis Engada unha liña que conteña a palabra «directional» ao ficheiro de datos debrush's. - Pinceis direccionais animados + Rotating Brushes - Pode mesturar funcións animadas e direccionais nun pincel. Use ambas - as opcións («frames=N» e «directional»), en liñas separadas no - ficheiro «.dat» do pincel. + As of Tux Paint version 0.9.27, you may now create rotating brushes. + As the brush is used, it is rotated 360 degrees, depending on the + direction the brush is going. - Coloque o pincel de xeito que cada conxunto de formas 3x3 de - dirección estea distribuído nunha ampla imaxe PNG. Por exemplo, se o - pincel ten 30x30 e hai 5 fotogramas, sería de 450x90. (Os píxeles - máis a esquerda de 150x90 da imaxe representan as 9 formas de - dirección do primeiro cadro, por exemplo). + Engada unha liña que conteña a palabra «rotate» ao ficheiro de datos + debrush's. + + Animated Directional or Rotating Brushes + + You may mix both animated and either directional or rotating + features into one brush. Use both options desired ("frames=N" and + "directional" or "rotate"), in separate lines in the brush's ".dat" + file. + + For directional brushes, lay the brush out so that each 3x3 set of + directional shapes are laid out across a wide PNG image. For + example, if the brush is 30x30 and there are 5 frames, it would be + 450x90. (The leftmost 150x90 pixels of the image represent the 9 + direction shapes for the first frame, for example.) Coloque os ficheiros PNG de pincel (e calquera ficheiro de texto de datos) no directorio «brushes». diff --git a/docs/gl_ES.UTF-8/INSTALL.txt b/docs/gl_ES.UTF-8/INSTALL.txt index 51f54ba18..a02cb5dda 100644 --- a/docs/gl_ES.UTF-8/INSTALL.txt +++ b/docs/gl_ES.UTF-8/INSTALL.txt @@ -36,10 +36,11 @@ Requirements biblioteca de programación multimedia de código aberto dispoñíbel baixo a licenza pública GNU Lesser General Public License (LGPL). - Xunto con libSDL, Tux Paint depende doutras bibliotecas «de axuda» de - SDL: SDL_Image (para ficheiros gráficos), SDL_TTF e (opcionalmente) - SDL_Pango (para compatibilidade de tipo True Type) e, opcionalmente, - SDL_Mixer (para efectos de son). + Along with libSDL, Tux Paint depends on a number of other SDL 'helper' + libraries: SDL_Image (for graphics files), SDL_gfx (for some graphical + functions, like rotation), SDL_TTF and (optionally) SDL_Pango (for + True Type Font support) and, optionally, SDL_Mixer (for sound + effects). Usuarios de Linux/Unix: @@ -49,6 +50,9 @@ Requirements * libSDL: http://www.libsdl.org/ * SDL_Image: http://www.libsdl.org/projects/SDL_image/ + * SDL_gfx: + https://www.ferzkopp.net/wordpress/2016/01/02/sdl_gfx-sdl2_gfx/ + (https://sourceforge.net/projects/sdlgfx/) * SDL_TTF: http://www.libsdl.org/projects/SDL_ttf/ * SDL_Pango: http://sourceforge.net/projects/sdlpango/ (opcional) * SDL_Mixer: http://www.libsdl.org/projects/SDL_mixer/ (opcional) diff --git a/docs/gl_ES.UTF-8/html/EXTENDING.html b/docs/gl_ES.UTF-8/html/EXTENDING.html index fe15c606c..2fd21e8c3 100644 --- a/docs/gl_ES.UTF-8/html/EXTENDING.html +++ b/docs/gl_ES.UTF-8/html/EXTENDING.html @@ -26,7 +26,7 @@- 31 de Maio de 2021
+ 6 de Setembro de 2021
- Pinceis direccionais animados
+ Rotating Brushes+ +- Pode mesturar funcións animadas e direccionais nun pincel. Use ambas as opcións («
+ As of Tux Paint version 0.9.27, you may now create rotating brushes. As the brush is used, it is rotated 360 degrees, depending on the direction the brush is going.frames=N» e «directional»), en liñas separadas no ficheiro «.dat» do pincel.- Coloque o pincel de xeito que cada conxunto de formas 3x3 de dirección estea distribuído nunha ampla imaxe PNG. Por exemplo, se o pincel ten 30x30 e hai 5 fotogramas, sería de 450x90. (Os píxeles máis a esquerda de 150x90 da imaxe representan as 9 formas de dirección do primeiro cadro, por exemplo).
+ Engada unha liña que conteña a palabra «rotate» ao ficheiro de datos debrush's. ++ Animated Directional or Rotating Brushes
+ +++ You may mix both animated and either directional or rotating features into one brush. Use both options desired ("
+ +frames=N" and "directional" or "rotate"), in separate lines in the brush's ".dat" file.+ For directional brushes, lay the brush out so that each 3x3 set of directional shapes are laid out across a wide PNG image. For example, if the brush is 30x30 and there are 5 frames, it would be 450x90. (The leftmost 150x90 pixels of the image represent the 9 direction shapes for the first frame, for example.)
- Xunto con libSDL, Tux Paint depende doutras bibliotecas «de axuda» de SDL: SDL_Image (para ficheiros gráficos), SDL_TTF e (opcionalmente) SDL_Pango (para compatibilidade de tipo True Type) e, opcionalmente, SDL_Mixer (para efectos de son).
+ Along with libSDL, Tux Paint depends on a number of other SDL 'helper' libraries: SDL_Image (for graphics files), SDL_gfx (for some graphical functions, like rotation), SDL_TTF and (optionally) SDL_Pango (for True Type Font support) and, optionally, SDL_Mixer (for sound effects).@@ -116,6 +116,7 @@diff --git a/docs/ja_JP.UTF-8/html/INSTALL.html b/docs/ja_JP.UTF-8/html/INSTALL.html index 052b61897..927ef28b4 100644 --- a/docs/ja_JP.UTF-8/html/INSTALL.html +++ b/docs/ja_JP.UTF-8/html/INSTALL.html @@ -107,7 +107,7 @@ Tux Paint requires the Simple DirectMedia Layer Library (libSDL), an Open Source multimedia programming library available under the GNU Lesser General Public License (LGPL).
- libSDL: http://www.libsdl.org/
- SDL_Image: http://www.libsdl.org/projects/SDL_image/
+- SDL_gfx: https://www.ferzkopp.net/wordpress/2016/01/02/sdl_gfx-sdl2_gfx/ (https://sourceforge.net/projects/sdlgfx/)
- SDL_TTF: http://www.libsdl.org/projects/SDL_ttf/
- SDL_Pango: http://sourceforge.net/projects/sdlpango/ (opcional)
- SDL_Mixer: http://www.libsdl.org/projects/SDL_mixer/ (opcional)
diff --git a/docs/ja_JP.UTF-8/EXTENDING.txt b/docs/ja_JP.UTF-8/EXTENDING.txt index 1f4cccb04..42ef4b29e 100644 --- a/docs/ja_JP.UTF-8/EXTENDING.txt +++ b/docs/ja_JP.UTF-8/EXTENDING.txt @@ -5,7 +5,7 @@ Copyright © 2002-2021 by various contributors; "AUTHORS" 参照. http://www.tuxpaint.org/ - 2021年5月31日 + 2021年9月 6日 ---------------------------------------------------------------------- @@ -212,17 +212,26 @@ Brushes Add a line containing the word "directional" to the brush's data file. - Animated Directional Brushes + Rotating Brushes - You may mix both animated and directional features into one brush. - Use both options ("frames=N" and "directional"), in separate lines - in the brush's ".dat" file. + As of Tux Paint version 0.9.27, you may now create rotating brushes. + As the brush is used, it is rotated 360 degrees, depending on the + direction the brush is going. - Lay the brush out so that each 3x3 set of directional shapes are - laid out across a wide PNG image. For example, if the brush is 30x30 - and there are 5 frames, it would be 450x90. (The leftmost 150x90 - pixels of the image represent the 9 direction shapes for the first - frame, for example.) + Add a line containing the word "rotate" to the brush's data file. + + Animated Directional or Rotating Brushes + + You may mix both animated and either directional or rotating + features into one brush. Use both options desired ("frames=N" and + "directional" or "rotate"), in separate lines in the brush's ".dat" + file. + + For directional brushes, lay the brush out so that each 3x3 set of + directional shapes are laid out across a wide PNG image. For + example, if the brush is 30x30 and there are 5 frames, it would be + 450x90. (The leftmost 150x90 pixels of the image represent the 9 + direction shapes for the first frame, for example.) Place the brush image PNGs (and any data text files) in the "brushes" directory. diff --git a/docs/ja_JP.UTF-8/INSTALL.txt b/docs/ja_JP.UTF-8/INSTALL.txt index 4b82c98e0..845b4dded 100644 --- a/docs/ja_JP.UTF-8/INSTALL.txt +++ b/docs/ja_JP.UTF-8/INSTALL.txt @@ -37,9 +37,10 @@ Requirements Lesser General Public License (LGPL). Along with libSDL, Tux Paint depends on a number of other SDL 'helper' - libraries: SDL_Image (for graphics files), SDL_TTF and (optionally) - SDL_Pango (for True Type Font support) and, optionally, SDL_Mixer (for - sound effects). + libraries: SDL_Image (for graphics files), SDL_gfx (for some graphical + functions, like rotation), SDL_TTF and (optionally) SDL_Pango (for + True Type Font support) and, optionally, SDL_Mixer (for sound + effects). Linux/Unix Users: @@ -49,6 +50,9 @@ Requirements * libSDL: http://www.libsdl.org/ * SDL_Image: http://www.libsdl.org/projects/SDL_image/ + * SDL_gfx: + https://www.ferzkopp.net/wordpress/2016/01/02/sdl_gfx-sdl2_gfx/ + (https://sourceforge.net/projects/sdlgfx/) * SDL_TTF: http://www.libsdl.org/projects/SDL_ttf/ * SDL_Pango: http://sourceforge.net/projects/sdlpango/ (optional) * SDL_Mixer: http://www.libsdl.org/projects/SDL_mixer/ (optional) diff --git a/docs/ja_JP.UTF-8/html/EXTENDING.html b/docs/ja_JP.UTF-8/html/EXTENDING.html index f459a29f1..17cbfd7e2 100644 --- a/docs/ja_JP.UTF-8/html/EXTENDING.html +++ b/docs/ja_JP.UTF-8/html/EXTENDING.html @@ -26,7 +26,7 @@- 2021年5月31日
+ 2021年9月 6日
- Animated Directional Brushes
+ Rotating Brushes+ +- You may mix both animated and directional features into one brush. Use both options ("
+ As of Tux Paint version 0.9.27, you may now create rotating brushes. As the brush is used, it is rotated 360 degrees, depending on the direction the brush is going.frames=N" and "directional"), in separate lines in the brush's ".dat" file.- Lay the brush out so that each 3x3 set of directional shapes are laid out across a wide PNG image. For example, if the brush is 30x30 and there are 5 frames, it would be 450x90. (The leftmost 150x90 pixels of the image represent the 9 direction shapes for the first frame, for example.)
+ Add a line containing the word "rotate" to the brush's data file. ++ Animated Directional or Rotating Brushes
+ +++ You may mix both animated and either directional or rotating features into one brush. Use both options desired ("
+ +frames=N" and "directional" or "rotate"), in separate lines in the brush's ".dat" file.+ For directional brushes, lay the brush out so that each 3x3 set of directional shapes are laid out across a wide PNG image. For example, if the brush is 30x30 and there are 5 frames, it would be 450x90. (The leftmost 150x90 pixels of the image represent the 9 direction shapes for the first frame, for example.)
- Along with libSDL, Tux Paint depends on a number of other SDL 'helper' libraries: SDL_Image (for graphics files), SDL_TTF and (optionally) SDL_Pango (for True Type Font support) and, optionally, SDL_Mixer (for sound effects).
+ Along with libSDL, Tux Paint depends on a number of other SDL 'helper' libraries: SDL_Image (for graphics files), SDL_gfx (for some graphical functions, like rotation), SDL_TTF and (optionally) SDL_Pango (for True Type Font support) and, optionally, SDL_Mixer (for sound effects).@@ -116,6 +116,7 @@
- libSDL: http://www.libsdl.org/
- SDL_Image: http://www.libsdl.org/projects/SDL_image/
+- SDL_gfx: https://www.ferzkopp.net/wordpress/2016/01/02/sdl_gfx-sdl2_gfx/ (https://sourceforge.net/projects/sdlgfx/)
- SDL_TTF: http://www.libsdl.org/projects/SDL_ttf/
- SDL_Pango: http://sourceforge.net/projects/sdlpango/ (optional)
- SDL_Mixer: http://www.libsdl.org/projects/SDL_mixer/ (optional)
diff --git a/src/tuxpaint.c b/src/tuxpaint.c index 4ef6d5f9d..e45977c7d 100644 --- a/src/tuxpaint.c +++ b/src/tuxpaint.c @@ -402,6 +402,15 @@ static void mtw(wchar_t * wtok, char *tok) #error "---------------------------------------------------" #endif +#include "SDL_rotozoom.h" +#if !defined(_SDL_rotozoom_h) +#error "---------------------------------------------------" +#error "If you installed SDL_gfx from a package, be sure" +#error "to get the development package, as well!" +#error "(e.g., 'libsdl-gfx1.2-devel.rpm')" +#error "---------------------------------------------------" +#endif + #ifndef NO_SDLPANGO @@ -1810,6 +1819,7 @@ static SDL_Surface **img_brushes, **img_brushes_thumbs; static int *brushes_frames = NULL; static int *brushes_spacing = NULL; static short *brushes_directional = NULL; +static short *brushes_rotate = NULL; static SDL_Surface *img_shapes[NUM_SHAPES], *img_shape_names[NUM_SHAPES]; static SDL_Surface *img_fills[NUM_FILLS], *img_fill_names[NUM_FILLS]; @@ -1845,7 +1855,8 @@ enum static SDL_Surface *img_cur_brush; static int img_cur_brush_frame_w, img_cur_brush_w, img_cur_brush_h, - img_cur_brush_frames, img_cur_brush_directional, img_cur_brush_spacing; + img_cur_brush_frames, img_cur_brush_directional, img_cur_brush_rotate, + img_cur_brush_spacing; static int brush_counter, brush_frame; #define NUM_ERASERS 16 /* How many sizes of erasers @@ -1925,7 +1936,7 @@ SDL_Joystick *joystick; static void mainloop(void); static void brush_draw(int x1, int y1, int x2, int y2, int update); -static void blit_brush(int x, int y, int direction); +static void blit_brush(int x, int y, int direction, int rotation, int * w, int * h); static void stamp_draw(int x, int y); static void rec_undo_buffer(void); @@ -5845,14 +5856,23 @@ static void brush_draw(int x1, int y1, int x2, int y2, int update) direction = BRUSH_DIRECTION_NONE; - if (brushes_directional[cur_brush]) + r = 0; + if (brushes_directional[cur_brush] || brushes_rotate[cur_brush]) { - r = brush_rotation(x1, y1, x2, y2) + 22; - if (r < 0) - r = r + 360; + r = brush_rotation(x1, y1, x2, y2); - if (x1 != x2 || y1 != y2) - direction = (r / 45); + if (brushes_directional[cur_brush]) + { + r = r + 22; + if (r < 0) + r = r + 360; + if (x1 != x2 || y1 != y2) + direction = (r / 45); + } + else + { + r = 270 - r; + } } @@ -5878,12 +5898,12 @@ static void brush_draw(int x1, int y1, int x2, int y2, int update) if (y1 > y2) { for (y = y1; y >= y2; y--) - blit_brush(x1, y, direction); + blit_brush(x1, y, direction, r, &w, &h); } else { for (y = y1; y <= y2; y++) - blit_brush(x1, y, direction); + blit_brush(x1, y, direction, r, &w, &h); } x1 = x1 + dx; @@ -5899,7 +5919,7 @@ static void brush_draw(int x1, int y1, int x2, int y2, int update) } for (y = y1; y <= y2; y++) - blit_brush(x1, y, direction); + blit_brush(x1, y, direction, r, &w, &h); } if (orig_x1 > orig_x2) @@ -5944,9 +5964,10 @@ void reset_brush_counter(void) * * @param x X coordinate * @param y Y coordinate - * @param direction BRUSH_DIRECTION_... being drawn + * @param direction BRUSH_DIRECTION_... being drawn (for compass direction brushes) + * @param rotation angle being drawn (for brushes which may rotate at any angle (0-360 degrees)) */ -static void blit_brush(int x, int y, int direction) +static void blit_brush(int x, int y, int direction, int rotation, int * w, int * h) { SDL_Rect src, dest; @@ -6019,8 +6040,38 @@ static void blit_brush(int x, int y, int direction) src.w = img_cur_brush_w; src.h = img_cur_brush_h; - SDL_BlitSurface(img_cur_brush, &src, canvas, &dest); + if (img_cur_brush_rotate) + { + SDL_Surface * rotated_brush; + + /* TODO: Cache these; discard them when the user changes the brush or alters its color */ + /* FIXME: Account for src being within an animated brush! */ + rotated_brush = rotozoomSurface(img_cur_brush, rotation, 1.0, SMOOTHING_ON); + if (rotated_brush != NULL) + { + src.x = 0; + src.y = 0; + src.w = rotated_brush->w; + src.h = rotated_brush->h; + + dest.x = dest.x - (img_cur_brush_w >> 1) + (rotated_brush->w >> 1); + dest.y = dest.y - (img_cur_brush_h >> 1) + (rotated_brush->h >> 1); + dest.w = rotated_brush->w; + dest.h = rotated_brush->h; + + SDL_BlitSurface(rotated_brush, &src, canvas, &dest); + + SDL_FreeSurface(rotated_brush); + } + } + else + { + SDL_BlitSurface(img_cur_brush, &src, canvas, &dest); + } } + + *w = src.w; + *h = src.h; } @@ -6899,6 +6950,7 @@ static void loadbrush_callback(SDL_Surface * screen, img_brushes_thumbs = realloc(img_brushes_thumbs, num_brushes_max * sizeof *img_brushes_thumbs); brushes_frames = realloc(brushes_frames, num_brushes_max * sizeof(int)); brushes_directional = realloc(brushes_directional, num_brushes_max * sizeof(short)); + brushes_rotate = realloc(brushes_rotate, num_brushes_max * sizeof(short)); brushes_spacing = realloc(brushes_spacing, num_brushes_max * sizeof(int)); } img_brushes[num_brushes] = loadimage(fname); @@ -6907,6 +6959,7 @@ static void loadbrush_callback(SDL_Surface * screen, brushes_frames[num_brushes] = 1; brushes_directional[num_brushes] = 0; + brushes_rotate[num_brushes] = 0; brushes_spacing[num_brushes] = img_brushes[num_brushes]->h / 4; strcpy(strcasestr(fname, ".png"), ".dat"); /* FIXME: Use strncpy (ugh, complicated) */ @@ -6932,6 +6985,10 @@ static void loadbrush_callback(SDL_Surface * screen, { brushes_directional[num_brushes] = 1; } + else if (strstr(buf, "rotate") != NULL) + { + brushes_rotate[num_brushes] = 1; + } else if (strstr(buf, "random") != NULL) { want_rand = 1; @@ -8842,7 +8899,7 @@ static void draw_brushes(void) SDL_BlitSurface(img_brushes_thumbs[brush], &src, screen, &dest); - if (brushes_directional[brush]) + if (brushes_directional[brush] || brushes_rotate[brush]) { dest.x = ui_btn_x + button_w - img_brush_dir->w; dest.y = ui_btn_y + button_h - img_brush_dir->h; @@ -10458,6 +10515,7 @@ static void render_brush(void) img_cur_brush_h = img_cur_brush->h / (brushes_directional[cur_brush] ? 3 : 1); img_cur_brush_frames = brushes_frames[cur_brush]; img_cur_brush_directional = brushes_directional[cur_brush]; + img_cur_brush_rotate = brushes_rotate[cur_brush]; img_cur_brush_spacing = brushes_spacing[cur_brush]; brush_counter = 0; @@ -13073,6 +13131,7 @@ static void cleanup(void) free_surface_array(img_brushes_thumbs, num_brushes); free(brushes_frames); free(brushes_directional); + free(brushes_rotate); free(brushes_spacing); free_surface_array(img_tools, NUM_TOOLS); free_surface_array(img_tool_names, NUM_TOOLS);