Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- diff --git a/src/defaultsettings.cpp b/src/defaultsettings.cpp
- index 333d98c..cc29e28 100644
- --- a/src/defaultsettings.cpp
- +++ b/src/defaultsettings.cpp
- @@ -114,6 +114,8 @@ void set_default_settings(Settings *settings)
- settings->setDefault("bilinear_filter", "false");
- settings->setDefault("trilinear_filter", "false");
- + settings->setDefault("enable_shaders", "0");
- + settings->setDefault("on_demand_item_images", "false");
- // Server stuff
- // "map-dir" doesn't exist by default.
- settings->setDefault("default_game", "minetest");
- diff --git a/src/guiMainMenu.cpp b/src/guiMainMenu.cpp
- index 0bdb44e..abcf943 100644
- --- a/src/guiMainMenu.cpp
- +++ b/src/guiMainMenu.cpp
- @@ -102,6 +102,8 @@ enum
- GUI_ID_ANISOTROPIC_CB,
- GUI_ID_BILINEAR_CB,
- GUI_ID_TRILINEAR_CB,
- + GUI_ID_SHADERS_CB,
- + GUI_ID_ON_DEMAND_ITEM_IMAGES_CB,
- GUI_ID_DAMAGE_CB,
- GUI_ID_CREATIVE_CB,
- GUI_ID_JOIN_GAME_BUTTON,
- @@ -616,6 +618,21 @@ void GUIMainMenu::regenerateGui(v2u32 screensize)
- GUI_ID_TRILINEAR_CB, wgettext("Tri-Linear Filtering"));
- }
- + // shader/on demand image loading settings
- + {
- + core::rect<s32> rect(0, 0, option_w+20, 30);
- + rect += m_topleft_client + v2s32(option_x+175*2, option_y);
- + Environment->addCheckBox(m_data->enable_shaders, rect, this,
- + GUI_ID_SHADERS_CB, wgettext("Shaders"));
- + }
- +
- + {
- + core::rect<s32> rect(0, 0, option_w+20, 30);
- + rect += m_topleft_client + v2s32(option_x+175*2, option_y+20);
- + Environment->addCheckBox(m_data->on_demand_item_images, rect, this,
- + GUI_ID_ON_DEMAND_ITEM_IMAGES_CB, wgettext("On-demand item images"));
- + }
- +
- // Key change button
- {
- core::rect<s32> rect(0, 0, 120, 30);
- @@ -821,6 +838,18 @@ void GUIMainMenu::readInput(MainMenuData *dst)
- }
- {
- + gui::IGUIElement *e = getElementFromId(GUI_ID_BILINEAR_CB);
- + if(e != NULL && e->getType() == gui::EGUIET_CHECK_BOX)
- + dst->enable_shaders = ((gui::IGUICheckBox*)e)->isChecked() ? 2 : 0;
- + }
- +
- + {
- + gui::IGUIElement *e = getElementFromId(GUI_ID_TRILINEAR_CB);
- + if(e != NULL && e->getType() == gui::EGUIET_CHECK_BOX)
- + dst->on_demand_item_images = ((gui::IGUICheckBox*)e)->isChecked();
- + }
- +
- + {
- gui::IGUIElement *e = getElementFromId(GUI_ID_WORLD_LISTBOX);
- if(e != NULL && e->getType() == gui::EGUIET_LIST_BOX)
- dst->selected_world = ((gui::IGUIListBox*)e)->getSelected();
- diff --git a/src/guiMainMenu.h b/src/guiMainMenu.h
- index abfc6bd..41eaee8 100644
- --- a/src/guiMainMenu.h
- +++ b/src/guiMainMenu.h
- @@ -45,6 +45,8 @@ struct MainMenuData
- bool anisotropic_filter;
- bool bilinear_filter;
- bool trilinear_filter;
- + int enable_shaders;
- + bool on_demand_item_images;
- // Server options
- bool creative_mode;
- bool enable_damage;
- diff --git a/src/main.cpp b/src/main.cpp
- index dcc47cd..dce4025 100644
- --- a/src/main.cpp
- +++ b/src/main.cpp
- @@ -1440,6 +1440,8 @@ int main(int argc, char *argv[])
- 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.on_demand_item_images = g_settings->getBool("on_demand_item_images");
- 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");
- @@ -1560,6 +1562,9 @@ int main(int argc, char *argv[])
- 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("on_demand_item_images", itos(menudata.on_demand_item_images));
- +
- g_settings->set("creative_mode", itos(menudata.creative_mode));
- g_settings->set("enable_damage", itos(menudata.enable_damage));
- g_settings->set("name", playername);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement