diff --git a/Sources/Client/Client.cpp b/Sources/Client/Client.cpp index f785d158..59a5a787 100644 --- a/Sources/Client/Client.cpp +++ b/Sources/Client/Client.cpp @@ -124,7 +124,7 @@ namespace spades { scoreboard = stmp::make_unique(this); limbo = stmp::make_unique(this); paletteView = stmp::make_unique(this); - tcView = stmp::make_unique(this); + tcView = stmp::make_unique(*this); scriptedUI = Handle::New(renderer.GetPointerOrNull(), audioDev.GetPointerOrNull(), fontManager.GetPointerOrNull(), this); diff --git a/Sources/Client/TCProgressView.cpp b/Sources/Client/TCProgressView.cpp index 33a75e65..b68c1a68 100644 --- a/Sources/Client/TCProgressView.cpp +++ b/Sources/Client/TCProgressView.cpp @@ -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) { diff --git a/Sources/Client/TCProgressView.h b/Sources/Client/TCProgressView.h index 963133d7..13d35fb9 100644 --- a/Sources/Client/TCProgressView.h +++ b/Sources/Client/TCProgressView.h @@ -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();