From 2df5e26d3b7f08ef7d120511705fa0b75a44783e Mon Sep 17 00:00:00 2001 From: madmaxoft Date: Fri, 18 Jul 2014 09:57:34 +0200 Subject: Fixed spaces before commas. --- src/Simulator/IncrementalRedstoneSimulator.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/Simulator') diff --git a/src/Simulator/IncrementalRedstoneSimulator.cpp b/src/Simulator/IncrementalRedstoneSimulator.cpp index 8e5e40fb5..3dd6417dc 100644 --- a/src/Simulator/IncrementalRedstoneSimulator.cpp +++ b/src/Simulator/IncrementalRedstoneSimulator.cpp @@ -724,7 +724,7 @@ void cIncrementalRedstoneSimulator::HandleRedstoneRepeater(int a_RelBlockX, int X Axis ----> - Repeater directions, values from a cWorld::GetBlockMeta(a_RelBlockX , a_RelBlockY, a_RelBlockZ) lookup: + Repeater directions, values from a cWorld::GetBlockMeta(a_RelBlockX, a_RelBlockY, a_RelBlockZ) lookup: East (Right) (X+): 0x1 West (Left) (X-): 0x3 @@ -1723,7 +1723,7 @@ bool cIncrementalRedstoneSimulator::IsWirePowered(int a_RelBlockX, int a_RelBloc { continue; } - a_PowerLevel = std::max(itr->a_PowerLevel , a_PowerLevel); // Get the highest power level (a_PowerLevel is initialised already and there CAN be multiple levels for one block) + a_PowerLevel = std::max(itr->a_PowerLevel, a_PowerLevel); // Get the highest power level (a_PowerLevel is initialised already and there CAN be multiple levels for one block) } for (LinkedBlocksList::const_iterator itr = m_LinkedPoweredBlocks->begin(); itr != m_LinkedPoweredBlocks->end(); ++itr) // Check linked powered list -- cgit v1.2.3 From 0859ee3995d0cc80d80b328af920911d1cfb25d3 Mon Sep 17 00:00:00 2001 From: archshift Date: Fri, 18 Jul 2014 00:28:40 -0700 Subject: Simulator/CMakeLists.txt: Replaced glob with list of files --- src/Simulator/CMakeLists.txt | 33 ++++++++++++++++++++++++++++----- 1 file changed, 28 insertions(+), 5 deletions(-) (limited to 'src/Simulator') diff --git a/src/Simulator/CMakeLists.txt b/src/Simulator/CMakeLists.txt index b2a29d45c..f56fb0079 100644 --- a/src/Simulator/CMakeLists.txt +++ b/src/Simulator/CMakeLists.txt @@ -4,9 +4,32 @@ project (MCServer) include_directories ("${PROJECT_SOURCE_DIR}/../") -file(GLOB SOURCE - "*.cpp" - "*.h" -) +SET (SRCS + DelayedFluidSimulator.cpp + FireSimulator.cpp + FloodyFluidSimulator.cpp + FluidSimulator.cpp + IncrementalRedstoneSimulator.cpp + RedstoneSimulator.cpp + SandSimulator.cpp + Simulator.cpp + SimulatorManager.cpp + VanillaFluidSimulator.cpp + VaporizeFluidSimulator.cpp) -add_library(Simulator ${SOURCE}) +SET (HDRS + DelayedFluidSimulator.h + FireSimulator.h + FloodyFluidSimulator.h + FluidSimulator.h + IncrementalRedstoneSimulator.h + NoopFluidSimulator.h + NoopRedstoneSimulator.h + RedstoneSimulator.h + SandSimulator.h + Simulator.h + SimulatorManager.h + VanillaFluidSimulator.h + VaporizeFluidSimulator.h) + +add_library(Simulator ${SRCS} ${HDRS}) -- cgit v1.2.3 From 725d1fd1e2995b1720673c280fea1125ac338b3c Mon Sep 17 00:00:00 2001 From: archshift Date: Fri, 18 Jul 2014 13:26:43 -0700 Subject: Subdirs: Only add_library if not using MSVC --- src/Simulator/CMakeLists.txt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/Simulator') diff --git a/src/Simulator/CMakeLists.txt b/src/Simulator/CMakeLists.txt index f56fb0079..521b145b6 100644 --- a/src/Simulator/CMakeLists.txt +++ b/src/Simulator/CMakeLists.txt @@ -32,4 +32,6 @@ SET (HDRS VanillaFluidSimulator.h VaporizeFluidSimulator.h) -add_library(Simulator ${SRCS} ${HDRS}) +if(NOT MSVC) + add_library(Simulator ${SRCS} ${HDRS}) +endif() -- cgit v1.2.3 From 00c524519ef6c7ceaf4ac91307617cfd65d7cf21 Mon Sep 17 00:00:00 2001 From: madmaxoft Date: Sat, 19 Jul 2014 14:53:41 +0200 Subject: Fixed style: spaces after commas. --- src/Simulator/FireSimulator.cpp | 2 +- src/Simulator/IncrementalRedstoneSimulator.cpp | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) (limited to 'src/Simulator') diff --git a/src/Simulator/FireSimulator.cpp b/src/Simulator/FireSimulator.cpp index 9433a8c68..2164b6b10 100644 --- a/src/Simulator/FireSimulator.cpp +++ b/src/Simulator/FireSimulator.cpp @@ -98,7 +98,7 @@ void cFireSimulator::SimulateChunk(float a_Dt, int a_ChunkX, int a_ChunkZ, cChun int x = itr->x; int y = itr->y; int z = itr->z; - BLOCKTYPE BlockType = a_Chunk->GetBlock(x,y,z); + BLOCKTYPE BlockType = a_Chunk->GetBlock(x, y, z); if (!IsAllowedBlock(BlockType)) { diff --git a/src/Simulator/IncrementalRedstoneSimulator.cpp b/src/Simulator/IncrementalRedstoneSimulator.cpp index 3dd6417dc..ada8de4b8 100644 --- a/src/Simulator/IncrementalRedstoneSimulator.cpp +++ b/src/Simulator/IncrementalRedstoneSimulator.cpp @@ -570,10 +570,10 @@ void cIncrementalRedstoneSimulator::HandleRedstoneWire(int a_RelBlockX, int a_Re {-1, 1, 0}, { 0, 1, 1}, { 0, 1, -1}, /* Wires one higher, surrounding self stop */ - { 1,-1, 0}, /* Wires one lower, surrounding self start */ - {-1,-1, 0}, - { 0,-1, 1}, - { 0,-1, -1}, /* Wires one lower, surrounding self stop */ + { 1, -1, 0}, /* Wires one lower, surrounding self start */ + {-1, -1, 0}, + { 0, -1, 1}, + { 0, -1, -1}, /* Wires one lower, surrounding self stop */ } ; static const struct // Define which directions the wire will check for repeater prescence @@ -584,7 +584,7 @@ void cIncrementalRedstoneSimulator::HandleRedstoneWire(int a_RelBlockX, int a_Re { 1, 0, 0 }, {-1, 0, 0 }, { 0, 0, 1 }, - { 0, 0,-1 }, + { 0, 0, -1 }, { 0, 1, 0 }, }; -- cgit v1.2.3 From 6be79575fd50e37ac275bd0cb9d16f9e51e8a225 Mon Sep 17 00:00:00 2001 From: madmaxoft Date: Sun, 20 Jul 2014 23:10:31 +0200 Subject: Style: Normalized spaces after if, for and while. --- src/Simulator/FireSimulator.cpp | 2 +- src/Simulator/FluidSimulator.cpp | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'src/Simulator') diff --git a/src/Simulator/FireSimulator.cpp b/src/Simulator/FireSimulator.cpp index 2164b6b10..69dc7164e 100644 --- a/src/Simulator/FireSimulator.cpp +++ b/src/Simulator/FireSimulator.cpp @@ -140,7 +140,7 @@ void cFireSimulator::SimulateChunk(float a_Dt, int a_ChunkX, int a_ChunkZ, cChun continue; } - if((itr->y > 0) && (!DoesBurnForever(a_Chunk->GetBlock(itr->x, itr->y - 1, itr->z)))) + if ((itr->y > 0) && (!DoesBurnForever(a_Chunk->GetBlock(itr->x, itr->y - 1, itr->z)))) { a_Chunk->SetMeta(x, y, z, BlockMeta + 1); } diff --git a/src/Simulator/FluidSimulator.cpp b/src/Simulator/FluidSimulator.cpp index 499e204a1..58501326f 100644 --- a/src/Simulator/FluidSimulator.cpp +++ b/src/Simulator/FluidSimulator.cpp @@ -159,18 +159,18 @@ Direction cFluidSimulator::GetFlowingDirection(int a_X, int a_Y, int a_Z, bool a { Vector3i *Pos = (*it); char BlockID = m_World.GetBlock(Pos->x, Pos->y, Pos->z); - if(IsAllowedBlock(BlockID)) + if (IsAllowedBlock(BlockID)) { char Meta = m_World.GetBlockMeta(Pos->x, Pos->y, Pos->z); - if(Meta > LowestPoint) + if (Meta > LowestPoint) { LowestPoint = Meta; X = Pos->x; Z = Pos->z; } } - else if(BlockID == E_BLOCK_AIR) + else if (BlockID == E_BLOCK_AIR) { LowestPoint = 9; // This always dominates X = Pos->x; -- cgit v1.2.3 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/Simulator/NoopRedstoneSimulator.h | 2 +- src/Simulator/SimulatorManager.cpp | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'src/Simulator') diff --git a/src/Simulator/NoopRedstoneSimulator.h b/src/Simulator/NoopRedstoneSimulator.h index 4301b8aae..f9ed47982 100644 --- a/src/Simulator/NoopRedstoneSimulator.h +++ b/src/Simulator/NoopRedstoneSimulator.h @@ -28,7 +28,7 @@ public: UNUSED(a_ChunkZ); UNUSED(a_Chunk); } - virtual bool IsAllowedBlock( BLOCKTYPE a_BlockType ) override { return false; } + virtual bool IsAllowedBlock( BLOCKTYPE a_BlockType) override { return false; } virtual void AddBlock(int a_BlockX, int a_BlockY, int a_BlockZ, cChunk * a_Chunk) override { UNUSED(a_BlockX); diff --git a/src/Simulator/SimulatorManager.cpp b/src/Simulator/SimulatorManager.cpp index 2bc483cbd..918bac7a1 100644 --- a/src/Simulator/SimulatorManager.cpp +++ b/src/Simulator/SimulatorManager.cpp @@ -29,7 +29,7 @@ cSimulatorManager::~cSimulatorManager() void cSimulatorManager::Simulate(float a_Dt) { m_Ticks++; - for (cSimulators::iterator itr = m_Simulators.begin(); itr != m_Simulators.end(); ++itr ) + for (cSimulators::iterator itr = m_Simulators.begin(); itr != m_Simulators.end(); ++itr) { if ((m_Ticks % itr->second) == 0) { @@ -45,7 +45,7 @@ void cSimulatorManager::Simulate(float a_Dt) void cSimulatorManager::SimulateChunk(float a_Dt, int a_ChunkX, int a_ChunkZ, cChunk * a_Chunk) { // m_Ticks has already been increased in Simulate() - for (cSimulators::iterator itr = m_Simulators.begin(); itr != m_Simulators.end(); ++itr ) + for (cSimulators::iterator itr = m_Simulators.begin(); itr != m_Simulators.end(); ++itr) { if ((m_Ticks % itr->second) == 0) { @@ -60,7 +60,7 @@ void cSimulatorManager::SimulateChunk(float a_Dt, int a_ChunkX, int a_ChunkZ, cC void cSimulatorManager::WakeUp(int a_BlockX, int a_BlockY, int a_BlockZ, cChunk * a_Chunk) { - for (cSimulators::iterator itr = m_Simulators.begin(); itr != m_Simulators.end(); ++itr ) + for (cSimulators::iterator itr = m_Simulators.begin(); itr != m_Simulators.end(); ++itr) { itr->first->WakeUp(a_BlockX, a_BlockY, a_BlockZ, a_Chunk); } -- 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/Simulator/Simulator.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/Simulator') diff --git a/src/Simulator/Simulator.h b/src/Simulator/Simulator.h index 171eba91c..4d9a18867 100644 --- a/src/Simulator/Simulator.h +++ b/src/Simulator/Simulator.h @@ -32,7 +32,7 @@ public: UNUSED(a_ChunkX); UNUSED(a_ChunkZ); UNUSED(a_Chunk); - }; + } /// Called when a block changes virtual void WakeUp(int a_BlockX, int a_BlockY, int a_BlockZ, cChunk * a_Chunk); -- cgit v1.2.3