Date:2010-05-30 17:41:14 (10 years 4 months ago)
Author:Xiangfu Liu
Commit:9858e271720861315726765cf3aebbfa4ff14ca8
Message:use argv[1] as filename

Signed-off-by: Xiangfu Liu <xiangfu@sharism.cc>
Files: sdl-imageviewer.c (2 diffs)

Change Details

sdl-imageviewer.c
4242                rightPressed,
4343                upPressed,
4444                downPressed;
45    char sFilename[255] = "\0",
46                sVersion[] = "0.2.1";
45    char * sFilename;
46    char sVersion[] = "0.2.1";
4747    double scale_x = 1.0,
4848                scale_y = 1.0,
4949                scale = 1.0;
...... 
5454    // Process command line
5555    if (argc != 2)
5656    {
57        fprintf (stderr, "\n imgv v%s. Syntax: imgv <image file>\n\n Hotkeys:\n 'f' fit to screen\n 'z' zoom at pixel level\n 'i' zoom in 'o' zoom out\n 'l' rotate left 'r' rotate right\n 'arrows' pan 'ESC' quit\n\n", sVersion);
57        fprintf (stderr, "\n"
58             " imgv v%s. Syntax: imgv <image file>\n\n"
59             " Hotkeys:\n"
60             " 'f' fit to screen\n"
61             " 'z' zoom at pixel level\n"
62             " 'i' zoom in 'o' zoom out\n"
63             " 'l' rotate left 'r' rotate right\n"
64             " 'arrows' pan 'ESC' quit\n\n", sVersion);
5865        exit (1);
5966    }
60    strncpy (sFilename, argv[1], 254);
67    sFilename = argv[1];
6168
6269    // Initialize the SDL library
6370    if (SDL_Init(SDL_INIT_VIDEO) < 0)

Archive Download the corresponding diff file

Branches:
master



interactive