TODO: Merge bahamada's audio stuff (clean patch available)
-TODO: Move content_features to mapnode_content_features.{h,cpp} or so
-
-TODO: Fix item use() stuff; dropping a stack of cooked rats and eating
- it gives 3 hearts and consumes all the rats.
-
Making it more portable:
------------------------
*/
#ifdef NDEBUG
- #ifdef _WIN32
+ /*#ifdef _WIN32
#pragma message ("Disabling unit tests")
#else
#warning "Disabling unit tests"
- #endif
+ #endif*/
// Disable unit tests
#define ENABLE_TESTS 0
#else
#include "settings.h"
#include "profiler.h"
#include "log.h"
-
-// This makes textures
-ITextureSource *g_texturesource = NULL;
+#include "nodedef.h" // For init_contentfeatures
+#include "content_mapnode.h" // For content_mapnode_init
/*
Settings.
// Connection
std::ostream *dout_con_ptr = &dummyout;
std::ostream *derr_con_ptr = &verbosestream;
+//std::ostream *dout_con_ptr = &infostream;
+//std::ostream *derr_con_ptr = &errorstream;
// Server
std::ostream *dout_server_ptr = &infostream;
}
}
-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
{
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");
#endif
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);
porting::signal_handler_init();
bool &kill = *porting::signal_handler_killstatus();
These are needed for unit tests at least.
*/
- // Initial call with g_texturesource not set.
- init_mapnode();
+ // Must be called before texturesource is created
+ // (for texture atlas making)
+ init_mineral();
/*
Run unit tests
if (device == 0)
return 1; // could not create selected driver.
+ /*
+ Continue initialization
+ */
+
+ 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.
+ */
+ //driver->setMinHardwareBufferVertexCount(50);
+
// Set the window caption
device->setWindowCaption(L"Minetest [Main Menu]");
// Create game callback for menus
g_gamecallback = new MainGameCallback(device);
- // Create texture source
- g_texturesource = new TextureSource(device);
-
/*
Speed tests (done after irrlicht is loaded to get timer)
*/
else
input = new RealInputHandler(device, &receiver);
- /*
- Continue initialization
- */
-
- //video::IVideoDriver* driver = device->getVideoDriver();
-
- /*
- This changes the minimum allowed number of vertices in a VBO.
- Default is 500.
- */
- //driver->setMinHardwareBufferVertexCount(50);
-
scene::ISceneManager* smgr = device->getSceneManager();
guienv = device->getGUIEnvironment();
skin->setColor(gui::EGDC_3D_HIGH_LIGHT, video::SColor(255,0,0,0));
skin->setColor(gui::EGDC_3D_SHADOW, video::SColor(255,0,0,0));
- /*
- Preload some textures and stuff
- */
-
- init_mapnode(); // Second call with g_texturesource set
- init_mineral();
-
/*
GUI stuff
*/
menudata.port = narrow_to_wide(itos(port));
menudata.fancy_trees = g_settings->getBool("new_style_leaves");
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.creative_mode = g_settings->getBool("creative_mode");
menudata.enable_damage = g_settings->getBool("enable_damage");
port = newport;
g_settings->set("new_style_leaves", itos(menudata.fancy_trees));
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("creative_mode", itos(menudata.creative_mode));
g_settings->set("enable_damage", itos(menudata.enable_damage));
if(device->run() == false)
break;
- // Initialize mapnode again to enable changed graphics settings
- init_mapnode();
-
/*
Run game
*/