TCProgressView
: Replace Client *
with Client &
This commit is contained in:
parent
1a4594d9bd
commit
99489cab66
@ -124,7 +124,7 @@ namespace spades {
|
||||
scoreboard = stmp::make_unique<ScoreboardView>(this);
|
||||
limbo = stmp::make_unique<LimboView>(this);
|
||||
paletteView = stmp::make_unique<PaletteView>(this);
|
||||
tcView = stmp::make_unique<TCProgressView>(this);
|
||||
tcView = stmp::make_unique<TCProgressView>(*this);
|
||||
scriptedUI =
|
||||
Handle<ClientUI>::New(renderer.GetPointerOrNull(), audioDev.GetPointerOrNull(),
|
||||
fontManager.GetPointerOrNull(), this);
|
||||
|
@ -34,7 +34,8 @@ namespace spades {
|
||||
float progress; // 0 = team1 owns
|
||||
};
|
||||
|
||||
TCProgressView::TCProgressView(Client *c) : client(c), renderer(c->GetRenderer()) {
|
||||
TCProgressView::TCProgressView(Client &client)
|
||||
: client(client), renderer(client.GetRenderer()) {
|
||||
lastTerritoryId = -1;
|
||||
}
|
||||
|
||||
@ -61,7 +62,7 @@ namespace spades {
|
||||
}
|
||||
|
||||
void TCProgressView::Draw() {
|
||||
World *w = client->GetWorld();
|
||||
World *w = client.GetWorld();
|
||||
if (!w) {
|
||||
lastTerritoryId = -1;
|
||||
return;
|
||||
@ -147,7 +148,7 @@ namespace spades {
|
||||
AABB2((1.f - state.progress) * 256.f, 0, state.progress * 256.f, 32));
|
||||
}
|
||||
|
||||
IFont &font = client->fontManager->GetGuiFont();
|
||||
IFont &font = client.fontManager->GetGuiFont();
|
||||
std::string str;
|
||||
|
||||
if (nearTerritory->ownerTeamId == 2) {
|
||||
|
@ -25,14 +25,14 @@ namespace spades {
|
||||
class Client;
|
||||
class IRenderer;
|
||||
class TCProgressView {
|
||||
Client *client;
|
||||
Client &client;
|
||||
IRenderer &renderer;
|
||||
|
||||
int lastTerritoryId;
|
||||
float lastTerritoryTime;
|
||||
|
||||
public:
|
||||
TCProgressView(Client *);
|
||||
TCProgressView(Client &);
|
||||
~TCProgressView();
|
||||
|
||||
void Draw();
|
||||
|
Loading…
x
Reference in New Issue
Block a user