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
ab1c4cb1
Unverified
Commit
ab1c4cb1
authored
Dec 20, 2018
by
Zach H
Committed by
GitHub
Dec 20, 2018
Browse files
Use scryfall urls (#3474)
parent
4616dd47
Changes
2
Hide whitespace changes
Inline
Side-by-side
cockatrice/src/pictureloader.cpp
View file @
ab1c4cb1
...
...
@@ -25,6 +25,10 @@
// never cache more than 300 cards at once for a single deck
#define CACHED_CARD_PER_DECK_MAX 300
// Other URLs we can use (TODO: Make this less messy)
#define GATHERER_DEFAULT "http://gatherer.wizards.com/Handlers/Image.ashx?multiverseid=!cardid!&type=card"
#define GATHERER_FALLBACK "http://gatherer.wizards.com/Handlers/Image.ashx?name=!name!&type=card"
class
PictureToLoad
::
SetDownloadPriorityComparator
{
public:
...
...
@@ -48,6 +52,8 @@ PictureToLoad::PictureToLoad(CardInfoPtr _card) : card(std::move(_card))
/* #2479 will expand this into a list of Urls */
urlTemplates
.
append
(
settingsCache
->
getPicUrl
());
urlTemplates
.
append
(
settingsCache
->
getPicUrlFallback
());
urlTemplates
.
append
(
GATHERER_DEFAULT
);
urlTemplates
.
append
(
GATHERER_FALLBACK
);
if
(
card
)
{
sortedSets
=
card
->
getSets
();
...
...
cockatrice/src/settingscache.h
View file @
ab1c4cb1
...
...
@@ -13,9 +13,10 @@
class
ReleaseChannel
;
// the falbacks are used for cards without a muid
#define PIC_URL_DEFAULT "http://gatherer.wizards.com/Handlers/Image.ashx?multiverseid=!cardid!&type=card"
#define PIC_URL_FALLBACK "http://gatherer.wizards.com/Handlers/Image.ashx?name=!name!&type=card"
// Fallbacks used for cards w/o MultiverseId
#define PIC_URL_DEFAULT "https://api.scryfall.com/cards/multiverse/!cardid!?format=image"
#define PIC_URL_FALLBACK "https://api.scryfall.com/cards/named?fuzzy=!name!&format=image"
// size should be a multiple of 64
#define PIXMAPCACHE_SIZE_DEFAULT 2047
#define PIXMAPCACHE_SIZE_MIN 64
...
...
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