Skip to content

Commit 9aca65a

Browse files
zcanannclaude
andcommitted
Grind main/menu_compa: CompaDraw signed->unsigned char alpha cast (clrlwi byte-mask)
Line 295 SetColor passed the alpha as static_cast<signed char>, but the target emits a clrlwi r7,r0,24 (unsigned-byte zero-extend) before the CColor(Uc,Uc,Uc,Uc) constructor call (Ghidra 80160edc row ~571, __ct__6CColorFUcUcUcUc 4th arg). The sibling SetColor at line 341 already uses static_cast<unsigned char>; making line 295 consistent matches the byte-mask the original emitted. CompaDraw misalign 23 -> 21; unit fuzzy 95.749 -> 95.864. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
1 parent 7fd58d6 commit 9aca65a

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/menu_compa.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -292,7 +292,7 @@ void CMenuPcs::CompaDraw()
292292
font->SetScaleY(kCompaOne);
293293
font->DrawInit();
294294

295-
font->SetColor(CColor(0xFF, 0xFF, 0xFF, static_cast<signed char>(kCompaColorMax * compaList->entries[0].alpha)).color);
295+
font->SetColor(CColor(0xFF, 0xFF, 0xFF, static_cast<unsigned char>(kCompaColorMax * compaList->entries[0].alpha)).color);
296296

297297
const CCaravanWork* nameWork = reinterpret_cast<const CCaravanWork*>(Game.m_scriptFoodBase[0]);
298298
drawIndex = 0;

0 commit comments

Comments
 (0)