[colobot] 34/377: Bring to zero some types of issues reported by colobot-lint
Didier Raboud
odyx at moszumanska.debian.org
Wed Mar 30 13:33:55 UTC 2016
This is an automated email from the git hooks/post-receive script.
odyx pushed a commit to branch debian/master
in repository colobot.
commit d11ebc891ccd433cbc478c3312612eb826523026
Author: Piotr Dziwinski <piotrdz at gmail.com>
Date: Sat Oct 3 22:05:14 2015 +0200
Bring to zero some types of issues reported by colobot-lint
---
src/CBot/CBotClass.cpp | 4 +
src/CBot/CBotDll.h | 4 +
src/CBot/CBotVar.cpp | 5 +
src/app/app.cpp | 9 +-
src/app/input.cpp | 10 +-
src/app/input.h | 2 +-
src/app/main.cpp | 2 +-
src/app/pausemanager.cpp | 16 ++-
src/app/pausemanager.h | 19 +---
src/app/signal_handlers.cpp | 7 +-
src/app/system.cpp | 5 +-
src/common/logger.cpp | 4 +-
src/common/regex_utils.cpp | 4 +-
src/common/regex_utils.h | 6 +-
src/graphics/engine/camera.cpp | 4 +-
src/graphics/engine/camera.h | 2 +-
src/graphics/engine/cloud.h | 2 +-
src/graphics/engine/engine.cpp | 6 +-
src/graphics/engine/engine.h | 11 +-
src/graphics/engine/lightman.cpp | 8 +-
src/graphics/engine/lightman.h | 6 +-
src/graphics/engine/pyro.h | 2 +-
src/graphics/engine/terrain.cpp | 26 ++---
src/graphics/engine/terrain.h | 2 +-
src/graphics/engine/text.cpp | 4 +-
src/graphics/engine/text.h | 4 +-
src/graphics/model/model_input.cpp | 4 +-
src/level/parser/parser.h | 3 +-
src/level/robotmain.cpp | 40 ++++---
src/level/robotmain.h | 22 ++--
src/level/scene_conditions.cpp | 4 +-
src/object/auto/auto.cpp | 8 +-
src/object/auto/auto.h | 5 +-
src/object/auto/autobase.cpp | 2 -
src/object/auto/autobase.h | 2 +-
src/object/auto/autoconvert.cpp | 8 +-
src/object/auto/autoconvert.h | 2 +-
src/object/auto/autoderrick.cpp | 2 -
src/object/auto/autoderrick.h | 2 +-
src/object/auto/autodestroyer.cpp | 2 -
src/object/auto/autoegg.cpp | 2 +-
src/object/auto/autoegg.h | 2 +-
src/object/auto/autofactory.cpp | 6 +-
src/object/auto/autofactory.h | 2 +-
src/object/auto/autolabo.cpp | 4 +-
src/object/auto/autonest.h | 2 +-
src/object/auto/autonuclearplant.cpp | 4 +-
src/object/auto/autonuclearplant.h | 2 +-
src/object/auto/autopowercaptor.cpp | 4 +-
src/object/auto/autopowerplant.h | 2 +-
src/object/auto/autoresearch.h | 2 +-
src/object/implementation/program_storage_impl.cpp | 2 +-
src/object/implementation/programmable_impl.h | 7 +-
src/object/interface/trace_drawing_object.h | 4 +-
src/object/object.cpp | 4 +-
src/object/old_object.h | 13 ++-
src/object/subclass/base_alien.cpp | 4 +-
src/object/subclass/base_building.cpp | 2 +-
src/object/subclass/base_robot.cpp | 4 +-
src/object/subclass/shielder.cpp | 2 +-
src/object/task/taskgoto.cpp | 2 +-
src/object/task/taskpen.h | 5 +-
src/object/task/taskterraform.cpp | 4 +-
src/script/scriptfunc.cpp | 10 +-
src/sound/oalsound/alsound.cpp | 118 ++++++++-------------
src/sound/oalsound/alsound.h | 16 +--
src/sound/oalsound/buffer.cpp | 21 ++--
src/sound/oalsound/buffer.h | 6 +-
src/sound/oalsound/channel.cpp | 114 +++++++-------------
src/sound/oalsound/channel.h | 12 +--
src/sound/sound.cpp | 2 +-
src/ui/controls/button.cpp | 4 +-
src/ui/controls/button.h | 2 +-
src/ui/controls/list.cpp | 4 +-
src/ui/controls/list.h | 2 +-
src/ui/controls/slider.h | 2 +-
src/ui/controls/target.h | 2 +-
src/ui/displaytext.h | 2 +-
src/ui/maindialog.cpp | 4 +-
src/ui/mainui.cpp | 12 +--
src/ui/object_interface.h | 2 +-
src/ui/screen/screen.cpp | 4 +-
src/ui/screen/screen_io.cpp | 6 +-
src/ui/screen/screen_io_read.cpp | 2 +-
src/ui/screen/screen_io_write.cpp | 2 +-
src/ui/screen/screen_player_select.cpp | 13 ++-
src/ui/studio.cpp | 6 +-
test/unit/app/app_test.cpp | 48 ++++-----
test/unit/app/system_linux_test.cpp | 4 +-
test/unit/app/system_windows_test.cpp | 4 +-
test/unit/common/config_file_test.cpp | 3 +-
test/unit/graphics/engine/lightman_test.cpp | 32 +++---
92 files changed, 383 insertions(+), 441 deletions(-)
diff --git a/src/CBot/CBotClass.cpp b/src/CBot/CBotClass.cpp
index be44e1a..3e1e007 100644
--- a/src/CBot/CBotClass.cpp
+++ b/src/CBot/CBotClass.cpp
@@ -72,6 +72,10 @@ CBotClass::~CBotClass()
delete m_next; // releases all of them on this level
}
+CBotClass* CBotClass::Create(const char* name, CBotClass* parent, bool intrinsic)
+{
+ return new CBotClass(name, parent, intrinsic);
+}
void CBotClass::Free()
{
diff --git a/src/CBot/CBotDll.h b/src/CBot/CBotDll.h
index 3797256..bcb02d1 100644
--- a/src/CBot/CBotDll.h
+++ b/src/CBot/CBotDll.h
@@ -610,6 +610,8 @@ virtual ~CBotVar( ); // destructor
static
CBotVar* Create( CBotVar* pVar );
+ static void Destroy(CBotVar* var);
+
void SetUserPtr(void* pUser);
// associate a user pointer to an instance
@@ -807,6 +809,8 @@ public:
~CBotClass( ); // destructor
+ static CBotClass* Create(const char* name, CBotClass* parent, bool intrinsic = false);
+
bool AddFunction(const char* name,
bool rExec (CBotVar* pThis, CBotVar* pVar, CBotVar* pResult, int& Exception, void* user),
CBotTypResult rCompile (CBotVar* pThis, CBotVar* &pVar));
diff --git a/src/CBot/CBotVar.cpp b/src/CBot/CBotVar.cpp
index 5deb935..da5119f 100644
--- a/src/CBot/CBotVar.cpp
+++ b/src/CBot/CBotVar.cpp
@@ -444,6 +444,11 @@ CBotVar* CBotVar::Create( const char* name, CBotClass* pClass)
return pVar;
}
+void CBotVar::Destroy(CBotVar* var)
+{
+ delete var;
+}
+
CBotTypResult CBotVar::GetTypResult(int mode)
{
CBotTypResult r = m_type;
diff --git a/src/app/app.cpp b/src/app/app.cpp
index b83a45f..5c12408 100644
--- a/src/app/app.cpp
+++ b/src/app/app.cpp
@@ -19,8 +19,6 @@
#include "app/app.h"
-#include "common/version.h"
-
#include "app/controller.h"
#include "app/input.h"
#include "app/system.h"
@@ -32,6 +30,7 @@
#include "common/make_unique.h"
#include "common/pathman.h"
#include "common/stringutils.h"
+#include "common/version.h"
#include "common/resources/resourcemanager.h"
@@ -39,10 +38,10 @@
#include "graphics/opengl/glutil.h"
-#include "object/object_manager.h"
-
#include "level/robotmain.h"
+#include "object/object_manager.h"
+
#ifdef OPENAL_SOUND
#include "sound/oalsound/alsound.h"
#endif
@@ -479,7 +478,7 @@ bool CApplication::Create()
#ifdef OPENAL_SOUND
if (!m_headless)
{
- m_sound = MakeUnique<ALSound>();
+ m_sound = MakeUnique<CALSound>();
}
else
{
diff --git a/src/app/input.cpp b/src/app/input.cpp
index ff75d91..228b5e9 100644
--- a/src/app/input.cpp
+++ b/src/app/input.cpp
@@ -404,19 +404,19 @@ InputSlot CInput::SearchKeyById(std::string id)
return INPUT_SLOT_MAX;
}
-std::string CInput::GetKeysString(InputBinding b)
+std::string CInput::GetKeysString(InputBinding binding)
{
std::ostringstream ss;
- if ( b.primary != KEY_INVALID )
+ if ( binding.primary != KEY_INVALID )
{
std::string iNameStr;
- if ( GetResource(RES_KEY, b.primary, iNameStr) )
+ if ( GetResource(RES_KEY, binding.primary, iNameStr) )
{
ss << iNameStr;
- if ( b.secondary != KEY_INVALID )
+ if ( binding.secondary != KEY_INVALID )
{
- if ( GetResource(RES_KEY, b.secondary, iNameStr) )
+ if ( GetResource(RES_KEY, binding.secondary, iNameStr) )
{
std::string textStr;
GetResource(RES_TEXT, RT_KEY_OR, textStr);
diff --git a/src/app/input.h b/src/app/input.h
index 771267b..e9e3b03 100644
--- a/src/app/input.h
+++ b/src/app/input.h
@@ -131,7 +131,7 @@ public:
//@}
//! Seeks a InputSlot by id. Returns INPUT_SLOT_MAX if not found
- InputSlot SearchKeyById(std::string name);
+ InputSlot SearchKeyById(std::string id);
//! Returns string describing keys to be pressed
//@{
diff --git a/src/app/main.cpp b/src/app/main.cpp
index 0845d5a..7d3e665 100644
--- a/src/app/main.cpp
+++ b/src/app/main.cpp
@@ -23,7 +23,6 @@
*/
#include "common/config.h"
-#include "common/version.h"
#include "app/app.h"
#include "app/signal_handlers.h"
@@ -35,6 +34,7 @@
#include "common/logger.h"
#include "common/make_unique.h"
#include "common/restext.h"
+#include "common/version.h"
#include "common/resources/resourcemanager.h"
diff --git a/src/app/pausemanager.cpp b/src/app/pausemanager.cpp
index ba867a6..64a0b9d 100644
--- a/src/app/pausemanager.cpp
+++ b/src/app/pausemanager.cpp
@@ -27,6 +27,20 @@
#include <algorithm>
+struct ActivePause
+{
+ explicit ActivePause(PauseType type, PauseMusic music = PAUSE_MUSIC_NONE)
+ : type(type),
+ music(music)
+ {}
+
+ ActivePause(const ActivePause&) = delete;
+ ActivePause& operator=(const ActivePause&) = delete;
+
+ PauseType type;
+ PauseMusic music;
+};
+
CPauseManager::CPauseManager()
{
@@ -39,7 +53,7 @@ CPauseManager::~CPauseManager()
ActivePause* CPauseManager::ActivatePause(PauseType type, PauseMusic music)
{
//GetLogger()->Debug("Activated pause mode - %s\n", GetPauseName(type).c_str());
- auto pause = std::unique_ptr<ActivePause>(new ActivePause(type, music)); // TODO: Can't use MakeUnique here because the constructor is private
+ auto pause = MakeUnique<ActivePause>(type, music);
ActivePause* ptr = pause.get();
m_activePause.push_back(std::move(pause));
Update();
diff --git a/src/app/pausemanager.h b/src/app/pausemanager.h
index b6c261f..d5ba1d7 100644
--- a/src/app/pausemanager.h
+++ b/src/app/pausemanager.h
@@ -23,6 +23,8 @@
*/
#pragma once
+#include "common/make_unique.h"
+
#include <string>
#include <vector>
#include <memory>
@@ -63,22 +65,7 @@ enum PauseMusic
PAUSE_MUSIC_SATCOM = 2,
};
-struct ActivePause
-{
-private:
- friend class CPauseManager;
-
- explicit ActivePause(PauseType type, PauseMusic music = PAUSE_MUSIC_NONE)
- : type(type)
- , music(music)
- {}
-
- ActivePause(const ActivePause&) = delete;
- ActivePause& operator=(const ActivePause&) = delete;
-
- PauseType type;
- PauseMusic music;
-};
+struct ActivePause;
class CPauseManager
{
diff --git a/src/app/signal_handlers.cpp b/src/app/signal_handlers.cpp
index f00a8d8..618f323 100644
--- a/src/app/signal_handlers.cpp
+++ b/src/app/signal_handlers.cpp
@@ -19,13 +19,12 @@
#include "app/signal_handlers.h"
-#include "common/version.h"
-
-#include "common/resources/resourcemanager.h"
-
#include "app/system.h"
#include "common/stringutils.h"
+#include "common/version.h"
+
+#include "common/resources/resourcemanager.h"
#include "level/robotmain.h"
diff --git a/src/app/system.cpp b/src/app/system.cpp
index e0ea2ba..01450c4 100644
--- a/src/app/system.cpp
+++ b/src/app/system.cpp
@@ -22,9 +22,6 @@
#include "common/config.h"
-#include "common/make_unique.h"
-
-
#if defined(PLATFORM_WINDOWS)
#include "app/system_windows.h"
#elif defined(PLATFORM_LINUX)
@@ -35,6 +32,8 @@
#include "app/system_other.h"
#endif
+#include "common/make_unique.h"
+
#include <cassert>
#include <iostream>
diff --git a/src/common/logger.cpp b/src/common/logger.cpp
index 2217f5e..2d3f9b7 100644
--- a/src/common/logger.cpp
+++ b/src/common/logger.cpp
@@ -151,9 +151,9 @@ bool CLogger::IsOpened()
return m_file != nullptr;
}
-void CLogger::SetLogLevel(LogLevel type)
+void CLogger::SetLogLevel(LogLevel level)
{
- m_logLevel = type;
+ m_logLevel = level;
}
bool CLogger::ParseLogLevel(const std::string& str, LogLevel& logLevel)
diff --git a/src/common/regex_utils.cpp b/src/common/regex_utils.cpp
index 27086ca..1796cd0 100644
--- a/src/common/regex_utils.cpp
+++ b/src/common/regex_utils.cpp
@@ -25,7 +25,7 @@ std::string FormatAssertRegexMatchError(const std::string& text,
return "Text \"" + text + "\" did not match regex \"" + pattern + "\"";
}
-RegexUtils::AssertRegexMatchError::AssertRegexMatchError(
+RegexUtils::CAssertRegexMatchError::CAssertRegexMatchError(
const std::string& text, const std::string& pattern) NOEXCEPT
: std::runtime_error(FormatAssertRegexMatchError(text, pattern))
{
@@ -37,7 +37,7 @@ boost::smatch RegexUtils::AssertRegexMatch(const std::string& text, const std::s
boost::smatch matches;
bool ok = boost::regex_match(text, matches, regex);
if (!ok)
- throw AssertRegexMatchError(text, pattern);
+ throw CAssertRegexMatchError(text, pattern);
return matches;
}
diff --git a/src/common/regex_utils.h b/src/common/regex_utils.h
index 5c0e100..7f5b83f 100644
--- a/src/common/regex_utils.h
+++ b/src/common/regex_utils.h
@@ -26,11 +26,11 @@
namespace RegexUtils
{
-class AssertRegexMatchError : public std::runtime_error
+class CAssertRegexMatchError : public std::runtime_error
{
public:
- explicit AssertRegexMatchError(const std::string& text,
- const std::string& pattern) NOEXCEPT;
+ explicit CAssertRegexMatchError(const std::string& text,
+ const std::string& pattern) NOEXCEPT;
};
//! Match string with regex and return list of matches; throw exception on mismatch
diff --git a/src/graphics/engine/camera.cpp b/src/graphics/engine/camera.cpp
index 62e6edb..a1dc698 100644
--- a/src/graphics/engine/camera.cpp
+++ b/src/graphics/engine/camera.cpp
@@ -859,8 +859,8 @@ void CCamera::FixCamera()
}
void CCamera::SetViewTime(const Math::Vector &eyePt,
- const Math::Vector &lookatPt,
- float rTime)
+ const Math::Vector &lookatPt,
+ float rTime)
{
Math::Vector eye, lookat;
diff --git a/src/graphics/engine/camera.h b/src/graphics/engine/camera.h
index 453f994..72c6f29 100644
--- a/src/graphics/engine/camera.h
+++ b/src/graphics/engine/camera.h
@@ -249,7 +249,7 @@ protected:
bool EventFrameScript(const Event &event);
//! Specifies the location and direction of view to the 3D engine
- void SetViewTime(const Math::Vector &vEyePt, const Math::Vector &vLookatPt, float rTime);
+ void SetViewTime(const Math::Vector &eyePt, const Math::Vector &lookatPt, float rTime);
//! Avoid the obstacles
bool IsCollision(Math::Vector &eye, Math::Vector lookat);
//! Avoid the obstacles
diff --git a/src/graphics/engine/cloud.h b/src/graphics/engine/cloud.h
index 06e82ea..89299ff 100644
--- a/src/graphics/engine/cloud.h
+++ b/src/graphics/engine/cloud.h
@@ -74,7 +74,7 @@ public:
//! Management of clouds
//@{
- void SetEnabled(bool enable);
+ void SetEnabled(bool enabled);
bool GetEnabled();
//@}
diff --git a/src/graphics/engine/engine.cpp b/src/graphics/engine/engine.cpp
index 51eddf0..29c6f92 100644
--- a/src/graphics/engine/engine.cpp
+++ b/src/graphics/engine/engine.cpp
@@ -4932,11 +4932,11 @@ int CEngine::GetEngineState(const ModelTriangle& triangle)
return state;
}
-void CEngine::UpdateObjectShadowSpotNormal(int rank)
+void CEngine::UpdateObjectShadowSpotNormal(int objRank)
{
- assert(rank >= 0 && rank < static_cast<int>( m_objects.size() ));
+ assert(objRank >= 0 && objRank < static_cast<int>( m_objects.size() ));
- int shadowRank = m_objects[rank].shadowRank;
+ int shadowRank = m_objects[objRank].shadowRank;
if (shadowRank == -1)
return;
diff --git a/src/graphics/engine/engine.h b/src/graphics/engine/engine.h
index c95dcb8..9aebe83 100644
--- a/src/graphics/engine/engine.h
+++ b/src/graphics/engine/engine.h
@@ -48,7 +48,6 @@
class CApplication;
class CSoundInterface;
class CImage;
-class CPauseManager;
class CSystemUtils;
struct SystemTimeStamp;
struct Event;
@@ -717,7 +716,7 @@ public:
//@}
//! Increments the triangle counter for the current frame
- void AddStatisticTriangle(int nb);
+ void AddStatisticTriangle(int count);
//! Returns the number of triangles in current frame
int GetStatisticTriangle();
@@ -778,7 +777,7 @@ public:
// Objects
//! Print debug info about an object
- void DebugObject(int rank);
+ void DebugObject(int objRank);
//! Creates a new object and returns its rank
int CreateObject();
@@ -942,7 +941,7 @@ public:
void SetTexture(const Texture& tex, int stage = 0);
//! Deletes the given texture, unloading it and removing from cache
- void DeleteTexture(const std::string& name);
+ void DeleteTexture(const std::string& texName);
//! Deletes the given texture, unloading it and removing from cache
void DeleteTexture(const Texture& tex);
@@ -1215,7 +1214,7 @@ protected:
//! Draws the mouse cursor
void DrawMouse();
//! Draw part of mouse cursor sprite
- void DrawMouseSprite(Math::Point pos, Math::Point dim, int icon);
+ void DrawMouseSprite(Math::Point pos, Math::Point size, int icon);
//! Draw statistic texts
void DrawStats();
//! Draw mission timer
@@ -1225,7 +1224,7 @@ protected:
EngineBaseObjTexTier& AddLevel2(EngineBaseObject& p1, const std::string& tex1Name, const std::string& tex2Name);
//! Creates a new tier 3 object (data)
EngineBaseObjDataTier& AddLevel3(EngineBaseObjTexTier &p3, EngineTriangleType type,
- const Material& mat, int state);
+ const Material& material, int state);
//! Create texture and add it to cache
Texture CreateTexture(const std::string &texName, const TextureCreateParams ¶ms, CImage* image = nullptr);
diff --git a/src/graphics/engine/lightman.cpp b/src/graphics/engine/lightman.cpp
index 60f8c1c..15b0335 100644
--- a/src/graphics/engine/lightman.cpp
+++ b/src/graphics/engine/lightman.cpp
@@ -448,7 +448,7 @@ void CLightManager::UpdateDeviceLights(EngineObjectType type)
m_lightMap[i] = -1;
std::vector<DynamicLight> sortedLights = m_dynLights;
- LightsComparator lightsComparator(m_engine->GetEyePt(), type);
+ CLightsComparator lightsComparator(m_engine->GetEyePt(), type);
std::sort(sortedLights.begin(), sortedLights.end(), lightsComparator);
int lightMapIndex = 0;
@@ -497,13 +497,13 @@ void CLightManager::UpdateDeviceLights(EngineObjectType type)
// -----------
-CLightManager::LightsComparator::LightsComparator(Math::Vector eyePos, EngineObjectType objectType)
+CLightManager::CLightsComparator::CLightsComparator(Math::Vector eyePos, EngineObjectType objectType)
{
m_eyePos = eyePos;
m_objectType = objectType;
}
-float CLightManager::LightsComparator::GetLightWeight(const DynamicLight& dynLight)
+float CLightManager::CLightsComparator::GetLightWeight(const DynamicLight& dynLight)
{
if (dynLight.priority == LIGHT_PRI_HIGHEST)
return -1.0f;
@@ -519,7 +519,7 @@ float CLightManager::LightsComparator::GetLightWeight(const DynamicLight& dynLig
return enabled ? ( (dynLight.light.position - m_eyePos).Length() * dynLight.priority ) : 10000.0f;
}
-bool CLightManager::LightsComparator::operator()(const DynamicLight& left, const DynamicLight& right)
+bool CLightManager::CLightsComparator::operator()(const DynamicLight& left, const DynamicLight& right)
{
float leftWeight = GetLightWeight(left);
float rightWeight = GetLightWeight(right);
diff --git a/src/graphics/engine/lightman.h b/src/graphics/engine/lightman.h
index 9d1eb5e..ebf42d9 100644
--- a/src/graphics/engine/lightman.h
+++ b/src/graphics/engine/lightman.h
@@ -168,7 +168,7 @@ public:
//! Returns the light parameters for given dynamic light
bool GetLight(int lightRank, Light &light);
//! Enables/disables the given dynamic light
- bool SetLightEnabled(int lightRank, bool enable);
+ bool SetLightEnabled(int lightRank, bool enabled);
//! Changes the light priority
bool SetLightPriority(int lightRank, LightPriority priority);
@@ -212,10 +212,10 @@ public:
void UpdateDeviceLights(EngineObjectType type);
protected:
- class LightsComparator
+ class CLightsComparator
{
public:
- LightsComparator(Math::Vector eyePos, EngineObjectType objectType);
+ CLightsComparator(Math::Vector eyePos, EngineObjectType objectType);
bool operator()(const DynamicLight& left, const DynamicLight& right);
diff --git a/src/graphics/engine/pyro.h b/src/graphics/engine/pyro.h
index 2289b78..e98bf96 100644
--- a/src/graphics/engine/pyro.h
+++ b/src/graphics/engine/pyro.h
@@ -93,7 +93,7 @@ protected:
void DeleteObject(bool primary, bool secondary);
//! Creates an explosion with triangular form of particles
- void CreateTriangle(CObject* obj, ObjectType type, int part);
+ void CreateTriangle(CObject* obj, ObjectType oType, int part);
//! Starts the explosion of a vehicle
void ExploStart();
diff --git a/src/graphics/engine/terrain.cpp b/src/graphics/engine/terrain.cpp
index 0d36a38..ae82c8f 100644
--- a/src/graphics/engine/terrain.cpp
+++ b/src/graphics/engine/terrain.cpp
@@ -247,13 +247,13 @@ bool CTerrain::LoadResources(const std::string& fileName)
return true;
}
-TerrainRes CTerrain::GetResource(const Math::Vector &p)
+TerrainRes CTerrain::GetResource(const Math::Vector &pos)
{
if (m_resources.empty())
return TR_NULL;
- int x = static_cast<int>((p.x + (m_mosaicCount*m_brickCount*m_brickSize)/2.0f)/m_brickSize);
- int y = static_cast<int>((p.z + (m_mosaicCount*m_brickCount*m_brickSize)/2.0f)/m_brickSize);
+ int x = static_cast<int>((pos.x + (m_mosaicCount*m_brickCount*m_brickSize)/2.0f)/m_brickSize);
+ int y = static_cast<int>((pos.z + (m_mosaicCount*m_brickCount*m_brickSize)/2.0f)/m_brickSize);
if ( x < 0 || x > m_mosaicCount*m_brickCount ||
y < 0 || y > m_mosaicCount*m_brickCount )
@@ -1677,16 +1677,16 @@ bool CTerrain::DeleteBuildingLevel(Math::Vector center)
return false;
}
-float CTerrain::GetBuildingFactor(const Math::Vector &p)
+float CTerrain::GetBuildingFactor(const Math::Vector &pos)
{
for (int i = 0; i < static_cast<int>( m_buildingLevels.size() ); i++)
{
- if ( p.x < m_buildingLevels[i].bboxMinX ||
- p.x > m_buildingLevels[i].bboxMaxX ||
- p.z < m_buildingLevels[i].bboxMinZ ||
- p.z > m_buildingLevels[i].bboxMaxZ ) continue;
+ if ( pos.x < m_buildingLevels[i].bboxMinX ||
+ pos.x > m_buildingLevels[i].bboxMaxX ||
+ pos.z < m_buildingLevels[i].bboxMinZ ||
+ pos.z > m_buildingLevels[i].bboxMaxZ ) continue;
- float dist = Math::DistanceProjected(p, m_buildingLevels[i].center);
+ float dist = Math::DistanceProjected(pos, m_buildingLevels[i].center);
if (dist <= m_buildingLevels[i].max)
return m_buildingLevels[i].factor;
@@ -1730,9 +1730,9 @@ void CTerrain::AdjustBuildingLevel(Math::Vector &p)
}
}
-float CTerrain::GetHardness(const Math::Vector &p)
+float CTerrain::GetHardness(const Math::Vector &pos)
{
- float factor = GetBuildingFactor(p);
+ float factor = GetBuildingFactor(pos);
if (factor != 1.0f) return 1.0f; // on building level
if (m_materialPoints.empty()) return m_defaultHardness;
@@ -1741,8 +1741,8 @@ float CTerrain::GetHardness(const Math::Vector &p)
int x, y;
- x = static_cast<int>((p.x+dim)/m_brickSize);
- y = static_cast<int>((p.z+dim)/m_brickSize);
+ x = static_cast<int>((pos.x+dim)/m_brickSize);
+ y = static_cast<int>((pos.z+dim)/m_brickSize);
if ( x < 0 || x > m_mosaicCount*m_brickCount ||
y < 0 || y > m_mosaicCount*m_brickCount ) return m_defaultHardness;
diff --git a/src/graphics/engine/terrain.h b/src/graphics/engine/terrain.h
index 3235f40..8c489c8 100644
--- a/src/graphics/engine/terrain.h
+++ b/src/graphics/engine/terrain.h
@@ -157,7 +157,7 @@ public:
//! Clears all terrain materials
void FlushMaterials();
//! Adds a terrain material the names of textures to use for the land
- void AddMaterial(int id, const std::string& baseName, const Math::Point& uv,
+ void AddMaterial(int id, const std::string& texName, const Math::Point& uv,
int up, int right, int down, int left, float hardness);
//! Initializes all the ground with one material
bool InitMaterials(int id);
diff --git a/src/graphics/engine/text.cpp b/src/graphics/engine/text.cpp
index d100344..f5028d1 100644
--- a/src/graphics/engine/text.cpp
+++ b/src/graphics/engine/text.cpp
@@ -22,14 +22,14 @@
#include "app/app.h"
-#include "graphics/engine/engine.h"
-
#include "common/image.h"
#include "common/logger.h"
#include "common/stringutils.h"
#include "common/resources/resourcemanager.h"
+#include "graphics/engine/engine.h"
+
#include "math/func.h"
#include <SDL.h>
diff --git a/src/graphics/engine/text.h b/src/graphics/engine/text.h
index 6ce6be3..6f79320 100644
--- a/src/graphics/engine/text.h
+++ b/src/graphics/engine/text.h
@@ -27,8 +27,8 @@
#include "graphics/core/color.h"
-#include "math/point.h"
#include "math/intpoint.h"
+#include "math/point.h"
#include <map>
#include <memory>
@@ -309,7 +309,7 @@ public:
CharTexture GetCharTexture(UTF8Char ch, FontType font, float size);
protected:
- CachedFont* GetOrOpenFont(FontType type, float size);
+ CachedFont* GetOrOpenFont(FontType font, float size);
CharTexture CreateCharTexture(UTF8Char ch, CachedFont* font);
void DrawString(const std::string &text, std::vector<FontMetaChar>::iterator format,
diff --git a/src/graphics/model/model_input.cpp b/src/graphics/model/model_input.cpp
index a29e042..c71c88f 100644
--- a/src/graphics/model/model_input.cpp
+++ b/src/graphics/model/model_input.cpp
@@ -59,8 +59,8 @@ namespace ModelInput
VertexTex2 ReadBinaryVertexTex2(std::istream& stream);
Material ReadBinaryMaterial(std::istream& stream);
- std::string ReadLineString(std::istream& stream, const std::string& prefix);
- void ReadValuePrefix(std::istream& stream, const std::string& prefix);
+ std::string ReadLineString(std::istream& stream, const std::string& expectedPrefix);
+ void ReadValuePrefix(std::istream& stream, const std::string& expectedPrefix);
VertexTex2 ParseVertexTex2(const std::string& text);
Material ParseMaterial(const std::string& text);
Math::Vector ParseVector(const std::string& text);
diff --git a/src/level/parser/parser.h b/src/level/parser/parser.h
index f3eb128..4d78c59 100644
--- a/src/level/parser/parser.h
+++ b/src/level/parser/parser.h
@@ -24,10 +24,9 @@
#pragma once
-#include "level/level_category.h"
-
#include "common/make_unique.h"
+#include "level/level_category.h"
#include "level/robotmain.h"
#include "level/parser/parserexceptions.h"
diff --git a/src/level/robotmain.cpp b/src/level/robotmain.cpp
index 3d25495..6290075 100644
--- a/src/level/robotmain.cpp
+++ b/src/level/robotmain.cpp
@@ -502,15 +502,21 @@ void CRobotMain::ChangePhase(Phase phase)
if (CResourceManager::DirectoryExists("crashsave"))
{
GetLogger()->Info("Pre-crash save found!\n");
- m_ui->GetDialog()->StartQuestion("Your game seems to have crashed. Do you want to restore pre-crash state?", false, false, false, [&]() {
- GetLogger()->Info("Trying to restore pre-crash state...\n");
- assert(m_playerProfile != nullptr);
- m_playerProfile->LoadScene("../../crashsave");
- CResourceManager::RemoveDirectory("crashsave");
- }, [&]() {
- GetLogger()->Info("Not restoring pre-crash state\n");
- CResourceManager::RemoveDirectory("crashsave");
- });
+ m_ui->GetDialog()->StartQuestion(
+ "Your game seems to have crashed. Do you want to restore pre-crash state?", false, false, false,
+ [&]()
+ {
+ GetLogger()->Info("Trying to restore pre-crash state...\n");
+ assert(m_playerProfile != nullptr);
+ m_playerProfile->LoadScene("../../crashsave");
+ CResourceManager::RemoveDirectory("crashsave");
+ },
+ [&]()
+ {
+ GetLogger()->Info("Not restoring pre-crash state\n");
+ CResourceManager::RemoveDirectory("crashsave");
+ }
+ );
}
}
@@ -1018,9 +1024,13 @@ bool CRobotMain::ProcessEvent(Event &event)
break;
case EVENT_OBJECT_DELETE:
- m_ui->GetDialog()->StartQuestion(RT_DIALOG_DELOBJ, true, false, false, [&]() {
- DestroySelectedObject();
- });
+ m_ui->GetDialog()->StartQuestion(
+ RT_DIALOG_DELOBJ, true, false, false,
+ [&]()
+ {
+ DestroySelectedObject();
+ }
+ );
break;
case EVENT_OBJECT_BHELP:
@@ -2256,9 +2266,9 @@ void CRobotMain::ChangeCamera()
}
//! Remote control the camera using the arrow keys
-void CRobotMain::KeyCamera(EventType type, InputSlot key)
+void CRobotMain::KeyCamera(EventType event, InputSlot key)
{
- if (type == EVENT_KEY_UP)
+ if (event == EVENT_KEY_UP)
{
if (key == INPUT_SLOT_LEFT)
{
@@ -2290,7 +2300,7 @@ void CRobotMain::KeyCamera(EventType type, InputSlot key)
assert(obj->Implements(ObjectInterfaceType::Controllable));
if (!dynamic_cast<CControllableObject*>(obj)->GetTrainer()) return;
- if (type == EVENT_KEY_DOWN)
+ if (event == EVENT_KEY_DOWN)
{
if (key == INPUT_SLOT_LEFT)
{
diff --git a/src/level/robotmain.h b/src/level/robotmain.h
index 3544ed3..30adec1 100644
--- a/src/level/robotmain.h
+++ b/src/level/robotmain.h
@@ -30,14 +30,14 @@
#include "common/event.h"
#include "common/singleton.h"
+#include "graphics/engine/camera.h"
+#include "graphics/engine/particle.h"
+
#include "level/build_type.h"
#include "level/level_category.h"
#include "level/mainmovie.h"
#include "level/research_type.h"
-#include "graphics/engine/camera.h"
-#include "graphics/engine/particle.h"
-
#include "object/drive_type.h"
#include "object/mission_type.h"
#include "object/object_type.h"
@@ -193,8 +193,8 @@ public:
void SelectHuman();
CObject* SearchHuman();
CObject* SearchToto();
- CObject* SearchNearest(Math::Vector pos, CObject* pExclu);
- bool SelectObject(CObject* pObj, bool displayError=true);
+ CObject* SearchNearest(Math::Vector pos, CObject* exclu);
+ bool SelectObject(CObject* obj, bool displayError=true);
CObject* GetSelectObject();
CObject* DeselectAll();
@@ -259,15 +259,15 @@ public:
void HideDropZone(CObject* metal);
void ShowDropZone(CObject* metal, CObject* transporter);
void FlushShowLimit(int i);
- void SetShowLimit(int i, Gfx::ParticleType parti, CObject *pObj, Math::Vector pos,
+ void SetShowLimit(int i, Gfx::ParticleType parti, CObject *obj, Math::Vector pos,
float radius, float duration=SHOWLIMITTIME);
void StartShowLimit();
void FrameShowLimit(float rTime);
void SaveAllScript();
- void SaveOneScript(CObject *pObj);
- bool SaveFileStack(CObject *pObj, FILE *file, int objRank);
- bool ReadFileStack(CObject *pObj, FILE *file, int objRank);
+ void SaveOneScript(CObject *obj);
+ bool SaveFileStack(CObject *obj, FILE *file, int objRank);
+ bool ReadFileStack(CObject *obj, FILE *file, int objRank);
void FlushNewScriptName();
void AddNewScriptName(ObjectType type, const std::string& name);
@@ -365,7 +365,7 @@ public:
void StartDetectEffect(COldObject* object, CObject* target);
- bool IsSelectable(CObject* pObj);
+ bool IsSelectable(CObject* obj);
protected:
bool EventFrame(const Event &event);
@@ -390,7 +390,7 @@ protected:
void RemoteCamera(float pan, float zoom, float rTime);
void KeyCamera(EventType event, InputSlot key);
void AbortMovie();
- void SelectOneObject(CObject* pObj, bool displayError=true);
+ void SelectOneObject(CObject* obj, bool displayError=true);
void HelpObject();
bool DeselectObject();
void DeleteAllObjects();
diff --git a/src/level/scene_conditions.cpp b/src/level/scene_conditions.cpp
index b4cb886..2228fba 100644
--- a/src/level/scene_conditions.cpp
+++ b/src/level/scene_conditions.cpp
@@ -19,10 +19,10 @@
#include "level/scene_conditions.h"
-#include "math/geometry.h"
-
#include "level/parser/parserline.h"
+#include "math/geometry.h"
+
#include "object/object.h"
#include "object/object_manager.h"
diff --git a/src/object/auto/auto.cpp b/src/object/auto/auto.cpp
index 29d7d24..6c72d67 100644
--- a/src/object/auto/auto.cpp
+++ b/src/object/auto/auto.cpp
@@ -32,12 +32,12 @@
#include "object/old_object.h"
+#include "sound/sound.h"
+
#include "ui/controls/gauge.h"
#include "ui/controls/interface.h"
#include "ui/controls/window.h"
-#include "sound/sound.h"
-
// Object's constructor.
@@ -372,9 +372,9 @@ bool CAuto::GetBusy()
return m_bBusy;
}
-void CAuto::SetBusy(bool bBusy)
+void CAuto::SetBusy(bool busy)
{
- m_bBusy = bBusy;
+ m_bBusy = busy;
}
void CAuto::InitProgressTotal(float total)
diff --git a/src/object/auto/auto.h b/src/object/auto/auto.h
index c685e26..b3df5b9 100644
--- a/src/object/auto/auto.h
+++ b/src/object/auto/auto.h
@@ -19,9 +19,8 @@
#pragma once
-
-#include "common/event.h"
#include "common/error.h"
+#include "common/event.h"
#include "object/object_type.h"
@@ -75,7 +74,7 @@ public:
virtual Error GetError();
virtual bool GetBusy();
- virtual void SetBusy(bool bBuse);
+ virtual void SetBusy(bool busy);
virtual void InitProgressTotal(float total);
virtual void EventProgress(float rTime);
diff --git a/src/object/auto/autobase.cpp b/src/object/auto/autobase.cpp
index cb9e851..6e5061d 100644
--- a/src/object/auto/autobase.cpp
+++ b/src/object/auto/autobase.cpp
@@ -41,8 +41,6 @@
#include "ui/controls/interface.h"
#include "ui/controls/window.h"
-#include "sound/sound.h"
-
const float BASE_LAND_TIME = 7.5f; // hard landing
diff --git a/src/object/auto/autobase.h b/src/object/auto/autobase.h
index ab0cec8..04ebc07 100644
--- a/src/object/auto/autobase.h
+++ b/src/object/auto/autobase.h
@@ -86,7 +86,7 @@ public:
protected:
void UpdateInterface();
- void FreezeCargo(bool bFreeze);
+ void FreezeCargo(bool freeze);
void MoveCargo();
Error CheckCloseDoor();
void BeginTransit();
diff --git a/src/object/auto/autoconvert.cpp b/src/object/auto/autoconvert.cpp
index d1853e0..e780384 100644
--- a/src/object/auto/autoconvert.cpp
+++ b/src/object/auto/autoconvert.cpp
@@ -22,11 +22,11 @@
#include "common/make_unique.h"
+#include "level/robotmain.h"
+
#include "level/parser/parserline.h"
#include "level/parser/parserparam.h"
-#include "level/robotmain.h"
-
#include "math/geometry.h"
#include "object/object_manager.h"
@@ -34,11 +34,11 @@
#include "object/interface/transportable_object.h"
+#include "sound/sound.h"
+
#include "ui/controls/interface.h"
#include "ui/controls/window.h"
-#include "sound/sound.h"
-
// Object's constructor.
diff --git a/src/object/auto/autoconvert.h b/src/object/auto/autoconvert.h
index 15c94f0..ba0505e 100644
--- a/src/object/auto/autoconvert.h
+++ b/src/object/auto/autoconvert.h
@@ -42,7 +42,7 @@ public:
CAutoConvert(COldObject* object);
~CAutoConvert();
- void DeleteObject(bool bAll=false) override;
+ void DeleteObject(bool all=false) override;
void Init() override;
bool EventProcess(const Event &event) override;
diff --git a/src/object/auto/autoderrick.cpp b/src/object/auto/autoderrick.cpp
index bc1ced2..ab4a22e 100644
--- a/src/object/auto/autoderrick.cpp
+++ b/src/object/auto/autoderrick.cpp
@@ -37,8 +37,6 @@
#include "ui/controls/interface.h"
#include "ui/controls/window.h"
-#include "sound/sound.h"
-
const float DERRICK_DELAY = 10.0f; // duration of the extraction
diff --git a/src/object/auto/autoderrick.h b/src/object/auto/autoderrick.h
index ea7d23d..08d2515 100644
--- a/src/object/auto/autoderrick.h
+++ b/src/object/auto/autoderrick.h
@@ -42,7 +42,7 @@ public:
CAutoDerrick(COldObject* object);
~CAutoDerrick();
- void DeleteObject(bool bAll=false) override;
+ void DeleteObject(bool all=false) override;
void Init() override;
bool EventProcess(const Event &event) override;
diff --git a/src/object/auto/autodestroyer.cpp b/src/object/auto/autodestroyer.cpp
index 24b8e16..66df64e 100644
--- a/src/object/auto/autodestroyer.cpp
+++ b/src/object/auto/autodestroyer.cpp
@@ -37,8 +37,6 @@
#include "ui/controls/interface.h"
#include "ui/controls/window.h"
-#include "sound/sound.h"
-
#include <limits>
diff --git a/src/object/auto/autoegg.cpp b/src/object/auto/autoegg.cpp
index 0c61b1d..0aab026 100644
--- a/src/object/auto/autoegg.cpp
+++ b/src/object/auto/autoegg.cpp
@@ -32,8 +32,8 @@
#include "object/object_manager.h"
#include "object/old_object.h"
-#include "object/interface/programmable_object.h"
#include "object/interface/program_storage_object.h"
+#include "object/interface/programmable_object.h"
#include "object/interface/transportable_object.h"
diff --git a/src/object/auto/autoegg.h b/src/object/auto/autoegg.h
index 8a82e1a..9c8e29d 100644
--- a/src/object/auto/autoegg.h
+++ b/src/object/auto/autoegg.h
@@ -42,7 +42,7 @@ public:
CAutoEgg(COldObject* object);
~CAutoEgg();
- void DeleteObject(bool bAll=false) override;
+ void DeleteObject(bool all=false) override;
void Init() override;
void Start(int param) override;
diff --git a/src/object/auto/autofactory.cpp b/src/object/auto/autofactory.cpp
index 952805e..2c62fce 100644
--- a/src/object/auto/autofactory.cpp
+++ b/src/object/auto/autofactory.cpp
@@ -22,20 +22,20 @@
#include "common/make_unique.h"
-#include "math/geometry.h"
-
#include "level/robotmain.h"
#include "level/parser/parser.h"
#include "level/parser/parserline.h"
#include "level/parser/parserparam.h"
+#include "math/geometry.h"
+
#include "object/object_create_params.h"
#include "object/object_manager.h"
#include "object/old_object.h"
-#include "object/interface/programmable_object.h"
#include "object/interface/program_storage_object.h"
+#include "object/interface/programmable_object.h"
#include "object/interface/transportable_object.h"
#include "physics/physics.h"
diff --git a/src/object/auto/autofactory.h b/src/object/auto/autofactory.h
index 5e339ff..ead937f 100644
--- a/src/object/auto/autofactory.h
+++ b/src/object/auto/autofactory.h
@@ -43,7 +43,7 @@ public:
CAutoFactory(COldObject* object);
~CAutoFactory();
- void DeleteObject(bool bAll=false) override;
+ void DeleteObject(bool all=false) override;
void Init() override;
bool EventProcess(const Event &event) override;
diff --git a/src/object/auto/autolabo.cpp b/src/object/auto/autolabo.cpp
index b8e6992..550a82a 100644
--- a/src/object/auto/autolabo.cpp
+++ b/src/object/auto/autolabo.cpp
@@ -35,11 +35,11 @@
#include "object/interface/powered_object.h"
+#include "sound/sound.h"
+
#include "ui/controls/interface.h"
#include "ui/controls/window.h"
-#include "sound/sound.h"
-
const float LABO_DELAY = 20.0f; // duration of the analysis
diff --git a/src/object/auto/autonest.h b/src/object/auto/autonest.h
index 4eed176..d516e22 100644
--- a/src/object/auto/autonest.h
+++ b/src/object/auto/autonest.h
@@ -39,7 +39,7 @@ public:
CAutoNest(COldObject* object);
~CAutoNest();
- void DeleteObject(bool bAll=false) override;
+ void DeleteObject(bool all=false) override;
void Init() override;
bool EventProcess(const Event &event) override;
diff --git a/src/object/auto/autonuclearplant.cpp b/src/object/auto/autonuclearplant.cpp
index 15d0bb3..b034f4c 100644
--- a/src/object/auto/autonuclearplant.cpp
+++ b/src/object/auto/autonuclearplant.cpp
@@ -22,13 +22,13 @@
#include "common/make_unique.h"
-#include "math/geometry.h"
-
#include "level/robotmain.h"
#include "level/parser/parserline.h"
#include "level/parser/parserparam.h"
+#include "math/geometry.h"
+
#include "object/object_manager.h"
#include "object/old_object.h"
diff --git a/src/object/auto/autonuclearplant.h b/src/object/auto/autonuclearplant.h
index fc1e780..5d8c4cd 100644
--- a/src/object/auto/autonuclearplant.h
+++ b/src/object/auto/autonuclearplant.h
@@ -42,7 +42,7 @@ public:
CAutoNuclearPlant(COldObject* object);
~CAutoNuclearPlant();
- void DeleteObject(bool bAll=false) override;
+ void DeleteObject(bool all=false) override;
void Init() override;
bool EventProcess(const Event &event) override;
diff --git a/src/object/auto/autopowercaptor.cpp b/src/object/auto/autopowercaptor.cpp
index 0779bca..55c83c1 100644
--- a/src/object/auto/autopowercaptor.cpp
+++ b/src/object/auto/autopowercaptor.cpp
@@ -22,11 +22,11 @@
#include "common/make_unique.h"
-#include "math/geometry.h"
-
#include "level/parser/parserline.h"
#include "level/parser/parserparam.h"
+#include "math/geometry.h"
+
#include "object/object_manager.h"
#include "object/old_object.h"
diff --git a/src/object/auto/autopowerplant.h b/src/object/auto/autopowerplant.h
index dbc4f3e..92e700e 100644
--- a/src/object/auto/autopowerplant.h
+++ b/src/object/auto/autopowerplant.h
@@ -43,7 +43,7 @@ public:
CAutoPowerPlant(COldObject* object);
~CAutoPowerPlant();
- void DeleteObject(bool bAll=false) override;
+ void DeleteObject(bool all=false) override;
void Init() override;
bool EventProcess(const Event &event) override;
diff --git a/src/object/auto/autoresearch.h b/src/object/auto/autoresearch.h
index 55a8d94..eaeae3d 100644
--- a/src/object/auto/autoresearch.h
+++ b/src/object/auto/autoresearch.h
@@ -42,7 +42,7 @@ public:
void DeleteObject(bool bAll=false) override;
void Init() override;
- Error StartAction(int result) override;
+ Error StartAction(int param) override;
bool EventProcess(const Event &event) override;
Error GetError() override;
diff --git a/src/object/implementation/program_storage_impl.cpp b/src/object/implementation/program_storage_impl.cpp
index 1114274..2ef4e8c 100644
--- a/src/object/implementation/program_storage_impl.cpp
+++ b/src/object/implementation/program_storage_impl.cpp
@@ -17,7 +17,7 @@
* along with this program. If not, see http://gnu.org/licenses
*/
-#include "object/implementation/programmable_impl.h"
+#include "object/implementation/program_storage_impl.h"
#include "common/global.h"
#include "common/logger.h"
diff --git a/src/object/implementation/programmable_impl.h b/src/object/implementation/programmable_impl.h
index f92b312..b8e3125 100644
--- a/src/object/implementation/programmable_impl.h
+++ b/src/object/implementation/programmable_impl.h
@@ -19,12 +19,13 @@
#pragma once
-#include "object/interface/interactive_object.h"
#include "object/interface/programmable_object.h"
-#include "object/interface/trace_drawing_object.h"
#include "math/vector.h"
+#include "object/interface/interactive_object.h"
+#include "object/interface/trace_drawing_object.h"
+
#include <sstream>
class CObject;
@@ -64,7 +65,7 @@ public:
void TraceRecordStop() override;
bool IsTraceRecord() override;
- void SetActivity(bool bMode) override;
+ void SetActivity(bool activity) override;
bool GetActivity() override;
void SetCmdLine(unsigned int rank, float value);
diff --git a/src/object/interface/trace_drawing_object.h b/src/object/interface/trace_drawing_object.h
index a5be3fd..ee8c52b 100644
--- a/src/object/interface/trace_drawing_object.h
+++ b/src/object/interface/trace_drawing_object.h
@@ -53,9 +53,9 @@ enum class TraceColor
Max,
};
//! Convert TraceColor to a std::string
-std::string TraceColorName(TraceColor c);
+std::string TraceColorName(TraceColor color);
//! Return Gfx::Color for this TraceColor constants
-Gfx::Color TraceColorColor(TraceColor c);
+Gfx::Color TraceColorColor(TraceColor color);
/**
* \class CTraceDrawingObject
diff --git a/src/object/object.cpp b/src/object/object.cpp
index 0a59774..8568879 100644
--- a/src/object/object.cpp
+++ b/src/object/object.cpp
@@ -23,13 +23,13 @@
#include "common/restext.h"
#include "common/stringutils.h"
+#include "graphics/model/model_crash_sphere.h"
+
#include "level/robotmain.h"
#include "level/parser/parserline.h"
#include "level/parser/parserparam.h"
-#include "graphics/model/model_crash_sphere.h"
-
#include "script/scriptfunc.h"
#include <stdexcept>
diff --git a/src/object/old_object.h b/src/object/old_object.h
index a44458b..152d870 100644
--- a/src/object/old_object.h
+++ b/src/object/old_object.h
@@ -28,6 +28,11 @@
#include "object/object.h"
+#include "object/implementation/power_container_impl.h"
+#include "object/implementation/program_storage_impl.h"
+#include "object/implementation/programmable_impl.h"
+#include "object/implementation/task_executor_impl.h"
+
#include "object/interface/carrier_object.h"
#include "object/interface/controllable_object.h"
#include "object/interface/flying_object.h"
@@ -44,11 +49,6 @@
#include "object/interface/trace_drawing_object.h"
#include "object/interface/transportable_object.h"
-#include "object/implementation/power_container_impl.h"
-#include "object/implementation/program_storage_impl.h"
-#include "object/implementation/programmable_impl.h"
-#include "object/implementation/task_executor_impl.h"
-
// The father of all parts must always be the part number zero!
const int OBJECTMAXPART = 40;
@@ -101,7 +101,7 @@ protected:
void SetMovable(std::unique_ptr<CMotion> motion, std::unique_ptr<CPhysics> physics);
void SetAuto(std::unique_ptr<CAuto> automat);
void SetOption(int option);
- void SetJostlingSphere(const Math::Sphere& sphere);
+ void SetJostlingSphere(const Math::Sphere& jostlingSphere);
public:
@@ -360,7 +360,6 @@ protected:
float m_cameraDist;
bool m_bCameraLock;
float m_magnifyDamage;
- float m_param;
Math::Sphere m_jostlingSphere;
float m_shieldRadius;
diff --git a/src/object/subclass/base_alien.cpp b/src/object/subclass/base_alien.cpp
index 796d0dc..350fd80 100644
--- a/src/object/subclass/base_alien.cpp
+++ b/src/object/subclass/base_alien.cpp
@@ -24,8 +24,6 @@
#include "level/parser/parserline.h"
#include "level/parser/parserparam.h"
-#include "graphics/engine/oldmodelmanager.h"
-
#include "object/object_create_params.h"
#include "object/motion/motionant.h"
@@ -87,7 +85,7 @@ std::unique_ptr<CBaseAlien> CBaseAlien::Create(
obj->SetProgrammable();
obj->SetMovable(std::move(motion), std::move(physics));
- return std::move(obj);
+ return obj;
}
void CBaseAlien::SetFixed(bool fixed)
diff --git a/src/object/subclass/base_building.cpp b/src/object/subclass/base_building.cpp
index 6f1a09a..3a5700a 100644
--- a/src/object/subclass/base_building.cpp
+++ b/src/object/subclass/base_building.cpp
@@ -889,5 +889,5 @@ std::unique_ptr<CBaseBuilding> CBaseBuilding::Create(
obj->UpdateMapping();
- return std::move(obj);
+ return obj;
}
diff --git a/src/object/subclass/base_robot.cpp b/src/object/subclass/base_robot.cpp
index 53423f0..7cf23c5 100644
--- a/src/object/subclass/base_robot.cpp
+++ b/src/object/subclass/base_robot.cpp
@@ -55,7 +55,7 @@ std::unique_ptr<CBaseRobot> CBaseRobot::Create(
auto motion = MakeUnique<CMotionToto>(obj.get());
motion->Create(params.pos, params.angle, params.type, 1.0f, modelManager);
obj->SetMovable(std::move(motion), nullptr);
- return std::move(obj);
+ return obj;
}
if ( params.type == OBJECT_HUMAN ||
@@ -95,5 +95,5 @@ std::unique_ptr<CBaseRobot> CBaseRobot::Create(
obj->SetProgrammable();
obj->SetMovable(std::move(motion), std::move(physics));
- return std::move(obj);
+ return obj;
}
diff --git a/src/object/subclass/shielder.cpp b/src/object/subclass/shielder.cpp
index 9b74ad5..df5f4a7 100644
--- a/src/object/subclass/shielder.cpp
+++ b/src/object/subclass/shielder.cpp
@@ -66,7 +66,7 @@ std::unique_ptr<CShielder> CShielder::Create(
obj->SetProgrammable();
obj->SetMovable(std::move(motion), std::move(physics));
- return std::move(obj);
+ return obj;
}
void CShielder::SetShieldRadius(float shieldRadius)
diff --git a/src/object/task/taskgoto.cpp b/src/object/task/taskgoto.cpp
index 455e82d..49484d3 100644
--- a/src/object/task/taskgoto.cpp
+++ b/src/object/task/taskgoto.cpp
@@ -20,8 +20,8 @@
#include "object/task/taskgoto.h"
-#include "common/global.h"
#include "common/event.h"
+#include "common/global.h"
#include "common/make_unique.h"
#include "graphics/engine/terrain.h"
diff --git a/src/object/task/taskpen.h b/src/object/task/taskpen.h
index 08de361..525a298 100644
--- a/src/object/task/taskpen.h
+++ b/src/object/task/taskpen.h
@@ -19,13 +19,12 @@
#pragma once
-
#include "object/task/task.h"
-#include "object/interface/trace_drawing_object.h"
-
#include "math/vector.h"
+#include "object/interface/trace_drawing_object.h"
+
enum TaskPenPhase
{
diff --git a/src/object/task/taskterraform.cpp b/src/object/task/taskterraform.cpp
index f761dba..f1adf4a 100644
--- a/src/object/task/taskterraform.cpp
+++ b/src/object/task/taskterraform.cpp
@@ -23,10 +23,10 @@
#include "graphics/engine/pyro_manager.h"
#include "graphics/engine/terrain.h"
-#include "math/geometry.h"
-
#include "level/robotmain.h"
+#include "math/geometry.h"
+
#include "object/object_manager.h"
#include "object/old_object.h"
diff --git a/src/script/scriptfunc.cpp b/src/script/scriptfunc.cpp
index 4a0214a..3b55bb2 100644
--- a/src/script/scriptfunc.cpp
+++ b/src/script/scriptfunc.cpp
@@ -3680,14 +3680,14 @@ void CScriptFunctions::Init()
CBotClass* bc;
// Add the class Point.
- bc = new CBotClass("point", nullptr, true); // intrinsic class
+ bc = CBotClass::Create("point", nullptr, true); // intrinsic class
bc->AddItem("x", CBotTypFloat);
bc->AddItem("y", CBotTypFloat);
bc->AddItem("z", CBotTypFloat);
bc->AddFunction("point", CScriptFunctions::rPointConstructor, CScriptFunctions::cPointConstructor);
// Adds the class Object.
- bc = new CBotClass("object", nullptr);
+ bc = CBotClass::Create("object", nullptr);
bc->AddItem("category", CBotTypResult(CBotTypInt), PR_READ);
bc->AddItem("position", CBotTypResult(CBotTypClass, "point"), PR_READ);
bc->AddItem("orientation", CBotTypResult(CBotTypFloat), PR_READ);
@@ -3718,7 +3718,7 @@ void CScriptFunctions::Init()
// canal.close(); // close the file
// create the class FILE
- bc = new CBotClass("file", nullptr);
+ bc = CBotClass::Create("file", nullptr);
// adds the component ".filename"
bc->AddItem("filename", CBotTypString);
// adds the component ".handle"
@@ -3991,6 +3991,6 @@ void CScriptFunctions::DestroyObjectVar(CBotVar* botVar, bool permanent)
if ( botVar == nullptr ) return;
botVar->SetUserPtr(OBJECTDELETED);
- if(permanent)
- delete botVar;
+ if (permanent)
+ CBotVar::Destroy(botVar);
}
diff --git a/src/sound/oalsound/alsound.cpp b/src/sound/oalsound/alsound.cpp
index 029327c..a94e279 100644
--- a/src/sound/oalsound/alsound.cpp
+++ b/src/sound/oalsound/alsound.cpp
@@ -27,7 +27,7 @@
#include <boost/filesystem.hpp>
-ALSound::ALSound()
+CALSound::CALSound()
: m_enabled(false),
m_audioVolume(1.0f),
m_musicVolume(1.0f),
@@ -37,14 +37,12 @@ ALSound::ALSound()
{
}
-
-ALSound::~ALSound()
+CALSound::~CALSound()
{
CleanUp();
}
-
-void ALSound::CleanUp()
+void CALSound::CleanUp()
{
if (m_enabled)
{
@@ -71,8 +69,7 @@ void ALSound::CleanUp()
}
}
-
-bool ALSound::Create()
+bool CALSound::Create()
{
CleanUp();
@@ -102,20 +99,17 @@ bool ALSound::Create()
return true;
}
-
-bool ALSound::GetEnable()
+bool CALSound::GetEnable()
{
return m_enabled;
}
-
-void ALSound::SetAudioVolume(int volume)
+void CALSound::SetAudioVolume(int volume)
{
m_audioVolume = static_cast<float>(volume) / MAXVOLUME;
}
-
-int ALSound::GetAudioVolume()
+int CALSound::GetAudioVolume()
{
if ( !m_enabled )
return 0;
@@ -123,8 +117,7 @@ int ALSound::GetAudioVolume()
return m_audioVolume * MAXVOLUME;
}
-
-void ALSound::SetMusicVolume(int volume)
+void CALSound::SetMusicVolume(int volume)
{
m_musicVolume = static_cast<float>(volume) / MAXVOLUME;
if (m_currentMusic)
@@ -133,8 +126,7 @@ void ALSound::SetMusicVolume(int volume)
}
}
-
-int ALSound::GetMusicVolume()
+int CALSound::GetMusicVolume()
{
if ( !m_enabled )
return 0.0f;
@@ -142,10 +134,9 @@ int ALSound::GetMusicVolume()
return m_musicVolume * MAXVOLUME;
}
-
-bool ALSound::Cache(SoundType sound, const std::string &filename)
+bool CALSound::Cache(SoundType sound, const std::string &filename)
{
- auto buffer = MakeUnique<Buffer>();
+ auto buffer = MakeUnique<CBuffer>();
if (buffer->LoadFromFile(filename, sound))
{
m_sounds[sound] = std::move(buffer);
@@ -154,11 +145,11 @@ bool ALSound::Cache(SoundType sound, const std::string &filename)
return false;
}
-bool ALSound::CacheMusic(const std::string &filename)
+bool CALSound::CacheMusic(const std::string &filename)
{
if (m_music.find(filename) == m_music.end())
{
- auto buffer = MakeUnique<Buffer>();
+ auto buffer = MakeUnique<CBuffer>();
if (buffer->LoadFromFile(filename, static_cast<SoundType>(-1)))
{
m_music[filename] = std::move(buffer);
@@ -168,17 +159,17 @@ bool ALSound::CacheMusic(const std::string &filename)
return false;
}
-bool ALSound::IsCached(SoundType sound)
+bool CALSound::IsCached(SoundType sound)
{
return m_sounds.find(sound) != m_sounds.end();
}
-bool ALSound::IsCachedMusic(const std::string &filename)
+bool CALSound::IsCachedMusic(const std::string &filename)
{
return m_music.find(filename) != m_music.end();
}
-int ALSound::GetPriority(SoundType sound)
+int CALSound::GetPriority(SoundType sound)
{
if ( sound == SOUND_FLYh ||
sound == SOUND_FLY ||
@@ -226,8 +217,7 @@ int ALSound::GetPriority(SoundType sound)
return 10;
}
-
-bool ALSound::SearchFreeBuffer(SoundType sound, int &channel, bool &alreadyLoaded)
+bool CALSound::SearchFreeBuffer(SoundType sound, int &channel, bool &alreadyLoaded)
{
int priority = GetPriority(sound);
@@ -253,7 +243,7 @@ bool ALSound::SearchFreeBuffer(SoundType sound, int &channel, bool &alreadyLoade
// just add a new channel if we dont have any
if (m_channels.size() == 0)
{
- auto chn = MakeUnique<Channel>();
+ auto chn = MakeUnique<CChannel>();
// check if we channel ready to play music, if not report error
if (chn->IsReady())
{
@@ -278,7 +268,7 @@ bool ALSound::SearchFreeBuffer(SoundType sound, int &channel, bool &alreadyLoade
{
if (m_channels.find(i) == m_channels.end())
{
- auto chn = MakeUnique<Channel>();
+ auto chn = MakeUnique<CChannel>();
// check if channel is ready to play music, if not destroy it and seek free one
if (chn->IsReady())
{
@@ -321,14 +311,12 @@ bool ALSound::SearchFreeBuffer(SoundType sound, int &channel, bool &alreadyLoade
return false;
}
-
-int ALSound::Play(SoundType sound, float amplitude, float frequency, bool loop)
+int CALSound::Play(SoundType sound, float amplitude, float frequency, bool loop)
{
return Play(sound, m_eye, amplitude, frequency, loop);
}
-
-int ALSound::Play(SoundType sound, const Math::Vector &pos, float amplitude, float frequency, bool loop)
+int CALSound::Play(SoundType sound, const Math::Vector &pos, float amplitude, float frequency, bool loop)
{
if (!m_enabled)
{
@@ -356,7 +344,7 @@ int ALSound::Play(SoundType sound, const Math::Vector &pos, float amplitude, flo
}
}
- Channel* chn = m_channels[channel].get();
+ CChannel* chn = m_channels[channel].get();
chn->SetPosition(pos);
chn->SetVolumeAtrib(1.0f);
@@ -382,8 +370,7 @@ int ALSound::Play(SoundType sound, const Math::Vector &pos, float amplitude, flo
return channel | ((chn->GetId() & 0xffff) << 16);
}
-
-bool ALSound::FlushEnvelope(int channel)
+bool CALSound::FlushEnvelope(int channel)
{
if (!CheckChannel(channel))
{
@@ -394,8 +381,7 @@ bool ALSound::FlushEnvelope(int channel)
return true;
}
-
-bool ALSound::AddEnvelope(int channel, float amplitude, float frequency, float time, SoundNext oper)
+bool CALSound::AddEnvelope(int channel, float amplitude, float frequency, float time, SoundNext oper)
{
if (!CheckChannel(channel))
{
@@ -413,8 +399,7 @@ bool ALSound::AddEnvelope(int channel, float amplitude, float frequency, float t
return true;
}
-
-bool ALSound::Position(int channel, const Math::Vector &pos)
+bool CALSound::Position(int channel, const Math::Vector &pos)
{
if (!CheckChannel(channel))
{
@@ -425,8 +410,7 @@ bool ALSound::Position(int channel, const Math::Vector &pos)
return true;
}
-
-bool ALSound::Frequency(int channel, float frequency)
+bool CALSound::Frequency(int channel, float frequency)
{
if (!CheckChannel(channel))
{
@@ -438,7 +422,7 @@ bool ALSound::Frequency(int channel, float frequency)
return true;
}
-bool ALSound::Stop(int channel)
+bool CALSound::Stop(int channel)
{
if (!CheckChannel(channel))
{
@@ -451,8 +435,7 @@ bool ALSound::Stop(int channel)
return true;
}
-
-bool ALSound::StopAll()
+bool CALSound::StopAll()
{
if (!m_enabled)
{
@@ -468,8 +451,7 @@ bool ALSound::StopAll()
return true;
}
-
-bool ALSound::MuteAll(bool mute)
+bool CALSound::MuteAll(bool mute)
{
if (!m_enabled)
{
@@ -487,8 +469,7 @@ bool ALSound::MuteAll(bool mute)
return true;
}
-
-void ALSound::FrameMove(float delta)
+void CALSound::FrameMove(float rTime)
{
if (!m_enabled)
{
@@ -513,7 +494,7 @@ void ALSound::FrameMove(float delta)
continue;
SoundOper &oper = it.second->GetEnvelope();
- oper.currentTime += delta;
+ oper.currentTime += rTime;
progress = oper.currentTime / oper.totalTime;
progress = std::min(progress, 1.0f);
@@ -560,7 +541,7 @@ void ALSound::FrameMove(float delta)
}
else
{
- it->currentTime += delta;
+ it->currentTime += rTime;
it->music->SetVolume(((it->fadeTime-it->currentTime) / it->fadeTime) * m_musicVolume);
++it;
}
@@ -574,14 +555,13 @@ void ALSound::FrameMove(float delta)
}
else
{
- m_previousMusic.currentTime += delta;
+ m_previousMusic.currentTime += rTime;
m_previousMusic.music->SetVolume(((m_previousMusic.fadeTime-m_previousMusic.currentTime) / m_previousMusic.fadeTime) * m_musicVolume);
}
}
}
-
-void ALSound::SetListener(const Math::Vector &eye, const Math::Vector &lookat)
+void CALSound::SetListener(const Math::Vector &eye, const Math::Vector &lookat)
{
m_eye = eye;
m_lookat = lookat;
@@ -593,15 +573,14 @@ void ALSound::SetListener(const Math::Vector &eye, const Math::Vector &lookat)
alListenerfv(AL_ORIENTATION, orientation);
}
-
-bool ALSound::PlayMusic(const std::string &filename, bool repeat, float fadeTime)
+bool CALSound::PlayMusic(const std::string &filename, bool repeat, float fadeTime)
{
if (!m_enabled)
{
return false;
}
- Buffer *buffer = nullptr;
+ CBuffer *buffer = nullptr;
// check if we have music in cache
if (m_music.find(filename) == m_music.end())
@@ -613,7 +592,7 @@ bool ALSound::PlayMusic(const std::string &filename, bool repeat, float fadeTime
return false;
} */
- auto newBuffer = MakeUnique<Buffer>();
+ auto newBuffer = MakeUnique<CBuffer>();
buffer = newBuffer.get();
if (!newBuffer->LoadFromFile(filename, static_cast<SoundType>(-1)))
{
@@ -636,7 +615,7 @@ bool ALSound::PlayMusic(const std::string &filename, bool repeat, float fadeTime
m_oldMusic.push_back(std::move(old));
}
- m_currentMusic = MakeUnique<Channel>();
+ m_currentMusic = MakeUnique<CChannel>();
m_currentMusic->SetBuffer(buffer);
m_currentMusic->SetVolume(m_musicVolume);
m_currentMusic->SetLoop(repeat);
@@ -645,8 +624,7 @@ bool ALSound::PlayMusic(const std::string &filename, bool repeat, float fadeTime
return true;
}
-
-bool ALSound::PlayPauseMusic(const std::string &filename, bool repeat)
+bool CALSound::PlayPauseMusic(const std::string &filename, bool repeat)
{
if (m_previousMusic.fadeTime > 0.0f)
{
@@ -671,8 +649,7 @@ bool ALSound::PlayPauseMusic(const std::string &filename, bool repeat)
return PlayMusic(filename, repeat);
}
-
-void ALSound::StopPauseMusic()
+void CALSound::StopPauseMusic()
{
if (m_previousMusic.fadeTime > 0.0f)
{
@@ -691,8 +668,7 @@ void ALSound::StopPauseMusic()
}
}
-
-bool ALSound::RestartMusic()
+bool CALSound::RestartMusic()
{
if (!m_enabled || m_currentMusic == nullptr)
{
@@ -704,8 +680,7 @@ bool ALSound::RestartMusic()
return true;
}
-
-void ALSound::StopMusic(float fadeTime)
+void CALSound::StopMusic(float fadeTime)
{
if (!m_enabled || m_currentMusic == nullptr)
{
@@ -719,8 +694,7 @@ void ALSound::StopMusic(float fadeTime)
m_oldMusic.push_back(std::move(old));
}
-
-bool ALSound::IsPlayingMusic()
+bool CALSound::IsPlayingMusic()
{
if (!m_enabled || m_currentMusic == nullptr)
{
@@ -730,8 +704,7 @@ bool ALSound::IsPlayingMusic()
return m_currentMusic->IsPlaying();
}
-
-void ALSound::SuspendMusic()
+void CALSound::SuspendMusic()
{
if (!m_enabled || m_currentMusic == nullptr)
{
@@ -741,8 +714,7 @@ void ALSound::SuspendMusic()
m_currentMusic->Stop();
}
-
-bool ALSound::CheckChannel(int &channel)
+bool CALSound::CheckChannel(int &channel)
{
int id = (channel >> 16) & 0xffff;
channel &= 0xffff;
diff --git a/src/sound/oalsound/alsound.h b/src/sound/oalsound/alsound.h
index 39ad905..a03a08d 100644
--- a/src/sound/oalsound/alsound.h
+++ b/src/sound/oalsound/alsound.h
@@ -60,7 +60,7 @@ struct OldMusic
return *this;
}
- std::unique_ptr<Channel> music;
+ std::unique_ptr<CChannel> music;
float fadeTime = 0.0f;
float currentTime = 0.0f;
@@ -75,11 +75,11 @@ struct OldMusic
}
};
-class ALSound : public CSoundInterface
+class CALSound : public CSoundInterface
{
public:
- ALSound();
- ~ALSound();
+ CALSound();
+ ~CALSound();
bool Create() override;
bool Cache(SoundType, const std::string &) override;
@@ -126,10 +126,10 @@ private:
unsigned int m_channelsLimit;
ALCdevice* m_device;
ALCcontext* m_context;
- std::map<SoundType, std::unique_ptr<Buffer>> m_sounds;
- std::map<std::string, std::unique_ptr<Buffer>> m_music;
- std::map<int, std::unique_ptr<Channel>> m_channels;
- std::unique_ptr<Channel> m_currentMusic;
+ std::map<SoundType, std::unique_ptr<CBuffer>> m_sounds;
+ std::map<std::string, std::unique_ptr<CBuffer>> m_music;
+ std::map<int, std::unique_ptr<CChannel>> m_channels;
+ std::unique_ptr<CChannel> m_currentMusic;
std::list<OldMusic> m_oldMusic;
OldMusic m_previousMusic;
Math::Vector m_eye;
diff --git a/src/sound/oalsound/buffer.cpp b/src/sound/oalsound/buffer.cpp
index 7f6b670..c48da36 100644
--- a/src/sound/oalsound/buffer.cpp
+++ b/src/sound/oalsound/buffer.cpp
@@ -28,15 +28,14 @@
#include <memory>
-Buffer::Buffer()
+CBuffer::CBuffer()
: m_buffer(),
m_sound(),
m_loaded(false),
m_duration(0.0f)
{}
-
-Buffer::~Buffer()
+CBuffer::~CBuffer()
{
if (m_loaded)
{
@@ -46,8 +45,7 @@ Buffer::~Buffer()
}
}
-
-bool Buffer::LoadFromFile(std::string filename, SoundType sound)
+bool CBuffer::LoadFromFile(std::string filename, SoundType sound)
{
m_sound = sound;
GetLogger()->Debug("Loading audio file: %s\n", filename.c_str());
@@ -92,27 +90,22 @@ bool Buffer::LoadFromFile(std::string filename, SoundType sound)
return true;
}
-
-SoundType Buffer::GetSoundType()
+SoundType CBuffer::GetSoundType()
{
return m_sound;
}
-
-ALuint Buffer::GetBuffer()
+ALuint CBuffer::GetBuffer()
{
return m_buffer;
}
-
-bool Buffer::IsLoaded()
+bool CBuffer::IsLoaded()
{
return m_loaded;
}
-
-float Buffer::GetDuration()
+float CBuffer::GetDuration()
{
return m_duration;
}
-
diff --git a/src/sound/oalsound/buffer.h b/src/sound/oalsound/buffer.h
index b45ce3b..379fafb 100644
--- a/src/sound/oalsound/buffer.h
+++ b/src/sound/oalsound/buffer.h
@@ -32,11 +32,11 @@
#include <al.h>
-class Buffer
+class CBuffer
{
public:
- Buffer();
- ~Buffer();
+ CBuffer();
+ ~CBuffer();
bool LoadFromFile(std::string, SoundType);
bool IsLoaded();
diff --git a/src/sound/oalsound/channel.cpp b/src/sound/oalsound/channel.cpp
index 4b3b559..fb506e4 100644
--- a/src/sound/oalsound/channel.cpp
+++ b/src/sound/oalsound/channel.cpp
@@ -22,7 +22,7 @@
#include "sound/oalsound/buffer.h"
-Channel::Channel()
+CChannel::CChannel()
: m_buffer(nullptr),
m_source(0),
m_priority(0),
@@ -49,8 +49,7 @@ Channel::Channel()
}
}
-
-Channel::~Channel()
+CChannel::~CChannel()
{
if (m_ready)
{
@@ -62,8 +61,7 @@ Channel::~Channel()
}
}
-
-bool Channel::Play()
+bool CChannel::Play()
{
if (!m_ready || m_buffer == nullptr)
{
@@ -81,7 +79,7 @@ bool Channel::Play()
return true;
}
-bool Channel::Pause()
+bool CChannel::Pause()
{
if (!m_ready || !IsPlaying())
{
@@ -96,8 +94,7 @@ bool Channel::Pause()
return true;
}
-
-bool Channel::SetPosition(const Math::Vector &pos)
+bool CChannel::SetPosition(const Math::Vector &pos)
{
if (!m_ready || m_buffer == nullptr)
{
@@ -113,8 +110,7 @@ bool Channel::SetPosition(const Math::Vector &pos)
return true;
}
-
-bool Channel::SetFrequency(float freq)
+bool CChannel::SetFrequency(float freq)
{
if (!m_ready || m_buffer == nullptr)
{
@@ -130,8 +126,7 @@ bool Channel::SetFrequency(float freq)
return true;
}
-
-float Channel::GetFrequency()
+float CChannel::GetFrequency()
{
ALfloat freq;
if (!m_ready || m_buffer == nullptr)
@@ -149,8 +144,7 @@ float Channel::GetFrequency()
return freq;
}
-
-bool Channel::SetVolume(float vol)
+bool CChannel::SetVolume(float vol)
{
if (!m_ready || vol < 0 || m_buffer == nullptr)
{
@@ -166,8 +160,7 @@ bool Channel::SetVolume(float vol)
return true;
}
-
-float Channel::GetVolume()
+float CChannel::GetVolume()
{
ALfloat vol;
if (!m_ready || m_buffer == nullptr)
@@ -185,87 +178,72 @@ float Channel::GetVolume()
return vol;
}
-
-void Channel::SetVolumeAtrib(float volume)
+void CChannel::SetVolumeAtrib(float volume)
{
m_volume = volume;
}
-
-float Channel::GetVolumeAtrib()
+float CChannel::GetVolumeAtrib()
{
return m_volume;
}
-
-
-int Channel::GetPriority()
+int CChannel::GetPriority()
{
return m_priority;
}
-
-void Channel::SetPriority(int pri)
+void CChannel::SetPriority(int pri)
{
m_priority = pri;
}
-
-void Channel::SetStartAmplitude(float gain)
+void CChannel::SetStartAmplitude(float gain)
{
m_startAmplitude = gain;
}
-
-void Channel::SetStartFrequency(float freq)
+void CChannel::SetStartFrequency(float freq)
{
m_startFrequency = freq;
}
-
-void Channel::SetChangeFrequency(float freq)
+void CChannel::SetChangeFrequency(float freq)
{
m_changeFrequency = freq;
}
-
-float Channel::GetStartAmplitude()
+float CChannel::GetStartAmplitude()
{
return m_startAmplitude;
}
-
-float Channel::GetStartFrequency()
+float CChannel::GetStartFrequency()
{
return m_startFrequency;
}
-
-float Channel::GetChangeFrequency()
+float CChannel::GetChangeFrequency()
{
return m_changeFrequency;
}
-
-float Channel::GetInitFrequency()
+float CChannel::GetInitFrequency()
{
return m_initFrequency;
}
-
-void Channel::AddOper(SoundOper oper)
+void CChannel::AddOper(SoundOper oper)
{
m_oper.push_back(oper);
}
-
-void Channel::ResetOper()
+void CChannel::ResetOper()
{
m_oper.clear();
}
-
-SoundType Channel::GetSoundType()
+SoundType CChannel::GetSoundType()
{
if (!m_ready || m_buffer == nullptr)
{
@@ -275,8 +253,7 @@ SoundType Channel::GetSoundType()
return m_buffer->GetSoundType();
}
-
-bool Channel::SetBuffer(Buffer *buffer)
+bool CChannel::SetBuffer(CBuffer *buffer)
{
if (!m_ready)
return false;
@@ -299,7 +276,7 @@ bool Channel::SetBuffer(Buffer *buffer)
return true;
}
-bool Channel::IsPlaying()
+bool CChannel::IsPlaying()
{
ALint status;
if (!m_ready || m_buffer == nullptr)
@@ -317,19 +294,17 @@ bool Channel::IsPlaying()
return status == AL_PLAYING;
}
-
-bool Channel::IsReady()
+bool CChannel::IsReady()
{
return m_ready;
}
-bool Channel::IsLoaded()
+bool CChannel::IsLoaded()
{
return m_buffer != nullptr;
}
-
-bool Channel::Stop()
+bool CChannel::Stop()
{
if (!m_ready || m_buffer == nullptr)
{
@@ -345,8 +320,7 @@ bool Channel::Stop()
return true;
}
-
-float Channel::GetCurrentTime()
+float CChannel::GetCurrentTime()
{
if (!m_ready || m_buffer == nullptr)
{
@@ -363,8 +337,7 @@ float Channel::GetCurrentTime()
return current;
}
-
-void Channel::SetCurrentTime(float current)
+void CChannel::SetCurrentTime(float current)
{
if (!m_ready || m_buffer == nullptr)
{
@@ -378,8 +351,7 @@ void Channel::SetCurrentTime(float current)
}
}
-
-float Channel::GetDuration()
+float CChannel::GetDuration()
{
if (!m_ready || m_buffer == nullptr)
{
@@ -389,50 +361,42 @@ float Channel::GetDuration()
return m_buffer->GetDuration();
}
-
-bool Channel::HasEnvelope()
+bool CChannel::HasEnvelope()
{
return m_oper.size() > 0;
}
-
-SoundOper& Channel::GetEnvelope()
+SoundOper& CChannel::GetEnvelope()
{
return m_oper.front();
}
-
-void Channel::PopEnvelope()
+void CChannel::PopEnvelope()
{
m_oper.pop_front();
}
-
-void Channel::SetLoop(bool loop)
+void CChannel::SetLoop(bool loop)
{
m_loop = loop;
}
-
-void Channel::Mute(bool mute)
+void CChannel::Mute(bool mute)
{
m_mute = mute;
}
-
-bool Channel::IsMuted()
+bool CChannel::IsMuted()
{
return m_mute;
}
-
-void Channel::Reset()
+void CChannel::Reset()
{
m_id++;
}
-
-int Channel::GetId()
+int CChannel::GetId()
{
return m_id;
}
diff --git a/src/sound/oalsound/channel.h b/src/sound/oalsound/channel.h
index b605006..63b4362 100644
--- a/src/sound/oalsound/channel.h
+++ b/src/sound/oalsound/channel.h
@@ -37,7 +37,7 @@
#include <al.h>
#include <alc.h>
-class Buffer;
+class CBuffer;
struct SoundOper
{
@@ -49,11 +49,11 @@ struct SoundOper
};
-class Channel
+class CChannel
{
public:
- Channel();
- ~Channel();
+ CChannel();
+ ~CChannel();
bool Play();
bool Pause();
@@ -77,7 +77,7 @@ public:
bool IsReady();
bool IsLoaded();
- bool SetBuffer(Buffer *buffer);
+ bool SetBuffer(CBuffer *buffer);
bool HasEnvelope();
SoundOper& GetEnvelope();
@@ -106,7 +106,7 @@ public:
int GetId();
private:
- Buffer *m_buffer;
+ CBuffer *m_buffer;
ALuint m_source;
int m_priority;
diff --git a/src/sound/sound.cpp b/src/sound/sound.cpp
index 7afe956..fb10d2f 100644
--- a/src/sound/sound.cpp
+++ b/src/sound/sound.cpp
@@ -153,7 +153,7 @@ bool CSoundInterface::StopAll()
return true;
}
-bool CSoundInterface::MuteAll(bool bMute)
+bool CSoundInterface::MuteAll(bool mute)
{
return true;
}
diff --git a/src/ui/controls/button.cpp b/src/ui/controls/button.cpp
index 2f2a7b0..92ac3f5 100644
--- a/src/ui/controls/button.cpp
+++ b/src/ui/controls/button.cpp
@@ -208,9 +208,9 @@ void CButton::Draw()
// Management of immediate mode, which sends the event "press"
// before the mouse button is released.
-void CButton::SetImmediat(bool bImmediat)
+void CButton::SetImmediat(bool immediat)
{
- m_bImmediat = bImmediat;
+ m_bImmediat = immediat;
}
bool CButton::GetImmediat()
diff --git a/src/ui/controls/button.h b/src/ui/controls/button.h
index c4cc7e8..a596662 100644
--- a/src/ui/controls/button.h
+++ b/src/ui/controls/button.h
@@ -38,7 +38,7 @@ public:
void Draw() override;
- void SetImmediat(bool bRepeat);
+ void SetImmediat(bool immediat);
bool GetImmediat();
void SetRepeat(bool bRepeat);
diff --git a/src/ui/controls/list.cpp b/src/ui/controls/list.cpp
index 7ed77b7..be2301c 100644
--- a/src/ui/controls/list.cpp
+++ b/src/ui/controls/list.cpp
@@ -699,12 +699,12 @@ bool CList::GetCheck(int i)
// Specifies the bit "enable" for a box.
-void CList::SetEnable(int i, bool bMode)
+void CList::SetEnable(int i, bool enable)
{
if ( i < 0 || i >= m_totalLine )
return;
- m_items[i].enable = bMode;
+ m_items[i].enable = enable;
}
// Returns the bit "enable" for a box.
diff --git a/src/ui/controls/list.h b/src/ui/controls/list.h
index abf90b2..82671c2 100644
--- a/src/ui/controls/list.h
+++ b/src/ui/controls/list.h
@@ -77,7 +77,7 @@ public:
void SetCheck(int i, bool bMode);
bool GetCheck(int i);
- void SetEnable(int i, bool bEnable);
+ void SetEnable(int i, bool enable);
bool GetEnable(int i);
void SetTabs(int i, float pos, Gfx::TextAlign justif=Gfx::TEXT_ALIGN_LEFT);
diff --git a/src/ui/controls/slider.h b/src/ui/controls/slider.h
index ce2d5b4..ca35c13 100644
--- a/src/ui/controls/slider.h
+++ b/src/ui/controls/slider.h
@@ -34,7 +34,7 @@ public:
CSlider();
~CSlider();
- bool Create(Math::Point pos, Math::Point dim, int icon, EventType eventMsg) override;
+ bool Create(Math::Point pos, Math::Point dim, int icon, EventType eventType) override;
void SetPos(Math::Point pos) override;
void SetDim(Math::Point dim) override;
diff --git a/src/ui/controls/target.h b/src/ui/controls/target.h
index b7d7049..4de48c1 100644
--- a/src/ui/controls/target.h
+++ b/src/ui/controls/target.h
@@ -37,7 +37,7 @@ public:
CTarget();
~CTarget();
- bool Create(Math::Point pos, Math::Point dim, int icon, EventType eventMsg) override;
+ bool Create(Math::Point pos, Math::Point dim, int icon, EventType eventType) override;
bool EventProcess(const Event &event) override;
void Draw() override;
diff --git a/src/ui/displaytext.h b/src/ui/displaytext.h
index 8db4e93..6c36607 100644
--- a/src/ui/displaytext.h
+++ b/src/ui/displaytext.h
@@ -19,8 +19,8 @@
#pragma once
-#include "common/event.h"
#include "common/error.h"
+#include "common/event.h"
#include <array>
diff --git a/src/ui/maindialog.cpp b/src/ui/maindialog.cpp
index 31e5ebb..662e0a2 100644
--- a/src/ui/maindialog.cpp
+++ b/src/ui/maindialog.cpp
@@ -29,14 +29,14 @@
#include "common/make_unique.h"
#include "common/settings.h"
-#include "level/robotmain.h"
#include "level/player_profile.h"
+#include "level/robotmain.h"
#include "sound/sound.h"
#include "ui/controls/button.h"
-#include "ui/controls/label.h"
#include "ui/controls/interface.h"
+#include "ui/controls/label.h"
#include "ui/controls/window.h"
#include "ui/screen/screen_setup.h"
diff --git a/src/ui/mainui.cpp b/src/ui/mainui.cpp
index c61dd03..2cc5297 100644
--- a/src/ui/mainui.cpp
+++ b/src/ui/mainui.cpp
@@ -35,6 +35,11 @@
#include "ui/maindialog.h"
+#include "ui/controls/group.h"
+#include "ui/controls/interface.h"
+#include "ui/controls/label.h"
+#include "ui/controls/window.h"
+
#include "ui/screen/screen.h"
#include "ui/screen/screen_apperance.h"
#include "ui/screen/screen_io_read.h"
@@ -43,19 +48,14 @@
#include "ui/screen/screen_loading.h"
#include "ui/screen/screen_main_menu.h"
#include "ui/screen/screen_player_select.h"
+#include "ui/screen/screen_quit.h"
#include "ui/screen/screen_setup_controls.h"
#include "ui/screen/screen_setup_display.h"
#include "ui/screen/screen_setup_game.h"
#include "ui/screen/screen_setup_graphics.h"
#include "ui/screen/screen_setup_sound.h"
-#include "ui/screen/screen_quit.h"
#include "ui/screen/screen_welcome.h"
-#include "ui/controls/interface.h"
-#include "ui/controls/group.h"
-#include "ui/controls/label.h"
-#include "ui/controls/window.h"
-
namespace Ui
{
diff --git a/src/ui/object_interface.h b/src/ui/object_interface.h
index 7d89259..fb5d791 100644
--- a/src/ui/object_interface.h
+++ b/src/ui/object_interface.h
@@ -53,7 +53,7 @@ public:
CObjectInterface(COldObject* object);
~CObjectInterface();
- void DeleteObject(bool bAll=false);
+ void DeleteObject(bool all=false);
bool EventProcess(const Event &event);
bool CreateInterface(bool bSelect);
diff --git a/src/ui/screen/screen.cpp b/src/ui/screen/screen.cpp
index 7adc5df..fce3a07 100644
--- a/src/ui/screen/screen.cpp
+++ b/src/ui/screen/screen.cpp
@@ -19,10 +19,10 @@
#include "ui/screen/screen.h"
-#include "common/version.h"
-
#include "app/app.h"
+#include "common/version.h"
+
#include "graphics/engine/engine.h"
#include "level/robotmain.h"
diff --git a/src/ui/screen/screen_io.cpp b/src/ui/screen/screen_io.cpp
index fbae048..450990f 100644
--- a/src/ui/screen/screen_io.cpp
+++ b/src/ui/screen/screen_io.cpp
@@ -31,15 +31,15 @@
#include "sound/sound.h"
-#include "ui/screen/screen_level_list.h"
-
#include "ui/controls/button.h"
#include "ui/controls/edit.h"
-#include "ui/controls/interface.h"
#include "ui/controls/image.h"
+#include "ui/controls/interface.h"
#include "ui/controls/list.h"
#include "ui/controls/window.h"
+#include "ui/screen/screen_level_list.h"
+
#include <ctime>
#include <cstring>
diff --git a/src/ui/screen/screen_io_read.cpp b/src/ui/screen/screen_io_read.cpp
index 5ce9753..3fd4b6b 100644
--- a/src/ui/screen/screen_io_read.cpp
+++ b/src/ui/screen/screen_io_read.cpp
@@ -26,8 +26,8 @@
#include "level/robotmain.h"
#include "ui/controls/button.h"
-#include "ui/controls/interface.h"
#include "ui/controls/image.h"
+#include "ui/controls/interface.h"
#include "ui/controls/list.h"
#include "ui/controls/window.h"
diff --git a/src/ui/screen/screen_io_write.cpp b/src/ui/screen/screen_io_write.cpp
index f5dcaca..b372670 100644
--- a/src/ui/screen/screen_io_write.cpp
+++ b/src/ui/screen/screen_io_write.cpp
@@ -27,8 +27,8 @@
#include "ui/controls/button.h"
#include "ui/controls/edit.h"
-#include "ui/controls/interface.h"
#include "ui/controls/image.h"
+#include "ui/controls/interface.h"
#include "ui/controls/label.h"
#include "ui/controls/list.h"
#include "ui/controls/window.h"
diff --git a/src/ui/screen/screen_player_select.cpp b/src/ui/screen/screen_player_select.cpp
index 680af0c..33aeaaf 100644
--- a/src/ui/screen/screen_player_select.cpp
+++ b/src/ui/screen/screen_player_select.cpp
@@ -21,13 +21,12 @@
#include "app/app.h"
-#include "level/robotmain.h"
-
#include "common/logger.h"
#include "common/misc.h"
#include "common/stringutils.h"
#include "level/player_profile.h"
+#include "level/robotmain.h"
#include "sound/sound.h"
@@ -194,9 +193,13 @@ bool CScreenPlayerSelect::EventProcess(const Event &event)
GetResource(RES_TEXT, RT_DIALOG_DELGAME, name);
gamer = pl->GetItemName(pl->GetSelect());
- m_dialog->StartQuestion(StrUtils::Format(name.c_str(), gamer), true, false, false, [&]() {
- NameDelete();
- });
+ m_dialog->StartQuestion(
+ StrUtils::Format(name.c_str(), gamer), true, false, false,
+ [&]()
+ {
+ NameDelete();
+ }
+ );
break;
default:
diff --git a/src/ui/studio.cpp b/src/ui/studio.cpp
index b5da62f..033e57e 100644
--- a/src/ui/studio.cpp
+++ b/src/ui/studio.cpp
@@ -32,12 +32,12 @@
#include "common/resources/resourcemanager.h"
-#include "level/robotmain.h"
-#include "level/player_profile.h"
-
#include "graphics/engine/camera.h"
#include "graphics/engine/engine.h"
+#include "level/player_profile.h"
+#include "level/robotmain.h"
+
#include "object/object.h"
#include "object/interface/program_storage_object.h"
diff --git a/test/unit/app/app_test.cpp b/test/unit/app/app_test.cpp
index 3aec8ef..6075e7c 100644
--- a/test/unit/app/app_test.cpp
+++ b/test/unit/app/app_test.cpp
@@ -61,16 +61,16 @@ public:
}
};
-class ApplicationUT : public testing::Test
+class CApplicationUT : public testing::Test
{
protected:
- ApplicationUT() :
+ CApplicationUT() :
m_systemUtils(nullptr),
m_stampUid(0),
m_currentTime(0)
{}
- ~ApplicationUT() NOEXCEPT
+ ~CApplicationUT() NOEXCEPT
{}
void SetUp() override;
@@ -99,7 +99,7 @@ private:
long long m_currentTime;
};
-void ApplicationUT::SetUp()
+void CApplicationUT::SetUp()
{
m_systemUtils = m_mocks.Mock<CSystemUtils>();
@@ -107,21 +107,21 @@ void ApplicationUT::SetUp()
m_mocks.OnCall(m_systemUtils, CSystemUtils::GetLangPath).Return("");
m_mocks.OnCall(m_systemUtils, CSystemUtils::GetSaveDir).Return("");
- m_mocks.OnCall(m_systemUtils, CSystemUtils::CreateTimeStamp).Do(std::bind(&ApplicationUT::CreateTimeStamp, this));
- m_mocks.OnCall(m_systemUtils, CSystemUtils::DestroyTimeStamp).Do(std::bind(&ApplicationUT::DestroyTimeStamp, this, ph::_1));
- m_mocks.OnCall(m_systemUtils, CSystemUtils::CopyTimeStamp).Do(std::bind(&ApplicationUT::CopyTimeStamp, this, ph::_1, ph::_2));
- m_mocks.OnCall(m_systemUtils, CSystemUtils::GetCurrentTimeStamp).Do(std::bind(&ApplicationUT::GetCurrentTimeStamp, this, ph::_1));
- m_mocks.OnCall(m_systemUtils, CSystemUtils::TimeStampExactDiff).Do(std::bind(&ApplicationUT::TimeStampExactDiff, this, ph::_1, ph::_2));
+ m_mocks.OnCall(m_systemUtils, CSystemUtils::CreateTimeStamp).Do(std::bind(&CApplicationUT::CreateTimeStamp, this));
+ m_mocks.OnCall(m_systemUtils, CSystemUtils::DestroyTimeStamp).Do(std::bind(&CApplicationUT::DestroyTimeStamp, this, ph::_1));
+ m_mocks.OnCall(m_systemUtils, CSystemUtils::CopyTimeStamp).Do(std::bind(&CApplicationUT::CopyTimeStamp, this, ph::_1, ph::_2));
+ m_mocks.OnCall(m_systemUtils, CSystemUtils::GetCurrentTimeStamp).Do(std::bind(&CApplicationUT::GetCurrentTimeStamp, this, ph::_1));
+ m_mocks.OnCall(m_systemUtils, CSystemUtils::TimeStampExactDiff).Do(std::bind(&CApplicationUT::TimeStampExactDiff, this, ph::_1, ph::_2));
m_app = MakeUnique<CApplicationWrapper>(m_systemUtils);
}
-void ApplicationUT::TearDown()
+void CApplicationUT::TearDown()
{
m_app.reset();
}
-SystemTimeStamp* ApplicationUT::CreateTimeStamp()
+SystemTimeStamp* CApplicationUT::CreateTimeStamp()
{
auto stamp = MakeUnique<FakeSystemTimeStamp>(++m_stampUid);
auto stampPtr = stamp.get();
@@ -129,33 +129,33 @@ SystemTimeStamp* ApplicationUT::CreateTimeStamp()
return stampPtr;
}
-void ApplicationUT::DestroyTimeStamp(SystemTimeStamp *stamp)
+void CApplicationUT::DestroyTimeStamp(SystemTimeStamp *stamp)
{
}
-void ApplicationUT::CopyTimeStamp(SystemTimeStamp *dst, SystemTimeStamp *src)
+void CApplicationUT::CopyTimeStamp(SystemTimeStamp *dst, SystemTimeStamp *src)
{
*static_cast<FakeSystemTimeStamp*>(dst) = *static_cast<FakeSystemTimeStamp*>(src);
}
-void ApplicationUT::GetCurrentTimeStamp(SystemTimeStamp *stamp)
+void CApplicationUT::GetCurrentTimeStamp(SystemTimeStamp *stamp)
{
static_cast<FakeSystemTimeStamp*>(stamp)->time = m_currentTime;
}
-long long ApplicationUT::TimeStampExactDiff(SystemTimeStamp *before, SystemTimeStamp *after)
+long long CApplicationUT::TimeStampExactDiff(SystemTimeStamp *before, SystemTimeStamp *after)
{
return static_cast<FakeSystemTimeStamp*>(after)->time - static_cast<FakeSystemTimeStamp*>(before)->time;
}
-void ApplicationUT::NextInstant(long long diff)
+void CApplicationUT::NextInstant(long long diff)
{
m_currentTime += diff;
}
-void ApplicationUT::TestCreateUpdateEvent(long long relTimeExact, long long absTimeExact,
- float relTime, float absTime,
- long long relTimeReal, long long absTimeReal)
+void CApplicationUT::TestCreateUpdateEvent(long long relTimeExact, long long absTimeExact,
+ float relTime, float absTime,
+ long long relTimeReal, long long absTimeReal)
{
Event event = m_app->CreateUpdateEvent();
EXPECT_EQ(EVENT_FRAME, event.type);
@@ -169,14 +169,14 @@ void ApplicationUT::TestCreateUpdateEvent(long long relTimeExact, long long absT
}
-TEST_F(ApplicationUT, UpdateEventTimeCalculation_SimulationSuspended)
+TEST_F(CApplicationUT, UpdateEventTimeCalculation_SimulationSuspended)
{
m_app->SuspendSimulation();
Event event = m_app->CreateUpdateEvent();
EXPECT_EQ(EVENT_NULL, event.type);
}
-TEST_F(ApplicationUT, UpdateEventTimeCalculation_NormalOperation)
+TEST_F(CApplicationUT, UpdateEventTimeCalculation_NormalOperation)
{
// 1st update
@@ -205,7 +205,7 @@ TEST_F(ApplicationUT, UpdateEventTimeCalculation_NormalOperation)
TestCreateUpdateEvent(relTimeExact, absTimeExact, relTime, absTime, relTimeReal, absTimeReal);
}
-TEST_F(ApplicationUT, UpdateEventTimeCalculation_NegativeTimeOperation)
+TEST_F(CApplicationUT, UpdateEventTimeCalculation_NegativeTimeOperation)
{
// 1st update
@@ -228,7 +228,7 @@ TEST_F(ApplicationUT, UpdateEventTimeCalculation_NegativeTimeOperation)
EXPECT_EQ(EVENT_NULL, event.type);
}
-TEST_F(ApplicationUT, UpdateEventTimeCalculation_ChangingSimulationSpeed)
+TEST_F(CApplicationUT, UpdateEventTimeCalculation_ChangingSimulationSpeed)
{
m_app->SetSimulationSpeed(2.0f);
@@ -287,7 +287,7 @@ TEST_F(ApplicationUT, UpdateEventTimeCalculation_ChangingSimulationSpeed)
TestCreateUpdateEvent(relTimeExact, absTimeExact, relTime, absTime, relTimeReal, absTimeReal);
}
-TEST_F(ApplicationUT, UpdateEventTimeCalculation_SuspendingAndResumingSimulation)
+TEST_F(CApplicationUT, UpdateEventTimeCalculation_SuspendingAndResumingSimulation)
{
// 1st update -- simulation enabled
diff --git a/test/unit/app/system_linux_test.cpp b/test/unit/app/system_linux_test.cpp
index 1bd6db1..02a85a3 100644
--- a/test/unit/app/system_linux_test.cpp
+++ b/test/unit/app/system_linux_test.cpp
@@ -22,7 +22,7 @@
#include <gtest/gtest.h>
-class SystemUtilsLinuxUT : public testing::Test
+class CSystemUtilsLinuxUT : public testing::Test
{
protected:
static const long long SEC = 1000000000;
@@ -31,7 +31,7 @@ protected:
};
-TEST_F(SystemUtilsLinuxUT, TimeStampDiff)
+TEST_F(CSystemUtilsLinuxUT, TimeStampDiff)
{
SystemTimeStamp before, after;
diff --git a/test/unit/app/system_windows_test.cpp b/test/unit/app/system_windows_test.cpp
index a517f47..6398db0 100644
--- a/test/unit/app/system_windows_test.cpp
+++ b/test/unit/app/system_windows_test.cpp
@@ -31,7 +31,7 @@ public:
}
};
-class SystemUtilsWindowsUT : public testing::Test
+class CSystemUtilsWindowsUT : public testing::Test
{
protected:
static const long long SEC = 1000000000;
@@ -39,7 +39,7 @@ protected:
CSystemUtilsWindowsWrapper m_systemUtils;
};
-TEST_F(SystemUtilsWindowsUT, TimeStampDiff)
+TEST_F(CSystemUtilsWindowsUT, TimeStampDiff)
{
m_systemUtils.SetFrequency(SEC);
diff --git a/test/unit/common/config_file_test.cpp b/test/unit/common/config_file_test.cpp
index 9af7d8f..6af0ffe 100644
--- a/test/unit/common/config_file_test.cpp
+++ b/test/unit/common/config_file_test.cpp
@@ -17,9 +17,10 @@
* along with this program. If not, see http://gnu.org/licenses
*/
+#include "app/system.h"
+
#include "common/config_file.h"
#include "common/logger.h"
-#include "app/system.h"
#include <iostream>
#include <string>
diff --git a/test/unit/graphics/engine/lightman_test.cpp b/test/unit/graphics/engine/lightman_test.cpp
index 06ba4ec..dcddc0a 100644
--- a/test/unit/graphics/engine/lightman_test.cpp
+++ b/test/unit/graphics/engine/lightman_test.cpp
@@ -17,12 +17,12 @@
* along with this program. If not, see http://gnu.org/licenses
*/
-#include "graphics/engine/lightman.h"
-
#include "common/make_unique.h"
#include "graphics/core/device.h"
+#include "graphics/engine/lightman.h"
+
#include <gtest/gtest.h>
#include <hippomocks.h>
@@ -33,15 +33,15 @@ using namespace Gfx;
using namespace HippoMocks;
namespace ph = std::placeholders;
-class LightManagerUT : public testing::Test
+class CLightManagerUT : public testing::Test
{
protected:
- LightManagerUT() :
+ CLightManagerUT() :
m_engine(nullptr),
m_device(nullptr),
m_maxLightsCount(0)
{}
- ~LightManagerUT() NOEXCEPT
+ ~CLightManagerUT() NOEXCEPT
{}
void SetUp() override;
@@ -64,7 +64,7 @@ private:
int m_maxLightsCount;
};
-void LightManagerUT::SetUp()
+void CLightManagerUT::SetUp()
{
m_engine = m_mocks.Mock<CEngine>();
m_device = m_mocks.Mock<CDevice>();
@@ -72,7 +72,7 @@ void LightManagerUT::SetUp()
m_lightManager = MakeUnique<CLightManager>(m_engine);
}
-void LightManagerUT::PrepareLightTesting(int maxLights, Math::Vector eyePos)
+void CLightManagerUT::PrepareLightTesting(int maxLights, Math::Vector eyePos)
{
m_maxLightsCount = maxLights;
@@ -80,12 +80,12 @@ void LightManagerUT::PrepareLightTesting(int maxLights, Math::Vector eyePos)
m_lightManager->SetDevice(m_device);
- m_mocks.OnCall(m_device, CDevice::SetLight).Do(std::bind(&LightManagerUT::CheckLight, this, ph::_1, ph::_2));
+ m_mocks.OnCall(m_device, CDevice::SetLight).Do(std::bind(&CLightManagerUT::CheckLight, this, ph::_1, ph::_2));
m_mocks.OnCall(m_engine, CEngine::GetEyePt).Return(eyePos);
}
-void LightManagerUT::CheckLightSorting(EngineObjectType objectType, const std::vector<int>& expectedLights)
+void CLightManagerUT::CheckLightSorting(EngineObjectType objectType, const std::vector<int>& expectedLights)
{
m_expectedLightTypes = expectedLights;
@@ -105,14 +105,14 @@ void LightManagerUT::CheckLightSorting(EngineObjectType objectType, const std::v
m_lightManager->UpdateDeviceLights(objectType);
}
-void LightManagerUT::CheckLight(int index, const Light& light)
+void CLightManagerUT::CheckLight(int index, const Light& light)
{
ASSERT_TRUE(index >= 0 && index < static_cast<int>( m_expectedLightTypes.size() ));
ASSERT_EQ(m_expectedLightTypes[index], light.type);
}
-void LightManagerUT::AddLight(int type, LightPriority priority, bool used, bool enabled,
- Math::Vector pos, EngineObjectType includeType, EngineObjectType excludeType)
+void CLightManagerUT::AddLight(int type, LightPriority priority, bool used, bool enabled,
+ Math::Vector pos, EngineObjectType includeType, EngineObjectType excludeType)
{
int rank = m_lightManager->CreateLight(priority);
@@ -129,7 +129,7 @@ void LightManagerUT::AddLight(int type, LightPriority priority, bool used, bool
m_lightManager->DeleteLight(rank);
}
-TEST_F(LightManagerUT, LightSorting_UnusedOrDisabledAreSkipped)
+TEST_F(CLightManagerUT, LightSorting_UnusedOrDisabledAreSkipped)
{
const int lightCount = 10;
const Math::Vector eyePos(0.0f, 0.0f, 0.0f);
@@ -143,7 +143,7 @@ TEST_F(LightManagerUT, LightSorting_UnusedOrDisabledAreSkipped)
CheckLightSorting(ENG_OBJTYPE_TERRAIN, expectedLights);
}
-TEST_F(LightManagerUT, LightSorting_IncludeTypesAreIncluded)
+TEST_F(CLightManagerUT, LightSorting_IncludeTypesAreIncluded)
{
const int lightCount = 10;
const Math::Vector eyePos(0.0f, 0.0f, 0.0f);
@@ -157,7 +157,7 @@ TEST_F(LightManagerUT, LightSorting_IncludeTypesAreIncluded)
CheckLightSorting(ENG_OBJTYPE_TERRAIN, expectedLights);
}
-TEST_F(LightManagerUT, LightSorting_ExcludeTypesAreExcluded)
+TEST_F(CLightManagerUT, LightSorting_ExcludeTypesAreExcluded)
{
const int lightCount = 10;
const Math::Vector eyePos(0.0f, 0.0f, 0.0f);
@@ -171,7 +171,7 @@ TEST_F(LightManagerUT, LightSorting_ExcludeTypesAreExcluded)
CheckLightSorting(ENG_OBJTYPE_TERRAIN, expectedLights);
}
-TEST_F(LightManagerUT, LightSorting_SortingAccordingToDistance)
+TEST_F(CLightManagerUT, LightSorting_SortingAccordingToDistance)
{
const int lightCount = 3;
const Math::Vector eyePos(0.0f, 0.0f, 0.0f);
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-games/colobot.git
More information about the Pkg-games-commits
mailing list