From 969d2b3eb1f30e257823d9220697e47735be68e3 Mon Sep 17 00:00:00 2001 From: Kahrl Date: Fri, 3 May 2013 23:58:22 +0200 Subject: Optional dependencies and properly handle mod name conflicts again --- doc/lua_api.txt | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'doc') diff --git a/doc/lua_api.txt b/doc/lua_api.txt index 597f98c2c..02ca7cba3 100644 --- a/doc/lua_api.txt +++ b/doc/lua_api.txt @@ -120,6 +120,17 @@ depends.txt: List of mods that have to be loaded before loading this mod. A single line contains a single modname. + Optional dependencies can be defined by appending a question mark + to a single modname. Their meaning is that if the specified mod + is missing, that does not prevent this mod from being loaded. + +optdepends.txt: + An alternative way of specifying optional dependencies. + Like depends.txt, a single line contains a single modname. + + NOTE: This file exists for compatibility purposes only and + support for it will be removed from the engine by the end of 2013. + init.lua: The main Lua script. Running this script should register everything it wants to register. Subsequent execution depends on minetest calling the -- cgit v1.2.3 From 3b1c3ac678157a1b7b7c17769499bec53868c9a9 Mon Sep 17 00:00:00 2001 From: Kahrl Date: Thu, 9 May 2013 15:53:29 +0200 Subject: Add --videomodes option to show available video modes --- doc/minetest.6 | 3 +++ src/main.cpp | 59 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++-- 2 files changed, 60 insertions(+), 2 deletions(-) (limited to 'doc') diff --git a/doc/minetest.6 b/doc/minetest.6 index b3fdd94d9..64dfdd149 100644 --- a/doc/minetest.6 +++ b/doc/minetest.6 @@ -61,6 +61,9 @@ Run dedicated server \-\-speedtests Run speed tests .TP +\-\-videomodes +List available video modes +.TP \-\-info Print more information to console .TP diff --git a/src/main.cpp b/src/main.cpp index f2ff88c0c..b87a3e6d0 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -936,6 +936,8 @@ int main(int argc, char *argv[]) allowed_options.insert(std::make_pair("gameid", ValueSpec(VALUETYPE_STRING, _("Set gameid (\"--gameid list\" prints available ones)")))); #ifndef SERVER + allowed_options.insert(std::make_pair("videomodes", ValueSpec(VALUETYPE_FLAG, + _("Show available video modes")))); allowed_options.insert(std::make_pair("speedtests", ValueSpec(VALUETYPE_FLAG, _("Run speed tests")))); allowed_options.insert(std::make_pair("address", ValueSpec(VALUETYPE_STRING, @@ -1035,7 +1037,7 @@ int main(int argc, char *argv[]) print_worldspecs(worldspecs, dstream); return 0; } - + // Print startup message infostream<(640, 480); + params.Bits = 24; + params.AntiAlias = fsaa; + params.Fullscreen = false; + params.Stencilbuffer = false; + params.Vsync = vsync; + params.EventReceiver = &receiver; + + nulldevice = createDeviceEx(params); + + if(nulldevice == 0) + return 1; + + dstream<<_("Available video modes (WxHxD):")<getVideoModeList(); + + if(videomode_list == 0){ + nulldevice->drop(); + return 1; + } + + s32 videomode_count = videomode_list->getVideoModeCount(); + core::dimension2d videomode_res; + s32 videomode_depth; + for (s32 i = 0; i < videomode_count; ++i){ + videomode_res = videomode_list->getVideoModeResolution(i); + videomode_depth = videomode_list->getVideoModeDepth(i); + dstream<getDesktopResolution(); + videomode_depth = videomode_list->getDesktopDepth(); + dstream<drop(); + + return 0; + } + + /* + Create device and exit if creation failed + */ + IrrlichtDevice *device; SIrrlichtCreationParameters params = SIrrlichtCreationParameters(); -- cgit v1.2.3