From 4a237f5925eb0d371e097416b17dd5e919cd2258 Mon Sep 17 00:00:00 2001 From: krzys-h Date: Tue, 31 Dec 2013 12:58:45 +0100 Subject: CPauseManager --- src/graphics/engine/engine.cpp | 13 +++++-------- src/graphics/engine/engine.h | 10 +++------- 2 files changed, 8 insertions(+), 15 deletions(-) (limited to 'src/graphics') diff --git a/src/graphics/engine/engine.cpp b/src/graphics/engine/engine.cpp index 5cf7b23..0ee7715 100644 --- a/src/graphics/engine/engine.cpp +++ b/src/graphics/engine/engine.cpp @@ -63,6 +63,7 @@ CEngine::CEngine(CApplication *app) m_planet = nullptr; m_sound = nullptr; m_terrain = nullptr; + m_pause = nullptr; m_showStats = false; @@ -80,7 +81,6 @@ CEngine::CEngine(CApplication *app) m_fogStart[1] = 0.75f; m_waterAddColor = Color(0.0f, 0.0f, 0.0f, 0.0f); - m_pause = false; m_render = true; m_movieLock = false; m_shadowVisible = true; @@ -179,6 +179,7 @@ CEngine::~CEngine() m_lightning = nullptr; m_planet = nullptr; m_terrain = nullptr; + m_pause = nullptr; GetSystemUtils()->DestroyTimeStamp(m_lastFrameTime); m_lastFrameTime = nullptr; @@ -252,6 +253,7 @@ bool CEngine::Create() m_cloud = new CCloud(this); m_lightning = new CLightning(this); m_planet = new CPlanet(this); + m_pause = new CPauseManager(); m_lightMan->SetDevice(m_device); m_particle->SetDevice(m_device); @@ -422,18 +424,13 @@ void CEngine::FrameUpdate() bool CEngine::WriteScreenShot(const std::string& fileName, int width, int height) { // TODO write screenshot: not very important for now - GetLogger()->Trace("CEngine::WriteSceenShot(): stub!\n"); + GetLogger()->Debug("CEngine::WriteSceenShot(): stub!\n"); return true; } -void CEngine::SetPause(bool pause) -{ - m_pause = pause; -} - bool CEngine::GetPause() { - return m_pause; + return m_pause->GetPause(); } void CEngine::SetMovieLock(bool lock) diff --git a/src/graphics/engine/engine.h b/src/graphics/engine/engine.h index 5ecde8f..d56bf38 100644 --- a/src/graphics/engine/engine.h +++ b/src/graphics/engine/engine.h @@ -24,6 +24,7 @@ #include "app/system.h" +#include "app/pausemanager.h" #include "common/event.h" #include "common/singleton.h" @@ -734,11 +735,8 @@ public: bool WriteScreenShot(const std::string& fileName, int width, int height); - //@{ - //! Management of game pause mode - void SetPause(bool pause); + //! Get pause mode TEST_VIRTUAL bool GetPause(); - //@} //@{ //! Management of lock for the duration of movie sequence @@ -1288,6 +1286,7 @@ protected: CLightning* m_lightning; CPlanet* m_planet; CTerrain* m_terrain; + CPauseManager* m_pause; //! Last encountered error std::string m_error; @@ -1300,9 +1299,6 @@ protected: //! Whether to show stats (FPS, etc) bool m_showStats; std::string m_fpsText; - - //! Pause mode - bool m_pause; //! Rendering enabled? bool m_render; //! Lock for duration of movie? -- cgit v1.2.3-1-g7c22 From e9960f53730f84c299147cb996fb656da48dfa66 Mon Sep 17 00:00:00 2001 From: andreymal Date: Sun, 2 Mar 2014 04:15:59 +0400 Subject: GetStringWidth fix --- src/graphics/engine/text.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/graphics') diff --git a/src/graphics/engine/text.cpp b/src/graphics/engine/text.cpp index ffd2eb2..581ff01 100644 --- a/src/graphics/engine/text.cpp +++ b/src/graphics/engine/text.cpp @@ -333,7 +333,7 @@ float CText::GetStringWidth(std::string text, FontType font, float size) // Skip special chars for (char& c : text) { - if (c < 32) + if (c < 32 && c >= 0) c = ':'; } @@ -351,7 +351,7 @@ float CText::GetCharWidth(UTF8Char ch, FontType font, float size, float offset) if (font == FONT_BUTTON) return 0.0f; int width = 1; - if (ch.c1 < 32) + if (ch.c1 < 32 && ch.c1 >= 0) { if (ch.c1 == '\t') width = m_tabSize; -- cgit v1.2.3-1-g7c22 From a181ba9bbf319447db83eea6ce243a08425bb4f4 Mon Sep 17 00:00:00 2001 From: Oleg Kosmakov Date: Tue, 25 Mar 2014 22:56:40 +0200 Subject: Fixes #271 --- src/graphics/engine/text.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'src/graphics') diff --git a/src/graphics/engine/text.cpp b/src/graphics/engine/text.cpp index 581ff01..d0c9cc8 100644 --- a/src/graphics/engine/text.cpp +++ b/src/graphics/engine/text.cpp @@ -646,7 +646,13 @@ void CText::DrawString(const std::string &text, std::vector::itera DrawCharAndAdjustPos(ch, font, size, pos, color); - fmtIndex++; + // increment fmtIndex for each byte in multibyte character + if ( ch.c1 != 0 ) + fmtIndex++; + if ( ch.c2 != 0 ) + fmtIndex++; + if ( ch.c3 != 0 ) + fmtIndex++; } if (eol != 0) -- cgit v1.2.3-1-g7c22 From f71658e38dbcfc5635a6b2a9c6c4168582728bb5 Mon Sep 17 00:00:00 2001 From: krzys-h Date: Thu, 10 Apr 2014 21:50:26 +0200 Subject: Random relief generator --- src/graphics/engine/terrain.cpp | 60 +++++++++++++++++++++++++++++++++++++++++ src/graphics/engine/terrain.h | 4 ++- 2 files changed, 63 insertions(+), 1 deletion(-) (limited to 'src/graphics') diff --git a/src/graphics/engine/terrain.cpp b/src/graphics/engine/terrain.cpp index 4b5384e..e6ca824 100644 --- a/src/graphics/engine/terrain.cpp +++ b/src/graphics/engine/terrain.cpp @@ -331,6 +331,66 @@ bool CTerrain::LoadRelief(const std::string &fileName, float scaleRelief, return true; } +bool CTerrain::RandomizeRelief() +{ + // Perlin noise + // Based on Python implementation by Marek Rogalski (mafik) + // http://amt2014.pl/archiwum/perlin.py + + int size = (m_mosaicCount*m_brickCount)+1; + const int ilosc_oktaw = 6; + + float* oktawy[ilosc_oktaw]; + for(int i=0; i(pow(2, (i+1)*2)); + oktawy[i] = new float[pxCount]; + for(int j=0; j(y2) / size; + for(int x2=0; x2 < size; x2++) + { + float x = static_cast(x2) / size; + + float wart = 0; + for(int i=0; i(pow(2, (i+1)*2))); + double xi, yi, a, b; + a = modf(x * (rozmiar_oktawy-1), &xi); + b = modf(y * (rozmiar_oktawy-1), &yi); + /*int xi = floor(x * (rozmiar_oktawy-1)); + int yi = floor(y * (rozmiar_oktawy-1)); + float a = (x * (rozmiar_oktawy-1)) - xi; + float b = (y * (rozmiar_oktawy-1)) - yi;*/ + //CLogger::GetInstancePointer()->Error("%f %f %f %f\n", xi, yi, a, b); + + float lg = oktawy[i][static_cast(yi * rozmiar_oktawy + xi)]; + float pg = oktawy[i][static_cast(yi * rozmiar_oktawy + xi + 1)]; + float ld = oktawy[i][static_cast((yi+1) * rozmiar_oktawy + xi)]; + float pd = oktawy[i][static_cast((yi+1) * rozmiar_oktawy + xi + 1)]; + //CLogger::GetInstancePointer()->Error("%f %f %f %f\n", lg, pg, ld, pd); + + float g = pg * a + lg * (1-a); + float d = pd * a + ld * (1-a); + float res = d * b + g * (1-b); + wart += res; + } + + wart /= ilosc_oktaw; + + m_relief[x2+y2*size] = wart * 255.0f; + } + } + return true; +} + bool CTerrain::AddReliefPoint(Math::Vector pos, float scaleRelief) { float dim = (m_mosaicCount*m_brickCount*m_brickSize)/2.0f; diff --git a/src/graphics/engine/terrain.h b/src/graphics/engine/terrain.h index e618691..75a8975 100644 --- a/src/graphics/engine/terrain.h +++ b/src/graphics/engine/terrain.h @@ -212,7 +212,7 @@ struct FlyingLimit * where relief data is specifically adjusted to level space to allow * construction of buildings. * - * Undergound resources can be supplied by loading them from image like relief data. + * Underground resources can be supplied by loading them from image like relief data. * * Terrain also specifies flying limits for player: one global level and possible * additional spherical restrictions. @@ -243,6 +243,8 @@ public: void FlushRelief(); //! Load relief from image bool LoadRelief(const std::string& fileName, float scaleRelief, bool adjustBorder); + //! Load ramdomized relief + bool RandomizeRelief(); //! Load resources from image bool LoadResources(const std::string& fileName); -- cgit v1.2.3-1-g7c22 From f0d97bfdb91a2c0a17d1697b145d4df930280dbb Mon Sep 17 00:00:00 2001 From: krzys-h Date: Sun, 18 May 2014 12:12:47 +0200 Subject: Better datadir mod support --- src/graphics/engine/engine.cpp | 34 +++++++--------------------------- src/graphics/engine/modelmanager.cpp | 20 +++++++++++++++++++- src/graphics/engine/modelmanager.h | 17 +++++++++++++++++ src/graphics/engine/terrain.cpp | 5 +++-- src/graphics/engine/text.cpp | 3 ++- 5 files changed, 48 insertions(+), 31 deletions(-) (limited to 'src/graphics') diff --git a/src/graphics/engine/engine.cpp b/src/graphics/engine/engine.cpp index 0ee7715..d6e4415 100644 --- a/src/graphics/engine/engine.cpp +++ b/src/graphics/engine/engine.cpp @@ -19,6 +19,7 @@ #include "graphics/engine/engine.h" #include "app/app.h" +#include "app/gamedata.h" #include "common/image.h" #include "common/key.h" @@ -2246,33 +2247,12 @@ Texture CEngine::CreateTexture(const std::string& texName, const TextureCreatePa if (image == nullptr) { - bool loadedFromTexPack = false; - - std::string texPackName = m_app->GetTexPackFilePath(texName); - if (! texPackName.empty()) + if (! img.Load(CGameData::GetInstancePointer()->GetFilePath(DIR_TEXTURE, texName))) { - if (img.Load(texPackName)) - { - loadedFromTexPack = true; - } - else - { - std::string error = img.GetError(); - GetLogger()->Error("Couldn't load texture '%s' from texpack: %s, blacklisting the texpack path\n", - texName.c_str(), error.c_str()); - m_texBlacklist.insert(texPackName); - } - } - - if (!loadedFromTexPack) - { - if (! img.Load(m_app->GetDataFilePath(DIR_TEXTURE, texName))) - { - std::string error = img.GetError(); - GetLogger()->Error("Couldn't load texture '%s': %s, blacklisting\n", texName.c_str(), error.c_str()); - m_texBlacklist.insert(texName); - return Texture(); // invalid texture - } + std::string error = img.GetError(); + GetLogger()->Error("Couldn't load texture '%s': %s, blacklisting\n", texName.c_str(), error.c_str()); + m_texBlacklist.insert(texName); + return Texture(); // invalid texture } image = &img; @@ -2435,7 +2415,7 @@ bool CEngine::ChangeTextureColor(const std::string& texName, CImage img; - if (! img.Load(m_app->GetDataFilePath(DIR_TEXTURE, texName))) + if (! img.Load(CGameData::GetInstancePointer()->GetFilePath(DIR_TEXTURE, texName))) { std::string error = img.GetError(); GetLogger()->Error("Couldn't load texture '%s': %s, blacklisting\n", texName.c_str(), error.c_str()); diff --git a/src/graphics/engine/modelmanager.cpp b/src/graphics/engine/modelmanager.cpp index abc8c6c..0c0fb98 100644 --- a/src/graphics/engine/modelmanager.cpp +++ b/src/graphics/engine/modelmanager.cpp @@ -1,6 +1,24 @@ +// * This file is part of the COLOBOT source code +// * Copyright (C) 2001-2008, Daniel ROUX & EPSITEC SA, www.epsitec.ch +// * Copyright (C) 2012-2014, Polish Portal of Colobot (PPC) +// * +// * This program is free software: you can redistribute it and/or modify +// * it under the terms of the GNU General Public License as published by +// * the Free Software Foundation, either version 3 of the License, or +// * (at your option) any later version. +// * +// * This program is distributed in the hope that it will be useful, +// * but WITHOUT ANY WARRANTY; without even the implied warranty of +// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// * GNU General Public License for more details. +// * +// * You should have received a copy of the GNU General Public License +// * along with this program. If not, see http://www.gnu.org/licenses/. + #include "graphics/engine/modelmanager.h" #include "app/app.h" +#include "app/gamedata.h" #include "common/logger.h" @@ -30,7 +48,7 @@ bool CModelManager::LoadModel(const std::string& fileName, bool mirrored) if (CApplication::GetInstance().IsDebugModeActive(DEBUG_MODELS)) modelFile.SetPrintDebugInfo(true); - std::string filePath = CApplication::GetInstance().GetDataFilePath(DIR_MODEL, fileName); + std::string filePath = CGameData::GetInstancePointer()->GetFilePath(DIR_MODEL, fileName); if (!modelFile.ReadModel(filePath)) { diff --git a/src/graphics/engine/modelmanager.h b/src/graphics/engine/modelmanager.h index 9d50b97..ee5fc27 100644 --- a/src/graphics/engine/modelmanager.h +++ b/src/graphics/engine/modelmanager.h @@ -1,3 +1,20 @@ +// * This file is part of the COLOBOT source code +// * Copyright (C) 2001-2008, Daniel ROUX & EPSITEC SA, www.epsitec.ch +// * Copyright (C) 2012-2014, Polish Portal of Colobot (PPC) +// * +// * This program is free software: you can redistribute it and/or modify +// * it under the terms of the GNU General Public License as published by +// * the Free Software Foundation, either version 3 of the License, or +// * (at your option) any later version. +// * +// * This program is distributed in the hope that it will be useful, +// * but WITHOUT ANY WARRANTY; without even the implied warranty of +// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// * GNU General Public License for more details. +// * +// * You should have received a copy of the GNU General Public License +// * along with this program. If not, see http://www.gnu.org/licenses/. + #pragma once #include "common/singleton.h" diff --git a/src/graphics/engine/terrain.cpp b/src/graphics/engine/terrain.cpp index e6ca824..5f37cd8 100644 --- a/src/graphics/engine/terrain.cpp +++ b/src/graphics/engine/terrain.cpp @@ -19,6 +19,7 @@ #include "graphics/engine/terrain.h" #include "app/app.h" +#include "app/gamedata.h" #include "common/image.h" #include "common/logger.h" @@ -189,7 +190,7 @@ void CTerrain::AddMaterial(int id, const std::string& texName, const Math::Point bool CTerrain::LoadResources(const std::string& fileName) { CImage img; - std::string path = CApplication::GetInstance().GetDataFilePath(DIR_TEXTURE, fileName); + std::string path = CGameData::GetInstancePointer()->GetFilePath(DIR_TEXTURE, fileName); if (! img.Load(path)) { GetLogger()->Error("Cannot load resource file: '%s'\n", path.c_str()); @@ -286,7 +287,7 @@ bool CTerrain::LoadRelief(const std::string &fileName, float scaleRelief, m_scaleRelief = scaleRelief; CImage img; - std::string path = CApplication::GetInstance().GetDataFilePath(DIR_TEXTURE, fileName); + std::string path = CGameData::GetInstancePointer()->GetFilePath(DIR_TEXTURE, fileName); if (! img.Load(path)) { GetLogger()->Error("Could not load relief file: '%s'!\n", path.c_str()); diff --git a/src/graphics/engine/text.cpp b/src/graphics/engine/text.cpp index d0c9cc8..8fd01b7 100644 --- a/src/graphics/engine/text.cpp +++ b/src/graphics/engine/text.cpp @@ -19,6 +19,7 @@ #include "graphics/engine/text.h" #include "app/app.h" +#include "app/gamedata.h" #include "common/image.h" #include "common/logger.h" @@ -865,7 +866,7 @@ CachedFont* CText::GetOrOpenFont(FontType font, float size) return m_lastCachedFont; } - std::string path = CApplication::GetInstance().GetDataFilePath(DIR_FONT, mf->fileName); + std::string path = CGameData::GetInstancePointer()->GetFilePath(DIR_FONT, mf->fileName); m_lastCachedFont = new CachedFont(); m_lastCachedFont->font = TTF_OpenFont(path.c_str(), pointSize); -- cgit v1.2.3-1-g7c22 From 613e1d74c47cf3a756af9aff75575c7567699381 Mon Sep 17 00:00:00 2001 From: Mohamed Waheed Date: Tue, 24 Jun 2014 01:35:05 +0300 Subject: implemented savefile screenshot feature --- src/graphics/core/device.h | 3 +++ src/graphics/engine/engine.cpp | 17 ++++++++++++++--- src/graphics/opengl/gldevice.cpp | 17 +++++++++++++++++ src/graphics/opengl/gldevice.h | 2 ++ 4 files changed, 36 insertions(+), 3 deletions(-) (limited to 'src/graphics') diff --git a/src/graphics/core/device.h b/src/graphics/core/device.h index 4c1189c..a896104 100644 --- a/src/graphics/core/device.h +++ b/src/graphics/core/device.h @@ -400,6 +400,9 @@ public: virtual void SetFillMode(FillMode mode) = 0; //! Returns the current fill mode virtual FillMode GetFillMode() = 0; + + //! Returns the pixels of the entire screen + virtual void* GetFrameBufferPixels()const = 0; }; diff --git a/src/graphics/engine/engine.cpp b/src/graphics/engine/engine.cpp index d6e4415..9216fb0 100644 --- a/src/graphics/engine/engine.cpp +++ b/src/graphics/engine/engine.cpp @@ -424,9 +424,20 @@ void CEngine::FrameUpdate() bool CEngine::WriteScreenShot(const std::string& fileName, int width, int height) { - // TODO write screenshot: not very important for now - GetLogger()->Debug("CEngine::WriteSceenShot(): stub!\n"); - return true; + void *pixels = m_device->GetFrameBufferPixels(); + CImage img({width,height}); + + img.SetDataPixels(pixels); + img.flipVertical(); + + if ( img.SavePNG(fileName.c_str()) ){ + GetLogger()->Info("Save SceenShot Saved Successfully!\n"); + return true; + } + else{ + GetLogger()->Error("%s!\n",img.GetError().c_str()); + return false; + } } bool CEngine::GetPause() diff --git a/src/graphics/opengl/gldevice.cpp b/src/graphics/opengl/gldevice.cpp index 9f64fab..57738a6 100644 --- a/src/graphics/opengl/gldevice.cpp +++ b/src/graphics/opengl/gldevice.cpp @@ -1791,6 +1791,23 @@ FillMode CGLDevice::GetFillMode() return FILL_POINT; } +void* CGLDevice::GetFrameBufferPixels()const{ + + SDL_Surface* surface = SDL_GetVideoSurface(); + + assert(surface != nullptr); + + GLubyte* pixels = new GLubyte [4 * surface->h * surface->w]; + + glReadPixels(0,0,surface->w,surface->h,GL_RGBA,GL_UNSIGNED_BYTE,pixels); + + unsigned int* p = static_cast ( static_cast(pixels) ); + + for (int i = 0; i < surface->h * surface->w; ++i) + p[i] |= 0xFF000000; + + return static_cast(p); +} } // namespace Gfx diff --git a/src/graphics/opengl/gldevice.h b/src/graphics/opengl/gldevice.h index c648161..267ee73 100644 --- a/src/graphics/opengl/gldevice.h +++ b/src/graphics/opengl/gldevice.h @@ -188,6 +188,8 @@ public: virtual void SetFillMode(FillMode mode) ; virtual FillMode GetFillMode(); + virtual void* GetFrameBufferPixels()const; + private: //! Updates internal modelview matrix void UpdateModelviewMatrix(); -- cgit v1.2.3-1-g7c22 From b7125a5b24bc6d2581bec0d3f792ba948e0e7edd Mon Sep 17 00:00:00 2001 From: Mohamed Waheed Date: Tue, 24 Jun 2014 20:27:31 +0300 Subject: formatting and enhancements for savefile screenshot feature --- src/graphics/engine/engine.cpp | 2 +- src/graphics/opengl/gldevice.cpp | 10 +++------- 2 files changed, 4 insertions(+), 8 deletions(-) (limited to 'src/graphics') diff --git a/src/graphics/engine/engine.cpp b/src/graphics/engine/engine.cpp index 9216fb0..e0861d2 100644 --- a/src/graphics/engine/engine.cpp +++ b/src/graphics/engine/engine.cpp @@ -428,7 +428,7 @@ bool CEngine::WriteScreenShot(const std::string& fileName, int width, int height CImage img({width,height}); img.SetDataPixels(pixels); - img.flipVertical(); + img.flipVertically(); if ( img.SavePNG(fileName.c_str()) ){ GetLogger()->Info("Save SceenShot Saved Successfully!\n"); diff --git a/src/graphics/opengl/gldevice.cpp b/src/graphics/opengl/gldevice.cpp index 57738a6..b42f29d 100644 --- a/src/graphics/opengl/gldevice.cpp +++ b/src/graphics/opengl/gldevice.cpp @@ -1793,17 +1793,13 @@ FillMode CGLDevice::GetFillMode() void* CGLDevice::GetFrameBufferPixels()const{ - SDL_Surface* surface = SDL_GetVideoSurface(); - - assert(surface != nullptr); - - GLubyte* pixels = new GLubyte [4 * surface->h * surface->w]; + GLubyte* pixels = new GLubyte [4 * m_config.size.x * m_config.size.y]; - glReadPixels(0,0,surface->w,surface->h,GL_RGBA,GL_UNSIGNED_BYTE,pixels); + glReadPixels(0, 0, m_config.size.x, m_config.size.y, GL_RGBA, GL_UNSIGNED_BYTE, pixels); unsigned int* p = static_cast ( static_cast(pixels) ); - for (int i = 0; i < surface->h * surface->w; ++i) + for (int i = 0; i < m_config.size.x * m_config.size.y; ++i) p[i] |= 0xFF000000; return static_cast(p); -- cgit v1.2.3-1-g7c22 From 0fbc05b96ca9b464b273d64349d9a7940a0c992b Mon Sep 17 00:00:00 2001 From: Piotr Dziwinski Date: Thu, 26 Jun 2014 22:36:57 +0200 Subject: Fix test compilation --- src/graphics/core/vertex.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/graphics') diff --git a/src/graphics/core/vertex.h b/src/graphics/core/vertex.h index c3a657a..ca68352 100644 --- a/src/graphics/core/vertex.h +++ b/src/graphics/core/vertex.h @@ -82,7 +82,9 @@ struct VertexCol Math::Vector coord; Color color; - explicit VertexCol(Math::Vector aCoord = Math::Vector(), + VertexCol() = default; + + explicit VertexCol(Math::Vector aCoord, Color aColor = Color()) : coord(aCoord), color(aColor) {} -- cgit v1.2.3-1-g7c22 From 1835d2ae580525603308206f7b8e6b4552b3ca0f Mon Sep 17 00:00:00 2001 From: krzys-h Date: Fri, 27 Jun 2014 19:50:09 +0200 Subject: Removed old code based on #ifs (issue #55) --- src/graphics/engine/camera.cpp | 3 --- 1 file changed, 3 deletions(-) (limited to 'src/graphics') diff --git a/src/graphics/engine/camera.cpp b/src/graphics/engine/camera.cpp index f0c379c..fedc70a 100644 --- a/src/graphics/engine/camera.cpp +++ b/src/graphics/engine/camera.cpp @@ -593,9 +593,6 @@ void CCamera::EffectFrame(const Event &event) dist = Math::Norm((dist - 100.f) / 100.0f); force *= 1.0f-dist; -#if _TEEN - force *= 2.0f; -#endif m_effectOffset *= force; if (m_effectProgress >= 1.0f) -- cgit v1.2.3-1-g7c22