summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohn Anthony <johnanthony@lavabit.com>2012-02-16 05:40:04 +0000
committerJohn Anthony <johnanthony@lavabit.com>2012-02-16 05:40:04 +0000
commit02f961c19934f06d7f684aa8adf33674f375cc14 (patch)
tree02b77d5c70057b88fa48fa3b6a52061e1abfb2bd
parent87e9a4186a96aac77aa0b102960e889c71ceaf47 (diff)
downloadnyancat-02f961c19934f06d7f684aa8adf33674f375cc14.tar.gz
nyancat-02f961c19934f06d7f684aa8adf33674f375cc14.tar.bz2
nyancat-02f961c19934f06d7f684aa8adf33674f375cc14.zip
Added warning regarding full-screen stretchy cat not being officially supported.
-rw-r--r--README2
-rw-r--r--nyan.c26
2 files changed, 18 insertions, 10 deletions
diff --git a/README b/README
index 90afd79..4028347 100644
--- a/README
+++ b/README
@@ -2,7 +2,7 @@ Usage: nyancat [OPTIONS]
-h, --help This help message
-f, --fullscreen Enable fullscreen mode (default)
-nf, --nofullscreen Disable fullscreen mode
- -c, --catsize Choose size of cat, options are full and small. Small is default
+ -c, --catsize Choose size of cat, options are full and small. Small is default. "Full" is not officially supported.
-nc, --nocursor Don't show the cursor (default)
-sc, --cursor, --showcursor Show the cursor
-ns, --nosound Don't play sound
diff --git a/nyan.c b/nyan.c
index ab3d300..9cfd624 100644
--- a/nyan.c
+++ b/nyan.c
@@ -158,7 +158,8 @@ clear_screen(void) {
while (c) {
/* This is bad. These magic numbers are to make up for uneven image sizes */
- fillsquare(screen, c->loc.x, c->loc.y - (curr_frame < 2 ? 0 : 5), image_set[curr_frame]->w + 6, image_set[curr_frame]->h + 5, bgcolor);
+ fillsquare(screen, c->loc.x, c->loc.y - (curr_frame < 2 ? 0 : 5),
+ image_set[curr_frame]->w + 6, image_set[curr_frame]->h + 5, bgcolor);
c = c->next;
}
@@ -483,7 +484,8 @@ stretch_images(void) {
stretchto.w = 0;
stretchto.h = 0;
- /* Just use the x co-ordinate for scaling for now. This does, however, need to be changed to accomodate taller resolutions */
+ /* Just use the x co-ordinate for scaling for now. This does, however,
+ need to be changed to accomodate taller resolutions */
#ifdef XINERAMA
int i, nn;
XineramaScreenInfo* info = XineramaQueryScreens(dpy, &nn);
@@ -500,11 +502,12 @@ stretch_images(void) {
/* Handle a slight scaling down */
stretchto.w *= 0.9;
- stretchto.h = stretchto.w * cat_img[0]->h / cat_img[0]->w; /* Scale h to w */
+ stretchto.h = stretchto.w * cat_img[0]->h / cat_img[0]->w;
SDL_PixelFormat fmt = *(cat_img[0]->format);
for(int i=0; i<=4; i++) {
- stretch_cat[i] = SDL_CreateRGBSurface(SURF_TYPE,stretchto.w,stretchto.h,SCREEN_BPP,fmt.Rmask,fmt.Gmask,fmt.Bmask,fmt.Amask);
+ stretch_cat[i] = SDL_CreateRGBSurface(SURF_TYPE, stretchto.w,
+ stretchto.h,SCREEN_BPP,fmt.Rmask,fmt.Gmask,fmt.Bmask,fmt.Amask);
SDL_SoftStretch(cat_img[i],NULL,stretch_cat[i],NULL);
}
@@ -542,12 +545,15 @@ usage(char* exname) {
-h, --help This help message\n\
-f, --fullscreen Enable fullscreen mode (default)\n\
-nf, --nofullscreen Disable fullscreen mode\n\
- -c, --catsize Choose size of cat, options are full and small. Small is default\n\
+ -c, --catsize Choose size of cat, options are full and \
+ small. Small is default. \"Full\" not officially supported.\n\
-nc, --nocursor Don't show the cursor (default)\n\
-sc, --cursor, --showcursor Show the cursor\n\
-ns, --nosound Don't play sound\n\
- -r, --resolution Make next two arguments the screen resolution to use (0 and 0 for full resolution) (800x600 default)\n\
- -hw, -sw Use hardware or software SDL rendering, respectively. Hardware is default\n", exname);
+ -r, --resolution Make next two arguments the screen \
+ resolution to use (0 and 0 for full resolution) (800x600 default)\n\
+ -hw, -sw Use hardware or software SDL rendering, \
+ respectively. Hardware is default\n", exname);
exit(0);
}
@@ -559,9 +565,11 @@ xinerama_add_cats(void) {
for (i = 0; i < nn; ++i)
if(fullscreen)
- add_cat(info[i].x_org + ((info[i].width - image_set[0]->w) / 2), info[i].y_org + ((info[i].height - image_set[0]->h) / 2));
+ add_cat(info[i].x_org + ((info[i].width - image_set[0]->w) / 2),
+ info[i].y_org + ((info[i].height - image_set[0]->h) / 2));
else
- add_cat((SCREEN_WIDTH - image_set[0]->w) / 2, (SCREEN_HEIGHT - image_set[0]->h) / 2);
+ add_cat((SCREEN_WIDTH - image_set[0]->w) / 2,
+ (SCREEN_HEIGHT - image_set[0]->h) / 2);
XFree(info);
}