Fixed compilation in VC2008.

Also removed an unused inline header file (yuck).
master
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" RelativePath="..\src\Chunk.h"
> >
</File> </File>
<File
RelativePath="..\src\Chunk.inl.h"
>
</File>
<File <File
RelativePath="..\src\ChunkDef.h" RelativePath="..\src\ChunkDef.h"
> >

View File

@ -87,10 +87,9 @@ public:
virtual void SendTo(cClientHandle & a_Client) = 0; 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. /// 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_Dt);
UNUSED(a_Chunk);
return false; return false;
} }

View File

@ -527,9 +527,10 @@ void cChunk::SpawnMobs(cMobSpawner& a_MobSpawner)
// MG TODO : check that "Level" really means Y // MG TODO : check that "Level" really means Y
/*NIBBLETYPE SkyLight = 0; /*
NIBBLETYPE SkyLight = 0;
NIBBLETYPE BlockLight = 0;*/ NIBBLETYPE BlockLight = 0;
*/
if (IsLightValid()) 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) 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); int Idx = cChunkDef::MakeIndexNoCheck(a_RelX, a_RelY, a_RelZ);
a_BlockMeta = cChunkDef::GetNibble(m_BlockMeta, 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 namespace Json
{ {
class Value; class Value;
@ -436,8 +423,6 @@ private:
void RemoveBlockEntity(cBlockEntity * a_BlockEntity); void RemoveBlockEntity(cBlockEntity * a_BlockEntity);
void AddBlockEntity (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 /// Creates a block entity for each block that needs a block entity and doesn't have one in the list
void CreateBlockEntities(void); 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

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