From 93d29555e58df172bafba530afbc593c16ec66a3 Mon Sep 17 00:00:00 2001 From: madmaxoft Date: Mon, 21 Jul 2014 15:19:48 +0200 Subject: Style: Normalized to no spaces before closing parenthesis. --- src/Chunk.h | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'src/Chunk.h') diff --git a/src/Chunk.h b/src/Chunk.h index 2e2895c6e..9ab39a0a2 100644 --- a/src/Chunk.h +++ b/src/Chunk.h @@ -82,9 +82,9 @@ public: /* To save a chunk, the WSSchema must: - 1. Mark the chunk as being saved (MarkSaving() ) + 1. Mark the chunk as being saved (MarkSaving()) 2. Get the chunk's data using GetAllData() - 3. Mark the chunk as saved (MarkSaved() ) + 3. Mark the chunk as saved (MarkSaved()) If anywhere inside this sequence another thread mmodifies the chunk, the chunk will not get marked as saved in MarkSaved() */ void MarkSaving(void); // Marks the chunk as being saved. @@ -144,7 +144,7 @@ public: void SetBlock(int a_RelX, int a_RelY, int a_RelZ, BLOCKTYPE a_BlockType, NIBBLETYPE a_BlockMeta, bool a_SendToClients = true); // SetBlock() does a lot of work (heightmap, tickblocks, blockentities) so a BlockIdx version doesn't make sense - void SetBlock( const Vector3i & a_RelBlockPos, BLOCKTYPE a_BlockType, NIBBLETYPE a_BlockMeta ) { SetBlock( a_RelBlockPos.x, a_RelBlockPos.y, a_RelBlockPos.z, a_BlockType, a_BlockMeta ); } + void SetBlock( const Vector3i & a_RelBlockPos, BLOCKTYPE a_BlockType, NIBBLETYPE a_BlockMeta) { SetBlock( a_RelBlockPos.x, a_RelBlockPos.y, a_RelBlockPos.z, a_BlockType, a_BlockMeta); } /** Queues a block change till the specified world tick */ void QueueSetBlock(int a_RelX, int a_RelY, int a_RelZ, BLOCKTYPE a_BlockType, NIBBLETYPE a_BlockMeta, Int64 a_Tick, BLOCKTYPE a_PreviousBlockType = E_BLOCK_AIR); @@ -195,7 +195,7 @@ public: /** Sets the sign text. Returns true if successful. Also sends update packets to all clients in the chunk */ bool SetSignLines(int a_RelX, int a_RelY, int a_RelZ, const AString & a_Line1, const AString & a_Line2, const AString & a_Line3, const AString & a_Line4); - int GetHeight( int a_X, int a_Z ); + int GetHeight( int a_X, int a_Z); void SendBlockTo(int a_RelX, int a_RelY, int a_RelZ, cClientHandle * a_Client); @@ -301,7 +301,7 @@ public: void BroadcastSoundParticleEffect(int a_EffectID, int a_SrcX, int a_SrcY, int a_SrcZ, int a_Data, const cClientHandle * a_Exclude = NULL); void BroadcastSpawnEntity (cEntity & a_Entity, const cClientHandle * a_Exclude = NULL); void BroadcastThunderbolt (int a_BlockX, int a_BlockY, int a_BlockZ, const cClientHandle * a_Exclude = NULL); - void BroadcastUseBed (const cEntity & a_Entity, int a_BlockX, int a_BlockY, int a_BlockZ ); + void BroadcastUseBed (const cEntity & a_Entity, int a_BlockX, int a_BlockY, int a_BlockZ); void SendBlockEntity (int a_BlockX, int a_BlockY, int a_BlockZ, cClientHandle & a_Client); @@ -311,7 +311,7 @@ public: } void PositionToWorldPosition(int a_RelX, int a_RelY, int a_RelZ, int & a_BlockX, int & a_BlockY, int & a_BlockZ); - Vector3i PositionToWorldPosition(int a_RelX, int a_RelY, int a_RelZ ); + Vector3i PositionToWorldPosition(int a_RelX, int a_RelY, int a_RelZ); inline void MarkDirty(void) { -- cgit v1.2.3 From c0b62ef139a65ca648135fb6999e6623438fdd71 Mon Sep 17 00:00:00 2001 From: madmaxoft Date: Thu, 24 Jul 2014 18:32:05 +0200 Subject: Added a queue for setting chunk data. Fixes #1196. --- src/Chunk.h | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) (limited to 'src/Chunk.h') diff --git a/src/Chunk.h b/src/Chunk.h index 9ab39a0a2..5d50f9717 100644 --- a/src/Chunk.h +++ b/src/Chunk.h @@ -95,16 +95,10 @@ public: /** Gets all chunk data, calls the a_Callback's methods for each data type */ void GetAllData(cChunkDataCallback & a_Callback); - /** Sets all chunk data */ - void SetAllData( - const BLOCKTYPE * a_BlockTypes, - const NIBBLETYPE * a_BlockMeta, - const NIBBLETYPE * a_BlockLight, - const NIBBLETYPE * a_BlockSkyLight, - const cChunkDef::HeightMap * a_HeightMap, - const cChunkDef::BiomeMap & a_BiomeMap, - cBlockEntityList & a_BlockEntities - ); + /** Sets all chunk data as either loaded from the storage or generated. + BlockLight and BlockSkyLight are optional, if not present, chunk will be marked as unlighted. + Modifies the BlockEntity list in a_SetChunkData - moves the block entities into the chunk. */ + void SetAllData(cSetChunkData & a_SetChunkData); void SetLight( const cChunkDef::BlockNibbles & a_BlockLight, -- cgit v1.2.3 From 4191be7ddba820af4ed0c505a8d62416c2b7a8b4 Mon Sep 17 00:00:00 2001 From: archshift Date: Tue, 22 Jul 2014 15:36:13 -0700 Subject: Removed redundant semicolons and re-added warning --- src/Chunk.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/Chunk.h') diff --git a/src/Chunk.h b/src/Chunk.h index 5d50f9717..7eee3999c 100644 --- a/src/Chunk.h +++ b/src/Chunk.h @@ -380,9 +380,9 @@ public: cRedstoneSimulatorChunkData * GetRedstoneSimulatorData(void) { return &m_RedstoneSimulatorData; } cRedstoneSimulatorChunkData * GetRedstoneSimulatorQueuedData(void) { return &m_RedstoneSimulatorQueuedData; } cIncrementalRedstoneSimulator::PoweredBlocksList * GetRedstoneSimulatorPoweredBlocksList(void) { return &m_RedstoneSimulatorPoweredBlocksList; } - cIncrementalRedstoneSimulator::LinkedBlocksList * GetRedstoneSimulatorLinkedBlocksList(void) { return &m_RedstoneSimulatorLinkedBlocksList; }; - cIncrementalRedstoneSimulator::SimulatedPlayerToggleableList * GetRedstoneSimulatorSimulatedPlayerToggleableList(void) { return &m_RedstoneSimulatorSimulatedPlayerToggleableList; }; - cIncrementalRedstoneSimulator::RepeatersDelayList * GetRedstoneSimulatorRepeatersDelayList(void) { return &m_RedstoneSimulatorRepeatersDelayList; }; + cIncrementalRedstoneSimulator::LinkedBlocksList * GetRedstoneSimulatorLinkedBlocksList(void) { return &m_RedstoneSimulatorLinkedBlocksList; } + cIncrementalRedstoneSimulator::SimulatedPlayerToggleableList * GetRedstoneSimulatorSimulatedPlayerToggleableList(void) { return &m_RedstoneSimulatorSimulatedPlayerToggleableList; } + cIncrementalRedstoneSimulator::RepeatersDelayList * GetRedstoneSimulatorRepeatersDelayList(void) { return &m_RedstoneSimulatorRepeatersDelayList; } bool IsRedstoneDirty(void) const { return m_IsRedstoneDirty; } void SetIsRedstoneDirty(bool a_Flag) { m_IsRedstoneDirty = a_Flag; } -- cgit v1.2.3