1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-06-27 16:36:03 +00:00

partly working chunk-based map generator (doesn't save properly, spawn is pretty random)

This commit is contained in:
Perttu Ahola 2011-02-01 03:06:02 +02:00
parent be851871cd
commit 6e196c2ce4
13 changed files with 1370 additions and 126 deletions

View file

@ -207,6 +207,10 @@ public:
{
return ptr == t;
}
T & operator[](unsigned int i)
{
return ptr[i];
}
private:
void drop()
{
@ -572,6 +576,15 @@ inline bool isInArea(v2s16 p, s16 d)
);
}
inline bool isInArea(v3s16 p, v3s16 d)
{
return (
p.X >= 0 && p.X < d.X &&
p.Y >= 0 && p.Y < d.Y &&
p.Z >= 0 && p.Z < d.Z
);
}
inline s16 rangelim(s16 i, s16 min, s16 max)
{
if(i < min)
@ -1459,6 +1472,13 @@ int myrand(void);
void mysrand(unsigned seed);
#define MYRAND_MAX 32767
inline int myrand_range(int min, int max)
{
if(min >= max)
return max;
return (myrand()%(max-min+1))+min;
}
/*
Some kind of a thing that stores attributes related to
coordinate points