Skip to content

Commit 23a7a22

Browse files
committed
kvc: Correctly write color when compiling
1 parent 2338129 commit 23a7a22

1 file changed

Lines changed: 16 additions & 0 deletions

File tree

utils/kvc/kvc_paintkit.cpp

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -250,13 +250,29 @@ static void SaveToFile_R( KeyValues *pkv, IBaseFileSystem *pFileSystem, FileHand
250250
{
251251
char szTmpBuf[32] = {};
252252
const Color c = pkv->GetColor();
253+
253254
V_to_chars( szTmpBuf, c.r() );
255+
// dimhotepus: Fix writing color components.
256+
nStrLen = V_strlen( szTmpBuf );
257+
pFileSystem->Write( szTmpBuf, nStrLen, hFile );
254258
pFileSystem->Write( " ", 1, hFile );
259+
255260
V_to_chars( szTmpBuf, c.g() );
261+
// dimhotepus: Fix writing color components.
262+
nStrLen = V_strlen( szTmpBuf );
263+
pFileSystem->Write( szTmpBuf, nStrLen, hFile );
256264
pFileSystem->Write( " ", 1, hFile );
265+
257266
V_to_chars( szTmpBuf, c.b() );
267+
// dimhotepus: Fix writing color components.
268+
nStrLen = V_strlen( szTmpBuf );
269+
pFileSystem->Write( szTmpBuf, nStrLen, hFile );
258270
pFileSystem->Write( " ", 1, hFile );
271+
259272
V_to_chars( szTmpBuf, c.a() );
273+
// dimhotepus: Fix writing color components.
274+
nStrLen = V_strlen( szTmpBuf );
275+
pFileSystem->Write( szTmpBuf, nStrLen, hFile );
260276
break;
261277
}
262278
default:

0 commit comments

Comments
 (0)