MCPcopy Create free account
hub / github.com/Warzone2100/warzone2100 / queueStructureBuildProgress

Function queueStructureBuildProgress

src/display3d.cpp:3382–3392  ·  view source on GitHub ↗

draw the construction bar for the specified structure

Source from the content-addressed store, hash-verified

3380
3381/// draw the construction bar for the specified structure
3382static void queueStructureBuildProgress(STRUCTURE *psStruct, BatchedMultiRectRenderer& batchedMultiRectRenderer, size_t rectGroup)
3383{
3384 int32_t scale = static_cast<int32_t>(MAX(psStruct->pStructureType->baseWidth, psStruct->pStructureType->baseBreadth));
3385 int32_t scrX = static_cast<int32_t>(psStruct->sDisplay.screenX);
3386 int32_t scrY = static_cast<int32_t>(psStruct->sDisplay.screenY) + (scale * 10);
3387 int32_t scrR = scale * 20;
3388 auto progress = scale * 40 * structureCompletionProgress(*psStruct);
3389 batchedMultiRectRenderer.addRectF(PIERECT_DrawRequest_f(scrX - scrR - 1, scrY - 1 + 5, scrX + scrR + 1, scrY + 3 + 5, WZCOL_RELOAD_BACKGROUND), rectGroup);
3390 batchedMultiRectRenderer.addRectF(PIERECT_DrawRequest_f(scrX - scrR, scrY + 5, scrX - scrR + progress, scrY + 1 + 5, WZCOL_HEALTH_MEDIUM_SHADOW), rectGroup);
3391 batchedMultiRectRenderer.addRectF(PIERECT_DrawRequest_f(scrX - scrR, scrY + 1 + 5, scrX - scrR + progress, scrY + 2 + 5, WZCOL_HEALTH_MEDIUM), rectGroup);
3392}
3393
3394/// Draw the health of structures and show enemy structures being targetted
3395static void drawStructureSelections()

Calls 3

addRectFMethod · 0.80

Tested by

no test coverage detected