/*
-Minetest-c55
-Copyright (C) 2010-2011 kwolekr, Ryan Kwolek <kwolekr2@cs.scranton.edu>
+Minetest
+Copyright (C) 2010-2013 kwolekr, Ryan Kwolek <kwolekr2@cs.scranton.edu>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
bgroup->push_back(b);
verbosestream << "BiomeDefManager: added biome '" << b->name <<
- "' to biome group " << b->groupid << std::endl;
+ "' to biome group " << (int)b->groupid << std::endl;
}
void Biome::genColumn(Mapgen *mapgen, int x, int z, int y1, int y2) {
- MapgenV7 *mg = (MapgenV7 *)mapgen;
- int i = (z - mg->node_min.Z) * mg->csize.Z + (x - mg->node_min.X);
- int surfaceh = np->offset + np->scale * mg->map_terrain[i];
-
- /*///experimental
- if (groupid > 0) {
- float prevfreq = mg->biomedef->bgroup_freqs[groupid - 1];
- float range = mg->biomedef->bgroup_freqs[groupid] - prevfreq;
- float factor = (mg->map_bgroup[i] - prevfreq) / range;
-
- std::vector<Biome *> *bg = mg->biomedef->bgroups[groupid - 1];
- Biome *b = (*bg)[0];
- int h1 = b->np->offset + b->np->scale * mg->map_terrain[i];
- surfaceh += (int)round((surfaceh - h1) * factor);
- //printf("h1: %d, surfaceh: %d, factor %f\n", h1, surfaceh, factor);
- }*/
-
-
- int y = y1;
-
- i = mg->vmanip->m_area.index(x, y, z);
- for (; y <= surfaceh - ntopnodes && y <= y2; y++, i += mg->ystride)
- mg->vmanip->m_data[i] = n_filler;
- for (; y <= surfaceh && y <= y2; y++, i += mg->ystride)
- mg->vmanip->m_data[i] = n_top;
- for (; y <= y2; y++, i += mg->ystride)
- mg->vmanip->m_data[i] = mg->n_air;
+
}
void BiomeLiquid::genColumn(Mapgen *mapgen, int x, int z, int y1, int y2) {
- MapgenV7 *mg = (MapgenV7 *)mapgen;
- int i = (z - mg->node_min.Z) * mg->csize.Z + (x - mg->node_min.X);
- int surfaceh = np->offset + np->scale * mg->map_terrain[i];
- int y = y1;
-
- i = mg->vmanip->m_area.index(x, y, z);
- for (; y <= surfaceh - ntopnodes && y <= y2; y++, i += mg->ystride)
- mg->vmanip->m_data[i] = n_filler;
- for (; y <= surfaceh && y <= y2; y++, i += mg->ystride)
- mg->vmanip->m_data[i] = n_top;
- for (; y <= mg->water_level && y <= y2; y++, i += mg->ystride)
- mg->vmanip->m_data[i] = mg->n_water;
- for (; y <= y2; y++, i += mg->ystride)
- mg->vmanip->m_data[i] = mg->n_air;
+
}
void BiomeHell::genColumn(Mapgen *mapgen, int x, int z, int y1, int y2) {
- MapgenV7 *mg = (MapgenV7 *)mapgen;
- //stub
+
}
void BiomeAether::genColumn(Mapgen *mapgen, int x, int z, int y1, int y2) {
- MapgenV7 *mg = (MapgenV7 *)mapgen;
- //stub
+
}
void BiomeSuperflat::genColumn(Mapgen *mapgen, int x, int z, int y1, int y2) {
- MapgenV7 *mg = (MapgenV7 *)mapgen;
- int surfaceh = ntopnodes;
- int y = y1;
-
- int i = mg->vmanip->m_area.index(x, y, z);
- for (; y <= surfaceh - ntopnodes && y <= y2; y++, i += mg->ystride)
- mg->vmanip->m_data[i] = n_filler;
- for (; y <= surfaceh && y <= y2; y++, i += mg->ystride)
- mg->vmanip->m_data[i] = n_top;
- for (; y <= y2; y++, i += mg->ystride)
- mg->vmanip->m_data[i] = mg->n_air;
+
}