New Magic: Double vision
WIP - needs icon & sfx
This commit is contained in:
parent
d0b9c89d4a
commit
9b9fc9c845
2 changed files with 23 additions and 6 deletions
|
|
@ -7,7 +7,7 @@ Various contributors (see below, and AUTHORS.txt)
|
||||||
https://tuxpaint.org/
|
https://tuxpaint.org/
|
||||||
|
|
||||||
|
|
||||||
2023.March.21 (0.9.29) ### RC2
|
2023.March.22 (0.9.29) ### RC2
|
||||||
* Improvements to "Stamp" tool:
|
* Improvements to "Stamp" tool:
|
||||||
-----------------------------
|
-----------------------------
|
||||||
* Stamps may now be rotated.
|
* Stamps may now be rotated.
|
||||||
|
|
@ -62,6 +62,13 @@ https://tuxpaint.org/
|
||||||
Attribution 4.0 International (CC BY 4.0)
|
Attribution 4.0 International (CC BY 4.0)
|
||||||
by https://freesound.org/people/juskiddink/)
|
by https://freesound.org/people/juskiddink/)
|
||||||
|
|
||||||
|
* [WIP] "Double Vision" - separate and blend (50/50) the image,
|
||||||
|
simulating double vision.
|
||||||
|
Bill Kendrick <bill@newbreedsoftware.com>
|
||||||
|
(Closes https://sourceforge.net/p/tuxpaint/feature-requests/221/)
|
||||||
|
+ needs icon
|
||||||
|
+ needs sound effects
|
||||||
|
|
||||||
* "Saturate" & "Desaturate" - Increase or decrease color saturation.
|
* "Saturate" & "Desaturate" - Increase or decrease color saturation.
|
||||||
Bill Kendrick <bill@newbreedsoftware.com>
|
Bill Kendrick <bill@newbreedsoftware.com>
|
||||||
(Sounds based on "can lid.wav", Creative Commons 0 (CC0 1.0)
|
(Sounds based on "can lid.wav", Creative Commons 0 (CC0 1.0)
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@
|
||||||
Color separation effect (a la red/cyan aka red/blue 3D glasses).
|
Color separation effect (a la red/cyan aka red/blue 3D glasses).
|
||||||
Bill Kendrick
|
Bill Kendrick
|
||||||
|
|
||||||
Last updated: February 22, 2023
|
Last updated: March 22, 2023
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
|
@ -18,26 +18,32 @@
|
||||||
enum {
|
enum {
|
||||||
COLORSEP_TOOL_3DGLASSES,
|
COLORSEP_TOOL_3DGLASSES,
|
||||||
COLORSEP_TOOL_COLORSEP,
|
COLORSEP_TOOL_COLORSEP,
|
||||||
|
COLORSEP_TOOL_DOUBLEVISION,
|
||||||
NUM_TOOLS
|
NUM_TOOLS
|
||||||
};
|
};
|
||||||
|
|
||||||
static char * colorsep_snd_filenames[NUM_TOOLS] = {
|
static char * colorsep_snd_filenames[NUM_TOOLS] = {
|
||||||
"3dglasses.ogg",
|
"3dglasses.ogg",
|
||||||
"colorsep.ogg"
|
"colorsep.ogg",
|
||||||
|
"colorsep.ogg" // FIXME
|
||||||
};
|
};
|
||||||
|
|
||||||
static char * colorsep_icon_filenames[NUM_TOOLS] = {
|
static char * colorsep_icon_filenames[NUM_TOOLS] = {
|
||||||
"3dglasses.png",
|
"3dglasses.png",
|
||||||
"colorsep.png"
|
"colorsep.png",
|
||||||
|
"colorsep.png" // FIXME
|
||||||
};
|
};
|
||||||
|
|
||||||
char * colorsep_names[NUM_TOOLS] = {
|
char * colorsep_names[NUM_TOOLS] = {
|
||||||
gettext_noop("3D Glasses"),
|
gettext_noop("3D Glasses"),
|
||||||
gettext_noop("Color Sep."),
|
gettext_noop("Color Sep."),
|
||||||
|
gettext_noop("Double Vision"),
|
||||||
};
|
};
|
||||||
|
|
||||||
char * colorsep_descrs[NUM_TOOLS] = {
|
char * colorsep_descrs[NUM_TOOLS] = {
|
||||||
gettext_noop("Click and drag left and right to separate your picture's red and cyan, to make anaglyphs you can view with 3D glasses!"),
|
gettext_noop("Click and drag left and right to separate your picture's red and cyan, to make anaglyphs you can view with 3D glasses!"),
|
||||||
gettext_noop("Click and drag to separate your picture's colors.")
|
gettext_noop("Click and drag to separate your picture's colors."),
|
||||||
|
gettext_noop("Click and drag to simulate double vision."),
|
||||||
};
|
};
|
||||||
|
|
||||||
Mix_Chunk *snd_effects[NUM_TOOLS];
|
Mix_Chunk *snd_effects[NUM_TOOLS];
|
||||||
|
|
@ -190,10 +196,14 @@ colorsep_drag(magic_api * api ATTRIBUTE_UNUSED, int which, SDL_Surface * canvas,
|
||||||
r = r1;
|
r = r1;
|
||||||
g = g2;
|
g = g2;
|
||||||
b = b2;
|
b = b2;
|
||||||
} else {
|
} else if (which == COLORSEP_TOOL_COLORSEP) {
|
||||||
r = (Uint8) ((float) r1 * colorsep_r_pct) + ((float) r2 * (1.0 - colorsep_r_pct));
|
r = (Uint8) ((float) r1 * colorsep_r_pct) + ((float) r2 * (1.0 - colorsep_r_pct));
|
||||||
g = (Uint8) ((float) g1 * colorsep_g_pct) + ((float) g2 * (1.0 - colorsep_g_pct));
|
g = (Uint8) ((float) g1 * colorsep_g_pct) + ((float) g2 * (1.0 - colorsep_g_pct));
|
||||||
b = (Uint8) ((float) b1 * colorsep_b_pct) + ((float) b2 * (1.0 - colorsep_b_pct));
|
b = (Uint8) ((float) b1 * colorsep_b_pct) + ((float) b2 * (1.0 - colorsep_b_pct));
|
||||||
|
} else { /* which == COLORSEP_TOOL_DOUBLEVISION */
|
||||||
|
r = (Uint8) ((float) r1 * 0.5) + ((float) r2 * 0.5);
|
||||||
|
g = (Uint8) ((float) g1 * 0.5) + ((float) g2 * 0.5);
|
||||||
|
b = (Uint8) ((float) b1 * 0.5) + ((float) b2 * 0.5);
|
||||||
}
|
}
|
||||||
|
|
||||||
api->putpixel(canvas, xx, yy, SDL_MapRGB(canvas->format, r, g, b));
|
api->putpixel(canvas, xx, yy, SDL_MapRGB(canvas->format, r, g, b));
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue