diff --git a/rts/Game/UI/GuiHandler.cpp b/rts/Game/UI/GuiHandler.cpp index fc8914f6054..f2f8d697af4 100644 --- a/rts/Game/UI/GuiHandler.cpp +++ b/rts/Game/UI/GuiHandler.cpp @@ -1278,21 +1278,22 @@ void CGuiHandler::MouseRelease(int x, int y, int button, const float3& cameraPos defaultCmdMemory = -1; } - if ((iconCmd >= 0) && ((size_t)iconCmd < commands.size())) { - const bool rightMouseButton = (button == SDL_BUTTON_RIGHT); - SetActiveCommand(iconCmd, rightMouseButton); + if (size_t(iconCmd) < commands.size()) { + SetActiveCommand(iconCmd, button == SDL_BUTTON_RIGHT); return; } // not over a button, try to execute a command - Command c = GetCommand(x, y, button, false, cameraPos, mouseDir); + // note: this executes GiveCommand for build-icon clicks if !preview + const Command c = GetCommand(x, y, button, false, cameraPos, mouseDir); - if (c.GetID() == CMD_FAILED) { // indicates we should not finish the current command + if (c.GetID() == CMD_FAILED) { + // failed indicates we should not finish the current command Channels::UserInterface->PlaySample(failedSound, 5); return; } - // if cmd_stop is returned it indicates that no good command could be found + // stop indicates that no good command could be found if (c.GetID() != CMD_STOP) { GiveCommand(c); @@ -1694,7 +1695,7 @@ bool CGuiHandler::ProcessLocalActions(const Action& action) // only process the build options while building // (conserve the keybinding space where we can) - if ((inCommand >= 0) && ((size_t)inCommand < commands.size()) && + if ((size_t(inCommand) < commands.size()) && ((commands[inCommand].type == CMDTYPE_ICON_BUILDING) || (commands[inCommand].id == CMD_UNLOAD_UNITS))) { if (ProcessBuildActions(action)) { @@ -2080,11 +2081,10 @@ std::string CGuiHandler::GetTooltip(int x, int y) // mousehandler::getcurrenttooltip --> CMiniMap::gettooltip --> GetBuildTooltip std::string CGuiHandler::GetBuildTooltip() const { - if ((inCommand >= 0) && ((size_t)inCommand < commands.size()) && - (commands[inCommand].type == CMDTYPE_ICON_BUILDING)) { + if ((size_t(inCommand) < commands.size()) && (commands[inCommand].type == CMDTYPE_ICON_BUILDING)) return commands[inCommand].tooltip; - } - return std::string(""); + + return ""; } @@ -2152,7 +2152,7 @@ Command CGuiHandler::GetCommand(int mouseX, int mouseY, int buttonHint, bool pre } } - if ((size_t)tempInCommand >= commands.size()) { + if (size_t(tempInCommand) >= commands.size()) { if (!preview) inCommand = -1; @@ -2192,8 +2192,7 @@ Command CGuiHandler::GetCommand(int mouseX, int mouseY, int buttonHint, bool pre if (unitdef == nullptr) return Command(CMD_STOP); - std::vector buildPos; - BuildInfo bi(unitdef, cameraPos + mouseDir * dist, buildFacing); + const BuildInfo bi(unitdef, cameraPos + mouseDir * dist, buildFacing); if (GetQueueKeystate() && (button == SDL_BUTTON_LEFT)) { const float3 camTracePos = mouse->buttons[SDL_BUTTON_LEFT].camPos; @@ -2202,30 +2201,32 @@ Command CGuiHandler::GetCommand(int mouseX, int mouseY, int buttonHint, bool pre const float traceDist = globalRendering->viewRange * 1.4f; const float isectDist = CGround::LineGroundWaterCol(camTracePos, camTraceDir, traceDist, unitdef->floatOnWater, false); - buildPos = GetBuildPos(BuildInfo(unitdef, camTracePos + camTraceDir * isectDist, buildFacing), bi, cameraPos, mouseDir); + GetBuildPositions(BuildInfo(unitdef, camTracePos + camTraceDir * isectDist, buildFacing), bi, cameraPos, mouseDir); } else { - buildPos = GetBuildPos(bi, bi, cameraPos, mouseDir); + GetBuildPositions(bi, bi, cameraPos, mouseDir); } - if (buildPos.empty()) + if (buildInfos.empty()) return Command(CMD_STOP); - if (buildPos.size() == 1) { + if (buildInfos.size() == 1) { CFeature* feature = nullptr; - // TODO Maybe also check out-of-range for immobile builder? - if (!CGameHelper::TestUnitBuildSquare(buildPos[0], feature, gu->myAllyTeam, false)) + // TODO: maybe also check out-of-range for immobile builder? + if (!CGameHelper::TestUnitBuildSquare(buildInfos[0], feature, gu->myAllyTeam, false)) return defaultRet; } if (!preview) { - for (auto bpi = buildPos.cbegin(); bpi != --buildPos.cend(); ++bpi) { - GiveCommand(bpi->CreateCommand(CreateOptions(button))); + // only issue if more than one entry, i.e. user created some + // kind of line/area queue (caller handles the last command) + for (auto beg = buildInfos.cbegin(), end = --buildInfos.cend(); beg != end; ++beg) { + GiveCommand(beg->CreateCommand(CreateOptions(button))); } } - return CheckCommand(buildPos.back().CreateCommand(CreateOptions(button))); + return CheckCommand((buildInfos.back()).CreateCommand(CreateOptions(button))); } case CMDTYPE_ICON_UNIT: { @@ -2446,16 +2447,20 @@ static void FillRowOfBuildPos(const BuildInfo& startInfo, float x, float z, floa } } -// Assuming both builds have the same unitdef -std::vector CGuiHandler::GetBuildPos(const BuildInfo& startInfo, const BuildInfo& endInfo, const float3& cameraPos, const float3& mouseDir) + +size_t CGuiHandler::GetBuildPositions(const BuildInfo& startInfo, const BuildInfo& endInfo, const float3& cameraPos, const float3& mouseDir) { - std::vector ret; + // both builds must have the same unitdef + assert(startInfo.def == endInfo.def); float3 start = CGameHelper::Pos2BuildPos(startInfo, false); float3 end = CGameHelper::Pos2BuildPos(endInfo, false); BuildInfo other; // the unit around which buildings can be circled + buildInfos.clear(); + buildInfos.reserve(16); + if (GetQueueKeystate() && KeyInput::GetKeyModState(KMOD_CTRL)) { const CUnit* unit = nullptr; const CFeature* feature = nullptr; @@ -2493,10 +2498,10 @@ std::vector CGuiHandler::GetBuildPos(const BuildInfo& startInfo, cons const int nvert = 1 + (oxsize / xsize); const int nhori = 1 + (ozsize / xsize); - FillRowOfBuildPos(startInfo, end.x + zsize / 2, start.z + xsize / 2, 0, xsize, nhori, 3, true, ret); - FillRowOfBuildPos(startInfo, end.x - xsize / 2, end.z + zsize / 2, -xsize, 0, nvert, 2, true, ret); - FillRowOfBuildPos(startInfo, start.x - zsize / 2, end.z - xsize / 2, 0, -xsize, nhori, 1, true, ret); - FillRowOfBuildPos(startInfo, start.x + xsize / 2, start.z - zsize / 2, xsize, 0, nvert, 0, true, ret); + FillRowOfBuildPos(startInfo, end.x + zsize / 2, start.z + xsize / 2, 0, xsize, nhori, 3, true, buildInfos); + FillRowOfBuildPos(startInfo, end.x - xsize / 2, end.z + zsize / 2, -xsize, 0, nvert, 2, true, buildInfos); + FillRowOfBuildPos(startInfo, start.x - zsize / 2, end.z - xsize / 2, 0, -xsize, nhori, 1, true, buildInfos); + FillRowOfBuildPos(startInfo, start.x + xsize / 2, start.z - zsize / 2, xsize, 0, nvert, 0, true, buildInfos); } else { // rectangle or line const float3 delta = end - start; @@ -2515,17 +2520,17 @@ std::vector CGuiHandler::GetBuildPos(const BuildInfo& startInfo, cons if (KeyInput::GetKeyModState(KMOD_CTRL)) { if ((1 < xnum) && (1 < znum)) { // go "down" on the "left" side - FillRowOfBuildPos(startInfo, start.x , start.z + zstep , 0, zstep, znum - 1, 0, false, ret); + FillRowOfBuildPos(startInfo, start.x , start.z + zstep , 0, zstep, znum - 1, 0, false, buildInfos); // go "right" on the "bottom" side - FillRowOfBuildPos(startInfo, start.x + xstep , start.z + (znum - 1) * zstep, xstep, 0, xnum - 1, 0, false, ret); + FillRowOfBuildPos(startInfo, start.x + xstep , start.z + (znum - 1) * zstep, xstep, 0, xnum - 1, 0, false, buildInfos); // go "up" on the "right" side - FillRowOfBuildPos(startInfo, start.x + (xnum - 1) * xstep, start.z + (znum - 2) * zstep, 0, -zstep, znum - 1, 0, false, ret); + FillRowOfBuildPos(startInfo, start.x + (xnum - 1) * xstep, start.z + (znum - 2) * zstep, 0, -zstep, znum - 1, 0, false, buildInfos); // go "left" on the "top" side - FillRowOfBuildPos(startInfo, start.x + (xnum - 2) * xstep, start.z , -xstep, 0, xnum - 1, 0, false, ret); + FillRowOfBuildPos(startInfo, start.x + (xnum - 2) * xstep, start.z , -xstep, 0, xnum - 1, 0, false, buildInfos); } else if (1 == xnum) { - FillRowOfBuildPos(startInfo, start.x, start.z, 0, zstep, znum, 0, false, ret); + FillRowOfBuildPos(startInfo, start.x, start.z, 0, zstep, znum, 0, false, buildInfos); } else if (1 == znum) { - FillRowOfBuildPos(startInfo, start.x, start.z, xstep, 0, xnum, 0, false, ret); + FillRowOfBuildPos(startInfo, start.x, start.z, xstep, 0, xnum, 0, false, buildInfos); } } else { // filled @@ -2533,10 +2538,10 @@ std::vector CGuiHandler::GetBuildPos(const BuildInfo& startInfo, cons for (float z = start.z; zn < znum; ++zn) { if (zn & 1) { // every odd line "right" to "left" - FillRowOfBuildPos(startInfo, start.x + (xnum - 1) * xstep, z, -xstep, 0, xnum, 0, false, ret); + FillRowOfBuildPos(startInfo, start.x + (xnum - 1) * xstep, z, -xstep, 0, xnum, 0, false, buildInfos); } else { // every even line "left" to "right" - FillRowOfBuildPos(startInfo, start.x , z, xstep, 0, xnum, 0, false, ret); + FillRowOfBuildPos(startInfo, start.x , z, xstep, 0, xnum, 0, false, buildInfos); } z += zstep; } @@ -2551,11 +2556,11 @@ std::vector CGuiHandler::GetBuildPos(const BuildInfo& startInfo, cons xstep = KeyInput::GetKeyModState(KMOD_CTRL) ? 0 : zstep * delta.x / (delta.z ? delta.z : 1); } - FillRowOfBuildPos(startInfo, start.x, start.z, xstep, zstep, xDominatesZ ? xnum : znum, 0, false, ret); + FillRowOfBuildPos(startInfo, start.x, start.z, xstep, zstep, xDominatesZ ? xnum : znum, 0, false, buildInfos); } } - return ret; + return (buildInfos.size()); } @@ -3195,8 +3200,9 @@ void CGuiHandler::DrawSelectionInfo() void CGuiHandler::DrawNumberInput() // Only called by drawbuttons { // draw the value for CMDTYPE_NUMBER commands - if ((inCommand >= 0) && ((size_t)inCommand < commands.size())) { + if (size_t(inCommand) < commands.size()) { const SCommandDescription& cd = commands[inCommand]; + if (cd.type == CMDTYPE_NUMBER) { const float value = GetNumberInput(cd); glDisable(GL_TEXTURE_2D); @@ -3447,9 +3453,9 @@ static inline void DrawWeaponArc(const CUnit* unit) } -void CGuiHandler::DrawMapStuff(bool onMinimap) +void CGuiHandler::DrawMapStuff(bool onMiniMap) { - if (!onMinimap) { + if (!onMiniMap) { glEnable(GL_DEPTH_TEST); glDepthMask(GL_FALSE); glDisable(GL_TEXTURE_2D); @@ -3472,7 +3478,7 @@ void CGuiHandler::DrawMapStuff(bool onMinimap) tracePos = minimap->GetMapPosition(mouse->lastx, mouse->lasty); traceDir = -UpVector; - if (miniMapMarker && minimap->FullProxy() && !onMinimap && !minimap->GetMinimized()) { + if (miniMapMarker && minimap->FullProxy() && !onMiniMap && !minimap->GetMinimized()) { DrawMiniMapMarker(tracePos); } } @@ -3482,7 +3488,7 @@ void CGuiHandler::DrawMapStuff(bool onMinimap) int cmdIndex = -1; int button = SDL_BUTTON_LEFT; - if ((inCommand >= 0) && ((size_t)inCommand < commands.size())) { + if (size_t(inCommand) < commands.size()) { cmdIndex = inCommand; } else { if (mouse->buttons[SDL_BUTTON_RIGHT].pressed && @@ -3505,7 +3511,7 @@ void CGuiHandler::DrawMapStuff(bool onMinimap) if (cmdDesc.params.size() > 1) sizeDiv = atof(cmdDesc.params[1].c_str()); - DrawFormationFrontOrder(button, maxSize, sizeDiv, onMinimap, tracePos, traceDir); + DrawFormationFrontOrder(button, maxSize, sizeDiv, onMiniMap, tracePos, traceDir); } } break; @@ -3559,7 +3565,7 @@ void CGuiHandler::DrawMapStuff(bool onMinimap) } } - if (!onMinimap) { + if (!onMiniMap) { DrawArea(innerPos, radius, color); } else { glColor4f(color[0], color[1], color[2], 0.5f); @@ -3596,7 +3602,7 @@ void CGuiHandler::DrawMapStuff(bool onMinimap) const float3 innerPos = camTracePos + camTraceDir * innerDist; const float3 outerPos = tracePos + traceDir * outerDist; - if (!onMinimap) { + if (!onMiniMap) { DrawSelectBox(innerPos, outerPos, tracePos); } else { glColor4f(1.0f, 0.0f, 0.0f, 0.5f); @@ -3613,7 +3619,7 @@ void CGuiHandler::DrawMapStuff(bool onMinimap) } } - if (!onMinimap) { + if (!onMiniMap) { glBlendFunc((GLenum) cmdColors.SelectedBlendSrc(), (GLenum) cmdColors.SelectedBlendDst()); glLineWidth(cmdColors.SelectedLineWidth()); } else { @@ -3690,7 +3696,7 @@ void CGuiHandler::DrawMapStuff(bool onMinimap) } // draw buildings we are about to build - if ((inCommand >= 0) && ((size_t)inCommand < commands.size()) && (commands[inCommand].type == CMDTYPE_ICON_BUILDING)) { + if ((size_t(inCommand) < commands.size()) && (commands[inCommand].type == CMDTYPE_ICON_BUILDING)) { { // draw build distance for all immobile builders during build commands for (const auto bi: unitHandler.GetBuilderCAIs()) { @@ -3729,21 +3735,22 @@ void CGuiHandler::DrawMapStuff(bool onMinimap) const float3 cPos = tracePos + traceDir * dist; const float3 bPos = bp.camPos + bp.dir * bpDist; - std::vector buildInfos; - if (GetQueueKeystate() && bp.pressed) { const BuildInfo cInfo = BuildInfo(unitdef, cPos, buildFacing); const BuildInfo bInfo = BuildInfo(unitdef, bPos, buildFacing); - buildInfos = std::move(GetBuildPos(bInfo, cInfo, tracePos, traceDir)); + buildColors.clear(); + buildColors.reserve(GetBuildPositions(bInfo, cInfo, tracePos, traceDir)); } else { const BuildInfo bi(unitdef, cPos, buildFacing); - buildInfos = std::move(GetBuildPos(bi, bi, tracePos, traceDir)); + buildColors.clear(); + buildColors.reserve(GetBuildPositions(bi, bi, tracePos, traceDir)); } - for (auto bpi = buildInfos.cbegin(); bpi != buildInfos.cend(); ++bpi) { - const float3& buildPos = bpi->pos; + + for (const BuildInfo& bi: buildInfos) { + const float3& buildPos = bi.pos; DrawUnitDefRanges(nullptr, unitdef, buildPos); @@ -3754,11 +3761,13 @@ void CGuiHandler::DrawMapStuff(bool onMinimap) glBallisticCircle(unitdef->weapons[0].def, 40, buildPos, {unitdef->weapons[0].def->range, unitdef->weapons[0].def->heightmod, mapInfo->map.gravity}); glEnable(GL_DEPTH_TEST); } + // draw extraction range - if (unitdef->extractRange > 0) { + if (unitdef->extractRange > 0.0f) { glColor4fv(cmdColors.rangeExtract); glSurfaceCircle(buildPos, unitdef->extractRange, 40); } + // draw interceptor range const WeaponDef* wd = unitdef->stockpileWeaponDef; if ((wd != nullptr) && wd->interceptor) { @@ -3766,31 +3775,34 @@ void CGuiHandler::DrawMapStuff(bool onMinimap) glSurfaceCircle(buildPos, wd->coverageRange, 40); } - std::vector cv; - if (GetQueueKeystate()) { - const Command c = bpi->CreateCommand(); + buildCommands.clear(); + + const Command c = bi.CreateCommand(); + for (const int unitID: selectedUnitsHandler.selectedUnits) { const CUnit* su = unitHandler.GetUnit(unitID); const CCommandAI* cai = su->commandAI; + for (const Command& cmd: cai->GetOverlapQueued(c)) { - cv.push_back(cmd); + buildCommands.push_back(cmd); } } } - if (unitDrawer->ShowUnitBuildSquare(*bpi, cv)) { - glColor4f(0.7f,1,1,0.4f); + + if (unitDrawer->ShowUnitBuildSquare(bi, buildCommands)) { + glColor4f(0.7f, 1.0f, 1.0f, 0.4f); } else { - glColor4f(1,0.5f,0.5f,0.4f); + glColor4f(1.0f, 0.5f, 0.5f, 0.4f); } - if (!onMinimap) { + if (!onMiniMap) { glPushMatrix(); glLoadIdentity(); glTranslatef3(buildPos); - glRotatef(bpi->buildFacing * 90.0f, 0.0f, 1.0f, 0.0f); + glRotatef(bi.buildFacing * 90.0f, 0.0f, 1.0f, 0.0f); - CUnitDrawer::DrawIndividualDefAlpha(bpi->def, gu->myTeam, false); + CUnitDrawer::DrawIndividualDefAlpha(bi.def, gu->myTeam, false); glPopMatrix(); glBlendFunc((GLenum)cmdColors.SelectedBlendSrc(), (GLenum)cmdColors.SelectedBlendDst()); @@ -3800,19 +3812,26 @@ void CGuiHandler::DrawMapStuff(bool onMinimap) } } - // draw range circles if attack orders are imminent + // draw range circles (for immobile units) if attack orders are imminent const int defcmd = GetDefaultCommand(mouse->lastx, mouse->lasty, tracePos, traceDir); - if ((inCommand >= 0 && (size_t)inCommand 0 && commands[defcmd].id == CMD_ATTACK) - ) { + const bool playerAttackCmd = (size_t(inCommand) < commands.size() && commands[inCommand].id == CMD_ATTACK); + const bool defaultAttackCmd = (inCommand == -1 && defcmd > 0 && commands[defcmd].id == CMD_ATTACK); + const bool drawWeaponRanges = (!onMiniMap && gs->cheatEnabled && globalRendering->drawdebug); + + if ((playerAttackCmd || defaultAttackCmd) && drawWeaponRanges) { for (const int unitID: selectedUnitsHandler.selectedUnits) { const CUnit* unit = unitHandler.GetUnit(unitID); if (unit == pointedAt) continue; - if (onMinimap && (unit->unitDef->speed > 0.0f)) + if (unit->maxRange <= 0.0f) + continue; + if (unit->weapons.empty()) + continue; + // only consider (armed) static structures + if (unit->unitDef->speed > 0.0f) continue; if (!gu->spectatingFullView && !unit->IsInLosForAllyTeam(gu->myAllyTeam)) @@ -3829,7 +3848,7 @@ void CGuiHandler::DrawMapStuff(bool onMinimap) glLineWidth(1.0f); - if (!onMinimap) { + if (!onMiniMap) { glDepthMask(GL_TRUE); glDisable(GL_BLEND); } @@ -3891,19 +3910,19 @@ void CGuiHandler::DrawMiniMapMarker(const float3& cameraPos) void CGuiHandler::DrawCentroidCursor() { int cmd = -1; - if ((inCommand >= 0) && ((size_t)inCommand < commands.size())) { + if (size_t(inCommand) < commands.size()) { cmd = commands[inCommand].id; } else { - int defcmd; - if (mouse->buttons[SDL_BUTTON_RIGHT].pressed && - ((activeReceiver == this) || (minimap->ProxyMode()))) { + size_t defcmd = 0; + + if (mouse->buttons[SDL_BUTTON_RIGHT].pressed && ((activeReceiver == this) || (minimap->ProxyMode()))) { defcmd = defaultCmdMemory; } else { defcmd = GetDefaultCommand(mouse->lastx, mouse->lasty); } - if ((defcmd >= 0) && ((size_t)defcmd < commands.size())) { + + if (defcmd < commands.size()) cmd = commands[defcmd].id; - } } if ((cmd == CMD_MOVE) || (cmd == CMD_GATHERWAIT)) { @@ -4136,7 +4155,6 @@ static void StencilDrawSelectBox(const float3& pos0, const float3& pos1, glDisable(GL_TEXTURE_2D); glDisable(GL_FOG); - glEnable(GL_BLEND); if (!invColorSelect) { @@ -4151,7 +4169,6 @@ static void StencilDrawSelectBox(const float3& pos0, const float3& pos1, } DrawCornerPosts(pos0, pos1); - glEnable(GL_FOG); } @@ -4298,7 +4315,6 @@ void CGuiHandler::DrawSelectCircle(const float3& pos, float radius, glDisable(GL_TEXTURE_2D); glDisable(GL_FOG); - glEnable(GL_BLEND); glBlendFunc(GL_SRC_ALPHA, GL_ONE); glColor4f(color[0], color[1], color[2], 0.25f); @@ -4337,3 +4353,4 @@ void CGuiHandler::SetBuildSpacing(int spacing) /******************************************************************************/ /******************************************************************************/ + diff --git a/rts/Game/UI/GuiHandler.h b/rts/Game/UI/GuiHandler.h index 6e993233101..3c02cf20b16 100644 --- a/rts/Game/UI/GuiHandler.h +++ b/rts/Game/UI/GuiHandler.h @@ -9,13 +9,14 @@ #include "InputReceiver.h" #include "MouseHandler.h" #include "Game/Camera.h" +#include "Sim/Units/BuildInfo.h" #include "Sim/Units/CommandAI/Command.h" #define DEFAULT_GUI_CONFIG "ctrlpanel.txt" class CUnit; struct UnitDef; -struct BuildInfo; + class Action; struct SCommandDescription; @@ -29,7 +30,7 @@ class CGuiHandler : public CInputReceiver { void Update(); void Draw(); - void DrawMapStuff(bool onMinimap); + void DrawMapStuff(bool onMiniMap); void DrawCentroidCursor(); bool AboveGui(int x, int y); @@ -58,7 +59,7 @@ class CGuiHandler : public CInputReceiver { } Command GetCommand(int mouseX, int mouseY, int buttonHint, bool preview, const float3& cameraPos, const float3& mouseDir); /// startInfo.def has to be endInfo.def - std::vector GetBuildPos(const BuildInfo& startInfo, const BuildInfo& endInfo, const float3& cameraPos, const float3& mouseDir); + size_t GetBuildPositions(const BuildInfo& startInfo, const BuildInfo& endInfo, const float3& cameraPos, const float3& mouseDir); bool EnableLuaUI(bool enableCommand); bool DisableLuaUI(bool layoutIcons = true); @@ -151,7 +152,7 @@ class CGuiHandler : public CInputReceiver { void DrawSelectionInfo(); void DrawNumberInput(); void DrawMiniMapMarker(const float3& cameraPos); - void DrawFormationFrontOrder(int button, float maxSize, float sizeDiv, bool onMinimap, const float3& cameraPos, const float3& mouseDir); + void DrawFormationFrontOrder(int button, float maxSize, float sizeDiv, bool onMiniMap, const float3& cameraPos, const float3& mouseDir); void DrawArea(float3 pos, float radius, const float* color); void DrawSelectBox(const float3& start, const float3& end, const float3& cameraPos); void DrawSelectCircle(const float3& pos, float radius, const float* color); @@ -245,8 +246,14 @@ class CGuiHandler : public CInputReceiver { std::vector layoutCommands; std::vector< std::pair > commandsToGive; + + // DrawMapStuff caches + std::vector buildInfos; + std::vector buildCommands; + std::vector buildColors; }; extern CGuiHandler* guihandler; #endif /* GUI_HANDLER_H */ +