From 8d82c49a996e98be5552c861582b2d97031c5990 Mon Sep 17 00:00:00 2001 From: beegee1 Date: Mon, 22 Apr 2013 15:08:04 +0000 Subject: [PATCH] - Compile fix - Renamed map operations --- lib/mapping/CMapEditManager.cpp | 36 ++++++++++++++++----------------- lib/mapping/CMapEditManager.h | 12 +++++------ server/CVCMIServer.cpp | 2 +- 3 files changed, 25 insertions(+), 25 deletions(-) diff --git a/lib/mapping/CMapEditManager.cpp b/lib/mapping/CMapEditManager.cpp index cf4f66b95..db16a4077 100644 --- a/lib/mapping/CMapEditManager.cpp +++ b/lib/mapping/CMapEditManager.cpp @@ -184,12 +184,12 @@ void CMapEditManager::clearTerrain(CRandomGenerator * gen) void CMapEditManager::drawTerrain(const MapRect & rect, ETerrainType terType, CRandomGenerator * gen) { - execute(make_unique(map, rect, terType, gen)); + execute(make_unique(map, rect, terType, gen)); } void CMapEditManager::insertObject(const int3 & pos, CGObjectInstance * obj) { - execute(make_unique(map, pos, obj)); + execute(make_unique(map, pos, obj)); } void CMapEditManager::execute(unique_ptr && operation) @@ -348,13 +348,13 @@ const TerrainViewPattern & CTerrainViewPatternConfig::getPatternById(ETerrainGro throw std::runtime_error("Pattern with ID not found: " + id); } -DrawTerrainOperation::DrawTerrainOperation(CMap * map, const MapRect & rect, ETerrainType terType, CRandomGenerator * gen) +CDrawTerrainOperation::CDrawTerrainOperation(CMap * map, const MapRect & rect, ETerrainType terType, CRandomGenerator * gen) : CMapOperation(map), rect(rect), terType(terType), gen(gen) { } -void DrawTerrainOperation::execute() +void CDrawTerrainOperation::execute() { for(int i = rect.x; i < rect.x + rect.width; ++i) { @@ -371,22 +371,22 @@ void DrawTerrainOperation::execute() updateTerrainViews(viewRect & MapRect(int3(0, 0, viewRect.z), map->width, map->height)); // Rect should not overlap map dimensions } -void DrawTerrainOperation::undo() +void CDrawTerrainOperation::undo() { //TODO } -void DrawTerrainOperation::redo() +void CDrawTerrainOperation::redo() { //TODO } -std::string DrawTerrainOperation::getLabel() const +std::string CDrawTerrainOperation::getLabel() const { return "Draw Terrain"; } -void DrawTerrainOperation::updateTerrainViews(const MapRect & rect) +void CDrawTerrainOperation::updateTerrainViews(const MapRect & rect) { for(int i = rect.x; i < rect.x + rect.width; ++i) { @@ -454,7 +454,7 @@ void DrawTerrainOperation::updateTerrainViews(const MapRect & rect) } } -ETerrainGroup::ETerrainGroup DrawTerrainOperation::getTerrainGroup(ETerrainType terType) const +ETerrainGroup::ETerrainGroup CDrawTerrainOperation::getTerrainGroup(ETerrainType terType) const { switch(terType) { @@ -471,7 +471,7 @@ ETerrainGroup::ETerrainGroup DrawTerrainOperation::getTerrainGroup(ETerrainType } } -DrawTerrainOperation::ValidationResult DrawTerrainOperation::validateTerrainView(const int3 & pos, const TerrainViewPattern & pattern, int recDepth /*= 0*/) const +CDrawTerrainOperation::ValidationResult CDrawTerrainOperation::validateTerrainView(const int3 & pos, const TerrainViewPattern & pattern, int recDepth /*= 0*/) const { ETerrainType centerTerType = map->getTile(pos).terType; int totalPoints = 0; @@ -601,7 +601,7 @@ DrawTerrainOperation::ValidationResult DrawTerrainOperation::validateTerrainView return ValidationResult(true, transitionReplacement); } -bool DrawTerrainOperation::isSandType(ETerrainType terType) const +bool CDrawTerrainOperation::isSandType(ETerrainType terType) const { switch(terType) { @@ -614,7 +614,7 @@ bool DrawTerrainOperation::isSandType(ETerrainType terType) const } } -TerrainViewPattern DrawTerrainOperation::getFlippedPattern(const TerrainViewPattern & pattern, int flip) const +TerrainViewPattern CDrawTerrainOperation::getFlippedPattern(const TerrainViewPattern & pattern, int flip) const { if(flip == 0) { @@ -641,19 +641,19 @@ TerrainViewPattern DrawTerrainOperation::getFlippedPattern(const TerrainViewPatt return ret; } -DrawTerrainOperation::ValidationResult::ValidationResult(bool result, const std::string & transitionReplacement /*= ""*/) +CDrawTerrainOperation::ValidationResult::ValidationResult(bool result, const std::string & transitionReplacement /*= ""*/) : result(result), transitionReplacement(transitionReplacement) { } -InsertObjectOperation::InsertObjectOperation(CMap * map, const int3 & pos, CGObjectInstance * obj) +CInsertObjectOperation::CInsertObjectOperation(CMap * map, const int3 & pos, CGObjectInstance * obj) : CMapOperation(map), pos(pos), obj(obj) { } -void InsertObjectOperation::execute() +void CInsertObjectOperation::execute() { obj->pos = pos; obj->id = ObjectInstanceID(map->objects.size()); @@ -669,17 +669,17 @@ void InsertObjectOperation::execute() map->addBlockVisTiles(obj); } -void InsertObjectOperation::undo() +void CInsertObjectOperation::undo() { //TODO } -void InsertObjectOperation::redo() +void CInsertObjectOperation::redo() { execute(); } -std::string InsertObjectOperation::getLabel() const +std::string CInsertObjectOperation::getLabel() const { return "Insert Object"; } diff --git a/lib/mapping/CMapEditManager.h b/lib/mapping/CMapEditManager.h index b9e05e720..89df116ee 100644 --- a/lib/mapping/CMapEditManager.h +++ b/lib/mapping/CMapEditManager.h @@ -217,11 +217,11 @@ private: static boost::mutex smx; }; -/// The DrawTerrainOperation class draws a terrain area on the map. -class DrawTerrainOperation : public CMapOperation +/// The CDrawTerrainOperation class draws a terrain area on the map. +class CDrawTerrainOperation : public CMapOperation { public: - DrawTerrainOperation(CMap * map, const MapRect & rect, ETerrainType terType, CRandomGenerator * gen); + CDrawTerrainOperation(CMap * map, const MapRect & rect, ETerrainType terType, CRandomGenerator * gen); void execute() override; void undo() override; @@ -255,11 +255,11 @@ private: CRandomGenerator * gen; }; -/// The InsertObjectOperation class inserts an object to the map. -class InsertObjectOperation : public CMapOperation +/// The CInsertObjectOperation class inserts an object to the map. +class CInsertObjectOperation : public CMapOperation { public: - InsertObjectOperation(CMap * map, const int3 & pos, CGObjectInstance * obj); + CInsertObjectOperation(CMap * map, const int3 & pos, CGObjectInstance * obj); void execute() override; void undo() override; diff --git a/server/CVCMIServer.cpp b/server/CVCMIServer.cpp index dc6ba3d1d..4262db095 100644 --- a/server/CVCMIServer.cpp +++ b/server/CVCMIServer.cpp @@ -515,7 +515,7 @@ int main(int argc, char** argv) logConfig.configureDefault(); if(argc > 1) { - port = std::stoi(argv[1]); + port = boost::lexical_cast(argv[1]); } preinitDLL(console);