From 7d8b56d9ab8f90a3692f1ad9648cdd98fa27989b Mon Sep 17 00:00:00 2001 From: Piotr Dziwinski Date: Sun, 2 Aug 2015 11:40:47 +0200 Subject: [PATCH] More style fixes --- src/app/app.cpp | 19 +++++++++++++------ src/app/app.h | 3 ++- src/app/controller.h | 3 ++- src/app/main.cpp | 3 ++- src/app/pausemanager.h | 3 ++- src/common/image.cpp | 7 ++++--- src/common/ioutils.h | 5 +++-- src/common/pathman.cpp | 3 ++- src/common/regex_utils.h | 3 ++- src/common/resources/outputstreambuffer.cpp | 3 ++- src/common/stringutils.h | 5 +++-- src/graphics/core/color.cpp | 3 ++- src/graphics/core/color.h | 3 ++- src/graphics/core/device.h | 3 ++- src/graphics/core/framebuffer.cpp | 3 ++- src/graphics/core/framebuffer.h | 3 ++- src/graphics/core/light.h | 3 ++- src/graphics/core/material.h | 3 ++- src/graphics/core/nulldevice.cpp | 3 ++- src/graphics/core/nulldevice.h | 3 ++- src/graphics/core/texture.h | 8 +++++--- src/graphics/core/vertex.h | 3 ++- src/graphics/engine/camera.cpp | 6 ++++-- src/graphics/engine/camera.h | 6 ++++-- src/graphics/engine/cloud.cpp | 3 ++- src/graphics/engine/cloud.h | 3 ++- src/graphics/engine/engine.cpp | 6 ++++-- src/graphics/engine/engine.h | 3 ++- src/graphics/engine/lightman.cpp | 3 ++- src/graphics/engine/lightman.h | 5 +++-- src/graphics/engine/lightning.cpp | 3 ++- src/graphics/engine/lightning.h | 3 ++- src/graphics/engine/oldmodelmanager.cpp | 3 ++- src/graphics/engine/oldmodelmanager.h | 3 ++- src/graphics/engine/particle.cpp | 3 ++- src/graphics/engine/particle.h | 3 ++- src/graphics/engine/planet.cpp | 3 ++- src/graphics/engine/planet.h | 3 ++- src/graphics/engine/pyro.cpp | 3 ++- src/graphics/engine/pyro.h | 3 ++- src/graphics/engine/pyro_manager.cpp | 3 ++- src/graphics/engine/pyro_manager.h | 3 ++- src/graphics/engine/pyro_type.h | 3 ++- src/graphics/engine/terrain.cpp | 3 ++- src/graphics/engine/terrain.h | 3 ++- src/graphics/engine/text.cpp | 3 ++- src/graphics/engine/text.h | 3 ++- src/graphics/engine/water.cpp | 3 ++- src/graphics/engine/water.h | 3 ++- src/graphics/model/model.cpp | 3 ++- src/graphics/model/model.h | 3 ++- src/graphics/model/model_crash_sphere.h | 3 ++- src/graphics/model/model_format.h | 3 ++- src/graphics/model/model_input.cpp | 3 ++- src/graphics/model/model_input.h | 3 ++- src/graphics/model/model_io_exception.h | 3 ++- src/graphics/model/model_io_structs.h | 3 ++- src/graphics/model/model_manager.cpp | 3 ++- src/graphics/model/model_manager.h | 3 ++- src/graphics/model/model_mesh.cpp | 3 ++- src/graphics/model/model_mesh.h | 3 ++- src/graphics/model/model_output.cpp | 3 ++- src/graphics/model/model_output.h | 3 ++- src/graphics/model/model_shadow_spot.h | 3 ++- src/graphics/model/model_triangle.h | 3 ++- src/graphics/opengl/gl21device.cpp | 10 ++++++---- src/graphics/opengl/gl21device.h | 3 ++- src/graphics/opengl/gl33device.cpp | 6 ++++-- src/graphics/opengl/gl33device.h | 9 ++++++--- src/graphics/opengl/gldevice.cpp | 10 ++++++---- src/graphics/opengl/gldevice.h | 3 ++- src/graphics/opengl/glframebuffer.cpp | 3 ++- src/graphics/opengl/glframebuffer.h | 3 ++- src/graphics/opengl/glutil.cpp | 3 ++- src/math/const.h | 3 ++- src/math/func.h | 3 ++- src/math/geometry.h | 3 ++- src/math/intpoint.h | 3 ++- src/math/matrix.h | 3 ++- src/math/point.h | 3 ++- src/math/sphere.h | 3 ++- src/math/vector.h | 3 ++- src/object/auto/auto.h | 6 ++++-- src/object/auto/autodestroyer.cpp | 3 ++- src/object/brain.h | 6 ++++-- src/object/mainmovie.h | 3 ++- src/object/motion/motion.h | 3 ++- src/object/object.h | 3 ++- src/object/object_factory.h | 3 ++- src/object/object_manager.h | 6 ++++-- src/object/old_object.cpp | 3 ++- src/object/robotmain.cpp | 6 ++++-- src/object/robotmain.h | 6 ++++-- src/object/subclass/exchange_post.h | 3 ++- src/object/subclass/static_object.h | 3 ++- src/object/task/task.h | 3 ++- src/object/task/taskflag.cpp | 4 +++- src/object/trace_color.cpp | 3 ++- src/object/trace_color.h | 3 ++- src/physics/physics.h | 3 ++- src/script/script.h | 6 ++++-- src/ui/button.cpp | 3 ++- src/ui/button.h | 3 ++- src/ui/check.cpp | 3 ++- src/ui/check.h | 6 ++++-- src/ui/color.cpp | 3 ++- src/ui/color.h | 6 ++++-- src/ui/compass.cpp | 3 ++- src/ui/compass.h | 6 ++++-- src/ui/control.cpp | 3 ++- src/ui/control.h | 3 ++- src/ui/displayinfo.cpp | 3 ++- src/ui/displayinfo.h | 6 ++++-- src/ui/displaytext.cpp | 3 ++- src/ui/displaytext.h | 6 ++++-- src/ui/edit.cpp | 3 ++- src/ui/edit.h | 3 ++- src/ui/editvalue.cpp | 3 ++- src/ui/editvalue.h | 6 ++++-- src/ui/enumslider.cpp | 6 ++++-- src/ui/enumslider.h | 3 ++- src/ui/gauge.cpp | 3 ++- src/ui/gauge.h | 3 ++- src/ui/group.cpp | 3 ++- src/ui/group.h | 8 +++++--- src/ui/image.cpp | 3 ++- src/ui/image.h | 8 +++++--- src/ui/interface.cpp | 3 ++- src/ui/interface.h | 3 ++- src/ui/key.cpp | 3 ++- src/ui/key.h | 3 ++- src/ui/label.cpp | 3 ++- src/ui/label.h | 3 ++- src/ui/list.cpp | 3 ++- src/ui/list.h | 3 ++- src/ui/maindialog.cpp | 7 +++++-- src/ui/maindialog.h | 6 ++++-- src/ui/mainmap.cpp | 3 ++- src/ui/mainmap.h | 3 ++- src/ui/mainshort.cpp | 3 ++- src/ui/mainshort.h | 3 ++- src/ui/map.cpp | 6 ++++-- src/ui/map.h | 3 ++- src/ui/scroll.cpp | 3 ++- src/ui/scroll.h | 3 ++- src/ui/shortcut.cpp | 3 ++- src/ui/shortcut.h | 3 ++- src/ui/slider.cpp | 3 ++- src/ui/slider.h | 3 ++- src/ui/studio.cpp | 3 ++- src/ui/studio.h | 8 +++++--- src/ui/target.cpp | 3 ++- src/ui/target.h | 3 ++- src/ui/window.cpp | 3 ++- src/ui/window.h | 3 ++- 155 files changed, 392 insertions(+), 201 deletions(-) diff --git a/src/app/app.cpp b/src/app/app.cpp index 7a83b072..8cd91c89 100644 --- a/src/app/app.cpp +++ b/src/app/app.cpp @@ -403,12 +403,16 @@ bool CApplication::Create() defaultValues = true; } - if (GetConfigFile().GetStringProperty("Language", "Lang", path)) { + if (GetConfigFile().GetStringProperty("Language", "Lang", path)) + { Language language; - if (ParseLanguage(path, language)) { + if (ParseLanguage(path, language)) + { m_language = language; GetLogger()->Info("Setting language '%s' from ini file\n", path.c_str()); - } else { + } + else + { GetLogger()->Error("Invalid language '%s' in ini file\n", path.c_str()); } } @@ -487,14 +491,17 @@ bool CApplication::Create() std::getline(resolution, ws, 'x'); std::getline(resolution, hs, 'x'); int w = 800, h = 600; - if (!ws.empty() && !hs.empty()) { + if (!ws.empty() && !hs.empty()) + { w = atoi(ws.c_str()); h = atoi(hs.c_str()); } // Why not just set m_deviceConfig.size to w,h? Because this way if the resolution is no longer supported (e.g. changimg monitor) defaults will be used instead - for(auto it = modes.begin(); it != modes.end(); ++it) { - if (it->x == w && it->y == h) { + for (auto it = modes.begin(); it != modes.end(); ++it) + { + if (it->x == w && it->y == h) + { m_deviceConfig.size = *it; break; } diff --git a/src/app/app.h b/src/app/app.h index 650513c3..00b38302 100644 --- a/src/app/app.h +++ b/src/app/app.h @@ -46,7 +46,8 @@ class CInput; class CObjectManager; class CPathManager; -namespace Gfx { +namespace Gfx +{ class CModelManager; } diff --git a/src/app/controller.h b/src/app/controller.h index 5bc42090..b70eb30c 100644 --- a/src/app/controller.h +++ b/src/app/controller.h @@ -32,7 +32,8 @@ class CApplication; class CRobotMain; struct Event; -namespace Ui { +namespace Ui +{ class CMainDialog; } diff --git a/src/app/main.cpp b/src/app/main.cpp index 49d61b20..84f59153 100644 --- a/src/app/main.cpp +++ b/src/app/main.cpp @@ -113,7 +113,8 @@ int SDL_MAIN_FUNC(int argc, char *argv[]) logger.Info("%s starting\n", COLOBOT_FULLNAME); int code = 0; - while(true) { + while (true) + { CSystemUtils* systemUtils = CSystemUtils::Create(); // platform-specific utils systemUtils->Init(); diff --git a/src/app/pausemanager.h b/src/app/pausemanager.h index 2bd6c0a9..2efdab4d 100644 --- a/src/app/pausemanager.h +++ b/src/app/pausemanager.h @@ -29,7 +29,8 @@ #include -enum PauseType { +enum PauseType +{ PAUSE_NONE = 0, PAUSE_USER, PAUSE_SATCOM, diff --git a/src/common/image.cpp b/src/common/image.cpp index 9a40462f..754dba20 100644 --- a/src/common/image.cpp +++ b/src/common/image.cpp @@ -435,14 +435,15 @@ bool CImage::SavePNG(const std::string& fileName) return true; } -void CImage::SetDataPixels(void *pixels){ - +void CImage::SetDataPixels(void *pixels) +{ Uint8* srcPixels = static_cast (pixels); Uint8* resultPixels = static_cast (m_data->surface->pixels); Uint32 pitch = m_data->surface->pitch; - for(int line = 0; line < m_data->surface->h; ++line) { + for (int line = 0; line < m_data->surface->h; ++line) + { Uint32 pos = line * pitch; memcpy(&resultPixels[pos], &srcPixels[pos], pitch); } diff --git a/src/common/ioutils.h b/src/common/ioutils.h index 4b5a27be..9e2be67c 100644 --- a/src/common/ioutils.h +++ b/src/common/ioutils.h @@ -29,7 +29,8 @@ #include -namespace IOUtils { +namespace IOUtils +{ //! Writes a binary number to output stream /** @@ -148,5 +149,5 @@ std::string ReadBinaryString(std::istream &istr) return str; } -}; // namespace IOUtils +} // namespace IOUtils diff --git a/src/common/pathman.cpp b/src/common/pathman.cpp index 07865502..c35933a8 100644 --- a/src/common/pathman.cpp +++ b/src/common/pathman.cpp @@ -148,7 +148,8 @@ void CPathManager::InitPaths() void CPathManager::LoadModsFromDir(const std::string &dir) { - try { + try + { #if PLATFORM_WINDOWS boost::filesystem::directory_iterator iterator(CSystemUtilsWindows::UTF8_Decode(dir)); #else diff --git a/src/common/regex_utils.h b/src/common/regex_utils.h index d70b4e55..58e7e7f1 100644 --- a/src/common/regex_utils.h +++ b/src/common/regex_utils.h @@ -23,7 +23,8 @@ #include -namespace RegexUtils { +namespace RegexUtils +{ class AssertRegexMatchError : public std::runtime_error { diff --git a/src/common/resources/outputstreambuffer.cpp b/src/common/resources/outputstreambuffer.cpp index b3e4a7ca..57701845 100644 --- a/src/common/resources/outputstreambuffer.cpp +++ b/src/common/resources/outputstreambuffer.cpp @@ -81,7 +81,8 @@ std::streambuf::int_type COutputStreamBuffer::overflow(std::streambuf::int_type pbump(-bytes_written); // write final char - if (ch != traits_type::eof()) { + if (ch != traits_type::eof()) + { bytes_written = PHYSFS_write(m_file, &ch, 1, 1); if (bytes_written <= 0) return traits_type::eof(); diff --git a/src/common/stringutils.h b/src/common/stringutils.h index 46c1d2a1..eed65275 100644 --- a/src/common/stringutils.h +++ b/src/common/stringutils.h @@ -28,7 +28,8 @@ #include #include -namespace StrUtils { +namespace StrUtils +{ //! Converts a value to string /** If given, \a ok is set to true/false on success/failure. @@ -83,5 +84,5 @@ int Utf8CharSizeAt(const std::string &str, unsigned int pos); //! Returns the length in characters of UTF-8 string \a str size_t Utf8StringLength(const std::string &str); -}; // namespace StrUtil +} // namespace StrUtil diff --git a/src/graphics/core/color.cpp b/src/graphics/core/color.cpp index d51eb1af..934994cb 100644 --- a/src/graphics/core/color.cpp +++ b/src/graphics/core/color.cpp @@ -24,7 +24,8 @@ // Graphics module namespace -namespace Gfx { +namespace Gfx +{ ColorHSV RGB2HSV(Color color) diff --git a/src/graphics/core/color.h b/src/graphics/core/color.h index d73b47ef..1fd8419c 100644 --- a/src/graphics/core/color.h +++ b/src/graphics/core/color.h @@ -29,7 +29,8 @@ // Graphics module namespace -namespace Gfx { +namespace Gfx +{ /** * \struct Color diff --git a/src/graphics/core/device.h b/src/graphics/core/device.h index ecd516fa..345abf68 100644 --- a/src/graphics/core/device.h +++ b/src/graphics/core/device.h @@ -43,7 +43,8 @@ struct ImageData; // Graphics module namespace -namespace Gfx { +namespace Gfx +{ /** * \struct DeviceConfig diff --git a/src/graphics/core/framebuffer.cpp b/src/graphics/core/framebuffer.cpp index f05f26ee..05e3c204 100644 --- a/src/graphics/core/framebuffer.cpp +++ b/src/graphics/core/framebuffer.cpp @@ -24,7 +24,8 @@ #include "graphics/core/framebuffer.h" -namespace Gfx { +namespace Gfx +{ CDefaultFramebuffer::CDefaultFramebuffer(const FramebufferParams& params) : m_width(params.width), m_height(params.height), m_depth(params.depth) diff --git a/src/graphics/core/framebuffer.h b/src/graphics/core/framebuffer.h index 3b61ce1b..c5197ef2 100644 --- a/src/graphics/core/framebuffer.h +++ b/src/graphics/core/framebuffer.h @@ -24,7 +24,8 @@ #pragma once -namespace Gfx { +namespace Gfx +{ /** * \struct FramebufferParams diff --git a/src/graphics/core/light.h b/src/graphics/core/light.h index e8eda7be..e2938af7 100644 --- a/src/graphics/core/light.h +++ b/src/graphics/core/light.h @@ -31,7 +31,8 @@ // Graphics module namespace -namespace Gfx { +namespace Gfx +{ /** * \enum LightType diff --git a/src/graphics/core/material.h b/src/graphics/core/material.h index 1fde860c..33867adb 100644 --- a/src/graphics/core/material.h +++ b/src/graphics/core/material.h @@ -29,7 +29,8 @@ // Graphics module namespace -namespace Gfx { +namespace Gfx +{ /** * \struct Material diff --git a/src/graphics/core/nulldevice.cpp b/src/graphics/core/nulldevice.cpp index b5e755a0..c0c3397c 100644 --- a/src/graphics/core/nulldevice.cpp +++ b/src/graphics/core/nulldevice.cpp @@ -27,7 +27,8 @@ // Graphics module namespace -namespace Gfx { +namespace Gfx +{ CNullDevice::CNullDevice() { diff --git a/src/graphics/core/nulldevice.h b/src/graphics/core/nulldevice.h index 0e152e4f..7282ecb7 100644 --- a/src/graphics/core/nulldevice.h +++ b/src/graphics/core/nulldevice.h @@ -28,7 +28,8 @@ #include "graphics/core/device.h" // Graphics module namespace -namespace Gfx { +namespace Gfx +{ /** * \class CNullDevice diff --git a/src/graphics/core/texture.h b/src/graphics/core/texture.h index 49d3610a..34f95741 100644 --- a/src/graphics/core/texture.h +++ b/src/graphics/core/texture.h @@ -31,7 +31,8 @@ // Graphics module namespace -namespace Gfx { +namespace Gfx +{ /** @@ -252,11 +253,12 @@ enum TexGenMode */ struct TextureGenerationParams { - struct + struct Coord { TexGenMode mode; float plane[4]; - } coords[4]; + }; + Coord coords[4]; TextureGenerationParams() { diff --git a/src/graphics/core/vertex.h b/src/graphics/core/vertex.h index 7af72129..0a53da4c 100644 --- a/src/graphics/core/vertex.h +++ b/src/graphics/core/vertex.h @@ -34,7 +34,8 @@ // Graphics module namespace -namespace Gfx { +namespace Gfx +{ /** diff --git a/src/graphics/engine/camera.cpp b/src/graphics/engine/camera.cpp index 94810578..5bec9715 100644 --- a/src/graphics/engine/camera.cpp +++ b/src/graphics/engine/camera.cpp @@ -41,7 +41,8 @@ // Graphics module namespace -namespace Gfx { +namespace Gfx +{ //! Changes the level of transparency of an object and objects transported (battery & cargo) @@ -170,7 +171,8 @@ void CCamera::SetBlood(bool enable) m_blood = enable; } -bool CCamera::GetBlood() { +bool CCamera::GetBlood() +{ return m_blood; } diff --git a/src/graphics/engine/camera.h b/src/graphics/engine/camera.h index 0ae1ca2a..6fe9111a 100644 --- a/src/graphics/engine/camera.h +++ b/src/graphics/engine/camera.h @@ -36,7 +36,8 @@ class CInput; // Graphics module namespace -namespace Gfx { +namespace Gfx +{ /** @@ -130,7 +131,8 @@ enum CameraOverEffect \brief Camera moving in 3D scene ... */ -class CCamera { +class CCamera +{ public: CCamera(); ~CCamera(); diff --git a/src/graphics/engine/cloud.cpp b/src/graphics/engine/cloud.cpp index 7ec0d9e2..53fe8bad 100644 --- a/src/graphics/engine/cloud.cpp +++ b/src/graphics/engine/cloud.cpp @@ -30,7 +30,8 @@ // Graphics module namespace -namespace Gfx { +namespace Gfx +{ const int CLOUD_LINE_PREALLOCATE_COUNT = 100; diff --git a/src/graphics/engine/cloud.h b/src/graphics/engine/cloud.h index decf1d66..8d504615 100644 --- a/src/graphics/engine/cloud.h +++ b/src/graphics/engine/cloud.h @@ -37,7 +37,8 @@ // Graphics module namespace -namespace Gfx { +namespace Gfx +{ class CEngine; class CTerrain; diff --git a/src/graphics/engine/engine.cpp b/src/graphics/engine/engine.cpp index a8e6182b..840d5854 100644 --- a/src/graphics/engine/engine.cpp +++ b/src/graphics/engine/engine.cpp @@ -55,7 +55,8 @@ template<> Gfx::CEngine* CSingleton::m_instance = nullptr; // Graphics module namespace -namespace Gfx { +namespace Gfx +{ CEngine::CEngine(CApplication *app) { @@ -4514,7 +4515,8 @@ void CEngine::DrawBackgroundImage() Math::Point scale; scale.x = static_cast(m_size.x) / static_cast(m_backgroundTex.originalSize.x); scale.y = static_cast(m_size.y) / static_cast(m_backgroundTex.originalSize.y); - if (scale.x > scale.y) { + if (scale.x > scale.y) + { scale.y /= scale.x; scale.x = 1; } diff --git a/src/graphics/engine/engine.h b/src/graphics/engine/engine.h index aee1b24e..7fd409e7 100644 --- a/src/graphics/engine/engine.h +++ b/src/graphics/engine/engine.h @@ -56,7 +56,8 @@ struct Event; // Graphics module namespace -namespace Gfx { +namespace Gfx +{ class CDevice; diff --git a/src/graphics/engine/lightman.cpp b/src/graphics/engine/lightman.cpp index bb67ad07..76ebf5df 100644 --- a/src/graphics/engine/lightman.cpp +++ b/src/graphics/engine/lightman.cpp @@ -32,7 +32,8 @@ // Graphics module namespace -namespace Gfx { +namespace Gfx +{ void LightProgression::Init(float value) diff --git a/src/graphics/engine/lightman.h b/src/graphics/engine/lightman.h index d8f32bb0..4c34e4a7 100644 --- a/src/graphics/engine/lightman.h +++ b/src/graphics/engine/lightman.h @@ -33,7 +33,8 @@ // Graphics module namespace -namespace Gfx { +namespace Gfx +{ /** * \struct LightProgression @@ -236,5 +237,5 @@ protected: std::vector m_lightMap; }; -}; // namespace Gfx +} // namespace Gfx diff --git a/src/graphics/engine/lightning.cpp b/src/graphics/engine/lightning.cpp index 67e936a9..60520685 100644 --- a/src/graphics/engine/lightning.cpp +++ b/src/graphics/engine/lightning.cpp @@ -39,7 +39,8 @@ // Graphics module namespace -namespace Gfx { +namespace Gfx +{ CLightning::CLightning(CEngine* engine) diff --git a/src/graphics/engine/lightning.h b/src/graphics/engine/lightning.h index 3426515b..a6dcfeab 100644 --- a/src/graphics/engine/lightning.h +++ b/src/graphics/engine/lightning.h @@ -35,7 +35,8 @@ class CSoundInterface; // Graphics module namespace -namespace Gfx { +namespace Gfx +{ class CEngine; class CTerrain; diff --git a/src/graphics/engine/oldmodelmanager.cpp b/src/graphics/engine/oldmodelmanager.cpp index d00132ba..443cef15 100644 --- a/src/graphics/engine/oldmodelmanager.cpp +++ b/src/graphics/engine/oldmodelmanager.cpp @@ -32,7 +32,8 @@ #include -namespace Gfx { +namespace Gfx +{ COldModelManager::COldModelManager(CEngine* engine) { diff --git a/src/graphics/engine/oldmodelmanager.h b/src/graphics/engine/oldmodelmanager.h index 05c732f9..7415f222 100644 --- a/src/graphics/engine/oldmodelmanager.h +++ b/src/graphics/engine/oldmodelmanager.h @@ -27,7 +27,8 @@ #include #include -namespace Gfx { +namespace Gfx +{ class CEngine; class CModelFile; diff --git a/src/graphics/engine/particle.cpp b/src/graphics/engine/particle.cpp index 8bb36883..813d7d6c 100644 --- a/src/graphics/engine/particle.cpp +++ b/src/graphics/engine/particle.cpp @@ -39,7 +39,8 @@ // Graphics module namespace -namespace Gfx { +namespace Gfx +{ const float FOG_HSUP = 10.0f; diff --git a/src/graphics/engine/particle.h b/src/graphics/engine/particle.h index 6509ac4e..f196ffe9 100644 --- a/src/graphics/engine/particle.h +++ b/src/graphics/engine/particle.h @@ -36,7 +36,8 @@ class CSoundInterface; // Graphics module namespace -namespace Gfx { +namespace Gfx +{ const short MAXPARTICULE = 500; const short MAXPARTITYPE = 5; diff --git a/src/graphics/engine/planet.cpp b/src/graphics/engine/planet.cpp index df34fbcd..f8c37930 100644 --- a/src/graphics/engine/planet.cpp +++ b/src/graphics/engine/planet.cpp @@ -25,7 +25,8 @@ // Graphics module namespace -namespace Gfx { +namespace Gfx +{ const int PLANET_PREALLOCATE_COUNT = 10; diff --git a/src/graphics/engine/planet.h b/src/graphics/engine/planet.h index 52ffd243..8a53cd68 100644 --- a/src/graphics/engine/planet.h +++ b/src/graphics/engine/planet.h @@ -34,7 +34,8 @@ // Graphics module namespace -namespace Gfx { +namespace Gfx +{ class CEngine; diff --git a/src/graphics/engine/pyro.cpp b/src/graphics/engine/pyro.cpp index eec9bc2e..4be6ab8d 100644 --- a/src/graphics/engine/pyro.cpp +++ b/src/graphics/engine/pyro.cpp @@ -37,7 +37,8 @@ // Graphics module namespace -namespace Gfx { +namespace Gfx +{ CPyro::CPyro() diff --git a/src/graphics/engine/pyro.h b/src/graphics/engine/pyro.h index 06f09e3d..8a1bd767 100644 --- a/src/graphics/engine/pyro.h +++ b/src/graphics/engine/pyro.h @@ -43,7 +43,8 @@ class CSoundInterface; // Graphics module namespace -namespace Gfx { +namespace Gfx +{ class CEngine; class CTerrain; diff --git a/src/graphics/engine/pyro_manager.cpp b/src/graphics/engine/pyro_manager.cpp index d2449d60..d35af22d 100644 --- a/src/graphics/engine/pyro_manager.cpp +++ b/src/graphics/engine/pyro_manager.cpp @@ -23,7 +23,8 @@ #include "graphics/engine/pyro.h" -namespace Gfx { +namespace Gfx +{ Gfx::CPyroManager::CPyroManager() diff --git a/src/graphics/engine/pyro_manager.h b/src/graphics/engine/pyro_manager.h index 0267e21c..2e1820fb 100644 --- a/src/graphics/engine/pyro_manager.h +++ b/src/graphics/engine/pyro_manager.h @@ -32,7 +32,8 @@ struct Event; class CObject; -namespace Gfx { +namespace Gfx +{ class CPyro; using CPyroUPtr = std::unique_ptr; diff --git a/src/graphics/engine/pyro_type.h b/src/graphics/engine/pyro_type.h index 942ca69e..119cb180 100644 --- a/src/graphics/engine/pyro_type.h +++ b/src/graphics/engine/pyro_type.h @@ -24,7 +24,8 @@ #pragma once -namespace Gfx { +namespace Gfx +{ /** * \enum PyroType diff --git a/src/graphics/engine/terrain.cpp b/src/graphics/engine/terrain.cpp index 15a1abf5..005e0894 100644 --- a/src/graphics/engine/terrain.cpp +++ b/src/graphics/engine/terrain.cpp @@ -36,7 +36,8 @@ // Graphics module namespace -namespace Gfx { +namespace Gfx +{ CTerrain::CTerrain() diff --git a/src/graphics/engine/terrain.h b/src/graphics/engine/terrain.h index a2bb36ae..0b7bc698 100644 --- a/src/graphics/engine/terrain.h +++ b/src/graphics/engine/terrain.h @@ -29,7 +29,8 @@ // Graphics module namespace -namespace Gfx { +namespace Gfx +{ class CEngine; class CWater; diff --git a/src/graphics/engine/text.cpp b/src/graphics/engine/text.cpp index 8e4f483d..13c3e2ad 100644 --- a/src/graphics/engine/text.cpp +++ b/src/graphics/engine/text.cpp @@ -34,7 +34,8 @@ // Graphics module namespace -namespace Gfx { +namespace Gfx +{ /** diff --git a/src/graphics/engine/text.h b/src/graphics/engine/text.h index 11f13c9a..f1f98d37 100644 --- a/src/graphics/engine/text.h +++ b/src/graphics/engine/text.h @@ -34,7 +34,8 @@ // Graphics module namespace -namespace Gfx { +namespace Gfx +{ class CEngine; class CDevice; diff --git a/src/graphics/engine/water.cpp b/src/graphics/engine/water.cpp index 8a396a89..0916fd58 100644 --- a/src/graphics/engine/water.cpp +++ b/src/graphics/engine/water.cpp @@ -37,7 +37,8 @@ // Graphics module namespace -namespace Gfx { +namespace Gfx +{ const int WATERLINE_PREALLOCATE_COUNT = 500; diff --git a/src/graphics/engine/water.h b/src/graphics/engine/water.h index 5e488d5f..dfdd51bc 100644 --- a/src/graphics/engine/water.h +++ b/src/graphics/engine/water.h @@ -34,7 +34,8 @@ class CSoundInterface; // Graphics module namespace -namespace Gfx { +namespace Gfx +{ class CEngine; diff --git a/src/graphics/model/model.cpp b/src/graphics/model/model.cpp index 3f97d31d..e4c5d6d0 100644 --- a/src/graphics/model/model.cpp +++ b/src/graphics/model/model.cpp @@ -22,7 +22,8 @@ #include "common/logger.h" -namespace Gfx { +namespace Gfx +{ int CModel::GetMeshCount() const { diff --git a/src/graphics/model/model.h b/src/graphics/model/model.h index 794b0322..d86ea49a 100644 --- a/src/graphics/model/model.h +++ b/src/graphics/model/model.h @@ -30,7 +30,8 @@ #include #include -namespace Gfx { +namespace Gfx +{ /** * \class CModel diff --git a/src/graphics/model/model_crash_sphere.h b/src/graphics/model/model_crash_sphere.h index c8d45b42..c0bf3223 100644 --- a/src/graphics/model/model_crash_sphere.h +++ b/src/graphics/model/model_crash_sphere.h @@ -21,7 +21,8 @@ #include "math/vector.h" -namespace Gfx { +namespace Gfx +{ /** * \struct ModelCrashSphere diff --git a/src/graphics/model/model_format.h b/src/graphics/model/model_format.h index 25651895..fbc95305 100644 --- a/src/graphics/model/model_format.h +++ b/src/graphics/model/model_format.h @@ -19,7 +19,8 @@ #pragma once -namespace Gfx { +namespace Gfx +{ /** * \enum ModelFormat diff --git a/src/graphics/model/model_input.cpp b/src/graphics/model/model_input.cpp index f2ea9258..8216d0ed 100644 --- a/src/graphics/model/model_input.cpp +++ b/src/graphics/model/model_input.cpp @@ -32,7 +32,8 @@ #include #include -namespace Gfx { +namespace Gfx +{ // Private functions namespace ModelInput diff --git a/src/graphics/model/model_input.h b/src/graphics/model/model_input.h index e8cfb27d..34872502 100644 --- a/src/graphics/model/model_input.h +++ b/src/graphics/model/model_input.h @@ -24,7 +24,8 @@ #include -namespace Gfx { +namespace Gfx +{ /** * \namespace ModelInput diff --git a/src/graphics/model/model_io_exception.h b/src/graphics/model/model_io_exception.h index 4c5f8d3e..7eeb69c7 100644 --- a/src/graphics/model/model_io_exception.h +++ b/src/graphics/model/model_io_exception.h @@ -21,7 +21,8 @@ #include -namespace Gfx { +namespace Gfx +{ class CModelIOException : public std::runtime_error { diff --git a/src/graphics/model/model_io_structs.h b/src/graphics/model/model_io_structs.h index c4660d60..becff62c 100644 --- a/src/graphics/model/model_io_structs.h +++ b/src/graphics/model/model_io_structs.h @@ -24,7 +24,8 @@ #include -namespace Gfx { +namespace Gfx +{ /******************************************************* Deprecated enums/magic values diff --git a/src/graphics/model/model_manager.cpp b/src/graphics/model/model_manager.cpp index 66912c5b..8575c18c 100644 --- a/src/graphics/model/model_manager.cpp +++ b/src/graphics/model/model_manager.cpp @@ -25,7 +25,8 @@ #include "graphics/model/model_input.h" #include "graphics/model/model_io_exception.h" -namespace Gfx { +namespace Gfx +{ CModel& CModelManager::GetModel(const std::string& modelName) { diff --git a/src/graphics/model/model_manager.h b/src/graphics/model/model_manager.h index 30db355d..8c611269 100644 --- a/src/graphics/model/model_manager.h +++ b/src/graphics/model/model_manager.h @@ -24,7 +24,8 @@ #include #include -namespace Gfx { +namespace Gfx +{ /** * \class CModelManager diff --git a/src/graphics/model/model_mesh.cpp b/src/graphics/model/model_mesh.cpp index 531c2191..b0b39d1a 100644 --- a/src/graphics/model/model_mesh.cpp +++ b/src/graphics/model/model_mesh.cpp @@ -19,7 +19,8 @@ #include "graphics/model/model_mesh.h" -namespace Gfx { +namespace Gfx +{ void CModelMesh::AddTriangle(const ModelTriangle& triangle) { diff --git a/src/graphics/model/model_mesh.h b/src/graphics/model/model_mesh.h index 5d763a38..82ee42df 100644 --- a/src/graphics/model/model_mesh.h +++ b/src/graphics/model/model_mesh.h @@ -25,7 +25,8 @@ #include -namespace Gfx { +namespace Gfx +{ struct ModelTriangle; diff --git a/src/graphics/model/model_output.cpp b/src/graphics/model/model_output.cpp index 37764f08..d1218e4b 100644 --- a/src/graphics/model/model_output.cpp +++ b/src/graphics/model/model_output.cpp @@ -28,7 +28,8 @@ #include -namespace Gfx { +namespace Gfx +{ // Private functions namespace ModelOutput diff --git a/src/graphics/model/model_output.h b/src/graphics/model/model_output.h index 88be7014..0770bf84 100644 --- a/src/graphics/model/model_output.h +++ b/src/graphics/model/model_output.h @@ -24,7 +24,8 @@ #include #include -namespace Gfx { +namespace Gfx +{ class CModel; diff --git a/src/graphics/model/model_shadow_spot.h b/src/graphics/model/model_shadow_spot.h index a15d67f7..bcf546f1 100644 --- a/src/graphics/model/model_shadow_spot.h +++ b/src/graphics/model/model_shadow_spot.h @@ -19,7 +19,8 @@ #pragma once -namespace Gfx { +namespace Gfx +{ /** * \struct ModelShadowSpot diff --git a/src/graphics/model/model_triangle.h b/src/graphics/model/model_triangle.h index 773a7b93..bd5a897d 100644 --- a/src/graphics/model/model_triangle.h +++ b/src/graphics/model/model_triangle.h @@ -22,7 +22,8 @@ #include "graphics/core/color.h" #include "graphics/core/vertex.h" -namespace Gfx { +namespace Gfx +{ /** * \enum ModelSpecialMark diff --git a/src/graphics/opengl/gl21device.cpp b/src/graphics/opengl/gl21device.cpp index fde1585d..69865643 100644 --- a/src/graphics/opengl/gl21device.cpp +++ b/src/graphics/opengl/gl21device.cpp @@ -37,7 +37,8 @@ // Graphics module namespace -namespace Gfx { +namespace Gfx +{ CGL21Device::CGL21Device(const DeviceConfig &config) { @@ -710,7 +711,8 @@ Texture CGL21Device::CreateTexture(ImageData *data, const TextureCreateParams &p convert = true; } } - else { + else + { GetLogger()->Error("Unknown data surface format"); assert(false); } @@ -1710,8 +1712,8 @@ void CGL21Device::CopyFramebufferToTexture(Texture& texture, int xOffset, int yO glBindTexture(GL_TEXTURE_2D, m_currentTextures[0].id); } -void* CGL21Device::GetFrameBufferPixels()const{ - +void* CGL21Device::GetFrameBufferPixels()const +{ GLubyte* pixels = new GLubyte[4 * m_config.size.x * m_config.size.y]; glReadPixels(0, 0, m_config.size.x, m_config.size.y, GL_RGBA, GL_UNSIGNED_BYTE, pixels); diff --git a/src/graphics/opengl/gl21device.h b/src/graphics/opengl/gl21device.h index 2e71e27a..59f90093 100644 --- a/src/graphics/opengl/gl21device.h +++ b/src/graphics/opengl/gl21device.h @@ -34,7 +34,8 @@ // Graphics module namespace -namespace Gfx { +namespace Gfx +{ struct GLDevicePrivate; diff --git a/src/graphics/opengl/gl33device.cpp b/src/graphics/opengl/gl33device.cpp index c42a4f28..b2ce11f9 100644 --- a/src/graphics/opengl/gl33device.cpp +++ b/src/graphics/opengl/gl33device.cpp @@ -36,7 +36,8 @@ // Graphics module namespace -namespace Gfx { +namespace Gfx +{ CGL33Device::CGL33Device(const DeviceConfig &config) { @@ -736,7 +737,8 @@ Texture CGL33Device::CreateTexture(ImageData *data, const TextureCreateParams &p convert = true; } } - else { + else + { GetLogger()->Error("Unknown data surface format"); assert(false); } diff --git a/src/graphics/opengl/gl33device.h b/src/graphics/opengl/gl33device.h index a88332b9..f19a0da5 100644 --- a/src/graphics/opengl/gl33device.h +++ b/src/graphics/opengl/gl33device.h @@ -35,7 +35,8 @@ // Graphics module namespace -namespace Gfx { +namespace Gfx +{ /** \class CGL33Device @@ -304,7 +305,7 @@ private: //! Specular color GLint uni_SpecularColor; - struct + struct LightUniforms { //! true enables light GLint Enabled; @@ -320,7 +321,9 @@ private: GLint Specular; //! Attenuation GLint Attenuation; - } uni_Light[8]; + }; + + LightUniforms uni_Light[8]; }; } // namespace Gfx diff --git a/src/graphics/opengl/gldevice.cpp b/src/graphics/opengl/gldevice.cpp index 0dd42b59..ff6555a4 100644 --- a/src/graphics/opengl/gldevice.cpp +++ b/src/graphics/opengl/gldevice.cpp @@ -35,7 +35,8 @@ // Graphics module namespace -namespace Gfx { +namespace Gfx +{ CGLDevice::CGLDevice(const DeviceConfig &config) { @@ -683,7 +684,8 @@ Texture CGLDevice::CreateTexture(ImageData *data, const TextureCreateParams &par convert = true; } } - else { + else + { GetLogger()->Error("Unknown data surface format"); assert(false); } @@ -1842,8 +1844,8 @@ void CGLDevice::CopyFramebufferToTexture(Texture& texture, int xOffset, int yOff glBindTexture(GL_TEXTURE_2D, m_currentTextures[0].id); } -void* CGLDevice::GetFrameBufferPixels()const{ - +void* CGLDevice::GetFrameBufferPixels()const +{ GLubyte* pixels = new GLubyte[4 * m_config.size.x * m_config.size.y]; glReadPixels(0, 0, m_config.size.x, m_config.size.y, GL_RGBA, GL_UNSIGNED_BYTE, pixels); diff --git a/src/graphics/opengl/gldevice.h b/src/graphics/opengl/gldevice.h index 423d17ae..7a87a206 100644 --- a/src/graphics/opengl/gldevice.h +++ b/src/graphics/opengl/gldevice.h @@ -35,7 +35,8 @@ // Graphics module namespace -namespace Gfx { +namespace Gfx +{ /** \enum VertexBufferType diff --git a/src/graphics/opengl/glframebuffer.cpp b/src/graphics/opengl/glframebuffer.cpp index 5f087250..edb83e0b 100644 --- a/src/graphics/opengl/glframebuffer.cpp +++ b/src/graphics/opengl/glframebuffer.cpp @@ -21,7 +21,8 @@ #include "common/logger.h" -namespace Gfx { +namespace Gfx +{ // CGLFramebuffer diff --git a/src/graphics/opengl/glframebuffer.h b/src/graphics/opengl/glframebuffer.h index ed366a2e..e9fbc980 100644 --- a/src/graphics/opengl/glframebuffer.h +++ b/src/graphics/opengl/glframebuffer.h @@ -22,7 +22,8 @@ #include "graphics/core/framebuffer.h" #include "graphics/opengl/glutil.h" -namespace Gfx { +namespace Gfx +{ /** * \class CGLFramebuffer diff --git a/src/graphics/opengl/glutil.cpp b/src/graphics/opengl/glutil.cpp index cabaa5fe..c2b6a8d7 100644 --- a/src/graphics/opengl/glutil.cpp +++ b/src/graphics/opengl/glutil.cpp @@ -30,7 +30,8 @@ #include // Graphics module namespace -namespace Gfx { +namespace Gfx +{ GLuint textureCoordinates[] = { GL_S, GL_T, GL_R, GL_Q }; GLuint textureCoordGen[] = { GL_TEXTURE_GEN_S, GL_TEXTURE_GEN_T, GL_TEXTURE_GEN_R, GL_TEXTURE_GEN_Q }; diff --git a/src/math/const.h b/src/math/const.h index 1e2cddfe..7602b262 100644 --- a/src/math/const.h +++ b/src/math/const.h @@ -29,7 +29,8 @@ // Math module namespace -namespace Math { +namespace Math +{ //! Tolerance level -- minimum accepted float value diff --git a/src/math/func.h b/src/math/func.h index 78bfeb42..087d8bc2 100644 --- a/src/math/func.h +++ b/src/math/func.h @@ -33,7 +33,8 @@ // Math module namespace -namespace Math { +namespace Math +{ //! Compares \a a and \a b within \a tolerance diff --git a/src/math/geometry.h b/src/math/geometry.h index dec18eba..e02695f3 100644 --- a/src/math/geometry.h +++ b/src/math/geometry.h @@ -37,7 +37,8 @@ // Math module namespace -namespace Math { +namespace Math +{ //! Returns py up on the line \a a - \a b diff --git a/src/math/intpoint.h b/src/math/intpoint.h index 7d27b337..800d7428 100644 --- a/src/math/intpoint.h +++ b/src/math/intpoint.h @@ -27,7 +27,8 @@ #include // Math module namespace -namespace Math { +namespace Math +{ /** * \struct IntPoint diff --git a/src/math/matrix.h b/src/math/matrix.h index 75e515c0..fa1f54da 100644 --- a/src/math/matrix.h +++ b/src/math/matrix.h @@ -35,7 +35,8 @@ // Math module namespace -namespace Math { +namespace Math +{ /** * \struct Matrix math/matrix.h diff --git a/src/math/point.h b/src/math/point.h index e8ae4d62..97ff6fbf 100644 --- a/src/math/point.h +++ b/src/math/point.h @@ -34,7 +34,8 @@ // Math module namespace -namespace Math { +namespace Math +{ /** diff --git a/src/math/sphere.h b/src/math/sphere.h index ef6b837b..cbc9f230 100644 --- a/src/math/sphere.h +++ b/src/math/sphere.h @@ -2,7 +2,8 @@ #include "math/vector.h" -namespace Math { +namespace Math +{ struct Sphere { diff --git a/src/math/vector.h b/src/math/vector.h index 31a61625..f45fd52a 100644 --- a/src/math/vector.h +++ b/src/math/vector.h @@ -34,7 +34,8 @@ // Math module namespace -namespace Math { +namespace Math +{ /** diff --git a/src/object/auto/auto.h b/src/object/auto/auto.h index 9b05eaaf..616ea1a4 100644 --- a/src/object/auto/auto.h +++ b/src/object/auto/auto.h @@ -33,12 +33,14 @@ class CSoundInterface; class CLevelParserLine; class COldObject; -namespace Ui { +namespace Ui +{ class CInterface; class CWindow; } /* Ui */ -namespace Gfx { +namespace Gfx +{ class CEngine; class CParticle; diff --git a/src/object/auto/autodestroyer.cpp b/src/object/auto/autodestroyer.cpp index ed299072..96d81aa4 100644 --- a/src/object/auto/autodestroyer.cpp +++ b/src/object/auto/autodestroyer.cpp @@ -159,7 +159,8 @@ bool CAutoDestroyer::EventProcess(const Event &event) if ( pw != 0 ) EnableInterface(pw, EVENT_OBJECT_BDESTROY, (scrap != 0)); } } - } else if ( pw != 0 ) EnableInterface(pw, EVENT_OBJECT_BDESTROY, false); + } + else if ( pw != 0 ) EnableInterface(pw, EVENT_OBJECT_BDESTROY, false); if ( m_phase == ADEP_DOWN ) { diff --git a/src/object/brain.h b/src/object/brain.h index 50e6d2e8..50760693 100644 --- a/src/object/brain.h +++ b/src/object/brain.h @@ -46,13 +46,15 @@ class CRobotMain; class CSoundInterface; class CLevelParserLine; -namespace Ui { +namespace Ui +{ class CStudio; class CInterface; class CWindow; } -namespace Gfx { +namespace Gfx +{ class CEngine; class CTerrain; class CWater; diff --git a/src/object/mainmovie.h b/src/object/mainmovie.h index c4fc79a9..c76e7537 100644 --- a/src/object/mainmovie.h +++ b/src/object/mainmovie.h @@ -33,7 +33,8 @@ class CRobotMain; class CSoundInterface; -namespace Gfx { +namespace Gfx +{ class CCamera; class CEngine; } diff --git a/src/object/motion/motion.h b/src/object/motion/motion.h index ffa7985a..ee2421d8 100644 --- a/src/object/motion/motion.h +++ b/src/object/motion/motion.h @@ -27,7 +27,8 @@ #include "object/object_type.h" -namespace Gfx { +namespace Gfx +{ class CEngine; class CParticle; class CTerrain; diff --git a/src/object/object.h b/src/object/object.h index fdfc3398..e47cdc4a 100644 --- a/src/object/object.h +++ b/src/object/object.h @@ -30,7 +30,8 @@ #include -namespace Gfx { +namespace Gfx +{ struct ModelCrashSphere; } // namespace Gfx diff --git a/src/object/object_factory.h b/src/object/object_factory.h index 607abf2d..c7efb427 100644 --- a/src/object/object_factory.h +++ b/src/object/object_factory.h @@ -30,7 +30,8 @@ #include -namespace Gfx { +namespace Gfx +{ class CEngine; class COldModelManager; class CModelManager; diff --git a/src/object/object_manager.h b/src/object/object_manager.h index cdc1feec..db7738d1 100644 --- a/src/object/object_manager.h +++ b/src/object/object_manager.h @@ -36,7 +36,8 @@ #include #include -namespace Gfx { +namespace Gfx +{ class CEngine; class CModelManager; class COldModelManager; @@ -75,7 +76,8 @@ public: do { ++m_currentIt; - } while (m_currentIt != m_endIt && m_currentIt->second == nullptr); + } + while (m_currentIt != m_endIt && m_currentIt->second == nullptr); } inline bool operator!=(const CObjectIteratorProxy& other) diff --git a/src/object/old_object.cpp b/src/object/old_object.cpp index 280b47d4..455dd4d6 100644 --- a/src/object/old_object.cpp +++ b/src/object/old_object.cpp @@ -3127,7 +3127,8 @@ int COldObject::GetDefRank() bool COldObject::GetTooltipName(std::string& name) { GetResource(RES_OBJECT, m_type, name); - if(GetTeam() != 0) { + if (GetTeam() != 0) + { name += " ["+CRobotMain::GetInstancePointer()->GetTeamName(GetTeam())+" ("+boost::lexical_cast(GetTeam())+")]"; } return !name.empty(); diff --git a/src/object/robotmain.cpp b/src/object/robotmain.cpp index ada6c536..31633cca 100644 --- a/src/object/robotmain.cpp +++ b/src/object/robotmain.cpp @@ -2556,7 +2556,8 @@ void CRobotMain::InitEye() bool CRobotMain::EventFrame(const Event &event) { m_time += event.rTime; - if (!m_movieLock && m_pause->GetPause() == PAUSE_NONE) { + if (!m_movieLock && m_pause->GetPause() == PAUSE_NONE) + { m_gameTime += event.rTime; m_gameTimeAbsolute += m_app->GetRealRelTime() / 1e9f; } @@ -5499,7 +5500,8 @@ Error CRobotMain::CheckEndMission(bool frame) // Special handling for teams m_missionResult = ERR_MISSION_NOTERM; - if (teamCount == 0) { + if (teamCount == 0) + { GetLogger()->Info("All teams died, mission ended with failure\n"); m_missionResult = INFO_LOST; } diff --git a/src/object/robotmain.h b/src/object/robotmain.h index 1af454a7..f5ca0233 100644 --- a/src/object/robotmain.h +++ b/src/object/robotmain.h @@ -82,7 +82,8 @@ class CSceneEndCondition; class CAudioChangeCondition; class CPlayerProfile; -namespace Gfx { +namespace Gfx +{ class CEngine; class CLightManager; class CWater; @@ -93,7 +94,8 @@ class CTerrain; class CModelManager; } -namespace Ui { +namespace Ui +{ class CMainDialog; class CMainShort; class CMainMap; diff --git a/src/object/subclass/exchange_post.h b/src/object/subclass/exchange_post.h index b3713442..8e26c09a 100644 --- a/src/object/subclass/exchange_post.h +++ b/src/object/subclass/exchange_post.h @@ -36,7 +36,8 @@ struct ExchangePostInfo struct ObjectCreateParams; -namespace Gfx { +namespace Gfx +{ class COldModelManager; class CEngine; } diff --git a/src/object/subclass/static_object.h b/src/object/subclass/static_object.h index 8935ac68..36bc4fa8 100644 --- a/src/object/subclass/static_object.h +++ b/src/object/subclass/static_object.h @@ -23,7 +23,8 @@ #include -namespace Gfx { +namespace Gfx +{ class CModelManager; class CEngine; class CModel; diff --git a/src/object/task/task.h b/src/object/task/task.h index e660fc45..4c5a546c 100644 --- a/src/object/task/task.h +++ b/src/object/task/task.h @@ -36,7 +36,8 @@ class CRobotMain; class CSoundInterface; -namespace Gfx { +namespace Gfx +{ class CEngine; class CLightManager; class CParticle; diff --git a/src/object/task/taskflag.cpp b/src/object/task/taskflag.cpp index 5ff4b729..9c71ab89 100644 --- a/src/object/task/taskflag.cpp +++ b/src/object/task/taskflag.cpp @@ -141,7 +141,9 @@ CObject* CTaskFlag::SearchNearest(Math::Vector pos, ObjectType type) if(type == OBJECT_NULL) { types = {OBJECT_FLAGb, OBJECT_FLAGr, OBJECT_FLAGg, OBJECT_FLAGy, OBJECT_FLAGv}; - } else { + } + else + { types = {type}; } return CObjectManager::GetInstancePointer()->FindNearest(nullptr, pos, types); diff --git a/src/object/trace_color.cpp b/src/object/trace_color.cpp index a2e74c80..8a4ca457 100644 --- a/src/object/trace_color.cpp +++ b/src/object/trace_color.cpp @@ -20,7 +20,8 @@ std::string TraceColorName(TraceColor color) { - switch(color) { + switch(color) + { case TraceColor::White: return "White"; break; case TraceColor::Black: return "Black"; break; case TraceColor::Gray: return "Gray"; break; diff --git a/src/object/trace_color.h b/src/object/trace_color.h index 47eed5ea..c9804943 100644 --- a/src/object/trace_color.h +++ b/src/object/trace_color.h @@ -20,7 +20,8 @@ #include -enum class TraceColor : int { +enum class TraceColor : int +{ Default = -1, White = 0, diff --git a/src/physics/physics.h b/src/physics/physics.h index 6836e1e7..86f4e135 100644 --- a/src/physics/physics.h +++ b/src/physics/physics.h @@ -42,7 +42,8 @@ class CLevelParserLine; class CJostleableObject; struct Event; -namespace Gfx { +namespace Gfx +{ class CCamera; class CEngine; class CLight; diff --git a/src/script/script.h b/src/script/script.h index d6245bbc..ccb8cddf 100644 --- a/src/script/script.h +++ b/src/script/script.h @@ -38,13 +38,15 @@ class CRobotMain; class CPauseManager; class CScriptFunctions; -namespace Ui{ +namespace Ui +{ class CEdit; class CInterface; class CList; } /* Ui */ -namespace Gfx { +namespace Gfx +{ class CEngine; class CTerrain; class CWater; diff --git a/src/ui/button.cpp b/src/ui/button.cpp index 0a103790..4d06e897 100644 --- a/src/ui/button.cpp +++ b/src/ui/button.cpp @@ -29,7 +29,8 @@ #include -namespace Ui { +namespace Ui +{ const float DELAY1 = 0.4f; const float DELAY2 = 0.1f; diff --git a/src/ui/button.h b/src/ui/button.h index 2c664686..88565888 100644 --- a/src/ui/button.h +++ b/src/ui/button.h @@ -24,7 +24,8 @@ #include "ui/control.h" -namespace Ui { +namespace Ui +{ class CButton : public CControl diff --git a/src/ui/check.cpp b/src/ui/check.cpp index 53421e74..0fcf90b8 100644 --- a/src/ui/check.cpp +++ b/src/ui/check.cpp @@ -30,7 +30,8 @@ #include -namespace Ui { +namespace Ui +{ // Object's constructor. diff --git a/src/ui/check.h b/src/ui/check.h index cdb51345..4ab0a0e4 100644 --- a/src/ui/check.h +++ b/src/ui/check.h @@ -24,11 +24,13 @@ #include "ui/control.h" -namespace Gfx { +namespace Gfx +{ class CEngine; } -namespace Ui { +namespace Ui +{ class CCheck : public CControl { diff --git a/src/ui/color.cpp b/src/ui/color.cpp index e2c79d31..ffd58d93 100644 --- a/src/ui/color.cpp +++ b/src/ui/color.cpp @@ -30,7 +30,8 @@ #include -namespace Ui { +namespace Ui +{ const float DELAY1 = 0.4f; const float DELAY2 = 0.1f; diff --git a/src/ui/color.h b/src/ui/color.h index 06b259ed..d2be408d 100644 --- a/src/ui/color.h +++ b/src/ui/color.h @@ -24,12 +24,14 @@ #include "ui/control.h" -namespace Gfx{ +namespace Gfx +{ class CEngine; struct Color; } -namespace Ui { +namespace Ui +{ class CColor : public CControl { diff --git a/src/ui/compass.cpp b/src/ui/compass.cpp index 45977c5f..9ad185bb 100644 --- a/src/ui/compass.cpp +++ b/src/ui/compass.cpp @@ -28,7 +28,8 @@ #include "math/geometry.h" -namespace Ui { +namespace Ui +{ // Object's constructor. CCompass::CCompass() : CControl() diff --git a/src/ui/compass.h b/src/ui/compass.h index 510d9e88..1d1883d7 100644 --- a/src/ui/compass.h +++ b/src/ui/compass.h @@ -24,11 +24,13 @@ #include "ui/control.h" -namespace Gfx { +namespace Gfx +{ class CEngine; } -namespace Ui { +namespace Ui +{ class CCompass : public CControl { diff --git a/src/ui/control.cpp b/src/ui/control.cpp index a4cdbfcd..fa4b503e 100644 --- a/src/ui/control.cpp +++ b/src/ui/control.cpp @@ -23,7 +23,8 @@ #include "app/app.h" -namespace Ui { +namespace Ui +{ // Object's constructor. CControl::CControl() { diff --git a/src/ui/control.h b/src/ui/control.h index 53066411..5ccde02b 100644 --- a/src/ui/control.h +++ b/src/ui/control.h @@ -38,7 +38,8 @@ -namespace Ui { +namespace Ui +{ enum ControlState { diff --git a/src/ui/displayinfo.cpp b/src/ui/displayinfo.cpp index 2cbbf7f7..645a0245 100644 --- a/src/ui/displayinfo.cpp +++ b/src/ui/displayinfo.cpp @@ -49,7 +49,8 @@ #include -namespace Ui { +namespace Ui +{ // Object's constructor. CDisplayInfo::CDisplayInfo() diff --git a/src/ui/displayinfo.h b/src/ui/displayinfo.h index f820cd64..813a9093 100644 --- a/src/ui/displayinfo.h +++ b/src/ui/displayinfo.h @@ -35,13 +35,15 @@ class CEventQueue; struct Event; -namespace Gfx { +namespace Gfx +{ class CEngine; class CParticle; class CLightManager; } -namespace Ui { +namespace Ui +{ class CInterface; diff --git a/src/ui/displaytext.cpp b/src/ui/displaytext.cpp index dbff6776..c4caf6eb 100644 --- a/src/ui/displaytext.cpp +++ b/src/ui/displaytext.cpp @@ -40,7 +40,8 @@ -namespace Ui { +namespace Ui +{ const float FONTSIZE = 12.0f; diff --git a/src/ui/displaytext.h b/src/ui/displaytext.h index 38154075..bfb1be07 100644 --- a/src/ui/displaytext.h +++ b/src/ui/displaytext.h @@ -32,11 +32,13 @@ class CObject; class CSound; -namespace Gfx { +namespace Gfx +{ class CEngine; } -namespace Ui { +namespace Ui +{ class CInterface; diff --git a/src/ui/edit.cpp b/src/ui/edit.cpp index 6e2c6dc9..141a5ccd 100644 --- a/src/ui/edit.cpp +++ b/src/ui/edit.cpp @@ -36,7 +36,8 @@ #include #include -namespace Ui { +namespace Ui +{ const float MARGX = (5.0f/640.0f); const float MARGY = (5.0f/480.0f); diff --git a/src/ui/edit.h b/src/ui/edit.h index fa543d7e..1eae6741 100644 --- a/src/ui/edit.h +++ b/src/ui/edit.h @@ -46,7 +46,8 @@ namespace fs = boost::filesystem; -namespace Ui { +namespace Ui +{ diff --git a/src/ui/editvalue.cpp b/src/ui/editvalue.cpp index b5fde44e..57880e7c 100644 --- a/src/ui/editvalue.cpp +++ b/src/ui/editvalue.cpp @@ -31,7 +31,8 @@ -namespace Ui { +namespace Ui +{ // Object's constructor. CEditValue::CEditValue() : CControl () diff --git a/src/ui/editvalue.h b/src/ui/editvalue.h index af9bea0f..1afcf27a 100644 --- a/src/ui/editvalue.h +++ b/src/ui/editvalue.h @@ -25,11 +25,13 @@ #include "ui/control.h" -namespace Gfx{ +namespace Gfx +{ class CEngine; } -namespace Ui { +namespace Ui +{ enum EditValueType { diff --git a/src/ui/enumslider.cpp b/src/ui/enumslider.cpp index 71be03f2..8536efe7 100644 --- a/src/ui/enumslider.cpp +++ b/src/ui/enumslider.cpp @@ -20,7 +20,8 @@ #include "common/stringutils.h" -namespace Ui { +namespace Ui +{ CEnumSlider::CEnumSlider() : CSlider() { @@ -35,7 +36,8 @@ void CEnumSlider::SetPossibleValues(const std::map& values) { m_values.clear(); m_labels.clear(); - for (auto it = values.begin(); it != values.end(); ++it) { + for (auto it = values.begin(); it != values.end(); ++it) + { m_values.push_back(it->first); m_labels.push_back(it->second); } diff --git a/src/ui/enumslider.h b/src/ui/enumslider.h index 9f23fb7b..4a353393 100644 --- a/src/ui/enumslider.h +++ b/src/ui/enumslider.h @@ -23,7 +23,8 @@ #include #include -namespace Ui { +namespace Ui +{ class CEnumSlider : public CSlider { diff --git a/src/ui/gauge.cpp b/src/ui/gauge.cpp index 92f4d7c8..bfb2ec64 100644 --- a/src/ui/gauge.cpp +++ b/src/ui/gauge.cpp @@ -21,7 +21,8 @@ #include "ui/gauge.h" -namespace Ui { +namespace Ui +{ // Object's constructor. CGauge::CGauge() : CControl() diff --git a/src/ui/gauge.h b/src/ui/gauge.h index 798171f2..eb73f13f 100644 --- a/src/ui/gauge.h +++ b/src/ui/gauge.h @@ -29,7 +29,8 @@ #include "ui/control.h" -namespace Ui { +namespace Ui +{ class CGauge : public CControl { diff --git a/src/ui/group.cpp b/src/ui/group.cpp index e924ea6a..ae15e7e2 100644 --- a/src/ui/group.cpp +++ b/src/ui/group.cpp @@ -31,7 +31,8 @@ #include -namespace Ui { +namespace Ui +{ // Object's constructor. CGroup::CGroup() : CControl() diff --git a/src/ui/group.h b/src/ui/group.h index e12bf782..69eefc31 100644 --- a/src/ui/group.h +++ b/src/ui/group.h @@ -24,11 +24,13 @@ #include "ui/control.h" -namespace Gfx{ +namespace Gfx +{ class CEngine; -}; +} -namespace Ui { +namespace Ui +{ class CGroup : public CControl { diff --git a/src/ui/image.cpp b/src/ui/image.cpp index 89e1fd2f..51a2d8db 100644 --- a/src/ui/image.cpp +++ b/src/ui/image.cpp @@ -31,7 +31,8 @@ #include -namespace Ui { +namespace Ui +{ // Object's constructor. CImage::CImage() : CControl() diff --git a/src/ui/image.h b/src/ui/image.h index cff43a88..0f180add 100644 --- a/src/ui/image.h +++ b/src/ui/image.h @@ -24,12 +24,14 @@ #include "ui/control.h" -namespace Gfx{ +namespace Gfx +{ class CEngine; -}; +} -namespace Ui { +namespace Ui +{ class CImage : public CControl { diff --git a/src/ui/interface.cpp b/src/ui/interface.cpp index 1eda5bbd..4e26eb55 100644 --- a/src/ui/interface.cpp +++ b/src/ui/interface.cpp @@ -22,7 +22,8 @@ #include "app/app.h" -namespace Ui { +namespace Ui +{ CInterface::CInterface() diff --git a/src/ui/interface.h b/src/ui/interface.h index 9334abfc..c5e7fb70 100644 --- a/src/ui/interface.h +++ b/src/ui/interface.h @@ -51,7 +51,8 @@ #include -namespace Ui { +namespace Ui +{ const int MAXCONTROL = 100; diff --git a/src/ui/key.cpp b/src/ui/key.cpp index b537de1a..d71171ab 100644 --- a/src/ui/key.cpp +++ b/src/ui/key.cpp @@ -25,7 +25,8 @@ #include -namespace Ui { +namespace Ui +{ CKey::CKey() : CControl() diff --git a/src/ui/key.h b/src/ui/key.h index 658e66a7..1f12369a 100644 --- a/src/ui/key.h +++ b/src/ui/key.h @@ -33,7 +33,8 @@ #include "common/key.h" -namespace Ui { +namespace Ui +{ class CKey : public CControl { diff --git a/src/ui/label.cpp b/src/ui/label.cpp index f4d01194..68349d7a 100644 --- a/src/ui/label.cpp +++ b/src/ui/label.cpp @@ -20,7 +20,8 @@ #include "ui/label.h" -namespace Ui { +namespace Ui +{ // Object's constructor. diff --git a/src/ui/label.h b/src/ui/label.h index 36b6da18..293f2867 100644 --- a/src/ui/label.h +++ b/src/ui/label.h @@ -27,7 +27,8 @@ #include "common/event.h" #include "common/misc.h" -namespace Ui { +namespace Ui +{ class CLabel : public CControl { diff --git a/src/ui/list.cpp b/src/ui/list.cpp index 9611533f..fa4c0ef1 100644 --- a/src/ui/list.cpp +++ b/src/ui/list.cpp @@ -22,7 +22,8 @@ #include -namespace Ui { +namespace Ui +{ const float MARGING = 4.0f; diff --git a/src/ui/list.h b/src/ui/list.h index 60ac4b30..81b6470b 100644 --- a/src/ui/list.h +++ b/src/ui/list.h @@ -32,7 +32,8 @@ #include "graphics/engine/text.h" -namespace Ui { +namespace Ui +{ const int LISTMAXDISPLAY = 20; // maximum number of visible lines const int LISTMAXTOTAL = 100; // maximum total number of lines diff --git a/src/ui/maindialog.cpp b/src/ui/maindialog.cpp index 07a6badc..d53efd34 100644 --- a/src/ui/maindialog.cpp +++ b/src/ui/maindialog.cpp @@ -69,7 +69,8 @@ //TODO Get rid of all sprintf's -namespace Ui { +namespace Ui +{ const int KEY_VISIBLE = 6; // number of visible keys redefinable @@ -4486,9 +4487,11 @@ void CMainDialog::UpdateSceneResume(int chap, int rank) // Updates the list of modes. -int GCD(int a, int b) { +int GCD(int a, int b) +{ return (b == 0) ? a : GCD(b, a%b); } + Math::IntPoint AspectRatio(Math::IntPoint resolution) { int gcd = GCD(resolution.x, resolution.y); diff --git a/src/ui/maindialog.h b/src/ui/maindialog.h index 05e71398..f9a31d26 100644 --- a/src/ui/maindialog.h +++ b/src/ui/maindialog.h @@ -33,12 +33,14 @@ class CEventQueue; class CSoundInterface; -namespace Gfx { +namespace Gfx +{ class CEngine; class CParticle; } -namespace Ui { +namespace Ui +{ class CInterface; class CWindow; diff --git a/src/ui/mainmap.cpp b/src/ui/mainmap.cpp index 11b25172..f6068653 100644 --- a/src/ui/mainmap.cpp +++ b/src/ui/mainmap.cpp @@ -23,7 +23,8 @@ #include "app/app.h" -namespace Ui { +namespace Ui +{ const float ZOOM_MIN = 1.0f; diff --git a/src/ui/mainmap.h b/src/ui/mainmap.h index 4ea38a56..95b768da 100644 --- a/src/ui/mainmap.h +++ b/src/ui/mainmap.h @@ -30,7 +30,8 @@ #include "ui/interface.h" -namespace Ui { +namespace Ui +{ class CMainMap { diff --git a/src/ui/mainshort.cpp b/src/ui/mainshort.cpp index f10eb0eb..2583d926 100644 --- a/src/ui/mainshort.cpp +++ b/src/ui/mainshort.cpp @@ -28,7 +28,8 @@ #include "object/object.h" -namespace Ui { +namespace Ui +{ // Constructor of the application card. diff --git a/src/ui/mainshort.h b/src/ui/mainshort.h index dd56f4b1..dfc90de7 100644 --- a/src/ui/mainshort.h +++ b/src/ui/mainshort.h @@ -31,7 +31,8 @@ #include "ui/interface.h" -namespace Ui { +namespace Ui +{ class CMainShort diff --git a/src/ui/map.cpp b/src/ui/map.cpp index 81c03ce2..3f8a2123 100644 --- a/src/ui/map.cpp +++ b/src/ui/map.cpp @@ -27,7 +27,8 @@ #include -namespace Ui { +namespace Ui +{ // Object's constructor. @@ -325,7 +326,8 @@ void CMap::Draw() if ( m_fixImage[0] == 0 && m_map[MAPMAXOBJECT - 1].bUsed ) m_offset = AdjustOffset(m_map[MAPMAXOBJECT - 1].pos); - if ( m_fixImage[0] == 0 ) { // drawing of the relief? + if ( m_fixImage[0] == 0 ) // drawing of the relief? + { m_engine->SetTexture("textures/interface/map.png"); m_engine->SetState(Gfx::ENG_RSTATE_NORMAL); uv1.x = 0.5f + (m_offset.x - (m_half / m_zoom)) / (m_half * 2.0f); diff --git a/src/ui/map.h b/src/ui/map.h index e5ecae32..42f2eb34 100644 --- a/src/ui/map.h +++ b/src/ui/map.h @@ -37,7 +37,8 @@ #include "object/robotmain.h" -namespace Ui { +namespace Ui +{ const int MAPMAXOBJECT = 100; diff --git a/src/ui/scroll.cpp b/src/ui/scroll.cpp index 32c58184..e94d3402 100644 --- a/src/ui/scroll.cpp +++ b/src/ui/scroll.cpp @@ -29,7 +29,8 @@ -namespace Ui { +namespace Ui +{ // Object's constructor. diff --git a/src/ui/scroll.h b/src/ui/scroll.h index 505af096..8c0b24a1 100644 --- a/src/ui/scroll.h +++ b/src/ui/scroll.h @@ -26,7 +26,8 @@ #include "ui/control.h" -namespace Ui { +namespace Ui +{ class CButton; diff --git a/src/ui/shortcut.cpp b/src/ui/shortcut.cpp index 81495a7d..1d848410 100644 --- a/src/ui/shortcut.cpp +++ b/src/ui/shortcut.cpp @@ -28,7 +28,8 @@ #include -namespace Ui { +namespace Ui +{ // Object's constructor. diff --git a/src/ui/shortcut.h b/src/ui/shortcut.h index 9f3a3395..f835ebef 100644 --- a/src/ui/shortcut.h +++ b/src/ui/shortcut.h @@ -25,7 +25,8 @@ #include "common/event.h" -namespace Ui { +namespace Ui +{ class CShortcut : public CControl { diff --git a/src/ui/slider.cpp b/src/ui/slider.cpp index 80f990be..6abec531 100644 --- a/src/ui/slider.cpp +++ b/src/ui/slider.cpp @@ -32,7 +32,8 @@ #include -namespace Ui { +namespace Ui +{ const float CURSOR_WIDTH = (10.0f/640.0f); const float HOLE_WIDTH = (5.0f/480.0f); diff --git a/src/ui/slider.h b/src/ui/slider.h index c1f42db8..416e4e0d 100644 --- a/src/ui/slider.h +++ b/src/ui/slider.h @@ -27,7 +27,8 @@ #include -namespace Ui { +namespace Ui +{ class CButton; diff --git a/src/ui/studio.cpp b/src/ui/studio.cpp index 08fc6def..abe145f8 100644 --- a/src/ui/studio.cpp +++ b/src/ui/studio.cpp @@ -61,7 +61,8 @@ #include -namespace Ui { +namespace Ui +{ // Object's constructor. diff --git a/src/ui/studio.h b/src/ui/studio.h index 36c3d8a4..f46c7827 100644 --- a/src/ui/studio.h +++ b/src/ui/studio.h @@ -37,14 +37,16 @@ class CRobotMain; class CScript; class CSoundInterface; -namespace Gfx { +namespace Gfx +{ class CEngine; class CCamera; -}; +} struct Program; -namespace Ui { +namespace Ui +{ class CEdit; class CInterface; diff --git a/src/ui/target.cpp b/src/ui/target.cpp index 5c433b35..4e00fcb8 100644 --- a/src/ui/target.cpp +++ b/src/ui/target.cpp @@ -24,7 +24,8 @@ #include "object/object_manager.h" -namespace Ui { +namespace Ui +{ // Object's constructor. CTarget::CTarget() : CControl() diff --git a/src/ui/target.h b/src/ui/target.h index 9182f1ef..f5e97729 100644 --- a/src/ui/target.h +++ b/src/ui/target.h @@ -34,7 +34,8 @@ #include -namespace Ui { +namespace Ui +{ class CTarget : public CControl { diff --git a/src/ui/window.cpp b/src/ui/window.cpp index 8754b343..91edf51f 100644 --- a/src/ui/window.cpp +++ b/src/ui/window.cpp @@ -22,7 +22,8 @@ -namespace Ui { +namespace Ui +{ // Object's constructor. CWindow::CWindow() : CControl() diff --git a/src/ui/window.h b/src/ui/window.h index 5c99557e..c4a9f836 100644 --- a/src/ui/window.h +++ b/src/ui/window.h @@ -49,7 +49,8 @@ #include -namespace Ui { +namespace Ui +{ const int MAXWINDOW = 100;