Sun Oct 31 21:36:50 GMT 1999

(gilbertt)

New cloak-animation - text banner.
Fixed my bouncing ball.
Rand()omised my atoms.

How can I even try to make a serious ChangeLog entry when all I've done is
fix my bouncing ball? I give up.


SVN revision: 1074
This commit is contained in:
Tom Gilbert 1999-10-31 13:19:20 +00:00
parent c4c3ee495a
commit 5c423a43ce
4 changed files with 181 additions and 17 deletions

View File

@ -1,4 +1,13 @@
Mon Oct 31 11:36:50 GMT 1999
Sun Oct 31 21:36:50 GMT 1999
(gilbertt)
New cloak-animation - text banner.
Fixed my bouncing ball.
Rand()omised my atoms.
-------------------------------------------------------------------------------
Sun Oct 31 11:36:50 GMT 1999
(gilbertt)
Added E-ScreenShoot. I guess I should include a recent Changelog:

View File

@ -195,6 +195,12 @@ cloak_draw (void *data)
Epplet_timer (cloak_draw, NULL, opt.draw_interval, "DRAW_TIMER");
break;
}
case 13:
{
draw_text ();
Epplet_timer (cloak_draw, NULL, opt.draw_interval, "DRAW_TIMER");
break;
}
default:
{
blank_buf ();
@ -426,6 +432,8 @@ create_epplet_layout (void)
(void *) (&(cloak_anims[11])));
Epplet_add_popup_entry (p, "Atoms", NULL, cb_cloak_anim,
(void *) (&(cloak_anims[12])));
Epplet_add_popup_entry (p, "Banner", NULL, cb_cloak_anim,
(void *) (&(cloak_anims[13])));
col_p = Epplet_create_popup ();
Epplet_add_popup_entry (col_p, "Flame Colors", NULL, NULL, NULL);

View File

@ -25,6 +25,7 @@ static void aa_pixel (double wx, double wy, unsigned char c,
unsigned char bbb);
static void color_buf (unsigned char rr, unsigned char gg, unsigned char bb);
static void fade_buf (int percent);
static void scroll_buf (void);
/* Raster's flame colors */
/* Look, even US spelling ;-) */
@ -370,7 +371,7 @@ draw_aa_triangle (void)
aa_line (x3, y3, x1, y1, 255, 0, 0, 255);
}
/* Two triangles. Possible lamer :) */
/* Two triangles. */
void
draw_aa_star (void)
{
@ -692,34 +693,40 @@ draw_ball (void)
ball_x += d_x;
ball_y += d_y;
if (ball_x < 0)
if (ball_x < 1)
{
ball_x = 0;
ball_x = 1;
d_x = -d_x;
}
else if (ball_x > 38)
else if (ball_x > 37)
{
ball_x = 38;
ball_x = 37;
d_x = -d_x;
}
if (ball_y < 0)
if (ball_y < 1)
{
ball_y = 0;
ball_y = 1;
d_y = -d_y;
}
else if (ball_y > 38)
else if (ball_y > 37)
{
ball_y = 38;
ball_y = 37;
d_y = -d_y;
}
fade_buf (93);
fade_buf (92);
set_col_pixel (ball_x, ball_y, 255, 255, 0, 0);
set_col_pixel (ball_x + 1, ball_y, 255, 255, 0, 0);
set_col_pixel (ball_x, ball_y + 1, 255, 255, 0, 0);
set_col_pixel (ball_x + 1, ball_y + 1, 255, 255, 0, 0);
set_col_pixel (ball_x + 1, ball_y + 1, 155, 255, 0, 0);
set_col_pixel (ball_x - 1, ball_y, 255, 255, 0, 0);
set_col_pixel (ball_x, ball_y - 1, 255, 255, 0, 0);
set_col_pixel (ball_x - 1, ball_y - 1, 155, 255, 0, 0);
set_col_pixel (ball_x - 1, ball_y + 1, 155, 255, 0, 0);
set_col_pixel (ball_x + 1, ball_y - 1, 155, 255, 0, 0);
}
#define NUM_ATOMS 8
@ -741,16 +748,16 @@ draw_atoms (void)
{
atom_x[i] = rand () % 39;
atom_y[i] = rand () % 39;
while (abs (atom_d_x[i]) < 0.5)
while (fabs (atom_d_x[i]) < 0.3)
atom_d_x[i] = ((double) rand () / RAND_MAX * 3) - 1.5;
while (abs (atom_d_y[i]) < 0.5)
while (fabs (atom_d_y[i]) < 0.3)
atom_d_y[i] = ((double) rand () / RAND_MAX * 3) - 1.5;
blank_buf ();
setup = 1;
}
}
else
fade_buf (83);
fade_buf (87);
for (i = 0; i < NUM_ATOMS; i++)
{
@ -814,8 +821,8 @@ aa_line (int x1, int y1, int x2, int y2, unsigned char b,
line_height = (y2 - y1);
}
/* This is currently broken for lines that don't
* span more than one pixel */
/* This is currently broken. It is supposed to account
* for lines that don't span more than one pixel */
if (abs (line_width) < 0.1)
{
x2 = x1 + 0.5;
@ -979,6 +986,7 @@ aa_line (int x1, int y1, int x2, int y2, unsigned char b,
}
}
/* Draw an anti-aliased pixel */
static void
aa_pixel (double wx, double wy, unsigned char c, unsigned char rrr,
unsigned char ggg, unsigned char bbb)
@ -1003,6 +1011,7 @@ aa_pixel (double wx, double wy, unsigned char c, unsigned char rrr,
set_col_pixel (x + 1, y + 1, bbr, rrr, ggg, bbb);
}
/* Set a pixel, takes a brightness and a colour value */
static void
set_col_pixel (int x, int y, unsigned char c, unsigned char rrr,
unsigned char ggg, unsigned char bbb)
@ -1018,6 +1027,7 @@ set_col_pixel (int x, int y, unsigned char c, unsigned char rrr,
ptr[2] = ((double) bbb / 255 * (double) c);
}
/* Set a pixel, grayscale, takes a brightness value */
static void
set_pixel (int x, int y, unsigned char c)
{
@ -1031,3 +1041,139 @@ set_pixel (int x, int y, unsigned char c)
ptr[1] = c;
ptr[2] = c;
}
/* 19 x 132 */
static char enlighten[19][172] = {
"....+@@@@@@@@@@.............+@+..@#.............#@..........................................................................................................................",
"....@$$$$$$$$$$.............@$@..$%.............%$..........&@................................................................&@............................................",
"....@$*@@@@@@@@.............@$@..@#.............%$.........@$@...............................................................@$@............................................",
"....@$%.....................@$@.................%$.........@$@...............................................................@$@............................................",
"....@$%..........+@++=%=#...@$@..@#....&%%#.@#..%$.#%%&...#=$=@....@%%=+....@#.&%%@....@#.&%=+.+=%=+.....#=%%#....#@.#%%&+..#=$=@...........................................",
"....@$%..........@$=$$$$$@..@$@..$%...*$$$$%$%..%$%$$$$-+.%$$$$..+-$$$$$@...$%-$$$$%...$%-$$$-#-$$$-+...%$$$$$%...%$=$$$$-+.%$$$$...........................................",
"....@$*@@@@@@@+..@$$&..&$*..@$@..$%..=$%+.&$$%..%$-#.+%$&.#=$=@..-$&..#*$#..$$%+.#-$+..$$%+.%$$%+.%$=..=$%+.+=$=..%$-#.+%$&.#=$=@...........................................",
"....@$$$$$$$$$@..@$%....*$..@$@..$%..$*....&$%..%$@...+$%..@$@..@$&....+$%..$$....&$@..$$....$-....$%..$*.....*$..%$@...+$%..@$@............................................",
"....@$*@@@@@@@+..@$@....%$..@$@..$%.@$&....+$%..%$.....$%..@$@..=$@@@@@@*-..$%....@$@..$%....$%....$%.#$=@@@@@=$#.%$.....$%..@$@............................................",
"....@$%..........@$@....%$..@$@..$%.@$@.....$%..%$.....$%..@$@..%$$$$$$$$$..$%....@$@..$%....$%....$%.@$$$$$$$$$@.%$.....$%..@$@............................................",
"....@$%..........@$@....%$..@$@..$%.@$@.....$%..%$.....$%..@$@..%$@@@@@@@@..$%....@$@..$%....$%....$%.@$=@@@@@@@+.%$.....$%..@$@............................................",
"....@$%..........@$@....%$..@$@..$%.+$=....@$%..%$.....$%..@$@..=$#.....#...$%....@$@..$%....$%....$%.#$=.....++..%$.....$%..@$@............................................",
"....@$%..........@$@....%$..@$@..$%..*$@..+-$%..%$.....$%..@$@..#$*....+$*..$%....@$@..$%....$%....$%..-$+....*$+.%$.....$%..@$@............................................",
"....@$-%%%%%%%%#.@$@....%$..@$@..$%..+$$*%$$$%..%$.....$%..@$%@..%$-&@=-$#..$%....@$@..$%....$%....$%..@$$=@&*$=..%$.....$%..@$%@...........................................",
"....@$$$$$$$$$$@.@$@....%$..@$@..$%...+%$$*+$%..%$.....$%...-$$#..=$$$$-@...$%....@$@..$%....$%....$%...@-$$$$=...%$.....$%...-$$#..........................................",
".....................................@.....+$=...............@@+....@@#...................................#@@..................@@+..........................................",
".....................................$-....%$@..............................................................................................................................",
".....................................=$-%%-$%...............................................................................................................................",
"......................................&*$$-=................................................................................................................................"
};
/* Do *not* flame me for doing it this way... */
/* I know !!! */
/* ;-) */
void
draw_text (void)
{
static int setup = 0;
static int i = 0, j = 0, y = 0;
unsigned char b;
if (!setup)
{
blank_buf ();
setup = 1;
y = (rand () % 14) + 4;
}
else
{
scroll_buf ();
}
for (i = y; i < (y + 19); i++)
{
switch (enlighten[i - y][j])
{
case '.':
{
b = 0;
break;
}
case '@':
{
b = 85;
break;
}
case '$':
{
b = 255;
break;
}
case '-':
{
b = 224;
break;
}
case '=':
{
b = 141;
break;
}
case '#':
{
b = 56;
break;
}
case '+':
{
b = 28;
break;
}
case '*':
{
b = 98;
break;
}
case '%':
{
b = 70;
break;
}
case '&':
{
b = 113;
break;
}
}
set_col_pixel (39, i, b, 136, 221, 221);
}
++j;
if (j > 172)
{
j = 0;
y = (rand () % 14) + 4;
}
}
/* Scrolls buf along one */
static void
scroll_buf (void)
{
int x, y;
unsigned char *rgb, *rptr;
for (y = 0; y < 40; y++)
{
rgb = Epplet_get_rgb_pointer (buf);
rptr = rgb + (y * 40 * 3);
for (x = 0; x < 39; x++)
{
rptr[0] = rptr[3];
rptr[1] = rptr[4];
rptr[2] = rptr[5];
rptr += 3;
}
rptr[0] = 0;
rptr[1] = 0;
rptr[2] = 0;
}
}

View File

@ -19,3 +19,4 @@ void draw_scanner (void);
void draw_colorwarp (void);
void draw_ball(void);
void draw_atoms(void);
void draw_text(void);