49 const int x,
const int y,
const int z)
60 void World::Shine(
const int x,
const int y,
const int z,
int level) {
69 if ( x > 0 )
Shine(x-1, y, z, level);
70 if ( x < border )
Shine(x+1, y, z, level);
71 if ( y > 0 )
Shine(x, y-1, z, level);
72 if ( y < border )
Shine(x, y+1, z, level);
73 Shine(x, y, z-1, level);
74 Shine(x, y, z+1, level);
114 if ( x > 0 )
UpShine(x-1, y, z_bottom);
115 if ( x < bound )
UpShine(x+1, y, z_bottom);
116 if ( y > 0 )
UpShine(x, y-1, z_bottom);
117 if ( y < bound )
UpShine(x, y+1, z_bottom);
135 emit
Updated(x, y, z_bottom++);
146 Shine(x, y, z, radius);
194 default: Q_UNREACHABLE();
break;
200 const int light =
LightMap(x, y, z);
209 Focus(i, j, k, &x, &y, &z, dir);
237 if ( (
lightMap[x][y][z] & 0x0F ) < level ) {
238 (
lightMap[x][y][z] &= 0xF0 ) |= level;
248 if ( (
lightMap[x][y][z] & 0xF0 ) < level ) {
249 (
lightMap[x][y][z] &= 0x0F ) |= level;
267 (*i)->LightRadius());
QLinkedList< Active *const >::const_iterator ShiningEnd() const
static int CoordInShred(const int x)
Get local coordinate.
QLinkedList< Active *const >::const_iterator ShiningBegin() const
bool SetFireLight(int x, int y, int z, int level)
const int FIRE_LIGHT_FACTOR
void Updated(int, int, int)
uchar lightMap[SHRED_WIDTH][SHRED_WIDTH][HEIGHT]
void UpShineInit(int x, int y, int z_bottom)
const int MOON_LIGHT_FACTOR
bool SetSunLight(int x, int y, int z, int level)
void AddFireLight(int x, int y, int z, int level)
int LightMap(int x, int y, int z) const
Use Enlightened instead, which is smart wrapper of this.
virtual int LightRadius() const
void Shine(int x, int y, int z, int level)
If init is false, light will not spread from non-invisible blocks.
const int SUN_LIGHT_FACTOR
void ReEnlightenMove(dirs)
Called from ReloadShreds(int), enlightens only needed shreds.
Block * GetBlock(int x, int y, int z) const
int SunLight(int x, int y, int z) const
void SetAllLightMapNull()
bool GetEvernight() const
void ShineAll()
Makes all shining blocks of shred shine.
int SunLight(int x, int y, int z) const
void ReEnlighten(int x, int y, int z)
Called when block is moved.
void SetLightmap(int x, int y, int z, int level)
times_of_day PartOfDay() const
int FireLight(int x, int y, int z) const
Shred * GetShred(int i, int j) const
Block * GetBlock(const int x, const int y, const int z) const
bool SetFireLightMap(int level, int x, int y, int z)
void RemoveFireLight(int x, int y, int z)
bool Focus(int x, int y, int z, int *x_targ, int *y_targ, int *z_targ, dirs dir) const
False on error, true if focus is received to _targ successfully.
int Lightmap(int x, int y, int z) const
void CrossUpShine(int x, int y, int z_bottom)
void SunShineVertical(int x, int y, int z=HEIGHT-2, int level=MAX_LIGHT_RADIUS)
void UpShine(int x, int y, int z_bottom)
int FireLight(int x, int y, int z) const
Provides definition for class Block.
int Enlightened(int x, int y, int z) const