// along with this program; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-#include <assert.h>
-#include <stdio.h>
+#include <cassert>
+#include <cstdio>
#include <iostream>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <errno.h>
+#include <cstdio>
+#include <cstdlib>
+#include <cstring>
+#include <cerrno>
#include <unistd.h>
-#include <SDL.h>
-#include <SDL_image.h>
+
+#include "SDL.h"
+#include "SDL_image.h"
#ifndef NOOPENGL
-#include <SDL_opengl.h>
+#include "SDL_opengl.h"
#endif
#include <sys/stat.h>
#ifndef WIN32
#include <libgen.h>
#endif
-#include <ctype.h>
+
+#include <cctype>
#include "defines.h"
#include "globals.h"
#include "setup.h"
#include "screen/screen.h"
-#include "screen/texture.h"
+#include "screen/surface.h"
#include "menu.h"
#include "gameloop.h"
#include "configfile.h"
options_menu->additem(MN_LABEL,_("Options"),0,0);
options_menu->additem(MN_HL,"",0,0);
#ifndef NOOPENGL
- options_menu->additem(MN_TOGGLE,"OpenGL",use_gl,0, MNID_OPENGL);
+ options_menu->additem(MN_TOGGLE,_("OpenGL "),use_gl,0, MNID_OPENGL);
#else
options_menu->additem(MN_DEACTIVE,_("OpenGL (not supported)"),use_gl, 0, MNID_OPENGL);
#endif
options_menu->additem(MN_DEACTIVE,_("Music "), false,0, MNID_MUSIC);
}
options_menu->additem(MN_TOGGLE,_("Show FPS "),show_fps,0, MNID_SHOWFPS);
- options_menu->additem(MN_GOTO,_("Keyboard Setup"),0,options_keys_menu);
+ options_menu->additem(MN_GOTO,_("Setup Keys"),0,options_keys_menu);
if(use_joystick)
- options_menu->additem(MN_GOTO,_("Joystick Setup"),0,options_joystick_menu);
+ options_menu->additem(MN_GOTO,_("Setup Joystick"),0,options_joystick_menu);
options_menu->additem(MN_HL,"",0,0);
options_menu->additem(MN_BACK,_("Back"),0,0);
- options_keys_menu->additem(MN_LABEL,_("Key Setup"),0,0);
+ options_keys_menu->additem(MN_LABEL,_("Keyboard Setup"),0,0);
options_keys_menu->additem(MN_HL,"",0,0);
options_keys_menu->additem(MN_CONTROLFIELD_KB,_("Left move"), 0,0, 0,&keymap.left);
options_keys_menu->additem(MN_CONTROLFIELD_KB,_("Right move"), 0,0, 0,&keymap.right);
blue_text = new Font(datadir + "/images/fonts/blue.png", Font::TEXT, 16,18,3);
white_text = new Font(datadir + "/images/fonts/white.png",
Font::TEXT, 16,18);
+ gray_text = new Font(datadir + "/images/fonts/gray.png",
+ Font::TEXT, 16,18);
white_small_text = new Font(datadir + "/images/fonts/white-small.png",
Font::TEXT, 8,9, 1);
white_big_text = new Font(datadir + "/images/fonts/white-big.png",
delete main_menu;
delete game_menu;
delete options_menu;
+ delete options_keys_menu;
+ delete options_joystick_menu;
delete highscore_menu;
+ delete contrib_menu;
+ delete contrib_subset_menu;
+ delete worldmap_menu;
delete save_game_menu;
delete load_game_menu;
}
{
fprintf(stderr,
"\nWarning: I could not set up fullscreen video for "
- "640x480 mode.\n"
+ "800x600 mode.\n"
"The Simple DirectMedia error that occured was:\n"
"%s\n\n", SDL_GetError());
use_fullscreen = false;
if (screen == NULL)
{
fprintf(stderr,
- "\nError: I could not set up video for 640x480 mode.\n"
+ "\nError: I could not set up video for 800x600 mode.\n"
"The Simple DirectMedia error that occured was:\n"
"%s\n\n", SDL_GetError());
exit(1);
/* Open joystick: */
if (SDL_NumJoysticks() <= 0)
{
- fprintf(stderr, "Warning: No joysticks are available.\n");
+ fprintf(stderr, "Info: No joysticks were found.\n");
use_joystick = false;
}
if (strcmp(argv[i], "--fullscreen") == 0 ||
strcmp(argv[i], "-f") == 0)
{
- /* Use full screen: */
-
use_fullscreen = true;
}
+ else if (strcmp(argv[i], "--window") == 0 ||
+ strcmp(argv[i], "-w") == 0)
+ {
+ use_fullscreen = false;
+ }
else if (strcmp(argv[i], "--joystick") == 0 || strcmp(argv[i], "-j") == 0)
{
assert(i+1 < argc);
}
else if (strcmp(argv[i], "--help") == 0)
{ /* Show help: */
- puts("Super Tux " VERSION "\n"
- " Please see the file \"README.txt\" for more details.\n");
- printf("Usage: %s [OPTIONS] FILENAME\n\n", argv[0]);
- puts("Display Options:\n"
- " --fullscreen Run in fullscreen mode.\n"
- " --opengl If opengl support was compiled in, this will enable\n"
- " the EXPERIMENTAL OpenGL mode.\n"
- " --sdl Use non-opengl renderer\n"
+ puts(_(" SuperTux " VERSION "\n"
+ " Please see the file \"README.txt\" for more details.\n"));
+ printf(_("Usage: %s [OPTIONS] FILENAME\n\n"), argv[0]);
+ puts(_("Display Options:\n"
+ " -f, --fullscreen Run in fullscreen mode.\n"
+ " -w, --window Run in window mode.\n"
+ " --opengl If OpenGL support was compiled in, this will tell\n"
+ " SuperTux to make use of it.\n"
+ " --sdl Use the SDL software graphical renderer\n"
"\n"
"Sound Options:\n"
" --disable-sound If sound support was compiled in, this will\n"
" options, license and game controls.\n"
" --usage Display a brief message summarizing command-line options.\n"
" --version Display the version of SuperTux you're running.\n\n"
- );
+ ));
exit(0);
}
else if (argv[i][0] != '-')
/* Display the usage message: */
- fprintf(fi, "Usage: %s [--fullscreen] [--opengl] [--disable-sound] [--disable-music] [--debug-mode] | [--usage | --help | --version] [--leveleditor] FILENAME\n",
+ fprintf(fi, _("Usage: %s [--fullscreen] [--opengl] [--disable-sound] [--disable-music] [--debug-mode] | [--usage | --help | --version] [--leveleditor] FILENAME\n"),
prog);
exit(ret);
}
+std::vector<std::string> read_directory(const std::string& pathname)
+{
+ std::vector<std::string> dirnames;
+
+ DIR* dir = opendir(pathname.c_str());
+ if (dir)
+ {
+ struct dirent *direntp;
+
+ while((direntp = readdir(dir)))
+ {
+ dirnames.push_back(direntp->d_name);
+ }
+
+ closedir(dir);
+ }
+
+ return dirnames;
+}
+
+/* EOF */