1
0

Compiles for linux

git-svn-id: http://mc-server.googlecode.com/svn/trunk@6 0a769ca7-a7f5-676a-18bf-c427514a06d6
This commit is contained in:
faketruth
2011-10-21 21:25:29 +00:00
parent 7e010e7f8f
commit c7b4b9f819
20 changed files with 399 additions and 208 deletions

View File

@@ -22,6 +22,7 @@
#include "cItem.h"
#include "cNoise.h"
#include "cRoot.h"
#include "cCriticalSection.h"
#include "cGenSettings.h"
@@ -37,6 +38,10 @@
#include <vector>
#include <map>
#ifndef _WIN32
#define sprintf_s(dst, size, format, ...) sprintf(dst, format, __VA_ARGS__ )
#endif
extern bool g_bWaterPhysics;
@@ -77,8 +82,7 @@ cChunk::~cChunk()
if( m_EntitiesCriticalSection )
{
DeleteCriticalSection( (CRITICAL_SECTION*)m_EntitiesCriticalSection );
delete (CRITICAL_SECTION*)m_EntitiesCriticalSection;
delete m_EntitiesCriticalSection;
m_EntitiesCriticalSection = 0;
}
delete m_pState;
@@ -102,8 +106,7 @@ cChunk::cChunk(int a_X, int a_Y, int a_Z)
, m_EntitiesCriticalSection( 0 )
{
//LOG("cChunk::cChunk(%i, %i, %i)", a_X, a_Y, a_Z);
m_EntitiesCriticalSection = new CRITICAL_SECTION;
InitializeCriticalSection( (CRITICAL_SECTION*)m_EntitiesCriticalSection );
m_EntitiesCriticalSection = new cCriticalSection();
}
void cChunk::Initialize()
@@ -1064,12 +1067,12 @@ bool cChunk::RemoveEntity( cEntity & a_Entity, cChunk* a_CalledFrom /* = 0 */ )
void cChunk::LockEntities()
{
EnterCriticalSection( (CRITICAL_SECTION*)m_EntitiesCriticalSection );
m_EntitiesCriticalSection->Lock();
}
void cChunk::UnlockEntities()
{
LeaveCriticalSection( (CRITICAL_SECTION*)m_EntitiesCriticalSection );
m_EntitiesCriticalSection->Unlock();
}
char cChunk::GetBlock( int a_X, int a_Y, int a_Z )