]> git.lizzy.rs Git - dragonblocks_alpha.git/commitdiff
Rename wetness to humidity
authorElias Fleckenstein <eliasfleckenstein@web.de>
Mon, 23 Aug 2021 12:38:50 +0000 (14:38 +0200)
committerElias Fleckenstein <eliasfleckenstein@web.de>
Mon, 23 Aug 2021 12:38:50 +0000 (14:38 +0200)
src/client/client_node.c
src/client/client_player.c
src/client/client_player.h
src/environment.c
src/environment.h
src/server/biomes.c
src/server/biomes.h
src/server/mapgen.c

index de1ed1ba95f7c3479a99483a6a2b347a33c7e269..144afa021b55933d6495031b93dc544b5d09739f 100644 (file)
@@ -14,14 +14,14 @@ static f64 clamp(f64 v, f64 min, f64 max)
 
 static void render_grass(v3s32 pos, unused MapNode *node, Vertex3D *vertex, unused int f, unused int v)
 {
-       f32 wet_min, wet_max, temp_max;
-       wet_min = 0.13f;
-       wet_max = 0.33f;
+       f32 hum_min, hum_max, temp_max;
+       hum_min = 0.13f;
+       hum_max = 0.33f;
        temp_max = 0.45f;
 
        f32 temp_f = clamp(0.3f - get_temperature(pos), 0.0f, 0.3f) / 0.3f;
 
-       vertex->color.h = (get_wetness(pos) * (wet_max - wet_min) + wet_min) * (1.0f - temp_f) + temp_max * temp_f;
+       vertex->color.h = (get_humidity(pos) * (hum_max - hum_min) + hum_min) * (1.0f - temp_f) + temp_max * temp_f;
        vertex->color.s = 1.0f;
        vertex->color.v = 1.0f;
 }
index a94ccef225eeadc157fc9a3722e1ee60200081fc..3171b7fc77ab77508f6c95bb03eeb3f5fd0f8563 100644 (file)
@@ -215,7 +215,7 @@ void client_player_update_info()
        v3s32 node_pos = {client_player.pos.x, client_player.pos.y, client_player.pos.z};
 
        char info_text[BUFSIZ];
-       sprintf(info_text, "(%.1f %.1f %.1f) wetness: %.2f temperature: %.2f flight: %s collision: %s", client_player.pos.x, client_player.pos.y, client_player.pos.z, get_wetness(node_pos), get_temperature(node_pos), client_player.fly ? "enabled" : "disabled", client_player.collision ? "enabled" : "disabled");
+       sprintf(info_text, "(%.1f %.1f %.1f) humidity: %.2f temperature: %.2f flight: %s collision: %s", client_player.pos.x, client_player.pos.y, client_player.pos.z, get_humidity(node_pos), get_temperature(node_pos), client_player.fly ? "enabled" : "disabled", client_player.collision ? "enabled" : "disabled");
 
        hud_change_text(client_player.info_hud, info_text);
 }
index aca4385199ac9a8c8fdad1b168d6fbccbd58db34..1621aa46008647010f42f2391cb0ece92cd4cde1 100644 (file)
@@ -18,7 +18,7 @@ extern struct ClientPlayer
        bool fly;                                       // can the player fly?
        bool collision;                         // should the player collide with the floor?
        Object *obj;                            // 3D mesh object (currently always invisible), not thread safe
-       HUDElement *info_hud;           // display position, temperature and wetness on HUD, not thread safe
+       HUDElement *info_hud;           // display position, temperature and humidity on HUD, not thread safe
 } client_player;
 
 void client_player_init();                             // ClientPlayer singleton constructor
index 2deb143eadb354185c251223adf46669407fc808..02db27617be48e0fe22054f128ea2ca733488d54 100644 (file)
@@ -2,7 +2,7 @@
 #include "perlin.h"
 #include "util.h"
 
-f64 get_wetness(v3s32 pos)
+f64 get_humidity(v3s32 pos)
 {
        return smooth2d(U32(pos.x) / 128.0, U32(pos.z) / 128.0, 0, seed + SO_WETNESS) * 0.5 + 0.5;
 }
index 232e76dafea541a08db57ad0b5c35e7f615abf5a..1de120c775092f5d3dfeac38a119ca0ea06eea3b 100644 (file)
@@ -3,7 +3,7 @@
 
 #include "types.h"
 
-f64 get_wetness(v3s32 pos);
+f64 get_humidity(v3s32 pos);
 f64 get_temperature(v3s32 pos);
 
 #endif
index 1bdde8906964ed9dcc7b87b164aa3ed4e1d312e5..d596e87450971f2fa3e76d48f914edace1350f12 100644 (file)
@@ -27,7 +27,7 @@ static s32 height_mountain(v2s32 pos, f64 factor, s32 height, unused void *row_d
        return pow((height + 96) * pow(((smooth2d(U32(pos.x) / 48.0, U32(pos.y) / 48.0, 0, seed + SO_MOUNTAIN_HEIGHT) + 1.0) * 256.0 + 128.0), factor), 1.0 / (factor + 1.0)) - 96;
 }
 
-static Node generate_mountain(unused v3s32 pos, s32 diff, unused f64 wetness, unused f64 temperature, unused f64 factor, unused MapBlock *block, unused List *changed_blocks, unused void *row_data, unused void *block_data)
+static Node generate_mountain(unused v3s32 pos, s32 diff, unused f64 humidity, unused f64 temperature, unused f64 factor, unused MapBlock *block, unused List *changed_blocks, unused void *row_data, unused void *block_data)
 {
        return diff <= 0 ? NODE_STONE : NODE_AIR;
 }
@@ -210,7 +210,7 @@ static s32 height_ocean(unused v2s32 pos, f64 factor, s32 height, void *row_data
        return rdata->vulcano ? max(ocean_floor, rdata->vulcano_height) : ocean_floor;
 }
 
-static Node generate_ocean(v3s32 pos, s32 diff, unused f64 wetness, unused f64 temperature, unused f64 factor, unused MapBlock *block, unused List *changed_blocks, void *row_data, unused void *block_data)
+static Node generate_ocean(v3s32 pos, s32 diff, unused f64 humidity, unused f64 temperature, unused f64 factor, unused MapBlock *block, unused List *changed_blocks, void *row_data, unused void *block_data)
 {
        OceanRowData *rdata = row_data;
 
@@ -240,7 +240,7 @@ static s32 height_hills(unused v2s32 pos, unused f64 factor, s32 height, unused
        return height;
 }
 
-static Node generate_hills(v3s32 pos, s32 diff, unused f64 wetness, unused f64 temperature, unused f64 factor, unused MapBlock *block, List *changed_blocks, unused void *row_data, unused void *block_data)
+static Node generate_hills(v3s32 pos, s32 diff, unused f64 humidity, unused f64 temperature, unused f64 factor, unused MapBlock *block, List *changed_blocks, unused void *row_data, unused void *block_data)
 {
        if (diff == 2 && smooth2d(U32(pos.x), U32(pos.z), 0, seed + SO_BOULDER_CENTER) > 0.999) {
                for (s8 bx = -1; bx <= 1; bx++) {
index 415f0ce022d3a7673431093d72c162c484955eed..1481e3fed3ccbccbb693bf1a5568a9ddeac19f7e 100644 (file)
@@ -20,7 +20,7 @@ typedef struct
        f64 threshold;
        bool snow;
        s32 (*height)(v2s32 pos, f64 factor, s32 height, void *row_data, void *block_data);
-       Node (*generate)(v3s32 pos, s32 diff, f64 wetness, f64 temperature, f64 factor, MapBlock *block, List *changed_blocks, void *row_data, void *block_data);
+       Node (*generate)(v3s32 pos, s32 diff, f64 humidity, f64 temperature, f64 factor, MapBlock *block, List *changed_blocks, void *row_data, void *block_data);
        size_t block_data_size;
        void (*preprocess_block)(MapBlock *block, List *changed_blocks, void *block_data);
        size_t row_data_size;
index b9c7e97c3122099c01636da1534e29184ce810fc..b596ffd113fe85721b3ae2b97f25e143779183e6 100644 (file)
@@ -59,12 +59,12 @@ void mapgen_generate_block(MapBlock *block, List *changed_blocks)
                        for (u8 y = 0; y < MAPBLOCK_SIZE; y++) {
                                v3s32 pos = {pos_horizontal.x, block_node_pos.y + y, pos_horizontal.y};
 
-                               f64 wetness = get_wetness(pos);
+                               f64 humidity = get_humidity(pos);
                                f64 temperature = get_temperature(pos);
 
                                s32 diff = pos.y - height;
 
-                               Node node = biome_def->generate(pos, diff, wetness, temperature, factor, block, changed_blocks, row_data, block_data[biome]);
+                               Node node = biome_def->generate(pos, diff, humidity, temperature, factor, block, changed_blocks, row_data, block_data[biome]);
 
                                if (biome_def->snow && diff <= 1 && temperature < 0.0 && node == NODE_AIR)
                                        node = NODE_SNOW;