chore(gx): improve more param and variable names

This commit is contained in:
fallenoak 2025-12-21 13:16:18 -06:00
parent 30fd02c942
commit da51f7e4fc
No known key found for this signature in database
GPG Key ID: 7628F8E61AEA070D
3 changed files with 12 additions and 12 deletions

View File

@ -641,20 +641,20 @@ void CGxString::Tick() {
} }
} }
void CGxString::WriteGeometry(CGxVertexPCT* buf, int32_t line, int32_t ofs, int32_t size) { void CGxString::WriteGeometry(CGxVertexPCT* buffer, int32_t lineIndex, int32_t vertexOffset, int32_t vertexCount) {
auto textLine = this->m_textLines[line]; auto textLine = this->m_textLines[lineIndex];
if (textLine) { if (textLine) {
textLine->WriteGeometry( textLine->WriteGeometry(
buf, buffer,
this->m_fontColor, this->m_fontColor,
this->m_shadowOffset, this->m_shadowOffset,
this->m_shadowColor, this->m_shadowColor,
this->m_viewTranslation, this->m_viewTranslation,
this->m_flags & EGxStringFlags_DropShadow, this->m_flags & EGxStringFlags_DropShadow,
this->m_flags & EGxStringFlags_Flag20, this->m_flags & EGxStringFlags_Flag20,
ofs, vertexOffset,
size vertexCount
); );
} }
} }

View File

@ -27,7 +27,7 @@ class TEXTLINETEXTURE {
TSGrowableArray<CImVector> m_colors; TSGrowableArray<CImVector> m_colors;
// Member functions // 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<CGxString> { class CGxString : public TSLinkedNode<CGxString> {
@ -79,7 +79,7 @@ class CGxString : public TSLinkedNode<CGxString> {
int32_t SetGradient(int32_t startCharacter, int32_t length); int32_t SetGradient(int32_t startCharacter, int32_t length);
void SetStringPosition(const C3Vector& position); void SetStringPosition(const C3Vector& position);
void Tick(); 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 #endif

View File

@ -146,8 +146,8 @@ void BATCHEDRENDERFONTDESC::RenderBatch() {
char* vertexData = g_theGxDevicePtr->BufLock(vertexStream); char* vertexData = g_theGxDevicePtr->BufLock(vertexStream);
CGxVertexPCT* vertexBuf = reinterpret_cast<CGxVertexPCT*>(vertexData); CGxVertexPCT* vertexBuf = reinterpret_cast<CGxVertexPCT*>(vertexData);
for (int32_t i = 0; i < 8; i++) { for (int32_t lineIndex = 0; lineIndex < 8; lineIndex++) {
auto& textureCache = this->m_face->m_textureCache[i]; auto& textureCache = this->m_face->m_textureCache[lineIndex];
auto texture = textureCache.m_texture; auto texture = textureCache.m_texture;
if (!texture) { if (!texture) {
@ -163,19 +163,19 @@ void BATCHEDRENDERFONTDESC::RenderBatch() {
GxRsSet(GxRs_Texture0, gxTex); GxRsSet(GxRs_Texture0, gxTex);
for (auto string = this->m_strings.Head(); string; string = this->m_strings.Next(string)) { 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) { if (!line) {
continue; continue;
} }
int32_t vertsNeeded = string->CalculateVertsNeeded(i); int32_t vertsNeeded = string->CalculateVertsNeeded(lineIndex);
int32_t sliceOffset = 0; int32_t sliceOffset = 0;
while (vertsNeeded) { while (vertsNeeded) {
int32_t sliceCount = std::min(vertsNeeded, batchCapacity); int32_t sliceCount = std::min(vertsNeeded, batchCapacity);
string->WriteGeometry(vertexBuf, i, sliceOffset, sliceCount); string->WriteGeometry(vertexBuf, lineIndex, sliceOffset, sliceCount);
vertsNeeded -= sliceCount; vertsNeeded -= sliceCount;
sliceOffset += sliceCount; sliceOffset += sliceCount;