Advertisement
Guest User

Untitled

a guest
Oct 14th, 2012
97
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Diff 5.90 KB | None | 0 0
  1. diff -ru minetest-orig/src/defaultsettings.cpp minetest/src/defaultsettings.cpp
  2. --- minetest-orig/src/defaultsettings.cpp   2012-10-14 02:55:49.525876499 -0400
  3. +++ minetest/src/defaultsettings.cpp    2012-10-14 07:04:09.214197587 -0400
  4. @@ -142,10 +142,5 @@
  5.     settings->setDefault("full_block_send_enable_min_time_from_building", "2.0");
  6.     settings->setDefault("dedicated_server_step", "0.05");
  7.     settings->setDefault("ignore_world_load_errors", "false");
  8. -
  9. -   settings->setDefault("mip_map", "false");
  10. -   settings->setDefault("anisotropic_filter", "false");
  11. -   settings->setDefault("bilinear_filter", "false");
  12. -   settings->setDefault("trilinear_filter", "false");
  13.  }
  14.  
  15. diff -ru minetest-orig/src/guiMainMenu.cpp minetest/src/guiMainMenu.cpp
  16. --- minetest-orig/src/guiMainMenu.cpp   2012-10-14 02:48:20.941866830 -0400
  17. +++ minetest/src/guiMainMenu.cpp    2012-10-14 06:46:43.438175053 -0400
  18. @@ -98,6 +98,10 @@
  19.     GUI_ID_SMOOTH_LIGHTING_CB,
  20.     GUI_ID_3D_CLOUDS_CB,
  21.     GUI_ID_OPAQUE_WATER_CB,
  22. +   GUI_ID_MIPMAP_CB,
  23. +   GUI_ID_ANISOTROPIC_CB,
  24. +   GUI_ID_BILINEAR_CB,
  25. +   GUI_ID_TRILINEAR_CB,
  26.     GUI_ID_DAMAGE_CB,
  27.     GUI_ID_CREATIVE_CB,
  28.     GUI_ID_JOIN_GAME_BUTTON,
  29. @@ -580,6 +584,38 @@
  30.             Environment->addCheckBox(m_data->opaque_water, rect, this,
  31.                     GUI_ID_OPAQUE_WATER_CB, wgettext("Opaque water"));
  32.         }
  33. +
  34. +
  35. +       // Anisotropic/mipmap/bi-/trilinear settings
  36. +
  37. +       {
  38. +           core::rect<s32> rect(0, 0, option_w+20, 30);
  39. +           rect += m_topleft_client + v2s32(option_x+175, option_y);
  40. +           Environment->addCheckBox(m_data->mip_map, rect, this,
  41. +                      GUI_ID_MIPMAP_CB, wgettext("Mip-Mapping"));
  42. +       }
  43. +
  44. +       {
  45. +           core::rect<s32> rect(0, 0, option_w+20, 30);
  46. +           rect += m_topleft_client + v2s32(option_x+175, option_y+20);
  47. +           Environment->addCheckBox(m_data->anisotropic_filter, rect, this,
  48. +                      GUI_ID_ANISOTROPIC_CB, wgettext("Anisotropic Filtering"));
  49. +       }
  50. +
  51. +       {
  52. +           core::rect<s32> rect(0, 0, option_w+20, 30);
  53. +           rect += m_topleft_client + v2s32(option_x+175, option_y+20*2);
  54. +           Environment->addCheckBox(m_data->bilinear_filter, rect, this,
  55. +                      GUI_ID_BILINEAR_CB, wgettext("Bi-Linear Filtering"));
  56. +       }
  57. +
  58. +       {
  59. +           core::rect<s32> rect(0, 0, option_w+20, 30);
  60. +           rect += m_topleft_client + v2s32(option_x+175, option_y+20*3);
  61. +           Environment->addCheckBox(m_data->trilinear_filter, rect, this,
  62. +                      GUI_ID_TRILINEAR_CB, wgettext("Tri-Linear Filtering"));
  63. +       }
  64. +
  65.         // Key change button
  66.         {
  67.             core::rect<s32> rect(0, 0, 120, 30);
  68. @@ -761,6 +797,30 @@
  69.     }
  70.  
  71.     {
  72. +       gui::IGUIElement *e = getElementFromId(GUI_ID_MIPMAP_CB);
  73. +       if(e != NULL && e->getType() == gui::EGUIET_CHECK_BOX)
  74. +           dst->mip_map = ((gui::IGUICheckBox*)e)->isChecked();
  75. +   }
  76. +
  77. +   {
  78. +       gui::IGUIElement *e = getElementFromId(GUI_ID_ANISOTROPIC_CB);
  79. +       if(e != NULL && e->getType() == gui::EGUIET_CHECK_BOX)
  80. +           dst->anisotropic_filter = ((gui::IGUICheckBox*)e)->isChecked();
  81. +   }
  82. +
  83. +   {
  84. +       gui::IGUIElement *e = getElementFromId(GUI_ID_BILINEAR_CB);
  85. +       if(e != NULL && e->getType() == gui::EGUIET_CHECK_BOX)
  86. +           dst->bilinear_filter = ((gui::IGUICheckBox*)e)->isChecked();
  87. +   }
  88. +
  89. +   {
  90. +       gui::IGUIElement *e = getElementFromId(GUI_ID_TRILINEAR_CB);
  91. +       if(e != NULL && e->getType() == gui::EGUIET_CHECK_BOX)
  92. +           dst->trilinear_filter = ((gui::IGUICheckBox*)e)->isChecked();
  93. +   }
  94. +
  95. +   {
  96.         gui::IGUIElement *e = getElementFromId(GUI_ID_WORLD_LISTBOX);
  97.         if(e != NULL && e->getType() == gui::EGUIET_LIST_BOX)
  98.             dst->selected_world = ((gui::IGUIListBox*)e)->getSelected();
  99. diff -ru minetest-orig/src/guiMainMenu.h minetest/src/guiMainMenu.h
  100. --- minetest-orig/src/guiMainMenu.h 2012-10-14 02:48:20.941866830 -0400
  101. +++ minetest/src/guiMainMenu.h  2012-10-14 06:46:40.334174988 -0400
  102. @@ -41,6 +41,10 @@
  103.     bool smooth_lighting;
  104.     bool clouds_3d;
  105.     bool opaque_water;
  106. +   bool mip_map;
  107. +   bool anisotropic_filter;
  108. +   bool bilinear_filter;
  109. +   bool trilinear_filter;
  110.     // Server options
  111.     bool creative_mode;
  112.     bool enable_damage;
  113. diff -ru minetest-orig/src/main.cpp minetest/src/main.cpp
  114. --- minetest-orig/src/main.cpp  2012-10-14 02:53:45.365873821 -0400
  115. +++ minetest/src/main.cpp   2012-10-14 06:57:40.934189222 -0400
  116. @@ -1292,11 +1292,6 @@
  117.  
  118.     video::IVideoDriver* driver = device->getVideoDriver();
  119.  
  120. -   // Allow user to set mip-mapping by config file
  121. -   // (see also, clientmap.cpp line 548)
  122. -
  123. -   driver->setTextureCreationFlag(video::ETCF_CREATE_MIP_MAPS, g_settings->getBool("mip_map"));
  124. -
  125.     /*
  126.         This changes the minimum allowed number of vertices in a VBO.
  127.         Default is 500.
  128. @@ -1441,6 +1436,11 @@
  129.                 menudata.smooth_lighting = g_settings->getBool("smooth_lighting");
  130.                 menudata.clouds_3d = g_settings->getBool("enable_3d_clouds");
  131.                 menudata.opaque_water = g_settings->getBool("opaque_water");
  132. +               menudata.mip_map = g_settings->getBool("mip_map");
  133. +               menudata.anisotropic_filter = g_settings->getBool("anisotropic_filter");
  134. +               menudata.bilinear_filter = g_settings->getBool("bilinear_filter");
  135. +               menudata.trilinear_filter = g_settings->getBool("trilinear_filter");
  136. +               driver->setTextureCreationFlag(video::ETCF_CREATE_MIP_MAPS, menudata.mip_map);
  137.                 menudata.creative_mode = g_settings->getBool("creative_mode");
  138.                 menudata.enable_damage = g_settings->getBool("enable_damage");
  139.                 // Default to selecting nothing
  140. @@ -1554,6 +1554,12 @@
  141.                 g_settings->set("smooth_lighting", itos(menudata.smooth_lighting));
  142.                 g_settings->set("enable_3d_clouds", itos(menudata.clouds_3d));
  143.                 g_settings->set("opaque_water", itos(menudata.opaque_water));
  144. +
  145. +               g_settings->set("mip_map", itos(menudata.mip_map));
  146. +               g_settings->set("anisotropic_filter", itos(menudata.anisotropic_filter));
  147. +               g_settings->set("bilinear_filter", itos(menudata.bilinear_filter));
  148. +               g_settings->set("trilinear_filter", itos(menudata.trilinear_filter));
  149. +
  150.                 g_settings->set("creative_mode", itos(menudata.creative_mode));
  151.                 g_settings->set("enable_damage", itos(menudata.enable_damage));
  152.                 g_settings->set("name", playername);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement