// // Delete all cursors // void DeleteAll() { ASSERT(sysInit); // Unset the current cursor current = NULL; // Clear standard cursors for (int i = 0; i < MAX_CURSORS; i++) { standardCrs[i] = 0; } // Delete all cursors cursors.DisposeAll(); }
/////////////////////////////////////////////////////////////////////////////// // // Quake::Done // void Done() { if (!soundoff) { effect->StopByEffect(); soundoff = TRUE; } if (effect) { delete effect; } typeList.DisposeAll(); VarSys::DeleteItem("quake"); sysInit = FALSE; }
// // DrawSelf // // Redraw self // void Color::DrawSelf(PaintInfo &pi) { IControl::DrawSelf(pi); // Get the color for the current color const PlayerInfo *playerInfo; Data::Get(&playerInfo, Network::GetCurrentPlayer().GetId()); ASSERT(playerInfo); ASSERT(teamId < Game::MAX_TEAMS); const Team *team; Data::Get(&team, teamId); ASSERT(team); // Update the current color colorCurrent->SetIntegerValue(team->color); // Figure out which colors are available BinTree<GroupTree> groups; BuildPlayerHierachy(groups); Bool colors[Game::MAX_TEAMS + 1]; for (U32 t = 0; t <= Game::MAX_TEAMS; t++) { colors[t] = FALSE; } for (BinTree<GroupTree>::Iterator gti(&groups); *gti; gti++) { for (BinTree<TeamTree>::Iterator tti(&(*gti)->teams); *tti; tti++) { colors[(*tti)->team->color] = TRUE; } } groups.DisposeAll(); /* // Is the currently selected color still available ? if (colors[colorSelected->GetIntegerValue()]) { colorSelected->SetIntegerValue(team->color); } */ // Display all of the available colors for (t = 0; t <= Game::MAX_TEAMS; t++) { // Is the color available ? if (!colors[t] || t == team->color) { Point<S32> p(t * pi.client.Height(), 0); // Draw the team color ClipRect c( pi.client.p0.x + p.x + 3, pi.client.p0.y + p.y + 3, pi.client.p0.x + p.x + pi.client.Height() - 3, pi.client.p0.y + p.y + pi.client.Height() - 3); IFace::RenderShadow( c, c + IFace::GetMetric(IFace::DROPSHADOW_UP), ::Color(0, 0, 0, IFace::GetMetric(IFace::SHADOW_ALPHA)), 0); IFace::RenderGradient(c, GetTeamColor(t), 150); // Is this the selected color ? if (t == U32(colorSelected->GetIntegerValue())) { IFace::RenderGradient( ClipRect( pi.client.p0.x + p.x + 1, pi.client.p0.y + p.y + 1, pi.client.p0.x + p.x + pi.client.Height() - 1, pi.client.p0.y + p.y + pi.client.Height() - 1), ::Color(1.0f, 1.0f, 1.0f, 0.4f), ::Color(0.5f, 0.5f, 0.5f, 0.4f)); } // Is this the current color ? else if (t == team->color) { IFace::RenderGradient( ClipRect( pi.client.p0.x + p.x + 1, pi.client.p0.y + p.y + 1, pi.client.p0.x + p.x + pi.client.Height() - 1, pi.client.p0.y + p.y + pi.client.Height() - 1), ::Color(1.0f, 1.0f, 1.0f, 0.15f), ::Color(0.5f, 0.5f, 0.5f, 0.15f)); } } } }