...
 
Commits (3)
......@@ -98,7 +98,6 @@ elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Intel")
endif()
elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC")
add_definitions(/DNOMINMAX)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /MP /bigobj")
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /ZI /bigobj")
set(RESSOURCE_FILE src/maxr.rc)
......@@ -161,7 +160,8 @@ add_executable(maxr ${maxr_SRCS} ${RESSOURCE_FILE})
# set linker flags for target
if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC")
set_target_properties(maxr PROPERTIES LINK_FLAGS "/SUBSYSTEM:WINDOWS")
#set_target_properties(maxr PROPERTIES LINK_FLAGS "/SUBSYSTEM:WINDOWS")
target_compile_definitions(maxr PRIVATE "NOMINMAX" "_USE_MATH_DEFINES")
endif()
# ============================================
......
......@@ -52,7 +52,7 @@ cMapView::cMapView(std::shared_ptr<const cMap> map_, std::shared_ptr<const cPlay
}
});
connectionManager.connect(player->getScanMap().positionsInRange, [&](const std::vector<const cPosition>& positions)
connectionManager.connect(player->getScanMap().positionsInRange, [&](const std::vector<cPosition>& positions)
{
// scan area of player has changed
std::set<const cUnit*> units;
......@@ -90,7 +90,7 @@ cMapView::cMapView(std::shared_ptr<const cMap> map_, std::shared_ptr<const cPlay
}
});
connectionManager.connect(player->getScanMap().positionsOutOfRange, [&](const std::vector<const cPosition>& positions)
connectionManager.connect(player->getScanMap().positionsOutOfRange, [&](const std::vector<cPosition>& positions)
{
// scan area of player has changed
std::set<const cUnit*> units;
......
......@@ -37,7 +37,7 @@ void cRangeMap::resize(const cPosition& size_)
//------------------------------------------------------------------------------
void cRangeMap::add(int range, const cPosition& position, int unitSize, bool square /*= false*/)
{
std::vector<const cPosition> positions;
std::vector<cPosition> positions;
const int minx = std::max(position.x() - range, 0);
const int maxx = std::min(position.x() + range, size.x() - 1);
......@@ -68,8 +68,8 @@ void cRangeMap::add(int range, const cPosition& position, int unitSize, bool squ
//------------------------------------------------------------------------------
void cRangeMap::update(int range, const cPosition& oldPosition, const cPosition& newPosition, int oldUnitSize, int newUnitSize, bool square /*= false*/)
{
std::vector<const cPosition> inPositions;
std::vector<const cPosition> outPositions;
std::vector<cPosition> inPositions;
std::vector<cPosition> outPositions;
const int minx = std::max(std::min(oldPosition.x(), newPosition.x()) - range, 0);
const int maxx = std::min(std::max(oldPosition.x(), newPosition.x()) + range, size.x() - 1);
......@@ -114,8 +114,8 @@ void cRangeMap::update(int range, const cPosition& oldPosition, const cPosition&
//------------------------------------------------------------------------------
void cRangeMap::update(int oldRange, int newRange, const cPosition& position, int unitSize, bool square /*= false*/)
{
std::vector<const cPosition> inPositions;
std::vector<const cPosition> outPositions;
std::vector<cPosition> inPositions;
std::vector<cPosition> outPositions;
const int maxRange = std::max(oldRange, newRange);
const int minx = std::max(position.x() - maxRange, 0);
......@@ -161,7 +161,7 @@ void cRangeMap::update(int oldRange, int newRange, const cPosition& position, in
//------------------------------------------------------------------------------
void cRangeMap::remove(int range, const cPosition& position, int unitSize, bool square /*= false*/)
{
std::vector<const cPosition> positions;
std::vector<cPosition> positions;
const int minx = std::max(position.x() - range, 0);
const int maxx = std::min(position.x() + range, size.x() - 1);
......@@ -221,7 +221,7 @@ void cRangeMap::subtract(const std::vector<uint16_t>& data)
{
assert(map.size() == data.size());
std::vector<const cPosition> positions;
std::vector<cPosition> positions;
for (size_t i = 0; i < data.size(); i++)
{
......
......@@ -51,8 +51,8 @@ public:
uint32_t getChecksum(uint32_t crc) const;
/** Triggered, when a position comes in range or goes out of range, by an add/update/remove */
mutable cSignal<void(const std::vector<const cPosition>& positions)> positionsInRange;
mutable cSignal<void(const std::vector<const cPosition>& positions)> positionsOutOfRange;
mutable cSignal<void(const std::vector<cPosition>& positions)> positionsInRange;
mutable cSignal<void(const std::vector<cPosition>& positions)> positionsOutOfRange;
/** Triggered after an operation changed at least the status of one position */
mutable cSignal<void()> changed;
......