1
0

Fixed compilation in VC2008.

Also removed an unused inline header file (yuck).
This commit is contained in:
madmaxoft 2013-12-30 17:41:59 +01:00
parent d724241407
commit ee15d4e08e
7 changed files with 13 additions and 79 deletions

View File

@ -494,10 +494,6 @@
RelativePath="..\src\Chunk.h"
>
</File>
<File
RelativePath="..\src\Chunk.inl.h"
>
</File>
<File
RelativePath="..\src\ChunkDef.h"
>

View File

@ -87,10 +87,9 @@ public:
virtual void SendTo(cClientHandle & a_Client) = 0;
/// Ticks the entity; returns true if the chunk should be marked as dirty as a result of this ticking. By default does nothing.
virtual bool Tick(float a_Dt, cChunk & a_Chunk)
virtual bool Tick(float a_Dt, cChunk & /* a_Chunk */)
{
UNUSED(a_Dt);
UNUSED(a_Chunk);
return false;
}

View File

@ -527,9 +527,10 @@ void cChunk::SpawnMobs(cMobSpawner& a_MobSpawner)
// MG TODO : check that "Level" really means Y
/*NIBBLETYPE SkyLight = 0;
NIBBLETYPE BlockLight = 0;*/
/*
NIBBLETYPE SkyLight = 0;
NIBBLETYPE BlockLight = 0;
*/
if (IsLightValid())
{
@ -2323,8 +2324,9 @@ BLOCKTYPE cChunk::GetBlock(int a_BlockIdx) const
void cChunk::GetBlockTypeMeta(int a_RelX, int a_RelY, int a_RelZ, BLOCKTYPE & a_BlockType, NIBBLETYPE & a_BlockMeta)
{
a_BlockType = cChunkDef::GetBlock (m_BlockTypes, a_RelX, a_RelY, a_RelZ);
a_BlockMeta = cChunkDef::GetNibble(m_BlockMeta, a_RelX, a_RelY, a_RelZ);
int Idx = cChunkDef::MakeIndexNoCheck(a_RelX, a_RelY, a_RelZ);
a_BlockType = cChunkDef::GetBlock (m_BlockTypes, Idx);
a_BlockMeta = cChunkDef::GetNibble(m_BlockMeta, Idx);
}
@ -2896,11 +2898,3 @@ NIBBLETYPE cChunk::GetTimeAlteredLight(NIBBLETYPE a_Skylight) const
#if !C_CHUNK_USE_INLINE
# include "cChunk.inl.h"
#endif

View File

@ -12,19 +12,6 @@
#define C_CHUNK_USE_INLINE 1
// Do not touch
#if C_CHUNK_USE_INLINE
#define __C_CHUNK_INLINE__ inline
#else
#define __C_CHUNK_INLINE__
#endif
namespace Json
{
class Value;
@ -436,8 +423,6 @@ private:
void RemoveBlockEntity(cBlockEntity * a_BlockEntity);
void AddBlockEntity (cBlockEntity * a_BlockEntity);
void SpreadLightOfBlock(NIBBLETYPE * a_LightBuffer, int a_X, int a_Y, int a_Z, char a_Falloff);
/// Creates a block entity for each block that needs a block entity and doesn't have one in the list
void CreateBlockEntities(void);
@ -482,11 +467,3 @@ typedef std::list<cChunkPtr> cChunkPtrList;
#if C_CHUNK_USE_INLINE
#include "Chunk.inl.h"
#endif

View File

@ -1,34 +0,0 @@
#ifndef __C_CHUNK_INL_H__
#define __C_CHUNK_INL_H__
#ifndef MAX
# define MAX(a,b) (((a)>(b))?(a):(b))
#endif
__C_CHUNK_INLINE__
void cChunk::SpreadLightOfBlock(NIBBLETYPE * a_LightBuffer, int a_X, int a_Y, int a_Z, char a_Falloff)
{
unsigned char CurrentLight = cChunkDef::GetNibble( a_LightBuffer, a_X, a_Y, a_Z );
cChunkDef::SetNibble( a_LightBuffer, a_X-1, a_Y, a_Z, MAX(cChunkDef::GetNibble( a_LightBuffer, a_X-1, a_Y, a_Z ), MAX(0,CurrentLight-a_Falloff) ) );
cChunkDef::SetNibble( a_LightBuffer, a_X+1, a_Y, a_Z, MAX(cChunkDef::GetNibble( a_LightBuffer, a_X+1, a_Y, a_Z ), MAX(0,CurrentLight-a_Falloff) ) );
cChunkDef::SetNibble( a_LightBuffer, a_X, a_Y-1, a_Z, MAX(cChunkDef::GetNibble( a_LightBuffer, a_X, a_Y-1, a_Z ), MAX(0,CurrentLight-a_Falloff) ) );
cChunkDef::SetNibble( a_LightBuffer, a_X, a_Y+1, a_Z, MAX(cChunkDef::GetNibble( a_LightBuffer, a_X, a_Y+1, a_Z ), MAX(0,CurrentLight-a_Falloff) ) );
cChunkDef::SetNibble( a_LightBuffer, a_X, a_Y, a_Z-1, MAX(cChunkDef::GetNibble( a_LightBuffer, a_X, a_Y, a_Z-1 ), MAX(0,CurrentLight-a_Falloff) ) );
cChunkDef::SetNibble( a_LightBuffer, a_X, a_Y, a_Z+1, MAX(cChunkDef::GetNibble( a_LightBuffer, a_X, a_Y, a_Z+1 ), MAX(0,CurrentLight-a_Falloff) ) );
MarkDirty();
}
#endif

View File

@ -180,7 +180,7 @@ public:
/// Converts absolute block coords into relative (chunk + block) coords:
inline static void AbsoluteToRelative(/* in-out */ int & a_X, int& a_Y, int & a_Z, /* out */ int & a_ChunkX, int & a_ChunkZ )
inline static void AbsoluteToRelative(/* in-out */ int & a_X, int & a_Y, int & a_Z, /* out */ int & a_ChunkX, int & a_ChunkZ )
{
UNUSED(a_Y);
BlockToChunk(a_X, a_Z, a_ChunkX, a_ChunkZ);

View File

@ -424,11 +424,13 @@ protected:
void Dereference( cEntity*& a_EntityPtr );
private:
// Measured in degrees (MAX 360 degrees)
// Measured in degrees, [-180, +180)
double m_HeadYaw;
// Measured in meter/second (m/s)
Vector3d m_Speed;
// Measured in degrees (MAX 360 degrees)
// Measured in degrees, [-180, +180)
Vector3d m_Rot;
/// Position of the entity's XZ center and Y bottom