X-Git-Url: https://git.librecmc.org/?a=blobdiff_plain;f=src%2Fmain.cpp;h=ede9f63b06477308d091263809190ade2e934259;hb=8eb717d4d0d4131eb5b82a73b343c7309b1ebf47;hp=c1ed70fafc2886adbd58fd2273cfe259307d858a;hpb=42323014eaf359f76b388e75e788486bb0bda280;p=oweals%2Fminetest.git diff --git a/src/main.cpp b/src/main.cpp index c1ed70faf..ede9f63b0 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -3,16 +3,16 @@ Minetest-c55 Copyright (C) 2010-2011 celeron55, Perttu Ahola This program is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or +it under the terms of the GNU Lesser General Public License as published by +the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. +GNU Lesser General Public License for more details. -You should have received a copy of the GNU General Public License along +You should have received a copy of the GNU Lesser General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ @@ -47,7 +47,7 @@ with this program; if not, write to the Free Software Foundation, Inc., #include #include #include -#include "common_irrlicht.h" +#include "irrlichttypes_extrabloated.h" #include "debug.h" #include "test.h" #include "server.h" @@ -68,7 +68,7 @@ with this program; if not, write to the Free Software Foundation, Inc., #include "profiler.h" #include "log.h" #include "mods.h" -#include "utility_string.h" +#include "util/string.h" #include "subgame.h" #include "quicktune.h" @@ -778,46 +778,46 @@ int main(int argc, char *argv[]) // List all allowed options core::map allowed_options; allowed_options.insert("help", ValueSpec(VALUETYPE_FLAG, - "Show allowed options")); + _("Show allowed options"))); allowed_options.insert("config", ValueSpec(VALUETYPE_STRING, - "Load configuration from specified file")); + _("Load configuration from specified file"))); allowed_options.insert("port", ValueSpec(VALUETYPE_STRING, - "Set network port (UDP)")); + _("Set network port (UDP)"))); allowed_options.insert("disable-unittests", ValueSpec(VALUETYPE_FLAG, - "Disable unit tests")); + _("Disable unit tests"))); allowed_options.insert("enable-unittests", ValueSpec(VALUETYPE_FLAG, - "Enable unit tests")); + _("Enable unit tests"))); allowed_options.insert("map-dir", ValueSpec(VALUETYPE_STRING, - "Same as --world (deprecated)")); + _("Same as --world (deprecated)"))); allowed_options.insert("world", ValueSpec(VALUETYPE_STRING, - "Set world path (implies local game)")); + _("Set world path (implies local game) ('list' lists all)"))); allowed_options.insert("worldname", ValueSpec(VALUETYPE_STRING, - "Set world by name (implies local game)")); + _("Set world by name (implies local game)"))); allowed_options.insert("info", ValueSpec(VALUETYPE_FLAG, - "Print more information to console")); + _("Print more information to console"))); allowed_options.insert("verbose", ValueSpec(VALUETYPE_FLAG, - "Print even more information to console")); + _("Print even more information to console"))); allowed_options.insert("trace", ValueSpec(VALUETYPE_FLAG, - "Print enormous amounts of information to log and console")); + _("Print enormous amounts of information to log and console"))); allowed_options.insert("logfile", ValueSpec(VALUETYPE_STRING, - "Set logfile path ('' = no logging)")); + _("Set logfile path ('' = no logging)"))); allowed_options.insert("gameid", ValueSpec(VALUETYPE_STRING, - "Set gameid (\"--gameid list\" prints available ones)")); + _("Set gameid (\"--gameid list\" prints available ones)"))); #ifndef SERVER allowed_options.insert("speedtests", ValueSpec(VALUETYPE_FLAG, - "Run speed tests")); + _("Run speed tests"))); allowed_options.insert("address", ValueSpec(VALUETYPE_STRING, - "Address to connect to. ('' = local game)")); + _("Address to connect to. ('' = local game)"))); allowed_options.insert("random-input", ValueSpec(VALUETYPE_FLAG, - "Enable random user input, for testing")); + _("Enable random user input, for testing"))); allowed_options.insert("server", ValueSpec(VALUETYPE_FLAG, - "Run dedicated server")); + _("Run dedicated server"))); allowed_options.insert("name", ValueSpec(VALUETYPE_STRING, - "Set player name")); + _("Set player name"))); allowed_options.insert("password", ValueSpec(VALUETYPE_STRING, - "Set password")); + _("Set password"))); allowed_options.insert("go", ValueSpec(VALUETYPE_FLAG, - "Disable main menu")); + _("Disable main menu"))); #endif Settings cmd_args; @@ -826,7 +826,7 @@ int main(int argc, char *argv[]) if(ret == false || cmd_args.getFlag("help") || cmd_args.exists("nonopt1")) { - dstream<<"Allowed options:"<::Iterator i = allowed_options.getIterator(); i.atEnd() == false; i++) @@ -836,7 +836,7 @@ int main(int argc, char *argv[]) if(i.getNode()->getValue().type == VALUETYPE_FLAG) {} else - os1<<" "; + os1<<_(" "); dstream<getValue().help != NULL) @@ -853,9 +853,10 @@ int main(int argc, char *argv[]) // If trace is enabled, enable logging of certain things if(cmd_args.getFlag("trace")){ - dstream<<"Enabling trace level debug output"< worldspecs = getAvailableWorlds(); + print_worldspecs(worldspecs, dstream); + return 0; + } + // Print startup message infostream< worldmt.size() && commanded_world.substr(commanded_world.size()-worldmt.size()) == worldmt){ - dstream<<"Supplied world.mt file - stripping it off."< worldspecs = getAvailableWorlds(); + bool found = false; + for(u32 i=0; i worldspecs = getAvailableWorlds(); - world_path = ""; - for(u32 i=0; i 1){ - dstream<<"Multiple worlds are available."<" - <<" or --world "<" + " or --world ")<get("name"); if(cmd_args.exists("name")) @@ -1278,9 +1292,6 @@ int main(int argc, char *argv[]) video::IVideoDriver* driver = device->getVideoDriver(); - // Disable mipmaps (because some of them look ugly) - driver->setTextureCreationFlag(video::ETCF_CREATE_MIP_MAPS, false); - /* This changes the minimum allowed number of vertices in a VBO. Default is 500. @@ -1338,7 +1349,13 @@ int main(int argc, char *argv[]) skin->setColor(gui::EGDC_3D_SHADOW, video::SColor(255,0,0,0)); skin->setColor(gui::EGDC_HIGH_LIGHT, video::SColor(255,70,100,50)); skin->setColor(gui::EGDC_HIGH_LIGHT_TEXT, video::SColor(255,255,255,255)); - + +#if (IRRLICHT_VERSION_MAJOR >= 1 && IRRLICHT_VERSION_MINOR >= 8) || IRRLICHT_VERSION_MAJOR >= 2 + // Irrlicht 1.8 input colours + skin->setColor(gui::EGDC_EDITABLE, video::SColor(255,128,128,128)); + skin->setColor(gui::EGDC_FOCUSED_EDITABLE, video::SColor(255,96,134,49)); +#endif + /* GUI stuff */ @@ -1363,7 +1380,7 @@ int main(int argc, char *argv[]) while(device->run() && kill == false) { // Set the window caption - device->setWindowCaption(L"Minetest [Main Menu]"); + device->setWindowCaption((std::wstring(L"Minetest [")+wgettext("Main Menu")+L"]").c_str()); // This is used for catching disconnects try @@ -1425,6 +1442,13 @@ int main(int argc, char *argv[]) menudata.smooth_lighting = g_settings->getBool("smooth_lighting"); menudata.clouds_3d = g_settings->getBool("enable_3d_clouds"); menudata.opaque_water = g_settings->getBool("opaque_water"); + menudata.mip_map = g_settings->getBool("mip_map"); + menudata.anisotropic_filter = g_settings->getBool("anisotropic_filter"); + menudata.bilinear_filter = g_settings->getBool("bilinear_filter"); + menudata.trilinear_filter = g_settings->getBool("trilinear_filter"); + menudata.enable_shaders = g_settings->getS32("enable_shaders"); + menudata.preload_item_visuals = g_settings->getBool("preload_item_visuals"); + driver->setTextureCreationFlag(video::ETCF_CREATE_MIP_MAPS, menudata.mip_map); menudata.creative_mode = g_settings->getBool("creative_mode"); menudata.enable_damage = g_settings->getBool("enable_damage"); // Default to selecting nothing @@ -1448,7 +1472,7 @@ int main(int argc, char *argv[]) // If a world was commanded, append and select it if(commanded_world != ""){ std::string gameid = getWorldGameId(commanded_world, true); - std::string name = "[--world parameter]"; + std::string name = _("[--world parameter]"); if(gameid == ""){ gameid = g_settings->get("default_game"); name += " [new]"; @@ -1538,6 +1562,15 @@ int main(int argc, char *argv[]) g_settings->set("smooth_lighting", itos(menudata.smooth_lighting)); g_settings->set("enable_3d_clouds", itos(menudata.clouds_3d)); g_settings->set("opaque_water", itos(menudata.opaque_water)); + + g_settings->set("mip_map", itos(menudata.mip_map)); + g_settings->set("anisotropic_filter", itos(menudata.anisotropic_filter)); + g_settings->set("bilinear_filter", itos(menudata.bilinear_filter)); + g_settings->set("trilinear_filter", itos(menudata.trilinear_filter)); + + g_settings->setS32("enable_shaders", menudata.enable_shaders); + g_settings->set("preload_item_visuals", itos(menudata.preload_item_visuals)); + g_settings->set("creative_mode", itos(menudata.creative_mode)); g_settings->set("enable_damage", itos(menudata.enable_damage)); g_settings->set("name", playername); @@ -1585,7 +1618,7 @@ int main(int argc, char *argv[]) + wide_to_narrow(menudata.create_world_name); // Create world if it doesn't exist if(!initializeWorld(path, menudata.create_world_gameid)){ - error_message = L"Failed to initialize world"; + error_message = wgettext("Failed to initialize world"); errorstream<