}
-void Biome::genColumn(MapgenV7 *mg, int x, int z, int y1, int y2) {
+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];
///////////////////////////// [ Ocean biome ] /////////////////////////////////
-void BiomeLiquid::genColumn(MapgenV7 *mg, int x, int z, int y1, int y2) {
+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;
}
-void BiomeHell::genColumn(MapgenV7 *mg, int x, int z, int y1, int y2) {
-
+void BiomeHell::genColumn(Mapgen *mapgen, int x, int z, int y1, int y2) {
+ MapgenV7 *mg = (MapgenV7 *)mapgen;
+ //stub
}
}
-void BiomeAether::genColumn(MapgenV7 *mg, int x, int z, int y1, int y2) {
-
+void BiomeAether::genColumn(Mapgen *mapgen, int x, int z, int y1, int y2) {
+ MapgenV7 *mg = (MapgenV7 *)mapgen;
+ //stub
}
}
-void BiomeSuperflat::genColumn(MapgenV7 *mg, int x, int z, int y1, int y2) {
+void BiomeSuperflat::genColumn(Mapgen *mapgen, int x, int z, int y1, int y2) {
+ MapgenV7 *mg = (MapgenV7 *)mapgen;
int surfaceh = ntopnodes;
int y = y1;
std::string name;
NoiseParams *np;
- virtual void genColumn(MapgenV7 *mg, int x, int z, int y1, int y2);
+ virtual void genColumn(Mapgen *mg, int x, int z, int y1, int y2);
virtual int getSurfaceHeight(float noise_terrain);
};
class BiomeLiquid : public Biome {
- virtual void genColumn(MapgenV7 *mg, int x, int z, int y1, int y2);
+ virtual void genColumn(Mapgen *mg, int x, int z, int y1, int y2);
};
class BiomeHell : public Biome {
- virtual void genColumn(MapgenV7 *mg, int x, int z, int y1, int y2);
+ virtual void genColumn(Mapgen *mg, int x, int z, int y1, int y2);
virtual int getSurfaceHeight(float noise_terrain);
};
class BiomeAether : public Biome {
- virtual void genColumn(MapgenV7 *mg, int x, int z, int y1, int y2);
+ virtual void genColumn(Mapgen *mg, int x, int z, int y1, int y2);
virtual int getSurfaceHeight(float noise_terrain);
};
class BiomeSuperflat : public Biome {
- virtual void genColumn(MapgenV7 *mg, int x, int z, int y1, int y2);
+ virtual void genColumn(Mapgen *mg, int x, int z, int y1, int y2);
virtual int getSurfaceHeight(float noise_terrain);
};
#if (IRRLICHT_VERSION_MAJOR == 1 && IRRLICHT_VERSION_MINOR < 8)
#ifdef _MSC_VER
// Windows
+ typedef long long s64;
typedef unsigned long long u64;
#else
// Posix
#include <stdint.h>
+ typedef int64_t s64;
typedef uint64_t u64;
- //typedef unsigned long long u64;
#endif
#endif
#define SWPRINTF_CHARSTRING L"%s"
#endif
+//currently not needed
+//template<typename T> struct alignment_trick { char c; T member; };
+//#define ALIGNOF(type) offsetof (alignment_trick<type>, member)
+
#ifdef _WIN32
#include <windows.h>
+
+ #define ALIGNOF(x) __alignof(x)
#define sleep_ms(x) Sleep(x)
+ #define strtok_r(x, y, z) strtok_s(x, y, z)
+ #define strtof(x, y) (float)strtod(x, y)
+ #define strtoll(x, y, z) _strtoi64(x, y, z)
+ #define strtoull(x, y, z) _strtoui64(x, y, z)
#else
#include <unistd.h>
+
+ #define ALIGNOF(x) __alignof__(x)
#define sleep_ms(x) usleep(x*1000)
#endif
+#define PADDING(x, y) ((ALIGNOF(y) - ((uintptr_t)(x) & (ALIGNOF(y) - 1))) & (ALIGNOF(y) - 1))
+
namespace porting
{
#include "debug.h"
#include "log.h"
#include "util/string.h"
+#include "porting.h"
enum ValueType
{
return value;
}
-//template<typename T> struct alignment_trick { char c; T member; };
-//#define ALIGNOF(type) offsetof (alignment_trick<type>, member)
-#ifdef _WIN32
- #define ALIGNOF(x) __alignof(x)
-#else
- #define ALIGNOF(x) __alignof__(x)
-#endif
-#define PADDING(x, y) ((ALIGNOF(y) - ((uintptr_t)(x) & (ALIGNOF(y) - 1))) & (ALIGNOF(y) - 1))
-#ifdef _WIN32
- #define strtok_r(x, y, z) strtok_s(x, y, z)
- #define strtof(x, y) (float)strtod(x, y)
- #define strtoll(x, y, z) _strtoi64(x, y, z)
- #define strtoull(x, y, z) _strtoui64(x, y, z)
-#endif
-
-typedef long long int s64; //to be added to src/irrlichttypes.h later
-
template <class T> T *getStruct(std::string name, std::string format)
{
size_t len = sizeof(T);