TCProgressView: Replace Client * with Client &

This commit is contained in:
yvt 2019-08-08 01:10:28 +09:00
parent 1a4594d9bd
commit 99489cab66
No known key found for this signature in database
GPG Key ID: 48F2768FA8D07C92
3 changed files with 7 additions and 6 deletions

View File

@ -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);

View File

@ -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) {

View File

@ -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();