diff --git a/src/gx/font/CGxString.cpp b/src/gx/font/CGxString.cpp index b8970db..7fc9ea1 100644 --- a/src/gx/font/CGxString.cpp +++ b/src/gx/font/CGxString.cpp @@ -641,20 +641,20 @@ void CGxString::Tick() { } } -void CGxString::WriteGeometry(CGxVertexPCT* buf, int32_t line, int32_t ofs, int32_t size) { - auto textLine = this->m_textLines[line]; +void CGxString::WriteGeometry(CGxVertexPCT* buffer, int32_t lineIndex, int32_t vertexOffset, int32_t vertexCount) { + auto textLine = this->m_textLines[lineIndex]; if (textLine) { textLine->WriteGeometry( - buf, + buffer, this->m_fontColor, this->m_shadowOffset, this->m_shadowColor, this->m_viewTranslation, this->m_flags & EGxStringFlags_DropShadow, this->m_flags & EGxStringFlags_Flag20, - ofs, - size + vertexOffset, + vertexCount ); } } diff --git a/src/gx/font/CGxString.hpp b/src/gx/font/CGxString.hpp index 3e57e26..e4d2619 100644 --- a/src/gx/font/CGxString.hpp +++ b/src/gx/font/CGxString.hpp @@ -27,7 +27,7 @@ class TEXTLINETEXTURE { TSGrowableArray m_colors; // Member functions - void WriteGeometry(CGxVertexPCT*, const CImVector&, const C2Vector&, const CImVector&, const C3Vector&, bool hasShadow, bool, int32_t vertexOffset, int32_t vertexCount); + void WriteGeometry(CGxVertexPCT* buffer, const CImVector& fontColor, const C2Vector& shadowOffset, const CImVector& shadowColor, const C3Vector& viewTranslation, bool hasShadow, bool a8, int32_t vertexOffset, int32_t vertexCount); }; class CGxString : public TSLinkedNode { @@ -79,7 +79,7 @@ class CGxString : public TSLinkedNode { int32_t SetGradient(int32_t startCharacter, int32_t length); void SetStringPosition(const C3Vector& position); void Tick(); - void WriteGeometry(CGxVertexPCT* buf, int32_t line, int32_t ofs, int32_t size); + void WriteGeometry(CGxVertexPCT* buffer, int32_t lineIndex, int32_t vertexOffset, int32_t vertexCount); }; #endif diff --git a/src/gx/font/CGxStringBatch.cpp b/src/gx/font/CGxStringBatch.cpp index 04b408e..3ba0c5d 100644 --- a/src/gx/font/CGxStringBatch.cpp +++ b/src/gx/font/CGxStringBatch.cpp @@ -146,8 +146,8 @@ void BATCHEDRENDERFONTDESC::RenderBatch() { char* vertexData = g_theGxDevicePtr->BufLock(vertexStream); CGxVertexPCT* vertexBuf = reinterpret_cast(vertexData); - for (int32_t i = 0; i < 8; i++) { - auto& textureCache = this->m_face->m_textureCache[i]; + for (int32_t lineIndex = 0; lineIndex < 8; lineIndex++) { + auto& textureCache = this->m_face->m_textureCache[lineIndex]; auto texture = textureCache.m_texture; if (!texture) { @@ -163,19 +163,19 @@ void BATCHEDRENDERFONTDESC::RenderBatch() { GxRsSet(GxRs_Texture0, gxTex); for (auto string = this->m_strings.Head(); string; string = this->m_strings.Next(string)) { - auto line = string->m_textLines[i]; + auto line = string->m_textLines[lineIndex]; if (!line) { continue; } - int32_t vertsNeeded = string->CalculateVertsNeeded(i); + int32_t vertsNeeded = string->CalculateVertsNeeded(lineIndex); int32_t sliceOffset = 0; while (vertsNeeded) { int32_t sliceCount = std::min(vertsNeeded, batchCapacity); - string->WriteGeometry(vertexBuf, i, sliceOffset, sliceCount); + string->WriteGeometry(vertexBuf, lineIndex, sliceOffset, sliceCount); vertsNeeded -= sliceCount; sliceOffset += sliceCount;