Improve glass
[oweals/minetest.git] / src / servermain.cpp
index 6227901e77785846633daa7df071b78ebca14252..64853604b1a8ec64c11de1411005e66dec95a43f 100644 (file)
@@ -74,6 +74,8 @@ with this program; if not, write to the Free Software Foundation, Inc.,
 #include "settings.h"
 #include "profiler.h"
 #include "log.h"
+#include "nodedef.h" // For init_contentfeatures
+#include "content_mapnode.h" // For content_mapnode_init
 
 /*
        Settings.
@@ -86,9 +88,6 @@ Settings *g_settings = &main_settings;
 Profiler main_profiler;
 Profiler *g_profiler = &main_profiler;
 
-// A dummy thing
-ITextureSource *g_texturesource = NULL;
-
 /*
        Debug streams
 */
@@ -117,15 +116,15 @@ u32 getTimeMs()
        return porting::getTimeMs();
 }
 
-class DstreamLogOutput: public ILogOutput
+class StderrLogOutput: public ILogOutput
 {
 public:
        /* line: Full line with timestamp, level and thread */
        void printLog(const std::string &line)
        {
-               dstream<<line<<std::endl;
+               std::cerr<<line<<std::endl;
        }
-} main_dstream_log_out;
+} main_stderr_log_out;
 
 class DstreamNoStderrLogOutput: public ILogOutput
 {
@@ -143,7 +142,7 @@ int main(int argc, char *argv[])
                Initialization
        */
 
-       log_add_output_maxlev(&main_dstream_log_out, LMT_ACTION);
+       log_add_output_maxlev(&main_stderr_log_out, LMT_ACTION);
        log_add_output_all_levs(&main_dstream_no_stderr_log_out);
 
        log_register_thread("main");
@@ -175,7 +174,7 @@ int main(int argc, char *argv[])
 #ifdef RUN_IN_PLACE
        std::string debugfile = DEBUGFILE;
 #else
-       std::string debugfile = porting::path_userdata+"/"+DEBUGFILE;
+       std::string debugfile = porting::path_userdata+DIR_DELIM+DEBUGFILE;
 #endif
        debugstreams_init(disable_stderr, debugfile.c_str());
        // Initialize debug stacks
@@ -245,7 +244,7 @@ int main(int argc, char *argv[])
        }
 
        if(cmd_args.getFlag("info-on-stderr"))
-               log_add_output(&main_dstream_log_out, LMT_INFO);
+               log_add_output(&main_stderr_log_out, LMT_INFO);
 
        /*
                Basic initialization
@@ -279,9 +278,11 @@ int main(int argc, char *argv[])
        else
        {
                core::array<std::string> filenames;
-               filenames.push_back(porting::path_userdata + "/minetest.conf");
+               filenames.push_back(porting::path_userdata +
+                               DIR_DELIM + "minetest.conf");
 #ifdef RUN_IN_PLACE
-               filenames.push_back(porting::path_userdata + "/../minetest.conf");
+               filenames.push_back(porting::path_userdata +
+                               DIR_DELIM + ".." + DIR_DELIM + "minetest.conf");
 #endif
 
                for(u32 i=0; i<filenames.size(); i++)
@@ -301,7 +302,6 @@ int main(int argc, char *argv[])
 
        // Initialize stuff
        
-       init_mapnode();
        init_mineral();
 
        /*
@@ -347,7 +347,7 @@ int main(int argc, char *argv[])
        }
        
        // Figure out path to map
-       std::string map_dir = porting::path_userdata+"/world";
+       std::string map_dir = porting::path_userdata+DIR_DELIM+"world";
        if(cmd_args.exists("map-dir"))
                map_dir = cmd_args.get("map-dir");
        else if(g_settings->exists("map-dir"))