diff --git a/AUTHORS b/AUTHORS index 9dcb52601..f5734d181 100644 --- a/AUTHORS +++ b/AUTHORS @@ -1,6 +1,6 @@ VCMI PROJECT CODE CONTRIBUTORS: -Michał Urbańczyk aka Tow, +MichaƂ UrbaƄczyk aka Tow, * project originator; programming, making releases, website maintenance, reverse engineering, general support. diff --git a/client/CMT.cpp b/client/CMT.cpp index 4bf2adfcb..fbd97fa33 100644 --- a/client/CMT.cpp +++ b/client/CMT.cpp @@ -171,14 +171,7 @@ void init() static void prog_version(void) { printf("%s\n", GameConstants::VCMI_VERSION.c_str()); - printf(" game data: %s\n", boost::algorithm::join(VCMIDirs::get().dataPaths(), ":").c_str()); - printf(" libraries: %s\n", VCMIDirs::get().libraryPath().c_str()); - printf(" server: %s\n", VCMIDirs::get().serverPath().c_str()); - printf("\n"); - printf(" user data: %s\n", VCMIDirs::get().userDataPath().c_str()); - printf(" user cache: %s\n", VCMIDirs::get().userCachePath().c_str()); - printf(" user config: %s\n", VCMIDirs::get().userConfigPath().c_str()); - printf(" user saves: %s\n", VCMIDirs::get().userSavePath().c_str()); + std::cout << VCMIDirs::get().genHelpString(); } static void prog_help(const po::options_description &opts) @@ -770,7 +763,7 @@ static void setScreenRes(int w, int h, int bpp, bool fullscreen, bool resetVideo int suggestedBpp = SDL_VideoModeOK(w, h, bpp, SDL_SWSURFACE|(fullscreen?SDL_FULLSCREEN:0)); if(suggestedBpp == 0) { - logGlobal->errorStream() << "Error: SDL says that " << w << "x" << h << " resolution is not available!"; + logGlobal->errorStream() << "Error: SDL says that " << w << "x" << h << " resolution is not available!"; return; } @@ -778,7 +771,7 @@ static void setScreenRes(int w, int h, int bpp, bool fullscreen, bool resetVideo if(suggestedBpp != bpp) { - logGlobal->infoStream() << boost::format("Using %s bpp (bits per pixel) for the video mode. Default or overriden setting was %s bpp.") % suggestedBpp % bpp; + logGlobal->infoStream() << boost::format("Using %s bpp (bits per pixel) for the video mode. Default or overridden setting was %s bpp.") % suggestedBpp % bpp; } //For some reason changing fullscreen via config window checkbox result in SDL_Quit event @@ -791,11 +784,11 @@ static void setScreenRes(int w, int h, int bpp, bool fullscreen, bool resetVideo if((screen = SDL_SetVideoMode(w, h, suggestedBpp, SDL_SWSURFACE|(fullscreen?SDL_FULLSCREEN:0))) == nullptr) { - logGlobal->errorStream() << "Requested screen resolution is not available (" << w << "x" << h << "x" << suggestedBpp << "bpp)"; + logGlobal->errorStream() << "Requested screen resolution is not available (" << w << "x" << h << "x" << suggestedBpp << "bpp)"; throw std::runtime_error("Requested screen resolution is not available\n"); } - logGlobal->infoStream() << "New screen flags: " << screen->flags; + logGlobal->infoStream() << "New screen flags: " << screen->flags; if(screen2) SDL_FreeSurface(screen2); diff --git a/client/icons/vcmiclient.desktop b/client/icons/vcmiclient.desktop index a68269d23..68d446c47 100644 --- a/client/icons/vcmiclient.desktop +++ b/client/icons/vcmiclient.desktop @@ -7,3 +7,4 @@ Icon=vcmiclient Exec=vcmiclient Categories=Game;StrategyGame; Version=1.0 +Keywords=heroes;homm3; diff --git a/launcher/vcmilauncher.desktop b/launcher/vcmilauncher.desktop index ae0a4f993..b916a002d 100644 --- a/launcher/vcmilauncher.desktop +++ b/launcher/vcmilauncher.desktop @@ -7,3 +7,4 @@ Icon=vcmiclient Exec=vcmilauncher Categories=Game;StrategyGame; Version=1.0 +Keywords=heroes;homm3; diff --git a/lib/Connection.cpp b/lib/Connection.cpp index 980728c72..45f423861 100644 --- a/lib/Connection.cpp +++ b/lib/Connection.cpp @@ -389,15 +389,15 @@ void CLoadFile::openNextFile(const std::string &fname, int minimalVersion) if(fileVersion > version) { - logGlobal->warnStream() << boost::format("Warning format version mismatch: found %d when current is %d! (file %s)\n") % fileVersion % version % fname; + logGlobal->warnStream() << boost::format("Warning format version mismatch: found %d when current is %d! (file %s)\n") % fileVersion % version % fname; auto versionptr = (char*)&fileVersion; std::reverse(versionptr, versionptr + 4); - logGlobal->warnStream() << "Version number reversed is " << fileVersion << ", checking..."; + logGlobal->warnStream() << "Version number reversed is " << fileVersion << ", checking..."; if(fileVersion == version) { - logGlobal->warnStream() << fname << " seems to have different endianess! Entering reversing mode."; + logGlobal->warnStream() << fname << " seems to have different endianness! Entering reversing mode."; reverseEndianess = true; } else diff --git a/lib/NetPacksLib.cpp b/lib/NetPacksLib.cpp index 0d1fc0b87..c99215093 100644 --- a/lib/NetPacksLib.cpp +++ b/lib/NetPacksLib.cpp @@ -632,7 +632,7 @@ DLL_LINKAGE const CStackInstance * StackLocation::getStack() { if(!army->hasStackAtSlot(slot)) { - logNetwork->warnStream() << "Warning: " << army->nodeName() << " dont have a stack at slot " << slot; + logNetwork->warnStream() << "Warning: " << army->nodeName() << " don't have a stack at slot " << slot; return nullptr; } return &army->getStack(slot); diff --git a/lib/VCMIDirs.cpp b/lib/VCMIDirs.cpp index afb675c63..699938a00 100644 --- a/lib/VCMIDirs.cpp +++ b/lib/VCMIDirs.cpp @@ -220,3 +220,16 @@ std::vector VCMIDirs::dataPaths() const } #endif + +std::string VCMIDirs::genHelpString() const +{ + return + " game data: " + boost::algorithm::join(dataPaths(), ":") + "\n" + + " libraries: " + libraryPath() + "\n" + + " server: " + serverPath() + "\n" + + "\n" + + " user data: " + userDataPath() + "\n" + + " user cache: " + userCachePath() + "\n" + + " user config: " + userConfigPath() + "\n" + + " user saves: " + userSavePath() + "\n"; +} diff --git a/lib/VCMIDirs.h b/lib/VCMIDirs.h index ab3cdb31e..c3f02c56c 100644 --- a/lib/VCMIDirs.h +++ b/lib/VCMIDirs.h @@ -47,4 +47,6 @@ public: /// Returns system-specific name for dynamic libraries ( StupidAI => "libStupidAI.so" or "StupidAI.dll") std::string libraryName(std::string basename) const; + + std::string genHelpString() const; }; diff --git a/server/CVCMIServer.cpp b/server/CVCMIServer.cpp index a158209e1..e1e47c6f4 100644 --- a/server/CVCMIServer.cpp +++ b/server/CVCMIServer.cpp @@ -533,6 +533,25 @@ static void handleCommandOptions(int argc, char *argv[]) } po::notify(cmdLineOptions); + + if (cmdLineOptions.count("help")) + { + printf("%s - A Heroes of Might and Magic 3 clone\n", GameConstants::VCMI_VERSION.c_str()); + printf("Copyright (C) 2007-2014 VCMI dev team - see AUTHORS file\n"); + printf("This is free software; see the source for copying conditions. There is NO\n"); + printf("warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n"); + printf("\n"); + printf("Usage:\n"); + std::cout << opts; + exit(0); + } + + if (cmdLineOptions.count("version")) + { + printf("%s\n", GameConstants::VCMI_VERSION.c_str()); + std::cout << VCMIDirs::get().genHelpString(); + exit(0); + } } #if defined(__GNUC__) && !defined (__MINGW32__) diff --git a/vcmibuilder b/vcmibuilder index 511b22394..6807e9abe 100755 --- a/vcmibuilder +++ b/vcmibuilder @@ -59,7 +59,7 @@ then echo " " "Requires unzip" echo echo " --convertMP3 " "Convert all mp3 files into ogg/vorbis" - echo " " "Requires ffmpeg" + echo " " "Requires ffmpeg or avconv" echo echo " --download " "Automatically download requied packages using wget" echo " " "Requires wget and Internet connection" @@ -116,7 +116,12 @@ fi if [[ -n "$useffmpeg" ]] then - test_utility "ffmpeg" "-version" + ffmpeg -version > /dev/null 2>&1 && AUDIO_CONV=ffmpeg + avconv -version > /dev/null 2>&1 && AUDIO_CONV=avconv + if [[ -z "$AUDIO_CONV" ]] + then + fail "Error: neither ffmpeg nor avconv were found. Please install it." + fi fi if [[ -n "$cd1_dir" ]] @@ -277,7 +282,7 @@ then do echo "Converting $file" ogg=${file%.*} - ffmpeg -y -i "$file" -acodec libvorbis "$ogg".ogg 2>/dev/null || fail "Error: failed to convert $file to ogg/vorbis using ffmpeg" "rm -f "$ogg".ogg" + $AUDIO_CONV -y -i "$file" -acodec libvorbis "$ogg".ogg 2>/dev/null || fail "Error: failed to convert $file to ogg/vorbis using $AUDIO_CONV" "rm -f "$ogg".ogg" rm -f $file done