Skip to content

Commit

Permalink
Increasing max picture size for player icons.
Browse files Browse the repository at this point in the history
(200px BigIcon.png, 100 Kibibytes; 900px Picture.png)
  • Loading branch information
Somebodyisnobody committed Mar 2, 2022
1 parent dcbaf45 commit f53fb64
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/C4Constants.h
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,8 @@ const int C4SymbolSize = 35,
C4SymbolBorder = 5,
C4UpperBoardHeight = 50,
C4PictureSize = 64,
C4MaxPictureSize = 150,
C4MaxBigIconSize = 64;
C4MaxPictureSize = 900,
C4MaxBigIconSize = 200;

const int C4P_MaxPosition = 4;

Expand Down
5 changes: 4 additions & 1 deletion src/C4Network2Res.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1188,7 +1188,10 @@ bool C4Network2Res::OptimizeStandalone(bool fSilent)
size_t iBigIconSize = 0;
if (Grp.FindEntry(C4CFN_BigIcon, nullptr, &iBigIconSize))
if (iBigIconSize > C4NetResMaxBigicon * 1024)
Grp.Delete(C4CFN_BigIcon);
{
Grp.Delete(C4CFN_BigIcon);
LogF("OptimizeStandalone: BigIcon is too large! Maximum allowed file size is %" PRId32 " Kibibytes. Deleting BigIcon.png for distribution of the player file in network.", C4NetResMaxBigicon);
}
Grp.Close();
}
return true;
Expand Down
2 changes: 1 addition & 1 deletion src/C4Network2Res.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ const int32_t C4NetResDiscoverTimeout = 10, // (s)
C4NetResMaxLoad = 20,
C4NetResLoadTimeout = 60, // (s)
C4NetResDeleteTime = 60, // (s)
C4NetResMaxBigicon = 20; // maximum size, in KB, of bigicon
C4NetResMaxBigicon = 100; // maximum size, in KB, of bigicon

const int32_t C4NetResIDAnonymous = -2;

Expand Down

0 comments on commit f53fb64

Please sign in to comment.