From 5db97f7f106d0ce1f2099096129c646d0be8fac2 Mon Sep 17 00:00:00 2001 From: yvt Date: Wed, 17 Jul 2019 00:31:22 +0900 Subject: [PATCH] clang-format --- Sources/Client/CTFGameMode.h | 4 +- Sources/Client/ClientPlayer.cpp | 8 ++- Sources/Client/ClientPlayer.h | 4 +- Sources/Client/Client_Draw.cpp | 21 ++++---- Sources/Client/Client_Input.cpp | 15 +++--- Sources/Client/Client_Scene.cpp | 79 +++++++++++++++++------------- Sources/Client/Client_Update.cpp | 30 ++++++------ Sources/Client/Corpse.cpp | 15 +++--- Sources/Client/Corpse.h | 4 +- Sources/Client/FallingBlock.cpp | 34 +++++++------ Sources/Client/HitTestDebugger.cpp | 8 +-- Sources/Client/HurtRingView.cpp | 4 +- Sources/Client/Player.h | 2 +- Sources/Client/TCGameMode.cpp | 6 +-- Sources/Client/TCGameMode.h | 4 +- Sources/Client/Weapon.cpp | 9 ++-- Sources/Core/RefCountedObject.h | 2 +- 17 files changed, 129 insertions(+), 120 deletions(-) diff --git a/Sources/Client/CTFGameMode.h b/Sources/Client/CTFGameMode.h index adb61635..26a05221 100644 --- a/Sources/Client/CTFGameMode.h +++ b/Sources/Client/CTFGameMode.h @@ -54,5 +54,5 @@ namespace spades { bool PlayerHasIntel(World &world, Player &player); }; - } -} + } // namespace client +} // namespace spades diff --git a/Sources/Client/ClientPlayer.cpp b/Sources/Client/ClientPlayer.cpp index 478e1e10..483aca4c 100644 --- a/Sources/Client/ClientPlayer.cpp +++ b/Sources/Client/ClientPlayer.cpp @@ -530,8 +530,7 @@ namespace spades { eye.z -= p * 0.06f * sp; } - return Matrix4::FromAxis(-player.GetRight(), player.GetFront(), -player.GetUp(), - eye); + return Matrix4::FromAxis(-player.GetRight(), player.GetFront(), -player.GetUp(), eye); } void ClientPlayer::SetSkinParameterForTool(Player::ToolType type, asIScriptObject *skin) { @@ -548,7 +547,7 @@ namespace spades { interface.SetActionProgress(p.GetSpadeAnimationProgress()); } else if (inp.secondary) { interface.SetActionType(p.IsFirstDig() ? SpadeActionTypeDigStart - : SpadeActionTypeDig); + : SpadeActionTypeDig); interface.SetActionProgress(p.GetDigAnimationProgress()); } else { interface.SetActionType(SpadeActionTypeIdle); @@ -697,8 +696,7 @@ namespace spades { float sp = 1.f - aimDownState; sp *= .3f; sp *= std::min(1.f, p.GetVelocty().GetLength() * 5.f); - viewWeaponOffset.x += - sinf(p.GetWalkAnimationProgress() * M_PI * 2.f) * 0.013f * sp; + viewWeaponOffset.x += sinf(p.GetWalkAnimationProgress() * M_PI * 2.f) * 0.013f * sp; float vl = cosf(p.GetWalkAnimationProgress() * M_PI * 2.f); vl *= vl; viewWeaponOffset.z += vl * 0.018f * sp; diff --git a/Sources/Client/ClientPlayer.h b/Sources/Client/ClientPlayer.h index c9f6ada5..ba75c0b0 100644 --- a/Sources/Client/ClientPlayer.h +++ b/Sources/Client/ClientPlayer.h @@ -114,5 +114,5 @@ namespace spades { Matrix4 GetEyeMatrix(); }; - } -} + } // namespace client +} // namespace spades diff --git a/Sources/Client/Client_Draw.cpp b/Sources/Client/Client_Draw.cpp index c84e3ef7..5ac71e61 100644 --- a/Sources/Client/Client_Draw.cpp +++ b/Sources/Client/Client_Draw.cpp @@ -32,6 +32,7 @@ #include "IAudioChunk.h" #include "IAudioDevice.h" +#include "CTFGameMode.h" #include "CenterMessageView.h" #include "ChatWindow.h" #include "ClientPlayer.h" @@ -41,6 +42,7 @@ #include "Fonts.h" #include "HurtRingView.h" #include "IFont.h" +#include "IGameMode.h" #include "ILocalEntity.h" #include "LimboView.h" #include "MapView.h" @@ -50,8 +52,6 @@ #include "SmokeSpriteEntity.h" #include "TCProgressView.h" #include "Tracer.h" -#include "IGameMode.h" -#include "CTFGameMode.h" #include "GameMap.h" #include "Grenade.h" @@ -103,7 +103,7 @@ namespace spades { return name; } } - } + } // namespace void Client::TakeScreenShot(bool sceneOnly) { SceneDefinition sceneDef = CreateSceneDefinition(); @@ -290,7 +290,7 @@ namespace spades { if ((int)cg_playerNames == 0) return; - + Player &p = GetWorld()->GetLocalPlayer().value(); hitTag_t tag = hit_None; @@ -429,7 +429,7 @@ namespace spades { Handle img(renderer->RegisterImage("Gfx/Intel.png"), false); // Strobe - Vector4 color {1.0f, 1.0f, 1.0f, 1.0f}; + Vector4 color{1.0f, 1.0f, 1.0f, 1.0f}; color *= std::fabs(std::sin(world->GetTime() * 2.0f)); renderer->SetColorAlphaPremultiplied(color); @@ -559,7 +559,7 @@ namespace spades { } else if (weap.GetAmmo() == 0 && weap.GetStock() == 0) { msg = _Tr("Client", "Out of Ammo"); } else if (weap.GetStock() > 0 && - weap.GetAmmo() < weap.GetClipSize() / 4) { + weap.GetAmmo() < weap.GetClipSize() / 4) { msg = _Tr("Client", "Press [{0}] to Reload", TranslateKeyName(cg_keyReloadWeapon)); } @@ -756,8 +756,9 @@ namespace spades { color = Vector4(1.f, 1.f, 1.f, 1.f); color *= fade; - font->DrawShadow(alertContents, Vector2(pos.x + contentsSize.x - textSize.x - margin, - pos.y + (contentsSize.y - textSize.y) * 0.5f), + font->DrawShadow(alertContents, + Vector2(pos.x + contentsSize.x - textSize.x - margin, + pos.y + (contentsSize.y - textSize.y) * 0.5f), 1.f, color, Vector4(0.f, 0.f, 0.f, fade * 0.5f)); } @@ -966,5 +967,5 @@ namespace spades { DrawStats(); } - } -} + } // namespace client +} // namespace spades diff --git a/Sources/Client/Client_Input.cpp b/Sources/Client/Client_Input.cpp index 5a6018a7..55956626 100644 --- a/Sources/Client/Client_Input.cpp +++ b/Sources/Client/Client_Input.cpp @@ -27,8 +27,8 @@ #include "IAudioChunk.h" #include "IAudioDevice.h" -#include "ClientUI.h" #include "ChatWindow.h" +#include "ClientUI.h" #include "Corpse.h" #include "LimboView.h" #include "MapView.h" @@ -441,7 +441,7 @@ namespace spades { } if (world->GetLocalPlayer()->IsToolWeapon() && weapInput.secondary && !lastVal && world->GetLocalPlayer()->IsReadyToUseTool() && - !world->GetLocalPlayer()->GetWeapon().IsReloading() && + !world->GetLocalPlayer()->GetWeapon().IsReloading() && GetSprintState() == 0.0f) { AudioParam params; params.volume = 0.08f; @@ -453,7 +453,7 @@ namespace spades { Weapon &w = world->GetLocalPlayer()->GetWeapon(); if (w.GetAmmo() < w.GetClipSize() && w.GetStock() > 0 && (!world->GetLocalPlayer()->IsAwaitingReloadCompletion()) && - (!w.IsReloading()) && + (!w.IsReloading()) && world->GetLocalPlayer()->GetTool() == Player::ToolWeapon) { if (world->GetLocalPlayer()->IsToolWeapon()) { if (weapInput.secondary) { @@ -553,7 +553,7 @@ namespace spades { } else if (CheckKey(cg_keyLimbo, name) && down) { limbo->SetSelectedTeam(world->GetLocalPlayer()->GetTeamId()); limbo->SetSelectedWeapon( - world->GetLocalPlayer()->GetWeapon().GetWeaponType()); + world->GetLocalPlayer()->GetWeapon().GetWeaponType()); inGameLimbo = true; } else if (CheckKey(cg_keySceneshot, name) && down) { TakeScreenShot(true); @@ -563,7 +563,8 @@ namespace spades { TakeMapShot(); } else if (CheckKey(cg_keyFlashlight, name) && down) { // spectators and dead players should not be able to toggle the flashlight - if (world->GetLocalPlayer()->IsSpectator() || !world->GetLocalPlayer()->IsAlive()) + if (world->GetLocalPlayer()->IsSpectator() || + !world->GetLocalPlayer()->IsAlive()) return; flashlightOn = !flashlightOn; flashlightOnTime = time; @@ -626,5 +627,5 @@ namespace spades { } } } - } -} + } // namespace client +} // namespace spades diff --git a/Sources/Client/Client_Scene.cpp b/Sources/Client/Client_Scene.cpp index b7cb7332..a7a422e8 100644 --- a/Sources/Client/Client_Scene.cpp +++ b/Sources/Client/Client_Scene.cpp @@ -121,7 +121,7 @@ namespace spades { return 1.f; } - ClientPlayer* clientPlayer = clientPlayers[player.GetId()]; + ClientPlayer *clientPlayer = clientPlayers[player.GetId()]; SPAssert(clientPlayer); float delta = .8f; @@ -178,7 +178,8 @@ namespace spades { def.fovY = (float)cg_fov * static_cast(M_PI) / 180.f; def.fovX = atanf(tanf(def.fovY * .5f) * renderer->ScreenWidth() / - renderer->ScreenHeight()) * 2.f; + renderer->ScreenHeight()) * + 2.f; def.zNear = 0.05f; @@ -204,7 +205,8 @@ namespace spades { localFireVibration *= 0.4f; } - roll += (SampleRandomFloat() - SampleRandomFloat()) * 0.03f * localFireVibration; + roll += (SampleRandomFloat() - SampleRandomFloat()) * 0.03f * + localFireVibration; scale += SampleRandomFloat() * 0.04f * localFireVibration; vibPitch += localFireVibration * (1.f - localFireVibration) * 0.01f; @@ -216,13 +218,13 @@ namespace spades { { float sp = SmoothStep(GetSprintState()); vibYaw += sinf(player.GetWalkAnimationProgress() * - static_cast(M_PI) * 2.f) * - 0.01f * sp; + static_cast(M_PI) * 2.f) * + 0.01f * sp; roll -= sinf(player.GetWalkAnimationProgress() * - static_cast(M_PI) * 2.f) * - 0.005f * (sp); + static_cast(M_PI) * 2.f) * + 0.005f * (sp); float p = cosf(player.GetWalkAnimationProgress() * - static_cast(M_PI) * 2.f); + static_cast(M_PI) * 2.f); p = p * p; p *= p; p *= p; @@ -230,14 +232,14 @@ namespace spades { if (shakeLevel >= 2) { vibYaw += coherentNoiseSamplers[0].Sample( - player.GetWalkAnimationProgress() * 2.5f) * - 0.005f * sp; + player.GetWalkAnimationProgress() * 2.5f) * + 0.005f * sp; vibPitch += coherentNoiseSamplers[1].Sample( - player.GetWalkAnimationProgress() * 2.5f) * - 0.01f * sp; + player.GetWalkAnimationProgress() * 2.5f) * + 0.01f * sp; roll += coherentNoiseSamplers[2].Sample( - player.GetWalkAnimationProgress() * 2.5f) * - 0.008f * sp; + player.GetWalkAnimationProgress() * 2.5f) * + 0.008f * sp; scale += sp * 0.1f; } @@ -246,7 +248,8 @@ namespace spades { def.fovY = (float)cg_fov * static_cast(M_PI) / 180.f; def.fovX = atanf(tanf(def.fovY * .5f) * renderer->ScreenWidth() / - renderer->ScreenHeight()) * 2.f; + renderer->ScreenHeight()) * + 2.f; // for 1st view, camera blur can be used def.denyCameraBlur = false; @@ -287,15 +290,15 @@ namespace spades { Vector3 center = player.GetEye(); if (!player.IsAlive() && lastMyCorpse && - &player == world->GetLocalPlayer()) { + &player == world->GetLocalPlayer()) { center = lastMyCorpse->GetCenter(); } if (map->IsSolidWrapped((int)floorf(center.x), (int)floorf(center.y), - (int)floorf(center.z))) { + (int)floorf(center.z))) { float z = center.z; while (z > center.z - 5.f) { if (!map->IsSolidWrapped((int)floorf(center.x), - (int)floorf(center.y), (int)floorf(z))) { + (int)floorf(center.y), (int)floorf(z))) { center.z = z; break; } else { @@ -306,8 +309,8 @@ namespace spades { float distance = 5.f; if (&player == world->GetLocalPlayer() && - world->GetLocalPlayer()->GetTeamId() < 2 && - !world->GetLocalPlayer()->IsAlive()) { + world->GetLocalPlayer()->GetTeamId() < 2 && + !world->GetLocalPlayer()->IsAlive()) { // deathcam. float elapsedTime = time - lastAliveTime; distance -= 3.f * expf(-elapsedTime * 1.f); @@ -344,7 +347,8 @@ namespace spades { def.fovY = (float)cg_fov * static_cast(M_PI) / 180.f; def.fovX = atanf(tanf(def.fovY * .5f) * renderer->ScreenWidth() / - renderer->ScreenHeight()) * 2.f; + renderer->ScreenHeight()) * + 2.f; // Update initial floating camera pos freeCameraState.position = def.viewOrigin; @@ -369,7 +373,8 @@ namespace spades { def.fovY = (float)cg_fov * static_cast(M_PI) / 180.f; def.fovX = atanf(tanf(def.fovY * .5f) * renderer->ScreenWidth() / - renderer->ScreenHeight()) * 2.f; + renderer->ScreenHeight()) * + 2.f; // for 1st view, camera blur can be used def.denyCameraBlur = false; @@ -386,7 +391,8 @@ namespace spades { if (grenVib > 1.f) grenVib = 1.f; roll += (SampleRandomFloat() - SampleRandomFloat()) * 0.2f * grenVib; - vibPitch += (SampleRandomFloat() - SampleRandomFloat()) * 0.1f * grenVib; + vibPitch += + (SampleRandomFloat() - SampleRandomFloat()) * 0.1f * grenVib; vibYaw += (SampleRandomFloat() - SampleRandomFloat()) * 0.1f * grenVib; scale -= (SampleRandomFloat() - SampleRandomFloat()) * 0.1f * grenVib; @@ -445,7 +451,7 @@ namespace spades { if ((int)cg_manualFocus) { // Depth of field is manually controlled def.depthOfFieldNearBlurStrength = def.depthOfFieldFarBlurStrength = - 0.5f * (float)cg_depthOfFieldAmount; + 0.5f * (float)cg_depthOfFieldAmount; def.depthOfFieldFocalLength = focalLength; } else { def.depthOfFieldNearBlurStrength = cg_depthOfFieldAmount; @@ -605,7 +611,7 @@ namespace spades { clientPlayers[i]->AddToScene(); } auto &nades = world->GetAllGrenades(); - for (auto &nade: nades) { + for (auto &nade : nades) { AddGrenadeToScene(*nade); } @@ -638,7 +644,7 @@ namespace spades { std::vector blocks; if (p->IsBlockCursorDragging()) { blocks = world->CubeLine(p->GetBlockCursorDragPos(), - p->GetBlockCursorPos(), 256); + p->GetBlockCursorPos(), 256); } else { blocks.push_back(p->GetBlockCursorPos()); } @@ -651,8 +657,10 @@ namespace spades { if ((int)blocks.size() > p->GetNumBlocks()) color = MakeVector3(1.f, 0.f, 0.f); - IModel *curLine = renderer->RegisterModel("Models/MapObjects/BlockCursorLine.kv6"); - IModel *curSingle = renderer->RegisterModel("Models/MapObjects/BlockCursorSingle.kv6"); + IModel *curLine = + renderer->RegisterModel("Models/MapObjects/BlockCursorLine.kv6"); + IModel *curSingle = + renderer->RegisterModel("Models/MapObjects/BlockCursorSingle.kv6"); for (size_t i = 0; i < blocks.size(); i++) { IntVector3 &v = blocks[i]; bool solid = blocks.size() > 2 && map->IsSolid(v.x, v.y, v.z); @@ -660,11 +668,16 @@ namespace spades { param.ghost = true; param.opacity = active && !solid ? .7f : .3f; param.customColor = color; - param.matrix = Matrix4::Translate(MakeVector3(v.x + .5f, v.y + .5f, v.z + .5f)); - param.matrix = param.matrix * Matrix4::Scale(1.f / 24.f + (solid ? 0.0005f : 0.f)); // make cursor larger if needed to stop z-fighting + param.matrix = + Matrix4::Translate(MakeVector3(v.x + .5f, v.y + .5f, v.z + .5f)); + param.matrix = + param.matrix * + Matrix4::Scale( + 1.f / 24.f + + (solid ? 0.0005f + : 0.f)); // make cursor larger if needed to stop z-fighting renderer->RenderModel(blocks.size() > 1 ? curLine : curSingle, param); } - } } } @@ -717,5 +730,5 @@ namespace spades { return v2; } - } -} + } // namespace client +} // namespace spades diff --git a/Sources/Client/Client_Update.cpp b/Sources/Client/Client_Update.cpp index c7493089..b934a9eb 100644 --- a/Sources/Client/Client_Update.cpp +++ b/Sources/Client/Client_Update.cpp @@ -689,10 +689,9 @@ namespace spades { if (isLocal) audioDevice->PlayLocal(c, MakeVector3(.4f, -.3f, .5f), AudioParam()); else - audioDevice->Play(c, - p.GetEye() + p.GetFront() * 0.5f - p.GetUp() * .3f + - p.GetRight() * .4f, - AudioParam()); + audioDevice->Play( + c, p.GetEye() + p.GetFront() * 0.5f - p.GetUp() * .3f + p.GetRight() * .4f, + AudioParam()); } } @@ -705,14 +704,14 @@ namespace spades { if (isLocal) audioDevice->PlayLocal(c, MakeVector3(.4f, -.3f, .5f), AudioParam()); else - audioDevice->Play(c, - p.GetEye() + p.GetFront() * 0.5f - p.GetUp() * .3f + - p.GetRight() * .4f, - AudioParam()); + audioDevice->Play( + c, p.GetEye() + p.GetFront() * 0.5f - p.GetUp() * .3f + p.GetRight() * .4f, + AudioParam()); } } - void Client::PlayerThrewGrenade(spades::client::Player &p, stmp::optional g) { + void Client::PlayerThrewGrenade(spades::client::Player &p, + stmp::optional g) { SPADES_MARK_FUNCTION(); if (!IsMuted()) { @@ -727,10 +726,9 @@ namespace spades { if (isLocal) audioDevice->PlayLocal(c, MakeVector3(.4f, 0.1f, .3f), AudioParam()); else - audioDevice->Play(c, - p.GetEye() + p.GetFront() * 0.5f - p.GetUp() * .2f + - p.GetRight() * .3f, - AudioParam()); + audioDevice->Play( + c, p.GetEye() + p.GetFront() * 0.5f - p.GetUp() * .2f + p.GetRight() * .3f, + AudioParam()); } } @@ -922,11 +920,11 @@ namespace spades { // log to netlog if (&killer != &victim) { NetLog("%s (%s) [%s] %s (%s)", killer.GetName().c_str(), - world->GetTeam(killer.GetTeamId()).name.c_str(), cause.c_str(), - victim.GetName().c_str(), world->GetTeam(victim.GetTeamId()).name.c_str()); + world->GetTeam(killer.GetTeamId()).name.c_str(), cause.c_str(), + victim.GetName().c_str(), world->GetTeam(victim.GetTeamId()).name.c_str()); } else { NetLog("%s (%s) [%s]", killer.GetName().c_str(), - world->GetTeam(killer.GetTeamId()).name.c_str(), cause.c_str()); + world->GetTeam(killer.GetTeamId()).name.c_str(), cause.c_str()); } // show big message if player is involved diff --git a/Sources/Client/Corpse.cpp b/Sources/Client/Corpse.cpp index 83696c11..e9e24d1a 100644 --- a/Sources/Client/Corpse.cpp +++ b/Sources/Client/Corpse.cpp @@ -19,13 +19,13 @@ */ #include "Corpse.h" -#include -#include #include "GameMap.h" #include "IModel.h" #include "IRenderer.h" #include "Player.h" #include "World.h" +#include +#include using namespace std; @@ -84,8 +84,7 @@ namespace spades { SetNode(Arm2, torso * MakeVector3(-0.2f, -.4f, .2f)); } - SetNode(Head, - (nodes[Torso1].pos + nodes[Torso2].pos) * .5f + MakeVector3(0, 0, -0.6f)); + SetNode(Head, (nodes[Torso1].pos + nodes[Torso2].pos) * .5f + MakeVector3(0, 0, -0.6f)); } void Corpse::SetNode(NodeType n, spades::Vector3 v) { @@ -99,9 +98,7 @@ namespace spades { nodes[n].lastPos = v; nodes[n].lastForce = MakeVector3(0, 0, 0); } - void Corpse::SetNode(NodeType n, spades::Vector4 v) { - SetNode(n, v.GetXYZ()); - } + void Corpse::SetNode(NodeType n, spades::Vector4 v) { SetNode(n, v.GetXYZ()); } Corpse::~Corpse() {} @@ -746,5 +743,5 @@ namespace spades { for (int i = 0; i < NodeCount; i++) nodes[i].vel += v; } - } -} + } // namespace client +} // namespace spades diff --git a/Sources/Client/Corpse.h b/Sources/Client/Corpse.h index c607aa7c..886f5fa8 100644 --- a/Sources/Client/Corpse.h +++ b/Sources/Client/Corpse.h @@ -100,5 +100,5 @@ namespace spades { void AddImpulse(Vector3); }; - } -} + } // namespace client +} // namespace spades diff --git a/Sources/Client/FallingBlock.cpp b/Sources/Client/FallingBlock.cpp index f5f12ac4..25b4546b 100644 --- a/Sources/Client/FallingBlock.cpp +++ b/Sources/Client/FallingBlock.cpp @@ -19,8 +19,6 @@ */ #include "FallingBlock.h" -#include -#include #include "Client.h" #include "GameMap.h" #include "IModel.h" @@ -28,6 +26,8 @@ #include "ParticleSpriteEntity.h" #include "SmokeSpriteEntity.h" #include "World.h" +#include +#include #include namespace spades { @@ -104,7 +104,7 @@ namespace spades { const Handle &map = client->GetWorld()->GetMap(); Vector3 orig = matrix.GetOrigin(); - + SPAssert(map); if (time > 1.f || map->ClipBox(orig.x, orig.y, orig.z)) { @@ -142,8 +142,8 @@ namespace spades { client->grenadeVibration += impact / (dist + 5.f); if (client->grenadeVibration > 1.f) client->grenadeVibration = 1.f; - - auto *getRandom = SampleRandomFloat; + + auto *getRandom = SampleRandomFloat; for (int x = 0; x < w; x++) { Vector3 p1 = vmOrigin + vmAxis1 * (float)x; @@ -171,11 +171,12 @@ namespace spades { { ParticleSpriteEntity *ent = new SmokeSpriteEntity(client, col, 70.f); - ent->SetTrajectory(p3, (MakeVector3(getRandom() - getRandom(), - getRandom() - getRandom(), - getRandom() - getRandom())) * - 0.2f, - 1.f, 0.f); + ent->SetTrajectory( + p3, + (MakeVector3(getRandom() - getRandom(), getRandom() - getRandom(), + getRandom() - getRandom())) * + 0.2f, + 1.f, 0.f); ent->SetRotation(getRandom() * (float)M_PI * 2.f); ent->SetRadius(1.0f, 0.5f); ent->SetBlockHitAction(ParticleSpriteEntity::Ignore); @@ -187,10 +188,11 @@ namespace spades { for (int i = 0; i < 6; i++) { ParticleSpriteEntity *ent = new ParticleSpriteEntity(client, img, col); - ent->SetTrajectory(p3, MakeVector3(getRandom() - getRandom(), - getRandom() - getRandom(), - getRandom() - getRandom()) * - 13.f, + ent->SetTrajectory(p3, + MakeVector3(getRandom() - getRandom(), + getRandom() - getRandom(), + getRandom() - getRandom()) * + 13.f, 1.f, .6f); ent->SetRotation(getRandom() * (float)M_PI * 2.f); ent->SetRadius(0.35f + getRandom() * getRandom() * 0.1f); @@ -223,5 +225,5 @@ namespace spades { param.matrix = matrix; client->GetRenderer()->RenderModel(model, param); } - } -} + } // namespace client +} // namespace spades diff --git a/Sources/Client/HitTestDebugger.cpp b/Sources/Client/HitTestDebugger.cpp index 718783c8..413ee50f 100644 --- a/Sources/Client/HitTestDebugger.cpp +++ b/Sources/Client/HitTestDebugger.cpp @@ -21,8 +21,8 @@ #include //windows needs this. -#include "HitTestDebugger.h" #include "GameMap.h" +#include "HitTestDebugger.h" #include "Player.h" #include "Weapon.h" #include "World.h" @@ -148,7 +148,7 @@ namespace spades { def.zFar = 200.f; // start rendering - const Handle& map = world->GetMap(); + const Handle &map = world->GetMap(); if (!def.skipWorld) { renderer->SetGameMap(&*map); } @@ -307,5 +307,5 @@ namespace spades { renderer->Flip(); } - } -} + } // namespace client +} // namespace spades diff --git a/Sources/Client/HurtRingView.cpp b/Sources/Client/HurtRingView.cpp index 07285e8e..334d2205 100644 --- a/Sources/Client/HurtRingView.cpp +++ b/Sources/Client/HurtRingView.cpp @@ -112,5 +112,5 @@ namespace spades { AABB2(0, 0, image->GetWidth(), image->GetHeight())); } } - } -} + } // namespace client +} // namespace spades diff --git a/Sources/Client/Player.h b/Sources/Client/Player.h index 7f47ae3d..23a574e3 100644 --- a/Sources/Client/Player.h +++ b/Sources/Client/Player.h @@ -140,7 +140,7 @@ namespace spades { IntVector3 color); Player(const Player &) = delete; - void operator =(const Player &) = delete; + void operator=(const Player &) = delete; ~Player(); diff --git a/Sources/Client/TCGameMode.cpp b/Sources/Client/TCGameMode.cpp index a718e68a..94c3beca 100644 --- a/Sources/Client/TCGameMode.cpp +++ b/Sources/Client/TCGameMode.cpp @@ -20,8 +20,8 @@ */ #include "TCGameMode.h" -#include #include "World.h" +#include namespace spades { namespace client { @@ -49,5 +49,5 @@ namespace spades { prog = 1.f; return prog; } - } -} + } // namespace client +} // namespace spades diff --git a/Sources/Client/TCGameMode.h b/Sources/Client/TCGameMode.h index 501e5500..1f64989d 100644 --- a/Sources/Client/TCGameMode.h +++ b/Sources/Client/TCGameMode.h @@ -78,5 +78,5 @@ namespace spades { void AddTerritory(const Territory &); }; - } -} + } // namespace client +} // namespace spades diff --git a/Sources/Client/Weapon.cpp b/Sources/Client/Weapon.cpp index 6631220c..928f3183 100644 --- a/Sources/Client/Weapon.cpp +++ b/Sources/Client/Weapon.cpp @@ -33,7 +33,7 @@ namespace spades { owner(p), time(0), shooting(false), - shootingPreviously(false), + shootingPreviously(false), reloading(false), nextShotTime(0.f), reloadStartTime(-101.f), @@ -388,9 +388,8 @@ namespace spades { case SHOTGUN_WEAPON: return new ShotgunWeapon4(p.GetWorld(), p); default: SPInvalidEnum("type", type); } - default: - SPInvalidEnum("protocolVersion", gp.protocolVersion); + default: SPInvalidEnum("protocolVersion", gp.protocolVersion); } } - } -} + } // namespace client +} // namespace spades diff --git a/Sources/Core/RefCountedObject.h b/Sources/Core/RefCountedObject.h index 3741d658..9c5b8a11 100644 --- a/Sources/Core/RefCountedObject.h +++ b/Sources/Core/RefCountedObject.h @@ -149,4 +149,4 @@ namespace spades { */ template Handle Cast() const & { return Handle{*this}.Cast(); } }; -} +} // namespace spades