aboutsummaryrefslogtreecommitdiff
path: root/games/minimal
Commit message (Collapse)AuthorAge
* Fix relief mapping issuesRealBadAngel2015-07-16
|
* Minimal: Remove recently added unnecessary nodesparamat2015-07-14
| | | | Fix 'is ground content' for some nodes
* Simpler patch for saplings trying to grow on unknown nodesShadowNinja2015-06-16
|
* Add list-ringsest312015-06-16
| | | | | | | Adds list-rings, a method to implement item sending between inventories via shift-click. Nice insider feature: a ring consisting of a single inventory list serves as nice clean-up method. Also adds them to minimal game, and the standard inventory. Craft output slots are not supported.
* Don't crash when saplings try to grow on unknown nodesy.st2015-06-15
|
* Minimal: Add snow biome and jungleleaves nodes. Add mapgen aliasesparamat2015-06-12
| | | | Treegen: Remove alias checks from jungletree generation for speed
* Minimal: Edit mapgen aliases. Use blob ore for clay, update other ores. ↵paramat2015-06-09
| | | | Update simple biomes. Cleanup code
* Fix NDT_GLASSLIKE normalsKahrl2015-01-31
| | | | Remove inventorycube() workaround for default:glass in minimal game
* Remove builtin_biome.lua from builtin and add simple biome minimalparamat2015-01-11
|
* Add lua exception handling test codesapier2014-08-23
| | | | Catch some error situations when mod used without thinking about it
* Minimal game: add /dummyball <count> commandKahrl2014-08-23
|
* Add minetest.swap_nodeNovatux2013-11-30
|
* Change default value of is_ground_content to truekwolekr2013-11-30
| | | | Most modders would otherwise forget to explicitly define this, and generated nodes aliased from mods would wall-off caves
* Fix possible crash with grass ABM.Novatux2013-11-02
|
* Fix grass adding/removing ABM.Novatux2013-11-02
|
* Move the sapling growing and grass adding/removing ABMs to LuaNovatux2013-11-02
|
* Remove mapgen_air alias (#935)0gb.us2013-10-05
|
* Add mapgen_stair_cobble alias to minimalSfan52013-09-06
|
* Add support for different drowning damage and allow drowning in other nodetypesBlockMen2013-08-06
|
* Add drowningPilzAdam2013-06-19
|
* Compress texturesDavid Gumberg2013-06-18
|
* Move scriptapi to separate folder (by sapier)sapier2013-05-25
| | | | | | | | | | | On the lua side, notably minetest.env:<function>(<args>) should now be replaced by minetest.<function>(<args>). The old way is and will stay supported for a long time. Also: Update and clean up lua_api.txt (by celeron55) Move EnvRef to lua and remove add_rat and add_firefly (by kahrl) Add separate src/util/CMakeLists.txt, other minor fixes (by kahrl)
* Use the group "soil" for nodes that saplings grow onShadowNinja2013-05-20
|
* games/minimal: Add menu/background.png and menu/icon.pngPerttu Ahola2013-05-02
|
* Add Mapgen V7, reorganize biomeskwolekr2013-04-07
|
* unkn own block -> unkn own nodekhonkhortisan2013-04-05
|
* Add different place sound for nodesPilzAdam2013-03-29
|
* Use minetest.register_ore() in minimalPilzAdam2013-03-24
|
* Mapgen indev: float islands, larger far biomesproller2013-03-24
|
* Liquid fine tuningproller2013-03-14
|
* new adjustable finite liquidproller2013-02-24
|
* Readded and optimized mapgen V6kwolekr2013-01-21
|
* Add initial Lua biomedef support, fixed biome selectionkwolekr2013-01-21
|
* Add the group attached_nodePilzAdam2012-12-01
| | | | Nodes in this group will be dropped as items if the node under them or the node in the wallmounted direction is not walkable.
* Swap out pixel-perfect nyan cat by request of Chris TorresPerttu Ahola2012-11-09
|
* Add functions to the default mod of minimal game to support old codePilzAdam2012-11-01
|
* Move falling to builtinPilzAdam2012-10-31
|
* Fix crash when furnace is full (minimal game)Perttu Ahola2012-08-12
|
* Deprecate minetest.add_to_creative_inventory and use group ↵Perttu Ahola2012-07-25
| | | | not_in_creative_inventory instead
* Add notice in the minimal gamePerttu Ahola2012-07-25
|
* Improve inventory callbacks a bitPerttu Ahola2012-07-25
|
* Detached inventory callbacks and reworked node metadata callbacksPerttu Ahola2012-07-25
|
* Detached inventoriesPerttu Ahola2012-07-24
|
* Add node timer test in minimal/experimentalPerttu Ahola2012-07-24
|
* Move /give, /giveme, /spawnentity and /pulverize to builtin/chatcommands.luaPerttu Ahola2012-07-23
|
* Formspec button_exit[] and image_button_exit[]Perttu Ahola2012-07-22
|
* Add /test1 command to minimal for testing a more complicated player ↵Perttu Ahola2012-07-22
| | | | inventory form
* Implement formspecdarkrose2012-07-22
|
* Actually fix facedir-rotated nodes placed using minetest.env:place_node()Perttu Ahola2012-07-21
|
* Make lava buckets work as fuel in minimal gamedarkrose2012-07-21
|
r point of drawing in the noise v2s16 center_of_drawing_in_noise_i( std::floor(center_of_drawing_in_noise_f.X / cloud_size), std::floor(center_of_drawing_in_noise_f.Y / cloud_size) ); // The world position of the integer center point of drawing in the noise v2f world_center_of_drawing_in_noise_f = v2f( center_of_drawing_in_noise_i.X * cloud_size, center_of_drawing_in_noise_i.Y * cloud_size ) + m_origin; /*video::SColor c_top(128,b*240,b*240,b*255); video::SColor c_side_1(128,b*230,b*230,b*255); video::SColor c_side_2(128,b*220,b*220,b*245); video::SColor c_bottom(128,b*205,b*205,b*230);*/ video::SColorf c_top_f(m_color); video::SColorf c_side_1_f(m_color); video::SColorf c_side_2_f(m_color); video::SColorf c_bottom_f(m_color); c_side_1_f.r *= 0.95; c_side_1_f.g *= 0.95; c_side_1_f.b *= 0.95; c_side_2_f.r *= 0.90; c_side_2_f.g *= 0.90; c_side_2_f.b *= 0.90; c_bottom_f.r *= 0.80; c_bottom_f.g *= 0.80; c_bottom_f.b *= 0.80; video::SColor c_top = c_top_f.toSColor(); video::SColor c_side_1 = c_side_1_f.toSColor(); video::SColor c_side_2 = c_side_2_f.toSColor(); video::SColor c_bottom = c_bottom_f.toSColor(); // Get fog parameters for setting them back later video::SColor fog_color(0,0,0,0); video::E_FOG_TYPE fog_type = video::EFT_FOG_LINEAR; f32 fog_start = 0; f32 fog_end = 0; f32 fog_density = 0; bool fog_pixelfog = false; bool fog_rangefog = false; driver->getFog(fog_color, fog_type, fog_start, fog_end, fog_density, fog_pixelfog, fog_rangefog); // Set our own fog driver->setFog(fog_color, fog_type, cloud_full_radius * 0.5, cloud_full_radius*1.2, fog_density, fog_pixelfog, fog_rangefog); // Read noise bool *grid = new bool[m_cloud_radius_i * 2 * m_cloud_radius_i * 2]; for(s16 zi = -m_cloud_radius_i; zi < m_cloud_radius_i; zi++) { u32 si = (zi + m_cloud_radius_i) * m_cloud_radius_i * 2 + m_cloud_radius_i; for (s16 xi = -m_cloud_radius_i; xi < m_cloud_radius_i; xi++) { u32 i = si + xi; grid[i] = gridFilled( xi + center_of_drawing_in_noise_i.X, zi + center_of_drawing_in_noise_i.Y ); } } #define GETINDEX(x, z, radius) (((z)+(radius))*(radius)*2 + (x)+(radius)) #define INAREA(x, z, radius) \ ((x) >= -(radius) && (x) < (radius) && (z) >= -(radius) && (z) < (radius)) for (s16 zi0= -m_cloud_radius_i; zi0 < m_cloud_radius_i; zi0++) for (s16 xi0= -m_cloud_radius_i; xi0 < m_cloud_radius_i; xi0++) { s16 zi = zi0; s16 xi = xi0; // Draw from front to back (needed for transparency) /*if(zi <= 0) zi = -m_cloud_radius_i - zi; if(xi <= 0) xi = -m_cloud_radius_i - xi;*/ // Draw from back to front if(zi >= 0) zi = m_cloud_radius_i - zi - 1; if(xi >= 0) xi = m_cloud_radius_i - xi - 1; u32 i = GETINDEX(xi, zi, m_cloud_radius_i); if (!grid[i]) continue; v2f p0 = v2f(xi,zi)*cloud_size + world_center_of_drawing_in_noise_f; video::S3DVertex v[4] = { video::S3DVertex(0,0,0, 0,0,0, c_top, 0, 1), video::S3DVertex(0,0,0, 0,0,0, c_top, 1, 1), video::S3DVertex(0,0,0, 0,0,0, c_top, 1, 0), video::S3DVertex(0,0,0, 0,0,0, c_top, 0, 0) }; /*if(zi <= 0 && xi <= 0){ v[0].Color.setBlue(255); v[1].Color.setBlue(255); v[2].Color.setBlue(255); v[3].Color.setBlue(255); }*/ f32 rx = cloud_size / 2.0f; // if clouds are flat, the top layer should be at the given height f32 ry = m_enable_3d ? m_params.thickness * BS : 0.0f; f32 rz = cloud_size / 2; for(int i=0; i<num_faces_to_draw; i++) { switch(i) { case 0: // top for (video::S3DVertex &vertex : v) { vertex.Normal.set(0,1,0); } v[0].Pos.set(-rx, ry,-rz); v[1].Pos.set(-rx, ry, rz); v[2].Pos.set( rx, ry, rz); v[3].Pos.set( rx, ry,-rz); break; case 1: // back if (INAREA(xi, zi - 1, m_cloud_radius_i)) { u32 j = GETINDEX(xi, zi - 1, m_cloud_radius_i); if(grid[j]) continue; } for (video::S3DVertex &vertex : v) { vertex.Color = c_side_1; vertex.Normal.set(0,0,-1); } v[0].Pos.set(-rx, ry,-rz); v[1].Pos.set( rx, ry,-rz); v[2].Pos.set( rx, 0,-rz); v[3].Pos.set(-rx, 0,-rz); break; case 2: //right if (INAREA(xi + 1, zi, m_cloud_radius_i)) { u32 j = GETINDEX(xi+1, zi, m_cloud_radius_i); if(grid[j]) continue; } for (video::S3DVertex &vertex : v) { vertex.Color = c_side_2; vertex.Normal.set(1,0,0); } v[0].Pos.set( rx, ry,-rz); v[1].Pos.set( rx, ry, rz); v[2].Pos.set( rx, 0, rz); v[3].Pos.set( rx, 0,-rz); break; case 3: // front if (INAREA(xi, zi + 1, m_cloud_radius_i)) { u32 j = GETINDEX(xi, zi + 1, m_cloud_radius_i); if(grid[j]) continue; } for (video::S3DVertex &vertex : v) { vertex.Color = c_side_1; vertex.Normal.set(0,0,-1); } v[0].Pos.set( rx, ry, rz); v[1].Pos.set(-rx, ry, rz); v[2].Pos.set(-rx, 0, rz); v[3].Pos.set( rx, 0, rz); break; case 4: // left if (INAREA(xi-1, zi, m_cloud_radius_i)) { u32 j = GETINDEX(xi-1, zi, m_cloud_radius_i); if(grid[j]) continue; } for (video::S3DVertex &vertex : v) { vertex.Color = c_side_2; vertex.Normal.set(-1,0,0); } v[0].Pos.set(-rx, ry, rz); v[1].Pos.set(-rx, ry,-rz); v[2].Pos.set(-rx, 0,-rz); v[3].Pos.set(-rx, 0, rz); break; case 5: // bottom for (video::S3DVertex &vertex : v) { vertex.Color = c_bottom; vertex.Normal.set(0,-1,0); } v[0].Pos.set( rx, 0, rz); v[1].Pos.set(-rx, 0, rz); v[2].Pos.set(-rx, 0,-rz); v[3].Pos.set( rx, 0,-rz); break; } v3f pos(p0.X, m_params.height * BS, p0.Y); pos -= intToFloat(m_camera_offset, BS); for (video::S3DVertex &vertex : v) vertex.Pos += pos; u16 indices[] = {0,1,2,2,3,0}; driver->drawVertexPrimitiveList(v, 4, indices, 2, video::EVT_STANDARD, scene::EPT_TRIANGLES, video::EIT_16BIT); } } delete[] grid; // Restore fog settings driver->setFog(fog_color, fog_type, fog_start, fog_end, fog_density, fog_pixelfog, fog_rangefog); } void Clouds::step(float dtime) { m_origin = m_origin + dtime * BS * m_params.speed; } void Clouds::update(const v3f &camera_p, const video::SColorf &color_diffuse) { m_camera_pos = camera_p; m_color.r = MYMIN(MYMAX(color_diffuse.r * m_params.color_bright.getRed(), m_params.color_ambient.getRed()), 255) / 255.0f; m_color.g = MYMIN(MYMAX(color_diffuse.g * m_params.color_bright.getGreen(), m_params.color_ambient.getGreen()), 255) / 255.0f; m_color.b = MYMIN(MYMAX(color_diffuse.b * m_params.color_bright.getBlue(), m_params.color_ambient.getBlue()), 255) / 255.0f; m_color.a = m_params.color_bright.getAlpha() / 255.0f; // is the camera inside the cloud mesh? m_camera_inside_cloud = false; // default if (m_enable_3d) { float camera_height = camera_p.Y; if (camera_height >= m_box.MinEdge.Y && camera_height <= m_box.MaxEdge.Y) { v2f camera_in_noise; camera_in_noise.X = floor((camera_p.X - m_origin.X) / cloud_size + 0.5); camera_in_noise.Y = floor((camera_p.Z - m_origin.Y) / cloud_size + 0.5); bool filled = gridFilled(camera_in_noise.X, camera_in_noise.Y); m_camera_inside_cloud = filled; } } } void Clouds::readSettings() { m_cloud_radius_i = g_settings->getU16("cloud_radius"); m_enable_3d = g_settings->getBool("enable_3d_clouds"); } bool Clouds::gridFilled(int x, int y) const { float cloud_size_noise = cloud_size / (BS * 200.f); float noise = noise2d_perlin( (float)x * cloud_size_noise, (float)y * cloud_size_noise, m_seed, 3, 0.5); // normalize to 0..1 (given 3 octaves) static constexpr const float noise_bound = 1.0f + 0.5f + 0.25f; float density = noise / noise_bound * 0.5f + 0.5f; return (density < m_params.density); }