aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKylie McClain <kylie@somas.is>2021-06-03 01:17:58 -0400
committerKylie McClain <kylie@somas.is>2021-06-05 19:01:27 -0400
commitb8ff61efe51796b24d3221ec7bbeb104b9c9db8e (patch)
tree862c7bfc041718f347f9d1293667346e27f405a3
parentc64fa6ace0273a5594655a4d0604b68819ff5e94 (diff)
downloadxmascot-b8ff61efe51796b24d3221ec7bbeb104b9c9db8e.tar.gz
xmascot-b8ff61efe51796b24d3221ec7bbeb104b9c9db8e.tar.xz
xmascot-b8ff61efe51796b24d3221ec7bbeb104b9c9db8e.zip
Always enable SHADOW.
-rw-r--r--imagelib/image.c4
-rw-r--r--main.c2
-rw-r--r--pattern.c19
-rw-r--r--preference.c6
-rw-r--r--resource.c4
-rw-r--r--xmascot.h2
6 files changed, 0 insertions, 37 deletions
diff --git a/imagelib/image.c b/imagelib/image.c
index 5d7b13d..aa43d45 100644
--- a/imagelib/image.c
+++ b/imagelib/image.c
@@ -753,8 +753,6 @@ else if (r0 >= 0) {
}
-#ifdef SHADOW
-
/* イメージをpixmapに変換する */
Pixmap
image_pixmap_with_shadow(ImageData *img, Pixmap *m, int shadow_len)
@@ -865,8 +863,6 @@ image_pixmap_with_shadow(ImageData *img, Pixmap *m, int shadow_len)
return p;
}
-#endif /* SHADOW */
-
/* イメージをpixmapに変換する */
Pixmap
diff --git a/main.c b/main.c
index cc6f053..7dd7dd1 100644
--- a/main.c
+++ b/main.c
@@ -65,10 +65,8 @@ static XrmOptionDescRec options[] = {
{"-chainpat", ".chainPattern", XrmoptionSepArg, NULL},
#endif
{"-searchpath", ".search", XrmoptionSepArg, NULL},
-#ifdef SHADOW
{"-shadow", ".shadow", XrmoptionSepArg, NULL},
{"-noshadow", ".shadow", XrmoptionNoArg, "0"},
-#endif
{"-drawtiming", ".drawTiming", XrmoptionSepArg, NULL},
};
diff --git a/pattern.c b/pattern.c
index 7ffe240..f67063f 100644
--- a/pattern.c
+++ b/pattern.c
@@ -48,20 +48,11 @@ set_widget_pattern(Widget w, char *name, int c, int r)
}
image_set_col(img, XtDisplay(w), XtWindow(w));
-#ifdef SHADOW
pix = image_pixmap_with_shadow(img, &bit, adat.shadow);
-#else
- pix = image_pixmap(img, &bit);
-#endif
XtVaSetValues(w, XtNbackgroundPixmap, pix, NULL);
-#ifdef SHADOW
XtResizeWidget(w, (Dimension) (img->width + adat.shadow),
(Dimension) (img->height + adat.shadow), 0);
-#else
- XtResizeWidget(w, (Dimension)img->width,
- (Dimension)img->height, 0);
-#endif
XShapeCombineMask(XtDisplay(w), XtWindow(w), ShapeBounding, 0, 0, bit, ShapeSet);
@@ -97,11 +88,7 @@ set_chain_pat(char *name, int c, int r)
img->width + adat.shadow,
img->height + adat.shadow, 0);
-#ifdef SHADOW
pix = image_pixmap_with_shadow(img, &bit, adat.shadow);
-#else
- pix = image_pixmap(img, &bit);
-#endif
for (i = 0; i < adat.chain_num; i++)
XShapeCombineMask(dpy, XtWindow(chain[i]),
ShapeBounding, 0, 0, bit, ShapeSet);
@@ -130,7 +117,6 @@ roll(ImageData *img, double mmag)
unsigned h = img->height; /* 縦幅 */
unsigned s = sqrt((double) (w * w + h * h)) * mmag; /* 対角長 */
-#ifdef SHADOW
u_long black;
msg_out("in roll\n");
@@ -149,7 +135,6 @@ roll(ImageData *img, double mmag)
} else
black = 0;
}
-#endif
/* pixmap の生成 */
for (i = 0; i < 17; i++) {
@@ -191,7 +176,6 @@ roll(ImageData *img, double mmag)
for (x = s - 1; x >= 0; x--) {
c = (int)v*w + (int)u;
if (u >= 0 && u < w && v >= 0 && v < h) {
-#ifdef SHADOW
if (adat.shadow) {
if (data[c] != img->trans_index) {
XPutPixel(img_data, x, y,
@@ -207,18 +191,15 @@ roll(ImageData *img, double mmag)
XPutPixel(img_mask, x, y, 0);
}
} else
-#endif
{
XPutPixel(img_data, x, y, pixel_value[data[c]]);
XPutPixel(img_mask, x, y,
(data[c] != img->trans_index)?1:0);
}
} else {
-#ifdef SHADOW
if (adat.shadow)
XPutPixel(img_data, x, y, black);
else
-#endif
XPutPixel(img_data, x, y,
img->pixel_value[data[c]]);
XPutPixel(img_mask, x, y, 0L);
diff --git a/preference.c b/preference.c
index c033f6a..f91cdd8 100644
--- a/preference.c
+++ b/preference.c
@@ -55,9 +55,7 @@ typedef struct {
PrefDialog param[] = {
{"grav", "%4.2fG", 1, 0, 0, 0.01, NULL, NULL, 0},
{"damp", "%4.2f ", 1, 0, 0, 0.01, NULL, NULL, 0},
-#ifdef SHADOW
{"shadow", "%4.0f ", 20, 0, 0, 1, NULL, NULL, 0},
-#endif
{"mag", "%4.1f ", 2.9, 0, 0.1, 0.1, NULL, NULL, 0},
{"chain", "%4.0f ", 19, 0, 1, 1, NULL, NULL, 0},
};
@@ -103,9 +101,7 @@ set_preference_dialog(Widget w, XtPointer dat, XtPointer call)
pref = param;
set_pref(adat.grav / 980.0);
set_pref(adat.damping);
-#ifdef SHADOW
set_pref(adat.shadow);
-#endif
set_pref(adat.magnify);
set_pref(adat.chain_num);
}
@@ -132,12 +128,10 @@ ok_preference(Widget w, XtPointer dat, XtPointer cal)
if (changed())
adat.damping = get_pref();
-#ifdef SHADOW
if (changed()) {
reload_flag = 1;
adat.shadow = get_pref();
}
-#endif
if (changed()) {
reload_flag = 1;
adat.magnify = get_pref();
diff --git a/resource.c b/resource.c
index f318afe..463b4fa 100644
--- a/resource.c
+++ b/resource.c
@@ -154,14 +154,12 @@ static XtResource resources[] = {
XtOffsetOf(AppData, no),
XtRImmediate, (XtPointer) 0
},
-#ifdef SHADOW
{
"shadow", "Shadow",
XtRInt, sizeof(int),
XtOffsetOf(AppData, shadow),
XtRImmediate, (XtPointer) 4
},
-#endif
{
"drawTiming", "DrawTiming",
XtRInt, sizeof(int),
@@ -258,10 +256,8 @@ usage(int *argc, char **argv)
#endif
" -searchpath s : Mascot"
" search path\n"
-#ifdef SHADOW
" -shadow n : Set shadow length\n"
" -noshadow : No shadow\n"
-#endif
"\n";
int i, f = 0;
for (i = 1; i < *argc; i++) {
diff --git a/xmascot.h b/xmascot.h
index f408a2f..5c07846 100644
--- a/xmascot.h
+++ b/xmascot.h
@@ -84,9 +84,7 @@ typedef struct{
Boolean random; /* キャラクタのランダム変更 */
int change_time; /* 切替までの時間 (分指定) */
Boolean all_menu; /* 切替え全メニュー */
-#ifdef SHADOW
int shadow; /* 影の幅 */
-#endif
Cursor cursor_normal;
Cursor cursor_click;
Cursor cursor_drag;