• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

Return-To-The-Roots / s25client / 44076625557

17 Nov 2026 11:43AM UTC coverage: 51.803% (-0.002%) from 51.805%
44076625557

push

github

web-flow
Merge pull request #2018 from Return-To-The-Roots/refactor/lowerCamelCase-methods

Rename Msg_* handlers to lowerCamelCase

8121 of 16693 new or added lines in 565 files covered. (48.65%)

323 existing lines in 133 files now uncovered.

24236 of 46785 relevant lines covered (51.8%)

49647.74 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

24.0
/libs/s25main/nodeObjs/noSign.cpp
1
// Copyright (C) 2005 - 2021 Settlers Freaks (sf-team at siedler25.org)
2
//
3
// SPDX-License-Identifier: GPL-2.0-or-later
4

5
#include "noSign.h"
6
#include "GlobalGameSettings.h"
7
#include "Loader.h"
8
#include "SerializedGameData.h"
9
#include "addons/AddonDurableGeologistSigns.h"
10
#include "addons/const_addons.h"
11
#include "ogl/glArchivItem_Bitmap.h"
12
#include "ogl/glArchivItem_Bitmap_Player.h"
13
#include "world/GameWorld.h"
14
#include <algorithm>
15

16
noSign::noSign(const MapPoint pos, Resource resource)
44 ✔
17
    : noDisappearingEnvObject(
18
      pos, 8500 * (signDurabilityFactor[world->getGGS().getSelection(AddonId::DURABLE_GEOLOGIST_SIGNS)]), 500),
44 ✔
19
      resource(resource)
88 ✔
20
{
21
    // As this is only for drawing we set the type to nothing if the resource is depleted
22
    if(resource.getAmount() == 0u)
44 ✔
23
        this->resource.setType(ResourceType::Nothing);
37 ✔
24
}
44 ✔
25

NEW
26
void noSign::serialize(SerializedGameData& sgd) const
×
27
{
NEW
28
    noDisappearingEnvObject::serialize(sgd);
×
29

30
    sgd.PushUnsignedChar(resource.getValue());
×
31
}
×
32

33
noSign::noSign(SerializedGameData& sgd, const unsigned obj_id)
×
34
    : noDisappearingEnvObject(sgd, obj_id), resource(sgd.PopUnsignedChar())
×
35
{}
×
36

NEW
37
void noSign::draw(DrawPoint drawPt)
×
38
{
39
    // Schild selbst
40
    unsigned imgId;
41
    switch(resource.getType())
×
42
    {
43
        case ResourceType::Iron: imgId = 680; break;
×
44
        case ResourceType::Gold: imgId = 683; break;
×
45
        case ResourceType::Coal: imgId = 686; break;
×
46
        case ResourceType::Granite: imgId = 689; break;
×
47
        case ResourceType::Water: imgId = 692; break;
×
48
        case ResourceType::Nothing: imgId = 695; break;
×
49
        default: return;
×
50
    }
51
    imgId += std::min(resource.getAmount() / 3u, 2u);
×
NEW
52
    LOADER.getMapTexture(imgId)->drawFull(drawPt, getDrawColor());
×
53

54
    // Schatten des Schildes
NEW
55
    LOADER.getMapTexture(700)->drawFull(drawPt, getDrawShadowColor());
×
56
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE TRIAL · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc