diff --git a/src/base/log.cpp b/src/base/log.cpp index ed3368569..ada2d0295 100644 --- a/src/base/log.cpp +++ b/src/base/log.cpp @@ -179,23 +179,23 @@ std::unique_ptr log_logger_android() class CLoggerCollection : public ILogger { - std::vector> m_apLoggers; + std::vector> m_vpLoggers; public: - CLoggerCollection(std::vector> &&apLoggers) : - m_apLoggers(std::move(apLoggers)) + CLoggerCollection(std::vector> &&vpLoggers) : + m_vpLoggers(std::move(vpLoggers)) { } void Log(const CLogMessage *pMessage) override { - for(auto &pLogger : m_apLoggers) + for(auto &pLogger : m_vpLoggers) { pLogger->Log(pMessage); } } void GlobalFinish() override { - for(auto &pLogger : m_apLoggers) + for(auto &pLogger : m_vpLoggers) { pLogger->GlobalFinish(); } @@ -453,12 +453,12 @@ void CFutureLogger::Set(std::unique_ptr &&pLogger) { dbg_assert(false, "future logger has already been set and can only be set once"); } - for(const auto &Pending : m_aPending) + for(const auto &Pending : m_vPending) { pLoggerRaw->Log(&Pending); } - m_aPending.clear(); - m_aPending.shrink_to_fit(); + m_vPending.clear(); + m_vPending.shrink_to_fit(); m_PendingLock.unlock(); } @@ -471,7 +471,7 @@ void CFutureLogger::Log(const CLogMessage *pMessage) return; } m_PendingLock.lock(); - m_aPending.push_back(*pMessage); + m_vPending.push_back(*pMessage); m_PendingLock.unlock(); } diff --git a/src/base/logger.h b/src/base/logger.h index 2fe96897d..bef07dd65 100644 --- a/src/base/logger.h +++ b/src/base/logger.h @@ -196,7 +196,7 @@ class CFutureLogger : public ILogger { private: std::atomic m_pLogger; - std::vector m_aPending; + std::vector m_vPending; std::mutex m_PendingLock; public: diff --git a/src/engine/client/backend/glsl_shader_compiler.cpp b/src/engine/client/backend/glsl_shader_compiler.cpp index 2eeaa8019..538be9351 100644 --- a/src/engine/client/backend/glsl_shader_compiler.cpp +++ b/src/engine/client/backend/glsl_shader_compiler.cpp @@ -19,7 +19,7 @@ CGLSLCompiler::CGLSLCompiler(int OpenGLVersionMajor, int OpenGLVersionMinor, int void CGLSLCompiler::AddDefine(const std::string &DefineName, const std::string &DefineValue) { - m_Defines.emplace_back(SGLSLCompilerDefine(DefineName, DefineValue)); + m_vDefines.emplace_back(SGLSLCompilerDefine(DefineName, DefineValue)); } void CGLSLCompiler::AddDefine(const char *pDefineName, const char *pDefineValue) @@ -29,7 +29,7 @@ void CGLSLCompiler::AddDefine(const char *pDefineName, const char *pDefineValue) void CGLSLCompiler::ClearDefines() { - m_Defines.clear(); + m_vDefines.clear(); } void CGLSLCompiler::ParseLine(std::string &Line, const char *pReadLine, EGLSLShaderCompilerType Type) diff --git a/src/engine/client/backend/glsl_shader_compiler.h b/src/engine/client/backend/glsl_shader_compiler.h index afc64f105..d3917f46c 100644 --- a/src/engine/client/backend/glsl_shader_compiler.h +++ b/src/engine/client/backend/glsl_shader_compiler.h @@ -26,7 +26,7 @@ private: std::string m_DefineValue; }; - std::vector m_Defines; + std::vector m_vDefines; int m_OpenGLVersionMajor; int m_OpenGLVersionMinor; diff --git a/src/engine/client/backend/opengl/backend_opengl.cpp b/src/engine/client/backend/opengl/backend_opengl.cpp index 5b3c308c1..9a747706d 100644 --- a/src/engine/client/backend/opengl/backend_opengl.cpp +++ b/src/engine/client/backend/opengl/backend_opengl.cpp @@ -65,7 +65,7 @@ size_t CCommandProcessorFragment_OpenGL::GLFormatToImageColorChannelCount(int GL bool CCommandProcessorFragment_OpenGL::IsTexturedState(const CCommandBuffer::SState &State) { - return State.m_Texture >= 0 && State.m_Texture < (int)m_Textures.size(); + return State.m_Texture >= 0 && State.m_Texture < (int)m_vTextures.size(); } void CCommandProcessorFragment_OpenGL::SetState(const CCommandBuffer::SState &State, bool Use2DArrayTextures) @@ -126,9 +126,9 @@ void CCommandProcessorFragment_OpenGL::SetState(const CCommandBuffer::SState &St if(!Use2DArrayTextures) { glEnable(GL_TEXTURE_2D); - glBindTexture(GL_TEXTURE_2D, m_Textures[State.m_Texture].m_Tex); + glBindTexture(GL_TEXTURE_2D, m_vTextures[State.m_Texture].m_Tex); - if(m_Textures[State.m_Texture].m_LastWrapMode != State.m_WrapMode) + if(m_vTextures[State.m_Texture].m_LastWrapMode != State.m_WrapMode) { switch(State.m_WrapMode) { @@ -143,7 +143,7 @@ void CCommandProcessorFragment_OpenGL::SetState(const CCommandBuffer::SState &St default: dbg_msg("render", "unknown wrapmode %d\n", State.m_WrapMode); }; - m_Textures[State.m_Texture].m_LastWrapMode = State.m_WrapMode; + m_vTextures[State.m_Texture].m_LastWrapMode = State.m_WrapMode; } } else @@ -152,13 +152,13 @@ void CCommandProcessorFragment_OpenGL::SetState(const CCommandBuffer::SState &St { if(!m_HasShaders) glEnable(m_2DArrayTarget); - glBindTexture(m_2DArrayTarget, m_Textures[State.m_Texture].m_Tex2DArray); + glBindTexture(m_2DArrayTarget, m_vTextures[State.m_Texture].m_Tex2DArray); } else if(m_Has3DTextures) { if(!m_HasShaders) glEnable(GL_TEXTURE_3D); - glBindTexture(GL_TEXTURE_3D, m_Textures[State.m_Texture].m_Tex2DArray); + glBindTexture(GL_TEXTURE_3D, m_vTextures[State.m_Texture].m_Tex2DArray); } else { @@ -633,12 +633,12 @@ bool CCommandProcessorFragment_OpenGL::Cmd_Init(const SCommand_Init *pCommand) void CCommandProcessorFragment_OpenGL::TextureUpdate(int Slot, int X, int Y, int Width, int Height, int GLFormat, void *pTexData) { - glBindTexture(GL_TEXTURE_2D, m_Textures[Slot].m_Tex); + glBindTexture(GL_TEXTURE_2D, m_vTextures[Slot].m_Tex); if(!m_HasNPOTTextures) { - float ResizeW = m_Textures[Slot].m_ResizeWidth; - float ResizeH = m_Textures[Slot].m_ResizeHeight; + float ResizeW = m_vTextures[Slot].m_ResizeWidth; + float ResizeH = m_vTextures[Slot].m_ResizeHeight; if(ResizeW > 0 && ResizeH > 0) { int ResizedW = (int)(Width * ResizeW); @@ -653,11 +653,11 @@ void CCommandProcessorFragment_OpenGL::TextureUpdate(int Slot, int X, int Y, int } } - if(m_Textures[Slot].m_RescaleCount > 0) + if(m_vTextures[Slot].m_RescaleCount > 0) { int OldWidth = Width; int OldHeight = Height; - for(int i = 0; i < m_Textures[Slot].m_RescaleCount; ++i) + for(int i = 0; i < m_vTextures[Slot].m_RescaleCount; ++i) { Width >>= 1; Height >>= 1; @@ -682,35 +682,35 @@ void CCommandProcessorFragment_OpenGL::Cmd_Texture_Update(const CCommandBuffer:: void CCommandProcessorFragment_OpenGL::DestroyTexture(int Slot) { - m_pTextureMemoryUsage->store(m_pTextureMemoryUsage->load(std::memory_order_relaxed) - m_Textures[Slot].m_MemSize, std::memory_order_relaxed); + m_pTextureMemoryUsage->store(m_pTextureMemoryUsage->load(std::memory_order_relaxed) - m_vTextures[Slot].m_MemSize, std::memory_order_relaxed); - if(m_Textures[Slot].m_Tex != 0) + if(m_vTextures[Slot].m_Tex != 0) { - glDeleteTextures(1, &m_Textures[Slot].m_Tex); + glDeleteTextures(1, &m_vTextures[Slot].m_Tex); } - if(m_Textures[Slot].m_Tex2DArray != 0) + if(m_vTextures[Slot].m_Tex2DArray != 0) { - glDeleteTextures(1, &m_Textures[Slot].m_Tex2DArray); + glDeleteTextures(1, &m_vTextures[Slot].m_Tex2DArray); } if(IsNewApi()) { - if(m_Textures[Slot].m_Sampler != 0) + if(m_vTextures[Slot].m_Sampler != 0) { - glDeleteSamplers(1, &m_Textures[Slot].m_Sampler); + glDeleteSamplers(1, &m_vTextures[Slot].m_Sampler); } - if(m_Textures[Slot].m_Sampler2DArray != 0) + if(m_vTextures[Slot].m_Sampler2DArray != 0) { - glDeleteSamplers(1, &m_Textures[Slot].m_Sampler2DArray); + glDeleteSamplers(1, &m_vTextures[Slot].m_Sampler2DArray); } } - m_Textures[Slot].m_Tex = 0; - m_Textures[Slot].m_Sampler = 0; - m_Textures[Slot].m_Tex2DArray = 0; - m_Textures[Slot].m_Sampler2DArray = 0; - m_Textures[Slot].m_LastWrapMode = CCommandBuffer::WRAP_REPEAT; + m_vTextures[Slot].m_Tex = 0; + m_vTextures[Slot].m_Sampler = 0; + m_vTextures[Slot].m_Tex2DArray = 0; + m_vTextures[Slot].m_Sampler2DArray = 0; + m_vTextures[Slot].m_LastWrapMode = CCommandBuffer::WRAP_REPEAT; } void CCommandProcessorFragment_OpenGL::Cmd_Texture_Destroy(const CCommandBuffer::SCommand_Texture_Destroy *pCommand) @@ -729,11 +729,11 @@ void CCommandProcessorFragment_OpenGL::TextureCreate(int Slot, int Width, int He glGetIntegerv(GL_MAX_TEXTURE_SIZE, &m_MaxTexSize); } - if(Slot >= (int)m_Textures.size()) - m_Textures.resize(m_Textures.size() * 2); + if(Slot >= (int)m_vTextures.size()) + m_vTextures.resize(m_vTextures.size() * 2); - m_Textures[Slot].m_ResizeWidth = -1.f; - m_Textures[Slot].m_ResizeHeight = -1.f; + m_vTextures[Slot].m_ResizeWidth = -1.f; + m_vTextures[Slot].m_ResizeHeight = -1.f; if(!m_HasNPOTTextures) { @@ -745,8 +745,8 @@ void CCommandProcessorFragment_OpenGL::TextureCreate(int Slot, int Width, int He free(pTexData); pTexData = pTmpData; - m_Textures[Slot].m_ResizeWidth = (float)PowerOfTwoWidth / (float)Width; - m_Textures[Slot].m_ResizeHeight = (float)PowerOfTwoHeight / (float)Height; + m_vTextures[Slot].m_ResizeWidth = (float)PowerOfTwoWidth / (float)Width; + m_vTextures[Slot].m_ResizeHeight = (float)PowerOfTwoHeight / (float)Height; Width = PowerOfTwoWidth; Height = PowerOfTwoHeight; @@ -778,17 +778,17 @@ void CCommandProcessorFragment_OpenGL::TextureCreate(int Slot, int Width, int He pTexData = pTmpData; } } - m_Textures[Slot].m_Width = Width; - m_Textures[Slot].m_Height = Height; - m_Textures[Slot].m_RescaleCount = RescaleCount; + m_vTextures[Slot].m_Width = Width; + m_vTextures[Slot].m_Height = Height; + m_vTextures[Slot].m_RescaleCount = RescaleCount; int Oglformat = GLFormat; int StoreOglformat = GLStoreFormat; if((Flags & CCommandBuffer::TEXFLAG_NO_2D_TEXTURE) == 0) { - glGenTextures(1, &m_Textures[Slot].m_Tex); - glBindTexture(GL_TEXTURE_2D, m_Textures[Slot].m_Tex); + glGenTextures(1, &m_vTextures[Slot].m_Tex); + glBindTexture(GL_TEXTURE_2D, m_vTextures[Slot].m_Tex); } if(Flags & CCommandBuffer::TEXFLAG_NOMIPMAPS || !m_HasMipMaps) @@ -822,7 +822,7 @@ void CCommandProcessorFragment_OpenGL::TextureCreate(int Slot, int Width, int He { bool Is3DTexture = (Flags & Flag3DTexture) != 0; - glGenTextures(1, &m_Textures[Slot].m_Tex2DArray); + glGenTextures(1, &m_vTextures[Slot].m_Tex2DArray); GLenum Target = GL_TEXTURE_3D; @@ -835,12 +835,12 @@ void CCommandProcessorFragment_OpenGL::TextureCreate(int Slot, int Width, int He Target = m_2DArrayTarget; } - glBindTexture(Target, m_Textures[Slot].m_Tex2DArray); + glBindTexture(Target, m_vTextures[Slot].m_Tex2DArray); if(IsNewApi()) { - glGenSamplers(1, &m_Textures[Slot].m_Sampler2DArray); - glBindSampler(0, m_Textures[Slot].m_Sampler2DArray); + glGenSamplers(1, &m_vTextures[Slot].m_Sampler2DArray); + glBindSampler(0, m_vTextures[Slot].m_Sampler2DArray); } glTexParameteri(Target, GL_TEXTURE_MAG_FILTER, GL_LINEAR); @@ -848,14 +848,14 @@ void CCommandProcessorFragment_OpenGL::TextureCreate(int Slot, int Width, int He { glTexParameteri(Target, GL_TEXTURE_MIN_FILTER, GL_LINEAR); if(IsNewApi()) - glSamplerParameteri(m_Textures[Slot].m_Sampler2DArray, GL_TEXTURE_MIN_FILTER, GL_LINEAR); + glSamplerParameteri(m_vTextures[Slot].m_Sampler2DArray, GL_TEXTURE_MIN_FILTER, GL_LINEAR); } else { glTexParameteri(Target, GL_TEXTURE_MIN_FILTER, GL_LINEAR_MIPMAP_LINEAR); glTexParameteri(Target, GL_GENERATE_MIPMAP, GL_TRUE); if(IsNewApi()) - glSamplerParameteri(m_Textures[Slot].m_Sampler2DArray, GL_TEXTURE_MIN_FILTER, GL_LINEAR_MIPMAP_LINEAR); + glSamplerParameteri(m_vTextures[Slot].m_Sampler2DArray, GL_TEXTURE_MIN_FILTER, GL_LINEAR_MIPMAP_LINEAR); } glTexParameteri(Target, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); @@ -869,13 +869,13 @@ void CCommandProcessorFragment_OpenGL::TextureCreate(int Slot, int Width, int He if(IsNewApi()) { - glSamplerParameteri(m_Textures[Slot].m_Sampler2DArray, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); - glSamplerParameteri(m_Textures[Slot].m_Sampler2DArray, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); - glSamplerParameteri(m_Textures[Slot].m_Sampler2DArray, GL_TEXTURE_WRAP_R, GL_MIRRORED_REPEAT); + glSamplerParameteri(m_vTextures[Slot].m_Sampler2DArray, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); + glSamplerParameteri(m_vTextures[Slot].m_Sampler2DArray, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); + glSamplerParameteri(m_vTextures[Slot].m_Sampler2DArray, GL_TEXTURE_WRAP_R, GL_MIRRORED_REPEAT); #ifndef BACKEND_AS_OPENGL_ES if(m_OpenGLTextureLodBIAS != 0 && !m_IsOpenGLES) - glSamplerParameterf(m_Textures[Slot].m_Sampler2DArray, GL_TEXTURE_LOD_BIAS, ((GLfloat)m_OpenGLTextureLodBIAS / 1000.0f)); + glSamplerParameterf(m_vTextures[Slot].m_Sampler2DArray, GL_TEXTURE_LOD_BIAS, ((GLfloat)m_OpenGLTextureLodBIAS / 1000.0f)); #endif glBindSampler(0, 0); @@ -929,17 +929,17 @@ void CCommandProcessorFragment_OpenGL::TextureCreate(int Slot, int Width, int He } // This is the initial value for the wrap modes - m_Textures[Slot].m_LastWrapMode = CCommandBuffer::WRAP_REPEAT; + m_vTextures[Slot].m_LastWrapMode = CCommandBuffer::WRAP_REPEAT; // calculate memory usage - m_Textures[Slot].m_MemSize = Width * Height * PixelSize; + m_vTextures[Slot].m_MemSize = Width * Height * PixelSize; while(Width > 2 && Height > 2) { Width >>= 1; Height >>= 1; - m_Textures[Slot].m_MemSize += Width * Height * PixelSize; + m_vTextures[Slot].m_MemSize += Width * Height * PixelSize; } - m_pTextureMemoryUsage->store(m_pTextureMemoryUsage->load(std::memory_order_relaxed) + m_Textures[Slot].m_MemSize, std::memory_order_relaxed); + m_pTextureMemoryUsage->store(m_pTextureMemoryUsage->load(std::memory_order_relaxed) + m_vTextures[Slot].m_MemSize, std::memory_order_relaxed); free(pTexData); #endif @@ -1050,7 +1050,7 @@ void CCommandProcessorFragment_OpenGL::Cmd_Screenshot(const CCommandBuffer::SCom CCommandProcessorFragment_OpenGL::CCommandProcessorFragment_OpenGL() { - m_Textures.resize(CCommandBuffer::MAX_TEXTURES); + m_vTextures.resize(CCommandBuffer::MAX_TEXTURES); m_HasShaders = false; } @@ -1135,13 +1135,13 @@ void CCommandProcessorFragment_OpenGL2::UseProgram(CGLSLTWProgram *pProgram) bool CCommandProcessorFragment_OpenGL2::IsAndUpdateTextureSlotBound(int IDX, int Slot, bool Is2DArray) { - if(m_TextureSlotBoundToUnit[IDX].m_TextureSlot == Slot && m_TextureSlotBoundToUnit[IDX].m_Is2DArray == Is2DArray) + if(m_vTextureSlotBoundToUnit[IDX].m_TextureSlot == Slot && m_vTextureSlotBoundToUnit[IDX].m_Is2DArray == Is2DArray) return true; else { // the texture slot uses this index now - m_TextureSlotBoundToUnit[IDX].m_TextureSlot = Slot; - m_TextureSlotBoundToUnit[IDX].m_Is2DArray = Is2DArray; + m_vTextureSlotBoundToUnit[IDX].m_TextureSlot = Slot; + m_vTextureSlotBoundToUnit[IDX].m_Is2DArray = Is2DArray; return false; } } @@ -1218,15 +1218,15 @@ void CCommandProcessorFragment_OpenGL2::SetState(const CCommandBuffer::SState &S glActiveTexture(GL_TEXTURE0 + Slot); if(!Use2DArrayTextures) { - glBindTexture(GL_TEXTURE_2D, m_Textures[State.m_Texture].m_Tex); + glBindTexture(GL_TEXTURE_2D, m_vTextures[State.m_Texture].m_Tex); if(IsNewApi()) - glBindSampler(Slot, m_Textures[State.m_Texture].m_Sampler); + glBindSampler(Slot, m_vTextures[State.m_Texture].m_Sampler); } else { - glBindTexture(GL_TEXTURE_2D_ARRAY, m_Textures[State.m_Texture].m_Tex2DArray); + glBindTexture(GL_TEXTURE_2D_ARRAY, m_vTextures[State.m_Texture].m_Tex2DArray); if(IsNewApi()) - glBindSampler(Slot, m_Textures[State.m_Texture].m_Sampler2DArray); + glBindSampler(Slot, m_vTextures[State.m_Texture].m_Sampler2DArray); } } } @@ -1237,9 +1237,9 @@ void CCommandProcessorFragment_OpenGL2::SetState(const CCommandBuffer::SState &S { if(!IsNewApi() && !m_HasShaders) glEnable(GL_TEXTURE_2D); - glBindTexture(GL_TEXTURE_2D, m_Textures[State.m_Texture].m_Tex); + glBindTexture(GL_TEXTURE_2D, m_vTextures[State.m_Texture].m_Tex); if(IsNewApi()) - glBindSampler(Slot, m_Textures[State.m_Texture].m_Sampler); + glBindSampler(Slot, m_vTextures[State.m_Texture].m_Sampler); } else { @@ -1247,17 +1247,17 @@ void CCommandProcessorFragment_OpenGL2::SetState(const CCommandBuffer::SState &S { if(!IsNewApi() && !m_HasShaders) glEnable(GL_TEXTURE_3D); - glBindTexture(GL_TEXTURE_3D, m_Textures[State.m_Texture].m_Tex2DArray); + glBindTexture(GL_TEXTURE_3D, m_vTextures[State.m_Texture].m_Tex2DArray); if(IsNewApi()) - glBindSampler(Slot, m_Textures[State.m_Texture].m_Sampler2DArray); + glBindSampler(Slot, m_vTextures[State.m_Texture].m_Sampler2DArray); } else { if(!IsNewApi() && !m_HasShaders) glEnable(m_2DArrayTarget); - glBindTexture(m_2DArrayTarget, m_Textures[State.m_Texture].m_Tex2DArray); + glBindTexture(m_2DArrayTarget, m_vTextures[State.m_Texture].m_Tex2DArray); if(IsNewApi()) - glBindSampler(Slot, m_Textures[State.m_Texture].m_Sampler2DArray); + glBindSampler(Slot, m_vTextures[State.m_Texture].m_Sampler2DArray); } } } @@ -1268,28 +1268,28 @@ void CCommandProcessorFragment_OpenGL2::SetState(const CCommandBuffer::SState &S pProgram->m_LastTextureSampler = Slot; } - if(m_Textures[State.m_Texture].m_LastWrapMode != State.m_WrapMode && !Use2DArrayTextures) + if(m_vTextures[State.m_Texture].m_LastWrapMode != State.m_WrapMode && !Use2DArrayTextures) { switch(State.m_WrapMode) { case CCommandBuffer::WRAP_REPEAT: if(IsNewApi()) { - glSamplerParameteri(m_Textures[State.m_Texture].m_Sampler, GL_TEXTURE_WRAP_S, GL_REPEAT); - glSamplerParameteri(m_Textures[State.m_Texture].m_Sampler, GL_TEXTURE_WRAP_T, GL_REPEAT); + glSamplerParameteri(m_vTextures[State.m_Texture].m_Sampler, GL_TEXTURE_WRAP_S, GL_REPEAT); + glSamplerParameteri(m_vTextures[State.m_Texture].m_Sampler, GL_TEXTURE_WRAP_T, GL_REPEAT); } break; case CCommandBuffer::WRAP_CLAMP: if(IsNewApi()) { - glSamplerParameteri(m_Textures[State.m_Texture].m_Sampler, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); - glSamplerParameteri(m_Textures[State.m_Texture].m_Sampler, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); + glSamplerParameteri(m_vTextures[State.m_Texture].m_Sampler, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); + glSamplerParameteri(m_vTextures[State.m_Texture].m_Sampler, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); } break; default: dbg_msg("render", "unknown wrapmode %d\n", State.m_WrapMode); }; - m_Textures[State.m_Texture].m_LastWrapMode = State.m_WrapMode; + m_vTextures[State.m_Texture].m_LastWrapMode = State.m_WrapMode; } } @@ -1874,11 +1874,11 @@ void CCommandProcessorFragment_OpenGL2::Cmd_CreateBufferObject(const CCommandBuf void *pUploadData = pCommand->m_pUploadData; int Index = pCommand->m_BufferIndex; // create necessary space - if((size_t)Index >= m_BufferObjectIndices.size()) + if((size_t)Index >= m_vBufferObjectIndices.size()) { - for(int i = m_BufferObjectIndices.size(); i < Index + 1; ++i) + for(int i = m_vBufferObjectIndices.size(); i < Index + 1; ++i) { - m_BufferObjectIndices.emplace_back(0); + m_vBufferObjectIndices.emplace_back(0); } } @@ -1892,7 +1892,7 @@ void CCommandProcessorFragment_OpenGL2::Cmd_CreateBufferObject(const CCommandBuf glBindBuffer(GL_ARRAY_BUFFER, 0); } - SBufferObject &BufferObject = m_BufferObjectIndices[Index]; + SBufferObject &BufferObject = m_vBufferObjectIndices[Index]; BufferObject.m_BufferObjectID = VertBufferID; BufferObject.m_DataSize = pCommand->m_DataSize; BufferObject.m_pData = malloc(pCommand->m_DataSize); @@ -1907,7 +1907,7 @@ void CCommandProcessorFragment_OpenGL2::Cmd_RecreateBufferObject(const CCommandB { void *pUploadData = pCommand->m_pUploadData; int Index = pCommand->m_BufferIndex; - SBufferObject &BufferObject = m_BufferObjectIndices[Index]; + SBufferObject &BufferObject = m_vBufferObjectIndices[Index]; if(m_HasShaders) { @@ -1930,7 +1930,7 @@ void CCommandProcessorFragment_OpenGL2::Cmd_UpdateBufferObject(const CCommandBuf { void *pUploadData = pCommand->m_pUploadData; int Index = pCommand->m_BufferIndex; - SBufferObject &BufferObject = m_BufferObjectIndices[Index]; + SBufferObject &BufferObject = m_vBufferObjectIndices[Index]; if(m_HasShaders) { @@ -1951,8 +1951,8 @@ void CCommandProcessorFragment_OpenGL2::Cmd_CopyBufferObject(const CCommandBuffe int WriteIndex = pCommand->m_WriteBufferIndex; int ReadIndex = pCommand->m_ReadBufferIndex; - SBufferObject &ReadBufferObject = m_BufferObjectIndices[ReadIndex]; - SBufferObject &WriteBufferObject = m_BufferObjectIndices[WriteIndex]; + SBufferObject &ReadBufferObject = m_vBufferObjectIndices[ReadIndex]; + SBufferObject &WriteBufferObject = m_vBufferObjectIndices[WriteIndex]; mem_copy(((uint8_t *)WriteBufferObject.m_pData) + (ptrdiff_t)pCommand->m_pWriteOffset, ((uint8_t *)ReadBufferObject.m_pData) + (ptrdiff_t)pCommand->m_pReadOffset, pCommand->m_CopySize); @@ -1967,7 +1967,7 @@ void CCommandProcessorFragment_OpenGL2::Cmd_CopyBufferObject(const CCommandBuffe void CCommandProcessorFragment_OpenGL2::Cmd_DeleteBufferObject(const CCommandBuffer::SCommand_DeleteBufferObject *pCommand) { int Index = pCommand->m_BufferIndex; - SBufferObject &BufferObject = m_BufferObjectIndices[Index]; + SBufferObject &BufferObject = m_vBufferObjectIndices[Index]; if(m_HasShaders) { @@ -1982,23 +1982,23 @@ void CCommandProcessorFragment_OpenGL2::Cmd_CreateBufferContainer(const CCommand { int Index = pCommand->m_BufferContainerIndex; // create necessary space - if((size_t)Index >= m_BufferContainers.size()) + if((size_t)Index >= m_vBufferContainers.size()) { - for(int i = m_BufferContainers.size(); i < Index + 1; ++i) + for(int i = m_vBufferContainers.size(); i < Index + 1; ++i) { SBufferContainer Container; Container.m_ContainerInfo.m_Stride = 0; Container.m_ContainerInfo.m_VertBufferBindingIndex = -1; - m_BufferContainers.push_back(Container); + m_vBufferContainers.push_back(Container); } } - SBufferContainer &BufferContainer = m_BufferContainers[Index]; + SBufferContainer &BufferContainer = m_vBufferContainers[Index]; for(int i = 0; i < pCommand->m_AttrCount; ++i) { SBufferContainerInfo::SAttribute &Attr = pCommand->m_pAttributes[i]; - BufferContainer.m_ContainerInfo.m_Attributes.push_back(Attr); + BufferContainer.m_ContainerInfo.m_vAttributes.push_back(Attr); } BufferContainer.m_ContainerInfo.m_Stride = pCommand->m_Stride; @@ -2007,14 +2007,14 @@ void CCommandProcessorFragment_OpenGL2::Cmd_CreateBufferContainer(const CCommand void CCommandProcessorFragment_OpenGL2::Cmd_UpdateBufferContainer(const CCommandBuffer::SCommand_UpdateBufferContainer *pCommand) { - SBufferContainer &BufferContainer = m_BufferContainers[pCommand->m_BufferContainerIndex]; + SBufferContainer &BufferContainer = m_vBufferContainers[pCommand->m_BufferContainerIndex]; - BufferContainer.m_ContainerInfo.m_Attributes.clear(); + BufferContainer.m_ContainerInfo.m_vAttributes.clear(); for(int i = 0; i < pCommand->m_AttrCount; ++i) { SBufferContainerInfo::SAttribute &Attr = pCommand->m_pAttributes[i]; - BufferContainer.m_ContainerInfo.m_Attributes.push_back(Attr); + BufferContainer.m_ContainerInfo.m_vAttributes.push_back(Attr); } BufferContainer.m_ContainerInfo.m_Stride = pCommand->m_Stride; @@ -2023,7 +2023,7 @@ void CCommandProcessorFragment_OpenGL2::Cmd_UpdateBufferContainer(const CCommand void CCommandProcessorFragment_OpenGL2::Cmd_DeleteBufferContainer(const CCommandBuffer::SCommand_DeleteBufferContainer *pCommand) { - SBufferContainer &BufferContainer = m_BufferContainers[pCommand->m_BufferContainerIndex]; + SBufferContainer &BufferContainer = m_vBufferContainers[pCommand->m_BufferContainerIndex]; if(pCommand->m_DestroyAllBO) { @@ -2032,15 +2032,15 @@ void CCommandProcessorFragment_OpenGL2::Cmd_DeleteBufferContainer(const CCommand { if(m_HasShaders) { - glDeleteBuffers(1, &m_BufferObjectIndices[VertBufferID].m_BufferObjectID); + glDeleteBuffers(1, &m_vBufferObjectIndices[VertBufferID].m_BufferObjectID); } - free(m_BufferObjectIndices[VertBufferID].m_pData); - m_BufferObjectIndices[VertBufferID].m_pData = NULL; + free(m_vBufferObjectIndices[VertBufferID].m_pData); + m_vBufferObjectIndices[VertBufferID].m_pData = NULL; } } - BufferContainer.m_ContainerInfo.m_Attributes.clear(); + BufferContainer.m_ContainerInfo.m_vAttributes.clear(); } void CCommandProcessorFragment_OpenGL2::Cmd_IndicesRequiredNumNotify(const CCommandBuffer::SCommand_IndicesRequiredNumNotify *pCommand) @@ -2068,9 +2068,9 @@ void CCommandProcessorFragment_OpenGL2::RenderBorderTileEmulation(SBufferContain CCommandProcessorFragment_OpenGL::SetState(State, true); } - bool IsTextured = BufferContainer.m_ContainerInfo.m_Attributes.size() == 2; + bool IsTextured = BufferContainer.m_ContainerInfo.m_vAttributes.size() == 2; - SBufferObject &BufferObject = m_BufferObjectIndices[(size_t)BufferContainer.m_ContainerInfo.m_VertBufferBindingIndex]; + SBufferObject &BufferObject = m_vBufferObjectIndices[(size_t)BufferContainer.m_ContainerInfo.m_VertBufferBindingIndex]; glEnableClientState(GL_VERTEX_ARRAY); glEnableClientState(GL_COLOR_ARRAY); @@ -2153,9 +2153,9 @@ void CCommandProcessorFragment_OpenGL2::RenderBorderTileLineEmulation(SBufferCon CCommandProcessorFragment_OpenGL::SetState(State, true); } - bool IsTextured = BufferContainer.m_ContainerInfo.m_Attributes.size() == 2; + bool IsTextured = BufferContainer.m_ContainerInfo.m_vAttributes.size() == 2; - SBufferObject &BufferObject = m_BufferObjectIndices[(size_t)BufferContainer.m_ContainerInfo.m_VertBufferBindingIndex]; + SBufferObject &BufferObject = m_vBufferObjectIndices[(size_t)BufferContainer.m_ContainerInfo.m_VertBufferBindingIndex]; glEnableClientState(GL_VERTEX_ARRAY); glEnableClientState(GL_COLOR_ARRAY); @@ -2219,10 +2219,10 @@ void CCommandProcessorFragment_OpenGL2::Cmd_RenderBorderTile(const CCommandBuffe { int Index = pCommand->m_BufferContainerIndex; // if space not there return - if((size_t)Index >= m_BufferContainers.size()) + if((size_t)Index >= m_vBufferContainers.size()) return; - SBufferContainer &BufferContainer = m_BufferContainers[Index]; + SBufferContainer &BufferContainer = m_vBufferContainers[Index]; RenderBorderTileEmulation(BufferContainer, pCommand->m_State, (float *)&pCommand->m_Color, pCommand->m_pIndicesOffset, pCommand->m_DrawNum, pCommand->m_Offset, pCommand->m_Dir, pCommand->m_JumpIndex); } @@ -2231,10 +2231,10 @@ void CCommandProcessorFragment_OpenGL2::Cmd_RenderBorderTileLine(const CCommandB { int Index = pCommand->m_BufferContainerIndex; // if space not there return - if((size_t)Index >= m_BufferContainers.size()) + if((size_t)Index >= m_vBufferContainers.size()) return; - SBufferContainer &BufferContainer = m_BufferContainers[Index]; + SBufferContainer &BufferContainer = m_vBufferContainers[Index]; RenderBorderTileLineEmulation(BufferContainer, pCommand->m_State, (float *)&pCommand->m_Color, pCommand->m_pIndicesOffset, pCommand->m_IndexDrawNum, pCommand->m_DrawNum, pCommand->m_Offset, pCommand->m_Dir); } @@ -2243,10 +2243,10 @@ void CCommandProcessorFragment_OpenGL2::Cmd_RenderTileLayer(const CCommandBuffer { int Index = pCommand->m_BufferContainerIndex; // if space not there return - if((size_t)Index >= m_BufferContainers.size()) + if((size_t)Index >= m_vBufferContainers.size()) return; - SBufferContainer &BufferContainer = m_BufferContainers[Index]; + SBufferContainer &BufferContainer = m_vBufferContainers[Index]; if(pCommand->m_IndicesDrawNum == 0) { @@ -2273,9 +2273,9 @@ void CCommandProcessorFragment_OpenGL2::Cmd_RenderTileLayer(const CCommandBuffer CCommandProcessorFragment_OpenGL::SetState(pCommand->m_State, true); } - bool IsTextured = BufferContainer.m_ContainerInfo.m_Attributes.size() == 2; + bool IsTextured = BufferContainer.m_ContainerInfo.m_vAttributes.size() == 2; - SBufferObject &BufferObject = m_BufferObjectIndices[(size_t)BufferContainer.m_ContainerInfo.m_VertBufferBindingIndex]; + SBufferObject &BufferObject = m_vBufferObjectIndices[(size_t)BufferContainer.m_ContainerInfo.m_VertBufferBindingIndex]; if(m_HasShaders) glBindBuffer(GL_ARRAY_BUFFER, BufferObject.m_BufferObjectID); @@ -2291,11 +2291,11 @@ void CCommandProcessorFragment_OpenGL2::Cmd_RenderTileLayer(const CCommandBuffer if(m_HasShaders) { glEnableVertexAttribArray(0); - glVertexAttribPointer(0, 2, GL_FLOAT, false, BufferContainer.m_ContainerInfo.m_Stride, BufferContainer.m_ContainerInfo.m_Attributes[0].m_pOffset); + glVertexAttribPointer(0, 2, GL_FLOAT, false, BufferContainer.m_ContainerInfo.m_Stride, BufferContainer.m_ContainerInfo.m_vAttributes[0].m_pOffset); if(IsTextured) { glEnableVertexAttribArray(1); - glVertexAttribPointer(1, 3, GL_FLOAT, false, BufferContainer.m_ContainerInfo.m_Stride, BufferContainer.m_ContainerInfo.m_Attributes[1].m_pOffset); + glVertexAttribPointer(1, 3, GL_FLOAT, false, BufferContainer.m_ContainerInfo.m_Stride, BufferContainer.m_ContainerInfo.m_vAttributes[1].m_pOffset); } for(int i = 0; i < pCommand->m_IndicesDrawNum; ++i) diff --git a/src/engine/client/backend/opengl/backend_opengl.h b/src/engine/client/backend/opengl/backend_opengl.h index da7d8751f..37645d2a8 100644 --- a/src/engine/client/backend/opengl/backend_opengl.h +++ b/src/engine/client/backend/opengl/backend_opengl.h @@ -52,7 +52,7 @@ protected: float m_ResizeWidth; float m_ResizeHeight; }; - std::vector m_Textures; + std::vector m_vTextures; std::atomic *m_pTextureMemoryUsage; uint32_t m_CanvasWidth = 0; @@ -140,7 +140,7 @@ class CCommandProcessorFragment_OpenGL2 : public CCommandProcessorFragment_OpenG { SBufferContainerInfo m_ContainerInfo; }; - std::vector m_BufferContainers; + std::vector m_vBufferContainers; #ifndef BACKEND_AS_OPENGL_ES GL_SVertexTex3D m_aStreamVertices[1024 * 4]; @@ -159,7 +159,7 @@ class CCommandProcessorFragment_OpenGL2 : public CCommandProcessorFragment_OpenG size_t m_DataSize; }; - std::vector m_BufferObjectIndices; + std::vector m_vBufferObjectIndices; #ifndef BACKEND_GL_MODERN_API bool DoAnalyzeStep(size_t StepN, size_t CheckCount, size_t VerticesCount, uint8_t aFakeTexture[], size_t SingleImageSize); @@ -210,7 +210,7 @@ protected: int m_TextureSlot; bool m_Is2DArray; }; - std::vector m_TextureSlotBoundToUnit; // the texture index generated by loadtextureraw is stored in an index calculated by max texture units + std::vector m_vTextureSlotBoundToUnit; // the texture index generated by loadtextureraw is stored in an index calculated by max texture units bool IsAndUpdateTextureSlotBound(int IDX, int Slot, bool Is2DArray = false); diff --git a/src/engine/client/backend/opengl/backend_opengl3.cpp b/src/engine/client/backend/opengl/backend_opengl3.cpp index 5ad001768..ca160a3c7 100644 --- a/src/engine/client/backend/opengl/backend_opengl3.cpp +++ b/src/engine/client/backend/opengl/backend_opengl3.cpp @@ -459,11 +459,11 @@ bool CCommandProcessorFragment_OpenGL3_3::Cmd_Init(const SCommand_Init *pCommand // query maximum of allowed textures glGetIntegerv(GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS, &m_MaxTextureUnits); - m_TextureSlotBoundToUnit.resize(m_MaxTextureUnits); + m_vTextureSlotBoundToUnit.resize(m_MaxTextureUnits); for(int i = 0; i < m_MaxTextureUnits; ++i) { - m_TextureSlotBoundToUnit[i].m_TextureSlot = -1; - m_TextureSlotBoundToUnit[i].m_Is2DArray = false; + m_vTextureSlotBoundToUnit[i].m_TextureSlot = -1; + m_vTextureSlotBoundToUnit[i].m_Is2DArray = false; } glBindVertexArray(0); @@ -486,7 +486,7 @@ bool CCommandProcessorFragment_OpenGL3_3::Cmd_Init(const SCommand_Init *pCommand m_CurrentIndicesInBuffer = CCommandBuffer::MAX_VERTICES / 4 * 6; - m_Textures.resize(CCommandBuffer::MAX_TEXTURES); + m_vTextures.resize(CCommandBuffer::MAX_TEXTURES); m_ClearColor.r = m_ClearColor.g = m_ClearColor.b = -1.f; @@ -546,17 +546,17 @@ void CCommandProcessorFragment_OpenGL3_3::Cmd_Shutdown(const SCommand_Shutdown * glDeleteBuffers(1, &m_PrimitiveDrawBufferIDTex3D); glDeleteVertexArrays(1, &m_PrimitiveDrawVertexIDTex3D); - for(int i = 0; i < (int)m_Textures.size(); ++i) + for(int i = 0; i < (int)m_vTextures.size(); ++i) { DestroyTexture(i); } - for(size_t i = 0; i < m_BufferContainers.size(); ++i) + for(size_t i = 0; i < m_vBufferContainers.size(); ++i) { DestroyBufferContainer(i); } - m_BufferContainers.clear(); + m_vBufferContainers.clear(); } void CCommandProcessorFragment_OpenGL3_3::TextureUpdate(int Slot, int X, int Y, int Width, int Height, int GLFormat, void *pTexData) @@ -567,14 +567,14 @@ void CCommandProcessorFragment_OpenGL3_3::TextureUpdate(int Slot, int X, int Y, // just tell, that we using this texture now IsAndUpdateTextureSlotBound(SamplerSlot, Slot); glActiveTexture(GL_TEXTURE0 + SamplerSlot); - glBindSampler(SamplerSlot, m_Textures[Slot].m_Sampler); + glBindSampler(SamplerSlot, m_vTextures[Slot].m_Sampler); } - glBindTexture(GL_TEXTURE_2D, m_Textures[Slot].m_Tex); + glBindTexture(GL_TEXTURE_2D, m_vTextures[Slot].m_Tex); - if(m_Textures[Slot].m_RescaleCount > 0) + if(m_vTextures[Slot].m_RescaleCount > 0) { - for(int i = 0; i < m_Textures[Slot].m_RescaleCount; ++i) + for(int i = 0; i < m_vTextures[Slot].m_RescaleCount; ++i) { Width >>= 1; Height >>= 1; @@ -608,15 +608,15 @@ void CCommandProcessorFragment_OpenGL3_3::Cmd_Texture_Destroy(const CCommandBuff } glBindTexture(GL_TEXTURE_2D, 0); glBindSampler(Slot, 0); - m_TextureSlotBoundToUnit[Slot].m_TextureSlot = -1; - m_TextureSlotBoundToUnit[Slot].m_Is2DArray = false; + m_vTextureSlotBoundToUnit[Slot].m_TextureSlot = -1; + m_vTextureSlotBoundToUnit[Slot].m_Is2DArray = false; DestroyTexture(pCommand->m_Slot); } void CCommandProcessorFragment_OpenGL3_3::TextureCreate(int Slot, int Width, int Height, int PixelSize, int GLFormat, int GLStoreFormat, int Flags, void *pTexData) { - if(Slot >= (int)m_Textures.size()) - m_Textures.resize(m_Textures.size() * 2); + if(Slot >= (int)m_vTextures.size()) + m_vTextures.resize(m_vTextures.size() * 2); // resample if needed int RescaleCount = 0; @@ -636,9 +636,9 @@ void CCommandProcessorFragment_OpenGL3_3::TextureCreate(int Slot, int Width, int pTexData = pTmpData; } } - m_Textures[Slot].m_Width = Width; - m_Textures[Slot].m_Height = Height; - m_Textures[Slot].m_RescaleCount = RescaleCount; + m_vTextures[Slot].m_Width = Width; + m_vTextures[Slot].m_Height = Height; + m_vTextures[Slot].m_RescaleCount = RescaleCount; int Oglformat = GLFormat; int StoreOglformat = GLStoreFormat; @@ -652,17 +652,17 @@ void CCommandProcessorFragment_OpenGL3_3::TextureCreate(int Slot, int Width, int // just tell, that we using this texture now IsAndUpdateTextureSlotBound(SamplerSlot, Slot); glActiveTexture(GL_TEXTURE0 + SamplerSlot); - m_TextureSlotBoundToUnit[SamplerSlot].m_TextureSlot = -1; - m_TextureSlotBoundToUnit[SamplerSlot].m_Is2DArray = false; + m_vTextureSlotBoundToUnit[SamplerSlot].m_TextureSlot = -1; + m_vTextureSlotBoundToUnit[SamplerSlot].m_Is2DArray = false; } if((Flags & CCommandBuffer::TEXFLAG_NO_2D_TEXTURE) == 0) { - glGenTextures(1, &m_Textures[Slot].m_Tex); - glBindTexture(GL_TEXTURE_2D, m_Textures[Slot].m_Tex); + glGenTextures(1, &m_vTextures[Slot].m_Tex); + glBindTexture(GL_TEXTURE_2D, m_vTextures[Slot].m_Tex); - glGenSamplers(1, &m_Textures[Slot].m_Sampler); - glBindSampler(SamplerSlot, m_Textures[Slot].m_Sampler); + glGenSamplers(1, &m_vTextures[Slot].m_Sampler); + glBindSampler(SamplerSlot, m_vTextures[Slot].m_Sampler); } if(Flags & CCommandBuffer::TEXFLAG_NOMIPMAPS) @@ -671,8 +671,8 @@ void CCommandProcessorFragment_OpenGL3_3::TextureCreate(int Slot, int Width, int { glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); - glSamplerParameteri(m_Textures[Slot].m_Sampler, GL_TEXTURE_MAG_FILTER, GL_LINEAR); - glSamplerParameteri(m_Textures[Slot].m_Sampler, GL_TEXTURE_MIN_FILTER, GL_LINEAR); + glSamplerParameteri(m_vTextures[Slot].m_Sampler, GL_TEXTURE_MAG_FILTER, GL_LINEAR); + glSamplerParameteri(m_vTextures[Slot].m_Sampler, GL_TEXTURE_MIN_FILTER, GL_LINEAR); glTexImage2D(GL_TEXTURE_2D, 0, StoreOglformat, Width, Height, 0, Oglformat, GL_UNSIGNED_BYTE, pTexData); } } @@ -680,12 +680,12 @@ void CCommandProcessorFragment_OpenGL3_3::TextureCreate(int Slot, int Width, int { if((Flags & CCommandBuffer::TEXFLAG_NO_2D_TEXTURE) == 0) { - glSamplerParameteri(m_Textures[Slot].m_Sampler, GL_TEXTURE_MAG_FILTER, GL_LINEAR); - glSamplerParameteri(m_Textures[Slot].m_Sampler, GL_TEXTURE_MIN_FILTER, GL_LINEAR_MIPMAP_LINEAR); + glSamplerParameteri(m_vTextures[Slot].m_Sampler, GL_TEXTURE_MAG_FILTER, GL_LINEAR); + glSamplerParameteri(m_vTextures[Slot].m_Sampler, GL_TEXTURE_MIN_FILTER, GL_LINEAR_MIPMAP_LINEAR); #ifndef BACKEND_AS_OPENGL_ES if(m_OpenGLTextureLodBIAS != 0 && !m_IsOpenGLES) - glSamplerParameterf(m_Textures[Slot].m_Sampler, GL_TEXTURE_LOD_BIAS, ((GLfloat)m_OpenGLTextureLodBIAS / 1000.0f)); + glSamplerParameterf(m_vTextures[Slot].m_Sampler, GL_TEXTURE_LOD_BIAS, ((GLfloat)m_OpenGLTextureLodBIAS / 1000.0f)); #endif // prevent mipmap display bugs, when zooming out far @@ -700,20 +700,20 @@ void CCommandProcessorFragment_OpenGL3_3::TextureCreate(int Slot, int Width, int if((Flags & (CCommandBuffer::TEXFLAG_TO_2D_ARRAY_TEXTURE | CCommandBuffer::TEXFLAG_TO_2D_ARRAY_TEXTURE_SINGLE_LAYER)) != 0) { - glGenTextures(1, &m_Textures[Slot].m_Tex2DArray); - glBindTexture(GL_TEXTURE_2D_ARRAY, m_Textures[Slot].m_Tex2DArray); + glGenTextures(1, &m_vTextures[Slot].m_Tex2DArray); + glBindTexture(GL_TEXTURE_2D_ARRAY, m_vTextures[Slot].m_Tex2DArray); - glGenSamplers(1, &m_Textures[Slot].m_Sampler2DArray); - glBindSampler(SamplerSlot, m_Textures[Slot].m_Sampler2DArray); - glSamplerParameteri(m_Textures[Slot].m_Sampler2DArray, GL_TEXTURE_MAG_FILTER, GL_LINEAR); - glSamplerParameteri(m_Textures[Slot].m_Sampler2DArray, GL_TEXTURE_MIN_FILTER, GL_LINEAR_MIPMAP_LINEAR); - glSamplerParameteri(m_Textures[Slot].m_Sampler2DArray, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); - glSamplerParameteri(m_Textures[Slot].m_Sampler2DArray, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); - glSamplerParameteri(m_Textures[Slot].m_Sampler2DArray, GL_TEXTURE_WRAP_R, GL_MIRRORED_REPEAT); + glGenSamplers(1, &m_vTextures[Slot].m_Sampler2DArray); + glBindSampler(SamplerSlot, m_vTextures[Slot].m_Sampler2DArray); + glSamplerParameteri(m_vTextures[Slot].m_Sampler2DArray, GL_TEXTURE_MAG_FILTER, GL_LINEAR); + glSamplerParameteri(m_vTextures[Slot].m_Sampler2DArray, GL_TEXTURE_MIN_FILTER, GL_LINEAR_MIPMAP_LINEAR); + glSamplerParameteri(m_vTextures[Slot].m_Sampler2DArray, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); + glSamplerParameteri(m_vTextures[Slot].m_Sampler2DArray, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); + glSamplerParameteri(m_vTextures[Slot].m_Sampler2DArray, GL_TEXTURE_WRAP_R, GL_MIRRORED_REPEAT); #ifndef BACKEND_AS_OPENGL_ES if(m_OpenGLTextureLodBIAS != 0 && !m_IsOpenGLES) - glSamplerParameterf(m_Textures[Slot].m_Sampler2DArray, GL_TEXTURE_LOD_BIAS, ((GLfloat)m_OpenGLTextureLodBIAS / 1000.0f)); + glSamplerParameterf(m_vTextures[Slot].m_Sampler2DArray, GL_TEXTURE_LOD_BIAS, ((GLfloat)m_OpenGLTextureLodBIAS / 1000.0f)); #endif int ImageColorChannels = GLFormatToImageColorChannelCount(GLFormat); @@ -765,17 +765,17 @@ void CCommandProcessorFragment_OpenGL3_3::TextureCreate(int Slot, int Width, int } // This is the initial value for the wrap modes - m_Textures[Slot].m_LastWrapMode = CCommandBuffer::WRAP_REPEAT; + m_vTextures[Slot].m_LastWrapMode = CCommandBuffer::WRAP_REPEAT; // calculate memory usage - m_Textures[Slot].m_MemSize = Width * Height * PixelSize; + m_vTextures[Slot].m_MemSize = Width * Height * PixelSize; while(Width > 2 && Height > 2) { Width >>= 1; Height >>= 1; - m_Textures[Slot].m_MemSize += Width * Height * PixelSize; + m_vTextures[Slot].m_MemSize += Width * Height * PixelSize; } - m_pTextureMemoryUsage->store(m_pTextureMemoryUsage->load(std::memory_order_relaxed) + m_Textures[Slot].m_MemSize, std::memory_order_relaxed); + m_pTextureMemoryUsage->store(m_pTextureMemoryUsage->load(std::memory_order_relaxed) + m_vTextures[Slot].m_MemSize, std::memory_order_relaxed); free(pTexData); } @@ -915,7 +915,7 @@ void CCommandProcessorFragment_OpenGL3_3::Cmd_RenderTex3D(const CCommandBuffer:: void CCommandProcessorFragment_OpenGL3_3::DestroyBufferContainer(int Index, bool DeleteBOs) { - SBufferContainer &BufferContainer = m_BufferContainers[Index]; + SBufferContainer &BufferContainer = m_vBufferContainers[Index]; if(BufferContainer.m_VertArrayID != 0) glDeleteVertexArrays(1, &BufferContainer.m_VertArrayID); @@ -925,12 +925,12 @@ void CCommandProcessorFragment_OpenGL3_3::DestroyBufferContainer(int Index, bool int VertBufferID = BufferContainer.m_ContainerInfo.m_VertBufferBindingIndex; if(VertBufferID != -1) { - glDeleteBuffers(1, &m_BufferObjectIndices[VertBufferID]); + glDeleteBuffers(1, &m_vBufferObjectIndices[VertBufferID]); } } BufferContainer.m_LastIndexBufferBound = 0; - BufferContainer.m_ContainerInfo.m_Attributes.clear(); + BufferContainer.m_ContainerInfo.m_vAttributes.clear(); } void CCommandProcessorFragment_OpenGL3_3::AppendIndices(unsigned int NewIndicesCount) @@ -967,7 +967,7 @@ void CCommandProcessorFragment_OpenGL3_3::AppendIndices(unsigned int NewIndicesC for(unsigned int &i : m_LastIndexBufferBound) i = 0; - for(auto &BufferContainer : m_BufferContainers) + for(auto &BufferContainer : m_vBufferContainers) { BufferContainer.m_LastIndexBufferBound = 0; } @@ -981,11 +981,11 @@ void CCommandProcessorFragment_OpenGL3_3::Cmd_CreateBufferObject(const CCommandB void *pUploadData = pCommand->m_pUploadData; int Index = pCommand->m_BufferIndex; // create necessary space - if((size_t)Index >= m_BufferObjectIndices.size()) + if((size_t)Index >= m_vBufferObjectIndices.size()) { - for(int i = m_BufferObjectIndices.size(); i < Index + 1; ++i) + for(int i = m_vBufferObjectIndices.size(); i < Index + 1; ++i) { - m_BufferObjectIndices.push_back(0); + m_vBufferObjectIndices.push_back(0); } } @@ -995,7 +995,7 @@ void CCommandProcessorFragment_OpenGL3_3::Cmd_CreateBufferObject(const CCommandB glBindBuffer(BUFFER_INIT_VERTEX_TARGET, VertBufferID); glBufferData(BUFFER_INIT_VERTEX_TARGET, (GLsizeiptr)(pCommand->m_DataSize), pUploadData, GL_STATIC_DRAW); - m_BufferObjectIndices[Index] = VertBufferID; + m_vBufferObjectIndices[Index] = VertBufferID; if(pCommand->m_DeletePointer) free(pUploadData); @@ -1006,7 +1006,7 @@ void CCommandProcessorFragment_OpenGL3_3::Cmd_RecreateBufferObject(const CComman void *pUploadData = pCommand->m_pUploadData; int Index = pCommand->m_BufferIndex; - glBindBuffer(BUFFER_INIT_VERTEX_TARGET, m_BufferObjectIndices[Index]); + glBindBuffer(BUFFER_INIT_VERTEX_TARGET, m_vBufferObjectIndices[Index]); glBufferData(BUFFER_INIT_VERTEX_TARGET, (GLsizeiptr)(pCommand->m_DataSize), pUploadData, GL_STATIC_DRAW); if(pCommand->m_DeletePointer) @@ -1018,7 +1018,7 @@ void CCommandProcessorFragment_OpenGL3_3::Cmd_UpdateBufferObject(const CCommandB void *pUploadData = pCommand->m_pUploadData; int Index = pCommand->m_BufferIndex; - glBindBuffer(BUFFER_INIT_VERTEX_TARGET, m_BufferObjectIndices[Index]); + glBindBuffer(BUFFER_INIT_VERTEX_TARGET, m_vBufferObjectIndices[Index]); glBufferSubData(BUFFER_INIT_VERTEX_TARGET, (GLintptr)(pCommand->m_pOffset), (GLsizeiptr)(pCommand->m_DataSize), pUploadData); if(pCommand->m_DeletePointer) @@ -1030,8 +1030,8 @@ void CCommandProcessorFragment_OpenGL3_3::Cmd_CopyBufferObject(const CCommandBuf int WriteIndex = pCommand->m_WriteBufferIndex; int ReadIndex = pCommand->m_ReadBufferIndex; - glBindBuffer(GL_COPY_WRITE_BUFFER, m_BufferObjectIndices[WriteIndex]); - glBindBuffer(GL_COPY_READ_BUFFER, m_BufferObjectIndices[ReadIndex]); + glBindBuffer(GL_COPY_WRITE_BUFFER, m_vBufferObjectIndices[WriteIndex]); + glBindBuffer(GL_COPY_READ_BUFFER, m_vBufferObjectIndices[ReadIndex]); glCopyBufferSubData(GL_COPY_READ_BUFFER, GL_COPY_WRITE_BUFFER, (GLsizeiptr)(pCommand->m_pReadOffset), (GLsizeiptr)(pCommand->m_pWriteOffset), (GLsizeiptr)pCommand->m_CopySize); } @@ -1039,25 +1039,25 @@ void CCommandProcessorFragment_OpenGL3_3::Cmd_DeleteBufferObject(const CCommandB { int Index = pCommand->m_BufferIndex; - glDeleteBuffers(1, &m_BufferObjectIndices[Index]); + glDeleteBuffers(1, &m_vBufferObjectIndices[Index]); } void CCommandProcessorFragment_OpenGL3_3::Cmd_CreateBufferContainer(const CCommandBuffer::SCommand_CreateBufferContainer *pCommand) { int Index = pCommand->m_BufferContainerIndex; // create necessary space - if((size_t)Index >= m_BufferContainers.size()) + if((size_t)Index >= m_vBufferContainers.size()) { - for(int i = m_BufferContainers.size(); i < Index + 1; ++i) + for(int i = m_vBufferContainers.size(); i < Index + 1; ++i) { SBufferContainer Container; Container.m_ContainerInfo.m_Stride = 0; Container.m_ContainerInfo.m_VertBufferBindingIndex = -1; - m_BufferContainers.push_back(Container); + m_vBufferContainers.push_back(Container); } } - SBufferContainer &BufferContainer = m_BufferContainers[Index]; + SBufferContainer &BufferContainer = m_vBufferContainers[Index]; glGenVertexArrays(1, &BufferContainer.m_VertArrayID); glBindVertexArray(BufferContainer.m_VertArrayID); @@ -1067,7 +1067,7 @@ void CCommandProcessorFragment_OpenGL3_3::Cmd_CreateBufferContainer(const CComma { glEnableVertexAttribArray((GLuint)i); - glBindBuffer(GL_ARRAY_BUFFER, m_BufferObjectIndices[pCommand->m_VertBufferBindingIndex]); + glBindBuffer(GL_ARRAY_BUFFER, m_vBufferObjectIndices[pCommand->m_VertBufferBindingIndex]); SBufferContainerInfo::SAttribute &Attr = pCommand->m_pAttributes[i]; @@ -1076,7 +1076,7 @@ void CCommandProcessorFragment_OpenGL3_3::Cmd_CreateBufferContainer(const CComma else if(Attr.m_FuncType == 1) glVertexAttribIPointer((GLuint)i, Attr.m_DataTypeCount, Attr.m_Type, pCommand->m_Stride, Attr.m_pOffset); - BufferContainer.m_ContainerInfo.m_Attributes.push_back(Attr); + BufferContainer.m_ContainerInfo.m_vAttributes.push_back(Attr); } BufferContainer.m_ContainerInfo.m_VertBufferBindingIndex = pCommand->m_VertBufferBindingIndex; @@ -1085,29 +1085,29 @@ void CCommandProcessorFragment_OpenGL3_3::Cmd_CreateBufferContainer(const CComma void CCommandProcessorFragment_OpenGL3_3::Cmd_UpdateBufferContainer(const CCommandBuffer::SCommand_UpdateBufferContainer *pCommand) { - SBufferContainer &BufferContainer = m_BufferContainers[pCommand->m_BufferContainerIndex]; + SBufferContainer &BufferContainer = m_vBufferContainers[pCommand->m_BufferContainerIndex]; glBindVertexArray(BufferContainer.m_VertArrayID); // disable all old attributes - for(size_t i = 0; i < BufferContainer.m_ContainerInfo.m_Attributes.size(); ++i) + for(size_t i = 0; i < BufferContainer.m_ContainerInfo.m_vAttributes.size(); ++i) { glDisableVertexAttribArray((GLuint)i); } - BufferContainer.m_ContainerInfo.m_Attributes.clear(); + BufferContainer.m_ContainerInfo.m_vAttributes.clear(); for(int i = 0; i < pCommand->m_AttrCount; ++i) { glEnableVertexAttribArray((GLuint)i); - glBindBuffer(GL_ARRAY_BUFFER, m_BufferObjectIndices[pCommand->m_VertBufferBindingIndex]); + glBindBuffer(GL_ARRAY_BUFFER, m_vBufferObjectIndices[pCommand->m_VertBufferBindingIndex]); SBufferContainerInfo::SAttribute &Attr = pCommand->m_pAttributes[i]; if(Attr.m_FuncType == 0) glVertexAttribPointer((GLuint)i, Attr.m_DataTypeCount, Attr.m_Type, Attr.m_Normalized, pCommand->m_Stride, Attr.m_pOffset); else if(Attr.m_FuncType == 1) glVertexAttribIPointer((GLuint)i, Attr.m_DataTypeCount, Attr.m_Type, pCommand->m_Stride, Attr.m_pOffset); - BufferContainer.m_ContainerInfo.m_Attributes.push_back(Attr); + BufferContainer.m_ContainerInfo.m_vAttributes.push_back(Attr); } BufferContainer.m_ContainerInfo.m_VertBufferBindingIndex = pCommand->m_VertBufferBindingIndex; @@ -1129,10 +1129,10 @@ void CCommandProcessorFragment_OpenGL3_3::Cmd_RenderBorderTile(const CCommandBuf { int Index = pCommand->m_BufferContainerIndex; // if space not there return - if((size_t)Index >= m_BufferContainers.size()) + if((size_t)Index >= m_vBufferContainers.size()) return; - SBufferContainer &BufferContainer = m_BufferContainers[Index]; + SBufferContainer &BufferContainer = m_vBufferContainers[Index]; if(BufferContainer.m_VertArrayID == 0) return; @@ -1165,10 +1165,10 @@ void CCommandProcessorFragment_OpenGL3_3::Cmd_RenderBorderTileLine(const CComman { int Index = pCommand->m_BufferContainerIndex; // if space not there return - if((size_t)Index >= m_BufferContainers.size()) + if((size_t)Index >= m_vBufferContainers.size()) return; - SBufferContainer &BufferContainer = m_BufferContainers[Index]; + SBufferContainer &BufferContainer = m_vBufferContainers[Index]; if(BufferContainer.m_VertArrayID == 0) return; @@ -1199,10 +1199,10 @@ void CCommandProcessorFragment_OpenGL3_3::Cmd_RenderTileLayer(const CCommandBuff { int Index = pCommand->m_BufferContainerIndex; // if space not there return - if((size_t)Index >= m_BufferContainers.size()) + if((size_t)Index >= m_vBufferContainers.size()) return; - SBufferContainer &BufferContainer = m_BufferContainers[Index]; + SBufferContainer &BufferContainer = m_vBufferContainers[Index]; if(BufferContainer.m_VertArrayID == 0) return; @@ -1240,10 +1240,10 @@ void CCommandProcessorFragment_OpenGL3_3::Cmd_RenderQuadLayer(const CCommandBuff { int Index = pCommand->m_BufferContainerIndex; // if space not there return - if((size_t)Index >= m_BufferContainers.size()) + if((size_t)Index >= m_vBufferContainers.size()) return; - SBufferContainer &BufferContainer = m_BufferContainers[Index]; + SBufferContainer &BufferContainer = m_vBufferContainers[Index]; if(BufferContainer.m_VertArrayID == 0) return; @@ -1323,25 +1323,25 @@ void CCommandProcessorFragment_OpenGL3_3::RenderText(const CCommandBuffer::SStat if(!IsAndUpdateTextureSlotBound(SlotText, TextTextureIndex)) { glActiveTexture(GL_TEXTURE0 + SlotText); - glBindTexture(GL_TEXTURE_2D, m_Textures[TextTextureIndex].m_Tex); - glBindSampler(SlotText, m_Textures[TextTextureIndex].m_Sampler); + glBindTexture(GL_TEXTURE_2D, m_vTextures[TextTextureIndex].m_Tex); + glBindSampler(SlotText, m_vTextures[TextTextureIndex].m_Sampler); } if(!IsAndUpdateTextureSlotBound(SlotTextOutline, TextOutlineTextureIndex)) { glActiveTexture(GL_TEXTURE0 + SlotTextOutline); - glBindTexture(GL_TEXTURE_2D, m_Textures[TextOutlineTextureIndex].m_Tex); - glBindSampler(SlotTextOutline, m_Textures[TextOutlineTextureIndex].m_Sampler); + glBindTexture(GL_TEXTURE_2D, m_vTextures[TextOutlineTextureIndex].m_Tex); + glBindSampler(SlotTextOutline, m_vTextures[TextOutlineTextureIndex].m_Sampler); } } else { SlotText = 0; SlotTextOutline = 1; - glBindTexture(GL_TEXTURE_2D, m_Textures[TextTextureIndex].m_Tex); - glBindSampler(SlotText, m_Textures[TextTextureIndex].m_Sampler); + glBindTexture(GL_TEXTURE_2D, m_vTextures[TextTextureIndex].m_Tex); + glBindSampler(SlotText, m_vTextures[TextTextureIndex].m_Sampler); glActiveTexture(GL_TEXTURE1); - glBindTexture(GL_TEXTURE_2D, m_Textures[TextOutlineTextureIndex].m_Tex); - glBindSampler(SlotTextOutline, m_Textures[TextOutlineTextureIndex].m_Sampler); + glBindTexture(GL_TEXTURE_2D, m_vTextures[TextOutlineTextureIndex].m_Tex); + glBindSampler(SlotTextOutline, m_vTextures[TextOutlineTextureIndex].m_Sampler); glActiveTexture(GL_TEXTURE0); } @@ -1390,10 +1390,10 @@ void CCommandProcessorFragment_OpenGL3_3::Cmd_RenderText(const CCommandBuffer::S { int Index = pCommand->m_BufferContainerIndex; // if space not there return - if((size_t)Index >= m_BufferContainers.size()) + if((size_t)Index >= m_vBufferContainers.size()) return; - SBufferContainer &BufferContainer = m_BufferContainers[Index]; + SBufferContainer &BufferContainer = m_vBufferContainers[Index]; if(BufferContainer.m_VertArrayID == 0) return; @@ -1416,10 +1416,10 @@ void CCommandProcessorFragment_OpenGL3_3::Cmd_RenderQuadContainer(const CCommand int Index = pCommand->m_BufferContainerIndex; // if space not there return - if((size_t)Index >= m_BufferContainers.size()) + if((size_t)Index >= m_vBufferContainers.size()) return; - SBufferContainer &BufferContainer = m_BufferContainers[Index]; + SBufferContainer &BufferContainer = m_vBufferContainers[Index]; if(BufferContainer.m_VertArrayID == 0) return; @@ -1448,10 +1448,10 @@ void CCommandProcessorFragment_OpenGL3_3::Cmd_RenderQuadContainerEx(const CComma int Index = pCommand->m_BufferContainerIndex; // if space not there return - if((size_t)Index >= m_BufferContainers.size()) + if((size_t)Index >= m_vBufferContainers.size()) return; - SBufferContainer &BufferContainer = m_BufferContainers[Index]; + SBufferContainer &BufferContainer = m_vBufferContainers[Index]; if(BufferContainer.m_VertArrayID == 0) return; @@ -1513,10 +1513,10 @@ void CCommandProcessorFragment_OpenGL3_3::Cmd_RenderQuadContainerAsSpriteMultipl int Index = pCommand->m_BufferContainerIndex; // if space not there return - if((size_t)Index >= m_BufferContainers.size()) + if((size_t)Index >= m_vBufferContainers.size()) return; - SBufferContainer &BufferContainer = m_BufferContainers[Index]; + SBufferContainer &BufferContainer = m_vBufferContainers[Index]; if(BufferContainer.m_VertArrayID == 0) return; diff --git a/src/engine/client/backend/opengl/backend_opengl3.h b/src/engine/client/backend/opengl/backend_opengl3.h index 72c440eb1..a1eac9fc5 100644 --- a/src/engine/client/backend/opengl/backend_opengl3.h +++ b/src/engine/client/backend/opengl/backend_opengl3.h @@ -64,9 +64,9 @@ protected: TWGLuint m_LastIndexBufferBound; SBufferContainerInfo m_ContainerInfo; }; - std::vector m_BufferContainers; + std::vector m_vBufferContainers; - std::vector m_BufferObjectIndices; + std::vector m_vBufferObjectIndices; CCommandBuffer::SColorf m_ClearColor; diff --git a/src/engine/client/backend/opengl/opengl_sl.cpp b/src/engine/client/backend/opengl/opengl_sl.cpp index 8c0e883d2..2efc1adf8 100644 --- a/src/engine/client/backend/opengl/opengl_sl.cpp +++ b/src/engine/client/backend/opengl/opengl_sl.cpp @@ -71,7 +71,7 @@ bool CGLSL::LoadShader(CGLSLCompiler *pCompiler, IStorage *pStorage, const char } } - for(CGLSLCompiler::SGLSLCompilerDefine &Define : pCompiler->m_Defines) + for(CGLSLCompiler::SGLSLCompilerDefine &Define : pCompiler->m_vDefines) { Lines.push_back(std::string("#define ") + Define.m_DefineName + std::string(" ") + Define.m_DefineValue + std::string("\r\n")); } diff --git a/src/engine/client/backend/vulkan/backend_vulkan.cpp b/src/engine/client/backend/vulkan/backend_vulkan.cpp index 2ad245d3f..3be4a2598 100644 --- a/src/engine/client/backend/vulkan/backend_vulkan.cpp +++ b/src/engine/client/backend/vulkan/backend_vulkan.cpp @@ -149,7 +149,7 @@ class CCommandProcessorFragment_Vulkan : public CCommandProcessorFragment_GLBase struct SDeviceDescriptorPools { - std::vector m_Pools; + std::vector m_vPools; VkDeviceSize m_DefaultAllocSize = 0; bool m_IsUniformPool = false; }; @@ -345,28 +345,28 @@ class CCommandProcessorFragment_Vulkan : public CCommandProcessorFragment_GLBase SDeviceMemoryBlock m_BufferMem; void *m_pMappedBuffer; }; - std::vector m_MemoryHeaps; + std::vector m_vpMemoryHeaps; }; SMemoryCacheType m_MemoryCaches; - std::vector>> m_FrameDelayedCachedBufferCleanup; + std::vector>> m_vvFrameDelayedCachedBufferCleanup; bool m_CanShrink = false; void Init(size_t SwapChainImageCount) { - m_FrameDelayedCachedBufferCleanup.resize(SwapChainImageCount); + m_vvFrameDelayedCachedBufferCleanup.resize(SwapChainImageCount); } void DestroyFrameData(size_t ImageCount) { for(size_t i = 0; i < ImageCount; ++i) Cleanup(i); - m_FrameDelayedCachedBufferCleanup.clear(); + m_vvFrameDelayedCachedBufferCleanup.clear(); } void Destroy(VkDevice &Device) { - for(auto it = m_MemoryCaches.m_MemoryHeaps.begin(); it != m_MemoryCaches.m_MemoryHeaps.end();) + for(auto it = m_MemoryCaches.m_vpMemoryHeaps.begin(); it != m_MemoryCaches.m_vpMemoryHeaps.end();) { auto *pHeap = *it; if(pHeap->m_pMappedBuffer != nullptr) @@ -376,28 +376,28 @@ class CCommandProcessorFragment_Vulkan : public CCommandProcessorFragment_GLBase vkFreeMemory(Device, pHeap->m_BufferMem.m_Mem, nullptr); delete pHeap; - it = m_MemoryCaches.m_MemoryHeaps.erase(it); + it = m_MemoryCaches.m_vpMemoryHeaps.erase(it); } - m_MemoryCaches.m_MemoryHeaps.clear(); - m_FrameDelayedCachedBufferCleanup.clear(); + m_MemoryCaches.m_vpMemoryHeaps.clear(); + m_vvFrameDelayedCachedBufferCleanup.clear(); } void Cleanup(size_t ImgIndex) { - for(auto &MemBlock : m_FrameDelayedCachedBufferCleanup[ImgIndex]) + for(auto &MemBlock : m_vvFrameDelayedCachedBufferCleanup[ImgIndex]) { MemBlock.m_UsedSize = 0; MemBlock.m_pHeap->Free(MemBlock.m_HeapData); m_CanShrink = true; } - m_FrameDelayedCachedBufferCleanup[ImgIndex].clear(); + m_vvFrameDelayedCachedBufferCleanup[ImgIndex].clear(); } void FreeMemBlock(SMemoryBlock &Block, size_t ImgIndex) { - m_FrameDelayedCachedBufferCleanup[ImgIndex].push_back(Block); + m_vvFrameDelayedCachedBufferCleanup[ImgIndex].push_back(Block); } // returns the total free'd memory @@ -407,9 +407,9 @@ class CCommandProcessorFragment_Vulkan : public CCommandProcessorFragment_GLBase if(m_CanShrink) { m_CanShrink = false; - if(m_MemoryCaches.m_MemoryHeaps.size() > 1) + if(m_MemoryCaches.m_vpMemoryHeaps.size() > 1) { - for(auto it = m_MemoryCaches.m_MemoryHeaps.begin(); it != m_MemoryCaches.m_MemoryHeaps.end();) + for(auto it = m_MemoryCaches.m_vpMemoryHeaps.begin(); it != m_MemoryCaches.m_vpMemoryHeaps.end();) { auto *pHeap = *it; if(pHeap->m_Heap.IsUnused()) @@ -422,8 +422,8 @@ class CCommandProcessorFragment_Vulkan : public CCommandProcessorFragment_GLBase FreeedMemory += pHeap->m_BufferMem.m_Size; delete pHeap; - it = m_MemoryCaches.m_MemoryHeaps.erase(it); - if(m_MemoryCaches.m_MemoryHeaps.size() == 1) + it = m_MemoryCaches.m_vpMemoryHeaps.erase(it); + if(m_MemoryCaches.m_vpMemoryHeaps.size() == 1) break; } else @@ -840,7 +840,7 @@ class CCommandProcessorFragment_Vulkan : public CCommandProcessorFragment_GLBase struct SShaderFileCache { - std::vector m_Binary; + std::vector m_vBinary; }; struct SSwapImgViewportExtent @@ -884,9 +884,9 @@ class CCommandProcessorFragment_Vulkan : public CCommandProcessorFragment_GLBase SMemoryBlockCache m_VertexBufferCache; std::map> m_ImageBufferCaches; - std::vector m_NonFlushedStagingBufferRange; + std::vector m_vNonFlushedStagingBufferRange; - std::vector m_Textures; + std::vector m_vTextures; std::atomic *m_pTextureMemoryUsage; std::atomic *m_pBufferMemoryUsage; @@ -927,7 +927,7 @@ class CCommandProcessorFragment_Vulkan : public CCommandProcessorFragment_GLBase uint32_t m_MinUniformAlign; - std::vector m_ScreenshotHelper; + std::vector m_vScreenshotHelper; SDeviceMemoryBlock m_GetPresentedImgDataHelperMem; VkImage m_GetPresentedImgDataHelperImage = VK_NULL_HANDLE; @@ -949,9 +949,9 @@ class CCommandProcessorFragment_Vulkan : public CCommandProcessorFragment_GLBase void *m_pMappedData = nullptr; }; - std::vector> m_FrameDelayedBufferCleanup; - std::vector> m_FrameDelayedTextureCleanup; - std::vector>> m_FrameDelayedTextTexturesCleanup; + std::vector> m_vvFrameDelayedBufferCleanup; + std::vector> m_vvFrameDelayedTextureCleanup; + std::vector>> m_vvFrameDelayedTextTexturesCleanup; size_t m_ThreadCount = 1; static constexpr size_t ms_MainThreadIndex = 0; @@ -970,38 +970,38 @@ class CCommandProcessorFragment_Vulkan : public CCommandProcessorFragment_GLBase bool m_Finished = false; bool m_Started = false; }; - std::vector> m_RenderThreads; + std::vector> m_vpRenderThreads; private: - std::vector m_SwapChainImageViewList; - std::vector m_SwapChainMultiSamplingImages; - std::vector m_FramebufferList; - std::vector m_MainDrawCommandBuffers; + std::vector m_vSwapChainImageViewList; + std::vector m_vSwapChainMultiSamplingImages; + std::vector m_vFramebufferList; + std::vector m_vMainDrawCommandBuffers; - std::vector> m_ThreadDrawCommandBuffers; - std::vector m_HelperThreadDrawCommandBuffers; - std::vector> m_UsedThreadDrawCommandBuffer; + std::vector> m_vvThreadDrawCommandBuffers; + std::vector m_vHelperThreadDrawCommandBuffers; + std::vector> m_vvUsedThreadDrawCommandBuffer; - std::vector m_MemoryCommandBuffers; - std::vector m_UsedMemoryCommandBuffer; + std::vector m_vMemoryCommandBuffers; + std::vector m_vUsedMemoryCommandBuffer; // swapped by use case - std::vector m_WaitSemaphores; - std::vector m_SigSemaphores; + std::vector m_vWaitSemaphores; + std::vector m_vSigSemaphores; - std::vector m_MemorySemaphores; + std::vector m_vMemorySemaphores; - std::vector m_FrameFences; - std::vector m_ImagesFences; + std::vector m_vFrameFences; + std::vector m_vImagesFences; uint64_t m_CurFrame = 0; - std::vector m_ImageLastFrameCheck; + std::vector m_vImageLastFrameCheck; uint32_t m_LastPresentedSwapChainImageIndex; - std::vector m_BufferObjects; + std::vector m_vBufferObjects; - std::vector m_BufferContainers; + std::vector m_vBufferContainers; VkInstance m_VKInstance; VkPhysicalDevice m_VKGPU; @@ -1048,10 +1048,10 @@ private: SDeviceDescriptorPools m_StandardTextureDescrPool; SDeviceDescriptorPools m_TextTextureDescrPool; - std::vector m_UniformBufferDescrPools; + std::vector m_vUniformBufferDescrPools; VkSwapchainKHR m_VKSwapChain = VK_NULL_HANDLE; - std::vector m_SwapChainImages; + std::vector m_vSwapChainImages; uint32_t m_SwapChainImageCount = 0; std::vector> m_vStreamedVertexBuffers; @@ -1093,8 +1093,8 @@ private: typedef std::vector TCommandList; typedef std::vector TThreadCommandList; - TThreadCommandList m_ThreadCommandLists; - std::vector m_ThreadHelperHadCommands; + TThreadCommandList m_vvThreadCommandLists; + std::vector m_vThreadHelperHadCommands; typedef std::function TCommandBufferCommandCallback; typedef std::function TCommandBufferFillExecuteBufferFunc; @@ -1374,7 +1374,7 @@ protected: Region.imageOffset = {0, 0, 0}; Region.imageExtent = {Viewport.width, Viewport.height, 1}; - auto &SwapImg = m_SwapChainImages[m_LastPresentedSwapChainImageIndex]; + auto &SwapImg = m_vSwapChainImages[m_LastPresentedSwapChainImageIndex]; ImageBarrier(m_GetPresentedImgDataHelperImage, 0, 1, 0, 1, VK_FORMAT_R8G8B8A8_UNORM, VK_IMAGE_LAYOUT_GENERAL, VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL); ImageBarrier(SwapImg, 0, 1, 0, 1, m_VKSurfFormat.format, VK_IMAGE_LAYOUT_PRESENT_SRC_KHR, VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL); @@ -1424,7 +1424,7 @@ protected: ImageBarrier(SwapImg, 0, 1, 0, 1, m_VKSurfFormat.format, VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL, VK_IMAGE_LAYOUT_PRESENT_SRC_KHR); vkEndCommandBuffer(CommandBuffer); - m_UsedMemoryCommandBuffer[m_CurImageIndex] = false; + m_vUsedMemoryCommandBuffer[m_CurImageIndex] = false; VkSubmitInfo SubmitInfo{}; SubmitInfo.sType = VK_STRUCTURE_TYPE_SUBMIT_INFO; @@ -1553,7 +1553,7 @@ protected: SMemoryHeap::SMemoryHeapQueueElement AllocatedMem; SDeviceMemoryBlock TmpBufferMemory; typename SMemoryBlockCache::SMemoryCacheType::SMemoryCacheHeap *pCacheHeap = nullptr; - auto &Heaps = MemoryCache.m_MemoryCaches.m_MemoryHeaps; + auto &Heaps = MemoryCache.m_MemoryCaches.m_vpMemoryHeaps; for(size_t i = 0; i < Heaps.size(); ++i) { auto *pHeap = Heaps[i]; @@ -1668,7 +1668,7 @@ protected: if(UploadRange.offset + UploadRange.size > Block.m_BufferMem.m_Size) UploadRange.size = VK_WHOLE_SIZE; - m_NonFlushedStagingBufferRange.push_back(UploadRange); + m_vNonFlushedStagingBufferRange.push_back(UploadRange); } void UploadAndFreeStagingMemBlock(SMemoryBlock &Block) @@ -1676,7 +1676,7 @@ protected: PrepareStagingMemRange(Block); if(!Block.m_IsCached) { - m_FrameDelayedBufferCleanup[m_CurImageIndex].push_back({Block.m_Buffer, Block.m_BufferMem, Block.m_pMappedBuffer}); + m_vvFrameDelayedBufferCleanup[m_CurImageIndex].push_back({Block.m_Buffer, Block.m_BufferMem, Block.m_pMappedBuffer}); } else { @@ -1689,7 +1689,7 @@ protected: PrepareStagingMemRange(Block); if(!Block.m_IsCached) { - m_FrameDelayedBufferCleanup[m_CurImageIndex].push_back({Block.m_Buffer, Block.m_BufferMem, Block.m_pMappedBuffer}); + m_vvFrameDelayedBufferCleanup[m_CurImageIndex].push_back({Block.m_Buffer, Block.m_BufferMem, Block.m_pMappedBuffer}); } else { @@ -1706,7 +1706,7 @@ protected: { if(!Block.m_IsCached) { - m_FrameDelayedBufferCleanup[m_CurImageIndex].push_back({Block.m_Buffer, Block.m_BufferMem, nullptr}); + m_vvFrameDelayedBufferCleanup[m_CurImageIndex].push_back({Block.m_Buffer, Block.m_BufferMem, nullptr}); } else { @@ -1764,9 +1764,9 @@ protected: SMemoryHeap::SMemoryHeapQueueElement AllocatedMem; SDeviceMemoryBlock TmpBufferMemory; typename SMemoryBlockCache::SMemoryCacheType::SMemoryCacheHeap *pCacheHeap = nullptr; - for(size_t i = 0; i < MemoryCache.m_MemoryCaches.m_MemoryHeaps.size(); ++i) + for(size_t i = 0; i < MemoryCache.m_MemoryCaches.m_vpMemoryHeaps.size(); ++i) { - auto *pHeap = MemoryCache.m_MemoryCaches.m_MemoryHeaps[i]; + auto *pHeap = MemoryCache.m_MemoryCaches.m_vpMemoryHeaps[i]; if(pHeap->m_Heap.Allocate(RequiredSize, RequiredAlignment, AllocatedMem)) { TmpBufferMemory = pHeap->m_BufferMem; @@ -1786,7 +1786,7 @@ protected: pNewHeap->m_BufferMem = TmpBufferMemory; pNewHeap->m_pMappedBuffer = nullptr; - auto &Heaps = MemoryCache.m_MemoryCaches.m_MemoryHeaps; + auto &Heaps = MemoryCache.m_MemoryCaches.m_vpMemoryHeaps; pCacheHeap = pNewHeap; Heaps.emplace_back(pNewHeap); Heaps.back()->m_Heap.Init(MemoryBlockSize * BlockCount, 0); @@ -1845,7 +1845,7 @@ protected: { if(!Block.m_IsCached) { - m_FrameDelayedBufferCleanup[m_CurImageIndex].push_back({Block.m_Buffer, Block.m_BufferMem, nullptr}); + m_vvFrameDelayedBufferCleanup[m_CurImageIndex].push_back({Block.m_Buffer, Block.m_BufferMem, nullptr}); } else { @@ -1965,7 +1965,7 @@ protected: UploadStagingBuffers(); // clear pending buffers, that require deletion - for(auto &BufferPair : m_FrameDelayedBufferCleanup[FrameImageIndex]) + for(auto &BufferPair : m_vvFrameDelayedBufferCleanup[FrameImageIndex]) { if(BufferPair.m_pMappedData != nullptr) { @@ -1973,20 +1973,20 @@ protected: } CleanBufferPair(FrameImageIndex, BufferPair.m_Buffer, BufferPair.m_Mem); } - m_FrameDelayedBufferCleanup[FrameImageIndex].clear(); + m_vvFrameDelayedBufferCleanup[FrameImageIndex].clear(); // clear pending textures, that require deletion - for(auto &Texture : m_FrameDelayedTextureCleanup[FrameImageIndex]) + for(auto &Texture : m_vvFrameDelayedTextureCleanup[FrameImageIndex]) { DestroyTexture(Texture); } - m_FrameDelayedTextureCleanup[FrameImageIndex].clear(); + m_vvFrameDelayedTextureCleanup[FrameImageIndex].clear(); - for(auto &TexturePair : m_FrameDelayedTextTexturesCleanup[FrameImageIndex]) + for(auto &TexturePair : m_vvFrameDelayedTextTexturesCleanup[FrameImageIndex]) { DestroyTextTexture(TexturePair.first, TexturePair.second); } - m_FrameDelayedTextTexturesCleanup[FrameImageIndex].clear(); + m_vvFrameDelayedTextTexturesCleanup[FrameImageIndex].clear(); m_StagingBufferCache.Cleanup(FrameImageIndex); m_StagingBufferCacheImage.Cleanup(FrameImageIndex); @@ -2078,11 +2078,11 @@ protected: void StartRenderThread(size_t ThreadIndex) { - auto &List = m_ThreadCommandLists[ThreadIndex]; + auto &List = m_vvThreadCommandLists[ThreadIndex]; if(!List.empty()) { - m_ThreadHelperHadCommands[ThreadIndex] = true; - auto *pThread = m_RenderThreads[ThreadIndex].get(); + m_vThreadHelperHadCommands[ThreadIndex] = true; + auto *pThread = m_vpRenderThreads[ThreadIndex].get(); std::unique_lock Lock(pThread->m_Mutex); pThread->m_IsRendering = true; pThread->m_Cond.notify_one(); @@ -2097,7 +2097,7 @@ protected: for(size_t ThreadIndex = 0; ThreadIndex < m_ThreadCount - 1; ++ThreadIndex) { - if(!m_ThreadHelperHadCommands[ThreadIndex]) + if(!m_vThreadHelperHadCommands[ThreadIndex]) { StartRenderThread(ThreadIndex); } @@ -2105,10 +2105,10 @@ protected: for(size_t ThreadIndex = 0; ThreadIndex < m_ThreadCount - 1; ++ThreadIndex) { - if(m_ThreadHelperHadCommands[ThreadIndex]) + if(m_vThreadHelperHadCommands[ThreadIndex]) { - auto &pRenderThread = m_RenderThreads[ThreadIndex]; - m_ThreadHelperHadCommands[ThreadIndex] = false; + auto &pRenderThread = m_vpRenderThreads[ThreadIndex]; + m_vThreadHelperHadCommands[ThreadIndex] = false; std::unique_lock Lock(pRenderThread->m_Mutex); pRenderThread->m_Cond.wait(Lock, [&pRenderThread] { return !pRenderThread->m_IsRendering; }); m_vLastPipeline[ThreadIndex + 1] = VK_NULL_HANDLE; @@ -2119,9 +2119,9 @@ protected: void ExecuteMemoryCommandBuffer() { - if(m_UsedMemoryCommandBuffer[m_CurImageIndex]) + if(m_vUsedMemoryCommandBuffer[m_CurImageIndex]) { - auto &MemoryCommandBuffer = m_MemoryCommandBuffers[m_CurImageIndex]; + auto &MemoryCommandBuffer = m_vMemoryCommandBuffers[m_CurImageIndex]; vkEndCommandBuffer(MemoryCommandBuffer); VkSubmitInfo SubmitInfo{}; @@ -2132,7 +2132,7 @@ protected: vkQueueSubmit(m_VKGraphicsQueue, 1, &SubmitInfo, VK_NULL_HANDLE); vkQueueWaitIdle(m_VKGraphicsQueue); - m_UsedMemoryCommandBuffer[m_CurImageIndex] = false; + m_vUsedMemoryCommandBuffer[m_CurImageIndex] = false; } } @@ -2158,29 +2158,29 @@ protected: size_t RenderThreadCount = m_ThreadCount - 1; for(size_t i = 0; i < RenderThreadCount; ++i) { - if(m_UsedThreadDrawCommandBuffer[i + 1][m_CurImageIndex]) + if(m_vvUsedThreadDrawCommandBuffer[i + 1][m_CurImageIndex]) { - auto &GraphicThreadCommandBuffer = m_ThreadDrawCommandBuffers[i + 1][m_CurImageIndex]; - m_HelperThreadDrawCommandBuffers[ThreadedCommandsUsedCount++] = GraphicThreadCommandBuffer; + auto &GraphicThreadCommandBuffer = m_vvThreadDrawCommandBuffers[i + 1][m_CurImageIndex]; + m_vHelperThreadDrawCommandBuffers[ThreadedCommandsUsedCount++] = GraphicThreadCommandBuffer; - m_UsedThreadDrawCommandBuffer[i + 1][m_CurImageIndex] = false; + m_vvUsedThreadDrawCommandBuffer[i + 1][m_CurImageIndex] = false; } } if(ThreadedCommandsUsedCount > 0) { - vkCmdExecuteCommands(CommandBuffer, ThreadedCommandsUsedCount, m_HelperThreadDrawCommandBuffers.data()); + vkCmdExecuteCommands(CommandBuffer, ThreadedCommandsUsedCount, m_vHelperThreadDrawCommandBuffers.data()); } // special case if swap chain was not completed in one runbuffer call - if(m_UsedThreadDrawCommandBuffer[0][m_CurImageIndex]) + if(m_vvUsedThreadDrawCommandBuffer[0][m_CurImageIndex]) { - auto &GraphicThreadCommandBuffer = m_ThreadDrawCommandBuffers[0][m_CurImageIndex]; + auto &GraphicThreadCommandBuffer = m_vvThreadDrawCommandBuffers[0][m_CurImageIndex]; vkEndCommandBuffer(GraphicThreadCommandBuffer); vkCmdExecuteCommands(CommandBuffer, 1, &GraphicThreadCommandBuffer); - m_UsedThreadDrawCommandBuffer[0][m_CurImageIndex] = false; + m_vvUsedThreadDrawCommandBuffer[0][m_CurImageIndex] = false; } } @@ -2191,7 +2191,7 @@ protected: SetError("Command buffer cannot be ended anymore."); } - VkSemaphore WaitSemaphore = m_WaitSemaphores[m_CurFrames]; + VkSemaphore WaitSemaphore = m_vWaitSemaphores[m_CurFrames]; VkSubmitInfo SubmitInfo{}; SubmitInfo.sType = VK_STRUCTURE_TYPE_SUBMIT_INFO; @@ -2201,9 +2201,9 @@ protected: std::array aCommandBuffers = {}; - if(m_UsedMemoryCommandBuffer[m_CurImageIndex]) + if(m_vUsedMemoryCommandBuffer[m_CurImageIndex]) { - auto &MemoryCommandBuffer = m_MemoryCommandBuffers[m_CurImageIndex]; + auto &MemoryCommandBuffer = m_vMemoryCommandBuffers[m_CurImageIndex]; vkEndCommandBuffer(MemoryCommandBuffer); aCommandBuffers[0] = MemoryCommandBuffer; @@ -2211,7 +2211,7 @@ protected: SubmitInfo.commandBufferCount = 2; SubmitInfo.pCommandBuffers = aCommandBuffers.data(); - m_UsedMemoryCommandBuffer[m_CurImageIndex] = false; + m_vUsedMemoryCommandBuffer[m_CurImageIndex] = false; } std::array aWaitSemaphores = {WaitSemaphore}; @@ -2220,13 +2220,13 @@ protected: SubmitInfo.pWaitSemaphores = aWaitSemaphores.data(); SubmitInfo.pWaitDstStageMask = aWaitStages.data(); - std::array aSignalSemaphores = {m_SigSemaphores[m_CurFrames]}; + std::array aSignalSemaphores = {m_vSigSemaphores[m_CurFrames]}; SubmitInfo.signalSemaphoreCount = aSignalSemaphores.size(); SubmitInfo.pSignalSemaphores = aSignalSemaphores.data(); - vkResetFences(m_VKDevice, 1, &m_FrameFences[m_CurFrames]); + vkResetFences(m_VKDevice, 1, &m_vFrameFences[m_CurFrames]); - VkResult QueueSubmitRes = vkQueueSubmit(m_VKGraphicsQueue, 1, &SubmitInfo, m_FrameFences[m_CurFrames]); + VkResult QueueSubmitRes = vkQueueSubmit(m_VKGraphicsQueue, 1, &SubmitInfo, m_vFrameFences[m_CurFrames]); if(QueueSubmitRes != VK_SUCCESS) { const char *pCritErrorMsg = CheckVulkanCriticalError(QueueSubmitRes); @@ -2234,7 +2234,7 @@ protected: SetError("Submitting to graphics queue failed.", pCritErrorMsg); } - std::swap(m_WaitSemaphores[m_CurFrames], m_SigSemaphores[m_CurFrames]); + std::swap(m_vWaitSemaphores[m_CurFrames], m_vSigSemaphores[m_CurFrames]); VkPresentInfoKHR PresentInfo{}; PresentInfo.sType = VK_STRUCTURE_TYPE_PRESENT_INFO_KHR; @@ -2273,7 +2273,7 @@ protected: RecreateSwapChain(); } - auto AcqResult = vkAcquireNextImageKHR(m_VKDevice, m_VKSwapChain, std::numeric_limits::max(), m_SigSemaphores[m_CurFrames], VK_NULL_HANDLE, &m_CurImageIndex); + auto AcqResult = vkAcquireNextImageKHR(m_VKDevice, m_VKSwapChain, std::numeric_limits::max(), m_vSigSemaphores[m_CurFrames], VK_NULL_HANDLE, &m_CurImageIndex); if(AcqResult != VK_SUCCESS) { if(AcqResult == VK_ERROR_OUT_OF_DATE_KHR || m_RecreateSwapChain) @@ -2302,31 +2302,31 @@ protected: } } } - std::swap(m_WaitSemaphores[m_CurFrames], m_SigSemaphores[m_CurFrames]); + std::swap(m_vWaitSemaphores[m_CurFrames], m_vSigSemaphores[m_CurFrames]); - if(m_ImagesFences[m_CurImageIndex] != VK_NULL_HANDLE) + if(m_vImagesFences[m_CurImageIndex] != VK_NULL_HANDLE) { - vkWaitForFences(m_VKDevice, 1, &m_ImagesFences[m_CurImageIndex], VK_TRUE, std::numeric_limits::max()); + vkWaitForFences(m_VKDevice, 1, &m_vImagesFences[m_CurImageIndex], VK_TRUE, std::numeric_limits::max()); } - m_ImagesFences[m_CurImageIndex] = m_FrameFences[m_CurFrames]; + m_vImagesFences[m_CurImageIndex] = m_vFrameFences[m_CurFrames]; // next frame m_CurFrame++; - m_ImageLastFrameCheck[m_CurImageIndex] = m_CurFrame; + m_vImageLastFrameCheck[m_CurImageIndex] = m_CurFrame; // check if older frames weren't used in a long time - for(size_t FrameImageIndex = 0; FrameImageIndex < m_ImageLastFrameCheck.size(); ++FrameImageIndex) + for(size_t FrameImageIndex = 0; FrameImageIndex < m_vImageLastFrameCheck.size(); ++FrameImageIndex) { - auto LastFrame = m_ImageLastFrameCheck[FrameImageIndex]; + auto LastFrame = m_vImageLastFrameCheck[FrameImageIndex]; if(m_CurFrame - LastFrame > (uint64_t)m_SwapChainImageCount) { - if(m_ImagesFences[FrameImageIndex] != VK_NULL_HANDLE) + if(m_vImagesFences[FrameImageIndex] != VK_NULL_HANDLE) { - vkWaitForFences(m_VKDevice, 1, &m_ImagesFences[FrameImageIndex], VK_TRUE, std::numeric_limits::max()); + vkWaitForFences(m_VKDevice, 1, &m_vImagesFences[FrameImageIndex], VK_TRUE, std::numeric_limits::max()); ClearFrameData(FrameImageIndex); - m_ImagesFences[FrameImageIndex] = VK_NULL_HANDLE; + m_vImagesFences[FrameImageIndex] = VK_NULL_HANDLE; } - m_ImageLastFrameCheck[FrameImageIndex] = m_CurFrame; + m_vImageLastFrameCheck[FrameImageIndex] = m_CurFrame; } } @@ -2349,7 +2349,7 @@ protected: VkRenderPassBeginInfo RenderPassInfo{}; RenderPassInfo.sType = VK_STRUCTURE_TYPE_RENDER_PASS_BEGIN_INFO; RenderPassInfo.renderPass = m_VKRenderPass; - RenderPassInfo.framebuffer = m_FramebufferList[m_CurImageIndex]; + RenderPassInfo.framebuffer = m_vFramebufferList[m_CurImageIndex]; RenderPassInfo.renderArea.offset = {0, 0}; RenderPassInfo.renderArea.extent = m_VKSwapImgAndViewportExtent.m_SwapImageViewport; @@ -2365,11 +2365,11 @@ protected: void UploadStagingBuffers() { - if(!m_NonFlushedStagingBufferRange.empty()) + if(!m_vNonFlushedStagingBufferRange.empty()) { - vkFlushMappedMemoryRanges(m_VKDevice, m_NonFlushedStagingBufferRange.size(), m_NonFlushedStagingBufferRange.data()); + vkFlushMappedMemoryRanges(m_VKDevice, m_vNonFlushedStagingBufferRange.size(), m_vNonFlushedStagingBufferRange.data()); - m_NonFlushedStagingBufferRange.clear(); + m_vNonFlushedStagingBufferRange.clear(); } } @@ -2430,7 +2430,7 @@ protected: size_t ImageSize = Width * Height * ColorChannelCount; auto StagingBuffer = GetStagingBufferImage(pData, ImageSize); - auto &Tex = m_Textures[TextureSlot]; + auto &Tex = m_vTextures[TextureSlot]; if(Tex.m_RescaleCount > 0) { @@ -2472,9 +2472,9 @@ protected: size_t ImageIndex = (size_t)Slot; int ImageColorChannels = VulkanFormatToImageColorChannelCount(Format); - while(ImageIndex >= m_Textures.size()) + while(ImageIndex >= m_vTextures.size()) { - m_Textures.resize((m_Textures.size() * 2) + 1); + m_vTextures.resize((m_vTextures.size() * 2) + 1); } // resample if needed @@ -2506,7 +2506,7 @@ protected: MipMapLevelCount = 1; } - CTexture &Texture = m_Textures[ImageIndex]; + CTexture &Texture = m_vTextures[ImageIndex]; Texture.m_Width = Width; Texture.m_Height = Height; @@ -2944,11 +2944,11 @@ protected: pUploadData = pUploadDataTmp; } - while(BufferIndex >= m_BufferObjects.size()) + while(BufferIndex >= m_vBufferObjects.size()) { - m_BufferObjects.resize((m_BufferObjects.size() * 2) + 1); + m_vBufferObjects.resize((m_vBufferObjects.size() * 2) + 1); } - auto &BufferObject = m_BufferObjects[BufferIndex]; + auto &BufferObject = m_vBufferObjects[BufferIndex]; VkBuffer VertexBuffer; size_t BufferOffset = 0; @@ -2982,7 +2982,7 @@ protected: void DeleteBufferObject(size_t BufferIndex) { - auto &BufferObject = m_BufferObjects[BufferIndex]; + auto &BufferObject = m_vBufferObjects[BufferIndex]; if(!BufferObject.m_IsStreamedBuffer) { FreeVertexMemBlock(BufferObject.m_BufferObject.m_Mem); @@ -3202,8 +3202,8 @@ protected: void RenderTileLayer_FillExecuteBuffer(SRenderCommandExecuteBuffer &ExecBuffer, size_t DrawCalls, const CCommandBuffer::SState &State, size_t BufferContainerIndex) { - size_t BufferObjectIndex = (size_t)m_BufferContainers[BufferContainerIndex].m_BufferObjectIndex; - auto &BufferObject = m_BufferObjects[BufferObjectIndex]; + size_t BufferObjectIndex = (size_t)m_vBufferContainers[BufferContainerIndex].m_BufferObjectIndex; + auto &BufferObject = m_vBufferObjects[BufferObjectIndex]; ExecBuffer.m_Buffer = BufferObject.m_CurBuffer; ExecBuffer.m_BufferOff = BufferObject.m_CurBufferOffset; @@ -3211,7 +3211,7 @@ protected: bool IsTextured = GetIsTextured(State); if(IsTextured) { - auto &DescrSet = m_Textures[State.m_Texture].m_VKStandard3DTexturedDescrSet; + auto &DescrSet = m_vTextures[State.m_Texture].m_VKStandard3DTexturedDescrSet; ExecBuffer.m_aDescriptors[0] = DescrSet; } @@ -3343,14 +3343,14 @@ protected: public: CCommandProcessorFragment_Vulkan() { - m_Textures.reserve(CCommandBuffer::MAX_TEXTURES); + m_vTextures.reserve(CCommandBuffer::MAX_TEXTURES); } /************************ * VULKAN SETUP CODE ************************/ - bool GetVulkanExtensions(SDL_Window *pWindow, std::vector &VKExtensions) + bool GetVulkanExtensions(SDL_Window *pWindow, std::vector &vVKExtensions) { unsigned int ExtCount = 0; if(!SDL_Vulkan_GetInstanceExtensions(pWindow, &ExtCount, nullptr)) @@ -3359,8 +3359,8 @@ public: return false; } - std::vector ExtensionList(ExtCount); - if(!SDL_Vulkan_GetInstanceExtensions(pWindow, &ExtCount, ExtensionList.data())) + std::vector vExtensionList(ExtCount); + if(!SDL_Vulkan_GetInstanceExtensions(pWindow, &ExtCount, vExtensionList.data())) { SetError("Could not get instance extensions from SDL."); return false; @@ -3368,7 +3368,7 @@ public: for(uint32_t i = 0; i < ExtCount; i++) { - VKExtensions.emplace_back(ExtensionList[i]); + vVKExtensions.emplace_back(vExtensionList[i]); } return true; @@ -3397,15 +3397,15 @@ public: std::vector OurImageUsages() { - std::vector ImgUsages; + std::vector vImgUsages; - ImgUsages.emplace_back(VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT); - ImgUsages.emplace_back(VK_IMAGE_USAGE_TRANSFER_SRC_BIT); + vImgUsages.emplace_back(VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT); + vImgUsages.emplace_back(VK_IMAGE_USAGE_TRANSFER_SRC_BIT); - return ImgUsages; + return vImgUsages; } - bool GetVulkanLayers(std::vector &VKLayers) + bool GetVulkanLayers(std::vector &vVKLayers) { uint32_t LayerCount = 0; VkResult Res = vkEnumerateInstanceLayerProperties(&LayerCount, NULL); @@ -3415,8 +3415,8 @@ public: return false; } - std::vector VKInstanceLayers(LayerCount); - Res = vkEnumerateInstanceLayerProperties(&LayerCount, VKInstanceLayers.data()); + std::vector vVKInstanceLayers(LayerCount); + Res = vkEnumerateInstanceLayerProperties(&LayerCount, vVKInstanceLayers.data()); if(Res != VK_SUCCESS) { SetError("Could not get vulkan layers."); @@ -3424,36 +3424,36 @@ public: } std::set ReqLayerNames = OurVKLayers(); - VKLayers.clear(); - for(const auto &LayerName : VKInstanceLayers) + vVKLayers.clear(); + for(const auto &LayerName : vVKInstanceLayers) { auto it = ReqLayerNames.find(std::string(LayerName.layerName)); if(it != ReqLayerNames.end()) { - VKLayers.emplace_back(LayerName.layerName); + vVKLayers.emplace_back(LayerName.layerName); } } return true; } - bool CreateVulkanInstance(const std::vector &VKLayers, const std::vector &VKExtensions, bool TryDebugExtensions) + bool CreateVulkanInstance(const std::vector &vVKLayers, const std::vector &vVKExtensions, bool TryDebugExtensions) { - std::vector LayersCStr; - LayersCStr.reserve(VKLayers.size()); - for(const auto &Layer : VKLayers) - LayersCStr.emplace_back(Layer.c_str()); + std::vector vLayersCStr; + vLayersCStr.reserve(vVKLayers.size()); + for(const auto &Layer : vVKLayers) + vLayersCStr.emplace_back(Layer.c_str()); - std::vector ExtCStr; - ExtCStr.reserve(VKExtensions.size() + 1); - for(const auto &Ext : VKExtensions) - ExtCStr.emplace_back(Ext.c_str()); + std::vector vExtCStr; + vExtCStr.reserve(vVKExtensions.size() + 1); + for(const auto &Ext : vVKExtensions) + vExtCStr.emplace_back(Ext.c_str()); #ifdef VK_EXT_debug_utils if(TryDebugExtensions && (g_Config.m_DbgGfx == DEBUG_GFX_MODE_MINIMUM || g_Config.m_DbgGfx == DEBUG_GFX_MODE_ALL)) { // debug message support - ExtCStr.emplace_back(VK_EXT_DEBUG_UTILS_EXTENSION_NAME); + vExtCStr.emplace_back(VK_EXT_DEBUG_UTILS_EXTENSION_NAME); } #endif @@ -3485,10 +3485,10 @@ public: VKInstanceInfo.pNext = pExt; VKInstanceInfo.flags = 0; VKInstanceInfo.pApplicationInfo = &VKAppInfo; - VKInstanceInfo.enabledExtensionCount = static_cast(ExtCStr.size()); - VKInstanceInfo.ppEnabledExtensionNames = ExtCStr.data(); - VKInstanceInfo.enabledLayerCount = static_cast(LayersCStr.size()); - VKInstanceInfo.ppEnabledLayerNames = LayersCStr.data(); + VKInstanceInfo.enabledExtensionCount = static_cast(vExtCStr.size()); + VKInstanceInfo.ppEnabledExtensionNames = vExtCStr.data(); + VKInstanceInfo.enabledLayerCount = static_cast(vLayersCStr.size()); + VKInstanceInfo.ppEnabledLayerNames = vLayersCStr.data(); bool TryAgain = false; @@ -3503,7 +3503,7 @@ public: TryAgain = true; if(TryAgain && TryDebugExtensions) - return CreateVulkanInstance(VKLayers, VKExtensions, false); + return CreateVulkanInstance(vVKLayers, vVKExtensions, false); return true; } @@ -3567,12 +3567,12 @@ public: return false; } - std::vector DeviceList(DevicesCount); - vkEnumeratePhysicalDevices(m_VKInstance, &DevicesCount, DeviceList.data()); + std::vector vDeviceList(DevicesCount); + vkEnumeratePhysicalDevices(m_VKInstance, &DevicesCount, vDeviceList.data()); size_t Index = 0; - std::vector DevicePropList(DeviceList.size()); - m_pGPUList->m_GPUs.reserve(DeviceList.size()); + std::vector vDevicePropList(vDeviceList.size()); + m_pGPUList->m_vGPUs.reserve(vDeviceList.size()); size_t FoundDeviceIndex = 0; size_t FoundGPUType = STWGraphicGPU::ETWGraphicsGPUType::GRAPHICS_GPU_TYPE_INVALID; @@ -3581,18 +3581,18 @@ public: bool IsAutoGPU = str_comp(g_Config.m_GfxGPUName, "auto") == 0; - for(auto &CurDevice : DeviceList) + for(auto &CurDevice : vDeviceList) { - vkGetPhysicalDeviceProperties(CurDevice, &(DevicePropList[Index])); + vkGetPhysicalDeviceProperties(CurDevice, &(vDevicePropList[Index])); - auto &DeviceProp = DevicePropList[Index]; + auto &DeviceProp = vDevicePropList[Index]; STWGraphicGPU::ETWGraphicsGPUType GPUType = VKGPUTypeToGraphicsGPUType(DeviceProp.deviceType); STWGraphicGPU::STWGraphicGPUItem NewGPU; str_copy(NewGPU.m_Name, DeviceProp.deviceName, minimum(sizeof(DeviceProp.deviceName), sizeof(NewGPU.m_Name))); NewGPU.m_GPUType = GPUType; - m_pGPUList->m_GPUs.push_back(NewGPU); + m_pGPUList->m_vGPUs.push_back(NewGPU); Index++; @@ -3618,7 +3618,7 @@ public: FoundDeviceIndex = 1; { - auto &DeviceProp = DevicePropList[FoundDeviceIndex - 1]; + auto &DeviceProp = vDevicePropList[FoundDeviceIndex - 1]; int DevAPIMajor = (int)VK_API_VERSION_MAJOR(DeviceProp.apiVersion); int DevAPIMinor = (int)VK_API_VERSION_MINOR(DeviceProp.apiVersion); @@ -3678,7 +3678,7 @@ public: } } - VkPhysicalDevice CurDevice = DeviceList[FoundDeviceIndex - 1]; + VkPhysicalDevice CurDevice = vDeviceList[FoundDeviceIndex - 1]; uint32_t FamQueueCount = 0; vkGetPhysicalDeviceQueueFamilyProperties(CurDevice, &FamQueueCount, nullptr); @@ -3688,17 +3688,17 @@ public: return false; } - std::vector QueuePropList(FamQueueCount); - vkGetPhysicalDeviceQueueFamilyProperties(CurDevice, &FamQueueCount, QueuePropList.data()); + std::vector vQueuePropList(FamQueueCount); + vkGetPhysicalDeviceQueueFamilyProperties(CurDevice, &FamQueueCount, vQueuePropList.data()); uint32_t QueueNodeIndex = std::numeric_limits::max(); for(uint32_t i = 0; i < FamQueueCount; i++) { - if(QueuePropList[i].queueCount > 0 && (QueuePropList[i].queueFlags & VK_QUEUE_GRAPHICS_BIT)) + if(vQueuePropList[i].queueCount > 0 && (vQueuePropList[i].queueFlags & VK_QUEUE_GRAPHICS_BIT)) { QueueNodeIndex = i; } - /*if(QueuePropList[i].queueCount > 0 && (QueuePropList[i].queueFlags & VK_QUEUE_COMPUTE_BIT)) + /*if(vQueuePropList[i].queueCount > 0 && (vQueuePropList[i].queueFlags & VK_QUEUE_COMPUTE_BIT)) { QueueNodeIndex = i; }*/ @@ -3715,12 +3715,12 @@ public: return true; } - bool CreateLogicalDevice(const std::vector &VKLayers) + bool CreateLogicalDevice(const std::vector &vVKLayers) { - std::vector LayerCNames; - LayerCNames.reserve(VKLayers.size()); - for(const auto &Layer : VKLayers) - LayerCNames.emplace_back(Layer.c_str()); + std::vector vLayerCNames; + vLayerCNames.reserve(vVKLayers.size()); + for(const auto &Layer : vVKLayers) + vLayerCNames.emplace_back(Layer.c_str()); uint32_t DevPropCount = 0; if(vkEnumerateDeviceExtensionProperties(m_VKGPU, NULL, &DevPropCount, NULL) != VK_SUCCESS) @@ -3729,22 +3729,22 @@ public: return false; } - std::vector DevPropList(DevPropCount); - if(vkEnumerateDeviceExtensionProperties(m_VKGPU, NULL, &DevPropCount, DevPropList.data()) != VK_SUCCESS) + std::vector vDevPropList(DevPropCount); + if(vkEnumerateDeviceExtensionProperties(m_VKGPU, NULL, &DevPropCount, vDevPropList.data()) != VK_SUCCESS) { SetError("Querying logical device extension propterties failed."); return false; } - std::vector DevPropCNames; + std::vector vDevPropCNames; std::set OurDevExt = OurDeviceExtensions(); - for(const auto &CurExtProp : DevPropList) + for(const auto &CurExtProp : vDevPropList) { auto it = OurDevExt.find(std::string(CurExtProp.extensionName)); if(it != OurDevExt.end()) { - DevPropCNames.emplace_back(CurExtProp.extensionName); + vDevPropCNames.emplace_back(CurExtProp.extensionName); } } @@ -3752,8 +3752,8 @@ public: VKQueueCreateInfo.sType = VK_STRUCTURE_TYPE_DEVICE_QUEUE_CREATE_INFO; VKQueueCreateInfo.queueFamilyIndex = m_VKGraphicsQueueIndex; VKQueueCreateInfo.queueCount = 1; - std::vector queue_prio = {1.0f}; - VKQueueCreateInfo.pQueuePriorities = queue_prio.data(); + float QueuePrio = 1.0f; + VKQueueCreateInfo.pQueuePriorities = &QueuePrio; VKQueueCreateInfo.pNext = NULL; VKQueueCreateInfo.flags = 0; @@ -3761,10 +3761,10 @@ public: VKCreateInfo.sType = VK_STRUCTURE_TYPE_DEVICE_CREATE_INFO; VKCreateInfo.queueCreateInfoCount = 1; VKCreateInfo.pQueueCreateInfos = &VKQueueCreateInfo; - VKCreateInfo.ppEnabledLayerNames = LayerCNames.data(); - VKCreateInfo.enabledLayerCount = static_cast(LayerCNames.size()); - VKCreateInfo.ppEnabledExtensionNames = DevPropCNames.data(); - VKCreateInfo.enabledExtensionCount = static_cast(DevPropCNames.size()); + VKCreateInfo.ppEnabledLayerNames = vLayerCNames.data(); + VKCreateInfo.enabledLayerCount = static_cast(vLayerCNames.size()); + VKCreateInfo.ppEnabledExtensionNames = vDevPropCNames.data(); + VKCreateInfo.enabledExtensionCount = static_cast(vDevPropCNames.size()); VKCreateInfo.pNext = NULL; VKCreateInfo.pEnabledFeatures = NULL; VKCreateInfo.flags = 0; @@ -3813,15 +3813,15 @@ public: return false; } - std::vector PresentModeList(PresentModeCount); - if(vkGetPhysicalDeviceSurfacePresentModesKHR(m_VKGPU, m_VKPresentSurface, &PresentModeCount, PresentModeList.data()) != VK_SUCCESS) + std::vector vPresentModeList(PresentModeCount); + if(vkGetPhysicalDeviceSurfacePresentModesKHR(m_VKGPU, m_VKPresentSurface, &PresentModeCount, vPresentModeList.data()) != VK_SUCCESS) { SetError("The device surface presentation modes could not be fetched."); return false; } VKIOMode = g_Config.m_GfxVsync ? VK_PRESENT_MODE_FIFO_KHR : VK_PRESENT_MODE_IMMEDIATE_KHR; - for(auto &Mode : PresentModeList) + for(auto &Mode : vPresentModeList) { if(Mode == VKIOMode) return true; @@ -3829,7 +3829,7 @@ public: dbg_msg("vulkan", "warning: requested presentation mode was not available. falling back to mailbox / fifo relaxed."); VKIOMode = g_Config.m_GfxVsync ? VK_PRESENT_MODE_FIFO_RELAXED_KHR : VK_PRESENT_MODE_MAILBOX_KHR; - for(auto &Mode : PresentModeList) + for(auto &Mode : vPresentModeList) { if(Mode == VKIOMode) return true; @@ -3837,7 +3837,7 @@ public: dbg_msg("vulkan", "warning: requested presentation mode was not available. using first available."); if(PresentModeCount > 0) - VKIOMode = PresentModeList[0]; + VKIOMode = vPresentModeList[0]; return true; } @@ -3895,16 +3895,16 @@ public: bool GetImageUsage(const VkSurfaceCapabilitiesKHR &VKCapabilities, VkImageUsageFlags &VKOutUsage) { - std::vector OurImgUsages = OurImageUsages(); - if(OurImgUsages.empty()) + std::vector vOurImgUsages = OurImageUsages(); + if(vOurImgUsages.empty()) { SetError("Framebuffer image attachment types not supported."); return false; } - VKOutUsage = OurImgUsages[0]; + VKOutUsage = vOurImgUsages[0]; - for(const auto &ImgUsage : OurImgUsages) + for(const auto &ImgUsage : vOurImgUsages) { VkImageUsageFlags ImgUsageFlags = ImgUsage & VKCapabilities.supportedUsageFlags; if(ImgUsageFlags != ImgUsage) @@ -3936,8 +3936,8 @@ public: return false; } - std::vector SurfFormatList(SurfFormats); - Res = vkGetPhysicalDeviceSurfaceFormatsKHR(m_VKGPU, m_VKPresentSurface, &SurfFormats, SurfFormatList.data()); + std::vector vSurfFormatList(SurfFormats); + Res = vkGetPhysicalDeviceSurfaceFormatsKHR(m_VKGPU, m_VKPresentSurface, &SurfFormats, vSurfFormatList.data()); if(Res != VK_SUCCESS && Res != VK_INCOMPLETE) { SetError("The device surface format fetching failed."); @@ -3949,7 +3949,7 @@ public: dbg_msg("vulkan", "warning: not all surface formats are requestable with your current settings."); } - if(SurfFormatList.size() == 1 && SurfFormatList[0].format == VK_FORMAT_UNDEFINED) + if(vSurfFormatList.size() == 1 && vSurfFormatList[0].format == VK_FORMAT_UNDEFINED) { m_VKSurfFormat.format = VK_FORMAT_B8G8R8A8_UNORM; m_VKSurfFormat.colorSpace = VK_COLOR_SPACE_SRGB_NONLINEAR_KHR; @@ -3957,7 +3957,7 @@ public: return true; } - for(const auto &FindFormat : SurfFormatList) + for(const auto &FindFormat : vSurfFormatList) { if(FindFormat.format == VK_FORMAT_B8G8R8A8_UNORM && FindFormat.colorSpace == VK_COLOR_SPACE_SRGB_NONLINEAR_KHR) { @@ -3972,7 +3972,7 @@ public: } dbg_msg("vulkan", "warning: surface format was not RGBA(or variants of it). This can potentially cause weird looking images(too bright etc.)."); - m_VKSurfFormat = SurfFormatList[0]; + m_VKSurfFormat = vSurfFormatList[0]; return true; } @@ -4056,8 +4056,8 @@ public: m_SwapChainImageCount = ImgCount; - m_SwapChainImages.resize(ImgCount); - if(vkGetSwapchainImagesKHR(m_VKDevice, m_VKSwapChain, &ImgCount, m_SwapChainImages.data()) != VK_SUCCESS) + m_vSwapChainImages.resize(ImgCount); + if(vkGetSwapchainImagesKHR(m_VKDevice, m_VKSwapChain, &ImgCount, m_vSwapChainImages.data()) != VK_SUCCESS) { SetError("Could not get swap chain images."); return false; @@ -4068,7 +4068,7 @@ public: void ClearSwapChainImageHandles() { - m_SwapChainImages.clear(); + m_vSwapChainImages.clear(); } void GetDeviceQueue() @@ -4146,13 +4146,13 @@ public: bool CreateImageViews() { - m_SwapChainImageViewList.resize(m_SwapChainImageCount); + m_vSwapChainImageViewList.resize(m_SwapChainImageCount); for(size_t i = 0; i < m_SwapChainImageCount; i++) { VkImageViewCreateInfo CreateInfo{}; CreateInfo.sType = VK_STRUCTURE_TYPE_IMAGE_VIEW_CREATE_INFO; - CreateInfo.image = m_SwapChainImages[i]; + CreateInfo.image = m_vSwapChainImages[i]; CreateInfo.viewType = VK_IMAGE_VIEW_TYPE_2D; CreateInfo.format = m_VKSurfFormat.format; CreateInfo.components.r = VK_COMPONENT_SWIZZLE_IDENTITY; @@ -4165,7 +4165,7 @@ public: CreateInfo.subresourceRange.baseArrayLayer = 0; CreateInfo.subresourceRange.layerCount = 1; - if(vkCreateImageView(m_VKDevice, &CreateInfo, nullptr, &m_SwapChainImageViewList[i]) != VK_SUCCESS) + if(vkCreateImageView(m_VKDevice, &CreateInfo, nullptr, &m_vSwapChainImageViewList[i]) != VK_SUCCESS) { SetError("Could not create image views for the swap chain framebuffers."); return false; @@ -4177,23 +4177,23 @@ public: void DestroyImageViews() { - for(auto &ImageView : m_SwapChainImageViewList) + for(auto &ImageView : m_vSwapChainImageViewList) { vkDestroyImageView(m_VKDevice, ImageView, nullptr); } - m_SwapChainImageViewList.clear(); + m_vSwapChainImageViewList.clear(); } bool CreateMultiSamplerImageAttachments() { - m_SwapChainMultiSamplingImages.resize(m_SwapChainImageCount); + m_vSwapChainMultiSamplingImages.resize(m_SwapChainImageCount); if(HasMultiSampling()) { for(size_t i = 0; i < m_SwapChainImageCount; ++i) { - CreateImage(m_VKSwapImgAndViewportExtent.m_SwapImageViewport.width, m_VKSwapImgAndViewportExtent.m_SwapImageViewport.height, 1, 1, m_VKSurfFormat.format, VK_IMAGE_TILING_OPTIMAL, m_SwapChainMultiSamplingImages[i].m_Image, m_SwapChainMultiSamplingImages[i].m_ImgMem, VK_IMAGE_USAGE_TRANSIENT_ATTACHMENT_BIT | VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT); - m_SwapChainMultiSamplingImages[i].m_ImgView = CreateImageView(m_SwapChainMultiSamplingImages[i].m_Image, m_VKSurfFormat.format, VK_IMAGE_VIEW_TYPE_2D, 1, 1); + CreateImage(m_VKSwapImgAndViewportExtent.m_SwapImageViewport.width, m_VKSwapImgAndViewportExtent.m_SwapImageViewport.height, 1, 1, m_VKSurfFormat.format, VK_IMAGE_TILING_OPTIMAL, m_vSwapChainMultiSamplingImages[i].m_Image, m_vSwapChainMultiSamplingImages[i].m_ImgMem, VK_IMAGE_USAGE_TRANSIENT_ATTACHMENT_BIT | VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT); + m_vSwapChainMultiSamplingImages[i].m_ImgView = CreateImageView(m_vSwapChainMultiSamplingImages[i].m_Image, m_VKSurfFormat.format, VK_IMAGE_VIEW_TYPE_2D, 1, 1); } } @@ -4204,15 +4204,15 @@ public: { if(HasMultiSampling()) { - m_SwapChainMultiSamplingImages.resize(m_SwapChainImageCount); + m_vSwapChainMultiSamplingImages.resize(m_SwapChainImageCount); for(size_t i = 0; i < m_SwapChainImageCount; ++i) { - vkDestroyImage(m_VKDevice, m_SwapChainMultiSamplingImages[i].m_Image, nullptr); - vkDestroyImageView(m_VKDevice, m_SwapChainMultiSamplingImages[i].m_ImgView, nullptr); - FreeImageMemBlock(m_SwapChainMultiSamplingImages[i].m_ImgMem); + vkDestroyImage(m_VKDevice, m_vSwapChainMultiSamplingImages[i].m_Image, nullptr); + vkDestroyImageView(m_VKDevice, m_vSwapChainMultiSamplingImages[i].m_ImgView, nullptr); + FreeImageMemBlock(m_vSwapChainMultiSamplingImages[i].m_ImgMem); } } - m_SwapChainMultiSamplingImages.clear(); + m_vSwapChainMultiSamplingImages.clear(); } bool CreateRenderPass(bool ClearAttachs) @@ -4289,13 +4289,13 @@ public: bool CreateFramebuffers() { - m_FramebufferList.resize(m_SwapChainImageCount); + m_vFramebufferList.resize(m_SwapChainImageCount); for(size_t i = 0; i < m_SwapChainImageCount; i++) { std::array aAttachments = { - m_SwapChainMultiSamplingImages[i].m_ImgView, - m_SwapChainImageViewList[i]}; + m_vSwapChainMultiSamplingImages[i].m_ImgView, + m_vSwapChainImageViewList[i]}; bool HasMultiSamplingTargets = HasMultiSampling(); @@ -4308,7 +4308,7 @@ public: FramebufferInfo.height = m_VKSwapImgAndViewportExtent.m_SwapImageViewport.height; FramebufferInfo.layers = 1; - if(vkCreateFramebuffer(m_VKDevice, &FramebufferInfo, nullptr, &m_FramebufferList[i]) != VK_SUCCESS) + if(vkCreateFramebuffer(m_VKDevice, &FramebufferInfo, nullptr, &m_vFramebufferList[i]) != VK_SUCCESS) { SetError("Creating the framebuffers failed."); return false; @@ -4320,12 +4320,12 @@ public: void DestroyFramebuffers() { - for(auto &FrameBuffer : m_FramebufferList) + for(auto &FrameBuffer : m_vFramebufferList) { vkDestroyFramebuffer(m_VKDevice, FrameBuffer, nullptr); } - m_FramebufferList.clear(); + m_vFramebufferList.clear(); } bool CreateShaderModule(const std::vector &Code, VkShaderModule &ShaderModule) @@ -4386,21 +4386,21 @@ public: { auto *pShaderCodeFile = m_pStorage->OpenFile(pFileName, IOFLAG_READ, IStorage::TYPE_ALL); - std::vector ShaderBuff; + std::vector vShaderBuff; if(pShaderCodeFile) { long FileSize = io_length(pShaderCodeFile); - ShaderBuff.resize(FileSize); - io_read(pShaderCodeFile, ShaderBuff.data(), FileSize); + vShaderBuff.resize(FileSize); + io_read(pShaderCodeFile, vShaderBuff.data(), FileSize); io_close(pShaderCodeFile); } else return false; - it = m_ShaderFiles.insert({pFileName, {std::move(ShaderBuff)}}).first; + it = m_ShaderFiles.insert({pFileName, {std::move(vShaderBuff)}}).first; } - pShaderData = &it->second.m_Binary; + pShaderData = &it->second.m_vBinary; return true; } @@ -4409,10 +4409,10 @@ public: { bool ShaderLoaded = true; - std::vector *pVertBuff; - std::vector *pFragBuff; - ShaderLoaded &= LoadShader(pVertName, pVertBuff); - ShaderLoaded &= LoadShader(pFragName, pFragBuff); + std::vector *pvVertBuff; + std::vector *pvFragBuff; + ShaderLoaded &= LoadShader(pVertName, pvVertBuff); + ShaderLoaded &= LoadShader(pFragName, pvFragBuff); ShaderModule.m_VKDevice = m_VKDevice; @@ -4422,10 +4422,10 @@ public: return false; } - if(!CreateShaderModule(*pVertBuff, ShaderModule.m_VertShaderModule)) + if(!CreateShaderModule(*pvVertBuff, ShaderModule.m_VertShaderModule)) return false; - if(!CreateShaderModule(*pFragBuff, ShaderModule.m_FragShaderModule)) + if(!CreateShaderModule(*pvFragBuff, ShaderModule.m_FragShaderModule)) return false; VkPipelineShaderStageCreateInfo &VertShaderStageInfo = aShaderStages[0]; @@ -4856,14 +4856,14 @@ public: bool CreateUniformDescriptorSets(size_t RenderThreadIndex, VkDescriptorSetLayout &SetLayout, SDeviceDescriptorSet *pSets, size_t SetCount, VkBuffer BindBuffer, size_t SingleBufferInstanceSize, VkDeviceSize MemoryOffset) { - GetDescriptorPoolForAlloc(m_UniformBufferDescrPools[RenderThreadIndex], pSets, SetCount); + GetDescriptorPoolForAlloc(m_vUniformBufferDescrPools[RenderThreadIndex], pSets, SetCount); VkDescriptorSetAllocateInfo DesAllocInfo{}; DesAllocInfo.sType = VK_STRUCTURE_TYPE_DESCRIPTOR_SET_ALLOCATE_INFO; DesAllocInfo.descriptorSetCount = 1; DesAllocInfo.pSetLayouts = &SetLayout; for(size_t i = 0; i < SetCount; ++i) { - DesAllocInfo.descriptorPool = pSets[i].m_pPools->m_Pools[pSets[i].m_PoolIndex].m_Pool; + DesAllocInfo.descriptorPool = pSets[i].m_pPools->m_vPools[pSets[i].m_PoolIndex].m_Pool; if(vkAllocateDescriptorSets(m_VKDevice, &DesAllocInfo, &pSets[i].m_Descriptor) != VK_SUCCESS) { return false; @@ -4894,7 +4894,7 @@ public: { for(size_t i = 0; i < SetCount; ++i) { - vkFreeDescriptorSets(m_VKDevice, pSets[i].m_pPools->m_Pools[pSets[i].m_PoolIndex].m_Pool, 1, &pSets[i].m_Descriptor); + vkFreeDescriptorSets(m_VKDevice, pSets[i].m_pPools->m_vPools[pSets[i].m_PoolIndex].m_Pool, 1, &pSets[i].m_Descriptor); pSets[i].m_Descriptor = VK_NULL_HANDLE; } } @@ -5087,39 +5087,39 @@ public: bool CreateCommandBuffers() { - m_MainDrawCommandBuffers.resize(m_SwapChainImageCount); + m_vMainDrawCommandBuffers.resize(m_SwapChainImageCount); if(m_ThreadCount > 1) { - m_ThreadDrawCommandBuffers.resize(m_ThreadCount); - m_UsedThreadDrawCommandBuffer.resize(m_ThreadCount); - m_HelperThreadDrawCommandBuffers.resize(m_ThreadCount); - for(auto &ThreadDrawCommandBuffers : m_ThreadDrawCommandBuffers) + m_vvThreadDrawCommandBuffers.resize(m_ThreadCount); + m_vvUsedThreadDrawCommandBuffer.resize(m_ThreadCount); + m_vHelperThreadDrawCommandBuffers.resize(m_ThreadCount); + for(auto &ThreadDrawCommandBuffers : m_vvThreadDrawCommandBuffers) { ThreadDrawCommandBuffers.resize(m_SwapChainImageCount); } - for(auto &UsedThreadDrawCommandBuffer : m_UsedThreadDrawCommandBuffer) + for(auto &UsedThreadDrawCommandBuffer : m_vvUsedThreadDrawCommandBuffer) { UsedThreadDrawCommandBuffer.resize(m_SwapChainImageCount, false); } } - m_MemoryCommandBuffers.resize(m_SwapChainImageCount); - m_UsedMemoryCommandBuffer.resize(m_SwapChainImageCount, false); + m_vMemoryCommandBuffers.resize(m_SwapChainImageCount); + m_vUsedMemoryCommandBuffer.resize(m_SwapChainImageCount, false); VkCommandBufferAllocateInfo AllocInfo{}; AllocInfo.sType = VK_STRUCTURE_TYPE_COMMAND_BUFFER_ALLOCATE_INFO; AllocInfo.commandPool = m_vCommandPools[0]; AllocInfo.level = VK_COMMAND_BUFFER_LEVEL_PRIMARY; - AllocInfo.commandBufferCount = (uint32_t)m_MainDrawCommandBuffers.size(); + AllocInfo.commandBufferCount = (uint32_t)m_vMainDrawCommandBuffers.size(); - if(vkAllocateCommandBuffers(m_VKDevice, &AllocInfo, m_MainDrawCommandBuffers.data()) != VK_SUCCESS) + if(vkAllocateCommandBuffers(m_VKDevice, &AllocInfo, m_vMainDrawCommandBuffers.data()) != VK_SUCCESS) { SetError("Allocating command buffers failed."); return false; } - AllocInfo.commandBufferCount = (uint32_t)m_MemoryCommandBuffers.size(); + AllocInfo.commandBufferCount = (uint32_t)m_vMemoryCommandBuffers.size(); - if(vkAllocateCommandBuffers(m_VKDevice, &AllocInfo, m_MemoryCommandBuffers.data()) != VK_SUCCESS) + if(vkAllocateCommandBuffers(m_VKDevice, &AllocInfo, m_vMemoryCommandBuffers.data()) != VK_SUCCESS) { SetError("Allocating memory command buffers failed."); return false; @@ -5128,7 +5128,7 @@ public: if(m_ThreadCount > 1) { size_t Count = 0; - for(auto &ThreadDrawCommandBuffers : m_ThreadDrawCommandBuffers) + for(auto &ThreadDrawCommandBuffers : m_vvThreadDrawCommandBuffers) { AllocInfo.commandPool = m_vCommandPools[Count]; ++Count; @@ -5150,34 +5150,34 @@ public: if(m_ThreadCount > 1) { size_t Count = 0; - for(auto &ThreadDrawCommandBuffers : m_ThreadDrawCommandBuffers) + for(auto &ThreadDrawCommandBuffers : m_vvThreadDrawCommandBuffers) { vkFreeCommandBuffers(m_VKDevice, m_vCommandPools[Count], static_cast(ThreadDrawCommandBuffers.size()), ThreadDrawCommandBuffers.data()); ++Count; } } - vkFreeCommandBuffers(m_VKDevice, m_vCommandPools[0], static_cast(m_MemoryCommandBuffers.size()), m_MemoryCommandBuffers.data()); - vkFreeCommandBuffers(m_VKDevice, m_vCommandPools[0], static_cast(m_MainDrawCommandBuffers.size()), m_MainDrawCommandBuffers.data()); + vkFreeCommandBuffers(m_VKDevice, m_vCommandPools[0], static_cast(m_vMemoryCommandBuffers.size()), m_vMemoryCommandBuffers.data()); + vkFreeCommandBuffers(m_VKDevice, m_vCommandPools[0], static_cast(m_vMainDrawCommandBuffers.size()), m_vMainDrawCommandBuffers.data()); - m_ThreadDrawCommandBuffers.clear(); - m_UsedThreadDrawCommandBuffer.clear(); - m_HelperThreadDrawCommandBuffers.clear(); + m_vvThreadDrawCommandBuffers.clear(); + m_vvUsedThreadDrawCommandBuffer.clear(); + m_vHelperThreadDrawCommandBuffers.clear(); - m_MainDrawCommandBuffers.clear(); - m_MemoryCommandBuffers.clear(); - m_UsedMemoryCommandBuffer.clear(); + m_vMainDrawCommandBuffers.clear(); + m_vMemoryCommandBuffers.clear(); + m_vUsedMemoryCommandBuffer.clear(); } bool CreateSyncObjects() { - m_WaitSemaphores.resize(m_SwapChainImageCount); - m_SigSemaphores.resize(m_SwapChainImageCount); + m_vWaitSemaphores.resize(m_SwapChainImageCount); + m_vSigSemaphores.resize(m_SwapChainImageCount); - m_MemorySemaphores.resize(m_SwapChainImageCount); + m_vMemorySemaphores.resize(m_SwapChainImageCount); - m_FrameFences.resize(m_SwapChainImageCount); - m_ImagesFences.resize(m_SwapChainImageCount, VK_NULL_HANDLE); + m_vFrameFences.resize(m_SwapChainImageCount); + m_vImagesFences.resize(m_SwapChainImageCount, VK_NULL_HANDLE); VkSemaphoreCreateInfo CreateSemaphoreInfo{}; CreateSemaphoreInfo.sType = VK_STRUCTURE_TYPE_SEMAPHORE_CREATE_INFO; @@ -5188,10 +5188,10 @@ public: for(size_t i = 0; i < m_SwapChainImageCount; i++) { - if(vkCreateSemaphore(m_VKDevice, &CreateSemaphoreInfo, nullptr, &m_WaitSemaphores[i]) != VK_SUCCESS || - vkCreateSemaphore(m_VKDevice, &CreateSemaphoreInfo, nullptr, &m_SigSemaphores[i]) != VK_SUCCESS || - vkCreateSemaphore(m_VKDevice, &CreateSemaphoreInfo, nullptr, &m_MemorySemaphores[i]) != VK_SUCCESS || - vkCreateFence(m_VKDevice, &FenceInfo, nullptr, &m_FrameFences[i]) != VK_SUCCESS) + if(vkCreateSemaphore(m_VKDevice, &CreateSemaphoreInfo, nullptr, &m_vWaitSemaphores[i]) != VK_SUCCESS || + vkCreateSemaphore(m_VKDevice, &CreateSemaphoreInfo, nullptr, &m_vSigSemaphores[i]) != VK_SUCCESS || + vkCreateSemaphore(m_VKDevice, &CreateSemaphoreInfo, nullptr, &m_vMemorySemaphores[i]) != VK_SUCCESS || + vkCreateFence(m_VKDevice, &FenceInfo, nullptr, &m_vFrameFences[i]) != VK_SUCCESS) { SetError("Creating swap chain sync objects(fences, semaphores) failed."); return false; @@ -5205,19 +5205,19 @@ public: { for(size_t i = 0; i < m_SwapChainImageCount; i++) { - vkDestroySemaphore(m_VKDevice, m_WaitSemaphores[i], nullptr); - vkDestroySemaphore(m_VKDevice, m_SigSemaphores[i], nullptr); - vkDestroySemaphore(m_VKDevice, m_MemorySemaphores[i], nullptr); - vkDestroyFence(m_VKDevice, m_FrameFences[i], nullptr); + vkDestroySemaphore(m_VKDevice, m_vWaitSemaphores[i], nullptr); + vkDestroySemaphore(m_VKDevice, m_vSigSemaphores[i], nullptr); + vkDestroySemaphore(m_VKDevice, m_vMemorySemaphores[i], nullptr); + vkDestroyFence(m_VKDevice, m_vFrameFences[i], nullptr); } - m_WaitSemaphores.clear(); - m_SigSemaphores.clear(); + m_vWaitSemaphores.clear(); + m_vSigSemaphores.clear(); - m_MemorySemaphores.clear(); + m_vMemorySemaphores.clear(); - m_FrameFences.clear(); - m_ImagesFences.clear(); + m_vFrameFences.clear(); + m_vImagesFences.clear(); } void DestroyBufferOfFrame(size_t ImageIndex, SFrameBuffers &Buffer) @@ -5280,7 +5280,7 @@ public: CleanupVulkanSwapChain(true); // clean all images, buffers, buffer containers - for(auto &Texture : m_Textures) + for(auto &Texture : m_vTextures) { if(Texture.m_VKTextDescrSet.m_Descriptor != VK_NULL_HANDLE && IsVerbose()) { @@ -5289,16 +5289,16 @@ public: DestroyTexture(Texture); } - for(auto &BufferObject : m_BufferObjects) + for(auto &BufferObject : m_vBufferObjects) { if(!BufferObject.m_IsStreamedBuffer) FreeVertexMemBlock(BufferObject.m_BufferObject.m_Mem); } - m_BufferContainers.clear(); + m_vBufferContainers.clear(); } - m_ImageLastFrameCheck.clear(); + m_vImageLastFrameCheck.clear(); m_vLastPipeline.clear(); @@ -5315,9 +5315,9 @@ public: ClearFrameData(i); } - m_FrameDelayedBufferCleanup.clear(); - m_FrameDelayedTextureCleanup.clear(); - m_FrameDelayedTextTexturesCleanup.clear(); + m_vvFrameDelayedBufferCleanup.clear(); + m_vvFrameDelayedTextureCleanup.clear(); + m_vvFrameDelayedTextTexturesCleanup.clear(); m_StagingBufferCache.DestroyFrameData(m_SwapChainImageCount); m_StagingBufferCacheImage.DestroyFrameData(m_SwapChainImageCount); @@ -5419,26 +5419,26 @@ public: int InitVulkanSDL(SDL_Window *pWindow, uint32_t CanvasWidth, uint32_t CanvasHeight, char *pRendererString, char *pVendorString, char *pVersionString) { - std::vector VKExtensions; - std::vector VKLayers; + std::vector vVKExtensions; + std::vector vVKLayers; m_CanvasWidth = CanvasWidth; m_CanvasHeight = CanvasHeight; - if(!GetVulkanExtensions(pWindow, VKExtensions)) + if(!GetVulkanExtensions(pWindow, vVKExtensions)) return -1; - if(!GetVulkanLayers(VKLayers)) + if(!GetVulkanLayers(vVKLayers)) return -1; - if(!CreateVulkanInstance(VKLayers, VKExtensions, true)) + if(!CreateVulkanInstance(vVKLayers, vVKExtensions, true)) return -1; if(g_Config.m_DbgGfx == DEBUG_GFX_MODE_MINIMUM || g_Config.m_DbgGfx == DEBUG_GFX_MODE_ALL) { SetupDebugCallback(); - for(auto &VKLayer : VKLayers) + for(auto &VKLayer : vVKLayers) { dbg_msg("vulkan", "Validation layer: %s", VKLayer.c_str()); } @@ -5447,7 +5447,7 @@ public: if(!SelectGPU(pRendererString, pVendorString, pVersionString)) return -1; - if(!CreateLogicalDevice(VKLayers)) + if(!CreateLogicalDevice(vVKLayers)) return -1; GetDeviceQueue(); @@ -5556,7 +5556,7 @@ public: return false; } - DescriptorPools.m_Pools.push_back(NewPool); + DescriptorPools.m_vPools.push_back(NewPool); return true; } @@ -5568,8 +5568,8 @@ public: m_TextTextureDescrPool.m_IsUniformPool = false; m_TextTextureDescrPool.m_DefaultAllocSize = 8; - m_UniformBufferDescrPools.resize(m_ThreadCount); - for(auto &UniformBufferDescrPool : m_UniformBufferDescrPools) + m_vUniformBufferDescrPools.resize(m_ThreadCount); + for(auto &UniformBufferDescrPool : m_vUniformBufferDescrPools) { UniformBufferDescrPool.m_IsUniformPool = true; UniformBufferDescrPool.m_DefaultAllocSize = 512; @@ -5578,7 +5578,7 @@ public: bool Ret = AllocateDescriptorPool(m_StandardTextureDescrPool, CCommandBuffer::MAX_TEXTURES); Ret |= AllocateDescriptorPool(m_TextTextureDescrPool, 8); - for(auto &UniformBufferDescrPool : m_UniformBufferDescrPools) + for(auto &UniformBufferDescrPool : m_vUniformBufferDescrPools) { Ret |= AllocateDescriptorPool(UniformBufferDescrPool, 64); } @@ -5588,17 +5588,17 @@ public: void DestroyDescriptorPools() { - for(auto &DescrPool : m_StandardTextureDescrPool.m_Pools) + for(auto &DescrPool : m_StandardTextureDescrPool.m_vPools) vkDestroyDescriptorPool(m_VKDevice, DescrPool.m_Pool, nullptr); - for(auto &DescrPool : m_TextTextureDescrPool.m_Pools) + for(auto &DescrPool : m_TextTextureDescrPool.m_vPools) vkDestroyDescriptorPool(m_VKDevice, DescrPool.m_Pool, nullptr); - for(auto &UniformBufferDescrPool : m_UniformBufferDescrPools) + for(auto &UniformBufferDescrPool : m_vUniformBufferDescrPools) { - for(auto &DescrPool : UniformBufferDescrPool.m_Pools) + for(auto &DescrPool : UniformBufferDescrPool.m_vPools) vkDestroyDescriptorPool(m_VKDevice, DescrPool.m_Pool, nullptr); } - m_UniformBufferDescrPools.clear(); + m_vUniformBufferDescrPools.clear(); } VkDescriptorPool GetDescriptorPoolForAlloc(SDeviceDescriptorPools &DescriptorPools, SDeviceDescriptorSet *pSets, size_t AllocNum) @@ -5613,9 +5613,9 @@ public: bool Found = false; size_t DescriptorPoolIndex = std::numeric_limits::max(); - for(size_t i = 0; i < DescriptorPools.m_Pools.size(); ++i) + for(size_t i = 0; i < DescriptorPools.m_vPools.size(); ++i) { - auto &Pool = DescriptorPools.m_Pools[i]; + auto &Pool = DescriptorPools.m_vPools[i]; if(Pool.m_CurSize + CurAllocNum < Pool.m_Size) { AllocatedInThisRun = CurAllocNum; @@ -5644,13 +5644,13 @@ public: if(!Found) { - DescriptorPoolIndex = DescriptorPools.m_Pools.size(); + DescriptorPoolIndex = DescriptorPools.m_vPools.size(); AllocateDescriptorPool(DescriptorPools, DescriptorPools.m_DefaultAllocSize); AllocatedInThisRun = minimum((size_t)DescriptorPools.m_DefaultAllocSize, CurAllocNum); - auto &Pool = DescriptorPools.m_Pools.back(); + auto &Pool = DescriptorPools.m_vPools.back(); Pool.m_CurSize += AllocatedInThisRun; if(RetDescr == VK_NULL_HANDLE) RetDescr = Pool.m_Pool; @@ -5670,7 +5670,7 @@ public: bool CreateNewTexturedStandardDescriptorSets(size_t TextureSlot, size_t DescrIndex) { - auto &Texture = m_Textures[TextureSlot]; + auto &Texture = m_vTextures[TextureSlot]; auto &DescrSet = Texture.m_aVKStandardTexturedDescrSets[DescrIndex]; @@ -5709,13 +5709,13 @@ public: { auto &DescrSet = Texture.m_aVKStandardTexturedDescrSets[DescrIndex]; if(DescrSet.m_PoolIndex != std::numeric_limits::max()) - vkFreeDescriptorSets(m_VKDevice, DescrSet.m_pPools->m_Pools[DescrSet.m_PoolIndex].m_Pool, 1, &DescrSet.m_Descriptor); + vkFreeDescriptorSets(m_VKDevice, DescrSet.m_pPools->m_vPools[DescrSet.m_PoolIndex].m_Pool, 1, &DescrSet.m_Descriptor); DescrSet = {}; } bool CreateNew3DTexturedStandardDescriptorSets(size_t TextureSlot) { - auto &Texture = m_Textures[TextureSlot]; + auto &Texture = m_vTextures[TextureSlot]; auto &DescrSet = Texture.m_VKStandard3DTexturedDescrSet; @@ -5754,13 +5754,13 @@ public: { auto &DescrSet = Texture.m_VKStandard3DTexturedDescrSet; if(DescrSet.m_PoolIndex != std::numeric_limits::max()) - vkFreeDescriptorSets(m_VKDevice, DescrSet.m_pPools->m_Pools[DescrSet.m_PoolIndex].m_Pool, 1, &DescrSet.m_Descriptor); + vkFreeDescriptorSets(m_VKDevice, DescrSet.m_pPools->m_vPools[DescrSet.m_PoolIndex].m_Pool, 1, &DescrSet.m_Descriptor); } bool CreateNewTextDescriptorSets(size_t Texture, size_t TextureOutline) { - auto &TextureText = m_Textures[Texture]; - auto &TextureTextOutline = m_Textures[TextureOutline]; + auto &TextureText = m_vTextures[Texture]; + auto &TextureTextOutline = m_vTextures[TextureOutline]; auto &DescrSetText = TextureText.m_VKTextDescrSet; auto &DescrSetTextOutline = TextureText.m_VKTextDescrSet; @@ -5807,7 +5807,7 @@ public: { auto &DescrSet = Texture.m_VKTextDescrSet; if(DescrSet.m_PoolIndex != std::numeric_limits::max()) - vkFreeDescriptorSets(m_VKDevice, DescrSet.m_pPools->m_Pools[DescrSet.m_PoolIndex].m_Pool, 1, &DescrSet.m_Descriptor); + vkFreeDescriptorSets(m_VKDevice, DescrSet.m_pPools->m_vPools[DescrSet.m_PoolIndex].m_Pool, 1, &DescrSet.m_Descriptor); } bool HasMultiSampling() @@ -6000,16 +6000,16 @@ public: m_vLastPipeline.resize(m_ThreadCount, VK_NULL_HANDLE); - m_FrameDelayedBufferCleanup.resize(m_SwapChainImageCount); - m_FrameDelayedTextureCleanup.resize(m_SwapChainImageCount); - m_FrameDelayedTextTexturesCleanup.resize(m_SwapChainImageCount); + m_vvFrameDelayedBufferCleanup.resize(m_SwapChainImageCount); + m_vvFrameDelayedTextureCleanup.resize(m_SwapChainImageCount); + m_vvFrameDelayedTextTexturesCleanup.resize(m_SwapChainImageCount); m_StagingBufferCache.Init(m_SwapChainImageCount); m_StagingBufferCacheImage.Init(m_SwapChainImageCount); m_VertexBufferCache.Init(m_SwapChainImageCount); for(auto &ImageBufferCache : m_ImageBufferCaches) ImageBufferCache.second.Init(m_SwapChainImageCount); - m_ImageLastFrameCheck.resize(m_SwapChainImageCount, 0); + m_vImageLastFrameCheck.resize(m_SwapChainImageCount, 0); if(IsFirstInitialization) { @@ -6042,10 +6042,10 @@ public: VkCommandBuffer &GetMemoryCommandBuffer() { - VkCommandBuffer &MemCommandBuffer = m_MemoryCommandBuffers[m_CurImageIndex]; - if(!m_UsedMemoryCommandBuffer[m_CurImageIndex]) + VkCommandBuffer &MemCommandBuffer = m_vMemoryCommandBuffers[m_CurImageIndex]; + if(!m_vUsedMemoryCommandBuffer[m_CurImageIndex]) { - m_UsedMemoryCommandBuffer[m_CurImageIndex] = true; + m_vUsedMemoryCommandBuffer[m_CurImageIndex] = true; vkResetCommandBuffer(MemCommandBuffer, VK_COMMAND_BUFFER_RESET_RELEASE_RESOURCES_BIT); @@ -6064,14 +6064,14 @@ public: { if(m_ThreadCount < 2) { - return m_MainDrawCommandBuffers[m_CurImageIndex]; + return m_vMainDrawCommandBuffers[m_CurImageIndex]; } else { - VkCommandBuffer &DrawCommandBuffer = m_ThreadDrawCommandBuffers[RenderThreadIndex][m_CurImageIndex]; - if(!m_UsedThreadDrawCommandBuffer[RenderThreadIndex][m_CurImageIndex]) + VkCommandBuffer &DrawCommandBuffer = m_vvThreadDrawCommandBuffers[RenderThreadIndex][m_CurImageIndex]; + if(!m_vvUsedThreadDrawCommandBuffer[RenderThreadIndex][m_CurImageIndex]) { - m_UsedThreadDrawCommandBuffer[RenderThreadIndex][m_CurImageIndex] = true; + m_vvUsedThreadDrawCommandBuffer[RenderThreadIndex][m_CurImageIndex] = true; vkResetCommandBuffer(DrawCommandBuffer, VK_COMMAND_BUFFER_RESET_RELEASE_RESOURCES_BIT); @@ -6081,7 +6081,7 @@ public: VkCommandBufferInheritanceInfo InheretInfo{}; InheretInfo.sType = VK_STRUCTURE_TYPE_COMMAND_BUFFER_INHERITANCE_INFO; - InheretInfo.framebuffer = m_FramebufferList[m_CurImageIndex]; + InheretInfo.framebuffer = m_vFramebufferList[m_CurImageIndex]; InheretInfo.occlusionQueryEnable = VK_FALSE; InheretInfo.renderPass = m_VKRenderPass; InheretInfo.subpass = 0; @@ -6099,7 +6099,7 @@ public: VkCommandBuffer &GetMainGraphicCommandBuffer() { - return m_MainDrawCommandBuffers[m_CurImageIndex]; + return m_vMainDrawCommandBuffers[m_CurImageIndex]; } /************************ @@ -6285,7 +6285,7 @@ public: { StartRenderThread(m_LastCommandsInPipeThreadIndex - 1); } - m_ThreadCommandLists[Buffer.m_ThreadIndex - 1].push_back(Buffer); + m_vvThreadCommandLists[Buffer.m_ThreadIndex - 1].push_back(Buffer); } ++m_CurCommandInPipe; @@ -6348,7 +6348,7 @@ public: m_MultiSamplingCount = (g_Config.m_GfxFsaaSamples & 0xFFFFFFFE); // ignore the uneven bit, only even multi sampling works TGLBackendReadPresentedImageData &ReadPresentedImgDataFunc = *pCommand->m_pReadPresentedImageDataFunc; - ReadPresentedImgDataFunc = [this](uint32_t &Width, uint32_t &Height, uint32_t &Format, std::vector &DstData) { return GetPresentedImageData(Width, Height, Format, DstData); }; + ReadPresentedImgDataFunc = [this](uint32_t &Width, uint32_t &Height, uint32_t &Format, std::vector &vDstData) { return GetPresentedImageData(Width, Height, Format, vDstData); }; m_pWindow = pCommand->m_pWindow; @@ -6426,9 +6426,9 @@ public: void Cmd_Texture_Destroy(const CCommandBuffer::SCommand_Texture_Destroy *pCommand) { size_t ImageIndex = (size_t)pCommand->m_Slot; - auto &Texture = m_Textures[ImageIndex]; + auto &Texture = m_vTextures[ImageIndex]; - m_FrameDelayedTextureCleanup[m_CurImageIndex].push_back(Texture); + m_vvFrameDelayedTextureCleanup[m_CurImageIndex].push_back(Texture); Texture = CTexture{}; } @@ -6472,10 +6472,10 @@ public: { size_t ImageIndex = (size_t)pCommand->m_Slot; size_t ImageIndexOutline = (size_t)pCommand->m_SlotOutline; - auto &Texture = m_Textures[ImageIndex]; - auto &TextureOutline = m_Textures[ImageIndexOutline]; + auto &Texture = m_vTextures[ImageIndex]; + auto &TextureOutline = m_vTextures[ImageIndexOutline]; - m_FrameDelayedTextTexturesCleanup[m_CurImageIndex].push_back({Texture, TextureOutline}); + m_vvFrameDelayedTextTexturesCleanup[m_CurImageIndex].push_back({Texture, TextureOutline}); Texture = {}; TextureOutline = {}; @@ -6528,7 +6528,7 @@ public: if(IsTextured) { size_t AddressModeIndex = GetAddressModeIndex(pCommand->m_State); - auto &DescrSet = m_Textures[pCommand->m_State.m_Texture].m_aVKStandardTexturedDescrSets[AddressModeIndex]; + auto &DescrSet = m_vTextures[pCommand->m_State.m_Texture].m_aVKStandardTexturedDescrSets[AddressModeIndex]; ExecBuffer.m_aDescriptors[0] = DescrSet; } @@ -6552,11 +6552,11 @@ public: uint32_t Width; uint32_t Height; uint32_t Format; - if(GetPresentedImageDataImpl(Width, Height, Format, m_ScreenshotHelper, false, true)) + if(GetPresentedImageDataImpl(Width, Height, Format, m_vScreenshotHelper, false, true)) { size_t ImgSize = (size_t)Width * (size_t)Height * (size_t)4; pCommand->m_pImage->m_pData = malloc(ImgSize); - mem_copy(pCommand->m_pImage->m_pData, m_ScreenshotHelper.data(), ImgSize); + mem_copy(pCommand->m_pImage->m_pData, m_vScreenshotHelper.data(), ImgSize); } else { @@ -6572,7 +6572,7 @@ public: bool IsTextured = GetIsTextured(pCommand->m_State); if(IsTextured) { - auto &DescrSet = m_Textures[pCommand->m_State.m_Texture].m_VKStandard3DTexturedDescrSet; + auto &DescrSet = m_vTextures[pCommand->m_State.m_Texture].m_VKStandard3DTexturedDescrSet; ExecBuffer.m_aDescriptors[0] = DescrSet; } @@ -6677,7 +6677,7 @@ public: auto StagingBuffer = GetStagingBuffer(pUploadData, DataSize); - auto &MemBlock = m_BufferObjects[BufferIndex].m_BufferObject.m_Mem; + auto &MemBlock = m_vBufferObjects[BufferIndex].m_BufferObject.m_Mem; VkBuffer VertexBuffer = MemBlock.m_Buffer; MemoryBarrier(VertexBuffer, Offset + MemBlock.m_HeapData.m_OffsetToAlign, DataSize, VK_ACCESS_VERTEX_ATTRIBUTE_READ_BIT, true); CopyBuffer(StagingBuffer.m_Buffer, VertexBuffer, StagingBuffer.m_HeapData.m_OffsetToAlign, Offset + MemBlock.m_HeapData.m_OffsetToAlign, DataSize); @@ -6700,8 +6700,8 @@ public: { size_t ReadBufferIndex = (size_t)pCommand->m_ReadBufferIndex; size_t WriteBufferIndex = (size_t)pCommand->m_WriteBufferIndex; - auto &ReadMemBlock = m_BufferObjects[ReadBufferIndex].m_BufferObject.m_Mem; - auto &WriteMemBlock = m_BufferObjects[WriteBufferIndex].m_BufferObject.m_Mem; + auto &ReadMemBlock = m_vBufferObjects[ReadBufferIndex].m_BufferObject.m_Mem; + auto &WriteMemBlock = m_vBufferObjects[WriteBufferIndex].m_BufferObject.m_Mem; VkBuffer ReadBuffer = ReadMemBlock.m_Buffer; VkBuffer WriteBuffer = WriteMemBlock.m_Buffer; @@ -6725,16 +6725,16 @@ public: void Cmd_CreateBufferContainer(const CCommandBuffer::SCommand_CreateBufferContainer *pCommand) { size_t ContainerIndex = (size_t)pCommand->m_BufferContainerIndex; - while(ContainerIndex >= m_BufferContainers.size()) - m_BufferContainers.resize((m_BufferContainers.size() * 2) + 1); + while(ContainerIndex >= m_vBufferContainers.size()) + m_vBufferContainers.resize((m_vBufferContainers.size() * 2) + 1); - m_BufferContainers[ContainerIndex].m_BufferObjectIndex = pCommand->m_VertBufferBindingIndex; + m_vBufferContainers[ContainerIndex].m_BufferObjectIndex = pCommand->m_VertBufferBindingIndex; } void Cmd_UpdateBufferContainer(const CCommandBuffer::SCommand_UpdateBufferContainer *pCommand) { size_t ContainerIndex = (size_t)pCommand->m_BufferContainerIndex; - m_BufferContainers[ContainerIndex].m_BufferObjectIndex = pCommand->m_VertBufferBindingIndex; + m_vBufferContainers[ContainerIndex].m_BufferObjectIndex = pCommand->m_VertBufferBindingIndex; } void Cmd_DeleteBufferContainer(const CCommandBuffer::SCommand_DeleteBufferContainer *pCommand) @@ -6743,7 +6743,7 @@ public: bool DeleteAllBO = pCommand->m_DestroyAllBO; if(DeleteAllBO) { - size_t BufferIndex = (size_t)m_BufferContainers[ContainerIndex].m_BufferObjectIndex; + size_t BufferIndex = (size_t)m_vBufferContainers[ContainerIndex].m_BufferObjectIndex; DeleteBufferObject(BufferIndex); } } @@ -6753,20 +6753,20 @@ public: size_t IndicesCount = pCommand->m_RequiredIndicesNum; if(m_CurRenderIndexPrimitiveCount < IndicesCount / 6) { - m_FrameDelayedBufferCleanup[m_CurImageIndex].push_back({m_RenderIndexBuffer, m_RenderIndexBufferMemory}); - std::vector Indices(IndicesCount); + m_vvFrameDelayedBufferCleanup[m_CurImageIndex].push_back({m_RenderIndexBuffer, m_RenderIndexBufferMemory}); + std::vector vIndices(IndicesCount); uint32_t Primq = 0; for(size_t i = 0; i < IndicesCount; i += 6) { - Indices[i] = Primq; - Indices[i + 1] = Primq + 1; - Indices[i + 2] = Primq + 2; - Indices[i + 3] = Primq; - Indices[i + 4] = Primq + 2; - Indices[i + 5] = Primq + 3; + vIndices[i] = Primq; + vIndices[i + 1] = Primq + 1; + vIndices[i + 2] = Primq + 2; + vIndices[i + 3] = Primq; + vIndices[i + 4] = Primq + 2; + vIndices[i + 5] = Primq + 3; Primq += 4; } - CreateIndexBuffer(Indices.data(), Indices.size() * sizeof(uint32_t), m_RenderIndexBuffer, m_RenderIndexBufferMemory); + CreateIndexBuffer(vIndices.data(), vIndices.size() * sizeof(uint32_t), m_RenderIndexBuffer, m_RenderIndexBufferMemory); m_CurRenderIndexPrimitiveCount = IndicesCount / 6; } } @@ -6815,8 +6815,8 @@ public: void Cmd_RenderQuadLayer_FillExecuteBuffer(SRenderCommandExecuteBuffer &ExecBuffer, const CCommandBuffer::SCommand_RenderQuadLayer *pCommand) { size_t BufferContainerIndex = (size_t)pCommand->m_BufferContainerIndex; - size_t BufferObjectIndex = (size_t)m_BufferContainers[BufferContainerIndex].m_BufferObjectIndex; - auto &BufferObject = m_BufferObjects[BufferObjectIndex]; + size_t BufferObjectIndex = (size_t)m_vBufferContainers[BufferContainerIndex].m_BufferObjectIndex; + auto &BufferObject = m_vBufferObjects[BufferObjectIndex]; ExecBuffer.m_Buffer = BufferObject.m_CurBuffer; ExecBuffer.m_BufferOff = BufferObject.m_CurBufferOffset; @@ -6825,7 +6825,7 @@ public: if(IsTextured) { size_t AddressModeIndex = GetAddressModeIndex(pCommand->m_State); - auto &DescrSet = m_Textures[pCommand->m_State.m_Texture].m_aVKStandardTexturedDescrSets[AddressModeIndex]; + auto &DescrSet = m_vTextures[pCommand->m_State.m_Texture].m_aVKStandardTexturedDescrSets[AddressModeIndex]; ExecBuffer.m_aDescriptors[0] = DescrSet; } @@ -6918,13 +6918,13 @@ public: void Cmd_RenderText_FillExecuteBuffer(SRenderCommandExecuteBuffer &ExecBuffer, const CCommandBuffer::SCommand_RenderText *pCommand) { size_t BufferContainerIndex = (size_t)pCommand->m_BufferContainerIndex; - size_t BufferObjectIndex = (size_t)m_BufferContainers[BufferContainerIndex].m_BufferObjectIndex; - auto &BufferObject = m_BufferObjects[BufferObjectIndex]; + size_t BufferObjectIndex = (size_t)m_vBufferContainers[BufferContainerIndex].m_BufferObjectIndex; + auto &BufferObject = m_vBufferObjects[BufferObjectIndex]; ExecBuffer.m_Buffer = BufferObject.m_CurBuffer; ExecBuffer.m_BufferOff = BufferObject.m_CurBufferOffset; - auto &TextTextureDescr = m_Textures[pCommand->m_TextTextureIndex].m_VKTextDescrSet; + auto &TextTextureDescr = m_vTextures[pCommand->m_TextTextureIndex].m_VKTextDescrSet; ExecBuffer.m_aDescriptors[0] = TextTextureDescr; ExecBuffer.m_IndexBuffer = m_RenderIndexBuffer; @@ -6977,8 +6977,8 @@ public: void BufferContainer_FillExecuteBuffer(SRenderCommandExecuteBuffer &ExecBuffer, const CCommandBuffer::SState &State, size_t BufferContainerIndex, size_t DrawCalls) { - size_t BufferObjectIndex = (size_t)m_BufferContainers[BufferContainerIndex].m_BufferObjectIndex; - auto &BufferObject = m_BufferObjects[BufferObjectIndex]; + size_t BufferObjectIndex = (size_t)m_vBufferContainers[BufferContainerIndex].m_BufferObjectIndex; + auto &BufferObject = m_vBufferObjects[BufferObjectIndex]; ExecBuffer.m_Buffer = BufferObject.m_CurBuffer; ExecBuffer.m_BufferOff = BufferObject.m_CurBufferOffset; @@ -6987,7 +6987,7 @@ public: if(IsTextured) { size_t AddressModeIndex = GetAddressModeIndex(State); - auto &DescrSet = m_Textures[State.m_Texture].m_aVKStandardTexturedDescrSets[AddressModeIndex]; + auto &DescrSet = m_vTextures[State.m_Texture].m_aVKStandardTexturedDescrSets[AddressModeIndex]; ExecBuffer.m_aDescriptors[0] = DescrSet; } @@ -7237,9 +7237,9 @@ public: dbg_assert(m_ThreadCount != 2, "Either use 1 main thread or at least 2 extra rendering threads."); if(m_ThreadCount > 1) { - m_ThreadCommandLists.resize(m_ThreadCount - 1); - m_ThreadHelperHadCommands.resize(m_ThreadCount - 1, false); - for(auto &ThreadCommandList : m_ThreadCommandLists) + m_vvThreadCommandLists.resize(m_ThreadCount - 1); + m_vThreadHelperHadCommands.resize(m_ThreadCount - 1, false); + for(auto &ThreadCommandList : m_vvThreadCommandLists) { ThreadCommandList.reserve(256); } @@ -7248,7 +7248,7 @@ public: { auto *pRenderThread = new SRenderThread(); std::unique_lock Lock(pRenderThread->m_Mutex); - m_RenderThreads.emplace_back(pRenderThread); + m_vpRenderThreads.emplace_back(pRenderThread); pRenderThread->m_Thread = std::thread([this, i]() { RunThread(i); }); // wait until thread started pRenderThread->m_Cond.wait(Lock, [pRenderThread]() -> bool { return pRenderThread->m_Started; }); @@ -7260,7 +7260,7 @@ public: { for(size_t i = 0; i < m_ThreadCount - 1; ++i) { - auto *pThread = m_RenderThreads[i].get(); + auto *pThread = m_vpRenderThreads[i].get(); { std::unique_lock Lock(pThread->m_Mutex); pThread->m_Finished = true; @@ -7268,9 +7268,9 @@ public: } pThread->m_Thread.join(); } - m_RenderThreads.clear(); - m_ThreadCommandLists.clear(); - m_ThreadHelperHadCommands.clear(); + m_vpRenderThreads.clear(); + m_vvThreadCommandLists.clear(); + m_vThreadHelperHadCommands.clear(); m_ThreadCount = 1; @@ -7298,7 +7298,7 @@ public: void RunThread(size_t ThreadIndex) { - auto *pThread = m_RenderThreads[ThreadIndex].get(); + auto *pThread = m_vpRenderThreads[ThreadIndex].get(); std::unique_lock Lock(pThread->m_Mutex); pThread->m_Started = true; pThread->m_Cond.notify_one(); @@ -7318,15 +7318,15 @@ public: if(!pThread->m_Finished) { - for(auto &NextCmd : m_ThreadCommandLists[ThreadIndex]) + for(auto &NextCmd : m_vvThreadCommandLists[ThreadIndex]) { m_aCommandCallbacks[CommandBufferCMDOff(NextCmd.m_Command)].m_CommandCB(NextCmd.m_pRawCommand, NextCmd); } - m_ThreadCommandLists[ThreadIndex].clear(); + m_vvThreadCommandLists[ThreadIndex].clear(); - if(m_UsedThreadDrawCommandBuffer[ThreadIndex + 1][m_CurImageIndex]) + if(m_vvUsedThreadDrawCommandBuffer[ThreadIndex + 1][m_CurImageIndex]) { - auto &GraphicThreadCommandBuffer = m_ThreadDrawCommandBuffers[ThreadIndex + 1][m_CurImageIndex]; + auto &GraphicThreadCommandBuffer = m_vvThreadDrawCommandBuffers[ThreadIndex + 1][m_CurImageIndex]; vkEndCommandBuffer(GraphicThreadCommandBuffer); } } diff --git a/src/engine/client/client.cpp b/src/engine/client/client.cpp index f8935cd98..aa9db34ca 100644 --- a/src/engine/client/client.cpp +++ b/src/engine/client/client.cpp @@ -3269,7 +3269,7 @@ void CClient::Run() { // write down the config and quit if(!m_pConfigManager->Save()) - m_Warnings.emplace_back(SWarning(Localize("Saving ddnet-settings.cfg failed"))); + m_vWarnings.emplace_back(SWarning(Localize("Saving ddnet-settings.cfg failed"))); s_SavedConfig = true; } @@ -3280,7 +3280,7 @@ void CClient::Run() m_pStorage->RemoveFile(m_aDDNetInfoTmp, IStorage::TYPE_SAVE); } - if(m_Warnings.empty() && !GameClient()->IsDisplayingWarning()) + if(m_vWarnings.empty() && !GameClient()->IsDisplayingWarning()) break; } @@ -4651,18 +4651,18 @@ void CClient::GetSmoothTick(int *pSmoothTick, float *pSmoothIntraTick, float Mix SWarning *CClient::GetCurWarning() { - if(m_Warnings.empty()) + if(m_vWarnings.empty()) { return NULL; } - else if(m_Warnings[0].m_WasShown) + else if(m_vWarnings[0].m_WasShown) { - m_Warnings.erase(m_Warnings.begin()); + m_vWarnings.erase(m_vWarnings.begin()); return NULL; } else { - return &m_Warnings[0]; + return &m_vWarnings[0]; } } diff --git a/src/engine/client/client.h b/src/engine/client/client.h index e7714697b..b7295ea30 100644 --- a/src/engine/client/client.h +++ b/src/engine/client/client.h @@ -274,7 +274,7 @@ class CClient : public IClient, public CDemoPlayer::IListener static void GraphicsThreadProxy(void *pThis) { ((CClient *)pThis)->GraphicsThread(); } void GraphicsThread(); - std::vector m_Warnings; + std::vector m_vWarnings; #if defined(CONF_FAMILY_UNIX) CFifo m_Fifo; diff --git a/src/engine/client/graphics_threaded.cpp b/src/engine/client/graphics_threaded.cpp index dd11fa855..59fcbc96c 100644 --- a/src/engine/client/graphics_threaded.cpp +++ b/src/engine/client/graphics_threaded.cpp @@ -275,7 +275,7 @@ int CGraphics_Threaded::UnloadTexture(CTextureHandle *pIndex) AddCmd( Cmd, [] { return true; }, "failed to unload texture."); - m_TextureIndices[pIndex->Id()] = m_FirstFreeTexture; + m_vTextureIndices[pIndex->Id()] = m_FirstFreeTexture; m_FirstFreeTexture = pIndex->Id(); pIndex->Invalidate(); @@ -355,11 +355,11 @@ IGraphics::CTextureHandle CGraphics_Threaded::LoadSpriteTextureImpl(CImageInfo & { int bpp = ImageFormatToPixelSize(FromImageInfo.m_Format); - m_SpriteHelper.resize(w * h * bpp); + m_vSpriteHelper.resize((size_t)w * h * bpp); - CopyTextureFromTextureBufferSub(&m_SpriteHelper[0], w, h, (uint8_t *)FromImageInfo.m_pData, FromImageInfo.m_Width, FromImageInfo.m_Height, bpp, x, y, w, h); + CopyTextureFromTextureBufferSub(&m_vSpriteHelper[0], w, h, (uint8_t *)FromImageInfo.m_pData, FromImageInfo.m_Width, FromImageInfo.m_Height, bpp, x, y, w, h); - IGraphics::CTextureHandle RetHandle = LoadTextureRaw(w, h, FromImageInfo.m_Format, &m_SpriteHelper[0], FromImageInfo.m_Format, 0); + IGraphics::CTextureHandle RetHandle = LoadTextureRaw(w, h, FromImageInfo.m_Format, &m_vSpriteHelper[0], FromImageInfo.m_Format, 0); return RetHandle; } @@ -440,7 +440,7 @@ IGraphics::CTextureHandle CGraphics_Threaded::LoadTextureRaw(int Width, int Heig } str_format(NewWarning.m_aWarningMsg, sizeof(NewWarning.m_aWarningMsg), Localize("The width of texture %s is not divisible by %d, or the height is not divisible by %d, which might cause visual bugs."), aText, 16, 16); - m_Warnings.emplace_back(NewWarning); + m_vWarnings.emplace_back(NewWarning); } } @@ -451,18 +451,18 @@ IGraphics::CTextureHandle CGraphics_Threaded::LoadTextureRaw(int Width, int Heig int Tex = m_FirstFreeTexture; if(Tex == -1) { - size_t CurSize = m_TextureIndices.size(); - m_TextureIndices.resize(CurSize * 2); + size_t CurSize = m_vTextureIndices.size(); + m_vTextureIndices.resize(CurSize * 2); for(size_t i = 0; i < CurSize - 1; ++i) { - m_TextureIndices[CurSize + i] = CurSize + i + 1; + m_vTextureIndices[CurSize + i] = CurSize + i + 1; } - m_TextureIndices.back() = -1; + m_vTextureIndices.back() = -1; Tex = CurSize; } - m_FirstFreeTexture = m_TextureIndices[Tex]; - m_TextureIndices[Tex] = -1; + m_FirstFreeTexture = m_vTextureIndices[Tex]; + m_vTextureIndices[Tex] = -1; CCommandBuffer::SCommand_Texture_Create Cmd; Cmd.m_Slot = Tex; @@ -535,34 +535,34 @@ bool CGraphics_Threaded::LoadTextTextures(int Width, int Height, CTextureHandle int Tex = m_FirstFreeTexture; if(Tex == -1) { - size_t CurSize = m_TextureIndices.size(); - m_TextureIndices.resize(CurSize * 2); + size_t CurSize = m_vTextureIndices.size(); + m_vTextureIndices.resize(CurSize * 2); for(size_t i = 0; i < CurSize - 1; ++i) { - m_TextureIndices[CurSize + i] = CurSize + i + 1; + m_vTextureIndices[CurSize + i] = CurSize + i + 1; } - m_TextureIndices.back() = -1; + m_vTextureIndices.back() = -1; Tex = CurSize; } - m_FirstFreeTexture = m_TextureIndices[Tex]; - m_TextureIndices[Tex] = -1; + m_FirstFreeTexture = m_vTextureIndices[Tex]; + m_vTextureIndices[Tex] = -1; int Tex2 = m_FirstFreeTexture; if(Tex2 == -1) { - size_t CurSize = m_TextureIndices.size(); - m_TextureIndices.resize(CurSize * 2); + size_t CurSize = m_vTextureIndices.size(); + m_vTextureIndices.resize(CurSize * 2); for(size_t i = 0; i < CurSize - 1; ++i) { - m_TextureIndices[CurSize + i] = CurSize + i + 1; + m_vTextureIndices[CurSize + i] = CurSize + i + 1; } - m_TextureIndices.back() = -1; + m_vTextureIndices.back() = -1; Tex2 = CurSize; } - m_FirstFreeTexture = m_TextureIndices[Tex2]; - m_TextureIndices[Tex2] = -1; + m_FirstFreeTexture = m_vTextureIndices[Tex2]; + m_vTextureIndices[Tex2] = -1; CCommandBuffer::SCommand_TextTextures_Create Cmd; Cmd.m_Slot = Tex; @@ -590,10 +590,10 @@ bool CGraphics_Threaded::UnloadTextTextures(CTextureHandle &TextTexture, CTextur AddCmd( Cmd, [] { return true; }, "failed to unload text textures."); - m_TextureIndices[TextTexture.Id()] = m_FirstFreeTexture; + m_vTextureIndices[TextTexture.Id()] = m_FirstFreeTexture; m_FirstFreeTexture = TextTexture.Id(); - m_TextureIndices[TextOutlineTexture.Id()] = m_FirstFreeTexture; + m_vTextureIndices[TextOutlineTexture.Id()] = m_FirstFreeTexture; m_FirstFreeTexture = TextOutlineTexture.Id(); TextTexture.Invalidate(); @@ -694,7 +694,7 @@ bool CGraphics_Threaded::CheckImageDivisibility(const char *pFileName, CImageInf SWarning NewWarning; str_format(NewWarning.m_aWarningMsg, sizeof(NewWarning.m_aWarningMsg), Localize("The width of texture %s is not divisible by %d, or the height is not divisible by %d, which might cause visual bugs."), pFileName, DivX, DivY); - m_Warnings.emplace_back(NewWarning); + m_vWarnings.emplace_back(NewWarning); ImageIsValid = false; } @@ -746,7 +746,7 @@ bool CGraphics_Threaded::IsImageFormatRGBA(const char *pFileName, CImageInfo &Im } str_format(NewWarning.m_aWarningMsg, sizeof(NewWarning.m_aWarningMsg), Localize("The format of texture %s is not RGBA which will cause visual bugs."), aText); - m_Warnings.emplace_back(NewWarning); + m_vWarnings.emplace_back(NewWarning); return false; } return true; @@ -1396,14 +1396,14 @@ int CGraphics_Threaded::CreateQuadContainer(bool AutomaticUpload) int Index = -1; if(m_FirstFreeQuadContainer == -1) { - Index = m_QuadContainers.size(); - m_QuadContainers.emplace_back(AutomaticUpload); + Index = m_vQuadContainers.size(); + m_vQuadContainers.emplace_back(AutomaticUpload); } else { Index = m_FirstFreeQuadContainer; - m_FirstFreeQuadContainer = m_QuadContainers[Index].m_FreeIndex; - m_QuadContainers[Index].m_FreeIndex = Index; + m_FirstFreeQuadContainer = m_vQuadContainers[Index].m_FreeIndex; + m_vQuadContainers[Index].m_FreeIndex = Index; } return Index; @@ -1411,7 +1411,7 @@ int CGraphics_Threaded::CreateQuadContainer(bool AutomaticUpload) void CGraphics_Threaded::QuadContainerChangeAutomaticUpload(int ContainerIndex, bool AutomaticUpload) { - SQuadContainer &Container = m_QuadContainers[ContainerIndex]; + SQuadContainer &Container = m_vQuadContainers[ContainerIndex]; Container.m_AutomaticUpload = AutomaticUpload; } @@ -1419,18 +1419,18 @@ void CGraphics_Threaded::QuadContainerUpload(int ContainerIndex) { if(IsQuadContainerBufferingEnabled()) { - SQuadContainer &Container = m_QuadContainers[ContainerIndex]; - if(!Container.m_Quads.empty()) + SQuadContainer &Container = m_vQuadContainers[ContainerIndex]; + if(!Container.m_vQuads.empty()) { if(Container.m_QuadBufferObjectIndex == -1) { - size_t UploadDataSize = Container.m_Quads.size() * sizeof(SQuadContainer::SQuad); - Container.m_QuadBufferObjectIndex = CreateBufferObject(UploadDataSize, &Container.m_Quads[0], 0); + size_t UploadDataSize = Container.m_vQuads.size() * sizeof(SQuadContainer::SQuad); + Container.m_QuadBufferObjectIndex = CreateBufferObject(UploadDataSize, &Container.m_vQuads[0], 0); } else { - size_t UploadDataSize = Container.m_Quads.size() * sizeof(SQuadContainer::SQuad); - RecreateBufferObject(Container.m_QuadBufferObjectIndex, UploadDataSize, &Container.m_Quads[0], 0); + size_t UploadDataSize = Container.m_vQuads.size() * sizeof(SQuadContainer::SQuad); + RecreateBufferObject(Container.m_QuadBufferObjectIndex, UploadDataSize, &Container.m_vQuads[0], 0); } if(Container.m_QuadBufferContainerIndex == -1) @@ -1439,22 +1439,22 @@ void CGraphics_Threaded::QuadContainerUpload(int ContainerIndex) Info.m_Stride = sizeof(CCommandBuffer::SVertex); Info.m_VertBufferBindingIndex = Container.m_QuadBufferObjectIndex; - Info.m_Attributes.emplace_back(); - SBufferContainerInfo::SAttribute *pAttr = &Info.m_Attributes.back(); + Info.m_vAttributes.emplace_back(); + SBufferContainerInfo::SAttribute *pAttr = &Info.m_vAttributes.back(); pAttr->m_DataTypeCount = 2; pAttr->m_FuncType = 0; pAttr->m_Normalized = false; pAttr->m_pOffset = 0; pAttr->m_Type = GRAPHICS_TYPE_FLOAT; - Info.m_Attributes.emplace_back(); - pAttr = &Info.m_Attributes.back(); + Info.m_vAttributes.emplace_back(); + pAttr = &Info.m_vAttributes.back(); pAttr->m_DataTypeCount = 2; pAttr->m_FuncType = 0; pAttr->m_Normalized = false; pAttr->m_pOffset = (void *)(sizeof(float) * 2); pAttr->m_Type = GRAPHICS_TYPE_FLOAT; - Info.m_Attributes.emplace_back(); - pAttr = &Info.m_Attributes.back(); + Info.m_vAttributes.emplace_back(); + pAttr = &Info.m_vAttributes.back(); pAttr->m_DataTypeCount = 4; pAttr->m_FuncType = 0; pAttr->m_Normalized = true; @@ -1469,17 +1469,17 @@ void CGraphics_Threaded::QuadContainerUpload(int ContainerIndex) int CGraphics_Threaded::QuadContainerAddQuads(int ContainerIndex, CQuadItem *pArray, int Num) { - SQuadContainer &Container = m_QuadContainers[ContainerIndex]; + SQuadContainer &Container = m_vQuadContainers[ContainerIndex]; - if((int)Container.m_Quads.size() > Num + CCommandBuffer::CCommandBuffer::MAX_VERTICES) + if((int)Container.m_vQuads.size() > Num + CCommandBuffer::CCommandBuffer::MAX_VERTICES) return -1; - int RetOff = (int)Container.m_Quads.size(); + int RetOff = (int)Container.m_vQuads.size(); for(int i = 0; i < Num; ++i) { - Container.m_Quads.emplace_back(); - SQuadContainer::SQuad &Quad = Container.m_Quads.back(); + Container.m_vQuads.emplace_back(); + SQuadContainer::SQuad &Quad = Container.m_vQuads.back(); Quad.m_aVertices[0].m_Pos.x = pArray[i].m_X; Quad.m_aVertices[0].m_Pos.y = pArray[i].m_Y; @@ -1519,17 +1519,17 @@ int CGraphics_Threaded::QuadContainerAddQuads(int ContainerIndex, CQuadItem *pAr int CGraphics_Threaded::QuadContainerAddQuads(int ContainerIndex, CFreeformItem *pArray, int Num) { - SQuadContainer &Container = m_QuadContainers[ContainerIndex]; + SQuadContainer &Container = m_vQuadContainers[ContainerIndex]; - if((int)Container.m_Quads.size() > Num + CCommandBuffer::CCommandBuffer::MAX_VERTICES) + if((int)Container.m_vQuads.size() > Num + CCommandBuffer::CCommandBuffer::MAX_VERTICES) return -1; - int RetOff = (int)Container.m_Quads.size(); + int RetOff = (int)Container.m_vQuads.size(); for(int i = 0; i < Num; ++i) { - Container.m_Quads.emplace_back(); - SQuadContainer::SQuad &Quad = Container.m_Quads.back(); + Container.m_vQuads.emplace_back(); + SQuadContainer::SQuad &Quad = Container.m_vQuads.back(); Quad.m_aVertices[0].m_Pos.x = pArray[i].m_X0; Quad.m_aVertices[0].m_Pos.y = pArray[i].m_Y0; @@ -1560,13 +1560,13 @@ int CGraphics_Threaded::QuadContainerAddQuads(int ContainerIndex, CFreeformItem void CGraphics_Threaded::QuadContainerReset(int ContainerIndex) { - SQuadContainer &Container = m_QuadContainers[ContainerIndex]; + SQuadContainer &Container = m_vQuadContainers[ContainerIndex]; if(IsQuadContainerBufferingEnabled()) { if(Container.m_QuadBufferContainerIndex != -1) DeleteBufferContainer(Container.m_QuadBufferContainerIndex, true); } - Container.m_Quads.clear(); + Container.m_vQuads.clear(); Container.m_QuadBufferContainerIndex = Container.m_QuadBufferObjectIndex = -1; } @@ -1575,7 +1575,7 @@ void CGraphics_Threaded::DeleteQuadContainer(int ContainerIndex) QuadContainerReset(ContainerIndex); // also clear the container index - m_QuadContainers[ContainerIndex].m_FreeIndex = m_FirstFreeQuadContainer; + m_vQuadContainers[ContainerIndex].m_FreeIndex = m_FirstFreeQuadContainer; m_FirstFreeQuadContainer = ContainerIndex; } @@ -1586,12 +1586,12 @@ void CGraphics_Threaded::RenderQuadContainer(int ContainerIndex, int QuadDrawNum void CGraphics_Threaded::RenderQuadContainer(int ContainerIndex, int QuadOffset, int QuadDrawNum, bool ChangeWrapMode) { - SQuadContainer &Container = m_QuadContainers[ContainerIndex]; + SQuadContainer &Container = m_vQuadContainers[ContainerIndex]; if(QuadDrawNum == -1) - QuadDrawNum = (int)Container.m_Quads.size() - QuadOffset; + QuadDrawNum = (int)Container.m_vQuads.size() - QuadOffset; - if((int)Container.m_Quads.size() < QuadOffset + QuadDrawNum || QuadDrawNum == 0) + if((int)Container.m_vQuads.size() < QuadOffset + QuadDrawNum || QuadDrawNum == 0) return; if(IsQuadContainerBufferingEnabled()) @@ -1622,7 +1622,7 @@ void CGraphics_Threaded::RenderQuadContainer(int ContainerIndex, int QuadOffset, { for(int i = 0; i < QuadDrawNum; ++i) { - SQuadContainer::SQuad &Quad = Container.m_Quads[QuadOffset + i]; + SQuadContainer::SQuad &Quad = Container.m_vQuads[QuadOffset + i]; m_aVertices[i * 6] = Quad.m_aVertices[0]; m_aVertices[i * 6 + 1] = Quad.m_aVertices[1]; m_aVertices[i * 6 + 2] = Quad.m_aVertices[2]; @@ -1634,7 +1634,7 @@ void CGraphics_Threaded::RenderQuadContainer(int ContainerIndex, int QuadOffset, } else { - mem_copy(m_aVertices, &Container.m_Quads[QuadOffset], sizeof(CCommandBuffer::SVertex) * 4 * QuadDrawNum); + mem_copy(m_aVertices, &Container.m_vQuads[QuadOffset], sizeof(CCommandBuffer::SVertex) * 4 * QuadDrawNum); m_NumVertices += 4 * QuadDrawNum; } m_Drawing = DRAWING_QUADS; @@ -1648,20 +1648,20 @@ void CGraphics_Threaded::RenderQuadContainer(int ContainerIndex, int QuadOffset, void CGraphics_Threaded::RenderQuadContainerEx(int ContainerIndex, int QuadOffset, int QuadDrawNum, float X, float Y, float ScaleX, float ScaleY) { - SQuadContainer &Container = m_QuadContainers[ContainerIndex]; + SQuadContainer &Container = m_vQuadContainers[ContainerIndex]; - if((int)Container.m_Quads.size() < QuadOffset + 1) + if((int)Container.m_vQuads.size() < QuadOffset + 1) return; if(QuadDrawNum == -1) - QuadDrawNum = (int)Container.m_Quads.size() - QuadOffset; + QuadDrawNum = (int)Container.m_vQuads.size() - QuadOffset; if(IsQuadContainerBufferingEnabled()) { if(Container.m_QuadBufferContainerIndex == -1) return; - SQuadContainer::SQuad &Quad = Container.m_Quads[QuadOffset]; + SQuadContainer::SQuad &Quad = Container.m_vQuads[QuadOffset]; CCommandBuffer::SCommand_RenderQuadContainerEx Cmd; WrapClamp(); @@ -1701,7 +1701,7 @@ void CGraphics_Threaded::RenderQuadContainerEx(int ContainerIndex, int QuadOffse { for(int i = 0; i < QuadDrawNum; ++i) { - SQuadContainer::SQuad &Quad = Container.m_Quads[QuadOffset + i]; + SQuadContainer::SQuad &Quad = Container.m_vQuads[QuadOffset + i]; m_aVertices[i * 6 + 0] = Quad.m_aVertices[0]; m_aVertices[i * 6 + 1] = Quad.m_aVertices[1]; m_aVertices[i * 6 + 2] = Quad.m_aVertices[2]; @@ -1736,7 +1736,7 @@ void CGraphics_Threaded::RenderQuadContainerEx(int ContainerIndex, int QuadOffse } else { - mem_copy(m_aVertices, &Container.m_Quads[QuadOffset], sizeof(CCommandBuffer::SVertex) * 4 * QuadDrawNum); + mem_copy(m_aVertices, &Container.m_vQuads[QuadOffset], sizeof(CCommandBuffer::SVertex) * 4 * QuadDrawNum); for(int i = 0; i < QuadDrawNum; ++i) { for(int n = 0; n < 4; ++n) @@ -1778,7 +1778,7 @@ void CGraphics_Threaded::RenderQuadContainerAsSprite(int ContainerIndex, int Qua void CGraphics_Threaded::RenderQuadContainerAsSpriteMultiple(int ContainerIndex, int QuadOffset, int DrawCount, SRenderSpriteInfo *pRenderInfo) { - SQuadContainer &Container = m_QuadContainers[ContainerIndex]; + SQuadContainer &Container = m_vQuadContainers[ContainerIndex]; if(DrawCount == 0) return; @@ -1789,7 +1789,7 @@ void CGraphics_Threaded::RenderQuadContainerAsSpriteMultiple(int ContainerIndex, return; WrapClamp(); - SQuadContainer::SQuad &Quad = Container.m_Quads[0]; + SQuadContainer::SQuad &Quad = Container.m_vQuads[0]; CCommandBuffer::SCommand_RenderQuadContainerAsSpriteMultiple Cmd; Cmd.m_State = m_State; @@ -1876,14 +1876,14 @@ int CGraphics_Threaded::CreateBufferObject(size_t UploadDataSize, void *pUploadD int Index = -1; if(m_FirstFreeBufferObjectIndex == -1) { - Index = m_BufferObjectIndices.size(); - m_BufferObjectIndices.push_back(Index); + Index = m_vBufferObjectIndices.size(); + m_vBufferObjectIndices.push_back(Index); } else { Index = m_FirstFreeBufferObjectIndex; - m_FirstFreeBufferObjectIndex = m_BufferObjectIndices[Index]; - m_BufferObjectIndices[Index] = Index; + m_FirstFreeBufferObjectIndex = m_vBufferObjectIndices[Index]; + m_vBufferObjectIndices[Index] = Index; } CCommandBuffer::SCommand_CreateBufferObject Cmd; @@ -2096,7 +2096,7 @@ void CGraphics_Threaded::DeleteBufferObject(int BufferIndex) } // also clear the buffer object index - m_BufferObjectIndices[BufferIndex] = m_FirstFreeBufferObjectIndex; + m_vBufferObjectIndices[BufferIndex] = m_FirstFreeBufferObjectIndex; m_FirstFreeBufferObjectIndex = BufferIndex; } @@ -2117,7 +2117,7 @@ int CGraphics_Threaded::CreateBufferContainer(SBufferContainerInfo *pContainerIn CCommandBuffer::SCommand_CreateBufferContainer Cmd; Cmd.m_BufferContainerIndex = Index; - Cmd.m_AttrCount = (int)pContainerInfo->m_Attributes.size(); + Cmd.m_AttrCount = (int)pContainerInfo->m_vAttributes.size(); Cmd.m_Stride = pContainerInfo->m_Stride; Cmd.m_VertBufferBindingIndex = pContainerInfo->m_VertBufferBindingIndex; @@ -2140,7 +2140,7 @@ int CGraphics_Threaded::CreateBufferContainer(SBufferContainerInfo *pContainerIn return -1; } - mem_copy(Cmd.m_pAttributes, pContainerInfo->m_Attributes.data(), Cmd.m_AttrCount * sizeof(SBufferContainerInfo::SAttribute)); + mem_copy(Cmd.m_pAttributes, pContainerInfo->m_vAttributes.data(), Cmd.m_AttrCount * sizeof(SBufferContainerInfo::SAttribute)); m_VertexArrayInfo[Index].m_AssociatedBufferObjectIndex = pContainerInfo->m_VertBufferBindingIndex; @@ -2168,7 +2168,7 @@ void CGraphics_Threaded::DeleteBufferContainer(int ContainerIndex, bool DestroyA if(BufferObjectIndex != -1) { // clear the buffer object index - m_BufferObjectIndices[BufferObjectIndex] = m_FirstFreeBufferObjectIndex; + m_vBufferObjectIndices[BufferObjectIndex] = m_FirstFreeBufferObjectIndex; m_FirstFreeBufferObjectIndex = BufferObjectIndex; } } @@ -2183,7 +2183,7 @@ void CGraphics_Threaded::UpdateBufferContainerInternal(int ContainerIndex, SBuff { CCommandBuffer::SCommand_UpdateBufferContainer Cmd; Cmd.m_BufferContainerIndex = ContainerIndex; - Cmd.m_AttrCount = (int)pContainerInfo->m_Attributes.size(); + Cmd.m_AttrCount = (int)pContainerInfo->m_vAttributes.size(); Cmd.m_Stride = pContainerInfo->m_Stride; Cmd.m_VertBufferBindingIndex = pContainerInfo->m_VertBufferBindingIndex; @@ -2206,7 +2206,7 @@ void CGraphics_Threaded::UpdateBufferContainerInternal(int ContainerIndex, SBuff return; } - mem_copy(Cmd.m_pAttributes, pContainerInfo->m_Attributes.data(), Cmd.m_AttrCount * sizeof(SBufferContainerInfo::SAttribute)); + mem_copy(Cmd.m_pAttributes, pContainerInfo->m_vAttributes.data(), Cmd.m_AttrCount * sizeof(SBufferContainerInfo::SAttribute)); m_VertexArrayInfo[ContainerIndex].m_AssociatedBufferObjectIndex = pContainerInfo->m_VertBufferBindingIndex; } @@ -2307,7 +2307,7 @@ void CGraphics_Threaded::AddBackEndWarningIfExists() { SWarning NewWarning; str_format(NewWarning.m_aWarningMsg, sizeof(NewWarning.m_aWarningMsg), "%s", Localize(pErrStr)); - m_Warnings.emplace_back(NewWarning); + m_vWarnings.emplace_back(NewWarning); } } @@ -2446,10 +2446,10 @@ int CGraphics_Threaded::Init() // init textures m_FirstFreeTexture = 0; - m_TextureIndices.resize(CCommandBuffer::MAX_TEXTURES); - for(int i = 0; i < (int)m_TextureIndices.size() - 1; i++) - m_TextureIndices[i] = i + 1; - m_TextureIndices.back() = -1; + m_vTextureIndices.resize(CCommandBuffer::MAX_TEXTURES); + for(int i = 0; i < (int)m_vTextureIndices.size() - 1; i++) + m_vTextureIndices[i] = i + 1; + m_vTextureIndices.back() = -1; m_FirstFreeVertexArrayInfo = -1; m_FirstFreeBufferObjectIndex = -1; @@ -2609,13 +2609,13 @@ void CGraphics_Threaded::GotResized(int w, int h, int RefreshRate) KickCommandBuffer(); WaitForIdle(); - for(auto &ResizeListener : m_ResizeListeners) + for(auto &ResizeListener : m_vResizeListeners) ResizeListener.m_pFunc(ResizeListener.m_pUser); } void CGraphics_Threaded::AddWindowResizeListener(WINDOW_RESIZE_FUNC pFunc, void *pUser) { - m_ResizeListeners.emplace_back(pFunc, pUser); + m_vResizeListeners.emplace_back(pFunc, pUser); } int CGraphics_Threaded::GetWindowScreen() @@ -2696,12 +2696,12 @@ void CGraphics_Threaded::TakeCustomScreenshot(const char *pFilename) void CGraphics_Threaded::Swap() { - if(!m_Warnings.empty()) + if(!m_vWarnings.empty()) { SWarning *pCurWarning = GetCurWarning(); if(pCurWarning->m_WasShown) { - m_Warnings.erase(m_Warnings.begin()); + m_vWarnings.erase(m_vWarnings.begin()); } } @@ -2816,11 +2816,11 @@ void CGraphics_Threaded::WaitForIdle() SWarning *CGraphics_Threaded::GetCurWarning() { - if(m_Warnings.empty()) + if(m_vWarnings.empty()) return NULL; else { - SWarning *pCurWarning = &m_Warnings[0]; + SWarning *pCurWarning = &m_vWarnings[0]; return pCurWarning; } } diff --git a/src/engine/client/graphics_threaded.h b/src/engine/client/graphics_threaded.h index 2fd0abca6..b3379a657 100644 --- a/src/engine/client/graphics_threaded.h +++ b/src/engine/client/graphics_threaded.h @@ -818,13 +818,13 @@ class CGraphics_Threaded : public IEngineGraphics CTextureHandle m_InvalidTexture; - std::vector m_TextureIndices; + std::vector m_vTextureIndices; int m_FirstFreeTexture; int m_TextureMemoryUsage; - std::vector m_SpriteHelper; + std::vector m_vSpriteHelper; - std::vector m_Warnings; + std::vector m_vWarnings; // is a non full windowed (in a sense that the viewport won't include the whole window), // forced viewport, so that it justifies our UI ratio needs @@ -842,14 +842,14 @@ class CGraphics_Threaded : public IEngineGraphics std::vector m_VertexArrayInfo; int m_FirstFreeVertexArrayInfo; - std::vector m_BufferObjectIndices; + std::vector m_vBufferObjectIndices; int m_FirstFreeBufferObjectIndex; struct SQuadContainer { SQuadContainer(bool AutomaticUpload = true) { - m_Quads.clear(); + m_vQuads.clear(); m_QuadBufferObjectIndex = m_QuadBufferContainerIndex = -1; m_FreeIndex = -1; @@ -861,7 +861,7 @@ class CGraphics_Threaded : public IEngineGraphics CCommandBuffer::SVertex m_aVertices[4]; }; - std::vector m_Quads; + std::vector m_vQuads; int m_QuadBufferObjectIndex; int m_QuadBufferContainerIndex; @@ -870,7 +870,7 @@ class CGraphics_Threaded : public IEngineGraphics bool m_AutomaticUpload; }; - std::vector m_QuadContainers; + std::vector m_vQuadContainers; int m_FirstFreeQuadContainer; struct SWindowResizeListener @@ -880,7 +880,7 @@ class CGraphics_Threaded : public IEngineGraphics WINDOW_RESIZE_FUNC m_pFunc; void *m_pUser; }; - std::vector m_ResizeListeners; + std::vector m_vResizeListeners; void *AllocCommandBufferData(unsigned AllocSize); diff --git a/src/engine/client/serverbrowser.cpp b/src/engine/client/serverbrowser.cpp index d2890f246..c0cd55f27 100644 --- a/src/engine/client/serverbrowser.cpp +++ b/src/engine/client/serverbrowser.cpp @@ -573,7 +573,7 @@ CServerBrowser::CServerEntry *CServerBrowser::Add(const NETADDR &Addr) CNetworkCountry *pCntr = &Network.m_aCountries[i]; for(int j = 0; j < pCntr->m_NumServers; j++) { - if(net_addr_comp(&Addr, &pCntr->m_aServers[j]) == 0) + if(net_addr_comp(&Addr, &pCntr->m_vServers[j]) == 0) { pEntry->m_Info.m_Official = true; break; @@ -1016,7 +1016,7 @@ void CServerBrowser::UpdateFromHttp() if(DDNetFiltered(pExcludeTypes, pCntr->m_aTypes[g])) continue; - aWantedAddresses.push_back(CWantedAddr{pCntr->m_aServers[g], false, false}); + aWantedAddresses.push_back(CWantedAddr{pCntr->m_vServers[g], false, false}); } } } @@ -1415,7 +1415,7 @@ void CServerBrowser::LoadDDNetServers() continue; } const char *pStr = json_string_get(pAddr); - net_addr_from_str(&pCntr->m_aServers[pCntr->m_NumServers], pStr); + net_addr_from_str(&pCntr->m_vServers[pCntr->m_NumServers], pStr); str_copy(pCntr->m_aTypes[pCntr->m_NumServers], pType, sizeof(pCntr->m_aTypes[pCntr->m_NumServers])); } } @@ -1434,7 +1434,7 @@ void CServerBrowser::RecheckOfficial() CNetworkCountry *pCntr = &Network.m_aCountries[i]; for(int j = 0; j < pCntr->m_NumServers; j++) { - CServerEntry *pEntry = Find(pCntr->m_aServers[j]); + CServerEntry *pEntry = Find(pCntr->m_vServers[j]); if(pEntry) { pEntry->m_Info.m_Official = true; @@ -1538,7 +1538,7 @@ const char *CServerBrowser::GetTutorialServer() CNetworkCountry *pCntr = &pNetwork->m_aCountries[i]; for(int j = 0; j < pCntr->m_NumServers; j++) { - CServerEntry *pEntry = Find(pCntr->m_aServers[j]); + CServerEntry *pEntry = Find(pCntr->m_vServers[j]); if(!pEntry) continue; if(str_find(pEntry->m_Info.m_aName, "(Tutorial)") == 0) diff --git a/src/engine/client/serverbrowser.h b/src/engine/client/serverbrowser.h index e4d2db7cd..c7827d7fb 100644 --- a/src/engine/client/serverbrowser.h +++ b/src/engine/client/serverbrowser.h @@ -42,7 +42,7 @@ public: char m_aName[256]; int m_FlagID; - NETADDR m_aServers[MAX_SERVERS]; + NETADDR m_vServers[MAX_SERVERS]; char m_aTypes[MAX_SERVERS][32]; int m_NumServers; @@ -55,7 +55,7 @@ public: /*void Add(NETADDR Addr, char* pType) { if (m_NumServers < MAX_SERVERS) { - m_aServers[m_NumServers] = Addr; + m_vServers[m_NumServers] = Addr; str_copy(m_aTypes[m_NumServers], pType, sizeof(m_aTypes[0])); m_NumServers++; } diff --git a/src/engine/client/serverbrowser_http.cpp b/src/engine/client/serverbrowser_http.cpp index 56f503724..e80086aa5 100644 --- a/src/engine/client/serverbrowser_http.cpp +++ b/src/engine/client/serverbrowser_http.cpp @@ -258,25 +258,25 @@ public: int NumServers() const override { - return m_aServers.size(); + return m_vServers.size(); } const NETADDR &ServerAddress(int Index) const override { - return m_aServers[Index].m_Addr; + return m_vServers[Index].m_Addr; } void Server(int Index, NETADDR *pAddr, CServerInfo *pInfo) const override { - const CEntry &Entry = m_aServers[Index]; + const CEntry &Entry = m_vServers[Index]; *pAddr = Entry.m_Addr; *pInfo = Entry.m_Info; } int NumLegacyServers() const override { - return m_aLegacyServers.size(); + return m_vLegacyServers.size(); } const NETADDR &LegacyServer(int Index) const override { - return m_aLegacyServers[Index]; + return m_vLegacyServers[Index]; } private: @@ -305,8 +305,8 @@ private: std::shared_ptr m_pGetServers; std::unique_ptr m_pChooseMaster; - std::vector m_aServers; - std::vector m_aLegacyServers; + std::vector m_vServers; + std::vector m_vLegacyServers; }; CServerBrowserHttp::CServerBrowserHttp(IEngine *pEngine, IConsole *pConsole, const char **ppUrls, int NumUrls, int PreviousBestIndex) : @@ -358,7 +358,7 @@ void CServerBrowserHttp::Update() bool Success = true; json_value *pJson = pGetServers->ResultJson(); Success = Success && pJson; - Success = Success && !Parse(pJson, &m_aServers, &m_aLegacyServers); + Success = Success && !Parse(pJson, &m_vServers, &m_vLegacyServers); json_value_free(pJson); if(!Success) { diff --git a/src/engine/client/serverbrowser_ping_cache.cpp b/src/engine/client/serverbrowser_ping_cache.cpp index e674d2670..4fb957e25 100644 --- a/src/engine/client/serverbrowser_ping_cache.cpp +++ b/src/engine/client/serverbrowser_ping_cache.cpp @@ -26,8 +26,8 @@ private: CSqliteStmt m_pLoadStmt; CSqliteStmt m_pStoreStmt; - std::vector m_aEntries; - std::vector m_aNewEntries; + std::vector m_vEntries; + std::vector m_vNewEntries; }; CServerBrowserPingCache::CServerBrowserPingCache(IConsole *pConsole, IStorage *pStorage) : @@ -55,7 +55,7 @@ void CServerBrowserPingCache::Load() { if(m_pDisk) { - int PrevNewEntriesSize = m_aNewEntries.size(); + int PrevNewEntriesSize = m_vNewEntries.size(); sqlite3 *pSqlite = m_pDisk.get(); IConsole *pConsole = m_pConsole; @@ -85,7 +85,7 @@ void CServerBrowserPingCache::Load() } continue; } - m_aNewEntries.push_back(CEntry{Addr, Ping}); + m_vNewEntries.push_back(CEntry{Addr, Ping}); } else { @@ -95,7 +95,7 @@ void CServerBrowserPingCache::Load() if(Error) { pConsole->Print(IConsole::OUTPUT_LEVEL_STANDARD, "serverbrowse_ping_cache", "failed to load ping cache"); - m_aNewEntries.resize(PrevNewEntriesSize); + m_vNewEntries.resize(PrevNewEntriesSize); } } } @@ -103,7 +103,7 @@ void CServerBrowserPingCache::Load() void CServerBrowserPingCache::CachePing(NETADDR Addr, int Ping) { Addr.port = 0; - m_aNewEntries.push_back(CEntry{Addr, Ping}); + m_vNewEntries.push_back(CEntry{Addr, Ping}); if(m_pDisk) { sqlite3 *pSqlite = m_pDisk.get(); @@ -126,7 +126,7 @@ void CServerBrowserPingCache::CachePing(NETADDR Addr, int Ping) void CServerBrowserPingCache::GetPingCache(const CEntry **ppEntries, int *pNumEntries) { - if(!m_aNewEntries.empty()) + if(!m_vNewEntries.empty()) { class CAddrComparer { @@ -137,44 +137,44 @@ void CServerBrowserPingCache::GetPingCache(const CEntry **ppEntries, int *pNumEn } }; std::vector aOldEntries; - std::swap(m_aEntries, aOldEntries); + std::swap(m_vEntries, aOldEntries); // Remove duplicates, keeping newer ones. - std::stable_sort(m_aNewEntries.begin(), m_aNewEntries.end(), CAddrComparer()); + std::stable_sort(m_vNewEntries.begin(), m_vNewEntries.end(), CAddrComparer()); { unsigned To = 0; - for(unsigned int From = 0; From < m_aNewEntries.size(); From++) + for(unsigned int From = 0; From < m_vNewEntries.size(); From++) { if(To < From) { - m_aNewEntries[To] = m_aNewEntries[From]; + m_vNewEntries[To] = m_vNewEntries[From]; } - if(From + 1 >= m_aNewEntries.size() || - net_addr_comp(&m_aNewEntries[From].m_Addr, &m_aNewEntries[From + 1].m_Addr) != 0) + if(From + 1 >= m_vNewEntries.size() || + net_addr_comp(&m_vNewEntries[From].m_Addr, &m_vNewEntries[From + 1].m_Addr) != 0) { To++; } } - m_aNewEntries.resize(To); + m_vNewEntries.resize(To); } // Only keep the new entries where there are duplicates. - m_aEntries.reserve(m_aNewEntries.size() + aOldEntries.size()); + m_vEntries.reserve(m_vNewEntries.size() + aOldEntries.size()); { unsigned i = 0; unsigned j = 0; - while(i < aOldEntries.size() && j < m_aNewEntries.size()) + while(i < aOldEntries.size() && j < m_vNewEntries.size()) { - int Cmp = net_addr_comp(&aOldEntries[i].m_Addr, &m_aNewEntries[j].m_Addr); + int Cmp = net_addr_comp(&aOldEntries[i].m_Addr, &m_vNewEntries[j].m_Addr); if(Cmp != 0) { if(Cmp < 0) { - m_aEntries.push_back(aOldEntries[i]); + m_vEntries.push_back(aOldEntries[i]); i++; } else { - m_aEntries.push_back(m_aNewEntries[j]); + m_vEntries.push_back(m_vNewEntries[j]); j++; } } @@ -187,17 +187,17 @@ void CServerBrowserPingCache::GetPingCache(const CEntry **ppEntries, int *pNumEn // Add the remaining elements. for(; i < aOldEntries.size(); i++) { - m_aEntries.push_back(aOldEntries[i]); + m_vEntries.push_back(aOldEntries[i]); } - for(; j < m_aNewEntries.size(); j++) + for(; j < m_vNewEntries.size(); j++) { - m_aEntries.push_back(m_aNewEntries[j]); + m_vEntries.push_back(m_vNewEntries[j]); } } - m_aNewEntries.clear(); + m_vNewEntries.clear(); } - *ppEntries = m_aEntries.data(); - *pNumEntries = m_aEntries.size(); + *ppEntries = m_vEntries.data(); + *pNumEntries = m_vEntries.size(); } IServerBrowserPingCache *CreateServerBrowserPingCache(IConsole *pConsole, IStorage *pStorage) diff --git a/src/engine/client/text.cpp b/src/engine/client/text.cpp index 877918c26..f9000c44c 100644 --- a/src/engine/client/text.cpp +++ b/src/engine/client/text.cpp @@ -71,7 +71,7 @@ struct STextCharQuad struct STextureSkyline { // the height of each column - std::vector m_CurHeightOfPixelColumn; + std::vector m_vCurHeightOfPixelColumn; }; struct CFontSizeData @@ -94,7 +94,7 @@ public: free(m_pBuf); delete[] m_TextureData[0]; delete[] m_TextureData[1]; - for(auto &FtFallbackFont : m_FtFallbackFonts) + for(auto &FtFallbackFont : m_vFtFallbackFonts) { free(FtFallbackFont.m_pBuf); } @@ -128,7 +128,7 @@ public: FT_Face m_FtFace; }; - std::vector m_FtFallbackFonts; + std::vector m_vFtFallbackFonts; CFontSizeData m_aFontSizes[NUM_FONT_SIZES]; @@ -149,7 +149,7 @@ struct STextString size_t m_QuadNum; int m_SelectionQuadContainerIndex; - std::vector m_CharacterQuads; + std::vector m_vCharacterQuads; }; struct STextContainer @@ -191,7 +191,7 @@ struct STextContainer m_StringInfo.m_QuadBufferObjectIndex = m_StringInfo.m_QuadBufferContainerIndex = m_StringInfo.m_SelectionQuadContainerIndex = -1; m_StringInfo.m_QuadNum = 0; - m_StringInfo.m_CharacterQuads.clear(); + m_StringInfo.m_vCharacterQuads.clear(); m_AlignedStartX = m_AlignedStartY = m_X = m_Y = 0.f; m_Flags = m_LineCount = m_CharCount = m_GlyphCount = 0; @@ -216,13 +216,13 @@ class CTextRender : public IEngineTextRender unsigned int m_RenderFlags; - std::vector m_TextContainers; - std::vector m_TextContainerIndices; + std::vector m_vpTextContainers; + std::vector m_vTextContainerIndices; int m_FirstFreeTextContainerIndex; SBufferContainerInfo m_DefaultTextContainerInfo; - std::vector m_Fonts; + std::vector m_vpFonts; CFont *m_pCurFont; std::chrono::nanoseconds m_CursorRenderTime; @@ -231,41 +231,41 @@ class CTextRender : public IEngineTextRender { if(m_FirstFreeTextContainerIndex == -1) { - int Index = (int)m_TextContainerIndices.size(); - m_TextContainerIndices.push_back(Index); + int Index = (int)m_vTextContainerIndices.size(); + m_vTextContainerIndices.push_back(Index); return Index; } else { int Index = m_FirstFreeTextContainerIndex; - m_FirstFreeTextContainerIndex = m_TextContainerIndices[Index]; - m_TextContainerIndices[Index] = Index; + m_FirstFreeTextContainerIndex = m_vTextContainerIndices[Index]; + m_vTextContainerIndices[Index] = Index; return Index; } } void FreeTextContainerIndex(int Index) { - m_TextContainerIndices[Index] = m_FirstFreeTextContainerIndex; + m_vTextContainerIndices[Index] = m_FirstFreeTextContainerIndex; m_FirstFreeTextContainerIndex = Index; } void FreeTextContainer(int Index) { - m_TextContainers[Index]->Reset(); + m_vpTextContainers[Index]->Reset(); FreeTextContainerIndex(Index); } STextContainer &GetTextContainer(int Index) { - if(Index >= (int)m_TextContainers.size()) + if(Index >= (int)m_vpTextContainers.size()) { - int Size = (int)m_TextContainers.size(); + int Size = (int)m_vpTextContainers.size(); for(int i = 0; i < (Index + 1) - Size; ++i) - m_TextContainers.push_back(new STextContainer()); + m_vpTextContainers.push_back(new STextContainer()); } - return *m_TextContainers[Index]; + return *m_vpTextContainers[Index]; } int WordLength(const char *pText) @@ -353,7 +353,7 @@ class CTextRender : public IEngineTextRender delete[] pFont->m_TextureData[TextureIndex]; pFont->m_TextureData[TextureIndex] = pTmpTexBuffer; pFont->m_CurTextureDimensions[TextureIndex] = NewDimensions; - pFont->m_TextureSkyline[TextureIndex].m_CurHeightOfPixelColumn.resize(NewDimensions, 0); + pFont->m_TextureSkyline[TextureIndex].m_vCurHeightOfPixelColumn.resize(NewDimensions, 0); } void IncreaseFontTexture(CFont *pFont) @@ -400,7 +400,7 @@ class CTextRender : public IEngineTextRender return false; // skyline bottom left algorithm - std::vector &SkylineHeights = pFont->m_TextureSkyline[TextureIndex].m_CurHeightOfPixelColumn; + std::vector &SkylineHeights = pFont->m_TextureSkyline[TextureIndex].m_vCurHeightOfPixelColumn; // search a fitting area with less pixel loss int SmallestPixelLossAreaX = 0; @@ -486,7 +486,7 @@ class CTextRender : public IEngineTextRender if(GlyphIndex == 0) { - for(CFont::SFontFallBack &FallbackFont : pFont->m_FtFallbackFonts) + for(CFont::SFontFallBack &FallbackFont : pFont->m_vFtFallbackFonts) { FtFace = FallbackFont.m_FtFace; FT_Set_Pixel_Sizes(FtFace, 0, pSizeData->m_FontSize); @@ -631,18 +631,18 @@ public: virtual ~CTextRender() { - for(auto *pTextCont : m_TextContainers) + for(auto *pTextCont : m_vpTextContainers) { pTextCont->Reset(); delete pTextCont; } - m_TextContainers.clear(); + m_vpTextContainers.clear(); - for(auto &pFont : m_Fonts) + for(auto &pFont : m_vpFonts) { FT_Done_Face(pFont->m_FtFace); - for(CFont::SFontFallBack &FallbackFont : pFont->m_FtFallbackFonts) + for(CFont::SFontFallBack &FallbackFont : pFont->m_vFtFallbackFonts) { FT_Done_Face(FallbackFont.m_FtFace); } @@ -671,22 +671,22 @@ public: m_DefaultTextContainerInfo.m_Stride = sizeof(STextCharQuadVertex); m_DefaultTextContainerInfo.m_VertBufferBindingIndex = -1; - m_DefaultTextContainerInfo.m_Attributes.emplace_back(); - SBufferContainerInfo::SAttribute *pAttr = &m_DefaultTextContainerInfo.m_Attributes.back(); + m_DefaultTextContainerInfo.m_vAttributes.emplace_back(); + SBufferContainerInfo::SAttribute *pAttr = &m_DefaultTextContainerInfo.m_vAttributes.back(); pAttr->m_DataTypeCount = 2; pAttr->m_FuncType = 0; pAttr->m_Normalized = false; pAttr->m_pOffset = 0; pAttr->m_Type = GRAPHICS_TYPE_FLOAT; - m_DefaultTextContainerInfo.m_Attributes.emplace_back(); - pAttr = &m_DefaultTextContainerInfo.m_Attributes.back(); + m_DefaultTextContainerInfo.m_vAttributes.emplace_back(); + pAttr = &m_DefaultTextContainerInfo.m_vAttributes.back(); pAttr->m_DataTypeCount = 2; pAttr->m_FuncType = 0; pAttr->m_Normalized = false; pAttr->m_pOffset = (void *)(sizeof(float) * 2); pAttr->m_Type = GRAPHICS_TYPE_FLOAT; - m_DefaultTextContainerInfo.m_Attributes.emplace_back(); - pAttr = &m_DefaultTextContainerInfo.m_Attributes.back(); + m_DefaultTextContainerInfo.m_vAttributes.emplace_back(); + pAttr = &m_DefaultTextContainerInfo.m_vAttributes.back(); pAttr->m_DataTypeCount = 4; pAttr->m_FuncType = 0; pAttr->m_Normalized = true; @@ -731,12 +731,12 @@ public: InitTextures(pFont->m_CurTextureDimensions[0], pFont->m_CurTextureDimensions[0], pFont->m_aTextures, pFont->m_TextureData); - pFont->m_TextureSkyline[0].m_CurHeightOfPixelColumn.resize(pFont->m_CurTextureDimensions[0], 0); - pFont->m_TextureSkyline[1].m_CurHeightOfPixelColumn.resize(pFont->m_CurTextureDimensions[1], 0); + pFont->m_TextureSkyline[0].m_vCurHeightOfPixelColumn.resize(pFont->m_CurTextureDimensions[0], 0); + pFont->m_TextureSkyline[1].m_vCurHeightOfPixelColumn.resize(pFont->m_CurTextureDimensions[1], 0); pFont->InitFontSizes(); - m_Fonts.push_back(pFont); + m_vpFonts.push_back(pFont); return pFont; } @@ -750,7 +750,7 @@ public: if(FT_New_Memory_Face(m_FTLibrary, pBuf, Size, 0, &FallbackFont.m_FtFace) == 0) { dbg_msg("textrender", "loaded fallback font from '%s'", pFilename); - pFont->m_FtFallbackFonts.emplace_back(FallbackFont); + pFont->m_vFtFallbackFonts.emplace_back(FallbackFont); return true; } @@ -760,15 +760,15 @@ public: CFont *GetFont(int FontIndex) override { - if(FontIndex >= 0 && FontIndex < (int)m_Fonts.size()) - return m_Fonts[FontIndex]; + if(FontIndex >= 0 && FontIndex < (int)m_vpFonts.size()) + return m_vpFonts[FontIndex]; return NULL; } CFont *GetFont(const char *pFilename) override { - for(auto &pFont : m_Fonts) + for(auto &pFont : m_vpFonts) { if(str_comp(pFilename, pFont->m_aFilename) == 0) return pFont; @@ -983,15 +983,15 @@ public: AppendTextContainer(pCursor, ContainerIndex, pText, Length); - if(TextContainer.m_StringInfo.m_CharacterQuads.empty() && TextContainer.m_StringInfo.m_SelectionQuadContainerIndex == -1 && IsRendered) + if(TextContainer.m_StringInfo.m_vCharacterQuads.empty() && TextContainer.m_StringInfo.m_SelectionQuadContainerIndex == -1 && IsRendered) { FreeTextContainer(ContainerIndex); return -1; } else { - TextContainer.m_StringInfo.m_QuadNum = TextContainer.m_StringInfo.m_CharacterQuads.size(); - if(Graphics()->IsTextBufferingEnabled() && IsRendered && !TextContainer.m_StringInfo.m_CharacterQuads.empty()) + TextContainer.m_StringInfo.m_QuadNum = TextContainer.m_StringInfo.m_vCharacterQuads.size(); + if(Graphics()->IsTextBufferingEnabled() && IsRendered && !TextContainer.m_StringInfo.m_vCharacterQuads.empty()) { if((TextContainer.m_RenderFlags & TEXT_RENDER_FLAG_NO_AUTOMATIC_QUAD_UPLOAD) == 0) { @@ -1305,8 +1305,8 @@ public: // don't add text that isn't drawn, the color overwrite is used for that if(m_Color.a != 0.f && IsRendered) { - TextContainer.m_StringInfo.m_CharacterQuads.emplace_back(); - STextCharQuad &TextCharQuad = TextContainer.m_StringInfo.m_CharacterQuads.back(); + TextContainer.m_StringInfo.m_vCharacterQuads.emplace_back(); + STextCharQuad &TextCharQuad = TextContainer.m_StringInfo.m_vCharacterQuads.back(); TextCharQuad.m_Vertices[0].m_X = CharX; TextCharQuad.m_Vertices[0].m_Y = CharY; @@ -1432,14 +1432,14 @@ public: GotNewLineLast = 0; } - if(!TextContainer.m_StringInfo.m_CharacterQuads.empty() && IsRendered) + if(!TextContainer.m_StringInfo.m_vCharacterQuads.empty() && IsRendered) { - TextContainer.m_StringInfo.m_QuadNum = TextContainer.m_StringInfo.m_CharacterQuads.size(); + TextContainer.m_StringInfo.m_QuadNum = TextContainer.m_StringInfo.m_vCharacterQuads.size(); // setup the buffers if(Graphics()->IsTextBufferingEnabled()) { - size_t DataSize = TextContainer.m_StringInfo.m_CharacterQuads.size() * sizeof(STextCharQuad); - void *pUploadData = &TextContainer.m_StringInfo.m_CharacterQuads[0]; + size_t DataSize = TextContainer.m_StringInfo.m_vCharacterQuads.size() * sizeof(STextCharQuad); + void *pUploadData = &TextContainer.m_StringInfo.m_vCharacterQuads[0]; if(TextContainer.m_StringInfo.m_QuadBufferObjectIndex != -1 && (TextContainer.m_RenderFlags & TEXT_RENDER_FLAG_NO_AUTOMATIC_QUAD_UPLOAD) == 0) { @@ -1537,7 +1537,7 @@ public: void RecreateTextContainerSoft(CTextCursor *pCursor, int TextContainerIndex, const char *pText, int Length = -1) override { STextContainer &TextContainer = GetTextContainer(TextContainerIndex); - TextContainer.m_StringInfo.m_CharacterQuads.clear(); + TextContainer.m_StringInfo.m_vCharacterQuads.clear(); TextContainer.m_StringInfo.m_QuadNum = 0; // the text buffer gets then recreated by the appended quads AppendTextContainer(pCursor, TextContainerIndex, pText, Length); @@ -1561,8 +1561,8 @@ public: if(Graphics()->IsTextBufferingEnabled()) { STextContainer &TextContainer = GetTextContainer(TextContainerIndex); - size_t DataSize = TextContainer.m_StringInfo.m_CharacterQuads.size() * sizeof(STextCharQuad); - void *pUploadData = TextContainer.m_StringInfo.m_CharacterQuads.data(); + size_t DataSize = TextContainer.m_StringInfo.m_vCharacterQuads.size() * sizeof(STextCharQuad); + void *pUploadData = TextContainer.m_StringInfo.m_vCharacterQuads.data(); TextContainer.m_StringInfo.m_QuadBufferObjectIndex = Graphics()->CreateBufferObject(DataSize, pUploadData, TextContainer.m_SingleTimeUse ? IGraphics::EBufferObjectCreateFlags::BUFFER_OBJECT_CREATE_FLAGS_ONE_TIME_USE_BIT : 0); m_DefaultTextContainerInfo.m_VertBufferBindingIndex = TextContainer.m_StringInfo.m_QuadBufferObjectIndex; @@ -1608,7 +1608,7 @@ public: for(size_t i = 0; i < TextContainer.m_StringInfo.m_QuadNum; ++i) { - STextCharQuad &TextCharQuad = TextContainer.m_StringInfo.m_CharacterQuads[i]; + STextCharQuad &TextCharQuad = TextContainer.m_StringInfo.m_vCharacterQuads[i]; Graphics()->SetColor(TextCharQuad.m_Vertices[0].m_Color.m_R / 255.f * pTextOutlineColor->m_R, TextCharQuad.m_Vertices[0].m_Color.m_G / 255.f * pTextOutlineColor->m_G, TextCharQuad.m_Vertices[0].m_Color.m_B / 255.f * pTextOutlineColor->m_B, TextCharQuad.m_Vertices[0].m_Color.m_A / 255.f * pTextOutlineColor->m_A); @@ -1625,7 +1625,7 @@ public: for(size_t i = 0; i < TextContainer.m_StringInfo.m_QuadNum; ++i) { - STextCharQuad &TextCharQuad = TextContainer.m_StringInfo.m_CharacterQuads[i]; + STextCharQuad &TextCharQuad = TextContainer.m_StringInfo.m_vCharacterQuads[i]; unsigned char CR = (unsigned char)((float)(TextCharQuad.m_Vertices[0].m_Color.m_R) * pTextColor->m_R); unsigned char CG = (unsigned char)((float)(TextCharQuad.m_Vertices[0].m_Color.m_G) * pTextColor->m_G); unsigned char CB = (unsigned char)((float)(TextCharQuad.m_Vertices[0].m_Color.m_B) * pTextColor->m_B); @@ -1940,7 +1940,7 @@ public: void OnWindowResize() override { bool HasNonEmptyTextContainer = false; - for(auto *pTextContainer : m_TextContainers) + for(auto *pTextContainer : m_vpTextContainers) { if(pTextContainer->m_StringInfo.m_QuadBufferContainerIndex != -1) { @@ -1951,12 +1951,12 @@ public: dbg_assert(!HasNonEmptyTextContainer, "text container was not empty"); - for(auto &pFont : m_Fonts) + for(auto &pFont : m_vpFonts) { // reset the skylines for(int j = 0; j < 2; ++j) { - for(int &k : pFont->m_TextureSkyline[j].m_CurHeightOfPixelColumn) + for(int &k : pFont->m_TextureSkyline[j].m_vCurHeightOfPixelColumn) k = 0; mem_zero(pFont->m_TextureData[j], (size_t)pFont->m_CurTextureDimensions[j] * pFont->m_CurTextureDimensions[j] * sizeof(unsigned char)); diff --git a/src/engine/graphics.h b/src/engine/graphics.h index 5f960fd94..46ba94e54 100644 --- a/src/engine/graphics.h +++ b/src/engine/graphics.h @@ -34,7 +34,7 @@ struct SBufferContainerInfo //0: float, 1:integer unsigned int m_FuncType; }; - std::vector m_Attributes; + std::vector m_vAttributes; }; struct SQuadRenderInfo @@ -195,7 +195,7 @@ struct STWGraphicGPU char m_Name[256]; ETWGraphicsGPUType m_GPUType; }; - std::vector m_GPUs; + std::vector m_vGPUs; STWGraphicGPUItem m_AutoGPU; }; diff --git a/src/engine/server/databases/connection_pool.cpp b/src/engine/server/databases/connection_pool.cpp index 2a531a68c..0a5651814 100644 --- a/src/engine/server/databases/connection_pool.cpp +++ b/src/engine/server/databases/connection_pool.cpp @@ -73,9 +73,9 @@ CDbConnectionPool::~CDbConnectionPool() = default; void CDbConnectionPool::Print(IConsole *pConsole, Mode DatabaseMode) { const char *ModeDesc[] = {"Read", "Write", "WriteBackup"}; - for(unsigned int i = 0; i < m_aapDbConnections[DatabaseMode].size(); i++) + for(unsigned int i = 0; i < m_vvpDbConnections[DatabaseMode].size(); i++) { - m_aapDbConnections[DatabaseMode][i]->Print(pConsole, ModeDesc[DatabaseMode]); + m_vvpDbConnections[DatabaseMode][i]->Print(pConsole, ModeDesc[DatabaseMode]); } } @@ -83,7 +83,7 @@ void CDbConnectionPool::RegisterDatabase(std::unique_ptr pDatabas { if(DatabaseMode < 0 || NUM_MODES <= DatabaseMode) return; - m_aapDbConnections[DatabaseMode].push_back(std::move(pDatabase)); + m_vvpDbConnections[DatabaseMode].push_back(std::move(pDatabase)); } void CDbConnectionPool::Execute( @@ -157,7 +157,7 @@ void CDbConnectionPool::Worker() { case CSqlExecData::READ_ACCESS: { - for(int i = 0; i < (int)m_aapDbConnections[Mode::READ].size(); i++) + for(int i = 0; i < (int)m_vvpDbConnections[Mode::READ].size(); i++) { if(m_Shutdown) { @@ -169,8 +169,8 @@ void CDbConnectionPool::Worker() dbg_msg("sql", "%s dismissed read request during FailMode", pThreadData->m_pName); break; } - int CurServer = (ReadServer + i) % (int)m_aapDbConnections[Mode::READ].size(); - if(ExecSqlFunc(m_aapDbConnections[Mode::READ][CurServer].get(), pThreadData.get(), false)) + int CurServer = (ReadServer + i) % (int)m_vvpDbConnections[Mode::READ].size(); + if(ExecSqlFunc(m_vvpDbConnections[Mode::READ][CurServer].get(), pThreadData.get(), false)) { ReadServer = CurServer; dbg_msg("sql", "%s done on read database %d", pThreadData->m_pName, CurServer); @@ -186,20 +186,20 @@ void CDbConnectionPool::Worker() break; case CSqlExecData::WRITE_ACCESS: { - for(int i = 0; i < (int)m_aapDbConnections[Mode::WRITE].size(); i++) + for(int i = 0; i < (int)m_vvpDbConnections[Mode::WRITE].size(); i++) { - if(m_Shutdown && !m_aapDbConnections[Mode::WRITE_BACKUP].empty()) + if(m_Shutdown && !m_vvpDbConnections[Mode::WRITE_BACKUP].empty()) { dbg_msg("sql", "%s skipped to backup database during shutdown", pThreadData->m_pName); break; } - if(FailMode && !m_aapDbConnections[Mode::WRITE_BACKUP].empty()) + if(FailMode && !m_vvpDbConnections[Mode::WRITE_BACKUP].empty()) { dbg_msg("sql", "%s skipped to backup database during FailMode", pThreadData->m_pName); break; } - int CurServer = (WriteServer + i) % (int)m_aapDbConnections[Mode::WRITE].size(); - if(ExecSqlFunc(m_aapDbConnections[Mode::WRITE][i].get(), pThreadData.get(), false)) + int CurServer = (WriteServer + i) % (int)m_vvpDbConnections[Mode::WRITE].size(); + if(ExecSqlFunc(m_vvpDbConnections[Mode::WRITE][i].get(), pThreadData.get(), false)) { WriteServer = CurServer; dbg_msg("sql", "%s done on write database %d", pThreadData->m_pName, CurServer); @@ -210,9 +210,9 @@ void CDbConnectionPool::Worker() if(!Success) { FailMode = true; - for(int i = 0; i < (int)m_aapDbConnections[Mode::WRITE_BACKUP].size(); i++) + for(int i = 0; i < (int)m_vvpDbConnections[Mode::WRITE_BACKUP].size(); i++) { - if(ExecSqlFunc(m_aapDbConnections[Mode::WRITE_BACKUP][i].get(), pThreadData.get(), true)) + if(ExecSqlFunc(m_vvpDbConnections[Mode::WRITE_BACKUP][i].get(), pThreadData.get(), true)) { dbg_msg("sql", "%s done on write backup database %d", pThreadData->m_pName, i); Success = true; diff --git a/src/engine/server/databases/connection_pool.h b/src/engine/server/databases/connection_pool.h index ca7a9d6f6..99c12badb 100644 --- a/src/engine/server/databases/connection_pool.h +++ b/src/engine/server/databases/connection_pool.h @@ -69,7 +69,7 @@ public: void OnShutdown(); private: - std::vector> m_aapDbConnections[NUM_MODES]; + std::vector> m_vvpDbConnections[NUM_MODES]; static void Worker(void *pUser); void Worker(); diff --git a/src/engine/server/databases/mysql.cpp b/src/engine/server/databases/mysql.cpp index 484c58652..533da7554 100644 --- a/src/engine/server/databases/mysql.cpp +++ b/src/engine/server/databases/mysql.cpp @@ -129,8 +129,8 @@ private: bool m_HaveConnection = false; MYSQL m_Mysql; std::unique_ptr m_pStmt = nullptr; - std::vector m_aStmtParameters; - std::vector m_aStmtParameterExtras; + std::vector m_vStmtParameters; + std::vector m_vStmtParameterExtras; // copy of config vars char m_aDatabase[64]; @@ -348,10 +348,10 @@ bool CMysqlConnection::PrepareStatement(const char *pStmt, char *pError, int Err } m_NewQuery = true; unsigned NumParameters = mysql_stmt_param_count(m_pStmt.get()); - m_aStmtParameters.resize(NumParameters); - m_aStmtParameterExtras.resize(NumParameters); - mem_zero(&m_aStmtParameters[0], sizeof(m_aStmtParameters[0]) * m_aStmtParameters.size()); - mem_zero(&m_aStmtParameterExtras[0], sizeof(m_aStmtParameterExtras[0]) * m_aStmtParameterExtras.size()); + m_vStmtParameters.resize(NumParameters); + m_vStmtParameterExtras.resize(NumParameters); + mem_zero(&m_vStmtParameters[0], sizeof(m_vStmtParameters[0]) * m_vStmtParameters.size()); + mem_zero(&m_vStmtParameterExtras[0], sizeof(m_vStmtParameterExtras[0]) * m_vStmtParameterExtras.size()); return false; } @@ -359,15 +359,15 @@ void CMysqlConnection::BindString(int Idx, const char *pString) { m_NewQuery = true; Idx -= 1; - dbg_assert(0 <= Idx && Idx < (int)m_aStmtParameters.size(), "index out of bounds"); + dbg_assert(0 <= Idx && Idx < (int)m_vStmtParameters.size(), "index out of bounds"); int Length = str_length(pString); - m_aStmtParameterExtras[Idx].ul = Length; - MYSQL_BIND *pParam = &m_aStmtParameters[Idx]; + m_vStmtParameterExtras[Idx].ul = Length; + MYSQL_BIND *pParam = &m_vStmtParameters[Idx]; pParam->buffer_type = MYSQL_TYPE_STRING; pParam->buffer = (void *)pString; pParam->buffer_length = Length + 1; - pParam->length = &m_aStmtParameterExtras[Idx].ul; + pParam->length = &m_vStmtParameterExtras[Idx].ul; pParam->is_null = nullptr; pParam->is_unsigned = false; pParam->error = nullptr; @@ -377,14 +377,14 @@ void CMysqlConnection::BindBlob(int Idx, unsigned char *pBlob, int Size) { m_NewQuery = true; Idx -= 1; - dbg_assert(0 <= Idx && Idx < (int)m_aStmtParameters.size(), "index out of bounds"); + dbg_assert(0 <= Idx && Idx < (int)m_vStmtParameters.size(), "index out of bounds"); - m_aStmtParameterExtras[Idx].ul = Size; - MYSQL_BIND *pParam = &m_aStmtParameters[Idx]; + m_vStmtParameterExtras[Idx].ul = Size; + MYSQL_BIND *pParam = &m_vStmtParameters[Idx]; pParam->buffer_type = MYSQL_TYPE_BLOB; pParam->buffer = pBlob; pParam->buffer_length = Size; - pParam->length = &m_aStmtParameterExtras[Idx].ul; + pParam->length = &m_vStmtParameterExtras[Idx].ul; pParam->is_null = nullptr; pParam->is_unsigned = false; pParam->error = nullptr; @@ -394,13 +394,13 @@ void CMysqlConnection::BindInt(int Idx, int Value) { m_NewQuery = true; Idx -= 1; - dbg_assert(0 <= Idx && Idx < (int)m_aStmtParameters.size(), "index out of bounds"); + dbg_assert(0 <= Idx && Idx < (int)m_vStmtParameters.size(), "index out of bounds"); - m_aStmtParameterExtras[Idx].i = Value; - MYSQL_BIND *pParam = &m_aStmtParameters[Idx]; + m_vStmtParameterExtras[Idx].i = Value; + MYSQL_BIND *pParam = &m_vStmtParameters[Idx]; pParam->buffer_type = MYSQL_TYPE_LONG; - pParam->buffer = &m_aStmtParameterExtras[Idx].i; - pParam->buffer_length = sizeof(m_aStmtParameterExtras[Idx].i); + pParam->buffer = &m_vStmtParameterExtras[Idx].i; + pParam->buffer_length = sizeof(m_vStmtParameterExtras[Idx].i); pParam->length = nullptr; pParam->is_null = nullptr; pParam->is_unsigned = false; @@ -411,13 +411,13 @@ void CMysqlConnection::BindInt64(int Idx, int64_t Value) { m_NewQuery = true; Idx -= 1; - dbg_assert(0 <= Idx && Idx < (int)m_aStmtParameters.size(), "index out of bounds"); + dbg_assert(0 <= Idx && Idx < (int)m_vStmtParameters.size(), "index out of bounds"); - m_aStmtParameterExtras[Idx].i = Value; - MYSQL_BIND *pParam = &m_aStmtParameters[Idx]; + m_vStmtParameterExtras[Idx].i = Value; + MYSQL_BIND *pParam = &m_vStmtParameters[Idx]; pParam->buffer_type = MYSQL_TYPE_LONGLONG; - pParam->buffer = &m_aStmtParameterExtras[Idx].i; - pParam->buffer_length = sizeof(m_aStmtParameterExtras[Idx].i); + pParam->buffer = &m_vStmtParameterExtras[Idx].i; + pParam->buffer_length = sizeof(m_vStmtParameterExtras[Idx].i); pParam->length = nullptr; pParam->is_null = nullptr; pParam->is_unsigned = false; @@ -428,13 +428,13 @@ void CMysqlConnection::BindFloat(int Idx, float Value) { m_NewQuery = true; Idx -= 1; - dbg_assert(0 <= Idx && Idx < (int)m_aStmtParameters.size(), "index out of bounds"); + dbg_assert(0 <= Idx && Idx < (int)m_vStmtParameters.size(), "index out of bounds"); - m_aStmtParameterExtras[Idx].f = Value; - MYSQL_BIND *pParam = &m_aStmtParameters[Idx]; + m_vStmtParameterExtras[Idx].f = Value; + MYSQL_BIND *pParam = &m_vStmtParameters[Idx]; pParam->buffer_type = MYSQL_TYPE_FLOAT; - pParam->buffer = &m_aStmtParameterExtras[Idx].f; - pParam->buffer_length = sizeof(m_aStmtParameterExtras[Idx].i); + pParam->buffer = &m_vStmtParameterExtras[Idx].f; + pParam->buffer_length = sizeof(m_vStmtParameterExtras[Idx].i); pParam->length = nullptr; pParam->is_null = nullptr; pParam->is_unsigned = false; @@ -446,7 +446,7 @@ bool CMysqlConnection::Step(bool *pEnd, char *pError, int ErrorSize) if(m_NewQuery) { m_NewQuery = false; - if(mysql_stmt_bind_param(m_pStmt.get(), &m_aStmtParameters[0])) + if(mysql_stmt_bind_param(m_pStmt.get(), &m_vStmtParameters[0])) { StoreErrorStmt("bind_param"); str_copy(pError, m_aErrorDetail, ErrorSize); @@ -477,7 +477,7 @@ bool CMysqlConnection::ExecuteUpdate(int *pNumUpdated, char *pError, int ErrorSi if(m_NewQuery) { m_NewQuery = false; - if(mysql_stmt_bind_param(m_pStmt.get(), &m_aStmtParameters[0])) + if(mysql_stmt_bind_param(m_pStmt.get(), &m_vStmtParameters[0])) { StoreErrorStmt("bind_param"); str_copy(pError, m_aErrorDetail, ErrorSize); diff --git a/src/engine/server/server.cpp b/src/engine/server/server.cpp index 1a1b0697a..63b5082da 100644 --- a/src/engine/server/server.cpp +++ b/src/engine/server/server.cpp @@ -278,7 +278,7 @@ class CServerLogger : public ILogger { CServer *m_pServer; std::mutex m_PendingLock; - std::vector m_aPending; + std::vector m_vPending; std::thread::id m_MainThread; public: @@ -298,23 +298,23 @@ void CServerLogger::Log(const CLogMessage *pMessage) m_PendingLock.lock(); if(m_MainThread == std::this_thread::get_id()) { - if(!m_aPending.empty()) + if(!m_vPending.empty()) { if(m_pServer) { - for(const auto &Message : m_aPending) + for(const auto &Message : m_vPending) { m_pServer->SendLogLine(&Message); } } - m_aPending.clear(); + m_vPending.clear(); } m_PendingLock.unlock(); m_pServer->SendLogLine(pMessage); } else { - m_aPending.push_back(*pMessage); + m_vPending.push_back(*pMessage); m_PendingLock.unlock(); } } diff --git a/src/game/client/components/chat.cpp b/src/game/client/components/chat.cpp index 6f398a9ed..3770fd71d 100644 --- a/src/game/client/components/chat.cpp +++ b/src/game/client/components/chat.cpp @@ -32,7 +32,7 @@ CChat::CChat() #define CHAT_COMMAND(name, params, flags, callback, userdata, help) RegisterCommand(name, params, flags, help); #include - std::sort(m_Commands.begin(), m_Commands.end()); + std::sort(m_vCommands.begin(), m_vCommands.end()); m_Mode = MODE_NONE; Reset(); @@ -40,7 +40,7 @@ CChat::CChat() void CChat::RegisterCommand(const char *pName, const char *pParams, int flags, const char *pHelp) { - m_Commands.emplace_back(pName, pParams); + m_vCommands.emplace_back(pName, pParams); } void CChat::RebuildChat() @@ -349,7 +349,7 @@ bool CChat::OnInput(IInput::CEvent Event) { CCommand *pCompletionCommand = 0; - const size_t NumCommands = m_Commands.size(); + const size_t NumCommands = m_vCommands.size(); if(m_ReverseTAB && m_CompletionUsed) m_CompletionChosen--; @@ -376,7 +376,7 @@ bool CChat::OnInput(IInput::CEvent Event) Index = (m_CompletionChosen + i) % NumCommands; } - auto &Command = m_Commands[Index]; + auto &Command = m_vCommands[Index]; if(str_startswith(Command.m_pName, pCommandStart)) { diff --git a/src/game/client/components/chat.h b/src/game/client/components/chat.h index ac927ef6f..825cc941d 100644 --- a/src/game/client/components/chat.h +++ b/src/game/client/components/chat.h @@ -108,7 +108,7 @@ class CChat : public CComponent bool operator==(const CCommand &Other) const { return str_comp(m_pName, Other.m_pName) == 0; } }; - std::vector m_Commands; + std::vector m_vCommands; bool m_ReverseTAB; struct CHistoryEntry diff --git a/src/game/client/components/countryflags.cpp b/src/game/client/components/countryflags.cpp index 9555f9a4b..63235fc0f 100644 --- a/src/game/client/components/countryflags.cpp +++ b/src/game/client/components/countryflags.cpp @@ -80,15 +80,15 @@ void CCountryFlags::LoadCountryflagsIndexfile() str_format(aBuf, sizeof(aBuf), "loaded country flag '%s'", aOrigin); Console()->Print(IConsole::OUTPUT_LEVEL_ADDINFO, "countryflags", aBuf); } - m_aCountryFlags.push_back(CountryFlag); + m_vCountryFlags.push_back(CountryFlag); } io_close(File); - std::sort(m_aCountryFlags.begin(), m_aCountryFlags.end()); + std::sort(m_vCountryFlags.begin(), m_vCountryFlags.end()); // find index of default item size_t DefaultIndex = 0; - for(size_t Index = 0; Index < m_aCountryFlags.size(); ++Index) - if(m_aCountryFlags[Index].m_CountryCode == -1) + for(size_t Index = 0; Index < m_vCountryFlags.size(); ++Index) + if(m_vCountryFlags[Index].m_CountryCode == -1) { DefaultIndex = Index; break; @@ -100,22 +100,22 @@ void CCountryFlags::LoadCountryflagsIndexfile() CodeIndexLUT = DefaultIndex; else mem_zero(m_CodeIndexLUT, sizeof(m_CodeIndexLUT)); - for(size_t i = 0; i < m_aCountryFlags.size(); ++i) - m_CodeIndexLUT[maximum(0, (m_aCountryFlags[i].m_CountryCode - CODE_LB) % CODE_RANGE)] = i; + for(size_t i = 0; i < m_vCountryFlags.size(); ++i) + m_CodeIndexLUT[maximum(0, (m_vCountryFlags[i].m_CountryCode - CODE_LB) % CODE_RANGE)] = i; } void CCountryFlags::OnInit() { // load country flags - m_aCountryFlags.clear(); + m_vCountryFlags.clear(); LoadCountryflagsIndexfile(); - if(m_aCountryFlags.empty()) + if(m_vCountryFlags.empty()) { Console()->Print(IConsole::OUTPUT_LEVEL_STANDARD, "countryflags", "failed to load country flags. folder='countryflags/'"); CCountryFlag DummyEntry; DummyEntry.m_CountryCode = -1; mem_zero(DummyEntry.m_aCountryCodeString, sizeof(DummyEntry.m_aCountryCodeString)); - m_aCountryFlags.push_back(DummyEntry); + m_vCountryFlags.push_back(DummyEntry); } m_FlagsQuadContainerIndex = Graphics()->CreateQuadContainer(false); @@ -127,7 +127,7 @@ void CCountryFlags::OnInit() size_t CCountryFlags::Num() const { - return m_aCountryFlags.size(); + return m_vCountryFlags.size(); } const CCountryFlags::CCountryFlag *CCountryFlags::GetByCountryCode(int CountryCode) const @@ -137,7 +137,7 @@ const CCountryFlags::CCountryFlag *CCountryFlags::GetByCountryCode(int CountryCo const CCountryFlags::CCountryFlag *CCountryFlags::GetByIndex(size_t Index) const { - return &m_aCountryFlags[Index % m_aCountryFlags.size()]; + return &m_vCountryFlags[Index % m_vCountryFlags.size()]; } void CCountryFlags::Render(int CountryCode, const ColorRGBA *pColor, float x, float y, float w, float h) diff --git a/src/game/client/components/countryflags.h b/src/game/client/components/countryflags.h index e34027f69..8013c5416 100644 --- a/src/game/client/components/countryflags.h +++ b/src/game/client/components/countryflags.h @@ -33,7 +33,7 @@ private: CODE_UB = 999, CODE_RANGE = CODE_UB - CODE_LB + 1, }; - std::vector m_aCountryFlags; + std::vector m_vCountryFlags; size_t m_CodeIndexLUT[CODE_RANGE]; int m_FlagsQuadContainerIndex; diff --git a/src/game/client/components/ghost.cpp b/src/game/client/components/ghost.cpp index 4e676cb7e..ef2f134e2 100644 --- a/src/game/client/components/ghost.cpp +++ b/src/game/client/components/ghost.cpp @@ -61,41 +61,41 @@ void CGhost::GetNetObjCharacter(CNetObj_Character *pChar, const CGhostCharacter } CGhost::CGhostPath::CGhostPath(CGhostPath &&Other) noexcept : - m_ChunkSize(Other.m_ChunkSize), m_NumItems(Other.m_NumItems), m_lChunks(std::move(Other.m_lChunks)) + m_ChunkSize(Other.m_ChunkSize), m_NumItems(Other.m_NumItems), m_vpChunks(std::move(Other.m_vpChunks)) { Other.m_NumItems = 0; - Other.m_lChunks.clear(); + Other.m_vpChunks.clear(); } CGhost::CGhostPath &CGhost::CGhostPath::operator=(CGhostPath &&Other) noexcept { Reset(Other.m_ChunkSize); m_NumItems = Other.m_NumItems; - m_lChunks = std::move(Other.m_lChunks); + m_vpChunks = std::move(Other.m_vpChunks); Other.m_NumItems = 0; - Other.m_lChunks.clear(); + Other.m_vpChunks.clear(); return *this; } void CGhost::CGhostPath::Reset(int ChunkSize) { - for(auto &pChunk : m_lChunks) + for(auto &pChunk : m_vpChunks) free(pChunk); - m_lChunks.clear(); + m_vpChunks.clear(); m_ChunkSize = ChunkSize; m_NumItems = 0; } void CGhost::CGhostPath::SetSize(int Items) { - int Chunks = m_lChunks.size(); + int Chunks = m_vpChunks.size(); int NeededChunks = (Items + m_ChunkSize - 1) / m_ChunkSize; if(NeededChunks > Chunks) { - m_lChunks.resize(NeededChunks); + m_vpChunks.resize(NeededChunks); for(int i = Chunks; i < NeededChunks; i++) - m_lChunks[i] = (CGhostCharacter *)calloc(m_ChunkSize, sizeof(CGhostCharacter)); + m_vpChunks[i] = (CGhostCharacter *)calloc(m_ChunkSize, sizeof(CGhostCharacter)); } m_NumItems = Items; @@ -114,7 +114,7 @@ CGhostCharacter *CGhost::CGhostPath::Get(int Index) int Chunk = Index / m_ChunkSize; int Pos = Index % m_ChunkSize; - return &m_lChunks[Chunk][Pos]; + return &m_vpChunks[Chunk][Pos]; } void CGhost::GetPath(char *pBuf, int Size, const char *pPlayerName, int Time) const diff --git a/src/game/client/components/ghost.h b/src/game/client/components/ghost.h index a27f87959..49c09a6fe 100644 --- a/src/game/client/components/ghost.h +++ b/src/game/client/components/ghost.h @@ -64,7 +64,7 @@ private: int m_ChunkSize; int m_NumItems; - std::vector m_lChunks; + std::vector m_vpChunks; public: CGhostPath() { Reset(); } diff --git a/src/game/client/components/maplayers.cpp b/src/game/client/components/maplayers.cpp index 169e133db..6f51256ba 100644 --- a/src/game/client/components/maplayers.cpp +++ b/src/game/client/components/maplayers.cpp @@ -390,20 +390,20 @@ void mem_copy_special(void *pDest, void *pSource, size_t Size, size_t Count, siz CMapLayers::~CMapLayers() { //clear everything and destroy all buffers - if(!m_TileLayerVisuals.empty()) + if(!m_vpTileLayerVisuals.empty()) { - int s = m_TileLayerVisuals.size(); + int s = m_vpTileLayerVisuals.size(); for(int i = 0; i < s; ++i) { - delete m_TileLayerVisuals[i]; + delete m_vpTileLayerVisuals[i]; } } - if(!m_QuadLayerVisuals.empty()) + if(!m_vpQuadLayerVisuals.empty()) { - int s = m_QuadLayerVisuals.size(); + int s = m_vpQuadLayerVisuals.size(); for(int i = 0; i < s; ++i) { - delete m_QuadLayerVisuals[i]; + delete m_vpQuadLayerVisuals[i]; } } } @@ -413,25 +413,25 @@ void CMapLayers::OnMapLoad() if(!Graphics()->IsTileBufferingEnabled() && !Graphics()->IsQuadBufferingEnabled()) return; //clear everything and destroy all buffers - if(!m_TileLayerVisuals.empty()) + if(!m_vpTileLayerVisuals.empty()) { - int s = m_TileLayerVisuals.size(); + int s = m_vpTileLayerVisuals.size(); for(int i = 0; i < s; ++i) { - Graphics()->DeleteBufferContainer(m_TileLayerVisuals[i]->m_BufferContainerIndex, true); - delete m_TileLayerVisuals[i]; + Graphics()->DeleteBufferContainer(m_vpTileLayerVisuals[i]->m_BufferContainerIndex, true); + delete m_vpTileLayerVisuals[i]; } - m_TileLayerVisuals.clear(); + m_vpTileLayerVisuals.clear(); } - if(!m_QuadLayerVisuals.empty()) + if(!m_vpQuadLayerVisuals.empty()) { - int s = m_QuadLayerVisuals.size(); + int s = m_vpQuadLayerVisuals.size(); for(int i = 0; i < s; ++i) { - Graphics()->DeleteBufferContainer(m_QuadLayerVisuals[i]->m_BufferContainerIndex, true); - delete m_QuadLayerVisuals[i]; + Graphics()->DeleteBufferContainer(m_vpQuadLayerVisuals[i]->m_BufferContainerIndex, true); + delete m_vpQuadLayerVisuals[i]; } - m_QuadLayerVisuals.clear(); + m_vpQuadLayerVisuals.clear(); } bool PassedGameLayer = false; @@ -566,8 +566,8 @@ void CMapLayers::OnMapLoad() while(CurOverlay < OverlayCount + 1) { // We can later just count the tile layers to get the idx in the vector - m_TileLayerVisuals.push_back(new STileLayerVisuals()); - STileLayerVisuals &Visuals = *m_TileLayerVisuals.back(); + m_vpTileLayerVisuals.push_back(new STileLayerVisuals()); + STileLayerVisuals &Visuals = *m_vpTileLayerVisuals.back(); if(!Visuals.Init(pTMap->m_Width, pTMap->m_Height)) { ++CurOverlay; @@ -841,8 +841,8 @@ void CMapLayers::OnMapLoad() SBufferContainerInfo ContainerInfo; ContainerInfo.m_Stride = (DoTextureCoords ? (sizeof(float) * 2 + sizeof(vec3)) : 0); ContainerInfo.m_VertBufferBindingIndex = BufferObjectIndex; - ContainerInfo.m_Attributes.emplace_back(); - SBufferContainerInfo::SAttribute *pAttr = &ContainerInfo.m_Attributes.back(); + ContainerInfo.m_vAttributes.emplace_back(); + SBufferContainerInfo::SAttribute *pAttr = &ContainerInfo.m_vAttributes.back(); pAttr->m_DataTypeCount = 2; pAttr->m_Type = GRAPHICS_TYPE_FLOAT; pAttr->m_Normalized = false; @@ -850,8 +850,8 @@ void CMapLayers::OnMapLoad() pAttr->m_FuncType = 0; if(DoTextureCoords) { - ContainerInfo.m_Attributes.emplace_back(); - pAttr = &ContainerInfo.m_Attributes.back(); + ContainerInfo.m_vAttributes.emplace_back(); + pAttr = &ContainerInfo.m_vAttributes.back(); pAttr->m_DataTypeCount = 3; pAttr->m_Type = GRAPHICS_TYPE_FLOAT; pAttr->m_Normalized = false; @@ -872,8 +872,8 @@ void CMapLayers::OnMapLoad() { CMapItemLayerQuads *pQLayer = (CMapItemLayerQuads *)pLayer; - m_QuadLayerVisuals.push_back(new SQuadLayerVisuals()); - SQuadLayerVisuals *pQLayerVisuals = m_QuadLayerVisuals.back(); + m_vpQuadLayerVisuals.push_back(new SQuadLayerVisuals()); + SQuadLayerVisuals *pQLayerVisuals = m_vpQuadLayerVisuals.back(); bool Textured = (pQLayer->m_Image != -1); @@ -944,15 +944,15 @@ void CMapLayers::OnMapLoad() SBufferContainerInfo ContainerInfo; ContainerInfo.m_Stride = (Textured ? (sizeof(STmpQuadTextured) / 4) : (sizeof(STmpQuad) / 4)); ContainerInfo.m_VertBufferBindingIndex = BufferObjectIndex; - ContainerInfo.m_Attributes.emplace_back(); - SBufferContainerInfo::SAttribute *pAttr = &ContainerInfo.m_Attributes.back(); + ContainerInfo.m_vAttributes.emplace_back(); + SBufferContainerInfo::SAttribute *pAttr = &ContainerInfo.m_vAttributes.back(); pAttr->m_DataTypeCount = 4; pAttr->m_Type = GRAPHICS_TYPE_FLOAT; pAttr->m_Normalized = false; pAttr->m_pOffset = 0; pAttr->m_FuncType = 0; - ContainerInfo.m_Attributes.emplace_back(); - pAttr = &ContainerInfo.m_Attributes.back(); + ContainerInfo.m_vAttributes.emplace_back(); + pAttr = &ContainerInfo.m_vAttributes.back(); pAttr->m_DataTypeCount = 4; pAttr->m_Type = GRAPHICS_TYPE_UNSIGNED_BYTE; pAttr->m_Normalized = true; @@ -960,8 +960,8 @@ void CMapLayers::OnMapLoad() pAttr->m_FuncType = 0; if(Textured) { - ContainerInfo.m_Attributes.emplace_back(); - pAttr = &ContainerInfo.m_Attributes.back(); + ContainerInfo.m_vAttributes.emplace_back(); + pAttr = &ContainerInfo.m_vAttributes.back(); pAttr->m_DataTypeCount = 2; pAttr->m_Type = GRAPHICS_TYPE_FLOAT; pAttr->m_Normalized = false; @@ -980,7 +980,7 @@ void CMapLayers::OnMapLoad() void CMapLayers::RenderTileLayer(int LayerIndex, ColorRGBA *pColor, CMapItemLayerTilemap *pTileLayer, CMapItemGroup *pGroup) { - STileLayerVisuals &Visuals = *m_TileLayerVisuals[LayerIndex]; + STileLayerVisuals &Visuals = *m_vpTileLayerVisuals[LayerIndex]; if(Visuals.m_BufferContainerIndex == -1) return; //no visuals were created @@ -1097,7 +1097,7 @@ void CMapLayers::RenderTileBorderCornerTiles(int WidthOffsetToOrigin, int Height void CMapLayers::RenderTileBorder(int LayerIndex, ColorRGBA *pColor, CMapItemLayerTilemap *pTileLayer, CMapItemGroup *pGroup, int BorderX0, int BorderY0, int BorderX1, int BorderY1, int ScreenWidthTileCount, int ScreenHeightTileCount) { - STileLayerVisuals &Visuals = *m_TileLayerVisuals[LayerIndex]; + STileLayerVisuals &Visuals = *m_vpTileLayerVisuals[LayerIndex]; int Y0 = BorderY0; int X0 = BorderX0; @@ -1249,7 +1249,7 @@ void CMapLayers::RenderTileBorder(int LayerIndex, ColorRGBA *pColor, CMapItemLay void CMapLayers::RenderKillTileBorder(int LayerIndex, ColorRGBA *pColor, CMapItemLayerTilemap *pTileLayer, CMapItemGroup *pGroup) { - STileLayerVisuals &Visuals = *m_TileLayerVisuals[LayerIndex]; + STileLayerVisuals &Visuals = *m_vpTileLayerVisuals[LayerIndex]; if(Visuals.m_BufferContainerIndex == -1) return; //no visuals were created @@ -1361,7 +1361,7 @@ void CMapLayers::RenderKillTileBorder(int LayerIndex, ColorRGBA *pColor, CMapIte void CMapLayers::RenderQuadLayer(int LayerIndex, CMapItemLayerQuads *pQuadLayer, CMapItemGroup *pGroup, bool Force) { - SQuadLayerVisuals &Visuals = *m_QuadLayerVisuals[LayerIndex]; + SQuadLayerVisuals &Visuals = *m_vpQuadLayerVisuals[LayerIndex]; if(Visuals.m_BufferContainerIndex == -1) return; //no visuals were created diff --git a/src/game/client/components/maplayers.h b/src/game/client/components/maplayers.h index 02721bf22..b233f33de 100644 --- a/src/game/client/components/maplayers.h +++ b/src/game/client/components/maplayers.h @@ -103,7 +103,7 @@ class CMapLayers : public CComponent int m_BufferContainerIndex; bool m_IsTextured; }; - std::vector m_TileLayerVisuals; + std::vector m_vpTileLayerVisuals; struct SQuadLayerVisuals { @@ -124,7 +124,7 @@ class CMapLayers : public CComponent int m_BufferContainerIndex; bool m_IsTextured; }; - std::vector m_QuadLayerVisuals; + std::vector m_vpQuadLayerVisuals; virtual class CCamera *GetCurCamera(); diff --git a/src/game/client/components/menu_background.cpp b/src/game/client/components/menu_background.cpp index feeacf177..7ca9c3880 100644 --- a/src/game/client/components/menu_background.cpp +++ b/src/game/client/components/menu_background.cpp @@ -108,7 +108,7 @@ int CMenuBackground::ThemeScan(const char *pName, int IsDir, int DirType, void * return 0; // try to edit an existing theme - for(auto &Theme : pSelf->m_lThemes) + for(auto &Theme : pSelf->m_vThemes) { if(str_comp(Theme.m_Name.c_str(), aThemeName) == 0) { @@ -125,7 +125,7 @@ int CMenuBackground::ThemeScan(const char *pName, int IsDir, int DirType, void * char aBuf[512]; str_format(aBuf, sizeof(aBuf), "added theme %s from themes/%s", aThemeName, pName); pSelf->Console()->Print(IConsole::OUTPUT_LEVEL_ADDINFO, "game", aBuf); - pSelf->m_lThemes.push_back(Theme); + pSelf->m_vThemes.push_back(Theme); auto TimeNow = tw::time_get(); if(TimeNow - pSelf->m_ThemeScanStartTime >= std::chrono::nanoseconds(1s) / 60) { @@ -153,7 +153,7 @@ int CMenuBackground::ThemeIconScan(const char *pName, int IsDir, int DirType, vo str_truncate(aThemeName, sizeof(aThemeName), pName, pSuffix - pName); // save icon for an existing theme - for(CTheme &Theme : pSelf->m_lThemes) // bit slow but whatever + for(CTheme &Theme : pSelf->m_vThemes) // bit slow but whatever { if(str_comp(Theme.m_Name.c_str(), aThemeName) == 0 || (Theme.m_Name.empty() && str_comp(aThemeName, "none") == 0)) { @@ -396,18 +396,18 @@ void CMenuBackground::ChangePosition(int PositionNumber) std::vector &CMenuBackground::GetThemes() { - if(m_lThemes.empty()) // not loaded yet + if(m_vThemes.empty()) // not loaded yet { // when adding more here, make sure to change the value of PREDEFINED_THEMES_COUNT too - m_lThemes.emplace_back("", true, true); // no theme - m_lThemes.emplace_back("auto", true, true); // auto theme - m_lThemes.emplace_back("rand", true, true); // random theme + m_vThemes.emplace_back("", true, true); // no theme + m_vThemes.emplace_back("auto", true, true); // auto theme + m_vThemes.emplace_back("rand", true, true); // random theme m_ThemeScanStartTime = tw::time_get(); Storage()->ListDirectory(IStorage::TYPE_ALL, "themes", ThemeScan, (CMenuBackground *)this); Storage()->ListDirectory(IStorage::TYPE_ALL, "themes", ThemeIconScan, (CMenuBackground *)this); - std::sort(m_lThemes.begin() + PREDEFINED_THEMES_COUNT, m_lThemes.end()); + std::sort(m_vThemes.begin() + PREDEFINED_THEMES_COUNT, m_vThemes.end()); } - return m_lThemes; + return m_vThemes; } diff --git a/src/game/client/components/menu_background.h b/src/game/client/components/menu_background.h index 74517b80b..97614e31f 100644 --- a/src/game/client/components/menu_background.h +++ b/src/game/client/components/menu_background.h @@ -93,7 +93,7 @@ public: static int ThemeScan(const char *pName, int IsDir, int DirType, void *pUser); static int ThemeIconScan(const char *pName, int IsDir, int DirType, void *pUser); - std::vector m_lThemes; + std::vector m_vThemes; CMenuBackground(); ~CMenuBackground() override {} diff --git a/src/game/client/components/menus.cpp b/src/game/client/components/menus.cpp index 14defe60f..64c087c3f 100644 --- a/src/game/client/components/menus.cpp +++ b/src/game/client/components/menus.cpp @@ -1924,8 +1924,8 @@ int CMenus::Render() // delete demo if(m_DemolistSelectedIndex >= 0 && !m_DemolistSelectedIsDir) { - str_format(aBuf, sizeof(aBuf), "%s/%s", m_aCurrentDemoFolder, m_lDemos[m_DemolistSelectedIndex].m_aFilename); - if(Storage()->RemoveFile(aBuf, m_lDemos[m_DemolistSelectedIndex].m_StorageType)) + str_format(aBuf, sizeof(aBuf), "%s/%s", m_aCurrentDemoFolder, m_vDemos[m_DemolistSelectedIndex].m_aFilename); + if(Storage()->RemoveFile(aBuf, m_vDemos[m_DemolistSelectedIndex].m_StorageType)) { DemolistPopulate(); DemolistOnUpdate(false); @@ -1960,14 +1960,14 @@ int CMenus::Render() if(m_DemolistSelectedIndex >= 0 && !m_DemolistSelectedIsDir) { char aBufOld[512]; - str_format(aBufOld, sizeof(aBufOld), "%s/%s", m_aCurrentDemoFolder, m_lDemos[m_DemolistSelectedIndex].m_aFilename); + str_format(aBufOld, sizeof(aBufOld), "%s/%s", m_aCurrentDemoFolder, m_vDemos[m_DemolistSelectedIndex].m_aFilename); int Length = str_length(m_aCurrentDemoFile); char aBufNew[512]; if(Length <= 4 || m_aCurrentDemoFile[Length - 5] != '.' || str_comp_nocase(m_aCurrentDemoFile + Length - 4, "demo")) str_format(aBufNew, sizeof(aBufNew), "%s/%s.demo", m_aCurrentDemoFolder, m_aCurrentDemoFile); else str_format(aBufNew, sizeof(aBufNew), "%s/%s", m_aCurrentDemoFolder, m_aCurrentDemoFile); - if(Storage()->RenameFile(aBufOld, aBufNew, m_lDemos[m_DemolistSelectedIndex].m_StorageType)) + if(Storage()->RenameFile(aBufOld, aBufNew, m_vDemos[m_DemolistSelectedIndex].m_StorageType)) { DemolistPopulate(); DemolistOnUpdate(false); @@ -2019,7 +2019,7 @@ int CMenus::Render() if(m_DemolistSelectedIndex >= 0 && !m_DemolistSelectedIsDir) { char aBufOld[512]; - str_format(aBufOld, sizeof(aBufOld), "%s/%s", m_aCurrentDemoFolder, m_lDemos[m_DemolistSelectedIndex].m_aFilename); + str_format(aBufOld, sizeof(aBufOld), "%s/%s", m_aCurrentDemoFolder, m_vDemos[m_DemolistSelectedIndex].m_aFilename); int Length = str_length(m_aCurrentDemoFile); char aBufNew[512]; if(Length <= 3 || m_aCurrentDemoFile[Length - 4] != '.' || str_comp_nocase(m_aCurrentDemoFile + Length - 3, "mp4")) @@ -2036,7 +2036,7 @@ int CMenus::Render() } else { - const char *pError = Client()->DemoPlayer_Render(aBufOld, m_lDemos[m_DemolistSelectedIndex].m_StorageType, m_aCurrentDemoFile, m_Speed); + const char *pError = Client()->DemoPlayer_Render(aBufOld, m_vDemos[m_DemolistSelectedIndex].m_StorageType, m_aCurrentDemoFile, m_Speed); m_Speed = 4; //Console()->Print(IConsole::OUTPUT_LEVEL_DEBUG, "demo_render_path", aWholePath); if(pError) @@ -2136,8 +2136,8 @@ int CMenus::Render() { m_Popup = POPUP_NONE; // render video - str_format(aBuf, sizeof(aBuf), "%s/%s", m_aCurrentDemoFolder, m_lDemos[m_DemolistSelectedIndex].m_aFilename); - const char *pError = Client()->DemoPlayer_Render(aBuf, m_lDemos[m_DemolistSelectedIndex].m_StorageType, m_aCurrentDemoFile, m_Speed); + str_format(aBuf, sizeof(aBuf), "%s/%s", m_aCurrentDemoFolder, m_vDemos[m_DemolistSelectedIndex].m_aFilename); + const char *pError = Client()->DemoPlayer_Render(aBuf, m_vDemos[m_DemolistSelectedIndex].m_StorageType, m_aCurrentDemoFile, m_Speed); m_Speed = 4; if(pError) PopupMessage(Localize("Error"), str_comp(pError, "error loading demo") ? pError : Localize("Error loading demo"), Localize("Ok")); @@ -2167,8 +2167,8 @@ int CMenus::Render() // remove friend if(m_FriendlistSelectedIndex >= 0) { - m_pClient->Friends()->RemoveFriend(m_lFriends[m_FriendlistSelectedIndex].m_pFriendInfo->m_aName, - m_lFriends[m_FriendlistSelectedIndex].m_pFriendInfo->m_aClan); + m_pClient->Friends()->RemoveFriend(m_vFriends[m_FriendlistSelectedIndex].m_pFriendInfo->m_aName, + m_vFriends[m_FriendlistSelectedIndex].m_pFriendInfo->m_aClan); FriendlistOnUpdate(); Client()->ServerBrowserUpdate(); } diff --git a/src/game/client/components/menus.h b/src/game/client/components/menus.h index 8ba599271..f40f0c13a 100644 --- a/src/game/client/components/menus.h +++ b/src/game/client/components/menus.h @@ -254,11 +254,11 @@ public: }; protected: - std::vector m_EntitiesList; - std::vector m_GameList; - std::vector m_EmoticonList; - std::vector m_ParticlesList; - std::vector m_HudList; + std::vector m_vEntitiesList; + std::vector m_vGameList; + std::vector m_vEmoticonList; + std::vector m_vParticlesList; + std::vector m_vHudList; bool m_IsInit = false; @@ -471,7 +471,7 @@ protected: } }; - std::vector m_lFriends; + std::vector m_vFriends; int m_FriendlistSelectedIndex; void FriendlistOnUpdate(); @@ -620,7 +620,7 @@ public: // DDRace int DoButton_CheckBox_DontCare(const void *pID, const char *pText, int Checked, const CUIRect *pRect); - std::vector m_lDemos; + std::vector m_vDemos; void DemolistPopulate(); bool m_Dummy; @@ -645,7 +645,7 @@ public: bool HasFile() const { return m_aFilename[0]; } }; - std::vector m_lGhosts; + std::vector m_vGhosts; std::chrono::nanoseconds m_GhostPopulateStartTime{0}; diff --git a/src/game/client/components/menus_browser.cpp b/src/game/client/components/menus_browser.cpp index 21f8db954..e703a7a11 100644 --- a/src/game/client/components/menus_browser.cpp +++ b/src/game/client/components/menus_browser.cpp @@ -214,7 +214,7 @@ void CMenus::RenderServerbrowserServerList(CUIRect View) m_SelectedIndex = -1; // reset friend counter - for(auto &Friend : m_lFriends) + for(auto &Friend : m_vFriends) Friend.m_NumFound = 0; auto RenderBrowserIcons = [this](CUIElement::SUIElementRect &UIRect, CUIRect *pRect, const ColorRGBA &TextColor, const ColorRGBA &TextOutlineColor, const char *pText, ETextAlignment TextAlign, bool SmallFont = false) { @@ -262,7 +262,7 @@ void CMenus::RenderServerbrowserServerList(CUIRect View) { unsigned NameHash = str_quickhash(pItem->m_aClients[j].m_aName); unsigned ClanHash = str_quickhash(pItem->m_aClients[j].m_aClan); - for(auto &Friend : m_lFriends) + for(auto &Friend : m_vFriends) { if(((g_Config.m_ClFriendsIgnoreClan && Friend.m_pFriendInfo->m_aName[0]) || (ClanHash == Friend.m_pFriendInfo->m_ClanHash && !str_comp(Friend.m_pFriendInfo->m_aClan, pItem->m_aClients[j].m_aClan))) && (!Friend.m_pFriendInfo->m_aName[0] || (NameHash == Friend.m_pFriendInfo->m_NameHash && !str_comp(Friend.m_pFriendInfo->m_aName, pItem->m_aClients[j].m_aName)))) @@ -1241,10 +1241,10 @@ void CMenus::RenderServerbrowserServerDetail(CUIRect View) void CMenus::FriendlistOnUpdate() { - m_lFriends.clear(); + m_vFriends.clear(); for(int i = 0; i < m_pClient->Friends()->NumFriends(); ++i) - m_lFriends.emplace_back(m_pClient->Friends()->GetFriend(i)); - std::sort(m_lFriends.begin(), m_lFriends.end()); + m_vFriends.emplace_back(m_pClient->Friends()->GetFriend(i)); + std::sort(m_vFriends.begin(), m_vFriends.end()); } void CMenus::RenderServerbrowserFriends(CUIRect View) @@ -1274,12 +1274,12 @@ void CMenus::RenderServerbrowserFriends(CUIRect View) // friends list(remove friend) static float s_ScrollValue = 0; - if(m_FriendlistSelectedIndex >= (int)m_lFriends.size()) - m_FriendlistSelectedIndex = m_lFriends.size() - 1; - UiDoListboxStart(&m_lFriends, &List, 30.0f, "", "", m_lFriends.size(), 1, m_FriendlistSelectedIndex, s_ScrollValue); + if(m_FriendlistSelectedIndex >= (int)m_vFriends.size()) + m_FriendlistSelectedIndex = m_vFriends.size() - 1; + UiDoListboxStart(&m_vFriends, &List, 30.0f, "", "", m_vFriends.size(), 1, m_FriendlistSelectedIndex, s_ScrollValue); - std::sort(m_lFriends.begin(), m_lFriends.end()); - for(auto &Friend : m_lFriends) + std::sort(m_vFriends.begin(), m_vFriends.end()); + for(auto &Friend : m_vFriends) { CListboxItem Item = UiDoListboxNextItem(&Friend.m_NumFound, false, false); @@ -1308,7 +1308,7 @@ void CMenus::RenderServerbrowserFriends(CUIRect View) m_FriendlistSelectedIndex = UiDoListboxEnd(&s_ScrollValue, &Activated); // activate found server with friend - if(Activated && !m_EnterPressed && m_lFriends[m_FriendlistSelectedIndex].m_NumFound) + if(Activated && !m_EnterPressed && m_vFriends[m_FriendlistSelectedIndex].m_NumFound) { bool Found = false; int NumServers = ServerBrowser()->NumSortedServers(); @@ -1321,9 +1321,9 @@ void CMenus::RenderServerbrowserFriends(CUIRect View) for(int j = 0; j < pItem->m_NumReceivedClients && !Found; ++j) { if(pItem->m_aClients[j].m_FriendState != IFriends::FRIEND_NO && - ((g_Config.m_ClFriendsIgnoreClan && m_lFriends[m_FriendlistSelectedIndex].m_pFriendInfo->m_aName[0]) || str_quickhash(pItem->m_aClients[j].m_aClan) == m_lFriends[m_FriendlistSelectedIndex].m_pFriendInfo->m_ClanHash) && - (!m_lFriends[m_FriendlistSelectedIndex].m_pFriendInfo->m_aName[0] || - str_quickhash(pItem->m_aClients[j].m_aName) == m_lFriends[m_FriendlistSelectedIndex].m_pFriendInfo->m_NameHash)) + ((g_Config.m_ClFriendsIgnoreClan && m_vFriends[m_FriendlistSelectedIndex].m_pFriendInfo->m_aName[0]) || str_quickhash(pItem->m_aClients[j].m_aClan) == m_vFriends[m_FriendlistSelectedIndex].m_pFriendInfo->m_ClanHash) && + (!m_vFriends[m_FriendlistSelectedIndex].m_pFriendInfo->m_aName[0] || + str_quickhash(pItem->m_aClients[j].m_aName) == m_vFriends[m_FriendlistSelectedIndex].m_pFriendInfo->m_NameHash)) { str_copy(g_Config.m_UiServerAddress, pItem->m_aAddress, sizeof(g_Config.m_UiServerAddress)); m_ScrollOffset = ItemIndex; diff --git a/src/game/client/components/menus_demo.cpp b/src/game/client/components/menus_demo.cpp index 1275c9c0a..8c061c51a 100644 --- a/src/game/client/components/menus_demo.cpp +++ b/src/game/client/components/menus_demo.cpp @@ -117,7 +117,7 @@ void CMenus::RenderDemoPlayer(CUIRect MainView) static int s_ButtonOk = 0; if(DoButton_Menu(&s_ButtonOk, Localize("Ok"), 0, &Ok) || m_EnterPressed) { - if(str_comp(m_lDemos[m_DemolistSelectedIndex].m_aFilename, m_aCurrentDemoFile) == 0) + if(str_comp(m_vDemos[m_DemolistSelectedIndex].m_aFilename, m_aCurrentDemoFile) == 0) str_copy(m_aDemoPlayerPopupHint, Localize("Please use a different name"), sizeof(m_aDemoPlayerPopupHint)); else { @@ -456,7 +456,7 @@ void CMenus::RenderDemoPlayer(CUIRect MainView) static int s_SliceSaveButton = 0; if(DoButton_Sprite(&s_SliceSaveButton, IMAGE_FILEICONS, SPRITE_FILE_DEMO2, 0, &Button, CUI::CORNER_ALL)) { - str_copy(m_aCurrentDemoFile, m_lDemos[m_DemolistSelectedIndex].m_aFilename, sizeof(m_aCurrentDemoFile)); + str_copy(m_aCurrentDemoFile, m_vDemos[m_DemolistSelectedIndex].m_aFilename, sizeof(m_aCurrentDemoFile)); m_aDemoPlayerPopupHint[0] = '\0'; m_DemoPlayerState = DEMOPLAYER_SLICE_SAVE; } @@ -767,7 +767,7 @@ int CMenus::DemolistFetchCallback(const CFsFileInfo *pInfo, int IsDir, int Stora } Item.m_IsDir = IsDir != 0; Item.m_StorageType = StorageType; - pSelf->m_lDemos.push_back(Item); + pSelf->m_vDemos.push_back(Item); if(tw::time_get() - pSelf->m_DemoPopulateStartTime > 500ms) { @@ -779,7 +779,7 @@ int CMenus::DemolistFetchCallback(const CFsFileInfo *pInfo, int IsDir, int Stora void CMenus::DemolistPopulate() { - m_lDemos.clear(); + m_vDemos.clear(); if(!str_comp(m_aCurrentDemoFolder, "demos")) m_DemolistStorageType = IStorage::TYPE_ALL; m_DemoPopulateStartTime = tw::time_get(); @@ -788,7 +788,7 @@ void CMenus::DemolistPopulate() if(g_Config.m_BrDemoFetchInfo) FetchAllHeaders(); - std::stable_sort(m_lDemos.begin(), m_lDemos.end()); + std::stable_sort(m_vDemos.begin(), m_vDemos.end()); } void CMenus::DemolistOnUpdate(bool Reset) @@ -800,7 +800,7 @@ void CMenus::DemolistOnUpdate(bool Reset) bool Found = false; int SelectedIndex = -1; // search for selected index - for(auto &Item : m_lDemos) + for(auto &Item : m_vDemos) { SelectedIndex++; @@ -815,9 +815,9 @@ void CMenus::DemolistOnUpdate(bool Reset) m_DemolistSelectedIndex = SelectedIndex; } - m_DemolistSelectedIndex = Reset ? !m_lDemos.empty() ? 0 : -1 : - m_DemolistSelectedIndex >= (int)m_lDemos.size() ? m_lDemos.size() - 1 : m_DemolistSelectedIndex; - m_DemolistSelectedIsDir = m_DemolistSelectedIndex < 0 ? false : m_lDemos[m_DemolistSelectedIndex].m_IsDir; + m_DemolistSelectedIndex = Reset ? !m_vDemos.empty() ? 0 : -1 : + m_DemolistSelectedIndex >= (int)m_vDemos.size() ? m_vDemos.size() - 1 : m_DemolistSelectedIndex; + m_DemolistSelectedIsDir = m_DemolistSelectedIndex < 0 ? false : m_vDemos[m_DemolistSelectedIndex].m_IsDir; } bool CMenus::FetchHeader(CDemoItem &Item) @@ -834,11 +834,11 @@ bool CMenus::FetchHeader(CDemoItem &Item) void CMenus::FetchAllHeaders() { - for(auto &Item : m_lDemos) + for(auto &Item : m_vDemos) { FetchHeader(Item); } - std::stable_sort(m_lDemos.begin(), m_lDemos.end()); + std::stable_sort(m_vDemos.begin(), m_vDemos.end()); } void CMenus::RenderDemoList(CUIRect MainView) @@ -854,7 +854,7 @@ void CMenus::RenderDemoList(CUIRect MainView) char aFooterLabel[128] = {0}; if(m_DemolistSelectedIndex >= 0) { - CDemoItem &Item = m_lDemos[m_DemolistSelectedIndex]; + CDemoItem &Item = m_vDemos[m_DemolistSelectedIndex]; if(str_comp(Item.m_aFilename, "..") == 0) str_copy(aFooterLabel, Localize("Parent Folder"), sizeof(aFooterLabel)); else if(m_DemolistSelectedIsDir) @@ -901,7 +901,7 @@ void CMenus::RenderDemoList(CUIRect MainView) MainView.VMargin(5.0f, &MainView); MainView.HSplitBottom(5.0f, &MainView, 0); RenderTools()->DrawUIRect(&MainView, ColorRGBA(0, 0, 0, 0.15f), CUI::CORNER_B, 4.0f); - if(!m_DemolistSelectedIsDir && m_DemolistSelectedIndex >= 0 && m_lDemos[m_DemolistSelectedIndex].m_Valid) + if(!m_DemolistSelectedIsDir && m_DemolistSelectedIndex >= 0 && m_vDemos[m_DemolistSelectedIndex].m_Valid) { CUIRect Left, Right, Labels; MainView.VMargin(20.0f, &MainView); @@ -914,19 +914,19 @@ void CMenus::RenderDemoList(CUIRect MainView) UI()->DoLabelScaled(&Left, Localize("Created:"), 14.0f, TEXTALIGN_LEFT); char aTimestamp[256]; - str_timestamp_ex(m_lDemos[m_DemolistSelectedIndex].m_Date, aTimestamp, sizeof(aTimestamp), FORMAT_SPACE); + str_timestamp_ex(m_vDemos[m_DemolistSelectedIndex].m_Date, aTimestamp, sizeof(aTimestamp), FORMAT_SPACE); UI()->DoLabelScaled(&Right, aTimestamp, 14.0f, TEXTALIGN_LEFT); Labels.HSplitTop(5.0f, 0, &Labels); Labels.HSplitTop(20.0f, &Left, &Labels); Left.VSplitLeft(150.0f, &Left, &Right); UI()->DoLabelScaled(&Left, Localize("Type:"), 14.0f, TEXTALIGN_LEFT); - UI()->DoLabelScaled(&Right, m_lDemos[m_DemolistSelectedIndex].m_Info.m_aType, 14.0f, TEXTALIGN_LEFT); + UI()->DoLabelScaled(&Right, m_vDemos[m_DemolistSelectedIndex].m_Info.m_aType, 14.0f, TEXTALIGN_LEFT); Labels.HSplitTop(5.0f, 0, &Labels); Labels.HSplitTop(20.0f, &Left, &Labels); Left.VSplitLeft(150.0f, &Left, &Right); UI()->DoLabelScaled(&Left, Localize("Length:"), 14.0f, TEXTALIGN_LEFT); - int Length = m_lDemos[m_DemolistSelectedIndex].Length(); + int Length = m_vDemos[m_DemolistSelectedIndex].Length(); char aBuf[64]; str_time((int64_t)Length * 100, TIME_HOURS, aBuf, sizeof(aBuf)); UI()->DoLabelScaled(&Right, aBuf, 14.0f, TEXTALIGN_LEFT); @@ -934,13 +934,13 @@ void CMenus::RenderDemoList(CUIRect MainView) Labels.HSplitTop(20.0f, &Left, &Labels); Left.VSplitLeft(150.0f, &Left, &Right); UI()->DoLabelScaled(&Left, Localize("Version:"), 14.0f, TEXTALIGN_LEFT); - str_format(aBuf, sizeof(aBuf), "%d", m_lDemos[m_DemolistSelectedIndex].m_Info.m_Version); + str_format(aBuf, sizeof(aBuf), "%d", m_vDemos[m_DemolistSelectedIndex].m_Info.m_Version); UI()->DoLabelScaled(&Right, aBuf, 14.0f, TEXTALIGN_LEFT); Labels.HSplitTop(5.0f, 0, &Labels); Labels.HSplitTop(20.0f, &Left, &Labels); Left.VSplitLeft(150.0f, &Left, &Right); UI()->DoLabelScaled(&Left, Localize("Markers:"), 14.0f, TEXTALIGN_LEFT); - str_format(aBuf, sizeof(aBuf), "%d", m_lDemos[m_DemolistSelectedIndex].NumMarkers()); + str_format(aBuf, sizeof(aBuf), "%d", m_vDemos[m_DemolistSelectedIndex].NumMarkers()); UI()->DoLabelScaled(&Right, aBuf, 14.0f, TEXTALIGN_LEFT); // right side @@ -948,12 +948,12 @@ void CMenus::RenderDemoList(CUIRect MainView) Labels.HSplitTop(20.0f, &Left, &Labels); Left.VSplitLeft(150.0f, &Left, &Right); UI()->DoLabelScaled(&Left, Localize("Map:"), 14.0f, TEXTALIGN_LEFT); - UI()->DoLabelScaled(&Right, m_lDemos[m_DemolistSelectedIndex].m_Info.m_aMapName, 14.0f, TEXTALIGN_LEFT); + UI()->DoLabelScaled(&Right, m_vDemos[m_DemolistSelectedIndex].m_Info.m_aMapName, 14.0f, TEXTALIGN_LEFT); Labels.HSplitTop(5.0f, 0, &Labels); Labels.HSplitTop(20.0f, &Left, &Labels); Left.VSplitLeft(150.0f, &Left, &Right); UI()->DoLabelScaled(&Left, Localize("Size:"), 14.0f, TEXTALIGN_LEFT); - const float Size = m_lDemos[m_DemolistSelectedIndex].Size() / 1024.0f; + const float Size = m_vDemos[m_DemolistSelectedIndex].Size() / 1024.0f; if(Size > 1024) str_format(aBuf, sizeof(aBuf), Localize("%.2f MiB"), Size / 1024.0f); else @@ -962,17 +962,17 @@ void CMenus::RenderDemoList(CUIRect MainView) Labels.HSplitTop(5.0f, 0, &Labels); Labels.HSplitTop(20.0f, &Left, &Labels); Left.VSplitLeft(150.0f, &Left, &Right); - if(m_lDemos[m_DemolistSelectedIndex].m_MapInfo.m_Sha256 != SHA256_ZEROED) + if(m_vDemos[m_DemolistSelectedIndex].m_MapInfo.m_Sha256 != SHA256_ZEROED) { UI()->DoLabelScaled(&Left, "SHA256:", 14.0f, TEXTALIGN_LEFT); char aSha[SHA256_MAXSTRSIZE]; - sha256_str(m_lDemos[m_DemolistSelectedIndex].m_MapInfo.m_Sha256, aSha, sizeof(aSha) / 2); + sha256_str(m_vDemos[m_DemolistSelectedIndex].m_MapInfo.m_Sha256, aSha, sizeof(aSha) / 2); UI()->DoLabelScaled(&Right, aSha, Right.w > 235 ? 14.0f : 11.0f, TEXTALIGN_LEFT); } else { UI()->DoLabelScaled(&Left, Localize("Crc:"), 14.0f, TEXTALIGN_LEFT); - str_format(aBuf, sizeof(aBuf), "%08x", m_lDemos[m_DemolistSelectedIndex].m_MapInfo.m_Crc); + str_format(aBuf, sizeof(aBuf), "%08x", m_vDemos[m_DemolistSelectedIndex].m_MapInfo.m_Crc); UI()->DoLabelScaled(&Right, aBuf, 14.0f, TEXTALIGN_LEFT); } Labels.HSplitTop(5.0f, 0, &Labels); @@ -980,7 +980,7 @@ void CMenus::RenderDemoList(CUIRect MainView) Left.VSplitLeft(150.0f, &Left, &Right); UI()->DoLabelScaled(&Left, Localize("Netversion:"), 14.0f, TEXTALIGN_LEFT); - UI()->DoLabelScaled(&Right, m_lDemos[m_DemolistSelectedIndex].m_Info.m_aNetversion, 14.0f, TEXTALIGN_LEFT); + UI()->DoLabelScaled(&Right, m_vDemos[m_DemolistSelectedIndex].m_Info.m_aNetversion, 14.0f, TEXTALIGN_LEFT); } // demo list @@ -1070,7 +1070,7 @@ void CMenus::RenderDemoList(CUIRect MainView) } // Don't rescan in order to keep fetched headers, just resort - std::stable_sort(m_lDemos.begin(), m_lDemos.end()); + std::stable_sort(m_vDemos.begin(), m_vDemos.end()); DemolistOnUpdate(false); } } @@ -1083,10 +1083,10 @@ void CMenus::RenderDemoList(CUIRect MainView) s_ScrollValue = UIEx()->DoScrollbarV(&s_ScrollValue, &Scroll, s_ScrollValue); int PreviousIndex = m_DemolistSelectedIndex; - HandleListInputs(ListBox, s_ScrollValue, 3.0f, &m_ScrollOffset, s_aCols[0].m_Rect.h, m_DemolistSelectedIndex, m_lDemos.size()); + HandleListInputs(ListBox, s_ScrollValue, 3.0f, &m_ScrollOffset, s_aCols[0].m_Rect.h, m_DemolistSelectedIndex, m_vDemos.size()); if(PreviousIndex != m_DemolistSelectedIndex) { - str_copy(g_Config.m_UiDemoSelected, m_lDemos[m_DemolistSelectedIndex].m_aName, sizeof(g_Config.m_UiDemoSelected)); + str_copy(g_Config.m_UiDemoSelected, m_vDemos[m_DemolistSelectedIndex].m_aName, sizeof(g_Config.m_UiDemoSelected)); DemolistOnUpdate(false); } @@ -1095,13 +1095,13 @@ void CMenus::RenderDemoList(CUIRect MainView) CUIRect OriginalView = ListBox; int Num = (int)(ListBox.h / s_aCols[0].m_Rect.h) + 1; - int ScrollNum = maximum(m_lDemos.size() - Num + 1, 0); + int ScrollNum = maximum(m_vDemos.size() - Num + 1, 0); ListBox.y -= s_ScrollValue * ScrollNum * s_aCols[0].m_Rect.h; int ItemIndex = -1; bool DoubleClicked = false; - for(auto &Item : m_lDemos) + for(auto &Item : m_vDemos) { ItemIndex++; @@ -1217,14 +1217,14 @@ void CMenus::RenderDemoList(CUIRect MainView) { if(m_DemolistSelectedIsDir) // folder { - if(str_comp(m_lDemos[m_DemolistSelectedIndex].m_aFilename, "..") == 0) // parent folder + if(str_comp(m_vDemos[m_DemolistSelectedIndex].m_aFilename, "..") == 0) // parent folder fs_parent_dir(m_aCurrentDemoFolder); else // sub folder { char aTemp[256]; str_copy(aTemp, m_aCurrentDemoFolder, sizeof(aTemp)); - str_format(m_aCurrentDemoFolder, sizeof(m_aCurrentDemoFolder), "%s/%s", aTemp, m_lDemos[m_DemolistSelectedIndex].m_aFilename); - m_DemolistStorageType = m_lDemos[m_DemolistSelectedIndex].m_StorageType; + str_format(m_aCurrentDemoFolder, sizeof(m_aCurrentDemoFolder), "%s/%s", aTemp, m_vDemos[m_DemolistSelectedIndex].m_aFilename); + m_DemolistStorageType = m_vDemos[m_DemolistSelectedIndex].m_StorageType; } DemolistPopulate(); DemolistOnUpdate(true); @@ -1232,8 +1232,8 @@ void CMenus::RenderDemoList(CUIRect MainView) else // file { char aBuf[512]; - str_format(aBuf, sizeof(aBuf), "%s/%s", m_aCurrentDemoFolder, m_lDemos[m_DemolistSelectedIndex].m_aFilename); - const char *pError = Client()->DemoPlayer_Play(aBuf, m_lDemos[m_DemolistSelectedIndex].m_StorageType); + str_format(aBuf, sizeof(aBuf), "%s/%s", m_aCurrentDemoFolder, m_vDemos[m_DemolistSelectedIndex].m_aFilename); + const char *pError = Client()->DemoPlayer_Play(aBuf, m_vDemos[m_DemolistSelectedIndex].m_StorageType); if(pError) PopupMessage(Localize("Error"), str_comp(pError, "error loading demo") ? pError : Localize("Error loading demo"), Localize("Ok")); else @@ -1277,7 +1277,7 @@ void CMenus::RenderDemoList(CUIRect MainView) { UI()->SetActiveItem(nullptr); m_Popup = POPUP_RENAME_DEMO; - str_copy(m_aCurrentDemoFile, m_lDemos[m_DemolistSelectedIndex].m_aFilename, sizeof(m_aCurrentDemoFile)); + str_copy(m_aCurrentDemoFile, m_vDemos[m_DemolistSelectedIndex].m_aFilename, sizeof(m_aCurrentDemoFile)); return; } } @@ -1290,7 +1290,7 @@ void CMenus::RenderDemoList(CUIRect MainView) { UI()->SetActiveItem(nullptr); m_Popup = POPUP_RENDER_DEMO; - str_copy(m_aCurrentDemoFile, m_lDemos[m_DemolistSelectedIndex].m_aFilename, sizeof(m_aCurrentDemoFile)); + str_copy(m_aCurrentDemoFile, m_vDemos[m_DemolistSelectedIndex].m_aFilename, sizeof(m_aCurrentDemoFile)); return; } } diff --git a/src/game/client/components/menus_ingame.cpp b/src/game/client/components/menus_ingame.cpp index e2212e3ed..a2ac59a3e 100644 --- a/src/game/client/components/menus_ingame.cpp +++ b/src/game/client/components/menus_ingame.cpp @@ -867,7 +867,7 @@ int CMenus::GhostlistFetchCallback(const char *pName, int IsDir, int StorageType str_copy(Item.m_aPlayer, Info.m_aOwner, sizeof(Item.m_aPlayer)); Item.m_Time = Info.m_Time; if(Item.m_Time > 0) - pSelf->m_lGhosts.push_back(Item); + pSelf->m_vGhosts.push_back(Item); if(tw::time_get() - pSelf->m_GhostPopulateStartTime > 500ms) { @@ -879,13 +879,13 @@ int CMenus::GhostlistFetchCallback(const char *pName, int IsDir, int StorageType void CMenus::GhostlistPopulate() { - m_lGhosts.clear(); + m_vGhosts.clear(); m_GhostPopulateStartTime = tw::time_get(); Storage()->ListDirectory(IStorage::TYPE_ALL, m_pClient->m_Ghost.GetGhostDir(), GhostlistFetchCallback, this); - std::sort(m_lGhosts.begin(), m_lGhosts.end()); + std::sort(m_vGhosts.begin(), m_vGhosts.end()); CGhostItem *pOwnGhost = 0; - for(auto &Ghost : m_lGhosts) + for(auto &Ghost : m_vGhosts) if(str_comp(Ghost.m_aPlayer, Client()->PlayerName()) == 0 && (!pOwnGhost || Ghost < *pOwnGhost)) pOwnGhost = &Ghost; @@ -898,7 +898,7 @@ void CMenus::GhostlistPopulate() CMenus::CGhostItem *CMenus::GetOwnGhost() { - for(auto &Ghost : m_lGhosts) + for(auto &Ghost : m_vGhosts) if(Ghost.m_Own) return &Ghost; return nullptr; @@ -907,27 +907,27 @@ CMenus::CGhostItem *CMenus::GetOwnGhost() void CMenus::UpdateOwnGhost(CGhostItem Item) { int Own = -1; - for(size_t i = 0; i < m_lGhosts.size(); i++) - if(m_lGhosts[i].m_Own) + for(size_t i = 0; i < m_vGhosts.size(); i++) + if(m_vGhosts[i].m_Own) Own = i; if(Own != -1) { - m_lGhosts[Own].m_Slot = -1; - m_lGhosts[Own].m_Own = false; - if(Item.HasFile() || !m_lGhosts[Own].HasFile()) + m_vGhosts[Own].m_Slot = -1; + m_vGhosts[Own].m_Own = false; + if(Item.HasFile() || !m_vGhosts[Own].HasFile()) DeleteGhostItem(Own); } Item.m_Own = true; - m_lGhosts.insert(std::lower_bound(m_lGhosts.begin(), m_lGhosts.end(), Item), Item); + m_vGhosts.insert(std::lower_bound(m_vGhosts.begin(), m_vGhosts.end(), Item), Item); } void CMenus::DeleteGhostItem(int Index) { - if(m_lGhosts[Index].HasFile()) - Storage()->RemoveFile(m_lGhosts[Index].m_aFilename, IStorage::TYPE_SAVE); - m_lGhosts.erase(m_lGhosts.begin() + Index); + if(m_vGhosts[Index].HasFile()) + Storage()->RemoveFile(m_vGhosts[Index].m_aFilename, IStorage::TYPE_SAVE); + m_vGhosts.erase(m_vGhosts.begin() + Index); } void CMenus::RenderGhost(CUIRect MainView) @@ -996,7 +996,7 @@ void CMenus::RenderGhost(CUIRect MainView) static float s_ScrollValue = 0; s_ScrollValue = UIEx()->DoScrollbarV(&s_ScrollValue, &Scroll, s_ScrollValue); - int NumGhosts = m_lGhosts.size(); + int NumGhosts = m_vGhosts.size(); static int s_SelectedIndex = 0; HandleListInputs(View, s_ScrollValue, 1.0f, nullptr, s_aCols[0].m_Rect.h, s_SelectedIndex, NumGhosts); @@ -1013,7 +1013,7 @@ void CMenus::RenderGhost(CUIRect MainView) for(int i = 0; i < NumGhosts; i++) { - const CGhostItem *pItem = &m_lGhosts[i]; + const CGhostItem *pItem = &m_vGhosts[i]; CUIRect Row; View.HSplitTop(17.0f, &Row, &View); @@ -1106,10 +1106,10 @@ void CMenus::RenderGhost(CUIRect MainView) GhostlistPopulate(); } - if(s_SelectedIndex == -1 || s_SelectedIndex >= (int)m_lGhosts.size()) + if(s_SelectedIndex == -1 || s_SelectedIndex >= (int)m_vGhosts.size()) return; - CGhostItem *pGhost = &m_lGhosts[s_SelectedIndex]; + CGhostItem *pGhost = &m_vGhosts[s_SelectedIndex]; CGhostItem *pOwnGhost = GetOwnGhost(); int ReservedSlots = !pGhost->m_Own && !(pOwnGhost && pOwnGhost->Active()); diff --git a/src/game/client/components/menus_settings.cpp b/src/game/client/components/menus_settings.cpp index 87f30d452..08007948a 100644 --- a/src/game/client/components/menus_settings.cpp +++ b/src/game/client/components/menus_settings.cpp @@ -1480,7 +1480,7 @@ void CMenus::RenderSettingsGraphics(CUIRect MainView) // GPU list const auto &GPUList = Graphics()->GetGPUs(); - if(GPUList.m_GPUs.size() > 1) + if(GPUList.m_vGPUs.size() > 1) { MainView.HSplitTop(10.0f, nullptr, &MainView); MainView.HSplitTop(20.0f, &Text, &MainView); @@ -1493,7 +1493,7 @@ void CMenus::RenderSettingsGraphics(CUIRect MainView) static std::vector vGPUIDPtrs; static std::vector vGPUIDNames; - size_t GPUCount = GPUList.m_GPUs.size() + 1; + size_t GPUCount = GPUList.m_vGPUs.size() + 1; vGPUIDs.resize(GPUCount); vGPUIDPtrs.resize(GPUCount); vGPUIDNames.resize(GPUCount); @@ -1517,8 +1517,8 @@ void CMenus::RenderSettingsGraphics(CUIRect MainView) } else { - vGPUIDNames[i] = GPUList.m_GPUs[i - 1].m_Name; - if(str_comp(GPUList.m_GPUs[i - 1].m_Name, g_Config.m_GfxGPUName) == 0) + vGPUIDNames[i] = GPUList.m_vGPUs[i - 1].m_Name; + if(str_comp(GPUList.m_vGPUs[i - 1].m_Name, g_Config.m_GfxGPUName) == 0) { OldSelectedGPU = i; } @@ -1537,7 +1537,7 @@ void CMenus::RenderSettingsGraphics(CUIRect MainView) if(NewGPU == 0) str_copy(g_Config.m_GfxGPUName, "auto", sizeof(g_Config.m_GfxGPUName)); else - str_copy(g_Config.m_GfxGPUName, GPUList.m_GPUs[NewGPU - 1].m_Name, sizeof(g_Config.m_GfxGPUName)); + str_copy(g_Config.m_GfxGPUName, GPUList.m_vGPUs[NewGPU - 1].m_Name, sizeof(g_Config.m_GfxGPUName)); CheckSettings = true; s_GfxGPUChanged = NewGPU != s_OldSelectedGPU; } diff --git a/src/game/client/components/menus_settings_assets.cpp b/src/game/client/components/menus_settings_assets.cpp index 02e44b702..57f8888bc 100644 --- a/src/game/client/components/menus_settings_assets.cpp +++ b/src/game/client/components/menus_settings_assets.cpp @@ -99,7 +99,7 @@ int CMenus::EntitiesScan(const char *pName, int IsDir, int DirType, void *pUser) SCustomEntities EntitiesItem; str_copy(EntitiesItem.m_aName, pName, sizeof(EntitiesItem.m_aName)); CMenus::LoadEntities(&EntitiesItem, pUser); - pThis->m_EntitiesList.push_back(EntitiesItem); + pThis->m_vEntitiesList.push_back(EntitiesItem); } else { @@ -114,7 +114,7 @@ int CMenus::EntitiesScan(const char *pName, int IsDir, int DirType, void *pUser) SCustomEntities EntitiesItem; str_copy(EntitiesItem.m_aName, aName, sizeof(EntitiesItem.m_aName)); CMenus::LoadEntities(&EntitiesItem, pUser); - pThis->m_EntitiesList.push_back(EntitiesItem); + pThis->m_vEntitiesList.push_back(EntitiesItem); } } @@ -204,7 +204,7 @@ int CMenus::GameScan(const char *pName, int IsDir, int DirType, void *pUser) auto *pRealUser = (SMenuAssetScanUser *)pUser; auto *pThis = (CMenus *)pRealUser->m_pUser; IGraphics *pGraphics = pThis->Graphics(); - return AssetScan(pName, IsDir, DirType, pThis->m_GameList, "game", pGraphics, pUser); + return AssetScan(pName, IsDir, DirType, pThis->m_vGameList, "game", pGraphics, pUser); } int CMenus::EmoticonsScan(const char *pName, int IsDir, int DirType, void *pUser) @@ -212,7 +212,7 @@ int CMenus::EmoticonsScan(const char *pName, int IsDir, int DirType, void *pUser auto *pRealUser = (SMenuAssetScanUser *)pUser; auto *pThis = (CMenus *)pRealUser->m_pUser; IGraphics *pGraphics = pThis->Graphics(); - return AssetScan(pName, IsDir, DirType, pThis->m_EmoticonList, "emoticons", pGraphics, pUser); + return AssetScan(pName, IsDir, DirType, pThis->m_vEmoticonList, "emoticons", pGraphics, pUser); } int CMenus::ParticlesScan(const char *pName, int IsDir, int DirType, void *pUser) @@ -220,7 +220,7 @@ int CMenus::ParticlesScan(const char *pName, int IsDir, int DirType, void *pUser auto *pRealUser = (SMenuAssetScanUser *)pUser; auto *pThis = (CMenus *)pRealUser->m_pUser; IGraphics *pGraphics = pThis->Graphics(); - return AssetScan(pName, IsDir, DirType, pThis->m_ParticlesList, "particles", pGraphics, pUser); + return AssetScan(pName, IsDir, DirType, pThis->m_vParticlesList, "particles", pGraphics, pUser); } int CMenus::HudScan(const char *pName, int IsDir, int DirType, void *pUser) @@ -228,7 +228,7 @@ int CMenus::HudScan(const char *pName, int IsDir, int DirType, void *pUser) auto *pRealUser = (SMenuAssetScanUser *)pUser; auto *pThis = (CMenus *)pRealUser->m_pUser; IGraphics *pGraphics = pThis->Graphics(); - return AssetScan(pName, IsDir, DirType, pThis->m_HudList, "hud", pGraphics, pUser); + return AssetScan(pName, IsDir, DirType, pThis->m_vHudList, "hud", pGraphics, pUser); } static std::vector s_SearchEntitiesList; @@ -282,7 +282,7 @@ void CMenus::ClearCustomItems(int CurTab) { if(CurTab == ASSETS_TAB_ENTITIES) { - for(auto &Entity : m_EntitiesList) + for(auto &Entity : m_vEntitiesList) { for(auto &Image : Entity.m_aImages) { @@ -291,35 +291,35 @@ void CMenus::ClearCustomItems(int CurTab) Image.m_Texture = IGraphics::CTextureHandle(); } } - m_EntitiesList.clear(); + m_vEntitiesList.clear(); // reload current entities m_pClient->m_MapImages.ChangeEntitiesPath(g_Config.m_ClAssetsEntites); } else if(CurTab == ASSETS_TAB_GAME) { - ClearAssetList(m_GameList, Graphics()); + ClearAssetList(m_vGameList, Graphics()); // reload current game skin GameClient()->LoadGameSkin(g_Config.m_ClAssetGame); } else if(CurTab == ASSETS_TAB_EMOTICONS) { - ClearAssetList(m_EmoticonList, Graphics()); + ClearAssetList(m_vEmoticonList, Graphics()); // reload current emoticons skin GameClient()->LoadEmoticonsSkin(g_Config.m_ClAssetEmoticons); } else if(CurTab == ASSETS_TAB_PARTICLES) { - ClearAssetList(m_ParticlesList, Graphics()); + ClearAssetList(m_vParticlesList, Graphics()); // reload current particles skin GameClient()->LoadParticlesSkin(g_Config.m_ClAssetParticles); } else if(CurTab == ASSETS_TAB_HUD) { - ClearAssetList(m_HudList, Graphics()); + ClearAssetList(m_vHudList, Graphics()); // reload current hud skin GameClient()->LoadHudSkin(g_Config.m_ClAssetHud); @@ -396,35 +396,35 @@ void CMenus::RenderSettingsCustom(CUIRect MainView) }; if(s_CurCustomTab == ASSETS_TAB_ENTITIES) { - if(m_EntitiesList.empty()) + if(m_vEntitiesList.empty()) { SCustomEntities EntitiesItem; str_copy(EntitiesItem.m_aName, "default", sizeof(EntitiesItem.m_aName)); LoadEntities(&EntitiesItem, &User); - m_EntitiesList.push_back(EntitiesItem); + m_vEntitiesList.push_back(EntitiesItem); // load entities Storage()->ListDirectory(IStorage::TYPE_ALL, "assets/entities", EntitiesScan, &User); - std::sort(m_EntitiesList.begin(), m_EntitiesList.end()); + std::sort(m_vEntitiesList.begin(), m_vEntitiesList.end()); } - if(m_EntitiesList.size() != s_CustomListSize[s_CurCustomTab]) + if(m_vEntitiesList.size() != s_CustomListSize[s_CurCustomTab]) s_InitCustomList[s_CurCustomTab] = true; } else if(s_CurCustomTab == ASSETS_TAB_GAME) { - InitAssetList(m_GameList, "assets/game", "game", GameScan, Graphics(), Storage(), &User); + InitAssetList(m_vGameList, "assets/game", "game", GameScan, Graphics(), Storage(), &User); } else if(s_CurCustomTab == ASSETS_TAB_EMOTICONS) { - InitAssetList(m_EmoticonList, "assets/emoticons", "emoticons", EmoticonsScan, Graphics(), Storage(), &User); + InitAssetList(m_vEmoticonList, "assets/emoticons", "emoticons", EmoticonsScan, Graphics(), Storage(), &User); } else if(s_CurCustomTab == ASSETS_TAB_PARTICLES) { - InitAssetList(m_ParticlesList, "assets/particles", "particles", ParticlesScan, Graphics(), Storage(), &User); + InitAssetList(m_vParticlesList, "assets/particles", "particles", ParticlesScan, Graphics(), Storage(), &User); } else if(s_CurCustomTab == ASSETS_TAB_HUD) { - InitAssetList(m_HudList, "assets/hud", "hud", HudScan, Graphics(), Storage(), &User); + InitAssetList(m_vHudList, "assets/hud", "hud", HudScan, Graphics(), Storage(), &User); } MainView.HSplitTop(10.0f, 0, &MainView); @@ -438,10 +438,10 @@ void CMenus::RenderSettingsCustom(CUIRect MainView) if(s_CurCustomTab == ASSETS_TAB_ENTITIES) { s_SearchEntitiesList.clear(); - ListSize = m_EntitiesList.size(); + ListSize = m_vEntitiesList.size(); for(int i = 0; i < ListSize; ++i) { - const SCustomEntities *s = &m_EntitiesList[i]; + const SCustomEntities *s = &m_vEntitiesList[i]; // filter quick search if(s_aFilterString[s_CurCustomTab][0] != '\0' && !str_utf8_find_nocase(s->m_aName, s_aFilterString[s_CurCustomTab])) @@ -452,19 +452,19 @@ void CMenus::RenderSettingsCustom(CUIRect MainView) } else if(s_CurCustomTab == ASSETS_TAB_GAME) { - ListSize = InitSearchList(s_SearchGamesList, m_GameList); + ListSize = InitSearchList(s_SearchGamesList, m_vGameList); } else if(s_CurCustomTab == ASSETS_TAB_EMOTICONS) { - ListSize = InitSearchList(s_SearchEmoticonsList, m_EmoticonList); + ListSize = InitSearchList(s_SearchEmoticonsList, m_vEmoticonList); } else if(s_CurCustomTab == ASSETS_TAB_PARTICLES) { - ListSize = InitSearchList(s_SearchParticlesList, m_ParticlesList); + ListSize = InitSearchList(s_SearchParticlesList, m_vParticlesList); } else if(s_CurCustomTab == ASSETS_TAB_HUD) { - ListSize = InitSearchList(s_SearchHudList, m_HudList); + ListSize = InitSearchList(s_SearchHudList, m_vHudList); } s_InitCustomList[s_CurCustomTab] = false; s_CustomListSize[s_CurCustomTab] = ListSize; diff --git a/src/game/client/components/race_demo.cpp b/src/game/client/components/race_demo.cpp index b2724aa22..ca4ba22cc 100644 --- a/src/game/client/components/race_demo.cpp +++ b/src/game/client/components/race_demo.cpp @@ -27,7 +27,7 @@ struct CDemoItem struct CDemoListParam { const CRaceDemo *m_pThis; - std::vector *m_plDemos; + std::vector *m_pvDemos; const char *pMap; }; @@ -219,7 +219,7 @@ int CRaceDemo::RaceDemolistFetchCallback(const CFsFileInfo *pInfo, int IsDir, in Item.m_Time = CRaceHelper::TimeFromSecondsStr(pTime); if(Item.m_Time > 0) - pParam->m_plDemos->push_back(Item); + pParam->m_pvDemos->push_back(Item); if(tw::time_get() - pRealUser->m_pThis->m_RaceDemosLoadStartTime > 500ms) { diff --git a/src/game/client/components/skins.cpp b/src/game/client/components/skins.cpp index d1e692567..20c576ae4 100644 --- a/src/game/client/components/skins.cpp +++ b/src/game/client/components/skins.cpp @@ -294,7 +294,7 @@ int CSkins::LoadSkin(const char *pName, CImageInfo &Info) Console()->Print(IConsole::OUTPUT_LEVEL_ADDINFO, "game", aBuf); } - m_aSkins.insert(std::lower_bound(m_aSkins.begin(), m_aSkins.end(), Skin), Skin); + m_vSkins.insert(std::lower_bound(m_vSkins.begin(), m_vSkins.end(), Skin), Skin); return 0; } @@ -323,7 +323,7 @@ void CSkins::OnInit() void CSkins::Refresh(TSkinLoadedCBFunc &&SkinLoadedFunc) { - for(auto &Skin : m_aSkins) + for(auto &Skin : m_vSkins) { Graphics()->UnloadTexture(&Skin.m_OriginalSkin.m_Body); Graphics()->UnloadTexture(&Skin.m_OriginalSkin.m_BodyOutline); @@ -344,26 +344,26 @@ void CSkins::Refresh(TSkinLoadedCBFunc &&SkinLoadedFunc) Graphics()->UnloadTexture(&Eye); } - m_aSkins.clear(); - m_aDownloadSkins.clear(); + m_vSkins.clear(); + m_vDownloadSkins.clear(); SSkinScanUser SkinScanUser; SkinScanUser.m_pThis = this; SkinScanUser.m_SkinLoadedFunc = SkinLoadedFunc; Storage()->ListDirectory(IStorage::TYPE_ALL, "skins", SkinScan, &SkinScanUser); - if(m_aSkins.empty()) + if(m_vSkins.empty()) { Console()->Print(IConsole::OUTPUT_LEVEL_STANDARD, "gameclient", "failed to load skins. folder='skins/'"); CSkin DummySkin; DummySkin.m_IsVanilla = true; str_copy(DummySkin.m_aName, "dummy", sizeof(DummySkin.m_aName)); DummySkin.m_BloodColor = ColorRGBA(1.0f, 1.0f, 1.0f); - m_aSkins.push_back(DummySkin); + m_vSkins.push_back(DummySkin); } } int CSkins::Num() { - return m_aSkins.size(); + return m_vSkins.size(); } const CSkin *CSkins::Get(int Index) @@ -375,7 +375,7 @@ const CSkin *CSkins::Get(int Index) if(Index < 0) Index = 0; } - return &m_aSkins[Index % m_aSkins.size()]; + return &m_vSkins[Index % m_vSkins.size()]; } int CSkins::Find(const char *pName) @@ -404,9 +404,9 @@ int CSkins::FindImpl(const char *pName) CSkin Needle; mem_zero(&Needle, sizeof(Needle)); str_copy(Needle.m_aName, pName, sizeof(Needle.m_aName)); - auto Range = std::equal_range(m_aSkins.begin(), m_aSkins.end(), Needle); + auto Range = std::equal_range(m_vSkins.begin(), m_vSkins.end(), Needle); if(std::distance(Range.first, Range.second) == 1) - return Range.first - m_aSkins.begin(); + return Range.first - m_vSkins.begin(); if(str_comp(pName, "default") == 0) return -1; @@ -420,7 +420,7 @@ int CSkins::FindImpl(const char *pName) CDownloadSkin DownloadNeedle; mem_zero(&DownloadNeedle, sizeof(DownloadNeedle)); str_copy(DownloadNeedle.m_aName, pName, sizeof(DownloadNeedle.m_aName)); - const auto &[RangeBegin, RangeEnd] = std::equal_range(m_aDownloadSkins.begin(), m_aDownloadSkins.end(), DownloadNeedle); + const auto &[RangeBegin, RangeEnd] = std::equal_range(m_vDownloadSkins.begin(), m_vDownloadSkins.end(), DownloadNeedle); if(std::distance(RangeBegin, RangeEnd) == 1) { if(RangeBegin->m_pTask && RangeBegin->m_pTask->State() == HTTP_DONE) @@ -449,6 +449,6 @@ int CSkins::FindImpl(const char *pName) str_format(Skin.m_aPath, sizeof(Skin.m_aPath), "downloadedskins/%s", IStorage::FormatTmpPath(aBuf, sizeof(aBuf), pName)); Skin.m_pTask = std::make_shared(this, aUrl, Storage(), Skin.m_aPath); m_pClient->Engine()->AddJob(Skin.m_pTask); - m_aDownloadSkins.insert(std::lower_bound(m_aDownloadSkins.begin(), m_aDownloadSkins.end(), Skin), Skin); + m_vDownloadSkins.insert(std::lower_bound(m_vDownloadSkins.begin(), m_vDownloadSkins.end(), Skin), Skin); return -1; } diff --git a/src/game/client/components/skins.h b/src/game/client/components/skins.h index f813dcb50..93daf8e8c 100644 --- a/src/game/client/components/skins.h +++ b/src/game/client/components/skins.h @@ -45,8 +45,8 @@ public: int Find(const char *pName); private: - std::vector m_aSkins; - std::vector m_aDownloadSkins; + std::vector m_vSkins; + std::vector m_vDownloadSkins; char m_EventSkinPrefix[24]; bool LoadSkinPNG(CImageInfo &Info, const char *pName, const char *pPath, int DirType); diff --git a/src/game/client/gameclient.cpp b/src/game/client/gameclient.cpp index fe8ecdb49..f2ea7bc72 100644 --- a/src/game/client/gameclient.cpp +++ b/src/game/client/gameclient.cpp @@ -3252,7 +3252,7 @@ void CGameClient::SnapCollectEntities() std::sort(aItemEx.begin(), aItemEx.end(), CEntComparer()); // merge extended items with items they belong to - m_aSnapEntities.clear(); + m_vSnapEntities.clear(); size_t IndexEx = 0; for(const CSnapEntities &Ent : aItemData) @@ -3263,6 +3263,6 @@ void CGameClient::SnapCollectEntities() if(IndexEx < aItemEx.size() && aItemEx[IndexEx].m_Item.m_ID == Ent.m_Item.m_ID) pDataEx = (const CNetObj_EntityEx *)aItemEx[IndexEx].m_pData; - m_aSnapEntities.push_back({Ent.m_Item, Ent.m_pData, pDataEx}); + m_vSnapEntities.push_back({Ent.m_Item, Ent.m_pData, pDataEx}); } } diff --git a/src/game/client/gameclient.h b/src/game/client/gameclient.h index e4c94826a..891a22974 100644 --- a/src/game/client/gameclient.h +++ b/src/game/client/gameclient.h @@ -509,8 +509,8 @@ public: CGameWorld m_PredictedWorld; CGameWorld m_PrevPredictedWorld; - std::vector &Switchers() { return m_GameWorld.m_Core.m_aSwitchers; } - std::vector &PredSwitchers() { return m_PredictedWorld.m_Core.m_aSwitchers; } + std::vector &Switchers() { return m_GameWorld.m_Core.m_vSwitchers; } + std::vector &PredSwitchers() { return m_PredictedWorld.m_Core.m_vSwitchers; } void DummyResetInput() override; void Echo(const char *pString) override; @@ -675,10 +675,10 @@ public: SClientHudSkin m_HudSkin; bool m_HudSkinLoaded; - const std::vector &SnapEntities() { return m_aSnapEntities; } + const std::vector &SnapEntities() { return m_vSnapEntities; } private: - std::vector m_aSnapEntities; + std::vector m_vSnapEntities; void SnapCollectEntities(); bool m_DDRaceMsgSent[NUM_DUMMIES]; diff --git a/src/game/client/prediction/gameworld.cpp b/src/game/client/prediction/gameworld.cpp index f27db8571..a3b728a81 100644 --- a/src/game/client/prediction/gameworld.cpp +++ b/src/game/client/prediction/gameworld.cpp @@ -551,7 +551,7 @@ void CGameWorld::CopyWorld(CGameWorld *pFrom) } m_pTuningList = pFrom->m_pTuningList; m_Teams = pFrom->m_Teams; - m_Core.m_aSwitchers = pFrom->m_Core.m_aSwitchers; + m_Core.m_vSwitchers = pFrom->m_Core.m_vSwitchers; // delete the previous entities for(auto &pFirstEntityType : m_apFirstEntityTypes) while(pFirstEntityType) diff --git a/src/game/client/prediction/gameworld.h b/src/game/client/prediction/gameworld.h index ab4a7a98f..f1ed0d832 100644 --- a/src/game/client/prediction/gameworld.h +++ b/src/game/client/prediction/gameworld.h @@ -53,7 +53,7 @@ public: int GameTickSpeed() { return m_GameTickSpeed; } class CCollision *Collision() { return m_pCollision; } CTeamsCore *Teams() { return &m_Teams; } - std::vector &Switchers() { return m_Core.m_aSwitchers; } + std::vector &Switchers() { return m_Core.m_vSwitchers; } CTuningParams *Tuning(); CEntity *GetEntity(int ID, int EntityType); class CCharacter *GetCharacterByID(int ID) { return (ID >= 0 && ID < MAX_CLIENTS) ? m_apCharacters[ID] : 0; } diff --git a/src/game/client/ui.cpp b/src/game/client/ui.cpp index 348a6db61..f849fd8f4 100644 --- a/src/game/client/ui.cpp +++ b/src/game/client/ui.cpp @@ -14,13 +14,13 @@ void CUIElement::Init(CUI *pUI, int RequestedRectCount) { pUI->AddUIElement(this); if(RequestedRectCount > 0) - m_UIRects.resize(RequestedRectCount); + m_vUIRects.resize(RequestedRectCount); } void CUIElement::InitRects(int RequestedRectCount) { - dbg_assert(m_UIRects.empty(), "UI rects can only be initialized once, create another ui element instead."); - m_UIRects.resize(RequestedRectCount); + dbg_assert(m_vUIRects.empty(), "UI rects can only be initialized once, create another ui element instead."); + m_vUIRects.resize(RequestedRectCount); } CUIElement::SUIElementRect::SUIElementRect() { Reset(); } @@ -78,30 +78,30 @@ CUI::CUI() CUI::~CUI() { - for(CUIElement *&pEl : m_OwnUIElements) + for(CUIElement *&pEl : m_vpOwnUIElements) { delete pEl; } - m_OwnUIElements.clear(); + m_vpOwnUIElements.clear(); } CUIElement *CUI::GetNewUIElement(int RequestedRectCount) { CUIElement *pNewEl = new CUIElement(this, RequestedRectCount); - m_OwnUIElements.push_back(pNewEl); + m_vpOwnUIElements.push_back(pNewEl); return pNewEl; } void CUI::AddUIElement(CUIElement *pElement) { - m_UIElements.push_back(pElement); + m_vpUIElements.push_back(pElement); } void CUI::ResetUIElement(CUIElement &UIElement) { - for(CUIElement::SUIElementRect &Rect : UIElement.m_UIRects) + for(CUIElement::SUIElementRect &Rect : UIElement.m_vUIRects) { if(Rect.m_UIRectQuadContainer != -1) Graphics()->DeleteQuadContainer(Rect.m_UIRectQuadContainer); @@ -116,7 +116,7 @@ void CUI::ResetUIElement(CUIElement &UIElement) void CUI::OnElementsReset() { - for(CUIElement *pEl : m_UIElements) + for(CUIElement *pEl : m_vpUIElements) { ResetUIElement(*pEl); } @@ -230,11 +230,11 @@ void CUI::ClipEnable(const CUIRect *pRect) Intersection.y = std::max(pRect->y, pOldRect->y); Intersection.w = std::min(pRect->x + pRect->w, pOldRect->x + pOldRect->w) - pRect->x; Intersection.h = std::min(pRect->y + pRect->h, pOldRect->y + pOldRect->h) - pRect->y; - m_Clips.push_back(Intersection); + m_vClips.push_back(Intersection); } else { - m_Clips.push_back(*pRect); + m_vClips.push_back(*pRect); } UpdateClipping(); } @@ -242,14 +242,14 @@ void CUI::ClipEnable(const CUIRect *pRect) void CUI::ClipDisable() { dbg_assert(IsClipped(), "no clip region"); - m_Clips.pop_back(); + m_vClips.pop_back(); UpdateClipping(); } const CUIRect *CUI::ClipArea() const { dbg_assert(IsClipped(), "no clip region"); - return &m_Clips.back(); + return &m_vClips.back(); } void CUI::UpdateClipping() diff --git a/src/game/client/ui.h b/src/game/client/ui.h index 3afb4d6f3..38203a2a0 100644 --- a/src/game/client/ui.h +++ b/src/game/client/ui.h @@ -157,7 +157,7 @@ public: }; protected: - std::vector m_UIRects; + std::vector m_vUIRects; // used for marquees or other user implemented things int64_t m_ElementTime; @@ -169,12 +169,12 @@ public: SUIElementRect *Get(size_t Index) { - return &m_UIRects[Index]; + return &m_vUIRects[Index]; } bool AreRectsInit() { - return !m_UIRects.empty(); + return !m_vUIRects.empty(); } void InitRects(int RequestedRectCount); @@ -208,15 +208,15 @@ class CUI CUIRect m_Screen; - std::vector m_Clips; + std::vector m_vClips; void UpdateClipping(); class IInput *m_pInput; class IGraphics *m_pGraphics; class ITextRender *m_pTextRender; - std::vector m_OwnUIElements; // ui elements maintained by CUI class - std::vector m_UIElements; + std::vector m_vpOwnUIElements; // ui elements maintained by CUI class + std::vector m_vpUIElements; public: static float ms_FontmodHeight; @@ -321,7 +321,7 @@ public: void ClipEnable(const CUIRect *pRect); void ClipDisable(); const CUIRect *ClipArea() const; - inline bool IsClipped() const { return !m_Clips.empty(); } + inline bool IsClipped() const { return !m_vClips.empty(); } // TODO: Refactor: Redo UI scaling void SetScale(float s); diff --git a/src/game/editor/auto_map.cpp b/src/game/editor/auto_map.cpp index 08f9e5ef2..a679af591 100644 --- a/src/game/editor/auto_map.cpp +++ b/src/game/editor/auto_map.cpp @@ -76,26 +76,26 @@ void CAutoMapper::Load(const char *pTileName) NewConf.m_StartY = 0; NewConf.m_EndX = 0; NewConf.m_EndY = 0; - m_lConfigs.push_back(NewConf); - int ConfigurationID = m_lConfigs.size() - 1; - pCurrentConf = &m_lConfigs[ConfigurationID]; + m_vConfigs.push_back(NewConf); + int ConfigurationID = m_vConfigs.size() - 1; + pCurrentConf = &m_vConfigs[ConfigurationID]; str_copy(pCurrentConf->m_aName, pLine, str_length(pLine)); // add start run CRun NewRun; NewRun.m_AutomapCopy = true; - pCurrentConf->m_aRuns.push_back(NewRun); - int RunID = pCurrentConf->m_aRuns.size() - 1; - pCurrentRun = &pCurrentConf->m_aRuns[RunID]; + pCurrentConf->m_vRuns.push_back(NewRun); + int RunID = pCurrentConf->m_vRuns.size() - 1; + pCurrentRun = &pCurrentConf->m_vRuns[RunID]; } else if(str_startswith(pLine, "NewRun") && pCurrentConf) { // add new run CRun NewRun; NewRun.m_AutomapCopy = true; - pCurrentConf->m_aRuns.push_back(NewRun); - int RunID = pCurrentConf->m_aRuns.size() - 1; - pCurrentRun = &pCurrentConf->m_aRuns[RunID]; + pCurrentConf->m_vRuns.push_back(NewRun); + int RunID = pCurrentConf->m_vRuns.size() - 1; + pCurrentRun = &pCurrentConf->m_vRuns[RunID]; } else if(str_startswith(pLine, "Index") && pCurrentRun) { @@ -146,9 +146,9 @@ void CAutoMapper::Load(const char *pTileName) } // add the index rule object and make it current - pCurrentRun->m_aIndexRules.push_back(NewIndexRule); - int IndexRuleID = pCurrentRun->m_aIndexRules.size() - 1; - pCurrentIndex = &pCurrentRun->m_aIndexRules[IndexRuleID]; + pCurrentRun->m_vIndexRules.push_back(NewIndexRule); + int IndexRuleID = pCurrentRun->m_vIndexRules.size() - 1; + pCurrentIndex = &pCurrentRun->m_vIndexRules[IndexRuleID]; } else if(str_startswith(pLine, "Pos") && pCurrentIndex) { @@ -280,7 +280,7 @@ void CAutoMapper::Load(const char *pTileName) if(Value != CPosRule::NORULE) { CPosRule NewPosRule = {x, y, Value, NewIndexList}; - pCurrentIndex->m_aRules.push_back(NewPosRule); + pCurrentIndex->m_vRules.push_back(NewPosRule); pCurrentConf->m_StartX = minimum(pCurrentConf->m_StartX, NewPosRule.m_X); pCurrentConf->m_StartY = minimum(pCurrentConf->m_StartY, NewPosRule.m_Y); @@ -325,14 +325,14 @@ void CAutoMapper::Load(const char *pTileName) } // add default rule for Pos 0 0 if there is none - for(auto &Config : m_lConfigs) + for(auto &Config : m_vConfigs) { - for(auto &Run : Config.m_aRuns) + for(auto &Run : Config.m_vRuns) { - for(auto &IndexRule : Run.m_aIndexRules) + for(auto &IndexRule : Run.m_vIndexRules) { bool Found = false; - for(const auto &Rule : IndexRule.m_aRules) + for(const auto &Rule : IndexRule.m_vRules) { if(Rule.m_X == 0 && Rule.m_Y == 0) { @@ -346,7 +346,7 @@ void CAutoMapper::Load(const char *pTileName) CIndexInfo NewIndexInfo = {0, 0, false}; NewIndexList.push_back(NewIndexInfo); CPosRule NewPosRule = {0, 0, CPosRule::NOTINDEX, NewIndexList}; - IndexRule.m_aRules.push_back(NewPosRule); + IndexRule.m_vRules.push_back(NewPosRule); IndexRule.m_SkipEmpty = true; IndexRule.m_SkipFull = false; @@ -370,15 +370,15 @@ void CAutoMapper::Load(const char *pTileName) const char *CAutoMapper::GetConfigName(int Index) { - if(Index < 0 || Index >= (int)m_lConfigs.size()) + if(Index < 0 || Index >= (int)m_vConfigs.size()) return ""; - return m_lConfigs[Index].m_aName; + return m_vConfigs[Index].m_aName; } void CAutoMapper::ProceedLocalized(CLayerTiles *pLayer, int ConfigID, int Seed, int X, int Y, int Width, int Height) { - if(!m_FileLoaded || pLayer->m_Readonly || ConfigID < 0 || ConfigID >= (int)m_lConfigs.size()) + if(!m_FileLoaded || pLayer->m_Readonly || ConfigID < 0 || ConfigID >= (int)m_vConfigs.size()) return; if(Width < 0) @@ -387,7 +387,7 @@ void CAutoMapper::ProceedLocalized(CLayerTiles *pLayer, int ConfigID, int Seed, if(Height < 0) Height = pLayer->m_Height; - CConfiguration *pConf = &m_lConfigs[ConfigID]; + CConfiguration *pConf = &m_vConfigs[ConfigID]; int CommitFromX = clamp(X + pConf->m_StartX, 0, pLayer->m_Width); int CommitFromY = clamp(Y + pConf->m_StartY, 0, pLayer->m_Height); @@ -430,18 +430,18 @@ void CAutoMapper::ProceedLocalized(CLayerTiles *pLayer, int ConfigID, int Seed, void CAutoMapper::Proceed(CLayerTiles *pLayer, int ConfigID, int Seed, int SeedOffsetX, int SeedOffsetY) { - if(!m_FileLoaded || pLayer->m_Readonly || ConfigID < 0 || ConfigID >= (int)m_lConfigs.size()) + if(!m_FileLoaded || pLayer->m_Readonly || ConfigID < 0 || ConfigID >= (int)m_vConfigs.size()) return; if(Seed == 0) Seed = rand(); - CConfiguration *pConf = &m_lConfigs[ConfigID]; + CConfiguration *pConf = &m_vConfigs[ConfigID]; // for every run: copy tiles, automap, overwrite tiles - for(size_t h = 0; h < pConf->m_aRuns.size(); ++h) + for(size_t h = 0; h < pConf->m_vRuns.size(); ++h) { - CRun *pRun = &pConf->m_aRuns[h]; + CRun *pRun = &pConf->m_vRuns[h]; // don't make copy if it's requested CLayerTiles *pReadLayer; @@ -473,18 +473,18 @@ void CAutoMapper::Proceed(CLayerTiles *pLayer, int ConfigID, int Seed, int SeedO CTile *pTile = &(pLayer->m_pTiles[y * pLayer->m_Width + x]); m_pEditor->m_Map.m_Modified = true; - for(size_t i = 0; i < pRun->m_aIndexRules.size(); ++i) + for(size_t i = 0; i < pRun->m_vIndexRules.size(); ++i) { - CIndexRule *pIndexRule = &pRun->m_aIndexRules[i]; + CIndexRule *pIndexRule = &pRun->m_vIndexRules[i]; if(pIndexRule->m_SkipEmpty && pTile->m_Index == 0) // skip empty tiles continue; if(pIndexRule->m_SkipFull && pTile->m_Index != 0) // skip full tiles continue; bool RespectRules = true; - for(size_t j = 0; j < pIndexRule->m_aRules.size() && RespectRules; ++j) + for(size_t j = 0; j < pIndexRule->m_vRules.size() && RespectRules; ++j) { - CPosRule *pRule = &pIndexRule->m_aRules[j]; + CPosRule *pRule = &pIndexRule->m_vRules[j]; int CheckIndex, CheckFlags; int CheckX = x + pRule->m_X; @@ -504,7 +504,7 @@ void CAutoMapper::Proceed(CLayerTiles *pLayer, int ConfigID, int Seed, int SeedO if(pRule->m_Value == CPosRule::INDEX) { RespectRules = false; - for(auto &Index : pRule->m_aIndexList) + for(auto &Index : pRule->m_vIndexList) { if(CheckIndex == Index.m_ID && (!Index.m_TestFlag || CheckFlags == Index.m_Flag)) { @@ -515,7 +515,7 @@ void CAutoMapper::Proceed(CLayerTiles *pLayer, int ConfigID, int Seed, int SeedO } else if(pRule->m_Value == CPosRule::NOTINDEX) { - for(auto &Index : pRule->m_aIndexList) + for(auto &Index : pRule->m_vIndexList) { if(CheckIndex == Index.m_ID && (!Index.m_TestFlag || CheckFlags == Index.m_Flag)) { diff --git a/src/game/editor/auto_map.h b/src/game/editor/auto_map.h index 10ae70b2d..b5fd6cc4d 100644 --- a/src/game/editor/auto_map.h +++ b/src/game/editor/auto_map.h @@ -17,7 +17,7 @@ class CAutoMapper int m_X; int m_Y; int m_Value; - std::vector m_aIndexList; + std::vector m_vIndexList; enum { @@ -30,7 +30,7 @@ class CAutoMapper struct CIndexRule { int m_ID; - std::vector m_aRules; + std::vector m_vRules; int m_Flag; float m_RandomProbability; bool m_DefaultRule; @@ -40,13 +40,13 @@ class CAutoMapper struct CRun { - std::vector m_aIndexRules; + std::vector m_vIndexRules; bool m_AutomapCopy; }; struct CConfiguration { - std::vector m_aRuns; + std::vector m_vRuns; char m_aName[128]; int m_StartX; int m_StartY; @@ -61,13 +61,13 @@ public: void ProceedLocalized(class CLayerTiles *pLayer, int ConfigID, int Seed = 0, int X = 0, int Y = 0, int Width = -1, int Height = -1); void Proceed(class CLayerTiles *pLayer, int ConfigID, int Seed = 0, int SeedOffsetX = 0, int SeedOffsetY = 0); - int ConfigNamesNum() const { return m_lConfigs.size(); } + int ConfigNamesNum() const { return m_vConfigs.size(); } const char *GetConfigName(int Index); bool IsLoaded() const { return m_FileLoaded; } private: - std::vector m_lConfigs; + std::vector m_vConfigs; class CEditor *m_pEditor; bool m_FileLoaded; }; diff --git a/src/game/editor/editor.cpp b/src/game/editor/editor.cpp index 5e3213ac9..c304b0f2d 100644 --- a/src/game/editor/editor.cpp +++ b/src/game/editor/editor.cpp @@ -121,7 +121,7 @@ static void DeleteAll(std::vector &List) CLayerGroup::~CLayerGroup() { - DeleteAll(m_lLayers); + DeleteAll(m_vpLayers); } void CLayerGroup::Convert(CUIRect *pRect) @@ -168,7 +168,7 @@ void CLayerGroup::Render() (int)((x1 - x0) * pGraphics->ScreenWidth()), (int)((y1 - y0) * pGraphics->ScreenHeight())); } - for(auto &pLayer : m_lLayers) + for(auto &pLayer : m_vpLayers) { if(pLayer->m_Visible) { @@ -183,7 +183,7 @@ void CLayerGroup::Render() } } - for(auto &pLayer : m_lLayers) + for(auto &pLayer : m_vpLayers) { if(pLayer->m_Visible && pLayer->m_Type == LAYERTYPE_TILES && pLayer != m_pMap->m_pGameLayer && pLayer != m_pMap->m_pFrontLayer && pLayer != m_pMap->m_pTeleLayer && pLayer != m_pMap->m_pSpeedupLayer && pLayer != m_pMap->m_pSwitchLayer && pLayer != m_pMap->m_pTuneLayer) { @@ -201,15 +201,15 @@ void CLayerGroup::Render() void CLayerGroup::AddLayer(CLayer *l) { m_pMap->m_Modified = true; - m_lLayers.push_back(l); + m_vpLayers.push_back(l); } void CLayerGroup::DeleteLayer(int Index) { - if(Index < 0 || Index >= (int)m_lLayers.size()) + if(Index < 0 || Index >= (int)m_vpLayers.size()) return; - delete m_lLayers[Index]; - m_lLayers.erase(m_lLayers.begin() + Index); + delete m_vpLayers[Index]; + m_vpLayers.erase(m_vpLayers.begin() + Index); m_pMap->m_Modified = true; } @@ -217,7 +217,7 @@ void CLayerGroup::GetSize(float *w, float *h) const { *w = 0; *h = 0; - for(const auto &pLayer : m_lLayers) + for(const auto &pLayer : m_vpLayers) { float lw, lh; pLayer->GetSize(&lw, &lh); @@ -228,14 +228,14 @@ void CLayerGroup::GetSize(float *w, float *h) const int CLayerGroup::SwapLayers(int Index0, int Index1) { - if(Index0 < 0 || Index0 >= (int)m_lLayers.size()) + if(Index0 < 0 || Index0 >= (int)m_vpLayers.size()) return Index0; - if(Index1 < 0 || Index1 >= (int)m_lLayers.size()) + if(Index1 < 0 || Index1 >= (int)m_vpLayers.size()) return Index0; if(Index0 == Index1) return Index0; m_pMap->m_Modified = true; - std::swap(m_lLayers[Index0], m_lLayers[Index1]); + std::swap(m_vpLayers[Index0], m_vpLayers[Index1]); return Index1; } @@ -274,7 +274,7 @@ void CEditorImage::AnalyseTileFlags() void CEditor::EnvelopeEval(int TimeOffsetMillis, int Env, float *pChannels, void *pUser) { CEditor *pThis = (CEditor *)pUser; - if(Env < 0 || Env >= (int)pThis->m_Map.m_lEnvelopes.size()) + if(Env < 0 || Env >= (int)pThis->m_Map.m_vpEnvelopes.size()) { pChannels[0] = 0; pChannels[1] = 0; @@ -283,7 +283,7 @@ void CEditor::EnvelopeEval(int TimeOffsetMillis, int Env, float *pChannels, void return; } - CEnvelope *e = pThis->m_Map.m_lEnvelopes[Env]; + CEnvelope *e = pThis->m_Map.m_vpEnvelopes[Env]; float t = pThis->m_AnimateTime; t *= pThis->m_AnimateSpeed; t += (TimeOffsetMillis / 1000.0f); @@ -644,8 +644,8 @@ int CEditor::UiDoValueSelector(void *pID, CUIRect *pRect, const char *pLabel, in CLayerGroup *CEditor::GetSelectedGroup() const { - if(m_SelectedGroup >= 0 && m_SelectedGroup < (int)m_Map.m_lGroups.size()) - return m_Map.m_lGroups[m_SelectedGroup]; + if(m_SelectedGroup >= 0 && m_SelectedGroup < (int)m_Map.m_vpGroups.size()) + return m_Map.m_vpGroups[m_SelectedGroup]; return 0x0; } @@ -655,13 +655,13 @@ CLayer *CEditor::GetSelectedLayer(int Index) const if(!pGroup) return 0x0; - if(Index < 0 || Index >= (int)m_lSelectedLayers.size()) + if(Index < 0 || Index >= (int)m_vSelectedLayers.size()) return 0x0; - int LayerIndex = m_lSelectedLayers[Index]; + int LayerIndex = m_vSelectedLayers[Index]; - if(LayerIndex >= 0 && LayerIndex < (int)m_Map.m_lGroups[m_SelectedGroup]->m_lLayers.size()) - return pGroup->m_lLayers[LayerIndex]; + if(LayerIndex >= 0 && LayerIndex < (int)m_Map.m_vpGroups[m_SelectedGroup]->m_vpLayers.size()) + return pGroup->m_vpLayers[LayerIndex]; return 0x0; } @@ -676,13 +676,13 @@ CLayer *CEditor::GetSelectedLayerType(int Index, int Type) const std::vector CEditor::GetSelectedQuads() { CLayerQuads *ql = (CLayerQuads *)GetSelectedLayerType(0, LAYERTYPE_QUADS); - std::vector lQuads; + std::vector vpQuads; if(!ql) - return lQuads; - lQuads.resize(m_lSelectedQuads.size()); - for(int i = 0; i < (int)m_lSelectedQuads.size(); ++i) - lQuads[i] = &ql->m_lQuads[m_lSelectedQuads[i]]; - return lQuads; + return vpQuads; + vpQuads.resize(m_vSelectedQuads.size()); + for(int i = 0; i < (int)m_vSelectedQuads.size(); ++i) + vpQuads[i] = &ql->m_vQuads[m_vSelectedQuads[i]]; + return vpQuads; } CSoundSource *CEditor::GetSelectedSource() @@ -690,8 +690,8 @@ CSoundSource *CEditor::GetSelectedSource() CLayerSounds *pSounds = (CLayerSounds *)GetSelectedLayerType(0, LAYERTYPE_SOUNDS); if(!pSounds) return 0; - if(m_SelectedSource >= 0 && m_SelectedSource < (int)pSounds->m_lSources.size()) - return &pSounds->m_lSources[m_SelectedSource]; + if(m_SelectedSource >= 0 && m_SelectedSource < (int)pSounds->m_vSources.size()) + return &pSounds->m_vSources[m_SelectedSource]; return 0; } @@ -700,21 +700,21 @@ void CEditor::SelectLayer(int LayerIndex, int GroupIndex) if(GroupIndex != -1) m_SelectedGroup = GroupIndex; - m_lSelectedLayers.clear(); + m_vSelectedLayers.clear(); AddSelectedLayer(LayerIndex); } void CEditor::AddSelectedLayer(int LayerIndex) { - m_lSelectedLayers.push_back(LayerIndex); + m_vSelectedLayers.push_back(LayerIndex); m_QuadKnifeActive = false; } void CEditor::SelectQuad(int Index) { - m_lSelectedQuads.clear(); - m_lSelectedQuads.push_back(Index); + m_vSelectedQuads.clear(); + m_vSelectedQuads.push_back(Index); } void CEditor::DeleteSelectedQuads() @@ -723,14 +723,14 @@ void CEditor::DeleteSelectedQuads() if(!pLayer) return; - for(int i = 0; i < (int)m_lSelectedQuads.size(); ++i) + for(int i = 0; i < (int)m_vSelectedQuads.size(); ++i) { - pLayer->m_lQuads.erase(pLayer->m_lQuads.begin() + m_lSelectedQuads[i]); - for(int j = i + 1; j < (int)m_lSelectedQuads.size(); ++j) - if(m_lSelectedQuads[j] > m_lSelectedQuads[i]) - m_lSelectedQuads[j]--; + pLayer->m_vQuads.erase(pLayer->m_vQuads.begin() + m_vSelectedQuads[i]); + for(int j = i + 1; j < (int)m_vSelectedQuads.size(); ++j) + if(m_vSelectedQuads[j] > m_vSelectedQuads[i]) + m_vSelectedQuads[j]--; - m_lSelectedQuads.erase(m_lSelectedQuads.begin() + i); + m_vSelectedQuads.erase(m_vSelectedQuads.begin() + i); i--; } } @@ -742,8 +742,8 @@ bool CEditor::IsQuadSelected(int Index) const int CEditor::FindSelectedQuadIndex(int Index) const { - for(size_t i = 0; i < m_lSelectedQuads.size(); ++i) - if(m_lSelectedQuads[i] == Index) + for(size_t i = 0; i < m_vSelectedQuads.size(); ++i) + if(m_vSelectedQuads[i] == Index) return i; return -1; } @@ -815,7 +815,7 @@ static int EntitiesListdirCallback(const char *pName, int IsDir, int StorageType if(!IsDir && str_endswith(pName, ".png")) { std::string Name = pName; - pEditor->m_SelectEntitiesFiles.push_back(Name.substr(0, Name.length() - 4)); + pEditor->m_vSelectEntitiesFiles.push_back(Name.substr(0, Name.length() - 4)); } return 0; @@ -914,13 +914,13 @@ void CEditor::DoToolbar(CUIRect ToolBar) static int s_EntitiesButtonID = 0; if(DoButton_Editor(&s_EntitiesButtonID, "Entities", 0, &Button, 0, "Choose game layer entities image for different gametypes")) { - m_SelectEntitiesFiles.clear(); + m_vSelectEntitiesFiles.clear(); Storage()->ListDirectory(IStorage::TYPE_ALL, "editor/entities", EntitiesListdirCallback, this); - std::sort(m_SelectEntitiesFiles.begin(), m_SelectEntitiesFiles.end()); + std::sort(m_vSelectEntitiesFiles.begin(), m_vSelectEntitiesFiles.end()); static int s_EntitiesPopupID = 0; UiInvokePopupMenu(&s_EntitiesPopupID, 0, Button.x, Button.y + 18.0f, - 250, m_SelectEntitiesFiles.size() * 14 + 10, PopupEntities); + 250, m_vSelectEntitiesFiles.size() * 14 + 10, PopupEntities); } TB_Top.VSplitLeft(5.0f, 0, &TB_Top); @@ -956,7 +956,7 @@ void CEditor::DoToolbar(CUIRect ToolBar) static int s_FlipXButton = 0; if(DoButton_Ex(&s_FlipXButton, "X/X", Enabled, &Button, 0, "[N] Flip brush horizontal", CUI::CORNER_L) || (Input()->KeyPress(KEY_N) && m_Dialog == DIALOG_NONE && m_EditBoxActive == 0)) { - for(auto &pLayer : m_Brush.m_lLayers) + for(auto &pLayer : m_Brush.m_vpLayers) pLayer->BrushFlipX(); } @@ -964,7 +964,7 @@ void CEditor::DoToolbar(CUIRect ToolBar) static int s_FlipyButton = 0; if(DoButton_Ex(&s_FlipyButton, "Y/Y", Enabled, &Button, 0, "[M] Flip brush vertical", CUI::CORNER_R) || (Input()->KeyPress(KEY_M) && m_Dialog == DIALOG_NONE && m_EditBoxActive == 0)) { - for(auto &pLayer : m_Brush.m_lLayers) + for(auto &pLayer : m_Brush.m_vpLayers) pLayer->BrushFlipY(); } @@ -973,7 +973,7 @@ void CEditor::DoToolbar(CUIRect ToolBar) static int s_RotationAmount = 90; bool TileLayer = false; // check for tile layers in brush selection - for(auto &pLayer : m_Brush.m_lLayers) + for(auto &pLayer : m_Brush.m_vpLayers) if(pLayer->m_Type == LAYERTYPE_TILES) { TileLayer = true; @@ -986,7 +986,7 @@ void CEditor::DoToolbar(CUIRect ToolBar) static int s_CcwButton = 0; if(DoButton_Ex(&s_CcwButton, "CCW", Enabled, &Button, 0, "[R] Rotates the brush counter clockwise", CUI::CORNER_L) || (Input()->KeyPress(KEY_R) && m_Dialog == DIALOG_NONE && m_EditBoxActive == 0)) { - for(auto &pLayer : m_Brush.m_lLayers) + for(auto &pLayer : m_Brush.m_vpLayers) pLayer->BrushRotate(-s_RotationAmount / 360.0f * pi * 2); } @@ -994,7 +994,7 @@ void CEditor::DoToolbar(CUIRect ToolBar) static int s_CwButton = 0; if(DoButton_Ex(&s_CwButton, "CW", Enabled, &Button, 0, "[T] Rotates the brush clockwise", CUI::CORNER_R) || (Input()->KeyPress(KEY_T) && m_Dialog == DIALOG_NONE && m_EditBoxActive == 0)) { - for(auto &pLayer : m_Brush.m_lLayers) + for(auto &pLayer : m_Brush.m_vpLayers) pLayer->BrushRotate(s_RotationAmount / 360.0f * pi * 2); } @@ -1183,8 +1183,8 @@ void CEditor::DoToolbar(CUIRect ToolBar) int Height = 64; if(pLayerQuads->m_Image >= 0) { - Width = m_Map.m_lImages[pLayerQuads->m_Image]->m_Width; - Height = m_Map.m_lImages[pLayerQuads->m_Image]->m_Height; + Width = m_Map.m_vpImages[pLayerQuads->m_Image]->m_Width; + Height = m_Map.m_vpImages[pLayerQuads->m_Image]->m_Height; } pLayerQuads->NewQuad(x, y, Width, Height); @@ -1281,7 +1281,7 @@ void CEditor::DoSoundSource(CSoundSource *pSource, int Index) { if(!UI()->MouseButton(1)) { - if(m_lSelectedLayers.size() == 1) + if(m_vSelectedLayers.size() == 1) { static int s_SourcePopupID = 0; UiInvokePopupMenu(&s_SourcePopupID, 0, UI()->MouseX(), UI()->MouseY(), 120, 200, PopupSource); @@ -1427,9 +1427,9 @@ void CEditor::DoQuad(CQuad *pQuad, int Index) int OffsetX = f2fx(x) - pQuad->m_aPoints[4].x; int OffsetY = f2fx(y) - pQuad->m_aPoints[4].y; - for(auto &Selected : m_lSelectedQuads) + for(auto &Selected : m_vSelectedQuads) { - CQuad *pCurrentQuad = &pLayer->m_lQuads[Selected]; + CQuad *pCurrentQuad = &pLayer->m_vQuads[Selected]; for(auto &Point : pCurrentQuad->m_aPoints) { Point.x += OffsetX; @@ -1442,9 +1442,9 @@ void CEditor::DoQuad(CQuad *pQuad, int Index) int OffsetX = f2fx(wx) - pQuad->m_aPoints[4].x; int OffsetY = f2fx(wy) - pQuad->m_aPoints[4].y; - for(auto &Selected : m_lSelectedQuads) + for(auto &Selected : m_vSelectedQuads) { - CQuad *pCurrentQuad = &pLayer->m_lQuads[Selected]; + CQuad *pCurrentQuad = &pLayer->m_vQuads[Selected]; for(auto &Point : pCurrentQuad->m_aPoints) { Point.x += OffsetX; @@ -1456,9 +1456,9 @@ void CEditor::DoQuad(CQuad *pQuad, int Index) else if(s_Operation == OP_ROTATE) { CLayerQuads *pLayer = (CLayerQuads *)GetSelectedLayerType(0, LAYERTYPE_QUADS); - for(size_t i = 0; i < m_lSelectedQuads.size(); ++i) + for(size_t i = 0; i < m_vSelectedQuads.size(); ++i) { - CQuad *pCurrentQuad = &pLayer->m_lQuads[m_lSelectedQuads[i]]; + CQuad *pCurrentQuad = &pLayer->m_vQuads[m_vSelectedQuads[i]]; for(int v = 0; v < 4; v++) { pCurrentQuad->m_aPoints[v] = s_lRotatePoints[i][v]; @@ -1474,7 +1474,7 @@ void CEditor::DoQuad(CQuad *pQuad, int Index) { if(!UI()->MouseButton(1)) { - if(m_lSelectedLayers.size() == 1) + if(m_vSelectedLayers.size() == 1) { m_SelectedQuadIndex = FindSelectedQuadIndex(Index); @@ -1490,7 +1490,7 @@ void CEditor::DoQuad(CQuad *pQuad, int Index) { if(!UI()->MouseButton(1)) { - if(m_lSelectedLayers.size() == 1) + if(m_vSelectedLayers.size() == 1) { m_LockMouse = false; m_Map.m_Modified = true; @@ -1538,10 +1538,10 @@ void CEditor::DoQuad(CQuad *pQuad, int Index) CLayerQuads *pLayer = (CLayerQuads *)GetSelectedLayerType(0, LAYERTYPE_QUADS); s_lRotatePoints.clear(); - s_lRotatePoints.resize(m_lSelectedQuads.size()); - for(size_t i = 0; i < m_lSelectedQuads.size(); ++i) + s_lRotatePoints.resize(m_vSelectedQuads.size()); + for(size_t i = 0; i < m_vSelectedQuads.size(); ++i) { - CQuad *pCurrentQuad = &pLayer->m_lQuads[m_lSelectedQuads[i]]; + CQuad *pCurrentQuad = &pLayer->m_vQuads[m_vSelectedQuads[i]]; s_lRotatePoints[i].resize(4); s_lRotatePoints[i][0] = pCurrentQuad->m_aPoints[0]; @@ -1658,9 +1658,9 @@ void CEditor::DoQuadPoint(CQuad *pQuad, int QuadIndex, int V) int OffsetX = f2fx(x) - pQuad->m_aPoints[V].x; int OffsetY = f2fx(y) - pQuad->m_aPoints[V].y; - for(auto &Selected : m_lSelectedQuads) + for(auto &Selected : m_vSelectedQuads) { - CQuad *pCurrentQuad = &pLayer->m_lQuads[Selected]; + CQuad *pCurrentQuad = &pLayer->m_vQuads[Selected]; for(int m = 0; m < 4; m++) if(m_SelectedPoints & (1 << m)) { @@ -1674,9 +1674,9 @@ void CEditor::DoQuadPoint(CQuad *pQuad, int QuadIndex, int V) int OffsetX = f2fx(wx) - pQuad->m_aPoints[V].x; int OffsetY = f2fx(wy) - pQuad->m_aPoints[V].y; - for(auto &Selected : m_lSelectedQuads) + for(auto &Selected : m_vSelectedQuads) { - CQuad *pCurrentQuad = &pLayer->m_lQuads[Selected]; + CQuad *pCurrentQuad = &pLayer->m_vQuads[Selected]; for(int m = 0; m < 4; m++) if(m_SelectedPoints & (1 << m)) { @@ -1689,9 +1689,9 @@ void CEditor::DoQuadPoint(CQuad *pQuad, int QuadIndex, int V) else if(s_Operation == OP_MOVEUV) { CLayerQuads *pLayer = (CLayerQuads *)GetSelectedLayerType(0, LAYERTYPE_QUADS); - for(auto &Selected : m_lSelectedQuads) + for(auto &Selected : m_vSelectedQuads) { - CQuad *pCurrentQuad = &pLayer->m_lQuads[Selected]; + CQuad *pCurrentQuad = &pLayer->m_vQuads[Selected]; for(int m = 0; m < 4; m++) if(m_SelectedPoints & (1 << m)) { @@ -1712,7 +1712,7 @@ void CEditor::DoQuadPoint(CQuad *pQuad, int QuadIndex, int V) { if(!UI()->MouseButton(1)) { - if(m_lSelectedLayers.size() == 1) + if(m_vSelectedLayers.size() == 1) { m_SelectedQuadPoint = V; m_SelectedQuadIndex = FindSelectedQuadIndex(QuadIndex); @@ -1827,7 +1827,7 @@ bool CEditor::IsInTriangle(vec2 Point, vec2 A, vec2 B, vec2 C) void CEditor::DoQuadKnife(int QuadIndex) { CLayerQuads *pLayer = (CLayerQuads *)GetSelectedLayerType(0, LAYERTYPE_QUADS); - CQuad *pQuad = &pLayer->m_lQuads[QuadIndex]; + CQuad *pQuad = &pLayer->m_vQuads[QuadIndex]; bool IgnoreGrid = Input()->KeyIsPressed(KEY_LALT) || Input()->KeyIsPressed(KEY_RALT); float SnapRadius = 4.f * m_WorldZoom; @@ -1955,7 +1955,7 @@ void CEditor::DoQuadKnife(int QuadIndex) std::swap(m_aQuadKnifePoints[2], m_aQuadKnifePoints[3]); CQuad *pResult = pLayer->NewQuad(64, 64, 64, 64); - pQuad = &pLayer->m_lQuads[QuadIndex]; + pQuad = &pLayer->m_vQuads[QuadIndex]; for(int i = 0; i < 4; i++) { @@ -2045,16 +2045,16 @@ void CEditor::DoQuadKnife(int QuadIndex) Graphics()->QuadsEnd(); } -void CEditor::DoQuadEnvelopes(const std::vector &lQuads, IGraphics::CTextureHandle Texture) +void CEditor::DoQuadEnvelopes(const std::vector &vQuads, IGraphics::CTextureHandle Texture) { - size_t Num = lQuads.size(); + size_t Num = vQuads.size(); CEnvelope **apEnvelope = new CEnvelope *[Num]; mem_zero(apEnvelope, sizeof(CEnvelope *) * Num); // NOLINT(bugprone-sizeof-expression) for(size_t i = 0; i < Num; i++) { - if((m_ShowEnvelopePreview == 1 && lQuads[i].m_PosEnv == m_SelectedEnvelope) || m_ShowEnvelopePreview == 2) - if(lQuads[i].m_PosEnv >= 0 && lQuads[i].m_PosEnv < (int)m_Map.m_lEnvelopes.size()) - apEnvelope[i] = m_Map.m_lEnvelopes[lQuads[i].m_PosEnv]; + if((m_ShowEnvelopePreview == 1 && vQuads[i].m_PosEnv == m_SelectedEnvelope) || m_ShowEnvelopePreview == 2) + if(vQuads[i].m_PosEnv >= 0 && vQuads[i].m_PosEnv < (int)m_Map.m_vpEnvelopes.size()) + apEnvelope[i] = m_Map.m_vpEnvelopes[vQuads[i].m_PosEnv]; } //Draw Lines @@ -2067,15 +2067,15 @@ void CEditor::DoQuadEnvelopes(const std::vector &lQuads, IGraphics::CText continue; //QuadParams - const CPoint *pPoints = lQuads[j].m_aPoints; - for(size_t i = 0; i < apEnvelope[j]->m_lPoints.size() - 1; i++) + const CPoint *pPoints = vQuads[j].m_aPoints; + for(size_t i = 0; i < apEnvelope[j]->m_vPoints.size() - 1; i++) { - float OffsetX = fx2f(apEnvelope[j]->m_lPoints[i].m_aValues[0]); - float OffsetY = fx2f(apEnvelope[j]->m_lPoints[i].m_aValues[1]); + float OffsetX = fx2f(apEnvelope[j]->m_vPoints[i].m_aValues[0]); + float OffsetY = fx2f(apEnvelope[j]->m_vPoints[i].m_aValues[1]); vec2 Pos0 = vec2(fx2f(pPoints[4].x) + OffsetX, fx2f(pPoints[4].y) + OffsetY); - OffsetX = fx2f(apEnvelope[j]->m_lPoints[i + 1].m_aValues[0]); - OffsetY = fx2f(apEnvelope[j]->m_lPoints[i + 1].m_aValues[1]); + OffsetX = fx2f(apEnvelope[j]->m_vPoints[i + 1].m_aValues[0]); + OffsetY = fx2f(apEnvelope[j]->m_vPoints[i + 1].m_aValues[1]); vec2 Pos1 = vec2(fx2f(pPoints[4].x) + OffsetX, fx2f(pPoints[4].y) + OffsetY); IGraphics::CLineItem Line = IGraphics::CLineItem(Pos0.x, Pos0.y, Pos1.x, Pos1.y); @@ -2095,46 +2095,46 @@ void CEditor::DoQuadEnvelopes(const std::vector &lQuads, IGraphics::CText continue; //QuadParams - const CPoint *pPoints = lQuads[j].m_aPoints; + const CPoint *pPoints = vQuads[j].m_aPoints; - for(size_t i = 0; i < apEnvelope[j]->m_lPoints.size(); i++) + for(size_t i = 0; i < apEnvelope[j]->m_vPoints.size(); i++) { //Calc Env Position - float OffsetX = fx2f(apEnvelope[j]->m_lPoints[i].m_aValues[0]); - float OffsetY = fx2f(apEnvelope[j]->m_lPoints[i].m_aValues[1]); - float Rot = fx2f(apEnvelope[j]->m_lPoints[i].m_aValues[2]) / 360.0f * pi * 2; + float OffsetX = fx2f(apEnvelope[j]->m_vPoints[i].m_aValues[0]); + float OffsetY = fx2f(apEnvelope[j]->m_vPoints[i].m_aValues[1]); + float Rot = fx2f(apEnvelope[j]->m_vPoints[i].m_aValues[2]) / 360.0f * pi * 2; //Set Colours - float Alpha = (m_SelectedQuadEnvelope == lQuads[j].m_PosEnv && m_SelectedEnvelopePoint == (int)i) ? 0.65f : 0.35f; + float Alpha = (m_SelectedQuadEnvelope == vQuads[j].m_PosEnv && m_SelectedEnvelopePoint == (int)i) ? 0.65f : 0.35f; IGraphics::CColorVertex aArray[4] = { - IGraphics::CColorVertex(0, lQuads[j].m_aColors[0].r, lQuads[j].m_aColors[0].g, lQuads[j].m_aColors[0].b, Alpha), - IGraphics::CColorVertex(1, lQuads[j].m_aColors[1].r, lQuads[j].m_aColors[1].g, lQuads[j].m_aColors[1].b, Alpha), - IGraphics::CColorVertex(2, lQuads[j].m_aColors[2].r, lQuads[j].m_aColors[2].g, lQuads[j].m_aColors[2].b, Alpha), - IGraphics::CColorVertex(3, lQuads[j].m_aColors[3].r, lQuads[j].m_aColors[3].g, lQuads[j].m_aColors[3].b, Alpha)}; + IGraphics::CColorVertex(0, vQuads[j].m_aColors[0].r, vQuads[j].m_aColors[0].g, vQuads[j].m_aColors[0].b, Alpha), + IGraphics::CColorVertex(1, vQuads[j].m_aColors[1].r, vQuads[j].m_aColors[1].g, vQuads[j].m_aColors[1].b, Alpha), + IGraphics::CColorVertex(2, vQuads[j].m_aColors[2].r, vQuads[j].m_aColors[2].g, vQuads[j].m_aColors[2].b, Alpha), + IGraphics::CColorVertex(3, vQuads[j].m_aColors[3].r, vQuads[j].m_aColors[3].g, vQuads[j].m_aColors[3].b, Alpha)}; Graphics()->SetColorVertex(aArray, 4); //Rotation if(Rot != 0) { static CPoint aRotated[4]; - aRotated[0] = lQuads[j].m_aPoints[0]; - aRotated[1] = lQuads[j].m_aPoints[1]; - aRotated[2] = lQuads[j].m_aPoints[2]; - aRotated[3] = lQuads[j].m_aPoints[3]; + aRotated[0] = vQuads[j].m_aPoints[0]; + aRotated[1] = vQuads[j].m_aPoints[1]; + aRotated[2] = vQuads[j].m_aPoints[2]; + aRotated[3] = vQuads[j].m_aPoints[3]; pPoints = aRotated; - Rotate(&lQuads[j].m_aPoints[4], &aRotated[0], Rot); - Rotate(&lQuads[j].m_aPoints[4], &aRotated[1], Rot); - Rotate(&lQuads[j].m_aPoints[4], &aRotated[2], Rot); - Rotate(&lQuads[j].m_aPoints[4], &aRotated[3], Rot); + Rotate(&vQuads[j].m_aPoints[4], &aRotated[0], Rot); + Rotate(&vQuads[j].m_aPoints[4], &aRotated[1], Rot); + Rotate(&vQuads[j].m_aPoints[4], &aRotated[2], Rot); + Rotate(&vQuads[j].m_aPoints[4], &aRotated[3], Rot); } //Set Texture Coords Graphics()->QuadsSetSubsetFree( - fx2f(lQuads[j].m_aTexcoords[0].x), fx2f(lQuads[j].m_aTexcoords[0].y), - fx2f(lQuads[j].m_aTexcoords[1].x), fx2f(lQuads[j].m_aTexcoords[1].y), - fx2f(lQuads[j].m_aTexcoords[2].x), fx2f(lQuads[j].m_aTexcoords[2].y), - fx2f(lQuads[j].m_aTexcoords[3].x), fx2f(lQuads[j].m_aTexcoords[3].y)); + fx2f(vQuads[j].m_aTexcoords[0].x), fx2f(vQuads[j].m_aTexcoords[0].y), + fx2f(vQuads[j].m_aTexcoords[1].x), fx2f(vQuads[j].m_aTexcoords[1].y), + fx2f(vQuads[j].m_aTexcoords[2].x), fx2f(vQuads[j].m_aTexcoords[2].y), + fx2f(vQuads[j].m_aTexcoords[3].x), fx2f(vQuads[j].m_aTexcoords[3].y)); //Set Quad Coords & Draw IGraphics::CFreeformItem Freeform( @@ -2156,8 +2156,8 @@ void CEditor::DoQuadEnvelopes(const std::vector &lQuads, IGraphics::CText continue; //QuadParams - for(size_t i = 0; i < apEnvelope[j]->m_lPoints.size() - 1; i++) - DoQuadEnvPoint(&lQuads[j], j, i); + for(size_t i = 0; i < apEnvelope[j]->m_vPoints.size() - 1; i++) + DoQuadEnvPoint(&vQuads[j], j, i); } Graphics()->QuadsEnd(); delete[] apEnvelope; @@ -2176,13 +2176,13 @@ void CEditor::DoQuadEnvPoint(const CQuad *pQuad, int QIndex, int PIndex) static int s_Operation = OP_NONE; float wx = UI()->MouseWorldX(); float wy = UI()->MouseWorldY(); - CEnvelope *pEnvelope = m_Map.m_lEnvelopes[pQuad->m_PosEnv]; - void *pID = &pEnvelope->m_lPoints[PIndex]; + CEnvelope *pEnvelope = m_Map.m_vpEnvelopes[pQuad->m_PosEnv]; + void *pID = &pEnvelope->m_vPoints[PIndex]; static int s_CurQIndex = -1; // get pivot - float CenterX = fx2f(pQuad->m_aPoints[4].x) + fx2f(pEnvelope->m_lPoints[PIndex].m_aValues[0]); - float CenterY = fx2f(pQuad->m_aPoints[4].y) + fx2f(pEnvelope->m_lPoints[PIndex].m_aValues[1]); + float CenterX = fx2f(pQuad->m_aPoints[4].x) + fx2f(pEnvelope->m_vPoints[PIndex].m_aValues[0]); + float CenterY = fx2f(pQuad->m_aPoints[4].y) + fx2f(pEnvelope->m_vPoints[PIndex].m_aValues[1]); float dx = (CenterX - wx) / m_WorldZoom; float dy = (CenterY - wy) / m_WorldZoom; @@ -2214,17 +2214,17 @@ void CEditor::DoQuadEnvPoint(const CQuad *pQuad, int QIndex, int PIndex) else y = (int)((wy - (LineDistance / 2) * m_GridFactor) / (LineDistance * m_GridFactor)) * (LineDistance * m_GridFactor); - pEnvelope->m_lPoints[PIndex].m_aValues[0] = f2fx(x) - pQuad->m_aPoints[4].x; - pEnvelope->m_lPoints[PIndex].m_aValues[1] = f2fx(y) - pQuad->m_aPoints[4].y; + pEnvelope->m_vPoints[PIndex].m_aValues[0] = f2fx(x) - pQuad->m_aPoints[4].x; + pEnvelope->m_vPoints[PIndex].m_aValues[1] = f2fx(y) - pQuad->m_aPoints[4].y; } else { - pEnvelope->m_lPoints[PIndex].m_aValues[0] = f2fx(wx); - pEnvelope->m_lPoints[PIndex].m_aValues[1] = f2fx(wy); + pEnvelope->m_vPoints[PIndex].m_aValues[0] = f2fx(wx); + pEnvelope->m_vPoints[PIndex].m_aValues[1] = f2fx(wy); } } else if(s_Operation == OP_ROTATE) - pEnvelope->m_lPoints[PIndex].m_aValues[2] += 10 * m_MouseDeltaX; + pEnvelope->m_vPoints[PIndex].m_aValues[2] += 10 * m_MouseDeltaX; if(!UI()->MouseButton(0)) { @@ -2281,7 +2281,7 @@ void CEditor::DoMapEditor(CUIRect View) // render all good stuff if(!m_ShowPicker) { - for(auto &pGroup : m_Map.m_lGroups) + for(auto &pGroup : m_Map.m_vpGroups) { // don't render the front, tele, speedup and switch layer now we will do it later to make them on top of others if( pGroup == (CLayerGroup *)m_Map.m_pFrontLayer || @@ -2299,7 +2299,7 @@ void CEditor::DoMapEditor(CUIRect View) if(m_Map.m_pGameGroup->m_Visible) { m_Map.m_pGameGroup->MapScreen(); - for(auto &pLayer : m_Map.m_pGameGroup->m_lLayers) + for(auto &pLayer : m_Map.m_pGameGroup->m_vpLayers) { if( pLayer->m_Visible && @@ -2394,16 +2394,16 @@ void CEditor::DoMapEditor(CUIRect View) if(q) { m_QuadsetPicker.m_Image = q->m_Image; - m_QuadsetPicker.m_lQuads[0].m_aPoints[0].x = f2fx(View.x); - m_QuadsetPicker.m_lQuads[0].m_aPoints[0].y = f2fx(View.y); - m_QuadsetPicker.m_lQuads[0].m_aPoints[1].x = f2fx((View.x + View.w)); - m_QuadsetPicker.m_lQuads[0].m_aPoints[1].y = f2fx(View.y); - m_QuadsetPicker.m_lQuads[0].m_aPoints[2].x = f2fx(View.x); - m_QuadsetPicker.m_lQuads[0].m_aPoints[2].y = f2fx((View.y + View.h)); - m_QuadsetPicker.m_lQuads[0].m_aPoints[3].x = f2fx((View.x + View.w)); - m_QuadsetPicker.m_lQuads[0].m_aPoints[3].y = f2fx((View.y + View.h)); - m_QuadsetPicker.m_lQuads[0].m_aPoints[4].x = f2fx((View.x + View.w / 2)); - m_QuadsetPicker.m_lQuads[0].m_aPoints[4].y = f2fx((View.y + View.h / 2)); + m_QuadsetPicker.m_vQuads[0].m_aPoints[0].x = f2fx(View.x); + m_QuadsetPicker.m_vQuads[0].m_aPoints[0].y = f2fx(View.y); + m_QuadsetPicker.m_vQuads[0].m_aPoints[1].x = f2fx((View.x + View.w)); + m_QuadsetPicker.m_vQuads[0].m_aPoints[1].y = f2fx(View.y); + m_QuadsetPicker.m_vQuads[0].m_aPoints[2].x = f2fx(View.x); + m_QuadsetPicker.m_vQuads[0].m_aPoints[2].y = f2fx((View.y + View.h)); + m_QuadsetPicker.m_vQuads[0].m_aPoints[3].x = f2fx((View.x + View.w)); + m_QuadsetPicker.m_vQuads[0].m_aPoints[3].y = f2fx((View.y + View.h)); + m_QuadsetPicker.m_vQuads[0].m_aPoints[4].x = f2fx((View.x + View.w / 2)); + m_QuadsetPicker.m_vQuads[0].m_aPoints[4].y = f2fx((View.y + View.h / 2)); m_QuadsetPicker.Render(); } } @@ -2429,7 +2429,7 @@ void CEditor::DoMapEditor(CUIRect View) { // pick a type of layers to edit, prefering Tiles layers. int EditingType = -1; - for(size_t i = 0; i < m_lSelectedLayers.size(); i++) + for(size_t i = 0; i < m_vSelectedLayers.size(); i++) { CLayer *Layer = GetSelectedLayer(i); if(Layer && (EditingType == -1 || Layer->m_Type == LAYERTYPE_TILES)) @@ -2439,7 +2439,7 @@ void CEditor::DoMapEditor(CUIRect View) break; } } - for(size_t i = 0; i < m_lSelectedLayers.size() && NumEditLayers < 128; i++) + for(size_t i = 0; i < m_vSelectedLayers.size() && NumEditLayers < 128; i++) { pEditLayers[NumEditLayers] = GetSelectedLayerType(i, EditingType); if(pEditLayers[NumEditLayers]) @@ -2558,20 +2558,20 @@ void CEditor::DoMapEditor(CUIRect View) // draw with brush for(size_t k = 0; k < NumEditLayers; k++) { - size_t BrushIndex = k % m_Brush.m_lLayers.size(); - if(pEditLayers[k]->m_Type == m_Brush.m_lLayers[BrushIndex]->m_Type) + size_t BrushIndex = k % m_Brush.m_vpLayers.size(); + if(pEditLayers[k]->m_Type == m_Brush.m_vpLayers[BrushIndex]->m_Type) { if(pEditLayers[k]->m_Type == LAYERTYPE_TILES) { CLayerTiles *l = (CLayerTiles *)pEditLayers[k]; - CLayerTiles *b = (CLayerTiles *)m_Brush.m_lLayers[BrushIndex]; + CLayerTiles *b = (CLayerTiles *)m_Brush.m_vpLayers[BrushIndex]; if(l->m_Tele <= b->m_Tele && l->m_Speedup <= b->m_Speedup && l->m_Front <= b->m_Front && l->m_Game <= b->m_Game && l->m_Switch <= b->m_Switch && l->m_Tune <= b->m_Tune) l->BrushDraw(b, wx, wy); } else { - pEditLayers[k]->BrushDraw(m_Brush.m_lLayers[BrushIndex], wx, wy); + pEditLayers[k]->BrushDraw(m_Brush.m_vpLayers[BrushIndex], wx, wy); } } } @@ -2586,15 +2586,15 @@ void CEditor::DoMapEditor(CUIRect View) CLayerQuads *t = (CLayerQuads *)GetSelectedLayerType(0, LAYERTYPE_QUADS); if(t) { - for(size_t i = 0; i < t->m_lQuads.size(); i++) + for(size_t i = 0; i < t->m_vQuads.size(); i++) { - CQuad *q = &t->m_lQuads[i]; + CQuad *q = &t->m_vQuads[i]; float px = fx2f(q->m_aPoints[4].x); float py = fx2f(q->m_aPoints[4].y); if(px > r.x && px < r.x + r.w && py > r.y && py < r.y + r.h) if(!IsQuadSelected(i)) - m_lSelectedQuads.push_back(i); + m_vSelectedQuads.push_back(i); } } } @@ -2612,10 +2612,10 @@ void CEditor::DoMapEditor(CUIRect View) if(Grabs == 0) m_Brush.Clear(); - for(auto &pLayer : m_Brush.m_lLayers) + for(auto &pLayer : m_Brush.m_vpLayers) pLayer->m_BrushRefCount = 1; - m_lSelectedQuads.clear(); + m_vSelectedQuads.clear(); m_SelectedPoints = 0; } } @@ -2634,9 +2634,9 @@ void CEditor::DoMapEditor(CUIRect View) for(size_t k = 0; k < NumEditLayers; k++) { size_t BrushIndex = k; - if(m_Brush.m_lLayers.size() != NumEditLayers) + if(m_Brush.m_vpLayers.size() != NumEditLayers) BrushIndex = 0; - pEditLayers[k]->FillSelection(m_Brush.IsEmpty(), m_Brush.m_lLayers[BrushIndex], r); + pEditLayers[k]->FillSelection(m_Brush.IsEmpty(), m_Brush.m_vpLayers[BrushIndex], r); } } else @@ -2652,7 +2652,7 @@ void CEditor::DoMapEditor(CUIRect View) { if(UI()->MouseButton(1)) { - for(auto &pLayer : m_Brush.m_lLayers) + for(auto &pLayer : m_Brush.m_vpLayers) { if(pLayer->m_BrushRefCount == 1) delete pLayer; @@ -2672,10 +2672,10 @@ void CEditor::DoMapEditor(CUIRect View) for(size_t k = 0; k < NumEditLayers; k++) { size_t BrushIndex = k; - if(m_Brush.m_lLayers.size() != NumEditLayers) + if(m_Brush.m_vpLayers.size() != NumEditLayers) BrushIndex = 0; - if(pEditLayers[k]->m_Type == m_Brush.m_lLayers[BrushIndex]->m_Type) - pEditLayers[k]->BrushPlace(m_Brush.m_lLayers[BrushIndex], wx, wy); + if(pEditLayers[k]->m_Type == m_Brush.m_vpLayers[BrushIndex]->m_Type) + pEditLayers[k]->BrushPlace(m_Brush.m_vpLayers[BrushIndex], wx, wy); } } @@ -2688,7 +2688,7 @@ void CEditor::DoMapEditor(CUIRect View) { m_Brush.m_OffsetX = -(int)wx; m_Brush.m_OffsetY = -(int)wy; - for(const auto &pLayer : m_Brush.m_lLayers) + for(const auto &pLayer : m_Brush.m_vpLayers) { if(pLayer->m_Type == LAYERTYPE_TILES) { @@ -2742,17 +2742,17 @@ void CEditor::DoMapEditor(CUIRect View) m_ShowEnvelopePreview = 2; if(m_QuadKnifeActive) - DoQuadKnife(m_lSelectedQuads[m_SelectedQuadIndex]); + DoQuadKnife(m_vSelectedQuads[m_SelectedQuadIndex]); else { Graphics()->TextureClear(); Graphics()->QuadsBegin(); - for(size_t i = 0; i < pLayer->m_lQuads.size(); i++) + for(size_t i = 0; i < pLayer->m_vQuads.size(); i++) { for(int v = 0; v < 4; v++) - DoQuadPoint(&pLayer->m_lQuads[i], i, v); + DoQuadPoint(&pLayer->m_vQuads[i], i, v); - DoQuad(&pLayer->m_lQuads[i], i); + DoQuad(&pLayer->m_vQuads[i], i); } Graphics()->QuadsEnd(); } @@ -2764,9 +2764,9 @@ void CEditor::DoMapEditor(CUIRect View) Graphics()->TextureClear(); Graphics()->QuadsBegin(); - for(size_t i = 0; i < pLayer->m_lSources.size(); i++) + for(size_t i = 0; i < pLayer->m_vSources.size(); i++) { - DoSoundSource(&pLayer->m_lSources[i], i); + DoSoundSource(&pLayer->m_vSources[i], i); } Graphics()->QuadsEnd(); } @@ -2945,10 +2945,10 @@ void CEditor::DoMapEditor(CUIRect View) CLayerQuads *pLayer = (CLayerQuads *)GetSelectedLayer(0); IGraphics::CTextureHandle Texture; - if(pLayer->m_Image >= 0 && pLayer->m_Image < (int)m_Map.m_lImages.size()) - Texture = m_Map.m_lImages[pLayer->m_Image]->m_Texture; + if(pLayer->m_Image >= 0 && pLayer->m_Image < (int)m_Map.m_vpImages.size()) + Texture = m_Map.m_vpImages[pLayer->m_Image]->m_Texture; - DoQuadEnvelopes(pLayer->m_lQuads, Texture); + DoQuadEnvelopes(pLayer->m_vQuads, Texture); m_ShowEnvelopePreview = 0; } @@ -3132,7 +3132,7 @@ int CEditor::DoProperties(CUIRect *pToolBox, CProperty *pProps, int *pIDs, int * if(pProps[i].m_Value < 0) str_copy(aBuf, "None", sizeof(aBuf)); else - str_format(aBuf, sizeof(aBuf), "%s", m_Map.m_lImages[pProps[i].m_Value]->m_aName); + str_format(aBuf, sizeof(aBuf), "%s", m_Map.m_vpImages[pProps[i].m_Value]->m_aName); float FontSize = ScaleFontSize(aBuf, sizeof(aBuf), 10.0f, Shifter.w); if(DoButton_Ex(&pIDs[i], aBuf, 0, &Shifter, 0, 0, CUI::CORNER_ALL, FontSize)) @@ -3184,7 +3184,7 @@ int CEditor::DoProperties(CUIRect *pToolBox, CProperty *pProps, int *pIDs, int * if(pProps[i].m_Value < 0) str_copy(aBuf, "None", sizeof(aBuf)); else - str_format(aBuf, sizeof(aBuf), "%s", m_Map.m_lSounds[pProps[i].m_Value]->m_aName); + str_format(aBuf, sizeof(aBuf), "%s", m_Map.m_vpSounds[pProps[i].m_Value]->m_aName); float FontSize = ScaleFontSize(aBuf, sizeof(aBuf), 10.0f, Shifter.w); if(DoButton_Ex(&pIDs[i], aBuf, 0, &Shifter, 0, 0, CUI::CORNER_ALL, FontSize)) @@ -3200,10 +3200,10 @@ int CEditor::DoProperties(CUIRect *pToolBox, CProperty *pProps, int *pIDs, int * else if(pProps[i].m_Type == PROPTYPE_AUTOMAPPER) { char aBuf[64]; - if(pProps[i].m_Value < 0 || pProps[i].m_Min < 0 || pProps[i].m_Min >= (int)m_Map.m_lImages.size()) + if(pProps[i].m_Value < 0 || pProps[i].m_Min < 0 || pProps[i].m_Min >= (int)m_Map.m_vpImages.size()) str_copy(aBuf, "None", sizeof(aBuf)); else - str_format(aBuf, sizeof(aBuf), "%s", m_Map.m_lImages[pProps[i].m_Min]->m_AutoMapper.GetConfigName(pProps[i].m_Value)); + str_format(aBuf, sizeof(aBuf), "%s", m_Map.m_vpImages[pProps[i].m_Min]->m_AutoMapper.GetConfigName(pProps[i].m_Value)); float FontSize = ScaleFontSize(aBuf, sizeof(aBuf), 10.0f, Shifter.w); if(DoButton_Ex(&pIDs[i], aBuf, 0, &Shifter, 0, 0, CUI::CORNER_ALL, FontSize)) @@ -3227,8 +3227,8 @@ int CEditor::DoProperties(CUIRect *pToolBox, CProperty *pProps, int *pIDs, int * if(CurValue <= 0) str_copy(aBuf, "None", sizeof(aBuf)); - else if(m_Map.m_lEnvelopes[CurValue - 1]->m_aName[0]) - str_format(aBuf, sizeof(aBuf), "%d: %s", CurValue, m_Map.m_lEnvelopes[CurValue - 1]->m_aName); + else if(m_Map.m_vpEnvelopes[CurValue - 1]->m_aName[0]) + str_format(aBuf, sizeof(aBuf), "%d: %s", CurValue, m_Map.m_vpEnvelopes[CurValue - 1]->m_aName); else str_format(aBuf, sizeof(aBuf), "%d", CurValue); @@ -3264,13 +3264,13 @@ void CEditor::RenderLayers(CUIRect ToolBox, CUIRect View) float LayersHeight = 12.0f; // Height of AddGroup button static float s_ScrollValue = 0; - for(auto &pGroup : m_Map.m_lGroups) + for(auto &pGroup : m_Map.m_vpGroups) { // Each group is 19.0f // Each layer is 14.0f LayersHeight += 19.0f; if(!pGroup->m_Collapse) - LayersHeight += pGroup->m_lLayers.size() * 14.0f; + LayersHeight += pGroup->m_vpLayers.size() * 14.0f; } float ScrollDifference = LayersHeight - LayersBox.h; @@ -3303,13 +3303,13 @@ void CEditor::RenderLayers(CUIRect ToolBox, CUIRect View) // render layers { - for(int g = 0; g < (int)m_Map.m_lGroups.size(); g++) + for(int g = 0; g < (int)m_Map.m_vpGroups.size(); g++) { if(LayerCur > LayerStopAt) break; - else if(LayerCur + m_Map.m_lGroups[g]->m_lLayers.size() * 14.0f + 19.0f < LayerStartAt) + else if(LayerCur + m_Map.m_vpGroups[g]->m_vpLayers.size() * 14.0f + 19.0f < LayerStartAt) { - LayerCur += m_Map.m_lGroups[g]->m_lLayers.size() * 14.0f + 19.0f; + LayerCur += m_Map.m_vpGroups[g]->m_vpLayers.size() * 14.0f + 19.0f; continue; } @@ -3318,23 +3318,23 @@ void CEditor::RenderLayers(CUIRect ToolBox, CUIRect View) { LayersBox.HSplitTop(12.0f, &Slot, &LayersBox); Slot.VSplitLeft(12, &VisibleToggle, &Slot); - if(DoButton_Ex(&m_Map.m_lGroups[g]->m_Visible, m_Map.m_lGroups[g]->m_Visible ? "V" : "H", m_Map.m_lGroups[g]->m_Collapse ? 1 : 0, &VisibleToggle, 0, "Toggle group visibility", CUI::CORNER_L, 10.0f, 0)) - m_Map.m_lGroups[g]->m_Visible = !m_Map.m_lGroups[g]->m_Visible; + if(DoButton_Ex(&m_Map.m_vpGroups[g]->m_Visible, m_Map.m_vpGroups[g]->m_Visible ? "V" : "H", m_Map.m_vpGroups[g]->m_Collapse ? 1 : 0, &VisibleToggle, 0, "Toggle group visibility", CUI::CORNER_L, 10.0f, 0)) + m_Map.m_vpGroups[g]->m_Visible = !m_Map.m_vpGroups[g]->m_Visible; - str_format(aBuf, sizeof(aBuf), "#%d %s", g, m_Map.m_lGroups[g]->m_aName); + str_format(aBuf, sizeof(aBuf), "#%d %s", g, m_Map.m_vpGroups[g]->m_aName); float FontSize = 10.0f; while(TextRender()->TextWidth(0, FontSize, aBuf, -1, -1.0f) > Slot.w) FontSize--; - if(int Result = DoButton_Ex(&m_Map.m_lGroups[g], aBuf, g == m_SelectedGroup, &Slot, - BUTTON_CONTEXT, m_Map.m_lGroups[g]->m_Collapse ? "Select group. Shift click to select all layers. Double click to expand." : "Select group. Shift click to select all layers. Double click to collapse.", CUI::CORNER_R, FontSize)) + if(int Result = DoButton_Ex(&m_Map.m_vpGroups[g], aBuf, g == m_SelectedGroup, &Slot, + BUTTON_CONTEXT, m_Map.m_vpGroups[g]->m_Collapse ? "Select group. Shift click to select all layers. Double click to expand." : "Select group. Shift click to select all layers. Double click to collapse.", CUI::CORNER_R, FontSize)) { if(g != m_SelectedGroup) SelectLayer(0, g); if((Input()->KeyIsPressed(KEY_LSHIFT) || Input()->KeyIsPressed(KEY_RSHIFT)) && m_SelectedGroup == g) { - m_lSelectedLayers.clear(); - for(size_t i = 0; i < m_Map.m_lGroups[g]->m_lLayers.size(); i++) + m_vSelectedLayers.clear(); + for(size_t i = 0; i < m_Map.m_vpGroups[g]->m_vpLayers.size(); i++) { AddSelectedLayer(i); } @@ -3344,14 +3344,14 @@ void CEditor::RenderLayers(CUIRect ToolBox, CUIRect View) if(Result == 2) UiInvokePopupMenu(&s_GroupPopupId, 0, UI()->MouseX(), UI()->MouseY(), 145, 230, PopupGroup); - if(!m_Map.m_lGroups[g]->m_lLayers.empty() && Input()->MouseDoubleClick()) - m_Map.m_lGroups[g]->m_Collapse ^= 1; + if(!m_Map.m_vpGroups[g]->m_vpLayers.empty() && Input()->MouseDoubleClick()) + m_Map.m_vpGroups[g]->m_Collapse ^= 1; } LayersBox.HSplitTop(2.0f, &Slot, &LayersBox); } LayerCur += 14.0f; - for(int i = 0; i < (int)m_Map.m_lGroups[g]->m_lLayers.size(); i++) + for(int i = 0; i < (int)m_Map.m_vpGroups[g]->m_vpLayers.size(); i++) { if(LayerCur > LayerStopAt) break; @@ -3361,7 +3361,7 @@ void CEditor::RenderLayers(CUIRect ToolBox, CUIRect View) continue; } - if(m_Map.m_lGroups[g]->m_Collapse) + if(m_Map.m_vpGroups[g]->m_Collapse) continue; //visible @@ -3369,27 +3369,27 @@ void CEditor::RenderLayers(CUIRect ToolBox, CUIRect View) Slot.VSplitLeft(12.0f, 0, &Button); Button.VSplitLeft(15, &VisibleToggle, &Button); - if(DoButton_Ex(&m_Map.m_lGroups[g]->m_lLayers[i]->m_Visible, m_Map.m_lGroups[g]->m_lLayers[i]->m_Visible ? "V" : "H", 0, &VisibleToggle, 0, "Toggle layer visibility", CUI::CORNER_L, 10.0f, 0)) - m_Map.m_lGroups[g]->m_lLayers[i]->m_Visible = !m_Map.m_lGroups[g]->m_lLayers[i]->m_Visible; + if(DoButton_Ex(&m_Map.m_vpGroups[g]->m_vpLayers[i]->m_Visible, m_Map.m_vpGroups[g]->m_vpLayers[i]->m_Visible ? "V" : "H", 0, &VisibleToggle, 0, "Toggle layer visibility", CUI::CORNER_L, 10.0f, 0)) + m_Map.m_vpGroups[g]->m_vpLayers[i]->m_Visible = !m_Map.m_vpGroups[g]->m_vpLayers[i]->m_Visible; - if(m_Map.m_lGroups[g]->m_lLayers[i]->m_aName[0]) - str_copy(aBuf, m_Map.m_lGroups[g]->m_lLayers[i]->m_aName, sizeof(aBuf)); + if(m_Map.m_vpGroups[g]->m_vpLayers[i]->m_aName[0]) + str_copy(aBuf, m_Map.m_vpGroups[g]->m_vpLayers[i]->m_aName, sizeof(aBuf)); else { - if(m_Map.m_lGroups[g]->m_lLayers[i]->m_Type == LAYERTYPE_TILES) + if(m_Map.m_vpGroups[g]->m_vpLayers[i]->m_Type == LAYERTYPE_TILES) { - CLayerTiles *pTiles = (CLayerTiles *)m_Map.m_lGroups[g]->m_lLayers[i]; - str_copy(aBuf, pTiles->m_Image >= 0 ? m_Map.m_lImages[pTiles->m_Image]->m_aName : "Tiles", sizeof(aBuf)); + CLayerTiles *pTiles = (CLayerTiles *)m_Map.m_vpGroups[g]->m_vpLayers[i]; + str_copy(aBuf, pTiles->m_Image >= 0 ? m_Map.m_vpImages[pTiles->m_Image]->m_aName : "Tiles", sizeof(aBuf)); } - else if(m_Map.m_lGroups[g]->m_lLayers[i]->m_Type == LAYERTYPE_QUADS) + else if(m_Map.m_vpGroups[g]->m_vpLayers[i]->m_Type == LAYERTYPE_QUADS) { - CLayerQuads *pQuads = (CLayerQuads *)m_Map.m_lGroups[g]->m_lLayers[i]; - str_copy(aBuf, pQuads->m_Image >= 0 ? m_Map.m_lImages[pQuads->m_Image]->m_aName : "Quads", sizeof(aBuf)); + CLayerQuads *pQuads = (CLayerQuads *)m_Map.m_vpGroups[g]->m_vpLayers[i]; + str_copy(aBuf, pQuads->m_Image >= 0 ? m_Map.m_vpImages[pQuads->m_Image]->m_aName : "Quads", sizeof(aBuf)); } - else if(m_Map.m_lGroups[g]->m_lLayers[i]->m_Type == LAYERTYPE_SOUNDS) + else if(m_Map.m_vpGroups[g]->m_vpLayers[i]->m_Type == LAYERTYPE_SOUNDS) { - CLayerSounds *pSounds = (CLayerSounds *)m_Map.m_lGroups[g]->m_lLayers[i]; - str_copy(aBuf, pSounds->m_Sound >= 0 ? m_Map.m_lSounds[pSounds->m_Sound]->m_aName : "Sounds", sizeof(aBuf)); + CLayerSounds *pSounds = (CLayerSounds *)m_Map.m_vpGroups[g]->m_vpLayers[i]; + str_copy(aBuf, pSounds->m_Sound >= 0 ? m_Map.m_vpSounds[pSounds->m_Sound]->m_aName : "Sounds", sizeof(aBuf)); } if(str_length(aBuf) > 11) str_format(aBuf, sizeof(aBuf), "%.8s...", aBuf); @@ -3401,7 +3401,7 @@ void CEditor::RenderLayers(CUIRect ToolBox, CUIRect View) int Checked = 0; if(g == m_SelectedGroup) { - for(const auto &Selected : m_lSelectedLayers) + for(const auto &Selected : m_vSelectedLayers) { if(Selected == i) { @@ -3411,16 +3411,16 @@ void CEditor::RenderLayers(CUIRect ToolBox, CUIRect View) } } - if(m_Map.m_lGroups[g]->m_lLayers[i] == m_Map.m_pGameLayer || - m_Map.m_lGroups[g]->m_lLayers[i] == m_Map.m_pFrontLayer || - m_Map.m_lGroups[g]->m_lLayers[i] == m_Map.m_pSwitchLayer || - m_Map.m_lGroups[g]->m_lLayers[i] == m_Map.m_pTuneLayer || - m_Map.m_lGroups[g]->m_lLayers[i] == m_Map.m_pSpeedupLayer || - m_Map.m_lGroups[g]->m_lLayers[i] == m_Map.m_pTeleLayer) + if(m_Map.m_vpGroups[g]->m_vpLayers[i] == m_Map.m_pGameLayer || + m_Map.m_vpGroups[g]->m_vpLayers[i] == m_Map.m_pFrontLayer || + m_Map.m_vpGroups[g]->m_vpLayers[i] == m_Map.m_pSwitchLayer || + m_Map.m_vpGroups[g]->m_vpLayers[i] == m_Map.m_pTuneLayer || + m_Map.m_vpGroups[g]->m_vpLayers[i] == m_Map.m_pSpeedupLayer || + m_Map.m_vpGroups[g]->m_vpLayers[i] == m_Map.m_pTeleLayer) { Checked += 6; } - if(int Result = DoButton_Ex(m_Map.m_lGroups[g]->m_lLayers[i], aBuf, Checked, &Button, + if(int Result = DoButton_Ex(m_Map.m_vpGroups[g]->m_vpLayers[i], aBuf, Checked, &Button, BUTTON_CONTEXT, "Select layer. Shift click to select multiple.", CUI::CORNER_R, FontSize)) { static CLayerPopupContext s_LayerPopupContext = {}; @@ -3428,9 +3428,9 @@ void CEditor::RenderLayers(CUIRect ToolBox, CUIRect View) { if((Input()->KeyIsPressed(KEY_LSHIFT) || Input()->KeyIsPressed(KEY_RSHIFT)) && m_SelectedGroup == g) { - auto Position = std::find(m_lSelectedLayers.begin(), m_lSelectedLayers.end(), i); - if(Position != m_lSelectedLayers.end()) - m_lSelectedLayers.erase(Position); + auto Position = std::find(m_vSelectedLayers.begin(), m_vSelectedLayers.end(), i); + if(Position != m_vSelectedLayers.end()) + m_vSelectedLayers.erase(Position); else AddSelectedLayer(i); } @@ -3445,7 +3445,7 @@ void CEditor::RenderLayers(CUIRect ToolBox, CUIRect View) if(m_SelectedGroup == g) { - for(const auto &Selected : m_lSelectedLayers) + for(const auto &Selected : m_vSelectedLayers) { if(Selected == i) { @@ -3460,23 +3460,23 @@ void CEditor::RenderLayers(CUIRect ToolBox, CUIRect View) SelectLayer(i, g); } - if(m_lSelectedLayers.size() > 1) + if(m_vSelectedLayers.size() > 1) { bool AllTile = true; - for(size_t j = 0; AllTile && j < m_lSelectedLayers.size(); j++) + for(size_t j = 0; AllTile && j < m_vSelectedLayers.size(); j++) { - if(m_Map.m_lGroups[m_SelectedGroup]->m_lLayers[m_lSelectedLayers[j]]->m_Type == LAYERTYPE_TILES) - s_LayerPopupContext.m_aLayers.push_back((CLayerTiles *)m_Map.m_lGroups[m_SelectedGroup]->m_lLayers[m_lSelectedLayers[j]]); + if(m_Map.m_vpGroups[m_SelectedGroup]->m_vpLayers[m_vSelectedLayers[j]]->m_Type == LAYERTYPE_TILES) + s_LayerPopupContext.m_vpLayers.push_back((CLayerTiles *)m_Map.m_vpGroups[m_SelectedGroup]->m_vpLayers[m_vSelectedLayers[j]]); else AllTile = false; } // Don't allow editing if all selected layers are tile layers if(!AllTile) - s_LayerPopupContext.m_aLayers.clear(); + s_LayerPopupContext.m_vpLayers.clear(); } else - s_LayerPopupContext.m_aLayers.clear(); + s_LayerPopupContext.m_vpLayers.clear(); UiInvokePopupMenu(&s_LayerPopupContext, 0, UI()->MouseX(), UI()->MouseY(), 120, 300, PopupLayer, &s_LayerPopupContext); } @@ -3495,25 +3495,25 @@ void CEditor::RenderLayers(CUIRect ToolBox, CUIRect View) { if(Input()->KeyIsPressed(KEY_LSHIFT) || Input()->KeyIsPressed(KEY_RSHIFT)) { - if(m_lSelectedLayers[m_lSelectedLayers.size() - 1] < (int)m_Map.m_lGroups[m_SelectedGroup]->m_lLayers.size() - 1) - AddSelectedLayer(m_lSelectedLayers[m_lSelectedLayers.size() - 1] + 1); + if(m_vSelectedLayers[m_vSelectedLayers.size() - 1] < (int)m_Map.m_vpGroups[m_SelectedGroup]->m_vpLayers.size() - 1) + AddSelectedLayer(m_vSelectedLayers[m_vSelectedLayers.size() - 1] + 1); } else { int CurrentLayer = 0; - for(const auto &Selected : m_lSelectedLayers) + for(const auto &Selected : m_vSelectedLayers) CurrentLayer = maximum(Selected, CurrentLayer); SelectLayer(CurrentLayer); - if(m_lSelectedLayers[0] < (int)m_Map.m_lGroups[m_SelectedGroup]->m_lLayers.size() - 1) + if(m_vSelectedLayers[0] < (int)m_Map.m_vpGroups[m_SelectedGroup]->m_vpLayers.size() - 1) { - SelectLayer(m_lSelectedLayers[0] + 1); + SelectLayer(m_vSelectedLayers[0] + 1); } else { - for(size_t Group = m_SelectedGroup + 1; Group < m_Map.m_lGroups.size(); Group++) + for(size_t Group = m_SelectedGroup + 1; Group < m_Map.m_vpGroups.size(); Group++) { - if(!m_Map.m_lGroups[Group]->m_lLayers.empty()) + if(!m_Map.m_vpGroups[Group]->m_vpLayers.empty()) { SelectLayer(0, Group); break; @@ -3526,27 +3526,27 @@ void CEditor::RenderLayers(CUIRect ToolBox, CUIRect View) { if(Input()->KeyIsPressed(KEY_LSHIFT) || Input()->KeyIsPressed(KEY_RSHIFT)) { - if(m_lSelectedLayers[m_lSelectedLayers.size() - 1] > 0) - AddSelectedLayer(m_lSelectedLayers[m_lSelectedLayers.size() - 1] - 1); + if(m_vSelectedLayers[m_vSelectedLayers.size() - 1] > 0) + AddSelectedLayer(m_vSelectedLayers[m_vSelectedLayers.size() - 1] - 1); } else { int CurrentLayer = std::numeric_limits::max(); - for(const auto &Selected : m_lSelectedLayers) + for(const auto &Selected : m_vSelectedLayers) CurrentLayer = minimum(Selected, CurrentLayer); SelectLayer(CurrentLayer); - if(m_lSelectedLayers[0] > 0) + if(m_vSelectedLayers[0] > 0) { - SelectLayer(m_lSelectedLayers[0] - 1); + SelectLayer(m_vSelectedLayers[0] - 1); } else { for(int Group = m_SelectedGroup - 1; Group >= 0; Group--) { - if(!m_Map.m_lGroups[Group]->m_lLayers.empty()) + if(!m_Map.m_vpGroups[Group]->m_vpLayers.empty()) { - SelectLayer(m_Map.m_lGroups[Group]->m_lLayers.size() - 1, Group); + SelectLayer(m_Map.m_vpGroups[Group]->m_vpLayers.size() - 1, Group); break; } } @@ -3562,7 +3562,7 @@ void CEditor::RenderLayers(CUIRect ToolBox, CUIRect View) if(DoButton_Editor(&s_NewGroupButton, "Add group", 0, &Slot, CUI::CORNER_R, "Adds a new group")) { m_Map.NewGroup(); - m_SelectedGroup = m_Map.m_lGroups.size() - 1; + m_SelectedGroup = m_Map.m_vpGroups.size() - 1; } } @@ -3585,19 +3585,19 @@ void CEditor::SelectLayerByTile(float &Scroll) if(s_CtrlClick) return; s_CtrlClick = true; - for(size_t g = 0; g < m_Map.m_lGroups.size(); g++) + for(size_t g = 0; g < m_Map.m_vpGroups.size(); g++) { - for(size_t l = 0; l < m_Map.m_lGroups[g]->m_lLayers.size(); l++) + for(size_t l = 0; l < m_Map.m_vpGroups[g]->m_vpLayers.size(); l++) { TotalLayers++; if(IsFound) continue; - if(m_Map.m_lGroups[g]->m_lLayers[l]->m_Type != LAYERTYPE_TILES) + if(m_Map.m_vpGroups[g]->m_vpLayers[l]->m_Type != LAYERTYPE_TILES) continue; - CLayerTiles *pTiles = (CLayerTiles *)m_Map.m_lGroups[g]->m_lLayers[l]; - int x = (int)UI()->MouseWorldX() / 32 + m_Map.m_lGroups[g]->m_OffsetX; - int y = (int)UI()->MouseWorldY() / 32 + m_Map.m_lGroups[g]->m_OffsetY; + CLayerTiles *pTiles = (CLayerTiles *)m_Map.m_vpGroups[g]->m_vpLayers[l]; + int x = (int)UI()->MouseWorldX() / 32 + m_Map.m_vpGroups[g]->m_OffsetX; + int y = (int)UI()->MouseWorldY() / 32 + m_Map.m_vpGroups[g]->m_OffsetY; if(x < 0 || x >= pTiles->m_Width) continue; if(y < 0 || y >= pTiles->m_Height) @@ -3641,7 +3641,7 @@ void CEditor::ReplaceImage(const char *pFileName, int StorageType, void *pUser) if(!pEditor->Graphics()->LoadPNG(&ImgInfo, pFileName, StorageType)) return; - CEditorImage *pImg = pEditor->m_Map.m_lImages[pEditor->m_SelectedImage]; + CEditorImage *pImg = pEditor->m_Map.m_vpImages[pEditor->m_SelectedImage]; pEditor->Graphics()->UnloadTexture(&(pImg->m_Texture)); free(pImg->m_pData); pImg->m_pData = 0; @@ -3665,9 +3665,9 @@ void CEditor::ReplaceImage(const char *pFileName, int StorageType, void *pUser) pImg->m_Texture = pEditor->Graphics()->LoadTextureRaw(ImgInfo.m_Width, ImgInfo.m_Height, ImgInfo.m_Format, ImgInfo.m_pData, CImageInfo::FORMAT_AUTO, TextureLoadFlag, pFileName); ImgInfo.m_pData = 0; pEditor->SortImages(); - for(size_t i = 0; i < pEditor->m_Map.m_lImages.size(); ++i) + for(size_t i = 0; i < pEditor->m_Map.m_vpImages.size(); ++i) { - if(!str_comp(pEditor->m_Map.m_lImages[i]->m_aName, pImg->m_aName)) + if(!str_comp(pEditor->m_Map.m_vpImages[i]->m_aName, pImg->m_aName)) pEditor->m_SelectedImage = i; } pEditor->m_Dialog = DIALOG_NONE; @@ -3683,13 +3683,13 @@ void CEditor::AddImage(const char *pFileName, int StorageType, void *pUser) // check if we have that image already char aBuf[128]; IStorage::StripPathAndExtension(pFileName, aBuf, sizeof(aBuf)); - for(const auto &pImage : pEditor->m_Map.m_lImages) + for(const auto &pImage : pEditor->m_Map.m_vpImages) { if(!str_comp(pImage->m_aName, aBuf)) return; } - if(pEditor->m_Map.m_lImages.size() >= 64) // hard limit for teeworlds + if(pEditor->m_Map.m_vpImages.size() >= 64) // hard limit for teeworlds { pEditor->m_PopupEventType = pEditor->POPEVENT_IMAGE_MAX; pEditor->m_PopupEventActivated = true; @@ -3716,12 +3716,12 @@ void CEditor::AddImage(const char *pFileName, int StorageType, void *pUser) ImgInfo.m_pData = 0; str_copy(pImg->m_aName, aBuf, sizeof(pImg->m_aName)); pImg->m_AutoMapper.Load(pImg->m_aName); - pEditor->m_Map.m_lImages.push_back(pImg); + pEditor->m_Map.m_vpImages.push_back(pImg); pEditor->SortImages(); - if(pEditor->m_SelectedImage >= 0 && (size_t)pEditor->m_SelectedImage < pEditor->m_Map.m_lImages.size()) + if(pEditor->m_SelectedImage >= 0 && (size_t)pEditor->m_SelectedImage < pEditor->m_Map.m_vpImages.size()) { for(int i = 0; i <= pEditor->m_SelectedImage; ++i) - if(!str_comp(pEditor->m_Map.m_lImages[i]->m_aName, aBuf)) + if(!str_comp(pEditor->m_Map.m_vpImages[i]->m_aName, aBuf)) { pEditor->m_SelectedImage++; break; @@ -3737,7 +3737,7 @@ void CEditor::AddSound(const char *pFileName, int StorageType, void *pUser) // check if we have that sound already char aBuf[128]; IStorage::StripPathAndExtension(pFileName, aBuf, sizeof(aBuf)); - for(const auto &pSound : pEditor->m_Map.m_lSounds) + for(const auto &pSound : pEditor->m_Map.m_vpSounds) { if(!str_comp(pSound->m_aName, aBuf)) return; @@ -3776,12 +3776,12 @@ void CEditor::AddSound(const char *pFileName, int StorageType, void *pUser) pSound->m_DataSize = (unsigned)DataSize; pSound->m_pData = pData; str_copy(pSound->m_aName, aBuf, sizeof(pSound->m_aName)); - pEditor->m_Map.m_lSounds.push_back(pSound); + pEditor->m_Map.m_vpSounds.push_back(pSound); - if(pEditor->m_SelectedSound >= 0 && (size_t)pEditor->m_SelectedSound < pEditor->m_Map.m_lSounds.size()) + if(pEditor->m_SelectedSound >= 0 && (size_t)pEditor->m_SelectedSound < pEditor->m_Map.m_vpSounds.size()) { for(int i = 0; i <= pEditor->m_SelectedSound; ++i) - if(!str_comp(pEditor->m_Map.m_lSounds[i]->m_aName, aBuf)) + if(!str_comp(pEditor->m_Map.m_vpSounds[i]->m_aName, aBuf)) { pEditor->m_SelectedSound++; break; @@ -3817,7 +3817,7 @@ void CEditor::ReplaceSound(const char *pFileName, int StorageType, void *pUser) io_read(SoundFile, pData, (unsigned)DataSize); io_close(SoundFile); - CEditorSound *pSound = pEditor->m_Map.m_lSounds[pEditor->m_SelectedSound]; + CEditorSound *pSound = pEditor->m_Map.m_vpSounds[pEditor->m_SelectedSound]; // unload sample pEditor->Sound()->UnloadSample(pSound->m_SoundID); @@ -3850,7 +3850,7 @@ int CEditor::PopupImage(CEditor *pEditor, CUIRect View, void *pContext) CUIRect Slot; View.HSplitTop(2.0f, &Slot, &View); View.HSplitTop(12.0f, &Slot, &View); - CEditorImage *pImg = pEditor->m_Map.m_lImages[pEditor->m_SelectedImage]; + CEditorImage *pImg = pEditor->m_Map.m_vpImages[pEditor->m_SelectedImage]; static int s_ExternalButton = 0; if(pImg->m_External) @@ -3885,7 +3885,7 @@ int CEditor::PopupImage(CEditor *pEditor, CUIRect View, void *pContext) if(pEditor->DoButton_MenuItem(&s_RemoveButton, "Remove", 0, &Slot, 0, "Removes the image from the map")) { delete pImg; - pEditor->m_Map.m_lImages.erase(pEditor->m_Map.m_lImages.begin() + pEditor->m_SelectedImage); + pEditor->m_Map.m_vpImages.erase(pEditor->m_Map.m_vpImages.begin() + pEditor->m_SelectedImage); gs_ModifyIndexDeletedIndex = pEditor->m_SelectedImage; pEditor->m_Map.ModifyImageIndex(ModifyIndexDeleted); return 1; @@ -3910,11 +3910,11 @@ int CEditor::PopupSound(CEditor *pEditor, CUIRect View, void *pContext) View.HSplitTop(5.0f, &Slot, &View); View.HSplitTop(12.0f, &Slot, &View); - CEditorSound *pSound = pEditor->m_Map.m_lSounds[pEditor->m_SelectedSound]; + CEditorSound *pSound = pEditor->m_Map.m_vpSounds[pEditor->m_SelectedSound]; if(pEditor->DoButton_MenuItem(&s_RemoveButton, "Remove", 0, &Slot, 0, "Removes the sound from the map")) { delete pSound; - pEditor->m_Map.m_lSounds.erase(pEditor->m_Map.m_lSounds.begin() + pEditor->m_SelectedSound); + pEditor->m_Map.m_vpSounds.erase(pEditor->m_Map.m_vpSounds.begin() + pEditor->m_SelectedSound); gs_ModifyIndexDeletedIndex = pEditor->m_SelectedSound; pEditor->m_Map.ModifySoundIndex(ModifyIndexDeleted); return 1; @@ -3925,11 +3925,11 @@ int CEditor::PopupSound(CEditor *pEditor, CUIRect View, void *pContext) void CEditor::SelectGameLayer() { - for(size_t g = 0; g < m_Map.m_lGroups.size(); g++) + for(size_t g = 0; g < m_Map.m_vpGroups.size(); g++) { - for(size_t i = 0; i < m_Map.m_lGroups[g]->m_lLayers.size(); i++) + for(size_t i = 0; i < m_Map.m_vpGroups[g]->m_vpLayers.size(); i++) { - if(m_Map.m_lGroups[g]->m_lLayers[i] == m_Map.m_pGameLayer) + if(m_Map.m_vpGroups[g]->m_vpLayers[i] == m_Map.m_pGameLayer) { SelectLayer(i, g); return; @@ -3952,17 +3952,17 @@ static void ModifySortedIndex(int *pIndex) void CEditor::SortImages() { - if(!std::is_sorted(m_Map.m_lImages.begin(), m_Map.m_lImages.end(), ImageNameLess)) + if(!std::is_sorted(m_Map.m_vpImages.begin(), m_Map.m_vpImages.end(), ImageNameLess)) { - std::vector lTemp = m_Map.m_lImages; - gs_pSortedIndex = new int[lTemp.size()]; + std::vector vpTemp = m_Map.m_vpImages; + gs_pSortedIndex = new int[vpTemp.size()]; - std::sort(m_Map.m_lImages.begin(), m_Map.m_lImages.end(), ImageNameLess); - for(size_t OldIndex = 0; OldIndex < lTemp.size(); OldIndex++) + std::sort(m_Map.m_vpImages.begin(), m_Map.m_vpImages.end(), ImageNameLess); + for(size_t OldIndex = 0; OldIndex < vpTemp.size(); OldIndex++) { - for(size_t NewIndex = 0; NewIndex < m_Map.m_lImages.size(); NewIndex++) + for(size_t NewIndex = 0; NewIndex < m_Map.m_vpImages.size(); NewIndex++) { - if(lTemp[OldIndex] == m_Map.m_lImages[NewIndex]) + if(vpTemp[OldIndex] == m_Map.m_vpImages[NewIndex]) { gs_pSortedIndex[OldIndex] = NewIndex; break; @@ -3982,7 +3982,7 @@ void CEditor::RenderImages(CUIRect ToolBox, CUIRect View) return; static float s_ScrollValue = 0; - float ImagesHeight = 30.0f + 14.0f * m_Map.m_lImages.size() + 27.0f; + float ImagesHeight = 30.0f + 14.0f * m_Map.m_vpImages.size() + 27.0f; float ScrollDifference = ImagesHeight - ToolBox.h; if(ImagesHeight > ToolBox.h) // Do we even need a scrollbar? @@ -4027,10 +4027,10 @@ void CEditor::RenderImages(CUIRect ToolBox, CUIRect View) } ImageCur += 15.0f; - for(int i = 0; i < (int)m_Map.m_lImages.size(); i++) + for(int i = 0; i < (int)m_Map.m_vpImages.size(); i++) { - if((e && !m_Map.m_lImages[i]->m_External) || - (!e && m_Map.m_lImages[i]->m_External)) + if((e && !m_Map.m_vpImages[i]->m_External) || + (!e && m_Map.m_vpImages[i]->m_External)) { continue; } @@ -4045,13 +4045,13 @@ void CEditor::RenderImages(CUIRect ToolBox, CUIRect View) ImageCur += 14.0f; char aBuf[128]; - str_copy(aBuf, m_Map.m_lImages[i]->m_aName, sizeof(aBuf)); + str_copy(aBuf, m_Map.m_vpImages[i]->m_aName, sizeof(aBuf)); ToolBox.HSplitTop(12.0f, &Slot, &ToolBox); int Selected = m_SelectedImage == i; - const bool ImageUsed = std::any_of(m_Map.m_lGroups.cbegin(), m_Map.m_lGroups.cend(), [i](const auto &pGroup) { - return std::any_of(pGroup->m_lLayers.cbegin(), pGroup->m_lLayers.cend(), [i](const auto &pLayer) { + const bool ImageUsed = std::any_of(m_Map.m_vpGroups.cbegin(), m_Map.m_vpGroups.cend(), [i](const auto &pGroup) { + return std::any_of(pGroup->m_vpLayers.cbegin(), pGroup->m_vpLayers.cend(), [i](const auto &pLayer) { if(pLayer->m_Type == LAYERTYPE_QUADS) return static_cast(pLayer)->m_Image == i; else if(pLayer->m_Type == LAYERTYPE_TILES) @@ -4065,7 +4065,7 @@ void CEditor::RenderImages(CUIRect ToolBox, CUIRect View) if(Selected < 2 && e == 1) { - if(!IsVanillaImage(m_Map.m_lImages[i]->m_aName)) + if(!IsVanillaImage(m_Map.m_vpImages[i]->m_aName)) { Selected += 4; // Image should be embedded } @@ -4075,7 +4075,7 @@ void CEditor::RenderImages(CUIRect ToolBox, CUIRect View) while(TextRender()->TextWidth(0, FontSize, aBuf, -1, -1.0f) > Slot.w) FontSize--; - if(int Result = DoButton_Ex(&m_Map.m_lImages[i], aBuf, Selected, &Slot, + if(int Result = DoButton_Ex(&m_Map.m_vpImages[i], aBuf, Selected, &Slot, BUTTON_CONTEXT, "Select image.", 0, FontSize)) { m_SelectedImage = i; @@ -4083,7 +4083,7 @@ void CEditor::RenderImages(CUIRect ToolBox, CUIRect View) static int s_PopupImageID = 0; if(Result == 2) { - CEditorImage *pImg = m_Map.m_lImages[m_SelectedImage]; + CEditorImage *pImg = m_Map.m_vpImages[m_SelectedImage]; int Height; if(pImg->m_External || IsVanillaImage(pImg->m_aName)) Height = 60; @@ -4109,20 +4109,20 @@ void CEditor::RenderImages(CUIRect ToolBox, CUIRect View) if(Input()->KeyPress(KEY_DOWN) && m_Dialog == DIALOG_NONE) { int OldImage = m_SelectedImage; - m_SelectedImage = clamp(m_SelectedImage, 0, (int)m_Map.m_lImages.size() - 1); - for(size_t i = m_SelectedImage + 1; i < m_Map.m_lImages.size(); i++) + m_SelectedImage = clamp(m_SelectedImage, 0, (int)m_Map.m_vpImages.size() - 1); + for(size_t i = m_SelectedImage + 1; i < m_Map.m_vpImages.size(); i++) { - if(m_Map.m_lImages[i]->m_External == m_Map.m_lImages[m_SelectedImage]->m_External) + if(m_Map.m_vpImages[i]->m_External == m_Map.m_vpImages[m_SelectedImage]->m_External) { m_SelectedImage = i; break; } } - if(m_SelectedImage == OldImage && !m_Map.m_lImages[m_SelectedImage]->m_External) + if(m_SelectedImage == OldImage && !m_Map.m_vpImages[m_SelectedImage]->m_External) { - for(size_t i = 0; i < m_Map.m_lImages.size(); i++) + for(size_t i = 0; i < m_Map.m_vpImages.size(); i++) { - if(m_Map.m_lImages[i]->m_External) + if(m_Map.m_vpImages[i]->m_External) { m_SelectedImage = i; break; @@ -4133,20 +4133,20 @@ void CEditor::RenderImages(CUIRect ToolBox, CUIRect View) if(Input()->KeyPress(KEY_UP) && m_Dialog == DIALOG_NONE) { int OldImage = m_SelectedImage; - m_SelectedImage = clamp(m_SelectedImage, 0, (int)m_Map.m_lImages.size() - 1); + m_SelectedImage = clamp(m_SelectedImage, 0, (int)m_Map.m_vpImages.size() - 1); for(int i = m_SelectedImage - 1; i >= 0; i--) { - if(m_Map.m_lImages[i]->m_External == m_Map.m_lImages[m_SelectedImage]->m_External) + if(m_Map.m_vpImages[i]->m_External == m_Map.m_vpImages[m_SelectedImage]->m_External) { m_SelectedImage = i; break; } } - if(m_SelectedImage == OldImage && m_Map.m_lImages[m_SelectedImage]->m_External) + if(m_SelectedImage == OldImage && m_Map.m_vpImages[m_SelectedImage]->m_External) { - for(int i = (int)m_Map.m_lImages.size() - 1; i >= 0; i--) + for(int i = (int)m_Map.m_vpImages.size() - 1; i >= 0; i--) { - if(!m_Map.m_lImages[i]->m_External) + if(!m_Map.m_vpImages[i]->m_External) { m_SelectedImage = i; break; @@ -4157,7 +4157,7 @@ void CEditor::RenderImages(CUIRect ToolBox, CUIRect View) // render image int i = m_SelectedImage; - if(i >= 0 && (size_t)i < m_Map.m_lImages.size()) + if(i >= 0 && (size_t)i < m_Map.m_vpImages.size()) { CUIRect r; View.Margin(10.0f, &r); @@ -4165,10 +4165,10 @@ void CEditor::RenderImages(CUIRect ToolBox, CUIRect View) r.w = r.h; else r.h = r.w; - float Max = (float)(maximum(m_Map.m_lImages[i]->m_Width, m_Map.m_lImages[i]->m_Height)); - r.w *= m_Map.m_lImages[i]->m_Width / Max; - r.h *= m_Map.m_lImages[i]->m_Height / Max; - Graphics()->TextureSet(m_Map.m_lImages[i]->m_Texture); + float Max = (float)(maximum(m_Map.m_vpImages[i]->m_Width, m_Map.m_vpImages[i]->m_Height)); + r.w *= m_Map.m_vpImages[i]->m_Width / Max; + r.h *= m_Map.m_vpImages[i]->m_Height / Max; + Graphics()->TextureSet(m_Map.m_vpImages[i]->m_Texture); Graphics()->BlendNormal(); Graphics()->WrapClamp(); Graphics()->QuadsBegin(); @@ -4196,7 +4196,7 @@ void CEditor::RenderSounds(CUIRect ToolBox, CUIRect View) return; static float s_ScrollValue = 0; - float SoundsHeight = 30.0f + 14.0f * m_Map.m_lSounds.size() + 27.0f; + float SoundsHeight = 30.0f + 14.0f * m_Map.m_vpSounds.size() + 27.0f; float ScrollDifference = SoundsHeight - ToolBox.h; if(SoundsHeight > ToolBox.h) // Do we even need a scrollbar? @@ -4231,7 +4231,7 @@ void CEditor::RenderSounds(CUIRect ToolBox, CUIRect View) UI()->DoLabel(&Slot, "Embedded", 12.0f, TEXTALIGN_CENTER); SoundCur += 15.0f; - for(int i = 0; i < (int)m_Map.m_lSounds.size(); i++) + for(int i = 0; i < (int)m_Map.m_vpSounds.size(); i++) { if(SoundCur > SoundStopAt) break; @@ -4243,12 +4243,12 @@ void CEditor::RenderSounds(CUIRect ToolBox, CUIRect View) SoundCur += 14.0f; char aBuf[128]; - str_copy(aBuf, m_Map.m_lSounds[i]->m_aName, sizeof(aBuf)); + str_copy(aBuf, m_Map.m_vpSounds[i]->m_aName, sizeof(aBuf)); ToolBox.HSplitTop(12.0f, &Slot, &ToolBox); int Selected = m_SelectedSound == i; - const bool SoundUsed = std::any_of(m_Map.m_lGroups.cbegin(), m_Map.m_lGroups.cend(), [i](const auto &pGroup) { - return std::any_of(pGroup->m_lLayers.cbegin(), pGroup->m_lLayers.cend(), [i](const auto &pLayer) { + const bool SoundUsed = std::any_of(m_Map.m_vpGroups.cbegin(), m_Map.m_vpGroups.cend(), [i](const auto &pGroup) { + return std::any_of(pGroup->m_vpLayers.cbegin(), pGroup->m_vpLayers.cend(), [i](const auto &pLayer) { if(pLayer->m_Type == LAYERTYPE_SOUNDS) return static_cast(pLayer)->m_Sound == i; return false; @@ -4262,7 +4262,7 @@ void CEditor::RenderSounds(CUIRect ToolBox, CUIRect View) while(TextRender()->TextWidth(0, FontSize, aBuf, -1, -1.0f) > Slot.w) FontSize--; - if(int Result = DoButton_Ex(&m_Map.m_lSounds[i], aBuf, Selected, &Slot, + if(int Result = DoButton_Ex(&m_Map.m_vpSounds[i], aBuf, Selected, &Slot, BUTTON_CONTEXT, "Select sound.", 0, FontSize)) { m_SelectedSound = i; @@ -4285,17 +4285,17 @@ void CEditor::RenderSounds(CUIRect ToolBox, CUIRect View) if(Input()->KeyPress(KEY_DOWN) && m_Dialog == DIALOG_NONE) { - m_SelectedSound = clamp(m_SelectedSound, 0, (int)m_Map.m_lSounds.size() - 1); - if(m_SelectedSound == (int)m_Map.m_lSounds.size() - 1) + m_SelectedSound = clamp(m_SelectedSound, 0, (int)m_Map.m_vpSounds.size() - 1); + if(m_SelectedSound == (int)m_Map.m_vpSounds.size() - 1) m_SelectedSound = 0; else m_SelectedSound += 1; } if(Input()->KeyPress(KEY_UP) && m_Dialog == DIALOG_NONE) { - m_SelectedSound = clamp(m_SelectedSound, 0, (int)m_Map.m_lSounds.size() - 1); - if(m_SelectedSound == 0 && !m_Map.m_lSounds.empty()) - m_SelectedSound = m_Map.m_lSounds.size() - 1; + m_SelectedSound = clamp(m_SelectedSound, 0, (int)m_Map.m_vpSounds.size() - 1); + if(m_SelectedSound == 0 && !m_Map.m_vpSounds.empty()) + m_SelectedSound = m_Map.m_vpSounds.size() - 1; else m_SelectedSound -= 1; } @@ -4332,7 +4332,7 @@ static int EditorListdirCallback(const char *pName, int IsDir, int StorageType, Item.m_IsDir = IsDir != 0; Item.m_IsLink = false; Item.m_StorageType = StorageType; - pEditor->m_FileList.push_back(Item); + pEditor->m_vFileList.push_back(Item); return 0; } @@ -4351,15 +4351,15 @@ void CEditor::AddFileDialogEntry(int Index, CUIRect *pView) Graphics()->TextureSet(g_pData->m_aImages[IMAGE_FILEICONS].m_Id); Graphics()->QuadsBegin(); - RenderTools()->SelectSprite(m_FileList[Index].m_IsDir ? SPRITE_FILE_FOLDER : SPRITE_FILE_MAP2); + RenderTools()->SelectSprite(m_vFileList[Index].m_IsDir ? SPRITE_FILE_FOLDER : SPRITE_FILE_MAP2); IGraphics::CQuadItem QuadItem(FileIcon.x, FileIcon.y, FileIcon.w, FileIcon.h); Graphics()->QuadsDrawTL(&QuadItem, 1); Graphics()->QuadsEnd(); - if(DoButton_File(&m_FileList[Index], m_FileList[Index].m_aName, m_FilesSelectedIndex == Index, &Button, 0, 0)) + if(DoButton_File(&m_vFileList[Index], m_vFileList[Index].m_aName, m_FilesSelectedIndex == Index, &Button, 0, 0)) { - if(!m_FileList[Index].m_IsDir) - str_copy(m_aFileDialogFileName, m_FileList[Index].m_aFilename, sizeof(m_aFileDialogFileName)); + if(!m_vFileList[Index].m_IsDir) + str_copy(m_aFileDialogFileName, m_vFileList[Index].m_aFilename, sizeof(m_aFileDialogFileName)); else m_aFileDialogFileName[0] = 0; m_PreviewImageIsLoaded = false; @@ -4404,7 +4404,7 @@ void CEditor::RenderFileDialog() // pathbox char aPath[128], aBuf[128]; if(m_FilesSelectedIndex != -1) - Storage()->GetCompletePath(m_FileList[m_FilesSelectedIndex].m_StorageType, m_pFileDialogPath, aPath, sizeof(aPath)); + Storage()->GetCompletePath(m_vFileList[m_FilesSelectedIndex].m_StorageType, m_pFileDialogPath, aPath, sizeof(aPath)); else aPath[0] = 0; str_format(aBuf, sizeof(aBuf), "Current path: %s", aPath); @@ -4463,13 +4463,13 @@ void CEditor::RenderFileDialog() m_FileDialogScrollValue = UIEx()->DoScrollbarV(&m_FileDialogScrollValue, &Scroll, m_FileDialogScrollValue); int ScrollNum = 0; - for(size_t i = 0; i < m_FileList.size(); i++) + for(size_t i = 0; i < m_vFileList.size(); i++) { - m_FileList[i].m_IsVisible = false; - if(!m_aFileDialogSearchText[0] || str_utf8_find_nocase(m_FileList[i].m_aName, m_aFileDialogSearchText)) + m_vFileList[i].m_IsVisible = false; + if(!m_aFileDialogSearchText[0] || str_utf8_find_nocase(m_vFileList[i].m_aName, m_aFileDialogSearchText)) { AddFileDialogEntry(i, &View); - m_FileList[i].m_IsVisible = true; + m_vFileList[i].m_IsVisible = true; ScrollNum++; } } @@ -4487,7 +4487,7 @@ void CEditor::RenderFileDialog() if(m_FilesSelectedIndex > -1) { - if(!m_FileList[m_FilesSelectedIndex].m_IsVisible) + if(!m_vFileList[m_FilesSelectedIndex].m_IsVisible) { m_FilesSelectedIndex = 0; } @@ -4499,9 +4499,9 @@ void CEditor::RenderFileDialog() { if(Input()->GetEvent(i).m_Key == KEY_DOWN) { - for(NewIndex = m_FilesSelectedIndex + 1; NewIndex < (int)m_FileList.size(); NewIndex++) + for(NewIndex = m_FilesSelectedIndex + 1; NewIndex < (int)m_vFileList.size(); NewIndex++) { - if(m_FileList[NewIndex].m_IsVisible) + if(m_vFileList[NewIndex].m_IsVisible) break; } } @@ -4509,12 +4509,12 @@ void CEditor::RenderFileDialog() { for(NewIndex = m_FilesSelectedIndex - 1; NewIndex >= 0; NewIndex--) { - if(m_FileList[NewIndex].m_IsVisible) + if(m_vFileList[NewIndex].m_IsVisible) break; } } } - if(NewIndex > -1 && NewIndex < (int)m_FileList.size()) + if(NewIndex > -1 && NewIndex < (int)m_vFileList.size()) { //scroll float IndexY = View.y - m_FileDialogScrollValue * ScrollNum * 17.0f + NewIndex * 17.0f; @@ -4527,8 +4527,8 @@ void CEditor::RenderFileDialog() m_FileDialogScrollValue = ((float)(NewIndex - Num) + 2.5f) / ScrollNum; } - if(!m_FileList[NewIndex].m_IsDir) - str_copy(m_aFileDialogFileName, m_FileList[NewIndex].m_aFilename, sizeof(m_aFileDialogFileName)); + if(!m_vFileList[NewIndex].m_IsDir) + str_copy(m_aFileDialogFileName, m_vFileList[NewIndex].m_aFilename, sizeof(m_aFileDialogFileName)); else m_aFileDialogFileName[0] = 0; m_FilesSelectedIndex = NewIndex; @@ -4538,10 +4538,10 @@ void CEditor::RenderFileDialog() if(m_FileDialogFileType == CEditor::FILETYPE_IMG && !m_PreviewImageIsLoaded && m_FilesSelectedIndex > -1) { - if(str_endswith(m_FileList[m_FilesSelectedIndex].m_aFilename, ".png")) + if(str_endswith(m_vFileList[m_FilesSelectedIndex].m_aFilename, ".png")) { char aBuffer[1024]; - str_format(aBuffer, sizeof(aBuffer), "%s/%s", m_pFileDialogPath, m_FileList[m_FilesSelectedIndex].m_aFilename); + str_format(aBuffer, sizeof(aBuffer), "%s/%s", m_pFileDialogPath, m_vFileList[m_FilesSelectedIndex].m_aFilename); if(Graphics()->LoadPNG(&m_FilePreviewImageInfo, aBuffer, IStorage::TYPE_ALL)) { @@ -4613,35 +4613,35 @@ void CEditor::RenderFileDialog() CUIRect Button; ButtonBar.VSplitRight(50.0f, &ButtonBar, &Button); - bool IsDir = m_FilesSelectedIndex >= 0 && m_FileList[m_FilesSelectedIndex].m_IsDir; + bool IsDir = m_FilesSelectedIndex >= 0 && m_vFileList[m_FilesSelectedIndex].m_IsDir; if(DoButton_Editor(&s_OkButton, IsDir ? "Open" : m_pFileDialogButtonText, 0, &Button, 0, 0) || m_FileDialogActivate) { m_FileDialogActivate = false; if(IsDir) // folder { - if(str_comp(m_FileList[m_FilesSelectedIndex].m_aFilename, "..") == 0) // parent folder + if(str_comp(m_vFileList[m_FilesSelectedIndex].m_aFilename, "..") == 0) // parent folder { if(fs_parent_dir(m_pFileDialogPath)) m_pFileDialogPath = m_aFileDialogCurrentFolder; // leave the link } else // sub folder { - if(m_FileList[m_FilesSelectedIndex].m_IsLink) + if(m_vFileList[m_FilesSelectedIndex].m_IsLink) { m_pFileDialogPath = m_aFileDialogCurrentLink; // follow the link - str_copy(m_aFileDialogCurrentLink, m_FileList[m_FilesSelectedIndex].m_aFilename, sizeof(m_aFileDialogCurrentLink)); + str_copy(m_aFileDialogCurrentLink, m_vFileList[m_FilesSelectedIndex].m_aFilename, sizeof(m_aFileDialogCurrentLink)); } else { char aTemp[IO_MAX_PATH_LENGTH]; str_copy(aTemp, m_pFileDialogPath, sizeof(aTemp)); - str_format(m_pFileDialogPath, IO_MAX_PATH_LENGTH, "%s/%s", aTemp, m_FileList[m_FilesSelectedIndex].m_aFilename); + str_format(m_pFileDialogPath, IO_MAX_PATH_LENGTH, "%s/%s", aTemp, m_vFileList[m_FilesSelectedIndex].m_aFilename); } } FilelistPopulate(!str_comp(m_pFileDialogPath, "maps") || !str_comp(m_pFileDialogPath, "mapres") ? m_FileDialogStorageType : - m_FileList[m_FilesSelectedIndex].m_StorageType); - if(m_FilesSelectedIndex >= 0 && !m_FileList[m_FilesSelectedIndex].m_IsDir) - str_copy(m_aFileDialogFileName, m_FileList[m_FilesSelectedIndex].m_aFilename, sizeof(m_aFileDialogFileName)); + m_vFileList[m_FilesSelectedIndex].m_StorageType); + if(m_FilesSelectedIndex >= 0 && !m_vFileList[m_FilesSelectedIndex].m_IsDir) + str_copy(m_aFileDialogFileName, m_vFileList[m_FilesSelectedIndex].m_aFilename, sizeof(m_aFileDialogFileName)); else m_aFileDialogFileName[0] = 0; } @@ -4658,10 +4658,10 @@ void CEditor::RenderFileDialog() m_PopupEventActivated = true; } else if(m_pfnFileDialogFunc) - m_pfnFileDialogFunc(m_aFileSaveName, m_FilesSelectedIndex >= 0 ? m_FileList[m_FilesSelectedIndex].m_StorageType : m_FileDialogStorageType, m_pFileDialogUser); + m_pfnFileDialogFunc(m_aFileSaveName, m_FilesSelectedIndex >= 0 ? m_vFileList[m_FilesSelectedIndex].m_StorageType : m_FileDialogStorageType, m_pFileDialogUser); } else if(m_pfnFileDialogFunc) - m_pfnFileDialogFunc(m_aFileSaveName, m_FilesSelectedIndex >= 0 ? m_FileList[m_FilesSelectedIndex].m_StorageType : m_FileDialogStorageType, m_pFileDialogUser); + m_pfnFileDialogFunc(m_aFileSaveName, m_FilesSelectedIndex >= 0 ? m_vFileList[m_FilesSelectedIndex].m_StorageType : m_FileDialogStorageType, m_pFileDialogUser); } } @@ -4702,7 +4702,7 @@ void CEditor::RenderFileDialog() void CEditor::FilelistPopulate(int StorageType) { - m_FileList.clear(); + m_vFileList.clear(); if(m_FileDialogStorageType != IStorage::TYPE_SAVE && !str_comp(m_pFileDialogPath, "maps")) { CFilelistItem Item; @@ -4711,16 +4711,16 @@ void CEditor::FilelistPopulate(int StorageType) Item.m_IsDir = true; Item.m_IsLink = true; Item.m_StorageType = IStorage::TYPE_SAVE; - m_FileList.push_back(Item); + m_vFileList.push_back(Item); } Storage()->ListDirectory(StorageType, m_pFileDialogPath, EditorListdirCallback, this); - std::sort(m_FileList.begin(), m_FileList.end()); - m_FilesSelectedIndex = m_FileList.empty() ? -1 : 0; + std::sort(m_vFileList.begin(), m_vFileList.end()); + m_FilesSelectedIndex = m_vFileList.empty() ? -1 : 0; m_PreviewImageIsLoaded = false; m_FileDialogActivate = false; - if(m_FilesSelectedIndex >= 0 && !m_FileList[m_FilesSelectedIndex].m_IsDir) - str_copy(m_aFileDialogFileName, m_FileList[m_FilesSelectedIndex].m_aFilename, sizeof(m_aFileDialogFileName)); + if(m_FilesSelectedIndex >= 0 && !m_vFileList[m_FilesSelectedIndex].m_IsDir) + str_copy(m_aFileDialogFileName, m_vFileList[m_FilesSelectedIndex].m_aFilename, sizeof(m_aFileDialogFileName)); else m_aFileDialogFileName[0] = 0; } @@ -4839,14 +4839,14 @@ void CEditor::RenderStatusbar(CUIRect View) bool CEditor::IsEnvelopeUsed(int EnvelopeIndex) const { - for(const auto &pGroup : m_Map.m_lGroups) + for(const auto &pGroup : m_Map.m_vpGroups) { - for(const auto &pLayer : pGroup->m_lLayers) + for(const auto &pLayer : pGroup->m_vpLayers) { if(pLayer->m_Type == LAYERTYPE_QUADS) { CLayerQuads *pLayerQuads = (CLayerQuads *)pLayer; - for(const auto &Quad : pLayerQuads->m_lQuads) + for(const auto &Quad : pLayerQuads->m_vQuads) { if(Quad.m_PosEnv == EnvelopeIndex || Quad.m_ColorEnv == EnvelopeIndex) { @@ -4857,7 +4857,7 @@ bool CEditor::IsEnvelopeUsed(int EnvelopeIndex) const else if(pLayer->m_Type == LAYERTYPE_SOUNDS) { CLayerSounds *pLayerSounds = (CLayerSounds *)pLayer; - for(const auto &Source : pLayerSounds->m_lSources) + for(const auto &Source : pLayerSounds->m_vSources) { if(Source.m_PosEnv == EnvelopeIndex || Source.m_SoundEnv == EnvelopeIndex) { @@ -4880,12 +4880,12 @@ void CEditor::RenderEnvelopeEditor(CUIRect View) { if(m_SelectedEnvelope < 0) m_SelectedEnvelope = 0; - if(m_SelectedEnvelope >= (int)m_Map.m_lEnvelopes.size()) - m_SelectedEnvelope = m_Map.m_lEnvelopes.size() - 1; + if(m_SelectedEnvelope >= (int)m_Map.m_vpEnvelopes.size()) + m_SelectedEnvelope = m_Map.m_vpEnvelopes.size() - 1; CEnvelope *pEnvelope = 0; - if(m_SelectedEnvelope >= 0 && m_SelectedEnvelope < (int)m_Map.m_lEnvelopes.size()) - pEnvelope = m_Map.m_lEnvelopes[m_SelectedEnvelope]; + if(m_SelectedEnvelope >= 0 && m_SelectedEnvelope < (int)m_Map.m_vpEnvelopes.size()) + pEnvelope = m_Map.m_vpEnvelopes[m_SelectedEnvelope]; CUIRect ToolBar, CurveBar, ColorBar; View.HSplitTop(15.0f, &ToolBar, &View); @@ -4936,9 +4936,9 @@ void CEditor::RenderEnvelopeEditor(CUIRect View) { m_Map.m_Modified = true; m_Map.DeleteEnvelope(m_SelectedEnvelope); - if(m_SelectedEnvelope >= (int)m_Map.m_lEnvelopes.size()) - m_SelectedEnvelope = m_Map.m_lEnvelopes.size() - 1; - pEnvelope = m_SelectedEnvelope >= 0 ? m_Map.m_lEnvelopes[m_SelectedEnvelope] : 0; + if(m_SelectedEnvelope >= (int)m_Map.m_vpEnvelopes.size()) + m_SelectedEnvelope = m_Map.m_vpEnvelopes.size() - 1; + pEnvelope = m_SelectedEnvelope >= 0 ? m_Map.m_vpEnvelopes[m_SelectedEnvelope] : 0; } } @@ -4961,10 +4961,10 @@ void CEditor::RenderEnvelopeEditor(CUIRect View) Shifter.VSplitRight(15.0f, &Shifter, &Inc); Shifter.VSplitLeft(15.0f, &Dec, &Shifter); char aBuf[512]; - str_format(aBuf, sizeof(aBuf), "%d/%d", m_SelectedEnvelope + 1, (int)m_Map.m_lEnvelopes.size()); + str_format(aBuf, sizeof(aBuf), "%d/%d", m_SelectedEnvelope + 1, (int)m_Map.m_vpEnvelopes.size()); ColorRGBA EnvColor = ColorRGBA(1, 1, 1, 0.5f); - if(!m_Map.m_lEnvelopes.empty()) + if(!m_Map.m_vpEnvelopes.empty()) { EnvColor = IsEnvelopeUsed(m_SelectedEnvelope) ? ColorRGBA(1, 0.7f, 0.7f, 0.5f) : @@ -4979,7 +4979,7 @@ void CEditor::RenderEnvelopeEditor(CUIRect View) { m_SelectedEnvelope--; if(m_SelectedEnvelope < 0) - m_SelectedEnvelope = m_Map.m_lEnvelopes.size() - 1; + m_SelectedEnvelope = m_Map.m_vpEnvelopes.size() - 1; CurrentEnvelopeSwitched = true; } @@ -4987,7 +4987,7 @@ void CEditor::RenderEnvelopeEditor(CUIRect View) if(DoButton_ButtonInc(&s_NextButton, 0, 0, &Inc, 0, "Next Envelope")) { m_SelectedEnvelope++; - if(m_SelectedEnvelope >= (int)m_Map.m_lEnvelopes.size()) + if(m_SelectedEnvelope >= (int)m_Map.m_vpEnvelopes.size()) m_SelectedEnvelope = 0; CurrentEnvelopeSwitched = true; } @@ -5149,10 +5149,10 @@ void CEditor::RenderEnvelopeEditor(CUIRect View) // render curve options { - for(int i = 0; i < (int)pEnvelope->m_lPoints.size() - 1; i++) + for(int i = 0; i < (int)pEnvelope->m_vPoints.size() - 1; i++) { - float t0 = pEnvelope->m_lPoints[i].m_Time / 1000.0f / EndTime; - float t1 = pEnvelope->m_lPoints[i + 1].m_Time / 1000.0f / EndTime; + float t0 = pEnvelope->m_vPoints[i].m_Time / 1000.0f / EndTime; + float t1 = pEnvelope->m_vPoints[i + 1].m_Time / 1000.0f / EndTime; //dbg_msg("", "%f", end_time); @@ -5162,14 +5162,14 @@ void CEditor::RenderEnvelopeEditor(CUIRect View) v.h = CurveBar.h; v.w = CurveBar.h; v.x -= v.w / 2; - void *pID = &pEnvelope->m_lPoints[i].m_Curvetype; + void *pID = &pEnvelope->m_vPoints[i].m_Curvetype; const char *paTypeName[] = { "N", "L", "S", "F", "M"}; const char *pTypeName = "Invalid"; - if(0 <= pEnvelope->m_lPoints[i].m_Curvetype && pEnvelope->m_lPoints[i].m_Curvetype < (int)std::size(paTypeName)) - pTypeName = paTypeName[pEnvelope->m_lPoints[i].m_Curvetype]; + if(0 <= pEnvelope->m_vPoints[i].m_Curvetype && pEnvelope->m_vPoints[i].m_Curvetype < (int)std::size(paTypeName)) + pTypeName = paTypeName[pEnvelope->m_vPoints[i].m_Curvetype]; if(DoButton_Editor(pID, pTypeName, 0, &v, 0, "Switch curve type")) - pEnvelope->m_lPoints[i].m_Curvetype = (pEnvelope->m_lPoints[i].m_Curvetype + 1) % NUM_CURVETYPES; + pEnvelope->m_vPoints[i].m_Curvetype = (pEnvelope->m_vPoints[i].m_Curvetype + 1) % NUM_CURVETYPES; } } @@ -5178,16 +5178,16 @@ void CEditor::RenderEnvelopeEditor(CUIRect View) { Graphics()->TextureClear(); Graphics()->QuadsBegin(); - for(int i = 0; i < (int)pEnvelope->m_lPoints.size() - 1; i++) + for(int i = 0; i < (int)pEnvelope->m_vPoints.size() - 1; i++) { - float r0 = fx2f(pEnvelope->m_lPoints[i].m_aValues[0]); - float g0 = fx2f(pEnvelope->m_lPoints[i].m_aValues[1]); - float b0 = fx2f(pEnvelope->m_lPoints[i].m_aValues[2]); - float a0 = fx2f(pEnvelope->m_lPoints[i].m_aValues[3]); - float r1 = fx2f(pEnvelope->m_lPoints[i + 1].m_aValues[0]); - float g1 = fx2f(pEnvelope->m_lPoints[i + 1].m_aValues[1]); - float b1 = fx2f(pEnvelope->m_lPoints[i + 1].m_aValues[2]); - float a1 = fx2f(pEnvelope->m_lPoints[i + 1].m_aValues[3]); + float r0 = fx2f(pEnvelope->m_vPoints[i].m_aValues[0]); + float g0 = fx2f(pEnvelope->m_vPoints[i].m_aValues[1]); + float b0 = fx2f(pEnvelope->m_vPoints[i].m_aValues[2]); + float a0 = fx2f(pEnvelope->m_vPoints[i].m_aValues[3]); + float r1 = fx2f(pEnvelope->m_vPoints[i + 1].m_aValues[0]); + float g1 = fx2f(pEnvelope->m_vPoints[i + 1].m_aValues[1]); + float b1 = fx2f(pEnvelope->m_vPoints[i + 1].m_aValues[2]); + float a1 = fx2f(pEnvelope->m_vPoints[i + 1].m_aValues[3]); IGraphics::CColorVertex Array[4] = {IGraphics::CColorVertex(0, r0, g0, b0, a0), IGraphics::CColorVertex(1, r1, g1, b1, a1), @@ -5195,9 +5195,9 @@ void CEditor::RenderEnvelopeEditor(CUIRect View) IGraphics::CColorVertex(3, r0, g0, b0, a0)}; Graphics()->SetColorVertex(Array, 4); - float x0 = pEnvelope->m_lPoints[i].m_Time / 1000.0f / EndTime; + float x0 = pEnvelope->m_vPoints[i].m_Time / 1000.0f / EndTime; // float y0 = (fx2f(envelope->points[i].values[c])-bottom)/(top-bottom); - float x1 = pEnvelope->m_lPoints[i + 1].m_Time / 1000.0f / EndTime; + float x1 = pEnvelope->m_vPoints[i + 1].m_Time / 1000.0f / EndTime; //float y1 = (fx2f(envelope->points[i+1].values[c])-bottom)/(top-bottom); CUIRect v; v.x = ColorBar.x + x0 * ColorBar.w; @@ -5239,10 +5239,10 @@ void CEditor::RenderEnvelopeEditor(CUIRect View) if(!(s_ActiveChannels & (1 << c))) continue; - for(size_t i = 0; i < pEnvelope->m_lPoints.size(); i++) + for(size_t i = 0; i < pEnvelope->m_vPoints.size(); i++) { - float x0 = pEnvelope->m_lPoints[i].m_Time / 1000.0f / EndTime; - float y0 = (fx2f(pEnvelope->m_lPoints[i].m_aValues[c]) - Bottom) / (Top - Bottom); + float x0 = pEnvelope->m_vPoints[i].m_Time / 1000.0f / EndTime; + float y0 = (fx2f(pEnvelope->m_vPoints[i].m_aValues[c]) - Bottom) / (Top - Bottom); CUIRect Final; Final.x = View.x + x0 * View.w; Final.y = View.y + View.h - y0 * View.h; @@ -5251,7 +5251,7 @@ void CEditor::RenderEnvelopeEditor(CUIRect View) Final.w = 4.0f; Final.h = 4.0f; - void *pID = &pEnvelope->m_lPoints[i].m_aValues[c]; + void *pID = &pEnvelope->m_vPoints[i].m_aValues[c]; if(UI()->MouseInside(&Final)) UI()->SetHotItem(pID); @@ -5274,21 +5274,21 @@ void CEditor::RenderEnvelopeEditor(CUIRect View) if(i != 0) { if(Input()->ModifierIsPressed()) - pEnvelope->m_lPoints[i].m_Time += (int)((m_MouseDeltaX)); + pEnvelope->m_vPoints[i].m_Time += (int)((m_MouseDeltaX)); else - pEnvelope->m_lPoints[i].m_Time += (int)((m_MouseDeltaX * TimeScale) * 1000.0f); - if(pEnvelope->m_lPoints[i].m_Time < pEnvelope->m_lPoints[i - 1].m_Time) - pEnvelope->m_lPoints[i].m_Time = pEnvelope->m_lPoints[i - 1].m_Time + 1; - if(i + 1 != pEnvelope->m_lPoints.size() && pEnvelope->m_lPoints[i].m_Time > pEnvelope->m_lPoints[i + 1].m_Time) - pEnvelope->m_lPoints[i].m_Time = pEnvelope->m_lPoints[i + 1].m_Time - 1; + pEnvelope->m_vPoints[i].m_Time += (int)((m_MouseDeltaX * TimeScale) * 1000.0f); + if(pEnvelope->m_vPoints[i].m_Time < pEnvelope->m_vPoints[i - 1].m_Time) + pEnvelope->m_vPoints[i].m_Time = pEnvelope->m_vPoints[i - 1].m_Time + 1; + if(i + 1 != pEnvelope->m_vPoints.size() && pEnvelope->m_vPoints[i].m_Time > pEnvelope->m_vPoints[i + 1].m_Time) + pEnvelope->m_vPoints[i].m_Time = pEnvelope->m_vPoints[i + 1].m_Time - 1; } } else { if(Input()->ModifierIsPressed()) - pEnvelope->m_lPoints[i].m_aValues[c] -= f2fx(m_MouseDeltaY * 0.001f); + pEnvelope->m_vPoints[i].m_aValues[c] -= f2fx(m_MouseDeltaY * 0.001f); else - pEnvelope->m_lPoints[i].m_aValues[c] -= f2fx(m_MouseDeltaY * ValueScale); + pEnvelope->m_vPoints[i].m_aValues[c] -= f2fx(m_MouseDeltaY * ValueScale); } m_SelectedQuadEnvelope = m_SelectedEnvelope; @@ -5323,7 +5323,7 @@ void CEditor::RenderEnvelopeEditor(CUIRect View) str_format(s_aStrCurValue, sizeof(s_aStrCurValue), "0.000"); } - pEnvelope->m_lPoints.erase(pEnvelope->m_lPoints.begin() + i); + pEnvelope->m_vPoints.erase(pEnvelope->m_vPoints.begin() + i); m_Map.m_Modified = true; } @@ -5337,25 +5337,25 @@ void CEditor::RenderEnvelopeEditor(CUIRect View) { if(i != 0) { - pEnvelope->m_lPoints[i].m_Time = str_tofloat(s_aStrCurTime) * 1000.0f; + pEnvelope->m_vPoints[i].m_Time = str_tofloat(s_aStrCurTime) * 1000.0f; - if(pEnvelope->m_lPoints[i].m_Time < pEnvelope->m_lPoints[i - 1].m_Time) - pEnvelope->m_lPoints[i].m_Time = pEnvelope->m_lPoints[i - 1].m_Time + 1; - if(i + 1 != pEnvelope->m_lPoints.size() && pEnvelope->m_lPoints[i].m_Time > pEnvelope->m_lPoints[i + 1].m_Time) - pEnvelope->m_lPoints[i].m_Time = pEnvelope->m_lPoints[i + 1].m_Time - 1; + if(pEnvelope->m_vPoints[i].m_Time < pEnvelope->m_vPoints[i - 1].m_Time) + pEnvelope->m_vPoints[i].m_Time = pEnvelope->m_vPoints[i - 1].m_Time + 1; + if(i + 1 != pEnvelope->m_vPoints.size() && pEnvelope->m_vPoints[i].m_Time > pEnvelope->m_vPoints[i + 1].m_Time) + pEnvelope->m_vPoints[i].m_Time = pEnvelope->m_vPoints[i + 1].m_Time - 1; } else - pEnvelope->m_lPoints[i].m_Time = 0.0f; + pEnvelope->m_vPoints[i].m_Time = 0.0f; - str_format(s_aStrCurTime, sizeof(s_aStrCurTime), "%.3f", pEnvelope->m_lPoints[i].m_Time / 1000.0f); + str_format(s_aStrCurTime, sizeof(s_aStrCurTime), "%.3f", pEnvelope->m_vPoints[i].m_Time / 1000.0f); - pEnvelope->m_lPoints[i].m_aValues[c] = f2fx(str_tofloat(s_aStrCurValue)); + pEnvelope->m_vPoints[i].m_aValues[c] = f2fx(str_tofloat(s_aStrCurValue)); } if(UI()->CheckActiveItem(pID)) { - CurrentTime = pEnvelope->m_lPoints[i].m_Time; - CurrentValue = pEnvelope->m_lPoints[i].m_aValues[c]; + CurrentTime = pEnvelope->m_vPoints[i].m_Time; + CurrentValue = pEnvelope->m_vPoints[i].m_aValues[c]; // update displayed text str_format(s_aStrCurTime, sizeof(s_aStrCurTime), "%.3f", CurrentTime / 1000.0f); @@ -5431,7 +5431,7 @@ void CEditor::RenderServerSettingsEditor(CUIRect View, bool ShowServerSettingsEd if(m_aSettingsCommand[0] != 0 && str_find(m_aSettingsCommand, " ")) { bool Found = false; - for(const auto &Setting : m_Map.m_lSettings) + for(const auto &Setting : m_Map.m_vSettings) if(!str_comp(Setting.m_aCommand, m_aSettingsCommand)) { Found = true; @@ -5442,38 +5442,38 @@ void CEditor::RenderServerSettingsEditor(CUIRect View, bool ShowServerSettingsEd { CEditorMap::CSetting Setting; str_copy(Setting.m_aCommand, m_aSettingsCommand, sizeof(Setting.m_aCommand)); - m_Map.m_lSettings.push_back(Setting); - s_CommandSelectedIndex = m_Map.m_lSettings.size() - 1; + m_Map.m_vSettings.push_back(Setting); + s_CommandSelectedIndex = m_Map.m_vSettings.size() - 1; } } UI()->SetActiveItem(&m_CommandBox); } - if(!m_Map.m_lSettings.empty() && s_CommandSelectedIndex >= 0 && (size_t)s_CommandSelectedIndex < m_Map.m_lSettings.size()) + if(!m_Map.m_vSettings.empty() && s_CommandSelectedIndex >= 0 && (size_t)s_CommandSelectedIndex < m_Map.m_vSettings.size()) { ToolBar.VSplitRight(50.0f, &ToolBar, &Button); Button.VSplitRight(5.0f, &Button, 0); static int s_ModButton = 0; if(DoButton_Editor(&s_ModButton, "Mod", 0, &Button, 0, "Modify a command from the command list.") || (Input()->KeyPress(KEY_M) && UI()->LastActiveItem() != &m_CommandBox && m_Dialog == DIALOG_NONE)) { - if(str_comp(m_Map.m_lSettings[s_CommandSelectedIndex].m_aCommand, m_aSettingsCommand) != 0 && m_aSettingsCommand[0] != 0 && str_find(m_aSettingsCommand, " ")) + if(str_comp(m_Map.m_vSettings[s_CommandSelectedIndex].m_aCommand, m_aSettingsCommand) != 0 && m_aSettingsCommand[0] != 0 && str_find(m_aSettingsCommand, " ")) { bool Found = false; int i; - for(i = 0; i < (int)m_Map.m_lSettings.size(); i++) - if(i != s_CommandSelectedIndex && !str_comp(m_Map.m_lSettings[i].m_aCommand, m_aSettingsCommand)) + for(i = 0; i < (int)m_Map.m_vSettings.size(); i++) + if(i != s_CommandSelectedIndex && !str_comp(m_Map.m_vSettings[i].m_aCommand, m_aSettingsCommand)) { Found = true; break; } if(Found) { - m_Map.m_lSettings.erase(m_Map.m_lSettings.begin() + s_CommandSelectedIndex); + m_Map.m_vSettings.erase(m_Map.m_vSettings.begin() + s_CommandSelectedIndex); s_CommandSelectedIndex = i > s_CommandSelectedIndex ? i - 1 : i; } else { - str_copy(m_Map.m_lSettings[s_CommandSelectedIndex].m_aCommand, m_aSettingsCommand, sizeof(m_Map.m_lSettings[s_CommandSelectedIndex].m_aCommand)); + str_copy(m_Map.m_vSettings[s_CommandSelectedIndex].m_aCommand, m_aSettingsCommand, sizeof(m_Map.m_vSettings[s_CommandSelectedIndex].m_aCommand)); } } UI()->SetActiveItem(&m_CommandBox); @@ -5484,20 +5484,20 @@ void CEditor::RenderServerSettingsEditor(CUIRect View, bool ShowServerSettingsEd static int s_DelButton = 0; if(DoButton_Editor(&s_DelButton, "Del", 0, &Button, 0, "Delete a command from the command list.") || (Input()->KeyPress(KEY_DELETE) && UI()->LastActiveItem() != &m_CommandBox && m_Dialog == DIALOG_NONE)) { - m_Map.m_lSettings.erase(m_Map.m_lSettings.begin() + s_CommandSelectedIndex); - if(s_CommandSelectedIndex >= (int)m_Map.m_lSettings.size()) - s_CommandSelectedIndex = m_Map.m_lSettings.size() - 1; + m_Map.m_vSettings.erase(m_Map.m_vSettings.begin() + s_CommandSelectedIndex); + if(s_CommandSelectedIndex >= (int)m_Map.m_vSettings.size()) + s_CommandSelectedIndex = m_Map.m_vSettings.size() - 1; if(s_CommandSelectedIndex >= 0) - str_copy(m_aSettingsCommand, m_Map.m_lSettings[s_CommandSelectedIndex].m_aCommand, sizeof(m_aSettingsCommand)); + str_copy(m_aSettingsCommand, m_Map.m_vSettings[s_CommandSelectedIndex].m_aCommand, sizeof(m_aSettingsCommand)); UI()->SetActiveItem(&m_CommandBox); } ToolBar.VSplitRight(25.0f, &ToolBar, &Button); Button.VSplitRight(5.0f, &Button, 0); static int s_DownButton = 0; - if(s_CommandSelectedIndex < (int)m_Map.m_lSettings.size() - 1 && DoButton_Editor(&s_DownButton, "â–¼", 0, &Button, 0, "Move command down")) + if(s_CommandSelectedIndex < (int)m_Map.m_vSettings.size() - 1 && DoButton_Editor(&s_DownButton, "â–¼", 0, &Button, 0, "Move command down")) { - std::swap(m_Map.m_lSettings[s_CommandSelectedIndex], m_Map.m_lSettings[s_CommandSelectedIndex + 1]); + std::swap(m_Map.m_vSettings[s_CommandSelectedIndex], m_Map.m_vSettings[s_CommandSelectedIndex + 1]); s_CommandSelectedIndex++; } @@ -5506,7 +5506,7 @@ void CEditor::RenderServerSettingsEditor(CUIRect View, bool ShowServerSettingsEd static int s_UpButton = 0; if(s_CommandSelectedIndex > 0 && DoButton_Editor(&s_UpButton, "â–²", 0, &Button, 0, "Move command up")) { - std::swap(m_Map.m_lSettings[s_CommandSelectedIndex], m_Map.m_lSettings[s_CommandSelectedIndex - 1]); + std::swap(m_Map.m_vSettings[s_CommandSelectedIndex], m_Map.m_vSettings[s_CommandSelectedIndex - 1]); s_CommandSelectedIndex--; } } @@ -5518,7 +5518,7 @@ void CEditor::RenderServerSettingsEditor(CUIRect View, bool ShowServerSettingsEd CUIRect ListBox; View.Margin(1.0f, &ListBox); - float ListHeight = 17.0f * m_Map.m_lSettings.size(); + float ListHeight = 17.0f * m_Map.m_vSettings.size(); static float s_ScrollValue = 0; float ScrollDifference = ListHeight - ListBox.h; @@ -5550,7 +5550,7 @@ void CEditor::RenderServerSettingsEditor(CUIRect View, bool ShowServerSettingsEd float ListCur = 0; UI()->ClipEnable(&ListBox); - for(size_t i = 0; i < m_Map.m_lSettings.size(); i++) + for(size_t i = 0; i < m_Map.m_vSettings.size(); i++) { if(ListCur > ListStopAt) break; @@ -5562,10 +5562,10 @@ void CEditor::RenderServerSettingsEditor(CUIRect View, bool ShowServerSettingsEd ListBox.HSplitTop(2.0f, 0, &ListBox); Button.VSplitLeft(5.0f, 0, &Button); - if(DoButton_MenuItem(&m_Map.m_lSettings[i], m_Map.m_lSettings[i].m_aCommand, s_CommandSelectedIndex >= 0 && (size_t)s_CommandSelectedIndex == i, &Button, 0, 0)) + if(DoButton_MenuItem(&m_Map.m_vSettings[i], m_Map.m_vSettings[i].m_aCommand, s_CommandSelectedIndex >= 0 && (size_t)s_CommandSelectedIndex == i, &Button, 0, 0)) { s_CommandSelectedIndex = i; - str_copy(m_aSettingsCommand, m_Map.m_lSettings[i].m_aCommand, sizeof(m_aSettingsCommand)); + str_copy(m_aSettingsCommand, m_Map.m_vSettings[i].m_aCommand, sizeof(m_aSettingsCommand)); UI()->SetActiveItem(&m_CommandBox); } } @@ -5737,7 +5737,7 @@ void CEditor::Render() RenderBackground(View, m_CheckerTexture, 32.0f, 1.0f); CUIRect MenuBar, CModeBar, ToolBar, StatusBar, ExtraEditor, ToolBox; - m_ShowPicker = Input()->KeyIsPressed(KEY_SPACE) != 0 && m_Dialog == DIALOG_NONE && m_EditBoxActive == 0 && UI()->LastActiveItem() != &m_CommandBox && m_lSelectedLayers.size() == 1; + m_ShowPicker = Input()->KeyIsPressed(KEY_SPACE) != 0 && m_Dialog == DIALOG_NONE && m_EditBoxActive == 0 && UI()->LastActiveItem() != &m_CommandBox && m_vSelectedLayers.size() == 1; if(m_GuiActive) { @@ -5798,7 +5798,7 @@ void CEditor::Render() if(m_apSavedBrushes[Slot]) { CLayerGroup *pPrev = m_apSavedBrushes[Slot]; - for(auto &pLayer : pPrev->m_lLayers) + for(auto &pLayer : pPrev->m_vpLayers) { if(pLayer->m_BrushRefCount == 1) delete pLayer; @@ -5809,7 +5809,7 @@ void CEditor::Render() delete m_apSavedBrushes[Slot]; m_apSavedBrushes[Slot] = new CLayerGroup(m_Brush); - for(auto &pLayer : m_apSavedBrushes[Slot]->m_lLayers) + for(auto &pLayer : m_apSavedBrushes[Slot]->m_vpLayers) pLayer->m_BrushRefCount++; } else if(m_apSavedBrushes[Slot]) @@ -5817,7 +5817,7 @@ void CEditor::Render() dbg_msg("editor", "loading brush from slot %d", Slot); CLayerGroup *pNew = m_apSavedBrushes[Slot]; - for(auto &pLayer : pNew->m_lLayers) + for(auto &pLayer : pNew->m_vpLayers) pLayer->m_BrushRefCount++; m_Brush = *pNew; @@ -6091,7 +6091,7 @@ void CEditor::Reset(bool CreateDefault) } SelectGameLayer(); - m_lSelectedQuads.clear(); + m_vSelectedQuads.clear(); m_SelectedPoints = 0; m_SelectedEnvelope = 0; m_SelectedImage = 0; @@ -6159,18 +6159,18 @@ void CEditor::ZoomMouseTarget(float ZoomFactor) void CEditorMap::DeleteEnvelope(int Index) { - if(Index < 0 || Index >= (int)m_lEnvelopes.size()) + if(Index < 0 || Index >= (int)m_vpEnvelopes.size()) return; m_Modified = true; // fix links between envelopes and quads - for(auto &pGroup : m_lGroups) - for(auto &pLayer : pGroup->m_lLayers) + for(auto &pGroup : m_vpGroups) + for(auto &pLayer : pGroup->m_vpLayers) if(pLayer->m_Type == LAYERTYPE_QUADS) { CLayerQuads *pLayerQuads = static_cast(pLayer); - for(auto &Quad : pLayerQuads->m_lQuads) + for(auto &Quad : pLayerQuads->m_vQuads) { if(Quad.m_PosEnv == Index) Quad.m_PosEnv = -1; @@ -6193,7 +6193,7 @@ void CEditorMap::DeleteEnvelope(int Index) else if(pLayer->m_Type == LAYERTYPE_SOUNDS) { CLayerSounds *pLayerSounds = static_cast(pLayer); - for(auto &Source : pLayerSounds->m_lSources) + for(auto &Source : pLayerSounds->m_vSources) { if(Source.m_PosEnv == Index) Source.m_PosEnv = -1; @@ -6206,7 +6206,7 @@ void CEditorMap::DeleteEnvelope(int Index) } } - m_lEnvelopes.erase(m_lEnvelopes.begin() + Index); + m_vpEnvelopes.erase(m_vpEnvelopes.begin() + Index); } void CEditorMap::MakeGameLayer(CLayer *pLayer) @@ -6225,18 +6225,18 @@ void CEditorMap::MakeGameGroup(CLayerGroup *pGroup) void CEditorMap::Clean() { - for(auto &pGroup : m_lGroups) + for(auto &pGroup : m_vpGroups) { - DeleteAll(pGroup->m_lLayers); + DeleteAll(pGroup->m_vpLayers); } - DeleteAll(m_lGroups); - DeleteAll(m_lEnvelopes); - DeleteAll(m_lImages); - DeleteAll(m_lSounds); + DeleteAll(m_vpGroups); + DeleteAll(m_vpEnvelopes); + DeleteAll(m_vpImages); + DeleteAll(m_vpSounds); m_MapInfo.Reset(); - m_lSettings.clear(); + m_vSettings.clear(); m_pGameLayer = 0x0; m_pGameGroup = 0x0; diff --git a/src/game/editor/editor.h b/src/game/editor/editor.h index a7f932156..1cc2bd579 100644 --- a/src/game/editor/editor.h +++ b/src/game/editor/editor.h @@ -41,7 +41,7 @@ class CEnvelope { public: int m_Channels; - std::vector m_lPoints; + std::vector m_vPoints; char m_aName[32]; float m_Bottom, m_Top; bool m_Synchronized; @@ -57,7 +57,7 @@ public: void Resort() { - std::sort(m_lPoints.begin(), m_lPoints.end()); + std::sort(m_vPoints.begin(), m_vPoints.end()); FindTopBottom(0xf); } @@ -65,7 +65,7 @@ public: { m_Top = -1000000000.0f; m_Bottom = 1000000000.0f; - for(auto &Point : m_lPoints) + for(auto &Point : m_vPoints) { for(int c = 0; c < m_Channels; c++) { @@ -83,7 +83,7 @@ public: int Eval(float Time, float *pResult) { - CRenderTools::RenderEvalEnvelope(&m_lPoints[0], m_lPoints.size(), m_Channels, std::chrono::nanoseconds((int64_t)((double)Time * (double)std::chrono::nanoseconds(1s).count())), pResult); + CRenderTools::RenderEvalEnvelope(&m_vPoints[0], m_vPoints.size(), m_Channels, std::chrono::nanoseconds((int64_t)((double)Time * (double)std::chrono::nanoseconds(1s).count())), pResult); return m_Channels; } @@ -96,14 +96,14 @@ public: p.m_aValues[2] = v2; p.m_aValues[3] = v3; p.m_Curvetype = CURVETYPE_LINEAR; - m_lPoints.push_back(p); + m_vPoints.push_back(p); Resort(); } float EndTime() const { - if(!m_lPoints.empty()) - return m_lPoints[m_lPoints.size() - 1].m_Time * (1.0f / 1000.0f); + if(!m_vPoints.empty()) + return m_vPoints[m_vPoints.size() - 1].m_Time * (1.0f / 1000.0f); return 0; } }; @@ -171,7 +171,7 @@ class CLayerGroup public: class CEditorMap *m_pMap; - std::vector m_lLayers; + std::vector m_vpLayers; int m_OffsetX; int m_OffsetY; @@ -205,7 +205,7 @@ public: bool IsEmpty() const { - return m_lLayers.size() == 0; // stupid function, since its bad for Fillselection: TODO add a function for Fillselection that returns whether a specific tile is used in the given layer + return m_vpLayers.size() == 0; // stupid function, since its bad for Fillselection: TODO add a function for Fillselection that returns whether a specific tile is used in the given layer } /*bool IsUsedInThisLayer(int Layer, int Index) // <--------- this is what i meant but cause i don't know which Indexes belongs to which layers i can't finish yet @@ -245,26 +245,26 @@ public: void Clear() { - m_lLayers.clear(); + m_vpLayers.clear(); } void AddLayer(CLayer *l); void ModifyImageIndex(INDEX_MODIFY_FUNC Func) { - for(auto &pLayer : m_lLayers) + for(auto &pLayer : m_vpLayers) pLayer->ModifyImageIndex(Func); } void ModifyEnvelopeIndex(INDEX_MODIFY_FUNC Func) { - for(auto &pLayer : m_lLayers) + for(auto &pLayer : m_vpLayers) pLayer->ModifyEnvelopeIndex(Func); } void ModifySoundIndex(INDEX_MODIFY_FUNC Func) { - for(auto &pLayer : m_lLayers) + for(auto &pLayer : m_vpLayers) pLayer->ModifySoundIndex(Func); } }; @@ -340,10 +340,10 @@ public: Clean(); } - std::vector m_lGroups; - std::vector m_lImages; - std::vector m_lEnvelopes; - std::vector m_lSounds; + std::vector m_vpGroups; + std::vector m_vpImages; + std::vector m_vpEnvelopes; + std::vector m_vpSounds; class CMapInfo { @@ -377,7 +377,7 @@ public: { char m_aCommand[256]; }; - std::vector m_lSettings; + std::vector m_vSettings; class CLayerGame *m_pGameLayer; CLayerGroup *m_pGameGroup; @@ -386,7 +386,7 @@ public: { m_Modified = true; CEnvelope *e = new CEnvelope(Channels); - m_lEnvelopes.push_back(e); + m_vpEnvelopes.push_back(e); return e; } @@ -397,50 +397,50 @@ public: m_Modified = true; CLayerGroup *g = new CLayerGroup; g->m_pMap = this; - m_lGroups.push_back(g); + m_vpGroups.push_back(g); return g; } int SwapGroups(int Index0, int Index1) { - if(Index0 < 0 || Index0 >= (int)m_lGroups.size()) + if(Index0 < 0 || Index0 >= (int)m_vpGroups.size()) return Index0; - if(Index1 < 0 || Index1 >= (int)m_lGroups.size()) + if(Index1 < 0 || Index1 >= (int)m_vpGroups.size()) return Index0; if(Index0 == Index1) return Index0; m_Modified = true; - std::swap(m_lGroups[Index0], m_lGroups[Index1]); + std::swap(m_vpGroups[Index0], m_vpGroups[Index1]); return Index1; } void DeleteGroup(int Index) { - if(Index < 0 || Index >= (int)m_lGroups.size()) + if(Index < 0 || Index >= (int)m_vpGroups.size()) return; m_Modified = true; - delete m_lGroups[Index]; - m_lGroups.erase(m_lGroups.begin() + Index); + delete m_vpGroups[Index]; + m_vpGroups.erase(m_vpGroups.begin() + Index); } void ModifyImageIndex(INDEX_MODIFY_FUNC pfnFunc) { m_Modified = true; - for(auto &pGroup : m_lGroups) + for(auto &pGroup : m_vpGroups) pGroup->ModifyImageIndex(pfnFunc); } void ModifyEnvelopeIndex(INDEX_MODIFY_FUNC pfnFunc) { m_Modified = true; - for(auto &pGroup : m_lGroups) + for(auto &pGroup : m_vpGroups) pGroup->ModifyEnvelopeIndex(pfnFunc); } void ModifySoundIndex(INDEX_MODIFY_FUNC pfnFunc) { m_Modified = true; - for(auto &pGroup : m_lGroups) + for(auto &pGroup : m_vpGroups) pGroup->ModifySoundIndex(pfnFunc); } @@ -593,7 +593,7 @@ public: int Height = -1; int Color = 0; }; - static int RenderCommonProperties(SCommonPropState &State, CEditor *pEditor, CUIRect *pToolbox, std::vector &pLayers); + static int RenderCommonProperties(SCommonPropState &State, CEditor *pEditor, CUIRect *pToolbox, std::vector &vpLayers); void ModifyImageIndex(INDEX_MODIFY_FUNC pfnFunc) override; void ModifyEnvelopeIndex(INDEX_MODIFY_FUNC pfnFunc) override; @@ -655,7 +655,7 @@ public: void GetSize(float *w, float *h) override; int m_Image; - std::vector m_lQuads; + std::vector m_vQuads; }; class CLayerGame : public CLayerTiles @@ -924,12 +924,12 @@ public: bool operator<(const CFilelistItem &Other) const { return !str_comp(m_aFilename, "..") ? true : !str_comp(Other.m_aFilename, "..") ? false : m_IsDir && !Other.m_IsDir ? true : !m_IsDir && Other.m_IsDir ? false : str_comp_nocase(m_aFilename, Other.m_aFilename) < 0; } }; - std::vector m_FileList; + std::vector m_vFileList; int m_FilesStartAt; int m_FilesCur; int m_FilesStopAt; - std::vector m_SelectEntitiesFiles; + std::vector m_vSelectEntitiesFiles; std::string m_SelectEntitiesImage; float m_WorldOffsetX; @@ -959,8 +959,8 @@ public: bool m_ShowServerSettingsEditor; bool m_ShowPicker; - std::vector m_lSelectedLayers; - std::vector m_lSelectedQuads; + std::vector m_vSelectedLayers; + std::vector m_vSelectedQuads; int m_SelectedQuadPoint; int m_SelectedQuadIndex; int m_SelectedGroup; @@ -1031,7 +1031,7 @@ public: struct CLayerPopupContext { - std::vector m_aLayers; + std::vector m_vpLayers; CLayerTiles::SCommonPropState m_CommonPropState; }; static int PopupLayer(CEditor *pEditor, CUIRect View, void *pContext); @@ -1068,7 +1068,7 @@ public: void PopupSelectSoundInvoke(int Current, float x, float y); int PopupSelectSoundResult(); - void DoQuadEnvelopes(const std::vector &m_lQuads, IGraphics::CTextureHandle Texture = IGraphics::CTextureHandle()); + void DoQuadEnvelopes(const std::vector &vQuads, IGraphics::CTextureHandle Texture = IGraphics::CTextureHandle()); void DoQuadEnvPoint(const CQuad *pQuad, int QIndex, int pIndex); void DoQuadPoint(CQuad *pQuad, int QuadIndex, int v); @@ -1328,7 +1328,7 @@ public: void ModifySoundIndex(INDEX_MODIFY_FUNC pfnFunc) override; int m_Sound; - std::vector m_lSources; + std::vector m_vSources; }; #endif diff --git a/src/game/editor/io.cpp b/src/game/editor/io.cpp index 5234b8fd1..b3c8ef181 100644 --- a/src/game/editor/io.cpp +++ b/src/game/editor/io.cpp @@ -79,17 +79,17 @@ int CEditorMap::Save(class IStorage *pStorage, const char *pFileName) Item.m_License = -1; Item.m_Settings = -1; - if(!m_lSettings.empty()) + if(!m_vSettings.empty()) { int Size = 0; - for(const auto &Setting : m_lSettings) + for(const auto &Setting : m_vSettings) { Size += str_length(Setting.m_aCommand) + 1; } char *pSettings = (char *)malloc(maximum(Size, 1)); char *pNext = pSettings; - for(const auto &Setting : m_lSettings) + for(const auto &Setting : m_vSettings) { int Length = str_length(Setting.m_aCommand) + 1; mem_copy(pNext, Setting.m_aCommand, Length); @@ -103,9 +103,9 @@ int CEditorMap::Save(class IStorage *pStorage, const char *pFileName) } // save images - for(size_t i = 0; i < m_lImages.size(); i++) + for(size_t i = 0; i < m_vpImages.size(); i++) { - CEditorImage *pImg = m_lImages[i]; + CEditorImage *pImg = m_vpImages[i]; // analyse the image for when saving (should be done when we load the image) // TODO! @@ -146,9 +146,9 @@ int CEditorMap::Save(class IStorage *pStorage, const char *pFileName) } // save sounds - for(size_t i = 0; i < m_lSounds.size(); i++) + for(size_t i = 0; i < m_vpSounds.size(); i++) { - CEditorSound *pSound = m_lSounds[i]; + CEditorSound *pSound = m_vpSounds[i]; CMapItemSound Item; Item.m_Version = 1; @@ -164,7 +164,7 @@ int CEditorMap::Save(class IStorage *pStorage, const char *pFileName) // save layers int LayerCount = 0, GroupCount = 0; int AutomapperCount = 0; - for(const auto &pGroup : m_lGroups) + for(const auto &pGroup : m_vpGroups) { CMapItemGroup GItem; GItem.m_Version = CMapItemGroup::CURRENT_VERSION; @@ -184,7 +184,7 @@ int CEditorMap::Save(class IStorage *pStorage, const char *pFileName) // save group name StrToInts(GItem.m_aName, sizeof(GItem.m_aName) / sizeof(int), pGroup->m_aName); - for(const auto &pLayer : pGroup->m_lLayers) + for(const auto &pLayer : pGroup->m_vpLayers) { if(pLayer->m_Type == LAYERTYPE_TILES) { @@ -279,7 +279,7 @@ int CEditorMap::Save(class IStorage *pStorage, const char *pFileName) { m_pEditor->Console()->Print(IConsole::OUTPUT_LEVEL_ADDINFO, "editor", "saving quads layer"); CLayerQuads *pLayerQuads = (CLayerQuads *)pLayer; - if(!pLayerQuads->m_lQuads.empty()) + if(!pLayerQuads->m_vQuads.empty()) { CMapItemLayerQuads Item; Item.m_Version = 2; @@ -289,8 +289,8 @@ int CEditorMap::Save(class IStorage *pStorage, const char *pFileName) Item.m_Image = pLayerQuads->m_Image; // add the data - Item.m_NumQuads = pLayerQuads->m_lQuads.size(); - Item.m_Data = df.AddDataSwapped(pLayerQuads->m_lQuads.size() * sizeof(CQuad), &pLayerQuads->m_lQuads[0]); + Item.m_NumQuads = pLayerQuads->m_vQuads.size(); + Item.m_Data = df.AddDataSwapped(pLayerQuads->m_vQuads.size() * sizeof(CQuad), &pLayerQuads->m_vQuads[0]); // save layer name StrToInts(Item.m_aName, sizeof(Item.m_aName) / sizeof(int), pLayerQuads->m_aName); @@ -308,7 +308,7 @@ int CEditorMap::Save(class IStorage *pStorage, const char *pFileName) { m_pEditor->Console()->Print(IConsole::OUTPUT_LEVEL_ADDINFO, "editor", "saving sounds layer"); CLayerSounds *pLayerSounds = (CLayerSounds *)pLayer; - if(!pLayerSounds->m_lSources.empty()) + if(!pLayerSounds->m_vSources.empty()) { CMapItemLayerSounds Item; Item.m_Version = CMapItemLayerSounds::CURRENT_VERSION; @@ -318,8 +318,8 @@ int CEditorMap::Save(class IStorage *pStorage, const char *pFileName) Item.m_Sound = pLayerSounds->m_Sound; // add the data - Item.m_NumSources = pLayerSounds->m_lSources.size(); - Item.m_Data = df.AddDataSwapped(pLayerSounds->m_lSources.size() * sizeof(CSoundSource), &pLayerSounds->m_lSources[0]); + Item.m_NumSources = pLayerSounds->m_vSources.size(); + Item.m_Data = df.AddDataSwapped(pLayerSounds->m_vSources.size() * sizeof(CSoundSource), &pLayerSounds->m_vSources[0]); // save layer name StrToInts(Item.m_aName, sizeof(Item.m_aName) / sizeof(int), pLayerSounds->m_aName); @@ -336,15 +336,15 @@ int CEditorMap::Save(class IStorage *pStorage, const char *pFileName) // save envelopes int PointCount = 0; - for(size_t e = 0; e < m_lEnvelopes.size(); e++) + for(size_t e = 0; e < m_vpEnvelopes.size(); e++) { CMapItemEnvelope Item; Item.m_Version = CMapItemEnvelope::CURRENT_VERSION; - Item.m_Channels = m_lEnvelopes[e]->m_Channels; + Item.m_Channels = m_vpEnvelopes[e]->m_Channels; Item.m_StartPoint = PointCount; - Item.m_NumPoints = m_lEnvelopes[e]->m_lPoints.size(); - Item.m_Synchronized = m_lEnvelopes[e]->m_Synchronized; - StrToInts(Item.m_aName, sizeof(Item.m_aName) / sizeof(int), m_lEnvelopes[e]->m_aName); + Item.m_NumPoints = m_vpEnvelopes[e]->m_vPoints.size(); + Item.m_Synchronized = m_vpEnvelopes[e]->m_Synchronized; + StrToInts(Item.m_aName, sizeof(Item.m_aName) / sizeof(int), m_vpEnvelopes[e]->m_aName); df.AddItem(MAPITEMTYPE_ENVELOPE, e, sizeof(Item), &Item); PointCount += Item.m_NumPoints; @@ -355,10 +355,10 @@ int CEditorMap::Save(class IStorage *pStorage, const char *pFileName) CEnvPoint *pPoints = (CEnvPoint *)calloc(maximum(PointCount, 1), sizeof(*pPoints)); PointCount = 0; - for(const auto &pEnvelope : m_lEnvelopes) + for(const auto &pEnvelope : m_vpEnvelopes) { - int Count = pEnvelope->m_lPoints.size(); - mem_copy(&pPoints[PointCount], &pEnvelope->m_lPoints[0], sizeof(CEnvPoint) * Count); + int Count = pEnvelope->m_vPoints.size(); + mem_copy(&pPoints[PointCount], &pEnvelope->m_vPoints[0], sizeof(CEnvPoint) * Count); PointCount += Count; } @@ -459,7 +459,7 @@ int CEditorMap::Load(class IStorage *pStorage, const char *pFileName, int Storag int StrSize = str_length(pNext) + 1; CSetting Setting; str_copy(Setting.m_aCommand, pNext, sizeof(Setting.m_aCommand)); - m_lSettings.push_back(Setting); + m_vSettings.push_back(Setting); pNext += StrSize; } } @@ -519,7 +519,7 @@ int CEditorMap::Load(class IStorage *pStorage, const char *pFileName, int Storag // load auto mapper file pImg->m_AutoMapper.Load(pImg->m_aName); - m_lImages.push_back(pImg); + m_vpImages.push_back(pImg); // unload image DataFile.UnloadData(pItem->m_ImageData); @@ -578,7 +578,7 @@ int CEditorMap::Load(class IStorage *pStorage, const char *pFileName, int Storag if(pName) str_copy(pSound->m_aName, pName, sizeof(pSound->m_aName)); - m_lSounds.push_back(pSound); + m_vpSounds.push_back(pSound); // unload image DataFile.UnloadData(pItem->m_SoundData); @@ -851,7 +851,7 @@ int CEditorMap::Load(class IStorage *pStorage, const char *pFileName, int Storag pQuads->m_pEditor = m_pEditor; pLayer = pQuads; pQuads->m_Image = pQuadsItem->m_Image; - if(pQuads->m_Image < -1 || pQuads->m_Image >= (int)m_lImages.size()) + if(pQuads->m_Image < -1 || pQuads->m_Image >= (int)m_vpImages.size()) pQuads->m_Image = -1; // load layer name @@ -860,8 +860,8 @@ int CEditorMap::Load(class IStorage *pStorage, const char *pFileName, int Storag void *pData = DataFile.GetDataSwapped(pQuadsItem->m_Data); pGroup->AddLayer(pQuads); - pQuads->m_lQuads.resize(pQuadsItem->m_NumQuads); - mem_copy(&pQuads->m_lQuads[0], pData, sizeof(CQuad) * pQuadsItem->m_NumQuads); + pQuads->m_vQuads.resize(pQuadsItem->m_NumQuads); + mem_copy(&pQuads->m_vQuads[0], pData, sizeof(CQuad) * pQuadsItem->m_NumQuads); DataFile.UnloadData(pQuadsItem->m_Data); } else if(pLayerItem->m_Type == LAYERTYPE_SOUNDS) @@ -876,7 +876,7 @@ int CEditorMap::Load(class IStorage *pStorage, const char *pFileName, int Storag pSounds->m_Sound = pSoundsItem->m_Sound; // validate m_Sound - if(pSounds->m_Sound < -1 || pSounds->m_Sound >= (int)m_lSounds.size()) + if(pSounds->m_Sound < -1 || pSounds->m_Sound >= (int)m_vpSounds.size()) pSounds->m_Sound = -1; // load layer name @@ -886,8 +886,8 @@ int CEditorMap::Load(class IStorage *pStorage, const char *pFileName, int Storag // load data void *pData = DataFile.GetDataSwapped(pSoundsItem->m_Data); pGroup->AddLayer(pSounds); - pSounds->m_lSources.resize(pSoundsItem->m_NumSources); - mem_copy(&pSounds->m_lSources[0], pData, sizeof(CSoundSource) * pSoundsItem->m_NumSources); + pSounds->m_vSources.resize(pSoundsItem->m_NumSources); + mem_copy(&pSounds->m_vSources[0], pData, sizeof(CSoundSource) * pSoundsItem->m_NumSources); DataFile.UnloadData(pSoundsItem->m_Data); } else if(pLayerItem->m_Type == LAYERTYPE_SOUNDS_DEPRECATED) @@ -903,7 +903,7 @@ int CEditorMap::Load(class IStorage *pStorage, const char *pFileName, int Storag pSounds->m_Sound = pSoundsItem->m_Sound; // validate m_Sound - if(pSounds->m_Sound < -1 || pSounds->m_Sound >= (int)m_lSounds.size()) + if(pSounds->m_Sound < -1 || pSounds->m_Sound >= (int)m_vpSounds.size()) pSounds->m_Sound = -1; // load layer name @@ -913,13 +913,13 @@ int CEditorMap::Load(class IStorage *pStorage, const char *pFileName, int Storag // load data CSoundSource_DEPRECATED *pData = (CSoundSource_DEPRECATED *)DataFile.GetDataSwapped(pSoundsItem->m_Data); pGroup->AddLayer(pSounds); - pSounds->m_lSources.resize(pSoundsItem->m_NumSources); + pSounds->m_vSources.resize(pSoundsItem->m_NumSources); for(int i = 0; i < pSoundsItem->m_NumSources; i++) { CSoundSource_DEPRECATED *pOldSource = &pData[i]; - CSoundSource &Source = pSounds->m_lSources[i]; + CSoundSource &Source = pSounds->m_vSources[i]; Source.m_Position = pOldSource->m_Position; Source.m_Loop = pOldSource->m_Loop; Source.m_Pan = true; @@ -961,11 +961,11 @@ int CEditorMap::Load(class IStorage *pStorage, const char *pFileName, int Storag { CMapItemEnvelope *pItem = (CMapItemEnvelope *)DataFile.GetItem(Start + e, 0, 0); CEnvelope *pEnv = new CEnvelope(pItem->m_Channels); - pEnv->m_lPoints.resize(pItem->m_NumPoints); - mem_copy(&pEnv->m_lPoints[0], &pPoints[pItem->m_StartPoint], sizeof(CEnvPoint) * pItem->m_NumPoints); + pEnv->m_vPoints.resize(pItem->m_NumPoints); + mem_copy(&pEnv->m_vPoints[0], &pPoints[pItem->m_StartPoint], sizeof(CEnvPoint) * pItem->m_NumPoints); if(pItem->m_aName[0] != -1) // compatibility with old maps IntsToStr(pItem->m_aName, sizeof(pItem->m_aName) / sizeof(int), pEnv->m_aName); - m_lEnvelopes.push_back(pEnv); + m_vpEnvelopes.push_back(pEnv); if(pItem->m_Version >= 2) pEnv->m_Synchronized = pItem->m_Synchronized; } @@ -979,13 +979,13 @@ int CEditorMap::Load(class IStorage *pStorage, const char *pFileName, int Storag CMapItemAutoMapperConfig *pItem = (CMapItemAutoMapperConfig *)DataFile.GetItem(Start + i, 0, 0); if(pItem->m_Version == CMapItemAutoMapperConfig::CURRENT_VERSION) { - if(pItem->m_GroupId >= 0 && (size_t)pItem->m_GroupId < m_lGroups.size() && - pItem->m_LayerId >= 0 && (size_t)pItem->m_LayerId < m_lGroups[pItem->m_GroupId]->m_lLayers.size()) + if(pItem->m_GroupId >= 0 && (size_t)pItem->m_GroupId < m_vpGroups.size() && + pItem->m_LayerId >= 0 && (size_t)pItem->m_LayerId < m_vpGroups[pItem->m_GroupId]->m_vpLayers.size()) { - CLayer *pLayer = m_lGroups[pItem->m_GroupId]->m_lLayers[pItem->m_LayerId]; + CLayer *pLayer = m_vpGroups[pItem->m_GroupId]->m_vpLayers[pItem->m_LayerId]; if(pLayer->m_Type == LAYERTYPE_TILES) { - CLayerTiles *pTiles = (CLayerTiles *)m_lGroups[pItem->m_GroupId]->m_lLayers[pItem->m_LayerId]; + CLayerTiles *pTiles = (CLayerTiles *)m_vpGroups[pItem->m_GroupId]->m_vpLayers[pItem->m_LayerId]; // only load auto mappers for tile layers (not physics layers) if(!(pTiles->m_Game || pTiles->m_Tele || pTiles->m_Speedup || pTiles->m_Front || pTiles->m_Switch || pTiles->m_Tune)) @@ -1025,35 +1025,35 @@ int CEditor::Append(const char *pFileName, int StorageType) return Err; // modify indecies - gs_ModifyAddAmount = m_Map.m_lImages.size(); + gs_ModifyAddAmount = m_Map.m_vpImages.size(); NewMap.ModifyImageIndex(ModifyAdd); - gs_ModifyAddAmount = m_Map.m_lEnvelopes.size(); + gs_ModifyAddAmount = m_Map.m_vpEnvelopes.size(); NewMap.ModifyEnvelopeIndex(ModifyAdd); // transfer images - for(const auto &pImage : NewMap.m_lImages) - m_Map.m_lImages.push_back(pImage); - NewMap.m_lImages.clear(); + for(const auto &pImage : NewMap.m_vpImages) + m_Map.m_vpImages.push_back(pImage); + NewMap.m_vpImages.clear(); // transfer envelopes - for(const auto &pEnvelope : NewMap.m_lEnvelopes) - m_Map.m_lEnvelopes.push_back(pEnvelope); - NewMap.m_lEnvelopes.clear(); + for(const auto &pEnvelope : NewMap.m_vpEnvelopes) + m_Map.m_vpEnvelopes.push_back(pEnvelope); + NewMap.m_vpEnvelopes.clear(); // transfer groups - for(const auto &pGroup : NewMap.m_lGroups) + for(const auto &pGroup : NewMap.m_vpGroups) { if(pGroup == NewMap.m_pGameGroup) delete pGroup; else { pGroup->m_pMap = &m_Map; - m_Map.m_lGroups.push_back(pGroup); + m_Map.m_vpGroups.push_back(pGroup); } } - NewMap.m_lGroups.clear(); + NewMap.m_vpGroups.clear(); // all done \o/ return 0; diff --git a/src/game/editor/layer_quads.cpp b/src/game/editor/layer_quads.cpp index 3d4f82229..92f09a89f 100644 --- a/src/game/editor/layer_quads.cpp +++ b/src/game/editor/layer_quads.cpp @@ -19,21 +19,21 @@ CLayerQuads::~CLayerQuads() = default; void CLayerQuads::Render(bool QuadPicker) { Graphics()->TextureClear(); - if(m_Image >= 0 && (size_t)m_Image < m_pEditor->m_Map.m_lImages.size()) - Graphics()->TextureSet(m_pEditor->m_Map.m_lImages[m_Image]->m_Texture); + if(m_Image >= 0 && (size_t)m_Image < m_pEditor->m_Map.m_vpImages.size()) + Graphics()->TextureSet(m_pEditor->m_Map.m_vpImages[m_Image]->m_Texture); Graphics()->BlendNone(); - m_pEditor->RenderTools()->ForceRenderQuads(&m_lQuads[0], m_lQuads.size(), LAYERRENDERFLAG_OPAQUE, m_pEditor->EnvelopeEval, m_pEditor); + m_pEditor->RenderTools()->ForceRenderQuads(&m_vQuads[0], m_vQuads.size(), LAYERRENDERFLAG_OPAQUE, m_pEditor->EnvelopeEval, m_pEditor); Graphics()->BlendNormal(); - m_pEditor->RenderTools()->ForceRenderQuads(&m_lQuads[0], m_lQuads.size(), LAYERRENDERFLAG_TRANSPARENT, m_pEditor->EnvelopeEval, m_pEditor); + m_pEditor->RenderTools()->ForceRenderQuads(&m_vQuads[0], m_vQuads.size(), LAYERRENDERFLAG_TRANSPARENT, m_pEditor->EnvelopeEval, m_pEditor); } CQuad *CLayerQuads::NewQuad(int x, int y, int Width, int Height) { m_pEditor->m_Map.m_Modified = true; - m_lQuads.emplace_back(); - CQuad *q = &m_lQuads[m_lQuads.size() - 1]; + m_vQuads.emplace_back(); + CQuad *q = &m_vQuads[m_vQuads.size() - 1]; q->m_PosEnv = -1; q->m_ColorEnv = -1; @@ -109,7 +109,7 @@ int CLayerQuads::BrushGrab(CLayerGroup *pBrush, CUIRect Rect) pBrush->AddLayer(pGrabbed); //dbg_msg("", "%f %f %f %f", rect.x, rect.y, rect.w, rect.h); - for(const auto &Quad : m_lQuads) + for(const auto &Quad : m_vQuads) { float px = fx2f(Quad.m_aPoints[4].x); float py = fx2f(Quad.m_aPoints[4].y); @@ -124,17 +124,17 @@ int CLayerQuads::BrushGrab(CLayerGroup *pBrush, CUIRect Rect) Point.y -= f2fx(Rect.y); } - pGrabbed->m_lQuads.push_back(n); + pGrabbed->m_vQuads.push_back(n); } } - return pGrabbed->m_lQuads.empty() ? 0 : 1; + return pGrabbed->m_vQuads.empty() ? 0 : 1; } void CLayerQuads::BrushPlace(CLayer *pBrush, float wx, float wy) { CLayerQuads *l = (CLayerQuads *)pBrush; - for(const auto &Quad : l->m_lQuads) + for(const auto &Quad : l->m_vQuads) { CQuad n = Quad; @@ -144,14 +144,14 @@ void CLayerQuads::BrushPlace(CLayer *pBrush, float wx, float wy) Point.y += f2fx(wy); } - m_lQuads.push_back(n); + m_vQuads.push_back(n); } m_pEditor->m_Map.m_Modified = true; } void CLayerQuads::BrushFlipX() { - for(auto &Quad : m_lQuads) + for(auto &Quad : m_vQuads) { std::swap(Quad.m_aPoints[0], Quad.m_aPoints[1]); std::swap(Quad.m_aPoints[2], Quad.m_aPoints[3]); @@ -161,7 +161,7 @@ void CLayerQuads::BrushFlipX() void CLayerQuads::BrushFlipY() { - for(auto &Quad : m_lQuads) + for(auto &Quad : m_vQuads) { std::swap(Quad.m_aPoints[0], Quad.m_aPoints[2]); std::swap(Quad.m_aPoints[1], Quad.m_aPoints[3]); @@ -184,7 +184,7 @@ void CLayerQuads::BrushRotate(float Amount) Center.x /= 2; Center.y /= 2; - for(auto &Quad : m_lQuads) + for(auto &Quad : m_vQuads) { for(auto &Point : Quad.m_aPoints) { @@ -201,7 +201,7 @@ void CLayerQuads::GetSize(float *w, float *h) *w = 0; *h = 0; - for(const auto &Quad : m_lQuads) + for(const auto &Quad : m_vQuads) { for(const auto &Point : Quad.m_aPoints) { @@ -234,7 +234,7 @@ int CLayerQuads::RenderProperties(CUIRect *pToolBox) if(Prop == PROP_IMAGE) { if(NewVal >= 0) - m_Image = NewVal % m_pEditor->m_Map.m_lImages.size(); + m_Image = NewVal % m_pEditor->m_Map.m_vpImages.size(); else m_Image = -1; } @@ -249,7 +249,7 @@ void CLayerQuads::ModifyImageIndex(INDEX_MODIFY_FUNC Func) void CLayerQuads::ModifyEnvelopeIndex(INDEX_MODIFY_FUNC Func) { - for(auto &Quad : m_lQuads) + for(auto &Quad : m_vQuads) { Func(&Quad.m_PosEnv); Func(&Quad.m_ColorEnv); diff --git a/src/game/editor/layer_sounds.cpp b/src/game/editor/layer_sounds.cpp index 0f2a90370..112a85490 100644 --- a/src/game/editor/layer_sounds.cpp +++ b/src/game/editor/layer_sounds.cpp @@ -23,7 +23,7 @@ void CLayerSounds::Render(bool Tileset) // draw falloff distance Graphics()->SetColor(0.6f, 0.8f, 1.0f, 0.4f); - for(const auto &Source : m_lSources) + for(const auto &Source : m_vSources) { float OffsetX = 0; float OffsetY = 0; @@ -73,7 +73,7 @@ void CLayerSounds::Render(bool Tileset) Graphics()->SetColor(1.0f, 1.0f, 1.0f, 1.0f); m_pEditor->RenderTools()->SelectSprite(SPRITE_AUDIO_SOURCE); - for(const auto &Source : m_lSources) + for(const auto &Source : m_vSources) { float OffsetX = 0; float OffsetY = 0; @@ -96,8 +96,8 @@ CSoundSource *CLayerSounds::NewSource(int x, int y) { m_pEditor->m_Map.m_Modified = true; - m_lSources.emplace_back(); - CSoundSource *pSource = &m_lSources[m_lSources.size() - 1]; + m_vSources.emplace_back(); + CSoundSource *pSource = &m_vSources[m_vSources.size() - 1]; pSource->m_Position.x = f2fx(x); pSource->m_Position.y = f2fx(y); @@ -141,7 +141,7 @@ int CLayerSounds::BrushGrab(CLayerGroup *pBrush, CUIRect Rect) pGrabbed->m_Sound = m_Sound; pBrush->AddLayer(pGrabbed); - for(const auto &Source : m_lSources) + for(const auto &Source : m_vSources) { float px = fx2f(Source.m_Position.x); float py = fx2f(Source.m_Position.y); @@ -153,24 +153,24 @@ int CLayerSounds::BrushGrab(CLayerGroup *pBrush, CUIRect Rect) n.m_Position.x -= f2fx(Rect.x); n.m_Position.y -= f2fx(Rect.y); - pGrabbed->m_lSources.push_back(n); + pGrabbed->m_vSources.push_back(n); } } - return pGrabbed->m_lSources.empty() ? 0 : 1; + return pGrabbed->m_vSources.empty() ? 0 : 1; } void CLayerSounds::BrushPlace(CLayer *pBrush, float wx, float wy) { CLayerSounds *l = (CLayerSounds *)pBrush; - for(const auto &Source : l->m_lSources) + for(const auto &Source : l->m_vSources) { CSoundSource n = Source; n.m_Position.x += f2fx(wx); n.m_Position.y += f2fx(wy); - m_lSources.push_back(n); + m_vSources.push_back(n); } m_pEditor->m_Map.m_Modified = true; } @@ -198,7 +198,7 @@ int CLayerSounds::RenderProperties(CUIRect *pToolBox) if(Prop == PROP_SOUND) { if(NewVal >= 0) - m_Sound = NewVal % m_pEditor->m_Map.m_lSounds.size(); + m_Sound = NewVal % m_pEditor->m_Map.m_vpSounds.size(); else m_Sound = -1; } @@ -213,7 +213,7 @@ void CLayerSounds::ModifySoundIndex(INDEX_MODIFY_FUNC Func) void CLayerSounds::ModifyEnvelopeIndex(INDEX_MODIFY_FUNC Func) { - for(auto &Source : m_lSources) + for(auto &Source : m_vSources) { Func(&Source.m_SoundEnv); Func(&Source.m_PosEnv); diff --git a/src/game/editor/layer_tiles.cpp b/src/game/editor/layer_tiles.cpp index 1d3fd6127..3477a477a 100644 --- a/src/game/editor/layer_tiles.cpp +++ b/src/game/editor/layer_tiles.cpp @@ -65,7 +65,7 @@ void CLayerTiles::PrepareForSave() { for(int y = 0; y < m_Height; y++) for(int x = 0; x < m_Width; x++) - m_pTiles[y * m_Width + x].m_Flags |= m_pEditor->m_Map.m_lImages[m_Image]->m_aTileFlags[m_pTiles[y * m_Width + x].m_Index]; + m_pTiles[y * m_Width + x].m_Flags |= m_pEditor->m_Map.m_vpImages[m_Image]->m_aTileFlags[m_pTiles[y * m_Width + x].m_Index]; } } @@ -78,8 +78,8 @@ void CLayerTiles::MakePalette() void CLayerTiles::Render(bool Tileset) { - if(m_Image >= 0 && (size_t)m_Image < m_pEditor->m_Map.m_lImages.size()) - m_Texture = m_pEditor->m_Map.m_lImages[m_Image]->m_Texture; + if(m_Image >= 0 && (size_t)m_Image < m_pEditor->m_Map.m_vpImages.size()) + m_Texture = m_pEditor->m_Map.m_vpImages[m_Image]->m_Texture; Graphics()->TextureSet(m_Texture); ColorRGBA Color = ColorRGBA(m_Color.r / 255.0f, m_Color.g / 255.0f, m_Color.b / 255.0f, m_Color.a / 255.0f); Graphics()->BlendNone(); @@ -653,7 +653,7 @@ int CLayerTiles::RenderProperties(CUIRect *pToolBox) bool IsGameLayer = (m_pEditor->m_Map.m_pGameLayer == this || m_pEditor->m_Map.m_pTeleLayer == this || m_pEditor->m_Map.m_pSpeedupLayer == this || m_pEditor->m_Map.m_pFrontLayer == this || m_pEditor->m_Map.m_pSwitchLayer == this || m_pEditor->m_Map.m_pTuneLayer == this); - CLayerGroup *pGroup = m_pEditor->m_Map.m_lGroups[m_pEditor->m_SelectedGroup]; + CLayerGroup *pGroup = m_pEditor->m_Map.m_vpGroups[m_pEditor->m_SelectedGroup]; // Game tiles can only be constructed if the layer is relative to the game layer if(!IsGameLayer && !(pGroup->m_OffsetX % 32) && !(pGroup->m_OffsetY % 32) && pGroup->m_ParallaxX == 100 && pGroup->m_ParallaxY == 100) @@ -754,7 +754,7 @@ int CLayerTiles::RenderProperties(CUIRect *pToolBox) if(m_pEditor->m_Map.m_pGameLayer != this) { - if(m_Image >= 0 && (size_t)m_Image < m_pEditor->m_Map.m_lImages.size() && m_pEditor->m_Map.m_lImages[m_Image]->m_AutoMapper.IsLoaded() && + if(m_Image >= 0 && (size_t)m_Image < m_pEditor->m_Map.m_vpImages.size() && m_pEditor->m_Map.m_vpImages[m_Image]->m_AutoMapper.IsLoaded() && m_AutoMapperConfig != -1) { static int s_AutoMapperButton = 0; @@ -774,7 +774,7 @@ int CLayerTiles::RenderProperties(CUIRect *pToolBox) } if(m_pEditor->DoButton_Editor(&s_AutoMapperButton, "Automap", 0, &Button, 0, "Run the automapper")) { - m_pEditor->m_Map.m_lImages[m_Image]->m_AutoMapper.Proceed(this, m_AutoMapperConfig, m_Seed); + m_pEditor->m_Map.m_vpImages[m_Image]->m_AutoMapper.Proceed(this, m_AutoMapperConfig, m_Seed); return 1; } } @@ -865,10 +865,10 @@ int CLayerTiles::RenderProperties(CUIRect *pToolBox) } else { - m_Image = NewVal % m_pEditor->m_Map.m_lImages.size(); + m_Image = NewVal % m_pEditor->m_Map.m_vpImages.size(); m_AutoMapperConfig = -1; - if(m_pEditor->m_Map.m_lImages[m_Image]->m_Width % 16 != 0 || m_pEditor->m_Map.m_lImages[m_Image]->m_Height % 16 != 0) + if(m_pEditor->m_Map.m_vpImages[m_Image]->m_Width % 16 != 0 || m_pEditor->m_Map.m_vpImages[m_Image]->m_Height % 16 != 0) { m_pEditor->m_PopupEventType = m_pEditor->POPEVENT_IMAGEDIV16; m_pEditor->m_PopupEventActivated = true; @@ -887,12 +887,12 @@ int CLayerTiles::RenderProperties(CUIRect *pToolBox) } if(Prop == PROP_COLOR_ENV) { - int Index = clamp(NewVal - 1, -1, (int)m_pEditor->m_Map.m_lEnvelopes.size() - 1); + int Index = clamp(NewVal - 1, -1, (int)m_pEditor->m_Map.m_vpEnvelopes.size() - 1); int Step = (Index - m_ColorEnv) % 2; if(Step != 0) { - for(; Index >= -1 && Index < (int)m_pEditor->m_Map.m_lEnvelopes.size(); Index += Step) - if(Index == -1 || m_pEditor->m_Map.m_lEnvelopes[Index]->m_Channels == 4) + for(; Index >= -1 && Index < (int)m_pEditor->m_Map.m_vpEnvelopes.size(); Index += Step) + if(Index == -1 || m_pEditor->m_Map.m_vpEnvelopes[Index]->m_Channels == 4) { m_ColorEnv = Index; break; @@ -905,8 +905,8 @@ int CLayerTiles::RenderProperties(CUIRect *pToolBox) m_Seed = NewVal; else if(Prop == PROP_AUTOMAPPER) { - if(m_Image >= 0 && m_pEditor->m_Map.m_lImages[m_Image]->m_AutoMapper.ConfigNamesNum() > 0 && NewVal >= 0) - m_AutoMapperConfig = NewVal % m_pEditor->m_Map.m_lImages[m_Image]->m_AutoMapper.ConfigNamesNum(); + if(m_Image >= 0 && m_pEditor->m_Map.m_vpImages[m_Image]->m_AutoMapper.ConfigNamesNum() > 0 && NewVal >= 0) + m_AutoMapperConfig = NewVal % m_pEditor->m_Map.m_vpImages[m_Image]->m_AutoMapper.ConfigNamesNum(); else m_AutoMapperConfig = -1; } @@ -918,7 +918,7 @@ int CLayerTiles::RenderProperties(CUIRect *pToolBox) return 0; } -int CLayerTiles::RenderCommonProperties(SCommonPropState &State, CEditor *pEditor, CUIRect *pToolbox, std::vector &pLayers) +int CLayerTiles::RenderCommonProperties(SCommonPropState &State, CEditor *pEditor, CUIRect *pToolbox, std::vector &vpLayers) { if(State.Modified) { @@ -928,7 +928,7 @@ int CLayerTiles::RenderCommonProperties(SCommonPropState &State, CEditor *pEdito if(pEditor->DoButton_Editor(&s_CommitButton, "Commit", 0, &Commit, 0, "Applies the changes")) { dbg_msg("editor", "applying changes"); - for(auto &pLayer : pLayers) + for(auto &pLayer : vpLayers) { pLayer->Resize(State.Width, State.Height); @@ -944,7 +944,7 @@ int CLayerTiles::RenderCommonProperties(SCommonPropState &State, CEditor *pEdito } else { - for(auto &pLayer : pLayers) + for(auto &pLayer : vpLayers) { if(pLayer->m_Width > State.Width) State.Width = pLayer->m_Width; @@ -1011,7 +1011,7 @@ int CLayerTiles::RenderCommonProperties(SCommonPropState &State, CEditor *pEdito } else if(Prop == PROP_SHIFT) { - for(auto &pLayer : pLayers) + for(auto &pLayer : vpLayers) pLayer->Shift(NewVal); } else if(Prop == PROP_SHIFT_BY) @@ -1034,7 +1034,7 @@ void CLayerTiles::FlagModified(int x, int y, int w, int h) m_pEditor->m_Map.m_Modified = true; if(m_Seed != 0 && m_AutoMapperConfig != -1 && m_AutoAutoMap && m_Image >= 0) { - m_pEditor->m_Map.m_lImages[m_Image]->m_AutoMapper.ProceedLocalized(this, m_AutoMapperConfig, m_Seed, x, y, w, h); + m_pEditor->m_Map.m_vpImages[m_Image]->m_AutoMapper.ProceedLocalized(this, m_AutoMapperConfig, m_Seed, x, y, w, h); } } diff --git a/src/game/editor/popups.cpp b/src/game/editor/popups.cpp index d5aadff62..a46d9ff6f 100644 --- a/src/game/editor/popups.cpp +++ b/src/game/editor/popups.cpp @@ -139,7 +139,7 @@ int CEditor::PopupGroup(CEditor *pEditor, CUIRect View, void *pContext) { // gather all tile layers std::vector Layers; - for(auto &pLayer : pEditor->m_Map.m_pGameGroup->m_lLayers) + for(auto &pLayer : pEditor->m_Map.m_pGameGroup->m_vpLayers) { if(pLayer != pEditor->m_Map.m_pGameLayer && pLayer->m_Type == LAYERTYPE_TILES) Layers.push_back(static_cast(pLayer)); @@ -184,8 +184,8 @@ int CEditor::PopupGroup(CEditor *pEditor, CUIRect View, void *pContext) { CLayer *l = new CLayerTele(pEditor->m_Map.m_pGameLayer->m_Width, pEditor->m_Map.m_pGameLayer->m_Height); pEditor->m_Map.MakeTeleLayer(l); - pEditor->m_Map.m_lGroups[pEditor->m_SelectedGroup]->AddLayer(l); - pEditor->SelectLayer(pEditor->m_Map.m_lGroups[pEditor->m_SelectedGroup]->m_lLayers.size() - 1); + pEditor->m_Map.m_vpGroups[pEditor->m_SelectedGroup]->AddLayer(l); + pEditor->SelectLayer(pEditor->m_Map.m_vpGroups[pEditor->m_SelectedGroup]->m_vpLayers.size() - 1); pEditor->m_Brush.Clear(); return 1; } @@ -201,8 +201,8 @@ int CEditor::PopupGroup(CEditor *pEditor, CUIRect View, void *pContext) { CLayer *l = new CLayerSpeedup(pEditor->m_Map.m_pGameLayer->m_Width, pEditor->m_Map.m_pGameLayer->m_Height); pEditor->m_Map.MakeSpeedupLayer(l); - pEditor->m_Map.m_lGroups[pEditor->m_SelectedGroup]->AddLayer(l); - pEditor->SelectLayer(pEditor->m_Map.m_lGroups[pEditor->m_SelectedGroup]->m_lLayers.size() - 1); + pEditor->m_Map.m_vpGroups[pEditor->m_SelectedGroup]->AddLayer(l); + pEditor->SelectLayer(pEditor->m_Map.m_vpGroups[pEditor->m_SelectedGroup]->m_vpLayers.size() - 1); pEditor->m_Brush.Clear(); return 1; } @@ -218,8 +218,8 @@ int CEditor::PopupGroup(CEditor *pEditor, CUIRect View, void *pContext) { CLayer *l = new CLayerTune(pEditor->m_Map.m_pGameLayer->m_Width, pEditor->m_Map.m_pGameLayer->m_Height); pEditor->m_Map.MakeTuneLayer(l); - pEditor->m_Map.m_lGroups[pEditor->m_SelectedGroup]->AddLayer(l); - pEditor->SelectLayer(pEditor->m_Map.m_lGroups[pEditor->m_SelectedGroup]->m_lLayers.size() - 1); + pEditor->m_Map.m_vpGroups[pEditor->m_SelectedGroup]->AddLayer(l); + pEditor->SelectLayer(pEditor->m_Map.m_vpGroups[pEditor->m_SelectedGroup]->m_vpLayers.size() - 1); pEditor->m_Brush.Clear(); return 1; } @@ -235,8 +235,8 @@ int CEditor::PopupGroup(CEditor *pEditor, CUIRect View, void *pContext) { CLayer *l = new CLayerFront(pEditor->m_Map.m_pGameLayer->m_Width, pEditor->m_Map.m_pGameLayer->m_Height); pEditor->m_Map.MakeFrontLayer(l); - pEditor->m_Map.m_lGroups[pEditor->m_SelectedGroup]->AddLayer(l); - pEditor->SelectLayer(pEditor->m_Map.m_lGroups[pEditor->m_SelectedGroup]->m_lLayers.size() - 1); + pEditor->m_Map.m_vpGroups[pEditor->m_SelectedGroup]->AddLayer(l); + pEditor->SelectLayer(pEditor->m_Map.m_vpGroups[pEditor->m_SelectedGroup]->m_vpLayers.size() - 1); pEditor->m_Brush.Clear(); return 1; } @@ -252,8 +252,8 @@ int CEditor::PopupGroup(CEditor *pEditor, CUIRect View, void *pContext) { CLayer *l = new CLayerSwitch(pEditor->m_Map.m_pGameLayer->m_Width, pEditor->m_Map.m_pGameLayer->m_Height); pEditor->m_Map.MakeSwitchLayer(l); - pEditor->m_Map.m_lGroups[pEditor->m_SelectedGroup]->AddLayer(l); - pEditor->SelectLayer(pEditor->m_Map.m_lGroups[pEditor->m_SelectedGroup]->m_lLayers.size() - 1); + pEditor->m_Map.m_vpGroups[pEditor->m_SelectedGroup]->AddLayer(l); + pEditor->SelectLayer(pEditor->m_Map.m_vpGroups[pEditor->m_SelectedGroup]->m_vpLayers.size() - 1); pEditor->m_Brush.Clear(); return 1; } @@ -267,9 +267,9 @@ int CEditor::PopupGroup(CEditor *pEditor, CUIRect View, void *pContext) { CLayer *l = new CLayerQuads; l->m_pEditor = pEditor; - pEditor->m_Map.m_lGroups[pEditor->m_SelectedGroup]->AddLayer(l); - pEditor->SelectLayer(pEditor->m_Map.m_lGroups[pEditor->m_SelectedGroup]->m_lLayers.size() - 1); - pEditor->m_Map.m_lGroups[pEditor->m_SelectedGroup]->m_Collapse = false; + pEditor->m_Map.m_vpGroups[pEditor->m_SelectedGroup]->AddLayer(l); + pEditor->SelectLayer(pEditor->m_Map.m_vpGroups[pEditor->m_SelectedGroup]->m_vpLayers.size() - 1); + pEditor->m_Map.m_vpGroups[pEditor->m_SelectedGroup]->m_Collapse = false; return 1; } @@ -281,9 +281,9 @@ int CEditor::PopupGroup(CEditor *pEditor, CUIRect View, void *pContext) { CLayer *l = new CLayerTiles(pEditor->m_Map.m_pGameLayer->m_Width, pEditor->m_Map.m_pGameLayer->m_Height); l->m_pEditor = pEditor; - pEditor->m_Map.m_lGroups[pEditor->m_SelectedGroup]->AddLayer(l); - pEditor->SelectLayer(pEditor->m_Map.m_lGroups[pEditor->m_SelectedGroup]->m_lLayers.size() - 1); - pEditor->m_Map.m_lGroups[pEditor->m_SelectedGroup]->m_Collapse = false; + pEditor->m_Map.m_vpGroups[pEditor->m_SelectedGroup]->AddLayer(l); + pEditor->SelectLayer(pEditor->m_Map.m_vpGroups[pEditor->m_SelectedGroup]->m_vpLayers.size() - 1); + pEditor->m_Map.m_vpGroups[pEditor->m_SelectedGroup]->m_Collapse = false; return 1; } @@ -295,9 +295,9 @@ int CEditor::PopupGroup(CEditor *pEditor, CUIRect View, void *pContext) { CLayer *l = new CLayerSounds; l->m_pEditor = pEditor; - pEditor->m_Map.m_lGroups[pEditor->m_SelectedGroup]->AddLayer(l); - pEditor->SelectLayer(pEditor->m_Map.m_lGroups[pEditor->m_SelectedGroup]->m_lLayers.size() - 1); - pEditor->m_Map.m_lGroups[pEditor->m_SelectedGroup]->m_Collapse = false; + pEditor->m_Map.m_vpGroups[pEditor->m_SelectedGroup]->AddLayer(l); + pEditor->SelectLayer(pEditor->m_Map.m_vpGroups[pEditor->m_SelectedGroup]->m_vpLayers.size() - 1); + pEditor->m_Map.m_vpGroups[pEditor->m_SelectedGroup]->m_Collapse = false; return 1; } @@ -309,7 +309,7 @@ int CEditor::PopupGroup(CEditor *pEditor, CUIRect View, void *pContext) pEditor->UI()->DoLabel(&Button, "Name:", 10.0f, TEXTALIGN_LEFT); Button.VSplitLeft(40.0f, 0, &Button); static float s_Name = 0; - if(pEditor->DoEditBox(&s_Name, &Button, pEditor->m_Map.m_lGroups[pEditor->m_SelectedGroup]->m_aName, sizeof(pEditor->m_Map.m_lGroups[pEditor->m_SelectedGroup]->m_aName), 10.0f, &s_Name)) + if(pEditor->DoEditBox(&s_Name, &Button, pEditor->m_Map.m_vpGroups[pEditor->m_SelectedGroup]->m_aName, sizeof(pEditor->m_Map.m_vpGroups[pEditor->m_SelectedGroup]->m_aName), 10.0f, &s_Name)) pEditor->m_Map.m_Modified = true; } @@ -329,17 +329,17 @@ int CEditor::PopupGroup(CEditor *pEditor, CUIRect View, void *pContext) }; CProperty aProps[] = { - {"Order", pEditor->m_SelectedGroup, PROPTYPE_INT_STEP, 0, (int)pEditor->m_Map.m_lGroups.size() - 1}, - {"Pos X", -pEditor->m_Map.m_lGroups[pEditor->m_SelectedGroup]->m_OffsetX, PROPTYPE_INT_SCROLL, -1000000, 1000000}, - {"Pos Y", -pEditor->m_Map.m_lGroups[pEditor->m_SelectedGroup]->m_OffsetY, PROPTYPE_INT_SCROLL, -1000000, 1000000}, - {"Para X", pEditor->m_Map.m_lGroups[pEditor->m_SelectedGroup]->m_ParallaxX, PROPTYPE_INT_SCROLL, -1000000, 1000000}, - {"Para Y", pEditor->m_Map.m_lGroups[pEditor->m_SelectedGroup]->m_ParallaxY, PROPTYPE_INT_SCROLL, -1000000, 1000000}, + {"Order", pEditor->m_SelectedGroup, PROPTYPE_INT_STEP, 0, (int)pEditor->m_Map.m_vpGroups.size() - 1}, + {"Pos X", -pEditor->m_Map.m_vpGroups[pEditor->m_SelectedGroup]->m_OffsetX, PROPTYPE_INT_SCROLL, -1000000, 1000000}, + {"Pos Y", -pEditor->m_Map.m_vpGroups[pEditor->m_SelectedGroup]->m_OffsetY, PROPTYPE_INT_SCROLL, -1000000, 1000000}, + {"Para X", pEditor->m_Map.m_vpGroups[pEditor->m_SelectedGroup]->m_ParallaxX, PROPTYPE_INT_SCROLL, -1000000, 1000000}, + {"Para Y", pEditor->m_Map.m_vpGroups[pEditor->m_SelectedGroup]->m_ParallaxY, PROPTYPE_INT_SCROLL, -1000000, 1000000}, - {"Use Clipping", pEditor->m_Map.m_lGroups[pEditor->m_SelectedGroup]->m_UseClipping, PROPTYPE_BOOL, 0, 1}, - {"Clip X", pEditor->m_Map.m_lGroups[pEditor->m_SelectedGroup]->m_ClipX, PROPTYPE_INT_SCROLL, -1000000, 1000000}, - {"Clip Y", pEditor->m_Map.m_lGroups[pEditor->m_SelectedGroup]->m_ClipY, PROPTYPE_INT_SCROLL, -1000000, 1000000}, - {"Clip W", pEditor->m_Map.m_lGroups[pEditor->m_SelectedGroup]->m_ClipW, PROPTYPE_INT_SCROLL, 0, 1000000}, - {"Clip H", pEditor->m_Map.m_lGroups[pEditor->m_SelectedGroup]->m_ClipH, PROPTYPE_INT_SCROLL, 0, 1000000}, + {"Use Clipping", pEditor->m_Map.m_vpGroups[pEditor->m_SelectedGroup]->m_UseClipping, PROPTYPE_BOOL, 0, 1}, + {"Clip X", pEditor->m_Map.m_vpGroups[pEditor->m_SelectedGroup]->m_ClipX, PROPTYPE_INT_SCROLL, -1000000, 1000000}, + {"Clip Y", pEditor->m_Map.m_vpGroups[pEditor->m_SelectedGroup]->m_ClipY, PROPTYPE_INT_SCROLL, -1000000, 1000000}, + {"Clip W", pEditor->m_Map.m_vpGroups[pEditor->m_SelectedGroup]->m_ClipW, PROPTYPE_INT_SCROLL, 0, 1000000}, + {"Clip H", pEditor->m_Map.m_vpGroups[pEditor->m_SelectedGroup]->m_ClipH, PROPTYPE_INT_SCROLL, 0, 1000000}, {0}, }; @@ -361,23 +361,23 @@ int CEditor::PopupGroup(CEditor *pEditor, CUIRect View, void *pContext) if(!pEditor->GetSelectedGroup()->m_GameGroup) { if(Prop == PROP_PARA_X) - pEditor->m_Map.m_lGroups[pEditor->m_SelectedGroup]->m_ParallaxX = NewVal; + pEditor->m_Map.m_vpGroups[pEditor->m_SelectedGroup]->m_ParallaxX = NewVal; else if(Prop == PROP_PARA_Y) - pEditor->m_Map.m_lGroups[pEditor->m_SelectedGroup]->m_ParallaxY = NewVal; + pEditor->m_Map.m_vpGroups[pEditor->m_SelectedGroup]->m_ParallaxY = NewVal; else if(Prop == PROP_POS_X) - pEditor->m_Map.m_lGroups[pEditor->m_SelectedGroup]->m_OffsetX = -NewVal; + pEditor->m_Map.m_vpGroups[pEditor->m_SelectedGroup]->m_OffsetX = -NewVal; else if(Prop == PROP_POS_Y) - pEditor->m_Map.m_lGroups[pEditor->m_SelectedGroup]->m_OffsetY = -NewVal; + pEditor->m_Map.m_vpGroups[pEditor->m_SelectedGroup]->m_OffsetY = -NewVal; else if(Prop == PROP_USE_CLIPPING) - pEditor->m_Map.m_lGroups[pEditor->m_SelectedGroup]->m_UseClipping = NewVal; + pEditor->m_Map.m_vpGroups[pEditor->m_SelectedGroup]->m_UseClipping = NewVal; else if(Prop == PROP_CLIP_X) - pEditor->m_Map.m_lGroups[pEditor->m_SelectedGroup]->m_ClipX = NewVal; + pEditor->m_Map.m_vpGroups[pEditor->m_SelectedGroup]->m_ClipX = NewVal; else if(Prop == PROP_CLIP_Y) - pEditor->m_Map.m_lGroups[pEditor->m_SelectedGroup]->m_ClipY = NewVal; + pEditor->m_Map.m_vpGroups[pEditor->m_SelectedGroup]->m_ClipY = NewVal; else if(Prop == PROP_CLIP_W) - pEditor->m_Map.m_lGroups[pEditor->m_SelectedGroup]->m_ClipW = NewVal; + pEditor->m_Map.m_vpGroups[pEditor->m_SelectedGroup]->m_ClipW = NewVal; else if(Prop == PROP_CLIP_H) - pEditor->m_Map.m_lGroups[pEditor->m_SelectedGroup]->m_ClipH = NewVal; + pEditor->m_Map.m_vpGroups[pEditor->m_SelectedGroup]->m_ClipH = NewVal; } return 0; @@ -392,9 +392,9 @@ int CEditor::PopupLayer(CEditor *pEditor, CUIRect View, void *pContext) View.HSplitBottom(12.0f, &View, &Button); static int s_DeleteButton = 0; - if(pPopup->m_aLayers.size() > 1) + if(pPopup->m_vpLayers.size() > 1) { - return CLayerTiles::RenderCommonProperties(pPopup->m_CommonPropState, pEditor, &View, pPopup->m_aLayers); + return CLayerTiles::RenderCommonProperties(pPopup->m_CommonPropState, pEditor, &View, pPopup->m_vpLayers); } // don't allow deletion of game layer @@ -411,7 +411,7 @@ int CEditor::PopupLayer(CEditor *pEditor, CUIRect View, void *pContext) pEditor->m_Map.m_pSwitchLayer = 0x0; if(pEditor->GetSelectedLayer(0) == pEditor->m_Map.m_pTuneLayer) pEditor->m_Map.m_pTuneLayer = 0x0; - pEditor->m_Map.m_lGroups[pEditor->m_SelectedGroup]->DeleteLayer(pEditor->m_lSelectedLayers[0]); + pEditor->m_Map.m_vpGroups[pEditor->m_SelectedGroup]->DeleteLayer(pEditor->m_vSelectedLayers[0]); return 1; } @@ -430,7 +430,7 @@ int CEditor::PopupLayer(CEditor *pEditor, CUIRect View, void *pContext) View.HSplitBottom(10.0f, &View, 0); - CLayerGroup *pCurrentGroup = pEditor->m_Map.m_lGroups[pEditor->m_SelectedGroup]; + CLayerGroup *pCurrentGroup = pEditor->m_Map.m_vpGroups[pEditor->m_SelectedGroup]; CLayer *pCurrentLayer = pEditor->GetSelectedLayer(0); enum @@ -442,8 +442,8 @@ int CEditor::PopupLayer(CEditor *pEditor, CUIRect View, void *pContext) }; CProperty aProps[] = { - {"Group", pEditor->m_SelectedGroup, PROPTYPE_INT_STEP, 0, (int)pEditor->m_Map.m_lGroups.size() - 1}, - {"Order", pEditor->m_lSelectedLayers[0], PROPTYPE_INT_STEP, 0, (int)pCurrentGroup->m_lLayers.size()}, + {"Group", pEditor->m_SelectedGroup, PROPTYPE_INT_STEP, 0, (int)pEditor->m_Map.m_vpGroups.size() - 1}, + {"Order", pEditor->m_vSelectedLayers[0], PROPTYPE_INT_STEP, 0, (int)pCurrentGroup->m_vpLayers.size()}, {"Detail", pCurrentLayer && pCurrentLayer->m_Flags & LAYERFLAG_DETAIL, PROPTYPE_BOOL, 0, 1}, {0}, }; @@ -462,17 +462,17 @@ int CEditor::PopupLayer(CEditor *pEditor, CUIRect View, void *pContext) pEditor->m_Map.m_Modified = true; if(Prop == PROP_ORDER) - pEditor->SelectLayer(pCurrentGroup->SwapLayers(pEditor->m_lSelectedLayers[0], NewVal)); + pEditor->SelectLayer(pCurrentGroup->SwapLayers(pEditor->m_vSelectedLayers[0], NewVal)); else if(Prop == PROP_GROUP && pCurrentLayer && pCurrentLayer->m_Type != LAYERTYPE_GAME) { - if(NewVal >= 0 && (size_t)NewVal < pEditor->m_Map.m_lGroups.size()) + if(NewVal >= 0 && (size_t)NewVal < pEditor->m_Map.m_vpGroups.size()) { - auto Position = std::find(pCurrentGroup->m_lLayers.begin(), pCurrentGroup->m_lLayers.end(), pCurrentLayer); - if(Position != pCurrentGroup->m_lLayers.end()) - pCurrentGroup->m_lLayers.erase(Position); - pEditor->m_Map.m_lGroups[NewVal]->m_lLayers.push_back(pCurrentLayer); + auto Position = std::find(pCurrentGroup->m_vpLayers.begin(), pCurrentGroup->m_vpLayers.end(), pCurrentLayer); + if(Position != pCurrentGroup->m_vpLayers.end()) + pCurrentGroup->m_vpLayers.erase(Position); + pEditor->m_Map.m_vpGroups[NewVal]->m_vpLayers.push_back(pCurrentLayer); pEditor->m_SelectedGroup = NewVal; - pEditor->SelectLayer(pEditor->m_Map.m_lGroups[NewVal]->m_lLayers.size() - 1); + pEditor->SelectLayer(pEditor->m_Map.m_vpGroups[NewVal]->m_vpLayers.size() - 1); } } else if(Prop == PROP_HQ && pCurrentLayer) @@ -512,7 +512,7 @@ int CEditor::PopupQuad(CEditor *pEditor, CUIRect View, void *pContext) View.HSplitBottom(10.0f, &View, &Button); View.HSplitBottom(12.0f, &View, &Button); CLayerQuads *pLayer = (CLayerQuads *)pEditor->GetSelectedLayerType(0, LAYERTYPE_QUADS); - if(pLayer && pLayer->m_Image >= 0 && (size_t)pLayer->m_Image < pEditor->m_Map.m_lImages.size()) + if(pLayer && pLayer->m_Image >= 0 && (size_t)pLayer->m_Image < pEditor->m_Map.m_vpImages.size()) { static int s_AspectRatioButton = 0; if(pEditor->DoButton_Editor(&s_AspectRatioButton, "Aspect ratio", 0, &Button, 0, "Resizes the current Quad based on the aspect ratio of the image")) @@ -533,7 +533,7 @@ int CEditor::PopupQuad(CEditor *pEditor, CUIRect View, void *pContext) Right = pQuad->m_aPoints[k].x; } - int Height = (Right - Left) * pEditor->m_Map.m_lImages[pLayer->m_Image]->m_Height / pEditor->m_Map.m_lImages[pLayer->m_Image]->m_Width; + int Height = (Right - Left) * pEditor->m_Map.m_vpImages[pLayer->m_Image]->m_Height / pEditor->m_Map.m_vpImages[pLayer->m_Image]->m_Width; pQuad->m_aPoints[0].x = Left; pQuad->m_aPoints[0].y = Top; @@ -661,12 +661,12 @@ int CEditor::PopupQuad(CEditor *pEditor, CUIRect View, void *pContext) } if(Prop == PROP_POS_ENV) { - int Index = clamp(NewVal - 1, -1, (int)pEditor->m_Map.m_lEnvelopes.size() - 1); + int Index = clamp(NewVal - 1, -1, (int)pEditor->m_Map.m_vpEnvelopes.size() - 1); int Step = (Index - pQuad->m_PosEnv) % 2; if(Step != 0) { - for(; Index >= -1 && Index < (int)pEditor->m_Map.m_lEnvelopes.size(); Index += Step) - if(Index == -1 || pEditor->m_Map.m_lEnvelopes[Index]->m_Channels == 3) + for(; Index >= -1 && Index < (int)pEditor->m_Map.m_vpEnvelopes.size(); Index += Step) + if(Index == -1 || pEditor->m_Map.m_vpEnvelopes[Index]->m_Channels == 3) { pQuad->m_PosEnv = Index; break; @@ -677,12 +677,12 @@ int CEditor::PopupQuad(CEditor *pEditor, CUIRect View, void *pContext) pQuad->m_PosEnvOffset = NewVal; if(Prop == PROP_COLOR_ENV) { - int Index = clamp(NewVal - 1, -1, (int)pEditor->m_Map.m_lEnvelopes.size() - 1); + int Index = clamp(NewVal - 1, -1, (int)pEditor->m_Map.m_vpEnvelopes.size() - 1); int Step = (Index - pQuad->m_ColorEnv) % 2; if(Step != 0) { - for(; Index >= -1 && Index < (int)pEditor->m_Map.m_lEnvelopes.size(); Index += Step) - if(Index == -1 || pEditor->m_Map.m_lEnvelopes[Index]->m_Channels == 4) + for(; Index >= -1 && Index < (int)pEditor->m_Map.m_vpEnvelopes.size(); Index += Step) + if(Index == -1 || pEditor->m_Map.m_vpEnvelopes[Index]->m_Channels == 4) { pQuad->m_ColorEnv = Index; break; @@ -711,7 +711,7 @@ int CEditor::PopupSource(CEditor *pEditor, CUIRect View, void *pContext) if(pLayer) { pEditor->m_Map.m_Modified = true; - pLayer->m_lSources.erase(pLayer->m_lSources.begin() + pEditor->m_SelectedSource); + pLayer->m_vSources.erase(pLayer->m_vSources.begin() + pEditor->m_SelectedSource); pEditor->m_SelectedSource--; } return 1; @@ -800,12 +800,12 @@ int CEditor::PopupSource(CEditor *pEditor, CUIRect View, void *pContext) pSource->m_Falloff = NewVal; if(Prop == PROP_POS_ENV) { - int Index = clamp(NewVal - 1, -1, (int)pEditor->m_Map.m_lEnvelopes.size() - 1); + int Index = clamp(NewVal - 1, -1, (int)pEditor->m_Map.m_vpEnvelopes.size() - 1); int Step = (Index - pSource->m_PosEnv) % 2; if(Step != 0) { - for(; Index >= -1 && Index < (int)pEditor->m_Map.m_lEnvelopes.size(); Index += Step) - if(Index == -1 || pEditor->m_Map.m_lEnvelopes[Index]->m_Channels == 3) + for(; Index >= -1 && Index < (int)pEditor->m_Map.m_vpEnvelopes.size(); Index += Step) + if(Index == -1 || pEditor->m_Map.m_vpEnvelopes[Index]->m_Channels == 3) { pSource->m_PosEnv = Index; break; @@ -816,12 +816,12 @@ int CEditor::PopupSource(CEditor *pEditor, CUIRect View, void *pContext) pSource->m_PosEnvOffset = NewVal; if(Prop == PROP_SOUND_ENV) { - int Index = clamp(NewVal - 1, -1, (int)pEditor->m_Map.m_lEnvelopes.size() - 1); + int Index = clamp(NewVal - 1, -1, (int)pEditor->m_Map.m_vpEnvelopes.size() - 1); int Step = (Index - pSource->m_SoundEnv) % 2; if(Step != 0) { - for(; Index >= -1 && Index < (int)pEditor->m_Map.m_lEnvelopes.size(); Index += Step) - if(Index == -1 || pEditor->m_Map.m_lEnvelopes[Index]->m_Channels == 1) + for(; Index >= -1 && Index < (int)pEditor->m_Map.m_vpEnvelopes.size(); Index += Step) + if(Index == -1 || pEditor->m_Map.m_vpEnvelopes[Index]->m_Channels == 1) { pSource->m_SoundEnv = Index; break; @@ -925,7 +925,7 @@ int CEditor::PopupPoint(CEditor *pEditor, CUIRect View, void *pContext) CProperty aProps[] = { {"Pos X", x, PROPTYPE_INT_SCROLL, -1000000, 1000000}, {"Pos Y", y, PROPTYPE_INT_SCROLL, -1000000, 1000000}, - {"Color", Color, PROPTYPE_COLOR, -1, (int)pEditor->m_Map.m_lEnvelopes.size()}, + {"Color", Color, PROPTYPE_COLOR, -1, (int)pEditor->m_Map.m_vpEnvelopes.size()}, {"Tex U", tu, PROPTYPE_INT_SCROLL, -1000000, 1000000}, {"Tex V", tv, PROPTYPE_INT_SCROLL, -1000000, 1000000}, {0}, @@ -1225,10 +1225,10 @@ int CEditor::PopupSelectImage(CEditor *pEditor, CUIRect View, void *pContext) int ShowImage = g_SelectImageCurrent; static float s_ScrollValue = 0; - float ImagesHeight = pEditor->m_Map.m_lImages.size() * 14; + float ImagesHeight = pEditor->m_Map.m_vpImages.size() * 14; float ScrollDifference = ImagesHeight - ButtonBar.h; - if(pEditor->m_Map.m_lImages.size() > 20) // Do we need a scrollbar? + if(pEditor->m_Map.m_vpImages.size() > 20) // Do we need a scrollbar? { CUIRect Scroll; ButtonBar.VSplitRight(20.0f, &ButtonBar, &Scroll); @@ -1253,7 +1253,7 @@ int CEditor::PopupSelectImage(CEditor *pEditor, CUIRect View, void *pContext) float ImageStopAt = ImagesHeight - ScrollDifference * (1 - s_ScrollValue); float ImageCur = 0.0f; - for(int i = -1; i < (int)pEditor->m_Map.m_lImages.size(); i++) + for(int i = -1; i < (int)pEditor->m_Map.m_vpImages.size(); i++) { if(ImageCur > ImageStopAt) break; @@ -1272,26 +1272,26 @@ int CEditor::PopupSelectImage(CEditor *pEditor, CUIRect View, void *pContext) if(i == -1) { - if(pEditor->DoButton_MenuItem(&pEditor->m_Map.m_lImages[i], "None", i == g_SelectImageCurrent, &Button)) + if(pEditor->DoButton_MenuItem(&pEditor->m_Map.m_vpImages[i], "None", i == g_SelectImageCurrent, &Button)) g_SelectImageSelected = -1; } else { - if(pEditor->DoButton_MenuItem(&pEditor->m_Map.m_lImages[i], pEditor->m_Map.m_lImages[i]->m_aName, i == g_SelectImageCurrent, &Button)) + if(pEditor->DoButton_MenuItem(&pEditor->m_Map.m_vpImages[i], pEditor->m_Map.m_vpImages[i]->m_aName, i == g_SelectImageCurrent, &Button)) g_SelectImageSelected = i; } } - if(ShowImage >= 0 && (size_t)ShowImage < pEditor->m_Map.m_lImages.size()) + if(ShowImage >= 0 && (size_t)ShowImage < pEditor->m_Map.m_vpImages.size()) { if(ImageView.h < ImageView.w) ImageView.w = ImageView.h; else ImageView.h = ImageView.w; - float Max = (float)(maximum(pEditor->m_Map.m_lImages[ShowImage]->m_Width, pEditor->m_Map.m_lImages[ShowImage]->m_Height)); - ImageView.w *= pEditor->m_Map.m_lImages[ShowImage]->m_Width / Max; - ImageView.h *= pEditor->m_Map.m_lImages[ShowImage]->m_Height / Max; - pEditor->Graphics()->TextureSet(pEditor->m_Map.m_lImages[ShowImage]->m_Texture); + float Max = (float)(maximum(pEditor->m_Map.m_vpImages[ShowImage]->m_Width, pEditor->m_Map.m_vpImages[ShowImage]->m_Height)); + ImageView.w *= pEditor->m_Map.m_vpImages[ShowImage]->m_Width / Max; + ImageView.h *= pEditor->m_Map.m_vpImages[ShowImage]->m_Height / Max; + pEditor->Graphics()->TextureSet(pEditor->m_Map.m_vpImages[ShowImage]->m_Texture); pEditor->Graphics()->BlendNormal(); pEditor->Graphics()->WrapClamp(); pEditor->Graphics()->QuadsBegin(); @@ -1332,10 +1332,10 @@ int CEditor::PopupSelectSound(CEditor *pEditor, CUIRect View, void *pContext) View.Margin(10.0f, &SoundView); static float s_ScrollValue = 0; - float SoundsHeight = pEditor->m_Map.m_lSounds.size() * 14; + float SoundsHeight = pEditor->m_Map.m_vpSounds.size() * 14; float ScrollDifference = SoundsHeight - ButtonBar.h; - if(pEditor->m_Map.m_lSounds.size() > 20) // Do we need a scrollbar? + if(pEditor->m_Map.m_vpSounds.size() > 20) // Do we need a scrollbar? { CUIRect Scroll; ButtonBar.VSplitRight(20.0f, &ButtonBar, &Scroll); @@ -1360,7 +1360,7 @@ int CEditor::PopupSelectSound(CEditor *pEditor, CUIRect View, void *pContext) float SoundStopAt = SoundsHeight - ScrollDifference * (1 - s_ScrollValue); float SoundCur = 0.0f; - for(int i = -1; i < (int)pEditor->m_Map.m_lSounds.size(); i++) + for(int i = -1; i < (int)pEditor->m_Map.m_vpSounds.size(); i++) { if(SoundCur > SoundStopAt) break; @@ -1379,12 +1379,12 @@ int CEditor::PopupSelectSound(CEditor *pEditor, CUIRect View, void *pContext) if(i == -1) { - if(pEditor->DoButton_MenuItem(&pEditor->m_Map.m_lSounds[i], "None", i == g_SelectSoundCurrent, &Button)) + if(pEditor->DoButton_MenuItem(&pEditor->m_Map.m_vpSounds[i], "None", i == g_SelectSoundCurrent, &Button)) g_SelectSoundSelected = -1; } else { - if(pEditor->DoButton_MenuItem(&pEditor->m_Map.m_lSounds[i], pEditor->m_Map.m_lSounds[i]->m_aName, i == g_SelectSoundCurrent, &Button)) + if(pEditor->DoButton_MenuItem(&pEditor->m_Map.m_vpSounds[i], pEditor->m_Map.m_vpSounds[i]->m_aName, i == g_SelectSoundCurrent, &Button)) g_SelectSoundSelected = i; } } @@ -1468,7 +1468,7 @@ int CEditor::PopupSelectConfigAutoMap(CEditor *pEditor, CUIRect View, void *pCon CLayerTiles *pLayer = static_cast(pEditor->GetSelectedLayer(0)); CUIRect Button; static int s_AutoMapperConfigButtons[256]; - CAutoMapper *pAutoMapper = &pEditor->m_Map.m_lImages[pLayer->m_Image]->m_AutoMapper; + CAutoMapper *pAutoMapper = &pEditor->m_Map.m_vpImages[pLayer->m_Image]->m_AutoMapper; const float ButtonHeight = 12.0f; const float ButtonMargin = 2.0f; @@ -1540,7 +1540,7 @@ void CEditor::PopupSelectConfigAutoMapInvoke(int Current, float x, float y) s_AutoMapConfigSelected = -100; s_AutoMapConfigCurrent = Current; CLayerTiles *pLayer = static_cast(GetSelectedLayer(0)); - int ItemCount = m_Map.m_lImages[pLayer->m_Image]->m_AutoMapper.ConfigNamesNum(); + int ItemCount = m_Map.m_vpImages[pLayer->m_Image]->m_AutoMapper.ConfigNamesNum(); if(ItemCount > 10) ItemCount = 10; // Width for buttons is 120, 15 is the scrollbar width, 2 is the margin between both. @@ -1864,18 +1864,18 @@ int CEditor::PopupColorPicker(CEditor *pEditor, CUIRect View, void *pContext) int CEditor::PopupEntities(CEditor *pEditor, CUIRect View, void *pContext) { - for(int i = 0; i < (int)pEditor->m_SelectEntitiesFiles.size(); i++) + for(int i = 0; i < (int)pEditor->m_vSelectEntitiesFiles.size(); i++) { CUIRect Button; View.HSplitTop(14.0f, &Button, &View); - const char *Name = pEditor->m_SelectEntitiesFiles[i].c_str(); + const char *Name = pEditor->m_vSelectEntitiesFiles[i].c_str(); - if(pEditor->DoButton_MenuItem(Name, Name, pEditor->m_SelectEntitiesFiles[i] == pEditor->m_SelectEntitiesImage, &Button)) + if(pEditor->DoButton_MenuItem(Name, Name, pEditor->m_vSelectEntitiesFiles[i] == pEditor->m_SelectEntitiesImage, &Button)) { - if(pEditor->m_SelectEntitiesFiles[i] != pEditor->m_SelectEntitiesImage) + if(pEditor->m_vSelectEntitiesFiles[i] != pEditor->m_SelectEntitiesImage) { - pEditor->m_SelectEntitiesImage = pEditor->m_SelectEntitiesFiles[i]; + pEditor->m_SelectEntitiesImage = pEditor->m_vSelectEntitiesFiles[i]; pEditor->m_AllowPlaceUnusedTiles = pEditor->m_SelectEntitiesImage == "DDNet" ? 0 : -1; pEditor->m_PreventUnusedTilesWasWarned = false; diff --git a/src/game/gamecore.cpp b/src/game/gamecore.cpp index 30b738c85..6b6f6f783 100644 --- a/src/game/gamecore.cpp +++ b/src/game/gamecore.cpp @@ -652,20 +652,20 @@ void CCharacterCore::SetTeleOuts(std::map> *pTeleOuts) bool CCharacterCore::IsSwitchActiveCb(int Number, void *pUser) { CCharacterCore *pThis = (CCharacterCore *)pUser; - if(pThis->m_pWorld && !pThis->m_pWorld->m_aSwitchers.empty()) + if(pThis->m_pWorld && !pThis->m_pWorld->m_vSwitchers.empty()) if(pThis->m_Id != -1 && pThis->m_pTeams->Team(pThis->m_Id) != (pThis->m_pTeams->m_IsDDRace16 ? VANILLA_TEAM_SUPER : TEAM_SUPER)) - return pThis->m_pWorld->m_aSwitchers[Number].m_Status[pThis->m_pTeams->Team(pThis->m_Id)]; + return pThis->m_pWorld->m_vSwitchers[Number].m_Status[pThis->m_pTeams->Team(pThis->m_Id)]; return false; } void CWorldCore::InitSwitchers(int HighestSwitchNumber) { if(HighestSwitchNumber > 0) - m_aSwitchers.resize(HighestSwitchNumber + 1); + m_vSwitchers.resize(HighestSwitchNumber + 1); else - m_aSwitchers.clear(); + m_vSwitchers.clear(); - for(auto &Switcher : m_aSwitchers) + for(auto &Switcher : m_vSwitchers) { Switcher.m_Initial = true; for(int j = 0; j < MAX_CLIENTS; j++) diff --git a/src/game/gamecore.h b/src/game/gamecore.h index 0d6cb39a7..bbf348f9d 100644 --- a/src/game/gamecore.h +++ b/src/game/gamecore.h @@ -209,7 +209,7 @@ public: CPrng *m_pPrng; void InitSwitchers(int HighestSwitchNumber); - std::vector m_aSwitchers; + std::vector m_vSwitchers; }; class CCharacterCore diff --git a/src/game/localization.cpp b/src/game/localization.cpp index 7ec913a05..240cc6fc6 100644 --- a/src/game/localization.cpp +++ b/src/game/localization.cpp @@ -37,7 +37,7 @@ CLocalizationDatabase::CLocalizationDatabase() void CLocalizationDatabase::AddString(const char *pOrgStr, const char *pNewStr, const char *pContext) { - m_Strings.emplace_back(str_quickhash(pOrgStr), str_quickhash(pContext), m_StringsHeap.StoreString(*pNewStr ? pNewStr : pOrgStr)); + m_vStrings.emplace_back(str_quickhash(pOrgStr), str_quickhash(pContext), m_StringsHeap.StoreString(*pNewStr ? pNewStr : pOrgStr)); } bool CLocalizationDatabase::Load(const char *pFilename, IStorage *pStorage, IConsole *pConsole) @@ -45,7 +45,7 @@ bool CLocalizationDatabase::Load(const char *pFilename, IStorage *pStorage, ICon // empty string means unload if(pFilename[0] == 0) { - m_Strings.clear(); + m_vStrings.clear(); m_StringsHeap.Reset(); m_CurrentVersion = 0; return true; @@ -58,7 +58,7 @@ bool CLocalizationDatabase::Load(const char *pFilename, IStorage *pStorage, ICon char aBuf[256]; str_format(aBuf, sizeof(aBuf), "loaded '%s'", pFilename); pConsole->Print(IConsole::OUTPUT_LEVEL_ADDINFO, "localization", aBuf); - m_Strings.clear(); + m_vStrings.clear(); m_StringsHeap.Reset(); char aContext[512]; @@ -113,7 +113,7 @@ bool CLocalizationDatabase::Load(const char *pFilename, IStorage *pStorage, ICon AddString(aOrigin, pReplacement, aContext); } io_close(IoHandle); - std::sort(m_Strings.begin(), m_Strings.end()); + std::sort(m_vStrings.begin(), m_vStrings.end()); m_CurrentVersion = ++m_VersionCounter; return true; @@ -125,7 +125,7 @@ const char *CLocalizationDatabase::FindString(unsigned Hash, unsigned ContextHas String.m_Hash = Hash; String.m_ContextHash = ContextHash; String.m_pReplacement = 0x0; - auto Range1 = std::equal_range(m_Strings.begin(), m_Strings.end(), String); + auto Range1 = std::equal_range(m_vStrings.begin(), m_vStrings.end(), String); if(std::distance(Range1.first, Range1.second) == 1) return Range1.first->m_pReplacement; @@ -134,7 +134,7 @@ const char *CLocalizationDatabase::FindString(unsigned Hash, unsigned ContextHas { // Do another lookup with the default context hash String.m_ContextHash = DefaultHash; - auto Range2 = std::equal_range(m_Strings.begin(), m_Strings.end(), String); + auto Range2 = std::equal_range(m_vStrings.begin(), m_vStrings.end(), String); if(std::distance(Range2.first, Range2.second) == 1) return Range2.first->m_pReplacement; } diff --git a/src/game/localization.h b/src/game/localization.h index 36d1422bb..bf202489e 100644 --- a/src/game/localization.h +++ b/src/game/localization.h @@ -27,7 +27,7 @@ class CLocalizationDatabase bool operator==(const CString &Other) const { return m_Hash == Other.m_Hash && m_ContextHash == Other.m_ContextHash; } }; - std::vector m_Strings; + std::vector m_vStrings; CHeap m_StringsHeap; int m_VersionCounter; int m_CurrentVersion; diff --git a/src/game/server/entity.h b/src/game/server/entity.h index 345e67dd5..71418bbc6 100644 --- a/src/game/server/entity.h +++ b/src/game/server/entity.h @@ -58,7 +58,7 @@ public: // TODO: Maybe make protected virtual ~CEntity(); /* Objects */ - std::vector &Switchers() { return m_pGameWorld->m_Core.m_aSwitchers; } + std::vector &Switchers() { return m_pGameWorld->m_Core.m_vSwitchers; } class CGameWorld *GameWorld() { return m_pGameWorld; } class CConfig *Config() { return m_pGameWorld->Config(); } class CGameContext *GameServer() { return m_pGameWorld->GameServer(); } diff --git a/src/game/server/gamecontext.h b/src/game/server/gamecontext.h index 8ec778878..b4663aebe 100644 --- a/src/game/server/gamecontext.h +++ b/src/game/server/gamecontext.h @@ -161,7 +161,7 @@ public: // helper functions class CCharacter *GetPlayerChar(int ClientID); bool EmulateBug(int Bug); - std::vector &Switchers() { return m_World.m_Core.m_aSwitchers; } + std::vector &Switchers() { return m_World.m_Core.m_vSwitchers; } // voting void StartVote(const char *pDesc, const char *pCommand, const char *pReason, const char *pSixupDesc); diff --git a/src/game/server/score.cpp b/src/game/server/score.cpp index 7d9d402b4..9ca4fa356 100644 --- a/src/game/server/score.cpp +++ b/src/game/server/score.cpp @@ -63,8 +63,8 @@ void CScore::GeneratePassphrase(char *pBuf, int BufSize) if(i != 0) str_append(pBuf, " ", BufSize); // TODO: decide if the slight bias towards lower numbers is ok - int Rand = m_Prng.RandomBits() % m_aWordlist.size(); - str_append(pBuf, m_aWordlist[Rand].c_str(), BufSize); + int Rand = m_Prng.RandomBits() % m_vWordlist.size(); + str_append(pBuf, m_vWordlist[Rand].c_str(), BufSize); } } @@ -93,17 +93,17 @@ CScore::CScore(CGameContext *pGameServer, CDbConnectionPool *pPool) : char aWord[32] = {0}; sscanf(pLine, "%*s %31s", aWord); aWord[31] = 0; - m_aWordlist.emplace_back(aWord); + m_vWordlist.emplace_back(aWord); } io_close(File); } else { dbg_msg("sql", "failed to open wordlist, using fallback"); - m_aWordlist.assign(std::begin(g_aFallbackWordlist), std::end(g_aFallbackWordlist)); + m_vWordlist.assign(std::begin(g_aFallbackWordlist), std::end(g_aFallbackWordlist)); } - if(m_aWordlist.size() < 1000) + if(m_vWordlist.size() < 1000) { dbg_msg("sql", "too few words in wordlist"); Server()->SetErrorShutdown("sql too few words in wordlist"); diff --git a/src/game/server/score.h b/src/game/server/score.h index 2f5e692e4..6ab15d968 100644 --- a/src/game/server/score.h +++ b/src/game/server/score.h @@ -19,7 +19,7 @@ class CScore CGameContext *m_pGameServer; IServer *m_pServer; - std::vector m_aWordlist; + std::vector m_vWordlist; CPrng m_Prng; void GeneratePassphrase(char *pBuf, int BufSize); diff --git a/src/test/test.cpp b/src/test/test.cpp index de0c09bb8..7e3c01026 100644 --- a/src/test/test.cpp +++ b/src/test/test.cpp @@ -47,7 +47,7 @@ class CTestCollectData { public: char m_aCurrentDir[IO_MAX_PATH_LENGTH]; - std::vector *m_paEntries; + std::vector *m_pvEntries; }; int TestCollect(const char *pName, int IsDir, int Unused, void *pUser) @@ -62,12 +62,12 @@ int TestCollect(const char *pName, int IsDir, int Unused, void *pUser) CTestInfoPath Path; Path.m_IsDirectory = IsDir; str_format(Path.m_aData, sizeof(Path.m_aData), "%s/%s", pData->m_aCurrentDir, pName); - pData->m_paEntries->push_back(Path); + pData->m_pvEntries->push_back(Path); if(Path.m_IsDirectory) { CTestCollectData DataRecursive; str_copy(DataRecursive.m_aCurrentDir, Path.m_aData, sizeof(DataRecursive.m_aCurrentDir)); - DataRecursive.m_paEntries = pData->m_paEntries; + DataRecursive.m_pvEntries = pData->m_pvEntries; fs_listdir(DataRecursive.m_aCurrentDir, TestCollect, 0, &DataRecursive); } return 0; @@ -78,7 +78,7 @@ void TestDeleteTestStorageFiles(const char *pPath) std::vector aEntries; CTestCollectData Data; str_copy(Data.m_aCurrentDir, pPath, sizeof(Data.m_aCurrentDir)); - Data.m_paEntries = &aEntries; + Data.m_pvEntries = &aEntries; fs_listdir(Data.m_aCurrentDir, TestCollect, 0, &Data); CTestInfoPath Path;