summaryrefslogtreecommitdiff
path: root/xplanet/xplanet-1.2.1.patch
blob: 473c40073517deaf632e7dd5b33e753290d29144 (plain)
    1 http://bugs.gentoo.org/show_bug.cgi?id=277937
    2 
    3 diff -ur xplanet-1.2.1.orig/src/libimage/bmp.c xplanet-1.2.1/src/libimage/bmp.c
    4 --- xplanet-1.2.1.orig/src/libimage/bmp.c	2006-03-26 00:50:51.000000000 +0200
    5 +++ xplanet-1.2.1/src/libimage/bmp.c	2009-07-26 21:42:03.000000000 +0300
    6 @@ -61,10 +61,10 @@
    7      struct BMPHeader bmph;
    8  
    9      /* The length of each line must be a multiple of 4 bytes */
   10 -
   11      bytesPerLine = (3 * (width + 1) / 4) * 4;
   12  
   13 -    strcpy(bmph.bfType, "BM");
   14 +    /* copy only "BM" without a terminating null byte */
   15 +    strncpy(bmph.bfType, "BM", 2);
   16      bmph.bfOffBits = 54;
   17      bmph.bfSize = bmph.bfOffBits + bytesPerLine * height;
   18      bmph.bfReserved = 0;
   19 diff -ur xplanet-1.2.1.orig/src/libmultiple/addOrbits.cpp xplanet-1.2.1/src/libmultiple/addOrbits.cpp
   20 --- xplanet-1.2.1.orig/src/libmultiple/addOrbits.cpp	2008-11-14 01:46:12.000000000 +0200
   21 +++ xplanet-1.2.1/src/libmultiple/addOrbits.cpp	2009-07-26 21:42:06.000000000 +0300
   22 @@ -86,9 +86,13 @@
   23      const double period = p->Period();
   24      if (period == 0) return;
   25  
   26 +    // Units of orbit circumference
   27      const double startOrbit = currentProperties->StartOrbit();
   28      const double stopOrbit = currentProperties->StopOrbit();
   29 +
   30 +    // degrees
   31      const double delOrbit = currentProperties->DelOrbit();
   32 +
   33      const unsigned char *color = currentProperties->OrbitColor();
   34      const int thickness = currentProperties->ArcThickness();
   35  
   36 @@ -103,10 +107,11 @@
   37      const double startTime = jd0 + startOrbit * period;
   38      const double stopTime = jd0 + stopOrbit * period;
   39  
   40 -    const int numTimes = (int) (180/delOrbit + 0.5);
   41 -
   42 +    int numTimes = (int) abs(360 * startOrbit / delOrbit + 0.5);
   43      addArc(startTime, jd0, numTimes, color, thickness, view, width, height, 
   44             Prx, Pry, Prz, p, annotationMap);
   45 +
   46 +    numTimes = (int) abs(360 * stopOrbit / delOrbit + 0.5);
   47      addArc(jd0, stopTime, numTimes, color, thickness, view, width, height, 
   48             Prx, Pry, Prz, p, annotationMap);
   49  }
   50 diff -ur xplanet-1.2.1.orig/src/Satellite.cpp xplanet-1.2.1/src/Satellite.cpp
   51 --- xplanet-1.2.1.orig/src/Satellite.cpp	2006-03-26 02:34:21.000000000 +0200
   52 +++ xplanet-1.2.1/src/Satellite.cpp	2009-07-26 21:42:17.000000000 +0300
   53 @@ -1,4 +1,5 @@
   54  #include <clocale>
   55 +#include <cstdio>
   56  #include <cstring>
   57  #include <iostream>
   58  using namespace std;
   59 diff -ur xplanet-1.2.1.orig/src/Separation.cpp xplanet-1.2.1/src/Separation.cpp
   60 --- xplanet-1.2.1.orig/src/Separation.cpp	2008-11-14 02:19:05.000000000 +0200
   61 +++ xplanet-1.2.1/src/Separation.cpp	2009-07-26 21:42:17.000000000 +0300
   62 @@ -1,4 +1,5 @@
   63  #include <cmath>
   64 +#include <cstdio>
   65  #include <iostream>
   66  
   67  #include "Separation.h"
   68 diff -ur xplanet-1.2.1.orig/xplanet.1 xplanet-1.2.1/xplanet.1
   69 --- xplanet-1.2.1.orig/xplanet.1	2007-12-27 01:48:50.000000000 +0200
   70 +++ xplanet-1.2.1/xplanet.1	2009-07-26 21:42:17.000000000 +0300
   71 @@ -31,7 +31,7 @@
   72  .sp
   73  .fi
   74  where declination is in degrees and right ascension is in hours.  This
   75 -option has no effect if -projection is specified.
   76 +option has no effect if \-projection is specified.
   77  
   78  .TP
   79  .B \-arc_spacing spacing
   80 @@ -48,8 +48,8 @@
   81  .TP
   82  .B \-background background_file
   83  Use background_file as the background image, with the planet to be
   84 -superimposed upon it.  A color may also be supplied (e.g. -background
   85 -"navy blue" or -background 0xff00ff).
   86 +superimposed upon it.  A color may also be supplied (e.g. \-background
   87 +"navy blue" or \-background 0xff00ff).
   88  
   89  .TP
   90  .B \-base_magnitude magnitude
   91 @@ -67,20 +67,20 @@
   92  pluto, charon, random, and major.  
   93  
   94  The field of view can also be centered on a satellite location using
   95 -"naif" or "norad", along with the satellite id.  For example, "-body
   96 -naif-82" will center the field of view on NAIF ID -82, which is the
   97 +"naif" or "norad", along with the satellite id.  For example, "\-body
   98 +naif-82" will center the field of view on NAIF ID \-82, which is the
   99  Cassini orbiter.  Xplanet must be compiled with SPICE support and the
  100  required kernels must be present.  See the README in the spice
  101 -subdirectory for more details.  Using "-body norad20580" will center
  102 +subdirectory for more details.  Using "\-body norad20580" will center
  103  the field of view on NORAD ID 20580, which is the Hubble Space
  104  Telescope.  The appropriate TLE files must be present in this case.
  105  See the README in the satellites subdirectory for more information.
  106  
  107  Using "path" will center the field of view on the direction of motion
  108  of the origin.  This direction is relative to the direction of motion
  109 -of the body specified by -path_relative_to.
  110 +of the body specified by \-path_relative_to.
  111  
  112 -Earth is the default body.  This option is the same as -target.
  113 +Earth is the default body.  This option is the same as \-target.
  114  
  115  .TP
  116  .B \-center +x+y
  117 @@ -92,13 +92,13 @@
  118  .B \-color color
  119  Set the color for the label.  The default is "red".  Any color in the
  120  rgb.txt file may be used.  Colors may also be specified by RGB hex
  121 -values; for example -color 0xff and -color blue mean the same thing,
  122 -as do -color 0xff0000 and -color red.
  123 +values; for example \-color 0xff and \-color blue mean the same thing,
  124 +as do \-color 0xff0000 and \-color red.
  125  
  126  .TP
  127  .B \-config config_file
  128  Use the configuration file config_file.  The format of config_file is
  129 -described in README.config.  See the description of -searchdir to see
  130 +described in README.config.  See the description of \-searchdir to see
  131  where xplanet looks in order to find the configuration file.
  132  
  133  .TP
  134 @@ -116,7 +116,7 @@
  135  .TP
  136  .B \-dynamic_origin file
  137  Specify an observer location.  The location is relative to the body
  138 -specified with -origin (by default, this is the Sun).  The last line
  139 +specified with \-origin (by default, this is the Sun).  The last line
  140  of the file must be of the form
  141  .nf
  142  .sp
  143 @@ -126,7 +126,7 @@
  144  For example,
  145  .nf
  146  .sp
  147 -19951207.120000     10.328   -3.018   97.709    9.595
  148 +19951207.120000     10.328   \-3.018   97.709    9.595
  149  .sp
  150  .fi
  151  The specified time is ignored and the current time is used.  The range
  152 @@ -134,7 +134,7 @@
  153  hours) is optional, but if present, it will be used in place of the
  154  longitude.  Only the last line of the file is used.  This file may be
  155  updated between renderings using a script executed with the
  156 --prev_command or -post_command options.
  157 +\-prev_command or \-post_command options.
  158  
  159  .TP
  160  .B \-ephemeris_file filename
  161 @@ -144,13 +144,13 @@
  162  little endian binary files.  The ephemeris files found at
  163  ftp://ssd.jpl.nasa.gov/pub/eph/export/unix are big endian files, but
  164  you do not need to do any additional byte-swapping to use them.  See
  165 -the description of -searchdir to see where xplanet looks in order to
  166 +the description of \-searchdir to see where xplanet looks in order to
  167  find the ephemeris file.
  168  
  169  .TP
  170  .B \-font fontname 
  171  Set the font for the label.  Only TrueType fonts are supported.  If
  172 -the -pango option is used, fontname is taken to be the font family
  173 +the \-pango option is used, fontname is taken to be the font family
  174  name (e.g. "Arial").
  175  
  176  .TP
  177 @@ -168,9 +168,9 @@
  178  
  179  .TP
  180  .B \-fov
  181 -Specify the field of view, in degrees.  This option and the -radius
  182 +Specify the field of view, in degrees.  This option and the \-radius
  183  option are mutually exclusive.  This option has no effect if the
  184 --projection option is used.
  185 +\-projection option is used.
  186  
  187  .TP
  188  .B \-geometry string
  189 @@ -179,7 +179,7 @@
  190  (e.g. 256x256-10+10 puts a window 256x256 pixels in size 10 pixels
  191  away from the right side and 10 pixels below the top of the root
  192  window).  The root window outside of the image will be black.  This
  193 -option may be used with -window or -output.
  194 +option may be used with \-window or \-output.
  195  
  196  .TP
  197  .B \-glare radius
  198 @@ -188,7 +188,7 @@
  199  
  200  .TP
  201  .B \-gmtlabel
  202 -Same as the -label option, but show GMT instead of local time.
  203 +Same as the \-label option, but show GMT instead of local time.
  204  
  205  .TP
  206  .B \-grs_longitude lon
  207 @@ -213,7 +213,7 @@
  208  
  209  .TP
  210  .B \-interpolate_origin_file
  211 -This option is only useful in conjunction with -origin_file.  It
  212 +This option is only useful in conjunction with \-origin_file.  It
  213  computes the observer position at the current time by interpolating
  214  between values specified in the origin file.  This is useful if you
  215  have spacecraft positions tabulated in an origin file, but want a real
  216 @@ -232,12 +232,12 @@
  217  Specify the location of the label using the standard X window geometry
  218  syntax.  The default position is "-15+15", or 15 pixels to the left
  219  and below the top right corner of the display.  This option implies
  220 --label. 
  221 +\-label. 
  222  
  223  .TP
  224  .B \-label_body body
  225  Use the specified body to calculate the sub-observer, sub-solar, and
  226 -illumination values in the label.  This is useful with the -separation
  227 +illumination values in the label.  This is useful with the \-separation
  228  option.
  229  
  230  .TP
  231 @@ -268,17 +268,17 @@
  232  .B \-longitude longitude 
  233  Place the observer above the specified longitude (in degrees).
  234  Longitude is positive going east, negative going west (for the earth
  235 -and moon), so for example Los Angeles is at -118 or 242.  The default
  236 +and moon), so for example Los Angeles is at \-118 or 242.  The default
  237  value is 0.
  238  
  239  .TP
  240  .B \-make_cloud_maps
  241  If there is an entry in the config file for cloud_map, xplanet will
  242  output a day and night image with clouds overlaid and then exit.  The
  243 -images will be created in the directory specified by -tmpdir, or in
  244 -the current directory if -tmpdir is not used.  The names of the output
  245 +images will be created in the directory specified by \-tmpdir, or in
  246 +the current directory if \-tmpdir is not used.  The names of the output
  247  images default to day_clouds.jpg and night_clouds.jpg, but may be
  248 -changed by the -output option.  If "-output filename.extension" is
  249 +changed by the \-output option.  If "\-output filename.extension" is
  250  specified, the output images will be named "day_filename.extension"
  251  and "night_filename.extension".  The dimensions of the output images
  252  are the same as the day image.
  253 @@ -290,11 +290,11 @@
  254  declination, right ascension, string, as in the example below:
  255  .nf
  256  .sp
  257 --16.7161 6.7525 "Sirius"
  258 +\-16.7161 6.7525 "Sirius"
  259  .sp
  260  .fi
  261  For additional options which may be specified, see the marker_file
  262 -entry in README.config.  This option has no effect if -projection is
  263 +entry in README.config.  This option has no effect if \-projection is
  264  specified.  This option is not meant for city markers; for that use
  265  the marker_file option in the configuration file.
  266  
  267 @@ -321,9 +321,9 @@
  268  body:        body's north pole
  269  galactic:    galactic north pole
  270  orbit:       body's orbital north pole (perpendicular to the orbit plane)
  271 -path:        origin's velocity vector  (also see -path_relative_to option)
  272 +path:        origin's velocity vector  (also see \-path_relative_to option)
  273  separation:  perpendicular to the line of sight and the
  274 -	     target-separation target line (see -separation option)
  275 +	     target-separation target line (see \-separation option)
  276  .sp
  277  .fi
  278  The default value is "body".
  279 @@ -335,7 +335,7 @@
  280  .TP
  281  .B \-origin body
  282  Place the observer at the center of the specified body.  Valid values
  283 -are the same as for -target.  In addition, "above", "below", or
  284 +are the same as for \-target.  In addition, "above", "below", or
  285  "system" may be specified.  Using "above" or "below" centers the view
  286  on the body's primary and the field of view is large enough to show
  287  the body's orbit.  Using "system" places the observer at the center of
  288 @@ -351,15 +351,15 @@
  289  If the body name is preceded by a dash, the observer is placed on the
  290  opposite side of the target from the specified body at a distance
  291  equal to the distance between the target and body.  For example,
  292 --target earth -origin sun places the observer at the center of the
  293 -sun.  If -target earth -origin -sun is used, the observer is placed on
  294 +\-target earth \-origin sun places the observer at the center of the
  295 +sun.  If \-target earth \-origin \-sun is used, the observer is placed on
  296  a line connecting the centers of the earth and sun at a distance of 1
  297  AU farther from the sun than the earth.
  298  
  299  .TP
  300  .B \-origin_file origin_file
  301  Specify a list of observer positions in origin_file.  The positions
  302 -are relative to the body specified with -origin (by default, this is
  303 +are relative to the body specified with \-origin (by default, this is
  304  the Sun).  Each line should be of the form
  305  .nf
  306  .sp
  307 @@ -369,14 +369,14 @@
  308  For example,
  309  .nf
  310  .sp
  311 -19951207.120000     10.328   -3.018   97.709    9.595
  312 +19951207.120000     10.328   \-3.018   97.709    9.595
  313  .sp
  314  .fi
  315  Range is in planetary radii, and lat and lon are in degrees.  The date
  316  is the only required value.  If the localtime (in hours) is supplied,
  317  it will be used in place of the longitude.  For each line in the
  318  origin file, the observer is placed at the specified position,
  319 -relative to the body specified with -origin.  This option is useful
  320 +relative to the body specified with \-origin.  This option is useful
  321  for showing spacecraft flybys or orbiting around a planet.  Any line
  322  with a # in the first column is ignored.
  323  
  324 @@ -386,8 +386,8 @@
  325  taken from the extension. Currently .gif, .jpg, .ppm, .png, and .tiff
  326  images can be created, if xplanet has been compiled with the
  327  appropriate libraries.  The image size defaults to 512 by 512 pixels
  328 -but this may be changed by the -geometry flag. If used with the
  329 --num_times option, each output file will be numbered sequentially.
  330 +but this may be changed by the \-geometry flag. If used with the
  331 +\-num_times option, each output file will be numbered sequentially.
  332  
  333  .TP
  334  .B \-output_start_index index
  335 @@ -404,7 +404,7 @@
  336  
  337  .TP
  338  .B \-path_relative_to body
  339 -Only used with -north path or -target path.  The origin's velocity
  340 +Only used with \-north path or \-target path.  The origin's velocity
  341  vector is calculated relative to the specified body.  By default, this
  342  is the Sun.
  343  
  344 @@ -416,7 +416,7 @@
  345  On MS Windows, you may need to use unix-style paths.  For example:
  346  .nf
  347  .sp
  348 -xplanet.exe -prev_command ./prev.bat
  349 +xplanet.exe \-prev_command ./prev.bat
  350  .sp
  351  .fi
  352  
  353 @@ -471,8 +471,8 @@
  354  .TP
  355  .B \-rotate angle 
  356  Rotate the globe by angle degrees counterclockwise so that north (as
  357 -defined by the -north argument) isn't at the top.  The default value
  358 -is 0.  My friends in the Southern Hemisphere can use -rotate 180 to
  359 +defined by the \-north argument) isn't at the top.  The default value
  360 +is 0.  My friends in the Southern Hemisphere can use \-rotate 180 to
  361  make the earth look like it should!  For non-orthographic projections,
  362  the globe is rotated and then projected, if that helps you visualize
  363  what to expect.
  364 @@ -481,7 +481,7 @@
  365  .B \-save_desktop_file
  366  On Microsoft Windows and Mac OS X, xplanet creates an intermediate
  367  image file which is used to set the desktop.  This file will be
  368 -created in the -tmpdir directory.  By default, this image is removed
  369 +created in the \-tmpdir directory.  By default, this image is removed
  370  after the desktop has been set.  Specifying this option will leave the
  371  file in place.
  372  
  373 @@ -507,14 +507,14 @@
  374  .TP
  375  .B \-separation body:dist
  376  Place the observer at a location where the target body and the
  377 -separation body are dist degrees apart.  For example "-target earth
  378 --separation moon:-3" means place the observer at a location where the
  379 +separation body are dist degrees apart.  For example "\-target earth
  380 +\-separation moon:-3" means place the observer at a location where the
  381  moon appears 3 degrees to the left of the earth.
  382  
  383  .TP
  384  .B \-spice_ephemeris index
  385  Use SPICE kernels to compute the position of the named body.  The
  386 -index is the naif ID code (e.g. 599 for Jupiter).  The -spice_file
  387 +index is the naif ID code (e.g. 599 for Jupiter).  The \-spice_file
  388  option must be used to supply the names of the kernel files.  This
  389  option may be used more than once for different bodies.
  390  
  391 @@ -544,15 +544,15 @@
  392  decimal hours.  For example, the entry for Sirius is
  393  .nf
  394  .sp
  395 --16.7161  6.7525 -1.46
  396 +\-16.7161  6.7525 \-1.46
  397  .sp
  398  .fi
  399 -See the description of -searchdir to see where xplanet looks in order
  400 +See the description of \-searchdir to see where xplanet looks in order
  401  to find the star map.
  402  
  403  .TP
  404  .B \-target target
  405 -Same as -body.
  406 +Same as \-body.
  407  
  408  .TP
  409  .B \-tt
  410 @@ -568,13 +568,13 @@
  411  .TP
  412  .B \-tmpdir tmpdir
  413  Specify a directory that xplanet will use to place images created
  414 -using -make_cloud_maps.  On Microsoft Windows, xplanet will write
  415 +using \-make_cloud_maps.  On Microsoft Windows, xplanet will write
  416  a bitmap file called xplanet.bmp to the specified directory.  The
  417  default is the result of the GetWindowsDirectory call (C:\WINDOWS on
  418  Win95).  On Mac OS X, xplanet will create an intermediate PNG file in
  419  order to set the background.  The default value is /tmp.  On Windows
  420  and Mac OS X, the intermediate file will be removed unless the
  421 --save_desktop_file option is specified.
  422 +\-save_desktop_file option is specified.
  423  
  424  .TP
  425  .B \-transparency
  426 @@ -583,12 +583,12 @@
  427  
  428  .TP
  429  .B \-transpng filename
  430 -Same as the -output option, except set the background to be
  431 +Same as the \-output option, except set the background to be
  432  transparent when writing a PNG file.  
  433  
  434  .TP
  435  .B \-utclabel
  436 -Same as -gmtlabel.
  437 +Same as \-gmtlabel.
  438  
  439  .TP
  440  .B \-verbosity level
  441 @@ -624,13 +624,13 @@
  442  .TP
  443  .B \-window
  444  Render the image to its own X window.  The size defaults to 512 by 512
  445 -pixels but this may be set by the -geometry flag.
  446 +pixels but this may be set by the \-geometry flag.
  447  
  448  .TP
  449  .B \-window_title title
  450 -Set the window's title to title.  This option implies -window.
  451 +Set the window's title to title.  This option implies \-window.
  452  
  453  .TP
  454  .B \-xscreensaver
  455 -Same as -vroot.
  456 +Same as \-vroot.
  457  

Generated by cgit