Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Donald Haase
Cockatrice
Commits
6f69485f
Commit
6f69485f
authored
Apr 08, 2015
by
Zach
Browse files
Merge pull request #911 from ctrlaltca/fix_67
Large decks (up to 8000-ish cards) no longer make client crash; Fix #67
parents
0b4b8e85
0a366d75
Changes
2
Hide whitespace changes
Inline
Side-by-side
cockatrice/src/abstractcarditem.cpp
View file @
6f69485f
...
...
@@ -91,7 +91,10 @@ void AbstractCardItem::paintPicture(QPainter *painter, const QSizeF &translatedS
CardInfo
*
imageSource
=
facedown
?
db
->
getCard
()
:
info
;
QPixmap
translatedPixmap
;
imageSource
->
getPixmap
(
translatedSize
.
toSize
(),
translatedPixmap
);
// don't even spend time trying to load the picture if our size is too small
if
(
translatedSize
.
width
()
>
10
)
imageSource
->
getPixmap
(
translatedSize
.
toSize
(),
translatedPixmap
);
painter
->
save
();
QColor
bgColor
=
Qt
::
transparent
;
if
(
translatedPixmap
.
isNull
())
{
...
...
cockatrice/src/carddatabase.cpp
View file @
6f69485f
...
...
@@ -970,7 +970,9 @@ QStringList CardDatabase::getAllMainCardTypes() const
void
CardDatabase
::
cacheCardPixmaps
(
const
QStringList
&
cardNames
)
{
QPixmap
tmp
;
for
(
int
i
=
0
;
i
<
cardNames
.
size
();
++
i
)
// never cache more than 300 cards at once for a single deck
int
max
=
qMin
(
cardNames
.
size
(),
300
);
for
(
int
i
=
0
;
i
<
max
;
++
i
)
getCard
(
cardNames
[
i
])
->
loadPixmap
(
tmp
);
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment