projects
/
xscreensaver
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
From http://www.jwz.org/xscreensaver/xscreensaver-5.35.tar.gz
[xscreensaver]
/
hacks
/
pacman.c
diff --git
a/hacks/pacman.c
b/hacks/pacman.c
index 23fb3a1d4d0b743a43fb2e82e5abf0a0649b2a52..58b2bed6114562d8d2b0f0e427646a5a748c09f8 100644
(file)
--- a/
hacks/pacman.c
+++ b/
hacks/pacman.c
@@
-1,9
+1,8
@@
/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/* pacman --- Mr. Pacman and his ghost friends */
/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/* pacman --- Mr. Pacman and his ghost friends */
-#if
!defined( lint ) && !defined( SABER )
+#if
0
static const char sccsid[] = "@(#)pacman.c 5.00 2000/11/01 xlockmore";
static const char sccsid[] = "@(#)pacman.c 5.00 2000/11/01 xlockmore";
-
#endif
/*-
#endif
/*-
@@
-107,6
+106,7
@@
static const char sccsid[] = "@(#)pacman.c 5.00 2000/11/01 xlockmore";
# include "images/pacman/pacman-ds8.xpm"
#endif
# include "images/pacman/pacman-ds8.xpm"
#endif
+#if 0
static const struct
{
int dx, dy;
static const struct
{
int dx, dy;
@@
-114,6
+114,7
@@
static const struct
{ 0, 1},
{ 1, 0},
{ 0, -1}};
{ 0, 1},
{ 1, 0},
{ 0, -1}};
+#endif
#ifdef DISABLE_INTERACTIVE
ENTRYPOINT ModeSpecOpt pacman_opts = {
#ifdef DISABLE_INTERACTIVE
ENTRYPOINT ModeSpecOpt pacman_opts = {
@@
-602,9
+603,9
@@
drawlevelblock (ModeInfo * mi, pacmangamestruct * pp,
if (pp->ys % 2 == 1)
dy = -1;
if (pp->ys % 2 == 1)
dy = -1;
-#ifndef HAVE_
COCOA
+#ifndef HAVE_
JWXYZ
XSetFillStyle (display, pp->stippledGC, FillSolid);
XSetFillStyle (display, pp->stippledGC, FillSolid);
-#endif /* !HAVE_
COCOA
*/
+#endif /* !HAVE_
JWXYZ
*/
XSetLineAttributes (display, pp->stippledGC, pp->wallwidth,
LineSolid, CapRound, JoinMiter);
XSetLineAttributes (display, pp->stippledGC, pp->wallwidth,
LineSolid, CapRound, JoinMiter);
@@
-954,16
+955,12
@@
draw_pacman_sprite (ModeInfo * mi)
Display *display = MI_DISPLAY (mi);
Window window = MI_WINDOW (mi);
pacmangamestruct *pp = &pacman_games[MI_SCREEN (mi)];
Display *display = MI_DISPLAY (mi);
Window window = MI_WINDOW (mi);
pacmangamestruct *pp = &pacman_games[MI_SCREEN (mi)];
- unsigned int dir;
pp->pacman.cf = pp->pacman.col * pp->xs + pp->pacman.delta.x *
pp->pacman.cfactor + pp->xb + pp->spritedx;
pp->pacman.rf = pp->pacman.row * pp->ys + pp->pacman.delta.y *
pp->pacman.rfactor + pp->yb + pp->spritedy;
pp->pacman.cf = pp->pacman.col * pp->xs + pp->pacman.delta.x *
pp->pacman.cfactor + pp->xb + pp->spritedx;
pp->pacman.rf = pp->pacman.row * pp->ys + pp->pacman.delta.y *
pp->pacman.rfactor + pp->yb + pp->spritedy;
- dir = (ABS (pp->pacman.cfactor) * (2 - pp->pacman.cfactor) +
- ABS (pp->pacman.rfactor) * (1 + pp->pacman.rfactor)) % 4;
-
XSetForeground (display, pp->stippledGC, MI_BLACK_PIXEL (mi));
if (pp->pacman.oldcf != NOWHERE && pp->pacman.oldrf != NOWHERE) {
XSetForeground (display, pp->stippledGC, MI_BLACK_PIXEL (mi));
if (pp->pacman.oldcf != NOWHERE && pp->pacman.oldrf != NOWHERE) {
@@
-1263,7
+1260,7
@@
scale_pixmap (Display ** dpy, GC gc, Pixmap source, int dwidth, int dheight)
end = dheight * yscale;
/* Scale height of temp into dest pixmap */
for (i = 0; i <= end; i += yscale)
end = dheight * yscale;
/* Scale height of temp into dest pixmap */
for (i = 0; i <= end; i += yscale)
- XCopyArea (*dpy, temp, dest, gc, 0, i,
s
width, 1, 0, j++);
+ XCopyArea (*dpy, temp, dest, gc, 0, i,
d
width, 1, 0, j++);
XFreePixmap (*dpy, temp);
return (Pixmap) dest;
XFreePixmap (*dpy, temp);
return (Pixmap) dest;
@@
-1479,7
+1476,7
@@
init_pacman (ModeInfo * mi)
{
Display *display = MI_DISPLAY (mi);
Window window = MI_WINDOW (mi);
{
Display *display = MI_DISPLAY (mi);
Window window = MI_WINDOW (mi);
-
int
size = MI_SIZE (mi);
+
long
size = MI_SIZE (mi);
pacmangamestruct *pp;
XGCValues gcv;
int i, j, k;
pacmangamestruct *pp;
XGCValues gcv;
int i, j, k;
@@
-1570,7
+1567,7
@@
init_pacman (ModeInfo * mi)
}
}
}
}
-#ifdef HAVE_
COCOA
+#ifdef HAVE_
JWXYZ
jwxyz_XSetAntiAliasing (display, pp->stippledGC, False);
#endif
jwxyz_XSetAntiAliasing (display, pp->stippledGC, False);
#endif
@@
-1779,8
+1776,10
@@
ENTRYPOINT void
reshape_pacman(ModeInfo * mi, int width, int height)
{
pacmangamestruct *pp = &pacman_games[MI_SCREEN (mi)];
reshape_pacman(ModeInfo * mi, int width, int height)
{
pacmangamestruct *pp = &pacman_games[MI_SCREEN (mi)];
- pp->width = width;
+ pp->width
= width;
pp->height = height;
pp->height = height;
+ pp->xb = (pp->width - pp->ncols * pp->xs) >> 1;
+ pp->yb = (pp->height - pp->nrows * pp->ys) >> 1;
MI_CLEARWINDOW (mi);
/* repopulate (mi); */
drawlevel (mi);
MI_CLEARWINDOW (mi);
/* repopulate (mi); */
drawlevel (mi);